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

fengcang
anthonyywj2 3 years ago
parent a91972ba61
commit c4537a0ab8

@ -40,3 +40,32 @@ export function deleteSubWarehouse(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
})
}
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-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>
<div slot="footer" class="dialog-footer">
<el-button @click.native="hideForm">取消</el-button>
@ -530,8 +570,6 @@
</div>
</el-dialog>
<el-dialog title="关联仓库" :visible.sync="thrWareHouseVisible">
<el-form :inline="true" :model="query" class="query-form" size="mini">
<el-form-item class="query-form-item">
<el-input
@ -598,6 +636,65 @@
</div>
</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>
</template>
@ -609,10 +706,11 @@ import {
warehouseUserList, saveWarehouseBussinessType,
saveWarehouseUser, updateDirector, disableWarehouse,
deleteWarehouseUser, deleteWarehouseBussinessType,
bindThrWarehouse, unbindThrWarehouse, getThrsysDetail
bindThrWarehouse, unbindThrWarehouse, filterThridSubByInv, getThrsysDetail
} from "../../api/basic/invWarehouse";
import {
filterSubAll, saveSubWarehouse, deleteSubWarehouse
filterSubAll, saveSubWarehouse, deleteSubWarehouse,
getSubThrsysDetail, bindThrSubWarehouse, unbindSubThrWarehouse
} from "../../api/basic/invSubWarehouse";
import {filterThrList} from "@/api/thrsys/thrInvWarehouse";
import {getHospitalUserList} from "../../api/auth/authUser";
@ -696,23 +794,37 @@ export default {
bussinessTypeList: null,
userFormVisible: false,
currentCode: null,
superRow: null,
currentRow: {status: 1},
selectUserList: [],
selectBussinessTypeList: [],
bussinessTypeFormVisible: false,
thrWarehouseData: null,
thrWarehouseData: [],
thrSubWarehouseData: [],
currentId: null,
currentSubId: null,
thrWareHouseVisible: false,
thrSubWareHouseVisible: false,
sysList: [],
sysSubList: [],
checkThrWarehouseRow: null,
checkSubThrWarehouseRow: null,
currentSysId: null,
thirdSysVisible: false,
total: 0,
subTotal: 0,
thirdQuery: {
key: null,
page: 1,
limit: 10
, thirdSysFk: "thirdId",
limit: 10,
thirdSysFk: "thirdId",
},
thirdSubQuery: {
parentId: null,
key: null,
page: 1,
limit: 10,
thirdSysFk: "thirdId",
},
configParms: {},
subData: {},
@ -760,7 +872,7 @@ export default {
//
this.formVisible = false;
this.subFormVisible = false;
this.loadSubData(this.currentCode);
// this.loadSubData(this.currentCode);
return true;
},
//
@ -809,8 +921,24 @@ export default {
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) {
this.subFromName = formName;
if (formName === "edit") {
this.subData = data;
} else if (formName === "add") {
@ -819,7 +947,7 @@ export default {
}
;
this.subFormVisible = true;
this.getSubThrsysDetailData();
},
//
formSubmit() {
@ -1063,7 +1191,7 @@ export default {
this.subList = [];
this.userList = null;
this.bussinessTypeList = null;
this.currentCode = row.code;
this.superRow = row;
this.loadSubData(row.code);
},
@ -1305,8 +1433,11 @@ export default {
sysId: this.currentSysId
}
bindThrWarehouse(params).then((res) => {
this.$message.success("绑定成功")
this.getThrsysDetailData();
if (res.code == 20000) {
this.$message.success("绑定成功")
this.getThrsysDetailData();
}
}).catch((error) => {
this.$message.error("绑定失败")
})
@ -1324,11 +1455,46 @@ export default {
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) {
if (row != null)
this.currentSysId = row.sysId;
//
this.thirdQuery.thirdSysFk = this.currentSysId;
this.thrWarehouseData = [];
filterThrList(this.thirdQuery).then((res) => {
this.thrWarehouseData = res.data.list;
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) {
this.thirdQuery.page = val;
this.intentSelect();
},
handleSubCurrentChange(val) {
this.thirdSubQuery.page = val;
this.intentSubSelect();
},
changeThrWarehouse(row) {
this.checkThrWarehouseRow = row;
},
changeSubThrWarehouse(row) {
this.checkSubThrWarehouseRow = row;
},
hideThrWarehouseTable() {
this.thrWareHouseVisible = false;
this.thrSubWareHouseVisible = false;
},
getSyncConfig() {
findConfig()

@ -1,118 +1,117 @@
<template>
<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-date-picker
v-model="filterQuery.submitTime"
type="date"
placeholder="请选择提交时间"
:picker-options="pickerOptions">
</el-date-picker>
</el-form-item>
<el-card>
<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-select v-model="filterQuery.status" placeholder="处理状态">
<el-option label="全部" value=""></el-option>
<el-option label="处理成功" value="2"></el-option>
<el-option label="处理失败" value="3"></el-option>
</el-select>
</el-form-item>
<el-form-item class="query-form-item">
<el-date-picker
v-model="filterQuery.submitTime"
type="date"
placeholder="请选择提交时间"
:picker-options="pickerOptions">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button-group style="display:flex;">
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="search" @click="getList"></el-button>
</el-button-group>
</el-form-item>
</el-row>
</el-form>
<el-form-item class="query-form-item">
<el-select v-model="filterQuery.status" placeholder="处理状态">
<el-option label="全部" value=""></el-option>
<el-option label="处理成功" value="2"></el-option>
<el-option label="处理失败" value="3"></el-option>
</el-select>
</el-form-item>
<el-table
v-loading="loading"
:data="list"
style="width: 100%"
@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">
<span>{{ getStatusInfo(scope.row.status) }}</span>
</template>
</el-table-column>
<el-table-column
label="结果信息"
prop="result"
show-overflow-tooltip
<el-form-item>
<el-button-group style="display:flex;">
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="search" @click="getList"></el-button>
</el-button-group>
</el-form-item>
</el-row>
</el-form>
<el-table
v-loading="loading"
:data="list"
style="width: 100%"
@selection-change="handleSelectionChange"
>
</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-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">
<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
title="结果详情"
width="35%"

@ -1,118 +1,116 @@
<template>
<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-card>
<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-date-picker
v-model="filterQuery.submitTime"
type="date"
placeholder="请选择提交时间"
:picker-options="pickerOptions">
</el-date-picker>
</el-form-item>
<el-form-item class="query-form-item">
<el-date-picker
v-model="filterQuery.submitTime"
type="date"
placeholder="请选择提交时间"
:picker-options="pickerOptions">
</el-date-picker>
</el-form-item>
<el-form-item class="query-form-item">
<el-select v-model="filterQuery.status" placeholder="处理状态">
<el-option label="全部" value=""></el-option>
<el-option label="提交成功" value="2"></el-option>
<el-option label="提交失败" value="3"></el-option>
</el-select>
</el-form-item>
<el-form-item class="query-form-item">
<el-select v-model="filterQuery.status" placeholder="处理状态">
<el-option label="全部" value=""></el-option>
<el-option label="提交成功" value="2"></el-option>
<el-option label="提交失败" value="3"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button-group style="display:flex;">
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="search" @click="getList"></el-button>
</el-button-group>
</el-form-item>
</el-row>
</el-form>
<el-table
v-loading="loading"
:data="list"
style="width: 100%"
@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
<el-form-item>
<el-button-group style="display:flex;">
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="search" @click="getList"></el-button>
</el-button-group>
</el-form-item>
</el-row>
</el-form>
<el-table
v-loading="loading"
:data="list"
style="width: 100%"
@selection-change="handleSelectionChange"
>
<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-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">
<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
title="结果详情"
width="35%"

@ -48,8 +48,8 @@
style="width: 100%;margin-bottom: 20px;"
row-key="id"
border
default-expand-all
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
highlight-current-row
@current-change="handInvCurrentChange">
<el-table-column type="index" label="序号" width="50"></el-table-column>
<el-table-column
prop="code"
@ -76,6 +76,15 @@
<el-table-column label="操作" fixed="right">
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="handleSubForm( scope.row, 'add')"
>添加分库
</el-button
>
<el-button
type="text"
size="small"
@ -96,6 +105,53 @@
</el-table-column>
</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-pagination
:page-size="query.limit"
@ -104,34 +160,21 @@
:total="total"
>
</el-pagination>
<!--表单界-->
<!--仓库弹窗编辑页-->
<el-dialog
:title="formMap[formName]"
:close-on-click-modal="false"
:close-on-press-escape="false"
:visible.sync="subFormVisible"
:visible.sync="formVisible"
:before-close="hideForm"
width="40%"
top="5vh"
>
<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
disabled
v-model.trim="formData.code" style="width: 80%"
auto-complete="off"
></el-input>
@ -144,10 +187,21 @@
</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-option label="寄售" :value=true></el-option>
<el-option label="仓库" :value=false></el-option>
<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">
@ -169,68 +223,60 @@
>
</div>
</el-dialog>
<!-- 分库弹窗编辑页面-->
<el-dialog
:title="formMap[formName]"
:close-on-click-modal="false"
:close-on-press-escape="false"
:visible.sync="formVisible"
:visible.sync="subFormVisible"
:before-close="hideForm"
width="40%"
width="60%"
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
disabled
v-model.trim="formData.code" style="width: 80%"
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-form-item label="库名称" prop="name" class="query-form-item">
<el-input
v-model.trim="formData.name" style="width: 80%"
v-model="subData.name" style="width: 80%"
auto-complete="off"
></el-input>
</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>
<div slot="footer" class="dialog-footer">
<el-button @click.native="hideForm">取消</el-button>
<el-button
type="primary"
@click.native="formSubmit()"
@click.native="forSubSubmit()"
:loading="formLoading"
>提交
</el-button
>
</div>
</el-dialog>
</div>
</template>
@ -244,6 +290,7 @@ import {
import {filterDetailByKey, getBasicThirdSys} from "../../api/basic/basicThirdSys";
import {findConfig} from "@/api/thrsys/spsSyncStatus";
import {isBlank} from "@/utils/strUtil";
import {filterThridSubAll, filterSubByInv, deleteSubWarehouse, saveSubWarehouse} from "@/api/thrsys/thrdSubInvWarehouse";
const formJson = {
@ -273,6 +320,9 @@ export default {
thirdSysFk: null,
},
mergeList: [],
subList: [],
subData: {},
currentCode: null,
node: null,
defaultProps: {
children: "children",
@ -328,33 +378,25 @@ export default {
this.query.page = val;
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
style="font-size: 12px;"
type="text"
on-click={() => this.handleForm(node, data, "edit")}
>
编辑
</el-button>
<el-button
style="font-size: 12px;"
type="text"
on-click={() => this.handleDel(node, data)}
>
删除
</el-button>
</span>
</span>
);
handInvCurrentChange(row) {
this.subList = [];
this.currentCode = row.code;
this.loadSubData(row);
},
loadSubData(row) {
let subQuery = {
parentId: row.code,
thirdSysFk: row.thirdSysFk,
}
filterThridSubAll(subQuery).then((res) => {
if (res.code == 20000) {
this.subList = res.data.list;
}
}).catch((error) => {
});
},
onReset() {
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.pidData = data || null;
formJson.pid = (data && parseInt(data.id)) || "";
this.formData = JSON.parse(JSON.stringify(formJson));
if (formName === "edit") {
this.formData = Object.assign({}, data);
this.node = node;
} else {
let no = this.getProjectNum() + Math.floor(Math.random() * 10000);
this.formData.code = no;
handleSubDel(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("取消删除");
});
}
this.formData.pid = !this.formData.pid ? "" : this.formData.pid;
},
this.formName = formName;
if (data && data.id) {
this.index = this.mergeList.findIndex((d) => d.id === data.id);
//
forSubSubmit() {
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() {
if (!isBlank(this.formData.code)) {
if (Number(this.formData.code)+'' ===NaN+'' ) {
if (Number(this.formData.code) + '' === NaN + '') {
this.$message.error("仓库编码格式错误!")
return;
}
@ -515,11 +599,6 @@ export default {
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();
@ -658,7 +737,8 @@ export default {
.catch(() => {
});
},
},
}
,
filters: {
statusFilterType(status) {
const statusMap = {
@ -666,24 +746,30 @@ export default {
1: "success",
};
return statusMap[status];
},
}
,
statusFilterName(status) {
const statusMap = {
0: "禁用",
1: "正常",
};
return statusMap[status];
},
},
}
,
}
,
mounted() {
},
}
,
created() {
//
this.getBasicThirdSys();
this.getSyncConfig();
this.getList();
},
};
}
,
}
;
</script>
<style type="text/scss" lang="scss">

Loading…
Cancel
Save