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',
|
||||
logo_big: '/assets/logo_big.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://127.0.0.1:8000/
|
||||
|
@ -82,3 +82,81 @@ export function importExcel(file) {
|
||||
|
||||
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 Cookies from "js-cookie";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import { service, serviceForm } from "service/service";
|
||||
import { service, serviceForm,fetch} from "service/service";
|
||||
import App from "./App";
|
||||
import router from "./router";
|
||||
import store from "./store";
|
||||
@ -52,3 +52,4 @@ window.md5 = md5;
|
||||
window.jquery = window.$ = jquery;
|
||||
window.service = service;
|
||||
window.serviceForm = serviceForm;
|
||||
window.fetch = fetch;
|
||||
|
@ -25,6 +25,16 @@ export const serviceForm = axios.create({
|
||||
baseURL: domain
|
||||
});
|
||||
|
||||
export const fetch = axios.create({
|
||||
timeout: 1800000,
|
||||
headers: {
|
||||
post: {
|
||||
'Content-Type': 'application/json; charset=utf-8'
|
||||
}
|
||||
},
|
||||
baseURL: window.CONFIG.ascsUrl
|
||||
})
|
||||
|
||||
// http request 拦截器
|
||||
let request = function (config) {
|
||||
const token = getToken();
|
||||
@ -40,6 +50,15 @@ let request = function(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) {
|
||||
Message.error('请求超时');
|
||||
return Promise.reject(err);
|
||||
@ -93,6 +112,9 @@ service.interceptors.response.use(response, response_err);
|
||||
serviceForm.interceptors.request.use(request, request_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);
|
||||
|
||||
window.axios = axios;
|
||||
|
@ -19,21 +19,15 @@
|
||||
</div>
|
||||
|
||||
<div class="handle-item">
|
||||
<Button
|
||||
@click="ok"
|
||||
icon="md-checkmark"
|
||||
type="primary"
|
||||
v-if="hasPermission('update') && editModel"
|
||||
>保存修改</Button>
|
||||
<Button @click="ok" icon="md-checkmark" type="primary" v-if="hasPermission('update') && editModel">保存修改</Button>
|
||||
</div>
|
||||
|
||||
<div class="handle-item">
|
||||
<Button
|
||||
@click="settingsShow = true"
|
||||
icon="md-add"
|
||||
type="primary"
|
||||
v-if="hasPermission('create')"
|
||||
>配置管理</Button>
|
||||
<Button @click="settingsShow = true" icon="md-add" type="primary" v-if="hasPermission('create')">配置管理</Button>
|
||||
</div>
|
||||
|
||||
<div class="handle-item">
|
||||
<Button @click="configureShow = true" type="primary">应用类型车辆配置</Button>
|
||||
</div>
|
||||
|
||||
<div class="handle-item">
|
||||
@ -50,21 +44,13 @@
|
||||
<ul class="handle-wraper">
|
||||
<li class="handle-item w-250">
|
||||
<Select placeholder="企业名称" v-model.trim="params.company_id" clearable filterable>
|
||||
<Option
|
||||
:key="index"
|
||||
:value="item.id"
|
||||
v-for="(item, index) in companies"
|
||||
>{{ item.name }}</Option>
|
||||
<Option :key="index" :value="item.id" v-for="(item, index) in companies">{{ item.name }}</Option>
|
||||
</Select>
|
||||
</li>
|
||||
|
||||
<li class="handle-item w-250">
|
||||
<Select placeholder="套餐名称" v-model.trim="params.package_id" clearable filterable>
|
||||
<Option
|
||||
:key="index"
|
||||
:value="item.id"
|
||||
v-for="(item, index) in packages"
|
||||
>{{ item.name }}</Option>
|
||||
<Option :key="index" :value="item.id" v-for="(item, index) in packages">{{ item.name }}</Option>
|
||||
</Select>
|
||||
</li>
|
||||
|
||||
@ -102,37 +88,18 @@
|
||||
</div>
|
||||
|
||||
<div class="page-turn-wrap" v-if="showData">
|
||||
<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>
|
||||
<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>
|
||||
|
||||
<ui-edit
|
||||
:data="editObj.data"
|
||||
:isUpdate="editObj.isUpdate"
|
||||
:show.sync="editObj.show"
|
||||
:provinces="settingsData.province ? settingsData.province : []"
|
||||
@province-success="handleProvinceSuccess"
|
||||
></ui-edit>
|
||||
<ui-edit :data="editObj.data" :isUpdate="editObj.isUpdate" :show.sync="editObj.show" :provinces="settingsData.province ? settingsData.province : []" @province-success="handleProvinceSuccess"></ui-edit>
|
||||
|
||||
<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-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-configure :show.sync="configureShow"></ui-configure>
|
||||
|
||||
<platform-set :show.sync="platform.show" v-bind="platform"></platform-set>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -5,7 +5,9 @@ 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),
|
||||
platformSet: resolve => require(['views/virtual/properties/platform_set'], resolve),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -17,6 +19,12 @@ export default {
|
||||
},
|
||||
only: ['company_id', 'package_id', 'product', 'vehicle_type', 'company', 'platform', 'customer', 'province', 'agent'],
|
||||
updates: new Map(),
|
||||
configureShow: false,
|
||||
platform: {
|
||||
show: false,
|
||||
id: '',
|
||||
name: '',
|
||||
},
|
||||
settingsShow: false,
|
||||
settingsData: {},
|
||||
agentsData: {},
|
||||
@ -88,54 +96,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',
|
||||
@ -174,7 +182,7 @@ export default {
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '机构',
|
||||
title: '代理商',
|
||||
key: 'action',
|
||||
width: 150,
|
||||
render: (h, {
|
||||
@ -201,11 +209,48 @@ export default {
|
||||
|
||||
html.push(h('Tooltip', {
|
||||
props: {
|
||||
content: row.agent ? '已设置' : '机构未设置'
|
||||
content: row.agent ? '已设置' : '代理商未设置'
|
||||
}
|
||||
}, [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) {
|
||||
return h('div', html);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user