|
@@ -1,9 +1,220 @@
|
|
|
<template>
|
|
|
-
|
|
|
+ <div class="my-container">
|
|
|
+ <div class="bill-main">
|
|
|
+ <module-view :propConfig="config" ref="moduleView" @pagination="getDataList" @search="getDataList"
|
|
|
+ @resert="onRefresh" @detail="shortBarge" @onRefresh="onRefresh">
|
|
|
+ </module-view>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
-
|
|
|
-<script>
|
|
|
+<script lang="ts">
|
|
|
+ import { Component, Prop, Vue, Watch } from "vue-property-decorator";
|
|
|
+ import api from "@/api/currency";
|
|
|
+ @Component
|
|
|
+ export default class Store extends Vue {
|
|
|
+ timeNum = 0;
|
|
|
+ timer : any = null
|
|
|
+ config : any = {
|
|
|
+ attr: {
|
|
|
+ calculateH: true
|
|
|
+ },
|
|
|
+ search: {
|
|
|
+ attr: {
|
|
|
+ size: 'mini',
|
|
|
+ },
|
|
|
+ columns: [
|
|
|
+ [
|
|
|
+ {
|
|
|
+ span: 6,
|
|
|
+ label: '物料编码',
|
|
|
+ prop: 'skuCode',
|
|
|
+ component: 'by-input',
|
|
|
+ labelWidth: '70px',
|
|
|
+ compConfig: {
|
|
|
+ attr: {
|
|
|
+ placeholder: '请输入物料编码',
|
|
|
+ clearable: true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ tool: {
|
|
|
+ tools: {
|
|
|
+ refresh: true,
|
|
|
+ search: true,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ table: {
|
|
|
+ attr: {
|
|
|
+ size: 'mini',
|
|
|
+ align: 'left',
|
|
|
+ // checkbox: true,
|
|
|
+ },
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ width: '200px',
|
|
|
+ title: '标题',
|
|
|
+ field: 'skuTitle',
|
|
|
+ // isDetail: true,
|
|
|
+ fixed: 'left'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: '200px',
|
|
|
+ title: '副标题',
|
|
|
+ field: 'skuSubtitle',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: '140px',
|
|
|
+ title: '物料编码',
|
|
|
+ field: 'skuCode',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: '140px',
|
|
|
+ title: '',
|
|
|
+ field: 'financialCode2',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: '140px',
|
|
|
+ title: '',
|
|
|
+ field: 'financialCode3',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: '140px',
|
|
|
+ title: '',
|
|
|
+ field: 'financialCode4',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: '140px',
|
|
|
+ title: '',
|
|
|
+ field: 'financialCode5',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: '140px',
|
|
|
+ title: '',
|
|
|
+ field: 'financialCode6',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: '140px',
|
|
|
+ title: '',
|
|
|
+ field: 'financialCode7',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ width: 120,
|
|
|
+ title: '操作',
|
|
|
+ action: true,
|
|
|
+ plugins: [{
|
|
|
+ name: '短驳',
|
|
|
+ event: {
|
|
|
+ click: (item : any) => {
|
|
|
+ (this as any).shortBarge(item)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }, {
|
|
|
+ name: '调拨',
|
|
|
+ event: {
|
|
|
+ click: (item : any) => (this as any).allocate(item)
|
|
|
+ }
|
|
|
+ }]
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ }
|
|
|
+ mounted() {
|
|
|
+ this.timer = setInterval(() => {
|
|
|
+ this.getMaindataStorehouse()
|
|
|
+ this.getDataList()
|
|
|
+ }, 300)
|
|
|
+ }
|
|
|
+ // 获取仓库信息
|
|
|
+ getMaindataStorehouse(){
|
|
|
+ let moduleConfig = (this as any).$lodash.cloneDeep(this.config.table);
|
|
|
+ moduleConfig.columns.push({
|
|
|
+ width: '140px',
|
|
|
+ title: '财务编号2',
|
|
|
+ field: 'financialCode2',
|
|
|
+ })
|
|
|
+ console.log(moduleConfig);
|
|
|
+ api.pageList({}, 'maindataStorehouse').then(res => {
|
|
|
+ console.log(res);
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 获取列表数据
|
|
|
+ getDataList() {
|
|
|
+ if (!this.$refs.moduleView) {
|
|
|
+ if (this.timeNum > 5) {
|
|
|
+ clearInterval(this.timer)
|
|
|
+ }
|
|
|
+ this.timeNum++;
|
|
|
+ return
|
|
|
+ }
|
|
|
+ clearInterval(this.timer)
|
|
|
+ let query = (this.$refs.moduleView as any).getQuery();
|
|
|
+ this.getPageList(query);
|
|
|
+ }
|
|
|
+ getPageList(query : any) {
|
|
|
+ let loading = this.$loading({ target: '.main-container' });
|
|
|
+ api.pageList(query, 'maindataMaterialSku').then((res : any) => {
|
|
|
+ loading.close();
|
|
|
+ if (res.code === 200) {
|
|
|
+ (this.$refs.moduleView as any).setTableValue(res.data.records);
|
|
|
+ let page = {
|
|
|
+ pageNo: res.data.current, //当前页
|
|
|
+ pageSize: res.data.size, //每页条数
|
|
|
+ total: res.data.total //总条数
|
|
|
+ };
|
|
|
+ (this.$refs.moduleView as any).setPage(page);
|
|
|
+ } else this.$message.error(res.msg);
|
|
|
+ }).catch(() => loading.close());
|
|
|
+ }
|
|
|
+ // 短驳
|
|
|
+ shortBarge(e : any) {
|
|
|
+ console.log(e);
|
|
|
+ }
|
|
|
+ // 调拨
|
|
|
+ allocate(item : any) {
|
|
|
+ console.log(item);
|
|
|
+ }
|
|
|
+ // 刷新/重置
|
|
|
+ onRefresh() {
|
|
|
+ (this as any).$refs.moduleView.clearSearch();
|
|
|
+ this.getDataList();
|
|
|
+ }
|
|
|
+ }
|
|
|
</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+ .my-container {
|
|
|
+ width: 100%;
|
|
|
+ box-sizing: border-box;
|
|
|
+ display: flex;
|
|
|
+ padding: 16px;
|
|
|
+ height: 100%;
|
|
|
+
|
|
|
+ .bill-left {
|
|
|
+ position: relative;
|
|
|
+ border-right: solid #EEE 1px;
|
|
|
+ flex-shrink: 0;
|
|
|
+
|
|
|
+ .bill-tab {
|
|
|
+ width: 150px;
|
|
|
+ height: 100%;
|
|
|
+ transition: all .5s;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+
|
|
|
+ .tab-title {
|
|
|
+ font-size: 16px;
|
|
|
+ padding-bottom: 16px;
|
|
|
+ width: 200px;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
-<style>
|
|
|
+ .bill-main {
|
|
|
+ width: 100%;
|
|
|
+ box-sizing: border-box;
|
|
|
+ position: relative;
|
|
|
+ height: 100%;
|
|
|
+ overflow-y: hidden;
|
|
|
+ }
|
|
|
+ }
|
|
|
</style>
|