From 4cfbfd1b425f7b22b876ae6cae95c4fc29ae6bfb Mon Sep 17 00:00:00 2001 From: 马宇豪 <978517621@qq.com> Date: 星期五, 23 二月 2024 09:25:33 +0800 Subject: [PATCH] 盘库修改 --- src/views/warning/stock.vue | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 46 insertions(+), 1 deletions(-) diff --git a/src/views/warning/stock.vue b/src/views/warning/stock.vue index af0b027..55e1f5b 100644 --- a/src/views/warning/stock.vue +++ b/src/views/warning/stock.vue @@ -235,6 +235,20 @@ <span>{{ scope.row.modifieddate | parseTime('{y}-{m}-{d}') }}</span> </template> </el-table-column> + <el-table-column + label="操作" + align="center" + width="100" + class-name="small-padding fixed-width" + v-if="isAdmin" + ><template slot-scope="scope"> + <el-button + type="text" + :disabled="scope.row.ismend == 1" + @click="markSolved(scope.row)" + >标记已处理</el-button> + </template> + </el-table-column> </el-table> <br> <el-pagination @@ -256,7 +270,7 @@ <script> import { mapGetters } from 'vuex' - import { getStockWarningList } from '@/api/warning' + import { getStockWarningList, setSolved } from '@/api/warning' import { parseTime, computePageCount } from '@/utils' import { parseError } from '@/utils/messageDialog' import Cookies from 'js-cookie' @@ -316,6 +330,7 @@ } ], dateRange: [], + isAdmin: false, pickClear:false, pickerOptions: { shortcuts: [{ @@ -368,6 +383,12 @@ this.getProvince(); this.getDictionaryEnterpriseType(); this.getCertWarningList(); + const roles = JSON.parse(Cookies.get('roles')) + if(roles.find(i=>i.name == '管理员'|| i.name == '监管部门')){ + this.isAdmin = true + }else{ + this.isAdmin = false + } }, methods: { setDateRange(){ @@ -491,6 +512,30 @@ this.currentPage = val this.getCertWarningList() }, + markSolved(row){ + MessageBox.confirm('确定将该数据标记为已处理', '标记已处理', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(async () => { + const res = await setSolved({id: row.id}) + if(res.data.code === "200"){ + this.$message({ + type:'success', + message: '标记成功' + }) + this.getCertWarningList() + }else{ + this.$message({ + type:'warning', + message:res.data.message + }) + } + }).catch(() => { + console.log('已取消') + }) + + }, getBtnPermission(btnType) { return checkBtnPermission(this.userType, btnType) }, -- Gitblit v1.9.2