From 0e7404ca84d275ef39498b7a45063cd20b5e9633 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期二, 12 三月 2024 18:28:41 +0800
Subject: [PATCH] 点位类型、点位监管部门
---
src/views/system/point/index.vue | 72 ++++++++++++++++++++++++++++++-----
1 files changed, 61 insertions(+), 11 deletions(-)
diff --git a/src/views/system/point/index.vue b/src/views/system/point/index.vue
index 8f50e49..100f98b 100644
--- a/src/views/system/point/index.vue
+++ b/src/views/system/point/index.vue
@@ -1,6 +1,6 @@
<template>
<div class="app-container">
- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+ <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="鐐逛綅鍚嶇О" prop="pointName">
<el-input
v-model="queryParams.pointName"
@@ -39,7 +39,6 @@
icon="el-icon-plus"
size="mini"
@click="handleAdd"
- v-hasPermi="['x:point:add']"
>鏂板</el-button>
</el-col>
<el-col :span="1.5">
@@ -50,7 +49,6 @@
size="mini"
:disabled="single"
@click="handleUpdate"
- v-hasPermi="['x:point:edit']"
>淇敼</el-button>
</el-col>
<el-col :span="1.5">
@@ -61,7 +59,6 @@
size="mini"
:disabled="multiple"
@click="handleDelete"
- v-hasPermi="['x:point:remove']"
>鍒犻櫎</el-button>
</el-col>
<el-col :span="1.5">
@@ -90,7 +87,15 @@
<span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
- <el-table-column label="杩愮淮鍗曚綅" align="center" prop="unitId" />
+ <el-table-column label="杩愮淮鍗曚綅" align="center" prop="unitName" />
+ <el-table-column label="鐩戠閮ㄩ棬" align="center" prop="deptName" />
+ <el-table-column label="杩愮淮绫诲埆" align="center" prop="category">
+ <template slot-scope="scope">
+ <div v-if="scope.row.category === 1">瑙嗛鐩戞帶</div>
+ <div v-else-if="scope.row.category === 2">杞﹁締璇嗗埆</div>
+ <div v-else-if="scope.row.category === 3">浜鸿劯璇嗗埆</div>
+ </template>
+ </el-table-column>
<el-table-column label="杩愮淮鐘舵��" align="center" prop="status" />
<el-table-column label="澶囨敞" align="center" prop="remark" />
<el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">
@@ -100,14 +105,12 @@
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
- v-hasPermi="['x:point:edit']"
>淇敼</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
- v-hasPermi="['x:point:remove']"
>鍒犻櫎</el-button>
</template>
</el-table-column>
@@ -121,7 +124,7 @@
@pagination="getList"
/>
- <!-- 娣诲姞鎴栦慨鏀硅繍缁寸偣浣嶅璇濇 -->
+ <!-- 娣诲姞杩愮淮鐐逛綅瀵硅瘽妗� -->
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
<el-form ref="form" :model="tempForm" :rules="rules" label-width="120px">
<el-form-item label="鐐逛綅鍚嶇О" prop="pointName">
@@ -155,7 +158,7 @@
<el-button @click="nextAdd" type="primary" plain>缁х画娣诲姞</el-button>
</div>
</el-form-item>
- <div class="point-row" v-for="(point,index) in tempFormList">
+ <div class="point-row" v-for="(point,index) in tempFormList">
<div class="row-item">
<el-input :disabled="editingIndex!==index" v-model="point.pointName" placeholder="鐐逛綅鍚嶇О"></el-input>
</div>
@@ -193,6 +196,42 @@
<el-button @click="cancel">鍙� 娑�</el-button>
</div>
</el-dialog>
+
+ <!-- 淇敼杩愮淮鐐逛綅瀵硅瘽妗� -->
+ <el-dialog :title="title" :visible.sync="editOpen" width="500px" append-to-body>
+ <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+ <el-form-item label="鐐逛綅鍚嶇О" prop="pointName">
+ <el-input v-model="form.pointName" placeholder="璇疯緭鍏ョ偣浣嶅悕绉�" />
+ </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-date-picker>
+ </el-form-item>
+ </el-form>
+ <div slot="footer" class="dialog-footer">
+ <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
+ <el-button @click="updateCancel">鍙� 娑�</el-button>
+ </div>
+ </el-dialog>
</div>
</template>
@@ -224,6 +263,8 @@
title: "",
// 鏄惁鏄剧ず寮瑰嚭灞�
open: false,
+ // 淇敼寮圭獥
+ editOpen: false,
// 杩愮淮鍗曚綅
unitList: [],
// 杩愮淮鏃跺尯
@@ -313,6 +354,10 @@
this.open = false;
this.reset();
},
+ updateCancel() {
+ this.editOpen = false;
+ this.reset();
+ },
// 琛ㄥ崟閲嶇疆
reset() {
this.form = {
@@ -357,7 +402,8 @@
const id = row.id || this.ids
getPoint(id).then(response => {
this.form = response.data;
- this.open = true;
+ this.form.timezone = [this.form.startTime, this.form.endTime]
+ this.editOpen = true;
this.title = "淇敼杩愮淮鐐逛綅";
});
},
@@ -369,6 +415,10 @@
addPointBatch(this.formList).then(response => {
this.$modal.msgSuccess("鏂板鎴愬姛");
this.open = false;
+ // 閲嶇疆
+ this.tempForm = {};
+ this.tempFormList = [];
+ this.formList = [];
this.getList();
});
}
@@ -376,7 +426,7 @@
if (this.form.id != null) {
updatePoint(this.form).then(response => {
this.$modal.msgSuccess("淇敼鎴愬姛");
- this.open = false;
+ this.editOpen = false;
this.getList();
});
} else {
--
Gitblit v1.8.0