应用类型车辆配置开发
This commit is contained in:
parent
b5e8560472
commit
54fce285f0
@ -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/' : '/'
|
||||||
};
|
};
|
||||||
|
|
||||||
window.CONFIG = CONFIG;
|
window.CONFIG = CONFIG;
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
* @return {[type]} [description]
|
* @return {[type]} [description]
|
||||||
*/
|
*/
|
||||||
export function settings(data) {
|
export function settings(data) {
|
||||||
return service.get('api/virtual/properties/settings', {
|
return service.get('api/virtual/properties/settings', {
|
||||||
params: data
|
params: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -19,9 +19,9 @@ export function settings(data) {
|
|||||||
* @return {[type]} [description]
|
* @return {[type]} [description]
|
||||||
*/
|
*/
|
||||||
export function agents(data) {
|
export function agents(data) {
|
||||||
return service.get('api/virtual/properties/agents', {
|
return service.get('api/virtual/properties/agents', {
|
||||||
params: data
|
params: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -30,7 +30,7 @@ export function agents(data) {
|
|||||||
* @return {[type]} [description]
|
* @return {[type]} [description]
|
||||||
*/
|
*/
|
||||||
export function settingsStore(data) {
|
export function settingsStore(data) {
|
||||||
return service.post('api/virtual/properties/settings', data);
|
return service.post('api/virtual/properties/settings', data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -39,9 +39,9 @@ export function settingsStore(data) {
|
|||||||
* @return {[type]} [description]
|
* @return {[type]} [description]
|
||||||
*/
|
*/
|
||||||
export function index(data) {
|
export function index(data) {
|
||||||
return service.get('api/virtual/properties/index', {
|
return service.get('api/virtual/properties/index', {
|
||||||
params: data
|
params: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -50,7 +50,7 @@ export function index(data) {
|
|||||||
* @return {[type]} [description]
|
* @return {[type]} [description]
|
||||||
*/
|
*/
|
||||||
export function store(data) {
|
export function store(data) {
|
||||||
return serviceForm.post('api/virtual/properties/store', data);
|
return serviceForm.post('api/virtual/properties/store', data);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -59,9 +59,9 @@ export function store(data) {
|
|||||||
* @return {[type]} [description]
|
* @return {[type]} [description]
|
||||||
*/
|
*/
|
||||||
export function exportExcel(data) {
|
export function exportExcel(data) {
|
||||||
return service.get('api/virtual/properties/export', {
|
return service.get('api/virtual/properties/export', {
|
||||||
params: data
|
params: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -70,15 +70,36 @@ export function exportExcel(data) {
|
|||||||
* @return {[type]} [description]
|
* @return {[type]} [description]
|
||||||
*/
|
*/
|
||||||
export function importExcel(file) {
|
export function importExcel(file) {
|
||||||
let config = {
|
let config = {
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'multipart/form-data'
|
'Content-Type': 'multipart/form-data'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let params = new FormData();
|
let params = new FormData();
|
||||||
|
|
||||||
params.append('file', file);
|
params.append('file', 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('setting/list', { params: data })
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* [import 展示所有的平台车辆]
|
||||||
|
* @param {[type]} data [description]
|
||||||
|
* @return {[type]} [description]
|
||||||
|
*/
|
||||||
|
|
||||||
|
export function saveCarTypeToPlatform(data) {
|
||||||
|
return fetch.post('setting/update', 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;
|
||||||
|
@ -6,85 +6,102 @@ let domain = window.CONFIG.url;
|
|||||||
|
|
||||||
// 创建axios实例
|
// 创建axios实例
|
||||||
export const service = axios.create({
|
export const service = axios.create({
|
||||||
timeout: 1800000,
|
timeout: 1800000,
|
||||||
headers: {
|
headers: {
|
||||||
post: {
|
post: {
|
||||||
'Content-Type': 'application/x-www-form-urlencoded'
|
'Content-Type': 'application/x-www-form-urlencoded'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
baseURL: domain
|
baseURL: domain
|
||||||
});
|
});
|
||||||
|
|
||||||
export const serviceForm = axios.create({
|
export const serviceForm = axios.create({
|
||||||
timeout: 1800000,
|
timeout: 1800000,
|
||||||
headers: {
|
headers: {
|
||||||
post: {
|
post: {
|
||||||
'Content-Type': 'multipart/form-data'
|
'Content-Type': 'multipart/form-data'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
baseURL: domain
|
baseURL: domain
|
||||||
});
|
});
|
||||||
|
|
||||||
// http request 拦截器
|
export const fetch = axios.create({
|
||||||
let request = function(config) {
|
timeout: 1800000,
|
||||||
const token = getToken();
|
headers: {
|
||||||
// 判断是否存在token,如果存在的话,则每个http header都加上token
|
'Content-Type': 'application/json; charset=utf-8'
|
||||||
if (token) {
|
},
|
||||||
config.headers.Authorization = `Bearer ${token}`;
|
baseURL: window.CONFIG.ascsUrl
|
||||||
}
|
})
|
||||||
|
|
||||||
// 配置取消请求
|
// http request 拦截器
|
||||||
if (window._source) {
|
let request = function (config) {
|
||||||
config.cancelToken = window._source.token;
|
const token = getToken();
|
||||||
}
|
// 判断是否存在token,如果存在的话,则每个http header都加上token
|
||||||
return config;
|
if (token) {
|
||||||
|
config.headers.Authorization = `Bearer ${token}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 配置取消请求
|
||||||
|
if (window._source) {
|
||||||
|
config.cancelToken = window._source.token;
|
||||||
|
}
|
||||||
|
return config;
|
||||||
};
|
};
|
||||||
|
|
||||||
let request_err = function(err) {
|
//fetch 的 http request 拦截器
|
||||||
Message.error('请求超时');
|
let fetchRequest = function (config) {
|
||||||
return Promise.reject(err);
|
// 配置取消请求
|
||||||
|
if (window._source) {
|
||||||
|
config.cancelToken = window._source.token;
|
||||||
|
}
|
||||||
|
return config;
|
||||||
|
};
|
||||||
|
|
||||||
|
let request_err = function (err) {
|
||||||
|
Message.error('请求超时');
|
||||||
|
return Promise.reject(err);
|
||||||
};
|
};
|
||||||
|
|
||||||
// http response 拦截器
|
// http response 拦截器
|
||||||
let response = function(res) {
|
let response = function (res) {
|
||||||
const data = res.data;
|
const data = res.data;
|
||||||
const message = data.message || '未知错误';
|
const message = data.message || '未知错误';
|
||||||
|
|
||||||
if (res.status) {
|
if (res.status) {
|
||||||
switch (res.status) {
|
switch (res.status) {
|
||||||
case 200:
|
case 200:
|
||||||
if (data.code !== 0) {
|
if (data.code !== 0) {
|
||||||
Message.error(message);
|
Message.error(message);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
return data;
|
||||||
return data;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let response_err = function(err) {
|
let response_err = function (err) {
|
||||||
if (err.response) {
|
if (err.response) {
|
||||||
const data = err.response.data;
|
const data = err.response.data;
|
||||||
const message = data.message ? data.message : '未知错误';
|
const message = data.message ? data.message : '未知错误';
|
||||||
switch (err.response.status) {
|
switch (err.response.status) {
|
||||||
case 401:
|
case 401:
|
||||||
if ([40001, 40002, 40003, 40008].includes(data.code)) {
|
if ([40001, 40002, 40003, 40008].includes(data.code)) {
|
||||||
// 40001未登录、40002未激活、40003已禁用、40008token未传递
|
// 40001未登录、40002未激活、40003已禁用、40008token未传递
|
||||||
localStorage.clear();
|
localStorage.clear();
|
||||||
removeToken();
|
removeToken();
|
||||||
vm.$router.replace({ path: '/login', query: { redirect: encodeURIComponent(vm.$route.fullPath) } });
|
vm.$router.replace({ path: '/login', query: { redirect: encodeURIComponent(vm.$route.fullPath) } });
|
||||||
Message.error(message);
|
Message.error(message);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 500:
|
||||||
|
Message.error('服务器忙,请稍后再试');
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Message.error(message);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
case 500:
|
|
||||||
Message.error('服务器忙,请稍后再试');
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Message.error(message);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
return Promise.resolve(err);
|
||||||
return Promise.resolve(err);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
service.interceptors.request.use(request, request_err);
|
service.interceptors.request.use(request, request_err);
|
||||||
@ -93,6 +110,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;
|
||||||
|
33
frontend/src/views/virtual/properties/configure.vue
Normal file
33
frontend/src/views/virtual/properties/configure.vue
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<template>
|
||||||
|
<Drawer :mask-closable="false" @on-visible-change="visibleChange" title="应用类型车辆配置" v-model="my_show" width="900">
|
||||||
|
<div class="page-edit-wrap uinn-lr20">
|
||||||
|
<Row>
|
||||||
|
<Col span="3" style="line-height:32px">平台类型:</Col>
|
||||||
|
<Col span="21">
|
||||||
|
<Select v-model="param.name" style="width:400px" @on-change="getCarTypes">
|
||||||
|
<Option v-for="(item,key) in configure" :value="key" :key="key">{{key}}</Option>
|
||||||
|
</Select>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
<Row style="margin-top:20px" v-if="param.name">
|
||||||
|
<Col span="3" style="line-height:32px">车辆类型:</Col>
|
||||||
|
<Col span="21">
|
||||||
|
<Tabs v-model="carTypeName">
|
||||||
|
<TabPane v-for="(item,key) in carTypeList" :key="key" :name="key" :label="key">
|
||||||
|
<CheckboxGroup v-model="param.value[key]">
|
||||||
|
<Checkbox :label="name" v-for="(name,index) in item" :key="index"></Checkbox>
|
||||||
|
</CheckboxGroup>
|
||||||
|
</TabPane>
|
||||||
|
</Tabs>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="ta-c">
|
||||||
|
<Button @click="clear" class="w-80 umar-r5" ghost type="primary">取消</Button>
|
||||||
|
<Button :loading="loading" @click="ok" class="w-80" type="primary">确认</Button>
|
||||||
|
</div>
|
||||||
|
</Drawer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script src="./js/configure.js"></script>
|
@ -1,139 +1,104 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="page-wrap">
|
<div class="page-wrap">
|
||||||
<ui-loading :show="page_loading.show"></ui-loading>
|
<ui-loading :show="page_loading.show"></ui-loading>
|
||||||
|
|
||||||
<div class="page-handle-wrap">
|
<div class="page-handle-wrap">
|
||||||
<ul class="handle-wraper bd-b">
|
<ul class="handle-wraper bd-b">
|
||||||
<li class="f-l">
|
<li class="f-l">
|
||||||
<div class="text-exp">
|
<div class="text-exp">
|
||||||
<b>全部信息</b>
|
<b>全部信息</b>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li class="f-r">
|
<li class="f-r">
|
||||||
<div class="handle-item lh-32" v-if="hasPermission('update')">
|
<div class="handle-item lh-32" v-if="hasPermission('update')">
|
||||||
<b class="umar-r10">编辑模式</b>
|
<b class="umar-r10">编辑模式</b>
|
||||||
<Switch v-model="editModel" size="large">
|
<Switch v-model="editModel" size="large">
|
||||||
<span slot="open">开</span>
|
<span slot="open">开</span>
|
||||||
<span slot="close">关</span>
|
<span slot="close">关</span>
|
||||||
</Switch>
|
</Switch>
|
||||||
</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"
|
</div>
|
||||||
icon="md-checkmark"
|
|
||||||
type="primary"
|
|
||||||
v-if="hasPermission('update') && editModel"
|
|
||||||
>保存修改</Button>
|
|
||||||
</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"
|
|
||||||
v-if="hasPermission('create')"
|
|
||||||
>配置管理</Button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="handle-item">
|
<div class="handle-item">
|
||||||
<Button @click="search.show=!search.show" ghost icon="ios-search" type="primary">搜索</Button>
|
<Button @click="configureShow = true" type="primary">应用类型车辆配置</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="handle-item">
|
<div class="handle-item">
|
||||||
<Button @click="request()" icon="md-refresh">刷新</Button>
|
<Button @click="search.show=!search.show" ghost icon="ios-search" type="primary">搜索</Button>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<div class="search-wrap" v-show="search.show">
|
<div class="handle-item">
|
||||||
<ul class="handle-wraper">
|
<Button @click="request()" icon="md-refresh">刷新</Button>
|
||||||
<li class="handle-item w-250">
|
</div>
|
||||||
<Select placeholder="企业名称" v-model.trim="params.company_id" clearable filterable>
|
</li>
|
||||||
<Option
|
</ul>
|
||||||
:key="index"
|
|
||||||
:value="item.id"
|
|
||||||
v-for="(item, index) in companies"
|
|
||||||
>{{ item.name }}</Option>
|
|
||||||
</Select>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li class="handle-item w-250">
|
<div class="search-wrap" v-show="search.show">
|
||||||
<Select placeholder="套餐名称" v-model.trim="params.package_id" clearable filterable>
|
<ul class="handle-wraper">
|
||||||
<Option
|
<li class="handle-item w-250">
|
||||||
:key="index"
|
<Select placeholder="企业名称" v-model.trim="params.company_id" clearable filterable>
|
||||||
:value="item.id"
|
<Option :key="index" :value="item.id" v-for="(item, index) in companies">{{ item.name }}</Option>
|
||||||
v-for="(item, index) in packages"
|
</Select>
|
||||||
>{{ item.name }}</Option>
|
</li>
|
||||||
</Select>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li class="handle-item w-250">
|
<li class="handle-item w-250">
|
||||||
<Select placeholder="设置状态" v-model.trim="params.status" clearable>
|
<Select placeholder="套餐名称" v-model.trim="params.package_id" clearable filterable>
|
||||||
<Option :value="0">已设置</Option>
|
<Option :key="index" :value="item.id" v-for="(item, index) in packages">{{ item.name }}</Option>
|
||||||
<Option :value="1">未设置</Option>
|
</Select>
|
||||||
</Select>
|
</li>
|
||||||
</li>
|
|
||||||
|
|
||||||
<li class="f-r">
|
<li class="handle-item w-250">
|
||||||
<div class="handle-item">
|
<Select placeholder="设置状态" v-model.trim="params.status" clearable>
|
||||||
<Upload :before-upload="importExcel" action="/" :format="['xls','xlsx','csv']">
|
<Option :value="0">已设置</Option>
|
||||||
<Button type="primary" ghost>导入</Button>
|
<Option :value="1">未设置</Option>
|
||||||
</Upload>
|
</Select>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="f-r">
|
||||||
|
<div class="handle-item">
|
||||||
|
<Upload :before-upload="importExcel" action="/" :format="['xls','xlsx','csv']">
|
||||||
|
<Button type="primary" ghost>导入</Button>
|
||||||
|
</Upload>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="handle-item" v-if="hasPermission('output')">
|
||||||
|
<Button @click="exportExcel" type="warning" ghost>导出</Button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="handle-item">
|
||||||
|
<Button @click="index(1)" ghost type="primary">立即搜索</Button>
|
||||||
|
</div>
|
||||||
|
<div class="handle-item">
|
||||||
|
<Button @click="resetSearch" ghost type="warning">重置搜索</Button>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="handle-item" v-if="hasPermission('output')">
|
<div class="page-list-wrap">
|
||||||
<Button @click="exportExcel" type="warning" ghost>导出</Button>
|
<Table ref="table" :columns="columns" :data="showData ? showData : []"></Table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="handle-item">
|
<div class="page-turn-wrap" v-if="showData">
|
||||||
<Button @click="index(1)" ghost type="primary">立即搜索</Button>
|
<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>
|
||||||
<div class="handle-item">
|
|
||||||
<Button @click="resetSearch" ghost type="warning">重置搜索</Button>
|
<ui-edit :data="editObj.data" :isUpdate="editObj.isUpdate" :show.sync="editObj.show" :provinces="settingsData.province ? settingsData.province : []" @province-success="handleProvinceSuccess"></ui-edit>
|
||||||
</div>
|
|
||||||
</li>
|
<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>
|
||||||
</ul>
|
|
||||||
</div>
|
<ui-settings :data="settingsData" :show.sync="settingsShow" @store-success="updateSettings"></ui-settings>
|
||||||
|
|
||||||
|
<ui-configure :show.sync="configureShow"></ui-configure>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="page-list-wrap">
|
|
||||||
<Table ref="table" :columns="columns" :data="showData ? showData : []"></Table>
|
|
||||||
</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>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<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-settings :data="settingsData" :show.sync="settingsShow" @store-success="updateSettings"></ui-settings>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script src="./js/index.js"></script>
|
<script src="./js/index.js"></script>
|
||||||
|
92
frontend/src/views/virtual/properties/js/configure.js
Normal file
92
frontend/src/views/virtual/properties/js/configure.js
Normal file
@ -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: {}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
}
|
||||||
|
};
|
@ -5,7 +5,8 @@ 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)
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -17,6 +18,7 @@ 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,
|
||||||
settingsShow: false,
|
settingsShow: false,
|
||||||
settingsData: {},
|
settingsData: {},
|
||||||
agentsData: {},
|
agentsData: {},
|
||||||
@ -88,54 +90,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',
|
||||||
@ -210,7 +212,41 @@ export default {
|
|||||||
return h('div', html);
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user