|
@@ -24,6 +24,7 @@
|
|
isShow : any = 'home'
|
|
isShow : any = 'home'
|
|
timeNum = 0;
|
|
timeNum = 0;
|
|
calculateCount = 0;
|
|
calculateCount = 0;
|
|
|
|
+ baseInfo : any = ''
|
|
timer : any = null
|
|
timer : any = null
|
|
toolConfig = {
|
|
toolConfig = {
|
|
tools: {
|
|
tools: {
|
|
@@ -31,13 +32,13 @@
|
|
save: true,
|
|
save: true,
|
|
},
|
|
},
|
|
customTools: [
|
|
customTools: [
|
|
- // {
|
|
|
|
- // name: '同步到财务系统', icon: 'el-icon-top', audit: [''], event: {
|
|
|
|
- // click: () => {
|
|
|
|
- // (this as any).syncSystem()
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // },
|
|
|
|
|
|
+ {
|
|
|
|
+ name: '同步WMS', icon: 'el-icon-top', audit: [''], event: {
|
|
|
|
+ click: () => {
|
|
|
|
+ (this as any).syncSystem2()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
]
|
|
]
|
|
}
|
|
}
|
|
skuConfig : any = {
|
|
skuConfig : any = {
|
|
@@ -181,7 +182,7 @@
|
|
config : any = {
|
|
config : any = {
|
|
search: {
|
|
search: {
|
|
attr: {
|
|
attr: {
|
|
- size: 'mini'
|
|
|
|
|
|
+ size: 'mini',
|
|
},
|
|
},
|
|
columns: [
|
|
columns: [
|
|
[
|
|
[
|
|
@@ -218,21 +219,23 @@
|
|
search: true,
|
|
search: true,
|
|
refresh: true,
|
|
refresh: true,
|
|
},
|
|
},
|
|
- // customTools: [
|
|
|
|
- // {
|
|
|
|
- // name: '同步到财务系统', icon: 'el-icon-top', audit: [''], event: {
|
|
|
|
- // click: () => {
|
|
|
|
- // (this as any).syncSystem()
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // },
|
|
|
|
- // ]
|
|
|
|
|
|
+ customTools: [
|
|
|
|
+ {
|
|
|
|
+ name: '同步WMS', icon: 'el-icon-top', audit: [''], event: {
|
|
|
|
+ click: () => {
|
|
|
|
+ (this as any).syncSystem()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ ]
|
|
},
|
|
},
|
|
table: {
|
|
table: {
|
|
attr: {
|
|
attr: {
|
|
size: 'mini',
|
|
size: 'mini',
|
|
align: 'left',
|
|
align: 'left',
|
|
- height: '620'
|
|
|
|
|
|
+ height: '620',
|
|
|
|
+ checkbox: true,
|
|
|
|
+ triggerRowCheck:'row'
|
|
},
|
|
},
|
|
columns: [
|
|
columns: [
|
|
{
|
|
{
|
|
@@ -340,7 +343,49 @@
|
|
this.config.table.attr.height = window.innerHeight - 320;
|
|
this.config.table.attr.height = window.innerHeight - 320;
|
|
(this as any).$refs.moduleView.$refs[tableId].recalculate();
|
|
(this as any).$refs.moduleView.$refs[tableId].recalculate();
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ // 同步财务系统
|
|
|
|
+ syncSystem() {
|
|
|
|
+ let selectData = (this as any).$refs.moduleView.getSelectData();
|
|
|
|
+ if (selectData.length > 0) {
|
|
|
|
+ // if (selectData.length > 1) return this.$message.warning('只能同步一条数据');
|
|
|
|
+ // if (selectData[0].financialCode) return this.$message.warning('此数据已同步WMS');
|
|
|
|
+ this.$confirm('确定同步WMS吗', '注意', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ center: true
|
|
|
|
+ }).then(() => {
|
|
|
|
+ let ids = '';
|
|
|
|
+ selectData.map((v : any) => {
|
|
|
|
+ ids += v.id + ','
|
|
|
|
+ })
|
|
|
|
+ ids = ids.slice(0, ids.length - 1);
|
|
|
|
+ let loading = this.$loading({ target: '.main-container' });
|
|
|
|
+ api.WMSPushProducts({ ids: ids }).then((res : any) => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.$message.success('同步WMS成功');
|
|
|
|
+ loading.close();
|
|
|
|
+ } else loading.close();
|
|
|
|
+ }).catch(() => loading.close());
|
|
|
|
+ }).catch(() => this.$message.info('已取消同步WMS'));
|
|
|
|
+ } else this.$message.warning('请选择同步数据');
|
|
|
|
+ }
|
|
|
|
+ syncSystem2() {
|
|
|
|
+ this.$confirm('确定同步WMS吗', '注意', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ center: true
|
|
|
|
+ }).then(() => {
|
|
|
|
+ let loading = this.$loading({ target: '.main-container' });
|
|
|
|
+ api.WMSPushProducts({ ids: this.baseInfo.id }).then((res : any) => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.$message.success('同步WMS成功');
|
|
|
|
+ loading.close();
|
|
|
|
+ } else loading.close();
|
|
|
|
+ }).catch(() => loading.close());
|
|
|
|
+ }).catch(() => this.$message.info('已取消同步WMS'));
|
|
|
|
+ }
|
|
// 保存
|
|
// 保存
|
|
doFormData() {
|
|
doFormData() {
|
|
let data : any = (this as any).$refs.addFormId.getValue()
|
|
let data : any = (this as any).$refs.addFormId.getValue()
|
|
@@ -387,6 +432,7 @@
|
|
let loading = this.$loading({ target: '.main-container' });
|
|
let loading = this.$loading({ target: '.main-container' });
|
|
api.single({ id: e.id }, 'maindataMaterialSku').then((res : any) => {
|
|
api.single({ id: e.id }, 'maindataMaterialSku').then((res : any) => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
|
+ this.baseInfo = res.data;
|
|
this.isShow = 'detail';
|
|
this.isShow = 'detail';
|
|
loading.close();
|
|
loading.close();
|
|
setTimeout(() => { (this as any).$refs.addFormId.setValue([res.data]) }, 0);
|
|
setTimeout(() => { (this as any).$refs.addFormId.setValue([res.data]) }, 0);
|