商品信息管理 权限问题

This commit is contained in:
shidongli 2022-11-14 15:22:41 +08:00
parent 67108d8e0c
commit 82ff8d771a
2 changed files with 50 additions and 39 deletions

View File

@ -8,7 +8,14 @@ export function goodsInfoList(query) {
params: query params: query
}) })
} }
//所属护理站
export function stationList(query) {
return request({
url: '/system/station/list',
method: 'get',
params: query
})
}
// 查询商品基本信息详细 // 查询商品基本信息详细
export function getGoodsInfo(id) { export function getGoodsInfo(id) {
return request({ return request({

View File

@ -42,7 +42,10 @@
</el-form-item> </el-form-item>
<el-form-item label="商品用途" prop="goodsPurpose"> <el-form-item label="商品用途" prop="goodsPurpose">
<el-select v-model="queryParams.goodsPurpose" placeholder="请选择商品用途"> <el-select
v-model="queryParams.goodsPurpose"
placeholder="请选择商品用途"
>
<el-option <el-option
v-for="item in goods" v-for="item in goods"
:key="item.value" :key="item.value"
@ -381,7 +384,7 @@
:visible.sync="innerVisible" :visible.sync="innerVisible"
width="1000px" width="1000px"
append-to-body append-to-body
:before-close="addcancel" :before-close="addcancel"
> >
<el-form <el-form
ref="queryForm" ref="queryForm"
@ -488,9 +491,9 @@ import {
goodsInfoList, goodsInfoList,
goodsCategory, goodsCategory,
editGoodsWhetherShelf, editGoodsWhetherShelf,
stationList
} from "@/api/system/OperateGoodsInfo"; } from "@/api/system/OperateGoodsInfo";
import editor from "@/components/Editor"; import editor from "@/components/Editor";
import { getListByUser } from "@/api/system/userlist.js";
import stationAcatar from "../stationAvatar/index.vue"; import stationAcatar from "../stationAvatar/index.vue";
import baseurl from "@/api/baseurl.js"; import baseurl from "@/api/baseurl.js";
@ -589,7 +592,7 @@ export default {
}, },
// //
form: { form: {
nurseStationId:null, nurseStationId: null,
}, },
// //
rules: { rules: {
@ -701,7 +704,7 @@ export default {
cancel() { cancel() {
console.log(this.form); console.log(this.form);
var obj = { pictureUrlList: [] }; var obj = { pictureUrlList: [] };
if (this.imgone!= this.form.goodsPictureUrl) { if (this.imgone != this.form.goodsPictureUrl) {
obj.pictureUrlList.push(this.form.goodsPictureUrl); obj.pictureUrlList.push(this.form.goodsPictureUrl);
} }
if (obj.pictureUrlList.length > 0) { if (obj.pictureUrlList.length > 0) {
@ -738,14 +741,14 @@ export default {
}, },
handleQuery2() { handleQuery2() {
// this.getListByUserquery.pageNum = 1; // this.getListByUserquery.pageNum = 1;
this.getList2(); this.info();
},
getList2(){
getListByUser(this.getListByUserquery).then((res) => {
this.total2 = res.total;
this.nurseStationlist = res.rows;
});
}, },
// getList2() {
// stationList(this.getListByUserquery).then((res) => {
// this.total2 = res.total;
// this.nurseStationlist = res.rows;
// });
// },
resetQuery2() { resetQuery2() {
this.resetForm("queryForm"); this.resetForm("queryForm");
(this.getListByUserquery = { (this.getListByUserquery = {
@ -799,19 +802,17 @@ export default {
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
if (this.nurseStationlist[0].isAdmin == '1') {
this.resetForm("queryForm"); this.resetForm("queryForm");
this.queryParams = { this.queryParams = {
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10,
} goodsName: null,
} else { goodsCategoryName: null,
this.queryParams.pageNum = 1; goodsPurpose: null,
this.queryParams.pageSize = 10
this.queryParams.goodsName = null
this.queryParams.goodsCategoryName = null
this.queryParams.goodsPurpose = null
} }
this.handleQuery(); this.handleQuery();
}, },
// //
@ -858,7 +859,7 @@ export default {
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
console.log(this.form); console.log(this.form);
console.log(this.goodDetailsLists); console.log(this.goodDetailsLists);
this.form.goodAttributeDetailsLists = []; this.form.goodAttributeDetailsLists = [];
this.form.goodDetailsLists = this.goodDetailsLists; this.form.goodDetailsLists = this.goodDetailsLists;
@ -879,7 +880,7 @@ export default {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.StationName = "请选择所属护理站"; this.StationName = "请选择所属护理站";
this.open = false; this.open = false;
this.getList(); this.getList();
}); });
} }
@ -956,17 +957,20 @@ export default {
console.log(this.form); console.log(this.form);
this.goodsCategorylist = res.rows; this.goodsCategorylist = res.rows;
}); });
getListByUser(this.getListByUserquery).then((res) => { stationList(this.getListByUserquery).then((res) => {
if (res.rows[0].isAdmin == "1") { this.nurseStationlist = res.rows;
this.nurseStationlist = res.rows; this.total2 = res.total;
this.total2 = res.total; console.log(res)
} else { // if (res.rows[0].isAdmin == "1") {
this.total2 = res.total; // this.nurseStationlist = res.rows;
this.nurseStationlist = res.rows; // this.total2 = res.total;
this.queryParams.nurseStationId = res.rows[0].id; // } else {
this.form.nurseStationId = res.rows[0].id; // this.total2 = res.total;
this.handleQuery(); // 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) { if (this.getListByUserquery.pageNum >= a) {
} else { } else {
this.getListByUserquery.pageNum++; this.getListByUserquery.pageNum++;
getListByUser(this.getListByUserquery).then((res) => { stationList(this.getListByUserquery).then((res) => {
res.rows.forEach((e) => { res.rows.forEach((e) => {
this.nurseStationlist.push(e); this.nurseStationlist.push(e);
}); });