cz преди 1 година
родител
ревизия
2300791dc5
променени са 1 файла, в които са добавени 81 реда и са изтрити 89 реда
  1. 81 89
      src/views/processApproval/components/EhsdPriceSheet.vue

+ 81 - 89
src/views/processApproval/components/EhsdPriceSheet.vue

@@ -106,7 +106,6 @@ const formDom2 = ref(null);
 const formDom3 = ref(null);
 const formDom4 = ref(null);
 const formDom5 = ref(null);
-const formDom6 = ref(null);
 
 const formOption = reactive({
   readonly: false,
@@ -439,83 +438,83 @@ const formGoodsOption = reactive({
     plain: true,
     listTitle: "商品信息",
     listConfig: [
-      {
-        type: "picker",
-        label: "商品名称",
-        prop: "productId",
-        itemType: "onePicker",
-        showPicker: false,
-        readonly: false,
-        fieldNames: {
-          text: "label",
-          value: "value",
-        },
-        data: [],
-        changeFn: (val, data, index, indexTwo, propName) => {
-          let selectList = formData.data[propName].filter(
-            (item, itemIndex) =>
-              item[data.prop] === val.selectedValues[0] && itemIndex !== index
-          );
-          if (selectList && selectList.length > 0) {
-            return showFailToast(proxy.t("contract.productRepeat"));
-          }
-          formData.data[propName][index][data.prop] = val.selectedValues[0];
-          formData.data.contractShipmentList[index][data.prop] =
-            val.selectedValues[0];
-          let list = data.data.filter(
-            (item) => item[data.fieldNames.value] == val.selectedValues[0]
-          );
-          if (list && list.length > 0) {
-            formData.data[propName][index][data.prop + "Name"] =
-              list[0][data.fieldNames.text];
-            if (list[0].ehsdJson) {
-              let ehsdJson = JSON.parse(list[0].ehsdJson);
-              if (ehsdJson) {
-                formData.data[propName][index].productName =
-                  ehsdJson.nameEnglish || "";
-                formData.data.contractShipmentList[index].productName =
-                  ehsdJson.nameEnglish || list[0][data.fieldNames.text];
-                formData.data.contractShipmentList[index].productCode =
-                  list[0].code;
-                formData.data[propName][index].productModel =
-                  ehsdJson.productLong +
-                  "*" +
-                  ehsdJson.productWide +
-                  "*" +
-                  ehsdJson.productHigh;
-                // 包装方式
-                let str = "";
-                let strOne = "";
-                if (ehsdJson.innerPackMethod) {
-                  let innerPackMethodArr = ehsdJson.innerPackMethod.split(",");
-                  innerPackMethodArr = innerPackMethodArr.map((x) =>
-                    proxy.dictValueLabel(x, innerMethod.value)
-                  );
-                  str += innerPackMethodArr.join(",");
-                }
-                if (ehsdJson.outerPackMethod) {
-                  let outerPackMethodArr = ehsdJson.outerPackMethod.split(",");
-                  outerPackMethodArr = outerPackMethodArr.map((x) =>
-                    proxy.dictValueLabel(x, outsideMethod.value)
-                  );
-                  strOne += outerPackMethodArr.join(",");
-                }
-                formData.data[propName][index].packMethod = str + "," + strOne;
-              }
-            }
-          } else {
-            formData.data[propName][index][data.prop + "Name"] = "";
-          }
-          formData.data[propName][index].quantity = null;
-          formData.data[propName][index].price = null;
-          formData.data[propName][index].amount = null;
-          formData.data[propName][index].remark = null;
-          formData.data.contractShipmentList[index].shipmentTime = null;
-          formData.data.contractShipmentList[index].quantity = null;
-          formData.data.contractShipmentList[index].remark = null;
-          data.showPicker = false;
-        },
-      },
+      // {
+      //   type: "picker",
+      //   label: "商品名称",
+      //   prop: "productId",
+      //   itemType: "onePicker",
+      //   showPicker: false,
+      //   readonly: false,
+      //   fieldNames: {
+      //     text: "label",
+      //     value: "value",
+      //   },
+      //   data: [],
+      //   changeFn: (val, data, index, indexTwo, propName) => {
+      //     let selectList = formData.data[propName].filter(
+      //       (item, itemIndex) =>
+      //         item[data.prop] === val.selectedValues[0] && itemIndex !== index
+      //     );
+      //     if (selectList && selectList.length > 0) {
+      //       return showFailToast(proxy.t("contract.productRepeat"));
+      //     }
+      //     formData.data[propName][index][data.prop] = val.selectedValues[0];
+      //     formData.data.contractShipmentList[index][data.prop] =
+      //       val.selectedValues[0];
+      //     let list = data.data.filter(
+      //       (item) => item[data.fieldNames.value] == val.selectedValues[0]
+      //     );
+      //     if (list && list.length > 0) {
+      //       formData.data[propName][index][data.prop + "Name"] =
+      //         list[0][data.fieldNames.text];
+      //       if (list[0].ehsdJson) {
+      //         let ehsdJson = JSON.parse(list[0].ehsdJson);
+      //         if (ehsdJson) {
+      //           formData.data[propName][index].productName =
+      //             ehsdJson.nameEnglish || "";
+      //           formData.data.contractShipmentList[index].productName =
+      //             ehsdJson.nameEnglish || list[0][data.fieldNames.text];
+      //           formData.data.contractShipmentList[index].productCode =
+      //             list[0].code;
+      //           formData.data[propName][index].productModel =
+      //             ehsdJson.productLong +
+      //             "*" +
+      //             ehsdJson.productWide +
+      //             "*" +
+      //             ehsdJson.productHigh;
+      //           // 包装方式
+      //           let str = "";
+      //           let strOne = "";
+      //           if (ehsdJson.innerPackMethod) {
+      //             let innerPackMethodArr = ehsdJson.innerPackMethod.split(",");
+      //             innerPackMethodArr = innerPackMethodArr.map((x) =>
+      //               proxy.dictValueLabel(x, innerMethod.value)
+      //             );
+      //             str += innerPackMethodArr.join(",");
+      //           }
+      //           if (ehsdJson.outerPackMethod) {
+      //             let outerPackMethodArr = ehsdJson.outerPackMethod.split(",");
+      //             outerPackMethodArr = outerPackMethodArr.map((x) =>
+      //               proxy.dictValueLabel(x, outsideMethod.value)
+      //             );
+      //             strOne += outerPackMethodArr.join(",");
+      //           }
+      //           formData.data[propName][index].packMethod = str + "," + strOne;
+      //         }
+      //       }
+      //     } else {
+      //       formData.data[propName][index][data.prop + "Name"] = "";
+      //     }
+      //     formData.data[propName][index].quantity = null;
+      //     formData.data[propName][index].price = null;
+      //     formData.data[propName][index].amount = null;
+      //     formData.data[propName][index].remark = null;
+      //     formData.data.contractShipmentList[index].shipmentTime = null;
+      //     formData.data.contractShipmentList[index].quantity = null;
+      //     formData.data.contractShipmentList[index].remark = null;
+      //     data.showPicker = false;
+      //   },
+      // },
       {
         type: "input",
         label: "商品名称",
@@ -901,7 +900,7 @@ const getDict = () => {
     });
   // 产品
   Promise.all([getProduct(), getProductOne()]).then((res) => {
-    formGoodsOption.btnConfig.listConfig[0].data = res[0].concat(res[1]);
+    // formGoodsOption.btnConfig.listConfig[0].data = res[0].concat(res[1]);
   });
   // 包装方式
   proxy
@@ -984,7 +983,7 @@ const getDict = () => {
     .post("/dictTenantData/page", { ...query, dictCode: "trade_mode" })
     .then((res) => {
       if (res.data.rows && res.data.rows.length > 0) {
-        formGoodsOption.btnConfig.listConfig[6].data = res.data.rows.map(
+        formGoodsOption.btnConfig.listConfig[5].data = res.data.rows.map(
           (item) => {
             return {
               label: item.dictValue,
@@ -1121,16 +1120,9 @@ const handleSubmit = async () => {
           return formDom4.value.validateForm().then((status2) => {
             if (status2) {
               active.value = 2;
-              return false;
+              return true;
             } else {
-              return formDom6.value.validateForm().then((status3) => {
-                if (status3) {
-                  active.value = 3;
-                  return false;
-                } else {
-                  return true;
-                }
-              });
+              return true;
             }
           });
         }