修改仓库关联单据功能

tagView
zhengmingliang 3 years ago
parent 70e8c61c9c
commit 7d36c0d2fd

@ -168,7 +168,7 @@
<el-button <el-button
type="text" type="text"
size="small" :disabled="!configParms.basicInv" size="small" :disabled="!configParms.basicInv"
@click.native.stop="addBussinessType(scope.row)" @click.native.stop="selsectBussinessType(scope.row)"
>管理单据类型 >管理单据类型
</el-button </el-button
> >
@ -332,7 +332,6 @@
<el-table-column label="单据类型编码" prop="action" fixed></el-table-column> <el-table-column label="单据类型编码" prop="action" fixed></el-table-column>
<el-table-column label="单据类型名称" prop="name" fixed></el-table-column> <el-table-column label="单据类型名称" prop="name" fixed></el-table-column>
</el-table> </el-table>
<el-pagination <el-pagination
:page-size="bussinessTypeQuery.limit" :page-size="bussinessTypeQuery.limit"
@current-change="getBussinessType" @current-change="getBussinessType"
@ -340,8 +339,7 @@
:total="bussinessTypeTotal" :total="bussinessTypeTotal"
:current-page="bussinessTypeQuery.page" :current-page="bussinessTypeQuery.page"
> >
</el-pagination> </el-pagination>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click.native="bussinessTypeFormVisible = !bussinessTypeFormVisible" <el-button @click.native="bussinessTypeFormVisible = !bussinessTypeFormVisible"
>取消 >取消
@ -355,6 +353,53 @@
</div> </div>
</el-dialog> </el-dialog>
<!--添加单据类型弹窗---->
<!--添加单据类型弹窗-->
<el-dialog
title="仓库关联单据类型"
:close-on-click-modal="false"
:close-on-press-escape="false"
:visible.sync="userBussinessTypeFormVisible"
>
<el-row type="flex" justify="end">
<el-button-group style="display: flex;margin-bottom: 15px; margin-right: 50px">
<el-button
type="primary"
@click.native="addBussinessType()"
:loading="loading"
>选入
</el-button
>
</el-button-group>
</el-row>
<el-table v-loading="loading" :data="userBussinessTypeList" ref="typeList"
style="width: 100%">
<el-table-column label="单据类型编码" prop="action" fixed></el-table-column>
<el-table-column label="单据类型名称" prop="name" fixed></el-table-column>
<el-table-column label="操作" fixed="right">
<template slot-scope="scope">
<el-button
type="text"
size="small"
:disabled="!configParms.basicInv"
@click.native.stop="delWarehouseBussinessType(scope.row.id)"
>移除
</el-button
>
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button @click.native="userBussinessTypeFormVisible = !userBussinessTypeFormVisible"
>取消
</el-button
>
</div>
</el-dialog>
<!--表单界面--> <!--表单界面-->
<el-dialog <el-dialog
:title="formMap[formName]" :title="formMap[formName]"
@ -737,7 +782,7 @@ import {
warehouseUserList, saveWarehouseBussinessType, warehouseUserList, saveWarehouseBussinessType,
saveWarehouseUser, updateDirector, disableWarehouse, saveWarehouseUser, updateDirector, disableWarehouse,
deleteWarehouseBussinessType, deleteWarehouseBussinessType,
bindThrWarehouse, unbindThrWarehouse, filterThridSubByInv, getThrsysDetail bindThrWarehouse, unbindThrWarehouse, filterThridSubByInv, getThrsysDetail,delWarehouseBussinessType
} from "../../api/basic/invWarehouse"; } from "../../api/basic/invWarehouse";
import { import {
filterSubAll, saveSubWarehouse, deleteSubWarehouse, filterSubAll, saveSubWarehouse, deleteSubWarehouse,
@ -835,6 +880,8 @@ export default {
selectUserList: [], selectUserList: [],
selectBussinessTypeList: [], selectBussinessTypeList: [],
bussinessTypeFormVisible: false, bussinessTypeFormVisible: false,
userBussinessTypeList:[],
userBussinessTypeFormVisible:false,
thrWarehouseData: [], thrWarehouseData: [],
thrSubWarehouseData: [], thrSubWarehouseData: [],
currentId: null, currentId: null,
@ -887,7 +934,8 @@ export default {
bussinessTypeQuery: { bussinessTypeQuery: {
enabled: true, enabled: true,
page: 1, page: 1,
limit: 10 limit: 10,
ids:""
}, },
bussinessTypeTotal: 0, bussinessTypeTotal: 0,
curSeleUser: null, curSeleUser: null,
@ -1126,7 +1174,34 @@ export default {
}); });
} }
}, },
//
handleUserSubDel(row){
if (row.id) {
this.$confirm("确认移除单据吗?", "提示", {
type: "warning",
})
.then(() => {
this.deleteLoading = true;
let para = {id: row.id};
deleteSubWarehouse(para)
.then((response) => {
this.deleteLoading = false;
if (response.code !== 20000) {
this.$message.error(response.message);
return false;
}
this.$message.success("删除成功");
this.loadSubData(row.parentId);
})
.catch(() => {
this.deleteLoading = false;
});
})
.catch(() => {
this.$message.info("取消删除");
});
}
},
handleSubDel(row) { handleSubDel(row) {
if (row.id) { if (row.id) {
@ -1315,6 +1390,7 @@ export default {
}); });
}, },
loadBusList(val) { loadBusList(val) {
debugger
// //
if (this.curSeleUser == null) { if (this.curSeleUser == null) {
if (val != null) { if (val != null) {
@ -1372,10 +1448,15 @@ export default {
}) })
}); });
}, },
getBussinessType(val) { getBussinessType(val,obj) {
if (val != null) { if (val != null) {
this.bussinessTypeQuery.page = val; this.bussinessTypeQuery.page = val;
} }
if(obj!=undefined){
var action=obj.toString();
this.bussinessTypeQuery.ids=action;
}
this.bussinessTypeQuery.code=this.busQuery.code; this.bussinessTypeQuery.code=this.busQuery.code;
getJoinBussinessType(this.bussinessTypeQuery).then((res) => { getJoinBussinessType(this.bussinessTypeQuery).then((res) => {
this.selectBussinessTypeList = []; this.selectBussinessTypeList = [];
@ -1406,6 +1487,7 @@ export default {
handleBussinessTypeSelectionChange(row) { handleBussinessTypeSelectionChange(row) {
let _this = this; let _this = this;
_this.selectBussinessTypeList = []; _this.selectBussinessTypeList = [];
debugger
row.forEach((item) => { row.forEach((item) => {
_this.selectBussinessTypeList.push(item); _this.selectBussinessTypeList.push(item);
}) })
@ -1453,19 +1535,42 @@ export default {
}); });
} }
}, },
// addBussinessType(row) {
// this.currentCode = row.code;
// this.currentRow = row;
// this.loadLinkData(row);
// if (this.currentCode == null || this.currentCode == '') {
// this.$message.error('');
// } else if (this.currentCode != row.code) {
// this.$message.error("")
// } else {
// this.bussinessTypeFormVisible = true;
// this.bussinessTypeQuery.page = 1;
// this.getBussinessType();
// }
// },
addBussinessType(row) { addBussinessType(row) {
this.currentCode = row.code; var action=[];
this.currentRow = row; for(var i=0;i<this.userBussinessTypeList.length;i++){
this.loadLinkData(row); action.push(this.userBussinessTypeList[i].action);
if (this.currentCode == null || this.currentCode == '') { }
this.$message.error('请先选择仓库');
} else if (this.currentCode != row.code) {
this.$message.error("请先选择当前分库!")
} else {
this.bussinessTypeFormVisible = true; this.bussinessTypeFormVisible = true;
this.bussinessTypeQuery.page = 1; this.bussinessTypeQuery.page = 1;
this.getBussinessType(); this.getBussinessType(1,action);
},
selsectBussinessType(row){
var busQuery = {
code: this.currentCode,
page: 1,
limit: 10000
} }
warehouseBussinessTypeList(busQuery).then((res) => {
this.userBussinessTypeList = res.data.list;
}).catch((error) => {
this.$message.error("单据类型数据加载失败")
});
this.userBussinessTypeFormVisible = true;
}, },
addBussinessTypeData() { addBussinessTypeData() {
// if (this.selectBussinessTypeList.length == 0) { // if (this.selectBussinessTypeList.length == 0) {
@ -1477,7 +1582,6 @@ export default {
bussinessTypes: JSON.stringify(this.selectBussinessTypeList) bussinessTypes: JSON.stringify(this.selectBussinessTypeList)
}; };
saveWarehouseBussinessType(query).then((res) => { saveWarehouseBussinessType(query).then((res) => {
if (res.code == 20000) { if (res.code == 20000) {
this.$message.success("修改成功!"); this.$message.success("修改成功!");
// //
@ -1493,6 +1597,9 @@ export default {
this.bussinessTypeData = []; this.bussinessTypeData = [];
this.busTotal = 0; this.busTotal = 0;
}); });
this.selectWhouseBussinessType();
} else { } else {
this.$message.error(res.message); this.$message.error(res.message);
} }
@ -1502,6 +1609,17 @@ export default {
}); });
// } // }
}, },
selectWhouseBussinessType(){
var busQuery = {
code: this.currentCode,
page: 1,
limit: 100000
}
warehouseBussinessTypeList(busQuery).then((res) => {
this.userBussinessTypeList = res.data.list || [];
}).catch((error) => {
});
},
updateDirector(row) { updateDirector(row) {
row.director = !row.director; row.director = !row.director;
updateDirector(row).then((res) => { updateDirector(row).then((res) => {
@ -1530,12 +1648,19 @@ export default {
deleteWarehouseBussinessType(params).then((res) => { deleteWarehouseBussinessType(params).then((res) => {
if (res.code == 20000) { if (res.code == 20000) {
this.$message.success("已移除"); this.$message.success("已移除");
for (let i = 0; i < this.bussinessTypeData.length; i++) { this.bussinessTypeData = [];
if (this.bussinessTypeData[i].id == id) { this.selectWhouseBussinessType();
this.bussinessTypeData.splice(i, 1);   var busQuerys = {
return;                         code: this.currentCode,
}                         page: 1,
}                         limit: 10
                    }
            warehouseBussinessTypeList(busQuerys).then((res) => {
                    this.bussinessTypeData = res.data.list;
                }).catch((error) => {
                    this.$message.error("单据类型数据加载失败")
                });
} else { } else {
this.$message.error("移除失败"); this.$message.error("移除失败");
} }
@ -1713,6 +1838,7 @@ export default {
page: page, page: page,
limit: 10 limit: 10
}; };
debugger
filterUserBusTypeList(queryParam).then((res) => { filterUserBusTypeList(queryParam).then((res) => {
if (res.code === 20000) { if (res.code === 20000) {
this.bussinessTypeData = res.data.list || []; this.bussinessTypeData = res.data.list || [];

Loading…
Cancel
Save