From c74dcb8dca7b9e3eded0d20299f19a26a6b70974 Mon Sep 17 00:00:00 2001 From: wujian <14790700720@163.com> Date: 星期三, 31 一月 2024 12:48:45 +0800 Subject: [PATCH] add 追溯报表 --- jcdm-ui/src/views/main/pr/tightenReport/index.vue | 106 ++++++++++++++++++++++++++-------------------------- 1 files changed, 53 insertions(+), 53 deletions(-) diff --git a/jcdm-ui/src/views/main/pr/tightenReport/index.vue b/jcdm-ui/src/views/main/pr/tightenReport/index.vue index 36f9cc4..5a7f8af 100644 --- a/jcdm-ui/src/views/main/pr/tightenReport/index.vue +++ b/jcdm-ui/src/views/main/pr/tightenReport/index.vue @@ -14,16 +14,17 @@ placeholder="璇疯緭鍏ュ伐浣嶅彿" @keyup.enter.native="handleQuery"/> </el-form-item> - - <el-form-item label-width="120" label="閲囬泦鏃堕棿" prop="startDate"> - <el-date-picker - v-model="dateRange" - type="daterange" - range-separator="鑷�" - start-placeholder="寮�濮嬫棩鏈�" - end-placeholder="缁撴潫鏃ユ湡"> - </el-date-picker> - <button @click="fetchData">鏌ヨ</button> + <el-form-item label-width="130" label="淇濆瓨鏃ユ湡" prop="dateConditions"> + <el-date-picker + v-model="queryParams.dateConditions" + type="datetimerange" + :picker-options="pickerOptions" + value-format="yyyy-MM-dd HH:mm:ss" + range-separator="鑷�" + start-placeholder="寮�濮嬫棩鏈�" + end-placeholder="缁撴潫鏃ユ湡" + align="right"> + </el-date-picker> </el-form-item> <el-form-item style="float: right"> <el-button type="primary" icon="el-icon-refresh" @click="handleQuery">鏌ヨ</el-button> @@ -37,16 +38,16 @@ <el-table-column type="selection" width="55" align="center" /> <el-table-column label="绠变綋缂栫爜" align="center" width="200" prop="sfcCode"></el-table-column> <el-table-column label="宸ヤ綅" align="center" prop="locationCode"></el-table-column> - <el-table-column label="鍙傛暟缂栫爜" align="center" prop="paramCode"></el-table-column> <el-table-column label="鍙傛暟鍚嶇О" align="center" prop="paramName"></el-table-column> + <el-table-column label="鍙傛暟缂栫爜" align="center" prop="paramCode"></el-table-column> <el-table-column label="鍙傛暟鍊�" align="center" prop="paramValue"></el-table-column> + <el-table-column label="鍗曚綅" align="center" prop="unit"></el-table-column> + <el-table-column label="缁撴灉" align="center" prop="state"></el-table-column> <el-table-column label="閲囬泦鏃堕棿" align="center" prop="collectionTime" width="180"> <template slot-scope="scope"> - <span>{{ parseTime(scope.row.collectionTime, '{y}-{m}-{d}') }}</span> + <span>{{ parseTime(scope.row.collectionTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> </template> </el-table-column> - <el-table-column label="鐘舵��" align="center" prop="state"></el-table-column> - <el-table-column label="鍗曚綅" align="center" prop="unit"></el-table-column> </el-table> <el-empty v-else> <span slot="description">鏆傛棤鏁版嵁</span> @@ -112,31 +113,46 @@ unit: null, type: '鎷х揣鏁版嵁', startDate: null, - endDate: null + endDate: null, + dateConditions: [], + }, + pickerOptions: { + shortcuts: [{ + text: '鏈�杩戜竴鍛�', + onClick(picker) { + const end = new Date(); + const start = new Date(); + start.setTime(start.getTime() - 3600 * 1000 * 24 * 7); + picker.$emit('pick', [start, end]); + }, + class: 'custom-shortcut' // 娣诲姞class灞炴�� + }, { + text: '鏈�杩戜竴涓湀', + onClick(picker) { + const end = new Date(); + const start = new Date(); + start.setTime(start.getTime() - 3600 * 1000 * 24 * 30); + picker.$emit('pick', [start, end]); + }, + class: 'custom-shortcut' // 娣诲姞class灞炴�� + }, { + text: '鏈�杩戜笁涓湀', + onClick(picker) { + const end = new Date(); + const start = new Date(); + start.setTime(start.getTime() - 3600 * 1000 * 24 * 90); + picker.$emit('pick', [start, end]); + }, + }] }, } }, created() { this.getList(); }, - methods:{ + methods: { - async fetchData() { - // 鏋勫缓API璇锋眰鐨刄RL锛屼娇鐢ㄩ�夋嫨鐨勬棩鏈熻寖鍥翠綔涓烘煡璇㈠弬鏁� - const url = `@/api/main/da/paramCollection/paramCollection?startDate=${this.dateRange[0]}&endDate=${this.dateRange[1]}`; - - try { - // 鍙戦�丄PI璇锋眰锛岃幏鍙栨煡璇㈢粨鏋� - const response = await fetch(url); - const data = await response.json(); - console.log(data); // 澶勭悊鏌ヨ缁撴灉锛屾瘮濡傚湪鎺у埗鍙拌緭鍑烘垨鏄剧ず鍦ㄩ〉闈笂 - } catch (error) { - console.error('Error fetching data:', error); - } - }, - }, - - reset() { + reset() { this.form = { id: null, workOrderNo: null, @@ -177,31 +193,12 @@ // 澶氶�夋閫変腑鏁版嵁 handleSelectionChange(selection) { this.ids = selection.map(item => item.id) - this.single = selection.length!==1 + this.single = selection.length !== 1 this.multiple = !selection.length }, getList() { this.loading = true; - // const startDate = new Date(this.queryParams.startDate); - // const endDate = new Date(this.queryParams.endDate); - // const resultList = []; - // // 鏋勫缓鏌ヨ鏉′欢锛屼娇鐢≒aramCollection琛ㄧ殑createtime浣滀负鍒ゆ柇鏉′欢 - // const query = { - // createTime: date // 浣跨敤褰撳墠鏃ユ湡浣滀负鏌ヨ鏉′欢 - // }; - // for (let date = startDate; date <= endDate; date.setDate(date.getDate() + 1)) { - // // 鏍规嵁褰撳墠鏃ユ湡鎵ц鏌ヨ鎿嶄綔锛屽苟灏嗙粨鏋滄坊鍔犲埌缁撴灉鏁扮粍涓� - // listParamCollection(query).then(response => { - // resultList.push(...response.rows); - // // 鍒ゆ柇鏄惁鏄渶鍚庝竴涓棩鏈燂紝濡傛灉鏄紝鍒欐洿鏂伴〉闈㈡暟鎹� - // if (date.getTime() === endDate.getTime()) { - // this.tightenReportList = resultList; - // this.total = resultList.length; - // this.loading = false; - // } - // }); - // } listParamCollection(this.queryParams).then(response => { this.tightenReportList = response.rows; this.total = response.total; @@ -209,8 +206,9 @@ }); }, - + }, } + </script> <style scoped> @@ -220,4 +218,6 @@ ::v-deep .el-card__body{ padding: 15px 20px 0px 20px; } + +/* 娣诲姞鍏朵粬鏍峰紡灞炴�� */ </style> -- Gitblit v1.9.3