供应商管理

This commit is contained in:
zzyuan 2025-05-26 09:45:33 +08:00
parent d412d3a997
commit f2dbc2f485
2 changed files with 735 additions and 227 deletions

View File

@ -1,12 +1,65 @@
import request from '@/utils/request'
// 供应商列表
export function supplierPageApi(data) {
return request({
url: '/smart-canteen/supplier_manage/list',
method: 'get',
headers: {
"merchant-id":"378915229716713472",
},
params: data
})
}
// 新增供应商
export function addSupplierApi(data) {
return request({
url: '/smart-canteen/supplier_manage/add',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 修改供应商
export function editSupplierApi(data) {
return request({
url: '/smart-canteen/supplier_manage/edit',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 删除供应商
export function removeSupplierApi(data) {
return request({
url: '/smart-canteen/supplier_manage/remove',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}
// 变更供应商状态
export function editStatusSupplierApi(data) {
return request({
url: '/smart-canteen/supplier_manage/edit/status',
method: 'post',
headers: {
"merchant-id":"378915229716713472",
},
data: data
})
}

View File

@ -82,7 +82,13 @@
<el-table-column label="食品经营许可证编号" align="center" prop="" :show-overflow-tooltip="true" width="180"/>
<el-table-column label="供应类别" align="center" prop="" :show-overflow-tooltip="true" width="150"/>
<el-table-column label="地址" align="center" prop="address" :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="status" :show-overflow-tooltip="true" width="120">
<template slot-scope="scope">
<el-switch v-model="scope.row.status" active-value="0" inactive-value="1"
@change="handleStatusChange(scope.row)"
></el-switch>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
@ -112,7 +118,9 @@
<!-- 添加或修改参数配置对话框 -->
<el-dialog :title="title+'供应商'" :visible.sync="open" width="1000px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="140px">
<el-row>
<el-tabs v-model="activeName">
<el-tab-pane label="基础信息" name="baseInfo">
<el-row style="height: 550px;overflow-y: auto;">
<el-col :span="12">
<el-form-item label="供应商全称" prop="supplierName">
<el-input v-model="form.supplierName" placeholder="请输入供应商全称" maxlength="30" clearable/>
@ -143,6 +151,36 @@
<el-input v-model="form.address" placeholder="请输入详细地址" maxlength="30" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所属区域" prop="areaId">
<el-cascader v-model="form.areaId"
:options="treeOptions" :filterable="true" style="width: 100%;" :show-all-levels="false"
:props="{
emitPath: false,// falseid
checkStrictly: false,//
value:'id',label:'label'
}" clearable>
</el-cascader>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="主要供应类别" prop="categoryIdList">
<el-cascader
v-model="form.categoryIdList"
:options="treeTypeOptions"
:props="{
multiple:true,
emitPath: false,// falseid
checkStrictly: false,//
value:'id',label:'categoryName'
}"
collapse-tags
:show-all-levels="false"
placeholder="请选择供应类别"
clearable style="width: 100%;"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="开户行" prop="openingBank">
<el-input v-model="form.openingBank" placeholder="请输入开户行" maxlength="30" clearable/>
@ -215,54 +253,212 @@
<el-input v-model="form.standbyEmail" placeholder="请输入邮箱" maxlength="30" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所属区域" prop="areaId">
<el-cascader v-model="form.areaId"
:options="treeOptions" :filterable="true" style="width: 100%;" :show-all-levels="false"
:props="{
emitPath: false,// falseid
checkStrictly: false,//
value:'id',label:'label'
}" clearable>
</el-cascader>
<el-form-item label="企业法人身份证复印件(正面)" prop="">
<el-upload
:http-request="(obj) => imgUpLoad(obj, 'fileUrl')"
action="#"
:limit="1"
:show-file-list="true"
:file-list="fileList1"
list-type="picture-card"
accept=".png, .jpg, .jpeg"
:class="{ disabled: uploadDisabled }"
:on-preview="handlePictureCardPreview"
:on-remove="handleRemove"
>
<i
class="el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="主要供应类别" prop="categoryIdList">
<el-cascader
v-model="form.categoryIdList"
:options="treeTypeOptions"
:props="{
multiple:true,
emitPath: false,// falseid
checkStrictly: false,//
value:'id',label:'categoryName'
}"
collapse-tags
:show-all-levels="false"
placeholder="请选择供应类别"
clearable style="width: 100%;"
/>
<el-form-item label="企业法人身份证复印件(反面)" prop="">
<el-upload
:http-request="(obj) => imgUpLoad2(obj, 'fileUrl')"
action="#"
:limit="1"
:show-file-list="true"
:file-list="fileList2"
list-type="picture-card"
accept=".png, .jpg, .jpeg"
:class="{ disabled: uploadDisabled2 }"
:on-preview="handlePictureCardPreview"
:on-remove="handleRemove2"
>
<i
class="el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
</el-form-item>
</el-col>
</el-row>
</el-tab-pane>
<el-tab-pane label="主要经营情况" name="baseForm">
<el-row style="height: 550px;overflow-y: auto;">
<el-col :span="12">
<el-form-item label="注册资金(万元)" prop="registFund">
<el-input v-model.number="form.registFund" placeholder="请输入注册资金" maxlength="30" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="成立时间" prop="establishDate">
<el-date-picker v-model="form.establishDate"
type="date" align="right" clearable
format="yyyy-MM-dd" value-format="yyyy-MM-dd"
style="width: 100%">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="职工人数" prop="workersNum">
<el-input v-model.number="form.workersNum" placeholder="请输入供应商电话" maxlength="30" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="目前服务的客户数量" prop="clientNum">
<el-input v-model.number="form.clientNum" placeholder="请输入目前服务的客户数量" maxlength="30" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="去年度营业收入" prop="lastYearOperatingIncome">
<el-input v-model="form.lastYearOperatingIncome" placeholder="请输入去年度营业收入" maxlength="30" clearable
@input="(v)=>(form.lastYearOperatingIncome=v.replace(/[^\d.]/g,''))"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="前年度营业收入" prop="beforeYearOperatingIncome">
<el-input v-model="form.beforeYearOperatingIncome" placeholder="请输入前年度营业收入" maxlength="30" clearable
@input="(v)=>(form.beforeYearOperatingIncome=v.replace(/[^\d.]/g,''))"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="营业范围(工商信息)" prop="businessScope">
<el-input v-model="form.businessScope" placeholder="请输入营业范围" type="textarea" row="3" maxlength="150" clearable/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="前五大客户" prop="topFiveClient">
<el-input v-model="form.topFiveClient" placeholder="请输入前五大客户" type="textarea" row="3" maxlength="150" clearable/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="前五大供应商" prop="topFiveSupplier">
<el-input v-model="form.topFiveSupplier" placeholder="请输入前五大供应商" type="textarea" row="3" maxlength="150" clearable/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="公司简介" prop="companyIntroduction">
<el-input v-model="form.companyIntroduction" placeholder="请输入公司简介" type="textarea" row="3" maxlength="150" clearable/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="主要优势" prop="mainAdvantage">
<el-input v-model="form.mainAdvantage" placeholder="请输入主要优势" maxlength="50" clearable/>
</el-form-item>
</el-col>
</el-row>
</el-tab-pane>
<el-tab-pane label="主要资质" name="qualification">
<el-row style="height: 550px;overflow-y: auto;">
<div v-for="(item,index) in mainQualificationList" :key="index">
<el-col :span="24">
<div>{{ item.qualificationName }}</div>
</el-col>
<el-col :span="12">
<el-form-item label="证书编号">
<el-input v-model="item.qualificationNum" placeholder="请输入供应商全称" maxlength="30" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="有效期" prop="">
<el-date-picker v-model="item.validity"
type="date" align="right" clearable
format="yyyy-MM-dd" value-format="yyyy-MM-dd"
style="width: 100%">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="item.qualificationName+'照片'" prop="">
<el-upload
:http-request="(obj) => imgUpLoadMain(obj,index)"
action="#"
:limit="1"
:show-file-list="true"
:file-list="item.fileList"
list-type="picture-card"
accept=".png, .jpg, .jpeg"
:class="{ disabled: item.imgUrl!=''}"
:on-preview="handlePictureCardPreview"
:on-remove="handleRemoveMain(index)"
>
<i
class="el-icon-plus avatar-uploader-icon"
></i>
</el-upload>
</el-form-item>
</el-col>
</div>
</el-row>
</el-tab-pane>
<el-tab-pane label="附件管理" name="attachment">
<el-row style="height: 550px;overflow-y: auto;">
<el-col :span="12">
<el-form-item label="附件上传">
<el-upload
ref="upload"
:http-request="fileUpLoad"
action="#"
accept=".xlsx, .xls"
:show-file-list="true"
:file-list="fileList3"
:on-remove="handleRemoveFile"
>
<el-button
type="text"
size="mini"
>上传
</el-button>
</el-upload>
</el-form-item>
</el-col>
</el-row>
</el-tab-pane>
<el-tab-pane label="账户通知配置" name="notice">
</el-tab-pane>
</el-tabs>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<el-dialog
:visible.sync="dialogVisible"
title="预览"
width="800"
append-to-body
>
<img
:src="dialogImageUrl"
style="display: block; max-width: 100%; margin: 0 auto"
/>
</el-dialog>
</div>
</template>
<script>
import { systemAreaTreeApi } from "@/api/base/stall";
import { systemMaterialTreeApi } from "@/api/dish/material";
// import { getPageCanteenApi } from "@/api/base/canteen";
import { imgUpLoadTwo } from '@/api/system/upload'
import { supplierPageApi,addSupplierApi, editSupplierApi, removeSupplierApi, editStatusSupplierApi } from "@/api/supplierManage/index";
export default {
name: "",
@ -299,10 +495,7 @@ export default {
},
treeTypeOptions:[],//
treeOptions:[],//
activeName:'baseInfo',
//
form: {},
//
@ -316,18 +509,77 @@ export default {
linkmanNumber: [
{ required: true, message: "主要联系人手机号不能为空", trigger: "blur" }
],
areaId: [
{ required: true, message: "所属区域不能为空", trigger: "change" }
],
categoryIdList: [
{ required: true, message: "主要供应类别不能为空", trigger: "change" }
]
}
},
fileList1: [],
idCardImgZ: [],//
idCardImgZNameList: [],//
fileList2: [],
idCardImgF: [],//
idCardImgFNameList: [],//
mainQualificationList:[
// {
// "qualificationNum": "",
// "qualificationName": "",
// "validity": "",
// "imgUrl": "",
// "mainFlag": 1,
// },
// {
// "qualificationNum": "",
// "qualificationName": "ISO9001",
// "validity": "",
// "imgUrl": "",
// "mainFlag": 1,
// },
// {
// "qualificationNum": "",
// "qualificationName": "",
// "validity": "",
// "imgUrl": "",
// "mainFlag": 1,
// },
// {
// "qualificationNum": "",
// "qualificationName": "",
// "validity": "",
// "imgUrl": "",
// "mainFlag": 1,
// },
// {
// "qualificationNum": "",
// "qualificationName": "HACCP",
// "validity": "",
// "imgUrl": "",
// "mainFlag": 1,
// }
],
fileList3:[],
attachmentList:[],
dialogVisible:false,//
dialogImageUrl:"",//
};
},
computed: {
//1
uploadDisabled() {
return this.idCardImgZ.length > 0
},
uploadDisabled2() {
return this.idCardImgF.length > 0
},
},
created() {
this.getTypeTreeData();
this.getTreeData();
// this.getList();
this.getList();
},
methods: {
//
getTypeTreeData() {
@ -366,11 +618,22 @@ export default {
"linkman": this.queryParams.linkman,
"status": this.queryParams.status
}
// getPageCanteenApi(param).then(response => {
// this.tableListData = response.rows;
// this.total = Number(response.total);
supplierPageApi(param).then(response => {
this.tableListData = response.rows;
this.total = Number(response.total);
this.loading = false;
// });
});
},
//
handleStatusChange(row) {
// let text = row.status === '0' ? '' : ''
// this.$modal.confirm('"' + text + '').then(function() {
// return updateSysIpWhitelistStatus(row.id, row.status)
// }).then(() => {
// this.$modal.msgSuccess(text + '')
// }).catch(function() {
// row.status = row.status === '0' ? '1' : '0'
// })
},
/** 新增按钮操作 */
handleAdd() {
@ -381,12 +644,31 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
// const dictId = row.dictId || this.ids
// getType(dictId).then(response => {
// this.form = response.data;
if(row.idCardImgZ){
this.fileList1=[{url:row.idCardImgZ}]
this.idCardImgZ=[row.idCardImgZ]
}else{
this.fileList1=[]
this.idCardImgZ=[]
}
if(row.idCardImgF){
this.fileList2=[{url:row.idCardImgF}]
this.idCardImgF=[row.idCardImgF]
}else{
this.fileList2=[]
this.idCardImgF=[]
}
this.form = Object.assign({}, row)
this.form.mainQualificationList.forEach(item=>{
if(item.imgUrl&&item.imgUrl!=''){
item.fileList = [{url:item.imgUrl}]
}else{
item.fileList=[]
}
})
this.mainQualificationList = this.form.mainQualificationList;
this.open = true;
this.title = "修改";
// });
},
//
cancel() {
@ -395,39 +677,212 @@ export default {
},
//
reset() {
this.form = {};
this.activeName='baseInfo'
this.fileList1=[]
this.idCardImgZ=[]
this.idCardImgZNameList=[]
this.fileList2=[]
this.idCardImgF=[]
this.idCardImgFNameList=[]
this.mainQualificationList=[
{
"qualificationNum": "",
"qualificationName": "营业执照",
"validity": "",
"imgUrl": "",
fileList:[],
"mainFlag": 1,
},
{
"qualificationNum": "",
"qualificationName": "ISO9001国际质量体系认证",
"validity": "",
"imgUrl": "",
fileList:[],
"mainFlag": 1,
},
{
"qualificationNum": "",
"qualificationName": "食品经营许可证",
"validity": "",
"imgUrl": "",
fileList:[],
"mainFlag": 1,
},
{
"qualificationNum": "",
"qualificationName": "烟草经营许可证",
"validity": "",
"imgUrl": "",
fileList:[],
"mainFlag": 1,
},
{
"qualificationNum": "",
"qualificationName": "HACCP认证",
"validity": "",
"imgUrl": "",
fileList:[],
"mainFlag": 1,
}
]
this.fileList3=[]
this.attachmentList=[]
this.form = {
mainQualificationList:[],
otherQualificationList:[],
attachmentList:[],
deliverVOList:[]
};
this.resetForm("form");
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.dictId != undefined) {
// updateType(this.form).then(response => {
// this.$modal.msgSuccess("");
// this.open = false;
// this.getList();
// });
if(this.idCardImgZ.length>0){
this.form.idCardImgZ = this.idCardImgZ[0]
}else{
this.form.idCardImgZ = null
}
if(this.idCardImgF.length>0){
this.form.idCardImgF = this.idCardImgF[0]
}else{
this.form.idCardImgF = null
}
this.form.mainQualificationList = this.mainQualificationList
this.form.attachmentList = this.attachmentList
if (this.form.supplierId != undefined) {
editSupplierApi(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
// addType(this.form).then(response => {
// this.$modal.msgSuccess("");
// this.open = false;
// this.getList();
// });
addSupplierApi(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const dictIds = row.dictId || this.ids;
this.$modal.confirm('是否确认删除数据项?').then(function() {
// return delType(dictIds);
return removeSupplierApi({supplierId:row.supplierId});
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
//
imgUpLoad(param, name, index) {
param.type = 'canteen'
imgUpLoadTwo(param).then((res) => {
if (res.code == 200) {
this.idCardImgZ.push(res.data.url)
this.idCardImgZNameList.push(res.data.name)
} else {
this.$modal.msgError(res.msg)
}
})
.catch((error) => {
this.$modal.msgError(error)
})
},
handleRemove(file, fileList) {
let sum = 0
this.idCardImgZNameList.forEach((item, index) => {
if (item == file.name) {
sum = index
}
})
this.idCardImgZ.splice(sum, 1)
this.idCardImgZNameList.splice(sum, 1)
},
imgUpLoad2(param, name, index) {
param.type = 'canteen'
imgUpLoadTwo(param).then((res) => {
if (res.code == 200) {
this.idCardImgF.push(res.data.url)
this.idCardImgFNameList.push(res.data.name)
} else {
this.$modal.msgError(res.msg)
}
})
.catch((error) => {
this.$modal.msgError(error)
})
},
handleRemove2(file, fileList) {
let sum = 0
this.idCardImgFNameList.forEach((item, index) => {
if (item == file.name) {
sum = index
}
})
this.idCardImgF.splice(sum, 1)
this.idCardImgFNameList.splice(sum, 1)
},
//
imgUpLoadMain(param,index){
param.type = 'canteen'
imgUpLoadTwo(param).then((res) => {
if (res.code == 200) {
console.log(index)
this.mainQualificationList[index].imgUrl = res.data.url
} else {
this.$modal.msgError(res.msg)
}
})
.catch((error) => {
this.$modal.msgError(error)
})
},
handleRemoveMain(index) {
this.mainQualificationList[index].imgUrl="";
},
//
fileUpLoad(param){
param.type = 'canteen'
imgUpLoadTwo(param).then((res) => {
if (res.code == 200) {
this.attachmentList.push(res.data)
console.log(this.attachmentList)
} else {
this.$modal.msgError(res.msg);
}
}).catch((error) => {
this.$modal.msgError(error)
})
},
handleRemoveFile(file, fileList){
let sum = 0
this.attachmentList.forEach((item, index) => {
if (item.name == file.name) {
sum = index
}
})
this.attachmentList.splice(sum, 1)
},
//
handlePictureCardPreview(file) {
console.log(file)
this.dialogImageUrl = file.url
this.dialogVisible = true
}
}
};
</script>
<style lang="scss" scoped>
//css
::v-deep.disabled {
.el-upload--picture-card {
display: none;
}
}
</style>