冷凝胶前端
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.

984 lines
28 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div class="mod-config">
  3. <!-- 条件查询 -->
  4. <el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
  5. <el-form-item :label="'物料编码:'">
  6. <el-input v-model="searchData.partNo" clearable style="width: 120px"></el-input>
  7. </el-form-item>
  8. <el-form-item :label="'库位编码:'">
  9. <el-input v-model="searchData.locationId" clearable style="width: 120px"></el-input>
  10. </el-form-item>
  11. <el-form-item :label="'料号描述:'">
  12. <el-input v-model="searchData.partDesc" clearable style="width: 120px"></el-input>
  13. </el-form-item>
  14. <el-form-item :label="'卷号:'">
  15. <el-input v-model="searchData.rollNo" clearable style="width: 120px"></el-input>
  16. </el-form-item>
  17. <!-- <el-form-item label="出入库类型:">-->
  18. <!-- <el-select v-model="searchData.transType" placeholder="请选择" clearable style="width: 120px">-->
  19. <!-- <el-option-->
  20. <!-- v-for="i in findTrans"-->
  21. <!-- :key ="i.transType"-->
  22. <!-- :label="i.transType"-->
  23. <!-- :value="i.transType">-->
  24. <!-- </el-option>-->
  25. <!-- </el-select>-->
  26. <!-- </el-form-item>-->
  27. <el-form-item :label="' '">
  28. <el-button v-if="!authSearch" type="primary" @click="getDataList()">查询</el-button>
  29. <!-- <download-excel-->
  30. <!-- :fields="fields()"-->
  31. <!-- :data="exportData"-->
  32. <!-- type="xls"-->
  33. <!-- :name="exportName"-->
  34. <!-- :header="exportHeader"-->
  35. <!-- :footer="exportFooter"-->
  36. <!-- :fetch="createExportData"-->
  37. <!-- :before-generate="startDownload"-->
  38. <!-- :before-finish="finishDownload"-->
  39. <!-- worksheet="导出信息"-->
  40. <!-- class="el-button el-button&#45;&#45;primary el-button&#45;&#45;medium">-->
  41. <!-- {{ "导出" }}-->
  42. <!-- </download-excel>-->
  43. </el-form-item>
  44. </el-form>
  45. <!-- 展示列表 -->
  46. <el-table
  47. :height="height"
  48. :data="dataList"
  49. @row-click="changeData"
  50. border
  51. highlight-current-row
  52. ref="mainTable"
  53. style="width: 100%;">
  54. <el-table-column
  55. v-for="(item,index) in columnList" :key="index"
  56. :sortable="item.columnSortable"
  57. :prop="item.columnProp"
  58. :header-align="item.headerAlign"
  59. :show-overflow-tooltip="item.showOverflowTooltip"
  60. :align="item.align"
  61. :fixed="item.fixed==''?false:item.fixed"
  62. :width="item.columnWidth"
  63. :label="item.columnLabel">
  64. <template slot-scope="scope">
  65. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  66. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  67. </template>
  68. </el-table-column>
  69. </el-table>
  70. <el-tabs style="font-size: 12px;min-height: 200px" class="customer-tab" v-model="activeName" type="border-card" @tab-click="tabClick">
  71. <el-tab-pane label="卷明细" name="detail">
  72. <el-table
  73. :data="dataList2"
  74. :height="height"
  75. border
  76. style="width: 100%; ">
  77. <el-table-column
  78. v-for="(item,index) in columnList2" :key="index"
  79. :sortable="item.columnSortable"
  80. :prop="item.columnProp"
  81. :header-align="item.headerAlign"
  82. :show-overflow-tooltip="item.showOverflowTooltip"
  83. :align="item.align"
  84. :fixed="item.fixed==''?false:item.fixed"
  85. :min-width="item.columnWidth"
  86. :label="item.columnLabel">
  87. <template slot-scope="scope">
  88. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  89. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  90. style="width: 100px; height: 80px"/></span>
  91. </template>
  92. </el-table-column>
  93. </el-table>
  94. </el-tab-pane>
  95. </el-tabs>
  96. <el-pagination
  97. @size-change="sizeChangeHandle"
  98. @current-change="currentChangeHandle"
  99. :current-page="pageIndex"
  100. :page-sizes="[20, 50, 100, 200, 500]"
  101. :page-size="pageSize"
  102. :total="totalPage"
  103. layout="total, sizes, prev, pager, next, jumper">
  104. </el-pagination>
  105. </div>
  106. </template>
  107. <script>
  108. import {
  109. findTrans, // 检验方法查询
  110. findByRoll //查询卷明细
  111. // saveLocation, // 检验方法新增
  112. // updateLocation, // 检验方法修改
  113. // deleteLocation, // 检验方法删除
  114. // findByWarehouse, //查询库区
  115. // inspectionTypeSearch, // 搜索所有检验类型
  116. // // getSiteAndBuByUserName
  117. } from "@/api/material/seekByTrans.js"
  118. // import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
  119. // import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
  120. export default {
  121. data () {
  122. return {
  123. currentRow:'',
  124. headerData:'',
  125. wareHouseList:'',
  126. // 是否收藏
  127. favorite: false,
  128. // 导出 start
  129. exportData: [],
  130. exportName: "检验方法" + this.dayjs().format('YYYYMMDDHHmmss'),
  131. exportHeader: ["检验方法"],
  132. exportFooter: [],
  133. exportList: [],
  134. warehouseData: {
  135. id:'',
  136. site: '',
  137. },
  138. activeName:"detail",
  139. // 导出 end
  140. searchData: {
  141. transNo:'',
  142. site: '',
  143. userName: this.$store.state.user.name,
  144. transDate: '',
  145. warehouseID: '',
  146. rollNo: '',
  147. partNo: '',
  148. partDesc: '',
  149. transQty: '',
  150. batchNo: '',
  151. locationID: '',
  152. wdrNo: '',
  153. manufactureDate: '',
  154. orderRef1: '',
  155. receiver: '',
  156. enterDate: '',
  157. transType: '',
  158. page: 1,
  159. limit: 10,
  160. },
  161. pageIndex: 1,
  162. pageSize: 20,
  163. totalPage: 0,
  164. height: 200,
  165. dataList: [],
  166. dataList2:[],
  167. dataListLoading: false,
  168. modalFlag: false,
  169. modalDisableFlag: false,
  170. modalData: {
  171. site: '',
  172. warehouseId: '',
  173. locationId: '',
  174. active: 'Y',
  175. locationName: '',
  176. creator: this.$store.state.user.name,
  177. // updateBy: this.$store.state.user.name,
  178. locationDescription: '',
  179. keeper: '',
  180. remarks: '',
  181. createTime: '',
  182. },
  183. // 标头展示
  184. columnList: [
  185. {
  186. userId: this.$store.state.user.name,
  187. functionId: 200003,
  188. serialNumber: '200003TableSite',
  189. tableId: "200003Table",
  190. tableName: "工厂编码",
  191. columnWidth: 100,
  192. columnProp: 'site',
  193. headerAlign: 'left',
  194. align: "left",
  195. columnLabel: '工厂编码',
  196. columnHidden: false,
  197. columnImage: false,
  198. columnSortable: false,
  199. sortLv: 0,
  200. status: true,
  201. fixed: '',
  202. },
  203. {
  204. userId: this.$store.state.user.name,
  205. functionId: 200003,
  206. serialNumber: '200003TableTransNo',
  207. tableId: "200003Table",
  208. tableName: "出入库单号",
  209. columnWidth: 100,
  210. columnProp: 'transNo',
  211. headerAlign: 'left',
  212. align: "left",
  213. columnLabel: '出入库单号',
  214. columnHidden: false,
  215. columnImage: false,
  216. columnSortable: false,
  217. sortLv: 0,
  218. status: true,
  219. fixed: '',
  220. },
  221. {
  222. userId: this.$store.state.user.name,
  223. functionId: 200003,
  224. serialNumber: '200003TableTransDate',
  225. tableId: "200003Table",
  226. tableName: "出入库日期",
  227. columnWidth: 100,
  228. columnProp: 'transDate',
  229. headerAlign: 'center',
  230. align: "center",
  231. columnLabel: '出入库日期',
  232. columnHidden: false,
  233. columnImage: false,
  234. columnSortable: false,
  235. sortLv: 0,
  236. status: true,
  237. fixed: '',
  238. },
  239. {
  240. userId: this.$store.state.user.name,
  241. functionId: 200003,
  242. serialNumber: '200003TableWarehouseId',
  243. tableId: "200003Table",
  244. tableName: "仓位编码",
  245. columnWidth: 100,
  246. columnProp: 'warehouseID',
  247. headerAlign: 'left',
  248. align: "left",
  249. columnLabel: '仓位编码',
  250. columnHidden: false,
  251. columnImage: false,
  252. columnSortable: false,
  253. sortLv: 0,
  254. status: true,
  255. fixed: '',
  256. },
  257. // {
  258. // userId: this.$store.state.user.name,
  259. // functionId: 200003,
  260. // serialNumber: '200003TableRollNo',
  261. // tableId: "200003Table",
  262. // tableName: "卷号",
  263. // columnWidth: 100,
  264. // columnProp: 'rollNo',
  265. // headerAlign: 'center',
  266. // align: "center",
  267. // columnLabel: '卷号',
  268. // columnHidden: false,
  269. // columnImage: false,
  270. // columnSortable: false,
  271. // sortLv: 0,
  272. // status: true,
  273. // fixed: '',
  274. // },
  275. {
  276. userId: this.$store.state.user.name,
  277. functionId: 200003,
  278. serialNumber: '200003TablePartNo',
  279. tableId: "200003Table",
  280. tableName: "物料编码",
  281. columnWidth: 100,
  282. columnProp: 'partNo',
  283. headerAlign: 'left',
  284. align: "left",
  285. columnLabel: '物料编码',
  286. columnHidden: false,
  287. columnImage: false,
  288. columnSortable: false,
  289. sortLv: 0,
  290. status: true,
  291. fixed: '',
  292. },
  293. {
  294. userId: this.$store.state.user.name,
  295. functionId: 200003,
  296. serialNumber: '200003TablePartDesc',
  297. tableId: "200003Table",
  298. tableName: "料号描述",
  299. columnWidth: 100,
  300. columnProp: 'partDesc',
  301. headerAlign: 'left',
  302. align: "left",
  303. columnLabel: '料号描述',
  304. columnHidden: false,
  305. columnImage: false,
  306. columnSortable: false,
  307. sortLv: 0,
  308. status: true,
  309. fixed: '',
  310. },
  311. {
  312. userId: this.$store.state.user.name,
  313. functionId: 200003,
  314. serialNumber: '200003TableTransQty',
  315. tableId: "200003Table",
  316. tableName: "出入库数量",
  317. columnWidth: 100,
  318. columnProp: 'transQty',
  319. headerAlign: 'right',
  320. align: "right",
  321. columnLabel: '出入库数量',
  322. columnHidden: false,
  323. columnImage: false,
  324. columnSortable: false,
  325. sortLv: 0,
  326. status: true,
  327. fixed: '',
  328. },
  329. {
  330. userId: this.$store.state.user.name,
  331. functionId: 200003,
  332. serialNumber: '200003TableBatchNo',
  333. tableId: "200003Table",
  334. tableName: "批号",
  335. columnWidth: 100,
  336. columnProp: 'batchNo',
  337. headerAlign: 'left',
  338. align: "left",
  339. columnLabel: '批号',
  340. columnHidden: false,
  341. columnImage: false,
  342. columnSortable: false,
  343. sortLv: 0,
  344. status: true,
  345. fixed: '',
  346. },
  347. {
  348. userId: this.$store.state.user.name,
  349. functionId: 200003,
  350. serialNumber: '200003TableLocationID',
  351. tableId: "200003Table",
  352. tableName: "库位",
  353. columnWidth: 100,
  354. columnProp: 'locationID',
  355. headerAlign: 'left',
  356. align: "left",
  357. columnLabel: '库位',
  358. columnHidden: false,
  359. columnImage: false,
  360. columnSortable: false,
  361. sortLv: 0,
  362. status: true,
  363. fixed: '',
  364. },
  365. {
  366. userId: this.$store.state.user.name,
  367. functionId: 200003,
  368. serialNumber: '200003TableWdrNo',
  369. tableId: "200003Table",
  370. tableName: "W/D/R",
  371. columnWidth: 100,
  372. columnProp: 'wdrNo',
  373. headerAlign: 'left',
  374. align: "left",
  375. columnLabel: 'W/D/R',
  376. columnHidden: false,
  377. columnImage: false,
  378. columnSortable: false,
  379. sortLv: 0,
  380. status: true,
  381. fixed: '',
  382. },
  383. {
  384. userId: this.$store.state.user.name,
  385. functionId: 200003,
  386. serialNumber: '200003TableManufactureDate',
  387. tableId: "200003Table",
  388. tableName: "生产日期",
  389. columnWidth: 100,
  390. columnProp: 'manufactureDate',
  391. headerAlign: 'center',
  392. align: "center",
  393. columnLabel: '生产日期',
  394. columnHidden: false,
  395. columnImage: false,
  396. columnSortable: false,
  397. sortLv: 0,
  398. status: true,
  399. fixed: '',
  400. },
  401. {
  402. userId: this.$store.state.user.name,
  403. functionId: 200003,
  404. serialNumber: '200003TableOrderRef1',
  405. tableId: "200003Table",
  406. tableName: "关联单号",
  407. columnWidth: 100,
  408. columnProp: 'orderRef1',
  409. headerAlign: 'left',
  410. align: "left",
  411. columnLabel: '关联单号',
  412. columnHidden: false,
  413. columnImage: false,
  414. columnSortable: false,
  415. sortLv: 0,
  416. status: true,
  417. fixed: '',
  418. },
  419. {
  420. userId: this.$store.state.user.name,
  421. functionId: 200003,
  422. serialNumber: '200003TableReceiver',
  423. tableId: "200003Table",
  424. tableName: "经手人",
  425. columnWidth: 100,
  426. columnProp: 'receiver',
  427. headerAlign: 'left',
  428. align: "left",
  429. columnLabel: '经手人',
  430. columnHidden: false,
  431. columnImage: false,
  432. columnSortable: false,
  433. sortLv: 0,
  434. status: true,
  435. fixed: '',
  436. },
  437. {
  438. userId: this.$store.state.user.name,
  439. functionId: 200003,
  440. serialNumber: '200003TableEnterDate',
  441. tableId: "200003Table",
  442. tableName: "录入时间",
  443. columnWidth: 100,
  444. columnProp: 'enterDate',
  445. headerAlign: 'center',
  446. align: "center",
  447. columnLabel: '录入时间',
  448. columnHidden: false,
  449. columnImage: false,
  450. columnSortable: false,
  451. sortLv: 0,
  452. status: true,
  453. fixed: '',
  454. },
  455. {
  456. userId: this.$store.state.user.name,
  457. functionId: 200003,
  458. serialNumber: '200003TableUserName',
  459. tableId: "200003Table",
  460. tableName: "录入人",
  461. columnWidth: 100,
  462. columnProp: 'userName',
  463. headerAlign: 'left',
  464. align: "left",
  465. columnLabel: '录入人',
  466. columnHidden: false,
  467. columnImage: false,
  468. columnSortable: false,
  469. sortLv: 0,
  470. status: true,
  471. fixed: '',
  472. },
  473. {
  474. userId: this.$store.state.user.name,
  475. functionId: 200003,
  476. serialNumber: '200003TableTransType',
  477. tableId: "200003Table",
  478. tableName: "出入库类型",
  479. columnWidth: 100,
  480. columnProp: 'transType',
  481. headerAlign: 'left',
  482. align: "left",
  483. columnLabel: '出入库类型',
  484. columnHidden: false,
  485. columnImage: false,
  486. columnSortable: false,
  487. sortLv: 0,
  488. status: true,
  489. fixed: '',
  490. },
  491. ],
  492. columnList2:[
  493. {
  494. userId: this.$store.state.user.name,
  495. functionId: 200003,
  496. serialNumber: '200003TableTransNo',
  497. tableId: "200003Table",
  498. tableName: "出入库单号",
  499. columnWidth: 200,
  500. columnProp: 'transNo',
  501. headerAlign: 'left',
  502. align: "left",
  503. columnLabel: '出入库单号',
  504. columnHidden: false,
  505. columnImage: false,
  506. columnSortable: false,
  507. sortLv: 0,
  508. status: true,
  509. fixed: '',
  510. },
  511. {
  512. userId: this.$store.state.user.name,
  513. functionId: 200003,
  514. serialNumber: '200003TableRollNo',
  515. tableId: "200003Table",
  516. tableName: "卷号",
  517. columnWidth: 200,
  518. columnProp: 'rollNo',
  519. headerAlign: 'left',
  520. align: "left",
  521. columnLabel: '卷号',
  522. columnHidden: false,
  523. columnImage: false,
  524. columnSortable: false,
  525. sortLv: 0,
  526. status: true,
  527. fixed: '',
  528. },
  529. {
  530. userId: this.$store.state.user.name,
  531. functionId: 200003,
  532. serialNumber: '200003TableSum',
  533. tableId: "200003Table",
  534. tableName: "数量",
  535. columnWidth: 200,
  536. columnProp: 'sum',
  537. headerAlign: 'right',
  538. align: "right",
  539. columnLabel: '数量',
  540. columnHidden: false,
  541. columnImage: false,
  542. columnSortable: false,
  543. sortLv: 0,
  544. status: true,
  545. fixed: '',
  546. },
  547. {
  548. userId: this.$store.state.user.name,
  549. functionId: 200003,
  550. serialNumber: '200003TableManufactureDate',
  551. tableId: "200003Table",
  552. tableName: "生产日期",
  553. columnWidth: 200,
  554. columnProp: 'manufactureDate',
  555. headerAlign: 'center',
  556. align: "center",
  557. columnLabel: '生产日期',
  558. columnHidden: false,
  559. columnImage: false,
  560. columnSortable: false,
  561. sortLv: 0,
  562. status: true,
  563. fixed: '',
  564. },
  565. {
  566. userId: this.$store.state.user.name,
  567. functionId: 200003,
  568. serialNumber: '200003TableEnterDate',
  569. tableId: "200003Table",
  570. tableName: "录入时间",
  571. columnWidth: 200,
  572. columnProp: 'enterDate',
  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: '',
  582. },
  583. ],
  584. rules: {
  585. warehouseId:[
  586. {
  587. required: true,
  588. message: ' ',
  589. trigger: ['blur','change']
  590. }
  591. ],
  592. locationId:[
  593. {
  594. required: true,
  595. message: ' ',
  596. trigger: ['blur','change']
  597. }
  598. ],
  599. site:[
  600. {
  601. required: true,
  602. message: ' ',
  603. trigger: ['blur','change']
  604. }
  605. ],
  606. locationName:[
  607. {
  608. required: true,
  609. message: ' ',
  610. trigger: ['blur','change']
  611. }
  612. ]
  613. },
  614. options: [],
  615. userBuList: [],
  616. authSearch: false,
  617. authSave: false,
  618. authUpdate: false,
  619. authDelete: false,
  620. menuId: this.$route.meta.menuId,
  621. }
  622. },
  623. mounted () {
  624. this.$nextTick(() => {
  625. this.height = window.innerHeight - 180
  626. })
  627. },
  628. //页面加载前初始化着两个方法
  629. created () {
  630. this.getDataList()
  631. //this.getWareHouseList()
  632. },
  633. methods: {
  634. // 获取用户的bu
  635. getSiteAndBuByUserName () {
  636. let tempData = {
  637. username: this.$store.state.user.name,
  638. }
  639. getSiteAndBuByUserName(tempData).then(({data}) => {
  640. if (data.code === 0) {
  641. this.userBuList = data.rows
  642. }
  643. })
  644. },
  645. tabClick (tab, event) {
  646. // 刷新列表数据
  647. this.refreshCurrentTabTable()
  648. },
  649. changeData(row){
  650. this.currentRow = JSON.parse(JSON.stringify(row));
  651. this.headerData=row;
  652. this.refreshCurrentTabTable ();
  653. },
  654. refreshCurrentTabTable(){
  655. if(this.currentRow===''||this.currentRow===null){
  656. this.currentRow={site:'',transNo:''}
  657. }
  658. findByRoll(this.currentRow).then(({data}) => {
  659. //区分请求成功和失败的状况
  660. if (data && data.code == 0) {
  661. this.dataList2 = data.rows
  662. } else {
  663. this.dataList2 = [];
  664. }
  665. });
  666. },
  667. // 查询获取数据列表
  668. getDataList (){
  669. this.searchData.limit = this.pageSize
  670. this.searchData.page = this.pageIndex
  671. findTrans(this.searchData).then(({data}) => {
  672. if (data.code === 0) {
  673. this.dataList = data.page.list
  674. this.pageIndex = data.page.currPage
  675. this.pageSize = data.page.pageSize
  676. this.totalPage = data.page.totalCount
  677. if(this.dataList.length>0){
  678. this.$refs.mainTable.setCurrentRow(this.dataList[0]);
  679. this.changeData(this.dataList[0])
  680. }else {
  681. this.changeData(null)
  682. }
  683. }
  684. })
  685. },
  686. // 每页数
  687. sizeChangeHandle (val) {
  688. this.pageSize = val
  689. this.pageIndex = 1
  690. this.getDataList()
  691. },
  692. // 当前页
  693. currentChangeHandle (val) {
  694. this.pageIndex = val
  695. this.getDataList()
  696. },
  697. // // 新增按钮
  698. // addModal () {
  699. // this.modalData = {
  700. // flag: '1',
  701. // site: '',
  702. // creator: this.$store.state.user.name,
  703. // locationId: '',
  704. // locationName: '',
  705. // active: 'Y',
  706. // warehouseId: '',
  707. // locationDescription: '',
  708. // keeper: '',
  709. // remarks: '',
  710. // }
  711. // this.modalDisableFlag = false
  712. // this.modalFlag = true
  713. // },
  714. // // 修改按钮
  715. // updateModal (row) {
  716. // this.modalData = {
  717. // flag: '2',
  718. // id:row.id,
  719. // site: row.site,
  720. // creator: this.$store.state.user.name,
  721. // warehouseId: row.warehouseId,
  722. // locationId: row.locationId,
  723. // active: row.active,
  724. // locationName: row.locationName,
  725. // locationDescription: row.locationDescription,
  726. // keeper: row.keeper,
  727. // remarks: row.remarks,
  728. // }
  729. // this.modalDisableFlag = true
  730. // this.modalFlag = true
  731. // },
  732. // 删除方法
  733. // deleteModal (row) {
  734. // this.$confirm(`是否删除这个检验方法?`, '提示', {
  735. // confirmButtonText: '确定',
  736. // cancelButtonText: '取消',
  737. // type: 'warning'
  738. // }).then(() => {
  739. // deleteLocation(row).then(({data}) => {
  740. // if (data && data.code === 0) {
  741. // this.getDataList()
  742. // this.$message({
  743. // message: '操作成功',
  744. // type: 'success',
  745. // duration: 1500,
  746. // onClose: () => {}
  747. // })
  748. // } else {
  749. // this.$alert(data.msg, '错误', {
  750. // confirmButtonText: '确定'
  751. // })
  752. // }
  753. // })
  754. // }).catch(() => {
  755. // })
  756. // },
  757. // 新增/修改方法
  758. // saveData () {
  759. // if (this.modalData.site === '' || this.modalData.site == null) {
  760. // this.$message.warning('请输入工厂编码!')
  761. // return
  762. // }
  763. // if (this.modalData.warehouseId === '' || this.modalData.warehouseId == null) {
  764. // this.$message.warning('请选择仓库编码!')
  765. // return
  766. // }
  767. // if(this.modalData.locationName === ''|| this.modalData.locationName == null){
  768. // this.$message.warning('请输入库位名称!')
  769. // return
  770. // }
  771. // if(this.modalData.locationId === ''|| this.modalData.locationId == null){
  772. // this.$message.warning('请输入库位编码!')
  773. // return
  774. // }
  775. // if (this.modalData.flag === '1') { // 新增
  776. // saveLocation(this.modalData).then(({data}) => {
  777. // if (data && data.code === 0) {
  778. // this.getDataList()
  779. // this.modalFlag = false
  780. // this.$message({
  781. // message: '操作成功',
  782. // type: 'success',
  783. // duration: 1500,
  784. // onClose: () => {}
  785. // })
  786. // } else {
  787. // this.$alert(data.msg, '错误', {
  788. // confirmButtonText: '确定'
  789. // })
  790. // }
  791. // })
  792. // } else { // 修改
  793. // updateLocation(this.modalData).then(({data}) => {
  794. // if (data && data.code === 0) {
  795. // this.getDataList()
  796. // this.modalFlag = false
  797. // this.$message({
  798. // message: '操作成功',
  799. // type: 'success',
  800. // duration: 1500,
  801. // onClose: () => {}
  802. // })
  803. // } else {
  804. // this.$alert(data.msg, '错误', {
  805. // confirmButtonText: '确定'
  806. // })
  807. // }
  808. // })
  809. // }
  810. // },
  811. // 查询检验类型
  812. inspectionTypeSearch () {
  813. let tempData = {
  814. site: this.$store.state.user.site
  815. }
  816. inspectionTypeSearch(tempData).then(({data}) => {
  817. if (data.code === 0) {
  818. this.options = data.rows
  819. }
  820. })
  821. },
  822. // 校验用户是否收藏
  823. favoriteIsOk () {
  824. let userFavorite = {
  825. userId: this.$store.state.user.id,
  826. languageCode: this.$i18n.locale
  827. }
  828. userFavoriteList(userFavorite).then(({data}) => {for (let i = 0; i < data.list.length; i++) {
  829. if(this.$route.meta.menuId === data.list[i].menuId){
  830. this.favorite = true
  831. }
  832. }
  833. })
  834. },
  835. // 收藏 OR 取消收藏
  836. favoriteFunction () {
  837. let userFavorite = {
  838. userId: this.$store.state.user.id,
  839. functionId: this.$route.meta.menuId,
  840. }
  841. if (this.favorite) {
  842. removeUserFavorite(userFavorite).then(({data}) => {
  843. this.$message.success(data.msg)
  844. this.favorite = false
  845. })
  846. } else {
  847. // 收藏
  848. saveUserFavorite(userFavorite).then(({data}) => {
  849. this.$message.success(data.msg)
  850. this.favorite = true
  851. })
  852. }
  853. },
  854. //导出excel
  855. async createExportData() {
  856. this.searchData.limit = -1
  857. this.searchData.page = 1
  858. await findTrans(this.searchData).then(({data}) => {
  859. this.exportList= data.rows
  860. })
  861. return this.exportList
  862. },
  863. startDownload() {},
  864. finishDownload() {},
  865. fields () {
  866. let json = "{"
  867. this.columnList.forEach((item, index) => {
  868. if (index == this.columnList.length - 1) {
  869. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  870. } else {
  871. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  872. }
  873. })
  874. json += "}"
  875. let s = eval("(" + json + ")")
  876. return s
  877. },
  878. // 动态列开始 获取 用户保存的 格式列
  879. async getTableUserColumn (tableId, columnId) {
  880. let queryTableUser = {
  881. userId: this.$store.state.user.name,
  882. functionId: this.$route.meta.menuId,
  883. tableId: tableId,
  884. status: true,
  885. languageCode: this.$i18n.locale
  886. }
  887. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  888. if (data.rows.length > 0) {
  889. //this.columnList1 = []
  890. switch (columnId) {
  891. case 1:
  892. this.columnList = data.rows
  893. break;
  894. // case 2:
  895. // this.columnDetailList = data.rows
  896. // break;
  897. // case 3:
  898. // this.columnList2 = data.rows
  899. // break;
  900. // case 4:
  901. // this.columnList3 = data.rows
  902. // break;
  903. }
  904. } else {
  905. this.getColumnList(tableId, columnId)
  906. }
  907. })
  908. },
  909. // 获取 tableDefault 列
  910. async getColumnList (tableId, columnId) {
  911. let queryTable = {
  912. functionId: this.$route.meta.menuId,
  913. tableId: tableId,
  914. languageCode: this.$i18n.locale
  915. }
  916. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  917. if (!data.rows.length == 0) {
  918. switch (columnId) {
  919. case 1:
  920. this.columnList = data.rows
  921. break;
  922. // case 2:
  923. // this.columnDetailList = data.rows
  924. // break;
  925. // case 3:
  926. // this.columnList2 = data.rows
  927. // break;
  928. // case 4:
  929. // this.columnList3 = data.rows
  930. // break;
  931. }
  932. } else {
  933. // this.showDefault = true.
  934. }
  935. })
  936. },
  937. //获取按钮的权限数据
  938. getButtonAuthData () {
  939. let searchFlag = this.isAuth(this.menuId+":search")
  940. let saveFlag = this.isAuth(this.menuId+":save")
  941. let updateFlag = this.isAuth(this.menuId+":update")
  942. let deleteFlag = this.isAuth(this.menuId+":delete")
  943. //处理页面的权限数据
  944. this.authSearch = !searchFlag
  945. this.authSave = !saveFlag
  946. this.authUpdate = !updateFlag
  947. this.authDelete = !deleteFlag
  948. },
  949. }
  950. }
  951. </script>