Browse Source

功能更新,设备选择改成扫描

master
zhang_li 9 months ago
parent
commit
8e406765dc
  1. 2
      src/config.js
  2. 7
      src/pages.json
  3. 122
      src/pages/deviceReport/addForm.vue
  4. 3
      src/pages/mine/index.vue
  5. 109
      src/pages/overhaulOrder/addForm.vue
  6. 4
      src/pages/overhaulOrder/addServiceRecord.vue
  7. 256
      src/pages/overhaulOrder/reqairOrderList.vue
  8. 98
      src/pages/repairOrder/addForm.vue
  9. 151
      src/pages/repairOrder/detail.vue
  10. 4
      src/pages/repairOrder/index.vue
  11. 107
      src/pages/repairOrder/transfer.vue
  12. 9
      src/pages/upkeepOrder/addServiceRecord.vue

2
src/config.js

@ -1,6 +1,6 @@
// 应用全局配置 // 应用全局配置
module.exports = { module.exports = {
baseUrl: process.env.NODE_ENV === 'development' ? 'http://192.168.0.172:12080' : 'http://dev.ccwin-in.com:25202', baseUrl: process.env.NODE_ENV === 'development' ? 'http://192.168.0.106:12080' : 'http://dev.ccwin-in.com:25202',
baseApi:process.env.NODE_ENV === 'development' ? '/admin-api' : '/api/admin-api', baseApi:process.env.NODE_ENV === 'development' ? '/admin-api' : '/api/admin-api',
// 应用信息 // 应用信息
appInfo: { appInfo: {

7
src/pages.json

@ -122,6 +122,13 @@
"navigationBarBackgroundColor": "#409eff", "navigationBarBackgroundColor": "#409eff",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
},{
"path": "pages/overhaulOrder/reqairOrderList",
"style": {
"navigationBarTitleText": "选择维修工单",
"navigationBarBackgroundColor": "#409eff",
"navigationBarTextStyle": "white"
}
},{ },{
"path": "pages/upkeepOrder/index", "path": "pages/upkeepOrder/index",
"style": { "style": {

122
src/pages/deviceReport/addForm.vue

@ -5,7 +5,7 @@
<u-form-item label="故障描述" prop="describes" required> <u-form-item label="故障描述" prop="describes" required>
<u-input v-model="form.describes" placeholder="请输入故障描述" /> <u-input v-model="form.describes" placeholder="请输入故障描述" />
</u-form-item> </u-form-item>
<u-form-item label="所属厂区" prop="factoryAreaNumber" required> <!-- <u-form-item label="所属厂区" prop="factoryAreaNumber" required>
<view class="select" <view class="select"
@click="openSingleColumn('factoryAreaNumber',form.factoryAreaNumber,factoryAreaList)"> @click="openSingleColumn('factoryAreaNumber',form.factoryAreaNumber,factoryAreaList)">
<view class="input" v-if='form.factoryAreaNumber'> <view class="input" v-if='form.factoryAreaNumber'>
@ -16,11 +16,11 @@
</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="类型" 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>
{{`请选择类型`}} {{`请选择类型`}}
@ -28,7 +28,7 @@
<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'||type == 'TECH'?'设备' : '模具'}`" prop="deviceNumber" required> <!-- <u-form-item :label="`${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}`" 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.deviceNumber'>
{{selectFormat(form.deviceNumber,deviceList)}} {{selectFormat(form.deviceNumber,deviceList)}}
@ -38,8 +38,24 @@
</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 :label="`${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码`" prop="deviceNumber" required>
<u-input v-model="form.deviceNumber" :placeholder="`请输入${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码`" @blur="blur()" />
<view class="right-button" @click="chickRightButton">
扫描
</view>
</u-form-item>
<u-form-item :label="`${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}名称`" prop="deviceNumber" required class="disabled">
<u-input v-model="form.deviceName" :placeholder="`根据${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码获得`" disabled/>
</u-form-item>
<u-form-item :label="`厂区编码`" prop="factoryAreaNumber" required class="disabled">
<u-input v-model="form.factoryAreaNumber" :placeholder="`根据${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码获得`" disabled/>
</u-form-item> </u-form-item>
<view class="image"> <u-form-item :label="`厂区名称`" prop="factoryAreaName" required class="disabled">
<u-input v-model="form.factoryAreaName" :placeholder="`根据${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码获得`" disabled/>
</u-form-item>
<view class="image" style="margin-top: 20rpx;">
<view class="image-list" v-if='imgList.length>0'> <view class="image-list" v-if='imgList.length>0'>
<view class="image-item" v-for="(item,index) in imgList" :key="index"> <view class="image-item" v-for="(item,index) in imgList" :key="index">
<image :src="item" mode=""></image> <image :src="item" mode=""></image>
@ -85,17 +101,21 @@
deviceName: '', deviceName: '',
factoryAreaName: '', factoryAreaName: '',
factoryAreaNumber: '', factoryAreaNumber: '',
receiverType: '' type: ''
}, },
singleColumnShow: false, singleColumnShow: false,
singleColumnDefaultValue: [], singleColumnDefaultValue: [],
singleColumnList: [], singleColumnList: [],
imgList: [] imgList: [],
} }
}, },
methods: { methods: {
// //
chickRightButton(field) { chickRightButton(field) {
if(!this.form.type){
this.$modal.showToast('请先选择类型')
return;
}
uni.scanCode({ uni.scanCode({
success: function(res) { success: function(res) {
this.form.deviceNumber = res.result this.form.deviceNumber = res.result
@ -104,8 +124,12 @@
}); });
}, },
blur() { blur() {
if (this.form.deviceNumber) { if(this.form.deviceNumber){
this.getDetailsByNumber() this.getDetailsByNumber()
}else{
this.form.deviceName =''
this.form.factoryAreaName = ''
this.form.factoryAreaNumber = ''
} }
}, },
// //
@ -125,29 +149,55 @@
// / // /
getDetailsByNumber() { getDetailsByNumber() {
if (this.type == 'DEVICE'||this.type == 'TECH') { if (this.type == 'DEVICE'||this.type == 'TECH') {
deviceApi.getDeviceByFactoryAreaNumber(this.form.factoryAreaNumber).then((res) => { deviceApi.getDeviceDetailsByNumber({
if (res.data && res.data.length > 0) { number:this.form.deviceNumber,
res.data.map(item => { type:this.type
item.value = item.number }).then((res) => {
item.label = item.name // if (res.data && res.data.length > 0) {
}) // res.data.map(item => {
this.deviceList = res.data // item.value = item.number
} else { // item.label = item.name
this.deviceList = [] // })
// this.deviceList = res.data
// } else {
// this.deviceList = []
// }
if(!res.data){
this.$modal.showToast('找不到该设备')
this.form.deviceName =''
this.form.factoryAreaName = ''
this.form.factoryAreaNumber = ''
return;
} }
}).catch(()=>{}) this.form.deviceName = res.data.name
this.form.factoryAreaName = res.data.factoryAreaName
this.form.factoryAreaNumber = res.data.factoryAreaNumber
}).catch(()=>{
this.$modal.showToast('找不到该设备')
this.form.deviceName =''
this.form.factoryAreaName = ''
this.form.factoryAreaNumber = ''
})
} else if (this.type == 'MOLD') { } else if (this.type == 'MOLD') {
moldApi.getMoldByFactoryAreaNumber(this.form.factoryAreaNumber).then((res) => { moldApi.getMoldDetailsByNumber({
if (res.data && res.data.length > 0) { number:this.form.deviceNumber
res.data.map(item => { }).then((res) => {
item.value = item.number if(!res.data){
item.label = item.name this.$modal.showToast('找不到该设备')
}) this.form.deviceName =''
this.deviceList = res.data this.form.factoryAreaName = ''
} else { this.form.factoryAreaNumber = ''
this.deviceList = [] return;
} }
}).catch(()=>{}) this.form.deviceName = res.data.name
this.form.factoryAreaName = res.data.factoryAreaName
this.form.factoryAreaNumber = res.data.factoryAreaNumber
}).catch(()=>{
this.$modal.showToast('找不到该设备')
this.form.deviceName =''
this.form.factoryAreaName = ''
this.form.factoryAreaNumber = ''
})
} }
}, },
// //
@ -165,7 +215,7 @@
this.$modal.showToast(`请选择${this.type=='DEVICE'||this.type=='TECH'?'设备' : '模具'}`) this.$modal.showToast(`请选择${this.type=='DEVICE'||this.type=='TECH'?'设备' : '模具'}`)
return; return;
} }
if (!this.form.receiverType) { if (!this.form.type) {
this.$modal.showToast(`请选择类型'}`) this.$modal.showToast(`请选择类型'}`)
return; return;
} }
@ -173,7 +223,6 @@
describes: this.form.describes, describes: this.form.describes,
deviceNumber: this.form.deviceNumber, deviceNumber: this.form.deviceNumber,
factoryAreaNumber: this.form.factoryAreaNumber, factoryAreaNumber: this.form.factoryAreaNumber,
receiverType: this.form.receiverType,
type: this.type, type: this.type,
filePathList: this.imgList, filePathList: this.imgList,
} }
@ -227,8 +276,9 @@
this.form.deviceName = '' this.form.deviceName = ''
this.getDetailsByNumber() this.getDetailsByNumber()
} }
if (this.field == 'receiverType') { if (this.field == 'type') {
this.type = this.form[this.field] this.type = this.form[this.field]
this.getDetailsByNumber()
} }
this.singleColumnShow = false this.singleColumnShow = false
this.$emit('singleColumn', this.field, this.form[this.field]) this.$emit('singleColumn', this.field, this.form[this.field])
@ -275,8 +325,8 @@
title:'模具报修' title:'模具报修'
}) })
this.appDeviceMoldType = this.appDeviceMoldType.filter((item => item.value == "MOLD")) this.appDeviceMoldType = this.appDeviceMoldType.filter((item => item.value == "MOLD"))
this.form.receiverType = this.appDeviceMoldType[0].value
} }
this.form.type = this.appDeviceMoldType[0].value
this.getFactoryAreaList() this.getFactoryAreaList()
} }
} }

3
src/pages/mine/index.vue

@ -1,5 +1,5 @@
<template> <template>
<view class="mine-container" :style="{height: `${windowHeight}px`}"> <view class="mine-container" >
<u-navbar back-icon-color='#fff' back-icon-name='' <u-navbar back-icon-color='#fff' back-icon-name=''
:background="{ background: 'rgba(64, 158,255,'+bgOpacity+')'}" back-text="" title-color='#fff' :background="{ background: 'rgba(64, 158,255,'+bgOpacity+')'}" back-text="" title-color='#fff'
:immersive='true' :border-bottom='false' title="个人中心"> :immersive='true' :border-bottom='false' title="个人中心">
@ -78,6 +78,7 @@
<view style="margin-left: 10rpx;">隐私政策</view> <view style="margin-left: 10rpx;">隐私政策</view>
</view> </view>
</view> </view>
<!-- <view class="list-cell list-cell-arrow" @click="handleHelp"> <!-- <view class="list-cell list-cell-arrow" @click="handleHelp">
<view class="menu-item-box"> <view class="menu-item-box">
<u-icon name="info-circle" color="#2979ff" size="32"></u-icon> <u-icon name="info-circle" color="#2979ff" size="32"></u-icon>

109
src/pages/overhaulOrder/addForm.vue

@ -6,7 +6,7 @@
<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="maintenanceNumber" :class="form.id?'disabled':''"> <u-form-item label="维修工单" prop="maintenanceNumber" :class="form.id?'disabled':''">
<view class="select" @click="openSingleColumn('maintenanceNumber',form.maintenanceNumber,repairOrderList)"> <view class="select" @click="openOrder">
<view class="input" v-if='form.maintenanceNumber'> <view class="input" v-if='form.maintenanceNumber'>
{{form.maintenanceNumber}} {{form.maintenanceNumber}}
</view> </view>
@ -16,7 +16,7 @@
<u-icon name="arrow-right" color="#aaaaaa" size="28" v-if="!form.id"></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="factoryAreaName" required :class="isDisabled?'disabled':''"> <!-- <u-form-item :label="`${type=='DEVICE'?'设备' : '模具'}名称`" prop="factoryAreaName" required :class="isDisabled?'disabled':''">
<view class="select" @click="openSingleColumn('deviceNumber',form.deviceNumber,deviceList)"> <view class="select" @click="openSingleColumn('deviceNumber',form.deviceNumber,deviceList)">
<view class="input" v-if='form.deviceName'> <view class="input" v-if='form.deviceName'>
{{form.deviceName}} {{form.deviceName}}
@ -26,6 +26,18 @@
</view> </view>
<u-icon name="arrow-right" color="#aaaaaa" size="28" v-if="!form.id"></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 label="类型" prop="deviceNumber" required class="disabled">
{{type =='DEVICE'||type == 'TECH'?'设备' : '模具'}}
</u-form-item>
<u-form-item :label="`${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码`" prop="deviceNumber" required :class="isDisabled?'disabled':''">
<u-input v-model="form.deviceNumber" :placeholder="`请输入${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码`" @blur="blur()" />
<view class="right-button" @click="chickRightButton" v-show="!isDisabled">
扫描
</view>
</u-form-item>
<u-form-item :label="`${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}名称`" prop="deviceNumber" required class="disabled">
<u-input v-model="form.deviceName" :placeholder="`根据${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码获得`" disabled/>
</u-form-item> </u-form-item>
<u-form-item label="所属厂区" prop="factoryAreaName" class="disabled"> <u-form-item label="所属厂区" prop="factoryAreaName" class="disabled">
<u-input v-model="form.factoryAreaName" placeholder="请输入所属厂区" disabled /> <u-input v-model="form.factoryAreaName" placeholder="请输入所属厂区" disabled />
@ -245,6 +257,76 @@
} }
}, },
//
chickRightButton(field) {
if(!this.form.type){
this.$modal.showToast('请先选择类型')
return;
}
uni.scanCode({
success: function(res) {
this.form.deviceNumber = res.result
this.getDetailsByNumber()
}
});
},
blur() {
if(this.form.deviceNumber){
this.getDetailsByNumber()
}else{
this.form.deviceName =''
this.form.factoryAreaName = ''
this.form.factoryAreaNumber = ''
}
},
// /
getDetailsByNumber() {
if (this.type == 'DEVICE'||this.type == 'TECH') {
deviceApi.getDeviceDetailsByNumber({
number:this.form.deviceNumber,
type:this.type
}).then((res) => {
if(!res.data){
this.$modal.showToast('找不到该设备')
this.form.deviceName =''
this.form.factoryAreaName = ''
this.form.factoryAreaNumber = ''
return;
}
this.form.deviceName = res.data.name
this.form.factoryAreaName = res.data.factoryAreaName
this.form.factoryAreaNumber = res.data.factoryAreaNumber
}).catch(()=>{
this.$modal.showToast('找不到该设备')
this.form.deviceName =''
this.form.factoryAreaName = ''
this.form.factoryAreaNumber = ''
})
} else if (this.type == 'MOLD') {
moldApi.getMoldDetailsByNumber({
number:this.form.deviceNumber
}).then((res) => {
if(!res.data){
this.$modal.showToast('找不到该设备')
this.form.deviceName =''
this.form.factoryAreaName = ''
this.form.factoryAreaNumber = ''
return;
}
this.form.deviceName = res.data.name
this.form.factoryAreaName = res.data.factoryAreaName
this.form.factoryAreaNumber = res.data.factoryAreaNumber
}).catch(()=>{
this.$modal.showToast('找不到该设备')
this.form.deviceName =''
this.form.factoryAreaName = ''
this.form.factoryAreaNumber = ''
})
}
},
openOrder(){
this.$tab.navigateTo(`/pages/overhaulOrder/reqairOrderList?type=`+this.type)
}
}, },
async onLoad(option) { async onLoad(option) {
if (option.type) this.type = option.type; if (option.type) this.type = option.type;
@ -262,8 +344,29 @@
this.isDisabled = this.form.maintenanceNumber ||this.form.id ? true:false this.isDisabled = this.form.maintenanceNumber ||this.form.id ? true:false
}; };
await this.getRepairOrderList() await this.getRepairOrderList()
this.getDeviceList() // this.getDeviceList()
this.faultType = await dictApi.getDict('fault_type') this.faultType = await dictApi.getDict('fault_type')
uni.$on('chooseOrder',data=>{
console.log(data)
if(data){
this.form.maintenanceNumber = data.number
this.form.deviceName = data.name
this.form.deviceNumber = data.deviceNumber
this.form.deviceName = data.name
this.form.factoryAreaName = data.factoryAreaName
this.form.factoryAreaNumber = data.factoryAreaNumber
this.isDisabled = true
}else{
this.form.maintenanceNumber = ''
this.form.deviceName = ''
this.form.deviceNumber = ''
this.form.deviceName = ''
this.form.factoryAreaName = ''
this.form.factoryAreaNumber =''
this.isDisabled = false
}
})
} }
} }
</script> </script>

4
src/pages/overhaulOrder/addServiceRecord.vue

@ -1,5 +1,5 @@
<template> <template>
<!-- 添加修工单 --> <!-- 添加修工单 -->
<view class="add-form-container"> <view class="add-form-container">
<u-form :model="form" ref="form1" label-width="160rpx"> <u-form :model="form" ref="form1" label-width="160rpx">
<u-form-item label="检修描述" prop="name" required> <u-form-item label="检修描述" prop="name" required>
@ -108,7 +108,7 @@
</view> </view>
</u-form-item> </u-form-item>
<u-form-item label="数量" prop="qty" required> <u-form-item label="数量" prop="qty" required>
<u-input v-model="form1.qty" type="number" placeholder="请输入故障描述" /> <u-input v-model="form1.qty" type="number" placeholder="请输入数量" />
</u-form-item> </u-form-item>
</u-form> </u-form>
</view> </view>

256
src/pages/overhaulOrder/reqairOrderList.vue

@ -0,0 +1,256 @@
<template>
<!-- 维修工单 -->
<view class="container">
<view class="list">
<view class="item" v-for="(item,index) in repairOrderList" :key="index" @click="chooseItem(item)">
<u-checkbox v-model="item.checked" shape="circle" style="margin-top: 8rpx;"></u-checkbox>
<view class="right">
<view class="title">
<view class="title-txt">
{{item.describes}}
</view>
<u-tag text="待接单" v-if="item.status == 'PENDING'" bg-color='rgba(255,255,255,0)' color='#fe8463'
border-color='#fe8463' type="primary" shape='circle' />
<u-tag text="已撤回" v-else-if="item.status=='REJECTED'" bg-color='rgba(255,255,255,0)'
color='#d7d7d7' border-color='#d7d7d7 ' type="warning" shape='circle' />
<u-tag text="已转办" v-else-if="item.status=='TRANSFERRED'" bg-color='rgba(255,255,255,0)'
color='#e01f54' border-color='#e01f54' type="success" shape='circle' />
<u-tag text="已接单" v-else-if="item.status=='PECEIVED'" bg-color='rgba(255,255,255,0)'
color='#005eaa' border-color='#005eaa ' type="error" shape='circle' />
<u-tag text="已验证" v-else-if="item.status=='VERIFIED'" bg-color='rgba(255,255,255,0)'
color='#2EC7C9' border-color='#2EC7C9' type="info" shape='circle' />
<u-tag text="已完成" v-else-if="item.status=='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>
</view>
<view class="dec">
类型:<span>{{item.type=='DEVICE'?'设备':item.type=='TECH'?'工艺':'模具'}}</span>
</view>
<view class="dec">
{{`${type=='DEVICE'?'设备' : '模具'}`}}编号:<span>{{item.deviceNumber}}</span>
</view>
<view class="dec">
{{`${type=='DEVICE'?'设备' : '模具'}`}}名称:<span>{{item.name}}</span>
</view>
<view class="dec">
所属厂区:<span>{{item.factoryAreaName}}</span>
</view>
<view class="dec">
班次:<span>{{item.classesName}}</span>
</view>
<view class="dec">
故障类型:<span>{{item.faultTypeName}}</span>
</view>
</view>
</view>
</view>
<view class="footer">
<view class="btns">
<button class="sure" @click="sure"> 确定</button>
</view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
</template>
<script>
import * as repairOrderApi from "@/api/repairOrder.js"
export default {
data() {
return {
repairOrderList: [],
type: ''
}
},
methods: {
//
getList() {
this.$modal.loading('加载中')
repairOrderApi.repairOrderList({
type: this.type,
result: 'TEMPORARILY'
}).then((res) => {
this.$modal.closeLoading()
res.data.forEach(item=>{
item.checked = false
})
this.repairOrderList = res.data
})
},
chooseItem(item){
let arr = this.repairOrderList.filter(cur=>cur.id != item.id)
arr.forEach(item=>{
item.checked = false
})
item.checked = !item.checked
},
sure(){
let data =this.repairOrderList.filter(cur=>cur.checked)[0]
uni.$emit('chooseOrder',data)
this.$tab.navigateBack()
}
},
onLoad(option) {
if (option.type) this.type = option.type;
},
onShow() {
this.getList()
},
}
</script>
<style lang="scss" scoped>
.list {
background: #f5f5f5;
margin-top: 20rpx;
padding-bottom: 120rpx;
.item {
padding: 30rpx 30rpx 0px 30rpx;
margin-top: 20rpx;
background: white;
display: flex;
align-items: flex-start;
.right{
flex: 1;
}
.title {
display: flex;
align-items: center;
padding-bottom: 20rpx;
.title-txt {
color: #409eff;
font-weight: bold;
font-size: 36rpx;
width: 0px;
flex: 1;
}
.time {
color: #919191;
}
}
.dec {
padding-bottom: 20rpx;
span {
color: #999999;
}
}
.last {
padding-bottom: 30rpx;
}
.bottom {
display: flex;
justify-content: space-between;
align-items: center;
border-top: 1px solid #E4E4E4;
padding: 20rpx 0px;
}
}
}
.list {
background: #f5f5f5;
margin-top: 20rpx;
.item {
padding: 30rpx 30rpx 0px 30rpx;
margin-top: 20rpx;
background: white;
.title {
display: flex;
align-items: center;
padding-bottom: 20rpx;
.title-txt {
color: #409eff;
font-weight: bold;
font-size: 36rpx;
width: 0px;
flex: 1;
}
.time {
color: #919191;
}
}
.dec {
padding-bottom: 20rpx;
span {
color: #999999;
}
}
.last {
padding-bottom: 30rpx;
}
.bottom {
display: flex;
justify-content: space-between;
align-items: center;
border-top: 1px solid #E4E4E4;
padding: 20rpx 0px;
position: relative;
.button {
position: absolute;
right: 0rpx;
}
}
}
}
.footer {
position: fixed;
bottom: 0px;
left: 0px;
width: 100%;
}
.btns {
display: flex;
button {
flex: 1;
}
.sure {
background: #409eff;
color: white;
border-radius: 0px;
&::after {
border: 1px solid #409eff;
border-radius: 0px;
}
}
.reset {
background: #F5F5F5;
border-radius: 0px;
&::after {
border-radius: 0px;
}
}
}
</style>

98
src/pages/repairOrder/addForm.vue

@ -16,7 +16,7 @@
<u-icon name="arrow-right" color="#aaaaaa" size="28" v-if="!form.id"></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'||type == 'TECH'?'设备' : '模具'}名称`" prop="deviceNumber" required> <!-- <u-form-item :label="`${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}名称`" 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.deviceName'> <view class="input" v-if='form.deviceName'>
{{form.deviceName}} {{form.deviceName}}
@ -26,9 +26,21 @@
</view> </view>
<u-icon name="arrow-right" color="#aaaaaa" size="28" v-if="!form.id"></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 :label="`${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码`" prop="deviceNumber" required>
<u-input v-model="form.deviceNumber" :placeholder="`请输入${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码`" @blur="blur()" />
<view class="right-button" @click="chickRightButton">
扫描
</view>
</u-form-item>
<u-form-item :label="`${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}名称`" prop="deviceNumber" required class="disabled">
<u-input v-model="form.deviceName" :placeholder="`根据${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码获得`" disabled/>
</u-form-item> </u-form-item>
<u-form-item label="所属厂区" prop="factoryAreaName" required> <u-form-item :label="`厂区编码`" prop="factoryAreaNumber" required class="disabled">
<u-input v-model="form.factoryAreaName" placeholder="请输入所属厂区" disabled /> <u-input v-model="form.factoryAreaNumber" :placeholder="`根据${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码获得`" disabled/>
</u-form-item>
<u-form-item :label="`厂区名称`" prop="factoryAreaName" required class="disabled">
<u-input v-model="form.factoryAreaName" :placeholder="`根据${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码获得`" disabled/>
</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)">
@ -99,6 +111,73 @@
} }
}, },
methods: { methods: {
//
chickRightButton(field) {
if(!this.form.type){
this.$modal.showToast('请先选择类型')
return;
}
uni.scanCode({
success: function(res) {
this.form.deviceNumber = res.result
this.getDetailsByNumber()
}
});
},
blur() {
if(this.form.deviceNumber){
this.getDetailsByNumber()
}else{
this.form.deviceName =''
this.form.factoryAreaName = ''
this.form.factoryAreaNumber = ''
}
},
// /
getDetailsByNumber() {
if (this.type == 'DEVICE'||this.type == 'TECH') {
deviceApi.getDeviceDetailsByNumber({
number:this.form.deviceNumber,
type:this.type
}).then((res) => {
if(!res.data){
this.$modal.showToast('找不到该设备')
this.form.deviceName =''
this.form.factoryAreaName = ''
this.form.factoryAreaNumber = ''
return;
}
this.form.deviceName = res.data.name
this.form.factoryAreaName = res.data.factoryAreaName
this.form.factoryAreaNumber = res.data.factoryAreaNumber
}).catch(()=>{
this.$modal.showToast('找不到该设备')
this.form.deviceName =''
this.form.factoryAreaName = ''
this.form.factoryAreaNumber = ''
})
} else if (this.type == 'MOLD') {
moldApi.getMoldDetailsByNumber({
number:this.form.deviceNumber
}).then((res) => {
if(!res.data){
this.$modal.showToast('找不到该设备')
this.form.deviceName =''
this.form.factoryAreaName = ''
this.form.factoryAreaNumber = ''
return;
}
this.form.deviceName = res.data.name
this.form.factoryAreaName = res.data.factoryAreaName
this.form.factoryAreaNumber = res.data.factoryAreaNumber
}).catch(()=>{
this.$modal.showToast('找不到该设备')
this.form.deviceName =''
this.form.factoryAreaName = ''
this.form.factoryAreaNumber = ''
})
}
},
// //
submit() { submit() {
// //
@ -263,6 +342,7 @@
this.appDeviceMoldType = this.appDeviceMoldType.filter((item=>item.value!="MOLD")) this.appDeviceMoldType = this.appDeviceMoldType.filter((item=>item.value!="MOLD"))
} }
this.form.type = this.appDeviceMoldType[0].value
this.faultType = await dictApi.getDict('fault_type') this.faultType = await dictApi.getDict('fault_type')
} }
} }
@ -272,9 +352,17 @@
.add-form-container { .add-form-container {
min-height: calc(100vh - 140rpx); min-height: calc(100vh - 140rpx);
background: white; background: white;
padding: 0px 30rpx 140rpx; padding: 0px 0rpx 140rpx;
} }
.u-form-item {
padding: 20rpx 30rpx;
}
.disabled {
background: #f5f5f5;
}
.list { .list {
padding-bottom: 20rpx; padding-bottom: 20rpx;

151
src/pages/repairOrder/detail.vue

@ -17,15 +17,39 @@
<view>报修描述</view> <view>报修描述</view>
<view>{{data.describes}}</view> <view>{{data.describes}}</view>
</view> </view>
<view class="dec-item">
<u-form :model="data" ref="form1" label-width="160rpx" style="border-top: 1px solid rgba(220,220,220,0.5);border-bottom: 1px solid rgba(220,220,220,0.5);margin-bottom: 20rpx;" v-if="data.status == 'PECEIVED'&& $store.state.user.post.code == 'worker'">
<u-form-item label="班次" prop="classes" required>
<view class="select" @click="openSingleColumn('classes',data.classes,maintenanceShift)">
<view class="input" v-if='data.classes||data.classes==0'>
{{selectFormat(data.classes,maintenanceShift)}}
</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="classes" required>
<view class="select" @click="openSingleColumn('faultType',data.faultType,faultType)">
<view class="input" v-if='data.faultType'>
{{selectFormat(data.faultType,faultType)}}
</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="dec-item" v-if="data.status != 'PECEIVED'|| $store.state.user.post.code != 'worker'">
<view>班次</view> <view>班次</view>
<view>{{data.classesName}}</view> <view>{{data.classesName}}</view>
</view> </view>
<view class="dec-item"> <view class="dec-item" v-if="data.status != 'PECEIVED'|| $store.state.user.post.code != 'worker'">
<view>故障类型</view> <view>故障类型</view>
<view>{{data.faultTypeName}}</view> <view>{{data.faultTypeName}}</view>
</view> </view>
<view class="dec-item" v-if="data.createTime"> <view class="dec-item" v-if="data.createTime">
<view>创建时间</view> <view>创建时间</view>
<view>{{$time.formatDate(data.createTime)}}</view> <view>{{$time.formatDate(data.createTime)}}</view>
@ -161,7 +185,9 @@
<view class="btns" v-if="data.status == 'PENDING'&& $store.state.user.post.code == 'worker'"> <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> <u-button type="primary" @click="orderClick(1)" :loading='loading' :disabled='loading'>接单</u-button>
</view> </view>
<view class="btns" v-if="data.status == 'PECEIVED'&& $store.state.user.post.code == 'worker'"> <view class="btns" v-if="data.status == 'PECEIVED'&& $store.state.user.post.code == 'worker'">
<u-button shape="shape" type="warning" style="min-width: 120rpx;" :loading='loading1' @click="editForm" :disabled='loading1'>修改工单</u-button>
<u-button type="primary" @click="orderClickSuccess()" :loading='loading' <u-button type="primary" @click="orderClickSuccess()" :loading='loading'
:disabled='loading'>完成</u-button> :disabled='loading'>完成</u-button>
</view> </view>
@ -186,6 +212,8 @@
</view> </view>
</u-popup> </u-popup>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> <view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
<u-select v-model="singleColumnShow" mode="single-column" :default-value='singleColumnDefaultValue'
:list="singleColumnList" @confirm="chooseSingleColumn"></u-select>
</view> </view>
</template> </template>
@ -213,6 +241,7 @@
}, },
data: '', // data: '', //
loading: false, loading: false,
loading1:false,
type: "", type: "",
deviceInfo: '', // deviceInfo: '', //
serviceList: [], // serviceList: [], //
@ -220,7 +249,14 @@
isShowSuccess: false, isShowSuccess: false,
orderCompleteResult: [], // orderCompleteResult: [], //
result: 'TEMPORARILY', result: 'TEMPORARILY',
data1: '' data1: '',
singleColumnShow: false,
singleColumnDefaultValue: [],
singleColumnList: [],
field: '',
maintenanceShift: [], //
faultType: [], //
} }
}, },
methods: { methods: {
@ -293,7 +329,7 @@
} }
} }
const data = { const data = {
number: this.data.number, number: this.data.number,
status: this.data.status, status: this.data.status,
@ -301,12 +337,29 @@
result: type == 2 ? this.result : '', result: type == 2 ? this.result : '',
requestNumber: this.data.requestNumber, requestNumber: this.data.requestNumber,
} }
//
const data1 = {
id: this.data && this.data.id ? this.data.id : '',
describes: this.data.describes,
type: this.data.type,
deviceNumber: this.data.deviceNumber,
factoryAreaNumber: this.data.factoryAreaNumber,
classes: this.data.classes,
faultType: this.data.faultType
}
let tips = this.data.status == 'PENDING' ? '是否接单?' : this.data.status == 'PECEIVED' ? '是否完成?' : this.data let tips = this.data.status == 'PENDING' ? '是否接单?' : this.data.status == 'PECEIVED' ? '是否完成?' : this.data
.status == 'COMPLETED' ? '是否验证完结?' : '' .status == 'COMPLETED' ? '是否验证完结?' : ''
this.$modal.confirm(tips).then(() => { this.$modal.confirm(tips).then(async () => {
this.$modal.loading('加载中') this.$modal.loading('加载中')
this.loading = true this.loading = true
repairOrderApi.orderClick(data).then((res) => { //
if (this.data.status == 'PECEIVED') {
await repairOrderApi.repairOrderUpdate(data1).then((res) => {}).catch(() => {
this.$modal.closeLoading()
this.loading = false
})
}
await repairOrderApi.orderClick(data).then((res) => {
if (res.data) { if (res.data) {
this.$modal.showToast('操作成功') this.$modal.showToast('操作成功')
setTimeout(() => { setTimeout(() => {
@ -372,6 +425,67 @@
} }
} }
}); });
},
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.data[this.field] = e[0].value
if(this.field == 'classes'){
this.data.classesName = e[0].label
}
if(this.field == 'faultType'){
this.data.faultTypeName = e[0].label
}
this.singleColumnShow = false
this.$emit('singleColumn', this.field, this.data[this.field])
this.$forceUpdate()
},
//
editForm(){
const data = {
id: this.data && this.data.id ? this.data.id : '',
describes: this.data.describes,
type: this.data.type,
deviceNumber: this.data.deviceNumber,
factoryAreaNumber: this.data.factoryAreaNumber,
classes: this.data.classes,
faultType: this.data.faultType
}
this.$modal.confirm('是否修改维修工单').then(() => {
this.$modal.loading('加载中')
this.loading1 = true
repairOrderApi.repairOrderUpdate(data).then((res) => {
this.$modal.closeLoading()
if (res.data) {
this.$modal.showToast('修改成功')
// setTimeout(() => {
// this.$tab.navigateBack()
this.loading1 = false
// }, 1500)
} else {
this.$modal.showToast('修改失败')
this.loading1 = false
}
}).catch(() => {
this.$modal.closeLoading()
this.loading = false
})
})
} }
}, },
async onLoad(option) { async onLoad(option) {
@ -385,7 +499,7 @@
}, },
onShow() { async onShow() {
if (this.data.requestNumber) { if (this.data.requestNumber) {
this.getDeviceRepairDetailsByNumber() this.getDeviceRepairDetailsByNumber()
this.list = [{ this.list = [{
@ -408,6 +522,8 @@
}] }]
} }
this.getRepairOrderDetaiList() this.getRepairOrderDetaiList()
this.maintenanceShift = await dictApi.getDict('maintenance_shift')
this.faultType = await dictApi.getDict('fault_type')
} }
} }
</script> </script>
@ -628,4 +744,23 @@
border-radius: 10rpx; border-radius: 10rpx;
} }
} }
.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);
}
}
</style> </style>

4
src/pages/repairOrder/index.vue

@ -48,10 +48,10 @@
<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.code == 'worker'&&item.status=='PECEIVED'"> <!-- <view class="status" v-if=" $store.state.user.post.code == 'worker'&&item.status=='PECEIVED'">
<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> -->
</view> </view>
</view> </view>
</view> </view>

107
src/pages/repairOrder/transfer.vue

@ -13,17 +13,15 @@
<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'||type=='TECH'?'设备' : '模具'}名称`" prop="deviceNumber" required> <u-form-item :label="`${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码`" prop="deviceNumber" required>
<view class="select" @click="openSingleColumn('deviceNumber',form.deviceNumber,deviceList)"> <u-input v-model="form.deviceNumber" :placeholder="`请输入${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码`" @blur="blur()" />
<view class="input" v-if='form.deviceNumber'> <view class="right-button" @click="chickRightButton">
{{selectFormat(form.deviceNumber,deviceList)}} 扫描
</view>
<view class="placeholder" v-else>
{{`请选择${type=='DEVICE'||type=='TECH'?'设备' : '模具'}名称`}}
</view>
<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'||type == 'TECH'?'设备' : '模具'}名称`" prop="deviceNumber" required class="disabled">
<u-input v-model="form.deviceName" :placeholder="`根据${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码获得`" disabled/>
</u-form-item>
<u-form-item label="维修人员" prop="describes" required> <u-form-item label="维修人员" prop="describes" required>
<view class="select" @click="openSelecUser('receiverUserId')"> <view class="select" @click="openSelecUser('receiverUserId')">
<view class="input" v-if='form.receiverUserId'> <view class="input" v-if='form.receiverUserId'>
@ -104,7 +102,7 @@
return; return;
} }
if (!this.form.deviceNumber) { if (!this.form.deviceNumber) {
this.$modal.showToast(`请选择${this.type=='DEVICE'||this.type=='TECH'?'设备' : '模具'}名称`) this.$modal.showToast(`请选择${this.type=='DEVICE'||this.type=='TECH'?'设备' : '模具'}编码`)
return; return;
} }
if (!this.form.receiverUserId) { if (!this.form.receiverUserId) {
@ -116,6 +114,7 @@
receiverType: this.form.receiverType, receiverType: this.form.receiverType,
deviceNumber: this.form.deviceNumber, deviceNumber: this.form.deviceNumber,
receiverUserId: this.form.receiverUserId, receiverUserId: this.form.receiverUserId,
factoryAreaNumber: this.form.factoryAreaNumber,
} }
this.$modal.confirm('是否转办维修工单').then(() => { this.$modal.confirm('是否转办维修工单').then(() => {
this.$modal.loading('加载中') this.$modal.loading('加载中')
@ -151,6 +150,80 @@
this.form = {} this.form = {}
} }
}, },
//
chickRightButton(field) {
if(!this.form.type){
this.$modal.showToast('请先选择类型')
return;
}
uni.scanCode({
success: function(res) {
this.form.deviceNumber = res.result
this.getDetailsByNumber()
}
});
},
blur() {
if(this.form.deviceNumber){
this.getDetailsByNumber()
}else{
this.form.deviceName =''
this.form.factoryAreaName = ''
this.form.factoryAreaNumber = ''
}
},
// /
getDetailsByNumber() {
if (this.type == 'DEVICE'||this.type == 'TECH') {
deviceApi.getDeviceDetailsByNumber({
number:this.form.deviceNumber,
type:this.type
}).then(async (res) => {
if(!res.data){
this.$modal.showToast('找不到该设备')
this.form.deviceName =''
this.form.factoryAreaName = ''
this.form.factoryAreaNumber = ''
this.selecUserList = []
return;
}
this.form.deviceName = res.data.name
this.form.factoryAreaName = res.data.factoryAreaName
this.form.factoryAreaNumber = res.data.factoryAreaNumber
await this.getSelecUser()
}).catch(()=>{
this.$modal.showToast('找不到该设备')
this.form.deviceName =''
this.form.factoryAreaName = ''
this.form.factoryAreaNumber = ''
this.selecUserList = []
})
} else if (this.type == 'MOLD') {
moldApi.getMoldDetailsByNumber({
number:this.form.deviceNumber
}).then(async (res) => {
if(!res.data){
this.$modal.showToast('找不到该设备')
this.form.deviceName =''
this.form.factoryAreaName = ''
this.form.factoryAreaNumber = ''
this.selecUserList = []
return;
}
this.form.deviceName = res.data.name
this.form.factoryAreaName = res.data.factoryAreaName
this.form.factoryAreaNumber = res.data.factoryAreaNumber
await this.getSelecUser()
}).catch(()=>{
this.$modal.showToast('找不到该设备')
this.form.deviceName =''
this.form.factoryAreaName = ''
this.form.factoryAreaNumber = ''
console.log(this.form)
this.selecUserList = []
})
}
},
// //
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
@ -254,7 +327,8 @@
if (option.type) this.type = option.type; if (option.type) this.type = option.type;
if (option.id) this.form.id = option.id; if (option.id) this.form.id = option.id;
this.deviceMoldType = await dictApi.getDict('app_device_mold_type') this.deviceMoldType = await dictApi.getDict('app_device_mold_type')
this.deviceMoldType = this.deviceMoldType.filter(item => item.value != this.type) this.form.receiverType = this.deviceMoldType[0].value
// this.deviceMoldType = this.deviceMoldType.filter(item => item.value != this.type)
} }
} }
</script> </script>
@ -263,8 +337,17 @@
.add-form-container { .add-form-container {
min-height: calc(100vh - 140rpx); min-height: calc(100vh - 140rpx);
background: white; background: white;
padding: 0px 30rpx 140rpx; padding: 0px 0rpx 140rpx;
}
.u-form-item {
padding: 20rpx 30rpx;
}
.disabled {
background: #f5f5f5;
} }
.list { .list {
padding-bottom: 20rpx; padding-bottom: 20rpx;

9
src/pages/upkeepOrder/addServiceRecord.vue

@ -298,8 +298,13 @@
// //
reset() { reset() {
if (this.form.id) { if (this.form.id) {
this.form.classes = ''; this.form.actualMinutes = '';
this.form.faultType = '' this.form.chargePeoples = '';
this.form.status = 1;
this.form.completionTime = '';
this.form.engineer = '';
this.form.uncompleted = '';
this.form.itemNumbers = [];
} else { } else {
this.form = {} this.form = {}

Loading…
Cancel
Save