ソースを参照

同步质检代码

695593266@qq.com 7 ヶ月 前
コミット
37801c4c3e

+ 11 - 1
src/api/inspectionWork/index.js

@@ -151,4 +151,14 @@ export async function closeWork(data) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
-}
+}
+
+export async function checkByQualityWorkOrderId(qualityWorkOrderId) {
+  const res = await request.get(
+    `/qms/samplingrecord/checkByQualityWorkOrderId/` + qualityWorkOrderId
+  );
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 46 - 0
src/api/samplingRecords/index.js

@@ -0,0 +1,46 @@
+// 抽样记录
+import request from '@/utils/request';
+
+// 分页api /qms/samplingRecord/page
+export async function samplingRecordsPage(params) {
+  const res = await request.get(`/qms/samplingrecord/page`, {
+    params
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+//取样新建/修改
+export async function samplingrecordSave(data) {
+  const res = await request.post(`/qms/samplingrecord/save`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+//取样新建/修改
+export async function samplingrecordUpdate(data) {
+  const res = await request.put(`/qms/samplingrecord/update`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+//详情
+export async function getById(id) {
+  const res = await request.get(`/qms/samplingrecord/getById/` + id);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+//作废
+export async function listCancel(data) {
+  const res = await request.put(`/qms/samplingrecord/cancel`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 482 - 152
src/views/produce/components/workPlan/components/addSample.vue

@@ -1,34 +1,65 @@
 <template>
   <ele-modal
     :visible.sync="visible"
-    title="取样"
+    :title="title"
     width="80%"
     append-to-body
     :maxable="true"
+    @close="cancel"
   >
+    <div class="switch" v-if="type == 'view'">
+      <div class="switch_left">
+        <ul>
+          <li
+            v-for="item in tabOptions"
+            :key="item.key"
+            :class="{ active: activeComp == item.key }"
+            @click="activeComp = item.key"
+          >
+            {{ item.name }}
+          </li>
+        </ul>
+      </div>
+    </div>
     <el-form
+      v-show="activeComp === 'main'"
       ref="form"
       :model="form"
       :rules="rules"
       label-width="120px"
       class="el-form-box"
+      :disabled="type == 'view'"
     >
       <header-title title="基本信息"></header-title>
       <el-row>
         <el-col :span="8">
-          <el-form-item label="质检工单编码:" prop="code">
-            <el-input disabled v-model="form.code" placeholder=" " />
+          <el-form-item label="质检工单编码:" prop="qualityWorkOrderCode">
+            <el-input
+              :disabled="!isSampleRecord || (isSampleRecord && type != 'add')"
+              readonly
+              v-model="form.qualityWorkOrderCode"
+              placeholder=" "
+              @click.native="$refs.inspectionWorkDialog.open()"
+            />
           </el-form-item>
         </el-col>
         <el-col :span="8">
-          <el-form-item label="质检工单名称:" prop="name">
-            <el-input disabled v-model="form.name" placeholder=" " />
+          <el-form-item label="质检工单名称:" prop="qualityWorkOrderName">
+            <el-input
+              disabled
+              v-model="form.qualityWorkOrderName"
+              placeholder=" "
+            />
           </el-form-item>
         </el-col>
 
         <el-col :span="8">
           <el-form-item label="来源单号:" prop="sourceCode">
-            <el-input disabled v-model="form.sourceCode" placeholder=" " />
+            <el-input
+              disabled
+              :value="form.qualityWorkOrderCode"
+              placeholder=" "
+            />
           </el-form-item>
         </el-col>
         <el-col :span="8">
@@ -70,37 +101,73 @@
             <el-input disabled v-model="form.brandNo" placeholder=" " />
           </el-form-item>
         </el-col>
+        <el-col :span="8">
+          <el-form-item label="总数:" prop="total">
+            <el-input disabled v-model="form.total" placeholder=" ">
+              <template slot="append">
+                {{ tableList[0]?.measureUnit }}
+              </template>
+            </el-input>
+          </el-form-item>
+        </el-col>
+        <!-- <el-col :span="8">
+          <el-form-item label="样品数:" prop="sampleQuantity">
+            <el-input disabled v-model="form.sampleQuantity" placeholder=" ">
+              <template slot="append">
+                {{ form.qualityMode == 1 ? form.measureUnit : form.unit }}
+              </template>
+            </el-input>
+          </el-form-item>
+        </el-col> -->
       </el-row>
       <header-title title="来源清单"></header-title>
       <ele-pro-table
         ref="sourceTable"
         :columns="tableColumns"
-        :datasource="datasource"
+        :datasource="tableList"
         :initLoad="false"
         :needPage="false"
-        height="400px"
+        height="300px"
         full-height="calc(100vh - 120px)"
         :selection.sync="selection"
-      ></ele-pro-table>
-      <header-title title="取样信息"> </header-title>
+      >
+        <template v-slot:toolbar>
+          累计请样数量:{{ workSampleQuantity
+          }}{{
+            form.conditionType == '1' ? tableList[0]?.measureUnit : form.unit
+          }}
+        </template>
+      </ele-pro-table>
+      <header-title title="请样信息"> </header-title>
       <el-row>
+        <el-col :span="8">
+          <el-form-item label="请样目的:" prop="pleasePurpose">
+            <el-input
+              v-model="form.pleasePurpose"
+              placeholder="请输入"
+            ></el-input>
+          </el-form-item>
+        </el-col>
         <el-col :span="8">
           <el-form-item label="质检方式:" prop="qualityMode">
             <DictSelection
               dictName="取样类型"
               v-model="form.qualityMode"
+              @change="handleQualityModeChange"
+              :disabled="form.isFirstSampling != '1'"
             ></DictSelection>
           </el-form-item>
         </el-col>
         <el-col :span="8">
-          <el-form-item label="检验方法:" prop="sampleQuantity">
+          <el-form-item label="记录方法:" prop="recordingMethod">
             <el-select
               style="width: 100%"
-              v-model="form.sampleQuantity"
+              v-model="form.recordingMethod"
               placeholder="请选择"
+              :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"
@@ -109,13 +176,15 @@
           </el-form-item>
         </el-col>
       </el-row>
+
       <el-row v-if="form.qualityMode == '2'">
         <el-col :span="8">
-          <el-form-item label="取样:" prop="sampleNumber">
+          <el-form-item label="请样类型:" prop="conditionType">
             <el-select
               style="width: 100%"
               v-model="form.conditionType"
               placeholder="请选择"
+              :disabled="form.isFirstSampling != '1'"
             >
               <el-option
                 v-for="item in sampleNumberList"
@@ -129,21 +198,21 @@
         <el-col :span="16">
           <el-row>
             <el-col :span="6" v-if="form.conditionType == 2">
-              <el-form-item prop="measureQ">
+              <el-form-item prop="quantity">
                 <el-input
-                  v-model="form.measureQ"
+                  v-model="form.quantity"
                   placeholder="请输入"
                 ></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="6" v-if="form.conditionType == 2">
-              <el-form-item prop="sampleUnit" label-width="0">
+              <el-form-item prop="unit" label-width="0">
                 <DictSelection
                   dictName="计量单位"
                   clearable
-                  v-model="form.sampleUnit"
+                  :disabled="form.isFirstSampling != '1'"
+                  v-model="form.unit"
                   filter-placeholder="请输入计量单位搜索"
-                  @change="changeSamUnit"
                 ></DictSelection>
               </el-form-item>
             </el-col>
@@ -165,12 +234,17 @@
             </el-col>
             <el-col :span="10" v-if="form.conditionType == 1">
               <el-form-item prop="packingUnit" label="单位">
-                <el-select v-model="form.packingUnit" placeholder="请选择">
+                <el-select
+                  v-model="form.packingUnit"
+                  placeholder="请选择"
+                  :disabled="form.isFirstSampling != '1'"
+                >
                   <el-option
                     v-for="item in packingSpecificationOption"
                     :key="item.id"
                     :label="item.conversionUnit"
                     :value="item.id"
+                    @click.native="handlePackingUnitChange(item)"
                   >
                   </el-option>
                 </el-select>
@@ -179,7 +253,7 @@
             <el-col
               :span="4"
               style="text-align: right"
-              v-if="form.conditionType == 2"
+              v-if="form.conditionType == 2 && type != 'view'"
             >
               <el-button
                 type="primary"
@@ -192,7 +266,7 @@
             <el-col
               :span="4"
               style="text-align: right"
-              v-if="form.conditionType == 1"
+              v-if="form.conditionType == 1 && type != 'view'"
             >
               <el-button
                 type="primary"
@@ -215,63 +289,120 @@
         full-height="calc(100vh - 120px)"
       ></ele-pro-table>
     </el-form>
-
+    <bpmDetail
+      v-if="activeComp == 'bpm' && form.processInstanceId"
+      :id="form.processInstanceId"
+    ></bpmDetail>
     <template v-slot:footer>
-      <el-button type="primary" @click="save()" v-lodading="loading"
-        >确认</el-button
+      <el-button
+        type="primary"
+        @click="save()"
+        v-loading="loading"
+        v-if="type != 'view'"
+        >保存</el-button
+      >
+      <el-button
+        type="primary"
+        @click="save('submit')"
+        v-loading="loading"
+        v-if="type != 'view'"
+        >提交</el-button
       >
 
       <el-button @click="cancel">关闭</el-button>
     </template>
+    <inspectionWorkDialog
+      ref="inspectionWorkDialog"
+      @changeParent="changeParent"
+    ></inspectionWorkDialog>
+    <processSubmitDialog
+      :processSubmitDialogFlag.sync="processSubmitDialogFlag"
+      v-if="processSubmitDialogFlag"
+      ref="processSubmitDialogRef"
+      @reload="search"
+    ></processSubmitDialog>
   </ele-modal>
 </template>
 
 <script>
+  import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
+  import { recordingMethodList } from '@/utils/util.js';
+
   const defForm = {
     code: '', //编码
     name: '', //名称
     conditionType: '',
-    measureQ: '',
-    sampleUnit: '',
-    portion: ''
+    quantity: '',
+    unit: '',
+    portion: '',
+    qualityMode: '',
+    recordingMethod: 1,
+    pleaseQuantity: '',
+    pleasePurpose: '',
+    pleaseUnit: '',
+    sampleQuantity: '',
+    qualityWorkOrderId: '',
+    qualityWorkOrderCode: '',
+    qualityWorkOrderName: '',
+    isFirstSampling: ''
   };
   import {
     queryQualityInventory,
     queryQualityTempleContent
   } from '@/api/inspectionWork';
-  import { getCodeList } from '@/api/login';
+  import {
+    samplingrecordSave,
+    getById,
+    samplingrecordUpdate,
+    samplingRecordsPage
+  } from '@/api/samplingRecords';
+  import bpmDetail from '@/views/bpm/processInstance/detail.vue';
+  import inspectionWorkDialog from './inspectionWorkDialog.vue';
+  import { getCodeList, getCode } from '@/api/login';
   export default {
-    components: {},
+    components: { bpmDetail, inspectionWorkDialog, processSubmitDialog },
+    props: {
+      isSampleRecord: {
+        default: false
+      }
+    },
     data() {
       return {
+        recordingMethodList,
+        processSubmitDialogFlag: false,
         form: { ...defForm },
+        activeComp: 'main',
+        tabOptions: [
+          { key: 'main', name: '请样详情' },
+          { key: 'bpm', name: '流程详情' }
+        ],
+        workSampleQuantity: 0,
         visible: false,
         loading: false,
         rules: {
-          name: [
-            { required: true, message: '名称不能为空', trigger: 'change' }
-          ],
-          factoriesId: [
-            { required: true, message: '请选择工厂', trigger: 'change' }
+          qualityWorkOrderCode: [
+            { required: true, message: '请选择质检工单', trigger: 'change' }
           ],
-          bomId: [
-            { required: true, message: '请选择BOM版本', trigger: 'change' }
+          qualityMode: [
+            { required: true, message: '请选择质检方式', trigger: 'change' }
           ],
-          bomCategory: [
-            { required: true, message: '请选择BOM类型', trigger: 'change' }
+          recordingMethod: [
+            { required: true, message: '请选择记录方法', trigger: 'change' }
           ],
-          produceRoutingId: [
-            { required: true, message: '请选择工艺路线', trigger: 'change' }
+          conditionType: [
+            { required: true, message: '请选择请样类型', trigger: 'change' }
           ],
-          code: [{ required: true, message: '编码不能为空', trigger: 'change' }]
+          quantity: [{ required: true, message: '请输入', trigger: 'change' }],
+          portion: [{ required: true, message: '请输入', trigger: 'change' }],
+          unit: [{ required: true, message: '请选择', trigger: 'change' }],
+          packingUnit: [
+            { 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: [
@@ -478,49 +609,135 @@
         ],
         packingSpecificationOption: [],
         sampleList: [],
-        schemeList: []
+        schemeList: [],
+        tableList: [],
+        type: 'add',
+        title: ''
       };
     },
 
     computed: {},
     created() {},
     methods: {
-      async open(row) {
+      handlePackingUnitChange(val) {
+        this.$set(this.form, 'unit', val.conversionUnit);
+      },
+      async open(type, row) {
+        this.activeComp = 'main';
         this.visible = true;
-        row.sourceCode = row.qualityPlanCode || row.workOrderCode;
-        this.form = row;
-        this.queryQualityTempleContent();
-        this.$nextTick(() => {
-          this.$refs.sourceTable.reload({
-            page: 1,
-            where: { qualityWorkerId: row.id }
+        this.type = type;
+        this.title =
+          type == 'add' ? '请样' : type == 'edit' ? '修改请样' : '详情';
+        if (type == 'add') {
+          if (row) {
+            this.init(row);
+          }
+        } else {
+          this.getById(row.id);
+        }
+      },
+      async init(row) {
+        let data = await samplingRecordsPage({
+          qualityWorkOrderId: row.id
+        });
+        let list = data.list.filter(
+          (item) => item.status === 0 || item.status === 4
+        );
+        let list1 = data.list.filter((item) => item.status != 3);
+        if (list?.length) {
+          this.getById(list[0].id);
+          this.type = 'edit';
+          this.title = '修改请样';
+        } else {
+          row.sourceCode = row.qualityPlanCode || row.workOrderCode;
+          this.form = JSON.parse(JSON.stringify(row));
+          this.form.qualityWorkOrderId = row.id;
+          this.form.qualityWorkOrderCode = row.code;
+          this.form.qualityWorkOrderName = row.name;
+          this.workSampleQuantity = Number(row.sampleQuantity) || 0;
+
+          if (!list1?.length) {
+            this.form.isFirstSampling = 1;
+          } else {
+            this.$set(this.form, 'unit', list1[0].unit);
+          }
+          await this.datasource(list1[0]?.unit);
+          await this.queryQualityTempleContent(
+            !list1.length && row.qualityMode == 1
+          );
+        }
+      },
+      getById(id) {
+        getById(id).then((res) => {
+          this.workSampleQuantity =
+            Number(res.qualityWorkOrderVO.sampleQuantity) || 0;
+          [
+            'id',
+            'code',
+            'name',
+            'createTime',
+            'createUserId',
+            'status',
+            'approvalStatus',
+            'approvalUserId',
+            'sampleQuantity',
+            'processInstanceId'
+          ].forEach((it) => {
+            delete res.qualityWorkOrderVO[it];
           });
+          this.form = { ...res, ...res.qualityWorkOrderVO };
+          this.datasource(this.form.unit);
+          this.queryQualityTempleContent();
+          if (this.form.qualityMode == 2) {
+            if (res.qualityWorkOrderVO.conditionType == 1) {
+              // if (res.unit != res.qualitySampleList[0].measureUnit) {
+              //   this.$set(this.form, 'portion', res.qualitySampleList.length);
+              // } else {
+
+              // }
+              this.$set(this.form, 'portion', res.quantity);
+              this.$set(this.form, 'quantity', 0);
+            } else {
+              this.$set(this.form, 'portion', res.copies);
+              // this.$set(this.form, 'quantity', res.quantity / res.copies);
+            }
+          }
+
+          this.sampleList = res.qualitySampleList;
         });
       },
-      async queryQualityTempleContent() {
+      /* 查询质检模板内容 */
+      async queryQualityTempleContent(is) {
         const res = await queryQualityTempleContent({
-          qualityWorkerId: this.form.id,
+          qualityWorkerId: this.form.qualityWorkOrderId,
           page: 1,
           size: 10000
         });
         this.schemeList = res.list;
+        if (is) {
+          this.updatePackingList();
+        }
       },
       cancel() {
         this.form = {
           ...defForm
         };
         this.schemeList = [];
+        this.packingSpecificationOption = [];
+        this.sampleList = [];
+        this.tableList = [];
+
         this.visible = false;
       },
-      async datasource({ page, limit, where }) {
+      changeParent(row) {
+        this.init(row);
+      },
+      async datasource(unit) {
         const res = await queryQualityInventory({
-          ...where,
-          pageNum: page,
+          qualityWorkerId: this.form.qualityWorkOrderId,
+          pageNum: 1,
           size: -1
         });
-        if (res.list.length == 0) {
-          return res;
-        }
 
         let o = res.list[0];
         let listArr = [];
@@ -538,7 +755,14 @@
             id: '222'
           });
         }
-
+        if (unit) {
+          this.$set(
+            this.form,
+            'packingUnit',
+            listArr.find((item) => unit == item.conversionUnit)?.id
+          );
+        }
+        this.form.pleaseUnit = res.list[0]?.measureUnit;
         res.list.map((el) => {
           el.weightProportion = el.weight
             ? (el.weight / el.measureQuantity).toFixed(4)
@@ -546,6 +770,7 @@
           el.weightProportion = el.weightProportion - 0;
         });
         this.packingSpecificationOption = listArr;
+        this.tableList = res.list;
         return res;
       },
 
@@ -554,8 +779,8 @@
         // if (valid) {
         let params = {
           conditionType: this.form.conditionType,
-          measureQ: this.form.measureQ,
-          sampleUnit: this.form.sampleUnit,
+          quantity: this.form.quantity,
+          sampleUnit: this.form.unit,
           portion: this.form.portion
         };
         let specifications = this.packingSpecificationOption.find(
@@ -569,63 +794,56 @@
       async sampleFn(data, specifications) {
         this.sampleList = [];
         if (!this.selection || this.selection.length == 0) {
-          this.$message.warning('请先选择样品!');
+          this.$message.warning('请先选择来源清单!');
           return;
         }
-        const measureQ = data.measureQ || 1;
+        const quantity = data.quantity || 1;
         const unit = data.sampleUnit;
         const sampleCount = Number(data.portion);
         try {
-          if (
-            this.form.inspectionStandards === 1 ||
-            ([2, 3, 4, 5].includes(this.form.inspectionStandards) &&
-              this.form.conditionType == 2)
-          ) {
-            // 新增校验 数量  取整样 ***
-            if (this.form.conditionType == 1) {
-              let isFlag = this.validateSampleQuantity(
-                sampleCount,
-                specifications
-              );
-              if (!isFlag) return;
-            }
-            // ***
-            //抽检计量整样小样或者抽检计重小样
-            if (!this.validateMeasureQuantity(measureQ, unit, sampleCount))
+          // 2 取小样
+          if (this.form.conditionType == 2) {
+            if (!this.validateMeasureQuantity(quantity, unit, sampleCount))
               return; //取样数量验证
-            if (unit === 'KG' && !this.validateWeight(measureQ, sampleCount))
+            if (unit === 'KG' && !this.validateWeight(quantity, sampleCount))
               return; // 若计量单位为重量,还需验证总重量是否足够
             await this.getNewFullSampleList(
               Math.ceil(sampleCount),
               // sampleCount,
-              measureQ,
+              quantity,
               unit,
               specifications
             );
-            // 这里是取整样 非数量
-          } else if (
-            [2, 3, 4, 5].includes(this.form.inspectionStandards) &&
-            this.form.conditionType == 1
-          ) {
-            console.log('这里是取整样 吗');
-            //抽检取计重取整样
-            if (!this.validateSampleCount(sampleCount, specifications)) return;
-            await this.handleWeightFullSample(sampleCount, specifications);
+          } else {
+            let isFlag = this.validateSampleQuantity(
+              sampleCount,
+              specifications
+            );
+            if (!isFlag) return;
+            if (this.form.inspectionStandards == 1) {
+              await this.getNewFullSampleList(
+                Math.ceil(sampleCount),
+                quantity,
+                unit,
+                specifications
+              );
+            } else {
+              await this.handleWeightFullSample(sampleCount, specifications);
+            }
           }
         } catch (error) {
-          console.error('取样处理失败:', error);
-          this.$message.error('取样处理失败');
+          console.error('样处理失败:', error);
+          this.$message.error('样处理失败');
         }
       },
-      validateWeight(measureQ, sampleCount) {
+      validateWeight(quantity, sampleCount) {
         let totalMaxPossible = 0;
         this.selection.forEach((item) => {
-          totalMaxPossible += item.measureQuantity / measureQ;
+          totalMaxPossible += item.measureQuantity / quantity;
         });
 
         if (totalMaxPossible < sampleCount) {
-          // this.form.portion = totalMaxPossible;
-          this.$message.info(`最大取样条数为${totalMaxPossible}`);
+          this.$message.info(`最大请样条数为${totalMaxPossible}`);
           return false;
         }
 
@@ -636,76 +854,50 @@
         const weightUnit = this.selection[0].weightUnit;
         if (weightUnit === 'G') totalWeight /= 1000;
 
-        if (measureQ * sampleCount > totalWeight) {
-          this.$message.info('样计量重量不能大于总计量重量');
+        if (quantity * sampleCount > totalWeight) {
+          this.$message.info('样计量重量不能大于总计量重量');
           return false;
         }
 
         const invalidItem = this.selection.find((item) => {
           const weight =
             item.weightUnit === 'G' ? item.weight / 1000 : item.weight;
-          return weight < measureQ;
+          return weight < quantity;
         });
 
         if (invalidItem) {
-          this.$message.info('勾选条目重量小于样重量');
+          this.$message.info('勾选条目重量小于样重量');
           return false;
         }
 
         return true;
       },
 
-      validateMeasureQuantity(measureQ, unit, sampleCount) {
-        if (this.form.conditionType == 2 && measureQ <= 0) {
-          this.$message.info('样计量数量必须大于0');
+      validateMeasureQuantity(quantity, unit, sampleCount) {
+        if (quantity <= 0) {
+          this.$message.info('样计量数量必须大于0');
           return false;
         }
 
-        const totalQuantity = this.selection.reduce(
-          (sum, item) => sum + item.measureQuantity,
-          0
-        );
+        const totalQuantity =
+          this.selection.reduce((sum, item) => sum + item.measureQuantity, 0) -
+          this.workSampleQuantity;
+
         if (
-          (this.selection[0].measureUnit === unit ||
-            this.form.conditionType == 1) &&
-          measureQ * sampleCount > totalQuantity
+          this.selection[0].measureUnit === unit &&
+          quantity * sampleCount > totalQuantity
         ) {
-          this.$message.info('样计量数量不能大于总计量数量');
+          this.$message.info('样计量数量不能大于总计量数量');
           return false;
         }
 
         const invalidItem = this.selection.find(
-          (item) => item.measureQuantity < measureQ
+          (item) => item.measureQuantity < quantity
         );
         if (invalidItem) {
-          this.$message.info('条目计量数量小于样计量数量');
+          this.$message.info('条目计量数量小于样计量数量');
           return false;
         }
-
-        return true;
-      },
-
-      // 抽检取整样 校验
-      validateSampleCount(sampleCount, specifications) {
-        // 新增校验 ***
-        let isFlag = this.validateSampleQuantity(sampleCount, specifications);
-        if (!isFlag) {
-          return false;
-        }
-        // ***
-        const chooseNumber = this.selection.reduce((acc, pro) => {
-          return pro.measureQuantity ? acc + Number(pro.measureQuantity) : acc;
-        }, 0);
-        const invalidItem = chooseNumber < sampleCount;
-        // console.log(this.selection, 'this.selection');
-        // const invalidItem = this.selection.find(
-        //   (item) => item.measureQuantity < sampleCount
-        // );
-        if (invalidItem) {
-          this.$message.info('所选的条目计量数量小于取样计量数量');
-          return false;
-        }
-        // ***
         return true;
       },
 
@@ -730,7 +922,7 @@
             dataList.push({
               ...item,
               measureQuantity: 1, //作为计量数量
-              sampleCode: await this.getSampleCode(),
+              sampleCode: await getCode('sample_code'),
               qualitySampleTemplateList
             });
           } else {
@@ -738,7 +930,7 @@
               dataList.push({
                 ...item,
                 measureQuantity: currentNum1 > 1 ? 1 : currentNum1, //作为计量数量
-                sampleCode: await this.getSampleCode(),
+                sampleCode: await getCode('sample_code'),
                 qualitySampleTemplateList
               });
               currentNum1 -= 1;
@@ -771,6 +963,7 @@
         }
         // 更改
         this.sampleList = dataList;
+        this.getTotal();
       },
       // 小数点数据判断
       formatNumber(a, b, maxDecimals = 4) {
@@ -905,26 +1098,99 @@
         if (this.sampleList.length > sampleCount) {
           this.sampleList = this.sampleList.splice(0, sampleCount);
         }
+        this.getTotal();
       },
       // 当计量类型 是数量的时候 取整样 校验
       validateSampleQuantity(sampleCount, specifications) {
         let packingUnit = this.selection[0].packingUnit?.trim() || '';
         let totalS = 0;
+        let measureQuantityCount = 0;
         let labelKey =
           packingUnit == specifications.conversionUnit.trim()
             ? 'packingQuantity'
             : 'measureQuantity';
         let labelName = labelKey == 'packingQuantity' ? '包装数量' : '计量数量';
         totalS = this.selection.reduce((total, el) => total + el[labelKey], 0);
-
+        let formTotalS = this.tableList.reduce(
+          (total, el) => total + el.measureQuantity,
+          0
+        );
         if (sampleCount > totalS) {
           this.$message.info(
             `所填的条目数量不能超过所选${labelName}总和${totalS}`
           );
           return false;
         }
+        if (labelKey == 'packingQuantity') {
+          measureQuantityCount =
+            sampleCount * this.selection[0].measureQuantity;
+        } else {
+          measureQuantityCount = sampleCount;
+        }
+        if (measureQuantityCount > formTotalS - this.workSampleQuantity) {
+          this.$message.info(
+            `请样数量不能大于${formTotalS - this.workSampleQuantity} ${
+              this.selection[0].measureUnit
+            }`
+          );
+          return false;
+        }
         return true;
       },
+
+      handleQualityModeChange(val) {
+        if (val == 1) {
+          this.updatePackingList();
+        } else {
+          this.sampleList = [];
+          this.getTotal();
+        }
+      },
+      // 全检
+      async updatePackingList() {
+        let list = this.tableList;
+
+        let sampleCount = this.form.total;
+
+        const dataList = [];
+        let count = list ? list.length : 0;
+        console.log(count, 'count');
+        const codeList = await this.batchCodes(count);
+        for (const [index, item] of list.entries()) {
+          const qualitySampleTemplateList = item.qualitySampleTemplateList
+            ?.length
+            ? JSON.parse(JSON.stringify(item.qualitySampleTemplateList))
+            : JSON.parse(
+                JSON.stringify(
+                  this.schemeList.map((item) => {
+                    item['qualityResults'] = 1;
+                    return item;
+                  })
+                )
+              );
+
+          // if (sampleCount >= list.length) {
+          dataList.push({
+            ...item,
+            measureQuantity: item.measureQuantity, //作为计量数量
+            sampleCode: codeList[index],
+            qualitySampleTemplateList
+          });
+          // }
+        }
+        console.log(dataList, 'dataList');
+
+        this.sampleList = dataList;
+        this.getTotal();
+      },
+      getTotal() {
+        this.form.sampleQuantity = this.sampleList
+          .reduce((total, el) => total + Number(el.measureQuantity), 0)
+          .toFixed(2);
+        this.form.sampleWeight = this.sampleList
+          .reduce((total, el) => total + Number(el.weight), 0)
+          .toFixed(2);
+      },
       async batchCodes(count) {
         if (count <= 0) return;
         let params = { count };
@@ -932,21 +1198,85 @@
         return res;
       },
       /* 保存编辑 */
-      save() {
+      save(type) {
+        if (this.type == 'add') {
+          [
+            'id',
+            'code',
+            'name',
+            'createTime',
+            'createUserId',
+            'status',
+            'approvalStatus',
+            'approvalUserId'
+          ].forEach((key) => {
+            delete this.form[key];
+          });
+        }
+        let data = JSON.parse(JSON.stringify(this.form));
+
+        let api =
+          this.type == 'add' ? samplingrecordSave : samplingrecordUpdate;
         this.$refs.form.validate((valid) => {
           if (valid) {
+            if (!this.sampleList.length) {
+              this.$message.error('样品清单不能为空!');
+              return;
+            }
+            //抽检
+            if (data.qualityMode == 2) {
+              //取整样
+              if (data.conditionType == 1) {
+                data.quantity = data.portion;
+
+                data.measureUnit = this.tableList[0].measureUnit;
+              } else {
+                data.measureUnit = data.unit;
+                data.copies = data.portion;
+              }
+            }
             this.loading = true;
-            saveOrUpdate(this.form)
+
+            api({
+              ...data,
+              sampleList: this.sampleList
+            })
               .then((res) => {
                 this.$message.success('操作成功');
-                this.cancel();
-                this.$emit('done');
+
+                if (type == 'submit') {
+                  this.approvalSubmit(this.type == 'add' ? res : data.id);
+                } else {
+                  this.cancel();
+                  this.$emit('reload');
+                }
               })
               .finally(() => {
                 this.loading = false;
               });
           }
         });
+      },
+      async approvalSubmit(id) {
+        const res = await getById(id);
+        this.processSubmitDialogFlag = true;
+        this.$nextTick(() => {
+          let params = {
+            businessId: res.id,
+            businessKey: 'sampling_approval_process',
+            formCreateUserId: res.createUserId,
+            variables: {
+              businessCode: res.code,
+              businessName: '请样',
+              businessType: res.conditionType == 1 ? '整样' : '小样'
+            }
+          };
+          this.$refs.processSubmitDialogRef.init(params);
+        });
+      },
+      search() {
+        this.cancel();
+        this.$emit('reload');
       }
     }
   };

+ 42 - 1
src/views/produce/components/workPlan/components/baseInfo.vue

@@ -203,6 +203,48 @@
           </el-form-item>
         </el-col>
       </el-row>
+      <el-row>
+        <el-col :span="6">
+          <el-form-item label="执行班组" prop="executeJobId">
+            <el-select
+              :disabled="btnType == 'detail'"
+              v-model="form.executeJobId"
+              size="small"
+              style="width: 100%"
+            >
+              <el-option
+                v-for="item in form.jobList"
+                :key="item.id"
+                :value="item.id"
+                :label="item.name"
+                @click.native="changeExecuteJob(item)"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="6">
+          <el-form-item label="执行人" prop="executeUserId">
+            <el-select
+              :disabled="btnType == 'detail'"
+              v-model="form.executeUserIdList"
+              size="small"
+              style="width: 100%"
+              filterable
+              multiple
+              @change="executeUserIdChange"
+            >
+              <el-option
+                v-for="item in form.jobList.find(
+                  (job) => job.id == form.executeJobId
+                )?.userVOList"
+                :key="item.id"
+                :value="item.id"
+                :label="item.name"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+      </el-row>
       <el-row>
         <el-col :span="6">
           <el-form-item
@@ -430,7 +472,6 @@
 
   import { getProduceTaskList } from '@/api/aps';
   import { getByCode, parameterGetByCode } from '@/api/system/dictionary-data';
-
   export default {
     components: {
       EquipmentDialog,

+ 401 - 0
src/views/produce/components/workPlan/components/inspectionWorkDialog.vue

@@ -0,0 +1,401 @@
+<template>
+  <ele-modal
+    title="选择工单"
+    custom-class="ele-dialog-form long-dialog-form"
+    :visible.sync="visible"
+    :before-close="handleClose"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    append-to-body
+    width="70%"
+    :maxable="true"
+    :resizable="true"
+  >
+    <el-card shadow="never">
+      <seek-page
+        :seekList="seekList"
+        @search="search"
+        ref="search"
+      ></seek-page>
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        :pageSize="20"
+        :pageSizes="[20, 30, 40, 50, 100]"
+        row-key="id"
+        @cell-click="cellClick"
+      >
+        <!-- 表头工具栏 -->
+        <template v-slot:action="{ row }">
+          <el-radio class="radio" v-model="radio" :label="row.id"
+            ><i></i
+          ></el-radio>
+        </template>
+        <template v-slot:sourceCode="{ row }">
+          <div>{{
+            row.qualityPlanCode ? row.qualityPlanCode : row.workOrderCode
+          }}</div>
+        </template>
+
+        <template v-slot:qualityType="{ row }">{{
+          getDictValue('质检计划类型', row.qualityType)
+        }}</template>
+        <template v-slot:qualityMode="{ row }">{{
+          getDictValue('取样类型', row.qualityMode)
+        }}</template>
+      </ele-pro-table>
+    </el-card>
+
+    <div class="btns" slot="footer">
+      <el-button type="primary" size="small" @click="selected">选择</el-button>
+      <el-button size="small" @click="handleClose">关闭</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  import { getList } from '@/api/inspectionWork';
+  import dictMixins from '@/mixins/dictMixins';
+
+  export default {
+    mixins: [dictMixins],
+
+    components: {},
+    props: {},
+    data() {
+      return {
+        visible: false,
+        radio: null,
+        current: {},
+        columns: [
+          {
+            action: 'action',
+            slot: 'action',
+            align: 'center',
+            label: '选择',
+            minWidth: 100
+          },
+          {
+            type: 'index',
+            columnKey: 'index',
+            align: 'center',
+            label: '序号',
+            width: 55,
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+
+          {
+            prop: 'code',
+            label: '质检工单编码',
+            slot: 'code',
+            align: 'center',
+            width: 180,
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'name',
+            slot: 'name',
+            width: 120,
+            label: '质检工单名称',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            label: '来源单号',
+            prop: 'sourceCode',
+            slot: 'sourceCode',
+            align: 'center',
+            width: 160,
+            showOverflowTooltip: true
+          },
+          {
+            label: '类型',
+            prop: 'qualityType',
+            slot: 'qualityType',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true
+          },
+          {
+            label: '质检方式',
+            prop: 'qualityMode',
+            slot: 'qualityMode',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'qualityName',
+            label: '质检人',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true,
+            formatter: (row) => {
+              if (row.qualityName) {
+                return row.qualityName;
+              }
+              return row.qualityNames || '';
+            }
+          },
+          {
+            prop: 'qualityTime',
+            label: '质检时间',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'productCode',
+            width: 120,
+            label: '编码',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'productName',
+            width: 120,
+            label: '名称',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'batchNo',
+            label: '批次号',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'specification',
+            label: '规格',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'brandNo',
+            label: '牌号',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'produceTaskName',
+            label: '工序',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'total',
+            label: '总数量',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'qualifiedNumber',
+            label: '合格数',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'qualificationRate',
+            label: '合格率',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'noQualifiedNumber',
+            label: '不合格数',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'noQualificationRate',
+            label: '不合格率',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'hours',
+            label: '工时',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            label: '附件',
+            prop: 'accessory',
+            align: 'center',
+            slot: 'accessory',
+            showOverflowTooltip: true
+          },
+          {
+            label: '创建时间',
+            prop: 'createTime',
+            align: 'center',
+            width: 160
+          },
+          {
+            prop: 'status',
+            label: '状态',
+            align: 'center',
+            width: 80,
+            formatter: (row, column, cellValue) => {
+              // 状态(0未报工;1已报工;2已关闭;3待取样)
+              switch (cellValue) {
+                case 0:
+                  return '未报工';
+                case 1:
+                  return '已报工';
+                case 2:
+                  return '已关闭';
+                case 3:
+                  return '待取样';
+                default:
+                  return '';
+              }
+            },
+            fixed: 'right'
+          }
+        ]
+      };
+    },
+    created() {
+      this.requestDict('质检计划类型');
+      this.requestDict('不良品处理类型');
+      this.requestDict('取样类型');
+    },
+    computed: {
+      seekList() {
+        return [
+          {
+            label: '工单编码:',
+            value: 'code',
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '工单名称:',
+            value: 'name',
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '来源单号:',
+            value: 'sourceCode',
+            type: 'input',
+            placeholder: ''
+          },
+
+          {
+            label: '编码:',
+            value: 'productCode',
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '名称:',
+            value: 'productName',
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '质检人:',
+            value: 'qualityName',
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '状态:',
+            value: 'status',
+            type: 'select',
+            placeholder: '',
+            planList: [
+              {
+                label: '未报工',
+                value: 0
+              },
+              {
+                label: '待取样',
+                value: 3
+              }
+            ]
+          }
+        ];
+      }
+    },
+    methods: {
+      open() {
+        this.visible = true;
+      },
+
+      async datasource({ page, where, limit }) {
+        return getList({
+          ...where,
+          pageNum: page,
+          size: limit,
+
+          statusList: '0,3'
+        });
+      },
+      search(where) {
+        this.$refs.table.reload({
+          where: where
+          // page: 1
+        });
+      },
+      // 单击获取id
+      cellClick(row) {
+        this.current = row;
+        console.log(row);
+        this.radio = row.id;
+      },
+      handleClose() {
+        this.visible = false;
+        this.current = null;
+        this.radio = '';
+      },
+
+      selected() {
+        if (!this.current) {
+          return this.$message.warning('请至少选择一条数据');
+        }
+        this.$emit('changeParent', this.current);
+        this.handleClose();
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .tree_col {
+    border: 1px solid #eee;
+    padding: 10px 0;
+    box-sizing: border-box;
+    height: 500px;
+    overflow: auto;
+  }
+
+  .table_col {
+    padding-left: 10px;
+
+    ::v-deep .el-table th.el-table__cell {
+      background: #f2f2f2;
+    }
+  }
+
+  .pagination {
+    text-align: right;
+    padding: 10px 0;
+  }
+
+  .btns {
+    text-align: center;
+    padding: 10px 0;
+  }
+
+  .topsearch {
+    margin-bottom: 15px;
+  }
+</style>

+ 8 - 1
src/views/produce/components/workPlan/edit.vue

@@ -1049,10 +1049,13 @@
           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;
-
+          this.form.executeUserIdList = this.form.executeUserId
+            ? this.form.executeUserId.split(',')
+            : [];
           console.log(this.form, 'this.form');
           this.form.executeUserIdList = this.form.executeUserId
             ? this.form.executeUserId.split(',')
@@ -1653,6 +1656,10 @@
 
           // this.form.qualityIdList = [];
 
+          // if (this.form.qualityMode == 1) {
+          //   this.form.qualityResults = '';
+          // }
+
           let params = {
             ...this.form,
             sampleList: this.sampleList,

+ 105 - 23
src/views/produce/components/workPlan/index.vue

@@ -22,6 +22,7 @@
           :pageSize="20"
           :pageSizes="[20, 30, 40, 50, 100]"
           cache-key="work-planindex"
+          row-key="id"
         >
           <!-- <ele-pro-table
           ref="table"
@@ -87,6 +88,15 @@
           </template>
           <!-- 操作列 -->
           <template v-slot:action="{ row }">
+            <el-link
+              type="primary"
+              :underline="false"
+              @click="addSampleOpen(row)"
+              v-if="
+                ![1, 2].includes(row.status) && row.sampleQuantity < row.total
+              "
+              >请样</el-link
+            >
             <el-link
               type="primary"
               :underline="false"
@@ -113,7 +123,37 @@
               :businessId="row.id"
               businessCode="qmsqualityinspectionprint"
             ></jimureportBrowse>
-
+            <el-dropdown
+              trigger="click"
+              v-if="
+                row.status == 1 &&
+                isReportApproval == 1 &&
+                (!row.reportApprovalStatus || row.reportApprovalStatus == 0) &&
+                isEmptyObject(row.reportTemplateJson)
+              "
+            >
+              <el-link type="primary" :underline="false">生成质检报告</el-link>
+              <el-dropdown-menu slot="dropdown">
+                <el-dropdown-item
+                  v-for="item in reportTemplateList"
+                  :key="item.id"
+                  @click.native="generateReportApproval(row, item)"
+                  >{{ item.name }}</el-dropdown-item
+                >
+              </el-dropdown-menu>
+            </el-dropdown>
+            <el-link
+              v-if="
+                row.status == 1 &&
+                isReportApproval == 1 &&
+                row.reportApprovalStatus &&
+                !isEmptyObject(row.reportTemplateJson)
+              "
+              type="primary"
+              :underline="false"
+              @click="openReport(row)"
+              >查看质检报告</el-link
+            >
             <!-- 质检报告审批  -->
             <el-link
               v-if="
@@ -130,23 +170,13 @@
             <el-popconfirm
               class="ele-action"
               title="确定要关闭吗?"
-              @confirm="closeWork(row)"
+              @confirm="close(row)"
               v-if="row.status == 0 && row.qualityType == 2"
             >
               <template v-slot:reference>
                 <el-link type="warning" :underline="false"> 关闭 </el-link>
               </template>
             </el-popconfirm>
-            <!-- <el-link type="primary" :underline="false">
-            质检报告
-          </el-link>-->
-            <!-- <el-popconfirm class="ele-action" title="确定要删除吗?" @confirm="remove(row)" v-if="row.status == 0">
-            <template v-slot:reference>
-              <el-link type="danger" :underline="false" icon="el-icon-delete">
-                删除
-              </el-link>
-            </template>
-          </el-popconfirm>-->
           </template>
         </ele-pro-table>
         <!--  -->
@@ -209,7 +239,8 @@
     removeItem,
     updateCertificateNumber,
     verificationQualityInspector,
-    closeWork
+    closeWork,
+    checkByQualityWorkOrderId
   } from '@/api/inspectionWork';
   import dictMixins from '@/mixins/dictMixins';
   import tabMixins from '@/mixins/tableColumnsMixin';
@@ -217,6 +248,8 @@
   import { getFile } from '@/api/system/file';
   import { getByCode } from '@/api/system/dictionary-data';
   import { parameterGetByCode } from '@/api/system/dictionary-data';
+  import { recordingMethodList } from '@/utils/util.js';
+  import { inspectionProjectStatus } from '@/enum/dict.js';
 
   export default {
     mixins: [dictMixins, tabMixins],
@@ -233,6 +266,14 @@
     data() {
       return {
         columns: [
+          // 新增多选列
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center',
+            reserveSelection: true
+          },
           {
             type: 'index',
             columnKey: 'index',
@@ -303,7 +344,6 @@
             width: 120,
             showOverflowTooltip: true
           },
-
           {
             prop: 'productCode',
             width: 120,
@@ -337,7 +377,6 @@
             align: 'center',
             showOverflowTooltip: true
           },
-
           {
             prop: 'produceTaskName',
             label: '工序',
@@ -381,7 +420,6 @@
             align: 'center',
             showOverflowTooltip: true
           },
-
           {
             label: '附件',
             prop: 'accessory',
@@ -395,19 +433,46 @@
             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',
+            slot: 'templateList',
+            align: 'center',
+            width: 250
+          },
           {
             prop: 'status',
             label: '状态',
             align: 'center',
             width: 80,
             formatter: (row, column, cellValue) => {
-              return cellValue == 0
-                ? '未报工'
-                : cellValue == 1
-                ? '已报工'
-                : cellValue == 2
-                ? '已关闭'
-                : '';
+              // 状态(0未报工;1已报工;2已关闭;3待取样)
+              switch (cellValue) {
+                case 0:
+                  return '未报工';
+                case 1:
+                  return '已报工';
+                case 2:
+                  return '已关闭';
+                case 3:
+                  return '待请样';
+                default:
+                  return '';
+              }
             },
             fixed: 'right'
           },
@@ -424,6 +489,7 @@
         formData: {
           certificateNumber: ''
         },
+        inspectionProjectStatus,
         // certificateVisible: false,
         rowData: {},
         typeList: [], //类型列表
@@ -663,6 +729,22 @@
         }
       },
 
+      async addSampleOpen(row) {
+        const code = await verificationQualityInspector(row.id);
+        if (code == '-1') {
+          return;
+        }
+
+        const is = await checkByQualityWorkOrderId(row.id);
+        if (is) {
+          this.$message.warning('此工单存在未处理完的请样记录,请检查!');
+          return;
+        }
+
+        console.log(row, '==========');
+        this.$refs.addSampleRef.open('add', row);
+      },
+
       reportApprovalSubmit(res) {
         this.processSubmitDialogFlag = true;
         this.$nextTick(async () => {

+ 11 - 1
src/views/produce/components/workPlan/mixins/detailMixins.js

@@ -60,6 +60,16 @@ export default {
           prop: 'qualityTime',
           span: 6
         },
+        {
+          prop: 'executeJobName',
+          span: 6,
+          label: '执行班组',
+        },
+        {
+          prop: 'executeUserName',
+          span: 6,
+          label: '执行人'
+        },
         {
           label: '工时(h)',
           prop: 'hours',
@@ -95,7 +105,7 @@ export default {
           label: '总数量',
           prop: 'total',
           span: 6
-        },
+        }
       ],
       disposeTypeMap: {
         1: '返工',

+ 1 - 1
src/views/produce/index.vue

@@ -58,7 +58,7 @@
             </div>
           </el-tab-pane>
 
-          <el-tab-pane label="我的任务" name="second">
+          <el-tab-pane label="任务" name="second">
             <!-- <AssetTree @handleNodeClick="handleNodeClickNew" @setRootId="setRootId" id="0" :paramsType="'type'"
               ref="treeList" eqDevice="sb" /> -->
             <!-- <el-tree