You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1552 lines
48 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. <template>
  2. <div class="mod-config">
  3. <div>
  4. <span @click="favoriteFunction()">
  5. <icon-svg :name="favorite?'xiangqufill':'xiangqu'" class="sl-svg"></icon-svg>
  6. </span>
  7. </div>
  8. <el-form :inline="true" :model="querySysLanguagePack" @keyup.enter.native="getDataList()">
  9. <el-form-item :label="inputSearch1">
  10. <el-input style="width: 100px;" clearable placeholder="" v-model="mainQueryData.requisitionno"></el-input>
  11. </el-form-item>
  12. <el-form-item :label="inputSearch3">
  13. <el-input style="width: 100px;" clearable placeholder="" v-model="mainQueryData.partno"></el-input>
  14. </el-form-item>
  15. <el-form-item :label="inputSearch2">
  16. <el-select v-model="mainQueryData.orderType" placeholder="请选择" style="width: 100px;">
  17. <el-option
  18. key=""
  19. label="全部"
  20. value="">
  21. </el-option>
  22. <el-option
  23. v-for="item in orderTypeList"
  24. :key="item.baseData"
  25. :label="item.baseDesc"
  26. :value="item.baseDesc">
  27. </el-option>
  28. </el-select>
  29. <!-- <el-input style="width: 110px;" clearable placeholder="" v-model="mainQueryData.orderType"></el-input>-->
  30. </el-form-item>
  31. <el-form-item :label="inputSearch4">
  32. <el-select v-model="mainQueryData.authorizeFlag" style="width: 90px;">
  33. <el-option value="" label="全部"></el-option>
  34. <el-option value="Y" label="已审批"></el-option>
  35. <el-option value="N" label="未审批"></el-option>
  36. </el-select>
  37. </el-form-item>
  38. <el-form-item :label="inputSearch12">
  39. <el-select v-model="mainQueryData.approveresult" style="width: 110px;">
  40. <el-option value="" label="全部"></el-option>
  41. <el-option value="审批全通过" label="审批全通过"></el-option>
  42. <el-option value="审批未通过" label="审批未通过"></el-option>
  43. <el-option value="审批部分通过" label="审批部分通过"></el-option>
  44. </el-select>
  45. </el-form-item>
  46. <el-form-item>
  47. <el-button @click="getDataList('Y')" type="primary">{{ buttons.search }}</el-button>
  48. <el-button @click="initAddModel(null)" type="primary">{{ buttons.addLabelName }}</el-button>
  49. <el-button @click="saveColumnList()" type="primary" v-show="showDefault">{{ buttons.defaultTable }}
  50. </el-button>
  51. <el-button @click="userSetting()" type="primary">{{ buttons.settingTable }}</el-button>
  52. <download-excel
  53. :fields="fields()"
  54. :data="exportData"
  55. type="xls"
  56. :name="exportName"
  57. :header="exportHeader"
  58. :footer="exportFooter"
  59. :defaultValue="exportDefaultValue"
  60. :fetch="createExportData"
  61. :before-generate="startDownload"
  62. :before-finish="finishDownload"
  63. worksheet="导出信息"
  64. class="el-button el-button--primary el-button--medium">
  65. {{ buttons.download }}
  66. </download-excel>
  67. <el-button v-if="isAuth(':prd:delete')" type="danger" @click="deleteHandle()"
  68. :disabled="dataListSelections.length <= 0">{{ buttons.deleteList }}
  69. </el-button>
  70. </el-form-item>
  71. </el-form>
  72. <el-table
  73. :height="height"
  74. :data="dataList"
  75. border
  76. v-loading="dataListLoading"
  77. @selection-change="selectionChangeHandle"
  78. style="width: 100%;">
  79. <el-table-column
  80. v-for="(item,index) in columnList" :key="index"
  81. :sortable="item.columnSortable"
  82. :prop="item.columnProp"
  83. :header-align="item.headerAlign"
  84. :show-overflow-tooltip="item.showOverflowTooltip"
  85. :align="item.align"
  86. :fixed="item.fixed"
  87. :width="item.columnWidth"
  88. :label="item.columnLabel">
  89. <template slot-scope="scope">
  90. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  91. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  92. style="width: 100px; height: 80px"/></span>
  93. </template>
  94. </el-table-column>
  95. <el-table-column
  96. fixed="right"
  97. header-align="center"
  98. align="center"
  99. width="120"
  100. :label="buttons.operating">
  101. <template slot-scope="scope">
  102. <a v-if="scope.row.authorizeFlag == 'N'" @click="initAddModel(scope.row)">{{ buttons.edit }}</a>
  103. <a v-if="scope.row.authorizeFlag == 'N'" @click="updateAuthorizeFlag(scope.row)">{{ buttons.close }}</a>
  104. <a
  105. v-if="scope.row.authorizeFlag == 'Y' && scope.row.approvedFlag != 'Y' && scope.row.approveresult == '审批未通过'"
  106. @click="initReapply(scope.row)">{{ buttons.reapply }}</a>
  107. <a @click="initReviewDetails(scope.row.requisitionno)">{{ buttons.reviewDetails }}</a>
  108. </template>
  109. </el-table-column>
  110. </el-table>
  111. <el-pagination
  112. @size-change="sizeChangeHandle"
  113. @current-change="currentChangeHandle"
  114. :current-page="pageIndex"
  115. :page-sizes="[10, 50, 200, 10000]"
  116. :page-size="pageSize"
  117. :total="totalPage"
  118. layout="total, sizes, prev, pager, next, jumper">
  119. </el-pagination>
  120. <el-dialog :close-on-click-modal="false" :show-close="false" :close-on-press-escape="false" title="设置table列"
  121. :visible.sync="visible" width="1000px" v-drag>
  122. <el-form @keyup.enter.native="updateColumnList()"
  123. v-model="userColumnList"
  124. inline="inline"
  125. size="mini"
  126. label-width="80px">
  127. <el-form-item v-for="(item,index) in userColumnList"
  128. :key="item.columnProp"
  129. :label="item.columnLabel"
  130. :prop="item.columnProp">
  131. <el-form-item>
  132. 排序
  133. <el-input-number v-model="item.sortLv" controls-position="right" size="mini" :min="0"
  134. :max="10"></el-input-number>
  135. </el-form-item>
  136. <el-form-item>
  137. <el-switch
  138. v-model="item.status"
  139. active-text="显示"
  140. inactive-text="隐藏">
  141. </el-switch>
  142. </el-form-item>
  143. <el-form-item>
  144. <el-switch
  145. v-model="item.columnSortable"
  146. active-text="排序"
  147. inactive-text="不排序">
  148. </el-switch>
  149. </el-form-item>
  150. <el-form-item>
  151. <el-switch
  152. v-model="item.fixed"
  153. active-text="固定"
  154. inactive-text="不固定">
  155. </el-switch>
  156. </el-form-item>
  157. <el-form-item>
  158. 宽度
  159. <el-input-number v-model="item.columnWidth" controls-position="right" size="mini" :min="0"
  160. :max="1000"></el-input-number>
  161. </el-form-item>
  162. </el-form-item>
  163. </el-form>
  164. <span slot="footer" class="dialog-footer">
  165. <el-button @click="visible = false">取消</el-button>
  166. <el-button type="primary" @click="updateColumnList()">确定</el-button>
  167. </span>
  168. </el-dialog>
  169. <el-dialog title="申请单信息" :visible.sync="addPRDetailFlag" width="672px" :close-on-click-modal="false"
  170. :close-on-press-escape="false" v-drag>
  171. <el-form :inline="true" label-position="top">
  172. <el-form-item :label="inputSearch5">
  173. <el-select v-model="currentPRDetailData.orderType" placeholder="请选择" filterable style="width: 143px">
  174. <el-option
  175. v-for="(item ,index) in orderTypeList"
  176. :key="index"
  177. :label="item.baseDesc"
  178. :value="item.baseData"
  179. >
  180. </el-option>
  181. </el-select>
  182. </el-form-item>
  183. <el-form-item :label="inputSearch10">
  184. <el-select v-model="currentPRDetailData.supplierid" filterable placeholder="请选择" style="width: 143px">
  185. <el-option
  186. v-for="(item ,index) in supplierList"
  187. :key="index"
  188. :label="item.suppliername"
  189. :value="item.supplierid"
  190. >
  191. </el-option>
  192. </el-select>
  193. </el-form-item>
  194. <el-form-item :label="inputSearch6">
  195. <el-input style="text-align: left;width: 143px" onkeyup="this.value = this.value.toUpperCase()"
  196. v-model="currentPRDetailData.partno"></el-input>
  197. </el-form-item>
  198. <el-form-item :label="inputSearch11">
  199. <el-input style="text-align: left;width: 143px" v-model="currentPRDetailData.partdesc"></el-input>
  200. </el-form-item>
  201. <el-form-item :label="inputSearch7">
  202. <el-input style="text-align: left;width: 143px" @change="getNumber()"
  203. oninput="value=value.replace(/^\.+|[^\d.]/g,'')"
  204. v-model="currentPRDetailData.qty"></el-input>
  205. </el-form-item>
  206. <el-form-item :label="inputSearch8">
  207. <el-input style="text-align: left;width: 143px" v-model="currentPRDetailData.price" @change="getNumber()"
  208. oninput="value=value.replace(/^\.+|[^\d.]/g,'')"></el-input>
  209. </el-form-item>
  210. <el-form-item :label="inputSearch9">
  211. <el-input style="text-align: left;width: 143px"
  212. v-model="currentPRDetailData.totalPrice"
  213. :disabled="true"></el-input>
  214. </el-form-item>
  215. <el-form-item style="margin-top: 30px">
  216. <upload v-on:childByValue="childByValue"></upload>
  217. </el-form-item>
  218. <el-table
  219. height="170"
  220. :data="fileList"
  221. border
  222. v-loading="dataListLoading"
  223. @selection-change="selectionChangeHandle"
  224. style="width: 100%;">
  225. <el-table-column
  226. v-for="(item,index) in columnList2" :key="index"
  227. :sortable="item.columnSortable"
  228. :prop="item.columnProp"
  229. :header-align="item.headerAlign"
  230. :show-overflow-tooltip="item.showOverflowTooltip"
  231. :align="item.align"
  232. :fixed="item.fixed"
  233. :width="item.columnWidth"
  234. :label="item.columnLabel">
  235. <template slot-scope="scope">
  236. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  237. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  238. style="width: 100px; height: 80px"/></span>
  239. </template>
  240. </el-table-column>
  241. <el-table-column
  242. header-align="center"
  243. align="center"
  244. width="50"
  245. :label="buttons.operating">
  246. <template slot-scope="scope">
  247. <a @click="fileDownload(scope.row)">{{ buttons.fileDownload }}</a>
  248. </template>
  249. </el-table-column>
  250. </el-table>
  251. </el-form>
  252. <span slot="footer" class="dialog-footer">
  253. <el-button @click="addPRDetailFlag = false">取消</el-button>
  254. <el-button type="primary" :disabled="bannersBut" @click="savePRDetail()">确定</el-button>
  255. </span>
  256. </el-dialog>
  257. <el-dialog title="申请单审核" :visible.sync="reviewDetailsFlag" width="1208px" :close-on-click-modal="false"
  258. v-drag>
  259. <el-table
  260. :height="height"
  261. :data="reviewDetailsList"
  262. border
  263. v-loading="dataListLoading"
  264. @selection-change="selectionChangeHandle"
  265. style="width: 100%;">
  266. <el-table-column
  267. v-for="(item,index) in columnList1" :key="index"
  268. :sortable="item.columnSortable"
  269. :prop="item.columnProp"
  270. :header-align="item.headerAlign"
  271. :show-overflow-tooltip="item.showOverflowTooltip"
  272. :align="item.align"
  273. :fixed="item.fixed"
  274. :width="item.columnWidth"
  275. :label="item.columnLabel">
  276. <template slot-scope="scope">
  277. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  278. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  279. style="width: 100px; height: 80px"/></span>
  280. </template>
  281. </el-table-column>
  282. </el-table>
  283. </el-dialog>
  284. </div>
  285. </template>
  286. <script>
  287. import {
  288. searchSysLanguagePackList,
  289. searchSysLanguageParam,
  290. searchFunctionButtonList,
  291. saveButtonList,
  292. searchSysLanguage,
  293. searchLanguageListByLanguageCode,
  294. saveSysLanguageOne
  295. } from "@/api/sysLanguage.js"
  296. import {
  297. saveTableDefaultList,
  298. saveTableUser,
  299. getTableDefaultListLanguage,
  300. getTableUserListLanguage
  301. } from "@/api/table.js"
  302. import {
  303. userFavoriteList, saveUserFavorite, removeUserFavorite
  304. } from '@/api/userFavorite.js'
  305. import {
  306. getPRHeaderList,
  307. getTblBaseDataList,
  308. savePRDetail,
  309. getSupplierList,
  310. getExportList,
  311. authorizationHistList,
  312. updatePRHeaderAuthorizeFlag,
  313. downFtpFile,
  314. getFileList,
  315. } from '@/api/purchaseorder/purchaseRequisition.js'
  316. import upload from "../common/upload";
  317. import axios from "axios";
  318. import Vue from "vue";
  319. export default {
  320. components: {upload},
  321. data() {
  322. return {
  323. insertFileList: [],
  324. fileList: [],
  325. // table 高度
  326. height: 0,
  327. bannersBut: false,
  328. addPRDetailFlag: false,
  329. inputSearch1: '申请单号',
  330. inputSearch2: '处理类型',
  331. inputSearch3: '刀模编码',
  332. inputSearch4: '是否审批',
  333. inputSearch5: '处理类型',
  334. inputSearch6: '刀模编码',
  335. inputSearch7: '申请数量',
  336. inputSearch8: '预估单价',
  337. inputSearch9: '预估总价',
  338. inputSearch10: '供应商名称',
  339. inputSearch11: '刀模名称',
  340. inputSearch12: '审批结果',
  341. currentPRDetailData: {
  342. username: this.$store.state.user.name,
  343. requisitionno: '',
  344. site: this.$store.state.user.site,
  345. itemno: '',
  346. supplierid: '',
  347. suppliername: '',
  348. orderType: '',
  349. partno: '',
  350. partdesc: '',
  351. qty: 0,
  352. price: 0,
  353. totalPrice: 0,
  354. convertFactor: 0,
  355. currency: '',
  356. status: '',
  357. taxcode: '',
  358. currencyRate: 1,
  359. additionalCose: 0,
  360. orderref1: '',
  361. orderref2: '',
  362. sysOssEntityList: [],
  363. },
  364. mainQueryData: {
  365. requisitionno: '',
  366. orderType: '',
  367. partno: '',
  368. authorizeFlag: 'N',
  369. approveresult: '',
  370. site: this.$store.state.user.site,
  371. userId: this.$store.state.user.name,
  372. limit: '',
  373. page: '',
  374. },
  375. userId: this.$store.state.user.name,
  376. site: this.$store.state.user.site,
  377. //审核详情
  378. reviewDetailsFlag: false,
  379. //审核显示list
  380. reviewDetailsList: [],
  381. // 是否收藏
  382. favorite: false,
  383. addLanguage: false,
  384. functionId: 2001,
  385. tableId: "common1001",
  386. value1: true,
  387. visible: false,
  388. showDefault: false,
  389. // 默认table 查询参数
  390. queryTable: {
  391. functionId: 2001,
  392. tableId: 'PRHeaderTable',
  393. languageCode: this.$i18n.locale
  394. },
  395. // 用户table 查询参数
  396. queryTableUser: {
  397. userId: this.$store.state.user.name,
  398. functionId: 2001,
  399. tableId: "PRHeaderTable",
  400. status: true,
  401. languageCode: this.$i18n.locale
  402. },
  403. // 语言词典查询参数
  404. querySysLanguageParam: {
  405. languageCode: this.$i18n.locale
  406. },
  407. // 语言词典集合
  408. sysLanguageParams: [],
  409. // 用户table 配置集合
  410. userColumnList: [],
  411. // 展示列集
  412. columnList: [
  413. {
  414. userId: this.$store.state.user.name,
  415. functionId: 2001,
  416. serialNumber: 'PRHeader2001RequisitionNo',
  417. tableId: "PRHeaderTable",
  418. tableName: "PRHeader",
  419. columnProp: "requisitionno",
  420. headerAlign: "center",
  421. align: "center",
  422. columnLabel: "申请单单号",
  423. columnHidden: false,
  424. columnImage: false,
  425. columnSortable: false,
  426. sortLv: 0,
  427. status: true,
  428. fixed: false
  429. },
  430. {
  431. userId: this.$store.state.user.name,
  432. functionId: 2001,
  433. serialNumber: 'PRHeader2001OrderType',
  434. tableId: "PRHeaderTable",
  435. tableName: "PRHeader",
  436. columnProp: "orderType",
  437. headerAlign: "center",
  438. align: "center",
  439. columnLabel: "处理类型",
  440. columnHidden: false,
  441. columnImage: false,
  442. columnSortable: false,
  443. sortLv: 0,
  444. status: true,
  445. fixed: false
  446. },
  447. {
  448. userId: this.$store.state.user.name,
  449. functionId: 2001,
  450. serialNumber: 'PRHeader2001Partno',
  451. tableId: "PRHeaderTable",
  452. tableName: "PRHeader",
  453. columnProp: "partno",
  454. headerAlign: "center",
  455. align: "center",
  456. columnLabel: "刀模编码",
  457. columnHidden: false,
  458. columnImage: false,
  459. columnSortable: false,
  460. sortLv: 0,
  461. status: true,
  462. fixed: false
  463. },
  464. {
  465. userId: this.$store.state.user.name,
  466. functionId: 2001,
  467. serialNumber: 'PRHeader2001Partdesc',
  468. tableId: "PRHeaderTable",
  469. tableName: "PRHeader",
  470. columnProp: "partdesc",
  471. headerAlign: "center",
  472. align: "center",
  473. columnLabel: "刀模名称",
  474. columnHidden: false,
  475. columnImage: false,
  476. columnSortable: false,
  477. sortLv: 0,
  478. status: true,
  479. fixed: false
  480. },
  481. {
  482. userId: this.$store.state.user.name,
  483. functionId: 2001,
  484. serialNumber: 'PRHeader2001Qty',
  485. tableId: "PRHeaderTable",
  486. tableName: "PRHeader",
  487. columnProp: "qty",
  488. headerAlign: "center",
  489. align: "center",
  490. columnLabel: "申请数量",
  491. columnHidden: false,
  492. columnImage: false,
  493. columnSortable: false,
  494. sortLv: 0,
  495. status: true,
  496. fixed: false
  497. },
  498. {
  499. userId: this.$store.state.user.name,
  500. functionId: 2001,
  501. serialNumber: 'PRHeader2001Price',
  502. tableId: "PRHeaderTable",
  503. tableName: "PRHeader",
  504. columnProp: "price",
  505. headerAlign: "center",
  506. align: "center",
  507. columnLabel: "预估价格",
  508. columnHidden: false,
  509. columnImage: false,
  510. columnSortable: false,
  511. sortLv: 0,
  512. status: true,
  513. fixed: false
  514. },
  515. {
  516. userId: this.$store.state.user.name,
  517. functionId: 2001,
  518. serialNumber: 'PRHeader2001TotalPrice',
  519. tableId: "PRHeaderTable",
  520. tableName: "PRHeader",
  521. columnProp: "totalPrice",
  522. headerAlign: "center",
  523. align: "center",
  524. columnLabel: "预估总价",
  525. columnHidden: false,
  526. columnImage: false,
  527. columnSortable: false,
  528. sortLv: 0,
  529. status: true,
  530. fixed: false
  531. },
  532. {
  533. userId: this.$store.state.user.name,
  534. functionId: 2001,
  535. serialNumber: 'PRHeader2001Supplierid',
  536. tableId: "PRHeaderTable",
  537. tableName: "PRHeader",
  538. columnProp: "supplierid",
  539. headerAlign: "center",
  540. align: "center",
  541. columnLabel: "供应商编码",
  542. columnHidden: false,
  543. columnImage: false,
  544. columnSortable: false,
  545. sortLv: 0,
  546. status: true,
  547. fixed: false
  548. },
  549. {
  550. userId: this.$store.state.user.name,
  551. functionId: 2001,
  552. serialNumber: 'PRHeader2001Suppliername',
  553. tableId: "PRHeaderTable",
  554. tableName: "PRHeader",
  555. columnProp: "suppliername",
  556. headerAlign: "center",
  557. align: "center",
  558. columnLabel: "供应商名称",
  559. columnHidden: false,
  560. columnImage: false,
  561. columnSortable: false,
  562. sortLv: 0,
  563. status: true,
  564. fixed: false
  565. },
  566. {
  567. userId: this.$store.state.user.name,
  568. functionId: 2001,
  569. serialNumber: 'PRHeader2001AuthorizeFlag',
  570. tableId: "PRHeaderTable",
  571. tableName: "PRHeader",
  572. columnProp: "strAuthorizeFlag",
  573. headerAlign: "center",
  574. align: "center",
  575. columnLabel: "是否审批",
  576. columnHidden: false,
  577. columnImage: false,
  578. columnSortable: false,
  579. sortLv: 0,
  580. status: true,
  581. fixed: false
  582. },
  583. {
  584. userId: this.$store.state.user.name,
  585. functionId: 2101,
  586. serialNumber: 'review2101AuthorizeFlag',
  587. tableId: "review2101",
  588. tableName: "PRHeader",
  589. columnProp: "approveresult",
  590. headerAlign: "center",
  591. align: "left",
  592. columnLabel: "审批结果",
  593. columnHidden: false,
  594. columnImage: false,
  595. columnSortable: false,
  596. sortLv: 0,
  597. status: true,
  598. fixed: false
  599. },
  600. ],
  601. // 展示列集
  602. columnList1: [
  603. {
  604. userId: this.$store.state.user.name,
  605. functionId: 2001,
  606. tableId: "reviewDetails2001",
  607. tableName: "reviewDetails",
  608. columnProp: "stepId",
  609. headerAlign: "center",
  610. align: "center",
  611. columnLabel: "审批步骤号",
  612. columnHidden: false,
  613. columnImage: false,
  614. columnSortable: false,
  615. sortLv: 0,
  616. status: true,
  617. fixed: false,
  618. },
  619. {
  620. userId: this.$store.state.user.name,
  621. functionId: 2001,
  622. tableId: "reviewDetails2001",
  623. tableName: "reviewDetails",
  624. columnProp: "authTypeDb",
  625. headerAlign: "center",
  626. align: "center",
  627. columnLabel: "类型",
  628. columnHidden: false,
  629. columnImage: false,
  630. columnSortable: false,
  631. sortLv: 0,
  632. status: true,
  633. fixed: false
  634. },
  635. {
  636. userId: this.$store.state.user.name,
  637. functionId: 2001,
  638. tableId: "reviewDetails2001",
  639. tableName: "reviewDetails",
  640. columnProp: "userName",
  641. headerAlign: "center",
  642. align: "center",
  643. columnLabel: "账号",
  644. columnHidden: false,
  645. columnImage: false,
  646. columnSortable: false,
  647. sortLv: 0,
  648. status: true,
  649. fixed: false,
  650. },
  651. {
  652. userId: this.$store.state.user.name,
  653. functionId: 2001,
  654. tableId: "reviewDetails2001",
  655. tableName: "reviewDetails",
  656. columnProp: "userDisplay",
  657. headerAlign: "center",
  658. align: "center",
  659. columnLabel: "用户名称",
  660. columnHidden: false,
  661. columnImage: false,
  662. columnSortable: false,
  663. sortLv: 0,
  664. status: true,
  665. fixed: false,
  666. },
  667. {
  668. userId: this.$store.state.user.name,
  669. functionId: 2001,
  670. tableId: "reviewDetails2001",
  671. tableName: "reviewDetails",
  672. columnProp: "authRuleId",
  673. headerAlign: "center",
  674. align: "center",
  675. columnLabel: "审批组编码",
  676. columnHidden: false,
  677. columnImage: false,
  678. columnSortable: false,
  679. sortLv: 0,
  680. status: true,
  681. fixed: false,
  682. },
  683. {
  684. userId: this.$store.state.user.name,
  685. functionId: 2001,
  686. tableId: "reviewDetails2001",
  687. tableName: "reviewDetails",
  688. columnProp: "strRuleDesc",
  689. headerAlign: "center",
  690. align: "center",
  691. columnLabel: "审批组名称",
  692. columnHidden: false,
  693. columnImage: false,
  694. columnSortable: false,
  695. sortLv: 0,
  696. status: true,
  697. fixed: false,
  698. },
  699. {
  700. userId: this.$store.state.user.name,
  701. functionId: 2001,
  702. tableId: "reviewDetails2001",
  703. tableName: "reviewDetails",
  704. columnProp: "strActAuthorizator",
  705. headerAlign: "center",
  706. align: "center",
  707. columnLabel: "最终审批人",
  708. columnHidden: false,
  709. columnImage: false,
  710. columnSortable: false,
  711. sortLv: 0,
  712. status: true,
  713. fixed: false,
  714. },
  715. {
  716. userId: this.$store.state.user.name,
  717. functionId: 2001,
  718. tableId: "reviewDetails2001",
  719. tableName: "reviewDetails",
  720. columnProp: "actAuthorizeDate",
  721. headerAlign: "center",
  722. align: "center",
  723. columnLabel: "最终审批时间",
  724. columnHidden: false,
  725. columnImage: false,
  726. columnSortable: false,
  727. sortLv: 0,
  728. status: true,
  729. fixed: false,
  730. columnWidth: 135,
  731. },
  732. {
  733. userId: this.$store.state.user.name,
  734. functionId: 2001,
  735. tableId: "reviewDetails2001",
  736. tableName: "reviewDetails",
  737. columnProp: "strCanAuthFlag",
  738. headerAlign: "center",
  739. align: "center",
  740. columnLabel: "是否可以审批",
  741. columnHidden: false,
  742. columnImage: false,
  743. columnSortable: false,
  744. sortLv: 0,
  745. status: true,
  746. fixed: false,
  747. },
  748. {
  749. userId: this.$store.state.user.name,
  750. functionId: 2001,
  751. tableId: "reviewDetails2001",
  752. tableName: "reviewDetails",
  753. columnProp: "strAuthFlag",
  754. headerAlign: "center",
  755. align: "center",
  756. columnLabel: "是否审批",
  757. columnHidden: false,
  758. columnImage: false,
  759. columnSortable: false,
  760. sortLv: 0,
  761. status: true,
  762. fixed: false,
  763. },
  764. {
  765. userId: this.$store.state.user.name,
  766. functionId: 2001,
  767. tableId: "reviewDetails2001",
  768. tableName: "reviewDetails",
  769. columnProp: "approveResult",
  770. headerAlign: "center",
  771. align: "center",
  772. columnLabel: "审批结果",
  773. columnHidden: false,
  774. columnImage: false,
  775. columnSortable: false,
  776. sortLv: 0,
  777. status: true,
  778. fixed: false,
  779. },
  780. {
  781. userId: this.$store.state.user.name,
  782. functionId: 2001,
  783. tableId: "reviewDetails2001",
  784. tableName: "reviewDetails",
  785. columnProp: "remark",
  786. headerAlign: "center",
  787. align: "center",
  788. columnLabel: "审批备注",
  789. columnHidden: false,
  790. columnImage: false,
  791. columnSortable: false,
  792. sortLv: 0,
  793. status: true,
  794. fixed: false,
  795. },
  796. ],
  797. // 展示列集
  798. columnList2: [
  799. {
  800. userId: this.$store.state.user.name,
  801. functionId: 2001,
  802. tableId: "fileDetail2001",
  803. tableName: "fileDetailTable",
  804. columnProp: "fileName",
  805. headerAlign: "center",
  806. align: "center",
  807. columnLabel: "文件名称",
  808. columnHidden: false,
  809. columnImage: false,
  810. columnSortable: false,
  811. sortLv: 0,
  812. status: true,
  813. fixed: false
  814. },
  815. {
  816. userId: this.$store.state.user.name,
  817. functionId: 2001,
  818. tableId: "fileDetail2001",
  819. tableName: "fileDetailTable",
  820. columnProp: "createDate",
  821. headerAlign: "center",
  822. align: "center",
  823. columnLabel: "创建时间",
  824. columnHidden: false,
  825. columnImage: false,
  826. columnSortable: false,
  827. sortLv: 0,
  828. status: true,
  829. fixed: false,
  830. columnWidth: 135,
  831. },
  832. {
  833. userId: this.$store.state.user.name,
  834. functionId: 2001,
  835. tableId: "fileDetail2001",
  836. tableName: "fileDetailTable",
  837. columnProp: "createdBy",
  838. headerAlign: "center",
  839. align: "center",
  840. columnLabel: "创建人",
  841. columnHidden: false,
  842. columnImage: false,
  843. columnSortable: false,
  844. sortLv: 0,
  845. status: true,
  846. fixed: false,
  847. columnWidth: 70,
  848. },
  849. ],
  850. // 数据集
  851. dataList: [],
  852. //选项
  853. orderTypeList: [],
  854. supplierList: [],
  855. queryButton: {
  856. functionId: 2001,
  857. table_id: 'common1001',
  858. languageCode: this.$i18n.locale,
  859. objectType: 'button'
  860. },
  861. buttons: {
  862. add: '添加',
  863. edit: '编辑',
  864. delete: '删除',
  865. deleteList: '批量删除',
  866. cz: '操作',
  867. search: '查询',
  868. download: '导出',
  869. settingTable: '设置列表',
  870. defaultTable: '设置默认配置',
  871. addLabelName: '新增',
  872. operating: '操作',
  873. reviewDetails: "审批详情",
  874. close: '关闭',
  875. fileDownload: '下载',
  876. reapply: '重新申请',
  877. },
  878. // 导出 start
  879. exportData: [],
  880. exportDataStandard: {
  881. "功能编码": "functionId",
  882. "序列化编码": "objectId",
  883. "类型": "objectType",
  884. "语言值": "languageValue"
  885. },
  886. exportName: "刀申请",
  887. exportHeader: ["刀申请"],
  888. exportFooter: [],
  889. exportDefaultValue: "这一行这一列没有数据",
  890. // 导出 end
  891. buttonList: [
  892. // {
  893. // functionId: "9001",
  894. // languageValue: '添加',
  895. // objectId: 'add',
  896. // objectType: "button",
  897. // tableId: "common1001"
  898. // },
  899. // {
  900. // functionId: "9001",
  901. // languageValue: '编辑',
  902. // objectId: 'edit',
  903. // objectType: "button",
  904. // tableId: "common1001"
  905. // },
  906. // {
  907. // functionId: "9001",
  908. // languageValue: '删除',
  909. // objectId: 'delete',
  910. // objectType: "button",
  911. // tableId: "common1001"
  912. // },
  913. // {
  914. // functionId: "9001",
  915. // languageValue: '批量删除',
  916. // objectId: 'deleteList',
  917. // objectType: "button",
  918. // tableId: "common1001"
  919. // },
  920. // {
  921. // functionId: "9001",
  922. // languageValue: '操作',
  923. // objectId: 'cz',
  924. // objectType: "button",
  925. // tableId: "common1001"
  926. // },
  927. // {
  928. // functionId: "9001",
  929. // languageValue: '查询',
  930. // objectId: 'search',
  931. // objectType: "button",
  932. // tableId: "common1001"
  933. // },
  934. // {
  935. // functionId: "9001",
  936. // languageValue: '导出',
  937. // objectId: 'download',
  938. // objectType: "button",
  939. // tableId: "common1001"
  940. // },
  941. // {
  942. // functionId: "9001",
  943. // languageValue: '设置列表',
  944. // objectId: 'settingTable',
  945. // objectType: "button",
  946. // tableId: "common1001"
  947. // },
  948. // {
  949. // functionId: "9001",
  950. // languageValue: '设置默认配置',
  951. // objectId: 'defaultTable',
  952. // objectType: "button",
  953. // tableId: "common1001"
  954. // }
  955. ],
  956. languageList: [],
  957. languageColumnList: [],
  958. languageDataList: [],
  959. queryLanguage: {},
  960. // 数据集条件
  961. querySysLanguagePack: {
  962. page: 1,
  963. limit: 1,
  964. languageValue: '',
  965. objectType: '',
  966. objectId: ''
  967. },
  968. //
  969. // 分页
  970. pageIndex: 1,
  971. pageSize: 10,
  972. totalPage: 0,
  973. dataListLoading: false,
  974. dataListSelections: [],
  975. addOrUpdateVisible: false,
  976. }
  977. },
  978. mounted() {
  979. this.$nextTick(() => {
  980. this.height = window.innerHeight - 230;
  981. })
  982. },
  983. activated() {
  984. this.getDataList()
  985. this.getLanguageList()
  986. this.initTblBaseDataList()
  987. this.initSupplier()
  988. },
  989. methods: {
  990. //获取申请单号文件信息
  991. getFileList(row) {
  992. let jsonData = {
  993. site: row.site,
  994. type: 'PRFile',
  995. associatedField1: row.requisitionno
  996. }
  997. this.fileList = []
  998. getFileList(jsonData).then(({data}) => {
  999. if (data.code == 0) {
  1000. this.fileList = data.row
  1001. }
  1002. })
  1003. },
  1004. // 文件下载
  1005. fileDownload(row) {
  1006. axios.get('/api/ftp/file/downFtpFile/' + row.id, {
  1007. responseType: 'blob',
  1008. headers: {
  1009. 'Content-Type': 'application/json',
  1010. 'token':Vue.cookie.get('token')
  1011. }
  1012. }).then(({data}) => {
  1013. // 不限制文件下载类型
  1014. const blob = new Blob([data], {type: "application/octet-stream"})
  1015. // 下载文件名称
  1016. const fileName = row.fileName
  1017. // a标签下载
  1018. const linkNode = document.createElement('a')
  1019. linkNode.download = fileName // a标签的download属性规定下载文件的名称
  1020. linkNode.style.display = 'none'
  1021. linkNode.href = window.URL.createObjectURL(blob) // 生成一个Blob URL
  1022. document.body.appendChild(linkNode)
  1023. linkNode.click() // 模拟在按钮上的一次鼠标单击
  1024. URL.revokeObjectURL(linkNode.href) // 释放URL 对象
  1025. document.body.removeChild(linkNode)
  1026. })
  1027. },
  1028. childByValue(childValue) {
  1029. // childValue就是子组件传过来的值
  1030. this.fileList.push(childValue)
  1031. this.insertFileList.push(childValue)
  1032. },
  1033. updateAuthorizeFlag(row) {
  1034. let saveData = {
  1035. site: row.site,
  1036. requisitionno: row.requisitionno,
  1037. status: '已关闭',
  1038. authorizeFlag: 'Y',
  1039. approvedFlag: 'N',
  1040. }
  1041. updatePRHeaderAuthorizeFlag(saveData).then(({data}) => {
  1042. if (data.code == 0) {
  1043. this.getDataList()
  1044. }
  1045. this.$alert(data.msg, '操作提示', {
  1046. confirmButtonText: '确定',
  1047. callback: action => {
  1048. }
  1049. });
  1050. })
  1051. },
  1052. initReviewDetails(orderRef1) {
  1053. this.reviewDetailsFlag = true
  1054. this.reviewDetailsList = []
  1055. this.getAuthorizationHistList(orderRef1)
  1056. },
  1057. getAuthorizationHistList(orderRef1) {
  1058. let queryData = {
  1059. site: this.site,
  1060. orderRef1: orderRef1,
  1061. authRuleId: 5,
  1062. }
  1063. authorizationHistList(queryData).then(({data}) => {
  1064. this.reviewDetailsList = data.rows
  1065. })
  1066. },
  1067. getNumber() {
  1068. this.currentPRDetailData.totalPrice = this.decimalUtil.mul(this.currentPRDetailData.qty, this.currentPRDetailData.price)
  1069. },
  1070. savePRDetail() {
  1071. this.bannersBut = true
  1072. if (this.currentPRDetailData.orderType == null || this.currentPRDetailData.orderType.trim() === "") {
  1073. this.$alert('请选择处理类型!', '操作提示', {
  1074. confirmButtonText: '确定',
  1075. callback: action => {
  1076. this.bannersBut = false
  1077. }
  1078. });
  1079. return
  1080. } else if (this.currentPRDetailData.supplierid == null || this.currentPRDetailData.supplierid.trim() === "") {
  1081. this.$alert('请选择供应商名称!', '操作提示', {
  1082. confirmButtonText: '确定',
  1083. callback: action => {
  1084. this.bannersBut = false
  1085. }
  1086. });
  1087. return
  1088. } else if (this.currentPRDetailData.partno == null || this.currentPRDetailData.partno.trim() === "") {
  1089. this.$alert('请输入刀模编码!', '操作提示', {
  1090. confirmButtonText: '确定',
  1091. callback: action => {
  1092. this.bannersBut = false
  1093. }
  1094. });
  1095. return
  1096. } else if (this.currentPRDetailData.qty === 0 || this.currentPRDetailData.qty <= 0) {
  1097. this.$alert('请输入申请数量!', '操作提示', {
  1098. confirmButtonText: '确定',
  1099. callback: action => {
  1100. this.bannersBut = false
  1101. }
  1102. });
  1103. return
  1104. } else if (this.currentPRDetailData.price === 0 || this.currentPRDetailData.price <= 0) {
  1105. this.$alert('请输入预估单价!', '操作提示', {
  1106. confirmButtonText: '确定',
  1107. callback: action => {
  1108. this.bannersBut = false
  1109. }
  1110. });
  1111. return
  1112. } else if (this.currentPRDetailData.partDesc === 0 || this.currentPRDetailData.partDesc <= 0) {
  1113. this.$alert('请输入刀模名称!', '操作提示', {
  1114. confirmButtonText: '确定',
  1115. callback: action => {
  1116. this.bannersBut = false
  1117. }
  1118. });
  1119. return
  1120. }
  1121. let partNo = this.currentPRDetailData.partno.toUpperCase()
  1122. this.currentPRDetailData.partno = partNo
  1123. let filter = this.supplierList.filter(item => item.supplierid === this.currentPRDetailData.supplierid);
  1124. this.currentPRDetailData.suppliername = filter[0].suppliername
  1125. this.currentPRDetailData.currency = filter[0].currency
  1126. this.currentPRDetailData.taxcode = filter[0].taxcode
  1127. this.currentPRDetailData.fileType = 'PRFile'
  1128. this.currentPRDetailData.sysOssEntityList = this.insertFileList
  1129. savePRDetail(this.currentPRDetailData).then(({data}) => {
  1130. this.bannersBut = false
  1131. if (data.code == 0) {
  1132. this.bannersFlag = false
  1133. this.getDataList()
  1134. }
  1135. this.$alert(data.msg, '操作提示', {
  1136. confirmButtonText: '确定',
  1137. callback: action => {
  1138. if (data.code == 0) {
  1139. this.addPRDetailFlag = false
  1140. }
  1141. this.addPRDetailFlag = false
  1142. this.bannersBut = false
  1143. }
  1144. });
  1145. })
  1146. },
  1147. initSupplier() {
  1148. let queryData = {
  1149. site: this.site
  1150. }
  1151. getSupplierList(queryData).then(({data}) => {
  1152. this.supplierList = data.rows
  1153. })
  1154. },
  1155. initTblBaseDataList() {
  1156. let queryData = {
  1157. type: 'orderType'
  1158. }
  1159. getTblBaseDataList(queryData).then(({data}) => {
  1160. this.orderTypeList = data.rows
  1161. })
  1162. },
  1163. initReapply(row) {
  1164. this.currentPRDetailData.orderref1 = row.requisitionno
  1165. this.currentPRDetailData.orderref2 = row.itemno
  1166. this.initAddModel(null, 'Y')
  1167. },
  1168. initAddModel(row, val) {
  1169. this.fileList = []
  1170. this.insertFileList = []
  1171. if (row == null) {
  1172. this.currentPRDetailData.requisitionno = ''
  1173. this.currentPRDetailData.itemno = ''
  1174. this.currentPRDetailData.supplierid = ''
  1175. this.currentPRDetailData.suppliername = ''
  1176. this.currentPRDetailData.orderType = ''
  1177. this.currentPRDetailData.partno = ''
  1178. this.currentPRDetailData.qty = 0
  1179. this.currentPRDetailData.price = 0
  1180. this.currentPRDetailData.status = '已下达'
  1181. this.currentPRDetailData.taxCode = ''
  1182. this.currentPRDetailData.partdesc = ''
  1183. } else {
  1184. this.currentPRDetailData.requisitionno = row.requisitionno
  1185. this.currentPRDetailData.itemno = row.itemno
  1186. this.currentPRDetailData.supplierid = row.supplierid
  1187. this.currentPRDetailData.suppliername = row.suppliername
  1188. this.currentPRDetailData.orderType = row.orderType
  1189. this.currentPRDetailData.partno = row.partno
  1190. this.currentPRDetailData.qty = row.qty
  1191. this.currentPRDetailData.price = row.price
  1192. this.currentPRDetailData.status = ''
  1193. this.currentPRDetailData.taxCode = row.taxCode
  1194. this.currentPRDetailData.partDesc = row.partdesc
  1195. this.getFileList(row)
  1196. }
  1197. if (val != 'Y') {
  1198. this.currentPRDetailData.orderref1 = null
  1199. this.currentPRDetailData.orderref2 = null
  1200. }
  1201. this.getNumber()
  1202. this.bannersBut = false
  1203. this.addPRDetailFlag = true
  1204. },
  1205. // 校验用户是否收藏
  1206. favoriteIsOk() {
  1207. let userFavorite = {
  1208. userId: this.$store.state.user.id,
  1209. languageCode: this.$i18n.locale
  1210. }
  1211. userFavoriteList(userFavorite).then(({data}) => {
  1212. let size = data.list.filter(item => item.userId == userFavorite.menuId).length;
  1213. if (size > 0) {
  1214. this.favorite = true
  1215. } else {
  1216. this.favorite = false
  1217. }
  1218. })
  1219. },
  1220. // 收藏 OR 取消收藏
  1221. favoriteFunction() {
  1222. let userFavorite = {
  1223. userId: this.$store.state.user.id,
  1224. functionId: this.$route.meta.menuId,
  1225. }
  1226. if (this.favorite) {
  1227. // 取消收藏
  1228. this.$confirm(`确定取消收藏`, '提示', {
  1229. confirmButtonText: '确定',
  1230. cancelButtonText: '取消',
  1231. type: 'warning'
  1232. }).then(() => {
  1233. removeUserFavorite(userFavorite).then(({data}) => {
  1234. this.$message.success(data.msg)
  1235. this.favorite = false
  1236. })
  1237. })
  1238. } else {
  1239. // 收藏
  1240. saveUserFavorite(userFavorite).then(({data}) => {
  1241. this.$message.success(data.msg)
  1242. this.favorite = true
  1243. })
  1244. }
  1245. },
  1246. // 保存语言编辑
  1247. saveLanguageList(val) {
  1248. saveSysLanguageOne(val).then(({data}) => {
  1249. if (data.code == 0) {
  1250. this.$message.success(data.msg)
  1251. } else {
  1252. this.$message.error(data.msg)
  1253. }
  1254. })
  1255. },
  1256. // 编辑语言
  1257. addLanguageFun() {
  1258. if (this.querySysLanguagePack.languageCode) {
  1259. this.addLanguage = true
  1260. this.languageColumnList = []
  1261. let query = {
  1262. functionId: 2001,
  1263. tableId: "common1002",
  1264. languageCode: this.$i18n.locale
  1265. }
  1266. getTableDefaultListLanguage(query).then(({data}) => {
  1267. if (data.rows.length > 0) {
  1268. this.languageColumnList = data.rows
  1269. }
  1270. })
  1271. this.languageColumnList = this.columnList
  1272. searchLanguageListByLanguageCode(this.querySysLanguagePack).then(({data}) => {
  1273. this.languageDataList = data.rows
  1274. })
  1275. } else {
  1276. this.$message("请选中一种语言")
  1277. }
  1278. },
  1279. // 获取多语言列表
  1280. getLanguageList() {
  1281. searchSysLanguage(this.queryLanguage).then(({data}) => {
  1282. this.languageList = data.rows
  1283. })
  1284. },
  1285. // 获取button的词典
  1286. getFunctionButtonList() {
  1287. searchFunctionButtonList(this.queryButton).then(({data}) => {
  1288. if (data.data.length > 0) {
  1289. this.buttons = data.data
  1290. } else {
  1291. saveButtonList(this.buttonList).then(({data}) => {
  1292. })
  1293. }
  1294. })
  1295. },
  1296. // 获取语言词典
  1297. getSysLanguageParamList() {
  1298. searchSysLanguageParam(this.querySysLanguageParam).then(({data}) => {
  1299. this.sysLanguageParams = data.rows
  1300. })
  1301. },
  1302. // 打开页面设置
  1303. userSetting() {
  1304. this.visible = true;
  1305. this.getTableUserAll()
  1306. },
  1307. // 获取 用户的配置
  1308. getTableUserAll() {
  1309. let queryTable = {
  1310. userId: this.$store.state.user.name,
  1311. functionId: 2001,
  1312. tableId: "common1001",
  1313. languageCode: this.$i18n.locale
  1314. }
  1315. getTableUserListLanguage(queryTable).then(({data}) => {
  1316. if (data.code == 0) {
  1317. this.userColumnList = data.rows
  1318. if (data.rows.length <= 0) {
  1319. getTableDefaultListLanguage(this.queryTable).then(({data}) => {
  1320. this.userColumnList = data.rows
  1321. })
  1322. }
  1323. }
  1324. })
  1325. },
  1326. // 修改 table 列
  1327. updateColumnList() {
  1328. let userColumns = []
  1329. for (let column of this.userColumnList) {
  1330. let userColumn = {
  1331. userId: this.$store.state.user.name,
  1332. functionId: column.functionId,
  1333. tableId: column.tableId,
  1334. tableName: column.tableName,
  1335. columnProp: column.columnProp,
  1336. headerAlign: column.headerAlign,
  1337. align: column.align,
  1338. columnWidth: column.columnWidth,
  1339. columnLabel: column.columnLabel,
  1340. columnHidden: column.columnHidden,
  1341. columnImage: column.columnImage,
  1342. columnSortable: column.columnSortable,
  1343. format: column.format,
  1344. sortLv: column.sortLv,
  1345. status: column.status,
  1346. fixed: column.fixed,
  1347. serialNumber: column.serialNumber
  1348. }
  1349. userColumns.push(userColumn)
  1350. }
  1351. saveTableUser(userColumns).then(({data}) => {
  1352. if (data.code == 0) {
  1353. this.$message.success(data.msg)
  1354. this.visible = false
  1355. this.getTableUserColumn()
  1356. } else {
  1357. this.$message.error(data.msg)
  1358. }
  1359. })
  1360. },
  1361. // 获取 用户保存的 格式列
  1362. getTableUserColumn() {
  1363. getTableUserListLanguage(this.queryTableUser).then(({data}) => {
  1364. if (data.rows.length > 0) {
  1365. //this.columnList = []
  1366. this.columnList = data.rows
  1367. } else {
  1368. this.getColumnList()
  1369. }
  1370. })
  1371. },
  1372. // 保存 默认配置 列
  1373. saveColumnList() {
  1374. saveTableDefaultList(this.columnList).then(({data}) => {
  1375. if (data.code == 0) {
  1376. this.$message.success(data.msg)
  1377. this.showDefault = false
  1378. } else {
  1379. this.$message.error(data.msg)
  1380. }
  1381. })
  1382. saveTableDefaultList(this.columnList1).then(({data}) => {
  1383. if (data.code == 0) {
  1384. this.$message.success(data.msg)
  1385. this.showDefault = false
  1386. } else {
  1387. this.$message.error(data.msg)
  1388. }
  1389. })
  1390. this.getFunctionButtonList();
  1391. this.getColumnList()
  1392. },
  1393. // 获取 tableDefault 列
  1394. getColumnList() {
  1395. getTableDefaultListLanguage(this.queryTable).then(({data}) => {
  1396. if (!data.rows.length == 0) {
  1397. this.showDefault = false
  1398. this.columnList = data.rows
  1399. } else {
  1400. this.showDefault = true
  1401. }
  1402. })
  1403. },
  1404. // 获取数据列表
  1405. getDataList(val) {
  1406. this.dataListLoading = true
  1407. if (val == 'Y') {
  1408. this.pageIndex = 1
  1409. }
  1410. this.mainQueryData.limit = this.pageSize
  1411. this.mainQueryData.page = this.pageIndex
  1412. getPRHeaderList(this.mainQueryData).then(({data}) => {
  1413. if (data && data.code === 0) {
  1414. this.dataList = data.rows.list
  1415. this.totalPage = data.rows.totalCount
  1416. } else {
  1417. this.dataList = []
  1418. this.totalPage = 0
  1419. }
  1420. this.dataListLoading = false
  1421. })
  1422. },
  1423. // 每页数
  1424. sizeChangeHandle(val) {
  1425. this.pageSize = val
  1426. this.pageIndex = 1
  1427. this.getDataList()
  1428. },
  1429. // 当前页
  1430. currentChangeHandle(val) {
  1431. this.pageIndex = val
  1432. this.getDataList()
  1433. },
  1434. // 多选
  1435. selectionChangeHandle(val) {
  1436. this.dataListSelections = val
  1437. },
  1438. // 删除
  1439. deleteHandle(id) {
  1440. var ids = id ? [id] : this.dataListSelections.map(item => {
  1441. return item.id
  1442. })
  1443. this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
  1444. confirmButtonText: '确定',
  1445. cancelButtonText: '取消',
  1446. type: 'warning'
  1447. }).then(() => {
  1448. this.$http({
  1449. url: this.$http.adornUrl('//prd/delete'),
  1450. method: 'post',
  1451. data: this.$http.adornData(ids, false)
  1452. }).then(({data}) => {
  1453. if (data && data.code === 0) {
  1454. this.$message({
  1455. message: '操作成功',
  1456. type: 'success',
  1457. duration: 1500,
  1458. onClose: () => {
  1459. this.getDataList()
  1460. }
  1461. })
  1462. } else {
  1463. this.$message.error(data.msg)
  1464. }
  1465. })
  1466. })
  1467. },
  1468. createExportData() {
  1469. // 点击导出按钮之后,开始导出数据之前的执行函数,返回值为需要下载的数据
  1470. // TODO:构造需要下载的数据返回
  1471. getExportList(this.mainQueryData).then(({data}) => {
  1472. if (data && data.code === 0) {
  1473. return data.rows.list
  1474. }
  1475. return this.dataList;
  1476. })
  1477. },
  1478. startDownload() {
  1479. // this.exportData = this.dataList
  1480. console.log("数据开始")
  1481. },
  1482. finishDownload() {
  1483. console.log("数据下载完成")
  1484. },
  1485. fields() {
  1486. let json = "{"
  1487. this.columnList.forEach((item, index) => {
  1488. if (index == this.columnList.length - 1) {
  1489. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  1490. } else {
  1491. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  1492. }
  1493. })
  1494. json += "}"
  1495. let s = eval("(" + json + ")")
  1496. return s
  1497. },
  1498. },
  1499. created() {
  1500. this.getTableUserColumn()
  1501. this.getSysLanguageParamList()
  1502. this.getFunctionButtonList()
  1503. this.favoriteIsOk()
  1504. }
  1505. }
  1506. </script>
  1507. <style>
  1508. .sl-input {
  1509. background-color: transparent;
  1510. border: 0 !important;
  1511. font-size: 12px !important;
  1512. height: 12px !important;
  1513. line-height: 14px !important;
  1514. background-color: transparent !important;
  1515. width: 140px;
  1516. }
  1517. .sl-input:focus, textarea:focus {
  1518. outline: none;
  1519. }
  1520. .sl-svg {
  1521. overflow: hidden;
  1522. float: right;
  1523. }
  1524. </style>