+
-
-
- -
-
- 全部信息
-
-
- -
-
- 编辑模式
-
- 开
- 关
-
-
+
+
+ -
+
+ 全部信息
+
+
+ -
+
+ 编辑模式
+
+ 开
+ 关
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
-
-
+
+
+
-
-
- -
-
-
+
+
+
+
+
-
-
-
-
+
+
+ -
+
+
- -
-
-
+ -
+
+
- -
-
-
-
-
+
-
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
diff --git a/frontend/src/views/virtual/properties/js/configure.js b/frontend/src/views/virtual/properties/js/configure.js
new file mode 100644
index 00000000..a1951f6d
--- /dev/null
+++ b/frontend/src/views/virtual/properties/js/configure.js
@@ -0,0 +1,92 @@
+import * as API from "api/virtual/properties";
+export default {
+ props: {
+ show: {
+ type: Boolean,
+ default: false
+ },
+ },
+ data() {
+ return {
+ my_show: false,
+ loading: false,
+ configure: [],//配置总数据
+ carTypeList: {},//车辆类型
+ carTypeName: '',
+ param: {
+ name: '',//选中平台
+ value: {},//选中的车辆类型
+ },
+ };
+ },
+ watch: {
+ show(bool) {
+ this.my_show = bool;
+ if (bool) {
+ this.getCarTypeToPlatformList()
+ }
+ },
+ },
+ methods: {
+ getCarTypeToPlatformList() {
+ API.getCarTypeToPlatformList()
+ .then(res => {
+ if (res.code == 0) {
+ this.configure = res.data;
+ }
+ })
+ },
+ getCarTypes(val) {
+ if (!val) return;
+ const configure = this.configure[val] || {};
+ this.carTypeList = configure.carList;
+ this.param.value = {};
+ if (configure['已选']) {
+ this.param.value = configure['已选']
+ } else {
+ for (let k in configure.carList) {
+ this.$set(this.param.value, k, [])
+ }
+ }
+ this.carTypeName = Object.keys(configure.carList)[0];
+ },
+ ok() {
+ let data = new Object;
+ data.name = this.param.name;
+ data.value = JSON.stringify(this.param.value);
+ this.loading = true;
+ API.saveCarTypeToPlatform(data)
+ .then(res => {
+ this.loading = false;
+ if (res.code == 0) {
+ this.$Message.success('修改成功');
+ }
+ })
+ .catch(err => {
+ this.loading = false;
+ })
+ },
+ clear() {
+ this.my_show = false;
+ this.configure = [];
+ this.carTypeList = {};
+ this.carTypeName = '';
+ this.param = {
+ name: '',
+ value: {}
+ };
+ },
+ visibleChange(bool) {
+ if (!bool) {
+ this.$emit('update:show', false);
+ }
+ this.configure = [];
+ this.carTypeList = {};
+ this.carTypeName = '';
+ this.param = {
+ name: '',
+ value: {}
+ };
+ },
+ }
+};
diff --git a/frontend/src/views/virtual/properties/js/index.js b/frontend/src/views/virtual/properties/js/index.js
index d9e720ef..f4d98574 100644
--- a/frontend/src/views/virtual/properties/js/index.js
+++ b/frontend/src/views/virtual/properties/js/index.js
@@ -5,7 +5,8 @@ export default {
components: {
UiEdit: resolve => require(['views/virtual/properties/edit'], resolve),
UiAgent: resolve => require(['views/virtual/properties/agent'], resolve),
- UiSettings: resolve => require(['views/virtual/properties/settings'], resolve)
+ UiSettings: resolve => require(['views/virtual/properties/settings'], resolve),
+ UiConfigure: resolve => require(['views/virtual/properties/configure'],resolve)
},
data() {
return {
@@ -17,6 +18,7 @@ export default {
},
only: ['company_id', 'package_id', 'product', 'vehicle_type', 'company', 'platform', 'customer', 'province', 'agent'],
updates: new Map(),
+ configureShow: false,
settingsShow: false,
settingsData: {},
agentsData: {},
@@ -88,54 +90,54 @@ export default {
return this.editRender('company', h, context);
}
},
- {
- title: '平台/API',
- key: 'platform',
- minWidth: 120,
- render: (h, context) => {
- return this.editRender('platform', h, context);
- }
- },
- {
- title: '客户类型',
- key: 'customer',
- minWidth: 120,
- render: (h, context) => {
- return this.editRender('customer', h, context);
- }
- },
- {
- title: '产品类型',
- key: 'product',
- minWidth: 130,
- render: (h, context) => {
- return this.editRender('product', h, context);
- }
- },
- {
- title: '套餐类型',
- key: 'package_type',
- width: 100,
- render: (h, context) => {
- return h('span', this.productPackageTypes[context.row.product]);
- }
- },
- {
- title: '车辆类型',
- key: 'vehicle_type',
- minWidth: 120,
- render: (h, context) => {
- return this.editRender('vehicle_type', h, context);
- }
- },
- {
- title: '车型分类',
- key: 'vehicle_group',
- minWidth: 120,
- render: (h, context) => {
- return h('span', this.vehicleTypeVehicleGroups[context.row.vehicle_type]);
- }
- },
+ // {
+ // title: '平台/API',
+ // key: 'platform',
+ // minWidth: 120,
+ // render: (h, context) => {
+ // return this.editRender('platform', h, context);
+ // }
+ // },
+ // {
+ // title: '客户类型',
+ // key: 'customer',
+ // minWidth: 120,
+ // render: (h, context) => {
+ // return this.editRender('customer', h, context);
+ // }
+ // },
+ // {
+ // title: '产品类型',
+ // key: 'product',
+ // minWidth: 130,
+ // render: (h, context) => {
+ // return this.editRender('product', h, context);
+ // }
+ // },
+ // {
+ // title: '套餐类型',
+ // key: 'package_type',
+ // width: 100,
+ // render: (h, context) => {
+ // return h('span', this.productPackageTypes[context.row.product]);
+ // }
+ // },
+ // {
+ // title: '车辆类型',
+ // key: 'vehicle_type',
+ // minWidth: 120,
+ // render: (h, context) => {
+ // return this.editRender('vehicle_type', h, context);
+ // }
+ // },
+ // {
+ // title: '车型分类',
+ // key: 'vehicle_group',
+ // minWidth: 120,
+ // render: (h, context) => {
+ // return h('span', this.vehicleTypeVehicleGroups[context.row.vehicle_type]);
+ // }
+ // },
{
title: '销售省份',
key: 'action',
@@ -210,7 +212,41 @@ export default {
return h('div', html);
}
}
- }
+ },
+ {
+ title: '平台配置',
+ key: 'action',
+ width: 150,
+ render: (h, {
+ row,
+ column,
+ index
+ }) => {
+ let html = [];
+
+ if (this.haveJurisdiction('update')) {
+ let button = h('Button', {
+ props: {
+ type: 'success',
+ size: 'small'
+ },
+ class: ['btn'],
+ on: {
+ click: (event) => {
+ this.agentObj = { show: true, data: row, isUpdate: this.editModel };
+ this.agentsProp = this.agentsData[row.company_id] ? this.agentsData[row.company_id] : [];
+ }
+ }
+ }, '配置');
+
+ html.push(button);
+ }
+
+ if (html.length) {
+ return h('div', html);
+ }
+ }
+ }
]
};
},