Procházet zdrojové kódy

修改江南的bug

695593266@qq.com před 2 měsíci
rodič
revize
b90757e3e8

+ 17 - 0
src/api/material/inspectionClassify.js

@@ -67,4 +67,21 @@ export async function getTemplateById(id) {
     return res.data;
   }
   return Promise.reject(new Error(res.data.message));
+}
+
+export async function saveTemplate(data) {
+  const res = await request.post(`/qms/qualitytemplate/save`, data);
+  if (res.data.code == 0) {
+    return res.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+export async function getQualityStandardList(data) {
+  let par = new URLSearchParams(data);
+  const res = await request.get(`/qms/qualitystandard/page?` + par, {});
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
 }

+ 16 - 10
src/views/factoryModel/station/components/edit.vue

@@ -190,7 +190,10 @@
           </el-col>
 
           <el-col :span="8">
-            <el-form-item label="所属产线:" prop="productionLineId">
+            <el-form-item
+              label="所属产线:"
+              :prop="clientEnvironmentId == 9 ? '' : 'productionLineId'"
+            >
               <el-select
                 v-model="form.productionLineId"
                 placeholder="请选择"
@@ -443,7 +446,8 @@
       taskIds: [],
       taskNames: [],
       activeName: '',
-      workstationSubstanceList: []
+      workstationSubstanceList: [],
+      clientEnvironmentId: this.$store.state.user.info.clientEnvironmentId
     };
   };
 
@@ -733,14 +737,16 @@
           if (!valid) {
             return false;
           }
-          this.form.factoryWorkstationOperations =
-            this.$refs.stationMeter.getValue();
-          if (!this.form.factoryWorkstationOperations.length) {
-            return this.$message.error('请添加工序');
-          } else {
-            this.form.taskIds = this.form.factoryWorkstationOperations.map(
-              (n) => n.operationId
-            );
+          if (this.clientEnvironmentId != 9) {
+            this.form.factoryWorkstationOperations =
+              this.$refs.stationMeter.getValue();
+            if (!this.form.factoryWorkstationOperations.length) {
+              return this.$message.error('请添加工序');
+            } else {
+              this.form.taskIds = this.form.factoryWorkstationOperations.map(
+                (n) => n.operationId
+              );
+            }
           }
           this.loading = true;
 

+ 103 - 8
src/views/material/BOMmanage/components/workmanship.vue

@@ -205,6 +205,15 @@
           >
             工步
           </el-link>
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-plus"
+            @click="openCreateStep(row)"
+            v-if="attributeData.status != 1"
+          >
+            创建工步
+          </el-link>
           <el-link
             type="primary"
             :underline="false"
@@ -249,7 +258,7 @@
       :data="current"
       :controlList="controlList"
       :isView="isView"
-      @done="reload"
+      @done="handleStepEditDone"
       ref="userEdit"
       :typeList="typeList"
     />
@@ -270,6 +279,7 @@
   import workingStep from './workingStep.vue';
   import { getMbomPage, workingStepDelete } from '@/api/material/BOM';
   import control from '@/api/technology/control';
+  import stepManagement from '@/api/technology/stepManagement';
   import UserEdit from '@/views/technology/stepManagement/components/user-edit.vue';
   export default {
     name: 'process',
@@ -450,7 +460,8 @@
         showEdit: false,
         current: null,
         isView: false,
-        controlList: []
+        controlList: [],
+        createStepTargetProcess: null
       };
     },
     methods: {
@@ -521,6 +532,7 @@
       openStepConfigure(row, isView) {
         console.log('123123123', row);
         // this.$refs.workingStepRef.open(row, this.taskParam, !!isView);
+        this.createStepTargetProcess = null;
         this.isView = !!isView;
         this.getControlList();
         this.current = row;
@@ -528,6 +540,93 @@
         this.$refs.userEdit.$refs.form &&
           this.$refs.userEdit.$refs.form.clearValidate();
       },
+      openCreateStep(row) {
+        this.createStepTargetProcess = row;
+        this.isView = false;
+        this.getControlList();
+        this.current = null;
+        this.showEdit = true;
+        this.$refs.userEdit.$refs.form &&
+          this.$refs.userEdit.$refs.form.clearValidate();
+      },
+      async handleStepEditDone(stepData, formData) {
+        if (this.createStepTargetProcess && !this.current) {
+          const currentProcess = this.createStepTargetProcess;
+          this.createStepTargetProcess = null;
+          const currentStep = await this.getCreatedStep(stepData, formData);
+          if (currentStep && currentStep.id) {
+            this.chooseStepModal([currentStep], currentProcess);
+            return;
+          }
+          this.openStepSetting(currentProcess);
+          return;
+        }
+        this.createStepTargetProcess = null;
+        this.reload();
+      },
+      async getCreatedStep(stepData, formData) {
+        if (stepData && stepData.id) {
+          return stepData;
+        }
+        if (!formData || (!formData.name && !formData.code)) {
+          return null;
+        }
+        const res = await stepManagement.list({
+          pageNum: 1,
+          size: 50,
+          name: formData.name,
+          code: formData.code,
+          status: formData.status
+        });
+        const stepList = Array.isArray(res)
+          ? res
+          : Array.isArray(res?.list)
+          ? res.list
+          : [];
+        if (!stepList.length) {
+          return null;
+        }
+        return (
+          stepList.find((item) => {
+            return (
+              item.name === formData.name &&
+              (!formData.code || item.code === formData.code)
+            );
+          }) ||
+          stepList.sort((a, b) => Number(b.id || 0) - Number(a.id || 0))[0]
+        );
+      },
+      async refreshStepList(current) {
+        const data = await getStepListById({
+          paramId: current.id,
+          bomCategoryId: this.taskParam.id
+        });
+        const tableList = this.$refs.table.getData() || [];
+        const clonedArray = JSON.parse(JSON.stringify(tableList));
+        clonedArray.forEach((item) => {
+          if (item.id == current.id) {
+            item.categoryParamStepList = data;
+          }
+        });
+        this.$refs.table.setData([...clonedArray]);
+        this.expandCurrentProcess(current.id);
+      },
+      expandCurrentProcess(processId) {
+        this.$nextTick(() => {
+          const tableRef = this.$refs.table;
+          const tableList = tableRef.getData ? tableRef.getData() : [];
+          const currentRow = tableList.find((item) => item.id == processId);
+          if (!currentRow) {
+            this.$forceUpdate();
+            return;
+          }
+          tableRef.toggleRowExpansionAll(false);
+          if (tableRef.toggleRowExpansion) {
+            tableRef.toggleRowExpansion(currentRow, true);
+          }
+          this.$forceUpdate();
+        });
+      },
 
       getControlList() {
         const params = {
@@ -631,11 +730,7 @@
 
         this.$refs.table.setData([...clonedArray]);
         this.$emit('chooseProcess', clonedArray);
-
-        this.$nextTick(() => {
-          this.$refs.table.toggleRowExpansionAll();
-          this.$forceUpdate();
-        });
+        this.expandCurrentProcess(current.id);
       },
       chooseStepModal(data, current) {
         console.log(data, 'data');
@@ -655,7 +750,7 @@
           });
           workingStepSave(params).then((data) => {
             this.$message.success('保存成功');
-            this.reload();
+            this.refreshStepList(current);
           });
         }
         // this.reload();

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 932 - 98
src/views/material/BOMmanage/qualityTesting/term.vue


+ 2 - 1
src/views/technology/stepManagement/components/user-edit.vue

@@ -298,6 +298,7 @@
           if (!valid) {
             return false;
           }
+          const submitForm = JSON.parse(JSON.stringify(this.form));
           if (!this.isUpdate) {
             delete this.form.id;
           }
@@ -310,7 +311,7 @@
                 (this.isUpdate ? '修改' : '新建') + msg.message
               );
               this.updateVisible(false);
-              this.$emit('done');
+              this.$emit('done', msg.data, submitForm);
             })
             .catch((e) => {
               this.loading = false;

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů