This commit is contained in:
闫晓茹 2023-02-20 14:41:14 +08:00
parent fd64e4cf85
commit 5f1ac9f159
2 changed files with 11 additions and 6 deletions

View File

@ -509,7 +509,7 @@ export default {
console.log(this.form); console.log(this.form);
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
this.form.nurseClassifyInfoList[0].classifySort = parseInt(this.form.nurseClassifyInfoList[0].classifySort);
if (this.form.id != null) { if (this.form.id != null) {
updateInfo(this.form).then((response) => { updateInfo(this.form).then((response) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
@ -522,6 +522,7 @@ export default {
this.getList(); this.getList();
}); });
} else { } else {
this.form.nurseClassifyInfoList[0].classifySort = parseInt(this.form.nurseClassifyInfoList[0].classifySort);
addInfo(this.form).then((response) => { addInfo(this.form).then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;

View File

@ -280,6 +280,7 @@ export default {
// //
ids: [], ids: [],
// //
imgone:"",
single: true, single: true,
// //
multiple: true, multiple: true,
@ -406,8 +407,8 @@ export default {
cancel() { cancel() {
if (this.editopen) { if (this.editopen) {
var obj = { pictureUrlList: [] }; var obj = { pictureUrlList: [] };
if (this.form.classifyPictureUrl != this.classifyPictureUrl) { if (this.form.classifyPictureUrl != this.imgone) {
obj.pictureUrlList.push(this.classifyPictureUrl); obj.pictureUrlList.push(this.form.classifyPictureUrl);
} }
updatePicture(obj).then((res) => { updatePicture(obj).then((res) => {
this.editopen = false; this.editopen = false;
@ -481,6 +482,7 @@ export default {
const id = row.id || this.ids; const id = row.id || this.ids;
getStationClassify(id).then((response) => { getStationClassify(id).then((response) => {
this.form = response.data; this.form = response.data;
this.imgone = this.form.classifyPictureUrl;
this.classifyPictureUrl = response.data.classifyPictureUrl; this.classifyPictureUrl = response.data.classifyPictureUrl;
this.editopen = true; this.editopen = true;
this.title = "修改护理机构分类信息"; this.title = "修改护理机构分类信息";
@ -488,22 +490,24 @@ export default {
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
console.log(this.form); console.log(this.form);
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
this.form.nurseClassifyInfoList[0].classifySort=parseInt( this.form.nurseClassifyInfoList[0].classifySort)
if (this.form.id != null) { if (this.form.id != null) {
updateStationClassify(this.form).then((response) => { updateStationClassify(this.form).then((response) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
if (this.form.classifyPictureUrl != this.classifyPictureUrl) { if (this.form.classifyPictureUrl != this.imgone) {
var obj = { pictureUrlList: [] }; var obj = { pictureUrlList: [] };
obj.pictureUrlList.push(this.classifyPictureUrl); obj.pictureUrlList.push(this.imgone);
updatePicture(obj).then((res) => {}); updatePicture(obj).then((res) => {});
} }
this.editopen = false; this.editopen = false;
this.getList(); this.getList();
}); });
} else { } else {
this.form.nurseClassifyInfoList[0].classifySort=parseInt(this.form.nurseClassifyInfoList[0].classifySort)
addStationClassify(this.form).then((response) => { addStationClassify(this.form).then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;