Ver Fonte

Merge branch 'master' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-wt into dengfei

695593266@qq.com há 1 semana atrás
pai
commit
780ee1d6fe

+ 1 - 4
lib/vue-form-making/src/components/GenerateElementItem.vue

@@ -550,8 +550,7 @@
           :ref="'fm-'+widget.model"
           @focus="handleOnFocus"
           @blur="handleOnBlur"
-          :props="{multiple: widget.options.multiple, checkStrictly: widget.options.checkStrictly, ...(extendProps.props ?? {})}"
-          collapse-tags
+          :props="{multiple: widget.options.multiple, checkStrictly: widget.options.checkStrictly, ...(extendProps.props ?? {})}"    
           :filterable="widget.options.filterable"
           v-bind="{...widget.options.customProps, ...extendProps}"
         >
@@ -588,7 +587,6 @@
           @focus="handleOnFocus"
           @blur="handleOnBlur"
           :props="{multiple: widget.options.multiple, checkStrictly: widget.options.checkStrictly, ...(extendProps.props ?? {})}"
-          collapse-tags
           :filterable="widget.options.filterable"
           v-bind="{...widget.options.customProps, ...extendProps}"
         >
@@ -625,7 +623,6 @@
           @focus="handleOnFocus"
           @blur="handleOnBlur"
           :props="{multiple: widget.options.multiple, checkStrictly: widget.options.checkStrictly, ...(extendProps.props ?? {})}"
-          collapse-tags
           :filterable="widget.options.filterable"
           v-bind="{...widget.options.customProps, ...extendProps}"
         >

+ 62 - 17
src/BIZComponents/processSubmitDialog/components/businessTripComponent.vue

@@ -84,7 +84,7 @@
             top="5vh"
             :close-on-press-escape="false"
             append-to-body
-            width="70%"
+            width="50%"
             :maxable="true"
             destroy-on-close
         >
@@ -100,10 +100,18 @@
                             trigger: 'change'
                         }"
                     >
-                        <el-input
+                        <el-select
+                            style="width: 100%;"
                             v-model="form.transportation"
-                            placeholder="请输入"
-                        ></el-input>
+                            placeholder="请选择"
+                        >
+                            <el-option
+                                v-for="item in transportationOptions"
+                                :key="item.value"
+                                :label="item.label"
+                                :value="item.value"
+                            ></el-option>
+                        </el-select>
                     </el-form-item>
         
                     <el-form-item
@@ -116,10 +124,18 @@
                             trigger: 'change'
                         }"
                     >
-                        <el-input
+                        <el-select
+                            style="width: 100%;"
                             v-model="form.isRoundTrip"
-                            placeholder="请输入"
-                        ></el-input>
+                            placeholder="请选择"
+                        >
+                            <el-option
+                                v-for="item in isRoundTripOptions"
+                                :key="item.value"
+                                :label="item.label"
+                                :value="item.value"
+                            ></el-option>
+                        </el-select>
                     </el-form-item>
                     <el-form-item 
                         label="出发城市" 
@@ -131,10 +147,11 @@
                                 trigger: 'change'
                             }"
                     >
-                        <el-input
+                        <!-- <el-input
                             v-model="form.departureCity"
                             placeholder="请输入"
-                        ></el-input>
+                        ></el-input> -->
+                        <regions-select style="width: 100%;" valueField="label" v-model="form.departureCity" type="provinceCity" placeholder="请选择省市区"/>
                     </el-form-item>
                     <el-form-item 
                         label="目的城市" 
@@ -146,10 +163,11 @@
                                 trigger: 'change'
                             }"
                     >
-                        <el-input
+                        <!-- <el-input
                             v-model="form.destinationCity"
                             placeholder="请输入"
-                        ></el-input>
+                        ></el-input> -->
+                        <regions-select style="width: 100%;" valueField="label" v-model="form.destinationCity" type="provinceCity" placeholder="请选择省市区"/>
                     </el-form-item>
                     <el-form-item 
                         label="开始时间" 
@@ -193,11 +211,6 @@
                         label="时长" 
                         label-width="110px" 
                         prop="duration"
-                        :rules="{
-                                required: true,
-                                message: '请选择开始/结束时间',
-                                trigger: 'change'
-                            }"
                     >
                         <el-input
                             v-model="form.duration"
@@ -216,7 +229,11 @@
     </div>
 </template>
 <script>
+import RegionsSelect from '@/components/RegionsSelect/index.vue';
 export default {
+    components: {
+        RegionsSelect
+    },
     props: {
         info: {
             type: Object,
@@ -269,7 +286,35 @@ export default {
             visible: false,
             currentItem: {},
             currentIndex: null,
-            type: 'add'
+            type: 'add',
+            transportationOptions: [
+                {
+                    label: '飞机',
+                    value: '飞机'
+                },
+                {
+                    label: '火车',
+                    value: '火车'
+                },
+                {
+                    label: '汽车',
+                    value: '汽车'
+                },
+                {
+                    label: '其他',
+                    value: '其他'
+                }
+            ],
+            isRoundTripOptions: [
+                {
+                    label: '单程',
+                    value: '单程'
+                },
+                {
+                    label: '往返',
+                    value: '往返'
+                }
+            ]
         }
     },
     mounted() {

+ 1 - 1
src/BIZComponents/processSubmitDialog/components/eventComponent.vue

@@ -111,7 +111,7 @@
                         <el-input
                             v-model="form.eventDesc"
                             type="textarea"
-                            placeholder="请输入"
+                            placeholder="含患者信息及使用目的、问题点及出现问题的场景描述"
                             :autosize="{ minRows: 2, maxRows: 4}"
                         ></el-input>
                     </el-form-item>

+ 9 - 3
src/BIZComponents/processSubmitDialog/processSubmitDialog.vue

@@ -993,11 +993,17 @@ this.postOptions.push(...response.data);
             }
           });
 
-          // 检查每个组件的数据是否为空数组
+          // 检查每个组件的数据是否为空
           let emptyComponents = [];
           validArr.forEach((item) => {
-            // 检查data[item]是否存在且为数组,并且长度为0
-            if (Array.isArray(data[item]) && data[item].length === 0) {
+            const val = data[item];
+            // 为空(null/undefined/空字符串)或为数组且长度为0,均视为未填写
+            if (
+              val === null ||
+              val === undefined ||
+              val === '' ||
+              (Array.isArray(val) && val.length === 0)
+            ) {
               emptyComponents.push(item);
             }
           });

+ 18 - 5
src/api/bpm/components/qualityReportApproval/qualityReportApproval.js

@@ -4,7 +4,10 @@ import request from '@/utils/request';
  * 质检报告基本信息
  */
 export async function getDetail(id) {
-  const res = await request.get(`/qms/quality_work_order/queryInspectionReportData/${id}`, {});
+  const res = await request.get(
+    `/qms/quality_work_order/queryInspectionReportData/${id}`,
+    {}
+  );
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -15,7 +18,10 @@ export async function getDetail(id) {
  * 质检报告质检项列表信息
  */
 export async function getListDetail(id) {
-  const res = await request.get(`/qms/quality_work_order/queryInspectionReportList/${id}`, {});
+  const res = await request.get(
+    `/qms/quality_work_order/queryInspectionReportList/${id}`,
+    {}
+  );
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -31,7 +37,6 @@ export async function getDetailById(id) {
   return Promise.reject(new Error(res.data.message));
 }
 
-
 // 获取合格证详情
 export async function getCertifiById(id) {
   const res = await request.get(`/qms/qmscertificatemanagement/getById/${id}`);
@@ -41,7 +46,6 @@ export async function getCertifiById(id) {
   return Promise.reject(new Error(res.data.message));
 }
 
-
 // 根据检测工单id获取清单列表
 export async function queryQualityInventory(data) {
   const res = await request.post(
@@ -128,4 +132,13 @@ export async function getReasontypeList(data) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
-}
+}
+
+//修改
+export async function updateData(data) {
+  const res = await request.put('/qms/unqualifiedproducts/update', data);
+  if (res.data.code == 0) {
+    return res.data.message;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 9 - 0
src/api/bpm/task.js

@@ -378,4 +378,13 @@ export function withdrawTask(query) {
     method: 'get',
     params: query
   });
+}
+
+// 我的抄送已读未读
+export function ccReaderTask(query) {
+  return request({
+    url: 'bpm/task/cc-reader',
+    method: 'post',
+    data: query 
+  });
 }

+ 134 - 0
src/components/upload/imageUpload.vue

@@ -0,0 +1,134 @@
+<template>
+  <div class="image-upload">
+    <div class="image-preview" v-for="(url, index) in imageUrls" :key="index">
+      <el-image
+        style="width: 100px; height: 100px"
+        :src="url"
+        :preview-src-list="imageUrls"
+      >
+      </el-image>
+      <div class="image-actions">
+        <el-button type="text" @click="handleRemove(index)" v-if="!disabled"
+          >删除</el-button
+        >
+      </div>
+    </div>
+    <el-upload
+      v-if="!limit || value.length < limit"
+      class="image-uploader"
+      action="#"
+      accept="image/png,image/jpeg,image/jpg"
+      :show-file-list="false"
+      :http-request="handleUpload"
+      :multiple="multiple"
+      :disabled="disabled"
+      :limit="limit"
+    >
+      <i class="el-icon-plus image-uploader-icon"></i>
+    </el-upload>
+  </div>
+</template>
+
+<script>
+  import { uploadFile } from '@/api/system/file/index';
+  import { getFmImagePath } from '@/utils/file';
+
+  export default {
+    props: {
+      value: {
+        type: Array,
+        default: () => []
+      },
+      module: {
+        type: String,
+        default: 'main'
+      },
+      disabled: {
+        type: Boolean,
+        default: false
+      },
+      multiple: {
+        type: Boolean,
+        default: true
+      },
+      limit: {
+        type: Number,
+        default: 0
+      }
+    },
+    computed: {
+      imageUrls() {
+        return (this.value || [])
+          .map((item) => {
+            const path = typeof item === 'string' ? item : item.url || '';
+            return path ? getFmImagePath(path) : '';
+          })
+          .filter(Boolean);
+      }
+    },
+    methods: {
+      async handleUpload(params) {
+        const file = params.file;
+        if (!file.type.startsWith('image/')) {
+          this.$message.error('只能上传图片文件');
+          return;
+        }
+        // if (file.size / 1024 / 1024 > 2) {
+        //   this.$message.error('图片大小不能超过 2MB');
+        //   return;
+        // }
+        try {
+          const res = await uploadFile({
+            module: this.module,
+            multiPartFile: file
+          });
+          if (res.data && res.data.storePath) {
+            const newList = [...this.value, res.data.storePath];
+            this.$emit('input', newList);
+            this.$message.success('上传成功');
+          }
+        } catch (error) {
+          this.$message.error('上传失败');
+        }
+      },
+      handleRemove(index) {
+        const newList = [...this.value];
+        newList.splice(index, 1);
+        this.$emit('input', newList);
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .image-upload {
+    display: flex;
+    align-items: flex-start;
+    flex-wrap: wrap;
+    gap: 10px;
+  }
+  .image-preview {
+    display: flex;
+    flex-direction: column;
+    align-items: center;
+  }
+  .image-actions {
+    margin-top: 5px;
+  }
+  .image-uploader {
+    .image-uploader-icon {
+      font-size: 28px;
+      color: #8c939d;
+      width: 100px;
+      height: 100px;
+      line-height: 100px;
+      text-align: center;
+      border: 1px dashed #d9d9d9;
+      border-radius: 6px;
+      cursor: pointer;
+      &:hover {
+        border-color: #409eff;
+      }
+    }
+  }
+</style>

+ 13 - 0
src/utils/file.js

@@ -22,6 +22,19 @@ export function getImagePath(url) {
 
   return (match && match[1].split('&')[0]) || '';
 }
+// 从反显url上获取接口需要path
+export function getFmImagePath(url) {
+  if (!url) return;
+  let fileNames = url.split('/');
+
+  return (
+    window.location.origin +
+    '/api/main/file/getFile?objectName=' +
+    url +
+    '&fullfilename=' +
+    fileNames[fileNames.length - 1]
+  );
+}
 
 // 下载方法
 export function download(data, name) {

+ 44 - 3
src/views/bpm/carbonCopy/index.vue

@@ -38,9 +38,17 @@
                 />
               </el-form-item>
             </el-col>
+            <el-col v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }">
+              <el-form-item label="是否已读:" prop="isRead">
+                <el-select style="width: 100%" v-model="params.isRead" placeholder="请选择">
+                  <el-option label="已读" value="1"></el-option>
+                  <el-option label="未读" value="0"></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
             <el-col
               style="display: flex; justify-content: flex-end"
-              v-bind="styleResponsive ? { lg: 6, md: 12 } : { span: 6 }"
+              v-bind="styleResponsive ? { lg: 24, md: 24 } : { span: 6 }"
             >
               <div class="ele-form-actions">
                 <el-button
@@ -90,7 +98,9 @@
           {{ getDateTime(row.durationInMillis) }}
         </template>
         <template v-slot:name="{ row }">
+          <span class="dot" v-if="row.isRead == 0"></span>
           <el-link type="primary" :underline="false" @click="handleAudit(row)">
+            
             {{ row.name }}</el-link
           >
         </template>
@@ -112,7 +122,7 @@
 
 <script>
   import dictMixins from '@/mixins/dictMixins';
-  import { ccPage } from '@/api/bpm/task';
+  import { ccPage, ccReaderTask } from '@/api/bpm/task';
   import { getDate } from '@/utils/dateUtils';
   import detail from '@/views/bpm/done/detailDialog.vue';
 
@@ -236,6 +246,16 @@
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 130
+          },
+          {
+            prop: 'isRead',
+            label: '是否已读',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 130,
+            formatter: (row) => {
+              return row.isRead == 1 ? '已读' : '未读';
+            }
           }
         ]
       };
@@ -267,7 +287,15 @@
         this.reload();
       },
       /** 处理审批按钮 */
-      handleAudit(row) {
+      async handleAudit(row) {
+        const readStatus = await ccReaderTask({
+          id: row.id
+        });
+
+        console.log('readStatus~~', readStatus);
+        if(readStatus) {
+          row.isRead = 1;
+        }
         const params = {
           ...row,
           processInstance: {
@@ -307,3 +335,16 @@
     }
   };
 </script>
+
+<style scoped>
+.dot {
+  display: inline-block;
+  width: 5px;
+  height: 5px;
+  background-color: red;
+  border-radius: 50%;
+  position: absolute;
+  top: 10px;
+  left: 4px;
+}
+</style>

+ 210 - 167
src/views/bpm/collaborative/index.vue

@@ -59,6 +59,112 @@
               v-model="activeName"
             >
               <el-tab-pane label="个人记录" name="user">
+                <div class="filter-container">
+                  <el-form
+                    class="ele-form-search"
+                    @keyup.enter.native="reload"
+                    @submit.native.prevent
+                  >
+                    <el-row
+                      :gutter="15"
+                      style="display: flex; align-items: center"
+                    >
+                      <el-col v-bind="{ span: 4 }">
+                        <el-form-item label="分类:" label-width="60px">
+                          <el-select v-model="params.dictType" @change="changeDictTypeChange">
+                            <el-option
+                              v-for="(item, index) in dictList[
+                                'collaborative_type'
+                              ]"
+                              :key="index"
+                              :value="item.value"
+                              :label="item.label"
+                            ></el-option>
+                          </el-select>
+                        </el-form-item>
+                      </el-col>
+                      <el-col v-bind="{ span: 4 }">
+                        <el-form-item label="单据:" label-width="60px">
+                          <el-select v-model="params.formId" @change="changeFormIdChange">
+                            <el-option
+                              v-for="(item, index) in templateList[
+                                currentDictType
+                              ]"
+                              :key="index"
+                              :value="item.id"
+                              :label="item.name"
+                            ></el-option>
+                          </el-select>
+                        </el-form-item>
+                      </el-col>
+                      <el-col v-bind="{ span: 4 }">
+                        <el-form-item
+                          label="结果:"
+                          prop="result"
+                          label-width="60px"
+                        >
+                          <!-- <el-select
+                            v-model="params.status"
+                            placeholder="请选择状态"
+                            clearable
+                          >
+                            <el-option
+                              v-for="dict in statusList"
+                              :key="dict.value"
+                              :label="dict.label"
+                              :value="dict.value"
+                            />
+                          </el-select> -->
+                          <DictSelection
+                            dictName="流程实例的结果"
+                            clearable
+                            v-model="params.result"
+                          >
+                          </DictSelection>
+                        </el-form-item>
+                      </el-col>
+                      <el-col v-bind="{ span: 6 }">
+                        <el-form-item
+                          label="创建时间:"
+                          prop="createTime1"
+                          label-width="90px"
+                        >
+                          <el-date-picker
+                            v-model="createTime1"
+                            style="width: 100%"
+                            value-format="yyyy-MM-dd HH:mm:ss"
+                            type="daterange"
+                            range-separator="-"
+                            start-placeholder="开始日期"
+                            end-placeholder="结束日期"
+                            :default-time="['00:00:00', '23:59:59']"
+                          />
+                        </el-form-item>
+                      </el-col>
+                      <el-col v-bind="{ span: 4 }">
+                        <el-form-item
+                          label=""
+                          prop="createTime1"
+                          label-width="90px"
+                        >
+                          <!-- <div class="filter-container"> -->
+                            <div class="ele-form-actions">
+                              <el-button
+                                type="primary"
+                                icon="el-icon-search"
+                                class="ele-btn-icon"
+                                @click="reload"
+                              >
+                                查询
+                              </el-button>
+                              <el-button @click="reset">重置</el-button>
+                            </div>
+                          <!-- </div> -->
+                        </el-form-item>
+                      </el-col>
+                    </el-row>
+                  </el-form>
+                </div>
                 <ele-pro-table
                   ref="table"
                   height="calc(100vh - 380px)"
@@ -69,108 +175,12 @@
                   :cache-key="cacheKeyUrl"
                   :page-size="20"
                 >
-                  <template v-slot:toolbar="{ row }">
-                    <div class="filter-container">
-                      <el-form
-                        class="ele-form-search"
-                        @keyup.enter.native="reload"
-                        @submit.native.prevent
-                      >
-                        <el-row
-                          :gutter="15"
-                          style="display: flex; align-items: center"
-                        >
-                          <el-col v-bind="{ span: 4 }">
-                            <el-form-item label="分类:" label-width="60px">
-                              <el-select v-model="params.dictType" @change="changeDictTypeChange">
-                                <el-option
-                                  v-for="(item, index) in dictList[
-                                    'collaborative_type'
-                                  ]"
-                                  :key="index"
-                                  :value="item.value"
-                                  :label="item.label"
-                                ></el-option>
-                              </el-select>
-                            </el-form-item>
-                          </el-col>
-                          <el-col v-bind="{ span: 4 }">
-                            <el-form-item label="单据:" label-width="60px">
-                              <el-select v-model="params.formId" @change="changeFormIdChange">
-                                <el-option
-                                  v-for="(item, index) in templateList[
-                                    currentDictType
-                                  ]"
-                                  :key="index"
-                                  :value="item.id"
-                                  :label="item.name"
-                                ></el-option>
-                              </el-select>
-                            </el-form-item>
-                          </el-col>
-                          <el-col v-bind="{ span: 4 }">
-                            <el-form-item
-                              label="结果:"
-                              prop="result"
-                              label-width="60px"
-                            >
-                              <!-- <el-select
-                                v-model="params.status"
-                                placeholder="请选择状态"
-                                clearable
-                              >
-                                <el-option
-                                  v-for="dict in statusList"
-                                  :key="dict.value"
-                                  :label="dict.label"
-                                  :value="dict.value"
-                                />
-                              </el-select> -->
-                              <DictSelection
-                                dictName="流程实例的结果"
-                                clearable
-                                v-model="params.result"
-                              >
-                              </DictSelection>
-                            </el-form-item>
-                          </el-col>
-                          <el-col v-bind="{ span: 10 }">
-                            <el-form-item
-                              label="创建时间:"
-                              prop="createTime1"
-                              label-width="90px"
-                            >
-                              <el-date-picker
-                                v-model="createTime1"
-                                style="width: 100%"
-                                value-format="yyyy-MM-dd HH:mm:ss"
-                                type="daterange"
-                                range-separator="-"
-                                start-placeholder="开始日期"
-                                end-placeholder="结束日期"
-                                :default-time="['00:00:00', '23:59:59']"
-                              />
-                            </el-form-item>
-                          </el-col>
-                        </el-row>
-                      </el-form>
-                    </div>
+                  <!-- <template v-slot:toolbar="{ row }">
+                    
                   </template>
                   <template v-slot:toolkit="{ row }">
-                    <div class="filter-container">
-                      <div class="ele-form-actions">
-                        <el-button
-                          type="primary"
-                          icon="el-icon-search"
-                          class="ele-btn-icon"
-                          @click="reload"
-                        >
-                          查询
-                        </el-button>
-                        <el-button @click="reset">重置</el-button>
-                      </div>
-                    </div>
-                  </template>
+                    
+                  </template> -->
                   <template v-slot:formName="{ row }">
                     <el-link
                       type="primary"
@@ -267,17 +277,7 @@
                 </ele-pro-table>
               </el-tab-pane>
               <el-tab-pane label="部门记录" name="dept" v-if="$hasPermission('wt:collaborative:department')">
-                <ele-pro-table
-                  ref="deptTable"
-                  :columns="deptColumns"
-                  :datasource="deptDatasource"
-                  cache-key="deptDatasource"
-                  :toolkit="[]"
-                  height="calc(100vh - 450px)"
-                  :init-load="false"
-                >
-                  <template v-slot:toolbar="{ row }">
-                    <div class="filter-container">
+                <div class="filter-container">
                       <el-form
                         class="ele-form-search"
                         @keyup.enter.native="deptReload"
@@ -368,25 +368,44 @@
                               />
                             </el-form-item>
                           </el-col>
+                          <el-col v-bind="{ span: 4 }">
+                            <el-form-item
+                              label=""
+                              prop="createTime1"
+                              label-width="90px"
+                            >
+                              <div class="ele-form-actions">
+                                <el-button
+                                  type="primary"
+                                  icon="el-icon-search"
+                                  class="ele-btn-icon"
+                                  @click="deptReload"
+                                >
+                                  查询
+                                </el-button>
+                                <el-button @click="deptReset">重置</el-button>
+                              </div>
+                            </el-form-item>
+                          </el-col>
                         </el-row>
                       </el-form>
                     </div>
+                <ele-pro-table
+                  ref="deptTable"
+                  :columns="deptColumns"
+                  :datasource="deptDatasource"
+                  cache-key="deptDatasource"
+                  height="calc(100vh - 450px)"
+                  :init-load="false"
+                >
+                  <!-- <template v-slot:toolbar="{ row }">
+                    
                   </template>
                   <template v-slot:toolkit="{ row }">
                     <div class="filter-container">
-                      <div class="ele-form-actions">
-                        <el-button
-                          type="primary"
-                          icon="el-icon-search"
-                          class="ele-btn-icon"
-                          @click="deptReload"
-                        >
-                          查询
-                        </el-button>
-                        <el-button @click="deptReset">重置</el-button>
-                      </div>
+                      
                     </div>
-                  </template>
+                  </template> -->
                   <template v-slot:dictType="{ row }">
                     {{ getDictV('collaborative_type', row.dictType) }}
                   </template>
@@ -467,17 +486,7 @@
                 </ele-pro-table>
               </el-tab-pane>
               <el-tab-pane label="通知我的记录" name="notice">
-                <ele-pro-table
-                  ref="noticeTable"
-                  :columns="deptColumns"
-                  :datasource="noticeDatasource"
-                  cache-key="noticeDatasource"
-                  height="calc(100vh - 450px)"
-                  :toolkit="[]"
-                  :init-load="false"
-                >
-                  <template v-slot:toolbar="{ row }">
-                    <div class="filter-container">
+                <div class="filter-container">
                       <el-form
                         class="ele-form-search"
                         @keyup.enter.native="noticeReload"
@@ -568,23 +577,42 @@
                               />
                             </el-form-item>
                           </el-col>
+                          <el-col v-bind="{ span: 4 }">
+                            <el-form-item
+                              label=""
+                              prop="createTime1"
+                              label-width="90px"
+                            >
+                              <div class="ele-form-actions">
+                                <el-button
+                                  type="primary"
+                                  icon="el-icon-search"
+                                  class="ele-btn-icon"
+                                  @click="noticeReload"
+                                >
+                                  查询
+                                </el-button>
+                                <el-button @click="noticeReset">重置</el-button>
+                              </div>
+                            </el-form-item>
+                          </el-col>
                         </el-row>
                       </el-form>
                     </div>
+                <ele-pro-table
+                  ref="noticeTable"
+                  :columns="deptColumns"
+                  :datasource="noticeDatasource"
+                  cache-key="noticeDatasource"
+                  height="calc(100vh - 450px)"
+                  :init-load="false"
+                >
+                  <template v-slot:toolbar="{ row }">
+                    
                   </template>
                   <template v-slot:toolkit="{ row }">
                     <div class="filter-container">
-                      <div class="ele-form-actions">
-                        <el-button
-                          type="primary"
-                          icon="el-icon-search"
-                          class="ele-btn-icon"
-                          @click="noticeReload"
-                        >
-                          查询
-                        </el-button>
-                        <el-button @click="noticeReset">重置</el-button>
-                      </div>
+                      
                     </div>
                   </template>
                   <template v-slot:dictType="{ row }">
@@ -668,17 +696,7 @@
                 </ele-pro-table>
               </el-tab-pane>
               <el-tab-pane label="全部记录" name="all" v-if="$hasPermission('wt:collaborative:all')">
-                <ele-pro-table
-                  ref="allTable"
-                  :columns="deptColumns"
-                  :datasource="allDatasource"
-                  cache-key="allDatasource"
-                  :toolkit="[]"
-                  height="calc(100vh - 450px)"
-                  :init-load="false"
-                >
-                  <template v-slot:toolbar="{ row }">
-                    <div class="filter-container">
+                <div class="filter-container">
                       <el-form
                         class="ele-form-search"
                         @keyup.enter.native="allReload"
@@ -757,23 +775,42 @@
                               />
                             </el-form-item>
                           </el-col>
+                          <el-col v-bind="{ span: 4 }">
+                            <el-form-item
+                              label=""
+                              prop="createTime1"
+                              label-width="90px"
+                            >
+                              <div class="ele-form-actions">
+                                <el-button
+                                  type="primary"
+                                  icon="el-icon-search"
+                                  class="ele-btn-icon"
+                                  @click="allReload"
+                                >
+                                  查询
+                                </el-button>
+                                <el-button @click="allReset">重置</el-button>
+                              </div>
+                            </el-form-item>
+                          </el-col>
                         </el-row>
                       </el-form>
                     </div>
+                <ele-pro-table
+                  ref="allTable"
+                  :columns="deptColumns"
+                  :datasource="allDatasource"
+                  cache-key="allDatasource"
+                  height="calc(100vh - 450px)"
+                  :init-load="false"
+                >
+                  <template v-slot:toolbar="{ row }">
+                    
                   </template>
                   <template v-slot:toolkit="{ row }">
                     <div class="filter-container">
-                      <div class="ele-form-actions">
-                        <el-button
-                          type="primary"
-                          icon="el-icon-search"
-                          class="ele-btn-icon"
-                          @click="allReload"
-                        >
-                          查询
-                        </el-button>
-                        <el-button @click="allReset">重置</el-button>
-                      </div>
+                      
                     </div>
                   </template>
                   <template v-slot:dictType="{ row }">
@@ -1306,6 +1343,8 @@
           ) || {};
         let makingJson = find.formJson?.makingJson ? JSON.parse(find.formJson.makingJson) || {} : {};
         this.formColumnList = makingJson.list;
+
+        console.log('reload~~~', this.formColumnList);
         this.$nextTick(() => {
               this.$refs.table.reload({ page: 1, where });
         });
@@ -1472,6 +1511,10 @@
     width: 100%;
   }
 
+  .filter-container {
+    margin-bottom: 10px;
+  }
+
   .content-box {
     width: 100%;
     //max-width: 273px;

+ 117 - 34
src/views/bpm/handleTask/components/qualityReportApproval/detailDialog.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="quality-report-container">
-    <div v-if="template">
-      <div class="switch" v-if="businessType?.includes('检测报告单')">
+    <div>
+      <div class="switch" v-if="businessType?.includes('不良品处置')">
         <div class="switch_left">
           <ul>
             <li
@@ -15,25 +15,36 @@
           </ul>
         </div>
       </div>
+      <div
+        v-show="activeComp === 'unqualifiedHtml'"
+        v-if="businessType?.includes('不良品处置')"
+        style="height: 50vh; overflow-y: auto"
+      >
+        <component
+          :is="'inspection_report3'"
+          :key="'inspection_report3'"
+          ref="unqualifiedHtmlRef"
+          :view="view"
+        ></component>
+      </div>
 
-      <!-- <component
-        v-if="businessType?.includes('检测报告单')"
-        v-show="activeComp === 'main'"
-        :is="targetComponent"
-        :key="targetComponent"
-        :row="currentRow"
-        :item="currentItem"
-      ></component> -->
       <div v-html="template" v-show="activeComp === 'main'"> </div>
       <unqualifiedProduct
         ref="unqualifiedProductRef"
         v-show="activeComp == 'unqualifiedList'"
         @setQualifiedNumber="setQualifiedNumber"
-        :total="basicInfoData.total"
+        :total="basicInfoData.total || form.total"
         @setLossNumber="setLossNumber"
+        :businessType="businessType"
       ></unqualifiedProduct>
 
-      <div style="margin-top: 10px" v-if="businessType?.includes('检测报告单')">
+      <div
+        style="margin-top: 10px"
+        v-if="
+          businessType?.includes('检测报告单') ||
+          businessType?.includes('不良品处置')
+        "
+      >
         结论:
         <el-select
           v-model="basicInfoData.qualityResults"
@@ -92,7 +103,7 @@
         ></el-input>
       </div>
     </div>
-    <browse v-else :url="fileUrl"></browse>
+    <!-- <browse v-else :url="fileUrl"></browse> -->
   </div>
 </template>
 
@@ -120,13 +131,14 @@
     qualityType: ''
   };
   import {
-    getDetail,
-    getListDetail,
     getDetailById,
     getList,
-    getCertifiById
+    getCertifiById,
+    getById
   } from '@/api/bpm/components/qualityReportApproval/qualityReportApproval';
+  import { enterprisePage } from '@/api/bpm/components/contractManage/contractBook.js';
   import browse from '@/components/jimureport/browse.vue';
+  import inspection_report3 from './inspection_report3.vue';
   import unqualifiedProduct from './unqualifiedProduct.vue';
   import { getJmPrintViewUrl } from '@/components/jimureport/api.js';
   import { getToken } from '@/utils/token-util';
@@ -155,19 +167,30 @@
     },
     components: {
       browse,
-      unqualifiedProduct
+      unqualifiedProduct,
+      inspection_report3
     },
     data() {
       return {
-        basicInfoData: {},
+        view: false,
+        basicInfoData: {
+          qualifiedNumber: 0,
+          noQualifiedNumber: 0,
+          retainedSampleQuantity: 0,
+          retainedSampleUnqualified: 0,
+          lossNumber: 0,
+          lossNumberUnqualified: 0,
+          qualityResults: 0,
+          total: 0
+        },
         unqualifiedProducts: {
           ...defForm
         },
         inspectionItems: [],
         form: {},
         tabOptions: [
-          { key: 'main', name: '业务详情' },
-          { key: 'unqualifiedList', name: '不合格品台账' }
+          { key: 'main', name: '报告' },
+          { key: 'unqualifiedList', name: '不品台账' }
         ],
         activeComp: 'main',
         // 质检报告数据
@@ -182,6 +205,7 @@
       async open() {
         let api = getDetailById;
 
+        let detail = null;
         if (this.businessType?.includes('质检任务单')) {
           api = taskmonadGetById;
         }
@@ -191,18 +215,66 @@
         if (this.businessType?.includes('合格证')) {
           api = getCertifiById;
         }
+        if (this.businessType?.includes('不良品处置')) {
+          const data = await getById(this.businessId);
+          const enterprisePageData = await enterprisePage({
+            pageNum: 1,
+            size: 200
+          });
+          detail = await api(data.qualityWorkOrderId);
+          let inspectImage = [];
+          detail.data.templateList.forEach((item) => {
+            if (item.inspectImage) {
+              inspectImage.push(...item.inspectImage);
+            }
+          });
+          console.log(inspectImage, 'inspectImage');
+          this.tabOptions.unshift({
+            key: 'unqualifiedHtml',
+            name: '不合格品处置单'
+          });
+
+          this.activeComp = 'unqualifiedHtml';
+          this.$nextTick(() => {
+            if (data.contentText) {
+              data.contentText = JSON.parse(data.contentText);
+            }
+            this.$refs.unqualifiedHtmlRef.init(
+              data.contentText?.basicInfoData
+                ? data.contentText.basicInfoData
+                : {
+                    reportNumber: data.unqualifiedProductsCode,
+                    groupName: enterprisePageData?.list[0]?.name,
+                    version: 'V1.0',
+                    productName: data.categoryName,
+                    specification: data.specification,
+                    modelType: data.modelType,
+                    batchNo: data.batchNo,
+                    total: data.quantity,
+                    sampleMeasureUnit: data.measureUnit,
+                    remark:
+                      (data.poList[0]?.supplierName || '') +
+                      ',' +
+                      data.categoryName +
+                      data.batchNo +
+                      ',厂家批号' +
+                      data.batchNo
+                  }
+            );
+          });
+        } else {
+          detail = await api(this.businessId);
+        }
 
-        const detail = await api(this.businessId);
         this.form = detail.data;
-        // this.reportData = detail;
-        // this.showEditFlag = true;
+        this.initUnqualifiedProduct();
+
         if (detail.data.reportTemplateJson?.template) {
           this.template = detail.data.reportTemplateJson.template;
 
           this.inspectionItems = detail.data.reportTemplateJson.inspectionItems;
           this.basicInfoData = detail.data.reportTemplateJson?.basicInfoData;
           if (this.businessType?.includes('检测报告单')) {
-            this.initUnqualifiedProduct();
             this.$nextTick(() => {
               const table = document.querySelector('.inspection-items-table');
               console.log(table, 'table');
@@ -230,6 +302,9 @@
             });
           }
         } else {
+          this.tabOptions = this.tabOptions.filter(
+            (item) => item.key != 'main'
+          );
           // 组件挂载时加载数据
           // this.loadReportData();
           // this.loadListDetail();
@@ -263,7 +338,7 @@
       },
       async initUnqualifiedProduct() {
         const data = await getList({
-          sourceCode: this.basicInfoData.code
+          sourceCode: this.form.code
         });
         if (data.list[0]) {
           this.unqualifiedProducts = data.list[0];
@@ -272,11 +347,14 @@
         this.$nextTick(() => {
           this.$refs.unqualifiedProductRef.init({
             id: this.unqualifiedProducts?.id,
-            qualityType: this.basicInfoData.qualityType,
-            workOrderCode: this.basicInfoData.code,
-            qualityWorkerId: this.basicInfoData.qualityWorkerId,
-            workOrderId: this.basicInfoData.workOrderId,
-            qualityResults: this.basicInfoData.qualityResults
+            qualityType:
+              this.basicInfoData.qualityType || this.form.qualityType,
+            workOrderCode: this.basicInfoData.code || this.form.code,
+            qualityWorkerId: this.basicInfoData.qualityWorkerId || this.form.id,
+            workOrderId:
+              this.basicInfoData.workOrderId || this.form.workOrderId,
+            qualityResults:
+              this.basicInfoData.qualityResults || this.form.qualityResults
           });
         });
       },
@@ -291,26 +369,31 @@
             this.basicInfoData.qualityResults = 4;
           }
         }
-        if (!data.qualifiedNumber ) {
+        if (!data.qualifiedNumber) {
           this.basicInfoData.qualityResults = 2;
         }
         if (data.qualifiedNumber && data.noQualifiedNumber) {
           this.basicInfoData.qualityResults = 3;
         }
       },
-      getTableValue() {
+      async getTableValue() {
         let unqualifiedProducts = this.$refs.unqualifiedProductRef.getValue();
+        let contentText = null;
+        if (this.businessType?.includes('不良品处置')) {
+          contentText = await this.$refs.unqualifiedHtmlRef.getValue();
+        }
         if (unqualifiedProducts == 'isNodisposeType') {
           return unqualifiedProducts;
         }
         this.basicInfoData.conclusion =
-          document.getElementById('conclusionInput').value;
+          document.getElementById('conclusionInput')?.value;
         const params = {
-          id: this.businessId,
+          id: this.form.id,
           type: 0,
           reportTemplateId: this.form.reportTemplateId,
           reportTemplateCode: this.form.reportTemplateCode,
           reportTemplateName: this.form.reportTemplateName,
+          contentText: contentText,
           unqualifiedProducts,
           reportTemplateJson: {
             template: this.template,

+ 1262 - 0
src/views/bpm/handleTask/components/qualityReportApproval/inspection_report3.vue

@@ -0,0 +1,1262 @@
+<template>
+  <div
+    id="printSection"
+    style="
+      padding: 20px;
+      background-color: white;
+      display: flex;
+      flex-direction: column;
+      align-items: center;
+      width: 1200px;
+    "
+  >
+    <div class="table1" style="width: 100%">
+      <div
+        style="
+          text-align: center;
+          font-size: 20px;
+          margin-bottom: 5px;
+          font-weight: bold;
+        "
+        >{{ basicInfoData.groupName || '湖南特瑞精密医疗器器械有限公司' }}</div
+      >
+      <div style="text-align: center; font-size: 18px; margin-bottom: 5px"
+        >不合格品通知及评审处置表</div
+      >
+
+      <!-- 编号和报告单号 -->
+      <div style="margin-bottom: 5px">
+        <el-row style="display: flex">
+          <el-col :span="12" style="width: 50%">
+            <div style="display: flex; align-items: center">
+              <!-- 左侧空白占位 -->
+            </div>
+          </el-col>
+          <el-col :span="12" style="width: 50%">
+            <div
+              style="
+                display: flex;
+                align-items: center;
+                justify-content: flex-end;
+              "
+            >
+              <span style="font-weight: bold; margin-right: 10px"
+                >表单编号:</span
+              >
+              <span v-if="isView">
+                {{ basicInfoData.reportNumber }}
+              </span>
+              <span v-else>
+                <el-input
+                  v-model="basicInfoData.reportNumber"
+                  placeholder="请输入表单编号"
+                ></el-input>
+              </span>
+              <span style="font-weight: bold; margin-left: 3px">
+                <span> 版本:</span>
+                <span v-if="isView">
+                  {{ basicInfoData.version }}
+                </span>
+                <span v-else>
+                  <el-input
+                    style="width: 120px"
+                    v-model="basicInfoData.version"
+                    placeholder="请输入版本"
+                  ></el-input>
+                </span>
+              </span>
+            </div>
+          </el-col>
+        </el-row>
+      </div>
+
+      <!-- 基本信息表格 -->
+      <table
+        class="basic-info-table"
+        border="1"
+        style="width: 100%; border-collapse: collapse"
+      >
+        <tbody>
+          <tr align="center">
+            <td style="width: 150px">不合格品类别</td>
+            <td colspan="3" align="left">
+              <el-checkbox-group
+                v-model="basicInfoData.categoryList"
+                style="margin-left: 15px"
+              >
+                <el-checkbox label="原辅料"></el-checkbox>
+                <el-checkbox label="包材"></el-checkbox>
+                <el-checkbox label="中间产品"></el-checkbox>
+                <el-checkbox label="成品"></el-checkbox>
+              </el-checkbox-group>
+            </td>
+            <td style="width: 150px">处置编号</td>
+            <td style="width: 180px">
+              <el-input
+                v-if="!isView"
+                v-model="basicInfoData.disposalNumber"
+                placeholder="请输入处置编号"
+              ></el-input>
+              <span v-else>
+                {{ basicInfoData.disposalNumber }}
+              </span>
+            </td>
+          </tr>
+          <tr align="center"
+            ><td colspan="6"
+              ><span style="font-weight: 800; font-size: 15px"
+                >基本信息</span
+              ></td
+            ></tr
+          >
+          <tr align="center"
+            ><td>品名</td><td>型号规格</td><td>批号</td
+            ><td style="width: 80px">数量</td><td colspan="2">来源</td>
+          </tr>
+          <tr align="center"
+            ><td>{{ basicInfoData.productName }}</td
+            ><td
+              >{{ basicInfoData.specification }}/{{
+                basicInfoData.modelType
+              }}</td
+            ><td>{{ basicInfoData.batchNo }}</td
+            ><td
+              >{{ basicInfoData.total
+              }}{{ basicInfoData.sampleMeasureUnit }}</td
+            ><td colspan="2">
+              <div style="display: flex; flex-direction: column">
+                <div style="flex: 1; display: flex">
+                  <el-checkbox-group
+                    v-model="basicInfoData.sourceList"
+                    style="margin-left: 15px"
+                  >
+                    <el-checkbox label="来料检"></el-checkbox>
+                    <el-checkbox label="过程检"></el-checkbox>
+                    <el-checkbox label="成品检"></el-checkbox>
+                  </el-checkbox-group>
+                </div>
+                <div style="flex: 1; display: flex; align-items: center">
+                  <el-checkbox-group
+                    v-model="basicInfoData.sourceList"
+                    style="margin-left: 15px"
+                  >
+                    <el-checkbox label="库存"></el-checkbox>
+                    <el-checkbox label="交付后"></el-checkbox>
+                    <el-checkbox label="其他:"></el-checkbox>
+                  </el-checkbox-group>
+
+                  <template v-if="!isView">
+                    <input
+                      v-model="basicInfoData.sourceOther"
+                      style="
+                        border: none;
+                        border-bottom: solid 1px #000;
+                        width: 60px;
+                      "
+                    />
+                  </template>
+                  <span
+                    v-else
+                    style="
+                      display: inline-block;
+                      min-height: 20px;
+                      border-bottom: 1px solid #000;
+                      width: 60px;
+                      padding: 0 4px;
+                    "
+                    >{{ basicInfoData.sourceOther }}</span
+                  >
+                </div>
+              </div>
+            </td>
+          </tr>
+          <tr
+            ><td colspan="6">
+              <div>
+                <div
+                  >不合格描述:(来料不合格的,应描述供应商名称、厂家批号等信息)</div
+                >
+                <div style="margin-top: 15px">
+                  <el-input
+                    v-if="!isView"
+                    type="textarea"
+                    v-model="basicInfoData.remark"
+                    style="height: 80px"
+                  ></el-input>
+                  <span v-else>{{ basicInfoData.remark }}</span>
+                </div>
+                <div style="margin-top: 10px; display: flex">
+                  <image-upload
+                    v-if="!isView"
+                    v-model="basicInfoData.vehiclePhotoUrl"
+                    module="qms"
+                    :limit="4"
+                  ></image-upload>
+                  <template v-else>
+                    <img
+                      style="width: 300px; height: 280px; margin-left: 5px"
+                      v-for="url in basicInfoData.vehiclePhotoUrl"
+                      :src="getFmImagePath(url)"
+                      alt=""
+                      srcset=""
+                    />
+                  </template>
+                </div>
+                <div style="display: flex; margin-top: 25px"
+                  >是否有其他物料/中间产品/成品受影响(
+                  <el-checkbox-group
+                    v-model="basicInfoData.affectedList"
+                    style="margin-left: 15px"
+                  >
+                    <el-checkbox label="否"></el-checkbox>,
+                    <el-checkbox label="是"></el-checkbox></el-checkbox-group
+                  >,受影响的物料/中间产品/成品批次如下):</div
+                >
+                <div style="display: flex; margin-top: 25px"
+                  ><span style="font-size: 15px; font-weight: 800"
+                    >处置建议:</span
+                  >
+                  <el-checkbox-group
+                    v-model="basicInfoData.suggestionList"
+                    style="margin-left: 15px"
+                  >
+                    <el-checkbox label="退货"></el-checkbox>
+                    <el-checkbox label="销毁"></el-checkbox>
+                    <el-checkbox label="让步接收"></el-checkbox>
+                    <el-checkbox label="挑选使用"></el-checkbox>
+                    <el-checkbox label="返工"></el-checkbox>
+                    <el-checkbox label="其他:"></el-checkbox>
+                  </el-checkbox-group>
+                  <template v-if="!isView">
+                    <input
+                      v-model="basicInfoData.suggestionOther"
+                      style="
+                        border: none;
+                        border-bottom: solid 1px #000;
+                        width: 100px;
+                      "
+                    />
+                  </template>
+                  <span
+                    v-else
+                    style="
+                      display: inline-block;
+                      min-height: 20px;
+                      border-bottom: 1px solid #000;
+                      width: 100px;
+                      padding: 0 4px;
+                    "
+                    >{{ basicInfoData.suggestionOther }}</span
+                  >
+                </div>
+
+                <div style="margin-top: 25px">
+                  <div style="display: flex; align-items: center">
+                    <div
+                      style="
+                        display: flex;
+                        align-items: center;
+                        margin-bottom: 10px;
+                      "
+                    >
+                      <span
+                        style="
+                          font-weight: bold;
+                          min-width: 80px;
+                          font-size: 15px;
+                        "
+                        >反馈部门:</span
+                      >
+                      <span style="flex: 1; min-width: 150px">
+                        <div
+                          v-if="!isView"
+                          style="display: flex; align-items: center"
+                        >
+                          <el-input
+                            v-model="basicInfoData.feedbackDepartment"
+                            placeholder="请输入反馈部门"
+                            style="width: 140px"
+                          ></el-input>
+                        </div>
+                        <div v-else>{{
+                          basicInfoData.feedbackDepartment || ''
+                        }}</div>
+                      </span>
+                    </div>
+                    <div
+                      style="
+                        display: flex;
+                        align-items: center;
+                        margin-bottom: 10px;
+                      "
+                    >
+                      <span style="font-weight: bold; min-width: 100px"
+                        >反馈人/日期:</span
+                      >
+                      <span style="flex: 1; min-width: 150px">
+                        <div
+                          v-if="!isView"
+                          style="display: flex; align-items: center"
+                        >
+                          <el-input
+                            v-model="basicInfoData.feedbackPerson"
+                            placeholder="请输入反馈人"
+                            style="width: 120px"
+                          ></el-input>
+                          <el-date-picker
+                            v-model="basicInfoData.feedbackDate"
+                            type="date"
+                            value-format="yyyy-MM-dd"
+                            placeholder="选择日期"
+                            style="width: 140px"
+                          />
+                        </div>
+                        <div v-else
+                          >{{ basicInfoData.feedbackPerson || '' }} /
+                          {{ basicInfoData.feedbackDate || '' }}</div
+                        >
+                      </span>
+                    </div>
+                    <div
+                      style="
+                        display: flex;
+                        align-items: center;
+                        margin-bottom: 10px;
+                      "
+                    >
+                      <span style="font-weight: bold; min-width: 120px">
+                        部门负责人/日期:</span
+                      >
+                      <span style="flex: 1; min-width: 150px">
+                        <div
+                          v-if="!isView"
+                          style="display: flex; align-items: center"
+                        >
+                          <el-input
+                            v-model="basicInfoData.deptHeadPerson"
+                            placeholder="请输入部门负责人"
+                            style="width: 120px"
+                          ></el-input>
+                          <el-date-picker
+                            v-model="basicInfoData.deptHeadDate"
+                            type="date"
+                            value-format="yyyy-MM-dd"
+                            placeholder="选择日期"
+                            style="width: 140px"
+                          />
+                        </div>
+                        <div v-else
+                          >{{ basicInfoData.deptHeadPerson || '' }} /
+                          {{ basicInfoData.deptHeadDate || '' }}</div
+                        >
+                      </span>
+                    </div>
+                  </div>
+                </div>
+              </div>
+            </td>
+          </tr>
+          <tr
+            ><td colspan="6">
+              <div style="height: 80px"> 质量部QA确认: </div>
+              <div
+                style="
+                  display: flex;
+                  align-items: center;
+                  margin-bottom: 10px;
+                  justify-content: flex-end;
+                  width: 90%;
+                "
+              >
+                <span> 确认人/日期:</span>
+                <span>
+                  <div
+                    v-if="!isView"
+                    style="display: flex; align-items: center"
+                  >
+                    <el-input
+                      v-model="basicInfoData.qaPerson"
+                      placeholder="请输入确认人"
+                      style="width: 140px"
+                    ></el-input>
+                    <el-date-picker
+                      v-model="basicInfoData.qaDate"
+                      type="date"
+                      value-format="yyyy-MM-dd"
+                      placeholder="选择日期"
+                      style="width: 160px"
+                    />
+                  </div>
+                  <div v-else
+                    >{{ basicInfoData.qaPerson || '' }} /
+                    {{ basicInfoData.qaDate || '' }}</div
+                  >
+                </span>
+              </div>
+            </td></tr
+          >
+          <tr
+            ><td colspan="6">
+              <div style="height: 80px"
+                >委托方意见(仅适用于受托不合格品处置):
+              </div>
+              <div
+                style="
+                  display: flex;
+                  align-items: center;
+                  margin-bottom: 10px;
+                  justify-content: flex-end;
+                  width: 90%;
+                "
+              >
+                <span> 确认人/日期:</span>
+                <span>
+                  <div
+                    v-if="!isView"
+                    style="display: flex; align-items: center"
+                  >
+                    <el-input
+                      v-model="basicInfoData.consignorPerson"
+                      placeholder="请输入确认人"
+                      style="width: 140px"
+                    ></el-input>
+                    <el-date-picker
+                      v-model="basicInfoData.consignorDate"
+                      type="date"
+                      value-format="yyyy-MM-dd"
+                      placeholder="选择日期"
+                      style="width: 160px"
+                    />
+                  </div>
+                  <div v-else
+                    >{{ basicInfoData.consignorPerson || '' }} /
+                    {{ basicInfoData.consignorDate || '' }}</div
+                  >
+                </span>
+              </div>
+            </td></tr
+          >
+          <tr align="center"
+            ><td colspan="6"
+              ><span style="font-weight: 800; font-size: 15px"
+                >不合格评审</span
+              ></td
+            ></tr
+          >
+          <tr align="center"
+            ><td rowspan="6"><span style="font-size: 15px">评审意见</span></td>
+            <td>部门</td>
+            <td colspan="3">意见</td>
+            <td>评审人签字/日期</td>
+          </tr>
+          <tr align="center" v-for="value in basicInfoData.remarks">
+            <td style="width: 300px">
+              <el-input
+                v-if="!isView"
+                v-model="value.department"
+                placeholder="请输入部门"
+                style="width: 100%"
+              ></el-input>
+              <span v-else>{{ value.department }}</span>
+            </td>
+            <td colspan="3">
+              <el-input
+                v-if="!isView"
+                v-model="value.opinion"
+                placeholder="请输入意见"
+                style="width: 100%"
+              ></el-input>
+              <span v-else>{{ value.opinion }}</span>
+            </td>
+            <td>
+              <div v-if="!isView" style="display: flex; align-items: center">
+                <el-input
+                  v-model="value.sign"
+                  placeholder="请输入签字人"
+                  style="width: 140px"
+                ></el-input>
+                <el-date-picker
+                  v-model="value.date"
+                  type="date"
+                  value-format="yyyy-MM-dd"
+                  placeholder="选择日期"
+                  style="width: 160px"
+                />
+              </div>
+              <div v-else
+                >{{ value.sign || '' }} / {{ value.date || '' }}</div
+              ></td
+            >
+          </tr>
+        </tbody>
+      </table>
+    </div>
+
+    <div class="table2" style="width: 100%">
+      <div
+        style="
+          text-align: center;
+          font-size: 20px;
+          margin-bottom: 5px;
+          font-weight: bold;
+        "
+        >{{ basicInfoData.groupName || '湖南特瑞精密医疗器器械有限公司' }}</div
+      >
+      <div style="text-align: center; font-size: 18px; margin-bottom: 5px"
+        >不合格品通知及评审处置表</div
+      >
+
+      <!-- 编号和报告单号(与 table1 共用字段) -->
+      <div style="margin-bottom: 5px">
+        <el-row style="display: flex">
+          <el-col :span="12" style="width: 50%">
+            <div style="display: flex; align-items: center"></div>
+          </el-col>
+          <el-col :span="12" style="width: 50%">
+            <div
+              style="
+                display: flex;
+                align-items: center;
+                justify-content: flex-end;
+              "
+            >
+              <span style="font-weight: bold; margin-right: 10px"
+                >表单编号:</span
+              >
+              <span v-if="isView">
+                {{ basicInfoData.reportNumber }}
+              </span>
+              <span v-else>
+                <el-input
+                  v-model="basicInfoData.reportNumber"
+                  placeholder="请输入表单编号"
+                ></el-input>
+              </span>
+              <span style="font-weight: bold; margin-left: 3px">
+                <span> 版本:</span>
+                <span v-if="isView">
+                  {{ basicInfoData.version }}
+                </span>
+                <span v-else>
+                  <el-input
+                    style="width: 120px"
+                    v-model="basicInfoData.version"
+                    placeholder="请输入版本"
+                  ></el-input>
+                </span>
+              </span>
+            </div>
+          </el-col>
+        </el-row>
+      </div>
+
+      <table
+        class="basic-info-table"
+        border="1"
+        style="width: 100%; border-collapse: collapse"
+      >
+        <tbody>
+          <!-- 第一行:管代审批 + 总经理审批 -->
+          <tr>
+            <td style="width: 60%; padding: 15px" colspan="2">
+              <div style="font-weight: bold; margin-bottom: 10px"
+                >管代审批:</div
+              >
+              <el-checkbox-group
+                v-model="basicInfoData.managementApprovalList"
+                style="margin-left: 10px"
+              >
+                <el-checkbox label="退货"></el-checkbox>
+                <el-checkbox label="销毁"></el-checkbox>
+                <el-checkbox label="让步接收"></el-checkbox>
+                <el-checkbox label="挑选使用"></el-checkbox>
+                <el-checkbox label="返工"></el-checkbox>
+              </el-checkbox-group>
+              <el-checkbox label="其他" style="margin-left: 10px"></el-checkbox>
+              <template v-if="!isView">
+                <input
+                  v-model="basicInfoData.managementOtherText"
+                  style="
+                    width: 150px;
+                    border: none;
+                    border-bottom: solid 1px #000;
+                  "
+                />
+              </template>
+              <span
+                v-else
+                style="
+                  display: inline-block;
+                  min-height: 20px;
+                  border-bottom: 1px solid #000;
+                  width: 150px;
+                  padding: 0 4px;
+                "
+                >{{ basicInfoData.managementOtherText }}</span
+              >
+              <div style="margin-top: 15px; display: flex">
+                是否采取纠正预防措施:
+                <el-checkbox
+                  v-model="basicInfoData.correctiveActionChecked"
+                ></el-checkbox>
+                ,编号:
+                <template v-if="!isView">
+                  <input
+                    v-model="basicInfoData.correctiveActionNo"
+                    style="
+                      width: 180px;
+                      border: none;
+                      border-bottom: solid 1px #000;
+                    "
+                  />
+                </template>
+                <span
+                  v-else
+                  style="
+                    display: inline-block;
+                    min-height: 20px;
+                    border-bottom: 1px solid #000;
+                    width: 180px;
+                    padding: 0 4px;
+                  "
+                  >{{ basicInfoData.correctiveActionNo }}</span
+                >
+              </div>
+              <div style="margin-top: 15px; display: flex">
+                <el-checkbox
+                  v-model="basicInfoData.noCorrectiveReasonChecked"
+                ></el-checkbox>
+                否,理由:
+                <template v-if="!isView">
+                  <input
+                    v-model="basicInfoData.noCorrectiveReasonText"
+                    style="
+                      width: 180px;
+                      border: none;
+                      border-bottom: solid 1px #000;
+                    "
+                  />
+                </template>
+                <span
+                  v-else
+                  style="
+                    display: inline-block;
+                    min-height: 20px;
+                    border-bottom: 1px solid #000;
+                    width: 180px;
+                    padding: 0 4px;
+                  "
+                  >{{ basicInfoData.noCorrectiveReasonText }}</span
+                >
+              </div>
+              <div
+                style="
+                  display: flex;
+                  align-items: center;
+                  margin-top: 15px;
+                  width: 90%;
+                "
+              >
+                <span> 签名/日期:</span>
+                <span>
+                  <div
+                    v-if="!isView"
+                    style="display: flex; align-items: center"
+                  >
+                    <el-input
+                      v-model="basicInfoData.managementSign"
+                      placeholder="请输入签名"
+                      style="width: 140px"
+                    ></el-input>
+                    <el-date-picker
+                      v-model="basicInfoData.managementSignDate"
+                      type="date"
+                      value-format="yyyy-MM-dd"
+                      placeholder="选择日期"
+                      style="width: 160px"
+                    />
+                  </div>
+                  <div v-else
+                    >{{ basicInfoData.managementSign || '' }} /
+                    {{ basicInfoData.managementSignDate || '' }}</div
+                  >
+                </span>
+              </div>
+            </td>
+            <td style="width: 40%; padding: 15px">
+              <div
+                style="font-weight: bold; margin-bottom: 10px; font-size: 15px"
+              >
+                总经理/副总经理审批:
+                <span style="font-size: 12px"
+                  >(不适用于受托不合格品处置)</span
+                >
+              </div>
+              <el-checkbox-group
+                v-model="basicInfoData.generalManagerApprovalList"
+                style="margin-left: 10px"
+              >
+                <el-checkbox label="同意"></el-checkbox>
+                <el-checkbox label="不同意"></el-checkbox>
+              </el-checkbox-group>
+              <div
+                style="
+                  display: flex;
+                  align-items: center;
+                  margin-top: 15px;
+                  width: 90%;
+                "
+              >
+                <span> 签名/日期:</span>
+                <span>
+                  <div
+                    v-if="!isView"
+                    style="display: flex; align-items: center"
+                  >
+                    <el-input
+                      v-model="basicInfoData.generalManagerSign"
+                      placeholder="请输入签名"
+                      style="width: 140px"
+                    ></el-input>
+                    <el-date-picker
+                      v-model="basicInfoData.generalManagerSignDate"
+                      type="date"
+                      value-format="yyyy-MM-dd"
+                      placeholder="选择日期"
+                      style="width: 160px"
+                    />
+                  </div>
+                  <div v-else
+                    >{{ basicInfoData.generalManagerSign || '' }} /
+                    {{ basicInfoData.generalManagerSignDate || '' }}</div
+                  >
+                </span>
+              </div>
+            </td>
+          </tr>
+          <!-- 不合格品的处置记录标题 -->
+          <tr align="center"
+            ><td colspan="3"
+              ><span style="font-weight: 800; font-size: 15px"
+                >不合格品的处置记录</span
+              ></td
+            ></tr
+          >
+          <!-- 处理方法 -->
+          <tr>
+            <td colspan="3" style="padding: 15px">
+              <div style="font-weight: bold; margin-bottom: 10px">
+                处理方法:
+              </div>
+              <!-- 退货 -->
+              <div
+                style="margin-bottom: 15px; display: flex; align-items: center"
+              >
+                <el-checkbox
+                  v-model="basicInfoData.returnChecked"
+                ></el-checkbox>
+                退货,退货日期:
+                <el-date-picker
+                  v-if="!isView"
+                  v-model="basicInfoData.returnDate"
+                  type="date"
+                  value-format="yyyy-MM-dd"
+                  placeholder=" "
+                  style="width: 160px"
+                />
+                <span
+                  v-else
+                  style="
+                    display: inline-block;
+                    min-height: 20px;
+                    border-bottom: 1px solid #000;
+                    width: 160px;
+                    padding: 0 4px;
+                  "
+                  >{{ basicInfoData.returnDate }}</span
+                >
+                ;退货单号:
+                <template v-if="!isView">
+                  <input
+                    v-model="basicInfoData.returnNo"
+                    style="
+                      width: 180px;
+                      border: none;
+                      border-bottom: solid 1px #000;
+                    "
+                  />
+                </template>
+                <span
+                  v-else
+                  style="
+                    display: inline-block;
+                    min-height: 20px;
+                    border-bottom: 1px solid #000;
+                    width: 180px;
+                    padding: 0 4px;
+                  "
+                  >{{ basicInfoData.returnNo }}</span
+                >
+              </div>
+              <!-- 销毁 -->
+              <div>
+                <el-checkbox
+                  v-model="basicInfoData.destroyChecked"
+                ></el-checkbox>
+                销毁,方法(附销毁照片):
+                <el-checkbox-group
+                  v-model="basicInfoData.destroyMethods"
+                  style="display: inline-block; margin-left: 10px"
+                >
+                  <el-checkbox label="撕毁"></el-checkbox>
+                  <el-checkbox label="掩埋"></el-checkbox>
+                  <el-checkbox label="焚烧"></el-checkbox>
+                  <el-checkbox label="破碎"></el-checkbox>
+                  <el-checkbox label="废弃"></el-checkbox>
+                </el-checkbox-group>
+              </div>
+              <div style="margin-bottom: 25px">
+                <el-checkbox
+                  style="margin-left: 50px"
+                  label="其他"
+                ></el-checkbox>
+                <template v-if="!isView">
+                  <input
+                    v-model="basicInfoData.destroyOther"
+                    style="
+                      width: 50%;
+                      border: none;
+                      border-bottom: solid 1px #000;
+                    "
+                  />
+                </template>
+                <span
+                  v-else
+                  style="
+                    display: inline-block;
+                    min-height: 20px;
+                    border-bottom: 1px solid #000;
+                    width: 50%;
+                    padding: 0 4px;
+                  "
+                  >{{ basicInfoData.destroyOther }}</span
+                >
+              </div>
+              <!-- 让步接收 -->
+              <div style="margin-bottom: 25px">
+                <el-checkbox
+                  v-model="basicInfoData.concessionChecked"
+                ></el-checkbox>
+                让步接收,放行日期:
+                <el-date-picker
+                  v-if="!isView"
+                  v-model="basicInfoData.concessionDate"
+                  type="date"
+                  value-format="yyyy-MM-dd"
+                  placeholder="选择日期"
+                  style="width: 160px"
+                />
+                <span
+                  v-else
+                  style="
+                    display: inline-block;
+                    min-height: 20px;
+                    border-bottom: 1px solid #000;
+                    width: 160px;
+                    padding: 0 4px;
+                  "
+                  >{{ basicInfoData.concessionDate }}</span
+                >
+              </div>
+              <!-- 挑选使用 -->
+              <div style="margin-bottom: 25px">
+                <el-checkbox
+                  v-model="basicInfoData.selectChecked"
+                ></el-checkbox>
+                挑选使用,挑选人:
+                <template v-if="!isView">
+                  <input
+                    v-model="basicInfoData.selectPerson"
+                    style="
+                      width: 180px;
+                      border: none;
+                      border-bottom: solid 1px #000;
+                    "
+                  />
+                </template>
+                <span
+                  v-else
+                  style="
+                    display: inline-block;
+                    min-height: 20px;
+                    border-bottom: 1px solid #000;
+                    width: 180px;
+                    padding: 0 4px;
+                  "
+                  >{{ basicInfoData.selectPerson }}</span
+                >
+                ;挑选日期:
+                <el-date-picker
+                  v-if="!isView"
+                  v-model="basicInfoData.selectDate"
+                  type="date"
+                  value-format="yyyy-MM-dd"
+                  placeholder="选择日期"
+                  style="width: 160px"
+                />
+                <span
+                  v-else
+                  style="
+                    display: inline-block;
+                    min-height: 20px;
+                    border-bottom: 1px solid #000;
+                    width: 160px;
+                    padding: 0 4px;
+                  "
+                  >{{ basicInfoData.selectDate }}</span
+                >
+                ;
+                <div style="margin-top: 5px; margin-left: 24px">
+                  挑选结果:
+                  <template v-if="!isView">
+                    <input
+                      v-model="basicInfoData.selectResult"
+                      style="
+                        width: 50%;
+                        border: none;
+                        border-bottom: solid 1px #000;
+                      "
+                    />
+                  </template>
+                  <span
+                    v-else
+                    style="
+                      display: inline-block;
+                      min-height: 20px;
+                      border-bottom: 1px solid #000;
+                      width: 50%;
+                      padding: 0 4px;
+                    "
+                    >{{ basicInfoData.selectResult }}</span
+                  >
+                </div>
+              </div>
+              <!-- 返工 -->
+              <div style="margin-bottom: 15px">
+                <el-checkbox
+                  v-model="basicInfoData.reworkChecked"
+                ></el-checkbox>
+                返工,返工方案:
+                <template v-if="!isView">
+                  <input
+                    v-model="basicInfoData.reworkPlan"
+                    style="
+                      width: 180px;
+                      border: none;
+                      border-bottom: solid 1px #000;
+                    "
+                  />
+                </template>
+                <span
+                  v-else
+                  style="
+                    display: inline-block;
+                    min-height: 20px;
+                    border-bottom: 1px solid #000;
+                    width: 180px;
+                    padding: 0 4px;
+                  "
+                  >{{ basicInfoData.reworkPlan }}</span
+                >
+                ;返工日期:
+                <el-date-picker
+                  v-if="!isView"
+                  v-model="basicInfoData.reworkDate"
+                  type="date"
+                  value-format="yyyy-MM-dd"
+                  placeholder="选择日期"
+                  style="width: 160px"
+                />
+                <span
+                  v-else
+                  style="
+                    display: inline-block;
+                    min-height: 20px;
+                    border-bottom: 1px solid #000;
+                    width: 160px;
+                    padding: 0 4px;
+                  "
+                  >{{ basicInfoData.reworkDate }}</span
+                >
+                ;
+                <div style="margin-top: 5px; margin-left: 24px">
+                  返工结果:
+                  <template v-if="!isView">
+                    <input
+                      v-model="basicInfoData.reworkResult"
+                      style="
+                        width: 50%;
+                        border: none;
+                        border-bottom: solid 1px #000;
+                      "
+                    />
+                  </template>
+                  <span
+                    v-else
+                    style="
+                      display: inline-block;
+                      min-height: 20px;
+                      border-bottom: 1px solid #000;
+                      width: 50%;
+                      padding: 0 4px;
+                    "
+                    >{{ basicInfoData.reworkResult }}</span
+                  >
+                </div>
+              </div>
+              <!-- 其他 -->
+              <div style="margin-bottom: 15px">
+                <el-checkbox v-model="basicInfoData.otherChecked"></el-checkbox>
+                其他
+                <template v-if="!isView">
+                  <input
+                    v-model="basicInfoData.otherRemark"
+                    style="
+                      width: 50%;
+                      border: none;
+                      border-bottom: solid 1px #000;
+                    "
+                  />
+                </template>
+                <span
+                  v-else
+                  style="
+                    display: inline-block;
+                    min-height: 20px;
+                    border-bottom: 1px solid #000;
+                    width: 50%;
+                    padding: 0 4px;
+                  "
+                  >{{ basicInfoData.otherRemark }}</span
+                >
+              </div>
+            </td>
+          </tr>
+          <!-- 签名区域 -->
+          <tr>
+            <td style="padding: 15px; height: 80px">
+              <div>执行人/日期:</div>
+              <div v-if="!isView" style="display: flex; align-items: center">
+                <el-input
+                  v-model="basicInfoData.executorSign"
+                  placeholder="请输入执行人"
+                  style="width: 140px"
+                ></el-input>
+                <el-date-picker
+                  v-model="basicInfoData.executorDate"
+                  type="date"
+                  value-format="yyyy-MM-dd"
+                  placeholder="选择日期"
+                  style="width: 160px"
+                />
+              </div>
+              <div v-else
+                >{{ basicInfoData.executorSign || '' }} /
+                {{ basicInfoData.executorDate || '' }}</div
+              >
+            </td>
+            <td style="padding: 15px; height: 80px">
+              <div>执行部门负责人/日期:</div>
+              <div v-if="!isView" style="display: flex; align-items: center">
+                <el-input
+                  v-model="basicInfoData.departmentSign"
+                  placeholder="请输入部门负责人"
+                  style="width: 140px"
+                ></el-input>
+                <el-date-picker
+                  v-model="basicInfoData.departmentDate"
+                  type="date"
+                  value-format="yyyy-MM-dd"
+                  placeholder="选择日期"
+                  style="width: 160px"
+                />
+              </div>
+              <div v-else
+                >{{ basicInfoData.departmentSign || '' }} /
+                {{ basicInfoData.departmentDate || '' }}</div
+              >
+            </td>
+            <td style="padding: 15px; height: 80px" colspan="2">
+              <div>监督人(质量部)/日期:</div>
+              <div v-if="!isView" style="display: flex; align-items: center">
+                <el-input
+                  v-model="basicInfoData.supervisorSign"
+                  placeholder="请输入监督人"
+                  style="width: 140px"
+                ></el-input>
+                <el-date-picker
+                  v-model="basicInfoData.supervisorDate"
+                  type="date"
+                  value-format="yyyy-MM-dd"
+                  placeholder="选择日期"
+                  style="width: 160px"
+                />
+              </div>
+              <div v-else
+                >{{ basicInfoData.supervisorSign || '' }} /
+                {{ basicInfoData.supervisorDate || '' }}</div
+              >
+            </td>
+          </tr>
+        </tbody>
+      </table>
+      注:1.当报废处置金额达5万元及以上时,必须经总经理或其授权代表审批;2.处置过程可另附照片或其他证据等。
+    </div>
+  </div>
+</template>
+<script>
+  import imageUpload from '@/components/upload/imageUpload.vue';
+  import { getFmImagePath } from '@/utils/file';
+
+  export default {
+    name: 'QualityReport',
+    props: {
+      isView: {
+        type: Boolean,
+        default: false
+      }
+    },
+    components: {
+      imageUpload
+    },
+    data() {
+      return {
+        getFmImagePath,
+        basicInfoData: {
+          // 表单编号、版本(两处共用)
+          reportNumber: '',
+          version: '',
+          // 处置编号
+          disposalNumber: '',
+          remark: '',
+          // 不合格品类别
+          categoryList: [],
+          vehiclePhotoUrl: [],
+          // 来源
+          sourceList: [],
+          sourceOther: '',
+          // 是否受影响
+          affectedList: [],
+          // 处置建议
+          suggestionList: [],
+          suggestionOther: '',
+          // 基本信息的显示字段(非输入,但保留)
+          productName: '',
+          specification: '',
+          modelType: '',
+          batchNo: '',
+          total: '',
+          sampleMeasureUnit: '',
+          // 反馈部门、反馈人、部门负责人
+          feedbackDepartment: '',
+          feedbackPerson: '',
+          feedbackDate: '',
+          deptHeadPerson: '',
+          deptHeadDate: '',
+          // 质量部QA确认
+          qaPerson: '',
+          qaDate: '',
+          // 委托方意见
+          consignorPerson: '',
+          consignorDate: '',
+          // 评审意见表格(5行)
+          remarks: [
+            { department: '', opinion: '', sign: '', date: '' },
+            { department: '', opinion: '', sign: '', date: '' },
+            { department: '', opinion: '', sign: '', date: '' },
+            { department: '', opinion: '', sign: '', date: '' },
+            { department: '', opinion: '', sign: '', date: '' }
+          ],
+          // 管代审批
+          managementApprovalList: [],
+          managementOtherText: '',
+          correctiveActionChecked: false,
+          correctiveActionNo: '',
+          noCorrectiveReasonChecked: false,
+          noCorrectiveReasonText: '',
+          managementSign: '',
+          managementSignDate: '',
+          // 总经理审批
+          generalManagerApprovalList: [],
+          generalManagerSign: '',
+          generalManagerSignDate: '',
+          // 处置记录
+          returnChecked: false,
+          returnDate: '',
+          returnNo: '',
+          destroyChecked: false,
+          destroyMethods: [],
+          destroyOther: '',
+          concessionChecked: false,
+          concessionDate: '',
+          selectChecked: false,
+          selectPerson: '',
+          selectDate: '',
+          selectResult: '',
+          reworkChecked: false,
+          reworkPlan: '',
+          reworkDate: '',
+          reworkResult: '',
+          otherChecked: false,
+          otherRemark: '',
+          // 签名
+          executorSign: '',
+          executorDate: '',
+          departmentSign: '',
+          departmentDate: '',
+          supervisorSign: '',
+          supervisorDate: ''
+        }
+      };
+    },
+    methods: {
+      /* 打开质检报告 */
+      async init(basicInfoData) {
+        console.log(basicInfoData, 'basicInfoData');
+        if (basicInfoData.productName) {
+          this.$set(this, 'basicInfoData', {
+            ...this.basicInfoData,
+            ...basicInfoData
+          });
+        }
+      },
+      /* 保存编辑 */
+      async getValue() {
+        this.isView = true;
+        return new Promise((resolve, reject) => {
+          this.$nextTick(() => {
+            const printSection = document.getElementById('printSection');
+            resolve({
+              basicInfoData: this.basicInfoData,
+              html: printSection.innerHTML
+            });
+          });
+        });
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  td {
+    padding: 4px;
+  }
+  @media print {
+    .table1 {
+      page-break-after: always;
+    }
+    .table2 {
+      page-break-before: always;
+    }
+  }
+</style>

+ 17 - 5
src/views/bpm/handleTask/components/qualityReportApproval/submit.vue

@@ -62,7 +62,10 @@
     rejectTask,
     cancelTask
   } from '@/api/bpm/task';
-  import { generateReport } from '@/api/bpm/components/qualityReportApproval/qualityReportApproval';
+  import {
+    generateReport,
+    updateData
+  } from '@/api/bpm/components/qualityReportApproval/qualityReportApproval';
   // 流程实例的详情页,可用于审批
   export default {
     name: '',
@@ -104,14 +107,23 @@
       },
 
       async handleAudit(status) {
-        if (this.businessType?.includes('检测报告单')) {
+        if (
+          this.businessType?.includes('检测报告单') ||
+          this.businessType?.includes('不良品处置')
+        ) {
           const data = await this.getTableValue();
           if (data == 'isNodisposeType') {
-            this.$message.warning('有不合格品未处置,请检查!');
+            this.$message.warning('有不品未处置,请检查!');
             return;
           }
-          await generateReport(data);
-          console.log(data, 'dasdsa');
+          if (this.businessType?.includes('检测报告单')) {
+            await generateReport(data);
+          } else {
+            await updateData({
+              ...data.unqualifiedProducts,
+              contentText: data.contentText
+            });
+          }
         }
         let API = !!status ? approveTaskWithVariables : rejectTask;
         await API({

+ 25 - 7
src/views/bpm/handleTask/components/qualityReportApproval/unqualifiedProduct.vue

@@ -8,6 +8,7 @@
         :selection.sync="selection"
         :needPage="false"
         row-key="id"
+        max-height="500px"
       >
         <!-- 操作列 -->
         <template v-slot:toolbar v-if="showBtn">
@@ -287,7 +288,7 @@
         <el-button type="primary" @click="handleDispose">确 定</el-button>
       </div>
     </ele-modal>
-    <Edit ref="edit" @success="save" />
+    <!-- <Edit ref="edit" @success="save" /> -->
     <ele-modal
       :visible.sync="addDialogVisible"
       width="60%"
@@ -393,6 +394,10 @@
       total: {
         type: Number,
         default: 0
+      },
+      businessType: {
+        type: String,
+        default: ''
       }
     },
     mixins: [dictMixins],
@@ -458,9 +463,9 @@
           { value: 3, label: '报废' },
           { value: 4, label: '降级使用' },
           { value: 5, label: '让步接收' },
-          { value: 6, label: '留样' },
-          { value: 7, label: '消耗' },
-          { value: 8, label: '回用/归批' },
+          // { value: 6, label: '留样' },
+          // { value: 7, label: '消耗' },
+          // { value: 8, label: '回用/归批' },
           { value: 9, label: '转试销' },
           { value: 10, label: '退货' }
         ],
@@ -704,8 +709,14 @@
             prop: 'disposalStatus',
             label: '处置状态',
             align: 'center',
+            fixed: 'right',
             width: '120',
             showOverflowTooltip: true,
+            filters: [
+              { value: 0, text: '待处置' },
+              { value: 1, text: '处置中' }
+            ],
+            filterMethod: this.disposalStatusFilter,
             formatter: (row, column, cellValue) => {
               return this.disposalStatustList[cellValue ? cellValue : 0];
             }
@@ -714,6 +725,7 @@
             prop: 'disposeType',
             label: '处置类型',
             align: 'center',
+            fixed: 'right',
             width: '120',
             showOverflowTooltip: true,
             formatter: (row, column, cellValue) => {
@@ -736,6 +748,11 @@
       this.getReasonTypeList();
     },
     methods: {
+      disposalStatusFilter(value, row, column) {
+        if (value == row.disposalStatus) {
+          return row;
+        }
+      },
       // 查询不良类型
       async getBadTypeList() {
         const res = await getBadtypeList({
@@ -1017,16 +1034,17 @@
             }
           });
           this.dialogVisible = false;
+          this.$refs.table.clearSelection();
           this.setQualifiedNumber();
         });
       },
       validate() {},
       getValue() {
-        let unqualifiedProducts = {};
+        let unqualifiedProducts = { id: this.id };
         let isNodisposeType = false;
         if (this.poList.length > 0) {
           unqualifiedProducts.poList = this.poList.map((item) => {
-            if (!item.disposeType) {
+            if (!item.disposeType && this.businessType.includes('不良品处置')) {
               isNodisposeType = true;
             }
             item.qualityResults = 1;
@@ -1064,7 +1082,7 @@
         return null;
       },
       chooseWarehouse(item) {
-        console.log(item);
+        // console.log(item);
         this.disposeForm.depotId = item.id;
         this.disposeForm.depotName = item.name;
       }

+ 0 - 1
src/views/bpm/stockManagement/details.vue

@@ -944,7 +944,6 @@
       this.getFieldModel();
       this.requestDict('类型用途');
       this.requestDict('产地');
-
       this.getAllCategoryType();
       this._getInfo(this.businessId);
     },