护理站项目删除

This commit is contained in:
闫晓茹 2022-11-17 13:15:25 +08:00
parent 6e46a11a9c
commit 0379390fee

View File

@ -18,6 +18,7 @@
v-model="queryParams.nurseStationId" v-model="queryParams.nurseStationId"
clearable clearable
placeholder="请选择护理站" placeholder="请选择护理站"
> >
<el-option <el-option
v-for="item in handstationlist" v-for="item in handstationlist"
@ -38,6 +39,7 @@
<el-select <el-select
v-model="queryParams.nurseStationId" v-model="queryParams.nurseStationId"
placeholder="请选择护理站" placeholder="请选择护理站"
> >
<el-option <el-option
v-for="item in handstationlist" v-for="item in handstationlist"
@ -488,7 +490,7 @@
:data="nurseStationlist" :data="nurseStationlist"
@cell-dblclick="choicestationid" @cell-dblclick="choicestationid"
> >
<el-table-column label="请选择" width="70" align="center"> <el-table-column label="请选择" width="70" align="center" >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
type="primary" type="primary"
@ -712,7 +714,7 @@ export default {
return { return {
imageUrl: "", imageUrl: "",
imgone: "", imgone: "",
handstationlist: [], handstationlist:[],
// //
upload: { upload: {
// //
@ -738,7 +740,7 @@ export default {
multiple: true, multiple: true,
// //
showSearch: true, showSearch: true,
// //
total: 0, total: 0,
total2: 0, total2: 0,
total3: 0, total3: 0,
@ -829,10 +831,10 @@ export default {
this.info(); this.info();
this.getInfoListinfo(); this.getInfoListinfo();
this.infos(); this.infos();
}, },
methods: { methods: {
imgUrl(imgUrl) { imgUrl(imgUrl) {
console.log(imgUrl);
this.form.nurseStationItem.itemPictureUrl = imgUrl; this.form.nurseStationItem.itemPictureUrl = imgUrl;
}, },
handleAvatarSuccess(res, file) { handleAvatarSuccess(res, file) {
@ -883,20 +885,15 @@ export default {
// //
cellchoiceConsumable(item) { cellchoiceConsumable(item) {
if (this.form.nurseStationItemConsumables.find((e) => e.id == item.id)) { if (this.form.nurseStationItemConsumables.find((e) => e.id == item.id)) {
console.log(1);
this.form.nurseStationItemConsumables = this.form.nurseStationItemConsumables =
this.form.nurseStationItemConsumables.filter((e) => e.id != item.id); this.form.nurseStationItemConsumables.filter((e) => e.id != item.id);
} else { } else {
console.log(2);
this.form.nurseStationItemConsumables.push(item); this.form.nurseStationItemConsumables.push(item);
} }
console.log(this.form.nurseStationItemConsumables);
}, },
// //
choiceConsumable(item) { choiceConsumable(item) {
console.log(item);
this.form.nurseStationItemConsumables.push(item); this.form.nurseStationItemConsumables.push(item);
console.log(this.form.nurseStationItemConsumables);
}, },
// //
choicestationid(item) { choicestationid(item) {
@ -904,7 +901,6 @@ export default {
// this.form.nurseStationId = item.id; // this.form.nurseStationId = item.id;
this.form.nurseStationItem.nurseStationName = item.nurseStationName; this.form.nurseStationItem.nurseStationName = item.nurseStationName;
this.StationConsumablequeryParams.nurseStationId = item.id; this.StationConsumablequeryParams.nurseStationId = item.id;
// console.log(item);
this.nurseStationshow = false; this.nurseStationshow = false;
this.stationcancel(); this.stationcancel();
}, },
@ -935,12 +931,12 @@ export default {
}, },
// //
stationlist() { stationlist() {
this.loading = true; this.loading=true;
getListByUser(this.getListByUserquery).then((res) => { getListByUser(this.getListByUserquery).then((res) => {
this.total4 = res.total; this.total4 = res.total;
this.nurseStationlist = res.rows; this.nurseStationlist = res.rows;
}); });
this.loading = false; this.loading=false;
}, },
// //
getInfoListinfo() { getInfoListinfo() {
@ -988,14 +984,12 @@ export default {
}, },
// //
cancel() { cancel() {
console.log(this.form.nurseStationItem);
var obj = { pictureUrlList: [] }; var obj = { pictureUrlList: [] };
if (this.imgone != this.form.nurseStationItem.itemPictureUrl) { if (this.imgone != this.form.nurseStationItem.itemPictureUrl) {
obj.pictureUrlList.push(this.form.nurseStationItem.itemPictureUrl); obj.pictureUrlList.push(this.form.nurseStationItem.itemPictureUrl);
} }
if (obj.pictureUrlList.length > 0) { if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => { updatePicture(obj).then((res) => {
console.log(res);
}); });
} }
@ -1018,21 +1012,19 @@ export default {
} }
}, },
delnurseStationItemPrices(item) { delnurseStationItemPrices(item) {
if (item.ids && !item.nurseItemPriceId) { if (item.ids && !item.id) {
if (this.form.nurseStationItemPrices.length == 1) { if (this.form.nurseStationItemPrices.length == 1) {
this.$message.error("最后一条不可删除"); this.$message.error("最后一条不可删除");
} else { } else {
this.form.nurseStationItemPrices = this.form.nurseStationItemPrices =
this.form.nurseStationItemPrices.filter((e) => e.ids != item.ids); this.form.nurseStationItemPrices.filter((e) => e.ids != item.ids);
} }
} else if (!item.ids && item.nurseItemPriceId) { } else if (!item.ids && item.id) {
if (this.form.nurseStationItemPrices.length == 1) { if (this.form.nurseStationItemPrices.length == 1) {
this.$message.error("最后一条不可删除"); this.$message.error("最后一条不可删除");
} else { } else {
this.form.nurseStationItemPrices = this.form.nurseStationItemPrices =
this.form.nurseStationItemPrices.filter( this.form.nurseStationItemPrices.filter((e) => e.id != item.id);
(e) => e.nurseItemPriceId != item.nurseItemPriceId
);
} }
} }
}, },
@ -1115,7 +1107,6 @@ export default {
this.StationConsumablequeryParams.nurseStationId = null; this.StationConsumablequeryParams.nurseStationId = null;
const id = row.id || this.ids; const id = row.id || this.ids;
getNurseItem(id).then((response) => { getNurseItem(id).then((response) => {
console.log(response);
this.form = response.data; this.form = response.data;
this.StationConsumablequeryParams.nurseStationId = this.StationConsumablequeryParams.nurseStationId =
response.data.nurseStationItem.nurseStationId; response.data.nurseStationItem.nurseStationId;
@ -1155,16 +1146,9 @@ export default {
e.nurseStationConsumableId = e.id; e.nurseStationConsumableId = e.id;
}); });
this.form.nurseStationItem.nurseTypeId = this.form.nurseTypeId; this.form.nurseStationItem.nurseTypeId = this.form.nurseTypeId;
// this.form.nurseStationItem.nurseStationId = this.form.nurseStationId;
console.log(this.form);
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
console.log(valid);
if (valid) { if (valid) {
if (this.form.nurseStationItem.id != null) { if (this.form.nurseStationItem.id != null) {
this.form.nurseStationItemPrices.forEach((e) => {
e.nurseStationItemId = this.form.nurseStationItem.id;
});
updateNurseItem(this.form).then((response) => { updateNurseItem(this.form).then((response) => {
var obj = { pictureUrlList: [] }; var obj = { pictureUrlList: [] };
if (this.imgone != this.form.nurseStationItem.itemPictureUrl) { if (this.imgone != this.form.nurseStationItem.itemPictureUrl) {
@ -1172,7 +1156,7 @@ export default {
} }
if (obj.pictureUrlList.length > 0) { if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => { updatePicture(obj).then((res) => {
console.log(res);
}); });
} }
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
@ -1188,31 +1172,30 @@ export default {
}); });
} }
} }
}); });totaln
}, },
infos() { infos() {
var queryFor = { var queryFor = {
pageNum: 1, pageNum: 1,
pageSize: 9999, pageSize:9999,
}; };
getListByUser(queryFor).then((res) => { getListByUser(queryFor).then((res) => {
console.log(res);
this.handstationlist = res.rows; this.handstationlist = res.rows;
}); });
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids; const ids = row.id || this.ids;
this.$modal this.$modal
.confirm("是否确认删除此护理站护理项目?") .confirm("是否确认删除此护理站护理项目?")
.then(function () { .then(function () {
return delNurseItem(ids); delNurseItem(ids);
}) })
.then(() => { .then(() => {
var obj = { pictureUrlList: [] }; var obj = { pictureUrlList: [] };
obj.pictureUrlList.push(row.nurseStationItem.itemPictureUrl); obj.pictureUrlList.push(row.itemPictureUrl);
updatePicture(obj).then((res) => { updatePicture(obj).then((res) => {
console.log(res);
}); });
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
@ -1227,10 +1210,9 @@ export default {
// //
info() { info() {
getListByUser(this.getListByUserquery).then((res) => { getListByUser(this.getListByUserquery).then((res) => {
console.log(res);
if (res.rows[0].isAdmin == "1") { if (res.rows[0].isAdmin == "1") {
console.log(true);
this.nurseStationlist = res.rows; this.nurseStationlist = res.rows;
this.total4 = res.total; this.total4 = res.total;
} else { } else {
@ -1240,7 +1222,9 @@ export default {
this.handleQuery(); this.handleQuery();
} }
}); });
}, },
}, },
}; };
</script> </script>