Browse Source

设备保修功能修改,维修工单添加类型

master
zhang_li 9 months ago
parent
commit
63bf19f98c
  1. 9
      api/dept.js
  2. 7
      api/device.js
  3. 7
      api/mold.js
  4. 2
      config.js
  5. 102
      pages/deviceReport/addForm.vue
  6. 2
      pages/deviceReport/index.vue
  7. 15
      pages/repairOrder/addForm.vue
  8. 6
      pages/repairOrder/detail.vue
  9. 2
      pages/repairOrder/index.vue
  10. 2
      pages/sparePartsServiceWorkOrderList/addForm.vue
  11. 2
      pages/spotCheckOrder/addForm.vue

9
api/dept.js

@ -8,3 +8,12 @@ export function getSelecUser(params) {
params params
}) })
} }
// 获取厂区列表
export function getFactoryAreaList(params) {
return request({
url: '/system/dept/selectAllFactoryArea',
'method': 'GET',
params
})
}

7
api/device.js

@ -8,6 +8,13 @@ export function getDeviceDetailsByNumber(params) {
params params
}) })
} }
// 根据厂区查询设备
export function getDeviceByFactoryAreaNumber(factoryAreaNumber) {
return request({
url: '/eam/device-accounts/selectData?factoryAreaNumber='+factoryAreaNumber,
'method': 'GET'
})
}
// 添加报修 // 添加报修
export function deviceRepairCreate(data) { export function deviceRepairCreate(data) {
return request({ return request({

7
api/mold.js

@ -7,6 +7,13 @@ export function getMoldDetailsByNumber(params) {
params params
}) })
} }
// 根据厂区查询模具
export function getMoldByFactoryAreaNumber(factoryAreaNumber) {
return request({
url: '/eam/mold-accounts/selectData?factoryAreaNumber='+factoryAreaNumber,
'method': 'GET'
})
}
// 模具分页列表 // 模具分页列表
export function moldPage(params) { export function moldPage(params) {
return request({ return request({

2
config.js

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

102
pages/deviceReport/addForm.vue

@ -5,18 +5,27 @@
<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="`${type=='DEVICE'?'设备' : '模具'}编码`" prop="deviceNumber" required> <u-form-item label="所属厂区" prop="factoryAreaNumber" required>
<u-input v-model="form.deviceNumber" <view class="select" @click="openSingleColumn('factoryAreaNumber',form.factoryAreaNumber,factoryAreaList)">
:placeholder="`请输入${type=='DEVICE'?'设备' : '模具'}编码`" disabled/> <view class="input" v-if='form.factoryAreaNumber'>
<view class="right-button" @click="chickRightButton"> {{selectFormat(form.factoryAreaNumber,factoryAreaList)}}
扫描 </view>
<view class="placeholder" v-else>
{{`请选择所属厂区`}}
</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'?'设备' : '模具'}名称`" prop="deviceName" required class="disabled"> <u-form-item :label="`${type=='DEVICE'?'设备' : '模具'}`" prop="deviceNumber" required>
<u-input v-model="form.deviceName" :placeholder="`请输入${type=='DEVICE'?'设备' : '模具'}名称`" disabled /> <view class="select" @click="openSingleColumn('deviceNumber',form.deviceNumber,deviceList)">
</u-form-item> <view class="input" v-if='form.deviceNumber'>
<u-form-item label="所属厂区" prop="factoryAreaName" required class="disabled"> {{selectFormat(form.deviceNumber,deviceList)}}
<u-input v-model="form.factoryAreaName" placeholder="请输入所属厂区" disabled /> </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>
<u-form-item label="类型" prop="receiverType" required> <u-form-item label="类型" prop="receiverType" required>
<view class="select" @click="openSingleColumn('receiverType',form.receiverType,appDeviceMoldType)"> <view class="select" @click="openSingleColumn('receiverType',form.receiverType,appDeviceMoldType)">
@ -59,6 +68,7 @@
import * as moldApi from "@/api/mold.js" import * as moldApi from "@/api/mold.js"
import * as dictApi from "@/api/dict.js" import * as dictApi from "@/api/dict.js"
import * as uploadApi from "@/api/upload.js" import * as uploadApi from "@/api/upload.js"
import * as deptApi from "@/api/dept.js"
export default { export default {
data() { data() {
@ -66,6 +76,8 @@
loading: false, loading: false,
type: "", type: "",
appDeviceMoldType: [], appDeviceMoldType: [],
factoryAreaList:[],//
deviceList:[],//
form: { form: {
describes: "", describes: "",
deviceNumber: '', deviceNumber: '',
@ -95,30 +107,44 @@
this.getDetailsByNumber() this.getDetailsByNumber()
} }
}, },
//
getFactoryAreaList() {
deptApi.getFactoryAreaList().then((res) => {
if (res.data&&res.data.length>0) {
res.data.map(item => {
item.value = item.id
item.label = item.name
})
this.factoryAreaList = res.data
} else{
this.factoryAreaList =[]
}
})
},
// / // /
getDetailsByNumber() { getDetailsByNumber() {
const data = {
number: this.form.deviceNumber,
id: ''
}
if (this.type == 'DEVICE') { if (this.type == 'DEVICE') {
deviceApi.getDeviceDetailsByNumber(data).then((res) => { deviceApi.getDeviceByFactoryAreaNumber(this.form.factoryAreaNumber).then((res) => {
if (res.data) { if (res.data&&res.data.length>0) {
this.form.deviceName = res.data.name res.data.map(item => {
this.form.factoryAreaName = res.data.factoryAreaName item.value = item.number
this.form.factoryAreaNumber = res.data.factoryAreaNumber item.label = item.name
} else { })
this.$modal.showToast(`找不到该${this.type=='DEVICE'?'设备' : '模具'}`) this.deviceList = res.data
}else{
this.deviceList = []
} }
}) })
} else if (this.type == 'MOLD') { } else if (this.type == 'MOLD') {
moldApi.getMoldDetailsByNumber(data).then((res) => { moldApi.getMoldByFactoryAreaNumber(this.form.factoryAreaNumber).then((res) => {
if (res.data) { if (res.data&&res.data.length>0) {
this.form.deviceName = res.data.name res.data.map(item => {
this.form.factoryAreaName = res.data.factoryAreaName item.value = item.number
this.form.factoryAreaNumber = res.data.factoryAreaNumber item.label = item.name
} else { })
this.$modal.showToast(`找不到该${this.type=='DEVICE'?'设备' : '模具'}`) this.deviceList = res.data
}else{
this.deviceList = []
} }
}) })
} }
@ -130,16 +156,16 @@
this.$modal.showToast('请输入故障描述') this.$modal.showToast('请输入故障描述')
return; return;
} }
if (!this.form.deviceNumber) { if (!this.form.factoryAreaNumber) {
this.$modal.showToast(`输入${this.type=='DEVICE'?'设备' : '模具'}编码`) this.$modal.showToast(`选择选择所属厂区`)
return; return;
} }
if (!this.form.deviceName) { if (!this.form.deviceNumber) {
this.$modal.showToast(`输入${this.type=='DEVICE'?'设备' : '模具'}名称`) this.$modal.showToast(`选择${this.type=='DEVICE'?'设备' : '模具'}`)
return; return;
} }
if (!this.form.factoryAreaName) { if (!this.form.receiverType) {
this.$modal.showToast('请输入所属厂区') this.$modal.showToast(`请选择类型'}`)
return; return;
} }
if (this.imgList.length == 0) { if (this.imgList.length == 0) {
@ -150,6 +176,7 @@
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,
} }
@ -197,6 +224,11 @@
// //
chooseSingleColumn(e) { chooseSingleColumn(e) {
this.form[this.field] = e[0].value this.form[this.field] = e[0].value
if(this.field == 'factoryAreaNumber'){
this.form.deviceNumber = ''
this.form.deviceName = ''
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])
this.$forceUpdate() this.$forceUpdate()
@ -233,6 +265,8 @@
async onLoad(option) { async onLoad(option) {
if (option.type) this.type = option.type; if (option.type) this.type = option.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"))
this.getFactoryAreaList()
} }
} }
</script> </script>

2
pages/deviceReport/index.vue

@ -9,7 +9,7 @@
</u-navbar> </u-navbar>
<!-- <Search @search='search' @screen='screen' :isShowScreen='false'/> --> <!-- <Search @search='search' @screen='screen' :isShowScreen='false'/> -->
<view class="list"> <view class="list">
<view class="item" v-for="(item,index) in list" :key="index" @click="itemClick(item,index)"> <view class="item" v-for="(item,index) in list" :key="index">
<view class="title"> <view class="title">
<view class="title-txt"> <view class="title-txt">
{{item.describes}} {{item.describes}}

15
pages/repairOrder/addForm.vue

@ -5,6 +5,17 @@
<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>
<view class="select" @click="openSingleColumn('receiverType',form.receiverType,appDeviceMoldType)">
<view class="input" v-if='form.receiverType'>
{{selectFormat(form.receiverType,appDeviceMoldType)}}
</view>
<view class="placeholder" v-else>
{{`请选择类型`}}
</view>
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon>
</view>
</u-form-item>
<u-form-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.deviceNumber'>
@ -65,6 +76,7 @@
data() { data() {
return { return {
loading: false, loading: false,
appDeviceMoldType: [],
type: "", type: "",
form: { form: {
id: '', id: '',
@ -108,6 +120,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,
deviceNumber: this.form.deviceNumber, deviceNumber: this.form.deviceNumber,
factoryAreaNumber: this.form.factoryAreaNumber, factoryAreaNumber: this.form.factoryAreaNumber,
classes: this.form.classes, classes: this.form.classes,
@ -243,6 +256,8 @@
}; };
await this.getDeviceList() await this.getDeviceList()
this.maintenanceShift = await dictApi.getDict('maintenance_shift') this.maintenanceShift = await dictApi.getDict('maintenance_shift')
this.appDeviceMoldType = await dictApi.getDict('app_device_mold_type')
this.appDeviceMoldType = this.appDeviceMoldType.filter((item=>item.value!="MOLD"))
this.faultType = await dictApi.getDict('fault_type') this.faultType = await dictApi.getDict('fault_type')
} }
} }

6
pages/repairOrder/detail.vue

@ -121,11 +121,11 @@
</view> </view>
<view class="footer"> <view class="footer">
<view class="btns"> <view class="btns">
<u-button type="primary" v-if="data.status == 'PENDING'&& $store.state.user.post == 'worker'" @click="orderClick(1)" :loading='loading' <u-button type="primary" v-if="data.status == 'PENDING'&& $store.state.user.post.code == 'worker'" @click="orderClick(1)" :loading='loading'
:disabled='loading'>接单</u-button> :disabled='loading'>接单</u-button>
<u-button type="primary" v-if="data.status == 'PECEIVED'&& $store.state.user.post == 'worker'" @click="orderClickSuccess()" :loading='loading' <u-button type="primary" v-if="data.status == 'PECEIVED'&& $store.state.user.post.code == 'worker'" @click="orderClickSuccess()" :loading='loading'
:disabled='loading'>完成</u-button> :disabled='loading'>完成</u-button>
<u-button type="primary" v-if="data.status == 'COMPLETED'&& $store.state.user.post == 'engineer'" @click="orderClick(3)" :loading='loading' <u-button type="primary" v-if="data.status == 'COMPLETED'&& $store.state.user.post.code == 'engineer'" @click="orderClick(3)" :loading='loading'
:disabled='loading'>验证完结</u-button> :disabled='loading'>验证完结</u-button>
</view> </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>

2
pages/repairOrder/index.vue

@ -4,7 +4,7 @@
<u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff' <u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff'
title="维修工单"> title="维修工单">
<template v-slot:right> <template v-slot:right>
<u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm" v-if=" $store.state.user.post == 'worker'"></u-icon> <u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm" v-if=" $store.state.user.post.code == 'worker'"></u-icon>
</template> </template>
</u-navbar> </u-navbar>
<!-- <Search @search='search' @screen='screen'/> --> <!-- <Search @search='search' @screen='screen'/> -->

2
pages/sparePartsServiceWorkOrderList/addForm.vue

@ -71,7 +71,7 @@
</view> </view>
</u-form-item> </u-form-item>
<u-form-item label="库位" prop="locationNumber" required v-if="isShow"> <u-form-item label="库位" prop="locationNumber" required v-if="isShow">
<u-input v-model="form1.locationNumber" placeholder="请选择库位" disabled/> <u-input v-model="form1.locationNumber" placeholder="请选择库位" @blur="blur()"/>
<view class="right-button" @click="chickRightButton"> <view class="right-button" @click="chickRightButton">
扫描 扫描
</view> </view>

2
pages/spotCheckOrder/addForm.vue

@ -7,7 +7,7 @@
</u-form-item> </u-form-item>
<u-form-item :label="`${type=='DEVICE'?'设备' : '模具'}编码`" prop="deviceNumber" required> <u-form-item :label="`${type=='DEVICE'?'设备' : '模具'}编码`" prop="deviceNumber" required>
<u-input v-model="form.deviceNumber" <u-input v-model="form.deviceNumber"
:placeholder="`请输入${type=='DEVICE'?'设备' : '模具'}编码`" disabled/> :placeholder="`请输入${type=='DEVICE'?'设备' : '模具'}编码`" @blur="blur"/>
<view class="right-button" @click="chickRightButton"> <view class="right-button" @click="chickRightButton">
扫描 扫描
</view> </view>

Loading…
Cancel
Save