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
})
}
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"
>
<el-form-item label="护理站名称" prop="nurseStationId" label-width="100px">
<el-select v-model="queryParams.nurseStationId" placeholder="请选择护理站"
@change="handleQuery">
<el-select v-model="queryParams.nurseStationId" placeholder="请选择护理站" @change="handleQuery">
<el-option
v-for="item in handstationlist"
:key="item.id"
@ -112,6 +111,16 @@
<el-table-column label="护理项目编号" align="center" prop="nurseItemCode" />
<el-table-column label="护理项目名称" align="center" prop="nurseItemName" />
<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="createBy" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
@ -582,7 +591,8 @@ import {
delNurseItem,
addNurseItem,
updateNurseItem,
updatePicture
updatePicture,
updateShelfStatus
} from "@/api/system/nurseItem";
import { getToken } from "@/utils/auth";
import { getListByUser } from "@/api/system/userlist.js";
@ -764,6 +774,23 @@ export default {
this.classifylistInfo();
},
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
//
clickClassifyshow() {
@ -934,6 +961,13 @@ export default {
getList() {
this.loading = true;
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.total = response.total;
this.loading = false;