Przeglądaj źródła

feat(通知公文): 新增发文管理功能模块

liujt 7 miesięcy temu
rodzic
commit
914912f1f6

+ 62 - 0
src/api/documents/noticeIssuance/index.js

@@ -0,0 +1,62 @@
+import request from '@/utils/request';
+/**
+* 查询文件数据
+* @data data
+*/
+export async function noticeDocumentPageV1API(params) {
+  // if (!data.lcyStatus) {
+  //   return true
+  // }
+  const res = await request.get('/fm/noticeDocument/v1/page', { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 保存
+ * @data data
+ */
+export async function noticeDocumentCreateAPI(data) {
+  const res = await request.post('/fm/noticeDocument/v1/create', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 更新
+ * @data data
+ */
+ export async function noticeDocumentUpdateAPI(data) {
+  const res = await request.patch('/fm/noticeDocument/v1/update', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 获取信息详情
+ */
+ export async function noticeDocumentByIdAPI(id) {
+  const res = await request.get(`/fm/noticeDocument/v1/get/${id}`, {});
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
+/**
+ * 删除
+ * @id id
+ */
+export async function noticeDocumentDeleteAPI(id) {
+  const res = await request.delete(`/fm/noticeDocument/v1/delete/${id}`);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}  

+ 3 - 3
src/views/bpm/documents/documentTemplate/components/file-search.vue

@@ -20,12 +20,12 @@
       seekList() {
         return [
           {
-            prop: 'code:',
-            label: '范文名称',
+            prop: 'name',
+            label: '范文名称:',
             type: 'input'
           },
           {
-            prop: 'name',
+            prop: 'creator',
             label: '创建人:',
             type: 'input'
           }

+ 1 - 1
src/views/bpm/documents/documentTemplate/components/getCode.vue

@@ -209,7 +209,7 @@
       },
       /* 保存编辑 */
       save() {
-        this.$emit('success', this.form.code);
+        this.$emit('success', this.form);
         this.cancel();
       },
 

+ 8 - 3
src/views/bpm/documents/documentTemplate/components/mainBodyTemplate.vue

@@ -263,7 +263,7 @@
                 <span class="upload-text">上传文件,请</span>
                 <el-button type="text">点击上传</el-button>
               </el-upload> -->
-              <fileMain :type="disabled ? 'view' : 'add'" v-model="form.attachments"></fileMain>
+              <fileMain :type="disabled ? 'view' : 'add'" v-model="form.attachments" @updateVal="getFiles"></fileMain>
             </el-form-item>
           </td>
         </tr>
@@ -392,13 +392,18 @@ export default {
     
   },
   methods: {
+    getFiles() {
+      console.log('getFiles~~~', this.form.attachments);
+      const ids = JSON.parse(JSON.stringify(this.form.attachments)).join(',');
+      this.$emit('sendFiles', ids);
+    },
     getCodeOpen() {
       this.$refs.getCode.open('');
     },
-    codeSuccess(code) {
+    codeSuccess(data) {
         // this.code = code;
         this.$nextTick(() => {
-          this.$set(this.form, 'documentNumber', code);
+          this.$set(this.form, 'documentNumber', data.code);
         });
       },
     //选择人员数据

+ 137 - 59
src/views/bpm/documents/noticeIssuance/components/addOrEdit.vue

@@ -2,97 +2,172 @@
     <div class="ele-body">
         <el-card shadow="never">
             <el-tabs v-model="tabValue" type="card" @tab-click="handleTabClick">
-                <el-tab-pane label="范文信息" name="1">
-                    <el-form
-                        :model="formData"
-                        ref="form"
-                        label-width="110px"
-                        :rules="rules"
-                        style="margin-top: 20px;"
-                    >
-                        <el-row :gutter="24">
-                            <el-col :span="6">
-                                <el-form-item label="范文编号" prop="documentNo">
-                                    <el-input
-                                        placeholder="请输入范文编号"
-                                        v-model="formData.documentNo"
-                                    >
-                                    </el-input>
-                                </el-form-item>
-                            </el-col>
-                            <el-col :span="6">
-                                <el-form-item label="范文名称" prop="documentName">
-                                    <el-input
-                                        placeholder="请输入范文名称"
-                                        v-model="formData.documentName"
-                                    >
-                                    </el-input>
-                                </el-form-item>
-                            </el-col>
-                            <el-col :span="6">
-                                <el-form-item label="状态" prop="status">
-                                    <el-switch
-                                        v-model="formData.status"
-                                        active-text="启用"
-                                        inactive-text="停用">
-                                    </el-switch>
-                                </el-form-item>
-                            </el-col>
-                        </el-row>
-                    </el-form>
+                <el-tab-pane label="稿纸信息" name="1">
+                    <MainBodyTemplate ref="mainBodyTemplate" :type="routerQuery.type" @sendFiles="getFiles"></MainBodyTemplate>
                 </el-tab-pane>
-                <el-tab-pane label="稿纸信息" name="2">
-                    <MainBodyTemplate></MainBodyTemplate>
+                <el-tab-pane label="正文" name="2">
+                     <tinymce-editor :disabled="disabled" v-model="formData.content" :init="{ height: 525 }" />
                 </el-tab-pane>
-                <el-tab-pane label="正文" name="3">
-                     <tinymce-editor v-model="formData.content" :init="{ height: 525 }" />
+                <el-tab-pane label="附件查看" name="3">
+                     <el-row :gutter="20">
+                        <el-col :span="6">
+                            <div v-for="(item, index) in fileList" :key="item.id">
+                                <el-link type="primary">{{index + 1}}. {{item.name}}</el-link>
+                            </div>
+                        </el-col>
+                        <el-col :span="18">
+                            <iframe style="width: 100%; height: 62vh;" v-if="fileList && fileList.length > 0" :src="fileList?.[0]?.storagePath?.[0]?.url" frameborder="0"></iframe>
+                        </el-col>
+                     </el-row>
+                </el-tab-pane>
+                <el-tab-pane v-if="formData?.processInstance?.id" label="流程详情" name="4">
+                     <bpmDetail
+                        v-if="formData.processInstance.id"
+                        :id="formData.processInstance.id"
+                      ></bpmDetail>
                 </el-tab-pane>
             </el-tabs>
-            <div class="footer">
-                <el-button type="primary" @click="save" v-click-once>保存</el-button>
+            <div v-if="!disabled" class="footer">
+                <el-button type="primary" @click="save(0)" v-click-once>保存</el-button>
+                <el-button type="primary" @click="save(1)" v-click-once>提交</el-button>
                 <el-button @click="cancel">取消</el-button>
             </div>
         </el-card>
+        <process-submit-dialog
+          :processSubmitDialogFlag.sync="processSubmitDialogFlag"
+          v-if="processSubmitDialogFlag"
+          ref="processSubmitDialogRef"
+          @reload="cancel"
+        ></process-submit-dialog>
     </div>
 </template>
 <script>
 import MainBodyTemplate from '@/views/bpm/documents/documentTemplate/components/mainBodyTemplate.vue'
 import TinymceEditor from '@/components/TinymceEditor/index.vue';
+import { docTplTemplateById  } from '@/api/documents/doc-manage';
+import { noticeDocumentCreateAPI, noticeDocumentByIdAPI, noticeDocumentUpdateAPI } from '@/api/documents/noticeIssuance/index.js';
+import bpmDetail from '@/views/bpm/processInstance/detailNew.vue';
+import { queryIds } from '@/components/addDoc/api/index'
+
 export default {
   components: {
     MainBodyTemplate,
-    TinymceEditor
+    TinymceEditor,
+    bpmDetail
   },
 
   data() {
     return {
+      processSubmitDialogFlag: false,
       tabValue: '1',
       formData: {
-        documentNo: '',
-        documentName: '',
+        code: '',
+        name: '',
         status: true,
-        content: ''
+        content: '',
+        fields: [],
+        // directoryId: ''
       },
+      fileList: [],
       rules: {
-        documentNo: [{ required: true, message: '请输入范文编号', trigger: 'blur' }],
-        documentName: [{ required: true, message: '请输入范文名称', trigger: 'blur' }],
+        // code: [{ required: true, message: '请输入范文编号', trigger: 'blur' }],
+        name: [{ required: true, message: '请输入范文名称', trigger: 'blur' }],
         status: [{ required: true, message: '请选择状态', trigger: 'blur' }],
       }
     }
   },
+  created() {
+    this.routerQuery = this.$route.query || {};
+    // this.formData.directoryId = this.routerQuery.treeId || '';
+    // if(this.routerQuery.type == 'add') {
+    //   this.getTemplateDetail();
+    // } else if(this.routerQuery.type == 'edit') {
+      this.getDetail();
+    // }
+  },
+  computed: {
+    disabled() {
+      return this.routerQuery.type == 'detail';
+    }
+  },
   methods: {
+    async getFiles(ids) {
+      if(ids) {
+        let res = await queryIds({ ids: "'" + ids + "'" });
+        this.fileList = res || [];
+      }
+    },
+    async getDetail() {
+      const requestUrl = this.routerQuery.type == 'add' ? docTplTemplateById : noticeDocumentByIdAPI;
+      let res = await requestUrl(this.routerQuery.id);
+      this.formData = res;
+      let ids =this.formData.fields.find((item) => item.fieldKey == 'attachments')?.defaultValue || '';
+      this.getFiles(ids);
+      console.log(this.formData, this.$refs.mainBodyTemplate);
+      this.$refs.mainBodyTemplate.setData(this.formData.fields);
+    },
+    async getTemplateDetail() {
+      let res = await docTplTemplateById(this.routerQuery.id);
+      // res.status = res.status == 1 ? true : false;
+      this.formData = res;
+      let ids =this.formData.fields.find((item) => item.fieldKey == 'attachments')?.defaultValue || '';
+      this.getFiles(ids);
+      console.log(this.formData, this.$refs.mainBodyTemplate);
+      this.$refs.mainBodyTemplate.setData(this.formData.fields);
+    },
     handleTabClick(tab) {
       this.tabValue = tab.name;
     },
-    save() {
-    //   this.$refs.form.validate((valid) => {
-    //     if (valid) {
-    //       this.$emit('save', this.form);
-    //     } else {
-    //       console.log('校验失败');
-    //     }
-    //   });
+    async save(type) {
+      try {
+        // 先校验范文信息表单
+        // const formValid = await this.$refs.form.validate().catch(() => false);
+        // if (!formValid) {
+        //   this.$message.warning('请完善范文信息');
+        //   return;
+        // }
+
+        // 校验子组件 mainBodyTemplate 的必填项
+        const mainBodyValid = await this.$refs.mainBodyTemplate.$refs.form.validate().catch(() => false);
+        if (!mainBodyValid) {
+          this.$message.warning('请完善稿纸信息的必填项');
+          return;
+        }
+
+        // 获取自定义字段数据
+        const customFields = this.$refs.mainBodyTemplate.generateCustomFields();
+
+        // 将 customFields 放到 formData 字段
+        this.formData.fields = customFields;
+
+        this.formData.status = this.formData.status ? 1 : 0;
+
+        console.log('提交数据:', this.formData);
+
+        // 提交到后端
+        const loading = this.$loading({ lock: true });
+        const requestUrl = this.routerQuery.type == 'add' ? noticeDocumentCreateAPI : noticeDocumentUpdateAPI;
+        console.log('requestUrl~~~', this.routerQuery.type, requestUrl);
+        requestUrl(this.formData)
+          .then((res) => {
+            if(type == 1) {
+
+            }else {
+              loading.close();
+              this.$message.success('保存成功');
+              this.$router.go(-1);
+            }
+          })
+          .catch((e) => {
+            loading.close();
+            console.error('保存失败:', e);
+          });
+
+      } catch (error) {
+        console.error('保存异常:', error);
+      }
     },
+
     cancel() {
       this.$router.go(-1);
     },
@@ -100,7 +175,10 @@ export default {
 }
 </script>
 <style scoped>
+.el-card {
+  min-height: 600px;
+}
 .footer {
-  text-align: right;
+  text-align: center;
 }
 </style>

+ 8 - 7
src/views/bpm/documents/noticeIssuance/components/documentDialog.vue

@@ -107,7 +107,8 @@
         dimension: '1',
         cacheKeyUrl: 'document-template-list-dialog-cache-key',
         datasourceList: [],
-        columnsVersion: 1
+        columnsVersion: 1,
+        curNodeData: {}
       };
     },
     watch: {},
@@ -130,7 +131,7 @@
             showOverflowTooltip: true,
             formatter: () => {
               // 优先使用fullPath,如果没有则回退到name
-              return this.parentData?.fullPath || this.parentData?.name || '';
+              return this.curNodeData?.fullPath || this.curNodeData?.name || '';
             }
           },
           {
@@ -220,9 +221,9 @@
             ...order,
             pageNum: page,
             size: limit,
-            directoryId: this.parentData?.id,
+            directoryId: this.curNodeData?.id,
             // lcyStatus: this.lcyStatus,
-            fileType: this.fileType,
+            // fileType: this.fileType,
             // isQueryAll: this.$hasPermission('fm:doc:viewAll') ? 1 : ''
           });
         // }
@@ -305,12 +306,12 @@
       //   }
       // },
       async selected() {
-        if (!this.current && !this.selection.length) {
-          return this.$message.warning('请至少选择一条数据');
+        if (this.selection.length != 1) {
+          return this.$message.warning('请选择一条数据');
         }
 
         // }
-        let list = this.currentIndex == -1 ? this.selection : [this.current];
+        let list = this.selection;
         // let codeList = list.map((item) => item.code);
         // let idList = list.map((item) => item.id);
 

+ 84 - 165
src/views/bpm/documents/noticeIssuance/index.vue

@@ -4,11 +4,11 @@
       <seek-page :seekList="seekList" @search="search"></seek-page>
 
       <el-tabs v-model="tabValue" type="card" @tab-click="handleTabClick">
-        <el-tab-pane label="全部" name="1"></el-tab-pane>
-        <el-tab-pane label="草稿" name="5"></el-tab-pane>
-        <el-tab-pane label="审核中" name="4"></el-tab-pane>
-        <el-tab-pane label="退回" name="6"></el-tab-pane>
-        <el-tab-pane label="办结" name="7"></el-tab-pane>
+        <el-tab-pane label="全部" name="99"></el-tab-pane>
+        <el-tab-pane label="草稿" name="0"></el-tab-pane>
+        <el-tab-pane label="审核中" name="1"></el-tab-pane>
+        <el-tab-pane label="驳回" name="3"></el-tab-pane>
+        <el-tab-pane label="办结" name="2"></el-tab-pane>
       </el-tabs>
       <!-- 数据表格 -->
       <ele-pro-table
@@ -30,7 +30,7 @@
       >
         <template v-slot:toolbar>
           <el-button type="primary" @click="toAdd()">新增</el-button>
-          <el-button type="danger" @click="toDel()">删除</el-button>
+          <el-button type="danger" @click="toDelAll()">删除</el-button>
           <el-button type="success" @click="toEnd()">导出</el-button>
           <el-button type="primary" @click="allPrinting()">打印</el-button>
         </template>
@@ -120,21 +120,25 @@
             <el-link
                 type="primary"
                 :underline="false"
-                @click="routing(row)"
+                @click="toEdit('edit', row)"
             >
                 编辑
             </el-link>
-            <el-link
-                type="primary"
-                :underline="false"
-                @click="handleOrderPublish(row)"
+            <el-popconfirm
+              class="ele-action"
+              title="确定要删除吗?"
+              @confirm="
+                toDel(row)
+              "
             >
-                删除
-            </el-link>
+              <template v-slot:reference>
+                <el-link type="danger" :underline="false"> 删除 </el-link>
+              </template>
+            </el-popconfirm>
             <el-link
                 type="primary"
                 :underline="false"
-                @click="toEnd(row)"
+                @click="toSubmit(row)"
             >
                 提交
             </el-link>
@@ -146,11 +150,11 @@
                 发布
             </el-link>
 
-            <el-link
+            <!-- <el-link
                 type="primary"
                 @click="toRelease(row)"
                 >撤销</el-link
-            >
+            > -->
             <el-link
                 type="primary"
                 @click="toRelease(row)"
@@ -191,7 +195,8 @@
 //   import checkAdd from '@/views/checklistManagement/components/checkAdd.vue';
 //   import checkDetails from '@/views/checklistManagement/components/checkDetails.vue';
 //   import { getTaskInstanceList } from '@/api/produce/job';
-
+  import { noticeDocumentPageV1API, noticeDocumentDeleteAPI } from '@/api/documents/noticeIssuance/index.js';
+  
   export default {
     mixins: [tableColumnsMixin],
     components: {
@@ -202,7 +207,7 @@
       return {
         processSubmitDialogFlag: false,
         activeName: 'first',
-        tabValue: '1',
+        tabValue: '99',
         id: '',
         where: {},
         // 加载状态
@@ -241,28 +246,29 @@
         return [
           {
             label: '标题:',
-            value: 'keyWord',
+            value: 'title',
             type: 'input',
             placeholder: ''
           },
           {
             label: '发文字号:',
-            value: 'code',
+            value: 'docNumber',
             type: 'input',
             placeholder: '',
             labelWidth: 100
           },
           {
             label: '发文机关:',
-            value: 'apsWorkOrderCode',
+            value: 'issuingAuthorityId',
             type: 'select',
             labelWidth: 100
           },
           {
             label: '紧急程度:',
-            value: 'productionPlanCode',
+            value: 'urgencyLevelId',
             type: 'select',
-            width: 240
+            width: 240,
+
           },
         ];
       },
@@ -277,11 +283,13 @@
             fixed: 'left'
           },
           {
-            prop: 'batchNo',
+            columnKey: 'index',
             label: '序号',
+            type: 'index',
+            width: 55,
             align: 'center',
-            minWidth: 130,
-            showOverflowTooltip: true
+            showOverflowTooltip: true,
+            fixed: 'left'
           },
 
           {
@@ -293,61 +301,56 @@
           },
 
           {
-            prop: 'code',
-            slot: 'code',
+            prop: 'title',
             label: '标题',
             align: 'center',
             minWidth: 110,
             showOverflowTooltip: true
           },
           {
-            prop: 'QRcode',
-            slot: 'QRcode',
+            prop: 'docNumber',
             label: '发文字号',
             align: 'center',
             minWidth: 110,
             showOverflowTooltip: true
           },
           {
-            prop: 'apsWorkOrderCode',
+            prop: 'issuingAuthority',
             label: '发文机关',
-            slot: 'apsWorkOrderCode',
             align: 'center',
             minWidth: 110,
             showOverflowTooltip: true
           },
           {
-            prop: 'sourceType',
+            prop: 'draftAuthor',
             label: '拟稿人',
-            slot: 'sourceType',
             align: 'center',
             minWidth: 110,
             showOverflowTooltip: true
           },
           {
-            prop: 'sourceCode',
+            prop: 'draftDate',
             label: '拟稿日期',
             align: 'center',
             minWidth: 110,
             showOverflowTooltip: true
           },
           {
-            prop: 'workOrderType',
+            prop: 'urgencyLevelId',
             label: '紧急程度',
-            slot: 'workOrderType',
             align: 'center',
             minWidth: 110,
             showOverflowTooltip: true
           },
           {
-            prop: 'productionPlanCode',
+            prop: 'approvalStatusText',
             label: '审批状态',
             align: 'center',
             minWidth: 110,
             showOverflowTooltip: true
           },
           {
-            prop: 'planType',
+            prop: 'status',
             label: '发布状态',
             align: 'center',
             showOverflowTooltip: true,
@@ -356,43 +359,6 @@
               return obj && obj.label;
             }
           },
-          {
-            prop: 'bomType',
-            label: '当前环节',
-            align: 'center',
-            showOverflowTooltip: true,
-            width: 120,
-            formatter: (row) => {
-              if (row.bomType == 1) {
-                return '产品(PBOM)';
-              }
-              if (row.bomType == 2) {
-                return '加工(MBOM)';
-              }
-              if (row.bomType == 3) {
-                return '装配(ABOM)';
-              }
-              // if (row.bomType == 4) {
-              //   return '装配(EBOM)';
-              // }
-              return '';
-            }
-          },
-          {
-            prop: 'bomCategoryName',
-            label: '当前处理人',
-            align: 'center',
-            width: 130,
-            showOverflowTooltip: true,
-            formatter: (row) => {
-              if (row.bomCategoryName) {
-                return `${row.bomCategoryName} (V${row.bomCategoryVersions}.0)`;
-              }
-              return '';
-            }
-          },
-         
-
           {
             prop: 'action',
             label: '操作',
@@ -432,16 +398,16 @@
     },
 
     methods: {
-        processSubmit(powerData) {
-          if (this.selection.length == 0 || this.selection.length > 1) {
-            this.$message.warning('请选择一条数据');
-            return;
-          }
+        toSubmit(row) {
+          // if (this.selection.length == 0 || this.selection.length > 1) {
+          //   this.$message.warning('请选择一条数据');
+          //   return;
+          // }
     
           this.processSubmitDialogFlag = true;
           this.$nextTick(() => {
-            this.selection[0]['businessKey'] = 'fm_file_repeal_approve';
-            this.$refs.processSubmitDialogRef.init(this.selection[0]);
+            row['businessKey'] = 'fm_file_repeal_approve';
+            this.$refs.processSubmitDialogRef.init(row);
           });
         },
 
@@ -461,15 +427,40 @@
         toAdd() {
           this.$refs.documentDialogRef.open();
         },
+        toEdit(type, row = {}) {
+          this.current = row;
+          this.$router.push({
+            path: '/documents/noticeIssuance/add-or-edit',
+            // query
+            query: {
+              id: this.current.id,
+              type: type
+            }
+          });
+        },
+        toDel(row) {
+          const loading = this.$loading({ lock: true });
+          noticeDocumentDeleteAPI(row.id)
+            .then((msg) => {
+              loading.close();
+              this.$message.success('操作成功');
+              this.reload();
+            })
+            .catch((e) => {
+              loading.close();
+              // this.$message.error(e.message);
+            });
+        },
         handleSelectDone(list) {
           this.current = list[0];
           this.$router.push({
-          path: '/documents/noticeIssuance/add-or-edit/index',
-          // query
-          query: {
-            id: this.current.id
-          }
-        });
+            path: '/documents/noticeIssuance/add-or-edit',
+            // query
+            query: {
+              id: this.current.id,
+              type: 'add'
+            }
+          });
         },
       //派单
       toReleaseOpen(row) {
@@ -607,35 +598,16 @@
       /* 表格数据源 */
       async datasource({ page, limit, where, order }) {
         console.log(this.tabValue, '888');
-        let statusList = this.tabValue == 1 ? [4, 5, 7] : [this.tabValue];
-
+    
         let params = {
           ...where,
           ...order,
-          queryTermination: this.tabValue == '10' ? 1 : 0,
+          approvalStatus: this.tabValue == 99 ? '' : this.tabValue,
           pageNum: page,
           size: limit,
-          ...this.sort
         };
 
-        // 只有 tabValue == 1 才可能需要 workCenterIds 字段,可根据业务决定是否添加
-        if (this.tabValue == 1) {
-          params.workCenterIds = this.$store.state.user.info.workCenterIds;
-        }
-
-        const URL = this.tabValue == 1 ? getMyPage : getPage;
-
-        let res = await URL({ ...params, statusList });
-
-        // this.loadTaskNames(res.list);
-        // let res = await URL({ ...params, statusList });
-
-        // await Promise.all(
-        //   res.list.map(async (row) => {
-        //     const tasks = await getTaskInstanceList(row.id);
-        //     row._taskList = tasks;
-        //   })
-        // );
+        let res = await noticeDocumentPageV1API({ ...params });
 
         return res;
       },
@@ -718,56 +690,6 @@
         }
       },
 
-      // 删除
-      toDel(row) {
-        if (row) {
-          this.$confirm(`是否要完结工单【${row.code}】?`, '提醒', {
-            confirmButtonText: '确认',
-            cancelButtonText: '取消',
-            type: 'warning'
-          })
-            .then(() => {
-              batchCompletion([row.id]).then((res) => {
-                this.$message.success('成功');
-                this.reload();
-              });
-            })
-            .catch(() => {});
-        } else {
-          if (!this.selection.length) {
-            return this.$message.warning('请至少选择一条工单!');
-          }
-          const ids = [];
-          this.selection.map((item) => {
-            ids.push(item.id);
-          });
-          const h = this.$createElement;
-          this.$msgbox({
-            title: '提醒',
-            message: h('p', null, [
-              h('span', null, '是否要完结 '),
-              h(
-                'span',
-                { style: 'color: #70B603' },
-                `${this.selection.length}`
-              ),
-              h('span', null, ' 条工单?')
-            ]),
-            showCancelButton: true,
-            confirmButtonText: '确认',
-            cancelButtonText: '取消',
-            type: 'warning'
-          })
-            .then(() => {
-              batchCompletion(ids).then((res) => {
-                this.$message.success('成功');
-                this.reload();
-              });
-            })
-            .catch(() => {});
-        }
-      },
-
       // 取消完结
       toCancel(row) {
         cancelCompletion([row.id]).then((res) => {
@@ -787,10 +709,7 @@
       /* 刷新表格 */
       reload(where = {}) {
         this.$nextTick(() => {
-          where.statusList = (
-            where.status || this.statusOpt[this.activeName][0].value
-          ).split(',');
-          this.$refs.table.reload({ page: 1, where });
+          this.$refs.table.reload({ page: 1, where, approvalStatus: this.tabValue == 99 ? '' : this.tabValue });
         });
       },
 

+ 38 - 0
src/views/bpm/handleTask/components/noticeIssuance/detailDialog.vue

@@ -0,0 +1,38 @@
+<template>
+  <div>
+    
+  </div>
+</template>
+<script>
+  import { mapGetters } from 'vuex';
+  import { reduce } from 'lodash';
+
+  const defForm = {
+    
+  };
+  export default {
+    components: { },
+    computed: {
+      ...mapGetters(['user'])
+    },
+    props: {
+      businessId: {
+        default: ''
+      }
+    },
+    data() {
+      return {
+        form: {
+          ...defForm
+        }
+      };
+    },
+    created() {
+      this.getInfo(this.businessId);
+    },
+    methods: {
+     
+    }
+  };
+</script>
+<style scoped lang="scss"></style>

+ 157 - 0
src/views/bpm/handleTask/components/noticeIssuance/submit.vue

@@ -0,0 +1,157 @@
+<template>
+  <el-col :span="16" :offset="6">
+    <el-form label-width="100px" ref="formRef" :model="form">
+      <el-form-item
+        label="审批建议"
+
+        style="margin-bottom: 20px"
+        :rules="{
+          required: true,
+          message: '请选择',
+          trigger: 'change'
+        }"
+      >
+        <el-input
+          type="textarea"
+          v-model="form.reason"
+          placeholder="请输入审批建议"
+        />
+      </el-form-item>
+    </el-form>
+    <div style="margin-left: 10%; margin-bottom: 20px; font-size: 14px">
+      <el-button
+        icon="el-icon-edit-outline"
+        type="success"
+        size="mini"
+        v-click-once
+        @click="handleAudit(1)"
+        >通过
+      </el-button>
+      <el-button
+        icon="el-icon-circle-close"
+        type="danger"
+        size="mini"
+        v-click-once
+        @click="handleAudit(0)"
+       
+        >驳回
+      </el-button>
+
+      <el-dropdown @command="(command) => handleCommand(command)" style="margin-left: 30px;">
+        <span class="el-dropdown-link">更多<i class="el-icon-arrow-down el-icon--right"></i></span>
+        <el-dropdown-menu slot="dropdown">
+          <el-dropdown-item command="cancel">作废</el-dropdown-item>
+        </el-dropdown-menu>
+      </el-dropdown>
+    
+    </div>
+  </el-col>
+</template>
+
+<script>
+  import { UpdateInformation, cancel } from '@/api/bpm/components/contractManage/contractBook';
+  import {approveTaskWithVariables, rejectTask,cancelTask} from '@/api/bpm/task';
+  import { listAllUserBind } from '@/api/system/organization';
+
+  // 流程实例的详情页,可用于审批
+  export default {
+    name: '',
+    components: {
+      //   Parser
+    },
+    props: {
+      businessId: {
+        default: ''
+      },
+      taskId: {
+        default: ''
+      },
+      id: {
+        default: ''
+      },
+      taskDefinitionKey: {
+        default: ''
+      }
+    },
+    data() {
+      return {
+        form: {
+          reason: '同意'
+        },
+        userOptions: []
+      };
+    },
+    created() {
+
+      this.userOptions = [];
+      listAllUserBind().then((data) => {
+        this.userOptions.push(...data);
+      });
+    },
+    methods: {
+      /** 处理转办审批人 */
+      handleUpdateAssignee() {
+        this.$emit('handleUpdateAssignee');
+      },
+      /** 退回 */
+      handleBackList() {
+        this.$emit('handleBackList');
+      },
+
+
+      async handleAudit(status) {
+        let variables = {
+          pass: !!status
+        };
+
+        let API = !!status ? approveTaskWithVariables : rejectTask;
+        console.log('this.taskId~~', this.form);
+        API({
+          id: this.taskId,
+          reason: this.form.reason,
+          variables
+        }).then((res) => {
+          if (res.data.code != '-1') {
+            this.$emit('handleAudit', {
+              status,
+              title: status === 0 ? '驳回' : ''
+            });
+          }
+        });
+      },
+
+      getTableValue() {
+        return new Promise((resolve, reject) => {
+          this.$emit('getTableValue', async (data) => {
+            resolve(await data);
+          });
+        });
+      },
+
+      //更多
+      handleCommand(command) {
+        if (command === 'cancel') {
+          this.$confirm("是否确认作废?", {
+            type: 'warning',
+            cancelButtonText: '取消',
+            confirmButtonText: '确定'
+          }).then(() => {
+            cancelTask({
+              id: this.id,
+              taskId: this.taskId,
+              reason: this.form.reason,
+              businessId: this.businessId,
+            }).then(() => {
+              this.$emit('handleClose');
+            }).catch(() => {
+              this.$message.error("流程作废失败");
+            });
+          }).catch(() => {});
+        }
+      },
+
+    }
+  };
+</script>
+
+<style lang="scss"></style>

+ 49 - 26
src/views/home/indexNew.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="home-container">
-    <el-row :gutter="12" style="height: 158px;">
+    <el-row :gutter="12" style="height: 148px;">
       <el-col :span="24" class="box-col">
         <el-card class="box-card">
           <div slot="header" class="clearfix">
@@ -38,7 +38,7 @@
       </el-col>
     </el-row>
 
-    <el-row :gutter="12" class="mt-20" style="height: 250px;">
+    <el-row :gutter="12" class="mt-20" style="height: 242px;">
       <el-col :span="18" class="box-col">
         <el-card class="box-card">
           <div slot="header" class="clearfix">
@@ -130,7 +130,7 @@
           <div class="card-content portal-content">
             <div class="portal">
               <el-row :gutter="12">
-                <el-col :span="12" v-for="item in portals" :key="item.name" class="portal-item">
+                <el-col :span="8" v-for="item in portals" :key="item.name" class="portal-item">
                   <div class="portal-item-content">
                     <div class="portal-item-img"><img :src="item.img" alt=""></div>
                     <div class="portal-item-name">{{ item.name }}</div>
@@ -168,7 +168,7 @@
                     <div class="notification-title">{{ item.title }}</div>
                     <div class="notification-text">{{ item.content }}</div>
                   </div>
-                  <div class="notification-info">发文机关:{{ item.department }}  {{ item.createUser }}</div>
+                  <div class="notification-info">{{ item.department }}  {{ item.createUser }}</div>
                 </div>
                 <div class="notification-date">{{ item.createTime }}</div>
               </div>
@@ -192,8 +192,8 @@
               <template
                 slot="dateCell"
                 slot-scope="{date, data}">
-                <div class="calendar-day-content">
-                  <div :class="data.isSelected ? 'is-selected-day' : ''" @click="handleDateClick(data.day)">{{ data.day.split('-')[2] }} </div>
+                <div class="calendar-day-content" @click="handleDateClick(data.day)">
+                  <div :class="data.isSelected ? 'is-selected-day' : ''">{{ data.day.split('-')[2] }} </div>
                   <div class="dot-container" v-if="hasSchedule(data.day)"><span class="dot"></span></div>
                 </div>
               </template>
@@ -206,13 +206,14 @@
             <div class="schedule">
               <div class="schedule-item" v-for="(item, index) in getScheduleListByDate()" :key="index">
                 <el-row :gutter="20">
-                  <el-col :span="8">
+                  <el-col :span="10">
                     <div class="schedule-item-time">
                       <div>{{ item.startTime }}</div>
+                      <div>~</div>
                       <div>{{ item.endTime }}</div>
                     </div>
                   </el-col>
-                  <el-col :span="16">
+                  <el-col :span="14">
                     <div class="schedule-item-name">
                       {{ item.title || item.name || '日程安排' }}
                     </div>
@@ -248,6 +249,7 @@ import { deepClone } from 'ele-admin/lib/utils/core';
 import { mapGetters } from 'vuex';
 import vuedraggable from 'vuedraggable';
 import commonDialog from '@/views/home/common-dialog.vue';
+import { noticeDocumentPageV1API } from '@/api/documents/noticeIssuance/index.js';
 export default {
   name: 'HomePage',
   components: {
@@ -292,6 +294,14 @@ export default {
           // 重新获取日程数据
           this.getMyWorkCalendar();
         }
+        // 日期变化时,处理选中日期的日程
+        if (newVal !== oldVal) {
+          const year = newVal.getFullYear();
+          const month = String(newVal.getMonth() + 1).padStart(2, '0');
+          const day = String(newVal.getDate()).padStart(2, '0');
+          const dateStr = `${year}-${month}-${day}`;
+          this.handleDateClick(dateStr);
+        }
       },
       deep: true
     }
@@ -356,6 +366,7 @@ export default {
       return this.groupedWorkCalendar && this.groupedWorkCalendar[day] && this.groupedWorkCalendar[day].length > 0;
     },
     handleDateClick(day) {
+      console.log('day~~~', day);
       this.selectedScheduleDate = day;
     },
     getScheduleListByDate() {
@@ -401,7 +412,19 @@ export default {
     async getMessageList() {
       let list = [];
       if(this.activeTab === 'notice') {
-        list = []
+        const res = noticeDocumentPageV1API({
+          pageNum: 1,
+          size: 5,
+        })
+        list = (res.list || []).map((item) => {
+          return {
+            title: item.title,
+            content: item.templateContent,
+            createUser: '拟稿人:' + item.draftAuthor,
+            department: '发文机关:' + item.issuingAuthority,
+            createTime: item.createTime
+          }
+        });
       } else if(this.activeTab === 'industry') {
         list = []
       } else if(this.activeTab === 'system') {
@@ -434,7 +457,7 @@ export default {
       this.myTaskList = await getMyTaskTotal({});
     },
     handleAdd() {
-      if(this.commonFunctions.length > 10) return this.$message.warning('最多只能添加10个常用功能');
+      if(this.commonFunctions.length > 12) return this.$message.warning('最多只能添加12个常用功能');
       this.commonDialogFlag = true;
       this.$nextTick(() => {
         this.$refs.commonDialogRef.init();
@@ -502,7 +525,7 @@ export default {
       // this.currentPage++;
       switch(this.activeTab) {
         case 'notice':
-          this.handelRouterTo('/notice');
+          this.handelRouterTo('/page-wt/documents/noticeIssuance');
           break;
         case 'industry':
           this.handelRouterTo('/industry');
@@ -640,13 +663,13 @@ export default {
         flex-direction: column;
         justify-content: center;
         align-items: center;
-        margin: 0 20px;
+        margin: 0 18px;
         border-radius: 5px;
         cursor: pointer;
         transition: all 0.3s ease-in-out;
         .common-function-item-icon {
-          width: 56px;
-          height: 56px;
+          width: 50px;
+          height: 50px;
           box-shadow: 0px 1px 2px 1px #eae7e7;
           background: #f8fafc;
           border-radius: 17px;
@@ -654,14 +677,14 @@ export default {
           justify-content: center;
           align-items: center;
           img {
-            width: 32px;
-            height: 32px;
+            width: 30px;
+            height: 30px;
           }
         }
         .common-function-item-name {
-          font-size: 16px;
+          font-size: 14px;
           font-weight: 400;
-          color: #7a7a7a;
+          color: #3f3e3e;
           margin-top: 10px;
         }
       }
@@ -716,7 +739,7 @@ export default {
               font-weight: 500;
               color: #2D80EE;
               line-height: 42px;
-              margin-top: 8px;
+              // margin-top: 8px;
             }
           }
         }
@@ -733,13 +756,13 @@ export default {
             align-items: center;
             cursor: pointer;
             .overview-bottom-item-name {
-              font-size: 16px;
+              font-size: 14px;
               font-weight: 400;
-              color: #7a7a7a;
+              color: #686767;
               margin-right: 30px;
             }
             .overview-bottom-item-count {
-              font-size: 16px;
+              font-size: 15px;
               font-weight: 400;
               color: #303133;
             }
@@ -758,10 +781,10 @@ export default {
           border-radius: 11px;
           border: 1px solid #ebebeb;
           box-shadow: 0px 4px 4px #a7a7a740;
-          padding: 10px 24px 10px 24px;
+          padding: 6px 4px;
           .portal-item-img {
-            width: 35px;
-            height: 35px;
+            width: 32px;
+            height: 32px;
             border-radius: 5px;
             margin-right: 10px;
             img {
@@ -770,7 +793,7 @@ export default {
             }
           }
           .portal-item-name {
-            font-size: 14px;
+            font-size: 13px;
             font-weight: bold;
             color: #303133;
           }