From ea3c33c8561df39d4f123d1424fda99dd0f0c51d Mon Sep 17 00:00:00 2001 From: wujian <14790700720@163.com> Date: 星期四, 14 十一月 2024 08:15:41 +0800 Subject: [PATCH] add - panel --- jcdm-ui/src/views/main/da/paramCollection/index.vue | 229 +++++++++++++++++++++++---------------------------------- 1 files changed, 93 insertions(+), 136 deletions(-) diff --git a/jcdm-ui/src/views/main/da/paramCollection/index.vue b/jcdm-ui/src/views/main/da/paramCollection/index.vue index 223ef78..0f2c5bb 100644 --- a/jcdm-ui/src/views/main/da/paramCollection/index.vue +++ b/jcdm-ui/src/views/main/da/paramCollection/index.vue @@ -1,22 +1,35 @@ <template> <div class="app-container"> <el-card class="box-card"> - <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> - <el-form-item label="浜у搧缂栫爜" prop="productCode"> + <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px"> + <el-form-item label="鍙戝姩鏈虹紪鐮�" prop="sfcCode"> <el-input - v-model="queryParams.productCode" - placeholder="璇疯緭鍏ヤ骇鍝佺紪鐮�" + v-model="queryParams.sfcCode" + placeholder="璇疯緭鍏ュ彂鍔ㄦ満缂栫爜" clearable @keyup.enter.native="handleQuery" /> </el-form-item> - <el-form-item label="浜у搧鍚嶇О" prop="productName"> + <el-form-item label="宸ヤ綅缂栧彿" prop="locationCode"> <el-input - v-model="queryParams.productName" - placeholder="璇疯緭鍏ヤ骇鍝佸悕绉�" + v-model="queryParams.locationCode" + placeholder="璇疯緭鍏ュ伐浣嶇紪鍙�" clearable @keyup.enter.native="handleQuery" /> + </el-form-item> + <el-form-item label="鏃ユ湡鑼冨洿" prop="dateConditions"> + <el-date-picker + v-model="queryParams.dateConditions" + type="daterange" + align="right" + unlink-panels + range-separator="鑷�" + start-placeholder="寮�濮嬫棩鏈�" + end-placeholder="缁撴潫鏃ユ湡" + value-format="yyyy-MM-dd" + @change="handleDateChange"> + </el-date-picker> </el-form-item> <el-form-item style="float: right"> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button> @@ -73,99 +86,41 @@ <el-table v-loading="loading" border :data="paramCollectionList" @selection-change="handleSelectionChange" v-if="paramCollectionList.length > 0"> <el-table-column type="selection" width="55" align="center" /> - <el-table-column label="涓婚敭id" align="center" prop="id" /> - <el-table-column label="宸ュ崟缂栧彿" align="center" prop="workOrderNo"> -<!-- <template slot-scope="scope">--> -<!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.workOrderNo"/>--> -<!-- </template>--> - </el-table-column> - <el-table-column label="鎬绘垚搴忓垪鍙�" align="center" width="100" prop="sfcCode"> -<!-- <template slot-scope="scope">--> -<!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.sfcCode"/>--> -<!-- </template>--> - </el-table-column> - <el-table-column label="浜у搧缂栧彿" align="center" prop="productCode"> -<!-- <template slot-scope="scope">--> -<!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.productCode"/>--> -<!-- </template>--> - </el-table-column> - <el-table-column label="浜х嚎缂栧彿" align="center" prop="productionLine"> -<!-- <template slot-scope="scope">--> -<!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.productionLine"/>--> -<!-- </template>--> - </el-table-column> - <el-table-column label="宸ヤ綅缂栧彿" align="center" prop="locationCode"> -<!-- <template slot-scope="scope">--> -<!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.locationCode"/>--> -<!-- </template>--> - </el-table-column> - <el-table-column label="璁惧缂栧彿" align="center" prop="equipmentNo"> -<!-- <template slot-scope="scope">--> -<!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.equipmentNo"/>--> -<!-- </template>--> - </el-table-column> - <el-table-column label="鍙傛暟缂栫爜" align="center" prop="paramCode"> -<!-- <template slot-scope="scope">--> -<!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.paramCode"/>--> -<!-- </template>--> - </el-table-column> - <el-table-column label="鍙傛暟鍊�" align="center" prop="paramValue"> -<!-- <template slot-scope="scope">--> -<!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.paramValue"/>--> -<!-- </template>--> - </el-table-column> - <el-table-column label="鍙傛暟涓婇檺" align="center" prop="paramUpper"> -<!-- <template slot-scope="scope">--> -<!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.paramUpper"/>--> -<!-- </template>--> - </el-table-column> - <el-table-column label="鍙傛暟涓嬮檺" align="center" prop="paramLower"> -<!-- <template slot-scope="scope">--> -<!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.paramLower"/>--> -<!-- </template>--> - </el-table-column> - <el-table-column label="鏍囧噯鍊�" align="center" prop="paramStandard"> -<!-- <template slot-scope="scope">--> -<!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.paramStandard"/>--> -<!-- </template>--> - </el-table-column> - <el-table-column label="閲囬泦鏃堕棿" align="center" prop="collectionTime" width="180"> +<!-- <el-table-column label="宸ュ崟缂栧彿" align="center" prop="workOrderNo"></el-table-column>--> + <el-table-column label="鍙戝姩鏈虹紪鐮�" align="center" width="160" prop="sfcCode" ></el-table-column> +<!-- <el-table-column label="浜у搧缂栧彿" align="center" prop="productCode"></el-table-column>--> +<!-- <el-table-column label="浜х嚎缂栧彿" align="center" prop="productionLine"></el-table-column>--> +<!-- <el-table-column label="璁惧缂栧彿" align="center" prop="equipmentNo"></el-table-column>--> + <el-table-column label="鍙傛暟鍚嶇О" align="center" prop="paramName" width="150" ></el-table-column> + <el-table-column label="鍙傛暟鍊�" align="center" prop="paramValue"></el-table-column> + <el-table-column label="宸ヤ綅缂栧彿" align="center" prop="locationCode"></el-table-column> + <el-table-column label="鍙傛暟涓婇檺" align="center" prop="paramUpper"></el-table-column> + <el-table-column label="鍙傛暟涓嬮檺" align="center" prop="paramLower"></el-table-column> + <el-table-column label="閲囬泦鏃堕棿" align="center" prop="collectionTime" width="160"> <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"> -<!-- <template slot-scope="scope">--> -<!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.state"/>--> -<!-- </template>--> - </el-table-column> - <el-table-column label="鍙傛暟鍚嶇О" align="center" prop="paramName"> -<!-- <template slot-scope="scope">--> -<!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.paramName"/>--> -<!-- </template>--> - </el-table-column> - <el-table-column label="鍗曚綅" align="center" prop="unit"> -<!-- <template slot-scope="scope">--> -<!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.unit"/>--> -<!-- </template>--> - </el-table-column> - <el-table-column label="绫诲瀷" align="center" prop="type"> -<!-- <template slot-scope="scope">--> -<!-- <dict-tag :options="dict.type.${column.dictType}" :value="scope.row.type"/>--> -<!-- </template>--> - </el-table-column> - <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width" > + <el-table-column label="鐘舵��" align="center" prop="state"></el-table-column> + <el-table-column label="鍙傛暟缂栫爜" align="center" prop="paramCode"></el-table-column> + <el-table-column label="鍗曚綅" align="center" prop="unit"></el-table-column> + <el-table-column label="绫诲瀷" align="center" prop="type"></el-table-column> + <el-table-column fixed="right" width="200" label="鎿嶄綔" align="center" class-name="small-padding fixed-width" > <template slot-scope="scope"> <el-button size="mini" - type="text" + type="success" + plain + style="width: 72px" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['main:paramCollection:edit']" >淇敼</el-button> <el-button size="mini" - type="text" + type="danger" + plain + style="width: 72px" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['main:paramCollection:remove']" @@ -189,24 +144,24 @@ <!-- 娣诲姞鎴栦慨鏀硅澶囦骇鍝佽繃绋嬪弬鏁伴噰闆嗗璇濇 --> <el-dialog v-dialogpop-up :title="title" :visible.sync="open" width="500px" append-to-body> <el-form ref="form" :model="form" :rules="rules" label-width="80px"> - <el-form-item label="宸ュ崟缂栧彿" prop="workOrderNo"> - <el-input v-model="form.workOrderNo" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�" /> - </el-form-item> - <el-form-item label="鎬绘垚搴忓垪鍙�" prop="sfcCode"> +<!-- <el-form-item label="宸ュ崟缂栧彿" prop="workOrderNo">--> +<!-- <el-input v-model="form.workOrderNo" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�" />--> +<!-- </el-form-item>--> + <el-form-item label="鍙戝姩鏈虹紪鐮�" prop="sfcCode"> <el-input v-model="form.sfcCode" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�" /> </el-form-item> <el-form-item label="浜у搧缂栧彿" prop="productCode"> <el-input v-model="form.productCode" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�" /> </el-form-item> - <el-form-item label="浜х嚎缂栧彿" prop="productionLine"> - <el-input v-model="form.productionLine" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�" /> - </el-form-item> +<!-- <el-form-item label="浜х嚎缂栧彿" prop="productionLine">--> +<!-- <el-input v-model="form.productionLine" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�" />--> +<!-- </el-form-item>--> <el-form-item label="宸ヤ綅缂栧彿" prop="locationCode"> <el-input v-model="form.locationCode" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�" /> </el-form-item> - <el-form-item label="璁惧缂栧彿" prop="equipmentNo"> - <el-input v-model="form.equipmentNo" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�" /> - </el-form-item> +<!-- <el-form-item label="璁惧缂栧彿" prop="equipmentNo">--> +<!-- <el-input v-model="form.equipmentNo" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�" />--> +<!-- </el-form-item>--> <el-form-item label="鍙傛暟缂栫爜" prop="paramCode"> <el-input v-model="form.paramCode" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�" /> </el-form-item> @@ -222,26 +177,6 @@ <el-form-item label="鏍囧噯鍊�" prop="paramStandard"> <el-input v-model="form.paramStandard" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�" /> </el-form-item> - <el-form-item label="閲囬泦鏃堕棿" prop="collectionTime"> - <el-date-picker clearable - v-model="form.collectionTime" - type="date" - value-format="yyyy-MM-dd" - placeholder="璇烽�夋嫨閲囬泦鏃堕棿"> - </el-date-picker> - </el-form-item> -<!-- <el-form-item label="棰勭暀瀛楁1" prop="spareField1">--> -<!-- <el-input v-model="form.spareField1" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�" />--> -<!-- </el-form-item>--> -<!-- <el-form-item label="棰勭暀瀛楁2" prop="spareField2">--> -<!-- <el-input v-model="form.spareField2" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�" />--> -<!-- </el-form-item>--> -<!-- <el-form-item label="鍒涘缓鐢ㄦ埛" prop="createUser">--> -<!-- <el-input v-model="form.createUser" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�" />--> -<!-- </el-form-item>--> -<!-- <el-form-item label="鏇存敼鐢ㄦ埛" prop="updateUser">--> -<!-- <el-input v-model="form.updateUser" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�" />--> -<!-- </el-form-item>--> <el-form-item label="鐘舵��" prop="state"> <el-input v-model="form.state" placeholder="璇疯緭鍏ョ姸鎬�" /> </el-form-item> @@ -253,12 +188,6 @@ </el-form-item> <el-form-item label="绫诲瀷" prop="type"> <el-select v-model="form.type" placeholder="璇烽�夋嫨绫诲瀷"> -<!-- <el-option--> -<!-- v-for="dict in dict.type.${dictType}"--> -<!-- :key="dict.value"--> -<!-- :label="dict.label"--> -<!-- :value="dict.value"--> -<!-- ></el-option>--> </el-select> </el-form-item> </el-form> @@ -272,11 +201,13 @@ <script> import { listParamCollection, getParamCollection, delParamCollection, addParamCollection, updateParamCollection } from "@/api/main/da/paramCollection/paramCollection"; +import {queryDaParamCollectionListForSearch} from "../../../../api/main/da/paramCollection/paramCollection"; export default { name: "ParamCollection", data() { return { + maxDate: '', // 閬僵灞� loading: true, // 閫変腑鏁扮粍 @@ -297,6 +228,7 @@ open: false, // 鏌ヨ鍙傛暟 queryParams: { + dateConditions: [], pageNum: 1, pageSize: 10, workOrderNo: null, @@ -314,18 +246,18 @@ id: [ { required: true, message: "涓婚敭id涓嶈兘涓虹┖", trigger: "blur" } ], - workOrderNo: [ - { required: true, message: "宸ュ崟缂栧彿涓嶈兘涓虹┖", trigger: "blur" } - ], + // workOrderNo: [ + // { required: true, message: "宸ュ崟缂栧彿涓嶈兘涓虹┖", trigger: "blur" } + // ], sfcCode: [ { required: true, message: "鎬绘垚搴忓垪鍙蜂笉鑳戒负绌�", trigger: "blur" } ], productCode: [ { required: true, message: "浜у搧缂栧彿涓嶈兘涓虹┖", trigger: "blur" } ], - productionLine: [ - { required: true, message: "浜х嚎缂栧彿涓嶈兘涓虹┖", trigger: "blur" } - ], + // productionLine: [ + // { required: true, message: "浜х嚎缂栧彿涓嶈兘涓虹┖", trigger: "blur" } + // ], locationCode: [ { required: true, message: "宸ヤ綅缂栧彿涓嶈兘涓虹┖", trigger: "blur" } ], @@ -339,17 +271,42 @@ }; }, created() { - this.getList(); + // this.getList(); }, methods: { + handleDateChange(value) { + if (value && value.length === 2) { + const startDate = value[0]; + const endDate = value[1]; + const dayCount = this.daysBetween(startDate, endDate); + if (dayCount + 1 > 3) { + this.$message.error('璇烽�夋嫨杩炵画鐨�3澶╋紒'); + this.queryParams.dateConditions = []; // 閲嶇疆鏃ユ湡鑼冨洿 + } + } + }, + daysBetween(startDate, endDate) { + const oneDay = 24 * 60 * 60 * 1000; // 姣忓ぉ鐨勬绉掓暟 + const startTime = new Date(startDate).getTime(); + const endTime = new Date(endDate).getTime(); + return Math.round(Math.abs((startTime - endTime) / oneDay)); + }, /** 鏌ヨ璁惧浜у搧杩囩▼鍙傛暟閲囬泦鍒楄〃 */ getList() { this.loading = true; - listParamCollection(this.queryParams).then(response => { - this.paramCollectionList = response.rows; - this.total = response.total; - this.loading = false; - }); + if ((this.queryParams.sfcCode == null || this.queryParams.sfcCode === '') && this.queryParams.dateConditions.length === 0){ + this.$message({ + message: '璇疯緭鍏ュ彂鍔ㄦ満鍙风爜鎴栬�呴�夋嫨鏌ヨ鏃ユ湡', + type: 'info' + }); + } else { + queryDaParamCollectionListForSearch(this.queryParams).then(response => { + this.paramCollectionList = response.rows; + this.total = response.total; + this.loading = false; + }); + } + }, // 鍙栨秷鎸夐挳 cancel() { -- Gitblit v1.9.3