Browse Source

feat(app): 添加了eam的部分功能

master
ljlong_2630 5 months ago
parent
commit
a0d291389a
  1. 7600
      pnpm-lock.yaml
  2. 17
      sfms3.0-uniapp3/App.vue
  3. 20
      sfms3.0-uniapp3/index.html
  4. 22
      sfms3.0-uniapp3/main.js
  5. 72
      sfms3.0-uniapp3/manifest.json
  6. 17
      sfms3.0-uniapp3/pages.json
  7. 52
      sfms3.0-uniapp3/pages/index/index.vue
  8. BIN
      sfms3.0-uniapp3/static/logo.png
  9. 10
      sfms3.0-uniapp3/uni.promisify.adaptor.js
  10. 76
      sfms3.0-uniapp3/uni.scss
  11. 9
      src/api/dept.js
  12. 6
      src/api/eam/attachmentFile.js
  13. 18
      src/api/eam/device.js
  14. 6
      src/api/eam/dict.js
  15. 119
      src/api/eam/repairOrder.js
  16. 13
      src/api/eam/spareParts.js
  17. 18
      src/api/eam/sparePartsApplication.js
  18. 14
      src/api/eam/sparePartsApplicationApprove.js
  19. 6
      src/api/eam/sparePartsServiceWorkOrderList.js
  20. 25
      src/api/eam/tool.js
  21. 21
      src/api/mold.js
  22. 47
      src/api/repairOrder.js
  23. 8
      src/api/request2.js
  24. 18
      src/api/sparePartsApplication.js
  25. 14
      src/api/sparePartsApplicationApprove.js
  26. 16
      src/api/wms/workShop.js
  27. 2
      src/main.ts
  28. 51
      src/pages.json
  29. 25
      src/pages/eam/device/index.vue
  30. 247
      src/pages/eam/deviceReport/addForm.vue
  31. 72
      src/pages/eam/deviceReport/index.vue
  32. 0
      src/pages/eam/deviceReport/myDeviceReport.vue
  33. 0
      src/pages/eam/repairOrder/addForm.vue
  34. 0
      src/pages/eam/repairOrder/addServiceRecord.vue
  35. 372
      src/pages/eam/repairOrder/detail.vue
  36. 245
      src/pages/eam/repairOrder/index.vue
  37. 29
      src/pages/eam/repairOrder/indexBak.vue
  38. 14
      src/pages/eam/repairOrder/myOrder.vue
  39. 90
      src/pages/eam/repairOrder/myRepairRequest.vue
  40. 30
      src/pages/eam/repairOrder/transfer.vue
  41. 226
      src/pages/eam/spareParts/index.vue
  42. 108
      src/pages/eam/sparePartsApplication/CustomTableModal.vue
  43. 199
      src/pages/eam/sparePartsApplication/addForm.vue
  44. 38
      src/pages/eam/sparePartsApplication/detail.vue
  45. 9
      src/pages/eam/sparePartsApplication/index.vue
  46. 2
      src/pages/eam/sparePartsApplication/mySparePartsApplication.vue
  47. 10
      src/pages/eam/sparePartsApplicationApprove/index.vue
  48. 2
      src/pages/eam/sparePartsApplicationApprove/mySparePartsApplicationApprove.vue
  49. 209
      src/pages/eam/sparePartsServiceWorkOrderList/addForm.vue
  50. 0
      src/pages/eam/sparePartsServiceWorkOrderList/mySparePartsService.vue
  51. 32
      src/pages/eam/tool/index.vue
  52. 4
      src/pages/spareParts/index.vue
  53. 2
      src/plugins/auth.js
  54. 3
      src/static/config.js

7600
pnpm-lock.yaml

File diff suppressed because it is too large

17
sfms3.0-uniapp3/App.vue

@ -0,0 +1,17 @@
<script>
export default {
onLaunch: function() {
console.log('App Launch')
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
}
}
</script>
<style>
/*每个页面公共css */
</style>

20
sfms3.0-uniapp3/index.html

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<script>
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
CSS.supports('top: constant(a)'))
document.write(
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
</script>
<title></title>
<!--preload-links-->
<!--app-context-->
</head>
<body>
<div id="app"><!--app-html--></div>
<script type="module" src="/main.js"></script>
</body>
</html>

22
sfms3.0-uniapp3/main.js

@ -0,0 +1,22 @@
import App from './App'
// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
...App
})
app.$mount()
// #endif
// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
const app = createSSRApp(App)
return {
app
}
}
// #endif

72
sfms3.0-uniapp3/manifest.json

@ -0,0 +1,72 @@
{
"name" : "sfms3.0-uniapp3",
"appid" : "",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
/* 5+App */
"app-plus" : {
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
/* */
"modules" : {},
/* */
"distribute" : {
/* android */
"android" : {
"permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
/* ios */
"ios" : {},
/* SDK */
"sdkConfigs" : {}
}
},
/* */
"quickapp" : {},
/* */
"mp-weixin" : {
"appid" : "",
"setting" : {
"urlCheck" : false
},
"usingComponents" : true
},
"mp-alipay" : {
"usingComponents" : true
},
"mp-baidu" : {
"usingComponents" : true
},
"mp-toutiao" : {
"usingComponents" : true
},
"uniStatistics" : {
"enable" : false
},
"vueVersion" : "3"
}

17
sfms3.0-uniapp3/pages.json

@ -0,0 +1,17 @@
{
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "uni-app"
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "uni-app",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
},
"uniIdRouter": {}
}

52
sfms3.0-uniapp3/pages/index/index.vue

@ -0,0 +1,52 @@
<template>
<view class="content">
<image class="logo" src="/static/logo.png"></image>
<view class="text-area">
<text class="title">{{title}}</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {
title: 'Hello'
}
},
onLoad() {
},
methods: {
}
}
</script>
<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.logo {
height: 200rpx;
width: 200rpx;
margin-top: 200rpx;
margin-left: auto;
margin-right: auto;
margin-bottom: 50rpx;
}
.text-area {
display: flex;
justify-content: center;
}
.title {
font-size: 36rpx;
color: #8f8f94;
}
</style>

BIN
sfms3.0-uniapp3/static/logo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

10
sfms3.0-uniapp3/uni.promisify.adaptor.js

@ -0,0 +1,10 @@
uni.addInterceptor({
returnValue (res) {
if (!(!!res && (typeof res === "object" || typeof res === "function") && typeof res.then === "function")) {
return res;
}
return new Promise((resolve, reject) => {
res.then((res) => res[0] ? reject(res[0]) : resolve(res[1]));
});
},
});

76
sfms3.0-uniapp3/uni.scss

@ -0,0 +1,76 @@
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量
* 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
$uni-color-primary: #007aff;
$uni-color-success: #4cd964;
$uni-color-warning: #f0ad4e;
$uni-color-error: #dd524d;
/* 文字基本颜色 */
$uni-text-color:#333;//基本色
$uni-text-color-inverse:#fff;//反色
$uni-text-color-grey:#999;//辅助灰色如加载更多的提示信息
$uni-text-color-placeholder: #808080;
$uni-text-color-disable:#c0c0c0;
/* 背景颜色 */
$uni-bg-color:#ffffff;
$uni-bg-color-grey:#f8f8f8;
$uni-bg-color-hover:#f1f1f1;//点击状态颜色
$uni-bg-color-mask:rgba(0, 0, 0, 0.4);//遮罩颜色
/* 边框颜色 */
$uni-border-color:#c8c7cc;
/* 尺寸变量 */
/* 文字尺寸 */
$uni-font-size-sm:12px;
$uni-font-size-base:14px;
$uni-font-size-lg:16px;
/* 图片尺寸 */
$uni-img-size-sm:20px;
$uni-img-size-base:26px;
$uni-img-size-lg:40px;
/* Border Radius */
$uni-border-radius-sm: 2px;
$uni-border-radius-base: 3px;
$uni-border-radius-lg: 6px;
$uni-border-radius-circle: 50%;
/* 水平间距 */
$uni-spacing-row-sm: 5px;
$uni-spacing-row-base: 10px;
$uni-spacing-row-lg: 15px;
/* 垂直间距 */
$uni-spacing-col-sm: 4px;
$uni-spacing-col-base: 8px;
$uni-spacing-col-lg: 12px;
/* 透明度 */
$uni-opacity-disabled: 0.3; // 组件禁用态的透明度
/* 文章场景相关 */
$uni-color-title: #2C405A; // 文章标题颜色
$uni-font-size-title:20px;
$uni-color-subtitle: #555555; // 二级标题颜色
$uni-font-size-subtitle:26px;
$uni-color-paragraph: #3F536E; // 文章段落颜色
$uni-font-size-paragraph:15px;

9
src/api/dept.js

@ -5,7 +5,8 @@ export function getSelecUser(params) {
return http.get('/system/dept/selecUserByType',{params}) return http.get('/system/dept/selecUserByType',{params})
} }
// 获取厂区列表 // // 获取厂区列表
export function getFactoryAreaList(params) { // export function getFactoryAreaList(params) {
return http.get('/system/dept/selectAllFactoryArea',{params}) // return []
} // // http.get('/system/dept/selectAllFactoryArea',{params})
// }

6
src/api/eam/attachmentFile.js

@ -0,0 +1,6 @@
import http from '../http'
// 文件列表
export function listNoPage(params) {
return http.post('/eam/attachment-file/listNoPage',{params})
}

18
src/api/device.js → src/api/eam/device.js

@ -1,32 +1,32 @@
import http from './http' import http from '../http'
// 根据设备号查询信息 // 根据设备号查询信息
export function getDeviceDetailsByNumber(params) { export function getDeviceDetailsByNumber(params) {
return http.get('/eam/device-accounts/getDetailsByNumber',{params}) return http.get('/eam/device/equipment-accounts/detail',{params})
} }
// 根据厂区查询设备 // 根据厂区查询设备
export function getDeviceByFactoryAreaNumber(factoryAreaNumber) { export function getDeviceByFactoryAreaNumber(factoryAreaNumber) {
return http.get('/eam/device-accounts/selectData?factoryAreaNumber='+factoryAreaNumber) return http.get('/eam/device/equipment-accounts/noPage')
} }
// 添加报修 // 添加报修
export function deviceRepairCreate(data) { export function deviceRepairCreate(data) {
return http.post('/eam/device-repair-request/create',data) return http.post('/eam/equipment-report-repair-request/create',data)
} }
// 报修列表 // 报修列表
export function deviceRepairPage(params) { export function deviceRepairPage(params) {
return http.get('/eam/device-repair-request/getAppPage',{params}) return http.get('/eam/equipment-report-repair-request/page',{params})
} }
// 撤销 // 撤销
export function rejected(id) { export function rejected(id) {
return http.delete('/eam/device-repair-request/rejected?id='+id) return http.delete('/eam/device-repair-request/rejected?id='+id)
} }
// 设备列表 // 设备列表
export function deviceList(params) { export function deviceNoPage(params) {
return http.get('/eam/device-accounts/selectData',{params}) return http.get('/eam/device/equipment-accounts/noPage',{params})
} }
// 设备分页列表 // 设备分页列表
export function devicePage(params) { export function devicePage(params) {
return http.get('/eam/device-accounts/getAppPage',{params}) return http.get('/eam/device/equipment-accounts/page',{params})
} }
// 根据设备号码获取二级列表 // 根据设备号码获取二级列表
export function getSubList(params) { export function getSubList(params) {
@ -34,5 +34,5 @@ export function getSubList(params) {
} }
// 新增申领备件时获取备件列表 // 新增申领备件时获取备件列表
export function getApplyDeviceList() { export function getApplyDeviceList() {
return http.get('/eam/device-accounts/selectAll') return http.get('/eam/device/equipment-accounts/noPage')
} }

6
src/api/dict.js → src/api/eam/dict.js

@ -1,8 +1,8 @@
import http from './http' import http from '../http'
// 获取字典 // 获取字典
export function getDictList(type) { export function getDictList(type) {
return http.get('/eam/device-maintenance-job-main/getDictList?type=' + type) return http.get('/system/dict-data/queryByDictType?dictType=' + type)
} }
export async function getDict(type) { export async function getDict(type) {
let data =[] let data =[]
@ -11,7 +11,7 @@ export async function getDict(type) {
data = res.data.map(item=>{ data = res.data.map(item=>{
return { return {
label:item.label, label:item.label,
value:item.code, value:item.value,
} }
}) })
} else {} } else {}

119
src/api/eam/repairOrder.js

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

13
src/api/spareParts.js → src/api/eam/spareParts.js

@ -1,7 +1,7 @@
import http from './http' import http from '../http'
// 获取tabs备件列表 // 获取tabs备件列表
export function getSparePartsPage(params) { export function getSparePartsPage(params) {
return http.get('/eam/item/getAppPage',{params}) return http.get('/eam/item-accounts/page',{params})
} }
// 获取备件列表 // 获取备件列表
export function getSparePartsList(params) { export function getSparePartsList(params) {
@ -9,9 +9,14 @@ export function getSparePartsList(params) {
} }
// 新增申领备件时获取备件列表 // 新增申领备件时获取备件列表
export function getApplySparePartsList() { export function getApplySparePartsList() {
return http.get('/eam/item/getApplyList') return http.get('/eam/basic/spare-part/noPage')
} }
// 新增申领备件时获取备件列表
export function getItemAccountsNoPage() {
return http.get('/eam/item-accounts/noPage')
}
// 新增备件维修获取备件列表 // 新增备件维修获取备件列表
export function getServiceSparePartsList() { export function getServiceSparePartsList() {
return http.get('/eam/item/getItemMaintainList') return http.get('/eam/basic/spare-part/noPage')
} }

18
src/api/eam/sparePartsApplication.js

@ -0,0 +1,18 @@
import http from '../http'
// 备件领用列表
export function sparePartsApplicationPage(params) {
return http.get('/eam/spare-parts-apply-main/page',{params})
}
// 领用备件
export function sparePartsApplicationCreate(data) {
return http.post('/eam/spare-parts-apply-main/create',data)
}
// 撤回领用备件
export function sparePartsApplicationCancle(id) {
return http.get('/eam/spare-parts-apply-main/backout?id=' + id)
}
// 领用备件详情
export function sparePartsApplicationDetail(masterId) {
return http.get('/eam/spare-parts-apply-detail/page?masterId=' + masterId)
}

14
src/api/eam/sparePartsApplicationApprove.js

@ -0,0 +1,14 @@
import http from '../http'
// 备件领用审批列表
export function sparePartsApplicationApprovePage(params) {
return http.get('/eam/spare-parts-apply-main/page',{params})
}
// 通过申请
export function sparePartsApplicationAgree(id) {
return http.get('/eam/spare-parts-apply-main/agree?id='+id)
}
// 驳回申请
export function sparePartsApplicationReject(id) {
return http.get('/eam/spare-parts-apply-main/disAgree?id='+id)
}

6
src/api/sparePartsServiceWorkOrderList.js → src/api/eam/sparePartsServiceWorkOrderList.js

@ -1,10 +1,10 @@
import http from './http' import http from '../http'
// 领用备件 // 领用备件
export function sparePartsServiceWorkOrderListCreate(data) { export function sparePartsServiceWorkOrderListCreate(data) {
return http.post('/eam/item-maintenance-record/create',data) return http.post('/eam/repair-spare-parts-request/create',data)
} }
// 备件维修列表 // 备件维修列表
export function sparePartsServiceWorkOrderListPage(params) { export function sparePartsServiceWorkOrderListPage(params) {
return http.get('/eam/item-maintenance-record/getAppPage',{params}) return http.get('/eam/repair-spare-parts-request/page',{params})
} }

25
src/api/eam/tool.js

@ -0,0 +1,25 @@
import http from '../http'
// 根据模具号查询信息
export function getToolDetailsByNumber(params) {
return http.get('/eam/tool/tool-accounts/get',{params})
}
// 根据厂区查询模具
export function getToolByFactoryAreaNumber(factoryAreaNumber) {
return http.get('/eam/tool/tool-accounts/noPage')
}
// 模具分页列表
export function toolPage(params) {
return http.get('/eam/tool/tool-accounts/page',{params})
}
// 模具列表
export function toolList(params) {
return http.get('/eam/tool/tool-accounts/noPage',{params})
}
// 模具列表不分页
export function toolNoPage(params) {
return http.get('/eam/tool/tool-accounts/noPage',{params})
}
// 新增申领备件时获取模具列表
export function getApplyToolList() {
return http.get('/eam/tool/tool-accounts/noPage')
}

21
src/api/mold.js

@ -1,21 +0,0 @@
import http from './http'
// 根据模具号查询信息
export function getMoldDetailsByNumber(params) {
return http.get('/eam/mold-accounts/getDetailsByNumber',{params})
}
// 根据厂区查询模具
export function getMoldByFactoryAreaNumber(factoryAreaNumber) {
return http.get('/eam/mold-accounts/selectData?factoryAreaNumber='+factoryAreaNumber)
}
// 模具分页列表
export function moldPage(params) {
return http.get('/eam/mold-accounts/getAppPage',{params})
}
// 模具列表
export function moldList(params) {
return http.get('/eam/mold-accounts/selectData',{params})
}
// 新增申领备件时获取模具列表
export function getApplyMoldList() {
return http.get('/eam/item-accounts/selectAll')
}

47
src/api/repairOrder.js

@ -1,47 +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 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})
}

8
src/api/request2.js

@ -2291,10 +2291,12 @@ export function getFileList(tableName, tableId) {
* @param {*} * @param {*}
* *
*/ */
import * as auth from '@/common/utils/auth.js'
import * as storage from '@/common/utils/storage.js'
import * as config from '@/static/config.js'
export function uploadFile(tableName, tableId, filePath, callBack) { export function uploadFile(tableName, tableId, filePath, callBack) {
var token = storage.getStorage(storage.constant.token) var token = auth.getAccessToken()
var url = config.request_url + baseApi var url = config.default.upload_url
uni.uploadFile({ uni.uploadFile({
url: url + "/infra/file/upload?tableName=" + tableName + "&tableId=" + tableId, url: url + "/infra/file/upload?tableName=" + tableName + "&tableId=" + tableId,
filePath: filePath, filePath: filePath,

18
src/api/sparePartsApplication.js

@ -1,18 +0,0 @@
import http from './http'
// 备件领用列表
export function sparePartsApplicationPage(params) {
return http.get('/eam/item-apply-request-main/getAppPage',{params})
}
// 领用备件
export function sparePartsApplicationCreate(data) {
return http.post('/eam/item-apply-request-main/create',data)
}
// 撤回领用备件
export function sparePartsApplicationCancle(id) {
return http.get('/eam/item-apply-request-main/backout?id=' + id)
}
// 领用备件详情
export function sparePartsApplicationDetail(number) {
return http.get('/eam/item-apply-request-main/appGetByNumber?number=' + number)
}

14
src/api/sparePartsApplicationApprove.js

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

16
src/api/wms/workShop.js

@ -0,0 +1,16 @@
import http from '../http'
// 获取车间
export function getWorkshopNoPage(params) {
return http.get('/wms/workshop/noPage',{params})
}
// 获取库区
export function getAreaBasicInfoNoPage(params) {
return http.get('/wms/areabasic/list',{params})
}
// 获取库位
export function getLocationBasicInfoNoPage(params) {
return http.get('/wms/locationgroup/list',{params})
}

2
src/main.ts

@ -9,6 +9,7 @@ import App from './App.vue'
import tab from './plugins/tab' import tab from './plugins/tab'
import modal from './plugins/modal' import modal from './plugins/modal'
import time from './plugins/time' import time from './plugins/time'
import auth from './plugins/auth'
// unocss // unocss
@ -30,6 +31,7 @@ export function createApp() {
app.config.globalProperties.$modal = modal app.config.globalProperties.$modal = modal
// 时间对象 // 时间对象
app.config.globalProperties.$time = time app.config.globalProperties.$time = time
app.config.globalProperties.$auth = auth

51
src/pages.json

@ -1687,80 +1687,80 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, { }, {
"path": "pages/device/index", "path": "pages/eam/device/index",
"style": { "style": {
"navigationBarTitleText": "设备列表", "navigationBarTitleText": "设备列表",
"navigationBarBackgroundColor": "#409eff", "navigationBarBackgroundColor": "#409eff",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
}, { }, {
"path": "pages/mold/index", "path": "pages/eam/tool/index",
"style": { "style": {
"navigationBarTitleText": "模具", "navigationBarTitleText": "工装列表",
"navigationBarBackgroundColor": "#409eff", "navigationBarBackgroundColor": "#409eff",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
}, { }, {
"path": "pages/spareParts/index", "path": "pages/eam/spareParts/index",
"style": { "style": {
"navigationBarTitleText": "备件", "navigationBarTitleText": "备件",
"navigationBarBackgroundColor": "#409eff", "navigationBarBackgroundColor": "#409eff",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
},{ },{
"path": "pages/deviceReport/index", "path": "pages/eam/deviceReport/index",
"style": { "style": {
"navigationBarTitleText": "设备报修", "navigationBarTitleText": "设备报修",
"navigationStyle": "custom" "navigationStyle": "custom"
} }
},{ },{
"path": "pages/deviceReport/addForm", "path": "pages/eam/deviceReport/addForm",
"style": { "style": {
"navigationBarTitleText": "添加报修", "navigationBarTitleText": "添加报修",
"navigationBarBackgroundColor": "#409eff", "navigationBarBackgroundColor": "#409eff",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
},{ },{
"path": "pages/deviceReport/myDeviceReport", "path": "pages/eam/deviceReport/myDeviceReport",
"style": { "style": {
"navigationBarTitleText": "我的报修", "navigationBarTitleText": "我的报修",
"navigationStyle": "custom" "navigationStyle": "custom"
} }
},{ },{
"path": "pages/repairOrder/index", "path": "pages/eam/repairOrder/index",
"style": { "style": {
"navigationBarTitleText": "维修工单", "navigationBarTitleText": "维修工单",
"navigationStyle": "custom" "navigationStyle": "custom"
} }
},{ },{
"path": "pages/repairOrder/addForm", "path": "pages/eam/repairOrder/addForm",
"style": { "style": {
"navigationBarTitleText": "添加维修工单", "navigationBarTitleText": "添加维修工单",
"navigationBarBackgroundColor": "#409eff", "navigationBarBackgroundColor": "#409eff",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
},{ },{
"path": "pages/repairOrder/detail", "path": "pages/eam/repairOrder/detail",
"style": { "style": {
"navigationBarTitleText": "维修工单详情", "navigationBarTitleText": "维修工单详情",
"navigationBarBackgroundColor": "#409eff", "navigationBarBackgroundColor": "#409eff",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
},{ },{
"path": "pages/repairOrder/myOrder", "path": "pages/eam/repairOrder/myOrder",
"style": { "style": {
"navigationBarTitleText": "我的维修工单", "navigationBarTitleText": "我的维修工单",
"navigationStyle": "custom" "navigationStyle": "custom"
} }
},{ },{
"path": "pages/repairOrder/addServiceRecord", "path": "pages/eam/repairOrder/addServiceRecord",
"style": { "style": {
"navigationBarTitleText": "添加维修内容", "navigationBarTitleText": "添加维修内容",
"navigationBarBackgroundColor": "#409eff", "navigationBarBackgroundColor": "#409eff",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
},{ },{
"path": "pages/repairOrder/transfer", "path": "pages/eam/repairOrder/transfer",
"style": { "style": {
"navigationBarTitleText": "转办", "navigationBarTitleText": "转办",
"navigationBarBackgroundColor": "#409eff", "navigationBarBackgroundColor": "#409eff",
@ -1840,56 +1840,56 @@
"navigationStyle": "custom" "navigationStyle": "custom"
} }
},{ },{
"path": "pages/sparePartsApplication/index", "path": "pages/eam/sparePartsApplication/index",
"style": { "style": {
"navigationBarTitleText": "领用申请", "navigationBarTitleText": "领用申请",
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
},{ },{
"path": "pages/sparePartsApplication/addForm", "path": "pages/eam/sparePartsApplication/addForm",
"style": { "style": {
"navigationBarTitleText": "领用备件", "navigationBarTitleText": "领用备件",
"navigationBarBackgroundColor": "#409eff", "navigationBarBackgroundColor": "#409eff",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
},{ },{
"path": "pages/sparePartsApplication/detail", "path": "pages/eam/sparePartsApplication/detail",
"style": { "style": {
"navigationBarTitleText": "详情", "navigationBarTitleText": "详情",
"navigationBarBackgroundColor": "#409eff", "navigationBarBackgroundColor": "#409eff",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
},{ },{
"path": "pages/sparePartsApplication/mySparePartsApplication", "path": "pages/eam/sparePartsApplication/mySparePartsApplication",
"style": { "style": {
"navigationBarTitleText": "我的领用", "navigationBarTitleText": "我的领用",
"navigationBarBackgroundColor": "#409eff", "navigationBarBackgroundColor": "#409eff",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
},{ },{
"path": "pages/sparePartsServiceWorkOrderList/addForm", "path": "pages/eam/sparePartsServiceWorkOrderList/addForm",
"style": { "style": {
"navigationBarTitleText": "添加备件维修工单", "navigationBarTitleText": "添加备件维修工单",
"navigationBarBackgroundColor": "#409eff", "navigationBarBackgroundColor": "#409eff",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
},{ },{
"path": "pages/sparePartsServiceWorkOrderList/mySparePartsService", "path": "pages/eam/sparePartsServiceWorkOrderList/mySparePartsService",
"style": { "style": {
"navigationBarTitleText": "我的备件维修", "navigationBarTitleText": "我的备件维修",
"navigationBarBackgroundColor": "#409eff", "navigationBarBackgroundColor": "#409eff",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
},{ },{
"path": "pages/sparePartsApplicationApprove/index", "path": "pages/eam/sparePartsApplicationApprove/index",
"style": { "style": {
"navigationBarTitleText": "领用申请审批", "navigationBarTitleText": "领用申请审批",
"navigationStyle": "custom", "navigationStyle": "custom",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }
},{ },{
"path": "pages/sparePartsApplicationApprove/mySparePartsApplicationApprove", "path": "pages/eam/sparePartsApplicationApprove/mySparePartsApplicationApprove",
"style": { "style": {
"navigationBarTitleText": "我的领用审批", "navigationBarTitleText": "我的领用审批",
"navigationBarBackgroundColor": "#409eff", "navigationBarBackgroundColor": "#409eff",
@ -2093,7 +2093,14 @@
"navigationBarTitleText": "待报工", "navigationBarTitleText": "待报工",
"enablePullDownRefresh": true "enablePullDownRefresh": true
} }
} },
{
"path" : "pages/eam/repairOrder/myRepairRequest",
"style" :
{
"navigationBarTitleText" : ""
}
},

25
src/pages/device/index.vue → src/pages/eam/device/index.vue

@ -21,10 +21,10 @@
{{item.name}} {{item.name}}
</view> </view>
<view class="dec1"> <view class="dec1">
{{item.number}} {{item.code}}
</view> </view>
<view class="dec2"> <view class="dec2">
{{item.factoryAreaName}} {{item.workshopName}}
</view> </view>
</view> </view>
</view> </view>
@ -50,8 +50,9 @@
import { import {
getAccessToken getAccessToken
} from '@/utils/auth' } from '@/utils/auth'
import * as deviceApi from "@/api/device.js" import * as deviceApi from "@/api/eam/device.js"
import Search from '../../components/search/index.vue' import * as workShopApi from "@/api/wms/workShop.js"
import Search from '../../../components/search/index.vue'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const params = ref({ const params = ref({
pageNo: 1, pageNo: 1,
@ -82,9 +83,19 @@
deviceApi.devicePage(params.value).then((res) => { deviceApi.devicePage(params.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
list.value = list.value.concat(res.data.list); workShopApi.getWorkshopNoPage({}).then(response=>{
params.value.pageNo++; res.data.list.forEach(item => {
status.value = 'loadmore' const matchingElement = response.data.find(element => {
return element.code == item.workshopCode
});
if (matchingElement) {
item.workshopName = matchingElement.name;
}
});
list.value = list.value.concat(res.data.list);
params.value.pageNo++;
status.value = 'loadmore'
})
} else { } else {
status.value = 'nomore' status.value = 'nomore'
} }

247
src/pages/deviceReport/addForm.vue → src/pages/eam/deviceReport/addForm.vue

@ -5,6 +5,17 @@
<u-form-item label="故障描述" prop="describes" required> <u-form-item label="故障描述" prop="describes" required>
<u-input v-model="form.describes" placeholder="请输入故障描述" /> <u-input v-model="form.describes" placeholder="请输入故障描述" />
</u-form-item> </u-form-item>
<u-form-item label="故障类型" prop="urgency" required>
<view class="select" @click="openSingleColumn('urgency',form.urgency,appDeviceMoldUrgency)">
<view class="input" v-if='form.urgency'>
{{form.urgencyName}}
</view>
<view class="placeholder" v-else>
{{`请选择故障类型`}}
</view>
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon>
</view>
</u-form-item>
<u-form-item label="类型" prop="type" required> <u-form-item label="类型" prop="type" required>
<view class="select" @click="openSingleColumn('type',form.type,appDeviceMoldType)"> <view class="select" @click="openSingleColumn('type',form.type,appDeviceMoldType)">
<view class="input" v-if='form.type'> <view class="input" v-if='form.type'>
@ -16,37 +27,37 @@
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon> <u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon>
</view> </view>
</u-form-item> </u-form-item>
<u-form-item :label="`${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码`" prop="deviceNumber" required> <u-form-item :label="`${type=='DEVICE'?'设备' : '工装'}编码`" prop="equipmentCode" required>
<u-input v-model="form.deviceNumber" :placeholder="`请输入${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码`" <u-input v-model="form.equipmentCode" :placeholder="`请输入${type=='DEVICE'?'设备' : '工装'}编码`"
@blur="blur()" @confirm='blur()'/> @blur="blur()" @confirm='blur()'/>
<view class="right-button" @click="chickRightButton"> <view class="right-button" @click="chickRightButton">
扫描 扫描
</view> </view>
</u-form-item> </u-form-item>
<u-form-item :label="`${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}名称`" prop="deviceNumber" required <u-form-item :label="`${type=='DEVICE'?'设备' : '工装'}名称`" prop="equipmentName" required
class="disabled"> class="disabled">
<u-input v-model="form.deviceName" :placeholder="`根据${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码获得`" <u-input v-model="form.equipmentName" :placeholder="`根据${type=='DEVICE'?'设备' : '工装'}编码获得`"
disabled /> disabled />
</u-form-item> </u-form-item>
<u-form-item :label="`厂区编码`" prop="factoryAreaNumber" required class="disabled"> <u-form-item :label="`车间编码`" prop="workshopCode" required class="disabled">
<u-input v-model="form.factoryAreaNumber" <u-input v-model="form.workshopCode"
:placeholder="`根据${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码获得`" disabled /> :placeholder="`根据${type=='DEVICE'?'设备' : '工装'}编码获得`" disabled />
</u-form-item> </u-form-item>
<u-form-item :label="`厂区名称`" prop="factoryAreaName" required class="disabled"> <u-form-item :label="`车间名称`" prop="workshopName" required class="disabled">
<u-input v-model="form.factoryAreaName" <u-input v-model="form.workshopName"
:placeholder="`根据${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码获得`" disabled /> :placeholder="`根据${type=='DEVICE'?'设备' : '工装'}编码获得`" disabled />
</u-form-item> </u-form-item>
<view class="image" style="margin-top: 20rpx;"> <view class="image" style="margin-top: 20rpx;">
<view class="image-list" v-if='imgList.length>0'> <view class="image-list" v-if='fileInfoList.length>0'>
<view class="image-item" v-for="(item,index) in imgList" :key="index"> <view class="image-item" v-for="(item,index) in fileInfoList" :key="index">
<image :src="item" mode=""></image> <image :src="item.path" mode=""></image>
<u-icon name="close-circle-fill" color="red" class="close" size="36" @click="delImage(index)"> <u-icon name="close-circle-fill" color="red" class="close" size="36" @click="delImage(index)">
</u-icon> </u-icon>
</view> </view>
</view> </view>
<view class="image-item image-item1" @click="chooseImage" v-if='imgList.length<3'> <view class="image-item image-item1" @click="chooseImage" v-if='fileInfoList.length<3'>
<image src="../../static/images/photo.png" mode=""></image> <image src="../../../static/images/photo.png" mode=""></image>
</view> </view>
</view> </view>
</u-form> </u-form>
@ -70,28 +81,34 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as deviceApi from "@/api/device.js" import * as deviceApi from "@/api/eam/device.js"
import * as moldApi from "@/api/mold.js" import * as moldApi from "@/api/eam/tool.js"
import * as dictApi from "@/api/dict.js" import * as dictApi from "@/api/eam/dict.js"
import * as deptApi from "@/api/dept.js" import * as deptApi from "@/api/dept.js"
import * as requestApi from "@/api/request2.js"
import * as workShopApi from "@/api/wms/workShop.js"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const loading = ref(false) const loading = ref(false)
const type = ref('') const type = ref('')
const urgency = ref('')
const appDeviceMoldType = ref([]) const appDeviceMoldType = ref([])
const appDeviceMoldUrgency = ref([])
const factoryAreaList = ref([]) const factoryAreaList = ref([])
const form = ref({ const form = ref({
describes: "", describes: "",
deviceNumber: '', equipmentCode: '',
deviceName: '', equipmentName: '',
factoryAreaName: '', workshopName: '',
factoryAreaNumber: '', workshopCode: '',
type: '', type: '',
typeName:'' typeName:'',
urgency: '',
urgencyName: ''
}) })
const singleColumnShow = ref(false) const singleColumnShow = ref(false)
const singleColumnDefaultValue = ref([]) const singleColumnDefaultValue = ref([])
const singleColumnList = ref([]) const singleColumnList = ref([])
const imgList = ref([]) const fileInfoList = ref([])
const field = ref('') const field = ref('')
const msg = ref('') const msg = ref('')
function chickRightButton(field) { function chickRightButton(field) {
@ -101,79 +118,84 @@
} }
uni.scanCode({ uni.scanCode({
success: function (res) { success: function (res) {
form.value.deviceNumber = res.result form.value.equipmentCode = res.result
getDetailsByNumber() getDetailsByNumber()
} }
}); });
} }
function blur() { function blur() {
if (form.value.deviceNumber) { if (form.value.equipmentCode) {
getDetailsByNumber() getDetailsByNumber()
} else { } else {
form.value.deviceName = '' form.value.equipmentName = ''
form.value.factoryAreaName = '' form.value.workshopName = ''
form.value.factoryAreaNumber = '' form.value.workshopCode = ''
} }
} }
// // //
function getFactoryAreaList() { // function getFactoryAreaList() {
deptApi.getFactoryAreaList().then((res) => { // deptApi.getFactoryAreaList().then((res) => {
if (res.data && res.data.length > 0) { // if (res.data && res.data.length > 0) {
res.data.map(item => { // res.data.map(item => {
item.value = item.id // item.value = item.id
item.label = item.name // item.label = item.name
}) // })
factoryAreaList.value = res.data // factoryAreaList.value = res.data
} else { // } else {
factoryAreaList.value = [] // factoryAreaList.value = []
} // }
}).catch(() => { }) // }).catch(() => { })
} // }
// / // /
function getDetailsByNumber() { function getDetailsByNumber() {
if (type.value == 'DEVICE' || type.value == 'TECH') { if (type.value == 'DEVICE') {
deviceApi.getDeviceDetailsByNumber({ deviceApi.getDeviceDetailsByNumber({
number: form.value.deviceNumber, code: form.value.equipmentCode,
type: type.value,
flag:1
}).then((res) => { }).then((res) => {
console.log(res) console.log(res)
if (!res.data) { if (!res.data) {
msg.value = res.msg msg.value = res.msg
form.value.deviceName = '' form.value.equipmentName = ''
form.value.factoryAreaName = '' form.value.workshopCode = ''
form.value.factoryAreaNumber = '' form.value.workshopName = ''
return; return;
} }
form.value.deviceName = res.data.name form.value.equipmentName = res.data.name
form.value.factoryAreaName = res.data.factoryAreaName form.value.workshopCode = res.data.workshopCode
form.value.factoryAreaNumber = res.data.factoryAreaNumber workShopApi.getWorkshopNoPage({}).then(response=>{
form.value.workshopName = response.data.find(item=>{
return item.code = res.data.workshopCode
}).name
})
}).catch((err) => { }).catch((err) => {
console.log(err) console.log(err)
form.value.deviceName = '' form.value.equipmentName = ''
form.value.factoryAreaName = '' form.value.workshopName = ''
form.value.factoryAreaNumber = '' form.value.workshopCode = ''
}) })
} else if (type.value == 'MOLD') { } else if (type.value == 'EQUIPMENT') {
moldApi.getMoldDetailsByNumber({ moldApi.getMoldDetailsByNumber({
number: form.value.deviceNumber, code: form.value.equipmentCode,
flag:1
}).then((res) => { }).then((res) => {
if (!res.data) { if (!res.data) {
msg.value = res.msg msg.value = res.msg
form.value.deviceName = '' form.value.equipmentName = ''
form.value.factoryAreaName = '' form.value.workshopName = ''
form.value.factoryAreaNumber = '' form.value.workshopCode = ''
return; return;
} }
form.value.deviceName = res.data.name form.value.equipmentName = res.data.name
form.value.factoryAreaName = res.data.factoryAreaName form.value.workshopCode = res.data.workshopCode
form.value.factoryAreaNumber = res.data.factoryAreaNumber workShopApi.getWorkshopNoPage({}).then(response=>{
form.value.workshopName = response.data.find(item=>{
return item.code = res.data.workshopCode
}).name
})
}).catch((err) => { }).catch((err) => {
console.log(err) console.log(err)
form.value.deviceName = '' form.value.equipmentName = ''
form.value.factoryAreaName = '' form.value.workshopName = ''
form.value.factoryAreaNumber = '' form.value.workshopCode = ''
}) })
} }
} }
@ -184,15 +206,15 @@
proxy.$modal.showToast('请输入故障描述') proxy.$modal.showToast('请输入故障描述')
return; return;
} }
if (!form.value.factoryAreaNumber) { if (!form.value.workshopCode) {
proxy.$modal.showToast(`请选择选择所属厂区`) proxy.$modal.showToast(`请选择选择所属厂区`)
return; return;
} }
if (!form.value.deviceNumber) { if (!form.value.equipmentCode) {
proxy.$modal.showToast(`请选择${type.value == 'DEVICE' || type.value == 'TECH' ? '设备' : '模具'}`) proxy.$modal.showToast(`请选择${type.value == 'DEVICE' || type.value == 'EQUIPMENT' ? '设备' : '工装'}`)
return; return;
} }
if (!form.value.deviceName) { if (!form.value.equipmentName) {
proxy.$modal.showToast(msg.value) proxy.$modal.showToast(msg.value)
return; return;
} }
@ -202,10 +224,11 @@
} }
const data = { const data = {
describes: form.value.describes, describes: form.value.describes,
deviceNumber: form.value.deviceNumber, urgency: form.value.urgency,
factoryAreaNumber: form.value.factoryAreaNumber, equipmentCode: form.value.equipmentCode,
workshopCode: form.value.workshopCode,
type: type.value, type: type.value,
filePathList: imgList.value, fileInfoList: fileInfoList.value,
} }
proxy.$modal.confirm('是否添加报修').then(() => { proxy.$modal.confirm('是否添加报修').then(() => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
@ -236,7 +259,7 @@
// //
function reset() { function reset() {
form.value = {} form.value = {}
imgList.value = [] fileInfoList.value = []
} }
// //
function openSingleColumn(fieldName, val, list) { function openSingleColumn(fieldName, val, list) {
@ -253,20 +276,24 @@
function chooseSingleColumn(e) { function chooseSingleColumn(e) {
if(form.value[field.value] == e[0].value)return; if(form.value[field.value] == e[0].value)return;
form.value[field.value] = e[0].value form.value[field.value] = e[0].value
if (field.value == 'factoryAreaNumber') { if (field.value == 'workshopCode') {
form.value.deviceNumber = '' form.value.equipmentCode = ''
form.value.deviceName = '' form.value.equipmentName = ''
getDetailsByNumber() getDetailsByNumber()
} }
if (field.value == 'type') { if (field.value == 'type') {
type.value = form.value[field.value] type.value = form.value[field.value]
form.value.typeName = e[0].label form.value.typeName = e[0].label
form.value.deviceNumber = '' form.value.equipmentCode = ''
form.value.deviceName = '' form.value.equipmentName = ''
form.value.factoryAreaName = '' form.value.workshopName = ''
form.value.factoryAreaNumber = '' form.value.workshopCode = ''
// getDetailsByNumber() // getDetailsByNumber()
} }
if (field.value == 'urgency') {
urgency.value = form.value[field.value]
form.value.urgencyName = e[0].label
}
singleColumnShow.value = false singleColumnShow.value = false
} }
function chooseImage() { function chooseImage() {
@ -277,42 +304,56 @@
success: (res) => { success: (res) => {
let filePath = res.tempFilePaths[0] let filePath = res.tempFilePaths[0]
proxy.$modal.loading() proxy.$modal.loading()
// uploadApi.uploadFile({ requestApi.uploadFile(
// filePath: filePath, 'abcdefghijklmnopqrstuvw',
// name: 'file', '1',
// formData: { filePath,
// 'user': 'test' (resJson)=>{
// }, const jsonObject = JSON.parse(resJson)
// }).then(ret => { proxy.$modal.closeLoading()
// proxy.$modal.closeLoading() let fileInfo = {
// imgList.value.push(ret.data) url:'',
// }).catch((err) => { name:'',
// proxy.$modal.closeLoading() size:'',
// }); path:''
}
fileInfo.url = jsonObject.data
fileInfo.name = res.tempFiles[0]?.name
fileInfo.size = res.tempFiles[0]?.size
fileInfo.path = res.tempFiles[0]?.path
fileInfoList.value.push(fileInfo)
}
)
}, },
}); });
} }
// //
function delImage(index) { function delImage(index) {
imgList.value.splice(index, 1) fileInfoList.value.splice(index, 1)
} }
onLoad(async (option) => { onLoad(async (option) => {
if (option.type) type.value = option.type; if (option.type){
appDeviceMoldType.value = await dictApi.getDict('app_device_mold_type') type.value = option.type;
}else{
type.value = 'DEVICE'
}
appDeviceMoldType.value = await dictApi.getDict('device_type')
appDeviceMoldUrgency.value = await dictApi.getDict('failure_reason')
if (type.value == 'DEVICE') { if (type.value == 'DEVICE') {
appDeviceMoldType.value = appDeviceMoldType.value.filter((item => item.value != "MOLD")) // appDeviceMoldType.value = appDeviceMoldType.value.filter((item => item.value != "EQUIPMENT"))
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: '设备报修' title: '设备报修'
}) })
} else { } else {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: '模具报修' title: '工装报修'
}) })
appDeviceMoldType.value =appDeviceMoldType.value.filter((item => item.value == "MOLD")) // appDeviceMoldType.value =appDeviceMoldType.value.filter((item => item.value == "EQUIPMENT"))
} }
form.value.type = appDeviceMoldType.value[0].value form.value.type = appDeviceMoldType.value[0].value
form.value.typeName = appDeviceMoldType.value[0].label form.value.typeName = appDeviceMoldType.value[0].label
getFactoryAreaList() form.value.urgency = appDeviceMoldUrgency.value[0].value
form.value.urgencyName = appDeviceMoldUrgency.value[0].label
}) })
</script> </script>

72
src/pages/deviceReport/index.vue → src/pages/eam/deviceReport/index.vue

@ -21,16 +21,16 @@
报修单号:<span>{{item.number}}</span> 报修单号:<span>{{item.number}}</span>
</view> </view>
<view class="dec"> <view class="dec">
类型:<span>{{item.type=='DEVICE'?'设备':item.type=='TECH'?'工艺':'模具'}}</span> 类型:<span>{{item.type=='DEVICE'?'设备':'工装'}}</span>
</view> </view>
<view class="dec"> <view class="dec">
{{`${params.type=='DEVICE'?'设备' : '模具'}`}}编号:<span>{{item.deviceNumber}}</span> {{`${params.type=='DEVICE'?'设备' : '工装'}`}}编号:<span>{{item.equipmentCode}}</span>
</view> </view>
<view class="dec"> <view class="dec">
{{`${params.type=='DEVICE'?'设备' : '模具'}`}}名称:<span>{{item.name}}</span> {{`${params.type=='DEVICE'?'设备' : '工装'}`}}名称:<span>{{item.equipmentName}}</span>
</view> </view>
<view class="dec"> <view class="dec">
所属厂区:<span>{{item.factoryAreaName}}</span> 所属车间:<span>{{item.workshopName}}</span>
</view> </view>
<view class="images"> <view class="images">
@ -66,7 +66,10 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as deviceApi from "@/api/device.js" import * as deviceApi from "@/api/eam/device.js"
import * as toolApi from "@/api/eam/tool.js"
import * as workShopApi from "@/api/wms/workShop.js"
import * as attachmentFileApi from "@/api/eam/attachmentFile.js"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const params = ref({ const params = ref({
pageNo: 1, pageNo: 1,
@ -79,22 +82,57 @@
const type = ref() const type = ref()
function addForm() { function addForm() {
proxy.$tab.navigateTo(`/pages/deviceReport/addForm?type=${params.value.type}`) proxy.$tab.navigateTo(`/pages/eam/deviceReport/addForm?type=${params.value.type}`)
} }
async function getList() { async function getList() {
if (status.value == 'nomore') return; if (status.value == 'nomore') return;
status.value = 'loading'; status.value = 'loading';
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
await deviceApi.deviceRepairPage(params.value).then((res) => { const res = await deviceApi.deviceRepairPage(params.value)
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
list.value = list.value.concat(res.data.list); const deviceResp = await deviceApi.deviceNoPage()
params.value.pageNo++; const toolResp = await toolApi.toolNoPage()
status.value = 'loadmore' const response = await workShopApi.getWorkshopNoPage({})
} else { const resFiles = await attachmentFileApi.listNoPage({})
status.value = 'nomore' res.data.list.forEach(item => {
} const matchingElement = response.data.find(element => {
}).catch(() => { }) return element.code == item.workshopCode
})
const matchingElement01 = deviceResp.data.find(element01 => {
return item.type == 'DEVICE' && element01.code == item.equipmentCode
})
const matchingElement02 = toolResp.data.find(element02 => {
return item.type == 'EQUIPMENT' && element02.code == item.equipmentCode
})
const matchingElement03 = resFiles.data?.filter(element03 => {
if(item.type == 'DEVICE'){
return element03.number == item.number
}else if(item.type == 'EQUIPMENT'){
return element03.number == item.number
}
})
if (matchingElement) {
item.workshopName = matchingElement.name;
}
if (matchingElement01) {
item.equipmentName = matchingElement01.name;
}
if (matchingElement02) {
item.equipmentName = matchingElement02.name;
}
if (matchingElement03) {
item.filePathList = matchingElement03
.filter(fileInfo => fileInfo.number == item.number) //
.map(fileInfo => fileInfo.url); // url
}
})
list.value = list.value.concat(res.data.list);
params.value.pageNo++;
status.value = 'loadmore'
} else {
status.value = 'nomore'
}
} }
function cancle(item) { function cancle(item) {
proxy.$modal.confirm('确定撤销报修吗?').then(() => { proxy.$modal.confirm('确定撤销报修吗?').then(() => {
@ -133,7 +171,7 @@
}) })
} else { } else {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: '模具报修' title: '工装报修'
}) })
} }
}) })

0
src/pages/deviceReport/myDeviceReport.vue → src/pages/eam/deviceReport/myDeviceReport.vue

0
src/pages/repairOrder/addForm.vue → src/pages/eam/repairOrder/addForm.vue

0
src/pages/repairOrder/addServiceRecord.vue → src/pages/eam/repairOrder/addServiceRecord.vue

372
src/pages/repairOrder/detail.vue → src/pages/eam/repairOrder/detail.vue

@ -2,10 +2,15 @@
<!-- 详情 --> <!-- 详情 -->
<view class="detail-container"> <view class="detail-container">
<view class="info"> <view class="info">
<view class="title"> <view class="title">
<view>维修工单</view> <view>维修工单</view>
<view @click="transfer" <!-- <view @click="transfer"
v-if="data.status == 'PECEIVED' && (!serviceList || serviceList && serviceList.length == 0)">转办 v-if="data.status == 'PECEIVED' && (!serviceList || serviceList && serviceList.length == 0)">转办
</view> -->
<view @click="transfer"
v-if="data.status == 'PECEIVED'&&((type=='DEVICE'&&$auth.hasPermi('eam:device-maintenance-job-main:turnToAPP'))||(type=='MOLD'&&$auth.hasPermi('eam:mold-maintenance-job-main:turnToAPP'))||(type=='TECH'&&$auth.hasPermi('eam:tech-maintenance-job-main:turnToAPP')))">
转办
</view> </view>
</view> </view>
<view class="dec"> <view class="dec">
@ -72,6 +77,14 @@
<view>完成时间</view> <view>完成时间</view>
<view>{{$time.formatDate(data.completionTime)}}</view> <view>{{$time.formatDate(data.completionTime)}}</view>
</view> </view>
<view class="dec-item" v-if="data.applyTime">
<view>确认时间</view>
<view>{{$time.formatDate(data.applyTime)}}</view>
</view>
<view class="dec-item" v-if="data.applyContent">
<view>确认意见</view>
<view>{{data.applyContent}}</view>
</view>
<view class="dec-item" v-if="data.verifyTime"> <view class="dec-item" v-if="data.verifyTime">
<view>验证时间</view> <view>验证时间</view>
<view>{{$time.formatDate(data.verifyTime)}}</view> <view>{{$time.formatDate(data.verifyTime)}}</view>
@ -80,7 +93,13 @@
<view>验证人员</view> <view>验证人员</view>
<view>{{data.verifyer}}</view> <view>{{data.verifyer}}</view>
</view> </view>
<view class="dec-item" v-if="data.verifyContent">
<view>验证内容</view>
<view>{{data.verifyContent}}</view>
</view>
</view> </view>
</view> </view>
<div class="line"></div> <div class="line"></div>
<view class="info" style="padding-bottom: 130rpx;"> <view class="info" style="padding-bottom: 130rpx;">
@ -126,7 +145,7 @@
</view> </view>
<view class="dec-item"> <view class="dec-item">
<view>报修时间</view> <view>报修时间</view>
<view>{{$time.formatDate(data.createTime)}}</view> <view>{{data1.createTime? $time.formatDate(data1.createTime):null}}</view>
</view> </view>
<!-- <view>图片</view> --> <!-- <view>图片</view> -->
<view class="images"> <view class="images">
@ -142,12 +161,11 @@
<view class="title-txt"> <view class="title-txt">
{{item.describes}} {{item.describes}}
</view> </view>
<view class="" @click.stop="delService(item)"> <view class="" @click.stop="delService(item)">
<u-icon name="trash" color="#aaaaaa" size="40" <u-icon name="trash" color="#aaaaaa" size="40"
v-if="data.status == 'PENDING' || data.status == 'PECEIVED'" v-if="data.status == 'PECEIVED'"></u-icon>
></u-icon>
</view> </view>
</view> </view>
<view class="dec2"> <view class="dec2">
<view>故障真因</view> <view>故障真因</view>
@ -180,8 +198,7 @@
</view> </view>
<!-- <u-icon name="minus-circle" color="#aaaaaa" size="60" ></u-icon> --> <!-- <u-icon name="minus-circle" color="#aaaaaa" size="60" ></u-icon> -->
</view> </view>
<view class="add-btn" <view class="add-btn" v-if="data.status == 'PENDING' || data.status == 'PECEIVED'">
v-if="data.status == 'PENDING' || data.status == 'PECEIVED'">
<u-button type="primary" @click="addSubForm('creat')"><u-icon name="plus-circle" color="#ffffff" <u-button type="primary" @click="addSubForm('creat')"><u-icon name="plus-circle" color="#ffffff"
size="36"></u-icon>添加维修内容</u-button> size="36"></u-icon>添加维修内容</u-button>
</view> </view>
@ -189,18 +206,26 @@
</view> </view>
</view> </view>
<view class="footer"> <view class="footer">
<view class="btns" v-if="data.status == 'PENDING'"> <view class="btns"
v-if="data.status == 'PENDING'&&((type=='DEVICE'&&$auth.hasPermi('eam:device-maintenance-job-main:orderClickAPP'))||(type=='MOLD'&&$auth.hasPermi('eam:mold-maintenance-job-main:orderClickAPP'))||(type=='TECH'&&$auth.hasPermi('eam:tech-maintenance-job-main:orderClickAPP')))">
<u-button type="primary" @click="orderClick(1)" :loading='loading' :disabled='loading'>接单</u-button> <u-button type="primary" @click="orderClick(1)" :loading='loading' :disabled='loading'>接单</u-button>
</view> </view>
<view class="btns" v-if="data.status == 'PECEIVED'"> <view class="btns" v-if="data.status == 'PECEIVED'">
<u-button shape="shape" type="warning" style="min-width: 120rpx;" :loading='loading1' @click="editForm" <u-button shape="shape" type="warning" style="min-width: 120rpx;" :loading='loading1' @click="editForm"
:disabled='loading1'>修改工单</u-button> :disabled='loading1' v-if="(type=='DEVICE'&&$auth.hasPermi('eam:device-maintenance-job-main:updateAPP'))||(type=='MOLD'&&$auth.hasPermi('eam:mold-maintenance-job-main:updateAPP'))||(type=='TECH'&&$auth.hasPermi('eam:tech-maintenance-job-main:updateAPP'))">修改工单</u-button>
<u-button type="primary" @click="orderClickSuccess()" :loading='loading'
:disabled='loading'>完成</u-button> <u-button type="primary" @click="orderClickSuccess()" :loading='loading' :disabled='loading'
v-if="(type=='DEVICE'&&$auth.hasPermi('eam:device-maintenance-job-main:orderClickFinishAPP'))||(type=='MOLD'&&$auth.hasPermi('eam:mold-maintenance-job-main:orderClickFinishAPP'))||(type=='TECH'&&$auth.hasPermi('eam:tech-maintenance-job-main:orderClickFinishAPP'))">完成</u-button>
</view>
<view class="btns"
v-if="((data.status == 'COMPLETED' && !data.requestNumber) || (data.status == 'APPLYPASS')) && ((type=='DEVICE'&&$auth.hasPermi('eam:device-maintenance-job-main:orderClickVerifyAPP'))||(type=='MOLD'&&$auth.hasPermi('eam:mold-maintenance-job-main:orderClickVerifyAPP'))||(type=='TECH'&&$auth.hasPermi('eam:tech-maintenance-job-main:orderClickVerifyAPP')))">
<u-button type="primary" @click="verify()" :loading='loading' :disabled='loading'>验证</u-button>
</view> </view>
<view class="btns" v-if="data.status == 'COMPLETED'"> <view class="btns"
<u-button type="primary" @click="orderClick(3)" :loading='loading' :disabled='loading'>验证完结</u-button> v-if="(data.status == 'COMPLETED' && data.requestNumber && data.applyer == store.id)&& ((type=='DEVICE'&&$auth.hasPermi('eam:device-maintenance-job-main:orderClickConfirmAPP'))||(type=='MOLD'&&$auth.hasPermi('eam:mold-maintenance-job-main:orderClickConfirmAPP'))||(type=='TECH'&&$auth.hasPermi('eam:tech-maintenance-job-main:orderClickConfirmAPP')))">
<u-button type="primary" @click="orderClickApply()" :loading='loading'
:disabled='loading'>维修确认</u-button>
</view> </view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> <view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view> </view>
@ -216,13 +241,38 @@
</view> </view>
<view class="popup-footer"> <view class="popup-footer">
<view @click="isShowSuccess = false">取消</view> <view @click="isShowSuccess = false">取消</view>
<view class="sure" @click="sure">确认</view> <view class="sure" @click="orderClickFinish">确认</view>
</view>
</u-popup>
<!-- 验证完结-->
<u-popup v-model="isVerifyShowSuccess" mode="center" border-radius="14">
<view class="popup-title">验证完结意见</view>
<view class="popup">
<textarea v-model="data.applyContent" placeholder="请输入内容"></textarea>
</view>
<view class="popup-footer">
<view @click="cancel">取消</view>
<view class="sure" @click="orderClickVerify">确认</view>
</view>
</u-popup>
<!-- 维修确认弹出层 -->
<u-popup v-model="isApplyShowSuccess" mode="center" border-radius="14">
<view class="popup-title">维修确认意见</view>
<view class="popup">
<textarea v-model="data.applyContent" placeholder="请输入内容"></textarea>
</view>
<view class="popup-footer">
<view class="sure" @click="orderClickConfirm('APPLYPASS')">通过</view>
<view class="reject" @click="orderClickConfirm('APPLYREJECTED')" style="color: red;">驳回</view>
</view> </view>
</u-popup> </u-popup>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view> <view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
<u-select v-model="singleColumnShow" mode="single-column" :default-value='singleColumnDefaultValue' <u-select v-model="singleColumnShow" mode="single-column" :default-value='singleColumnDefaultValue'
:list="singleColumnList" @confirm="chooseSingleColumn"></u-select> :list="singleColumnList" @confirm="chooseSingleColumn"></u-select>
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -234,8 +284,8 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as dictApi from "@/api/dict.js" import * as dictApi from "@/api/eam/dict"
import * as repairOrderApi from "@/api/repairOrder.js" import * as repairOrderApi from "@/api/eam/repairOrder"
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
@ -257,15 +307,18 @@
name: '设备信息', name: '设备信息',
value: 1 value: 1
}) })
const data = ref() const data = ref({})
const loading = ref(false) const loading = ref(false)
const loading1 = ref(false) const loading1 = ref(false)
const type = ref('') const type = ref('')
const serviceList = ref([]) const serviceList = ref([])
const isShowSuccess = ref(false) const isShowSuccess = ref(false)
const isVerifyShowSuccess = ref(false)//
const isApplyShowSuccess = ref(false)//
const orderCompleteResult = ref([]) // const orderCompleteResult = ref([]) //
const result = ref('TEMPORARILY') const result = ref('TEMPORARILY')
const data1 = ref('') const data1 = ref('')
const number = ref('')
const singleColumnShow = ref(false) const singleColumnShow = ref(false)
const singleColumnDefaultValue = ref([]) const singleColumnDefaultValue = ref([])
@ -279,17 +332,20 @@
} }
// //
function addSubForm(clickType, item) { function addSubForm(clickType, item) {
if (data.value.status == 'APPLYPASS' || data.value.status == 'COMPLETED') {
return
}
if (data.value.status == 'PENDING') { if (data.value.status == 'PENDING') {
proxy.$modal.showToast('请先接单') proxy.$modal.showToast('请先接单')
return return
} }
if (clickType == 'updata') { if (clickType == 'updata') {
proxy.$tab.navigateTo( proxy.$tab.navigateTo(
`/pages/repairOrder/addServiceRecord?type=${data.value.type}&factoryAreaNumber=${data.value.factoryAreaNumber}&number=${data.value.number}&data=${encodeURIComponent(JSON.stringify(item))}` `/pages/eam/repairOrder/addServiceRecord?type=${data.value.type}&factoryAreaNumber=${data.value.factoryAreaNumber}&number=${data.value.number}&data=${encodeURIComponent(JSON.stringify(item))}&deviceNumber=${data.value.deviceNumber}`
) )
} else { } else {
proxy.$tab.navigateTo( proxy.$tab.navigateTo(
`/pages/repairOrder/addServiceRecord?type=${data.value.type}&factoryAreaNumber=${data.value.factoryAreaNumber}&number=${data.value.number}` `/pages/eam/repairOrder/addServiceRecord?type=${data.value.type}&factoryAreaNumber=${data.value.factoryAreaNumber}&number=${data.value.number}&deviceNumber=${data.value.deviceNumber}`
) )
} }
} }
@ -314,34 +370,39 @@
} }
isShowSuccess.value = true isShowSuccess.value = true
} }
/**
* 维修确认点击时间
*/
function orderClickApply() {
data.value.applyContent = null;
isApplyShowSuccess.value = true
}
/**
* 点击验证完结填写意见
*/
function verify() {
data.value.applyContent = null;
isVerifyShowSuccess.value = true
}
function cancel() {
data.applyContent = null;
isVerifyShowSuccess.value = false
isApplyShowSuccess.value = false
}
function radioGroupChange(e) { function radioGroupChange(e) {
result.value = e result.value = e
} }
function sure() { //
async function orderClickFinish() {
isShowSuccess.value = false isShowSuccess.value = false
orderClick(2)
}
// APP
async function orderClick(type) {
//
// if (this.data.status == 'PENDING') {
// if (this.$store.state.user.dept.parentId != this.data.factoryAreaNumber) {
// this.$modal.showToast('')
// return;
// }
// if (this.$store.state.user.dept.classType != this.data.type) {
// this.$modal.showToast('')
// return;
// }
// }
const dataOne = { const dataOne = {
number: data.value.number, number: data.value.number,
status: data.value.status, status: data.value.status,
id: data.value.id, id: data.value.id,
result: type == 2 ? result.value : '', result: result.value,
requestNumber: data.value.requestNumber, requestNumber: data.value.requestNumber,
content: data.value.applyContent ? data.value.applyContent : ''
} }
// //
const dataTwo = { const dataTwo = {
@ -353,17 +414,78 @@
classes: data.value.classes, classes: data.value.classes,
faultType: data.value.faultType faultType: data.value.faultType
} }
if(type ==2){ //
proxy.$modal.loading('加载中') await repairOrderApi.repairOrderUpdate(dataTwo, type.value).then((res) => { }).catch(() => {
loading.value = true proxy.$modal.closeLoading()
// loading.value = false
if (data.value.status == 'PECEIVED') { })
await repairOrderApi.repairOrderUpdate(dataTwo).then((res) => { }).catch(() => { proxy.$modal.loading('加载中')
proxy.$modal.closeLoading() loading.value = true
await repairOrderApi.orderClickFinish(dataOne, type.value).then((res) => {
if (res.data) {
proxy.$modal.showToast('操作成功')
setTimeout(() => {
proxy.$tab.navigateBack()
loading.value = false loading.value = false
}) }, 1500)
} else {
proxy.$modal.showToast(res.msg)
loading.value = false
} }
await repairOrderApi.orderClick(dataOne).then((res) => { }).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
})
}
/**
* 维修确认
*/
async function orderClickConfirm(status) {
isApplyShowSuccess.value = false
result.value = status
isShowSuccess.value = false
const dataOne = {
number: data.value.number,
status: data.value.status,
id: data.value.id,
result: result.value ,
requestNumber: data.value.requestNumber,
content: data.value.applyContent ? data.value.applyContent : ''
}
proxy.$modal.loading('加载中')
loading.value = true
await repairOrderApi.orderClickConfirm(dataOne, type.value).then((res) => {
if (res.data) {
proxy.$modal.showToast('操作成功')
setTimeout(() => {
proxy.$tab.navigateBack()
loading.value = false
}, 1500)
} else {
proxy.$modal.showToast(res.msg)
loading.value = false
}
}).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
})
}
/**
* 验证确认
*/
async function orderClickVerify() {
isVerifyShowSuccess.value = false
const dataOne = {
number: data.value.number,
status: data.value.status,
id: data.value.id,
result: result.value,
requestNumber: data.value.requestNumber,
content: data.value.applyContent ? data.value.applyContent : ''
}
proxy.$modal.loading('加载中')
loading.value = true
await repairOrderApi.orderClickVerify(dataOne, type.value).then((res) => {
if (res.data) { if (res.data) {
proxy.$modal.showToast('操作成功') proxy.$modal.showToast('操作成功')
setTimeout(() => { setTimeout(() => {
@ -371,60 +493,62 @@
loading.value = false loading.value = false
}, 1500) }, 1500)
} else { } else {
proxy.$modal.showToast('操作失败') proxy.$modal.showToast(res.msg)
loading.value = false loading.value = false
} }
}).catch(() => { }).catch(() => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
loading.value = false loading.value = false
}) })
}else{ }
let tips = data.value.status == 'PENDING' ? '是否接单?' : data.value.status == 'PECEIVED' ? '是否完成?' : data //
.value.status == 'COMPLETED' ? '是否验证完结?' : '' async function orderClick() {
proxy.$modal.confirm(tips).then(async () => { const dataOne = {
proxy.$modal.loading('加载中') number: data.value.number,
loading.value = true status: data.value.status,
// id: data.value.id,
if (data.value.status == 'PECEIVED') { result: '',
await repairOrderApi.repairOrderUpdate(dataTwo).then((res) => { }).catch(() => { requestNumber: data.value.requestNumber,
proxy.$modal.closeLoading() content: data.value.applyContent ? data.value.applyContent : ''
loading.value = false }
}) proxy.$modal.confirm('是否接单').then(async () => {
} proxy.$modal.loading('加载中')
await repairOrderApi.orderClick(dataOne).then((res) => { loading.value = true
if (res.data) { await repairOrderApi.orderClick(dataOne, type.value).then(async (res) => {
proxy.$modal.showToast('操作成功') if (res.data) {
setTimeout(() => { proxy.$modal.showToast('操作成功')
proxy.$tab.navigateBack() await getDeviceRepairDetail(number.value)
loading.value = false await getDeviceRepairDetailsByNumber()
}, 1500) loading.value = false
} else { } else {
proxy.$modal.showToast('操作失败') proxy.$modal.showToast(res.msg)
loading.value = false
}
}).catch(() => {
proxy.$modal.closeLoading()
loading.value = false loading.value = false
}) }
}).catch(() => {
proxy.$modal.closeLoading()
loading.value = false
}) })
} })
} }
// //
function getDeviceRepairDetailsByNumber() { async function getDeviceRepairDetailsByNumber() {
repairOrderApi.getDeviceRepairDetailsByNumber({ if (data.value.requestNumber) {
type: data.value.type, await repairOrderApi.getDeviceRepairDetailsByNumber({
requestNumber: data.value.requestNumber type: type.value,
}).then((res) => { requestNumber: data.value.requestNumber
if (res.data) { }, type.value).then((res) => {
data1.value = res.data if (res.data) {
} data1.value = res.data
}).catch(() => { }) }
}).catch(() => { })
}
} }
// //
function getRepairOrderDetaiList() { function getRepairOrderDetaiList() {
repairOrderApi.repairOrderDetailList({ repairOrderApi.repairOrderDetailList({
number: data.value.number number: number.value,
}).then((res) => { }, type.value).then((res) => {
if (res.data) { if (res.data) {
serviceList.value = res.data serviceList.value = res.data
} }
@ -450,10 +574,8 @@
longPressActions: { longPressActions: {
itemList: ['发送给朋友', '保存图片', '收藏'], itemList: ['发送给朋友', '保存图片', '收藏'],
success: function (data) { success: function (data) {
console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
}, },
fail: function (err) { fail: function (err) {
console.log(err.errMsg);
} }
} }
}); });
@ -472,10 +594,8 @@
// //
function chooseSingleColumn(e) { function chooseSingleColumn(e) {
data.value[field.value] = e[0].value data.value[field.value] = e[0].value
console.log(field.value)
if (field.value == 'classes') { if (field.value == 'classes') {
data.value.classesName = e[0].label data.value.classesName = e[0].label
console.log(data.value.classesName)
} }
if (field.value == 'faultType') { if (field.value == 'faultType') {
data.value.faultTypeName = e[0].label data.value.faultTypeName = e[0].label
@ -496,7 +616,7 @@
proxy.$modal.confirm('是否修改维修工单').then(() => { proxy.$modal.confirm('是否修改维修工单').then(() => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
loading1.value = true loading1.value = true
repairOrderApi.repairOrderUpdate(paramesData).then((res) => { repairOrderApi.repairOrderUpdate(paramesData, type.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data) { if (res.data) {
proxy.$modal.showToast('修改成功') proxy.$modal.showToast('修改成功')
@ -514,11 +634,47 @@
}) })
}) })
} }
async function getDeviceRepairDetail(number) {
const detailParam = {
number: number,
type: type.value,
}
await repairOrderApi.getDeviceRepairDetail(detailParam, type.value).then((res) => {
proxy.$modal.closeLoading()
data.value = res.data.list[0]
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(() => {
proxy.$modal.closeLoading()
loading.value = false
})
}
//
onLoad(async (option) => { onLoad(async (option) => {
if (option.type) type.value = option.type; if (option.type) type.value = option.type;
if (option.data) { if (option.number) {
data.value = JSON.parse(decodeURIComponent(option.data)) number.value = option.number
await getDeviceRepairDetail(number.value)
await getDeviceRepairDetailsByNumber()
} }
changeItem.value = list.value[current.value] changeItem.value = list.value[current.value]
orderCompleteResult.value = await dictApi.getDict('order_complete_result') orderCompleteResult.value = await dictApi.getDict('order_complete_result')
@ -526,27 +682,7 @@
}) })
onShow(async () => { onShow(async () => {
if (data.value.requestNumber) {
getDeviceRepairDetailsByNumber()
list.value = [{
name: '设备信息',
value: 1
}, {
name: '报修信息',
value: 2
}, {
name: '维修内容',
value: 3
}]
} else {
list.value = [{
name: '设备信息',
value: 1
}, {
name: '维修内容',
value: 3
}]
}
getRepairOrderDetaiList() getRepairOrderDetaiList()
maintenanceShift.value = await dictApi.getDict('maintenance_shift') maintenanceShift.value = await dictApi.getDict('maintenance_shift')
faultType.value = await dictApi.getDict('fault_type') faultType.value = await dictApi.getDict('fault_type')

245
src/pages/eam/repairOrder/index.vue

@ -0,0 +1,245 @@
<template>
<!-- 维修工单 -->
<view class="container">
<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" v-if="(params.type=='DEVICE'&&$auth.hasPermi('eam:device-maintenance-job-main:createAPP'))||(params.type==='MOLD'&&$auth.hasPermi('eam:mold-maintenance-job-main:createAPP'))||(params.type==='TECH'&&$auth.hasPermi('eam:tech-maintenance-job-main:createAPP'))"></u-icon>
</template>
</u-navbar>
<view class="list">
<view class="item" v-for="(item,index) in list" :key="index" >
<view class="" @click="itemClick(item,index)">
<view class="title">
<view class="title-txt">
{{item.maintenanceDesc}}
</view>
<u-tag text="待接单" v-if="item.status == 'PENDING'" bg-color='rgba(255,255,255,0)' color='#fe8463' border-color='#fe8463' type="primary" shape='circle'/>
<u-tag text="已撤回" v-else-if="item.status=='REJECTED'" bg-color='rgba(255,255,255,0)' color='#d7d7d7' border-color='#d7d7d7 ' type="warning" shape='circle'/>
<u-tag text="已转办" v-else-if="item.status=='TRANSFERRED'" bg-color='rgba(255,255,255,0)' color='#e01f54' border-color='#e01f54' type="success" shape='circle'/>
<u-tag text="已接单" v-else-if="item.status=='PECEIVED'" bg-color='rgba(255,255,255,0)' color='#005eaa' border-color='#005eaa ' type="error" shape='circle'/>
<u-tag text="已验证" v-else-if="item.status=='VERIFIED'" bg-color='rgba(255,255,255,0)' color='#2EC7C9' border-color='#2EC7C9' type="info" shape='circle'/>
<u-tag text="已完成" v-else-if="item.status=='COMPLETED'" bg-color='rgba(255,255,255,0)' color='#2ba471' border-color='#2ba471' type="info" shape='circle'/>
<u-tag text="报修人已确认" v-else-if="item.status=='APPLYPASS'" bg-color='rgba(255,255,255,0)' color='#2ba471' border-color='#2ba471' type="info" shape='circle'/>
</view>
<view class="dec">
工单单号:<span>{{item.number}}</span>
</view>
<view class="dec">
类型:<span>{{item.type=='DEVICE'?'设备':item.type=='TECH'?'工艺':'模具'}}</span>
</view>
<view class="dec">
{{`${params.type=='DEVICE'?'设备':params.type=='TECH'?'工艺' : '模具'}`}}编号:<span>{{item.deviceNumber}}</span>
</view>
<view class="dec">
{{`${params.type=='DEVICE'?'设备':params.type=='TECH'?'工艺' : '模具'}`}}名称:<span>{{item.name}}</span>
</view>
<view class="dec">
所属厂区:<span>{{item.factoryAreaName}}</span>
</view>
<view class="dec">
班次:<span>{{item.classesName}}</span>
</view>
<view class="dec">
故障类型:<span>{{item.faultTypeName}}</span>
</view>
</view>
<view class="bottom">
<view class="time" style="flex: 1;">
{{`${$time.formatDate(item.createTime)}`}}
</view>
</view>
</view>
</view>
<view style="height: 94rpx;padding-top: 30rpx;">
<u-loadmore :status="status" v-if="status != 'loadmore'" />
</view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
</template>
<script setup lang="ts">
import {
onLoad,
onShow,
onReachBottom
} from '@dcloudio/uni-app'
import {
ref,
getCurrentInstance,
nextTick
} from 'vue'
import * as repairOrderApi from "@/api/eam/repairOrder"
import { useCountStore } from '@/store'
const { proxy } = getCurrentInstance()
// store
const store = useCountStore()
const params = ref({
pageNo: 1,
pageSize: 10,
type: '',
})
const status = ref('loadmore') //
const list = ref([])
function itemClick(item, index) {
proxy.$tab.navigateTo(`/pages/eam/repairOrder/detail?type=${params.value.type}&number=${item.number}`)
}
function addForm(item) {
proxy.$tab.navigateTo(`/pages/eam/repairOrder/addForm?type=${params.value.type}&data=${encodeURIComponent(JSON.stringify(item))}`)
}
async function getList() {
if (status.value == 'nomore') return;
status.value = 'loading';
proxy.$modal.loading('加载中')
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);
params.value.pageNo++;
status.value = 'loadmore'
} else {
status.value = 'nomore'
}
}).catch(() => {
proxy.$modal.closeLoading()
})
}
onLoad((option) => {
if (option.type) params.value.type = option.type;
if (option.flag) params.value.flag = option.flag;
// nextTick(() => {
// //
// if (option.flag) params.value.flag = option.flag;
// });
})
onShow(() => {
params.value.pageNo = 1
list.value = []
status.value = 'loadmore'
getList()
})
onReachBottom(() => {
getList()
})
</script>
<style lang="scss" scoped>
.container{
background: #f5f5f5;
min-height: 100vh;
}
.list {
background: #f5f5f5;
margin-top: 20rpx;
.item {
padding: 30rpx 30rpx 0px 30rpx;
margin-top: 20rpx;
background: white;
.title {
display: flex;
align-items: center;
padding-bottom: 20rpx;
.title-txt {
color: #409eff;
font-weight: bold;
font-size: 36rpx;
width: 0px;
flex: 1;
word-wrap: break-word;
}
.time {
color: #919191;
}
}
.dec {
padding-bottom: 20rpx;
span {
color: #999999;
}
}
.last {
padding-bottom: 30rpx;
}
.bottom {
display: flex;
justify-content: space-between;
align-items: center;
border-top: 1px solid #E4E4E4;
padding: 20rpx 0px;
}
}
}
.list {
background: #f5f5f5;
margin-top: 20rpx;
.item {
padding: 30rpx 30rpx 0px 30rpx;
margin-top: 20rpx;
background: white;
.title {
display: flex;
align-items: center;
padding-bottom: 20rpx;
.title-txt {
color: #409eff;
font-weight: bold;
font-size: 36rpx;
width: 0px;
flex: 1;
}
.time {
color: #919191;
}
}
.dec {
padding-bottom: 20rpx;
span {
color: #999999;
}
}
.last {
padding-bottom: 30rpx;
}
.bottom {
display: flex;
justify-content: space-between;
align-items: center;
border-top: 1px solid #E4E4E4;
padding: 20rpx 0px;
position: relative;
.button {
position: absolute;
right: 0rpx;
}
}
}
}
</style>

29
src/pages/repairOrder/index.vue → src/pages/eam/repairOrder/indexBak.vue

@ -2,9 +2,9 @@
<!-- 维修工单 --> <!-- 维修工单 -->
<view class="container"> <view class="container">
<u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff' <u-navbar back-icon-color='#fff' :background="{ background: '#409eff'}" back-text="" title-color='#fff'
title="维修工单"> :title="params.flag == 2 ? '报修确认' : '维修工单'">
<template v-slot:right> <template v-slot:right v-if="params.flag!='2'">
<u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm"></u-icon> <u-icon name="plus" color="#fff" size="36" style="padding-right: 30rpx;" @click="addForm" v-if="(params.type=='DEVICE'&&$auth.hasPermi('eam:device-maintenance-job-main:createAPP'))||(params.type==='MOLD'&&$auth.hasPermi('eam:mold-maintenance-job-main:createAPP'))||(params.type==='TECH'&&$auth.hasPermi('eam:tech-maintenance-job-main:createAPP'))"></u-icon>
</template> </template>
</u-navbar> </u-navbar>
<view class="list"> <view class="list">
@ -12,7 +12,7 @@
<view class="" @click="itemClick(item,index)"> <view class="" @click="itemClick(item,index)">
<view class="title"> <view class="title">
<view class="title-txt"> <view class="title-txt">
{{item.describes}} {{item.maintenanceDesc}}
</view> </view>
<u-tag text="待接单" v-if="item.status == 'PENDING'" bg-color='rgba(255,255,255,0)' color='#fe8463' border-color='#fe8463' type="primary" shape='circle'/> <u-tag text="待接单" v-if="item.status == 'PENDING'" bg-color='rgba(255,255,255,0)' color='#fe8463' border-color='#fe8463' type="primary" shape='circle'/>
<u-tag text="已撤回" v-else-if="item.status=='REJECTED'" bg-color='rgba(255,255,255,0)' color='#d7d7d7' border-color='#d7d7d7 ' type="warning" shape='circle'/> <u-tag text="已撤回" v-else-if="item.status=='REJECTED'" bg-color='rgba(255,255,255,0)' color='#d7d7d7' border-color='#d7d7d7 ' type="warning" shape='circle'/>
@ -20,6 +20,7 @@
<u-tag text="已接单" v-else-if="item.status=='PECEIVED'" bg-color='rgba(255,255,255,0)' color='#005eaa' border-color='#005eaa ' type="error" shape='circle'/> <u-tag text="已接单" v-else-if="item.status=='PECEIVED'" bg-color='rgba(255,255,255,0)' color='#005eaa' border-color='#005eaa ' type="error" shape='circle'/>
<u-tag text="已验证" v-else-if="item.status=='VERIFIED'" bg-color='rgba(255,255,255,0)' color='#2EC7C9' border-color='#2EC7C9' type="info" shape='circle'/> <u-tag text="已验证" v-else-if="item.status=='VERIFIED'" bg-color='rgba(255,255,255,0)' color='#2EC7C9' border-color='#2EC7C9' type="info" shape='circle'/>
<u-tag text="已完成" v-else-if="item.status=='COMPLETED'" bg-color='rgba(255,255,255,0)' color='#2ba471' border-color='#2ba471' type="info" shape='circle'/> <u-tag text="已完成" v-else-if="item.status=='COMPLETED'" bg-color='rgba(255,255,255,0)' color='#2ba471' border-color='#2ba471' type="info" shape='circle'/>
<u-tag text="报修人已确认" v-else-if="item.status=='APPLYPASS'" bg-color='rgba(255,255,255,0)' color='#2ba471' border-color='#2ba471' type="info" shape='circle'/>
</view> </view>
<view class="dec"> <view class="dec">
工单单号:<span>{{item.number}}</span> 工单单号:<span>{{item.number}}</span>
@ -28,10 +29,10 @@
类型:<span>{{item.type=='DEVICE'?'设备':item.type=='TECH'?'工艺':'模具'}}</span> 类型:<span>{{item.type=='DEVICE'?'设备':item.type=='TECH'?'工艺':'模具'}}</span>
</view> </view>
<view class="dec"> <view class="dec">
{{`${params.type=='DEVICE'?'设备' : '模具'}`}}编号:<span>{{item.deviceNumber}}</span> {{`${params.type=='DEVICE'?'设备':params.type=='TECH'?'工艺' : '模具'}`}}编号:<span>{{item.deviceNumber}}</span>
</view> </view>
<view class="dec"> <view class="dec">
{{`${params.type=='DEVICE'?'设备' : '模具'}`}}名称:<span>{{item.name}}</span> {{`${params.type=='DEVICE'?'设备':params.type=='TECH'?'工艺' : '模具'}`}}名称:<span>{{item.name}}</span>
</view> </view>
<view class="dec"> <view class="dec">
所属厂区:<span>{{item.factoryAreaName}}</span> 所属厂区:<span>{{item.factoryAreaName}}</span>
@ -65,9 +66,10 @@
} from '@dcloudio/uni-app' } from '@dcloudio/uni-app'
import { import {
ref, ref,
getCurrentInstance getCurrentInstance,
nextTick
} from 'vue' } from 'vue'
import * as repairOrderApi from "@/api/repairOrder.js" import * as repairOrderApi from "@/api/eam/repairOrder"
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
@ -81,17 +83,17 @@
const status = ref('loadmore') // const status = ref('loadmore') //
const list = ref([]) const list = ref([])
function itemClick(item, index) { function itemClick(item, index) {
proxy.$tab.navigateTo(`/pages/repairOrder/detail?type=${params.value.type}&data=${encodeURIComponent(JSON.stringify(item))}`) proxy.$tab.navigateTo(`/pages/eam/repairOrder/detail?type=${params.value.type}&number=${item.number}`)
} }
function addForm(item) { function addForm(item) {
proxy.$tab.navigateTo(`/pages/repairOrder/addForm?type=${params.value.type}&data=${encodeURIComponent(JSON.stringify(item))}`) proxy.$tab.navigateTo(`/pages/eam/repairOrder/addForm?type=${params.value.type}&data=${encodeURIComponent(JSON.stringify(item))}`)
} }
async function getList() { async function getList() {
if (status.value == 'nomore') return; if (status.value == 'nomore') return;
status.value = 'loading'; status.value = 'loading';
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
await repairOrderApi.repairOrderPage(params.value).then((res) => { await repairOrderApi.repairOrderPage(params.value,params.value.type).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
list.value = list.value.concat(res.data.list); list.value = list.value.concat(res.data.list);
@ -106,6 +108,11 @@
} }
onLoad((option) => { onLoad((option) => {
if (option.type) params.value.type = option.type; if (option.type) params.value.type = option.type;
if (option.flag) params.value.flag = option.flag;
// nextTick(() => {
// //
// if (option.flag) params.value.flag = option.flag;
// });
}) })
onShow(() => { onShow(() => {
params.value.pageNo = 1 params.value.pageNo = 1

14
src/pages/repairOrder/myOrder.vue → src/pages/eam/repairOrder/myOrder.vue

@ -17,6 +17,7 @@
<u-tag text="已接单" v-else-if="item.status=='PECEIVED'" bg-color='rgba(255,255,255,0)' color='#005eaa' border-color='#005eaa ' type="error" shape='circle'/> <u-tag text="已接单" v-else-if="item.status=='PECEIVED'" bg-color='rgba(255,255,255,0)' color='#005eaa' border-color='#005eaa ' type="error" shape='circle'/>
<u-tag text="已验证" v-else-if="item.status=='VERIFIED'" bg-color='rgba(255,255,255,0)' color='#2EC7C9' border-color='#2EC7C9' type="info" shape='circle'/> <u-tag text="已验证" v-else-if="item.status=='VERIFIED'" bg-color='rgba(255,255,255,0)' color='#2EC7C9' border-color='#2EC7C9' type="info" shape='circle'/>
<u-tag text="已完成" v-else-if="item.status=='COMPLETED'" bg-color='rgba(255,255,255,0)' color='#2ba471' border-color='#2ba471' type="info" shape='circle'/> <u-tag text="已完成" v-else-if="item.status=='COMPLETED'" bg-color='rgba(255,255,255,0)' color='#2ba471' border-color='#2ba471' type="info" shape='circle'/>
<u-tag text="报修人已确认" v-else-if="item.status=='APPLYPASS'" bg-color='rgba(255,255,255,0)' color='#2ba471' border-color='#2ba471' type="info" shape='circle'/>
</view> </view>
<view class="dec"> <view class="dec">
报修单号:<span>{{item.number}}</span> 报修单号:<span>{{item.number}}</span>
@ -39,6 +40,15 @@
<view class="dec"> <view class="dec">
完成时间:<span>{{$time.formatDate(item.completionTime)}}</span> 完成时间:<span>{{$time.formatDate(item.completionTime)}}</span>
</view> </view>
<view class="dec" v-if="item.applyName">
报修人:<span>{{item.applyName}}</span>
</view>
<view class="dec" v-if="item.verifyName">
审核人:<span>{{item.verifyName}}</span>
</view>
<view class="time" v-if="item.verifyName">
审核时间:{{`${$time.formatDate(item.verifyTime)}`}}
</view>
</view> </view>
<view class="bottom"> <view class="bottom">
<view class="time" style="flex: 1;"> <view class="time" style="flex: 1;">
@ -68,7 +78,7 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as repairOrderApi from "@/api/repairOrder.js" import * as repairOrderApi from "@/api/eam/repairOrder"
import { useCountStore } from '@/store' import { useCountStore } from '@/store'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
@ -85,7 +95,7 @@
if (status.value == 'nomore') return; if (status.value == 'nomore') return;
status.value = 'loading'; status.value = 'loading';
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
await repairOrderApi.repairOrderPage(params.value).then((res) => { await repairOrderApi.repairOrderPage(params.value,'DEVICE').then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
list.value = list.value.concat(res.data.list); list.value = list.value.concat(res.data.list);

90
src/pages/eam/repairOrder/myRepairRequest.vue

@ -0,0 +1,90 @@
<template>
<view class="add-form-container">
<view class="list">
<view class="title">
<span>*</span>我的报修
</view>
<view class="add-btn">
<u-button type="primary" @click="openDevice"><u-icon name="plus-circle" color="#ffffff"
size="36"></u-icon>设备报修</u-button>
</view>
<view class="add-btn">
<u-button type="primary" @click="openTool"><u-icon name="plus-circle" color="#ffffff"
size="36"></u-icon>工装报修</u-button>
</view>
</view>
</view>
</template>
<script setup lang="ts">
import {
ref,
getCurrentInstance
} from 'vue'
const { proxy } = getCurrentInstance()
function openDevice() {
proxy.$tab.navigateTo(`/pages/eam/repairOrder/index?type=DEVICE&flag=2`)
}
function openTool() {
proxy.$tab.navigateTo(`/pages/eam/repairOrder/index?type=EQUIPMENT&flag=2`)
}
</script>
<style>
.add-form-container {
min-height: calc(100vh - 140rpx);
background: white;
padding: 0px 0rpx 140rpx;
}
.list {
padding: 0rpx 30rpx;
.item {
display: flex;
margin-bottom: 20rpx;
.item-box {
background: #F5F5F5;
border-radius: 12rpx;
flex: 1;
width: 0rpx;
}
.spare-title {
padding: 20rpx 30rpx;
border-bottom: 1px solid #e4e4e4;
.title-txt {
color: #409eff;
font-size: 30rpx;
font-weight: bold;
}
}
.dec {
color: #9c9c9c;
padding: 20rpx 30rpx 20rpx;
}
}
}
.title {
padding: 32rpx 0rpx;
position: relative;
span {
position: absolute;
left: -16rpx;
color: #fa3534;
top: 19px;
}
}
.add-btn {
display: flex;
justify-content: flex-start;
align-items: center;
margin-top: 20px;
}
</style>

30
src/pages/repairOrder/transfer.vue → src/pages/eam/repairOrder/transfer.vue

@ -407,20 +407,20 @@
form.value[field.value] = chooseUserInfo.value form.value[field.value] = chooseUserInfo.value
isShowSelecUser.value = false isShowSelecUser.value = false
} }
// // //
function getFactoryAreaList() { // function getFactoryAreaList() {
deptApi.getFactoryAreaList().then((res) => { // deptApi.getFactoryAreaList().then((res) => {
if (res.data && res.data.length > 0) { // if (res.data && res.data.length > 0) {
res.data.map(item => { // res.data.map(item => {
item.value = item.id // item.value = item.id
item.label = item.name // item.label = item.name
}) // })
factoryAreaList.value = res.data // factoryAreaList.value = res.data
} else { // } else {
factoryAreaList.value = [] // factoryAreaList.value = []
} // }
}).catch(() => { }) // }).catch(() => { })
} // }
onLoad(async (option) => { onLoad(async (option) => {
if (option.type) type.value = option.type; if (option.type) type.value = option.type;
if (option.id) form.value.id = option.id; if (option.id) form.value.id = option.id;
@ -434,7 +434,7 @@
} }
form.value.receiverType = deviceMoldType.value[0].value form.value.receiverType = deviceMoldType.value[0].value
form.value.receiverTypeTxt = deviceMoldType.value[0].label form.value.receiverTypeTxt = deviceMoldType.value[0].label
getFactoryAreaList() // getFactoryAreaList()
}) })
</script> </script>

226
src/pages/eam/spareParts/index.vue

@ -0,0 +1,226 @@
<template>
<!-- 设备 -->
<view class="work-container">
<view class="cartNull" v-show="!token">
还没有登录<navigator open-type="navigate" url="/pages/login">先登录</navigator>
</view>
<view class="" v-show='token'>
<Search :searchData='searchData' @search='search' @screen='screen' :isShowScreen='false' />
<view class="list">
<view class="item" v-for="(item,index) in list" :key='index'>
<u-image :src="item.images" width='160' height="160">
<template v-slot:error>
<view class="image-error">
<u-icon name="photo" color="#c7c7c7" size="38"></u-icon>
<view style="font-size: 24rpx;">暂无图片</view>
</view>
</template>
</u-image>
<view class="text">
<view class="title">
{{item.name}}
</view>
<view class="dec1">
备件编码{{item.itemNumber}}
</view>
<view class="dec2">
总库存{{item.qty}}
</view>
</view>
</view>
</view>
<view style="height: 94rpx;padding-top: 30rpx;">
<u-loadmore :status="status" v-if="status != 'loadmore'" />
</view>
</view>
<view style="height: constant(safe-area-inset-bottom); height: env(safe-area-inset-bottom);"></view>
</view>
</template>
<script setup lang="ts">
import {
onShow,
onReachBottom
} from '@dcloudio/uni-app'
import {
ref,
getCurrentInstance
} from 'vue'
import {
getAccessToken
} from '@/utils/auth'
import * as sparePartsApi from "@/api/eam/spareParts.js"
import Search from '../../../components/search/index.vue'
const { proxy } = getCurrentInstance()
const params = ref({
pageNo: 1,
pageSize: 10,
type: '',
name: ''
})
const status = ref('loadmore') //
const list = ref([])
const token = ref('')
const searchData = ref({
placeholder:'请输入备件名称'
})
//
function search(keyWord) {
params.value.name = keyWord
params.value.pageNo = 1
list.value = []
status.value = 'loadmore'
getList()
}
function screen() {
proxy.$tab.navigateTo(`/pages/device/screen`)
}
function getList() {
if (status.value == 'nomore') return;
status.value = 'loading';
proxy.$modal.loading('加载中')
sparePartsApi.getSparePartsPage(params.value).then((res) => {
proxy.$modal.closeLoading()
console.log(res)
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(() => { })
}
onShow(() => {
if (getAccessToken()) {
token.value = getAccessToken()
params.value.pageNo = 1
list.value = []
status.value = 'loadmore'
getList()
}
})
onReachBottom(() => {
getList()
})
// export default {
// components: {
// Search
// },
// data() {
// return {
// searchData: {
// placeholder: ''
// },
// params: {
// pageNo: 1,
// pageSize: 10,
// type: '',
// name: ''
// },
// status: 'loadmore', //
// list: [],
// token: ''
// }
// },
// methods: {
// //
// //
// search(keyWord) {
// this.params.name = keyWord
// this.params.pageNo = 1
// this.list = []
// this.status = 'loadmore'
// this.getList()
// },
// //
// screen() {
// this.$tab.navigateTo(`/pages/spareParts/screen`)
// },
// //
// getList() {
// if (this.status == 'nomore') return;
// this.status = 'loading';
// this.$modal.loading('')
// sparePartsApi.getSparePartsPage(this.params).then((res) => {
// this.$modal.closeLoading()
// if (res.data.list.length > 0) {
// this.list = this.list.concat(res.data.list);
// this.params.pageNo++;
// this.status = 'loadmore'
// } else {
// this.status = 'nomore'
// }
// }).catch(()=>{})
// },
// },
// onShow() {
// if (getAccessToken()) {
// this.token = getAccessToken()
// this.params.pageNo = 1
// this.list = []
// this.status = 'loadmore'
// this.getList()
// }
// },
// onReachBottom() {
// this.getList()
// }
// }
</script>
<style lang="scss" scoped>
.work-container{
min-height: 100vh;
background: #f5f5f5;
}
.list {
padding-bottom: 20rpx;
.item {
margin-top: 20rpx;
background: white;
padding: 30rpx;
display: flex;
align-items: center;
.text {
margin-left: 20rpx;
.title {
font-size: 32rpx;
font-weight: bold;
word-wrap: break-word;
}
.dec1 {
font-size: 28rpx;
margin-top: 16rpx;
color: #acacac;
}
.dec2 {
font-size: 28rpx;
margin-top: 6rpx;
color: #acacac;
}
}
}
}
.image-error {
text-align: center;
}
.cartNull {
text-align: center;
padding: 500rpx 40rpx 0;
font-size: 28rpx;
color: #888;
}
.cartNull navigator {
color: #2979ff;
}
</style>

108
src/pages/eam/sparePartsApplication/CustomTableModal.vue

@ -0,0 +1,108 @@
<!-- components/CustomTableModal.vue -->
<template>
<u-popup v-model="localVisible" mode="center" border-radius="14">
<view class="popup-title">{{ title }}</view>
<u-list @scrolltolower="scrolltolower" class="popup">
<u-list-item v-for="(item, index) in tableData" :key="index" @click="handleRowClick(item)">
<u-cell :title="`编号-${item.code}`">
<u-avatar
slot="icon"
shape="square"
size="35"
:src="item.url"
customStyle="margin: -3px 5px -3px 0"
></u-avatar>
<view>{{ item.name }}</view>
<view>库存: {{ item.qty }}</view>
</u-cell>
</u-list-item>
</u-list>
<view class="popup-footer">
<u-button @click="cancel">取消</u-button>
<u-button type="primary" @click="confirmSelection">确认</u-button>
</view>
</u-popup>
</template>
<script setup lang="ts">
import { ref, watch, defineProps, defineEmits } from 'vue';
const props = defineProps({
visible: {
type: Boolean,
required: true
},
list: {
type: Array,
required: true
},
title: {
type: String,
default: '选择项目'
}
});
const emits = defineEmits(['update:visible', 'confirm']);
const localVisible = ref(false);
const selectedRow = ref(null);
const tableData = ref([]);
watch(() => props.visible, (newVal) => {
localVisible.value = newVal;
});
watch(() => props.list, (newList) => {
tableData.value = newList.map((item, index) => ({
...item,
url: item.filePathList
}));
});
watch(localVisible, (newVal) => {
emits('update:visible', newVal);
});
const handleRowClick = (row: any) => {
selectedRow.value = row;
};
const cancel = () => {
localVisible.value = false;
};
const confirmSelection = () => {
if (selectedRow.value) {
emits('confirm', selectedRow.value);
localVisible.value = false;
} else {
alert('请选择一行');
}
};
const scrolltolower = () => {
loadmore();
};
const loadmore = () => {
for (let i = 0; i < 30; i++) {
tableData.value.push({
code: tableData.value.length + 1,
name: 'Item ' + (tableData.value.length + 1),
qty: Math.floor(Math.random() * 100),
url: 'https://cdn.uviewui.com/uview/album/' + ((tableData.value.length % 10) + 1) + '.jpg'
});
}
};
</script>
<style scoped>
.popup-title {
text-align: center;
font-size: 32rpx;
font-weight: bold;
color: #409eff;
padding: 30rpx 30rpx 0px;
}
.popup-footer {
display: flex;
justify-content: space-between;
padding: 10px;
}
.popup {
width: 600rpx;
padding: 30rpx 0rpx 30rpx;
}
</style>

199
src/pages/sparePartsApplication/addForm.vue → src/pages/eam/sparePartsApplication/addForm.vue

@ -2,8 +2,8 @@
<!-- 添加维修工单 --> <!-- 添加维修工单 -->
<view class="add-form-container"> <view class="add-form-container">
<u-form :model="form" ref="formRef" label-width="160rpx"> <u-form :model="form" ref="formRef" label-width="160rpx">
<u-form-item label="申请主题" prop="name" required> <u-form-item label="申请主题" prop="description" required>
<u-input v-model="form.name" placeholder="请输入申请主题" /> <u-input v-model="form.description" placeholder="请输入申请主题" />
</u-form-item> </u-form-item>
</u-form> </u-form>
<view class="list"> <view class="list">
@ -19,30 +19,41 @@
</view> </view>
<u-row gutter="16"> <u-row gutter="16">
<u-col :span="24"> <u-col :span="24">
<view class="dec" v-if="item.type"> <view class="dec" v-if="item.type" style="display: flex; align-items: center;">
类型:{{`${item.type=='DEVICE'?'设备' :item.type=='MOLD'?'模具' : ''}`}} <label for="type">类型:</label>
</view> <span id="type">{{`${item.type=='DEVICE'?'设备' :item.type=='EQUIPMENT'?'工装' : ''}`}}</span>
</u-col> </view>
<u-col :span="24"> </u-col>
<view class="dec" v-if="item.deviceName"> <u-col :span="24">
{{`${item.type=='DEVICE'?'设备' : '模具'}`}}:{{item.deviceName}} <view class="dec" v-if="item.deviceName" style="display: flex; align-items: center;">
</view> <label for="deviceName">{{`${item.type=='DEVICE'?'设备' : '工装'}`}}:</label>
</u-col> <span id="deviceName">{{item.deviceName}}</span>
<u-col :span="24"> </view>
<view class="dec"> </u-col>
是否以旧换新:{{item.isRadeIn=='TRUE'?'是' :'否'}} <u-col :span="24">
</view> <view class="dec" style="display: flex; align-items: center;">
</u-col> <label for="isRadeIn">是否以旧换新:</label>
<u-col :span="24"> <span id="isRadeIn">{{item.isRadeIn=='TRUE'?'是' :'否'}}</span>
<view class="dec"> </view>
库存:{{item.currentQty}} </u-col>
</view> <u-col :span="24">
</u-col> <view class="dec" style="display: flex; align-items: center;">
<u-col :span="24"> <label for="currentQty">库存:</label>
<view class="dec"> <span id="currentQty">{{item.currentQty}}</span>
数量:{{item.qty}} </view>
</view> </u-col>
</u-col> <u-col :span="24">
<view class="dec" style="display: flex; align-items: center;">
<label for="applyQty">数量:</label>
<span id="applyQty">{{item.applyQty}}</span>
</view>
</u-col>
<u-col :span="24">
<view class="dec" style="display: flex; align-items: center;">
<label for="description">描述:</label>
<textarea id="description" v-model="item.description" class="textarea-class"></textarea>
</view>
</u-col>
</u-row> </u-row>
</view> </view>
<u-icon name="minus-circle" color="#aaaaaa" size="60" @click="delSpareParts(index)"></u-icon> <u-icon name="minus-circle" color="#aaaaaa" size="60" @click="delSpareParts(index)"></u-icon>
@ -65,8 +76,8 @@
<view class="popup"> <view class="popup">
<u-form :model="form1" ref="form1Ref" label-width="200rpx"> <u-form :model="form1" ref="form1Ref" label-width="200rpx">
<u-form-item :label="`备件`" prop="number" required> <u-form-item :label="`备件`" prop="number" required>
<view class="select" @click="openSingleColumn('itemNumber',form1.itemNumber,sparePartsList)"> <view class="select" @click="openSingleColumn('sparePartsCode',form1.sparePartsCode,sparePartsList)">
<view class="input" v-if='form1.itemNumber'> <view class="input" v-if='form1.sparePartsCode'>
{{form1.name}} {{form1.name}}
</view> </view>
<view class="placeholder" v-else> <view class="placeholder" v-else>
@ -86,29 +97,33 @@
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon> <u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon>
</view> </view>
</u-form-item> </u-form-item>
<u-form-item :label="`${form1.type=='DEVICE'?'设备' : '模具'}`" prop="deviceNumber"> <u-form-item :label="`${form1.type=='DEVICE'?'设备' : '工装'}`" prop="deviceNumber">
<view class="select" @click="openSingleColumn('deviceNumber',form1.deviceNumber,deviceList)"> <view class="select" @click="openSingleColumn('deviceNumber',form1.deviceNumber,deviceList)">
<view class="input" v-if='form1.deviceNumber'> <view class="input" v-if='form1.deviceNumber'>
{{form1.deviceName}} {{form1.deviceName}}
</view> </view>
<view class="placeholder" v-else> <view class="placeholder" v-else>
{{`请选择${form1.type=='DEVICE'?'设备' : '模具'}`}} {{`请选择${form1.type=='DEVICE'?'设备' : '工装'}`}}
</view> </view>
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon> <u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon>
</view> </view>
</u-form-item> </u-form-item>
<u-form-item label="是否以旧换新" prop="isRadeIn" required class="disabled"> <!-- <u-form-item label="是否以旧换新" prop="isRadeIn" required class="disabled">
<u-radio-group v-model="form1.isRadeIn" :key="updataKey" disabled> <u-radio-group v-model="form1.isRadeIn" :key="updataKey" disabled>
<u-radio :name="'TRUE'"></u-radio> <u-radio :name="'TRUE'"></u-radio>
<u-radio :name="'FALSE'"></u-radio> <u-radio :name="'FALSE'"></u-radio>
</u-radio-group> </u-radio-group>
</u-form-item> </u-form-item> -->
<u-form-item label="库存" prop="currentQty" required class="disabled"> <u-form-item label="库存" prop="currentQty" required class="disabled">
<u-input v-model="form1.currentQty" type="number" disabled placeholder="请输入库存" /> <u-input v-model="form1.currentQty" type="number" disabled placeholder="请输入库存" />
</u-form-item> </u-form-item>
<u-form-item label="数量" prop="qty" required> <u-form-item label="数量" prop="applyQty" required>
<u-input v-model="form1.qty" type="number" placeholder="请输入数量" /> <u-input v-model="form1.applyQty" type="number" placeholder="请输入数量" />
</u-form-item> </u-form-item>
<u-form-item label="描述" prop="description" required>
<u-input v-model="form1.description" type="textarea" class="textarea-class-form" placeholder="请输入描述" />
</u-form-item>
</u-form> </u-form>
</view> </view>
<view class="popup-footer"> <view class="popup-footer">
@ -116,6 +131,14 @@
<view class="sure" @click="addSpare">确认</view> <view class="sure" @click="addSpare">确认</view>
</view> </view>
</u-popup> </u-popup>
<!-- <CustomTableModal
v-model:visible="isTableModalVisible"
:title="tableModalTitle"
:columns="tableModalColumns"
:list="tableModalList"
@confirm="handleTableSelection"
/> -->
<u-select v-model="singleColumnShow" mode="single-column" :default-value='singleColumnDefaultValue' <u-select v-model="singleColumnShow" mode="single-column" :default-value='singleColumnDefaultValue'
:list="singleColumnList" @confirm="chooseSingleColumn" @cancle='singleColumnShow = false'></u-select> :list="singleColumnList" @confirm="chooseSingleColumn" @cancle='singleColumnShow = false'></u-select>
</view> </view>
@ -129,12 +152,12 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as sparePartsApplicationApi from "@/api/sparePartsApplication.js" import * as sparePartsApplicationApi from "@/api/eam/sparePartsApplication.js"
import * as sparePartsApi from "@/api/spareParts.js" import * as sparePartsApi from "@/api/eam/spareParts.js"
import * as deviceApi from "@/api/device.js" import * as deviceApi from "@/api/eam/device.js"
import * as dictApi from "@/api/dict.js" import * as dictApi from "@/api/eam/dict.js"
import * as moldApi from "@/api/mold.js" import * as toolApi from "@/api/eam/tool.js"
import CustomTableModal from './CustomTableModal.vue' //
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const loading = ref(false) const loading = ref(false)
const type = ref('') const type = ref('')
@ -153,19 +176,21 @@
subList: [] subList: []
}) })
const form1 = ref({ const form1 = ref({
itemNumber: undefined, sparePartsCode: undefined,
type: '', type: '',
deviceNumber: undefined, deviceNumber: undefined,
isRadeIn: '', isRadeIn: '',
currentQty: '', currentQty: '',
qty: '' applyQty: ''
}) })
const deviceMoldType = ref([])// const deviceMoldType = ref([])//
const updataKey = ref(0) const updataKey = ref(0)
// //
function submit() { function submit() {
// //
if (!form.value.name) { if (!form.value.description) {
proxy.$modal.showToast('请输入主题') proxy.$modal.showToast('请输入主题')
return; return;
} }
@ -220,10 +245,11 @@
// //
function chooseSingleColumn(e) { function chooseSingleColumn(e) {
form1.value[field.value] = e[0].value form1.value[field.value] = e[0].value
if (field.value == 'itemNumber') { if (field.value == 'sparePartsCode') {
form1.value.name = e[0].label form1.value.name = e[0].label
choosesingleColumnItem.value = singleColumnList.value.filter(item => item.number == e[0].value) choosesingleColumnItem.value = singleColumnList.value.filter(item => item.code == e[0].value)
form1.value.isRadeIn = choosesingleColumnItem.value[0].isRadeIn // form1.value.isRadeIn = choosesingleColumnItem.value[0].isRadeIn
form1.value.isRadeIn = 'TRUE'
form1.value.currentQty = choosesingleColumnItem.value[0].qty form1.value.currentQty = choosesingleColumnItem.value[0].qty
updataKey.value++ updataKey.value++
@ -242,28 +268,42 @@
} }
// //
async function getApplySparePartsList() { async function getApplySparePartsList() {
await sparePartsApi.getApplySparePartsList().then(res => { await sparePartsApi.getApplySparePartsList().then(res => {
res.data.map(item => { sparePartsApi.getItemAccountsNoPage().then(resp => {
item.value = item.number
item.label = item.name const filteredData = res.data.filter(item => {
}) const obj = resp.data.find(element => {
sparePartsList.value = res.data return item.code == element.itemNumber;
}).catch(() => { }) });
// obj null obj.qty 0
return obj && obj.qty > 0;
}).map(item => {
const obj = resp.data.find(element => {
return item.code == element.itemNumber;
});
item.qty = obj?.qty;
item.value = item.code;
item.label = item.name;
return item;
});
sparePartsList.value = filteredData;
});
}).catch(() => { });
} }
// //
async function getApplyDeviceList() { async function getApplyDeviceList() {
if (form1.value.type == 'DEVICE') { if (form1.value.type == 'DEVICE') {
await deviceApi.getApplyDeviceList().then(res => { await deviceApi.getApplyDeviceList().then(res => {
res.data.map(item => { res.data.map(item => {
item.value = item.number item.value = item.code
item.label = item.name item.label = item.name
}) })
deviceList.value = res.data deviceList.value = res.data
}).catch(() => { }) }).catch(() => { })
} else if (form1.value.type == 'MOLD') { } else if (form1.value.type == 'EQUIPMENT') {
moldApi.getApplyMoldList().then((res) => { toolApi.getApplyToolList().then((res) => {
res.data.map(item => { res.data.map(item => {
item.value = item.number item.value = item.code
item.label = item.name item.label = item.name
}) })
deviceList.value = res.data deviceList.value = res.data
@ -273,18 +313,18 @@
// //
function open() { function open() {
form1.value = { form1.value = {
itemNumber: undefined, sparePartsCode: undefined,
type: '', type: '',
deviceNumber: undefined, deviceNumber: undefined,
isRadeIn: '', isRadeIn: '',
currentQty: "", currentQty: "",
qty: '', applyQty: '',
} }
isPopupShow.value = true isPopupShow.value = true
} }
// //
function addSpare() { function addSpare() {
if (!form1.value.itemNumber) { if (!form1.value.sparePartsCode) {
proxy.$modal.showToast('请选择备件') proxy.$modal.showToast('请选择备件')
return; return;
} }
@ -292,16 +332,18 @@
// this.$modal.showToast('') // this.$modal.showToast('')
// return; // return;
// } // }
if (!form1.value.qty || form1.value.qty == 0) { if (!form1.value.applyQty || form1.value.applyQty == 0) {
proxy.$modal.showToast('请输入数量') proxy.$modal.showToast('请输入数量')
return; return;
} }
if (form1.value.qty > form1.value.currentQty) { let totalApplyQty = form.value.subList.reduce((total, item) => total + item.applyQty, 0);
proxy.$modal.showToast('数量不可以大于库存') let countQty = form1.value.currentQty - totalApplyQty;
if (form1.value.applyQty > countQty) {
proxy.$modal.showToast('申请数量总数不可以大于库存')
return; return;
} }
if (form.valuesubList && form.value.subList.length > 0) { if (form.valuesubList && form.value.subList.length > 0) {
let arr = form.value.subList.filter(item => item.itemNumber == form1.value.itemNumber) let arr = form.value.subList.filter(item => item.itemNumber == form1.value.sparePartsCode)
if (arr && arr.length > 0) { if (arr && arr.length > 0) {
proxy.$modal.showToast('该备件已添加') proxy.$modal.showToast('该备件已添加')
return; return;
@ -323,9 +365,11 @@
form.value = JSON.parse(decodeURIComponent(option.data)) form.value = JSON.parse(decodeURIComponent(option.data))
form.value.subList = form.value.subList form.value.subList = form.value.subList
}; };
deviceMoldType.value = await dictApi.getDict('device_mold_type') deviceMoldType.value = await dictApi.getDict('device_type')
await getApplySparePartsList() await getApplySparePartsList()
}) })
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -492,4 +536,29 @@
::v-deep .u-checkbox-group { ::v-deep .u-checkbox-group {
display: grid !important; display: grid !important;
} }
.textarea-class {
flex: 1; /* 占据剩余空间 */
height: 100px;
border-radius: 4px;
font-size: 14px;
resize: vertical; /* 允许用户调整高度 */
::v-deep .uni-textarea-textarea{
width: 40%
}
}
.textarea-class-form {
::v-deep .uni-textarea-textarea{
width: 80%
}
}
.dec {
display: flex;
align-items: center;
}
.dec label {
width: 8%;
margin-right: 10px; /* 调整label和textarea之间的间距 */
}
</style> </style>

38
src/pages/sparePartsApplication/detail.vue → src/pages/eam/sparePartsApplication/detail.vue

@ -8,7 +8,7 @@
<view class="dec"> <view class="dec">
<view class="dec-item"> <view class="dec-item">
<view>申请主题</view> <view>申请主题</view>
<view>{{data.name}}</view> <view>{{data.description}}</view>
</view> </view>
<view class="dec-item"> <view class="dec-item">
<view>申请单号</view> <view>申请单号</view>
@ -22,16 +22,19 @@
备件名称{{cur.itemName}} 备件名称{{cur.itemName}}
</view> </view>
<view class="items-dec" v-if="cur.type"> <view class="items-dec" v-if="cur.type">
类型{{cur.type == 'type'?'设备' :'模具'}} 类型{{cur.type == 'type'?'设备' :'工装'}}
</view> </view>
<view class="items-dec" v-if="cur.name"> <view class="items-dec" v-if="cur.name">
{{cur.type == 'type'?'设备' :'模具'}}名称{{cur.name}} {{cur.type == 'type'?'设备' :'工装'}}名称{{cur.name}}
</view> </view>
<view class="items-dec"> <view class="items-dec">
是否以旧换新{{cur.isRadeIn == 'TRUE'?'是' :'否'}} 是否以旧换新{{cur.isRadeIn == 'TRUE'?'是' :'否'}}
</view> </view>
<view class="items-dec"> <view class="items-dec">
数量{{cur.qty}} 库存{{cur.qty}}
</view>
<view class="items-dec">
申请数量{{cur.applyQty}}
</view> </view>
</view> </view>
</view> </view>
@ -56,17 +59,29 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as sparePartsApplicationApi from "@/api/sparePartsApplication.js" import * as sparePartsApplicationApi from "@/api/eam/sparePartsApplication.js"
import * as sparePartsApplicationApproveApi from "@/api/sparePartsApplicationApprove.js" import * as sparePartsApplicationApproveApi from "@/api/eam/sparePartsApplicationApprove.js"
import * as sparePartsApi from "@/api/eam/spareParts.js"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const number = ref('') const number = ref('')
const masterId = ref('')
const data = ref({}) const data = ref({})
const loading = ref(false) const loading = ref(false)
const from = ref()//13 const from = ref()//13
const type = ref() const type = ref()
function getSparePartsApplicationDetail() { function getSparePartsApplicationDetail() {
sparePartsApplicationApi.sparePartsApplicationDetail(number.value).then((res) => { sparePartsApplicationApi.sparePartsApplicationDetail(masterId.value).then((res) => {
data.value = res.data sparePartsApi.getSparePartsPage({}).then((resp) => {
res.data.list.forEach(element=>{
const ele = resp.data.list.find(item=>{
return element.sparePartsCode == item.itemNumber
})
element.type = ele.type
element.itemName = ele.name
element.qty = ele.qty
})
data.value.subList = res.data.list
})
}).catch(() => { }) }).catch(() => { })
} }
// //
@ -121,6 +136,13 @@
if (option.from) from.value = option.from; if (option.from) from.value = option.from;
if (option.number) { if (option.number) {
number.value = option.number number.value = option.number
data.value.number = option.number
}
if (option.masterId){
masterId.value = option.masterId
}
if (option.description){
data.value.description = option.description
} }
}) })
onShow(() => { onShow(() => {

9
src/pages/sparePartsApplication/index.vue → src/pages/eam/sparePartsApplication/index.vue

@ -22,7 +22,7 @@
申请单号:<span>{{item.number}}</span> 申请单号:<span>{{item.number}}</span>
</view> </view>
<view class="dec"> <view class="dec">
:<span>{{item.applyName}}</span> :<span>{{item.applyer}}</span>
</view> </view>
<view class="bottom"> <view class="bottom">
<view class="status"> <view class="status">
@ -61,7 +61,7 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as sparePartsApplicationApi from "@/api/sparePartsApplication.js" import * as sparePartsApplicationApi from "@/api/eam/sparePartsApplication.js"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const params = ref({ const params = ref({
pageNo: 1, pageNo: 1,
@ -71,10 +71,10 @@
const status = ref('loadmore') // const status = ref('loadmore') //
const list = ref([]) const list = ref([])
function openDetail(item, index) { function openDetail(item, index) {
proxy.$tab.navigateTo(`/pages/sparePartsApplication/detail?number=${item.number}`) proxy.$tab.navigateTo(`/pages/eam/sparePartsApplication/detail?number=${item.number}&masterId=${item.id}&description=${item.description}`)
} }
function addForm(item) { function addForm(item) {
proxy.$tab.navigateTo(`/pages/sparePartsApplication/addForm`) proxy.$tab.navigateTo(`/pages/eam/sparePartsApplication/addForm`)
} }
async function getList() { async function getList() {
if (status.value == 'nomore') return; if (status.value == 'nomore') return;
@ -170,6 +170,7 @@
} }
.bottom { .bottom {
position: static !important;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;

2
src/pages/sparePartsApplication/mySparePartsApplication.vue → src/pages/eam/sparePartsApplication/mySparePartsApplication.vue

@ -70,7 +70,7 @@
const status = ref('loadmore') // const status = ref('loadmore') //
const list = ref([]) const list = ref([])
function openDetail(item, index) { function openDetail(item, index) {
proxy.$tab.navigateTo(`/pages/sparePartsApplication/detail?number=${item.number}`) proxy.$tab.navigateTo(`/pages/eam/sparePartsApplication/detail?number=${item.number}`)
} }
async function getList() { async function getList() {
if (status.value == 'nomore') return; if (status.value == 'nomore') return;

10
src/pages/sparePartsApplicationApprove/index.vue → src/pages/eam/sparePartsApplicationApprove/index.vue

@ -6,7 +6,7 @@
</u-navbar> </u-navbar>
<!-- <Search @search='search' @screen='screen' /> --> <!-- <Search @search='search' @screen='screen' /> -->
<view class="list"> <view class="list">
<view class="item" v-for="(item,index) in list" :key="index" @click="openDetail(item)"> <view class="item" v-for="(item,index) in list" :key="index" @click="(item)">
<view class="title"> <view class="title">
<view class="title-txt"> <view class="title-txt">
{{item.name}} {{item.name}}
@ -42,7 +42,6 @@
<u-button shape="circle" type="primary" size="mini" style="min-width: 120rpx;margin-left: 20rpx;" <u-button shape="circle" type="primary" size="mini" style="min-width: 120rpx;margin-left: 20rpx;"
v-if="item.status==0" @click="agree(item)">通过</u-button> v-if="item.status==0" @click="agree(item)">通过</u-button>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
@ -60,7 +59,7 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as sparePartsApplicationApproveApi from "@/api/sparePartsApplicationApprove.js" import * as sparePartsApplicationApproveApi from "@/api/eam/sparePartsApplicationApprove.js"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const params = ref({ const params = ref({
pageNo: 1, pageNo: 1,
@ -73,10 +72,10 @@
function openDetail(item, index) { function openDetail(item, index) {
console.log(from.value) console.log(from.value)
proxy.$tab.navigateTo(`/pages/sparePartsApplication/detail?number=${item.number}&from=${from.value}`) proxy.$tab.navigateTo(`/pages/eam/sparePartsApplication/detail?number=${item.number}&from=${from.value}`)
} }
function addForm(item) { function addForm(item) {
proxy.$tab.navigateTo(`/pages/sparePartsApplication/addForm`) proxy.$tab.navigateTo(`/pages/eam/sparePartsApplication/addForm`)
} }
async function getList() { async function getList() {
if (status.value == 'nomore') return; if (status.value == 'nomore') return;
@ -186,6 +185,7 @@
} }
.bottom { .bottom {
position: static !important;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;

2
src/pages/sparePartsApplicationApprove/mySparePartsApplicationApprove.vue → src/pages/eam/sparePartsApplicationApprove/mySparePartsApplicationApprove.vue

@ -71,7 +71,7 @@
const status = ref('loadmore') // const status = ref('loadmore') //
const list = ref([]) const list = ref([])
function openDetail(item) { function openDetail(item) {
proxy.$tab.navigateTo(`/pages/sparePartsApplication/detail?number=${item.number}&from=1`) proxy.$tab.navigateTo(`/pages/eam/sparePartsApplication/detail?number=${item.number}&from=1`)
} }
async function getList() { async function getList() {
if (status.value == 'nomore') return; if (status.value == 'nomore') return;

209
src/pages/sparePartsServiceWorkOrderList/addForm.vue → src/pages/eam/sparePartsServiceWorkOrderList/addForm.vue

@ -8,9 +8,9 @@
</u-form> --> </u-form> -->
<view class="list"> <view class="list">
<view class="title"> <view class="title">
<span>*</span>申请备件 <span>*</span>备件维修
</view> </view>
<view class="item " v-for="(item,index) in form.itemNumbers" :key="index"> <view class="item " v-for="(item,index) in form" :key="index">
<view class="item-box"> <view class="item-box">
<view class="spare-title"> <view class="spare-title">
<view class="title-txt"> <view class="title-txt">
@ -20,22 +20,22 @@
<u-row gutter="16"> <u-row gutter="16">
<u-col :span="24"> <u-col :span="24">
<view class="dec"> <view class="dec">
:{{item.locationNumber}} :{{item.areaName}}
</view> </view>
</u-col> </u-col>
<u-col :span="24"> <u-col :span="24">
<view class="dec"> <view class="dec">
数量:{{item.qty}} 库位:{{item.locationName}}
</view> </view>
</u-col> </u-col>
<u-col :span="24"> <u-col :span="24">
<view class="dec"> <view class="dec">
维修结果:{{item.result == 'YES'?'完成':'未完成'}} 数量:{{item.qty}}
</view> </view>
</u-col> </u-col>
<u-col :span="24"> <u-col :span="24">
<view class="dec"> <view class="dec">
维修原因:{{item.reasons}} 维修原因:{{item.repairCause}}
</view> </view>
</u-col> </u-col>
</u-row> </u-row>
@ -59,9 +59,9 @@
<view class="popup-title">添加备件</view> <view class="popup-title">添加备件</view>
<view class="popup"> <view class="popup">
<u-form :model="form1" ref="formRef" label-width="200rpx"> <u-form :model="form1" ref="formRef" label-width="200rpx">
<u-form-item :label="`备件`" prop="itemNumber" required> <u-form-item :label="`备件`" prop="sparePartsCode" required>
<view class="select" @click="openSingleColumn('itemNumber',form1.itemNumber,sparePartsList)"> <view class="select" @click="openSingleColumn('sparePartsCode',form1.sparePartsCode,sparePartsList)">
<view class="input" v-if='form1.itemNumber'> <view class="input" v-if='form1.sparePartsCode'>
{{form1.name}} {{form1.name}}
</view> </view>
<view class="placeholder" v-else> <view class="placeholder" v-else>
@ -70,23 +70,23 @@
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon> <u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon>
</view> </view>
</u-form-item> </u-form-item>
<u-form-item label="库位" prop="locationNumber" required v-if="isShow"> <u-form-item label="库区" prop="areaCode" required>
<u-input v-model="form1.locationNumber" placeholder="请输入库位" @blur="blur()" @confirm='blur()'/> <u-input v-model="form1.areaName" placeholder="请选择备件" disabled="true" @blur="blur()" @confirm='blur()'/>
<view class="right-button" @click="chickRightButton"> <view class="right-button" @click="chickRightButton" v-if="isShow">
扫描 扫描
</view> </view>
</u-form-item> </u-form-item>
<u-form-item label="数量" prop="qty" required> <u-form-item label="库位" prop="locationCode" required>
<u-input v-model="form1.qty" type="number" placeholder="请输入数量" /> <u-input v-model="form1.locationName" placeholder="请选择备件" disabled="true" @blur="blur()" @confirm='blur()'/>
<view class="right-button" @click="chickRightButton" v-if="isShow">
扫描
</view>
</u-form-item> </u-form-item>
<u-form-item label="维修结果" prop="reasons" required> <u-form-item label="数量" prop="qty" required >
<u-radio-group v-model="form1.result"> <u-input v-model="form1.qty" type="number" disabled="true" placeholder="请输入数量" />
<u-radio :name="item.value" v-for="(item,index) in result"
:key="index">{{item.label}}</u-radio>
</u-radio-group>
</u-form-item> </u-form-item>
<u-form-item label="维修原因" prop="reasons" required> <u-form-item label="维修原因" prop="repairCause" required>
<u-input v-model="form1.reasons" placeholder="请输入维修原因" /> <u-input v-model="form1.repairCause" placeholder="请输入维修原因" />
</u-form-item> </u-form-item>
</u-form> </u-form>
</view> </view>
@ -108,10 +108,11 @@
ref, ref,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
import * as sparePartsApi from "@/api/spareParts.js" import * as sparePartsApi from "@/api/eam/spareParts.js"
import * as sparePartsServiceWorkOrderListApi from "@/api/sparePartsServiceWorkOrderList.js" import * as sparePartsServiceWorkOrderListApi from "@/api/eam/sparePartsServiceWorkOrderList.js"
import * as dictApi from "@/api/dict.js" import * as dictApi from "@/api/eam/dict.js"
import * as locationApi from "@/api/location.js" import * as locationApi from "@/api/location.js"
import * as workShopApi from "@/api/wms/workShop.js"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const loading = ref(false) const loading = ref(false)
const type = ref('') const type = ref('')
@ -124,36 +125,37 @@
const singleColumnList = ref([]) const singleColumnList = ref([])
const field = ref('') const field = ref('')
const form = ref({ const form = ref([])
itemNumbers: []
})
const form1 = ref({ const form1 = ref({
itemNumber: "", sparePartsCode: "",
qty: '', qty: '',
result: 'YES', result: 'YES',
reasons: '', repairCause: '',
locationNumber: '', locationCode: '',
areaNumber: '' areaCode: '',
locationName: '',
areaName: '',
}) })
const result = ref([]) const result = ref([])
const isShow = ref(false) const isShow = ref(false)
const choosesingleColumnItem = ref() const choosesingleColumnItem = ref()
const isInAccount = ref() const sparePartsCode = ref()
const itemNumber = ref()
const msg = ref('') const msg = ref('')
const areaBasicInfo = ref([])
const locationBasicInfo = ref([])
// //
function submit() { function submit() {
// //
if (form.value.itemNumbers == 0) { if (form1.value == 0) {
proxy.$modal.showToast('请选择备件') proxy.$modal.showToast('请选择备件')
return; return;
} }
proxy.$modal.confirm('是否添加备件维修工单').then(() => { proxy.$modal.confirm('是否添加备件维修工单').then(() => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
loading.value = true loading.value = true
sparePartsServiceWorkOrderListApi.sparePartsServiceWorkOrderListCreate(form.value).then(( sparePartsServiceWorkOrderListApi.sparePartsServiceWorkOrderListCreate(form1.value).then((
res) => { res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data) { if (res.data) {
@ -178,8 +180,15 @@
} }
// //
function reset() { function reset() {
form.value = { form1.value = {
itemNumbers: [] sparePartsCode: "",
qty: '',
result: 'YES',
repairCause: '',
locationCode: '',
areaCode: '',
locationName: '',
areaName: ''
} }
} }
// //
@ -192,86 +201,116 @@
} else { } else {
singleColumnDefaultValue.value = [] singleColumnDefaultValue.value = []
} }
workShopApi.getAreaBasicInfoNoPage({}).then(res=>{
areaBasicInfo.value = res.data
})
workShopApi.getLocationBasicInfoNoPage({}).then(res=>{
locationBasicInfo.value = res.data
})
singleColumnShow.value = true singleColumnShow.value = true
} }
// //
function chooseSingleColumn(e) { function chooseSingleColumn(e) {
form1.value[field.value] = e[0].value form1.value[field.value] = e[0].value
if (field.value == 'itemNumber') { if (field.value == 'sparePartsCode') {
choosesingleColumnItem.value = singleColumnList.value.filter(item => item.number == e[0].value) choosesingleColumnItem.value = singleColumnList.value.filter(item => item.code == e[0].value)
form1.value.name = e[0].label form1.value.name = e[0].label
form1.value.locationNumber = choosesingleColumnItem.value[0].locationNumber form1.value.qty = 1
form1.value.areaNumber = choosesingleColumnItem.value[0].areaNumber form1.value.locationCode = choosesingleColumnItem.value[0].locationCode
if (!choosesingleColumnItem.value[0].locationNumber) { form1.value.areaCode = choosesingleColumnItem.value[0].areaCode
form1.value.areaName = areaBasicInfo.value?.find(item=>{
return item.code == form1.value.areaCode
})?.name
form1.value.locationName = locationBasicInfo.value?.find(item=>{
return item.code == form1.value.locationCode
})?.name
if (!choosesingleColumnItem.value[0].locationCode) {
isShow.value = true isShow.value = true
} else { } else {
isShow.value = false isShow.value = false
itemNumber.value = '' sparePartsCode.value = ''
} }
} }
singleColumnShow.value = false singleColumnShow.value = false
} }
// //
async function getServiceSparePartsList() { async function getServiceSparePartsList() {
await sparePartsApi.getServiceSparePartsList().then(res => { await sparePartsApi.getServiceSparePartsList().then(res => {
res.data.map(item => { sparePartsApi.getItemAccountsNoPage().then(resp => {
item.value = item.number const filteredData = res.data.filter(item => {
item.label = item.name // respitem.code
}) const matchedRespItem = resp.data.find(respItem => respItem.itemNumber === item.code);
sparePartsList.value = res.data if (matchedRespItem) {
}).catch(() => { }) // item
item.areaCode = matchedRespItem.areaNumber;
item.locationCode = matchedRespItem.locationNumber;
item.singlePrice = matchedRespItem.singlePrice;
item.qty = matchedRespItem.qty;
item.value = item.code;
item.label = item.name;
return true; //
}
return false; //
});
sparePartsList.value = filteredData;
debugger
});
}).catch(() => { });
} }
// //
function chickRightButton(field) { function chickRightButton(field) {
uni.scanCode({ uni.scanCode({
success: function (res) { success: function (res) {
form1.value.locationNumber = res.result form1.value.locationCode = res.result
getLocation() getLocation()
} }
}); });
} }
function getLocation() { function getLocation() {
locationApi.getLocation(form1.value.locationNumber).then(res => { workShopApi.getAreaBasicInfoNoPage({code:form1.value.locationCode}).then(res => {
if (!res.data) { if (!res.data[0]) {
msg.value = res.msg ? res.msg : '找不到该库位' msg.value = res.msg ? res.msg : '找不到该库位'
proxy.$modal.showToast(msg.value) proxy.$modal.showToast(msg.value)
form1.value.areaCode =''
form1.value.areaNumber ='' sparePartsCode.value = ''
isInAccount.value = ''
itemNumber.value = ''
return; return;
} }
msg.value = '' msg.value = ''
form1.value.areaNumber = res.data.areaNumber; form1.value.areaCode = res.data[0].areaCode;
isInAccount.value = res.data.isInAccount sparePartsCode.value = res.data[0].sparePartsCode
itemNumber.value = res.data.itemNumber
}).catch(() => { }) }).catch(() => { })
} }
function blur() { function blur() {
if (form1.value.locationNumber) { if (form1.value.locationCode) {
getLocation() getLocation()
} }
} }
// //
function open() { function open() {
form1.value = { form1.value = {
itemNumber: "", sparePartsCode: "",
qty: '', qty: '',
result: 'YES', result: 'YES',
reasons: '', repairCause: '',
locationNumber: '', locationCode: '',
areaNumber: '' areaCode: '',
locationName: '',
areaName: ''
} }
isPopupShow.value = true isPopupShow.value = true
} }
// //
function addSpare() { function addSpare() {
// //
if (!form1.value.itemNumber) { if (!form1.value.sparePartsCode) {
proxy.$modal.showToast('请选择备件') proxy.$modal.showToast('请选择备件')
return; return;
} }
if (!form1.value.locationNumber) { if (!form1.value.areaCode) {
proxy.$modal.showToast('请扫描库区')
return;
}
if (!form1.value.locationCode) {
proxy.$modal.showToast('请扫描库位') proxy.$modal.showToast('请扫描库位')
return; return;
} }
@ -279,46 +318,42 @@
proxy.$modal.showToast(msg.value) proxy.$modal.showToast(msg.value)
return; return;
} }
if (isInAccount.value == 'TRUE') { if (sparePartsCode.value) {
proxy.$modal.showToast('该库位属于帐内库,请选择帐外库')
return;
}
if (itemNumber.value) {
proxy.$modal.showToast('该库位已绑定过备件') proxy.$modal.showToast('该库位已绑定过备件')
return; return;
} }
if (!form1.value.qty) { // if (!form1.value.qty) {
proxy.$modal.showToast(`请输入数量`) // proxy.$modal.showToast(``)
return; // return;
} // }
if (!form1.value.result) { // if (!form1.value.result) {
proxy.$modal.showToast('请选择维修结果') // proxy.$modal.showToast('')
return; // return;
} // }
if (!form1.value.reasons) { if (!form1.value.repairCause) {
proxy.$modal.showToast('请输入维修原因') proxy.$modal.showToast('请输入维修原因')
return; return;
} }
if (form.value.itemNumbers && form.value.itemNumbers.length > 0) { if (form.value && form.value.length > 0) {
let arr = form.value.itemNumbers.filter(item => item.itemNumber == form1.value.itemNumber) let arr = form.value.filter(item => item.sparePartsCode == form1.value.sparePartsCode)
if (arr && arr.length > 0) { if (arr && arr.length > 0) {
proxy.$modal.showToast('该备件已添加') proxy.$modal.showToast('该备件已添加')
return; return;
} }
} }
if (form.value.itemNumbers && form.value.itemNumbers.length > 0) { if (form.value && form.value.length > 0) {
let arr1 = form.value.itemNumbers.filter(item => item.locationNumber == form1.value.locationNumber) let arr1 = form.value.filter(item => item.locationCode == form1.value.locationCode)
if (arr1 && arr1.length > 0) { if (arr1 && arr1.length > 0) {
proxy.$modal.showToast('该库位已经绑定备件') proxy.$modal.showToast('该库位已经绑定备件')
return; return;
} }
} }
form.value.itemNumbers.push(form1.value) form.value.push(form1.value)
isPopupShow.value = false isPopupShow.value = false
} }
// //
function delSpareParts(index) { function delSpareParts(index) {
form.value.itemNumbers.splice(index, 1) form.value.splice(index, 1)
} }
onLoad(async (option) => { onLoad(async (option) => {
if (option.type) type.value = option.type; if (option.type) type.value = option.type;

0
src/pages/sparePartsServiceWorkOrderList/mySparePartsService.vue → src/pages/eam/sparePartsServiceWorkOrderList/mySparePartsService.vue

32
src/pages/mold/index.vue → src/pages/eam/tool/index.vue

@ -23,10 +23,10 @@
{{item.name}} {{item.name}}
</view> </view>
<view class="dec1"> <view class="dec1">
{{item.number}} {{item.code}}
</view> </view>
<view class="dec2"> <view class="dec2">
{{item.factoryAreaName}} {{item.workshopName}}
</view> </view>
</view> </view>
</view> </view>
@ -51,8 +51,9 @@
import { import {
getAccessToken getAccessToken
} from '@/utils/auth' } from '@/utils/auth'
import * as moldApi from "@/api/mold.js" import * as toolApi from "@/api/eam/tool.js"
import Search from '../../components/search/index.vue' import * as workShopApi from "@/api/wms/workShop.js"
import Search from '../../../components/search/index.vue'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const params = ref({ const params = ref({
pageNo: 1, pageNo: 1,
@ -64,7 +65,7 @@
const list = ref([]) const list = ref([])
const token = ref('') const token = ref('')
const searchData = ref({ const searchData = ref({
placeholder:'请输入模具名称' placehTooler:'请输入模具名称'
}) })
// //
@ -82,12 +83,23 @@
if (status.value == 'nomore') return; if (status.value == 'nomore') return;
status.value = 'loading'; status.value = 'loading';
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
moldApi.moldPage(params.value).then((res) => { toolApi.toolPage(params.value).then((res) => {
proxy.$modal.closeLoading() proxy.$modal.closeLoading()
if (res.data.list.length > 0) { if (res.data.list.length > 0) {
list.value = list.value.concat(res.data.list); workShopApi.getWorkshopNoPage({}).then(response=>{
params.value.pageNo++; res.data.list.forEach(item => {
status.value = 'loadmore' const matchingElement = response.data.find(element => {
return element.code == item.workshopCode
});
if (matchingElement) {
item.workshopName = matchingElement.name;
}
});
list.value = list.value.concat(res.data.list);
params.value.pageNo++;
status.value = 'loadmore'
})
} else { } else {
status.value = 'nomore' status.value = 'nomore'
} }
@ -128,7 +140,7 @@
.title { .title {
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bTool;
word-wrap: break-word; word-wrap: break-word;
} }

4
src/pages/spareParts/index.vue

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

2
src/plugins/auth.js

@ -1,4 +1,4 @@
import store from '@/store' // import store from '@/store'
function authPermission(permission) { function authPermission(permission) {
const all_permission = "*:*:*" const all_permission = "*:*:*"

3
src/static/config.js

@ -1,8 +1,9 @@
let request_url = "http://dev.ccwin-in.com:25102/api/admin-api" let request_url = "http://dev.ccwin-in.com:25102/api/admin-api"
let upload_url = "http://localhost:12080/admin-api"
let isDevelopment = true let isDevelopment = true
export default { export default {
upload_url,
request_url, request_url,
isDevelopment isDevelopment
} }

Loading…
Cancel
Save