Commit a43f6108 by 胡悦

Merge branch 'master' of 192.168.3.233:micro-customization-system/micro-trialrun

2 parents 858ac8c6 563b3fd6
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
<span @click="goToPage('/app-vue-history/about')">app-vue-history About</span> <span @click="goToPage('/app-vue-history/about')">app-vue-history About</span>
</p> </p>
</div> --> </div> -->
<keep-alive> <keep-alive :include="keepAlives">
<router-view /> <router-view v-if="!$route.meta.isKeepAlive" />
</keep-alive> </keep-alive>
</div> </div>
</template> </template>
...@@ -33,6 +33,14 @@ export default { ...@@ -33,6 +33,14 @@ export default {
data() { data() {
return { return {
isQiankun: window.__POWERED_BY_QIANKUN__, isQiankun: window.__POWERED_BY_QIANKUN__,
keepAlives: []
}
},
watch: {
$route(to, from) {
if(to.meta.keepAlives) {
this.keepAlives.push(to.name);
}
} }
}, },
methods: { methods: {
......
...@@ -25,7 +25,8 @@ const SPECIALSHOP_API = { ...@@ -25,7 +25,8 @@ const SPECIALSHOP_API = {
GET_FENCE_DETAIL: '/trialdrive/specialshop/info', GET_FENCE_DETAIL: '/trialdrive/specialshop/info',
SAVE_FENCE: '/trialdrive/specialshop/add', SAVE_FENCE: '/trialdrive/specialshop/add',
UPDATE_FENCE: '/trialdrive/specialshop/edit', UPDATE_FENCE: '/trialdrive/specialshop/edit',
EXPORT_TABLE: '/trialdrive/specialshop/export' EXPORT_TABLE: '/trialdrive/specialshop/export',
DELETE_SPECIAL_SHOP: '/trialdrive/specialshop/delete'
} }
// 试驾报表 // 试驾报表
const REPORT_API = { const REPORT_API = {
......
...@@ -8,59 +8,92 @@ const routes = [ ...@@ -8,59 +8,92 @@ const routes = [
{ {
path: '/', path: '/',
name: 'specialShop', name: 'specialShop',
component: () => import('../views/specialShop/index.vue') component: () => import('../views/specialShop/index.vue'),
meta: {
keepAlive: true
}
}, },
{ {
path: '/todo', path: '/todo',
name: 'toDo', name: 'toDo',
component: () => import('../views/toDo/index.vue') component: () => import('../views/toDo/index.vue'),
meta: {
keepAlive: true
}
}, },
{ {
path: '/vehicleManage', path: '/vehicleManage',
name: 'vehicleManage', name: 'vehicleManage',
component: () => import('../views/vehicleManage/index.vue') component: () => import('../views/vehicleManage/index.vue'),
meta: {
keepAlive: true
}
}, },
{ {
path: '/vehicleSubmit', path: '/vehicleSubmit',
name: 'vehicleSubmit', name: 'vehicleSubmit',
component: () => import('../views/vehicleSubmit/index.vue') component: () => import('../views/vehicleSubmit/index.vue'),
meta: {
keepAlive: true
}
}, },
{ {
path: '/vehicleSubmit/addVehicle', path: '/vehicleSubmit/addVehicle',
name: 'addVehicle', name: 'addVehicle',
meta: {title: '新增车辆'}, meta: {title: '新增车辆'},
component: () => import('../views/vehicleSubmit/addVehicle/index.vue') component: () => import('../views/vehicleSubmit/addVehicle/index.vue'),
meta: {
keepAlive: true
}
}, },
{ {
path: '/vehicleCheck', path: '/vehicleCheck',
name: 'vehicleCheck', name: 'vehicleCheck',
component: () => import('../views/vehicleSubmit/vehicleCheck/index.vue') component: () => import('../views/vehicleSubmit/vehicleCheck/index.vue'),
meta: {
keepAlive: true
}
}, },
{ {
path: '/reportManage', path: '/reportManage',
name: 'reportManage', name: 'reportManage',
component: () => import('../views/reportManage/index.vue') component: () => import('../views/reportManage/index.vue'),
meta: {
keepAlive: true
}
}, },
{ {
path: '/specialShop', path: '/specialShop',
name: 'specialShop', name: 'specialShop',
meta: {title: '新增特约店'}, meta: {title: '新增特约店'},
component: () => import('../views/specialShop/index.vue') component: () => import('../views/specialShop/index.vue'),
meta: {
keepAlive: true
}
}, },
{ {
path: '/specialShop/addShop', path: '/specialShop/addShop',
name: 'addShop', name: 'addShop',
component: () => import('../views/specialShop/addShop/index.vue') component: () => import('../views/specialShop/addShop/index.vue'),
meta: {
keepAlive: false
}
}, },
{ {
path: '/testDrive/checkList', path: '/testDrive/checkList',
name: 'testDriveCheckList', name: 'testDriveCheckList',
component: () => import('../views/testDrive/checkList.vue') component: () => import('../views/testDrive/checkList.vue'),
meta: {
keepAlive: true
}
}, },
{ {
path: '/alarmCenter/removeAlarm', path: '/alarmCenter/removeAlarm',
name: 'removeAlarm', name: 'removeAlarm',
component: () => import('../views/alarmCenter/removeAlarm.vue') component: () => import('../views/alarmCenter/removeAlarm.vue'),
meta: {
keepAlive: true
}
} }
] ]
......
...@@ -22,4 +22,9 @@ function updateFence (params) { ...@@ -22,4 +22,9 @@ function updateFence (params) {
return request(params, url, 'post') return request(params, url, 'post')
} }
export { getList, getFenceDetailById, saveFence, updateFence } function deleteSpecialShop (params) {
const url = SPECIALSHOP_API.DELETE_SPECIAL_SHOP
return request(params, url, 'get')
}
export { getList, getFenceDetailById, saveFence, updateFence, deleteSpecialShop }
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
:inline="true" :inline="true"
> >
<el-form-item class="special-shop-input" label="特约店名称:" prop="specialShop"> <el-form-item class="special-shop-input" label="特约店名称:" prop="specialShop">
<el-cascader <el-cascader
ref="specialShopCascader" ref="specialShopCascader"
v-model="form.specialShopId" v-model="form.specialShopId"
:value="form.specialShopName" :value="form.specialShopName"
...@@ -183,49 +183,49 @@ export default { ...@@ -183,49 +183,49 @@ export default {
shopName: '', shopName: '',
shopCode: '', shopCode: '',
shopLevel: '一级店', shopLevel: '一级店',
fenceName: '', fenceName: '',
lng: '', lng: '',
lat: '', lat: '',
radius: 1000, radius: 1000,
bizFenceType: '12', bizFenceType: '12',
shapeType: 1, shapeType: 1,
specialShopId: '', specialShopId: '',
specialShopName: '', specialShopName: '',
// fenceNo: '', // fenceNo: '',
electricFenceType: 1, electricFenceType: 1,
startTime: '', startTime: '',
endTime: '', endTime: '',
des: '', des: '',
areaCode: '', areaCode: '',
analysisAddress: '', analysisAddress: '',
status: 1, status: 1,
transferError: false, transferError: false,
timeType:2, timeType:2,
electricTimeFenceType:'', electricTimeFenceType:'',
electricTimeFenceTypes: [ electricTimeFenceTypes: [
{ {
value: 1, value: 1,
label: '1个月' label: '1个月'
}, { }, {
value: 2, value: 2,
label: '2个月' label: '2个月'
}, { }, {
value: 3, value: 3,
label: '3个月' label: '3个月'
}, { }, {
value: 4, value: 4,
label: '4个月' label: '4个月'
}, { }, {
value: 5, value: 5,
label: '5个月' label: '5个月'
}, { }, {
value: 6, value: 6,
label: '6个月' label: '6个月'
} }
], ],
dateRange: [], dateRange: [],
msgtel: '' msgtel: ''
}, },
rules: { rules: {
specialShop: [ specialShop: [
{required: true, validator: checkSpecialShop, trigger: 'change'} {required: true, validator: checkSpecialShop, trigger: 'change'}
...@@ -281,13 +281,13 @@ export default { ...@@ -281,13 +281,13 @@ export default {
if(res.code == 200){ if(res.code == 200){
const form = this.form; const form = this.form;
const data = res.data; const data = res.data;
if(!data) { if(!data) {
return; return;
} }
for(let key in data){ for(let key in data){
form[key] = data[key] form[key] = data[key]
} }
this.shopId = data.id; this.shopId = data.id;
this.form.dateRange = [form.startTime, form.endTime]; this.form.dateRange = [form.startTime, form.endTime];
this.areaCode = form.areaCode this.areaCode = form.areaCode
this.restainFenceName = form.fenceName; this.restainFenceName = form.fenceName;
...@@ -295,6 +295,7 @@ export default { ...@@ -295,6 +295,7 @@ export default {
this.form.msgtel = data.telNumbers; this.form.msgtel = data.telNumbers;
this.form.specialShopId = data.shopCode; this.form.specialShopId = data.shopCode;
this.form.specialShopName = data.shopName; this.form.specialShopName = data.shopName;
this.form.shopLevel = data.shopLevel;
if(form.shapeType === 1){ if(form.shapeType === 1){
this.mapData = { this.mapData = {
...@@ -327,36 +328,36 @@ export default { ...@@ -327,36 +328,36 @@ export default {
}); });
}, },
updateMapData(data) { updateMapData(data) {
if(data.radius){ if(data.radius){
this.form.radius = data.radius; this.form.radius = data.radius;
} }
if(data.lng && data.lat){ if(data.lng && data.lat){
this.form.lng = data.lng; this.form.lng = data.lng;
this.form.lat = data.lat; this.form.lat = data.lat;
this.transfer() this.transfer()
} }
if(data.polygonPath && data.polygonPath.length){ if(data.polygonPath && data.polygonPath.length){
this.polygonPath = data.polygonPath this.polygonPath = data.polygonPath
} }
}, },
handleSpecialShopChange(val) { handleSpecialShopChange(val) {
// 特约店级联选项 // 特约店级联选项
if(val && val.length > 1) { if(val && val.length > 1) {
const thisNodes = this.$refs['specialShopCascader'].getCheckedNodes()[0]; const thisNodes = this.$refs['specialShopCascader'].getCheckedNodes()[0];
this.form.specialShopId = val[1]; this.form.specialShopId = val[1];
this.form.specialShopName = thisNodes.label; this.form.specialShopName = thisNodes.label;
} }
}, },
updateFence(){ updateFence(){
this.$refs.fenceMap.updateFence({ this.$refs.fenceMap.updateFence({
fenceType: 'circle', fenceType: 'circle',
lng: this.form.lng, lng: this.form.lng,
lat: this.form.lat, lat: this.form.lat,
radius: this.form.radius radius: this.form.radius
}); });
this.transfer() this.transfer()
}, },
validateLngLat(){ validateLngLat(){
let pass = true; let pass = true;
this.$refs.shopForm.validateField('lng', (error)=>{ this.$refs.shopForm.validateField('lng', (error)=>{
...@@ -518,19 +519,19 @@ export default { ...@@ -518,19 +519,19 @@ export default {
<style scoped> <style scoped>
.fenceModalfooter{ .fenceModalfooter{
margin: 0; margin: 0;
padding: 20px; padding: 20px;
padding-top: 10px; padding-top: 10px;
text-align: right; text-align: right;
box-sizing: border-box; box-sizing: border-box;
z-index: 500; z-index: 500;
position: fixed; position: fixed;
left:0; left:0;
bottom: 0; bottom: 0;
width: 100%; width: 100%;
border-top: 1px solid #e7eaec; border-top: 1px solid #e7eaec;
background-color: #fdfdfd; background-color: #fdfdfd;
margin-left: 220px; margin-left: 220px;
padding-right: 260px; padding-right: 260px;
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
>{{item.name}}</el-button> >{{item.name}}</el-button>
</h3> </h3>
<basic-table <basic-table
ref="roleTable" ref="shopTable"
:tableParams="shopTableParams" :tableParams="shopTableParams"
:getListApi="getListApi" :getListApi="getListApi"
:searchForm="searchForm" :searchForm="searchForm"
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
</template> </template>
<script> <script>
import { getList } from 'services/specialshop' import { getList, deleteSpecialShop } from 'services/specialshop'
import { getSimpleRoot, getSimpleList } from 'services/common' import { getSimpleRoot, getSimpleList } from 'services/common'
import { SPECIALSHOP_API } from '@/config/config' import { SPECIALSHOP_API } from '@/config/config'
import store from '@/store' import store from '@/store'
...@@ -215,9 +215,7 @@ export default { ...@@ -215,9 +215,7 @@ export default {
this.searchForm = {} this.searchForm = {}
}, },
btnClick(pType, scope) { btnClick(pType, scope) {
if(scope) { const shopId = scope && scope.shopId;
const { shopId } = scope;
}
switch (pType) { switch (pType) {
case 'create': case 'create':
this.$router.push({ name: 'addShop' }) this.$router.push({ name: 'addShop' })
...@@ -241,6 +239,19 @@ export default { ...@@ -241,6 +239,19 @@ export default {
query: { id: shopId, readonlyStatus: true } query: { id: shopId, readonlyStatus: true }
}) })
break break
case 'delete':
deleteSpecialShop({shopId}).then(res => {
const { code, message } = res;
if(code == 200) {
this.$refs.shopTable.refreshTable()
} else {
this.$message({
message,
type: 'error'
});
}
})
break
} }
}, },
change(name, val) { change(name, val) {
......
...@@ -44,8 +44,8 @@ ...@@ -44,8 +44,8 @@
slot-scope="scope" slot-scope="scope"
> >
<template v-for="(j, idx) in testDriveTableParams.tableOption.btnList"> <template v-for="(j, idx) in testDriveTableParams.tableOption.btnList">
<!-- approvalStatus为1也就是未审核状态才展示通过/驳回 --> <!-- approvalStatus为1也就是未审核状态展示全部按钮 -->
<template v-if="(j.pType == 'pass' || j.pType == 'reject') && scope.scope.approvalStatus == 1"> <template v-if="scope.scope.approvalStatus == 1">
<el-button <el-button
:key="idx" :key="idx"
:type="j.type || 'text'" :type="j.type || 'text'"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!