feat: 科室设备经营分析功能

lh_dev_ksck
chenhc 4 months ago
parent 097478bc25
commit b4dbd6fa7e

@ -0,0 +1,52 @@
import axios from "@/utils/request";
export function deviceBusinessProjectPage(query) {
return axios(
{
url: `/udi/device/businessProject/page`,
method: "POST",
data: query
}
)
}
export function deviceBusinessProjectDetailList(query) {
return axios(
{
url: `/udi/device/businessProject/detailList`,
method: "POST",
data: query
}
)
}
export function selectNotSelectDevice(query) {
return axios(
{
url: `/udi/device/businessProject/selectNotSelectDevice`,
method: "POST",
data: query
}
)
}
export function addDeviceProject(query) {
return axios(
{
url: `/udi/device/businessProject/addDeviceProject`,
method: "POST",
data: query
}
)
}
export function deleteDeviceProject(query) {
return axios(
{
url: `/udi/device/businessProject/deleteDeviceProject`,
method: "POST",
data: query
}
)
}

@ -0,0 +1,323 @@
<template>
<div>
<el-form :inline="true" :model="deviceQuery" class="query-form" size="mini">
<el-form-item class="query-form-item" label="设备名称或设备编码:">
<el-input
v-model="deviceQuery.key"
placeholder="请输入设备名称或设备编码"
clearable
></el-input>
</el-form-item>
<el-form-item>
<el-button-group>
<el-button
type="primary"
icon="el-icon-refresh"
@click="onUserReset"
>重置
</el-button>
<el-button type="primary" @click="loadUserList"
icon="el-icon-search"
>查询
</el-button
>
<el-button type="primary" @click="addDevice()"
icon="el-icon-document-add"
>选入库存设备
</el-button
>
</el-button-group>
</el-form-item>
</el-form>
<el-table
:data="deviceData"
key="row.id"
border
style="width: 100%"
highlight-current-row
>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="设备编码" width="150" prop="deviceCode"/>
<el-table-column label="最小销售标识" width="150" prop="nameCode"/>
<el-table-column label="名称" width="150" prop="productName"/>
<el-table-column label="规格型号" width="160" prop="ggxh"/>
<el-table-column label="状态" width="180" prop="statusName">
<template slot-scope="scope">
<el-tag :type="deviceStatus[scope.row.status].tagType">{{ scope.row.statusName }}</el-tag>
</template>
</el-table-column>
<el-table-column
label="操作"
min-width="30%"
>
<template slot-scope="scope">
<el-button
type="text"
@click.native="rmInvUser(scope.row)">
移除
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="userTotal>0"
:total="userTotal"
:page.sync="deviceQuery.page"
:limit.sync="deviceQuery.limit"
@pagination="loadUserList"
/>
<!--添加用户弹窗-->
<el-dialog
v-if="userFormVisible"
title="选入库存设备"
:close-on-click-modal="false"
width="65%"
append-to-body
:close-on-press-escape="false"
:visible.sync="userFormVisible"
>
<el-table v-loading="userloading" :data="selectUserList"
ref="selectUserList"
@selection-change="handleUserSelectionChange"
border
style="width: 100%">
<el-table-column
type="selection"
:reserve-selection="false"
width="55">
</el-table-column>
<el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="设备编码" width="150" prop="deviceCode"/>
<el-table-column label="最小销售标识" width="150" prop="nameCode"/>
<el-table-column label="名称" width="150" prop="productName"/>
<el-table-column label="规格型号" width="160" prop="ggxh"/>
<el-table-column label="状态" width="180" prop="statusName">
<template slot-scope="scope">
<el-tag :type="deviceStatus[scope.row.status].tagType">{{ scope.row.statusName }}</el-tag>
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button @click.native="userFormVisible = !userFormVisible"
>取消
</el-button
>
<el-button
type="primary"
@click.native="adddeviceData()"
>选入
</el-button>
</div>
<pagination
v-show="selectUserToatl>0"
:total="selectUserToatl"
:page.sync="selectdeviceQuery.page"
:limit.sync="selectdeviceQuery.limit"
@pagination="getSelectUser"
/>
</el-dialog>
</div>
</template>
<script>
import {
deviceBusinessProjectDetailList,selectNotSelectDevice,addDeviceProject,deleteDeviceProject
} from "@/api/dev/deviceBusinessProjectApi";
import {isBlank} from "@/utils/strUtil";
import {deviceChangeStatus, deviceChangeType, deviceStatus} from "@/utils/enum";
export default {
name: "invRelUsers",
computed: {
deviceChangeType() {
return deviceChangeType
},
deviceStatus() {
return deviceStatus
},
deviceChangeStatus() {
return deviceChangeStatus
}
},
props: {
configParms: {
type: Object,
required: true,
},
inputQuery: {
type: Object,
required: true,
},
closeDialog: {
type: Function,
required: true,
},
},
data() {
return {
//-------------------------------------
deviceQuery: {
sfxm: null,
page: 1,
limit: 10
},
deviceData: [],
userTotal: 0,
deviceDataList:[],
//--------------------
selectdeviceQuery: {
code: null,
page: 1,
limit: 10,
parentId:""
},
userFormVisible: false,
userloading: false,
selectUserList: [],
selectUserToatl: 0,
selectaddDevice: [],
//------------------------------
curSeleUser: null,
relBusUserVisile: false,
}
},
methods: {
//
onUserReset() {
this.deviceQuery = {
sfxm: this.inputQuery.sfxm,
page: 1,
limit: 10
};
this.loadUserList();
},
loadUserList() { ////
// if (val != null) {
// this.deviceQuery.page = val;
// }
//
deviceBusinessProjectDetailList(this.deviceQuery).then((res) => {
this.deviceData = res.data.list;
this.userTotal = res.data.total;
}).catch((error) => {
this.$message.error("数据正在处理,请勿重复提交")
});
},
addDevice() { //
if (isBlank(this.inputQuery.sfxm)) {
this.$message.warning("请先收费项目");
return;
}
this.currentCode = this.inputQuery.sfxm;
this.userFormVisible = true;
this.selectdeviceQuery.sfxm=this.inputQuery.sfxm;
this.getSelectUser();
},
rmInvUser(row) { //
this.$confirm("确定移除该库存设备关联收费项目?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
let params = {deviceCode: row.deviceCode};
deleteDeviceProject(params).then((res) => {
if (res.code == 20000) {
this.loadUserList();
} else {
this.$message.error(res.message);
}
}).catch((error) => {
});
})
.catch(() => {
});
},
handleUserSelectionChange(val) {
this.selectaddDevice = val;
},
getSelectUser() {
selectNotSelectDevice(this.selectdeviceQuery).then((res) => {
this.selectUserList = res.data.list;
this.selectUserToatl = res.data.total;
}).catch((error) => {
this.$message.error("用户数据加载失败")
});
},
adddeviceData() { //
if(this.selectaddDevice.length==0){
this.$message.error("请选择要选入的库存设备!");
return;
}
let deviceList = [] ;
this.selectaddDevice.forEach((obj) => {
deviceList.push(obj.deviceCode);
});
let query = {
sfxm: this.currentCode,
deviceList: deviceList
};
addDeviceProject(query).then((res) => {
if (res.code === 20000) {
this.userFormVisible = false;
this.$message.success("添加成功");
this.deviceQuery = {
sfxm: this.currentCode,
page: 1,
limit: 10
}
//
deviceBusinessProjectDetailList(this.deviceQuery).then((res) => {
this.deviceData = res.data.list;
this.userTotal = res.data.total;
}).catch((error) => {
this.deviceData = [];
this.userTotal = 0;
});
} else {
this.$message.error(res.message);
}
}).catch((error) => {
this.$message.error("添加失败");
});
},
//-
relBusttype(row) {
this.curSeleUser = row;
this.relBusUserVisile = true;
},
cancelRelBusDiaolog() {
this.relBusUserVisile = false;
},
},
watch: {
inputQuery: function () {
this.deviceQuery.sfxm = this.inputQuery.sfxm;
this.loadUserList();
},
},
created() {
this.deviceQuery.sfxm = this.inputQuery.sfxm;
}
}
</script>
<style scoped>
</style>

@ -0,0 +1,622 @@
<template>
<div>
<el-card>
<el-form :inline="true" :model="query" class="query-form" size="mini">
<!-- <el-form-item label="所属部门:">-->
<!-- <el-input v-model="query.deptName" placeholder="部门名称" clearable></el-input>-->
<!-- </el-form-item>-->
<el-form-item label="项目名称:">
<el-input
v-model="query.sfmc"
clearable
placeholder="项目名称"
></el-input>
</el-form-item>
<el-form-item>
<el-button-group style="margin-left: 10px;display:flex;">
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
<el-button type="primary" icon="el-icon-search" @click="onSubmit"></el-button>
</el-button-group>
</el-form-item>
</el-form>
<el-table
:data="list"
style="width: 100%"
border
highlight-current-row
@current-change="handSubInvCurrentChange"
row-key="id"
:default-expand-all="isExpandAll"
:row-style="{ height: '32px' }"
>
<el-table-column label="序号" type="index" ref="dataForm"></el-table-column>
<el-table-column
prop="sfxm"
width="140"
label="项目编码"
>
</el-table-column>
<el-table-column
width="160"
prop="sfmc"
label="项目名称"
>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="query.page"
:limit.sync="query.limit"
@pagination="handleCurrentChange"
></pagination>
</el-card>
<el-card>
<el-tabs type="border-card" style="margin: 15px 0px">
<el-tab-pane>
<span slot="label">{{ currentRow.sfmc }} -设备列表</span>
<InvRelDevice :inputQuery="currentRow"
:configParms="configParms"
></InvRelDevice>
</el-tab-pane>
</el-tabs>
</el-card>
</div>
</template>
<script>
import {
deviceBusinessProjectPage,
} from "@/api/dev/deviceBusinessProjectApi";
import {getJoinBussinessType} from "@/api/basic/bussinessType";
import {findConfig} from "@/api/sync/spsSyncStatus";
import {selectSysParamByKey} from "@/api/system/param/systemParamConfig";
import invSpaceManage from "@/views/inventory/InvSpaceManage";
import {
filterList,
filterThridSubByInv,
} from "@/api/system/invWarehouse";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import Treeselect from "@riophae/vue-treeselect";
import InvRelBusType from "@/views/system/dept/invRelBusType";
import InvRelDevice from "@/views/purchase/benefitManagement/invRelDevice";
import {isBlank} from "@/utils/strUtil";
export default {
data() {
return {
//----------------------------------
query: {
name: null,
sfmc: null,
code: null,
status: "1",
page: 1,
limit: 10,
},
isAdvanceTypeShow: false,
isShow: false,
loading: true,
list: [],
isExpandAll: true,
total: 0,
advanceTypeTypeMap: {
1: "入账库",
3: "寄售库",
2: "预验收库",
},
formMap: {
add: "仓库信息-新增",
edit: "仓库信息-编辑"
},
invWouse: {},
formName: null,
configParms: {},
currentCode: null,
currentRow: {},
mutiInvMode: true,
subFormVisible: false,
formRules: {
parentId: [
{required: true, message: "请选择所属部门", trigger: "blur"}
],
name: [
{required: true, message: "请输入仓库名称", trigger: "blur"}
],
advanceType: [
{required: true, message: "请选择是否寄售", trigger: "blur"}
]
},
subData: {},
subDataType: {},
fromDeptOptions: [],
invOptions: [],
thirdSubQuery: {
parentId: null,
name: null,
page: 1,
limit: 10,
thirdSysFk: "thirdId",
},
thrSubWareHouseVisible: false,
thrSubWarehouseData: [],
checkSubThrWarehouseRow: null,
subTotal: 0,
relBusTypeVisible: false,
relUserVisible: false,
//
currentInvInfo: {
invStorageCode: null,
invWarehouseCode: null,
invName: null
},
sysList: [],
sysSubList: [],
advanceTypese: [],
submitLoading: false,
};
},
methods: {
handleCurrentChange(val) {
this.query.page = val.page;
this.getList();
},
//---------------------------------
onReset() { //
this.$router.push({
path: "",
});
this.query = {
name: null,
sfmc: null,
code: null,
page: 1,
limit: 10,
};
this.subDataType.advanceType = null;
this.getList();
//
this.currentRow = {name: "仓库"};
this.currentInvInfo = {
invStorageCode: null,
invWarehouseCode: null,
invName: null
};
},
onResetintent() {
this.$router.push({
path: "",
});
this.thirdSubQuery = {
thirdSysFk: this.thirdSubQuery.thirdSysFk,
page: 1,
limit: 10
}
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("第三方分库库数据加载失败");
});
},
onSubmit() { //
this.query.advanceType = this.subDataType.advanceType;
this.getList();
},
getList() { //
this.loading = true;
this.list = [];
deviceBusinessProjectPage(this.query)
.then((response) => {
this.loading = false;
this.list = response.data.list || [];
this.total = response.data.total
})
.catch(() => {
this.loading = false;
this.total = 0;
this.list = [];
});
},
//
handleSubForm(data, formName) { //
if (data != null) {
this.invWouse = data;
}
this.formName = formName;
if (formName === "edit") {
this.subData = JSON.parse(JSON.stringify(data));
this.subData.advanceType = this.subData.advanceType.toString();
if (this.subData.parentCode != null && this.subData.parentCode != "") {
this.isAdvanceTypeShow = true;
this.isShow = false;
} else {
this.isAdvanceTypeShow = false;
this.isShow = true
this.subData.parentCode = null;
}
} else if (formName === "add") {
this.isShow = true
if (data == null) {
this.isAdvanceTypeShow = false;
this.subData = {advanceType: '1', spUse: false, parentCode: null};
} else {
this.isAdvanceTypeShow = true;
this.subData = {advanceType: data.advanceType.toString(), spUse: false, parentCode: data.code};
}
}
this.subFormVisible = true;
this.getSubThrsysDetailData();
if (this.subData.parentCode != null && this.subData.parentCode != "") {
filterSubAll(this.query)
.then((response) => {
let invList = response.data || [];
this.invOptions = this.handleTree(invList, "code", "parentCode");
})
.catch(() => {
});
}
filterSubAll(this.query)
.then((response) => {
let invList = response.data || [];
//
if (invList.length > 0) {
for (let i = 0; i < invList.length; i++) {
if (invList[i].code === this.subData.code) {
invList.splice(i, 1);
break;
}
}
}
this.invOptions = this.handleTree(invList, "code", "parentCode");
})
.catch(() => {
});
this.sysSubList = null;
},
hideForm() { // ---
this.query.advanceType = null;
this.formVisible = false;
this.subFormVisible = false;
this.resetForm();
return true;
},
//
resetForm() {
if (this.$refs["dataForm"]) {
//
this.$refs["dataForm"].clearValidate();
//
this.$refs["dataForm"].resetFields();
this.getList();
}
},
forInvSubmit() { // ---
this.$refs["dataForm"].validate(valid => {
if (valid) {
this.submitLoading = true
saveSubWarehouse(this.subData, this.formName).then((response) => {
this.submitLoading = false
this.subFormVisible = false;
if (response.code == 20000) {
this.getList();
} else {
this.$message.error(response.message);
}
}).catch(() => {
this.submitLoading = false
this.subFormVisible = false;
});
}
});
},
findDeptMethod() { //---
let query = {
status: 1,
};
filterList(query)
.then((response) => {
this.loading = false;
this.fromDeptOptions = response.data.list || [];
})
.catch(() => {
this.loading = false;
this.fromDeptOptions = [];
});
},
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id: node.code,
label: node.name,
children: node.children
};
},
getSyncConfig() {//
findConfig()
.then((response) => {
if (response.code == 20000) {
this.configParms = response.data;
}
})
.catch(() => {
});
let query = {
paramKey: "muti_inv_mode",
};
selectSysParamByKey(query).then((response) => {
if (response.code == 20000) {
if (response.data.paramValue == "1") {
this.mutiInvMode = true;
} else {
this.mutiInvMode = false;
}
}
});
},
handSubInvCurrentChange(row) { //
this.currentRow = row;
this.curSeleUser = null;
},
//
intentSubSelect(row) {
if (row != null) {
if (row.sysId != null && row.sysId != undefined) {
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("第三方分库库数据加载失败");
});
},
changeSubThrWarehouse(row) {
this.checkSubThrWarehouseRow = row;
},
hideThrWarehouseTable() {
this.thrWareHouseVisible = false;
this.thrSubWareHouseVisible = false;
//
this.thirdSubQuery.name = "";
this.checkSubThrWarehouseRow.code = null;
this.checkSubThrWarehouseRow.thirdSysFk = null;
},
//
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) {
this.$confirm("确定解绑已关联第三方仓库信息?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
let params = {
id: this.subData.id,
sysId: row.sysId
};
unbindSubThrWarehouse(params).then((res) => {
this.$message.success("解绑成功");
this.getSubThrsysDetailData();
}).catch((error) => {
this.$message.error("解绑失败");
})
})
.catch(() => {
});
},
popInvRelBustype(row) {
this.relBusTypeVisible = true;
this.currentRow = row;
},
cancelRelBustype() {
this.relBusTypeVisible = false;
},
popInvRelUser(row) {
this.relUserVisible = true;
this.currentRow = row;
},
cancelRelUser() {
this.relUserVisible = false;
},
getBussinessType(val, obj) {
if (val != null) {
this.bussinessTypeQuery.page = val;
}
if (obj != undefined) {
var action = obj.toString();
this.bussinessTypeQuery.ids = action;
}
this.bussinessTypeQuery.code = this.busQuery.code;
getJoinBussinessType(this.bussinessTypeQuery).then((res) => {
this.selectBussinessTypeList = [];
this.bussinessTypeList = res.data.list;
this.bussinessTypeTotal = res.data.total;
var that = this;
that.$nextTick(() => {
if (that.$refs.typeList) {
that.$refs.typeList.clearSelection();
}
that.bussinessTypeList.forEach(row => {
if (row.checkSelect == true) {
that.$refs.typeList.toggleRowSelection(row, true);
}
});
});
}).catch((error) => {
});
},
invSpaceManage(row) {
this.currentInvInfo = {
invStorageCode: row.parentId,
invWarehouseCode: row.code,
invName: row.name,
flag: row.id,
page: 1
};
},
getSubThrsysDetailData() {
if (!isBlank(this.subData.code)) {
let params = {
id: this.subData.code,
};
getSubThrsysDetail(params)
.then((response) => {
this.loading = false;
this.sysSubList = response.data.list || [];
})
.catch(() => {
this.loading = false;
this.sysSubList = [];
});
}
},
handleDelInv(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.getList();
this.$message.success("删除成功");
})
.catch(() => {
this.deleteLoading = false;
});
})
.catch(() => {
this.$message.info("取消删除");
});
}
},
},
filters: {
spUerFilterType(status) {
const upUerMap = {
true: "success",
false: "danger",
};
return upUerMap[status];
},
spUerFilterName(status) {
const upUerMap = {
true: "允许",
false: "不允许",
};
return upUerMap[status];
},
},
mounted() {
},
components: {
InvRelDevice,
InvRelBusType,
invSpaceManage, Treeselect
},
created() {
this.getList();
this.getSyncConfig();
this.findDeptMethod();
}
};
</script>
<style scoped>
.vue-treeselect >>> .vue-treeselect__placeholder {
font-size: 12px;
}
.vue-treeselect >>> .vue-treeselect__value-container {
font-size: 12px;
height: 30px;
}
.vue-treeselect >>> .vue-treeselect__control {
height: 20px;
}
</style>
Loading…
Cancel
Save