diff --git a/src/api/system/OperateGoodsInfo.js b/src/api/system/OperateGoodsInfo.js index c648a1b..9585cec 100644 --- a/src/api/system/OperateGoodsInfo.js +++ b/src/api/system/OperateGoodsInfo.js @@ -8,7 +8,14 @@ export function goodsInfoList(query) { params: query }) } - +//所属护理站 +export function stationList(query) { + return request({ + url: '/system/station/list', + method: 'get', + params: query + }) +} // 查询商品基本信息详细 export function getGoodsInfo(id) { return request({ diff --git a/src/views/system/OperateGoodsInfo/index.vue b/src/views/system/OperateGoodsInfo/index.vue index 4abc841..a1acde2 100644 --- a/src/views/system/OperateGoodsInfo/index.vue +++ b/src/views/system/OperateGoodsInfo/index.vue @@ -42,7 +42,10 @@ - + 0) { @@ -738,14 +741,14 @@ export default { }, handleQuery2() { // this.getListByUserquery.pageNum = 1; - this.getList2(); - }, - getList2(){ - getListByUser(this.getListByUserquery).then((res) => { - this.total2 = res.total; - this.nurseStationlist = res.rows; - }); + this.info(); }, + // getList2() { + // stationList(this.getListByUserquery).then((res) => { + // this.total2 = res.total; + // this.nurseStationlist = res.rows; + // }); + // }, resetQuery2() { this.resetForm("queryForm"); (this.getListByUserquery = { @@ -799,19 +802,17 @@ export default { }, /** 重置按钮操作 */ resetQuery() { - if (this.nurseStationlist[0].isAdmin == '1') { - this.resetForm("queryForm"); - this.queryParams = { - pageNum: 1, - pageSize: 10 - } - } else { - this.queryParams.pageNum = 1; - this.queryParams.pageSize = 10 - this.queryParams.goodsName = null - this.queryParams.goodsCategoryName = null - this.queryParams.goodsPurpose = null + + this.resetForm("queryForm"); + this.queryParams = { + pageNum: 1, + pageSize: 10, + goodsName: null, + goodsCategoryName: null, + goodsPurpose: null, } + + this.handleQuery(); }, // 多选框选中数据 @@ -858,7 +859,7 @@ export default { /** 提交按钮 */ submitForm() { - console.log(this.form); + console.log(this.form); console.log(this.goodDetailsLists); this.form.goodAttributeDetailsLists = []; this.form.goodDetailsLists = this.goodDetailsLists; @@ -879,7 +880,7 @@ export default { this.$modal.msgSuccess("新增成功"); this.StationName = "请选择所属护理站"; - this.open = false; + this.open = false; this.getList(); }); } @@ -956,17 +957,20 @@ export default { console.log(this.form); this.goodsCategorylist = res.rows; }); - getListByUser(this.getListByUserquery).then((res) => { - if (res.rows[0].isAdmin == "1") { - this.nurseStationlist = res.rows; - this.total2 = res.total; - } else { - this.total2 = res.total; - this.nurseStationlist = res.rows; - this.queryParams.nurseStationId = res.rows[0].id; - this.form.nurseStationId = res.rows[0].id; - this.handleQuery(); - } + stationList(this.getListByUserquery).then((res) => { + this.nurseStationlist = res.rows; + this.total2 = res.total; + console.log(res) + // if (res.rows[0].isAdmin == "1") { + // this.nurseStationlist = res.rows; + // this.total2 = res.total; + // } else { + // this.total2 = res.total; + // this.nurseStationlist = res.rows; + // this.queryParams.nurseStationId = res.rows[0].id; + // this.form.nurseStationId = res.rows[0].id; + // this.handleQuery(); + // } }); }, //滑动下拉框 @@ -977,7 +981,7 @@ export default { if (this.getListByUserquery.pageNum >= a) { } else { this.getListByUserquery.pageNum++; - getListByUser(this.getListByUserquery).then((res) => { + stationList(this.getListByUserquery).then((res) => { res.rows.forEach((e) => { this.nurseStationlist.push(e); });