This commit is contained in:
磷叶 2024-12-23 14:34:14 +08:00
parent d082c08888
commit f1aa60fbf6
5 changed files with 73 additions and 5 deletions

10
jsconfig.json Normal file
View File

@ -0,0 +1,10 @@
{
"compilerOptions": {
"baseUrl": "./",
"paths": {
"@/*": ["src/*"]
}
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
}

View File

@ -72,12 +72,12 @@ export function cancelPrice(priceId) {
} }
// 审核单价 // 审核单价
export function verifyPrice(priceId, pass) { export function verifyPrice(priceIds, pass) {
return request({ return request({
url: `/yh/price/verify`, url: `/yh/price/verify`,
method: 'put', method: 'put',
data: { data: {
priceId, priceIds,
pass pass
} }
}) })

View File

@ -8,6 +8,7 @@
ref="check" ref="check"
:multiple="multiple" :multiple="multiple"
:init-select="initSelect" :init-select="initSelect"
:query="query"
v-on="$listeners" v-on="$listeners"
/> />
<template #footer> <template #footer>

View File

@ -82,7 +82,7 @@ export default {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.submitLoading = true; this.submitLoading = true;
verifyPrice(this.priceId, pass).then(res => { verifyPrice([this.priceId], pass).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.$message.success(pass ? '通过成功' : '驳回成功'); this.$message.success(pass ? '通过成功' : '驳回成功');
this.show = false; this.show = false;

View File

@ -154,6 +154,16 @@
v-has-permi="['yh:price:export']" v-has-permi="['yh:price:export']"
>导出</el-button> >导出</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-s-check"
size="mini"
@click="handleBatchVerify(true)"
v-has-permi="['yh:price:verify']"
>批量通过</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row> </el-row>
@ -165,6 +175,8 @@
@sort-change="onSortChange" @sort-change="onSortChange"
v-on="$listeners" v-on="$listeners"
ref="table" ref="table"
@row-click="handleRowClick"
:row-class-name="tableRowClassName"
> >
<el-table-column type="selection" width="55" align="center"/> <el-table-column type="selection" width="55" align="center"/>
<template v-for="column of showColumns"> <template v-for="column of showColumns">
@ -352,7 +364,8 @@ import {
getPrice, getPrice,
listPrice, listPrice,
submitPrice, submitPrice,
updatePrice updatePrice,
verifyPrice
} from "@/api/yh/price"; } from "@/api/yh/price";
import {$showColumns} from '@/utils/mixins'; import {$showColumns} from '@/utils/mixins';
import DeptTreeSelect from "@/components/Business/Dept/DeptTreeSelect.vue"; import DeptTreeSelect from "@/components/Business/Dept/DeptTreeSelect.vue";
@ -480,7 +493,8 @@ export default {
name: [ name: [
{ required: true, message: "工序不能为空", trigger: "blur" } { required: true, message: "工序不能为空", trigger: "blur" }
] ]
} },
currentRow: null, //
}; };
}, },
computed: { computed: {
@ -493,6 +507,19 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
handleBatchVerify(pass) {
this.$confirm(`确定要${pass ? '通过' : '驳回'} ID 为 ${this.ids.join(',')} 的单价吗?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
verifyPrice(this.ids, pass).then(res => {
this.$message.success(pass ? '通过成功' : '驳回成功');
}).finally(() => {
this.getList();
})
})
},
formatFraction, formatFraction,
/** 当排序按钮被点击时触发 **/ /** 当排序按钮被点击时触发 **/
onSortChange(column) { onSortChange(column) {
@ -566,6 +593,8 @@ export default {
this.ids = selection.map(item => item.priceId) this.ids = selection.map(item => item.priceId)
this.single = selection.length!==1 this.single = selection.length!==1
this.multiple = !selection.length this.multiple = !selection.length
//
this.currentRow = selection.length === 1 ? selection[0] : null;
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
@ -682,7 +711,35 @@ export default {
this.download('yh/price/export', { this.download('yh/price/export', {
...this.queryParams ...this.queryParams
}, `单价列表_${new Date().getTime()}.xlsx`) }, `单价列表_${new Date().getTime()}.xlsx`)
},
//
handleRowClick(row) {
//
this.$refs.table.toggleRowSelection(row);
this.currentRow = row;
},
//
tableRowClassName({row}) {
if (this.currentRow === row) {
return 'selected-row';
}
return '';
} }
} }
}; };
</script> </script>
<style lang="scss" scoped>
//
//
:deep(.selected-row) {
background-color: #f5f7fa !important;
}
//
:deep(.el-table__body tr:hover > td) {
background-color: #f5f7fa !important;
cursor: pointer;
}
</style>