Browse Source

fix: 权限问题

master
zhang_li 7 months ago
parent
commit
904a92b025
  1. 4
      .env.production
  2. 1
      src/App.vue
  3. 12
      src/api/device.js
  4. 80
      src/api/overhaulOrder.js
  5. 121
      src/api/repairOrder.js
  6. 33
      src/api/report.js
  7. 7
      src/api/sparePartsApplicationApprove.js
  8. 50
      src/api/spotCheckOrder.js
  9. 80
      src/api/upkeepOrder.js
  10. 7
      src/main.ts
  11. 25
      src/pages/deviceReport/addForm.vue
  12. 42
      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. 73
      src/pages/overhaulOrder/detail.vue
  18. 5
      src/pages/overhaulOrder/index.vue
  19. 30
      src/pages/repairOrder/addForm.vue
  20. 4
      src/pages/repairOrder/addServiceRecord.vue
  21. 348
      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. 27
      src/pages/sparePartsApplicationApprove/index.vue
  26. 8
      src/pages/spotCheckOrder/addForm.vue
  27. 17
      src/pages/spotCheckOrder/detail.vue
  28. 5
      src/pages/spotCheckOrder/index.vue
  29. 4
      src/pages/upkeepOrder/addServiceRecord.vue
  30. 91
      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_IMAGE=http://10.62.139.32:81/api/admin-api
VITE_BASE_URL=http://dev.ccwin-in.com:25210/admin-api
VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25210/admin-api

1
src/App.vue

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

12
src/api/device.js

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

80
src/api/overhaulOrder.js

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

121
src/api/repairOrder.js

@ -2,51 +2,144 @@ import http from './http'
// 添加工单
export function repairOrderCreate(data) {
export function repairOrderCreate(data,type) {
if (type == 'DEVICE') {
return http.post('/eam/device-maintenance-job-main/create', data)
} else if (type == 'MOLD') {
return http.post('/eam/mold-maintenance-job-main/create', data)
} else if (type == 'TECH') {
return http.post('/eam/tech-maintenance-job-main/create', data)
}
}
// 编辑工单
export function repairOrderUpdate(data) {
export function repairOrderUpdate(data,type) {
if (type == 'DEVICE') {
return http.put('/eam/device-maintenance-job-main/update', data)
} else if (type == 'MOLD') {
return http.put('/eam/mold-maintenance-job-main/update', data)
} else if (type == 'TECH') {
return http.put('/eam/tech-maintenance-job-main/update', data)
}
}
// 工单列表
export function repairOrderPage(params) {
export function repairOrderPage(params,type) {
if (type == 'DEVICE') {
return http.get('/eam/device-maintenance-job-main/getAppPage', {params})
} else if (type == 'MOLD') {
return http.get('/eam/mold-maintenance-job-main/getAppPage', {params})
} else if (type == 'TECH') {
return http.get('/eam/tech-maintenance-job-main/getAppPage', {params})
}
}
// 获取维修工单详情信息
export function getDeviceRepairDetail(number) {
export function getDeviceRepairDetail(number,type) {
if (type == 'DEVICE') {
return http.get('eam/device-maintenance-job-main/getAppByNumber?number=' + number)
} else if (type == 'MOLD') {
return http.get('eam/mold-maintenance-job-main/getAppByNumber?number=' + number)
} else if (type == 'TECH') {
return http.get('eam/tech-maintenance-job-main/getAppByNumber?number=' + number)
}
// 操作工单
export function orderClick(params) {
}
// 接单
export function orderClick(params,type) {
if (type == 'DEVICE') {
return http.get('/eam/device-maintenance-job-main/orderClick', {params})
} else if (type == 'MOLD') {
return http.get('/eam/mold-maintenance-job-main/orderClick', {params})
} else if (type == 'TECH') {
return http.get('/eam/tech-maintenance-job-main/orderClick', {params})
}
}
// 完成
export function orderClickFinish(params,type) {
if (type == 'DEVICE') {
return http.get('/eam/device-maintenance-job-main/orderClickFinish', {params})
} else if (type == 'MOLD') {
return http.get('/eam/mold-maintenance-job-main/orderClickFinish', {params})
} else if (type == 'TECH') {
return http.get('/eam/tech-maintenance-job-main/orderClickFinish', {params})
}
}
// 确认
export function orderClickConfirm(params,type) {
if (type == 'DEVICE') {
return http.get('/eam/device-maintenance-job-main/orderClickConfirm', {params})
} else if (type == 'MOLD') {
return http.get('/eam/mold-maintenance-job-main/orderClickConfirm', {params})
} else if (type == 'TECH') {
return http.get('/eam/tech-maintenance-job-main/orderClickConfirm', {params})
}
}
// 验证
export function orderClickVerify(params,type) {
if (type == 'DEVICE') {
return http.get('/eam/device-maintenance-job-main/orderClickVerify', {params})
} else if (type == 'MOLD') {
return http.get('/eam/mold-maintenance-job-main/orderClickVerify', {params})
} else if (type == 'TECH') {
return http.get('/eam/tech-maintenance-job-main/orderClickVerify', {params})
}
}
// 添加维修工单子项维修内容
export function repairOrderDetailCreate(data) {
export function repairOrderDetailCreate(data,type) {
if (type == 'DEVICE') {
return http.post('/eam/device-maintenance-job-detail/create', data)
} else if (type == 'MOLD') {
return http.post('/eam/mold-maintenance-job-detail/create', data)
} else if (type == 'TECH') {
return http.post('/eam/tech-maintenance-job-detail/create', data)
}
}
// 编辑维修工单子项维修内容
export function repairOrderDetailUpdate(data) {
export function repairOrderDetailUpdate(data,type) {
if (type == 'DEVICE') {
return http.put('/eam/device-maintenance-job-detail/update', data)
} else if (type == 'MOLD') {
return http.put('/eam/mold-maintenance-job-detail/update', data)
} else if (type == 'TECH') {
return http.put('/eam/tech-maintenance-job-detail/update', data)
}
}
// 获得维修工单子列表
export function repairOrderDetailList(params) {
export function repairOrderDetailList(params,type) {
if (type == 'DEVICE') {
return http.get('/eam/device-maintenance-job-detail/selectListByNumber', {params})
} else if (type == 'MOLD') {
return http.get('/eam/mold-maintenance-job-detail/selectListByNumber', {params})
} else if (type == 'TECH') {
return http.get('/eam/tech-maintenance-job-detail/selectListByNumber', {params})
}
}
// 删除维修工单子
export function repairOrderDetailDelete(id) {
export function repairOrderDetailDelete(id,type) {
if (type == 'DEVICE') {
return http.delete('/eam/device-maintenance-job-detail/delete?id=' + id)
} else if (type == 'MOLD') {
return http.delete('/eam/mold-maintenance-job-detail/delete?id=' + id)
} else if (type == 'TECH') {
return http.delete('/eam/tech-maintenance-job-detail/delete?id=' + id)
}
}
//转办
export function transfer(params) {
export function transfer(params,type) {
if (type == 'DEVICE') {
return http.get('/eam/device-maintenance-job-main/turnTo', {params})
} else if (type == 'MOLD') {
return http.get('/eam/mold-maintenance-job-main/turnTo', {params})
} else if (type == 'TECH') {
return http.get('/eam/tech-maintenance-job-main/turnTo', {params})
}
}
// 获取采取临时措施的维修工单
export function repairOrderList(params) {
return http.get('/eam/device-maintenance-job-main/getList',{params})
return http.get('/eam/device-maintenance-job-main/getList', {
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'
// 备件领用审批列表
// 备件一级审批领用审批列表
export function sparePartsApplicationApprovePage(params) {
return http.get('/eam/item-apply-request-main/getAppApprovePage',{params})
}
// 备件二级审批领用审批列表
export function sparePartsApplicationApprovePage1(params) {
return http.get('/eam/item-apply-request-main/getAppApprovePage1',{params})
}
// 通过申请
export function sparePartsApplicationAgree(id) {
return http.get('/eam/item-apply-request-main/agree?id='+id)

50
src/api/spotCheckOrder.js

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

80
src/api/upkeepOrder.js

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

7
src/main.ts

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

25
src/pages/deviceReport/addForm.vue

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

42
src/pages/deviceReport/index.vue

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

206
src/pages/index.vue

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

20
src/pages/login.vue

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

4
src/pages/overhaulOrder/addForm.vue

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

4
src/pages/overhaulOrder/addServiceRecord.vue

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

73
src/pages/overhaulOrder/detail.vue

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

5
src/pages/overhaulOrder/index.vue

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

30
src/pages/repairOrder/addForm.vue

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

4
src/pages/repairOrder/addServiceRecord.vue

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

348
src/pages/repairOrder/detail.vue

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

9
src/pages/repairOrder/index.vue

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

9
src/pages/sparePartsApplication/detail.vue

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

3
src/pages/sparePartsApplication/index.vue

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

27
src/pages/sparePartsApplicationApprove/index.vue

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

8
src/pages/spotCheckOrder/addForm.vue

@ -6,8 +6,8 @@
<u-input v-model="form.describes" placeholder="请输入点检描述" />
</u-form-item>
<u-form-item :label="`${type=='DEVICE'?'设备' : '模具'}编码`" prop="deviceNumber" required>
<u-input v-model="form.deviceNumber"
:placeholder="`请输入${type=='DEVICE'?'设备' : '模具'}编码`" @blur="blur" @confirm='blur()'/>
<u-input v-model="form.deviceNumber" :placeholder="`请输入${type=='DEVICE'?'设备' : '模具'}编码`" @blur="blur"
@confirm='blur()' />
<view class="right-button" @click="chickRightButton">
扫描
</view>
@ -225,7 +225,7 @@
proxy.$modal.confirm('是否添加点检工单').then(() => {
proxy.$modal.loading('加载中')
loading.value = true
spotCheckOrderApi.spotCheckOrderCreate(data).then((res) => {
spotCheckOrderApi.spotCheckOrderCreate(data, type.value).then((res) => {
proxy.$modal.closeLoading()
if (res.data) {
proxy.$modal.showToast('添加成功')
@ -287,7 +287,6 @@
function radioGroupChange(e) {
console.log(e);
}
</script>
<style lang="scss" scoped>
@ -307,6 +306,7 @@
.list {
padding: 30rpx 30rpx;
.item {
display: flex;
margin-bottom: 20rpx;

17
src/pages/spotCheckOrder/detail.vue

@ -94,14 +94,16 @@
</view>
</view>
<view class="footer">
<view class="btns" v-if="(data.status == 'COMPLETED' || data.status =='APPLYPASS' || 'APPLYREJECTED')">
<u-button type="primary" @click="orderClickVerify()" :loading='loading' :disabled='loading'>审核</u-button>
<view class="btns"
v-if="(data.status == 'COMPLETED' || 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 style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
<!-- 验证完结-->
<u-popup v-model="isVerifyShowSuccess" mode="center" border-radius="14">
<view class="popup-title">审核意见</view>
<view class="popup-title">意见</view>
<view class="popup">
<textarea v-model="data.applyContent" placeholder="请输入内容"></textarea>
</view>
@ -131,6 +133,7 @@
import * as repairOrderApi from "@/api/repairOrder.js"
import { useCountStore } from '@/store'
import * as spotCheckOrderApi from "@/api/spotCheckOrder.js"
import auth from '@/plugins/auth'
const { proxy } = getCurrentInstance()
// store
@ -236,10 +239,9 @@
approveOpinion: data.value.applyContent
}
let tips = '是否确认提交'
proxy.$modal.confirm(tips).then(async () => {
proxy.$modal.loading('加载中')
loading.value = true
await spotCheckOrderApi.orderClickApprove(dataOne).then((res) => {
await spotCheckOrderApi.orderClickVerify(dataOne, type.value).then((res) => {
if (res.data) {
proxy.$modal.showToast('操作成功')
setTimeout(() => {
@ -254,12 +256,11 @@
proxy.$modal.closeLoading()
loading.value = false
})
})
}
async function getDeviceRepairDetail(number) {
await repairOrderApi.getDeviceRepairDetail(number).then((res) => {
await repairOrderApi.getDeviceRepairDetail(number, type.value).then((res) => {
proxy.$modal.closeLoading()
data.value = res.data
if (res.data) {
@ -311,7 +312,7 @@
const data = {
number: number.value
}
spotCheckOrderApi.selectListByNumber(data).then((res) => {
spotCheckOrderApi.selectListByNumber(data, type.value).then((res) => {
if (res.data) {
subList.value = res.data
}

5
src/pages/spotCheckOrder/index.vue

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

4
src/pages/upkeepOrder/addServiceRecord.vue

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

91
src/pages/upkeepOrder/detail.vue

@ -103,7 +103,9 @@
</view>
<view class="dec2">
<view>完成情况</view>
<view>{{item.status===0 || item.status === '0'? '完成':item.status===1 ||item.status === '1'?'未完成':''}}</view>
<view>
{{item.status===0 || item.status === '0'? '完成':item.status===1 ||item.status === '1'?'未完成':''}}
</view>
</view>
<view class="dec2" v-if='item.status === 0 || item.status === "0"'>
<view>完成时间</view>
@ -139,12 +141,15 @@
</view>
<view class="footer">
<view class="btns">
<u-button type="primary" v-if="data.status == 'PENDING'" @click="orderClick(1)" :loading='loading'
:disabled='loading'>接单</u-button>
<u-button type="primary" v-if="data.status == 'PECEIVED'" @click="orderClick(2)" :loading='loading'
:disabled='loading'>完成</u-button>
<u-button type="primary" v-if="data.status == 'COMPLETED'" @click="orderClickVerify()" :loading='loading'
:disabled='loading'>验证</u-button>
<u-button type="primary"
v-if="data.status == 'PENDING' && auth.hasPermiOr(['eam:device-maintain-job-main:orderClick','eam:mold-maintain-job-main:orderClick','eam:tech-maintain-job-main:orderClick'])"
@click="orderClick()" :loading='loading' :disabled='loading'>接单</u-button>
<u-button type="primary"
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'])"
@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 style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
@ -157,7 +162,7 @@
</view>
<view class="popup-footer">
<view @click="cancel">取消</view>
<view class="sure" @click="verify">确认</view>
<view class="sure" @click="orderClickVerify">确认</view>
</view>
</u-popup>
</view>
@ -174,6 +179,7 @@
} from 'vue'
import * as moldApi from "@/api/mold.js"
import * as upkeepOrderApi from "@/api/upkeepOrder.js"
import auth from '@/plugins/auth'
const { proxy } = getCurrentInstance()
const list = ref([{
name: '设备信息'
@ -219,24 +225,14 @@
proxy.$modal.showToast('没有保养内容')
return;
}
let tips = data.value.status == 'PENDING' ? '是否接单?' : data.value.status == 'PECEIVED' ? '是否完成?' : data.value.status == 'COMPLETED' ? '是否验证完结?' :''
// if(type == 2){
// isTrue.value = serviceList.value.some(item=>item.items.length == 0)
// if(isTrue.value){
// proxy.$modal.showToast('')
// return;
// }
// }
const paramsData = {
id: data.value.id,
verifyContent: data.value.applyContent
}
proxy.$modal.confirm(tips).then(() => {
proxy.$modal.confirm('是否接单?').then(() => {
proxy.$modal.loading('加载中')
loading.value = true
if(type1 == 1){
upkeepOrderApi.orderClick(paramsData).then((res) => {
upkeepOrderApi.orderClick(paramsData,type.value).then((res) => {
if (res.data) {
proxy.$modal.showToast('操作成功')
setTimeout(() => {
@ -251,8 +247,23 @@
proxy.$modal.closeLoading()
loading.value = false
})
}else if(type1 == 2){
upkeepOrderApi.orderClickFinish(paramsData).then((res) => {
})
}
//
function orderClickFinish() {
if (!serviceList.value || serviceList.value && serviceList.value.length == 0) {
proxy.$modal.showToast('没有保养内容')
return;
}
const paramsData = {
id: data.value.id,
verifyContent: data.value.applyContent
}
proxy.$modal.confirm('是否验证完结?').then(() => {
proxy.$modal.loading('加载中')
loading.value = true
upkeepOrderApi.orderClickFinish(paramsData,type.value).then((res) => {
if (res.data) {
proxy.$modal.showToast('操作成功')
setTimeout(() => {
@ -267,10 +278,26 @@
proxy.$modal.closeLoading()
loading.value = false
})
}else if(type1==3){//
upkeepOrderApi.orderClickVerify(paramsData).then((res) => {
})
}
//
function orderClickVerify() {
if (!serviceList.value || serviceList.value && serviceList.value.length == 0) {
proxy.$modal.showToast('没有保养内容')
return;
}
const paramsData = {
id: data.value.id,
verifyContent: data.value.applyContent
}
isVerifyShowSuccess.value = false
proxy.$modal.confirm('是否完成?').then(() => {
proxy.$modal.loading('加载中')
loading.value = true
upkeepOrderApi.orderClickVerify(paramsData,type.value).then((res) => {
if (res.data) {
proxy.$modal.showToast('操作成功')
setTimeout(() => {
// proxy.$tab.navigateTo(`/pages/upkeepOrder/index?type=${type.value}`)
proxy.$tab.navigateBack()
@ -284,14 +311,13 @@
proxy.$modal.closeLoading()
loading.value = false
})
}
})
}
//
function getUpkeepOrderDetailList() {
upkeepOrderApi.upkeepOrderDetailList({
number: data.value.number
}).then((res) => {
},type.value).then((res) => {
if (res.data) {
serviceList.value = res.data
}
@ -301,7 +327,7 @@
function delService(item) {
proxy.$modal.confirm('确定删除维修内容吗?').then(() => {
proxy.$modal.loading('加载中')
upkeepOrderApi.upkeepOrderDetailDelete(item.id).then((res) => {
upkeepOrderApi.upkeepOrderDetailDelete(item.id,type.value).then((res) => {
proxy.$modal.closeLoading()
getUpkeepOrderDetailList()
}).catch(() => { })
@ -323,17 +349,10 @@
/**
* 点击验证完结填写意见
*/
function orderClickVerify() {
function verify() {
data.value.applyContent = null;
isVerifyShowSuccess.value = true
}
/**
* 验证确认
*/
function verify() {
isVerifyShowSuccess.value = false
orderClick(3)
}
function cancel() {
data.applyContent = null;
isVerifyShowSuccess.value = false
@ -345,10 +364,12 @@
min-height: 100vh;
background: white;
}
.line {
background: #f5f5f5;
height: 20rpx;
}
.info {
background: white;
}

2
src/pages/upkeepOrder/index.vue

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

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) {
const all_permission = "*:*:*"
const permissions = store.getters && store.getters.permissions
const permissions = store && store.permissions
if (permission && permission.length > 0) {
return permissions.some(v => {
return all_permission === v || v === permission
@ -14,7 +16,7 @@ function authPermission(permission) {
function authRole(role) {
const super_admin = "admin"
const roles = store.getters && store.getters.roles
const roles = store && store.roles
if (role && role.length > 0) {
return roles.some(v => {
return super_admin === v || v === role

5
src/plugins/index.js

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

32
src/store/modules/countStore.ts

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

Loading…
Cancel
Save