Sfoglia il codice sorgente

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend into dev

yusheng 2 mesi fa
parent
commit
a91b15ad3d

+ 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));
 }

+ 1 - 1
src/components/selectReleaseRules/select-release-rules.vue

@@ -113,7 +113,7 @@
           },
           {
             prop: 'reportWorkType',
-            label: '模块划分',
+            label: '报工类型',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110,

+ 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;
 

+ 162 - 23
src/views/material/BOMmanage/components/workingProcedure.vue

@@ -124,7 +124,14 @@
             :columns="columns"
           >
             <!-- 表头工具栏 -->
-            <template v-if="!isView" v-slot:toolbar>
+            <template
+              v-if="
+                !isView &&
+                attributeData.approvalStatus != 1 &&
+                attributeData.approvalStatus != 2
+              "
+              v-slot:toolbar
+            >
               <el-button
                 size="small"
                 icon="el-icon-plus"
@@ -215,6 +222,10 @@
             <!-- 操作列 -->
             <template v-slot:action="{ row }">
               <el-popconfirm
+                v-if="
+                  attributeData.approvalStatus != 1 &&
+                  attributeData.approvalStatus != 2
+                "
                 class="ele-action"
                 title="确定要删除当前参数吗?"
                 @confirm="remove(row, '工艺')"
@@ -235,7 +246,7 @@
         <el-tab-pane label="质检项参数" name="质检项参数">
           <term
             :qualityParam="qualityParam"
-            :isView="isView"
+            :isView="isReadonly"
             :isQualityInspection="false"
             ref="qualityParamRef"
           ></term>
@@ -563,7 +574,6 @@
                 v-else
                 v-model="row.count"
                 placeholder="请输入"
-                style="width: 90px"
                 @input="handleInput(row)"
                 :disabled="
                   attributeData.approvalStatus == 1 ||
@@ -572,6 +582,21 @@
               ></el-input>
             </template>
 
+            <template v-slot:weight="{ row }">
+              <div v-if="isView">{{ row.weight }}</div>
+              <el-input
+                v-else
+                v-model="row.weight"
+                placeholder="请输入"
+                oninput="value = value.replace(/[^\d.]/g, '')"
+                :disabled="
+                  attributeData.approvalStatus == 1 ||
+                  attributeData.approvalStatus == 2 ||
+                  !row.weightUnit
+                "
+              ></el-input>
+            </template>
+
             <template v-slot:categoryName="{ row, $index }">
               <el-link
                 type="primary"
@@ -631,11 +656,24 @@
             :immediate="true"
           >
             <!-- 表头工具栏 -->
-            <template v-if="!isView" v-slot:toolbar>
+            <template
+              v-if="
+                !isView &&
+                attributeData.approvalStatus != 1 &&
+                attributeData.approvalStatus != 2
+              "
+              v-slot:toolbar
+            >
               <el-button type="primary" @click="add">添加</el-button>
             </template>
             <template v-slot:action="{ row, $index }">
-              <el-link type="danger" @click="handleDel(row, $index)"
+              <el-link
+                v-if="
+                  attributeData.approvalStatus != 1 &&
+                  attributeData.approvalStatus != 2
+                "
+                type="danger"
+                @click="handleDel(row, $index)"
                 >删除</el-link
               >
             </template>
@@ -651,11 +689,24 @@
             :immediate="true"
           >
             <!-- 表头工具栏 -->
-            <template v-if="!isView" v-slot:toolbar>
+            <template
+              v-if="
+                !isView &&
+                attributeData.approvalStatus != 1 &&
+                attributeData.approvalStatus != 2
+              "
+              v-slot:toolbar
+            >
               <el-button type="primary" @click="add">添加</el-button>
             </template>
             <template v-slot:action="{ row, $index }">
-              <el-link type="primary" @click="handleDel(row, $index)"
+              <el-link
+                v-if="
+                  attributeData.approvalStatus != 1 &&
+                  attributeData.approvalStatus != 2
+                "
+                type="primary"
+                @click="handleDel(row, $index)"
                 >删除</el-link
               >
             </template>
@@ -743,7 +794,13 @@
             row-key="id"
           >
             <!-- 表头工具栏 -->
-            <template v-slot:toolbar>
+            <template
+              v-slot:toolbar
+              v-if="
+                attributeData.approvalStatus != 1 &&
+                attributeData.approvalStatus != 2
+              "
+            >
               <el-button
                 size="small"
                 type="primary"
@@ -754,7 +811,13 @@
               >
             </template>
             <template v-slot:action="{ row, $index }">
-              <el-link type="primary" @click="handleDel(row, $index)"
+              <el-link
+                v-if="
+                  attributeData.approvalStatus != 1 &&
+                  attributeData.approvalStatus != 2
+                "
+                type="primary"
+                @click="handleDel(row, $index)"
                 >删除</el-link
               >
             </template>
@@ -768,11 +831,24 @@
             :need-page="false"
             :immediate="true"
           >
-            <template v-if="!isView" v-slot:toolbar>
+            <template
+              v-if="
+                !isView &&
+                attributeData.approvalStatus != 1 &&
+                attributeData.approvalStatus != 2
+              "
+              v-slot:toolbar
+            >
               <el-button type="primary" @click="addFile">添加</el-button>
             </template>
             <template v-slot:action="{ row, $index }">
-              <el-link type="primary" @click="handleDel(row, $index)"
+              <el-link
+                v-if="
+                  attributeData.approvalStatus != 1 &&
+                  attributeData.approvalStatus != 2
+                "
+                type="primary"
+                @click="handleDel(row, $index)"
                 >删除</el-link
               >
               <el-link type="primary" @click="fileDetails(row)">详情</el-link>
@@ -789,11 +865,24 @@
             :immediate="true"
           >
             <!-- 表头工具栏 -->
-            <template v-if="!isView" v-slot:toolbar>
+            <template
+              v-if="
+                !isView &&
+                attributeData.approvalStatus != 1 &&
+                attributeData.approvalStatus != 2
+              "
+              v-slot:toolbar
+            >
               <el-button type="primary" @click="add">添加</el-button>
             </template>
             <template v-slot:action="{ row, $index }">
-              <el-link type="danger" @click="handleDel(row, $index)"
+              <el-link
+                v-if="
+                  attributeData.approvalStatus != 1 &&
+                  attributeData.approvalStatus != 2
+                "
+                type="danger"
+                @click="handleDel(row, $index)"
                 >删除</el-link
               >
             </template>
@@ -805,13 +894,14 @@
             :produce-task-name="rowData.name"
             :produce-task-code="rowData.code"
             :bom-category-id="resourceBomId"
+            :is-view="isReadonly"
             ref="userSettingMatterProcessRef"
           ></userSettingMatterProcess>
         </el-tab-pane>
         <el-tab-pane label="首件两检" name="首件两检">
           <term
             :qualityParam="firstArticleDualInspectionParam"
-            :isView="isView"
+            :isView="isReadonly"
             ref="firstArticleDualInspectionParamRef"
           ></term>
         </el-tab-pane>
@@ -824,13 +914,26 @@
             :immediate="true"
           >
             <!-- 表头工具栏 -->
-            <template v-if="!isView" v-slot:toolbar>
+            <template
+              v-if="
+                !isView &&
+                attributeData.approvalStatus != 1 &&
+                attributeData.approvalStatus != 2
+              "
+              v-slot:toolbar
+            >
               <el-button type="primary" @click="addFile('ncCodeList')"
                 >添加</el-button
               >
             </template>
             <template v-slot:action="{ row, $index }">
-              <el-link type="primary" @click="handleDel(row, $index)"
+              <el-link
+                v-if="
+                  attributeData.approvalStatus != 1 &&
+                  attributeData.approvalStatus != 2
+                "
+                type="primary"
+                @click="handleDel(row, $index)"
                 >删除</el-link
               >
               <el-link type="primary" @click="fileDetails(row, 'nc')"
@@ -871,15 +974,25 @@
       <el-button
         type="primary"
         size="small"
-        v-if="!isView"
+        v-if="
+          !isView &&
+          attributeData.approvalStatus != 1 &&
+          attributeData.approvalStatus != 2
+        "
         @click="save('save')"
       >
         保存</el-button
       >
 
-      <el-button type="primary" size="small" @click="save('close')">{{
-        isView ? '确定' : '保存并关闭'
-      }}</el-button>
+      <el-button
+        type="primary"
+        size="small"
+        v-if="
+          attributeData.approvalStatus != 1 && attributeData.approvalStatus != 2
+        "
+        @click="save('close')"
+        >{{ isView ? '确定' : '保存并关闭' }}</el-button
+      >
       <el-button size="small" @click="handleClose">关闭</el-button>
     </div>
   </ele-modal>
@@ -1014,19 +1127,32 @@
           {
             label: '数量',
             slot: 'count',
-            action: 'count'
+            action: 'count',
+            width: 100
           },
           {
             label: '单位',
             slot: 'unit',
             action: 'unit'
           },
+          {
+            label: '重量',
+            prop: 'weight',
+            slot: 'weight',
+            action: 'weight',
+            width: 100
+          },
+          {
+            label: '重量单位',
+            prop: 'weightUnit',
+            width: 80
+          },
 
           {
             label: '附件',
             slot: 'bomArtFiles',
             action: 'bomArtFiles',
-            minWidth: 150
+            minWidth: 100
           },
 
           {
@@ -1366,6 +1492,15 @@
       this.getDictList('time_unit');
       this.getDicTUnitList('measuring_uint');
     },
+    computed: {
+      isReadonly() {
+        return (
+          this.isView ||
+          this.attributeData.approvalStatus == 1 ||
+          this.attributeData.approvalStatus == 2
+        );
+      }
+    },
     methods: {
       addFile(fileListType) {
         this.fileShow = true;
@@ -1642,8 +1777,12 @@
             remark: '',
             specification: item.specification,
             rootCategoryLevelId: item.categoryLevelPathIdParent,
-            extInfo: item.extInfo
+            extInfo: item.extInfo,
+            weightUnit: item.weightUnit,
+            weight: item.netWeight
           });
+
+          console.log('array', array);
         });
 
         let _arr =

+ 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();

File diff suppressed because it is too large
+ 932 - 98
src/views/material/BOMmanage/qualityTesting/term.vue


+ 1 - 1
src/views/material/product/detail.vue

@@ -460,7 +460,7 @@
               </template>
             </el-form-item>
           </el-col>
-          <template v-if="industryAttribute != 2">
+          <template v-if="industryAttribute == 1">
             <el-col :span="8">
               <el-form-item label="性味与归经">
                 <el-input v-model="form.propertiesChannelTropism" />

+ 7 - 2
src/views/technology/production/components/user-setting-matter-process.vue

@@ -9,7 +9,7 @@
       @refresh="getMatterList"
       cache-key="user-setting-matter-process-2510181058"
     >
-      <template v-slot:toolbar>
+      <template v-slot:toolbar v-if="!isView">
         <el-button
           size="small"
           type="primary"
@@ -24,6 +24,7 @@
       <!-- 操作列 -->
       <template v-slot:action="{ row }">
         <el-popconfirm
+          v-if="!isView"
           class="ele-action"
           title="确定要删除此事项吗?"
           @confirm="delMatter(row)"
@@ -44,7 +45,7 @@
         </el-link>
 
         <el-link
-          v-if="row.itemType == 2"
+          v-if="row.itemType == 2 && !isView"
           type="primary"
           :underline="false"
           icon="el-icon-edit"
@@ -110,6 +111,10 @@
       bomCategoryId: {
         type: String,
         required: true
+      },
+      isView: {
+        type: Boolean,
+        default: false
       }
     },
     watch: {

+ 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;

+ 2 - 2
vue.config.js

@@ -35,11 +35,11 @@ module.exports = {
         // target: 'http://192.168.1.3:18086',
         // target: 'http://192.168.1.158:18086',
         // target: 'http://192.168.1.176:18086',
-        target: 'http://192.168.1.125:18086',
+        // target: 'http://192.168.1.125:18086',
         // target: 'http://192.168.1.251:18186',
         // target: 'http://192.168.1.251:18086',
         // target: 'http://192.168.1.251:18186',
-        // target: 'http://192.168.1.125:18086',
+        target: 'http://192.168.1.125:18086',
         // target: 'http://192.168.1.251:18186', // 测试环境
         // target: 'http://192.168.1.251:18087',
         // target: 'http://192.168.1.116:18086',

Some files were not shown because too many files changed in this diff