Ver código fonte

物料变更单-提交-批号管理、序列号管理改变,需要判断现存量和出入库流水

002390 1 ano atrás
pai
commit
338e1c7c07

+ 1 - 21
src/views/material/changeApply/add/index.vue

@@ -205,10 +205,6 @@ export default {
     //
     async useSubmit(prop) {
       let params = _.cloneDeep(this.params);
-      params.materialBasic = params.materialBasic.map((item) => {
-        delete item.isNewVersion;
-        return item;
-      });
 
       this.handleSubmitValidate(prop, async () => {
         try {
@@ -288,21 +284,7 @@ export default {
       }
       this.changeExpiryDateManagerment(row);
     },
-    visibleChange(val, source) {
-      val &&
-        !source.isNewVersion &&
-        this.$confirm("是否生成新版本?", "提示", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning",
-        })
-          .then(() => {
-            source.isNewVersion = true;
-          })
-          .catch(() => {
-            source.isNewVersion = false;
-          });
-    },
+    
     changeExpiryDateManagerment(row) {
       if (row.expiryDateManagerment === "2") {
         row.usefulLife = "";
@@ -479,7 +461,6 @@ export default {
                 v-model="scope.row[scope.item.key]"
                 :size="$attrs.size"
                 :source.sync="scope.row"
-                @visible-change="(val) => visibleChange(val, scope.row)"
                 @change="changeIsInventoryStatus(scope.row)"
               >
                 <el-option
@@ -518,7 +499,6 @@ export default {
                 :size="$attrs.size"
                 :source.sync="scope.row"
                 :disabled="scope.row.isInventoryStatus !== '0'"
-                @visible-change="(val) => visibleChange(val, scope.row)"
               >
                 <el-option
                   v-for="item in dict.type[scope.attr.dictName]"

+ 81 - 36
src/views/material/changeApply/see/index.vue

@@ -127,19 +127,66 @@ export default {
       this.params = this.$init.params([...TabColumns, ...TableColumns]);
     },
 
+    // 提交
     async handleSubmit() {
-      this.params = { ...this.params, status: "1" };
-      console.log(this.params, "this.params");
+      let params = _.cloneDeep({ ...this.params, status: "1" });
+
+      console.log(params, "params");
       try {
         this.loading = true;
 
-        const { code, msg } = await addChangeList(this.params);
+        const { code, msg } = await addChangeList({
+          ...params,
+          isInventory: "Y",
+        });
 
         if (code == 200) {
           this.hide();
           this.$notify.success({
             message: msg,
           });
+        } else if (code == 10000) {
+          this.$alert(
+            "<div style='overflow: auto;overflow-x: hidden;max-height: 65vh;padding: 10px 20px 0;'>" +
+              msg +
+              "</div>",
+            "提示",
+            {
+              showCancelButton: true,
+              dangerouslyUseHTMLString: true,
+              confirmButtonText: "确认",
+              cancelButtonText: "取消",
+              beforeClose: async (action, instance, done) => {
+                if (action === "confirm") {
+                  instance.confirmButtonLoading = true;
+                  instance.confirmButtonText = "执行中...";
+                  try {
+                    const { code, msg } = await addChangeList({
+                      ...params,
+                      isInventory: "N",
+                    });
+                    if (code == 200) {
+                      done();
+                      this.hide();
+                      this.$notify.success({
+                        message: msg,
+                      });
+                    }
+                  } catch (error) {
+                    instance.confirmButtonText = "确认";
+                  } finally {
+                    instance.confirmButtonLoading = false;
+                  }
+                } else {
+                  done();
+                  this.$notify.warning({
+                    message:
+                      "不允许修改【批号及库存状态管理】或【是否序列号管理】",
+                  });
+                }
+              },
+            }
+          );
         }
       } catch (error) {
       } finally {
@@ -235,41 +282,39 @@ export default {
         :name="item.key"
         lazy
       >
-        
-          <el-super-ux-table
-            v-model="materialInfo[item.key]"
-            :dict="dict"
-            index
-            :ref="tabName"
-            :columns="columns"
-            :size="$attrs.size"
-            :height="420"
+        <el-super-ux-table
+          v-model="materialInfo[item.key]"
+          :dict="dict"
+          index
+          :ref="tabName"
+          :columns="columns"
+          :size="$attrs.size"
+          :height="420"
+        >
+          <template slot="materialName" slot-scope="scope">
+            <component
+              v-bind="scope.attr"
+              v-model="scope.row[scope.item.key]"
+              :size="$attrs.size"
+              :source.sync="scope.row"
+              @change="changeMaterialName(scope)"
+            >
+            </component>
+          </template>
+          <ux-table-column
+            fixed="right"
+            title="操作"
+            width="120"
+            align="center"
           >
-            <template slot="materialName" slot-scope="scope">
-              <component
-                v-bind="scope.attr"
-                v-model="scope.row[scope.item.key]"
-                :size="$attrs.size"
-                :source.sync="scope.row"
-                @change="changeMaterialName(scope)"
-              >
-              </component>
+            <template slot-scope="scope">
+              <AmendantRecord
+                v-if="tabName === 'materialBasic'"
+                v-model="scope.row"
+              ></AmendantRecord>
             </template>
-            <ux-table-column
-              fixed="right"
-              title="操作"
-              width="120"
-              align="center"
-            >
-              <template slot-scope="scope">
-                <AmendantRecord
-                  v-if="tabName === 'materialBasic'"
-                  v-model="scope.row"
-                ></AmendantRecord>
-              </template>
-            </ux-table-column>
-          </el-super-ux-table>
-        
+          </ux-table-column>
+        </el-super-ux-table>
       </el-tab-pane>
     </el-tabs>
   </el-drawer>