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