desc: 调整创建权限流程,创建字段修改
This commit is contained in:
parent
8b05776895
commit
aa0199754a
@ -86,7 +86,7 @@ export default {
|
|||||||
select: '选择',
|
select: '选择',
|
||||||
chooseGoods: '选择商品',
|
chooseGoods: '选择商品',
|
||||||
permissionName: '权限名称',
|
permissionName: '权限名称',
|
||||||
permissionGoodName: '权限商品名称',
|
permissionGoodName: '权限名称', // 创建时 商品名称与权限名称一致
|
||||||
receivingPermission: '领取权限',
|
receivingPermission: '领取权限',
|
||||||
isPackage: '是否权限包',
|
isPackage: '是否权限包',
|
||||||
modifyPermissionContent: '修改权限内容',
|
modifyPermissionContent: '修改权限内容',
|
||||||
|
@ -5,8 +5,8 @@ export function getBaseUrl() {
|
|||||||
// BASE_API = 'https://joylink.club/jlcloud';
|
// BASE_API = 'https://joylink.club/jlcloud';
|
||||||
// BASE_API = 'https://test.joylink.club/jlcloud';
|
// BASE_API = 'https://test.joylink.club/jlcloud';
|
||||||
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
||||||
BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||||
// BASE_API = 'http://192.168.3.41:9000'; // 王兴杰
|
BASE_API = 'http://192.168.3.41:9000'; // 王兴杰
|
||||||
} else {
|
} else {
|
||||||
BASE_API = process.env.VUE_APP_BASE_API;
|
BASE_API = process.env.VUE_APP_BASE_API;
|
||||||
}
|
}
|
||||||
|
@ -188,9 +188,10 @@ export default {
|
|||||||
delCommodity(row.id).then(response => {
|
delCommodity(row.id).then(response => {
|
||||||
this.$message.success(this.$t('tip.successfullyDelete'));
|
this.$message.success(this.$t('tip.successfullyDelete'));
|
||||||
this.reloadTable();
|
this.reloadTable();
|
||||||
}).catch(() => {
|
}).catch((error) => {
|
||||||
this.reloadTable();
|
this.reloadTable();
|
||||||
this.$messageBox(this.$t('tip.failDelete'));
|
// this.$messageBox(this.$t('tip.failDelete'));
|
||||||
|
this.$messageBox(error.message);
|
||||||
});
|
});
|
||||||
}).catch(() => { });
|
}).catch(() => { });
|
||||||
},
|
},
|
||||||
|
@ -73,7 +73,7 @@ export default {
|
|||||||
price: good.price,
|
price: good.price,
|
||||||
list: good.list
|
list: good.list
|
||||||
}];
|
}];
|
||||||
this.$refs.orderForm.setOrderName(good, permission);
|
this.$refs.orderForm.setOrderName(permission, good);
|
||||||
this.display = 1;
|
this.display = 1;
|
||||||
},
|
},
|
||||||
orderNext(data) {
|
orderNext(data) {
|
||||||
|
@ -333,16 +333,13 @@ export default {
|
|||||||
this.$refs.permissionList.doShow(row.list);
|
this.$refs.permissionList.doShow(row.list);
|
||||||
},
|
},
|
||||||
// 第一个参数 商品对象、 第二个参数 权限对象
|
// 第一个参数 商品对象、 第二个参数 权限对象
|
||||||
setOrderName(data, permission) {
|
setOrderName(permission, good) {
|
||||||
if (data) {
|
if (good) {
|
||||||
this.formModel.goodsName = data.name;
|
this.formModel.goodsName = good.name;
|
||||||
this.formModel.price = data.price;
|
this.formModel.price = good.price;
|
||||||
this.formModel.goodsId = data.id;
|
this.formModel.goodsId = good.id;
|
||||||
this.goodsVo = {};
|
|
||||||
this.permissionVo = permission; // 权限对象
|
this.permissionVo = permission; // 权限对象
|
||||||
if (!this.permissionVo.id) {
|
this.goodsVo = good;
|
||||||
this.goodsVo = data;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
buildModel() {
|
buildModel() {
|
||||||
|
@ -43,7 +43,17 @@
|
|||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="addModel.type == '02'" :label="$t('orderAuthor.permissionGoodName') + ':'" prop="name">
|
<el-form-item v-show="addModel.type == '02'" :label="$t('orderAuthor.permissionGoodName') + ':'" prop="name">
|
||||||
<el-input v-model="addModel.name" size="small" :disabled="isGoods" />
|
<el-input v-model="addModel.name" size="small" style="width: calc(100% - 30px);" />
|
||||||
|
<el-popover
|
||||||
|
placement="top-start"
|
||||||
|
title=""
|
||||||
|
width="200"
|
||||||
|
trigger="hover"
|
||||||
|
content="此名称将作为领取二维码权限最终名称,请保证此名称能代表所有的权限。"
|
||||||
|
style="width: 17px; float: right;"
|
||||||
|
>
|
||||||
|
<i slot="reference" class="el-icon-info" />
|
||||||
|
</el-popover>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="addModel.type == '02'" :label="$t('orderAuthor.describtion') + ':'">
|
<el-form-item v-show="addModel.type == '02'" :label="$t('orderAuthor.describtion') + ':'">
|
||||||
<el-input
|
<el-input
|
||||||
@ -52,20 +62,19 @@
|
|||||||
:rows="2"
|
:rows="2"
|
||||||
maxlength="60"
|
maxlength="60"
|
||||||
show-word-limit
|
show-word-limit
|
||||||
:disabled="isGoods"
|
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="addModel.type == '02'" :label="$t('orderAuthor.price') + ':'" prop="price">
|
<el-form-item v-show="addModel.type == '02'" :label="$t('orderAuthor.price') + ':'" prop="price">
|
||||||
<el-input-number v-model="addModel.price" :min="0.01" :disabled="isGoods" />
|
<el-input-number v-model="addModel.price" :min="0.01" />
|
||||||
<span style="padding-left: 20px; font-size: 12px; color: #a9a9a9;">{{ $t('global.yuan') }}</span>
|
<span style="padding-left: 20px; font-size: 12px; color: #a9a9a9;">{{ $t('global.yuan') }}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-show="addModel.type == '02'" :label="$t('orderAuthor.whetherTrial')" prop="forever">
|
<el-form-item v-show="addModel.type == '02'" :label="$t('orderAuthor.whetherTrial')" prop="forever">
|
||||||
<el-radio-group v-model="addModel.forever" :disabled="isGoods">
|
<el-radio-group v-model="addModel.forever">
|
||||||
<el-radio v-for="option in $ConstSelect.Whether" :key="option.value" :label="option.value">{{ option.label }}</el-radio>
|
<el-radio v-for="option in $ConstSelect.Whether" :key="option.value" :label="option.value">{{ option.label }}</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="addModel.type == '02' && addModel.forever" :label="$t('orderAuthor.unitOfTime')" prop="tryUseTimeUnit">
|
<el-form-item v-if="addModel.type == '02' && addModel.forever" :label="$t('orderAuthor.unitOfTime')" prop="tryUseTimeUnit">
|
||||||
<el-select v-model="addModel.tryUseTimeUnit" filterable :disabled="isGoods">
|
<el-select v-model="addModel.tryUseTimeUnit" filterable>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="option in TimeStyleList"
|
v-for="option in TimeStyleList"
|
||||||
:key="option.value"
|
:key="option.value"
|
||||||
@ -75,7 +84,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="addModel.type == '02' && addModel.forever" :label="$t('orderAuthor.price') + ':'" prop="tryUseTime">
|
<el-form-item v-if="addModel.type == '02' && addModel.forever" :label="$t('orderAuthor.price') + ':'" prop="tryUseTime">
|
||||||
<el-input-number v-model="addModel.tryUseTime" :min="0.01" :disabled="isGoods" />
|
<el-input-number v-model="addModel.tryUseTime" :min="0.01" />
|
||||||
<span style="padding-left: 20px; font-size: 12px; color: #a9a9a9;">{{ TimeStyleDict[addModel.tryUseTimeUnit] }}</span>
|
<span style="padding-left: 20px; font-size: 12px; color: #a9a9a9;">{{ TimeStyleDict[addModel.tryUseTimeUnit] }}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
@ -158,7 +167,7 @@ export default {
|
|||||||
this.isGoods = false;
|
this.isGoods = false;
|
||||||
if (res.data && res.data.goodsId) {
|
if (res.data && res.data.goodsId) {
|
||||||
this.isGoods = true;
|
this.isGoods = true;
|
||||||
this.addModel.name = res.data.name;
|
this.addModel.name = res.data.prdName;
|
||||||
this.addModel.price = res.data.prdPrice;
|
this.addModel.price = res.data.prdPrice;
|
||||||
this.addModel.remarks = res.data.remarks;
|
this.addModel.remarks = res.data.remarks;
|
||||||
}
|
}
|
||||||
@ -195,7 +204,7 @@ export default {
|
|||||||
this.isGoods = false;
|
this.isGoods = false;
|
||||||
if (res.data && res.data.goodsId) {
|
if (res.data && res.data.goodsId) {
|
||||||
this.isGoods = true;
|
this.isGoods = true;
|
||||||
this.addModel.name = res.data.name;
|
this.addModel.name = res.data.prdName;
|
||||||
this.addModel.price = res.data.prdPrice;
|
this.addModel.price = res.data.prdPrice;
|
||||||
this.addModel.remarks = res.data.remarks;
|
this.addModel.remarks = res.data.remarks;
|
||||||
}
|
}
|
||||||
@ -324,32 +333,42 @@ 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 (this.isGoods) {
|
if (res.data) {
|
||||||
|
this.addModel['id'] = res.data.id;
|
||||||
|
}
|
||||||
|
if (this.isGoods) { // 有商品传值
|
||||||
this.addModel.name = res.data.name;
|
this.addModel.name = res.data.name;
|
||||||
this.addModel.remarks = res.data.remarks;
|
this.addModel.remarks = res.data.remarks;
|
||||||
this.addModel['id'] = res.data.id;
|
|
||||||
const good = {
|
const good = {
|
||||||
id: res.data.goodsId,
|
id: res.data.goodsId,
|
||||||
permissionId: res.data.id,
|
permissionId: res.data.id,
|
||||||
name: res.data.prdName,
|
name: goodNameNew,
|
||||||
price: res.data.prdPrice,
|
price: this.addModel.price,
|
||||||
remarks: res.data.remarks,
|
remarks: remarksNew,
|
||||||
|
tryUse: this.addModel.forever,
|
||||||
|
tryUseTime: this.addModel.tryUseTime,
|
||||||
|
tryUseTimeUnit: this.addModel.tryUseTimeUnit,
|
||||||
list: this.ruleList
|
list: this.ruleList
|
||||||
};
|
};
|
||||||
this.$emit('permissionNextOrder', this.addModel, good);
|
this.$emit('permissionNextOrder', this.addModel, good);
|
||||||
} else {
|
} else {
|
||||||
this.addModel['id'] = '';
|
|
||||||
// 创建万能权限商品 接口
|
// 创建万能权限商品 接口
|
||||||
|
if (res.data && res.data.name) {
|
||||||
|
this.addModel.name = res.data.name;
|
||||||
|
this.addModel.remarks = res.data.remarks;
|
||||||
|
}
|
||||||
const good = {
|
const good = {
|
||||||
name: this.addModel.name,
|
name: goodNameNew,
|
||||||
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: this.addModel.remarks,
|
remarks: remarksNew,
|
||||||
list: this.ruleList
|
list: this.ruleList
|
||||||
};
|
};
|
||||||
this.$emit('permissionNextOrder', this.addModel, good);
|
this.$emit('permissionNextOrder', this.addModel, good);
|
||||||
|
Loading…
Reference in New Issue
Block a user