فهرست منبع

包装出货bug

cz 1 سال پیش
والد
کامیت
e897f0c6e0

+ 2 - 1
src/components/process/Contract.vue

@@ -139,7 +139,8 @@
             <el-table-column label="规格型号" width="180">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
-                  <el-form-item :prop="'contractProductList.' + $index + '.productModel'" :rules="rules.productModel" :inline-message="true">
+                  <!-- :rules="rules.productModel" -->
+                  <el-form-item :prop="'contractProductList.' + $index + '.productModel'"  :inline-message="true">
                     <el-input v-model="row.productModel" placeholder="请输入规格型号" />
                   </el-form-item>
                 </div>

+ 2 - 1
src/components/process/PriceSheet.vue

@@ -139,7 +139,8 @@
             <el-table-column label="规格型号" width="180">
               <template #default="{ row, $index }">
                 <div style="width: 100%">
-                  <el-form-item :prop="'quotationProductList.' + $index + '.productModel'" :rules="rules.productModel" :inline-message="true">
+                  <!-- :rules="rules.productModel" -->
+                  <el-form-item :prop="'quotationProductList.' + $index + '.productModel'"  :inline-message="true">
                     <el-input v-model="row.productModel" placeholder="请输入规格型号" />
                   </el-form-item>
                 </div>

+ 20 - 1
src/views/connect/E-mail/mail/com/left.vue

@@ -3,10 +3,12 @@
     <div class="top">
       <el-dropdown>
         <span class="mail">
+          <!-- <el-badge :value="12" :max="99" class="item"> -->
           {{ selectMail.mailUser }}
-          <el-icon class="el-icon--right">
+          <el-icon class="el-icon--right" style="margin-right: 15px">
             <arrow-down />
           </el-icon>
+          <!-- </el-badge> -->
         </span>
         <template #dropdown>
           <el-dropdown-menu>
@@ -95,6 +97,9 @@
               v-else-if="item.sort === 6"
             ></i>
             <span style="margin-left: 5px">{{ item.name }}</span>
+            <!-- <div v-if="item.sort === 1" class="badge">
+              <span> 40 </span>
+            </div> -->
           </li>
         </ul>
         <!-- 员工邮箱 -->
@@ -800,6 +805,20 @@ defineExpose({
           font-size: 16px;
           color: #999999;
         }
+        .badge {
+          background: #eeeeee;
+          height: 20px;
+          width: 30px;
+          border-radius: 10px;
+          line-height: 20px;
+          text-align: center;
+          font-weight: normal;
+          margin-left: auto;
+          margin-right: 10px;
+          span {
+            color: #666666;
+          }
+        }
       }
     }
   }

+ 94 - 69
src/views/salesMange/shipmentMange/packing/index.vue

@@ -152,9 +152,10 @@
                     v-model="item.packQuantity"
                     :precision="0"
                     :controls="false"
-                    :min="0"
+                    :min="1"
                     placeholder="请输入"
                     onmousewheel="return false;"
+                    @change="(val) => handleChangePackQuantity(val, index)"
                   />
                 </el-form-item>
               </el-col>
@@ -459,7 +460,7 @@ const selectConfig = reactive([
         value: "0",
       },
       {
-        label: "出货",
+        label: "出货",
         value: "1",
       },
     ],
@@ -469,9 +470,9 @@ const config = computed(() => {
   return [
     {
       type: "selection",
-      // attrs: {
-      //   checkAtt: "isCheck",
-      // },
+      attrs: {
+        checkAtt: "isCheck",
+      },
     },
     {
       attrs: {
@@ -492,12 +493,14 @@ const config = computed(() => {
       attrs: {
         label: "总箱数",
         prop: "packQuantity",
+        width: 90,
       },
     },
     {
       attrs: {
         label: "净重",
         prop: "netWeight",
+        width: 90,
       },
       render(netWeight) {
         return netWeight + "kg";
@@ -507,6 +510,7 @@ const config = computed(() => {
       attrs: {
         label: "毛重",
         prop: "roughWeight",
+        width: 90,
       },
 
       render(roughWeight) {
@@ -517,6 +521,7 @@ const config = computed(() => {
       attrs: {
         label: "长",
         prop: "boxLong",
+        width: 90,
       },
       render(boxLong) {
         return boxLong + "cm";
@@ -527,6 +532,7 @@ const config = computed(() => {
       attrs: {
         label: "宽",
         prop: "boxWide",
+        width: 90,
       },
       render(boxWide) {
         return boxWide + "cm";
@@ -536,6 +542,7 @@ const config = computed(() => {
       attrs: {
         label: "高",
         prop: "boxHigh",
+        width: 90,
       },
       render(boxHigh) {
         return boxHigh + "cm";
@@ -545,6 +552,7 @@ const config = computed(() => {
       attrs: {
         label: "总体积",
         prop: "bomVolume",
+        width: 120,
       },
       render(bomVolume) {
         return bomVolume + "m³";
@@ -554,6 +562,7 @@ const config = computed(() => {
       attrs: {
         label: "出货状态",
         prop: "shipmentStatus",
+        width: 90,
       },
       render(status) {
         return status == 1 ? "出货" : status == 0 ? "未出货" : "";
@@ -563,64 +572,63 @@ const config = computed(() => {
       attrs: {
         label: "出货时间",
         prop: "shipmentTime",
+        width: 155,
       },
     },
-
     {
       attrs: {
         label: "操作",
-        width: "200",
-        align: "right",
+        width: "90",
+        align: "center",
       },
       // 渲染 el-button,一般用在最后一列。
       renderHTML(row) {
         return [
-          {
-            attrs: {
-              label: "打印",
-              type: "primary",
-              text: true,
-            },
-            el: "button",
-            click() {
-              getDtl(row);
-            },
-          },
-          {
-            attrs: {
-              label: "删除",
-              type: "danger",
-              text: true,
-              disabled: row.status != 30,
-            },
-            el: "button",
-            click() {
-              // 弹窗提示是否删除
-              ElMessageBox.confirm(
-                "此操作将永久作废该数据, 是否继续?",
-                "提示",
-                {
-                  confirmButtonText: "确定",
-                  cancelButtonText: "取消",
-                  type: "warning",
-                }
-              ).then(() => {
-                // 删除
-                proxy
-                  .post("/subscribeDetail/edit", {
-                    ...row,
-                    status: 99,
-                  })
-                  .then((res) => {
-                    ElMessage({
-                      message: "作废成功",
-                      type: "success",
-                    });
-                    getList();
-                  });
-              });
-            },
-          },
+          // {
+          //   attrs: {
+          //     label: "打印",
+          //     type: "primary",
+          //     text: true,
+          //   },
+          //   el: "button",
+          //   click() {
+          //     getDtl(row);
+          //   },
+          // },
+          // {
+          //   attrs: {
+          //     label: "删除",
+          //     type: "primary",
+          //     text: true,
+          //     disabled: row.status != 30,
+          //   },
+          //   el: "button",
+          //   click() {
+          //     ElMessageBox.confirm(
+          //       "此操作将永久作废该数据, 是否继续?",
+          //       "提示",
+          //       {
+          //         confirmButtonText: "确定",
+          //         cancelButtonText: "取消",
+          //         type: "warning",
+          //       }
+          //     ).then(() => {
+          //       // 删除
+          //       proxy
+          //         .post("/subscribeDetail/edit", {
+          //           ...row,
+          //           status: 99,
+          //         })
+          //         .then((res) => {
+          //           ElMessage({
+          //             message: "作废成功",
+          //             type: "success",
+          //           });
+          //           getList();
+          //         });
+          //     });
+          //   },
+          // },
         ];
       },
     },
@@ -650,13 +658,16 @@ const formConfig = reactive([
 ]);
 
 const getList = async (req) => {
+  selectData.value = [];
   sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
   loading.value = true;
   proxy
     .post("/packDetail/page", sourceList.value.pagination)
     .then((message) => {
-      console.log(message);
-      sourceList.value.data = message.rows;
+      sourceList.value.data = message.rows.map((x) => ({
+        ...x,
+        isCheck: x.shipmentStatus == 1 ? false : true,
+      }));
       sourceList.value.pagination.total = message.total;
       setTimeout(() => {
         loading.value = false;
@@ -804,9 +815,9 @@ const handleClickPacking = () => {
     formData.data.packDetailList.push({
       customerId: customerId,
       contractIds: contractIds,
-      packQuantity: "",
-      netWeight: "",
-      roughWeight: "",
+      packQuantity: undefined,
+      netWeight: undefined,
+      roughWeight: undefined,
       boxLong: undefined,
       boxWide: undefined,
       boxHigh: undefined,
@@ -816,16 +827,6 @@ const handleClickPacking = () => {
       packDetailProductList: packDetailProductList,
       isShow: false,
     });
-    // 减去待装箱数量
-    for (let i = 0; i < list.length; i++) {
-      const e = list[i];
-      for (let j = 0; j < formData.data.contractProductData.length; j++) {
-        const jele = formData.data.contractProductData[j];
-        if (e.id === jele.id) {
-          formData.data.contractProductData[j].waitQuantity -= e.quantity;
-        }
-      }
-    }
   } else {
     return ElMessage({
       message: "请选择产品 !",
@@ -834,6 +835,30 @@ const handleClickPacking = () => {
   }
 };
 
+const handleChangePackQuantity = (val, index) => {
+  if (formData.data.contractProductData.length > 0 && val && val > 0) {
+    for (let j = 0; j < formData.data.contractProductData.length; j++) {
+      const e = formData.data.contractProductData[j];
+      e.waitQuantity = Number(e.cpQuantity) - Number(e.sumPackQuantity);
+      let quantity = e.waitQuantity - val * Number(e.quantity);
+      if (quantity < 0) {
+        formData.data.packDetailList[index].packQuantity = undefined;
+        return ElMessage({
+          message: "装箱数量 * 箱数不可大于待装箱数量",
+          type: "info",
+        });
+      } else {
+        e.waitQuantity = quantity;
+      }
+    }
+  } else {
+    for (let j = 0; j < formData.data.contractProductData.length; j++) {
+      const e = formData.data.contractProductData[j];
+      e.waitQuantity = Number(e.cpQuantity) - Number(e.sumPackQuantity);
+    }
+  }
+};
+
 const handleCustomPush = (index) => {
   formData.data.packDetailList[index].packDetailGoodsList.push({
     unit: "",