liuchen864 7 months ago
parent
commit
432f7ca029
  1. 5
      .env.development
  2. 4
      .env.production
  3. 8
      aliasPassword.txt
  4. BIN
      apptest.keystore
  5. 18
      src/App.vue
  6. 0
      src/api/dept.ts
  7. 12
      src/api/device.ts
  8. 0
      src/api/dict.ts
  9. 0
      src/api/index.ts
  10. 0
      src/api/location.ts
  11. 0
      src/api/login.ts
  12. 0
      src/api/mold.ts
  13. 39
      src/api/overhaulOrder.js
  14. 93
      src/api/overhaulOrder.ts
  15. 52
      src/api/repairOrder.js
  16. 145
      src/api/repairOrder.ts
  17. 33
      src/api/report.ts
  18. 0
      src/api/spareParts.ts
  19. 0
      src/api/sparePartsApplication.ts
  20. 7
      src/api/sparePartsApplicationApprove.ts
  21. 0
      src/api/sparePartsServiceWorkOrderList.ts
  22. 29
      src/api/spotCheckOrder.js
  23. 65
      src/api/spotCheckOrder.ts
  24. 44
      src/api/upkeepOrder.js
  25. 104
      src/api/upkeepOrder.ts
  26. 0
      src/api/upload.ts
  27. 0
      src/api/user.ts
  28. 2
      src/components/item/slectItemList.vue
  29. 7
      src/main.ts
  30. 2
      src/pages/device/index.vue
  31. 53
      src/pages/deviceReport/addForm.vue
  32. 51
      src/pages/deviceReport/index.vue
  33. 4
      src/pages/deviceReport/myDeviceReport.vue
  34. 210
      src/pages/index.vue
  35. 20
      src/pages/login.vue
  36. 2
      src/pages/mine/changePassword.vue
  37. 2
      src/pages/mold/index.vue
  38. 22
      src/pages/overhaulOrder/addForm.vue
  39. 12
      src/pages/overhaulOrder/addServiceRecord.vue
  40. 161
      src/pages/overhaulOrder/detail.vue
  41. 6
      src/pages/overhaulOrder/index.vue
  42. 2
      src/pages/overhaulOrder/reqairOrderList.vue
  43. 40
      src/pages/repairOrder/addForm.vue
  44. 10
      src/pages/repairOrder/addServiceRecord.vue
  45. 443
      src/pages/repairOrder/detail.vue
  46. 10
      src/pages/repairOrder/index.vue
  47. 4
      src/pages/repairOrder/myOrder.vue
  48. 12
      src/pages/repairOrder/transfer.vue
  49. 2
      src/pages/spareParts/index.vue
  50. 10
      src/pages/sparePartsApplication/addForm.vue
  51. 12
      src/pages/sparePartsApplication/detail.vue
  52. 6
      src/pages/sparePartsApplication/index.vue
  53. 2
      src/pages/sparePartsApplication/mySparePartsApplication.vue
  54. 52
      src/pages/sparePartsApplicationApprove/index.vue
  55. 2
      src/pages/sparePartsApplicationApprove/mySparePartsApplicationApprove.vue
  56. 8
      src/pages/sparePartsServiceWorkOrderList/addForm.vue
  57. 2
      src/pages/sparePartsServiceWorkOrderList/mySparePartsService.vue
  58. 136
      src/pages/spotCheckOrder/addForm.vue
  59. 86
      src/pages/spotCheckOrder/detail.vue
  60. 6
      src/pages/spotCheckOrder/index.vue
  61. 4
      src/pages/spotCheckOrder/myOrder.vue
  62. 12
      src/pages/upkeepOrder/addServiceRecord.vue
  63. 274
      src/pages/upkeepOrder/detail.vue
  64. 4
      src/pages/upkeepOrder/index.vue
  65. 4
      src/pages/upkeepOrder/myOrder.vue
  66. 108
      src/plugins/auth.js
  67. 5
      src/plugins/index.js
  68. BIN
      src/static/images/icon8.png
  69. BIN
      src/static/images/icon9.png
  70. 21
      src/store/modules/countStore.ts

5
.env.development

@ -1,4 +1,5 @@
VITE_BASE_URL=http://192.168.0.106:12080/admin-api VITE_BASE_URL=http://localhost:12080/admin-api
#VITE_BASE_URL=http://dev.ccwin-in.com:25202/api/admin-api #VITE_BASE_URL=http://dev.ccwin-in.com:25202/api/admin-api
VITE_BASE_URL_IMAGE=http://localhost:12080/admin-api VITE_BASE_URL_IMAGE=http://192.168.0.106:12080/admin-api

4
.env.production

@ -1,2 +1,2 @@
VITE_BASE_URL=http://10.62.139.32:81/api/admin-api VITE_BASE_URL=http://dev.ccwin-in.com:25210/admin-api
VITE_BASE_URL_IMAGE=http://10.62.139.32:81/api/admin-api VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25210/admin-api

8
aliasPassword.txt

@ -0,0 +1,8 @@
证书名称:apptest.keystore
证书别名:apptestalias
证书密码:092134
SHA1: 62:A6:01:95:5A:A3:F9:66:95:A7:F7:86:3E:85:37:03:B7:B7:BF:13
SHA256: A4:A7:A9:BF:4A:F6:E2:A8:DD:C2:FF:3D:39:E6:3D:D7:1C:A0:13:8E:41:75:C4:2F:39:14:4B:05:98:AA:33:3A
Android 包名:com.eam.uniapp
Android 应用签名:aa65e187685c2088b82d1a8c143bbabe
ios 包名:com.eam.bundleld

BIN
apptest.keystore

Binary file not shown.

18
src/App.vue

@ -5,6 +5,7 @@
onHide onHide
} from '@dcloudio/uni-app' } from '@dcloudio/uni-app'
import { import {
ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import { import {
@ -15,10 +16,8 @@
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
// store // store
const store = useCountStore() const store = useCountStore()
onLaunch(async () => { onLaunch(async () => {
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
if (uni.canIUse('getUpdateManager')) { if (uni.canIUse('getUpdateManager')) {
@ -67,12 +66,18 @@
}) })
} }
plus.push.addEventListener("click", function (data) { plus.push.addEventListener("click", function (data) {
// 02 // 012
if(data.payload.status == 0 || data.payload.status == 2){ if(data.payload.status == 0 || data.payload.status == 1 || data.payload.status == 2){
uni.navigateTo({ uni.navigateTo({
url: (`/pages/repairOrder/detail?type=${data.payload.type}&number=${data.payload.number}`) url: (`/pages/repairOrder/detail?type=${data.payload.type}&number=${data.payload.number}`)
}) })
} }
// // 1
// if(data.payload.status == 1){
// uni.navigateTo({
// url: (`/pages/repairOrder/detail?type=${data.payload.type}&number=${data.payload.number}`)
// })
// }
}, false); }, false);
uni.getPushClientId({ uni.getPushClientId({
success: (res) => { success: (res) => {
@ -86,7 +91,10 @@
// #endif // #endif
if (getAccessToken()) { if (getAccessToken()) {
await store.GetPermissionInfo().then(res => { await store.GetPermissionInfo().then(res => {
}).catch(() => { }) uni.setStorageSync('permissionInfo',res.permissions)
uni.setStorageSync('roles',res.roles)
}).catch(() => {
})
await store.GetInfo().then(res => { await store.GetInfo().then(res => {
}).catch(() => { }) }).catch(() => { })
} }

0
src/api/dept.js → src/api/dept.ts

12
src/api/device.js → src/api/device.ts

@ -8,18 +8,6 @@ export function getDeviceDetailsByNumber(params) {
export function getDeviceByFactoryAreaNumber(factoryAreaNumber) { export function getDeviceByFactoryAreaNumber(factoryAreaNumber) {
return http.get('/eam/device-accounts/selectData?factoryAreaNumber='+factoryAreaNumber) return http.get('/eam/device-accounts/selectData?factoryAreaNumber='+factoryAreaNumber)
} }
// 添加报修
export function deviceRepairCreate(data) {
return http.post('/eam/device-repair-request/create',data)
}
// 报修列表
export function deviceRepairPage(params) {
return http.get('/eam/device-repair-request/getAppPage',{params})
}
// 撤销
export function rejected(id) {
return http.delete('/eam/device-repair-request/rejected?id='+id)
}
// 设备列表 // 设备列表
export function deviceList(params) { export function deviceList(params) {
return http.get('/eam/device-accounts/selectData',{params}) return http.get('/eam/device-accounts/selectData',{params})

0
src/api/dict.js → src/api/dict.ts

0
src/api/index.js → src/api/index.ts

0
src/api/location.js → src/api/location.ts

0
src/api/login.js → src/api/login.ts

0
src/api/mold.js → src/api/mold.ts

39
src/api/overhaulOrder.js

@ -1,39 +0,0 @@
import http from './http'
// 添加工单
export function overhaulOrderCreate(data) {
return http.post('/eam/device-inspection-job-main/create',data)
}
// 编辑工单
export function overhaulOrderUpdate(data) {
return http.put('/eam/device-inspection-job-main/updat',data)
}
// 报修列表
export function overhaulOrderPage(params) {
return http.get('/eam/device-inspection-job-main/getAppPage',{params})
}
// 操作工单
export function orderClick(params) {
return http.get('/eam/device-inspection-job-main/onClick',{params})
}
export function onVerify(params) {
return http.get('/eam/device-inspection-job-main/onVerify',{params})
}
// 添加维修工单子项维修内容
export function overhaulOrderDetailCreate(data) {
return http.post('/eam/device-inspection-job-detail/create',data)
}
// 编辑维修工单子项维修内容
export function overhaulOrderDetailUpdate(data) {
return http.put('/eam/device-inspection-job-detail/update',data)
}
// 获得维修工单子列表
export function overhaulOrderDetailList(params) {
return http.get('/eam/device-inspection-job-detail/selectListByNumber',{params})
}
// 删除维修工单子
export function overhaulOrderDetailDelete(id) {
return http.delete('/eam/device-inspection-job-detail/delete?id='+id)
}

93
src/api/overhaulOrder.ts

@ -0,0 +1,93 @@
import http from './http'
// 添加工单
export function overhaulOrderCreate(data,type) {
if (type == 'DEVICE') {
return http.post('/eam/device-inspection-job-main/create',data)
} else if (type == 'MOLD') {
return http.post('/eam/mold-inspection-job-main/create',data)
} else if (type == 'TECH') {
return http.post('/eam/tech-inspection-job-main/create',data)
}
}
// 编辑工单
export function overhaulOrderUpdate(data,type) {
if (type == 'DEVICE') {
return http.put('/eam/device-inspection-job-main/updat',data)
} else if (type == 'MOLD') {
return http.put('/eam/mold-inspection-job-main/updat',data)
} else if (type == 'TECH') {
return http.put('/eam/tech-inspection-job-main/updat',data)
}
}
// 报修列表
export function overhaulOrderPage(params,type) {
if (type == 'DEVICE') {
return http.get('/eam/device-inspection-job-main/getAppPage',{params})
} else if (type == 'MOLD') {
return http.get('/eam/mold-inspection-job-main/getAppPage',{params})
} else if (type == 'TECH') {
return http.get('/eam/tech-inspection-job-main/getAppPage',{params})
}
}
// 完成
export function orderClickFinish(params,type) {
if (type == 'DEVICE') {
return http.get('/eam/device-inspection-job-main/orderClickFinish',{params})
} else if (type == 'MOLD') {
return http.get('/eam/mold-inspection-job-main/orderClickFinish',{params})
} else if (type == 'TECH') {
return http.get('/eam/tech-inspection-job-main/orderClickFinish',{params})
}
}
// 验证
export function orderClickVerify(params,type) {
if (type == 'DEVICE') {
return http.get('/eam/device-inspection-job-main/orderClickVerify',{params})
} else if (type == 'MOLD') {
return http.get('/eam/mold-inspection-job-main/orderClickVerify',{params})
} else if (type == 'TECH') {
return http.get('/eam/tech-inspection-job-main/orderClickVerify',{params})
}
}
// 添加维修工单子项维修内容
export function overhaulOrderDetailCreate(data,type) {
if (type == 'DEVICE') {
return http.post('/eam/device-inspection-job-detail/create',data)
} else if (type == 'MOLD') {
return http.post('/eam/mold-inspection-job-detail/create',data)
} else if (type == 'TECH') {
return http.post('/eam/tech-inspection-job-detail/create',data)
}
}
// 编辑维修工单子项维修内容
export function overhaulOrderDetailUpdate(data,type) {
if (type == 'DEVICE') {
return http.put('/eam/device-inspection-job-detail/update',data)
} else if (type == 'MOLD') {
return http.put('/eam/mold-inspection-job-detail/update',data)
} else if (type == 'TECH') {
return http.put('/eam/tech-inspection-job-detail/update',data)
}
}
// 获得维修工单子列表
export function overhaulOrderDetailList(params,type) {
if (type == 'DEVICE') {
return http.get('/eam/device-inspection-job-detail/selectListByNumber',{params})
} else if (type == 'MOLD') {
return http.get('/eam/mold-inspection-job-detail/selectListByNumber',{params})
} else if (type == 'TECH') {
return http.get('/eam/tech-inspection-job-detail/selectListByNumber',{params})
}
}
// 删除维修工单子
export function overhaulOrderDetailDelete(id,type) {
if (type == 'DEVICE') {
return http.delete('/eam/device-inspection-job-detail/delete?id='+id)
} else if (type == 'MOLD') {
return http.delete('/eam/mold-inspection-job-detail/delete?id='+id)
} else if (type == 'TECH') {
return http.delete('/eam/tech-inspection-job-detail/delete?id='+id)
}
}

52
src/api/repairOrder.js

@ -1,52 +0,0 @@
import http from './http'
// 添加工单
export function repairOrderCreate(data) {
return http.post('/eam/device-maintenance-job-main/create',data)
}
// 编辑工单
export function repairOrderUpdate(data) {
return http.put('/eam/device-maintenance-job-main/update',data)
}
// 工单列表
export function repairOrderPage(params) {
return http.get('/eam/device-maintenance-job-main/getAppPage',{params})
}
// 获取维修工单详情信息
export function getDeviceRepairDetail(number) {
return http.get('eam/device-maintenance-job-main/getAppByNumber?number='+number)
}
// 操作工单
export function orderClick(params) {
return http.get('/eam/device-maintenance-job-main/orderClick',{params})
}
// 添加维修工单子项维修内容
export function repairOrderDetailCreate(data) {
return http.post('/eam/device-maintenance-job-detail/create',data)
}
// 编辑维修工单子项维修内容
export function repairOrderDetailUpdate(data) {
return http.put('/eam/device-maintenance-job-detail/update',data)
}
// 获得维修工单子列表
export function repairOrderDetailList(params) {
return http.get('/eam/device-maintenance-job-detail/selectListByNumber',{params})
}
// 删除维修工单子
export function repairOrderDetailDelete(id) {
return http.delete( '/eam/device-maintenance-job-detail/delete?id='+id)
}
//转办
export function transfer(params) {
return http.get('/eam/device-maintenance-job-main/turnTo',{params})
}
// 获取采取临时措施的维修工单
export function repairOrderList(params) {
return http.get('/eam/device-maintenance-job-main/getList',{params})
}
// 获取维修工单的报修信息
export function getDeviceRepairDetailsByNumber(params) {
return http.get('/eam/device-repair-request/getDetailsByNumber',{params})
}

145
src/api/repairOrder.ts

@ -0,0 +1,145 @@
import http from './http'
// 添加工单
export function repairOrderCreate(data,type) {
if (type == 'DEVICE') {
return http.post('/eam/device-maintenance-job-main/create', data)
} else if (type == 'MOLD') {
return http.post('/eam/mold-maintenance-job-main/create', data)
} else if (type == 'TECH') {
return http.post('/eam/tech-maintenance-job-main/create', data)
}
}
// 编辑工单
export function repairOrderUpdate(data,type) {
if (type == 'DEVICE') {
return http.put('/eam/device-maintenance-job-main/update', data)
} else if (type == 'MOLD') {
return http.put('/eam/mold-maintenance-job-main/update', data)
} else if (type == 'TECH') {
return http.put('/eam/tech-maintenance-job-main/update', data)
}
}
// 工单列表
export function repairOrderPage(params,type) {
if (type == 'DEVICE') {
return http.get('/eam/device-maintenance-job-main/getAppPage', {params})
} else if (type == 'MOLD') {
return http.get('/eam/mold-maintenance-job-main/getAppPage', {params})
} else if (type == 'TECH') {
return http.get('/eam/tech-maintenance-job-main/getAppPage', {params})
}
}
// 获取维修工单详情信息
export function getDeviceRepairDetail(number,type) {
if (type == 'DEVICE') {
return http.get('eam/device-maintenance-job-main/getAppByNumber?number=' + number)
} else if (type == 'MOLD') {
return http.get('eam/mold-maintenance-job-main/getAppByNumber?number=' + number)
} else if (type == 'TECH') {
return http.get('eam/tech-maintenance-job-main/getAppByNumber?number=' + number)
}
}
// 接单
export function orderClick(params,type) {
if (type == 'DEVICE') {
return http.get('/eam/device-maintenance-job-main/orderClick', {params})
} else if (type == 'MOLD') {
return http.get('/eam/mold-maintenance-job-main/orderClick', {params})
} else if (type == 'TECH') {
return http.get('/eam/tech-maintenance-job-main/orderClick', {params})
}
}
// 完成
export function orderClickFinish(params,type) {
if (type == 'DEVICE') {
return http.get('/eam/device-maintenance-job-main/orderClickFinish', {params})
} else if (type == 'MOLD') {
return http.get('/eam/mold-maintenance-job-main/orderClickFinish', {params})
} else if (type == 'TECH') {
return http.get('/eam/tech-maintenance-job-main/orderClickFinish', {params})
}
}
// 确认
export function orderClickConfirm(params,type) {
if (type == 'DEVICE') {
return http.get('/eam/device-maintenance-job-main/orderClickConfirm', {params})
} else if (type == 'MOLD') {
return http.get('/eam/mold-maintenance-job-main/orderClickConfirm', {params})
} else if (type == 'TECH') {
return http.get('/eam/tech-maintenance-job-main/orderClickConfirm', {params})
}
}
// 验证
export function orderClickVerify(params,type) {
if (type == 'DEVICE') {
return http.get('/eam/device-maintenance-job-main/orderClickVerify', {params})
} else if (type == 'MOLD') {
return http.get('/eam/mold-maintenance-job-main/orderClickVerify', {params})
} else if (type == 'TECH') {
return http.get('/eam/tech-maintenance-job-main/orderClickVerify', {params})
}
}
// 添加维修工单子项维修内容
export function repairOrderDetailCreate(data,type) {
if (type == 'DEVICE') {
return http.post('/eam/device-maintenance-job-detail/create', data)
} else if (type == 'MOLD') {
return http.post('/eam/mold-maintenance-job-detail/create', data)
} else if (type == 'TECH') {
return http.post('/eam/tech-maintenance-job-detail/create', data)
}
}
// 编辑维修工单子项维修内容
export function repairOrderDetailUpdate(data,type) {
if (type == 'DEVICE') {
return http.put('/eam/device-maintenance-job-detail/update', data)
} else if (type == 'MOLD') {
return http.put('/eam/mold-maintenance-job-detail/update', data)
} else if (type == 'TECH') {
return http.put('/eam/tech-maintenance-job-detail/update', data)
}
}
// 获得维修工单子列表
export function repairOrderDetailList(params,type) {
if (type == 'DEVICE') {
return http.get('/eam/device-maintenance-job-detail/selectListByNumber', {params})
} else if (type == 'MOLD') {
return http.get('/eam/mold-maintenance-job-detail/selectListByNumber', {params})
} else if (type == 'TECH') {
return http.get('/eam/tech-maintenance-job-detail/selectListByNumber', {params})
}
}
// 删除维修工单子
export function repairOrderDetailDelete(id,type) {
if (type == 'DEVICE') {
return http.delete('/eam/device-maintenance-job-detail/delete?id=' + id)
} else if (type == 'MOLD') {
return http.delete('/eam/mold-maintenance-job-detail/delete?id=' + id)
} else if (type == 'TECH') {
return http.delete('/eam/tech-maintenance-job-detail/delete?id=' + id)
}
}
//转办
export function transfer(params,type) {
if (type == 'DEVICE') {
return http.get('/eam/device-maintenance-job-main/turnTo', {params})
} else if (type == 'MOLD') {
return http.get('/eam/mold-maintenance-job-main/turnTo', {params})
} else if (type == 'TECH') {
return http.get('/eam/tech-maintenance-job-main/turnTo', {params})
}
}
// 获取采取临时措施的维修工单
export function repairOrderList(params) {
return http.get('/eam/device-maintenance-job-main/getList', {
params
})
}
// 获取维修工单的报修信息
export function getDeviceRepairDetailsByNumber(params) {
return http.get('/eam/device-repair-request/getDetailsByNumber', {
params
})
}

33
src/api/report.ts

@ -0,0 +1,33 @@
import http from './http'
// 添加报修
export function repairCreate(data,type) {
if(type == 'DEVICE'){
return http.post('/eam/device-repair-request/create',data)
}else if(type == 'MOLD'){
return http.post('/eam/mold-repair-request/create',data)
}else if(type == 'TECH'){
return http.post('/eam/tech-repair-request/create',data)
}
}
// 报修列表
export function repairPage(params,type) {
if(type == 'DEVICE'){
return http.get('/eam/device-repair-request/getAppPage',{params})
}else if(type == 'MOLD'){
return http.get('/eam/mold-repair-request/getAppPage',{params})
}else if(type == 'TECH'){
return http.get('/eam/tech-repair-request/getAppPage',{params})
}
}
// 撤销
export function repairCancel(id,type) {
if(type == 'DEVICE'){
return http.delete('/eam/device-repair-request/cancel?id='+id)
}else if(type == 'MOLD'){
return http.delete('/eam/mold-repair-request/cancel?id='+id)
}else if(type == 'TECH'){
return http.delete('/eam/tech-repair-request/cancel?id='+id)
}
}

0
src/api/spareParts.js → src/api/spareParts.ts

0
src/api/sparePartsApplication.js → src/api/sparePartsApplication.ts

7
src/api/sparePartsApplicationApprove.js → src/api/sparePartsApplicationApprove.ts

@ -1,9 +1,14 @@
import http from './http' import http from './http'
// 备件领用审批列表 // 备件一级审批领用审批列表
export function sparePartsApplicationApprovePage(params) { export function sparePartsApplicationApprovePage(params) {
return http.get('/eam/item-apply-request-main/getAppApprovePage',{params}) return http.get('/eam/item-apply-request-main/getAppApprovePage',{params})
} }
// 备件二级审批领用审批列表
export function sparePartsApplicationApprovePage1(params) {
return http.get('/eam/item-apply-request-main/getAppApprovePage1',{params})
}
// 通过申请 // 通过申请
export function sparePartsApplicationAgree(id) { export function sparePartsApplicationAgree(id) {
return http.get('/eam/item-apply-request-main/agree?id='+id) return http.get('/eam/item-apply-request-main/agree?id='+id)

0
src/api/sparePartsServiceWorkOrderList.js → src/api/sparePartsServiceWorkOrderList.ts

29
src/api/spotCheckOrder.js

@ -1,29 +0,0 @@
import http from './http'
// 添加工单
export function spotCheckOrderCreate(data) {
return http.post('/eam/device-spot-inspection-record-main/create',data)
}
// 编辑工单
export function spotCheckOrderUpdate(data) {
return http.put('/eam/device-spot-inspection-record-main/update',data)
}
// 工单列表
export function spotCheckOrderPage(params) {
return http.get('/eam/device-spot-inspection-record-main/getAppPage',{params})
}
// 操作工单
export function orderClick(params) {
return http.get('/eam/device-spot-inspection-record-main/onClick',{params})
}
// 操作工单
export function selectListByNumber(params) {
return http.get('/eam/device-spot-inspection-record-detail/getList',{params})
}
// 工程师审批
export function orderClickApprove(params) {
return http.get('/eam/device-spot-inspection-record-main/orderClickApprove',{params})
}

65
src/api/spotCheckOrder.ts

@ -0,0 +1,65 @@
import http from './http'
// 添加工单
export function spotCheckOrderCreate(data,type) {
if (type == 'DEVICE') {
return http.post('/eam/device-spot-inspection-record-main/create',data)
} else if (type == 'MOLD') {
return http.post('/eam/mold-spot-inspection-record-main/create',data)
} else if (type == 'TECH') {
return http.post('/eam/tech-spot-inspection-record-main/create',data)
}
}
// 编辑工单
export function spotCheckOrderUpdate(data,type) {
if (type == 'DEVICE') {
return http.put('/eam/device-spot-inspection-record-main/update',data)
} else if (type == 'MOLD') {
return http.put('/eam/mold-spot-inspection-record-main/update',data)
} else if (type == 'TECH') {
return http.put('/eam/tech-spot-inspection-record-main/update',data)
}
}
// 工单列表
export function spotCheckOrderPage(params,type) {
if (type == 'DEVICE') {
return http.get('/eam/device-spot-inspection-record-main/getAppPage',{params})
} else if (type == 'MOLD') {
return http.get('/eam/mold-spot-inspection-record-main/getAppPage',{params})
} else if (type == 'TECH') {
return http.get('/eam/tech-spot-inspection-record-main/getAppPage',{params})
}
}
// 操作工单
export function orderClick(params,type) {
if (type == 'DEVICE') {
return http.get('/eam/device-spot-inspection-record-main/onClick',{params})
} else if (type == 'MOLD') {
return http.get('/eam/mold-spot-inspection-record-main/onClick',{params})
} else if (type == 'TECH') {
return http.get('/eam/tech-spot-inspection-record-main/onClick',{params})
}
}
// 操作工单
export function selectListByNumber(params,type) {
if (type == 'DEVICE') {
return http.get('/eam/device-spot-inspection-record-detail/getList',{params})
} else if (type == 'MOLD') {
return http.get('/eam/mold-spot-inspection-record-detail/getList',{params})
} else if (type == 'TECH') {
return http.get('/eam/tech-spot-inspection-record-detail/getList',{params})
}
}
// 工程师审批
export function orderClickVerify(params,type) {
if (type == 'DEVICE') {
return http.get('/eam/device-spot-inspection-record-main/orderClickVerify',{params})
} else if (type == 'MOLD') {
return http.get('/eam/mold-spot-inspection-record-main/orderClickVerify',{params})
} else if (type == 'TECH') {
return http.get('/eam/tech-spot-inspection-record-main/orderClickVerify',{params})
}
}

44
src/api/upkeepOrder.js

@ -1,44 +0,0 @@
import http from './http'
// 添加工单
export function upkeepOrderCreate(data) {
return http.post('/eam/device-maintain-job-main/create',data)
}
// 编辑工单
export function upkeepOrderUpdate(data) {
return http.put('/eam/device-maintain-job-main/update',data)
}
// 工单列表
export function upkeepOrderPage(params) {
return http.get('/eam/device-maintain-job-main/getAppPage',{params})
}
// 接单
export function orderClick(params) {
return http.get('/eam/device-maintain-job-main/orderClick',{params})
}
export function orderClickVerify(params) {
return http.get('/eam/device-maintain-job-main/orderClickVerify',{params})
}
// 完成保养工单
export function orderClickFinish(params) {
return http.get('/eam/device-maintain-job-main/orderClickFinish',{params})
}
// 添加维修工单子项维修内容
export function upkeepOrderDetailCreate(data) {
return http.post('/eam/device-maintain-job-detail/create',data)
}
// 编辑维修工单子项维修内容
export function upkeepOrderDetailUpdate(data) {
return http.put('/eam/device-maintain-job-detail/update',data)
}
// 获得维修工单子列表
export function upkeepOrderDetailList(params) {
return http.get('/eam/device-maintain-job-detail/selectListByNumber',{params})
}
// 删除维修工单子
export function upkeepOrderDetailDelete(id) {
return http.delete('/eam/device-maintain-job-detail/delete?id='+id)
}

104
src/api/upkeepOrder.ts

@ -0,0 +1,104 @@
import http from './http'
// 添加工单
export function upkeepOrderCreate(data,type) {
if (type == 'DEVICE') {
return http.post('/eam/device-maintain-job-main/create',data)
} else if (type == 'MOLD') {
return http.post('/eam/mold-maintain-job-main/create',data)
} else if (type == 'TECH') {
return http.post('/eam/tech-maintain-job-main/create',data)
}
}
// 编辑工单
export function upkeepOrderUpdate(data,type) {
if (type == 'DEVICE') {
return http.put('/eam/device-maintain-job-main/update',data)
} else if (type == 'MOLD') {
return http.put('/eam/mold-maintain-job-main/update',data)
} else if (type == 'TECH') {
return http.put('/eam/tech-maintain-job-main/update',data)
}
}
// 工单列表
export function upkeepOrderPage(params,type) {
if (type == 'DEVICE') {
return http.get('/eam/device-maintain-job-main/getAppPage',{params})
} else if (type == 'MOLD') {
return http.get('/eam/mold-maintain-job-main/getAppPage',{params})
} else if (type == 'TECH') {
return http.get('/eam/tech-maintain-job-main/getAppPage',{params})
}
}
// 接单
export function orderClick(params,type) {
if (type == 'DEVICE') {
return http.get('/eam/device-maintain-job-main/orderClick',{params})
} else if (type == 'MOLD') {
return http.get('/eam/mold-maintain-job-main/orderClick',{params})
} else if (type == 'TECH') {
return http.get('/eam/tech-maintain-job-main/orderClick',{params})
}
}
export function orderClickVerify(params,type) {
if (type == 'DEVICE') {
return http.get('/eam/device-maintain-job-main/orderClickVerify',{params})
} else if (type == 'MOLD') {
return http.get('/eam/mold-maintain-job-main/orderClickVerify',{params})
} else if (type == 'TECH') {
return http.get('/eam/tech-maintain-job-main/orderClickVerify',{params})
}
}
// 完成保养工单
export function orderClickFinish(params,type) {
if (type == 'DEVICE') {
return http.get('/eam/device-maintain-job-main/orderClickFinish',{params})
} else if (type == 'MOLD') {
return http.get('/eam/mold-maintain-job-main/orderClickFinish',{params})
} else if (type == 'TECH') {
return http.get('/eam/tech-maintain-job-main/orderClickFinish',{params})
}
}
// 添加维修工单子项维修内容
export function upkeepOrderDetailCreate(data,type) {
if (type == 'DEVICE') {
return http.post('/eam/device-maintain-job-detail/create',data)
} else if (type == 'MOLD') {
return http.post('/eam/mold-maintain-job-detail/create',data)
} else if (type == 'TECH') {
return http.post('/eam/tech-maintain-job-detail/create',data)
}
}
// 编辑维修工单子项维修内容
export function upkeepOrderDetailUpdate(data,type) {
if (type == 'DEVICE') {
return http.put('/eam/device-maintain-job-detail/update',data)
} else if (type == 'MOLD') {
return http.put('/eam/mold-maintain-job-detail/update',data)
} else if (type == 'TECH') {
return http.put('/eam/tech-maintain-job-detail/update',data)
}
}
// 获得维修工单子列表
export function upkeepOrderDetailList(params,type) {
if (type == 'DEVICE') {
return http.get('/eam/device-maintain-job-detail/selectListByNumber',{params})
} else if (type == 'MOLD') {
return http.get('/eam/mold-maintain-job-detail/selectListByNumber',{params})
} else if (type == 'TECH') {
return http.get('/eam/tech-maintain-job-detail/selectListByNumber',{params})
}
}
// 删除维修工单子
export function upkeepOrderDetailDelete(id,type) {
if (type == 'DEVICE') {
return http.delete('/eam/device-maintain-job-detail/delete?id='+id)
} else if (type == 'MOLD') {
return http.delete('/eam/mold-maintain-job-detail/delete?id='+id)
} else if (type == 'TECH') {
return http.delete('/eam/tech-maintain-job-detail/delete?id='+id)
}
}

0
src/api/upload.js → src/api/upload.ts

0
src/api/user.js → src/api/user.ts

2
src/components/item/slectItemList.vue

@ -39,7 +39,7 @@
import { import {
onLoad, onLoad,
} from '@dcloudio/uni-app' } from '@dcloudio/uni-app'
import * as repairOrderApi from "@/api/repairOrder.js" import * as repairOrderApi from "@/api/repairOrder"
const props = defineProps({ const props = defineProps({
isShowSelectItem: { isShowSelectItem: {

7
src/main.ts

@ -9,6 +9,10 @@ import App from './App.vue'
import tab from './plugins/tab' import tab from './plugins/tab'
import modal from './plugins/modal' import modal from './plugins/modal'
import time from './plugins/time' import time from './plugins/time'
import auth from './plugins/auth'
// 权限
import { setupAuth } from '@/directives'
// unocss // unocss
@ -30,6 +34,9 @@ export function createApp() {
app.config.globalProperties.$modal = modal app.config.globalProperties.$modal = modal
// 时间对象 // 时间对象
app.config.globalProperties.$time = time app.config.globalProperties.$time = time
app.config.globalProperties.$auth = auth

2
src/pages/device/index.vue

@ -50,7 +50,7 @@
import { import {
getAccessToken getAccessToken
} from '@/utils/auth' } from '@/utils/auth'
import * as deviceApi from "@/api/device.js" import * as deviceApi from "@/api/device"
import Search from '../../components/search/index.vue' import Search from '../../components/search/index.vue'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const params = ref({ const params = ref({

53
src/pages/deviceReport/addForm.vue

@ -16,14 +16,14 @@
<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>
<u-input v-model="form.deviceNumber" :placeholder="`请输入${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码`" <u-input v-model="form.deviceNumber" :placeholder="`请输入${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码`"
@blur="blur()" @confirm='blur()'/> @blur="blur()" @confirm='blur()' />
<view class="right-button" @click="chickRightButton"> <view class="right-button" @click="chickRightButton">
扫描 扫描
</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
class="disabled"> class="disabled">
<u-input v-model="form.deviceName" :placeholder="`根据${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码获得`" <u-input v-model="form.deviceName" :placeholder="`根据${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码获得`"
disabled /> disabled />
@ -31,11 +31,11 @@
<u-form-item :label="`厂区编码`" prop="factoryAreaNumber" required class="disabled"> <u-form-item :label="`厂区编码`" prop="factoryAreaNumber" required class="disabled">
<u-input v-model="form.factoryAreaNumber" <u-input v-model="form.factoryAreaNumber"
:placeholder="`根据${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码获得`" disabled /> :placeholder="`根据${type=='DEVICE'?'设备' :type == 'TECH'?'工艺' : '模具'}编码获得`" disabled />
</u-form-item> </u-form-item>
<u-form-item :label="`厂区名称`" prop="factoryAreaName" required class="disabled"> <u-form-item :label="`厂区名称`" prop="factoryAreaName" required class="disabled">
<u-input v-model="form.factoryAreaName" <u-input v-model="form.factoryAreaName"
:placeholder="`根据${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码获得`" disabled /> :placeholder="`根据${type=='DEVICE'?'设备':type == 'TECH'?'工艺' : '模具'}编码获得`" disabled />
</u-form-item> </u-form-item>
<view class="image" style="margin-top: 20rpx;"> <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'>
@ -70,11 +70,12 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as deviceApi from "@/api/device.js" import * as deviceApi from "@/api/device"
import * as moldApi from "@/api/mold.js" import * as reportApi from "@/api/report"
import * as dictApi from "@/api/dict.js" import * as moldApi from "@/api/mold"
import * as uploadApi from "@/api/upload.js" import * as dictApi from "@/api/dict"
import * as deptApi from "@/api/dept.js" import * as uploadApi from "@/api/upload"
import * as deptApi from "@/api/dept"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const loading = ref(false) const loading = ref(false)
const type = ref('') const type = ref('')
@ -87,7 +88,7 @@
factoryAreaName: '', factoryAreaName: '',
factoryAreaNumber: '', factoryAreaNumber: '',
type: '', type: '',
typeName:'' typeName: ''
}) })
const singleColumnShow = ref(false) const singleColumnShow = ref(false)
const singleColumnDefaultValue = ref([]) const singleColumnDefaultValue = ref([])
@ -136,7 +137,7 @@
deviceApi.getDeviceDetailsByNumber({ deviceApi.getDeviceDetailsByNumber({
number: form.value.deviceNumber, number: form.value.deviceNumber,
type: type.value, type: type.value,
flag:1 flag: 1
}).then((res) => { }).then((res) => {
if (!res.data) { if (!res.data) {
msg.value = res.msg msg.value = res.msg
@ -156,7 +157,7 @@
} else if (type.value == 'MOLD') { } else if (type.value == 'MOLD') {
moldApi.getMoldDetailsByNumber({ moldApi.getMoldDetailsByNumber({
number: form.value.deviceNumber, number: form.value.deviceNumber,
flag:1 flag: 1
}).then((res) => { }).then((res) => {
if (!res.data) { if (!res.data) {
msg.value = res.msg msg.value = res.msg
@ -187,7 +188,7 @@
return; return;
} }
if (!form.value.deviceNumber) { if (!form.value.deviceNumber) {
proxy.$modal.showToast(`请选择${type.value == 'DEVICE' || type.value == 'TECH' ? '设备' : '模具'}`) proxy.$modal.showToast(`请选择${type.value == 'DEVICE' ? '设备' : type == 'TECH' ? '工艺' : '模具'}`)
return; return;
} }
if (!form.value.deviceName) { if (!form.value.deviceName) {
@ -208,7 +209,7 @@
proxy.$modal.confirm('是否添加报修').then(() => { proxy.$modal.confirm('是否添加报修').then(() => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
loading.value = true loading.value = true
deviceApi.deviceRepairCreate(data).then((res) => { reportApi.repairCreate(data, type.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data) { if (res.data) {
proxy.$modal.showToast('添加成功') proxy.$modal.showToast('添加成功')
@ -217,9 +218,9 @@
loading.value = false loading.value = false
}, 1500) }, 1500)
} else { } else {
if(res.msg){ if (res.msg) {
proxy.$modal.showToast(res.msg) proxy.$modal.showToast(res.msg)
}else{ } else {
proxy.$modal.showToast('添加失败') proxy.$modal.showToast('添加失败')
} }
loading.value = false loading.value = false
@ -249,7 +250,7 @@
} }
// //
function chooseSingleColumn(e) { function chooseSingleColumn(e) {
if(form.value[field.value] == e[0].value)return; if (form.value[field.value] == e[0].value) return;
form.value[field.value] = e[0].value form.value[field.value] = e[0].value
if (field.value == 'factoryAreaNumber') { if (field.value == 'factoryAreaNumber') {
form.value.deviceNumber = '' form.value.deviceNumber = ''
@ -258,7 +259,7 @@
} }
if (field.value == 'type') { if (field.value == 'type') {
type.value = form.value[field.value] type.value = form.value[field.value]
form.value.typeName = e[0].label form.value.typeName = e[0].label
form.value.deviceNumber = '' form.value.deviceNumber = ''
form.value.deviceName = '' form.value.deviceName = ''
form.value.factoryAreaName = '' form.value.factoryAreaName = ''
@ -298,15 +299,11 @@
if (option.type) type.value = option.type; if (option.type) type.value = option.type;
appDeviceMoldType.value = await dictApi.getDict('app_device_mold_type') appDeviceMoldType.value = await dictApi.getDict('app_device_mold_type')
if (type.value == 'DEVICE') { if (type.value == 'DEVICE') {
appDeviceMoldType.value = appDeviceMoldType.value.filter((item => item.value != "MOLD")) appDeviceMoldType.value = appDeviceMoldType.value.filter((item => item.value == "DEVICE"))
uni.setNavigationBarTitle({ } else if (type.value == 'MOLD') {
title: '设备报修' appDeviceMoldType.value = appDeviceMoldType.value.filter((item => item.value == "MOLD"))
}) } else if (type.value == 'TECH') {
} else { appDeviceMoldType.value = appDeviceMoldType.value.filter((item => item.value == "TECH"))
uni.setNavigationBarTitle({
title: '模具报修'
})
appDeviceMoldType.value =appDeviceMoldType.value.filter((item => item.value == "MOLD"))
} }
form.value.type = appDeviceMoldType.value[0].value form.value.type = appDeviceMoldType.value[0].value
form.value.typeName = appDeviceMoldType.value[0].label form.value.typeName = appDeviceMoldType.value[0].label

51
src/pages/deviceReport/index.vue

@ -2,9 +2,9 @@
<!-- 设备报修 --> <!-- 设备报修 -->
<view class="container"> <view class="container">
<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="title">
<template v-slot:right> <template v-slot:right>
<u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm"></u-icon> <u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm" v-if="(type=='DEVICE'&&$auth.hasPermi('eam:device-repair-request:createAPP'))||(type=='MOLD'&&$auth.hasPermi('eam:mold-repair-request:createAPP'))||(type=='TECH'&&$auth.hasPermi('eam:tech-repair-request:createAPP'))"></u-icon>
</template> </template>
</u-navbar> </u-navbar>
<view class="list"> <view class="list">
@ -43,8 +43,13 @@
type="primary" shape='circle' /> type="primary" shape='circle' />
</view> </view>
<view class="button"> <view class="button">
<u-button shape="circle" type="primary" size="mini" style="min-width: 120rpx;" <u-button shape="circle" type="primary" size="mini" style="min-width: 120rpx;" @click="cancle(item)"
v-if="item.isCancel == 0" @click="cancle(item)">撤销</u-button> v-if="((type=='DEVICE'&&$auth.hasPermi('eam:device-repair-request:cancelAPP'))
||(type=='MOLD'&&$auth.hasPermi('eam:mold-repair-request:cancelAPP'))
||(type=='TECH'&&$auth.hasPermi('eam:tech-repair-request:cancelAPP')))&&
item.isCancel == 0 &&
item.declarer == store.id"
>撤销</u-button>
</view> </view>
</view> </view>
</view> </view>
@ -66,7 +71,12 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as deviceApi from "@/api/device.js" import * as reportApi from "@/api/report"
import { useCountStore } from '@/store'
// store
const store = useCountStore()
console.log(store.id)
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const params = ref({ const params = ref({
pageNo: 1, pageNo: 1,
@ -77,6 +87,7 @@
const status = ref('loadmore') // const status = ref('loadmore') //
const list = ref([]) const list = ref([])
const type = ref() const type = ref()
const title = ref('')
function addForm() { function addForm() {
proxy.$tab.navigateTo(`/pages/deviceReport/addForm?type=${params.value.type}`) proxy.$tab.navigateTo(`/pages/deviceReport/addForm?type=${params.value.type}`)
@ -85,7 +96,8 @@
if (status.value == 'nomore') return; if (status.value == 'nomore') return;
status.value = 'loading'; status.value = 'loading';
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
await deviceApi.deviceRepairPage(params.value).then((res) => { console.log(type.value)
await reportApi.repairPage(params.value,type.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
list.value = list.value.concat(res.data.list); list.value = list.value.concat(res.data.list);
@ -99,7 +111,7 @@
function cancle(item) { function cancle(item) {
proxy.$modal.confirm('确定撤销报修吗?').then(() => { proxy.$modal.confirm('确定撤销报修吗?').then(() => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
deviceApi.rejected(item.id).then(async (res) => { reportApi.repairCancel(item.id,type.value).then(async (res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
params.value.pageNo = 1 params.value.pageNo = 1
list.value = [] list.value = []
@ -123,19 +135,21 @@
} }
}); });
} }
function hasPermi1(val) {
console.log(proxy.$auth)
}
onLoad((option) => { onLoad((option) => {
if (option.type) params.value.type = option.type; if (option.type) type.value = option.type;
if (type.value == 'DEVICE') { params.value.type = type.value
uni.setNavigationBarTitle({ if (option.type == 'DEVICE') {
title: '设备报修' title.value = '设备报修'
}) } else if (option.type == 'MOLD') {
} else { title.value = '模具报修'
uni.setNavigationBarTitle({ } else if (option.type == 'TECH') {
title: '模具报修' title.value = '工艺报修'
})
} }
}) })
onShow(async() => { onShow(async () => {
params.value.pageNo = 1 params.value.pageNo = 1
list.value = [] list.value = []
status.value = 'loadmore' status.value = 'loadmore'
@ -147,10 +161,11 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.container{ .container {
min-height: 100vh; min-height: 100vh;
background: #f5f5f5; background: #f5f5f5;
} }
.list { .list {
background: #f5f5f5; background: #f5f5f5;
margin-top: 20rpx; margin-top: 20rpx;

4
src/pages/deviceReport/myDeviceReport.vue

@ -59,7 +59,7 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as deviceApi from "@/api/device.js" import * as reportApi from "@/api/report"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const params = ref({ const params = ref({
pageNo: 1, pageNo: 1,
@ -72,7 +72,7 @@
if (status.value == 'nomore') return; if (status.value == 'nomore') return;
status.value = 'loading'; status.value = 'loading';
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
await deviceApi.deviceRepairPage(params.value).then((res) => { await reportApi.repairPage(params.value,'DEVICE').then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
list.value = list.value.concat(res.data.list); list.value = list.value.concat(res.data.list);

210
src/pages/index.vue

@ -31,127 +31,46 @@
<view>待验证</view> <view>待验证</view>
</view> </view>
<view class="status-item"> <view class="status-item">
<view>{{counts1.shenpi || 0}}</view> <view>{{number || 0}}</view>
<view>待审核</view> <view>待审核</view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<view class="box"> <view class="box">
<!-- <view class="" v-if="deviceMenus.length>0"> --> <view class="" v-for="(item,index) in meaus" :key='index'>
<view class=""> <view class="title">{{item.name}}</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" v-for="(cur,key) in item.children" :key='key'>
<view class="icon-item" @click="open('/pages/deviceReport/index?type=DEVICE')" <view class="icon-item" @click="open(cur.path)">
> <!-- 报修图标 -->
<image src="../static/images/icon4.svg" mode=""></image> <image src="../static/images/icon4.svg" mode="" v-if="cur.componentName == 'report'"></image>
<view>设备报修</view> <!-- 报修确认图标 -->
</view> <image src="../static/images/icon8.png" mode="" v-else-if="cur.componentName == 'reportSure'"></image>
</u-col> <!-- 维修工单图标 -->
<u-col span="3"> <image src="../static/images/icon5.svg" mode="" v-else-if="cur.componentName == 'maintenanceOrder'"></image>
<view class="icon-item" @click="open('/pages/repairOrder/index?type=DEVICE&flag=2')" > <!-- 检修工单图标 -->
<image src="../static/images/icon11.svg" mode=""></image> <image src="../static/images/icon3.svg" mode="" v-else-if="cur.componentName == 'inspectionJob'"></image>
<view>报修确认</view> <!-- 保养工单图标 -->
</view> <image src="../static/images/icon1.svg" mode="" v-else-if="cur.componentName == 'upkeepOrder'"></image>
</u-col> <!-- 点检工单图标 -->
<u-col span="3" v-for="(item,index) in store.deviceMenus" :key='index'> <image src="../static/images/icon2.svg" mode="" v-else-if="cur.componentName == 'spotInspectionRecord'"></image>
<view class="icon-item" @click="open('/pages/repairOrder/index?type=DEVICE')" <!-- 备件申领图标 -->
v-if="item.path =='deviceMaintenanceJob'"> <image src="../static/images/icon6.png" mode="" v-else-if="cur.componentName == 'itemRequest'"></image>
<image src="../static/images/icon5.svg" mode=""></image> <!-- 备件申领审核图标 -->
<view>维修工单</view> <image src="../static/images/icon7.png" mode="" v-else-if="cur.componentName == 'itemApprove1'"></image>
</view> <!-- 备件申领审核图标 -->
<view class="icon-item" @click="open('/pages/overhaulOrder/index?type=DEVICE')" <image src="../static/images/icon9.png" mode="" v-else-if="cur.componentName == 'itemApprove2'"></image>
v-if="item.path =='deviceInspectionJob'"> <!-- 备件维修工单图标 -->
<image src="../static/images/icon3.svg" mode=""></image> <image src="../static/images/icon5.svg" mode="" v-else-if="cur.componentName == 'itemMaintenanceRecord'"></image>
<view>检修工单</view> <view>{{cur.name}}</view>
</view>
<view class="icon-item" @click="open('/pages/spotCheckOrder/index?type=DEVICE&flag=0')"
v-if="item.path =='deviceSpotInspectionRecord'">
<image src="../static/images/icon2.svg" mode=""></image>
<view>点检工单</view>
</view>
<view class="icon-item" @click="open('/pages/upkeepOrder/index?type=DEVICE')"
v-if="item.path =='deviceMaintainJob'">
<image src="../static/images/icon1.svg" mode=""></image>
<view>保养工单</view>
</view>
</u-col>
</u-row>
</view>
<!-- <view class="" v-if="moldMenus.length>0"> -->
<view class="">
<view class="title">模具维护</view>
<u-row gutter="16">
<u-col span="3">
<view class="icon-item" @click="open('/pages/deviceReport/index?type=MOLD')"
>
<image src="../static/images/icon4.svg" mode=""></image>
<view>模具报修</view>
</view>
</u-col>
<u-col span="3">
<view class="icon-item" @click="open('/pages/repairOrder/index?type=MOLD&flag=2')" >
<image src="../static/images/icon11.svg" mode=""></image>
<view>报修确认</view>
</view>
</u-col>
<u-col span="3" v-for="(item,index) in moldMenus" :key='index'>
<!-- <view class="icon-item" @click="open('/pages/deviceReport/index?type=MOLD')"
v-if="item.path =='moldRequest'">
<image src="../static/images/icon4.svg" mode=""></image>
<view>模具报修</view>
</view> -->
<view class="icon-item" @click="open('/pages/repairOrder/index?type=MOLD')"
v-if="item.path =='moldMaintenanceJob'">
<image src="../static/images/icon5.svg" mode=""></image>
<view>维修工单</view>
</view>
<view class="icon-item" @click="open('/pages/overhaulOrder/index?type=MOLD')"
v-if="item.path =='moldInspectionJob'">
<image src="../static/images/icon2.svg" mode=""></image>
<view>检修工单</view>
</view>
<view class="icon-item" @click="open('/pages/spotCheckOrder/index?type=MOLD&flag=0')"
v-if="item.path =='moldSpotInspectionRecord'">
<image src="../static/images/icon2.svg" mode=""></image>
<view>点检工单</view>
</view>
<view class="icon-item" @click="open('/pages/upkeepOrder/index?type=MOLD')"
v-if="item.path =='moldMaintainJob'">
<image src="../static/images/icon1.svg" mode=""></image>
<view>保养工单</view>
</view> </view>
</u-col> </u-col>
</u-row> </u-row>
</view> </view>
<view class="" v-if="thchMenus.length>0">
<view class="title">备件管理</view>
<u-row gutter="16">
<u-col span="3" v-for="(item,index) in thchMenus" :key='index'>
<view class="icon-item" @click="open('/pages/sparePartsApplication/index?from=2')"
v-if="item.path =='itemRequest'">
<image src="../static/images/icon6.png" mode=""></image>
<view>领用申请</view>
</view>
<view class="icon-item" @click="open('/pages/sparePartsApplicationApprove/index?from=3')"
v-if="item.path =='itemApprove'">
<image src="../static/images/icon7.png" mode=""></image>
<view>领用申请审批 </view>
</view>
<view class="icon-item"
@click="open('/pages/sparePartsServiceWorkOrderList/addForm?type=DEVICE')"
v-if="item.path =='itemMaintenanceRecord'">
<image src="../static/images/icon5.svg" mode=""></image>
<view>维修工单</view>
</view>
</u-col>
</u-row>
</view>
</view> </view>
</view> </view>
</template> </template>
@ -175,8 +94,10 @@
} from '@/utils/auth' } from '@/utils/auth'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
import * as sparePartsApplicationApproveApi from "@/api/sparePartsApplicationApprove"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
console.log(proxy.$plugins)
// store // store
const store = useCountStore() const store = useCountStore()
@ -192,9 +113,9 @@
yanzheng: '', yanzheng: '',
shenpi: '' shenpi: ''
}) })
const deviceMenus = ref([]) const meaus = ref([])
const moldMenus = ref([]) const isShowItemApprove2 = ref()// true
const thchMenus = ref([]) const isShowItemApprove1 = ref()// true
// //
function getCounts1() { function getCounts1() {
@ -208,21 +129,72 @@
}).catch(() => { }) }).catch(() => { })
} }
function open(url) { function open(url) {
proxy.$tab.navigateTo(url) proxy.$tab.navigateTo("/" + url)
} }
const number1 = ref() //
const number2 = ref()//
const number = ref()//
const params = ref({
pageNo: 1,
pageSize: 10,
type: '',
})
//
async function sparePartsApplicationApprovePage(){
await sparePartsApplicationApproveApi.sparePartsApplicationApprovePage(params.value).then((res) => {
number1.value = res.data.total
}).catch(() => {
proxy.$modal.closeLoading()
})
}
//
async function sparePartsApplicationApprovePage1(){
await sparePartsApplicationApproveApi.sparePartsApplicationApprovePage1(params.value).then((res) => {
number2.value = res.data.total
}).catch(() => {
proxy.$modal.closeLoading()
})
}
onLoad(async()=>{ onLoad(async()=>{
// onLaunchonLoad // APP.vue onLaunchonLoad
await proxy.$onLaunched; await proxy.$onLaunched;
deviceMenus.value = store.deviceMenus if (getAccessToken()) {
moldMenus.value = store.moldMenus meaus.value = store.meaus
thchMenus.value = store.thchMenus let isHave = meaus.value.find (item=>item.path == 'parePartsManagement')
let isHaveIndex = meaus.value.findIndex (item=>item.path == 'parePartsManagement')
if(isHave&&isHave.children){
isShowItemApprove1.value = isHave.children.some(item=>{
return item.componentName == 'itemApprove1'
})
isShowItemApprove2.value = isHave.children.some(item=>{
return item.componentName == 'itemApprove2'
})
await sparePartsApplicationApprovePage()
await sparePartsApplicationApprovePage1()
//
if(isShowItemApprove1.value && !isShowItemApprove2.value){
number.value =number1.value
}
//
if(isShowItemApprove1.value && !isShowItemApprove2.value){
number.value =number2.value
}
//
if(isShowItemApprove1.value && isShowItemApprove2.value){
meaus.value[isHaveIndex].children.splice(1,1)
number.value =number2.value
}
}
}
}) })
onShow(async () => { onShow(async () => {
if (getAccessToken()) { if (getAccessToken()) {
getCounts1() getCounts1()
getToDoCountsByUser1() getToDoCountsByUser1()
} }
}) })
onPageScroll((e) => { onPageScroll((e) => {

20
src/pages/login.vue

@ -48,6 +48,9 @@
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
import { storeToRefs } from 'pinia'
import { useCountStore } from '@/store'
let loginForm = ref({ let loginForm = ref({
tenantName: "闻荫源码", tenantName: "闻荫源码",
username: "", username: "",
@ -58,10 +61,19 @@
uuid: "APP", uuid: "APP",
cid:uni.getStorageSync('cid') cid:uni.getStorageSync('cid')
}) })
console.log(import.meta.env)
import { storeToRefs } from 'pinia' if( import.meta.env.VITE_USER_NODE_ENV == 'development'){
import { useCountStore } from '@/store' loginForm.value = {
tenantName: "闻荫源码",
username: "admin",
password: "123456",
captchaVerification: "",
rememberMe: false,
code: '1',
uuid: "APP",
cid:uni.getStorageSync('cid')
}
}
// store // store
const store = useCountStore() const store = useCountStore()
async function handleLogin(params) { async function handleLogin(params) {

2
src/pages/mine/changePassword.vue

@ -29,7 +29,7 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as userApi from "@/api/user.js" import * as userApi from "@/api/user"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const newPassword = ref('') const newPassword = ref('')
const oldPassword = ref('') const oldPassword = ref('')

2
src/pages/mold/index.vue

@ -51,7 +51,7 @@
import { import {
getAccessToken getAccessToken
} from '@/utils/auth' } from '@/utils/auth'
import * as moldApi from "@/api/mold.js" import * as moldApi from "@/api/mold"
import Search from '../../components/search/index.vue' import Search from '../../components/search/index.vue'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const params = ref({ const params = ref({

22
src/pages/overhaulOrder/addForm.vue

@ -107,12 +107,12 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as overhaulOrderApi from "@/api/overhaulOrder.js" import * as overhaulOrderApi from "@/api/overhaulOrder"
import * as moldApi from "@/api/mold.js" import * as moldApi from "@/api/mold"
import * as dictApi from "@/api/dict.js" import * as dictApi from "@/api/dict"
import * as repairOrderApi from "@/api/repairOrder.js" import * as repairOrderApi from "@/api/repairOrder"
import * as deviceApi from "@/api/device.js" import * as deviceApi from "@/api/device"
import * as deptApi from "@/api/dept.js" import * as deptApi from "@/api/dept"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const loading = ref(false) const loading = ref(false)
@ -142,7 +142,7 @@
// //
const selecUserList = ref([])// const selecUserList = ref([])//
const isShowSelecUser = ref(false) const isShowSelecUser = ref(false)
const chooseUserInfo = ref({}) const chooseUserInfo = ref(null)
function submit() { function submit() {
// //
if (!form.value.describes) { if (!form.value.describes) {
@ -180,7 +180,7 @@
proxy.$modal.confirm('是否修改检修工单').then(() => { proxy.$modal.confirm('是否修改检修工单').then(() => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
loading.value = true loading.value = true
overhaulOrderApi.overhaulOrderUpdate(data).then((res) => { overhaulOrderApi.overhaulOrderUpdate(data,type.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data) { if (res.data) {
proxy.$modal.showToast('修改成功') proxy.$modal.showToast('修改成功')
@ -205,7 +205,7 @@
proxy.$modal.confirm('是否添加检修工单').then(() => { proxy.$modal.confirm('是否添加检修工单').then(() => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
loading.value = true loading.value = true
overhaulOrderApi.overhaulOrderCreate(data).then((res) => { overhaulOrderApi.overhaulOrderCreate(data,type.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data) { if (res.data) {
proxy.$modal.showToast('添加成功') proxy.$modal.showToast('添加成功')
@ -393,6 +393,10 @@
} }
// //
function chooseUser() { function chooseUser() {
if(!chooseUserInfo.value){
proxy.$modal.showToast('请选择人员')
return;
}
form.value[field.value] = chooseUserInfo.value form.value[field.value] = chooseUserInfo.value
isShowSelecUser.value = false isShowSelecUser.value = false
} }

12
src/pages/overhaulOrder/addServiceRecord.vue

@ -148,10 +148,10 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as overhaulOrderApi from "@/api/overhaulOrder.js" import * as overhaulOrderApi from "@/api/overhaulOrder"
import * as sparePartsApi from "@/api/spareParts.js" import * as sparePartsApi from "@/api/spareParts"
import * as deptApi from "@/api/dept.js" import * as deptApi from "@/api/dept"
import * as dictApi from "@/api/dict.js" import * as dictApi from "@/api/dict"
import SelectItemList from "../../components/item/slectItemList.vue" import SelectItemList from "../../components/item/slectItemList.vue"
const { proxy} = getCurrentInstance() const { proxy} = getCurrentInstance()
const loading = ref(false) const loading = ref(false)
@ -275,7 +275,7 @@
proxy.$modal.confirm('是否修改检修内容').then(() => { proxy.$modal.confirm('是否修改检修内容').then(() => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
loading.value = true loading.value = true
overhaulOrderApi.overhaulOrderDetailUpdate(form.value).then((res) => { overhaulOrderApi.overhaulOrderDetailUpdate(form.value,type.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data) { if (res.data) {
proxy.$modal.showToast('修改成功') proxy.$modal.showToast('修改成功')
@ -300,7 +300,7 @@
proxy.$modal.confirm('是否添加检修内容').then(() => { proxy.$modal.confirm('是否添加检修内容').then(() => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
loading.value = true loading.value = true
overhaulOrderApi.overhaulOrderDetailCreate(form.value).then((res) => { overhaulOrderApi.overhaulOrderDetailCreate(form.value,type.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data) { if (res.data) {
proxy.$modal.showToast('添加成功') proxy.$modal.showToast('添加成功')

161
src/pages/overhaulOrder/detail.vue

@ -131,11 +131,12 @@
</view> </view>
<view class="footer"> <view class="footer">
<view class="btns"> <view class="btns">
<u-button type="primary" v-if="data.status == 'PECEIVED'" @click="orderClick(0)" :loading='loading' <u-button type="primary" v-if="data.status == 'PECEIVED'&&((type=='DEVICE'&&$auth.hasPermi('eam:device-inspection-job-main:orderClickFinishAPP'))||(type=='MOLD'&&$auth.hasPermi('eam:mold-inspection-job-main:orderClickFinishAPP'))||(type=='TECH'&&$auth.hasPermi('eam:tech-inspection-job-main:orderClickFinishAPP')))" @click="orderClickFinish" :loading='loading'
:disabled='loading'>完成</u-button> :disabled='loading'>完成</u-button>
</view> </view>
<view class="btns" v-if="(data.status == 'COMPLETED')"> <view class="btns" v-if="(data.status == 'COMPLETED')&&((type=='DEVICE'&&$auth.hasPermi('eam:device-inspection-job-main:orderClickVerifyAPP'))||(type=='MOLD'&&$auth.hasPermi('eam:mold-inspection-job-main:orderClickVerifyAPP'))||(type=='TECH'&&$auth.hasPermi('eam:tech-inspection-job-main:orderClickVerifyAPP')))">
<u-button type="primary" @click="orderClickVerify()" :loading='loading' :disabled='loading'>验证完结</u-button> <u-button type="primary" @click="orderClickVerify()" :loading='loading'
: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>
</view> </view>
@ -143,7 +144,7 @@
<u-popup v-model="isVerifyShowSuccess" mode="center" border-radius="14"> <u-popup v-model="isVerifyShowSuccess" mode="center" border-radius="14">
<view class="popup-title">验证完结意见</view> <view class="popup-title">验证完结意见</view>
<view class="popup"> <view class="popup">
<textarea v-model="data.applyContent" placeholder="请输入内容"></textarea> <textarea v-model="data.applyContent" placeholder="请输入内容"></textarea>
</view> </view>
<view class="popup-footer"> <view class="popup-footer">
<view @click="cancel">取消</view> <view @click="cancel">取消</view>
@ -162,7 +163,7 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as overhaulOrderApi from "@/api/overhaulOrder.js" import * as overhaulOrderApi from "@/api/overhaulOrder"
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
@ -208,72 +209,88 @@
) )
} }
} }
// APP //
function orderClick(type1) { function orderClickFinish() {
const paramseData = { const paramseData = {
// number: data.number,
// status: data.status,
id: data.value.id, id: data.value.id,
verifyContent:data.value.applyContent verifyContent: data.value.applyContent
// requestNumber: ''
} }
if(type1==0){// if (!serviceList.value || serviceList.value && serviceList.value.length == 0) {
if (!serviceList.value || serviceList.value && serviceList.value.length == 0) { proxy.$modal.showToast('请添加检修内容')
proxy.$modal.showToast('请添加检修内容') return;
return; }
}
proxy.$modal.confirm('是否完成?').then(() => {
let tips = '是否完成?' proxy.$modal.loading('加载中')
proxy.$modal.confirm(tips).then(() => { loading.value = true
proxy.$modal.loading('加载中') overhaulOrderApi.orderClickFinish(paramseData,type.value).then((res) => {
loading.value = true if (res.data) {
overhaulOrderApi.orderClick(paramseData).then((res) => { proxy.$modal.showToast('操作成功')
if (res.data) { setTimeout(() => {
proxy.$modal.showToast('操作成功') // proxy.$tab.navigateTo(`/pages/overhaulOrder/index?type=${type.value}`)
setTimeout(() => { proxy.$tab.navigateBack()
// proxy.$tab.navigateTo(`/pages/overhaulOrder/index?type=${type.value}`)
proxy.$tab.navigateBack()
loading.value = false
}, 1500)
} else {
proxy.$modal.showToast('操作失败')
loading.value = false loading.value = false
} }, 1500)
}).catch(() => { } else {
proxy.$modal.closeLoading() proxy.$modal.showToast('操作失败')
loading.value = false loading.value = false
}) }
}).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
}) })
}else if(type1==1){// })
}
/**
* 点击验证完结填写意见
*/
function verify() {
data.value.applyContent = null;
isVerifyShowSuccess.value = true
}
/**
* 验证取消
*/
function cancel() {
data.applyContent = null;
isVerifyShowSuccess.value = false
}
//
function orderClickVerify() {
const paramseData = {
id: data.value.id,
verifyContent: data.value.applyContent
}
let tips = '是否验证完结?' let tips = '是否验证完结?'
proxy.$modal.confirm(tips).then(async () => { proxy.$modal.confirm(tips).then(async () => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
loading.value = true loading.value = true
overhaulOrderApi.onVerify(paramseData).then((res) => { overhaulOrderApi.orderClickVerify(paramseData,type.value).then((res) => {
if (res.data) { if (res.data) {
proxy.$modal.showToast('操作成功') proxy.$modal.showToast('操作成功')
setTimeout(() => { setTimeout(() => {
// proxy.$tab.navigateTo(`/pages/overhaulOrder/index?type=${type.value}`) // proxy.$tab.navigateTo(`/pages/overhaulOrder/index?type=${type.value}`)
proxy.$tab.navigateBack() proxy.$tab.navigateBack()
loading.value = false
}, 1500)
} else {
proxy.$modal.showToast('操作失败')
loading.value = false loading.value = false
} isVerifyShowSuccess.value = false
}).catch(() => { }, 1500)
proxy.$modal.closeLoading() } else {
proxy.$modal.showToast('操作失败')
loading.value = false loading.value = false
}) }
}).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
}) })
} })
} }
// //
function getOverhaulOrderDetailList() { function getOverhaulOrderDetailList() {
overhaulOrderApi.overhaulOrderDetailList({ overhaulOrderApi.overhaulOrderDetailList({
number: data.value.number number: data.value.number
}).then((res) => { }, type.value).then((res) => {
if (res.data) { if (res.data) {
serviceList.value = res.data serviceList.value = res.data
} }
@ -281,40 +298,20 @@
} }
// //
function delService(item) { function delService(item) {
if(data.status == 'PECEIVED'){ if (data.status == 'PECEIVED') {
proxy.$modal.confirm('确定删除维修内容吗?').then(() => { proxy.$modal.confirm('确定删除维修内容吗?').then(() => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
overhaulOrderApi.overhaulOrderDetailDelete(item.id).then((res) => { overhaulOrderApi.overhaulOrderDetailDelete(item.id, type.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
getOverhaulOrderDetailList() getOverhaulOrderDetailList()
}).catch(() => { }) }).catch(() => { })
}) })
} }
}
/**
* 点击验证完结填写意见
*/
function orderClickVerify() {
data.value.applyContent = null;
isVerifyShowSuccess.value = true
}
/**
* 验证取消
*/
function cancel(){
data.applyContent = null;
isVerifyShowSuccess.value = false
}
/**
* 验证确认
*/
function verify() {
isVerifyShowSuccess.value = false
orderClick(1)
} }
onLoad(async (option) => { onLoad(async (option) => {
if (option.type) type.value = option.type; if (option.type) type.value = option.type;
if (option.data) { if (option.data) {

6
src/pages/overhaulOrder/index.vue

@ -5,7 +5,7 @@
title="检修工单"> title="检修工单">
<!-- <template v-slot:right v-if="isEngineer"> --> <!-- <template v-slot:right v-if="isEngineer"> -->
<template v-slot:right> <template v-slot:right>
<u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm"></u-icon> <u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm" v-if="(params.type=='DEVICE'&&$auth.hasPermi('eam:device-inspection-job-main:createAPP'))||(params.type=='MOLD'&&$auth.hasPermi('eam:mold-inspection-job-main:createAPP'))||(params.type=='TECH'&&$auth.hasPermi('eam:tech-inspection-job-main:createAPP'))"></u-icon>
</template> </template>
</u-navbar> </u-navbar>
<!-- <Search @search='search' @screen='screen'/> --> <!-- <Search @search='search' @screen='screen'/> -->
@ -69,7 +69,7 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as overhaulOrderApi from "@/api/overhaulOrder.js" import * as overhaulOrderApi from "@/api/overhaulOrder"
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
const store = useCountStore() const store = useCountStore()
const isEngineer = ref(false) const isEngineer = ref(false)
@ -97,7 +97,7 @@
if (status.value == 'nomore') return; if (status.value == 'nomore') return;
status.value = 'loading'; status.value = 'loading';
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
await overhaulOrderApi.overhaulOrderPage(params.value).then((res) => { await overhaulOrderApi.overhaulOrderPage(params.value,params.value.type).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
list.value = list.value.concat(res.data.list); list.value = list.value.concat(res.data.list);

2
src/pages/overhaulOrder/reqairOrderList.vue

@ -65,7 +65,7 @@
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as repairOrderApi from "@/api/repairOrder.js" import * as repairOrderApi from "@/api/repairOrder"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const repairOrderList = ref([]) const repairOrderList = ref([])

40
src/pages/repairOrder/addForm.vue

@ -90,10 +90,10 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as deviceApi from "@/api/device.js" import * as deviceApi from "@/api/device"
import * as moldApi from "@/api/mold.js" import * as moldApi from "@/api/mold"
import * as dictApi from "@/api/dict.js" import * as dictApi from "@/api/dict"
import * as repairOrderApi from "@/api/repairOrder.js" import * as repairOrderApi from "@/api/repairOrder"
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
@ -225,7 +225,7 @@
proxy.$modal.confirm('是否修改维修工单').then(() => { proxy.$modal.confirm('是否修改维修工单').then(() => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
loading.value = true loading.value = true
repairOrderApi.repairOrderUpdate(data).then((res) => { repairOrderApi.repairOrderUpdate(data,type.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data) { if (res.data) {
proxy.$modal.showToast('修改成功') proxy.$modal.showToast('修改成功')
@ -250,7 +250,7 @@
proxy.$modal.confirm('是否添加维修工单').then(() => { proxy.$modal.confirm('是否添加维修工单').then(() => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
loading.value = true loading.value = true
repairOrderApi.repairOrderCreate(data).then((res) => { repairOrderApi.repairOrderCreate(data,type.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data) { if (res.data) {
proxy.$modal.showToast('添加成功') proxy.$modal.showToast('添加成功')
@ -355,20 +355,22 @@
maintenanceShift.value = await dictApi.getDict('maintenance_shift') maintenanceShift.value = await dictApi.getDict('maintenance_shift')
appDeviceMoldType1.value = await dictApi.getDict('app_device_mold_type') appDeviceMoldType1.value = await dictApi.getDict('app_device_mold_type')
faultType.value = await dictApi.getDict('fault_type') faultType.value = await dictApi.getDict('fault_type')
if (type.value == 'MOLD') { if (type.value == 'DEVICE') {
appDeviceMoldType.value = appDeviceMoldType1.value.filter((item => item.value == "DEVICE"))
}else if (type.value == 'MOLD') {
appDeviceMoldType.value = appDeviceMoldType1.value.filter((item => item.value == "MOLD")) appDeviceMoldType.value = appDeviceMoldType1.value.filter((item => item.value == "MOLD"))
} else { } else if (type.value == 'TECH') {
appDeviceMoldType.value = [] appDeviceMoldType.value = appDeviceMoldType1.value.filter((item => item.value == "TECH"))
console.log(88,store.roles)
if(store.roles.some(item=>item.indexOf('device')>-1)){ // if(store.roles.some(item=>item.indexOf('device')>-1)){
appDeviceMoldType.value = appDeviceMoldType1.value.filter((item => item.value == "DEVICE")) // appDeviceMoldType.value = appDeviceMoldType1.value.filter((item => item.value == "DEVICE"))
} // }
if(store.roles.some(item=>item.indexOf('tech')>-1)){ // if(store.roles.some(item=>item.indexOf('tech')>-1)){
appDeviceMoldType.value = appDeviceMoldType1.value.filter((item => item.value == "TECH")) // appDeviceMoldType.value = appDeviceMoldType1.value.filter((item => item.value == "TECH"))
} // }
if(store.roles.some(item=>item.indexOf('tech')>-1&&item.indexOf('device')>-1)){ // if(store.roles.some(item=>item.indexOf('tech')>-1&&item.indexOf('device')>-1)){
appDeviceMoldType.value = appDeviceMoldType1.value.filter((item => item.value != "MOLD")) // appDeviceMoldType.value = appDeviceMoldType1.value.filter((item => item.value != "MOLD"))
} // }
} }
form.value.type = appDeviceMoldType.value[0].value form.value.type = appDeviceMoldType.value[0].value

10
src/pages/repairOrder/addServiceRecord.vue

@ -138,9 +138,9 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as repairOrderApi from "@/api/repairOrder.js" import * as repairOrderApi from "@/api/repairOrder"
import * as sparePartsApi from "@/api/spareParts.js" import * as sparePartsApi from "@/api/spareParts"
import * as deptApi from "@/api/dept.js" import * as deptApi from "@/api/dept"
import SelectItemList from "../../components/item/slectItemList.vue" import SelectItemList from "../../components/item/slectItemList.vue"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
@ -200,7 +200,7 @@
proxy.$modal.confirm('是否修改维修内容').then(() => { proxy.$modal.confirm('是否修改维修内容').then(() => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
loading.value = true loading.value = true
repairOrderApi.repairOrderDetailUpdate(form.value).then((res) => { repairOrderApi.repairOrderDetailUpdate(form.value,type.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data) { if (res.data) {
proxy.$modal.showToast('修改成功') proxy.$modal.showToast('修改成功')
@ -225,7 +225,7 @@
proxy.$modal.confirm('是否添加维修内容').then(() => { proxy.$modal.confirm('是否添加维修内容').then(() => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
loading.value = true loading.value = true
repairOrderApi.repairOrderDetailCreate(form.value).then((res) => { repairOrderApi.repairOrderDetailCreate(form.value,type.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data) { if (res.data) {
proxy.$modal.showToast('添加成功') proxy.$modal.showToast('添加成功')

443
src/pages/repairOrder/detail.vue

@ -2,14 +2,15 @@
<!-- 详情 --> <!-- 详情 -->
<view class="detail-container"> <view class="detail-container">
<view class="info"> <view class="info">
<view class="title"> <view class="title">
<view>维修工单</view> <view>维修工单</view>
<!-- <view @click="transfer" <!-- <view @click="transfer"
v-if="data.status == 'PECEIVED' && (!serviceList || serviceList && serviceList.length == 0)">转办 v-if="data.status == 'PECEIVED' && (!serviceList || serviceList && serviceList.length == 0)">转办
</view> --> </view> -->
<view @click="transfer" <view @click="transfer"
v-if="data.status == 'PECEIVED'">转办 v-if="data.status == 'PECEIVED'&&((type=='DEVICE'&&$auth.hasPermi('eam:device-maintenance-job-main:turnToAPP'))||(type=='MOLD'&&$auth.hasPermi('eam:mold-maintenance-job-main:turnToAPP'))||(type=='TECH'&&$auth.hasPermi('eam:tech-maintenance-job-main:turnToAPP')))">
转办
</view> </view>
</view> </view>
<view class="dec"> <view class="dec">
@ -97,8 +98,8 @@
<view>{{data.verifyContent}}</view> <view>{{data.verifyContent}}</view>
</view> </view>
</view> </view>
</view> </view>
<div class="line"></div> <div class="line"></div>
<view class="info" style="padding-bottom: 130rpx;"> <view class="info" style="padding-bottom: 130rpx;">
@ -160,12 +161,11 @@
<view class="title-txt"> <view class="title-txt">
{{item.describes}} {{item.describes}}
</view> </view>
<view class="" @click.stop="delService(item)"> <view class="" @click.stop="delService(item)">
<u-icon name="trash" color="#aaaaaa" size="40" <u-icon name="trash" color="#aaaaaa" size="40"
v-if="data.status == 'PECEIVED'" v-if="data.status == 'PECEIVED'"></u-icon>
></u-icon>
</view> </view>
</view> </view>
<view class="dec2"> <view class="dec2">
<view>故障真因</view> <view>故障真因</view>
@ -198,8 +198,7 @@
</view> </view>
<!-- <u-icon name="minus-circle" color="#aaaaaa" size="60" ></u-icon> --> <!-- <u-icon name="minus-circle" color="#aaaaaa" size="60" ></u-icon> -->
</view> </view>
<view class="add-btn" <view class="add-btn" v-if="data.status == 'PENDING' || data.status == 'PECEIVED'">
v-if="data.status == 'PENDING' || data.status == 'PECEIVED'">
<u-button type="primary" @click="addSubForm('creat')"><u-icon name="plus-circle" color="#ffffff" <u-button type="primary" @click="addSubForm('creat')"><u-icon name="plus-circle" color="#ffffff"
size="36"></u-icon>添加维修内容</u-button> size="36"></u-icon>添加维修内容</u-button>
</view> </view>
@ -207,21 +206,26 @@
</view> </view>
</view> </view>
<view class="footer"> <view class="footer">
<view class="btns" v-if="data.status == 'PENDING'"> <view class="btns"
v-if="data.status == 'PENDING'&&((type=='DEVICE'&&$auth.hasPermi('eam:device-maintenance-job-main:orderClickAPP'))||(type=='MOLD'&&$auth.hasPermi('eam:mold-maintenance-job-main:orderClickAPP'))||(type=='TECH'&&$auth.hasPermi('eam:tech-maintenance-job-main:orderClickAPP')))">
<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'"> <view class="btns" v-if="data.status == 'PECEIVED'">
<u-button shape="shape" type="warning" style="min-width: 120rpx;" :loading='loading1' @click="editForm" <u-button shape="shape" type="warning" style="min-width: 120rpx;" :loading='loading1' @click="editForm"
:disabled='loading1'>修改工单</u-button> :disabled='loading1' v-if="(type=='DEVICE'&&$auth.hasPermi('eam:device-maintenance-job-main:updateAPP'))||(type=='MOLD'&&$auth.hasPermi('eam:mold-maintenance-job-main:updateAPP'))||(type=='TECH'&&$auth.hasPermi('eam:tech-maintenance-job-main:updateAPP'))">修改工单</u-button>
<u-button type="primary" @click="orderClickSuccess()" :loading='loading'
:disabled='loading'>完成</u-button> <u-button type="primary" @click="orderClickSuccess()" :loading='loading' :disabled='loading'
v-if="(type=='DEVICE'&&$auth.hasPermi('eam:device-maintenance-job-main:orderClickFinishAPP'))||(type=='MOLD'&&$auth.hasPermi('eam:mold-maintenance-job-main:orderClickFinishAPP'))||(type=='TECH'&&$auth.hasPermi('eam:tech-maintenance-job-main:orderClickFinishAPP'))">完成</u-button>
</view> </view>
<view class="btns" v-if="(data.status == 'COMPLETED' && !data.requestNumber) || (data.status == 'APPLYPASS')"> <view class="btns"
<u-button type="primary" @click="orderClickVerify()" :loading='loading' :disabled='loading'>验证</u-button> v-if="((data.status == 'COMPLETED' && !data.requestNumber) || (data.status == 'APPLYPASS')) && ((type=='DEVICE'&&$auth.hasPermi('eam:device-maintenance-job-main:orderClickVerifyAPP'))||(type=='MOLD'&&$auth.hasPermi('eam:mold-maintenance-job-main:orderClickVerifyAPP'))||(type=='TECH'&&$auth.hasPermi('eam:tech-maintenance-job-main:orderClickVerifyAPP')))">
<u-button type="primary" @click="verify()" :loading='loading' :disabled='loading'>验证</u-button>
</view> </view>
<view class="btns" v-if="data.status == 'COMPLETED' && data.requestNumber && data.applyer == store.id"> <view class="btns"
<u-button type="primary" @click="orderClickApply()" :loading='loading' :disabled='loading'>维修确认</u-button> v-if="(data.status == 'COMPLETED' && data.requestNumber && data.applyer == store.id)&& ((type=='DEVICE'&&$auth.hasPermi('eam:device-maintenance-job-main:orderClickConfirmAPP'))||(type=='MOLD'&&$auth.hasPermi('eam:mold-maintenance-job-main:orderClickConfirmAPP'))||(type=='TECH'&&$auth.hasPermi('eam:tech-maintenance-job-main:orderClickConfirmAPP')))">
<u-button type="primary" @click="orderClickApply()" :loading='loading'
: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>
</view> </view>
@ -237,32 +241,32 @@
</view> </view>
<view class="popup-footer"> <view class="popup-footer">
<view @click="isShowSuccess = false">取消</view> <view @click="isShowSuccess = false">取消</view>
<view class="sure" @click="sure">确认</view> <view class="sure" @click="orderClickFinish">确认</view>
</view> </view>
</u-popup> </u-popup>
<!-- 验证完结--> <!-- 验证完结-->
<u-popup v-model="isVerifyShowSuccess" mode="center" border-radius="14"> <u-popup v-model="isVerifyShowSuccess" mode="center" border-radius="14">
<view class="popup-title">验证完结意见</view> <view class="popup-title">验证完结意见</view>
<view class="popup"> <view class="popup">
<textarea v-model="data.applyContent" placeholder="请输入内容"></textarea> <textarea v-model="data.applyContent" placeholder="请输入内容"></textarea>
</view> </view>
<view class="popup-footer"> <view class="popup-footer">
<view @click="cancel">取消</view> <view @click="cancel">取消</view>
<view class="sure" @click="verify">确认</view> <view class="sure" @click="orderClickVerify">确认</view>
</view> </view>
</u-popup> </u-popup>
<!-- 维修确认弹出层 --> <!-- 维修确认弹出层 -->
<u-popup v-model="isApplyShowSuccess" mode="center" border-radius="14"> <u-popup v-model="isApplyShowSuccess" mode="center" border-radius="14">
<view class="popup-title">维修确认意见</view> <view class="popup-title">维修确认意见</view>
<view class="popup"> <view class="popup">
<textarea v-model="data.applyContent" placeholder="请输入内容"></textarea> <textarea v-model="data.applyContent" placeholder="请输入内容"></textarea>
</view> </view>
<view class="popup-footer"> <view class="popup-footer">
<view class="sure" @click="apply('APPLYPASS')">通过</view> <view class="sure" @click="orderClickConfirm('APPLYPASS')">通过</view>
<view class="reject" @click="apply('APPLYREJECTED')" style="color: red;">驳回</view> <view class="reject" @click="orderClickConfirm('APPLYREJECTED')" style="color: red;">驳回</view>
</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' <u-select v-model="singleColumnShow" mode="single-column" :default-value='singleColumnDefaultValue'
@ -280,8 +284,8 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as dictApi from "@/api/dict.js" import * as dictApi from "@/api/dict"
import * as repairOrderApi from "@/api/repairOrder.js" import * as repairOrderApi from "@/api/repairOrder"
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
@ -376,145 +380,264 @@
/** /**
* 点击验证完结填写意见 * 点击验证完结填写意见
*/ */
function orderClickVerify() { function verify() {
data.value.applyContent = null; data.value.applyContent = null;
isVerifyShowSuccess.value = true isVerifyShowSuccess.value = true
} }
function cancel(){ function cancel() {
data.applyContent = null; data.applyContent = null;
isVerifyShowSuccess.value = false isVerifyShowSuccess.value = false
isApplyShowSuccess.value = false isApplyShowSuccess.value = false
} }
function radioGroupChange(e) { function radioGroupChange(e) {
result.value = e result.value = e
} }
function sure() { //
async function orderClickFinish() {
isShowSuccess.value = false isShowSuccess.value = false
orderClick(2) const dataOne = {
number: data.value.number,
status: data.value.status,
id: data.value.id,
result: result.value,
requestNumber: data.value.requestNumber,
content: data.value.applyContent ? data.value.applyContent : ''
}
//
const dataTwo = {
id: data.value && data.value.id ? data.value.id : '',
describes: data.value.describes,
type: data.value.type,
deviceNumber: data.value.deviceNumber,
factoryAreaNumber: data.value.factoryAreaNumber,
classes: data.value.classes,
faultType: data.value.faultType
}
//
await repairOrderApi.repairOrderUpdate(dataTwo, type.value).then((res) => { }).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
})
proxy.$modal.loading('加载中')
loading.value = true
await repairOrderApi.orderClickFinish(dataOne, type.value).then((res) => {
if (res.data) {
proxy.$modal.showToast('操作成功')
setTimeout(() => {
proxy.$tab.navigateBack()
loading.value = false
}, 1500)
} else {
proxy.$modal.showToast(res.msg)
loading.value = false
}
}).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
})
} }
/** /**
* 维修确认 * 维修确认
*/ */
function apply(status) { async function orderClickConfirm(status) {
isApplyShowSuccess.value = false isApplyShowSuccess.value = false
result.value = status result.value = status
orderClick(3) isShowSuccess.value = false
const dataOne = {
number: data.value.number,
status: data.value.status,
id: data.value.id,
result: result.value ,
requestNumber: data.value.requestNumber,
content: data.value.applyContent ? data.value.applyContent : ''
}
proxy.$modal.loading('加载中')
loading.value = true
await repairOrderApi.orderClickConfirm(dataOne, type.value).then((res) => {
if (res.data) {
proxy.$modal.showToast('操作成功')
setTimeout(() => {
proxy.$tab.navigateBack()
loading.value = false
}, 1500)
} else {
proxy.$modal.showToast(res.msg)
loading.value = false
}
}).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
})
} }
/** /**
* 验证确认 * 验证确认
*/ */
function verify() { async function orderClickVerify() {
isVerifyShowSuccess.value = false isVerifyShowSuccess.value = false
orderClick(2) const dataOne = {
number: data.value.number,
status: data.value.status,
id: data.value.id,
result: result.value,
requestNumber: data.value.requestNumber,
content: data.value.applyContent ? data.value.applyContent : ''
}
proxy.$modal.loading('加载中')
loading.value = true
await repairOrderApi.orderClickVerify(dataOne, type.value).then((res) => {
if (res.data) {
proxy.$modal.showToast('操作成功')
setTimeout(() => {
proxy.$tab.navigateBack()
loading.value = false
}, 1500)
} else {
proxy.$modal.showToast(res.msg)
loading.value = false
}
}).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
})
} }
// APP // APP
async function orderClick(type1) { // async function orderClick(type1) {
// // //
// if (this.data.status == 'PENDING') { // // if (this.data.status == 'PENDING') {
// if (this.$store.state.user.dept.parentId != this.data.factoryAreaNumber) { // // if (this.$store.state.user.dept.parentId != this.data.factoryAreaNumber) {
// this.$modal.showToast('') // // this.$modal.showToast('')
// return; // // return;
// } // // }
// if (this.$store.state.user.dept.classType != this.data.type) { // // if (this.$store.state.user.dept.classType != this.data.type) {
// this.$modal.showToast('') // // this.$modal.showToast('')
// return; // // return;
// } // // }
// } // // }
// const dataOne = {
// number: data.value.number,
// status: data.value.status,
// id: data.value.id,
// result: type1 == 2||type1 == 3 ? result.value : '',
// requestNumber: data.value.requestNumber,
// content:data.value.applyContent ? data.value.applyContent:''
// }
// //
// const dataTwo = {
// id: data.value && data.value.id ? data.value.id : '',
// describes: data.value.describes,
// type: data.value.type,
// deviceNumber: data.value.deviceNumber,
// factoryAreaNumber: data.value.factoryAreaNumber,
// classes: data.value.classes,
// faultType: data.value.faultType
// }
// let tips = data.value.status == 'PENDING' ? '' : data.value.status == 'PECEIVED' ? '' : data.value.status == 'COMPLETED' && data.value.requestNumber && data.value.applyer == store.id ? '' :data.value.status == 'COMPLETED' && !data.value.requestNumber ? '':data.value.status == 'APPLYPASS' ? '':''
// if(type1 == 2 || type1 ==3){
// //
// if (data.value.status == 'PECEIVED') {
// await repairOrderApi.repairOrderUpdate(dataTwo).then((res) => { }).catch(() => {
// proxy.$modal.closeLoading()
// loading.value = false
// })
// }
// proxy.$modal.confirm(tips).then(async () => {
// proxy.$modal.loading('')
// loading.value = true
// await repairOrderApi.orderClick(dataOne).then((res) => {
// if (res.data) {
// proxy.$modal.showToast('')
// setTimeout(() => {
// if(type1==3){
// // proxy.$tab.navigateTo(`/pages/repairOrder/index?type=${type.value}&flag=2`)
// proxy.$tab.navigateBack()
// }else{
// // proxy.$tab.navigateTo(`/pages/repairOrder/index?type=${type.value}`)
// proxy.$tab.navigateBack()
// }
// loading.value = false
// }, 1500)
// } else {
// proxy.$modal.showToast('')
// loading.value = false
// }
// }).catch(() => {
// proxy.$modal.closeLoading()
// loading.value = false
// })
// })
// }else{
// proxy.$modal.confirm(tips).then(async () => {
// proxy.$modal.loading('')
// loading.value = true
// //
// if (data.value.status == 'PECEIVED') {
// await repairOrderApi.repairOrderUpdate(dataTwo).then((res) => { }).catch(() => {
// proxy.$modal.closeLoading()
// loading.value = false
// })
// }
// await repairOrderApi.orderClick(dataOne).then(async(res) => {
// if (res.data) {
// proxy.$modal.showToast('')
// await getDeviceRepairDetail(number.value)
// await getDeviceRepairDetailsByNumber()
// loading.value = false
// // setTimeout(() => {
// // // proxy.$tab.navigateBack()
// // }, 1500)
// } else {
// proxy.$modal.showToast('')
// loading.value = false
// }
// }).catch(() => {
// proxy.$modal.closeLoading()
// loading.value = false
// })
// })
// }
// }
//
async function orderClick() {
const dataOne = { const dataOne = {
number: data.value.number, number: data.value.number,
status: data.value.status, status: data.value.status,
id: data.value.id, id: data.value.id,
result: type1 == 2||type1 == 3 ? result.value : '', result: '',
requestNumber: data.value.requestNumber, requestNumber: data.value.requestNumber,
content:data.value.applyContent ? data.value.applyContent:'' content: data.value.applyContent ? data.value.applyContent : ''
}
//
const dataTwo = {
id: data.value && data.value.id ? data.value.id : '',
describes: data.value.describes,
type: data.value.type,
deviceNumber: data.value.deviceNumber,
factoryAreaNumber: data.value.factoryAreaNumber,
classes: data.value.classes,
faultType: data.value.faultType
} }
let tips = data.value.status == 'PENDING' ? '是否接单?' : data.value.status == 'PECEIVED' ? '是否完成?' : data.value.status == 'COMPLETED' && data.value.requestNumber && data.value.applyer == store.id ? '是否确认提交?' :data.value.status == 'COMPLETED' && !data.value.requestNumber ? '是否验证完结?':data.value.status == 'APPLYPASS' ? '是否验证完结?':'' proxy.$modal.confirm('是否接单').then(async () => {
if(type1 == 2 || type1 ==3){ proxy.$modal.loading('加载中')
// loading.value = true
if (data.value.status == 'PECEIVED') { await repairOrderApi.orderClick(dataOne, type.value).then(async (res) => {
await repairOrderApi.repairOrderUpdate(dataTwo).then((res) => { }).catch(() => { if (res.data) {
proxy.$modal.closeLoading() proxy.$modal.showToast('操作成功')
await getDeviceRepairDetail(number.value)
await getDeviceRepairDetailsByNumber()
loading.value = false loading.value = false
}) } else {
} proxy.$modal.showToast(res.msg)
proxy.$modal.confirm(tips).then(async () => {
proxy.$modal.loading('加载中')
loading.value = true
await repairOrderApi.orderClick(dataOne).then((res) => {
if (res.data) {
proxy.$modal.showToast('操作成功')
setTimeout(() => {
if(type1==3){
// proxy.$tab.navigateTo(`/pages/repairOrder/index?type=${type.value}&flag=2`)
proxy.$tab.navigateBack()
}else{
// proxy.$tab.navigateTo(`/pages/repairOrder/index?type=${type.value}`)
proxy.$tab.navigateBack()
}
loading.value = false
}, 1500)
} else {
proxy.$modal.showToast('操作失败')
loading.value = false
}
}).catch(() => {
proxy.$modal.closeLoading()
loading.value = false loading.value = false
})
})
}else{
proxy.$modal.confirm(tips).then(async () => {
proxy.$modal.loading('加载中')
loading.value = true
//
if (data.value.status == 'PECEIVED') {
await repairOrderApi.repairOrderUpdate(dataTwo).then((res) => { }).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
})
} }
await repairOrderApi.orderClick(dataOne).then(async(res) => { }).catch(() => {
if (res.data) { proxy.$modal.closeLoading()
proxy.$modal.showToast('操作成功') loading.value = false
await getDeviceRepairDetail(number.value)
await getDeviceRepairDetailsByNumber()
loading.value = false
// setTimeout(() => {
// // proxy.$tab.navigateBack()
// }, 1500)
} else {
proxy.$modal.showToast('操作失败')
loading.value = false
}
}).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
})
}) })
} })
} }
// //
async function getDeviceRepairDetailsByNumber() { async function getDeviceRepairDetailsByNumber() {
if(data.value.requestNumber){ if (data.value.requestNumber) {
await repairOrderApi.getDeviceRepairDetailsByNumber({ await repairOrderApi.getDeviceRepairDetailsByNumber({
type: type.value, type: type.value,
requestNumber: data.value.requestNumber requestNumber: data.value.requestNumber
}).then((res) => { }, type.value).then((res) => {
if (res.data) { if (res.data) {
data1.value = res.data data1.value = res.data
} }
@ -524,8 +647,8 @@
// //
function getRepairOrderDetaiList() { function getRepairOrderDetaiList() {
repairOrderApi.repairOrderDetailList({ repairOrderApi.repairOrderDetailList({
number: number.value number: number.value,
}).then((res) => { }, type.value).then((res) => {
if (res.data) { if (res.data) {
serviceList.value = res.data serviceList.value = res.data
} }
@ -593,7 +716,7 @@
proxy.$modal.confirm('是否修改维修工单').then(() => { proxy.$modal.confirm('是否修改维修工单').then(() => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
loading1.value = true loading1.value = true
repairOrderApi.repairOrderUpdate(paramesData).then((res) => { repairOrderApi.repairOrderUpdate(paramesData, type.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data) { if (res.data) {
proxy.$modal.showToast('修改成功') proxy.$modal.showToast('修改成功')
@ -611,12 +734,30 @@
}) })
}) })
} }
async function getDeviceRepairDetail(number){ async function getDeviceRepairDetail(number) {
await repairOrderApi.getDeviceRepairDetail(number).then((res) => { await repairOrderApi.getDeviceRepairDetail(number, type.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
data.value = res.data data.value = res.data
if (res.data) { if (data.value.requestNumber) {
} list.value = [{
name: '设备信息',
value: 1
}, {
name: '报修信息',
value: 2
}, {
name: '维修内容',
value: 3
}]
} else {
list.value = [{
name: '设备信息',
value: 1
}, {
name: '维修内容',
value: 3
}]
}
loading.value = false loading.value = false
}).catch(() => { }).catch(() => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
@ -637,27 +778,7 @@
}) })
onShow(async () => { onShow(async () => {
if (number.value) {
list.value = [{
name: '设备信息',
value: 1
}, {
name: '报修信息',
value: 2
}, {
name: '维修内容',
value: 3
}]
} else {
list.value = [{
name: '设备信息',
value: 1
}, {
name: '维修内容',
value: 3
}]
}
getRepairOrderDetaiList() getRepairOrderDetaiList()
maintenanceShift.value = await dictApi.getDict('maintenance_shift') maintenanceShift.value = await dictApi.getDict('maintenance_shift')
faultType.value = await dictApi.getDict('fault_type') faultType.value = await dictApi.getDict('fault_type')

10
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="params.flag == 2 ? '报修确认' : '维修工单'"> :title="params.flag == 2 ? '报修确认' : '维修工单'">
<template v-slot:right v-if="params.flag!='2'"> <template v-slot:right v-if="params.flag!='2'">
<u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm"></u-icon> <u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm" v-if="(params.type=='DEVICE'&&$auth.hasPermi('eam:device-maintenance-job-main:createAPP'))||(params.type==='MOLD'&&$auth.hasPermi('eam:mold-maintenance-job-main:createAPP'))||(params.type==='TECH'&&$auth.hasPermi('eam:tech-maintenance-job-main:createAPP'))"></u-icon>
</template> </template>
</u-navbar> </u-navbar>
<view class="list"> <view class="list">
@ -29,10 +29,10 @@
类型:<span>{{item.type=='DEVICE'?'设备':item.type=='TECH'?'工艺':'模具'}}</span> 类型:<span>{{item.type=='DEVICE'?'设备':item.type=='TECH'?'工艺':'模具'}}</span>
</view> </view>
<view class="dec"> <view class="dec">
{{`${params.type=='DEVICE'?'设备' : '模具'}`}}编号:<span>{{item.deviceNumber}}</span> {{`${params.type=='DEVICE'?'设备':params.type=='TECH'?'工艺' : '模具'}`}}编号:<span>{{item.deviceNumber}}</span>
</view> </view>
<view class="dec"> <view class="dec">
{{`${params.type=='DEVICE'?'设备' : '模具'}`}}名称:<span>{{item.name}}</span> {{`${params.type=='DEVICE'?'设备':params.type=='TECH'?'工艺' : '模具'}`}}名称:<span>{{item.name}}</span>
</view> </view>
<view class="dec"> <view class="dec">
所属厂区:<span>{{item.factoryAreaName}}</span> 所属厂区:<span>{{item.factoryAreaName}}</span>
@ -69,7 +69,7 @@
getCurrentInstance, getCurrentInstance,
nextTick nextTick
} from 'vue' } from 'vue'
import * as repairOrderApi from "@/api/repairOrder.js" import * as repairOrderApi from "@/api/repairOrder"
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
@ -93,7 +93,7 @@
if (status.value == 'nomore') return; if (status.value == 'nomore') return;
status.value = 'loading'; status.value = 'loading';
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
await repairOrderApi.repairOrderPage(params.value).then((res) => { await repairOrderApi.repairOrderPage(params.value,params.value.type).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
list.value = list.value.concat(res.data.list); list.value = list.value.concat(res.data.list);

4
src/pages/repairOrder/myOrder.vue

@ -78,7 +78,7 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as repairOrderApi from "@/api/repairOrder.js" import * as repairOrderApi from "@/api/repairOrder"
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
@ -95,7 +95,7 @@
if (status.value == 'nomore') return; if (status.value == 'nomore') return;
status.value = 'loading'; status.value = 'loading';
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
await repairOrderApi.repairOrderPage(params.value).then((res) => { await repairOrderApi.repairOrderPage(params.value,'DEVICE').then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
list.value = list.value.concat(res.data.list); list.value = list.value.concat(res.data.list);

12
src/pages/repairOrder/transfer.vue

@ -97,11 +97,11 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as deviceApi from "@/api/device.js" import * as deviceApi from "@/api/device"
import * as moldApi from "@/api/mold.js" import * as moldApi from "@/api/mold"
import * as dictApi from "@/api/dict.js" import * as dictApi from "@/api/dict"
import * as repairOrderApi from "@/api/repairOrder.js" import * as repairOrderApi from "@/api/repairOrder"
import * as deptApi from "@/api/dept.js" import * as deptApi from "@/api/dept"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const loading = ref(false) const loading = ref(false)
@ -174,7 +174,7 @@
proxy.$modal.confirm('是否转办维修工单').then(() => { proxy.$modal.confirm('是否转办维修工单').then(() => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
loading.value = true loading.value = true
repairOrderApi.transfer(paramsData).then((res) => { repairOrderApi.transfer(paramsData,type.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data) { if (res.data) {
proxy.$modal.showToast('转办成功') proxy.$modal.showToast('转办成功')

2
src/pages/spareParts/index.vue

@ -49,7 +49,7 @@
import { import {
getAccessToken getAccessToken
} from '@/utils/auth' } from '@/utils/auth'
import * as sparePartsApi from "@/api/spareParts.js" import * as sparePartsApi from "@/api/spareParts"
import Search from '../../components/search/index.vue' import Search from '../../components/search/index.vue'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const params = ref({ const params = ref({

10
src/pages/sparePartsApplication/addForm.vue

@ -129,11 +129,11 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as sparePartsApplicationApi from "@/api/sparePartsApplication.js" import * as sparePartsApplicationApi from "@/api/sparePartsApplication"
import * as sparePartsApi from "@/api/spareParts.js" import * as sparePartsApi from "@/api/spareParts"
import * as deviceApi from "@/api/device.js" import * as deviceApi from "@/api/device"
import * as dictApi from "@/api/dict.js" import * as dictApi from "@/api/dict"
import * as moldApi from "@/api/mold.js" import * as moldApi from "@/api/mold"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const loading = ref(false) const loading = ref(false)

12
src/pages/sparePartsApplication/detail.vue

@ -36,10 +36,10 @@
</view> </view>
</view> </view>
</view> </view>
<view class="footer" v-if="from == 3"> <view class="footer" v-if="from == 3 || from == 2">
<view class="btns"> <view class="btns">
<button class="reset" @click="reject">驳回</button> <button class="reset" @click="reject" v-if="(from==2&&$auth.hasPermi('eam:item-apply-request-main:role0APP'))||(from==3&&$auth.hasPermi('eam:item-apply-request-main:role1APP'))">驳回</button>
<button class="sure" @click="agree" :loading='loading' :disabled='loading'>通过</button> <button class="sure" @click="agree" :loading='loading' :disabled='loading' v-if="(from==2&&$auth.hasPermi('eam:item-apply-request-main:role0APP'))||(from==3&&$auth.hasPermi('eam:item-apply-request-main:role1APP'))">通过</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>
</view> </view>
@ -56,13 +56,13 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as sparePartsApplicationApi from "@/api/sparePartsApplication.js" import * as sparePartsApplicationApi from "@/api/sparePartsApplication"
import * as sparePartsApplicationApproveApi from "@/api/sparePartsApplicationApprove.js" import * as sparePartsApplicationApproveApi from "@/api/sparePartsApplicationApprove"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const number = ref('') const number = ref('')
const data = ref({}) const data = ref({})
const loading = ref(false) const loading = ref(false)
const from = ref()//13 const from = ref()//123
const type = ref() const type = ref()
function getSparePartsApplicationDetail() { function getSparePartsApplicationDetail() {
sparePartsApplicationApi.sparePartsApplicationDetail(number.value).then((res) => { sparePartsApplicationApi.sparePartsApplicationDetail(number.value).then((res) => {

6
src/pages/sparePartsApplication/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"></u-icon> <u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm" v-if="$auth.hasPermi('eam:item-apply-request-main:createAPP')"></u-icon>
</template> </template>
</u-navbar> </u-navbar>
<!-- <Search @search='search' @screen='screen' /> --> <!-- <Search @search='search' @screen='screen' /> -->
@ -41,7 +41,7 @@
</view> </view>
<view class="button"> <view class="button">
<u-button shape="circle" type="primary" size="mini" style="min-width: 120rpx;" <u-button shape="circle" type="primary" size="mini" style="min-width: 120rpx;"
v-if="item.status==0" @click="cancle(item)">撤回</u-button> v-if="item.status==0&&$auth.hasPermi('eam:item-apply-request-main:cancelAPP')" @click="cancle(item)">撤回</u-button>
</view> </view>
</view> </view>
@ -61,7 +61,7 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as sparePartsApplicationApi from "@/api/sparePartsApplication.js" import * as sparePartsApplicationApi from "@/api/sparePartsApplication"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const params = ref({ const params = ref({
pageNo: 1, pageNo: 1,

2
src/pages/sparePartsApplication/mySparePartsApplication.vue

@ -60,7 +60,7 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as sparePartsApplicationApi from "@/api/sparePartsApplication.js" import * as sparePartsApplicationApi from "@/api/sparePartsApplication"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const params = ref({ const params = ref({
pageNo: 1, pageNo: 1,

52
src/pages/sparePartsApplicationApprove/index.vue

@ -38,9 +38,9 @@
</view> </view>
<view class="button"> <view class="button">
<u-button shape="circle" size="mini" style="min-width: 120rpx;" <u-button shape="circle" size="mini" style="min-width: 120rpx;"
v-if="item.status==0" @click="reject(item)">驳回</u-button> v-if="item.status==0&&((from==2&&$auth.hasPermi('eam:item-apply-request-main:role0APP'))||(from==3&&$auth.hasPermi('eam:item-apply-request-main:role1APP')))" @click="reject(item)">驳回</u-button>
<u-button shape="circle" type="primary" size="mini" style="min-width: 120rpx;margin-left: 20rpx;" <u-button shape="circle" type="primary" size="mini" style="min-width: 120rpx;margin-left: 20rpx;"
v-if="item.status==0" @click="agree(item)">通过</u-button> v-if="item.status==0&&((from==2&&$auth.hasPermi('eam:item-apply-request-main:role0APP'))||(from==3&&$auth.hasPermi('eam:item-apply-request-main:role1APP')))" @click="agree(item)">通过</u-button>
</view> </view>
</view> </view>
@ -60,7 +60,7 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as sparePartsApplicationApproveApi from "@/api/sparePartsApplicationApprove.js" import * as sparePartsApplicationApproveApi from "@/api/sparePartsApplicationApprove"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const params = ref({ const params = ref({
pageNo: 1, pageNo: 1,
@ -69,7 +69,7 @@
}) })
const status = ref('loadmore') // const status = ref('loadmore') //
const list = ref([]) const list = ref([])
const from = ref('') const from = ref('')//123
function openDetail(item, index) { function openDetail(item, index) {
proxy.$tab.navigateTo(`/pages/sparePartsApplication/detail?number=${item.number}&from=${from.value}`) proxy.$tab.navigateTo(`/pages/sparePartsApplication/detail?number=${item.number}&from=${from.value}`)
@ -81,18 +81,34 @@
if (status.value == 'nomore') return; if (status.value == 'nomore') return;
status.value = 'loading'; status.value = 'loading';
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
await sparePartsApplicationApproveApi.sparePartsApplicationApprovePage(params.value).then((res) => { if(from.value == 2){
proxy.$modal.closeLoading() await sparePartsApplicationApproveApi.sparePartsApplicationApprovePage(params.value).then((res) => {
if (res.data.list.length > 0) { proxy.$modal.closeLoading()
list.value = list.value.concat(res.data.list); if (res.data.list.length > 0) {
params.value.pageNo++; list.value = list.value.concat(res.data.list);
status.value = 'loadmore' params.value.pageNo++;
} else { status.value = 'loadmore'
status.value = 'nomore' } else {
} status.value = 'nomore'
}).catch(() => { }
proxy.$modal.closeLoading() }).catch(() => {
}) proxy.$modal.closeLoading()
})
}else if(from.value == 3){
await sparePartsApplicationApproveApi.sparePartsApplicationApprovePage1(params.value).then((res) => {
proxy.$modal.closeLoading()
if (res.data.list.length > 0) {
list.value = list.value.concat(res.data.list);
params.value.pageNo++;
status.value = 'loadmore'
} else {
status.value = 'nomore'
}
}).catch(() => {
proxy.$modal.closeLoading()
})
}
} }
// //
function agree(item) { function agree(item) {
@ -142,6 +158,10 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.container{
background: #f5f5f5;
min-height: 100vh;
}
.list { .list {
background: #f5f5f5; background: #f5f5f5;
margin-top: 20rpx; margin-top: 20rpx;

2
src/pages/sparePartsApplicationApprove/mySparePartsApplicationApprove.vue

@ -60,7 +60,7 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as sparePartsApplicationApproveApi from "@/api/sparePartsApplicationApprove.js" import * as sparePartsApplicationApproveApi from "@/api/sparePartsApplicationApprove"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const params = ref({ const params = ref({

8
src/pages/sparePartsServiceWorkOrderList/addForm.vue

@ -108,10 +108,10 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as sparePartsApi from "@/api/spareParts.js" import * as sparePartsApi from "@/api/spareParts"
import * as sparePartsServiceWorkOrderListApi from "@/api/sparePartsServiceWorkOrderList.js" import * as sparePartsServiceWorkOrderListApi from "@/api/sparePartsServiceWorkOrderList"
import * as dictApi from "@/api/dict.js" import * as dictApi from "@/api/dict"
import * as locationApi from "@/api/location.js" import * as locationApi from "@/api/location"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const loading = ref(false) const loading = ref(false)
const type = ref('') const type = ref('')

2
src/pages/sparePartsServiceWorkOrderList/mySparePartsService.vue

@ -66,7 +66,7 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as sparePartsServiceWorkOrderListApi from "@/api/sparePartsServiceWorkOrderList.js" import * as sparePartsServiceWorkOrderListApi from "@/api/sparePartsServiceWorkOrderList"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const params = ref({ const params = ref({

136
src/pages/spotCheckOrder/addForm.vue

@ -6,8 +6,8 @@
<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="`${type=='DEVICE'?'设备' : '模具'}编码`" prop="deviceNumber" required>
<u-input v-model="form.deviceNumber" <u-input v-model="form.deviceNumber" :placeholder="`请输入${type=='DEVICE'?'设备' : '模具'}编码`" @blur="blur"
:placeholder="`请输入${type=='DEVICE'?'设备' : '模具'}编码`" @blur="blur" @confirm='blur()'/> @confirm='blur()' />
<view class="right-button" @click="chickRightButton"> <view class="right-button" @click="chickRightButton">
扫描 扫描
</view> </view>
@ -50,9 +50,9 @@
<view>{{item.equipmentParts}}</view> <view>{{item.equipmentParts}}</view>
</view> </view>
<view class="dec"> <view class="dec">
<!-- <view style="margin-right: 20rpx;">是否符合:</view><u-switch v-model="item.isConform1"></u-switch> --> <!-- <view style="margin-right: 20rpx;">是否符合:</view><u-switch v-model="item.isConform1"></u-switch> -->
<u-radio-group v-model="item.isConform" @change="radioGroupChange"> <u-radio-group v-model="item.isConform" @change="radioGroupChange">
<!-- <u-radio <!-- <u-radio
@change="radioChange" @change="radioChange"
v-for="(item, index) in list" :key="index" v-for="(item, index) in list" :key="index"
:name="item.name" :name="item.name"
@ -60,12 +60,12 @@
> >
{{item.name}} {{item.name}}
</u-radio> --> </u-radio> -->
<u-radio name="TRUE">符合</u-radio> <u-radio name="TRUE">符合</u-radio>
<u-radio name="FALSE">不符合</u-radio> <u-radio name="FALSE">不符合</u-radio>
</u-radio-group> </u-radio-group>
</view> </view>
<!-- <view class="dec"> <!-- <view class="dec">
<view style="margin-right: 20rpx;">是否符合:</view> <view style="margin-right: 20rpx;">是否符合:</view>
<input type="radio" v-model="item.isConform1" value="true"> <input type="radio" v-model="item.isConform1" value="true">
@ -96,38 +96,38 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as deviceApi from "@/api/device.js" import * as deviceApi from "@/api/device"
import * as moldApi from "@/api/mold.js" import * as moldApi from "@/api/mold"
import * as spotCheckOrderApi from "@/api/spotCheckOrder.js" import * as spotCheckOrderApi from "@/api/spotCheckOrder"
import * as dictApi from "@/api/dict.js" import * as dictApi from "@/api/dict"
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
// store // store
const store = useCountStore() const store = useCountStore()
const loading = ref(false) const loading = ref(false)
const type = ref('') const type = ref('')
const list = ref([{ const list = ref([{
name: 'apple', name: 'apple',
disabled: false disabled: false
}, },
{ {
name: 'banner', name: 'banner',
disabled: false disabled: false
}, },
{ {
name: 'orange', name: 'orange',
disabled: false disabled: false
}]) }])
const form = ref({ const form = ref({
describes: "", describes: "",
deviceNumber: '', deviceNumber: '',
deviceName: '', deviceName: '',
maintenances:'', maintenances: '',
classes: '', classes: '',
classesName:'' classesName: ''
}) })
const singleColumnShow = ref(false) const singleColumnShow = ref(false)
const singleColumnDefaultValue = ref([]) const singleColumnDefaultValue = ref([])
@ -138,7 +138,7 @@
// //
function chickRightButton(field) { function chickRightButton(field) {
uni.scanCode({ uni.scanCode({
success: function(res) { success: function (res) {
form.value.deviceNumber = res.result form.value.deviceNumber = res.result
getDetailsByNumber() getDetailsByNumber()
getSubList() getSubList()
@ -154,27 +154,27 @@
// / // /
function getDetailsByNumber() { function getDetailsByNumber() {
const data = { const data = {
number:form.value.deviceNumber, number: form.value.deviceNumber,
flag:2 flag: 2
} }
if(type.value=='MOLD'){ if (type.value == 'MOLD') {
moldApi.getMoldDetailsByNumber(data).then((res) => { moldApi.getMoldDetailsByNumber(data).then((res) => {
if (res.data) { if (res.data) {
form.value.deviceName = res.data.name form.value.deviceName = res.data.name
} else { } else {
proxy.$modal.showToast(`找不到该${type.value=='DEVICE'?'设备' : '模具'}`) proxy.$modal.showToast(`找不到该${type.value == 'DEVICE' ? '设备' : '模具'}`)
} }
}).catch(()=>{}) }).catch(() => { })
}else{ } else {
deviceApi.getDeviceDetailsByNumber(data).then((res) => { deviceApi.getDeviceDetailsByNumber(data).then((res) => {
if (res.data) { if (res.data) {
form.value.deviceName = res.data.name form.value.deviceName = res.data.name
} else { } else {
proxy.$modal.showToast(`找不到该${type.value=='DEVICE'?'设备' : '模具'}`) proxy.$modal.showToast(`找不到该${type.value == 'DEVICE' ? '设备' : '模具'}`)
} }
}).catch(()=>{}) }).catch(() => { })
} }
} }
// //
function getSubList() { function getSubList() {
@ -184,13 +184,13 @@
deviceApi.getSubList(data).then((res) => { deviceApi.getSubList(data).then((res) => {
if (res.data) { if (res.data) {
subList.value = res.data subList.value = res.data
subList.value.forEach(item=>{ subList.value.forEach(item => {
item.isConform = 'TRUE' item.isConform = 'TRUE'
}) })
} else { } else {
proxy.$modal.showToast(`找不到该${type.value=='DEVICE'?'设备' : '模具'}`) proxy.$modal.showToast(`找不到该${type.value == 'DEVICE' ? '设备' : '模具'}`)
} }
}).catch(()=>{}) }).catch(() => { })
} }
// //
function submit() { function submit() {
@ -200,14 +200,14 @@
return; return;
} }
if (!form.value.deviceNumber) { if (!form.value.deviceNumber) {
proxy.$modal.showToast(`请输入${type.value=='DEVICE'?'设备' : '模具'}编码`) proxy.$modal.showToast(`请输入${type.value == 'DEVICE' ? '设备' : '模具'}编码`)
return; return;
} }
if (!form.value.classes) { if (!form.value.classes) {
proxy.$modal.showToast('请选择班次') proxy.$modal.showToast('请选择班次')
return; return;
} }
if (subList.value.length==0) { if (subList.value.length == 0) {
proxy.$modal.showToast('该设备无检修项目') proxy.$modal.showToast('该设备无检修项目')
return; return;
} }
@ -215,17 +215,17 @@
// item.isConform = !item.isConform1 ? 'FALSE' : 'TRUE' // item.isConform = !item.isConform1 ? 'FALSE' : 'TRUE'
// }) // })
const data = { const data = {
describes:form.value.describes, describes: form.value.describes,
deviceNumber:form.value.deviceNumber, deviceNumber: form.value.deviceNumber,
maintenances: form.value.maintenances, maintenances: form.value.maintenances,
classes:form.value.classes, classes: form.value.classes,
subList:subList.value, subList: subList.value,
type: type.value type: type.value
} }
proxy.$modal.confirm('是否添加点检工单').then(() => { proxy.$modal.confirm('是否添加点检工单').then(() => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
loading.value = true loading.value = true
spotCheckOrderApi.spotCheckOrderCreate(data).then((res) => { spotCheckOrderApi.spotCheckOrderCreate(data, type.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data) { if (res.data) {
proxy.$modal.showToast('添加成功') proxy.$modal.showToast('添加成功')
@ -234,9 +234,9 @@
loading.value = false loading.value = false
}, 1500) }, 1500)
} else { } else {
if(res.msg){ if (res.msg) {
proxy.$modal.showToast(res.msg) proxy.$modal.showToast(res.msg)
}else{ } else {
proxy.$modal.showToast('添加失败') proxy.$modal.showToast('添加失败')
} }
loading.value = false loading.value = false
@ -246,7 +246,7 @@
loading.value = false loading.value = false
}) })
}) })
} }
// //
function reset() { function reset() {
@ -254,7 +254,7 @@
describes: "", describes: "",
deviceNumber: '', deviceNumber: '',
deviceName: '', deviceName: '',
maintenances:'', maintenances: '',
classes: '' classes: ''
} }
} }
@ -273,21 +273,20 @@
// //
function chooseSingleColumn(e) { function chooseSingleColumn(e) {
form.value[field.value] = e[0].value form.value[field.value] = e[0].value
if(field.value == 'classes'){ if (field.value == 'classes') {
form.value.classesName = e[0].label form.value.classesName = e[0].label
} }
singleColumnShow.value = false singleColumnShow.value = false
} }
onLoad(async (option) => { onLoad(async (option) => {
if (option.type) type.value = option.type; if (option.type) type.value = option.type;
maintenanceShift.value = await dictApi.getDict('maintenance_shift') maintenanceShift.value = await dictApi.getDict('maintenance_shift')
form.value.maintenances = uni.getStorageSync('user').nickname form.value.maintenances = uni.getStorageSync('user').nickname
}) })
function radioGroupChange(e) { function radioGroupChange(e) {
console.log(e); console.log(e);
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -307,38 +306,39 @@
.list { .list {
padding: 30rpx 30rpx; padding: 30rpx 30rpx;
.item { .item {
display: flex; display: flex;
margin-bottom: 20rpx; margin-bottom: 20rpx;
.item-box { .item-box {
background: #F5F5F5; background: #F5F5F5;
border-radius: 12rpx; border-radius: 12rpx;
flex: 1; flex: 1;
width: 0rpx; width: 0rpx;
} }
.spare-title { .spare-title {
padding: 20rpx 30rpx; padding: 20rpx 30rpx;
border-bottom: 1px solid #e4e4e4; border-bottom: 1px solid #e4e4e4;
.title-txt { .title-txt {
color: #409eff; color: #409eff;
font-size: 30rpx; font-size: 30rpx;
font-weight: bold; font-weight: bold;
} }
} }
.dec { .dec {
color: #9c9c9c; color: #9c9c9c;
padding: 20rpx 30rpx 20rpx; padding: 20rpx 30rpx 20rpx;
display: flex; display: flex;
align-items: center; align-items: center;
} }
} }
} }
.select { .select {
display: flex; display: flex;

86
src/pages/spotCheckOrder/detail.vue

@ -2,8 +2,8 @@
<!-- 详情 --> <!-- 详情 -->
<view class="detail-container"> <view class="detail-container">
<view class="info"> <view class="info">
<view class="title"> <view class="title">
<view>点检工单</view> <view>点检工单</view>
</view> </view>
<view class="dec"> <view class="dec">
@ -27,7 +27,7 @@
<view>点检时间</view> <view>点检时间</view>
<view>{{$time.formatDate(data.createTime)}}</view> <view>{{$time.formatDate(data.createTime)}}</view>
</view> </view>
</view> </view>
</view> </view>
<div class="line"></div> <div class="line"></div>
@ -59,7 +59,7 @@
<view>{{data.type == 'DEVICE'?'设备':data.type == 'TECH'?'工艺':'模具'}}</view> <view>{{data.type == 'DEVICE'?'设备':data.type == 'TECH'?'工艺':'模具'}}</view>
</view> </view>
</view> </view>
<view class="list" v-if="changeItem.value == 2"> <view class="list" v-if="changeItem.value == 2">
<view class="item " v-for="(item,index) in subList" :key="index"> <view class="item " v-for="(item,index) in subList" :key="index">
<view class="item-box"> <view class="item-box">
@ -80,7 +80,7 @@
是否符合: {{item.isConform=='TRUE'?'符合':'不符合'}} 是否符合: {{item.isConform=='TRUE'?'符合':'不符合'}}
</view> </view>
</view> </view>
<!-- <view class="dec"> <!-- <view class="dec">
<view style="margin-right: 20rpx;">是否符合:</view> <view style="margin-right: 20rpx;">是否符合:</view>
<input type="radio" v-model="item.isConform1" value="true"> <input type="radio" v-model="item.isConform1" value="true">
@ -94,23 +94,25 @@
</view> </view>
</view> </view>
<view class="footer"> <view class="footer">
<view class="btns" v-if="(data.status == 'COMPLETED' || data.status =='APPLYPASS' || 'APPLYREJECTED')"> <view class="btns"
<u-button type="primary" @click="orderClickVerify()" :loading='loading' :disabled='loading'>审核</u-button> v-if="data.status == 'COMPLETED'&& ((type=='DEVICE'&&$auth.hasPermi('eam:device-spot-inspection-record-main:orderClickVerifyAPP'))||(type=='MOLD'&&$auth.hasPermi('eam:mold-spot-inspection-record-main:orderClickVerifyAPP'))||(type=='TECH'&&$auth.hasPermi('eam:tech-spot-inspection-record-main:orderClickVerifyAPP')))">
<u-button type="primary" @click="orderClickVerify()" :loading='loading'
: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>
</view> </view>
<!-- 验证完结--> <!-- 验证完结-->
<u-popup v-model="isVerifyShowSuccess" mode="center" border-radius="14"> <u-popup v-model="isVerifyShowSuccess" mode="center" border-radius="14">
<view class="popup-title">审核意见</view> <view class="popup-title">意见</view>
<view class="popup"> <view class="popup">
<textarea v-model="data.applyContent" placeholder="请输入内容"></textarea> <textarea v-model="data.applyContent" placeholder="请输入内容"></textarea>
</view> </view>
<view class="popup-footer"> <view class="popup-footer">
<view class="sure" @click="apply('APPROVEPASS')">通过</view> <view class="sure" @click="apply('APPROVEPASS')">通过</view>
<view class="reject" @click="apply('APPROVEREJECTED')" style="color: red;">驳回</view> <view class="reject" @click="apply('APPROVEREJECTED')" style="color: red;">驳回</view>
</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' <u-select v-model="singleColumnShow" mode="single-column" :default-value='singleColumnDefaultValue'
:list="singleColumnList" @confirm="chooseSingleColumn"></u-select> :list="singleColumnList" @confirm="chooseSingleColumn"></u-select>
@ -127,10 +129,10 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as dictApi from "@/api/dict.js" import * as dictApi from "@/api/dict"
import * as repairOrderApi from "@/api/repairOrder.js" import * as repairOrderApi from "@/api/repairOrder"
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
import * as spotCheckOrderApi from "@/api/spotCheckOrder.js" import * as spotCheckOrderApi from "@/api/spotCheckOrder"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
// store // store
@ -198,12 +200,12 @@
data.value.applyContent = null; data.value.applyContent = null;
isVerifyShowSuccess.value = true isVerifyShowSuccess.value = true
} }
function cancel(){ function cancel() {
data.applyContent = null; data.applyContent = null;
isVerifyShowSuccess.value = false isVerifyShowSuccess.value = false
isApplyShowSuccess.value = false isApplyShowSuccess.value = false
} }
function radioGroupChange(e) { function radioGroupChange(e) {
result.value = e result.value = e
} }
@ -218,7 +220,7 @@
isVerifyShowSuccess.value = false isVerifyShowSuccess.value = false
orderClick() orderClick()
} }
/** /**
* 审核确认 * 审核确认
*/ */
@ -235,35 +237,33 @@
id: data.value.id, id: data.value.id,
approveOpinion: data.value.applyContent approveOpinion: data.value.applyContent
} }
let tips ='是否确认提交' let tips = '是否确认提交'
proxy.$modal.confirm(tips).then(async () => { proxy.$modal.loading('加载中')
proxy.$modal.loading('加载中') loading.value = true
loading.value = true await spotCheckOrderApi.orderClickVerify(dataOne, type.value).then((res) => {
await spotCheckOrderApi.orderClickApprove(dataOne).then((res) => { if (res.data) {
if (res.data) { proxy.$modal.showToast('操作成功')
proxy.$modal.showToast('操作成功') setTimeout(() => {
setTimeout(() => { proxy.$tab.navigateBack()
proxy.$tab.navigateBack()
loading.value = false
}, 1500)
} else {
proxy.$modal.showToast('操作失败')
loading.value = false loading.value = false
} }, 1500)
}).catch(() => { } else {
proxy.$modal.closeLoading() proxy.$modal.showToast(res.msg)
loading.value = false loading.value = false
}) }
}).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
}) })
} }
async function getDeviceRepairDetail(number){ async function getDeviceRepairDetail(number) {
await repairOrderApi.getDeviceRepairDetail(number).then((res) => { await repairOrderApi.getDeviceRepairDetail(number, type.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
data.value = res.data data.value = res.data
if (res.data) { if (res.data) {
} }
loading.value = false loading.value = false
}).catch(() => { }).catch(() => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
@ -287,9 +287,9 @@
}) })
onShow(async () => { onShow(async () => {
if (number.value) { if (number.value) {
list.value = [{ list.value = [{
name: type.value=='MOLD'?'模具信息':'设备信息', name: type.value == 'MOLD' ? '模具信息' : '设备信息',
value: 1 value: 1
}, { }, {
name: '点检项内容', name: '点检项内容',
@ -297,7 +297,7 @@
}] }]
} else { } else {
list.value = [{ list.value = [{
name: type.value=='MOLD'?'模具信息':'设备信息', name: type.value == 'MOLD' ? '模具信息' : '设备信息',
value: 1 value: 1
}, { }, {
name: '点检项内容', name: '点检项内容',
@ -311,11 +311,11 @@
const data = { const data = {
number: number.value number: number.value
} }
spotCheckOrderApi.selectListByNumber(data).then((res) => { spotCheckOrderApi.selectListByNumber(data, type.value).then((res) => {
if (res.data) { if (res.data) {
subList.value = res.data subList.value = res.data
} }
}).catch(()=>{}) }).catch(() => { })
} }
</script> </script>

6
src/pages/spotCheckOrder/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"></u-icon> <u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm" v-if="(params.type=='DEVICE'&&$auth.hasPermi('eam:device-spot-inspection-record-main:createAPP'))||(params.type=='MOLD'&&$auth.hasPermi('eam:mold-spot-inspection-record-main:createAPP'))||(params.type=='TECH'&&$auth.hasPermi('eam:tech-spot-inspection-record-main:createAPP'))"></u-icon>
</template> </template>
</u-navbar> </u-navbar>
<view class="list"> <view class="list">
@ -70,7 +70,7 @@
getCurrentInstance, getCurrentInstance,
nextTick nextTick
} from 'vue' } from 'vue'
import * as spotCheckOrderApi from "@/api/spotCheckOrder.js" import * as spotCheckOrderApi from "@/api/spotCheckOrder"
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
@ -94,7 +94,7 @@
if (status.value == 'nomore') return; if (status.value == 'nomore') return;
status.value = 'loading'; status.value = 'loading';
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
await spotCheckOrderApi.spotCheckOrderPage(params.value).then((res) => { await spotCheckOrderApi.spotCheckOrderPage(params.value,params.value.type).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
list.value = list.value.concat(res.data.list); list.value = list.value.concat(res.data.list);

4
src/pages/spotCheckOrder/myOrder.vue

@ -63,7 +63,7 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as spotCheckOrderApi from "@/api/spotCheckOrder.js" import * as spotCheckOrderApi from "@/api/spotCheckOrder"
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
@ -80,7 +80,7 @@
if (status.value == 'nomore') return; if (status.value == 'nomore') return;
status.value = 'loading'; status.value = 'loading';
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
await spotCheckOrderApi.spotCheckOrderPage(params.value).then((res) => { await spotCheckOrderApi.spotCheckOrderPage(params.value,'DEVICE').then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
list.value = list.value.concat(res.data.list); list.value = list.value.concat(res.data.list);

12
src/pages/upkeepOrder/addServiceRecord.vue

@ -149,10 +149,10 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as upkeepOrderApi from "@/api/upkeepOrder.js" import * as upkeepOrderApi from "@/api/upkeepOrder"
import * as sparePartsApi from "@/api/spareParts.js" import * as sparePartsApi from "@/api/spareParts"
import * as deptApi from "@/api/dept.js" import * as deptApi from "@/api/dept"
import * as dictApi from "@/api/dict.js" import * as dictApi from "@/api/dict"
import SelectItemList from "../../components/item/slectItemList.vue" import SelectItemList from "../../components/item/slectItemList.vue"
const { proxy} = getCurrentInstance() const { proxy} = getCurrentInstance()
const loading = ref(false) const loading = ref(false)
@ -256,7 +256,7 @@ const form = ref({
proxy.$modal.confirm('是否修改保养内容').then(() => { proxy.$modal.confirm('是否修改保养内容').then(() => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
loading.value = true loading.value = true
upkeepOrderApi.upkeepOrderDetailUpdate(form.value).then((res) => { upkeepOrderApi.upkeepOrderDetailUpdate(form.value,type.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data) { if (res.data) {
proxy.$modal.showToast('修改成功') proxy.$modal.showToast('修改成功')
@ -281,7 +281,7 @@ const form = ref({
proxy.$modal.confirm('是否添加保养内容').then(() => { proxy.$modal.confirm('是否添加保养内容').then(() => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
loading.value = true loading.value = true
upkeepOrderApi.upkeepOrderDetailCreate(form.value).then((res) => { upkeepOrderApi.upkeepOrderDetailCreate(form.value,type.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data) { if (res.data) {
proxy.$modal.showToast('添加成功') proxy.$modal.showToast('添加成功')

274
src/pages/upkeepOrder/detail.vue

@ -42,7 +42,7 @@
</view> </view>
<div class="line"></div> <div class="line"></div>
<view class="info" style="padding-bottom: 130rpx;"> <view class="info" style="padding-bottom: 130rpx;">
<view class="tab"> <view class="tab">
<u-tabs :list="list" :is-scroll="false" bar-height="2" bar-width="250" v-model="current" <u-tabs :list="list" :is-scroll="false" bar-height="2" bar-width="250" v-model="current"
@change="change"></u-tabs> @change="change"></u-tabs>
</view> </view>
@ -101,9 +101,11 @@
<view>责任人</view> <view>责任人</view>
<view>{{item.chargePeoplesName}}</view> <view>{{item.chargePeoplesName}}</view>
</view> </view>
<view class="dec2" > <view class="dec2">
<view>完成情况</view> <view>完成情况</view>
<view>{{item.status===0 || item.status === '0'? '完成':item.status===1 ||item.status === '1'?'未完成':''}}</view> <view>
{{item.status===0 || item.status === '0'? '完成':item.status===1 ||item.status === '1'?'未完成':''}}
</view>
</view> </view>
<view class="dec2" v-if='item.status === 0 || item.status === "0"'> <view class="dec2" v-if='item.status === 0 || item.status === "0"'>
<view>完成时间</view> <view>完成时间</view>
@ -139,25 +141,28 @@
</view> </view>
<view class="footer"> <view class="footer">
<view class="btns"> <view class="btns">
<u-button type="primary" v-if="data.status == 'PENDING'" @click="orderClick(1)" :loading='loading' <u-button type="primary"
:disabled='loading'>接单</u-button> v-if="data.status == 'PENDING' && ((type=='DEVICE'&&$auth.hasPermi('eam:device-maintain-job-main:orderClickAPP'))||(type=='MOLD'&&$auth.hasPermi('eam:mold-maintain-job-main:orderClickAPP'))||(type=='TECH'&&$auth.hasPermi('eam:tech-maintain-job-main:orderClickAPP')))"
<u-button type="primary" v-if="data.status == 'PECEIVED'" @click="orderClick(2)" :loading='loading' @click="orderClick()" :loading='loading' :disabled='loading'>接单</u-button>
:disabled='loading'>完成</u-button> <u-button type="primary"
<u-button type="primary" v-if="data.status == 'COMPLETED'" @click="orderClickVerify()" :loading='loading' v-if="data.status == 'PECEIVED' && ((type=='DEVICE'&&$auth.hasPermi('eam:device-maintain-job-main:orderClickFinishAPP'))||(type=='MOLD'&&$auth.hasPermi('eam:mold-maintain-job-main:orderClickFinishAPP'))||(type=='TECH'&&$auth.hasPermi('eam:tech-maintain-job-main:orderClickFinishAPP')))"
:disabled='loading'>验证</u-button> @click="orderClickFinish()" :loading='loading' :disabled='loading'>完成</u-button>
<u-button type="primary"
v-if="data.status == 'COMPLETED' && ((type=='DEVICE'&&$auth.hasPermi('eam:device-maintain-job-main:orderClickVerifyAPP'))||(type=='MOLD'&&$auth.hasPermi('eam:mold-maintain-job-main:orderClickVerifyAPP'))||(type=='TECH'&&$auth.hasPermi('eam:tech-maintain-job-main:orderClickVerifyAPP')))"
@click="verify()" :loading='loading' :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>
</view> </view>
<!-- 验证完结--> <!-- 验证完结-->
<u-popup v-model="isVerifyShowSuccess" mode="center" border-radius="14"> <u-popup v-model="isVerifyShowSuccess" mode="center" border-radius="14">
<view class="popup-title">验证完结意见</view> <view class="popup-title">验证完结意见</view>
<view class="popup"> <view class="popup">
<textarea v-model="data.applyContent" placeholder="请输入内容"></textarea> <textarea v-model="data.applyContent" placeholder="请输入内容"></textarea>
</view> </view>
<view class="popup-footer"> <view class="popup-footer">
<view @click="cancel">取消</view> <view @click="cancel">取消</view>
<view class="sure" @click="verify">确认</view> <view class="sure" @click="orderClickVerify">确认</view>
</view> </view>
</u-popup> </u-popup>
</view> </view>
@ -172,9 +177,9 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as moldApi from "@/api/mold.js" import * as moldApi from "@/api/mold"
import * as upkeepOrderApi from "@/api/upkeepOrder.js" import * as upkeepOrderApi from "@/api/upkeepOrder"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const list = ref([{ const list = ref([{
name: '设备信息' name: '设备信息'
}, { }, {
@ -197,7 +202,7 @@
} }
// //
function addSubForm(clickType, item) { function addSubForm(clickType, item) {
if(data.value.status == 'COMPLETED'){// if (data.value.status == 'COMPLETED') {//
return return
} }
if (data.value.status == 'PENDING') { if (data.value.status == 'PENDING') {
@ -215,140 +220,155 @@
} }
} }
function orderClick(type1) { function orderClick(type1) {
if(!serviceList.value || serviceList.value&&serviceList.value.length == 0){ if (!serviceList.value || serviceList.value && serviceList.value.length == 0) {
proxy.$modal.showToast('没有保养内容') proxy.$modal.showToast('没有保养内容')
return; return;
}
const paramsData = {
id: data.value.id,
verifyContent: data.value.applyContent
}
proxy.$modal.confirm('是否接单?').then(() => {
proxy.$modal.loading('加载中')
loading.value = true
upkeepOrderApi.orderClick(paramsData,type.value).then((res) => {
if (res.data) {
proxy.$modal.showToast('操作成功')
setTimeout(() => {
proxy.$tab.navigateBack()
loading.value = false
}, 1500)
} else {
proxy.$modal.showToast(res.msg)
loading.value = false
} }
let tips = data.value.status == 'PENDING' ? '是否接单?' : data.value.status == 'PECEIVED' ? '是否完成?' : data.value.status == 'COMPLETED' ? '是否验证完结?' :'' }).catch(() => {
// if(type == 2){ proxy.$modal.closeLoading()
// isTrue.value = serviceList.value.some(item=>item.items.length == 0) loading.value = false
// if(isTrue.value){ })
// proxy.$modal.showToast('') })
// return; }
// } //
// } function orderClickFinish() {
if (!serviceList.value || serviceList.value && serviceList.value.length == 0) {
const paramsData = { proxy.$modal.showToast('没有保养内容')
id: data.value.id, return;
verifyContent: data.value.applyContent }
const paramsData = {
id: data.value.id,
verifyContent: data.value.applyContent
}
proxy.$modal.confirm('是否验证完结?').then(() => {
proxy.$modal.loading('加载中')
loading.value = true
upkeepOrderApi.orderClickFinish(paramsData,type.value).then((res) => {
if (res.data) {
proxy.$modal.showToast('操作成功')
setTimeout(() => {
proxy.$tab.navigateBack()
loading.value = false
}, 1500)
} else {
proxy.$modal.showToast(res.msg)
loading.value = false
} }
proxy.$modal.confirm(tips).then(() => { }).catch(() => {
proxy.$modal.loading('加载中') proxy.$modal.closeLoading()
loading.value = true loading.value = false
if(type1 == 1){ })
upkeepOrderApi.orderClick(paramsData).then((res) => { })
if (res.data) { }
proxy.$modal.showToast('操作成功') //
setTimeout(() => { function orderClickVerify() {
proxy.$tab.navigateBack() if (!serviceList.value || serviceList.value && serviceList.value.length == 0) {
loading.value = false proxy.$modal.showToast('没有保养内容')
}, 1500) return;
} else { }
proxy.$modal.showToast('操作失败') const paramsData = {
loading.value = false id: data.value.id,
} verifyContent: data.value.applyContent
}).catch(() => { }
proxy.$modal.closeLoading() isVerifyShowSuccess.value = false
loading.value = false proxy.$modal.confirm('是否完成?').then(() => {
}) proxy.$modal.loading('加载中')
}else if(type1 == 2){ loading.value = true
upkeepOrderApi.orderClickFinish(paramsData).then((res) => { upkeepOrderApi.orderClickVerify(paramsData,type.value).then((res) => {
if (res.data) { if (res.data) {
proxy.$modal.showToast('操作成功') proxy.$modal.showToast('操作成功')
setTimeout(() => {
proxy.$tab.navigateBack() setTimeout(() => {
loading.value = false // proxy.$tab.navigateTo(`/pages/upkeepOrder/index?type=${type.value}`)
}, 1500) proxy.$tab.navigateBack()
} else { loading.value = false
proxy.$modal.showToast('操作失败') }, 1500)
loading.value = false } else {
} proxy.$modal.showToast(res.msg)
}).catch(() => { loading.value = false
proxy.$modal.closeLoading()
loading.value = false
})
}else if(type1==3){//
upkeepOrderApi.orderClickVerify(paramsData).then((res) => {
if (res.data) {
proxy.$modal.showToast('操作成功')
setTimeout(() => {
// proxy.$tab.navigateTo(`/pages/upkeepOrder/index?type=${type.value}`)
proxy.$tab.navigateBack()
loading.value = false
}, 1500)
} else {
proxy.$modal.showToast('操作失败')
loading.value = false
}
}).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
})
}
})
}
//
function getUpkeepOrderDetailList() {
upkeepOrderApi.upkeepOrderDetailList({
number: data.value.number
}).then((res) => {
if (res.data) {
serviceList.value = res.data
}
}).catch(() => { })
}
//
function delService(item) {
proxy.$modal.confirm('确定删除维修内容吗?').then(() => {
proxy.$modal.loading('加载中')
upkeepOrderApi.upkeepOrderDetailDelete(item.id).then((res) => {
proxy.$modal.closeLoading()
getUpkeepOrderDetailList()
}).catch(() => { })
})
}
onLoad(async (option) => {
if (option.type) type.value = option.type;
if (option.data) {
data.value = JSON.parse(decodeURIComponent(option.data))
} }
changeItem.value = list.value[current.value] }).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
}) })
onShow(() => { })
}
//
function getUpkeepOrderDetailList() {
upkeepOrderApi.upkeepOrderDetailList({
number: data.value.number
},type.value).then((res) => {
if (res.data) {
serviceList.value = res.data
}
}).catch(() => { })
}
//
function delService(item) {
proxy.$modal.confirm('确定删除维修内容吗?').then(() => {
proxy.$modal.loading('加载中')
upkeepOrderApi.upkeepOrderDetailDelete(item.id,type.value).then((res) => {
proxy.$modal.closeLoading()
getUpkeepOrderDetailList() getUpkeepOrderDetailList()
}) }).catch(() => { })
})
}
onLoad(async (option) => {
if (option.type) type.value = option.type;
if (option.data) {
data.value = JSON.parse(decodeURIComponent(option.data))
}
changeItem.value = list.value[current.value]
})
onShow(() => {
getUpkeepOrderDetailList()
})
/** /**
* 点击验证完结填写意见 * 点击验证完结填写意见
*/ */
function orderClickVerify() { function verify() {
data.value.applyContent = null; data.value.applyContent = null;
isVerifyShowSuccess.value = true isVerifyShowSuccess.value = true
} }
/** function cancel() {
* 验证确认
*/
function verify() {
isVerifyShowSuccess.value = false
orderClick(3)
}
function cancel(){
data.applyContent = null; data.applyContent = null;
isVerifyShowSuccess.value = false isVerifyShowSuccess.value = false
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.detail-container{ .detail-container {
min-height: 100vh; min-height: 100vh;
background: white; background: white;
} }
.line{
.line {
background: #f5f5f5; background: #f5f5f5;
height: 20rpx; height: 20rpx;
} }
.info { .info {
background: white; background: white;
} }

4
src/pages/upkeepOrder/index.vue

@ -61,7 +61,7 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as upkeepOrderApi from "@/api/upkeepOrder.js" import * as upkeepOrderApi from "@/api/upkeepOrder"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const params = ref({ const params = ref({
pageNo: 1, pageNo: 1,
@ -80,7 +80,7 @@
if (status.value == 'nomore') return; if (status.value == 'nomore') return;
status.value = 'loading'; status.value = 'loading';
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
await upkeepOrderApi.upkeepOrderPage(params.value).then((res) => { await upkeepOrderApi.upkeepOrderPage(params.value,params.value.type).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
list.value = list.value.concat(res.data.list); list.value = list.value.concat(res.data.list);

4
src/pages/upkeepOrder/myOrder.vue

@ -76,7 +76,7 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as upkeepOrderApi from "@/api/upkeepOrder.js" import * as upkeepOrderApi from "@/api/upkeepOrder"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const params = ref({ const params = ref({
pageNo: 1, pageNo: 1,
@ -89,7 +89,7 @@
if (status.value == 'nomore') return; if (status.value == 'nomore') return;
status.value = 'loading'; status.value = 'loading';
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
await upkeepOrderApi.upkeepOrderPage(params.value).then((res) => { await upkeepOrderApi.upkeepOrderPage(params.value,'DEVICE').then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
list.value = list.value.concat(res.data.list); list.value = list.value.concat(res.data.list);

108
src/plugins/auth.js

@ -1,60 +1,64 @@
import store from '@/store' // import store from '@/store'
// import {
// useCountStore
// } from '@/store'
// const store = useCountStore()
function authPermission(permission) { function authPermission(permission) {
const all_permission = "*:*:*" const all_permission = "*:*:*"
const permissions = store.getters && store.getters.permissions const permissions = uni.getStorageSync('permissionInfo')
if (permission && permission.length > 0) { if (permission && permission.length > 0) {
return permissions.some(v => { return permissions.some(v => {
return all_permission === v || v === permission return all_permission === v || v === permission
}) })
} else { } else {
return false return false
} }
} }
function authRole(role) { function authRole(role) {
const super_admin = "admin" const super_admin = "admin"
const roles = store.getters && store.getters.roles const roles = uni.getStorageSync('roles')
if (role && role.length > 0) { if (role && role.length > 0) {
return roles.some(v => { return roles.some(v => {
return super_admin === v || v === role return super_admin === v || v === role
}) })
} else { } else {
return false return false
} }
} }
export default { export default {
// 验证用户是否具备某权限 // 验证用户是否具备某权限
hasPermi(permission) { hasPermi(permission) {
return authPermission(permission) return authPermission(permission)
}, },
// 验证用户是否含有指定权限,只需包含其中一个 // 验证用户是否含有指定权限,只需包含其中一个
hasPermiOr(permissions) { hasPermiOr(permissions) {
return permissions.some(item => { return permissions.some(item => {
return authPermission(item) return authPermission(item)
}) })
}, },
// 验证用户是否含有指定权限,必须全部拥有 // 验证用户是否含有指定权限,必须全部拥有
hasPermiAnd(permissions) { hasPermiAnd(permissions) {
return permissions.every(item => { return permissions.every(item => {
return authPermission(item) return authPermission(item)
}) })
}, },
// 验证用户是否具备某角色 // 验证用户是否具备某角色
hasRole(role) { hasRole(role) {
return authRole(role) return authRole(role)
}, },
// 验证用户是否含有指定角色,只需包含其中一个 // 验证用户是否含有指定角色,只需包含其中一个
hasRoleOr(roles) { hasRoleOr(roles) {
return roles.some(item => { return roles.some(item => {
return authRole(item) return authRole(item)
}) })
}, },
// 验证用户是否含有指定角色,必须全部拥有 // 验证用户是否含有指定角色,必须全部拥有
hasRoleAnd(roles) { hasRoleAnd(roles) {
return roles.every(item => { return roles.every(item => {
return authRole(item) return authRole(item)
}) })
} }
} }

5
src/plugins/index.js

@ -1,14 +1,13 @@
import tab from './tab' import tab from './tab'
// import auth from './auth' import auth from './auth'
import modal from './modal' import modal from './modal'
import time from './time' import time from './time'
export default { export default {
install(app) { install(app) {
// 页签操作 // 页签操作
app.config.globalProperties.$tab = tab app.config.globalProperties.$tab = tab
// 认证对象 // 认证对象
// Vue.prototype.$auth = auth app.config.globalProperties.$auth = auth
// 模态框对象 // 模态框对象
app.config.globalProperties.$modal = modal app.config.globalProperties.$modal = modal
// 时间对象 // 时间对象

BIN
src/static/images/icon8.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
src/static/images/icon9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

21
src/store/modules/countStore.ts

@ -23,6 +23,7 @@ const useStore = defineStore('storeId', {
deviceMenus: [], deviceMenus: [],
moldMenus: [], moldMenus: [],
thchMenus: [], thchMenus: [],
meaus:[]
}), }),
getters: { getters: {
// isEven: (state) => state.count % 2 === 0 // isEven: (state) => state.count % 2 === 0
@ -60,6 +61,8 @@ const useStore = defineStore('storeId', {
this.roles = res.roles this.roles = res.roles
this.role = res.roles.filter(item => item == 'all_approve' || item == 'normal_approve')[0] this.role = res.roles.filter(item => item == 'all_approve' || item == 'normal_approve')[0]
this.permissions = res.permissions this.permissions = res.permissions
uni.setStorageSync('permissionInfo',res.permissions)
uni.setStorageSync('roles',res.roles)
let menus = [] let menus = []
res.menus.forEach(item => { res.menus.forEach(item => {
if (item.path == '/APP') { if (item.path == '/APP') {
@ -67,21 +70,7 @@ const useStore = defineStore('storeId', {
} }
}) })
if (menus.filter(item => item.path == 'device') && menus.filter(item => item.path == 'device').length > 0) { this.meaus = menus
this.deviceMenus = menus.filter(item => item.path == 'device')[0].children
} else {
this.deviceMenus = []
}
if (menus.filter(item => item.path == 'mold') && menus.filter(item => item.path == 'mold').length > 0) {
this.moldMenus = menus.filter(item => item.path == 'mold')[0].children
} else {
this.moldMenus = []
}
if (menus.filter(item => item.path != 'device' && item.path != 'mold') && menus.filter(item => item.path != 'device' && item.path != 'mold').length > 0) {
this.thchMenus = menus.filter(item => item.path != 'device' && item.path != 'mold')
} else {
this.thchMenus = []
}
} else { } else {
this.roles = [] this.roles = []
@ -127,6 +116,8 @@ const useStore = defineStore('storeId', {
this.post = '' this.post = ''
this.dept = '' this.dept = ''
removeToken() removeToken()
uni.removeStorageSync('permissionInfo')
uni.removeStorageSync('roles')
resolve(res) resolve(res)
}).catch(error => { }).catch(error => {
reject(error) reject(error)

Loading…
Cancel
Save