AlreadyIqcInspection.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522
  1. <template>
  2. <!-- 列表 -->
  3. <div>
  4. <!-- 操作工具栏 -->
  5. <el-row :gutter="10" class="mb8">
  6. <el-col v-if="activeName === 'alreadyIqcInspection'" :span="1.5">
  7. <el-button
  8. type="success"
  9. icon="el-icon-download"
  10. size="mini"
  11. @click="handleExport"
  12. >质检结果导出</el-button
  13. >
  14. </el-col>
  15. <right-toolbar
  16. :show-search.sync="showSearch"
  17. :columns="columnsList"
  18. @queryTable="handleQuery"
  19. @saveSetting="getColumnsList"
  20. />
  21. </el-row>
  22. <AutoResizer :given-height="220">
  23. <template #default="{ height }">
  24. <el-table
  25. v-if="columnsList.length > 0"
  26. ref="multipleTable"
  27. v-loading="loading"
  28. :data="list"
  29. :height="height"
  30. border
  31. >
  32. <el-table-column
  33. v-if="columnsList[14].visible"
  34. :key="Math.random()"
  35. label="检验单号"
  36. align="center"
  37. prop="id"
  38. fixed="left"
  39. width="165"
  40. >
  41. <template slot-scope="scope">
  42. <el-button
  43. type="text"
  44. size="mini"
  45. @click="handleInspectDetails(scope.row)"
  46. >{{ scope.row.id }}</el-button
  47. >
  48. </template>
  49. </el-table-column>
  50. <el-table-column
  51. v-if="columnsList[0].visible"
  52. :key="Math.random()"
  53. label="物料批次"
  54. align="center"
  55. prop="materialLots"
  56. width="120"
  57. show-overflow-tooltip
  58. />
  59. <el-table-column
  60. v-if="columnsList[1].visible"
  61. :key="Math.random()"
  62. label="送货批次"
  63. align="center"
  64. prop="deliverBatch"
  65. width="150"
  66. show-overflow-tooltip
  67. />
  68. <el-table-column
  69. v-if="columnsList[15].visible"
  70. :key="Math.random()"
  71. label="检验数量"
  72. align="center"
  73. prop="receiptQty"
  74. />
  75. <el-table-column
  76. v-if="columnsList[4].visible"
  77. :key="Math.random()"
  78. label="物料编码"
  79. align="center"
  80. prop="materialNo"
  81. width="120"
  82. show-overflow-tooltip
  83. />
  84. <el-table-column
  85. v-if="columnsList[5].visible"
  86. :key="Math.random()"
  87. label="物料名称"
  88. align="center"
  89. prop="materialName"
  90. width="120"
  91. show-overflow-tooltip
  92. />
  93. <el-table-column
  94. v-if="columnsList[23].visible"
  95. :key="Math.random()"
  96. label="图号"
  97. align="center"
  98. prop="drawingNo"
  99. width="150"
  100. show-overflow-tooltip
  101. />
  102. <el-table-column
  103. v-if="columnsList[17].visible"
  104. :key="Math.random()"
  105. label="审核人"
  106. align="center"
  107. prop="auditor"
  108. />
  109. <el-table-column
  110. v-if="columnsList[7].visible"
  111. :key="Math.random()"
  112. label="检验状态"
  113. align="center"
  114. prop="testStatus"
  115. >
  116. <template slot-scope="scope">
  117. <dict-tag
  118. :type="DICT_TYPE.WMS_TEST_STATUS"
  119. :value="scope.row.testStatus"
  120. />
  121. </template>
  122. </el-table-column>
  123. <el-table-column
  124. v-if="columnsList[16].visible"
  125. :key="Math.random()"
  126. label="审核状态"
  127. align="center"
  128. prop="auditStatus"
  129. width="120"
  130. >
  131. <template slot-scope="scope">
  132. <dict-tag
  133. :type="DICT_TYPE.WMS_AUDIT_STATUS"
  134. :value="scope.row.auditStatus"
  135. />
  136. </template>
  137. </el-table-column>
  138. <el-table-column
  139. v-if="columnsList[8].visible"
  140. :key="Math.random()"
  141. label="单位"
  142. align="center"
  143. prop="unitCode"
  144. />
  145. <el-table-column
  146. v-if="columnsList[9].visible"
  147. :key="Math.random()"
  148. label="供应商"
  149. align="center"
  150. prop="supplierName"
  151. width="120"
  152. show-overflow-tooltip
  153. />
  154. <el-table-column
  155. v-if="columnsList[10].visible"
  156. :key="Math.random()"
  157. label="存储条件"
  158. align="center"
  159. prop="storageEnvironment"
  160. width="120"
  161. show-overflow-tooltip
  162. />
  163. <el-table-column
  164. v-if="columnsList[24].visible"
  165. :key="Math.random()"
  166. label="采购订单"
  167. align="center"
  168. prop="purchaseOrderNo"
  169. width="120"
  170. show-overflow-tooltip
  171. />
  172. <el-table-column
  173. v-if="columnsList[19].visible"
  174. :key="Math.random()"
  175. label="检验时间"
  176. align="center"
  177. prop="createTime"
  178. width="160"
  179. >
  180. <template slot-scope="scope">
  181. <span>{{ parseTime(scope.row.createTime) }}</span>
  182. </template>
  183. </el-table-column>
  184. <el-table-column
  185. v-if="columnsList[18].visible"
  186. :key="Math.random()"
  187. label="审核时间"
  188. align="center"
  189. prop="auditTime"
  190. width="160"
  191. >
  192. <template slot-scope="scope">
  193. <span>{{ parseTime(scope.row.auditTime) }}</span>
  194. </template>
  195. </el-table-column>
  196. <el-table-column
  197. v-if="columnsList[20].visible"
  198. :key="Math.random()"
  199. label="检验人"
  200. align="center"
  201. prop="inspector"
  202. width="100"
  203. />
  204. <el-table-column
  205. v-if="columnsList[21].visible"
  206. :key="Math.random()"
  207. label="处理结果"
  208. align="center"
  209. prop="auditStatus"
  210. >
  211. <template slot-scope="scope">
  212. <dict-tag
  213. :type="DICT_TYPE.WMS_IQC_APPROVAL_STATUS"
  214. :value="scope.row.auditStatus"
  215. />
  216. </template>
  217. </el-table-column>
  218. <el-table-column
  219. v-if="columnsList[22].visible"
  220. :key="Math.random()"
  221. label="检验结果"
  222. align="center"
  223. prop="noPassType"
  224. >
  225. <template slot-scope="scope">
  226. <dict-tag
  227. :type="DICT_TYPE.WMS_INSPECT_RESULTS"
  228. :value="scope.row.noPassType"
  229. />
  230. </template>
  231. </el-table-column>
  232. <el-table-column
  233. label="操作"
  234. align="center"
  235. class-name="small-padding fixed-width"
  236. width="160"
  237. fixed="right"
  238. >
  239. <template slot-scope="scope">
  240. <el-button
  241. type="text"
  242. icon="el-icon-refresh"
  243. size="mini"
  244. @click="callBack(scope.row)"
  245. >撤回</el-button
  246. >
  247. <!-- <el-button
  248. type="text"
  249. icon="el-icon-view"
  250. size="mini"
  251. @click="InspectDetails(scope.row)"
  252. >检验详情</el-button> -->
  253. </template>
  254. </el-table-column>
  255. </el-table>
  256. </template>
  257. </AutoResizer>
  258. <!-- 分页组件 -->
  259. <pagination
  260. v-show="total > 0"
  261. :total="total"
  262. :page.sync="queryParams.pageNo"
  263. :limit.sync="queryParams.pageSize"
  264. @pagination="getList"
  265. />
  266. <!-- 检验详情查看 -->
  267. <!-- <InspectDetail ref="inspectDetail" /> -->
  268. </div>
  269. </template>
  270. <script>
  271. import {
  272. getIqcInspectionPage,
  273. inspectionReBack,
  274. } from "@/api/wms/quality/iqcInspectionExecute";
  275. import { getFormColumnsList } from "@/api/system/saveColumns/index";
  276. import { mapGetters } from "vuex";
  277. import { isArray } from "min-dash";
  278. import { exportQualityInspectionResults } from "@/api/wms/quality/iqcInspectionExecute";
  279. export default {
  280. name: "AlreadyIqcInspection",
  281. components: {},
  282. props: {
  283. activeName: {
  284. type: String,
  285. default: "",
  286. },
  287. queryParamspro: {
  288. type: Object,
  289. default: () => {},
  290. },
  291. },
  292. inject: ["paramsQuery"],
  293. data() {
  294. return {
  295. // 遮罩层
  296. loading: false,
  297. // 导出遮罩层
  298. exportLoading: false,
  299. // 显示搜索条件
  300. showSearch: true,
  301. filePreviewvisible: false,
  302. // 总条数
  303. total: 0,
  304. // 领料单列表
  305. list: [],
  306. // 用户列表
  307. users: [],
  308. // 弹出层标题
  309. title: "",
  310. // 是否显示弹出层
  311. open: false,
  312. baseData: "",
  313. auditStatusSelect: null,
  314. // 是否显示查看弹出层
  315. viewOpen: false,
  316. advParams: {},
  317. // 查询参数
  318. queryParams: {
  319. pageNo: 1,
  320. pageSize: 10,
  321. materialNo: null,
  322. materialLots: null,
  323. // type: 3,
  324. audited: 1,
  325. processNo: "PURCHASE",
  326. id: null,
  327. },
  328. // 表单参数
  329. form: {},
  330. // 表单校验
  331. rules: {},
  332. // 显示隐藏列参数
  333. columns: [
  334. { key: 0, label: "物料批次", visible: true },
  335. { key: 1, label: "送货批次", visible: true },
  336. { key: 2, label: "采购订单", visible: true },
  337. { key: 3, label: "采购数量", visible: true },
  338. { key: 4, label: "物料编码", visible: true },
  339. { key: 5, label: "物料名称", visible: true },
  340. { key: 6, label: "到货数量", visible: true },
  341. { key: 7, label: "检验状态", visible: true },
  342. { key: 8, label: "单位", visible: true },
  343. { key: 9, label: "供应商", visible: true },
  344. { key: 10, label: "存储条件", visible: false },
  345. { key: 11, label: "登记时间", visible: true },
  346. { key: 12, label: "登记人", visible: true },
  347. { key: 13, label: "累计已到货数量", visible: true },
  348. { key: 14, label: "检验单号", visible: true },
  349. { key: 15, label: "检验数量", visible: true },
  350. { key: 16, label: "审核状态", visible: true },
  351. { key: 17, label: "审核人", visible: true },
  352. { key: 18, label: "审核时间", visible: true },
  353. { key: 19, label: "检验时间", visible: true },
  354. { key: 20, label: "检验人", visible: true },
  355. { key: 21, label: "处理结果", visible: true },
  356. { key: 22, label: "检验结果", visible: true },
  357. { key: 23, label: "图号", visible: true },
  358. { key: 24, label: "采购订单", visible: true },
  359. ],
  360. // 显示隐藏持久化参数
  361. columnsList: [],
  362. };
  363. },
  364. computed: {
  365. ...mapGetters(["userId"]),
  366. },
  367. created() {
  368. // 获取显隐列列表
  369. this.getColumnsList();
  370. this.getList();
  371. },
  372. methods: {
  373. /** 查询列表 */
  374. getList() {
  375. this.loading = true;
  376. // 执行查询
  377. const params = {
  378. ...this.queryParams,
  379. ...this.paramsQuery,
  380. ...this.advParams,
  381. };
  382. getIqcInspectionPage(params)
  383. .then((response) => {
  384. this.list = response.data.list;
  385. this.users = response.data.users;
  386. this.total = response.data.total;
  387. })
  388. .finally(() => {
  389. this.loading = false;
  390. });
  391. },
  392. /** 取消按钮 */
  393. cancel() {
  394. this.open = false;
  395. this.reset();
  396. },
  397. /** 表单重置 */
  398. reset() {
  399. this.form = {
  400. id: undefined,
  401. wmsIncomingReceiptId: undefined,
  402. orderType: undefined,
  403. erpStockId: undefined,
  404. wmsStoreAreaId: undefined,
  405. wmsStoreId: undefined,
  406. inQty: undefined,
  407. funitId: undefined,
  408. remark: undefined,
  409. };
  410. this.resetForm("form");
  411. },
  412. handleName(row, column, cellValue) {
  413. const user = this.users.find((item) => item.id.toString() === cellValue);
  414. return user && user.nickname;
  415. },
  416. /** 搜索按钮操作 */
  417. handleQuery() {
  418. this.queryParams.pageNo = 1;
  419. this.getList();
  420. },
  421. // 撤回
  422. callBack({ id }) {
  423. this.loading = true;
  424. inspectionReBack({ inspectionId: id })
  425. .then((response) => {
  426. this.$message.success("已撤回");
  427. this.getList();
  428. })
  429. .finally(() => {
  430. this.loading = false;
  431. });
  432. },
  433. // 查看检验详情
  434. handleInspectDetails(row) {
  435. const {
  436. materialLots,
  437. materialNo,
  438. auditStatus,
  439. auditor,
  440. creator,
  441. processNo,
  442. unitCode,
  443. } = row;
  444. // this.$refs.inspectDetail.visible = true
  445. // this.$refs.inspectDetail.queryParams.materialLots = materialLots
  446. // this.$refs.inspectDetail.queryParams.materialNo = materialNo
  447. // this.$refs.inspectDetail.queryParams.type = 0
  448. // this.$refs.inspectDetail.apiStatus = auditStatus
  449. // this.$refs.inspectDetail.adjustForm.auditor = auditor
  450. // this.$refs.inspectDetail.adjustForm.inspector = creator
  451. // this.$refs.inspectDetail.queryParams.processNo = processNo
  452. // 跳转到检验执行
  453. this.$router.push({
  454. path: "/quality/iqcInspection/inspect-details",
  455. query: {
  456. auditStatus,
  457. unitCode,
  458. materialLots,
  459. materialNo,
  460. processNo,
  461. type: 0,
  462. auditor,
  463. creator,
  464. },
  465. });
  466. },
  467. // 获取显示隐藏列
  468. getColumnsList() {
  469. const { componentName } = this.$route.meta || null;
  470. const params = {
  471. userId: this.userId,
  472. vueForm: componentName,
  473. };
  474. getFormColumnsList(params)
  475. .then((res) => {
  476. if (isArray(res.data)) {
  477. this.columnsList = res.data.length === 0 ? this.columns : res.data;
  478. } else {
  479. this.columnsList = this.columns;
  480. }
  481. })
  482. .catch((err) => {
  483. if (err) {
  484. this.columnsList = this.columns;
  485. }
  486. })
  487. .finally(() => {
  488. this.$emit("columns", this.columnsList);
  489. });
  490. },
  491. /** 导出按钮操作 */
  492. handleExport() {
  493. // 处理查询参数
  494. const params = {
  495. ...this.queryParams,
  496. ...this.paramsQuery,
  497. ...this.advParams,
  498. };
  499. params.pageNo = undefined;
  500. params.pageSize = undefined;
  501. this.$modal
  502. .confirm("是否确认导出质检结果数据?")
  503. .then(() => {
  504. this.exportLoading = true;
  505. return exportQualityInspectionResults(params);
  506. })
  507. .then((response) => {
  508. this.$download.excel(response, "质检结果.xls");
  509. this.exportLoading = false;
  510. })
  511. .catch(() => {});
  512. },
  513. },
  514. };
  515. </script>
  516. <style></style>