From ac6d1295be85d51f77f8da4d77a3abe717a6dcb7 Mon Sep 17 00:00:00 2001 From: gaoluyang <2820782392@qq.com> Date: 星期四, 13 三月 2025 16:46:06 +0800 Subject: [PATCH] 隐藏工时管理部分功能 --- src/views/standard/model/index.vue | 136 +++++++++++++++------------------------------ 1 files changed, 45 insertions(+), 91 deletions(-) diff --git a/src/views/standard/model/index.vue b/src/views/standard/model/index.vue index 323b197..418c55b 100644 --- a/src/views/standard/model/index.vue +++ b/src/views/standard/model/index.vue @@ -4,77 +4,35 @@ <div class="search_thing"> <div class="search_label">妯℃澘鍚嶇О锛�</div> <div class="search_input"> - <el-input - v-model="queryParams.name" - clearable - placeholder="璇疯緭鍏�" - size="small" - @keyup.enter.native="refreshTable()" - ></el-input> + <el-input v-model="queryParams.name" clearable placeholder="璇疯緭鍏�" size="small" + @keyup.enter.native="refreshTable()"></el-input> </div> </div> <div class="search_thing" style="padding-left: 30px"> <el-button size="small" @click="refresh()">閲� 缃�</el-button> - <el-button size="small" type="primary" @click="refreshTable()" - >鏌� 璇�</el-button - > + <el-button size="small" type="primary" @click="refreshTable()">鏌� 璇�</el-button> </div> <div class="btn"> - <el-button - v-if="checkPermi(['system:standard:model:add'])" - size="small" - type="primary" - @click="openAdd" - >鏂板</el-button - > - <el-button - v-if="checkPermi(['system:standard:model:copy'])" + <el-button v-if="checkPermi(['standard:model:add'])" size="small" type="primary" @click="openAdd">鏂板</el-button> + <!-- <el-button + v-if="checkPermi(['standard:model:copy'])" size="small" @click="copyTemplate" >澶嶅埗妯$増</el-button - > + > --> </div> </div> - <div class="table"> - <lims-table - :tableData="tableData" - :column="column" - :page="page" - :tableLoading="tableLoading" - :height="'calc(100% - 200px)'" - ></lims-table> - </div> - <el-dialog - :before-close="isClose" - :close-on-click-modal="false" - :close-on-press-escape="false" - :visible.sync="isShow" - title="妯℃澘缂栧埗" - width="85%" - > + <lims-table :tableData="tableData" :column="column" :page="page" :tableLoading="tableLoading" + :height="'calc(100vh - 250px)'" style="padding: 20px; padding-top: 0" @pagination="pagination"></lims-table> + <el-dialog :before-close="isClose" :close-on-click-modal="false" :close-on-press-escape="false" + :visible.sync="isShow" title="妯℃澘缂栧埗" width="85%"> <div v-if="isShow" style="width: 100%; height: 82vh; overflow: auto"> - <Excel - v-loading="loading" - :data="row.thing" - :execlTitle="row.name" - ></Excel> + <Excel v-loading="loading" :data="row.thing" :execlTitle="row.name"></Excel> </div> </el-dialog> - <el-dialog - :before-close="closeCopyTem" - :close-on-click-modal="false" - :close-on-press-escape="false" - :visible.sync="isShowCopyTem" - :title="title" - width="35%" - > - <el-form - ref="copyForm" - :model="copyForm" - :rules="copyFormRules" - label-position="right" - label-width="80px" - > + <el-dialog :before-close="closeCopyTem" :close-on-click-modal="false" :close-on-press-escape="false" + :visible.sync="isShowCopyTem" :title="title" width="35%" :modal-append-to-body="false"> + <el-form ref="copyForm" :model="copyForm" :rules="copyFormRules" label-position="right" label-width="80px"> <el-form-item label="妯$増缂栧彿" prop="number"> <el-input v-model="copyForm.number" clearable size="small"></el-input> </el-form-item> @@ -87,12 +45,7 @@ </el-form> <span slot="footer" class="dialog-footer"> <el-button @click="closeCopyTem">鍙� 娑�</el-button> - <el-button - :loading="submitCopyInfoLoading" - type="primary" - @click="submitCopyInfo" - >纭� 瀹�</el-button - > + <el-button :loading="submitCopyInfoLoading" type="primary" @click="submitCopyInfo">纭� 瀹�</el-button> </span> </el-dialog> </div> @@ -109,8 +62,8 @@ delStandardTemplate, getEditTemplatePreparation, } from "@/api/standard/model"; -import { checkPermi } from "@/utils/permission"; // 鏉冮檺鍒ゆ柇鍑芥暟 export default { + name: 'Model', components: { Excel, limsTable, @@ -153,18 +106,17 @@ dataType: "action", fixed: "right", label: "鎿嶄綔", - width: "180px", operation: [ { name: "缂栬緫", type: "text", clickFun: (row) => { this.title = "缂栬緫"; - this.copyForm = row; + this.copyForm = this.HaveJson(row); this.isShowCopyTem = true; }, showHide: (row) => { - return this.checkPermi(["system:standard:model:edit"]); + return this.checkPermi(["standard:model:edit"]); }, }, { @@ -174,7 +126,7 @@ this.handleDelete(row); }, showHide: (row) => { - return this.checkPermi(["system:standard:model:del"]); + return this.checkPermi(["standard:model:del"]); }, }, { @@ -184,7 +136,7 @@ this.copyTemplate(row); }, showHide: (row) => { - return this.checkPermi(["system:standard:model:copy"]); + return this.checkPermi(["standard:model:copy"]); }, }, { @@ -195,8 +147,8 @@ }, showHide: (row) => { return this.checkPermi([ - "system:standard:model:edit", - "system:standard:model:add", + "standard:model:edit", + "standard:model:add", ]); }, }, @@ -217,26 +169,34 @@ this.getList(); }, methods: { - checkPermi, getList() { this.tableLoading = true; - selectStandardTemplatePageList({ ...this.queryParams, ...this.page }) + let param = { ...this.queryParams, ...this.page }; + delete param.total; + selectStandardTemplatePageList({ ...param }) .then((res) => { this.tableLoading = false; if (res.code === 200) { - this.tableData = res.data; - this.page.total = res.total; + this.tableData = res.data.records; + this.page.total = res.data.total; } }) .catch((err) => { this.tableLoading = false; }); }, + pagination({ page, limit }) { + this.page.current = page; + this.page.size = limit; + this.getList(); + }, refreshTable(e) { + this.page.current = 1; this.getList(); }, refresh() { this.queryParams = {}; + this.page.current = 1; this.getList(); }, openAdd() { @@ -266,7 +226,6 @@ delete params.id; addStandardTemplate(params) .then((res) => { - if (res.code == 201) return; this.isShowCopyTem = false; this.submitCopyInfoLoading = false; this.$message.success("鏂板鎴愬姛"); @@ -278,10 +237,9 @@ }); break; case "缂栬緫": - params.thing = row.thing; + params.thing = this.copyForm.thing ? this.copyForm.thing : ""; upStandardTemplate(params) .then((res) => { - if (res.code == 201) return; this.isShowCopyTem = false; this.submitCopyInfoLoading = false; this.$message.success("淇敼鎴愬姛"); @@ -295,7 +253,6 @@ case "澶嶅埗妯$増": copyStandardTemplate(params) .then((res) => { - if (res.code == 201) return; this.isShowCopyTem = false; this.submitCopyInfoLoading = false; this.$message.success("澶嶅埗鎴愬姛"); @@ -326,12 +283,11 @@ }) .then(() => { delStandardTemplate({ id: row.id }).then((res) => { - if (res.code == 201) return; this.$message.success("鍒犻櫎鎴愬姛"); this.refreshTable("page"); }); }) - .catch(() => {}); + .catch(() => { }); }, templateWrite(row) { getEditTemplatePreparation({ id: row.id }).then((res) => { @@ -355,7 +311,7 @@ .then(() => { this.closed(); }) - .catch(() => {}); + .catch(() => { }); }, closed() { this.loading = true; @@ -400,7 +356,6 @@ thing: JSON.stringify(data), name: luckysheet.getWorkbookName(["name"]), }).then((res) => { - if (res.code == 201) return; this.loading = false; this.$message.success("宸蹭繚瀛�"); this.isShow = false; @@ -424,6 +379,10 @@ </script> <style scoped> +/* >>>.el-dialog__wrapper { + z-index: 100 !important; +} */ + .search { background-color: #fff; height: 80px; @@ -439,7 +398,7 @@ } .search_label { - width: 110px; + width: 90px; font-size: 14px; text-align: right; } @@ -447,15 +406,10 @@ .search_input { width: calc(100% - 110px); } + .btn { position: absolute; - right: 20px; + right: 14px; top: 20px; -} - -.table { - background-color: #fff; - padding: 10px; - padding-top: 0; } </style> -- Gitblit v1.9.3