Quellcode durchsuchen

评估项目归档 与开票后的数据同步问题调整

徐滕 vor 2 Wochen
Ursprung
Commit
c32e9d4eee

+ 17 - 0
src/api/sys/WorkContractService.js

@@ -73,4 +73,21 @@ export default class WorkContractService {
 			params: params,
 		});
 	}
+
+	exportFile(params) {
+		return request({
+			url: prefix + "/workContract/workContractInfo/export",
+			method: "get",
+			params: params,
+			responseType: "blob",
+		});
+	}
+
+	getProjectIdByReportNo(reportNo) {
+		return request({
+			url: prefix + "/workContract/workContractInfo/getProjectIdByReportNo",
+			method: "get",
+			params: { reportNo: reportNo },
+		});
+	}
 }

+ 23 - 1
src/views/program/registered/ProjectList.vue

@@ -140,6 +140,17 @@
 					<vxe-column min-width="100" align="center" title="项目负责人" field="projectManagerName"></vxe-column>
 					<vxe-column min-width="180" align="center" title="委托方" field="clientName"></vxe-column>
 					<vxe-column min-width="210" align="center" title="报告号" field="reportNo"></vxe-column>
+					<vxe-column min-width="200px" title="发票号" field="invoiceNumbers" align="center">
+						<template #default="scope">
+							<div>
+								<template v-for="(item, index) in (scope.row.invoiceNumbers || '').split(',')">
+									<el-tag type="primary" v-if="item.trim()" :key="index" style="margin-right: 4px; margin-bottom: 2px; cursor: pointer;" @click="viewInvoice(scope.row, index)">
+										{{ item.trim() }}
+									</el-tag>
+								</template>
+							</div>
+						</template>
+					</vxe-column>
 					<vxe-column min-width="100" align="center" title="登记人" field="createById"></vxe-column>
 					<vxe-column min-width="120" align="center" title="创建日期" field="createTime"></vxe-column>
 
@@ -431,6 +442,7 @@
 		<!-- 一级校审修改 -->
 		<ProjectThreeAuditFormEditDialog ref="projectThreeAuditFormEditDialog" @refreshDataList="refreshList">
 		</ProjectThreeAuditFormEditDialog>
+		<InvoiceForm ref="invoiceFormDialog"></InvoiceForm>
 		<!--	  <el-dialog-->
 		<!--		  v-model="dialogVisible"-->
 		<!--		  title="提示"-->
@@ -468,6 +480,7 @@ import ProjectArchiveFormDialog from "./ProjectArchiveFormDialog";
 import UserSelect from '@/views/utils/UserTreeSelect'
 // 一级校审修改
 import ProjectThreeAuditFormEditDialog from './ProjectThreeAuditFormEditDialog'
+import InvoiceForm from '@/views/finance/invoice/InvoiceForm'
 export default {
 	data() {
 		return {
@@ -546,7 +559,8 @@ export default {
 		ProjectFormUpdate,
 		UserSelect,
 		ProjectArchiveFormDialog,
-		ProjectThreeAuditFormEditDialog
+		ProjectThreeAuditFormEditDialog,
+		InvoiceForm
 	},
 	mounted() {
 		this.$nextTick(() => {
@@ -743,6 +757,14 @@ export default {
 		viewContract(id) {
 			this.$refs.workContractForm2.init('view', id)
 		},
+		// 查看发票详情
+		viewInvoice(row, index) {
+			let invoiceIds = (row.invoiceIds || '').split(',')
+			let invoiceId = invoiceIds[index]
+			if (invoiceId) {
+				this.$refs.invoiceFormDialog.init(false, invoiceId)
+			}
+		},
 		start() {
 			// 读取流程表单
 			let tabTitle = `发起流程【评估-项目登记】`

+ 58 - 4
src/views/workContract/WorkContractList.vue

@@ -83,7 +83,7 @@
 		</el-form>
 
 		<div class="jp-table">
-			<vxe-toolbar ref="toolbarRef" :refresh="{ query: refreshList }" custom>
+			<vxe-toolbar ref="toolbarRef" :refresh="{ query: refreshList }" export custom>
 				<template #buttons>
 					<el-button v-if="hasPermission('sys:project:add')" type="primary" icon="el-icon-plus"
 						@click="add()">新建</el-button>
@@ -93,7 +93,14 @@
 				<vxe-table border="inner" auto-resize resizable height="auto" :loading="loading" size="small"
 					ref="workContractTable" show-header-overflow show-overflow highlight-hover-row :menu-config="{}"
 					:print-config="{}" @sort-change="sortChangeHandle" :sort-config="{ remote: true }" :data="dataList"
-					:checkbox-config="{}" :tooltip-config="tooltipConfig">
+					:checkbox-config="{}" :tooltip-config="tooltipConfig" :export-config="{
+						remote: true,
+						filename: `兴光评估合同数据${moment(new Date()).format('YYYY-MM-DD')}`,
+						sheetName: `兴光评估合同数据${moment(new Date()).format('YYYY-MM-DD')}`,
+						exportMethod: exportMethod,
+						types: ['xls'],
+						modes: ['current', 'selected', 'all']
+					}">
 					<vxe-column type="seq" width="60" title="序号"></vxe-column>
 					<vxe-column type="checkbox" width="50px"></vxe-column>
 
@@ -124,7 +131,7 @@
 							<div>
 								<!-- 把字符串用 split(',') 转成数组直接循环 -->
 								<template v-for="(item, index) in (scope.row.reportNos || '').split(',')">
-									<el-tag type="primary" v-if="item.trim()" :key="index" style="margin-right: 4px;">
+									<el-tag type="primary" v-if="item.trim()" :key="index" style="margin-right: 4px; cursor: pointer;" @click="viewProjectByReportNo(item.trim())">
 										{{ item.trim() }}
 									</el-tag>
 								</template>
@@ -277,6 +284,7 @@
 		<WorkContractBorrowMessageForm ref="workContractBorrowMessageForm" @refreshDataList="refreshList">
 		</WorkContractBorrowMessageForm>
 		<user-select ref="userSelect2" @doSubmit="selectUser"></user-select>
+		<ProjectForm ref="projectForm"></ProjectForm>
 	</div>
 </template>
 
@@ -295,6 +303,7 @@ import pick from 'lodash.pick'
 import userService from '@/api/sys/userService'
 // import UserSelect from '@/components/userSelect'
 import UserSelect from '@/views/utils/UserTreeSelect'
+import ProjectForm from '@/views/program/registered/ProjectForm'
 export default {
 	data() {
 		const tooltipConfig = {
@@ -370,7 +379,16 @@ export default {
 		WorkClientForm,
 		WorkContractBorrowMessageForm,
 		SelectUserTree,
-		UserSelect
+		UserSelect,
+		ProjectForm
+	},
+	mounted() {
+		this.$nextTick(() => {
+			// 将表格和工具栏进行关联
+			const $table = this.$refs.workContractTable;
+			const $toolbar = this.$refs.toolbarRef;
+			$table.connect($toolbar);
+		});
 	},
 	activated() {
 		this.is()
@@ -439,6 +457,32 @@ export default {
 			}
 			this.refreshList()
 		},
+		// 自定义服务端导出
+		exportMethod({ options }) {
+			// 传给服务端的参数
+			const params = {
+				'current': this.tablePage.currentPage,
+				'size': this.tablePage.pageSize,
+				'orders': this.tablePage.orders,
+				'itemType': '1',
+				...this.searchForm,
+				filename: options.filename,
+				sheetName: options.sheetName,
+				isHeader: options.isHeader,
+				original: options.original,
+				mode: options.mode,
+				selectIds: options.mode === 'selected' ? options.data.map(item => item.id) : [],
+				exportFields: options.columns.map(column => column.property)
+			}
+			return this.workContractService.exportFile(params).then((res) => {
+				// 将二进制流文件写入excel表
+				this.$utils.downloadExcel(res, options.filename + '.xls')
+			}).catch(function (err) {
+				if (err.response) {
+					console.log(err.response)
+				}
+			})
+		},
 		// 新增
 		add() {
 			this.start()
@@ -481,6 +525,16 @@ export default {
 		viewInfo(id) {
 			this.$refs.workClientForm.init('view', id)
 		},
+		// 根据报告号查看项目信息
+		viewProjectByReportNo(reportNo) {
+			this.workContractService.getProjectIdByReportNo(reportNo).then((projectId) => {
+				if (projectId) {
+					this.$refs.projectForm.init('view', projectId)
+				} else {
+					this.$message.warning('未找到该项目信息')
+				}
+			})
+		},
 		// 删除
 		del(id) {
 			let ids = id || this.$refs.workContractTable.getCheckboxRecords().map(item => {