From 55dee1e07a1569f57b38655e175dbda49a0699a8 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期一, 12 八月 2024 11:42:12 +0800
Subject: [PATCH] 样式调整
---
src/views/system/point/index.vue | 116 +++++++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 86 insertions(+), 30 deletions(-)
diff --git a/src/views/system/point/index.vue b/src/views/system/point/index.vue
index cfceccf..e39645e 100644
--- a/src/views/system/point/index.vue
+++ b/src/views/system/point/index.vue
@@ -34,12 +34,35 @@
</el-col>
<el-col :span="1.5">
<el-popover>
- <div>
- <el-select v-model="importUnitId" size="small" placeholder="璐熻矗鍗曚綅">
+ <p>瀵煎叆鐐逛綅鍙仛鏇存柊鎿嶄綔</p>
+ <div class="bottom_">
+ <el-select @change="getUnitContractTime" v-model="importUnitId" size="small" placeholder="杩愮淮鍗曚綅">
<el-option v-for="unit in unitList" :key="unit.id" :label="unit.value" :value="unit.id"></el-option>
</el-select>
</div>
- <div>
+ <div class="bottom_">
+ <el-select @change="showTimeRange" v-model="contractId" size="small" placeholder="杩愮淮鍚堝悓" :disabled="! importUnitId">
+ <el-option v-for="(time, index) in timeList" :key="index" :label="time.name" :value="time.id"></el-option>
+ </el-select>
+ <span style="margin-left: 10px;color: #8a8989" v-show="importUnitId">璇ュ崟浣嶆湁{{timeList.length}}涓悎鍚�</span>
+ </div>
+ <div class="bottom_">
+ <el-date-picker
+ :disabled="! contractId"
+ size="small"
+ v-model="ywTimes"
+ type="daterange"
+ range-separator="鑷�"
+ start-placeholder="杩愮淮寮�濮嬫椂闂�"
+ end-placeholder="杩愮淮缁撴潫鏃堕棿">
+ </el-date-picker>
+ </div>
+ <div class="bottom_">
+ <el-checkbox v-model="provinceTag">閲嶇偣鐐逛綅</el-checkbox>
+ <el-checkbox v-model="importantTag">鐪佸巺</el-checkbox>
+ <el-checkbox v-model="importantCommandImageTag">閲嶇偣鎸囨尌鍥惧儚</el-checkbox>
+ </div>
+ <div class="bottom_">
<el-upload
ref="upload"
class="upload-demo"
@@ -54,16 +77,16 @@
</el-upload>
</div>
<div>
- <el-button type="primary" size="small" v-model="upload" :disabled="! importUnitId || ! importFile" @click="handleImport" style="width: 100%; margin-top: 5px"
+ <el-button class="bottom_" type="primary" size="small" v-model="upload" :disabled="! importUnitId || ! importFile || ! this.ywTimes || this.ywTimes.length < 2" @click="handleImport"
v-hasPermi="['point:import']">瀵煎叆</el-button>
</div>
<el-button type="primary" size="mini" plain icon="el-icon-top" slot="reference">瀵煎叆鐐逛綅</el-button>
</el-popover>
</el-col>
- <el-col :span="1.5">
- <el-button type="danger" plain icon="el-icon-receiving" size="mini" @click="handleEditBatch"
- v-hasPermi="['point:edit']">鎵归噺淇敼</el-button>
- </el-col>
+<!-- <el-col :span="1.5">-->
+<!-- <el-button type="danger" plain icon="el-icon-receiving" size="mini" @click="handleEditBatch"-->
+<!-- v-hasPermi="['point:edit']">鎵归噺淇敼</el-button>-->
+<!-- </el-col>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@@ -82,15 +105,9 @@
<div v-else-if="scope.row.provinceTag === 'normal'">鏅�氱偣浣�</div>
</template>
</el-table-column>
- <el-table-column label="鐐逛綅寮�濮嬫椂闂�" align="center" prop="startTime" width="180">
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
- </template>
+ <el-table-column label="鐐逛綅寮�濮嬫椂闂�" align="center" prop="startTime" width="140">
</el-table-column>
- <el-table-column label="鐐逛綅缁撴潫鏃堕棿" align="center" prop="endTime" width="180">
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
- </template>
+ <el-table-column label="鐐逛綅缁撴潫鏃堕棿" align="center" prop="endTime" width="140">
</el-table-column>
<el-table-column label="杩愮淮鍗曚綅" align="center" prop="unitName" />
<el-table-column label="鐩戠閮ㄩ棬" align="center" prop="deptName" />
@@ -134,15 +151,25 @@
:props="{ checkStrictly: true }">
</el-cascader>
</el-form-item>
+ <el-form-item label="鐐逛綅鏍囩" prop="pointTag">
+ <el-select v-model="form.pointTag" placeholder="鐐逛綅鏍囩" multiple clearable>
+ <el-option v-for="dict in dict.type.point_tag" :key="dict.value" :label="dict.label" :value="dict.value" />
+ </el-select>
+ </el-form-item>
<el-form-item label="杩愮淮鍗曚綅" prop="unitId">
<el-select v-model="form.unitId" placeholder="杩愮淮鍗曚綅">
<el-option v-for="item in unitList" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</el-form-item>
- <el-form-item label="鐐逛綅鏃跺尯" prop="timezone">
- <el-date-picker @change="dateChange" v-model="form.timezone" type="daterange" align="right" unlink-panels
- range-separator="鑷�" start-placeholder="寮�濮嬫棩鏈�" end-placeholder="缁撴潫鏃ユ湡">
+ <el-form-item label="杩愮淮鏃堕棿" prop="timezone">
+ <el-date-picker
+ size="small"
+ v-model="timezone"
+ type="daterange"
+ range-separator="鑷�"
+ start-placeholder="杩愮淮寮�濮嬫椂闂�"
+ end-placeholder="杩愮淮缁撴潫鏃堕棿">
</el-date-picker>
</el-form-item>
<el-form-item label="鐐逛綅澶囨敞" prop="remark">
@@ -169,7 +196,7 @@
</el-select>
</el-form-item>
<el-form-item label="杩愮淮鏃堕棿娈�" prop="timezone">
- <el-date-picker @change="dateChange" v-model="batchEditForm.timezone" type="daterange" align="right"
+ <el-date-picker v-model="batchEditForm.timezone" type="daterange" align="right"
unlink-panels range-separator="鑷�" start-placeholder="寮�濮嬫棩鏈�" end-placeholder="缁撴潫鏃ユ湡">
</el-date-picker>
</el-form-item>
@@ -184,7 +211,7 @@
</template>
<script>
-import { listPoint, getPoint, delPoint, addPoint, batchEdit, updatePoint, exportData, importData } from "@/api/platform/point";
+import { listPoint, getPoint, delPoint, addPoint, batchEdit, updatePoint, exportData, importData, timeRange } from "@/api/platform/point";
import { unitSelect } from "@/api/platform/unit";
import { getCascader } from '@/api/platform/region'
import { cascader } from '@/api/system/dept'
@@ -194,10 +221,17 @@
dicts: ['point_tag'],
data() {
return {
+ importantTag: false,
+ provinceTag: false,
+ importantCommandImageTag: false,
+ timeList: [],
+ timezone: [],
+ ywTimes: [],
fileList: [],
importFile: null,
importUrl: '',
importUnitId: null,
+ contractId: null,
download: false,
upload: false,
deptOptions: [],
@@ -249,9 +283,6 @@
pointName: [
{ required: true, message: "鐐逛綅鍚嶇О涓嶈兘涓虹┖", trigger: "blur" }
],
- pointTag: [
- { required: true, message: "鐐逛綅鏍囩涓嶈兘涓虹┖", trigger: "change" }
- ],
deptId: [
{ required: true, message: "鐩戠閮ㄩ棬涓嶈兘涓虹┖", trigger: "change" }
],
@@ -274,6 +305,22 @@
this.getDeptCascader();
},
methods: {
+ getUnitContractTime(unitId) {
+ this.ywTimes = []
+ this.contractId = null;
+ timeRange(unitId).then(res => {
+ this.timeList = res.data;
+ })
+ },
+ showTimeRange(contractId) {
+ let a = this.timeList.filter(item => item.id === contractId)
+ if (a.length < 1) {
+ this.ywTimes = []
+ return
+ }
+ let target = a[0]
+ this.ywTimes = [target.startTime, target.endTime]
+ },
beforeUpload(file) {
this.importFile = file
this.fileList = [file]
@@ -281,12 +328,22 @@
},
// 鐐逛綅瀵煎叆
handleImport() {
+ if (! this.ywTimes || this.ywTimes.length < 2) {
+ this.$message.error("璇烽�夋嫨杩愮淮鏃堕棿")
+ return
+ }
this.upload =true;
let formData = new FormData()
formData.append("file", this.importFile)
+ formData.append("startTime", this.ywTimes[0])
+ formData.append("endTime", this.ywTimes[1])
+ formData.append("provinceTag", this.provinceTag)
+ formData.append("importantTag", this.importantTag)
+ formData.append("importantCommandImageTag", this.importantCommandImageTag)
importData(formData, this.importUnitId).then(res => {
this.$message.success("瀵煎叆鎴愬姛")
this.upload = false
+ this.getList()
})
},
// 鐐逛綅瀵煎嚭
@@ -339,12 +396,6 @@
cascader().then(res => {
this.deptOptions = res.data;
})
- },
-
- // 鏃堕棿閫夋嫨鍙戠敓鍙樺寲
- dateChange() {
- this.tempForm.startTime = this.tempForm.timezone[0];
- this.tempForm.endTime = this.tempForm.timezone[1];
},
getUnitSelect() {
// 杩愮淮鍗曚綅涓嬫媺鍒楄〃
@@ -413,6 +464,7 @@
this.form = response.data;
this.form.deptId = response.data.deptIds
this.form.category = this.form.category + ''
+ this.timezone = [response.data.startTime, response.data.endTime]
this.open = true;
console.log(this.form)
this.title = "淇敼杩愮淮鐐逛綅";
@@ -464,6 +516,10 @@
</script>
<style scoped>
+.bottom_ {
+ width: 100%;
+ margin-bottom: 5px;
+}
.col-item {
margin: 5px 0;
display: flex;
--
Gitblit v1.8.0