Browse Source

fix: 权限问题

master
zhang_li 5 months ago
parent
commit
904a92b025
  1. 4
      .env.production
  2. 1
      src/App.vue
  3. 12
      src/api/device.js
  4. 94
      src/api/overhaulOrder.js
  5. 141
      src/api/repairOrder.js
  6. 33
      src/api/report.js
  7. 7
      src/api/sparePartsApplicationApprove.js
  8. 60
      src/api/spotCheckOrder.js
  9. 102
      src/api/upkeepOrder.js
  10. 7
      src/main.ts
  11. 43
      src/pages/deviceReport/addForm.vue
  12. 46
      src/pages/deviceReport/index.vue
  13. 206
      src/pages/index.vue
  14. 20
      src/pages/login.vue
  15. 4
      src/pages/overhaulOrder/addForm.vue
  16. 4
      src/pages/overhaulOrder/addServiceRecord.vue
  17. 149
      src/pages/overhaulOrder/detail.vue
  18. 5
      src/pages/overhaulOrder/index.vue
  19. 32
      src/pages/repairOrder/addForm.vue
  20. 4
      src/pages/repairOrder/addServiceRecord.vue
  21. 442
      src/pages/repairOrder/detail.vue
  22. 9
      src/pages/repairOrder/index.vue
  23. 9
      src/pages/sparePartsApplication/detail.vue
  24. 3
      src/pages/sparePartsApplication/index.vue
  25. 51
      src/pages/sparePartsApplicationApprove/index.vue
  26. 100
      src/pages/spotCheckOrder/addForm.vue
  27. 61
      src/pages/spotCheckOrder/detail.vue
  28. 5
      src/pages/spotCheckOrder/index.vue
  29. 4
      src/pages/upkeepOrder/addServiceRecord.vue
  30. 265
      src/pages/upkeepOrder/detail.vue
  31. 2
      src/pages/upkeepOrder/index.vue
  32. 10
      src/plugins/auth.js
  33. 5
      src/plugins/index.js
  34. 32
      src/store/modules/countStore.ts

4
.env.production

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

1
src/App.vue

@ -18,7 +18,6 @@
// store // store
const store = useCountStore() const store = useCountStore()
onLaunch(async () => { onLaunch(async () => {
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
if (uni.canIUse('getUpdateManager')) { if (uni.canIUse('getUpdateManager')) {

12
src/api/device.js

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

94
src/api/overhaulOrder.js

@ -2,38 +2,92 @@ import http from './http'
// 添加工单 // 添加工单
export function overhaulOrderCreate(data) { export function overhaulOrderCreate(data,type) {
return http.post('/eam/device-inspection-job-main/create',data) 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) { export function overhaulOrderUpdate(data,type) {
return http.put('/eam/device-inspection-job-main/updat',data) 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) { export function overhaulOrderPage(params,type) {
return http.get('/eam/device-inspection-job-main/getAppPage',{params}) 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 orderClick(params) { export function orderClickFinish(params,type) {
return http.get('/eam/device-inspection-job-main/onClick',{params}) 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 onVerify(params) { export function orderClickVerify(params,type) {
return http.get('/eam/device-inspection-job-main/onVerify',{params}) 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) { export function overhaulOrderDetailCreate(data,type) {
return http.post('/eam/device-inspection-job-detail/create',data) 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) { export function overhaulOrderDetailUpdate(data,type) {
return http.put('/eam/device-inspection-job-detail/update',data) 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) { export function overhaulOrderDetailList(params,type) {
return http.get('/eam/device-inspection-job-detail/selectListByNumber',{params}) 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) { export function overhaulOrderDetailDelete(id,type) {
return http.delete('/eam/device-inspection-job-detail/delete?id='+id) 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)
}
} }

141
src/api/repairOrder.js

@ -2,51 +2,144 @@ import http from './http'
// 添加工单 // 添加工单
export function repairOrderCreate(data) { export function repairOrderCreate(data,type) {
return http.post('/eam/device-maintenance-job-main/create',data) 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) { export function repairOrderUpdate(data,type) {
return http.put('/eam/device-maintenance-job-main/update',data) 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) { export function repairOrderPage(params,type) {
return http.get('/eam/device-maintenance-job-main/getAppPage',{params}) 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) { export function getDeviceRepairDetail(number,type) {
return http.get('eam/device-maintenance-job-main/getAppByNumber?number='+number) 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) { export function orderClick(params,type) {
return http.get('/eam/device-maintenance-job-main/orderClick',{params}) 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) { export function repairOrderDetailCreate(data,type) {
return http.post('/eam/device-maintenance-job-detail/create',data) 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) { export function repairOrderDetailUpdate(data,type) {
return http.put('/eam/device-maintenance-job-detail/update',data) 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) { export function repairOrderDetailList(params,type) {
return http.get('/eam/device-maintenance-job-detail/selectListByNumber',{params}) 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) { export function repairOrderDetailDelete(id,type) {
return http.delete( '/eam/device-maintenance-job-detail/delete?id='+id) 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) { export function transfer(params,type) {
return http.get('/eam/device-maintenance-job-main/turnTo',{params}) 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) { export function repairOrderList(params) {
return http.get('/eam/device-maintenance-job-main/getList',{params}) return http.get('/eam/device-maintenance-job-main/getList', {
params
})
} }
// 获取维修工单的报修信息 // 获取维修工单的报修信息
export function getDeviceRepairDetailsByNumber(params) { export function getDeviceRepairDetailsByNumber(params) {
return http.get('/eam/device-repair-request/getDetailsByNumber',{params}) return http.get('/eam/device-repair-request/getDetailsByNumber', {
params
})
} }

33
src/api/report.js

@ -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.post('/eam/mold-repair-request/getAppPage',{params})
}else if(type == 'TECH'){
return http.post('/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.post('/eam/mold-repair-request/cancel?id='+id)
}else if(type == 'TECH'){
return http.post('/eam/tech-repair-request/cancel?id='+id)
}
}

7
src/api/sparePartsApplicationApprove.js

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

60
src/api/spotCheckOrder.js

@ -1,29 +1,65 @@
import http from './http' import http from './http'
// 添加工单 // 添加工单
export function spotCheckOrderCreate(data) { export function spotCheckOrderCreate(data,type) {
return http.post('/eam/device-spot-inspection-record-main/create',data) 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) { export function spotCheckOrderUpdate(data,type) {
return http.put('/eam/device-spot-inspection-record-main/update',data) 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) { export function spotCheckOrderPage(params,type) {
return http.get('/eam/device-spot-inspection-record-main/getAppPage',{params}) 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) { export function orderClick(params,type) {
return http.get('/eam/device-spot-inspection-record-main/onClick',{params}) 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) { export function selectListByNumber(params,type) {
return http.get('/eam/device-spot-inspection-record-detail/getList',{params}) 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 orderClickApprove(params) { export function orderClickVerify(params,type) {
return http.get('/eam/device-spot-inspection-record-main/orderClickApprove',{params}) 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})
}
} }

102
src/api/upkeepOrder.js

@ -1,44 +1,104 @@
import http from './http' import http from './http'
// 添加工单 // 添加工单
export function upkeepOrderCreate(data) { export function upkeepOrderCreate(data,type) {
return http.post('/eam/device-maintain-job-main/create',data) 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) { export function upkeepOrderUpdate(data,type) {
return http.put('/eam/device-maintain-job-main/update',data) 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) { export function upkeepOrderPage(params,type) {
return http.get('/eam/device-maintain-job-main/getAppPage',{params}) 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) { export function orderClick(params,type) {
return http.get('/eam/device-maintain-job-main/orderClick',{params}) 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) { export function orderClickVerify(params,type) {
return http.get('/eam/device-maintain-job-main/orderClickVerify',{params}) 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) { export function orderClickFinish(params,type) {
return http.get('/eam/device-maintain-job-main/orderClickFinish',{params}) 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) { export function upkeepOrderDetailCreate(data,type) {
return http.post('/eam/device-maintain-job-detail/create',data) 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) { export function upkeepOrderDetailUpdate(data,type) {
return http.put('/eam/device-maintain-job-detail/update',data) 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) { export function upkeepOrderDetailList(params,type) {
return http.get('/eam/device-maintain-job-detail/selectListByNumber',{params}) 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) { export function upkeepOrderDetailDelete(id,type) {
return http.delete('/eam/device-maintain-job-detail/delete?id='+id) 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)
}
} }

7
src/main.ts

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

43
src/pages/deviceReport/addForm.vue

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

46
src/pages/deviceReport/index.vue

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

206
src/pages/index.vue

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

20
src/pages/login.vue

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

4
src/pages/overhaulOrder/addForm.vue

@ -180,7 +180,7 @@
proxy.$modal.confirm('是否修改检修工单').then(() => { proxy.$modal.confirm('是否修改检修工单').then(() => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
loading.value = true loading.value = true
overhaulOrderApi.overhaulOrderUpdate(data).then((res) => { overhaulOrderApi.overhaulOrderUpdate(data,type.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data) { if (res.data) {
proxy.$modal.showToast('修改成功') proxy.$modal.showToast('修改成功')
@ -205,7 +205,7 @@
proxy.$modal.confirm('是否添加检修工单').then(() => { proxy.$modal.confirm('是否添加检修工单').then(() => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
loading.value = true loading.value = true
overhaulOrderApi.overhaulOrderCreate(data).then((res) => { overhaulOrderApi.overhaulOrderCreate(data,type.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data) { if (res.data) {
proxy.$modal.showToast('添加成功') proxy.$modal.showToast('添加成功')

4
src/pages/overhaulOrder/addServiceRecord.vue

@ -275,7 +275,7 @@
proxy.$modal.confirm('是否修改检修内容').then(() => { proxy.$modal.confirm('是否修改检修内容').then(() => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
loading.value = true loading.value = true
overhaulOrderApi.overhaulOrderDetailUpdate(form.value).then((res) => { overhaulOrderApi.overhaulOrderDetailUpdate(form.value,type.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data) { if (res.data) {
proxy.$modal.showToast('修改成功') proxy.$modal.showToast('修改成功')
@ -300,7 +300,7 @@
proxy.$modal.confirm('是否添加检修内容').then(() => { proxy.$modal.confirm('是否添加检修内容').then(() => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
loading.value = true loading.value = true
overhaulOrderApi.overhaulOrderDetailCreate(form.value).then((res) => { overhaulOrderApi.overhaulOrderDetailCreate(form.value,type.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data) { if (res.data) {
proxy.$modal.showToast('添加成功') proxy.$modal.showToast('添加成功')

149
src/pages/overhaulOrder/detail.vue

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

5
src/pages/overhaulOrder/index.vue

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

32
src/pages/repairOrder/addForm.vue

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

4
src/pages/repairOrder/addServiceRecord.vue

@ -200,7 +200,7 @@
proxy.$modal.confirm('是否修改维修内容').then(() => { proxy.$modal.confirm('是否修改维修内容').then(() => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
loading.value = true loading.value = true
repairOrderApi.repairOrderDetailUpdate(form.value).then((res) => { repairOrderApi.repairOrderDetailUpdate(form.value,type.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data) { if (res.data) {
proxy.$modal.showToast('修改成功') proxy.$modal.showToast('修改成功')
@ -225,7 +225,7 @@
proxy.$modal.confirm('是否添加维修内容').then(() => { proxy.$modal.confirm('是否添加维修内容').then(() => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
loading.value = true loading.value = true
repairOrderApi.repairOrderDetailCreate(form.value).then((res) => { repairOrderApi.repairOrderDetailCreate(form.value,type.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data) { if (res.data) {
proxy.$modal.showToast('添加成功') proxy.$modal.showToast('添加成功')

442
src/pages/repairOrder/detail.vue

@ -3,13 +3,14 @@
<view class="detail-container"> <view class="detail-container">
<view class="info"> <view class="info">
<view class="title"> <view class="title">
<view>维修工单</view> <view>维修工单</view>
<!-- <view @click="transfer" <!-- <view @click="transfer"
v-if="data.status == 'PECEIVED' && (!serviceList || serviceList && serviceList.length == 0)">转办 v-if="data.status == 'PECEIVED' && (!serviceList || serviceList && serviceList.length == 0)">转办
</view> --> </view> -->
<view @click="transfer" <view @click="transfer"
v-if="data.status == 'PECEIVED'">转办 v-if="data.status == 'PECEIVED'&&auth.hasPermiOr(['eam:device-maintenance-job-main:turnTo','eam:mold-maintenance-job-main:turnTo','eam:tech-maintenance-job-main:orderClick'])">
转办
</view> </view>
</view> </view>
<view class="dec"> <view class="dec">
@ -160,10 +161,9 @@
<view class="title-txt"> <view class="title-txt">
{{item.describes}} {{item.describes}}
</view> </view>
<view class="" @click.stop="delService(item)"> <view class="" @click.stop="delService(item)">
<u-icon name="trash" color="#aaaaaa" size="40" <u-icon name="trash" color="#aaaaaa" size="40"
v-if="data.status == 'PECEIVED'" v-if="data.status == 'PECEIVED'"></u-icon>
></u-icon>
</view> </view>
</view> </view>
@ -198,8 +198,7 @@
</view> </view>
<!-- <u-icon name="minus-circle" color="#aaaaaa" size="60" ></u-icon> --> <!-- <u-icon name="minus-circle" color="#aaaaaa" size="60" ></u-icon> -->
</view> </view>
<view class="add-btn" <view class="add-btn" v-if="data.status == 'PENDING' || data.status == 'PECEIVED'">
v-if="data.status == 'PENDING' || data.status == 'PECEIVED'">
<u-button type="primary" @click="addSubForm('creat')"><u-icon name="plus-circle" color="#ffffff" <u-button type="primary" @click="addSubForm('creat')"><u-icon name="plus-circle" color="#ffffff"
size="36"></u-icon>添加维修内容</u-button> size="36"></u-icon>添加维修内容</u-button>
</view> </view>
@ -207,21 +206,26 @@
</view> </view>
</view> </view>
<view class="footer"> <view class="footer">
<view class="btns" v-if="data.status == 'PENDING'"> <view class="btns"
v-if="data.status == 'PENDING'&&auth.hasPermiOr(['eam:device-maintenance-job-main:orderClick','eam:mold-maintenance-job-main:orderClick','eam:tech-maintenance-job-main:orderClick'])">
<u-button type="primary" @click="orderClick(1)" :loading='loading' :disabled='loading'>接单</u-button> <u-button type="primary" @click="orderClick(1)" :loading='loading' :disabled='loading'>接单</u-button>
</view> </view>
<view class="btns" v-if="data.status == 'PECEIVED'"> <view class="btns" v-if="data.status == 'PECEIVED'">
<u-button shape="shape" type="warning" style="min-width: 120rpx;" :loading='loading1' @click="editForm" <u-button shape="shape" type="warning" style="min-width: 120rpx;" :loading='loading1' @click="editForm"
:disabled='loading1'>修改工单</u-button> :disabled='loading1'
<u-button type="primary" @click="orderClickSuccess()" :loading='loading' v-if="auth.hasPermiOr(['eam:device-maintenance-job-main:update','eam:mold-maintenance-job-main:update','eam:tech-maintenance-job-main:update'])">修改工单</u-button>
:disabled='loading'>完成</u-button> <u-button type="primary" @click="orderClickSuccess()" :loading='loading' :disabled='loading'
v-if="auth.hasPermiOr(['eam:device-maintenance-job-main:orderClickFinish','eam:mold-maintenance-job-main:orderClickFinish','eam:tech-maintenance-job-main:orderClickFinish'])">完成</u-button>
</view> </view>
<view class="btns" v-if="(data.status == 'COMPLETED' && !data.requestNumber) || (data.status == 'APPLYPASS')"> <view class="btns"
<u-button type="primary" @click="orderClickVerify()" :loading='loading' :disabled='loading'>验证</u-button> v-if="((data.status == 'COMPLETED' && !data.requestNumber) || (data.status == 'APPLYPASS')) && auth.hasPermiOr(['eam:device-maintenance-job-main:orderClickVerify','eam:mold-maintenance-job-main:orderClickVerify','eam:tech-maintenance-job-main:orderClickVerify'])">
<u-button type="primary" @click="verify()" :loading='loading' :disabled='loading'>验证</u-button>
</view> </view>
<view class="btns" v-if="data.status == 'COMPLETED' && data.requestNumber && data.applyer == store.id"> <view class="btns"
<u-button type="primary" @click="orderClickApply()" :loading='loading' :disabled='loading'>维修确认</u-button> v-if="(data.status == 'COMPLETED' && data.requestNumber && data.applyer == store.id)&&auth.hasPermiOr(['eam:device-maintenance-job-main:orderClickConfirm','eam:mold-maintenance-job-main:orderClickConfirm','eam:tech-maintenance-job-main:orderClickConfirm'])">
<u-button type="primary" @click="orderClickApply()" :loading='loading'
:disabled='loading'>维修确认</u-button>
</view> </view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> <view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view> </view>
@ -237,7 +241,7 @@
</view> </view>
<view class="popup-footer"> <view class="popup-footer">
<view @click="isShowSuccess = false">取消</view> <view @click="isShowSuccess = false">取消</view>
<view class="sure" @click="sure">确认</view> <view class="sure" @click="orderClickFinish">确认</view>
</view> </view>
</u-popup> </u-popup>
@ -245,24 +249,24 @@
<u-popup v-model="isVerifyShowSuccess" mode="center" border-radius="14"> <u-popup v-model="isVerifyShowSuccess" mode="center" border-radius="14">
<view class="popup-title">验证完结意见</view> <view class="popup-title">验证完结意见</view>
<view class="popup"> <view class="popup">
<textarea v-model="data.applyContent" placeholder="请输入内容"></textarea> <textarea v-model="data.applyContent" placeholder="请输入内容"></textarea>
</view> </view>
<view class="popup-footer"> <view class="popup-footer">
<view @click="cancel">取消</view> <view @click="cancel">取消</view>
<view class="sure" @click="verify">确认</view> <view class="sure" @click="orderClickVerify">确认</view>
</view> </view>
</u-popup> </u-popup>
<!-- 维修确认弹出层 --> <!-- 维修确认弹出层 -->
<u-popup v-model="isApplyShowSuccess" mode="center" border-radius="14"> <u-popup v-model="isApplyShowSuccess" mode="center" border-radius="14">
<view class="popup-title">维修确认意见</view> <view class="popup-title">维修确认意见</view>
<view class="popup"> <view class="popup">
<textarea v-model="data.applyContent" placeholder="请输入内容"></textarea> <textarea v-model="data.applyContent" placeholder="请输入内容"></textarea>
</view> </view>
<view class="popup-footer"> <view class="popup-footer">
<view class="sure" @click="apply('APPLYPASS')">通过</view> <view class="sure" @click="orderClickConfirm('APPLYPASS')">通过</view>
<view class="reject" @click="apply('APPLYREJECTED')" style="color: red;">驳回</view> <view class="reject" @click="orderClickConfirm('APPLYREJECTED')" style="color: red;">驳回</view>
</view> </view>
</u-popup> </u-popup>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> <view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
<u-select v-model="singleColumnShow" mode="single-column" :default-value='singleColumnDefaultValue' <u-select v-model="singleColumnShow" mode="single-column" :default-value='singleColumnDefaultValue'
@ -283,6 +287,7 @@
import * as dictApi from "@/api/dict.js" import * as dictApi from "@/api/dict.js"
import * as repairOrderApi from "@/api/repairOrder.js" import * as repairOrderApi from "@/api/repairOrder.js"
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
import auth from '@/plugins/auth'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
// store // store
@ -376,11 +381,11 @@
/** /**
* 点击验证完结填写意见 * 点击验证完结填写意见
*/ */
function orderClickVerify() { function verify() {
data.value.applyContent = null; data.value.applyContent = null;
isVerifyShowSuccess.value = true isVerifyShowSuccess.value = true
} }
function cancel(){ function cancel() {
data.applyContent = null; data.applyContent = null;
isVerifyShowSuccess.value = false isVerifyShowSuccess.value = false
isApplyShowSuccess.value = false isApplyShowSuccess.value = false
@ -389,47 +394,112 @@
function radioGroupChange(e) { function radioGroupChange(e) {
result.value = e result.value = e
} }
function sure() { //
async function orderClickFinish() {
isShowSuccess.value = false isShowSuccess.value = false
orderClick(2) const dataOne = {
number: data.value.number,
status: data.value.status,
id: data.value.id,
result: result.value,
requestNumber: data.value.requestNumber,
content: data.value.applyContent ? data.value.applyContent : ''
}
//
const dataTwo = {
id: data.value && data.value.id ? data.value.id : '',
describes: data.value.describes,
type: data.value.type,
deviceNumber: data.value.deviceNumber,
factoryAreaNumber: data.value.factoryAreaNumber,
classes: data.value.classes,
faultType: data.value.faultType
}
//
await repairOrderApi.repairOrderUpdate(dataTwo, type.value).then((res) => { }).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
})
proxy.$modal.loading('加载中')
loading.value = true
await repairOrderApi.orderClickFinish(dataOne, type.value).then((res) => {
if (res.data) {
proxy.$modal.showToast('操作成功')
setTimeout(() => {
proxy.$tab.navigateBack()
loading.value = false
}, 1500)
} else {
proxy.$modal.showToast('操作失败')
loading.value = false
}
}).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
})
} }
/** /**
* 维修确认 * 维修确认
*/ */
function apply(status) { async function orderClickConfirm() {
isApplyShowSuccess.value = false isApplyShowSuccess.value = false
result.value = status result.value = status
orderClick(3) isShowSuccess.value = false
const dataOne = {
number: data.value.number,
status: data.value.status,
id: data.value.id,
result: result.value,
requestNumber: data.value.requestNumber,
content: data.value.applyContent ? data.value.applyContent : ''
}
//
const dataTwo = {
id: data.value && data.value.id ? data.value.id : '',
describes: data.value.describes,
type: data.value.type,
deviceNumber: data.value.deviceNumber,
factoryAreaNumber: data.value.factoryAreaNumber,
classes: data.value.classes,
faultType: data.value.faultType
}
//
await repairOrderApi.orderClickConfirm(dataTwo).then((res) => { }).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
})
proxy.$modal.confirm('是否完成?').then(async () => {
proxy.$modal.loading('加载中')
loading.value = true
await repairOrderApi.orderClickFinish(dataOne).then((res) => {
if (res.data) {
proxy.$modal.showToast('操作成功')
setTimeout(() => {
proxy.$tab.navigateBack()
loading.value = false
}, 1500)
} else {
proxy.$modal.showToast('操作失败')
loading.value = false
}
}).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
})
})
} }
/** /**
* 验证确认 * 验证确认
*/ */
function verify() { async function orderClickVerify() {
isVerifyShowSuccess.value = false 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 = { const dataOne = {
number: data.value.number, number: data.value.number,
status: data.value.status, status: data.value.status,
id: data.value.id, id: data.value.id,
result: type1 == 2||type1 == 3 ? result.value : '', result: result.value,
requestNumber: data.value.requestNumber, requestNumber: data.value.requestNumber,
content:data.value.applyContent ? data.value.applyContent:'' content: data.value.applyContent ? data.value.applyContent : ''
} }
// //
const dataTwo = { const dataTwo = {
@ -441,80 +511,168 @@
classes: data.value.classes, classes: data.value.classes,
faultType: data.value.faultType 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){ await repairOrderApi.repairOrderUpdate(dataTwo, type.value).then((res) => { }).catch(() => {
// proxy.$modal.closeLoading()
if (data.value.status == 'PECEIVED') { loading.value = false
await repairOrderApi.repairOrderUpdate(dataTwo).then((res) => { }).catch(() => { })
proxy.$modal.closeLoading() proxy.$modal.confirm('是否完成?').then(async () => {
loading.value = false proxy.$modal.loading('加载中')
}) loading.value = true
} await repairOrderApi.orderClickVerify(dataOne, type.value).then((res) => {
proxy.$modal.confirm(tips).then(async () => { if (res.data) {
proxy.$modal.loading('加载中') proxy.$modal.showToast('操作成功')
loading.value = true setTimeout(() => {
await repairOrderApi.orderClick(dataOne).then((res) => { proxy.$tab.navigateBack()
if (res.data) {
proxy.$modal.showToast('操作成功')
setTimeout(() => {
if(type1==3){
// proxy.$tab.navigateTo(`/pages/repairOrder/index?type=${type.value}&flag=2`)
proxy.$tab.navigateBack()
}else{
// proxy.$tab.navigateTo(`/pages/repairOrder/index?type=${type.value}`)
proxy.$tab.navigateBack()
}
loading.value = false
}, 1500)
} else {
proxy.$modal.showToast('操作失败')
loading.value = false loading.value = false
} }, 1500)
}).catch(() => { } else {
proxy.$modal.closeLoading() proxy.$modal.showToast('操作失败')
loading.value = false loading.value = false
})
})
}else{
proxy.$modal.confirm(tips).then(async () => {
proxy.$modal.loading('加载中')
loading.value = true
//
if (data.value.status == 'PECEIVED') {
await repairOrderApi.repairOrderUpdate(dataTwo).then((res) => { }).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
})
} }
await repairOrderApi.orderClick(dataOne).then(async(res) => { }).catch(() => {
if (res.data) { proxy.$modal.closeLoading()
proxy.$modal.showToast('操作成功') loading.value = false
await getDeviceRepairDetail(number.value)
await getDeviceRepairDetailsByNumber()
loading.value = false
// setTimeout(() => {
// // proxy.$tab.navigateBack()
// }, 1500)
} else {
proxy.$modal.showToast('操作失败')
loading.value = false
}
}).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
})
}) })
})
}
// 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(() => {
// 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('操作失败')
loading.value = false
}
}).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
})
})
} }
// //
async function getDeviceRepairDetailsByNumber() { async function getDeviceRepairDetailsByNumber() {
if(data.value.requestNumber){ if (data.value.requestNumber) {
await repairOrderApi.getDeviceRepairDetailsByNumber({ await repairOrderApi.getDeviceRepairDetailsByNumber({
type: type.value, type: type.value,
requestNumber: data.value.requestNumber requestNumber: data.value.requestNumber
}).then((res) => { }, type.value).then((res) => {
if (res.data) { if (res.data) {
data1.value = res.data data1.value = res.data
} }
@ -524,8 +682,8 @@
// //
function getRepairOrderDetaiList() { function getRepairOrderDetaiList() {
repairOrderApi.repairOrderDetailList({ repairOrderApi.repairOrderDetailList({
number: number.value number: number.value,
}).then((res) => { }, type.value).then((res) => {
if (res.data) { if (res.data) {
serviceList.value = res.data serviceList.value = res.data
} }
@ -593,7 +751,7 @@
proxy.$modal.confirm('是否修改维修工单').then(() => { proxy.$modal.confirm('是否修改维修工单').then(() => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
loading1.value = true loading1.value = true
repairOrderApi.repairOrderUpdate(paramesData).then((res) => { repairOrderApi.repairOrderUpdate(paramesData, type.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data) { if (res.data) {
proxy.$modal.showToast('修改成功') proxy.$modal.showToast('修改成功')
@ -611,11 +769,29 @@
}) })
}) })
} }
async function getDeviceRepairDetail(number){ async function getDeviceRepairDetail(number) {
await repairOrderApi.getDeviceRepairDetail(number).then((res) => { await repairOrderApi.getDeviceRepairDetail(number,type.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
data.value = res.data data.value = res.data
if (res.data) { if (data.value.requestNumber) {
list.value = [{
name: '设备信息',
value: 1
}, {
name: '报修信息',
value: 2
}, {
name: '维修内容',
value: 3
}]
} else {
list.value = [{
name: '设备信息',
value: 1
}, {
name: '维修内容',
value: 3
}]
} }
loading.value = false loading.value = false
}).catch(() => { }).catch(() => {
@ -637,27 +813,7 @@
}) })
onShow(async () => { onShow(async () => {
if (number.value) {
list.value = [{
name: '设备信息',
value: 1
}, {
name: '报修信息',
value: 2
}, {
name: '维修内容',
value: 3
}]
} else {
list.value = [{
name: '设备信息',
value: 1
}, {
name: '维修内容',
value: 3
}]
}
getRepairOrderDetaiList() getRepairOrderDetaiList()
maintenanceShift.value = await dictApi.getDict('maintenance_shift') maintenanceShift.value = await dictApi.getDict('maintenance_shift')
faultType.value = await dictApi.getDict('fault_type') faultType.value = await dictApi.getDict('fault_type')

9
src/pages/repairOrder/index.vue

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

9
src/pages/sparePartsApplication/detail.vue

@ -36,10 +36,10 @@
</view> </view>
</view> </view>
</view> </view>
<view class="footer" v-if="from == 3"> <view class="footer" v-if="from == 3 || from == 2">
<view class="btns"> <view class="btns">
<button class="reset" @click="reject">驳回</button> <button class="reset" @click="reject" v-if="auth.hasPermiOr(['eam:item-apply-request-main:role0','eam:item-apply-request-main:role1'])">驳回</button>
<button class="sure" @click="agree" :loading='loading' :disabled='loading'>通过</button> <button class="sure" @click="agree" :loading='loading' :disabled='loading' v-if="auth.hasPermiOr(['eam:item-apply-request-main:role0','eam:item-apply-request-main:role1'])">通过</button>
</view> </view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> <view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view> </view>
@ -56,13 +56,14 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import auth from '@/plugins/auth'
import * as sparePartsApplicationApi from "@/api/sparePartsApplication.js" import * as sparePartsApplicationApi from "@/api/sparePartsApplication.js"
import * as sparePartsApplicationApproveApi from "@/api/sparePartsApplicationApprove.js" import * as sparePartsApplicationApproveApi from "@/api/sparePartsApplicationApprove.js"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const number = ref('') const number = ref('')
const data = ref({}) const data = ref({})
const loading = ref(false) const loading = ref(false)
const from = ref()//13 const from = ref()//123
const type = ref() const type = ref()
function getSparePartsApplicationDetail() { function getSparePartsApplicationDetail() {
sparePartsApplicationApi.sparePartsApplicationDetail(number.value).then((res) => { sparePartsApplicationApi.sparePartsApplicationDetail(number.value).then((res) => {

3
src/pages/sparePartsApplication/index.vue

@ -4,7 +4,7 @@
<u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff' <u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff'
title="备件领用申请"> title="备件领用申请">
<template v-slot:right> <template v-slot:right>
<u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm"></u-icon> <u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm" v-if="auth.hasPermiOr(['eam:item-apply-request-main:create'])"></u-icon>
</template> </template>
</u-navbar> </u-navbar>
<!-- <Search @search='search' @screen='screen' /> --> <!-- <Search @search='search' @screen='screen' /> -->
@ -62,6 +62,7 @@
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as sparePartsApplicationApi from "@/api/sparePartsApplication.js" import * as sparePartsApplicationApi from "@/api/sparePartsApplication.js"
import auth from '@/plugins/auth'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const params = ref({ const params = ref({
pageNo: 1, pageNo: 1,

51
src/pages/sparePartsApplicationApprove/index.vue

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

100
src/pages/spotCheckOrder/addForm.vue

@ -6,8 +6,8 @@
<u-input v-model="form.describes" placeholder="请输入点检描述" /> <u-input v-model="form.describes" placeholder="请输入点检描述" />
</u-form-item> </u-form-item>
<u-form-item :label="`${type=='DEVICE'?'设备' : '模具'}编码`" prop="deviceNumber" required> <u-form-item :label="`${type=='DEVICE'?'设备' : '模具'}编码`" prop="deviceNumber" required>
<u-input v-model="form.deviceNumber" <u-input v-model="form.deviceNumber" :placeholder="`请输入${type=='DEVICE'?'设备' : '模具'}编码`" @blur="blur"
:placeholder="`请输入${type=='DEVICE'?'设备' : '模具'}编码`" @blur="blur" @confirm='blur()'/> @confirm='blur()' />
<view class="right-button" @click="chickRightButton"> <view class="right-button" @click="chickRightButton">
扫描 扫描
</view> </view>
@ -50,9 +50,9 @@
<view>{{item.equipmentParts}}</view> <view>{{item.equipmentParts}}</view>
</view> </view>
<view class="dec"> <view class="dec">
<!-- <view style="margin-right: 20rpx;">是否符合:</view><u-switch v-model="item.isConform1"></u-switch> --> <!-- <view style="margin-right: 20rpx;">是否符合:</view><u-switch v-model="item.isConform1"></u-switch> -->
<u-radio-group v-model="item.isConform" @change="radioGroupChange"> <u-radio-group v-model="item.isConform" @change="radioGroupChange">
<!-- <u-radio <!-- <u-radio
@change="radioChange" @change="radioChange"
v-for="(item, index) in list" :key="index" v-for="(item, index) in list" :key="index"
:name="item.name" :name="item.name"
@ -60,9 +60,9 @@
> >
{{item.name}} {{item.name}}
</u-radio> --> </u-radio> -->
<u-radio name="TRUE">符合</u-radio> <u-radio name="TRUE">符合</u-radio>
<u-radio name="FALSE">不符合</u-radio> <u-radio name="FALSE">不符合</u-radio>
</u-radio-group> </u-radio-group>
</view> </view>
@ -109,25 +109,25 @@
const loading = ref(false) const loading = ref(false)
const type = ref('') const type = ref('')
const list = ref([{ const list = ref([{
name: 'apple', name: 'apple',
disabled: false disabled: false
}, },
{ {
name: 'banner', name: 'banner',
disabled: false disabled: false
}, },
{ {
name: 'orange', name: 'orange',
disabled: false disabled: false
}]) }])
const form = ref({ const form = ref({
describes: "", describes: "",
deviceNumber: '', deviceNumber: '',
deviceName: '', deviceName: '',
maintenances:'', maintenances: '',
classes: '', classes: '',
classesName:'' classesName: ''
}) })
const singleColumnShow = ref(false) const singleColumnShow = ref(false)
const singleColumnDefaultValue = ref([]) const singleColumnDefaultValue = ref([])
@ -138,7 +138,7 @@
// //
function chickRightButton(field) { function chickRightButton(field) {
uni.scanCode({ uni.scanCode({
success: function(res) { success: function (res) {
form.value.deviceNumber = res.result form.value.deviceNumber = res.result
getDetailsByNumber() getDetailsByNumber()
getSubList() getSubList()
@ -154,25 +154,25 @@
// / // /
function getDetailsByNumber() { function getDetailsByNumber() {
const data = { const data = {
number:form.value.deviceNumber, number: form.value.deviceNumber,
flag:2 flag: 2
} }
if(type.value=='MOLD'){ if (type.value == 'MOLD') {
moldApi.getMoldDetailsByNumber(data).then((res) => { moldApi.getMoldDetailsByNumber(data).then((res) => {
if (res.data) { if (res.data) {
form.value.deviceName = res.data.name form.value.deviceName = res.data.name
} else { } else {
proxy.$modal.showToast(`找不到该${type.value=='DEVICE'?'设备' : '模具'}`) proxy.$modal.showToast(`找不到该${type.value == 'DEVICE' ? '设备' : '模具'}`)
} }
}).catch(()=>{}) }).catch(() => { })
}else{ } else {
deviceApi.getDeviceDetailsByNumber(data).then((res) => { deviceApi.getDeviceDetailsByNumber(data).then((res) => {
if (res.data) { if (res.data) {
form.value.deviceName = res.data.name form.value.deviceName = res.data.name
} else { } else {
proxy.$modal.showToast(`找不到该${type.value=='DEVICE'?'设备' : '模具'}`) proxy.$modal.showToast(`找不到该${type.value == 'DEVICE' ? '设备' : '模具'}`)
} }
}).catch(()=>{}) }).catch(() => { })
} }
} }
@ -184,13 +184,13 @@
deviceApi.getSubList(data).then((res) => { deviceApi.getSubList(data).then((res) => {
if (res.data) { if (res.data) {
subList.value = res.data subList.value = res.data
subList.value.forEach(item=>{ subList.value.forEach(item => {
item.isConform = 'TRUE' item.isConform = 'TRUE'
}) })
} else { } else {
proxy.$modal.showToast(`找不到该${type.value=='DEVICE'?'设备' : '模具'}`) proxy.$modal.showToast(`找不到该${type.value == 'DEVICE' ? '设备' : '模具'}`)
} }
}).catch(()=>{}) }).catch(() => { })
} }
// //
function submit() { function submit() {
@ -200,14 +200,14 @@
return; return;
} }
if (!form.value.deviceNumber) { if (!form.value.deviceNumber) {
proxy.$modal.showToast(`请输入${type.value=='DEVICE'?'设备' : '模具'}编码`) proxy.$modal.showToast(`请输入${type.value == 'DEVICE' ? '设备' : '模具'}编码`)
return; return;
} }
if (!form.value.classes) { if (!form.value.classes) {
proxy.$modal.showToast('请选择班次') proxy.$modal.showToast('请选择班次')
return; return;
} }
if (subList.value.length==0) { if (subList.value.length == 0) {
proxy.$modal.showToast('该设备无检修项目') proxy.$modal.showToast('该设备无检修项目')
return; return;
} }
@ -215,17 +215,17 @@
// item.isConform = !item.isConform1 ? 'FALSE' : 'TRUE' // item.isConform = !item.isConform1 ? 'FALSE' : 'TRUE'
// }) // })
const data = { const data = {
describes:form.value.describes, describes: form.value.describes,
deviceNumber:form.value.deviceNumber, deviceNumber: form.value.deviceNumber,
maintenances: form.value.maintenances, maintenances: form.value.maintenances,
classes:form.value.classes, classes: form.value.classes,
subList:subList.value, subList: subList.value,
type: type.value type: type.value
} }
proxy.$modal.confirm('是否添加点检工单').then(() => { proxy.$modal.confirm('是否添加点检工单').then(() => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
loading.value = true loading.value = true
spotCheckOrderApi.spotCheckOrderCreate(data).then((res) => { spotCheckOrderApi.spotCheckOrderCreate(data, type.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data) { if (res.data) {
proxy.$modal.showToast('添加成功') proxy.$modal.showToast('添加成功')
@ -234,9 +234,9 @@
loading.value = false loading.value = false
}, 1500) }, 1500)
} else { } else {
if(res.msg){ if (res.msg) {
proxy.$modal.showToast(res.msg) proxy.$modal.showToast(res.msg)
}else{ } else {
proxy.$modal.showToast('添加失败') proxy.$modal.showToast('添加失败')
} }
loading.value = false loading.value = false
@ -254,7 +254,7 @@
describes: "", describes: "",
deviceNumber: '', deviceNumber: '',
deviceName: '', deviceName: '',
maintenances:'', maintenances: '',
classes: '' classes: ''
} }
} }
@ -273,21 +273,20 @@
// //
function chooseSingleColumn(e) { function chooseSingleColumn(e) {
form.value[field.value] = e[0].value form.value[field.value] = e[0].value
if(field.value == 'classes'){ if (field.value == 'classes') {
form.value.classesName = e[0].label form.value.classesName = e[0].label
} }
singleColumnShow.value = false singleColumnShow.value = false
} }
onLoad(async (option) => { onLoad(async (option) => {
if (option.type) type.value = option.type; if (option.type) type.value = option.type;
maintenanceShift.value = await dictApi.getDict('maintenance_shift') maintenanceShift.value = await dictApi.getDict('maintenance_shift')
form.value.maintenances = uni.getStorageSync('user').nickname form.value.maintenances = uni.getStorageSync('user').nickname
}) })
function radioGroupChange(e) { function radioGroupChange(e) {
console.log(e); console.log(e);
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -307,6 +306,7 @@
.list { .list {
padding: 30rpx 30rpx; padding: 30rpx 30rpx;
.item { .item {
display: flex; display: flex;
margin-bottom: 20rpx; margin-bottom: 20rpx;

61
src/pages/spotCheckOrder/detail.vue

@ -3,7 +3,7 @@
<view class="detail-container"> <view class="detail-container">
<view class="info"> <view class="info">
<view class="title"> <view class="title">
<view>点检工单</view> <view>点检工单</view>
</view> </view>
<view class="dec"> <view class="dec">
@ -94,16 +94,18 @@
</view> </view>
</view> </view>
<view class="footer"> <view class="footer">
<view class="btns" v-if="(data.status == 'COMPLETED' || data.status =='APPLYPASS' || 'APPLYREJECTED')"> <view class="btns"
<u-button type="primary" @click="orderClickVerify()" :loading='loading' :disabled='loading'>审核</u-button> v-if="(data.status == 'COMPLETED' || data.status =='APPLYPASS' || data.status =='APPLYREJECTED')&& auth.hasPermiOr(['eam:device-spot-inspection-record-main:orderClickVerify','eam:mold-spot-inspection-record-main:orderClickVerify','eam:tech-spot-inspection-record-main:orderClickVerify'])">
<u-button type="primary" @click="orderClickVerify()" :loading='loading'
:disabled='loading'>验证</u-button>
</view> </view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> <view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view> </view>
<!-- 验证完结--> <!-- 验证完结-->
<u-popup v-model="isVerifyShowSuccess" mode="center" border-radius="14"> <u-popup v-model="isVerifyShowSuccess" mode="center" border-radius="14">
<view class="popup-title">审核意见</view> <view class="popup-title">意见</view>
<view class="popup"> <view class="popup">
<textarea v-model="data.applyContent" placeholder="请输入内容"></textarea> <textarea v-model="data.applyContent" placeholder="请输入内容"></textarea>
</view> </view>
<view class="popup-footer"> <view class="popup-footer">
<view class="sure" @click="apply('APPROVEPASS')">通过</view> <view class="sure" @click="apply('APPROVEPASS')">通过</view>
@ -131,6 +133,7 @@
import * as repairOrderApi from "@/api/repairOrder.js" import * as repairOrderApi from "@/api/repairOrder.js"
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
import * as spotCheckOrderApi from "@/api/spotCheckOrder.js" import * as spotCheckOrderApi from "@/api/spotCheckOrder.js"
import auth from '@/plugins/auth'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
// store // store
@ -198,7 +201,7 @@
data.value.applyContent = null; data.value.applyContent = null;
isVerifyShowSuccess.value = true isVerifyShowSuccess.value = true
} }
function cancel(){ function cancel() {
data.applyContent = null; data.applyContent = null;
isVerifyShowSuccess.value = false isVerifyShowSuccess.value = false
isApplyShowSuccess.value = false isApplyShowSuccess.value = false
@ -235,33 +238,31 @@
id: data.value.id, id: data.value.id,
approveOpinion: data.value.applyContent approveOpinion: data.value.applyContent
} }
let tips ='是否确认提交' let tips = '是否确认提交'
proxy.$modal.confirm(tips).then(async () => { proxy.$modal.loading('加载中')
proxy.$modal.loading('加载中') loading.value = true
loading.value = true await spotCheckOrderApi.orderClickVerify(dataOne, type.value).then((res) => {
await spotCheckOrderApi.orderClickApprove(dataOne).then((res) => { if (res.data) {
if (res.data) { proxy.$modal.showToast('操作成功')
proxy.$modal.showToast('操作成功') setTimeout(() => {
setTimeout(() => { proxy.$tab.navigateBack()
proxy.$tab.navigateBack()
loading.value = false
}, 1500)
} else {
proxy.$modal.showToast('操作失败')
loading.value = false loading.value = false
} }, 1500)
}).catch(() => { } else {
proxy.$modal.closeLoading() proxy.$modal.showToast('操作失败')
loading.value = false loading.value = false
}) }
}).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
}) })
} }
async function getDeviceRepairDetail(number){ async function getDeviceRepairDetail(number) {
await repairOrderApi.getDeviceRepairDetail(number).then((res) => { await repairOrderApi.getDeviceRepairDetail(number, type.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
data.value = res.data data.value = res.data
if (res.data) { if (res.data) {
} }
loading.value = false loading.value = false
@ -289,7 +290,7 @@
if (number.value) { if (number.value) {
list.value = [{ list.value = [{
name: type.value=='MOLD'?'模具信息':'设备信息', name: type.value == 'MOLD' ? '模具信息' : '设备信息',
value: 1 value: 1
}, { }, {
name: '点检项内容', name: '点检项内容',
@ -297,7 +298,7 @@
}] }]
} else { } else {
list.value = [{ list.value = [{
name: type.value=='MOLD'?'模具信息':'设备信息', name: type.value == 'MOLD' ? '模具信息' : '设备信息',
value: 1 value: 1
}, { }, {
name: '点检项内容', name: '点检项内容',
@ -311,11 +312,11 @@
const data = { const data = {
number: number.value number: number.value
} }
spotCheckOrderApi.selectListByNumber(data).then((res) => { spotCheckOrderApi.selectListByNumber(data, type.value).then((res) => {
if (res.data) { if (res.data) {
subList.value = res.data subList.value = res.data
} }
}).catch(()=>{}) }).catch(() => { })
} }
</script> </script>

5
src/pages/spotCheckOrder/index.vue

@ -4,7 +4,7 @@
<u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff' <u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff'
title="点检工单"> title="点检工单">
<template v-slot:right> <template v-slot:right>
<u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm"></u-icon> <u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm" v-if="auth.hasPermiOr(['eam:device-spot-inspection-record-main:create','eam:mold-spot-inspection-record-main:create','eam:tech-spot-inspection-record-main:create'])"></u-icon>
</template> </template>
</u-navbar> </u-navbar>
<view class="list"> <view class="list">
@ -70,6 +70,7 @@
getCurrentInstance, getCurrentInstance,
nextTick nextTick
} from 'vue' } from 'vue'
import auth from '@/plugins/auth'
import * as spotCheckOrderApi from "@/api/spotCheckOrder.js" import * as spotCheckOrderApi from "@/api/spotCheckOrder.js"
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
@ -94,7 +95,7 @@
if (status.value == 'nomore') return; if (status.value == 'nomore') return;
status.value = 'loading'; status.value = 'loading';
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
await spotCheckOrderApi.spotCheckOrderPage(params.value).then((res) => { await spotCheckOrderApi.spotCheckOrderPage(params.value,params.value.type).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
list.value = list.value.concat(res.data.list); list.value = list.value.concat(res.data.list);

4
src/pages/upkeepOrder/addServiceRecord.vue

@ -256,7 +256,7 @@ const form = ref({
proxy.$modal.confirm('是否修改保养内容').then(() => { proxy.$modal.confirm('是否修改保养内容').then(() => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
loading.value = true loading.value = true
upkeepOrderApi.upkeepOrderDetailUpdate(form.value).then((res) => { upkeepOrderApi.upkeepOrderDetailUpdate(form.value,type.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data) { if (res.data) {
proxy.$modal.showToast('修改成功') proxy.$modal.showToast('修改成功')
@ -281,7 +281,7 @@ const form = ref({
proxy.$modal.confirm('是否添加保养内容').then(() => { proxy.$modal.confirm('是否添加保养内容').then(() => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
loading.value = true loading.value = true
upkeepOrderApi.upkeepOrderDetailCreate(form.value).then((res) => { upkeepOrderApi.upkeepOrderDetailCreate(form.value,type.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data) { if (res.data) {
proxy.$modal.showToast('添加成功') proxy.$modal.showToast('添加成功')

265
src/pages/upkeepOrder/detail.vue

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

2
src/pages/upkeepOrder/index.vue

@ -80,7 +80,7 @@
if (status.value == 'nomore') return; if (status.value == 'nomore') return;
status.value = 'loading'; status.value = 'loading';
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
await upkeepOrderApi.upkeepOrderPage(params.value).then((res) => { await upkeepOrderApi.upkeepOrderPage(params.value,params.value.type).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
list.value = list.value.concat(res.data.list); list.value = list.value.concat(res.data.list);

10
src/plugins/auth.js

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

5
src/plugins/index.js

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

32
src/store/modules/countStore.ts

@ -23,6 +23,7 @@ const useStore = defineStore('storeId', {
deviceMenus: [], deviceMenus: [],
moldMenus: [], moldMenus: [],
thchMenus: [], thchMenus: [],
meaus:[]
}), }),
getters: { getters: {
// isEven: (state) => state.count % 2 === 0 // isEven: (state) => state.count % 2 === 0
@ -67,21 +68,22 @@ const useStore = defineStore('storeId', {
} }
}) })
if (menus.filter(item => item.path == 'device') && menus.filter(item => item.path == 'device').length > 0) { // 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 // this.deviceMenus = menus.filter(item => item.path == 'device')[0].children
} else { // } else {
this.deviceMenus = [] // this.deviceMenus = []
} // }
if (menus.filter(item => item.path == 'mold') && menus.filter(item => item.path == 'mold').length > 0) { // 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 // this.moldMenus = menus.filter(item => item.path == 'mold')[0].children
} else { // } else {
this.moldMenus = [] // this.moldMenus = []
} // }
if (menus.filter(item => item.path != 'device' && item.path != 'mold') && menus.filter(item => item.path != 'device' && item.path != 'mold').length > 0) { // 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') // this.thchMenus = menus.filter(item => item.path != 'device' && item.path != 'mold')
} else { // } else {
this.thchMenus = [] // this.thchMenus = []
} // }
this.meaus = menus
} else { } else {
this.roles = [] this.roles = []

Loading…
Cancel
Save