Browse Source

维修工单和保修

master
zhang_li 9 months ago
parent
commit
91dbca8728
  1. 23
      .hbuilderx/launch.json
  2. 8
      src/api/repairOrder.js
  3. 3
      src/manifest.json
  4. 76
      src/pages/device/index.vue
  5. 46
      src/pages/deviceReport/addForm.vue
  6. 17
      src/pages/deviceReport/index.vue
  7. 22
      src/pages/index.vue
  8. 11
      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. 11
      src/pages/spareParts/index.vue
  13. 2
      src/store/modules/user.js

23
.hbuilderx/launch.json

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

8
src/api/repairOrder.js

@ -82,3 +82,11 @@ export function repairOrderList(params) {
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-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>", "<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>" "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
] ],
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ]
}, },
"ios" : { "ios" : {
"dSYMs" : false "dSYMs" : false

76
src/pages/device/index.vue

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

46
src/pages/deviceReport/addForm.vue

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

17
src/pages/deviceReport/index.vue

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

22
src/pages/index.vue

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

11
src/pages/mold/index.vue

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

30
src/pages/repairOrder/addForm.vue

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

94
src/pages/repairOrder/detail.vue

@ -23,9 +23,35 @@
<view>故障类型</view> <view>故障类型</view>
<view>{{data.faultTypeName}}</view> <view>{{data.faultTypeName}}</view>
</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 class="dec-item"> <view class="dec-item">
<view>维修工</view> <view>接单人员</view>
<view>{{data.maintenance}}</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> </view>
</view> </view>
@ -60,16 +86,27 @@
</view> </view>
<view class="dec" v-if="current == 1"> <view class="dec" v-if="current == 1">
<view class="dec-item"> <view class="dec-item">
<view>工单单号</view> <view>报修单号</view>
<view>{{data.number}}</view> <view>{{data1.number}}</view>
</view> </view>
<view class="dec-item"> <view class="dec-item">
<view>报修描述</view> <view>报修描述</view>
<view>{{data.describes}}</view> <view>{{data1.describes}}</view>
</view> </view>
<view class="dec-item"> <view class="dec-item">
<view>维修工</view> <view>报修人</view>
<view>{{data.maintenance}}</view> <view>{{data1.declarName}}</view>
</view>
<view class="dec-item">
<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> </view>
<view class="list" v-if="current == 2"> <view class="list" v-if="current == 2">
@ -175,7 +212,8 @@
// //
isShowSuccess:false, isShowSuccess:false,
orderCompleteResult:[],// orderCompleteResult:[],//
result:'TEMPORARILY' result:'TEMPORARILY',
data1:''
} }
}, },
methods: { 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() { getRepairOrderDetaiList() {
repairOrderApi.repairOrderDetailList({ repairOrderApi.repairOrderDetailList({
@ -294,7 +344,6 @@
}, },
// //
delService(item) { delService(item) {
console.log(222)
this.$modal.confirm('确定删除维修内容吗?').then(() => { this.$modal.confirm('确定删除维修内容吗?').then(() => {
this.$modal.loading('加载中') this.$modal.loading('加载中')
repairOrderApi.repairOrderDetailDelete(item.id).then((res) => { repairOrderApi.repairOrderDetailDelete(item.id).then((res) => {
@ -305,6 +354,21 @@
}, },
transfer(){ transfer(){
this.$tab.navigateTo(`/pages/repairOrder/transfer?type=${this.type}&id=${this.data.id}`) 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) { async onLoad(option) {
@ -313,6 +377,7 @@
this.data = JSON.parse(decodeURIComponent(option.data)) this.data = JSON.parse(decodeURIComponent(option.data))
} }
console.log(this.data)
this.changeItem = this.list[this.current] this.changeItem = this.list[this.current]
this.orderCompleteResult = await dictApi.getDict('order_complete_result') this.orderCompleteResult = await dictApi.getDict('order_complete_result')
this.data.maintenance = uni.getStorageSync('user').nickname this.data.maintenance = uni.getStorageSync('user').nickname
@ -321,6 +386,7 @@
}, },
onShow() { onShow() {
this.getDetailsByNumber() this.getDetailsByNumber()
this.getDeviceRepairDetailsByNumber()
this.getRepairOrderDetaiList() this.getRepairOrderDetaiList()
} }
} }
@ -527,4 +593,14 @@
display: grid !important; display: grid !important;
padding-bottom: 20rpx; padding-bottom: 20rpx;
} }
.images{
display: flex;
width: 100%;
image{
width: 30%;
margin-right: 20rpx;
height: 200rpx;
border-radius: 10rpx;
}
}
</style> </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'/> <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>
<view class="dec"> <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>
<view class="dec"> <view class="dec">
{{`${params.type=='DEVICE'?'设备' : '模具'}`}}编号:<span>{{item.deviceNumber}}</span> {{`${params.type=='DEVICE'?'设备' : '模具'}`}}编号:<span>{{item.deviceNumber}}</span>
@ -45,7 +48,7 @@
<view class="time" style="flex: 1;"> <view class="time" style="flex: 1;">
{{`${$time.formatDate(item.createTime)}`}} {{`${$time.formatDate(item.createTime)}`}}
</view> </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> <u-button shape="circle" type="primary" size="mini" style="min-width: 120rpx;" @click="addForm(item)">编辑</u-button>
</view> </view>

11
src/pages/spareParts/index.vue

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

2
src/store/modules/user.js

@ -124,7 +124,7 @@ const user = {
res = res.data; // 读取 data 数据 res = res.data; // 读取 data 数据
commit('SET_CLASSTYPE', res.dept.classType) commit('SET_CLASSTYPE', res.dept.classType)
if (res.posts && res.posts.length > 0) { 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 { } else {
commit('SET_POST','') commit('SET_POST','')
} }

Loading…
Cancel
Save