同步仓库代码

zhairh
郑明梁 3 years ago
parent aae47452ef
commit 7942a0fb49

@ -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"
>取消 >取消
@ -390,7 +388,7 @@
</el-button </el-button
> >
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -784,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,
@ -882,6 +880,8 @@ export default {
selectUserList: [], selectUserList: [],
selectBussinessTypeList: [], selectBussinessTypeList: [],
bussinessTypeFormVisible: false, bussinessTypeFormVisible: false,
userBussinessTypeList:[],
userBussinessTypeFormVisible:false,
thrWarehouseData: [], thrWarehouseData: [],
thrSubWarehouseData: [], thrSubWarehouseData: [],
currentId: null, currentId: null,
@ -1174,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) {
@ -1420,10 +1447,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 = [];
@ -1434,7 +1466,7 @@ export default {
if (that.$refs.typeList) { if (that.$refs.typeList) {
that.$refs.typeList.clearSelection(); that.$refs.typeList.clearSelection();
} }
that.bussinessTypeList.forEach(row => { that.bussinessTypeList.forEach(row => {
if (row.checkSelect==true) { if (row.checkSelect==true) {
that.$refs.typeList.toggleRowSelection(row, true); that.$refs.typeList.toggleRowSelection(row, true);
@ -1501,17 +1533,47 @@ export default {
}); });
} }
}, },
addBussinessType(row) {
this.currentCode = row.code; // addBussinessType(row) {
this.currentRow = row; // this.currentCode = row.code;
this.loadLinkData(row); // this.currentRow = row;
if (this.currentCode != row.code) { // this.loadLinkData(row);
this.$message.error("请先选择当前分库!") // if (this.currentCode == null || this.currentCode == '') {
} else { // this.$message.error('');
// } else if (this.currentCode != row.code) {
// this.$message.error("")
// } else {
// this.bussinessTypeFormVisible = true;
// this.bussinessTypeQuery.page = 1;
// this.getBussinessType();
// }
// },
addBussinessType(row) {
var action=[];
for(var i=0;i<this.userBussinessTypeList.length;i++){
action.push(this.userBussinessTypeList[i].action);
}
this.bussinessTypeFormVisible = true; this.bussinessTypeFormVisible = true;
this.bussinessTypeQuery.page = 1; this.bussinessTypeQuery.page = 1;
this.getBussinessType(); this.getBussinessType(1,action);
} },
selsectBussinessType(row){
// if(row==null || row==undefined){
// this.$message.info("");
// return;
// }
var busQuery = {
code: row.code,
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) {
@ -1523,7 +1585,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("修改成功!");
// //
@ -1539,15 +1600,29 @@ 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);
} }
}).catch((error) => { }).catch((error) => {
}); });
// } // }
}, },
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) => {
@ -1576,14 +1651,21 @@ 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(res.message);
} }
}).catch((error) => { }).catch((error) => {
this.$message.error("移除失败"); this.$message.error("移除失败");

Loading…
Cancel
Save