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.

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