供应商评分

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

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