|
|
|
@ -1,6 +1,5 @@
|
|
|
|
|
<template> |
|
|
|
|
<div class="content" v-loading="loading" |
|
|
|
|
element-loading-text="Loading..."> |
|
|
|
|
<div class="content" v-loading="loading" element-loading-text="Loading..."> |
|
|
|
|
<!-- 配置计价规则 --> |
|
|
|
|
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick"> |
|
|
|
|
<el-tab-pane label="商配" :name="1"></el-tab-pane> |
|
|
|
@ -82,20 +81,20 @@
|
|
|
|
|
<el-form-item label="超区点位计费模式"> |
|
|
|
|
<el-radio-group v-model="form.overZoneSiteMode"> |
|
|
|
|
<el-radio :label="1">统一计费</el-radio> |
|
|
|
|
<el-radio :label="2" v-if="form.overZoneKilometerRule!=1">区域计费</el-radio> |
|
|
|
|
<el-radio :label="2" v-if="form.overZoneKilometerRule != 1">区域计费</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
</el-form-item> |
|
|
|
|
</template> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<div class="el_row"> |
|
|
|
|
<!-- <div class="el_row"> |
|
|
|
|
<el-form-item label="超区点位是否计算返程"> |
|
|
|
|
<el-radio-group v-model="form.ynOverZoneKilometerReturn"> |
|
|
|
|
<el-radio :label="1">是</el-radio> |
|
|
|
|
<el-radio :label="0">否</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
</el-form-item> |
|
|
|
|
</div> |
|
|
|
|
</div> --> |
|
|
|
|
|
|
|
|
|
<div class="el_row"> |
|
|
|
|
<el-form-item label="是否点位补贴计费"> |
|
|
|
@ -142,9 +141,9 @@
|
|
|
|
|
<el-button type="primary" @click="preservation" |
|
|
|
|
>保存<el-icon><Promotion /></el-icon |
|
|
|
|
></el-button> |
|
|
|
|
<!-- <el-button type="primary" @click="nextstep" |
|
|
|
|
<el-button type="primary" v-if="tabactive.label1 && tabactive.label2" @click="nextstep" |
|
|
|
|
>下一步<el-icon><ArrowRightBold /></el-icon |
|
|
|
|
></el-button> --> |
|
|
|
|
></el-button> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
@ -173,9 +172,13 @@ const props = defineProps({
|
|
|
|
|
}); |
|
|
|
|
console.log(props, '来自父页面参数'); |
|
|
|
|
const $route = useRoute(); //获取地址栏参数 |
|
|
|
|
const tabactive = ref({ |
|
|
|
|
label1: false, |
|
|
|
|
label2: false, |
|
|
|
|
}); |
|
|
|
|
const copyform = ref({}); |
|
|
|
|
const State = ref(false); //是否有数据 |
|
|
|
|
const loading=ref(false) |
|
|
|
|
const loading = ref(false); |
|
|
|
|
const form = ref({ |
|
|
|
|
ynSurcharge: 0, //是否有附加费 |
|
|
|
|
ynChargedKilometer: 0, //是否公里数计费 |
|
|
|
@ -202,7 +205,20 @@ const handleClick = () => {
|
|
|
|
|
clearTimeout(time); |
|
|
|
|
}, 50); |
|
|
|
|
}; |
|
|
|
|
const preservation = () => { |
|
|
|
|
const preservation = async () => { |
|
|
|
|
if (!$route.query.id && !props.templateData.id) { |
|
|
|
|
ElMessage({ |
|
|
|
|
message: '请先新增模板', |
|
|
|
|
type: 'error', |
|
|
|
|
}); |
|
|
|
|
console.log(emit); |
|
|
|
|
let data = { |
|
|
|
|
active: 1, |
|
|
|
|
}; |
|
|
|
|
emit('request-data', data); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
let data = { |
|
|
|
|
type: activeName.value, |
|
|
|
|
...form.value, |
|
|
|
@ -211,10 +227,10 @@ const preservation = () => {
|
|
|
|
|
if (!State.value) { |
|
|
|
|
// 没有保存过走新增接口 |
|
|
|
|
// 新增 |
|
|
|
|
$_expenseDispatchPriceRulesave(data).then(res => { |
|
|
|
|
await $_expenseDispatchPriceRulesave(data).then(async res => { |
|
|
|
|
console.log(res, '新增成'); |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
State.value = true;//表示已经新增成功 |
|
|
|
|
State.value = true; //表示已经新增成功 |
|
|
|
|
ElMessage({ |
|
|
|
|
message: res.data.msg, |
|
|
|
|
type: 'success', |
|
|
|
@ -224,7 +240,7 @@ const preservation = () => {
|
|
|
|
|
} else { |
|
|
|
|
// 修改编辑 |
|
|
|
|
if ($route.query.id || props.templateData.id) { |
|
|
|
|
$_expenseDispatchPriceRuleupdate(data).then(res => { |
|
|
|
|
await $_expenseDispatchPriceRuleupdate(data).then(async res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
ElMessage({ |
|
|
|
|
message: res.data.msg, |
|
|
|
@ -234,37 +250,61 @@ const preservation = () => {
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
await onLoad(); |
|
|
|
|
}; |
|
|
|
|
const Reset = () => { |
|
|
|
|
copyform.value = deepClone(form.value); |
|
|
|
|
}; |
|
|
|
|
const onLoad = () => { |
|
|
|
|
const onLoad = async () => { |
|
|
|
|
let _pageData = { |
|
|
|
|
id: props.templateData.id || $route.query.id, |
|
|
|
|
TabPageState: false, |
|
|
|
|
}; |
|
|
|
|
emit('request-data', _pageData); |
|
|
|
|
|
|
|
|
|
if ($route.query.id || props.templateData.id) { |
|
|
|
|
let data = { |
|
|
|
|
type: activeName.value, |
|
|
|
|
templateId: $route.query.id || props.templateData.id, |
|
|
|
|
}; |
|
|
|
|
// if ($route.query.id) { |
|
|
|
|
// data.id = $route.query.id; |
|
|
|
|
// } else { |
|
|
|
|
// data.templateId = '1821740515451240449'; |
|
|
|
|
// } |
|
|
|
|
loading.value=true; |
|
|
|
|
$_expenseDispatchPriceRuledetail(data).then(res => { |
|
|
|
|
loading.value = true; |
|
|
|
|
await $_expenseDispatchPriceRuledetail(data) |
|
|
|
|
.then(res => { |
|
|
|
|
console.log(res, '详情'); |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
if (res.data.data) { |
|
|
|
|
form.value = res.data.data; |
|
|
|
|
activeName.value = res.data.data.type; |
|
|
|
|
|
|
|
|
|
// 判断是否有数据 |
|
|
|
|
if (res.data.data) { |
|
|
|
|
if (activeName.value == 1) { |
|
|
|
|
tabactive.value.label1 = true; |
|
|
|
|
} else { |
|
|
|
|
tabactive.value.label2 = true; |
|
|
|
|
} |
|
|
|
|
if (tabactive.value.label1 && tabactive.value.label2) { |
|
|
|
|
let _pageData = { |
|
|
|
|
id: props.templateData.id, |
|
|
|
|
TabPageState: true, |
|
|
|
|
}; |
|
|
|
|
emit('request-data', _pageData); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
console.log(tabactive.value, 'tabactive.value'); |
|
|
|
|
} |
|
|
|
|
State.value = true; |
|
|
|
|
} else { |
|
|
|
|
State.value = false; |
|
|
|
|
} |
|
|
|
|
console.log(State.value,'状态'); |
|
|
|
|
console.log(State.value, '状态'); |
|
|
|
|
} |
|
|
|
|
}).catch((error)=>{ |
|
|
|
|
}) |
|
|
|
|
.catch(error => { |
|
|
|
|
console.log(error); |
|
|
|
|
}).finally(()=>{ |
|
|
|
|
loading.value=false; |
|
|
|
|
}) |
|
|
|
|
.finally(() => { |
|
|
|
|
loading.value = false; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
@ -273,6 +313,15 @@ const onLoadPage = async () => {
|
|
|
|
|
onLoad(); |
|
|
|
|
}; |
|
|
|
|
onLoadPage(); |
|
|
|
|
// 下一步 |
|
|
|
|
const nextstep = () => { |
|
|
|
|
let _pageData = { |
|
|
|
|
id: props.templateData.id, |
|
|
|
|
TabPageState: true, |
|
|
|
|
active: 4, |
|
|
|
|
}; |
|
|
|
|
emit('request-data', _pageData); |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
|