Browse Source

缓存

master
pengsong 1 year ago
parent
commit
2c5d9edfc1
  1. 4
      src/page/index/index.vue
  2. 4
      src/page/index/layout.vue
  3. 5
      src/router/avue-router.js
  4. 1
      src/router/index.js
  5. 27
      src/router/views/index.js
  6. 5
      src/store/getters.js
  7. 188
      src/views/distribution/deliverylist/distributionDeliveryListmar.vue

4
src/page/index/index.vue

@ -15,9 +15,9 @@
<!-- 主体视图层 -->
<div id="avue-view" v-show="!isSearch" v-if="isRefresh">
<router-view #="{ Component }">
<!-- <keep-alive :include="$store.getters.tagsKeep"> -->
<keep-alive :include="$store.getters.tagsKeep">
<component :is="Component" />
<!-- </keep-alive> -->
</keep-alive>
</router-view>
</div>
</div>

4
src/page/index/layout.vue

@ -1,7 +1,7 @@
<template>
<router-view #="{ Component }">
<!-- <keep-alive :include="$store.getters.tagsKeep"> -->
<keep-alive :include="$store.getters.tagsKeep">
<component :is="Component" />
<!-- </keep-alive> -->
</keep-alive>
</router-view>
</template>

5
src/router/avue-router.js

@ -58,7 +58,6 @@ RouterPlugin.install = function (option = {}) {
if (option.keepAlive) {
meta.keepAlive = option.keepAlive;
}
const isChild = !!(children && children.length !== 0);
const oRouter = {
path: path,
@ -132,7 +131,7 @@ export const formatPath = (ele, first) => {
const propsDefault = website.menu;
const icon = ele[propsDefault.icon];
ele[propsDefault.icon] = !icon ? propsDefault.iconDefault : icon;
ele.meta = { keepAlive: ele.isOpen === 2 };
ele.meta = { keepAlive: ele.isOpen == 2 };
const iframeComponent = 'components/iframe/main';
const iframeSrc = href => {
return href.replace(/&/g, '#');
@ -149,7 +148,7 @@ export const formatPath = (ele, first) => {
ele[propsDefault.children] &&
ele[propsDefault.children].forEach(child => {
child.component = 'views' + child[propsDefault.path];
child.meta = { keepAlive: child.isOpen === 2 };
child.meta = { keepAlive: child.isOpen == 2 };
if (isURL(child[propsDefault.href])) {
let href = child[propsDefault.href];
child[propsDefault.path] = ele[propsDefault.path] + '/' + child.code;

1
src/router/index.js

@ -14,6 +14,7 @@ AvueRouter.install({
store: Store,
router: Router,
i18n: i18n,
keepAlive: true
});
Router.$avueRouter.formatRoutes(Store.getters.menuAll, true);

27
src/router/views/index.js

@ -688,6 +688,7 @@ export default [
name: '配送查看',
meta: {
i18n: 'dict',
keepAlive:true
},
props: route => ({
name: route.query.name,
@ -1051,20 +1052,20 @@ export default [
},
],
},
// 下面的代码为 商场客户端的页面
// 下面的代码为 商场客户端的页面
{
path: '/mail/order/add',
component: Layout,
redirect: '/mail/order/add',
children: [
{
path: '/mail/order/add',
name: '新建商场预约单',
component: () => import('@/views/mail/order/add.vue'),
},
],
},
{
path: '/mail/order/add',
component: Layout,
redirect: '/mail/order/add',
children: [
{
path: '/mail/order/add',
name: '新建商场预约单',
component: () => import('@/views/mail/order/add.vue'),
},
],
},
// {

5
src/store/getters.js

@ -15,15 +15,12 @@ const getters = {
lockPasswd: state => state.common.lockPasswd,
tagList: state => state.tags.tagList,
tagsKeep: (state, getters) => {
console.log(getters.tagList,'-----')
return getters.tagList
.filter(ele => {
return (ele.meta || {}).keepAlive;
})
.map(ele => {
console.log('ele :>> ', ele);
const path = ele.path;
const reg = new RegExp(path, 'g');
console.log('reg', reg);
return ele.fullPath;
});
},

188
src/views/distribution/deliverylist/distributionDeliveryListmar.vue

@ -33,34 +33,14 @@
</el-select>
</el-form-item>
<el-form-item label="配送司机:">
<el-select
v-model="query.driverName"
filterable
placeholder="请输入司机名称"
:loading="loading"
>
<el-option
v-for="item in driverData"
:key="item.dictKey"
:label="item.dictValue"
:value="item.dictValue"
>
<el-select v-model="query.driverName" filterable placeholder="请输入司机名称" :loading="loading">
<el-option v-for="item in driverData" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="配送车辆:">
<el-select
v-model="query.vehicleName"
filterable
placeholder="请输入司机名称"
:loading="loading"
>
<el-option
v-for="item in vehicleData"
:key="item.dictKey"
:label="item.dictValue"
:value="item.dictValue"
>
<el-select v-model="query.vehicleName" filterable placeholder="请输入司机名称" :loading="loading">
<el-option v-for="item in vehicleData" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue">
</el-option>
</el-select>
</el-form-item>
@ -104,12 +84,9 @@
<div class="avue-crud__header">
<!-- 头部左侧按钮模块 -->
<div class="avue-crud__left" style="margin-top: 20px">
<el-button type="primary" icon="el-icon-plus" @click="printBatchOrder"
>批量打印</el-button
>
<el-button type="primary" icon="el-icon-plus" @click="printBatchOrder">批量打印</el-button>
<!-- <el-button type="danger" icon="el-icon-delete" @click="handleDelete" plain> </el-button>-->
<el-button type="danger" icon="el-icon-download" @click="handleExportInfo" plain
>导出
<el-button type="danger" icon="el-icon-download" @click="handleExportInfo" plain>导出
</el-button>
</div>
<!-- 头部右侧按钮模块 -->
@ -122,29 +99,15 @@
</el-row>
<el-row>
<!-- 列表模块 -->
<tablecmt
:columnList="columnList"
:tableData="data"
:loading="loading"
@inputTxt="inputsc"
@timeCheck="timesc"
@btnCheck="btnsc"
@selectCheck="selectsc"
@selection="selectionsc"
>
<tablecmt :columnList="columnList" :tableData="data" :loading="loading" @inputTxt="inputsc" @timeCheck="timesc"
@btnCheck="btnsc" @selectCheck="selectsc" @selection="selectionsc">
<template #default="slotProps">
<el-text size="small" @click="printOrder(slotProps.scope.row)"> </el-text>
<el-text size="small" @click="editsolt(slotProps.scope)"> </el-text>
<el-text size="small" @click="editmap(slotProps.scope)"> </el-text>
<el-text
size="small"
v-if="
slotProps.scope.row.deliveryStatusName !== '已完成' ||
slotProps.scope.row.deliveryStatus !== '3'
"
@click="handleEdit(slotProps.scope)"
> </el-text
>
<el-text size="small" v-if="slotProps.scope.row.deliveryStatusName !== '已完成' ||
slotProps.scope.row.deliveryStatus !== '3'
" @click="handleEdit(slotProps.scope)"> </el-text>
<!-- <el-button size="small" @click="costadd(slotProps.scope)"> </el-button>-->
</template>
@ -182,17 +145,9 @@
<div class="avue-crud__pagination flex-c-sb" style="width: 100%">
<div style="font-size: 14px">勾选数量: {{ selectionList.length }}</div>
<!-- 分页模块 -->
<el-pagination
align="right"
background
@size-change="sizeChange"
@current-change="currentChange"
:current-page="page.currentPage"
:page-sizes="[30, 50, 80, 120]"
:page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="page.total"
>
<el-pagination align="right" background @size-change="sizeChange" @current-change="currentChange"
:current-page="page.currentPage" :page-sizes="[30, 50, 80, 120]" :page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper" :total="page.total">
</el-pagination>
</div>
</el-row>
@ -219,80 +174,34 @@
</el-dialog>
</div>
<el-dialog
v-model="dialogVisible"
title="增值服务"
width="30%"
:model="addvalue"
:before-close="handleClose"
>
<el-dialog v-model="dialogVisible" title="增值服务" width="30%" :model="addvalue" :before-close="handleClose">
<el-form-item label="增值服务" prop="freightMark">
<el-checkbox-group v-model="form.addvalueType" @change="handleCheckedCitiesChange">
<el-checkbox
style="width: 100%; margin-bottom: 3%"
v-for="(item, index) in addvalueServeTypeData"
:key="item.dictKey"
:label="item.dictKey"
>{{ item.dictValue }}
<span v-if="index === 0 || index === 6 || index === 2 || index === 4"
>&nbsp;件数:
<el-input
type="number"
v-model="item.f"
:disabled="this.form?.freightMark?.indexOf(item.dictKey) == -1"
@change="textbox($event, index, 1)"
style="width: 20%; border: none; border-bottom: 2px solid #eee"
/>
<el-checkbox style="width: 100%; margin-bottom: 3%" v-for="(item, index) in addvalueServeTypeData"
:key="item.dictKey" :label="item.dictKey">{{ item.dictValue }}
<span v-if="index === 0 || index === 6 || index === 2 || index === 4">&nbsp;件数:
<el-input type="number" v-model="item.f" :disabled="this.form?.freightMark?.indexOf(item.dictKey) == -1"
@change="textbox($event, index, 1)" style="width: 20%; border: none; border-bottom: 2px solid #eee" />
</span>
<span v-if="index === 1"
>公里:
<el-input
type="primary"
v-model="item.a"
:disabled="this.form?.freightMark?.indexOf(item.dictKey) == -1"
@change="textbox($event, index, 2)"
style="width: 20%; border: none; border-bottom: 2px solid #eee"
/>
<span v-if="index === 1">公里:
<el-input type="primary" v-model="item.a" :disabled="this.form?.freightMark?.indexOf(item.dictKey) == -1"
@change="textbox($event, index, 2)" style="width: 20%; border: none; border-bottom: 2px solid #eee" />
</span>
<span v-if="index === 3"
>距离:
<el-input
type="number"
v-model="item.b"
:disabled="this.form?.freightMark?.indexOf(item.dictKey) == -1"
@change="textbox($event, index, 3)"
style="width: 20%; border: none; border-bottom: 2px solid #eee"
/>
<span v-if="index === 3">距离:
<el-input type="number" v-model="item.b" :disabled="this.form?.freightMark?.indexOf(item.dictKey) == -1"
@change="textbox($event, index, 3)" style="width: 20%; border: none; border-bottom: 2px solid #eee" />
</span>
<span v-if="index === 5"
>人数:
<el-input
type="number"
v-model="item.c"
:disabled="this.form?.freightMark?.indexOf(item.dictKey) == -1"
@change="textbox($event, index, 4)"
style="width: 20%; border: none; border-bottom: 2px solid #eee"
/>
<span v-if="index === 5">人数:
<el-input type="number" v-model="item.c" :disabled="this.form?.freightMark?.indexOf(item.dictKey) == -1"
@change="textbox($event, index, 4)" style="width: 20%; border: none; border-bottom: 2px solid #eee" />
</span>
<span v-if="index === 0"
>楼层:
<el-input
type="number"
v-model="item.d"
:disabled="this.form?.freightMark?.indexOf(item.dictKey) == -1"
@change="textbox($event, index, 5)"
style="width: 20%; border: none; border-bottom: 2px solid #eee"
/>
<span v-if="index === 0">楼层:
<el-input type="number" v-model="item.d" :disabled="this.form?.freightMark?.indexOf(item.dictKey) == -1"
@change="textbox($event, index, 5)" style="width: 20%; border: none; border-bottom: 2px solid #eee" />
</span>
<span v-if="item"
>预计费用:
<el-input
type="number"
v-model="item.e"
:disabled="this.form?.freightMark?.indexOf(item.dictKey) == -1"
@change="textbox($event, index, 6)"
style="width: 20%; border: none; border-bottom: 2px solid #eee"
/>
<span v-if="item">预计费用:
<el-input type="number" v-model="item.e" :disabled="this.form?.freightMark?.indexOf(item.dictKey) == -1"
@change="textbox($event, index, 6)" style="width: 20%; border: none; border-bottom: 2px solid #eee" />
</span>
</el-checkbox>
</el-checkbox-group>
@ -305,12 +214,8 @@
</template>
</el-dialog>
</basic-container>
<edittablehead
@setcolum="setnewcolum"
@closce="showdrawer"
:drawerShow="drawerShow"
:columnList="columnList"
></edittablehead>
<edittablehead @setcolum="setnewcolum" @closce="showdrawer" :drawerShow="drawerShow" :columnList="columnList">
</edittablehead>
</template>
<script>
@ -732,6 +637,7 @@ export default {
return new Promise((rv, rev) => {
getVehicleList(1, 10, '').then(res => {
const data = res.data.data;
if (!data.records) return
let po = [];
data.records.forEach(item => {
let a = {
@ -877,7 +783,7 @@ export default {
.then(_ => {
done();
})
.catch(_ => {});
.catch(_ => { });
},
editsolt(scope) {
const { row } = scope;
@ -1205,6 +1111,7 @@ export default {
width: fit-content;
}
}
.order-info {
ul {
list-style: none;
@ -1218,10 +1125,12 @@ export default {
display: flex;
align-items: center;
font-weight: 500;
img {
margin-right: 4px;
}
}
li::after {
content: '';
display: block;
@ -1233,55 +1142,68 @@ export default {
left: 0px;
}
}
li:first-child::after {
content: none;
}
li:first-child {
padding-left: 0;
}
}
.avue-crud__header {
// align-items: flex-end !important;
}
//
.el-times {
:deep(.el-tooltip__trigger) {
height: 30px !important;
}
}
.el-btn {
min-width: 200px;
margin-right: 0 !important;
:deep(.el-form-item__content) {
width: 180px;
justify-content: flex-end;
}
}
.avue-crud__right {
display: flex;
align-items: center;
}
.fr-fo {
display: flex;
}
:deep(.avue-crud__header) {
.avue-crud__left {
margin-top: 0 !important;
}
}
:deep(.avue-crud) {
display: flex;
height: 100%;
flex-direction: column;
}
:deep(.el-card__body) {
height: 100%;
}
:deep(.el-card) {
height: 100%;
display: flex;
flex-direction: column;
}
.el-fy {
flex: 1;
display: flex;

Loading…
Cancel
Save