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.

1240 lines
40 KiB

  1. <template>
  2. <div class="mod-config">
  3. <!-- 收藏 -->
  4. <div>
  5. <span @click="favoriteFunction()">
  6. <icon-svg :name="favorite?'xiangqufill':'xiangqu'" class="sl-svg"></icon-svg>
  7. </span>
  8. </div>
  9. <!-- 条件查询 -->
  10. <el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList">
  11. <el-form-item :label="'BU'">
  12. <el-select v-model="searchData.buNo" placeholder="请选择" clearable style="width: 75px">
  13. <el-option
  14. v-for = "i in buList"
  15. :key = "i.buNo"
  16. :label = "i.buDesc"
  17. :value = "i.buNo">
  18. </el-option>
  19. </el-select>
  20. </el-form-item>
  21. <el-form-item :label="'检验单号'">
  22. <el-input v-model="searchData.inspectionNo" clearable style="width: 120px"></el-input>
  23. </el-form-item>
  24. <el-form-item :label="'物料编码'">
  25. <el-input v-model="searchData.partNo" clearable style="width: 120px"></el-input>
  26. </el-form-item>
  27. <el-form-item :label="'物料名称'">
  28. <el-input v-model="searchData.partDesc" clearable style="width: 307px"></el-input>
  29. </el-form-item>
  30. <el-form-item :label="'SKU'">
  31. <el-input v-model="searchData.sku" clearable style="width: 150px"></el-input>
  32. </el-form-item>
  33. <el-form-item :label="'PN'">
  34. <el-input v-model="searchData.cinvSourceCode" clearable style="width: 150px"></el-input>
  35. </el-form-item>
  36. </el-form>
  37. <el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList">
  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" @keyup.enter.native="getDataList">
  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: 150px" 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: 150px" 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"
  92. value-format='yyyy-MM-dd HH:mm:ss' format='yyyy-MM-dd HH:mm:ss' placeholder="开始日期">
  93. </el-date-picker>
  94. -
  95. <el-date-picker style="width: 170px" v-model="searchData.endDate" type="datetime"
  96. value-format='yyyy-MM-dd HH:mm:ss' format='yyyy-MM-dd HH:mm:ss' placeholder="结束日期">
  97. </el-date-picker>
  98. </el-form-item>
  99. <el-form-item :label="' '">
  100. <el-button v-if="!authSearch" type="primary" @click="getDataList">查询</el-button>
  101. <download-excel
  102. :fields="fields()"
  103. :data="exportData"
  104. type="xls"
  105. :name="exportName"
  106. :header="exportHeader"
  107. :footer="exportFooter"
  108. :fetch="createExportData"
  109. :before-generate="startDownload"
  110. :before-finish="finishDownload"
  111. worksheet="导出信息"
  112. class="el-button el-button--primary el-button--medium">
  113. {{ "导出" }}
  114. </download-excel>
  115. </el-form-item>
  116. </el-form>
  117. <!-- 展示列表 -->
  118. <el-table
  119. :height="height"
  120. :data="dataList"
  121. border
  122. @row-click="FAIClickRow"
  123. :row-style="rowStyle"
  124. style="width: 100%;">
  125. <el-table-column
  126. v-for="(item,index) in columnList" :key="index"
  127. :sortable="item.columnSortable"
  128. :prop="item.columnProp"
  129. :header-align="item.headerAlign"
  130. :show-overflow-tooltip="item.showOverflowTooltip"
  131. :align="item.align"
  132. :fixed="item.fixed==''?false:item.fixed"
  133. :width="item.columnWidth"
  134. :label="item.columnLabel">
  135. <template slot-scope="scope">
  136. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  137. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  138. </template>
  139. </el-table-column>
  140. <el-table-column
  141. fixed="right"
  142. header-align="center"
  143. align="center"
  144. width="90"
  145. label="操作">
  146. <template slot-scope="scope">
  147. <a style="cursor: pointer" @click="subDetailModal(scope.row)">检验明细</a>
  148. </template>
  149. </el-table-column>
  150. </el-table>
  151. <el-pagination
  152. @size-change="sizeChangeHandle"
  153. @current-change="currentChangeHandle"
  154. :current-page="pageIndex"
  155. :page-sizes="[20, 50, 100, 200, 500]"
  156. :page-size="pageSize"
  157. :total="totalPage"
  158. layout="total, sizes, prev, pager, next, jumper">
  159. </el-pagination>
  160. <el-drawer title="检验项目子明细" :visible.sync="subDetailModalFlag" direction="rtl" :with-header="false">
  161. <div style="padding: 5px">
  162. <el-table
  163. :height="height + 210"
  164. :data="templateTableData"
  165. border
  166. style="width: 100%;">
  167. <el-table-column
  168. v-for="(item,index) in SubDetailColumnList" :key="index"
  169. :sortable="item.columnSortable"
  170. :prop="item.columnProp"
  171. :header-align="item.headerAlign"
  172. :show-overflow-tooltip="item.showOverflowTooltip"
  173. :align="item.align"
  174. :fixed="item.fixed==''?false:item.fixed"
  175. :min-width="item.columnWidth"
  176. :label="item.columnLabel">
  177. <template slot-scope="scope">
  178. <span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span>
  179. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  180. </template>
  181. </el-table-column>
  182. </el-table>
  183. <!-- 分页-->
  184. <el-pagination
  185. @size-change="sizeChangeHandle2"
  186. @current-change="currentChangeHandle2"
  187. :current-page="pageIndex2"
  188. :page-sizes="[20, 50, 100, 200, 500]"
  189. :page-size="pageSize2"
  190. :total="subDetailDataList.length"
  191. layout="total, sizes, prev, pager, next, jumper">
  192. </el-pagination>
  193. </div>
  194. </el-drawer>
  195. </div>
  196. </template>
  197. <script>
  198. import {
  199. getFAIReport, // 获取FAI报表
  200. } from "@/api/qc/qc_report.js"
  201. import {
  202. getSiteAndBuByUserName2, // 获取site bu
  203. selectFAISubDetailedRecord, // 查询子明细
  204. disposalMeasuresSearch, // 获取处置措施列表
  205. } from "@/api/qc/qc.js"
  206. import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
  207. import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
  208. export default {
  209. computed: {
  210. templateTableData () {
  211. let start = (this.pageIndex2 - 1) * this.pageSize2
  212. let end = start + this.pageSize2
  213. if (end > this.subDetailDataList.length){
  214. end = this.subDetailDataList.length
  215. }
  216. return this.subDetailDataList.slice(start,end)
  217. }
  218. },
  219. data () {
  220. return {
  221. // 是否收藏
  222. favorite: false,
  223. // 导出 start
  224. exportData: [],
  225. exportName: "FAI报表" + this.dayjs().format('YYYYMMDDHHmmss'),
  226. exportHeader: ["FAI报表"],
  227. exportFooter: [],
  228. exportList: [],
  229. // 导出 end
  230. searchData: {
  231. site: '',
  232. userName: this.$store.state.user.name,
  233. inspectionNo: '',
  234. state: '',
  235. inspectionResult: '',
  236. orderNo: '',
  237. operationDesc: '',
  238. buNo: '',
  239. startDate: '',
  240. endDate: '',
  241. startDate2: '',
  242. endDate2: '',
  243. partNo: '',
  244. partDesc: '',
  245. cinvSourceCode: '',
  246. sku: '',
  247. disposalMeasures: '',
  248. page: 1,
  249. limit: 10,
  250. seqNo: '',
  251. states: [],
  252. operatorName: '',
  253. responsiblePersonName: '',
  254. itemResult: ''
  255. },
  256. pageIndex: 1,
  257. pageSize: 20,
  258. totalPage: 0,
  259. pageIndex2: 1,
  260. pageSize2: 50,
  261. totalPage2: 0,
  262. height: 200,
  263. dataList: [],
  264. // 标头展示
  265. columnList: [
  266. {
  267. userId: this.$store.state.user.name,
  268. functionId: 107001003,
  269. serialNumber: '107001003Table1State',
  270. tableId: "107001003Table1",
  271. tableName: "FAI报表",
  272. columnProp: 'state',
  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: 107001003,
  287. serialNumber: '107001003Table1BuDesc',
  288. tableId: "107001003Table1",
  289. tableName: "FAI报表",
  290. columnProp: 'buDesc',
  291. headerAlign: "center",
  292. align: "center",
  293. columnLabel: 'BU',
  294. columnHidden: false,
  295. columnImage: false,
  296. columnSortable: false,
  297. sortLv: 0,
  298. status: true,
  299. fixed: '',
  300. columnWidth: 100,
  301. },
  302. {
  303. userId: this.$store.state.user.name,
  304. functionId: 107001003,
  305. serialNumber: '107001003Table1InspectionNo',
  306. tableId: "107001003Table1",
  307. tableName: "FAI报表",
  308. columnProp: 'inspectionNo',
  309. headerAlign: "center",
  310. align: "center",
  311. columnLabel: '检验单号',
  312. columnHidden: false,
  313. columnImage: false,
  314. columnSortable: false,
  315. sortLv: 0,
  316. status: true,
  317. fixed: '',
  318. columnWidth: 120,
  319. },
  320. {
  321. userId: this.$store.state.user.name,
  322. functionId: 107001003,
  323. serialNumber: '107001003Table1RollNo',
  324. tableId: "107001003Table1",
  325. tableName: "FAI报表",
  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: 107001003,
  341. serialNumber: '107001003Table1InspectionResult',
  342. tableId: "107001003Table1",
  343. tableName: "FAI报表",
  344. columnProp: 'inspectionResult',
  345. headerAlign: "center",
  346. align: "center",
  347. columnLabel: '检验结论',
  348. columnHidden: false,
  349. columnImage: false,
  350. columnSortable: false,
  351. sortLv: 0,
  352. status: true,
  353. fixed: '',
  354. columnWidth: 100,
  355. },
  356. {
  357. userId: this.$store.state.user.name,
  358. functionId: 107001003,
  359. serialNumber: '107001003Table1DisposalMeasures',
  360. tableId: "107001003Table1",
  361. tableName: "FAI报表",
  362. columnProp: 'disposalMeasures',
  363. headerAlign: "center",
  364. align: "center",
  365. columnLabel: '处置措施',
  366. columnHidden: false,
  367. columnImage: false,
  368. columnSortable: false,
  369. sortLv: 0,
  370. status: true,
  371. fixed: '',
  372. columnWidth: 120,
  373. },
  374. {
  375. userId: this.$store.state.user.name,
  376. functionId: 107001003,
  377. serialNumber: '107001003Table1TaskDate',
  378. tableId: "107001003Table1",
  379. tableName: "FAI报表",
  380. columnProp: 'taskDate',
  381. headerAlign: "center",
  382. align: "center",
  383. columnLabel: '送检日期',
  384. columnHidden: false,
  385. columnImage: false,
  386. columnSortable: false,
  387. sortLv: 0,
  388. status: true,
  389. fixed: '',
  390. columnWidth: 130,
  391. },
  392. {
  393. userId: this.$store.state.user.name,
  394. functionId: 107001003,
  395. serialNumber: '107001003Table1InspectionCycle',
  396. tableId: "107001003Table1",
  397. tableName: "FAI报表",
  398. columnProp: 'inspectionCycle',
  399. headerAlign: "center",
  400. align: "right",
  401. columnLabel: '检验周期(h)',
  402. columnHidden: false,
  403. columnImage: false,
  404. columnSortable: false,
  405. sortLv: 0,
  406. status: true,
  407. fixed: '',
  408. columnWidth: 100,
  409. },
  410. {
  411. userId: this.$store.state.user.name,
  412. functionId: 107001003,
  413. serialNumber: '107001003Table1OrderNo',
  414. tableId: "107001003Table1",
  415. tableName: "FAI报表",
  416. columnProp: 'orderNo',
  417. headerAlign: "center",
  418. align: "left",
  419. columnLabel: '工单号',
  420. columnHidden: false,
  421. columnImage: false,
  422. columnSortable: false,
  423. sortLv: 0,
  424. status: true,
  425. fixed: '',
  426. columnWidth: 120,
  427. },
  428. {
  429. userId: this.$store.state.user.name,
  430. functionId: 107001003,
  431. serialNumber: '107001003Table1SeqNo',
  432. tableId: "107001003Table1",
  433. tableName: "FAI报表",
  434. columnProp: 'seqNo',
  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: 150,
  445. },
  446. {
  447. userId: this.$store.state.user.name,
  448. functionId: 107001003,
  449. serialNumber: '107001003Table1OperationDesc',
  450. tableId: "107001003Table1",
  451. tableName: "FAI报表",
  452. columnProp: 'operationDesc',
  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: 107001003,
  467. serialNumber: '107001003Table1ResourceDesc',
  468. tableId: "107001003Table1",
  469. tableName: "FAI报表",
  470. columnProp: 'resourceDesc',
  471. headerAlign: "center",
  472. align: "left",
  473. columnLabel: '机台',
  474. columnHidden: false,
  475. columnImage: false,
  476. columnSortable: false,
  477. sortLv: 0,
  478. status: true,
  479. fixed: '',
  480. columnWidth: 100,
  481. },
  482. {
  483. userId: this.$store.state.user.name,
  484. functionId: 107001003,
  485. serialNumber: '107001003Table1PartNo',
  486. tableId: "107001003Table1",
  487. tableName: "FAI报表",
  488. columnProp: 'partNo',
  489. headerAlign: "center",
  490. align: "center",
  491. columnLabel: '物料编码',
  492. columnHidden: false,
  493. columnImage: false,
  494. columnSortable: false,
  495. sortLv: 0,
  496. status: true,
  497. fixed: '',
  498. columnWidth: 150,
  499. },
  500. {
  501. userId: this.$store.state.user.name,
  502. functionId: 107001003,
  503. serialNumber: '107001003Table1PartDesc',
  504. tableId: "107001003Table1",
  505. tableName: "FAI报表",
  506. columnProp: 'partDesc',
  507. headerAlign: "center",
  508. align: "left",
  509. columnLabel: '物料名称',
  510. columnHidden: false,
  511. columnImage: false,
  512. columnSortable: false,
  513. sortLv: 0,
  514. status: true,
  515. fixed: '',
  516. columnWidth: 350,
  517. },
  518. {
  519. userId: this.$store.state.user.name,
  520. functionId: 107001003,
  521. serialNumber: '107001003Table1Sku',
  522. tableId: "107001003Table1",
  523. tableName: "FAI报表",
  524. columnProp: 'sku',
  525. headerAlign: "center",
  526. align: "center",
  527. columnLabel: 'SKU',
  528. columnHidden: false,
  529. columnImage: false,
  530. columnSortable: false,
  531. sortLv: 0,
  532. status: true,
  533. fixed: '',
  534. columnWidth: 120,
  535. },
  536. {
  537. userId: this.$store.state.user.name,
  538. functionId: 107001003,
  539. serialNumber: '107001003Table1cinvSourceCode',
  540. tableId: "107001003Table1",
  541. tableName: "FAI报表",
  542. columnProp: 'cinvSourceCode',
  543. headerAlign: "center",
  544. align: "center",
  545. columnLabel: 'PN',
  546. columnHidden: false,
  547. columnImage: false,
  548. columnSortable: false,
  549. sortLv: 0,
  550. status: true,
  551. fixed: '',
  552. columnWidth: 120,
  553. },
  554. {
  555. userId: this.$store.state.user.name,
  556. functionId: 107001003,
  557. serialNumber: '107001003Table1Invdefinetype',
  558. tableId: "107001003Table1",
  559. tableName: "FAI报表",
  560. columnProp: 'invdefinetype',
  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: 120,
  571. },
  572. {
  573. userId: this.$store.state.user.name,
  574. functionId: 107001003,
  575. serialNumber: '107001003Table1UmName',
  576. tableId: "107001003Table1",
  577. tableName: "FAI报表",
  578. columnProp: 'umName',
  579. headerAlign: "center",
  580. align: "left",
  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: 107001003,
  593. serialNumber: '107001003Table1RollCount',
  594. tableId: "107001003Table1",
  595. tableName: "FAI报表",
  596. columnProp: 'rollCount',
  597. headerAlign: "center",
  598. align: "right",
  599. columnLabel: '送检数量',
  600. columnHidden: false,
  601. columnImage: false,
  602. columnSortable: false,
  603. sortLv: 0,
  604. status: true,
  605. fixed: '',
  606. columnWidth: 100,
  607. },
  608. {
  609. userId: this.$store.state.user.name,
  610. functionId: 107001003,
  611. serialNumber: '107001003Table1SamplingQty',
  612. tableId: "107001003Table1",
  613. tableName: "FAI报表",
  614. columnProp: 'samplingQty',
  615. headerAlign: "center",
  616. align: "right",
  617. columnLabel: '抽样数量',
  618. columnHidden: false,
  619. columnImage: false,
  620. columnSortable: false,
  621. sortLv: 0,
  622. status: true,
  623. fixed: '',
  624. columnWidth: 100,
  625. },
  626. {
  627. userId: this.$store.state.user.name,
  628. functionId: 107001003,
  629. serialNumber: '107001003Table1InspectionRemark',
  630. tableId: "107001003Table1",
  631. tableName: "FAI报表",
  632. columnProp: 'inspectionRemark',
  633. headerAlign: "center",
  634. align: "left",
  635. columnLabel: '质检备注',
  636. columnHidden: false,
  637. columnImage: false,
  638. columnSortable: false,
  639. sortLv: 0,
  640. status: true,
  641. fixed: '',
  642. columnWidth: 200,
  643. },
  644. {
  645. userId: this.$store.state.user.name,
  646. functionId: 107001003,
  647. serialNumber: '107001003Table1DisposalRemark',
  648. tableId: "107001003Table1",
  649. tableName: "FAI报表",
  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: 107001003,
  665. serialNumber: '107001003Table1ActionDate',
  666. tableId: "107001003Table1",
  667. tableName: "FAI报表",
  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: 107001003,
  683. serialNumber: '107001003Table1InspectorDate',
  684. tableId: "107001003Table1",
  685. tableName: "FAI报表",
  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: 107001003,
  701. serialNumber: '107001003Table1InspectorName',
  702. tableId: "107001003Table1",
  703. tableName: "FAI报表",
  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: 107001003,
  719. serialNumber: '107001003Table1OperatorName',
  720. tableId: "107001003Table1",
  721. tableName: "FAI报表",
  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: 107001003,
  737. serialNumber: '107001003Table1ResponsiblePersonName',
  738. tableId: "107001003Table1",
  739. tableName: "FAI报表",
  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: 107001003,
  755. serialNumber: '107001003Table1SpecialRequirements',
  756. tableId: "107001003Table1",
  757. tableName: "FAI报表",
  758. columnProp: 'specialRequirements',
  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: 107001003,
  773. serialNumber: '107001003Table1ItemNo',
  774. tableId: "107001003Table1",
  775. tableName: "FAI报表",
  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: 107001003,
  791. serialNumber: '107001003Table1ItemDesc',
  792. tableId: "107001003Table1",
  793. tableName: "FAI报表",
  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: 107001003,
  809. serialNumber: '107001003Table1DefaultValue',
  810. tableId: "107001003Table1",
  811. tableName: "FAI报表",
  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: 107001003,
  827. serialNumber: '107001003Table1MaxValue',
  828. tableId: "107001003Table1",
  829. tableName: "FAI报表",
  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: 107001003,
  845. serialNumber: '107001003Table1MinValue',
  846. tableId: "107001003Table1",
  847. tableName: "FAI报表",
  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: 107001003,
  863. serialNumber: '107001003Table1ItemSamplingQty',
  864. tableId: "107001003Table1",
  865. tableName: "FAI报表",
  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: 107001003,
  881. serialNumber: '107001003Table1UnqualifiedQuantity',
  882. tableId: "107001003Table1",
  883. tableName: "FAI报表",
  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: 107001003,
  899. serialNumber: '107001003Table1TextValue',
  900. tableId: "107001003Table1",
  901. tableName: "FAI报表",
  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: 107001003,
  917. serialNumber: '107001003Table1ItemResultDesc',
  918. tableId: "107001003Table1",
  919. tableName: "FAI报表",
  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. SubDetailColumnList: [
  934. {
  935. userId: this.$store.state.user.name,
  936. functionId: 107001003,
  937. serialNumber: '107001003Table2SamplingLocation',
  938. tableId: "107001003Table2",
  939. tableName: "FAI子明细",
  940. columnProp: 'samplingLocation',
  941. headerAlign: "center",
  942. align: "center",
  943. columnLabel: '抽样位置A',
  944. columnHidden: false,
  945. columnImage: false,
  946. columnSortable: false,
  947. sortLv: 0,
  948. status: true,
  949. fixed: '',
  950. columnWidth: 100,
  951. },
  952. {
  953. userId: this.$store.state.user.name,
  954. functionId: 107001003,
  955. serialNumber: '107001003Table2SamplingLocationB',
  956. tableId: "107001003Table2",
  957. tableName: "FAI子明细",
  958. columnProp: 'samplingLocationB',
  959. headerAlign: "center",
  960. align: "center",
  961. columnLabel: '抽样位置B',
  962. columnHidden: false,
  963. columnImage: false,
  964. columnSortable: false,
  965. sortLv: 0,
  966. status: true,
  967. fixed: '',
  968. columnWidth: 100,
  969. },
  970. {
  971. userId: this.$store.state.user.name,
  972. functionId: 107001003,
  973. serialNumber: '107001003Table2SubDetailValue',
  974. tableId: "107001003Table2",
  975. tableName: "FAI子明细",
  976. columnProp: 'subDetailValue',
  977. headerAlign: "center",
  978. align: "center",
  979. columnLabel: '实测值',
  980. columnHidden: false,
  981. columnImage: false,
  982. columnSortable: false,
  983. sortLv: 0,
  984. status: true,
  985. fixed: '',
  986. columnWidth: 100,
  987. },
  988. ],
  989. options: [],
  990. buList: [],
  991. authSearch: false,
  992. menuId: this.$route.meta.menuId,
  993. subDetailModalFlag: false,
  994. subDetailDataList: [],
  995. currentRow: {},
  996. disposalMeasuresOptions: [],
  997. }
  998. },
  999. mounted () {
  1000. this.$nextTick(() => {
  1001. this.height = window.innerHeight - 250
  1002. })
  1003. },
  1004. activated () {
  1005. if (this.$route.params.type === 'tokenLogin') {
  1006. this.searchData.buNo = this.$route.params.buNo
  1007. this.searchData.inspectionNo = this.$route.params.docNo
  1008. this.searchData.itemResult = this.$route.params.itemResult
  1009. }
  1010. this.getDataList()
  1011. },
  1012. created () {
  1013. // 按钮控制
  1014. this.getButtonAuthData()
  1015. // 获取用户的 site 和 bu
  1016. this.getSiteAndBuByUserName2()
  1017. // 获取处置措施
  1018. this.disposalMeasuresSearch()
  1019. // 校验用户是否收藏
  1020. this.favoriteIsOk()
  1021. // 动态列
  1022. this.getTableUserColumn(this.$route.meta.menuId+'table',1)
  1023. if (!this.authSearch) {
  1024. // 获取数据列表
  1025. this.getDataList()
  1026. }
  1027. },
  1028. methods: {
  1029. // 单机选中
  1030. FAIClickRow (row) {
  1031. this.currentRow = JSON.parse(JSON.stringify(row))
  1032. },
  1033. rowStyle ({row}) {
  1034. if (this.currentRow.inspectionNo === row.inspectionNo && this.currentRow.itemNo === row.itemNo) {
  1035. return { 'background-color': '#E8F7F6', cursor: 'pointer' }
  1036. }
  1037. },
  1038. // 获取用户的bu
  1039. getSiteAndBuByUserName2 () {
  1040. let tempData = {
  1041. username: this.$store.state.user.name,
  1042. }
  1043. getSiteAndBuByUserName2(tempData).then(({data}) => {
  1044. if (data.code === 0) {
  1045. this.buList = data.rows
  1046. }
  1047. })
  1048. },
  1049. // 每页数
  1050. sizeChangeHandle (val) {
  1051. this.pageSize = val
  1052. this.pageIndex = 1
  1053. this.getDataList()
  1054. },
  1055. // 当前页
  1056. currentChangeHandle (val) {
  1057. this.pageIndex = val
  1058. this.getDataList()
  1059. },
  1060. // 查询获取数据列表
  1061. getDataList () {
  1062. this.searchData.limit = this.pageSize
  1063. this.searchData.page = this.pageIndex
  1064. getFAIReport(this.searchData).then(({data}) => {
  1065. if (data.code === 0) {
  1066. this.dataList = data.page.list
  1067. this.pageIndex = data.page.currPage
  1068. this.pageSize = data.page.pageSize
  1069. this.totalPage = data.page.totalCount
  1070. }
  1071. })
  1072. },
  1073. // 子明细每页数
  1074. sizeChangeHandle2 (val) {
  1075. this.pageSize2 = val
  1076. },
  1077. // 子明细当前页
  1078. currentChangeHandle2 (val) {
  1079. this.pageIndex2 = val
  1080. },
  1081. // 打开子明细
  1082. subDetailModal (row) {
  1083. this.pageIndex2 = 1
  1084. selectFAISubDetailedRecord(row).then(({data}) => {
  1085. if (data && data.code === 0) {
  1086. this.subDetailDataList = data.rows
  1087. this.subDetailModalFlag = true
  1088. }
  1089. })
  1090. },
  1091. // 获取处置措施列表
  1092. disposalMeasuresSearch () {
  1093. let tempData = {
  1094. inspectionTypeNo: '106'
  1095. }
  1096. disposalMeasuresSearch(tempData).then(({data}) => {
  1097. if (data.code === 0) {
  1098. this.disposalMeasuresOptions = data.rows
  1099. }
  1100. })
  1101. },
  1102. // 校验用户是否收藏
  1103. favoriteIsOk () {
  1104. let userFavorite = {
  1105. userId: this.$store.state.user.id,
  1106. languageCode: this.$i18n.locale
  1107. }
  1108. userFavoriteList(userFavorite).then(({data}) => {
  1109. for (let i = 0; i < data.list.length; i++) {
  1110. if(this.$route.meta.menuId === data.list[i].menuId){
  1111. this.favorite = true
  1112. }
  1113. }
  1114. })
  1115. },
  1116. // 收藏 OR 取消收藏
  1117. favoriteFunction () {
  1118. let userFavorite = {
  1119. userId: this.$store.state.user.id,
  1120. functionId: this.$route.meta.menuId,
  1121. }
  1122. if (this.favorite) {
  1123. removeUserFavorite(userFavorite).then(({data}) => {
  1124. this.$message.success(data.msg)
  1125. this.favorite = false
  1126. })
  1127. } else {
  1128. // 收藏
  1129. saveUserFavorite(userFavorite).then(({data}) => {
  1130. this.$message.success(data.msg)
  1131. this.favorite = true
  1132. })
  1133. }
  1134. },
  1135. //导出excel
  1136. async createExportData() {
  1137. this.searchData.limit = -1
  1138. this.searchData.page = 1
  1139. await getFAIReport(this.searchData).then(({data}) => {
  1140. this.exportList= data.page.list
  1141. })
  1142. return this.exportList
  1143. },
  1144. startDownload() {},
  1145. finishDownload() {},
  1146. fields () {
  1147. let json = "{"
  1148. this.columnList.forEach((item, index) => {
  1149. if (index == this.columnList.length - 1) {
  1150. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  1151. } else {
  1152. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  1153. }
  1154. })
  1155. json += "}"
  1156. let s = eval("(" + json + ")")
  1157. return s
  1158. },
  1159. // 动态列开始 获取 用户保存的 格式列
  1160. async getTableUserColumn (tableId, columnId) {
  1161. let queryTableUser = {
  1162. userId: this.$store.state.user.name,
  1163. functionId: this.$route.meta.menuId,
  1164. tableId: tableId,
  1165. status: true,
  1166. languageCode: this.$i18n.locale
  1167. }
  1168. await getTableUserListLanguage(queryTableUser).then(({data}) => {
  1169. if (data.rows.length > 0) {
  1170. switch (columnId) {
  1171. case 1:
  1172. this.columnList = data.rows
  1173. break
  1174. }
  1175. } else {
  1176. this.getColumnList(tableId, columnId)
  1177. }
  1178. })
  1179. },
  1180. // 获取 tableDefault 列
  1181. async getColumnList (tableId, columnId) {
  1182. let queryTable = {
  1183. functionId: this.$route.meta.menuId,
  1184. tableId: tableId,
  1185. languageCode: this.$i18n.locale
  1186. }
  1187. await getTableDefaultListLanguage(queryTable).then(({data}) => {
  1188. if (!data.rows.length === 0) {
  1189. switch (columnId) {
  1190. case 1:
  1191. this.columnList = data.rows
  1192. break
  1193. }
  1194. }
  1195. })
  1196. },
  1197. //获取按钮的权限数据
  1198. getButtonAuthData () {
  1199. let searchFlag = this.isAuth(this.menuId+":search")
  1200. //处理页面的权限数据
  1201. this.authSearch = !searchFlag
  1202. },
  1203. }
  1204. }
  1205. </script>
  1206. <style scoped>
  1207. .el-table /deep/ .cell{
  1208. height: auto;
  1209. line-height: 1.5;
  1210. }
  1211. </style>