Browse Source

新增价格维护的缓存

dev-xx
qb 11 months ago
parent
commit
34937eec12
  1. 2
      src/views/Pricesystem/ListOfPriceSystems.vue
  2. 23
      src/views/Pricesystem/PricesyHome.vue
  3. 5
      src/views/financialsector/CustomerBaseprice.vue
  4. 109
      src/views/financialsector/FinanceHome.vue

2
src/views/Pricesystem/ListOfPriceSystems.vue

@ -523,6 +523,8 @@ const Deletetemplate = () => {
// //
const Modifytemplate = row => { const Modifytemplate = row => {
console.log(row); console.log(row);
$useStore.commit('DEL_ONCE_TAG', '/Pricesystem/PricesyHome');
$router.push({ $router.push({
query: { query: {
id: row.id, id: row.id,

23
src/views/Pricesystem/PricesyHome.vue

@ -1,8 +1,8 @@
<template> <template>
<basic-container v-loading="pageLoading" element-loading-text="页面正在加载中..."> <basic-container v-loading="pageLoading" element-loading-text="页面正在加载中...">
<!-- 模板内容 --> <!-- 模板内容 -->
<div class="content"> <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"> <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 == '提货'" <span v-if="item.label == '提货'"
@ -37,6 +37,12 @@
</basic-container> </basic-container>
</template> </template>
<script>
export default {
name: '/Pricesystem/PricesyHome',
};
</script>
<script setup> <script setup>
import { ref, defineAsyncComponent } from 'vue'; import { ref, defineAsyncComponent } from 'vue';
import { getDictionaryBiz } from '@/api/system/dict'; // import { getDictionaryBiz } from '@/api/system/dict'; //
@ -73,7 +79,7 @@ const ServiceList = ref([]);
const VehicleTypeList = ref([]); const VehicleTypeList = ref([]);
const financialBill = ref(); const financialBill = ref();
const eltabs=ref() const eltabs = ref();
const financialTrunkLine = ref(); const financialTrunkLine = ref();
const financialDelivery = ref(); const financialDelivery = ref();
@ -108,7 +114,6 @@ async function executeCheckedResults(results) {
await provideData(); await provideData();
} }
pageLoading.value = false; pageLoading.value = false;
} }
/** 获取回显数据 */ /** 获取回显数据 */
@ -128,7 +133,7 @@ const initData = async () => {
// //
const onLoad = async () => { const onLoad = async () => {
console.log(eltabs.value,'eltabssss'); console.log(eltabs.value, 'eltabssss');
try { try {
pageLoading.value = true; pageLoading.value = true;
@ -176,7 +181,7 @@ const onLoad = async () => {
const result = ServiceList.value.filter(item => form.value.ServiceType.includes(item.value)); const result = ServiceList.value.filter(item => form.value.ServiceType.includes(item.value));
await initData(); await initData();
// //
await executeCheckedResults(result); await executeCheckedResults(result);
await nextTick(); await nextTick();
setTimeout(() => { setTimeout(() => {
@ -188,7 +193,7 @@ const onLoad = async () => {
financialTrunkLine.value[0].initDictionaryBiz(); financialTrunkLine.value[0].initDictionaryBiz();
} }
}, 1000); }, 1000);
Tabmenu.value=result[0].label;// Tabmenu.value = result[0].label; //
}); });
} catch (error) { } catch (error) {
console.log('error :>> ', error); console.log('error :>> ', error);
@ -198,7 +203,7 @@ const onLoad = async () => {
onLoad(); onLoad();
// //
const isChecked =async (val, isCheck = false) => { const isChecked = async (val, isCheck = false) => {
/// ///
val.state = !val.state; val.state = !val.state;
// //
@ -219,7 +224,7 @@ const removeTag = value => {
}; };
// //
const provideData = async data => { const provideData = async data => {
console.log(data, '来自子页面的数据'); console.log(data, '来自子页面的数据');
console.log(form.value, 'form.value'); console.log(form.value, 'form.value');

5
src/views/financialsector/CustomerBaseprice.vue

@ -23,7 +23,6 @@
<el-button type="primary" @click="Deletetemplate"> <el-button type="primary" @click="Deletetemplate">
<el-icon><Delete /></el-icon> </el-button <el-icon><Delete /></el-icon> </el-button
> >
</div> </div>
<!-- 头部右侧按钮模块 --> <!-- 头部右侧按钮模块 -->
<div class="avue-crud__right"> <div class="avue-crud__right">
@ -318,6 +317,7 @@ const searchReset = () => {
priceTemplate(); priceTemplate();
// //
const Addtemplate = () => { const Addtemplate = () => {
$useStore.commit('DEL_ONCE_TAG', '/financialsector/FinanceHome');
$router.push({ $router.push({
path: '/financialsector/FinanceHome', path: '/financialsector/FinanceHome',
}); });
@ -364,6 +364,8 @@ const Deletetemplate = () => {
// //
const Modifytemplate = row => { const Modifytemplate = row => {
console.log(row); console.log(row);
$useStore.commit('DEL_ONCE_TAG', '/financialsector/FinanceHome');
$router.push({ $router.push({
query: { query: {
id: row.id, id: row.id,
@ -372,7 +374,6 @@ const Modifytemplate = row => {
}); });
}; };
// //
const dialogVisible = () => {}; const dialogVisible = () => {};
</script> </script>

109
src/views/financialsector/FinanceHome.vue

@ -81,6 +81,12 @@
</div> </div>
</template> </template>
<script>
export default {
name: '/financialsector/FinanceHome',
};
</script>
<script setup> <script setup>
import { ref, defineAsyncComponent, getCurrentInstance } from 'vue'; import { ref, defineAsyncComponent, getCurrentInstance } from 'vue';
import { getDictionaryBiz } from '@/api/system/dict'; // import { getDictionaryBiz } from '@/api/system/dict'; //
@ -119,9 +125,9 @@ const request = ref({}); //用于保存会显的值
const templateInfo = ref({}); const templateInfo = ref({});
// //
const ServiceList = ref([]); const ServiceList = ref([]);
// //
async function updateDictionary(targetArray, dictionaryType) { async function updateDictionary(targetArray, dictionaryType) {
await getDictionaryBiz(dictionaryType) await getDictionaryBiz(dictionaryType)
.then(res => { .then(res => {
console.log(res, '字典'); console.log(res, '字典');
if (res.data.code == 200) { if (res.data.code == 200) {
@ -150,8 +156,7 @@ async function executeCheckedResults(results) {
await provideData(); await provideData();
} }
pageLoading.value = false; pageLoading.value = false;
console.log(results,'results'); console.log(results, 'results');
} }
// //
const onLoad = async () => { const onLoad = async () => {
@ -173,8 +178,8 @@ const onLoad = async () => {
form.value.ServiceType.includes(item.value) form.value.ServiceType.includes(item.value)
); );
// //
await executeCheckedResults(result); await executeCheckedResults(result);
Tabmenu.value=result[0].label;// Tabmenu.value = result[0].label; //
} }
}); });
} else { } else {
@ -196,8 +201,8 @@ onLoad();
const isChecked = async (val, isChecked = false, msg = false) => { const isChecked = async (val, isChecked = false, msg = false) => {
console.log(msg, '当前msg'); console.log(msg, '当前msg');
console.log(val, 'val'); console.log(val, 'val');
if (msg) { if (msg) {
val.state = !val.state; val.state = !val.state;
Tabmenu.value = val.label; Tabmenu.value = val.label;
if (!val.check) { if (!val.check) {
form.value.ServiceType.push(val.value); form.value.ServiceType.push(val.value);
@ -209,7 +214,7 @@ const isChecked = async (val, isChecked = false, msg = false) => {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
}) })
.then( async () => { .then(async () => {
val.check = false; val.check = false;
val.state = false; val.state = false;
let indexToRemove = await form.value.ServiceType.findIndex(item => item == val.value); let indexToRemove = await form.value.ServiceType.findIndex(item => item == val.value);
@ -263,56 +268,47 @@ const isChecked = async (val, isChecked = false, msg = false) => {
}; };
// //
const removeTag = value => { const removeTag = value => {
form.value.ServiceType.push(value);// form.value.ServiceType.push(value); //
console.log(value,'value'); console.log(value, 'value');
ElMessageBox.confirm('关闭当前模板会重置数据!是否关闭?', '提示', { ElMessageBox.confirm('关闭当前模板会重置数据!是否关闭?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
}) }).then(async () => {
.then( async () => { let indexToRemove = await form.value.ServiceType.findIndex(item => item == value);
let indexToRemove = await form.value.ServiceType.findIndex(item => item == value); if (indexToRemove !== -1) {
if (indexToRemove !== -1) { form.value.ServiceType.splice(indexToRemove, 1);
form.value.ServiceType.splice(indexToRemove, 1); }
} if (form.value.ServiceType.length) {
Tabmenu.value = ServiceList.value.find(res => res.state).label;
}
if ($route.query.id || templateInfo.value.code) {
let data = {
checkType: value,
templateId: $route.query.id,
};
$_tempDelpriceTemplate(data).then(res => {
console.log(res, '删除成功返回值');
if (res.data.code == 200) {
ElMessage({
type: 'success',
message: res.data.msg,
});
//
if (form.value.ServiceType.length) { if (form.value.ServiceType.length) {
Tabmenu.value = ServiceList.value.find(res => res.state).label; Tabmenu.value = ServiceList.value.find(res => res.state).label;
} }
if ($route.query.id || templateInfo.value.code) { }
let data = { });
checkType:value, } else {
templateId: $route.query.id, ElMessage({
}; type: 'success',
$_tempDelpriceTemplate(data).then(res => { message: '操作成功',
console.log(res, '删除成功返回值'); });
if (res.data.code == 200) { }
ElMessage({ ServiceList.value.find(res => res.value == value).check = false;
type: 'success', ServiceList.value.find(res => res.value == value).state = false;
message: res.data.msg, });
});
//
if (form.value.ServiceType.length) {
Tabmenu.value = ServiceList.value.find(res => res.state).label;
}
}
});
} else {
ElMessage({
type: 'success',
message: '操作成功',
});
}
ServiceList.value.find(res => res.value == value).check = false;
ServiceList.value.find(res => res.value == value).state = false;
})
}; };
// //
const provideData = data => { const provideData = data => {
@ -369,7 +365,6 @@ const handleChange = () => {
.name { .name {
font-size: 16px; font-size: 16px;
} }
} }
} }

Loading…
Cancel
Save