第三方仓库新增分库,关联绑定第三方分库等,第三方的单据上传新增条码上传

fengcang
anthonyywj2 3 years ago
parent a91972ba61
commit c4537a0ab8

@ -40,3 +40,32 @@ export function deleteSubWarehouse(data) {
data: data data: data
}); });
} }
//查询第三方系统和仓库数据关联信息
export function getSubThrsysDetail(params) {
return axios({
url: "/spms/sub/inv/warehouse/thridSys/detail",
method: "get",
params: params
});
}
//绑定第三方仓库
export function bindThrSubWarehouse(params) {
return axios({
url: "/spms/sub/inv/warehouse/bindThrWarehouse",
method: "post",
params: params
});
}
//解绑第三方仓库
export function unbindSubThrWarehouse(params) {
return axios({
url: "/spms/sub/inv/warehouse/unbindThrWarehouse",
method: "post",
params: params
});
}

@ -199,3 +199,14 @@ export function replaceCodes(data) {
data: data data: data
}) })
} }
export function filterThridSubByInv(params) {
return axios({
url: "/spms/sub/inv/warehouse/filterThridInv",
method: "get",
params: params
});
}

@ -0,0 +1,43 @@
import axios from "../../utils/axios";
export function filterThridSubAll(query) {
return axios({
url: "/thirdSys/sub/inv/warehouse/filter",
method: "get",
params: query
});
}
export function filterSubByInv(query) {
return axios({
url: "/thirdSys/sub/inv/warehouse/findByInv",
method: "get",
params: query
});
}
// 保存
export function saveSubWarehouse(data, formName, method = "post") {
let url =
formName !== "edit"
? "/thirdSys/sub/inv/warehouse/save"
: "/thirdSys/sub/inv/warehouse/edit";
return axios({
url: url,
method: method,
data: data
});
}
// 删除
export function deleteSubWarehouse(data) {
return axios({
url: "/thirdSys/sub/inv/warehouse/delete",
method: "post",
data: data
});
}

@ -367,20 +367,60 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="分库编码" prop="title" class="query-form-item">
<el-input
disabled
v-model="subData.code" style="width: 80%"
auto-complete="off"
></el-input>
</el-form-item>
<el-form-item label="分库名称" prop="name" class="query-form-item">
<el-input
v-model="subData.name" style="width: 80%"
auto-complete="off"
></el-input>
</el-form-item>
<el-row :gutter="20" class="el-row" type="flex">
<el-col :span="12" class="el-col">
<el-form-item label="分库编码" prop="title" class="query-form-item">
<el-input
disabled
v-model="subData.code" style="width: 80%"
auto-complete="off"
></el-input>
</el-form-item>
</el-col>
<el-col :span="12" class="el-col">
<el-form-item label="分库名称" prop="name" class="query-form-item">
<el-input
v-model="subData.name" style="width: 80%"
auto-complete="off"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-table :data="sysSubList" style="width: 100%; margin-bottom: 30px;" border>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column
label="第三方系统名称"
prop="sysName"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="第三方仓库ID"
prop="thirdId"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="第三方仓库名称"
prop="thirdName"
show-overflow-tooltip
></el-table-column>
<el-table-column label="操作" fixed="right">
<template slot-scope="scope">
<el-button
type="text"
size="small"
:disabled="!configParms.basicInv"
@click="intentSubSelect(scope.row)"
>关联
</el-button
>
<el-button type="text" size="small" @click.native.stop="unbindSubThrWarehouse(scope.row)"
:disabled="scope.row.thirdId=='' ||scope.row.thirdId==null ||!configParms.basicInv"
>解绑
</el-button>
</template>
</el-table-column>
</el-table>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click.native="hideForm">取消</el-button> <el-button @click.native="hideForm">取消</el-button>
@ -530,8 +570,6 @@
</div> </div>
</el-dialog> </el-dialog>
<el-dialog title="关联仓库" :visible.sync="thrWareHouseVisible"> <el-dialog title="关联仓库" :visible.sync="thrWareHouseVisible">
<el-form :inline="true" :model="query" class="query-form" size="mini"> <el-form :inline="true" :model="query" class="query-form" size="mini">
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-input <el-input
@ -598,6 +636,65 @@
</div> </div>
</el-dialog> </el-dialog>
<el-dialog title="关联分库" :visible.sync="thrSubWareHouseVisible">
<el-form :inline="true" :model="thirdSubQuery" class="query-form" size="mini">
<el-form-item class="query-form-item">
<el-input
v-model="thirdSubQuery.key"
clearable
placeholder="分库名称"
style="width: 400px"
></el-input>
</el-form-item>
<el-form-item>
<el-button-group>
<el-button type="primary" icon="search" @click="intentSubSelect"></el-button>
</el-button-group>
</el-form-item>
</el-form>
<el-table
:data="thrSubWarehouseData"
style="width: 100%;margin-top: 10px;"
row-key="id"
border
highlight-current-row
@current-change="changeSubThrWarehouse"
>
<el-table-column
type="index"
label="序号"
>
</el-table-column>
<el-table-column
prop="code"
label="分库编码"
>
</el-table-column>
<el-table-column
prop="name"
label="分库名称"
>
</el-table-column>
</el-table>
<el-pagination
:page-size="thirdSubQuery.limit"
@current-change="handleSubCurrentChange"
layout="prev, pager, next"
:total="subTotal"
>
</el-pagination>
<div slot="footer" class="dialog-footer">
<el-button @click.native="hideThrWarehouseTable()">取消</el-button>
<el-button
type="primary"
@click.native="bindSubThrWarehouse()"
:loading="formLoading"
>提交
</el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
@ -609,10 +706,11 @@ import {
warehouseUserList, saveWarehouseBussinessType, warehouseUserList, saveWarehouseBussinessType,
saveWarehouseUser, updateDirector, disableWarehouse, saveWarehouseUser, updateDirector, disableWarehouse,
deleteWarehouseUser, deleteWarehouseBussinessType, deleteWarehouseUser, deleteWarehouseBussinessType,
bindThrWarehouse, unbindThrWarehouse, getThrsysDetail bindThrWarehouse, unbindThrWarehouse, filterThridSubByInv, getThrsysDetail
} from "../../api/basic/invWarehouse"; } from "../../api/basic/invWarehouse";
import { import {
filterSubAll, saveSubWarehouse, deleteSubWarehouse filterSubAll, saveSubWarehouse, deleteSubWarehouse,
getSubThrsysDetail, bindThrSubWarehouse, unbindSubThrWarehouse
} from "../../api/basic/invSubWarehouse"; } from "../../api/basic/invSubWarehouse";
import {filterThrList} from "@/api/thrsys/thrInvWarehouse"; import {filterThrList} from "@/api/thrsys/thrInvWarehouse";
import {getHospitalUserList} from "../../api/auth/authUser"; import {getHospitalUserList} from "../../api/auth/authUser";
@ -696,23 +794,37 @@ export default {
bussinessTypeList: null, bussinessTypeList: null,
userFormVisible: false, userFormVisible: false,
currentCode: null, currentCode: null,
superRow: null,
currentRow: {status: 1}, currentRow: {status: 1},
selectUserList: [], selectUserList: [],
selectBussinessTypeList: [], selectBussinessTypeList: [],
bussinessTypeFormVisible: false, bussinessTypeFormVisible: false,
thrWarehouseData: null, thrWarehouseData: [],
thrSubWarehouseData: [],
currentId: null, currentId: null,
currentSubId: null,
thrWareHouseVisible: false, thrWareHouseVisible: false,
thrSubWareHouseVisible: false,
sysList: [], sysList: [],
sysSubList: [],
checkThrWarehouseRow: null, checkThrWarehouseRow: null,
checkSubThrWarehouseRow: null,
currentSysId: null, currentSysId: null,
thirdSysVisible: false, thirdSysVisible: false,
total: 0, total: 0,
subTotal: 0,
thirdQuery: { thirdQuery: {
key: null, key: null,
page: 1, page: 1,
limit: 10 limit: 10,
, thirdSysFk: "thirdId", thirdSysFk: "thirdId",
},
thirdSubQuery: {
parentId: null,
key: null,
page: 1,
limit: 10,
thirdSysFk: "thirdId",
}, },
configParms: {}, configParms: {},
subData: {}, subData: {},
@ -760,7 +872,7 @@ export default {
// //
this.formVisible = false; this.formVisible = false;
this.subFormVisible = false; this.subFormVisible = false;
this.loadSubData(this.currentCode); // this.loadSubData(this.currentCode);
return true; return true;
}, },
// //
@ -809,8 +921,24 @@ export default {
this.sysList = []; this.sysList = [];
}); });
}, },
getSubThrsysDetailData() {
let params = {
id: this.subData.code,
};
getSubThrsysDetail(params)
.then((response) => {
this.loading = false;
this.sysSubList = response.data.list || [];
})
.catch(() => {
this.loading = false;
this.sysSubList = [];
});
},
handleSubForm(data, formName) { handleSubForm(data, formName) {
this.subFromName = formName; this.subFromName = formName;
if (formName === "edit") { if (formName === "edit") {
this.subData = data; this.subData = data;
} else if (formName === "add") { } else if (formName === "add") {
@ -819,7 +947,7 @@ export default {
} }
; ;
this.subFormVisible = true; this.subFormVisible = true;
this.getSubThrsysDetailData();
}, },
// //
formSubmit() { formSubmit() {
@ -1063,7 +1191,7 @@ export default {
this.subList = []; this.subList = [];
this.userList = null; this.userList = null;
this.bussinessTypeList = null; this.bussinessTypeList = null;
this.currentCode = row.code; this.superRow = row;
this.loadSubData(row.code); this.loadSubData(row.code);
}, },
@ -1305,8 +1433,11 @@ export default {
sysId: this.currentSysId sysId: this.currentSysId
} }
bindThrWarehouse(params).then((res) => { bindThrWarehouse(params).then((res) => {
this.$message.success("绑定成功") if (res.code == 20000) {
this.getThrsysDetailData(); this.$message.success("绑定成功")
this.getThrsysDetailData();
}
}).catch((error) => { }).catch((error) => {
this.$message.error("绑定失败") this.$message.error("绑定失败")
}) })
@ -1324,11 +1455,46 @@ export default {
this.$message.error("解绑失败"); this.$message.error("解绑失败");
}) })
}, },
//
bindSubThrWarehouse() {
let params = {
id: this.subData.id,
thridWarehouseId: this.checkSubThrWarehouseRow.code,
sysId: this.checkSubThrWarehouseRow.thirdSysFk
}
bindThrSubWarehouse(params).then((res) => {
if (res.code == 20000) {
this.$message.success("绑定成功")
this.getSubThrsysDetailData();
}
this.thrSubWareHouseVisible = false;
}).catch((error) => {
this.$message.error("绑定失败");
this.thrSubWareHouseVisible = false;
})
},
//
unbindSubThrWarehouse(row) {
let params = {
id: this.subData.id,
sysId: row.sysId
};
unbindSubThrWarehouse(params).then((res) => {
this.$message.success("解绑成功");
this.getSubThrsysDetailData();
}).catch((error) => {
this.$message.error("解绑失败");
})
},
intentSelect(row) { intentSelect(row) {
if (row != null) if (row != null)
this.currentSysId = row.sysId; this.currentSysId = row.sysId;
// //
this.thirdQuery.thirdSysFk = this.currentSysId; this.thirdQuery.thirdSysFk = this.currentSysId;
this.thrWarehouseData = [];
filterThrList(this.thirdQuery).then((res) => { filterThrList(this.thirdQuery).then((res) => {
this.thrWarehouseData = res.data.list; this.thrWarehouseData = res.data.list;
this.total = res.data.total || 0; this.total = res.data.total || 0;
@ -1341,16 +1507,47 @@ export default {
}); });
}, },
intentSubSelect(row) {
if (row != null) {
this.thirdSubQuery.parentId = this.superRow.code;
this.thirdSubQuery.thirdSysFk = row.sysId;
}
this.thrSubWarehouseData = [];
this.thrSubWareHouseVisible = true;
filterThridSubByInv(this.thirdSubQuery).then((res) => {
if (res.code == 20000) {
this.thrSubWarehouseData = res.data.list;
this.subTotal = res.data.total || 0;
} else {
this.$message.error(res.message);
}
}).catch((error) => {
this.thrWarehouseData = [];
this.subTotal = 0;
this.$message.error("第三方分库库数据加载失败");
});
},
handleCurrentChange(val) { handleCurrentChange(val) {
this.thirdQuery.page = val; this.thirdQuery.page = val;
this.intentSelect(); this.intentSelect();
}, },
handleSubCurrentChange(val) {
this.thirdSubQuery.page = val;
this.intentSubSelect();
},
changeThrWarehouse(row) { changeThrWarehouse(row) {
this.checkThrWarehouseRow = row; this.checkThrWarehouseRow = row;
}, },
changeSubThrWarehouse(row) {
this.checkSubThrWarehouseRow = row;
},
hideThrWarehouseTable() { hideThrWarehouseTable() {
this.thrWareHouseVisible = false; this.thrWareHouseVisible = false;
this.thrSubWareHouseVisible = false;
}, },
getSyncConfig() { getSyncConfig() {
findConfig() findConfig()

@ -1,118 +1,117 @@
<template> <template>
<div> <div>
<el-form :inline="true" :model="filterQuery" class="query-form" size="mini">
<el-row>
<el-form-item class="query-form-item">
<el-input v-model="filterQuery.billNo" placeholder="单据号" clearable></el-input>
</el-form-item>
<el-form-item class="query-form-item">
<el-input v-model="filterQuery.thirdBillNo" placeholder="第三方单据号" clearable></el-input>
</el-form-item>
<el-form-item class="query-form-item"> <el-card>
<el-date-picker <el-form :inline="true" :model="filterQuery" class="query-form" size="mini">
v-model="filterQuery.submitTime" <el-row>
type="date" <el-form-item class="query-form-item">
placeholder="请选择提交时间" <el-input v-model="filterQuery.billNo" placeholder="单据号" clearable></el-input>
:picker-options="pickerOptions"> </el-form-item>
</el-date-picker> <el-form-item class="query-form-item">
</el-form-item> <el-input v-model="filterQuery.thirdBillNo" placeholder="第三方单据号" clearable></el-input>
</el-form-item>
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-select v-model="filterQuery.status" placeholder="处理状态"> <el-date-picker
<el-option label="全部" value=""></el-option> v-model="filterQuery.submitTime"
<el-option label="处理成功" value="2"></el-option> type="date"
<el-option label="处理失败" value="3"></el-option> placeholder="请选择提交时间"
</el-select> :picker-options="pickerOptions">
</el-form-item> </el-date-picker>
</el-form-item>
<el-form-item> <el-form-item class="query-form-item">
<el-button-group style="display:flex;"> <el-select v-model="filterQuery.status" placeholder="处理状态">
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button> <el-option label="全部" value=""></el-option>
<el-button type="primary" icon="search" @click="getList"></el-button> <el-option label="处理成功" value="2"></el-option>
</el-button-group> <el-option label="处理失败" value="3"></el-option>
</el-form-item> </el-select>
</el-row> </el-form-item>
</el-form>
<el-table <el-form-item>
v-loading="loading" <el-button-group style="display:flex;">
:data="list" <el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
style="width: 100%" <el-button type="primary" icon="search" @click="getList"></el-button>
@selection-change="handleSelectionChange" </el-button-group>
> </el-form-item>
<el-table-column label="序号" type="index"></el-table-column> </el-row>
<el-table-column </el-form>
label="第三方单据号" <el-table
prop="billNo" v-loading="loading"
show-overflow-tooltip :data="list"
> style="width: 100%"
</el-table-column> @selection-change="handleSelectionChange"
<el-table-column
label="系统扫码单据号"
prop="thrBillNo"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="单据类型"
prop="billType"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label="单据日期"
prop="billDate"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="上传时间"
prop="submitTime"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="上传状态"
prop="status"
show-overflow-tooltip
>
<template slot-scope="scope">
<span>{{ getStatusInfo(scope.row.status) }}</span>
</template>
</el-table-column>
<el-table-column
label="结果信息"
prop="result"
show-overflow-tooltip
> >
</el-table-column> <el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="操作" fixed="right" width="160"> <el-table-column
<template slot-scope="scope"> label="第三方单据号"
<el-button prop="billNo"
type="text" show-overflow-tooltip
size="small" >
@click.native.stop="showResultInfo(scope.row)" </el-table-column>
>详情 <el-table-column
</el-button label="系统扫码单据号"
> prop="thrBillNo"
<el-button show-overflow-tooltip
type="text" ></el-table-column>
size="small" <el-table-column
@click.native.stop="deleteLog(scope.row.id)" label="单据类型"
>删除 prop="billType"
</el-button show-overflow-tooltip
> >
</template> </el-table-column>
</el-table-column> <el-table-column
</el-table> label="单据日期"
prop="billDate"
show-overflow-tooltip
<el-pagination ></el-table-column>
:page-size="filterQuery.limit" <el-table-column
@current-change="handleCurrentChange" label="上传时间"
layout="prev, pager, next" prop="submitTime"
:total="total" show-overflow-tooltip
:current-page="filterQuery.page" ></el-table-column>
></el-pagination> <el-table-column
label="上传状态"
prop="status"
show-overflow-tooltip
>
<template slot-scope="scope">
<span>{{ getStatusInfo(scope.row.status) }}</span>
</template>
</el-table-column>
<el-table-column
label="结果信息"
prop="result"
show-overflow-tooltip
>
</el-table-column>
<el-table-column label="操作" fixed="right" width="160">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="showResultInfo(scope.row)"
>详情
</el-button
>
<el-button
type="text"
size="small"
@click.native.stop="deleteLog(scope.row.id)"
>删除
</el-button
>
</template>
</el-table-column>
</el-table>
<el-pagination
:page-size="filterQuery.limit"
@current-change="handleCurrentChange"
layout="prev, pager, next"
:total="total"
:current-page="filterQuery.page"
></el-pagination>
</el-card>
<el-dialog <el-dialog
title="结果详情" title="结果详情"
width="35%" width="35%"

@ -1,118 +1,116 @@
<template> <template>
<div> <div>
<el-form :inline="true" :model="filterQuery" class="query-form" size="mini"> <el-card>
<el-row> <el-form :inline="true" :model="filterQuery" class="query-form" size="mini">
<el-form-item class="query-form-item"> <el-row>
<el-input v-model="filterQuery.billNo" placeholder="单据号" clearable></el-input> <el-form-item class="query-form-item">
</el-form-item> <el-input v-model="filterQuery.billNo" placeholder="单据号" clearable></el-input>
<el-form-item class="query-form-item"> </el-form-item>
<el-input v-model="filterQuery.thirdBillNo" placeholder="第三方单据号" clearable></el-input> <el-form-item class="query-form-item">
</el-form-item> <el-input v-model="filterQuery.thirdBillNo" placeholder="第三方单据号" clearable></el-input>
</el-form-item>
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-date-picker <el-date-picker
v-model="filterQuery.submitTime" v-model="filterQuery.submitTime"
type="date" type="date"
placeholder="请选择提交时间" placeholder="请选择提交时间"
:picker-options="pickerOptions"> :picker-options="pickerOptions">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-select v-model="filterQuery.status" placeholder="处理状态"> <el-select v-model="filterQuery.status" placeholder="处理状态">
<el-option label="全部" value=""></el-option> <el-option label="全部" value=""></el-option>
<el-option label="提交成功" value="2"></el-option> <el-option label="提交成功" value="2"></el-option>
<el-option label="提交失败" value="3"></el-option> <el-option label="提交失败" value="3"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button-group style="display:flex;"> <el-button-group style="display:flex;">
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button> <el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="search" @click="getList"></el-button> <el-button type="primary" icon="search" @click="getList"></el-button>
</el-button-group> </el-button-group>
</el-form-item> </el-form-item>
</el-row> </el-row>
</el-form> </el-form>
<el-table
<el-table v-loading="loading"
v-loading="loading" :data="list"
:data="list" style="width: 100%"
style="width: 100%" @selection-change="handleSelectionChange"
@selection-change="handleSelectionChange"
>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column
label="单据号"
prop="billNo"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label="第三方单据号"
prop="thrBillNo"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="单据类型"
prop="billType"
show-overflow-tooltip
>
</el-table-column>
<el-table-column
label="单据日期"
prop="billDate"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="提交时间"
prop="submitTime"
show-overflow-tooltip
></el-table-column>
<el-table-column
label="提交状态"
prop="status"
show-overflow-tooltip
> >
<template slot-scope="scope"> <el-table-column label="序号" type="index"></el-table-column>
<span>{{ getStatusInfo(scope.row.status) }}</span> <el-table-column
</template> label="单据号"
</el-table-column> prop="billNo"
<el-table-column show-overflow-tooltip
label="结果信息" >
prop="result" </el-table-column>
show-overflow-tooltip <el-table-column
> label="第三方单据号"
</el-table-column> prop="thrBillNo"
<el-table-column label="操作" fixed="right" width="160"> show-overflow-tooltip
<template slot-scope="scope"> ></el-table-column>
<el-button <el-table-column
type="text" label="单据类型"
size="small" prop="billType"
@click.native.stop="showResultInfo(scope.row)" show-overflow-tooltip
>详情 >
</el-button </el-table-column>
> <el-table-column
<el-button label="单据日期"
type="text" prop="billDate"
size="small" show-overflow-tooltip
@click.native.stop="deleteLog(scope.row.id)" ></el-table-column>
>删除 <el-table-column
</el-button label="提交时间"
> prop="submitTime"
</template> show-overflow-tooltip
</el-table-column> ></el-table-column>
</el-table> <el-table-column
label="提交状态"
prop="status"
<el-pagination show-overflow-tooltip
:page-size="filterQuery.limit" >
@current-change="handleCurrentChange" <template slot-scope="scope">
layout="prev, pager, next" <span>{{ getStatusInfo(scope.row.status) }}</span>
:total="total" </template>
:current-page="filterQuery.page" </el-table-column>
></el-pagination> <el-table-column
label="结果信息"
prop="result"
show-overflow-tooltip
>
</el-table-column>
<el-table-column label="操作" fixed="right" width="160">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="showResultInfo(scope.row)"
>详情
</el-button
>
<el-button
type="text"
size="small"
@click.native.stop="deleteLog(scope.row.id)"
>删除
</el-button
>
</template>
</el-table-column>
</el-table>
<el-pagination
:page-size="filterQuery.limit"
@current-change="handleCurrentChange"
layout="prev, pager, next"
:total="total"
:current-page="filterQuery.page"
></el-pagination>
</el-card>
<el-dialog <el-dialog
title="结果详情" title="结果详情"
width="35%" width="35%"

@ -48,8 +48,8 @@
style="width: 100%;margin-bottom: 20px;" style="width: 100%;margin-bottom: 20px;"
row-key="id" row-key="id"
border border
default-expand-all highlight-current-row
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"> @current-change="handInvCurrentChange">
<el-table-column type="index" label="序号" width="50"></el-table-column> <el-table-column type="index" label="序号" width="50"></el-table-column>
<el-table-column <el-table-column
prop="code" prop="code"
@ -76,6 +76,15 @@
<el-table-column label="操作" fixed="right"> <el-table-column label="操作" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="handleSubForm( scope.row, 'add')"
>添加分库
</el-button
>
<el-button <el-button
type="text" type="text"
size="small" size="small"
@ -96,6 +105,53 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-table
:data="subList"
border
highlight-current-row
style="width: 100%;">
<el-table-column type="index" label="序号" width="50"></el-table-column>
<el-table-column
prop="code"
label="分库编码"
>
</el-table-column>
<el-table-column
prop="name"
label="分库名称"
>
</el-table-column>
<el-table-column
prop="parentId"
label="所属仓库"
>
</el-table-column>
<el-table-column label="操作" fixed="right">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="handleSubForm( scope.row, 'edit')"
>编辑
</el-button
>
<el-button
type="text"
size="small"
:disabled="!configParms.basicInv"
@click.native.stop="handleSubDel(scope.row)"
>删除
</el-button
>
</template>
</el-table-column>
</el-table>
</el-card> </el-card>
<el-pagination <el-pagination
:page-size="query.limit" :page-size="query.limit"
@ -104,34 +160,21 @@
:total="total" :total="total"
> >
</el-pagination> </el-pagination>
<!--表单界--> <!--仓库弹窗编辑页-->
<el-dialog <el-dialog
:title="formMap[formName]" :title="formMap[formName]"
:close-on-click-modal="false" :close-on-click-modal="false"
:close-on-press-escape="false" :close-on-press-escape="false"
:visible.sync="subFormVisible" :visible.sync="formVisible"
:before-close="hideForm" :before-close="hideForm"
width="40%" width="40%"
top="5vh" top="5vh"
> >
<el-form :model="formData" :rules="formRules" ref="dataForm"> <el-form :model="formData" :rules="formRules" ref="dataForm">
<el-form-item label="本企业仓库" prop="pid">
<el-select v-model="formData.pid" placeholder="顶级" disabled>
<el-option
v-for="item in mergeList"
:key="item.id"
:label="item.name"
:value="item.id"
>
<span style="float: left"
><span v-html="item.html"></span>{{ item.name }}</span
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="仓库编码" prop="title" class="query-form-item"> <el-form-item label="仓库编码" prop="code" class="query-form-item">
<el-input <el-input
disabled
v-model.trim="formData.code" style="width: 80%" v-model.trim="formData.code" style="width: 80%"
auto-complete="off" auto-complete="off"
></el-input> ></el-input>
@ -144,10 +187,21 @@
</el-form-item> </el-form-item>
<el-form-item class="query-form-item" label="仓库类型:"> <el-form-item class="query-form-item" prop="advanceType" label="仓库类型">
<el-select v-model="formData.advanceType" placeholder="仓库类型" clearable> <el-select v-model="formData.advanceType" placeholder="仓库类型" clearable>
<el-option label="寄售" :value=true></el-option> <el-option label="寄售" :value='true'></el-option>
<el-option label="仓库" :value=false></el-option> <el-option label="仓库" :value='false'></el-option>
</el-select>
</el-form-item>
<el-form-item class="query-form-item" prop="thirdSysFk" label="第三方系统">
<el-select v-model="formData.thirdSysFk" placeholder="请选择第三方系统" clearable>
<el-option
v-for="item in thirdSys"
:key="item.thirdId"
:lable="item.thirdName"
:value="item.thirdName"
>
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="状态:" prop="status" class="query-form-item"> <el-form-item label="状态:" prop="status" class="query-form-item">
@ -169,68 +223,60 @@
> >
</div> </div>
</el-dialog> </el-dialog>
<!-- 分库弹窗编辑页面-->
<el-dialog <el-dialog
:title="formMap[formName]" :title="formMap[formName]"
:close-on-click-modal="false" :close-on-click-modal="false"
:close-on-press-escape="false" :close-on-press-escape="false"
:visible.sync="formVisible" :visible.sync="subFormVisible"
:before-close="hideForm" :before-close="hideForm"
width="40%" width="60%"
top="5vh" top="5vh"
> >
<el-form :model="formData" :rules="formRules" ref="dataForm"> <el-form :model="subData" ref="dataForm">
<el-form-item label="所属仓库" prop="pid">
<el-select v-model="subData.parentId" placeholder="顶级" disabled>
<el-option
v-for="item in mergeList"
:key="item.code"
:label="item.name"
:value="item.code"
>
<span style="float: left"
><span v-html="item.html"></span>{{ item.name }}</span
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="仓库编码" prop="code" class="query-form-item"> <el-form-item label="分库编码" prop="title" class="query-form-item">
<el-input <el-input
disabled v-model="subData.code" style="width: 80%"
v-model.trim="formData.code" style="width: 80%"
auto-complete="off" auto-complete="off"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="仓库名称" prop="name" class="query-form-item"> <el-form-item label="库名称" prop="name" class="query-form-item">
<el-input <el-input
v-model.trim="formData.name" style="width: 80%" v-model="subData.name" style="width: 80%"
auto-complete="off" auto-complete="off"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item class="query-form-item" prop="advanceType" label="仓库类型">
<el-select v-model="formData.advanceType" placeholder="仓库类型" clearable>
<el-option label="寄售" :value='true'></el-option>
<el-option label="仓库" :value='false'></el-option>
</el-select>
</el-form-item>
<el-form-item class="query-form-item" prop="thirdSysFk" label="第三方系统">
<el-select v-model="formData.thirdSysFk" placeholder="请选择第三方系统" clearable>
<el-option
v-for="item in thirdSys"
:key="item.thirdId"
:lable="item.thirdName"
:value="item.thirdName"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="状态:" prop="status" class="query-form-item">
<el-radio-group v-model="formData.status">
<el-radio :label="0">禁用</el-radio>
<el-radio :label="1">正常</el-radio>
</el-radio-group>
</el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click.native="hideForm">取消</el-button> <el-button @click.native="hideForm">取消</el-button>
<el-button <el-button
type="primary" type="primary"
@click.native="formSubmit()" @click.native="forSubSubmit()"
:loading="formLoading" :loading="formLoading"
>提交 >提交
</el-button </el-button
> >
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@ -244,6 +290,7 @@ import {
import {filterDetailByKey, getBasicThirdSys} from "../../api/basic/basicThirdSys"; import {filterDetailByKey, getBasicThirdSys} from "../../api/basic/basicThirdSys";
import {findConfig} from "@/api/thrsys/spsSyncStatus"; import {findConfig} from "@/api/thrsys/spsSyncStatus";
import {isBlank} from "@/utils/strUtil"; import {isBlank} from "@/utils/strUtil";
import {filterThridSubAll, filterSubByInv, deleteSubWarehouse, saveSubWarehouse} from "@/api/thrsys/thrdSubInvWarehouse";
const formJson = { const formJson = {
@ -273,6 +320,9 @@ export default {
thirdSysFk: null, thirdSysFk: null,
}, },
mergeList: [], mergeList: [],
subList: [],
subData: {},
currentCode: null,
node: null, node: null,
defaultProps: { defaultProps: {
children: "children", children: "children",
@ -328,33 +378,25 @@ export default {
this.query.page = val; this.query.page = val;
this.getList(); this.getList();
}, },
renderContent(h, {node, data, store}) {
return (
<span
style="flex: 1; display: flex; align-items: center; justify-content: space-between; font-size: 14px; padding-right: 8px;">
<span>
<span title={data.name} style="margin-left:8px">{node.label}</span>
<span style="margin-left:18px">(编码{data.code})</span>
</span>
<span>
<el-button handInvCurrentChange(row) {
style="font-size: 12px;" this.subList = [];
type="text" this.currentCode = row.code;
on-click={() => this.handleForm(node, data, "edit")} this.loadSubData(row);
> },
编辑
</el-button> loadSubData(row) {
<el-button let subQuery = {
style="font-size: 12px;" parentId: row.code,
type="text" thirdSysFk: row.thirdSysFk,
on-click={() => this.handleDel(node, data)} }
> filterThridSubAll(subQuery).then((res) => {
删除 if (res.code == 20000) {
</el-button> this.subList = res.data.list;
</span>
</span> }
); }).catch((error) => {
});
}, },
onReset() { onReset() {
this.$router.push({ this.$router.push({
@ -456,29 +498,71 @@ export default {
} }
}, },
handleSubForm(node, data, formName) { handleSubForm(data, formName) {
this.subFromName = formName;
if (formName === "edit") {
this.subData = data;
} else if (formName === "add") {
this.subData = {};
this.subData.parentId = data.code;
this.subData.thirdSysFk = data.thirdSysFk;
}
this.subFormVisible = true; this.subFormVisible = true;
},
this.pidData = data || null; handleSubDel(row) {
formJson.pid = (data && parseInt(data.id)) || ""; if (row.id) {
this.formData = JSON.parse(JSON.stringify(formJson)); this.$confirm("确认删除该分库吗?", "提示", {
if (formName === "edit") { type: "warning",
this.formData = Object.assign({}, data); })
this.node = node; .then(() => {
} else { this.deleteLoading = true;
let no = this.getProjectNum() + Math.floor(Math.random() * 10000); let para = {id: row.id};
this.formData.code = no; 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("取消删除");
});
} }
this.formData.pid = !this.formData.pid ? "" : this.formData.pid; },
this.formName = formName; //
if (data && data.id) { forSubSubmit() {
this.index = this.mergeList.findIndex((d) => d.id === data.id);
if (this.$isBlank(this.subData.name)) {
this.$message.error("分库名称不能为空!");
return;
} }
saveSubWarehouse(this.subData, this.subFromName).then((response) => {
if (response.code == 20000) {
this.loadSubData(this.subData.parentId);
this.subFormVisible = false;
} else {
this.$message.error(response.message);
this.subFormVisible = false;
}
}).catch(() => {
this.subFormVisible = false;
});
}, },
formSubmit() { formSubmit() {
if (!isBlank(this.formData.code)) { if (!isBlank(this.formData.code)) {
if (Number(this.formData.code)+'' ===NaN+'' ) { if (Number(this.formData.code) + '' === NaN + '') {
this.$message.error("仓库编码格式错误!") this.$message.error("仓库编码格式错误!")
return; return;
} }
@ -515,11 +599,6 @@ export default {
this.mergeList.push(data); this.mergeList.push(data);
} }
} }
} else {
// const parent = this.node.parent;
// const children = parent.data.children || parent.data;
// const index = children.findIndex((d) => d.id === data.id);
// children.splice(index, 1, data);
} }
// //
this.resetForm(); this.resetForm();
@ -658,7 +737,8 @@ export default {
.catch(() => { .catch(() => {
}); });
}, },
}, }
,
filters: { filters: {
statusFilterType(status) { statusFilterType(status) {
const statusMap = { const statusMap = {
@ -666,24 +746,30 @@ export default {
1: "success", 1: "success",
}; };
return statusMap[status]; return statusMap[status];
}, }
,
statusFilterName(status) { statusFilterName(status) {
const statusMap = { const statusMap = {
0: "禁用", 0: "禁用",
1: "正常", 1: "正常",
}; };
return statusMap[status]; return statusMap[status];
}, }
}, ,
}
,
mounted() { mounted() {
}, }
,
created() { created() {
// //
this.getBasicThirdSys(); this.getBasicThirdSys();
this.getSyncConfig(); this.getSyncConfig();
this.getList(); this.getList();
}, }
}; ,
}
;
</script> </script>
<style type="text/scss" lang="scss"> <style type="text/scss" lang="scss">

Loading…
Cancel
Save