From 09f0861e61e69e2d818eafc7b9edbd17cf0822d4 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期四, 06 十一月 2025 17:20:02 +0800
Subject: [PATCH] 页面优化以及扣分详情导出
---
src/views/system/unit/index.vue | 80 ++++++++++++++++++++++++++-------------
1 files changed, 53 insertions(+), 27 deletions(-)
diff --git a/src/views/system/unit/index.vue b/src/views/system/unit/index.vue
index 83775f8..91fdfcc 100644
--- a/src/views/system/unit/index.vue
+++ b/src/views/system/unit/index.vue
@@ -6,6 +6,7 @@
v-model="queryParams.unitCode"
placeholder="璇疯緭鍏ュ崟浣嶇紪鐮�"
clearable
+ @clear="handleQuery"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
@@ -14,6 +15,7 @@
v-model="queryParams.unitName"
placeholder="璇疯緭鍏ュ崟浣嶅悕绉�"
clearable
+ @clear="handleQuery"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
@@ -21,7 +23,7 @@
<el-date-picker
v-model="daterangeCreateTime"
style="width: 240px"
- value-format="yyyy-MM-dd"
+ value-format="yyyy-MM-dd HH:mm:ss"
type="daterange"
range-separator="-"
start-placeholder="寮�濮嬫棩鏈�"
@@ -29,8 +31,8 @@
></el-date-picker>
</el-form-item>
<el-form-item>
- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button>
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button>
+ <el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">鎼滅储</el-button>
+ <el-button icon="el-icon-refresh" size="small" @click="resetQuery">閲嶇疆</el-button>
</el-form-item>
</el-form>
@@ -42,7 +44,7 @@
icon="el-icon-plus"
size="mini"
@click="handleAdd"
- v-hasPermi="['system:unit:add']"
+ v-hasPermi="['unit:add']"
>鏂板</el-button>
</el-col>
<el-col :span="1.5">
@@ -53,7 +55,7 @@
size="mini"
:disabled="single"
@click="handleUpdate"
- v-hasPermi="['system:unit:edit']"
+ v-hasPermi="['unit:edit']"
>淇敼</el-button>
</el-col>
<el-col :span="1.5">
@@ -64,7 +66,7 @@
size="mini"
:disabled="multiple"
@click="handleDelete"
- v-hasPermi="['system:unit:remove']"
+ v-hasPermi="['unit:remove']"
>鍒犻櫎</el-button>
</el-col>
<el-col :span="1.5">
@@ -74,7 +76,7 @@
icon="el-icon-download"
size="mini"
@click="handleExport"
- v-hasPermi="['system:unit:export']"
+ v-hasPermi="['unit:export']"
>瀵煎嚭</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@@ -82,28 +84,28 @@
<el-table v-loading="loading" :data="unitList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
- <el-table-column label="涓婚敭" align="center" prop="id" />
<el-table-column label="鍗曚綅缂栫爜" align="center" prop="unitCode" />
<el-table-column label="鍗曚綅鍚嶇О" align="center" prop="unitName" />
<el-table-column label="鍗曚綅鑱旂郴浜�" align="center" prop="unitContact" />
<el-table-column label="鍗曚綅鑱旂郴浜虹數璇�" align="center" prop="unitContactPhone" />
<el-table-column label="鍗曚綅绠$悊鍛樿处鍙�" align="center" prop="unitAdminAccount" />
- <el-table-column label="澶囨敞" align="center" prop="remark" />
- <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width">
+ <el-table-column label="澶囨敞" align="center" prop="remark" show-overflow-tooltip/>
+ <el-table-column label="娣诲姞鏃堕棿" align="center" prop="createTime" />
+ <el-table-column label="鎿嶄綔" align="center" fixed="right" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
- v-hasPermi="['system:unit:edit']"
+ v-hasPermi="['unit:edit']"
>淇敼</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
- v-hasPermi="['system:unit:remove']"
+ v-hasPermi="['unit:remove']"
>鍒犻櫎</el-button>
</template>
</el-table-column>
@@ -119,29 +121,32 @@
<!-- 娣诲姞鎴栦慨鏀硅繍缁村崟浣嶅璇濇 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
- <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+ <el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="鍗曚綅缂栫爜" prop="unitCode">
<el-input v-model="form.unitCode" placeholder="璇疯緭鍏ュ崟浣嶇紪鐮�" />
</el-form-item>
<el-form-item label="鍗曚綅鍚嶇О" prop="unitName">
<el-input v-model="form.unitName" placeholder="璇疯緭鍏ュ崟浣嶅悕绉�" />
</el-form-item>
+ <el-form-item label="鍗曚綅璐﹀彿" prop="unitAdminAccount">
+ <el-input v-model="form.unitAdminAccount" placeholder="璇疯緭鍏ュ崟浣嶈处鍙�" :disabled="account" />
+ </el-form-item>
+ <el-form-item label="璐﹀彿瀵嗙爜" prop="password">
+ <el-input v-model="form.password" placeholder="璇疯緭鍏ュ崟浣嶈处鍙峰瘑鐮�" :disabled="account" />
+ </el-form-item>
<el-form-item label="鍗曚綅鑱旂郴浜�" prop="unitContact">
<el-input v-model="form.unitContact" placeholder="璇疯緭鍏ュ崟浣嶈仈绯讳汉" />
</el-form-item>
- <el-form-item label="鍗曚綅鑱旂郴浜虹數璇�" prop="unitContactPhone">
+ <el-form-item label="鑱旂郴浜虹數璇�" prop="unitContactPhone">
<el-input v-model="form.unitContactPhone" placeholder="璇疯緭鍏ュ崟浣嶈仈绯讳汉鐢佃瘽" />
</el-form-item>
- <el-form-item label="鍗曚綅绠$悊鍛樿处鍙�" prop="unitAdminAccount">
- <el-input v-model="form.unitAdminAccount" placeholder="璇疯緭鍏ュ崟浣嶇鐞嗗憳璐﹀彿" />
- </el-form-item>
<el-form-item label="澶囨敞" prop="remark">
- <el-input v-model="form.remark" placeholder="璇疯緭鍏ュ娉�" />
+ <el-input v-model="form.remark" maxlength="100" show-word-limit rows="3" type="textarea" placeholder="澶囨敞淇℃伅" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
<el-button @click="cancel">鍙� 娑�</el-button>
+ <el-button type="primary" @click="submitForm">纭� 瀹�</el-button>
</div>
</el-dialog>
</div>
@@ -154,6 +159,8 @@
name: "Unit",
data() {
return {
+ // 璐﹀彿涓嶅彲淇敼
+ account: true,
// 閬僵灞�
loading: true,
// 閫変腑鏁扮粍
@@ -180,7 +187,8 @@
pageSize: 10,
unitCode: null,
unitName: null,
- createTime: null,
+ start: null,
+ end: null,
},
// 琛ㄥ崟鍙傛暟
form: {},
@@ -199,11 +207,24 @@
{ required: true, message: "鍗曚綅鑱旂郴浜虹數璇濅笉鑳戒负绌�", trigger: "blur" }
],
unitAdminAccount: [
- { required: true, message: "鍗曚綅绠$悊鍛樿处鍙蜂笉鑳戒负绌�", trigger: "blur" }
+ { required: true, message: "鍗曚綅璐﹀彿涓嶈兘涓虹┖", trigger: "blur" }
],
}
};
},
+ // computed: {
+ // unitAdminAccount:{
+ // get: function() {
+ // let value = this.form.unitCode ? this.form.unitCode + '_admin' : ""
+ // this.form.unitAdminAccount = value
+ // return value
+ // },
+ // set:function (newValue) {
+ // this.unitAdminAccount = newValue;
+ // this.form.unitAdminAccount = newValue
+ // }
+ // }
+ // },
created() {
this.getList();
},
@@ -211,13 +232,13 @@
/** 鏌ヨ杩愮淮鍗曚綅鍒楄〃 */
getList() {
this.loading = true;
- this.queryParams.params = {};
+ // this.queryParams = {};
if (null != this.daterangeCreateTime && '' != this.daterangeCreateTime) {
- this.queryParams.params["beginCreateTime"] = this.daterangeCreateTime[0];
- this.queryParams.params["endCreateTime"] = this.daterangeCreateTime[1];
+ this.queryParams.start = this.daterangeCreateTime[0];
+ this.queryParams.end = this.daterangeCreateTime[1];
}
listUnit(this.queryParams).then(response => {
- this.unitList = response.rows;
+ this.unitList = response.data;
this.total = response.total;
this.loading = false;
});
@@ -239,7 +260,8 @@
remark: null,
createTime: null,
updateTime: null,
- deleted: null
+ deleted: null,
+ password: null,
};
this.resetForm("form");
},
@@ -251,6 +273,8 @@
/** 閲嶇疆鎸夐挳鎿嶄綔 */
resetQuery() {
this.daterangeCreateTime = [];
+ this.queryParams.start = null;
+ this.queryParams.end = null;
this.resetForm("queryForm");
this.handleQuery();
},
@@ -262,12 +286,14 @@
},
/** 鏂板鎸夐挳鎿嶄綔 */
handleAdd() {
+ this.account = false;
this.reset();
this.open = true;
this.title = "娣诲姞杩愮淮鍗曚綅";
},
/** 淇敼鎸夐挳鎿嶄綔 */
handleUpdate(row) {
+ this.account = true;
this.reset();
const id = row.id || this.ids
getUnit(id).then(response => {
@@ -308,7 +334,7 @@
},
/** 瀵煎嚭鎸夐挳鎿嶄綔 */
handleExport() {
- this.download('system/unit/export', {
+ this.download('yw-unit/export', {
...this.queryParams
}, `unit_${new Date().getTime()}.xlsx`)
}
--
Gitblit v1.8.0