diff --git a/fuintAdmin/src/api/convenienceStore/supplier.js b/fuintAdmin/src/api/convenienceStore/supplier.js index 953833f2b..b3d7e36da 100644 --- a/fuintAdmin/src/api/convenienceStore/supplier.js +++ b/fuintAdmin/src/api/convenienceStore/supplier.js @@ -9,6 +9,15 @@ export function listSupplier(query) { }) } +// 查询供应商列表 +export function listSuppliers(query) { + return request({ + url: '/business/convenience/supplier/lists', + method: 'get', + params: query + }) +} + // 查询供应商详细 export function getSupplier(id) { return request({ diff --git a/fuintAdmin/src/views/convenienceStore/goodsFile.vue b/fuintAdmin/src/views/convenienceStore/goodsFile.vue index a92177301..bbbd5cf19 100644 --- a/fuintAdmin/src/views/convenienceStore/goodsFile.vue +++ b/fuintAdmin/src/views/convenienceStore/goodsFile.vue @@ -205,7 +205,6 @@ v-model="form.cvsGoodId" placeholder="全部" clearable - disabled style="width: 300px" > @@ -282,32 +281,30 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + @@ -348,7 +345,7 @@ import {cvsGoodsAll, cvsGoodsTree, selectTree} from "@/api/convenienceStore/goods"; -import {addSupplier, getSupplier, listSupplier} from "@/api/convenienceStore/supplier"; +import {addSupplier, listSuppliers} from "@/api/convenienceStore/supplier"; import { addLJGoods, createGoodsNo, @@ -466,6 +463,16 @@ export default { computed:{ }, methods:{ + // 修改供应商 + changeSupplier(val){ + if (val){ + listSuppliers({ifDelete:'0'}).then(response => { + this.supplierList = response.data + }) + }else { + this.getSuppilers(); + } + }, // 模糊查询商品信息 querySearch(queryString, cb) { let _this = this; @@ -493,7 +500,7 @@ export default { }, addSupplier(val){ // console.log(val,222) - addSupplier({name:val,remark:"添加商品自动添加"}).then(res => { + addSupplier({name:val,remark:"添加商品自动添加",ifDelete:'0'}).then(res => { // console.log(res) if (res.data==1){ this.$modal.msgSuccess("已为您自动添加此供应商") @@ -590,8 +597,8 @@ export default { }); }, getSuppilers(val){ - listSupplier().then(response => { - this.supplierList = response.data.records + listSuppliers().then(response => { + this.supplierList = response.data if (val){ this.supplierList.forEach(item => { if (item.name = val){ @@ -689,6 +696,7 @@ export default { // } // } // }) + console.log(this.supplierList) this.supplierList.forEach(item => { if (item.id == response.data.supplierId){ this.supplier = item.name diff --git a/fuintAdmin/src/views/convenienceStore/index.vue b/fuintAdmin/src/views/convenienceStore/index.vue index a20b99ebc..d5a92bddd 100644 --- a/fuintAdmin/src/views/convenienceStore/index.vue +++ b/fuintAdmin/src/views/convenienceStore/index.vue @@ -280,7 +280,7 @@ import {getAccount} from "@/api/system/account"; import {addLJGoods, createGoodsNo, queryGoodsVoList, queryLJGoods, scanCode} from "@/api/convenienceStore/ljgoods"; import pinyin from "js-pinyin"; import {getSysConfig} from "@/api/staff/user/sysconfig"; -import {addSupplier, listSupplier} from "@/api/convenienceStore/supplier"; +import {addSupplier, listSuppliers} from "@/api/convenienceStore/supplier"; export default { dicts:['zhzt','yes_or_no'], data() { @@ -385,7 +385,7 @@ export default { { required: true, message: "请选择是否能使用积分抵扣", trigger: "blur" }, ], supplierId: [ - { required: true, message: "请选择供应商", trigger: "change" }, + { required: true, message: "请选择供应商", trigger: "blur" }, ], status: [ { required: true, message: "请选择商品状态", trigger: "blur" }, @@ -403,12 +403,12 @@ export default { }, methods: { getSuppilers(val){ - listSupplier().then(response => { - this.supplierList = response.data.records + listSuppliers({ifDelete:'0'}).then(response => { + this.supplierList = response.data if (val){ this.supplierList.forEach(item => { - if (item.name = val){ - this.form.supplierId = item.id + if (item.name == val){ + this.form1.supplierId = item.id } }) } @@ -469,24 +469,25 @@ export default { selectSupplier(data){ this.supplier = data.name; this.form1.supplierId = data.id - this.$forceUpdate() + // this.$forceUpdate() }, addSupplier(val){ // console.log(val,222) if (!val){ return; } - addSupplier({name:val,remark:"添加商品自动添加"}).then(res => { + addSupplier({name:val,remark:"添加商品自动添加",ifDelete:'0'}).then(async res => { // console.log(res) - if (res.data==1){ + if (res.data == 1) { this.supplier = val; this.$modal.msgSuccess("已为您自动添加此供应商") - this.getSuppilers(val) + await this.getSuppilers(val) } }) }, // 提交按钮 submitForm1: function() { + console.log(this.form1.supplierId,8274) this.$refs["form1"].validate(valid => { if (valid) { if (this.form1) { @@ -669,7 +670,8 @@ export default { // 添加商品信息 addGoods(data){ this.openGoods = true - this.form1.cvsGoodId = data.id + this.form1 = {status:'jy', canUsePoint:'no', stock:0, sort:0, buyingPrice:0, retailPrice:0, memberPrice:0, cvsGoodId:data.id} + // this.form1.cvsGoodId = data.id this.supplier = "" this.title = "添加商品信息" }, diff --git a/fuintAdmin/src/views/convenienceStore/stockStatistic.vue b/fuintAdmin/src/views/convenienceStore/stockStatistic.vue index 4efd547f6..5bf05d322 100644 --- a/fuintAdmin/src/views/convenienceStore/stockStatistic.vue +++ b/fuintAdmin/src/views/convenienceStore/stockStatistic.vue @@ -4,18 +4,18 @@ - - - - - - - - - + + + + + + + - + - + + + + + + + + @@ -227,8 +229,8 @@