供应商评分

This commit is contained in:
zzyuan 2025-07-23 10:29:46 +08:00
parent 7401dba03f
commit 8d356872a7
2 changed files with 266 additions and 198 deletions

View File

@ -125,14 +125,54 @@ export function editSupplierBindMaterialApi(data) {
// 实时分页查询供应商评分
export function supplierScorePageApi(data) {
return request({
url: '/smart-canteen/ims-supplier-score-rule/page',
method: 'get',
headers: {
//"merchant-id":"378915229716713472",
},
params:data
})
}
// 分页查询供应商历史评分
export function supplierScoreHistApi(data) {
return request({
url: '/smart-canteen/ims-supplier-score-rule/hist',
method: 'get',
headers: {
//"merchant-id":"378915229716713472",
},
params:data
})
}
// 查询供应商评分规则分数设定
export function supplierScoreRuleListApi(data) {
return request({
url: '/smart-canteen/ims-supplier-score-rule/list',
method: 'get',
headers: {
//"merchant-id":"378915229716713472",
},
params:data
})
}
// 新增/编辑供应商评分规则分数设定
export function editSupplierRuleApi(data) {
return request({
url: '/smart-canteen/ims-supplier-score-rule/add-or-edit',
method: 'post',
headers: {
//"merchant-id":"378915229716713472",
},
data: data
})
}

View File

@ -8,14 +8,16 @@
emitPath: false,// falseid
checkStrictly: false,//
value:'id',label:'label'
}" clearable>
}" clearable >
</el-cascader>
</el-form-item>
<el-form-item label="供应商" prop="supplierId">
<el-select v-model="queryParams.supplierId" placeholder="请选择供应商" style="width: 240px;">
<el-option label="供应商1" :value="1"></el-option>
<el-option label="供应商2" :value="2"></el-option>
<el-option label="供应商3" :value="2"></el-option>
<el-option v-for="item in supplierOptions"
:key="item.supplierId"
:label="item.supplierName"
:value="item.supplierId"
></el-option>
</el-select>
</el-form-item>
@ -43,18 +45,17 @@
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
</template>
</el-table-column>
<el-table-column label="供应商名称" align="center" prop="supplierName" :show-overflow-tooltip="true" width="120" />
<el-table-column label="所属区域" align="center" prop="areaName" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="交货及时率分数" align="center" prop="" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="产品合格率分数" align="center" prop="" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="产品合格率分数" align="center" prop="" :show-overflow-tooltip="true" width="150"/>
<el-table-column label="公司资质认证分数" align="center" prop="" :show-overflow-tooltip="true" width="150"/>
<el-table-column label="注册资金分数" align="center" prop="" :show-overflow-tooltip="true" width="150"/>
<el-table-column label="上一年度营业额分数" align="center" prop="" :show-overflow-tooltip="true" width="150"/>
<el-table-column label="员工数分数" align="center" prop="" :show-overflow-tooltip="true" width="150"/>
<el-table-column label="订单数量分数" align="center" prop="" :show-overflow-tooltip="true" width="150"/>
<el-table-column label="订单金额分数" align="center" prop="" :show-overflow-tooltip="true" width="150"/>
<el-table-column label="总分" align="center" prop="" :show-overflow-tooltip="true" width="150"/>
<el-table-column label="供应商名称" align="center" prop="supplierName" :show-overflow-tooltip="true" width="150" />
<el-table-column label="所属区域" align="center" prop="areaName" :show-overflow-tooltip="true" width="150"/>
<el-table-column label="交货及时率分数" align="center" prop="deliveryOnTimeScore" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="产品合格率分数" align="center" prop="productPassScore" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="公司资质认证分数" align="center" prop="companyQualificationCertificationScore" :show-overflow-tooltip="true" width="130"/>
<el-table-column label="注册资金分数" align="center" prop="registFundScore" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="上一年度营业额分数" align="center" prop="lastYearOperatingIncomeScore" :show-overflow-tooltip="true" width="150"/>
<el-table-column label="员工数分数" align="center" prop="workersNumScore" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="订单数量分数" align="center" prop="orderNumScore" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="订单金额分数" align="center" prop="orderAmountScore" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="总分" align="center" prop="totalScore" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
@ -103,15 +104,15 @@
</el-col>
<el-col :span="24" v-for="(item,index) in rulesList" :key="index">
<el-form-item :label="item.ruleName" required>
<div v-for="(sub,sindex) in item.sectionListDTO" :key="sindex" style="width: 100%;display: flex;margin-bottom: 10px;">
<div v-for="(sub,sindex) in item.sectionVOList" :key="sindex" style="width: 100%;display: flex;margin-bottom: 10px;">
<el-input value="0" disabled v-model="sub.leftValue" style="width: 30%;">
<template slot="append">{{ item.unitName }}</template>
<!-- <template slot="append">{{ item.unitName }}</template> -->
</el-input>
<div style="width: 5%;text-align: center;">-</div>
<el-input value="0" v-model.number="sub.rightValue" :disabled="sindex<(item.sectionListDTO.length-1)" style="width: 30%;" maxlength="8" @blur="checkRange(sub)">
<template slot="append">{{ item.unitName }}</template>
<el-input value="0" v-model.number="sub.rightValue" :disabled="sindex<(item.sectionVOList.length-1)" style="width: 30%;" maxlength="8" @blur="checkRange(sub)">
<!-- <template slot="append">{{ item.unitName }}</template> -->
</el-input>
<el-input value="0" v-model.number="sub.sectionScore" :disabled="sindex<(item.sectionListDTO.length-1)" maxlength="5" @blur="checkScore(item,sindex)" style="width: 25%;margin-left: 2%;margin-right: 2%;">
<el-input value="0" v-model.number="sub.sectionScore" :disabled="sindex<(item.sectionVOList.length-1)" maxlength="5" @blur="checkScore(item,sindex)" style="width: 25%;margin-left: 2%;margin-right: 2%;">
<template slot="append"></template>
</el-input>
<el-button
@ -128,8 +129,8 @@
>删除</el-button>
</div>
<div>
<el-input value="0" disabled v-model="item.sectionListDTO[item.sectionListDTO.length-1].rightValue" style="width: 64%;">
<template slot="append">{{ item.unitName }}以上</template>
<el-input value="0" disabled v-model="item.sectionVOList[item.sectionVOList.length-1].rightValue" style="width: 64%;">
<template slot="append">以上</template>
</el-input>
<el-input value="0" v-model.number="item.setScore" @blur="checkScoreAll(item)" maxlength="5" style="width: 25%;margin-left: 2%;margin-right: 2%;">
<template slot="append"></template>
@ -151,21 +152,35 @@
</el-dialog>
<!-- 历史评分 -->
<el-dialog title="历史评分" :visible.sync="openHistory" width="1200px" append-to-body>
<el-dialog title="历史评分" :visible.sync="openHistory" width="80%" append-to-body>
<el-table v-loading="loading" :data="dialogTableData" height="500">
<el-table-column label="供应商名称" align="center" prop="supplierName" :show-overflow-tooltip="true" width="100" />
<el-table-column label="评分周期" align="center" prop="areaName" :show-overflow-tooltip="true" width="100"/>
<el-table-column label="评分时间" align="center" prop="" :show-overflow-tooltip="true" width="150"/>
<el-table-column label="交货及时率分数" align="center" prop="" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="产品合格率分数" align="center" prop="" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="公司资质认证分数" align="center" prop="" :show-overflow-tooltip="true" width="130"/>
<el-table-column label="注册资金分数" align="center" prop="" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="上一年度营业额分数" align="center" prop="" :show-overflow-tooltip="true" width="140"/>
<el-table-column label="员工数分数" align="center" prop="" :show-overflow-tooltip="true" width="110"/>
<el-table-column label="订单数量分数" align="center" prop="" :show-overflow-tooltip="true" width="110"/>
<el-table-column label="订单金额分数" align="center" prop="" :show-overflow-tooltip="true" width="110"/>
<el-table-column label="总分" align="center" prop="" :show-overflow-tooltip="true" width="100"/>
<el-table-column label="供应商名称" align="center" prop="supplierName" :show-overflow-tooltip="true" width="140"/>
<el-table-column label="评分周期" align="center" prop="ruleType" :show-overflow-tooltip="true" width="120">
<template slot-scope="scope">
<span v-if="scope.row.ruleType==1">月度</span>
<span v-if="scope.row.ruleType==2">季度</span>
<span v-if="scope.row.ruleType==3">半年度</span>
<span v-if="scope.row.ruleType==4">年度</span>
</template>
</el-table-column>
<el-table-column label="评分时间" align="center" prop="createTime" :show-overflow-tooltip="true" width="150"/>
<el-table-column label="交货及时率分数" align="center" prop="deliveryOnTimeScore" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="产品合格率分数" align="center" prop="productPassScore" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="公司资质认证分数" align="center" prop="companyQualificationCertificationScore" :show-overflow-tooltip="true" width="130"/>
<el-table-column label="注册资金分数" align="center" prop="registFundScore" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="上一年度营业额分数" align="center" prop="lastYearOperatingIncomeScore" :show-overflow-tooltip="true" width="140"/>
<el-table-column label="员工数分数" align="center" prop="workersNumScore" :show-overflow-tooltip="true" width="110"/>
<el-table-column label="订单数量分数" align="center" prop="orderNumScore" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="订单金额分数" align="center" prop="orderAmountScore" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="总分" align="center" prop="totalScore" :show-overflow-tooltip="true" width="100"/>
</el-table>
<pagination
v-show="total2>0"
:total="total2"
:page.sync="queryParams2.pageNum"
:limit.sync="queryParams2.pageSize"
@pagination="getList2"
/>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="openHistory=false"> </el-button>
<el-button @click="openHistory=false"> </el-button>
@ -176,9 +191,7 @@
<script>
import { systemAreaTreeApi } from "@/api/base/stall";
import { systemMaterialTreeApi } from "@/api/dish/material";
// import { getPageCanteenApi } from "@/api/base/canteen";
import { supplierPageApi,supplierScorePageApi,supplierScoreHistApi,supplierScoreRuleListApi,editSupplierRuleApi } from "@/api/foodManage/supplierManage";
export default {
name: "",
@ -207,14 +220,11 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
supplierName: undefined,
areaId: undefined,
linkman: undefined,
status: undefined,
categoryIdList: []
supplierId: undefined,
areaId: undefined
},
treeTypeOptions:[],//
treeOptions:[],//
supplierOptions:[],//
//
form: {},
//
@ -227,111 +237,117 @@ export default {
]
},
rulesList:[
{
ruleName:"交货及时率",
sectionListDTO:[
{
leftValue:0,
rightValue:null,
sectionScore:null,
}
],
unitName:'%',
setScore:null,
},
{
ruleName:"产品合格率",
sectionListDTO:[
{
leftValue:0,
rightValue:null,
sectionScore:null,
}
],
unitName:'%',
setScore:null,
},
{
ruleName:"公司资质认证",
sectionListDTO:[
{
leftValue:0,
rightValue:null,
sectionScore:null,
}
],
unitName:'个',
setScore:null,
},
{
ruleName:"注册资金(万元)",
sectionListDTO:[
{
leftValue:0,
rightValue:null,
sectionScore:null,
}
],
unitName:'万元',
setScore:null,
},
{
ruleName:"上一年度营业额(万元)",
sectionListDTO:[
{
leftValue:0,
rightValue:null,
sectionScore:null,
}
],
unitName:'万元',
setScore:null,
},
{
ruleName:"员工数(人)",
sectionListDTO:[
{
leftValue:0,
rightValue:null,
sectionScore:null,
}
],
unitName:'人',
setScore:null,
},
{
ruleName:"订单数量(个)",
sectionListDTO:[
{
leftValue:0,
rightValue:null,
sectionScore:null,
}
],
unitName:'个',
setScore:null,
},
{
ruleName:"订单金额(万元)",
sectionListDTO:[
{
leftValue:0,
rightValue:null,
sectionScore:null,
}
],
unitName:'万元',
setScore:null,
}
// {
// ruleName:"",
// sectionVOList:[
// {
// leftValue:0,
// rightValue:null,
// sectionScore:null,
// }
// ],
// unitName:'%',
// setScore:null,
// },
// {
// ruleName:"",
// sectionVOList:[
// {
// leftValue:0,
// rightValue:null,
// sectionScore:null,
// }
// ],
// unitName:'%',
// setScore:null,
// },
// {
// ruleName:"",
// sectionVOList:[
// {
// leftValue:0,
// rightValue:null,
// sectionScore:null,
// }
// ],
// unitName:'',
// setScore:null,
// },
// {
// ruleName:"",
// sectionVOList:[
// {
// leftValue:0,
// rightValue:null,
// sectionScore:null,
// }
// ],
// unitName:'',
// setScore:null,
// },
// {
// ruleName:"",
// sectionVOList:[
// {
// leftValue:0,
// rightValue:null,
// sectionScore:null,
// }
// ],
// unitName:'',
// setScore:null,
// },
// {
// ruleName:"",
// sectionVOList:[
// {
// leftValue:0,
// rightValue:null,
// sectionScore:null,
// }
// ],
// unitName:'',
// setScore:null,
// },
// {
// ruleName:"",
// sectionVOList:[
// {
// leftValue:0,
// rightValue:null,
// sectionScore:null,
// }
// ],
// unitName:'',
// setScore:null,
// },
// {
// ruleName:"",
// sectionVOList:[
// {
// leftValue:0,
// rightValue:null,
// sectionScore:null,
// }
// ],
// unitName:'',
// setScore:null,
// }
],
openHistory: false,
queryParams2: {
pageNum: 1,
pageSize: 10
},
total2: 0,
histRow:{},
dialogTableData:[],
};
},
created() {
this.getTypeTreeData();
this.getTreeData();
// this.getList();
this.getSupplierData();
this.getList();
},
computed:{
@ -346,21 +362,18 @@ export default {
}
},
methods: {
//
getTypeTreeData() {
let param = {
// categoryType:1,
}
systemMaterialTreeApi(param).then((response) => {
this.treeTypeOptions = response.data;
});
},
//
getTreeData() {
systemAreaTreeApi({}).then((response) => {
this.treeOptions = response.data;
});
},
/** 查询供应商下拉结构 */
getSupplierData() {
supplierPageApi({ isPaging:1,areaIdList:[] }).then((response) => {
this.supplierOptions = response.rows||[];
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
@ -377,22 +390,22 @@ export default {
let param = {
"pageNum": this.queryParams.pageNum,
"pageSize": this.queryParams.pageSize,
"supplierName": this.queryParams.supplierName,
"categoryIdList": this.queryParams.categoryIdList,
"supplierId": this.queryParams.supplierId,
"areaId": this.queryParams.areaId,
"linkman": this.queryParams.linkman,
"status": this.queryParams.status
}
// getPageCanteenApi(param).then(response => {
// this.tableListData = response.rows;
// this.total = Number(response.total);
supplierScorePageApi(param).then(response => {
this.tableListData = response.rows;
this.total = Number(response.total);
this.loading = false;
// });
});
},
/** 新增按钮操作 */
handleRules() {
this.reset();
this.open = true;
supplierScoreRuleListApi({}).then(response => {
this.rulesList = response.data;
this.open = true;
});
},
//
cancel() {
@ -407,12 +420,12 @@ export default {
//item-> sub-> 0%-10%
handleAdd(item){
let sub = item.sectionListDTO[item.sectionListDTO.length-1]
let sub = item.sectionVOList[item.sectionVOList.length-1]
if(!sub.rightValue||!sub.sectionScore){
this.$modal.msgError('请输入'+item.ruleName+'和得分');
}else{
item.sectionListDTO.push({
leftValue:item.sectionListDTO[item.sectionListDTO.length-1].rightValue,
item.sectionVOList.push({
leftValue:item.sectionVOList[item.sectionVOList.length-1].rightValue,
rightValue:null,
sectionScore:null,
})
@ -420,8 +433,8 @@ export default {
},
//item-> sub-> 0%-10%
handleDel(item,sindex){
item.sectionListDTO.splice(sindex,1)
item.sectionListDTO[sindex].leftValue = item.sectionListDTO[sindex-1].rightValue
item.sectionVOList.splice(sindex,1)
item.sectionVOList[sindex].leftValue = item.sectionVOList[sindex-1].rightValue
},
//item-> sub-> 0%-10%
//
@ -434,28 +447,29 @@ export default {
//
checkScore(item,sindex){
if(sindex>0){
if(item.sectionListDTO[sindex].sectionScore<item.sectionListDTO[sindex-1].sectionScore){
item.sectionListDTO[sindex].sectionScore=item.sectionListDTO[sindex-1].sectionScore+1
if(item.sectionVOList[sindex].sectionScore<item.sectionVOList[sindex-1].sectionScore){
item.sectionVOList[sindex].sectionScore=item.sectionVOList[sindex-1].sectionScore+1
}
}
if(item.setScore<item.sectionListDTO[sindex].sectionScore){
item.setScore=item.sectionListDTO[sindex].sectionScore+1
if(item.setScore<item.sectionVOList[sindex].sectionScore){
item.setScore=item.sectionVOList[sindex].sectionScore+1
}
},
//
checkScoreAll(item){
if(item.setScore<item.sectionListDTO[item.sectionListDTO.length-1].sectionScore){
item.setScore=item.sectionListDTO[item.sectionListDTO.length-1].sectionScore+1
if(item.setScore<item.sectionVOList[item.sectionVOList.length-1].sectionScore){
item.setScore=item.sectionVOList[item.sectionVOList.length-1].sectionScore+1
}
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
console.log(this.rulesList)
try{
this.rulesList.forEach(item => {
let index = item.sectionListDTO.findIndex(v=>(!v.rightValue||!v.sectionScore))
item.areaId = this.form.areaId
item.ruleType = this.form.ruleType
let index = item.sectionVOList.findIndex(v=>(!v.rightValue||!v.sectionScore))
if(index>-1){
this.$modal.msgError('请输入'+item.ruleName+'和得分');
throw new Error()
@ -469,22 +483,36 @@ export default {
if(this.allScore!=100){
this.$modal.msgError('供应商评分总分需要是100分!');
}else{
// addType(this.form).then(response => {
// this.$modal.msgSuccess("");
// this.open = false;
// this.getList();
// });
console.log(this.rulesList)
editSupplierRuleApi(this.rulesList).then(response => {
this.$modal.msgSuccess("保存成功");
this.open = false;
this.getList();
});
}
}
});
},
handleView(row){
// getType().then(response => {
// this.form = response.data;
this.histRow = row;
this.getList2()
},
/** 查询列表 */
getList2() {
let param = {
"pageNum": this.queryParams2.pageNum,
"pageSize": this.queryParams2.pageSize,
"supplierId": this.histRow.supplierId,
"areaIdList": [this.histRow.areaId],
}
this.loading = true;
supplierScoreHistApi(param).then(response => {
this.dialogTableData = response.rows;
this.total2 = Number(response.total);
this.openHistory = true;
// });
}
this.loading = false;
});
},
}
};
</script>