This commit is contained in:
曹辉 2023-03-28 16:06:04 +08:00
parent 8da6c547cf
commit 6cc2964f69
2 changed files with 43 additions and 3 deletions

View File

@ -68,3 +68,9 @@ export function updatePicture(data) {
data: data data: data
}) })
} }
export function updateShelfStatus(id, shelfStatus) {
return request({
url: `/system/stationItem/updateShelfStatus?id=${id}&shelfStatus=${shelfStatus}`,
method: 'post',
})
}

View File

@ -9,8 +9,7 @@
label-width="110px" label-width="110px"
> >
<el-form-item label="护理站名称" prop="nurseStationId" label-width="100px"> <el-form-item label="护理站名称" prop="nurseStationId" label-width="100px">
<el-select v-model="queryParams.nurseStationId" placeholder="请选择护理站" <el-select v-model="queryParams.nurseStationId" placeholder="请选择护理站" @change="handleQuery">
@change="handleQuery">
<el-option <el-option
v-for="item in handstationlist" v-for="item in handstationlist"
:key="item.id" :key="item.id"
@ -112,6 +111,16 @@
<el-table-column label="护理项目编号" align="center" prop="nurseItemCode" /> <el-table-column label="护理项目编号" align="center" prop="nurseItemCode" />
<el-table-column label="护理项目名称" align="center" prop="nurseItemName" /> <el-table-column label="护理项目名称" align="center" prop="nurseItemName" />
<el-table-column label="护理项目分类名称" align="center" prop="classifyName" /> <el-table-column label="护理项目分类名称" align="center" prop="classifyName" />
<el-table-column label="上架状态" align="center" prop="whetherShelf">
<template slot-scope="scope">
<el-switch
v-model="scope.row.shelfStatus"
active-color="#13ce66"
inactive-color="#ff4949"
@change="upwhetherShelf(scope.row)"
></el-switch>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" /> <el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="创建人" align="center" prop="createBy" /> <el-table-column label="创建人" align="center" prop="createBy" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
@ -582,7 +591,8 @@ import {
delNurseItem, delNurseItem,
addNurseItem, addNurseItem,
updateNurseItem, updateNurseItem,
updatePicture updatePicture,
updateShelfStatus
} from "@/api/system/nurseItem"; } from "@/api/system/nurseItem";
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
import { getListByUser } from "@/api/system/userlist.js"; import { getListByUser } from "@/api/system/userlist.js";
@ -764,6 +774,23 @@ export default {
this.classifylistInfo(); this.classifylistInfo();
}, },
methods: { methods: {
//
upwhetherShelf(row) {
let shelfStatus = null;
if (row.shelfStatus == false) {
shelfStatus = "NOT_SHELF";
} else if (row.shelfStatus == true) {
shelfStatus = "SHELF";
}
updateShelfStatus(row.id, shelfStatus).then(res => {
if (row.shelfStatus == false) {
this.$modal.msgSuccess("已修改上架状态为未上架");
} else {
this.$modal.msgSuccess("已修改上架状态为上架");
}
this.getList();
});
},
//// //list //// //list
// //
clickClassifyshow() { clickClassifyshow() {
@ -934,6 +961,13 @@ export default {
getList() { getList() {
this.loading = true; this.loading = true;
list(this.queryParams).then(response => { list(this.queryParams).then(response => {
response.rows.forEach(e => {
if (e.shelfStatus == "SHELF") {
e.shelfStatus = true;
} else {
e.shelfStatus = false;
}
});
this.nurseItemList = response.rows; this.nurseItemList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;