巡检计划相关修改
parent
24abcee7e9
commit
5fc6e1cb3d
@ -1,40 +1,53 @@
|
||||
import axios from "@/utils/request";
|
||||
|
||||
export function devicePlanDetailItemPage(query) {
|
||||
return axios(
|
||||
{
|
||||
url: "/udi/device/plan/detail/item/page",
|
||||
method: "POST",
|
||||
data: query
|
||||
}
|
||||
)
|
||||
return axios(
|
||||
{
|
||||
url: "/udi/device/plan/detail/item/page",
|
||||
method: "POST",
|
||||
data: query
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
export function devicePlanDetailItemAdd(query) {
|
||||
return axios(
|
||||
{
|
||||
url: "/udi/device/plan/detail/item/add",
|
||||
method: "POST",
|
||||
data: query
|
||||
}
|
||||
)
|
||||
return axios(
|
||||
{
|
||||
url: "/udi/device/plan/detail/item/add",
|
||||
method: "POST",
|
||||
data: query
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
export function devicePlanDetailItemDel(planId,productId,itemCode) {
|
||||
return axios(
|
||||
{
|
||||
url: `/udi/device/plan/detail/item/delByProductId/${planId}/${productId}/${itemCode}`,
|
||||
method: "DELETE"
|
||||
}
|
||||
)
|
||||
export function devicePlanDetailItemBatchAdd(query) {
|
||||
return axios(
|
||||
{
|
||||
url: "/udi/device/plan/detail/item/batch/add",
|
||||
method: "POST",
|
||||
data: query
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
export function devicePlanDetailItemByDeviceCodeDel(planId,deviceCode,itemCode) {
|
||||
return axios(
|
||||
{
|
||||
url: `/udi/device/plan/detail/item/delByDeviceCode/${planId}/${deviceCode}/${itemCode}`,
|
||||
method: "DELETE"
|
||||
}
|
||||
)
|
||||
|
||||
export function devicePlanDetailItemDel(planId, productId, itemCode) {
|
||||
return axios(
|
||||
{
|
||||
url: `/udi/device/plan/detail/item/delByProduct/${planId}/${productId}/${itemCode}`,
|
||||
method: "DELETE"
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
export function devicePlanDetailItemByDeviceCodeDel(planId, deviceCode, itemCode) {
|
||||
return axios(
|
||||
{
|
||||
url: `/udi/device/plan/detail/item/delByDevice/${planId}/${deviceCode}/${itemCode}`,
|
||||
method: "DELETE"
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,158 @@
|
||||
<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.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-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="query.page=1;getList()"
|
||||
>查询
|
||||
</el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="chooseDevice"
|
||||
>选入
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
<el-divider style="margin: 15px"></el-divider>
|
||||
<el-table :data="list" v-loading="loading" @selection-change="(val)=>{selectChangeFunc(val)}"
|
||||
@row-click="(row)=>{$refs.table.toggleRowSelection(row)}" ref="table" row-key="deviceCode">
|
||||
<el-table-column type="selection" width="55"></el-table-column>
|
||||
<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="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>
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="query.page"
|
||||
:limit.sync="query.limit"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {deviceDetailInfo} from "@/api/dev/deviceInfoApi";
|
||||
import {getLoading} from "@/utils";
|
||||
import {devicePlanDetailAdd} from "@/api/dev/devicePlanDetailApi";
|
||||
|
||||
let query = {
|
||||
page: 1,
|
||||
limit: 10,
|
||||
productName: null,
|
||||
deviceCode: null,
|
||||
planId: null,
|
||||
}
|
||||
export default {
|
||||
name: "deviceAdd",
|
||||
props: {
|
||||
planId: {required: true},
|
||||
selectChangeFunc: {required: true, type: Function},
|
||||
closeAddDevice: {required: true, type: Function},
|
||||
planData: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showSearch: true,
|
||||
loading: false,
|
||||
query: {...query},
|
||||
list: [],
|
||||
total: 0,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.query = {...query, planId: this.planId}
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
onReset() {
|
||||
this.query = {...query, planId: this.planId}
|
||||
this.getList()
|
||||
},
|
||||
chooseDevice() {
|
||||
let selectList = this.$refs.table.selection
|
||||
if (selectList.length == 0) {
|
||||
this.$message.error("请选择设备")
|
||||
return
|
||||
}
|
||||
let deviceCodes = selectList.map(item => item.deviceCode)
|
||||
let param = {
|
||||
planId: this.planId,
|
||||
deviceCodes: deviceCodes,
|
||||
devicePlanParam: this.planData
|
||||
}
|
||||
devicePlanDetailAdd(param).then(res => {
|
||||
if (res.code != 20000) {
|
||||
this.$message.error(res.message)
|
||||
return
|
||||
}
|
||||
this.$message.success(res.message)
|
||||
this.closeAddDevice(res.data);
|
||||
}).catch(e => {
|
||||
})
|
||||
},
|
||||
getList() {
|
||||
this.loading = true
|
||||
deviceDetailInfo(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(() => {
|
||||
this.loading = false
|
||||
this.list = [];
|
||||
this.total = 0;
|
||||
});
|
||||
},
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@ -0,0 +1,175 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card>
|
||||
<div slot="header" class="clearfix">
|
||||
<div class="fr">
|
||||
<el-button type="primary" @click="chooseItemList=[];chooseDetailItemFlag=true">添加巡检项目</el-button>
|
||||
<el-button type="" @click="getDetailItemList">刷新</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table :data="itemList" ref="itemTable" v-loading="itemLoading" row-key="itemCode">
|
||||
<el-table-column label="序号" width="50" type="index"/>
|
||||
<el-table-column label="项目编码" width="150" prop="itemCode"/>
|
||||
<el-table-column label="项目名称" width="200" prop="name"/>
|
||||
<el-table-column label="项目内容" width="250" prop="content"/>
|
||||
<el-table-column label="操作" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text"
|
||||
@click="delDetailItem(scope.row)"
|
||||
>移除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- <pagination-->
|
||||
<!-- v-show="itemTotal>0"-->
|
||||
<!-- :total="itemTotal"-->
|
||||
<!-- :page.sync="itemQuery.page"-->
|
||||
<!-- :limit.sync="itemQuery.limit"-->
|
||||
<!-- @pagination="getDetailItemList"-->
|
||||
<!-- />-->
|
||||
</el-card>
|
||||
|
||||
<el-dialog
|
||||
title="添加巡检项目"
|
||||
:visible="true"
|
||||
v-if="chooseDetailItemFlag"
|
||||
@close="chooseDetailItemFlag = false"
|
||||
width="80%"
|
||||
>
|
||||
<deviceProjectAdd style="margin: 0"
|
||||
:planId="projectItem.planId"
|
||||
:projectItem="projectItem"
|
||||
:closeAddDevice="closeAddDevice"/>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
devicePlanDetailItemAdd,
|
||||
devicePlanDetailItemByDeviceCodeDel,
|
||||
devicePlanDetailItemDel,
|
||||
devicePlanDetailItemPage
|
||||
} from "@/api/dev/devicePlanDetailItemApi";
|
||||
import {getLoading} from "@/utils";
|
||||
import deviceProjectAdd from "@/views/dev/deviceProjectAdd";
|
||||
|
||||
export default {
|
||||
name: "devicePlanProject",
|
||||
props: {
|
||||
projectItem: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
planId: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
itemList: [],
|
||||
itemTotal: 0,
|
||||
itemLoading: false,
|
||||
itemQuery: {
|
||||
planId: null,
|
||||
page: 1,
|
||||
limit: 10,
|
||||
deviceCode: '',
|
||||
itemCode: '',
|
||||
name: '',
|
||||
content: '',
|
||||
},
|
||||
chooseItemList: [],
|
||||
chooseDetailItemFlag: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getDetailItemList() {
|
||||
this.itemLoading = true
|
||||
this.itemQuery.deviceCode = this.projectItem.deviceCode
|
||||
this.itemQuery.planId = this.projectItem.planId
|
||||
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)
|
||||
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()
|
||||
})
|
||||
})
|
||||
},
|
||||
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()
|
||||
})
|
||||
},
|
||||
itemSelectChangFunc(list) {
|
||||
this.chooseItemList = list.map(i => i.code)
|
||||
},
|
||||
|
||||
|
||||
closeAddDevice() {
|
||||
this.chooseDetailItemFlag = false;
|
||||
this.getDetailItemList()
|
||||
},
|
||||
},
|
||||
|
||||
created() {
|
||||
this.getDetailItemList()
|
||||
},
|
||||
|
||||
components: {
|
||||
deviceProjectAdd
|
||||
}
|
||||
,
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@ -0,0 +1,219 @@
|
||||
<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-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="combine"
|
||||
>选入
|
||||
</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
<el-divider style="margin: 15px"></el-divider>
|
||||
|
||||
<el-table :data="list"
|
||||
v-loading="loading" ref="table"
|
||||
click-row-light>
|
||||
<el-table-column type="selection" width="55"></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="250" prop="content"/>
|
||||
<el-table-column label="创建人" width="120" prop="createUserName"/>
|
||||
<el-table-column label="创建时间" width="140" prop="createTime"/>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="query.page"
|
||||
:limit.sync="query.limit"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
deviceCheckItemDictPage,
|
||||
} from "@/api/dev/deviceCheckItemDictApi";
|
||||
import {devicePlanDetailItemAdd, devicePlanDetailItemBatchAdd} from "@/api/dev/devicePlanDetailItemApi";
|
||||
import {getLoading} from "@/utils";
|
||||
import {devicePlanDetailDelByDeviceCode} from "@/api/dev/devicePlanDetailApi";
|
||||
|
||||
let query = {
|
||||
page: 1,
|
||||
limit: 10,
|
||||
name: null,
|
||||
code: null,
|
||||
}
|
||||
|
||||
let saveData = {
|
||||
code: null,
|
||||
name: null,
|
||||
content: null,
|
||||
}
|
||||
|
||||
export default {
|
||||
name: "deviceCheckItemDict",
|
||||
props: {
|
||||
projectItem: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
planId: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
type: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
isChoose: {required: false, default: false, type: Boolean},
|
||||
closeAddDevice: {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"}]
|
||||
},
|
||||
chooseItemList: [],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
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
|
||||
})
|
||||
},
|
||||
|
||||
combine() {
|
||||
let selectList = this.$refs.table.selection
|
||||
if (selectList.length == 0) {
|
||||
this.$message.error("请选择巡检项目")
|
||||
return
|
||||
}
|
||||
if (this.type == 2) {
|
||||
this.$confirm("此操作将会批量添加或覆盖该计划下所有设备巡检项目,是否继续", "提示", {
|
||||
confirmButtonText: "继续",
|
||||
cancelButtonText: "取消"
|
||||
}).then(() => {
|
||||
this.addProject()
|
||||
})
|
||||
} else {
|
||||
this.addProject()
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
addProject() {
|
||||
let selectList = this.$refs.table.selection
|
||||
if (selectList.length == 0) {
|
||||
this.$message.error("请选择巡检项目")
|
||||
return
|
||||
}
|
||||
this.chooseItemList = selectList.map(item => item.code)
|
||||
|
||||
|
||||
if (this.type == 2) {
|
||||
let param = {
|
||||
planId: this.planId,
|
||||
itemCodes: this.chooseItemList
|
||||
}
|
||||
devicePlanDetailItemBatchAdd(param).then(res => {
|
||||
if (res.code != 20000) {
|
||||
this.$message.error(res.message)
|
||||
return
|
||||
}
|
||||
this.$message.success(res.message)
|
||||
this.closeAddDevice()
|
||||
}).catch(e => {
|
||||
})
|
||||
} else {
|
||||
|
||||
let param = {
|
||||
planId: this.projectItem.planId,
|
||||
productId: this.projectItem.productId,
|
||||
deviceCode: this.projectItem.deviceCode,
|
||||
itemCodes: this.chooseItemList
|
||||
}
|
||||
devicePlanDetailItemAdd(param).then(res => {
|
||||
if (res.code != 20000) {
|
||||
this.$message.error(res.message)
|
||||
return
|
||||
}
|
||||
this.$message.success(res.message)
|
||||
this.closeAddDevice()
|
||||
}).catch(e => {
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped>
|
||||
|
||||
/deep/ .el-dialog__body {
|
||||
padding: 0 0 20px 0;
|
||||
}
|
||||
|
||||
</style>
|
Loading…
Reference in New Issue