|
|
@ -1,5 +1,5 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="content_box" v-loading='pageLoading'> |
|
|
|
<div class="content_box" v-loading="pageLoading"> |
|
|
|
<div class="header"> |
|
|
|
<div class="header"> |
|
|
|
<!-- 模板名称 --> |
|
|
|
<!-- 模板名称 --> |
|
|
|
<div class="el_Template"> |
|
|
|
<div class="el_Template"> |
|
|
@ -7,7 +7,6 @@ |
|
|
|
<el-input v-model="form.TemplateName" style="width: 240px" placeholder="请输入模板名称" /> |
|
|
|
<el-input v-model="form.TemplateName" style="width: 240px" placeholder="请输入模板名称" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 品牌 --> |
|
|
|
<!-- 品牌 --> |
|
|
|
<div class="el_Service"> |
|
|
|
<div class="el_Service"> |
|
|
|
<span class="name">品牌</span> |
|
|
|
<span class="name">品牌</span> |
|
|
@ -38,8 +37,9 @@ |
|
|
|
:popper-append-to-body="false" |
|
|
|
:popper-append-to-body="false" |
|
|
|
style="width: 340px" |
|
|
|
style="width: 340px" |
|
|
|
multiple |
|
|
|
multiple |
|
|
|
|
|
|
|
@change="handleChange" |
|
|
|
@remove-tag="removeTag" |
|
|
|
@remove-tag="removeTag" |
|
|
|
:loading='ServiceTypeLoading' |
|
|
|
:loading="ServiceTypeLoading" |
|
|
|
> |
|
|
|
> |
|
|
|
<el-option |
|
|
|
<el-option |
|
|
|
v-for="item in ServiceList" |
|
|
|
v-for="item in ServiceList" |
|
|
@ -47,7 +47,7 @@ |
|
|
|
:label="item.label" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value" |
|
|
|
:value="item.value" |
|
|
|
> |
|
|
|
> |
|
|
|
<el-checkbox v-model="item.check" @change="isChecked(item)"> |
|
|
|
<el-checkbox v-model="item.check" @change="() => isChecked(item, true)"> |
|
|
|
{{ item.label }} |
|
|
|
{{ item.label }} |
|
|
|
</el-checkbox> |
|
|
|
</el-checkbox> |
|
|
|
</el-option> |
|
|
|
</el-option> |
|
|
@ -60,12 +60,18 @@ |
|
|
|
<el-tabs type="border-card" v-model="Tabmenu"> |
|
|
|
<el-tabs type="border-card" v-model="Tabmenu"> |
|
|
|
<template v-for="item in ServiceList" :key="item.label"> |
|
|
|
<template v-for="item in ServiceList" :key="item.label"> |
|
|
|
<el-tab-pane :name="item.label" v-if="item.state" :label="item.label"> |
|
|
|
<el-tab-pane :name="item.label" v-if="item.state" :label="item.label"> |
|
|
|
<span v-if="item.label == '提货'"><FinancialBill @request-data="provideData" :templateData="templateInfo"/></span> |
|
|
|
<span v-if="item.label == '提货'" |
|
|
|
<span v-if="item.label == '干线'"><FinancialTrunkLine @request-data="provideData" :templateData="templateInfo"/></span> |
|
|
|
><FinancialBill @request-data="provideData" :templateData="templateInfo" |
|
|
|
|
|
|
|
/></span> |
|
|
|
|
|
|
|
<span v-if="item.label == '干线'" |
|
|
|
|
|
|
|
><FinancialTrunkLine @request-data="provideData" :templateData="templateInfo" |
|
|
|
|
|
|
|
/></span> |
|
|
|
<span v-if="item.label == '仓储'" |
|
|
|
<span v-if="item.label == '仓储'" |
|
|
|
><FinancialWarehousing @request-data="provideData" :templateData="templateInfo" |
|
|
|
><FinancialWarehousing @request-data="provideData" :templateData="templateInfo" |
|
|
|
/></span> |
|
|
|
/></span> |
|
|
|
<span v-if="item.label == '配送'"><FinancialDelivery @request-data="provideData" :templateData="templateInfo"/></span> |
|
|
|
<span v-if="item.label == '配送'" |
|
|
|
|
|
|
|
><FinancialDelivery @request-data="provideData" :templateData="templateInfo" |
|
|
|
|
|
|
|
/></span> |
|
|
|
<span v-if="item.label == '安装'">安装</span> |
|
|
|
<span v-if="item.label == '安装'">安装</span> |
|
|
|
</el-tab-pane> |
|
|
|
</el-tab-pane> |
|
|
|
</template> |
|
|
|
</template> |
|
|
@ -75,11 +81,15 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script setup> |
|
|
|
<script setup> |
|
|
|
import { ref, defineAsyncComponent,reactive, toRefs, computed, onMounted, nextTick, watch } from 'vue'; |
|
|
|
import { ref, defineAsyncComponent, getCurrentInstance } from 'vue'; |
|
|
|
import { getDictionaryBiz } from '@/api/system/dict'; //字典 |
|
|
|
import { getDictionaryBiz } from '@/api/system/dict'; //字典 |
|
|
|
import { $_basicdataBrande, $_InfopriceTemplate } from '@/api/financialsector/index'; //价格模板 |
|
|
|
import { $_basicdataBrande, $_InfopriceTemplate } from '@/api/financialsector/index'; //价格模板 |
|
|
|
|
|
|
|
import { ElMessage } from 'element-plus'; |
|
|
|
const $route = useRoute(); //获取地址栏参数 |
|
|
|
const $route = useRoute(); //获取地址栏参数 |
|
|
|
const pageLoading = ref(true); //页面加载效果 |
|
|
|
const pageLoading = ref(true); //页面加载效果 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// vue实例 |
|
|
|
|
|
|
|
const instance = getCurrentInstance(); |
|
|
|
//仓储模板 |
|
|
|
//仓储模板 |
|
|
|
const FinancialWarehousing = defineAsyncComponent(() => |
|
|
|
const FinancialWarehousing = defineAsyncComponent(() => |
|
|
|
import('@/views/financialsector/Financialse/FinancialWarehousing.vue') |
|
|
|
import('@/views/financialsector/Financialse/FinancialWarehousing.vue') |
|
|
@ -106,7 +116,8 @@ const templateInfo = ref({}); |
|
|
|
const ServiceList = ref([]); |
|
|
|
const ServiceList = ref([]); |
|
|
|
// 字典公共函数 |
|
|
|
// 字典公共函数 |
|
|
|
function updateDictionary(targetArray, dictionaryType) { |
|
|
|
function updateDictionary(targetArray, dictionaryType) { |
|
|
|
getDictionaryBiz(dictionaryType).then(res => { |
|
|
|
getDictionaryBiz(dictionaryType) |
|
|
|
|
|
|
|
.then(res => { |
|
|
|
console.log(res, '字典'); |
|
|
|
console.log(res, '字典'); |
|
|
|
if (res.data.code == 200) { |
|
|
|
if (res.data.code == 200) { |
|
|
|
if (res.data.data.length) { |
|
|
|
if (res.data.data.length) { |
|
|
@ -118,9 +129,12 @@ function updateDictionary(targetArray, dictionaryType) { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log('targetArray :>> ', targetArray); |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch(()=>{ |
|
|
|
}) |
|
|
|
}).finally(()=>{ |
|
|
|
.catch(() => {}) |
|
|
|
|
|
|
|
.finally(() => { |
|
|
|
ServiceTypeLoading.value = false; |
|
|
|
ServiceTypeLoading.value = false; |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
@ -130,7 +144,7 @@ ServiceTypeLoading.value=false; |
|
|
|
for (const res of results) { |
|
|
|
for (const res of results) { |
|
|
|
await new Promise(resolve => setTimeout(resolve, 500)); |
|
|
|
await new Promise(resolve => setTimeout(resolve, 500)); |
|
|
|
await isChecked(res); |
|
|
|
await isChecked(res); |
|
|
|
await provideData() |
|
|
|
await provideData(); |
|
|
|
} |
|
|
|
} |
|
|
|
pageLoading.value = false; |
|
|
|
pageLoading.value = false; |
|
|
|
} |
|
|
|
} |
|
|
@ -139,41 +153,45 @@ const onLoad= async()=>{ |
|
|
|
await updateDictionary(ServiceList.value, 'service_type'); //菜单加载 |
|
|
|
await updateDictionary(ServiceList.value, 'service_type'); //菜单加载 |
|
|
|
if ($route.query.id) { |
|
|
|
if ($route.query.id) { |
|
|
|
let data = { |
|
|
|
let data = { |
|
|
|
id:$route.query.id |
|
|
|
id: $route.query.id, |
|
|
|
} |
|
|
|
}; |
|
|
|
$_InfopriceTemplate(data).then(res => { |
|
|
|
$_InfopriceTemplate(data).then(res => { |
|
|
|
console.log(res, '获取详情'); |
|
|
|
console.log(res, '获取详情'); |
|
|
|
if (res.data.code == 200) { |
|
|
|
if (res.data.code == 200) { |
|
|
|
request.value = res.data.data; //发送回显数据 |
|
|
|
request.value = res.data.data; //发送回显数据 |
|
|
|
form.value.brand = res.data.data.brandId || ''; //品牌 |
|
|
|
form.value.brand = res.data.data.brandId || ''; //品牌 |
|
|
|
form.value.TemplateName = res.data.data.name || ''; //模板名称 |
|
|
|
form.value.TemplateName = res.data.data.name || ''; //模板名称 |
|
|
|
form.value.ServiceType= res.data.data.serviceType.split(",")||[];//服务类型 |
|
|
|
form.value.ServiceType = res.data.data.serviceType.split(',') || []; //服务类型 |
|
|
|
const result = ServiceList.value.filter(item => form.value.ServiceType.includes(item.value)); |
|
|
|
|
|
|
|
|
|
|
|
console.log('form.value.ServiceType :>> ', form.value.ServiceType); |
|
|
|
|
|
|
|
const result = ServiceList.value.filter(item => |
|
|
|
|
|
|
|
form.value.ServiceType.includes(item.value) |
|
|
|
|
|
|
|
); |
|
|
|
// 激活菜单设置为已经存在的 |
|
|
|
// 激活菜单设置为已经存在的 |
|
|
|
executeCheckedResults(result); |
|
|
|
executeCheckedResults(result); |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
pageLoading.value=false |
|
|
|
pageLoading.value = false; |
|
|
|
} |
|
|
|
} |
|
|
|
let data = { |
|
|
|
let data = { |
|
|
|
current: 1, |
|
|
|
current: 1, |
|
|
|
size: 1000, |
|
|
|
size: 1000, |
|
|
|
} |
|
|
|
}; |
|
|
|
$_basicdataBrande(data).then(res => { |
|
|
|
$_basicdataBrande(data).then(res => { |
|
|
|
console.log(res, '品牌'); |
|
|
|
console.log(res, '品牌'); |
|
|
|
if (res.data.code == 200) { |
|
|
|
if (res.data.code == 200) { |
|
|
|
brand.value=res.data.data |
|
|
|
brand.value = res.data.data; |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
onLoad() |
|
|
|
}); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
onLoad(); |
|
|
|
// 点击菜单 |
|
|
|
// 点击菜单 |
|
|
|
const isChecked = val => { |
|
|
|
const isChecked = (val, isChecked = false) => { |
|
|
|
console.log(val, 'val'); |
|
|
|
console.log(val, 'val'); |
|
|
|
//菜单隐藏/显示 |
|
|
|
//菜单隐藏/显示 |
|
|
|
val.state = !val.state; |
|
|
|
val.state = !val.state; |
|
|
|
if($route.query.id){ |
|
|
|
if ($route.query.id && !isChecked) { |
|
|
|
val.check = !val.check; |
|
|
|
val.check = !val.check; |
|
|
|
} |
|
|
|
} |
|
|
|
// 激活菜单设置为已经存在的 |
|
|
|
// 激活菜单设置为已经存在的 |
|
|
@ -195,7 +213,7 @@ const removeTag = value => { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// 给子页面传递数据 |
|
|
|
// 给子页面传递数据 |
|
|
|
const provideData = (data) => { |
|
|
|
const provideData = data => { |
|
|
|
console.log(data, '来自子页面的数据'); |
|
|
|
console.log(data, '来自子页面的数据'); |
|
|
|
console.log(form.value, 'form.value'); |
|
|
|
console.log(form.value, 'form.value'); |
|
|
|
templateInfo.value = form.value; |
|
|
|
templateInfo.value = form.value; |
|
|
@ -206,6 +224,12 @@ const provideData = (data) => { |
|
|
|
templateInfo.value.request = request.value; //发送回显数据 |
|
|
|
templateInfo.value.request = request.value; //发送回显数据 |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handleChange = () => { |
|
|
|
|
|
|
|
console.log('instance :>> ', instance); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
instance.ctx.$forceUpdate(); |
|
|
|
|
|
|
|
}; |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
<style scoped lang="scss"> |
|
|
|