Browse Source

fix: 检修工单

master
songguoqiang 7 months ago
parent
commit
cab86a7fa5
  1. 4
      src/api/overhaulOrder.js
  2. 4
      src/api/upkeepOrder.js
  3. 269
      src/components/item/slectItemList.vue
  4. 2
      src/pages/deviceReport/index.vue
  5. 36
      src/pages/index.vue
  6. 129
      src/pages/overhaulOrder/addForm.vue
  7. 8
      src/pages/overhaulOrder/addServiceRecord.vue
  8. 138
      src/pages/overhaulOrder/detail.vue
  9. 9
      src/pages/overhaulOrder/index.vue
  10. 96
      src/pages/repairOrder/addServiceRecord.vue
  11. 159
      src/pages/repairOrder/detail.vue
  12. 4
      src/pages/repairOrder/index.vue
  13. 4
      src/pages/repairOrder/transfer.vue
  14. 8
      src/pages/upkeepOrder/addServiceRecord.vue
  15. 73
      src/pages/upkeepOrder/detail.vue
  16. 18
      src/static/images/icon11.svg

4
src/api/overhaulOrder.js

@ -17,6 +17,10 @@ export function overhaulOrderPage(params) {
export function orderClick(params) { export function orderClick(params) {
return http.get('/eam/device-inspection-job-main/onClick',{params}) return http.get('/eam/device-inspection-job-main/onClick',{params})
} }
export function onVerify(params) {
return http.get('/eam/device-inspection-job-main/onVerify',{params})
}
// 添加维修工单子项维修内容 // 添加维修工单子项维修内容
export function overhaulOrderDetailCreate(data) { export function overhaulOrderDetailCreate(data) {
return http.post('/eam/device-inspection-job-detail/create',data) return http.post('/eam/device-inspection-job-detail/create',data)

4
src/api/upkeepOrder.js

@ -18,6 +18,10 @@ export function orderClick(params) {
return http.get('/eam/device-maintain-job-main/orderClick',{params}) return http.get('/eam/device-maintain-job-main/orderClick',{params})
} }
export function orderClickVerify(params) {
return http.get('/eam/device-maintain-job-main/orderClickVerify',{params})
}
// 完成保养工单 // 完成保养工单
export function orderClickFinish(params) { export function orderClickFinish(params) {
return http.get('/eam/device-maintain-job-main/orderClickFinish',{params}) return http.get('/eam/device-maintain-job-main/orderClickFinish',{params})

269
src/components/item/slectItemList.vue

@ -0,0 +1,269 @@
<template>
<!-- 选择备件 -->
<u-popup v-model="props.isShowSelectItem" mode="center" border-radius="14">
<view class="popup-title">选择备件</view>
<view class="popup">
<!-- <input v-model="searchKeyword" @input="filterItems" placeholder="搜索备件名称"> -->
<u-search placeholder="搜索" v-model="form1.searchName" @change="searchItem" clearabled=false></u-search>
<!-- <u-input v-model="form1.searchName" placeholder="请输入备件名称" @change="searchItem"/>
<u-button>搜索</u-button> -->
<view class="list">
<view class="item" v-for="(item,index) in singleColumnList" :key="index" @click="chooseItem(item)">
<u-checkbox v-model="item.checked" shape="circle" style="margin-top: 8rpx;"></u-checkbox>
<view class="right">
<view class="item-name">
备件名称:<span>{{item.name}}</span>
</view>
<view class="item-dec">
备件编码:<span>{{item.number}}</span>
</view>
</view>
</view>
</view>
</view>
<view class="popup-footer">
<view @click="chooseItem1(0)">取消</view>
<view class="sure" @click="chooseItem1(1)">确认</view>
</view>
</u-popup>
</template>
<script setup lang="ts">
import {
ref,
defineProps,
defineEmits,
getCurrentInstance,
watch
} from 'vue'
import {
onLoad,
} from '@dcloudio/uni-app'
import * as repairOrderApi from "@/api/repairOrder.js"
const props = defineProps({
isShowSelectItem: {
type: Boolean,
default: () => { return false },
require: true
},
singleColumnList:{
type: Array,
default: () => { return [] },
require: false
},
});
// isShowSelectItem
watch(() => props.isShowSelectItem, (newValue, oldValue) => {
if(newValue){
console.log('props.isShowSelectItem',props.isShowSelectItem);
form1.value.searchName = null
form1.value.temporarilyNumber = null
form1.value.temporarilyName = null
}
});
const { proxy } = getCurrentInstance()
const repairOrderList = ref([])
const itemList = ref([])
const type = ref('')
const isShowSelectItem = ref(false);
const selectVal = ref(null);
const emits = defineEmits(['searchItem','chooseItem1']);
const form1 = ref({
number: "",
name:"",
qty: 0,
temporarilyNumber:"",//
temporarilyName:"",//
searchName:"",//
})
onLoad((option) => {
if (option.type) type.value = option.type;
if (option.type) isShowSelectItem.value = option.isShowSelectItem;//
if (option.selectVal) selectVal.value = option.selectVal;//
})
//
function chooseItem1(type){
if(type==1){
form1.value.number = form1.value.temporarilyNumber
form1.value.name = form1.value.temporarilyName
}
emits('chooseItem1',type,form1);
}
function searchItem(){
emits('searchItem',form1.value.searchName);
}
function chooseItem(item){
console.log('props.isShowSelectItem',props.isShowSelectItem);
console.log('props.singleColumnList',props.singleColumnList);
let arr = props.singleColumnList.filter(cur=>cur.number != item.number)
arr.forEach(item=>{
item.checked = false
})
item.checked = !item.checked
let arr1 = props.singleColumnList.filter(cur=>cur.number == item.number)
form1.value.temporarilyNumber = arr1[0].number;
form1.value.temporarilyName = arr1[0].name;
}
</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>

2
src/pages/deviceReport/index.vue

@ -2,7 +2,7 @@
<!-- 设备报修 --> <!-- 设备报修 -->
<view class="container"> <view class="container">
<u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff' <u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff'
title="设备报修"> title="报修申请">
<template v-slot:right> <template v-slot:right>
<u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm"></u-icon> <u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm"></u-icon>
</template> </template>

36
src/pages/index.vue

@ -38,16 +38,24 @@
</view> </view>
</view> </view>
<view class="box"> <view class="box">
<view class="" v-if="deviceMenus.length>0"> <!-- <view class="" v-if="deviceMenus.length>0"> -->
<view class="">
<view class="title">设备维护</view> <view class="title">设备维护</view>
<u-row gutter="16" style="padding:0px 20rpx ;"> <u-row gutter="16" style="padding:0px 20rpx ;">
<u-col span="3" v-for="(item,index) in store.deviceMenus" :key='index'> <u-col span="3">
<view class="icon-item" @click="open('/pages/deviceReport/index?type=DEVICE')" <view class="icon-item" @click="open('/pages/deviceReport/index?type=DEVICE')"
v-if="item.path =='deviceRequest'"> >
<image src="../static/images/icon4.svg" mode=""></image> <image src="../static/images/icon4.svg" mode=""></image>
<view>设备报修</view> <view>设备报修</view>
</view> </view>
</u-col>
<u-col span="3">
<view class="icon-item" @click="open('/pages/repairOrder/index?type=DEVICE&flag=2')" >
<image src="../static/images/icon11.svg" mode=""></image>
<view>报修确认</view>
</view>
</u-col>
<u-col span="3" v-for="(item,index) in store.deviceMenus" :key='index'>
<view class="icon-item" @click="open('/pages/repairOrder/index?type=DEVICE')" <view class="icon-item" @click="open('/pages/repairOrder/index?type=DEVICE')"
v-if="item.path =='deviceMaintenanceJob'"> v-if="item.path =='deviceMaintenanceJob'">
<image src="../static/images/icon5.svg" mode=""></image> <image src="../static/images/icon5.svg" mode=""></image>
@ -73,15 +81,29 @@
</view> </view>
<view class="" v-if="moldMenus.length>0"> <!-- <view class="" v-if="moldMenus.length>0"> -->
<view class="">
<view class="title">模具维护</view> <view class="title">模具维护</view>
<u-row gutter="16"> <u-row gutter="16">
<u-col span="3" v-for="(item,index) in moldMenus" :key='index'> <u-col span="3">
<view class="icon-item" @click="open('/pages/deviceReport/index?type=MOLD')" <view class="icon-item" @click="open('/pages/deviceReport/index?type=MOLD')"
v-if="item.path =='moldRequest'"> >
<image src="../static/images/icon4.svg" mode=""></image> <image src="../static/images/icon4.svg" mode=""></image>
<view>模具报修</view> <view>模具报修</view>
</view> </view>
</u-col>
<u-col span="3">
<view class="icon-item" @click="open('/pages/repairOrder/index?type=MOLD&flag=2')" >
<image src="../static/images/icon11.svg" mode=""></image>
<view>报修确认</view>
</view>
</u-col>
<u-col span="3" v-for="(item,index) in moldMenus" :key='index'>
<!-- <view class="icon-item" @click="open('/pages/deviceReport/index?type=MOLD')"
v-if="item.path =='moldRequest'">
<image src="../static/images/icon4.svg" mode=""></image>
<view>模具报修</view>
</view> -->
<view class="icon-item" @click="open('/pages/repairOrder/index?type=MOLD')" <view class="icon-item" @click="open('/pages/repairOrder/index?type=MOLD')"
v-if="item.path =='moldMaintenanceJob'"> v-if="item.path =='moldMaintenanceJob'">
<image src="../static/images/icon5.svg" mode=""></image> <image src="../static/images/icon5.svg" mode=""></image>

129
src/pages/overhaulOrder/addForm.vue

@ -57,7 +57,34 @@
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon> <u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon>
</view> </view>
</u-form-item> </u-form-item>
<u-form-item label="维修人员" prop="maintenance" required>
<view class="select" @click="openSelecUser('maintenance')">
<view class="input" v-if='form.maintenance'>
{{selectFormatRadin(form.maintenance,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> </u-form>
<!-- 选择维修人员 -->
<u-popup v-model="isShowSelecUser" mode="center" border-radius="14">
<view class="popup-title">选择维修人员</view>
<view class="popup">
<u-radio-group v-model="form.maintenance"
@change="radioGroupChange('maintenance',form.maintenance,selecUserList)">
<u-radio v-for="(item, index) in selecUserList" :key="index" :name="item.id">
{{item.name}}
</u-radio>
</u-radio-group>
</view>
<view class="popup-footer">
<view @click="isShowSelecUser = false">取消</view>
<view class="sure" @click="chooseUser">确认</view>
</view>
</u-popup>
<view class="footer"> <view class="footer">
<view class="btns"> <view class="btns">
<button class="reset" @click="reset">重置</button> <button class="reset" @click="reset">重置</button>
@ -65,6 +92,8 @@
</view> </view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> <view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view> </view>
<u-select v-model="singleColumnShow" mode="single-column" :default-value='singleColumnDefaultValue' <u-select v-model="singleColumnShow" mode="single-column" :default-value='singleColumnDefaultValue'
:list="singleColumnList" @confirm="chooseSingleColumn" @cancle='singleColumnShow = false'></u-select> :list="singleColumnList" @confirm="chooseSingleColumn" @cancle='singleColumnShow = false'></u-select>
</view> </view>
@ -83,6 +112,7 @@
import * as dictApi from "@/api/dict.js" import * as dictApi from "@/api/dict.js"
import * as repairOrderApi from "@/api/repairOrder.js" import * as repairOrderApi from "@/api/repairOrder.js"
import * as deviceApi from "@/api/device.js" import * as deviceApi from "@/api/device.js"
import * as deptApi from "@/api/dept.js"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const loading = ref(false) const loading = ref(false)
@ -96,7 +126,8 @@
faultType: '', faultType: '',
deviceName: '', deviceName: '',
deviceNumber: '', deviceNumber: '',
faultTypeName: '' faultTypeName: '',
maintenance:''
}) })
@ -108,6 +139,10 @@
const isDisabled = ref(false) const isDisabled = ref(false)
const choosesingleColumnItem = ref([]) const choosesingleColumnItem = ref([])
const msg = ref('') const msg = ref('')
//
const selecUserList = ref([])//
const isShowSelecUser = ref(false)
const chooseUserInfo = ref({})
function submit() { function submit() {
// //
if (!form.value.describes) { if (!form.value.describes) {
@ -127,6 +162,10 @@
proxy.$modal.showToast('请选择故障类型') proxy.$modal.showToast('请选择故障类型')
return; return;
} }
if (!form.value.maintenance) {
proxy.$modal.showToast('请选择维修人员')
return;
}
const data = { const data = {
id: form.value && form.value.id ? form.value.id : '', id: form.value && form.value.id ? form.value.id : '',
describes: form.value.describes, describes: form.value.describes,
@ -135,6 +174,7 @@
factoryAreaNumber: form.value.factoryAreaNumber, factoryAreaNumber: form.value.factoryAreaNumber,
type: type.value, type: type.value,
faultType: form.value.faultType, faultType: form.value.faultType,
maintenance:form.value.maintenance
} }
if (form.value.id) { if (form.value.id) {
proxy.$modal.confirm('是否修改检修工单').then(() => { proxy.$modal.confirm('是否修改检修工单').then(() => {
@ -200,7 +240,8 @@
faultType: '', faultType: '',
deviceName:'', deviceName:'',
deviceNumber:'', deviceNumber:'',
faultTypeName:'' faultTypeName:'',
maintenance:''
} }
isDisabled.value = false isDisabled.value = false
} }
@ -339,6 +380,50 @@
}) })
}) })
//
function openSelecUser(fieldName) {
field.value = fieldName
getSelecUser();
isShowSelecUser.value = true
}
function radioGroupChange(field, e, list) {
form.value.maintenance = e;
chooseUserInfo.value = e
}
//
function chooseUser() {
form.value[field.value] = chooseUserInfo.value
isShowSelecUser.value = false
}
//
async function getSelecUser() {
let data = {
classType: type.value,
factoryAreaNumber: form.value.factoryAreaNumber,
}
let arr = []
if (form.value.maintenances) {
arr = form.value.maintenances.split(',')
}
await deptApi.getSelecUser(data).then(res => {
res.data.forEach(item => {
item.checked = false
arr.forEach(cur => {
if (item.id == cur) {
item.checked = true
}
})
})
selecUserList.value = res.data
})
}
//
function selectFormatRadin(val, array) {
let str = array.filter(item => item.id == val)[0].name
return str
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -455,4 +540,44 @@
} }
} }
.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;
}
.item-name{
font-size: 30rpx;
font-weight: bold;
padding: 20rpx 0px 0px;
}
.item-dec{
color: #8f8f8f;
}
</style> </style>

8
src/pages/overhaulOrder/addServiceRecord.vue

@ -412,7 +412,12 @@
} }
// //
async function getSparePartsList() { async function getSparePartsList() {
await sparePartsApi.getSparePartsList().then(res => { number =deviceNumber.value
let param = {
number:number,
name:name
}
await sparePartsApi.getSparePartsList(param).then(res => {
res.data.map(item => { res.data.map(item => {
item.value = item.number item.value = item.number
item.label = item.name item.label = item.name
@ -492,6 +497,7 @@
if (option.type) type.value = option.type; if (option.type) type.value = option.type;
if (option.factoryAreaNumber) factoryAreaNumber.value = option.factoryAreaNumber; if (option.factoryAreaNumber) factoryAreaNumber.value = option.factoryAreaNumber;
if (option.number) form.value.number = option.number; if (option.number) form.value.number = option.number;
if (option.deviceNumber) form.value.deviceNumber = option.deviceNumber;
if (option.data && JSON.parse(decodeURIComponent(option.data)) && JSON.parse(decodeURIComponent(option if (option.data && JSON.parse(decodeURIComponent(option.data)) && JSON.parse(decodeURIComponent(option
.data)).id) { .data)).id) {
form.value = JSON.parse(decodeURIComponent(option.data)) form.value = JSON.parse(decodeURIComponent(option.data))

138
src/pages/overhaulOrder/detail.vue

@ -42,7 +42,7 @@
<view class="dec" v-if="current == 0"> <view class="dec" v-if="current == 0">
<view class="dec-item"> <view class="dec-item">
<view>设备编号</view> <view>设备编号</view>
<view>{{data.number}}</view> <view>{{data.deviceNumber}}</view>
</view> </view>
<view class="dec-item"> <view class="dec-item">
<view>设备名称</view> <view>设备名称</view>
@ -122,7 +122,7 @@
</view> </view>
<!-- <u-icon name="minus-circle" color="#aaaaaa" size="60" ></u-icon> --> <!-- <u-icon name="minus-circle" color="#aaaaaa" size="60" ></u-icon> -->
</view> </view>
<view class="add-btn" v-if="data.status == 'PROCCED'"> <view class="add-btn" v-if="data.status == 'PECEIVED'">
<u-button type="primary" @click="addSubForm('creat')"><u-icon name="plus-circle" color="#ffffff" <u-button type="primary" @click="addSubForm('creat')"><u-icon name="plus-circle" color="#ffffff"
size="36"></u-icon>添加检修内容</u-button> size="36"></u-icon>添加检修内容</u-button>
</view> </view>
@ -131,11 +131,25 @@
</view> </view>
<view class="footer"> <view class="footer">
<view class="btns"> <view class="btns">
<u-button type="primary" v-if="data.status == 'PROCCED'" @click="orderClick()" :loading='loading' <u-button type="primary" v-if="data.status == 'PECEIVED'" @click="orderClick(0)" :loading='loading'
:disabled='loading'>完成</u-button> :disabled='loading'>完成</u-button>
</view> </view>
<view class="btns" v-if="(data.status == 'COMPLETED')">
<u-button type="primary" @click="orderClickVerify()" :loading='loading' :disabled='loading'>验证完结</u-button>
</view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> <view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</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 @click="cancel">取消</view>
<view class="sure" @click="verify">确认</view>
</view>
</u-popup>
</view> </view>
</template> </template>
@ -169,6 +183,7 @@
const loading = ref(false) const loading = ref(false)
const type = ref('') const type = ref('')
const serviceList = ref([]) const serviceList = ref([])
const isVerifyShowSuccess = ref(false)//
function change(index) { function change(index) {
current.value = index current.value = index
@ -176,52 +191,81 @@
} }
// //
function addSubForm(clickType, item) { function addSubForm(clickType, item) {
if (data.value.status == 'COMPLETED') {
return
}
if (data.value.status == 'PENDING') { if (data.value.status == 'PENDING') {
proxy.$modal.showToast('请先接单') proxy.$modal.showToast('请先接单')
return return
} }
if (clickType == 'updata') { if (clickType == 'updata') {
proxy.$tab.navigateTo( proxy.$tab.navigateTo(
`/pages/overhaulOrder/addServiceRecord?type=${data.value.type}&factoryAreaNumber=${data.value.factoryAreaNumber}&number=${data.value.number}&data=${encodeURIComponent(JSON.stringify(item))}` `/pages/overhaulOrder/addServiceRecord?type=${data.value.type}&factoryAreaNumber=${data.value.factoryAreaNumber}&number=${data.value.number}&data=${encodeURIComponent(JSON.stringify(item))}&deviceNumber=${data.value.deviceNumber}`
) )
} else { } else {
proxy.$tab.navigateTo( proxy.$tab.navigateTo(
`/pages/overhaulOrder/addServiceRecord?type=${data.value.type}&factoryAreaNumber=${data.value.factoryAreaNumber}&number=${data.value.number}` `/pages/overhaulOrder/addServiceRecord?type=${data.value.type}&factoryAreaNumber=${data.value.factoryAreaNumber}&number=${data.value.number}&deviceNumber=${data.value.deviceNumber}`
) )
} }
} }
// APP // APP
function orderClick() { function orderClick(type1) {
if (!serviceList.value || serviceList.value && serviceList.value.length == 0) {
proxy.$modal.showToast('请添加检修内容')
return;
}
const paramseData = { const paramseData = {
// number: data.number, // number: data.number,
// status: data.status, // status: data.status,
id: data.value.id, id: data.value.id,
verifyContent:data.value.applyContent
// requestNumber: '' // requestNumber: ''
} }
let tips = '是否完成' if(type1==0){//
proxy.$modal.confirm(tips).then(() => { if (!serviceList.value || serviceList.value && serviceList.value.length == 0) {
proxy.$modal.loading('加载中') proxy.$modal.showToast('请添加检修内容')
loading.value = true return;
overhaulOrderApi.orderClick(paramseData).then((res) => { }
if (res.data) {
proxy.$modal.showToast('操作成功') let tips = '是否完成?'
setTimeout(() => { proxy.$modal.confirm(tips).then(() => {
proxy.$tab.navigateBack() proxy.$modal.loading('加载中')
loading.value = true
overhaulOrderApi.orderClick(paramseData).then((res) => {
if (res.data) {
proxy.$modal.showToast('操作成功')
setTimeout(() => {
proxy.$tab.navigateTo(`/pages/overhaulOrder/index?type=${type.value}`)
loading.value = false
}, 1500)
} else {
proxy.$modal.showToast('操作失败')
loading.value = false loading.value = false
}, 1500) }
} else { }).catch(() => {
proxy.$modal.showToast('操作失败') proxy.$modal.closeLoading()
loading.value = false loading.value = false
} })
}).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
}) })
}) }else if(type1==1){//
let tips = '是否验证完结?'
proxy.$modal.confirm(tips).then(async () => {
proxy.$modal.loading('加载中')
loading.value = true
overhaulOrderApi.onVerify(paramseData).then((res) => {
if (res.data) {
proxy.$modal.showToast('操作成功')
setTimeout(() => {
proxy.$tab.navigateTo(`/pages/overhaulOrder/index?type=${type.value}`)
loading.value = false
}, 1500)
} else {
proxy.$modal.showToast('操作失败')
loading.value = false
}
}).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
})
})
}
} }
// //
function getOverhaulOrderDetailList() { function getOverhaulOrderDetailList() {
@ -235,13 +279,39 @@
} }
// //
function delService(item) { function delService(item) {
proxy.$modal.confirm('确定删除维修内容吗?').then(() => { if(data.status == 'PECEIVED'){
proxy.$modal.loading('加载中') proxy.$modal.confirm('确定删除维修内容吗?').then(() => {
overhaulOrderApi.overhaulOrderDetailDelete(item.id).then((res) => { proxy.$modal.loading('加载中')
proxy.$modal.closeLoading() overhaulOrderApi.overhaulOrderDetailDelete(item.id).then((res) => {
getOverhaulOrderDetailList() proxy.$modal.closeLoading()
}).catch(() => { }) getOverhaulOrderDetailList()
}) }).catch(() => { })
})
}
}
/**
* 点击验证完结填写意见
*/
function orderClickVerify() {
data.value.applyContent = null;
isVerifyShowSuccess.value = true
}
/**
* 验证取消
*/
function cancel(){
data.applyContent = null;
isVerifyShowSuccess.value = false
}
/**
* 验证确认
*/
function verify() {
isVerifyShowSuccess.value = false
orderClick(1)
} }
onLoad(async (option) => { onLoad(async (option) => {
if (option.type) type.value = option.type; if (option.type) type.value = option.type;

9
src/pages/overhaulOrder/index.vue

@ -3,6 +3,7 @@
<view class="container"> <view class="container">
<u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff' <u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff'
title="检修工单"> title="检修工单">
<!-- <template v-slot:right v-if="isEngineer"> -->
<template v-slot:right> <template v-slot:right>
<u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm"></u-icon> <u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm"></u-icon>
</template> </template>
@ -69,6 +70,14 @@
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as overhaulOrderApi from "@/api/overhaulOrder.js" import * as overhaulOrderApi from "@/api/overhaulOrder.js"
import { useCountStore } from '@/store'
const store = useCountStore()
const isEngineer = ref(false)
if(store.roles.some(item=>item.indexOf('Engineer')>-1)){//
isEngineer.value = true
}else{
isEngineer.value = false
}
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const params = ref({ const params = ref({
pageNo: 1, pageNo: 1,

96
src/pages/repairOrder/addServiceRecord.vue

@ -92,15 +92,41 @@
<u-checkbox v-model="item.checked" v-for="(item, index) in selecUserList" :key="index" <u-checkbox v-model="item.checked" v-for="(item, index) in selecUserList" :key="index"
:name="item.id">{{item.name}}</u-checkbox> :name="item.id">{{item.name}}</u-checkbox>
</u-checkbox-group> </u-checkbox-group>
</view> </view>
<view class="popup-footer"> <view class="popup-footer">
<view @click="isShowSelecUser = false">取消</view> <view @click="isShowSelecUser = false">取消</view>
<view class="sure" @click="chooseUser">确认</view> <view class="sure" @click="chooseUser">确认</view>
</view> </view>
</u-popup> </u-popup>
<u-select v-model="singleColumnShow" mode="single-column" :default-value='singleColumnDefaultValue'
:list="singleColumnList" @confirm="chooseSingleColumn" @cancle='singleColumnShow = false'></u-select> <!-- 选择备件 -->
<!-- <u-popup v-model="isShowSelectItem" mode="center" border-radius="14">
<view class="popup-title">选择备件</view>
<view class="popup">
<u-search placeholder="搜索" v-model="form1.searchName" @change="searchItem" clearabled=false></u-search>
<view class="list">
<view class="item" v-for="(item,index) in singleColumnList" :key="index" @click="chooseItem(item)">
<u-checkbox v-model="item.checked" shape="circle" style="margin-top: 8rpx;"></u-checkbox>
<view class="right">
<view class="item-name">
备件名称1:<span>{{item.name}}</span>
</view>
<view class="item-dec">
备件编码:<span>{{item.number}}</span>
</view>
</view>
</view>
</view>
</view>
<view class="popup-footer">
<view @click="chooseItem1(0)">取消</view>
<view class="sure" @click="chooseItem1(1)">确认</view>
</view>
</u-popup> -->
<SelectItemList :isShowSelectItem=isShowSelectItem :singleColumnList=singleColumnList @searchItem='searchItem' @chooseItem1='chooseItem1'/>
<!-- <u-select v-model="singleColumnShow" mode="single-column" :default-value='singleColumnDefaultValue'
:list="singleColumnList" @confirm="chooseSingleColumn" @cancle='singleColumnShow = false'></u-select> -->
</view> </view>
</template> </template>
@ -115,11 +141,13 @@
import * as repairOrderApi from "@/api/repairOrder.js" import * as repairOrderApi from "@/api/repairOrder.js"
import * as sparePartsApi from "@/api/spareParts.js" import * as sparePartsApi from "@/api/spareParts.js"
import * as deptApi from "@/api/dept.js" import * as deptApi from "@/api/dept.js"
import SelectItemList from "../../components/item/slectItemList.vue"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const loading = ref(false) const loading = ref(false)
const type = ref('') const type = ref('')
const deviceNumber = ref('')
const isPopupShow = ref(false) const isPopupShow = ref(false)
const sparePartsList = ref([]) const sparePartsList = ref([])
@ -127,7 +155,7 @@
const singleColumnDefaultValue = ref([]) const singleColumnDefaultValue = ref([])
const singleColumnList = ref([]) const singleColumnList = ref([])
const field = ref('') const field = ref('')
const isShowSelectItem = ref(false)
const selecUserList = ref([]) const selecUserList = ref([])
const isShowSelecUser = ref(false) const isShowSelecUser = ref(false)
const form = ref({ const form = ref({
@ -141,7 +169,10 @@
const form1 = ref({ const form1 = ref({
number: "", number: "",
name:"", name:"",
qty: 0 qty: 0,
temporarilyNumber:"",//
temporarilyName:"",//
searchName:"",//
}) })
const factoryAreaNumber = ref('') const factoryAreaNumber = ref('')
@ -218,6 +249,34 @@
} }
} }
function chooseItem(item){
let arr = singleColumnList.value.filter(cur=>cur.number != item.number)
arr.forEach(item=>{
item.checked = false
})
item.checked = !item.checked
let arr1 = singleColumnList.value.filter(cur=>cur.number == item.number)
form1.value.temporarilyNumber = arr1[0].number;
form1.value.temporarilyName = arr1[0].name;
}
async function searchItem(name){
await getSparePartsList(null,name);
}
async function chooseItem1(type,forms){
if(!forms.value.number&&type==1){
proxy.$modal.showToast('请选择备件')
return
}
if(type==1){
form1.value.number = forms.value.temporarilyNumber
form1.value.name =forms.value.temporarilyName
}
await getSparePartsList(null,null);
isShowSelectItem.value = false;
}
// //
function reset() { function reset() {
form.value.describes = '' form.value.describes = ''
@ -277,7 +336,12 @@
} else { } else {
singleColumnDefaultValue.value = [] singleColumnDefaultValue.value = []
} }
singleColumnShow.value = true form1.value.searchName = "";
form1.value.temporarilyName = "";
form1.value.temporarilyNumber = "";
//singleColumnShow.value = true
isShowSelectItem.value = true;
singleColumnList.value = list
} }
// //
function chooseSingleColumn(e) { function chooseSingleColumn(e) {
@ -288,15 +352,22 @@
singleColumnShow.value = false singleColumnShow.value = false
} }
// //
async function getSparePartsList() { async function getSparePartsList(number,name) {
await sparePartsApi.getSparePartsList().then(res => { number =deviceNumber.value
let param = {
number:number,
name:name
}
await sparePartsApi.getSparePartsList(param).then(res => {
res.data.map(item => { res.data.map(item => {
item.value = item.number item.value = item.number
item.label = item.name item.label = item.name
}) })
sparePartsList.value = res.data sparePartsList.value = res.data
singleColumnList.value = sparePartsList.value
}).catch(() => { }) }).catch(() => { })
} }
// //
function open() { function open() {
form1.value = { form1.value = {
@ -333,6 +404,7 @@
} }
onLoad(async (option) => { onLoad(async (option) => {
if (option.type) type.value = option.type; if (option.type) type.value = option.type;
if (option.deviceNumber) deviceNumber.value = option.deviceNumber;
if (option.factoryAreaNumber) factoryAreaNumber.value = option.factoryAreaNumber; if (option.factoryAreaNumber) factoryAreaNumber.value = option.factoryAreaNumber;
if (option.number) form.value.number = option.number; if (option.number) form.value.number = option.number;
if (option.data && JSON.parse(decodeURIComponent(option.data)) && JSON.parse(decodeURIComponent(option if (option.data && JSON.parse(decodeURIComponent(option.data)) && JSON.parse(decodeURIComponent(option
@ -500,4 +572,12 @@
::v-deep .u-checkbox-group { ::v-deep .u-checkbox-group {
display: grid !important; display: grid !important;
} }
.item-name{
font-size: 30rpx;
font-weight: bold;
padding: 20rpx 0px 0px;
}
.item-dec{
color: #8f8f8f;
}
</style> </style>

159
src/pages/repairOrder/detail.vue

@ -5,8 +5,11 @@
<view class="title"> <view class="title">
<view>维修工单</view> <view>维修工单</view>
<view @click="transfer" <!-- <view @click="transfer"
v-if="data.status == 'PECEIVED' && (!serviceList || serviceList && serviceList.length == 0)">转办 v-if="data.status == 'PECEIVED' && (!serviceList || serviceList && serviceList.length == 0)">转办
</view> -->
<view @click="transfer"
v-if="data.status == 'PECEIVED'">转办
</view> </view>
</view> </view>
<view class="dec"> <view class="dec">
@ -73,6 +76,14 @@
<view>完成时间</view> <view>完成时间</view>
<view>{{$time.formatDate(data.completionTime)}}</view> <view>{{$time.formatDate(data.completionTime)}}</view>
</view> </view>
<view class="dec-item" v-if="data.applyTime">
<view>确认时间</view>
<view>{{$time.formatDate(data.applyTime)}}</view>
</view>
<view class="dec-item" v-if="data.applyContent">
<view>确认意见</view>
<view>{{data.applyContent}}</view>
</view>
<view class="dec-item" v-if="data.verifyTime"> <view class="dec-item" v-if="data.verifyTime">
<view>验证时间</view> <view>验证时间</view>
<view>{{$time.formatDate(data.verifyTime)}}</view> <view>{{$time.formatDate(data.verifyTime)}}</view>
@ -81,6 +92,10 @@
<view>验证人员</view> <view>验证人员</view>
<view>{{data.verifyer}}</view> <view>{{data.verifyer}}</view>
</view> </view>
<view class="dec-item" v-if="data.verifyContent">
<view>验证内容</view>
<view>{{data.verifyContent}}</view>
</view>
</view> </view>
@ -129,7 +144,7 @@
</view> </view>
<view class="dec-item"> <view class="dec-item">
<view>报修时间</view> <view>报修时间</view>
<view>{{$time.formatDate(data.createTime)}}</view> <view>{{data1.createTime? $time.formatDate(data1.createTime):null}}</view>
</view> </view>
<!-- <view>图片</view> --> <!-- <view>图片</view> -->
<view class="images"> <view class="images">
@ -147,7 +162,7 @@
</view> </view>
<view class="" @click.stop="delService(item)"> <view class="" @click.stop="delService(item)">
<u-icon name="trash" color="#aaaaaa" size="40" <u-icon name="trash" color="#aaaaaa" size="40"
v-if="data.status == 'PENDING' || data.status == 'PECEIVED'" v-if="data.status == 'PECEIVED'"
></u-icon> ></u-icon>
</view> </view>
@ -202,8 +217,11 @@
<u-button type="primary" @click="orderClickSuccess()" :loading='loading' <u-button type="primary" @click="orderClickSuccess()" :loading='loading'
:disabled='loading'>完成</u-button> :disabled='loading'>完成</u-button>
</view> </view>
<view class="btns" v-if="data.status == 'COMPLETED'"> <view class="btns" v-if="(data.status == 'COMPLETED' && !data.requestNumber) || (data.status == 'APPLYPASS')">
<u-button type="primary" @click="orderClick(3)" :loading='loading' :disabled='loading'>验证完结</u-button> <u-button type="primary" @click="orderClickVerify()" :loading='loading' :disabled='loading'>验证</u-button>
</view>
<view class="btns" v-if="data.status == 'COMPLETED' && data.requestNumber && data.applyer == store.id">
<u-button type="primary" @click="orderClickApply()" :loading='loading' :disabled='loading'>维修确认</u-button>
</view> </view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> <view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view> </view>
@ -222,6 +240,30 @@
<view class="sure" @click="sure">确认</view> <view class="sure" @click="sure">确认</view>
</view> </view>
</u-popup> </u-popup>
<!-- 验证完结-->
<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 @click="cancel">取消</view>
<view class="sure" @click="verify">确认</view>
</view>
</u-popup>
<!-- 维修确认弹出层 -->
<u-popup v-model="isApplyShowSuccess" 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('APPLYPASS')">通过</view>
<view class="reject" @click="apply('APPLYREJECTED')" style="color: red;">驳回</view>
</view>
</u-popup>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> <view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
<u-select v-model="singleColumnShow" mode="single-column" :default-value='singleColumnDefaultValue' <u-select v-model="singleColumnShow" mode="single-column" :default-value='singleColumnDefaultValue'
:list="singleColumnList" @confirm="chooseSingleColumn"></u-select> :list="singleColumnList" @confirm="chooseSingleColumn"></u-select>
@ -267,6 +309,8 @@
const type = ref('') const type = ref('')
const serviceList = ref([]) const serviceList = ref([])
const isShowSuccess = ref(false) const isShowSuccess = ref(false)
const isVerifyShowSuccess = ref(false)//
const isApplyShowSuccess = ref(false)//
const orderCompleteResult = ref([]) // const orderCompleteResult = ref([]) //
const result = ref('TEMPORARILY') const result = ref('TEMPORARILY')
const data1 = ref('') const data1 = ref('')
@ -284,17 +328,20 @@
} }
// //
function addSubForm(clickType, item) { function addSubForm(clickType, item) {
if (data.value.status == 'APPLYPASS' || data.value.status == 'COMPLETED') {
return
}
if (data.value.status == 'PENDING') { if (data.value.status == 'PENDING') {
proxy.$modal.showToast('请先接单') proxy.$modal.showToast('请先接单')
return return
} }
if (clickType == 'updata') { if (clickType == 'updata') {
proxy.$tab.navigateTo( proxy.$tab.navigateTo(
`/pages/repairOrder/addServiceRecord?type=${data.value.type}&factoryAreaNumber=${data.value.factoryAreaNumber}&number=${data.value.number}&data=${encodeURIComponent(JSON.stringify(item))}` `/pages/repairOrder/addServiceRecord?type=${data.value.type}&factoryAreaNumber=${data.value.factoryAreaNumber}&number=${data.value.number}&data=${encodeURIComponent(JSON.stringify(item))}&deviceNumber=${data.value.deviceNumber}`
) )
} else { } else {
proxy.$tab.navigateTo( proxy.$tab.navigateTo(
`/pages/repairOrder/addServiceRecord?type=${data.value.type}&factoryAreaNumber=${data.value.factoryAreaNumber}&number=${data.value.number}` `/pages/repairOrder/addServiceRecord?type=${data.value.type}&factoryAreaNumber=${data.value.factoryAreaNumber}&number=${data.value.number}&deviceNumber=${data.value.deviceNumber}`
) )
} }
} }
@ -319,6 +366,26 @@
} }
isShowSuccess.value = true isShowSuccess.value = true
} }
/**
* 维修确认点击时间
*/
function orderClickApply() {
data.value.applyContent = null;
isApplyShowSuccess.value = true
}
/**
* 点击验证完结填写意见
*/
function orderClickVerify() {
data.value.applyContent = null;
isVerifyShowSuccess.value = true
}
function cancel(){
data.applyContent = null;
isVerifyShowSuccess.value = false
isApplyShowSuccess.value = false
}
function radioGroupChange(e) { function radioGroupChange(e) {
result.value = e result.value = e
} }
@ -326,8 +393,23 @@
isShowSuccess.value = false isShowSuccess.value = false
orderClick(2) orderClick(2)
} }
/**
* 维修确认
*/
function apply(status) {
isApplyShowSuccess.value = false
result.value = status
orderClick(3)
}
/**
* 验证确认
*/
function verify() {
isVerifyShowSuccess.value = false
orderClick(2)
}
// APP // APP
async function orderClick(type) { async function orderClick(type1) {
// //
// if (this.data.status == 'PENDING') { // if (this.data.status == 'PENDING') {
// if (this.$store.state.user.dept.parentId != this.data.factoryAreaNumber) { // if (this.$store.state.user.dept.parentId != this.data.factoryAreaNumber) {
@ -345,8 +427,9 @@
number: data.value.number, number: data.value.number,
status: data.value.status, status: data.value.status,
id: data.value.id, id: data.value.id,
result: type == 2 ? result.value : '', result: type1 == 2||type1 == 3 ? result.value : '',
requestNumber: data.value.requestNumber, requestNumber: data.value.requestNumber,
content:data.value.applyContent ? data.value.applyContent:''
} }
// //
const dataTwo = { const dataTwo = {
@ -358,9 +441,8 @@
classes: data.value.classes, classes: data.value.classes,
faultType: data.value.faultType faultType: data.value.faultType
} }
if(type ==2){ let tips = data.value.status == 'PENDING' ? '是否接单?' : data.value.status == 'PECEIVED' ? '是否完成?' : data.value.status == 'COMPLETED' && data.value.requestNumber && data.value.applyer == store.id ? '是否确认提交?' :data.value.status == 'COMPLETED' && !data.value.requestNumber ? '是否验证完结?':data.value.status == 'APPLYPASS' ? '是否验证完结?':''
proxy.$modal.loading('加载中') if(type1 == 2 || type1 ==3){
loading.value = true
// //
if (data.value.status == 'PECEIVED') { if (data.value.status == 'PECEIVED') {
await repairOrderApi.repairOrderUpdate(dataTwo).then((res) => { }).catch(() => { await repairOrderApi.repairOrderUpdate(dataTwo).then((res) => { }).catch(() => {
@ -368,24 +450,31 @@
loading.value = false loading.value = false
}) })
} }
await repairOrderApi.orderClick(dataOne).then((res) => { proxy.$modal.confirm(tips).then(async () => {
if (res.data) { proxy.$modal.loading('加载中')
proxy.$modal.showToast('操作成功') loading.value = true
setTimeout(() => { await repairOrderApi.orderClick(dataOne).then((res) => {
proxy.$tab.navigateBack() if (res.data) {
proxy.$modal.showToast('操作成功')
setTimeout(() => {
if(type1==3){
proxy.$tab.navigateTo(`/pages/repairOrder/index?type=${type.value}&flag=2`)
}else{
proxy.$tab.navigateTo(`/pages/repairOrder/index?type=${type.value}`)
}
loading.value = false
}, 1500)
} else {
proxy.$modal.showToast('操作失败')
loading.value = false loading.value = false
}, 1500) }
} else { }).catch(() => {
proxy.$modal.showToast('操作失败') proxy.$modal.closeLoading()
loading.value = false loading.value = false
} })
}).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
}) })
}else{ }else{
let tips = data.value.status == 'PENDING' ? '是否接单?' : data.value.status == 'PECEIVED' ? '是否完成?' : data
.value.status == 'COMPLETED' ? '是否验证完结?' : ''
proxy.$modal.confirm(tips).then(async () => { proxy.$modal.confirm(tips).then(async () => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
loading.value = true loading.value = true
@ -419,14 +508,16 @@
} }
// //
async function getDeviceRepairDetailsByNumber() { async function getDeviceRepairDetailsByNumber() {
await repairOrderApi.getDeviceRepairDetailsByNumber({ if(data.value.requestNumber){
type: type.value, await repairOrderApi.getDeviceRepairDetailsByNumber({
requestNumber: number.value type: type.value,
}).then((res) => { requestNumber: data.value.requestNumber
if (res.data) { }).then((res) => {
data1.value = res.data if (res.data) {
} data1.value = res.data
}).catch(() => { }) }
}).catch(() => { })
}
} }
// //
function getRepairOrderDetaiList() { function getRepairOrderDetaiList() {

4
src/pages/repairOrder/index.vue

@ -3,7 +3,7 @@
<view class="container"> <view class="container">
<u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff' <u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff'
title="维修工单"> title="维修工单">
<template v-slot:right> <template v-slot:right v-if="params.flag!='2'">
<u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm"></u-icon> <u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm"></u-icon>
</template> </template>
</u-navbar> </u-navbar>
@ -20,6 +20,7 @@
<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=='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=='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'/> <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'/>
<u-tag text="申请人已确认" v-else-if="item.status=='APPLYPASS'" bg-color='rgba(255,255,255,0)' color='#2ba471' border-color='#2ba471' type="info" shape='circle'/>
</view> </view>
<view class="dec"> <view class="dec">
工单单号:<span>{{item.number}}</span> 工单单号:<span>{{item.number}}</span>
@ -106,6 +107,7 @@
} }
onLoad((option) => { onLoad((option) => {
if (option.type) params.value.type = option.type; if (option.type) params.value.type = option.type;
if (option.flag) params.value.flag = option.flag;
}) })
onShow(() => { onShow(() => {
params.value.pageNo = 1 params.value.pageNo = 1

4
src/pages/repairOrder/transfer.vue

@ -49,7 +49,7 @@
<u-input v-model="form.deviceName" :placeholder="`根据${form.receiverType=='DEVICE'||form.receiverType == 'TECH'?'设备' : '模具'}编码获得`" <u-input v-model="form.deviceName" :placeholder="`根据${form.receiverType=='DEVICE'||form.receiverType == 'TECH'?'设备' : '模具'}编码获得`"
disabled /> disabled />
</u-form-item> </u-form-item>
<u-form-item label="维修人员" prop="describes" required> <u-form-item label="维修人员" prop="describes" required v-if="form.status==1">
<view class="select" @click="openSelecUser('receiverUserId')"> <view class="select" @click="openSelecUser('receiverUserId')">
<view class="input" v-if='form.receiverUserId'> <view class="input" v-if='form.receiverUserId'>
{{selectFormatRadin(form.receiverUserId,selecUserList)}} {{selectFormatRadin(form.receiverUserId,selecUserList)}}
@ -159,7 +159,7 @@
proxy.$modal.showToast('请选择厂区') proxy.$modal.showToast('请选择厂区')
return; return;
} }
if (!form.value.receiverUserId) { if (!form.value.receiverUserId && form.value.status==1) {
proxy.$modal.showToast('请选择维修人员') proxy.$modal.showToast('请选择维修人员')
return; return;
} }

8
src/pages/upkeepOrder/addServiceRecord.vue

@ -385,12 +385,16 @@ const form = ref({
form1.value.name = e[0].label form1.value.name = e[0].label
} }
} }
singleColumnShow.value = false singleColumnShow.value = false
} }
// //
async function getSparePartsList() { async function getSparePartsList() {
await sparePartsApi.getSparePartsList().then(res => { number =deviceNumber.value
let param = {
number:number,
name:name
}
await sparePartsApi.getSparePartsList(param).then(res => {
res.data.map(item => { res.data.map(item => {
item.value = item.number item.value = item.number
item.label = item.name item.label = item.name

73
src/pages/upkeepOrder/detail.vue

@ -53,7 +53,7 @@
<view class="dec" v-if="current == 0"> <view class="dec" v-if="current == 0">
<view class="dec-item"> <view class="dec-item">
<view>设备编号</view> <view>设备编号</view>
<view>{{data.number}}</view> <view>{{data.deviceNumber}}</view>
</view> </view>
<view class="dec-item"> <view class="dec-item">
<view>设备名称</view> <view>设备名称</view>
@ -93,6 +93,10 @@
<view>实际分钟</view> <view>实际分钟</view>
<view v-if='item.actualMinutes'>{{item.actualMinutes}}分钟</view> <view v-if='item.actualMinutes'>{{item.actualMinutes}}分钟</view>
</view> </view>
<view class="dec2">
<view>保养部位</view>
<view>{{item.equipmentParts}}</view>
</view>
<view class="dec2"> <view class="dec2">
<view>责任人</view> <view>责任人</view>
<view>{{item.chargePeoplesName}}</view> <view>{{item.chargePeoplesName}}</view>
@ -139,9 +143,23 @@
:disabled='loading'>接单</u-button> :disabled='loading'>接单</u-button>
<u-button type="primary" v-if="data.status == 'PECEIVED'" @click="orderClick(2)" :loading='loading' <u-button type="primary" v-if="data.status == 'PECEIVED'" @click="orderClick(2)" :loading='loading'
:disabled='loading'>完成</u-button> :disabled='loading'>完成</u-button>
<u-button type="primary" v-if="data.status == 'COMPLETED'" @click="orderClickVerify()" :loading='loading'
:disabled='loading'>验证</u-button>
</view> </view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> <view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</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 @click="cancel">取消</view>
<view class="sure" @click="verify">确认</view>
</view>
</u-popup>
</view> </view>
</template> </template>
@ -172,12 +190,16 @@
const type = ref('') const type = ref('')
const serviceList = ref([]) const serviceList = ref([])
const isTrue = ref(false) const isTrue = ref(false)
const isVerifyShowSuccess = ref(false)
function change(index) { function change(index) {
current.value = index current.value = index
changeItem.value = list.value[current.value] changeItem.value = list.value[current.value]
} }
// //
function addSubForm(clickType, item) { function addSubForm(clickType, item) {
if(data.value.status == 'COMPLETED'){//
return
}
if (data.value.status == 'PENDING') { if (data.value.status == 'PENDING') {
proxy.$modal.showToast('请先接单') proxy.$modal.showToast('请先接单')
return return
@ -192,11 +214,12 @@
) )
} }
} }
function orderClick(type) { function orderClick(type1) {
if(!serviceList.value || serviceList.value&&serviceList.value.length == 0){ if(!serviceList.value || serviceList.value&&serviceList.value.length == 0){
proxy.$modal.showToast('没有保养内容') proxy.$modal.showToast('没有保养内容')
return; return;
} }
let tips = data.value.status == 'PENDING' ? '是否接单?' : data.value.status == 'PECEIVED' ? '是否完成?' : data.value.status == 'COMPLETED' ? '是否验证完结?' :''
// if(type == 2){ // if(type == 2){
// isTrue.value = serviceList.value.some(item=>item.items.length == 0) // isTrue.value = serviceList.value.some(item=>item.items.length == 0)
// if(isTrue.value){ // if(isTrue.value){
@ -204,15 +227,15 @@
// return; // return;
// } // }
// } // }
const paramsData = { const paramsData = {
id: data.value.id id: data.value.id,
verifyContent: data.value.applyContent
} }
let tips = data.value.status == 'PENDING' ? '是否接单?' : data.value.status == 'PECEIVED' ? '是否完成?' : ''
proxy.$modal.confirm(tips).then(() => { proxy.$modal.confirm(tips).then(() => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
loading.value = true loading.value = true
if(type == 1){ if(type1 == 1){
upkeepOrderApi.orderClick(paramsData).then((res) => { upkeepOrderApi.orderClick(paramsData).then((res) => {
if (res.data) { if (res.data) {
proxy.$modal.showToast('操作成功') proxy.$modal.showToast('操作成功')
@ -228,7 +251,7 @@
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
loading.value = false loading.value = false
}) })
}else if(type == 2){ }else if(type1 == 2){
upkeepOrderApi.orderClickFinish(paramsData).then((res) => { upkeepOrderApi.orderClickFinish(paramsData).then((res) => {
if (res.data) { if (res.data) {
proxy.$modal.showToast('操作成功') proxy.$modal.showToast('操作成功')
@ -244,8 +267,23 @@
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
loading.value = false loading.value = false
}) })
}else if(type1==3){//
upkeepOrderApi.orderClickVerify(paramsData).then((res) => {
if (res.data) {
proxy.$modal.showToast('操作成功')
setTimeout(() => {
proxy.$tab.navigateTo(`/pages/upkeepOrder/index?type=${type.value}`)
loading.value = false
}, 1500)
} else {
proxy.$modal.showToast('操作失败')
loading.value = false
}
}).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
})
} }
}) })
} }
// //
@ -281,7 +319,24 @@
onShow(() => { onShow(() => {
getUpkeepOrderDetailList() getUpkeepOrderDetailList()
}) })
/**
* 点击验证完结填写意见
*/
function orderClickVerify() {
data.value.applyContent = null;
isVerifyShowSuccess.value = true
}
/**
* 验证确认
*/
function verify() {
isVerifyShowSuccess.value = false
orderClick(3)
}
function cancel(){
data.applyContent = null;
isVerifyShowSuccess.value = false
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

18
src/static/images/icon11.svg

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 9.6 KiB

Loading…
Cancel
Save