diff --git a/src/api/foodManage/supplierManage.js b/src/api/foodManage/supplierManage.js index e69de29b..6af20815 100644 --- a/src/api/foodManage/supplierManage.js +++ b/src/api/foodManage/supplierManage.js @@ -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 + }) +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/foodManage/supplierManage/supplierList/index.vue b/src/views/foodManage/supplierManage/supplierList/index.vue index 93f3767e..48b9e00a 100644 --- a/src/views/foodManage/supplierManage/supplierList/index.vue +++ b/src/views/foodManage/supplierManage/supplierList/index.vue @@ -84,12 +84,12 @@ - - + - - + + @@ -364,18 +364,18 @@ - + {{ item.qualificationName }} - + - @@ -405,7 +405,7 @@ - + @@ -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("删除成功");