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>
<el-form :model="formData" ref="dataForm">
<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
type="primary"
@click.native="saveDeviceCollectOrder()"
@ -48,6 +42,7 @@
<el-form-item prop="deptCode">
<el-select v-model="formData.deptCode" placeholder="领用部门"
:disabled="detailList.length >0 "
@change="deptChange"
clearable>
<el-option
v-for="item in deptList"
@ -68,16 +63,18 @@
</el-col>
<el-col :span="7">
<el-form-item prop="collectUser">
<el-select v-model="formData.deptCode" placeholder="领用部门"
<el-select v-model="formData.collectUser" placeholder="领用人"
:disabled="detailList.length >0 "
clearable>
<el-option
v-for="item in deptList"
:key="item.name"
:label="item.name"
:value="item.code">
<span style="float: left">{{ item.name }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.code }}</span>
v-for="item in userList"
:key="item.employeeName"
:label="item.employeeName"
:value="item.employeeName">
<span style="float: left">{{ item.employeeName }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{
item.employeeName
}}</span>
</el-option>
</el-select>
</el-form-item>
@ -113,9 +110,17 @@
size="small"
@click.native.stop="addCode()"
style="height: 31px; margin-left: 20px"
>添加
>扫码添加
</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-col>
@ -281,7 +286,7 @@
</template>
<script>
import {filterSubAll} from "@/api/basic/invSubWarehouse";
import { getInvWarehouseList} from "@/api/basic/invSubWarehouse";
import {getSpaceCodeList} from "@/api/inventory/invSpace";
import {
addCollectOrder,
@ -295,6 +300,8 @@ import {
import {getMAInvProducts} from "@/api/inventory/InvProducts";
import {isBlank} from "@/utils/strUtil";
import {filterDepts} from "@/api/auth/authDept";
import {authAdminList} from "@/api/auth/authAdmin";
import {userInfo} from "@/api/auth/login";
export default {
props: {
@ -316,6 +323,7 @@ export default {
batchNo: null,
invWarehouseCode: null,
invSpaceCode: null,
cplb: "设备",
page: 1,
limit: 10
},
@ -329,6 +337,7 @@ export default {
deptCode: null,
status: 0,
code: null,
collectUser: null
},
detailList: [],
loading: false,
@ -336,12 +345,24 @@ export default {
currentIndex: -1,
selectInvProductVisible: false,
multiProduct: [],
deptList: []
deptList: [],
userList: []
}
},
methods: {
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) {
this.warehouseList = res.data || [];
}
@ -356,7 +377,24 @@ export default {
});
},
selectInvProduct() {
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.filterQuery = {
@ -364,6 +402,7 @@ export default {
cpmctymc: null,
batchNo: null,
invWarehouseCode: null,
cplb: "设备",
invSpaceCode: null,
page: 1,
limit: 10
@ -499,6 +538,7 @@ export default {
batchNo: null,
invWarehouseCode: null,
invSpaceCode: null,
cplb: "设备",
page: 1,
limit: 10
};
@ -568,6 +608,17 @@ export default {
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() {
this.getDepts();
@ -577,6 +628,7 @@ export default {
this.formData.deptCode = this.deviceCollectOrder.deptCode;
this.formData.createTime = this.deviceCollectOrder.createTime;
this.formData.invWarehouseCode = this.deviceCollectOrder.invWarehouseCode;
this.formData.collectUser = this.deviceCollectOrder.collectUser;
this.getList();
}
},

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

@ -143,6 +143,32 @@
</el-row>
<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">
<div class="text item">
<el-form-item prop="comments">
@ -198,6 +224,7 @@ import {
import {findConfig} from "@/api/thrsys/spsSyncStatus";
import {isBlank} from "@/utils/strUtil";
import {selectSysParamByKey} from "@/api/param/systemParamConfig";
import {filterDepts} from "@/api/auth/authDept";
const formJson = {
@ -208,7 +235,8 @@ const formJson = {
employeeName: "",
userFlag: 1,
comments: '',
roles: []
roles: [],
dept: null
};
export default {
data() {
@ -280,7 +308,8 @@ export default {
{required: true, message: "请选择状态", trigger: "change"}
]
},
deleteLoading: false
deleteLoading: false,
fromDeptOptions: []
};
},
methods: {
@ -352,6 +381,8 @@ export default {
},
//
handleForm(index, row) {
//
this.findDeptMethod();
this.formVisible = true;
this.formData = JSON.parse(JSON.stringify(formJson));
if (row !== null) {
@ -363,7 +394,8 @@ export default {
employeeName: row.employeeName,
userFlag: 1,
comments: row.comments,
roles: row.roles
roles: row.roles,
dept: row.dept
};
}
this.formName = "add";
@ -458,6 +490,25 @@ export default {
.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: {
statusFilterType(status) {
@ -491,15 +542,14 @@ export default {
this.getRoleList();
//
selectSysParamByKey({paramKey: "muti_inv_mode"}).then((res) => {
/*selectSysParamByKey({paramKey: "muti_inv_mode"}).then((res) => {
if (res.code === 20000) {
if (res.data.paramValue === "0") {
this.enableDept = true;
}
}
})
})*/
}
};
</script>

Loading…
Cancel
Save