|
@@ -3,7 +3,7 @@
|
|
|
<transition-group name="fade" style="position: relative;width: 100%;display: flex;">
|
|
|
<div class="bill-main" v-show="isShow==='ckb'" key="item">
|
|
|
<module-view :propConfig="config" ref="moduleView" @pagination="getDataList" @search="getDataList"
|
|
|
- @resert="getDataList" @clickHandle="clickHandle" @detail="changeTab">
|
|
|
+ @resert="getDataList" @clickHandle="clickHandle" @detail="openEdit">
|
|
|
</module-view>
|
|
|
<!-- 新增/编辑弹窗 -->
|
|
|
<el-dialog :title="popTitle+'仓库'" :visible.sync="dialogFormVisible" width="30%">
|
|
@@ -15,8 +15,7 @@
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
<div class="bill-main" v-show="isShow==='cwb'" key="item2">
|
|
|
- <module-view :propConfig="config2" ref="moduleView2" @pagination="getDataList2" @search="getDataList2"
|
|
|
- @resert="getDataList2" @clickHandle="clickHandle2" @detail="openEdit2">
|
|
|
+ <module-view :propConfig="config2" ref="moduleView2" @clickHandle="clickHandle2" @detail="openEdit2">
|
|
|
</module-view>
|
|
|
<!-- 新增/编辑弹窗 -->
|
|
|
<el-dialog :title="popTitle+'仓位'" :visible.sync="dialogFormVisible2" width="30%">
|
|
@@ -38,9 +37,8 @@
|
|
|
isShow : any = 'ckb'
|
|
|
timeNum = 0;
|
|
|
timer : any = null
|
|
|
- timeNum2 = 0;
|
|
|
- timer2 : any = null
|
|
|
popTitle : any = ''
|
|
|
+ tableData : any = ''
|
|
|
dialogFormVisible : boolean = false
|
|
|
dialogFormVisible2 : boolean = false
|
|
|
config : any = {
|
|
@@ -111,7 +109,7 @@
|
|
|
audit: '',
|
|
|
event: {
|
|
|
click: (item : any) => {
|
|
|
- (this as any).changeTab()
|
|
|
+ (this as any).changeTab(item)
|
|
|
}
|
|
|
}
|
|
|
}]
|
|
@@ -279,7 +277,7 @@
|
|
|
}, {
|
|
|
name: '删除',
|
|
|
event: {
|
|
|
- click: (item : any) => (this as any).doDelete2(item, 'maindataStoringLocation')
|
|
|
+ click: (item : any) => (this as any).doDelete2(item)
|
|
|
}
|
|
|
}]
|
|
|
}]
|
|
@@ -371,13 +369,13 @@
|
|
|
this.getDataList()
|
|
|
}, 500)
|
|
|
}
|
|
|
- changeTab() {
|
|
|
+ changeTab(item : any) {
|
|
|
+ console.log(item);
|
|
|
+ this.tableData = item;
|
|
|
+ (this.$refs.moduleView2 as any).setTableValue(item.subList);
|
|
|
this.isShow = 'cwb';
|
|
|
- this.timer2 = setInterval(() => {
|
|
|
- this.getDataList2()
|
|
|
- }, 500)
|
|
|
}
|
|
|
- // 确认新增/编辑
|
|
|
+ // 仓库确认新增/编辑
|
|
|
confirm() {
|
|
|
(this as any).$refs.addFormId.validate().then(() => {
|
|
|
let query = (this as any).$refs.addFormId.getValue();
|
|
@@ -405,31 +403,22 @@
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+ // 仓位确认新增/编辑
|
|
|
confirm2() {
|
|
|
(this as any).$refs.addFormId2.validate().then(() => {
|
|
|
let query = (this as any).$refs.addFormId2.getValue();
|
|
|
+ this.tableData.subList = [query];
|
|
|
+ console.log(this.tableData);
|
|
|
this.dialogFormVisible2 = false;
|
|
|
- if (this.popTitle === '新增') {
|
|
|
- api.saveList(query, 'maindataStoringLocation').then((res : any) => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: this.popTitle + '成功!'
|
|
|
- });
|
|
|
- this.getDataList2();
|
|
|
- } else this.failHandle(res)
|
|
|
- })
|
|
|
- } else if (this.popTitle === '编辑') {
|
|
|
- api.updateList(query, 'maindataStoringLocation').then((res : any) => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: this.popTitle + '成功!'
|
|
|
- });
|
|
|
- this.getDataList2();
|
|
|
- } else this.failHandle(res)
|
|
|
- })
|
|
|
- }
|
|
|
+ api.updateList(this.tableData, 'maindataStorehouse').then((res : any) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: this.popTitle + '成功!'
|
|
|
+ });
|
|
|
+ this.getDataList();
|
|
|
+ } else this.failHandle(res)
|
|
|
+ })
|
|
|
})
|
|
|
}
|
|
|
// 获取仓库列表数据
|
|
@@ -455,29 +444,6 @@
|
|
|
} else this.failHandle(res)
|
|
|
})
|
|
|
}
|
|
|
- // 获取仓位列表数据
|
|
|
- getDataList2() {
|
|
|
- if (!this.$refs.moduleView2) {
|
|
|
- if (this.timeNum2 > 5) {
|
|
|
- clearInterval(this.timer2)
|
|
|
- }
|
|
|
- this.timeNum2++;
|
|
|
- return
|
|
|
- }
|
|
|
- clearInterval(this.timer2)
|
|
|
- let query = (this.$refs.moduleView2 as any).getQuery();
|
|
|
- api.pageList(query, 'maindataStoringLocation').then((res : any) => {
|
|
|
- if (res.code === 200) {
|
|
|
- (this.$refs.moduleView2 as any).setTableValue(res.data.records);
|
|
|
- let page = {
|
|
|
- pageNo: res.data.current, //当前页
|
|
|
- pageSize: res.data.size, //每页条数
|
|
|
- total: res.data.total //总条数
|
|
|
- };
|
|
|
- (this.$refs.moduleView2 as any).setPage(page)
|
|
|
- } else this.failHandle(res)
|
|
|
- })
|
|
|
- }
|
|
|
// 工具栏方法
|
|
|
clickHandle(e : any) {
|
|
|
console.log(e);
|
|
@@ -490,7 +456,6 @@
|
|
|
console.log(e);
|
|
|
if (e === 'onRefresh') (this.$refs.moduleView2 as any).resert();
|
|
|
if (e === 'onAdd') this.onAdd2();
|
|
|
- if (e === 'onDelete') this.onDelete('moduleView2', 'maindataStoringLocation');
|
|
|
if (e === 'onExport') this.onExport();
|
|
|
if (e === 'onReturn') this.isShow = 'ckb';
|
|
|
}
|
|
@@ -558,22 +523,15 @@
|
|
|
});
|
|
|
}
|
|
|
// 操作删除
|
|
|
- doDelete2(item : any, url : any) {
|
|
|
+ doDelete2(item : any) {
|
|
|
+ console.log(item);
|
|
|
this.$confirm('确定删除吗,此操作不能撤销!', '注意', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning',
|
|
|
center: true
|
|
|
}).then(() => {
|
|
|
- api.deleteList({ ids: item.id }, url).then((res : any) => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.getDataList();
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '删除成功!'
|
|
|
- });
|
|
|
- } else this.failHandle(res)
|
|
|
- })
|
|
|
+
|
|
|
}).catch(() => {
|
|
|
this.$message({
|
|
|
type: 'info',
|