赫艾前端
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.

1332 lines
43 KiB

  1. <template>
  2. <div class="mod-config">
  3. <!-- 条件查询 -->
  4. <el-form :inline="true" label-position="top" :model="searchData">
  5. <el-form-item :label="'BU'">
  6. <el-select v-model="searchData.buDesc" placeholder="请选择BU" clearable style="width: 120px">
  7. <el-option
  8. v-for = "i in buList"
  9. :key = "i.buNo"
  10. :label = "i.buDesc"
  11. :value = "i.buDesc">
  12. </el-option>
  13. </el-select>
  14. </el-form-item>
  15. <el-form-item :label="'检验单号'">
  16. <el-input v-model="searchData.inspectionNo" clearable style="width: 140px"></el-input>
  17. </el-form-item>
  18. <el-form-item :label="'销售订单'">
  19. <el-input v-model="searchData.poOrderNo" clearable style="width: 150px"></el-input>
  20. </el-form-item>
  21. <el-form-item :label="'客户编码'">
  22. <el-input v-model="searchData.customerNo" clearable style="width: 120px"></el-input>
  23. </el-form-item>
  24. <el-form-item :label="'客户名称'">
  25. <el-input v-model="searchData.customerName" clearable style="width: 200px"></el-input>
  26. </el-form-item>
  27. <el-form-item :label="'物料编码'">
  28. <el-input v-model="searchData.partNo" clearable style="width: 120px"></el-input>
  29. </el-form-item>
  30. <el-form-item :label="'物料名称'">
  31. <el-input v-model="searchData.partDesc" clearable style="width: 200px"></el-input>
  32. </el-form-item>
  33. </el-form>
  34. <el-form :inline="true" label-position="top" :model="searchData">
  35. <el-form-item :label="'规格型号'">
  36. <el-input v-model="searchData.spec" clearable style="width: 150px"></el-input>
  37. </el-form-item>
  38. <el-form-item :label="'SKU'">
  39. <el-input v-model="searchData.sku" clearable style="width: 120px"></el-input>
  40. </el-form-item>
  41. <el-form-item :label="'PN'">
  42. <el-input v-model="searchData.cinvSourceCode" clearable style="width: 120px"></el-input>
  43. </el-form-item>
  44. <el-form-item :label="'质检员'">
  45. <el-input v-model="searchData.inspectorName" clearable style="width: 100px"></el-input>
  46. </el-form-item>
  47. <el-form-item :label="'状态'">
  48. <el-select v-model="searchData.states" multiple style="width: 340px">
  49. <el-option label="未开始" value="未开始"></el-option>
  50. <el-option label="待检验" value="待检验"></el-option>
  51. <el-option label="待审核" value="待审核"></el-option>
  52. <el-option label="已完成" value="已完成"></el-option>
  53. </el-select>
  54. </el-form-item>
  55. <el-form-item :label="'检验结论'">
  56. <el-select v-model="searchData.inspectionResult" clearable style="width: 80px">
  57. <el-option label="合格" value="合格"></el-option>
  58. <el-option label="不合格" value="不合格"></el-option>
  59. <el-option label="免检" value="免检"></el-option>
  60. </el-select>
  61. </el-form-item>
  62. <el-form-item :label="'检验项目编码'">
  63. <el-input v-model="searchData.itemNo" clearable style="width: 100px"></el-input>
  64. </el-form-item>
  65. <el-form-item :label="'检验项目名称'">
  66. <el-input v-model="searchData.itemDesc" clearable style="width: 150px"></el-input>
  67. </el-form-item>
  68. <el-form-item :label="'项目检验结论'">
  69. <el-select v-model="searchData.itemResult" clearable style="width: 80px">
  70. <el-option label="合格" value="Y"></el-option>
  71. <el-option label="不合格" value="N"></el-option>
  72. </el-select>
  73. </el-form-item>
  74. <el-form-item :label="'处置措施'">
  75. <el-select v-model="searchData.disposalMeasures" clearable style="width: 90px">
  76. <el-option
  77. v-for = "i in disposalMeasuresOptions"
  78. :key = "i.id"
  79. :label = "i.disposalMeasures"
  80. :value = "i.disposalMeasures">
  81. </el-option>
  82. </el-select>
  83. </el-form-item>
  84. </el-form>
  85. <el-form :inline="true" label-position="top" :model="searchData">
  86. <el-form-item :label="'协同人员'">
  87. <el-input v-model="searchData.operatorName" clearable style="width: 150px"></el-input>
  88. </el-form-item>
  89. <el-form-item :label="'责任人'">
  90. <el-input v-model="searchData.responsiblePersonName" clearable style="width: 150px"></el-input>
  91. </el-form-item>
  92. <el-form-item :label="'送检日期'">
  93. <el-date-picker style="width: 150px" v-model="searchData.startDate2" type="datetime" value-format='yyyy-MM-dd HH:mm' format='yyyy-MM-dd HH:mm' placeholder="开始日期"></el-date-picker>
  94. -
  95. <el-date-picker style="width: 150px" v-model="searchData.endDate2" type="datetime" value-format='yyyy-MM-dd HH:mm' format='yyyy-MM-dd HH:mm' placeholder="结束日期"></el-date-picker>
  96. </el-form-item>
  97. <el-form-item :label="'检验时间'">
  98. <el-date-picker style="width: 150px" v-model="searchData.startDate" type="datetime" value-format='yyyy-MM-dd HH:mm' format='yyyy-MM-dd HH:mm' placeholder="开始日期"></el-date-picker>
  99. -
  100. <el-date-picker style="width: 150px" v-model="searchData.endDate" type="datetime" value-format='yyyy-MM-dd HH:mm' format='yyyy-MM-dd HH:mm' placeholder="结束日期"></el-date-picker>
  101. </el-form-item>
  102. <el-form-item :label="' '">
  103. <el-button v-if="!authSearch" type="primary" :loading="searchLoading" @click="getDataList">查询</el-button>
  104. <el-button v-if="!authSearch" type="primary" :loading="downLoading" @click="downloadQcDetailRecord">导出</el-button>
  105. </el-form-item>
  106. </el-form>
  107. <!-- 展示列表 -->
  108. <el-table
  109. :height="height"
  110. :data="dataList"
  111. border
  112. v-loading="searchLoading"
  113. element-loading-text="拼命加载中"
  114. @row-click="OQCClickRow"
  115. :row-style="rowStyle"
  116. style="width: 100%;">
  117. <el-table-column
  118. v-for="(item,index) in columnList" :key="index"
  119. :sortable="item.columnSortable"
  120. :prop="item.columnProp"
  121. :header-align="item.headerAlign"
  122. :show-overflow-tooltip="item.showOverflowTooltip"
  123. :align="item.align"
  124. :fixed="item.fixed==''?false:item.fixed"
  125. :min-width="item.columnWidth"
  126. :label="item.columnLabel">
  127. <template slot-scope="scope">
  128. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  129. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  130. </template>
  131. </el-table-column>
  132. </el-table>
  133. <el-pagination
  134. @size-change="sizeChangeHandle"
  135. @current-change="currentChangeHandle"
  136. :current-page="pageIndex"
  137. :page-sizes="[20, 50, 100, 200, 500]"
  138. :page-size="pageSize"
  139. :total="totalPage"
  140. layout="total, sizes, prev, pager, next, jumper">
  141. </el-pagination>
  142. <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
  143. </div>
  144. </template>
  145. <script>
  146. import {
  147. getOQCDetailReport, // 查询
  148. downloadQcDetailRecord, // 导出
  149. } from "@/api/qc/qc_report.js"
  150. import {disposalMeasuresSearch, getSiteAndBuByUserName2,} from "@/api/qc/qc.js"
  151. import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
  152. import {removeUserFavorite, saveUserFavorite, userFavoriteList} from '@/api/userFavorite.js'
  153. import Chooselist from '@/views/modules/common/Chooselist_eam'
  154. import QcReportFileTable from "../qc/QCReportFileTable.vue";
  155. import axios from "axios";
  156. export default {
  157. components: {
  158. QcReportFileTable,
  159. Chooselist
  160. },
  161. data () {
  162. return {
  163. // 是否收藏
  164. favorite: false,
  165. // 导出 start
  166. exportData: [],
  167. exportName: "OQC明细报表" + this.dayjs().format('YYYYMMDDHHmmss'),
  168. exportHeader: ["OQC明细报表"],
  169. exportFooter: [],
  170. exportList: [],
  171. // 导出 end
  172. searchData: {
  173. site: '',
  174. userName: this.$store.state.user.name,
  175. inspectionNo: '',
  176. inspectionTypeNo:'110',
  177. isQualified: '',
  178. buDesc: '',
  179. startDate: '',
  180. endDate: '',
  181. startDate2: '',
  182. endDate2: '',
  183. partNo:'',
  184. partDesc:'',
  185. spec:'',
  186. cinvSourceCode:'',
  187. sku:'',
  188. state: '',
  189. inspectionResult: '',
  190. customerNo: '',
  191. customerName: '',
  192. disposalMeasures: '',
  193. inspectorName: '',
  194. page: 1,
  195. limit: 10,
  196. poOrderNo: '',
  197. states: [],
  198. operatorName: '',
  199. responsiblePersonName: '',
  200. itemResult: '',
  201. downloadType: 'oqc',
  202. itemNo: '',
  203. itemDesc: ''
  204. },
  205. pageIndex: 1,
  206. pageSize: 20,
  207. totalPage: 0,
  208. height: 200,
  209. dataList: [],
  210. // 标头展示
  211. columnList: [
  212. {
  213. userId: this.$store.state.user.name,
  214. functionId: 107001012,
  215. serialNumber: '107001012Table1State',
  216. tableId: "107001012Table1",
  217. tableName: "OQC明细报表",
  218. columnProp: 'state',
  219. headerAlign: "center",
  220. align: "center",
  221. columnLabel: '状态',
  222. columnHidden: false,
  223. columnImage: false,
  224. columnSortable: false,
  225. sortLv: 0,
  226. status: true,
  227. fixed: '',
  228. columnWidth: 100,
  229. },
  230. {
  231. userId: this.$store.state.user.name,
  232. functionId: 107001012,
  233. serialNumber: '107001012Table1BuDesc',
  234. tableId: "107001012Table1",
  235. tableName: "OQC明细报表",
  236. columnProp: 'buDesc',
  237. headerAlign: "center",
  238. align: "center",
  239. columnLabel: 'BU',
  240. columnHidden: false,
  241. columnImage: false,
  242. columnSortable: false,
  243. sortLv: 0,
  244. status: true,
  245. fixed: '',
  246. columnWidth: 100,
  247. },
  248. {
  249. userId: this.$store.state.user.name,
  250. functionId: 107001012,
  251. serialNumber: '107001012Table1InspectionNo',
  252. tableId: "107001012Table1",
  253. tableName: "OQC明细报表",
  254. columnProp: 'inspectionNo',
  255. headerAlign: "center",
  256. align: "center",
  257. columnLabel: '检验单号',
  258. columnHidden: false,
  259. columnImage: false,
  260. columnSortable: false,
  261. sortLv: 0,
  262. status: true,
  263. fixed: '',
  264. columnWidth: 120,
  265. },
  266. {
  267. userId: this.$store.state.user.name,
  268. functionId: 107001012,
  269. serialNumber: '107001012Table1InspectionResult',
  270. tableId: "107001012Table1",
  271. tableName: "OQC明细报表",
  272. columnProp: 'inspectionResult',
  273. headerAlign: "center",
  274. align: "center",
  275. columnLabel: '检验结论',
  276. columnHidden: false,
  277. columnImage: false,
  278. columnSortable: false,
  279. sortLv: 0,
  280. status: true,
  281. fixed: '',
  282. columnWidth: 100,
  283. },
  284. {
  285. userId: this.$store.state.user.name,
  286. functionId: 107001012,
  287. serialNumber: '107001012Table1TaskDate',
  288. tableId: "107001012Table1",
  289. tableName: "OQC明细报表",
  290. columnProp: 'taskDate',
  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: 130,
  301. },
  302. {
  303. userId: this.$store.state.user.name,
  304. functionId: 107001012,
  305. serialNumber: '107001012Table1InspectionCycle',
  306. tableId: "107001012Table1",
  307. tableName: "OQC明细报表",
  308. columnProp: 'inspectionCycle',
  309. headerAlign: "center",
  310. align: "right",
  311. columnLabel: '检验周期(h)',
  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: 107001012,
  323. serialNumber: '107001012Table1RollNo',
  324. tableId: "107001012Table1",
  325. tableName: "OQC明细报表",
  326. columnProp: 'rollNo',
  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: 107001012,
  341. serialNumber: '107001012Table1PartNo',
  342. tableId: "107001012Table1",
  343. tableName: "OQC明细报表",
  344. columnProp: 'partNo',
  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: 150,
  355. },
  356. {
  357. userId: this.$store.state.user.name,
  358. functionId: 107001012,
  359. serialNumber: '107001012Table1Spec',
  360. tableId: "107001012Table1",
  361. tableName: "OQC明细报表",
  362. columnProp: 'spec',
  363. headerAlign: "center",
  364. align: "left",
  365. columnLabel: '规格型号',
  366. columnHidden: false,
  367. columnImage: false,
  368. columnSortable: false,
  369. sortLv: 0,
  370. status: true,
  371. fixed: '',
  372. columnWidth: 120,
  373. },
  374. {
  375. userId: this.$store.state.user.name,
  376. functionId: 107001012,
  377. serialNumber: '107001012Table1PartDesc',
  378. tableId: "107001012Table1",
  379. tableName: "OQC明细报表",
  380. columnProp: 'partDesc',
  381. headerAlign: "center",
  382. align: "left",
  383. columnLabel: '物料名称',
  384. columnHidden: false,
  385. columnImage: false,
  386. columnSortable: false,
  387. sortLv: 0,
  388. status: true,
  389. fixed: '',
  390. columnWidth: 350,
  391. },
  392. {
  393. userId: this.$store.state.user.name,
  394. functionId: 107001012,
  395. serialNumber: '107001012Table1Sku',
  396. tableId: "107001012Table1",
  397. tableName: "OQC明细报表",
  398. columnProp: 'sku',
  399. headerAlign: "center",
  400. align: "left",
  401. columnLabel: 'SKU',
  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: 107001012,
  413. serialNumber: '107001012Table1CinvSourceCode',
  414. tableId: "107001012Table1",
  415. tableName: "OQC明细报表",
  416. columnProp: 'cinvSourceCode',
  417. headerAlign: "center",
  418. align: "left",
  419. columnLabel: 'PN',
  420. columnHidden: false,
  421. columnImage: false,
  422. columnSortable: false,
  423. sortLv: 0,
  424. status: true,
  425. fixed: '',
  426. columnWidth: 120,
  427. },
  428. {
  429. userId: this.$store.state.user.name,
  430. functionId: 107001012,
  431. serialNumber: '107001012Table1Invdefinetype',
  432. tableId: "107001012Table1",
  433. tableName: "OQC明细报表",
  434. columnProp: 'invdefinetype',
  435. headerAlign: "center",
  436. align: "left",
  437. columnLabel: '物料类别',
  438. columnHidden: false,
  439. columnImage: false,
  440. columnSortable: false,
  441. sortLv: 0,
  442. status: true,
  443. fixed: '',
  444. columnWidth: 120,
  445. },
  446. {
  447. userId: this.$store.state.user.name,
  448. functionId: 107001012,
  449. serialNumber: '107001012Table1Umid',
  450. tableId: "107001012Table1",
  451. tableName: "OQC明细报表",
  452. columnProp: 'umId',
  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: 100,
  463. },
  464. {
  465. userId: this.$store.state.user.name,
  466. functionId: 107001012,
  467. serialNumber: '107001012Table1RollQty',
  468. tableId: "107001012Table1",
  469. tableName: "OQC明细报表",
  470. columnProp: 'rollQty',
  471. headerAlign: "center",
  472. align: "right",
  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: 107001012,
  485. serialNumber: '107001012Table1RollCount',
  486. tableId: "107001012Table1",
  487. tableName: "OQC明细报表",
  488. columnProp: 'rollCount',
  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: 107001012,
  503. serialNumber: '107001012Table1SamplingQty',
  504. tableId: "107001012Table1",
  505. tableName: "OQC明细报表",
  506. columnProp: 'samplingQty',
  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: 107001012,
  521. serialNumber: '107001012Table1PoOrderNo',
  522. tableId: "107001012Table1",
  523. tableName: "OQC明细报表",
  524. columnProp: 'poOrderNo',
  525. headerAlign: "center",
  526. align: "center",
  527. columnLabel: '单据号',
  528. columnHidden: false,
  529. columnImage: false,
  530. columnSortable: false,
  531. sortLv: 0,
  532. status: true,
  533. fixed: '',
  534. columnWidth: 130,
  535. },
  536. {
  537. userId: this.$store.state.user.name,
  538. functionId: 107001012,
  539. serialNumber: '107001012Table1OrderType',
  540. tableId: "107001012Table1",
  541. tableName: "OQC明细报表",
  542. columnProp: 'orderType',
  543. headerAlign: "center",
  544. align: "center",
  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: 107001012,
  557. serialNumber: '107001012Table1SubmissionType',
  558. tableId: "107001012Table1",
  559. tableName: "OQC明细报表",
  560. columnProp: 'submissionType',
  561. headerAlign: "center",
  562. align: "center",
  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: 107001012,
  575. serialNumber: '107001012Table1PoItemNo',
  576. tableId: "107001012Table1",
  577. tableName: "OQC明细报表",
  578. columnProp: 'poItemNo',
  579. headerAlign: "center",
  580. align: "right",
  581. columnLabel: '单据行号',
  582. columnHidden: false,
  583. columnImage: false,
  584. columnSortable: false,
  585. sortLv: 0,
  586. status: true,
  587. fixed: '',
  588. columnWidth: 100,
  589. },
  590. {
  591. userId: this.$store.state.user.name,
  592. functionId: 107001012,
  593. serialNumber: '107001012Table1SupplierDesc',
  594. tableId: "107001012Table1",
  595. tableName: "OQC明细报表",
  596. columnProp: 'supplierDesc',
  597. headerAlign: "center",
  598. align: "left",
  599. columnLabel: '供应商',
  600. columnHidden: false,
  601. columnImage: false,
  602. columnSortable: false,
  603. sortLv: 0,
  604. status: true,
  605. fixed: '',
  606. columnWidth: 200,
  607. },
  608. {
  609. userId: this.$store.state.user.name,
  610. functionId: 107001012,
  611. serialNumber: '107001012Table1InspectionRemark',
  612. tableId: "107001012Table1",
  613. tableName: "OQC明细报表",
  614. columnProp: 'inspectionRemark',
  615. headerAlign: "center",
  616. align: "left",
  617. columnLabel: '质检备注',
  618. columnHidden: false,
  619. columnImage: false,
  620. columnSortable: false,
  621. sortLv: 0,
  622. status: true,
  623. fixed: '',
  624. columnWidth: 200,
  625. },
  626. {
  627. userId: this.$store.state.user.name,
  628. functionId: 107001012,
  629. serialNumber: '107001012Table1DisposalMeasures',
  630. tableId: "107001012Table1",
  631. tableName: "OQC明细报表",
  632. columnProp: 'disposalMeasures',
  633. headerAlign: "center",
  634. align: "center",
  635. columnLabel: '处置措施',
  636. columnHidden: false,
  637. columnImage: false,
  638. columnSortable: false,
  639. sortLv: 0,
  640. status: true,
  641. fixed: '',
  642. columnWidth: 120,
  643. },
  644. {
  645. userId: this.$store.state.user.name,
  646. functionId: 107001012,
  647. serialNumber: '107001012Table1DisposalRemark',
  648. tableId: "107001012Table1",
  649. tableName: "OQC明细报表",
  650. columnProp: 'disposalRemark',
  651. headerAlign: "center",
  652. align: "left",
  653. columnLabel: '处置说明',
  654. columnHidden: false,
  655. columnImage: false,
  656. columnSortable: false,
  657. sortLv: 0,
  658. status: true,
  659. fixed: '',
  660. columnWidth: 200,
  661. },
  662. {
  663. userId: this.$store.state.user.name,
  664. functionId: 107001012,
  665. serialNumber: '107001012Table1ActionDate',
  666. tableId: "107001012Table1",
  667. tableName: "OQC明细报表",
  668. columnProp: 'actionDate',
  669. headerAlign: "center",
  670. align: "center",
  671. columnLabel: '开始检验时间',
  672. columnHidden: false,
  673. columnImage: false,
  674. columnSortable: false,
  675. sortLv: 0,
  676. status: true,
  677. fixed: '',
  678. columnWidth: 170,
  679. },
  680. {
  681. userId: this.$store.state.user.name,
  682. functionId: 107001012,
  683. serialNumber: '107001012Table1InspectorDate',
  684. tableId: "107001012Table1",
  685. tableName: "OQC明细报表",
  686. columnProp: 'inspectorDate',
  687. headerAlign: "center",
  688. align: "center",
  689. columnLabel: '检验时间',
  690. columnHidden: false,
  691. columnImage: false,
  692. columnSortable: false,
  693. sortLv: 0,
  694. status: true,
  695. fixed: '',
  696. columnWidth: 170,
  697. },
  698. {
  699. userId: this.$store.state.user.name,
  700. functionId: 107001012,
  701. serialNumber: '107001012Table1InspectorName',
  702. tableId: "107001012Table1",
  703. tableName: "OQC明细报表",
  704. columnProp: 'inspectorName',
  705. headerAlign: "center",
  706. align: "center",
  707. columnLabel: '质检员',
  708. columnHidden: false,
  709. columnImage: false,
  710. columnSortable: false,
  711. sortLv: 0,
  712. status: true,
  713. fixed: '',
  714. columnWidth: 100,
  715. },
  716. {
  717. userId: this.$store.state.user.name,
  718. functionId: 107001012,
  719. serialNumber: '107001012Table1OperatorName',
  720. tableId: "107001012Table1",
  721. tableName: "OQC明细报表",
  722. columnProp: 'operatorName',
  723. headerAlign: "center",
  724. align: "left",
  725. columnLabel: '协同人员',
  726. columnHidden: false,
  727. columnImage: false,
  728. columnSortable: false,
  729. sortLv: 0,
  730. status: true,
  731. fixed: '',
  732. columnWidth: 200,
  733. },
  734. {
  735. userId: this.$store.state.user.name,
  736. functionId: 107001012,
  737. serialNumber: '107001012Table1ResponsiblePersonName',
  738. tableId: "107001012Table1",
  739. tableName: "OQC明细报表",
  740. columnProp: 'responsiblePersonName',
  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: 107001012,
  755. serialNumber: '107001012Table1SubmissionRemark',
  756. tableId: "107001012Table1",
  757. tableName: "OQC明细报表",
  758. columnProp: 'submissionRemark',
  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: 107001012,
  773. serialNumber: '107001012Table1ItemNo',
  774. tableId: "107001012Table1",
  775. tableName: "OQC明细报表",
  776. columnProp: 'itemNo',
  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: 107001012,
  791. serialNumber: '107001012Table1ItemDesc',
  792. tableId: "107001012Table1",
  793. tableName: "OQC明细报表",
  794. columnProp: 'itemDesc',
  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: 107001012,
  809. serialNumber: '107001012Table1DefaultValue',
  810. tableId: "107001012Table1",
  811. tableName: "OQC明细报表",
  812. columnProp: 'defaultValue',
  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: 100,
  823. },
  824. {
  825. userId: this.$store.state.user.name,
  826. functionId: 107001012,
  827. serialNumber: '107001012Table1MaxValue',
  828. tableId: "107001012Table1",
  829. tableName: "OQC明细报表",
  830. columnProp: 'maxValue',
  831. headerAlign: "center",
  832. align: "right",
  833. columnLabel: '上限值',
  834. columnHidden: false,
  835. columnImage: false,
  836. columnSortable: false,
  837. sortLv: 0,
  838. status: true,
  839. fixed: '',
  840. columnWidth: 100,
  841. },
  842. {
  843. userId: this.$store.state.user.name,
  844. functionId: 107001012,
  845. serialNumber: '107001012Table1MinValue',
  846. tableId: "107001012Table1",
  847. tableName: "OQC明细报表",
  848. columnProp: 'minValue',
  849. headerAlign: "center",
  850. align: "right",
  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: 107001012,
  863. serialNumber: '107001012Table1ItemSamplingQty',
  864. tableId: "107001012Table1",
  865. tableName: "OQC明细报表",
  866. columnProp: 'itemSamplingQty',
  867. headerAlign: "center",
  868. align: "right",
  869. columnLabel: '抽样数量(项目)',
  870. columnHidden: false,
  871. columnImage: false,
  872. columnSortable: false,
  873. sortLv: 0,
  874. status: true,
  875. fixed: '',
  876. columnWidth: 100,
  877. },
  878. {
  879. userId: this.$store.state.user.name,
  880. functionId: 107001012,
  881. serialNumber: '107001012Table1UnqualifiedQuantity',
  882. tableId: "107001012Table1",
  883. tableName: "OQC明细报表",
  884. columnProp: 'unqualifiedQuantity',
  885. headerAlign: "center",
  886. align: "right",
  887. columnLabel: '不合格数量(项目)',
  888. columnHidden: false,
  889. columnImage: false,
  890. columnSortable: false,
  891. sortLv: 0,
  892. status: true,
  893. fixed: '',
  894. columnWidth: 120,
  895. },
  896. {
  897. userId: this.$store.state.user.name,
  898. functionId: 107001012,
  899. serialNumber: '107001012Table1TextValue',
  900. tableId: "107001012Table1",
  901. tableName: "OQC明细报表",
  902. columnProp: 'textValue',
  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: 107001012,
  917. serialNumber: '107001012Table1ItemResultDesc',
  918. tableId: "107001012Table1",
  919. tableName: "OQC明细报表",
  920. columnProp: 'itemResultDesc',
  921. headerAlign: "center",
  922. align: "center",
  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: 107001012,
  935. serialNumber: '107001012Table1SamplingLocation',
  936. tableId: "107001012Table1",
  937. tableName: "OQC明细报表",
  938. columnProp: 'samplingLocation',
  939. headerAlign: "center",
  940. align: "left",
  941. columnLabel: '默认抽样位置A',
  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: 107001012,
  953. serialNumber: '107001012Table1SamplingLocationB',
  954. tableId: "107001012Table1",
  955. tableName: "OQC明细报表",
  956. columnProp: 'samplingLocationB',
  957. headerAlign: "center",
  958. align: "left",
  959. columnLabel: '默认抽样位置B',
  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: 107001012,
  971. serialNumber: '107001012Table1SubDetailValue',
  972. tableId: "107001012Table1",
  973. tableName: "OQC明细报表",
  974. columnProp: 'subDetailValue',
  975. headerAlign: "center",
  976. align: "right",
  977. columnLabel: '实测值A',
  978. columnHidden: false,
  979. columnImage: false,
  980. columnSortable: false,
  981. sortLv: 0,
  982. status: true,
  983. fixed: '',
  984. columnWidth: 100,
  985. },
  986. {
  987. userId: this.$store.state.user.name,
  988. functionId: 107001012,
  989. serialNumber: '107001012Table1SubDetailValueB',
  990. tableId: "107001012Table1",
  991. tableName: "OQC明细报表",
  992. columnProp: 'subDetailValueB',
  993. headerAlign: "center",
  994. align: "right",
  995. columnLabel: '实测值B',
  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: 107001012,
  1007. serialNumber: '107001012Table1SubDetailValueC',
  1008. tableId: "107001012Table1",
  1009. tableName: "OQC明细报表",
  1010. columnProp: 'subDetailValueC',
  1011. headerAlign: "center",
  1012. align: "right",
  1013. columnLabel: '实测值C',
  1014. columnHidden: false,
  1015. columnImage: false,
  1016. columnSortable: false,
  1017. sortLv: 0,
  1018. status: true,
  1019. fixed: '',
  1020. columnWidth: 100,
  1021. },
  1022. {
  1023. userId: this.$store.state.user.name,
  1024. functionId: 107001012,
  1025. serialNumber: '107001012Table1SubDetailValueD',
  1026. tableId: "107001012Table1",
  1027. tableName: "OQC明细报表",
  1028. columnProp: 'subDetailValueD',
  1029. headerAlign: "center",
  1030. align: "right",
  1031. columnLabel: '实测值D',
  1032. columnHidden: false,
  1033. columnImage: false,
  1034. columnSortable: false,
  1035. sortLv: 0,
  1036. status: true,
  1037. fixed: '',
  1038. columnWidth: 100,
  1039. },
  1040. {
  1041. userId: this.$store.state.user.name,
  1042. functionId: 107001012,
  1043. serialNumber: '107001012Table1SubDetailValueE',
  1044. tableId: "107001012Table1",
  1045. tableName: "OQC明细报表",
  1046. columnProp: 'subDetailValueE',
  1047. headerAlign: "center",
  1048. align: "right",
  1049. columnLabel: '实测值E',
  1050. columnHidden: false,
  1051. columnImage: false,
  1052. columnSortable: false,
  1053. sortLv: 0,
  1054. status: true,
  1055. fixed: '',
  1056. columnWidth: 100,
  1057. },
  1058. ],
  1059. buList: [],
  1060. authSearch: false,
  1061. menuId: this.$route.meta.menuId,
  1062. currentRow: {},
  1063. disposalMeasuresOptions: [],
  1064. searchLoading: false,
  1065. downLoading: false
  1066. }
  1067. },
  1068. mounted () {
  1069. this.$nextTick(() => {
  1070. this.height = window.innerHeight - 250
  1071. })
  1072. },
  1073. created () {
  1074. // 按钮控制
  1075. this.getButtonAuthData()
  1076. // 获取用户的 site 和 bu
  1077. this.getSiteAndBuByUserName2()
  1078. // 获取处置措施
  1079. this.disposalMeasuresSearch()
  1080. // 校验用户是否收藏
  1081. this.favoriteIsOk()
  1082. // 动态列
  1083. this.getTableUserColumn(this.$route.meta.menuId+'table',1)
  1084. if (!this.authSearch) {
  1085. // 获取数据列表
  1086. //this.getDataList()
  1087. }
  1088. },
  1089. methods: {
  1090. // 导出按钮
  1091. downloadQcDetailRecord () {
  1092. this.downLoading = true
  1093. downloadQcDetailRecord(this.searchData)
  1094. .then(response => {
  1095. const blob = new Blob([response.data],{ type: 'application/vnd.ms-excel'});
  1096. const url = window.URL.createObjectURL(blob);
  1097. const link= document.createElement('a');
  1098. link.href = url;
  1099. link.download='OQC检验单明细.xlsx';// 设置下载文件名
  1100. link.click();
  1101. window.URL.revokeObjectURL(url);//释放URL对象
  1102. this.downLoading = false
  1103. }).catch(()=>{
  1104. this.downLoading = false
  1105. })
  1106. },
  1107. // 单机选中
  1108. OQCClickRow (row) {
  1109. this.currentRow = JSON.parse(JSON.stringify(row))
  1110. },
  1111. rowStyle ({row}) {
  1112. if (this.currentRow.id === row.id) {
  1113. return { 'background-color': '#E8F7F6', cursor: 'pointer' }
  1114. }
  1115. },
  1116. // 获取用户的bu
  1117. getSiteAndBuByUserName2 () {
  1118. let tempData = {
  1119. username: this.$store.state.user.name,
  1120. }
  1121. getSiteAndBuByUserName2(tempData).then(({data}) => {
  1122. if (data.code === 0) {
  1123. this.buList = data.rows
  1124. }
  1125. })
  1126. },
  1127. // 每页数
  1128. sizeChangeHandle (val) {
  1129. this.pageSize = val
  1130. this.pageIndex = 1
  1131. this.getDataList()
  1132. },
  1133. // 当前页
  1134. currentChangeHandle (val) {
  1135. this.pageIndex = val
  1136. this.getDataList()
  1137. },
  1138. // 查询获取数据列表
  1139. getDataList () {
  1140. let searchFlag = true
  1141. Object.keys(this.searchData).forEach(val=>{
  1142. if (val !== 'userName' && val !== 'inspectionTypeNo' && val !== 'page' && val !== 'limit' && val !== 'downloadType') {
  1143. if (this.searchData[val].length > 0) {
  1144. searchFlag = false
  1145. return
  1146. }
  1147. }
  1148. })
  1149. if (searchFlag) {
  1150. this.$message.warning('请填写查询条件后再执行操作!')
  1151. return
  1152. }
  1153. this.searchLoading = true
  1154. this.searchData.limit = this.pageSize
  1155. this.searchData.page = this.pageIndex
  1156. getOQCDetailReport(this.searchData).then(({data}) => {
  1157. if (data.code === 0) {
  1158. this.dataList = data.page.list
  1159. this.pageIndex = data.page.currPage
  1160. this.pageSize = data.page.pageSize
  1161. this.totalPage = data.page.totalCount
  1162. }
  1163. this.searchLoading = false
  1164. }).catch(()=>{
  1165. this.searchLoading = false
  1166. })
  1167. },
  1168. // 获取处置措施列表
  1169. disposalMeasuresSearch () {
  1170. let tempData = {
  1171. inspectionTypeNo: '110'
  1172. }
  1173. disposalMeasuresSearch(tempData).then(({data}) => {
  1174. if (data.code === 0) {
  1175. this.disposalMeasuresOptions = data.rows
  1176. }
  1177. })
  1178. },
  1179. // 获取基础数据列表S
  1180. getBaseList (val,type) {
  1181. this.tagNo = val
  1182. this.$nextTick(() => {
  1183. let strVal = ''
  1184. if (val === 508) {
  1185. strVal = this.searchData.warehouseId
  1186. this.$refs.baseList.init(val, strVal)
  1187. }
  1188. if (val === 509) {
  1189. strVal = this.searchData.supplierNo
  1190. this.$refs.baseList.init(val, strVal)
  1191. }
  1192. })
  1193. },
  1194. // 列表方法的回调
  1195. getBaseData (val) {
  1196. if (this.tagNo === 508) {
  1197. this.searchData.warehouseId = val.WareHouseID
  1198. }
  1199. if (this.tagNo === 509) {
  1200. this.searchData.supplierNo = val.SupplierID
  1201. }
  1202. },
  1203. // 校验用户是否收藏
  1204. favoriteIsOk () {
  1205. let userFavorite = {
  1206. userId: this.$store.state.user.id,
  1207. languageCode: this.$i18n.locale
  1208. }
  1209. userFavoriteList(userFavorite).then(({data}) => {
  1210. for (let i = 0; i < data.list.length; i++) {
  1211. if(this.$route.meta.menuId === data.list[i].menuId){
  1212. this.favorite = true
  1213. }
  1214. }
  1215. })
  1216. },
  1217. // 收藏 OR 取消收藏
  1218. favoriteFunction () {
  1219. let userFavorite = {
  1220. userId: this.$store.state.user.id,
  1221. functionId: this.$route.meta.menuId,
  1222. }
  1223. if (this.favorite) {
  1224. removeUserFavorite(userFavorite).then(({data}) => {
  1225. this.$message.success(data.msg)
  1226. this.favorite = false
  1227. })
  1228. } else {
  1229. // 收藏
  1230. saveUserFavorite(userFavorite).then(({data}) => {
  1231. this.$message.success(data.msg)
  1232. this.favorite = true
  1233. })
  1234. }
  1235. },
  1236. //导出excel
  1237. async createExportData() {
  1238. this.searchData.limit = -1
  1239. this.searchData.page = 1
  1240. await getOQCDetailReport(this.searchData).then(({data}) => {
  1241. this.exportList= data.page.list
  1242. })
  1243. return this.exportList
  1244. },
  1245. startDownload() {},
  1246. finishDownload() {},
  1247. fields () {
  1248. return this.columnList.reduce((acc, item, index) => {
  1249. acc[item.columnLabel] = item.columnProp;
  1250. return acc;
  1251. }, {});
  1252. },
  1253. // 动态列开始 获取 用户保存的 格式列
  1254. async getTableUserColumn (tableId, columnId) {
  1255. let queryTableUser = {
  1256. userId: this.$store.state.user.name,
  1257. functionId: this.$route.meta.menuId,
  1258. tableId: tableId,
  1259. status: true,
  1260. languageCode: this.$i18n.locale
  1261. }
  1262. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  1263. if (data.rows.length > 0) {
  1264. switch (columnId) {
  1265. case 1:
  1266. this.columnList = data.rows
  1267. break
  1268. }
  1269. } else {
  1270. this.getColumnList(tableId, columnId)
  1271. }
  1272. })
  1273. },
  1274. // 获取 tableDefault 列
  1275. async getColumnList (tableId, columnId) {
  1276. let queryTable = {
  1277. functionId: this.$route.meta.menuId,
  1278. tableId: tableId,
  1279. languageCode: this.$i18n.locale
  1280. }
  1281. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  1282. if (!data.rows.length === 0) {
  1283. switch (columnId) {
  1284. case 1:
  1285. this.columnList = data.rows
  1286. break
  1287. }
  1288. }
  1289. })
  1290. },
  1291. //获取按钮的权限数据
  1292. getButtonAuthData () {
  1293. let searchFlag = this.isAuth(this.menuId+":search")
  1294. //处理页面的权限数据
  1295. this.authSearch = !searchFlag
  1296. },
  1297. }
  1298. }
  1299. </script>
  1300. <style scoped>
  1301. .el-table /deep/ .cell{
  1302. height: auto;
  1303. line-height: 1.5;
  1304. }
  1305. </style>