添加设备相关接口

master
jinna 1 year ago
parent 46a02bc3d5
commit d1e2e7af80
  1. 18
      src/api/operation/hand.js
  2. 108
      src/views/businessManagement/ordinary.vue
  3. 52
      src/views/device/deviceSystem.vue
  4. 1
      src/views/labManagement/inspectionManagement.vue
  5. 14
      src/views/operation/hand.vue
  6. 22
      src/views/workbench/index.vue

@ -259,3 +259,21 @@ export const getAllUser = (query) =>{
params:query
})
}
// 客服直接关闭接口
export const serviceSubmit = (data) =>{
return request({
url:'/api/lab-ops/work-order/service-repair-submit',
method:'post',
data
})
}
export const sendMess = (data) =>{
return request({
url:"/api/lab-ops/maintenance/task-supervisor-confirm",
method:"post",
data
})
}

@ -18,7 +18,7 @@
<!-- status 客服角色下 1839536982874193922 状态 0-客服待接单 1,23-待维修 4-维修完成 5-待评价 6-已完成
维修负责人 18395370553895157771-待接单 2,3-待维修 4-维修完成 5-待评价 6-已完成 维修人2-待确认 3-待维修 4-维修完成 5-待评价 6-已完成 领导4-待审批 5-待评价 6-已完成
-->
<el-tag :type="getStatus('maintain',role_id,row.status).type">{{ getStatus('maintain',role_id,row.status).name }}</el-tag>
<el-tag v-if="getStatus('maintain',role_id,row.status)" :type="getStatus('maintain',role_id,row.status).type">{{ getStatus('maintain',role_id,row.status).name }}</el-tag>
</template>
<template slot-scope="scope" slot="menuLeft">
<el-button type="primary" size="small" @click="handleAccept" v-show="role_id != '1839600115013713921'">{{
@ -34,8 +34,8 @@
<el-button v-show="permission.ordinaryConfirm && row.status == 201" @click="reciveOrder(row)">确认</el-button>
<el-button v-show="permission.ordinaryRefuse && row.status == 201" @click="repairReject(row)">驳回</el-button>
<el-button v-show="permission.ordinarySubmit && (row.status == 401 || row.status == 300)" @click="handleRepair(row)">提交</el-button>
<el-button v-show="permission.ordinaryFinish && row.status == 103" @click="handleRepairFinish(row)">维修完成</el-button>
<el-button v-show="permission.ordinaryExamine && row.status == 402 || row.status == 102" @click="handleExamine(row)">审批</el-button>
<el-button v-show="permission.ordinaryFinish && (row.status == 103 || row.status == 401)" @click="handleRepairFinish(row)">维修完成</el-button>
<el-button v-show="permission.ordinaryExamine && (row.status == 402 || row.status == 102)" @click="handleExamine(row)">审批</el-button>
<el-button v-show="row.status == 104" @click="handlePayment(row)">确认付款</el-button>
<el-button @click="handleExport(row)">导出</el-button>
</template>
@ -237,7 +237,7 @@
<el-form-item label="故障位置" prop="faultLocation">
<el-input placeholder="请输入故障位置" disabled v-model="repairForm.faultLocation" style="width:98%;"></el-input>
</el-form-item>
<el-form-item label="设备名称" prop="deviceId">
<el-form-item label="设备名称" prop="deviceName">
<el-input style="width:98%;" disabled v-model="repairForm.deviceName"></el-input>
</el-form-item>
<el-form-item label="故障专业类型" prop="faultType">
@ -289,9 +289,10 @@
<!-- <el-input
v-show="role_id == '1839600115013713921' || (repairForm.status == 402 || repairForm.status == 103 || repairForm.status == 301) || repairForm.status == 3 || dialogType != 'view'"
style="width: 98%" disabled v-model="repairForm.deviceName"></el-input> -->
<el-select placeholder="请选择设备" v-model="repairForm.deviceId" style="width:98%;" :disabled="dialogType == 'view' || dialogType == 'examine'">
<el-select v-if="dialogType != 'view' && dialogType != 'examine'" placeholder="请选择设备" v-model="repairForm.deviceId" style="width:98%;" :disabled="dialogType == 'view' || dialogType == 'examine'" @change="changeDevice">
<el-option v-for="item in deviceList" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
<el-input v-if="dialogType == 'view' || dialogType == 'examine'" v-model="repairForm.deviceName" disabled style="width:98%;"></el-input>
</el-form-item>
<el-form-item label="故障原因" prop="faultCause">
<el-input placeholder="请输入故障原因"
@ -608,6 +609,18 @@
<el-button @click="handleCloneSub"> </el-button>
</span>
</el-dialog>
<!-- 维修完成弹窗 -->
<el-dialog title="关闭" :visible.sync="finishVisible" :append-to-body="true" width="70%">
<el-form ref="finishForm" :model="finishForm" :rules="finishRules">
<el-form-item label="关闭原因" prop="closeReason" label-position="left" label-width="80px">
<el-input type="textarea" placeholder="请填写关闭原因" v-model="finishForm.closeReason"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="handleCancelFinish"> </el-button>
<el-button @click="handleFinishSub"> </el-button>
</span>
</el-dialog>
<!-- 报告导出页面 -->
<div id="pdfDom" style="padding: 20px;">
<requirement :detailForm="requireForm"></requirement>
@ -628,7 +641,7 @@ import { nextTick } from 'vue';
import { getDeviceList } from '@/api/device/device'
import { applyGoods } from '@/api/goodsManagement/goods'
import { getList, getDetail, editData, getDeptList, getRepairPeople, repairReject, submitReject, clone,serviceman,servicemanReceive,servicemanReject,servicemanSubmit,supervisorConfirm,supervisorReject,
servicemanRepairSubmit,serviceInvoice
servicemanRepairSubmit,serviceInvoice,serviceSubmit,sendMess
} from '@/api/operation/hand'
import { getGoodsList } from '@/api/goodsManagement/goods'
export default {
@ -645,6 +658,8 @@ export default {
return v.getTime() < new Date().getTime() - 86400000;// - 86400000
}
},
finishForm:{},
finishVisible:false,
rejectVisible: false,
rejectForm: {},
materialsData: [],
@ -854,7 +869,6 @@ export default {
mounted() {
this.role_id = this.userInfo.role_id
console.log('role_id---------->', this.role_id)
this.getDeviceList()
getRepairPeople({ isRepair: this.role_id == '1839537055389515777' ? true : false }).then(res => {
this.repairPersonList = res.data.data
})
@ -879,8 +893,11 @@ export default {
}
},
methods: {
getDeviceList(){
getDeviceList({current:1,size:100}).then(res =>{
changeDevice(val){
this.repairForm.deviceName = this.deviceList.find(item => item.id == val).name
},
getDeviceList(limsId){
getDeviceList({current:1,size:100,limsId:limsId}).then(res =>{
this.deviceList = res.data.data.records
})
},
@ -1049,7 +1066,9 @@ export default {
this.dialogType = 'repair'
this.repairForm.errorVideo = res.data.data.videoAttaches.length > 0 ? res.data.data.videoAttaches[0].link : ''
this.repairForm.errorImg = res.data.data.picAttaches.map(item => { return { name: item.originalName, url: item.link } })
this.repairForm.deviceId = this.repairForm.deviceId == -1 ? '' : this.repairForm.deviceId
this.repairForm.isNeedMaterial = (this.repairForm.status == 201 || this.repairForm.status == 401 || this.repairForm.status == 402) && this.repairForm.isNeedMaterial == -1 ? '' : this.repairForm.isNeedMaterial
this.getDeviceList(res.data.data.createDept)
if (this.repairForm.isNeedMaterial != '') {
this.tableData = []
this.repairForm.materials.map(item => {
@ -1118,20 +1137,28 @@ export default {
},
//
handleRepairFinish(row){
this.$confirm('请确认当前工单是否维修完成?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
servicemanRepairSubmit({id:row.id}).then(res =>{
if(res.data.code == 200){
this.$message.success('维修完成')
this.onLoad()
}
})
}).catch(() =>{
if(row.status == 401){
this.finishVisible = true
this.finishForm = {
id:row.id
}
}else{
this.$confirm('请确认当前工单是否维修完成?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
servicemanRepairSubmit({id:row.id}).then(res =>{
if(res.data.code == 200){
this.$message.success('维修完成')
this.onLoad()
}
})
}).catch(() =>{
})
})
}
},
async getProductList(val) {
let data = await getGoodsList({
@ -1356,13 +1383,31 @@ export default {
this.cloneForm = {}
this.cloneVisible = false
},
handleCancelFinish(){
this.finishForm = {}
this.finishVisible = false
},
handleFinishSub(){
let query = {
id: this.finishForm.id,
closeReason: this.finishForm.closeReason,
}
servicemanRepairSubmit(query).then(res =>{
if (res.data.code == 200) {
this.$message.success('关闭成功')
this.finishForm = {}
this.finishVisible = false
this.onLoad()
}
})
},
//
handleCloneSub() {
let query = {
id: this.cloneForm.id,
closeReason: this.cloneForm.reason,
}
clone(query).then(res => {
serviceSubmit(query).then(res => {
if (res.data.code == 200) {
this.$message.success('关闭成功')
this.cloneForm = {}
@ -1471,12 +1516,16 @@ export default {
processMethod: this.repairForm.processMethod,
isNeedMaterial: this.repairForm.isNeedMaterial,
deviceId:this.repairForm.deviceId,
deviceName:this.repairForm.deviceName,
materials: data
}
console.log('query---------->', query)
editData(query).then(res => {
if (res.data.code == 200) {
servicemanSubmit({id:this.repairForm.id}).then(res =>{
servicemanSubmit({id:this.repairForm.id,
deviceId:this.repairForm.deviceId,
deviceName:this.repairForm.deviceName,
}).then(res =>{
this.$message.success("提交成功")
this.repairVisible = false
this.onLoad()
@ -1493,9 +1542,14 @@ export default {
}
editData(query).then(res => {
if (res.data.code == 200) {
this.$message.success("提交成功")
this.repairVisible = false
this.onLoad()
servicemanSubmit({id:this.repairForm.id,
deviceId:this.repairForm.deviceId,
deviceName:this.repairForm.deviceName,
}).then(res =>{
this.$message.success("提交成功")
this.repairVisible = false
this.onLoad()
})
}
})
}

@ -34,11 +34,11 @@
">
{{
row.runStatus == 0
? "关机"
? ""
: row.runStatus == 1
? "运行中"
: row.runStatus == 2
? '报警中'
? '故障中'
: ""
}}
</el-tag>
@ -360,11 +360,7 @@ export default {
value: "1",
},
{
label: "关机",
value: "0",
},
{
label: "报警中",
label: "故障中",
value: "2",
}
]
@ -413,7 +409,7 @@ export default {
res.data.data.map(item => {
firstNode.push({
value: item.id,
label: item.fullName,
label: item.title,
leaf: level >= 2
})
})
@ -628,7 +624,7 @@ export default {
//
handleAdd() {
this.dialogTitle = '设备新增'
this.addForm = { position: { node: undefined, data: {} } }
this.addForm = { position: { node: undefined, data: {} },isWarran:false }
this.viewType = 'add'
this.tableData = []
this.fileList = []
@ -658,6 +654,7 @@ export default {
this.addForm.requirement = this.tableData.length > 0 ? this.tableData.map(item => item.craft).join(';') : ''
this.addForm.cycle = this.tableData.length > 0 ? this.tableData.find(item => item.period).period : ''
this.addForm.startTime = this.tableData.length > 0 ? this.tableData.find(item => item.startTime).startTime : ''
this.addForm.isWarran = this.addForm.isWarran == 0 ? true : false
this.dialogTitle = '设备查看'
this.dialogVisible = true
this.addForm.isMaintain = res.data.data.isMaintain//
@ -715,6 +712,7 @@ export default {
cycle: this.tableData.length > 0 ? this.tableData.find(item => item.period).period : '',
startTime: this.tableData.length > 0 ? this.tableData.find(item => item.startTime).startTime : ''
}
this.addForm.isWarran = this.addForm.isWarran == 0 ? true : false
this.dialogTitle = '设备编辑'
this.dialogVisible = true
})
@ -797,26 +795,26 @@ export default {
floorId: this.addForm.lab[1], //id
roomId: this.addForm.lab[2], //id
brand:this.addForm.brand,//
isWarran:this.addForm.isWarran
isWarran:this.addForm.isWarran ? 0 : 1
}
console.log('query----------------->',query)
// if (this.viewType == 'add') {
// addDevice(query).then(res => {
// if (res.data.code == 200) {
// this.$message.success('!')
// this.dialogVisible = false
// this.onLoad()
// }
// })
// } else if (this.viewType == 'edit') {
// editDevice(query).then(res => {
// if (res.data.code == 200) {
// this.$message.success('!')
// this.dialogVisible = false
// this.onLoad()
// }
// })
// }
if (this.viewType == 'add') {
addDevice(query).then(res => {
if (res.data.code == 200) {
this.$message.success('新增成功!')
this.dialogVisible = false
this.onLoad()
}
})
} else if (this.viewType == 'edit') {
editDevice(query).then(res => {
if (res.data.code == 200) {
this.$message.success('修改成功!')
this.dialogVisible = false
this.onLoad()
}
})
}
}
})
},

@ -42,7 +42,6 @@
</addDialog>
<span slot="footer" class="dialog-footer">
<el-button @click="handleCancel"> </el-button>
<el-button v-show="dialogTitle != '查看'" @click="handleSave"> </el-button>
<el-button v-show="dialogTitle != '查看'" type="primary" @click="handleConfirm"> </el-button>
</span>
</el-dialog>

@ -82,7 +82,7 @@
<el-button v-show="row.status == 200 || row.status == 100" @click="handleEdit(row)">编辑</el-button>
<el-button v-show="row.status == 200 || row.status == 100" @click="handleSubmit(row)">提交</el-button>
<el-button v-show="row.status == 301" @click="confirmOrder(row)">确认</el-button>
<el-button v-show="row.status == 403 || row.status == 20" @click="handleEvaluate(row)">评价</el-button>
<el-button v-show="row.status == 403 || row.status == 202" @click="handleEvaluate(row)">评价</el-button>
<el-button @click="handleExport(row)">导出</el-button>
</template>
</avue-crud>
@ -153,7 +153,7 @@
</el-date-picker>
</el-form-item>
</div>
<div v-show="rowStatus == 20 && detailForm.closeReason != ''">
<div v-show="rowStatus == 202 && detailForm.closeReason != ''">
<div style="
color: #101010;
font-size: 20px;
@ -163,10 +163,10 @@
处理情况
</div>
<el-form-item label="关闭原因">
<el-input type="textarea" v-model="detailForm.closeReason" disabled></el-input>
<el-input type="textarea" v-model="detailForm.closeReason" disabled style="width:98%;"></el-input>
</el-form-item>
</div>
<div v-show="rowStatus != 0 && rowStatus != 20 && detailForm.closeReason == ''">
<div v-show="rowStatus != 101 && rowStatus != 100 && rowStatus != 202 && detailForm.closeReason == ''">
<div style="
color: #101010;
font-size: 20px;
@ -185,7 +185,7 @@
</el-form-item>
</div>
<div
v-show="rowStatus != 0 && rowStatus != 20 && rowStatus != 1 && rowStatus != 2 && rowStatus != 3 && detailForm.closeReason == ''">
v-show="rowStatus != 100 && rowStatus != 202 && rowStatus != 101 && rowStatus != 401 && rowStatus != 402 && detailForm.closeReason == ''">
<div style="
color: #101010;
font-size: 20px;
@ -318,7 +318,7 @@
<div v-show="(rowStatus == 403 && detailForm.approveResult1 == 0)"></div>
<!-- || (rowStatus == 20 || isEvalute) || rowStatus == 7 || rowStatus == 8 || rowStatus == 9" -->
<div
v-show="((rowStatus == 403 || isEvalute ) && detailForm.approveResult1 == 1) || rowStatus == 104 || rowStatus == 203">
v-show="((rowStatus == 403 || isEvalute ) && detailForm.approveResult1 == 1) || rowStatus == 104 || rowStatus == 203 || rowStatus == 202">
<div style="
color: #101010;
font-size: 20px;
@ -398,7 +398,7 @@
</div>
</div>
<div
v-show="((rowStatus == 6 || isEvalute) && detailForm.approveResult1 == 1) || rowStatus == 104 || rowStatus == 203">
v-show="((rowStatus == 6 || isEvalute) && detailForm.approveResult1 == 1) || rowStatus == 104 || rowStatus == 203 || rowStatus == 202">
<div style="
color: #101010;
font-size: 20px;

@ -647,6 +647,7 @@ export default {
var myChart = this.$echarts.init(document.getElementById('bar_echart'));
var option = {
tooltip: {
trigger: 'axis',
transitionDuration: 0,//
},
legend: { //
@ -748,6 +749,7 @@ export default {
var myChart = this.$echarts.init(document.getElementById('unitCharts'));
var option = {
tooltip: {
trigger: 'axis',
transitionDuration: 0,//
},
legend: { //
@ -789,6 +791,14 @@ export default {
tooltip: {
trigger: 'axis',
transitionDuration: 0,//
formatter: params => {
console.log('params',params)
let rander = params.map(item => `<div>${item.marker}${item.seriesName}: ${item.seriesType !== "line" ? item.value : item.value != '' ? item.value + "%" : '-'}</div>` ).join('')
return `
<div>${params[0].axisValue}</div>
${rander}
`
}
},
legend: { //
data: ['维修数量','好评率'],
@ -813,9 +823,9 @@ export default {
},
{
type: 'value',
name: '好评率',
name: '好评率(%)',
min: 0,
max: 100,
max: 100
}
],
series: [
@ -903,10 +913,10 @@ export default {
},
legend: {
type: 'scroll',
left: 'center',
top: 0,
right:5,
orient: 'vertical',
},
series: [
{
type: 'pie',
@ -1223,16 +1233,16 @@ export default {
.tablebox_item_warp {
height: 90%;
margin-top: 15px;
overflow: hidden;
.left_item {
width: 94%;
height: 128px;
background: #fff;
border: 1px solid #EBEEF5;
border-radius: 10px;
margin: 0 auto;
margin-top: 20px;
margin-bottom: 20px;
display: flex;
justify-content: space-between;

Loading…
Cancel
Save