Commit a11bfdfc by 冒粤蓉

fix

1 parent 65001ed2
......@@ -25,7 +25,8 @@ const SPECIALSHOP_API = {
GET_FENCE_DETAIL: '/trialdrive/specialshop/info',
SAVE_FENCE: '/trialdrive/specialshop/add',
UPDATE_FENCE: '/trialdrive/specialshop/edit',
EXPORT_TABLE: '/trialdrive/specialshop/export'
EXPORT_TABLE: '/trialdrive/specialshop/export',
DELETE_SPECIAL_SHOP: '/trialdrive/specialshop/delete'
}
// 试驾报表
const REPORT_API = {
......
......@@ -22,4 +22,9 @@ function updateFence (params) {
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 @@
:inline="true"
>
<el-form-item class="special-shop-input" label="特约店名称:" prop="specialShop">
<el-cascader
<el-cascader
ref="specialShopCascader"
v-model="form.specialShopId"
:value="form.specialShopName"
......@@ -183,49 +183,49 @@ export default {
shopName: '',
shopCode: '',
shopLevel: '一级店',
fenceName: '',
fenceName: '',
lng: '',
lat: '',
radius: 1000,
bizFenceType: '12',
shapeType: 1,
specialShopId: '',
specialShopName: '',
// fenceNo: '',
electricFenceType: 1,
startTime: '',
endTime: '',
des: '',
areaCode: '',
analysisAddress: '',
status: 1,
transferError: false,
timeType:2,
electricTimeFenceType:'',
electricTimeFenceTypes: [
{
value: 1,
label: '1个月'
}, {
value: 2,
label: '2个月'
}, {
value: 3,
label: '3个月'
}, {
value: 4,
label: '4个月'
}, {
value: 5,
label: '5个月'
}, {
value: 6,
label: '6个月'
}
],
dateRange: [],
msgtel: ''
},
lat: '',
radius: 1000,
bizFenceType: '12',
shapeType: 1,
specialShopId: '',
specialShopName: '',
// fenceNo: '',
electricFenceType: 1,
startTime: '',
endTime: '',
des: '',
areaCode: '',
analysisAddress: '',
status: 1,
transferError: false,
timeType:2,
electricTimeFenceType:'',
electricTimeFenceTypes: [
{
value: 1,
label: '1个月'
}, {
value: 2,
label: '2个月'
}, {
value: 3,
label: '3个月'
}, {
value: 4,
label: '4个月'
}, {
value: 5,
label: '5个月'
}, {
value: 6,
label: '6个月'
}
],
dateRange: [],
msgtel: ''
},
rules: {
specialShop: [
{required: true, validator: checkSpecialShop, trigger: 'change'}
......@@ -281,13 +281,13 @@ export default {
if(res.code == 200){
const form = this.form;
const data = res.data;
if(!data) {
return;
}
if(!data) {
return;
}
for(let key in data){
form[key] = data[key]
}
this.shopId = data.id;
this.shopId = data.id;
this.form.dateRange = [form.startTime, form.endTime];
this.areaCode = form.areaCode
this.restainFenceName = form.fenceName;
......@@ -327,36 +327,36 @@ export default {
});
},
updateMapData(data) {
if(data.radius){
this.form.radius = data.radius;
}
if(data.lng && data.lat){
this.form.lng = data.lng;
this.form.lat = data.lat;
this.transfer()
}
if(data.polygonPath && data.polygonPath.length){
this.polygonPath = data.polygonPath
}
if(data.radius){
this.form.radius = data.radius;
}
if(data.lng && data.lat){
this.form.lng = data.lng;
this.form.lat = data.lat;
this.transfer()
}
if(data.polygonPath && data.polygonPath.length){
this.polygonPath = data.polygonPath
}
},
handleSpecialShopChange(val) {
// 特约店级联选项
if(val && val.length > 1) {
const thisNodes = this.$refs['specialShopCascader'].getCheckedNodes()[0];
this.form.specialShopId = val[1];
this.form.specialShopName = thisNodes.label;
}
},
// 特约店级联选项
if(val && val.length > 1) {
const thisNodes = this.$refs['specialShopCascader'].getCheckedNodes()[0];
this.form.specialShopId = val[1];
this.form.specialShopName = thisNodes.label;
}
},
updateFence(){
this.$refs.fenceMap.updateFence({
fenceType: 'circle',
lng: this.form.lng,
lat: this.form.lat,
radius: this.form.radius
});
this.transfer()
},
this.$refs.fenceMap.updateFence({
fenceType: 'circle',
lng: this.form.lng,
lat: this.form.lat,
radius: this.form.radius
});
this.transfer()
},
validateLngLat(){
let pass = true;
this.$refs.shopForm.validateField('lng', (error)=>{
......@@ -518,19 +518,19 @@ export default {
<style scoped>
.fenceModalfooter{
margin: 0;
padding: 20px;
padding-top: 10px;
text-align: right;
box-sizing: border-box;
z-index: 500;
position: fixed;
left:0;
bottom: 0;
width: 100%;
border-top: 1px solid #e7eaec;
background-color: #fdfdfd;
margin-left: 220px;
padding-right: 260px;
}
margin: 0;
padding: 20px;
padding-top: 10px;
text-align: right;
box-sizing: border-box;
z-index: 500;
position: fixed;
left:0;
bottom: 0;
width: 100%;
border-top: 1px solid #e7eaec;
background-color: #fdfdfd;
margin-left: 220px;
padding-right: 260px;
}
</style>
\ No newline at end of file
......@@ -75,7 +75,7 @@
>{{item.name}}</el-button>
</h3>
<basic-table
ref="roleTable"
ref="shopTable"
:tableParams="shopTableParams"
:getListApi="getListApi"
:searchForm="searchForm"
......@@ -109,7 +109,7 @@
</template>
<script>
import { getList } from 'services/specialshop'
import { getList, deleteSpecialShop } from 'services/specialshop'
import { getSimpleRoot, getSimpleList } from 'services/common'
import { SPECIALSHOP_API } from '@/config/config'
import store from '@/store'
......@@ -239,6 +239,19 @@ export default {
query: { id: shopId, readonlyStatus: true }
})
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) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!