Browse Source

访问其他业务系统

sangwenwei 1 year atrás
parent
commit
7241649617

+ 34 - 0
src/api/centerservice/ccpm/CcpmService.js

@@ -0,0 +1,34 @@
+import request from '@/utils/httpRequest'
+import { FLOW_PATH as prefix } from "../../AppPath";
+
+export default class CcpmService {
+  getByIdGenerate (id, processDefKey) {
+    return request({
+      url: prefix+'/ccpm_control/getByIdGenerate',
+      method: 'get',
+      params: {id: id, processDefKey: processDefKey}
+    })
+  }
+  reimAudit (id, flag, comment, processDefKey) {
+    return request({
+      url: prefix+'/ccpm_reimbursement/reimAudit',
+      method: 'get',
+      params: {id: id, flag: flag, comment: comment, processDefKey: processDefKey}
+    })
+  }
+	invoiceAudit (id, flag, comment, processDefKey,jsonData) {
+		return request({
+			url: prefix+'/ccpm_reimbursement/invoiceAudit',
+			method: 'get',
+			params: {id: id, flag: flag, comment: comment, processDefKey: processDefKey, jsonData: jsonData}
+		})
+	}
+	queryByNumber(number){
+		return request({
+			url: prefix+'/ccpm_reimbursement/queryByNumber',
+			method: 'get',
+			params: {number: number}
+		})
+
+	}
+}

+ 19 - 0
src/api/centerservice/ccpm/FlowService.js

@@ -0,0 +1,19 @@
+import request from '@/utils/httpRequest'
+import { FLOW_PATH as prefix } from "../../AppPath";
+
+export default class FlowService {
+  getHistoicFlowList (procInsId) {
+    return request({
+      url: prefix+'/ccpm_flow/getHistoicFlowList',
+      method: 'get',
+      params: {procInsId: procInsId}
+    })
+  }
+  getFlowChart (procInsId) {
+    return request({
+      url: prefix+'/ccpm_flow/getFlowChart',
+      method: 'get',
+      params: {procInsId: procInsId}
+    })
+  }
+}

+ 33 - 0
src/api/centerservice/ccpm/ReimbursementService.js

@@ -0,0 +1,33 @@
+import request from '@/utils/httpRequest'
+import { FLOW_PATH as prefix } from "../../AppPath";
+
+export default class ReimbursementService {
+  getReimbursementById (id, processDefKey) {
+    return request({
+      url: prefix+'/ccpm_reimbursement/getReimbursementById',
+      method: 'get',
+      params: {id: id, processDefKey: processDefKey}
+    })
+  }
+  reimAudit (id, flag, comment, processDefKey) {
+    return request({
+      url: prefix+'/ccpm_reimbursement/reimAudit',
+      method: 'get',
+      params: {id: id, flag: flag, comment: comment, processDefKey: processDefKey}
+    })
+  }
+  reimReapply (id) {
+    return request({
+      url: prefix+'/ccpm_reimbursement/reimReapply',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+  deleteReim (id) {
+    return request({
+      url: prefix+'/ccpm_reimbursement/deleteReim',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+}

+ 4 - 0
src/router/systemRouter.js

@@ -80,6 +80,10 @@ const routes = [
 				component: () => import("@/layout/other/empty.vue"),
 				meta: { target: "iframe" },
 			},
+			{path: '/flowable/task/CenterForm', component: () => import('@/views/flowable/task/CenterForm'), name: 'center-form', meta: {title: '流程详情-其他系统'}},
+			{path: '/generateForm/GenerateForm', component: () => import('@/views/generateForm/GenerateForm.vue'), name: 'generate-form', meta: {title: '流程详情动态页面-其他系统'}},
+			{path: '/generateForm/InvoiceUpdateGenerateForm', component: () => import('@/views/generateForm/InvoiceUpdateGenerateForm.vue'), name: 'invoiceUpdateGenerate-form', meta: {title: '发票流程详情动态页面-其他系统'}},
+			{path: '/generateForm/InvoiceGenerateForm', component: () => import('@/views/generateForm/InvoiceGenerateForm.vue'), name: 'invoiceGenerate-form', meta: {title: '发票流程详情动态页面-其他系统'}},
 		],
 	},
 	{

+ 4 - 4
src/views/common/UpLoadComponentCcpm.vue

@@ -29,7 +29,7 @@
         :data="dataListNew">
         <el-table-column type="seq" width="40"></el-table-column>
         <el-table-column label="文件名称" prop="name" align="center">
-          <template scope="scope">
+          <template #default="scope">
             <div v-if="ifName(scope.row) === true">
               <el-image
                 style="width: 30px; height: 30px;padding-top: 4px"
@@ -50,9 +50,9 @@
 <!--          </template>-->
 <!--        </el-table-column>-->
         <el-table-column label="操作" width="200px" fixed="right" align="center">
-          <template  scope="scope">
-            <el-button type="text"  icon="el-icon-edit" size="small" @click="toHref(scope.row)" :disabled="false">下载</el-button>
-            <el-button type="text"  icon="el-icon-delete" size="small"  @click="deleteById(scope.row, scope.$index,fileList)" :disabled="auth==='view'&&delFlag === false&&createBy!==scope.row.createBy.name">删除</el-button>
+          <template  #default="scope">
+            <el-button text type="primary" icon="el-icon-edit" size="small" @click="toHref(scope.row)" :disabled="false">下载</el-button>
+            <el-button text type="primary" icon="el-icon-delete" size="small"  @click="deleteById(scope.row, scope.$index,fileList)" :disabled="auth==='view'&&delFlag === false&&createBy!==scope.row.createBy.name">删除</el-button>
 <!--            <el-button v-if="createBy===scope.row.createBy.name" type="text"  icon="el-icon-delete" size="small"  @click="deleteById(scope.row, scope.$index)" :disabled="auth==='view'&&delFlag === false">删除2</el-button>-->
           </template>
         </el-table-column>

+ 6 - 3
src/views/cw/reportManagement/ReportReviewTakeNumberForm.vue

@@ -1016,9 +1016,12 @@
 								}).then(async ()=>{
 									this.inputForm.isCompleteInvoice = '1'
 									this.doSubmit('start', callback)
-								}).catch(async ()=>{
-									this.inputForm.isCompleteInvoice = '0'
-									this.doSubmit('start', callback)
+								}).catch(async (action)=>{
+									console.log('action',action)
+									if (action === 'cancel'){
+										this.inputForm.isCompleteInvoice = '0'
+										this.doSubmit('start', callback)
+									}
 								})
 							}else {
 								this.doSubmit('start', callback)

+ 75 - 1
src/views/dashboard/widgets/components/TodoList.vue

@@ -19,7 +19,16 @@
 				label="实例标题"
 				prop="vars.title"
 				show-overflow-tooltip
-			></el-table-column>
+			>
+				<template #default="scope">
+					<el-link  type="primary" :underline="false" v-if="scope.row.belongProject === 'ccpm'"
+							  @click="todoCcpm(scope.row)">{{scope.row.vars.title}}</el-link>
+					<el-link type="primary" :underline="false" v-if="scope.row.status === 'todo'"
+							 @click="todo(scope.row)">{{scope.row.vars.title}}
+					</el-link>
+					<span v-else>{{scope.row.vars.title}}</span>
+				</template>
+			</el-table-column>
 			<el-table-column
 				width="90px"
 				label="流程名称"
@@ -59,12 +68,17 @@
 				align="center"
 			>
 				<template #default="scope">
+					<div v-if="scope.row.belongProject === 'ccpm'">
+						<el-button type="text" size="small" @click="todoCcpm(scope.row)">ccpm审核</el-button>
+					</div>
+					<div v-else>
 					<el-button type="primary" text @click="todo(scope.row)"
 					>办理</el-button
 					>
 					<el-button type="primary" text @click="trace(scope.row)"
 					>进度</el-button
 					>
+					</div>
 				</template>
 			</el-table-column>
 		</el-table>
@@ -253,6 +267,7 @@
 						...this.searchForm,
 					})
 					.then((data) => {
+						console.log('data',data.records)
 						this.dataList = data.records;
 						this.tablePage.total = data.total;
 						this.$store.state.global.backlogCount = data.total
@@ -320,6 +335,65 @@
 					this.$refs.preview.init();
 				});
 			},
+			// // 审核方法
+			todoCcpm (row) {
+				console.log('row',row)
+				if (row.task.processDefKey === '108' || row.task.processDefKey === '109'|| row.task.processDefKey === '13'|| row.task.processDefKey === '102') {
+					let id = row.vars.notifyId
+					let title = '报销申请审批'
+					this.toCenterForm(id, title, row.task.processDefKey, 'audit') // 跳转
+				} else if (row.task.processDefKey === '21' || row.task.processDefKey === '213') {
+					let id = row.vars.notifyId
+					let title = '发票申请审批'
+					this.toInvoiceUpdateCenterForm(id, title, row.task.processDefKey, 'audit') // 跳转
+
+					// if (row.task.name === '财务部门审批'){
+					// }else {
+					// 	this.toInvoiceCenterForm(id, title, row.task.processDefKey, 'audit') // 跳转
+					// }
+				} else{
+					this.$message.warning('此流程的跨系统审核暂未开放,请前往所属系统进行审核')
+				}
+			},
+			// 审核页面跳转
+			toCenterForm (id, title, processDefKey, type) {
+				this.$router.push({ // 跳转
+					path: '/generateForm/GenerateForm',
+					query: {
+						id: id,
+						backPath: '/dashboard/index',
+						title: title,
+						processDefKey: processDefKey,
+						type: type
+					}
+				})
+			},
+			// // 发票审核页面跳转(财务审批)
+			toInvoiceUpdateCenterForm (id, title, processDefKey, type) {
+				this.$router.push({ // 跳转
+					path: '/generateForm/InvoiceUpdateGenerateForm',
+					query: {
+						id: id,
+						backPath: '/flowable/task/TodoList',
+						title: title,
+						processDefKey: processDefKey,
+						type: type
+					}
+				})
+			},
+			// // 发票审核页面跳转
+			toInvoiceCenterForm (id, title, processDefKey, type) {
+				this.$router.push({ // 跳转
+					path: '/generateForm/InvoiceGenerateForm',
+					query: {
+						id: id,
+						backPath: '/flowable/task/TodoList',
+						title: title,
+						processDefKey: processDefKey,
+						type: type
+					}
+				})
+			}
 
 		},
 	};

+ 124 - 0
src/views/flowable/task/FlowHisTableCcpm.vue

@@ -0,0 +1,124 @@
+<!--文件上传组件-->
+<template>
+  <div>
+    <!--审批流程-->
+    <el-divider v-if="showDivider" content-position="left"><i class="el-icon-document"></i> {{dividerName}}</el-divider>
+
+    <el-steps :active="3" simple style="margin-top: 10px;margin-bottom: 10px;font-weight: bold;">
+      <el-step v-for="item in flowChart" :title="item.taskName" ></el-step>
+    </el-steps>
+
+    <vxe-table
+        border="inner"
+        show-footer
+        show-overflow="title"
+        ref="flowHisTable"
+        class="vxe-table-element"
+        :data="histoicFlowList"
+        :loading="loading"
+      >
+        <vxe-table-column min-width="80" align="center" field="taskName" title="审批环节" >
+          <template #default="scope">
+            <span v-if="commonJS.isNotEmpty(scope.row.durationTime)" style="color:#409EFF">{{scope.row.taskName}}</span>
+            <span v-else-if="commonJS.isEmpty(scope.row.durationTime) && commonJS.isNotEmpty(scope.row.beginDate)" style="color:#F56C6C">{{scope.row.taskName}}</span>
+            <span v-else >{{scope.row.taskName}}</span>
+          </template>
+        </vxe-table-column>
+        <vxe-table-column min-width="80" align="center" field="roleName" title="审批角色" ></vxe-table-column>
+        <vxe-table-column min-width="80" align="center" field="assigneeName" title="审批人"  ></vxe-table-column>
+        <vxe-table-column min-width="80" align="center" field="beginDate" title="开始时间"  ></vxe-table-column>
+        <vxe-table-column min-width="80" align="center" field="endDate" title="结束时间" ></vxe-table-column>
+        <vxe-table-column min-width="80" align="center" field="comment" title="提交意见"  ></vxe-table-column>
+        <vxe-table-column min-width="80" align="center" field="durationTime" title="任务历时" ></vxe-table-column>
+      </vxe-table>
+  </div>
+</template>
+
+<script>
+  export default {
+    data () {
+      return {
+        dividerName: '',
+        loading: false,
+        histoicFlowList: [],
+        flowChart: [],
+        showDivider: true
+      }
+    },
+    watch: {
+    },
+    created () {
+    },
+    components: {
+    },
+    mounted () {
+    },
+    methods: {
+      /**
+       * dividerName: 组件中divider的名称赋值
+       * showDivider: 组件中divider是否展示
+       *     注:值为空时,默认值为true 展示
+       *    showDivider=false时 Divider隐藏
+       **/
+      setDividerName (dividerName, showDivider) {
+        this.showDivider = true
+        if (this.commonJS.isNotEmpty(showDivider)) {
+          if (showDivider === false) {
+            this.showDivider = false
+          }
+        }
+        this.dividerName = '审批流程'
+        if (this.commonJS.isNotEmpty(dividerName)) {
+          this.dividerName = dividerName
+        }
+      },
+      /**
+       * 组件初始化
+       * @param flowChart 流程流向图
+       * @param histoicFlowList 流程历史
+       * @param dividerName 组件中divider的名称  默认为'审批流程'
+       * @param showDivider 组件中divider是否展示  默认值为true 展示
+       */
+      setFlowHis (flowChart, histoicFlowList, dividerName, showDivider) {
+        this.histoicFlowList = []
+        if (this.commonJS.isNotEmpty(histoicFlowList)) {
+          this.histoicFlowList = histoicFlowList
+        }
+        this.flowChart = []
+        if (this.commonJS.isNotEmpty(flowChart)) {
+          this.flowChart = flowChart
+        }
+        this.dividerName = '审批流程'
+        if (this.commonJS.isNotEmpty(dividerName)) {
+          this.dividerName = dividerName
+        }
+        this.showDivider = true
+        if (this.commonJS.isNotEmpty(showDivider)) {
+          if (showDivider === false) {
+            this.showDivider = false
+          }
+        }
+      },
+      /**
+       * 关闭时清除组件中的数据
+       */
+      clearFlowHis () {
+        this.histoicFlowList = []
+        this.flowChart = []
+      },
+      // 开启/关闭页面的加载中状态
+      changeLoading (loading) {
+        this.loading = false
+        if (this.commonJS.isNotEmpty(loading)) {
+          this.loading = loading
+        }
+      }
+    }
+  }
+</script>
+<style scoped>
+  .el-divider__text {
+    font-size: 16px;
+    font-weight: bold;
+  }
+</style>

+ 77 - 11
src/views/flowable/task/TodoList.vue

@@ -88,6 +88,7 @@
 					<vxe-column type="checkbox" width="40px"></vxe-column>
 					<vxe-column title="实例标题" field="vars.title">
 						<template #default="scope">
+							<el-link  type="primary" :underline="false" v-if="scope.row.belongProject === 'ccpm'"  @click="todoCcpm(scope.row)">{{scope.row.vars.title}}</el-link>
 							<el-link
 								type="primary"
 								:underline="false"
@@ -118,18 +119,23 @@
 						align="center"
 					>
 						<template #default="scope">
-							<el-button
-								type="primary"
-								text
-								@click="todo(scope.row)"
+							<div v-if="scope.row.belongProject === 'ccpm'">
+								<el-button type="text" size="small" @click="todoCcpm(scope.row)">项目系统审核</el-button>
+							</div>
+							<div v-else>
+								<el-button
+									type="primary"
+									text
+									@click="todo(scope.row)"
 								>办理</el-button
-							>
-							<el-button
-								type="primary"
-								text
-								@click="trace(scope.row)"
-								>进度</el-button
-							>
+								>
+
+								<el-button
+									type="primary"
+									text
+									@click="trace(scope.row)"
+								>进度</el-button>
+							</div>
 						</template>
 					</vxe-column>
 				</vxe-table>
@@ -393,6 +399,66 @@ export default {
 		approval(){
 			let info=this.$refs.todoTable.getCheckboxRecords()
 			this.$refs.todoDia.init(info)
+		},
+		// // 审核方法
+		todoCcpm (row) {
+			console.log('row',row)
+			if (row.task.processDefKey === '108' || row.task.processDefKey === '109' || row.task.processDefKey === '13'|| row.task.processDefKey === '102') {
+				console.log('row',row)
+				let id = row.vars.notifyId
+				let title = '报销申请审批'
+				this.toCenterForm(id, title, row.task.processDefKey, 'audit') // 跳转
+			} else if (row.task.processDefKey === '21' || row.task.processDefKey === '213') {
+
+				let id = row.vars.notifyId
+				let title = '发票申请审批'
+				this.toInvoiceUpdateCenterForm(id, title, row.task.processDefKey, 'audit') // 跳转
+				// if (row.task.name === '财务部门审批'){
+				// }else {
+				// 	this.toInvoiceCenterForm(id, title, row.task.processDefKey, 'audit') // 跳转
+				// }
+			} else {
+				this.$message.warning('此流程的跨系统审核暂未开放,请前往所属系统进行审核')
+			}
+		},
+		// // 审核页面跳转
+		toCenterForm (id, title, processDefKey, type) {
+			this.$router.push({ // 跳转
+				path: '/generateForm/Generateform',
+				query: {
+					id: id,
+					backPath: '/flowable/task/TodoList',
+					title: title,
+					processDefKey: processDefKey,
+					type: type
+				}
+			})
+		},
+		// // 发票审核页面跳转(财务审批)
+		toInvoiceUpdateCenterForm (id, title, processDefKey, type) {
+			this.$router.push({ // 跳转
+				path: '/generateForm/InvoiceUpdateGenerateForm',
+				query: {
+					id: id,
+					backPath: '/flowable/task/TodoList',
+					title: title,
+					processDefKey: processDefKey,
+					type: type
+				}
+			})
+		},
+		// // 发票审核页面跳转
+		toInvoiceCenterForm (id, title, processDefKey, type) {
+			this.$router.push({ // 跳转
+				path: '/generateForm/InvoiceGenerateForm',
+				query: {
+					id: id,
+					backPath: '/flowable/task/TodoList',
+					title: title,
+					processDefKey: processDefKey,
+					type: type
+				}
+			})
 		}
 
 	},

+ 155 - 0
src/views/generateForm/GenerateForm.vue

@@ -0,0 +1,155 @@
+<template>
+  <div>
+    <div style="padding: 10px 0px 66px 0px;min-height: 100px">
+      <!--标题-->
+      <h2 style="text-align:center">{{title}}</h2>
+      <el-card>
+        <!--表单-->
+        <fm-generate-form :data="jsonData" ref="generateForm" v-loading="loading"></fm-generate-form>
+        <!--附件-->
+        <UpLoadComponent ref="upLoadComponent"></UpLoadComponent>
+        <!--审核意见-->
+        <div v-if="type === 'audit'">
+          <el-divider content-position="left"><span style="color: red">*</span> <i class="el-icon-document"></i> 审批意见</el-divider>
+          <el-row><el-input type="textarea" :rows="5" maxlength="500" placeholder="请填写审核意见:" v-model="comments" show-word-limit></el-input></el-row>
+        </div>
+        <!--流程历史-->
+        <FlowHisTableCcpm ref="flowHisTableCcpm"></FlowHisTableCcpm>
+        <!--操作按钮-->
+        <div class="FlowFormFooter" style="margin-top: 2em;margin-left: 45em">
+          <el-button v-if="type === 'audit'" type="primary" :loading="loading" @click="agree" v-noMoreClick plain>同意</el-button>
+          <el-button v-if="type === 'audit'" type="danger" :loading="loading" @click="reject" v-noMoreClick plain>驳回</el-button>
+          <el-button :loading="loading" @click="close" v-noMoreClick plain>关闭</el-button>
+        </div>
+      </el-card>
+
+    </div>
+  </div>
+</template>
+
+<script>
+  import CcpmService from '@/api/centerservice/ccpm/CcpmService'
+  import UpLoadComponent from '@/views/common/UpLoadComponentCcpm'
+  import FlowHisTableCcpm from '@/views/flowable/task/FlowHisTableCcpm'
+  export default {
+    data () {
+      return {
+        jsonData: {},
+        title: '',
+        businessId: '',
+        loading: false,
+        type: '',
+        processDefKey: '',
+        comments: '' // 审核意见
+      }
+    },
+    ccpmService: null,
+    activated () {
+      this.init()
+    },
+    created () {
+      this.ccpmService = new CcpmService()
+      this.init()
+    },
+    components: {
+      UpLoadComponent,
+      FlowHisTableCcpm
+    },
+    methods: {
+      // 初始化
+      init () {
+        this.businessId = this.$route.query.id
+        this.processDefKey = this.$route.query.processDefKey
+        this.title = this.$route.query.title
+        this.type = this.$route.query.type
+        this.jsonData = []
+        this.comments = ''
+        this.$nextTick(async () => {
+          this.loading = true
+          this.$refs.upLoadComponent.clearUpload()
+          this.$refs.flowHisTableCcpm.clearFlowHis()
+          await this.ccpmService.getByIdGenerate(this.businessId, this.processDefKey).then((data)=>{
+			  if (data) {
+			  	console.log('data',data)
+				  this.loading = false
+				  this.jsonData = JSON.parse(JSON.stringify(data))
+				  if (this.commonJS.isEmpty(this.jsonData.files)) {
+					  this.jsonData.files = []
+				  }
+				  let filesLabel = '附件'
+				  if (this.commonJS.isNotEmpty(this.jsonData.filesLabel)) {
+					  filesLabel = this.jsonData.filesLabel
+				  }
+				  this.$refs.upLoadComponent.newUpload('view', this.jsonData.files, null, null, filesLabel)
+				  this.$refs.flowHisTableCcpm.setFlowHis(this.jsonData.flowChart, this.jsonData.histoicFlow)
+				  this.$nextTick(() => {
+					  this.$refs.generateForm.refresh()
+				  })
+			  } else {
+				  this.loading = false
+			  }
+		  })
+
+        })
+      },
+      // 关闭
+      close () {
+        this.$refs.upLoadComponent.clearUpload()
+        this.$refs.flowHisTableCcpm.clearFlowHis()
+        this.jsonData = []
+        this.comments = ''
+        this.$store.dispatch('tagsView/delView', {fullPath: this.$route.fullPath})
+        if (this.$route.query.backPath) {
+          this.$router.push(this.$route.query.backPath)
+        } else {
+          this.$router.push('/dashboard/index')
+        }
+      },
+      // 同意
+      agree () {
+        if (this.commonJS.isEmpty(this.comments)) {
+          this.$message.error('请填写审批意见')
+        } else {
+          this.loading = true
+          this.ccpmService.reimAudit(this.businessId, 'yes', this.comments, this.processDefKey).then((data) => {
+            this.loading = false
+            if (data.success) {
+              this.$message.success(data.message)
+              this.close()
+            } else {
+              this.$message.error(data.message)
+            }
+          }).catch(() => {
+            this.loading = false
+          })
+        }
+      },
+      // 驳回
+      reject () {
+        if (this.commonJS.isEmpty(this.comments)) {
+          this.$message.error('请填写审批意见')
+        } else {
+          this.$confirm(`确定驳回此报销申请吗?`, '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(async () => {
+            this.loading = true
+            this.ccpmService.reimAudit(this.businessId, 'no', this.comments, this.processDefKey).then((data) => {
+              this.loading = false
+              if (data.success) {
+                this.$message.success(data.message)
+                this.close()
+              } else {
+                this.$message.error(data.message)
+              }
+            }).catch(() => {
+              this.loading = false
+            })
+          })
+        }
+      }
+    }
+  }
+</script>
+

+ 157 - 0
src/views/generateForm/InvoiceGenerateForm.vue

@@ -0,0 +1,157 @@
+<template>
+	<div>
+		<div style="padding: 10px 0px 66px 0px;min-height: 100px">
+			<!--标题-->
+			<h2 style="text-align:center">{{title}}</h2>
+			<el-card>
+				<!--表单-->
+				<fm-generate-form :data="jsonData" ref="generateForm" v-loading="loading"></fm-generate-form>
+				<!--附件-->
+				<UpLoadComponent ref="upLoadComponent"></UpLoadComponent>
+				<!--审核意见-->
+				<div v-if="type === 'audit'">
+					<el-divider content-position="left"><span style="color: red">*</span> <i class="el-icon-document"></i> 审批意见</el-divider>
+					<el-row><el-input type="textarea" :rows="5" maxlength="500" placeholder="请填写审核意见:" v-model="comments" show-word-limit></el-input></el-row>
+				</div>
+				<!--流程历史-->
+				<FlowHisTableCcpm ref="flowHisTableCcpm"></FlowHisTableCcpm>
+				<!--操作按钮-->
+				<div class="FlowFormFooter" style="margin-top: 2em;margin-left: 45em">
+					<el-button v-if="type === 'audit'" type="primary" :loading="loading" @click="agree" v-noMoreClick plain>同意</el-button>
+					<el-button v-if="type === 'audit'" type="danger" :loading="loading" @click="reject" v-noMoreClick plain>驳回</el-button>
+					<el-button :loading="loading" @click="close" v-noMoreClick plain>关闭</el-button>
+				</div>
+			</el-card>
+
+		</div>
+	</div>
+</template>
+
+<script>
+	import CcpmService from '@/api/centerservice/ccpm/CcpmService'
+	import UpLoadComponent from '@/views/common/UpLoadComponentCcpm'
+	import FlowHisTableCcpm from '@/views/flowable/task/FlowHisTableCcpm'
+	export default {
+		data () {
+			return {
+				jsonData: {},
+				title: '',
+				businessId: '',
+				loading: false,
+				type: '',
+				processDefKey: '',
+				comments: '' // 审核意见
+			}
+		},
+		ccpmService: null,
+		activated () {
+			this.init()
+		},
+		created () {
+			this.ccpmService = new CcpmService()
+			this.init()
+		},
+		components: {
+			UpLoadComponent,
+			FlowHisTableCcpm
+		},
+		methods: {
+			// 初始化
+			init () {
+				this.businessId = this.$route.query.id
+				this.processDefKey = this.$route.query.processDefKey
+				this.title = this.$route.query.title
+				this.type = this.$route.query.type
+				this.jsonData = []
+				this.comments = ''
+				this.$nextTick(async () => {
+					this.loading = true
+					this.$refs.upLoadComponent.clearUpload()
+					this.$refs.flowHisTableCcpm.clearFlowHis()
+					await this.ccpmService.getByIdGenerate(this.businessId, this.processDefKey).then((data)=>{
+						if (data) {
+							console.log('data',data)
+							this.loading = false
+							this.jsonData = JSON.parse(JSON.stringify(data))
+							if (this.commonJS.isEmpty(this.jsonData.files)) {
+								this.jsonData.files = []
+							}
+							let filesLabel = '附件'
+							if (this.commonJS.isNotEmpty(this.jsonData.filesLabel)) {
+								filesLabel = this.jsonData.filesLabel
+							}
+							this.$refs.upLoadComponent.newUpload('view', this.jsonData.files, null, null, filesLabel)
+							this.$refs.flowHisTableCcpm.setFlowHis(this.jsonData.flowChart, this.jsonData.histoicFlow)
+							this.$nextTick(() => {
+								this.$refs.generateForm.refresh()
+							})
+						} else {
+							this.loading = false
+						}
+					})
+
+				})
+			},
+			// 关闭
+			close () {
+				this.$refs.upLoadComponent.clearUpload()
+				this.$refs.flowHisTableCcpm.clearFlowHis()
+				this.jsonData = []
+				this.comments = ''
+				this.$store.dispatch('tagsView/delView', {fullPath: this.$route.fullPath})
+				if (this.$route.query.backPath) {
+					this.$router.push(this.$route.query.backPath)
+				} else {
+					this.$router.push('/dashboard/index')
+				}
+			},
+			// 同意
+			agree () {
+				if (this.commonJS.isEmpty(this.comments)) {
+					this.$message.error('请填写审批意见')
+				} else {
+					this.loading = true
+					let jsonData = JSON.stringify(this.jsonData)
+					this.ccpmService.invoiceAudit(this.businessId, 'yes', this.comments, this.processDefKey,jsonData).then((data) => {
+						this.loading = false
+						if (data.success) {
+							this.$message.success(data.message)
+							this.close()
+						} else {
+							this.$message.error(data.message)
+						}
+					}).catch(() => {
+						this.loading = false
+					})
+				}
+			},
+			// 驳回
+			reject () {
+				if (this.commonJS.isEmpty(this.comments)) {
+					this.$message.error('请填写审批意见')
+				} else {
+					this.$confirm(`确定驳回此报销申请吗?`, '提示', {
+						confirmButtonText: '确定',
+						cancelButtonText: '取消',
+						type: 'warning'
+					}).then(async () => {
+						this.loading = true
+						let jsonData = JSON.stringify(this.jsonData)
+						this.ccpmService.invoiceAudit(this.businessId, 'no', this.comments, this.processDefKey,jsonData).then((data) => {
+							this.loading = false
+							if (data.success) {
+								this.$message.success(data.message)
+								this.close()
+							} else {
+								this.$message.error(data.message)
+							}
+						}).catch(() => {
+							this.loading = false
+						})
+					})
+				}
+			}
+		}
+	}
+</script>
+

+ 779 - 0
src/views/generateForm/InvoiceUpdateGenerateForm.vue

@@ -0,0 +1,779 @@
+<template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
+	<div>
+		<el-form :model="jsonData" ref="inputForm" v-loading="loading"
+				 label-width="160px" @submit.native.prevent>
+			<el-divider content-position="left"><i class="el-icon-document"></i>
+				基本信息
+			</el-divider>
+			<el-row  :gutter="15">
+				<el-col :span="24">
+					<vxe-table
+						border
+						show-overflow
+						show-footer
+						footer-method
+						ref="baseTable"
+						class="vxe-table-element"
+						:data="jsonData.workInvoiceProjectRelationList"
+						style="margin-left: 5em"
+						@cell-click=""
+						@edit-closed=""
+						keep-source
+						highlight-current-row
+						:edit-config="{trigger: 'click', mode: 'cell', showStatus: true, autoClear: true, icon: '-'}"
+					>
+						<vxe-table-column field="projectName" align="center" title="项目名称" :edit-render="{}" show-overflow="title">
+							<template v-slot:edit="scope">
+								<el-input @focus="openProgramPageForm(scope.$rowIndex)" placeholder="请填写项目名称" :readonly="true" v-model="scope.row.projectName"/>
+							</template>
+						</vxe-table-column>
+						<vxe-table-column field="workContractName" align="center" title="合同名称" :edit-render="{}">
+							<template v-slot:edit="scope">
+								<el-input @focus="openContractForm()" placeholder="请填写合同名称" :readonly="true" v-model="scope.row.workContractName"/>
+							</template>
+						</vxe-table-column>
+						<vxe-table-column field="projectNum" align="center" title="项目编号" :edit-render="{}">
+							<template v-slot:edit="scope">
+								<el-input :readonly="true" placeholder="请填写项目编号" v-model="scope.row.projectNum"/>
+							</template>
+						</vxe-table-column>
+						<vxe-table-column field="clientName" title="委托方" :edit-render="{}">
+							<template v-slot:edit="scope">
+								<el-input :readonly="true" placeholder="请填写委托方" v-model="scope.row.clientName"/>
+							</template>
+						</vxe-table-column>
+						<vxe-table-column field="reportDataNum" align="center" title="报告号" :edit-render="{}">
+							<template v-slot:edit="scope">
+								<el-input :readonly="true" placeholder="请填写项目编号" v-model="scope.row.reportDataNum"/>
+							</template>
+						</vxe-table-column>
+						<!--            <vxe-table-column field="reportNo" title="报告号" :edit-render="{}">-->
+						<!--              <template v-slot:edit="scope">-->
+						<!--                <el-input v-model="scope.row.reportNo" placeholder="请填写报告号"/>-->
+						<!--              </template>-->
+						<!--            </vxe-table-column>-->
+					</vxe-table>
+				</el-col>
+			</el-row>
+			<el-divider content-position="left"><i class="el-icon-document"></i> 发票详情</el-divider>
+			<el-row  :gutter="15">
+				<el-col :span="12">
+					<el-form-item label="发票类型" prop="invoiceTypeName"
+								  :rules="[
+
+               ]">
+						<el-input :disabled="true" placeholder="请填写发票类型" v-model="jsonData.invoiceTypeName" clearable></el-input>
+					</el-form-item>
+				</el-col>
+				<el-col :span="12">
+					<el-form-item label="开票类型" prop="newDrawerName"
+								  :rules="[
+               ]">
+						<el-input :disabled="true" placeholder="请填写开票类型" v-model="jsonData.newDrawerName" clearable></el-input>
+					</el-form-item>
+				</el-col>
+			</el-row>
+			<el-row>
+				<el-col :span="12">
+					<el-form-item label="实际开票单位" prop="clientName"
+								  :rules="[
+               ]">
+						<el-input :disabled="true" :readonly="true" placeholder="请填写实际开票单位" v-model="jsonData.clientName" clearable></el-input>
+					</el-form-item>
+				</el-col>
+				<el-col :span="12">
+					<el-form-item label="纳税人识别号" prop="taxpayerIdentificationNo"
+								  :rules="[
+             ]">
+						<el-input :disabled="true" v-model="jsonData.taxpayerIdentificationNo" placeholder="请填写纳税人识别号" clearable></el-input>
+					</el-form-item>
+				</el-col>
+				<el-col :span="12">
+					<el-form-item label="地址" prop="address"
+								  :rules="[
+             ]">
+						<el-input :disabled="true" v-model="jsonData.address" placeholder="请填写地址" clearable></el-input>
+					</el-form-item>
+				</el-col>
+				<el-col :span="12">
+					<el-form-item label="电话" prop="telephone"
+								  :rules="[
+             ]">
+						<el-input :disabled="true" v-model="jsonData.telephone" placeholder="请填写电话"></el-input>
+					</el-form-item>
+				</el-col>
+				<el-col :span="12">
+					<el-form-item label="开户银行" prop="bank"
+								  :rules="[
+             ]">
+						<el-input :disabled="true" v-model="jsonData.bank" placeholder="请填写开户银行"></el-input>
+					</el-form-item>
+				</el-col>
+				<el-col :span="12">
+					<el-form-item label="银行账号" prop="bankNumber"
+								  :rules="[
+             ]">
+						<el-input :disabled="true" placeholder="请填写银行账号" v-model="jsonData.bankNumber" clearable></el-input>
+					</el-form-item>
+				</el-col>
+				<el-col :span="12">
+					<el-form-item label="收款类型" prop="chargeType"
+								  :rules="[
+               ]">
+						<el-input :disabled="true" placeholder="请填写收款类型" v-model="jsonData.chargeType" clearable></el-input>
+					</el-form-item>
+				</el-col>
+				<el-col :span="12">
+					<el-form-item label="开票内容" prop="billingContent"
+								  :rules="[
+               ]">
+						<el-input :disabled="true" placeholder="请填写开票内容" v-model="jsonData.billingContent" clearable></el-input>
+					</el-form-item>
+				</el-col>
+				<el-col :span="12">
+					<el-form-item label="发票金额(元)" prop="money"
+								  :rules="[
+               ]">
+						<el-input
+							placeholder="请填写发票金额"
+							maxlength="15"
+							v-model="jsonData.money"
+							:disabled="true"
+						>
+						</el-input>
+					</el-form-item>
+				</el-col >
+				<el-col :span="12">
+					<el-form-item label="开票内容要求" prop="content"
+								  :rules="[
+               ]">
+						<el-input :disabled="true" type="input"  v-model="jsonData.content" placeholder="开票内容要求" show-word-limit></el-input>
+					</el-form-item>
+				</el-col>
+				<el-col :span="12">
+					<el-form-item label="开票人" prop="drawerName"
+								  :rules="[
+               ]">
+						<el-input :disabled="true" v-model="jsonData.drawerName" placeholder="请选择开票人" clearable></el-input>
+					</el-form-item>
+				</el-col>
+				<el-col :span="12" >
+					<el-form-item label="开票时间" prop="invoiceDate"
+								  :rules="[
+                         {required: true, message:'开票时间不能为空', trigger:'blur'}
+                 ]">
+						<el-date-picker
+							v-model="jsonData.invoiceDate"
+							type="date"
+							value-format="YYYY-MM-DD"
+							placeholder="选择开票时间"
+							style="width:100%"
+							placement="bottom-start"
+							clearable>
+						</el-date-picker>
+					</el-form-item>
+				</el-col>
+				<el-col :span="12">
+					<el-form-item label="领票时间" prop="takeDate"
+								  :rules="[
+                 ]">
+						<el-date-picker
+							v-model="jsonData.takeDate"
+							type="date"
+							value-format="YYYY-MM-DD"
+							placeholder="选择领票时间"
+							style="width:100%"
+							placement="bottom-start"
+							clearable>
+						</el-date-picker>
+					</el-form-item>
+				</el-col>
+
+				<el-col :span="12">
+					<el-form-item label="实际开票人" prop="actualDrawerName"
+								  :rules="[
+					   ]">
+						<el-input :disabled="true" :readonly="true" v-model="jsonData.actualDrawerName" placeholder="请选择实际开票人">
+						</el-input>
+					</el-form-item>
+				</el-col>
+				<el-col :span="12">
+					<el-form-item label="接收邮箱" prop="actualDrawerEmailAddress"
+								  :rules="[
+							/*{required: true, message:'邮箱不能为空', trigger:'blur'},
+							{required: true, message:'邮箱不能为空', trigger:'change'}*/
+               ]">
+						<el-input :disabled="true" v-model="jsonData.actualDrawerEmailAddress" placeholder="请输入接收邮箱" show-word-limi maxlength="50"></el-input>
+					</el-form-item>
+				</el-col>
+				<el-col :span="12">
+					<el-col>
+						<el-form-item label="对账人" prop="accountCheckingUserName"
+									  :rules="[
+                        {required: true, message:'对账人不能为空', trigger:'blur'},
+                        {required: true, message:'对账人不能为空', trigger:'change'}
+               ]">
+							<el-input :disabled="true" :readonly="true"  v-model="jsonData.accountCheckingUserName" placeholder="请选择对账人">
+							</el-input>
+						</el-form-item>
+					</el-col>
+
+				</el-col>
+				<el-col :span="12">
+					<el-form-item label="对账地区" prop="area"
+								  :rules="[
+               ]">
+						<el-input :disabled="true" :readonly="true"  v-model="jsonData.area" placeholder="请选择对账地区">
+						</el-input>
+					</el-form-item>
+				</el-col>
+
+				<el-col :span="24">
+					<el-form-item label="备注" prop="remarks"
+								  :rules="[
+               ]">
+						<el-input :disabled="true" maxlength="500" type="textarea" placeholder="请填写备注" v-model="jsonData.remarks" show-word-limit></el-input>
+					</el-form-item>
+				</el-col>
+			</el-row>
+
+
+			<el-form>
+				<el-divider content-position="left"><i class="el-icon-document"></i>
+					发票明细
+					<el-button style="margin-left: 20px" type="primary" @click="insertEvent('detail')" plain>
+						新增
+					</el-button>
+					<el-popover
+						placement="top"
+						width="400"
+						v-model="importVisible">
+						<p>请先下载模板,然后再进行导入操作</p>
+						<el-row :gutter="1">
+							<el-col :span="6">
+								<el-button type="success" @click="downloadTpl">下载模板</el-button>
+							</el-col>
+							<el-col :span="6">
+								<el-upload
+									action=""
+									:auto-upload="false"
+									:on-change="beforeUploadDetail"
+									:show-file-list="false">
+									<el-button type="primary">导入全部</el-button>
+								</el-upload>
+							</el-col>
+							<el-col :span="6">
+								<el-upload
+									action=""
+									:auto-upload="false"
+									:on-change="beforeUploadDetailCode"
+									:show-file-list="false">
+									<el-button type="primary" >仅导入当前纳税人识别号</el-button>
+								</el-upload>
+							</el-col>
+						</el-row>
+						<div style="text-align: right; margin-top: 10px;margin-right: 10px;">
+							<el-button  type="default" @click="importVisible = false" plain>取消</el-button>
+							<!--            <el-button type="primary"  @click="importVisible = false">确定</el-button>-->
+						</div>
+						<template #reference>
+							<el-button style="margin-left: 20px" type="warning" plain>导入</el-button>
+						</template>
+					</el-popover>
+				</el-divider>
+			</el-form>
+
+			<el-form :model="jsonData" ref="inputForm" v-loading="loading"
+					 label-width="160px" @submit.native.prevent>
+				<el-row  :gutter="15">
+					<el-col :span="24">
+						<vxe-table
+							border
+							show-overflow
+							show-footer
+							footer-method
+							keep-source
+							ref="detailTable"
+							:key="detailKey"
+							class="vxe-table-element"
+							:data="jsonData.workAccountList"
+							style="margin-left: 5em"
+							highlight-current-row
+							:edit-config="{trigger: 'click', mode: 'cell', showStatus: true, autoClear: true}"
+						>
+							<vxe-table-column field="code" title="发票代码" :edit-render="{}">
+								<template #edit="scope">
+									<el-input  v-model="scope.row.code" placeholder="请填写发票代码"/>
+								</template>
+							</vxe-table-column>
+							<vxe-table-column field="number" title="发票号" :edit-render="{}">
+								<template #edit="scope">
+									<el-input
+										oninput ="value=value.replace(/\D|^/g,'')"
+										placeholder="请填写发票号"
+										maxlength="8"
+										@blur="checkNumber(scope.row,scope.$rowIndex)"
+										v-model="scope.row.number"
+										clearable>
+									</el-input>
+								</template>
+							</vxe-table-column>
+							<vxe-table-column field="account" title="开票金额(元)" :edit-render="{}">
+								<template #edit="scope">
+									<el-input-number
+										@blur="checkAccount(scope.row,scope.$rowIndex)"
+										v-model="scope.row.account"
+										controls-position="right"
+										:controls="false"
+										style="width:100%;"
+										:max="999999999999999"
+										:precision="2"
+										placeholder="请填写开票金额"
+										:step="0.01"
+									>
+									</el-input-number>
+								</template>
+							</vxe-table-column>
+							<vxe-table-column field="rate" title="税率(%)" :edit-render="{}">
+								<template #edit="scope">
+									<el-input-number
+										@blur="checkRate(scope.row, scope.$rowIndex)"
+										v-model="scope.row.rate"
+										controls-position="right"
+										:controls="false"
+										style="width:100%;"
+										:precision="2"
+										placeholder="请填写税率"
+										:step="0.01"
+										:min="0"
+										clearable>
+									</el-input-number>
+								</template>
+							</vxe-table-column>
+							<vxe-table-column field="amount" title="金额" :edit-render="{}">
+								<template #edit="scope">
+									<el-input  :readonly="true" v-model="scope.row.amount" placeholder="请填写金额"/>
+								</template>
+							</vxe-table-column>
+							<vxe-table-column field="tax" title="税额" :edit-render="{}">
+								<template #edit="scope">
+									<el-input  :readonly="true" v-model="scope.row.tax" placeholder="请填写税额"/>
+								</template>
+							</vxe-table-column>
+							<vxe-table-column title="操作" width="100">
+								<template v-slot="scope">
+									<el-button type="danger" @click="removeEvent(scope.row,scope.$rowIndex,'detail')">删除</el-button>
+								</template>
+							</vxe-table-column>
+						</vxe-table>
+					</el-col>
+				</el-row>
+			</el-form>
+		</el-form>
+		<!--        附件-->
+		<UpLoadComponent ref="uploadComponent"></UpLoadComponent>
+		<!--审核意见-->
+		<div v-if="type === 'audit'">
+			<el-divider content-position="left"><span style="color: red">*</span> <i class="el-icon-document"></i> 审批意见</el-divider>
+			<el-row><el-input type="textarea" :rows="5" maxlength="500" placeholder="请填写审核意见:" v-model="comments" show-word-limit></el-input></el-row>
+		</div>
+		<!--流程历史-->
+		<FlowHisTableCcpm ref="flowHisTableCcpm"></FlowHisTableCcpm>
+		<!--操作按钮-->
+		<div class="FlowFormFooter" style="margin-top: 2em;margin-left: 45em">
+			<el-button v-if="type === 'audit'" type="primary" :loading="loading" @click="agree" v-noMoreClick plain>同意</el-button>
+			<el-button v-if="type === 'audit'" type="danger" :loading="loading" @click="reject" v-noMoreClick plain>驳回</el-button>
+			<el-button :loading="loading" @click="close" v-noMoreClick plain>关闭</el-button>
+		</div>
+	</div>
+</template>
+
+<script>
+	import UpLoadComponent from '@/views/common/UpLoadComponent'
+	import XEUtils from 'xe-utils'
+	import processService from '@/api/flowable/processService'
+	import FlowHisTableCcpm from '@/views/flowable/task/FlowHisTableCcpm'
+	import financeInvoiceService from '@/api/cw/invoice/CwFinanceInvoiceService'
+	import CcpmService from '@/api/centerservice/ccpm/CcpmService'
+	export default {
+		props: {
+		},
+		data() {
+			return {
+				jsonData: {},
+				title: '',
+				businessId: '',
+				loading: false,
+				type: '',
+				processDefKey: '',
+				comments: '', // 审核意见
+				importVisible: false,
+				detailKey:''
+			}
+		},
+		ccpmService: null,
+		activated () {
+			this.init()
+		},
+		created() {
+			this.ccpmService = new CcpmService()
+			this.init()
+		},
+		mounted() {
+		},
+		components: {
+			UpLoadComponent,
+			FlowHisTableCcpm
+		},
+		computed: {
+
+		},
+		watch: {
+		},
+		methods: {
+			// 初始化
+			init () {
+				this.businessId = this.$route.query.id
+				this.processDefKey = this.$route.query.processDefKey
+				this.title = this.$route.query.title
+				this.type = this.$route.query.type
+				this.jsonData = []
+				this.comments = ''
+				this.$nextTick(async () => {
+					this.loading = true
+					this.$refs.uploadComponent.clearUpload()
+					this.$refs.flowHisTableCcpm.clearFlowHis()
+					await this.ccpmService.getByIdGenerate(this.businessId, this.processDefKey).then((data)=>{
+						if (data) {
+							console.log('data',data)
+							this.loading = false
+							this.jsonData = JSON.parse(JSON.stringify(data))
+							if (this.commonJS.isEmpty(this.jsonData.files)) {
+								this.jsonData.files = []
+							}
+							if (this.commonJS.isEmpty(this.jsonData.drawerName)) {
+								this.jsonData.drawerName = this.$store.state.user.name
+							}
+							if (this.commonJS.isEmpty(this.jsonData.invoiceDate)){
+								this.jsonData.invoiceDate = this.moment(new Date()).format('YYYY-MM-DD')
+							}
+							let filesLabel = '附件'
+							if (this.commonJS.isNotEmpty(this.jsonData.filesLabel)) {
+								filesLabel = this.jsonData.filesLabel
+							}
+							this.$refs.uploadComponent.newUpload('view', this.jsonData.files, null, null, filesLabel)
+							this.$refs.flowHisTableCcpm.setFlowHis(this.jsonData.flowChart, this.jsonData.histoicFlow)
+							this.getTotalAccount()
+							// this.$nextTick(() => {
+							//   this.$refs.generateForm.refresh()
+							// })
+						} else {
+							this.loading = false
+						}
+					})
+
+				})
+			},
+			// 关闭
+			close () {
+				this.$refs.uploadComponent.clearUpload()
+				this.$refs.flowHisTableCcpm.clearFlowHis()
+				this.jsonData = []
+				this.comments = ''
+				this.$store.dispatch('tagsView/delView', {fullPath: this.$route.fullPath})
+				if (this.$route.query.backPath) {
+					this.$router.push(this.$route.query.backPath)
+				} else {
+					this.$router.push('/dashboard/index')
+				}
+			},
+			// 同意
+			async agree () {
+				let acc = 0
+				this.jsonData.workAccountList.forEach((item, index) => {
+					if (this.commonJS.isEmpty(item.number)) {
+						this.loading = false
+						this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “发票号” 为空')
+						throw new Error()
+					}
+					if (this.commonJS.isEmpty(item.account)) {
+						this.loading = false
+						this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “开票金额” 为空')
+						throw new Error()
+					}
+					acc = (acc + parseFloat(parseFloat(item.account).toFixed(2)))
+				})
+				if (parseFloat(acc).toFixed(2) !== parseFloat(this.jsonData.money).toFixed(2)) {
+					this.loading = false
+					this.$message.warning('发票明细中 “开票金额”总和 与发票详情中 “发票金额” 不等')
+					throw new Error()
+				}
+				this.jsonData.workAccountList.forEach((item, index) => {
+					this.jsonData.workAccountList.forEach((item2, index2) => {
+						if (index !== index2) {
+							if (item.number === item2.number) {
+								this.loading = false
+								this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “发票号” 存在重复')
+								throw new Error()
+							}
+						}
+					})
+				})
+				for await (let [index, item] of this.jsonData.workAccountList.entries()) {
+					if (this.commonJS.isEmpty(item.number)) {
+						this.loading = false
+						this.$message.warning('发票明细中第 ' + (index + 1) + ' 条数据的 “发票号” 为空')
+						this.err = true
+					}
+				}
+				if (this.err === true) {
+					this.loading = false
+					this.err = ''
+					throw new Error()
+				}
+
+				if (this.commonJS.isEmpty(this.comments)) {
+					this.$message.error('请填写审批意见')
+				} else {
+					this.loading = true
+					let jsonData = JSON.stringify(this.jsonData)
+					this.ccpmService.invoiceAudit(this.businessId, 'yes', this.comments, this.processDefKey,jsonData).then((data) => {
+						this.loading = false
+						if (data.success) {
+							this.$message.success(data.message)
+							this.close()
+						} else {
+							this.$message.error(data.message)
+						}
+					}).catch(() => {
+						this.loading = false
+					})
+				}
+			},
+			// 驳回
+			reject () {
+				if (this.commonJS.isEmpty(this.comments)) {
+					this.$message.error('请填写审批意见')
+				} else {
+					this.$confirm(`确定驳回此报销申请吗?`, '提示', {
+						confirmButtonText: '确定',
+						cancelButtonText: '取消',
+						type: 'warning'
+					}).then(async () => {
+						this.loading = true
+						let jsonData = JSON.stringify(this.jsonData)
+						this.ccpmService.invoiceAudit(this.businessId, 'no', this.comments, this.processDefKey,jsonData).then((data) => {
+							this.loading = false
+							if (data.success) {
+								this.$message.success(data.message)
+								this.close()
+							} else {
+								this.$message.error(data.message)
+							}
+						}).catch(() => {
+							this.loading = false
+						})
+					})
+				}
+			},
+			//新增
+			insertEvent(type) {
+				if (type === 'detail') {
+					this.$refs.detailTable.insert().then((data) => {
+						this.jsonData.workAccountList.push(data)
+						this.detailKey = Math.random()
+					})
+				}
+			},
+			// 下载模板
+			downloadTpl() {
+				this.loading = true
+				financeInvoiceService.exportTemplate().then((res) => {
+					// 将二进制流文件写入excel表,以下为重要步骤
+					this.$utils.downloadExcel(res, '发票明细导入模板')
+					this.loading = false
+				}).catch(function (err) {
+					this.loading = false
+					if (err.response) {
+						console.log(err.response)
+					}
+				})
+			},
+			beforeUploadDetail(file) {
+				const formBody = new FormData()
+				formBody.append('file', file.raw)
+				this.loading = true
+				financeInvoiceService.importDetail(formBody).then(async (result) => {
+					if (this.commonJS.isEmpty(result)) {
+						this.importVisible = false
+						this.loading = false
+						throw new Error()
+					}
+					for await (let item of result) {
+						this.jsonData.workAccountList.forEach(detail => {
+							if (item.number === detail.number) {
+								this.$message.error('上传的文件中存在与页面重复的发票号,请重新填写后上传')
+								this.importVisible = false
+								this.loading = false
+								throw new Error()
+							}
+						})
+					}
+					await this.detailPush(result)
+					this.importVisible = false
+					this.loading = false
+				}).catch(() => {
+					this.importVisible = false
+					this.loading = false
+				})
+			},
+			async detailPush(data) {
+				if (this.commonJS.isNotEmpty(data)) {
+					await data.forEach(item => {
+						this.getAmount(item)
+						this.getTax(item)
+						this.jsonData.workAccountList.push(item)
+						this.detailKey = Math.random()
+					})
+				}
+				this.$message.success('导入完成')
+			},
+			checkNumber(row, rowIndex) {
+				if (!this.commonJS.isEmpty(row.number)) {
+					if (parseInt(row.number) > 99999999) {
+						this.$message.warning('“发票号” 不可以大于 8 位,请重新输入')
+						row.number = undefined
+						return
+					}
+					this.jsonData.workAccountList.forEach((item, index) => {
+						if (rowIndex !== index) {
+							if (row.number === item.number) {
+								row.number = ''
+								this.$message.warning('“发票号” 已存在,请重新输入')
+								throw new Error()
+							}
+						}
+					})
+					this.ccpmService.queryByNumber(row.number).then((data) => {
+						if (data === true) {
+							row.number = ''
+							this.$message.warning('“发票号” 已存在,请重新输入')
+						}
+					})
+				}
+			},
+			checkAccount(row, rowIndex) {
+				if (this.commonJS.isEmpty(row.account)) {
+					row.account = undefined
+				}
+				this.getAmount(row)
+				this.getTax(row)
+			},
+			checkRate(row, rowIndex) {
+				if (!this.commonJS.isEmpty(row.rate)) {
+					if (parseFloat(row.rate) < 1 || parseFloat(row.rate) > 100) {
+						this.$message.warning('“税率” 请填写 1 到 100 之间的数字,请重新输入')
+						row.rate = undefined
+					}
+				}
+				this.getAmount(row)
+				this.getTax(row)
+			},
+			// 根据开票金额和税率计算出金额: 开票金额-税率*开票金额
+			getAmount(row) {
+				if (!this.commonJS.isEmpty(row.account) && !this.commonJS.isEmpty(row.rate)) {
+					row.amount = parseFloat((parseFloat(row.account) - parseFloat((parseFloat(row.account) * parseFloat((parseFloat(row.rate) / 100).toFixed(4))).toFixed(4))).toFixed(2))
+				} else {
+					row.amount = undefined
+				}
+			},
+			// 根据开票金额和税率计算出税额: 税率*开票金额
+			getTax(row) {
+				if (!this.commonJS.isEmpty(row.account) && !this.commonJS.isEmpty(row.rate)) {
+					row.tax = parseFloat((parseFloat(row.account) * parseFloat((parseFloat(row.rate) / 100).toFixed(4))).toFixed(2))
+				} else {
+					row.tax = undefined
+				}
+			},
+			// 获取发票金额,放到开票明细中第一条数据
+			getTotalAccount() {
+				if (!this.commonJS.isEmpty(this.jsonData.money)) {
+					this.jsonData.workAccountList.push({account: this.jsonData.money})
+				}
+			},
+			async beforeUploadDetailCode(file) {
+				await this.checkIdentificationNo()
+				const formBody = new FormData()
+				formBody.append('file', file.raw)
+				this.loading = true
+				financeInvoiceService.importDetail(formBody).then(async result => {
+					if (this.commonJS.isEmpty(result)) {
+						this.importVisible = false
+						this.loading = false
+						throw new Error()
+					}
+					for await (let item of result) {
+						await this.jsonData.workAccountList.forEach(detail => {
+							if (item.number === detail.number) {
+								this.$message.error('上传的文件中存在与页面重复的发票号,请重新填写后上传')
+								this.importVisible = false
+								this.loading = false
+								throw new Error()
+							}
+						})
+					}
+					this.detailPushCode(result)
+					this.importVisible = false
+					this.loading = false
+				}).catch(() => {
+					this.importVisible = false
+					this.loading = false
+				})
+			},
+			checkIdentificationNo() {
+				if (this.commonJS.isEmpty(this.jsonData.taxpayerIdentificationNo)) {
+					this.$message.error('当前纳税人识别号为空,导入失败')
+					throw new Error()
+				}
+			},
+			detailPushCode(data) {
+				if (this.commonJS.isNotEmpty(data)) {
+					data.forEach(item => {
+						if (this.commonJS.isNotEmpty(item.taxpayerIdentificationNo)) {
+							if (item.taxpayerIdentificationNo === this.jsonData.taxpayerIdentificationNo) {
+								this.getAmount(item)
+								this.getTax(item)
+								this.jsonData.workAccountList.push(item)
+								this.detailKey = Math.random()
+							}
+						}
+					})
+				}
+				this.$message.success('导入完成')
+			},
+			// 删除
+			removeEvent(row, rowIndex, type) {
+				if (type === 'base') {
+					this.$refs.baseTable.remove(row)
+					this.inputForm.financeInvoiceBaseDTOList.splice(rowIndex, 1)
+				}
+				if (type === 'detail') {
+					this.$refs.detailTable.remove(row)
+					this.jsonData.workAccountList.splice(rowIndex, 1)
+				}
+				if (type === 'receivables') {
+					this.$refs.receivablesTable.remove(row)
+					this.inputForm.financeInvoiceReceivablesDTOList.splice(rowIndex, 1)
+				}
+			},
+		}
+	}
+</script>
+<style scoped>
+	/deep/ .el-input-number .el-input__inner {
+		text-align: left;
+	}
+	/deep/ .vxe-footer--row .vxe-footer--column:nth-child(1) .vxe-cell--item {
+		font-weight:700;
+	}
+</style>

+ 8 - 0
src/views/sys/user/UserForm.vue

@@ -142,6 +142,13 @@
 						</el-radio-group>
 					</el-form-item>
 				</el-col>
+				<el-col :span="12">
+					<el-form-item label="是否获取其他服务待办" prop="otherServiceFlag" :rules="[{required: true, message: '必须选择', trigger: 'blur'}]">
+						<el-radio-group v-model="inputForm.otherServiceFlag">
+							<el-radio v-for="item in this.$dictUtils.getDictList('yes_no')" :label="item.value" :key="item.id">{{item.label}}</el-radio>
+						</el-radio-group>
+					</el-form-item>
+				</el-col>
 			</el-row>
 			<el-divider content-position="left"
 				><el-icon> <user /></el-icon> 身份信息</el-divider
@@ -521,6 +528,7 @@ export default {
 				phone: "", // 电话
 				mobile: "", // 手机
 				loginFlag: "1", // 是否允许登陆
+				otherServiceFlag: '0', // 是否获取其他服务待办
 				photo: "", // 头像
 				qrCode: "", // 二维码
 				oldLoginName: "", // 原登录名