desc: 调整创建权限流程,创建字段修改

This commit is contained in:
zyy 2019-10-11 15:27:14 +08:00
parent 8b05776895
commit aa0199754a
6 changed files with 48 additions and 31 deletions

View File

@ -86,7 +86,7 @@ export default {
select: '选择',
chooseGoods: '选择商品',
permissionName: '权限名称',
permissionGoodName: '权限商品名称',
permissionGoodName: '权限名称', // 创建时 商品名称与权限名称一致
receivingPermission: '领取权限',
isPackage: '是否权限包',
modifyPermissionContent: '修改权限内容',

View File

@ -5,8 +5,8 @@ export function getBaseUrl() {
// BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 王兴杰
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
BASE_API = 'http://192.168.3.41:9000'; // 王兴杰
} else {
BASE_API = process.env.VUE_APP_BASE_API;
}

View File

@ -188,9 +188,10 @@ export default {
delCommodity(row.id).then(response => {
this.$message.success(this.$t('tip.successfullyDelete'));
this.reloadTable();
}).catch(() => {
}).catch((error) => {
this.reloadTable();
this.$messageBox(this.$t('tip.failDelete'));
// this.$messageBox(this.$t('tip.failDelete'));
this.$messageBox(error.message);
});
}).catch(() => { });
},

View File

@ -73,7 +73,7 @@ export default {
price: good.price,
list: good.list
}];
this.$refs.orderForm.setOrderName(good, permission);
this.$refs.orderForm.setOrderName(permission, good);
this.display = 1;
},
orderNext(data) {

View File

@ -333,16 +333,13 @@ export default {
this.$refs.permissionList.doShow(row.list);
},
//
setOrderName(data, permission) {
if (data) {
this.formModel.goodsName = data.name;
this.formModel.price = data.price;
this.formModel.goodsId = data.id;
this.goodsVo = {};
setOrderName(permission, good) {
if (good) {
this.formModel.goodsName = good.name;
this.formModel.price = good.price;
this.formModel.goodsId = good.id;
this.permissionVo = permission; //
if (!this.permissionVo.id) {
this.goodsVo = data;
}
this.goodsVo = good;
}
},
buildModel() {

View File

@ -43,7 +43,17 @@
</el-radio-group>
</el-form-item>
<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 v-show="addModel.type == '02'" :label="$t('orderAuthor.describtion') + ':'">
<el-input
@ -52,20 +62,19 @@
:rows="2"
maxlength="60"
show-word-limit
:disabled="isGoods"
/>
</el-form-item>
<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>
</el-form-item>
<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-group>
</el-form-item>
<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
v-for="option in TimeStyleList"
:key="option.value"
@ -75,7 +84,7 @@
</el-select>
</el-form-item>
<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>
</el-form-item>
</el-form>
@ -158,7 +167,7 @@ export default {
this.isGoods = false;
if (res.data && res.data.goodsId) {
this.isGoods = true;
this.addModel.name = res.data.name;
this.addModel.name = res.data.prdName;
this.addModel.price = res.data.prdPrice;
this.addModel.remarks = res.data.remarks;
}
@ -195,7 +204,7 @@ export default {
this.isGoods = false;
if (res.data && res.data.goodsId) {
this.isGoods = true;
this.addModel.name = res.data.name;
this.addModel.name = res.data.prdName;
this.addModel.price = res.data.prdPrice;
this.addModel.remarks = res.data.remarks;
}
@ -324,32 +333,42 @@ 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 (this.isGoods) {
if (res.data) {
this.addModel['id'] = res.data.id;
}
if (this.isGoods) { //
this.addModel.name = res.data.name;
this.addModel.remarks = res.data.remarks;
this.addModel['id'] = res.data.id;
const good = {
id: res.data.goodsId,
permissionId: res.data.id,
name: res.data.prdName,
price: res.data.prdPrice,
remarks: res.data.remarks,
name: goodNameNew,
price: this.addModel.price,
remarks: remarksNew,
tryUse: this.addModel.forever,
tryUseTime: this.addModel.tryUseTime,
tryUseTimeUnit: this.addModel.tryUseTimeUnit,
list: this.ruleList
};
this.$emit('permissionNextOrder', this.addModel, good);
} else {
this.addModel['id'] = '';
//
if (res.data && res.data.name) {
this.addModel.name = res.data.name;
this.addModel.remarks = res.data.remarks;
}
const good = {
name: this.addModel.name,
name: goodNameNew,
permissionId: '',
tryUse: this.addModel.forever,
tryUseTime: this.addModel.tryUseTime,
tryUseTimeUnit: this.addModel.tryUseTimeUnit,
price: this.addModel.price,
remarks: this.addModel.remarks,
remarks: remarksNew,
list: this.ruleList
};
this.$emit('permissionNextOrder', this.addModel, good);