|
|
@ -4,7 +4,9 @@ |
|
|
|
<view class="info"> |
|
|
|
<view class="title"> |
|
|
|
<view>维修工单</view> |
|
|
|
<view @click="transfer" v-if="data.status == 'PECEIVED' && (!serviceList || serviceList && serviceList.length == 0)">转办</view> |
|
|
|
<view @click="transfer" |
|
|
|
v-if="data.status == 'PECEIVED' && (!serviceList || serviceList && serviceList.length == 0)">转办 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="dec"> |
|
|
|
<view class="dec-item"> |
|
|
@ -23,35 +25,35 @@ |
|
|
|
<view>故障类型:</view> |
|
|
|
<view>{{data.faultTypeName}}</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="dec-item"> |
|
|
|
|
|
|
|
<view class="dec-item" v-if="data.createTime"> |
|
|
|
<view>创建时间:</view> |
|
|
|
<view>{{deviceInfo.typeName}}</view> |
|
|
|
<view>{{$time.formatDate(data.createTime)}}</view> |
|
|
|
</view> |
|
|
|
<view class="dec-item"> |
|
|
|
<view class="dec-item" v-if="data.creator"> |
|
|
|
<view>创建人员:</view> |
|
|
|
<view>{{deviceInfo.typeName}}</view> |
|
|
|
<view>{{data.creator}}</view> |
|
|
|
</view> |
|
|
|
<view class="dec-item"> |
|
|
|
<view class="dec-item" v-if="data.receivingTime"> |
|
|
|
<view>接单时间:</view> |
|
|
|
<view>{{deviceInfo.typeName}}</view> |
|
|
|
<view>{{$time.formatDate(data.receivingTime)}}</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="dec-item"> |
|
|
|
|
|
|
|
<view class="dec-item" v-if="data.maintenanceName"> |
|
|
|
<view>接单人员:</view> |
|
|
|
<view>{{deviceInfo.maintenanceName}}</view> |
|
|
|
<view>{{data.maintenanceName}}</view> |
|
|
|
</view> |
|
|
|
<view class="dec-item"> |
|
|
|
<view class="dec-item" v-if="data.completionTime"> |
|
|
|
<view>完成时间:</view> |
|
|
|
<view>{{deviceInfo.typeName}}</view> |
|
|
|
<view>{{$time.formatDate(data.completionTime)}}</view> |
|
|
|
</view> |
|
|
|
<view class="dec-item"> |
|
|
|
<view class="dec-item" v-if="data.verifyTime"> |
|
|
|
<view>验证时间:</view> |
|
|
|
<view>{{deviceInfo.typeName}}</view> |
|
|
|
<view>{{$time.formatDate(data.verifyTime)}}</view> |
|
|
|
</view> |
|
|
|
<view class="dec-item"> |
|
|
|
<view class="dec-item" v-if="data.verifyer"> |
|
|
|
<view>验证人员:</view> |
|
|
|
<view>{{deviceInfo.typeName}}</view> |
|
|
|
<view>{{data.verifyer}}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -66,25 +68,25 @@ |
|
|
|
<view class="title"> |
|
|
|
<view>{{changeItem.name}}</view> |
|
|
|
</view> |
|
|
|
<view class="dec" v-if="current == 0"> |
|
|
|
<view class="dec" v-if="changeItem.value == 1"> |
|
|
|
<view class="dec-item"> |
|
|
|
<view>设备编号:</view> |
|
|
|
<view>{{deviceInfo.number}}</view> |
|
|
|
<view>{{data1.deviceNumber}}</view> |
|
|
|
</view> |
|
|
|
<view class="dec-item"> |
|
|
|
<view>设备名称:</view> |
|
|
|
<view>{{deviceInfo.name}}</view> |
|
|
|
<view>{{data1.name}}</view> |
|
|
|
</view> |
|
|
|
<view class="dec-item"> |
|
|
|
<view>所属厂区:</view> |
|
|
|
<view>{{deviceInfo.factoryAreaName}}</view> |
|
|
|
<view>{{data1.factoryAreaName}}</view> |
|
|
|
</view> |
|
|
|
<view class="dec-item"> |
|
|
|
<view>设备类型:</view> |
|
|
|
<view>{{deviceInfo.typeName}}</view> |
|
|
|
<view>{{data1.type == 'DEVICE'?'设备':data1.type == 'TECH'?'工艺':'模具'}}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="dec" v-if="current == 1"> |
|
|
|
<view class="dec" v-if="changeItem.value == 2"> |
|
|
|
<view class="dec-item"> |
|
|
|
<view>报修单号:</view> |
|
|
|
<view>{{data1.number}}</view> |
|
|
@ -101,15 +103,13 @@ |
|
|
|
<view>报修时间:</view> |
|
|
|
<view>{{data1.describes}}</view> |
|
|
|
</view> |
|
|
|
<view class="dec-item"> |
|
|
|
<!-- <view>图片:</view> --> |
|
|
|
<view class="images"> |
|
|
|
{{data1.filePathList}} |
|
|
|
<image :src="cur" mode="" v-for="(cur,key) in data1.filePathList" :key='key' @click="previewImage(key,data1.filePathList)"></image> |
|
|
|
</view> |
|
|
|
<!-- <view>图片:</view> --> |
|
|
|
<view class="images"> |
|
|
|
<image :src="cur" mode="" v-for="(cur,key) in data1.filePathList" :key='key' |
|
|
|
@click="previewImage(key,data1.filePathList)"></image> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="list" v-if="current == 2"> |
|
|
|
<view class="list" v-if="changeItem.value == 3"> |
|
|
|
<view class="item " v-for="(item,index) in serviceList" :key="index" |
|
|
|
@click="addSubForm('updata',item)"> |
|
|
|
<view class="item-box"> |
|
|
@ -117,7 +117,7 @@ |
|
|
|
<view class="title-txt"> |
|
|
|
{{item.describes}} |
|
|
|
</view> |
|
|
|
<u-icon name="trash" color="#aaaaaa" size="40" |
|
|
|
<u-icon name="trash" color="#aaaaaa" size="40" v-if="(data.status == 'PENDING' || data.status == 'PECEIVED')&& $store.state.user.post.code == 'worker'" |
|
|
|
@click.native.stop="delService(item)"></u-icon> |
|
|
|
</view> |
|
|
|
<view class="dec2"> |
|
|
@ -149,7 +149,8 @@ |
|
|
|
</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')&& $store.state.user.post == 'worker'" > |
|
|
|
<view class="add-btn" |
|
|
|
v-if="(data.status == 'PENDING' || data.status == 'PECEIVED')&& $store.state.user.post.code == 'worker'"> |
|
|
|
<u-button type="primary" @click="addSubForm('creat')"><u-icon name="plus-circle" color="#ffffff" |
|
|
|
size="36"></u-icon>添加维修内容</u-button> |
|
|
|
</view> |
|
|
@ -157,13 +158,15 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="footer"> |
|
|
|
<view class="btns"> |
|
|
|
<u-button type="primary" v-if="data.status == 'PENDING'&& $store.state.user.post.code == 'worker'" @click="orderClick(1)" :loading='loading' |
|
|
|
:disabled='loading'>接单</u-button> |
|
|
|
<u-button type="primary" v-if="data.status == 'PECEIVED'&& $store.state.user.post.code == 'worker'" @click="orderClickSuccess()" :loading='loading' |
|
|
|
<view class="btns" v-if="data.status == 'PENDING'&& $store.state.user.post.code == 'worker'"> |
|
|
|
<u-button type="primary" @click="orderClick(1)" :loading='loading' :disabled='loading'>接单</u-button> |
|
|
|
</view> |
|
|
|
<view class="btns" v-if="data.status == 'PECEIVED'&& $store.state.user.post.code == 'worker'"> |
|
|
|
<u-button type="primary" @click="orderClickSuccess()" :loading='loading' |
|
|
|
:disabled='loading'>完成</u-button> |
|
|
|
<u-button type="primary" v-if="data.status == 'COMPLETED'&& $store.state.user.post.code == 'engineer'" @click="orderClick(3)" :loading='loading' |
|
|
|
:disabled='loading'>验证完结</u-button> |
|
|
|
</view> |
|
|
|
<view class="btns" v-if="data.status == 'COMPLETED'&& $store.state.user.post.code == 'engineer'"> |
|
|
|
<u-button type="primary" @click="orderClick(3)" :loading='loading' :disabled='loading'>验证完结</u-button> |
|
|
|
</view> |
|
|
|
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> |
|
|
|
</view> |
|
|
@ -171,8 +174,7 @@ |
|
|
|
<u-popup v-model="isShowSuccess" mode="center" border-radius="14"> |
|
|
|
<view class="popup-title">完成类型</view> |
|
|
|
<view class="popup"> |
|
|
|
<u-radio-group v-model="result" |
|
|
|
@change="radioGroupChange"> |
|
|
|
<u-radio-group v-model="result" @change="radioGroupChange"> |
|
|
|
<u-radio v-for="(item, index) in orderCompleteResult" :key="index" :name="item.value"> |
|
|
|
{{item.label}} |
|
|
|
</u-radio> |
|
|
@ -188,7 +190,6 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import * as deviceApi from "@/api/device.js" |
|
|
|
import * as moldApi from "@/api/mold.js" |
|
|
|
import * as dictApi from "@/api/dict.js" |
|
|
|
import * as repairOrderApi from "@/api/repairOrder.js" |
|
|
@ -196,24 +197,30 @@ |
|
|
|
data() { |
|
|
|
return { |
|
|
|
list: [{ |
|
|
|
name: '设备信息' |
|
|
|
name: '设备信息', |
|
|
|
value: 1 |
|
|
|
}, { |
|
|
|
name: '报修信息' |
|
|
|
name: '报修信息', |
|
|
|
value: 2 |
|
|
|
}, { |
|
|
|
name: '维修内容' |
|
|
|
name: '维修内容', |
|
|
|
value: 3 |
|
|
|
}], |
|
|
|
current: 0, |
|
|
|
changeItem: '', |
|
|
|
changeItem: { |
|
|
|
name: '设备信息', |
|
|
|
value: 1 |
|
|
|
}, |
|
|
|
data: '', //工单信息 |
|
|
|
loading: false, |
|
|
|
type: "", |
|
|
|
deviceInfo: '', //设备信息 |
|
|
|
serviceList: [], //维修内同列表 |
|
|
|
// 完成类型字段 |
|
|
|
isShowSuccess:false, |
|
|
|
orderCompleteResult:[],//订单完成类型 |
|
|
|
result:'TEMPORARILY', |
|
|
|
data1:'' |
|
|
|
isShowSuccess: false, |
|
|
|
orderCompleteResult: [], //订单完成类型 |
|
|
|
result: 'TEMPORARILY', |
|
|
|
data1: '' |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
@ -224,7 +231,7 @@ |
|
|
|
}, |
|
|
|
// 添加表格表单 |
|
|
|
addSubForm(clickType, item) { |
|
|
|
if(this.data.status == 'PENDING'){ |
|
|
|
if (this.data.status == 'PENDING') { |
|
|
|
this.$modal.showToast('请先接单') |
|
|
|
return |
|
|
|
} |
|
|
@ -246,56 +253,56 @@ |
|
|
|
cancle() { |
|
|
|
this.isPopupShow = false |
|
|
|
}, |
|
|
|
// 根据设备/模具号查询信息 |
|
|
|
getDetailsByNumber() { |
|
|
|
const data = { |
|
|
|
number: this.data.deviceNumber, |
|
|
|
id: '' |
|
|
|
} |
|
|
|
if (this.type == 'DEVICE') { |
|
|
|
deviceApi.getDeviceDetailsByNumber(data).then((res) => { |
|
|
|
if (res.data) { |
|
|
|
this.deviceInfo = res.data |
|
|
|
} else { |
|
|
|
this.$modal.showToast(`找不到该${this.type=='DEVICE'?'设备' : '模具'}`) |
|
|
|
} |
|
|
|
}) |
|
|
|
} else if (this.type == 'MOLD') { |
|
|
|
moldApi.getMoldDetailsByNumber(data).then((res) => { |
|
|
|
if (res.data) { |
|
|
|
this.deviceInfo = res.data |
|
|
|
} else { |
|
|
|
this.$modal.showToast(`找不到该${this.type=='DEVICE'?'设备' : '模具'}`) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
// 完成按钮 |
|
|
|
orderClickSuccess(){ |
|
|
|
orderClickSuccess() { |
|
|
|
// 如果点击完成是否与接单人员一致 |
|
|
|
if (this.data.status == 'PECEIVED') { |
|
|
|
console.log(this.$store.state.user.id) |
|
|
|
console.log(this.data) |
|
|
|
if (this.$store.state.user.id != this.data.maintenance) { |
|
|
|
this.$modal.showToast('当前人员与接单人员不一致') |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (!this.serviceList || this.serviceList && this.serviceList.length == 0) { |
|
|
|
this.$modal.showToast('请添加维修内容') |
|
|
|
return; |
|
|
|
} |
|
|
|
if (!this.data.classesName || !this.data.faultTypeName) { |
|
|
|
this.$modal.showToast('请完善班次和故障类型') |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
this.isShowSuccess = true |
|
|
|
}, |
|
|
|
radioGroupChange(e){ |
|
|
|
radioGroupChange(e) { |
|
|
|
console.log(e) |
|
|
|
this.result = e |
|
|
|
}, |
|
|
|
sure(){ |
|
|
|
sure() { |
|
|
|
this.isShowSuccess = false |
|
|
|
this.orderClick(2) |
|
|
|
}, |
|
|
|
// APP维修工单接单、点击完成、验证 |
|
|
|
orderClick(type) { |
|
|
|
if(this.data.status == 'PECEIVED'){ |
|
|
|
if(!this.serviceList || this.serviceList&&this.serviceList.length == 0){ |
|
|
|
this.$modal.showToast('请添加维修内容') |
|
|
|
// 如果是接单 |
|
|
|
if (this.data.status == 'PENDING') { |
|
|
|
if (this.$store.state.user.dept.parentId != this.data.factoryAreaNumber) { |
|
|
|
this.$modal.showToast('当前人员厂区与工单来源的厂区不一致') |
|
|
|
return; |
|
|
|
} |
|
|
|
if (this.$store.state.user.dept.classType != this.data.type) { |
|
|
|
this.$modal.showToast('当前人员班组与工单类型不一致') |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const data = { |
|
|
|
number: this.data.number, |
|
|
|
status: this.data.status, |
|
|
|
id: this.data.id, |
|
|
|
result:type == 2? this.result :'', |
|
|
|
result: type == 2 ? this.result : '', |
|
|
|
requestNumber: '' |
|
|
|
} |
|
|
|
let tips = this.data.status == 'PENDING' ? '是否接单?' : this.data.status == 'PECEIVED' ? '是否完成?' : this.data |
|
|
@ -328,7 +335,7 @@ |
|
|
|
}).then((res) => { |
|
|
|
if (res.data) { |
|
|
|
this.data1 = res.data |
|
|
|
console.log(this.data1 ) |
|
|
|
console.log(this.data1) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
@ -352,23 +359,23 @@ |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
transfer(){ |
|
|
|
transfer() { |
|
|
|
this.$tab.navigateTo(`/pages/repairOrder/transfer?type=${this.type}&id=${this.data.id}`) |
|
|
|
}, |
|
|
|
previewImage(current,array){ |
|
|
|
previewImage(current, array) { |
|
|
|
uni.previewImage({ |
|
|
|
urls: array, |
|
|
|
current:current, |
|
|
|
longPressActions: { |
|
|
|
itemList: ['发送给朋友', '保存图片', '收藏'], |
|
|
|
success: function(data) { |
|
|
|
console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片'); |
|
|
|
}, |
|
|
|
fail: function(err) { |
|
|
|
console.log(err.errMsg); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
urls: array, |
|
|
|
current: current, |
|
|
|
longPressActions: { |
|
|
|
itemList: ['发送给朋友', '保存图片', '收藏'], |
|
|
|
success: function(data) { |
|
|
|
console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片'); |
|
|
|
}, |
|
|
|
fail: function(err) { |
|
|
|
console.log(err.errMsg); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
async onLoad(option) { |
|
|
@ -377,34 +384,53 @@ |
|
|
|
this.data = JSON.parse(decodeURIComponent(option.data)) |
|
|
|
|
|
|
|
} |
|
|
|
console.log(this.data) |
|
|
|
this.changeItem = this.list[this.current] |
|
|
|
this.orderCompleteResult = await dictApi.getDict('order_complete_result') |
|
|
|
this.data.maintenance = uni.getStorageSync('user').nickname |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
this.getDetailsByNumber() |
|
|
|
this.getDeviceRepairDetailsByNumber() |
|
|
|
if (this.data.requestNumber) { |
|
|
|
this.getDeviceRepairDetailsByNumber() |
|
|
|
this.list = [{ |
|
|
|
name: '设备信息', |
|
|
|
value: 1 |
|
|
|
}, { |
|
|
|
name: '报修信息', |
|
|
|
value: 2 |
|
|
|
}, { |
|
|
|
name: '维修内容', |
|
|
|
value: 3 |
|
|
|
}] |
|
|
|
} else { |
|
|
|
this.list = [{ |
|
|
|
name: '设备信息', |
|
|
|
value: 1 |
|
|
|
}, { |
|
|
|
name: '维修内容', |
|
|
|
value: 3 |
|
|
|
}] |
|
|
|
} |
|
|
|
this.getRepairOrderDetaiList() |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
.detail-container{ |
|
|
|
.detail-container { |
|
|
|
min-height: 100vh; |
|
|
|
background: white; |
|
|
|
} |
|
|
|
.line{ |
|
|
|
|
|
|
|
.line { |
|
|
|
background: #f5f5f5; |
|
|
|
height: 20rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.info { |
|
|
|
background: white; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.tab { |
|
|
|
border-bottom: 1px solid #e4e4e4; |
|
|
|
|
|
|
@ -589,14 +615,17 @@ |
|
|
|
justify-content: flex-start; |
|
|
|
align-items: center; |
|
|
|
} |
|
|
|
|
|
|
|
::v-deep .u-radio-group { |
|
|
|
display: grid !important; |
|
|
|
padding-bottom: 20rpx; |
|
|
|
} |
|
|
|
.images{ |
|
|
|
|
|
|
|
.images { |
|
|
|
display: flex; |
|
|
|
width: 100%; |
|
|
|
image{ |
|
|
|
|
|
|
|
image { |
|
|
|
width: 30%; |
|
|
|
margin-right: 20rpx; |
|
|
|
height: 200rpx; |
|
|
|