zhang_li
10 months ago
8 changed files with 1646 additions and 3 deletions
@ -0,0 +1,67 @@ |
|||||
|
import request from '@/utils/request' |
||||
|
|
||||
|
|
||||
|
// 添加工单
|
||||
|
export function onkeepOrderCreate(data) { |
||||
|
return request({ |
||||
|
url: '/eam/device-maintain-order-main/create', |
||||
|
'method': 'POST', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
// 编辑工单
|
||||
|
export function onkeepOrderUpdate(data) { |
||||
|
return request({ |
||||
|
url: '/eam/device-maintain-order-main/update', |
||||
|
'method': 'PUT', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
// 报修列表
|
||||
|
export function onkeepOrderPage(params) { |
||||
|
return request({ |
||||
|
url: '/eam/device-maintain-order-main/getAppPage', |
||||
|
'method': 'GET', |
||||
|
params |
||||
|
}) |
||||
|
} |
||||
|
// 操作工单
|
||||
|
export function orderClick(params) { |
||||
|
return request({ |
||||
|
url: '/eam/device-maintain-order-main/onClick', |
||||
|
'method': 'GET', |
||||
|
params |
||||
|
}) |
||||
|
} |
||||
|
// 添加维修工单子项维修内容
|
||||
|
export function onkeepOrderDetailCreate(data) { |
||||
|
return request({ |
||||
|
url: '/eam/device-maintain-order-detail/create', |
||||
|
'method': 'POST', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
// 编辑维修工单子项维修内容
|
||||
|
export function onkeepOrderDetailUpdate(data) { |
||||
|
return request({ |
||||
|
url: '/eam/device-maintain-order-detail/update', |
||||
|
'method': 'PUT', |
||||
|
data |
||||
|
}) |
||||
|
} |
||||
|
// 获得维修工单子列表
|
||||
|
export function onkeepOrderDetailList(params) { |
||||
|
return request({ |
||||
|
url: '/eam/device-maintain-order-detail/selectListByNumber', |
||||
|
'method': 'GET', |
||||
|
params |
||||
|
}) |
||||
|
} |
||||
|
// 删除维修工单子
|
||||
|
export function onkeepOrderDetailDelete(id) { |
||||
|
return request({ |
||||
|
url: '/eam/device-maintain-order-detail/delete?id='+id, |
||||
|
'method': 'DELETE' |
||||
|
}) |
||||
|
} |
||||
|
|
@ -0,0 +1,629 @@ |
|||||
|
<template> |
||||
|
<!-- 添加维修工单 --> |
||||
|
<view class="add-form-container"> |
||||
|
<u-form :model="form" ref="form1" label-width="160rpx"> |
||||
|
<u-form-item label="检修描述" prop="name" required> |
||||
|
<u-input v-model="form.name" placeholder="请输入检修描述" maxlength="50"/> |
||||
|
</u-form-item> |
||||
|
<u-form-item label="预估人数" prop="peoples" required> |
||||
|
<u-input v-model="form.peoples" type="number" placeholder="请输入预估人数" maxlength="50"/> |
||||
|
</u-form-item> |
||||
|
<u-form-item label="预估分钟" prop="estimatedMinutes" required> |
||||
|
<u-input v-model="form.estimatedMinutes" type="number" placeholder="请输入预估分钟" maxlength="50"/> |
||||
|
</u-form-item> |
||||
|
<u-form-item label="实际分钟" prop="actualMinutes" required> |
||||
|
<u-input v-model="form.actualMinutes" type="number" placeholder="请输入实际分钟" maxlength="50"/> |
||||
|
</u-form-item> |
||||
|
<u-form-item label="责任人" prop="chargePeoples" required> |
||||
|
<view class="select" @click="openSelecUser"> |
||||
|
<view class="input" v-if='form.chargePeoples'> |
||||
|
{{selectFormatCheck(form.chargePeoples,selecUserList)}} |
||||
|
</view> |
||||
|
<view class="placeholder" v-else> |
||||
|
请选择维修人员 |
||||
|
</view> |
||||
|
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon> |
||||
|
</view> |
||||
|
</u-form-item> |
||||
|
<u-form-item label="完成情况" prop="status" required> |
||||
|
<view class="select" @click="openSingleColumn('status',form.status,jxDetailsStatus,'form')"> |
||||
|
<view class="input" v-if='form.status'> |
||||
|
{{selectFormat(form.status,jxDetailsStatus)}} |
||||
|
</view> |
||||
|
<view class="placeholder" v-else> |
||||
|
{{`请选择完成情况`}} |
||||
|
</view> |
||||
|
<u-icon name="arrow-right" color="#aaaaaa" size="28" v-if="!form.id"></u-icon> |
||||
|
</view> |
||||
|
</u-form-item> |
||||
|
<u-form-item label="完成时间" prop="completionTime" required v-if='form.status == 0'> |
||||
|
<view class="select" @click="openDatetime('completionTime',formatDate,params,formatValue)"> |
||||
|
<view class="input" v-if='formatDate'> |
||||
|
{{formatDate}} |
||||
|
</view> |
||||
|
<view class="placeholder" v-else> |
||||
|
{{`请选择完成时间`}} |
||||
|
</view> |
||||
|
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon> |
||||
|
</view> |
||||
|
</u-form-item> |
||||
|
<u-form-item label="工程师确认" prop="engineer"> |
||||
|
<u-input v-model="form.engineer" placeholder="请输入工程师确认" maxlength="50"/> |
||||
|
</u-form-item> |
||||
|
|
||||
|
<u-form-item label="未完成原因" prop="uncompleted" required v-if='form.status == 1'> |
||||
|
<u-input type='textarea' v-model="form.uncompleted" placeholder="请输入未完成原因" maxlength="200"/> |
||||
|
</u-form-item> |
||||
|
</u-form> |
||||
|
|
||||
|
<view class="list"> |
||||
|
<view class="title"> |
||||
|
<span>*</span>备件 |
||||
|
</view> |
||||
|
<view class="item " v-for="(item,index) in form.itemNumbers" :key="index"> |
||||
|
<view class="item-box"> |
||||
|
<view class="spare-title"> |
||||
|
<view class="title-txt"> |
||||
|
{{selectFormat(item.number,sparePartsList)}} |
||||
|
</view> |
||||
|
</view> |
||||
|
<u-row gutter="16"> |
||||
|
<u-col :span="12"> |
||||
|
<view class="dec"> |
||||
|
<view class=""> |
||||
|
数量:{{item.qty}} |
||||
|
</view> |
||||
|
</view> |
||||
|
</u-col> |
||||
|
</u-row> |
||||
|
</view> |
||||
|
<u-icon name="minus-circle" color="#aaaaaa" size="60" @click="delSpareParts(index)"></u-icon> |
||||
|
</view> |
||||
|
<view class="add-btn"> |
||||
|
<u-button type="primary" @click="open"><u-icon name="plus-circle" color="#ffffff" |
||||
|
size="36"></u-icon>添加备件</u-button> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="footer"> |
||||
|
<view class="btns"> |
||||
|
<button class="reset" @click="reset">重置</button> |
||||
|
<button class="sure" @click="submit" :loading='loading' :disabled='loading'>确定</button> |
||||
|
</view> |
||||
|
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> |
||||
|
</view> |
||||
|
<!-- 添加备件 --> |
||||
|
<u-popup v-model="isPopupShow" mode="center" border-radius="14"> |
||||
|
<view class="popup-title">添加备件</view> |
||||
|
<view class="popup"> |
||||
|
<u-form :model="form1" ref="form1" label-width="160rpx"> |
||||
|
<u-form-item :label="`备件`" prop="number" required> |
||||
|
<view class="select" @click="openSingleColumn('number',form1.number,sparePartsList,'form1')"> |
||||
|
<view class="input" v-if='form1.number'> |
||||
|
{{selectFormat(form1.number,sparePartsList)}} |
||||
|
</view> |
||||
|
<view class="placeholder" v-else> |
||||
|
请选择备件 |
||||
|
</view> |
||||
|
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon> |
||||
|
</view> |
||||
|
</u-form-item> |
||||
|
<u-form-item label="数量" prop="qty" required> |
||||
|
<u-input v-model="form1.qty" type="number" placeholder="请输入故障描述" /> |
||||
|
</u-form-item> |
||||
|
</u-form> |
||||
|
</view> |
||||
|
<view class="popup-footer"> |
||||
|
<view @click="isPopupShow = false">取消</view> |
||||
|
<view class="sure" @click="addSpare">确认</view> |
||||
|
</view> |
||||
|
</u-popup> |
||||
|
<!-- 选择维修人员 --> |
||||
|
<u-popup v-model="isShowSelecUser" mode="center" border-radius="14"> |
||||
|
<view class="popup-title">选择维修人员</view> |
||||
|
<view class="popup"> |
||||
|
<u-checkbox-group @change="checkboxGroupChange"> |
||||
|
<u-checkbox v-model="item.checked" v-for="(item, index) in selecUserList" :key="index" |
||||
|
:name="item.id">{{item.name}}</u-checkbox> |
||||
|
</u-checkbox-group> |
||||
|
|
||||
|
</view> |
||||
|
<view class="popup-footer"> |
||||
|
<view @click="isShowSelecUser = false">取消</view> |
||||
|
<view class="sure" @click="chooseUser">确认</view> |
||||
|
</view> |
||||
|
</u-popup> |
||||
|
<u-select v-model="singleColumnShow" mode="single-column" :default-value='singleColumnDefaultValue' |
||||
|
:list="singleColumnList" @confirm="chooseSingleColumn"></u-select> |
||||
|
<u-picker mode="time" v-model="datetimeShow" :default-time='datetimeDefaultValue' :params="params" @confirm='chooseDatetime'></u-picker> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import * as overhaulOrderApi from "@/api/overhaulOrder.js" |
||||
|
import * as sparePartsApi from "@/api/spareParts.js" |
||||
|
import * as deptApi from "@/api/dept.js" |
||||
|
import * as dictApi from "@/api/dict.js" |
||||
|
|
||||
|
|
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
loading: false, |
||||
|
type: "", |
||||
|
// 备件弹窗 |
||||
|
isPopupShow: false, |
||||
|
sparePartsList: [], |
||||
|
// 下拉框字段 |
||||
|
from:'',//下拉选 是主还是子 |
||||
|
singleColumnShow: false, |
||||
|
singleColumnDefaultValue: [], |
||||
|
singleColumnList: [], |
||||
|
field: '', |
||||
|
// 负责人员 |
||||
|
selecUserList: [], //负责人员 |
||||
|
isShowSelecUser: false, |
||||
|
jxDetailsStatus:[],//完成情况 |
||||
|
form: { |
||||
|
number: '', |
||||
|
name:'', |
||||
|
peoples: '', |
||||
|
estimatedMinutes: '', |
||||
|
actualMinutes: '', |
||||
|
chargePeoples: '', |
||||
|
status: '', |
||||
|
completionTime: '', |
||||
|
engineer: '', |
||||
|
uncompleted: '', |
||||
|
itemNumbers:[] |
||||
|
}, |
||||
|
formatDate:'',//日期展示 |
||||
|
form1: { |
||||
|
number: "", |
||||
|
qty: '' |
||||
|
}, |
||||
|
|
||||
|
// 时间参数 |
||||
|
datetimeShow:false, |
||||
|
params:{ |
||||
|
year: true, |
||||
|
month: true, |
||||
|
day: true, |
||||
|
hour: true, |
||||
|
minute: true, |
||||
|
second: true, |
||||
|
timestamp: true, |
||||
|
}, |
||||
|
datetimeDefaultValue:'', |
||||
|
formatValue:'YYYY-MM-DD hh:mm:ss' |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
// 触发提交表单 |
||||
|
submit() { |
||||
|
// 校验 |
||||
|
if (!this.form.name) { |
||||
|
this.$modal.showToast('请输入检修描述') |
||||
|
return; |
||||
|
} |
||||
|
if (!this.form.peoples) { |
||||
|
this.$modal.showToast('请输入预估人数') |
||||
|
return; |
||||
|
} |
||||
|
if (this.form.peoples>100) { |
||||
|
this.$modal.showToast('预估人数不得超出100') |
||||
|
return; |
||||
|
} |
||||
|
if (!this.form.estimatedMinutes) { |
||||
|
this.$modal.showToast(`请输入预估分钟`) |
||||
|
return; |
||||
|
} |
||||
|
if (!this.form.actualMinutes) { |
||||
|
this.$modal.showToast('请输入实际分钟') |
||||
|
return; |
||||
|
} |
||||
|
if (!this.form.chargePeoples) { |
||||
|
this.$modal.showToast('请选择负责人') |
||||
|
return; |
||||
|
} |
||||
|
if (!this.form.status) { |
||||
|
this.$modal.showToast('请选择完成情况') |
||||
|
return; |
||||
|
} |
||||
|
if(this.form.status == 0){ |
||||
|
if (!this.form.completionTime) { |
||||
|
this.$modal.showToast('请选择完成时间') |
||||
|
return; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
// if (!this.form.engineer) { |
||||
|
// this.$modal.showToast('请输入工程师') |
||||
|
// return; |
||||
|
// } |
||||
|
if(this.form.status == 1){ |
||||
|
if (!this.form.uncompleted) { |
||||
|
this.$modal.showToast('请输入未完成原因') |
||||
|
return; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
if (this.form.itemNumbers.length === 0) { |
||||
|
this.$modal.showToast('请选择备件') |
||||
|
return; |
||||
|
} |
||||
|
if (this.form.id) { |
||||
|
this.$modal.confirm('是否修改检修内容').then(() => { |
||||
|
this.$modal.loading('加载中') |
||||
|
this.loading = true |
||||
|
overhaulOrderApi.overhaulOrderDetailUpdate(this.form).then((res) => { |
||||
|
this.$modal.closeLoading() |
||||
|
if (res.data) { |
||||
|
this.$modal.showToast('修改成功') |
||||
|
setTimeout(() => { |
||||
|
this.$tab.navigateBack() |
||||
|
this.loading = false |
||||
|
}, 1500) |
||||
|
} else { |
||||
|
this.$modal.showToast('添加失败') |
||||
|
this.loading = false |
||||
|
} |
||||
|
}).catch(() => { |
||||
|
this.$modal.closeLoading() |
||||
|
this.loading = false |
||||
|
}) |
||||
|
}) |
||||
|
} else { |
||||
|
this.$modal.confirm('是否添加检修内容').then(() => { |
||||
|
this.$modal.loading('加载中') |
||||
|
this.loading = true |
||||
|
overhaulOrderApi.overhaulOrderDetailCreate(this.form).then((res) => { |
||||
|
this.$modal.closeLoading() |
||||
|
if (res.data) { |
||||
|
this.$modal.showToast('添加成功') |
||||
|
setTimeout(() => { |
||||
|
this.$tab.navigateBack() |
||||
|
this.loading = false |
||||
|
}, 1500) |
||||
|
} else { |
||||
|
this.$modal.showToast('添加失败') |
||||
|
this.loading = false |
||||
|
} |
||||
|
}).catch(() => { |
||||
|
this.$modal.closeLoading() |
||||
|
this.loading = false |
||||
|
}) |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
}, |
||||
|
// 重置 |
||||
|
reset() { |
||||
|
if (this.form.id) { |
||||
|
this.form.classes = ''; |
||||
|
this.form.faultType = '' |
||||
|
} else { |
||||
|
|
||||
|
this.form = {} |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
// 获取责任人员列表 |
||||
|
async getSelecUser() { |
||||
|
let data = { |
||||
|
classType: this.type, |
||||
|
factoryAreaNumber: this.factoryAreaNumber, |
||||
|
flag: 0 |
||||
|
} |
||||
|
let arr = [] |
||||
|
if (this.form.chargePeoples) { |
||||
|
arr = this.form.chargePeoples.split(',') |
||||
|
} |
||||
|
await deptApi.getSelecUser(data).then(res => { |
||||
|
res.data.forEach(item => { |
||||
|
item.checked = false |
||||
|
arr.forEach(cur => { |
||||
|
if (item.id == cur) { |
||||
|
item.checked = true |
||||
|
} |
||||
|
}) |
||||
|
}) |
||||
|
this.selecUserList = res.data |
||||
|
}) |
||||
|
}, |
||||
|
// 打开人员列表 |
||||
|
openSelecUser() { |
||||
|
this.isShowSelecUser = true |
||||
|
}, |
||||
|
checkboxGroupChange(e) { |
||||
|
this.chooseUserList = e |
||||
|
}, |
||||
|
// 多选选择框回显 |
||||
|
selectFormatCheck(val, array) { |
||||
|
const arr = val.split(',').map(parseFloat) |
||||
|
let str = array.filter(item => arr.includes(item.id)).map(item => item.name).join(',') |
||||
|
return str |
||||
|
}, |
||||
|
// 选择人员 |
||||
|
chooseUser() { |
||||
|
this.form.chargePeoples = this.chooseUserList.join(',') |
||||
|
this.isShowSelecUser = false |
||||
|
}, |
||||
|
selectFormat(val, array) { |
||||
|
let str = array.filter(item => item.value == val)[0].label |
||||
|
return str |
||||
|
}, |
||||
|
// 单列模式 |
||||
|
openSingleColumn(field, val, list,from) { |
||||
|
if (field == 'deviceNumber' && this.form.id) return; |
||||
|
this.from = from |
||||
|
this.singleColumnList = list |
||||
|
this.field = field |
||||
|
if (val) { |
||||
|
this.singleColumnDefaultValue = [list.findIndex(item => item.value == val)] |
||||
|
} else { |
||||
|
this.singleColumnDefaultValue = [] |
||||
|
} |
||||
|
this.singleColumnShow = true |
||||
|
}, |
||||
|
// 单列模式点击确定之后 |
||||
|
chooseSingleColumn(e) { |
||||
|
this[this.from][this.field] = e[0].value |
||||
|
this.singleColumnShow = false |
||||
|
this.$emit('singleColumn', this.field, this.form[this.field]) |
||||
|
this.$forceUpdate() |
||||
|
}, |
||||
|
// 获取备件列表 |
||||
|
async getSparePartsList() { |
||||
|
await sparePartsApi.getSparePartsList().then(res => { |
||||
|
res.data.map(item => { |
||||
|
item.value = item.number |
||||
|
item.label = item.name |
||||
|
}) |
||||
|
this.sparePartsList = res.data |
||||
|
}) |
||||
|
}, |
||||
|
// 打开弹窗 |
||||
|
open() { |
||||
|
this.form1 = { |
||||
|
number: "", |
||||
|
qty: '' |
||||
|
} |
||||
|
this.isPopupShow = true |
||||
|
}, |
||||
|
// 添加配件 |
||||
|
addSpare() { |
||||
|
if (!this.form1.number) { |
||||
|
this.$modal.showToast('请选择备件') |
||||
|
return; |
||||
|
} |
||||
|
if (!this.form1.qty) { |
||||
|
this.$modal.showToast('请输入数量') |
||||
|
return; |
||||
|
} |
||||
|
if (this.form.itemNumbers && this.form.itemNumbers.length > 0) { |
||||
|
let arr = this.form.itemNumbers.filter(item => item.number == this.form1.number) |
||||
|
if (arr && arr.length > 0) { |
||||
|
this.$modal.showToast('该备件已添加') |
||||
|
return; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
this.form.itemNumbers.push(this.form1) |
||||
|
this.isPopupShow = false |
||||
|
}, |
||||
|
// 删除备件 |
||||
|
delSpareParts(index) { |
||||
|
this.form.itemNumbers.splice(index, 1) |
||||
|
}, |
||||
|
openDatetime(field,val,params,formatValue){ |
||||
|
this.params = params |
||||
|
this.formatValue =formatValue |
||||
|
this.field = field |
||||
|
this.form[this.field] = val ? val :'' |
||||
|
this.datetimeDefaultValue = val ? val :this.$time.formatDate() |
||||
|
this.datetimeShow = true |
||||
|
}, |
||||
|
// 日期模式点击确定之后 |
||||
|
chooseDatetime(e){ |
||||
|
let array1 = [] |
||||
|
let array2 = [] |
||||
|
if(this.formatValue.indexOf('YYYY')>-1){ |
||||
|
array1.push(e.year) |
||||
|
} |
||||
|
if(this.formatValue.indexOf('MM')>-1){ |
||||
|
array1.push(e.month) |
||||
|
} |
||||
|
if(this.formatValue.indexOf('DD')>-1){ |
||||
|
array1.push(e.day) |
||||
|
} |
||||
|
if(this.formatValue.indexOf('hh')>-1){ |
||||
|
array2.push(e.hour) |
||||
|
} |
||||
|
if(this.formatValue.indexOf('mm')>-1){ |
||||
|
array2.push(e.minute) |
||||
|
} |
||||
|
if(this.formatValue.indexOf('ss')>-1){ |
||||
|
array2.push(e.second) |
||||
|
} |
||||
|
let str = array1.join('-') + ' ' + array2.join(':') |
||||
|
this.formatDate = str |
||||
|
this.form[this.field] = e.timestamp |
||||
|
}, |
||||
|
|
||||
|
|
||||
|
}, |
||||
|
async onLoad(option) { |
||||
|
if (option.type) this.type = option.type; |
||||
|
if (option.factoryAreaNumber) this.factoryAreaNumber = option.factoryAreaNumber; |
||||
|
if (option.number) this.form.number = option.number; |
||||
|
if (option.data && JSON.parse(decodeURIComponent(option.data)) && JSON.parse(decodeURIComponent(option |
||||
|
.data)).id) { |
||||
|
this.form = JSON.parse(decodeURIComponent(option.data)) |
||||
|
this.$set(this.form,'itemNumbers',this.form.items) |
||||
|
this.formatDate = this.$time.formatDate(this.form.completionTime) |
||||
|
|
||||
|
}; |
||||
|
this.jxDetailsStatus = await dictApi.getDict('jx_details_status') |
||||
|
|
||||
|
await this.getSelecUser() |
||||
|
await this.getSparePartsList() |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.add-form-container { |
||||
|
min-height: calc(100vh - 140rpx); |
||||
|
background: white; |
||||
|
padding: 0px 30rpx 140rpx; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
.footer { |
||||
|
position: fixed; |
||||
|
bottom: 0px; |
||||
|
left: 0px; |
||||
|
width: 100%; |
||||
|
z-index: 22; |
||||
|
} |
||||
|
|
||||
|
.btns { |
||||
|
display: flex; |
||||
|
|
||||
|
|
||||
|
button { |
||||
|
flex: 1; |
||||
|
} |
||||
|
|
||||
|
.sure { |
||||
|
background: #409eff; |
||||
|
color: white; |
||||
|
border-radius: 0px; |
||||
|
|
||||
|
&::after { |
||||
|
border: 1px solid #409eff; |
||||
|
border-radius: 0px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.reset { |
||||
|
background: #F5F5F5; |
||||
|
border-radius: 0px; |
||||
|
|
||||
|
&::after { |
||||
|
border-radius: 0px; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.right-button { |
||||
|
background: #409eff; |
||||
|
color: white; |
||||
|
padding: 0rpx 30rpx; |
||||
|
border-radius: 16rpx; |
||||
|
text-align: center; |
||||
|
font-size: 28rpx; |
||||
|
} |
||||
|
|
||||
|
.select { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
height: 72rpx; |
||||
|
width: 100%; |
||||
|
|
||||
|
.input { |
||||
|
flex: 1; |
||||
|
font-size: 28rpx; |
||||
|
color: #000000; |
||||
|
} |
||||
|
|
||||
|
.placeholder { |
||||
|
flex: 1; |
||||
|
font-size: 28rpx; |
||||
|
color: rgb(192, 196, 204); |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.title { |
||||
|
padding: 32rpx 0px; |
||||
|
position: relative; |
||||
|
|
||||
|
span { |
||||
|
position: absolute; |
||||
|
left: -16rpx; |
||||
|
color: #fa3534; |
||||
|
padding-top: 6rpx; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.list { |
||||
|
.item { |
||||
|
display: flex; |
||||
|
margin-bottom: 20rpx; |
||||
|
|
||||
|
.item-box { |
||||
|
background: #F5F5F5; |
||||
|
border-radius: 12rpx; |
||||
|
flex: 1; |
||||
|
width: 0rpx; |
||||
|
} |
||||
|
|
||||
|
.spare-title { |
||||
|
padding: 20rpx 30rpx; |
||||
|
border-bottom: 1px solid #e4e4e4; |
||||
|
|
||||
|
.title-txt { |
||||
|
color: #409eff; |
||||
|
font-size: 30rpx; |
||||
|
font-weight: bold; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.dec { |
||||
|
color: #9c9c9c; |
||||
|
padding: 20rpx 30rpx 20rpx; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.add-btn { |
||||
|
display: flex; |
||||
|
justify-content: flex-start; |
||||
|
align-items: center; |
||||
|
} |
||||
|
|
||||
|
.popup-title { |
||||
|
text-align: center; |
||||
|
font-size: 32rpx; |
||||
|
font-weight: bold; |
||||
|
color: #409eff; |
||||
|
padding: 30rpx 30rpx 0px |
||||
|
} |
||||
|
|
||||
|
.popup { |
||||
|
width: 600rpx; |
||||
|
padding: 30rpx 60rpx 30rpx; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
.popup-footer { |
||||
|
display: flex; |
||||
|
border-top: 1px solid #e4e4e4; |
||||
|
|
||||
|
view { |
||||
|
line-height: 100rpx; |
||||
|
flex: 1; |
||||
|
text-align: center; |
||||
|
|
||||
|
&.sure { |
||||
|
color: #409eff; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
::v-deep .u-checkbox-group { |
||||
|
display: grid !important; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,478 @@ |
|||||
|
<template> |
||||
|
<!-- 详情 --> |
||||
|
<view class="detail-container"> |
||||
|
<view class="info"> |
||||
|
<view class="title"> |
||||
|
<view>检修工单</view> |
||||
|
</view> |
||||
|
<view class="dec"> |
||||
|
<view class="dec-item"> |
||||
|
<view>工单单号:</view> |
||||
|
<view>{{data.number}}</view> |
||||
|
</view> |
||||
|
<view class="dec-item"> |
||||
|
<view>保养计划单号:</view> |
||||
|
<view>{{data.planNumber}}</view> |
||||
|
</view> |
||||
|
<view class="dec-item"> |
||||
|
<view>故障类型:</view> |
||||
|
<view>{{data.faultTypeName}}</view> |
||||
|
</view> |
||||
|
<view class="dec-item"> |
||||
|
<view>维修工:</view> |
||||
|
<view>{{data.maintenance}}</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="info" style="padding-bottom: 130rpx;"> |
||||
|
<view class="tab"> |
||||
|
<u-tabs :list="list" :is-scroll="false" bar-height="2" bar-width="250" v-model="current" |
||||
|
@change="change"></u-tabs> |
||||
|
</view> |
||||
|
|
||||
|
<view> |
||||
|
<view class="title"> |
||||
|
<view>{{changeItem.name}}</view> |
||||
|
</view> |
||||
|
<view class="dec" v-if="current == 0"> |
||||
|
<view class="dec-item"> |
||||
|
<view>设备编号:</view> |
||||
|
<view>{{deviceInfo.number}}</view> |
||||
|
</view> |
||||
|
<view class="dec-item"> |
||||
|
<view>设备名称:</view> |
||||
|
<view>{{deviceInfo.name}}</view> |
||||
|
</view> |
||||
|
<view class="dec-item"> |
||||
|
<view>所属厂区:</view> |
||||
|
<view>{{deviceInfo.factoryAreaName}}</view> |
||||
|
</view> |
||||
|
<view class="dec-item"> |
||||
|
<view>设备类型:</view> |
||||
|
<view>{{deviceInfo.typeName}}</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="list" v-if="current == 1"> |
||||
|
<view class="item " v-for="(item,index) in serviceList" :key="index" |
||||
|
@click="addSubForm('updata',item)"> |
||||
|
<view class="item-box"> |
||||
|
<view class="spare-title"> |
||||
|
<view class="title-txt"> |
||||
|
{{item.name}} |
||||
|
</view> |
||||
|
<u-icon name="trash" color="#aaaaaa" size="40" |
||||
|
@click.native.stop="delService(item)"></u-icon> |
||||
|
</view> |
||||
|
<view class="dec2"> |
||||
|
<view>预估人数:</view> |
||||
|
<view>{{item.peoples}}人</view> |
||||
|
</view> |
||||
|
<view class="dec2"> |
||||
|
<view>预估分钟:</view> |
||||
|
<view>{{item.estimatedMinutes}}分钟</view> |
||||
|
</view> |
||||
|
<view class="dec2"> |
||||
|
<view>实际分钟:</view> |
||||
|
<view>{{item.actualMinutes}}分钟</view> |
||||
|
</view> |
||||
|
<view class="dec2"> |
||||
|
<view>责任人:</view> |
||||
|
<view>{{item.chargePeoplesName}}</view> |
||||
|
</view> |
||||
|
<view class="dec2" > |
||||
|
<view>完成情况:</view> |
||||
|
<view>{{item.status==0?'完成':'未完成'}}</view> |
||||
|
</view> |
||||
|
<view class="dec2" v-if='item.status == 0'> |
||||
|
<view>完成时间:</view> |
||||
|
<view>{{$time.formatDate(item.completionTime)}}</view> |
||||
|
</view> |
||||
|
<view class="dec2"> |
||||
|
<view>工程师确认:</view> |
||||
|
<view>{{item.engineer}}</view> |
||||
|
</view> |
||||
|
<view class="dec2" v-if="item.status == 1"> |
||||
|
<view>未完成原因:</view> |
||||
|
<view>{{item.uncompleted}}</view> |
||||
|
</view> |
||||
|
<view class="dec2"> |
||||
|
备件: |
||||
|
</view> |
||||
|
<view class="items" v-for="(cur,key) in item.items" :key="key"> |
||||
|
<view class="items-name"> |
||||
|
{{cur.name}} |
||||
|
</view> |
||||
|
<view class="items-dec"> |
||||
|
备件编号:{{cur.number}} |
||||
|
</view> |
||||
|
<view class="items-dec"> |
||||
|
数量:{{cur.qty}} |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
<!-- <u-icon name="minus-circle" color="#aaaaaa" size="60" ></u-icon> --> |
||||
|
</view> |
||||
|
<view class="add-btn" v-if="data.status == 'PROCCED'" > |
||||
|
<u-button type="primary" @click="addSubForm('creat')"><u-icon name="plus-circle" color="#ffffff" |
||||
|
size="36"></u-icon>添加检修内容</u-button> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="footer"> |
||||
|
<view class="btns"> |
||||
|
<u-button type="primary" v-if="data.status == 'PROCCED'" @click="orderClick()" :loading='loading' |
||||
|
:disabled='loading'>完成</u-button> |
||||
|
</view> |
||||
|
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import Form from '@/components/form/index.vue' |
||||
|
import SparePartsCard from '@/components/sparePartsCard/index.vue' |
||||
|
import * as deviceApi from "@/api/device.js" |
||||
|
import * as moldApi from "@/api/mold.js" |
||||
|
import * as overhaulOrderApi from "@/api/overhaulOrder.js" |
||||
|
export default { |
||||
|
components: { |
||||
|
Form, |
||||
|
SparePartsCard |
||||
|
}, |
||||
|
data() { |
||||
|
return { |
||||
|
list: [{ |
||||
|
name: '设备信息' |
||||
|
}, { |
||||
|
name: '检修内容' |
||||
|
}], |
||||
|
current: 0, |
||||
|
changeItem: '', |
||||
|
data: '', //工单信息 |
||||
|
loading: false, |
||||
|
type: "", |
||||
|
deviceInfo: '', //设备信息 |
||||
|
serviceList: [], //维修内同列表 |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
change(index) { |
||||
|
this.current = index |
||||
|
this.changeItem = this.list[this.current] |
||||
|
}, |
||||
|
// 添加表格表单 |
||||
|
addSubForm(clickType, item) { |
||||
|
if(this.data.status == 'PENDING'){ |
||||
|
this.$modal.showToast('请先接单') |
||||
|
return |
||||
|
} |
||||
|
if (clickType == 'updata') { |
||||
|
this.$tab.navigateTo( |
||||
|
`/pages/overhaulOrder/addServiceRecord?type=${this.type}&factoryAreaNumber=${this.data.factoryAreaNumber}&number=${this.data.number}&data=${encodeURIComponent(JSON.stringify(item))}` |
||||
|
) |
||||
|
} else { |
||||
|
this.$tab.navigateTo( |
||||
|
`/pages/overhaulOrder/addServiceRecord?type=${this.type}&factoryAreaNumber=${this.data.factoryAreaNumber}&number=${this.data.number}` |
||||
|
) |
||||
|
} |
||||
|
}, |
||||
|
// 添加备件 |
||||
|
addSpare() { |
||||
|
|
||||
|
}, |
||||
|
// 取消添加备件 |
||||
|
cancle() { |
||||
|
this.isPopupShow = false |
||||
|
}, |
||||
|
// 根据设备/模具号查询信息 |
||||
|
getDetailsByNumber() { |
||||
|
const data = { |
||||
|
number: this.data.deviceNumber, |
||||
|
id: '' |
||||
|
} |
||||
|
if (this.type == 'DEVICE') { |
||||
|
deviceApi.getDeviceDetailsByNumber(data).then((res) => { |
||||
|
if (res.data) { |
||||
|
this.deviceInfo = res.data |
||||
|
} else { |
||||
|
this.$modal.showToast(`找不到该${this.type=='DEVICE'?'设备' : '模具'}`) |
||||
|
} |
||||
|
}) |
||||
|
} else if (this.type == 'MOLD') { |
||||
|
moldApi.getMoldDetailsByNumber(data).then((res) => { |
||||
|
if (res.data) { |
||||
|
this.deviceInfo = res.data |
||||
|
} else { |
||||
|
this.$modal.showToast(`找不到该${this.type=='DEVICE'?'设备' : '模具'}`) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
// APP维修工单接单、点击完成、验证 |
||||
|
orderClick() { |
||||
|
if(!this.serviceList || this.serviceList&&this.serviceList.length == 0){ |
||||
|
this.$modal.showToast('请添加检修内容') |
||||
|
return; |
||||
|
} |
||||
|
const data = { |
||||
|
// number: this.data.number, |
||||
|
// status: this.data.status, |
||||
|
id: this.data.id, |
||||
|
// requestNumber: '' |
||||
|
} |
||||
|
let tips = '是否完成' |
||||
|
this.$modal.confirm(tips).then(() => { |
||||
|
this.$modal.loading('加载中') |
||||
|
this.loading = true |
||||
|
overhaulOrderApi.orderClick(data).then((res) => { |
||||
|
if (res.data) { |
||||
|
this.$modal.showToast('操作成功') |
||||
|
setTimeout(() => { |
||||
|
this.$tab.navigateBack() |
||||
|
this.loading = false |
||||
|
}, 1500) |
||||
|
} else { |
||||
|
this.$modal.showToast('操作失败') |
||||
|
this.loading = false |
||||
|
} |
||||
|
}).catch(() => { |
||||
|
this.$modal.closeLoading() |
||||
|
this.loading = false |
||||
|
}) |
||||
|
}) |
||||
|
}, |
||||
|
// 获取维修内容列表 |
||||
|
getOverhaulOrderDetailList() { |
||||
|
overhaulOrderApi.overhaulOrderDetailList({ |
||||
|
number: this.data.number |
||||
|
}).then((res) => { |
||||
|
if (res.data) { |
||||
|
this.serviceList = res.data |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 删除维修内容 |
||||
|
delService(item) { |
||||
|
this.$modal.confirm('确定删除检修内容吗?').then(() => { |
||||
|
this.$modal.loading('加载中') |
||||
|
overhaulOrderApi.overhaulOrderDetailDelete(item.id).then((res) => { |
||||
|
this.$modal.closeLoading() |
||||
|
this.getOverhaulOrderDetailList() |
||||
|
}) |
||||
|
}) |
||||
|
|
||||
|
}, |
||||
|
// 转办 |
||||
|
transfer() { |
||||
|
this.$tab.navigateTo(`/pages/repairOrder/transfer?type=${this.type}&id=${this.data.id}`) |
||||
|
} |
||||
|
}, |
||||
|
onLoad(option) { |
||||
|
if (option.type) this.type = option.type; |
||||
|
if (option.data) { |
||||
|
this.data = JSON.parse(decodeURIComponent(option.data)) |
||||
|
|
||||
|
} |
||||
|
this.changeItem = this.list[this.current] |
||||
|
|
||||
|
|
||||
|
}, |
||||
|
onShow() { |
||||
|
this.getDetailsByNumber() |
||||
|
this.getOverhaulOrderDetailList() |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.info { |
||||
|
background: white; |
||||
|
margin-bottom: 20rpx; |
||||
|
} |
||||
|
|
||||
|
.tab { |
||||
|
border-bottom: 1px solid #e4e4e4; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
.title { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
padding: 20rpx 30rpx; |
||||
|
border-bottom: 1px solid #e4e4e4; |
||||
|
|
||||
|
view { |
||||
|
&:nth-child(1) { |
||||
|
flex: 1; |
||||
|
border-left: 10rpx solid #409eff; |
||||
|
padding-left: 20rpx; |
||||
|
font-weight: bold; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.dec { |
||||
|
padding: 30rpx; |
||||
|
|
||||
|
.dec-item { |
||||
|
padding-bottom: 30rpx; |
||||
|
display: flex; |
||||
|
|
||||
|
view { |
||||
|
&:nth-child(1) { |
||||
|
width: 200rpx; |
||||
|
} |
||||
|
|
||||
|
&:nth-child(2) { |
||||
|
color: #888888; |
||||
|
flex: 1; |
||||
|
width: 0px; |
||||
|
word-wrap: break-word; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.dec2 { |
||||
|
padding: 10rpx 30rpx; |
||||
|
display: flex; |
||||
|
|
||||
|
view { |
||||
|
&:nth-child(1) { |
||||
|
width: 180rpx; |
||||
|
} |
||||
|
|
||||
|
&:nth-child(2) { |
||||
|
color: #888888; |
||||
|
flex: 1; |
||||
|
width: 0px; |
||||
|
word-wrap: break-word; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
.items { |
||||
|
margin: 20rpx 30rpx; |
||||
|
border-radius: 12rpx; |
||||
|
background: #F5F5F5; |
||||
|
padding-bottom: 20rpx; |
||||
|
|
||||
|
.items-name { |
||||
|
padding: 20rpx; |
||||
|
border-bottom: 1px solid #dedede; |
||||
|
} |
||||
|
|
||||
|
.items-dec { |
||||
|
padding: 0px 20rpx; |
||||
|
margin-top: 20rpx; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.popup-title { |
||||
|
text-align: center; |
||||
|
font-size: 32rpx; |
||||
|
font-weight: bold; |
||||
|
color: #409eff; |
||||
|
padding: 30rpx |
||||
|
} |
||||
|
|
||||
|
.popup { |
||||
|
width: 600rpx; |
||||
|
padding: 0rpx 60rpx 0rpx; |
||||
|
|
||||
|
} |
||||
|
|
||||
|
.popup-footer { |
||||
|
display: flex; |
||||
|
border-top: 1px solid #e4e4e4; |
||||
|
|
||||
|
view { |
||||
|
line-height: 100rpx; |
||||
|
flex: 1; |
||||
|
text-align: center; |
||||
|
|
||||
|
&.sure { |
||||
|
color: #409eff; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.footer { |
||||
|
position: fixed; |
||||
|
bottom: 0px; |
||||
|
left: 0px; |
||||
|
width: 100%; |
||||
|
background: white; |
||||
|
z-index: 22; |
||||
|
} |
||||
|
|
||||
|
.btns { |
||||
|
display: flex; |
||||
|
|
||||
|
padding: 20rpx; |
||||
|
box-shadow: 0px -2rpx 20rpx rgba(0, 0, 0, 0.1); |
||||
|
|
||||
|
|
||||
|
button { |
||||
|
flex: 1; |
||||
|
margin: 0px 10rpx; |
||||
|
} |
||||
|
|
||||
|
.sure { |
||||
|
background: #409eff; |
||||
|
color: white; |
||||
|
border-radius: 8rpx; |
||||
|
|
||||
|
&::after { |
||||
|
border: 1px solid #409eff; |
||||
|
border-radius: 0px; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.list { |
||||
|
padding: 20rpx; |
||||
|
|
||||
|
.item { |
||||
|
display: flex; |
||||
|
margin-bottom: 20rpx; |
||||
|
|
||||
|
.item-box { |
||||
|
border-radius: 12rpx; |
||||
|
border: 1px solid #dedede; |
||||
|
border-radius: 12rpx; |
||||
|
|
||||
|
flex: 1; |
||||
|
width: 0rpx; |
||||
|
} |
||||
|
|
||||
|
.spare-title { |
||||
|
padding: 20rpx 30rpx; |
||||
|
border-bottom: 1px solid #e4e4e4; |
||||
|
display: flex; |
||||
|
|
||||
|
.title-txt { |
||||
|
color: #409eff; |
||||
|
font-size: 30rpx; |
||||
|
font-weight: bold; |
||||
|
flex: 1; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.dec { |
||||
|
color: #9c9c9c; |
||||
|
padding: 0rpx 30rpx 20rpx; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.add-btn { |
||||
|
display: flex; |
||||
|
justify-content: flex-start; |
||||
|
align-items: center; |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,230 @@ |
|||||
|
<template> |
||||
|
<!-- 保养工单 --> |
||||
|
<view class="container"> |
||||
|
<u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff' |
||||
|
title="保养工单"> |
||||
|
</u-navbar> |
||||
|
<view class="list"> |
||||
|
<view class="item" v-for="(item,index) in list" :key="index" > |
||||
|
<view class="" @click="itemClick(item,index)"> |
||||
|
<view class="title"> |
||||
|
<view class="title-txt"> |
||||
|
{{item.describes}} |
||||
|
</view> |
||||
|
<u-tag text="待接单" v-if="item.status == 'PENDING'" bg-color='rgba(255,255,255,0)' color='#fe8463' border-color='#fe8463' type="primary" shape='circle'/> |
||||
|
<u-tag text="已撤回" v-else-if="item.status=='REJECTED'" bg-color='rgba(255,255,255,0)' color='#d7d7d7' border-color='#d7d7d7 ' type="warning" shape='circle'/> |
||||
|
<u-tag text="已转办" v-else-if="item.status=='TRANSFERRED'" bg-color='rgba(255,255,255,0)' color='#e01f54' border-color='#e01f54' type="success" shape='circle'/> |
||||
|
<u-tag text="已接单" v-else-if="item.status=='PECEIVED'" bg-color='rgba(255,255,255,0)' color='#005eaa' border-color='#005eaa ' type="error" shape='circle'/> |
||||
|
<u-tag text="已验证" v-else-if="item.status=='VERIFIED'" bg-color='rgba(255,255,255,0)' color='#2EC7C9' border-color='#2EC7C9' type="info" shape='circle'/> |
||||
|
<u-tag text="已完成" v-else-if="item.status=='COMPLETED'" bg-color='rgba(255,255,255,0)' color='#2ba471' border-color='#2ba471' type="info" shape='circle'/> |
||||
|
</view> |
||||
|
<view class="dec"> |
||||
|
保养单号:<span>{{item.number}}</span> |
||||
|
</view> |
||||
|
<view class="dec"> |
||||
|
保养计划单号:<span>{{item.planNumber}}</span> |
||||
|
</view> |
||||
|
<view class="dec"> |
||||
|
{{`${params.type=='DEVICE'?'设备' : '模具'}`}}编号:<span>{{item.deviceNumber}}</span> |
||||
|
</view> |
||||
|
<view class="dec"> |
||||
|
{{`${params.type=='DEVICE'?'设备' : '模具'}`}}名称:<span>{{item.name}}</span> |
||||
|
</view> |
||||
|
<view class="dec"> |
||||
|
所属厂区:<span>{{item.factoryAreaName}}</span> |
||||
|
</view> |
||||
|
<view class="dec"> |
||||
|
故障类型:<span>{{item.faultTypeName}}</span> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="bottom"> |
||||
|
<view class="time" style="flex: 1;"> |
||||
|
{{`${$time.formatDate(item.createTime)}`}} |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view style="height: 94rpx;padding-top: 30rpx;"> |
||||
|
<u-loadmore :status="status" v-if="status != 'loadmore'" /> |
||||
|
</view> |
||||
|
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import * as onkeepOrderApi from "@/api/onkeepOrder.js" |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
params: { |
||||
|
pageNo: 1, |
||||
|
pageSize: 10, |
||||
|
type: '' |
||||
|
}, |
||||
|
status: 'loadmore', //是否显示没有更多了 |
||||
|
list: [], |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
// 筛选 |
||||
|
screen() { |
||||
|
this.$tab.navigateTo(`/pages/onkeepOrder/screen?type=${this.params.type}`) |
||||
|
}, |
||||
|
itemClick(item, index) { |
||||
|
this.$tab.navigateTo(`/pages/upkeepOrder/detail?type=${this.params.type}&data=${encodeURIComponent(JSON.stringify(item))}`) |
||||
|
}, |
||||
|
addForm(item) { |
||||
|
this.$tab.navigateTo(`/pages/onkeepOrder/addForm?type=${this.params.type}&data=${encodeURIComponent(JSON.stringify(item))}`) |
||||
|
}, |
||||
|
// 获取检修工单列表 |
||||
|
getList() { |
||||
|
if (this.status == 'nomore') return; |
||||
|
this.status = 'loading'; |
||||
|
this.$modal.loading('加载中') |
||||
|
onkeepOrderApi.onkeepOrderPage(this.params).then((res) => { |
||||
|
this.$modal.closeLoading() |
||||
|
if (res.data.list.length > 0) { |
||||
|
this.list = this.list.concat(res.data.list); |
||||
|
this.params.pageNo++; |
||||
|
this.status = 'loadmore' |
||||
|
} else { |
||||
|
this.status = 'nomore' |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
}, |
||||
|
onLoad(option) { |
||||
|
if (option.type) this.params.type = option.type; |
||||
|
}, |
||||
|
onShow() { |
||||
|
|
||||
|
uni.$on('screen',(data)=>{ |
||||
|
console.log(data) |
||||
|
this.params = {...this.params,...data} |
||||
|
}) |
||||
|
this.params.pageNo = 1 |
||||
|
this.list = [] |
||||
|
this.status = 'loadmore' |
||||
|
this.getList() |
||||
|
|
||||
|
}, |
||||
|
onUnload() { |
||||
|
uni.$off('screen') |
||||
|
}, |
||||
|
onReachBottom() { |
||||
|
this.getList() |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.list { |
||||
|
background: #f5f5f5; |
||||
|
margin-top: 20rpx; |
||||
|
|
||||
|
.item { |
||||
|
padding: 30rpx 30rpx 0px 30rpx; |
||||
|
margin-top: 20rpx; |
||||
|
background: white; |
||||
|
|
||||
|
.title { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
padding-bottom: 20rpx; |
||||
|
|
||||
|
.title-txt { |
||||
|
color: #409eff; |
||||
|
font-weight: bold; |
||||
|
font-size: 36rpx; |
||||
|
width: 0px; |
||||
|
flex: 1; |
||||
|
} |
||||
|
|
||||
|
.time { |
||||
|
color: #919191; |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.dec { |
||||
|
padding-bottom: 20rpx; |
||||
|
|
||||
|
span { |
||||
|
color: #999999; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.last { |
||||
|
padding-bottom: 30rpx; |
||||
|
} |
||||
|
|
||||
|
.bottom { |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
border-top: 1px solid #E4E4E4; |
||||
|
padding: 20rpx 0px; |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.list { |
||||
|
background: #f5f5f5; |
||||
|
margin-top: 20rpx; |
||||
|
|
||||
|
.item { |
||||
|
padding: 30rpx 30rpx 0px 30rpx; |
||||
|
margin-top: 20rpx; |
||||
|
background: white; |
||||
|
|
||||
|
.title { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
padding-bottom: 20rpx; |
||||
|
|
||||
|
.title-txt { |
||||
|
color: #409eff; |
||||
|
font-weight: bold; |
||||
|
font-size: 36rpx; |
||||
|
width: 0px; |
||||
|
flex: 1; |
||||
|
} |
||||
|
|
||||
|
.time { |
||||
|
color: #919191; |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.dec { |
||||
|
padding-bottom: 20rpx; |
||||
|
|
||||
|
span { |
||||
|
color: #999999; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.last { |
||||
|
padding-bottom: 30rpx; |
||||
|
} |
||||
|
|
||||
|
.bottom { |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
border-top: 1px solid #E4E4E4; |
||||
|
padding: 20rpx 0px; |
||||
|
position: relative; |
||||
|
|
||||
|
|
||||
|
.button { |
||||
|
position: absolute; |
||||
|
right: 0rpx; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</style> |
@ -0,0 +1,226 @@ |
|||||
|
<template> |
||||
|
<!-- 我的维修工单 --> |
||||
|
<view class="container"> |
||||
|
<u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff' |
||||
|
title="我的维修"> |
||||
|
</u-navbar> |
||||
|
<Search @search='search' @screen='screen'/> |
||||
|
<view class="list"> |
||||
|
<view class="item" v-for="(item,index) in list" :key="index" @click="itemClick(item,index)"> |
||||
|
<view class="title"> |
||||
|
<view class="title-txt"> |
||||
|
{{item.describes}} |
||||
|
</view> |
||||
|
<view class="time"> |
||||
|
2023-12-12 08:00:00 |
||||
|
</view> |
||||
|
</view> |
||||
|
<view class="dec"> |
||||
|
报修单号:<span>{{item.number}}</span> |
||||
|
</view> |
||||
|
<view class="dec"> |
||||
|
设备编号:<span>{{item.deviceNumber}}</span> |
||||
|
</view> |
||||
|
<view class="dec"> |
||||
|
设备名称:<span>{{item.name}}</span> |
||||
|
</view> |
||||
|
<view class="dec"> |
||||
|
所属厂区:<span>{{item.factoryAreaName}}</span> |
||||
|
</view> |
||||
|
<view class="bottom"> |
||||
|
<view class="status"> |
||||
|
<u-tag text="已报修" v-if="item.result=='已报修'" bg-color='rgba(255,255,255,0)' color='#2ba471' |
||||
|
border-color='#2ba471' type="primary" shape='circle' /> |
||||
|
</view> |
||||
|
<view class="button"> |
||||
|
<u-button shape="circle" type="primary" size="mini" style="min-width: 120rpx;" |
||||
|
v-if="item.isCancel == 0" @click="cancle(item)">撤销</u-button> |
||||
|
</view> |
||||
|
|
||||
|
</view> |
||||
|
</view> |
||||
|
<view style="height: 94rpx;padding-top: 30rpx;"> |
||||
|
<u-loadmore :status="status" v-if="status != 'loadmore'" /> |
||||
|
</view> |
||||
|
</view> |
||||
|
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> |
||||
|
</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import * as repairOrderApi from "@/api/repairOrder.js" |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
params: { |
||||
|
pageNo: 1, |
||||
|
pageSize: 10, |
||||
|
type: 'DEVICE', |
||||
|
flag:1 |
||||
|
}, |
||||
|
status: 'loadmore', //是否显示没有更多了 |
||||
|
list: [], |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
// 筛选 |
||||
|
screen() { |
||||
|
this.$tab.navigateTo(`/pages/deviceReport/screen?type=${this.type}`) |
||||
|
}, |
||||
|
itemClick(item, index) { |
||||
|
this.$tab.navigateTo(`/pages/workOrderList/detail?type=${this.type}`) |
||||
|
}, |
||||
|
addForm() { |
||||
|
this.$tab.navigateTo(`/pages/deviceReport/addForm?type=${this.params.type}`) |
||||
|
}, |
||||
|
// 获取设备保修列表 |
||||
|
getList() { |
||||
|
if (this.status == 'nomore') return; |
||||
|
this.status = 'loading'; |
||||
|
repairOrderApi.repairOrderPage(this.params).then((res) => { |
||||
|
if (res.data.list.length > 0) { |
||||
|
this.list = this.list.concat(res.data.list); |
||||
|
this.params.pageNo++; |
||||
|
this.status = 'loadmore' |
||||
|
} else { |
||||
|
this.status = 'nomore' |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
// 撤销 |
||||
|
cancle(item){ |
||||
|
this.$modal.confirm('确定撤销报修吗?').then(()=>{ |
||||
|
deviceApi.rejected(item.id).then((res) => { |
||||
|
this.params.pageNo = 1 |
||||
|
this.list = [] |
||||
|
this.status = 'loadmore' |
||||
|
this.getList() |
||||
|
}) |
||||
|
}) |
||||
|
|
||||
|
} |
||||
|
}, |
||||
|
onShow() { |
||||
|
this.params.pageNo = 1 |
||||
|
this.list = [] |
||||
|
this.status = 'loadmore' |
||||
|
this.getList() |
||||
|
}, |
||||
|
onReachBottom() { |
||||
|
this.getList() |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.list { |
||||
|
margin-top: 20rpx; |
||||
|
|
||||
|
.item { |
||||
|
padding: 30rpx 30rpx 0px 30rpx; |
||||
|
margin-top: 20rpx; |
||||
|
background: white; |
||||
|
|
||||
|
.title { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
padding-bottom: 20rpx; |
||||
|
|
||||
|
.title-txt { |
||||
|
color: #409eff; |
||||
|
font-weight: bold; |
||||
|
font-size: 36rpx; |
||||
|
width: 0px; |
||||
|
flex: 1; |
||||
|
} |
||||
|
|
||||
|
.time { |
||||
|
color: #919191; |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.dec { |
||||
|
padding-bottom: 20rpx; |
||||
|
|
||||
|
span { |
||||
|
color: #999999; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.last { |
||||
|
padding-bottom: 30rpx; |
||||
|
} |
||||
|
|
||||
|
.bottom { |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
border-top: 1px solid #E4E4E4; |
||||
|
padding: 20rpx 0px; |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.list { |
||||
|
background: #f5f5f5; |
||||
|
margin-top: 20rpx; |
||||
|
|
||||
|
.item { |
||||
|
padding: 30rpx 30rpx 0px 30rpx; |
||||
|
margin-top: 20rpx; |
||||
|
background: white; |
||||
|
|
||||
|
.title { |
||||
|
display: flex; |
||||
|
align-items: center; |
||||
|
padding-bottom: 20rpx; |
||||
|
|
||||
|
.title-txt { |
||||
|
color: #409eff; |
||||
|
font-weight: bold; |
||||
|
font-size: 36rpx; |
||||
|
width: 0px; |
||||
|
flex: 1; |
||||
|
} |
||||
|
|
||||
|
.time { |
||||
|
color: #919191; |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.dec { |
||||
|
padding-bottom: 20rpx; |
||||
|
|
||||
|
span { |
||||
|
color: #999999; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.last { |
||||
|
padding-bottom: 30rpx; |
||||
|
} |
||||
|
|
||||
|
.bottom { |
||||
|
display: flex; |
||||
|
justify-content: space-between; |
||||
|
align-items: center; |
||||
|
border-top: 1px solid #E4E4E4; |
||||
|
padding: 20rpx 0px; |
||||
|
position: relative; |
||||
|
|
||||
|
.status { |
||||
|
flex: 1; |
||||
|
} |
||||
|
.button{ |
||||
|
position: absolute; |
||||
|
right: 0rpx; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
</style> |
Loading…
Reference in new issue