|
|
|
@ -1,8 +1,8 @@
|
|
|
|
|
<template> |
|
|
|
|
<basic-container v-loading="pageLoading"> |
|
|
|
|
<basic-container v-loading="pageLoading" element-loading-text="页面正在拼命加载中..."> |
|
|
|
|
<!-- 模板内容 --> |
|
|
|
|
<div class="content"> |
|
|
|
|
<el-tabs type="border-card" @tab-click="handleClick" v-model="Tabmenu"> |
|
|
|
|
<el-tabs type="border-card" @tab-click="handleClick" v-model="Tabmenu"> |
|
|
|
|
<template v-for="item in ServiceList" :key="item.label"> |
|
|
|
|
<el-tab-pane :name="item.label" v-if="item.state" :label="item.label"> |
|
|
|
|
<span v-if="item.label == '提货'" |
|
|
|
@ -18,10 +18,16 @@
|
|
|
|
|
:templateData="templateInfo" |
|
|
|
|
/></span> |
|
|
|
|
<span v-if="item.label == '仓储'" |
|
|
|
|
><FinancialWarehousing ref="financialWarehousing" @request-data="provideData" :templateData="templateInfo" |
|
|
|
|
><FinancialWarehousing |
|
|
|
|
ref="financialWarehousing" |
|
|
|
|
@request-data="provideData" |
|
|
|
|
:templateData="templateInfo" |
|
|
|
|
/></span> |
|
|
|
|
<span v-if="item.label == '配送'" |
|
|
|
|
><FinancialDelivery ref="financialDelivery" @request-data="provideData" :templateData="templateInfo" |
|
|
|
|
><FinancialDelivery |
|
|
|
|
ref="financialDelivery" |
|
|
|
|
@request-data="provideData" |
|
|
|
|
:templateData="templateInfo" |
|
|
|
|
/></span> |
|
|
|
|
<span v-if="item.label == '安装'">安装</span> |
|
|
|
|
</el-tab-pane> |
|
|
|
@ -59,7 +65,7 @@ const FinancialDelivery = defineAsyncComponent(() =>
|
|
|
|
|
/** 页面loading */ |
|
|
|
|
const pageLoading = ref(true); //菜单加载 |
|
|
|
|
const form = ref({}); |
|
|
|
|
const Tabmenu = ref('仓储'); |
|
|
|
|
const Tabmenu = ref('提货'); |
|
|
|
|
const templateInfo = ref({}); |
|
|
|
|
// 菜单列表 |
|
|
|
|
const ServiceList = ref([]); |
|
|
|
@ -67,15 +73,15 @@ const ServiceList = ref([]);
|
|
|
|
|
const VehicleTypeList = ref([]); |
|
|
|
|
|
|
|
|
|
const financialBill = ref(); |
|
|
|
|
|
|
|
|
|
const eltabs=ref() |
|
|
|
|
const financialTrunkLine = ref(); |
|
|
|
|
|
|
|
|
|
const financialDelivery=ref() |
|
|
|
|
const financialDelivery = ref(); |
|
|
|
|
|
|
|
|
|
const financialWarehousing=ref() |
|
|
|
|
const financialWarehousing = ref(); |
|
|
|
|
// 字典公共函数 |
|
|
|
|
function updateDictionary(targetArray, dictionaryType) { |
|
|
|
|
getDictionaryBiz(dictionaryType) |
|
|
|
|
async function updateDictionary(targetArray, dictionaryType) { |
|
|
|
|
await getDictionaryBiz(dictionaryType) |
|
|
|
|
.then(res => { |
|
|
|
|
const { code, data } = res.data; |
|
|
|
|
|
|
|
|
@ -102,6 +108,7 @@ async function executeCheckedResults(results) {
|
|
|
|
|
await provideData(); |
|
|
|
|
} |
|
|
|
|
pageLoading.value = false; |
|
|
|
|
Tabmenu.value=results[0].label;//设置第一个菜单 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** 获取回显数据 */ |
|
|
|
@ -121,6 +128,7 @@ const initData = async () => {
|
|
|
|
|
|
|
|
|
|
// 页面初始化必要请求 |
|
|
|
|
const onLoad = async () => { |
|
|
|
|
console.log(eltabs.value,'eltabssss'); |
|
|
|
|
try { |
|
|
|
|
pageLoading.value = true; |
|
|
|
|
|
|
|
|
@ -173,28 +181,27 @@ const onLoad = async () => {
|
|
|
|
|
await nextTick(); |
|
|
|
|
setTimeout(() => { |
|
|
|
|
console.log('financialBill :>> ', financialBill); |
|
|
|
|
if( financialBill.value && financialBill.value.length){ |
|
|
|
|
if (financialBill.value && financialBill.value.length) { |
|
|
|
|
financialBill.value[0].initDictionaryBiz(); |
|
|
|
|
} |
|
|
|
|
if(financialTrunkLine.value && financialTrunkLine.value.length){ |
|
|
|
|
if (financialTrunkLine.value && financialTrunkLine.value.length) { |
|
|
|
|
financialTrunkLine.value[0].initDictionaryBiz(); |
|
|
|
|
} |
|
|
|
|
}, 1000); |
|
|
|
|
}); |
|
|
|
|
} catch (error) { |
|
|
|
|
console.log('error :>> ', error); |
|
|
|
|
} finally { |
|
|
|
|
pageLoading.value = false; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
onLoad(); |
|
|
|
|
|
|
|
|
|
// 点击菜单 |
|
|
|
|
const isChecked = (val, isCheck = false) => { |
|
|
|
|
const isChecked =async (val, isCheck = false) => { |
|
|
|
|
//菜单隐藏/显示 |
|
|
|
|
val.state = !val.state; |
|
|
|
|
//设置激活菜单 |
|
|
|
|
if (!isCheck) Tabmenu.value = val.label; |
|
|
|
|
if (!isCheck) Tabmenu.value = await val.label; |
|
|
|
|
// 如果当前菜单被关闭则显示最新菜单 |
|
|
|
|
if (!val.state && form.value.ServiceType.length) { |
|
|
|
|
Tabmenu.value = ServiceList.value.find(res => res.state).label; |
|
|
|
@ -211,13 +218,13 @@ const removeTag = value => {
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// 给子页面传递数据 |
|
|
|
|
const provideData = data => { |
|
|
|
|
const provideData = async data => { |
|
|
|
|
console.log(data, '来自子页面的数据'); |
|
|
|
|
console.log(form.value, 'form.value'); |
|
|
|
|
|
|
|
|
|
templateInfo.value = form.value; |
|
|
|
|
if (data) { |
|
|
|
|
templateInfo.value.code = data; //接收来自子页面第一次保存的返回值 |
|
|
|
|
templateInfo.value.code = await data; //接收来自子页面第一次保存的返回值 |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|