1.调整设备领用功能页面

zhairh
x_z 3 years ago
parent 5c2e8cd2a5
commit e7b5de7fd3

@ -68,4 +68,12 @@ export function unbindSubThrWarehouse(params) {
}); });
} }
export function getInvWarehouseList(params) {
return axios({
url: "/spms/sub/inv/warehouse/filterSubInvList",
method: "get",
params: params
});
}

@ -2,12 +2,6 @@
<div> <div>
<el-form :model="formData" ref="dataForm"> <el-form :model="formData" ref="dataForm">
<el-button-group style="display: flex;margin: -50px 0 10px 80%; height: 35px"> <el-button-group style="display: flex;margin: -50px 0 10px 80%; height: 35px">
<el-button
type="primary"
:disabled="this.detailList.length > 0"
@click.native="selectInvProduct()"
>录入产品
</el-button>
<el-button <el-button
type="primary" type="primary"
@click.native="saveDeviceCollectOrder()" @click.native="saveDeviceCollectOrder()"
@ -48,6 +42,7 @@
<el-form-item prop="deptCode"> <el-form-item prop="deptCode">
<el-select v-model="formData.deptCode" placeholder="领用部门" <el-select v-model="formData.deptCode" placeholder="领用部门"
:disabled="detailList.length >0 " :disabled="detailList.length >0 "
@change="deptChange"
clearable> clearable>
<el-option <el-option
v-for="item in deptList" v-for="item in deptList"
@ -68,16 +63,18 @@
</el-col> </el-col>
<el-col :span="7"> <el-col :span="7">
<el-form-item prop="collectUser"> <el-form-item prop="collectUser">
<el-select v-model="formData.deptCode" placeholder="领用部门" <el-select v-model="formData.collectUser" placeholder="领用人"
:disabled="detailList.length >0 " :disabled="detailList.length >0 "
clearable> clearable>
<el-option <el-option
v-for="item in deptList" v-for="item in userList"
:key="item.name" :key="item.employeeName"
:label="item.name" :label="item.employeeName"
:value="item.code"> :value="item.employeeName">
<span style="float: left">{{ item.name }}</span> <span style="float: left">{{ item.employeeName }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.code }}</span> <span style="float: right; color: #8492a6; font-size: 13px">{{
item.employeeName
}}</span>
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -113,9 +110,17 @@
size="small" size="small"
@click.native.stop="addCode()" @click.native.stop="addCode()"
style="height: 31px; margin-left: 20px" style="height: 31px; margin-left: 20px"
>添加 >扫码添加
</el-button </el-button
> >
<el-button
style="height: 31px; margin-left: 20px"
type="primary"
:disabled="this.detailList.length > 0"
@click.native="selectInvProduct()"
>手动添加
</el-button>
</el-button-group> </el-button-group>
</el-col> </el-col>
@ -281,7 +286,7 @@
</template> </template>
<script> <script>
import {filterSubAll} from "@/api/basic/invSubWarehouse"; import { getInvWarehouseList} from "@/api/basic/invSubWarehouse";
import {getSpaceCodeList} from "@/api/inventory/invSpace"; import {getSpaceCodeList} from "@/api/inventory/invSpace";
import { import {
addCollectOrder, addCollectOrder,
@ -295,6 +300,8 @@ import {
import {getMAInvProducts} from "@/api/inventory/InvProducts"; import {getMAInvProducts} from "@/api/inventory/InvProducts";
import {isBlank} from "@/utils/strUtil"; import {isBlank} from "@/utils/strUtil";
import {filterDepts} from "@/api/auth/authDept"; import {filterDepts} from "@/api/auth/authDept";
import {authAdminList} from "@/api/auth/authAdmin";
import {userInfo} from "@/api/auth/login";
export default { export default {
props: { props: {
@ -316,6 +323,7 @@ export default {
batchNo: null, batchNo: null,
invWarehouseCode: null, invWarehouseCode: null,
invSpaceCode: null, invSpaceCode: null,
cplb: "设备",
page: 1, page: 1,
limit: 10 limit: 10
}, },
@ -329,6 +337,7 @@ export default {
deptCode: null, deptCode: null,
status: 0, status: 0,
code: null, code: null,
collectUser: null
}, },
detailList: [], detailList: [],
loading: false, loading: false,
@ -336,12 +345,24 @@ export default {
currentIndex: -1, currentIndex: -1,
selectInvProductVisible: false, selectInvProductVisible: false,
multiProduct: [], multiProduct: [],
deptList: [] deptList: [],
userList: []
} }
}, },
methods: { methods: {
getAllWarehouse() { getAllWarehouse() {
filterSubAll().then((res) => { let userId = null;
if (!isBlank(this.formData.collectUser)) {
this.userList.forEach(item => {
if (item.name === this.formData.collectUser) {
userId = item.id;
}
});
} else {
userId = this.$store.getters.adminId;
}
let params = {userId: userId};
getInvWarehouseList(params).then((res) => {
if (res.code === 20000) { if (res.code === 20000) {
this.warehouseList = res.data || []; this.warehouseList = res.data || [];
} }
@ -356,7 +377,24 @@ export default {
}); });
}, },
selectInvProduct() { selectInvProduct() {
this.getAllWarehouse(); if (isBlank(this.formData.deptCode)) {
this.$message.error("请选择领用部门!")
return;
} else if (isBlank(this.formData.collectUser)) {
this.$message.error("请选择领用人!")
return;
}
userInfo().then((res) => {
if (res.code === 20000) {
if (!isBlank(res.data.locInvCode)) {
this.filterQuery.invWarehouseCode = res.data.locSubInvCode;
this.getAllWarehouse();
this.warehouseChange();
}
this.getList();
}
}).catch((error) => {
});
// //
this.saveOrder(); this.saveOrder();
this.filterQuery = { this.filterQuery = {
@ -364,6 +402,7 @@ export default {
cpmctymc: null, cpmctymc: null,
batchNo: null, batchNo: null,
invWarehouseCode: null, invWarehouseCode: null,
cplb: "设备",
invSpaceCode: null, invSpaceCode: null,
page: 1, page: 1,
limit: 10 limit: 10
@ -499,6 +538,7 @@ export default {
batchNo: null, batchNo: null,
invWarehouseCode: null, invWarehouseCode: null,
invSpaceCode: null, invSpaceCode: null,
cplb: "设备",
page: 1, page: 1,
limit: 10 limit: 10
}; };
@ -568,6 +608,17 @@ export default {
this.deptList = res.data.list || []; this.deptList = res.data.list || [];
}) })
}, },
deptChange() {
//
this.userList = [];
this.formData.collectUser = null;
let params = {
deptCode: this.formData.deptCode
};
authAdminList(params).then((res) => {
this.userList = res.data.list || [];
});
},
}, },
created() { created() {
this.getDepts(); this.getDepts();
@ -577,6 +628,7 @@ export default {
this.formData.deptCode = this.deviceCollectOrder.deptCode; this.formData.deptCode = this.deviceCollectOrder.deptCode;
this.formData.createTime = this.deviceCollectOrder.createTime; this.formData.createTime = this.deviceCollectOrder.createTime;
this.formData.invWarehouseCode = this.deviceCollectOrder.invWarehouseCode; this.formData.invWarehouseCode = this.deviceCollectOrder.invWarehouseCode;
this.formData.collectUser = this.deviceCollectOrder.collectUser;
this.getList(); this.getList();
} }
}, },

@ -190,6 +190,7 @@ export default {
}); });
}, },
closeDialog() { closeDialog() {
debugger
this.formVisible = false; this.formVisible = false;
this.getList(); this.getList();
}, },

@ -143,6 +143,32 @@
</el-row> </el-row>
<el-row :gutter="20" class="el-row" type="flex"> <el-row :gutter="20" class="el-row" type="flex">
<el-col :span="10" class="el-col" type="flex">
<el-form-item class="text item" prop="dept" label="所属科室"
>
<el-select
v-model="formData.dept"
filterable
clearable="true"
reserve-keyword
placeholder="请选择科室信息"
:remote-method="findDeptMethod"
:loading="loading"
@focus="findDeptMethod('')"
@change="deptChange"
>
<el-option
v-for="item in fromDeptOptions"
:key="item.code"
:label="item.name"
:value="item.code"
>
<span style="float: left">{{ item.name }}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="10" class="el-col" type="flex"> <el-col :span="10" class="el-col" type="flex">
<div class="text item"> <div class="text item">
<el-form-item prop="comments"> <el-form-item prop="comments">
@ -198,6 +224,7 @@ import {
import {findConfig} from "@/api/thrsys/spsSyncStatus"; import {findConfig} from "@/api/thrsys/spsSyncStatus";
import {isBlank} from "@/utils/strUtil"; import {isBlank} from "@/utils/strUtil";
import {selectSysParamByKey} from "@/api/param/systemParamConfig"; import {selectSysParamByKey} from "@/api/param/systemParamConfig";
import {filterDepts} from "@/api/auth/authDept";
const formJson = { const formJson = {
@ -208,7 +235,8 @@ const formJson = {
employeeName: "", employeeName: "",
userFlag: 1, userFlag: 1,
comments: '', comments: '',
roles: [] roles: [],
dept: null
}; };
export default { export default {
data() { data() {
@ -280,7 +308,8 @@ export default {
{required: true, message: "请选择状态", trigger: "change"} {required: true, message: "请选择状态", trigger: "change"}
] ]
}, },
deleteLoading: false deleteLoading: false,
fromDeptOptions: []
}; };
}, },
methods: { methods: {
@ -352,6 +381,8 @@ export default {
}, },
// //
handleForm(index, row) { handleForm(index, row) {
//
this.findDeptMethod();
this.formVisible = true; this.formVisible = true;
this.formData = JSON.parse(JSON.stringify(formJson)); this.formData = JSON.parse(JSON.stringify(formJson));
if (row !== null) { if (row !== null) {
@ -363,7 +394,8 @@ export default {
employeeName: row.employeeName, employeeName: row.employeeName,
userFlag: 1, userFlag: 1,
comments: row.comments, comments: row.comments,
roles: row.roles roles: row.roles,
dept: row.dept
}; };
} }
this.formName = "add"; this.formName = "add";
@ -458,6 +490,25 @@ export default {
.catch(() => { .catch(() => {
}); });
}, },
findDeptMethod() {
let query = {
flag: 1
};
filterDepts(query)
.then((response) => {
this.loading = false;
this.fromDeptOptions = response.data.list || [];
})
.catch(() => {
this.loading = false;
this.fromDeptOptions = [];
});
},
deptChange(row) {
this.formData.corpId = row.code;
this.formData.corpName = row.name;
},
}, },
filters: { filters: {
statusFilterType(status) { statusFilterType(status) {
@ -491,15 +542,14 @@ export default {
this.getRoleList(); this.getRoleList();
// //
selectSysParamByKey({paramKey: "muti_inv_mode"}).then((res) => { /*selectSysParamByKey({paramKey: "muti_inv_mode"}).then((res) => {
if (res.code === 20000) { if (res.code === 20000) {
if (res.data.paramValue === "0") { if (res.data.paramValue === "0") {
this.enableDept = true; this.enableDept = true;
} }
} }
}) })*/
} }
}; };
</script> </script>

Loading…
Cancel
Save