lxf 1 سال پیش
والد
کامیت
e1dffe3b20
2فایلهای تغییر یافته به همراه86 افزوده شده و 16 حذف شده
  1. 85 15
      src/views/group/order/management/detail.vue
  2. 1 1
      src/views/subsidiary/order/management/add.vue

+ 85 - 15
src/views/group/order/management/detail.vue

@@ -311,6 +311,15 @@
             </el-collapse>
           </div>
         </template>
+        <template #package>
+          <div style="width: 100%; padding: 0 20px">
+            <el-form :model="formData.data">
+              <el-form-item>
+                <el-button type="primary" size="small" @click="clickViewPackaging()" v-preReClick>产品包装配置</el-button>
+              </el-form-item>
+            </el-form>
+          </div>
+        </template>
         <template #deliveryTime>
           <div style="width: 100%">
             <el-date-picker
@@ -329,13 +338,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>
@@ -405,6 +411,38 @@
         <el-button type="primary" @click="submitChangePrice()" size="large" v-preReClick>提 交</el-button>
       </template>
     </el-dialog>
+    
+    <el-dialog title="包装配置" v-if="openViewPackaging" v-model="openViewPackaging" width="80%">
+      <div style="height: calc(100vh - 184px); overflow-y: auto; overflow-x: hidden">
+        <div style="font-weight: 700; margin: 20px 0 10px 0">发货包装</div>
+        <el-table :data="formData.data.orderPackageBomList" :row-style="{ height: '35px' }" header-row-class-name="tableHeader">
+          <el-table-column label="品号" prop="code" width="160" />
+          <el-table-column label="品名" prop="name" min-width="220" />
+          <el-table-column label="销售单价" prop="internalSellingPrice" width="100" />
+          <el-table-column label="数量" prop="quantity" width="120" />
+          <el-table-column label="销售小计" width="120">
+            <template #default="{ row }">
+              {{ moneyFormat(computePackagingMoney(row, "internalSellingPrice"), 2) }}
+            </template>
+          </el-table-column>
+        </el-table>
+        <div style="font-weight: 700; margin: 20px 0 10px 0">外箱不干胶图稿</div>
+        <div style="display: flex; width: 100%">
+          <div style="width: 80px; line-height: 32px">不干胶图片:</div>
+          <div style="width: calc(100% - 80px)">
+            <el-image
+              fit="scale-down"
+              style="width: 148px; height: 148px; margin-right: 10px; cursor: pointer"
+              v-if="formData.data.outerBoxSelfAdhesiveStickerFile && formData.data.outerBoxSelfAdhesiveStickerFile.fileUrl"
+              :src="formData.data.outerBoxSelfAdhesiveStickerFile.fileUrl"
+              @click="openFile(formData.data.outerBoxSelfAdhesiveStickerFile.fileUrl)" />
+          </div>
+        </div>
+      </div>
+      <template #footer>
+        <el-button @click="openViewPackaging = false">关 闭</el-button>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -434,6 +472,8 @@ const formData = reactive({
     type: 1,
     orderSkuList: [],
     fileList: [],
+    orderPackageBomList: [],
+    outerBoxSelfAdhesiveStickerFile: {},
   },
 });
 const formConfig = computed(() => {
@@ -448,6 +488,19 @@ const formConfig = computed(() => {
       prop: "orderSkuList",
       slotName: "orderSkuList",
     },
+    route.query && route.query.detailId
+      ? {
+          type: "title",
+          title: "产品包装配置",
+          label: "",
+        }
+      : {},
+    route.query && route.query.detailId
+      ? {
+          type: "slot",
+          slotName: "package",
+        }
+      : {},
     {
       type: "title",
       title: "类型",
@@ -643,6 +696,12 @@ const getOrderDetail = (parameter) => {
           } else {
             fileList.value = [];
           }
+          let outerBoxSelfAdhesiveStickerFile = fileObj[formData.data.id].filter((item) => item.businessType == "1");
+          if (outerBoxSelfAdhesiveStickerFile && outerBoxSelfAdhesiveStickerFile.length > 0) {
+            formData.data.outerBoxSelfAdhesiveStickerFile = outerBoxSelfAdhesiveStickerFile[0];
+          } else {
+            formData.data.outerBoxSelfAdhesiveStickerFile = {};
+          }
         }
         for (let i = 0; i < formData.data.orderSkuList.length; i++) {
           if (fileObj[formData.data.orderSkuList[i].id] && fileObj[formData.data.orderSkuList[i].id].length > 0) {
@@ -734,7 +793,7 @@ const clickRefresh = (index, label) => {
   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.packagingMaterialCost = calculatedPackagingMaterialCost();
@@ -788,10 +847,9 @@ const submitChangePrice = () => {
         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();
         if (fileList.value && fileList.value.length > 0) {
@@ -836,7 +894,7 @@ const submitChangePrice = () => {
         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.packagingMaterialCost = calculatedPackagingMaterialCost();
@@ -897,7 +955,7 @@ const clickBomPriceRefresh = (index, indexBOM, label) => {
   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.packagingMaterialCost = calculatedPackagingMaterialCost();
@@ -1000,10 +1058,9 @@ const calculatedTotalAmount = () => {
       (calculatedAmount("unitPrice") +
         calculatedAmount("customProcessingFee") +
         calculatedAmount("lssueFee") +
-        calculatedAmount("deliveryMaterialsFee") +
+        computeDeliveryMaterialsFee() +
         calculatedAmount("packingLabor") +
         calculatedAmount("managementFee") +
-        // calculatedOuterBoxPackingFee() +
         calculatedPackagingMaterialCost()) *
         100
     ) / 100
@@ -1027,17 +1084,30 @@ const onSuccessFile = (any, UploadFile) => {
 const onPreviewFile = (file) => {
   window.open(file.raw.fileUrl, "_blank");
 };
-const calculatedOuterBoxPackingFee = () => {
-  let money = 0;
+const computeDeliveryMaterialsFee = () => {
+  let money = calculatedAmount("deliveryMaterialsFee");
   if (formData.data.orderPackageBomList && formData.data.orderPackageBomList.length > 0) {
     for (let i = 0; i < formData.data.orderPackageBomList.length; i++) {
-      if (formData.data.orderPackageBomList[i].costPrice && formData.data.orderPackageBomList[i].quantity) {
-        money = Number(Math.round((money + formData.data.orderPackageBomList[i].costPrice * formData.data.orderPackageBomList[i].quantity) * 100) / 100);
+      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 openViewPackaging = ref(false);
+const clickViewPackaging = () => {
+  openViewPackaging.value = true;
+};
+const computePackagingMoney = (item, label) => {
+  let money = 0;
+  if (item.quantity && item[label]) {
+    money = Number(Math.round(item.quantity * item[label] * 100) / 100);
+  }
+  return money;
+};
 </script>
 
 <style lang="scss" scoped>

+ 1 - 1
src/views/subsidiary/order/management/add.vue

@@ -531,7 +531,7 @@
           <el-table-column label="数量" prop="quantity" width="120" />
           <el-table-column label="销售小计" width="120">
             <template #default="{ row }">
-              {{ moneyFormat(computeMoney(row, "internalSellingPrice"), 2) }}
+              {{ moneyFormat(computePackagingMoney(row, "internalSellingPrice"), 2) }}
             </template>
           </el-table-column>
         </el-table>