价格 修改

This commit is contained in:
shidongli 2022-11-24 14:38:27 +08:00
parent f8869416f5
commit c7f22e6e06
5 changed files with 60 additions and 33 deletions

View File

@ -298,7 +298,7 @@
<el-table-column label="商品单价" align="center">
<template slot-scope="scope">
<el-input
v-model="scope.row.goodsPrice"
v-model.number="scope.row.goodsPrice"
type="number"
oninput=" if(value.length>7){value=value.slice(0,7)}"
></el-input>

View File

@ -236,10 +236,9 @@
<el-form-item label="排序" prop="sort">
<el-input
v-model="form.sort"
placeholder="不可输入小数点"
type="number"
min="0"
oninput="if(value.indexOf('.')>0){value=value.slice(0,value.indexOf('.')+0)} if(value.length>10){value=value.slice(0,10)}"
placeholder="请输入排序"
oninput="value=value.replace(/[^\d]/g,'')"
maxLength="10"
/>
</el-form-item>
</el-form>
@ -339,11 +338,10 @@
:prop="`nurseStationConsumables.${index}.sort`"
>
<el-input
placeholder="请输入排序"
v-model="item.sort"
placeholder="不可输入小数点"
type="number"
min="0"
oninput="if(value.indexOf('.')>0){value=value.slice(0,value.indexOf('.')+0)} if(value.length>10){value=value.slice(0,10)}"
maxlength="10"
oninput="value=value.replace(/[^\d]/g,'')"
/>
</el-form-item>
<el-button

View File

@ -96,53 +96,53 @@ export default {
required: true,
message: "请选择所属护理站",
trigger: "blur",
}, ],
},],
consumableDetail: [{
required: true,
message: "请输入耗材包名称",
trigger: "blur",
}, ],
},],
consumableUnit: [{
required: true,
message: "请输入耗材包单位",
trigger: "blur",
}, ],
},],
consumablePrice: [{
required: true,
message: "请输入耗材包价格",
trigger: "blur",
}, ],
},],
sort: [{
required: true,
message: "请输入排序",
trigger: "blur",
}, ],
},],
nurseStationConsumables: {
consumableDetail: [{
required: true,
message: "请输入耗材包名称",
trigger: "blur",
}, ],
},],
nurseStationId: [{
required: true,
message: "请选择所属护理站",
trigger: "blur",
}, ],
},],
consumableUnit: [{
required: true,
message: "请输入耗材包单位",
trigger: "blur",
}, ],
},],
consumablePrice: [{
required: true,
message: "请输入耗材包价格",
trigger: "blur",
}, ],
},],
sort: [{
required: true,
message: "请输入排序",
trigger: "blur",
}, ],
},],
},
},
homenumber: null,
@ -280,7 +280,7 @@ export default {
consumablePrice: "",
consumableDetail: null,
nurseStationName: "请选择所属护理站",
}, ],
},],
};
this.resetForm("form");
},
@ -345,6 +345,7 @@ export default {
this.reset();
const id = row.id || this.ids;
getStationConsumable(id).then((response) => {
console.log(this.form)
this.form = response.data;
this.xgopen = true;
this.title = "修改护理站耗材信息";
@ -353,6 +354,21 @@ export default {
},
/** 提交按钮 */
submitForm() {
if (this.form.id == null) {
this.form.consumableDetail =
this.form.nurseStationConsumables[0].consumableDetail;
this.form.nurseStationId =
this.form.nurseStationConsumables[0].nurseStationId;
this.form.consumableUnit =
this.form.nurseStationConsumables[0].consumableUnit;
this.form.consumablePrice =
this.form.nurseStationConsumables[0].consumablePrice;
this.form.sort = this.form.nurseStationConsumables[0].sort;
} else {
this.form.consumablePrice =
Number(this.form.consumablePrice);
}
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.id != null) {
@ -362,6 +378,9 @@ export default {
this.getList();
});
} else {
this.form.nurseStationConsumables.forEach(e => {
e.consumablePrice = Number(e.consumablePrice)
})
addStationConsumable(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.nurseStationName = "请选择所属护理站";
@ -377,21 +396,21 @@ export default {
const ids = row.id || this.ids;
this.$modal
.confirm("是否确认删除?")
.then(function() {
.then(function () {
return delStationConsumable(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
.catch(() => { });
},
/** 导出按钮操作 */
handleExport() {
this.download(
"system/stationConsumable/export", {
...this.queryParams,
},
...this.queryParams,
},
`stationConsumable_${new Date().getTime()}.xlsx`
);
},

View File

@ -324,7 +324,7 @@
<el-table-column property="price" label="价格" align="center">
<template slot-scope="scope">
<el-input
v-model="scope.row.price"
v-model.number="scope.row.price"
placeholder="小数点后两位(元)"
type="number"
min="0"

View File

@ -118,7 +118,7 @@ export default {
required: true,
trigger: "blur",
message: "请选择项目头像",
}, ],
},],
nurseStationId: [
{ required: true, trigger: "blur", message: "请选择所属护理站" },
],
@ -290,7 +290,7 @@ export default {
obj.pictureUrlList.push(this.form.nurseStationItem.itemPictureUrl);
}
if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {});
updatePicture(obj).then((res) => { });
}
this.open = false;
@ -355,7 +355,7 @@ export default {
price: null,
description: null,
ids: this.ids,
}, ],
},],
};
this.resetForm("form");
},
@ -453,8 +453,10 @@ export default {
this.form.nurseStationItem.nurseTypeId = this.form.nurseTypeId;
this.$refs["form"].validate((valid) => {
if (valid) {
if (this.form.nurseStationItem.id != null) {
this.form.nurseStationItemPrices.forEach((e) => {
this.form.nurseStationItemPrices.forEach(e => {
e.nurseStationItemId = this.form.nurseStationItem.id;
});
var obj = { pictureUrlList: [] };
@ -462,19 +464,27 @@ export default {
obj.pictureUrlList.push(this.imgone);
}
if (obj.pictureUrlList.length > 0) {
updatePicture(obj).then((res) => {});
updatePicture(obj).then((res) => { });
}
// this.form.nurseStationItemPrices.price.forEach((e) => {
// e.price = Number(e.price)
// });
updateNurseItem(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
// this.form.nurseStationItemPrices.price.forEach(e => {
// e.price = Number(e.price)
// });
addNurseItem(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.$forceUpdate();
this.open = false;
this.getList();
this.form={}
});
}
}
@ -486,16 +496,16 @@ export default {
var that = this;
this.$modal
.confirm("是否确认删除此护理站护理项目?")
.then(function() {
.then(function () {
delNurseItem(ids).then(res => {
var obj = { pictureUrlList: [] };
obj.pictureUrlList.push(row.itemPictureUrl);
updatePicture(obj).then((res) => {});
updatePicture(obj).then((res) => { });
that.getList();
that.$modal.msgSuccess("删除成功");
})
})
.catch(() => {});
.catch(() => { });
},
/** 导入按钮操作 */
handleExport() {