| | |
| | | > |
| | | <template #top> |
| | | <div class="top-view" ref="refTopView"> |
| | | <div class="search-form"> |
| | | <Form :model="topForm" :label-width="110"> |
| | | <Row> |
| | | <Col span="6"> |
| | | <FormItem label="仓库编码:"> |
| | | <Input v-model="topForm.code" size="small"></Input> |
| | | </FormItem> |
| | | </Col> |
| | | <Col span="6"> |
| | | <FormItem label="仓库名称:"> |
| | | <Input v-model="topForm.name" size="small"></Input> |
| | | </FormItem> |
| | | </Col> |
| | | <Col span="6"> |
| | | <FormItem label="仓库负责人:"> |
| | | <Input v-model="topForm.leader" size="small"></Input> |
| | | </FormItem> |
| | | </Col> |
| | | <Col span="6"> |
| | | <FormItem label="仓库电话:"> |
| | | <Input v-model="topForm.tel" size="small"></Input> |
| | | </FormItem> |
| | | </Col> |
| | | </Row> |
| | | <Row> |
| | | <Col span="6"> |
| | | <FormItem label="上级仓库编码:"> |
| | | <Input v-model="topForm.topCode" size="small"></Input> |
| | | </FormItem> |
| | | </Col> |
| | | <Col span="6"> |
| | | <FormItem label="地址:"> |
| | | <Input v-model="topForm.address" size="small"></Input> |
| | | </FormItem> |
| | | </Col> |
| | | <Col span="4"> |
| | | <FormItem :label-width="34"> |
| | | <Checkbox v-model="topForm.isThisLevel" size="small" |
| | | >是否本级</Checkbox |
| | | > |
| | | </FormItem> |
| | | </Col> |
| | | <Col span="4"> |
| | | <FormItem :label-width="34"> |
| | | <Checkbox v-model="topForm.isEscorw" size="small" |
| | | >是否代管</Checkbox |
| | | > |
| | | </FormItem> |
| | | </Col> |
| | | <Col span="4"> |
| | | <FormItem :label-width="34"> |
| | | <Checkbox v-model="topForm.isEnable" size="small" |
| | | >是否启用</Checkbox |
| | | > |
| | | </FormItem> |
| | | </Col> |
| | | </Row> |
| | | </Form> |
| | | </div> |
| | | <div class="buttons"> |
| | | <Button type="warning" size="small" @click="onClearClick" |
| | | >清空查询</Button |
| | | > |
| | | </div> |
| | | <DataTable |
| | | :tableHeight="tableTopHeight" |
| | | :buttons="topButtons" |
| | | :formObject="topFormObject" |
| | | :height="topHeight" |
| | | :columns="topColumns" |
| | | :data="topData" |
| | | :page="topPage" |
| | |
| | | :limits="topLimits" |
| | | :total="topTotal" |
| | | :loading="topLoading" |
| | | pagePlacement="top" |
| | | highlight-row |
| | | @on-current-change="onCurrentChange" |
| | | @on-change="onPageChange" |
| | |
| | | <template #bottom> |
| | | <div class="bottom-view" ref="refBottomView"> |
| | | <DataTable |
| | | :tableHeight="tableBottomHeight" |
| | | :showForm="false" |
| | | :showTopButtons="false" |
| | | :height="bottomHeight" |
| | | :columns="bottomColumns" |
| | | :data="bottomData" |
| | | :paged="false" |
| | | size="small" |
| | | @on-row-click="onBottomRowClick" |
| | | ></DataTable> |
| | | </div> |
| | | </template> |
| | | </Split> |
| | | <Drawer |
| | | title="演示" |
| | | closable |
| | | v-model="thirdDataDialog.visible" |
| | | :width="thirdDataDialog.width" |
| | | :mask-closable="false" |
| | | :mask="false" |
| | | draggable |
| | | > |
| | | <p>Some contents...</p> |
| | | <p>Some contents...</p> |
| | | <p>Some contents...</p> |
| | | </Drawer> |
| | | <Spin fix :show="loading" /> |
| | | </div> |
| | | </template> |
| | |
| | | return { |
| | | // 分隔比例 |
| | | split: 0.8, |
| | | topFormObject: { |
| | | options: {}, |
| | | items: [], |
| | | }, |
| | | // 主表参数定义 |
| | | topButtons: [ |
| | | { |
| | | showName: "清空查询", |
| | | onClick: () => this.onClearClick(), |
| | | }, |
| | | ], |
| | | topColumns: [], |
| | | topData: [], |
| | | tableTopHeight: 0, |
| | | tableBottomHeight: 0, |
| | | topHeight: 0, |
| | | bottomHeight: 0, |
| | | topForm: { |
| | | code: "", |
| | | name: "", |
| | |
| | | // 从表参数定义 |
| | | bottomColumns: [], |
| | | bottomData: [], |
| | | // 三级数据演示 |
| | | thirdDataDialog: { |
| | | visible: false, |
| | | width: 500, |
| | | }, |
| | | |
| | | loading: false, |
| | | }; |
| | | }, |
| | | methods: { |
| | | async loadTopForm() { |
| | | this.topFormObject.options = { |
| | | labelWidth: 110, |
| | | }; |
| | | this.topFormObject.items = [ |
| | | { |
| | | label: "仓库编码:", |
| | | field: "SupplierCode", |
| | | value: "", |
| | | type: "input", |
| | | span: 6, |
| | | }, |
| | | { |
| | | label: "仓库名称:", |
| | | field: "SupplierName", |
| | | value: "", |
| | | type: "input", |
| | | span: 6, |
| | | }, |
| | | { |
| | | label: "仓库负责人:", |
| | | field: "ASNCode", |
| | | value: "", |
| | | type: "input", |
| | | span: 6, |
| | | }, |
| | | { |
| | | label: "仓库电话:", |
| | | field: "Invertory", |
| | | value: "", |
| | | type: "input", |
| | | span: 6, |
| | | }, |
| | | { |
| | | label: "上级仓库编码:", |
| | | field: "PurchaseOrderNo", |
| | | value: "", |
| | | type: "input", |
| | | span: 6, |
| | | }, |
| | | { |
| | | label: "地址:", |
| | | field: "OrderDate", |
| | | value: "", |
| | | type: "input", |
| | | span: 18, |
| | | }, |
| | | { |
| | | label: "是否本级", |
| | | field: "isThisLevel", |
| | | value: false, |
| | | type: "checkbox", |
| | | span: 6, |
| | | onChange: () => {}, |
| | | }, |
| | | { |
| | | label: "是否代管", |
| | | field: "isEscorw", |
| | | value: false, |
| | | type: "checkbox", |
| | | span: 6, |
| | | onChange: () => {}, |
| | | }, |
| | | { |
| | | label: "是否启用", |
| | | field: "isEnable", |
| | | value: false, |
| | | type: "checkbox", |
| | | span: 6, |
| | | onChange: () => {}, |
| | | }, |
| | | ]; |
| | | }, |
| | | async loadTopColumns() { |
| | | this.topColumns = [ |
| | | { |
| | |
| | | }, |
| | | resize() { |
| | | this.$nextTick(() => { |
| | | let topHeight = |
| | | this.refTopView.clientHeight - |
| | | this.$el.querySelector(".search-form").clientHeight - |
| | | this.$el.querySelector(".buttons").clientHeight - |
| | | 9; |
| | | this.tableTopHeight = topHeight; |
| | | this.topHeight = this.refTopView.clientHeight - 10; |
| | | let bottomHeight = this.refBottomView.clientHeight - 9; |
| | | this.tableBottomHeight = bottomHeight; |
| | | this.bottomHeight = bottomHeight; |
| | | }); |
| | | }, |
| | | // 主表切换选择行时触发 |
| | |
| | | onClearClick() { |
| | | this.reset(); |
| | | }, |
| | | onBottomRowClick(row, index) { |
| | | this.showThirdData(row); |
| | | }, |
| | | showThirdData() { |
| | | this.thirdDataDialog.visible = true; |
| | | }, |
| | | reset() { |
| | | this.topForm.code = ""; |
| | | this.topForm.name = ""; |
| | |
| | | }, |
| | | }, |
| | | async mounted() { |
| | | await this.loadTopForm(); |
| | | await this.loadTopColumns(); |
| | | await this.loadBottomColumns(); |
| | | this.$nextTick(async () => { |
| | |
| | | height: 100%; |
| | | .top-view { |
| | | height: 100%; |
| | | .search-form, |
| | | .buttons { |
| | | .search-form { |
| | | margin-bottom: 9px; |
| | | } |
| | | } |