lxf 1 an în urmă
părinte
comite
cf901f2a32
1 a modificat fișierele cu 6 adăugiri și 13 ștergeri
  1. 6 13
      src/views/production/operation/batching/quick.vue

+ 6 - 13
src/views/production/operation/batching/quick.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <el-card class="box-card">
+    <el-card class="box-card" v-loading="loading">
       <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
         <template #basicInformation>
           <div style="width: 100%">
@@ -75,18 +75,8 @@
               </el-table-column>
               <el-table-column label="剩余库存" prop="surplusStock" width="120" />
               <el-table-column label="出库数量" width="140">
-                <template #default="{ row, $index }">
-                  <el-form-item :prop="'inOutStorageBomList.' + $index + '.quantity'" :rules="rules.quantity" :inline-message="true" style="width: 100%">
-                    <el-input-number
-                      onmousewheel="return false;"
-                      v-model="row.quantity"
-                      placeholder="出库数量"
-                      style="width: 100%"
-                      :controls="false"
-                      :min="0"
-                      :precision="0"
-                      disabled />
-                  </el-form-item>
+                <template #default="{ row }">
+                  <span :style="row.surplusStock && row.surplusStock > row.quantity ? '' : 'color: red'">{{ row.quantity }}</span>
                 </template>
               </el-table-column>
               <el-table-column label="操作" align="center" fixed="right" width="80">
@@ -186,6 +176,7 @@ const duplicateRemoval = (arr) => {
   let list = [];
   return arr.filter((item) => !list.includes(item) && list.push(item));
 };
+const loading = ref(false)
 const submitForm = () => {
   submit.value.handleSubmit(async () => {
     if (formData.data.inOutStorageBomList && formData.data.inOutStorageBomList.length > 0) {
@@ -194,6 +185,7 @@ const submitForm = () => {
           return ElMessage("出库数量大于剩余库存数量");
         }
       }
+      loading.value = true
       for (let i = 0; i < warehouseList.value.length; i++) {
         let data = proxy.deepClone(formData.data);
         data.inOutStorageBomList = data.inOutStorageBomList.filter((item) => item.warehouseId === warehouseList.value[i].dictKey);
@@ -208,6 +200,7 @@ const submitForm = () => {
         }
       }
       ElMessage({ message: "提交完成", type: "success" });
+      loading.value = false
       emit("clickCancel", true);
     } else {
       return ElMessage("请添加BOM");