diff --git a/.env.development b/.env.development index 84af96b..e69c543 100644 --- a/.env.development +++ b/.env.development @@ -1,4 +1,5 @@ -VITE_BASE_URL=http://192.168.0.106:12080/admin-api +VITE_BASE_URL=http://localhost:12080/admin-api #VITE_BASE_URL=http://dev.ccwin-in.com:25202/api/admin-api -VITE_BASE_URL_IMAGE=http://localhost:12080/admin-api \ No newline at end of file +VITE_BASE_URL_IMAGE=http://192.168.0.106:12080/admin-api + diff --git a/.env.production b/.env.production index 7024ed4..2e1b905 100644 --- a/.env.production +++ b/.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 \ No newline at end of file +VITE_BASE_URL=http://dev.ccwin-in.com:25210/admin-api +VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25210/admin-api \ No newline at end of file diff --git a/aliasPassword.txt b/aliasPassword.txt new file mode 100644 index 0000000..b2a4050 --- /dev/null +++ b/aliasPassword.txt @@ -0,0 +1,8 @@ +证书名称:apptest.keystore +证书别名:apptestalias +证书密码:092134 +SHA1: 62:A6:01:95:5A:A3:F9:66:95:A7:F7:86:3E:85:37:03:B7:B7:BF:13 + SHA256: A4:A7:A9:BF:4A:F6:E2:A8:DD:C2:FF:3D:39:E6:3D:D7:1C:A0:13:8E:41:75:C4:2F:39:14:4B:05:98:AA:33:3A +Android 包名:com.eam.uniapp +Android 应用签名:aa65e187685c2088b82d1a8c143bbabe +ios 包名:com.eam.bundleld \ No newline at end of file diff --git a/apptest.keystore b/apptest.keystore new file mode 100644 index 0000000..178b5bb Binary files /dev/null and b/apptest.keystore differ diff --git a/src/App.vue b/src/App.vue index 0aad051..1c345d7 100644 --- a/src/App.vue +++ b/src/App.vue @@ -5,6 +5,7 @@ onHide } from '@dcloudio/uni-app' import { + ref, getCurrentInstance } from 'vue' import { @@ -15,10 +16,8 @@ import { storeToRefs } from 'pinia' import { useCountStore } from '@/store' - // 获取自定义的store const store = useCountStore() - onLaunch(async () => { // #ifdef MP-WEIXIN if (uni.canIUse('getUpdateManager')) { @@ -67,12 +66,18 @@ }) } plus.push.addEventListener("click", function (data) { - // 0或者2是维修工单 - if(data.payload.status == 0 || data.payload.status == 2){ + // 0接单1报修人确认2是维修工单验证 + if(data.payload.status == 0 || data.payload.status == 1 || data.payload.status == 2){ uni.navigateTo({ url: (`/pages/repairOrder/detail?type=${data.payload.type}&number=${data.payload.number}`) }) } + // // 1报修申请人确认 + // if(data.payload.status == 1){ + // uni.navigateTo({ + // url: (`/pages/repairOrder/detail?type=${data.payload.type}&number=${data.payload.number}`) + // }) + // } }, false); uni.getPushClientId({ success: (res) => { @@ -86,7 +91,10 @@ // #endif if (getAccessToken()) { await store.GetPermissionInfo().then(res => { - }).catch(() => { }) + uni.setStorageSync('permissionInfo',res.permissions) + uni.setStorageSync('roles',res.roles) + }).catch(() => { + }) await store.GetInfo().then(res => { }).catch(() => { }) } diff --git a/src/api/dept.js b/src/api/dept.ts similarity index 100% rename from src/api/dept.js rename to src/api/dept.ts diff --git a/src/api/device.js b/src/api/device.ts similarity index 71% rename from src/api/device.js rename to src/api/device.ts index 04e0a76..c3cad9e 100644 --- a/src/api/device.js +++ b/src/api/device.ts @@ -8,18 +8,6 @@ export function getDeviceDetailsByNumber(params) { export function getDeviceByFactoryAreaNumber(factoryAreaNumber) { return http.get('/eam/device-accounts/selectData?factoryAreaNumber='+factoryAreaNumber) } -// 添加报修 -export function deviceRepairCreate(data) { - return http.post('/eam/device-repair-request/create',data) -} -// 报修列表 -export function deviceRepairPage(params) { - return http.get('/eam/device-repair-request/getAppPage',{params}) -} -// 撤销 -export function rejected(id) { - return http.delete('/eam/device-repair-request/rejected?id='+id) -} // 设备列表 export function deviceList(params) { return http.get('/eam/device-accounts/selectData',{params}) diff --git a/src/api/dict.js b/src/api/dict.ts similarity index 100% rename from src/api/dict.js rename to src/api/dict.ts diff --git a/src/api/index.js b/src/api/index.ts similarity index 100% rename from src/api/index.js rename to src/api/index.ts diff --git a/src/api/location.js b/src/api/location.ts similarity index 100% rename from src/api/location.js rename to src/api/location.ts diff --git a/src/api/login.js b/src/api/login.ts similarity index 100% rename from src/api/login.js rename to src/api/login.ts diff --git a/src/api/mold.js b/src/api/mold.ts similarity index 100% rename from src/api/mold.js rename to src/api/mold.ts diff --git a/src/api/overhaulOrder.js b/src/api/overhaulOrder.js deleted file mode 100644 index fe4a538..0000000 --- a/src/api/overhaulOrder.js +++ /dev/null @@ -1,39 +0,0 @@ -import http from './http' - - -// 添加工单 -export function overhaulOrderCreate(data) { - return http.post('/eam/device-inspection-job-main/create',data) -} -// 编辑工单 -export function overhaulOrderUpdate(data) { - return http.put('/eam/device-inspection-job-main/updat',data) -} -// 报修列表 -export function overhaulOrderPage(params) { - return http.get('/eam/device-inspection-job-main/getAppPage',{params}) -} -// 操作工单 -export function orderClick(params) { - return http.get('/eam/device-inspection-job-main/onClick',{params}) -} - -export function onVerify(params) { - return http.get('/eam/device-inspection-job-main/onVerify',{params}) -} -// 添加维修工单子项维修内容 -export function overhaulOrderDetailCreate(data) { - return http.post('/eam/device-inspection-job-detail/create',data) -} -// 编辑维修工单子项维修内容 -export function overhaulOrderDetailUpdate(data) { - return http.put('/eam/device-inspection-job-detail/update',data) -} -// 获得维修工单子列表 -export function overhaulOrderDetailList(params) { - return http.get('/eam/device-inspection-job-detail/selectListByNumber',{params}) -} -// 删除维修工单子 -export function overhaulOrderDetailDelete(id) { - return http.delete('/eam/device-inspection-job-detail/delete?id='+id) -} diff --git a/src/api/overhaulOrder.ts b/src/api/overhaulOrder.ts new file mode 100644 index 0000000..c051fa9 --- /dev/null +++ b/src/api/overhaulOrder.ts @@ -0,0 +1,93 @@ +import http from './http' + + +// 添加工单 +export function overhaulOrderCreate(data,type) { + if (type == 'DEVICE') { + return http.post('/eam/device-inspection-job-main/create',data) + } else if (type == 'MOLD') { + return http.post('/eam/mold-inspection-job-main/create',data) + } else if (type == 'TECH') { + return http.post('/eam/tech-inspection-job-main/create',data) + } +} +// 编辑工单 +export function overhaulOrderUpdate(data,type) { + if (type == 'DEVICE') { + return http.put('/eam/device-inspection-job-main/updat',data) + } else if (type == 'MOLD') { + return http.put('/eam/mold-inspection-job-main/updat',data) + } else if (type == 'TECH') { + return http.put('/eam/tech-inspection-job-main/updat',data) + } +} +// 报修列表 +export function overhaulOrderPage(params,type) { + if (type == 'DEVICE') { + return http.get('/eam/device-inspection-job-main/getAppPage',{params}) + } else if (type == 'MOLD') { + return http.get('/eam/mold-inspection-job-main/getAppPage',{params}) + } else if (type == 'TECH') { + return http.get('/eam/tech-inspection-job-main/getAppPage',{params}) + } +} +// 完成 +export function orderClickFinish(params,type) { + if (type == 'DEVICE') { + return http.get('/eam/device-inspection-job-main/orderClickFinish',{params}) + } else if (type == 'MOLD') { + return http.get('/eam/mold-inspection-job-main/orderClickFinish',{params}) + } else if (type == 'TECH') { + return http.get('/eam/tech-inspection-job-main/orderClickFinish',{params}) + } +} +// 验证 +export function orderClickVerify(params,type) { + if (type == 'DEVICE') { + return http.get('/eam/device-inspection-job-main/orderClickVerify',{params}) + } else if (type == 'MOLD') { + return http.get('/eam/mold-inspection-job-main/orderClickVerify',{params}) + } else if (type == 'TECH') { + return http.get('/eam/tech-inspection-job-main/orderClickVerify',{params}) + } +} +// 添加维修工单子项维修内容 +export function overhaulOrderDetailCreate(data,type) { + if (type == 'DEVICE') { + return http.post('/eam/device-inspection-job-detail/create',data) + } else if (type == 'MOLD') { + return http.post('/eam/mold-inspection-job-detail/create',data) + } else if (type == 'TECH') { + return http.post('/eam/tech-inspection-job-detail/create',data) + } +} +// 编辑维修工单子项维修内容 +export function overhaulOrderDetailUpdate(data,type) { + if (type == 'DEVICE') { + return http.put('/eam/device-inspection-job-detail/update',data) + } else if (type == 'MOLD') { + return http.put('/eam/mold-inspection-job-detail/update',data) + } else if (type == 'TECH') { + return http.put('/eam/tech-inspection-job-detail/update',data) + } +} +// 获得维修工单子列表 +export function overhaulOrderDetailList(params,type) { + if (type == 'DEVICE') { + return http.get('/eam/device-inspection-job-detail/selectListByNumber',{params}) + } else if (type == 'MOLD') { + return http.get('/eam/mold-inspection-job-detail/selectListByNumber',{params}) + } else if (type == 'TECH') { + return http.get('/eam/tech-inspection-job-detail/selectListByNumber',{params}) + } +} +// 删除维修工单子 +export function overhaulOrderDetailDelete(id,type) { + if (type == 'DEVICE') { + return http.delete('/eam/device-inspection-job-detail/delete?id='+id) + } else if (type == 'MOLD') { + return http.delete('/eam/mold-inspection-job-detail/delete?id='+id) + } else if (type == 'TECH') { + return http.delete('/eam/tech-inspection-job-detail/delete?id='+id) + } +} diff --git a/src/api/repairOrder.js b/src/api/repairOrder.js deleted file mode 100644 index 251c291..0000000 --- a/src/api/repairOrder.js +++ /dev/null @@ -1,52 +0,0 @@ -import http from './http' - - -// 添加工单 -export function repairOrderCreate(data) { - return http.post('/eam/device-maintenance-job-main/create',data) -} -// 编辑工单 -export function repairOrderUpdate(data) { - return http.put('/eam/device-maintenance-job-main/update',data) -} -// 工单列表 -export function repairOrderPage(params) { - return http.get('/eam/device-maintenance-job-main/getAppPage',{params}) -} -// 获取维修工单详情信息 -export function getDeviceRepairDetail(number) { - return http.get('eam/device-maintenance-job-main/getAppByNumber?number='+number) -} -// 操作工单 -export function orderClick(params) { - return http.get('/eam/device-maintenance-job-main/orderClick',{params}) -} -// 添加维修工单子项维修内容 -export function repairOrderDetailCreate(data) { - return http.post('/eam/device-maintenance-job-detail/create',data) -} -// 编辑维修工单子项维修内容 -export function repairOrderDetailUpdate(data) { - return http.put('/eam/device-maintenance-job-detail/update',data) -} -// 获得维修工单子列表 -export function repairOrderDetailList(params) { - return http.get('/eam/device-maintenance-job-detail/selectListByNumber',{params}) -} -// 删除维修工单子 -export function repairOrderDetailDelete(id) { - return http.delete( '/eam/device-maintenance-job-detail/delete?id='+id) -} -//转办 -export function transfer(params) { - return http.get('/eam/device-maintenance-job-main/turnTo',{params}) -} -// 获取采取临时措施的维修工单 -export function repairOrderList(params) { - return http.get('/eam/device-maintenance-job-main/getList',{params}) -} -// 获取维修工单的报修信息 -export function getDeviceRepairDetailsByNumber(params) { - return http.get('/eam/device-repair-request/getDetailsByNumber',{params}) -} - diff --git a/src/api/repairOrder.ts b/src/api/repairOrder.ts new file mode 100644 index 0000000..c2ad432 --- /dev/null +++ b/src/api/repairOrder.ts @@ -0,0 +1,145 @@ +import http from './http' + + +// 添加工单 +export function repairOrderCreate(data,type) { + if (type == 'DEVICE') { + return http.post('/eam/device-maintenance-job-main/create', data) + } else if (type == 'MOLD') { + return http.post('/eam/mold-maintenance-job-main/create', data) + } else if (type == 'TECH') { + return http.post('/eam/tech-maintenance-job-main/create', data) + } +} +// 编辑工单 +export function repairOrderUpdate(data,type) { + if (type == 'DEVICE') { + return http.put('/eam/device-maintenance-job-main/update', data) + } else if (type == 'MOLD') { + return http.put('/eam/mold-maintenance-job-main/update', data) + } else if (type == 'TECH') { + return http.put('/eam/tech-maintenance-job-main/update', data) + } +} +// 工单列表 +export function repairOrderPage(params,type) { + if (type == 'DEVICE') { + return http.get('/eam/device-maintenance-job-main/getAppPage', {params}) + } else if (type == 'MOLD') { + return http.get('/eam/mold-maintenance-job-main/getAppPage', {params}) + } else if (type == 'TECH') { + return http.get('/eam/tech-maintenance-job-main/getAppPage', {params}) + } +} +// 获取维修工单详情信息 +export function getDeviceRepairDetail(number,type) { + if (type == 'DEVICE') { + return http.get('eam/device-maintenance-job-main/getAppByNumber?number=' + number) + } else if (type == 'MOLD') { + return http.get('eam/mold-maintenance-job-main/getAppByNumber?number=' + number) + } else if (type == 'TECH') { + return http.get('eam/tech-maintenance-job-main/getAppByNumber?number=' + number) + } +} +// 接单 +export function orderClick(params,type) { + if (type == 'DEVICE') { + return http.get('/eam/device-maintenance-job-main/orderClick', {params}) + } else if (type == 'MOLD') { + return http.get('/eam/mold-maintenance-job-main/orderClick', {params}) + } else if (type == 'TECH') { + return http.get('/eam/tech-maintenance-job-main/orderClick', {params}) + } +} +// 完成 +export function orderClickFinish(params,type) { + if (type == 'DEVICE') { + return http.get('/eam/device-maintenance-job-main/orderClickFinish', {params}) + } else if (type == 'MOLD') { + return http.get('/eam/mold-maintenance-job-main/orderClickFinish', {params}) + } else if (type == 'TECH') { + return http.get('/eam/tech-maintenance-job-main/orderClickFinish', {params}) + } +} +// 确认 +export function orderClickConfirm(params,type) { + if (type == 'DEVICE') { + return http.get('/eam/device-maintenance-job-main/orderClickConfirm', {params}) + } else if (type == 'MOLD') { + return http.get('/eam/mold-maintenance-job-main/orderClickConfirm', {params}) + } else if (type == 'TECH') { + return http.get('/eam/tech-maintenance-job-main/orderClickConfirm', {params}) + } +} +// 验证 +export function orderClickVerify(params,type) { + if (type == 'DEVICE') { + return http.get('/eam/device-maintenance-job-main/orderClickVerify', {params}) + } else if (type == 'MOLD') { + return http.get('/eam/mold-maintenance-job-main/orderClickVerify', {params}) + } else if (type == 'TECH') { + return http.get('/eam/tech-maintenance-job-main/orderClickVerify', {params}) + } +} +// 添加维修工单子项维修内容 +export function repairOrderDetailCreate(data,type) { + if (type == 'DEVICE') { + return http.post('/eam/device-maintenance-job-detail/create', data) + } else if (type == 'MOLD') { + return http.post('/eam/mold-maintenance-job-detail/create', data) + } else if (type == 'TECH') { + return http.post('/eam/tech-maintenance-job-detail/create', data) + } +} +// 编辑维修工单子项维修内容 +export function repairOrderDetailUpdate(data,type) { + if (type == 'DEVICE') { + return http.put('/eam/device-maintenance-job-detail/update', data) + } else if (type == 'MOLD') { + return http.put('/eam/mold-maintenance-job-detail/update', data) + } else if (type == 'TECH') { + return http.put('/eam/tech-maintenance-job-detail/update', data) + } +} +// 获得维修工单子列表 +export function repairOrderDetailList(params,type) { + if (type == 'DEVICE') { + return http.get('/eam/device-maintenance-job-detail/selectListByNumber', {params}) + } else if (type == 'MOLD') { + return http.get('/eam/mold-maintenance-job-detail/selectListByNumber', {params}) + } else if (type == 'TECH') { + return http.get('/eam/tech-maintenance-job-detail/selectListByNumber', {params}) + } +} +// 删除维修工单子 +export function repairOrderDetailDelete(id,type) { + if (type == 'DEVICE') { + return http.delete('/eam/device-maintenance-job-detail/delete?id=' + id) + } else if (type == 'MOLD') { + return http.delete('/eam/mold-maintenance-job-detail/delete?id=' + id) + } else if (type == 'TECH') { + return http.delete('/eam/tech-maintenance-job-detail/delete?id=' + id) + } +} +//转办 +export function transfer(params,type) { + if (type == 'DEVICE') { + return http.get('/eam/device-maintenance-job-main/turnTo', {params}) + } else if (type == 'MOLD') { + return http.get('/eam/mold-maintenance-job-main/turnTo', {params}) + } else if (type == 'TECH') { + return http.get('/eam/tech-maintenance-job-main/turnTo', {params}) + } +} +// 获取采取临时措施的维修工单 +export function repairOrderList(params) { + return http.get('/eam/device-maintenance-job-main/getList', { + params + }) +} +// 获取维修工单的报修信息 +export function getDeviceRepairDetailsByNumber(params) { + return http.get('/eam/device-repair-request/getDetailsByNumber', { + params + }) +} \ No newline at end of file diff --git a/src/api/report.ts b/src/api/report.ts new file mode 100644 index 0000000..c386e02 --- /dev/null +++ b/src/api/report.ts @@ -0,0 +1,33 @@ +import http from './http' + + +// 添加报修 +export function repairCreate(data,type) { + if(type == 'DEVICE'){ + return http.post('/eam/device-repair-request/create',data) + }else if(type == 'MOLD'){ + return http.post('/eam/mold-repair-request/create',data) + }else if(type == 'TECH'){ + return http.post('/eam/tech-repair-request/create',data) + } +} +// 报修列表 +export function repairPage(params,type) { + if(type == 'DEVICE'){ + return http.get('/eam/device-repair-request/getAppPage',{params}) + }else if(type == 'MOLD'){ + return http.get('/eam/mold-repair-request/getAppPage',{params}) + }else if(type == 'TECH'){ + return http.get('/eam/tech-repair-request/getAppPage',{params}) + } +} +// 撤销 +export function repairCancel(id,type) { + if(type == 'DEVICE'){ + return http.delete('/eam/device-repair-request/cancel?id='+id) + }else if(type == 'MOLD'){ + return http.delete('/eam/mold-repair-request/cancel?id='+id) + }else if(type == 'TECH'){ + return http.delete('/eam/tech-repair-request/cancel?id='+id) + } +} diff --git a/src/api/spareParts.js b/src/api/spareParts.ts similarity index 100% rename from src/api/spareParts.js rename to src/api/spareParts.ts diff --git a/src/api/sparePartsApplication.js b/src/api/sparePartsApplication.ts similarity index 100% rename from src/api/sparePartsApplication.js rename to src/api/sparePartsApplication.ts diff --git a/src/api/sparePartsApplicationApprove.js b/src/api/sparePartsApplicationApprove.ts similarity index 65% rename from src/api/sparePartsApplicationApprove.js rename to src/api/sparePartsApplicationApprove.ts index e4def43..25c4047 100644 --- a/src/api/sparePartsApplicationApprove.js +++ b/src/api/sparePartsApplicationApprove.ts @@ -1,9 +1,14 @@ import http from './http' -// 备件领用审批列表 +// 备件一级审批领用审批列表 export function sparePartsApplicationApprovePage(params) { return http.get('/eam/item-apply-request-main/getAppApprovePage',{params}) } + +// 备件二级审批领用审批列表 +export function sparePartsApplicationApprovePage1(params) { + return http.get('/eam/item-apply-request-main/getAppApprovePage1',{params}) +} // 通过申请 export function sparePartsApplicationAgree(id) { return http.get('/eam/item-apply-request-main/agree?id='+id) diff --git a/src/api/sparePartsServiceWorkOrderList.js b/src/api/sparePartsServiceWorkOrderList.ts similarity index 100% rename from src/api/sparePartsServiceWorkOrderList.js rename to src/api/sparePartsServiceWorkOrderList.ts diff --git a/src/api/spotCheckOrder.js b/src/api/spotCheckOrder.js deleted file mode 100644 index fb65753..0000000 --- a/src/api/spotCheckOrder.js +++ /dev/null @@ -1,29 +0,0 @@ -import http from './http' - -// 添加工单 -export function spotCheckOrderCreate(data) { - return http.post('/eam/device-spot-inspection-record-main/create',data) -} -// 编辑工单 -export function spotCheckOrderUpdate(data) { - return http.put('/eam/device-spot-inspection-record-main/update',data) -} -// 工单列表 -export function spotCheckOrderPage(params) { - return http.get('/eam/device-spot-inspection-record-main/getAppPage',{params}) -} - -// 操作工单 -export function orderClick(params) { - return http.get('/eam/device-spot-inspection-record-main/onClick',{params}) -} - -// 操作工单 -export function selectListByNumber(params) { - return http.get('/eam/device-spot-inspection-record-detail/getList',{params}) -} - -// 工程师审批 -export function orderClickApprove(params) { - return http.get('/eam/device-spot-inspection-record-main/orderClickApprove',{params}) -} diff --git a/src/api/spotCheckOrder.ts b/src/api/spotCheckOrder.ts new file mode 100644 index 0000000..6241be0 --- /dev/null +++ b/src/api/spotCheckOrder.ts @@ -0,0 +1,65 @@ +import http from './http' + +// 添加工单 +export function spotCheckOrderCreate(data,type) { + if (type == 'DEVICE') { + return http.post('/eam/device-spot-inspection-record-main/create',data) + } else if (type == 'MOLD') { + return http.post('/eam/mold-spot-inspection-record-main/create',data) + } else if (type == 'TECH') { + return http.post('/eam/tech-spot-inspection-record-main/create',data) + } +} +// 编辑工单 +export function spotCheckOrderUpdate(data,type) { + if (type == 'DEVICE') { + return http.put('/eam/device-spot-inspection-record-main/update',data) + } else if (type == 'MOLD') { + return http.put('/eam/mold-spot-inspection-record-main/update',data) + } else if (type == 'TECH') { + return http.put('/eam/tech-spot-inspection-record-main/update',data) + } +} +// 工单列表 +export function spotCheckOrderPage(params,type) { + if (type == 'DEVICE') { + return http.get('/eam/device-spot-inspection-record-main/getAppPage',{params}) + } else if (type == 'MOLD') { + return http.get('/eam/mold-spot-inspection-record-main/getAppPage',{params}) + } else if (type == 'TECH') { + return http.get('/eam/tech-spot-inspection-record-main/getAppPage',{params}) + } +} + +// 操作工单 +export function orderClick(params,type) { + if (type == 'DEVICE') { + return http.get('/eam/device-spot-inspection-record-main/onClick',{params}) + } else if (type == 'MOLD') { + return http.get('/eam/mold-spot-inspection-record-main/onClick',{params}) + } else if (type == 'TECH') { + return http.get('/eam/tech-spot-inspection-record-main/onClick',{params}) + } +} + +// 操作工单 +export function selectListByNumber(params,type) { + if (type == 'DEVICE') { + return http.get('/eam/device-spot-inspection-record-detail/getList',{params}) + } else if (type == 'MOLD') { + return http.get('/eam/mold-spot-inspection-record-detail/getList',{params}) + } else if (type == 'TECH') { + return http.get('/eam/tech-spot-inspection-record-detail/getList',{params}) + } +} + +// 工程师审批 +export function orderClickVerify(params,type) { + if (type == 'DEVICE') { + return http.get('/eam/device-spot-inspection-record-main/orderClickVerify',{params}) + } else if (type == 'MOLD') { + return http.get('/eam/mold-spot-inspection-record-main/orderClickVerify',{params}) + } else if (type == 'TECH') { + return http.get('/eam/tech-spot-inspection-record-main/orderClickVerify',{params}) + } +} diff --git a/src/api/upkeepOrder.js b/src/api/upkeepOrder.js deleted file mode 100644 index 7cfc7f1..0000000 --- a/src/api/upkeepOrder.js +++ /dev/null @@ -1,44 +0,0 @@ -import http from './http' - - -// 添加工单 -export function upkeepOrderCreate(data) { - return http.post('/eam/device-maintain-job-main/create',data) -} -// 编辑工单 -export function upkeepOrderUpdate(data) { - return http.put('/eam/device-maintain-job-main/update',data) -} -// 工单列表 -export function upkeepOrderPage(params) { - return http.get('/eam/device-maintain-job-main/getAppPage',{params}) -} -// 接单 -export function orderClick(params) { - return http.get('/eam/device-maintain-job-main/orderClick',{params}) -} - -export function orderClickVerify(params) { - return http.get('/eam/device-maintain-job-main/orderClickVerify',{params}) -} - -// 完成保养工单 -export function orderClickFinish(params) { - return http.get('/eam/device-maintain-job-main/orderClickFinish',{params}) -} -// 添加维修工单子项维修内容 -export function upkeepOrderDetailCreate(data) { - return http.post('/eam/device-maintain-job-detail/create',data) -} -// 编辑维修工单子项维修内容 -export function upkeepOrderDetailUpdate(data) { - return http.put('/eam/device-maintain-job-detail/update',data) -} -// 获得维修工单子列表 -export function upkeepOrderDetailList(params) { - return http.get('/eam/device-maintain-job-detail/selectListByNumber',{params}) -} -// 删除维修工单子 -export function upkeepOrderDetailDelete(id) { - return http.delete('/eam/device-maintain-job-detail/delete?id='+id) -} diff --git a/src/api/upkeepOrder.ts b/src/api/upkeepOrder.ts new file mode 100644 index 0000000..944701e --- /dev/null +++ b/src/api/upkeepOrder.ts @@ -0,0 +1,104 @@ + import http from './http' + + +// 添加工单 +export function upkeepOrderCreate(data,type) { + if (type == 'DEVICE') { + return http.post('/eam/device-maintain-job-main/create',data) + } else if (type == 'MOLD') { + return http.post('/eam/mold-maintain-job-main/create',data) + } else if (type == 'TECH') { + return http.post('/eam/tech-maintain-job-main/create',data) + } +} +// 编辑工单 +export function upkeepOrderUpdate(data,type) { + if (type == 'DEVICE') { + return http.put('/eam/device-maintain-job-main/update',data) + } else if (type == 'MOLD') { + return http.put('/eam/mold-maintain-job-main/update',data) + } else if (type == 'TECH') { + return http.put('/eam/tech-maintain-job-main/update',data) + } +} +// 工单列表 +export function upkeepOrderPage(params,type) { + if (type == 'DEVICE') { + return http.get('/eam/device-maintain-job-main/getAppPage',{params}) + } else if (type == 'MOLD') { + return http.get('/eam/mold-maintain-job-main/getAppPage',{params}) + } else if (type == 'TECH') { + return http.get('/eam/tech-maintain-job-main/getAppPage',{params}) + } +} +// 接单 +export function orderClick(params,type) { + if (type == 'DEVICE') { + return http.get('/eam/device-maintain-job-main/orderClick',{params}) + } else if (type == 'MOLD') { + return http.get('/eam/mold-maintain-job-main/orderClick',{params}) + } else if (type == 'TECH') { + return http.get('/eam/tech-maintain-job-main/orderClick',{params}) + } +} + +export function orderClickVerify(params,type) { + if (type == 'DEVICE') { + return http.get('/eam/device-maintain-job-main/orderClickVerify',{params}) + } else if (type == 'MOLD') { + return http.get('/eam/mold-maintain-job-main/orderClickVerify',{params}) + } else if (type == 'TECH') { + return http.get('/eam/tech-maintain-job-main/orderClickVerify',{params}) + } +} + +// 完成保养工单 +export function orderClickFinish(params,type) { + if (type == 'DEVICE') { + return http.get('/eam/device-maintain-job-main/orderClickFinish',{params}) + } else if (type == 'MOLD') { + return http.get('/eam/mold-maintain-job-main/orderClickFinish',{params}) + } else if (type == 'TECH') { + return http.get('/eam/tech-maintain-job-main/orderClickFinish',{params}) + } +} +// 添加维修工单子项维修内容 +export function upkeepOrderDetailCreate(data,type) { + if (type == 'DEVICE') { + return http.post('/eam/device-maintain-job-detail/create',data) + } else if (type == 'MOLD') { + return http.post('/eam/mold-maintain-job-detail/create',data) + } else if (type == 'TECH') { + return http.post('/eam/tech-maintain-job-detail/create',data) + } +} +// 编辑维修工单子项维修内容 +export function upkeepOrderDetailUpdate(data,type) { + if (type == 'DEVICE') { + return http.put('/eam/device-maintain-job-detail/update',data) + } else if (type == 'MOLD') { + return http.put('/eam/mold-maintain-job-detail/update',data) + } else if (type == 'TECH') { + return http.put('/eam/tech-maintain-job-detail/update',data) + } +} +// 获得维修工单子列表 +export function upkeepOrderDetailList(params,type) { + if (type == 'DEVICE') { + return http.get('/eam/device-maintain-job-detail/selectListByNumber',{params}) + } else if (type == 'MOLD') { + return http.get('/eam/mold-maintain-job-detail/selectListByNumber',{params}) + } else if (type == 'TECH') { + return http.get('/eam/tech-maintain-job-detail/selectListByNumber',{params}) + } +} +// 删除维修工单子 +export function upkeepOrderDetailDelete(id,type) { + if (type == 'DEVICE') { + return http.delete('/eam/device-maintain-job-detail/delete?id='+id) + } else if (type == 'MOLD') { + return http.delete('/eam/mold-maintain-job-detail/delete?id='+id) + } else if (type == 'TECH') { + return http.delete('/eam/tech-maintain-job-detail/delete?id='+id) + } +} diff --git a/src/api/upload.js b/src/api/upload.ts similarity index 100% rename from src/api/upload.js rename to src/api/upload.ts diff --git a/src/api/user.js b/src/api/user.ts similarity index 100% rename from src/api/user.js rename to src/api/user.ts diff --git a/src/components/item/slectItemList.vue b/src/components/item/slectItemList.vue index 70cdb35..8c67e40 100644 --- a/src/components/item/slectItemList.vue +++ b/src/components/item/slectItemList.vue @@ -39,7 +39,7 @@ import { onLoad, } from '@dcloudio/uni-app' - import * as repairOrderApi from "@/api/repairOrder.js" + import * as repairOrderApi from "@/api/repairOrder" const props = defineProps({ isShowSelectItem: { diff --git a/src/main.ts b/src/main.ts index c19c964..22b7f31 100644 --- a/src/main.ts +++ b/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 + + diff --git a/src/pages/device/index.vue b/src/pages/device/index.vue index f8aa637..81e82a4 100644 --- a/src/pages/device/index.vue +++ b/src/pages/device/index.vue @@ -50,7 +50,7 @@ import { getAccessToken } from '@/utils/auth' - import * as deviceApi from "@/api/device.js" + import * as deviceApi from "@/api/device" import Search from '../../components/search/index.vue' const { proxy } = getCurrentInstance() const params = ref({ diff --git a/src/pages/deviceReport/addForm.vue b/src/pages/deviceReport/addForm.vue index 9464a16..bbdcdbc 100644 --- a/src/pages/deviceReport/addForm.vue +++ b/src/pages/deviceReport/addForm.vue @@ -16,14 +16,14 @@ - + + @blur="blur()" @confirm='blur()' /> 扫描 - @@ -31,11 +31,11 @@ + :placeholder="`根据${type=='DEVICE'?'设备' :type == 'TECH'?'工艺' : '模具'}编码获得`" disabled /> + :placeholder="`根据${type=='DEVICE'?'设备':type == 'TECH'?'工艺' : '模具'}编码获得`" disabled /> @@ -70,11 +70,12 @@ ref, getCurrentInstance } from 'vue' - import * as deviceApi from "@/api/device.js" - import * as moldApi from "@/api/mold.js" - import * as dictApi from "@/api/dict.js" - import * as uploadApi from "@/api/upload.js" - import * as deptApi from "@/api/dept.js" + import * as deviceApi from "@/api/device" + import * as reportApi from "@/api/report" + import * as moldApi from "@/api/mold" + import * as dictApi from "@/api/dict" + import * as uploadApi from "@/api/upload" + import * as deptApi from "@/api/dept" const { proxy } = getCurrentInstance() const loading = ref(false) const type = ref('') @@ -87,7 +88,7 @@ factoryAreaName: '', factoryAreaNumber: '', type: '', - typeName:'' + typeName: '' }) const singleColumnShow = ref(false) const singleColumnDefaultValue = ref([]) @@ -136,7 +137,7 @@ deviceApi.getDeviceDetailsByNumber({ number: form.value.deviceNumber, type: type.value, - flag:1 + flag: 1 }).then((res) => { if (!res.data) { msg.value = res.msg @@ -156,7 +157,7 @@ } else if (type.value == 'MOLD') { moldApi.getMoldDetailsByNumber({ number: form.value.deviceNumber, - flag:1 + flag: 1 }).then((res) => { if (!res.data) { msg.value = res.msg @@ -187,7 +188,7 @@ return; } if (!form.value.deviceNumber) { - proxy.$modal.showToast(`请选择${type.value == 'DEVICE' || type.value == 'TECH' ? '设备' : '模具'}`) + proxy.$modal.showToast(`请选择${type.value == 'DEVICE' ? '设备' : type == 'TECH' ? '工艺' : '模具'}`) return; } if (!form.value.deviceName) { @@ -208,7 +209,7 @@ proxy.$modal.confirm('是否添加报修').then(() => { proxy.$modal.loading('加载中') loading.value = true - deviceApi.deviceRepairCreate(data).then((res) => { + reportApi.repairCreate(data, type.value).then((res) => { proxy.$modal.closeLoading() if (res.data) { proxy.$modal.showToast('添加成功') @@ -217,9 +218,9 @@ loading.value = false }, 1500) } else { - if(res.msg){ + if (res.msg) { proxy.$modal.showToast(res.msg) - }else{ + } else { proxy.$modal.showToast('添加失败') } loading.value = false @@ -249,7 +250,7 @@ } // 单列模式点击确定之后 function chooseSingleColumn(e) { - if(form.value[field.value] == e[0].value)return; + if (form.value[field.value] == e[0].value) return; form.value[field.value] = e[0].value if (field.value == 'factoryAreaNumber') { form.value.deviceNumber = '' @@ -258,7 +259,7 @@ } if (field.value == 'type') { type.value = form.value[field.value] - form.value.typeName = e[0].label + form.value.typeName = e[0].label form.value.deviceNumber = '' form.value.deviceName = '' form.value.factoryAreaName = '' @@ -298,15 +299,11 @@ if (option.type) type.value = option.type; appDeviceMoldType.value = await dictApi.getDict('app_device_mold_type') if (type.value == 'DEVICE') { - appDeviceMoldType.value = appDeviceMoldType.value.filter((item => item.value != "MOLD")) - uni.setNavigationBarTitle({ - title: '设备报修' - }) - } else { - uni.setNavigationBarTitle({ - title: '模具报修' - }) - appDeviceMoldType.value =appDeviceMoldType.value.filter((item => item.value == "MOLD")) + appDeviceMoldType.value = appDeviceMoldType.value.filter((item => item.value == "DEVICE")) + } else if (type.value == 'MOLD') { + appDeviceMoldType.value = appDeviceMoldType.value.filter((item => item.value == "MOLD")) + } else if (type.value == 'TECH') { + appDeviceMoldType.value = appDeviceMoldType.value.filter((item => item.value == "TECH")) } form.value.type = appDeviceMoldType.value[0].value form.value.typeName = appDeviceMoldType.value[0].label diff --git a/src/pages/deviceReport/index.vue b/src/pages/deviceReport/index.vue index 8982982..9604490 100644 --- a/src/pages/deviceReport/index.vue +++ b/src/pages/deviceReport/index.vue @@ -2,9 +2,9 @@ + :title="title"> @@ -43,8 +43,13 @@ type="primary" shape='circle' /> - 撤销 + 撤销 @@ -66,7 +71,12 @@ ref, getCurrentInstance } from 'vue' - import * as deviceApi from "@/api/device.js" + import * as reportApi from "@/api/report" + + import { useCountStore } from '@/store' + // 获取自定义的store + const store = useCountStore() + console.log(store.id) const { proxy } = getCurrentInstance() const params = ref({ pageNo: 1, @@ -77,6 +87,7 @@ const status = ref('loadmore') //是否显示没有更多了 const list = ref([]) const type = ref() + const title = ref('') function addForm() { proxy.$tab.navigateTo(`/pages/deviceReport/addForm?type=${params.value.type}`) @@ -85,7 +96,8 @@ if (status.value == 'nomore') return; status.value = 'loading'; proxy.$modal.loading('加载中') - await deviceApi.deviceRepairPage(params.value).then((res) => { + console.log(type.value) + await reportApi.repairPage(params.value,type.value).then((res) => { proxy.$modal.closeLoading() if (res.data.list.length > 0) { list.value = list.value.concat(res.data.list); @@ -99,7 +111,7 @@ function cancle(item) { proxy.$modal.confirm('确定撤销报修吗?').then(() => { proxy.$modal.loading('加载中') - deviceApi.rejected(item.id).then(async (res) => { + reportApi.repairCancel(item.id,type.value).then(async (res) => { proxy.$modal.closeLoading() params.value.pageNo = 1 list.value = [] @@ -123,19 +135,21 @@ } }); } + function hasPermi1(val) { + console.log(proxy.$auth) + } onLoad((option) => { - if (option.type) params.value.type = option.type; - if (type.value == 'DEVICE') { - uni.setNavigationBarTitle({ - title: '设备报修' - }) - } else { - uni.setNavigationBarTitle({ - title: '模具报修' - }) + if (option.type) type.value = option.type; + params.value.type = type.value + if (option.type == 'DEVICE') { + title.value = '设备报修' + } else if (option.type == 'MOLD') { + title.value = '模具报修' + } else if (option.type == 'TECH') { + title.value = '工艺报修' } }) - onShow(async() => { + onShow(async () => { params.value.pageNo = 1 list.value = [] status.value = 'loadmore' @@ -147,10 +161,11 @@