祥兆质量前端
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.

1367 lines
44 KiB

8 months ago
  1. <template>
  2. <div class="mod-config">
  3. <!-- 收藏 -->
  4. <div>
  5. <span @click="favoriteFunction()">
  6. <icon-svg :name="favorite?'xiangqufill':'xiangqu'" class="sl-svg"></icon-svg>
  7. </span>
  8. </div>
  9. <!-- 条件查询 -->
  10. <el-form :inline="true" label-position="top" :model="searchData">
  11. <el-form-item :label="'BU'">
  12. <el-select v-model="searchData.buDesc" placeholder="请选择" clearable style="width: 75px">
  13. <el-option
  14. v-for = "i in userBuList"
  15. :key = "i.buNo"
  16. :label = "i.buDesc"
  17. :value = "i.buDesc">
  18. </el-option>
  19. </el-select>
  20. </el-form-item>
  21. <el-form-item :label="'检验单号'">
  22. <el-input v-model="searchData.inspectionNo" clearable style="width: 140px"></el-input>
  23. </el-form-item>
  24. <el-form-item :label="'单据号'">
  25. <el-input v-model="searchData.poOrderNo" clearable style="width: 150px"></el-input>
  26. </el-form-item>
  27. <el-form-item :label="'单据行号'">
  28. <el-input v-model="searchData.poItemNo" clearable style="width: 120px"></el-input>
  29. </el-form-item>
  30. <el-form-item :label="'物料编码'">
  31. <el-input v-model="searchData.partNo" clearable style="width: 120px"></el-input>
  32. </el-form-item>
  33. <el-form-item :label="'物料名称'">
  34. <el-input v-model="searchData.partDesc" clearable style="width: 315px"></el-input>
  35. </el-form-item>
  36. </el-form>
  37. <el-form :inline="true" label-position="top" :model="searchData">
  38. <el-form-item :label="'通知单号'">
  39. <el-input v-model="searchData.receiptNo" clearable style="width: 144px"></el-input>
  40. </el-form-item>
  41. <el-form-item :label="'关联单号1'">
  42. <el-input v-model="searchData.refInfo1" clearable style="width: 155px"></el-input>
  43. </el-form-item>
  44. <el-form-item :label="'关联单号2'">
  45. <el-input v-model="searchData.refInfo2" clearable style="width: 155px"></el-input>
  46. </el-form-item>
  47. <el-form-item :label="'关联单号3'">
  48. <el-input v-model="searchData.refInfo3" clearable style="width: 155px"></el-input>
  49. </el-form-item>
  50. <el-form-item :label="'关联单号4'">
  51. <el-input v-model="searchData.refInfo4" clearable style="width: 155px"></el-input>
  52. </el-form-item>
  53. <el-form-item :label="'关联单号5'">
  54. <el-input v-model="searchData.refInfo5" clearable style="width: 155px"></el-input>
  55. </el-form-item>
  56. </el-form>
  57. <el-form :inline="true" label-position="top" :model="searchData">
  58. <el-form-item :label="'质检员'">
  59. <el-input v-model="searchData.inspectorName" clearable style="width: 120px"></el-input>
  60. </el-form-item>
  61. <el-form-item>
  62. <span slot="label" @click="getBaseList(509)"><a herf="#">供应商编码</a></span>
  63. <el-input v-model="searchData.supplierNo" clearable style="width: 145px"></el-input>
  64. </el-form-item>
  65. <el-form-item>
  66. <span slot="label" @click="getBaseList(508)"><a herf="#">仓库编码</a></span>
  67. <el-input v-model="searchData.warehouseId" clearable style="width: 130px"></el-input>
  68. </el-form-item>
  69. <el-form-item :label="'仓库名称'">
  70. <el-input v-model="searchData.warehouseName" clearable style="width: 200px"></el-input>
  71. </el-form-item>
  72. <el-form-item :label="'状态'">
  73. <el-select v-model="searchData.states" multiple style="width: 340px">
  74. <el-option label="未开始" value="未开始"></el-option>
  75. <el-option label="待检验" value="待检验"></el-option>
  76. <el-option label="待审核" value="待审核"></el-option>
  77. <el-option label="已完成" value="已完成"></el-option>
  78. </el-select>
  79. </el-form-item>
  80. </el-form>
  81. <el-form :inline="true" label-position="top" :model="searchData">
  82. <el-form-item :label="'检验结论'">
  83. <el-select v-model="searchData.inspectionResult" clearable style="width: 80px">
  84. <el-option label="合格" value="合格"></el-option>
  85. <el-option label="不合格" value="不合格"></el-option>
  86. <el-option label="免检" value="免检"></el-option>
  87. </el-select>
  88. </el-form-item>
  89. <el-form-item :label="'项目检验结论'">
  90. <el-select v-model="searchData.itemResult" clearable style="width: 80px">
  91. <el-option label="合格" value="Y"></el-option>
  92. <el-option label="不合格" value="N"></el-option>
  93. </el-select>
  94. </el-form-item>
  95. <el-form-item :label="'处置措施'">
  96. <el-select v-model="searchData.disposalMeasures" clearable style="width: 90px">
  97. <el-option
  98. v-for = "i in disposalMeasuresOptions"
  99. :key = "i.id"
  100. :label = "i.disposalMeasures"
  101. :value = "i.disposalMeasures">
  102. </el-option>
  103. </el-select>
  104. </el-form-item>
  105. <el-form-item :label="'送检日期'">
  106. <el-date-picker style="width: 120px" v-model="searchData.startDate2" type="date" value-format='yyyy-MM-dd' format='yyyy-MM-dd' placeholder="开始日期"></el-date-picker>
  107. -
  108. <el-date-picker style="width: 120px" v-model="searchData.endDate2" type="date" value-format='yyyy-MM-dd' format='yyyy-MM-dd' placeholder="结束日期"></el-date-picker>
  109. </el-form-item>
  110. <el-form-item :label="'检验日期'">
  111. <el-date-picker style="width: 120px" v-model="searchData.startDate" type="date" value-format='yyyy-MM-dd' format='yyyy-MM-dd' placeholder="开始日期"></el-date-picker>
  112. -
  113. <el-date-picker style="width: 120px" v-model="searchData.endDate" type="date" value-format='yyyy-MM-dd' format='yyyy-MM-dd' placeholder="结束日期"></el-date-picker>
  114. </el-form-item>
  115. <el-form-item :label="' '">
  116. <el-button v-if="!authSearch" type="primary" @click="getDataList">查询</el-button>
  117. <el-button v-if="!authSearch" type="primary" :loading="downLoading" @click="downloadQcRecord">导出</el-button>
  118. </el-form-item>
  119. </el-form>
  120. <!-- 展示列表 -->
  121. <el-table
  122. :height="height - 45"
  123. :data="dataList"
  124. border
  125. @row-click="IQCClickRow"
  126. :row-style="rowStyle"
  127. style="width: 100%;">
  128. <el-table-column
  129. v-for="(item,index) in columnList" :key="index"
  130. :sortable="item.columnSortable"
  131. :prop="item.columnProp"
  132. :header-align="item.headerAlign"
  133. :show-overflow-tooltip="item.showOverflowTooltip"
  134. :align="item.align"
  135. :fixed="item.fixed==''?false:item.fixed"
  136. :width="item.columnWidth"
  137. :label="item.columnLabel">
  138. <template slot-scope="scope">
  139. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  140. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  141. </template>
  142. </el-table-column>
  143. <el-table-column
  144. fixed="right"
  145. header-align="center"
  146. align="center"
  147. width="90"
  148. label="操作">
  149. <template slot-scope="scope">
  150. <a style="cursor: pointer" @click="subDetailModal(scope.row)">检验明细</a>
  151. </template>
  152. </el-table-column>
  153. </el-table>
  154. <el-pagination
  155. @size-change="sizeChangeHandle"
  156. @current-change="currentChangeHandle"
  157. :current-page="pageIndex"
  158. :page-sizes="[20, 50, 100, 200, 500]"
  159. :page-size="pageSize"
  160. :total="totalPage"
  161. layout="total, sizes, prev, pager, next, jumper">
  162. </el-pagination>
  163. <el-drawer title="检验项目子明细" :visible.sync="subDetailModalFlag" direction="rtl" :with-header="false">
  164. <div style="padding: 5px">
  165. <el-table
  166. :height="height + 210"
  167. :data="templateTableData"
  168. border
  169. style="width: 100%;">
  170. <el-table-column
  171. v-for="(item,index) in SubDetailColumnList" :key="index"
  172. :sortable="item.columnSortable"
  173. :prop="item.columnProp"
  174. :header-align="item.headerAlign"
  175. :show-overflow-tooltip="item.showOverflowTooltip"
  176. :align="item.align"
  177. :fixed="item.fixed==''?false:item.fixed"
  178. :min-width="item.columnWidth"
  179. :label="item.columnLabel">
  180. <template slot-scope="scope">
  181. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  182. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  183. </template>
  184. </el-table-column>
  185. </el-table>
  186. <!-- 分页-->
  187. <el-pagination
  188. @size-change="sizeChangeHandle2"
  189. @current-change="currentChangeHandle2"
  190. :current-page="pageIndex2"
  191. :page-sizes="[20, 50, 100, 200, 500]"
  192. :page-size="pageSize2"
  193. :total="subDetailDataList.length"
  194. layout="total, sizes, prev, pager, next, jumper">
  195. </el-pagination>
  196. </div>
  197. </el-drawer>
  198. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  199. </div>
  200. </template>
  201. <script>
  202. import {
  203. getIQCReport, // 获取IQC报表
  204. downloadQcRecord, // 导出
  205. } from "@/api/qc/qc_report.js"
  206. import {
  207. getSiteAndBuByUserName, // 获取site bu
  208. selectIQCSubDetailedRecord, // 查询子明细
  209. disposalMeasuresSearch, // 获取处置措施列表
  210. } from "@/api/qc/qc.js"
  211. import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
  212. import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
  213. import Chooselist from '@/views/modules/common/Chooselist_eam'
  214. export default {
  215. components: {
  216. Chooselist
  217. },
  218. computed: {
  219. templateTableData () {
  220. let start = (this.pageIndex2 - 1) * this.pageSize2
  221. let end = start + this.pageSize2
  222. if (end > this.subDetailDataList.length){
  223. end = this.subDetailDataList.length
  224. }
  225. return this.subDetailDataList.slice(start,end)
  226. }
  227. },
  228. data () {
  229. return {
  230. // 是否收藏
  231. favorite: false,
  232. // 导出 start
  233. exportData: [],
  234. exportName: "IQC报表" + this.dayjs().format('YYYYMMDDHHmmss'),
  235. exportHeader: ["IQC报表"],
  236. exportFooter: [],
  237. exportList: [],
  238. // 导出 end
  239. searchData: {
  240. site: '',
  241. userName: this.$store.state.user.name,
  242. inspectionNo: '',
  243. inspectionTypeNo: '105',
  244. isQualified: '',
  245. buDesc: '',
  246. startDate: '',
  247. endDate: '',
  248. startDate2: '',
  249. endDate2: '',
  250. partNo:'',
  251. partDesc:'',
  252. state: '',
  253. inspectionResult: '',
  254. itemResult: '',
  255. supplierNo: '',
  256. disposalMeasures: '',
  257. inspectorName: '',
  258. page: 1,
  259. limit: 10,
  260. poOrderNo: '',
  261. poItemNo: '',
  262. orderType: '',
  263. states: [],
  264. warehouseId: '',
  265. warehouseName: '',
  266. receiptNo: '',
  267. refInfo1: '',
  268. refInfo2: '',
  269. refInfo3: '',
  270. refInfo4: '',
  271. refInfo5: '',
  272. downloadType: 'iqc',
  273. },
  274. pageIndex: 1,
  275. pageSize: 20,
  276. totalPage: 0,
  277. pageIndex2: 1,
  278. pageSize2: 50,
  279. totalPage2: 0,
  280. height: 200,
  281. dataList: [],
  282. // 标头展示
  283. columnList: [
  284. {
  285. userId: this.$store.state.user.name,
  286. functionId: 107001001,
  287. serialNumber: '107001001Table1State',
  288. tableId: "107001001Table1",
  289. tableName: "IQC报表",
  290. columnProp: 'state',
  291. headerAlign: "center",
  292. align: "center",
  293. columnLabel: '状态',
  294. columnHidden: false,
  295. columnImage: false,
  296. columnSortable: false,
  297. sortLv: 0,
  298. status: true,
  299. fixed: '',
  300. columnWidth: 100,
  301. },
  302. {
  303. userId: this.$store.state.user.name,
  304. functionId: 107001001,
  305. serialNumber: '107001001Table1BuDesc',
  306. tableId: "107001001Table1",
  307. tableName: "IQC报表",
  308. columnProp: 'buDesc',
  309. headerAlign: "center",
  310. align: "center",
  311. columnLabel: 'BU',
  312. columnHidden: false,
  313. columnImage: false,
  314. columnSortable: false,
  315. sortLv: 0,
  316. status: true,
  317. fixed: '',
  318. columnWidth: 100,
  319. },
  320. {
  321. userId: this.$store.state.user.name,
  322. functionId: 107001001,
  323. serialNumber: '107001001Table1InspectionNo',
  324. tableId: "107001001Table1",
  325. tableName: "IQC报表",
  326. columnProp: 'inspectionNo',
  327. headerAlign: "center",
  328. align: "center",
  329. columnLabel: '检验单号',
  330. columnHidden: false,
  331. columnImage: false,
  332. columnSortable: false,
  333. sortLv: 0,
  334. status: true,
  335. fixed: '',
  336. columnWidth: 120,
  337. },
  338. {
  339. userId: this.$store.state.user.name,
  340. functionId: 107001001,
  341. serialNumber: '107001001Table1InspectionResult',
  342. tableId: "107001001Table1",
  343. tableName: "IQC报表",
  344. columnProp: 'inspectionResult',
  345. headerAlign: "center",
  346. align: "center",
  347. columnLabel: '检验结论',
  348. columnHidden: false,
  349. columnImage: false,
  350. columnSortable: false,
  351. sortLv: 0,
  352. status: true,
  353. fixed: '',
  354. columnWidth: 100,
  355. },
  356. {
  357. userId: this.$store.state.user.name,
  358. functionId: 107001001,
  359. serialNumber: '107001001Table1TaskDate',
  360. tableId: "107001001Table1",
  361. tableName: "IQC报表",
  362. columnProp: 'taskDate',
  363. headerAlign: "center",
  364. align: "center",
  365. columnLabel: '送检日期',
  366. columnHidden: false,
  367. columnImage: false,
  368. columnSortable: false,
  369. sortLv: 0,
  370. status: true,
  371. fixed: '',
  372. columnWidth: 130,
  373. },
  374. {
  375. userId: this.$store.state.user.name,
  376. functionId: 107001001,
  377. serialNumber: '107001001Table1InspectionCycle',
  378. tableId: "107001001Table1",
  379. tableName: "IQC报表",
  380. columnProp: 'inspectionCycle',
  381. headerAlign: "center",
  382. align: "right",
  383. columnLabel: '检验周期(h)',
  384. columnHidden: false,
  385. columnImage: false,
  386. columnSortable: false,
  387. sortLv: 0,
  388. status: true,
  389. fixed: '',
  390. columnWidth: 100,
  391. },
  392. {
  393. userId: this.$store.state.user.name,
  394. functionId: 107001001,
  395. serialNumber: '107001001Table1RollNo',
  396. tableId: "107001001Table1",
  397. tableName: "IQC报表",
  398. columnProp: 'rollNo',
  399. headerAlign: "center",
  400. align: "center",
  401. columnLabel: '标签条码',
  402. columnHidden: false,
  403. columnImage: false,
  404. columnSortable: false,
  405. sortLv: 0,
  406. status: true,
  407. fixed: '',
  408. columnWidth: 120,
  409. },
  410. {
  411. userId: this.$store.state.user.name,
  412. functionId: 107001001,
  413. serialNumber: '107001001Table1WarehouseName',
  414. tableId: "107001001Table1",
  415. tableName: "IQC报表",
  416. columnProp: 'warehouseName',
  417. headerAlign: "center",
  418. align: "left",
  419. columnLabel: '仓库',
  420. columnHidden: false,
  421. columnImage: false,
  422. columnSortable: false,
  423. sortLv: 0,
  424. status: true,
  425. fixed: '',
  426. columnWidth: 200,
  427. },
  428. {
  429. userId: this.$store.state.user.name,
  430. functionId: 107001001,
  431. serialNumber: '107001001Table1PartNo',
  432. tableId: "107001001Table1",
  433. tableName: "IQC报表",
  434. columnProp: 'partNo',
  435. headerAlign: "center",
  436. align: "center",
  437. columnLabel: '物料编码',
  438. columnHidden: false,
  439. columnImage: false,
  440. columnSortable: false,
  441. sortLv: 0,
  442. status: true,
  443. fixed: '',
  444. columnWidth: 150,
  445. },
  446. {
  447. userId: this.$store.state.user.name,
  448. functionId: 107001001,
  449. serialNumber: '107001001Table1PartDesc',
  450. tableId: "107001001Table1",
  451. tableName: "IQC报表",
  452. columnProp: 'partDesc',
  453. headerAlign: "center",
  454. align: "left",
  455. columnLabel: '物料名称',
  456. columnHidden: false,
  457. columnImage: false,
  458. columnSortable: false,
  459. sortLv: 0,
  460. status: true,
  461. fixed: '',
  462. columnWidth: 350,
  463. },
  464. {
  465. userId: this.$store.state.user.name,
  466. functionId: 107001001,
  467. serialNumber: '107001001Table1Umid',
  468. tableId: "107001001Table1",
  469. tableName: "IQC报表",
  470. columnProp: 'umId',
  471. headerAlign: "center",
  472. align: "left",
  473. columnLabel: '计量单位',
  474. columnHidden: false,
  475. columnImage: false,
  476. columnSortable: false,
  477. sortLv: 0,
  478. status: true,
  479. fixed: '',
  480. columnWidth: 100,
  481. },
  482. {
  483. userId: this.$store.state.user.name,
  484. functionId: 107001001,
  485. serialNumber: '107001001Table1RollQty',
  486. tableId: "107001001Table1",
  487. tableName: "IQC报表",
  488. columnProp: 'rollQty',
  489. headerAlign: "center",
  490. align: "right",
  491. columnLabel: '到货数量',
  492. columnHidden: false,
  493. columnImage: false,
  494. columnSortable: false,
  495. sortLv: 0,
  496. status: true,
  497. fixed: '',
  498. columnWidth: 100,
  499. },
  500. {
  501. userId: this.$store.state.user.name,
  502. functionId: 107001001,
  503. serialNumber: '107001001Table1RollCount',
  504. tableId: "107001001Table1",
  505. tableName: "IQC报表",
  506. columnProp: 'rollCount',
  507. headerAlign: "center",
  508. align: "right",
  509. columnLabel: '送检数量',
  510. columnHidden: false,
  511. columnImage: false,
  512. columnSortable: false,
  513. sortLv: 0,
  514. status: true,
  515. fixed: '',
  516. columnWidth: 100,
  517. },
  518. {
  519. userId: this.$store.state.user.name,
  520. functionId: 107001001,
  521. serialNumber: '107001001Table1SamplingQty',
  522. tableId: "107001001Table1",
  523. tableName: "IQC报表",
  524. columnProp: 'samplingQty',
  525. headerAlign: "center",
  526. align: "right",
  527. columnLabel: '抽样数量',
  528. columnHidden: false,
  529. columnImage: false,
  530. columnSortable: false,
  531. sortLv: 0,
  532. status: true,
  533. fixed: '',
  534. columnWidth: 100,
  535. },
  536. {
  537. userId: this.$store.state.user.name,
  538. functionId: 107001001,
  539. serialNumber: '107001001Table1PassQty',
  540. tableId: "107001001Table1",
  541. tableName: "IQC报表",
  542. columnProp: 'passQty',
  543. headerAlign: "center",
  544. align: "right",
  545. columnLabel: '合格数量',
  546. columnHidden: false,
  547. columnImage: false,
  548. columnSortable: false,
  549. sortLv: 0,
  550. status: true,
  551. fixed: '',
  552. columnWidth: 100,
  553. },
  554. {
  555. userId: this.$store.state.user.name,
  556. functionId: 107001001,
  557. serialNumber: '107001001Table1NotPassQty',
  558. tableId: "107001001Table1",
  559. tableName: "IQC报表",
  560. columnProp: 'notPassQty',
  561. headerAlign: "center",
  562. align: "right",
  563. columnLabel: '不合格数量',
  564. columnHidden: false,
  565. columnImage: false,
  566. columnSortable: false,
  567. sortLv: 0,
  568. status: true,
  569. fixed: '',
  570. columnWidth: 100,
  571. },
  572. {
  573. userId: this.$store.state.user.name,
  574. functionId: 107001001,
  575. serialNumber: '107001001Table1PoOrderNo',
  576. tableId: "107001001Table1",
  577. tableName: "IQC报表",
  578. columnProp: 'poOrderNo',
  579. headerAlign: "center",
  580. align: "center",
  581. columnLabel: '单据号',
  582. columnHidden: false,
  583. columnImage: false,
  584. columnSortable: false,
  585. sortLv: 0,
  586. status: true,
  587. fixed: '',
  588. columnWidth: 130,
  589. },
  590. {
  591. userId: this.$store.state.user.name,
  592. functionId: 107001001,
  593. serialNumber: '107001001Table1ReceiptNo',
  594. tableId: "107001001Table1",
  595. tableName: "IQC报表",
  596. columnProp: 'receiptNo',
  597. headerAlign: "center",
  598. align: "center",
  599. columnLabel: '通知单号',
  600. columnHidden: false,
  601. columnImage: false,
  602. columnSortable: false,
  603. sortLv: 0,
  604. status: true,
  605. fixed: '',
  606. columnWidth: 130,
  607. },
  608. {
  609. userId: this.$store.state.user.name,
  610. functionId: 107001001,
  611. serialNumber: '107001001Table1ReceiptItemNo',
  612. tableId: "107001001Table1",
  613. tableName: "IQC报表",
  614. columnProp: 'receiptItemNo',
  615. headerAlign: "center",
  616. align: "center",
  617. columnLabel: '通知单序号',
  618. columnHidden: false,
  619. columnImage: false,
  620. columnSortable: false,
  621. sortLv: 0,
  622. status: true,
  623. fixed: '',
  624. columnWidth: 100,
  625. },
  626. {
  627. userId: this.$store.state.user.name,
  628. functionId: 107001001,
  629. serialNumber: '107001001Table1RefInfo1',
  630. tableId: "107001001Table1",
  631. tableName: "IQC报表",
  632. columnProp: 'refInfo1',
  633. headerAlign: "center",
  634. align: "center",
  635. columnLabel: '关联单号1',
  636. columnHidden: false,
  637. columnImage: false,
  638. columnSortable: false,
  639. sortLv: 0,
  640. status: true,
  641. fixed: '',
  642. columnWidth: 130,
  643. },
  644. {
  645. userId: this.$store.state.user.name,
  646. functionId: 107001001,
  647. serialNumber: '107001001Table1RefInfo2',
  648. tableId: "107001001Table1",
  649. tableName: "IQC报表",
  650. columnProp: 'refInfo2',
  651. headerAlign: "center",
  652. align: "center",
  653. columnLabel: '关联单号2',
  654. columnHidden: false,
  655. columnImage: false,
  656. columnSortable: false,
  657. sortLv: 0,
  658. status: true,
  659. fixed: '',
  660. columnWidth: 130,
  661. },
  662. {
  663. userId: this.$store.state.user.name,
  664. functionId: 107001001,
  665. serialNumber: '107001001Table1RefInfo3',
  666. tableId: "107001001Table1",
  667. tableName: "IQC报表",
  668. columnProp: 'refInfo3',
  669. headerAlign: "center",
  670. align: "center",
  671. columnLabel: '关联单号3',
  672. columnHidden: false,
  673. columnImage: false,
  674. columnSortable: false,
  675. sortLv: 0,
  676. status: true,
  677. fixed: '',
  678. columnWidth: 130,
  679. },
  680. {
  681. userId: this.$store.state.user.name,
  682. functionId: 107001001,
  683. serialNumber: '107001001Table1RefInfo4',
  684. tableId: "107001001Table1",
  685. tableName: "IQC报表",
  686. columnProp: 'refInfo4',
  687. headerAlign: "center",
  688. align: "center",
  689. columnLabel: '关联单号4',
  690. columnHidden: false,
  691. columnImage: false,
  692. columnSortable: false,
  693. sortLv: 0,
  694. status: true,
  695. fixed: '',
  696. columnWidth: 130,
  697. },
  698. {
  699. userId: this.$store.state.user.name,
  700. functionId: 107001001,
  701. serialNumber: '107001001Table1RefInfo5',
  702. tableId: "107001001Table1",
  703. tableName: "IQC报表",
  704. columnProp: 'refInfo5',
  705. headerAlign: "center",
  706. align: "center",
  707. columnLabel: '关联单号5',
  708. columnHidden: false,
  709. columnImage: false,
  710. columnSortable: false,
  711. sortLv: 0,
  712. status: true,
  713. fixed: '',
  714. columnWidth: 130,
  715. },
  716. {
  717. userId: this.$store.state.user.name,
  718. functionId: 107001001,
  719. serialNumber: '107001001Table1PoItemNo',
  720. tableId: "107001001Table1",
  721. tableName: "IQC报表",
  722. columnProp: 'poItemNo',
  723. headerAlign: "center",
  724. align: "right",
  725. columnLabel: '单据行号',
  726. columnHidden: false,
  727. columnImage: false,
  728. columnSortable: false,
  729. sortLv: 0,
  730. status: true,
  731. fixed: '',
  732. columnWidth: 100,
  733. },
  734. {
  735. userId: this.$store.state.user.name,
  736. functionId: 107001001,
  737. serialNumber: '107001001Table1SupplierDesc',
  738. tableId: "107001001Table1",
  739. tableName: "IQC报表",
  740. columnProp: 'supplierDesc',
  741. headerAlign: "center",
  742. align: "left",
  743. columnLabel: '供应商',
  744. columnHidden: false,
  745. columnImage: false,
  746. columnSortable: false,
  747. sortLv: 0,
  748. status: true,
  749. fixed: '',
  750. columnWidth: 200,
  751. },
  752. {
  753. userId: this.$store.state.user.name,
  754. functionId: 107001001,
  755. serialNumber: '107001001Table1InspectionRemark',
  756. tableId: "107001001Table1",
  757. tableName: "IQC报表",
  758. columnProp: 'inspectionRemark',
  759. headerAlign: "center",
  760. align: "left",
  761. columnLabel: '质检备注',
  762. columnHidden: false,
  763. columnImage: false,
  764. columnSortable: false,
  765. sortLv: 0,
  766. status: true,
  767. fixed: '',
  768. columnWidth: 200,
  769. },
  770. {
  771. userId: this.$store.state.user.name,
  772. functionId: 107001001,
  773. serialNumber: '107001001Table1DisposalMeasures',
  774. tableId: "107001001Table1",
  775. tableName: "IQC报表",
  776. columnProp: 'disposalMeasures',
  777. headerAlign: "center",
  778. align: "center",
  779. columnLabel: '处置措施',
  780. columnHidden: false,
  781. columnImage: false,
  782. columnSortable: false,
  783. sortLv: 0,
  784. status: true,
  785. fixed: '',
  786. columnWidth: 120,
  787. },
  788. {
  789. userId: this.$store.state.user.name,
  790. functionId: 107001001,
  791. serialNumber: '107001001Table1DisposalRemark',
  792. tableId: "107001001Table1",
  793. tableName: "IQC报表",
  794. columnProp: 'disposalRemark',
  795. headerAlign: "center",
  796. align: "left",
  797. columnLabel: '处置说明',
  798. columnHidden: false,
  799. columnImage: false,
  800. columnSortable: false,
  801. sortLv: 0,
  802. status: true,
  803. fixed: '',
  804. columnWidth: 200,
  805. },
  806. {
  807. userId: this.$store.state.user.name,
  808. functionId: 107001001,
  809. serialNumber: '107001001Table1ActionDate',
  810. tableId: "107001001Table1",
  811. tableName: "IQC报表",
  812. columnProp: 'actionDate',
  813. headerAlign: "center",
  814. align: "center",
  815. columnLabel: '开始检验时间',
  816. columnHidden: false,
  817. columnImage: false,
  818. columnSortable: false,
  819. sortLv: 0,
  820. status: true,
  821. fixed: '',
  822. columnWidth: 170,
  823. },
  824. {
  825. userId: this.$store.state.user.name,
  826. functionId: 107001001,
  827. serialNumber: '107001001Table1InspectorDate',
  828. tableId: "107001001Table1",
  829. tableName: "IQC报表",
  830. columnProp: 'inspectorDate',
  831. headerAlign: "center",
  832. align: "center",
  833. columnLabel: '检验时间',
  834. columnHidden: false,
  835. columnImage: false,
  836. columnSortable: false,
  837. sortLv: 0,
  838. status: true,
  839. fixed: '',
  840. columnWidth: 170,
  841. },
  842. {
  843. userId: this.$store.state.user.name,
  844. functionId: 107001001,
  845. serialNumber: '107001001Table1InspectorName',
  846. tableId: "107001001Table1",
  847. tableName: "IQC报表",
  848. columnProp: 'inspectorName',
  849. headerAlign: "center",
  850. align: "center",
  851. columnLabel: '质检员',
  852. columnHidden: false,
  853. columnImage: false,
  854. columnSortable: false,
  855. sortLv: 0,
  856. status: true,
  857. fixed: '',
  858. columnWidth: 100,
  859. },
  860. {
  861. userId: this.$store.state.user.name,
  862. functionId: 107001001,
  863. serialNumber: '107001001Table1ItemNo',
  864. tableId: "107001001Table1",
  865. tableName: "IQC报表",
  866. columnProp: 'itemNo',
  867. headerAlign: "center",
  868. align: "center",
  869. columnLabel: '检验项目编码',
  870. columnHidden: false,
  871. columnImage: false,
  872. columnSortable: false,
  873. sortLv: 0,
  874. status: true,
  875. fixed: '',
  876. columnWidth: 120,
  877. },
  878. {
  879. userId: this.$store.state.user.name,
  880. functionId: 107001001,
  881. serialNumber: '107001001Table1ItemDesc',
  882. tableId: "107001001Table1",
  883. tableName: "IQC报表",
  884. columnProp: 'itemDesc',
  885. headerAlign: "center",
  886. align: "left",
  887. columnLabel: '检验项目名称',
  888. columnHidden: false,
  889. columnImage: false,
  890. columnSortable: false,
  891. sortLv: 0,
  892. status: true,
  893. fixed: '',
  894. columnWidth: 200,
  895. },
  896. {
  897. userId: this.$store.state.user.name,
  898. functionId: 107001001,
  899. serialNumber: '107001001Table1DefaultValue',
  900. tableId: "107001001Table1",
  901. tableName: "IQC报表",
  902. columnProp: 'defaultValue',
  903. headerAlign: "center",
  904. align: "center",
  905. columnLabel: '标准值',
  906. columnHidden: false,
  907. columnImage: false,
  908. columnSortable: false,
  909. sortLv: 0,
  910. status: true,
  911. fixed: '',
  912. columnWidth: 100,
  913. },
  914. {
  915. userId: this.$store.state.user.name,
  916. functionId: 107001001,
  917. serialNumber: '107001001Table1MaxValue',
  918. tableId: "107001001Table1",
  919. tableName: "IQC报表",
  920. columnProp: 'maxValue',
  921. headerAlign: "center",
  922. align: "right",
  923. columnLabel: '上限值',
  924. columnHidden: false,
  925. columnImage: false,
  926. columnSortable: false,
  927. sortLv: 0,
  928. status: true,
  929. fixed: '',
  930. columnWidth: 100,
  931. },
  932. {
  933. userId: this.$store.state.user.name,
  934. functionId: 107001001,
  935. serialNumber: '107001001Table1MinValue',
  936. tableId: "107001001Table1",
  937. tableName: "IQC报表",
  938. columnProp: 'minValue',
  939. headerAlign: "center",
  940. align: "right",
  941. columnLabel: '下限值',
  942. columnHidden: false,
  943. columnImage: false,
  944. columnSortable: false,
  945. sortLv: 0,
  946. status: true,
  947. fixed: '',
  948. columnWidth: 100,
  949. },
  950. {
  951. userId: this.$store.state.user.name,
  952. functionId: 107001001,
  953. serialNumber: '107001001Table1ItemSamplingQty',
  954. tableId: "107001001Table1",
  955. tableName: "IQC报表",
  956. columnProp: 'itemSamplingQty',
  957. headerAlign: "center",
  958. align: "right",
  959. columnLabel: '抽样数量(项目)',
  960. columnHidden: false,
  961. columnImage: false,
  962. columnSortable: false,
  963. sortLv: 0,
  964. status: true,
  965. fixed: '',
  966. columnWidth: 100,
  967. },
  968. {
  969. userId: this.$store.state.user.name,
  970. functionId: 107001001,
  971. serialNumber: '107001001Table1UnqualifiedQuantity',
  972. tableId: "107001001Table1",
  973. tableName: "IQC报表",
  974. columnProp: 'unqualifiedQuantity',
  975. headerAlign: "center",
  976. align: "right",
  977. columnLabel: '不合格数量(项目)',
  978. columnHidden: false,
  979. columnImage: false,
  980. columnSortable: false,
  981. sortLv: 0,
  982. status: true,
  983. fixed: '',
  984. columnWidth: 120,
  985. },
  986. {
  987. userId: this.$store.state.user.name,
  988. functionId: 107001001,
  989. serialNumber: '107001001Table1TextValue',
  990. tableId: "107001001Table1",
  991. tableName: "IQC报表",
  992. columnProp: 'textValue',
  993. headerAlign: "center",
  994. align: "center",
  995. columnLabel: '实测值',
  996. columnHidden: false,
  997. columnImage: false,
  998. columnSortable: false,
  999. sortLv: 0,
  1000. status: true,
  1001. fixed: '',
  1002. columnWidth: 100,
  1003. },
  1004. {
  1005. userId: this.$store.state.user.name,
  1006. functionId: 107001001,
  1007. serialNumber: '107001001Table1ItemResultDesc',
  1008. tableId: "107001001Table1",
  1009. tableName: "IQC报表",
  1010. columnProp: 'itemResultDesc',
  1011. headerAlign: "center",
  1012. align: "center",
  1013. columnLabel: '项目检验结论',
  1014. columnHidden: false,
  1015. columnImage: false,
  1016. columnSortable: false,
  1017. sortLv: 0,
  1018. status: true,
  1019. fixed: '',
  1020. columnWidth: 100,
  1021. },
  1022. ],
  1023. SubDetailColumnList: [
  1024. {
  1025. userId: this.$store.state.user.name,
  1026. functionId: 107001001,
  1027. serialNumber: '107001001Table2SamplingLocation',
  1028. tableId: "107001001Table2",
  1029. tableName: "IQC子明细",
  1030. columnProp: 'samplingLocation',
  1031. headerAlign: "center",
  1032. align: "center",
  1033. columnLabel: '抽样位置A',
  1034. columnHidden: false,
  1035. columnImage: false,
  1036. columnSortable: false,
  1037. sortLv: 0,
  1038. status: true,
  1039. fixed: '',
  1040. columnWidth: 100,
  1041. },
  1042. {
  1043. userId: this.$store.state.user.name,
  1044. functionId: 107001001,
  1045. serialNumber: '107001001Table2SamplingLocationB',
  1046. tableId: "107001001Table2",
  1047. tableName: "IQC子明细",
  1048. columnProp: 'samplingLocationB',
  1049. headerAlign: "center",
  1050. align: "center",
  1051. columnLabel: '抽样位置B',
  1052. columnHidden: false,
  1053. columnImage: false,
  1054. columnSortable: false,
  1055. sortLv: 0,
  1056. status: true,
  1057. fixed: '',
  1058. columnWidth: 100,
  1059. },
  1060. {
  1061. userId: this.$store.state.user.name,
  1062. functionId: 107001001,
  1063. serialNumber: '107001001Table2SubDetailValue',
  1064. tableId: "107001001Table2",
  1065. tableName: "IQC子明细",
  1066. columnProp: 'subDetailValue',
  1067. headerAlign: "center",
  1068. align: "center",
  1069. columnLabel: '实测值',
  1070. columnHidden: false,
  1071. columnImage: false,
  1072. columnSortable: false,
  1073. sortLv: 0,
  1074. status: true,
  1075. fixed: '',
  1076. columnWidth: 100,
  1077. },
  1078. ],
  1079. options: [],
  1080. userBuList: [],
  1081. authSearch: false,
  1082. menuId: this.$route.meta.menuId,
  1083. subDetailModalFlag: false,
  1084. subDetailDataList: [],
  1085. currentRow: {},
  1086. disposalMeasuresOptions: [],
  1087. downLoading: false
  1088. }
  1089. },
  1090. mounted () {
  1091. this.$nextTick(() => {
  1092. this.height = window.innerHeight - 250
  1093. })
  1094. },
  1095. created () {
  1096. // 按钮控制
  1097. this.getButtonAuthData()
  1098. // 获取用户的 site 和 bu
  1099. this.getSiteAndBuByUserName()
  1100. // 获取处置措施
  1101. this.disposalMeasuresSearch()
  1102. // 校验用户是否收藏
  1103. this.favoriteIsOk()
  1104. // 动态列
  1105. this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
  1106. if (!this.authSearch) {
  1107. // 获取数据列表
  1108. this.getDataList()
  1109. }
  1110. },
  1111. methods: {
  1112. // 导出按钮
  1113. downloadQcRecord () {
  1114. this.downLoading = true
  1115. downloadQcRecord(this.searchData)
  1116. .then(response => {
  1117. const blob = new Blob([response.data],{ type: 'application/vnd.ms-excel'});
  1118. const url = window.URL.createObjectURL(blob);
  1119. const link= document.createElement('a');
  1120. link.href = url;
  1121. link.download='IQC报表.xlsx';// 设置下载文件名
  1122. link.click();
  1123. window.URL.revokeObjectURL(url);//释放URL对象
  1124. this.downLoading = false
  1125. }).catch(()=>{
  1126. this.downLoading = false
  1127. })
  1128. },
  1129. // 单机选中
  1130. IQCClickRow (row) {
  1131. this.currentRow = JSON.parse(JSON.stringify(row))
  1132. },
  1133. rowStyle ({row}) {
  1134. if (this.currentRow.inspectionNo === row.inspectionNo && this.currentRow.itemNo === row.itemNo) {
  1135. return { 'background-color': '#E8F7F6', cursor: 'pointer' }
  1136. }
  1137. },
  1138. // 获取用户的bu
  1139. getSiteAndBuByUserName () {
  1140. let tempData = {
  1141. username: this.$store.state.user.name,
  1142. }
  1143. getSiteAndBuByUserName(tempData).then(({data}) => {
  1144. if (data.code === 0) {
  1145. this.userBuList = data.rows
  1146. }
  1147. })
  1148. },
  1149. // 每页数
  1150. sizeChangeHandle (val) {
  1151. this.pageSize = val
  1152. this.pageIndex = 1
  1153. this.getDataList()
  1154. },
  1155. // 当前页
  1156. currentChangeHandle (val) {
  1157. this.pageIndex = val
  1158. this.getDataList()
  1159. },
  1160. // 查询获取数据列表
  1161. getDataList () {
  1162. this.searchData.limit = this.pageSize
  1163. this.searchData.page = this.pageIndex
  1164. getIQCReport(this.searchData).then(({data}) => {
  1165. if (data.code === 0) {
  1166. this.dataList = data.page.list
  1167. this.pageIndex = data.page.currPage
  1168. this.pageSize = data.page.pageSize
  1169. this.totalPage = data.page.totalCount
  1170. }
  1171. })
  1172. },
  1173. // 子明细每页数
  1174. sizeChangeHandle2 (val) {
  1175. this.pageSize2 = val
  1176. },
  1177. // 子明细当前页
  1178. currentChangeHandle2 (val) {
  1179. this.pageIndex2 = val
  1180. },
  1181. // 打开子明细
  1182. subDetailModal (row) {
  1183. this.pageIndex2 = 1
  1184. selectIQCSubDetailedRecord(row).then(({data}) => {
  1185. if (data && data.code === 0) {
  1186. this.subDetailDataList = data.rows
  1187. this.subDetailModalFlag = true
  1188. }
  1189. })
  1190. },
  1191. // 获取处置措施列表
  1192. disposalMeasuresSearch () {
  1193. let tempData = {
  1194. inspectionTypeNo: '105'
  1195. }
  1196. disposalMeasuresSearch(tempData).then(({data}) => {
  1197. if (data.code === 0) {
  1198. this.disposalMeasuresOptions = data.rows
  1199. }
  1200. })
  1201. },
  1202. // 获取基础数据列表S
  1203. getBaseList (val,type) {
  1204. this.tagNo = val
  1205. this.$nextTick(() => {
  1206. let strVal = ''
  1207. if (val === 508) {
  1208. strVal = this.searchData.warehouseId
  1209. this.$refs.baseList.init(val, strVal)
  1210. }
  1211. if (val === 509) {
  1212. strVal = this.searchData.supplierNo
  1213. this.$refs.baseList.init(val, strVal)
  1214. }
  1215. })
  1216. },
  1217. // 列表方法的回调
  1218. getBaseData (val) {
  1219. if (this.tagNo === 508) {
  1220. this.searchData.warehouseId = val.WareHouseID
  1221. }
  1222. if (this.tagNo === 509) {
  1223. this.searchData.supplierNo = val.SupplierID
  1224. }
  1225. },
  1226. // 校验用户是否收藏
  1227. favoriteIsOk () {
  1228. let userFavorite = {
  1229. userId: this.$store.state.user.id,
  1230. languageCode: this.$i18n.locale
  1231. }
  1232. userFavoriteList(userFavorite).then(({data}) => {
  1233. for (let i = 0; i < data.list.length; i++) {
  1234. if(this.$route.meta.menuId === data.list[i].menuId){
  1235. this.favorite = true
  1236. }
  1237. }
  1238. })
  1239. },
  1240. // 收藏 OR 取消收藏
  1241. favoriteFunction () {
  1242. let userFavorite = {
  1243. userId: this.$store.state.user.id,
  1244. functionId: this.$route.meta.menuId,
  1245. }
  1246. if (this.favorite) {
  1247. removeUserFavorite(userFavorite).then(({data}) => {
  1248. this.$message.success(data.msg)
  1249. this.favorite = false
  1250. })
  1251. } else {
  1252. // 收藏
  1253. saveUserFavorite(userFavorite).then(({data}) => {
  1254. this.$message.success(data.msg)
  1255. this.favorite = true
  1256. })
  1257. }
  1258. },
  1259. //导出excel
  1260. async createExportData() {
  1261. this.searchData.limit = -1
  1262. this.searchData.page = 1
  1263. await getIQCReport(this.searchData).then(({data}) => {
  1264. this.exportList = data.page.list
  1265. })
  1266. return this.exportList
  1267. },
  1268. startDownload() {},
  1269. finishDownload() {},
  1270. fields () {
  1271. let json = "{"
  1272. this.columnList.forEach((item, index) => {
  1273. if (index == this.columnList.length - 1) {
  1274. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  1275. } else {
  1276. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  1277. }
  1278. })
  1279. json += "}"
  1280. let s = eval("(" + json + ")")
  1281. return s
  1282. },
  1283. // 动态列开始 获取 用户保存的 格式列
  1284. async getTableUserColumn (tableId, columnId) {
  1285. let queryTableUser = {
  1286. userId: this.$store.state.user.name,
  1287. functionId: this.$route.meta.menuId,
  1288. tableId: tableId,
  1289. status: true,
  1290. languageCode: this.$i18n.locale
  1291. }
  1292. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  1293. if (data.rows.length > 0) {
  1294. switch (columnId) {
  1295. case 1:
  1296. this.columnList = data.rows
  1297. break
  1298. }
  1299. } else {
  1300. this.getColumnList(tableId, columnId)
  1301. }
  1302. })
  1303. },
  1304. // 获取 tableDefault 列
  1305. async getColumnList (tableId, columnId) {
  1306. let queryTable = {
  1307. functionId: this.$route.meta.menuId,
  1308. tableId: tableId,
  1309. languageCode: this.$i18n.locale
  1310. }
  1311. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  1312. if (!data.rows.length === 0) {
  1313. switch (columnId) {
  1314. case 1:
  1315. this.columnList = data.rows
  1316. break
  1317. }
  1318. }
  1319. })
  1320. },
  1321. //获取按钮的权限数据
  1322. getButtonAuthData () {
  1323. let searchFlag = this.isAuth(this.menuId+":search")
  1324. //处理页面的权限数据
  1325. this.authSearch = !searchFlag
  1326. },
  1327. }
  1328. }
  1329. </script>
  1330. <style scoped>
  1331. .el-table /deep/ .cell{
  1332. height: auto;
  1333. line-height: 1.5;
  1334. }
  1335. </style>