소스 검색

中审报告归档调整

sangwenwei 2 달 전
부모
커밋
0d8ef0c871
3개의 변경된 파일154개의 추가작업 그리고 11개의 파일을 삭제
  1. 10 10
      src/views/zs/reportArchieve/ArchieveList.vue
  2. 20 1
      src/views/zs/reportArchieve/ReportArchieveForm.vue
  3. 124 0
      src/views/zs/reportArchieve/ReportArchieveImport.vue

+ 10 - 10
src/views/zs/reportArchieve/ArchieveList.vue

@@ -119,16 +119,9 @@
 		</el-form>
 
 		<div class="jp-table" style="">
-			<vxe-toolbar ref="toolbarRef" :refresh="{query: refreshList}" import export custom>
-				<template #tools>
-					<vxe-button
-						type="text"
-						title="下载导入模板"
-						icon="vxe-icon-copy"
-						class="tool-btn m-l-0"
-						@click="downloadTpl()"
-					>
-					</vxe-button>
+			<vxe-toolbar ref="toolbarRef" :refresh="{query: refreshList}" export custom>
+				<template #buttons>
+					<el-button type="primary" @click="importReport()" plain>导入</el-button>
 				</template>
 			</vxe-toolbar>
 			<div  class="jp-table-body">
@@ -224,6 +217,7 @@
 				</vxe-pager>
 				<user-select2 ref="userSelect2" @doSubmit="selectUser2"></user-select2>
 				<ReportArchieveForm ref="reportArchieveForm" @refreshList="refreshList"></ReportArchieveForm>
+				<ReportArchieveImport ref="reportArchieveImport" @refreshList="refreshList"></ReportArchieveImport>
 			</div>
 		</div>
 	</div>
@@ -234,6 +228,7 @@
 	import userService from '@/api/sys/UserService'
 	import UserSelect2 from '@/views/utils/UserTreeSelect'
 	import ReportArchieveForm from "./ReportArchieveForm";
+	import ReportArchieveImport from "./ReportArchieveImport";
 	export default {
 		data () {
 			return {
@@ -280,6 +275,7 @@
 		components: {
 			UserSelect2,
 			ReportArchieveForm,
+			ReportArchieveImport
 		},
 		mounted () {
 			this.$nextTick(() => {
@@ -441,6 +437,10 @@
 					this.refreshList();
 				});
 			},
+			//报告号替换
+			importReport(){
+				this.$refs.reportArchieveImport.init()
+			}
 
 		}
 	}

+ 20 - 1
src/views/zs/reportArchieve/ReportArchieveForm.vue

@@ -154,7 +154,7 @@
 					<el-form-item label="盒号" prop="fileBoxNumber"
 								  :rules="[{required: true, message:'盒号不能为空', trigger:'blur'}]">
 						<el-input @blur="checkFileBoxNumber()" v-model="inputForm.fileBoxNumber" class="m-2" placeholder="请输入盒号" clearable></el-input>
-						<span style="color: red; font-weight: bold;">{{usedReportNo}}</span>
+						<span style="color: lightgray; font-weight: bold;">{{usedReportNo}}</span>
 					</el-form-item>
 				</el-col>
 				<el-col :span="12">
@@ -368,6 +368,25 @@
 						this.reportArchieveService.queryById(this.inputForm.id).then((data)=>{
 							console.log('s',data)
 							this.inputForm = this.recover(this.inputForm, data)
+							this.reportArchieveService.getReportNo(this.inputForm.reportNoType).then((data1)=>{
+								if (this.commonJS.isNotEmpty(data1.fileBoxNumber)){
+									let fileBoxNumber = ''
+									let updateName = ''
+									let reportNo = ''
+									if (this.commonJS.isNotEmpty(data1.fileBoxNumber)){
+										fileBoxNumber = data1.fileBoxNumber
+									}
+									if (this.commonJS.isNotEmpty(data1.updateName)){
+										updateName = data1.updateName
+									}
+									if (this.commonJS.isNotEmpty(data1.reportNo)){
+										reportNo = data1.reportNo
+									}
+									this.usedReportNo = "盒号("+fileBoxNumber+")填写人("+updateName+")报告文号("+reportNo+")"
+								}else {
+									this.usedReportNo = ''
+								}
+							})
 						})
 						this.loading = false
 					}

+ 124 - 0
src/views/zs/reportArchieve/ReportArchieveImport.vue

@@ -0,0 +1,124 @@
+<template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
+	<div>
+		<el-dialog
+			:title="title"
+			:close-on-click-modal="false"
+			draggable
+			width="1000px"
+			height="500px"
+			@close="close"
+			append-to-body
+			v-model="visible">
+
+				<el-form :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="status === 'audit' || status === 'taskFormDetail'"
+						 label-width="135px" @submit.native.prevent>
+					<el-row  :gutter="0">
+					</el-row>
+					<el-row :gutter="0">
+						<el-col :span="12">
+							<el-form-item label="附件">
+							<el-upload
+								ref="upload"
+								action=""
+								:auto-upload="false"
+								:on-change="beforeUploadDetail"
+								:show-file-list="true">
+								<el-button type="primary">导入全部</el-button>
+							</el-upload>
+							</el-form-item>
+						</el-col>
+					</el-row>
+
+				</el-form>
+
+
+			<template #footer>
+						<span class="dialog-footer">
+					  		<el-button  type="warning" @click="downloadTpl()" plain>下载模板</el-button>
+					  		<el-button  @click="close()" icon="el-icon-circle-close">关闭</el-button>
+					  		<el-button  v-if="method !== 'view'" type="primary" icon="el-icon-circle-check" @click="doSubmit()">确定</el-button>
+					 	</span>
+				</template>
+		</el-dialog>
+	</div>
+</template>
+
+<script>
+	import ReportArchieveService from '@/api/zs/reportArchieve/ReportArchieveService'
+	export default {
+    	data(){
+    		return {
+				visible: false,
+				title: '',
+				inputForm:{
+					file:[]
+				}
+			}
+		},
+		reportArchieveService: null,
+		created () {
+			this.reportArchieveService = new ReportArchieveService()
+		},
+		components: {
+		},
+		methods: {
+			init(){
+				this.visible = true
+				this.title = '报告归档导入'
+				this.inputForm={
+					file:[]
+				}
+				this.$forceUpdate()
+			},
+
+			beforeUploadDetail(file){
+				this.inputForm.file.push(file)
+			},
+			// 下载模板
+			downloadTpl () {
+				this.loading = true
+				this.reportArchieveService.exportTemplate().then((res) => {
+					// 将二进制流文件写入excel表,以下为重要步骤
+					this.$utils.downloadExcel(res, '报告归档导入模板' + ".xls")
+					this.loading = false
+				}).catch(function (err) {
+					this.loading = false
+					if (err.response) {
+						console.log(err.response)
+					}
+				})
+			},
+			doSubmit(){
+
+				const formBody = new FormData()
+				formBody.append('file', this.inputForm.file[0].raw)
+				this.reportArchieveService.importExcel(formBody).then((data) =>{
+					if (data){
+						this.$message.success('导入成功')
+						this.close()
+						this.$emit("refreshList");
+					}
+				})
+			},
+			close(){
+				this.visible = false
+				this.$refs.inputForm.resetFields()
+				this.$refs.upload.clearFiles();
+				this.inputForm = {
+					file:[]
+				}
+			}
+
+		}
+    }
+</script>
+
+<style scoped>
+	/deep/ .el-input-number .el-input__inner {
+		text-align: left;
+	}
+	.el-row {
+		display: flex;
+		align-items: center; /* 垂直居中 */
+	}
+</style>