958 changed files with 63727 additions and 134595 deletions
@ -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" |
@ -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' |
|||
|
@ -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' |
|||
|
File diff suppressed because it is too large
@ -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> |
@ -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> |
@ -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
|
@ -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" |
|||
} |
@ -1,17 +0,0 @@ |
|||
{ |
|||
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages |
|||
{ |
|||
"path": "pages/index/index", |
|||
"style": { |
|||
"navigationBarTitleText": "uni-app" |
|||
} |
|||
} |
|||
], |
|||
"globalStyle": { |
|||
"navigationBarTextStyle": "black", |
|||
"navigationBarTitleText": "uni-app", |
|||
"navigationBarBackgroundColor": "#F8F8F8", |
|||
"backgroundColor": "#F8F8F8" |
|||
}, |
|||
"uniIdRouter": {} |
|||
} |
@ -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> |
Before Width: | Height: | Size: 3.9 KiB |
@ -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])); |
|||
}); |
|||
}, |
|||
}); |
@ -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; |
@ -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})
|
|||
// }
|
@ -1,6 +0,0 @@ |
|||
import http from '../http' |
|||
|
|||
// 文件列表
|
|||
export function listNoPage(params) { |
|||
return http.post('/eam/attachment-file/listNoPage',{params}) |
|||
} |
@ -1,5 +0,0 @@ |
|||
import http from '../http' |
|||
// 根据模具号查询信息
|
|||
export function getBasicFaultTypeNoPage(params) { |
|||
return http.get('/eam/basic-fault-type/noPage',{params}) |
|||
} |
@ -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}) |
|||
} |
@ -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 |
|||
} |
@ -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) |
|||
} |
|||
|
@ -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}) |
|||
} |
@ -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 |
|||
}) |
|||
} |
@ -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') |
|||
} |
@ -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) |
|||
} |
@ -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) |
|||
} |
@ -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}) |
|||
} |
@ -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) |
|||
} |
|||
|
@ -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') |
|||
} |
@ -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) |
|||
} |
|||
} |
@ -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') |
|||
} |
|||
|
@ -1,5 +0,0 @@ |
|||
import http from './http' |
|||
// 获取库位
|
|||
export function getLocation(number) { |
|||
return http.get('/eam/location/scanCodeByNumber?number='+number) |
|||
} |
@ -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 |
|||
} |
@ -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) |
|||
} |
@ -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) |
|||
} |
@ -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}) |
|||
} |
@ -1,8 +0,0 @@ |
|||
import http from '../../http' |
|||
|
|||
|
|||
export function create(data) { |
|||
return http.post('/mes/work-scheduling-qaform/create',data) |
|||
} |
|||
|
|||
|
@ -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) |
|||
} |
@ -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) |
|||
} |
@ -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) |
|||
} |
|||
|
|||
|
@ -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) |
|||
} |
|||
|
@ -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) |
|||
} |
File diff suppressed because it is too large
@ -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}) |
|||
} |
@ -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}) |
|||
} |
@ -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() |
|||
} |
|||
} |
|||
|
@ -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; |
|||
} |
@ -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 |
|||
}; |
@ -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, |
|||
}; |
@ -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) |
|||
} |
@ -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 |
|||
} |
@ -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 |
|||
} |
@ -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> |
|||
|
@ -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-model所绑定的list的值 |
|||
value: { |
|||
type: Array, |
|||
default: function() { |
|||
return []; |
|||
} |
|||
}, |
|||
//是否使用虚拟列表,默认为否 |
|||
useVirtualList: { |
|||
type: Boolean, |
|||
default: false |
|||
}, |
|||
//是否在z-paging内部循环渲染列表(内置列表),默认为否。若use-virtual-list为true,则此项恒为true |
|||
useInnerList: { |
|||
type: Boolean, |
|||
default: false |
|||
}, |
|||
//内置列表cell的key名称,仅nvue有效,在nvue中开启use-inner-list时必须填此项 |
|||
cellKeyName: { |
|||
type: String, |
|||
default: '' |
|||
}, |
|||
//innerList样式 |
|||
innerListStyle: { |
|||
type: Object, |
|||
default: function() { |
|||
return {}; |
|||
} |
|||
}, |
|||
//预加载的列表可视范围(列表高度)页数,默认为12,即预加载当前页及上下各7页的cell。此数值越大,则虚拟列表中加载的dom越多,内存消耗越大(会维持在一个稳定值),但增加预加载页面数量可缓解快速滚动短暂白屏问题 |
|||
preloadPage: { |
|||
type: [Number, String], |
|||
default: 12 |
|||
}, |
|||
//虚拟列表cell高度模式,默认为fixed,也就是每个cell高度完全相同,将以第一个cell高度为准进行计算。可选值【dynamic】,即代表高度是动态非固定的,【dynamic】性能低于【fixed】。 |
|||
cellHeightMode: { |
|||
type: String, |
|||
default: 'fixed' |
|||
}, |
|||
//虚拟列表scroll取样帧率,默认为60,过高可能出现卡顿等问题 |
|||
virtualScrollFps: { |
|||
type: [Number, String], |
|||
default: 60 |
|||
}, |
|||
}, |
|||
watch: { |
|||
//监听页面v-mode传过来的值,同时传给z-paging |
|||
value(newVal) { |
|||
this.list = newVal; |
|||
}, |
|||
// #ifdef VUE3 |
|||
modelValue(newVal) { |
|||
this.list = newVal; |
|||
}, |
|||
// #endif |
|||
//监听z-paging给当前组件的值,同时传给页面 |
|||
list(newVal) { |
|||
//通过emit input修改页面中v-model绑定的值 |
|||
this.$emit('input', newVal); |
|||
// #ifdef VUE3 |
|||
this.$emit('update:modelValue', newVal); |
|||
// #endif |
|||
} |
|||
}, |
|||
methods: { |
|||
//监听z-paging的@query方法,通过emit传递给页面 |
|||
queryList(pageNo, pageSize) { |
|||
console.log("queryList",pageNo) |
|||
// this.$emit('query', pageNo, pageSize); |
|||
}, |
|||
//接收页面触发的reload方法,传给z-paging |
|||
reload(data) { |
|||
this.$refs.paging.reload(data); |
|||
}, |
|||
//接收页面触发的complete方法,传给z-paging |
|||
complete(data) { |
|||
this.$refs.paging.complete(data); |
|||
}, |
|||
/* |
|||
//如果是使用页面滚动,则需要添加以下三行,注意页面那边要引入mixins,与使用页面滚动示例写法相同。 |
|||
//接收页面触发的updatePageScrollTop方法,传给z-paging |
|||
updatePageScrollTop(data){ |
|||
this.$refs.paging.updatePageScrollTop(data); |
|||
}, |
|||
//接收页面触发的pageReachBottom方法,传给z-paging |
|||
pageReachBottom(){ |
|||
this.$refs.paging.pageReachBottom(); |
|||
}, |
|||
//接收页面触发的doChatRecordLoadMore方法,传给z-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-list为true,则此项恒为true |
|||
useInnerList: { |
|||
type: Boolean, |
|||
default: false |
|||
}, |
|||
// 内置列表cell的key名称,仅nvue有效,在nvue中开启use-inner-list时必须填此项 |
|||
cellKeyName: { |
|||
type: String, |
|||
default: '' |
|||
}, |
|||
// innerList样式 |
|||
innerListStyle: { |
|||
type: Object, |
|||
default() { |
|||
return {} |
|||
} |
|||
}, |
|||
// 预加载的列表可视范围(列表高度)页数,默认为12,即预加载当前页及上下各7页的cell。此数值越大,则虚拟列表中加载的dom越多,内存消耗越大(会维持在一个稳定值),但增加预加载页面数量可缓解快速滚动短暂白屏问题 |
|||
preloadPage: { |
|||
type: [Number, String], |
|||
default: 12 |
|||
}, |
|||
// 虚拟列表cell高度模式,默认为fixed,也就是每个cell高度完全相同,将以第一个cell高度为准进行计算。可选值【dynamic】,即代表高度是动态非固定的,【dynamic】性能低于【fixed】。 |
|||
cellHeightMode: { |
|||
type: String, |
|||
default: 'fixed' |
|||
}, |
|||
// 虚拟列表scroll取样帧率,默认为60,过高可能出现卡顿等问题 |
|||
virtualScrollFps: { |
|||
type: [Number, String], |
|||
default: 60 |
|||
} |
|||
}) |
|||
const list = ref([]) |
|||
const paging = ref() |
|||
// 监听页面v-mode传过来的值,同时传给z-paging |
|||
watch( |
|||
() => props.value, |
|||
(newVal) => { |
|||
list.value = newVal |
|||
} |
|||
) |
|||
// #ifdef VUE3 |
|||
watch( |
|||
() => props.modelValue, |
|||
(newVal) => { |
|||
list.value = newVal |
|||
} |
|||
) |
|||
// #endif |
|||
watch( |
|||
() => list.value, |
|||
(newVal) => { |
|||
// 通过emit input修改页面中v-model绑定的值 |
|||
emit('input', newVal) |
|||
// #ifdef VUE3 |
|||
emit('update:modelValue', newVal) |
|||
// #endif |
|||
} |
|||
) |
|||
|
|||
// 监听z-paging的@query方法,通过emit传递给页面 |
|||
const queryList = (pageNo, pageSize) => { |
|||
console.log('queryList', pageNo) |
|||
// this.$emit('query', pageNo, pageSize); |
|||
} |
|||
// 接收页面触发的reload方法,传给z-paging |
|||
const reload = (data) => { |
|||
paging.value.reload(data) |
|||
} |
|||
// 接收页面触发的complete方法,传给z-paging |
|||
const complete = (data) => { |
|||
console.log(data) |
|||
paging.value.complete(data) |
|||
} |
|||
/* |
|||
//如果是使用页面滚动,则需要添加以下三行,注意页面那边要引入mixins,与使用页面滚动示例写法相同。 |
|||
//接收页面触发的updatePageScrollTop方法,传给z-paging |
|||
updatePageScrollTop(data){ |
|||
this.$refs.paging.updatePageScrollTop(data); |
|||
}, |
|||
//接收页面触发的pageReachBottom方法,传给z-paging |
|||
pageReachBottom(){ |
|||
this.$refs.paging.pageReachBottom(); |
|||
}, |
|||
//接收页面触发的doChatRecordLoadMore方法,传给z-paging |
|||
doChatRecordLoadMore() { |
|||
this.$refs.paging.doChatRecordLoadMore(); |
|||
} |
|||
*/ |
|||
// 传递给父类 |
|||
const emit = defineEmits(['input', 'update:modelValue']) |
|||
defineExpose({ |
|||
reload, |
|||
complete |
|||
}) |
|||
</script> |
|||
|
|||
<style> |
|||
|
|||
</style> |
|||
<style></style> |
|||
|
@ -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> |
@ -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> |
|||
|
@ -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> |
File diff suppressed because one or more lines are too long
@ -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(); |
|||
} |
@ -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) |
|||
} |
|||
}) |
|||
}) |
|||
} |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -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> |
|||
|
@ -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> |
|||
|
@ -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> |
|||
|
@ -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> |
|||
|
@ -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> |
|||
|
@ -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> |
|||
|
@ -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> |
|||
|
@ -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> |
|||
|
@ -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> |
|||
|
@ -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> |
|||
|
@ -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> |
|||
|
File diff suppressed because it is too large
@ -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">  请扫描</text> |
|||
<text style="color:#3FBAFF; font-size: 35rpx;">  {{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">  请扫描</text> |
|||
<text style="color: #3fbaff; font-size: 35rpx">  {{ 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> |
|||
|
@ -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> |
|||
|
@ -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> |
|||
|
@ -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…
Reference in new issue