供应商列表接口对接

This commit is contained in:
zzyuan 2025-07-01 14:43:10 +08:00
parent 77af2e00a7
commit aaf5ee94d7
2 changed files with 156 additions and 58 deletions

View File

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

View File

@ -84,12 +84,12 @@
<el-table-column label="地址" align="center" prop="address" :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"
<el-switch v-model="scope.row.status" active-value="1" inactive-value="2"
@change="handleStatusChange(scope.row)"
></el-switch>
</template>
</el-table-column>
<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" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
@ -219,8 +219,8 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="主要联系人手机号" prop="linkmanNumber">
<el-input v-model="form.linkmanNumber" placeholder="请输入主要联系人手机号" maxlength="30" clearable/>
<el-form-item label="主要联系人手机号" prop="linkmanPhone">
<el-input v-model="form.linkmanPhone" placeholder="请输入主要联系人手机号" maxlength="30" clearable/>
</el-form-item>
</el-col>
<el-col :span="12">
@ -370,12 +370,12 @@
</el-col>
<el-col :span="12">
<el-form-item label="证书编号">
<el-input v-model="item.qualificationNum" placeholder="请输入供应商全称" maxlength="30" clearable/>
<el-input v-model="item.qualificationCode" 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"
<el-date-picker v-model="item.expirationDate"
type="date" align="right" clearable
format="yyyy-MM-dd" value-format="yyyy-MM-dd"
style="width: 100%">
@ -405,7 +405,7 @@
</div>
</el-row>
</el-tab-pane>
<el-tab-pane label="附件管理" name="attachment">
<!-- <el-tab-pane label="附件管理" name="attachment">
<el-row style="height: 550px;overflow-y: auto;">
<el-col :span="12">
<el-form-item label="附件上传">
@ -430,7 +430,7 @@
</el-tab-pane>
<el-tab-pane label="账户通知配置" name="notice">
</el-tab-pane>
</el-tab-pane> -->
</el-tabs>
</el-form>
@ -458,7 +458,7 @@
import { systemAreaTreeApi } from "@/api/base/stall";
import { systemMaterialTreeApi } from "@/api/dish/material";
import { imgUpLoadTwo } from '@/api/system/upload'
// import { supplierPageApi,addSupplierApi, editSupplierApi, removeSupplierApi, editStatusSupplierApi } from "@/api/supplierManage/index";
import { supplierPageApi,addSupplierApi, editSupplierApi, removeSupplierApi, editStatusSupplierApi } from "@/api/foodManage/supplierManage";
export default {
name: "",
@ -506,7 +506,7 @@ export default {
linkman: [
{ required: true, message: "主要联系人不能为空", trigger: "blur" }
],
linkmanNumber: [
linkmanPhone: [
{ required: true, message: "主要联系人手机号不能为空", trigger: "blur" }
],
areaId: [
@ -524,37 +524,37 @@ export default {
idCardImgFNameList: [],//
mainQualificationList:[
// {
// "qualificationNum": "",
// "qualificationCode": "",
// "qualificationName": "",
// "validity": "",
// "expirationDate": "",
// "imgUrl": "",
// "mainFlag": 1,
// },
// {
// "qualificationNum": "",
// "qualificationCode": "",
// "qualificationName": "ISO9001",
// "validity": "",
// "expirationDate": "",
// "imgUrl": "",
// "mainFlag": 1,
// },
// {
// "qualificationNum": "",
// "qualificationCode": "",
// "qualificationName": "",
// "validity": "",
// "expirationDate": "",
// "imgUrl": "",
// "mainFlag": 1,
// },
// {
// "qualificationNum": "",
// "qualificationCode": "",
// "qualificationName": "",
// "validity": "",
// "expirationDate": "",
// "imgUrl": "",
// "mainFlag": 1,
// },
// {
// "qualificationNum": "",
// "qualificationCode": "",
// "qualificationName": "HACCP",
// "validity": "",
// "expirationDate": "",
// "imgUrl": "",
// "mainFlag": 1,
// }
@ -583,9 +583,7 @@ export default {
methods: {
//
getTypeTreeData() {
let param = {
// categoryType:1,
}
let param = {}
systemMaterialTreeApi(param).then((response) => {
this.treeTypeOptions = response.data;
});
@ -618,22 +616,26 @@ export default {
"linkman": this.queryParams.linkman,
"status": this.queryParams.status
}
// supplierPageApi(param).then(response => {
// this.tableListData = response.rows;
// this.total = Number(response.total);
// this.loading = false;
// });
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'
// })
let text = row.status === '1' ? '启用' : '停用'
let param = {
supplierId:row.supplierId,
status:row.status
}
this.$modal.confirm('确认要"' + text + '吗?').then(function() {
return editStatusSupplierApi(param)
}).then(() => {
this.$modal.msgSuccess(text + '成功')
}).catch(function() {
row.status = row.status === '1' ? '2' : '1'
})
},
/** 新增按钮操作 */
handleAdd() {
@ -686,41 +688,46 @@ export default {
this.idCardImgFNameList=[]
this.mainQualificationList=[
{
"qualificationNum": "",
"qualificationCode": "",
"qualificationName": "营业执照",
"validity": "",
"qualificationType": 1,
"expirationDate": "",
"imgUrl": "",
fileList:[],
"mainFlag": 1,
},
{
"qualificationNum": "",
"qualificationCode": "",
"qualificationName": "ISO9001国际质量体系认证",
"validity": "",
"qualificationType": 2,
"expirationDate": "",
"imgUrl": "",
fileList:[],
"mainFlag": 1,
},
{
"qualificationNum": "",
"qualificationCode": "",
"qualificationName": "食品经营许可证",
"validity": "",
"qualificationType": 3,
"expirationDate": "",
"imgUrl": "",
fileList:[],
"mainFlag": 1,
},
{
"qualificationNum": "",
"qualificationCode": "",
"qualificationName": "烟草经营许可证",
"validity": "",
"qualificationType": 4,
"expirationDate": "",
"imgUrl": "",
fileList:[],
"mainFlag": 1,
},
{
"qualificationNum": "",
"qualificationCode": "",
"qualificationName": "HACCP认证",
"validity": "",
"qualificationType": 5,
"expirationDate": "",
"imgUrl": "",
fileList:[],
"mainFlag": 1,
@ -753,17 +760,17 @@ export default {
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();
// });
editSupplierApi(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
// addSupplierApi(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();
});
}
}
});
@ -771,7 +778,7 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
this.$modal.confirm('是否确认删除数据项?').then(function() {
// return removeSupplierApi({supplierId:row.supplierId});
return removeSupplierApi({supplierId:[row.supplierId]});
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");