Browse Source

fix: 最新代码改成vue3

master
张立 2 months ago
parent
commit
d2a381e47b
  1. 17
      .env.development
  2. 11
      .env.production
  3. 14
      .env.test
  4. 4
      nginx.conf
  5. 10
      package.json
  6. 7592
      pnpm-lock.yaml
  7. 17
      sfms3.0-uniapp3/App.vue
  8. 20
      sfms3.0-uniapp3/index.html
  9. 22
      sfms3.0-uniapp3/main.js
  10. 72
      sfms3.0-uniapp3/manifest.json
  11. 17
      sfms3.0-uniapp3/pages.json
  12. 52
      sfms3.0-uniapp3/pages/index/index.vue
  13. BIN
      sfms3.0-uniapp3/static/logo.png
  14. 10
      sfms3.0-uniapp3/uni.promisify.adaptor.js
  15. 76
      sfms3.0-uniapp3/uni.scss
  16. 12
      src/api/dept.js
  17. 6
      src/api/eam/attachmentFile.js
  18. 5
      src/api/eam/basicFaultType.js
  19. 43
      src/api/eam/device.js
  20. 20
      src/api/eam/dict.js
  21. 57
      src/api/eam/inspection.js
  22. 24
      src/api/eam/location.js
  23. 119
      src/api/eam/repairOrder.js
  24. 22
      src/api/eam/spareParts.js
  25. 18
      src/api/eam/sparePartsApplication.js
  26. 14
      src/api/eam/sparePartsApplicationApprove.js
  27. 10
      src/api/eam/sparePartsServiceWorkOrderList.js
  28. 57
      src/api/eam/spotcheck.js
  29. 25
      src/api/eam/tool.js
  30. 104
      src/api/eam/upkeepOrder.js
  31. 11
      src/api/eam/user.js
  32. 96
      src/api/http.ts
  33. 5
      src/api/location.js
  34. 2
      src/api/login.js
  35. 21
      src/api/mes/dict/dictApi.ts
  36. 54
      src/api/mes/orderDay/index.ts
  37. 15
      src/api/mes/productBackline/productBacklineApi.ts
  38. 23
      src/api/mes/productOffline/productOfflineApi.ts
  39. 8
      src/api/mes/qaForm/index.ts
  40. 15
      src/api/mes/reworkBatch/reworkBatchApi.ts
  41. 15
      src/api/mes/reworkSingle/reworkSingleApi.ts
  42. 13
      src/api/mes/workScheduling/addBasicItem/index.ts
  43. 149
      src/api/mes/workScheduling/index.ts
  44. 35
      src/api/overhaulOrder.js
  45. 828
      src/api/request2.js
  46. 19
      src/api/spotCheckOrder.js
  47. 21
      src/api/wms/workShop.js
  48. 117
      src/common/appUpdate.js
  49. 50
      src/common/array.js
  50. 139
      src/common/balance.js
  51. 177
      src/common/basic.js
  52. 10
      src/common/calc.js
  53. 281
      src/common/detail.js
  54. 181
      src/common/directory.js
  55. 107
      src/common/label.js
  56. 101
      src/common/record.js
  57. 236
      src/common/style/new_style.css
  58. 31
      src/common/style/pdabasic.css
  59. 138
      src/common/utils/common.ts
  60. 50
      src/common/utils/dateTime.ts
  61. 19
      src/common/utils/http.ts
  62. 16
      src/common/utils/storage.js
  63. 31
      src/common/utils/utils.ts
  64. 783
      src/common/utils/validator.ts
  65. 269
      src/components/item/slectItemList.vue
  66. 299
      src/components/my-paging/my-paging.vue
  67. 85
      src/components/search/index.vue
  68. 885
      src/components/show-modal/show-modal.vue
  69. 87
      src/components/tags/index.vue
  70. 469
      src/components/verifition/Verify.vue
  71. 14
      src/components/verifition/utils/ase.js
  72. 17
      src/components/verifition/utils/request.js
  73. 555
      src/components/verifition/verifyPoint/verifyPoint.vue
  74. 661
      src/components/verifition/verifySlider/verifySlider.vue
  75. 11
      src/main.ts
  76. 37
      src/manifest.json
  77. 239
      src/mycomponents/balance/balance.vue
  78. 2
      src/mycomponents/balance/balanceDetailPopup.vue
  79. 2
      src/mycomponents/balance/balanceMove.vue
  80. 85
      src/mycomponents/balance/balanceSelect.vue
  81. 29
      src/mycomponents/balance/batch.vue
  82. 51
      src/mycomponents/balance/bussinessType.vue
  83. 125
      src/mycomponents/balance/handleBalance.vue
  84. 42
      src/mycomponents/balance/location.vue
  85. 55
      src/mycomponents/balance/pack.vue
  86. 87
      src/mycomponents/balance/productionLabel.vue
  87. 127
      src/mycomponents/balance/recommendBalance.vue
  88. 42
      src/mycomponents/balance/toLocation.vue
  89. 74
      src/mycomponents/button/requestButton.vue
  90. 46
      src/mycomponents/common/comBlankView.vue
  91. 29
      src/mycomponents/common/comEmptyView.vue
  92. 4
      src/mycomponents/common/comListHint.vue
  93. 124
      src/mycomponents/common/comListItem.vue
  94. 1026
      src/mycomponents/common/comMessage.vue
  95. 25
      src/mycomponents/common/comPopup.vue
  96. 111
      src/mycomponents/container/targetContainer.vue
  97. 315
      src/mycomponents/detail/comDetailCard.vue
  98. 270
      src/mycomponents/detail/comRequestDetailCard.vue
  99. 44
      src/mycomponents/detail/detailBalanceInfo.vue
  100. 103
      src/mycomponents/detail/detailCommonInfo.vue

17
.env.development

@ -1,4 +1,15 @@
VITE_BASE_URL=http://localhost:12080/admin-api
#VITE_BASE_URL=http://dev.ccwin-in.com:25203/api/admin-api
VITE_BASE_URL_IMAGE=http://localhost:12080/admin-api
#VITE_BASE_URL=http://dev.ccwin-in.com:28051/api/admin-api
# VITE_BASE_URL_IMAGE=http://172.22.32.9:81/admin-api
# 租户配置
VITE_TENANT='[{"text":"英泰","value":1}]'
# 是否是测试环境
VITE_isDevelopment=true
# 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://172.22.32.9:90'
# 项目管理模式 批次货/包装
VITE_MANAGE_MODEL="BY_BATCH"

11
.env.production

@ -1,4 +1,7 @@
# VITE_BASE_URL=http://dev.ccwin-in.com:23111/app
# VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:23111
VITE_BASE_URL=https://tmsapp.hongxianggroup.com.cn
VITE_BASE_URL_IMAGE=https://tmsapp.hongxianggroup.com.cn
VITE_BASE_URL=http://172.21.32.14:81/api/admin-api VITE_BASE_URL_IMAGE=http://172.21.32.14:81/admin-api # 租户配置 VITE_TENANT='[{"text":"长春","value":1},{"text":"成都","value":2}]'
# 是否是测试环境
VITE_isDevelopment=false
# 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://172.21.32.14:90'

14
.env.test

@ -1,2 +1,12 @@
VITE_BASE_URL=http://dev.ccwin-in.com:25303/api/admin-api
VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25303/api/admin-api
VITE_BASE_URL=http://dev.ccwin-in.com:25300/api/admin-api
VITE_BASE_URL_IMAGE=http://dev.ccwin-in.com:25300/admin-api
# 租户配置
VITE_TENANT='[{"text":"长春","value":1},{"text":"成都","value":2}]'
# 是否是测试环境
VITE_isDevelopment=false
# 积木报表请求路径
VITE_JMREPORT_BASE_URL='http://dev.ccwin-in.com:25310'

4
nginx.conf

@ -27,10 +27,10 @@ http {
gzip_vary on;
gzip_disable "MSIE [1-6]\.";
upstream eam {
server localhost:25310 weight=10 max_fails=3 fail_timeout=10s;
server localhost:25210 weight=10 max_fails=3 fail_timeout=10s;
}
server {
listen 25303;
listen 25203;
server_name_in_redirect off;
server_name dev.ccwin-in.com;
location /api/ {

10
package.json

@ -11,10 +11,16 @@
"test:mp-weixin": "uni build -p mp-weixin",
"test:app": "uni build -p app",
"test:custom": "uni build -p",
"prod": "uni build --mode production",
"prod:mp-weixin": "uni build -p mp-weixin --mode production",
"prod:app": "uni build -p app --mode production",
"prod:custom": "uni build -p --mode production"
"prod:custom": "uni build -p --mode production",
"prod": "uni build --mode production",
"hella8": "uni build --mode hella8",
"hella9": "uni build --mode hella9",
"hella13": "uni build --mode hella13",
"hella14": "uni build --mode hella14",
"hella15": "uni build --mode hella15",
"hella16": "uni build --mode hella16"
},
"dependencies": {
"@dcloudio/uni-app": "3.0.0-alpha-3060920221114001",

7592
pnpm-lock.yaml

File diff suppressed because it is too large

17
sfms3.0-uniapp3/App.vue

@ -1,17 +0,0 @@
<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

@ -1,20 +0,0 @@
<!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

@ -1,22 +0,0 @@
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

@ -1,72 +0,0 @@
{
"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

@ -1,17 +0,0 @@
{
"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

@ -1,52 +0,0 @@
<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.

Before

Width:  |  Height:  |  Size: 3.9 KiB

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

@ -1,10 +0,0 @@
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

@ -1,76 +0,0 @@
/**
* 这里是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;

12
src/api/dept.js

@ -1,12 +0,0 @@
import http from './http'
// 获取人员列表
export function getSelecUser(params) {
return http.get('/system/dept/selecUserByType',{params})
}
// // 获取厂区列表
// export function getFactoryAreaList(params) {
// return []
// // http.get('/system/dept/selectAllFactoryArea',{params})
// }

6
src/api/eam/attachmentFile.js

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

5
src/api/eam/basicFaultType.js

@ -1,5 +0,0 @@
import http from '../http'
// 根据模具号查询信息
export function getBasicFaultTypeNoPage(params) {
return http.get('/eam/basic-fault-type/noPage',{params})
}

43
src/api/eam/device.js

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

20
src/api/eam/dict.js

@ -1,20 +0,0 @@
import http from '../http'
// 获取字典
export function getDictList(type) {
return http.get('/system/dict-data/queryByDictType?dictType=' + type)
}
export async function getDict(type) {
let data =[]
await getDictList(type).then((res) => {
if (res.code == 0) {
data = res.data.map(item=>{
return {
label:item.label,
value:item.value,
}
})
} else {}
}).catch((err) => {})
return data
}

57
src/api/eam/inspection.js

@ -1,57 +0,0 @@
import http from '../http'
// 获取巡检工单
export function inspectionOrderPage(params) {
return http.get('/eam/equipment-inspection-main/page',{params})
}
// 获取巡检工单
export function inspectionOrder(number) {
return http.get('/eam/equipment-inspection-main/get?id=' + number)
}
//接单
export function inspectionUpdateOrder(params) {
return http.post('/eam/equipment-inspection-main/updateOrder',params)
}
//完成
export function inspectionExecuteOrder(params) {
return http.post('/eam/equipment-inspection-main/execute',params)
}
// 获取巡检工单
export function inspectionOrderDetail(params) {
return http.get('/eam/equipment-inspection-detail/getList',{params})
}
//更新巡检项
export function inspectionOrderItemUpdate(params) {
return http.put('/eam/equipment-inspection-detail/update',params)
}
//新增非必选巡检项
export function inspectionOrderItemCreate(params) {
return http.post('/eam/equipment-inspection-detail/create',params)
}
//删除巡检项
export function inspectionOrderDetailDelete(number) {
return http.delete('/eam/equipment-inspection-detail/delete?id=' + number)
}
//获取非必选的巡检项
export function inspectionPlanItemList(params) {
return http.post('/eam/relation-inspection-plan-item/getList',params)
}
//验证驳回
export function inspectionOrderRejected(params) {
return http.post('/eam/equipment-inspection-main/fallback',params)
}
//验证通过
export function inspectionOrderPassed(params) {
return http.put('/eam/equipment-inspection-main/updateOrders',params)
}

24
src/api/eam/location.js

@ -1,24 +0,0 @@
import http from '../http'
// 获取库位
export function getLocation(number) {
return http.get('/eam/location/scanCodeByNumber?number='+number)
}
// 出库获取库位
export function getOutLocation(data) {
return http.post('/eam/location/outScanCodeByNumber',data)
}
// 首页扫码获取详情
export function pdaItemAndLocation(number) {
return http.get('/eam/location/pdaItemAndLocation?number='+number)
}
// 获取领用出库主表分页列表
export function getOutLocationPage(params) {
return http.get('/eam/spare-parts-out-location-main/page',{params})
}
// 获取领用出库子表分页列表
export function getOutLocationDetailPage(params) {
return http.get('/eam/spare-parts-out-location-detail/page',{params})
}

119
src/api/eam/repairOrder.js

@ -1,119 +0,0 @@
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.post('/eam/equipment-repair-job-main/updateOrder', params)
} else if (type == 'EQUIPMENT') {
return http.post('/eam/equipment-repair-job-main/updateOrder', 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/noPage', {params})
} else if (type == 'EQUIPMENT') {
return http.get('/eam/equipment-repair-job-detail/noPage', {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/equipment-repair-job-main/detail', {
params
})
}

22
src/api/eam/spareParts.js

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

18
src/api/eam/sparePartsApplication.js

@ -1,18 +0,0 @@
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

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

10
src/api/eam/sparePartsServiceWorkOrderList.js

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

57
src/api/eam/spotcheck.js

@ -1,57 +0,0 @@
import http from '../http'
// 获取点检工单
export function spotcheckOrderPage(params) {
return http.get('/eam/equipment-spot-check-main/page',{params})
}
// 获取点检工单
export function spotcheckOrder(number) {
return http.get('/eam/equipment-spot-check-main/get?id=' + number)
}
//接单
export function spotcheckUpdateOrder(params) {
return http.post('/eam/equipment-spot-check-main/updateOrder',params)
}
//完成
export function spotcheckExecuteOrder(params) {
return http.post('/eam/equipment-spot-check-main/execute',params)
}
// 获取点检工单
export function spotcheckOrderDetail(params) {
return http.get('/eam/equipment-spot-check-detail/getList',{params})
}
//更新点检项
export function spotcheckOrderItemUpdate(params) {
return http.put('/eam/equipment-spot-check-detail/update',params)
}
//新增非必选点检项
export function spotcheckOrderItemCreate(params) {
return http.post('/eam/equipment-spot-check-detail/create',params)
}
//删除点检项
export function spotcheckOrderDetailDelete(number) {
return http.delete('/eam/equipment-spot-check-detail/delete?id=' + number)
}
//获取非必选的点检项
export function spotcheckPlanItemList(params) {
return http.post('/eam/relation-spot-check-plan-item/getList',params)
}
//验证驳回
export function spotcheckOrderRejected(params) {
return http.post('/eam/equipment-spot-check-main/fallback',params)
}
//验证通过
export function spotcheckOrderPassed(params) {
return http.put('/eam/equipment-spot-check-main/updateOrders',params)
}

25
src/api/eam/tool.js

@ -1,25 +0,0 @@
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')
}

104
src/api/eam/upkeepOrder.js

@ -1,104 +0,0 @@
import http from '../http'
// 添加工单
export function upkeepOrderCreate(data,type) {
if (type == 'DEVICE') {
return http.post('/eam/equipment-maintenance-main/create',data)
} else if (type == 'EQUIPMENT') {
return http.post('/eam/equipment-maintenance-main/create',data)
}
}
// 编辑工单
export function upkeepOrderUpdate(data,type) {
if (type == 'DEVICE') {
return http.put('/eam/equipment-maintenance-main/update',data)
} else if (type == 'EQUIPMENT') {
return http.put('/eam/equipment-maintenance-main/update',data)
}
}
// 工单列表
export function upkeepOrderPage(params,type) {
if (type == 'DEVICE') {
return http.get('/eam/equipment-maintenance-main/page',{params})
} else if (type == 'EQUIPMENT') {
return http.get('/eam/equipment-maintenance-main/page',{params})
}
}
// 工单列表
export function upkeepOrderInfo(params,type) {
if (type == 'DEVICE') {
return http.get('/eam/equipment-maintenance-main/get',{params})
} else if (type == 'EQUIPMENT') {
return http.get('/eam/equipment-maintenance-main/get',{params})
}
}
// 接单
export function orderClick(params,type) {
if (type == 'DEVICE') {
return http.post('/eam/equipment-maintenance-main/updateOrder',params)
} else if (type == 'EQUIPMENT') {
return http.post('/eam/equipment-maintenance-main/updateOrder',params)
}
}
export function orderClickVerify(params,type) {
if (type == 'DEVICE') {
return http.get('/eam/equipment-maintenance-main/orderClickVerify',{params})
} else if (type == 'EQUIPMENT') {
return http.get('/eam/equipment-maintenance-main/orderClickVerify',{params})
}
}
// 完成保养工单
export function orderClickFinish(params,type) {
if (type == 'DEVICE') {
return http.post('/eam/equipment-maintenance-main/updateOrders',params)
} else if (type == 'EQUIPMENT') {
return http.post('/eam/equipment-maintenance-main/updateOrders',params)
}
}
// 修改保养工单完成状态
export function excuteFinish(params,type) {
if (type == 'DEVICE') {
return http.post('/eam/equipment-maintenance-main/execute',params)
} else if (type == 'EQUIPMENT') {
return http.post('/eam/equipment-maintenance-main/execute',params)
}
}
// 添加维修工单子项维修内容
export function upkeepOrderDetailCreate(data,type) {
if (type == 'DEVICE') {
return http.post('/eam/device-maintain-job-detail/create',data)
} else if (type == 'EQUIPMENT') {
return http.post('/eam/device-maintain-job-detail/create',data)
}
}
// 编辑维修工单子项维修内容
export function upkeepOrderDetailUpdate(data,type) {
if (type == 'DEVICE') {
return http.put('/eam/equipment-maintenance-detail/update',data)
} else if (type == 'EQUIPMENT') {
return http.put('/eam/equipment-maintenance-detail/update',data)
}
}
// 获得维修工单子列表
export function upkeepOrderDetailList(params,type) {
if (type == 'DEVICE') {
return http.post('/eam/equipment-maintenance-detail/noPage',params)
} else if (type == 'EQUIPMENT') {
return http.post('/eam/equipment-maintenance-detail/noPage',params)
}
}
// 删除维修工单子
export function upkeepOrderDetailDelete(id,type) {
if (type == 'DEVICE') {
return http.delete('/eam/device-maintain-job-detail/delete?id='+id)
} else if (type == 'EQUIPMENT') {
return http.delete('/eam/device-maintain-job-detail/delete?id='+id)
}
}

11
src/api/eam/user.js

@ -1,11 +0,0 @@
import http from '../http'
// 用户密码重置
export function updateUserPassword(data) {
return http.put('/eam/device-accounts/getDetailsByNumber',data)
}
export function getAllUserSimpleInfo(){
return http.get('/system/user/list-all-simple')
}

96
src/api/http.ts

@ -8,6 +8,7 @@ const instance = axios.create({
adapter(config) {
const { url, method, data, params, headers, baseURL, paramsSerializer } =
config
config.timeout = 300000
return new Promise((resolve, reject) => {
uni.request({
method: method!.toUpperCase() as any,
@ -20,7 +21,16 @@ const instance = axios.create({
resolve(res)
},
fail: (error : any) => {
reject(error)
// var message = error.errMsg
// if (message === 'Network Error') {
// message = '接口连接异常'
// } else if (message.includes('timeout')) {
// message = '接口请求超时'
// } else if (message.includes('Request failed with status code')) {
// message = '接口' + message.substr(message.length - 3) + '异常'
// }
// reject("系统异常:"+message);
// console.log("系统异常",message)
}
})
})
@ -34,10 +44,12 @@ const instance = axios.create({
instance.interceptors.request.use((config) => {
const { method, params, url } = config
// 附带鉴权的token
const tenantId = 1
// const tenantId = 1
var tenantId = uni.getStorageSync('tenantId')
const headers : any = {
token: getAccessToken(),
"tenant-id":tenantId,
"tenant-id": tenantId,
"dataSource":"PDA",
'Authorization': 'Bearer ' + getAccessToken()
}
if (uni.getStorageSync('openId')) {
@ -66,45 +78,51 @@ instance.interceptors.request.use((config) => {
*
*/
instance.interceptors.response.use((v) => {
const code = v.data?.code || 200
if (code === 401) {
// alert('即将跳转登录页。。。', '登录过期')
// setTimeout(redirectHome, 1500)
removeToken()
uni.showModal({
title: '系统提示',
content: '登录状态已过期,您可以继续留在该页面,或者重新登录',
cancelText: '关闭',
confirmText: '重新登录',
success: function (res) {
if (res.confirm) {
uni.reLaunch({ url: '/pages/login' })
}
if (v) {
if (v.statusCode == 200) {
if (v.data.code == 0) {
// return v.data
return Promise.resolve(v.data)
}else if(v.data.code == 404){
uni.showModal({
title: '系统提示',
content: '登录状态已过期,您可以继续留在该页面,或者重新登录',
cancelText: '关闭',
confirmText: '重新登录',
success: function (res) {
if (res.confirm) {
uni.reLaunch({ url: '/pages/login/index' })
}
}
})
} else if(v.data.code == 401){
uni.clearStorageSync()
uni.removeStorageSync('overPackageRecord')
uni.showModal({
title: '系统提示',
content: '账号未登录,请重新登录',
cancelText: '关闭',
confirmText: '重新登录',
success: function (res) {
if (res.confirm) {
uni.reLaunch({ url: '/pages/login/index' })
}
}
})
} else {
// return v.data
return Promise.reject("系统异常:" + v.data.msg)
}
})
return v.data
} else if (code === 500) {
uni.showToast({
title: v.data.msg,
icon: 'none'
})
return v.data
} else if (code !== 200) {
uni.showToast({
title: v.data.msg,
icon: 'none'
})
return v.data
}
// @ts-ignore
if ((v.status || v.statusCode) === 200) {
return v.data
}else{
} else {
return Promise.reject("系统异常:" + v.data.msg)
}
} else {
return Promise.reject("系统异常:" + v.data.msg)
}
return Promise.reject(v)
},error=>{
}, error => {
console.log(error)
uni.showToast({
title: '网络错误',

5
src/api/location.js

@ -1,5 +0,0 @@
import http from './http'
// 获取库位
export function getLocation(number) {
return http.get('/eam/location/scanCodeByNumber?number='+number)
}

2
src/api/login.js

@ -11,7 +11,7 @@ export function login(username, password, captchaVerification, tenantName, remem
code,
uuid,
}
return http.post('/system/auth/login', data)
return http.post('/system/auth/loginNoCode', data)
}
// 获取用户详细信息

21
src/api/mes/dict/dictApi.ts

@ -1,21 +0,0 @@
import http from '../../http'
// 获取字典
export function getDictList(type) {
return http.get('/system/dict-data/queryByDictType?dictType=' + type)
}
export async function getDict(type) {
let data =[]
await getDictList(type).then((res) => {
if (res.code == 0) {
data = res.data.map(item=>{
return {
label:item.label,
value:item.value,
}
})
} else {}
}).catch((err) => {})
return data
}

54
src/api/mes/orderDay/index.ts

@ -1,54 +0,0 @@
import http from '../../http'
export interface OrderDayVO {
status: string
remark: string
planNoMonth: string
planNoDay: string
productCode: string
workroomCode: string
lineCode: string
planCount: number
processrouteCode: string
tempProcessroute: string
standardBom: string
tempBom: string
workMode: string
planDate: Date
startTime: Date
endTime: Date
taskMode: string
}
export function getCompleteInspectionMark(paramCode) {
return http.get('/mes/complete-inspect/get?paramCode=' + paramCode)
}
export function getQualityformInfo(fromNo) {
return http.get('/mes/qualityform/getQualityform?fromNo=' + fromNo)
}
export function getOrderDayPage(params) {
return http.get('/mes/orderday/page', {params})
}
export function getOrderDayPlanDetail(number) {
//return http.get('/eam/item-apply-request-main/appGetByNumber?number=' + number)
return http.get('/mes/orderday/get?id=' + number)
}
export function getBomInfo(params) {
return http.post('/mes/complete-inspect/get-orderDay-bom', params)
}
export function getBomInfoList(params) {
return http.post('/mes/complete-inspect/get-orderDay-bom-page', params)
}
export function updateBomInfo(params) {
return http.post('/mes/complete-inspect/update', params)
}
export function planStop(params) {
return http.post('/mes/orderday/stopPlan/'+ params)
}

15
src/api/mes/productBackline/productBacklineApi.ts

@ -1,15 +0,0 @@
import http from '../../http'
// 产品离线登记列表
export function getPage(params) {
return http.get('/mes/product-backline/page',{params})
}
export function changeStatus(data) {
return http.put('/mes/product-backline/update',data)
}
export function create(data) {
return http.post('/mes/product-backline/create',data)
}

23
src/api/mes/productOffline/productOfflineApi.ts

@ -1,23 +0,0 @@
import http from '../../http'
// 产品离线登记列表
export function getPage(params) {
return http.get('/mes/product-offline/page',{params})
}
export function changeStatus(data) {
return http.put('/mes/product-offline/update',data)
}
export function create(data) {
return http.post('/mes/product-offline/create',data)
}
export function getPageChildren(params) {
return http.get('/wms/team/getPageChildren',{params})
}
export function getworkSchedulingPage(params) {
return http.get('/mes/work-scheduling/page',{params})
}

8
src/api/mes/qaForm/index.ts

@ -1,8 +0,0 @@
import http from '../../http'
export function create(data) {
return http.post('/mes/work-scheduling-qaform/create',data)
}

15
src/api/mes/reworkBatch/reworkBatchApi.ts

@ -1,15 +0,0 @@
import http from '../../http'
// 产品离线登记列表
export function getPage(params) {
return http.get('/mes/rework-batch/page',{params})
}
export function update(data) {
return http.put('/mes/rework-batch/update',data)
}
export function create(data) {
return http.post('/mes/rework-batch/create',data)
}

15
src/api/mes/reworkSingle/reworkSingleApi.ts

@ -1,15 +0,0 @@
import http from '../../http'
// 产品离线登记列表
export function getPage(params) {
return http.get('/mes/rework-single/page',{params})
}
export function update(data) {
return http.put('/mes/rework-single/update',data)
}
export function create(data) {
return http.post('/mes/rework-single/create',data)
}

13
src/api/mes/workScheduling/addBasicItem/index.ts

@ -1,13 +0,0 @@
import http from '../../../http'
//查询物料信息列表
export function getByOrder(params) {
return http.get('/mes/orderDayBom/getByOrder', {params})
}
//补料
export function addBasicItem(data) {
return http.post('/mes/item-request-main/addBasicItem', data)
}

149
src/api/mes/workScheduling/index.ts

@ -1,149 +0,0 @@
import http from '../../http'
export interface OrderDayVO {
status: string
remark: string
planNoMonth: string
planNoDay: string
productCode: string
workroomCode: string
lineCode: string
planCount: number
processrouteCode: string
tempProcessroute: string
standardBom: string
tempBom: string
workMode: string
planDate: Date
startTime: Date
endTime: Date
taskMode: string
}
export function getCompleteInspectionMark(paramCode) {
return http.get('/mes/complete-inspect/get?paramCode=' + paramCode)
}
export function getQualityformInfo(fromNo) {
return http.get('/mes/qualityform/getQualityform?fromNo=' + fromNo)
}
export function getWorkSchedulingPage(params) {
return http.get('/mes/workScheduling/page', {params})
}
export function getWorkSchedulingPDAPage(params) {
return http.get('/mes/workScheduling/PDA-page', {params})
}
export function getWorkSchedulingInfo(number) {
return http.get('/mes/workScheduling/get?id=' + number)
}
export function updateWorkScheduling(params) {
return http.post('/mes/workScheduling/update-status', params)
}
export function getWorkSchedulingPDF(number) {
return http.get('/mes/workScheduling/get-PDF?planMasterCode=' + number)
}
export function getWorkSchedulingDetail(params) {
return http.post('/mes/work-scheduling-detail/get-info', params)
}
export function getWorkSchedulingProcessFinished(number) {
return http.get('/mes/work-scheduling-detail/processFinished?id=' + number)
}
export function getBomInfo(params) {
return http.post('/mes/complete-inspect/get-orderDay-bom', params)
}
export function getBomInfoList(params) {
return http.post('/mes/complete-inspect/get-orderDay-bom-page', params)
}
export function getWorkerInfoList(params) {
return http.post('/mes/complete-inspect/get-orderDay-worker-page', params)
}
export function getEquipmentInfoList(params) {
return http.post('/mes/complete-inspect/get-orderDay-equipment-page', params)
}
export function updateWorkSchedulingInfo(params) {
return http.post('/mes/complete-inspect/update', params)
}
export function getQaFormPage(params) {
return http.get('/mes/work-scheduling-qaform/page', {params})
}
// 查询已经配置工序人员
export const getConfigProcessWorker = async (params: any) => {
return http.get('/mes/work-scheduling-detail/getPeopleReportList', {params})
}
// 工序报工
export const reportWorkByProcess = async (params: any) => {
return http.post('/mes/work-scheduling-detail/reportWorkByProcess', params)
}
//完工处理
export function completeHandle(data) {
return http.post('/mes/workScheduling/completeHandle', data)
}
//叫料
export function callBasicItem(params) {
return http.get('/mes/orderDayBom/page', {params})
}
export function callBasicItemForm(params) {
console.log(params)
return http.post('/mes/item-request-main/create-call-material', params)
}
//领料
export function receiveBasicItem(data) {
return http.post('/mes/item-request-main/receiveBasicItem', data)
}
//领料
export function receiveItem(data) {
return http.post('/mes/item-request-main/receiveItem', data)
}
//补料
export function addBasicItem(data) {
return http.post('/mes/', data)
}
export function getRequestMainList(params) {
return http.get('/mes/item-request-main/page', {params})
}
// 完工查询是否最后节点
export function getNodePosition(params) {
return http.get('/mes/workScheduling/getNodePosition', {params})
}
// 完工查询人员
export function getWorkerList(params) {
return http.get('/mes/workScheduling/getCurrentWorkerList', {params})
}
export function getRequestMainDetail(params) {
return http.get('/mes/item-request-detail/page', {params})
}
//工序报工
export function reportByProcess(data) {
return http.post('/mes/work-scheduling-detail/reportWorkByProcess', data)
}
//工序完工
export function finishedByProcess(data) {
return http.post('/mes/work-scheduling-detail/processFinished', data)
}
//工序质检
export function qualityByProcess(data) {
return http.post('/mes/work-scheduling-detail/processQualified', data)
}

35
src/api/overhaulOrder.js

@ -1,35 +0,0 @@
import http from './http'
// 添加工单
export function overhaulOrderCreate(data) {
return http.post('/eam/device-inspection-job-main/create',data)
}
// 编辑工单
export function overhaulOrderUpdate(data) {
return http.put('/eam/device-inspection-job-main/updat',data)
}
// 报修列表
export function overhaulOrderPage(params) {
return http.get('/eam/device-inspection-job-main/getAppPage',{params})
}
// 操作工单
export function orderClick(params) {
return http.get('/eam/device-inspection-job-main/onClick',{params})
}
// 添加维修工单子项维修内容
export function overhaulOrderDetailCreate(data) {
return http.post('/eam/device-inspection-job-detail/create',data)
}
// 编辑维修工单子项维修内容
export function overhaulOrderDetailUpdate(data) {
return http.put('/eam/device-inspection-job-detail/update',data)
}
// 获得维修工单子列表
export function overhaulOrderDetailList(params) {
return http.get('/eam/device-inspection-job-detail/selectListByNumber',{params})
}
// 删除维修工单子
export function overhaulOrderDetailDelete(id) {
return http.delete('/eam/device-inspection-job-detail/delete?id='+id)
}

828
src/api/request2.js

File diff suppressed because it is too large

19
src/api/spotCheckOrder.js

@ -1,19 +0,0 @@
import http from './http'
// 添加工单
export function spotCheckOrderCreate(data) {
return http.post('/eam/device-spot-inspection-record-main/create',data)
}
// 编辑工单
export function spotCheckOrderUpdate(data) {
return http.put('/eam/device-spot-inspection-record-main/update',data)
}
// 工单列表
export function spotCheckOrderPage(params) {
return http.get('/eam/device-spot-inspection-record-main/getAppPage',{params})
}
// 操作工单
export function orderClick(params) {
return http.get('/eam/device-spot-inspection-record-main/onClick',{params})
}

21
src/api/wms/workShop.js

@ -1,21 +0,0 @@
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})
}
// 获取班组
export function getTeamNoPage(params) {
return http.get('/wms/team/noPage',{params})
}

117
src/common/appUpdate.js

@ -1,7 +1,7 @@
import {
appCheckUpdate
} from '../api/request2.js';
export function appUpdate() {
export function appUpdate(isShowHint) {
let curversion = 0;
plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
const data = {
@ -11,44 +11,77 @@ export function appUpdate() {
wgtVersion: widgetInfo.version,
versionCode: widgetInfo.versionCode
}
curversion=data.versionCode
appCheckUpdate().then(res => {
console.log("当前版本提示",curversion)
if (res.data) {
if (res.data.versionCode > Number(curversion)) {
var downUrl = res.data.downUrl;
var content = res.data.content;
var version =res.data.version
console.log("新版本提示")
uni.showModal({
title: "发现新版本:("+version+")",
content: content,
confirmText: "更新",
cancelText: "取消",
success: (res) => {
if (res.confirm) {
confirm(downUrl);
console.log('comfirm') //点击确定之后执行的代码
} else {
console.log('cancel') //点击取消之后执行的代码
}
curversion = data.versionCode
appCheckUpdate().then(res => {
console.log("当前版本提示", curversion)
var json = JSON.stringify(res)
console.log("获取更新数据", json)
if (res.data) {
if (res.data.installPackageVersion > Number(curversion)) {
var downUrl = res.data.installPackageUrl;
var content = res.data.updateContent;
var version = res.data.installPackageVersion;
var isForcedUpdate = res.data.isForcedUpdate
var versionName = res.data.installPackageName
console.log("新版本提示")
showDialog(versionName, content, isForcedUpdate, downUrl)
// uni.showModal({
// title: "发现新版本:(" + version + ")",
// content: content,
// confirmText: "更新",
// showCancel: isForcedUpdate == "TRUE" ? false : true,
// cancelText: "取消",
// success: (res) => {
// if (res.confirm) {
// confirm(downUrl);
// console.log('comfirm') //点击确定之后执行的代码
// } else {
// console.log('cancel') //点击取消之后执行的代码
// if (isForcedUpdate == "TRUE") {
// }
// }
// }
// })
} else {
if (isShowHint) {
uni.showToast({
title: "当前是最新版本"
})
}
})
console.log("没有新版本")
}
}
}).catch(error => {
console.log("版本错误", error)
})
})
}
export function showDialog(versionName, content, isForcedUpdate, downUrl) {
uni.showModal({
title: "发现新版本:(" + versionName + ")",
content: content,
confirmText: "更新",
showCancel: isForcedUpdate == "TRUE" ? false : true,
cancelText: "取消",
success: (res) => {
if (res.confirm) {
confirm(downUrl);
console.log(
'comfirm') //点击确定之后执行的代码
} else {
uni.showToast({
title:"当前是最新版本"
})
console.log("没有新版本")
console.log(
'cancel') //点击取消之后执行的代码
if (isForcedUpdate == "TRUE") {
showDialog(versionName, content, isForcedUpdate, downUrl)
}
}
}
}).catch(error => {
console.log("版本错误", error)
})
})
}
export function confirm(downUrl) {
@ -91,12 +124,16 @@ export function confirm(downUrl) {
showLoading.setTitle("已连接到服务器");
break;
case 3:
prg = parseInt(
(parseFloat(task.downloadedSize) /
parseFloat(task.totalSize)) *
100
);
showLoading.setTitle(" 正在下载" + prg + "% ");
if (task.totalSize && task.totalSize > 0) {
prg = parseInt(
(parseFloat(task.downloadedSize) /
parseFloat(task.totalSize)) *
100
);
showLoading.setTitle("正在下载" + prg + "% ");
}else {
showLoading.setTitle("正在下载");
}
break;
case 4:
plus.nativeUI.closeWaiting();

50
src/common/array.js

@ -110,6 +110,18 @@ export function getPurchaseReceiptOption(allowModifyQty, allowModifyLocation) {
return option;
}
export function getRecordOption(allowModifyQty, allowModifyLocation) {
var option = []
option.push(...getDetailOption())
if (allowModifyQty) {
option.push(...getEditOption())
}
if (allowModifyLocation) {
option.push(...getLocationOption())
}
option.push(...getRemoveOption())
return option;
}
//详情
export function getDetailOption() {
let option_detail = [{
@ -223,7 +235,7 @@ export function getDetailEditRemoveOption() {
}
//详情编辑放弃
//详情编辑关闭
export function getDetailGiveupOption() {
let option_detail_giveup = [{
text: '详情',
@ -241,7 +253,23 @@ export function getDetailGiveupOption() {
return option_detail_giveup;
}
//详情放弃
export function getDetailCloseOption() {
let option_detail_giveup = [{
text: '详情',
style: {
backgroundColor: '#3C9CFF'
}
},
{
text: '关闭',
style: {
backgroundColor: '#F56C6C'
}
}
];
return option_detail_giveup;
}
//详情编辑移除
export function getEditRemoveOption() {
@ -261,7 +289,23 @@ export function getEditRemoveOption() {
return option_edit_remove;
}
//详情编辑移除
export function getEditLocationRemoveOption() {
let option_edit_remove = [{
text: '修改\n库位',
style: {
backgroundColor: '#F1A532'
}
},
{
text: '移除',
style: {
backgroundColor: '#F56C6C'
}
}
];
return option_edit_remove;
}
// 库存状态字典项
export function getInventoryStatusArray() {
let array = [{

139
src/common/balance.js

@ -84,16 +84,19 @@ export function getPrecisionStrategyList(itemList, callback) {
};
getPrecisionStrategy(itemList).then(res => {
console.log(111, res.data)
if (res.data == null) {
result.success = false
result.message = '未查询到管理精度信息'
} else {
result.list = res.data;
}
console.log('haha', result)
callback(result);
}).catch(error => {
result.success = false;
result.message = error;
console.log('hehe', result)
callback(result);
})
}
@ -105,7 +108,7 @@ export function getPrecisionStrategyList(itemList, callback) {
* @param {*}
*
*/
export function getManagementPrecisions(itemCodes, locationCode, callback) {
export async function getManagementPrecisions(itemCodes, locationCode, callback) {
// let jsonParem = JSON.stringify(param)
let result = {
list: [],
@ -113,11 +116,11 @@ export function getManagementPrecisions(itemCodes, locationCode, callback) {
message: ''
};
var params = {
const params = {
itemCodes: itemCodes,
locationCode: locationCode
}
getManagementPrecision(params).then(res => {
await getManagementPrecision(params).then(res => {
if (res.data == null) {
result.success = false
result.message = '未查询到管理精度信息'
@ -131,23 +134,75 @@ export function getManagementPrecisions(itemCodes, locationCode, callback) {
callback(result);
})
}
//通过父包装查询
export function getBalanceByManagementPrecisionByPacking(label, packageInfo,locationCode, fromInventoryStatuses, callback) {
let result = {
list: [],
success: true,
message: ''
};
let params = {
itemCodes: [label.itemCode],
locationCode: locationCode
};
// let jsonParem = JSON.stringify(param)
getManagementPrecision(params).then(res => {
let managementPrecision = res.data[0].ManagementPrecision;
switch (managementPrecision) {
case 'BY_PACKAGING':
byPacking(label, packageInfo,locationCode, fromInventoryStatuses, res => {
res.managementPrecision = managementPrecision;
callback(res);
});
break;
case 'BY_BATCH':
byBatch(label, locationCode, fromInventoryStatuses, res => {
res.managementPrecision = managementPrecision;
callback(res);
});
break;
case 'BY_QUANTITY':
byQuantity(label, locationCode, fromInventoryStatuses, res => {
res.managementPrecision = managementPrecision;
callback(res);
});
break;
case 'BY_UNIQUEID':
byUniqueId(label, fromInventoryStatuses, res => {
res.managementPrecision = managementPrecision;
callback(res);
});
break;
}
}).catch(error => {
let result = {
success: false,
message: error
};
callback(result);
})
}
export function getBalanceByManagementPrecision(label, locationCode, fromInventoryStatuses, callback) {
let result = {
list: [],
success: true,
message: ''
};
let params = {
itemCodes: [label.itemCode],
locationCode: locationCode
};
// let jsonParem = JSON.stringify(param)
getManagementPrecision(params).then(res => {
console.log("成功" + res)
let managementPrecision = res.data[0].ManagementPrecision;
switch (managementPrecision) {
case 'BY_PACKAGING':
byPacking(label, locationCode, fromInventoryStatuses, res => {
byPacking(label, "", locationCode, fromInventoryStatuses, res => {
res.managementPrecision = managementPrecision;
callback(res);
});
@ -172,6 +227,7 @@ export function getBalanceByManagementPrecision(label, locationCode, fromInvento
break;
}
}).catch(error => {
console.log("失败" + error)
let result = {
success: false,
message: error
@ -191,6 +247,20 @@ export function byPacking(label, locationCode, fromInventoryStatuses, callback)
data: {}
};
var filters = []
if (packageInfo&&packageInfo.parentNumber) {
var packingNumber = packageInfo.parentNumber + "," + label.packingNumber;
filters.push({
column: "packingNumber",
action: "in",
value: packingNumber
})
} else {
filters.push({
column: "packingNumber",
action: "==",
value: label.packingNumber
})
}
filters.push({
column: "packingNumber",
action: "==",
@ -211,11 +281,12 @@ export function byPacking(label, locationCode, fromInventoryStatuses, callback)
action: "==",
value: locationCode
})
if (fromInventoryStatuses != null && fromInventoryStatuses != "") {
if (fromInventoryStatuses) {
var status = fromInventoryStatuses.join(',');
filters.push({
column: "inventoryStatus",
action: "in",
value: fromInventoryStatuses
value: status
})
}
@ -266,7 +337,7 @@ export function byBatch(label, locationCode, fromInventoryStatuses, callback) {
filters.push({
column: "packingNumber",
action: "==",
value: null
value: ''
})
filters.push({
column: "locationCode",
@ -274,12 +345,13 @@ export function byBatch(label, locationCode, fromInventoryStatuses, callback) {
value: locationCode
})
if (fromInventoryStatuses != null && fromInventoryStatuses != "") {
filters.push({
column: "inventoryStatus",
action: "in",
value: fromInventoryStatuses
})
if (fromInventoryStatuses) {
var status = fromInventoryStatuses.join(',');
filters.push({
column: "inventoryStatus",
action: "in",
value: status
})
}
var params = {
@ -324,7 +396,7 @@ export function byQuantity(label, locationCode, fromInventoryStatuses, callback)
data: {}
};
var filters = []
let filters = []
filters.push({
column: "itemCode",
action: "==",
@ -332,13 +404,13 @@ export function byQuantity(label, locationCode, fromInventoryStatuses, callback)
})
filters.push({
column: "packingNumber",
action: "==",
value: null
action: "isStr",
value: ''
})
filters.push({
column: "batch",
action: "==",
value: null
action: "isStr",
value: ''
})
filters.push({
column: "locationCode",
@ -346,12 +418,13 @@ export function byQuantity(label, locationCode, fromInventoryStatuses, callback)
value: locationCode
})
if (fromInventoryStatuses != null && fromInventoryStatuses != "") {
filters.push({
column: "inventoryStatus",
action: "in",
value: fromInventoryStatuses
})
if (fromInventoryStatuses) {
var status = fromInventoryStatuses.join(',');
filters.push({
column: "inventoryStatus",
action: "in",
value: status
})
}
var params = {
@ -393,19 +466,21 @@ export function byUniqueId(label, locationCode, fromInventoryStatuses, callback)
data: {}
};
var filters = []
let filters = []
filters.push({
column: "packingNumber",
action: "==",
value: label.packingNumber
})
if (fromInventoryStatuses != null && fromInventoryStatuses != "") {
filters.push({
column: "inventoryStatus",
action: "in",
value: fromInventoryStatuses
})
if (fromInventoryStatuses) {
var status = fromInventoryStatuses.join(',');
filters.push({
column: "inventoryStatus",
action: "in",
value: status
})
}
var params = {
@ -474,4 +549,4 @@ export function balanceByLocation(locationCode, callback) {
result.message = err.message;
callback(result)
})
}
}

177
src/common/basic.js

@ -7,7 +7,7 @@ import { calc } from '@/common/calc'
let jobStatusList = [];
let itemStatusList = [];
let locationTypeList = [];
let locationAreaTypeList = [];
let uomList = [];
let inventoryStatusList = [];
let containerTypeList = [];
@ -17,6 +17,8 @@ let unplannedReceiptReasonList = [];
let unplannedIissueReason = [];
let scrapReasonList = [];
let inspectFailedReasonList = [];
let switchList=[]
let businessList=[]
@ -24,7 +26,7 @@ let inspectFailedReasonList = [];
export function clearCacheData() {
jobStatusList = [];
itemStatusList = [];
locationTypeList = [];
locationAreaTypeList = [];
uomList = [];
inventoryStatusList = [];
containerTypeList = [];
@ -34,6 +36,8 @@ export function clearCacheData() {
unplannedIissueReason = [];
scrapReasonList = [];
inspectFailedReasonList = [];
switchList=[]
businessList = []
}
@ -152,11 +156,11 @@ export function getItemStateInfo(value) {
//获取库位类型
export function getLocationTypeInfo(value) {
var resultInfo = "";
if (locationTypeList.length == 0) {
locationTypeList = getDirectoryInfo("location_type")
if (locationAreaTypeList.length == 0) {
locationAreaTypeList = getDirectoryInfo("location_type")
}
if (locationTypeList.length > 0) {
for (let item of locationTypeList) {
if (locationAreaTypeList.length > 0) {
for (let item of locationAreaTypeList) {
if (item.value == value) {
resultInfo = item
break;
@ -174,7 +178,7 @@ export function getLocationTypeName(value) {
}
//获取计量单位
export function getUnitInfo(value) {
export function getUomInfo(value) {
var resultInfo = "";
if (uomList.length == 0) {
uomList = getDirectoryInfo("uom")
@ -191,7 +195,7 @@ export function getUnitInfo(value) {
}
//获取包装单位
export function getStdPackUnitInfo(value) {
export function getPackUnitInfo(value) {
var resultInfo = "";
if (packUnitList.length == 0) {
packUnitList = getDirectoryInfo("pack_unit")
@ -335,6 +339,39 @@ export function getInspectReasonList(value) {
return inspectFailedReasonList
}
//获取单据开关
export function getSwitchInfoByCode(code) {
var isCheck = false
var resultInfo = ""
switchList = uni.getStorageSync("switch")
for (let item of switchList) {
if (item.code == code) {
resultInfo = item
break;
}
}
isCheck = resultInfo.effectiveSetValue == "TRUE" ? true : false
return isCheck;
}
//获取业务类型名称
export function getBusinessTypeName(code) {
var resultInfo = null
if (businessList.length == 0) {
businessList = uni.getStorageSync("businessType")
}
for (let item of businessList) {
if (item.code == code) {
resultInfo = item
break;
}
}
return resultInfo.name;
}
// //数量状态
// export function getCoutJobStatuStyle(val) {
@ -688,23 +725,29 @@ export function getPackingNumberAndBatch(managementList, itemCode, packingNumber
return itemInfo;
}
// //提示是否消息
// export function showConfirmMsg(content, callback) {
// uni.showModal({
// title: '提示',
// cancelText: '否',
// confirmText: '是',
// content: content,
// success: function(res) {
// if (res.confirm) {
// callback(true);
// } else {
// callback(false);
// }
// },
// })
// scanErrorAudio();
// }
// 提示是否消息
export function showConfirmMsg(content, callback) {
uni.showModal({
title: '提示',
cancelText: '否',
confirmText: '是',
content: content,
success: function(res) {
if (res.confirm) {
callback(true);
} else {
callback(false);
}
},
})
}
export function compare(key) {
return function(a, b) {
var val1 = a[key];
var val2 = b[key];
return val2 - val1;
}
}
export function compareTime() {
return function(a, b) {
@ -813,7 +856,74 @@ export function getBatch() {
var batch = year.toString() + month.toString() + day.toString()
return batch;
}
//20270717
export function getBatch8() {
var date = new Date();
//获取日期部分
var year = date.getFullYear(); //年
var month = date.getMonth() + 1; //月
var day = date.getDate(); //日
month = month < 10 ? "0" + month : month;
day = day < 10 ? "0" + day : day;
return year + month + day;
}
/**
* 获取前几天和后几天的日期 2024-07-07
*/
export function lastThreeDays(grapDay) {
let dates = [];
for (let i = grapDay; i >= 0; i--) {
// 创建新的Date对象,并减去i天
let date = new Date();
date.setDate(date.getDate() - i);
// 将格式化的日期字符串添加到数组中
dates.push(formatDate(date));
}
for (let i = 0; i <grapDay; i++) {
// 创建新的Date对象,并减去i天
let date = new Date();
date.setDate(date.getDate() + (i+1));
// 将格式化的日期字符串添加到数组中
dates.push(formatDate(date));
}
return dates;
}
//20240702
export function formatDate(date) {
const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, '0');
const day = date.getDate().toString().padStart(2, '0');
return `${year}-${month}-${day}`;
}
export function getBeforeDayDate(grapDay) {
const today = new Date();
var resultList = []
//获取前几天
var beforeList = []
var afterList = []
for (var i = 0; i < grapDay; i++) {
beforeList.push(today.getDate() - (i + 1))
}
//获取后几天
var afterList = []
for (var i = 0; i < grapDay; i++) {
afterList.push(today.getDate() + (i + 1))
}
resultList.concat(beforeList)
resultList.push(today)
resultList.concat(afterList)
return resultList;
}
export function getCurrDate() {
var date = new Date();
return getDate(date);
@ -839,6 +949,15 @@ export function dateFormat(time) {
return result;
}
export function dateFormatData(time) {
var result = ""
if (time != null) {
let date = new Date(time);
result = getDate(date);
}
return result;
}
//获取日期部分
export function getDate(date) {
@ -957,8 +1076,8 @@ export function createItemInfo(res) {
let item = {
itemCode: res.itemCode,
itemName: res.itemName,
stdPackQty: Number(res.stdPackQty),
stdPackUnit: res.stdPackUnit,
packQty: Number(res.packQty),
packUnit: res.packUnit,
qty: Number(res.qty),
handleQty: 0,
uom: res.uom,
@ -1012,3 +1131,7 @@ export function deepCopyData(target) {
return cloneTarget;
}
//数组去重重复数据
export function uniqueArray(arr) {
return arr.filter((item, index, self) => self.indexOf(item) === index);
}

10
src/common/calc.js

@ -1,16 +1,24 @@
/* 解决js计算精度问题 */
import { Decimal } from 'decimal.js';//引入
import Decimal from 'decimal.js'
class Calc {
add(num1,num2) {
num1 = num1 || 0
num2 = num2 || 0
return new Decimal(num1).add(new Decimal(num2)).toNumber()
}
sub(num1,num2) {
num1 = num1 || 0
num2 = num2 || 0
return new Decimal(num1).sub(new Decimal(num2)).toNumber()
}
mul(num1,num2) {
num1 = num1 || 0
num2 = num2 || 0
return new Decimal(num1).mul(new Decimal(num2)).toNumber()
}
div(num1,num2) {
num1 = num1 || 0
num2 = num2 || 0
return new Decimal(num1).div(new Decimal(num2)).toNumber()
}
}

281
src/common/detail.js

@ -1,83 +1,232 @@
import {
calc
} from '@/common/calc'
import { Decimal } from 'decimal.js';//引入
export function getDataSource(subList) {
let items = [];
subList.forEach(detail => {
var item = items.find(r =>
r.itemCode == detail.itemCode)
if (item == undefined) {
item = createItemInfo(detail);
let newDetail = createDetailInfo(detail); //
item.subList.push(newDetail);
items.push(item)
} else {
item.qty = calc.add(item.qty, detail.qty)
let newDetail = createDetailInfo(detail); //
item.subList.push(newDetail);
}
})
return items;
}
calc
} from '@/common/calc'
import {
Decimal
} from 'decimal.js'; //引入
export function getTreeDataSource(dataList) {
let items = [];
let parentList = dataList.filter(r => r.parentPackingNumber == null || r
.parentPackingNumber == '');
let childList = dataList.filter(r => r.parentPackingNumber != '' && r.parentPackingNumber != null);
export function createItemInfo(detail) {
let item = {
itemCode: detail.itemCode,
itemName: detail.itemName,
stdPackQty: Number(detail.stdPackQty) || undefined,
stdPackUnit: detail.stdPackUnit,
qty: Number(detail.qty),
handleQty: 0,
uom: detail.uom,
subList: []
parentList.forEach(detail => {
var item = items.find(r =>
r.itemCode == detail.itemCode)
if (item == undefined) {
item = createItemInfo(detail);
let newDetail = createDetailInfo(detail); //
item.subList.push(newDetail);
items.push(item)
} else {
item.qty = calc.add(item.qty, detail.qty)
let newDetail = createDetailInfo(detail); //
item.subList.push(newDetail);
}
return item;
})
if (childList.length > 0) {
items.forEach(r =>
r.subList.forEach(s => {
s.packList = childList.filter(c => c.parentPackingNumber == s.packingNumber)
s.packList.forEach(pac => {
pac.scaned = false;
pac.scanDate = new Date();
})
})
)
}
export function createDetailInfo(data) {
data.scaned = false;
// data.record = {};
let detail = data;
return detail;
return items;
}
export function getThreeDataSource(data) {
let items = []
let obj ={
...data.subList[0]
}
console.log(12)
data.subList.forEach((item)=>{
item.threeList = [{
fromLocationCode:item.fromLocationCode,
batch:item.batch,
handleQty:0,
qty:item.qty,
inventoryStatus:item.inventoryStatus,
toLocationCode:item.toLocationCode,
}]
item.packList=[{
scaned : false,
scanDate: new Date()
}]
})
obj.subList = data.subList
items.push(obj)
return items;
}
export function getDataSourceBatch(subList) {
let items = [];
subList.forEach(detail => {
var item = items.find(r =>
r.itemCode == detail.itemCode )
if (item == undefined) {
item = createItemInfo(detail);
let newDetail = createDetailInfo(detail); //
item.subList.push(newDetail);
items.push(item)
} else {
item.qty = calc.add(item.qty, detail.qty)
let newDetail = createDetailInfo(detail); //
item.subList.push(newDetail);
}
})
return items;
}
export function getDataSource(subList) {
let items = [];
subList.forEach(detail => {
var item = items.find(r =>
r.itemCode == detail.itemCode)
if (item == undefined) {
item = createItemInfo(detail);
let newDetail = createDetailInfo(detail); //
item.subList.push(newDetail);
items.push(item)
} else {
item.qty = calc.add(item.qty, detail.qty)
let newDetail = createDetailInfo(detail); //
item.subList.push(newDetail);
}
})
return items;
}
//根据明细创建记录
export function createRecordInfo(detail, balance) {
var record = {}
// let record = JSON.parse(JSON.stringify(detail));
//克隆对象,深度克隆,防止双向绑定同一个变量
Object.assign(record, detail)
detail.scaned = true;
detail.balance = balance;
detail.recommendInventoryStatus = detail.inventoryStatus;
detail.inventoryStatus = balance.inventoryStatus;
record.qty = Number(balance.qty);
return record;
export function createItemInfo(detail) {
let item = {
itemCode: detail.itemCode,
itemName: detail.itemName,
packQty: Number(detail.packQty) || undefined,
packUnit: detail.packUnit,
qty: Number(detail.qty),
handleQty: 0,
uom: detail.uom,
subList: []
}
return item;
}
export function createDetailInfo(data) {
data.scaned = false;
data.scanDate = new Date();
let detail = data;
detail.packList = [];
return detail;
}
//计算实际数量
export function calcHandleQty(detailSource) {
for (let item of detailSource) {
item.handleQty = new Decimal(0).toNumber();
// item.qty = new Decimal(0).toNumber();
for (let detail of item.subList) {
if (detail != undefined && detail.scaned) {
item.handleQty = calc.add(item.handleQty,detail.handleQty);
// item.qty = calc.add(item.qty,detail.qty);
//根据明细创建记录
export function createRecordInfo(detail, balance) {
var record = {}
// let record = JSON.parse(JSON.stringify(detail));
//克隆对象,深度克隆,防止双向绑定同一个变量
Object.assign(record, detail)
detail.scaned = true;
detail.balance = balance;
detail.recommendInventoryStatus = detail.inventoryStatus;
detail.inventoryStatus = balance.inventoryStatus;
record.qty = Number(balance.qty);
return record;
}
//计算实际数量
export function calcHandleQty(detailSource) {
for (let item of detailSource) {
item.handleQty = new Decimal(0).toNumber();
item.qty = new Decimal(0).toNumber();
for (let detail of item.subList) {
if (detail != undefined) {
if (detail.scaned) {
item.handleQty = calc.add(item.handleQty, detail.handleQty);
}
item.qty = calc.add(item.qty, detail.qty);
}
}
}
}
//计算计划外入库实际数量和任务数量
export function calcHandleQtyPlanOut(detailSource) {
for (let item of detailSource) {
item.handleQty = new Decimal(0).toNumber();
item.qty = new Decimal(0).toNumber();
for (let detail of item.subList) {
if (detail != undefined) {
if (detail.scaned) {
item.handleQty = calc.add(item.handleQty, detail.handleQty);
}
console.log(detail.isRecommend)
if(detail.isRecommend){
item.qty = calc.add(item.qty, detail.qty);
}
}
}
}
}
//计算推荐和扫描的不是用一个的数量
export function calcHandleNewQty(detailSource) {
for (let item of detailSource) {
item.handleQty = new Decimal(0).toNumber();
// item.qty = new Decimal(0).toNumber();
for (let detail of item.subList) {
if (detail ) {
if (!detail.isRecommend && detail.scaned) {
item.handleQty = calc.add(item.handleQty, detail.handleQty);
}
// if (!detail.isRecommend ) {
// item.qty = calc.add(item.qty, detail.qty);
// }
}
}
}
}
export function calcTreeHandleQty(detailSource) {
for (let item of detailSource) {
item.handleQty = new Decimal(0).toNumber();
export function getScanCount(subList) {
let items = subList.filter(r => {
if (r.scaned) {
return r;
for (let detail of item.subList) {
if (detail) {
if (detail.packList && detail.packList.length > 0) {
detail.handleQty = new Decimal(0).toNumber();
for (let pack of detail.packList) {
if (pack && pack.scaned) {
detail.handleQty = calc.add(detail.handleQty, pack.handleQty);
}
}
}else{
detail.handleQty = new Decimal(0).toNumber();
}
if(detail.handleQty){
item.handleQty = calc.add(item.handleQty, detail.handleQty);
}
}
})
let scanCount = items != null ? items.length : 0;
return scanCount;
}
}
}
export function getScanCount(subList) {
let items = subList.filter(r => {
if (r.scaned) {
return r;
}
})
let scanCount = items != null ? items.length : 0;
return scanCount;
}

181
src/common/directory.js

@ -1,4 +1,5 @@
let jobStatusList = [];
let receiveStatusList = [];
let itemStatusList = [];
let itemTypeList =[];
let locationTypeList = [];
@ -6,6 +7,7 @@ let uomList = [];
let inventoryStatusList = [];
let containerTypeList = [];
let packUnitList = [];
let packUnitInfoList = [];
let requestStatusList = [];
let unplannedReceiptReasonList = [];
let unplannedIssueReasonList = [];
@ -18,8 +20,10 @@ let inspectTypeList = [];
let sampleMethodList = [];
let transferModeList = [];
let countStageList = [];
let locationAreaTypeList = [];
let businessList=[];
let countScopeTypeList = [];
let priorityList = []
@ -39,6 +43,7 @@ export function getBusinessTypeDesc(type) {
//获取字典信息
export function clearCacheData() {
jobStatusList = [];
receiveStatusList=[];
itemStatusList = [];
itemTypeList =[];
locationTypeList = [];
@ -46,6 +51,7 @@ export function clearCacheData() {
inventoryStatusList = [];
containerTypeList = [];
packUnitList = [];
packUnitInfoList = [];
requestStatusList = [];
unplannedReceiptReasonList = [];
unplannedIssueReasonList = [];
@ -58,6 +64,10 @@ export function clearCacheData() {
sampleMethodList = [];
transferModeList = [];
countStageList = [];
locationAreaTypeList=[];
businessList=[];
countScopeTypeList = []
priorityList = []
}
//获取字典信息
@ -131,6 +141,22 @@ export function getJobStateInfo(value) {
return resultInfo
}
export function getReceiveStateInfo(value) {
var resultInfo = "";
if (receiveStatusList.length == 0) {
receiveStatusList = getDirectoryInfo("receive_status")
}
if (receiveStatusList.length > 0) {
for (let item of receiveStatusList) {
if (item.value == value) {
resultInfo = item
break;
}
}
}
return resultInfo
}
//获取任务状态样式
export function getJobStateStyle(value) {
let item = getJobStateInfo(value);
@ -145,6 +171,16 @@ export function getJobStateStyle(value) {
}
}
//获取库区描述(多个库区)
export function getListLocationAreaTypeDesc(list) {
let desc = '';
list.forEach(res => {
desc += getLocationAreaTypeInfo(res).label + ","
})
desc = desc.slice(0, -1);
return desc;
}
//获取库位描述(多个库位)
export function getListLocationTypeDesc(list) {
let desc = '';
@ -175,7 +211,15 @@ export function getListItemTypeDesc(list) {
desc = desc.slice(0, -1);
return desc;
}
//获取物品状态(多个)
export function getListItemStatusDesc(list) {
let desc = '';
list.forEach(res => {
desc += getItemStateInfo(res).label + ","
})
desc = desc.slice(0, -1);
return desc;
}
//获取物品类型
export function getItemTypeInfo(value) {
var resultInfo = "";
@ -213,6 +257,38 @@ export function getItemStateInfo(value) {
return resultInfo
}
//获取业务类型名称
export function getBusinessTypeName(code) {
var resultInfo = null
if (businessList.length == 0) {
businessList = uni.getStorageSync("businessType")
}
for (let item of businessList) {
if (item.code == code) {
resultInfo = item
break;
}
}
return resultInfo.name;
}
//获取库区类型
export function getLocationAreaTypeInfo(value) {
var resultInfo = "";
if (locationAreaTypeList.length == 0) {
locationAreaTypeList = getDirectoryInfo("area_type")
}
if (locationAreaTypeList.length > 0) {
for (let item of locationAreaTypeList) {
if (item.value == value) {
resultInfo = item
break;
}
}
}
return resultInfo
}
//获取库位类型
export function getLocationTypeInfo(value) {
var resultInfo = "";
@ -229,6 +305,26 @@ export function getLocationTypeInfo(value) {
}
return resultInfo
}
//获取库区类型名称
export function getLocationAreaTypeName(value) {
let location = getLocationAreaTypeInfo(value);
return location == '' ? value : location.label;
}
//获取物品类型名称
export function getItemTypeName(value) {
let location = getItemTypeInfo(value);
return location == '' ? value : location.label;
}
//获取物品状态名称
export function getItemStatusName(value) {
let location = getItemStateInfo(value);
return location == '' ? value : location.label;
}
//获取库位类型名称
export function getLocationTypeName(value) {
@ -249,7 +345,7 @@ export function getLocationTypeNameList(lst) {
}
//获取计量单位
export function getUnitInfo(value) {
export function getUomInfo(value) {
var resultInfo = "";
if (uomList.length == 0) {
uomList = getDirectoryInfo("uom")
@ -264,9 +360,25 @@ export function getUnitInfo(value) {
}
return resultInfo
}
//获取盘点范围类型
export function getCountScopeType(value) {
var resultInfo = "";
if (countStageList.length == 0) {
countStageList = getDirectoryInfo("count_scope_type")
}
if (countStageList.length > 0) {
for (let item of countStageList) {
if (item.value == value) {
resultInfo = item
break;
}
}
}
return resultInfo
}
//获取包装单位
export function getStdPackUnitInfo(value) {
export function getPackUnitInfo(value) {
var resultInfo = "";
if (packUnitList.length == 0) {
packUnitList = getDirectoryInfo("pack_unit")
@ -298,7 +410,13 @@ export function getRequestStateInfo(value) {
}
return resultInfo
}
//获取库存状态集合
export function getInventoryStatusList() {
if (inventoryStatusList.length == 0) {
inventoryStatusList = getDirectoryInfo("inventory_status")
}
return inventoryStatusList
}
//获取库存状态
export function getInventoryStatusInfo(value) {
@ -514,3 +632,54 @@ export function getCountStageName(value) {
}
return resultInfo
}
//获取包装规格
export function getPackUnitName(value) {
var resultInfo = "";
if (packUnitInfoList.length == 0) {
packUnitInfoList = uni.getStorageSync('packunit');
}
if (packUnitInfoList.length > 0) {
for (let item of packUnitInfoList) {
if (item.code == value) {
resultInfo = item.name
break;
}
}
}
return resultInfo
}
//获取优先级
export function getPriorityName(value) {
// console.log(344,value)
var resultInfo = "";
if (priorityList.length == 0) {
priorityList = getDirectoryInfo("priority")
}
// console.log(455,priorityList)
if (priorityList.length > 0) {
for (let item of priorityList) {
if (item.value == value) {
resultInfo = item.label
break;
}
}
}
return resultInfo
}
//获取优先级
export function getDeliverMethod(value) {
var resultInfo = "";
if (priorityList.length == 0) {
priorityList = getDirectoryInfo("deliver_method")
}
if (priorityList.length > 0) {
for (let item of priorityList) {
if (item.value == value) {
resultInfo = item.label
break;
}
}
}
return resultInfo
}

107
src/common/label.js

@ -2,18 +2,19 @@ let labelDic = [];
import {
getLabelByHeader,
getPackageByNumber
} from '../api/request2.js';
getPackageListByNumber
} from '@/api/request2.js';
import {
checkDirectoryItemExist,
getDirectoryItemArray
} from '../common/directory.js';
} from '@/common/directory.js';
import {
getManagementPrecisions
} from '@/common/balance.js';
export function getLabelInfo(scanMsg,headerType, callBack) {
console.log('扫描信息:', scanMsg);
export function getLabelInfo(scanMsg,headerType, callBack,locationCode,isHavePackNumber) {
if (scanMsg.length == 0) {
return null
}
@ -41,29 +42,32 @@ export function getLabelInfo(scanMsg,headerType, callBack) {
let type = header.substring(header.length - 1, header.length);
if (type == 'Q') //qrcode
{
getQRCodeInfo(header, version, scanMsg, callBack);
} else if (type == 'B') //barcode
{
getBarCodeInfo(header, version, items[2], callBack);
} else { //直接输入文本
getBarCodeInfo('text', 'V1.0', scanMsg, callBack);
getQRCodeInfo(header, version, scanMsg, callBack,locationCode,isHavePackNumber);
}
// else if (type == 'B') //barcode
// {
// getBarCodeInfo(header, version, items[2], callBack);
// }
else { //直接输入文本
getBarCodeInfo('text', 'V1.0', scanMsg, callBack,locationCode,isHavePackNumber);
}
}else {
let labelResult = {
label: {
labelType: "",
barType: '',
code:""
},
package: null,
success: false,
message: '标签格式不正确',
}
callBack(labelResult);
getBarCodeInfo('text', 'V1.0', scanMsg, callBack,locationCode,isHavePackNumber);
// let labelResult = {
// label: {
// labelType: "",
// barType: '',
// code:""
// },
// package: null,
// success: false,
// message: '标签格式不正确',
// }
// callBack(labelResult);
}
}
export function getQRCodeInfo(header, version, scanMsg, callBack) {
export function getQRCodeInfo(header, version, scanMsg, callBack,locationCode,isHavePackNumber) {
//获取包装信息
let labelItem = labelDic.find(r => r.header == header && r.version == version);
if (labelItem == undefined) {
@ -88,7 +92,7 @@ export function getQRCodeInfo(header, version, scanMsg, callBack) {
};
labelDic.push(newItem);
getLabelItems(newItem, scanMsg, callBack);
getLabelItems(newItem, scanMsg, callBack,locationCode,isHavePackNumber);
}
}).catch(err => {
labelResult.success = false;
@ -96,24 +100,40 @@ export function getQRCodeInfo(header, version, scanMsg, callBack) {
callBack(err);
})
} else {
getLabelItems(labelItem, scanMsg, callBack);
getLabelItems(labelItem, scanMsg, callBack,locationCode,isHavePackNumber);
}
}
export function getLabelItems(labelItem, scanMsg, callBack) {
export async function getLabelItems(labelItem, scanMsg, callBack,locationCode) {
let managementType = ""
let labelResult = analysisQRCodeLabel(labelItem, scanMsg);
if (labelResult.label.labelType == 'PurchaseLabel' || labelResult.label.labelType == 'MakeLabel') {
//查询包装信息
let packingNumber = labelResult.label.packingNumber
if (packingNumber != undefined) {
getPackageByNumber(packingNumber).then(pack => {
if (pack.data.list.length == 0) {
let packingNumber1 = labelResult.label.packingNumber//记录单号
if(locationCode){
await getManagementPrecisions([labelResult.label.itemCode], locationCode, res => {
if (res.success) {
const managementList = res.list;
managementType = managementList&&managementList[0]&&managementList[0].ManagementPrecision ? managementList[0].ManagementPrecision :'BY_PACKAGING'
if(managementType == 'BY_BATCH' || managementType == 'BY_QUANTITY'){
if(!isHavePackNumber){
packingNumber = ''
}
}
}
})
}
if (packingNumber != undefined && packingNumber != '') {
await getPackageListByNumber(packingNumber).then(pack => {
if (pack.data.reqPackage) {
labelResult.package = pack.data.reqPackage;
labelResult.package.subList = pack.data.subList;
} else {
labelResult.success = false;
labelResult.message = '包装号[' + packingNumber + ']没有包装信息';
} else {
labelResult.package = pack.data.list[0];
console.log('包装信息', JSON.stringify(labelResult.package))
}
labelResult.managementType = managementType
callBack(labelResult);
}).catch(err => {
labelResult.success = false;
@ -121,9 +141,14 @@ export function getLabelItems(labelItem, scanMsg, callBack) {
callBack(labelResult);
})
} else {
labelResult.success = false;
labelResult.message = '在条码中未解析到箱码';
labelResult.package = labelResult.label;
labelResult.package.number = packingNumber1 ? packingNumber1 : ''
labelResult.package.packingNumber=''
labelResult.managementType = managementType
callBack(labelResult);
// labelResult.success = false;
// labelResult.message = '在条码中未解析到箱码';
// callBack(labelResult);
}
} else {
callBack(labelResult);
@ -153,8 +178,15 @@ export function analysisQRCodeLabel(labelItem, scanMsg) {
let scanItems = scanMsg.split(separators);
if (scanItems.length > 0) {
scanItems.forEach((item, index) => {
let type = item.substring(0, 1);
let value = item.substring(1, item.length);
let type = ''
let value = ''
if(item.includes('PU')||item.includes('PQ')){
type = item.substring(0, 2);
value = item.substring(2, item.length);
}else{
type = item.substring(0, 1);
value = item.substring(1, item.length);
}
if (type == 'H') {
labelResult.label.header = item;
} else if (type == 'V') {
@ -175,7 +207,6 @@ export function analysisQRCodeLabel(labelItem, scanMsg) {
}
}
// console.log('标签', labelResult.label)
return labelResult;
}

101
src/common/record.js

@ -7,21 +7,22 @@ import {
} from '@/common/directory.js';
import { calc } from '@/common/calc'
import { Decimal } from 'decimal.js';//引入
import {
deepCopyData
} from '@/common/basic.js';
import {
deepCopyData
} from '@/common/basic.js';
export function createItemInfo(balance, pack) {
let item = {
itemCode: pack.itemCode,
itemName: pack.itemName,
stdPackQty: pack.stdPackQty,
stdPackUnit: pack.stdPackUnit,
packQty: pack.packQty,
packUnit: pack.packUnit,
qty: new Decimal(balance.qty).toNumber(),
handleQty:new Decimal(0).toNumber(),
handleQty: new Decimal(0).toNumber(),
uom: pack.uom,
subList: []
}
item.containerNumber = pack.parentNumber ? pack.parentNumber : pack.number;
return item;
}
@ -32,21 +33,56 @@ export function createDetailInfo(balance, pack) {
let detail = deepCopyData(balance);
detail.balanceQty = new Decimal(detail.qty).toNumber()
detail.qty = new Decimal(detail.qty).toNumber();
detail.stdPackQty = new Decimal(pack.stdPackQty).toNumber()
detail.stdPackUnit = pack.stdPackUnit
detail.handleQty = new Decimal(detail.qty).toNumber() ;
detail.packQty = pack.packQty ? new Decimal(pack.packQty).toNumber() : 0
detail.packUnit = pack.packUnit
detail.handleQty = new Decimal(detail.qty).toNumber() ;
detail.package = pack;
detail.productionlineCode = pack.productionLineCode; // 制品回收记录需要加的
detail.toInventoryStatus = balance.inventoryStatus; // 制品回收记录需要加的
return detail;
}
export function createDetailInfoForLabel(balance, pack,label) {
balance.scaned = true;
// data.toInventoryStatus = this.toInventoryStatus == "" ? data.inventoryStatus : this.toInventoryStatus;
// data.inventoryStatus = data.inventoryStatus;
let detail = deepCopyData(balance);
detail.balanceQty = new Decimal(detail.qty).toNumber()
detail.qty = new Decimal(detail.qty).toNumber();
detail.packQty = pack.packQty ? new Decimal(pack.packQty).toNumber() : 0
detail.packUnit = pack.packUnit
console.log(988,label.qty)
detail.handleQty = new Decimal(label.qty).toNumber();
detail.package = pack;
detail.productionlineCode = pack.productionLineCode; // 制品回收记录需要加的
detail.toInventoryStatus = balance.inventoryStatus; // 制品回收记录需要加的
return detail;
}
export function createDetailByPackInfo(pack) {
// data.toInventoryStatus = this.toInventoryStatus == "" ? data.inventoryStatus : this.toInventoryStatus;
// data.inventoryStatus = data.inventoryStatus;
let detail = deepCopyData(pack); detail.scaned = true;
detail.balanceQty = new Decimal(detail.qty).toNumber()
detail.qty = new Decimal(detail.qty).toNumber();
detail.packQty = pack.packQty ? new Decimal(pack.packQty).toNumber() : 0
detail.packUnit = pack.packUnit
detail.handleQty = new Decimal(detail.qty).toNumber();
detail.package = pack;
return detail;
}
//计算实际数量
export function calcHandleQty(detailSource) {
for (let item of detailSource) {
console.log('qqqqqqqqq')
item.handleQty = new Decimal(0).toNumber();
item.qty = new Decimal(0).toNumber();
console.log('bbbbbb')
for (let detail of item.subList) {
if(detail!=undefined){
console.log(detail)
if(detail.scaned){
item.handleQty = calc.add(item.handleQty,detail.handleQty);
}
@ -55,14 +91,48 @@ export function calcHandleQty(detailSource) {
}
}
}
//添加数量
export function calcHandleQtyAdd(detailSource,label) {
for (let item of detailSource) {
item.handleQty = item.handleQty || new Decimal(0).toNumber();
item.qty = item.qty|| new Decimal(0).toNumber();
item.handleQty = calc.add(item.handleQty, label.qty);
for (let detail of item.subList) {
if (detail != undefined) {
if (detail.scaned) {
detail.handleQty = calc.add(detail.handleQty, label.qty);
}
// item.qty = calc.add(item.qty, detail.qty);
}
}
}
}
export function calcTreeHandleQty(detailSource) {
for (let item of detailSource) {
item.handleQty = new Decimal(0).toNumber();
for (let detail of item.subList) {
if (detail != undefined && detail.scaned) {
detail.handleQty = new Decimal(0).toNumber();
for (let pack of detail.packList){
if(pack!=undefined&&pack.scaned){
detail.handleQty = calc.add(detail.handleQty, pack.handleQty);
}
}
item.handleQty = calc.add(item.handleQty, detail.handleQty);
}
}
}
}
export function getBusinessType(typeCode, callback) {
let result = {
success: true,
businessType: '',
fromlocationTypeList: '',
tolocationTypeList: '',
itemCodeTypeList:"",
fromLocationAreaTypeList:'',
toLocationAreaTypeList:'',
itemTypeList: "",
itemStatusList:"",
useOnTheWay:"FALSE",
fromInventoryStatuses: '',
toInventoryStatuses: '',
@ -71,9 +141,10 @@ export function getBusinessType(typeCode, callback) {
getBusinesstypeByCode(typeCode).then(res => {
if (res.data.total > 0) {
result.businessType = res.data.list[0];
result.fromlocationTypeList = getDirectoryItemArray(res.data.list[0].outLocationTypes)
result.tolocationTypeList = getDirectoryItemArray(res.data.list[0].inLocationTypes)
result.itemCodeTypeList = getDirectoryItemArray(res.data.list[0].itemTypes)
result.fromLocationAreaTypeList = getDirectoryItemArray(res.data.list[0].outAreaTypes) ;
result.toLocationAreaTypeList = getDirectoryItemArray(res.data.list[0].inAreaTypes) ;
result.itemTypeList = getDirectoryItemArray(res.data.list[0].itemTypes)
result.itemStatusList =getDirectoryItemArray(res.data.list[0].itemStatuses)
result.fromInventoryStatuses = res.data.list[0].outInventoryStatuses;
result.toInventoryStatuses = res.data.list[0].inInventoryStatuses;
result.useOnTheWay =res.data.list[0].useOnTheWay

236
src/common/style/new_style.css

@ -62,6 +62,10 @@ uni-page-head .uni-page-head__title {
font-size: 1.125rem;
}
.font_default {
font-size: 1rem;
}
.margin_top {
margin-top: 20rpx;
}
@ -180,18 +184,20 @@ uni-page-head .uni-page-head__title {
text-align: center;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
opacity: 0.8;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
.scan_float image {
width: 40rpx;
height: 40rpx;
margin-top: 10rpx;
}
.scan_float view {
color: #fff;
font-size: .725rem;
margin-top: -8rpx;
}
.top_card {
@ -212,9 +218,10 @@ uni-page-head .uni-page-head__title {
.cen_card {
padding: 0 0rpx;
width: 100%;
box-sizing: border-box;
float: left;
background:#EEF4FA;
padding:20rpx;
border-radius: 10rpx;
}
.cell_box {
@ -227,6 +234,7 @@ uni-page-head .uni-page-head__title {
padding: 0 20rpx;
/* margin: 0 0 20rpx; */
text-align: center;
flex:1
}
.cell_box .cell_long {
@ -236,7 +244,8 @@ uni-page-head .uni-page-head__title {
.cell_box .cell_info view {
font-size: 0.9375rem;
margin-bottom: 10rpx;
color: #7B8195;
color: #515562;
word-wrap:break-word
}
.cell_box .cell_info .text_black {
@ -306,7 +315,7 @@ uni-page-head .uni-page-head__title {
}
.cen_card .cell_box .cell_info .text_lightblue {
font-size: 0.925rem;
font-size:26rpx;
}
.bot_card {
@ -1390,13 +1399,13 @@ uni-page-head .uni-page-head__title {
}
.msg_list {
padding-top: 20rpx;
}
.msg_list .uni-list-chat__header {
.msg_list ::v-deep .u-card__head--left__thumb{
width: 60rpx !important;
height: 60rpx !important;
background-color: #3d7eff;
padding:12rpx;
background-color: #3d7eff!important;
border-color: transparent !important;
border-radius: 6rpx !important;
}
@ -1422,9 +1431,8 @@ uni-page-head .uni-page-head__title {
.msg_list .uni-list-chat__content-title {
font-size: .9rem !important;
}
.msg_list .hasread .uni-list-chat__header {
background-color: #ccc;
::v-deep .msg_list .hasread .u-card__head--left__thumb {
background-color: #ccc!important;
}
/* index */
@ -1850,7 +1858,7 @@ uni-modal .uni-modal__hd {
border-radius: 8rpx;
max-width: 300rpx;
font-size: 0.7rem;
overflow: visble;
overflow: visible;
word-break: break-all;
/* overflow: hidden;
white-space: nowrap;
@ -2027,15 +2035,21 @@ button::after {
}
.card_itemCode {
font-size: 36rpx;
/* font-weight: 500; */
padding: 5rpx 10rpx;
font-size: 32rpx;
font-weight: bold;
/* padding: 5rpx 10rpx; */
/* width: 210rpx; */
word-wrap: break-word;
word-break: break-all;
}
.card_itemName {
color: #909399;
font-size: 30rpx;
padding: 5rpx 20rpx;
font-size: 26rpx;
/* padding: 5rpx 10rpx; */
/* width: 210rpx; */
word-wrap: break-word;
word-break: break-all;
}
.card_ProdLine {
@ -2058,43 +2072,50 @@ button::after {
.card_content {
font-size: 32rpx;
font-size: 40rpx;
color:#2E3A63;
margin-left:20rpx;
font-weight: 600;
}
.card_big_content {
font-size: 40rpx;
font-weight: bold;
padding: 5px;
}
.card_icon_normal {
width: 45rpx;
height: 45rpx;
vertical-align: middle
width: 30rpx;
height: 30rpx;
vertical-align: middle;
margin-right:12rpx
}
.card_packing_code {
color: #3315EB;
.card_item_code {
color: #329362;
padding: 5px;
font-size: 30rpx;
}
.card_packing_code_content {
font-size: 32rpx;
.card_packing_code {
color: #3315EB;
padding: 5px;
font-size: 26rpx;
font-style: italic;
}
.card_batch {
color: #9747FF;
padding: 5px;
}
.card_batch_content {
font-size: 32rpx;
padding: 5px;
font-size: 26rpx;
font-style: italic;
}
.card_container {
color: #0076F6;
padding: 5px;
font-size: 30rpx;
}
.card_container_content {
font-size: 32rpx;
padding: 5px;
@ -2102,45 +2123,72 @@ button::after {
.card_business {
color: #F1A532;
padding: 5px;
font-size: 26rpx;
font-style: italic;
}
.card_business_content {
font-size: 32rpx;
padding: 5px;
color:#2E3A63;
margin-left:20rpx
}
.card_location {
color: #DA8910;
padding: 5px;
font-size: 26rpx;
font-style: italic;
}
.card_to_location {
color: #329362;
padding: 5px;
font-size: 26rpx;
font-style: italic;
}
.card_location_content {
font-size: 32rpx;
padding: 5px;
}
.card_level {
color: #0689da;
padding: 5px;
font-size: 30rpx;
}
.card_supportCode {
color: #DA8910;
padding: 5px;
}
.card_supportCode_content {
font-size: 32rpx;
}
/* .card_item_code {
color: #F1A532;
padding: 5px;
} */
.card_product_date {
color: #329362;
padding: 5px;
}
.card_order {
color: #0076F6;
padding: 5px;
}
.scan_view {
/* #0CC2B6 20% */
background: linear-gradient(90deg, rgba(12, 194, 182, 0.2) 0%, rgba(12, 194, 182, 0) 100%)
background: linear-gradient(90deg, rgba(12, 194, 182, 0.2) 0%, rgba(12, 194, 182, 0.05) 100%);
border-radius:14rpx;
padding:10rpx 20rpx 16rpx
}
.card_view {
font-size: 32rpx;
padding: 5rpx;
margin-top:14rpx;
margin-left: 10rpx;
}
/*
@ -2183,29 +2231,28 @@ button::after {
.task_top {
margin: 0rpx 10rpx;
background-color: #fff;
vertical-align: middle;
}
.task_item {
margin: 0rpx 10rpx;
background-color: #fff;
padding:20rpx 0px
}
.task_card {
padding: 12rpx;
padding:0px 20rpx;
background-color: #fff;
border-radius: 10rpx;
margin: 12rpx;
}
.task_number {
font-size: 35rpx;
font-size: 36rpx;
font-weight: 600;
/* bold */
}
.task_text {
font-size: 30rpx;
margin: 5rpx 0rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
@ -2260,25 +2307,50 @@ button::after {
border-radius: 10rpx;
}
.receive_state_no_ok {
font-size: 28rpx;
background: rgba(236, 156, 0, 0.2);
color: #EC9C00;
padding: 10rpx 20rpx 10rpx 20rpx;
border-radius: 10rpx;
}
.receive_state_ok {
font-size: 28rpx;
background: rgba(95, 203, 148, 0.2);
color: #22AF68;
padding: 10rpx 20rpx 10rpx 20rpx;
border-radius: 10rpx;
}
.receive_state_reject {
font-size: 28rpx;
background: rgba(95, 203, 148, 0.2);
color: #22AF68;
padding: 10rpx 20rpx 10rpx 20rpx;
border-radius: 10rpx;
}
.pop_detail {
background-color: #fff;
width: 100%;
border-radius: 8rpx 8rpx 0rpx 0rpx;
padding: 15rpx;
padding:0px 30rpx;
}
.pop_detail .item {
padding-top: 5rpx;
padding-bottom: 5rpx;
margin-left: 10rpx;
margin-right: 10rpx;
/* margin-left: 10rpx; */
/* margin-right: 10rpx; */
display: flex;
flex-direction: row;
-webkit-justify-content: space-between;
justify-content: space-between;
align-items:center
}
.pop_detail .item_title {
@ -2423,7 +2495,24 @@ button[disabled] {
padding-right: 20rpx;
z-index: 10;
}
.btn_single_clear{
background-color: #fff;
font-size: 30rpx;
color: #000;
text-align: center;
width: 180rpx;
}
.btn_single_clear{
background-color: #fff;
font-size: 30rpx;
color: #000;
text-align: center;
width: 180rpx;
}
.btn_clear_after {
opacity: 0.7;
}
.btn_single_commit {
background-color: #3C9CFF;
font-size: 30rpx;
@ -2431,11 +2520,27 @@ button[disabled] {
text-align: center;
width: 180rpx;
}
.btn_single_clear {
background-color: #EBEEF0;
font-size: 30rpx;
color: #000;
text-align: center;
width: 180rpx;
}
.btn_single_reject {
background-color: #F56C6C;
font-size: 30rpx;
color: #fff;
text-align: center;
width: 180rpx;
}
.center {
display: flex;
flex-direction: row;
justify-content: center;
justify-content: flex-end;
align-items: center;
}
@ -2447,9 +2552,17 @@ button[disabled] {
.text_recommend {
color: #0A84FF;
font-size: 38rpx;
font-size: 34rpx;
font-weight: bold;
}
.text_packQty {
color: #3315EB;
font-size: 40rpx;
font-weight: bold;
}
.text_balance {
font-size: 36rpx;
}
@ -2481,7 +2594,7 @@ button[disabled] {
align-items: center;
padding: 0px;
color: #909399;
font-size: 30rpx;
font-size:26rpx;
}
.std_uom {
@ -2493,7 +2606,7 @@ button[disabled] {
.uom {
color: #909399;
font-size: 30rpx;
font-size: 26rpx;
margin-left: 5rpx;
margin-right: 5rpx;
display: flex;
@ -2587,7 +2700,14 @@ button[disabled] {
border: 1px solid rgb(220, 211, 211);
padding: 5rpx;
}
.desc_input {
height: 100rpx;
font-size: 10rpx;
color: #000000;
text-align: left;
border: 1px solid rgb(220, 211, 211);
padding: 5rpx;
}
.qty_inspect_input {
width: 150rpx;
height: 60rpx;
@ -2642,8 +2762,9 @@ button[disabled] {
align-self: stretch;
/* 颜色/白色 */
background: #FFFFFF;
background:rgba(60, 156, 255, 1);
box-sizing: border-box;
color:white;
/* 颜色/边框 */
border: 1px solid #E7E6E4;
z-index: 3;
@ -2747,3 +2868,8 @@ button[disabled] {
padding: 10rpx 20rpx 10rpx 20rpx;
border-radius: 10rpx;
}
.split_line {
background-color: rgba(230,230,230,0.5);
height: 1px;
}

31
src/common/style/pdabasic.css

@ -480,7 +480,7 @@ export function getItemTypeStyle(val) {
.detail-list {
background-color: #fff;
padding:5rpx 10rpx;
padding: 5rpx 10rpx;
/* margin: 20rpx; */
/* border-radius: 16rpx; */
/* overflow: hidden; */
@ -631,7 +631,7 @@ export function getItemTypeStyle(val) {
/* border-width: 0.5px;
border-style: solid;
border-color: #e5e5e5;
border-radius: 5px;
border-radius: 5px;
background-color: rgb(248, 248, 248);
font-size: 18px;*/
font-size: .825rem;
@ -725,20 +725,29 @@ page {
}
.page-header {
background-color: #3c9cff;
font-size: 35rpx;
padding: 10rpx 20rpx;
}
.page-header .header-view {
display: flex;
flex-direction: column;
background-color: #fff;
font-size: 35rpx;
padding: 10rpx 20rpx;
border-radius: 4px;
}
.page-header .header_item {
.page-header .header-view .header_item {
/* padding-left: 10rpx; */
padding: 5rpx 10rpx;
font-size:32rpx ;
font-size: 32rpx;
}
.page-header .header_job_top {
padding:5rpx 0rpx;
.page-header .header-view .header_job_top {
padding: 5rpx 0rpx;
}
.page-main {
flex: 1;
position: relative;
@ -760,3 +769,11 @@ page {
background: #e0e0e0;
}
.page-footer {
/* color: #fff; */
/* line-height: 100rpx; */
/* 不放大不缩小固定100rpx */
flex: 0 0 100rpx;
/* background-color: #00AAFF; */
}

138
src/common/utils/common.ts

@ -1,138 +0,0 @@
const _dTo = function(url) {
if (!_getSync('isLogin')) {
_gTo('/pages/login/index')
return;
}
uni.navigateTo({
url: url
});
}
const _gTo = function(url) {
uni.navigateTo({
url: url
});
}
const _getSync = (i) => {
return uni.getStorageSync(i);
}
const _removeSync = (i) => {
return uni.removeStorageSync(i);
}
const _setSync = (i, data) => {
return uni.setStorageSync(i, data);
}
const _alert = (txt, cb) => {
uni.showModal({
title: '温馨提示',
content: txt,
showCancel: false,
confirmColor: '#2979ff',
success: function() {
cb && cb();
}
});
}
const _confirm = function(txt, cb) {
uni.showModal({
title: '温馨提示',
content: txt,
showCancel: true,
confirmColor: '#2979ff',
success: function(res) {
if (res.confirm) {
cb && cb();
}
}
});
}
const _toast = function(txt) {
uni.showToast({
title: txt,
icon: 'none',
duration: 1500
});
}
const _backT = function() {
uni.navigateBack();
}
const _call = function(tel) {
uni.makePhoneCall({
phoneNumber: tel
});
}
const _showLoading = (msg = '') => uni.showLoading({
mask: true,
title: msg
});
/**
* loading
*/
const _closeLoading = () => uni.hideLoading();
// 获取截图宽高
const _screenshot = function(fromWhere, widthProp, proportion) {
var width = 0,
height = 0;
uni.getSystemInfo({
//整个手机屏幕的高
success: function(res) {
width = parseInt(res.screenWidth * widthProp) //宽等于屏幕款*百分比
height = width * proportion
}
});
_gTo('../u-avatar-cropper/u-avatar-cropper?destWidth=' + (width * 2) + '&destHeight=' + (height * 2) +
'&rectWidth=' + width + '&rectHeight=' + height + '&fileType=jpg' + '&fromWhere=' +
fromWhere)
}
// 复制
const _copy = (data) => {
uni.setClipboardData({
data: data,
success: function() {
}
});
}
const _upLoad = function(tempFilePaths) {
return new Promise((resolve, reject) => {
uni.uploadFile({
url: import.meta.env.VITE_BASE_URL + '/common/upload', //仅为示例,非真实的接口地址
filePath: tempFilePaths,
name: 'file',
formData: {
'user': 'test'
},
header: { "Content-Type": "multipart/form-data", 'openId': uni.getStorageSync('openId') },
success: (uploadFileRes) => {
let item = JSON.parse(uploadFileRes.data.replace(/\ufeff/g, ""));
resolve(item)
},
fail(err) {
}
});
})
}
export {
_dTo,
_gTo,
_toast,
_backT,
_call,
_confirm,
_alert,
_getSync,
_setSync,
_removeSync,
_showLoading,
_closeLoading,
_screenshot,
_copy,
_upLoad
};

50
src/common/utils/dateTime.ts

@ -1,50 +0,0 @@
const zeroPadd = function(date,seperator) {
var hours = date.getHours(); // 获取时
var minutes = date.getMinutes(); // 获取分
var second = date.getSeconds(); // 获取秒
var seperator1 = seperator?seperator:"-"; // 自定义日期分隔符
var year = date.getFullYear(); // 获取年
var month = date.getMonth() + 1; // 获取月
var strDate = date.getDate(); // 获取日
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (strDate >= 0 && strDate <= 9) {
strDate = "0" + strDate;
}
if (hours >= 0 && hours <= 9) {
hours = "0" + hours;
}
if (minutes >= 0 && minutes <= 9) {
minutes = "0" + minutes;
}
if (second >= 0 && second <= 9) {
second = "0" + second;
}
var time = hours + ":" + minutes + ":" + second; // 时分秒
var currentdate = year + seperator1 + month + seperator1 + strDate; // 年月日
var date = {
time, currentdate
}
return date;
}
// 获取当前日期 时间
const getNowFormatDate = function(date,seperator) {
return zeroPadd(date,seperator);
}
//获取一小时后的日期 时间
const accessTimeInAnHour = function(date, h,seperator) {
var date1 = date.getTime(); // 获取当前时间戳
// 当前时间戳+3600s(一小时,其他时间通过计算时间戳进行相应加减),重新设置 Date 对象
date.setTime(date1 + h * 3600000);
return zeroPadd(date,seperator);
}
export {
getNowFormatDate,
accessTimeInAnHour,
};

19
src/common/utils/http.ts

@ -1,19 +0,0 @@
// @ts-ignore
import buildURL from 'axios/lib/helpers/buildURL'
import type { AxiosRequestConfig } from 'axios'
type ParamsSerializer = AxiosRequestConfig['paramsSerializer']
export function getFullURL(
baseURL: string,
url: string,
params: Record<string, any>,
paramsSerializer?: ParamsSerializer
) {
if (url.startsWith('http')) {
return buildURL(url, params, paramsSerializer)
}
baseURL = baseURL.endsWith('/') ? baseURL : `${baseURL}/`
url = url.startsWith('/') ? url.slice(1) : url
return buildURL(`${baseURL}${url}`, params, paramsSerializer)
}

16
src/common/utils/storage.js

@ -10,7 +10,21 @@ const setStorage = (key,value)=>{
// 清除全部本地存储
const clearStorage = ()=>{
uni.clearStorageSync();
let overPackageRecordPointParams = ''
if( uni.getStorageSync('overPackageRecordPointParams')){
overPackageRecordPointParams = uni.getStorageSync('overPackageRecordPointParams')
}
let overPackageJobDetailPointParams = ''
if( uni.getStorageSync('overPackageJobDetailPointParams')){
overPackageJobDetailPointParams = uni.getStorageSync('overPackageJobDetailPointParams')
}
uni.clearStorageSync();
if(overPackageRecordPointParams){
uni.setStorageSync('overPackageRecordPointParams',overPackageRecordPointParams)
}
if(overPackageJobDetailPointParams){
uni.setStorageSync('overPackageJobDetailPointParams',overPackageJobDetailPointParams)
}
}
// 清除指定key本地存储

31
src/common/utils/utils.ts

@ -1,31 +0,0 @@
function compareVersion(v1, v2) {
v1 = v1.split('.')
v2 = v2.split('.')
const len = Math.max(v1.length, v2.length)
while (v1.length < len) {
v1.push('0')
}
while (v2.length < len) {
v2.push('0')
}
for (let i = 0; i < len; i++) {
const num1 = parseInt(v1[i])
const num2 = parseInt(v2[i])
if (num1 > num2) {
return 1
} else if (num1 < num2) {
return -1
}
}
return 0
}
export default {
compareVersion
}

783
src/common/utils/validator.ts

@ -1,783 +0,0 @@
//校验学校编码 只能为数字
export function validateCode(rule, value, callback) {
if (!value) {
return callback(new Error('学校编码不能为空'))
} else {
const codeReg = /^[0-9]+$/
const codeMax = /^\d{0,5}$/
if (codeReg.test(value)) {
if (codeMax.test(value)) {
callback()
} else {
callback(new Error('学校编码不能大于5位'))
}
} else {
callback(new Error('请输入正确的学校编码,只能是数字'))
}
}
}
//校验邮箱
export function validateEmail(rule, value, callback) {
if (value) {
const mailReg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/
if (mailReg.test(value)) {
callback()
} else {
callback(new Error('请输入正确的邮箱格式'))
}
} else {
callback()
}
}
//校验英文
export function validateEng(rule, value, callback) {
if (value) {
const mailReg = /^[A-Za-z\-\&\(\)\Ⅰ\Ⅱ\Ⅲ\Ⅳ\Ⅴ\Ⅵ\Ⅶ\Ⅷ\Ⅸ\Ⅹ\s]+$/;
if (mailReg.test(value)) {
callback()
} else {
callback(new Error('请输入正确的英文名字'))
}
} else {
callback()
}
}
//校验姓名拼音
export function validateEngName(rule, value, callback) {
if (value) {
const EngNameReg = /^[A-Za-z \(\)\s]+$/
if (EngNameReg.test(value)) {
callback()
} else {
callback(new Error('请输入正确的姓名拼音'))
}
} else {
callback()
}
}
//校验手机号码
export function validateHanset(rule, value, callback) {
if (value) {
// const regs =/^[1][3,4,5,6,7,8,9][0-9]{9}$/;
// const regs = /^1[3|4|5|7|8][0-9]\d{8}$/
const regs = /^1[3-9]\d{9}$/
if (regs.test(value)) {
callback()
} else {
return callback(new Error('请输入正确的手机号'))
}
} else {
callback()
}
}
//校验座机电话
export function validatePhone(rule, value, callback) {
if (value) {
//const reg = /^1[3|4|5|7|8][0-9]\d{8}$/
// const regs = /^([0-9]{3,4}-)?[0-9]{7,8}$/;
const regs = /^((0\d{2,3}-\d{7,8}))$/;
if (regs.test(value)) {
callback()
} else {
return callback(new Error('请输入正确的座机号'))
}
} else {
callback()
}
}
//校验家庭电话 手机或者座机
export function validateFamilyPhone(rule, value, callback) {
if (value) {
const isPhone = /^([0-9]{3,4}-)?[0-9]{7,8}$/;
const isMob = /^((\+?86)|(\+86))?(13[0123456789][0-9]{8}|15[0123456789][0-9]{8}|17[0123456789][0-9]{8}|18[0123456789][0-9]{8}|147[0-9]{8}|1349[0-9]{7})$/;
if (isPhone.test(value) || isMob.test(value)) {
callback()
} else {
return callback(new Error('请输入正确的手机或者座机电话'))
}
} else {
callback()
}
}
// 校验只能为中文
export function validateChinese(rule, value, callback) {
if (value) {
const chineseReg = /^[\u4E00-\u9FA5]+$/
if (chineseReg.test(value)) {
callback()
} else {
callback(new Error('请输入简介,只能为中文'))
}
} else {
callback()
}
}
// 校验名称既能为中文也可以为英文
export function validateName(rule, value, callback) {
if (value) {
const chineseReg = /^[\u4E00-\u9FA5]+$/
const engLish = /^[A-Za-z]+$/
if (chineseReg.test(value) || engLish.test(value)) {
callback()
} else {
callback(new Error('请输入正确的中文或者英文名称'))
}
} else {
callback()
}
}
// 校验负责人既能为中文也可以为英文
export function validateChargeperson(rule, value, callback) {
if (value) {
const chineseReg = /^[\u4E00-\u9FA5]+$/
const engLish = /^[A-Za-z]+$/
if (chineseReg.test(value) || engLish.test(value)) {
callback()
} else {
callback(new Error('请输入正确的负责人(中英文都可以)'))
}
} else {
callback()
}
}
//校验学校名称不能为空
export function validateXXMC(rule, value, callback) {
if (!value) {
return callback(new Error('案例名称不能为空'))
} else {
const chineseReg = /^[\u4E00-\u9FA5]+$/
if (chineseReg.test(value)) {
callback()
} else {
callback(new Error('请输入正确的案例名称,只能是汉字'))
}
}
}
//校验中英文数字和下划线都可以
export function validateZYS(rule, value, callback) {
if (value) {
//const postReg =/^[\u4e00-\u9fa5_a-zA-Z0-9_]{4,10}+$/
const Reg = /^[\u4e00-\u9fa5a-zA-Z0-9]+$/
if (Reg.test(value)) {
callback()
} else {
callback(new Error('请输入正确的名称'))
}
} else {
callback()
}
}
// 校验邮政编码
export function validatePostCode(rule, value, callback) {
if (value) {
const postReg = /^[1-9]\d{5}$/
if (postReg.test(value)) {
callback()
} else {
callback(new Error('请输入正确的邮政编码'))
}
} else {
callback()
}
}
// 数字
export function validateNum(rule, value, callback) {
if (value) {
const numReg = /^[\d]+$/
if (numReg.test(value)) {
callback()
} else {
callback(new Error('请输入数字'))
}
} else {
callback()
}
}
//数字和小数点
export function validateNumDot(rule, value, callback) {
if (value) {
const numReg = /^\d+$|^\d+\.\d+$/g
if (numReg.test(value)) {
callback()
} else {
callback(new Error('请输入数字或小数点'))
}
} else {
callback()
}
}
// 组织机构代码
export function validateOrganization(rule, value, callback) {
if (value) {
const orgReg = /^[A-Za-z0-9]\w{14}$/g
if (orgReg.test(value)) {
callback()
} else {
callback(new Error('请输入组织机构代码'))
}
} else {
callback()
}
}
// 传真
export function validateFax(rule, value, callback) {
if (value) {
const faxReg = /^(\d{3,4}-)?\d{7,8}$/
if (faxReg.test(value)) {
callback()
} else {
callback(new Error('请输入正确的传真'))
}
} else {
callback()
}
}
// 主页地址
export function validateHome(rule, value, callback) {
if (value) {
const homeReg = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\*\+,;=.]+$/
if (homeReg.test(value)) {
callback()
} else {
return callback(new Error('请输入正确的主页地址'))
}
} else {
callback()
}
}
// 学分 小数,且保留最多三位小数
export function validateXf(rule, value, callback) {
if (!value) {
return callback(new Error('学分不能为空'))
} else {
const numReg = /^[0-9]+\.[0-9]{0,3}$/
if (numReg.test(value)) {
callback()
} else {
callback(new Error('请输入小数,且小数点后最多三位'))
}
}
}
// 数字格式 小数点后一位
export function validateOneNum(rule, value, callback) {
if (value) {
const numReg = /^\d+(\.\d+)?$/
const numOneReg = /^\d*\.{0,1}\d{0,1}$/
if (numReg.test(value)) {
if (numOneReg.test(value)) {
callback()
} else {
callback(new Error('小数点后最多1位'))
}
} else {
callback(new Error('请输入数字'))
}
}
callback()
}
// 数字格式 小数点后两位
export function validateTwoNum(rule, value, callback) {
if (value) {
const numReg = /^\d+(\.\d+)?$/
const numTwoReg = /^\d*\.{0,2}\d{0,2}$/
if (numReg.test(value)) {
if (numTwoReg.test(value)) {
callback()
} else {
callback(new Error('小数点后最多2位'))
}
} else {
callback(new Error('请输入数字'))
}
}
callback()
}
// 数字格式 小数点后两位 小数点前保留五位
export function validateTwoNumThree(rule, value, callback) {
if (value) {
if (Number(value) > 10000) {// 校验value值不能大于10000
callback(new Error('数值过大,请重新输入'))
} const numReg = /^\d+(\.\d+)?$/
const numTwoReg = /^\d*\.{0,2}\d{0,2}$/
if (numReg.test(value)) {
if (numTwoReg.test(value)) {
callback()
} else {
callback(new Error('小数点后最多2位'))
}
} else {
callback(new Error('请输入数字'))
}
}
callback()
}
// 数字格式 小数点后三位
export function validateThreeNum(rule, value, callback) {
if (value) {
const numReg = /^\d+(\.\d+)?$/
const numTwoReg = /^\d*\.{0,3}\d{0,3}$/
if (numReg.test(value)) {
if (numTwoReg.test(value)) {
callback()
} else {
callback(new Error('小数点后最多3位'))
}
} else {
callback(new Error('请输入数字'))
}
}
callback()
// if (!value) {
// return callback(new Error('字段不能为空'))
// } else {
// const numReg = /^\d+(\.\d+)?$/
// const numTwoReg = /^\d*\.{0,3}\d{0,3}$/
// if (numReg.test(value)) {
// if (numTwoReg.test(value)) {
// callback()
// } else {
// callback(new Error('小数点后最多3位'))
// }
// } else {
// callback(new Error('请输入数字'))
// }
// }
}
//校验年份必须为4位数字
export function validateNF(rule, value, callback) {
if (value) {
const NFReg = /^\d{4}$/
if (NFReg.test(value)) {
callback()
} else {
callback(new Error('请输入4位数字'))
}
} else {
callback()
}
}
//校验年份必须为4位数字
export function validateXQ(rule, value, callback) {
if (value) {
const NFReg = /^\d{5}$/
if (NFReg.test(value)) {
callback()
} else {
callback(new Error('请输入5位数字'))
}
} else {
callback()
}
}
//校验分数最大值
export function validateMaxNumber(rule, value, callback) {
if (parseInt(value) <= 200) {
callback()
} else {
callback(new Error('分数不能大于200'))
}
}
//校验正整数
export function validateInteger(rule, value, callback) {
if (value) {
const integerReg = /^[+]{0,1}(\d+)$/
if (integerReg.test(value)) {
callback()
} else {
callback(new Error('请输入正确的整数'))
}
} else {
callback()
}
}
//校验整数
export function validateroundNumber(rule, value, callback) {
if (value) {
const numReg = /^[1-9]\d*$/
if (numReg.test(value)) {
callback()
} else {
callback(new Error('请输入正确的整数'))
}
} else {
callback()
}
}
// 校验车牌号
export function validateCarNumber(rule, value, callback) {
if (value) {
// 新能源
const numReg = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([A-HJ-K][A-HJ-NP-Z0-9][0-9]{4}$))/;
// 燃油车
const numReg1 = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;
if (value.length == 7) {
if (numReg1.test(value)) {
callback()
}else{
callback(new Error('请输入正确的车牌号'))
}
} else if (value.length == 8) {
if (numReg.test(value)) {
callback()
}else{
callback(new Error('请输入正确的车牌号'))
}
} else {
callback(new Error('请输入正确的车牌号'))
}
} else {
callback()
}
}
//校验身份证号
export function validateCard(rule, value, callback) {
if (value) {
let cardBoolean = IdCardValidate(value);
// const cardReg =/(^\d{18}$)|(^\d{17}(\d|X|x)$)/
// if (cardReg.test(value)) {
if (cardBoolean) {
callback()
} else {
callback(new Error('请输入正确的身份证号'))
}
} else {
callback()
}
}
//身份证:身份证校验
function IdCardValidate(code) {
var tip = "";
if (code != "") {
var city = {
11: "北京",
12: "天津",
13: "河北",
14: "山西",
15: "内蒙古",
21: "辽宁",
22: "吉林",
23: "黑龙江 ",
31: "上海",
32: "江苏",
33: "浙江",
34: "安徽",
35: "福建",
36: "江西",
37: "山东",
41: "河南",
42: "湖北 ",
43: "湖南",
44: "广东",
45: "广西",
46: "海南",
50: "重庆",
51: "四川",
52: "贵州",
53: "云南",
54: "西藏 ",
61: "陕西",
62: "甘肃",
63: "青海",
64: "宁夏",
65: "新疆",
71: "台湾",
81: "香港",
82: "澳门",
91: "国外 "
};
var pass = true;
//是否为空
if (code === '') {
tip = "请输入身份证号,身份证号不能为空";
pass = false;
}
//校验长度,类型
else if (isCardNo(code) === false) {
tip = "您输入的身份证号码不正确,请重新输入";
pass = false;
}
//检查省份
else if (checkProvince(code, city) === false) {
tip = "您输入的身份证号码不正确,请重新输入";
pass = false;
}
//校验生日
else if (checkBirthday(code) === false) {
tip = "您输入的身份证号码生日不正确,请重新输入";
pass = false;
} else {
//18位身份证需要验证最后一位校验位
if (code.length == 18) {
code = code.split('');
//∑(ai×Wi)(mod 11)
//加权因子
var factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
//校验位
var parity = [1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2];
var sum = 0;
var ai = 0;
var wi = 0;
for (var i = 0; i < 17; i++) {
ai = code[i];
wi = factor[i];
sum += ai * wi;
}
var last = parity[sum % 11];
if (parity[sum % 11] != code[17]) {
tip = "身份证格式错误";
pass = false;
}
}
}
return pass;
}
}
//身份证:检查身份证号码是否符合规范,包括长度,类型
function isCardNo(card) {
//身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X
var reg = /(^\d{15}$)|(^\d{17}(\d|X)$)/;
if (reg.test(card) === false) {
return false;
}
return true;
};
//身份证:取身份证前两位,校验省份
function checkProvince(card, city) {
var province = card.substr(0, 2);
if (city[province] == undefined) {
return false;
}
return true;
};
//身份证:检查生日是否正确
function checkBirthday(card) {
var len = card.length;
//身份证15位时,次序为省(3位)市(3位)年(2位)月(2位)日(2位)校验位(3位),皆为数字
if (len == '15') {
var re_fifteen = /^(\d{6})(\d{2})(\d{2})(\d{2})(\d{3})$/;
var arr_data = card.match(re_fifteen);
var year = arr_data[2];
var month = arr_data[3];
var day = arr_data[4];
var birthday = new Date('19' + year + '/' + month + '/' + day);
return verifyBirthday('19' + year, month, day, birthday);
}
//身份证18位时,次序为省(3位)市(3位)年(4位)月(2位)日(2位)校验位(4位),校验位末尾可能为X
if (len == '18') {
var re_eighteen = /^(\d{6})(\d{4})(\d{2})(\d{2})(\d{3})([0-9]|X)$/;
var arr_data = card.match(re_eighteen);
var year = arr_data[2];
var month = arr_data[3];
var day = arr_data[4];
var birthday = new Date(year + '/' + month + '/' + day);
return verifyBirthday(year, month, day, birthday);
}
return false;
};
//身份证:校验日期
function verifyBirthday(year, month, day, birthday) {
var now = new Date();
var now_year = now.getFullYear();
//年月日是否合理
if (birthday.getFullYear() == year && (birthday.getMonth() + 1) == month && birthday.getDate() == day) {
//判断年份的范围(3岁到100岁之间)
var time = now_year - year;
if (time >= 3 && time <= 100) {
return true;
}
return false;
}
return false;
};
/**
* 18
* @param a_idCard
* @return
*/
function isTrueValidateCodeBy18IdCard(a_idCard) {
let By18Val = a_idCard[17].toLowerCase(); // 获取第十八位值
const numReg = /^[1-9]\d*$/
let numVal = false; // 校验第十八位是否为整数
if (numReg.test(Number(By18Val))) {
numVal = true
} else {
numVal = false
}
if (By18Val == 'x' || By18Val == 'X' || numVal) {
return true
} else {
return false
}
}
/**
*
* @param AddressNum
* @constructor
*/
function IdCardValidateAddress(AddressNum) {
var city = {
11: "北京",
12: "天津",
13: "河北",
14: "山西",
15: "内蒙古",
21: "辽宁",
22: "吉林",
23: "黑龙江 ",
31: "上海",
32: "江苏",
33: "浙江",
34: "安徽",
35: "福建",
36: "江西",
37: "山东",
41: "河南",
42: "湖北 ",
43: "湖南",
44: "广东",
45: "广西",
46: "海南",
50: "重庆",
51: "四川",
52: "贵州",
53: "云南",
54: "西藏 ",
61: "陕西",
62: "甘肃",
63: "青海",
64: "宁夏",
65: "新疆",
71: "台湾",
81: "香港",
82: "澳门",
91: "国外 "
};
if (city[AddressNum.substr(0, 2)]) {
return true
} else {
return false
}
}
/**
* 18
* @param idCard 18
* @return
*/
function isValidityBrithBy18IdCard(idCard18) {
var year = idCard18.substring(6, 10);
var month = idCard18.substring(10, 12);
var day = idCard18.substring(12, 14);
var temp_date = new Date(year, parseFloat(month) - 1, parseFloat(day));
// 这里用getFullYear()获取年份,避免千年虫问题
if (temp_date.getFullYear() != parseFloat(year)
|| temp_date.getMonth() != parseFloat(month) - 1
|| temp_date.getDate() != parseFloat(day)) {
return false;
} else {
return true;
}
}
/**
* 15
* @param idCard15 15
* @return
*/
function isValidityBrithBy15IdCard(idCard15) {
var year = idCard15.substring(6, 8);
var month = idCard15.substring(8, 10);
var day = idCard15.substring(10, 12);
var temp_date = new Date(year, parseFloat(month) - 1, parseFloat(day));
// 对于老身份证中的你年龄则不需考虑千年虫问题而使用getYear()方法
if (temp_date.getYear() != parseFloat(year)
|| temp_date.getMonth() != parseFloat(month) - 1
|| temp_date.getDate() != parseFloat(day)) {
return false;
} else {
return true;
}
}
/**
*
* @param str
* @returns {*}
*/
function trim(str) {
return str.replace(/(^\s*)|(\s*$)/g, "");
}
export default {
validateCode,
validateEmail,
validateEng,
validatePhone,
validateChinese,
validatePostCode,
validateNum,
validateNumDot,
validateZYS,
validateOrganization,
validateFax,
validateHome,
validateXXMC,
validateXf,
validateOneNum,
validateMaxNumber,
validateTwoNum,
validateTwoNumThree,
validateThreeNum,
validateInteger,
validateNF,
validateXQ,
validateroundNumber,
validateEngName,
validateCard,
validateHanset,
validateFamilyPhone,
validateName,
validateChargeperson,
validateCarNumber
}

269
src/components/item/slectItemList.vue

@ -1,269 +0,0 @@
<template>
<!-- 选择备件 -->
<u-popup v-model="props.isShowSelectItem" mode="center" border-radius="14">
<view class="popup-title">选择备件</view>
<view class="popup">
<!-- <input v-model="searchKeyword" @input="filterItems" placeholder="搜索备件名称"> -->
<u-search placeholder="搜索" v-model="form1.searchName" @change="searchItem" clearabled=false></u-search>
<!-- <u-input v-model="form1.searchName" placeholder="请输入备件名称" @change="searchItem"/>
<u-button>搜索</u-button> -->
<view class="list">
<view class="item" v-for="(item,index) in singleColumnList" :key="index" @click="chooseItem(item)">
<u-checkbox v-model="item.checked" shape="circle" style="margin-top: 8rpx;"></u-checkbox>
<view class="right">
<view class="item-name">
备件名称:<span>{{item.name}}</span>
</view>
<view class="item-dec">
备件编码:<span>{{item.number}}</span>
</view>
</view>
</view>
</view>
</view>
<view class="popup-footer">
<view @click="chooseItem1(0)">取消</view>
<view class="sure" @click="chooseItem1(1)">确认</view>
</view>
</u-popup>
</template>
<script setup lang="ts">
import {
ref,
defineProps,
defineEmits,
getCurrentInstance,
watch
} from 'vue'
import {
onLoad,
} from '@dcloudio/uni-app'
import * as repairOrderApi from "@/api/repairOrder"
const props = defineProps({
isShowSelectItem: {
type: Boolean,
default: () => { return false },
require: true
},
singleColumnList:{
type: Array,
default: () => { return [] },
require: false
},
});
// isShowSelectItem
watch(() => props.isShowSelectItem, (newValue, oldValue) => {
if(newValue){
console.log('props.isShowSelectItem',props.isShowSelectItem);
form1.value.searchName = null
form1.value.temporarilyNumber = null
form1.value.temporarilyName = null
}
});
const { proxy } = getCurrentInstance()
const repairOrderList = ref([])
const itemList = ref([])
const type = ref('')
const isShowSelectItem = ref(false);
const selectVal = ref(null);
const emits = defineEmits(['searchItem','chooseItem1']);
const form1 = ref({
number: "",
name:"",
qty: 0,
temporarilyNumber:"",//
temporarilyName:"",//
searchName:"",//
})
onLoad((option) => {
if (option.type) type.value = option.type;
if (option.type) isShowSelectItem.value = option.isShowSelectItem;//
if (option.selectVal) selectVal.value = option.selectVal;//
})
//
function chooseItem1(type){
if(type==1){
form1.value.number = form1.value.temporarilyNumber
form1.value.name = form1.value.temporarilyName
}
emits('chooseItem1',type,form1);
}
function searchItem(){
emits('searchItem',form1.value.searchName);
}
function chooseItem(item){
console.log('props.isShowSelectItem',props.isShowSelectItem);
console.log('props.singleColumnList',props.singleColumnList);
let arr = props.singleColumnList.filter(cur=>cur.number != item.number)
arr.forEach(item=>{
item.checked = false
})
item.checked = !item.checked
let arr1 = props.singleColumnList.filter(cur=>cur.number == item.number)
form1.value.temporarilyNumber = arr1[0].number;
form1.value.temporarilyName = arr1[0].name;
}
</script>
<style lang="scss" scoped>
.add-form-container {
min-height: calc(100vh - 140rpx);
background: white;
padding: 0px 30rpx 140rpx;
}
.footer {
position: fixed;
bottom: 0px;
left: 0px;
width: 100%;
z-index: 22;
}
.btns {
display: flex;
button {
flex: 1;
}
.sure {
background: #409eff;
color: white;
border-radius: 0px;
&::after {
border: 1px solid #409eff;
border-radius: 0px;
}
}
.reset {
background: #F5F5F5;
border-radius: 0px;
&::after {
border-radius: 0px;
}
}
}
.right-button {
background: #409eff;
color: white;
padding: 0rpx 30rpx;
border-radius: 16rpx;
text-align: center;
font-size: 28rpx;
}
.select {
display: flex;
align-items: center;
height: 72rpx;
width: 100%;
.input {
flex: 1;
font-size: 28rpx;
color: #000000;
}
.placeholder {
flex: 1;
font-size: 28rpx;
color: rgb(192, 196, 204);
}
}
.title {
padding: 32rpx 0px;
position: relative;
span {
position: absolute;
left: -16rpx;
color: #fa3534;
padding-top: 6rpx;
}
}
.list {
.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;
}
}
}
.add-btn {
display: flex;
justify-content: flex-start;
align-items: center;
}
.popup-title {
text-align: center;
font-size: 32rpx;
font-weight: bold;
color: #409eff;
padding: 30rpx 30rpx 0px
}
.popup {
width: 600rpx;
padding: 30rpx 60rpx 30rpx;
}
.popup-footer {
display: flex;
border-top: 1px solid #e4e4e4;
view {
line-height: 100rpx;
flex: 1;
text-align: center;
&.sure {
color: #409eff;
}
}
}
::v-deep .u-checkbox-group {
display: grid !important;
}
</style>

299
src/components/my-paging/my-paging.vue

@ -1,157 +1,160 @@
<!-- 基于z-paging封装个性化分页组件演示可减少大量重复代码 -->
<template>
<!-- 这边统一设置z-paging在页面中使用时就不用重复写 -->
<!-- 如果要在这里设置极简写法这里的ref不能设置为paging设置为其他名即可因为极简写法会修改/调用第一个包含了ref="paging"的付view中的list和query -->
<!-- 极简写法在下方设置autowire-list-name="xxx" autowire-query-name="xxx"即可与minimalism-demo.vue中的一致并且不用再从这个组件转发到页面只要遵循上一行的规则即可 -->
<z-paging ref="paging" v-model="list" fixed auto-show-back-to-top refresher-threshold="160rpx" @query="queryList"
:useVirtualList="useVirtualList" :useInnerList="useInnerList" :cellKeyName="cellKeyName" :innerListStyle="innerListStyle" :preloadPage="preloadPage" :cellHeightMode="cellHeightMode" :virtualScrollFps="virtualScrollFps"
:loading-more-loading-text="{'en':'英文的加载中','zh-cn':'中文的加载中','zh-hant-cn':'繁体的加载中'}">
<!-- 这里插入一个view到z-paging中并且这个view会被z-paging标记为top固定在顶部 -->
<template #top>
<!-- 这里接收页面传进来的slot这样相当于将页面传进来的slot传给z-paging的slot="top" -->
<slot name="top" />
</template>
<!-- 这里插入一个view到z-paging中并且这个view会被z-paging标记为bottom固定在顶部 -->
<!-- vue3中用v-slot:bottom -->
<template #bottom>
<!-- 这里接收页面传进来的slot这样相当于将页面传进来的slot传给z-paging的slot="bottom" -->
<slot name="bottom" />
</template>
<template #empty v-if="$slots.empty" >
<!-- 这里接收页面传进来的slot这样相当于将页面传进来的slot传给z-paging的slot="empty" -->
<slot name="empty" />
</template>
<!-- 这个是插入虚拟列表/内置列表的cell -->
<template #cell="{item,index}">
<slot name="cell" :item="item" :index="index"/>
</template>
<!-- 这边统一设置z-paging在页面中使用时就不用重复写 -->
<!-- 如果要在这里设置极简写法这里的ref不能设置为paging设置为其他名即可因为极简写法会修改/调用第一个包含了ref="paging"的付view中的list和query -->
<!-- 极简写法在下方设置autowire-list-name="xxx" autowire-query-name="xxx"即可与minimalism-demo.vue中的一致并且不用再从这个组件转发到页面只要遵循上一行的规则即可 -->
<z-paging ref="paging" v-model="list" fixed auto-show-back-to-top refresher-threshold="160rpx" @query="queryList" :useVirtualList="useVirtualList" :useInnerList="useInnerList" :cellKeyName="cellKeyName" :innerListStyle="innerListStyle" :preloadPage="preloadPage" :cellHeightMode="cellHeightMode" :virtualScrollFps="virtualScrollFps" :loading-more-loading-text="{ en: '英文的加载中', 'zh-cn': '中文的加载中', 'zh-hant-cn': '繁体的加载中' }">
<!-- 这里插入一个view到z-paging中并且这个view会被z-paging标记为top固定在顶部 -->
<template #top>
<!-- 这里接收页面传进来的slot这样相当于将页面传进来的slot传给z-paging的slot="top" -->
<slot name="top" />
</template>
<!-- 这里通过slot统一自定义了下拉刷新view和没有更多数据view页面那边就不用再写下面两行了 -->
<!-- 自定义下拉刷新view(如果use-custom-refresher为true且不设置下面的slot="refresher"此时不用获取refresherStatus会自动使用z-paging自带的下拉刷新view) -->
<template #refresher="{refresherStatus}">
<!-- <custom-refresher :status="refresherStatus" /> -->
</template>
<!-- 自定义没有更多数据view -->
<template #loadingMoreNoMore>
<!-- <custom-nomore></custom-nomore> -->
<uni-load-more status="normore" />
</template>
<!-- 这里插入一个view到z-paging中并且这个view会被z-paging标记为bottom固定在顶部 -->
<!-- vue3中用v-slot:bottom -->
<template #bottom>
<!-- 这里接收页面传进来的slot这样相当于将页面传进来的slot传给z-paging的slot="bottom" -->
<slot name="bottom" />
</template>
<!-- 这里接收页面传进来的普通slot如列表数据等 -->
<slot />
</z-paging>
<template #empty v-if="$slots.empty">
<!-- 这里接收页面传进来的slot这样相当于将页面传进来的slot传给z-paging的slot="empty" -->
<slot name="empty" />
</template>
<!-- 这个是插入虚拟列表/内置列表的cell -->
<template #cell="{ item, index }">
<slot name="cell" :item="item" :index="index" />
</template>
<!-- 这里通过slot统一自定义了下拉刷新view和没有更多数据view页面那边就不用再写下面两行了 -->
<!-- 自定义下拉刷新view(如果use-custom-refresher为true且不设置下面的slot="refresher"此时不用获取refresherStatus会自动使用z-paging自带的下拉刷新view) -->
<template #refresher="{ refresherStatus }">
<!-- <custom-refresher :status="refresherStatus" /> -->
</template>
<!-- 自定义没有更多数据view -->
<template #loadingMoreNoMore>
<!-- <custom-nomore></custom-nomore> -->
<u-loadmore status="normore" />
</template>
<!-- 这里接收页面传进来的普通slot如列表数据等 -->
<slot />
</z-paging>
</template>
<script>
export default {
name: "my-paging",
data() {
return {
list: []
};
},
props: {
//v-modellist
value: {
type: Array,
default: function() {
return [];
}
},
//使
useVirtualList: {
type: Boolean,
default: false
},
//z-paging()use-virtual-listtruetrue
useInnerList: {
type: Boolean,
default: false
},
//cellkeynvuenvueuse-inner-list
cellKeyName: {
type: String,
default: ''
},
//innerList
innerListStyle: {
type: Object,
default: function() {
return {};
}
},
//()127celldom()
preloadPage: {
type: [Number, String],
default: 12
},
//cellfixedcellcelldynamicdynamicfixed
cellHeightMode: {
type: String,
default: 'fixed'
},
//scroll60
virtualScrollFps: {
type: [Number, String],
default: 60
},
},
watch: {
//v-modez-paging
value(newVal) {
this.list = newVal;
},
// #ifdef VUE3
modelValue(newVal) {
this.list = newVal;
},
// #endif
//z-paging
list(newVal) {
//emit inputv-model
this.$emit('input', newVal);
// #ifdef VUE3
this.$emit('update:modelValue', newVal);
// #endif
}
},
methods: {
//z-paging@queryemit
queryList(pageNo, pageSize) {
console.log("queryList",pageNo)
// this.$emit('query', pageNo, pageSize);
},
//reloadz-paging
reload(data) {
this.$refs.paging.reload(data);
},
//completez-paging
complete(data) {
this.$refs.paging.complete(data);
},
/*
//使mixins使
//updatePageScrollTopz-paging
updatePageScrollTop(data){
this.$refs.paging.updatePageScrollTop(data);
},
//pageReachBottomz-paging
pageReachBottom(){
this.$refs.paging.pageReachBottom();
},
//doChatRecordLoadMorez-paging
doChatRecordLoadMore() {
this.$refs.paging.doChatRecordLoadMore();
}
*/
}
<script setup lang="ts">
import { ref, getCurrentInstance, nextTick, onMounted, watch } from 'vue'
import { onLoad, onShow, onNavigationBarButtonTap, onReady, onBackPress, onReachBottom, onPullDownRefresh } from '@dcloudio/uni-app'
const props = defineProps({
value: {
type: Array,
default() {
return []
}
},
// 使
useVirtualList: {
type: Boolean,
default: false
},
// z-paging()use-virtual-listtruetrue
useInnerList: {
type: Boolean,
default: false
},
// cellkeynvuenvueuse-inner-list
cellKeyName: {
type: String,
default: ''
},
// innerList
innerListStyle: {
type: Object,
default() {
return {}
}
},
// ()127celldom()
preloadPage: {
type: [Number, String],
default: 12
},
// cellfixedcellcelldynamicdynamicfixed
cellHeightMode: {
type: String,
default: 'fixed'
},
// scroll60
virtualScrollFps: {
type: [Number, String],
default: 60
}
})
const list = ref([])
const paging = ref()
// v-modez-paging
watch(
() => props.value,
(newVal) => {
list.value = newVal
}
)
// #ifdef VUE3
watch(
() => props.modelValue,
(newVal) => {
list.value = newVal
}
)
// #endif
watch(
() => list.value,
(newVal) => {
// emit inputv-model
emit('input', newVal)
// #ifdef VUE3
emit('update:modelValue', newVal)
// #endif
}
)
// z-paging@queryemit
const queryList = (pageNo, pageSize) => {
console.log('queryList', pageNo)
// this.$emit('query', pageNo, pageSize);
}
// reloadz-paging
const reload = (data) => {
paging.value.reload(data)
}
// completez-paging
const complete = (data) => {
console.log(data)
paging.value.complete(data)
}
/*
//使mixins使
//updatePageScrollTopz-paging
updatePageScrollTop(data){
this.$refs.paging.updatePageScrollTop(data);
},
//pageReachBottomz-paging
pageReachBottom(){
this.$refs.paging.pageReachBottom();
},
//doChatRecordLoadMorez-paging
doChatRecordLoadMore() {
this.$refs.paging.doChatRecordLoadMore();
}
*/
//
const emit = defineEmits(['input', 'update:modelValue'])
defineExpose({
reload,
complete
})
</script>
<style>
</style>
<style></style>

85
src/components/search/index.vue

@ -1,85 +0,0 @@
<template>
<view class="content">
<view class="screen-input">
<u-search
v-model='keyWord'
:show-action='false'
:bg-color="searchData.bgBolor ||'white'"
:border-color="searchData.borderColor ||'#E4E4E4'"
:shape="searchData.shape ||'square'"
:height="searchData.height || 80"
:placeholder="searchData.placeholder ||'请输入设备名称'"
:clearabled="true"
@search='search'
@clear='clear'
>
</u-search>
</view>
<view class="screen-btn" @click="screen" v-if="isShowScreen">
<image src="../../static/icons/screen.png" mode="widthFix"></image>
<view>筛选</view>
</view>
</view>
</template>
<script>
export default {
props: {
searchData:{
type: Object,
default:()=>{return {}},
require:false
},
isShowScreen: {
type: Boolean,
default:()=>{return true},
require:false
},
},
data() {
return {
keyWord: '',
}
},
methods: {
//
search() {
this.$emit('search', this.keyWord)
},
//
clear() {
this.$emit('search', '')
},
//
screen() {
this.$emit('screen')
}
}
}
</script>
<style lang="scss" scoped>
.content {
padding: 20rpx;
display: flex;
align-items: center;
background: white;
.screen-input {
flex: 1;
width: 0px;
}
.screen-btn {
display: flex;
align-items: center;
margin-left:20rpx;
image {
width: 30rpx;
margin-right: 6rpx;
}
}
}
</style>

885
src/components/show-modal/show-modal.vue

@ -1,456 +1,443 @@
<template name="show-modal">
<view>
<u-modal v-model="show" :title-style="{color: 'red'}" :title="title" :showTitle="false"
:showConfirmButton="false" ref="modal">
<view class="slot-content">
<slot name="icon">
<image class="icon" :src="icon" />
</slot>
<scroll-view scroll-y="true" style="max-height: 200px;">
<rich-text class="content" :nodes="content">
</rich-text>
</scroll-view>
<u-line></u-line>
<slot name="button">
<view class="uni-flex uni-row u-col-center space-between" style="width: 100%;height: 48px;">
<view v-if="showCancelButton" class="cance_button" @tap="$u.throttle(cancelClose, 500)">
<text :style="{'color':cancelColor}">{{ cancelText }}</text>
</view>
<u-line direction="col" length="100%"></u-line>
<view v-if="showConfirmButton" class="confirm_button" @tap="$u.throttle(confirmClose, 500)">
<text :style="{'color':confirmColor}">{{confirmText}}</text>
<text v-if="showConfirmCountdown">({{seconds}}s关闭)</text>
</view>
</view>
</slot>
</view>
</u-modal>
</view>
<view>
<u-modal v-model="show" :title-style="{ color: 'red' }" :title="title" :showTitle="false" :showConfirmButton="false" ref="modal">
<view class="slot-content">
<slot name="icon">
<image class="icon" :src="icon" />
</slot>
<scroll-view scroll-y="true" style="max-height: 200px">
<rich-text class="content" :nodes="content"> </rich-text>
</scroll-view>
<view class="split_line"></view>
<slot name="button">
<view class="uni-flex uni-row u-col-center space-between" style="width: 100%; height: 48px">
<view v-if="showCancelButton" class="cance_button" @tap="$u.throttle(cancelClose, 500)">
<text :style="{ color: cancelColor }">{{ cancelText }}</text>
</view>
<u-line direction="col" length="100%"></u-line>
<view v-if="showConfirmButton" class="confirm_button" @tap="$u.throttle(confirmClose, 500)">
<text :style="{ color: confirmColor }">{{ confirmText }}</text>
<text v-if="showConfirmCountdown">({{ seconds }}s关闭)</text>
</view>
</view>
</slot>
</view>
</u-modal>
</view>
</template>
<script>
/**
* modal 模态框
* @description 弹出模态框常用于消息提示消息确认在当前页面内完成特定的交互操作
* */
export default {
data() {
return {
timer: null,
show: false, //
iconType: '消息',
icon: '../../static/icons/error-circle.svg',
title: '', //
content: '', //
cancelText: '取消', //
confirmText: '确定', //
showCancel: true, // true
confirmColor: '#007aff', //
cancelColor: null, //
showConfirmButton: true, //
showConfirmCountdown: true, //
showCancelButton: true, //
showClose: false,
confirm: false, // true
cancel: false, // true
seconds: 0,
success: () => {} //
}
},
methods: {
open() {
this.show = true;
},
close() {
this.$.refs.modal.popupClose();
},
confirmClose() {
if (this.show) {
this.show = false;
clearInterval(this.timer) //timer
this.$.refs.modal.popupClose();
this.success({
// cancel: false,
confirm: true,
});
}
},
cancelClose() {
clearInterval(this.timer) //timer
this.$.refs.modal.popupClose();
this.success({
// cancel: true,
confirm: false,
});
},
// (
showConfirmMessageModal(mContent, callback) {
this.showConfirmModal("消息", mContent, callback);
},
// (
showConfirmSuccessModal(mContent, callback) {
this.showConfirmModal("成功", mContent, callback);
},
// (
showConfirmFailModal(mContent, callback) {
this.showConfirmModal("失败", mContent, callback);
},
// (
showConfirmWarningModal(mContent, callback) {
this.showConfirmModal("警告", mContent, callback);
},
// (
showConfirmQuestionModal(mContent, callback) {
this.showConfirmModal("疑问", mContent, callback);
},
// (
showConfirmModal(mIconType, mContent, callback) {
this.showModal({
iconType: mIconType,
content: mContent,
showCancelButton: false,
success: function(res) {
if (callback != undefined) {
if (res.confirm == true) {
callback(true);
console.log('用户点击确定')
} else {
callback(false);
console.log('用户点击取消')
}
}
}
});
},
// (+
showSelectMessageModal(mContent, callback) {
this.showSelectModal("消息", mContent, callback);
},
// (+
showSelectSuccessModal(mContent, callback) {
this.showSelectModal("成功", mContent, callback);
},
// (+
showSelectFailModal(mContent, callback) {
this.showSelectModal("失败", mContent, callback);
},
// (+
showSelectWarningModal(mContent, callback) {
this.showSelectModal("警告", mContent, callback);
},
// (+
showSelectQuestionModal(mContent, callback) {
this.showSelectModal("疑问", mContent, callback);
},
// (+
showSelectModal(mIconType, mContent, callback) {
this.showModal({
iconType: mIconType,
content: mContent,
success: function(res) {
if (callback != undefined) {
if (res.confirm == true) {
callback(true);
console.log('用户点击确定')
} else {
callback(false);
console.log('用户点击取消')
}
}
}
});
},
// (+)
showConfirmCountdownMessageModal(mContent, callback) {
this.showConfirmCountdownModal("消息", mContent, callback);
},
// (+)
showConfirmCountdownSuccessModal(mContent, callback) {
this.showConfirmCountdownModal("成功", mContent, callback);
},
// (+)
showConfirmCountdownFailModal(mContent, callback) {
this.showConfirmCountdownModal("失败", mContent, callback);
},
// (+)
showConfirmCountdownWarningModal(mContent, callback) {
this.showConfirmCountdownModal("警告", mContent, callback);
},
// (+)
showConfirmCountdownQuestionModal(mContent, callback) {
this.showConfirmCountdownModal("疑问", mContent, callback);
},
// (+)
showConfirmCountdownModal(mIconType, mContent, callback) {
this.showModal({
iconType: mIconType,
content: mContent,
showCancelButton: false,
showConfirmCountdown: true,
success: function(res) {
if (callback != undefined) {
if (res.confirm == true) {
callback(true);
console.log('用户点击确定')
} else {
callback(false);
console.log('用户点击取消')
}
}
}
});
},
// (++)
showSelectCountdownMessageModal(mContent, callback) {
this.showSelectCountdownModal("消息", mContent, callback);
},
// (++)
showSelectCountdownSuccessModal(mContent, callback) {
this.showSelectCountdownModal("成功", mContent, callback);
},
// (++)
showSelectCountdownFailModal(mContent, callback) {
this.showSelectCountdownModal("失败", mContent, callback);
},
// (++)
showSelectCountdownWarningModal(mContent, callback) {
this.showSelectCountdownModal("警告", mContent, callback);
},
// (++)
showSelectCountdownQuestionModal(mContent, callback) {
this.showSelectCountdownModal("疑问", mContent, callback);
},
// (++)
showSelectCountdownModal(mIconType, mContent, callback) {
this.showModal({
iconType: mIconType,
content: mContent,
showConfirmCountdown: true,
success: function(res) {
if (callback != undefined) {
if (res.confirm == true) {
callback(true);
console.log('用户点击确定')
} else {
callback(false);
console.log('用户点击取消')
}
}
}
});
},
//
showModal(data) {
if (data.iconType) {
this.iconType = data.iconType
switch (data.iconType) {
case '消息':
this.icon = '/static/icons/error-circle.svg';
break;
case '成功':
this.icon = '/static/icons/checkmark-circle.svg';
break;
case '失败':
this.icon = '/static/icons/close-circle.svg';
break;
case '警告':
this.icon = '/static/icons/warning.svg';
break;
case '疑问':
this.icon = '/static/icons/question-circle.svg';
break;
default:
break;
}
}
// image
if (data.title) {
this.title = data.title
}
if (data.content) {
console.log(data.content);
this.content = data.content;
} else {
this.content = ''
}
if (data.cancelText) {
this.cancelText = data.cancelText
} else {
this.cancelText = '取消'
}
if (data.confirmText) {
this.confirmText = data.confirmText
} else {
this.confirmText = '确定'
}
if (data.showCancel === false || data.showCancel === true) {
this.showCancel = data.showCancel
} else {
this.showCancel = true
}
if (data.confirmColor) {
this.confirmColor = data.confirmColor
} else {
this.confirmColor = '#007aff'
}
if (data.cancelColor) {
this.cancelColor = data.cancelColor
} else {
this.cancelColor = '#666F83'
}
if (data.showConfirmButton === false || data.showConfirmButton === true) {
this.showConfirmButton = data.showConfirmButton
} else {
this.showConfirmButton = true
}
if (data.showConfirmCountdown === false || data.showConfirmCountdown === true) {
this.showConfirmCountdown = data.showConfirmCountdown
} else {
this.showConfirmCountdown = false
}
if (data.showCancelButton === false || data.showCancelButton === true) {
this.showCancelButton = data.showCancelButton
} else {
this.showCancelButton = true
}
if (data.success) {
this.success = data.success
} else {
this.success = () => {}
}
setTimeout(res => {
this.show = true;
}, 500)
if (this.showConfirmCountdown) {
this.startTimer();
}
},
startTimer() {
this.seconds = 3;
clearInterval(this.timer)
this.timer = setInterval(() => {
this.seconds--
// console.log("", this.seconds);
if (this.seconds <= 0) {
this.timeUp()
return
}
}, 1000)
},
timeUp() {
// clearInterval(this.timer)
console.log('时间到')
this.confirmClose();
},
},
}
/**
* modal 模态框
* @description 弹出模态框常用于消息提示消息确认在当前页面内完成特定的交互操作
* */
export default {
data() {
return {
timer: null,
show: false, //
iconType: '消息',
icon: '../../static/icons/error-circle.svg',
title: '', //
content: '', //
cancelText: '取消', //
confirmText: '确定', //
showCancel: true, // true
confirmColor: '#007aff', //
cancelColor: null, //
showConfirmButton: true, //
showConfirmCountdown: true, //
showCancelButton: true, //
showClose: false,
confirm: false, // true
cancel: false, // true
seconds: 0,
success: () => {} //
}
},
methods: {
open() {
this.show = true
},
close() {
this.$.refs.modal.popupClose()
},
confirmClose() {
if (this.show) {
this.show = false
clearInterval(this.timer) // timer
this.success({
// cancel: false,
confirm: true
})
}
},
cancelClose() {
clearInterval(this.timer) // timer
if(this.$refs.modal){
this.$refs.modal.popupClose();
}
this.success({
// cancel: true,
confirm: false
})
},
// (
showConfirmMessageModal(mContent, callback) {
this.showConfirmModal('消息', mContent, callback)
},
// (
showConfirmSuccessModal(mContent, callback) {
this.showConfirmModal('成功', mContent, callback)
},
// (
showConfirmFailModal(mContent, callback) {
this.showConfirmModal('失败', mContent, callback)
},
// (
showConfirmWarningModal(mContent, callback) {
this.showConfirmModal('警告', mContent, callback)
},
// (
showConfirmQuestionModal(mContent, callback) {
this.showConfirmModal('疑问', mContent, callback)
},
// (
showConfirmModal(mIconType, mContent, callback) {
this.showModal({
iconType: mIconType,
content: mContent,
showCancelButton: false,
success(res) {
if (callback != undefined) {
if (res.confirm == true) {
callback(true)
console.log('用户点击确定')
} else {
callback(false)
console.log('用户点击取消')
}
}
}
})
},
// (+
showSelectMessageModal(mContent, callback) {
this.showSelectModal('消息', mContent, callback)
},
// (+
showSelectSuccessModal(mContent, callback) {
this.showSelectModal('成功', mContent, callback)
},
// (+
showSelectFailModal(mContent, callback) {
this.showSelectModal('失败', mContent, callback)
},
// (+
showSelectWarningModal(mContent, callback) {
this.showSelectModal('警告', mContent, callback)
},
// (+
showSelectQuestionModal(mContent, callback) {
this.showSelectModal('疑问', mContent, callback)
},
// (+
showSelectModal(mIconType, mContent, callback) {
this.showModal({
iconType: mIconType,
content: mContent,
success(res) {
if (callback != undefined) {
if (res.confirm == true) {
callback(true)
console.log('用户点击确定')
} else {
callback(false)
console.log('用户点击取消')
}
}
}
})
},
// (+)
showConfirmCountdownMessageModal(mContent, callback) {
this.showConfirmCountdownModal('消息', mContent, callback)
},
// (+)
showConfirmCountdownSuccessModal(mContent, callback) {
this.showConfirmCountdownModal('成功', mContent, callback)
},
// (+)
showConfirmCountdownFailModal(mContent, callback) {
this.showConfirmCountdownModal('失败', mContent, callback)
},
// (+)
showConfirmCountdownWarningModal(mContent, callback) {
this.showConfirmCountdownModal('警告', mContent, callback)
},
// (+)
showConfirmCountdownQuestionModal(mContent, callback) {
this.showConfirmCountdownModal('疑问', mContent, callback)
},
// (+)
showConfirmCountdownModal(mIconType, mContent, callback) {
this.showModal({
iconType: mIconType,
content: mContent,
showCancelButton: false,
showConfirmCountdown: true,
success(res) {
if (callback != undefined) {
if (res.confirm == true) {
callback(true)
console.log('用户点击确定')
} else {
callback(false)
console.log('用户点击取消')
}
}
}
})
},
// (++)
showSelectCountdownMessageModal(mContent, callback) {
this.showSelectCountdownModal('消息', mContent, callback)
},
// (++)
showSelectCountdownSuccessModal(mContent, callback) {
this.showSelectCountdownModal('成功', mContent, callback)
},
// (++)
showSelectCountdownFailModal(mContent, callback) {
this.showSelectCountdownModal('失败', mContent, callback)
},
// (++)
showSelectCountdownWarningModal(mContent, callback) {
this.showSelectCountdownModal('警告', mContent, callback)
},
// (++)
showSelectCountdownQuestionModal(mContent, callback) {
this.showSelectCountdownModal('疑问', mContent, callback)
},
// (++)
showSelectCountdownModal(mIconType, mContent, callback) {
this.showModal({
iconType: mIconType,
content: mContent,
showConfirmCountdown: true,
success(res) {
if (callback != undefined) {
if (res.confirm == true) {
callback(true)
console.log('用户点击确定')
} else {
callback(false)
console.log('用户点击取消')
}
}
}
})
},
//
showModal(data) {
if (data.iconType) {
this.iconType = data.iconType
switch (data.iconType) {
case '消息':
this.icon = '/static/icons/error-circle.svg'
break
case '成功':
this.icon = '/static/icons/checkmark-circle.svg'
break
case '失败':
this.icon = '/static/icons/close-circle.svg'
break
case '警告':
this.icon = '/static/icons/warning.svg'
break
case '疑问':
this.icon = '/static/icons/question-circle.svg'
break
default:
break
}
}
// image
if (data.title) {
this.title = data.title
}
if (data.content) {
console.log(data.content)
this.content = data.content
} else {
this.content = ''
}
if (data.cancelText) {
this.cancelText = data.cancelText
} else {
this.cancelText = '取消'
}
if (data.confirmText) {
this.confirmText = data.confirmText
} else {
this.confirmText = '确定'
}
if (data.showCancel === false || data.showCancel === true) {
this.showCancel = data.showCancel
} else {
this.showCancel = true
}
if (data.confirmColor) {
this.confirmColor = data.confirmColor
} else {
this.confirmColor = '#007aff'
}
if (data.cancelColor) {
this.cancelColor = data.cancelColor
} else {
this.cancelColor = '#666F83'
}
if (data.showConfirmButton === false || data.showConfirmButton === true) {
this.showConfirmButton = data.showConfirmButton
} else {
this.showConfirmButton = true
}
if (data.showConfirmCountdown === false || data.showConfirmCountdown === true) {
this.showConfirmCountdown = data.showConfirmCountdown
} else {
this.showConfirmCountdown = false
}
if (data.showCancelButton === false || data.showCancelButton === true) {
this.showCancelButton = data.showCancelButton
} else {
this.showCancelButton = true
}
if (data.success) {
this.success = data.success
} else {
this.success = () => {}
}
setTimeout((res) => {
this.show = true
}, 500)
if (this.showConfirmCountdown) {
this.startTimer()
}
},
startTimer() {
this.seconds = 3
clearInterval(this.timer)
this.timer = setInterval(() => {
this.seconds--
// console.log("", this.seconds);
if (this.seconds <= 0) {
this.timeUp()
}
}, 1000)
},
timeUp() {
// clearInterval(this.timer)
console.log('时间到')
this.confirmClose()
}
}
}
</script>
<style lang="scss" scoped>
.slot-content {
font-size: 36rpx;
display: flex; //
flex-direction: column; //
align-items: center; //
// background-image: url()
}
.icon {
width: 70rpx;
height: 70rpx;
opacity: 1; //
margin-top: 16px;
}
.title {
font-size: 35rpx;
}
.content {
margin-top: 16px;
margin-bottom: 16px;
margin-left: 8px;
margin-right: 8px;
font-size: 32rpx;
text-align: center;
word-wrap: break-word;
word-break: break-all;
white-space: pre-line;
}
.cance_button {
width: 100%;
margin-top: 10px;
margin-bottom: 10px;
font-size: 32rpx;
display: flex;
justify-content: center;
align-items: center;
}
.confirm_button {
width: 100%;
margin-top: 10px;
margin-bottom: 10px;
font-size: 32rpx;
display: flex;
justify-content: center;
align-items: center;
}
.confirm_text {
// color: $uni-color-primary;
}
.def_text {
color: $uni-color-primary;
}
.slot-content {
font-size: 36rpx;
display: flex; //
flex-direction: column; //
align-items: center; //
// background-image: url()
}
.icon {
width: 70rpx;
height: 70rpx;
opacity: 1; //
margin-top: 16px;
}
.title {
font-size: 35rpx;
}
.content {
margin-top: 16px;
margin-bottom: 16px;
margin-left: 8px;
margin-right: 8px;
font-size: 32rpx;
text-align: center;
word-wrap: break-word;
word-break: break-all;
white-space: pre-line;
}
.cance_button {
width: 100%;
margin-top: 10px;
margin-bottom: 10px;
font-size: 32rpx;
display: flex;
justify-content: center;
align-items: center;
}
.confirm_button {
width: 100%;
margin-top: 10px;
margin-bottom: 10px;
font-size: 32rpx;
display: flex;
justify-content: center;
align-items: center;
}
.confirm_text {
// color: $uni-color-primary;
}
.def_text {
color: $uni-color-primary;
}
</style>

87
src/components/tags/index.vue

@ -1,87 +0,0 @@
<template>
<view class="container" v-for="item in data">
<u-tag key="{{item.value}}">{{ item.text }}</u-tag>
</view>
</template>
<script setup lang="ts">
/* 初始化 */
import { onShow } from '@dcloudio/uni-app'
import { getCurrentInstance, ref, defineExpose } from 'vue'
const { proxy } = getCurrentInstance()
const data = ref([])
defineExpose({ data })
</script>
<style scoped lang="scss">
.container {
background: #f5f5f5;
min-height: 100vh;
margin: 10rpx;
}
.list {
background: #f5f5f5;
margin-top: 20rpx;
.item {
padding: 30rpx 30rpx 0px 30rpx;
margin-top: 20rpx;
background: white;
position: relative;
.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;
display: flex;
align-items: center;
view {
&:nth-child(1) {
width: 160rpx;
}
&:nth-child(2) {
color: #999999;
flex: 1;
width: 0px;
word-wrap: break-word;
}
}
}
.last {
padding-bottom: 30rpx;
}
.bottom {
display: flex;
justify-content: space-between;
align-items: center;
border-top: 1px solid #e4e4e4;
padding: 20rpx 0px;
height: 90rpx;
}
}
}
</style>

469
src/components/verifition/Verify.vue

File diff suppressed because one or more lines are too long

14
src/components/verifition/utils/ase.js

@ -1,14 +0,0 @@
import CryptoJS from 'crypto-js'
/**
* @word 要加密的内容
* @keyWord String 服务器随机返回的关键字
* */
export function aesEncrypt(word, keyWord = "XwKsGlMcdPMEhR1B") {
var key = CryptoJS.enc.Utf8.parse(keyWord);
var srcs = CryptoJS.enc.Utf8.parse(word);
var encrypted = CryptoJS.AES.encrypt(srcs, key, {
mode: CryptoJS.mode.ECB,
padding: CryptoJS.pad.Pkcs7
});
return encrypted.toString();
}

17
src/components/verifition/utils/request.js

@ -1,17 +0,0 @@
import config from '@/config'
const baseUrl = config.baseUrl
export const myRequest = (option = {}) => {
return new Promise((reslove, reject) => {
uni.request({
url: baseUrl + option.url,
data: option.data,
method: option.method || "GET",
success: (result) => {
reslove(result)
},
fail: (error) => {
reject(error)
}
})
})
}

555
src/components/verifition/verifyPoint/verifyPoint.vue

File diff suppressed because one or more lines are too long

661
src/components/verifition/verifySlider/verifySlider.vue

File diff suppressed because one or more lines are too long

11
src/main.ts

@ -3,13 +3,14 @@ import * as Pinia from 'pinia'
// @ts-ignore
import uView from 'vk-uview-ui'
import App from './App.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import noclick from './common/noclick.js'
import tab from './plugins/tab'
import modal from './plugins/modal'
import time from './plugins/time'
import auth from './plugins/auth'
import storage from './plugins/storage'
// unocss
@ -31,7 +32,11 @@ export function createApp() {
app.config.globalProperties.$modal = modal
// 时间对象
app.config.globalProperties.$time = time
app.config.globalProperties.$auth = auth
// 节流
app.config.globalProperties.$throttle = noclick.throttle;
// 缓存
app.config.globalProperties.$storage = storage
app.component('ComMessage', comMessage)

37
src/manifest.json

@ -1,9 +1,10 @@
{
"name" : "富维汽车镜",
"package" : "uni.UNI43932FE",
"appid" : "__UNI__DA78BC9",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"versionName" : "1.0.44",
"versionCode" : 44,
"transformPx" : false,
/* 5+App */
"app-plus" : {
@ -47,6 +48,38 @@
/* SDK */
"sdkConfigs" : {
"ad" : {}
},
"nativePlugins" : {
"TestModule" : {
"__plugin_info__" : {
"name" : "TestModule",
"description" : "打印",
"platforms" : "Android",
"url" : "",
"android_package_name" : "",
"ios_bundle_id" : "",
"isCloud" : false,
"bought" : -1,
"pid" : "",
"parameters" : {}
}
}
}
},
"nativePlugins" : {
"TestModule" : {
"__plugin_info__" : {
"name" : "TestModule",
"description" : "打印",
"platforms" : "Android",
"url" : "",
"android_package_name" : "",
"ios_bundle_id" : "",
"isCloud" : false,
"bought" : -1,
"pid" : "",
"parameters" : {}
}
}
}
},

239
src/mycomponents/balance/balance.vue

@ -1,147 +1,110 @@
<template>
<view :class="dataContent.scaned?'scan_view':''" style="background-color: #ffffff;margin-bottom: 1px; ">
<view class="uni-flex uni-row space-between" style="align-items: center">
<view>
<pack v-if="isShowPack && dataContent.packingNumber" :packingCode="dataContent.packingNumber"></pack>
<batch v-if="isShowBatch && dataContent.batch" :batch="dataContent.batch"></batch>
<location title="来源库位" v-if="isShowFromLocation" :locationCode="dataContent.locationCode"></location>
<to-location title="目标库位" v-if="isShowToLocation" :locationCode="dataContent.toLocationCode">
</to-location>
</view>
<view>
<!-- <qty v-if="dataContent.record==null ||dataContent.record==undefined " :dataContent="dataContent"
<view :class="dataContent.scaned ? 'scan_view' : ''">
<view class="uni-flex uni-row space-between" style="align-items: center; padding: 20rpx">
<view>
<pack v-if="isShowParentPack && dataContent.parentNumber" title="父包装" :packingCode="dataContent.parentNumber"></pack>
<pack v-if="isShowPack && dataContent.packingNumber" :isShowPackingNumberProps="isShowPackingNumberProps" :packingCode="dataContent.packingNumber"></pack>
<batch v-if="isShowBatch && dataContent.batch" :batch="dataContent.batch"></batch>
<location title="来源库位" v-if="isShowFromLocation" :locationCode="dataContent.locationCode"></location>
<to-location title="目标库位" v-if="isShowToLocation" :locationCode="dataContent.toLocationCode"> </to-location>
</view>
<view class="uni-flex" style="flex-direction: column">
<view class="uni-flex uni-row u-align-start">
<!-- <qty v-if="dataContent.record==null ||dataContent.record==undefined " :dataContent="dataContent"
:isShowStdPack="isShowStdPack" :isShowStatus="isShowStatus"></qty> -->
<qty v-if="dataContent.handleQty==0 || dataContent.handleQty==undefined" :dataContent="dataContent"
:isShowStdPack="isShowStdPack" :isShowStatus="isShowStatus"></qty>
<compare-qty v-else :dataContent="dataContent" :recommendQty="Number( dataContent.qty)"
:handleQty="Number (dataContent.handleQty)" :isShowStdPack="isShowStdPack">
</compare-qty>
<!-- <view class="uni-flex uni-row" style="vertical-align:center" v-if="isDevlement()">
<text style="font-size: 30rpx;color: #2979ff; " @click="copy">复制采购</text>
<text style="font-size: 30rpx;color: #2979ff;" @click="copyPro">|制品</text>
</view> -->
</view>
</view>
<!-- <u-line></u-line> -->
</view>
</template>
<qty v-if="dataContent.handleQty == 0 || dataContent.handleQty == undefined" :dataContent="dataContent" :isShowStdPack="isShowStdPack" :isShowStatus="isShowStatus"></qty>
<compare-qty v-else :dataContent="dataContent" :recommendQty="Number(dataContent.qty)" :handleQty="Number(dataContent.handleQty)" :isShowStdPack="isShowStdPack" :isShowStatus="isShowStatus"> </compare-qty>
<script>
import pack from '@/mycomponents/balance/pack.vue'
import location from '@/mycomponents/balance/location.vue'
import toLocation from '@/mycomponents/balance/toLocation.vue'
import batch from '@/mycomponents/balance/batch.vue'
import qty from '@/mycomponents/qty/qty.vue'
import recommendQty from '@/mycomponents/qty/recommendQty.vue'//recommendQty
import compareQty from '@/mycomponents/qty/compareQty.vue'
// import config from '@/static/config.js'
<!-- <view class="uni-flex uni-row" style="vertical-align: center" v-if="isDevlement()">
<image style="width: 26rpx; height: 26rpx; margin-top: 40rpx" src="/static/icons/icon_copy.svg" alt="" @click="copy" />
</view> -->
</view>
<!-- <view class="" v-if="dataContent.inventoryStatus">
<move-status :fromInventoryStatus="dataContent.inventoryStatus"> </move-status>
</view> -->
</view>
</view>
<!-- <u-line></u-line> -->
</view>
</template>
export default {
components: {
pack,
location,
toLocation,
batch,
qty,
recommendQty,
compareQty,
},
<script setup lang="ts">
import pack from '@/mycomponents/balance/pack.vue'
import location from '@/mycomponents/balance/location.vue'
import toLocation from '@/mycomponents/balance/toLocation.vue'
import batch from '@/mycomponents/balance/batch.vue'
import qty from '@/mycomponents/qty/qty.vue'
import compareQty from '@/mycomponents/qty/compareQty.vue'
import config from '@/static/config.js'
import moveStatus from '@/mycomponents/balance/moveStatus.vue'
data() {
return {
const props = defineProps({
dataContent: {
type: Object,
default: {}
},
isShowPack: {
type: Boolean,
default: true
},
isShowBatch: {
type: Boolean,
default: true
},
isShowFromLocation: {
type: Boolean,
default: true
},
isShowStdPack: {
type: Boolean,
default: true
},
isShowStatus: {
type: Boolean,
default: true
},
isShowToLocation: {
type: Boolean,
default: false
},
isShowParentPack: {
type: Boolean,
default: true
},
isShowPackingNumberProps: {
type: Boolean,
default: false
}
})
const copy = () => {
// HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100
const content = `HPQ;V1.0;I${props.dataContent.itemCode};P${props.dataContent.packingNumber};B${props.dataContent.batch};Q${props.dataContent.qty}`
}
},
props: {
dataContent: {
type: Object,
default: {}
},
isShowPack: {
type: Boolean,
default: true
},
isShowBatch: {
type: Boolean,
default: true
},
isShowFromLocation: {
type: Boolean,
default: true
},
isShowStdPack: {
type: Boolean,
default: true
},
isShowStatus: {
type: Boolean,
default: true
},
isShowToLocation: {
type: Boolean,
default: false
},
},
watch: {
uni.setClipboardData({
data: content,
success: () => {
uni.showToast({
title: '复制采购标签成功'
})
}
})
}
const copyPro = () => {
// HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100
const content = `HMQ;V1.0;I${props.dataContent.itemCode};P${props.dataContent.packingNumber};B${props.dataContent.batch};Q${props.dataContent.qty}`
},
methods: {
copy() {
// HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100
var content = "HPQ;V1.0;I" + this.dataContent.itemCode + ";P" + this.dataContent.packingNumber + ";B" +
this.dataContent.batch + ";Q" + this.dataContent.qty
// #ifdef H5
this.$copyText(content).then(
res => {
uni.showToast({
title: '复制成功',
icon: 'none'
})
}
)
// #endif
// #ifndef H5
uni.setClipboardData({
data: content,
success: () => {
uni.showToast({
title: '复制采购标签成功'
})
}
})
// #endif
},
copyPro() {
// HPQ;V1.0;ICE115F11161AG;PP20230427000026;B20230427002;Q100
var content = "HMQ;V1.0;I" + this.dataContent.itemCode + ";P" + this.dataContent.packingNumber + ";B" +
this.dataContent.batch + ";Q" + this.dataContent.qty
// #ifdef H5
this.$copyText(content).then(
res => {
uni.showToast({
title: '复制成功',
icon: 'none'
})
}
)
// #endif
// #ifndef H5
uni.setClipboardData({
data: content,
success: () => {
uni.showToast({
title: '复制制品标签成功'
})
}
})
// #endif
},
// isDevlement() {
// return config.isDevelopment;
// }
}
}
uni.setClipboardData({
data: content,
success: () => {
uni.showToast({
title: '复制制品标签成功'
})
}
})
}
const isDevlement = () => {
return config.isDevelopment
}
</script>
<style>
</style>
<style></style>

2
src/mycomponents/balance/balanceDetailPopup.vue

@ -4,7 +4,7 @@
<!-- <com-item :dataContent="dataContent.package"></com-item>
<u-line></u-line>
<view class='split_line'></view>
<scroll-view style="height:320px ">
<view v-for="(item, index) in dataList" style="width: 100%;">
<view class="item">

2
src/mycomponents/balance/balanceMove.vue

@ -18,7 +18,7 @@
</view>
</view>
<u-line></u-line>
<view class='split_line'></view>
</view>
</template>

85
src/mycomponents/balance/balanceSelect.vue

@ -1,54 +1,49 @@
<!--发料任务卡片-->
<template>
<!-- <page-meta root-font-size="18px"></page-meta> -->
<uni-popup ref="popupItems" type="center">
<scroll-view scroll-y="true" style="background-color: #EEEEEE;height: 90vh;">
<item :dataContent="balanceItems[0]"></item>
<view class="popinpop count_shadow" style="width: 90vw;margin: 20rpx 20rpx 30rpx 20rpx;"
v-for="(item, index) in balanceItems" :key="item.id" @click="callback(item)">
<balance :dataContent="item"></balance>
</view>
</scroll-view>
</uni-popup>
<!-- <page-meta root-font-size="18px"></page-meta> -->
<u-popup v-model="show" mode="center">
<scroll-view scroll-y="true" style="background-color: #eeeeee; height: 90vh">
<item style="margin: 10rpx" :dataContent="balanceItems[0]"></item>
<view class="popinpop count_shadow" style="width: 90vw; margin: 20rpx 20rpx 30rpx 20rpx" v-for="(item, index) in balanceItems" :key="item.id" @click="callback(item)">
<balance :dataContent="item" :isShowStatus="false"></balance>
</view>
<view class="page-footer">
<view class="uni-flex space-between" style="width: 100%">
<!-- <view class=" uni-flex uni-row"> -->
<button class="btn_single_reject" hover-class="btn_commit_after" @click="close">关闭</button>
<!-- </view> -->
</view>
</view>
</scroll-view>
</u-popup>
</template>
<script>
import item from '@/mycomponents/item/item.vue'
import balance from '@/mycomponents/balance/balance.vue'
<script setup lang="ts">
import { ref, getCurrentInstance } from 'vue'
import item from '@/mycomponents/item/item.vue'
import balance from '@/mycomponents/balance/balance.vue'
export default {
name: "balanceSelect",
emits: ['onSelectItem'],
components: {
item,
balance
},
data() {
return {
balanceItems: [],
};
},
//
props: {
// datacontent: {
// type: Object,
// value: null
// }
},
methods: {
openPopup(items) {
this.balanceItems = items;
this.$refs['popupItems'].open("center");
},
const balanceItems = ref([])
const show = ref(false)
const openPopup = (items) => {
if (Array.isArray(items)) {
balanceItems.value = items
} else {
balanceItems.value = [items]
}
show.value = true
}
callback(item) {
this.$emit("onSelectItem", item);
this.$refs['popupItems'].close();
},
const callback = (item) => {
emit('onSelectItem', item)
show.value = false
}
}
}
const close = () => {
show.value = false
}
const emit = defineEmits(['onSelectItem'])
defineExpose({ openPopup })
</script>
<style scoped lang="scss">
</style>
<style scoped lang="scss"></style>

29
src/mycomponents/balance/batch.vue

@ -1,24 +1,19 @@
<template>
<view class="card_view ">
<text class="card_batch card_content ">批次</text>
<text class="card_content ">{{batch}}</text>
<view class="card_view">
<text class="card_batch">批次</text>
<text class="card_content">{{batch}}</text>
</view>
</template>
<script>
export default {
data() {
return {}
},
props: {
batch: {
type: String,
default: ""
}
},
}
<script setup lang="ts">
const props = defineProps({
batch: {
type: String,
default: ""
}
})
</script>
<style>
<style scoped>
</style>

51
src/mycomponents/balance/bussinessType.vue

@ -1,37 +1,26 @@
<template>
<view class="business_view">
<text class="card_business">{{businessTypeDesc(bussinessType)}}</text>
<text class="card_business_content">{{number}}</text>
</view>
<view class="card_view">
<text class="card_business">业务类型</text>
<text class="card_business_content">{{ businessTypeDesc(bussinessType) }}</text>
</view>
</template>
<script>
import {
getBusinessTypeDesc
} from '@/common/directory.js';
export default {
data() {
return {}
},
props: {
bussinessType: {
type: String,
default: ""
},
number: {
type: String,
default: ""
}
},
methods:{
businessTypeDesc(type){
return getBusinessTypeDesc(type)
}
}
<script setup lang="ts">
import { getBusinessTypeName } from '@/common/directory.js'
}
const props = defineProps({
bussinessType: {
type: String,
default: ''
},
number: {
type: String,
default: ''
}
})
const businessTypeDesc = (type) => {
return getBusinessTypeName(type)
}
</script>
<style>
</style>
<style></style>

125
src/mycomponents/balance/handleBalance.vue

@ -1,80 +1,59 @@
<template>
<view :class="detail.scaned?'scan_view':''" style="background-color: #ffffff;">
<view class="space_between center" >
<view style="word-break: break-all;width: 60%;">
<pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack>
<batch v-if="isShowBatch" :batch="detail.batch"></batch>
<location v-if="isShowLocation" :locationCode="detail.fromLocationCode"></location>
</view>
<view style="word-break: break-all;">
<recommend-qty v-if="detail.record==null || detail.record==undefined" :dataContent="detail"
:isShowStdPack="false"></recommend-qty>
<compare-qty v-else :dataContent="detail" :recommendQty="detail.qty" :handleQty="detail.record.qty"
:isShowStdPack="false">
</compare-qty>
</view>
</view>
</view>
<view :class="detail.scaned ? 'scan_view' : ''" style="background-color: #ffffff">
<view class="space_between center">
<view style="word-break: break-all; width: 60%">
<pack title="外包装" v-if="detail.parentPackingNumber" :packingCode="detail.parentPackingNumber"></pack>
<pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack>
<batch v-if="isShowBatch" :batch="detail.batch"></batch>
<location v-if="isShowLocation" :locationCode="detail.fromLocationCode"></location>
</view>
<view style="word-break: break-all">
<recommend-qty v-if="detail.record == null || detail.record == undefined" :dataContent="detail" :isShowStatus="isShowStatus" :isShowStdPack="true"></recommend-qty>
<compare-qty v-else :dataContent="detail" :recommendQty="detail.qty" :handleQty="detail.record.qty" :isShowStatus="isShowStatus" :isShowStdPack="true"> </compare-qty>
</view>
</view>
</view>
</template>
<script>
import pack from '@/mycomponents/balance/pack.vue'
import location from '@/mycomponents/balance/location.vue'
import batch from '@/mycomponents/balance/batch.vue'
import recommendQty from '@/mycomponents/qty/recommendQty.vue'
import compareQty from '@/mycomponents/qty/compareQty.vue'
export default {
components: {
pack,
location,
batch,
recommendQty,
compareQty
},
data() {
return {
}
},
props: {
detail: {
type: Object,
default: {}
},
isShowPack: {
type: Boolean,
default: true
},
isShowBatch: {
type: Boolean,
default: true
},
isShowLocation: {
type: Boolean,
default: true
},
},
watch: {
},
methods: {
}
}
<script setup lang="ts">
import pack from '@/mycomponents/balance/pack.vue'
import location from '@/mycomponents/balance/location.vue'
import batch from '@/mycomponents/balance/batch.vue'
import recommendQty from '@/mycomponents/qty/recommendQty.vue'
import compareQty from '@/mycomponents/qty/compareQty.vue'
const props = defineProps({
detail: {
type: Object,
default: {}
},
isShowPack: {
type: Boolean,
default: true
},
isShowBatch: {
type: Boolean,
default: true
},
isShowLocation: {
type: Boolean,
default: true
},
isShowStatus: {
type: Boolean,
default: true
}
})
</script>
<style>
.recommend {
position: absolute;
left: 25px;
top: 70px;
width: 10px;
height: 30px;
opacity: 1;
}
.recommend {
position: absolute;
left: 25px;
top: 70px;
width: 10px;
height: 30px;
opacity: 1;
}
</style>

42
src/mycomponents/balance/location.vue

@ -1,31 +1,23 @@
<template>
<view class="card_view ">
<text class="card_location card_content ">{{title}}</text>
<text class="card_content ">{{locationCode}}</text>
</view>
<view class="card_view">
<text class="card_location">{{ title }}</text>
<text class="card_big_content" style="font-size: 40rpx">{{ locationCode }}</text>
</view>
</template>
<script>
export default {
components: {
},
data() {
return {}
},
props: {
locationCode: {
type: String,
default: ''
},
title: {
type: String,
default: '库位'
},
},
}
<script setup lang="ts">
const props = defineProps({
locationCode: {
type: String,
default: ''
},
title: {
type: String,
default: '库位'
}
})
</script>
<style>
<style scoped>
</style>

55
src/mycomponents/balance/pack.vue

@ -1,34 +1,33 @@
<template>
<view class="card_view">
<text class="card_packing_code card_content ">箱码</text>
<text class="card_content ">{{packingCode}}</text>
</view>
<view class="card_view" v-if="ShowPackingNumber">
<text class="card_packing_code">{{ title }}</text>
<text class="card_content">{{ packingCode }}</text>
</view>
</template>
<script>
export default {
components: {
},
data() {
return {
}
},
props: {
packingCode: {
type: String,
default: ''
},
},
watch: {
},
methods: {
}
}
<script setup lang="ts">
import {getSwitchInfoByCode} from '@/common/basic.js';
import {onMounted} from "vue";
import {ref} from "vue";
const props = defineProps({
packingCode: {
type: String,
default: ''
},
title: {
type: String,
default: '包装'
}
})
const ShowPackingNumber = ref(true)
onMounted(()=>{
ShowPackingNumber.value = getSwitchInfoByCode('ShowPackingNumber')
})
</script>
<style>
<style lang="scss" scoped>
.card_packing_code {
padding: 0;
}
</style>

87
src/mycomponents/balance/productionLabel.vue

@ -1,59 +1,40 @@
<template>
<view :class="dataContent.scaned?'scan_view':''">
<balance :dataContent="dataContent" :isShowStdPack="false" :isShowPack="isShowPack"
:isShowFromLocation="isShowLocation"></balance>
<production-info :dataContent="packageContent"></production-info>
</view>
<view :class="dataContent.scaned ? 'scan_view' : ''">
<balance :dataContent="dataContent" :isShowStdPack="false" :isShowPack="isShowPack" :isShowFromLocation="isShowLocation"></balance>
<production-info :dataContent="packageContent"></production-info>
</view>
</template>
<script>
import balance from '@/mycomponents/balance/balance.vue'
import productionInfo from '@/mycomponents/production/productionInfo.vue'
export default {
components: {
balance,
productionInfo
},
data() {
return {
<script setup lang="ts">
import balance from '@/mycomponents/balance/balance.vue'
import productionInfo from '@/mycomponents/production/productionInfo.vue'
}
},
props: {
dataContent: {
type: Object,
default: {}
},
packageContent: {
type: Object,
default: {}
},
isShowPack: {
type: Boolean,
default: true
},
isShowBatch: {
type: Boolean,
default: true
},
isShowLocation: {
type: Boolean,
default: true
},
isShowStdPack: {
type: Boolean,
default: true
}
},
watch: {
},
methods: {
}
}
const props = defineProps({
dataContent: {
type: Object,
default: {}
},
packageContent: {
type: Object,
default: {}
},
isShowPack: {
type: Boolean,
default: true
},
isShowBatch: {
type: Boolean,
default: true
},
isShowLocation: {
type: Boolean,
default: true
},
isShowStdPack: {
type: Boolean,
default: true
}
})
</script>
<style>
</style>
<style></style>

127
src/mycomponents/balance/recommendBalance.vue

@ -1,85 +1,56 @@
<template>
<view :class="detail.scaned?'scan_view':''" style="background-color: #fff;">
<view class="uni-flex uni-row space-between center ">
<view class="uni-flex uni-row " style="width: 60%;margin-left: 30rpx;" >
<view style=" width: 25rpx;color: #32C1E8;">
推荐
</view>
<view style="word-break: break-all">
<pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack>
<batch v-if="isShowBatch" :batch="detail.batch"></batch>
<location v-if="isShowLocation" :locationCode="detail.fromLocationCode"></location>
</view>
</view>
<view style="word-break: break-all">
<recommend-qty v-if="detail.Records==null || detail.Records.length==0" :dataContent="detail"
:isShowStdPack="false" :isShowStatus="false"></recommend-qty>
<compare-qty v-else :dataContent="detail" :recommendQty="Number( detail.qty)"
:handleQty="Number(detail.handleQty)" :isShowStdPack="false" :isShowStatus="false">
</compare-qty>
</view>
</view>
</view>
<view :class="detail.scaned ? 'scan_view' : ''" style="background-color: #fff">
<view class="uni-flex uni-row space-between center">
<view class="uni-flex uni-row" style="width: 60%">
<view style="width: 20rpx; color: #1677ff; margin-right: 20rpx; font-size: 24rpx"> 推荐 </view>
<view style="word-break: break-all">
<pack v-if="isShowPack" :packingCode="detail.packingNumber"></pack>
<batch v-if="isShowBatch" :batch="detail.batch"></batch>
<location v-if="isShowLocation" :locationCode="detail.fromLocationCode"></location>
</view>
</view>
<view style="word-break: break-all">
<recommend-qty v-if="detail.Records == null || detail.Records.length == 0" :dataContent="detail" :isShowStdPack="false" :isShowStatus="false"></recommend-qty>
<compare-qty v-else :dataContent="detail" :recommendQty="Number(detail.qty)" :handleQty="Number(detail.handleQty)" :isShowStdPack="false" :isShowStatus="false"> </compare-qty>
</view>
</view>
</view>
</template>
<script>
import pack from '@/mycomponents/balance/pack.vue'
import location from '@/mycomponents/balance/location.vue'
import batch from '@/mycomponents/balance/batch.vue'
//
import recommendQty from '@/mycomponents/qty/recommendQty.vue'
import compareQty from '@/mycomponents/qty/compareQty.vue'
export default {
components: {
pack,
location,
batch,
recommendQty,
compareQty
},
data() {
return {
}
},
props: {
detail: {
type: Object,
default: {}
},
isShowPack: {
type: Boolean,
default: true
},
isShowBatch: {
type: Boolean,
default: true
},
isShowLocation: {
type: Boolean,
default: true
},
},
watch: {
},
methods: {
}
}
<script setup lang="ts">
import pack from '@/mycomponents/balance/pack.vue'
import location from '@/mycomponents/balance/location.vue'
import batch from '@/mycomponents/balance/batch.vue'
import recommendQty from '@/mycomponents/qty/recommendQty.vue'
import compareQty from '@/mycomponents/qty/compareQty.vue'
const props = defineProps({
detail: {
type: Object,
default: {}
},
isShowPack: {
type: Boolean,
default: true
},
isShowBatch: {
type: Boolean,
default: true
},
isShowLocation: {
type: Boolean,
default: true
}
})
</script>
<style>
.recommend {
position: absolute;
left: 25px;
top: 70px;
width: 10px;
height: 30px;
opacity: 1;
}
.recommend {
position: absolute;
left: 25px;
top: 70px;
width: 10px;
height: 30px;
opacity: 1;
}
</style>

42
src/mycomponents/balance/toLocation.vue

@ -1,31 +1,19 @@
<template>
<view class="card_view ">
<text class="card_to_location card_content ">{{title}}</text>
<text class="card_content ">{{locationCode}}</text>
</view>
<view class="card_view">
<text class="card_to_location">{{ title }}</text>
<text class="card_big_content">{{ locationCode }}</text>
</view>
</template>
<script>
export default {
components: {
},
data() {
return {}
},
props: {
locationCode: {
type: String,
default: ''
},
title: {
type: String,
default: '库位'
},
},
}
<script setup lang="ts">
const props = defineProps({
locationCode: {
type: String
},
title: {
type: String,
default: '库位'
}
})
</script>
<style>
</style>
<style></style>

74
src/mycomponents/button/requestButton.vue

@ -4,53 +4,43 @@
<image src="@/static/icons_ui/icon_add.svg"></image>
<view>{{btnName}}</view>
</view>
<!-- <movable-area>
<movable-view class="max" direction="all">扫描</movable-view>
</movable-area> -->
</view>
</template>
<script>
export default {
data() {
return {
x: 0,
y: 0,
old: {
x: 0,
y: 0
}
}
},
props: {
btnName: {
type: String,
default: '创建'
},
},
created() {
},
methods: {
goScan(content) {
this.$emit("goScan", '');
},
tap: function(e) {
this.x = this.old.x
this.y = this.old.y
this.$nextTick(function() {
this.x = 30
this.y = 30
})
},
onChange: function(e) {
this.old.x = e.detail.x
this.old.y = e.detail.y
}
<script setup lang="ts">
import {
ref,
nextTick
} from 'vue'
const props = defineProps({
btnName: {
type: String,
default: '创建'
},
})
const x = ref(0)
const y = ref(0)
const old= ref({
x: 0,
y: 0
})
const goScan=(content)=> {
emit("goScan", '');
}
const tap=(e) =>{
x.value = old.value.x
y.value = old.value.y
nextTick(function() {
x.value = 30
y.value = 30
})
}
const onChange=(e) =>{
old.value.x = e.detail.x
old.value.y = e.detail.y
}
//
const emit = defineEmits(['goScan'])
</script>
<style>

46
src/mycomponents/common/comBlankView.vue

@ -1,31 +1,25 @@
<template>
<view class="default_goscan">
<image class="img_goscan" src="@/static/icons_ui/default_blank.png"></image>
<button @click="goScan">
<image src="@/static/icons_ui/icon_add.svg"></image>
去扫描
</button>
</view>
<view class="default_goscan">
<image class="img_goscan" src="@/static/icons_ui/default_blank.png"></image>
<button @click="goScan">
<image src="@/static/icons_ui/icon_add.svg"></image>
{{ title }}
</button>
</view>
</template>
<script>
export default {
data() {
return {
}
},
created() {
},
methods: {
goScan(content) {
this.$emit("goScan", '');
}
}
}
<script setup lang="ts">
const props = defineProps({
title: {
type: String,
default: '去扫描'
}
})
const goScan = (content) => {
emit('goScan', '')
}
//
const emit = defineEmits(['goScan'])
</script>
<style>
</style>
<style></style>

29
src/mycomponents/common/comEmptyView.vue

@ -4,36 +4,11 @@
<view class="">
<image class="default_nodata" src="@/static/icons_ui/default_data.png"></image>
</view>
<!--
<view class="" style="display: flex;flex-direction: column;
align-items: center;">
<view class="" >
<image class="nodata" src="/static/icons_ui/default_data.png"></image>
</view>
<view style="font-size: 40rpx;color: #909193;">
暂无数据
</view>
</view> -->
</view>
</template>
<script>
export default {
data() {
return {
}
},
created() {
},
methods: {
}
}
<script setup lang="ts">
</script>

4
src/mycomponents/common/comListHint.vue

@ -39,14 +39,14 @@
</view> -->
</view>
<u-line></u-line>
<view class='split_line'></view>
<view class="" v-for="(item, index) in dataList">
<view class="item" v-if="(item.title!='worker')" v-show="(item.title!='date')">
<text class="item_title">{{item.title}} : </text>
<text class="text_wrap">{{item.content}} </text>
</view>
</view>
<u-line></u-line>
<view class='split_line'></view>
<view v-if="isShowbottom" style="margin-top: 10rpx;margin-bottom: 10rpx;width: 100%;display: flex;"
class="uni-flex uni-row space-between u-col-center">
<view class="uni-flex uni-row u-col-center " style="flex: 1; overflow: hidden;">

124
src/mycomponents/common/comListItem.vue

@ -1,27 +1,25 @@
<template>
<view class="">
<view class="uni-flex uni-column">
<view class="item" v-for="(item,index) in dataList">
<text class="item_title">{{item.title}} : </text>
<text v-if="(item.type=='')||(item.type==undefined)" class="text_wrap">{{item.content}} </text>
<text v-else-if="item.type=='dateTime'" class="text_wrap">{{formatDate(item.content)}} </text>
<text v-else-if="item.type=='boolean'" class="text_wrap">{{boolean(item.content)}} </text>
<text v-else-if="item.type=='transferMode'" class="text_wrap">{{getTransferModeName(item.content)}} </text>
<text v-else-if="item.type=='locationType'" class="text_wrap">{{getLocationTypeNameList(getDirectoryItemArray(item.content))}} </text>
<text v-else-if="item.type=='uom'" class="text_wrap">{{getUnitInfo(item.content)}} </text>
<text v-else-if="item.type=='inspectType'" class="text_wrap">{{getInspectType(item.content)}} </text>
<text v-else-if="item.type=='sampleMethod'" class="text_wrap">{{getSampleMethod(item.content)}} </text>
<text v-else-if="item.type=='requestState'" class="text_wrap">{{getRequestStateInfo(item.content)}} </text>
<text v-else-if="item.type=='inventoryStatus'" class="text_wrap">{{getInventoryStatusName(item.content)}} </text>
<text v-else-if="item.type=='locationCode'" class="text_wrap">{{getLocationTypeName(item.content)}} </text>
<text v-else-if="item.type=='transferMode'" class="text_wrap">{{handleGetTransferModeName(item.content)}} </text>
<text v-else-if="item.type=='locationType'" class="text_wrap">{{handleGetLocationTypeNameList(handleGetDirectoryItemArray(item.content))}} </text>
<text v-else-if="item.type=='uom'" class="text_wrap">{{handleGetUomInfo(item.content)}} </text>
<text v-else-if="item.type=='inspectType'" class="text_wrap">{{handleGetInspectType(item.content)}} </text>
<text v-else-if="item.type=='sampleMethod'" class="text_wrap">{{handleGetSampleMethod(item.content)}} </text>
<text v-else-if="item.type=='requestState'" class="text_wrap">{{handleGetRequestStateInfo(item.content)}} </text>
<text v-else-if="item.type=='inventoryStatus'" class="text_wrap">{{handleGetInventoryStatusName(item.content)}} </text>
<text v-else-if="item.type=='locationCode'" class="text_wrap">{{handleGetLocationTypeName(item.content)}} </text>
</view>
</view>
</view>
</template>
<script>
<script setup lang="ts">
import {
dateFormat
} from '@/common/basic.js';
@ -30,7 +28,7 @@
getTransferModeName,
getLocationTypeNameList,
getDirectoryItemArray,
getUnitInfo,
getUomInfo,
getInspectType,
getSampleMethod,
getRequestStateInfo,
@ -38,69 +36,49 @@
getLocationTypeName
} from '@/common/directory.js';
export default {
components: {},
data() {
return {
}
},
mounted() {},
watch: {
// dataContent: {
// handler(newName, oldName) {
// },
// immediate: true,
// deep: true
// }
},
props: {
dataList: {
type: Array,
default: []
}
},
methods: {
avaliable(value) {
return value == "TRUE" ? "可用" : "不可用"
},
boolean(value) {
return value == "TRUE" ? "是" : "否"
},
formatDate(val) {
return dateFormat(val)
},
getTransferModeName(value){
return getTransferModeName(value)
},
getLocationTypeNameList(value){
return getLocationTypeNameList(value)
},
getDirectoryItemArray(value){
return getDirectoryItemArray(value)
},
getUnitInfo(value){
return getUnitInfo(value).label
},
getInspectType(value){
return getInspectType(value)
},
getSampleMethod(value){
return getSampleMethod(value)
},
getRequestStateInfo(value){
return getRequestStateInfo(value).label
},
getInventoryStatusName(value){
return getInventoryStatusName(value)
},
getLocationTypeName(value){
return getLocationTypeName(value)
}
const props = defineProps({
dataList: {
type: Array,
default: []
}
})
const avaliable=(value)=> {
return value == "TRUE" ? "可用" : "不可用"
}
const boolean=(value)=> {
return value == "TRUE" ? "是" : "否"
}
const formatDate=(val)=> {
return dateFormat(val)
}
const handleGetTransferModeName=(value)=>{
return getTransferModeName(value)
}
const handleGetLocationTypeNameList=(value)=>{
return getLocationTypeNameList(value)
}
const handleGetDirectoryItemArray=(value)=>{
return getDirectoryItemArray(value)
}
const handleGetUomInfo=(value)=>{
return getUomInfo(value).label
}
const handleGetInspectType=(value)=>{
return getInspectType(value)
}
const handleGetSampleMethod=(value)=>{
return getSampleMethod(value)
}
const handleGetRequestStateInfo=(value)=>{
return getRequestStateInfo(value).label
}
const handleGetInventoryStatusName=(value)=>{
return getInventoryStatusName(value)
}
const handleGetLocationTypeName=(value)=>{
return getLocationTypeName(value)
}
</script>
<style>

1026
src/mycomponents/common/comMessage.vue

File diff suppressed because it is too large

25
src/mycomponents/common/comPopup.vue

@ -10,26 +10,13 @@
</view>
</template>
<script>
export default {
emits: ["onClose"],
components: {
},
props: {
},
data() {
return {
}
},
methods: {
closeScanPopup() {
this.$emit("onClose", );
}
}
<script setup lang="ts">
const closeScanPopup = () => {
emit("onClose", );
}
//
const emit = defineEmits(['onClose'])
</script>
<style>

111
src/mycomponents/container/targetContainer.vue

@ -1,68 +1,57 @@
<template>
<view class="uni-flex u-col-center" style="padding-top: 15rpx;
padding-bottom: 15rpx;
padding-left: 10rpx;
padding-right: 10rpx;
font-size:32rpx;">
<text style="font-size: 35rpx;">{{title}} </text>
<view class="uni-flex u-col-center" @click="showLocation">
<text style="color:#3FBAFF;font-size: 35rpx;" v-if="containerCode==''&&isShowEdit==true">&nbsp 请扫描</text>
<text style="color:#3FBAFF; font-size: 35rpx;">&nbsp {{containerCode}}</text>
<image v-if="isShowEdit" style="width: 45rpx;height: 45rpx;" src="/static/icons/icons_edit.svg"></image>
</view>
<winScanContainer ref="scanContainer" :title="title" @getContainer='getContainer'></winScanContainer>
</view>
<view class="uni-flex u-col-center" style="padding-top: 15rpx; padding-bottom: 15rpx; padding-left: 10rpx; padding-right: 10rpx; font-size: 32rpx">
<text style="font-size: 35rpx">{{ title }} </text>
<view class="uni-flex u-col-center" @click="showLocation">
<text style="color: #3fbaff; font-size: 35rpx" v-if="containerCode == '' && isShowEdit == true">&nbsp 请扫描</text>
<text style="color: #3fbaff; font-size: 35rpx">&nbsp {{ containerCode }}</text>
<image v-if="isShowEdit" style="width: 45rpx; height: 45rpx" src="/static/icons/icons_edit.svg"></image>
</view>
<winScanContainer ref="scanContainer" :title="title" @getContainer="getContainer"></winScanContainer>
</view>
</template>
<script>
import winScanContainer from "@/mycomponents/scan/winScanContainer.vue"
<script setup lang="ts">
import { ref, getCurrentInstance, onMounted, nextTick, watch } from 'vue'
import winScanContainer from '@/mycomponents/scan/winScanContainer.vue'
export default {
components: {
winScanContainer
},
data() {
return {
defaultContainerCode: ""
}
},
props: {
title: {
type: String,
default: "需求库位"
},
containerCode: {
type: String,
default: ""
},
isShowEdit: {
type: Boolean,
default: true
},
},
const defaultContainerCode = ref('')
const props = defineProps({
title: {
type: String,
default: '需求库位'
},
containerCode: {
type: String,
default: ''
},
isShowEdit: {
type: Boolean,
default: true
}
})
watch(
() => props.containerCode,
(val) => {
if (val != '') {
defaultContainerCode.value = val
}
},
{
immediate: true,
deep: true
}
)
watch: {
containerCode: {
handler(newName, oldName) {
if (this.containerCode != "") {
this.defaultContainerCode = this.containerCode;
}
},
immediate: true,
deep: true
}
},
methods: {
showLocation() {
this.$refs.scanContainer.openScanPopup();
},
//
getContainer(containerInfo) {
this.$emit("getContainer", containerInfo)
}
}
}
const showLocation = () => {
scanContainer.value.openScanPopup()
}
//
const getContainer = (containerInfo) => {
emit('getContainer', containerInfo)
}
//
const emit = defineEmits(['getContainer'])
</script>
<style>
</style>
<style></style>

315
src/mycomponents/detail/comDetailCard.vue

@ -1,162 +1,165 @@
<template>
<view class="" style="background-color: #fff;">
<uni-collapse ref="collapse1" @change="">
<uni-collapse-item :open="true">
<template v-slot:title>
<item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowStdPack="false">
</item-compare-qty>
</template>
<u-line></u-line>
<view class="" v-for="(item,index) in dataContent.subList">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="item.scaned?scanOptions:detailOptions"
style='padding:0px 0px 5px 0px;align-items: center;'>
<recommend :detail="item" :isShowToLocation="false">
</recommend>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
</uni-collapse-item>
</uni-collapse>
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" @confirm="confirm"></balance-qty-edit>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation='getLocation'
:locationTypeList="locationTypeList"></win-scan-location>
<comMessage ref="message"></comMessage>
</view>
<view class="" style="background-color: #fff">
<u-collapse ref="collapse">
<u-collapse-item :open="true">
<template v-slot:title>
<item-compare-qty :dataContent="dataContent" :handleQty="dataContent.handleQty" :isShowStdPack="false" style="width: 100%"> </item-compare-qty>
</template>
<u-swipe-action :show="item.show" :index="index" v-for="(item, index) in dataContent.subList" :key="index" :options="item.scaned ? scanOptions : detailOptions" bg-color="rgba(255,255,255,0)" @click="(...event) => swipeClick(event, item)">
<recommend :detail="item" :isShowFromLocation="isShowFromLocation" :isShowStatus="isShowStatus" :isShowToLocation="isShowToLocation"></recommend>
</u-swipe-action>
</u-collapse-item>
</u-collapse>
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" :queryBalance="queryBalance" @confirm="confirm"></balance-qty-edit>
<win-scan-location ref="scanLocationCode" title="目标库位" @getLocation="getLocation" :locationAreaTypeList="locationAreaTypeList"></win-scan-location>
<com-message ref="comMessageRef" />
</view>
</template>
<script>
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import {
getDetailOption,
getPurchaseReceiptOption
} from '@/common/array.js';
<script setup lang="ts">
import { ref, getCurrentInstance, onMounted, nextTick, watch } from 'vue'
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import winScanLocation from '@/mycomponents/scan/winScanLocation.vue'
import { getDetailOption, getPurchaseReceiptOption } from '@/common/array.js'
export default {
emits: ['openDetail', "updateData"],
components: {
itemCompareQty,
recommend,
balanceQtyEdit,
winScanLocation
},
props: {
dataContent: {
type: Object,
default: {}
},
settingParam: {
type: Object,
default: {}
},
isShowPack: {
type: Boolean,
default: true
},
isShowBatch: {
type: Boolean,
default: true
},
isShowLocation: {
type: Boolean,
default: true
},
locationTypeList: {
type: Array,
default: []
},
},
watch: {
dataContent: {
handler(newName, oldName) {
if (this.dataContent.subList.length > 0) {
if (this.$refs.collapse1 != undefined && this.$refs.collapse1 != null) {
this.$nextTick(res => {
this.$refs.collapse1.resize()
})
}
}
},
immediate: true,
deep: true
}
},
data() {
return {
option: [],
showItem: {},
locatonItem: {},
editItem: {},
detailOptions: [],
scanOptions: []
}
},
mounted() {
if (this.detailOptions.length == 0) {
this.detailOptions = getDetailOption();
}
if (this.scanOptions.length == 0) {
this.scanOptions = getPurchaseReceiptOption(this.settingParam.allowModifyQty, this.settingParam
.allowModifyLocation)
}
},
methods: {
swipeClick(e, item) {
if (e.content.text == "详情") {
this.detail(item)
} else if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "库位") {
this.showLocation(item)
} else if (e.content.text == "移除") {
this.remove(item)
}
},
edit(item) {
this.editItem = item;
this.$refs.qtyEdit.openEditPopup(item.balance, item.handleQty);
},
detail(item) {
this.$emit('openDetail', item);
// this.showItem = item;
// this.$refs.jobDetailPopup.openPopup(item)
},
remove(item) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
item.scaned = false
item.balance = {}
item.handleQty = null;
this.$forceUpdate()
this.$emit('remove', item)
}
});
},
confirm(qty) {
this.editItem.handleQty = qty;
this.$emit('updateData')
},
showLocation(item) {
this.locatonItem = item;
this.$refs.scanLocationCode.openScanPopup();
},
//
getLocation(location, code) {
this.locatonItem.toLocationCode = code;
this.$emit('updateData')
},
}
}
const props = defineProps({
dataContent: {
type: Object,
default: null
},
settingParam: {
type: Object,
default: null
},
isShowPack: {
type: Boolean,
default: true
},
isShowBatch: {
type: Boolean,
default: true
},
isShowLocation: {
type: Boolean,
default: true
},
isShowFromLocation: {
type: Boolean,
default: true
},
isShowToLocation: {
type: Boolean,
default: false
},
locationAreaTypeList: {
type: Array,
default: null
},
queryBalance: {
type: Boolean,
default: true
},
isShowStatus: {
type: Boolean,
default: true
}
})
const option = ref([])
const showItem = ref({})
const editItem = ref({})
const locatonItem = ref({})
const detailOptions = ref([])
const scanOptions = ref([])
const comMessageRef = ref()
const collapse = ref()
const qtyEdit = ref()
const scanLocationCode = ref()
const dataContent = ref(props.dataContent)
dataContent.value.subList.forEach((item) => {
item.show = false
})
//
watch(
() => props.dataContent,
(val) => {
if (val.subList.length > 0) {
if (collapse.value != undefined && collapse.value != null) {
nextTick((res) => {
setTimeout(()=>{
collapse.value.init()
},500)
})
}
}
},
{
immediate: true,
deep: true
}
)
onMounted(() => {
if (detailOptions.value.length == 0) {
detailOptions.value = getDetailOption()
}
if (scanOptions.value.length == 0) {
scanOptions.value = getPurchaseReceiptOption(props.settingParam.allowModifyQty, false)
}
nextTick((res) => {
collapse.value.init()
})
showLocation()
})
const swipeClick = (params, item) => {
let text = ''
if (item.scaned) {
text = scanOptions.value[params[1]].text
} else {
text = detailOptions.value[params[1]].text
}
if (text == '详情') {
detail(item)
} else if (text == '编辑') {
edit(item)
} else if (text == '库位') {
showLocation(item)
} else if (text == '移除') {
remove(item)
}
}
const edit = (item) => {
editItem.value = item
qtyEdit.value.openEditPopup(item, item.handleQty)
}
const detail = (item) => {
emit('openDetail', item)
}
const remove = (item) => {
comMessageRef.value.showQuestionMessage('确定移除扫描信息?', (res) => {
if (res) {
item.scaned = false
item.balance = {}
item.handleQty = null
emit('remove', item)
}
})
}
const confirm = (qty) => {
editItem.value.handleQty = qty
emit('updateData')
}
const showLocation = (item) => {
locatonItem.value = item
scanLocationCode.value.openScanPopup()
}
//
const getLocation = () => {
locatonItem.value.LocationCode = code
emit('updateData')
}
//
const emit = defineEmits(['openDetail', 'remove', 'updateData'])
</script>
<style>
</style>
<style></style>

270
src/mycomponents/detail/comRequestDetailCard.vue

@ -1,151 +1,135 @@
<template>
<view class="" style="background-color: #fff;">
<!-- <comReturnRequestInfo :workShopCode="dataContent.workshopCode" :dataContent="requestItem">
</comReturnRequestInfo> -->
<uni-collapse ref="collapse1" @change="">
<uni-collapse-item :open="true">
<template v-slot:title>
<item-compare-qty
:dataContent="dataContent"
:handleQty="Number(dataContent.handleQty)"
:isShowStdPack="false">
</item-compare-qty>
</template>
<u-line />
<view class="" v-for="(item,index) in dataContent.subList">
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item)"
:right-options="item.scaned?scanOptions:detailOptions">
<recommend :detail="item" :record="item.record" :isShowPack="isShowPack"
:isShowBatch="isShowBatch" :isShowFromLocation="isShowLocation"></recommend>
</uni-swipe-action-item>
</uni-swipe-action>
</view>
</uni-collapse-item>
</uni-collapse>
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" @confirm="confirm"></balance-qty-edit>
<comMessage ref="message"></comMessage>
</view>
<view class="" style="background-color: #fff">
<u-collapse ref="collapse">
<u-collapse-item :open="true">
<template v-slot:title>
<item-compare-qty :dataContent="dataContent" :handleQty="Number(dataContent.handleQty)" :isShowStdPack="false" style="flex: 1"> </item-compare-qty>
</template>
<u-swipe-action :show="item.show" :index="index" v-for="(item, index) in dataContent.subList" :key="index" :options="item.scaned ? scanOptions : detailOptions" bg-color="rgba(255,255,255,0)" @click="(...event) => swipeClick(event, item)">
<recommend :detail="item" :record="item.record" :isShowPack="isShowPack" :isShowBatch="isShowBatch" :isShowFromLocation="isShowLocation"></recommend>
</u-swipe-action>
</u-collapse-item>
</u-collapse>
<balance-qty-edit ref="qtyEdit" :settingParam="settingParam" @confirm="confirm"></balance-qty-edit>
<com-message ref="comMessageRef" />
</view>
</template>
<script>
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import comReturnRequestInfo from '@/pages/productionReturn/coms/comReturnRequestInfo.vue'
import {
getDetailOption,
getDetailEditRemoveOption,
getDetailRemoveOption
} from '@/common/array.js';
<script setup lang="ts">
import { ref, getCurrentInstance, onMounted, watch, nextTick } from 'vue'
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import balanceQtyEdit from '@/mycomponents/qty/balanceQtyEdit.vue'
import comReturnRequestInfo from '@/pages/productionReturn/coms/comReturnRequestInfo.vue'
import { getDetailOption, getDetailEditRemoveOption, getDetailRemoveOption } from '@/common/array.js'
export default {
emits: ['openDetail'],
components: {
itemCompareQty,
recommend,
balanceQtyEdit,
comReturnRequestInfo
},
props: {
dataContent: {
type: Object,
default: {}
},
settingParam: {
type: Object,
default: {}
},
isShowPack: {
type: Boolean,
default: true
},
isShowBatch: {
type: Boolean,
default: true
},
isShowLocation: {
type: Boolean,
default: true
},
},
watch: {
dataContent(newVal) {
var test =this.dataContent
this.requestItem = newVal.subList[0];
},
},
data() {
return {
option: [],
showItem: {},
editItem: {
record: {
}
},
detailOptions: [],
scanOptions: [],
requestItem:{}
}
},
mounted() {
if (this.detailOptions.length == 0) {
this.detailOptions = getDetailOption();
}
if (this.scanOptions.length == 0) {
this.scanOptions = getDetailEditRemoveOption();
// if (this.dataContent.allowModifyQty == 1) {
// this.scanOptions = getDetailEditRemoveOption();
// } else {
// this.scanOptions = getDetailRemoveOption();
// }
}
},
methods: {
swipeClick(e, item) {
if (e.content.text == "详情") {
this.detail(item)
} else if (e.content.text == "编辑") {
this.edit(item)
} else if (e.content.text == "移除") {
this.remove(item)
}
},
edit(item) {
this.editItem = item;
this.$refs.qtyEdit.openEditPopup(item.balance, item.record.qty);
},
detail(item) {
this.$emit('openDetail', item);
// this.showItem = item;
// this.$refs.jobDetailPopup.openPopup(item)
},
remove(item) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
item.scaned = false
item.record = {}
item.balance = {}
item.inventoryStatus = item.RecommendInventoryStatus
// item.record.qty = 0;
this.$forceUpdate()
this.$emit('remove', item)
}
});
},
confirm(qty) {
this.editItem.record.qty = qty;
this.$emit('updateData')
}
}
}
const props = defineProps({
dataContent: {
type: Object,
default: {}
},
settingParam: {
type: Object,
default: {}
},
isShowPack: {
type: Boolean,
default: true
},
isShowBatch: {
type: Boolean,
default: true
},
isShowLocation: {
type: Boolean,
default: true
}
})
const option = ref([])
const showItem = ref({})
const editItem = ref({
record: {}
})
const detailOptions = ref([])
const scanOptions = ref([])
const requestItem = ref({})
const qtyEdit = ref()
const comMessageRef = ref()
const dataContent = ref([])
const collapse = ref()
dataContent.value = props.dataContent
dataContent.value.subList.forEach((item) => {
item.show = false
})
onMounted(() => {
if (detailOptions.value.length == 0) {
detailOptions.value = getDetailOption()
}
if (scanOptions.value.length == 0) {
scanOptions.value = getDetailEditRemoveOption()
}
})
//
watch(
() => props.dataContent,
(val) => {
requestItem.value = val.subList[0]
dataContent.value = val
dataContent.value.subList.forEach((item) => {
item.show = false
})
nextTick(() => {
collapse.value.init()
})
},
{
immediate: true,
deep: true
}
)
const swipeClick = (params, item) => {
let text = ''
if (item.scaned) {
text = scanOptions.value[params[1]].text
} else {
text = detailOptions.value[params[1]].text
}
if (text == '详情') {
detail(item)
} else if (text == '编辑') {
edit(item)
} else if (text == '移除') {
remove(item)
}
}
const edit = (item) => {
editItem.value = item
qtyEdit.value.openEditPopup(item.balance, item.record.qty)
}
const detail = (item) => {
emit('openDetail', item)
}
const remove = (item) => {
comMessageRef.value.showQuestionMessage('确定移除扫描信息?', (res) => {
if (res) {
item.scaned = false
item.record = {}
item.balance = {}
item.inventoryStatus = item.RecommendInventoryStatus
emit('remove', item)
}
})
}
const confirm = (qty) => {
editItem.value.record.qty = qty
emit('updateData')
}
//
const emit = defineEmits(['openDetail', 'remove', 'updateData'])
</script>
<style>
::v-deep .u-arrow-down-icon {
margin-right: 0px !important;
}
</style>

44
src/mycomponents/detail/detailBalanceInfo.vue

@ -15,12 +15,12 @@
<text class="item_title">数量 : </text>
<view class="text_wrap">
<text class="text_wrap">{{Number(dataContent.qty)}}</text>
<text class="text_wrap">{{getUnitInfo(dataContent.uom)}}</text>
<text class="text_wrap">{{handleGetUomInfo(dataContent.uom)}}</text>
</view>
</view>
<view class="item">
<text class="item_title">库存状态 : </text>
<text class="text_wrap">{{getInventoryStatusInfo(dataContent.inventoryStatus)}}</text>
<text class="text_wrap">{{handleGetInventoryStatusInfo(dataContent.inventoryStatus)}}</text>
</view>
<view class="item">
<text class="item_title">来源库位 : </text>
@ -29,37 +29,25 @@
</view>
</template>
<script>
<script setup lang="ts">
import {
getInventoryStatusName,
getStdPackUnitInfo,
getUnitInfo
getPackUnitInfo,
getUomInfo
} from '@/common/directory.js';
export default {
components: {},
data() {
return {
}
},
mounted() {},
props: {
dataContent: {
type: Object,
default: {}
}
},
methods: {
getInventoryStatusInfo(value) {
return getInventoryStatusName(value)
},
getUnitInfo(value){
return getUnitInfo(value).label
}
const props = defineProps({
dataContent: {
type: Object,
default: {}
}
})
const handleGetInventoryStatusInfo=(value)=> {
return getInventoryStatusName(value)
}
const handleGetUomInfo=(value)=>{
return getUomInfo(value).label
}
</script>
<style>

103
src/mycomponents/detail/detailCommonInfo.vue

@ -1,65 +1,48 @@
<template>
<view class="pop_detail" style="height:80%">
<com-item :dataContent="dataContent"></com-item>
<u-line></u-line>
<scroll-view style="height:320px ">
<detail-item-info :dataContent="dataContent"></detail-item-info>
<u-line></u-line>
<detail-recommend-info :dataContent="dataContent"></detail-recommend-info>
<u-line></u-line>
<view v-if="dataContent.record!=undefined">
<detail-handle-info :dataContent="dataContent">
</detail-handle-info>
<u-line></u-line>
</view>
<slot>
<!-- 每个任务的详情 -->
</slot>
</scroll-view>
<view class="uni-flex u-row-center ">
<view class="close_button" @click="closePopup">
关闭</view>
<!-- button 滚动不好使 -->
</view>
</view>
<view class="pop_detail" style="height: 80%">
<view class="u-p-t-20 u-p-b-20">
<com-item :dataContent="dataContent"></com-item>
</view>
<view class="split_line"></view>
<scroll-view style="height: 320px" scroll-y>
<detail-item-info :dataContent="dataContent"></detail-item-info>
<view class="split_line"></view>
<detail-recommend-info :dataContent="dataContent"></detail-recommend-info>
<view class="split_line"></view>
<view v-if="dataContent.record != undefined">
<detail-handle-info :dataContent="dataContent"> </detail-handle-info>
<view class="split_line"></view>
</view>
<slot>
<!-- 每个任务的详情 -->
</slot>
</scroll-view>
<view class="uni-flex u-row-center u-p-t-20 u-p-b-20">
<view class="close_button" @click="closePopup"> 关闭</view>
<!-- button 滚动不好使 -->
</view>
</view>
</template>
<script>
import comItem from '@/mycomponents/item/item.vue'
import detailItemInfo from '@/mycomponents/detail/detailItemInfo.vue'
import detailRecommendInfo from '@/mycomponents/detail/detailRecommendInfo.vue'
import detailHandleInfo from '@/mycomponents/detail/detailHandleInfo.vue'
export default {
emits: ['onClose'],
components: {
comItem,
detailItemInfo,
detailRecommendInfo,
detailHandleInfo
},
data() {
return {}
},
mounted() {},
props: {
dataContent: {
type: Object,
default: {}
}
},
methods: {
closePopup() {
this.$emit('onClose')
},
}
}
<script setup lang="ts">
import comItem from '@/mycomponents/item/item.vue'
import detailItemInfo from '@/mycomponents/detail/detailItemInfo.vue'
import detailRecommendInfo from '@/mycomponents/detail/detailRecommendInfo.vue'
import detailHandleInfo from '@/mycomponents/detail/detailHandleInfo.vue'
const props = defineProps({
dataContent: {
type: Object,
default: {}
}
})
const closePopup = () => {
emit('onClose')
}
//
const emit = defineEmits(['onClose'])
</script>
<style>
</style>
<style></style>

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save