ezhizao_zx 4 ماه پیش
والد
کامیت
9c66d7a86b
1فایلهای تغییر یافته به همراه14 افزوده شده و 14 حذف شده
  1. 14 14
      src/views/business/returnTurnover/DialogReturnTurnoverBatch.vue

+ 14 - 14
src/views/business/returnTurnover/DialogReturnTurnoverBatch.vue

@@ -8,19 +8,13 @@
           <el-button @click="showProcessList">工序列表</el-button>
         </el-form-item>
         <el-form-item label="下序是否包装:" prop="isSortPackaging" label-width="130px">
-        <el-switch
-          v-model="form.isSortPackaging"
-          active-text="是"
-          :active-value="1"
-          inactive-text="否"
-          :inactive-value="0"
-
-        />
-      </el-form-item>
+          <el-switch v-model="form.isSortPackaging" active-text="是" :active-value="1" inactive-text="否"
+            :inactive-value="0" />
+        </el-form-item>
       </el-form>
     </div>
     <template #footer>
-      <el-button v-if="form.flag" type="primary" icon="Check" @click="handleSave">确 定</el-button>
+      <el-button v-if="form.flag" :loading="saveLoading" type="primary" icon="Check" @click="handleSave">确 定</el-button>
       <el-button v-if="form.flag" icon="Close" @click="handleCancel">取 消</el-button>
     </template>
     <dialog-process ref="dialogProcessRef" />
@@ -43,6 +37,7 @@ const deptList = ref([]);
 const loadingCarrier = ref(false);
 const visible = ref(false);
 const dialogProcessRef = ref(null)
+const saveLoading = ref(false)
 const data = reactive({
   form: {},
   rules: {
@@ -68,7 +63,7 @@ function openBatch(batches) {
   visible.value = true;
   console.log(batches)
   form.value = proxy.deepClone(batches[0]);
- form.value.isSortPackaging ="0"
+  form.value.isSortPackaging = "0"
   console.log(form.value)
   if (form.value.productionDeptId == 0) {
     form.value.productionDeptId = null;
@@ -116,12 +111,12 @@ function getTurnoverDept(data) {
 }
 function handleDeptChange() {
   console.log(deptList.value)
-  let deptInfo = deptList.value.find(item =>item.value == form.value.productionDeptId)
+  let deptInfo = deptList.value.find(item => item.value == form.value.productionDeptId)
   console.log(deptInfo)
-  if(deptInfo.isSortPackaging == 1) {
+  if (deptInfo.isSortPackaging == 1) {
     form.value.isSortPackaging = 1
     console.log(form.value)
-  }else{
+  } else {
     form.value.isSortPackaging = 0
   }
 }
@@ -176,9 +171,11 @@ function reset() {
 
 /** 提交按钮 */
 function handleSave() {
+  saveLoading.value = true
   console.log(form.value)
   if (!form.value.flag) {
     visible.value = false;
+    saveLoading.value = false
   } else {
     proxy.$refs["returnTurnoverRef"].validate((valid) => {
       if (valid) {
@@ -187,7 +184,10 @@ function handleSave() {
           proxy.$modal.msgSuccess("修改成功");
           visible.value = false;
           emit("handleSaveSuccess");
+          saveLoading.value = false
         });
+      } else {
+        saveLoading.value = false
       }
     });
   }