From f704c69aac5df70067eb82cfa09554810b08f591 Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期三, 10 六月 2026 14:44:40 +0800
Subject: [PATCH] 1.工价设置新增按钮级权限控制
---
src/api/basicSettings.js | 16 ++
src/views/basicSettings/meterPrice.vue | 314 +++++++++++++++++++++++++++++++++++++++-----
src/views/basicSettings/powerDivider.vue | 89 ++++++------
3 files changed, 336 insertions(+), 83 deletions(-)
diff --git a/src/api/basicSettings.js b/src/api/basicSettings.js
index 432fdf6..80b8627 100644
--- a/src/api/basicSettings.js
+++ b/src/api/basicSettings.js
@@ -496,6 +496,22 @@
params: data
})
}
+// 鑺傛媿宸ヤ环瀹℃牳
+export function VerifyBeatRate(data) {
+ return request({
+ url: 'BasicSetting/VerifyBeatRate',
+ method: 'post',
+ data
+ })
+}
+// 鑺傛媿宸ヤ环鍙嶅鏍�
+export function NoVerifyBeatRate(data) {
+ return request({
+ url: 'BasicSetting/NoVerifyBeatRate',
+ method: 'post',
+ data
+ })
+}
// 浜у搧缂栫爜鏌ユ壘鍏宠仈鐨勫伐鑹轰俊鎭�
export function PartSelectRpute(data) {
diff --git a/src/views/basicSettings/meterPrice.vue b/src/views/basicSettings/meterPrice.vue
index d3a16c1..4a7bf3a 100644
--- a/src/views/basicSettings/meterPrice.vue
+++ b/src/views/basicSettings/meterPrice.vue
@@ -2,9 +2,36 @@
<div>
<div class="body" :style="{height:mainHeight+'px'}">
- <div class="bodyTopButtonGroup" style="justify-content: space-between">
- <el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
- <el-button v-waves type="success" icon="el-icon-download" @click="$router.push('./../systemSetting/dataImport?fileCode=25')">瀵煎叆</el-button>
+ <div class="bodyTopButtonGroup" style="height: 47px;">
+
+ <el-button
+ v-if="buttoncodeArr.includes('Add')"
+ v-waves
+ type="primary"
+ icon="el-icon-circle-plus-outline"
+ @click="add('add')"
+ >鏂板</el-button>
+ <el-button
+ v-if="buttoncodeArr.includes('Verify')"
+ v-waves
+ type="success"
+ icon="el-icon-circle-check"
+ @click="Verify(false)"
+ >鎵归噺瀹℃牳</el-button>
+ <el-button
+ v-if="buttoncodeArr.includes('NoVerify')"
+ v-waves
+ type="warning"
+ icon="el-icon-circle-close"
+ @click="NoVerify(false)"
+ >鎵归噺鍙嶅鏍�</el-button>
+ <el-button
+ v-if="buttoncodeArr.includes('InExcel')"
+ v-waves
+ type="success"
+ icon="el-icon-download"
+ @click="$router.push('./../systemSetting/dataImport?fileCode=25')"
+ >瀵煎叆</el-button>
</div>
<div class="bodyTopFormGroup">
@@ -130,46 +157,149 @@
:header-cell-style="this.$headerCellStyle"
:cell-style="this.$cellStyle"
@sort-change="sortChange"
+ @selection-change="handleSelectionChange"
>
-
<el-table-column
- v-for="item in tableColumnSettingsArray"
- v-if="item.show"
- :key="item.id"
- :sortable="item.sortable"
- :prop="item.prop"
- :min-width="item.minWidth"
- :label="item.label"
- :width="item.width"
- show-tooltip-when-overflow
- :fixed="item.fixed?(item.fixed==='left'?'left':'right'):false"
+ type="selection"
+ width="50"
+ fixed
+ />
+ <el-table-column
+ prop="rowNum"
+ width="60"
+ label="搴忓彿"
+ fixed
+ />
+ <el-table-column
+ prop="verifyuser"
+ label="鏄惁宸插鏍�"
+ sortable="custom"
+ width="120"
>
<template slot-scope="{row}">
- <div v-if="!row[item.prop]">/</div>
- <div v-else-if="item.prop==='eqp_value'||item.prop==='stand_value'">
- {{ row[item.prop] }} 绉�
- </div>
- <div v-else>{{ row[item.prop] }}</div>
+ <el-tag v-if="row.verifyuser" size="small" type="success">宸插鏍�</el-tag>
+ <el-tag v-else size="small" type="danger">鏈鏍�</el-tag>
</template>
</el-table-column>
<el-table-column
+ prop="partcode"
+ label="浜у搧缂栫爜"
+ sortable="custom"
+ min-width="110"
+ />
+ <el-table-column
+ prop="partname"
+ label="浜у搧鍚嶇О"
+ sortable="custom"
+ min-width="110"
+ />
+ <el-table-column
+ prop="partspec"
+ label="浜у搧瑙勬牸"
+ sortable="custom"
+ min-width="110"
+ />
+ <el-table-column
+ prop="stepname"
+ label="宸ュ簭鍚嶇О"
+ sortable="custom"
+ width="110"
+ />
+ <el-table-column
+ prop="unprice"
+ label="璁′欢鍗曚环"
+ sortable="custom"
+ width="110"
+ />
+ <el-table-column
+ prop="verifyuser"
+ label="瀹℃牳浜�"
+ sortable="custom"
+ width="110"
+ />
+ <el-table-column
+ prop="verifydate"
+ label="瀹℃牳鏃ユ湡"
+ sortable="custom"
+ width="160"
+ />
+ <el-table-column
+ prop="lm_user"
+ label="鍒涘缓浜哄憳"
+ sortable="custom"
+ width="110"
+ />
+ <el-table-column
+ prop="lm_date"
+ label="鍒涘缓鏃堕棿"
+ sortable="custom"
+ width="160"
+ />
+
+ <!-- <el-table-column-->
+ <!-- v-for="item in tableColumnSettingsArray"-->
+ <!-- v-if="item.show"-->
+ <!-- :key="item.id"-->
+ <!-- :sortable="item.sortable"-->
+ <!-- :prop="item.prop"-->
+ <!-- :min-width="item.minWidth"-->
+ <!-- :label="item.label"-->
+ <!-- :width="item.width"-->
+ <!-- show-tooltip-when-overflow-->
+ <!-- :fixed="item.fixed?(item.fixed==='left'?'left':'right'):false"-->
+ <!-- >-->
+ <!-- <template slot-scope="{row}">-->
+ <!-- <div v-if="!row[item.prop]">/</div>-->
+ <!-- <div v-else-if="item.prop==='eqp_value'||item.prop==='stand_value'">-->
+ <!-- {{ row[item.prop] }} 绉�-->
+ <!-- </div>-->
+ <!-- <div v-else>{{ row[item.prop] }}</div>-->
+ <!-- </template>-->
+ <!-- </el-table-column>-->
+
+ <el-table-column
label="鎿嶄綔"
fixed="right"
- width="120"
+ width="160"
>
<template slot-scope="{row}">
<div class="operationClass">
- <el-tooltip class="item" effect="dark" content="缂栬緫" placement="top">
- <i
- :style="{color:$store.state.settings.theme}"
- class="el-icon-edit-outline"
- @click="edit('edit',row)"
- />
- </el-tooltip>
- <el-tooltip v-del-tab-index class="item" effect="dark" content="鍒犻櫎" placement="top">
- <i :style="{color:$store.state.settings.theme}" class="el-icon-delete" @click="del(row)" />
- </el-tooltip>
+ <el-button
+ v-if="buttoncodeArr.includes('Update')&&!row.verifyuser"
+ type="text"
+ :style="{color:$store.state.settings.theme}"
+ @click="edit('edit',row)"
+ >缂栬緫</el-button>
+ <!-- v-if="!buttoncodeArr.includes('Delete')"-->
+ <el-button
+ v-if="buttoncodeArr.includes('Delete')&&!row.verifyuser"
+ type="text"
+ :style="{color: 'red'}"
+ @click="del(row)"
+ >鍒犻櫎</el-button>
+ <el-button
+ v-if="buttoncodeArr.includes('Verify')&&!row.verifyuser"
+ type="text"
+ :style="{color:$store.state.settings.theme}"
+ @click="Verify(true,row)"
+ >瀹℃牳</el-button>
+ <el-button
+ v-if="buttoncodeArr.includes('NoVerify')&&row.verifyuser"
+ type="text"
+ :style="{color: 'red'}"
+ @click="NoVerify(true,row)"
+ >鍙嶅鏍�</el-button>
+ <!-- <el-tooltip class="item" effect="dark" content="缂栬緫" placement="top">-->
+ <!-- <i-->
+ <!-- :style="{color:$store.state.settings.theme}"-->
+ <!-- class="el-icon-edit-outline"-->
+ <!-- @click="edit('edit',row)"-->
+ <!-- />-->
+ <!-- </el-tooltip>-->
+ <!-- <el-tooltip v-del-tab-index class="item" effect="dark" content="鍒犻櫎" placement="top">-->
+ <!-- <i :style="{color:$store.state.settings.theme}" class="el-icon-delete" @click="del(row)" />-->
+ <!-- </el-tooltip>-->
</div>
</template>
</el-table-column>
@@ -301,10 +431,10 @@
<script>
import Pagination from '@/components/Pagination'
import {
- BeatRateSearch, DeleteBeatRate,
+ BeatRateSearch, DeleteBeatRate, NoVerifyBeatRate,
PartSelect,
PartSelectRpute,
- RouteSelectStep, SaveBeatRate
+ RouteSelectStep, SaveBeatRate, VerifyBeatRate
} from '@/api/basicSettings'
import elDragDialog from '@/directive/el-drag-dialog'
import waves from '@/directive/waves'
@@ -340,7 +470,17 @@
tableData: [],
tableColumnSettingsArray: [
// { minWidth: 50, width: false, prop: 'id', label: 'id', id: 1, show: false, fixed: false, sortable: false }, // 闅愯棌鍒� show: false闅愯棌锛宼rue鏄剧ず
- { minWidth: 25, width: 50, prop: 'rowNum', label: '搴忓彿', id: 2, show: true, fixed: 'left', sortable: false }, // custom
+ { minWidth: 25, width: 50, prop: 'rowNum', label: '搴忓彿', id: 1, show: true, fixed: 'left', sortable: false }, // custom
+ // {
+ // minWidth: false,
+ // width: 130,
+ // prop: 'verifyuser1',
+ // label: '鏄惁宸插鏍�',
+ // id: 2,
+ // show: true,
+ // fixed: false,
+ // sortable: true
+ // },
{
minWidth: 110,
width: false,
@@ -419,8 +559,8 @@
fixed: false,
sortable: true
}, {
- minWidth: 110,
- width: false,
+ minWidth: false,
+ width: 110,
prop: 'stepname',
label: '宸ュ簭鍚嶇О',
id: 11,
@@ -429,8 +569,8 @@
sortable: true
},
{
- minWidth: 110,
- width: false,
+ minWidth: false,
+ width: 110,
prop: 'unprice',
label: '璁′欢鍗曚环',
id: 12,
@@ -441,9 +581,29 @@
{
minWidth: false,
width: 110,
+ prop: 'verifyuser',
+ label: '瀹℃牳浜�',
+ id: 13,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: false,
+ width: 160,
+ prop: 'verifydate',
+ label: '瀹℃牳鏃ユ湡',
+ id: 14,
+ show: true,
+ fixed: false,
+ sortable: true
+ },
+ {
+ minWidth: false,
+ width: 110,
prop: 'lm_user',
label: '鍒涘缓浜哄憳',
- id: 13,
+ id: 15,
show: true,
fixed: false,
sortable: true
@@ -453,7 +613,7 @@
width: 160,
prop: 'lm_date',
label: '鍒涘缓鏃堕棿',
- id: 14,
+ id: 16,
show: true,
fixed: false,
sortable: true
@@ -479,7 +639,11 @@
editPartName: '', // 缂栬緫鏃朵骇鍝佸悕绉�
editRouteName: '', // 缂栬緫鏃跺伐鑹鸿矾绾垮悕绉�
editStepName: '', // 缂栬緫鏃跺姞宸ュ伐搴忓悕绉�
- operation: ''
+ operation: '',
+
+ buttoncodeArr: [],
+
+ multipleSelection: []
}
},
@@ -491,6 +655,9 @@
},
created() {
this.handleRequest()
+
+ console.log(this.$route.meta.buttoncode)
+ this.buttoncodeArr = this.$route.meta.buttoncode.split(',')
},
mounted() {
window.addEventListener('resize', this.getHeight)
@@ -632,6 +799,73 @@
this.$message.info('宸插彇娑堝垹闄�')
})
},
+ // 瀹℃牳
+ Verify(boolean, row) {
+ this.$confirm('鏄惁纭瀹℃牳?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ if (boolean) {
+ VerifyBeatRate([row.id]).then(res => {
+ if (res.code === '200') {
+ this.$message.success('瀹℃牳鎴愬姛!')
+ if (this.form.page > 1 && this.tableData.length === 1) {
+ this.form.page--
+ }
+ this.getBeatRateSearch()
+ }
+ })
+ } else {
+ VerifyBeatRate(this.multipleSelection.filter(i => !i.verifyuser).map(i => i.id)).then(res => {
+ if (res.code === '200') {
+ this.$message.success('瀹℃牳鎴愬姛!')
+ if (this.form.page > 1 && this.tableData.length === 1) {
+ this.form.page--
+ }
+ this.getBeatRateSearch()
+ }
+ })
+ }
+ }).catch(() => {
+ this.$message.info('宸插彇娑堝鏍�')
+ })
+ },
+ // 鍙嶅鏍�
+ NoVerify(boolean, row) {
+ this.$confirm('鏄惁纭鍙嶅鏍�?', '鎻愮ず', {
+ confirmButtonText: '纭畾',
+ cancelButtonText: '鍙栨秷',
+ type: 'warning'
+ }).then(() => {
+ if (boolean) {
+ NoVerifyBeatRate([row.id]).then(res => {
+ if (res.code === '200') {
+ this.$message.success('鍙嶅鏍告垚鍔�!')
+ if (this.form.page > 1 && this.tableData.length === 1) {
+ this.form.page--
+ }
+ this.getBeatRateSearch()
+ }
+ })
+ } else {
+ NoVerifyBeatRate(this.multipleSelection.filter(i => i.verifyuser).map(i => i.id)).then(res => {
+ if (res.code === '200') {
+ this.$message.success('鍙嶅鏍告垚鍔�!')
+ if (this.form.page > 1 && this.tableData.length === 1) {
+ this.form.page--
+ }
+ this.getBeatRateSearch()
+ }
+ })
+ }
+ }).catch(() => {
+ this.$message.info('宸插彇娑堝弽瀹℃牳')
+ })
+ },
+ handleSelectionChange(val) {
+ this.multipleSelection = val
+ },
// 瀵硅瘽妗嗗叧闂簨浠�
handleClose() {
this.dialogForm.partcode = ''
diff --git a/src/views/basicSettings/powerDivider.vue b/src/views/basicSettings/powerDivider.vue
index 8e250dd..00e4770 100644
--- a/src/views/basicSettings/powerDivider.vue
+++ b/src/views/basicSettings/powerDivider.vue
@@ -57,7 +57,7 @@
<div style="display: flex;">
<div
ref="scrollLeft"
- style="border-right: 1px solid rgba(0,0,0,0.2);width:100%;
+ style="border-right: 1px solid rgba(0,0,0,0.2);width:260px;
overflow-y: auto;overflow-x:hidden;"
:style="{height:(tableHeight-40)+'px'}"
@scroll="scrollLeftScroll()"
@@ -81,66 +81,66 @@
@node-click="getLeftTreeNode"
/>
</div>
- <!-- <div-->
- <!-- ref="scrollCenter"-->
- <!-- style="width: calc(100% - 260px );padding-left: 10px;overflow-y: auto;"-->
- <!-- :style="{height:(tableHeight-40)+'px'}"-->
- <!-- @scroll="scrollCenterScroll()"-->
- <!-- @mouseover="isScroll='center'"-->
- <!-- >-->
- <!-- <div style=" ">-->
- <!-- <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" /> 鎸夐挳鏉冮檺-->
- <!-- </div>-->
+ <div
+ ref="scrollCenter"
+ style="width: calc(100% - 260px );padding-left: 10px;overflow-y: auto;"
+ :style="{height:(tableHeight-40)+'px'}"
+ @scroll="scrollCenterScroll()"
+ @mouseover="isScroll='center'"
+ >
+ <div style=" ">
+ <i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" /> 鎸夐挳鏉冮檺
+ </div>
- <!-- <el-checkbox-->
- <!-- v-model="buttonIsChecked"-->
- <!-- style="height: 26px;display:flex;align-items: center;margin-top:10px;width:200px"-->
- <!-- @change=" handleCheckAllChange "-->
- <!-- >鍏ㄩ��-->
- <!-- </el-checkbox>-->
+ <el-checkbox
+ v-model="buttonIsChecked"
+ style="height: 26px;display:flex;align-items: center;margin-top:10px;width:200px"
+ @change=" handleCheckAllChange "
+ >鍏ㄩ��
+ </el-checkbox>
- <!-- <div v-if="treeCenter.length>0">-->
- <!-- <div v-for="(item,index) in treeCenter[0].children" :key="item.menucode">-->
+ <div v-if="treeCenter.length>0">
+ <div v-for="(item,index) in treeCenter[0].children" :key="item.menucode">
- <!-- <div-->
- <!-- v-if="!item.buttoncodelist"-->
- <!-- style="margin-left: 40px;height:26px;display: flex;"-->
- <!-- />-->
+ <div
+ v-if="!item.buttoncodelist"
+ style="margin-left: 40px;height:26px;display: flex;"
+ />
- <!-- <el-checkbox-group-->
- <!-- v-for="it in item.children"-->
- <!-- v-if="item.expanded"-->
- <!-- :key="it.menucode"-->
- <!-- v-model="it.buttonChecked"-->
- <!-- style="margin-left: 40px;height:26px;display: flex;"-->
- <!-- @change="val=>handleCheckedButtonChange(val,it.menucode,it.buttonChecked)"-->
- <!-- >-->
+ <el-checkbox-group
+ v-for="it in item.children"
+ v-if="item.expanded"
+ :key="it.menucode"
+ v-model="it.buttonChecked"
+ style="margin-left: 40px;height:26px;display: flex;"
+ @change="val=>handleCheckedButtonChange(val,it.menucode,it.buttonChecked)"
+ >
- <!-- <el-checkbox-->
- <!-- v-for="i in it.buttoncodelist"-->
- <!-- :key="i"-->
- <!-- :label="i"-->
- <!-- style="display:flex;align-items: center;"-->
- <!-- />-->
- <!-- </el-checkbox-group>-->
+ <el-checkbox
+ v-for="i in it.buttoncodelist"
+ :key="i"
+ :label="i"
+ style="display:flex;align-items: center;"
+ />
+ </el-checkbox-group>
- <!-- </div>-->
+ </div>
- <!-- </div>-->
+ </div>
- <!-- </div>-->
+ </div>
</div>
</el-tab-pane>
<el-tab-pane label="APP绔�" name="APP">
<div style="display: flex;">
<div
- ref="scrollLeft"
style="border-right: 1px solid rgba(0,0,0,0.2);width:100%;
overflow-y: auto;overflow-x:hidden;"
:style="{height:(tableHeight-40)+'px'}"
- @scroll="scrollLeftScroll()"
@mouseover="isScroll='left'"
>
+ <!-- ref="scrollLeft"-->
+ <!-- @scroll="scrollLeftScroll()"-->
<div style=" ">
<i class="el-icon-s-operation" :style="{color:$store.state.settings.theme}" /> 鑿滃崟鏉冮檺
</div>
@@ -279,10 +279,13 @@
{ menucode: '-1', menuname: '鍏ㄩ儴', children: result }
]
+ console.log(this.treeCenter, 12)
this.treeCenter[0].children.sort((a, b) => a.menu_seq - b.menu_seq)
this.treeCenter[0].children.forEach(item => {
if (item.children && item.children.length) {
item.children.forEach(it => {
+ // console.log(it.menucode === '0115')
+
it.buttoncodelist = it.buttoncodelist !== '' && it.buttoncodelist !== null ? it.buttoncodelist.split(',') : []
if (it.buttoncodelist && it.buttoncodelist.length > 0) {
it.buttoncodelist = this.ButtonData.filter(j =>
--
Gitblit v1.9.3