feat: 优化

dev_ksck2.0
chenhc 11 months ago
parent 329a1a324e
commit 2ca04c2165

@ -97,3 +97,13 @@ export function printDevLabel(query) {
}
export function updateOrderItem(data) {
return axios(
{
url: "/udi/device/info/update",
method: "POST",
data: data
}
)
}

@ -1,181 +1,17 @@
<template>
<div>
<!-- <el-card class="el-card">-->
<!-- <el-form :model="filterQuery" class="query-form" size="mini" label-width="100px" v-if="showSearch">-->
<!-- <el-row>-->
<!-- <el-col :span="18">-->
<!-- <el-form-item class="query-form-item" label="扫码查询:">-->
<!-- <el-input v-model="filterQuery.udiCode"-->
<!-- style="width: 97%"-->
<!-- placeholder="请扫描或输入UDI码"-->
<!-- clearable="true"-->
<!-- @keyup.enter.native="keyup_submit($event)"></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <el-row>-->
<!-- <el-col :span="8">-->
<!-- <el-form-item class="query-form-item" label="登记部门:">-->
<!-- <el-select v-model="filterQuery.deptCode" placeholder="请选择登记部门" clearable="true"-->
<!-- @change="deptChange"-->
<!-- style="width: 90%"-->
<!-- >-->
<!-- <el-option-->
<!-- v-for="item in deptList"-->
<!-- :key="item.name"-->
<!-- :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="8">-->
<!-- <el-form-item class="query-form-item" label="负责人:">-->
<!-- <el-input v-model="filterQuery.manager" placeholder="请输入负责人" style="width: 90%"-->
<!-- clearable></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="8">-->
<!-- <el-form-item class="query-form-item" label="设备状态:">-->
<!-- <el-select v-model="filterQuery.status"-->
<!-- style="width: 90%"-->
<!-- placeholder="请选择设备状态"-->
<!-- clearable-->
<!-- >-->
<!-- <el-option-->
<!-- v-for="item in statusMap"-->
<!-- :key="item.value"-->
<!-- :value="item.value"-->
<!-- :label="item.label"-->
<!-- >-->
<!-- {{ item.label }}-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <el-row>-->
<!-- <el-col :span="8">-->
<!-- <el-form-item class="query-form-item" label="DI/物资编码:">-->
<!-- <el-input v-model="filterQuery.nameCode" placeholder="请输入DI/物资编码" style="width: 90%"-->
<!-- clearable></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="8">-->
<!-- <el-form-item class="query-form-item" label="设备名称:">-->
<!-- <el-input v-model="filterQuery.deviceName" placeholder="请输入设备名称" style="width: 90%"-->
<!-- clearable></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="8">-->
<!-- <el-form-item class="query-form-item" label="规格型号:">-->
<!-- <el-input v-model="filterQuery.ggxh" placeholder="请输入规格型号" style="width: 90%"-->
<!-- clearable></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <el-row>-->
<!-- <el-col :span="8">-->
<!-- <el-form-item class="query-form-item" label="生产企业:">-->
<!-- <el-input v-model="filterQuery.manufactory" placeholder="请输入生产企业" style="width: 90%"-->
<!-- clearable></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="8">-->
<!-- <el-form-item class="query-form-item" label="注册/备案号:">-->
<!-- <el-input v-model="filterQuery.zczbhhzbapzbh" placeholder="请输入注册/备案号" style="width: 90%"-->
<!-- clearable></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="8">-->
<!-- <el-form-item class="query-form-item" label="供应商:">-->
<!-- <el-input v-model="filterQuery.supName" placeholder="请输入供应商" style="width: 90%"-->
<!-- clearable></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <el-row>-->
<!-- <el-col :span="8">-->
<!-- <el-form-item class="query-form-item" label="资产编码:">-->
<!-- <el-input v-model="filterQuery.code" placeholder="请输入资产编码" style="width: 90%" clearable></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="8">-->
<!-- <el-form-item class="query-form-item" label="批次号:">-->
<!-- <el-input v-model="filterQuery.batchNo" placeholder="请输入批次号" style="width: 90%"-->
<!-- clearable></el-input>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- </el-form>-->
<!-- <div class="top-right-btn">-->
<!-- <el-button-group>-->
<!-- <el-button icon="el-icon-view" type="primary" @click="hideSearch">/</el-button>-->
<!-- <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>-->
<!-- </div>-->
<!-- <el-divider style="margin: 15px"></el-divider>-->
<!-- <el-table v-loading="loading" :data="list" style="width: 100%" highlight-current-row-->
<!-- @row-click="listClick"-->
<!-- border>-->
<!-- <el-table-column label="序号" type="index"></el-table-column>-->
<!-- <el-table-column label="登记部门" prop="deptName" width="180"></el-table-column>-->
<!-- <el-table-column label="负责人" prop="managerName" show-overflow-tooltip width="200"></el-table-column>-->
<!-- <el-table-column label="设备名称" prop="deviceName" width="200"></el-table-column>-->
<!-- <el-table-column label="规格型号" prop="ggxh" width="200" show-overflow-tooltip></el-table-column>-->
<!-- <el-table-column label="物资编码" prop="code" width="180"></el-table-column>-->
<!-- <el-table-column label="DI/物资编码" prop="nameCode" width="200" show-overflow-tooltip></el-table-column>-->
<!-- <el-table-column label="批次号" prop="batchNo" width="150"></el-table-column>-->
<!-- <el-table-column label="生产日期" prop="productionDate" width="150"></el-table-column>-->
<!-- <el-table-column label="失效日期" prop="expireDate" width="120"></el-table-column>-->
<!-- <el-table-column label="设备状态" prop="status" width="150">-->
<!-- <template slot-scope="scope">-->
<!-- <el-tag>{{ status[scope.row.status] }}</el-tag>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="生产企业" prop="manufactory" show-overflow-tooltip width="200"></el-table-column>-->
<!-- <el-table-column label="注册/备案号" prop="zczbhhzbapzbh" width="300"></el-table-column>-->
<!-- <el-table-column label="供应商" prop="supName" width="300"></el-table-column>-->
<!-- <el-table-column label="操作" width="120" fixed="right">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button type="text" size="small" @click.native.stop="editOrder(scope.row)">编辑</el-button>-->
<!-- <el-button type="text" size="small" @click.native.stop="printOrder(scope.row)">标签打印</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- </el-table>-->
<!-- <pagination-->
<!-- v-show="total>0"-->
<!-- :total="total"-->
<!-- :limit.sync="filterQuery.limit"-->
<!-- :page.sync="filterQuery.page"-->
<!-- @pagination="getList"-->
<!-- ></pagination>-->
<!-- </el-card>-->
<el-tabs type="border-card" style="margin: 15px">
<el-tab-pane label="基本信息">
<deviceModifyDialog
:rowData="this.rowData"
<deviceModifyDialog v-if="viewCheckVisible "
:rowData.sync="this.rowData"
:editSaveDev="editSaveDev"
:maintainsList = "this.maintainsList"
>
</deviceModifyDialog>
</el-tab-pane>
<el-tab-pane label="财务信息">
<deviceFinanceModifyDialog
<deviceFinanceModifyDialog v-if="viewCheckVisible "
:rowData="this.rowData"
:editSaveDev="editSaveDev"
:maintainsList = "this.maintainsList"
@ -183,7 +19,7 @@
</deviceFinanceModifyDialog>
</el-tab-pane>
<el-tab-pane label="附属信息">
<deviceSubModifyDialog
<deviceSubModifyDialog v-if="viewCheckVisible "
:rowData="this.rowData"
:editSaveDev="editSaveDev"
:maintainsList = "this.maintainsList"
@ -191,39 +27,39 @@
</deviceSubModifyDialog>
</el-tab-pane>
<el-tab-pane label="设备资质">
<checkResultPanel
<checkResultPanel v-if="viewCheckVisible "
:idQuery="filterQuery"
:rowData="this.rowData"
></checkResultPanel>
</el-tab-pane>
<el-tab-pane label="技术资料">
<technical
<el-tab-pane label="技术资料" >
<technical v-if="viewCheckVisible "
:idQuery="filterQuery"
:rowData="this.rowData"
></technical>
</el-tab-pane>
<el-tab-pane label="相关人员">
<invDeviceUserEditDialog
<el-tab-pane label="相关人员" >
<invDeviceUserEditDialog v-if="viewCheckVisible "
:idQuery="filterQuery"
:rowData="this.rowData">
</invDeviceUserEditDialog>
</el-tab-pane>
<el-tab-pane label="维修记录" v-if="this.visible">
<invDeviceInspectEditDialog
<el-tab-pane label="维修记录" v-if="this.visible " >
<invDeviceInspectEditDialog v-if="viewCheckVisible "
:idQuery="filterQuery"
:rowData="this.rowData">
</invDeviceInspectEditDialog>
</el-tab-pane>
<el-tab-pane label="巡检记录" v-if="this.visible">
<invDeviceCheckEditDialog
<el-tab-pane label="巡检记录" v-if="this.visible" >
<invDeviceCheckEditDialog v-if="viewCheckVisible "
:idQuery="filterQuery"
:rowData="this.rowData">
</invDeviceCheckEditDialog>
</el-tab-pane>
<el-tab-pane label="使用记录" v-if="this.visible">
<invDeviceUsageEditDialog
<el-tab-pane label="使用记录" v-if="this.visible" >
<invDeviceUsageEditDialog v-if="viewCheckVisible "
:idQuery="filterQuery"
:rowData="this.rowData">
</invDeviceUsageEditDialog>
@ -312,6 +148,7 @@ export default {
data() {
return {
selectedRowData: {},
viewCheckVisible: false,
filterQuery: {
deptCode: this.$store.getters.locDeptCode,
deviceName: null,
@ -392,7 +229,14 @@ export default {
deviceCode: null
};
},
beforeDestroy() {
//
this.$parent.$off('refresh', this.refreshComponentData);
},
methods: {
refreshComponentData() {
this.rowData = this.rowData
},
getBasicUnitMaintainsList() {
getCorpList()
.then((response) => {
@ -439,23 +283,23 @@ export default {
this.getList();
},
getList() {
this.loading = true;
getDeptDeviceList(this.filterQuery).then((res) => {
this.loading = false;
if (res.code === 20000) {
this.list = res.data.list || [];
this.total = res.data.total || 0;
} else {
this.$message.error(res.message);
this.list = [];
this.total = 0;
}
}).catch((error) => {
this.loading = false;
this.$message.error(error.message);
this.list = [];
this.total = 0;
})
// this.loading = true;
// getDeptDeviceList(this.filterQuery).then((res) => {
// this.loading = false;
// if (res.code === 20000) {
// this.list = res.data.list || [];
// this.total = res.data.total || 0;
// } else {
// this.$message.error(res.message);
// this.list = [];
// this.total = 0;
// }
// }).catch((error) => {
// this.loading = false;
// this.$message.error(error.message);
// this.list = [];
// this.total = 0;
// })
},
deptChange() {
this.filterQuery.invCode = null;
@ -620,7 +464,21 @@ export default {
this.filterQuery.devCodeFk = this.rowData.deviceCode
this.getDeptList();
this.getBasicUnitMaintainsList();
this.viewCheckVisible = true
},
watch: {
rowData: {
handler: function(newVal) {
this.rowData = newVal;
this.viewCheckVisible = false
this.$nextTick(() => {
//
this.viewCheckVisible = true
});
},
deep: true
}
}
};
</script>

@ -51,74 +51,7 @@
</div>
<el-divider style="margin: 15px"></el-divider>
<el-table :data="list" @row-click="rowClick" v-loading="loading" click-row-light>
<el-table-column label="序号" width="50" type="index"/>
<el-table-column label="科室" width="150" prop="deptName"/>
<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="120" 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="巡检锁定" width="120">
<template slot-scope="scope">
<el-tag :type="scope.row.checkLock?'primark':'info'">{{ scope.row.checkLock ? '是' : '否' }}</el-tag>
</template>
</el-table-column>
<el-table-column label="数量" width="120" prop="count"/>
<el-table-column label="计量单位" width="100" prop="measname"/>
<el-table-column label="生产企业" width="180" prop="manufactory"/>
<!-- <el-table-column label="批次号" width="100" prop="batchNo"/>-->
<!-- <el-table-column label="序列号" width="100" prop="serialNo"/>-->
<!-- <el-table-column label="生产日期" width="140" prop="productionDate"/>-->
<!-- <el-table-column label="过期时间" width="140" prop="expireDate"/>-->
<!-- <el-table-column label="供应商" width="100" prop="supName"/>-->
<!-- <el-table-column label="udi码" width="150" prop="udi"/>-->
<!-- <el-table-column label="注册/备案号" width="150" prop="zczbhhzbapzbh"/>-->
<!-- <el-table-column label="操作" width="120" fixed="right">-->
<!-- <template scope="scope">-->
<!-- <el-button type="text"-->
<!-- >详情-->
<!-- </el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="query.page"
:limit.sync="query.limit"
@pagination="getList"
/>
</el-card>
<el-card>
<div slot="header" class="clearfix">
<div class="fl">
{{
`设备详情 ${clickRow ? '——' + clickRow.productName + '(' + clickRow.ggxh + ')' : ''}`
}}
</div>
<div class="fr">
<el-button @click="getDetailList"></el-button>
</div>
</div>
<el-form v-if="clickRow" :model="detailQuery" inline label-width="auto">
<el-row :gutter="20">
<el-col>
<el-form-item label="设备编码">
<el-input v-model.trim="detailQuery.deviceCode" clearable/>
</el-form-item>
<el-button type="primary" icon="el-icon-search" @click="getDetailList"
>查询
</el-button>
</el-col>
</el-row>
</el-form>
<el-table :data="detailList" v-loading="detailLoading" >
<el-table :data="list" @current-change="rowClickDetail" v-loading="loading" click-row-light>
<el-table-column label="序号" width="50" type="index"/>
<el-table-column label="科室" width="150" prop="deptName"/>
<el-table-column label="设备编码" width="150" prop="deviceCode"/>
@ -149,11 +82,12 @@
<el-table-column label="注册/备案号" width="150" prop="zczbhhzbapzbh"/>
<el-table-column label="操作" :width="200" fixed="right">
<template slot-scope="scope">
<el-button class="mr10" type="text" @click="rowClickDetail(scope.row)"
>详情
</el-button><el-button class="mr10" type="text" @click="getDeviceLogs(scope.row)"
>变更日志
</el-button>
<!-- <el-button class="mr10" type="text" @click="rowClickDetail(scope.row)"-->
<!-- >详情-->
<!-- </el-button>-->
<el-button class="mr10" type="text" @click="getDeviceLogs(scope.row)"
>变更日志
</el-button>
<el-popover class="mr10"
placement="left"
width="300"
@ -175,31 +109,24 @@
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="detailTotal>0"
:total="detailTotal"
:page.sync="detailQuery.page"
:limit.sync="detailQuery.limit"
@pagination="getDetailList"
v-show="total>0"
:total="total"
:page.sync="query.page"
:limit.sync="query.limit"
@pagination="getList"
/>
</el-card>
<el-dialog
width="65%"
title="设备信息-详情"
:visible="true"
v-if="deviceInfoFlag"
@close="deviceInfoFlag = false"
>
<deptDeviceDetail
<deptDeviceDetail v-if="deviceInfoFlag"
:rowData="this.curDevRow"
:editSaveDev="editSaveDev"
:visible="true"
:visible="false"
@refresh="rowClickDetail"
>
</deptDeviceDetail>
</el-dialog>
<el-dialog
:title="`设备变更日志——${productRow.productName}(${productRow.deviceCode})`"

@ -0,0 +1,167 @@
<template>
<div>
<el-card>
<el-form :model="query" v-if="showSearch" label-width="auto">
<el-row :gutter="20">
<!-- <el-col :span="6">-->
<!-- <el-form-item label="所属科室" >-->
<!-- <deptSelect :value.sync="query.deptCode" />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="6">
<el-form-item label="设备编码">
<el-input v-model="query.deviceCode" clearable/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="设备名称">
<el-input v-model="query.productName" clearable/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="设备状态">
<el-select v-model="query.status"
style="width: 100%"
clearable>
<el-option
v-for="item in deviceStatus"
:key="item.key"
:label="item.desc"
:value="item.key">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="top-right-btn">
<el-button-group>
<el-button icon="el-icon-view" type="primary" @click="showSearch = !showSearch">显示/隐藏搜索栏</el-button>
<el-button
type="primary"
icon="el-icon-refresh"
@click="onReset"
>重置
</el-button>
<el-button type="primary" icon="el-icon-search" @click="search"
>查询
</el-button>
</el-button-group>
</div>
<el-divider style="margin: 15px"></el-divider>
<el-table :data="list" @current-change="rowClickDetail" v-loading="loading" click-row-light>
<el-table-column label="序号" width="50" type="index"/>
<el-table-column label="科室" width="150" prop="deptName"/>
<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="120" 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="巡检锁定" width="120">
<template slot-scope="scope">
<el-tag :type="scope.row.checkLock?'primark':'info'">{{ scope.row.checkLock ? '是' : '否' }}</el-tag>
</template>
</el-table-column>
<el-table-column label="变更次数" width="100" prop="changeCount"/>
<el-table-column label="维修次数" width="100" prop="repairCount"/>
<el-table-column label="巡检次数" width="100" prop="checkCount"/>
<el-table-column label="计量单位" width="100" prop="measname"/>
<el-table-column label="生产企业" width="180" prop="manufactory"/>
<el-table-column label="批次号" width="100" prop="batchNo"/>
<el-table-column label="序列号" width="100" prop="serialNo"/>
<el-table-column label="生产日期" width="140" prop="productionDate"/>
<el-table-column label="过期时间" width="140" prop="expireDate"/>
<el-table-column label="供应商" width="100" prop="supName"/>
<el-table-column label="udi码" width="150" prop="udi"/>
<el-table-column label="注册/备案号" width="150" prop="zczbhhzbapzbh"/>
<el-table-column label="操作" :width="200" fixed="right">
<template slot-scope="scope">
<!-- <el-button class="mr10" type="text" @click="rowClickDetail(scope.row)"-->
<!-- >详情-->
<!-- </el-button>-->
<el-button class="mr10" type="text" @click="getDeviceLogs(scope.row)"
>变更日志
</el-button>
<el-popover class="mr10"
placement="left"
width="300"
trigger="click">
<div v-if="scope.row.QR" align="center">
<el-image :src="scope.row.QR" style="display: block"/>
<el-button style="display: block"
@click="downloadBase64Image(scope.row.QR,`${scope.row.deviceCode}——${scope.row.productName}——${scope.row.ggxh}`)">
下载
</el-button>
</div>
<el-button slot="reference" type="text" @click="genQR(scope.row)"
>设备码
</el-button>
</el-popover>
<el-button v-if="isChoose&&scope.row.status==deviceStatus.NORMAL.key" type="text"
@click="chooseFunc(scope.row)"
>选择
</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="query.page"
:limit.sync="query.limit"
@pagination="getList"
/>
</el-card>
<deptDeviceDetail v-if="deviceInfoFlag"
:rowData="this.curDevRow"
:editSaveDev="editSaveDev"
:visible="false"
@refresh="rowClickDetail"
>
</deptDeviceDetail>
<el-dialog
:title="`设备变更日志——${productRow.productName}(${productRow.deviceCode})`"
:visible="true"
v-if="showLog"
@close="showLog = false"
>
<el-timeline>
<el-timeline-item placement="top"
v-for="(item, index) in logList"
:key="index"
size="large"
icon="el-icon-s-promotion"
:type="deviceChangeType[item.type].tagType"
:timestamp="item.createTime">
<el-card style="margin-left: 0px">
<div slot="header">
<div style="font-size: 24px">
{{ item.typeName }}
</div>
</div>
<el-descriptions>
<el-descriptions-item label="操作部门">{{ item.deptName }}</el-descriptions-item>
<el-descriptions-item label="操作人">{{ item.createUserName }}</el-descriptions-item>
<el-descriptions-item label="变更单号">{{ item.changeOrderId }}</el-descriptions-item>
<el-descriptions-item label="目标部门">{{ item.toDeptName }}</el-descriptions-item>
<el-descriptions-item label="确认人">{{ item.confirmUserName }}</el-descriptions-item>
<el-descriptions-item label="确认时间">{{ item.confirmTime }}</el-descriptions-item>
</el-descriptions>
</el-card>
</el-timeline-item>
</el-timeline>
</el-dialog>
</div>
</template>
<script src="./js/deviceInfoFull.js"/>

@ -1,8 +1,8 @@
import {deviceAllPage, deviceLogs, detailPage, genDeviceQR} from "@/api/dev/deviceInfoApi";
import {deviceAllPage, deviceLogs, detailPage, genDeviceQR,detailByDeptCodePage} from "@/api/dev/deviceInfoApi";
import {deviceChangeStatus, deviceChangeType, deviceStatus} from "@/utils/enum";
import {downloadBase64Image} from "@/utils";
import deptDeviceDetail from "@/views/dev/DeptDeviceDetail.vue";
import {updateOrderItem } from "@/api/dev/deviceInfoApi";//保存到info
let query = {
page: 1,
limit: 10,
@ -57,14 +57,24 @@ export default {
},
created() {
this.locDeptCode = this.$store.getters.locDeptCode
this.query.deptCode = this.$store.getters.locDeptCode
this.getList()
},
methods: {
//设备编辑保存
editSaveDev(row) {
this.curDevRow = row;
this.deviceInfoFlag = false;
// this.curDevRow = row;
// console.log(this.curDevRow)
updateOrderItem(this.curDevRow).then(res => {
if (res.code != 20000) {
this.$message.error(res.message)
return
}
this.getList()
this.$message.success(res.message)
})
// this.deviceInfoFlag = false;
},
downloadBase64Image,
genQR(row) {
@ -97,9 +107,10 @@ export default {
this.getDetailList()
},
rowClickDetail(row){
this.deviceInfoFlag = false
this.curDevRow = row;
this.curDevRow.status = null;
this.deviceInfoFlag = true;
this.$emit('refresh');
this.deviceInfoFlag = true
},
getDetailList() {
this.detailLoading = true
@ -121,11 +132,17 @@ export default {
},
onReset() {
this.query = {...query}
this.query.deptCode = this.$store.getters.locDeptCode
this.getList()
},
getList() {
this.loading = true
deviceAllPage(this.query).then(res => {
if (this.query.deptCode == null){
this.$message.warning("请选择所属科室!")
this.loading = false
return
}
detailByDeptCodePage(this.query).then(res => {
this.loading = false
if (res.code != 20000) {
this.$message.error(res.message)

@ -0,0 +1,163 @@
import {deviceAllPage, deviceLogs, detailPage, genDeviceQR,detailByDeptCodePage} from "@/api/dev/deviceInfoApi";
import {deviceChangeStatus, deviceChangeType, deviceStatus} from "@/utils/enum";
import {downloadBase64Image} from "@/utils";
import deptDeviceDetail from "@/views/dev/DeptDeviceDetail.vue";
import {updateOrderItem } from "@/api/dev/deviceInfoApi";
let query = {
page: 1,
limit: 10,
productName: null,
deviceCode: null,
deptCode: null,
status: null,
}
let detailQuery = {
page: 1,
limit: 10,
deviceCode:null,
deptCode: null,
productId: null,
}
export default {
name: "deviceInfo",
computed: {
deviceChangeType() {
return deviceChangeType
},
deviceStatus() {
return deviceStatus
},
deviceChangeStatus() {
return deviceChangeStatus
}
},
props: {isChoose: {required: false, default: false, type: Boolean}, chooseFunc: {required: false, type: Function}},
data() {
return {
deviceInfoFlag: false,
locDeptCode: null,
clickRow: null,
showSearch: true,
loading: false,
total: .0,
list: [],
query: {...query},
//设备详情=============================================
detailLoading: false,
detailQuery: {...detailQuery},
detailList: [],
detailTotal: 0,
showLog: false,
productRow: null,
//===================================================
logList: [],
}
},
created() {
this.locDeptCode = this.$store.getters.locDeptCode
this.query.deptCode = this.$store.getters.locDeptCode
this.getList()
},
methods: {
//设备编辑保存
editSaveDev(row) {
// this.curDevRow = row;
// console.log(this.curDevRow)
updateOrderItem(this.curDevRow).then(res => {
if (res.code != 20000) {
this.$message.error(res.message)
return
}
this.getList()
this.$message.success(res.message)
})
// this.deviceInfoFlag = false;
},
downloadBase64Image,
genQR(row) {
genDeviceQR(row.deviceCode).then(res => {
if (res.code != 20000) {
this.$message.error(res.message)
return
}
this.$set(row, 'QR', res.data)
})
},
getDeviceLogs(row) {
this.productRow = row
deviceLogs(row.deviceCode).then(res => {
if (res.code != 20000) {
this.$message.error(res.message)
return
}
this.logList = res.data || []
this.showLog = true
}).catch(e => {
})
},
rowClick(row) {
if (this.clickRow && row.deptCode == this.clickRow.deptCode && row.productId == this.clickRow.productId && row.status == this.clickRow.status && row.checkLock == this.clickRow.checkLock) {
return false
}
this.clickRow = row
this.detailQuery = {...detailQuery, deptCode: row.deptCode, productId: row.productId, status: row.status,checkLock:row.checkLock}
this.getDetailList()
},
rowClickDetail(row){
this.deviceInfoFlag = false
this.curDevRow = row;
this.$emit('refresh');
this.deviceInfoFlag = true
},
getDetailList() {
this.detailLoading = true
detailPage(this.detailQuery).then(res => {
this.detailLoading = false
if (res.code != 20000) {
this.$message.error(res.message)
return
}
this.detailList = res.data.list || []
this.detailTotal = res.data.total || 0
}).catch(e => {
this.detailLoading = false
})
},
search() {
this.query.page = 1
this.getList()
},
onReset() {
this.query = {...query}
this.query.deptCode = this.$store.getters.locDeptCode
this.getList()
},
getList() {
this.loading = true
if (this.query.deptCode == null){
this.$message.warning("请选择所属科室!")
this.loading = false
return
}
detailByDeptCodePage(this.query).then(res => {
this.loading = false
if (res.code != 20000) {
this.$message.error(res.message)
return
}
this.list = res.data.list || []
this.total = res.data.total || 0
}).catch(e => {
this.loading = false
})
}
},
components:{
deptDeviceDetail
}
}
Loading…
Cancel
Save