价格 修改
This commit is contained in:
parent
f8869416f5
commit
c7f22e6e06
@ -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>
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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 = "请选择所属护理站";
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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: [] };
|
||||
@ -464,17 +466,25 @@ export default {
|
||||
if (obj.pictureUrlList.length > 0) {
|
||||
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={}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user