lijuncheng 9 months ago
parent
commit
f64c0ba24f
  1. 9
      src/api/dept.js
  2. 13
      src/api/device.js
  3. 7
      src/api/mold.js
  4. 8
      src/api/sparePartsApplication.js
  5. 6
      src/api/sparePartsApplicationApprove.js
  6. 4
      src/api/sparePartsServiceWorkOrderList.js
  7. 102
      src/pages/deviceReport/addForm.vue
  8. 2
      src/pages/deviceReport/index.vue
  9. 15
      src/pages/repairOrder/addForm.vue
  10. 6
      src/pages/repairOrder/detail.vue
  11. 2
      src/pages/repairOrder/index.vue
  12. 2
      src/pages/sparePartsServiceWorkOrderList/addForm.vue
  13. 2
      src/pages/spotCheckOrder/addForm.vue

9
src/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
})
}

13
src/api/device.js

@ -8,10 +8,17 @@ 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({
url: '/eam/device-repair/create', url: '/eam/device-repair-request/create',
'method': 'POST', 'method': 'POST',
data data
}) })
@ -19,7 +26,7 @@ export function deviceRepairCreate(data) {
// 报修列表 // 报修列表
export function deviceRepairPage(params) { export function deviceRepairPage(params) {
return request({ return request({
url: '/eam/device-repair/getAppPage', url: '/eam/device-repair-request/getAppPage',
'method': 'GET', 'method': 'GET',
params params
}) })
@ -28,7 +35,7 @@ export function deviceRepairPage(params) {
// 撤销 // 撤销
export function rejected(id) { export function rejected(id) {
return request({ return request({
url: '/eam/device-repair/rejected?id='+id, url: '/eam/device-repair-request/rejected?id='+id,
'method': 'DELETE', 'method': 'DELETE',
}) })
} }

7
src/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({

8
src/api/sparePartsApplication.js

@ -3,7 +3,7 @@ import request from '@/utils/request'
// 备件领用列表 // 备件领用列表
export function sparePartsApplicationPage(params) { export function sparePartsApplicationPage(params) {
return request({ return request({
url: '/eam/item-apply-main/getAppPage', url: '/eam/item-apply-request-main/getAppPage',
'method': 'GET', 'method': 'GET',
params params
}) })
@ -11,7 +11,7 @@ export function sparePartsApplicationPage(params) {
// 领用备件 // 领用备件
export function sparePartsApplicationCreate(data) { export function sparePartsApplicationCreate(data) {
return request({ return request({
url: '/eam/item-apply-main/create', url: '/eam/item-apply-request-main/create',
'method': 'POST', 'method': 'POST',
data data
}) })
@ -19,14 +19,14 @@ export function sparePartsApplicationCreate(data) {
// 撤回领用备件 // 撤回领用备件
export function sparePartsApplicationCancle(id) { export function sparePartsApplicationCancle(id) {
return request({ return request({
url: '/eam/item-apply-main/backout?id=' + id, url: '/eam/item-apply-request-main/backout?id=' + id,
'method': 'GET', 'method': 'GET',
}) })
} }
// 领用备件详情 // 领用备件详情
export function sparePartsApplicationDetail(number) { export function sparePartsApplicationDetail(number) {
return request({ return request({
url: '/eam/item-apply-main/appGetByNumber?number=' + number, url: '/eam/item-apply-request-main/appGetByNumber?number=' + number,
'method': 'GET', 'method': 'GET',
}) })
} }

6
src/api/sparePartsApplicationApprove.js

@ -3,7 +3,7 @@ import request from '@/utils/request'
// 备件领用审批列表 // 备件领用审批列表
export function sparePartsApplicationApprovePage(params) { export function sparePartsApplicationApprovePage(params) {
return request({ return request({
url: '/eam/item-apply-main/getAppApprovePage', url: '/eam/item-apply-request-main/getAppApprovePage',
'method': 'GET', 'method': 'GET',
params params
}) })
@ -11,14 +11,14 @@ export function sparePartsApplicationApprovePage(params) {
// 通过申请 // 通过申请
export function sparePartsApplicationAgree(id) { export function sparePartsApplicationAgree(id) {
return request({ return request({
url: '/eam/item-apply-main/agree?id='+id, url: '/eam/item-apply-request-main/agree?id='+id,
'method': 'GET' 'method': 'GET'
}) })
} }
// 驳回申请 // 驳回申请
export function sparePartsApplicationReject(id) { export function sparePartsApplicationReject(id) {
return request({ return request({
url: '/eam/item-apply-main/disAgree?id='+id, url: '/eam/item-apply-request-main/disAgree?id='+id,
'method': 'GET' 'method': 'GET'
}) })
} }

4
src/api/sparePartsServiceWorkOrderList.js

@ -3,7 +3,7 @@ import request from '@/utils/request'
// 领用备件 // 领用备件
export function sparePartsServiceWorkOrderListCreate(data) { export function sparePartsServiceWorkOrderListCreate(data) {
return request({ return request({
url: '/eam/item-maintenance/create', url: '/eam/item-maintenance-record/create',
'method': 'POST', 'method': 'POST',
data data
}) })
@ -11,7 +11,7 @@ export function sparePartsServiceWorkOrderListCreate(data) {
// 备件维修列表 // 备件维修列表
export function sparePartsServiceWorkOrderListPage(params) { export function sparePartsServiceWorkOrderListPage(params) {
return request({ return request({
url: '/eam/item-maintenance/getAppPage', url: '/eam/item-maintenance-record/getAppPage',
'method': 'GET', 'method': 'GET',
params params
}) })

102
src/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
src/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
src/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
src/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
src/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
src/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
src/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