lizhenhao vor 2 Jahren
Ursprung
Commit
0e8ff0a7b3

+ 5 - 0
src/components/editor/WangEditor.vue

@@ -25,6 +25,10 @@ export default {
     isClear: {
       type: Boolean,
       default: false
+    },
+    index: {
+      type: Number,
+      default: 0
     }
   },
   watch: {
@@ -87,6 +91,7 @@ export default {
           // 图片上传成功回调
           // editor.txt.append('<img style="max-width: 650px" src=' + result.lsUrl + '></img>')
           editor.uploadImg.insertLinkImg(result.lsUrl)
+          this.$emit('getUrl', result.url, result.lsUrl, this.index)
         },
         timeout: (xhr, editor) => {
           // 网络超时的回调

+ 1 - 1
src/views/modules/flowable/task/TaskForm.vue

@@ -267,7 +267,7 @@
           } catch (e) {
             console.log(e)
           }
-        }, 500)
+        }, 200)
       },
       cc (procInsId) {
         if (this.isCC && this.auditForm.userIds) {

+ 65 - 7
src/views/modules/klgBase/questions/KlgBaseQuestionsForm.vue

@@ -61,14 +61,18 @@
         <el-col :span="24">
           <el-form-item label="问题内容" prop="content"
           >
-            <WangEditor ref="contentEditor" v-model="inputForm.content"/>
+            <WangEditor ref="contentEditor" v-model="inputForm.content"
+                        @getUrl="(url, lsUrl) => {
+                        inputForm.editorFilesDTOList.push({temporaryUrl: lsUrl, url: url});
+                        }"/>
           </el-form-item>
         </el-col>
         <el-col :span="24" v-for="(item,index) in inputForm.klgBaseReplyDTOList">
           <el-form-item :label="commonJS.isNotEmpty(item.replyName)?item.replyName+'回复:':'回复:'"
                         :prop="'content'+index"
           >
-            <WangEditor ref="contentEditorList" v-model="item.content"/>
+            <WangEditor ref="contentEditorList" :index="index" v-model="item.content"
+                        @getUrl="getUrl"/>
           </el-form-item>
         </el-col>
       </el-row>
@@ -118,6 +122,7 @@
           status: '',
           procInsId: '',
           processDefinitionId: '',
+          editorFilesDTOList: [],
           klgBaseDisposeDTOList: [],
           klgBaseReplyDTOList: [],
           workAttachmentDtoList: []
@@ -133,7 +138,7 @@
       bus: {
         get () {
           this.$refs.uploadComponent.setDividerName('附件')
-          this.$refs.contentEditor.clear()
+          // this.$refs.contentEditor.clear()
           return this.businessId
         },
         set (val) {
@@ -144,10 +149,8 @@
     watch: {
       'keyWatch': {
         handler (newVal) {
-          if (this.bus) {
-            if (this.bus !== 'false') {
-              this.init('', this.bus)
-            }
+          if (this.commonJS.isNotEmpty(this.bus)) {
+            this.init('', this.bus)
           } else {
             this.$nextTick(() => {
               this.$refs.inputForm.resetFields()
@@ -182,6 +185,7 @@
           status: '',
           procInsId: '',
           processDefinitionId: '',
+          editorFilesDTOList: [],
           klgBaseDisposeDTOList: [],
           klgBaseReplyDTOList: [],
           workAttachmentDtoList: []
@@ -204,6 +208,9 @@
             if (this.commonJS.isNotEmpty(this.inputForm.content)) {
               this.$refs.contentEditor.init(this.inputForm.content)
             }
+            if (this.commonJS.isEmpty(this.inputForm.editorFilesDTOList)) {
+              this.inputForm.editorFilesDTOList = []
+            }
             if (this.commonJS.isEmpty(this.inputForm.workAttachmentDtoList)) {
               this.inputForm.workAttachmentDtoList = []
             }
@@ -278,6 +285,8 @@
           } else {
             this.inputForm.klgBaseDisposeDTOList = []
           }
+          this.getEditorFilesDTOList()
+          this.getEditorFilesDTOS()
           this.klgBaseQuestionsService.saveForm(this.inputForm).then(({data}) => {
             this.inputForm.assignee = this.inputForm.disposeBy
             callback(data.businessTable, data.businessId, this.inputForm)
@@ -294,6 +303,7 @@
           if (this.inputForm.status === '2') {
             this.inputForm.status = '5'
           } else if (this.inputForm.status === '5') {
+            this.inputForm.finishDate = this.moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
             this.inputForm.status = '6'
           }
         }
@@ -319,6 +329,8 @@
             } else {
               this.inputForm.klgBaseDisposeDTOList = []
             }
+            this.getEditorFilesDTOList()
+            this.getEditorFilesDTOS()
             this.klgBaseQuestionsService.saveForm(this.inputForm).then(({data}) => {
               if (this.inputForm.status === '2') {
                 this.inputForm.assignee = this.inputForm.disposeBy
@@ -377,6 +389,8 @@
             } else if (this.inputForm.status === '5') {
               this.inputForm.status = '2'
             }
+            this.getEditorFilesDTOList()
+            this.getEditorFilesDTOS()
             this.klgBaseQuestionsService.saveForm(this.inputForm).then(({data}) => {
               this.inputForm.assignee = this.inputForm.disposeBy
               callback(data.businessTable, data.businessId, this.inputForm)
@@ -405,6 +419,7 @@
           status: '',
           procInsId: '',
           processDefinitionId: '',
+          editorFilesDTOList: [],
           klgBaseDisposeDTOList: [],
           klgBaseReplyDTOList: [],
           workAttachmentDtoList: []
@@ -421,6 +436,49 @@
           this.inputForm.programId = rows[0].id // 项目id
           this.inputForm.programName = rows[0].name // 项目名称
         }
+      },
+      getEditorFilesDTOList () {
+        let a = []
+        // this.inputForm.content.splice('amp;', '')
+        if (this.commonJS.isNotEmpty(this.inputForm.editorFilesDTOList)) {
+          this.inputForm.editorFilesDTOList.forEach((item) => {
+            if (this.inputForm.content.includes(item.temporaryUrl)) {
+              a.push(item)
+            }
+          })
+        }
+        setTimeout(() => {
+          this.inputForm.editorFilesDTOList = []
+          a.forEach((item) => {
+            this.inputForm.editorFilesDTOList.push(item)
+          })
+        }, 200)
+      },
+      getEditorFilesDTOS () {
+        if (this.commonJS.isNotEmpty(this.inputForm.klgBaseReplyDTOList)) {
+          this.inputForm.klgBaseReplyDTOList.forEach((item, index) => {
+            let a = []
+            if (this.commonJS.isNotEmpty(item.editorFilesDTOList)) {
+              item.editorFilesDTOList.forEach((item2) => {
+                if (item.content.includes(item2.temporaryUrl)) {
+                  a.push(item)
+                }
+              })
+            }
+            setTimeout(() => {
+              this.inputForm.klgBaseReplyDTOList[index].editorFilesDTOList = []
+              a.forEach((item) => {
+                this.inputForm.klgBaseReplyDTOList[index].editorFilesDTOList.push(item)
+              })
+            }, 200)
+          })
+        }
+      },
+      getUrl (url, lsUrl, index) {
+        if (this.commonJS.isEmpty(this.inputForm.klgBaseReplyDTOList[index].editorFilesDTOList)) {
+          this.inputForm.klgBaseReplyDTOList[index].editorFilesDTOList = []
+        }
+        this.inputForm.klgBaseReplyDTOList[index].editorFilesDTOList.push({temporaryUrl: lsUrl, url: url})
       }
     }
   }

+ 94 - 74
src/views/modules/klgBase/questions/KlgBaseQuestionsList.vue

@@ -2,8 +2,35 @@
   <div class="page">
     <el-form size="small" :inline="true" class="query-form" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
       <!-- 搜索框-->
-      <el-form-item prop="name">
-        <el-input size="small" v-model="searchForm.name" placeholder="请输入附件类型名称" clearable></el-input>
+      <el-form-item prop="title">
+        <el-input size="small" v-model="searchForm.title" placeholder="请输入标题" clearable></el-input>
+      </el-form-item>
+      <el-form-item prop="programName">
+        <el-input @focus="openProgramPageForm()" v-model="searchForm.programName" @clear="clearProgram" placeholder="请选择项目" clearable></el-input>
+      </el-form-item>
+      <el-form-item prop="status">
+        <el-select size="small" v-model="searchForm.status" placeholder="请选择问题状态" clearable>
+          <el-option
+            v-for="item in statusList"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value">
+          </el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item prop="createDateList" label="提交时间">
+        <el-date-picker
+          size="small"
+          v-model="searchForm.createDateList"
+          type="daterange"
+          value-format="yyyy-MM-dd"
+          range-separator="至"
+          style="width: 100%  "
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          placement="bottom-start"
+          clearabl>
+        </el-date-picker>
       </el-form-item>
       <el-form-item>
         <el-button type="primary" @click="refreshList()" size="small" icon="el-icon-search">查询</el-button>
@@ -14,10 +41,10 @@
       <vxe-toolbar :refresh="{query: refreshList}" custom>
         <template #buttons>
           <el-button v-if="hasPermission('klg:question:add')" type="primary" size="small" icon="el-icon-plus" @click="start()">新建</el-button>
-          <el-button v-if="hasPermission('klg:question:del')" type="danger"   size="small" icon="el-icon-delete" @click="del()" :disabled="$refs.questionsTable && $refs.questionsTable.getCheckboxRecords().length === 0" plain>删除</el-button>
+<!--          <el-button v-if="hasPermission('klg:question:del')" type="danger"   size="small" icon="el-icon-delete" @click="del()" :disabled="$refs.questionsTable && $refs.questionsTable.getCheckboxRecords().length === 0" plain>删除</el-button>-->
         </template>
       </vxe-toolbar>
-      <div style="height: calc(100% - 50px)">
+      <div style="height: calc(100% - 90px)">
         <vxe-table
           :key="tableKey"
           border="inner"
@@ -38,12 +65,16 @@
           <vxe-column type="seq" width="60" title="序号"></vxe-column>
           <vxe-column type="checkbox" width="40" ></vxe-column>
           <vxe-column min-width="160"align="center" title="标题" field="title"></vxe-column>
-          <vxe-column min-width="160"align="center" title="问题类型" field="type"></vxe-column>
-          <vxe-column min-width="160"align="center" title="所属项目" field="programId"></vxe-column>
+          <vxe-column min-width="160"align="center" title="问题类型" field="type">
+            <template slot-scope="scope">
+              {{$dictUtils.getDictLabel("question_type", scope.row.type, '-')}}
+            </template>
+          </vxe-column>
+          <vxe-column min-width="160"align="center" title="所属项目" field="programName"></vxe-column>
           <vxe-column min-width="160"align="center" title="提交人" field="createBy.name"></vxe-column>
           <vxe-column min-width="160"align="center" title="提交时间" field="createDate"></vxe-column>
-          <vxe-column min-width="160"align="center" title="处理人" field="createDate"></vxe-column>
-          <vxe-column min-width="160"align="center" title="结案时间" field="createDate"></vxe-column>
+          <vxe-column min-width="200"align="center" title="处理人" field="disposeByName"></vxe-column>
+          <vxe-column min-width="160"align="center" title="结案时间" field="finishDate"></vxe-column>
           <vxe-column  min-width="150px"align="center" fixed="right" title="状态" field="status" >
             <template slot-scope="scope">
               <el-button  type="text" @click="registeredDetail(scope.row)" effect="dark" size="mini"
@@ -55,16 +86,25 @@
           <vxe-column title="操作" width="150px" fixed="right" align="center">
             <template  slot-scope="scope">
               <el-button v-if="hasPermission('klg:question:edit')&&scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4'" type="text" icon="el-icon-edit" size="small" @click="registeredPush(scope.row)">修改</el-button>
-              <el-button v-if="hasPermission('klg:question:edit')&&scope.row.status==='2'" type="text" icon="el-icon-edit" size="small" @click="registeredReback(scope.row)">撤回</el-button>
-<!--              <el-button v-if="hasPermission('klg:question:edit')&&scope.row.status==='5'" type="text" icon="el-icon-edit" size="small" @click="auditPush(scope.row)">处理回复</el-button>-->
-<!--              <el-button v-if="hasPermission('klg:question:edit')&&scope.row.status==='6'" type="text" icon="el-icon-edit" size="small" @click="auditReback(scope.row)">撤回回复驳回</el-button>-->
-<!--              <el-button v-if="hasPermission('klg:question:del')&&scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4'" type="text"  icon="el-icon-delete" size="small" @click="del(scope.row.id)">删除</el-button>-->
+              <el-button v-if="hasPermission('klg:question:edit')&&scope.row.status==='2'||scope.row.status==='5'" type="text" icon="el-icon-edit" size="small" @click="registeredReback(scope.row)">撤回</el-button>
+              <el-button v-if="hasPermission('klg:question:del')&&scope.row.status==='1'||scope.row.status==='3'||scope.row.status==='4'" type="text"  icon="el-icon-delete" size="small" @click="del(scope.row.id)">删除</el-button>
             </template>
           </vxe-column>
         </vxe-table>
+        <vxe-pager
+          background
+          size="small"
+          :current-page="tablePage.currentPage"
+          :page-size="tablePage.pageSize"
+          :total="tablePage.total"
+          :page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"
+          :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
+          @page-change="currentChangeHandle">
+        </vxe-pager>
       </div>
     </div>
 <!--    <KlgBaseQuestionsForm  ref="klgBaseQuestionsForm" @refreshDataList="refreshList"></KlgBaseQuestionsForm>-->
+    <ProgramPageForm ref="programPageForm" @getProgram="getProgram"></ProgramPageForm>
   </div>
 </template>
 
@@ -73,13 +113,18 @@
   import KlgBaseQuestionsForm from './KlgBaseQuestionsForm'
   import TaskService from '@/api/flowable/TaskService'
   import ProcessService from '@/api/flowable/ProcessService'
+  import ProgramPageForm from '@/views/modules/finance/invoice/ProgramPageForm'
   import pick from 'lodash.pick'
   export default {
     data () {
       return {
         searchForm: {
-          type: '',
-          sort: ''
+          createDateList: [],
+          createDateBegin: '',
+          createDateEnd: '',
+          title: '',
+          programName: '',
+          status: ''
         },
         dataList: [],
         tablePage: {
@@ -92,7 +137,15 @@
         loading: false,
         processDefinitionAuditId: '',
         procDefAuditKey: '',
-        taskId: ''
+        taskId: '',
+        statusList: [
+          {label: '未发起', value: '0'},
+          {label: '暂存', value: '1'},
+          {label: '回复中', value: '2'},
+          {label: '问题撤回', value: '3'},
+          {label: '问题驳回', value: '4'},
+          {label: '已结案', value: '6'}
+        ]
       }
     },
     klgBaseQuestionsService: null,
@@ -104,7 +157,8 @@
       this.processService = new ProcessService()
     },
     components: {
-      KlgBaseQuestionsForm
+      KlgBaseQuestionsForm,
+      ProgramPageForm
     },
     computed: {
       userName () {
@@ -140,6 +194,15 @@
       // 获取数据列表
       refreshList () {
         this.loading = true
+        if (!this.commonJS.isEmpty(this.searchForm.createDateList)) {
+          if (!this.commonJS.isEmpty(this.searchForm.createDateList[0]) && !this.commonJS.isEmpty(this.searchForm.createDateList[1])) {
+            this.searchForm.createDateBegin = this.moment(this.searchForm.createDateList[0]).format('YYYY-MM-DD HH:mm:ss')
+            this.searchForm.createDateEnd = this.moment(this.searchForm.createDateList[1]).format('YYYY-MM-DD HH:mm:ss')
+          }
+        } else {
+          this.searchForm.createDateBegin = ''
+          this.searchForm.createDateEnd = ''
+        }
         this.klgBaseQuestionsService.list({
           'current': this.tablePage.currentPage,
           'size': this.tablePage.pageSize,
@@ -192,6 +255,8 @@
       },
       resetSearch () {
         this.$refs.searchForm.resetFields()
+        this.searchForm.programId = ''
+        this.searchForm.programName = ''
         this.refreshList()
       },
       start () {
@@ -270,7 +335,7 @@
           })
         }
       },
-      // 撤回项目登记审批
+      // 撤回业务提问
       registeredReback (row) {
         this.$confirm(`确定要撤回该申请吗?`, '提示', {
           confirmButtonText: '确定',
@@ -278,7 +343,7 @@
           type: 'warning'
         }).then(async () => {
           await this.klgBaseQuestionsService.queryById(row.id).then(({data}) => {
-            if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+            if (row.procInsId !== data.procInsId) { // status的值不等于“审核中”,就弹出提示
               this.$message.error('数据已发生改变或不存在,请刷新数据')
               this.err = true
             }
@@ -296,63 +361,18 @@
           }
         })
       },
-      // 业务回复审核
-      async auditPush (row) {
-        await this.taskService.getTaskId({procDefId: this.processDefinitionAuditId, procInsId: row.procInsId}).then((data) => {
-          this.taskId = data.data
-        })
-        // 读取流程表单
-        let title = `发起流程【业务回复审核】`
-        let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了[业务回复审核]`
-        let status = 'agreeAndReject'
-        this.taskService.getTaskDef({ procDefId: this.processDefinitionAuditId,
-          businessId: row.id,
-          businessTable: 'klg_base_questions'}).then((data) => {
-            this.$router.push({
-              path: '/flowable/task/TaskForm',
-              query: {
-                procDefId: this.processDefinitionAuditId,
-                procDefKey: this.procDefAuditKey,
-                title: title,
-                formType: data.data.formType,
-                formUrl: data.data.formUrl,
-                formTitle: processTitle,
-                businessTable: 'klg_base_questions',
-                businessId: row.id,
-                isShow: 'false',
-                status: status,
-                taskId: this.taskId,
-                formReadOnly: true,
-                routePath: '/klgBase/questions/KlgBaseQuestionsList'
-              }
-            })
-          })
+      openProgramPageForm () {
+        this.$refs.programPageForm.init('1', false)
       },
-      // 撤回项目登记审批
-      auditReback (row) {
-        this.$confirm(`确定要撤回该申请吗?`, '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(async () => {
-          await this.klgBaseQuestionsService.queryById(row.id).then(({data}) => {
-            if (data.status !== '6') { // status的值不等于“审核中”,就弹出提示
-              this.$message.error('数据已发生改变或不存在,请刷新数据')
-              this.err = true
-            }
-          })
-          if (this.err === true) {
-            this.err = ''
-            this.refreshList()
-          } else {
-            this.processService.revokeProcIns(row.procInsId).then(({data}) => {
-              let form = {status: '5', id: row.id}
-              this.klgBaseQuestionsService.updateStatusById(form)
-              this.$message.success(data)
-              this.refreshList()
-            })
-          }
-        })
+      getProgram (rows) {
+        if (this.commonJS.isNotEmpty(rows)) {
+          this.searchForm.programId = rows[0].id // 项目id
+          this.searchForm.programName = rows[0].name // 项目名称
+        }
+      },
+      clearProgram () {
+        this.searchForm.programId = ''
+        this.searchForm.programName = ''
       }
     }
   }