From bfb10b42c5fb6bc9f751f88f9351bfc19c6380a4 Mon Sep 17 00:00:00 2001 From: 黄何裕 <1053952480@qq.com> Date: 星期二, 16 七月 2024 14:57:50 +0800 Subject: [PATCH] 样式调整 --- src/views/system/contract/contract-result/index.vue | 353 +++++++++++++++++++++++++++++++++++++--------------------- 1 files changed, 222 insertions(+), 131 deletions(-) diff --git a/src/views/system/contract/contract-result/index.vue b/src/views/system/contract/contract-result/index.vue index 77e0c5e..20c0f51 100644 --- a/src/views/system/contract/contract-result/index.vue +++ b/src/views/system/contract/contract-result/index.vue @@ -1,14 +1,36 @@ <template> <div class="app-container"> - <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px"> + <el-form + :model="queryParams" + ref="queryForm" + size="small" + :inline="true" + v-show="showSearch" + label-width="100px" + > <el-form-item label="鑰冩牳瀵硅薄" prop="unitId"> - <el-select v-model="queryParams.unitId" @change="handleQuery" clearable placeholder="鑰冩牳瀵硅薄"> - <el-option v-for="item in unitList" :key="item.id" :label="item.value" :value="item.id"> + <el-select + v-model="queryParams.unitId" + @change="handleQuery" + clearable + 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="unitId"> - <el-select v-model="queryParams.publish" @change="handleQuery" clearable placeholder="鍙戝竷鐘舵��"> + <el-select + v-model="queryParams.publish" + @change="handleQuery" + clearable + placeholder="鍙戝竷鐘舵��" + > <el-option label="鏈彂甯�" :value="0" /> <el-option label="宸插彂甯�" :value="1" /> </el-select> @@ -25,22 +47,30 @@ ></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="mini" + @click="handleQuery" + >鎼滅储</el-button + > + <el-button icon="el-icon-refresh" size="mini" @click="resetQuery" + >閲嶇疆</el-button + > </el-form-item> </el-form> <el-row :gutter="10" class="mb8"> -<!-- <el-col :span="1.5">--> -<!-- <el-button--> -<!-- type="primary"--> -<!-- plain--> -<!-- icon="el-icon-plus"--> -<!-- size="mini"--> -<!-- @click="handleAdd"--> -<!-- v-hasPermi="['system:checkResult:add']"--> -<!-- >鏂板</el-button>--> -<!-- </el-col>--> + <!-- <el-col :span="1.5">--> + <!-- <el-button--> + <!-- type="primary"--> + <!-- plain--> + <!-- icon="el-icon-plus"--> + <!-- size="mini"--> + <!-- @click="handleAdd"--> + <!-- v-hasPermi="['system:checkResult:add']"--> + <!-- >鏂板</el-button>--> + <!-- </el-col>--> <el-col :span="1.5"> <el-button type="danger" @@ -50,7 +80,8 @@ :disabled="multiple" v-hasPermi="['system:result:remove']" @click="handleDelete" - >鍒犻櫎</el-button> + >鍒犻櫎</el-button + > </el-col> <el-col :span="1.5"> <el-button @@ -60,95 +91,139 @@ size="mini" v-hasPermi="['system:result:export']" @click="handleExport" - >瀵煎嚭</el-button> + >瀵煎嚭</el-button + > </el-col> - <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> + <right-toolbar + :showSearch.sync="showSearch" + @queryTable="getList" + ></right-toolbar> </el-row> <el-row v-loading="loading"> - <el-col :span="8" v-for="(item, index) in checkResultList" :key="index"> + <el-col + :xl="8" + :lg="8" + :md="12" + :sm="12" + :xs="12" + v-for="(item, index) in checkResultList" + :key="index" + > <el-card class="box-card"> <div slot="header" class="clearfix"> <span>{{ item.contractName }}</span> - <el-button style="float: right; padding: 3px 6px" type="text" @click="handleDetail(item)">璇︽儏</el-button> + <el-button + style="float: right; padding: 3px 6px" + type="text" + @click="handleDetail(item)" + >璇︽儏</el-button + > </div> - <div class="text item">鑰冩牳瀵硅薄<span class="time">{{ item.unitName }}</span></div> - <div class="text item">鑰冩牳鍒嗘暟<span class="time">{{ item.score }}</span></div> - <div class="text item">鑰冩牳鏃堕棿 + <div class="text item"> + 鑰冩牳瀵硅薄<span class="time">{{ item.unitName }}</span> + </div> + <div class="text item"> + 鑰冩牳鍒嗘暟<span class="time">{{ item.score }}</span> + </div> + <div class="text item"> + 鑰冩牳鏃堕棿 <span class="time">{{ item.checkTime }}</span> - <el-button size="small" round style="float: right;" @click="handlePublish(item)" v-show="item.publish != 1" v-hasPermi="['result:contract:publish']">纭鍙戝竷</el-button> - <el-button size="small" round style="float: right;" disabled v-show="item.publish == 1" v-hasPermi="['result:contract:publish']">宸插彂甯�</el-button> + <el-button + size="small" + round + style="float: right" + @click="handlePublish(item)" + v-show="item.publish != 1" + v-hasPermi="['result:contract:publish']" + >纭鍙戝竷</el-button + > + <el-button + size="small" + round + style="float: right" + disabled + v-show="item.publish == 1" + v-hasPermi="['result:contract:publish']" + >宸插彂甯�</el-button + > </div> </el-card> </el-col> </el-row> - <pagination - v-show="total>0" + v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" /> - <el-dialog :title="manualScoreTitle" :visible.sync="manualScoreOpen" width="500px" append-to-body> - <el-input v-model="manualScoreForm.manualScore" type="number" placeholder="璇蜂负璇ュ崟浣嶆墦鍒�"/> + <el-dialog + :title="manualScoreTitle" + :visible.sync="manualScoreOpen" + width="500px" + append-to-body + > + <el-input + v-model="manualScoreForm.manualScore" + type="number" + placeholder="璇蜂负璇ュ崟浣嶆墦鍒�" + /> <div slot="footer" class="dialog-footer"> <el-button type="primary" @click="submitManualScore">纭� 瀹�</el-button> <el-button @click="cancelManualScore">鍙� 娑�</el-button> </div> </el-dialog> - <el-dialog :title="detailTitle" :visible.sync="detailOpen" width="700px" append-to-body> + <el-dialog + :title="detailTitle" + :visible.sync="detailOpen" + width="700px" + append-to-body + > <el-descriptions class="margin-top" :column="3" border> <el-descriptions-item> <template slot="label"> <i class="el-icon-user"></i> 鑰冩牳瀵硅薄 </template> - {{detail.unitName}} + {{ detail.unitName }} </el-descriptions-item> <el-descriptions-item> <template slot="label"> <i class="el-icon-s-management"></i> 鍚堝悓鍚嶇О </template> - {{detail.contractName}} + {{ detail.contractName }} </el-descriptions-item> <el-descriptions-item> <template slot="label"> <i class="el-icon-medal"></i> 缁煎悎鍒嗘暟 </template> - <el-tag type="danger" size="small">{{detail.score}}</el-tag> + <el-tag type="danger" size="small">{{ detail.score }}</el-tag> </el-descriptions-item> </el-descriptions> - <el-table - :data="tableData" - show-summary - style="width: 100%"> - <el-table-column - prop="ruleName" - label="瑙勫垯鍚�" - :show-overflow-tooltip="true" - width="300"> - </el-table-column> - <el-table-column - label="鎵e噺鏂瑰紡" - align="center" - prop="deductCategory" - width="180px"> - </el-table-column> - <el-table-column - prop="num" - label="鎸囨爣"> - </el-table-column> - <el-table-column - prop="score" - label="鎵e垎"> - </el-table-column> - </el-table> + <el-table :data="tableData" show-summary style="width: 100%"> + <el-table-column + prop="ruleName" + label="瑙勫垯鍚�" + :show-overflow-tooltip="true" + width="300" + > + </el-table-column> + <el-table-column + label="鎵e噺鏂瑰紡" + align="center" + prop="deductCategory" + width="180px" + > + </el-table-column> + <el-table-column prop="num" label="鎸囨爣"> </el-table-column> + <el-table-column prop="score" label="鎵e垎"> </el-table-column> + </el-table> </el-dialog> <!-- 娣诲姞鎴栦慨鏀硅�冩牳缁撴灉瀵硅瘽妗� --> @@ -164,22 +239,29 @@ </template> <script> -import { resultRecord, listCheckResult, getCheckResult, delCheckResult, addCheckResult, updateCheckResult,manualScore, publishCheckResult } from "@/api/platform/contract-result"; +import { + resultRecord, + listCheckResult, + getCheckResult, + delCheckResult, + addCheckResult, + updateCheckResult, + manualScore, + publishCheckResult, +} from "@/api/platform/contract-result"; import { unitSelect } from "@/api/platform/unit"; export default { name: "CheckResult", data() { return { - detailTitle: '', + detailTitle: "", detailOpen: false, - detail:{ - - }, + detail: {}, tableData: [], manualScoreOpen: false, manualScoreForm: {}, - manualScoreTitle: '', + manualScoreTitle: "", // 閬僵灞� loading: true, // 閫変腑鏁扮粍 @@ -210,9 +292,8 @@ // 琛ㄥ崟鍙傛暟 form: {}, // 琛ㄥ崟鏍¢獙 - rules: { - }, - unitList: [] + rules: {}, + unitList: [], }; }, created() { @@ -224,17 +305,17 @@ // 杩愮淮鍗曚綅涓嬫媺鍒楄〃 unitSelect().then((res) => { this.unitList = res.data; - }) + }); }, /** 鏌ヨ鑰冩牳缁撴灉鍒楄〃 */ getList() { this.loading = true; - if (null != this.daterangeCheckTime && '' != this.daterangeCheckTime) { + if (null != this.daterangeCheckTime && "" != this.daterangeCheckTime) { this.queryParams["createStartTime"] = this.daterangeCheckTime[0]; this.queryParams["createEndTime"] = this.daterangeCheckTime[1]; } - console.log("this.queryParams", this.queryParams) - listCheckResult(this.queryParams).then(response => { + console.log("this.queryParams", this.queryParams); + listCheckResult(this.queryParams).then((response) => { this.checkResultList = response.rows; this.total = response.total; this.loading = false; @@ -257,7 +338,7 @@ checkTime: null, createTime: null, updateTime: null, - deleted: null + deleted: null, }; this.resetForm("form"); }, @@ -267,40 +348,43 @@ this.manualScoreOpen = false; }, submitManualScore() { - if (! this.manualScoreForm.manualScore) { + if (!this.manualScoreForm.manualScore) { this.$modal.msgWarning("璇峰~鍐欏垎鏁�"); - return + return; } - manualScore(this.manualScoreForm).then(res => { + manualScore(this.manualScoreForm).then((res) => { this.$modal.msgSuccess("鎿嶄綔鎴愬姛"); this.cancelManualScore(); this.getList(); - }) + }); }, handleSetManualScore(row) { this.manualScoreForm.id = row.id; this.manualScoreForm.manualScore = parseInt(row.manualScore); - this.manualScoreTitle = row.checkUnitName + '浜哄伐鎵撳垎' + this.manualScoreTitle = row.checkUnitName + "浜哄伐鎵撳垎"; this.manualScoreOpen = true; }, handleDetail(row) { - resultRecord(row.id).then(res => { + resultRecord(row.id).then((res) => { this.tableData = res.rows; - }) + }); this.detail = row; - this.detailTitle = '鑰冩牳缁撴灉璇︽儏'; + this.detailTitle = "鑰冩牳缁撴灉璇︽儏"; this.detailOpen = true; }, handlePublish(row) { - let text = row.publish == 1 ? '鍙栨秷鍙戝竷' : '鍙戝竷'; + let text = row.publish == 1 ? "鍙栨秷鍙戝竷" : "鍙戝竷"; const ids = row.id || this.ids; - this.$modal.confirm('鏄惁纭' + text + '鑰冩牳缁撴灉缂栧彿涓�"' + ids + '"鐨勬暟鎹」锛�').then(function() { - return publishCheckResult(ids); - }).then(() => { - this.getList(); - this.$modal.msgSuccess(text + "鎴愬姛"); - }).catch(() => {}); - + this.$modal + .confirm("鏄惁纭" + text + '鑰冩牳缁撴灉缂栧彿涓�"' + ids + '"鐨勬暟鎹」锛�') + .then(function () { + return publishCheckResult(ids); + }) + .then(() => { + this.getList(); + this.$modal.msgSuccess(text + "鎴愬姛"); + }) + .catch(() => {}); }, /** 鎼滅储鎸夐挳鎿嶄綔 */ handleQuery() { @@ -315,9 +399,9 @@ }, // 澶氶�夋閫変腑鏁版嵁 handleSelectionChange(selection) { - this.ids = selection.map(item => item.id) - this.single = selection.length!==1 - this.multiple = !selection.length + this.ids = selection.map((item) => item.id); + this.single = selection.length !== 1; + this.multiple = !selection.length; }, /** 鏂板鎸夐挳鎿嶄綔 */ handleAdd() { @@ -328,8 +412,8 @@ /** 淇敼鎸夐挳鎿嶄綔 */ handleUpdate(row) { this.reset(); - const id = row.id || this.ids - getCheckResult(id).then(response => { + const id = row.id || this.ids; + getCheckResult(id).then((response) => { this.form = response.data; this.open = true; this.title = "淇敼鑰冩牳缁撴灉"; @@ -337,16 +421,16 @@ }, /** 鎻愪氦鎸夐挳 */ submitForm() { - this.$refs["form"].validate(valid => { + this.$refs["form"].validate((valid) => { if (valid) { if (this.form.id != null) { - updateCheckResult(this.form).then(response => { + updateCheckResult(this.form).then((response) => { this.$modal.msgSuccess("淇敼鎴愬姛"); this.open = false; this.getList(); }); } else { - addCheckResult(this.form).then(response => { + addCheckResult(this.form).then((response) => { this.$modal.msgSuccess("鏂板鎴愬姛"); this.open = false; this.getList(); @@ -358,45 +442,52 @@ /** 鍒犻櫎鎸夐挳鎿嶄綔 */ handleDelete(row) { const ids = row.id || this.ids; - this.$modal.confirm('鏄惁纭鍒犻櫎鑰冩牳缁撴灉缂栧彿涓�"' + ids + '"鐨勬暟鎹」锛�').then(function() { - return delCheckResult(ids); - }).then(() => { - this.getList(); - this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); - }).catch(() => {}); + this.$modal + .confirm('鏄惁纭鍒犻櫎鑰冩牳缁撴灉缂栧彿涓�"' + ids + '"鐨勬暟鎹」锛�') + .then(function () { + return delCheckResult(ids); + }) + .then(() => { + this.getList(); + this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + }) + .catch(() => {}); }, /** 瀵煎嚭鎸夐挳鎿嶄綔 */ handleExport() { - this.download('check/result/export', { - ...this.queryParams - }, `鍚堝悓鑰冩牳缁撴灉_${new Date().getTime()}.xlsx`) + this.download( + "check/result/export", + { + ...this.queryParams, + }, + `鍚堝悓鑰冩牳缁撴灉_${new Date().getTime()}.xlsx` + ); }, - - } + }, }; </script> <style> - .text { - font-size: 14px; - } - .time { - font-size: 13px; - color: #999; - margin-left: 10px; - } - .item { - margin-bottom: 18px; - } - .clearfix:before, - .clearfix:after { - display: table; - content: ""; - } - .clearfix:after { - clear: both - } - .box-card { - width: 400px; - margin-bottom: 20px; - } +.text { + font-size: 14px; +} +.time { + font-size: 13px; + color: #999; + margin-left: 10px; +} +.item { + margin-bottom: 18px; +} +.clearfix:before, +.clearfix:after { + display: table; + content: ""; +} +.clearfix:after { + clear: both; +} +.box-card { + width: 400px; + margin-bottom: 20px; +} </style> -- Gitblit v1.8.0