feat(outsourcingOrder): 新增外协订单独立路由并修复相关页面逻辑
| | |
| | | ], |
| | | }, |
| | | { |
| | | path: "/outsourcingOrder", |
| | | component: Layout, |
| | | hidden: true, |
| | | permissions: ["business:order"], |
| | | children: [ |
| | | { |
| | | path: "rawOrder", |
| | | component: () => import("@/views/business/materialOrder/customsInspectionOrder"), |
| | | name: "OutsourceRawOrder", |
| | | meta: { title: "进行外协订单下单" }, |
| | | }, |
| | | { |
| | | path: "productOrder", |
| | | component: () => import("@/views/business/materialOrder/customsInspectionOrder"), |
| | | name: "OutsourceProductOrder", |
| | | meta: { title: "进行外协成品下单" }, |
| | | }, |
| | | { |
| | | path: "orderView", |
| | | component: () => import("@/views/business/materialOrder/customsInspectionView"), |
| | | name: "OutsourceOrderView", |
| | | meta: { title: "查看外协订单详情" }, |
| | | }, |
| | | { |
| | | path: "copperView", |
| | | component: () => import("@/views/business/materialOrder/copperView"), |
| | | name: "OutsourceCopperView", |
| | | meta: { title: "查看外协铜材料下单详情" }, |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | // 检验任务 |
| | | path: "/inspectionTask", |
| | | component: Layout, |
| | |
| | | placeholder="请选择" |
| | | size="small" |
| | | @change=" |
| | | (m) => handleChangeCableTag(currentSample.id, 4, 'cableTag', m) |
| | | (m) => handleChangeCableTag(currentSample.id, 4, 'rawMaterialTag', m) |
| | | " |
| | | @focus="getRawMaterialTag(currentSample.id)" |
| | | > |
| | |
| | | }, |
| | | // 根据类型、任务id、实验室来获取样品的检验项信息 |
| | | async getCurrentProduct(id, type, cableTag) { |
| | | if (cableTag === undefined) { |
| | | cableTag = ""; |
| | | } |
| | | const selectedCableTag = cableTag || this.temCableTag; |
| | | this.tableLoading = true; |
| | | type = this.typeSource == "1" ? 5 : type; |
| | | // 外购历史单可能曾误记为原材料,选择线芯时仍应按颜色查询。 |
| | | const usesCableItems = selectedCableTag && ( |
| | | this.effectiveOrderType === "02wg" || |
| | | ["03incoming", "04subcontract"].includes(this.insOrder.ifsOrderType) |
| | | ); |
| | | type = this.typeSource == "1" && !usesCableItems ? 5 : type; |
| | | this.type = type; |
| | | let res = await getInsProduct({ |
| | | id: id, |
| | | type: type, |
| | | laboratory: this.sonLaboratory, |
| | | cableTag: cableTag ? cableTag : this.temCableTag, |
| | | cableTag: selectedCableTag, |
| | | rawMaterialTag: this.rawMaterialTag, |
| | | repetitionTag: this.repetitionTag, |
| | | }); |
| | | this.tableLoading = false; |
| | | if (res.data.length > 0) { |
| | | return res.data; |
| | | } |
| | | return res.data || []; |
| | | }, |
| | | // 切换样品 |
| | | async handleChangeSample(row, column, event) { |
| | |
| | | this.sampleVisible = false; |
| | | // 赋值样品 |
| | | this.currentSample = this.HaveJson(row); |
| | | this.currentTab = null; |
| | | this.temCableTag = ""; |
| | | this.repetitionTag = ""; |
| | | let list = await this.getCurrentProduct(row.id, 0); |
| | | // 赋值样品检验项 |
| | | this.currentSample.insProduct = this.HaveJson(list); |
| | |
| | | // 处理页面列表数据 |
| | | this.getTableLists(); |
| | | this.currentKey = row.index; |
| | | this.currentTab = null; |
| | | // 向多线程去保存页面列表数据,后端传参,当前模板信息 |
| | | this.worker.postMessage( |
| | | JSON.stringify({ |
| | |
| | | if (num === "cableTag") { |
| | | cableTag = m2; |
| | | this.temCableTag = cableTag; |
| | | this.repetitionTag = ""; |
| | | this.getRepetitionTag(); |
| | | } else if (num === "rawMaterialTag") { |
| | | this.currentTab = null; |
| | | this.temCableTag = ""; |
| | | this.repetitionTag = ""; |
| | | this.getRepetitionTag(); |
| | | } |
| | | if (num === "repetitionTag") { |
| | |
| | | methods: { |
| | | // 每次进入下单页面明确设置来源,避免复用缓存页面时沿用上一张订单。 |
| | | initOrderSource() { |
| | | if (this.active !== 1) return |
| | | if (Number(this.active) !== 1) return |
| | | this.addObj.typeSource = this.isOutsourcing === 't' ? 0 : 1 |
| | | if (this.isOutsourcing === 't') { |
| | | this.addObj.appointed = dateFormat(new Date(),'yyyy-MM-dd') |
| | |
| | | } |
| | | const isProduct = orderType === '04subcontract' && row.materialProp === '成品' |
| | | this.$router.push({ |
| | | path: isProduct ? '/outsourcingFinishProduct/customsInspectionOrder' : '/materialOrder/customsInspectionOrder', |
| | | path: isProduct ? '/outsourcingOrder/productOrder' : '/outsourcingOrder/rawOrder', |
| | | query: { isOutsourcing: isProduct ? 't' : 'f', orderType: 0, customsInspection: row, active: 1 } |
| | | }) |
| | | }).catch(error => { |
| | |
| | | selectAllByOne(row) { |
| | | if (row.isCopper == 1) { |
| | | this.currentId = row.enterOrderId |
| | | this.$router.push({ path: "/materialOrder/CopperView", query: { customsInspection: row, active: 2, currentId: this.currentId } }); |
| | | this.$router.push({ path: "/outsourcingOrder/copperView", query: { customsInspection: row, active: 2, currentId: this.currentId } }); |
| | | } else { |
| | | this.currentId = row.insOrderId |
| | | this.$router.push({ path: "/materialOrder/customsInspectionView", query: { customsInspection: row, active: 2, currentId: this.currentId } }); |
| | | this.$router.push({ path: "/outsourcingOrder/orderView", query: { customsInspection: row, active: 2, currentId: this.currentId } }); |
| | | } |
| | | }, |
| | | // 打开免检弹框 |
| | |
| | | }, |
| | | // 切换订单分类时清除不适用的物料属性。 |
| | | changeOrderType(form) { |
| | | if (!this.getMaterialProps(form.orderType).some(item => item.dictValue === form.materialProp)) { |
| | | if (form.orderType === '04subcontract' && !['半成品', '成品'].includes(form.materialProp)) { |
| | | form.materialProp = null |
| | | } |
| | | }, |