Przeglądaj źródła

承担单位例行监测任务列表样式及功能修改

jiangyu 3 lat temu
rodzic
commit
ae975040f4
1 zmienionych plików z 56 dodań i 32 usunięć
  1. 56 32
      src/components/jc/routineMonitor.vue

+ 56 - 32
src/components/jc/routineMonitor.vue

@@ -12,7 +12,7 @@
 			</div>
 			<!-- 头部搜索栏 -->
 			<el-row :gutter="50" style="margin-right: 0px;">
-				<el-form style="display: flex; flex-direction: row;">
+				<el-form style="display: flex; flex-direction: row;"  size="mini">
 					<el-form-item label="年度" class="select">
 						<el-date-picker v-model="queryInfo.taskyear" style="width: 110px;" value-format="yyyy"
 							type="year" clearable />
@@ -28,7 +28,7 @@
 						<el-date-picker v-model="queryInfo.starttime" style="width: 180px;" align="right" type="date"
 							:picker-options="pickerOptions" clearable />
 					</el-form-item>
-					<el-form-item label="--" class="select" style="margin-left: 10px;">
+					<el-form-item label="--" class="select" style="margin-left: 10px; padding-left: 0px;">
 						<el-date-picker v-model="queryInfo.endtime" style="width: 180px;" align="right" type="date"
 							:picker-options="pickerOptions" clearable />
 					</el-form-item>
@@ -36,9 +36,9 @@
 						<el-input v-model="queryInfo.taskname"></el-input>
 					</el-form-item>
 					<!-- 查询 -->
-					<el-button style="height: 40px;margin-left: 10px;" type="success">查询</el-button>
+					<el-button style="height: 40px;margin-left: 10px;" type="success" @click="searchData()">查询</el-button>
 					<!-- 重置 -->
-					<el-button style="height: 40px;margin-left: 5px;" type="success">重置</el-button>
+					<el-button style="height: 40px;margin-left: 5px;" type="success" @click="reset()">重置</el-button>
 				</el-form>
 			</el-row>
 			<!--  头部钮区域-->
@@ -63,25 +63,25 @@
 
 				<el-table-column :key="table.label" v-for="table in tableHeader" :label="table.label" :prop="table.prop"
 					align="center" :width="table.width" :fixed="table.fixed" />
-				<el-table-column prop="status" label="任务状态">
+				<el-table-column prop="ispublic" label="任务状态" align="center">
 					<template slot-scope="scope">
-						<el-tag type="success" v-if="scope.row.ispublic==1">已发布</el-tag>
+						<!-- <el-tag type="success" v-if="scope.row.ispublic==1">已发布</el-tag> -->
 						<el-tag type="danger" v-if="scope.row.ispublic==2">废止</el-tag>
 						<el-tag type="info" v-if="scope.row.ispublic==3">已结束,未完成</el-tag>
 						<el-tag type="success" v-if="scope.row.ispublic==4">已结束,已完成</el-tag>
 						<el-tag type="warning" v-if="scope.row.ispublic==5">执行中</el-tag>
 					</template>
 				</el-table-column>
-				<el-table-column prop="status" label="任务优先级" width="100">
+				<el-table-column prop="level" label="任务优先级" width="100" align="center">
 					<template slot-scope="scope">
 						<el-tag type="success" v-if="scope.row.level==0">一般</el-tag>
 						<el-tag type="warning" v-if="scope.row.level==1">紧急</el-tag>
 						<el-tag type="danger" v-if="scope.row.level==2">特急</el-tag>
 					</template>
 				</el-table-column>
-				<el-table-column prop="status" label="附件" width="80">
+				<el-table-column prop="file_url" label="附件" width="80" align="center">
 					<template slot-scope="scope">
-						<el-link type="primary" :href="scope.row.fileurl">附件</el-link>
+						<el-link type="primary" :href="scope.row.file_url">下载</el-link>
 					</template>
 				</el-table-column>
 				<el-table-column label="操作" align="center" fixed="right">
@@ -93,7 +93,7 @@
 				</el-table-column>
 			</el-table>
 			<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
-				:current-page="currentPage" :page-sizes="[10, 20, 30, 40]" :page-size="pageNum"
+				:current-page="queryInfo.currentPage" :page-sizes="[10, 20, 30, 40]" :page-size="queryInfo.pageSize"
 				layout="total, sizes, prev, pager, next, jumper" :total="total">
 			</el-pagination>
 	
@@ -106,9 +106,7 @@
 		name: '',
 		data() {
 			return {
-				currentPage: 1,
 				total: 0,
-				pageNum: 10,
 				cellStyle: {
 					padding: 2 + 'px'
 				},
@@ -158,29 +156,33 @@
 				tableData: [],
 				// 批量删除选中数据
 				multipleSelection: [],
-				queryInfo: {},
+				queryInfo:{
+					pageSize:10,
+					pageNum:1,
+					currentPage:1,
+					year:'',
+					ispublic:'',
+					starttime:'',
+					endtime:'',
+					task_name:'',
+					task_class:'例行监测'
+				},
 				// 任务状态选项
 				taskstatus: [{
-					value: '选项1',
+					value: '',
 					label: '全部'
-				}, {
-					value: '选项2',
-					label: '未发布'
-				}, {
-					value: '选项3',
-					label: '已发布'
-				}, {
-					value: '选项4',
+				},{
+					value: '2',
 					label: '已废止'
 				}, {
-					value: '选项5',
-					label: '执行中'
-				}, {
-					value: '选项6',
+					value: '3',
 					label: '已结束,未完成'
 				}, {
-					value: '选项7',
+					value: '4',
 					label: '已结束,已完成'
+				}, {
+					value: '5',
+					label: '执行中'
 				}],
 				// 日期选择器快捷选项
 				pickerOptions: {
@@ -225,20 +227,42 @@
 				// this.$router.push('')
 			},
 			async gettaskList() {
+				for (var key in this.queryInfo) {
+					if (this.queryInfo[key] == '') {
+						delete this.queryInfo[key]
+					}
+				}
 				const {
 					data: res
 				} = await this.$http.post(
-					"getTaskcd", {
-						'pageNum': this.currentPage,
-						'pageSize': this.pageNum,
-						'task_class': '例行监测'
-					}
+					"getTaskcd", this.queryInfo
 				);
 				console.log(res)
 				this.tableData = res.data.rows
 				this.total = res.data.total
 
 
+			},
+				// 搜索
+			async searchData() {
+				console.log(this.queryInfo)
+				this.queryInfo.pageNum = 1
+				this.gettaskList()
+			},
+
+			// 重置
+			reset(){
+				this.queryInfo={
+					year:'',
+					task_name:'',
+					starttime:'',
+					endtime:'',
+					ispublic:'',
+					pageSize:10,
+					pageNum:1,
+					task_class:'例行监测'
+				}
+				this.gettaskList()
 			},
 			runtask(id) {
 				console.log(id)