Browse Source

归档添加文档转移功能

huangguoce 3 weeks ago
parent
commit
c40d0aa5d8

File diff suppressed because it is too large
+ 697 - 733
src/views/cw/projectReportArchive/ProjectReportArchiveForm.vue


+ 10 - 1
src/views/cw/projectReportArchive/ProjectReportArchiveList.vue

@@ -96,6 +96,8 @@
         <template #buttons>
           <el-button v-if="hasPermission('cwProjectReportArchive:newExport')" type="primary" icon="el-icon-Download"
             @click="exportNew()">导出</el-button>
+          <el-button v-if="hasPermission('cwProjectReportArchive:docTransfer')" type="primary" icon="el-icon-Connection"
+            @click="docTransfer()">文档转移</el-button>
 
           <!--          <el-button v-if="hasPermission('cwProjectReportArchive:add')" type="primary" icon="el-icon-plus" @click="start()">新建</el-button>-->
         </template>
@@ -235,6 +237,7 @@
       <user-select1 ref="userSelect1" @doSubmit="selectUser1"></user-select1>
       <user-select2 ref="userSelect2" @doSubmit="selectUser2"></user-select2>
       <user-select3 ref="userSelect3" @doSubmit="selectUser3"></user-select3>
+      <ReportTransfer ref="reportTransfer"></ReportTransfer>
     </div>
   </div>
 </template>
@@ -258,6 +261,7 @@ import ProjectReportArchiveDia from "./ProjectReportArchiveDia";
 import UserSelect1 from '@/views/utils/UserTreeSelectBySignatureScribe'
 import UserSelect2 from '@/views/utils/UserTreeSelectBySignatureScribe'
 import UserSelect3 from '@/views/utils/UserTreeSelect'
+import ReportTransfer from './ReportTransfer.vue'
 
 import dayjs from 'dayjs'
 export default {
@@ -353,7 +357,8 @@ export default {
     ProjectReportBorrowMessageForm,
     ProjectReportArchiveDia,
     UserSelect1,
-    UserSelect3
+    UserSelect3,
+    ReportTransfer
   },
   computed: {
     userName() {
@@ -826,6 +831,10 @@ export default {
       console.log(user[0].name)
       this.searchForm.createBy.name = user[0].name
     },
+    // 文档批量转移
+    docTransfer() {
+      this.$refs.reportTransfer.init('docTransfer')
+    }
   }
 }
 </script>

+ 40 - 1
src/views/cw/projectReportArchive/ProjectReportArchiveTaskForm.vue

@@ -1,5 +1,5 @@
 <template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
-  <div v-if="false">
+  <div v-if="$store.state.user.company.name == '苏州分公司'">
     <el-row>
       <el-col :span="24">
         <el-form :model="inputForm" ref="inputForm" v-loading="loading" :class="method === 'view' ? 'readonly' : ''"
@@ -486,6 +486,15 @@
                 <el-input :disabled="true" v-model="inputForm.isNumber" placeholder="请填写确认盒号" clearable></el-input>
               </el-form-item>
             </el-col>
+            <el-col v-if="status !== 'audit'" :span="12">
+              <el-form-item label="文档存放位置" prop="specialPlace" :rules="[
+              ]">
+                <el-input :disabled="true" v-model="inputForm.specialPlace" placeholder="请填写文档存放位置(特殊)"
+                  clearable></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col v-if="status !== 'audit'" :span="12"></el-col>
+
             <el-col :span="12" v-if="status !== 'audit'">
               <el-form-item class="star-require" label="审定金额(不含税/元)" prop="approvedNoIncludingTax" :rules="[
               ]">
@@ -539,6 +548,15 @@
               </el-form-item>
             </el-col>
             <el-col :span="12" v-if="status === 'audit'">
+              <el-form-item label="文档存放位置" prop="specialPlace" :rules="[
+              ]">
+                <el-input :disabled="false" style="width: 100%" v-model="inputForm.specialPlace" placeholder="请填写文档存放位置"
+                  clearable></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col v-if="status === 'audit'" :span="12"></el-col>
+
+            <el-col :span="12" v-if="status === 'audit'">
               <el-form-item class="star-require" label="审定金额(不含税/元)" prop="approvedNoIncludingTax" :rules="[
               ]">
                 <el-input :disabled="true" v-model="inputForm.approvedNoIncludingTax"
@@ -812,6 +830,16 @@
                 <el-input :disabled="true" v-model="inputForm.isNumber" placeholder="请填写确认盒号" clearable></el-input>
               </el-form-item>
             </el-col>
+
+            <el-col v-if="status !== 'audit'" :span="12">
+              <el-form-item label="文档存放位置" prop="specialPlace" :rules="[
+              ]">
+                <el-input :disabled="true" style="width: 100%" v-model="inputForm.specialPlace" placeholder="请填写文档存放位置"
+                  clearable></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col v-if="status !== 'audit'" :span="12"></el-col>
+
             <el-form v-if="status === 'audit'" style="width: 100%" :model="inputForm" ref="inputForm"
               v-loading="loading" :class="method === 'view' ? 'readonly' : ''" label-width="110px"
               @submit.native.prevent>
@@ -832,6 +860,15 @@
                 </el-form-item>
               </el-col>
               <el-col :span="12">
+                <el-form-item label="文档存放位置" prop="specialPlace" :rules="[
+                ]">
+                  <el-input :disabled="false" style="width: 100%" v-model="inputForm.specialPlace"
+                    placeholder="请填写文档存放位置" clearable></el-input>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12"></el-col>
+
+              <el-col :span="12">
                 <el-form-item label="备注" prop="remarks" :rules="[
                 ]">
                   <el-input type="textarea" :disabled="false" style="width: 100%" v-model="inputForm.remarks"
@@ -1099,6 +1136,7 @@ export default {
         year: '',
         number: '',
         isNumber: '',
+        specialPlace: '',
         approveRemarks: '',
         contract: '',
         approvedNoIncludingTax: "",
@@ -1265,6 +1303,7 @@ export default {
         year: '',
         number: '',
         isNumber: '',
+        specialPlace: '',
         approveRemarks: '',
         contract: '',
         approvedNoIncludingTax: "",

+ 122 - 0
src/views/cw/projectReportArchive/ReportTransfer.vue

@@ -0,0 +1,122 @@
+<template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
+	<div>
+		<el-dialog :title="title" :close-on-click-modal="false" draggable width="600px" height="500px" @close="close"
+			append-to-body v-model="visible">
+			<el-form :model="inputForm" ref="inputForm" :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="24">
+						<el-form-item label="报告年份" :rules="rules.year" prop="year">
+							<el-input v-model="inputForm.year" placeholder="请输入报告年份" style="width: 100%;"></el-input>
+						</el-form-item>
+					</el-col>
+					<el-col :span="24">
+						<el-form-item label="文档存放位置" :rules="rules.specialPlace" prop="specialPlace">
+							<el-input v-model="inputForm.specialPlace" placeholder="请输入文档存放位置"></el-input>
+						</el-form-item>
+					</el-col>
+				</el-row>
+			</el-form>
+
+			<template #footer>
+				<span class="dialog-footer">
+					<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 ProjectReportArchiveService from '@/api/cw/projectRecords/ProjectReportArchiveService'
+export default {
+	data() {
+		return {
+			visible: false,
+			title: '',
+			inputForm: {
+				year: "",
+				specialPlace: "",
+			},
+			// 校验规则,年份必须为数字
+			rules: {
+				year: [
+					{ required: true, message: '请输入报告年份', trigger: 'blur' },
+					{ pattern: /^[0-9]{4}$/, message: '报告年份必须为4位数字', trigger: 'blur' }
+				],
+				specialPlace: [
+					{ required: true, message: '请输入文档存放位置', trigger: 'blur' }
+				]
+			}
+		}
+	},
+	projectReportArchiveService: null,
+	created() {
+	},
+	components: {
+	},
+	methods: {
+		handleRemove() {
+			this.inputForm.file.pop()
+		},
+		init() {
+			this.visible = true
+			this.title = '文档转移'
+			this.inputForm = {
+				year: "",
+				specialPlace: "",
+			}
+			this.projectReportArchiveService = new ProjectReportArchiveService()
+			this.$forceUpdate()
+		},
+		doSubmit() {
+			// 校验数据
+			this.$refs.inputForm.validate((valid) => {
+				if (valid) {
+					const loading = this.$loading({
+						lock: true,
+						text: '操作中,请稍后',
+						spinner: 'el-icon-loading',
+						background: 'rgba(255, 255, 255, 0.3)'
+					});
+					this.projectReportArchiveService.updatePlaceByYear(this.inputForm).then((data) => {
+						this.$message.success(data)
+						loading.close();
+					}).catch(err => {
+						loading.close();
+					})
+				} else {
+					return false;
+				}
+			});
+
+		},
+		close() {
+			this.visible = false
+			this.$refs.inputForm.resetFields()
+			this.inputForm = {
+				year: "",
+				specialPlace: "",
+			}
+		}
+
+	}
+}
+</script>
+
+<style scoped>
+/deep/ .el-input-number .el-input__inner {
+	text-align: left;
+}
+
+.el-row {
+	display: flex;
+	align-items: center;
+	/* 垂直居中 */
+}
+</style>

+ 1 - 2
src/views/cw/reportManagement/ReportListImport.vue

@@ -57,7 +57,7 @@ export default {
 		},
 		init() {
 			this.visible = true
-			this.title = '项目导入'
+			this.title = '报告导入'
 			this.inputForm = {
 				file: []
 			}
@@ -117,7 +117,6 @@ export default {
 							},
 						})
 					} else {
-						this.$message.success('操作成功')
 						this.$emit("refreshDataList");
 					}
 				} else {