Преглед на файлове

优化文件组件参数传递并增强公式计算精度

yusheng преди 6 месеца
родител
ревизия
6f7ca33048
променени са 25 файла, в които са добавени 1098 реда и са изтрити 555 реда
  1. 8 1
      src/api/inspectionStandard/index.js
  2. 48 15
      src/api/inspectionWork/index.js
  3. 2 0
      src/components/addDoc/doc_template.vue
  4. 7 3
      src/components/addDoc/file-table-listTemplate.vue
  5. 3 1
      src/components/addDoc/index.vue
  6. 4 0
      src/components/addDoc/main.vue
  7. 8 5
      src/components/templateDiv/customTable.vue
  8. 10 3
      src/components/templateDiv/customText.vue
  9. 36 7
      src/components/templateDiv/experimentationProcess.vue
  10. 361 334
      src/views/inspectionPlan/index.vue
  11. 16 3
      src/views/inspectionProjectRequest/components/search.vue
  12. 22 6
      src/views/inspectionProjectRequest/index.vue
  13. 16 3
      src/views/inspectionProjectTask/components/search.vue
  14. 22 6
      src/views/inspectionProjectTask/index.vue
  15. 100 27
      src/views/inspectionStandard/components/edit.vue
  16. 168 114
      src/views/inspectionStandard/index.vue
  17. 4 3
      src/views/inspectionWork/components/experimentReport.vue
  18. 12 6
      src/views/inspectionWork/components/inspectionProjectReport.vue
  19. 108 2
      src/views/inspectionWork/components/newQualityContentTabs.vue
  20. 31 11
      src/views/inspectionWork/details.vue
  21. 3 1
      src/views/inspectionWork/edit.vue
  22. 24 2
      src/views/inspectionWork/index.vue
  23. 83 0
      src/views/inspectionWork/mixins/detailMixins.js
  24. 1 1
      src/views/sample/sampleRecord/components/addSample.vue
  25. 1 1
      src/views/sample/sampleRecord/index.vue

+ 8 - 1
src/api/inspectionStandard/index.js

@@ -30,7 +30,14 @@ export async function update(data) {
   return Promise.reject(new Error(res.data.message));
 }
 
-
+// 编辑
+export async function change(data) {
+  const res = await request.put(`/qms/qualitystandard/change`, data);
+  if (res.data.code == 0) {
+    return res.data.message;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
 
 
 export async function getById(id) {

+ 48 - 15
src/api/inspectionWork/index.js

@@ -1,10 +1,11 @@
 import request from '@/utils/request';
 
-
 // 列表
 export async function getList(data) {
-  const res = data.parentId ? await request.post(`/qms/line_point/page`) : await request.post('/qms/quality_work_order/page', data);
-  console.log(res)
+  const res = data.parentId
+    ? await request.post(`/qms/line_point/page`)
+    : await request.post('/qms/quality_work_order/page', data);
+  console.log(res);
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -29,7 +30,6 @@ export async function update(data) {
   return Promise.reject(new Error(res.data.message));
 }
 
-
 export async function getById(id) {
   const res = await request.get(`/qms/quality_work_order/getById/${id}`);
   if (res.data.code == 0) {
@@ -56,7 +56,6 @@ export async function qualificationSave(data) {
   return Promise.reject(new Error(res.data.message));
 }
 
-
 // 删除
 export async function removeItem(data) {
   const res = await request.delete('/qms/quality_work_order/delete', {
@@ -88,7 +87,10 @@ export async function exeReportWork(data) {
 
 // 根据质检工单id获取清单列表
 export async function queryQualityInventory(data) {
-  const res = await request.post('/qms/quality_work_order/query_quality_inventory', data);
+  const res = await request.post(
+    '/qms/quality_work_order/query_quality_inventory',
+    data
+  );
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -96,14 +98,20 @@ export async function queryQualityInventory(data) {
 
 // 根据质检工单id获取质检样品列表
 export async function queryQualitySamplContent(data) {
-  const res = await request.post('/qms/quality_work_order/query_quality_sampl_content', data);
+  const res = await request.post(
+    '/qms/quality_work_order/query_quality_sampl_content',
+    data
+  );
   if (res.data.code == 0) {
     return res.data.data;
   }
 }
 // 根据质检工单id获取方案内容
 export async function queryQualityTempleContent(data) {
-  const res = await request.post('/qms/quality_work_order/query_quality_temple_content', data);
+  const res = await request.post(
+    '/qms/quality_work_order/query_quality_temple_content',
+    data
+  );
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -116,10 +124,12 @@ export async function warehouseList(data) {
   }
 }
 
-
 //更新合格证号
 export async function updateCertificateNumber(data) {
-  const res = await request.post('/qms/quality_work_order/updateCertificateNumber', data);
+  const res = await request.post(
+    '/qms/quality_work_order/updateCertificateNumber',
+    data
+  );
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -127,13 +137,14 @@ export async function updateCertificateNumber(data) {
 
 // 查询合格证
 export async function qualityWorkOrderCertificate(params) {
-  const res = await request.get('/qms/qualityWorkOrderCertificate/page', {params});
+  const res = await request.get('/qms/qualityWorkOrderCertificate/page', {
+    params
+  });
   if (res.data.code == 0) {
     return res.data.data;
   }
 }
 
-
 // 关闭
 export async function closeWork(data) {
   const res = await request.post(`/qms/quality_work_order/close`, data);
@@ -153,13 +164,17 @@ export async function closeWorkList(data) {
 
 // 关闭
 export async function verificationQualityInspector(id) {
-  const res = await request.post(`/qms/quality_work_order/verificationQualityInspector/${id}`);
-  return res.data.code
+  const res = await request.post(
+    `/qms/quality_work_order/verificationQualityInspector/${id}`
+  );
+  return res.data.code;
   return Promise.reject(new Error(res.data.message));
 }
 
 export async function checkByQualityWorkOrderId(qualityWorkOrderId) {
-  const res = await request.get(`/qms/samplingrecord/checkByQualityWorkOrderId/`+qualityWorkOrderId);
+  const res = await request.get(
+    `/qms/samplingrecord/checkByQualityWorkOrderId/` + qualityWorkOrderId
+  );
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -193,4 +208,22 @@ export async function getQmsReportTemplatePageList(params) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
+}
+
+export async function newFilePageAPI(data) {
+  const res = await request.post('/fm/file/queryIds', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+//收样
+
+export async function sampleCollection(data) {
+  const res = await request.put(`/qms/quality_work_order/sampleCollection`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
 }

+ 2 - 0
src/components/addDoc/doc_template.vue

@@ -45,6 +45,7 @@
           <FileTableList
             ref="tableRef"
             :parentData="current"
+            :lcyStatus="lcyStatus"
             :disabledTableList="disabledTableList"
           />
         </template>
@@ -100,6 +101,7 @@
           type: this.fileType,
           currentUserId: this.user.info.userId
         };
+     
         this.data = await getDocTreeListAPI(query);
 
         this.current = null;

+ 7 - 3
src/components/addDoc/file-table-listTemplate.vue

@@ -39,7 +39,7 @@
         type: Object,
         default: () => {}
       },
-
+      lcyStatus: '',
       disabledTableList: {
         //已选择列表
         default: () => []
@@ -175,13 +175,17 @@
     methods: {
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {
-        return filePageAPI({
+        let params = {
           ...where,
           ...order,
           pageNum: page,
           size: limit,
           directoryId: this.parentData?.id
-        });
+        };
+        if (this.lcyStatus) {
+          params.lcyStatus = this.lcyStatus;
+        }
+        return filePageAPI(params);
       },
       /* 刷新表格 */
       reload(where) {

+ 3 - 1
src/components/addDoc/index.vue

@@ -20,7 +20,7 @@
       >
     </el-badge>
 
-    <file-upload @success="getFiles" ref="fileUploadRef"></file-upload>
+    <file-upload @success="getFiles" ref="fileUploadRef" :lcyStatus="lcyStatus"></file-upload>
   </div>
 </template>
 
@@ -34,7 +34,9 @@
       prop: 'value',
       event: 'updateVal'
     },
+
     props: {
+      lcyStatus: '',
       type: {
         type: String,
         default: ''

+ 4 - 0
src/components/addDoc/main.vue

@@ -70,6 +70,7 @@
       <doc_template
         :disabledTableList="tableList"
         ref="doc_templateRef"
+        :lcyStatus="lcyStatus"
       ></doc_template>
       <template v-slot:footer>
         <el-button @click="fileShow = false">取消</el-button>
@@ -91,6 +92,9 @@
   export default {
     components: { doc_template, fileEdit, browse },
     mixins: [tabMixins],
+    props: {
+      lcyStatus: ''
+    },
     data() {
       return {
         fileId: [],

+ 8 - 5
src/components/templateDiv/customTable.vue

@@ -93,7 +93,7 @@
         domId: '',
         rightClickShow: false,
         columns: [],
-        // rows: [],
+        units: {},
         equation: {}
       };
     },
@@ -240,22 +240,25 @@
         return {
           form: null,
           equation: this.equation,
+          units: this.units,
           valueObj: {
             columns: this.columns
           }
         };
       },
-      init({ form, valueObj, equation }) {
+      init({ form, valueObj, equation, units }) {
         this.form = form;
         this.columns = valueObj.columns;
-
+        this.units = units || {};
         this.equation = equation || {};
       },
       editInputChange(domObj) {
         if (domObj.equation) {
           this.equation[this.domId] = domObj.equation;
         }
-
+        if (domObj.units) {
+          this.units[this.domId] = domObj.units;
+        }
         this.columns.forEach((item, index) => {
           let rowsIndex = item.findIndex((cells) => cells.id == this.domId);
 
@@ -266,7 +269,7 @@
       },
 
       inputClick(item, type) {
-        return
+        return;
         if (!this.edit) {
           return;
         }

+ 10 - 3
src/components/templateDiv/customText.vue

@@ -44,6 +44,7 @@
         valueObj: {},
         equation: {},
         domId: '',
+        units: {},
         rightClickShow: false
       };
     },
@@ -113,6 +114,7 @@
         return {
           form: this.$refs[this.id].innerHTML,
           valueObj: data,
+          units: this.units,
           equation: this.equation
         };
       },
@@ -125,10 +127,12 @@
           }
         }
       },
-      init({ form, valueObj, equation }) {
+      init({ form, valueObj, equation, units }) {
         this.form = form;
         this.valueObj = valueObj;
         this.equation = equation || {};
+        this.units = units || {};
+
         this.$nextTick(() => {
           if (!this.edit) {
             let inputs = document.querySelectorAll('.templateInput');
@@ -152,10 +156,13 @@
         if (domObj.equation) {
           this.equation[domObj.id] = domObj.equation;
         }
+        if (domObj.units) {
+          this.units[domObj.id] = domObj.units;
+        }
         dom.id = domObj.id;
       },
       onRightClick(PointerEvent) {
-        return
+        return;
         this.rightClickShow = true;
         this.$nextTick(() => {
           let y = PointerEvent.pageY;
@@ -175,7 +182,7 @@
         }
       },
       inputClick(event) {
-        return
+        return;
         if (!this.edit) {
           return;
         }

+ 36 - 7
src/components/templateDiv/experimentationProcess.vue

@@ -271,32 +271,59 @@
         });
         equation.forEach((item) => {
           for (const key in item.equation) {
-            let data = this.getObjValue(); //每次计算都获取最新的值
+            let { data, units } = this.getObjValue(); //每次计算都获取最新的值
             let value = '';
             if (item.equation[key].length) {
               item.equation[key].forEach((equationItem) => {
-                if (equationItem.type == 'symbol') {
+                if (
+                  equationItem.type == 'symbol' ||
+                  equationItem.type == 'value'
+                ) {
                   value += equationItem.value;
                 } else if (equationItem.type == 'id') {
                   value += Number(data[equationItem.value]) || 0;
-                } else {
-                  value += equationItem.value;
                 }
               });
+
+              if (units[key]?.decimalPlace) {
+                if (units[key]?.takeValueMethod) {
+                  value =
+                    units[key]?.takeValueMethod == 1
+                      ? parseFloat(eval(value).toFixed(units[key].decimalPlace))
+                      : this.truncateToFixedManual(
+                          eval(value),
+                          units[key].decimalPlace
+                        );
+                } else {
+                  value = parseFloat(
+                    eval(value).toFixed(units[key].decimalPlace)
+                  );
+                }
+              } else {
+                value = parseFloat(eval(value).toFixed(2));
+              }
+
               if (this.$refs['customTextRef' + item.id][0]) {
                 this.$refs['customTextRef' + item.id][0].equationValue({
                   domId: key,
-                  value: eval(value)
+                  value
                 });
               }
             }
           }
         });
       },
+      truncateToFixedManual(num, decimalPlaces) {
+        let factor = Math.pow(10, decimalPlaces);
+        return Math.floor(num * factor) / factor;
+      },
       getObjValue() {
         this.getValue();
         let data = {};
+        let units = {};
         this.list.forEach((item) => {
+          units = { ...item.units, ...units };
+
           if (item.type == 'customText') {
             data = { ...item.valueObj, ...data };
           } else {
@@ -307,7 +334,7 @@
             });
           }
         });
-        return data || {};
+        return { data: data || {}, units: units || {} };
       },
 
       setEquation() {
@@ -410,6 +437,7 @@
               this.$refs['customTextRef' + item.id][0].init({
                 form: item.value,
                 valueObj: item.valueObj,
+                units: item.units,
                 equation: item.equation
               });
             });
@@ -445,11 +473,12 @@
       },
       getValue() {
         this.list.forEach((item, index) => {
-          let { form, valueObj, equation } =
+          let { form, valueObj, equation, units } =
             this.$refs['customTextRef' + item.id][0].getValue();
           this.$set(this.list[index], 'value', form);
           this.$set(this.list[index], 'valueObj', valueObj);
           this.$set(this.list[index], 'equation', equation);
+          this.$set(this.list[index], 'units', units);
         });
         return this.list;
       }

+ 361 - 334
src/views/inspectionPlan/index.vue

@@ -2,7 +2,11 @@
   <div class="ele-body">
     <el-card shadow="never">
       <!-- <search ref="search" @search="reload"></search> -->
-      <seek-page :seekList="seekList" @search="search" :keyValue="'qms-inspectionPlan-index-search'"></seek-page>
+      <seek-page
+        :seekList="seekList"
+        @search="search"
+        :keyValue="'qms-inspectionPlan-index-search'"
+      ></seek-page>
 
       <ele-pro-table
         ref="tableRef"
@@ -108,353 +112,376 @@
   </div>
 </template>
 <script>
-import search from './components/search.vue';
-// import edit from './components/edit.vue';
-import edit from './components/new-edit.vue';
-import {
-  getList,
-  removeItem,
-  closePlan,
-  retractPlan
-} from '@/api/inspectionPlan';
-import dictMixins from '@/mixins/dictMixins';
-import { getFile } from '@/api/system/file';
-import { getByCode } from '@/api/system/dictionary-data';
-import { queryTodo } from '@/api/bpm/task';
+  import search from './components/search.vue';
+  // import edit from './components/edit.vue';
+  import edit from './components/new-edit.vue';
+  import {
+    getList,
+    removeItem,
+    closePlan,
+    retractPlan
+  } from '@/api/inspectionPlan';
+  import dictMixins from '@/mixins/dictMixins';
+  import { getFile } from '@/api/system/file';
+  import { getByCode } from '@/api/system/dictionary-data';
+  import { queryTodo } from '@/api/bpm/task';
+  import { recordingMethodList } from '@/utils/util.js';
 
-import tabMixins from '@/mixins/tableColumnsMixin';
-export default {
-  mixins: [dictMixins, tabMixins],
-  components: {
-    search,
-    edit
-  },
-  data() {
-    return {
-      cacheKeyUrl: 'qsm-c2e9664a-inspectionPlan',
-      columns: [
-        {
-          columnKey: 'index',
-          label: '序号',
-          type: 'index',
-          width: 55,
-          align: 'center',
-          showOverflowTooltip: true,
-          fixed: 'left'
-        },
+  import tabMixins from '@/mixins/tableColumnsMixin';
+  export default {
+    mixins: [dictMixins, tabMixins],
+    components: {
+      search,
+      edit
+    },
+    data() {
+      return {
+        cacheKeyUrl: 'qsm-c2e9664a-inspectionPlan',
+        columns: [
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
 
-        {
-          prop: 'code',
-          slot: 'code',
-          label: '质检计划编码',
-          width: 160,
-          align: 'center',
-          showOverflowTooltip: true,
-          fixed: 'left'
-        },
-        {
-          label: '质检计划名称',
-          prop: 'name',
-          width: 160,
-          align: 'center',
-          showOverflowTooltip: true,
-          fixed: 'left'
-        },
-        {
-          label: '来源单据编码',
-          prop: 'planSourceCode',
-          width: 160,
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'productCode',
-          width: 120,
-          label: '编码',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'productName',
-          width: 120,
-          label: '名称',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          prop: 'batchNo',
-          label: '批次号',
-          width: 160,
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          label: '类型',
-          prop: 'type',
-          slot: 'type',
-          width: 120,
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          label: '检验方式',
-          prop: 'qualityMode',
-          slot: 'qualityMode',
-          width: 120,
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          label: '自动派单',
-          prop: 'autoOrder',
-          align: 'center',
-          showOverflowTooltip: true,
-          formatter: (row, column, cellValue) => {
-            return cellValue == 1 ? '是' : '否';
-          }
-        },
-        // {
-        //   prop: 'productName',
-        //   label: '产品名称',
-        // },
-        // {
-        //   prop: 'productCode',
-        //   label: '产品编码',
-        // },
-        // {
-        //   prop: 'specification',
-        //   label: '规格',
-        // },
-        // {
-        //   prop: 'brandNo',
-        //   label: '牌号',
-        // },
+          {
+            prop: 'code',
+            slot: 'code',
+            label: '质检计划编码',
+            width: 160,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            label: '质检计划名称',
+            prop: 'name',
+            width: 160,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            label: '来源单据编码',
+            prop: 'planSourceCode',
+            width: 160,
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'productCode',
+            width: 120,
+            label: '编码',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'productName',
+            width: 120,
+            label: '名称',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'batchNo',
+            label: '批次号',
+            width: 160,
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            label: '类型',
+            prop: 'type',
+            slot: 'type',
+            width: 120,
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            label: '检验方式',
+            prop: 'qualityMode',
+            slot: 'qualityMode',
+            width: 120,
+            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: 'autoOrder',
+            align: 'center',
+            showOverflowTooltip: true,
+            formatter: (row, column, cellValue) => {
+              return cellValue == 1 ? '是' : '否';
+            }
+          },
+          // {
+          //   prop: 'productName',
+          //   label: '产品名称',
+          // },
+          // {
+          //   prop: 'productCode',
+          //   label: '产品编码',
+          // },
+          // {
+          //   prop: 'specification',
+          //   label: '规格',
+          // },
+          // {
+          //   prop: 'brandNo',
+          //   label: '牌号',
+          // },
 
-        // {
-        //   prop: 'productNumber',
-        //   label: '数量',
-        //   width: 60
-        // },
+          // {
+          //   prop: 'productNumber',
+          //   label: '数量',
+          //   width: 60
+          // },
 
-        {
-          label: '执行部门',
-          prop: 'groupName',
-          align: 'center',
-          showOverflowTooltip: true
-        },
-        {
-          label: '执行人',
-          prop: 'executeName',
-          align: 'center',
-          width: 120,
-          showOverflowTooltip: true
-        },
-        {
-          label: '创建时间',
-          prop: 'createTime',
-          align: 'center',
-          width: 120,
-          showOverflowTooltip: true
-        },
-        {
-          label: '开始时间',
-          prop: 'planStartTime',
-          align: 'center',
-          width: 120,
-          showOverflowTooltip: true
-        },
-        {
-          label: '结束时间',
-          prop: 'planEndTime',
-          align: 'center',
-          width: 120,
-          showOverflowTooltip: true
-        },
-        // {
-        //   label: '附件',
-        //   prop: 'accessory',
-        //   slot: 'accessory',
-        //   align: 'center',
-        //   width: 120,
-        //   showOverflowTooltip: true
-        // },
-        {
-          label: '状态',
-          prop: 'status',
-          width: 70,
-          align: 'center',
-          showOverflowTooltip: true,
-          formatter: (row, column, cellValue) => {
-            return this.getDictName('质检计划状态', cellValue);
-          }
-        },
+          {
+            label: '执行部门',
+            prop: 'groupName',
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            label: '执行人',
+            prop: 'executeName',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true
+          },
+          {
+            label: '创建时间',
+            prop: 'createTime',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true
+          },
+          {
+            label: '开始时间',
+            prop: 'planStartTime',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true
+          },
+          {
+            label: '结束时间',
+            prop: 'planEndTime',
+            align: 'center',
+            width: 120,
+            showOverflowTooltip: true
+          },
+          // {
+          //   label: '附件',
+          //   prop: 'accessory',
+          //   slot: 'accessory',
+          //   align: 'center',
+          //   width: 120,
+          //   showOverflowTooltip: true
+          // },
+          {
+            label: '状态',
+            prop: 'status',
+            width: 70,
+            align: 'center',
+            showOverflowTooltip: true,
+            formatter: (row, column, cellValue) => {
+              return this.getDictName('质检计划状态', cellValue);
+            }
+          },
 
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 200,
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          showOverflowTooltip: true,
-          fixed: 'right'
-        }
-      ],
-      typeList: [], //类型列表
-      qualityMode: []
-    };
-  },
-  computed: {
-    seekList() {
-      return [
-        {
-          label: '计划编码:',
-          value: 'code',
-          type: 'input',
-          placeholder: ''
-        },
-        {
-          label: '计划名称:',
-          value: 'name',
-          type: 'input',
-          placeholder: ''
-        },
-        {
-          label: '来源单据编码:',
-          value: 'planSourceCode',
-          type: 'input',
-          placeholder: ''
-        },
-        {
-          label: '编码',
-          value: 'productCode',
-          type: 'input',
-          placeholder: '',
-          width: 240
-        },
-        {
-          label: '名称',
-          value: 'productName',
-          type: 'input',
-          placeholder: '',
-          width: 240
-        },
-        {
-          label: '类型:',
-          value: 'type',
-          type: 'select',
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 200,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true,
+            fixed: 'right'
+          }
+        ],
+        typeList: [], //类型列表
+        qualityMode: []
+      };
+    },
+    computed: {
+      seekList() {
+        return [
+          {
+            label: '计划编码:',
+            value: 'code',
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '计划名称:',
+            value: 'name',
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '来源单据编码:',
+            value: 'planSourceCode',
+            type: 'input',
+            placeholder: ''
+          },
+          {
+            label: '编码',
+            value: 'productCode',
+            type: 'input',
+            placeholder: '',
+            width: 240
+          },
+          {
+            label: '名称',
+            value: 'productName',
+            type: 'input',
+            placeholder: '',
+            width: 240
+          },
+          {
+            label: '类型:',
+            value: 'type',
+            type: 'select',
 
-          placeholder: '',
-          width: 240,
-          // 加载状态
-          planList: this.typeList
-        },
-        {
-          label: '检验方式:',
-          value: 'qualityMode',
-          type: 'select',
+            placeholder: '',
+            width: 240,
+            // 加载状态
+            planList: this.typeList
+          },
+          {
+            label: '检验方式:',
+            value: 'qualityMode',
+            type: 'select',
 
-          placeholder: '',
-          width: 240,
-          planList: this.qualityMode
-        }
-      ];
-    }
-  },
-  created() {
-    this.requestDict('质检计划类型');
-    this.requestDict('取样类型');
-    this.requestDict('质检计划状态');
-    this.getTnspectionPlanType();
-    this.getQualityMethodCode();
-  },
-  methods: {
-    // datasource({ page, limit, where }) {
-    //   return getList({
-    //     ...where,
-    //     pageNum: page,
-    //     size: limit
-    //   });
-    // },
-    
-    async datasource({ page, where, limit }) {
-      try {
-        await queryTodo({});
-      } catch (err) {
-        console.error('调用queryTodo失败:', err);
-      }
-
-      return getList({
-        ...where,
-        pageNum: page,
-        size: limit
-      });
-    },
-    search(e) {
-      if (Array.isArray(e.createTime) && e.createTime.length) {
-        e.createTimeStart = e.createTime[0];
-        e.createTimeEnd = e.createTime[1];
+            placeholder: '',
+            width: 240,
+            planList: this.qualityMode
+          },
+          // {
+          //   label: '记录方法:',
+          //   value: 'recordingMethod',
+          //   type: 'select',
+          //   placeholder: '',
+          //   width: 240,
+          //   planList: recordingMethodList
+          // }
+        ];
       }
-      this.reload(e);
-    },
-    openEdit(type, row) {
-      console.log(row);
-      this.$refs.edit.open(type, row);
-    },
-    downloadFile(file) {
-      getFile({ objectName: file.storePath }, file.name);
     },
-    remove(row) {
-      removeItem([row.id])
-        .then((message) => {
-          this.$message.success(message);
-          this.reload();
-        })
-        .catch((e) => {});
-    },
-    async retract(row) {
-      await retractPlan(row);
-      this.reload();
-    },
-    async close(row) {
-      console.log(row);
-      await closePlan(row);
-      this.reload();
-    },
-    reload(where) {
-      this.$refs.tableRef.reload({ where });
+    created() {
+      this.requestDict('质检计划类型');
+      this.requestDict('取样类型');
+      this.requestDict('质检计划状态');
+      this.getTnspectionPlanType();
+      this.getQualityMethodCode();
     },
+    methods: {
+      // datasource({ page, limit, where }) {
+      //   return getList({
+      //     ...where,
+      //     pageNum: page,
+      //     size: limit
+      //   });
+      // },
 
-    async getTnspectionPlanType() {
-      let res = await getByCode('inspection_plan_type');
-      if (res?.code == 0) {
-        let list = res.data.map((item) => {
-          let key = Object.keys(item)[0];
-          return { value: key, label: item[key] };
+      async datasource({ page, where, limit }) {
+        try {
+          await queryTodo({});
+        } catch (err) {
+          console.error('调用queryTodo失败:', err);
+        }
+
+        return getList({
+          ...where,
+          pageNum: page,
+          size: limit
         });
-        this.typeList = list;
-      }
-    },
+      },
+      search(e) {
+        if (Array.isArray(e.createTime) && e.createTime.length) {
+          e.createTimeStart = e.createTime[0];
+          e.createTimeEnd = e.createTime[1];
+        }
+        this.reload(e);
+      },
+      openEdit(type, row) {
+        console.log(row);
+        this.$refs.edit.open(type, row);
+      },
+      downloadFile(file) {
+        getFile({ objectName: file.storePath }, file.name);
+      },
+      remove(row) {
+        removeItem([row.id])
+          .then((message) => {
+            this.$message.success(message);
+            this.reload();
+          })
+          .catch((e) => {});
+      },
+      async retract(row) {
+        await retractPlan(row);
+        this.reload();
+      },
+      async close(row) {
+        console.log(row);
+        await closePlan(row);
+        this.reload();
+      },
+      reload(where) {
+        this.$refs.tableRef.reload({ where });
+      },
+
+      async getTnspectionPlanType() {
+        let res = await getByCode('inspection_plan_type');
+        if (res?.code == 0) {
+          let list = res.data.map((item) => {
+            let key = Object.keys(item)[0];
+            return { value: key, label: item[key] };
+          });
+          this.typeList = list;
+        }
+      },
 
-    async getQualityMethodCode() {
-      let res = await getByCode('quality_method_code');
-      if (res?.code == 0) {
-        let list = res.data.map((item) => {
-          let key = Object.keys(item)[0];
-          return { value: key, label: item[key] };
+      async getQualityMethodCode() {
+        let res = await getByCode('quality_method_code');
+        if (res?.code == 0) {
+          let list = res.data.map((item) => {
+            let key = Object.keys(item)[0];
+            return { value: key, label: item[key] };
+          });
+          this.qualityMode = list;
+        }
+      },
+      // 打开详情
+      openDetails(row) {
+        console.log(row, 'row 000');
+        let id = row.id;
+        this.$router.push({
+          path: '/inspectionWork/details',
+          query: { id, path: '/inspectionPlan', name: '计划' }
         });
-        this.qualityMode = list;
       }
-    },
-    // 打开详情
-    openDetails(row) {
-      console.log(row, 'row 000');
-      let id = row.id;
-      this.$router.push({
-        path: '/inspectionWork/details',
-        query: { id, path: '/inspectionPlan', name: '计划' }
-      });
     }
-  }
-};
+  };
 </script>

+ 16 - 3
src/views/inspectionProjectRequest/components/search.vue

@@ -5,6 +5,8 @@
 
 <script>
   import { getList } from '@/api/inspectionStandard';
+  import { recordingMethodList } from '@/utils/util.js';
+
   export default {
     data() {
       return {
@@ -48,9 +50,20 @@
 
           {
             label: '状态:',
-            value: 'standardCode',
-            type: 'input',
-            placeholder: '请输入'
+            value: 'status',
+            type: 'select',
+            placeholder: '请选择',
+            planList: [
+              { label: '未报工', value: 1 },
+              { label: '已报工', value: 2 }
+            ]
+          },
+          {
+            label: '记录方法:',
+            value: 'recordingMethod',
+            type: 'select',
+            placeholder: '',
+            planList: recordingMethodList
           }
         ];
       }

+ 22 - 6
src/views/inspectionProjectRequest/index.vue

@@ -65,7 +65,7 @@
             @click="approvalSubmit(row)"
             >提交</el-link
           >
-          <el-link
+          <!-- <el-link
             type="primary"
             :underline="false"
             v-if="
@@ -75,7 +75,7 @@
             "
             @click="sampleCollection(row)"
             >收样</el-link
-          >
+          > -->
           <el-link
             type="primary"
             :underline="false"
@@ -173,6 +173,8 @@
   import { reviewStatus } from '@/enum/dict';
   import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
   import bpmDetail from '@/views/bpm/processInstance/detail.vue';
+  import { recordingMethodList } from '@/utils/util.js';
+
   export default {
     components: {
       search,
@@ -358,17 +360,31 @@
             align: 'center',
             showOverflowTooltip: true
           },
+          {
+            prop: 'recordingMethod',
+            label: '记录方法',
+            align: 'center',
+            formatter: (row) => {
+              return (
+                recordingMethodList.find(
+                  (item) => item.value == row.recordingMethod
+                )?.label || ''
+              );
+            },
+            width: 130,
+            showOverflowTooltip: true
+          },
           {
             prop: 'status',
             minWidth: 110,
             label: '状态',
             align: 'center',
             formatter: (row) => {
-              return row.status == 0
-                ? '待收样'
-                : row.status == 1
+              return row.status == 1
                 ? '未报工'
-                : '已报工';
+                : row.status == 2
+                ? '已报工'
+                : '';
             },
             showOverflowTooltip: true
           },

+ 16 - 3
src/views/inspectionProjectTask/components/search.vue

@@ -5,6 +5,8 @@
 
 <script>
   import { getList } from '@/api/inspectionStandard';
+  import { recordingMethodList } from '@/utils/util.js';
+
   export default {
     data() {
       return {
@@ -48,9 +50,20 @@
 
           {
             label: '状态:',
-            value: 'standardCode',
-            type: 'input',
-            placeholder: '请输入'
+            value: 'status',
+            type: 'select',
+            placeholder: '请选择',
+            planList: [
+              { label: '未报工', value: 1 },
+              { label: '已报工', value: 2 }
+            ]
+          },
+          {
+            label: '记录方法:',
+            value: 'recordingMethod',
+            type: 'select',
+            placeholder: '',
+            planList: recordingMethodList
           }
         ];
       }

+ 22 - 6
src/views/inspectionProjectTask/index.vue

@@ -31,7 +31,7 @@
         </template>
         <!-- 操作列 -->
         <template v-slot:action="{ row }">
-          <el-link
+          <!-- <el-link
             type="primary"
             :underline="false"
             icon="el-icon-edit"
@@ -39,7 +39,7 @@
             v-if="row.status == 0"
           >
             收样
-          </el-link>
+          </el-link> -->
           <el-link
             type="primary"
             :underline="false"
@@ -71,6 +71,8 @@
     verificationQualityInspector
   } from '@/api/inspectionProjectTask';
   import dictMixins from '@/mixins/dictMixins';
+  import { recordingMethodList } from '@/utils/util.js';
+
   export default {
     components: {
       search,
@@ -215,12 +217,26 @@
             label: '状态',
             align: 'center',
             formatter: (row) => {
-              return row.status == 0
-                ? '待收样'
-                : row.status == 1
+              return row.status == 1
                 ? '未报工'
-                : '已报工';
+                : row.status == 2
+                ? '已报工'
+                : '';
+            },
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'recordingMethod',
+            label: '记录方法',
+            align: 'center',
+            formatter: (row) => {
+              return (
+                recordingMethodList.find(
+                  (item) => item.value == row.recordingMethod
+                )?.label || ''
+              );
             },
+            width: 130,
             showOverflowTooltip: true
           },
           {

+ 100 - 27
src/views/inspectionStandard/components/edit.vue

@@ -10,7 +10,28 @@
     width="50%"
     :maxable="true"
   >
-    <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+    <div class="switch" v-if="type == 'detail'">
+      <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
+    style="margin-top: 10px;"
+      ref="form"
+      :model="form"
+      :rules="rules"
+      label-width="100px"
+      v-show="activeComp === 'main'"
+    >
       <el-row>
         <el-col :span="12" style="padding: 0">
           <el-form-item label="标准类型:" prop="type">
@@ -49,7 +70,7 @@
             ></el-input>
           </el-form-item>
         </el-col>
-        <el-col :span="12" style="padding: 0">
+        <!-- <el-col :span="12" style="padding: 0">
           <el-form-item label="状态:" prop="status">
             <el-select
               v-model="form.status"
@@ -61,21 +82,22 @@
               <el-option label="启用" :value="1" />
             </el-select>
           </el-form-item>
-        </el-col>
+        </el-col> -->
 
-        <el-col :span="8" style="padding: 0">
+        <el-col :span="12" style="padding: 0">
+          <el-form-item prop="sort" label="排序">
+            <el-input v-model="form.sort" type="number"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12" style="padding: 0">
           <el-form-item prop="imgUrl" label="附件">
-            <fileUpload
+            <fileMain
               v-model="form.imgUrl"
+              lcyStatus="3"
               :type="type == 'detail' ? 'view' : 'add'"
             />
           </el-form-item>
         </el-col>
-        <el-col :span="8" style="padding: 0">
-          <el-form-item prop="sort" label="排序">
-            <el-input v-model="form.sort" type="number"></el-input>
-          </el-form-item>
-        </el-col>
       </el-row>
       <el-row>
         <el-col :span="24">
@@ -248,7 +270,10 @@
         <!-- <inspectionProjectList v-if="visible" :linePoints="form.inspectionItems" ref="inspectionProjectRef" /> -->
       </el-row>
     </el-form>
-
+    <bpmDetail
+      v-if="activeComp == 'bpm' && form.processInstanceId"
+      :id="form.processInstanceId"
+    ></bpmDetail>
     <template v-slot:footer>
       <el-button @click="handleClose">取消</el-button>
       <el-button
@@ -259,29 +284,42 @@
       >
         保存
       </el-button>
+      <el-button
+        type="primary"
+        :loading="loading"
+        @click="save('submit')"
+        v-if="type != 'detail'"
+      >
+        发布
+      </el-button>
     </template>
     <!-- <standardDialog ref="standardDialogRef" @choose="choose" />
     <EquipmentDialog ref="equipmentDialogRef" @choose="choose" />
 
     <edit ref="edit" ></edit> -->
+    <processSubmitDialog
+      :processSubmitDialogFlag.sync="processSubmitDialogFlag"
+      v-if="processSubmitDialogFlag"
+      ref="processSubmitDialogRef"
+      @reload="search"
+    ></processSubmitDialog>
   </ele-modal>
 </template>
 
 <script>
-  import { save, update, getById } from '@/api/inspectionStandard';
-  import fileUpload from '@/components/addDoc/index.vue';
+  import { save, update, getById, change } from '@/api/inspectionStandard';
   import standardDialog from './standardDialog';
-  // import EquipmentDialog from './EquipmentDialog';
-
-  // import edit from '@/views/inspectionPoint/components/edit';
+  import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
+  import dictMixins from '@/mixins/dictMixins';
+  import bpmDetail from '@/views/bpm/processInstance/detail.vue';
 
   export default {
     components: {
-      fileUpload,
-      standardDialog
-      // EquipmentDialog,
-      // edit
+      standardDialog,
+      processSubmitDialog,
+      bpmDetail
     },
+    mixins: [dictMixins],
 
     data() {
       const defaultForm = function () {
@@ -299,11 +337,17 @@
           linePoints: [],
           parameterType: '',
           imgUrl: [],
-          sort:0
+          sort: 0
         };
       };
       return {
         defaultForm,
+        processSubmitDialogFlag: false,
+        activeComp: 'main',
+        tabOptions: [
+          { key: 'main', name: '质检标准详情' },
+          { key: 'bpm', name: '流程详情' }
+        ],
         // 表单数据
         form: { ...defaultForm() },
         activeName: '质检项',
@@ -327,13 +371,16 @@
         visible: false,
         type: null,
         title: null,
-        loading: false
+        loading: false,
+        isChange: false
       };
     },
 
     created() {},
     methods: {
-      open(type, row) {
+      open(type, row, isChange) {
+        this.activeComp='main'
+        this.isChange = isChange;
         this.title = type == 'add' ? '新增' : 'edit' ? '编辑' : '详情';
         this.type = type;
         if (this.type != 'add') {
@@ -398,7 +445,7 @@
         this.form[list].splice(index, 1);
       },
       /* 保存编辑 */
-      save() {
+      save(type) {
         this.$refs.form.validate((valid) => {
           if (!valid) {
             return false;
@@ -409,19 +456,41 @@
           }
           // this.form.inspectionId = this.$refs.inspectionProjectRef.getValue();
 
-          let URL = this.type == 'add' ? save : update;
+          let URL = this.type == 'add' ? save : this.isChange ? change : update;
           URL(this.form)
             .then((msg) => {
               this.loading = false;
               this.$message.success(msg);
-              this.handleClose();
-              this.$emit('done');
+
+              if (type == 'submit') {
+                this.approvalSubmit(this.form.id || msg);
+              } else {
+                this.handleClose();
+                this.$emit('done');
+              }
             })
             .catch((e) => {
               this.loading = false;
             });
         });
       },
+      async approvalSubmit(id) {
+        const res = await getById(id);
+        this.processSubmitDialogFlag = true;
+        this.$nextTick(() => {
+          let params = {
+            businessId: res.data.id,
+            businessKey: 'qms_standard_release',
+            formCreateUserId: res.data.createUserId,
+            variables: {
+              businessCode: res.data.code,
+              businessName: '发布',
+              businessType: this.getDictValue('质检标准类型', res.data.type)
+            }
+          };
+          this.$refs.processSubmitDialogRef.init(params);
+        });
+      },
       restForm() {
         this.form = { ...this.defaultForm() };
         this.$nextTick(() => {
@@ -431,6 +500,10 @@
       handleClose() {
         this.restForm();
         this.visible = false;
+      },
+      search() {
+        this.handleClose();
+        this.$emit('done');
       }
     }
   };

+ 168 - 114
src/views/inspectionStandard/index.vue

@@ -47,13 +47,33 @@
             :underline="false"
             icon="el-icon-edit"
             @click="openEdit('edit', row)"
+            v-if="row.isUpdate != 1 && [0, 3].includes(row.approvalStatus)"
           >
             修改
           </el-link>
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="approvalSubmit(row)"
+            v-if="row.isUpdate != 1 && [0, 3].includes(row.approvalStatus)"
+          >
+            发布
+          </el-link>
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            @click="openEdit('edit', row,true)"
+            v-if="row.isUpdate != 1 && [2].includes(row.approvalStatus)"
+          >
+            变更
+          </el-link>
           <el-popconfirm
             class="ele-action"
             title="确定要删除此质检标准吗?"
             @confirm="remove(row)"
+            v-if="row.isUpdate != 1 && [0, 3].includes(row.approvalStatus)"
           >
             <template v-slot:reference>
               <el-link type="danger" :underline="false" icon="el-icon-delete">
@@ -65,125 +85,159 @@
       </ele-pro-table>
     </el-card>
     <edit ref="edit" @done="done"></edit>
+    <processSubmitDialog
+      :processSubmitDialogFlag.sync="processSubmitDialogFlag"
+      v-if="processSubmitDialogFlag"
+      ref="processSubmitDialogRef"
+      @reload="search"
+    ></processSubmitDialog>
   </div>
 </template>
 <script>
-import search from './components/search.vue';
-import edit from './components/edit.vue';
-import { getList, removeItem } from '@/api/inspectionStandard';
-import dictMixins from '@/mixins/dictMixins';
-import tabMixins from '@/mixins/tableColumnsMixin';
-export default {
-  mixins: [dictMixins, tabMixins],
-  components: {
-    search,
-    edit
-  },
-  data() {
-    return {
-      
-      cacheKeyUrl: 'qsm-c2e9664a-inspectionStandard',
-      columns: [
-        {
-          width: 55,
-          type: 'index',
-          label: '序号',
-          columnKey: 'index',
-          align: 'center'
-        },
-        {
-          width: 70,
-          prop: 'sort',
-          label: '排序',
-          align: 'center'
-        },
-        {
-          prop: 'code',
-          label: '标准编码',
-          slot: 'code',
-          align: 'center'
-        },
-        {
-          label: '标准名称',
-          prop: 'name',
-          align: 'center'
-        },
-        {
-          label: '标准类型',
-          prop: 'type',
-          slot: 'type',
-          align: 'center'
-        },
-        {
-          label: '标准代码',
-          prop: 'standardCode',
-          align: 'center'
-        },
-        {
-          label: '状态',
-          prop: 'status',
-          slot: 'status',
-          align: 'center'
-        },
-        {
-          label: '版本号',
-          prop: 'version',
-          align: 'center'
-        },
-        {
-          label: '创建时间',
-          prop: 'createTime',
-          align: 'center'
-        },
-        {
-          label: '创建人',
-          prop: 'createUserName',
-          align: 'center'
-        },
-        {
-          columnKey: 'action',
-          label: '操作',
-          width: 220,
-          align: 'center',
-          resizable: false,
-          slot: 'action',
-          showOverflowTooltip: true
-        }
-      ]
-    };
-  },
-  created() {
-    this.requestDict('质检标准类型');
-  },
-  methods: {
-    datasource({ page, where, limit }) {
-      return getList({
-        ...where,
-        pageNum: page,
-        size: limit
-      });
-    },
-    search(where) {
-      this.$refs.table.reload({
-        where: where,
-        page: 1
-      });
+  import search from './components/search.vue';
+  import edit from './components/edit.vue';
+  import { getList, removeItem, getById } from '@/api/inspectionStandard';
+  import dictMixins from '@/mixins/dictMixins';
+  import tabMixins from '@/mixins/tableColumnsMixin';
+  import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
+
+  export default {
+    mixins: [dictMixins, tabMixins],
+    components: {
+      search,
+      edit,
+      processSubmitDialog
     },
-    openEdit(type, row) {
-      this.$refs.edit.open(type, row);
+    data() {
+      return {
+        cacheKeyUrl: 'qsm-c2e9664a-inspectionStandard',
+        processSubmitDialogFlag: false,
+        columns: [
+          {
+            width: 55,
+            type: 'index',
+            label: '序号',
+            columnKey: 'index',
+            align: 'center'
+          },
+          {
+            width: 70,
+            prop: 'sort',
+            label: '排序',
+            align: 'center'
+          },
+          {
+            prop: 'code',
+            label: '标准编码',
+            slot: 'code',
+            align: 'center'
+          },
+          {
+            label: '标准名称',
+            prop: 'name',
+            align: 'center'
+          },
+          {
+            label: '标准类型',
+            prop: 'type',
+            slot: 'type',
+            align: 'center'
+          },
+          {
+            label: '标准代码',
+            prop: 'standardCode',
+            align: 'center'
+          },
+          {
+            label: '是否启用',
+            prop: 'status',
+            slot: 'status',
+            align: 'center'
+          },
+          {
+            label: '版本号',
+            prop: 'version',
+            align: 'center'
+          },
+          {
+            label: '创建时间',
+            prop: 'createTime',
+            align: 'center'
+          },
+          {
+            label: '创建人',
+            prop: 'createUserName',
+            align: 'center'
+          },
+          {
+            label: '状态',
+            prop: 'approvalStatus',
+            formatter: (row) => {
+             return row.approvalStatus == 0 ? '待发布' : row.approvalStatus == 1 ? '审批中' : row.approvalStatus == 2 ? '已发布' :'审核不通过'
+            },
+            align: 'center'
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 220,
+            align: 'center',
+            resizable: false,
+            fixed: 'right',
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ]
+      };
     },
-
-    remove(row) {
-      removeItem([row.id])
-        .then((message) => {
-          this.$message.success(message);
-          this.done();
-        })
-        .catch((e) => {});
+    created() {
+      this.requestDict('质检标准类型');
     },
-    done() {
-      this.$refs.search.search();
+    methods: {
+      datasource({ page, where, limit }) {
+        return getList({
+          ...where,
+          pageNum: page,
+          size: limit
+        });
+      },
+      search(where) {
+        this.$refs.table.reload({
+          where: where,
+          page: 1
+        });
+      },
+      openEdit(type, row,isChange) {
+        this.$refs.edit.open(type, row,isChange);
+      },
+      async approvalSubmit(res) {
+        // const res = await getById(id);
+        this.processSubmitDialogFlag = true;
+        this.$nextTick(() => {
+          let params = {
+            businessId: res.id,
+            businessKey: 'qms_standard_release',
+            formCreateUserId: res.createUserId,
+            variables: {
+              businessCode: res.code,
+              businessName: res.name,
+              businessType: this.getDictValue('质检标准类型', res.type)
+            }
+          };
+          this.$refs.processSubmitDialogRef.init(params);
+        });
+      },
+      remove(row) {
+        removeItem([row.id])
+          .then((message) => {
+            this.$message.success(message);
+            this.done();
+          })
+          .catch((e) => {});
+      },
+      done() {
+        this.$refs.search.search();
+      }
     }
-  }
-};
+  };
 </script>

+ 4 - 3
src/views/inspectionWork/components/experimentReport.vue

@@ -40,7 +40,7 @@
         :columns="workColumns"
         :datasource="tableData"
       >
-        <template v-slot:toolbar>
+        <template v-slot:toolbar v-if="type != 'detail'">
           当前质检剩余样品数:{{ getSampleQuantityCount1 }}
         </template>
         <template v-slot:sampleQuantity="{ row, $index }">
@@ -383,7 +383,7 @@
 
     <template v-slot:footer>
       <el-button size="small" @click="handleClose">关闭</el-button>
-      <el-button type="primary" size="small" @click="save">保存</el-button>
+      <el-button type="primary" size="small" @click="save" v-if="type!='detail'">保存</el-button>
       <!-- <el-button type="primary" size="small" @click="submit">提交</el-button> -->
     </template>
     <releaseRules
@@ -603,8 +603,9 @@
     },
     watch: {},
     methods: {
-      async open(row) {
+      async open(row,type) {
         this.tableData = [row];
+        this.type = type;
         console.log(row, 'dasd');
         this.getSampleQuantityCount = row.getSampleQuantityCount;
         if (row.experimentId) {

+ 12 - 6
src/views/inspectionWork/components/inspectionProjectReport.vue

@@ -83,11 +83,7 @@
         </el-select>
       </template>
       <template v-slot:useTools="{ row }">
-        <toolButtom
-          v-model="row.useTools"
-          :type="type"
-          :sList="row.toolList"
-        />
+        <toolButtom v-model="row.useTools" :type="type" :sList="row.toolList" />
       </template>
       <template v-slot:qualityResultContent="{ row }">
         <el-input
@@ -714,7 +710,8 @@
           });
           if (row.sampleQuantity) {
             this.form.remainingSampleCount =
-              row.sampleQuantity + this.form.remainingSampleCount;
+              Number(row.sampleQuantity) +
+              Number(this.form.remainingSampleCount);
           }
         } else {
           this.$set(this, 'form', JSON.parse(JSON.stringify(workData)));
@@ -741,6 +738,9 @@
         this.visible = true;
       },
       formSampleQuantityChange() {
+        if (this.form.sampleQuantity < 0) {
+          this.form.sampleQuantity = 0;
+        }
         if (this.form.sampleQuantity > this.form.remainingSampleCount) {
           this.form.sampleQuantity = this.form.remainingSampleCount;
         }
@@ -760,6 +760,9 @@
         this.form.sampleNoQualifiedNumber = 0;
       },
       formSampleNoQualifiedNumberChange() {
+        if (this.form.sampleNoQualifiedNumber < 0) {
+          this.form.sampleNoQualifiedNumber = 0;
+        }
         if (this.form.sampleNoQualifiedNumber > this.form.sampleQuantity) {
           this.form.sampleNoQualifiedNumber = this.form.sampleQuantity;
         }
@@ -804,6 +807,9 @@
         }
       },
       inputValue(type, item, index) {
+        if (item[type] < 0) {
+          item[type] = 0;
+        }
         //样品数
         if (type == 'sampleQuantity') {
           this.isSampleQuantity(item, index);

+ 108 - 2
src/views/inspectionWork/components/newQualityContentTabs.vue

@@ -480,6 +480,18 @@
               </div>
             </template>
           </el-table-column>
+
+          <el-table-column
+            label="执行方法"
+            prop="executionMethod"
+            align="center"
+            :show-overflow-tooltip="true"
+            v-if="form.recordingMethod == 1"
+          >
+            <template slot-scope="scope">
+              {{ scope.row.executionMethod == 1 ? '常规' : '实验' }}
+            </template></el-table-column
+          >
           <el-table-column
             label="质检状态"
             prop="status"
@@ -589,6 +601,20 @@
         >
         </ele-pro-table>
       </el-tab-pane>
+
+      <el-tab-pane label="工艺文件" name="6">
+        <ele-pro-table
+          ref="fileTable"
+          :columns="jobColumns1"
+          :datasource="fileTableList"
+          :need-page="false"
+          :immediate="true"
+        >
+          <template v-slot:action="{ row, $index }">
+            <el-link type="primary" @click="fileDetails(row)">预览</el-link>
+          </template>
+        </ele-pro-table>
+      </el-tab-pane>
     </el-tabs>
   </el-row>
 </template>
@@ -606,7 +632,8 @@
     exeReportWork,
     queryQualitySamplContent,
     queryQualityTempleContent,
-    queryQualityInventory
+    queryQualityInventory,
+    newFilePageAPI
   } from '@/api/inspectionWork';
   import { getQualityTemplateByIds } from '@/api/inspectionTemplate';
   import { getCodeList } from '@/api/login';
@@ -641,6 +668,7 @@
       packingList: Array,
       sampleList: Array,
       schemeList: Array,
+      fileParam: Array,
       loading: Boolean,
       form: Object,
       ids: String,
@@ -654,6 +682,7 @@
     data() {
       return {
         // 不良品类型列表
+        fileTableList: [],
         badTypeList: [],
         // 不良名称列表
         badNameList: [],
@@ -976,6 +1005,62 @@
             showOverflowTooltip: true
           }
         ],
+        // 表格选中数据
+        jobColumns1: [
+          {
+            label: '编码',
+            prop: 'code',
+            width: 180,
+            align: 'center',
+            showOverflowTooltip: true
+          },
+
+          {
+            prop: 'name',
+            label: '文档名称',
+            align: 'center',
+            slot: 'name',
+            showOverflowTooltip: true,
+            minWidth: 200
+          },
+
+          {
+            prop: 'storagePath',
+            label: '文件名称',
+            align: 'center',
+
+            showOverflowTooltip: true,
+            minWidth: 200,
+            formatter: (_row, _column, cellValue) => {
+              return cellValue[0]?.name;
+            }
+          },
+
+          {
+            prop: 'version',
+            label: '版本',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 100
+          },
+
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            showOverflowTooltip: true,
+            align: 'center',
+            minWidth: 110
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 100,
+            align: 'center',
+            resizable: false,
+            slot: 'action',
+            showOverflowTooltip: true
+          }
+        ],
         conditionType: null,
         formData: {
           number: 1,
@@ -1207,7 +1292,28 @@
         }
       });
     },
+    mounted() {
+      if (this.fileParam.length) {
+        this.fileParamDatasource(this.fileParam);
+      }
+    },
+
     methods: {
+      //工艺文件表格回显
+      fileParamDatasource(fileParam) {
+        let fileId = fileParam.map((item) => item.id).join(',');
+        newFilePageAPI({
+          // pageNum: 1,
+          // size: 999,
+          // directoryId: null,
+          // lcyStatus: 1,
+          // fileType: 0,
+          // ids: fileId
+          ids: "'" + fileId + "'"
+        }).then((res) => {
+          this.fileTableList = res;
+        });
+      },
       // 不良类型改变
       badTypeChange(row) {
         row.badTypeName = null;
@@ -1242,7 +1348,7 @@
       async getBadNameList() {
         const res = await getBadNameList({
           pageNum: 1,
-          size: 999,
+          size: 999
         });
         this.badNameList = res.list;
       },

+ 31 - 11
src/views/inspectionWork/details.vue

@@ -60,12 +60,12 @@
             <el-row>
               <el-col :span="6" v-if="form.qualityType == 2">
                 <el-form-item label="执行班组" prop="executeJobName">
-                  <el-input :value="executeJobName" disabled />
+                  <el-input :value="form.executeJobName" disabled />
                 </el-form-item>
               </el-col>
               <el-col :span="6">
                 <el-form-item label="执行人" prop="executeUserName">
-                  <el-input :value="executeUserName" disabled />
+                  <el-input :value="form.executeUserName" disabled />
                 </el-form-item>
               </el-col>
               <el-col :span="6">
@@ -88,8 +88,8 @@
                   <el-input :value="form.qualificationRate" disabled />
                 </el-form-item>
               </el-col>
-            <!-- </el-row> -->
-            <!-- <el-row> -->
+              <!-- </el-row> -->
+              <!-- <el-row> -->
               <el-col :span="6">
                 <el-form-item label="不合格率">
                   <el-input :value="form.noQualificationRate" disabled />
@@ -110,8 +110,8 @@
                   <el-input :value="form.totalWeight" disabled />
                 </el-form-item>
               </el-col>
-            <!-- </el-row> -->
-            <!-- <el-row> -->
+              <!-- </el-row> -->
+              <!-- <el-row> -->
               <el-col :span="6">
                 <el-form-item label="总数量">
                   <el-input :value="form.total" disabled />
@@ -133,8 +133,8 @@
                   <el-input :value="form.noQualifiedNumber" disabled />
                 </el-form-item>
               </el-col>
-            <!-- </el-row> -->
-            <!-- <el-row> -->
+              <!-- </el-row> -->
+              <!-- <el-row> -->
               <el-col :span="6">
                 <el-form-item label="规格">
                   <el-input :value="form.specification" disabled />
@@ -308,8 +308,16 @@
                 :toolkit="[]"
                 height="calc(100vh - 330px)"
               >
-              </ele-pro-table
-            ></el-tab-pane>
+                <template v-slot:experimentCode="scope">
+                  <el-link
+                    type="primary"
+                    :underline="false"
+                    @click="experimentReport(scope.row)"
+                    >{{ scope.row.experimentCode }}
+                  </el-link>
+                </template>
+              </ele-pro-table></el-tab-pane
+            >
           </el-tabs>
         </el-tab-pane>
         <el-tab-pane
@@ -342,6 +350,7 @@
       <el-button class="go_back" @click="goBack">返回</el-button>
     </el-card>
     <sampleListDialog ref="detailRef"></sampleListDialog>
+    <experimentReport ref="experimentReport"></experimentReport>
   </div>
 </template>
 
@@ -354,10 +363,11 @@
   import { getUserPage } from '@/api/system/organization';
   import { recordingMethodList } from '@/utils/util.js';
   import sampleListDialog from './components/sampleListDialog.vue';
+  import experimentReport from './components/experimentReport.vue';
 
   export default {
     mixins: [detailMixins],
-    components: { sampleListDialog },
+    components: { sampleListDialog, experimentReport },
     data() {
       return {
         activeName: '1',
@@ -571,6 +581,16 @@
         }
         return '';
       },
+      experimentReport(row) {
+        this.$refs.experimentReport.open(
+          {
+            ...row,
+            batchNo: this.form.batchNo,
+            qualityWorkOrderId: this.form.id
+          },
+          'detail'
+        );
+      },
       goBack() {
         let path = this.$route.query.path || '';
         console.log(path, 'path');

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

@@ -201,6 +201,7 @@
         :form="form"
         :productId="productId"
         :status="statusType"
+        :fileParam="form.fileParam"
         @handleSelectionChange="handleSelectionChange1"
         @batch-quality="batchQuality"
         @batch-dispose="batchDispose"
@@ -855,7 +856,8 @@
           ...this.schemeList.filter((item) => item.correlationId)
         ];
         data.type = 2;
-        this.form.taskMonadInfo = data;
+         this.form.remainingSampleCount= this.form.remainingSampleCount-data.sampleQuantity;
+        this.form.taskMonadInfo = data
         this.form.hours = data.hours;
       },
       // 切换检验方式为全检后生成样品

+ 24 - 2
src/views/inspectionWork/index.vue

@@ -84,15 +84,25 @@
             v-if="
               $hasPermission('qms:samplingrecord:save') &&
               ![1, 2].includes(row.status) &&
-              row.sampleQuantity < row.total
+              row.sampleQuantity < row.total &&
+              row.isPendingSample != 1
             "
             >请样</el-link
           >
+          <el-link
+            type="primary"
+            :underline="false"
+            @click="sampleCollection(row)"
+            v-if="![1, 2].includes(row.status) && row.isPendingSample == 1"
+            >收样</el-link
+          >
           <el-link
             type="primary"
             :underline="false"
             v-if="
-              row.status == 0 && $hasPermission('qms:quality_work_order:update')
+              row.status == 0 &&
+              $hasPermission('qms:quality_work_order:update') &&
+              row.isPendingSample != 1
             "
             @click="openEdit('edit', row)"
             >报工</el-link
@@ -293,6 +303,7 @@
     closeWorkList,
     verificationQualityInspector,
     closeWork,
+    sampleCollection,
     checkByQualityWorkOrderId
   } from '@/api/inspectionWork';
   import { queryTodo } from '@/api/bpm/task';
@@ -721,6 +732,17 @@
         }
         this.$refs.addSampleRef.open('add', row);
       },
+      async sampleCollection(row) {
+        const code = await verificationQualityInspector(row.id);
+        if (code == '-1') {
+          return;
+        }
+
+        sampleCollection({ id: row.id }).then((res) => {
+          this.$message.success('收样成功');
+          this.reload();
+        });
+      },
       // 批量关闭
       batchClose() {
         const validRows = this.selection.filter(

+ 83 - 0
src/views/inspectionWork/mixins/detailMixins.js

@@ -140,6 +140,14 @@ export default {
           align: 'center',
           label: '留样数(不合格品)',
           showOverflowTooltip: true
+        },
+        {
+          prop: 'executeJobName',
+          label: '执行班组'
+        },
+        {
+          prop: 'executeUserName',
+          label: '执行人'
         }
       ],
       disposeTypeMap: {
@@ -779,6 +787,81 @@ export default {
           showOverflowTooltip: true,
           slot: 'defaultValue'
         },
+        {
+          label: '执行方法',
+          prop: 'executionMethod',
+          align: 'center',
+          showOverflowTooltip: true,
+          show: this.form.recordingMethod == 1,
+          formatter: (row) => {
+            return row.executionMethod == 1 ? '常规检验' : '实验';
+          }
+        },
+        {
+          minWidth: 200,
+          prop: 'qualityResultContent',
+          align: 'center',
+          headerSlot: 'isRequired',
+          label: '质检内容',
+          showOverflowTooltip: true
+        },
+        {
+          minWidth: 120,
+          prop: 'sampleQuantity',
+          align: 'center',
+          label: '样品数',
+          showOverflowTooltip: true
+        },
+        {
+          minWidth: 120,
+          prop: 'qualifiedQuantity',
+          align: 'center',
+          label: '合格数',
+          showOverflowTooltip: true
+        },
+        {
+          minWidth: 130,
+          prop: 'noQualifiedQuantity',
+          align: 'center',
+          label: '不合格数',
+          showOverflowTooltip: true
+        },
+        {
+          minWidth: 140,
+          prop: 'lossNumber',
+          align: 'center',
+          label: '损耗数(合格品)',
+          showOverflowTooltip: true
+        },
+        {
+          minWidth: 150,
+          prop: 'lossNumberUnqualified',
+          align: 'center',
+          label: '损耗数(不合格品)',
+          showOverflowTooltip: true
+        },
+        {
+          minWidth: 140,
+          prop: 'retainedSampleQuantity',
+          align: 'center',
+          label: '留样数(合格品)',
+          showOverflowTooltip: true
+        },
+        {
+          minWidth: 150,
+          prop: 'retainedSampleUnqualified',
+          align: 'center',
+          label: '留样数(不合格品)',
+          showOverflowTooltip: true
+        },
+        {
+          minWidth: 150,
+          prop: 'experimentCode',
+          slot: 'experimentCode',
+          align: 'center',
+          label: '实验编号',
+          showOverflowTooltip: true
+        },
         {
           label: '质检状态',
           prop: 'status',

+ 1 - 1
src/views/sample/sampleRecord/components/addSample.vue

@@ -1268,7 +1268,7 @@
             variables: {
               businessCode: res.code,
               businessName: '请样',
-              businessType: res.conditionType == 1 ? '整样' : '小样'
+              businessType: res.qualityWorkOrderVO.conditionType == 1 ? '整样' : '小样'
             }
           };
           this.$refs.processSubmitDialogRef.init(params);

+ 1 - 1
src/views/sample/sampleRecord/index.vue

@@ -396,7 +396,7 @@
             formCreateUserId: res.createUserId,
             variables: {
               businessCode: res.code,
-              businessName: '样',
+              businessName: '样',
               businessType: res.conditionType == 1 ? '整样' : '小样'
             }
           };