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.

1295 lines
42 KiB

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