Browse Source

检修工单

master
zhang_li 10 months ago
parent
commit
23c7c65fb3
  1. 82
      pages/deviceReport/addForm.vue
  2. 3
      pages/deviceReport/index.vue
  3. 70
      pages/overhaulOrder/addForm.vue
  4. 224
      pages/overhaulOrder/addServiceRecord.vue
  5. 112
      pages/overhaulOrder/detail.vue
  6. 1
      pages/overhaulOrder/index.vue
  7. 10
      pages/overhaulOrder/transfer.vue
  8. 20
      pages/repairOrder/addServiceRecord.vue
  9. 8
      pages/repairOrder/detail.vue

82
pages/deviceReport/addForm.vue

@ -12,12 +12,23 @@
扫描
</view>
</u-form-item>
<u-form-item :label="`${type=='DEVICE'?'设备' : '模具'}名称`" prop="deviceName" required>
<u-form-item :label="`${type=='DEVICE'?'设备' : '模具'}名称`" prop="deviceName" required class="disabled">
<u-input v-model="form.deviceName" :placeholder="`请输入${type=='DEVICE'?'设备' : '模具'}名称`" disabled />
</u-form-item>
<u-form-item label="所属厂区" prop="factoryAreaName" required>
<u-form-item label="所属厂区" prop="factoryAreaName" required class="disabled">
<u-input v-model="form.factoryAreaName" placeholder="请输入所属厂区" disabled />
</u-form-item>
<u-form-item label="类型" prop="receiverType" required>
<view class="select" @click="openSingleColumn('receiverType',form.receiverType,appDeviceMoldType)">
<view class="input" v-if='form.receiverType'>
{{selectFormat(form.receiverType,appDeviceMoldType)}}
</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="footer">
<view class="btns">
@ -26,24 +37,32 @@
</view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
<u-select v-model="singleColumnShow" mode="single-column" :default-value='singleColumnDefaultValue'
:list="singleColumnList" @confirm="chooseSingleColumn"></u-select>
</view>
</template>
<script>
import * as deviceApi from "@/api/device.js"
import * as moldApi from "@/api/mold.js"
import * as dictApi from "@/api/dict.js"
export default {
data() {
return {
loading: false,
type: "",
appDeviceMoldType:[],
form: {
describes: "",
deviceNumber: '',
deviceName: '',
factoryAreaName: '',
factoryAreaNumber: '',
}
receiverType:''
},
singleColumnShow: false,
singleColumnDefaultValue: [],
singleColumnList: [],
}
},
methods: {
@ -141,10 +160,37 @@
console.log('表单数据信息1:', this.data);
this.form = {}
},
selectFormat(val, array) {
let str = array.filter(item => item.value == val)[0].label
return str
},
//
openSingleColumn(field, val, list) {
this.singleColumnList = list
this.field = field
if (val) {
this.singleColumnDefaultValue = [list.findIndex(item => item.value == val)]
} else {
this.singleColumnDefaultValue = []
}
this.singleColumnShow = true
},
//
chooseSingleColumn(e) {
console.log(e[0])
this.form[this.field] = e[0].value
// if (this.field == 'receiverType') {
// this.type = this.form[this.field]
// }
this.singleColumnShow = false
this.$emit('singleColumn', this.field, this.form[this.field])
this.$forceUpdate()
},
},
onLoad(option) {
async onLoad(option) {
if (option.type) this.type = option.type;
this.appDeviceMoldType = await dictApi.getDict('app_device_mold_type')
}
}
</script>
@ -153,7 +199,15 @@
.add-form-container {
min-height: calc(100vh - 140rpx);
background: white;
padding: 0px 30rpx 140rpx;
padding: 0px 0rpx 140rpx;
}
.u-form-item {
padding: 20rpx 30rpx;
}
.disabled {
background: #f5f5f5;
}
.list {
@ -190,7 +244,25 @@
}
}
}
.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);
}
}
.footer {
position: fixed;
bottom: 0px;

3
pages/deviceReport/index.vue

@ -33,7 +33,7 @@
</view>
<view class="bottom">
<view class="status">
<u-tag text="已报修" v-if="item.result=='已报修'" bg-color='rgba(255,255,255,0)' color='#2ba471'
<u-tag :text="item.result" bg-color='rgba(255,255,255,0)' color='#2ba471'
border-color='#2ba471' type="primary" shape='circle' />
</view>
<view class="button">
@ -170,6 +170,7 @@
align-items: center;
border-top: 1px solid #E4E4E4;
padding: 20rpx 0px;
height: 90rpx;
}
}

70
pages/overhaulOrder/addForm.vue

@ -2,10 +2,10 @@
<!-- 添加维修工单 -->
<view class="add-form-container">
<u-form :model="form" ref="form1" label-width="160rpx">
<u-form-item label="检修描述" prop="describes" required>
<u-form-item label="检修描述" prop="describes" required :class="form.id?'disabled':''">
<u-input v-model="form.describes" placeholder="请输入检修描述" :disabled="form&&form.id?true:false" />
</u-form-item>
<u-form-item label="维修工单" prop="maintenanceNumber">
<u-form-item label="维修工单" prop="maintenanceNumber" :class="form.id?'disabled':''">
<view class="select" @click="openSingleColumn('maintenanceNumber',form.maintenanceNumber,repairOrderList)">
<view class="input" v-if='form.maintenanceNumber'>
{{selectFormat(form.maintenanceNumber,repairOrderList)}}
@ -16,10 +16,18 @@
<u-icon name="arrow-right" color="#aaaaaa" size="28" v-if="!form.id"></u-icon>
</view>
</u-form-item>
<u-form-item :label="`${type=='DEVICE'?'设备' : '模具'}名称`" prop="factoryAreaName">
<u-input v-model="form.deviceName" :placeholder="`请输入${type=='DEVICE'?'设备' : '模具'}名称`" disabled />
<u-form-item :label="`${type=='DEVICE'?'设备' : '模具'}名称`" prop="factoryAreaName" required :class="isDisabled?'disabled':''">
<view class="select" @click="openSingleColumn('deviceNumber',form.deviceNumber,deviceList)">
<view class="input" v-if='form.deviceNumber'>
{{selectFormat(form.deviceNumber,deviceList)}}
</view>
<view class="placeholder" v-else>
{{`请输入${type=='DEVICE'?'设备' : '模具'}名称`}}
</view>
<u-icon name="arrow-right" color="#aaaaaa" size="28" v-if="!form.id"></u-icon>
</view>
</u-form-item>
<u-form-item label="所属厂区" prop="factoryAreaName">
<u-form-item label="所属厂区" prop="factoryAreaName" class="disabled">
<u-input v-model="form.factoryAreaName" placeholder="请输入所属厂区" disabled />
</u-form-item>
<u-form-item label="故障类型" prop="faultType" required>
@ -51,6 +59,7 @@
import * as moldApi from "@/api/mold.js"
import * as dictApi from "@/api/dict.js"
import * as repairOrderApi from "@/api/repairOrder.js"
import * as deviceApi from "@/api/device.js"
export default {
@ -70,6 +79,8 @@
singleColumnList: [],
field: '',
faultType: [], //
deviceList: [], //
isDisabled:false,//
}
},
methods: {
@ -80,6 +91,10 @@
this.$modal.showToast('请输入故障描述')
return;
}
if (!this.form.deviceNumber) {
this.$modal.showToast('请选择设备名称或者维修工单')
return;
}
if (!this.form.faultType) {
this.$modal.showToast('请选择故障类型')
return;
@ -88,6 +103,7 @@
id: this.form && this.form.id ? this.form.id : '',
describes: this.form.describes,
maintenanceNumber: this.form.maintenanceNumber,
deviceNumber: this.form.deviceNumber,
faultType: this.form.faultType,
}
if (this.form.id) {
@ -141,8 +157,8 @@
this.form.classes = '';
this.form.faultType = ''
} else {
this.form = {}
this.isDisabled = false
}
},
//
@ -158,6 +174,7 @@
//
openSingleColumn(field, val, list) {
if (field == 'maintenanceNumber' && this.form.id) return;
if (field == 'deviceNumber' && this.isDisabled) return;
this.singleColumnList = list
this.field = field
if (val) {
@ -169,15 +186,22 @@
},
//
chooseSingleColumn(e) {
console.log(e[0])
this.form[this.field] = e[0].value
if (this.field == 'maintenanceNumber') {
this.choosesingleColumnItem = this.singleColumnList.filter(item => item.number == e[0].value)
this.form.deviceName = this.choosesingleColumnItem[0].name
this.form.deviceNumber = this.choosesingleColumnItem[0].deviceNumber
this.form.factoryAreaName = this.choosesingleColumnItem[0].factoryAreaName
this.form.factoryAreaNumber = this.choosesingleColumnItem[0].factoryAreaNumber
this.isDisabled = true
// this.form.deviceNumber = e[0].value
}
if (this.field == 'deviceNumber') {
this.choosesingleColumnItem = this.singleColumnList.filter(item => item.number == e[0].value)
this.form.deviceName = this.choosesingleColumnItem[0].name
this.form.factoryAreaName = this.choosesingleColumnItem[0].factoryAreaName
this.form.factoryAreaNumber = this.choosesingleColumnItem[0].factoryAreaNumber
}
this.singleColumnShow = false
this.$emit('singleColumn', this.field, this.form[this.field])
this.$forceUpdate()
@ -196,6 +220,27 @@
})
},
// /
async getDeviceList() {
if(this.type == 'DEVICE'){
await deviceApi.deviceList().then(res => {
res.data.map(item => {
item.value = item.number
item.label = item.name
})
this.deviceList = res.data
})
}else if(this.type == 'MOLD'){
await moldApi.moldList().then(res => {
res.data.map(item => {
item.value = item.number
item.label = item.name
})
this.deviceList = res.data
})
}
},
},
async onLoad(option) {
if (option.type) this.type = option.type;
@ -206,11 +251,14 @@
describes: data.describes,
maintenanceNumber: data.maintenanceNumber,
deviceName: data.name,
deviceNumber: data.deviceNumber,
factoryAreaName: data.factoryAreaName,
faultType: data.faultType,
}
this.isDisabled = this.form.maintenanceNumber ? true:false
};
await this.getRepairOrderList()
this.getDeviceList()
this.faultType = await dictApi.getDict('fault_type')
}
}
@ -220,7 +268,13 @@
.add-form-container {
min-height: calc(100vh - 140rpx);
background: white;
padding: 0px 30rpx 140rpx;
padding: 0px 0rpx 140rpx;
}
.u-form-item{
padding: 20rpx 30rpx;
}
.disabled{
background: #f5f5f5;
}
.list {

224
pages/overhaulOrder/addServiceRecord.vue

@ -2,19 +2,22 @@
<!-- 添加维修工单 -->
<view class="add-form-container">
<u-form :model="form" ref="form1" label-width="160rpx">
<u-form-item label="故障描述" prop="describes" required>
<u-input v-model="form.describes" placeholder="请输入故障描述" />
<u-form-item label="检修描述" prop="name" required>
<u-input v-model="form.name" placeholder="请输入检修描述" maxlength="50"/>
</u-form-item>
<u-form-item label="故障真因" prop="describes" required>
<u-input v-model="form.describes1" placeholder="请输入故障真因" />
<u-form-item label="预估人数" prop="peoples" required>
<u-input v-model="form.peoples" type="number" placeholder="请输入预估人数" maxlength="50"/>
</u-form-item>
<u-form-item label="解决措施" prop="describes" required>
<u-input type='textarea' v-model="form.workOut" placeholder="请输入解决措施" />
<u-form-item label="预估分钟" prop="estimatedMinutes" required>
<u-input v-model="form.estimatedMinutes" type="number" placeholder="请输入预估分钟" maxlength="50"/>
</u-form-item>
<u-form-item label="维修人员" prop="describes" required>
<u-form-item label="实际分钟" prop="actualMinutes" required>
<u-input v-model="form.actualMinutes" type="number" placeholder="请输入实际分钟" maxlength="50"/>
</u-form-item>
<u-form-item label="责任人" prop="chargePeoples" required>
<view class="select" @click="openSelecUser">
<view class="input" v-if='form.maintenances'>
{{selectFormatCheck(form.maintenances,selecUserList)}}
<view class="input" v-if='form.chargePeoples'>
{{selectFormatCheck(form.chargePeoples,selecUserList)}}
</view>
<view class="placeholder" v-else>
请选择维修人员
@ -22,12 +25,42 @@
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon>
</view>
</u-form-item>
<u-form-item label="完成情况" prop="status" required>
<view class="select" @click="openSingleColumn('status',form.status,jxDetailsStatus,'form')">
<view class="input" v-if='form.status'>
{{selectFormat(form.status,jxDetailsStatus)}}
</view>
<view class="placeholder" v-else>
{{`请选择完成情况`}}
</view>
<u-icon name="arrow-right" color="#aaaaaa" size="28" v-if="!form.id"></u-icon>
</view>
</u-form-item>
<u-form-item label="完成时间" prop="completionTime" required v-if='form.status == 0'>
<view class="select" @click="openDatetime('completionTime',formatDate,params,formatValue)">
<view class="input" v-if='formatDate'>
{{formatDate}}
</view>
<view class="placeholder" v-else>
{{`请选择完成时间`}}
</view>
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon>
</view>
</u-form-item>
<u-form-item label="工程师确认" prop="engineer">
<u-input v-model="form.engineer" placeholder="请输入工程师确认" maxlength="50"/>
</u-form-item>
<u-form-item label="未完成原因" prop="uncompleted" required v-if='form.status == 1'>
<u-input type='textarea' v-model="form.uncompleted" placeholder="请输入未完成原因" maxlength="200"/>
</u-form-item>
</u-form>
<view class="list">
<view class="title">
<span>*</span>备件
</view>
<view class="item " v-for="(item,index) in form.itemNUmbers" :key="index">
<view class="item " v-for="(item,index) in form.itemNumbers" :key="index">
<view class="item-box">
<view class="spare-title">
<view class="title-txt">
@ -64,7 +97,7 @@
<view class="popup">
<u-form :model="form1" ref="form1" label-width="160rpx">
<u-form-item :label="`备件`" prop="number" required>
<view class="select" @click="openSingleColumn('number',form1.number,sparePartsList)">
<view class="select" @click="openSingleColumn('number',form1.number,sparePartsList,'form1')">
<view class="input" v-if='form1.number'>
{{selectFormat(form1.number,sparePartsList)}}
</view>
@ -101,13 +134,15 @@
</u-popup>
<u-select v-model="singleColumnShow" mode="single-column" :default-value='singleColumnDefaultValue'
:list="singleColumnList" @confirm="chooseSingleColumn"></u-select>
<u-picker mode="time" v-model="datetimeShow" :default-time='datetimeDefaultValue' :params="params" @confirm='chooseDatetime'></u-picker>
</view>
</template>
<script>
import * as repairOrderApi from "@/api/repairOrder.js"
import * as overhaulOrderApi from "@/api/overhaulOrder.js"
import * as sparePartsApi from "@/api/spareParts.js"
import * as deptApi from "@/api/dept.js"
import * as dictApi from "@/api/dict.js"
export default {
@ -119,57 +154,108 @@
isPopupShow: false,
sparePartsList: [],
//
from:'',//
singleColumnShow: false,
singleColumnDefaultValue: [],
singleColumnList: [],
field: '',
//
selecUserList: [], //
//
selecUserList: [], //
isShowSelecUser: false,
jxDetailsStatus:[],//
form: {
maintenanceNumber: '',
describes: '',
describes1: '',
workOut: '',
maintenances: '',
itemNUmbers: [],
number: '',
name:'',
peoples: '',
estimatedMinutes: '',
actualMinutes: '',
chargePeoples: '',
status: '',
completionTime: '',
engineer: '',
uncompleted: '',
itemNumbers:[]
},
formatDate:'',//
form1: {
number: "",
qty: ''
},
//
datetimeShow:false,
params:{
year: true,
month: true,
day: true,
hour: true,
minute: true,
second: true,
timestamp: true,
},
datetimeDefaultValue:'',
formatValue:'YYYY-MM-DD hh:mm:ss'
}
},
methods: {
//
submit() {
//
if (!this.form.describes) {
this.$modal.showToast('请输入故障描述')
if (!this.form.name) {
this.$modal.showToast('请输入检修描述')
return;
}
if (!this.form.peoples) {
this.$modal.showToast('请输入预估人数')
return;
}
if (this.form.peoples>100) {
this.$modal.showToast('预估人数不得超出100')
return;
}
if (!this.form.describes1) {
this.$modal.showToast(`请输入故障真因`)
if (!this.form.estimatedMinutes) {
this.$modal.showToast(`请输入预估分钟`)
return;
}
if (!this.form.workOut) {
this.$modal.showToast('请输入解决措施')
if (!this.form.actualMinutes) {
this.$modal.showToast('请输入实际分钟')
return;
}
if (!this.form.maintenances) {
this.$modal.showToast('请选择维修人员')
if (!this.form.chargePeoples) {
this.$modal.showToast('请选择负责人')
return;
}
if (this.form.itemNUmbers.length === 0) {
if (!this.form.status) {
this.$modal.showToast('请选择完成情况')
return;
}
if(this.form.status == 0){
if (!this.form.completionTime) {
this.$modal.showToast('请选择完成时间')
return;
}
}
// if (!this.form.engineer) {
// this.$modal.showToast('')
// return;
// }
if(this.form.status == 1){
if (!this.form.uncompleted) {
this.$modal.showToast('请输入未完成原因')
return;
}
}
if (this.form.itemNumbers.length === 0) {
this.$modal.showToast('请选择备件')
return;
}
console.log(this.form)
if (this.form.id) {
this.$modal.confirm('是否修改维修内容').then(() => {
this.$modal.confirm('是否修改修内容').then(() => {
this.$modal.loading('加载中')
this.loading = true
repairOrderApi.repairOrderDetailUpdate(this.form).then((res) => {
overhaulOrderApi.overhaulOrderDetailUpdate(this.form).then((res) => {
this.$modal.closeLoading()
if (res.data) {
this.$modal.showToast('修改成功')
@ -187,10 +273,10 @@
})
})
} else {
this.$modal.confirm('是否添加修内容').then(() => {
this.$modal.confirm('是否添加修内容').then(() => {
this.$modal.loading('加载中')
this.loading = true
repairOrderApi.repairOrderDetailCreate(this.form).then((res) => {
overhaulOrderApi.overhaulOrderDetailCreate(this.form).then((res) => {
this.$modal.closeLoading()
if (res.data) {
this.$modal.showToast('添加成功')
@ -221,16 +307,16 @@
}
},
//
//
async getSelecUser() {
let data = {
classType: this.type,
factoryAreaNumber: this.factoryAreaNumber,
flag: 1
flag: 0
}
let arr = []
if (this.form.maintenances) {
arr = this.form.maintenances.split(',')
if (this.form.chargePeoples) {
arr = this.form.chargePeoples.split(',')
}
await deptApi.getSelecUser(data).then(res => {
res.data.forEach(item => {
@ -253,13 +339,13 @@
},
//
selectFormatCheck(val, array) {
const arr = val.split(',')
const arr = val.split(',').map(parseFloat)
let str = array.filter(item => arr.includes(item.id)).map(item => item.name).join(',')
return str
},
//
chooseUser() {
this.form.maintenances = this.chooseUserList.join(',')
this.form.chargePeoples = this.chooseUserList.join(',')
this.isShowSelecUser = false
},
selectFormat(val, array) {
@ -267,8 +353,9 @@
return str
},
//
openSingleColumn(field, val, list) {
openSingleColumn(field, val, list,from) {
if (field == 'deviceNumber' && this.form.id) return;
this.from = from
this.singleColumnList = list
this.field = field
if (val) {
@ -280,9 +367,7 @@
},
//
chooseSingleColumn(e) {
console.log(e[0])
this.form1[this.field] = e[0].value
this[this.from][this.field] = e[0].value
this.singleColumnShow = false
this.$emit('singleColumn', this.field, this.form[this.field])
this.$forceUpdate()
@ -315,34 +400,71 @@
this.$modal.showToast('请输入数量')
return;
}
if (this.form.itemNUmbers && this.form.itemNUmbers.length > 0) {
let arr = this.form.itemNUmbers.filter(item => item.number == this.form1.number)
if (this.form.itemNumbers && this.form.itemNumbers.length > 0) {
let arr = this.form.itemNumbers.filter(item => item.number == this.form1.number)
if (arr && arr.length > 0) {
this.$modal.showToast('该备件已添加')
return;
}
}
this.form.itemNUmbers.push(this.form1)
this.form.itemNumbers.push(this.form1)
this.isPopupShow = false
},
//
delSpareParts(index) {
this.form.itemNUmbers.splice(index, 1)
this.form.itemNumbers.splice(index, 1)
},
openDatetime(field,val,params,formatValue){
this.params = params
this.formatValue =formatValue
this.field = field
this.form[this.field] = val ? val :''
this.datetimeDefaultValue = val ? val :this.$time.formatDate()
this.datetimeShow = true
},
//
chooseDatetime(e){
let array1 = []
let array2 = []
if(this.formatValue.indexOf('YYYY')>-1){
array1.push(e.year)
}
if(this.formatValue.indexOf('MM')>-1){
array1.push(e.month)
}
if(this.formatValue.indexOf('DD')>-1){
array1.push(e.day)
}
if(this.formatValue.indexOf('hh')>-1){
array2.push(e.hour)
}
if(this.formatValue.indexOf('mm')>-1){
array2.push(e.minute)
}
if(this.formatValue.indexOf('ss')>-1){
array2.push(e.second)
}
let str = array1.join('-') + ' ' + array2.join(':')
this.formatDate = str
this.form[this.field] = e.timestamp
},
},
async onLoad(option) {
console.log(option)
if (option.type) this.type = option.type;
if (option.factoryAreaNumber) this.factoryAreaNumber = option.factoryAreaNumber;
if (option.number) this.form.maintenanceNumber = option.number;
if (option.number) this.form.number = option.number;
if (option.data && JSON.parse(decodeURIComponent(option.data)) && JSON.parse(decodeURIComponent(option
.data)).id) {
this.form = JSON.parse(decodeURIComponent(option.data))
this.$set(this.form,'itemNUmbers',this.form.items)
this.$set(this.form,'itemNumbers',this.form.items)
this.formatDate = this.$time.formatDate(this.form.completionTime)
};
this.jxDetailsStatus = await dictApi.getDict('jx_details_status')
await this.getSelecUser()
await this.getSparePartsList()
}

112
pages/overhaulOrder/detail.vue

@ -3,8 +3,7 @@
<view class="detail-container">
<view class="info">
<view class="title">
<view>维修工单</view>
<view @click="transfer" v-if="data.status == 'PECEIVED' && (!serviceList || serviceList && serviceList.length == 0)">转办</view>
<view>检修工单</view>
</view>
<view class="dec">
<view class="dec-item">
@ -12,12 +11,8 @@
<view>{{data.number}}</view>
</view>
<view class="dec-item">
<view>报修描述</view>
<view>{{data.describes}}</view>
</view>
<view class="dec-item">
<view>班次</view>
<view>{{data.classesName}}</view>
<view>维修工单</view>
<view>{{data.maintenanceNumber}}</view>
</view>
<view class="dec-item">
<view>故障类型</view>
@ -57,42 +52,48 @@
<view>{{deviceInfo.typeName}}</view>
</view>
</view>
<view class="dec" v-if="current == 1">
<view class="dec-item">
<view>工单单号</view>
<view>{{data.number}}</view>
</view>
<view class="dec-item">
<view>报修描述</view>
<view>{{data.describes}}</view>
</view>
<view class="dec-item">
<view>维修工</view>
<view>{{data.maintenance}}</view>
</view>
</view>
<view class="list" v-if="current == 2">
<view class="list" v-if="current == 1">
<view class="item " v-for="(item,index) in serviceList" :key="index"
@click="addSubForm('updata',item)">
<view class="item-box">
<view class="spare-title">
<view class="title-txt">
{{item.describes}}
{{item.name}}
</view>
<u-icon name="trash" color="#aaaaaa" size="40"
@click.native.stop="delService(item)"></u-icon>
</view>
<view class="dec2">
<view>故障真因</view>
<view>{{item.describes1}}</view>
<view>预估人数</view>
<view>{{item.peoples}}</view>
</view>
<view class="dec2">
<view>预估分钟</view>
<view>{{item.estimatedMinutes}}分钟</view>
</view>
<view class="dec2">
<view>实际分钟</view>
<view>{{item.actualMinutes}}分钟</view>
</view>
<view class="dec2">
<view>责任人</view>
<view>{{item.chargePeoplesName}}</view>
</view>
<view class="dec2" >
<view>解决措施</view>
<view>{{item.workOut}}</view>
<view>完成情况</view>
<view>{{item.status==0?'完成':'未完成'}}</view>
</view>
<view class="dec2" v-if='item.status == 0'>
<view>完成时间</view>
<view>{{$time.formatDate(item.completionTime)}}</view>
</view>
<view class="dec2">
<view>维修人员</view>
<view>{{item.maintenancesName}}</view>
<view>工程师确认</view>
<view>{{item.engineer}}</view>
</view>
<view class="dec2" v-if="item.status == 1">
<view>未完成原因</view>
<view>{{item.uncompleted}}</view>
</view>
<view class="dec2">
备件
@ -111,21 +112,17 @@
</view>
<!-- <u-icon name="minus-circle" color="#aaaaaa" size="60" ></u-icon> -->
</view>
<view class="add-btn" v-if="data.status == 'PENDING' || data.status == 'PECEIVED'" >
<view class="add-btn" v-if="data.status == 'PROCCED'" >
<u-button type="primary" @click="addSubForm('creat')"><u-icon name="plus-circle" color="#ffffff"
size="36"></u-icon>添加修内容</u-button>
size="36"></u-icon>添加修内容</u-button>
</view>
</view>
</view>
</view>
<view class="footer">
<view class="btns">
<u-button type="primary" v-if="data.status == 'PENDING'" @click="orderClick()" :loading='loading'
:disabled='loading'>接单</u-button>
<u-button type="primary" v-if="data.status == 'PECEIVED'" @click="orderClick()" :loading='loading'
<u-button type="primary" v-if="data.status == 'PROCCED'" @click="orderClick()" :loading='loading'
:disabled='loading'>完成</u-button>
<u-button type="primary" v-if="data.status == 'COMPLETED'" @click="orderClick()" :loading='loading'
:disabled='loading'>验证完结</u-button>
</view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
@ -137,7 +134,7 @@
import SparePartsCard from '@/components/sparePartsCard/index.vue'
import * as deviceApi from "@/api/device.js"
import * as moldApi from "@/api/mold.js"
import * as repairOrderApi from "@/api/repairOrder.js"
import * as overhaulOrderApi from "@/api/overhaulOrder.js"
export default {
components: {
Form,
@ -148,9 +145,7 @@
list: [{
name: '设备信息'
}, {
name: '报修信息'
}, {
name: '维修内容'
name: '检修内容'
}],
current: 0,
changeItem: '',
@ -163,7 +158,6 @@
},
methods: {
change(index) {
console.log("index", index);
this.current = index
this.changeItem = this.list[this.current]
},
@ -175,11 +169,11 @@
}
if (clickType == 'updata') {
this.$tab.navigateTo(
`/pages/repairOrder/addServiceRecord?type=${this.type}&factoryAreaNumber=${this.data.factoryAreaNumber}&number=${this.data.number}&data=${encodeURIComponent(JSON.stringify(item))}`
`/pages/overhaulOrder/addServiceRecord?type=${this.type}&factoryAreaNumber=${this.data.factoryAreaNumber}&number=${this.data.number}&data=${encodeURIComponent(JSON.stringify(item))}`
)
} else {
this.$tab.navigateTo(
`/pages/repairOrder/addServiceRecord?type=${this.type}&factoryAreaNumber=${this.data.factoryAreaNumber}&number=${this.data.number}`
`/pages/overhaulOrder/addServiceRecord?type=${this.type}&factoryAreaNumber=${this.data.factoryAreaNumber}&number=${this.data.number}`
)
}
},
@ -217,18 +211,21 @@
},
// APP
orderClick() {
if(!this.serviceList || this.serviceList&&this.serviceList.length == 0){
this.$modal.showToast('请添加检修内容')
return;
}
const data = {
number: this.data.number,
status: this.data.status,
// number: this.data.number,
// status: this.data.status,
id: this.data.id,
requestNumber: ''
// requestNumber: ''
}
let tips = this.data.status == 'PENDING' ? '是否接单?' : this.data.status == 'PECEIVED' ? '是否完成?' : this.data
.status == 'COMPLETED' ? '是否验证完结?' : ''
let tips = '是否完成'
this.$modal.confirm(tips).then(() => {
this.$modal.loading('加载中')
this.loading = true
repairOrderApi.orderClick(data).then((res) => {
overhaulOrderApi.orderClick(data).then((res) => {
if (res.data) {
this.$modal.showToast('操作成功')
setTimeout(() => {
@ -246,8 +243,8 @@
})
},
//
getRepairOrderDetaiList() {
repairOrderApi.repairOrderDetailList({
getOverhaulOrderDetailList() {
overhaulOrderApi.overhaulOrderDetailList({
number: this.data.number
}).then((res) => {
if (res.data) {
@ -257,12 +254,11 @@
},
//
delService(item) {
console.log(222)
this.$modal.confirm('确定删除维修内容吗?').then(() => {
this.$modal.confirm('确定删除检修内容吗?').then(() => {
this.$modal.loading('加载中')
repairOrderApi.repairOrderDetailDelete(item.id).then((res) => {
overhaulOrderApi.overhaulOrderDetailDelete(item.id).then((res) => {
this.$modal.closeLoading()
this.getRepairOrderDetaiList()
this.getOverhaulOrderDetailList()
})
})
@ -284,7 +280,7 @@
},
onShow() {
this.getDetailsByNumber()
this.getRepairOrderDetaiList()
this.getOverhaulOrderDetailList()
}
}
</script>
@ -344,7 +340,7 @@
view {
&:nth-child(1) {
width: 160rpx;
width: 180rpx;
}
&:nth-child(2) {

1
pages/overhaulOrder/index.vue

@ -47,7 +47,6 @@
</view>
<view class="status">
<u-button shape="circle" type="primary" size="mini" style="min-width: 120rpx;" @click="addForm(item)">编辑</u-button>
</view>
</view>
</view>

10
pages/overhaulOrder/transfer.vue

@ -3,9 +3,9 @@
<view class="add-form-container">
<u-form :model="form" ref="form1" label-width="160rpx">
<u-form-item label="类型" prop="receiverType" required>
<view class="select" @click="openSingleColumn('receiverType',form.receiverType,deviceMoldType)">
<view class="select" @click="openSingleColumn('receiverType',form.receiverType,appDeviceMoldType)">
<view class="input" v-if='form.receiverType'>
{{selectFormat(form.receiverType,deviceMoldType)}}
{{selectFormat(form.receiverType,appDeviceMoldType)}}
</view>
<view class="placeholder" v-else>
{{`请选择类型`}}
@ -77,7 +77,7 @@
return {
loading: false,
type: "",
deviceMoldType: [], //
appDeviceMoldType: [], //
form: {
id: '',
receiverType: "",
@ -252,8 +252,8 @@
async onLoad(option) {
if (option.type) this.type = option.type;
if (option.id) this.form.id = option.id;
this.deviceMoldType = await dictApi.getDict('device_mold_type')
this.deviceMoldType = this.deviceMoldType.filter(item => item.value != this.type)
this.appDeviceMoldType = await dictApi.getDict('app_device_mold_type')
this.appDeviceMoldType = this.appDeviceMoldType.filter(item => item.value != this.type)
}
}
</script>

20
pages/repairOrder/addServiceRecord.vue

@ -27,7 +27,7 @@
<view class="title">
<span>*</span>备件
</view>
<view class="item " v-for="(item,index) in form.itemNUmbers" :key="index">
<view class="item " v-for="(item,index) in form.itemNumbers" :key="index">
<view class="item-box">
<view class="spare-title">
<view class="title-txt">
@ -132,7 +132,7 @@
describes1: '',
workOut: '',
maintenances: '',
itemNUmbers: [],
itemNumbers: [],
},
form1: {
number: "",
@ -160,7 +160,7 @@
this.$modal.showToast('请选择维修人员')
return;
}
if (this.form.itemNUmbers.length === 0) {
if (this.form.itemNumbers.length === 0) {
this.$modal.showToast('请选择备件')
return;
}
@ -253,7 +253,7 @@
},
//
selectFormatCheck(val, array) {
const arr = val.split(',')
const arr = val.split(',').map(Number)
let str = array.filter(item => arr.includes(item.id)).map(item => item.name).join(',')
return str
},
@ -315,20 +315,20 @@
this.$modal.showToast('请输入数量')
return;
}
if (this.form.itemNUmbers && this.form.itemNUmbers.length > 0) {
let arr = this.form.itemNUmbers.filter(item => item.number == this.form1.number)
if (this.form.itemNumbers && this.form.itemNumbers.length > 0) {
let arr = this.form.itemNumbers.filter(item => item.number == this.form1.number)
if (arr && arr.length > 0) {
this.$modal.showToast('该备件已添加')
return;
}
}
this.form.itemNUmbers.push(this.form1)
this.form.itemNumbers.push(this.form1)
this.isPopupShow = false
},
//
delSpareParts(index) {
this.form.itemNUmbers.splice(index, 1)
this.form.itemNumbers.splice(index, 1)
}
},
@ -339,8 +339,8 @@
if (option.data && JSON.parse(decodeURIComponent(option.data)) && JSON.parse(decodeURIComponent(option
.data)).id) {
this.form = JSON.parse(decodeURIComponent(option.data))
this.$set(this.form,'itemNUmbers',this.form.items)
this.$set(this.form,'itemNumbers',this.form.items)
console.log('99',this.form)
};
await this.getSelecUser()
await this.getSparePartsList()

8
pages/repairOrder/detail.vue

@ -246,6 +246,10 @@
},
// APP
orderClick(type) {
if(!this.serviceList || this.serviceList&&this.serviceList.length == 0){
this.$modal.showToast('请添加维修内容')
return;
}
const data = {
number: this.data.number,
status: this.data.status,
@ -295,8 +299,10 @@
this.getRepairOrderDetaiList()
})
})
},
transfer(){
this.$tab.navigateTo(`/pages/repairOrder/transfer?type=${this.type}&id=${this.data.id}`)
}
},
async onLoad(option) {
if (option.type) this.type = option.type;

Loading…
Cancel
Save