Просмотр исходного кода

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

695593266@qq.com 7 месяцев назад
Родитель
Сommit
6b82c7836b

+ 2 - 2
src/enum/dict.js

@@ -31,9 +31,9 @@ export default {
   检查有效期单位: 'validity_unit',
   事项类型: 'record_rules_item_type',
   报工类型: 'record_rules_report_work_type',
-  执行方式: 'record_rules_execute_method',
+  执行方式: 'produce_task_config_execute_method',
   记录规则报工类型: 'record_rules_report_work_type',
-  记录规则执行方式: 'record_rules_execute_method',
+  记录规则执行方式: 'produce_task_config_execute_method',
   记录规则事项类型: 'record_rules_item_type',
   规则类型: 'rule_type',
   规则状态: 'rule_status',

+ 6 - 3
src/views/batchRecord/components/editModal.vue

@@ -567,7 +567,7 @@
         deviceId: null,
         //设备名称
         deviceName: '',
-        // 记录规则执行方式,参考字典项:record_rules_execute_method
+        // 记录规则执行方式,参考字典项:produce_task_config_execute_method
         executeMethod: '1',
         // 执行状态
         executeStatus: 0,
@@ -802,6 +802,9 @@
         this.form.ruleId = null;
         this.form.ruleName = '';
         this.form.details = [];
+        this.$nextTick(() => {
+          this.$refs.formRef.clearValidate()
+        });
       },
       // 去选择设备
       selectDeviceId() {
@@ -885,12 +888,12 @@
           this.form.batchNo = '';
           this.form.specification = null;
           this.form.formingNum = null;
-          this.form.produceTaskId = null;
-          this.form.produceTaskName = '';
           this.form.brandNo = '';
 
           this.produceTaskList = [];
         }
+        this.form.produceTaskId = null;
+        this.form.produceTaskName = '';
       },
       // 获取工序列表
       async getProductTaskList(id) {

+ 9 - 4
src/views/checklistManagement/components/checkDetails.vue

@@ -106,7 +106,7 @@
         <template v-slot:isPass="{ row }">
           <el-radio-group v-model="row.isPass">
             <el-radio :label="1">是</el-radio>
-            <el-radio :label="2">否</el-radio>
+            <el-radio :label="0">否</el-radio>
           </el-radio-group>
         </template>
         <template v-slot:remark="{ row }">
@@ -170,7 +170,7 @@
         <template v-slot:isPass="{ row }">
           <el-radio-group v-model="row.isPass">
             <el-radio :label="1">是</el-radio>
-            <el-radio :label="2">否</el-radio>
+            <el-radio :label="0">否</el-radio>
           </el-radio-group>
         </template>
         <template v-slot:remark="{ row }">
@@ -722,11 +722,16 @@
           console.log('规则齐套检查', data);
 
           // 把检查结果赋值给对应的明细
-          this.form.details.forEach((item) => {
+          this.form.details = this.form.details.map((item) => {
             const checkItem = data.find((d) => d.id === item.id);
+            console.log('checkItem 存在', checkItem);
             if (checkItem && item.isAutoCheck) {
-              item.isPass = checkItem.isPass;
+              return {
+                ...item,
+                isPass: checkItem.isPass
+              };
             }
+            return item;
           });
 
           console.log('规则齐套检查', this.form.details);

+ 1 - 1
src/views/checklistManagement/components/templateAdd.vue

@@ -251,7 +251,7 @@
         type="primary"
         @click="submit('edit')"
         :loading="buttonLoading"
-        >编 辑</el-button
+        >保 存</el-button
       >
 
       <el-button

+ 7 - 10
src/views/produce/components/prenatalExamination/materialModal.vue

@@ -158,8 +158,7 @@
         // 表格选中数据
         selection: [],
         taskPlanList: [],
-        workOrderId: '',
-        ruleId: '',
+        params: {},
         // 已选物料
         pickDetails: []
       };
@@ -189,8 +188,7 @@
       async datasource({ page, limit, where }) {
         const res = await queryPickAndFeedByWorkOrderId({
           ...where,
-          workOrderId: this.workOrderId,
-          ruleId: this.ruleId
+          ...this.params
           // pageNum: page,
           // size: limit
         });
@@ -205,13 +203,12 @@
         this.selection = [];
         this.visible = false;
       },
-      open(workOrderId, ruleId, pickDetails = []) {
-        this.workOrderId = workOrderId;
-        this.pickDetails = pickDetails;
-        this.ruleId = ruleId;
+      open(params = {}, pickDetails = []) {
+        this.params = params;
         this.$nextTick(() => {
-          // this.reload({ workOrderId });
-          this.queryAllProduceTaskList(workOrderId);
+          if (this.params.workOrderId) {
+            this.queryAllProduceTaskList(this.params.workOrderId);
+          }
         });
         this.visible = true;
       },

+ 93 - 35
src/views/produce/components/prenatalExamination/releaseRulesDialog.vue

@@ -49,11 +49,22 @@
               disabled
             ></el-input>
           </el-form-item>
-          <el-form-item v-else label="车间区域" prop="workshopArea">
-            <el-input
-              v-model="addForm.workshopArea"
-              placeholder="请输入"
-            ></el-input>
+          <el-form-item v-else label="车间区域">
+            <el-select
+              v-model="addForm.workshopAreaId"
+              placeholder="请选择车间区域"
+              filterable
+              clearable
+              style="width: 100%"
+              @change="workshopAreaIdChange"
+            >
+              <el-option
+                v-for="item in workshopAreaList"
+                :key="item.id"
+                :label="item.name"
+                :value="item.id"
+              />
+            </el-select>
           </el-form-item>
         </el-col>
       </el-row>
@@ -153,7 +164,7 @@
           </el-form-item>
         </el-col>
         <el-col :span="8">
-          <el-form-item label="检查有效期" required prop="checkValidity">
+          <el-form-item label="检查有效期">
             <el-input
               placeholder="请输入"
               v-model="addForm.checkValidity"
@@ -161,9 +172,9 @@
             >
               <template slot="append">
                 <div style="width: 40px; box-sizing: border-box">
-                  <el-form-item required prop="checkValidityUnit">
+                  <el-form-item>
                     <DictSelection
-                      dictName="检查有效期单位"
+                      dictName="单位"
                       clearable
                       v-model="addForm.checkValidityUnit"
                       placeholder="单位"
@@ -281,6 +292,20 @@
       cacheKey="mes-releaseRulesDialong-2510281408"
       :needPage="false"
     >
+      <template v-slot:toolkit>
+        <el-button
+          v-if="addForm.recordRulesClassify != 4"
+          type="primary"
+          @click="batchCheck"
+          >批量检查</el-button
+        >
+        <el-button
+          v-if="addForm.recordRulesClassify != 4"
+          type="primary"
+          @click="batchQualified"
+          >批量合格</el-button
+        >
+      </template>
       <template v-slot:paramValue="{ row }">
         <div v-if="addForm.recordRulesClassify == 4">
           {{ row.productName || row.name }}
@@ -347,7 +372,9 @@
       >
       <template v-slot:checkResult="{ row }">
         <div>
-          <el-radio-group v-model="row.checkResult">
+          <el-radio-group
+            v-model="row.checkResult"
+          >
             <el-radio :label="1">合格</el-radio>
             <el-radio :label="0">不合格</el-radio>
           </el-radio-group>
@@ -428,6 +455,7 @@
   import toolModal from '@/views/batchRecord/components/toolModal.vue';
   import { getTeam } from '@/api/produce/job.js';
   import materialModal from './materialModal.vue';
+  import { getFactoryarea } from '@/api/aps/index';
 
   export default {
     components: { SelectUser, toolModal, materialModal },
@@ -438,10 +466,24 @@
         default: 0
       }
     },
+    watch: {
+      'addForm.details': {
+        handler(details) {
+          const any = details.some((i) => i.checkResult === null);
+
+          if (any || details.length === 0) return;
+
+          const every = details.every((i) => i.checkResult == 1);
+          this.addForm.conclution = every ? 1 : 2;
+        },
+        deep: true
+      }
+    },
     data() {
       const formDate = {
         id: null,
         workshopArea: '',
+        workshopAreaId: null,
         checkFinishTime: '',
         checkStartTime: '',
         checkValidity: null,
@@ -539,22 +581,6 @@
             { required: true, message: '请选择结论', trigger: 'blur' },
             { required: true, message: '请选择结论', trigger: 'change' }
           ],
-          checkValidity: [
-            { required: true, message: '请输入检查有效期', trigger: 'blur' },
-            { required: true, message: '请输入检查有效期', trigger: 'change' }
-          ],
-          checkValidityUnit: [
-            {
-              required: true,
-              message: '请选择检查有效期单位',
-              trigger: 'blur'
-            },
-            {
-              required: true,
-              message: '请选择检查有效期单位',
-              trigger: 'change'
-            }
-          ],
           duration: [
             { required: true, message: '请输入工时', trigger: 'blur' },
             { required: true, message: '请输入工时', trigger: 'change' },
@@ -705,7 +731,8 @@
           }
         ],
         activeExecuteMethodTitle: '',
-        executeMethodTitleList: []
+        executeMethodTitleList: [],
+        workshopAreaList: []
       };
     },
     computed: {
@@ -805,6 +832,7 @@
       } else {
         this.getTeamList(this.$store.state.user.info.teamId);
       }
+      this.getWorkshopArea();
     },
     methods: {
       open(productionInfo, workOrderInfo) {
@@ -1059,6 +1087,7 @@
           this.butLoading = false;
           this.productionInfo.recordId == null;
           this.addForm.workshopArea = '';
+          this.addForm.workshopAreaId = null;
           this.addForm.checkFinishTime = null;
           this.addForm.checkStartTime = null;
           this.addForm.checkValidity = null;
@@ -1220,8 +1249,13 @@
       // 选择物料
       openMaterialModal() {
         this.$refs.materialModalRef.open(
-          this.addForm.workOrderId,
-          this.addForm.ruleId,
+          {
+            workOrderId: this.addForm.workOrderId,
+            ruleId: this.addForm.ruleId,
+            produceTaskInstanceId:
+              this.workOrderInfo.taskId ||
+              this.workOrderInfo.produceTaskInstanceId
+          },
           []
         );
       },
@@ -1273,16 +1307,40 @@
       noQualifiedQuantityMax(row) {
         return row.reportQuantity - row.qualifiedQuantity;
       },
-      // 结论修改-同步
-      conclutionChange() {
+      // 查询车间区域
+      async getWorkshopArea() {
+        const data = await getFactoryarea({
+          pageNum: 1,
+          size: 999,
+          type: 3
+        });
+        console.log('list', data.list);
+        this.workshopAreaList = data.list;
+      },
+      workshopAreaIdChange(e) {
+        const area = this.workshopAreaList.find((i) => i.id === e);
+        if (area) {
+          this.addForm.workshopArea = area.name;
+        } else {
+          this.addForm.workshopArea = '';
+        }
+      },
+      // 批量检查
+      batchCheck() {
         this.addForm.details = this.addForm.details.map((i) => {
-          if (!i.checkStatus) {
-            i.checkStatus = 1;
-          }
-          i.checkResult = this.addForm.conclution == 1 ? 1 : 0;
-
+          i.checkStatus = 1;
           return i;
         });
+      },
+      // 批量合格
+      batchQualified() {
+        this.addForm.details = this.addForm.details.map((i) => {
+          i.checkResult = 1;
+          return i;
+        });
+      },
+      conclutionChange() {
+        console.log('this.addForm.conclution', this.addForm.conclution);
       }
     }
   };