Merge branch 'pengyh' into local
# Conflicts: # frontend/src/views/virtual/properties/js/index.js
This commit is contained in:
commit
b76e127567
@ -3,7 +3,8 @@ var CONFIG = {
|
|||||||
login_background: '/assets/login_background.jpg',
|
login_background: '/assets/login_background.jpg',
|
||||||
logo_big: '/assets/logo_big.png',
|
logo_big: '/assets/logo_big.png',
|
||||||
logo_small: '/assets/logo_small.png',
|
logo_small: '/assets/logo_small.png',
|
||||||
url: (window.location.hostname === 'localhost') ? 'http://vd.dipp.ink/' : '/'
|
url: (window.location.hostname === 'localhost') ? 'http://vd.dipp.ink/' : '/',
|
||||||
|
ascsUrl: (window.location.hostname === 'localhost') ? 'http://172.16.14.91:8080/' : '/'
|
||||||
};
|
};
|
||||||
//http://vd.dipp.ink/
|
//http://vd.dipp.ink/
|
||||||
//http://127.0.0.1:8000/
|
//http://127.0.0.1:8000/
|
||||||
|
@ -82,3 +82,81 @@ export function importExcel(file) {
|
|||||||
|
|
||||||
return service.post('api/virtual/properties/import', params, config);
|
return service.post('api/virtual/properties/import', params, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* [getCarAndplatformList 展示所有的平台车辆]
|
||||||
|
* @param {[type]} data [description]
|
||||||
|
* @return {[type]} [description]
|
||||||
|
*/
|
||||||
|
|
||||||
|
export function getCarTypeToPlatformList(data) {
|
||||||
|
return fetch.get('property/list', { params: data })
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* [import 展示所有的平台车辆]
|
||||||
|
* @param {[type]} data [description]
|
||||||
|
* @return {[type]} [description]
|
||||||
|
*/
|
||||||
|
|
||||||
|
export function saveCarTypeToPlatform(data) {
|
||||||
|
return fetch.post('property/update', data)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* [getPlatformList 展示公司应用]
|
||||||
|
* @param {[type]} data [description]
|
||||||
|
* @return {[type]} [description]
|
||||||
|
*/
|
||||||
|
|
||||||
|
export function getApplyList(data) {
|
||||||
|
return fetch.get('properties/platform', { params: data })
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* [getPlatformList 展示公司下级机构]
|
||||||
|
* @param {[type]} data [description]
|
||||||
|
* @return {[type]} [description]
|
||||||
|
*/
|
||||||
|
|
||||||
|
export function getAgentsList(data) {
|
||||||
|
return fetch.get('properties/agents', { params: data })
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* [getPlatformList 展示公司所属套餐]
|
||||||
|
* @param {[type]} data [description]
|
||||||
|
* @return {[type]} [description]
|
||||||
|
*/
|
||||||
|
|
||||||
|
export function getPackageList(data) {
|
||||||
|
return fetch.get('properties/package', { params: data })
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* [getPlatformSetList 展示平台配置列表]
|
||||||
|
* @param {[type]} data [description]
|
||||||
|
* @return {[type]} [description]
|
||||||
|
*/
|
||||||
|
export function getPlatformSetList(data) {
|
||||||
|
return fetch.get('setting/list', { params: data })
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* [savePlatformSet 保存平台配置]
|
||||||
|
* @param {[type]} data [description]
|
||||||
|
* @return {[type]} [description]
|
||||||
|
*/
|
||||||
|
export function savePlatformSet(data) {
|
||||||
|
return fetch.post('setting/save', data)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* [delPlatformSet 删除平台配置]
|
||||||
|
* @param {[type]} data [description]
|
||||||
|
* @return {[type]} [description]
|
||||||
|
*/
|
||||||
|
export function delPlatformSet(data) {
|
||||||
|
return fetch.post('setting/delete', data)
|
||||||
|
}
|
@ -7,7 +7,7 @@ import iView from "iview";
|
|||||||
import iviewArea from "iview-area";
|
import iviewArea from "iview-area";
|
||||||
import Cookies from "js-cookie";
|
import Cookies from "js-cookie";
|
||||||
import Treeselect from "@riophae/vue-treeselect";
|
import Treeselect from "@riophae/vue-treeselect";
|
||||||
import { service, serviceForm } from "service/service";
|
import { service, serviceForm,fetch} from "service/service";
|
||||||
import App from "./App";
|
import App from "./App";
|
||||||
import router from "./router";
|
import router from "./router";
|
||||||
import store from "./store";
|
import store from "./store";
|
||||||
@ -52,3 +52,4 @@ window.md5 = md5;
|
|||||||
window.jquery = window.$ = jquery;
|
window.jquery = window.$ = jquery;
|
||||||
window.service = service;
|
window.service = service;
|
||||||
window.serviceForm = serviceForm;
|
window.serviceForm = serviceForm;
|
||||||
|
window.fetch = fetch;
|
||||||
|
@ -25,6 +25,16 @@ export const serviceForm = axios.create({
|
|||||||
baseURL: domain
|
baseURL: domain
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const fetch = axios.create({
|
||||||
|
timeout: 1800000,
|
||||||
|
headers: {
|
||||||
|
post: {
|
||||||
|
'Content-Type': 'application/json; charset=utf-8'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
baseURL: window.CONFIG.ascsUrl
|
||||||
|
})
|
||||||
|
|
||||||
// http request 拦截器
|
// http request 拦截器
|
||||||
let request = function (config) {
|
let request = function (config) {
|
||||||
const token = getToken();
|
const token = getToken();
|
||||||
@ -40,6 +50,15 @@ let request = function(config) {
|
|||||||
return config;
|
return config;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//fetch 的 http request 拦截器
|
||||||
|
let fetchRequest = function (config) {
|
||||||
|
// 配置取消请求
|
||||||
|
if (window._source) {
|
||||||
|
config.cancelToken = window._source.token;
|
||||||
|
}
|
||||||
|
return config;
|
||||||
|
};
|
||||||
|
|
||||||
let request_err = function (err) {
|
let request_err = function (err) {
|
||||||
Message.error('请求超时');
|
Message.error('请求超时');
|
||||||
return Promise.reject(err);
|
return Promise.reject(err);
|
||||||
@ -93,6 +112,9 @@ service.interceptors.response.use(response, response_err);
|
|||||||
serviceForm.interceptors.request.use(request, request_err);
|
serviceForm.interceptors.request.use(request, request_err);
|
||||||
serviceForm.interceptors.response.use(response, response_err);
|
serviceForm.interceptors.response.use(response, response_err);
|
||||||
|
|
||||||
|
fetch.interceptors.request.use(fetchRequest, request_err);
|
||||||
|
fetch.interceptors.response.use(response, response_err);
|
||||||
|
|
||||||
axios.interceptors.response.use(response, response_err);
|
axios.interceptors.response.use(response, response_err);
|
||||||
|
|
||||||
window.axios = axios;
|
window.axios = axios;
|
||||||
|
@ -19,21 +19,15 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="handle-item">
|
<div class="handle-item">
|
||||||
<Button
|
<Button @click="ok" icon="md-checkmark" type="primary" v-if="hasPermission('update') && editModel">保存修改</Button>
|
||||||
@click="ok"
|
|
||||||
icon="md-checkmark"
|
|
||||||
type="primary"
|
|
||||||
v-if="hasPermission('update') && editModel"
|
|
||||||
>保存修改</Button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="handle-item">
|
<div class="handle-item">
|
||||||
<Button
|
<Button @click="settingsShow = true" icon="md-add" type="primary" v-if="hasPermission('create')">配置管理</Button>
|
||||||
@click="settingsShow = true"
|
</div>
|
||||||
icon="md-add"
|
|
||||||
type="primary"
|
<div class="handle-item">
|
||||||
v-if="hasPermission('create')"
|
<Button @click="configureShow = true" type="primary">应用类型车辆配置</Button>
|
||||||
>配置管理</Button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="handle-item">
|
<div class="handle-item">
|
||||||
@ -50,21 +44,13 @@
|
|||||||
<ul class="handle-wraper">
|
<ul class="handle-wraper">
|
||||||
<li class="handle-item w-250">
|
<li class="handle-item w-250">
|
||||||
<Select placeholder="企业名称" v-model.trim="params.company_id" clearable filterable>
|
<Select placeholder="企业名称" v-model.trim="params.company_id" clearable filterable>
|
||||||
<Option
|
<Option :key="index" :value="item.id" v-for="(item, index) in companies">{{ item.name }}</Option>
|
||||||
:key="index"
|
|
||||||
:value="item.id"
|
|
||||||
v-for="(item, index) in companies"
|
|
||||||
>{{ item.name }}</Option>
|
|
||||||
</Select>
|
</Select>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="handle-item w-250">
|
<li class="handle-item w-250">
|
||||||
<Select placeholder="套餐名称" v-model.trim="params.package_id" clearable filterable>
|
<Select placeholder="套餐名称" v-model.trim="params.package_id" clearable filterable>
|
||||||
<Option
|
<Option :key="index" :value="item.id" v-for="(item, index) in packages">{{ item.name }}</Option>
|
||||||
:key="index"
|
|
||||||
:value="item.id"
|
|
||||||
v-for="(item, index) in packages"
|
|
||||||
>{{ item.name }}</Option>
|
|
||||||
</Select>
|
</Select>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@ -102,37 +88,18 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="page-turn-wrap" v-if="showData">
|
<div class="page-turn-wrap" v-if="showData">
|
||||||
<Page
|
<Page :current="Number(page.page)" :page-size="Number(page.limit)" :page-size-opts="[10, 20, 50, 100]" :total="Number(page.total)" @on-change="changePage" @on-page-size-change="changeLimit" show-elevator show-total show-sizer></Page>
|
||||||
:current="Number(page.page)"
|
|
||||||
:page-size="Number(page.limit)"
|
|
||||||
:page-size-opts="[10, 20, 50, 100]"
|
|
||||||
:total="Number(page.total)"
|
|
||||||
@on-change="changePage"
|
|
||||||
@on-page-size-change="changeLimit"
|
|
||||||
show-elevator
|
|
||||||
show-total
|
|
||||||
show-sizer
|
|
||||||
></Page>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ui-edit
|
<ui-edit :data="editObj.data" :isUpdate="editObj.isUpdate" :show.sync="editObj.show" :provinces="settingsData.province ? settingsData.province : []" @province-success="handleProvinceSuccess"></ui-edit>
|
||||||
:data="editObj.data"
|
|
||||||
:isUpdate="editObj.isUpdate"
|
|
||||||
:show.sync="editObj.show"
|
|
||||||
:provinces="settingsData.province ? settingsData.province : []"
|
|
||||||
@province-success="handleProvinceSuccess"
|
|
||||||
></ui-edit>
|
|
||||||
|
|
||||||
<ui-agent
|
<ui-agent :data="agentObj.data" :isUpdate="agentObj.isUpdate" :show.sync="agentObj.show" :agents="agentsProp ? agentsProp : []" :platforms="settingsData.platform ? settingsData.platform : []" @agent-success="handleAgentSuccess"></ui-agent>
|
||||||
:data="agentObj.data"
|
|
||||||
:isUpdate="agentObj.isUpdate"
|
|
||||||
:show.sync="agentObj.show"
|
|
||||||
:agents="agentsProp ? agentsProp : []"
|
|
||||||
:platforms="settingsData.platform ? settingsData.platform : []"
|
|
||||||
@agent-success="handleAgentSuccess"
|
|
||||||
></ui-agent>
|
|
||||||
|
|
||||||
<ui-settings :data="settingsData" :show.sync="settingsShow" @store-success="updateSettings"></ui-settings>
|
<ui-settings :data="settingsData" :show.sync="settingsShow" @store-success="updateSettings"></ui-settings>
|
||||||
|
|
||||||
|
<ui-configure :show.sync="configureShow"></ui-configure>
|
||||||
|
|
||||||
|
<platform-set :show.sync="platform.show" v-bind="platform"></platform-set>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -5,7 +5,9 @@ export default {
|
|||||||
components: {
|
components: {
|
||||||
UiEdit: resolve => require(['views/virtual/properties/edit'], resolve),
|
UiEdit: resolve => require(['views/virtual/properties/edit'], resolve),
|
||||||
UiAgent: resolve => require(['views/virtual/properties/agent'], 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),
|
||||||
|
platformSet: resolve => require(['views/virtual/properties/platform_set'], resolve),
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -17,6 +19,12 @@ export default {
|
|||||||
},
|
},
|
||||||
only: ['company_id', 'package_id', 'product', 'vehicle_type', 'company', 'platform', 'customer', 'province', 'agent'],
|
only: ['company_id', 'package_id', 'product', 'vehicle_type', 'company', 'platform', 'customer', 'province', 'agent'],
|
||||||
updates: new Map(),
|
updates: new Map(),
|
||||||
|
configureShow: false,
|
||||||
|
platform: {
|
||||||
|
show: false,
|
||||||
|
id: '',
|
||||||
|
name: '',
|
||||||
|
},
|
||||||
settingsShow: false,
|
settingsShow: false,
|
||||||
settingsData: {},
|
settingsData: {},
|
||||||
agentsData: {},
|
agentsData: {},
|
||||||
@ -88,54 +96,54 @@ export default {
|
|||||||
return this.editRender('company', h, context);
|
return this.editRender('company', h, context);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
title: '平台/API',
|
// title: '平台/API',
|
||||||
key: 'platform',
|
// key: 'platform',
|
||||||
minWidth: 120,
|
// minWidth: 120,
|
||||||
render: (h, context) => {
|
// render: (h, context) => {
|
||||||
return this.editRender('platform', h, context);
|
// return this.editRender('platform', h, context);
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
title: '客户类型',
|
// title: '客户类型',
|
||||||
key: 'customer',
|
// key: 'customer',
|
||||||
minWidth: 120,
|
// minWidth: 120,
|
||||||
render: (h, context) => {
|
// render: (h, context) => {
|
||||||
return this.editRender('customer', h, context);
|
// return this.editRender('customer', h, context);
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
title: '产品类型',
|
// title: '产品类型',
|
||||||
key: 'product',
|
// key: 'product',
|
||||||
minWidth: 130,
|
// minWidth: 130,
|
||||||
render: (h, context) => {
|
// render: (h, context) => {
|
||||||
return this.editRender('product', h, context);
|
// return this.editRender('product', h, context);
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
title: '套餐类型',
|
// title: '套餐类型',
|
||||||
key: 'package_type',
|
// key: 'package_type',
|
||||||
width: 100,
|
// width: 100,
|
||||||
render: (h, context) => {
|
// render: (h, context) => {
|
||||||
return h('span', this.productPackageTypes[context.row.product]);
|
// return h('span', this.productPackageTypes[context.row.product]);
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
title: '车辆类型',
|
// title: '车辆类型',
|
||||||
key: 'vehicle_type',
|
// key: 'vehicle_type',
|
||||||
minWidth: 120,
|
// minWidth: 120,
|
||||||
render: (h, context) => {
|
// render: (h, context) => {
|
||||||
return this.editRender('vehicle_type', h, context);
|
// return this.editRender('vehicle_type', h, context);
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
title: '车型分类',
|
// title: '车型分类',
|
||||||
key: 'vehicle_group',
|
// key: 'vehicle_group',
|
||||||
minWidth: 120,
|
// minWidth: 120,
|
||||||
render: (h, context) => {
|
// render: (h, context) => {
|
||||||
return h('span', this.vehicleTypeVehicleGroups[context.row.vehicle_type]);
|
// return h('span', this.vehicleTypeVehicleGroups[context.row.vehicle_type]);
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
title: '销售省份',
|
title: '销售省份',
|
||||||
key: 'action',
|
key: 'action',
|
||||||
@ -174,7 +182,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '机构',
|
title: '代理商',
|
||||||
key: 'action',
|
key: 'action',
|
||||||
width: 150,
|
width: 150,
|
||||||
render: (h, {
|
render: (h, {
|
||||||
@ -201,11 +209,48 @@ export default {
|
|||||||
|
|
||||||
html.push(h('Tooltip', {
|
html.push(h('Tooltip', {
|
||||||
props: {
|
props: {
|
||||||
content: row.agent ? '已设置' : '机构未设置'
|
content: row.agent ? '已设置' : '代理商未设置'
|
||||||
}
|
}
|
||||||
}, [button]));
|
}, [button]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (html.length) {
|
||||||
|
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.platform.show=true;
|
||||||
|
this.platform.id=row.company_id;
|
||||||
|
this.platform.name=row.company_name;
|
||||||
|
this.platform.packagetype=row.package[0];
|
||||||
|
this.platform.propertyId=row.id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, '配置');
|
||||||
|
|
||||||
|
html.push(button);
|
||||||
|
}
|
||||||
|
|
||||||
if (html.length) {
|
if (html.length) {
|
||||||
return h('div', html);
|
return h('div', html);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user