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. 98
      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
})
}
// 获取厂区列表
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
})
}
// 根据厂区查询设备
export function getDeviceByFactoryAreaNumber(factoryAreaNumber) {
return request({
url: '/eam/device-accounts/selectData?factoryAreaNumber='+factoryAreaNumber,
'method': 'GET'
})
}
// 添加报修
export function deviceRepairCreate(data) {
return request({
url: '/eam/device-repair/create',
url: '/eam/device-repair-request/create',
'method': 'POST',
data
})
@ -19,7 +26,7 @@ export function deviceRepairCreate(data) {
// 报修列表
export function deviceRepairPage(params) {
return request({
url: '/eam/device-repair/getAppPage',
url: '/eam/device-repair-request/getAppPage',
'method': 'GET',
params
})
@ -28,7 +35,7 @@ export function deviceRepairPage(params) {
// 撤销
export function rejected(id) {
return request({
url: '/eam/device-repair/rejected?id='+id,
url: '/eam/device-repair-request/rejected?id='+id,
'method': 'DELETE',
})
}

7
src/api/mold.js

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

8
src/api/sparePartsApplication.js

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

6
src/api/sparePartsApplicationApprove.js

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

4
src/api/sparePartsServiceWorkOrderList.js

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

98
src/pages/deviceReport/addForm.vue

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

2
src/pages/deviceReport/index.vue

@ -9,7 +9,7 @@
</u-navbar>
<!-- <Search @search='search' @screen='screen' :isShowScreen='false'/> -->
<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-txt">
{{item.describes}}

15
src/pages/repairOrder/addForm.vue

@ -5,6 +5,17 @@
<u-form-item label="故障描述" prop="describes" required>
<u-input v-model="form.describes" placeholder="请输入故障描述" :disabled="form&&form.id?true:false" />
</u-form-item>
<u-form-item label="类型" prop="receiverType" required>
<view class="select" @click="openSingleColumn('receiverType',form.receiverType,appDeviceMoldType)">
<view class="input" v-if='form.receiverType'>
{{selectFormat(form.receiverType,appDeviceMoldType)}}
</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>
<view class="select" @click="openSingleColumn('deviceNumber',form.deviceNumber,deviceList)">
<view class="input" v-if='form.deviceNumber'>
@ -65,6 +76,7 @@
data() {
return {
loading: false,
appDeviceMoldType: [],
type: "",
form: {
id: '',
@ -108,6 +120,7 @@
const data = {
id: this.form && this.form.id ? this.form.id : '',
describes: this.form.describes,
receiverType: this.form.receiverType,
deviceNumber: this.form.deviceNumber,
factoryAreaNumber: this.form.factoryAreaNumber,
classes: this.form.classes,
@ -243,6 +256,8 @@
};
await this.getDeviceList()
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')
}
}

6
src/pages/repairOrder/detail.vue

@ -121,11 +121,11 @@
</view>
<view class="footer">
<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>
<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>
<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>
</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'
title="维修工单">
<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>
</u-navbar>
<!-- <Search @search='search' @screen='screen'/> -->

2
src/pages/sparePartsServiceWorkOrderList/addForm.vue

@ -71,7 +71,7 @@
</view>
</u-form-item>
<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>

2
src/pages/spotCheckOrder/addForm.vue

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

Loading…
Cancel
Save