lxf 1 éve
szülő
commit
de65420fab
1 módosított fájl, 92 hozzáadás és 21 törlés
  1. 92 21
      src/components/process/order.vue

+ 92 - 21
src/components/process/order.vue

@@ -365,13 +365,10 @@
               定制加工费: ¥{{ moneyFormat(calculatedAmount("customProcessingFee"), 2) }}
             </span>
             <span style="font-weight: 700; color: #6c88f1; margin-left: 40px">代发费: ¥{{ moneyFormat(calculatedAmount("lssueFee"), 2) }}</span>
-            <span style="font-weight: 700; color: #6c88f1; margin-left: 40px">
-              快递包材费: ¥{{ moneyFormat(calculatedAmount("deliveryMaterialsFee"), 2) }}
-            </span>
+            <span style="font-weight: 700; color: #6c88f1; margin-left: 40px">快递包材费: ¥{{ moneyFormat(computeDeliveryMaterialsFee(), 2) }} </span>
             <span style="font-weight: 700; color: #6c88f1; margin-left: 40px">包装人工费: ¥{{ moneyFormat(calculatedAmount("packingLabor"), 2) }}</span>
             <span style="font-weight: 700; color: #6c88f1; margin-left: 40px">包材费: ¥{{ moneyFormat(calculatedPackagingMaterialCost(), 2) }}</span>
             <span style="font-weight: 700; color: #6c88f1; margin-left: 40px">管理费: ¥{{ moneyFormat(calculatedAmount("managementFee"), 2) }}</span>
-            <span style="font-weight: 700; color: #6c88f1; margin-left: 40px">外箱包装费: ¥{{ moneyFormat(calculatedOuterBoxPackingFee(), 2) }}</span>
           </div>
           <div style="padding: 8px 0 0 0">
             <span style="font-weight: 700; color: red">订单总金额(含税): ¥{{ moneyFormat(calculatedTotalAmount(), 2) }}</span>
@@ -422,6 +419,16 @@
         <el-button @click="openDrawingFile = false" size="large">关 闭</el-button>
       </template>
     </el-dialog>
+
+    <el-dialog title="导入产品" v-if="openUpload" v-model="openUpload" width="60%">
+      <el-upload class="upload-demo" :show-file-list="false" drag action="##" :http-request="giveawayServerLog" v-loading="loadingUpload">
+        <el-icon class="el-icon--upload"><upload-filled /></el-icon>
+        <div class="el-upload__text">拖拽文件进行上传</div>
+      </el-upload>
+      <template #footer>
+        <el-button @click="openUpload = false">关 闭</el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -500,6 +507,13 @@ const formConfig = computed(() => {
       label: "事业部",
       itemWidth: 25,
     },
+    {
+      type: "input",
+      prop: "wlnCode",
+      label: "E10单号",
+      itemType: "text",
+      itemWidth: 25,
+    },
     formOption.disabled
       ? {}
       : {
@@ -600,6 +614,8 @@ const rules = ref({
   quantity: [{ required: true, message: "请输入数量", trigger: "blur" }],
   type: [{ required: true, message: "请选择订单类型", trigger: "change" }],
   departmentId: [{ required: true, message: "请选择事业部", trigger: "change" }],
+  wlnCode: [{ required: true, message: "请输入E10单号", trigger: "blur" }],
+  erpCode: [{ required: true, message: "请输入E10成品品号", trigger: "blur" }],
 });
 const getDemandData = () => {
   proxy.post("/department/page", { pageNum: 1, pageSize: 999 }).then((res) => {
@@ -719,6 +735,8 @@ const pushProduct = async (res, SKU, row) => {
     skuSpecId: row.id,
     bomSpecId: row.bomSpecId,
     quantity: undefined,
+    erpCode: "",
+    featureCode: "",
     customProcessingFee: "",
     customProcessingType: "",
     lssueFee: "",
@@ -733,6 +751,7 @@ const pushProduct = async (res, SKU, row) => {
     productionDocument: row.sharedFolder,
     artworkLibraryId: "0",
     inventoryQuantity: inventoryQuantity,
+    proofingFee: 0,
   });
   ElMessage({ message: "添加成功", type: "success" });
 };
@@ -902,10 +921,9 @@ const calculatedTotalAmount = () => {
       (calculatedAmount("unitPrice") +
         calculatedAmount("customProcessingFee") +
         calculatedAmount("lssueFee") +
-        calculatedAmount("deliveryMaterialsFee") +
+        computeDeliveryMaterialsFee() +
         calculatedAmount("packingLabor") +
         calculatedAmount("managementFee") +
-        calculatedOuterBoxPackingFee() +
         calculatedPackagingMaterialCost()) *
         100
     ) / 100
@@ -985,12 +1003,12 @@ const handleSubmit = async (flag) => {
         formData.data.productTotalAmount = calculatedAmount("unitPrice");
         formData.data.customProcessingFee = calculatedAmount("customProcessingFee");
         formData.data.lssueFee = calculatedAmount("lssueFee");
-        formData.data.deliveryMaterialsFee = calculatedAmount("deliveryMaterialsFee");
+        formData.data.deliveryMaterialsFee = computeDeliveryMaterialsFee();
         formData.data.packingLabor = calculatedAmount("packingLabor");
         formData.data.managementFee = calculatedAmount("managementFee");
-        formData.data.outerBoxPackingFee = calculatedOuterBoxPackingFee();
         formData.data.packagingMaterialCost = calculatedPackagingMaterialCost();
         formData.data.totalAmount = calculatedTotalAmount();
+        formData.data.proofingFee = 0;
         if (fileList.value && fileList.value.length > 0) {
           for (let i = 0; i < fileList.value.length; i++) {
             if (fileList.value[i].raw.uploadState) {
@@ -1075,19 +1093,6 @@ const saveShippingPackage = (data) => {
   formData.data.orderPackageBomList = data.orderPackageBomList;
   formData.data.outerBoxSelfAdhesiveStickerFile = data.outerBoxSelfAdhesiveStickerFile;
 };
-const calculatedOuterBoxPackingFee = () => {
-  let money = 0;
-  if (formData.data.orderPackageBomList && formData.data.orderPackageBomList.length > 0) {
-    for (let i = 0; i < formData.data.orderPackageBomList.length; i++) {
-      if (formData.data.orderPackageBomList[i].internalSellingPrice && formData.data.orderPackageBomList[i].quantity) {
-        money = Number(
-          Math.round((money + formData.data.orderPackageBomList[i].internalSellingPrice * formData.data.orderPackageBomList[i].quantity) * 100) / 100
-        );
-      }
-    }
-  }
-  return money;
-};
 const computeDeliveryMaterialsFee = () => {
   let money = 0;
   if (formData.data.orderPackageBomList && formData.data.orderPackageBomList.length > 0) {
@@ -1115,6 +1120,72 @@ const computeSingleDeliveryMaterialsFee = (index) => {
   formData.data.orderSkuList[index].deliveryMaterialsFee = singlePrice;
   return formData.data.orderSkuList[index].deliveryMaterialsFee;
 };
+const openUpload = ref(false);
+const loadingUpload = ref(false);
+const clickUploadProduct = () => {
+  loadingUpload.value = false;
+  openUpload.value = true;
+};
+const giveawayServerLog = (params) => {
+  let file = params.file;
+  let formFile = new FormData();
+  formFile.append("file", file);
+  loadingUpload.value = true;
+  proxy.postUploadFile("/skuSpec/getSkuSpecListFromImport", formFile).then(
+    (res) => {
+      ElMessage({ message: "导入成功", type: "success" });
+      openUpload.value = false;
+      if (res.data && res.data.length > 0) {
+        for (let i = 0; i < res.data.length; i++) {
+          let list = formData.data.orderSkuList.filter((item) => item.skuSpecId === res.data[i].id && item.bomSpecId === res.data[i].bomSpecId);
+          if (!(list && list.length > 0)) {
+            let orderSkuBomList = [];
+            if (res.data[i].packagingMaterialList && res.data[i].packagingMaterialList.length > 0) {
+              orderSkuBomList = res.data[i].packagingMaterialList.map((item) => {
+                return {
+                  bomSpecId: item.bomSpecId,
+                  unitPrice: item.internalSellingPrice,
+                  quantity: item.quantity,
+                  bomSpecName: item.name,
+                };
+              });
+            }
+            formData.data.orderSkuList.push({
+              wlnSkuName: res.data[i].wlnSkuName,
+              skuId: res.data[i].skuId,
+              code: res.data[i].code,
+              name: res.data[i].name,
+              skuSpecId: res.data[i].id,
+              bomSpecId: res.data[i].bomSpecId,
+              quantity: undefined,
+              erpCode: "",
+              featureCode: "",
+              customProcessingFee: "",
+              customProcessingType: "",
+              lssueFee: "",
+              deliveryMaterialsFee: "",
+              packingLabor: "",
+              managementFee: "",
+              unitPrice: "",
+              printType: 1,
+              packageRemark: "",
+              orderSkuBomList: orderSkuBomList,
+              blueprint: res.data[i].designImgUrl,
+              productionDocument: res.data[i].sharedFolder,
+              artworkLibraryId: "0",
+              inventoryQuantity: res.data[i].inventoryQuantity,
+              proofingFee: 0,
+            });
+          }
+        }
+      }
+    },
+    (err) => {
+      console.log(err);
+      loadingUpload.value = false;
+    }
+  );
+};
 // 向父组件暴露
 defineExpose({ getFormData, handleSubmit, saveShippingPackage });
 </script>