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"> <div id="avue-view" v-show="!isSearch" v-if="isRefresh">
<router-view #="{ Component }"> <router-view #="{ Component }">
<!-- <keep-alive :include="$store.getters.tagsKeep"> --> <keep-alive :include="$store.getters.tagsKeep">
<component :is="Component" /> <component :is="Component" />
<!-- </keep-alive> --> </keep-alive>
</router-view> </router-view>
</div> </div>
</div> </div>

4
src/page/index/layout.vue

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

5
src/router/avue-router.js

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

1
src/router/index.js

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

27
src/router/views/index.js

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

5
src/store/getters.js

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

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

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

Loading…
Cancel
Save