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

+ 27 - 11
src/views/inspectionWork/components/baseInfo.vue

@@ -119,14 +119,15 @@
           </el-form-item>
           </el-form-item>
         </el-col>
         </el-col>
         <el-col :span="6">
         <el-col :span="6">
-          <el-form-item label="质检人" prop="qualityId">
+          <el-form-item label="质检人" prop="qualityIdList">
             <el-select
             <el-select
               :disabled="btnType == 'detail'"
               :disabled="btnType == 'detail'"
-              v-model="form.qualityId"
+              v-model="form.qualityIdList"
               @change="changeExecutor"
               @change="changeExecutor"
               size="small"
               size="small"
               style="width: 100%"
               style="width: 100%"
               filterable
               filterable
+              multiple
             >
             >
               <el-option
               <el-option
                 v-for="item in executorList"
                 v-for="item in executorList"
@@ -139,14 +140,23 @@
         </el-col>
         </el-col>
         <el-col :span="6">
         <el-col :span="6">
           <el-form-item label="质检时间:" prop="qualityTime">
           <el-form-item label="质检时间:" prop="qualityTime">
-            <el-date-picker
+            <!-- <el-date-picker
               class="w100"
               class="w100"
               v-model="form.qualityTime"
               v-model="form.qualityTime"
               type="date"
               type="date"
               value-format="yyyy-MM-dd"
               value-format="yyyy-MM-dd"
               :disabled="btnType == 'detail'"
               :disabled="btnType == 'detail'"
               placeholder="请选择"
               placeholder="请选择"
-            ></el-date-picker>
+            ></el-date-picker> -->
+            <el-date-picker
+              v-model="form.qualityTime"
+              class="w100"
+              type="datetime"
+              value-format="yyyy-MM-dd HH:mm:ss"
+              :disabled="btnType == 'detail'"
+              placeholder="选择日期"
+            >
+            </el-date-picker>
           </el-form-item>
           </el-form-item>
         </el-col>
         </el-col>
         <el-col :span="6">
         <el-col :span="6">
@@ -469,7 +479,10 @@
           groupId: [
           groupId: [
             { required: true, message: '请选择质检部门', trigger: 'change' }
             { required: true, message: '请选择质检部门', trigger: 'change' }
           ],
           ],
-          qualityId: [
+          // qualityId: [
+          //   { required: true, message: '请选择质检人', trigger: 'change' }
+          // ],
+          qualityIdList: [
             { required: true, message: '请选择质检人', trigger: 'change' }
             { required: true, message: '请选择质检人', trigger: 'change' }
           ],
           ],
           qualityResults: [{ required: true, message: '', trigger: 'change' }],
           qualityResults: [{ required: true, message: '', trigger: 'change' }],
@@ -487,6 +500,7 @@
     created() {
     created() {
       this.getDictListIqoCode('measurement_type');
       this.getDictListIqoCode('measurement_type');
       this.getQualityModeList('quality_method_code');
       this.getQualityModeList('quality_method_code');
+
       // 是否展示合格不合格
       // 是否展示合格不合格
       this.getCode();
       this.getCode();
     },
     },
@@ -624,12 +638,14 @@
       },
       },
       // 人员选择
       // 人员选择
       changeExecutor(val) {
       changeExecutor(val) {
-        if (val) {
-          this.form.qualityId = val;
-          this.form.qualityName = this.executorList.filter(
-            (item) => item.id === val
-          )[0].name;
-        }
+        this.$set(this.form, 'qualityIdList', val);
+        this.$forceUpdate();
+        // if (val) {
+        //   this.form.qualityId = val;
+        //   this.form.qualityName = this.executorList.filter(
+        //     (item) => item.id === val
+        //   )[0].name;
+        // }
       },
       },
       inputTotal(val) {
       inputTotal(val) {
         if (val) {
         if (val) {

+ 27 - 3
src/views/inspectionWork/components/sampleListDialog.vue

@@ -106,6 +106,8 @@
                   />
                   />
                 </template>
                 </template>
               </el-table-column>
               </el-table-column>
+
+              <!-- @blur="(e) => inputResultContent(e, scope.row)" -->
               <el-table-column
               <el-table-column
                 label="质检内容"
                 label="质检内容"
                 prop="qualityResultContent"
                 prop="qualityResultContent"
@@ -116,10 +118,12 @@
                 <template slot-scope="scope">
                 <template slot-scope="scope">
                   <el-input
                   <el-input
                     :class="scope.row.qualityResults === 2 ? 'warn' : ''"
                     :class="scope.row.qualityResults === 2 ? 'warn' : ''"
-                    @blur="(e) => inputResultContent(e, scope.row)"
                     v-model="scope.row.qualityResultContent"
                     v-model="scope.row.qualityResultContent"
                     placeholder="请输入内容"
                     placeholder="请输入内容"
                     :disabled="type == 'detail'"
                     :disabled="type == 'detail'"
+                    @input="
+                      handleInput(scope.row, scope.row.qualityResultContent)
+                    "
                   ></el-input>
                   ></el-input>
                 </template>
                 </template>
               </el-table-column>
               </el-table-column>
@@ -359,7 +363,7 @@
       },
       },
       // 数学判断
       // 数学判断
       mathematicalJudgment(row) {
       mathematicalJudgment(row) {
-        console.log('进来没有',row);
+        console.log('进来没有', row);
         let symbol = row.symbol?.trim(); // 符号
         let symbol = row.symbol?.trim(); // 符号
         let Ivalue = Number(row.qualityResultContent); // 输入的值
         let Ivalue = Number(row.qualityResultContent); // 输入的值
         let Dvalue = Number(row.defaultValue); // 判断的值
         let Dvalue = Number(row.defaultValue); // 判断的值
@@ -391,7 +395,7 @@
         }
         }
 
 
         if (symbol == '≈' || symbol == '=') {
         if (symbol == '≈' || symbol == '=') {
-          console.log('进来等于号')
+          console.log('进来等于号');
           if (Ivalue == Dvalue) {
           if (Ivalue == Dvalue) {
             return 1;
             return 1;
           } else {
           } else {
@@ -424,6 +428,26 @@
 
 
         return 2;
         return 2;
       },
       },
+
+      handleInput(item, value) {
+        console.log(item, value, 'item item item');
+        if (item.defaultValue) {
+          const number = Number(item.defaultValue);
+
+          if (isNaN(number)) return;
+
+          const valueNumber = Number(value);
+
+          if (isNaN(valueNumber)) return;
+
+          if (valueNumber > number) {
+            item.qualityResults = 2;
+          } else {
+            item.qualityResults = 1;
+          }
+        }
+      },
+
       handleClose() {
       handleClose() {
         this.visible = false;
         this.visible = false;
       },
       },

+ 35 - 5
src/views/inspectionWork/details.vue

@@ -161,10 +161,11 @@
 
 
 <script>
 <script>
   import { getDetailById } from '@/api/inspectionWork/index';
   import { getDetailById } from '@/api/inspectionWork/index';
-  import { planDetails } from '@/api/inspectionPlan/index'
+  import { planDetails } from '@/api/inspectionPlan/index';
   import { getByCode } from '@/api/system/dictionary-data';
   import { getByCode } from '@/api/system/dictionary-data';
   import detailMixins from './mixins/detailMixins';
   import detailMixins from './mixins/detailMixins';
-    import { parameterGetByCode } from '@/api/main/index';
+  import { parameterGetByCode } from '@/api/main/index';
+  import { getUserPage } from '@/api/system/organization';
   export default {
   export default {
     mixins: [detailMixins],
     mixins: [detailMixins],
     data() {
     data() {
@@ -178,7 +179,8 @@
         sourceData5: [],
         sourceData5: [],
         disposeTypeList: [],
         disposeTypeList: [],
         form: {},
         form: {},
-        showArrange:'0'
+        showArrange: '0',
+        executorList: []
       };
       };
     },
     },
     computed: {
     computed: {
@@ -211,14 +213,42 @@
           }
           }
         });
         });
       },
       },
+
+      async getUserList(params) {
+        try {
+          let data = { pageNum: 1, size: -1 };
+          // 如果传了参数就是获取巡点检人员数据
+          if (params) {
+            data = Object.assign(data, params);
+          }
+          const res = await getUserPage(data);
+          console.log(res, 'resres');
+          this.executorList = res.list;
+        } catch (error) {}
+      },
+
       async getData() {
       async getData() {
         let id = this.$route.query.id;
         let id = this.$route.query.id;
         let name = this.$route.query.name;
         let name = this.$route.query.name;
         try {
         try {
           const api = name == '计划' ? planDetails : getDetailById;
           const api = name == '计划' ? planDetails : getDetailById;
           const result = await api(id);
           const result = await api(id);
-          console.log(result,'result')
+          console.log(result, 'result');
+          await this.getUserList({ groupId: result.data.groupId });
           const res = result.data;
           const res = result.data;
+          const qualityName = [];
+          if (res.qualityId && this.executorList.length != 0) {
+            res.qualityId.split(',').forEach((item) => {
+              this.executorList.forEach((el) => {
+                if (el.id == item) {
+                  qualityName.push(el.name);
+                }
+              });
+            });
+          }
+          if (qualityName.length != 0) {
+            res.qualityName = qualityName.join(',');
+          }
           let obj = {};
           let obj = {};
           this.infoList.map((item) => {
           this.infoList.map((item) => {
             obj[item.prop] = res[item.prop];
             obj[item.prop] = res[item.prop];
@@ -227,7 +257,7 @@
           this.fieldAssign(res, obj);
           this.fieldAssign(res, obj);
           this.sampleInfo(res);
           this.sampleInfo(res);
         } catch (err) {
         } catch (err) {
-          console.log(err,'err')
+          console.log(err, 'err');
         }
         }
       },
       },
       sampleInfo(res) {
       sampleInfo(res) {

+ 9 - 1
src/views/inspectionWork/edit.vue

@@ -207,6 +207,7 @@
           qualityTimeStart: '',
           qualityTimeStart: '',
           qualityTimeEnd: '',
           qualityTimeEnd: '',
           templateList: [],
           templateList: [],
+          qualityIdList: [],
           sampleMeasureUnit: '',
           sampleMeasureUnit: '',
           conditionType: null
           conditionType: null
         };
         };
@@ -292,7 +293,7 @@
     methods: {
     methods: {
       //
       //
       calculate(list) {
       calculate(list) {
-        console.log('执行了没')
+        console.log('执行了没');
         if (list.length == 0) {
         if (list.length == 0) {
           this.form.sampleQuantity = 0;
           this.form.sampleQuantity = 0;
           this.form.sampleWeight = 0;
           this.form.sampleWeight = 0;
@@ -734,6 +735,12 @@
       async getDetail() {
       async getDetail() {
         getById(this.$route.query.id).then((res) => {
         getById(this.$route.query.id).then((res) => {
           this.form = res.data;
           this.form = res.data;
+
+          console.log(this.form, 'this.form');
+
+          this.form.qualityIdList = this.form.qualityId
+            ? this.form.qualityId.split(',')
+            : [];
           this.productId = res.data.productId || '';
           this.productId = res.data.productId || '';
           this.statusType = this.form.status == 1 ? true : false;
           this.statusType = this.form.status == 1 ? true : false;
 
 
@@ -1252,6 +1259,7 @@
 
 
           this.form.qualityTimeEnd = this.getNowTime();
           this.form.qualityTimeEnd = this.getNowTime();
           this.form.qualityTimeStart = this.qualityTimeStart;
           this.form.qualityTimeStart = this.qualityTimeStart;
+          this.form.qualityId = this.form.qualityIdList.join(',');
 
 
           // if (this.form.qualityMode == 1) {
           // if (this.form.qualityMode == 1) {
           //   this.form.qualityResults = '';
           //   this.form.qualityResults = '';