desc: 修改权限字段

This commit is contained in:
zyy 2019-10-11 18:40:32 +08:00
parent 1e3486efc6
commit 5e8089cacd

View File

@ -165,11 +165,14 @@ export default {
});
postFindPermission(arr).then(res => {
this.isGoods = false;
if (res.data && res.data.goodsId) {
if (res.data && res.data.id) {
this.isGoods = true;
this.addModel.name = res.data.prdName;
this.addModel.price = res.data.prdPrice;
this.addModel.name = res.data.name;
this.addModel.price = res.data.prdPrice || 0.01;
this.addModel.remarks = res.data.remarks;
this.addModel.tryUse = this.addModel.forever;
this.addModel.tryUseTime = this.addModel.tryUseTime;
this.addModel.tryUseTimeUnit = this.addModel.tryUseTimeUnit;
}
});
}
@ -202,11 +205,14 @@ export default {
});
postFindPermission(arr).then(res => {
this.isGoods = false;
if (res.data && res.data.goodsId) {
if (res.data && res.data.id) {
this.isGoods = true;
this.addModel.name = res.data.prdName;
this.addModel.price = res.data.prdPrice;
this.addModel.name = res.data.name;
this.addModel.price = res.data.prdPrice || 0.01;
this.addModel.remarks = res.data.remarks;
this.addModel.tryUse = this.addModel.forever;
this.addModel.tryUseTime = this.addModel.tryUseTime;
this.addModel.tryUseTimeUnit = this.addModel.tryUseTimeUnit;
}
});
}
@ -333,22 +339,18 @@ export default {
} else if (this.addModel.type == '02') {
this.$refs.formData.validate((valid) => {
if (valid) { // 使
const goodNameNew = this.addModel.name;
const remarksNew = this.addModel.remarks;
postFindPermission(arr).then(res => {
this.addModel['relPermissions'] = arr;
if (res.data) {
this.addModel['id'] = res.data.id;
}
if (this.isGoods) { //
this.addModel.name = res.data.name;
this.addModel.remarks = res.data.remarks;
const good = {
id: res.data.goodsId,
permissionId: res.data.id,
name: goodNameNew,
name: this.addModel.name,
price: this.addModel.price,
remarks: remarksNew,
remarks: this.addModel.remarks,
tryUse: this.addModel.forever,
tryUseTime: this.addModel.tryUseTime,
tryUseTimeUnit: this.addModel.tryUseTimeUnit,
@ -357,18 +359,14 @@ export default {
this.$emit('permissionNextOrder', this.addModel, good);
} else {
//
if (res.data && res.data.name) {
this.addModel.name = res.data.name;
this.addModel.remarks = res.data.remarks;
}
const good = {
name: goodNameNew,
name: this.addModel.name,
permissionId: '',
tryUse: this.addModel.forever,
tryUseTime: this.addModel.tryUseTime,
tryUseTimeUnit: this.addModel.tryUseTimeUnit,
price: this.addModel.price,
remarks: remarksNew,
remarks: this.addModel.remarks,
list: this.ruleList
};
this.$emit('permissionNextOrder', this.addModel, good);