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.

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