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({
url: `/yh/price/verify`,
method: 'put',
data: {
priceId,
priceIds,
pass
}
})

View File

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

View File

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

View File

@ -154,6 +154,16 @@
v-has-permi="['yh:price:export']"
>导出</el-button>
</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>
</el-row>
@ -165,6 +175,8 @@
@sort-change="onSortChange"
v-on="$listeners"
ref="table"
@row-click="handleRowClick"
:row-class-name="tableRowClassName"
>
<el-table-column type="selection" width="55" align="center"/>
<template v-for="column of showColumns">
@ -352,7 +364,8 @@ import {
getPrice,
listPrice,
submitPrice,
updatePrice
updatePrice,
verifyPrice
} from "@/api/yh/price";
import {$showColumns} from '@/utils/mixins';
import DeptTreeSelect from "@/components/Business/Dept/DeptTreeSelect.vue";
@ -480,7 +493,8 @@ export default {
name: [
{ required: true, message: "工序不能为空", trigger: "blur" }
]
}
},
currentRow: null, //
};
},
computed: {
@ -493,6 +507,19 @@ export default {
this.getList();
},
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,
/** 当排序按钮被点击时触发 **/
onSortChange(column) {
@ -566,6 +593,8 @@ export default {
this.ids = selection.map(item => item.priceId)
this.single = selection.length!==1
this.multiple = !selection.length
//
this.currentRow = selection.length === 1 ? selection[0] : null;
},
/** 新增按钮操作 */
handleAdd() {
@ -682,7 +711,35 @@ export default {
this.download('yh/price/export', {
...this.queryParams
}, `单价列表_${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>
<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>