snapshot before 拆分组件“

This commit is contained in:
lb 2023-03-09 09:42:46 +08:00
parent 70b2dd6f33
commit 3709d3a29f
3 changed files with 111 additions and 92 deletions

View File

@ -5,98 +5,91 @@
**/ **/
--> -->
<template> <template>
<div class="main-container"> <div class="list-view-with-head">
<div class="inner-sidebar"> <section class="ongoing-order" id="ongoing">
<a href="#ongoing" :class="{ active: activeTable === '#ongoing' }">进行中的订单</a> <BaseSearchForm
<a href="#pending" :class="{ active: activeTable === '#pending' }">等待订单</a> head-title="进行中的订单"
<a href="#finished" :class="{ active: activeTable === '#finished' }">完成订单</a> :head-config="{ fields: headConfigs.ongoingTableSearch }"
</div> @btn-click="handleBtnClick('ongoing', $event)"
/>
<BaseListTable
key="confirmed"
v-loading="tableLoadings.ongoing"
:table-config="null"
:column-config="tableConfigs.ongoingTable"
:table-data="dataLists.ongoing"
@operate-event="handleOperate('ongoing', $event)"
:refresh-layout-key="refreshLayoutKey"
/>
<div class="list-view-with-head"> <el-pagination
<section class="ongoing-order" id="ongoing"> class="mt-5 flex justify-end"
<BaseSearchForm @size-change="handleSizeChange('ongoing', $event)"
head-title="进行中的订单" @current-change="handlePageChange('ongoing', $event)"
:head-config="{ fields: headConfigs.ongoingTableSearch }" :current-page.sync="conditions.ongoing.page"
@btn-click="handleBtnClick('ongoing', $event)" :page-sizes="[1, 5, 10, 20]"
/> :page-size="conditions.ongoing.limit"
<BaseListTable :total="totalPage.ongoing"
key="confirmed" layout="total, sizes, prev, pager, next, jumper"
v-loading="tableLoadings.ongoing" ></el-pagination>
:table-config="null" </section>
:column-config="tableConfigs.ongoingTable"
:table-data="dataLists.ongoing"
@operate-event="handleOperate(type, $event)"
:refresh-layout-key="refreshLayoutKey"
/>
<el-pagination <section class="pending-order" id="pending">
class="mt-5 flex justify-end" <BaseSearchForm
@size-change="handleSizeChange('ongoing', $event)" head-title="等待中的订单"
@current-change="handlePageChange('ongoing', $event)" :head-config="{ fields: headConfigs.pendingTableSearch }"
:current-page.sync="conditions.ongoing.page" @btn-click="handleBtnClick('pending', $event)"
:page-sizes="[1, 5, 10, 20]" />
:page-size="conditions.ongoing.limit" <BaseListTable
:total="totalPage.ongoing" key="unconfirmed"
layout="total, sizes, prev, pager, next, jumper" v-loading="tableLoadings.pending"
></el-pagination> :table-config="null"
</section> :column-config="tableConfigs.pendingTable"
:table-data="dataLists.pending"
@operate-event="handleOperate(type, $event)"
:refresh-layout-key="refreshLayoutKey"
/>
<el-pagination
class="mt-5 flex justify-end"
@size-change="handleSizeChange('pending', $event)"
@current-change="handlePageChange('pending', $event)"
:current-page.sync="conditions.pending.page"
:page-sizes="[1, 5, 10, 20]"
:page-size="conditions.pending.limit"
:total="totalPage.pending"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
</section>
<section class="pending-order" id="pending"> <section class="finished-order" id="finished">
<BaseSearchForm <BaseSearchForm
head-title="等待中的订单" head-title="已完成订单"
:head-config="{ fields: headConfigs.pendingTableSearch }" :head-config="{ fields: headConfigs.finishedTableSearch }"
@btn-click="handleBtnClick('pending', $event)" @btn-click="handleBtnClick('finished', $event)"
/> />
<BaseListTable <BaseListTable
key="unconfirmed" key="ended"
v-loading="tableLoadings.pending" v-loading="tableLoadings.finished"
:table-config="null" :table-config="null"
:column-config="tableConfigs.pendingTable" :column-config="tableConfigs.finishedTable"
:table-data="dataLists.pending" :table-data="dataLists.finished"
@operate-event="handleOperate(type, $event)" @operate-event="handleOperate(type, $event)"
:refresh-layout-key="refreshLayoutKey" :refresh-layout-key="refreshLayoutKey"
/> />
<el-pagination
class="mt-5 flex justify-end"
@size-change="handleSizeChange('pending', $event)"
@current-change="handlePageChange('pending', $event)"
:current-page.sync="conditions.pending.page"
:page-sizes="[1, 5, 10, 20]"
:page-size="conditions.pending.limit"
:total="totalPage.pending"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
</section>
<section class="finished-order" id="finished"> <el-pagination
<BaseSearchForm class="mt-5 flex justify-end"
head-title="已完成订单" @size-change="handleSizeChange('finished', $event)"
:head-config="{ fields: headConfigs.finishedTableSearch }" @current-change="handlePageChange('finished', $event)"
@btn-click="handleBtnClick('finished', $event)" :current-page.sync="conditions.finished.page"
/> :page-sizes="[1, 5, 10, 20]"
<BaseListTable :page-size="conditions.finished.limit"
key="ended" :total="totalPage.finished"
v-loading="tableLoadings.finished" layout="total, sizes, prev, pager, next, jumper"
:table-config="null" ></el-pagination>
:column-config="tableConfigs.finishedTable" </section>
:table-data="dataLists.finished"
@operate-event="handleOperate(type, $event)"
:refresh-layout-key="refreshLayoutKey"
/>
<el-pagination <!-- <DialogWithMenu
class="mt-5 flex justify-end"
@size-change="handleSizeChange('finished', $event)"
@current-change="handlePageChange('finished', $event)"
:current-page.sync="conditions.finished.page"
:page-sizes="[1, 5, 10, 20]"
:page-size="conditions.finished.limit"
:total="totalPage.finished"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
</section>
<!-- <DialogWithMenu
ref="edit-dialog" ref="edit-dialog"
v-if="dialogType === DIALOG_WITH_MENU" v-if="dialogType === DIALOG_WITH_MENU"
:dialog-visible.sync="dialogVisible" :dialog-visible.sync="dialogVisible"
@ -110,7 +103,6 @@
:configs="subdialogConfigs" :configs="subdialogConfigs"
@refreshDataList="handleRefreshDatalist" @refreshDataList="handleRefreshDatalist"
/> --> /> -->
</div>
</div> </div>
</template> </template>
@ -119,6 +111,7 @@ import BaseListTable from "./BaseListTable.vue";
import BaseSearchForm from "./BaseSearchForm.vue"; import BaseSearchForm from "./BaseSearchForm.vue";
import DialogWithMenu from "@/components/DialogWithMenu.vue"; import DialogWithMenu from "@/components/DialogWithMenu.vue";
import DialogJustForm from "./DialogJustForm.vue"; import DialogJustForm from "./DialogJustForm.vue";
import moment from "moment";
const DIALOG_WITH_MENU = "DialogWithMenu"; const DIALOG_WITH_MENU = "DialogWithMenu";
const DIALOG_JUST_FORM = "DialogJustForm"; const DIALOG_JUST_FORM = "DialogJustForm";
@ -447,6 +440,22 @@ export default {
handleBtnClick(type, { btnName, payload }) { handleBtnClick(type, { btnName, payload }) {
switch (type) { switch (type) {
case "ongoing": { case "ongoing": {
if (btnName === "查询") {
let params = Object.assign({}, payload);
if ("timerange" in payload) {
//
if (!!payload.timerange) {
const [startTime, endTime] = payload["timerange"];
params.startTime = moment(startTime).format("YYYY-MM-DDTHH:mm:ss");
params.endTime = moment(endTime).format("YYYY-MM-DDTHH:mm:ss");
}
delete params.timerange;
}
console.log("[search form btn click]", Object.assign({}, this.conditions.ongoing, params));
//
this.getSpecificList("ongoing", Object.assign({}, this.conditions.ongoing, params));
}
} }
case "pending": case "pending":
break; break;

View File

@ -79,8 +79,8 @@ export default function () {
{ width: 120, prop: "deliveryTime", label: "发货时间" }, { width: 120, prop: "deliveryTime", label: "发货时间" },
{ width: 120, prop: "customerCode", label: "客户" }, { width: 120, prop: "customerCode", label: "客户" },
{ width: 120, prop: "pcsKilnCar", label: "托盘码放砖数", }, { width: 120, prop: "pcsKilnCar", label: "托盘码放砖数", },
{ width: 200, prop: "remark", label: "备注" },
{ prop: "description", label: "详情", subcomponent: TableTextComponent }, { prop: "description", label: "详情", subcomponent: TableTextComponent },
{ width: 200, prop: "remark", label: "备注" },
{ {
prop: "operations", prop: "operations",
name: "操作", name: "操作",
@ -98,6 +98,7 @@ export default function () {
label: '订单号', label: '订单号',
prop: 'code', prop: 'code',
input: true, input: true,
default: { value: '' },
bind: { placeholder: '请输入订单号' } bind: { placeholder: '请输入订单号' }
}, },
{ {

View File

@ -1,5 +1,14 @@
<template> <template>
<ListViewWithHead :table-configs="tableConfigs" :head-configs="headFormConfigs" :dialog-configs="dialogConfigs" /> <div class="main-container">
<div class="inner-sidebar">
<a href="#ongoing" :class="{ active: activeTable === '#ongoing' }">进行中的订单</a>
<a href="#pending" :class="{ active: activeTable === '#pending' }">等待订单</a>
<a href="#finished" :class="{ active: activeTable === '#finished' }">完成订单</a>
</div>
<ListViewWithHead :table-configs="tableConfigs" :head-configs="headFormConfigs" :dialog-configs="dialogConfigs" />
</div>
<!-- <div style="padding: 16px; background: #fff; border-radius: 8px"> <!-- <div style="padding: 16px; background: #fff; border-radius: 8px">
<el-table :data="dataList"> <el-table :data="dataList">
<el-table-column key="id" prop="id" label="ID"></el-table-column> <el-table-column key="id" prop="id" label="ID"></el-table-column>
@ -43,7 +52,7 @@ export default {
// { id: 4, name: "", age: 15 }, // { id: 4, name: "", age: 15 },
// { id: 5, name: "", age: 16 }, // { id: 5, name: "", age: 16 },
// ], // ],
// limit: 20 // limit: 20
// }; // };
}, },
created() {}, created() {},
@ -63,7 +72,7 @@ export default {
}, },
handleDown({ $index, row }) { handleDown({ $index, row }) {
// const { id } = row; // const { id } = row;
if ($index === this.limit) return; if ($index === this.limit) return;
const [item] = this.dataList.splice($index, 1); const [item] = this.dataList.splice($index, 1);
this.dataList.splice($index + 1, 0, item); this.dataList.splice($index + 1, 0, item);
}, },