@@ -33,7 +28,6 @@ import { addOrganization, getOrganizationList } from '@/api/management/organizat
import { getSellerList } from '@/api/management/user';
import { createPermission } from '@/api/management/order';
import PremissionList from './list';
-// import { deepAssign } from '@/utils/index';
export default {
name: 'OrderForm',
@@ -64,7 +58,6 @@ export default {
foreverInitData: false,
canDistribute: true,
urlInfo: {},
- goodsVo: {},
orderList: [],
formModel: {
organizationId: '',
@@ -138,7 +131,7 @@ export default {
return this.foreverInitData;
},
form() {
- const form = {
+ return {
labelWidth: this.$i18n.locale == 'en' ? '200px' : '145px',
items: [
{ prop: 'organizationId', label: this.$t('orderAuthor.organizationOrEnterprise'), type: 'select', options: this.OrganizationList, allowCreate: true, onChange: this.onChange },
@@ -156,7 +149,6 @@ export default {
{ prop: 'canDistribute', label: this.$t('orderAuthor.optionPrivilegeTransfer'), type: 'radio', options: this.permissionList }
]
};
- return form;
},
rules() {
const _this = this;
@@ -329,18 +321,6 @@ export default {
showPermission(index, row) {
this.$refs.permissionList.doShow(row.list);
},
- // 第一个参数 商品对象、 第二个参数 权限对象
- setOrderName(permission, good) {
- if (good) {
- this.formModel = { // 订单数据
- goodsName: good.name,
- price: good.price,
- goodsId: good.id
- };
- this.permissionVo = permission; // 权限对象
- this.goodsVo = good; // 商品对象
- }
- },
buildModel() {
// 如果新增的条目不存在字典当中,则需要在临时字典中取对应的值
let orgzId = this.formModel.organizationId;
@@ -377,27 +357,24 @@ export default {
packForm() {
if (this.orderList && this.orderList.length) {
const arr = this.goodsList.map(nor => {
- return nor.permissionId;
+ return nor.goodItem.id;
});
const param = {
- isPackage: false,
- // 订单数据 formModel
- organizationId: this.formModel.organizationId,
- packageNum: this.formModel.amount,
- amount: this.formModel.amount,
- monthAmount: this.formModel.monthAmount,
- packageName: this.goodsVo.name,
- totalPrice: this.formModel.totalPrice,
- orderType: this.formModel.orderType,
- distributeType: this.formModel.canDistribute == '01',
- startTime: this.formModel.startTime,
- payStatus: this.formModel.payStatus,
- bizType: this.formModel.bizType,
- payWays: this.formModel.payWays,
- forever: this.formModel.forever,
- // 基础权限 list
- relPermissions: arr,
- orderDetailList: this.orderList
+ canDistribute: this.formModel.canDistribute == '01',
+ orderCreateVO: {
+ amount: this.formModel.amount,
+ contractNo: this.formModel.contractNo,
+ forever: this.formModel.forever,
+ goodsIds: arr,
+ monthAmount: this.formModel.monthAmount,
+ orderType: this.formModel.orderType,
+ organizationId: this.formModel.organizationId,
+ payStatus: this.formModel.payStatus,
+ payWays: this.formModel.payWays,
+ price: this.formModel.price,
+ sellerId: this.formModel.sellerId,
+ startTime: this.formModel.startTime
+ }
};
createPermission(param).then(res => {
this.urlInfo = {
@@ -416,43 +393,25 @@ export default {
createPermission() {
this.$refs.dataform.validateForm(() => {
this.formModel.organizationId = this.buildModel();
+ const arr = this.goodsList.map(nor => {
+ return nor.id;
+ });
const param = {
- // createVO: {
- // isPackage: true,
- // relPermissions: this.permissionVo.relPermissions,
- // name: this.permissionVo.name,
- // id: this.permissionVo.id,
- // remarks: this.permissionVo.remarks
- // },
- // goodsVO: this.goodsVo,
- // orderList: [this.formModel],
- // canDistribute: this.formModel.canDistribute == '01'
- isPackage: true,
- // 订单数据 formModel
- organizationId: this.formModel.organizationId,
- packageNum: this.formModel.amount,
- startTime: this.formModel.startTime,
- monthAmount: this.formModel.monthAmount,
- distributeType: this.formModel.canDistribute == '01',
- bizType: this.formModel.bizType,
- payWays: this.formModel.payWays,
- forever: this.formModel.forever,
- payStatus: this.formModel.payStatus,
- totalPrice: this.formModel.totalPrice,
- contractNo: this.formModel.contractNo,
- orderType: this.formModel.orderType,
- // 商品数据 goodsVo
- packageName: this.goodsVo.name,
- remarks: this.goodsVo.remarks,
- price: this.goodsVo.price,
- tryUse: this.goodsVo.tryUse,
- tryUseTime: this.goodsVo.tryUseTime,
- tryUseTimeUnit: this.goodsVo.tryUseTimeUnit,
- // 权限包ids 默认名称是 商品名称
- relPermissions: this.permissionVo.relPermissions
-
- // mapId: this.permissionVo.mapId
- // prdCode: this.permissionVo.prdCode
+ canDistribute: this.formModel.canDistribute == '01',
+ orderCreateVO: {
+ amount: this.formModel.amount,
+ contractNo: this.formModel.contractNo,
+ forever: this.formModel.forever,
+ goodsIds: arr,
+ monthAmount: this.formModel.monthAmount,
+ orderType: this.formModel.orderType,
+ organizationId: this.formModel.organizationId,
+ payStatus: this.formModel.payStatus,
+ payWays: this.formModel.payWays,
+ price: this.formModel.price,
+ sellerId: this.formModel.sellerId,
+ startTime: this.formModel.startTime
+ }
};
createPermission(param).then(res => {
this.urlInfo = {
diff --git a/src/views/orderauthor/permission/create/permission.vue b/src/views/orderauthor/permission/create/permission.vue
index 406ac4330..07331acf0 100644
--- a/src/views/orderauthor/permission/create/permission.vue
+++ b/src/views/orderauthor/permission/create/permission.vue
@@ -4,12 +4,7 @@
{{ $t('orderAuthor.mapName') }}:
-
+
@@ -32,6 +27,7 @@
{{ $t('global.delete') }}
+ 编辑
@@ -68,7 +64,7 @@
{{ $t('global.yuan') }}
-
+
{{ $t('orderAuthor.next') }}
+