liuchen864 6 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. 51
      src/pages/deviceReport/addForm.vue
  32. 51
      src/pages/deviceReport/index.vue
  33. 4
      src/pages/deviceReport/myDeviceReport.vue
  34. 204
      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. 81
      src/pages/overhaulOrder/detail.vue
  41. 6
      src/pages/overhaulOrder/index.vue
  42. 2
      src/pages/overhaulOrder/reqairOrderList.vue
  43. 38
      src/pages/repairOrder/addForm.vue
  44. 10
      src/pages/repairOrder/addServiceRecord.vue
  45. 343
      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. 28
      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. 64
      src/pages/spotCheckOrder/addForm.vue
  59. 36
      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. 112
      src/pages/upkeepOrder/detail.vue
  64. 4
      src/pages/upkeepOrder/index.vue
  65. 4
      src/pages/upkeepOrder/myOrder.vue
  66. 10
      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_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_IMAGE=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://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
} from '@dcloudio/uni-app'
import {
ref,
getCurrentInstance
} from 'vue'
import {
@ -15,10 +16,8 @@
import { storeToRefs } from 'pinia'
import { useCountStore } from '@/store'
// store
const store = useCountStore()
onLaunch(async () => {
// #ifdef MP-WEIXIN
if (uni.canIUse('getUpdateManager')) {
@ -67,12 +66,18 @@
})
}
plus.push.addEventListener("click", function (data) {
// 02
if(data.payload.status == 0 || data.payload.status == 2){
// 012
if(data.payload.status == 0 || data.payload.status == 1 || data.payload.status == 2){
uni.navigateTo({
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);
uni.getPushClientId({
success: (res) => {
@ -86,7 +91,10 @@
// #endif
if (getAccessToken()) {
await store.GetPermissionInfo().then(res => {
}).catch(() => { })
uni.setStorageSync('permissionInfo',res.permissions)
uni.setStorageSync('roles',res.roles)
}).catch(() => {
})
await store.GetInfo().then(res => {
}).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) {
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) {
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'
// 备件领用审批列表
// 备件一级审批领用审批列表
export function sparePartsApplicationApprovePage(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) {
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 {
onLoad,
} from '@dcloudio/uni-app'
import * as repairOrderApi from "@/api/repairOrder.js"
import * as repairOrderApi from "@/api/repairOrder"
const props = defineProps({
isShowSelectItem: {

7
src/main.ts

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

2
src/pages/device/index.vue

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

51
src/pages/deviceReport/addForm.vue

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

51
src/pages/deviceReport/index.vue

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

4
src/pages/deviceReport/myDeviceReport.vue

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

204
src/pages/index.vue

@ -31,126 +31,45 @@
<view>待验证</view>
</view>
<view class="status-item">
<view>{{counts1.shenpi || 0}}</view>
<view>{{number || 0}}</view>
<view>待审核</view>
</view>
</view>
</view>
</view>
<view class="box">
<!-- <view class="" v-if="deviceMenus.length>0"> -->
<view class="">
<view class="title">设备维护</view>
<view class="" v-for="(item,index) in meaus" :key='index'>
<view class="title">{{item.name}}</view>
<u-row gutter="16" style="padding:0px 20rpx ;">
<u-col span="3">
<view class="icon-item" @click="open('/pages/deviceReport/index?type=DEVICE')"
>
<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=DEVICE&flag=2')" >
<image src="../static/images/icon11.svg" mode=""></image>
<view>报修确认</view>
</view>
</u-col>
<u-col span="3" v-for="(item,index) in store.deviceMenus" :key='index'>
<view class="icon-item" @click="open('/pages/repairOrder/index?type=DEVICE')"
v-if="item.path =='deviceMaintenanceJob'">
<image src="../static/images/icon5.svg" mode=""></image>
<view>维修工单</view>
</view>
<view class="icon-item" @click="open('/pages/overhaulOrder/index?type=DEVICE')"
v-if="item.path =='deviceInspectionJob'">
<image src="../static/images/icon3.svg" mode=""></image>
<view>检修工单</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>
<u-col span="3" v-for="(cur,key) in item.children" :key='key'>
<view class="icon-item" @click="open(cur.path)">
<!-- 报修图标 -->
<image src="../static/images/icon4.svg" mode="" v-if="cur.componentName == 'report'"></image>
<!-- 报修确认图标 -->
<image src="../static/images/icon8.png" mode="" v-else-if="cur.componentName == 'reportSure'"></image>
<!-- 维修工单图标 -->
<image src="../static/images/icon5.svg" mode="" v-else-if="cur.componentName == 'maintenanceOrder'"></image>
<!-- 检修工单图标 -->
<image src="../static/images/icon3.svg" mode="" v-else-if="cur.componentName == 'inspectionJob'"></image>
<!-- 保养工单图标 -->
<image src="../static/images/icon1.svg" mode="" v-else-if="cur.componentName == 'upkeepOrder'"></image>
<!-- 点检工单图标 -->
<image src="../static/images/icon2.svg" mode="" v-else-if="cur.componentName == 'spotInspectionRecord'"></image>
<!-- 备件申领图标 -->
<image src="../static/images/icon6.png" mode="" v-else-if="cur.componentName == 'itemRequest'"></image>
<!-- 备件申领审核图标 -->
<image src="../static/images/icon7.png" mode="" v-else-if="cur.componentName == 'itemApprove1'"></image>
<!-- 备件申领审核图标 -->
<image src="../static/images/icon9.png" mode="" v-else-if="cur.componentName == 'itemApprove2'"></image>
<!-- 备件维修工单图标 -->
<image src="../static/images/icon5.svg" mode="" v-else-if="cur.componentName == 'itemMaintenanceRecord'"></image>
<view>{{cur.name}}</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>
</u-col>
</u-row>
</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>
@ -175,8 +94,10 @@
} from '@/utils/auth'
import { storeToRefs } from 'pinia'
import { useCountStore } from '@/store'
import * as sparePartsApplicationApproveApi from "@/api/sparePartsApplicationApprove"
const { proxy } = getCurrentInstance()
console.log(proxy.$plugins)
// store
const store = useCountStore()
@ -192,9 +113,9 @@
yanzheng: '',
shenpi: ''
})
const deviceMenus = ref([])
const moldMenus = ref([])
const thchMenus = ref([])
const meaus = ref([])
const isShowItemApprove2 = ref()// true
const isShowItemApprove1 = ref()// true
//
function getCounts1() {
@ -208,21 +129,72 @@
}).catch(() => { })
}
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()=>{
// onLaunchonLoad
// APP.vue onLaunchonLoad
await proxy.$onLaunched;
deviceMenus.value = store.deviceMenus
moldMenus.value = store.moldMenus
thchMenus.value = store.thchMenus
if (getAccessToken()) {
meaus.value = store.meaus
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'
})
onShow(async () => {
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 () => {
if (getAccessToken()) {
getCounts1()
getToDoCountsByUser1()
}
})
onPageScroll((e) => {

20
src/pages/login.vue

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

2
src/pages/mine/changePassword.vue

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

2
src/pages/mold/index.vue

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

22
src/pages/overhaulOrder/addForm.vue

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

12
src/pages/overhaulOrder/addServiceRecord.vue

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

81
src/pages/overhaulOrder/detail.vue

@ -131,11 +131,12 @@
</view>
<view class="footer">
<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>
</view>
<view class="btns" v-if="(data.status == 'COMPLETED')">
<u-button type="primary" @click="orderClickVerify()" :loading='loading' :disabled='loading'>验证完结</u-button>
<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>
</view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
@ -162,7 +163,7 @@
ref,
getCurrentInstance
} from 'vue'
import * as overhaulOrderApi from "@/api/overhaulOrder.js"
import * as overhaulOrderApi from "@/api/overhaulOrder"
import { useCountStore } from '@/store'
const { proxy } = getCurrentInstance()
@ -208,26 +209,21 @@
)
}
}
// APP
function orderClick(type1) {
//
function orderClickFinish() {
const paramseData = {
// number: data.number,
// status: data.status,
id: data.value.id,
verifyContent:data.value.applyContent
// requestNumber: ''
verifyContent: data.value.applyContent
}
if(type1==0){//
if (!serviceList.value || serviceList.value && serviceList.value.length == 0) {
proxy.$modal.showToast('请添加检修内容')
return;
}
let tips = '是否完成?'
proxy.$modal.confirm(tips).then(() => {
proxy.$modal.confirm('是否完成?').then(() => {
proxy.$modal.loading('加载中')
loading.value = true
overhaulOrderApi.orderClick(paramseData).then((res) => {
overhaulOrderApi.orderClickFinish(paramseData,type.value).then((res) => {
if (res.data) {
proxy.$modal.showToast('操作成功')
setTimeout(() => {
@ -244,18 +240,41 @@
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 = '是否验证完结?'
proxy.$modal.confirm(tips).then(async () => {
proxy.$modal.loading('加载中')
loading.value = true
overhaulOrderApi.onVerify(paramseData).then((res) => {
overhaulOrderApi.orderClickVerify(paramseData,type.value).then((res) => {
if (res.data) {
proxy.$modal.showToast('操作成功')
setTimeout(() => {
// proxy.$tab.navigateTo(`/pages/overhaulOrder/index?type=${type.value}`)
proxy.$tab.navigateBack()
loading.value = false
isVerifyShowSuccess.value = false
}, 1500)
} else {
proxy.$modal.showToast('操作失败')
@ -267,13 +286,11 @@
})
})
}
}
//
function getOverhaulOrderDetailList() {
overhaulOrderApi.overhaulOrderDetailList({
number: data.value.number
}).then((res) => {
}, type.value).then((res) => {
if (res.data) {
serviceList.value = res.data
}
@ -281,10 +298,10 @@
}
//
function delService(item) {
if(data.status == 'PECEIVED'){
if (data.status == 'PECEIVED') {
proxy.$modal.confirm('确定删除维修内容吗?').then(() => {
proxy.$modal.loading('加载中')
overhaulOrderApi.overhaulOrderDetailDelete(item.id).then((res) => {
overhaulOrderApi.overhaulOrderDetailDelete(item.id, type.value).then((res) => {
proxy.$modal.closeLoading()
getOverhaulOrderDetailList()
}).catch(() => { })
@ -293,28 +310,8 @@
}
/**
* 点击验证完结填写意见
*/
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) => {
if (option.type) type.value = option.type;
if (option.data) {

6
src/pages/overhaulOrder/index.vue

@ -5,7 +5,7 @@
title="检修工单">
<!-- <template v-slot:right v-if="isEngineer"> -->
<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>
</u-navbar>
<!-- <Search @search='search' @screen='screen'/> -->
@ -69,7 +69,7 @@
ref,
getCurrentInstance
} from 'vue'
import * as overhaulOrderApi from "@/api/overhaulOrder.js"
import * as overhaulOrderApi from "@/api/overhaulOrder"
import { useCountStore } from '@/store'
const store = useCountStore()
const isEngineer = ref(false)
@ -97,7 +97,7 @@
if (status.value == 'nomore') return;
status.value = 'loading';
proxy.$modal.loading('加载中')
await overhaulOrderApi.overhaulOrderPage(params.value).then((res) => {
await overhaulOrderApi.overhaulOrderPage(params.value,params.value.type).then((res) => {
proxy.$modal.closeLoading()
if (res.data.list.length > 0) {
list.value = list.value.concat(res.data.list);

2
src/pages/overhaulOrder/reqairOrderList.vue

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

38
src/pages/repairOrder/addForm.vue

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

10
src/pages/repairOrder/addServiceRecord.vue

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

343
src/pages/repairOrder/detail.vue

@ -9,7 +9,8 @@
v-if="data.status == 'PECEIVED' && (!serviceList || serviceList && serviceList.length == 0)">转办
</view> -->
<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 class="dec">
@ -162,8 +163,7 @@
</view>
<view class="" @click.stop="delService(item)">
<u-icon name="trash" color="#aaaaaa" size="40"
v-if="data.status == 'PECEIVED'"
></u-icon>
v-if="data.status == 'PECEIVED'"></u-icon>
</view>
</view>
@ -198,8 +198,7 @@
</view>
<!-- <u-icon name="minus-circle" color="#aaaaaa" size="60" ></u-icon> -->
</view>
<view class="add-btn"
v-if="data.status == 'PENDING' || data.status == 'PECEIVED'">
<view class="add-btn" v-if="data.status == 'PENDING' || data.status == 'PECEIVED'">
<u-button type="primary" @click="addSubForm('creat')"><u-icon name="plus-circle" color="#ffffff"
size="36"></u-icon>添加维修内容</u-button>
</view>
@ -207,21 +206,26 @@
</view>
</view>
<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>
</view>
<view class="btns" v-if="data.status == 'PECEIVED'">
<u-button shape="shape" type="warning" style="min-width: 120rpx;" :loading='loading1' @click="editForm"
:disabled='loading1'>修改工单</u-button>
<u-button type="primary" @click="orderClickSuccess()" :loading='loading'
:disabled='loading'>完成</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'
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 class="btns" v-if="(data.status == 'COMPLETED' && !data.requestNumber) || (data.status == 'APPLYPASS')">
<u-button type="primary" @click="orderClickVerify()" :loading='loading' :disabled='loading'>验证</u-button>
<view class="btns"
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 class="btns" v-if="data.status == 'COMPLETED' && data.requestNumber && data.applyer == store.id">
<u-button type="primary" @click="orderClickApply()" :loading='loading' :disabled='loading'>维修确认</u-button>
<view class="btns"
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 style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
@ -237,7 +241,7 @@
</view>
<view class="popup-footer">
<view @click="isShowSuccess = false">取消</view>
<view class="sure" @click="sure">确认</view>
<view class="sure" @click="orderClickFinish">确认</view>
</view>
</u-popup>
@ -249,7 +253,7 @@
</view>
<view class="popup-footer">
<view @click="cancel">取消</view>
<view class="sure" @click="verify">确认</view>
<view class="sure" @click="orderClickVerify">确认</view>
</view>
</u-popup>
@ -260,8 +264,8 @@
<textarea v-model="data.applyContent" placeholder="请输入内容"></textarea>
</view>
<view class="popup-footer">
<view class="sure" @click="apply('APPLYPASS')">通过</view>
<view class="reject" @click="apply('APPLYREJECTED')" style="color: red;">驳回</view>
<view class="sure" @click="orderClickConfirm('APPLYPASS')">通过</view>
<view class="reject" @click="orderClickConfirm('APPLYREJECTED')" style="color: red;">驳回</view>
</view>
</u-popup>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
@ -280,8 +284,8 @@
ref,
getCurrentInstance
} from 'vue'
import * as dictApi from "@/api/dict.js"
import * as repairOrderApi from "@/api/repairOrder.js"
import * as dictApi from "@/api/dict"
import * as repairOrderApi from "@/api/repairOrder"
import { useCountStore } from '@/store'
const { proxy } = getCurrentInstance()
@ -376,11 +380,11 @@
/**
* 点击验证完结填写意见
*/
function orderClickVerify() {
function verify() {
data.value.applyContent = null;
isVerifyShowSuccess.value = true
}
function cancel(){
function cancel() {
data.applyContent = null;
isVerifyShowSuccess.value = false
isApplyShowSuccess.value = false
@ -389,47 +393,16 @@
function radioGroupChange(e) {
result.value = e
}
function sure() {
//
async function orderClickFinish() {
isShowSuccess.value = false
orderClick(2)
}
/**
* 维修确认
*/
function apply(status) {
isApplyShowSuccess.value = false
result.value = status
orderClick(3)
}
/**
* 验证确认
*/
function verify() {
isVerifyShowSuccess.value = false
orderClick(2)
}
// APP
async function orderClick(type1) {
//
// if (this.data.status == 'PENDING') {
// if (this.$store.state.user.dept.parentId != this.data.factoryAreaNumber) {
// this.$modal.showToast('')
// return;
// }
// if (this.$store.state.user.dept.classType != this.data.type) {
// this.$modal.showToast('')
// return;
// }
// }
const dataOne = {
number: data.value.number,
status: data.value.status,
id: data.value.id,
result: type1 == 2||type1 == 3 ? result.value : '',
result: result.value,
requestNumber: data.value.requestNumber,
content:data.value.applyContent ? data.value.applyContent:''
content: data.value.applyContent ? data.value.applyContent : ''
}
//
const dataTwo = {
@ -441,64 +414,214 @@
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(() => {
await repairOrderApi.repairOrderUpdate(dataTwo, type.value).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) => {
await repairOrderApi.orderClickFinish(dataOne, type.value).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('操作失败')
proxy.$modal.showToast(res.msg)
loading.value = false
}
}).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
})
})
}else{
proxy.$modal.confirm(tips).then(async () => {
}
/**
* 维修确认
*/
async function orderClickConfirm(status) {
isApplyShowSuccess.value = false
result.value = status
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
//
if (data.value.status == 'PECEIVED') {
await repairOrderApi.repairOrderUpdate(dataTwo).then((res) => { }).catch(() => {
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
})
}
await repairOrderApi.orderClick(dataOne).then(async(res) => {
/**
* 验证确认
*/
async function orderClickVerify() {
isVerifyShowSuccess.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.orderClickVerify(dataOne, type.value).then((res) => {
if (res.data) {
proxy.$modal.showToast('操作成功')
await getDeviceRepairDetail(number.value)
await getDeviceRepairDetailsByNumber()
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
// async function orderClick(type1) {
// //
// // if (this.data.status == 'PENDING') {
// // if (this.$store.state.user.dept.parentId != this.data.factoryAreaNumber) {
// // this.$modal.showToast('')
// // return;
// // }
// // if (this.$store.state.user.dept.classType != this.data.type) {
// // this.$modal.showToast('')
// // 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(() => {
// // proxy.$tab.navigateBack()
// 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 = {
number: data.value.number,
status: data.value.status,
id: data.value.id,
result: '',
requestNumber: data.value.requestNumber,
content: data.value.applyContent ? data.value.applyContent : ''
}
proxy.$modal.confirm('是否接单').then(async () => {
proxy.$modal.loading('加载中')
loading.value = true
await repairOrderApi.orderClick(dataOne, type.value).then(async (res) => {
if (res.data) {
proxy.$modal.showToast('操作成功')
await getDeviceRepairDetail(number.value)
await getDeviceRepairDetailsByNumber()
loading.value = false
} else {
proxy.$modal.showToast('操作失败')
proxy.$modal.showToast(res.msg)
loading.value = false
}
}).catch(() => {
@ -507,14 +630,14 @@
})
})
}
}
//
async function getDeviceRepairDetailsByNumber() {
if(data.value.requestNumber){
if (data.value.requestNumber) {
await repairOrderApi.getDeviceRepairDetailsByNumber({
type: type.value,
requestNumber: data.value.requestNumber
}).then((res) => {
}, type.value).then((res) => {
if (res.data) {
data1.value = res.data
}
@ -524,8 +647,8 @@
//
function getRepairOrderDetaiList() {
repairOrderApi.repairOrderDetailList({
number: number.value
}).then((res) => {
number: number.value,
}, type.value).then((res) => {
if (res.data) {
serviceList.value = res.data
}
@ -593,7 +716,7 @@
proxy.$modal.confirm('是否修改维修工单').then(() => {
proxy.$modal.loading('加载中')
loading1.value = true
repairOrderApi.repairOrderUpdate(paramesData).then((res) => {
repairOrderApi.repairOrderUpdate(paramesData, type.value).then((res) => {
proxy.$modal.closeLoading()
if (res.data) {
proxy.$modal.showToast('修改成功')
@ -611,11 +734,29 @@
})
})
}
async function getDeviceRepairDetail(number){
await repairOrderApi.getDeviceRepairDetail(number).then((res) => {
async function getDeviceRepairDetail(number) {
await repairOrderApi.getDeviceRepairDetail(number, type.value).then((res) => {
proxy.$modal.closeLoading()
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
}).catch(() => {
@ -637,27 +778,7 @@
})
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()
maintenanceShift.value = await dictApi.getDict('maintenance_shift')
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'
:title="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>
</u-navbar>
<view class="list">
@ -29,10 +29,10 @@
类型:<span>{{item.type=='DEVICE'?'设备':item.type=='TECH'?'工艺':'模具'}}</span>
</view>
<view class="dec">
{{`${params.type=='DEVICE'?'设备' : '模具'}`}}编号:<span>{{item.deviceNumber}}</span>
{{`${params.type=='DEVICE'?'设备':params.type=='TECH'?'工艺' : '模具'}`}}编号:<span>{{item.deviceNumber}}</span>
</view>
<view class="dec">
{{`${params.type=='DEVICE'?'设备' : '模具'}`}}名称:<span>{{item.name}}</span>
{{`${params.type=='DEVICE'?'设备':params.type=='TECH'?'工艺' : '模具'}`}}名称:<span>{{item.name}}</span>
</view>
<view class="dec">
所属厂区:<span>{{item.factoryAreaName}}</span>
@ -69,7 +69,7 @@
getCurrentInstance,
nextTick
} from 'vue'
import * as repairOrderApi from "@/api/repairOrder.js"
import * as repairOrderApi from "@/api/repairOrder"
import { useCountStore } from '@/store'
const { proxy } = getCurrentInstance()
@ -93,7 +93,7 @@
if (status.value == 'nomore') return;
status.value = 'loading';
proxy.$modal.loading('加载中')
await repairOrderApi.repairOrderPage(params.value).then((res) => {
await repairOrderApi.repairOrderPage(params.value,params.value.type).then((res) => {
proxy.$modal.closeLoading()
if (res.data.list.length > 0) {
list.value = list.value.concat(res.data.list);

4
src/pages/repairOrder/myOrder.vue

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

12
src/pages/repairOrder/transfer.vue

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

2
src/pages/spareParts/index.vue

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

10
src/pages/sparePartsApplication/addForm.vue

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

12
src/pages/sparePartsApplication/detail.vue

@ -36,10 +36,10 @@
</view>
</view>
</view>
<view class="footer" v-if="from == 3">
<view class="footer" v-if="from == 3 || from == 2">
<view class="btns">
<button class="reset" @click="reject">驳回</button>
<button class="sure" @click="agree" :loading='loading' :disabled='loading'>通过</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' 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 style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
@ -56,13 +56,13 @@
ref,
getCurrentInstance
} from 'vue'
import * as sparePartsApplicationApi from "@/api/sparePartsApplication.js"
import * as sparePartsApplicationApproveApi from "@/api/sparePartsApplicationApprove.js"
import * as sparePartsApplicationApi from "@/api/sparePartsApplication"
import * as sparePartsApplicationApproveApi from "@/api/sparePartsApplicationApprove"
const { proxy } = getCurrentInstance()
const number = ref('')
const data = ref({})
const loading = ref(false)
const from = ref()//13
const from = ref()//123
const type = ref()
function getSparePartsApplicationDetail() {
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'
title="备件领用申请">
<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>
</u-navbar>
<!-- <Search @search='search' @screen='screen' /> -->
@ -41,7 +41,7 @@
</view>
<view class="button">
<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>
@ -61,7 +61,7 @@
ref,
getCurrentInstance
} from 'vue'
import * as sparePartsApplicationApi from "@/api/sparePartsApplication.js"
import * as sparePartsApplicationApi from "@/api/sparePartsApplication"
const { proxy } = getCurrentInstance()
const params = ref({
pageNo: 1,

2
src/pages/sparePartsApplication/mySparePartsApplication.vue

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

28
src/pages/sparePartsApplicationApprove/index.vue

@ -38,9 +38,9 @@
</view>
<view class="button">
<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;"
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>
@ -60,7 +60,7 @@
ref,
getCurrentInstance
} from 'vue'
import * as sparePartsApplicationApproveApi from "@/api/sparePartsApplicationApprove.js"
import * as sparePartsApplicationApproveApi from "@/api/sparePartsApplicationApprove"
const { proxy } = getCurrentInstance()
const params = ref({
pageNo: 1,
@ -69,7 +69,7 @@
})
const status = ref('loadmore') //
const list = ref([])
const from = ref('')
const from = ref('')//123
function openDetail(item, index) {
proxy.$tab.navigateTo(`/pages/sparePartsApplication/detail?number=${item.number}&from=${from.value}`)
@ -81,6 +81,7 @@
if (status.value == 'nomore') return;
status.value = 'loading';
proxy.$modal.loading('加载中')
if(from.value == 2){
await sparePartsApplicationApproveApi.sparePartsApplicationApprovePage(params.value).then((res) => {
proxy.$modal.closeLoading()
if (res.data.list.length > 0) {
@ -93,6 +94,21 @@
}).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) {
@ -142,6 +158,10 @@
</script>
<style lang="scss" scoped>
.container{
background: #f5f5f5;
min-height: 100vh;
}
.list {
background: #f5f5f5;
margin-top: 20rpx;

2
src/pages/sparePartsApplicationApprove/mySparePartsApplicationApprove.vue

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

8
src/pages/sparePartsServiceWorkOrderList/addForm.vue

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

2
src/pages/sparePartsServiceWorkOrderList/mySparePartsService.vue

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

64
src/pages/spotCheckOrder/addForm.vue

@ -6,8 +6,8 @@
<u-input v-model="form.describes" placeholder="请输入点检描述" />
</u-form-item>
<u-form-item :label="`${type=='DEVICE'?'设备' : '模具'}编码`" prop="deviceNumber" required>
<u-input v-model="form.deviceNumber"
:placeholder="`请输入${type=='DEVICE'?'设备' : '模具'}编码`" @blur="blur" @confirm='blur()'/>
<u-input v-model="form.deviceNumber" :placeholder="`请输入${type=='DEVICE'?'设备' : '模具'}编码`" @blur="blur"
@confirm='blur()' />
<view class="right-button" @click="chickRightButton">
扫描
</view>
@ -97,10 +97,10 @@
getCurrentInstance
} from 'vue'
import * as deviceApi from "@/api/device.js"
import * as moldApi from "@/api/mold.js"
import * as spotCheckOrderApi from "@/api/spotCheckOrder.js"
import * as dictApi from "@/api/dict.js"
import * as deviceApi from "@/api/device"
import * as moldApi from "@/api/mold"
import * as spotCheckOrderApi from "@/api/spotCheckOrder"
import * as dictApi from "@/api/dict"
import { useCountStore } from '@/store'
const { proxy } = getCurrentInstance()
@ -125,9 +125,9 @@
describes: "",
deviceNumber: '',
deviceName: '',
maintenances:'',
maintenances: '',
classes: '',
classesName:''
classesName: ''
})
const singleColumnShow = ref(false)
const singleColumnDefaultValue = ref([])
@ -138,7 +138,7 @@
//
function chickRightButton(field) {
uni.scanCode({
success: function(res) {
success: function (res) {
form.value.deviceNumber = res.result
getDetailsByNumber()
getSubList()
@ -154,25 +154,25 @@
// /
function getDetailsByNumber() {
const data = {
number:form.value.deviceNumber,
flag:2
number: form.value.deviceNumber,
flag: 2
}
if(type.value=='MOLD'){
if (type.value == 'MOLD') {
moldApi.getMoldDetailsByNumber(data).then((res) => {
if (res.data) {
form.value.deviceName = res.data.name
} else {
proxy.$modal.showToast(`找不到该${type.value=='DEVICE'?'设备' : '模具'}`)
proxy.$modal.showToast(`找不到该${type.value == 'DEVICE' ? '设备' : '模具'}`)
}
}).catch(()=>{})
}else{
}).catch(() => { })
} else {
deviceApi.getDeviceDetailsByNumber(data).then((res) => {
if (res.data) {
form.value.deviceName = res.data.name
} else {
proxy.$modal.showToast(`找不到该${type.value=='DEVICE'?'设备' : '模具'}`)
proxy.$modal.showToast(`找不到该${type.value == 'DEVICE' ? '设备' : '模具'}`)
}
}).catch(()=>{})
}).catch(() => { })
}
}
@ -184,13 +184,13 @@
deviceApi.getSubList(data).then((res) => {
if (res.data) {
subList.value = res.data
subList.value.forEach(item=>{
subList.value.forEach(item => {
item.isConform = 'TRUE'
})
} else {
proxy.$modal.showToast(`找不到该${type.value=='DEVICE'?'设备' : '模具'}`)
proxy.$modal.showToast(`找不到该${type.value == 'DEVICE' ? '设备' : '模具'}`)
}
}).catch(()=>{})
}).catch(() => { })
}
//
function submit() {
@ -200,14 +200,14 @@
return;
}
if (!form.value.deviceNumber) {
proxy.$modal.showToast(`请输入${type.value=='DEVICE'?'设备' : '模具'}编码`)
proxy.$modal.showToast(`请输入${type.value == 'DEVICE' ? '设备' : '模具'}编码`)
return;
}
if (!form.value.classes) {
proxy.$modal.showToast('请选择班次')
return;
}
if (subList.value.length==0) {
if (subList.value.length == 0) {
proxy.$modal.showToast('该设备无检修项目')
return;
}
@ -215,17 +215,17 @@
// item.isConform = !item.isConform1 ? 'FALSE' : 'TRUE'
// })
const data = {
describes:form.value.describes,
deviceNumber:form.value.deviceNumber,
describes: form.value.describes,
deviceNumber: form.value.deviceNumber,
maintenances: form.value.maintenances,
classes:form.value.classes,
subList:subList.value,
classes: form.value.classes,
subList: subList.value,
type: type.value
}
proxy.$modal.confirm('是否添加点检工单').then(() => {
proxy.$modal.loading('加载中')
loading.value = true
spotCheckOrderApi.spotCheckOrderCreate(data).then((res) => {
spotCheckOrderApi.spotCheckOrderCreate(data, type.value).then((res) => {
proxy.$modal.closeLoading()
if (res.data) {
proxy.$modal.showToast('添加成功')
@ -234,9 +234,9 @@
loading.value = false
}, 1500)
} else {
if(res.msg){
if (res.msg) {
proxy.$modal.showToast(res.msg)
}else{
} else {
proxy.$modal.showToast('添加失败')
}
loading.value = false
@ -254,7 +254,7 @@
describes: "",
deviceNumber: '',
deviceName: '',
maintenances:'',
maintenances: '',
classes: ''
}
}
@ -273,7 +273,7 @@
//
function chooseSingleColumn(e) {
form.value[field.value] = e[0].value
if(field.value == 'classes'){
if (field.value == 'classes') {
form.value.classesName = e[0].label
}
singleColumnShow.value = false
@ -287,7 +287,6 @@
function radioGroupChange(e) {
console.log(e);
}
</script>
<style lang="scss" scoped>
@ -307,6 +306,7 @@
.list {
padding: 30rpx 30rpx;
.item {
display: flex;
margin-bottom: 20rpx;

36
src/pages/spotCheckOrder/detail.vue

@ -94,14 +94,16 @@
</view>
</view>
<view class="footer">
<view class="btns" v-if="(data.status == 'COMPLETED' || data.status =='APPLYPASS' || 'APPLYREJECTED')">
<u-button type="primary" @click="orderClickVerify()" :loading='loading' :disabled='loading'>审核</u-button>
<view class="btns"
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 style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
<!-- 验证完结-->
<u-popup v-model="isVerifyShowSuccess" mode="center" border-radius="14">
<view class="popup-title">审核意见</view>
<view class="popup-title">意见</view>
<view class="popup">
<textarea v-model="data.applyContent" placeholder="请输入内容"></textarea>
</view>
@ -127,10 +129,10 @@
ref,
getCurrentInstance
} from 'vue'
import * as dictApi from "@/api/dict.js"
import * as repairOrderApi from "@/api/repairOrder.js"
import * as dictApi from "@/api/dict"
import * as repairOrderApi from "@/api/repairOrder"
import { useCountStore } from '@/store'
import * as spotCheckOrderApi from "@/api/spotCheckOrder.js"
import * as spotCheckOrderApi from "@/api/spotCheckOrder"
const { proxy } = getCurrentInstance()
// store
@ -198,7 +200,7 @@
data.value.applyContent = null;
isVerifyShowSuccess.value = true
}
function cancel(){
function cancel() {
data.applyContent = null;
isVerifyShowSuccess.value = false
isApplyShowSuccess.value = false
@ -235,11 +237,10 @@
id: data.value.id,
approveOpinion: data.value.applyContent
}
let tips ='是否确认提交'
proxy.$modal.confirm(tips).then(async () => {
let tips = '是否确认提交'
proxy.$modal.loading('加载中')
loading.value = true
await spotCheckOrderApi.orderClickApprove(dataOne).then((res) => {
await spotCheckOrderApi.orderClickVerify(dataOne, type.value).then((res) => {
if (res.data) {
proxy.$modal.showToast('操作成功')
setTimeout(() => {
@ -247,19 +248,18 @@
loading.value = false
}, 1500)
} else {
proxy.$modal.showToast('操作失败')
proxy.$modal.showToast(res.msg)
loading.value = false
}
}).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
})
})
}
async function getDeviceRepairDetail(number){
await repairOrderApi.getDeviceRepairDetail(number).then((res) => {
async function getDeviceRepairDetail(number) {
await repairOrderApi.getDeviceRepairDetail(number, type.value).then((res) => {
proxy.$modal.closeLoading()
data.value = res.data
if (res.data) {
@ -289,7 +289,7 @@
if (number.value) {
list.value = [{
name: type.value=='MOLD'?'模具信息':'设备信息',
name: type.value == 'MOLD' ? '模具信息' : '设备信息',
value: 1
}, {
name: '点检项内容',
@ -297,7 +297,7 @@
}]
} else {
list.value = [{
name: type.value=='MOLD'?'模具信息':'设备信息',
name: type.value == 'MOLD' ? '模具信息' : '设备信息',
value: 1
}, {
name: '点检项内容',
@ -311,11 +311,11 @@
const data = {
number: number.value
}
spotCheckOrderApi.selectListByNumber(data).then((res) => {
spotCheckOrderApi.selectListByNumber(data, type.value).then((res) => {
if (res.data) {
subList.value = res.data
}
}).catch(()=>{})
}).catch(() => { })
}
</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'
title="点检工单">
<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>
</u-navbar>
<view class="list">
@ -70,7 +70,7 @@
getCurrentInstance,
nextTick
} from 'vue'
import * as spotCheckOrderApi from "@/api/spotCheckOrder.js"
import * as spotCheckOrderApi from "@/api/spotCheckOrder"
import { useCountStore } from '@/store'
const { proxy } = getCurrentInstance()
@ -94,7 +94,7 @@
if (status.value == 'nomore') return;
status.value = 'loading';
proxy.$modal.loading('加载中')
await spotCheckOrderApi.spotCheckOrderPage(params.value).then((res) => {
await spotCheckOrderApi.spotCheckOrderPage(params.value,params.value.type).then((res) => {
proxy.$modal.closeLoading()
if (res.data.list.length > 0) {
list.value = list.value.concat(res.data.list);

4
src/pages/spotCheckOrder/myOrder.vue

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

12
src/pages/upkeepOrder/addServiceRecord.vue

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

112
src/pages/upkeepOrder/detail.vue

@ -101,9 +101,11 @@
<view>责任人</view>
<view>{{item.chargePeoplesName}}</view>
</view>
<view class="dec2" >
<view class="dec2">
<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 class="dec2" v-if='item.status === 0 || item.status === "0"'>
<view>完成时间</view>
@ -139,12 +141,15 @@
</view>
<view class="footer">
<view class="btns">
<u-button type="primary" v-if="data.status == 'PENDING'" @click="orderClick(1)" :loading='loading'
:disabled='loading'>接单</u-button>
<u-button type="primary" v-if="data.status == 'PECEIVED'" @click="orderClick(2)" :loading='loading'
:disabled='loading'>完成</u-button>
<u-button type="primary" v-if="data.status == 'COMPLETED'" @click="orderClickVerify()" :loading='loading'
:disabled='loading'>验证</u-button>
<u-button type="primary"
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')))"
@click="orderClick()" :loading='loading' :disabled='loading'>接单</u-button>
<u-button type="primary"
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')))"
@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 style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
@ -157,7 +162,7 @@
</view>
<view class="popup-footer">
<view @click="cancel">取消</view>
<view class="sure" @click="verify">确认</view>
<view class="sure" @click="orderClickVerify">确认</view>
</view>
</u-popup>
</view>
@ -172,8 +177,8 @@
ref,
getCurrentInstance
} from 'vue'
import * as moldApi from "@/api/mold.js"
import * as upkeepOrderApi from "@/api/upkeepOrder.js"
import * as moldApi from "@/api/mold"
import * as upkeepOrderApi from "@/api/upkeepOrder"
const { proxy } = getCurrentInstance()
const list = ref([{
name: '设备信息'
@ -197,7 +202,7 @@
}
//
function addSubForm(clickType, item) {
if(data.value.status == 'COMPLETED'){//
if (data.value.status == 'COMPLETED') {//
return
}
if (data.value.status == 'PENDING') {
@ -215,28 +220,18 @@
}
}
function orderClick(type1) {
if(!serviceList.value || serviceList.value&&serviceList.value.length == 0){
if (!serviceList.value || serviceList.value && serviceList.value.length == 0) {
proxy.$modal.showToast('没有保养内容')
return;
}
let tips = data.value.status == 'PENDING' ? '是否接单?' : data.value.status == 'PECEIVED' ? '是否完成?' : data.value.status == 'COMPLETED' ? '是否验证完结?' :''
// if(type == 2){
// isTrue.value = serviceList.value.some(item=>item.items.length == 0)
// if(isTrue.value){
// proxy.$modal.showToast('')
// return;
// }
// }
const paramsData = {
id: data.value.id,
verifyContent: data.value.applyContent
}
proxy.$modal.confirm(tips).then(() => {
proxy.$modal.confirm('是否接单?').then(() => {
proxy.$modal.loading('加载中')
loading.value = true
if(type1 == 1){
upkeepOrderApi.orderClick(paramsData).then((res) => {
upkeepOrderApi.orderClick(paramsData,type.value).then((res) => {
if (res.data) {
proxy.$modal.showToast('操作成功')
setTimeout(() => {
@ -244,15 +239,30 @@
loading.value = false
}, 1500)
} else {
proxy.$modal.showToast('操作失败')
proxy.$modal.showToast(res.msg)
loading.value = false
}
}).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
})
}else if(type1 == 2){
upkeepOrderApi.orderClickFinish(paramsData).then((res) => {
})
}
//
function orderClickFinish() {
if (!serviceList.value || serviceList.value && serviceList.value.length == 0) {
proxy.$modal.showToast('没有保养内容')
return;
}
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(() => {
@ -260,38 +270,53 @@
loading.value = false
}, 1500)
} else {
proxy.$modal.showToast('操作失败')
proxy.$modal.showToast(res.msg)
loading.value = false
}
}).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
})
}else if(type1==3){//
upkeepOrderApi.orderClickVerify(paramsData).then((res) => {
})
}
//
function orderClickVerify() {
if (!serviceList.value || serviceList.value && serviceList.value.length == 0) {
proxy.$modal.showToast('没有保养内容')
return;
}
const paramsData = {
id: data.value.id,
verifyContent: data.value.applyContent
}
isVerifyShowSuccess.value = false
proxy.$modal.confirm('是否完成?').then(() => {
proxy.$modal.loading('加载中')
loading.value = true
upkeepOrderApi.orderClickVerify(paramsData,type.value).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('操作失败')
proxy.$modal.showToast(res.msg)
loading.value = false
}
}).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
})
}
})
}
//
function getUpkeepOrderDetailList() {
upkeepOrderApi.upkeepOrderDetailList({
number: data.value.number
}).then((res) => {
},type.value).then((res) => {
if (res.data) {
serviceList.value = res.data
}
@ -301,7 +326,7 @@
function delService(item) {
proxy.$modal.confirm('确定删除维修内容吗?').then(() => {
proxy.$modal.loading('加载中')
upkeepOrderApi.upkeepOrderDetailDelete(item.id).then((res) => {
upkeepOrderApi.upkeepOrderDetailDelete(item.id,type.value).then((res) => {
proxy.$modal.closeLoading()
getUpkeepOrderDetailList()
}).catch(() => { })
@ -323,32 +348,27 @@
/**
* 点击验证完结填写意见
*/
function orderClickVerify() {
function verify() {
data.value.applyContent = null;
isVerifyShowSuccess.value = true
}
/**
* 验证确认
*/
function verify() {
isVerifyShowSuccess.value = false
orderClick(3)
}
function cancel(){
function cancel() {
data.applyContent = null;
isVerifyShowSuccess.value = false
}
</script>
<style lang="scss" scoped>
.detail-container{
.detail-container {
min-height: 100vh;
background: white;
}
.line{
.line {
background: #f5f5f5;
height: 20rpx;
}
.info {
background: white;
}

4
src/pages/upkeepOrder/index.vue

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

4
src/pages/upkeepOrder/myOrder.vue

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

10
src/plugins/auth.js

@ -1,8 +1,12 @@
import store from '@/store'
// import store from '@/store'
// import {
// useCountStore
// } from '@/store'
// const store = useCountStore()
function authPermission(permission) {
const all_permission = "*:*:*"
const permissions = store.getters && store.getters.permissions
const permissions = uni.getStorageSync('permissionInfo')
if (permission && permission.length > 0) {
return permissions.some(v => {
return all_permission === v || v === permission
@ -14,7 +18,7 @@ function authPermission(permission) {
function authRole(role) {
const super_admin = "admin"
const roles = store.getters && store.getters.roles
const roles = uni.getStorageSync('roles')
if (role && role.length > 0) {
return roles.some(v => {
return super_admin === v || v === role

5
src/plugins/index.js

@ -1,14 +1,13 @@
import tab from './tab'
// import auth from './auth'
import auth from './auth'
import modal from './modal'
import time from './time'
export default {
install(app) {
// 页签操作
app.config.globalProperties.$tab = tab
// 认证对象
// Vue.prototype.$auth = auth
app.config.globalProperties.$auth = auth
// 模态框对象
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: [],
moldMenus: [],
thchMenus: [],
meaus:[]
}),
getters: {
// isEven: (state) => state.count % 2 === 0
@ -60,6 +61,8 @@ const useStore = defineStore('storeId', {
this.roles = res.roles
this.role = res.roles.filter(item => item == 'all_approve' || item == 'normal_approve')[0]
this.permissions = res.permissions
uni.setStorageSync('permissionInfo',res.permissions)
uni.setStorageSync('roles',res.roles)
let menus = []
res.menus.forEach(item => {
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.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 = []
}
this.meaus = menus
} else {
this.roles = []
@ -127,6 +116,8 @@ const useStore = defineStore('storeId', {
this.post = ''
this.dept = ''
removeToken()
uni.removeStorageSync('permissionInfo')
uni.removeStorageSync('roles')
resolve(res)
}).catch(error => {
reject(error)

Loading…
Cancel
Save