Browse Source

Merge branch 'master' of http://36.137.93.232:3000/hf/byte-sailing-new

lxf 2 years ago
parent
commit
26546ad819

+ 38 - 10
src/views/WDLY/outInBound/logistics/index.vue

@@ -430,19 +430,46 @@ const openModal = () => {
 const submitForm = () => {
   console.log(byform.value);
   byform.value.handleSubmit((valid) => {
-    submitLoading.value = true;
-    proxy.post("/logisticsInfos/" + modalType.value, formData.data).then(
-      (res) => {
+    if (modalType.value == "other") {
+      loading.value = true;
+      formData.data.arrivalDetailList = formData.data.arrivalDetailList.map(
+        (x) => ({
+          bussinessId: x.bussinessId,
+          purchaseDetailId: x.purchaseDetailId,
+          deliverGoodsDetailsId: x.deliverGoodsDetailsId,
+          count: x.deliverGoodsQuantity,
+        })
+      );
+      const victoriatouristJson = {
+        deliverGoodsId: formData.data.deliverGoodsId,
+        logisticsCompanyCode: formData.data.logisticsCompanyCode,
+        code: formData.data.code,
+      };
+      formData.data.victoriatouristJson = JSON.stringify(victoriatouristJson);
+      proxy.post("/arrival/addByWdly", formData.data).then((res) => {
         ElMessage({
-          message: modalType.value == "add" ? "添加成功" : "编辑成功",
+          message: `操作成功!`,
           type: "success",
         });
         dialogVisible.value = false;
-        submitLoading.value = false;
+        loading.value = false;
         getList();
-      },
-      (err) => (submitLoading.value = false)
-    );
+      });
+    } else {
+      submitLoading.value = true;
+      proxy.post("/logisticsInfos/" + modalType.value, formData.data).then(
+        (res) => {
+          ElMessage({
+            message: modalType.value == "add" ? "添加成功" : "编辑成功",
+            type: "success",
+          });
+          dialogVisible.value = false;
+          submitLoading.value = false;
+          getList();
+        },
+        (err) => (submitLoading.value = false)
+      );
+    }
   });
 };
 
@@ -503,11 +530,12 @@ const handleClickCode = (row) => {
     openRecord.value = true;
   });
 };
-
+const deliverData = ref([]);
 const handleArrival = (row) => {
   modalType.value = "other";
   proxy.post("/deliverGoods/list", { id: row.businessId }).then((res) => {
-    console.log(res, "ass");
+    deliverData.value = res;
+
     formConfig[2].data = res.map((x) => ({
       ...x,
       label: x.code,

+ 42 - 8
src/views/salesMange/shipmentMange/packing/index.vue

@@ -51,16 +51,16 @@
       >
         <el-row :gutter="10">
           <el-col :span="8">
-            <el-form-item label="客户名称" prop="supplyId">
+            <el-form-item label="客户名称" prop="customerId">
               <el-select
-                v-model="formData.data.supplyId"
+                v-model="formData.data.customerId"
                 placeholder="请选择"
-                @change="handleChangeSupplier"
+                @change="handleChangeCustomer"
                 filterable
                 style="width: 100%"
               >
                 <el-option
-                  v-for="item in supplierData"
+                  v-for="item in customerList"
                   :label="item.name"
                   :value="item.id"
                 >
@@ -69,16 +69,17 @@
             </el-form-item>
           </el-col>
         </el-row>
-        <el-form-item label="选择合同" prop="supplyId">
+        <el-form-item label="选择合同" prop="contractIds">
           <el-select
-            v-model="formData.data.supplyId"
+            v-model="formData.data.contractIds"
             placeholder="请选择"
-            @change="handleChangeSupplier"
+            @change="handleChangeContract"
             filterable
             style="width: 100%"
+            multiple
           >
             <el-option
-              v-for="item in supplierData"
+              v-for="item in customerList"
               :label="item.name"
               :value="item.id"
             >
@@ -537,6 +538,7 @@ const getList = async (req) => {
 
 const openModal = () => {
   dialogVisible.value = true;
+  handleChangeCustomer("");
 };
 
 const submitForm = () => {
@@ -646,7 +648,39 @@ const selectRow = (data) => {
   selectData.value = data;
 };
 
+const customerList = ref([]);
 // selectConfig[1].data = statusData.value;
+const getSelectData = () => {
+  proxy.post("/customer/page", { pageNum: 1, pageSize: 999 }).then((res) => {
+    customerList.value = res.rows.map((item) => {
+      return {
+        ...item,
+        label: item.name,
+        value: item.id,
+      };
+    });
+  });
+};
+
+const handleChangeCustomer = (val) => {
+  proxy
+    .get(`/contract/getNoPackContractByCustomerId?customerId=${val}`)
+    .then((res) => {
+      console.log(res, "获取合同");
+    });
+};
+
+const handleChangeContract = (val) => {
+  proxy
+    .post(`/contract/getNoPackContractProductById`, {
+      customerId: formData.data.customerId,
+      contractId: val.join(),
+    })
+    .then((res) => {
+      console.log(res, "获取产品");
+    });
+};
+getSelectData();
 getList();
 </script>