liding
3 天以前 c19ec73d40519d87414b3e8a77972fefc9ef8d67
feat(outsourcingOrder): 新增外协订单独立路由并修复相关页面逻辑
已修改5个文件
71 ■■■■■ 文件已修改
src/router/index.js 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/inspectionTask/inspection.vue 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/materialOrder/customsInspectionOrder.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/outsourcingOrder/index.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/rawMaterialInspection/index.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js
@@ -226,6 +226,38 @@
    ],
  },
  {
    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,
src/views/business/inspectionTask/inspection.vue
@@ -385,7 +385,7 @@
            placeholder="请选择"
            size="small"
            @change="
              (m) => handleChangeCableTag(currentSample.id, 4, 'cableTag', m)
              (m) => handleChangeCableTag(currentSample.id, 4, 'rawMaterialTag', m)
            "
            @focus="getRawMaterialTag(currentSample.id)"
          >
@@ -2472,24 +2472,25 @@
    },
    // 根据类型、任务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) {
@@ -2498,6 +2499,9 @@
      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);
@@ -2517,7 +2521,6 @@
      // 处理页面列表数据
      this.getTableLists();
      this.currentKey = row.index;
      this.currentTab = null;
      // 向多线程去保存页面列表数据,后端传参,当前模板信息
      this.worker.postMessage(
        JSON.stringify({
@@ -2535,6 +2538,12 @@
      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") {
src/views/business/materialOrder/customsInspectionOrder.vue
@@ -688,7 +688,7 @@
  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')
src/views/business/outsourcingOrder/index.vue
@@ -1353,7 +1353,7 @@
        }
        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 => {
@@ -1364,10 +1364,10 @@
    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 } });
      }
    },
    // 打开免检弹框
src/views/business/rawMaterialInspection/index.vue
@@ -787,7 +787,7 @@
    },
    // 切换订单分类时清除不适用的物料属性。
    changeOrderType(form) {
      if (!this.getMaterialProps(form.orderType).some(item => item.dictValue === form.materialProp)) {
      if (form.orderType === '04subcontract' && !['半成品', '成品'].includes(form.materialProp)) {
        form.materialProp = null
      }
    },