护理站项目删除

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