Browse Source

批量归档

sangwenwei 1 year ago
parent
commit
8c0fdf48ac

+ 1 - 0
src/views/cw/fillingbatch/FileForm.vue

@@ -10,6 +10,7 @@
       v-model="visible">
       <el-form :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="method==='view'"
                label-width="100px" @submit.native.prevent>
+
 		  <el-button  type="primary" :disabled="this.method === 'edit'"   @click="insertEvent" plain>
 			  添加文件信息
 		  </el-button>

+ 1 - 1
src/views/cw/fillingbatch/FillingbatchDia.vue

@@ -85,7 +85,7 @@
 							:edit-config="{trigger: 'click', mode: 'row', showStatus: true, autoClear: true, icon:'_'}"
 							:tree-config="{transform: true,rowField: 'id', parentField: 'parentId', accordion: true}"
 							row-id="id">
-							<vxe-column title="归档项目编号/文件类型" field="projectNumber"  align="center" tree-node>
+							<vxe-column title="归档项目编号/文件类型" field="projectNumber"   align="center" tree-node>
 								<template v-slot:edit="scope">
 									<el-input  v-model="scope.row.projectNumber" :disabled="true"></el-input>
 								</template>

+ 1 - 0
src/views/cw/fillingbatch/FillingbatchForm.vue

@@ -452,6 +452,7 @@
 				this.loading = true
 				fillingbatchService.exportTemplate().then((res) => {
 					// 将二进制流文件写入excel表,以下为重要步骤
+					console.log('res',res)
 					this.$utils.downloadExcel(res, '批量归档导入模板')
 					this.loading = false
 				}).catch(function (err) {

+ 1 - 1
src/views/cw/fillingbatch/ProgramPageForm.vue

@@ -9,7 +9,7 @@
       @close="close"
       append-to-body
       v-model="visible">
-          <el-form  :inline="true" class="query-form" ref="searchForm" :model="searchForm" @submit.native.prevent>
+          <el-form   :inline="true" class="query-form" ref="searchForm" :model="searchForm" @submit.native.prevent>
             <!-- 搜索框-->
             <el-form-item label="项目名称" prop="name">
               <el-input v-model="searchForm.name" placeholder="请输入项目名称" clearable></el-input>

+ 35 - 23
src/views/cw/projectRecords/ProjectPlanForm.vue

@@ -52,7 +52,7 @@
 				<el-button size="default" style="margin-left: 20px" type="primary" :disabled = "method === 'view'" @click="exportPlan()" plain>
 					导出
 				</el-button>
-				<a v-if="inputForm.planStartDate !=='' && inputForm.planEndDate !== ''" style="margin-left: 1em;font-size: 14px">项目起始时间:{{inputForm.planStartDate}} - {{inputForm.planEndDate}}</a>
+				<a v-if="commonJS.isNotEmpty(inputForm.planStartDate) && commonJS.isNotEmpty(inputForm.planEndDate)" style="margin-left: 1em;font-size: 14px">项目起始时间:{{inputForm.planStartDate}} - {{inputForm.planEndDate}}</a>
 			</el-divider>
 			<el-row  :gutter="15">
 				<el-col :span="24">
@@ -73,11 +73,15 @@
 						<vxe-table-column field="taskPhase" title="任务阶段" :edit-render="{}" show-overflow="title" :rules="[{required: true, message:'请输入任务阶段', trigger:'blur'}]">
 							<template v-slot:edit="scope">
 								<el-autocomplete
+									value-key="taskPhase"
 									class="inline-input"
 									v-model="scope.row.taskPhase"
 									:fetch-suggestions="querySearch"
+									:trigger-on-focus="false"
+									clearable
 									placeholder="请输入内容"
-									@select="handleSelect"
+									:popper-append-to-body="false"
+									:popper-class="vxetableignoreclear"
 								></el-autocomplete>
 							</template>
 						</vxe-table-column>
@@ -189,6 +193,8 @@
 			  detailkey: '',
 			  visible: false,
 			  restaurants: [],
+			  tableIndex:0,
+			  vxetableignoreclear:'vxe-table--ignore-clear'
 		  }
 	  },
 
@@ -220,7 +226,7 @@
 		  }
 	  },
 	  mounted() {
-		  this.restaurants = this.loadAll();
+		  this.loadAll();
 	  },
 	  components: {
 		  UpLoadComponent,
@@ -266,9 +272,15 @@
 					  this.$refs.uploadComponent.clearUpload()
 					  this.inputForm = this.recover(this.inputForm, data)
 					  this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
-					  this.inputForm.planStartDate = this.moment(data.planStartDate).format('YYYY-MM-DD')
-					  this.inputForm.planEndDate = this.moment(data.planEndDate).format('YYYY-MM-DD')
-
+					  this.inputForm.planStartDate = data.projectStartTime
+					  this.inputForm.planEndDate = data.projectEndTime
+					  // if (this.commonJS.isEmpty(data.planStartDate)){
+						//   this.inputForm.planStartDate = this.moment(data.planStartDate).format('YYYY-MM-DD')
+					  // }
+					  // if (this.commonJS.isEmpty(data.planEndDate)){
+						//   this.inputForm.planEndDate = this.moment(data.planEndDate).format('YYYY-MM-DD')
+					  // }
+						console.log('this.inputForm.planStartDate',this.inputForm.planStartDate)
 					  if (this.commonJS.isEmpty(this.inputForm.planDetailsList)) {
 						  this.inputForm.planDetailsList = []
 						  let phase = this.$dictUtils.getDictList('cw_project_plan_phase')
@@ -297,7 +309,6 @@
 							  this.inputForm.planDetailsList[li].planEndDate = this.inputForm.planEndDate
 						  }
 					  }
-
 					  this.$refs.uploadComponent.newUpload(this.method, this.inputForm.planFileList, 'cw_project_plan', null, '项目计划附件信息', null, null, false)
 
 					  this.loading = false
@@ -404,29 +415,30 @@
 			  this.inputForm.planDetailsList.splice(rowIndex, 1)
 		  },
 		  querySearch(queryString, cb) {
-			  var restaurants = this.restaurants;
-			  var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
-			  // 调用 callback 返回建议列表的数据
-			  console.log('results', results)
-			  cb(results);
+		  	console.log('queryString',queryString)
+			  const restaurants = this.restaurants
+			  let results = queryString
+				  ? restaurants.filter(
+					  this.createFilter(queryString)
+				  )
+				  : restaurants
+			  console.log('results',results)
+			  cb(results.map(restaurant => ({ taskPhase: restaurant.value })))
 		  },
 		  createFilter(queryString) {
-			  return (restaurant) => {
-				  return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
+			  return (taskPhase) => {
+				  return taskPhase.value.toUpperCase().startsWith(queryString.toUpperCase());
 			  };
 		  },
 		  loadAll() {
-			let task = []
-		  	projectRecordsService.getTaskPhase().then((data)=>{
-			  	task=data
+				 projectRecordsService.getTaskPhase().then((data)=>{
+					this.restaurants=data
 			  })
-			  console.log('task',task)
-			  return projectRecordsService.getTaskPhase()
-		  },
-		  handleSelect(item) {
-			  console.log(item);
-			  console.log('index', index);
+
 		  },
+		  // handleSubmit(item) {
+			//
+		  // },
 		  // 自定义服务端导出
 		  exportPlan() {
 		  	let optionName = this.inputForm.projectName+"项目计划.xls"