Browse Source

维修工单和保修

master
zhang_li 9 months ago
parent
commit
91dbca8728
  1. 9
      .hbuilderx/launch.json
  2. 8
      src/api/repairOrder.js
  3. 3
      src/manifest.json
  4. 22
      src/pages/device/index.vue
  5. 44
      src/pages/deviceReport/addForm.vue
  6. 17
      src/pages/deviceReport/index.vue
  7. 22
      src/pages/index.vue
  8. 3
      src/pages/mold/index.vue
  9. 30
      src/pages/repairOrder/addForm.vue
  10. 94
      src/pages/repairOrder/detail.vue
  11. 7
      src/pages/repairOrder/index.vue
  12. 3
      src/pages/spareParts/index.vue
  13. 2
      src/store/modules/user.js

9
.hbuilderx/launch.json

@ -4,16 +4,13 @@
"version" : "0.0",
"configurations" : [
{
"app-plus" :
{
"app-plus" : {
"launchtype" : "local"
},
"default" :
{
"default" : {
"launchtype" : "local"
},
"mp-weixin" :
{
"mp-weixin" : {
"launchtype" : "local"
},
"type" : "uniCloud"

8
src/api/repairOrder.js

@ -82,3 +82,11 @@ export function repairOrderList(params) {
params
})
}
// 获取维修工单的报修信息
export function getDeviceRepairDetailsByNumber(params) {
return request({
url: '/eam/device-repair-request/getDetailsByNumber',
'method': 'GET',
params
})
}

3
src/manifest.json

@ -34,7 +34,8 @@
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
],
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ]
},
"ios" : {
"dSYMs" : false

22
src/pages/device/index.vue

@ -1,6 +1,10 @@
<template>
<!-- 设备 -->
<view class="work-container">
<view class="cartNull" v-show="!token">
还没有登录<navigator open-type="navigate" url="/pages/login">先登录</navigator>
</view>
<view class="" v-show='token'>
<Search @search='search' @screen='screen' :isShowScreen='false' />
<view class="list">
<view class="item" v-for="(item,index) in list" :key='index'>
@ -29,11 +33,14 @@
<view style="height: 94rpx;padding-top: 30rpx;">
<u-loadmore :status="status" v-if="status != 'loadmore'" />
</view>
</view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
</template>
<script>
import { getAccessToken } from '@/utils/auth'
import * as deviceApi from "@/api/device.js"
export default {
data() {
@ -46,6 +53,7 @@
},
status: 'loadmore', //
list: [],
token:''
}
},
methods: {
@ -79,10 +87,14 @@
},
},
onShow() {
if (getAccessToken()) {
this.token = getAccessToken()
this.params.pageNo = 1
this.list = []
this.status = 'loadmore'
this.getList()
}
},
onReachBottom() {
this.getList()
@ -127,4 +139,14 @@
.image-error {
text-align: center;
}
.cartNull {
text-align: center;
padding: 500rpx 40rpx 0;
font-size: 28rpx;
color: #888;
}
.cartNull navigator {
color: #2979ff;
}
</style>

44
src/pages/deviceReport/addForm.vue

@ -17,24 +17,24 @@
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon>
</view>
</u-form-item>
<u-form-item :label="`${type=='DEVICE'?'设备' : '模具'}`" prop="deviceNumber" required>
<view class="select" @click="openSingleColumn('deviceNumber',form.deviceNumber,deviceList)">
<view class="input" v-if='form.deviceNumber'>
{{selectFormat(form.deviceNumber,deviceList)}}
<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>
{{`请选择${type=='DEVICE'?'设备' : '模具'}`}}
{{`请选择类型`}}
</view>
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon>
</view>
</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)}}
<u-form-item :label="`${type=='DEVICE'||type == 'THEN'?'设备' : '模具'}`" prop="deviceNumber" required>
<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'||type == 'THEN'?'设备' : '模具'}`}}
</view>
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon>
</view>
@ -124,7 +124,7 @@
},
// /
getDetailsByNumber() {
if (this.type == 'DEVICE') {
if (this.type == 'DEVICE'||this.type == 'THEN') {
deviceApi.getDeviceByFactoryAreaNumber(this.form.factoryAreaNumber).then((res) => {
if (res.data && res.data.length > 0) {
res.data.map(item => {
@ -162,17 +162,13 @@
return;
}
if (!this.form.deviceNumber) {
this.$modal.showToast(`请选择${this.type=='DEVICE'?'设备' : '模具'}`)
this.$modal.showToast(`请选择${this.type=='DEVICE'||this.type=='THEN'?'设备' : '模具'}`)
return;
}
if (!this.form.receiverType) {
this.$modal.showToast(`请选择类型'}`)
return;
}
if (this.imgList.length == 0) {
this.$modal.showToast('请选择图片')
return;
}
const data = {
describes: this.form.describes,
deviceNumber: this.form.deviceNumber,
@ -206,6 +202,7 @@
//
reset() {
this.form = {}
this.imgList =[]
},
selectFormat(val, array) {
let str = array.filter(item => item.value == val)[0].label
@ -230,6 +227,9 @@
this.form.deviceName = ''
this.getDetailsByNumber()
}
if (this.field == 'receiverType') {
this.type = this.form[this.field]
}
this.singleColumnShow = false
this.$emit('singleColumn', this.field, this.form[this.field])
this.$forceUpdate()
@ -265,8 +265,20 @@
},
async onLoad(option) {
if (option.type) this.type = option.type;
console.log(33,this.type)
this.appDeviceMoldType = await dictApi.getDict('app_device_mold_type')
if(this.type == 'DEVICE'){
this.appDeviceMoldType = this.appDeviceMoldType.filter((item => item.value != "MOLD"))
uni.setNavigationBarTitle({
title:'设备报修'
})
}else{
uni.setNavigationBarTitle({
title:'模具报修'
})
this.appDeviceMoldType = this.appDeviceMoldType.filter((item => item.value == "MOLD"))
this.form.receiverType = this.appDeviceMoldType[0].value
}
this.getFactoryAreaList()
}
}

17
src/pages/deviceReport/index.vue

@ -15,13 +15,15 @@
{{item.describes}}
</view>
<view class="time">
<!-- 2023-12-12 08:00:00 -->
{{`${$time.formatDate(item.createTime)}`}}
</view>
</view>
<view class="dec">
报修单号:<span>{{item.number}}</span>
</view>
<view class="dec">
类型:<span>{{item.type=='DEVICE'?'设备':item.type=='THEN'?'工艺':'模具'}}</span>
</view>
<view class="dec">
{{`${params.type=='DEVICE'?'设备' : '模具'}`}}编号:<span>{{item.deviceNumber}}</span>
</view>
@ -31,6 +33,7 @@
<view class="dec">
所属厂区:<span>{{item.factoryAreaName}}</span>
</view>
<view class="images">
<image :src="cur" mode="" v-for="(cur,key) in item.filePathList" :key='key' @click="previewImage(key,item.filePathList)"></image>
</view>
@ -74,6 +77,7 @@
this.$tab.navigateTo(`/pages/deviceReport/screen?type=${this.type}`)
},
addForm() {
console.log(this.params)
this.$tab.navigateTo(`/pages/deviceReport/addForm?type=${this.params.type}`)
},
//
@ -102,7 +106,7 @@
this.list = []
this.status = 'loadmore'
await this.getList()
this.$modal.showLoading('撤销成功')
this.$modal.showToast('撤销成功')
})
})
@ -125,6 +129,15 @@
},
onLoad(option) {
if (option.type) this.params.type = option.type;
if(this.type == 'DEVICE'){
uni.setNavigationBarTitle({
title:'设备报修'
})
}else{
uni.setNavigationBarTitle({
title:'模具报修'
})
}
},
onShow() {
this.params.pageNo = 1

22
src/pages/index.vue

@ -42,7 +42,7 @@
</view>
</view>
<view class="box">
<view class="" v-if=" $store.state.user.classType == 'DEVICE' || $store.state.user.classType == 'TECH' || !$store.state.user.classType">
<view class="">
<view class="title">设备维护</view>
<u-row gutter="16" style="padding:0px 20rpx ;">
<u-col span="3">
@ -51,25 +51,25 @@
<view>设备报修</view>
</view>
</u-col>
<u-col span="3">
<u-col span="3" v-if=" $store.state.user.classType == 'DEVICE' || $store.state.user.classType == 'TECH' || !$store.state.user.classType">
<view class="icon-item" @click="open('/pages/repairOrder/index?type=DEVICE')">
<image src="../static/images/icon5.svg" mode=""></image>
<view>维修工单</view>
</view>
</u-col>
<u-col span="3">
<u-col span="3" v-if=" $store.state.user.classType == 'DEVICE' || $store.state.user.classType == 'TECH' || !$store.state.user.classType">
<view class="icon-item" @click="open('/pages/overhaulOrder/index?type=DEVICE')">
<image src="../static/images/icon3.svg" mode=""></image>
<view>检修工单</view>
</view>
</u-col>
<u-col span="3">
<u-col span="3" v-if=" $store.state.user.classType == 'DEVICE' || $store.state.user.classType == 'TECH' || !$store.state.user.classType">
<view class="icon-item" @click="open('/pages/spotCheckOrder/addForm?type=DEVICE')">
<image src="../static/images/icon2.svg" mode=""></image>
<view>点检工单</view>
</view>
</u-col>
<u-col span="3">
<u-col span="3" v-if=" $store.state.user.classType == 'DEVICE' || $store.state.user.classType == 'TECH' || !$store.state.user.classType">
<view class="icon-item" @click="open('/pages/upkeepOrder/index?type=DEVICE')">
<image src="../static/images/icon1.svg" mode=""></image>
<view>保养工单</view>
@ -79,28 +79,28 @@
</view>
<view class="" v-if="$store.state.user.classType == 'MOLD' ">
<view class="">
<view class="title">模具维护</view>
<u-row gutter="16">
<u-col span="3">
<view class="icon-item" @click="open('/pages/deviceReport/index?type=MOLD')">
<image src="../static/images/icon4.svg" mode=""></image>
<view>设备报修</view>
<view>模具报修</view>
</view>
</u-col>
<u-col span="3">
<u-col span="3" v-if="$store.state.user.classType == 'MOLD' ">
<view class="icon-item" @click="open('/pages/repairOrder/index?type=MOLD')">
<image src="../static/images/icon5.svg" mode=""></image>
<view>维修工单</view>
</view>
</u-col>
<u-col span="3">
<u-col span="3" v-if="$store.state.user.classType == 'MOLD' ">
<view class="icon-item" @click="open('/pages/overhaulOrder/index?type=MOLD')">
<image src="../static/images/icon2.svg" mode=""></image>
<view>检修工单</view>
</view>
</u-col>
<u-col span="3">
<u-col span="3" v-if="$store.state.user.classType == 'MOLD' ">
<view class="icon-item" @click="open('/pages/maintenWorkOrderList/index')">
<image src="../static/images/icon1.svg" mode=""></image>
<view>保养工单</view>
@ -113,7 +113,7 @@
<u-col span="3" v-if=" $store.state.user.role == 'all_approve' || $store.state.user.role == 'normal_approve'">
<view class="icon-item" @click="open('/pages/sparePartsApplicationApprove/index')">
<image src="../static/images/icon6.png" mode=""></image>
<view>领用申请审批</view>
<view>领用申请审批 </view>
</view>
</u-col>
<u-col span="3" v-else>

3
src/pages/mold/index.vue

@ -34,6 +34,7 @@
</template>
<script>
import { getAccessToken } from '@/utils/auth'
import * as moldApi from "@/api/mold.js"
export default {
data() {
@ -83,10 +84,12 @@
},
},
onShow() {
if (getAccessToken()) {
this.params.pageNo = 1
this.list = []
this.status = 'loadmore'
this.getList()
}
},
onReachBottom() {
this.getList()

30
src/pages/repairOrder/addForm.vue

@ -5,21 +5,21 @@
<u-form-item label="故障描述" prop="describes" required>
<u-input v-model="form.describes" placeholder="请输入故障描述" :disabled="form&&form.id?true:false" />
</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)}}
<u-form-item label="类型" prop="type" required>
<view class="select" @click="openSingleColumn('type',form.type,appDeviceMoldType)">
<view class="input" v-if='form.type'>
{{selectFormat(form.type,appDeviceMoldType)}}
</view>
<view class="placeholder" v-else>
{{`请选择类型`}}
</view>
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon>
<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="deviceNumber" required>
<view class="select" @click="openSingleColumn('deviceNumber',form.deviceNumber,deviceList)">
<view class="input" v-if='form.deviceNumber'>
{{selectFormat(form.deviceNumber,deviceList)}}
<view class="input" v-if='form.deviceName'>
{{form.deviceName}}
</view>
<view class="placeholder" v-else>
{{`请输入${type=='DEVICE'?'设备' : '模具'}名称`}}
@ -32,7 +32,7 @@
</u-form-item>
<u-form-item label="班次" prop="classes" required>
<view class="select" @click="openSingleColumn('classes',form.classes,maintenanceShift)">
<view class="input" v-if='form.classes'>
<view class="input" v-if='form.classes||form.classes==0'>
{{selectFormat(form.classes,maintenanceShift)}}
</view>
<view class="placeholder" v-else>
@ -86,6 +86,7 @@
factoryAreaName: '',
factoryAreaNumber: '',
classes: '',
type:'',
faultType: ''
},
deviceList: [], //
@ -120,7 +121,7 @@
const data = {
id: this.form && this.form.id ? this.form.id : '',
describes: this.form.describes,
receiverType: this.form.receiverType,
type: this.form.type,
deviceNumber: this.form.deviceNumber,
factoryAreaNumber: this.form.factoryAreaNumber,
classes: this.form.classes,
@ -193,7 +194,7 @@
},
//
openSingleColumn(field, val, list) {
if (field == 'deviceNumber' && this.form.id) return;
if ((field == 'deviceNumber' || field == 'type') && this.form.id) return;
this.singleColumnList = list
this.field = field
if (val) {
@ -208,9 +209,10 @@
this.form[this.field] = e[0].value
if (this.field == 'deviceNumber') {
this.choosesingleColumnItem = this.singleColumnList.filter(item => item.number == e[0].value)
console.log(this.choosesingleColumnItem)
this.form.factoryAreaName = this.choosesingleColumnItem[0].factoryAreaName
this.form.factoryAreaNumber = this.choosesingleColumnItem[0].factoryAreaNumber
// this.form.deviceNumber = e[0].value
this.form.deviceName = this.choosesingleColumnItem[0].name
}
this.singleColumnShow = false
this.$emit('singleColumn', this.field, this.form[this.field])
@ -225,6 +227,7 @@
item.label = item.name
})
this.deviceList = res.data
// console.log(22,this.deviceList)
})
}else if(this.type == 'MOLD'){
await moldApi.moldList().then(res => {
@ -249,10 +252,11 @@
deviceName: data.name,
factoryAreaName: data.factoryAreaName,
factoryAreaNumber: data.factoryAreaNumber,
classes: data.classes ? data.classes : '',
classes: data.classes|| data.classes == 0? data.classes : undefined,
faultType: data.faultType,
// faultTypeName:data.faultTypeName,
type: data.type
}
console.log(this.form)
};
await this.getDeviceList()
this.maintenanceShift = await dictApi.getDict('maintenance_shift')

94
src/pages/repairOrder/detail.vue

@ -23,9 +23,35 @@
<view>故障类型</view>
<view>{{data.faultTypeName}}</view>
</view>
<view class="dec-item">
<view>维修工</view>
<view>{{data.maintenance}}</view>
<view>创建时间</view>
<view>{{deviceInfo.typeName}}</view>
</view>
<view class="dec-item">
<view>创建人员</view>
<view>{{deviceInfo.typeName}}</view>
</view>
<view class="dec-item">
<view>接单时间</view>
<view>{{deviceInfo.typeName}}</view>
</view>
<view class="dec-item">
<view>接单人员</view>
<view>{{deviceInfo.maintenanceName}}</view>
</view>
<view class="dec-item">
<view>完成时间</view>
<view>{{deviceInfo.typeName}}</view>
</view>
<view class="dec-item">
<view>验证时间</view>
<view>{{deviceInfo.typeName}}</view>
</view>
<view class="dec-item">
<view>验证人员</view>
<view>{{deviceInfo.typeName}}</view>
</view>
</view>
</view>
@ -60,16 +86,27 @@
</view>
<view class="dec" v-if="current == 1">
<view class="dec-item">
<view>工单单号</view>
<view>{{data.number}}</view>
<view>报修单号</view>
<view>{{data1.number}}</view>
</view>
<view class="dec-item">
<view>报修描述</view>
<view>{{data.describes}}</view>
<view>{{data1.describes}}</view>
</view>
<view class="dec-item">
<view>报修人</view>
<view>{{data1.declarName}}</view>
</view>
<view class="dec-item">
<view>报修时间</view>
<view>{{data1.describes}}</view>
</view>
<view class="dec-item">
<view>维修工</view>
<view>{{data.maintenance}}</view>
<!-- <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="list" v-if="current == 2">
@ -175,7 +212,8 @@
//
isShowSuccess:false,
orderCompleteResult:[],//
result:'TEMPORARILY'
result:'TEMPORARILY',
data1:''
}
},
methods: {
@ -282,6 +320,18 @@
})
})
},
//
getDeviceRepairDetailsByNumber() {
repairOrderApi.getDeviceRepairDetailsByNumber({
type: this.data.type,
requestNumber: this.data.requestNumber
}).then((res) => {
if (res.data) {
this.data1 = res.data
console.log(this.data1 )
}
})
},
//
getRepairOrderDetaiList() {
repairOrderApi.repairOrderDetailList({
@ -294,7 +344,6 @@
},
//
delService(item) {
console.log(222)
this.$modal.confirm('确定删除维修内容吗?').then(() => {
this.$modal.loading('加载中')
repairOrderApi.repairOrderDetailDelete(item.id).then((res) => {
@ -305,6 +354,21 @@
},
transfer(){
this.$tab.navigateTo(`/pages/repairOrder/transfer?type=${this.type}&id=${this.data.id}`)
},
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);
}
}
});
}
},
async onLoad(option) {
@ -313,6 +377,7 @@
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
@ -321,6 +386,7 @@
},
onShow() {
this.getDetailsByNumber()
this.getDeviceRepairDetailsByNumber()
this.getRepairOrderDetaiList()
}
}
@ -527,4 +593,14 @@
display: grid !important;
padding-bottom: 20rpx;
}
.images{
display: flex;
width: 100%;
image{
width: 30%;
margin-right: 20rpx;
height: 200rpx;
border-radius: 10rpx;
}
}
</style>

7
src/pages/repairOrder/index.vue

@ -23,7 +23,10 @@
<u-tag text="已完成" v-else-if="item.status=='COMPLETED'" bg-color='rgba(255,255,255,0)' color='#2ba471' border-color='#2ba471' type="info" shape='circle'/>
</view>
<view class="dec">
报修单号:<span>{{item.number}}</span>
工单单号:<span>{{item.number}}</span>
</view>
<view class="dec">
类型:<span>{{item.type=='DEVICE'?'设备':item.type=='THEN'?'工艺':'模具'}}</span>
</view>
<view class="dec">
{{`${params.type=='DEVICE'?'设备' : '模具'}`}}编号:<span>{{item.deviceNumber}}</span>
@ -45,7 +48,7 @@
<view class="time" style="flex: 1;">
{{`${$time.formatDate(item.createTime)}`}}
</view>
<view class="status" v-if=" $store.state.user.post == 'worker'">
<view class="status" v-if=" $store.state.user.post.code == 'worker'">
<u-button shape="circle" type="primary" size="mini" style="min-width: 120rpx;" @click="addForm(item)">编辑</u-button>
</view>

3
src/pages/spareParts/index.vue

@ -35,6 +35,7 @@
<script>
import * as sparePartsApi from "@/api/spareParts.js"
import { getAccessToken } from '@/utils/auth'
import Search from '../../components/search/index.vue'
export default {
components: {
@ -89,10 +90,12 @@
},
},
onShow() {
if (getAccessToken()) {
this.params.pageNo = 1
this.list = []
this.status = 'loadmore'
this.getList()
}
},
onReachBottom() {
this.getList()

2
src/store/modules/user.js

@ -124,7 +124,7 @@ const user = {
res = res.data; // 读取 data 数据
commit('SET_CLASSTYPE', res.dept.classType)
if (res.posts && res.posts.length > 0) {
commit('SET_POST', res.posts.filter(item => item.code == 'worker' || item.code == 'engineer')[0].code)
commit('SET_POST', res.posts.filter(item => item.code == 'worker' || item.code == 'engineer')[0])
} else {
commit('SET_POST','')
}

Loading…
Cancel
Save