gaojs
5 months ago
9 changed files with 2014 additions and 5 deletions
@ -0,0 +1,52 @@ |
|||
import http from '../http' |
|||
// 获取巡检工单
|
|||
export function inspectionOrderPage(params) { |
|||
return http.get('/eam/equipment-inspection-main/page',{params}) |
|||
} |
|||
|
|||
// 获取巡检工单
|
|||
export function inspectionOrder(number) { |
|||
return http.get('/eam/equipment-inspection-main/get?id=' + number) |
|||
} |
|||
|
|||
//接单
|
|||
export function inspectionUpdateOrder(params) { |
|||
return http.post('/eam/equipment-inspection-main/updateOrder',params) |
|||
} |
|||
|
|||
//完成
|
|||
export function inspectionExecuteOrder(params) { |
|||
return http.post('/eam/equipment-inspection-main/execute',params) |
|||
} |
|||
|
|||
|
|||
// 获取巡检工单
|
|||
export function inspectionOrderDetail(params) { |
|||
return http.get('/eam/equipment-inspection-detail/getList',{params}) |
|||
} |
|||
|
|||
//更新巡检项
|
|||
export function inspectionOrderItemUpdate(params) { |
|||
return http.put('/eam/equipment-inspection-detail/update',params) |
|||
} |
|||
|
|||
//新增非必选巡检项
|
|||
export function inspectionOrderItemCreate(params) { |
|||
return http.post('/eam/equipment-inspection-detail/create',params) |
|||
} |
|||
|
|||
//获取非必选的巡检项
|
|||
export function inspectionPlanItemList(params) { |
|||
return http.post('/eam/relation-inspection-plan-item/getList',params) |
|||
} |
|||
|
|||
//验证驳回
|
|||
export function inspectionOrderRejected(params) { |
|||
return http.post('/eam/equipment-inspection-main/fallback',params) |
|||
} |
|||
|
|||
//验证通过
|
|||
export function inspectionOrderPassed(params) { |
|||
return http.put('/eam/equipment-inspection-main/update',params) |
|||
} |
|||
|
@ -0,0 +1,741 @@ |
|||
<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> |
|||
<u-tag text="待派工" v-if="data.status == '0'" bg-color='rgba(255,255,255,0)' color='#fe8463' border-color='#fe8463' type="info" shape='circle'/> |
|||
<u-tag text="已逾期" v-else-if="data.status=='1'" bg-color='rgba(255,255,255,0)' color='#d7d7d7' border-color='#d7d7d7 ' type="info" shape='circle'/> |
|||
<u-tag text="已退单" v-else-if="data.status=='2'" bg-color='rgba(255,255,255,0)' color='#e01f54' border-color='#e01f54' type="info" shape='circle'/> |
|||
<u-tag text="待接单" v-else-if="data.status=='3'" bg-color='rgba(255,255,255,0)' color='#005eaa' border-color='#005eaa ' type="info" shape='circle'/> |
|||
<u-tag text="待执行" v-else-if="data.status=='4'" bg-color='rgba(255,255,255,0)' color='#2EC7C9' border-color='#2EC7C9' type="info" shape='circle'/> |
|||
<u-tag text="执行中" v-else-if="data.status=='5'" bg-color='rgba(255,255,255,0)' color='#2ba471' border-color='#2ba471' type="info" shape='circle'/> |
|||
<u-tag text="待验证" v-else-if="data.status=='6'" bg-color='rgba(255,255,255,0)' color='#2ba471' border-color='#2ba471' type="info" shape='circle'/> |
|||
<u-tag text="已完成" v-else-if="data.status=='7'" bg-color='rgba(255,255,255,0)' color='#2ba471' border-color='#2ba471' type="info" shape='circle'/> |
|||
<u-tag text="已作废" v-else-if="data.status=='8'" bg-color='rgba(255,255,255,0)' color='#2ba471' border-color='#2ba471' type="info" shape='circle'/> |
|||
</view> |
|||
<view class="dec-item"> |
|||
<view>巡检描述:</view> |
|||
<view>{{data.describes}}</view> |
|||
</view> |
|||
<view class="dec-item"> |
|||
<view>班组:</view> |
|||
<view>{{data.classType}}</view> |
|||
</view> |
|||
<view class="dec-item"> |
|||
<view>巡检人:</view> |
|||
<view>{{data.maintenancer}}</view> |
|||
</view> |
|||
<view class="dec-item"> |
|||
<view>巡检人电话:</view> |
|||
<view>{{data.maintenancePhone}}</view> |
|||
</view> |
|||
<view class="dec-item"> |
|||
<view>巡检开始时间:</view> |
|||
<view>{{data.endTime == null ? '':$time.formatDate(data.startTime)}}</view> |
|||
</view> |
|||
<view class="dec-item"> |
|||
<view>巡检结束时间:</view> |
|||
<view>{{data.endTime == null ? '':$time.formatDate(data.endTime)}}</view> |
|||
</view> |
|||
<view class="dec-item"> |
|||
<view>完成时间:</view> |
|||
<view>{{data.completionTime == null ? '':$time.formatDate(data.completionTime)}}</view> |
|||
</view> |
|||
|
|||
</view> |
|||
</view> |
|||
<div class="line"></div> |
|||
<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="dec" v-if="current == 0 "> |
|||
<view class="dec-item"> |
|||
<view>编号:</view> |
|||
<view>{{data.equipmentCode}}</view> |
|||
</view> |
|||
<view class="dec-item"> |
|||
<view>所属车间:</view> |
|||
<view>{{data.workshopCode}}</view> |
|||
</view> |
|||
<view class="dec-item"> |
|||
<view>类型:</view> |
|||
<view>{{data.type == 'DEVICE'?'设备':data.type == 'EQUIPMENT'?'工装':''}}</view> |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="list" v-if="current == 1 "> |
|||
<view class="item " v-for="(item,index) in subList" :key="index" @click="upSubForm('update',item)"> |
|||
<view class="item-box"> |
|||
<view class="spare-title"> |
|||
<view class="title-txt"> |
|||
{{item.name}} |
|||
</view> |
|||
</view> |
|||
<u-row gutter="16"> |
|||
<u-col :span="12"> |
|||
<view class="dec"> |
|||
<view class=""> |
|||
巡检内容: {{item.content}} |
|||
</view> |
|||
</view> |
|||
<view class="dec"> |
|||
<view class=""> |
|||
结果: {{item.result == '0'?'完成':item.result == '1'?'未完成':''}} |
|||
</view> |
|||
</view> |
|||
<view class="dec"> |
|||
<view class=""> |
|||
未完成原因: {{item.uncompletedCause==null?'':item.uncompletedCause}} |
|||
</view> |
|||
</view> |
|||
<view class="dec"> |
|||
<view class=""> |
|||
完成时间: {{item.completionTime == null ? '':$time.formatDate(item.completionTime)}} |
|||
</view> |
|||
</view> |
|||
</u-col> |
|||
</u-row> |
|||
</view> |
|||
</view> |
|||
<view class="add-btn"> |
|||
<u-button type="primary" @click="upSubForm('create','')" v-if="data.status=='5'"><u-icon name="plus-circle" color="#ffffff" size="36"></u-icon>巡检</u-button> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<view class="footer"> |
|||
<view class="btns" v-if="data.status == '3'"> |
|||
<u-button type="primary" @click="handleReceive()" :loading='loading' :disabled='loading'>接单</u-button> |
|||
</view> |
|||
<view class="btns" v-if="data.status == '4'"> |
|||
<u-button type="primary" @click="handleExecute()" :loading='loading' :disabled='loading'>执行</u-button> |
|||
</view> |
|||
<view class="btns" v-if="data.status == '5'"> |
|||
<u-button type="primary" @click="handleFinish()" :loading='loading' :disabled='loading'>完成</u-button> |
|||
</view> |
|||
<view class="btns" v-if="data.status == '6'"> |
|||
<u-button type="primary" @click="handleValidate()" :loading='loading' :disabled='loading'>验证</u-button> |
|||
</view> |
|||
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> |
|||
</view> |
|||
|
|||
<!-- 时间弹出框 --> |
|||
<u-popup v-model="formPopupVisible" @close="formPopupVisible = false" mode="bottom"> |
|||
<view class="add-form-container"> |
|||
<u-form :model="form" ref="formRef2" label-width="160rpx"> |
|||
<u-form-item label="巡检开始时间:" prop="startTime" required > |
|||
<view class="select" @click="openDatetime('startTime',formatDate,params,formatValue)"> |
|||
<view class="input" v-if='formatStartDate'> |
|||
{{formatStartDate}} |
|||
</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="endTime" required> |
|||
<view class="select" @click="openDatetime('endTime',formatDate,params,formatValue)"> |
|||
<view class="input" v-if='formatEndDate'> |
|||
{{formatEndDate}} |
|||
</view> |
|||
<view class="placeholder" v-else> |
|||
{{`请选择完成时间`}} |
|||
</view> |
|||
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon> |
|||
</view> |
|||
</u-form-item> |
|||
</u-form> |
|||
<view class="popup-footer"> |
|||
<u-button @click="formPopupVisible = false">取消</u-button> |
|||
<u-button type="primary" @click="confirmKeepOrderForm">确认</u-button> |
|||
</view> |
|||
</view> |
|||
</u-popup> |
|||
<u-picker mode="time" v-model="datetimeShow" :default-time='datetimeDefaultValue' :params="params" @confirm='chooseDatetime' @cancle='datetimeShow = false'></u-picker> |
|||
|
|||
|
|||
<!-- 验证完结--> |
|||
<u-popup v-model="formPopupValidate" mode="center" border-radius="14"> |
|||
<view class="popup-title">验证内容</view> |
|||
<view class="popup"> |
|||
<textarea v-model="verifyContentStr" placeholder="请输入内容"></textarea> |
|||
</view> |
|||
<view class="popup-footer"> |
|||
<view class="sure" @click="apply('PASSED')">通过</view> |
|||
<view class="reject" @click="apply('REJECTED')" style="color: red;">驳回</view> |
|||
</view> |
|||
</u-popup> |
|||
|
|||
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> |
|||
</view> |
|||
|
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { |
|||
onLoad, |
|||
onShow |
|||
} from '@dcloudio/uni-app' |
|||
import { |
|||
ref, |
|||
getCurrentInstance |
|||
} from 'vue' |
|||
|
|||
import * as inspectionOrderApi from "@/api/eam/inspection" |
|||
|
|||
const { proxy } = getCurrentInstance() |
|||
const subList = ref([]) |
|||
const data = ref({}) |
|||
const loading = ref(false) |
|||
const number = ref('') |
|||
|
|||
|
|||
|
|||
const current = ref(0) |
|||
const id = ref('') |
|||
const type = ref('')//设备类型 设备/工装 |
|||
const list = ref([{ |
|||
name: '', |
|||
value: 1 |
|||
}, { |
|||
name: '', |
|||
value: 2 |
|||
}]) |
|||
|
|||
//时间弹出层 |
|||
const formPopupVisible = ref(false) |
|||
const form2 = ref({ |
|||
startTime: '', |
|||
endTime: '' |
|||
}) |
|||
const params = ref({ |
|||
year: true, |
|||
month: true, |
|||
day: true, |
|||
hour: true, |
|||
minute: true, |
|||
second: true, |
|||
timestamp: true, |
|||
}) |
|||
const datetimeDefaultValue = ref('') |
|||
const formatValue = ref('YYYY-MM-DD hh:mm:ss') |
|||
const field = ref('') |
|||
const datetimeShow = ref(false) |
|||
const formatStartDate = ref('')//日期展示 |
|||
const formatEndDate = ref('')//日期展示 |
|||
|
|||
|
|||
// 日期模式点击确定之后 |
|||
function chooseDatetime(e) { |
|||
let array1 = [] |
|||
let array2 = [] |
|||
if (formatValue.value.indexOf('YYYY') > -1) { |
|||
array1.push(e.year) |
|||
} |
|||
if (formatValue.value.indexOf('MM') > -1) { |
|||
array1.push(e.month) |
|||
} |
|||
if (formatValue.value.indexOf('DD') > -1) { |
|||
array1.push(e.day) |
|||
} |
|||
if (formatValue.value.indexOf('hh') > -1) { |
|||
array2.push(e.hour) |
|||
} |
|||
if (formatValue.value.indexOf('mm') > -1) { |
|||
array2.push(e.minute) |
|||
} |
|||
if (formatValue.value.indexOf('ss') > -1) { |
|||
array2.push(e.second) |
|||
} |
|||
let str = array1.join('-') + ' ' + array2.join(':') |
|||
if(field.value == 'startTime'){ |
|||
formatStartDate.value = str |
|||
}else if(field.value == 'endTime'){ |
|||
formatEndDate.value = str |
|||
} |
|||
form2.value[field.value] = e.timestamp*1000 |
|||
} |
|||
|
|||
//时间确认 |
|||
function confirmKeepOrderForm(){ |
|||
if (!(formatStartDate.value && formatStartDate.value.trim() != '')) { |
|||
proxy.$modal.showToast('请选择创建时间') |
|||
return |
|||
}else if (!(formatEndDate.value && formatStartDate.value.trim() != '')) { |
|||
proxy.$modal.showToast('请选择结束时间') |
|||
return |
|||
}else if(form2.value.startTime >= form2.value.endTime){ |
|||
proxy.$modal.showToast('创建时间要小于结束时间') |
|||
return |
|||
}else{ |
|||
formPopupVisible.value = false |
|||
} |
|||
const paramsData = { |
|||
id: id.value, |
|||
startTime: form2.value.startTime, |
|||
endTime: form2.value.endTime, |
|||
status:'5' |
|||
} |
|||
proxy.$modal.confirm('是否完成?').then(() => { |
|||
proxy.$modal.loading('加载中') |
|||
loading.value = true |
|||
inspectionOrderApi.inspectionExecuteOrder(paramsData).then((res) => { |
|||
if (res.data) { |
|||
proxy.$modal.showToast('操作成功') |
|||
setTimeout(() => { |
|||
selectDetail() |
|||
loading.value = false |
|||
}, 1500) |
|||
} else { |
|||
proxy.$modal.showToast(res.msg) |
|||
loading.value = false |
|||
} |
|||
}).catch((e) => { |
|||
proxy.$modal.closeLoading() |
|||
loading.value = false |
|||
}) |
|||
}) |
|||
} |
|||
|
|||
//选择时间函数 |
|||
function openDatetime(fieldName, val, params, format) { |
|||
params.value = params |
|||
formatValue.value = format |
|||
field.value = fieldName |
|||
datetimeDefaultValue.value = val ? val : proxy.$time.formatDate() |
|||
datetimeShow.value = true |
|||
} |
|||
|
|||
|
|||
//接单 |
|||
function handleReceive(){ |
|||
const datas = { |
|||
id: id.value, |
|||
status: '4' |
|||
} |
|||
proxy.$modal.confirm("是否确认接单").then(()=>{ |
|||
inspectionOrderApi.inspectionUpdateOrder(datas).then((res) => { |
|||
if (res.data) { |
|||
proxy.$modal.showToast('接单成功') |
|||
setTimeout(() => { |
|||
selectDetail() |
|||
loading.value = false |
|||
proxy.$modal.closeLoading() |
|||
}, 1000) |
|||
}else{ |
|||
proxy.$modal.showToast('接单失败') |
|||
setTimeout(() => { |
|||
selectDetail() |
|||
loading.value = false |
|||
proxy.$modal.closeLoading() |
|||
}, 1000) |
|||
} |
|||
}) |
|||
}) |
|||
} |
|||
|
|||
//执行 |
|||
function handleExecute(){ |
|||
const datas = { |
|||
id: id.value, |
|||
status: '5' |
|||
} |
|||
proxy.$modal.confirm("是否确认执行").then(()=>{ |
|||
inspectionOrderApi.inspectionUpdateOrder(datas).then((res) => { |
|||
if (res.data) { |
|||
proxy.$modal.showToast('执行成功') |
|||
setTimeout(() => { |
|||
selectDetail() |
|||
loading.value = false |
|||
proxy.$modal.closeLoading() |
|||
}, 1000) |
|||
}else{ |
|||
proxy.$modal.showToast('执行失败') |
|||
setTimeout(() => { |
|||
selectDetail() |
|||
loading.value = false |
|||
proxy.$modal.closeLoading() |
|||
}, 1000) |
|||
} |
|||
}) |
|||
}) |
|||
} |
|||
|
|||
//完成 |
|||
function handleFinish(){ |
|||
proxy.$modal.confirm("是否完成").then(()=>{ |
|||
formPopupVisible.value = true |
|||
}) |
|||
} |
|||
|
|||
//验证标识 |
|||
const formPopupValidate = ref(false) |
|||
//验证 |
|||
function handleValidate(){ |
|||
formPopupValidate.value = true |
|||
} |
|||
//验证提交 |
|||
const verifyContentStr = ref(''); |
|||
function apply(fieldName){ |
|||
if(fieldName == 'PASSED'){ |
|||
const paramsData = { |
|||
id: id.value, |
|||
status:'7', |
|||
verifyContent:verifyContentStr.value |
|||
} |
|||
formPopupValidate.value = false |
|||
proxy.$modal.confirm("是否确认执行").then(()=>{ |
|||
inspectionOrderApi.inspectionOrderPassed(paramsData).then((res) => { |
|||
console.log(res); |
|||
proxy.$modal.showToast('执行成功') |
|||
setTimeout(() => { |
|||
selectDetail() |
|||
loading.value = false |
|||
proxy.$modal.closeLoading() |
|||
}, 1000) |
|||
}) |
|||
}) |
|||
}else if(fieldName == 'REJECTED'){ |
|||
const paramsData = { |
|||
id: id.value, |
|||
status:'5', |
|||
} |
|||
formPopupValidate.value = false |
|||
proxy.$modal.confirm("是否确认执行").then(()=>{ |
|||
inspectionOrderApi.inspectionOrderRejected(paramsData).then((res) => { |
|||
console.log(res); |
|||
proxy.$modal.showToast('执行成功') |
|||
setTimeout(() => { |
|||
selectDetail() |
|||
loading.value = false |
|||
proxy.$modal.closeLoading() |
|||
}, 1000) |
|||
}) |
|||
}) |
|||
} |
|||
} |
|||
|
|||
|
|||
//新增非必选巡检项 |
|||
function openInspectionItem(){ |
|||
if (data.value.status == '3') { |
|||
proxy.$modal.showToast('请先接单') |
|||
return |
|||
} |
|||
} |
|||
//切换Tab页 |
|||
function change(index) { |
|||
current.value = index |
|||
} |
|||
// 更新巡检项 |
|||
function upSubForm(clickType,item) { |
|||
if (data.value.status == '3') { |
|||
proxy.$modal.showToast('请先接单') |
|||
return |
|||
} |
|||
if (data.value.status == '4'|| data.value.status == '6' || data.value.status == '7'|| data.value.status == '8'){ |
|||
proxy.$modal.showToast('当前工单状态不允许修改巡检项') |
|||
return |
|||
} |
|||
if (clickType == 'update') { |
|||
proxy.$tab.navigateTo( |
|||
`/pages/eam/inspectionOrder/item?type=${clickType}&data=${encodeURIComponent(JSON.stringify(item))}` |
|||
) |
|||
}else{ |
|||
proxy.$tab.navigateTo( |
|||
`/pages/eam/inspectionOrder/item?type=${clickType}&data=${encodeURIComponent(JSON.stringify(data.value))}` |
|||
) |
|||
} |
|||
|
|||
} |
|||
|
|||
|
|||
onLoad(async (option) => { |
|||
if (option.id) { |
|||
id.value = option.id |
|||
} |
|||
if (option.type) type.value = option.type; |
|||
}) |
|||
onShow(async () => { |
|||
list.value = [{ |
|||
name: type.value == 'DEVICE' ? '设备信息' : '工装信息', |
|||
value: 1 |
|||
}, { |
|||
name: '巡检项内容', |
|||
value: 2 |
|||
}] |
|||
selectDetail() |
|||
selectListByNumber() |
|||
}) |
|||
function selectDetail() { |
|||
inspectionOrderApi.inspectionOrder(id.value).then((res) => { |
|||
if (res.data) { |
|||
data.value = res.data |
|||
} |
|||
}) |
|||
} |
|||
|
|||
function selectListByNumber() { |
|||
const data = { |
|||
masterId: id.value |
|||
} |
|||
inspectionOrderApi.inspectionOrderDetail(data).then((res) => { |
|||
if (res.data) { |
|||
subList.value = res.data |
|||
} |
|||
}) |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.detail-container { |
|||
min-height: 100vh; |
|||
background: white; |
|||
} |
|||
|
|||
.line { |
|||
background: #f5f5f5; |
|||
height: 20rpx; |
|||
} |
|||
|
|||
.info { |
|||
background: white; |
|||
} |
|||
|
|||
.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: 160rpx; |
|||
} |
|||
|
|||
&:nth-child(2) { |
|||
color: #888888; |
|||
flex: 1; |
|||
width: 0px; |
|||
word-wrap: break-word; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
.dec2 { |
|||
padding: 10rpx 30rpx; |
|||
display: flex; |
|||
|
|||
view { |
|||
&:nth-child(1) { |
|||
width: 160rpx; |
|||
} |
|||
|
|||
&: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; |
|||
} |
|||
|
|||
::v-deep .u-radio-group { |
|||
display: grid !important; |
|||
padding-bottom: 20rpx; |
|||
} |
|||
|
|||
.images { |
|||
display: flex; |
|||
width: 100%; |
|||
|
|||
image { |
|||
width: 30%; |
|||
margin-right: 20rpx; |
|||
height: 200rpx; |
|||
border-radius: 10rpx; |
|||
} |
|||
} |
|||
|
|||
.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); |
|||
|
|||
} |
|||
} |
|||
</style> |
@ -0,0 +1,243 @@ |
|||
<template> |
|||
<!-- 巡检工单 --> |
|||
<view class="container"> |
|||
<u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff' |
|||
title="巡检工单"> |
|||
<template v-slot:right> |
|||
<u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm" ></u-icon> |
|||
</template> |
|||
</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.number}} |
|||
</view> |
|||
<u-tag text="待派工" v-if="item.status == '0'" bg-color='rgba(255,255,255,0)' color='#fe8463' border-color='#fe8463' type="info" shape='circle'/> |
|||
<u-tag text="已逾期" v-else-if="item.status=='1'" bg-color='rgba(255,255,255,0)' color='#d7d7d7' border-color='#d7d7d7 ' type="info" shape='circle'/> |
|||
<u-tag text="已退单" v-else-if="item.status=='2'" bg-color='rgba(255,255,255,0)' color='#e01f54' border-color='#e01f54' type="info" shape='circle'/> |
|||
<u-tag text="待接单" v-else-if="item.status=='3'" bg-color='rgba(255,255,255,0)' color='#005eaa' border-color='#005eaa ' type="info" shape='circle'/> |
|||
<u-tag text="待执行" v-else-if="item.status=='4'" bg-color='rgba(255,255,255,0)' color='#2EC7C9' border-color='#2EC7C9' type="info" shape='circle'/> |
|||
<u-tag text="执行中" v-else-if="item.status=='5'" bg-color='rgba(255,255,255,0)' color='#2ba471' border-color='#2ba471' type="info" shape='circle'/> |
|||
<u-tag text="待验证" v-else-if="item.status=='6'" bg-color='rgba(255,255,255,0)' color='#2ba471' border-color='#2ba471' type="info" shape='circle'/> |
|||
<u-tag text="已完成" v-else-if="item.status=='7'" bg-color='rgba(255,255,255,0)' color='#2ba471' border-color='#2ba471' type="info" shape='circle'/> |
|||
<u-tag text="已作废" v-else-if="item.status=='8'" 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.type=='DEVICE'?'设备':item.type=='EQUIPMENT'?'工装':''}}</span> |
|||
</view> |
|||
<view class="dec"> |
|||
{{`${params.type=='DEVICE'?'设备' : '工装'}`}}编号:<span>{{item.equipmentCode}}</span> |
|||
</view> |
|||
<view class="dec"> |
|||
所属车间:<span>{{item.workshopCode}}</span> |
|||
</view> |
|||
<view class="dec"> |
|||
班组:<span>{{item.classType}}</span> |
|||
</view> |
|||
<view class="dec"> |
|||
巡检人:<span>{{item.maintenancer}}</span> |
|||
</view> |
|||
<view class="dec"> |
|||
完成时间:<span>{{`${$time.formatDate(item.completionTime)}`}}</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 setup lang="ts"> |
|||
import { |
|||
onLoad, |
|||
onShow, |
|||
onReachBottom |
|||
} from '@dcloudio/uni-app' |
|||
|
|||
import { |
|||
ref, |
|||
getCurrentInstance, |
|||
nextTick |
|||
} from 'vue' |
|||
|
|||
import * as inspectionOrderApi from "@/api/eam/inspection" |
|||
|
|||
const { proxy } = getCurrentInstance() |
|||
const params = ref({ |
|||
pageNo: 1, |
|||
pageSize: 10, |
|||
type: '', |
|||
}) |
|||
const status = ref('loadmore') //是否显示没有更多了 |
|||
const list = ref([]) |
|||
|
|||
//点击详情 |
|||
function itemClick(item, index) { |
|||
proxy.$tab.navigateTo(`/pages/eam/inspectionOrder/detail?type=${params.value.type}&id=${encodeURIComponent(JSON.stringify(item.id))}`) |
|||
} |
|||
// function addForm(item) { |
|||
// proxy.$tab.navigateTo(`/pages/spotCheckOrder/addForm?type=${params.value.type}&data=${encodeURIComponent(JSON.stringify(item))}`) |
|||
// } |
|||
|
|||
async function getList() { |
|||
if (status.value == 'nomore') return; |
|||
status.value = 'loading'; |
|||
proxy.$modal.loading('加载中') |
|||
await inspectionOrderApi.inspectionOrderPage(params.value).then((res) => { |
|||
proxy.$modal.closeLoading() |
|||
if (res.data.list.length > 0) { |
|||
list.value = list.value.concat(res.data.list); |
|||
params.value.pageNo++; |
|||
status.value = 'loadmore' |
|||
} else { |
|||
status.value = 'nomore' |
|||
} |
|||
}).catch(() => { |
|||
proxy.$modal.closeLoading() |
|||
}) |
|||
} |
|||
onLoad((option) => { |
|||
if (option.type) params.value.type = option.type; |
|||
if (option.flag) params.value.flag = option.flag; |
|||
}) |
|||
onShow(() => { |
|||
params.value.pageNo = 1 |
|||
list.value = [] |
|||
status.value = 'loadmore' |
|||
getList() |
|||
|
|||
}) |
|||
onReachBottom(() => { |
|||
status.value = 'loading' |
|||
getList() |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.container{ |
|||
background: #f5f5f5; |
|||
min-height: 100vh; |
|||
} |
|||
.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; |
|||
word-wrap: break-word; |
|||
} |
|||
|
|||
.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,93 @@ |
|||
<template> |
|||
<view class="add-form-container"> |
|||
<view class="list"> |
|||
<view class="title"> |
|||
<span>*</span>巡检类型选择 |
|||
</view> |
|||
<view class="add-btn"> |
|||
<u-button type="primary" @click="openDevice"><u-icon name="plus-circle" color="#ffffff" |
|||
size="36"></u-icon>设备巡检</u-button> |
|||
</view> |
|||
<view class="add-btn"> |
|||
<u-button type="primary" @click="openTool"><u-icon name="plus-circle" color="#ffffff" |
|||
size="36"></u-icon>工装巡检</u-button> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { |
|||
ref, |
|||
getCurrentInstance |
|||
} from 'vue' |
|||
const { proxy } = getCurrentInstance() |
|||
function openDevice() { |
|||
proxy.$tab.navigateTo(`/pages/eam/inspectionOrder/index?type=DEVICE&flag=2`) |
|||
} |
|||
function openTool() { |
|||
proxy.$tab.navigateTo(`/pages/eam/inspectionOrder/index?type=EQUIPMENT&flag=2`) |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.add-form-container { |
|||
min-height: calc(100vh - 140rpx); |
|||
background: white; |
|||
padding: 0px 0rpx 140rpx; |
|||
} |
|||
|
|||
.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; |
|||
} |
|||
|
|||
} |
|||
} |
|||
.title { |
|||
padding: 32rpx 0rpx; |
|||
position: relative; |
|||
|
|||
span { |
|||
position: absolute; |
|||
left: -16rpx; |
|||
color: #fa3534; |
|||
top: 19px; |
|||
} |
|||
} |
|||
.add-btn { |
|||
display: flex; |
|||
justify-content: flex-start; |
|||
align-items: center; |
|||
margin-top: 20px; |
|||
} |
|||
|
|||
</style> |
@ -0,0 +1,517 @@ |
|||
<template> |
|||
<!-- 详情 update用--> |
|||
<view class="detail-container" v-if="show1"> |
|||
<view class="popup" > |
|||
<u-form :model="form1" label-width="160rpx"> |
|||
<u-form-item label="工单编号" prop="number" required> |
|||
<u-input v-model="form1.number" :disabled=true/> |
|||
</u-form-item> |
|||
<u-form-item label="巡检项名称" prop="name" required> |
|||
<u-input v-model="form1.name" :disabled=true/> |
|||
</u-form-item> |
|||
<u-form-item label="巡检内容" prop="content" required> |
|||
<u-input v-model="form1.content" :disabled=true/> |
|||
</u-form-item> |
|||
<u-form-item label="结果" prop="resultStr" required> |
|||
<u-input v-model="form1.resultStr" placeholder="请选择" :disabled=true /> |
|||
<u-select v-model="show" mode ='single-column' :list="list" @confirm="confirm"></u-select> |
|||
<u-button type="primary" @click="show = true">选择</u-button> |
|||
</u-form-item> |
|||
<u-form-item label="未完成原因" :required="causeFlag" > |
|||
<u-input v-model="form1.uncompletedCause" placeholder="请输入未完成原因" :disabled="causeDisabled" /> |
|||
</u-form-item> |
|||
</u-form> |
|||
</view> |
|||
<div class="line"></div> |
|||
<view class="footer"> |
|||
<view class="btns" > |
|||
<u-button type="primary" @click="submitForm1()" :loading='loading' :disabled='loading'>提交</u-button> |
|||
</view> |
|||
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> |
|||
</view> |
|||
<!-- 验证完结--> |
|||
<u-popup v-model="isVerifyShowSuccess" mode="center" border-radius="14"> |
|||
<view class="popup-title">意见</view> |
|||
<view class="popup"> |
|||
<textarea v-model="data.applyContent" placeholder="请输入内容"></textarea> |
|||
</view> |
|||
<view class="popup-footer"> |
|||
<view class="sure" @click="apply('APPROVEPASS')">通过</view> |
|||
<view class="reject" @click="apply('APPROVEREJECTED')" style="color: red;">驳回</view> |
|||
</view> |
|||
</u-popup> |
|||
|
|||
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> |
|||
</view> |
|||
<!-- 详情 create用--> |
|||
<view class="detail-container" v-if="show2"> |
|||
<view class="popup" > |
|||
<!-- 表单 --> |
|||
<u-form :model="form2" label-width="160rpx"> |
|||
<u-form-item label="工单编号" prop="number" required> |
|||
<u-input v-model="form2.number" :disabled=true/> |
|||
</u-form-item> |
|||
<u-form-item label="巡检项" prop="chargePeoples" required> |
|||
<view class="select" @click="addItem()"> |
|||
<view class="input" v-if='form2.name'> |
|||
{{form2.name}} |
|||
</view> |
|||
<view class="placeholder" v-else> |
|||
请选择非必选巡检项 |
|||
</view> |
|||
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon> |
|||
</view> |
|||
</u-form-item> |
|||
</u-form> |
|||
<!-- 弹出非必选巡检项 --> |
|||
<u-popup v-model="isShowItem" mode="center" border-radius="14"> |
|||
<view class="popup-title">非必选巡检项</view> |
|||
<view class="popup"> |
|||
<u-checkbox-group @change="checkboxItemChange"> |
|||
<u-checkbox v-model="item.checked" v-for="(item, index) in itemList" :key="index" |
|||
:name="item.itemName">{{item.itemName}}</u-checkbox> |
|||
</u-checkbox-group> |
|||
</view> |
|||
<view class="popup-footer"> |
|||
<view @click="isShowItem = false">取消</view> |
|||
<view class="sure" @click="chooseItem">确认</view> |
|||
</view> |
|||
</u-popup> |
|||
<view class="footer"> |
|||
<view class="btns" > |
|||
<u-button type="primary" @click="submitForm2()" :loading='loading' :disabled='loading'>提交</u-button> |
|||
</view> |
|||
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
|
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { |
|||
onLoad, |
|||
onShow |
|||
} from '@dcloudio/uni-app' |
|||
import { |
|||
ref, |
|||
getCurrentInstance |
|||
} from 'vue' |
|||
|
|||
import * as inspectionOrderApi from "@/api/eam/inspection" |
|||
|
|||
const { proxy } = getCurrentInstance() |
|||
const subList = ref([]) |
|||
const data = ref({}) |
|||
const loading = ref(false) |
|||
const number = ref('') |
|||
const show = ref(false) |
|||
|
|||
const show1 = ref(false) |
|||
const show2 = ref(false) |
|||
const isShowItem = ref(false) |
|||
const itemList = ref([])//查询非必选巡检项List |
|||
const chooseItemList = ref([])//选中非必选巡检项List |
|||
|
|||
|
|||
|
|||
|
|||
const current = ref(0) |
|||
const id = ref('') |
|||
const type = ref('')//设备类型 设备/工装 |
|||
const causeFlag = ref(false) |
|||
const causeDisabled = ref(false) |
|||
|
|||
const list = ref([{ |
|||
label: '完成', |
|||
value: '0' |
|||
}, { |
|||
label: '未完成', |
|||
value: '1' |
|||
}]) |
|||
|
|||
const form1 = ref({ |
|||
id:"", |
|||
masterId:"", |
|||
number: "", |
|||
result:"", |
|||
resultStr:"", |
|||
uncompletedCause: "", |
|||
content:"", |
|||
}) |
|||
|
|||
const form2 = ref({ |
|||
id:"", |
|||
masterId:"", |
|||
number: "", |
|||
name:"", |
|||
}) |
|||
|
|||
function addItem(){ |
|||
isShowItem.value = true |
|||
} |
|||
|
|||
function checkboxItemChange(e) { |
|||
chooseItemList.value = e |
|||
} |
|||
|
|||
function chooseItem() { |
|||
form2.value.name = chooseItemList.value.join(',') |
|||
isShowItem.value = false |
|||
} |
|||
|
|||
|
|||
function submitForm1(){ |
|||
// 校验 |
|||
if (form1.value.resultStr.length == 0) { |
|||
proxy.$modal.alert('请选择结果') |
|||
return; |
|||
} |
|||
if(form1.value.resultStr == '未完成' && form1.value.uncompletedCause.length == 0) { |
|||
proxy.$modal.alert('请输入未完成原因') |
|||
return; |
|||
} |
|||
|
|||
proxy.$modal.confirm("是否确认提交").then(()=>{ |
|||
proxy.$modal.loading('加载中') |
|||
inspectionOrderApi.inspectionOrderItemUpdate(form1.value).then((res) => { |
|||
proxy.$modal.closeLoading() |
|||
if(res.data){ |
|||
proxy.$modal.showToast('成功') |
|||
setTimeout(() => { |
|||
proxy.$tab.navigateBack() |
|||
loading.value = false |
|||
proxy.$modal.closeLoading() |
|||
}, 1000) |
|||
} |
|||
}).catch(() => { |
|||
proxy.$modal.closeLoading() |
|||
loading.value = false |
|||
}) |
|||
}) |
|||
} |
|||
|
|||
function submitForm2(){ |
|||
// 校验 |
|||
if (form2.value.name.length == 0) { |
|||
proxy.$modal.alert('请选择非必须巡检项') |
|||
return; |
|||
} |
|||
proxy.$modal.confirm("是否确认提交").then(()=>{ |
|||
proxy.$modal.loading('加载中') |
|||
inspectionOrderApi.inspectionOrderItemCreate(form2.value).then((res) => { |
|||
proxy.$modal.closeLoading() |
|||
console.log(res) |
|||
if(res.code == 0){ |
|||
proxy.$modal.showToast('成功') |
|||
setTimeout(() => { |
|||
proxy.$tab.navigateBack() |
|||
loading.value = false |
|||
proxy.$modal.closeLoading() |
|||
}, 1000) |
|||
}else{ |
|||
proxy.$modal.showToast(res.msg) |
|||
} |
|||
}).catch(() => { |
|||
proxy.$modal.closeLoading() |
|||
loading.value = false |
|||
}) |
|||
|
|||
}) |
|||
} |
|||
|
|||
const confirm =(e)=>{ |
|||
if(e[0].value == '0'){ |
|||
form1.value.result = '0' |
|||
form1.value.resultStr = '完成' |
|||
form1.value.uncompletedCause = '' |
|||
causeFlag.value = false |
|||
causeDisabled.value = true |
|||
} |
|||
if(e[0].value == '1'){ |
|||
form1.value.result = '1' |
|||
form1.value.resultStr = '未完成' |
|||
causeFlag.value = true |
|||
causeDisabled.value = false |
|||
} |
|||
} |
|||
onLoad(async (option) => { |
|||
if (option.data && option.type == 'update') { |
|||
show1.value = true |
|||
show2.value = false |
|||
data.value = JSON.parse(decodeURIComponent(option.data)) |
|||
console.log(data.value) |
|||
form1.value.id = data.value.id |
|||
form1.value.masterId = data.value.masterId |
|||
form1.value.number = data.value.number |
|||
form1.value.name = data.value.name |
|||
form1.value.content = data.value.content |
|||
if(data.value.result == '0'){ |
|||
form1.value.resultStr = '完成' |
|||
}else if(data.value.result == '1'){ |
|||
form1.value.resultStr = '未完成' |
|||
}else{ |
|||
form1.value.resultStr = '' |
|||
} |
|||
form1.value.uncompletedCause = data.value.uncompletedCause |
|||
}else if(option.data && option.type == 'create'){ |
|||
show1.value = false |
|||
show2.value = true |
|||
data.value = JSON.parse(decodeURIComponent(option.data)) |
|||
console.log(data.value) |
|||
form2.value.masterId = data.value.id |
|||
form2.value.number = data.value.number |
|||
//查询非必选巡检项 |
|||
const paras1 = { |
|||
planNumber: data.value.planNumber, |
|||
available: 'TRUE', |
|||
isSelectd: 'false' |
|||
} |
|||
inspectionOrderApi.inspectionPlanItemList(paras1).then((res) => { |
|||
if (res.data) { |
|||
itemList.value = res.data |
|||
} |
|||
}) |
|||
|
|||
} |
|||
if (option.type) type.value = option.type; |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.detail-container { |
|||
min-height: 100vh; |
|||
background: white; |
|||
} |
|||
|
|||
.line { |
|||
background: #f5f5f5; |
|||
height: 20rpx; |
|||
} |
|||
|
|||
.info { |
|||
background: white; |
|||
} |
|||
|
|||
.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: 160rpx; |
|||
} |
|||
|
|||
&:nth-child(2) { |
|||
color: #888888; |
|||
flex: 1; |
|||
width: 0px; |
|||
word-wrap: break-word; |
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
|||
.dec2 { |
|||
padding: 10rpx 30rpx; |
|||
display: flex; |
|||
|
|||
view { |
|||
&:nth-child(1) { |
|||
width: 160rpx; |
|||
} |
|||
|
|||
&: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; |
|||
} |
|||
|
|||
::v-deep .u-radio-group { |
|||
display: grid !important; |
|||
padding-bottom: 20rpx; |
|||
} |
|||
|
|||
.images { |
|||
display: flex; |
|||
width: 100%; |
|||
|
|||
image { |
|||
width: 30%; |
|||
margin-right: 20rpx; |
|||
height: 200rpx; |
|||
border-radius: 10rpx; |
|||
} |
|||
} |
|||
|
|||
.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); |
|||
|
|||
} |
|||
} |
|||
</style> |
@ -0,0 +1,242 @@ |
|||
<template> |
|||
<!-- 巡检工单 --> |
|||
<view class="container"> |
|||
<u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff' |
|||
title="巡检工单"> |
|||
<template v-slot:right> |
|||
<u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm" ></u-icon> |
|||
</template> |
|||
</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.number}} |
|||
</view> |
|||
<u-tag text="待派工" v-if="item.status == '0'" bg-color='rgba(255,255,255,0)' color='#fe8463' border-color='#fe8463' type="primary" shape='circle'/> |
|||
<u-tag text="已逾期" v-else-if="item.status=='1'" bg-color='rgba(255,255,255,0)' color='#d7d7d7' border-color='#d7d7d7 ' type="warning" shape='circle'/> |
|||
<u-tag text="已退单" v-else-if="item.status=='2'" bg-color='rgba(255,255,255,0)' color='#e01f54' border-color='#e01f54' type="success" shape='circle'/> |
|||
<u-tag text="待接单" v-else-if="item.status=='3'" bg-color='rgba(255,255,255,0)' color='#005eaa' border-color='#005eaa ' type="error" shape='circle'/> |
|||
<u-tag text="待执行" v-else-if="item.status=='4'" bg-color='rgba(255,255,255,0)' color='#2EC7C9' border-color='#2EC7C9' type="info" shape='circle'/> |
|||
<u-tag text="执行中" v-else-if="item.status=='5'" bg-color='rgba(255,255,255,0)' color='#2ba471' border-color='#2ba471' type="info" shape='circle'/> |
|||
<u-tag text="待验证" v-else-if="item.status=='6'" bg-color='rgba(255,255,255,0)' color='#2ba471' border-color='#2ba471' type="info" shape='circle'/> |
|||
<u-tag text="已完成" v-else-if="item.status=='7'" bg-color='rgba(255,255,255,0)' color='#2ba471' border-color='#2ba471' type="info" shape='circle'/> |
|||
<u-tag text="已作废" v-else-if="item.status=='8'" 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.type=='DEVICE'?'设备':item.type=='EQUIPMENT'?'工装':''}}</span> |
|||
</view> |
|||
<view class="dec"> |
|||
{{`${params.type=='DEVICE'?'设备' : '工装'}`}}编号:<span>{{item.equipmentCode}}</span> |
|||
</view> |
|||
<view class="dec"> |
|||
所属车间:<span>{{item.workshopCode}}</span> |
|||
</view> |
|||
<view class="dec"> |
|||
班组:<span>{{item.classType}}</span> |
|||
</view> |
|||
<view class="dec"> |
|||
巡检人:<span>{{item.maintenancer}}</span> |
|||
</view> |
|||
<view class="dec"> |
|||
完成时间:<span>{{`${$time.formatDate(item.completionTime)}`}}</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 setup lang="ts"> |
|||
import { |
|||
onLoad, |
|||
onShow, |
|||
onReachBottom |
|||
} from '@dcloudio/uni-app' |
|||
|
|||
import { |
|||
ref, |
|||
getCurrentInstance, |
|||
nextTick |
|||
} from 'vue' |
|||
|
|||
import * as inspectionOrderApi from "@/api/eam/inspection" |
|||
|
|||
const { proxy } = getCurrentInstance() |
|||
const params = ref({ |
|||
pageNo: 1, |
|||
pageSize: 10, |
|||
type: '', |
|||
}) |
|||
const status = ref('loadmore') //是否显示没有更多了 |
|||
const list = ref([]) |
|||
// function itemClick(item, index) { |
|||
// proxy.$tab.navigateTo(`/pages/spotCheckOrder/detail?type=${params.value.type}&number=${item.number}&data=${encodeURIComponent(JSON.stringify(item))}`) |
|||
// } |
|||
// function addForm(item) { |
|||
// proxy.$tab.navigateTo(`/pages/spotCheckOrder/addForm?type=${params.value.type}&data=${encodeURIComponent(JSON.stringify(item))}`) |
|||
// } |
|||
|
|||
async function getList() { |
|||
if (status.value == 'nomore') return; |
|||
status.value = 'loading'; |
|||
proxy.$modal.loading('加载中') |
|||
await inspectionOrderApi.inspectionOrderPage(params.value).then((res) => { |
|||
proxy.$modal.closeLoading() |
|||
if (res.data.list.length > 0) { |
|||
list.value = list.value.concat(res.data.list); |
|||
params.value.pageNo++; |
|||
status.value = 'loadmore' |
|||
} else { |
|||
status.value = 'nomore' |
|||
} |
|||
}).catch(() => { |
|||
proxy.$modal.closeLoading() |
|||
}) |
|||
console.log(list.value) |
|||
} |
|||
onLoad((option) => { |
|||
if (option.type) params.value.type = option.type; |
|||
if (option.flag) params.value.flag = option.flag; |
|||
}) |
|||
onShow(() => { |
|||
params.value.pageNo = 1 |
|||
list.value = [] |
|||
status.value = 'loadmore' |
|||
getList() |
|||
|
|||
}) |
|||
onReachBottom(() => { |
|||
status.value = 'loading' |
|||
getList() |
|||
}) |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.container{ |
|||
background: #f5f5f5; |
|||
min-height: 100vh; |
|||
} |
|||
.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; |
|||
word-wrap: break-word; |
|||
} |
|||
|
|||
.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,93 @@ |
|||
<template> |
|||
<view class="add-form-container"> |
|||
<view class="list"> |
|||
<view class="title"> |
|||
<span>*</span>点检类型选择 |
|||
</view> |
|||
<view class="add-btn"> |
|||
<u-button type="primary" @click="openDevice"><u-icon name="plus-circle" color="#ffffff" |
|||
size="36"></u-icon>设备点检</u-button> |
|||
</view> |
|||
<view class="add-btn"> |
|||
<u-button type="primary" @click="openTool"><u-icon name="plus-circle" color="#ffffff" |
|||
size="36"></u-icon>工装点检</u-button> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import { |
|||
ref, |
|||
getCurrentInstance |
|||
} from 'vue' |
|||
const { proxy } = getCurrentInstance() |
|||
function openDevice() { |
|||
proxy.$tab.navigateTo(`/pages/eam/spotcheckOrder/index?type=DEVICE&flag=2`) |
|||
} |
|||
function openTool() { |
|||
proxy.$tab.navigateTo(`/pages/eam/spotcheckOrder/index?type=EQUIPMENT&flag=2`) |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.add-form-container { |
|||
min-height: calc(100vh - 140rpx); |
|||
background: white; |
|||
padding: 0px 0rpx 140rpx; |
|||
} |
|||
|
|||
.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; |
|||
} |
|||
|
|||
} |
|||
} |
|||
.title { |
|||
padding: 32rpx 0rpx; |
|||
position: relative; |
|||
|
|||
span { |
|||
position: absolute; |
|||
left: -16rpx; |
|||
color: #fa3534; |
|||
top: 19px; |
|||
} |
|||
} |
|||
.add-btn { |
|||
display: flex; |
|||
justify-content: flex-start; |
|||
align-items: center; |
|||
margin-top: 20px; |
|||
} |
|||
|
|||
</style> |
Loading…
Reference in new issue