5/14 --保养计划

演示数据2.0
wangwei 11 months ago
parent b9b77e1a1c
commit 088e9aba7b

@ -0,0 +1,49 @@
import axios from "@/utils/request";
export function deviceCheckGenByPlanId(planId) {
return axios(
{
url: `/udi/device/upkeep/gen/${planId}`,
method: "GET"
}
)
}
export function deviceUpkeepPage(query) {
return axios(
{
url: `/udi/device/upkeep/page`,
method: "POST",
data: query
}
)
}
export function deviceCheckPageByDept(query) {
return axios(
{
url: `/udi/device/check/pageByDept`,
method: "POST",
data: query
}
)
}
export function deviceCheckPrint(taskId) {
return axios(
{
url: `/udi/device/check/info/print/${taskId}`,
method: "GET"
}
)
}
export function deviceCheckPrintByDeviceCode(taskId, deviceCode) {
return axios(
{
url: `/udi/device/check/info/print/${taskId}/${deviceCode}`,
method: "GET"
}
)
}

@ -0,0 +1,30 @@
import axios from "@/utils/request";
export function deviceUpkeepDetailPage(query) {
return axios(
{
url: `/udi/device/upkeep/detail/page`,
method: "POST",
data: query
}
)
}
// export function deviceCheckDetailRepair(query) {
// return axios(
// {
// url: `/udi/device/check/detail/repair`,
// method: "POST",
// data: query
// }
// )
// }
//
// export function deviceCheckDetailFinish(query) {
// return axios(
// {
// url: `/udi/device/check/detail/finish`,
// method: "POST",
// data: query
// }
// )
// }

@ -0,0 +1,40 @@
import axios from "@/utils/request";
export function deviceUpkeepPlanPage(query) {
return axios(
{
url: "/udi/device/plan/page",
method: "POST",
data: query
}
)
}
export function deviceUpkeepPlanSave(query) {
return axios(
{
url: "/udi/device/plan/save",
method: "POST",
data: query
}
)
}
export function devicePlanInfo(planId) {
return axios(
{
url: `/udi/device/plan/info/${planId}`,
method: "GET"
}
)
}
export function deviceUpkeepPlanDel(planId) {
return axios(
{
url: `/udi/device/plan/del/${planId}`,
method: "DELETE"
}
)
}

@ -88,6 +88,10 @@ export default {
type: Object,
required: true
},
pullData: {
type: Object,
required: true
},
},
data() {
return {
@ -117,7 +121,8 @@ export default {
let param = {
planId: this.planId,
deviceCodes: deviceCodes,
devicePlanParam: this.planData
devicePlanParam: this.planData,
type:this.pullData.type
}
devicePlanDetailAdd(param).then(res => {
if (res.code != 20000) {

@ -44,6 +44,12 @@
<el-table-column label="项目编码" width="150" prop="code"/>
<el-table-column label="项目名称" width="200" prop="name"/>
<el-table-column label="项目内容" width="500" prop="content"/>
<el-table-column label="项目类型" width="120" prop="type">
<template slot-scope="scope">
<div v-if="scope.row.type == 1"></div>
<div v-if="scope.row.type == 2"></div>
</template>
</el-table-column>
<el-table-column label="创建人" width="120" prop="createUserName"/>
<el-table-column label="创建时间" width="140" prop="createTime"/>
<el-table-column label="操作" v-if="!isChoose" fixed="right" width="80">

@ -148,6 +148,7 @@
<DevicePlanProject style="margin: 0"
:planId="detailQuery.planId"
:projectItem="projectItem"
:pullData="planData"
:closeAddDevice="closeAddDevice"/>
</el-dialog>
@ -212,6 +213,7 @@ let planData = {
frequency: 1,
dateInterval: null,
remark: null,
type:1,
}
export default {
@ -620,7 +622,9 @@ export default {
this.planData = row;
} else {
this.planEditTitle = "新增计划";
this.planData = {};
this.planData = {
type:1
};
}
this.createFlag = true;
@ -680,6 +684,9 @@ export default {
})
},
setProject(row) {
this.planData = {
type:1
};
this.projectVisible = true
this.projectItem = row
},

@ -73,7 +73,10 @@
<div slot="header" class="clearfix">
<div class="fr">
<el-button type="primary" @click="addDevice()"></el-button>
<el-button type="primary" @click="batchSetProject()"></el-button>
<el-button type="primary" @click="batchSetProject()">
<div v-if="this.originData.type == 2"></div>
<div v-else></div>
</el-button>
<el-button type="" @click="getDetailList"></el-button>
</div>
</div>
@ -91,7 +94,9 @@
<el-table-column label="操作" width="120">
<template slot-scope="scope">
<el-button type="text" @click="setProject(scope.row)"
>巡检项目
>
<div v-if="originData.type == 2"></div>
<div v-else></div>
</el-button>
<el-button type="text" @click="delProject(scope.row)"
>移除
@ -118,11 +123,12 @@
<DeviceAdd style="margin: 0"
:planId="detailQuery.planId"
:planData="planData"
:pullData="originData"
:closeAddDevice="closeAddDevice"/>
</el-dialog>
<el-dialog
title="编辑巡检项目"
:title="formMap1[formName1]"
:visible="true"
v-if="projectVisible"
@close="projectVisible = false"
@ -131,12 +137,13 @@
<DevicePlanProject style="margin: 0"
:planId="detailQuery.planId"
:projectItem="projectItem"
:pullData="originData"
:closeAddDevice="closeAddDevice"/>
</el-dialog>
<el-dialog
title="批量设置巡检项目"
:title="formMap[formName]"
:visible="true"
v-if="chooseDetailItemFlag"
@close="chooseDetailItemFlag = false"
@ -145,6 +152,7 @@
<deviceProjectAdd style="margin: 0"
:planId="planData.planId"
:type="2"
:pullData="originData"
:closeAddDevice="closeBatchSetProject"/>
</el-dialog>
@ -162,6 +170,7 @@ import DeviceAdd from "@/views/dev/deviceAdd";
import {devicePlanDetailItemAdd} from "@/api/dev/devicePlanDetailItemApi";
import DevicePlanProject from "@/views/dev/devicePlanProject";
import {devicePlanSave} from "@/api/dev/devicePlanApi";
import {deviceUpkeepPlanSave} from "@/api/dev/deviceUpkeepPlanApi";
import deviceProjectAdd from "@/views/dev/deviceProjectAdd";
export default {
@ -187,9 +196,21 @@ export default {
trigger: ["change", "blur"]
}],
},
formName:2,
formMap: {
1: "批量设置巡检项目",
2: "批量设置保养项目"
},
formName1:2,
formMap1: {
1: "添加巡检项目",
2: "添加保养项目"
},
detailList: [],
detailTotal: 0,
detailQuery: {},
detailQuery: {
type : this.originData.type
},
detailLoading: false,
chooseDeviceList: [],
chooseDeviceFlag: false,
@ -269,6 +290,12 @@ export default {
addDevice() {
this.$refs["dataForm"].validate(valid => {
if (valid) {
if(this.originData.type === 1) {
this.formName = 1
this.originData = {
type:1
}
}
this.chooseDeviceFlag = true
}
});
@ -281,7 +308,13 @@ export default {
},
batchSetProject() {
this.chooseDetailItemFlag = true;
if(this.originData.type === 1) {
this.formName = 1
this.originData = {
type:1
}
this.chooseDetailItemFlag = true;
}
},
closeBatchSetProject() {
this.chooseDetailItemFlag = false;
@ -289,6 +322,12 @@ export default {
setProject(row) {
if (this.originData.type === 1){
this.formName1 = 1
this.originData = {
type:1
}
}
this.projectVisible = true
this.projectItem = row
},
@ -316,15 +355,29 @@ export default {
saveOrder(status) {
this.planData.status = status;
devicePlanSave(this.planData).then(res => {
if (res.code != 20000) {
this.$message.error(res.message)
return
}
this.closePlanEdit();
this.$message.success("保存成功!")
}).catch(e => {
})
this.planData.type = this.originData.type;
if (this.$parent.$options.propsData.title == '新增保养计划'){
deviceUpkeepPlanSave(this.planData).then(res => {
if (res.code != 20000) {
this.$message.error(res.message)
return
}
this.closePlanEdit();
this.$message.success("保存成功!")
}).catch(e => {
})
}else {
devicePlanSave(this.planData).then(res => {
if (res.code != 20000) {
this.$message.error(res.message)
return
}
this.closePlanEdit();
this.$message.success("保存成功!")
}).catch(e => {
})
}
},
chooseDevice(multiData) {

@ -3,7 +3,11 @@
<el-card>
<div slot="header" class="clearfix">
<div class="fr">
<el-button type="primary" @click="chooseItemList=[];chooseDetailItemFlag=true"></el-button>
<!--<el-button type="primary" @click="chooseItemList=[];chooseDetailItemFlag=true;"></el-button>-->
<el-button type="primary" @click="addSetProject()">
<div v-if="this.pullData.type == 2"></div>
<div v-else></div>
</el-button>
<el-button type="" @click="getDetailItemList"></el-button>
</div>
</div>
@ -30,8 +34,11 @@
<!-- />-->
</el-card>
<el-dialog
title="添加巡检项目"
:title="titleMap[titleName]"
:visible="true"
v-if="chooseDetailItemFlag"
@close="chooseDetailItemFlag = false"
@ -40,6 +47,7 @@
<deviceProjectAdd style="margin: 0"
:planId="projectItem.planId"
:projectItem="projectItem"
:pullData="plantData"
:closeAddDevice="closeAddDevice"/>
</el-dialog>
</div>
@ -55,6 +63,8 @@ import {
import {getLoading} from "@/utils";
import deviceProjectAdd from "@/views/dev/deviceProjectAdd";
export default {
name: "devicePlanProject",
props: {
@ -66,6 +76,10 @@ export default {
type: Object,
required: true
},
pullData: {
type: Object,
required: true
},
},
data() {
return {
@ -82,7 +96,15 @@ export default {
content: '',
},
chooseItemList: [],
plantData : {
type : 2,
},
chooseDetailItemFlag: false,
titleName : 2,
titleMap : {
1: '添加巡检项目',
2: '添加保养项目'
}
}
},
methods: {
@ -90,6 +112,7 @@ export default {
this.itemLoading = true
this.itemQuery.deviceCode = this.projectItem.deviceCode
this.itemQuery.planId = this.projectItem.planId
this.itemQuery.type = this.pullData.type
devicePlanDetailItemPage(this.itemQuery).then(res => {
this.itemLoading = false
if (res.code != 20000) {
@ -124,6 +147,16 @@ export default {
})
})
},
addSetProject(){
if (this.pullData.type === 1){
this.plantData = {
type : 1,
}
this.titleName = 1;
}
this.chooseItemList=[],
this.chooseDetailItemFlag=true
},
chooseDetailItem() {
let loading = getLoading(this)
let param = {
@ -161,6 +194,7 @@ export default {
created() {
this.getDetailItemList()
// console.log("dangqian ",this.pullData)
},
components: {

@ -95,7 +95,11 @@ export default {
required: true
},
isChoose: {required: false, default: false, type: Boolean},
closeAddDevice: {required: false, type: Function}
closeAddDevice: {required: false, type: Function},
pullData: {
type: Object,
required: true
},
},
data() {
return {
@ -116,6 +120,7 @@ export default {
},
created() {
this.getList()
// console.log("dayin shjv shi",this.pullData)
},
methods: {
search() {
@ -128,18 +133,19 @@ export default {
},
getList() {
this.loading = true
deviceCheckItemDictPage(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
this.query.type = this.pullData.type
deviceCheckItemDictPage(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
})
}).catch(e => {
this.loading = false
})
},
combine() {
@ -190,7 +196,8 @@ export default {
planId: this.projectItem.planId,
productId: this.projectItem.productId,
deviceCode: this.projectItem.deviceCode,
itemCodes: this.chooseItemList
itemCodes: this.chooseItemList,
type : this.pullData.type
}
devicePlanDetailItemAdd(param).then(res => {
if (res.code != 20000) {

@ -0,0 +1,194 @@
<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.chargeDeptCode"/>
</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" @row-click="rowClick" v-loading="loading" click-row-light>
<el-table-column label="序号" width="50" type="index"/>
<el-table-column label="保养任务id" width="150" prop="taskId"/>
<el-table-column label="任务名称" width="150" prop="name"/>
<el-table-column label="计划名称" width="150" prop="planName"/>
<el-table-column label="系统生成" width="80" prop="sysFlag">
<template slot-scope="scope">
{{ scope.row.sysFlag ? '是' : '否' }}
</template>
</el-table-column>
<el-table-column label="完成情况" width="80" prop="finishFlag">
<template slot-scope="scope">
<el-tag v-if="scope.row.finishFlag==true" type="success"></el-tag>
<el-tag v-if="scope.row.finishFlag==false" type="warning"></el-tag>
</template>
</el-table-column>
<el-table-column label="负责部门" width="160" prop="chargeDeptName"/>
<!-- <el-table-column label="负责人" width="160" prop="checkUserName"/>-->
<!-- <el-table-column label="负责人联系方式" width="160" prop="checkUserPhone"/>-->
<el-table-column label="设备数量" width="50" prop="deviceCount"/>
<el-table-column label="完成数量" width="50" prop="finishCount"/>
<el-table-column label="创建时间" width="160" prop="createTime"/>
<el-table-column label="创建人" width="160" prop="createUserName"/>
</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.name : ''}`
}}
</div>
<div v-if="clickRow" 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-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="80" prop="finishFlag">
<template slot-scope="scope">
<el-tag v-if="scope.row.finishFlag==true" type="success"></el-tag>
<el-tag v-if="scope.row.finishFlag==false" type="warning"></el-tag>
</template>
</el-table-column>
<el-table-column label="最小销售标识" width="150" prop="nameCode"/>
<el-table-column label="名称" width="150" prop="productName"/>
<el-table-column label="项目数量" width="50" prop="itemCount"/>
<el-table-column label="完成数量" width="50" prop="finishCount"/>
<el-table-column label="规格型号" width="160" prop="ggxh"/>
<!-- <el-table-column label="状态" width="120" prop="statusName">-->
<!-- <template scope="scope">-->
<!-- <el-tag :type="deviceStatus[scope.row.status].tagType">{{ scope.row.statusName }}</el-tag>-->
<!-- </template>-->
<!-- </el-table-column>-->
<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="170" fixed="right">
<template slot-scope="scope">
<el-button type="text" @click="openItem(scope.row)"
>查看保养项目
</el-button>
<!--<el-button v-if="scope.row.repairId" type="text" @click="repairId = scope.row.repairId"-->
<!--&gt;查看维修单-->
<!--</el-button>-->
<!-- <el-button type="text" @click="print(scope.row.taskId,scope.row.deviceCode)"-->
<!-- >打印-->
<!-- </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"
/>
</el-card>
<el-dialog
:visible="true"
v-if="itemDialogFlag"
width="80%"
:title="`保养项目${itemQuery.title?'--'+itemQuery.title:''}`"
@close="itemDialogFlag = false"
>
<el-card>
<div slot="header" class="clearfix">
<div class="fr">
<el-button type="" @click="getDetailItemList"></el-button>
</div>
</div>
<el-table :data="itemList" v-loading="itemLoading">
<el-table-column label="序号" width="50" type="index"/>
<el-table-column label="项目编码" width="150" prop="itemCode"/>
<el-table-column label="完成情况" width="80" prop="finishFlag">
<template slot-scope="scope">
<el-tag v-if="scope.row.finishFlag==true" type="success"></el-tag>
<el-tag v-if="scope.row.finishFlag==false" type="warning"></el-tag>
</template>
</el-table-column>
<el-table-column label="完成时间" width="160" prop="finishTime"/>
<el-table-column label="保养部门" width="100" prop="checkDeptName"/>
<el-table-column label="保养人" width="100" prop="checkUserName"/>
<el-table-column label="异常情况" width="80" prop="finishFlag">
<template slot-scope="scope">
<el-tag v-if="scope.row.normalFlag==true" type="success"></el-tag>
<el-tag v-if="scope.row.normalFlag==false" type="danger"></el-tag>
</template>
</el-table-column>
<el-table-column label="项目名称" width="150" prop="itemName"/>
<el-table-column label="项目内容" width="450" prop="itemContent"/>
<el-table-column label="巡检意见" width="450" prop="suggestion"/>
</el-table>
<pagination
v-show="itemTotal>0"
:total="itemTotal"
:page.sync="itemQuery.page"
:limit.sync="itemQuery.limit"
@pagination="getDetailItemList"
/>
</el-card>
</el-dialog>
</div>
</template>
<script src="./js/deviceUpkeep.js"/>
<style scoped>
/deep/ .el-dialog__body {
padding: 0 0 20px 0;
}
</style>

@ -0,0 +1,133 @@
<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="项目编码">
<el-input v-model="query.code" clearable/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="项目名称">
<el-input v-model="query.name" clearable/>
</el-form-item>
</el-col>
<!--<el-col :span="6">-->
<!-- <el-form-item label="项目类型">-->
<!-- <el-select v-model="query.type" clearable placeholder="请选择">-->
<!-- <el-option-->
<!-- :key="index"-->
<!-- :label="item.label"-->
<!-- :value="item.value"-->
<!-- v-for="(item, index) in options">-->
<!-- </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 type="primary" icon="el-icon-plus" @click="openCreate"
>新增
</el-button>
</el-button-group>
</div>
<el-divider style="margin: 15px"></el-divider>
<el-table :data="list" @selection-change="(val)=>{if(isChoose){selectChangFunc(val)}}"
@row-click="(row)=>{if(isChoose){$refs.table.toggleRowSelection(row)}}" ref="table"
v-loading="loading"
click-row-light>
<el-table-column type="selection" width="55" v-if="isChoose"></el-table-column>
<el-table-column label="序号" width="50" type="index"/>
<el-table-column label="项目编码" width="150" prop="code"/>
<el-table-column label="项目名称" width="200" prop="name"/>
<el-table-column label="项目内容" width="500" prop="content"/>
<el-table-column label="项目类型" width="120" prop="type">
<template slot-scope="scope">
<div v-if="scope.row.type == 1"></div>
<div v-if="scope.row.type == 2"></div>
</template>
</el-table-column>
<el-table-column label="创建人" width="120" prop="createUserName"/>
<el-table-column label="创建时间" width="140" prop="createTime"/>
<el-table-column label="操作" v-if="!isChoose" fixed="right" width="80">
<template slot-scope="scope">
<el-button type="text"@click="delFunc(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>
<el-dialog
:visible="createFlag"
v-if="createFlag"
width="50%"
title="创建巡检项目"
@close="createFlag = false"
>
<el-card>
<div slot="header" class="clearfix">
<div class="fr">
<el-button @click="createFlag = false">取消</el-button>
<el-button type="primary" @click="saveFunc"></el-button>
</div>
</div>
<el-form :model="saveData" ref="saveForm" :rules="formRule" label-width="auto">
<el-row>
<el-col>
<el-form-item label="项目编码" prop="code">
<el-input v-model="saveData.code" clearable show-word-limit maxlength="20">
<el-button slot="append" @click="genCode"></el-button>
</el-input>
</el-form-item>
</el-col>
<el-col>
<el-form-item label="项目名称" prop="name">
<el-input v-model="saveData.name" clearable show-word-limit maxlength="100"/>
</el-form-item>
</el-col>
<el-col>
<el-form-item label="项目内容" prop="content">
<el-input v-model="saveData.content" type="textarea" resize="none"
:autosize="{ minRows: 8, maxRows: 8 }" clearable show-word-limit maxlength="500"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
</el-dialog>
</div>
</template>
<script src="./js/deviceUpkeepItemDict.js"/>
<style scoped>
/deep/ .el-dialog__body {
padding: 0 0 20px 0;
}
</style>

@ -0,0 +1,171 @@
<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="计划名称">
<el-input v-model.trim="query.name" clearable/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="负责部门">
<deptSelect :value.sync="query.chargeDeptCode"/>
</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 type="primary" icon="el-icon-plus" @click="openCreate(null,null)"
>新增
</el-button>
</el-button-group>
</div>
<el-divider style="margin: 15px"></el-divider>
<el-table :data="list" @row-click="rowClick" v-loading="loading" click-row-light
highlight-current-row>
<el-table-column label="序号" width="50" type="index"/>
<el-table-column label="计划名称" width="150" prop="name"/>
<el-table-column label="负责部门" width="120" prop="chargeDeptName"/>
<el-table-column label="设备数量" width="120" prop="deviceCount"/>
<el-table-column label="单据状态" width="120" prop="chargeDeptName">
<template slot-scope="scope">
<el-tag v-if="scope.row.status==1" type="warning">稿</el-tag>
<el-tag v-if="scope.row.status==2" type="success"></el-tag>
</template>
</el-table-column>
<el-table-column label="执行状态" width="120" prop="chargeDeptName">
<template slot-scope="scope">
<el-tag v-if="scope.row.isActive==true" type="success"></el-tag>
<el-tag v-if="scope.row.isActive==false" type="info"></el-tag>
</template>
</el-table-column>
<el-table-column label="开始日期" width="150" prop="startDate"/>
<el-table-column label="结束日期" width="150" prop="endDate"/>
<el-table-column label="执行频率" width="160" prop="frequency">
<template slot-scope="scope">
{{ `${scope.row.frequency}` }}
</template>
</el-table-column>
<el-table-column label="已执行次数" width="200" prop="execCount"/>
<el-table-column label="备注" width="200" prop="remark"/>
<el-table-column label="操作" width="200" fixed="right">
<template slot-scope="scope">
<el-button type="text" @click.stop="openCreate(scope.row.planId,scope.row)">
编辑
</el-button>
<el-button type="text" @click="deviceCheckGenFunc(scope.row)"
>生成保养单
</el-button>
<el-button type="text" @click.stop="delplan(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>
<!-- 保养计划设备明细-->
<el-card>
<div slot="header" class="clearfix">
<div class="fl">
{{ `计划详情 ${clickRow ? '——' + clickRow.name : ''}` }}
</div>
</div>
<el-table :data="detailList"
v-loading="detailLoading" click-row-light
highlight-current-row>
<el-table-column label="序号" width="50" type="index"/>
<el-table-column label="科室名称" prop="deptName"/>
<el-table-column label="设备编号" prop="deviceCode"/>
<el-table-column label="最小销售标识" prop="nameCode"/>
<el-table-column label="名称" prop="productName"/>
<el-table-column label="规格型号" prop="ggxh"/>
<el-table-column label="计量单位" prop="measname"/>
<el-table-column label="生产企业" prop="manufactory"/>
<el-table-column label="注册/备案号" prop="zczbhhzbapzbh"/>
<el-table-column label="操作" width="120">
<template slot-scope="prop">
<el-button type="text" @click="setProject(prop.row)"
>保养项目
</el-button>
<!-- <el-button type="text" @click="delDetail(prop.row)"-->
<!-- >移除-->
<!-- </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"
/>
</el-card>
<el-dialog
title="编辑保养项目"
:visible="true"
v-if="projectVisible"
@close="projectVisible = false"
width="80%"
>
<DevicePlanProject style="margin: 0"
:planId="detailQuery.planId"
:projectItem="projectItem"
:pullData="planData"
:closeAddDevice="closeAddDevice"/>
</el-dialog>
<!--新增保养计划-->
<el-dialog
:title="planEditTitle"
:visible="true"
v-if="createFlag"
@close="createFlag = false"
width="80%"
>
<devicePlanEdit :originData="planData"
:closePlanEdit="closePlanEdit"
:createFlag="createFlag"/>
</el-dialog>
</div>
</template>
<script src="./js/deviceUpkeepPlan.js"/>
<style scoped>
/deep/ .el-dialog__body {
padding: 0 0 20px 0;
}
</style>

@ -11,12 +11,14 @@ let query = {
limit: 10,
name: null,
code: null,
type:1,
}
let saveData = {
code: null,
name: null,
content: null,
type:1,
}
export default {

@ -0,0 +1,181 @@
// import {deviceCheckPage, deviceCheckPrint, deviceCheckPrintByDeviceCode} from "@/api/dev/deviceCheckApi";
// import {deviceCheckDetailPage} from "@/api/dev/deviceCheckDetailApi";
// import {deviceCheckDetailItemPage} from "@/api/dev/deviceCheckDetailItemApi";
import {getLoading} from "@/utils";
import { deviceUpkeepPage, deviceCheckPrint, deviceCheckPrintByDeviceCode } from '@/api/dev/deviceUpkeepApi'
import { deviceCheckDetailItemPage } from '@/api/dev/deviceCheckDetailItemApi'
import { deviceUpkeepDetailPage } from '@/api/dev/deviceUpkeepDetailApi'
let query = {
page: 1,
limit: 10,
chargeDeptCode: null,
finishFlag: null,
}
let detailQuery = {
page: 1,
limit: 10,
taskId: null,
deviceCode: null,
}
let itemQuery = {
page: 1,
limit: 10,
taskId: null,
deviceCode: null,
}
export default {
name: "deviceUpkeep",
computed: {},
data() {
return {
loading: false,
total: .0,
list: [],
query: {...query},
showSearch: true,
clickRow: null,
//保养设备详情=============
detailLoading: false,
detailQuery: {...detailQuery},
detailList: [],
detailTotal: 0,
showLog: false,
itemDialogFlag:false,
itemQuery: {...itemQuery},
itemTotal:0,
itemList:[],
itemLoading:false,
//===================================================
}
},
created() {
this.getList()
},
methods: {
// print(taskId, deviceCode) {
// let loading = getLoading(this)
// if (deviceCode) {
// deviceCheckPrintByDeviceCode(taskId, deviceCode).then(res => {
// loading.close()
// if (res.code != 20000) {
// this.$message.error(res.message)
// return
// }
// this.checkPrintData = {...res.data}
// setTimeout(() => {
// let html = document.getElementById("printDiv").innerHTML;
// let newWindow = this.openNewWindow("")
// newWindow.document.write(html)
// newWindow.print()
// }, 500)
//
// }).catch(() => {
// loading.close()
// })
// } else {
// deviceCheckPrint(taskId).then(res => {
// loading.close()
// if (res.code != 20000) {
// this.$message.error(res.message)
// return
// }
// this.checkPrintData = {...res.data}
// setTimeout(() => {
// let html = document.getElementById("printDiv").innerHTML;
// let newWindow = this.openNewWindow("")
// newWindow.document.write(html)
// newWindow.print()
// }, 500)
//
// }).catch(() => {
// loading.close()
// })
// }
// },
openItem(row) {
console.log("wobuzhidao sehns ")
this.itemQuery = {
...itemQuery,
taskId: row.taskId,
deviceCode: row.deviceCode,
title: `[${row.deviceCode}]--${row.productName}(${row.nameCode})`
}
this.itemDialogFlag = true
this.getDetailItemList()
},
getDetailItemList() {
this.itemLoading = true
deviceCheckDetailItemPage(this.itemQuery).then(res => {
this.itemLoading = false
if (res.code != 20000) {
this.$message.error(res.message)
return
}
this.itemList = res.data.list || []
this.itemTotal = res.data.total || 0
}).catch(e => {
this.itemLoading = false
this.itemList = []
this.itemTotal = 0
})
},
rowClick(row) {
if (this.clickRow && row.taskId == this.clickRow.taskId) {
return false
}
this.clickRow = row
this.detailQuery = {...detailQuery, taskId: row.taskId}
console.log("什么意思????")
this.getDetailList()
},
getDetailList() {
this.detailLoading = true
deviceUpkeepDetailPage(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.getList()
},
getList() {
this.loading = true
deviceUpkeepPage(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.list = []
this.total = 0
this.loading = false
})
}
}
}

@ -0,0 +1,136 @@
import {
delDeviceCheckItemDict,
deviceCheckItemDictPage,
genCheckItemCode,
saveDeviceCheckItemDict
} from "@/api/dev/deviceCheckItemDictApi";
import {getLoading, getLoadingObj} from "@/utils";
let query = {
page: 1,
limit: 10,
name: null,
code: null,
type:2,
}
let saveData = {
code: null,
name: null,
content: null,
type:2,
}
export default {
name: "deviceCheckItemDict",
props: {isChoose: {required: false, default: false, type: Boolean}, selectChangFunc: {required: false, type: Function}},
data() {
return {
showSearch: true,
loading: false,
total: .0,
list: [],
query: {...query},
createFlag: false,
saveData: {...saveData},
formRule: {
code: [{required: true, message: "项目编码不能为空", trigger: "change"}],
name: [{required: true, message: "项目名称不能为空", trigger: "change"}],
content: [{required: true, message: "项目内容不能为空", trigger: "change"}]
},
options: [
{ label: '巡检项目', value: '1' },
{ label: '保养项目', value: '2' }
]
}
},
created() {
this.getList()
},
methods: {
delFunc(row) {
this.$confirm("此操作将会永久删除该数据,是否继续?", "提示", {
confirmButtonText: "继续",
cancelButtonText: "取消"
}).then(() => {
let load = getLoading(this)
delDeviceCheckItemDict(row.code).then(res => {
load.close()
if (res.code != 20000) {
this.$message.error(res.message)
return
}
this.$message.success(res.message)
this.query = {...query}
this.getList()
}).catch(() => {
load.close()
})
})
},
genCode() {
genCheckItemCode().then(res => {
if (res.code != 20000) {
this.$message.error(res.message)
return
}
this.saveData.code = res.data
})
},
saveFunc: function () {
this.$refs.saveForm.validate(b => {
if (!b) {
return false
}
let loading = getLoading(this);
saveDeviceCheckItemDict(this.saveData).then(res => {
loading.close()
if (res.code != 20000) {
this.$message.error(res.message)
return
}
this.$message.success(res.message)
this.createFlag = false
this.query.page = 1
this.getList()
}).catch(() => {
loading.close
})
})
},
openCreate() {
genCheckItemCode().then(res => {
if (res.code != 20000) {
this.$message.error(res.message)
return
}
this.saveData = {...saveData, code: res.data}
this.createFlag = true
})
},
search() {
this.query.page = 1
this.getList()
},
onReset() {
this.query = {...query}
this.getList()
},
getList() {
this.loading = true
deviceCheckItemDictPage(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
})
}
}
}

@ -0,0 +1,517 @@
import DeviceCheckItemDict from '@/views/dev/deviceCheckItemDict'
import product from '@/views/basic/product/product'
import DevicePlanProject from '@/views/dev/devicePlanProject'
import {
devicePlanDetailDel,
devicePlanDetailDelByDeviceCode,
devicePlanDetailPage
} from '@/api/dev/devicePlanDetailApi'
import { getLoading } from '@/utils'
import { deviceCheckGenByPlanId } from '@/api/dev/deviceUpkeepApi'
import { deviceUpkeepPlanDel, devicePlanInfo, deviceUpkeepPlanPage, devicePlanSave } from '@/api/dev/deviceUpkeepPlanApi'
import {
devicePlanDetailItemAdd,
devicePlanDetailItemByDeviceCodeDel,
devicePlanDetailItemDel,
devicePlanDetailItemPage
} from '@/api/dev/devicePlanDetailItemApi'
import devicePlanEdit from "@/views/dev/devicePlanEdit";
let query = {
page: 1,
limit: 10,
name: null,
chargeDeptCode: null,
type:2,
}
let detailQuery = {
page: 1,
limit: 10,
planId: null,
}
let rowDeltailQuery = {
page: 1,
limit: 10,
planId: null,
productId: null,
}
let itemQuery = {
page: 1,
limit: 10,
planId: null,
productId: null,
}
let planData = {
name: null,
chargeDeptCode: null,
startDate: null,
endDate: null,
frequency: 1,
dateInterval: null,
remark: null,
type:2,
}
export default {
name: "deviceUpkeepPlan",
components: { product, devicePlanEdit, DevicePlanProject},
computed: {},
data() {
return {
clickRow: null,
showSearch: true,
loading: false,
total: .0,
list: [],
query: {...query},
//计划设备明细=============================================
detailLoading: false,
detailQuery: {...detailQuery},
detailList: [],
detailTotal: 0,
//巡检项目=============================================
itemQuery: {...itemQuery},
itemList: [],
itemTotal: 0,
itemLoading: false,
chooseDetailItemFlag: false,
chooseDeviceList: [],
chooseItemList: [],
//新增/编辑计划===================================================
planEditTitle: "新增保养计划",
createActive: 0,
createFlag: false,
chooseDeviceFlag: false,
expandRowKeys: [],
dialogExpandRowKeys: [],
planData: {...planData},
formRule: {
name: [{required: true, message: "计划名称不能为空", trigger: ["change", "blur"]}],
chargeDeptCode: [{required: true, message: "负责部门不能为空", trigger: ["change", "blur"]}],
dateInterval: [{required: true, message: "计划执行区间不能为空", trigger: ["change", "blur"]}],
frequency: [{
required: true,
message: "计划执行频率不能为空",
trigger: ["change", "blur"]
}],
},
dateInterval: null,
pickerOptions: {
disabledDate: time => {
let nowDate = new Date().getTime();
let pickDate = new Date(time).getTime();
return (nowDate >= pickDate);
},
shortcuts: [{
text: '一个月(30天)',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() + 3600 * 1000 * 24);
end.setTime(start.getTime() + 3600 * 1000 * 24 * 30);
picker.$emit('pick', [start, end]);
}
}, {
text: '三个月(90天)',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() + 3600 * 1000 * 24);
end.setTime(start.getTime() + 3600 * 1000 * 24 * 30 * 3);
picker.$emit('pick', [start, end]);
}
}, {
text: '半年(180天)',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() + 3600 * 1000 * 24);
end.setTime(start.getTime() + 3600 * 1000 * 24 * 30 * 6);
picker.$emit('pick', [start, end]);
}
}, {
text: '一年(365天)',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() + 3600 * 1000 * 24);
end.setTime(start.getTime() + 3600 * 1000 * 24 * 365);
picker.$emit('pick', [start, end]);
}
}]
},
projectVisible: false,
projectItem: null,
}
},
watch: {
planData(v) {
if (v.planId != null) {
this.$set(v, "dateInterval", [v.startDate, v.endDate])
}
},
"planData.dateInterval"(v) {
if (v != null && v.length > 0) {
this.planData.startDate = v[0]
this.planData.endDate = v[1]
}
},
"$refs.dialogTable"(v) {
this.$refs.dialogTable?.doLayout()
}
},
created() {
this.getList()
},
methods: {
handleExpendRow(row, expandedRows) {
if (expandedRows.length == 0) {
return
}
this.$set(row, "detailData", {
loading: false,
showSearch: true,
list: [],
total: 0,
query: {...rowDeltailQuery, planId: row.planId, productId: row.productId}
})
this.getRowDetailList(row.detailData)
},
getRowDetailList(data) {
data.loading = true
devicePlanDetailPage(data.query).then(res => {
data.loading = false
if (res.code != 20000) {
this.$message.error(res.message)
return
}
data.list = res.data.list || []
data.total = res.data.total || 0
}).catch(() => {
data.loading = false
data.list = []
data.total = 0
})
},
getDetailList() {
this.detailLoading = true
this.expandRowKeys = []
this.dialogExpandRowKeys = []
devicePlanDetailPage(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.detailList = []
this.detailTotal = 0
this.detailLoading = false
})
},
deviceCheckGenFunc(row) {
this.$confirm("此操作将会创建一个任务单,是否继续", "提示", {
confirmButtonText: "继续",
cancelButtonText: "取消"
}).then(() => {
let load = getLoading(this)
deviceCheckGenByPlanId(row.planId).then(res => {
load.close()
if (res.code != 20000) {
this.$message.error(res.message)
return
}
this.$message.success(res.message)
this.getList()
}).catch(() => {
load.close()
})
})
},
delplan(row) {
this.$confirm("此操作将会永久删除该计划,现有任务不受影响,是否继续", "提示", {
confirmButtonText: "继续",
cancelButtonText: "取消"
}).then(() => {
let load = getLoading(this)
deviceUpkeepPlanDel(row.planId).then(res => {
load.close()
if (res.code != 20000) {
this.$message.error(res.message)
return
}
this.$message.success(res.message)
this.query.page = 1
this.getList()
if (this.clickRow && this.clickRow.planId == row.planId) {
this.clickRow = null
this.detailTotal = 0
this.detailList = []
}
}).catch(() => {
load.close()
})
})
},
// openItem(row) {
// this.itemQuery = {
// ...itemQuery,
// planId: row.planId,
// productId: row.productId,
// deviceCode: row.deviceCode,
// title: `${row.deviceCode ? row.deviceCode + '--' : ''}${row.productName}(${row.nameCode})`
// }
// this.getDetailItemList()
// },
// getDetailItemList() {
// this.itemLoading = true
// devicePlanDetailItemPage(this.itemQuery).then(res => {
// this.itemLoading = false
// if (res.code != 20000) {
// this.$message.error(res.message)
// return
// }
// this.itemList = res.data.list || []
// this.itemTotal = res.data.total || 0
// }).catch(e => {
// this.itemList = []
// this.itemTotal = 0
// this.itemLoading = false
// })
// },
// // delDetailItem(row) {
// this.$confirm("此操作将会永久删除该条明细,且将在下一次任务生效,现有任务不受影响,是否继续", "提示", {
// confirmButtonText: "继续",
// cancelButtonText: "取消"
// }).then(() => {
// let load = getLoading(this)
// if (!row.deviceCode) {
// devicePlanDetailItemDel(row.planId, row.productId, row.itemCode).then(res => {
// load.close()
// if (res.code != 20000) {
// this.$message.error(res.message)
// return
// }
// this.$message.success(res.message)
// this.itemQuery.page = 1
// this.getDetailItemList()
// }).catch(() => {
// load.close()
// })
// } else {
// devicePlanDetailItemByDeviceCodeDel(row.planId, row.deviceCode, row.itemCode).then(res => {
// load.close()
// if (res.code != 20000) {
// this.$message.error(res.message)
// return
// }
// this.$message.success(res.message)
// this.itemQuery.page = 1
// this.getDetailItemList()
// }).catch(() => {
// load.close()
// })
// }
// })
// },
// delDetail(row) {
// this.$confirm("此操作将会永久删除该条明细,且将在下一次任务生效,现有任务不受影响,是否继续", "提示", {
// confirmButtonText: "继续",
// cancelButtonText: "取消"
// }).then(() => {
// let load = getLoading(this)
// if (row.deviceCode) {
// devicePlanDetailDelByDeviceCode(row.planId, row.deviceCode).then(res => {
// load.close()
// if (res.code != 20000) {
// this.$message.error(res.message)
// return
// }
// this.$message.success(res.message)
// this.detailQuery.page = 1
// this.getDetailList()
// }).catch(() => {
// load.close()
// })
// } else {
// devicePlanDetailDel(row.planId, row.productId).then(res => {
// load.close()
// if (res.code != 20000) {
// this.$message.error(res.message)
// return
// }
// this.$message.success(res.message)
// this.detailQuery.page = 1
// this.getDetailList()
// }).catch(() => {
// load.close()
// })
// }
//
// })
// },
rowClick(row) {
this.clickRow = row
this.detailQuery = {...detailQuery, planId: row.planId}
this.getDetailList()
},
// getDetailList() {
// this.detailLoading = true
// this.expandRowKeys = []
// this.dialogExpandRowKeys = []
// devicePlanDetailPage(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.detailList = []
// this.detailTotal = 0
// this.detailLoading = false
// })
// },
// changeActive(isNext, row) {
// let load = getLoading(this)
// if (isNext) {
// if (this.createActive == 0) {
// this.$refs.saveForm.validate(b => {
// if (!b) {
// load.close()
// return
// }
// devicePlanSave(this.planData).then(res => {
// load.close()
// if (res.code != 20000) {
// this.$message.error(res.message)
// return
// }
// this.planData.planId = res.data
// this.detailQuery = {...detailQuery, planId: this.planData.planId}
// this.getDetailList()
// this.createActive += 1
// }).catch(e => {
// load.close()
// })
// })
// } else if (this.createActive == 1) {
// this.openItem(row)
// load.close()
// this.createActive += 1
// }
//
// } else {
// if (this.createActive == 2) {
// this.planData = {...this.planData}
// this.detailQuery = {...detailQuery, planId: this.itemQuery.planId}
// this.getDetailList()
// load.close()
// this.createActive -= 1
// } else if (this.createActive == 1) {
// devicePlanInfo(this.planData.planId).then(res => {
// load.close()
// if (res.code != 20000) {
// this.$message.error(res.message)
// return
// }
// this.planData = {...res.data}
// this.createActive -= 1
// }).catch(e => {
// load.close()
// })
// }
// }
// load.close()
// },
// itemSelectChangFunc(list) {
// this.chooseItemList = list.map(i => i.code)
// },
// chooseDetailItem() {
// let loading = getLoading(this)
// let param = {
// planId: this.itemQuery.planId,
// productId: this.itemQuery.productId,
// deviceCode: this.itemQuery.deviceCode,
// itemCodes: this.chooseItemList
// }
// devicePlanDetailItemAdd(param).then(res => {
// loading.close()
// if (res.code != 20000) {
// this.$message.error(res.message)
// return
// }
// this.chooseItemList = []
// this.$message.success(res.message)
// this.chooseDetailItemFlag = false
// this.itemQuery.page = 1
// this.getDetailItemList()
//
// }).catch(e => {
// loading.close()
// })
// },
closePlanEdit() {
this.createFlag = false;
this.getList()
},
//
//
// deviceSelectChangFunc(list) {
// this.chooseDeviceList = list.map(i => i.deviceCode)
// },
//
//新增编辑计划
openCreate(planId, row) {
if (planId != null) {
this.planEditTitle = `编辑保养计划信息${row.planId ? '--(' + row.name + ')' : ''}`;
this.planData = row;
this.planData.type = 2
} else {
this.planEditTitle = "新增保养计划";
this.planData = {
type:2,
};
}
this.createFlag = true;
},
// search() {
// this.query.page = 1
// this.getList()
// },
// onReset() {
// this.query = {...query}
// this.getList()
// },
getList() {
this.loading = true
deviceUpkeepPlanPage(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
})
},
setProject(row) {
this.projectVisible = true
this.projectItem = row
},
}
}
Loading…
Cancel
Save