|
@@ -1,7 +1,7 @@
|
|
<template>
|
|
<template>
|
|
<div class="my-container">
|
|
<div class="my-container">
|
|
<div class="bill-main">
|
|
<div class="bill-main">
|
|
- <module-view :propConfig="config" ref="moduleView" @pagination="getDataList" @search="search" @resert="onRefresh"
|
|
|
|
|
|
+ <module-view :propConfig="config" ref="moduleView" @pagination="getDataList" @search="getDataList" @resert="onRefresh"
|
|
@detail="shortBarge" @onRefresh="onRefresh">
|
|
@detail="shortBarge" @onRefresh="onRefresh">
|
|
</module-view>
|
|
</module-view>
|
|
</div>
|
|
</div>
|
|
@@ -34,7 +34,7 @@
|
|
label: '标题',
|
|
label: '标题',
|
|
prop: 'skuTitle',
|
|
prop: 'skuTitle',
|
|
component: 'by-input',
|
|
component: 'by-input',
|
|
- labelWidth: '70px',
|
|
|
|
|
|
+ // labelWidth: '70px',
|
|
compConfig: {
|
|
compConfig: {
|
|
attr: {
|
|
attr: {
|
|
placeholder: '请输入标题',
|
|
placeholder: '请输入标题',
|
|
@@ -47,7 +47,7 @@
|
|
label: '物料编码',
|
|
label: '物料编码',
|
|
prop: 'skuCode',
|
|
prop: 'skuCode',
|
|
component: 'by-input',
|
|
component: 'by-input',
|
|
- labelWidth: '70px',
|
|
|
|
|
|
+ // labelWidth: '70px',
|
|
compConfig: {
|
|
compConfig: {
|
|
attr: {
|
|
attr: {
|
|
placeholder: '请输入物料编码',
|
|
placeholder: '请输入物料编码',
|
|
@@ -81,14 +81,14 @@
|
|
},
|
|
},
|
|
columns: [
|
|
columns: [
|
|
{
|
|
{
|
|
- width: '200px',
|
|
|
|
|
|
+ // width: '200px',
|
|
title: '标题',
|
|
title: '标题',
|
|
field: 'skuTitle',
|
|
field: 'skuTitle',
|
|
// isDetail: true,
|
|
// isDetail: true,
|
|
fixed: 'left'
|
|
fixed: 'left'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- width: '200px',
|
|
|
|
|
|
+ // width: '200px',
|
|
title: '副标题',
|
|
title: '副标题',
|
|
field: 'skuSubtitle',
|
|
field: 'skuSubtitle',
|
|
},
|
|
},
|
|
@@ -128,8 +128,62 @@
|
|
return
|
|
return
|
|
}
|
|
}
|
|
clearInterval(this.timer)
|
|
clearInterval(this.timer)
|
|
- this.getPageList();
|
|
|
|
|
|
+ // this.getPageList(); //旧代码无分页
|
|
|
|
+
|
|
|
|
+ // 新分页
|
|
|
|
+ let query = (this.$refs.moduleView as any).getQuery();
|
|
|
|
+ this.newsGetPageList(query)
|
|
}
|
|
}
|
|
|
|
+ // 新分页
|
|
|
|
+ newsGetPageList(query : any) {
|
|
|
|
+ let loading = this.$loading({ target: '.main-container' });
|
|
|
|
+ api.getMaterialInventory().then((res : any) => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.skuInfo = res.data;
|
|
|
|
+ } else loading.close();
|
|
|
|
+ }).then(() => {
|
|
|
|
+ api.pageList({}, 'maindataStorehouse').then((res : any) => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.storeHouseInfo = res.data.records;
|
|
|
|
+ } else loading.close();
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ let moduleConfig = (this as any).$lodash.cloneDeep(this.config.table);
|
|
|
|
+ this.storeHouseInfo = res.data.records;
|
|
|
|
+ res.data.records.map((v : any, i : any) => {
|
|
|
|
+ moduleConfig.columns.push({
|
|
|
|
+ // width: '150px',
|
|
|
|
+ title: v.name,
|
|
|
|
+ field: 'custom' + i,
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ (this as any).$refs.moduleView.setTableConfig(moduleConfig);
|
|
|
|
+ }
|
|
|
|
+ }).then(() => {
|
|
|
|
+ api.pageList(query, 'maindataMaterialSku').then((res : any) => {
|
|
|
|
+ loading.close();
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ for (let i = 0; i < res.data.records.length; i++) {
|
|
|
|
+ for (let j = 0; j < this.storeHouseInfo.length; j++) {
|
|
|
|
+ let nowData = this.skuInfo.filter((v : any) => v.skuId == res.data.records[i].id && v.storeHouseId == this.storeHouseInfo[j].id);
|
|
|
|
+ if (nowData[0]) res.data.records[i]['custom' + j] = nowData[0].inventory;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ (this.$refs.moduleView as any).setTableValue(res.data.records);
|
|
|
|
+ this.tableInfo = res.data.records;
|
|
|
|
+ loading.close();
|
|
|
|
+ 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());
|
|
|
|
+ }).catch(() => loading.close());
|
|
|
|
+ }).catch(() => loading.close());
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //旧代码无分页
|
|
getPageList() {
|
|
getPageList() {
|
|
let loading = this.$loading({ target: '.main-container' });
|
|
let loading = this.$loading({ target: '.main-container' });
|
|
api.getMaterialInventory().then((res : any) => {
|
|
api.getMaterialInventory().then((res : any) => {
|
|
@@ -137,10 +191,7 @@
|
|
this.skuInfo = res.data;
|
|
this.skuInfo = res.data;
|
|
} else loading.close();
|
|
} else loading.close();
|
|
}).then(() => {
|
|
}).then(() => {
|
|
- api.pageList({
|
|
|
|
- pageNum: 1,
|
|
|
|
- pageSize: 9999,
|
|
|
|
- }, 'maindataStorehouse').then((res : any) => {
|
|
|
|
|
|
+ api.pageList({}, 'maindataStorehouse').then((res : any) => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
this.storeHouseInfo = res.data.records;
|
|
this.storeHouseInfo = res.data.records;
|
|
} else loading.close();
|
|
} else loading.close();
|
|
@@ -176,8 +227,8 @@
|
|
}
|
|
}
|
|
}).then(() => {
|
|
}).then(() => {
|
|
api.pageList({
|
|
api.pageList({
|
|
- pageNum: 1,
|
|
|
|
- pageSize: 9999
|
|
|
|
|
|
+ pageNo: 1,
|
|
|
|
+ pageSize: 20,
|
|
}, 'maindataMaterialSku').then((res : any) => {
|
|
}, 'maindataMaterialSku').then((res : any) => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
for (let i = 0; i < res.data.records.length; i++) {
|
|
for (let i = 0; i < res.data.records.length; i++) {
|