Przeglądaj źródła

优化记录方法显示并统一请样相关命名

yusheng 6 miesięcy temu
rodzic
commit
8ddd1aa944

+ 5 - 0
src/utils/util.js

@@ -63,3 +63,8 @@ export function generateRandomString(num = 5) {
   }
   return result;
 }
+
+export const recordingMethodList = [
+  { label: '按质检项检', value: 1 },
+  { label: '按样品检', value: 2 }
+];

+ 55 - 25
src/views/inspectionReport/index.vue

@@ -46,14 +46,20 @@
           <el-link
             type="primary"
             :underline="false"
-            v-if="(row.reportApprovalStatus == 0 || row.reportApprovalStatus == 3) && $hasPermission('qms:inspectionReport:update')"
+            v-if="
+              (row.reportApprovalStatus == 0 ||
+                row.reportApprovalStatus == 3) &&
+              $hasPermission('qms:inspectionReport:update')
+            "
             @click="openEdit(row)"
             >编辑</el-link
           >
           <el-link
             v-if="
               isReportApproval == 1 &&
-              (row.reportApprovalStatus == 0 || row.reportApprovalStatus == 3) && $hasPermission('qms:inspectionReport:submit')
+              (row.reportApprovalStatus == 0 ||
+                row.reportApprovalStatus == 3) &&
+              $hasPermission('qms:inspectionReport:submit')
             "
             type="primary"
             :underline="false"
@@ -65,7 +71,11 @@
             class="ele-action"
             title="确定要删除吗?"
             @confirm="deleteReportBtn(row)"
-            v-if="(row.reportApprovalStatus == 0 || row.reportApprovalStatus == 3) && $hasPermission('qms:inspectionReport:delete')"
+            v-if="
+              (row.reportApprovalStatus == 0 ||
+                row.reportApprovalStatus == 3) &&
+              $hasPermission('qms:inspectionReport:delete')
+            "
           >
             <template v-slot:reference>
               <el-link type="danger" :underline="false"> 删除 </el-link>
@@ -105,9 +115,7 @@
   import search from './components/search.vue';
   import jimureportBrowse from '@/components/jimureport/browseModal.vue';
   import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
-  import {
-    closeWorkList,
-  } from '@/api/inspectionWork';
+  import { closeWorkList } from '@/api/inspectionWork';
   import { queryTodo } from '@/api/bpm/task';
   import dictMixins from '@/mixins/dictMixins';
   import { getFile } from '@/api/system/file';
@@ -117,6 +125,7 @@
   import { getList, deleteReport } from '@/api/inspectionReport';
   import inspection_report1 from '../inspectionReport/template/inspection_report1.vue';
   import QualityReportDetail from '../inspectionReport/components/detailDialog.vue';
+  import { recordingMethodList } from '@/utils/util.js';
 
   export default {
     mixins: [dictMixins, tabMixins],
@@ -169,7 +178,7 @@
             // slot: 'code',
             align: 'center',
             width: 180,
-            showOverflowTooltip: true,
+            showOverflowTooltip: true
           },
 
           {
@@ -198,6 +207,20 @@
             align: 'center',
             showOverflowTooltip: true
           },
+          {
+            prop: 'recordingMethod',
+            label: '记录方法',
+            align: 'center',
+            formatter: (row) => {
+              return (
+                recordingMethodList.find(
+                  (item) => item.value == row.recordingMethod
+                )?.label || ''
+              );
+            },
+            width: 130,
+            showOverflowTooltip: true
+          },
           {
             label: '创建时间',
             prop: 'reportDate',
@@ -242,7 +265,7 @@
                 default:
                   return '';
               }
-            },
+            }
           },
           {
             columnKey: 'action',
@@ -262,11 +285,11 @@
         typeList: [], //类型列表
         qualityMode: [], //取样类型
         statusList: [
-            { value: 0, label: '未提交' },
-            { value: 1, label: '审核中' },
-            { value: 2, label: '已审核' },
-            { value: 3, label: '审核不通过' },
-            { value: 7, label: '作废' }
+          { value: 0, label: '未提交' },
+          { value: 1, label: '审核中' },
+          { value: 2, label: '已审核' },
+          { value: 3, label: '审核不通过' },
+          { value: 7, label: '作废' }
         ],
         addOpen: false,
         transferVisible: false,
@@ -335,6 +358,13 @@
             type: 'select',
             placeholder: '',
             planList: this.statusList
+          },
+          {
+            label: '记录方法:',
+            value: 'recordingMethod',
+            type: 'select',
+            placeholder: '',
+            planList: recordingMethodList
           }
         ];
       },
@@ -377,7 +407,7 @@
       reportApprovalSubmit(res) {
         this.processSubmitDialogFlag = true;
         this.$nextTick(async () => {
-          let params = {   
+          let params = {
             businessId: res.id,
             businessKey: 'qms_report_approval',
             formCreateUserId: res.createUserId,
@@ -426,11 +456,11 @@
       },
       async openEdit(row) {
         console.log(row);
-         this.isView = false;
+        this.isView = false;
         this.targetComponent = row.reportTemplateCode;
         this.currentRow = row;
         this.$nextTick(() => {
-          this.targetVisible = true;    
+          this.targetVisible = true;
         });
       },
       openDetails(row) {
@@ -440,24 +470,24 @@
         console.log('currentRow', this.currentRow, this.targetComponent);
         this.$nextTick(() => {
           this.targetVisible = true;
-            console.log('targetVisible~~~~', this.targetVisible);
+          console.log('targetVisible~~~~', this.targetVisible);
         });
       },
       async deleteReportBtn(row) {
-          try {
-            await deleteReport(row.id);
-            this.$message.success('删除成功');
-            this.done();
-          } catch (err) {
-            // this.$message.error('删除失败:' + (err.message || '操作异常'));
-          }
+        try {
+          await deleteReport(row.id);
+          this.$message.success('删除成功');
+          this.done();
+        } catch (err) {
+          // this.$message.error('删除失败:' + (err.message || '操作异常'));
+        }
       },
       downloadFile(file) {
         getFile({ objectName: file.storePath }, file.name);
       },
       done() {
         this.$refs.search.search();
-      },
+      }
     }
   };
 </script>

+ 7 - 1
src/views/inspectionWork/details.vue

@@ -205,7 +205,11 @@
                 <el-form-item label="记录方法:" prop="recordingMethod">
                   <el-input
                     disabled
-                    :value="form.recordingMethod == 1 ? '批样' : '单样全部'"
+                    :value="
+                      recordingMethodList.find(
+                        (item) => item.value == form.recordingMethod
+                      )?.label
+                    "
                   />
                 </el-form-item>
               </el-col>
@@ -338,6 +342,7 @@
   import detailMixins from './mixins/detailMixins';
   import { parameterGetByCode } from '@/api/main/index';
   import { getUserPage } from '@/api/system/organization';
+  import { recordingMethodList } from '@/utils/util.js';
   import sampleListDialog from './components/sampleListDialog.vue';
 
   export default {
@@ -347,6 +352,7 @@
       return {
         activeName: '1',
         inspectionName: '1',
+        recordingMethodList,
         sourceData1: [],
         sourceData2: [],
         sourceData3: [],

+ 37 - 3
src/views/inspectionWork/edit.vue

@@ -129,10 +129,14 @@
             </el-form-item>
           </el-col>
           <el-col :span="6">
-            <el-form-item label="记录方法:" prop="samplesType">
+            <el-form-item label="记录方法:" prop="recordingMethod">
               <el-input
                 disabled
-                :value="form.recordingMethod == 1 ? '批样' : '单样全部'"
+                :value="
+                  recordingMethodList.find(
+                    (item) => item.value == form.recordingMethod
+                  )?.label
+                "
               />
             </el-form-item>
           </el-col>
@@ -244,6 +248,7 @@
   // import QualityContentTabs from './components/QualityContentTabs.vue';
   import QualityContentTabs from './components/newQualityContentTabs.vue';
   import pickOrderList from './components/pickOrderList/index.vue'; //领料记录
+  import { recordingMethodList } from '@/utils/util.js';
 
   import { getCode, getCodeList } from '@/api/login';
   import {
@@ -366,6 +371,7 @@
         };
       };
       return {
+        recordingMethodList,
         activeComp: 'main',
         tabOptions: [
           { key: 'main', name: '报工' },
@@ -1013,9 +1019,17 @@
       },
       async getDetail() {
         getById(this.$route.query.id).then((res) => {
+          if (res.data.jobList?.length == 1) {
+            res.data.executeJobId = res.data.jobList[0].id;
+            res.data.executeJobName = res.data.jobList[0].name;
+            this.execute = res.data.jobList[0].userVOList;
+          }
           this.form = res.data;
 
           console.log(this.form, 'this.form');
+          this.form.executeUserIdList = this.form.executeUserId
+            ? this.form.executeUserId.split(',')
+            : [];
 
           this.form.qualityIdList = this.form.qualityId
             ? this.form.qualityId.split(',')
@@ -1409,6 +1423,8 @@
 
           delete this.form['qualityTimeEnd'];
 
+          this.form.executeUserId = '';
+          this.form.executeUserName = '';
           let params = {
             ...this.form,
             sampleList: this.sampleList,
@@ -1549,7 +1565,7 @@
         this.$refs.baseInfoRefs.$refs.form1.validate((valid) => {
           if (!valid) return false;
           //单样全部
-          console.log(this.form.recordingMethod,'this.form.recordingMethod')
+          console.log(this.form.recordingMethod, 'this.form.recordingMethod');
           if (this.form.recordingMethod == 2) {
             if (this.qualityType == 2 && this.isReportProcessProduce) {
               for (let i = 0; i < this.sampleList.length; i++) {
@@ -1591,6 +1607,24 @@
           this.form.qualityTimeEnd = this.getNowTime();
           this.form.qualityTimeStart = this.qualityTimeStart;
           this.form.qualityId = this.form.qualityIdList.join(',');
+          if (
+            !this.form.executeUserIdList.find(
+              (item) => item == this.$store.state.user.info.userId
+            )
+          ) {
+            this.form.executeUserIdList.push(
+              this.$store.state.user.info.userId
+            );
+            this.form.executeUserName =
+              this.form.executeUserIdList.length > 1
+                ? this.form.executeUserName +
+                  ',' +
+                  this.$store.state.user.info.userName
+                : this.$store.state.user.info.userName;
+          }
+          this.form.executeUserId = this.form.executeUserIdList.join(',');
+
+          // this.form.qualityIdList = [];
 
           let params = {
             ...this.form,

+ 26 - 3
src/views/inspectionWork/index.vue

@@ -86,7 +86,7 @@
               ![1, 2].includes(row.status) &&
               row.sampleQuantity < row.total
             "
-            >样</el-link
+            >样</el-link
           >
           <el-link
             type="primary"
@@ -221,6 +221,7 @@
                 )?.type
               "
               effect="dark"
+              style="margin-top: 4px"
             >
               <span
                 :title="
@@ -304,6 +305,7 @@
   import { getQmsReportTemplatePageList } from '@/api/inspectionWork';
   import inspection_report1 from '../inspectionReport/template/inspection_report1.vue';
   import { inspectionProjectStatus } from '@/enum/dict.js';
+  import { recordingMethodList } from '@/utils/util.js';
 
   export default {
     mixins: [dictMixins, tabMixins],
@@ -494,6 +496,20 @@
             align: 'center',
             width: 160
           },
+          {
+            prop: 'recordingMethod',
+            label: '记录方法',
+            align: 'center',
+            formatter: (row) => {
+              return (
+                recordingMethodList.find(
+                  (item) => item.value == row.recordingMethod
+                )?.label || ''
+              );
+            },
+            width: 130,
+            showOverflowTooltip: true
+          },
           {
             label: '进度',
             prop: 'templateList',
@@ -516,7 +532,7 @@
                 case 2:
                   return '已关闭';
                 case 3:
-                  return '待样';
+                  return '待样';
                 default:
                   return '';
               }
@@ -637,6 +653,13 @@
             type: 'select',
             placeholder: '',
             planList: this.statusList
+          },
+          {
+            label: '记录方法:',
+            value: 'recordingMethod',
+            type: 'select',
+            placeholder: '',
+            planList: recordingMethodList
           }
         ];
       },
@@ -693,7 +716,7 @@
         }
         const is = await checkByQualityWorkOrderId(row.id);
         if (is) {
-          this.$message.warning('此工单存在未处理完的样记录,请检查!');
+          this.$message.warning('此工单存在未处理完的样记录,请检查!');
           return;
         }
         this.$refs.addSampleRef.open('add', row);

+ 24 - 48
src/views/sample/sampleRecord/components/addSample.vue

@@ -132,7 +132,7 @@
         :selection.sync="selection"
       >
         <template v-slot:toolbar>
-          累计样数量:{{ workSampleQuantity
+          累计样数量:{{ workSampleQuantity
           }}{{
             form.conditionType == '1' ? tableList[0]?.measureUnit : form.unit
           }}
@@ -148,31 +148,6 @@
             ></el-input>
           </el-form-item>
         </el-col>
-      </el-row>
-      <el-row>
-        <el-col :span="8">
-          <el-form-item label="请样数量:" prop="pleaseQuantity">
-            <el-input v-model="form.pleaseQuantity" placeholder="请输入">
-              <template slot="append">
-                {{ tableList[0]?.measureUnit }}
-              </template>
-            </el-input>
-          </el-form-item>
-        </el-col>
-        <!-- <el-col :span="4">
-          <el-form-item label="单位:" prop="pleaseUnit">
-            <DictSelection
-              dictName="计量单位"
-              clearable
-              v-model="form.pleaseUnit"
-              filter-placeholder="请输入计量单位搜索"
-              @change="changeSamUnit"
-            ></DictSelection>
-          </el-form-item>
-        </el-col> -->
-      </el-row>
-      <header-title title="取样信息"> </header-title>
-      <el-row>
         <el-col :span="8">
           <el-form-item label="质检方式:" prop="qualityMode">
             <DictSelection
@@ -192,7 +167,7 @@
               :disabled="form.isFirstSampling != '1'"
             >
               <el-option
-                v-for="item in sampleQuantityList"
+                v-for="item in recordingMethodList"
                 :label="item.label"
                 :value="item.value"
                 :key="item.value"
@@ -201,9 +176,10 @@
           </el-form-item>
         </el-col>
       </el-row>
+
       <el-row v-if="form.qualityMode == '2'">
         <el-col :span="8">
-          <el-form-item label="取样:" prop="conditionType">
+          <el-form-item label="请样类型:" prop="conditionType">
             <el-select
               style="width: 100%"
               v-model="form.conditionType"
@@ -350,6 +326,8 @@
 
 <script>
   import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
+  import { recordingMethodList } from '@/utils/util.js';
+
   const defForm = {
     code: '', //编码
     name: '', //名称
@@ -390,11 +368,12 @@
     },
     data() {
       return {
+        recordingMethodList,
         processSubmitDialogFlag: false,
         form: { ...defForm },
         activeComp: 'main',
         tabOptions: [
-          { key: 'main', name: '样详情' },
+          { key: 'main', name: '样详情' },
           { key: 'bpm', name: '流程详情' }
         ],
         workSampleQuantity: 0,
@@ -411,7 +390,7 @@
             { required: true, message: '请选择记录方法', trigger: 'change' }
           ],
           conditionType: [
-            { required: true, message: '请选择样类型', trigger: 'change' }
+            { required: true, message: '请选择样类型', trigger: 'change' }
           ],
           quantity: [{ required: true, message: '请输入', trigger: 'change' }],
           portion: [{ required: true, message: '请输入', trigger: 'change' }],
@@ -420,13 +399,10 @@
             { required: true, message: '请选择', trigger: 'change' }
           ]
         },
-        sampleQuantityList: [
-          { label: '批样', value: 1 },
-          { label: '单样全部', value: 2 }
-        ],
+
         sampleNumberList: [
-          { label: '整样', value: 1 },
-          { label: '小样', value: 2 }
+          { label: '请整样', value: 1 },
+          { label: '请小样', value: 2 }
         ],
         selection: [],
         tableColumns1: [
@@ -651,7 +627,7 @@
         this.visible = true;
         this.type = type;
         this.title =
-          type == 'add' ? '取样' : type == 'edit' ? '修改取样' : '详情';
+          type == 'add' ? '请样' : type == 'edit' ? '修改请样' : '详情';
         if (type == 'add') {
           if (row) {
             this.init(row);
@@ -671,7 +647,7 @@
         if (list?.length) {
           this.getById(list[0].id);
           this.type = 'edit';
-          this.title = '修改样';
+          this.title = '修改样';
         } else {
           row.sourceCode = row.qualityPlanCode || row.workOrderCode;
           this.form = JSON.parse(JSON.stringify(row));
@@ -856,8 +832,8 @@
             }
           }
         } catch (error) {
-          console.error('样处理失败:', error);
-          this.$message.error('样处理失败');
+          console.error('样处理失败:', error);
+          this.$message.error('样处理失败');
         }
       },
       validateWeight(quantity, sampleCount) {
@@ -867,7 +843,7 @@
         });
 
         if (totalMaxPossible < sampleCount) {
-          this.$message.info(`最大样条数为${totalMaxPossible}`);
+          this.$message.info(`最大样条数为${totalMaxPossible}`);
           return false;
         }
 
@@ -879,7 +855,7 @@
         if (weightUnit === 'G') totalWeight /= 1000;
 
         if (quantity * sampleCount > totalWeight) {
-          this.$message.info('样计量重量不能大于总计量重量');
+          this.$message.info('样计量重量不能大于总计量重量');
           return false;
         }
 
@@ -890,7 +866,7 @@
         });
 
         if (invalidItem) {
-          this.$message.info('勾选条目重量小于样重量');
+          this.$message.info('勾选条目重量小于样重量');
           return false;
         }
 
@@ -899,7 +875,7 @@
 
       validateMeasureQuantity(quantity, unit, sampleCount) {
         if (quantity <= 0) {
-          this.$message.info('样计量数量必须大于0');
+          this.$message.info('样计量数量必须大于0');
           return false;
         }
 
@@ -911,7 +887,7 @@
           this.selection[0].measureUnit === unit &&
           quantity * sampleCount > totalQuantity
         ) {
-          this.$message.info('样计量数量不能大于总计量数量');
+          this.$message.info('样计量数量不能大于总计量数量');
           return false;
         }
 
@@ -919,7 +895,7 @@
           (item) => item.measureQuantity < quantity
         );
         if (invalidItem) {
-          this.$message.info('条目计量数量小于样计量数量');
+          this.$message.info('条目计量数量小于样计量数量');
           return false;
         }
         return true;
@@ -1153,7 +1129,7 @@
         }
         if (measureQuantityCount > formTotalS - this.workSampleQuantity) {
           this.$message.info(
-            `样数量不能大于${formTotalS - this.workSampleQuantity} ${
+            `样数量不能大于${formTotalS - this.workSampleQuantity} ${
               this.selection[0].measureUnit
             }`
           );
@@ -1291,7 +1267,7 @@
             formCreateUserId: res.createUserId,
             variables: {
               businessCode: res.code,
-              businessName: '样',
+              businessName: '样',
               businessType: res.conditionType == 1 ? '整样' : '小样'
             }
           };

+ 44 - 29
src/views/sample/sampleRecord/index.vue

@@ -40,7 +40,8 @@
             @click="addSampleOpen('edit', row)"
             v-if="
               [0, 3].includes(row.approvalStatus) &&
-              $hasPermission('qms:samplingrecord:update')&&row.status!='3'
+              $hasPermission('qms:samplingrecord:update') &&
+              row.status != '3'
             "
           >
             编辑
@@ -50,7 +51,8 @@
             :underline="false"
             v-if="
               [0, 3].includes(row.approvalStatus) &&
-              $hasPermission('qms:samplingrecord:update')&&row.status!='3'
+              $hasPermission('qms:samplingrecord:update') &&
+              row.status != '3'
             "
             @click="approvalSubmit(row)"
             >提交</el-link
@@ -58,7 +60,7 @@
           <el-popconfirm
             class="ele-action"
             title="确定要删除此信息吗?"
-            v-if="[0, 3].includes(row.approvalStatus)&&row.status!='3'"
+            v-if="[0, 3].includes(row.approvalStatus) && row.status != '3'"
             @confirm="listCancel(row.id)"
           >
             <template v-slot:reference>
@@ -91,6 +93,7 @@
   import { samplingRecordsPage, listCancel } from '@/api/samplingRecords';
   import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
   import { reviewStatus } from '@/enum/dict';
+  import { recordingMethodList } from '@/utils/util.js';
 
   export default {
     mixins: [dictMixins, tableColumnsMixin],
@@ -112,7 +115,7 @@
           },
           {
             prop: 'code',
-            label: '样记录编码',
+            label: '样记录编码',
             slot: 'code',
             align: 'center',
             minWidth: 150,
@@ -210,30 +213,24 @@
             minWidth: 110,
             showOverflowTooltip: true
           },
-          {
-            prop: 'pleasePurpose',
-            label: '请样目的',
-            align: 'center',
-            minWidth: 110,
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'pleaseQuantity',
-            label: '请样数量',
-            align: 'center',
-            minWidth: 110,
-            showOverflowTooltip: true
-          },
-          {
-            prop: 'pleaseUnit',
-            label: '单位',
-            align: 'center',
-            minWidth: 110,
-            showOverflowTooltip: true
-          },
+
+          // {
+          //   prop: 'pleaseQuantity',
+          //   label: '请样数量',
+          //   align: 'center',
+          //   minWidth: 110,
+          //   showOverflowTooltip: true
+          // },
+          // {
+          //   prop: 'pleaseUnit',
+          //   label: '单位',
+          //   align: 'center',
+          //   minWidth: 110,
+          //   showOverflowTooltip: true
+          // },
           {
             prop: 'conditionType',
-            label: '取样',
+            label: '请样类型',
             formatter: (row) => {
               return row.conditionType == 1 ? '整样' : '小样';
             },
@@ -246,14 +243,25 @@
             label: '记录方法',
             align: 'center',
             formatter: (row) => {
-              return row.recordingMethod == 1 ? '批样' : '单样全部';
+              return (
+                recordingMethodList.find(
+                  (item) => item.value == row.recordingMethod
+                )?.label || ''
+              );
             },
             minWidth: 110,
             showOverflowTooltip: true
           },
+          {
+            prop: 'pleasePurpose',
+            label: '请样目的',
+            align: 'center',
+            minWidth: 110,
+            showOverflowTooltip: true
+          },
           {
             prop: 'sampleQuantity',
-            label: '取样数量',
+            label: '样数量',
             align: 'center',
             minWidth: 110,
             showOverflowTooltip: true
@@ -275,7 +283,7 @@
               return _row.status == 1
                 ? '审核中'
                 : _row.status == 2
-                ? '已样'
+                ? '已样'
                 : _row.status == 3
                 ? '已作废'
                 : _row.status == 4
@@ -355,6 +363,13 @@
             type: 'DictSelection',
             dictName: '质检计划类型',
             placeholder: '请输入'
+          },
+          {
+            label: '记录方法:',
+            value: 'recordingMethod',
+            type: 'select',
+            placeholder: '',
+            planList: recordingMethodList
           }
         ];
       }