剩余模块:生产退料

This commit is contained in:
刘晓鹏 2025-05-26 16:57:56 +08:00
parent b1d8dec263
commit eb2c8d2d7a
161 changed files with 18754 additions and 6607 deletions

View File

@ -27,7 +27,7 @@ export const BarcodePackBillList = async (data: object) => requst('/api/BarcodeP
export const BarcodePackBillScanData = async (data: object) => requst('/api/BarcodePackBill/ScanData', 'get', {...data})
//保存
export const BarcodePackBillSave = async (data: object) => requst('/api/BarcodePackBill/Save', 'post', {...data})
//生产发料 & 生产补料
//生产发料 & 生产补料 & 生产退料
export const PRDPPBOMList = async (data: object) => requst('/api/PRD_PPBOM/List', 'get', {...data})
export const PRDPPBOMView = async (data: object) => requst('/api/PRD_PPBOM/View', 'get', {...data})
export const PRDPPBOMScanData = async (data: object) => requst('/api/PRD_PPBOM/ScanData', 'get', {...data})
@ -78,7 +78,7 @@ export const SAL_DELIVERYNOTICEPush = async (data: object) => requst('/api/SAL_D
//生产装箱
export const PRD_MORPTPackView = async (data: object) => requst('/api/PRD_MORPT/PackView', 'get', {...data})
export const getPrintData = async (data: object) => requst('/api/BarcodePackBill/GetPrintData', 'get', {...data})
export const UHIK_BD_BarCodeMainFileSave = async (data: object) => requst('/api/UHIK_BD_BarCodeMainFile/Save', 'post', {...data})
export const UHIK_BD_BarCodeMainFileSave = async (data: object,noMsg:boolean) => requst('/api/UHIK_BD_BarCodeMainFile/Save', 'post', {...data},{},noMsg)
//仓库信息
export const stockList = async (data: object) => requst('/api/Stock/List', 'get', {...data})
export const stockView = async (data: object) => requst('/api/Stock/View', 'get', {...data})

View File

@ -1,6 +1,6 @@
import env from './env';
// import uniChat from "./uniChat";
export default function requst(url : string, type : string, params : any, header : object = {}) {
export default function requst(url : string, type : string, params : any, header : object = {}, noMsg:boolean = true) {
// #ifndef APP-PLUS
uni.showLoading({
mask: true
@ -10,6 +10,7 @@ export default function requst(url : string, type : string, params : any, header
plus.nativeUI.showWaiting();
// #endif
console.log('检查URL' + env.API_URL + url,)
console.log('检查TOKEN' + 'Bearer '+ uni.getStorageSync('TOKEN'),)
console.log(params);
var apiHeader = ''
var headerObj = {}
@ -37,10 +38,8 @@ export default function requst(url : string, type : string, params : any, header
console.log(result);
let res = result.data;
if (res.code === 200) {
console.log('请求成功')
resolve(res);
} else if (res.code == 401) {
console.log('请求失败')
// #ifdef APP-PLUS
plus.nativeUI.toast('登录状态失效,请重新登录');
// #endif
@ -56,6 +55,7 @@ export default function requst(url : string, type : string, params : any, header
// tools.jumpTo('/pages/client/account/login', {}, 0)
resolve(res)
} else {
if(!noMsg){
setTimeout(() => {
uni.showToast({
icon: 'none',
@ -63,6 +63,7 @@ export default function requst(url : string, type : string, params : any, header
title: res.msg
})
})
}
resolve(res)
}
},

View File

@ -0,0 +1,746 @@
<template>
<view class="fui-input__wrap" :class="{'fui-input__border-nvue':inputBorder}"
:style="{paddingTop:padding[0] || 0,paddingRight:padding[1] || 0,paddingBottom:padding[2] || padding[0] || 0,paddingLeft:padding[3] || padding[1] || 0,background:backgroundColor,marginTop:marginTop+'rpx',borderRadius:getRadius,borderColor:borderColor}"
@tap="fieldClick">
<view v-if="borderTop && !inputBorder" :style="{background:borderColor,left:topLeft+'rpx',right:topRight+'rpx'}"
class="fui-input__border-top" :class="{'fui-input__background':!borderColor}">
</view>
<!-- #ifndef APP-NVUE -->
<view class="fui-input__border" :class="{'fui-input__bordercolor':!borderColor}"
:style="{borderRadius:getBorderRadius,borderColor:borderColor}" v-if="inputBorder"></view>
<!-- #endif -->
<!-- #ifdef APP-NVUE -->
<view class="fui-input__required" v-if="required">
<text :style="{color:requiredColor || dangerColor}" class="fui-form__asterisk-text">*</text>
</view>
<!-- #endif -->
<!-- #ifndef APP-NVUE -->
<view class="fui-input__required" :style="{color:requiredColor || dangerColor}" v-if="required">*</view>
<!-- #endif -->
<view class="fui-input__label" :style="{minWidth:labelWidth+'rpx'}" v-if="label">
<text :style="{fontSize:getLabelSize,color:labelColor}">{{label}}</text>
</view>
<slot name="left"></slot>
<!-- #ifndef APP-NVUE -->
<input class="fui-input__self"
:class="{'fui-input__text-right':textRight,'fui-input__disabled-styl':disabled && disabledStyle,'fui-input__disabled':disabled}"
:style="{fontSize:getSize,color:color,textAlign:textRight?'right':textAlign}"
placeholder-class="fui-input__placeholder" :type="type" :name="name" :value="val"
:placeholder="val?'':placeholder" :password="password || type === 'password' || null"
:placeholder-style="placeholderStyl" :disabled="disabled || readonly" :cursor-spacing="cursorSpacing"
:maxlength="maxlength" :focus="focused" :confirm-type="confirmType" :confirm-hold="confirmHold"
:cursor="cursor" :selection-start="selectionStart" :selection-end="selectionEnd"
:adjust-position="adjustPosition" :hold-keyboard="holdKeyboard" :auto-blur="autoBlur" :enableNative="false"
:always-embed="alwaysEmbed" @focus="onFocus" @blur="onBlur" @input="onInput" @confirm="onConfirm"
@keyboardheightchange="onKeyboardheightchange" />
<!-- #endif -->
<!-- #ifdef APP-NVUE -->
<view class="fui-input__self-wrap">
<input ref="fuiInput" class="fui-input__self" :class="{'fui-input__text-right':textRight}"
:style="{fontSize:getSize,color:color,textAlign:textRight?'right':textAlign}"
placeholder-class="fui-input__placeholder" :type="type" :name="name" :value="val"
:placeholder="placeholder" :password="password || type === 'password'"
:placeholder-style="placeholderStyl" :disabled="disabled || readonly" :cursor-spacing="cursorSpacing"
:maxlength="maxlength" :focus="focused" :confirm-type="confirmType" :confirm-hold="confirmHold"
:cursor="cursor" :selection-start="selectionStart" :selection-end="selectionEnd"
:adjust-position="adjustPosition" :hold-keyboard="holdKeyboard" :auto-blur="autoBlur"
:enableNative="false" :always-embed="alwaysEmbed" @focus="onFocus" @blur="onBlur" @input="onInput"
@confirm="onConfirm" @keyboardheightchange="onKeyboardheightchange" />
<view class="fui-input__cover" v-if="disabled || readonly" @tap="fieldClickAndroid"></view>
</view>
<!-- #endif -->
<view class="fui-input__clear-wrap" :style="{background:clearColor}" v-if="clearable && val != ''"
@tap.stop="onClear">
<view class="fui-input__clear">
<view class="fui-input__clear-a"></view>
</view>
<view class="fui-input__clear">
<view class="fui-input__clear-b"></view>
</view>
</view>
<slot></slot>
<view v-if="borderBottom && !inputBorder"
:style="{background:borderColor,left:bottomLeft+'rpx',right:bottomRight+'rpx'}"
class="fui-input__border-bottom" :class="{'fui-input__background':!borderColor}"></view>
</view>
</template>
<script>
export default {
name: "fui-input",
emits: ['input', 'update:modelValue', 'focus', 'blur', 'confirm', 'click', 'keyboardheightchange'],
// #ifdef MP-WEIXIN
//group使value
behaviors: ['wx://form-field-group'],
// #endif
// #ifdef MP-BAIDU || MP-QQ || H5
//
behaviors: ['uni://form-field'],
// #endif
// #ifdef MP-WEIXIN
options: {
addGlobalClass: true,
virtualHost: true
},
// #endif
props: {
//
required: {
type: Boolean,
default: false
},
requiredColor: {
type: String,
default: ''
},
//
label: {
type: String,
default: ''
},
//
labelSize: {
type: [Number, String],
default: 0
},
labelColor: {
type: String,
default: '#333'
},
//label rpx
labelWidth: {
type: [Number, String],
default: 140
},
clearable: {
type: Boolean,
default: false
},
clearColor: {
type: String,
default: '#CCCCCC'
},
//
focus: {
type: Boolean,
default: false
},
placeholder: {
type: String,
default: ''
},
placeholderStyle: {
type: String,
default: ''
},
//
name: {
type: String,
default: ''
},
// vue2
value: {
type: [Number, String],
default: ''
},
// #ifdef VUE3
//
modelValue: {
type: [Number, String],
default: ''
},
// #endif
//vue3
modelModifiers: {
default: () => ({})
},
//typetextNumberNaN
number: {
type: Boolean,
default: false
},
//input type
type: {
type: String,
default: 'text'
},
password: {
type: Boolean,
default: false
},
disabled: {
type: Boolean,
default: false
},
//V2.1.0+
disabledStyle: {
type: Boolean,
default: false
},
readonly: {
type: Boolean,
default: false
},
maxlength: {
type: [Number, String],
default: 140
},
min: {
type: [Number, String],
default: 'NaN'
},
max: {
type: [Number, String],
default: 'NaN'
},
cursorSpacing: {
type: Number,
default: 0,
},
confirmType: {
type: String,
default: 'done'
},
confirmHold: {
type: Boolean,
default: false,
},
cursor: {
type: Number,
default: -1
},
selectionStart: {
type: Number,
default: -1
},
selectionEnd: {
type: Number,
default: -1
},
adjustPosition: {
type: Boolean,
default: true
},
holdKeyboard: {
type: Boolean,
default: false
},
autoBlur: {
type: Boolean,
default: false
},
alwaysEmbed: {
type: Boolean,
default: false
},
size: {
type: [Number, String],
default: 0
},
color: {
type: String,
default: '#333'
},
inputBorder: {
type: Boolean,
default: false
},
isFillet: {
type: Boolean,
default: false
},
radius: {
type: [Number, String],
default: 8
},
borderTop: {
type: Boolean,
default: false
},
topLeft: {
type: [Number, String],
default: 0
},
topRight: {
type: [Number, String],
default: 0
},
borderBottom: {
type: Boolean,
default: true
},
bottomLeft: {
type: [Number, String],
default: 32
},
bottomRight: {
type: [Number, String],
default: 0
},
// #ifdef APP-NVUE
borderColor: {
type: String,
default: '#EEEEEE'
},
// #endif
// #ifndef APP-NVUE
borderColor: {
type: String,
default: ''
},
// #endif
trim: {
type: Boolean,
default: true
},
//使textAlign
textRight: {
type: Boolean,
default: false
},
//V2.2.0+ left/center/right
textAlign: {
type: String,
default: 'left'
},
padding: {
type: Array,
default () {
return ['28rpx', '32rpx']
}
},
backgroundColor: {
type: String,
default: '#FFFFFF'
},
marginTop: {
type: [Number, String],
default: 0
}
},
data() {
return {
placeholderStyl: '',
focused: false,
val: ''
}
},
computed: {
getRadius() {
let radius = this.radius + 'rpx'
if (this.isFillet) {
radius = '120px'
}
return radius;
},
getBorderRadius() {
let radius = Number(this.radius) * 2 + 'rpx'
if (this.isFillet) {
radius = '240px'
}
return radius;
},
getSize() {
const size = (uni.$fui && uni.$fui.fuiInput && uni.$fui.fuiInput.size) || 32
return `${this.size || size}rpx`
},
getLabelSize() {
const labelSize = (uni.$fui && uni.$fui.fuiInput && uni.$fui.fuiInput.labelSize) || 32
return `${this.labelSize || labelSize}rpx`
},
dangerColor() {
const app = uni && uni.$fui && uni.$fui.color;
return (app && app.danger) || '#FF2B2B';
}
},
watch: {
focus(val) {
this.$nextTick(() => {
setTimeout(() => {
this.focused = val
}, 20)
})
},
// #ifdef APP-NVUE
focused(val) {
if (!this.$refs.fuiInput) return;
this.$nextTick(() => {
setTimeout(() => {
if (val) {
this.$refs.fuiInput.focus()
} else {
this.$refs.fuiInput.blur()
}
}, 50)
})
},
// #endif
placeholderStyle() {
this.fieldPlaceholderStyle()
},
// #ifdef VUE3
modelValue(newVal) {
this.val = newVal
},
// #endif
value(newVal) {
this.val = newVal
}
},
created() {
this.fieldPlaceholderStyle()
setTimeout(() => {
// #ifndef VUE3
this.val = this.value
// #endif
// #ifdef VUE3
if (this.value && !this.modelValue) {
this.val = this.value
} else {
this.val = this.modelValue
}
// #endif
}, 50)
},
mounted() {
this.$nextTick(() => {
setTimeout(() => {
this.focused = this.focus
}, 300)
})
},
methods: {
fieldPlaceholderStyle() {
if (this.placeholderStyle) {
this.placeholderStyl = this.placeholderStyle
} else {
const _size = (uni.$fui && uni.$fui.fuiInput && uni.$fui.fuiInput.size) || 32
const size = uni.upx2px(this.size || _size)
this.placeholderStyl = `fontSize:${size}px;`
}
},
onInput(event) {
let value = event.detail.value;
if (this.trim) value = this.trimStr(value);
this.val = value;
const currentVal = Number(value)
if ((this.modelModifiers.number || this.number || this.type === 'digit' || this.type === 'number') && !
isNaN(currentVal) && Number.isSafeInteger(currentVal)) {
let eVal = this.type === 'digit' ? value : currentVal
if (typeof eVal === 'number') {
const min = Number(this.min)
const max = Number(this.max)
if (typeof min === 'number' && currentVal < min) {
eVal = min
} else if (typeof max === 'number' && max < currentVal) {
eVal = max
}
}
value = isNaN(eVal) ? value : eVal
}
this.$nextTick(() => {
//0
event.detail.value !== '' && (this.val = String(value));
})
//0 0
const inputValue = event.detail.value !== '' ? value : ''
// TODO  vue2
this.$emit('input', inputValue);
// TODO  vue3
// #ifdef VUE3
this.$emit('update:modelValue', inputValue)
// #endif
},
onFocus(event) {
this.$emit('focus', event);
},
onBlur(event) {
this.$emit('blur', event);
},
onConfirm(e) {
this.$emit('confirm', e);
},
onClear(event) {
if (this.disabled && !this.readonly) return;
uni.hideKeyboard()
this.val = '';
this.$emit('input', '');
// #ifdef VUE3
this.$emit('update:modelValue', '')
// #endif
},
fieldClick() {
this.$emit('click', {
name: this.name,
target: 'wrap'
});
},
/**
* 在安卓nvue上事件无法冒泡
* 外层容器点击事件无法触发需要单独处理
*/
fieldClickAndroid(e) {
//
// const sys = uni.getSystemInfoSync()
// if (sys.platform.toLocaleLowerCase() == "android") {
// const formItem = this.getParent();
// // formItem
// formItem && formItem.handleClick();
// this.$emit('click', {
// name: this.name,
// target: 'input'
// });
// }
},
getParent(name = 'fui-form-item') {
let parent = this.$parent;
let parentName = parent.$options.name;
while (parentName !== name) {
parent = parent.$parent;
if (!parent) return false;
parentName = parent.$options.name;
}
return parent;
},
onKeyboardheightchange(e) {
this.$emit('keyboardheightchange', e.detail)
},
trimStr(str) {
return str.replace(/^\s+|\s+$/g, '');
}
}
}
</script>
<style scoped>
.fui-input__wrap {
/* #ifndef APP-NVUE */
width: 100%;
box-sizing: border-box;
display: flex;
/* #endif */
flex-direction: row;
flex: 1;
align-items: center;
position: relative;
border-width: 0;
}
.fui-input__border-top {
position: absolute;
top: 0;
/* #ifdef APP-NVUE */
height: 0.5px;
z-index: -1;
/* #endif */
/* #ifndef APP-NVUE */
height: 1px;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
transform-origin: 0 0;
z-index: 1;
/* #endif */
}
.fui-input__border-bottom {
position: absolute;
bottom: 0;
/* #ifdef APP-NVUE */
height: 0.5px;
z-index: -1;
/* #endif */
/* #ifndef APP-NVUE */
height: 1px;
-webkit-transform: scaleY(0.5) translateZ(0);
transform: scaleY(0.5) translateZ(0);
transform-origin: 0 100%;
z-index: 1;
/* #endif */
}
.fui-input__required {
position: absolute;
left: 12rpx;
/* #ifndef APP-NVUE */
height: 30rpx;
top: 50%;
transform: translateY(-50%);
line-height: 1.15;
/* #endif */
/* #ifdef APP-NVUE */
top: 28rpx;
bottom: 28rpx;
align-items: center;
justify-content: center;
/* #endif */
}
/* #ifdef APP-NVUE */
.fui-form__asterisk-text {
font-size: 32rpx;
height: 32rpx;
}
/* #endif */
.fui-input__label {
padding-right: 12rpx;
/* #ifndef APP-NVUE */
flex-shrink: 0;
/* #endif */
}
/* #ifdef APP-NVUE */
.fui-input__self-wrap {
flex: 1;
flex-direction: row;
position: relative;
}
.fui-input__cover {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
/* #endif */
.fui-input__self {
flex: 1;
padding-right: 12rpx;
/* #ifndef APP-NVUE */
box-sizing: border-box;
overflow: visible;
/* #endif */
background-color: transparent;
}
.fui-input__clear-wrap {
width: 32rpx;
height: 32rpx;
transform: rotate(45deg) scale(1.1);
position: relative;
/* #ifndef APP-NVUE */
border-radius: 50%;
flex-shrink: 0;
/* #endif */
/* #ifdef APP-NVUE */
border-radius: 32rpx;
/* #endif */
/* #ifdef H5 */
cursor: pointer;
/* #endif */
}
.fui-input__clear {
width: 32rpx;
height: 32rpx;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
align-items: center;
justify-content: center;
position: absolute;
left: 0;
top: 0;
transform: scale(0.5) translateZ(0);
}
.fui-input__clear-a {
width: 32rpx;
border: 2rpx solid #fff;
background-color: #fff;
/* #ifndef APP-NVUE */
box-sizing: border-box;
/* #endif */
}
.fui-input__clear-b {
height: 32rpx;
border: 2rpx solid #fff;
background-color: #fff;
/* #ifndef APP-NVUE */
box-sizing: border-box;
/* #endif */
}
.fui-input__placeholder {
/* #ifndef APP-NVUE */
color: var(--fui-color-minor, #ccc);
overflow: visible;
/* #endif */
/* #ifdef APP-NVUE */
color: #ccc;
font-size: 32rpx;
/* #endif */
}
/* #ifdef MP */
::v-deep .fui-input__placeholder {
color: var(--fui-color-minor, #ccc);
overflow: visible;
}
/* #endif */
/* #ifdef APP-NVUE */
.fui-input__border-nvue {
border-width: 0.5px;
border-style: solid;
}
/* #endif */
/* #ifndef APP-NVUE */
.fui-input__disabled {
pointer-events: none;
}
.fui-input__border {
position: absolute;
height: 200%;
width: 200%;
border: 1px solid var(--fui-color-border, #EEEEEE);
transform-origin: 0 0;
transform: scale(0.5);
left: 0;
top: 0;
border-radius: 16rpx;
pointer-events: none;
}
.fui-input__bordercolor {
border-color: var(--fui-color-border, #EEEEEE) !important;
}
.fui-input__background {
background: var(--fui-color-border, #EEEEEE) !important;
}
/* #endif */
.fui-input__text-left {
text-align: left;
}
.fui-input__text-right {
text-align: right;
}
.fui-input__text-center {
text-align: center;
}
.fui-input__disabled-styl {
opacity: .6;
}
</style>

View File

@ -17,9 +17,16 @@
<slot name="right"></slot>
</view>
</view>
<up-popup :show="state.show" mode="top" :safeAreaInsetTop="true">
<view>
</view>
</up-popup>
</view>
</template>
<script lang="ts" setup>
import { reactive, defineProps } from 'vue';
// #ifdef APP-NVUE
const domModule = uni.requireNativePlugin('dom')
domModule.addRule('fontFace', {
@ -48,6 +55,9 @@
default: 0
}
})
const state = reactive({
show: false
})
//
function pageBack() {
let pages = getCurrentPages();

View File

@ -186,20 +186,22 @@
//
if (Object.keys(state.warehouseData).length !== 0 && Object.keys(state.receiveBillScanData.StockId).length !== 0) {
console.log('断点1');
if (state.receiveBillScanData.StockId.Number !== state.warehouseData.FNUMBER) {
uni.showModal({
title: t('index.ts'), content: t('index.ymrckbt'), cancelText: t('index.qx'), confirmText: t('index.qd'),
success(res) {
if (res.confirm) {
state.scanFrame.warehouseStr = formatLangTextValue(state.receiveBillScanData.StockId.Name)
state.warehouseData = state.receiveBillScanData.StockId.MultiLanguageText
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
// uni.showModal({
// title: t('index.ts'), content: t('index.ymrckbt'), cancelText: t('index.qx'), confirmText: t('index.qd'),
// success(res) {
// if (res.confirm) {
// state.scanFrame.warehouseStr = formatLangTextValue(state.receiveBillScanData.StockId.Name)
// state.warehouseData = state.receiveBillScanData.StockId
// } else if (res.cancel) {
// console.log('');
// }
// }
// });
}
} else if (Object.keys(state.warehouseData).length == 0 && Object.keys(state.receiveBillScanData.StockId).length !== 0) {
console.log('断点2');
state.scanFrame.warehouseStr = formatLangTextValue(state.receiveBillScanData.StockId.Name)
state.warehouseData = {
FIsOpenLocation: state.receiveBillScanData.StockId.IsOpenLocation,
@ -244,11 +246,11 @@
//
const dataVerifyFun = () => {
if (state.quantityStrState) {
uni.$u.toast('请检查您的数量')
eimts('err')
return false
}
// if (state.quantityStrState) {
// uni.$u.toast('')
// eimts('err')
// return false
// }
if (state.receiveBillScanData.stashVerify) {
if (state.scanFrame.warehouseStr == '') {
uni.$u.toast(t('index.gmkxyzdck'))

View File

@ -15,6 +15,7 @@ export const cn = {
'cgrk': '采购入库',
'scfl': '生产发料',
'scbl': '生产补料',
'sctl': '生产退料',
'sctc': '生产投产',
'scrk': '生产入库',
'sczx': '生产装箱',
@ -146,6 +147,7 @@ export const cn = {
'whqdlyqx':'未获取到蓝牙权限',
'ljcg':'连接成功',
'ljsb':'连接失败',
'cjbqsb':'创建标签失败'
'cjbqsb':'创建标签失败',
'ljydk':'连接已断开,请重新连接'
}
}

View File

@ -15,6 +15,7 @@ export const en = {
'cgrk': 'Good Receipt',
'scfl': 'Picking List',
'scbl': 'Replenishment',
'sctl': 'Production Return',
'sctc': 'Production',
'scrk': 'MO Receipt',
'sczx': 'MO Packing',
@ -146,6 +147,7 @@ export const en = {
'whqdlyqx':'Bluethooth is not connected',
'ljcg':'connection is successful.',
'ljsb':'connection failed.',
'cjbqsb':'QR code creation is failed'
'cjbqsb':'QR code creation is failed',
'ljydk':'Bluetooth is disconnected,please re-connect to the Bluetooth.'
}
}

View File

@ -1,25 +1,20 @@
{
"id": "vcode-input",
"name": "验证码输入框",
"version": "2.0",
"description": "验证码输入框,密码输入框",
"id": "fui-input",
"name": "Input 输入框fui-input",
"version": "v2.3.0",
"description": "FirstUI Input 输入框该组件是对原生input组件的增强内置了常用布局样式同时包含 input 所有功能。",
"keywords": [
"验证码输入框",
"支付密码输入框"
"Input",
"输入框",
"fui-input",
"FirstUI",
"Nvue"
],
"displayName": "验证码输入框",
"dcloudext": {
"category": [
"前端组件",
"通用组件"
]
},
"dependencies": {
"@alipay/ams-checkout": "^1.9.0",
"@tencentcloud/chat": "^3.2.3",
"dayjs": "^1.11.10",
"tim-profanity-filter-plugin": "^1.1.0",
"tim-upload-plugin": "^1.3.0",
"vue-qr": "^4.0.9"
}
"displayName": "Input 输入框fui-input"
}

View File

@ -57,6 +57,12 @@
{
"path": "pages/supplement/material"
},
{
"path": "pages/returnMaterials/index"
},
{
"path": "pages/returnMaterials/material"
},
{
"path": "pages/ruleClaim/index"
},

View File

@ -15,8 +15,8 @@
</view>
</view>
<view class="receive-listBox" ref="listBoxRef">
<scroll-view id="scroll-box" class="scroll-box" scroll-y="true"
:style="{'height':state.scrollHeight+'px'}" @scrolltolower="fnScrollBottom()">
<scroll-view id="scroll-box" class="scroll-box" scroll-y="true" :style="{'height':state.scrollHeight+'px'}"
@scrolltolower="fnScrollBottom()">
<view class="list-box-list" v-if="state.dataList.length > 0">
<view class="data-item" v-for="(item, index) in state.dataList" :key="index" @click="toPrintFun(item)">
<view class="tit">{{ t('index.zxddh') }}{{item.FBillNo}}</view>
@ -54,7 +54,7 @@
})
onShow(() => {
fnDataList()
})
onMounted(() => {
const query = uni.createSelectorQuery().in(this);
@ -173,6 +173,7 @@
.list-box-list {
width: 100%;
// margin: 20rpx auto;
.data-item {
border: 1px solid #efeaea;
@ -181,14 +182,17 @@
padding: 20rpx 20rpx 0;
margin-bottom: 20rpx;
background-color: #ffffff;
.tit {
font-size: 30rpx;
font-weight: bold;
padding: 20rpx 0;
}
.line-p {
border: 1px solid #efeaea;
}
.b-font {
font-size: 25rpx;
padding: 20rpx 0;
@ -198,5 +202,4 @@
}
}
}
</style>

View File

@ -44,9 +44,9 @@
<view>{{ item['FVHUBStock.FName'] }}</view>
</view>
<view class="itemBox">
<view>{{ t('receive.ph') }}</view>
<view>{{ t('public.xxh') }}</view>
<view class="zongjian"></view>
<view>{{ item.FVHUBFlot }}</view>
<view>{{ item.FVHUBJSON }}</view>
</view>
</view>
</uni-swipe-action-item>
@ -142,6 +142,7 @@
FVHUBScanQty: item.BarCodeQty + '', //
FVHUBEntryId: item.Id, //ID
FVHUBFlot: item.FLot_Text, //
FVHUBJSON:item.MaxcessSNo, //
FVHUBStock: {
FNUMBER: item.StockId.Number //
},
@ -151,10 +152,15 @@
}).then((res : any) => {
console.log(res);
state.queryString = ''
if(res.code === 200) {
if (res.data.IsSuccess) {
fnDataList();
uni.$u.toast(t('public.cg'))
}
} else {
uni.$u.toast(res.msg)
}
})
}
//
@ -210,15 +216,18 @@
if (FDRes.code === 200) {
fnDataList();
uni.$u.toast(t('public.cg'))
console.log('===================================================',BPRes.data.SuccessEntitys);
toPages('/pages/encasement/print',{
type:'Arr',
list:JSON.stringify(BPRes.data.SuccessEntitys)
})
}
})
}
})
} else {
uni.$u.toast(t('public.noDataMessage'))
}
}
});
}

View File

@ -34,7 +34,7 @@
<script setup lang="ts">
import { reactive, nextTick, onMounted, ref, computed, watch } from 'vue';
import { onLoad, onShow, onReachBottom, } from '@dcloudio/uni-app'
import { onLoad, onShow, onReachBottom, onBackPress } from '@dcloudio/uni-app'
import tkiQrcode from '@/components/tki-qrcode/tki-qrcode.vue'
import { PRD_MOEnterIntoPro, UHIK_BD_BarCodeMainFileSave, getPrintData } from '../../common/request/api/api';
import { timeFormat } from '@/uni_modules/uview-plus';
@ -61,9 +61,17 @@
printDataList: []
})
onLoad((pageData : any) => {
if(pageData.type === 'Arr'){
state.pageData.FBillNo = JSON.parse(pageData.list)[0].Number
console.log('========================================',state.pageData);
console.log('========================================',JSON.parse(pageData.list));
getPrintDataFun()
} else {
state.pageData = pageData
console.log(pageData);
getPrintDataFun()
}
})
onShow(() => {
uni.getLocation({
@ -71,12 +79,6 @@
success(res) {
console.log('开启定位权限', res)
},
fail: (err) => {
// uni.showToast({
// title: ':' + err,
// duration: 1500
// });
}
});
// #ifdef APP-PLUS
hasPermission()
@ -89,6 +91,28 @@
}
//
const hasPermission = () => {
console.log(uni.getStorageSync('printInfo'));
blueModule.checkConnect({
mac: uni.getStorageSync('printInfo').address,
uuid: '00001101-0000-1000-8000-00805f9b34fb'
}, (ret : any) => {
console.log(ret);
if (!ret.success) {
uni.setStorageSync('printInfo', {})
state.printingMachine = {
name: '',
address: ''
}
setTimeout(() => {
uni.showToast({
icon: 'none',
mask: true,
title: t('index.ljydk'),
})
}, 500)
}
});
blueModule.hasPermission((res : any) => {
if (res.success) {
blueModule.isOpen((isOpenRes : any) => {
@ -129,6 +153,9 @@
}
const getAddressFun = (row : any) => {
blueModule.disconnectAll((ret) => {
console.log(ret);
});
blueModule.connect({
MACAddress: row.address,
uuid: '00001101-0000-1000-8000-00805f9b34fb',
@ -146,11 +173,9 @@
uni.$u.toast(t('index.ljsb'))
}
}, (data : any) => {
//
console.log(data)
})
}
const createLabel = () => {
var command = tsc.default.createNew()
command.setSize(100, 50)
@ -176,15 +201,21 @@
UHIK_BD_BarCodeMainFileSave({
Key: 'qwe123!@#',
Items: arr
}).then((res:any) => {
}, true).then((res : any) => {
console.log('=====================================', res);
let str = JSON.stringify(res)
if (str.indexOf('违反字段唯一性要求') !== -1 || str.indexOf('is already been used') !== -1) {
} else {
uni.$u.toast(t('index.cjbqsb'))
}
})
}
const sendHexStr = () => {
createLabel()
UHIK_BD_BarCodeMainFileSaveFun()
if (state.sendData == null) {
// uni.$u.toast('')
return
}
let hexStr = ''
@ -216,6 +247,15 @@
//
console.log('发送结果')
console.log(result)
if (!result.success) {
uni.$u.toast(t('index.ljydk'))
uni.setStorageSync('printInfo', {})
state.printingMachine = {
name: '',
address: ''
}
return
}
if (result.success) {
realWriteData(sendloop, i + 1);
}

View File

@ -28,6 +28,9 @@
<view class="type-item type-item-hl" @tap="toPages('/pages/supplement/index')">
<view class="type-item-text">{{ t('home.scbl') }}</view>
</view>
<view class="type-item type-item-hl" @tap="toPages('/pages/returnMaterials/index')">
<view class="type-item-text">{{ t('home.sctl') }}</view>
</view>
<view class="type-item type-item-hl" @tap="toPages('/pages/ruleClaim/index')">
<view class="type-item-text">{{ t('index.ctll') }}</view>
</view>

View File

@ -18,7 +18,7 @@
<view class="list-box-list" v-if="state.dataList.length > 0">
<view class="data-item" @click.stop="fnToUrl(item)"
v-for="(item, index) in state.dataList" :key="index">
<view class="tit">{{ t('index.scdd') }}{{item.FBillNo}}</view>
<view class="tit">{{ t('index.scdd') }}{{item.FMOBillNO}}</view>
<view class="line-p"></view>
<view class="b-font">{{ t('receive.rq') }}{{item.FDateFormat}}</view>
</view>
@ -74,7 +74,7 @@
}
}
const fnToUrl = (item : any) => {
toPages('/pages/material/material',{id:item.FID,fBillNo:item.FBillNo})
toPages('/pages/material/material',{id:item.FID,fBillNo:item.FMOBillNO})
}
const debounceTimer = ref()
const changeFun = (e : any) => {
@ -91,6 +91,7 @@
queryString: state.queryString,
pageIndex: state.page.pageIndex,
pageSize: state.page.pageSize,
FType:'Pick'
};
if (state.page.pageIndex == 1) {
uni.showLoading({ mask: true });

View File

@ -97,6 +97,7 @@
totalCount: 0
},
FBillNo: '',
BillNo: '',
materialId: '',
supplierName: '',
inputFocus: true,
@ -149,12 +150,14 @@
const getReceiveBillScanData = (val : string) => {
PRDPPBOMScanData({
FBarCode: val,
FBillNo: state.FBillNo,
IsFeed: 'true'
FBillNo: state.BillNo,
IsFeed: 'false'
}).then((res : any) => {
if (res.data !== null) {
console.log(res);
scanFrameRef.value.getreceiveBillScanData({ ...res.data, queryString: state.queryString, scanFrameShowSate: state.shortcutDataFeedback.scanFrameShowSate })
const scanData = res.data
if( scanData.UnScanQty > scanData.BarCodeQty ) scanData.UnScanQty = scanData.BarCodeQty
scanFrameRef.value.getreceiveBillScanData({ ...scanData, queryString: state.queryString, scanFrameShowSate: state.shortcutDataFeedback.scanFrameShowSate })
if (Object.keys(state.shortcutDataFeedback).length) {
if (state.shortcutDataFeedback.scanFrameShowSate) {
scanFrameRef.value.stateShow(true)
@ -189,7 +192,7 @@
console.log(item);
temporaryScanDraftSave({
FVHUBFormId: "PRD_PPBOM", //
FVHUBFBillNo: state.FBillNo, //
FVHUBFBillNo: state.BillNo, //
FVHUBScanNumber: state.queryString, //
FVHUBMaterialNumber: item.articlesStr, //
FVHUBScanQty: item.quantityStr + '', //
@ -201,6 +204,7 @@
FVHUBMaterial: {
FNUMBER: item.articlesStr
},
FType: "Picking",
...JSON.parse(str),
}).then((res : any) => {
console.log(res);
@ -225,7 +229,7 @@
const scanRecordFun = () => {
toPages('/pages/records/index', {
FormId: 'PRD_PPBOM',
FbillNo: state.FBillNo
FbillNo: state.BillNo
})
}
/**
@ -301,11 +305,13 @@
const fnDataList = (FBillNo : any, statesItem : boolean = false) => {
let param = {
id: FBillNo,
IsFeed:'false'
};
uni.showLoading({ mask: true });
PRDPPBOMView(param).then(res => {
uni.hideLoading();
if (res.code == 200) {
state.BillNo = res.data.BillNo
state.dataList = []
let dataListArray = res.data.Entry;
if (dataListArray.length > 0) {

View File

@ -124,7 +124,7 @@
*/
const dataPushNotification = () => {
uni.showModal({
title: '提示', content: '确定要推送此次数据吗', cancelText: '取消', confirmText: '确定',
title: t('public.ts'), content: t('public.tjMessage'), cancelText: t('public.cancel'), confirmText: t('public.confirm'),
success(res) {
if (res.confirm) {
let EntryIds : any = []
@ -166,14 +166,14 @@
fStockFlexDetailDelete({ Ids: ids.toString() }).then((res : any) => {
if (res.code === 200) {
fnDataList(state.materialId);
uni.$u.toast('操作成功')
uni.$u.toast(t('public.cg'))
}
})
}
})
} else {
uni.$u.toast('暂无扫描数据')
uni.$u.toast(t('index.zwsmsj'))
}
}
@ -225,7 +225,13 @@
.list-box-list {
width: 100%;
.itemRight {
display: flex;
align-items: center;
padding: 34rpx;
background-color: #ff5a5d;
border-radius: 20rpx;
}
.data-item {
border: 1px solid #efeaea;
border-radius: 20rpx;

View File

@ -256,8 +256,8 @@
const dataPushNotification = () => {
uni.showModal({
title: t('public.ts'), content: t('public.tjMessage'), cancelText: t('public.cancel'), confirmText: t('public.confirm'),
success(res) {
if (res.confirm) {
success(resShow) {
if (resShow.confirm) {
let EntryIds : any = []
let ids : any = []
let ScanEntry : any = []
@ -268,10 +268,10 @@
};
uni.showLoading({ mask: true });
//
temporaryScanList(param).then(res => {
if (res.code == 200) {
if (res.data.list.length != 0) {
res.data.list.forEach((item : any) => {
temporaryScanList(param).then(resScan => {
if (resScan.code == 200) {
if (resScan.data.list.length != 0) {
resScan.data.list.forEach((item : any) => {
EntryIds.push(item.FVHUBEntryId)
ids.push(item.FID)
ScanEntry.push({
@ -291,15 +291,18 @@
AutoAudit: 'true',
ScanEntry: ScanEntry
}
}).then((res : any) => {
}).then((resPush : any) => {
console.log();
if (res.code === 200) {
if (resPush.code === 200) {
fStockFlexDetailDelete({ Ids: ids.toString() }).then((res : any) => {
if (res.code === 200) {
fnDataList(state.materialId);
uni.$u.toast(t('public.cg'))
}
})
} else {
console.log('==========================================', resPush);
uni.$u.toast(resPush.msg)
}
})

View File

@ -19,7 +19,7 @@
<scroll-view id="scroll-box" class="scroll-box" scroll-y="true"
:style="{'height':state.scrollHeight+'px'}" @scrolltolower="fnScrollBottom()">
<view class="list-box-list" v-if="state.dataList.length > 0">
<view class="data-item" v-for="(item, index) in state.dataList" :key="index">
<view class="data-item" v-for="(item, index) in state.dataList" :key="index" @click="clickPRD_MOViewIntoPro(item)">
<view class="tit">{{ t('index.scddbh') }}{{item.FBillNo}}</view>
<view class="line-p"></view>
<view class="b-font">{{ t('receive.rq') }}{{item.FDateFormat}}</view>
@ -80,7 +80,6 @@
const fnScrollBottom = () => {
console.log(state.page.pageIndex * state.page.pageSize, state.page.totalCount);
if (state.page.pageIndex * state.page.pageSize <= state.page.totalCount) {
debugger
state.page.pageIndex++;
uni.showLoading({ mask: true });
setTimeout(() => {
@ -98,16 +97,31 @@
fnDataList(true)
}, 500)
}
const viewIntoProFun = (item : object) => {
const viewIntoProFun = (item : object,typeVertical:string = 'details') => {
PRD_MOViewIntoPro({
Number: state.queryString
}).then((res : any) => {
if (res.code === 200) {
if(typeVertical === 'details'){
pageDataInfoCom.putInProdPageData({ ...res.data, ...item, time: new Date().getTime(), type: state.type })
route({ url: '/pages/putInProd/details' })
}
if(typeVertical === 'item'){
if(state.type === '2'){
toPages('/pages/putInProd/print',{...res.data})
}
}
}
})
}
const clickPRD_MOViewIntoPro = (item:any) => {
PRD_MOViewIntoPro({
Number: item.FBillNo
}).then((res : any) => {
if(state.type === '2'){
toPages('/pages/putInProd/print',{...res.data})
}
})
}
const fnDataList = (scanData : boolean = false) => {
let param = {

View File

@ -16,18 +16,6 @@
</view>
</view>
<!-- <view class="data-item" :style="[{'background-color':'#ffffff'}]" style="margin-top: 32rpx;">
<view class="dataText" style="display: flex;align-items: center;">
<tki-qrcode cid="qrcode1" ref="qrcode" val="val" :size="160" unit="upx" :loadMake="true"
:usingComponents="true" />
<view style="margin-left: 32rpx;">
<view>Date:{{ state.pageData.FBillNo }}</view>
<view>MO No:{{ state.pageData.MaterialNo }}</view>
<view>P/No:{{ state.pageData.CheckQty }}</view>
<view>Serial No:{{ state.pageData.Lot }}</view>
</view>
</view>
</view> -->
<view class="input-box" @click="printingMachineSelectFun">
<view class="input-item">
<up-input :placeholder="t('index.qxzdyj')" border="none" clearable inputAlign="left" v-model="state.printingMachine.name"
@ -110,6 +98,28 @@
//
const hasPermission = () => {
console.log(uni.getStorageSync('printInfo'));
blueModule.checkConnect({
mac: uni.getStorageSync('printInfo').address,
uuid: '00001101-0000-1000-8000-00805f9b34fb'
}, (ret : any) => {
console.log(ret);
if (!ret.success) {
uni.setStorageSync('printInfo', {})
state.printingMachine = {
name: '',
address: ''
}
setTimeout(() => {
uni.showToast({
icon: 'none',
mask: true,
title: t('index.ljydk'),
})
}, 500)
}
});
blueModule.hasPermission((res : any) => {
if (res.success) {
blueModule.isOpen((isOpenRes : any) => {
@ -203,7 +213,7 @@
UHIK_BD_BarCodeMainFileSave({
Key: 'qwe123!@#',
Items: arr
}).then((res : any) => {
},true).then((res : any) => {
console.log(res);
if (res.code == 200) {
let i : number = 0;
@ -277,6 +287,15 @@
//
console.log('发送结果')
console.log(result)
if (!result.success) {
uni.$u.toast(t('index.ljydk'))
uni.setStorageSync('printInfo', {})
state.printingMachine = {
name: '',
address: ''
}
return
}
if (result.success) {
realWriteData(sendloop, i + 1);
}

View File

@ -0,0 +1,206 @@
<template>
<view class="app status-bar-gap">
<view class="page">
<l-header :title="t('home.sctl')" sticky></l-header>
<view class="input-box">
<view class="input-item">
<up-input :placeholder="t('index.scdd')" border="none" clearable inputAlign="left"
v-model="state.queryString" @change="changeFun">
<template #prefix>
<up-icon name="search" color="#2979ff" size="24"></up-icon>
</template>
</up-input>
</view>
</view>
<view class="receive-listBox" ref="listBoxRef">
<scroll-view id="scroll-box" class="scroll-box" scroll-y="true"
:style="{'height':state.scrollHeight+'px'}" @scrolltolower="fnScrollBottom()">
<view class="list-box-list" v-if="state.dataList.length > 0">
<view class="data-item" @click.stop="fnToUrl(item)"
v-for="(item, index) in state.dataList" :key="index">
<view class="tit">{{ t('index.scdd') }}{{item.FMOBillNO}}</view>
<view class="line-p"></view>
<view class="b-font">{{ t('receive.rq') }}{{item.FDateFormat}}</view>
</view>
</view>
<view v-if="state.dataList.length==0">
<up-empty mode="list"></up-empty>
</view>
</scroll-view>
</view>
</view>
</view>
</template>
<script lang="ts" setup>
import { reactive, nextTick, onMounted, ref } from 'vue';
import { onLoad, onShow, onReachBottom } from '@dcloudio/uni-app'
import { useI18n } from 'vue-i18n'
import { parseTime } from '../../utils/tools.js';
import { PRDPPBOMList } from '../../common/request/api/api';
const listBoxRef = ref(null)
const getI18n = useI18n()
const { t, locale } = getI18n
const state = reactive({
queryString: '',
dataList: [],
scrollHeight: 0,
page: {
pageIndex: 1,
pageSize: 200,
totalCount: 0
}
})
onShow(() => {
})
onMounted(() => {
const query = uni.createSelectorQuery().in(this);
query.select(".receive-listBox").boundingClientRect((data) => {
state.scrollHeight = data.height
}).exec();
fnDataList()
})
const fnScrollBottom = () => {
console.log(state.page.pageIndex * state.page.pageSize,state.page.totalCount);
if (state.page.pageIndex * state.page.pageSize <= state.page.totalCount) {
debugger
state.page.pageIndex ++;
uni.showLoading({ mask: true });
setTimeout(() => {
fnDataList();
}, 500);
}
}
const fnToUrl = (item : any) => {
toPages('/pages/returnMaterials/material',{id:item.FID,fBillNo:item.FMOBillNO})
}
const debounceTimer = ref()
const changeFun = (e : any) => {
if (debounceTimer.value !== null) clearTimeout(debounceTimer.value)
debounceTimer.value = setTimeout(() => {
state.queryString = e
state.page.pageIndex = 1
state.dataList = []
fnDataList()
}, 500)
}
const fnDataList = () => {
let param = {
queryString: state.queryString,
pageIndex: state.page.pageIndex,
pageSize: state.page.pageSize,
FType:'Return'
};
if (state.page.pageIndex == 1) {
uni.showLoading({ mask: true });
}
PRDPPBOMList(param).then(res => {
uni.hideLoading();
if (res.code == 200) {
let result = res.data;
let dataArray = result.list;
dataArray.forEach(p => {
p.FDateFormat = parseTime(p.FCREATEDATE, '{y}-{m}-{d}');
});
if (state.page.pageIndex == 1) {
state.dataList = dataArray;
}
else {
state.dataList = state.dataList.concat(dataArray);
}
state.page.totalCount = result.total;
if (state.dataList.length == state.page.totalCount) {
// more_status.value = 'nomore';
}
}
});
}
const toPages = (url : string, data : any = {}) => {
uni.$u.route({
url: url,
params: data
})
}
</script>
<style lang="scss">
.app {
background-color: #F5F5F5;
.page {
padding: 18px 32rpx;
display: flex;
flex-direction: column;
height: 100%;
flex: 1;
.input-box {
background-color: white;
box-sizing: border-box;
padding: 0 16rpx;
border-radius: 24rpx;
margin: 0 0 32rpx 0;
.u-textarea {
padding: 0 !important;
font-size: 24rpx !important;
color: #999999 !important;
}
.input-item {
box-sizing: border-box;
padding: 16rpx 0;
color: #222222;
font-size: 28rpx;
font-weight: 400;
.item-title {
//font-weight: 500;
font-size: 32rpx;
color: #333333;
}
.item-text {
font-weight: 400;
font-size: 27rpx;
color: #999999;
}
}
}
.receive-listBox {
flex: 1;
.list-box-list{
width: 100%;
// margin: 20rpx auto;
.data-item{
border: 1px solid #efeaea;
border-radius: 20rpx;
box-shadow: 0rpx 15rpx 15rpx #efeaea;
padding: 20rpx 20rpx 0;
margin-bottom: 20rpx;
background-color: #ffffff;
.tit{
font-size: 30rpx;
font-weight: bold;
padding: 20rpx 0;
}
.line-p{
border: 1px solid #efeaea;
}
.b-font{
font-size: 25rpx;
padding: 20rpx 0;
}
}
}
}
}
}
</style>

View File

@ -0,0 +1,428 @@
<template>
<view class="app status-bar-gap">
<view class="page">
<l-header :title="state.FBillNo" sticky #right>
<view style="margin-right: 32rpx;" @click="dataPushNotification">{{ t('receive.tj') }}</view>
</l-header>
<view class="input-box">
<view class="input-item">
<up-input :placeholder="t('receive.code')" border="none" clearable inputAlign="left"
inputmode="none" v-model="state.queryString" @change="changeFun" ref="inputRef">
<template #prefix>
<up-icon name="scan" color="#2979ff" size="24"></up-icon>
</template>
</up-input>
</view>
</view>
<view class="material-listBox">
<scroll-view id="scroll-box" class="scroll-box" scroll-y="true"
:style="{'height':state.scrollHeight+'px'}">
<view class="list-box-list" v-if="state.dataList.length > 0">
<view class="data-item" v-for="(item, index) in state.dataList"
:style="[{'background-color':interpolation(item)},{'margin-bottom':index + 1 === state.dataList.length ? '80px' : '20px'}]"
:key="index">
<view class="text" style="margin-bottom: 20px;display: flex;">
<view>{{ item.MaterialName }}</view>
</view>
<view class="itemBox">
<view>{{t('receive.djbh')}}</view>
<view class="zongjian"></view>
<view>{{ state.FBillNo }}</view>
</view>
<view class="itemBox">
<view>{{t('receive.wlbm')}}</view>
<view class="zongjian"></view>
<view>{{ item.MaterialNo }}</view>
</view>
<view class="itemBox">
<view>{{t('receive.ph')}}</view>
<view class="zongjian"></view>
<view>{{ item.Lot }}</view>
</view>
<view class="itemBox">
<view>{{t('receive.ys')}}</view>
<view class="zongjian"></view>
<view>{{ item.CheckJoinQty }}</view>
</view>
<view class="itemBox">
<view>{{t('receive.ws')}}</view>
<view class="zongjian"></view>
<view>{{ item.NoCheckQty }}</view>
</view>
<view class="itemBox">
<view>{{t('receive.yss')}}</view>
<view class="zongjian"></view>
<view>{{ item.CheckQty }}</view>
</view>
</view>
<view style="text-align: center;color: #F5F5F5;height: 20px;"></view>
</view>
<view v-if="state.dataList.length==0">
<up-empty mode="list"></up-empty>
</view>
</scroll-view>
</view>
</view>
</view>
<scanFrame ref="scanFrameRef" @confirmation="scanFrameCnfirmation"
@scanFrameDataFeedback="(res:object)=>{state.scanFrameDataFeedback = res}"
@fast="(row:any)=>{state.scanFrameDataFeedback = row}" @err="scanFrameErrFun" />
<shortcut ref="shortcutRef" @dataToscanFrame="dataToscanFrameFun" />
<tools ref="toolsRef" @defaultPopup="defaultPopupFun" @scanRecord="scanRecordFun" />
</template>
<script lang="ts" setup>
import { reactive, nextTick, onMounted, ref, computed, watch } from 'vue';
import { onLoad, onShow, onReachBottom, } from '@dcloudio/uni-app'
import { useI18n } from 'vue-i18n'
import { parseTime } from '../../utils/tools.js';
import { PRDPPBOMPush, PRDPPBOMScanData, PRDPPBOMView, fStockFlexDetailDelete, temporaryScanDraftSave, temporaryScanList } from '../../common/request/api/api';
import scanFrame from '../../components/scan-frame/scan-frame.vue'
import tools from '../../components/tools/tools.vue'
import shortcut from '../../components/tools/shortcut.vue'
import { sqlite } from '../../stores/sqlite'
const DB = sqlite()
const inputRef = ref()
const scanFrameRef = ref()
const shortcutRef = ref()
const getI18n = useI18n()
const { t, locale } = getI18n
const state = reactive({
queryString: '',
dataList: [],
scrollHeight: 0,
page: {
pageIndex: 1,
pageSize: 200,
totalCount: 0
},
FBillNo: '',
BillNo: '',
materialId: '',
supplierName: '',
inputFocus: true,
scanFrameDataFeedback: {},
shortcutDataFeedback: {},
})
onLoad((pageData : any) => {
console.log(pageData);
state.materialId = pageData.id
state.FBillNo = pageData.fBillNo
fnDataList(state.materialId);
})
onShow(() => {
if (state.materialId) {
fnDataList(state.materialId);
}
})
onMounted(() => {
const query = uni.createSelectorQuery().in(this);
query.select(".material-listBox").boundingClientRect((data) => {
state.scrollHeight = data.height
}).exec();
// scanFrameRef.value.stateShow(true)
})
/**
* 数据逻辑
*/
const interpolation = (item : any) => {
if (item.CheckJoinQty === 0 && item.CheckJoinQty + item.NoCheckQty === item.CheckQty) {
return '#ffffff'
}
if (item.CheckJoinQty !== 0 && item.NoCheckQty !== 0 && item.CheckJoinQty + item.NoCheckQty === item.CheckQty) {
return 'rgb(254 227 87)'
}
if (item.CheckJoinQty === item.CheckQty) {
return 'rgb(87 191 254)'
}
}
//
const debounceTimer = ref()
const changeFun = (e : any) => {
if (debounceTimer.value !== null) clearTimeout(debounceTimer.value)
debounceTimer.value = setTimeout(() => {
state.queryString = e
if (state.queryString !== '') getReceiveBillScanData(e)
}, 500)
}
//
const getReceiveBillScanData = (val : string) => {
PRDPPBOMScanData({
FBarCode: val,
FBillNo: state.BillNo,
IsFeed: 'other'
}).then((res : any) => {
if (res.data !== null) {
console.log(res);
const scanData = res.data
if( scanData.UnScanQty > scanData.BarCodeQty ) scanData.UnScanQty = scanData.BarCodeQty
scanFrameRef.value.getreceiveBillScanData({ ...scanData, queryString: state.queryString, scanFrameShowSate: state.shortcutDataFeedback.scanFrameShowSate })
if (Object.keys(state.shortcutDataFeedback).length) {
if (state.shortcutDataFeedback.scanFrameShowSate) {
scanFrameRef.value.stateShow(true)
} else {
postTemporaryScanDraftSaveFun(state.scanFrameDataFeedback)
}
} else {
scanFrameRef.value.stateShow(true)
}
} else {
uni.$u.toast(t('index.bmygtsj'))
state.queryString = ''
}
})
}
//
const scanFrameCnfirmation = (row : any) => {
state.scanFrameDataFeedback = row
postTemporaryScanDraftSaveFun(state.scanFrameDataFeedback)
}
const scanFrameErrFun = () => {
scanFrameRef.value.stateShow(true)
}
//
const postTemporaryScanDraftSaveFun = (item : any) => {
const obj = {};
if (item.warehouseData.FIsOpenLocation && Object.keys(item.locationData).length != 0) {
const key = `FVHUBSTOCKFLEX__FF${item.locationData.FID}`; //Id
obj[key] = { FNumber: item.locationData.FlexEntryId.Number }; //
}
const str = JSON.stringify(obj);
console.log(item);
temporaryScanDraftSave({
FVHUBFormId: "PRD_PPBOM", //
FVHUBFBillNo: state.BillNo, //
FVHUBScanNumber: state.queryString, //
FVHUBMaterialNumber: item.articlesStr, //
FVHUBScanQty: item.quantityStr + '', //
FVHUBEntryId: scanFrameRef.value.state.receiveBillScanData.Id, //ID
FVHUBFlot: item.batchNumberStr, //
FVHUBStock: {
FNUMBER: item.warehouseData.FNUMBER //
},
FVHUBMaterial: {
FNUMBER: item.articlesStr
},
FType: "Return",
...JSON.parse(str),
}).then((res : any) => {
console.log(res);
state.queryString = ''
if (res.data.IsSuccess) {
fnDataList(state.materialId);
uni.$u.toast(t('public.cg'))
scanFrameRef.value.stateShow(false)
}
})
}
//
const dataToscanFrameFun = (res : object) => {
state.shortcutDataFeedback = res
scanFrameRef.value.getComponentsData(res)
shortcutRef.value.stateShow(false)
}
//
const defaultPopupFun = () => {
shortcutRef.value.stateShow(true)
}
const scanRecordFun = () => {
toPages('/pages/records/index', {
FormId: 'PRD_PPBOM',
FbillNo: state.BillNo
})
}
/**
* 数据推送
*/
const dataPushNotification = () => {
uni.showModal({
title: t('public.ts'), content: t('public.tjMessage'), cancelText: t('public.cancel'), confirmText: t('public.confirm'),
success(res) {
if (res.confirm) {
let EntryIds : any = []
let ids : any = []
let ScanEntry : any = []
let param = {
FormId: 'PRD_PPBOM',
UserId: uni.getStorageSync('userInfo').Context.UserId,
FbillNo: state.FBillNo
};
uni.showLoading({ mask: true });
//
temporaryScanList(param).then(res => {
if (res.code == 200) {
if (res.data.list.length != 0) {
res.data.list.forEach((item : any) => {
EntryIds.push(item.FVHUBEntryId)
ids.push(item.FID)
ScanEntry.push({
FENTRYID: item.FVHUBEntryId,
Qty: item.FVHUBScanQty,
Flot: item.FVHUBFlot,
StockId: item.FVHUBStock,
StockFlex: item.FVHUBStockFlex
})
})
//
PRDPPBOMPush({
EntryIds: EntryIds.toString(),
TargetFormId: 'PRD_ReturnMtrl',
IsEnableDefaultRule: 'true',
CustomParams: {
AutoAudit: 'true',
ScanEntry: ScanEntry
}
}).then((res : any) => {
if (res.code === 200) {
fStockFlexDetailDelete({ Ids: ids.toString() }).then((res : any) => {
if (res.code === 200) {
fnDataList(state.materialId);
uni.$u.toast(t('public.cg'))
}
})
}
})
} else {
uni.$u.toast(t('public.noDataMessage'))
}
}
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
}
/**
* 数据请求
*/
const fnDataList = (FBillNo : any, statesItem : boolean = false) => {
let param = {
id: FBillNo,
IsFeed:'other'
};
uni.showLoading({ mask: true });
PRDPPBOMView(param).then(res => {
uni.hideLoading();
if (res.code == 200) {
state.BillNo = res.data.BillNo
state.dataList = []
let dataListArray = res.data.Entry;
if (dataListArray.length > 0) {
dataListArray.forEach((p : any) => {
let item = {
Id: p.Id,
MaterialNo: p.MaterialNumber, //
MaterialName: formatLangTextValue(p.MaterialName), //
Lot: p.FLot_Text, //
CheckQty: p.Qty, //
CheckJoinQty: p.ScanedQty, //
NoCheckQty: p.UnScanQty, //
MultiLanguageText: Object.keys(p.StockId).length ? formatLangTextValue(p.StockId.Name) : ''
};
state.dataList.push(item);
});
}
}
});
}
//
const formatLangTextValue = (val : any) => {
let lang_Id = uni.getStorageSync('locale')
let item = val.find(p => p.Key == (lang_Id == 'cn' ? 2052 : 1033));
if (item != null) {
return item.Value;
}
return val[0].Value;
}
const toPages = (url : string, data : any = {}) => {
uni.$u.route({
url: url,
params: data
})
}
</script>
<style lang="scss">
.app {
background-color: #F5F5F5;
.page {
padding: 18px 32rpx;
display: flex;
flex-direction: column;
height: 100%;
flex: 1;
.input-box {
background-color: white;
box-sizing: border-box;
padding: 0 16rpx;
border-radius: 24rpx;
margin: 0 0 32rpx 0;
.u-textarea {
padding: 0 !important;
font-size: 24rpx !important;
color: #999999 !important;
}
.input-item {
box-sizing: border-box;
padding: 16rpx 0;
color: #222222;
font-size: 28rpx;
font-weight: 400;
.item-title {
//font-weight: 500;
font-size: 32rpx;
color: #333333;
}
.item-text {
font-weight: 400;
font-size: 27rpx;
color: #999999;
}
}
}
.material-listBox {
flex: 1;
.list-box-list {
width: 100%;
.data-item {
border: 1px solid #efeaea;
border-radius: 20rpx;
box-shadow: 0rpx 15rpx 15rpx #efeaea;
padding: 20rpx 22rpx;
margin-bottom: 16rpx;
background-color: #ffffff;
.itemBox {
line-height: 50rpx;
display: flex;
justify-content: space-between;
align-items: center;
.zongjian {
height: 1px;
flex: 1;
background-color: #f0f0f0;
margin: 0 16rpx;
}
}
}
}
}
}
}
</style>

View File

@ -91,6 +91,7 @@
queryString: state.queryString,
pageIndex: state.page.pageIndex,
pageSize: state.page.pageSize,
FType:'Feed'
};
if (state.page.pageIndex == 1) {
uni.showLoading({ mask: true });

View File

@ -6,17 +6,29 @@
</l-header>
<view class="input-box">
<view class="input-item">
<up-input :placeholder="t('receive.code')" border="none" clearable inputAlign="left" inputmode="none"
:focus="state.inputFocus" v-model="state.queryString" @change="changeFun" ref="inputRef">
<up-input :placeholder="t('receive.code')" border="none" clearable inputAlign="left" :focus="state.inputFocus"
v-model="state.queryString" @change="changeFun" ref="inputRef">
<template #prefix>
<up-icon name="scan" color="#2979ff" size="24"></up-icon>
</template>
<template #suffix>
<up-icon name="edit-pen" color="#2979ff" size="24" @click="() => {state.manualShow = !state.manualShow}"></up-icon>
</template>
</up-input>
</view>
</view>
<view class="input-box" v-show="state.manualShow">
<view class="input-item">
<up-input :placeholder="t('receive.code')" border="none" clearable inputAlign="left" :focus="state.inputFocus"
v-model="state.manualQueryString" @confirm="confirmFun" ref="inputRef">
<template #prefix>
<up-icon name="search" color="#2979ff" size="24"></up-icon>
</template>
</up-input>
</view>
</view>
<view class="material-listBox">
<scroll-view id="scroll-box" class="scroll-box" scroll-y="true"
:style="{'height':state.scrollHeight+'px'}">
<scroll-view id="scroll-box" class="scroll-box" scroll-y="true" :style="{'height':state.scrollHeight+'px'}">
<view class="list-box-list" v-if="state.dataList.length > 0">
<view class="data-item" v-for="(item, index) in state.dataList"
:style="[{'background-color':interpolation(item)},{'margin-bottom':index + 1 === state.dataList.length ? '80px' : '20px'}]"
@ -89,6 +101,8 @@
const { t, locale } = getI18n
const state = reactive({
queryString: '',
manualQueryString: '',
manualShow: false,
dataList: [],
scrollHeight: 0,
page: {
@ -97,6 +111,7 @@
totalCount: 0
},
FBillNo: '',
BillNo: '',
materialId: '',
supplierName: '',
inputFocus: true,
@ -145,17 +160,21 @@
if (state.queryString !== '') getReceiveBillScanData(e)
}, 500)
}
const confirmFun = (e:any) => {
getReceiveBillScanData(e)
}
//
const getReceiveBillScanData = (val : string) => {
PRDPPBOMScanData({
FBarCode: val,
FBillNo: state.FBillNo,
FBillNo: state.BillNo,
IsFeed: 'true'
}).then((res : any) => {
if (res.data !== null) {
console.log(res);
const scanData = res.data
if( scanData.UnScanQty > scanData.BarCodeQty ) scanData.UnScanQty = scanData.BarCodeQty
scanFrameRef.value.getreceiveBillScanData({
...res.data,
queryString: state.queryString,
scanFrameShowSate: state.shortcutDataFeedback.scanFrameShowSate,
@ -195,7 +214,7 @@
console.log(item);
temporaryScanDraftSave({
FVHUBFormId: "PRD_PPBOM", //
FVHUBFBillNo: state.FBillNo, //
FVHUBFBillNo: state.BillNo, //
FVHUBScanNumber: state.queryString, //
FVHUBMaterialNumber: item.articlesStr, //
FVHUBScanQty: item.quantityStr + '', //
@ -207,6 +226,7 @@
FVHUBMaterial: {
FNUMBER: item.articlesStr
},
FType: "Feed",
...JSON.parse(str),
}).then((res : any) => {
console.log(res);
@ -231,7 +251,7 @@
const scanRecordFun = () => {
toPages('/pages/records/index', {
FormId: 'PRD_PPBOM',
FbillNo: state.FBillNo
FbillNo: state.BillNo
})
}
/**
@ -305,13 +325,14 @@
*/
const fnDataList = (FBillNo : any, statesItem : boolean = false) => {
let param = {
id: FBillNo,
IsInStock: 'true'
Id: FBillNo,
IsFeed: 'true',
};
uni.showLoading({ mask: true });
PRDPPBOMView(param).then(res => {
uni.hideLoading();
if (res.code == 200) {
state.BillNo = res.data.BillNo
state.dataList = []
let dataListArray = res.data.Entry;
if (dataListArray.length > 0) {

View File

@ -10,7 +10,7 @@
<!-- 根据uni-app的input组件文档H5和APP中只要声明了password参数(无论true还是false)type均失效此时
为了防止type=number时又存在password属性type无效此时需要设置password为undefined
-->
<input ref="input-native" id="myFocusKeeperInput" :inputmode="inputmode"
<input ref="input-native" id="myFocusKeeperInput"
class="u-input__content__field-wrapper__field upinputRef" :style="[inputStyle]" :type="type"
:focus="focus" :cursor="cursor" :value="innerValue" :auto-blur="autoBlur"
:disabled="disabled || readonly" :maxlength="maxlength" :placeholder="placeholder"
@ -115,7 +115,7 @@
// value
changeFromInner: false,
//
innerFormatter: value => value
innerFormatter: value => value,
};
},
created() {

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
{
"version": "1",
"env": {
"compilerVersion": "4.54.2025030608-alpha"
"compilerVersion": "4.63.2025042307-alpha"
},
"files": {
"utssdk/app-android/TransparentActivity.uts": {

View File

@ -0,0 +1,38 @@
{
"version": "1",
"env": {
"compilerVersion": "4.63.2025042307-alpha"
},
"files": {
"utssdk/app-android/TransparentActivity.uts": {
"md5": "d41530560fe13e9934cc3b1fb73c9890"
},
"utssdk/app-android/callbacks.uts": {
"md5": "348b1166fafde03d77d31c708ffeca5f"
},
"utssdk/app-android/constant.uts": {
"md5": "9e03e42b19d59d8ed16f3df814dbba74"
},
"utssdk/app-android/index.uts": {
"md5": "d3752bb6c002b2da6377f0e8a215f91a"
},
"utssdk/interface.uts": {
"md5": "ff87bca6142d3990b5057f452ea3f2b4"
},
"utssdk/unierror.uts": {
"md5": "d41d8cd98f00b204e9800998ecf8427e"
},
"package.json": {
"md5": "3cdbb2337594f0c0315d1fa20a739617"
},
"utssdk/app-android/AndroidManifest.xml": {
"md5": "80263498d2ad55cb954e347c7c933e65"
},
"utssdk/app-android/config.json": {
"md5": "d903d6c89479ad424282bba97dff94ef"
},
"utssdk/app-android/res/values/notification_progress_styles.xml": {
"md5": "6fa2d7ac4d16a31ee5251cfb34bacd41"
}
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
.multi-line-omit[data-v-401afd0e]{word-break:break-all;text-overflow:ellipsis;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.one-line-omit[data-v-401afd0e]{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.content[data-v-401afd0e]{display:flex;flex-direction:column;align-items:center;justify-content:center}.inputsty[data-v-401afd0e]{border:1px solid #000000;margin-top:50vh}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
body{background:transparent}.flex-center{display:flex;justify-content:center;align-items:center}.mask{position:fixed;left:0;top:0;right:0;bottom:0;background-color:rgba(0,0,0,.65)}.botton-radius{border-bottom-left-radius:.9375rem;border-bottom-right-radius:.9375rem}.content{position:relative;top:0;width:18.75rem;background-color:#fff;box-sizing:border-box;padding:0 1.5625rem;font-family:Source Han Sans CN}.text{display:block;line-height:200px;text-align:center;color:#fff}.content-top{position:absolute;top:-6.09375rem;left:0;width:18.75rem;height:8.4375rem}.content-top-text{font-size:1.40625rem;font-weight:700;color:#f8f8fa;position:absolute;top:3.75rem;left:1.5625rem;z-index:1}.content-header{height:2.1875rem}.title{font-size:1.03125rem;font-weight:700;color:#3da7ff;display:flex;align-items:center}.content-body-version{color:#fff;font-size:12px;margin-left:5px;padding:2px 6px;border-radius:4px;display:flex;background:#50aefd}.footer{height:4.6875rem;display:flex;align-items:center;justify-content:space-around}.box-des-scroll{box-sizing:border-box;height:6.25rem;text-align:left}.box-des{font-size:.8125rem;color:#000;line-height:1.5625rem}.progress-box{width:100%}.progress{width:90%;height:1.25rem}.close-img{width:2.1875rem;height:2.1875rem;z-index:1000;position:absolute;bottom:-3.75rem;left:calc(50% - 1.09375rem)}.content-button{text-align:center;flex:1;font-size:.9375rem;font-weight:400;color:#fff;border-radius:1.25rem;margin:0 .5625rem;height:2.5rem;line-height:2.5rem;background:linear-gradient(to right,#1785ff,#3da7ff)}.flex-column{display:flex;flex-direction:column;align-items:center}

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"
package="uts.sdk.modules.utsProgressNotification">
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<application>
<activity android:name="uts.sdk.modules.utsProgressNotification.TransparentActivity"
android:theme="@style/DCNotificationProgressTranslucentTheme" android:hardwareAccelerated="true"
android:screenOrientation="user" android:exported="true">
</activity>
</application>
</manifest>

View File

@ -0,0 +1,3 @@
{
"minSdkVersion": "19"
}

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="DCNotificationProgressTranslucentTheme">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowAnimationStyle">@android:style/Animation</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowContentOverlay">@null</item>
</style>
</resources>

View File

@ -0,0 +1,255 @@
@file:Suppress("UNCHECKED_CAST", "USELESS_CAST", "INAPPLICABLE_JVM_NAME", "UNUSED_ANONYMOUS_PARAMETER", "NAME_SHADOWING", "UNNECESSARY_NOT_NULL_ASSERTION")
package uts.sdk.modules.utsProgressNotification
import android.app.Activity
import android.app.Notification
import android.app.NotificationChannel
import android.app.NotificationManager
import android.app.PendingIntent
import android.content.ComponentName
import android.content.Context
import android.content.Intent
import android.graphics.Color
import android.os.Build
import android.os.Bundle
import android.view.View
import android.view.WindowManager
import io.dcloud.uniapp.*
import io.dcloud.uniapp.extapi.*
import io.dcloud.uts.*
import io.dcloud.uts.Map
import io.dcloud.uts.Set
import io.dcloud.uts.UTSAndroid
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Deferred
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async
import uts.sdk.modules.utsProgressNotification.R
open class CreateNotificationProgressOptions (
open var title: String? = null,
@JsonNotNull
open var content: String,
@JsonNotNull
open var progress: Number,
open var onClick: (() -> Unit)? = null,
) : UTSObject()
open class FinishNotificationProgressOptions (
open var title: String? = null,
@JsonNotNull
open var content: String,
open var onClick: () -> Unit,
) : UTSObject()
val ACTION_DOWNLOAD_FINISH = "ACTION_DOWNLOAD_FINISH"
val ACTION_DOWNLOAD_PROGRESS = "ACTION_DOWNLOAD_PROGRESS"
@JvmField
var globalNotificationProgressCallBack: (() -> Unit)? = fun(){}
@JvmField
var globalNotificationProgressFinishCallBack: (() -> Unit)? = fun(){}
fun setGlobalNotificationProgressCallBack(callBack: (() -> Unit)?): Unit {
globalNotificationProgressCallBack = callBack
}
fun getGlobalNotificationProgressCallBack(): (() -> Unit)? {
return globalNotificationProgressCallBack
}
fun setGlobalNotificationProgressFinishCallBack(callBack: (() -> Unit)?): Unit {
globalNotificationProgressFinishCallBack = callBack
}
fun getGlobalNotificationProgressFinishCallBack(): (() -> Unit)? {
return globalNotificationProgressFinishCallBack
}
open class TransparentActivity : Activity {
constructor() : super() {}
@Suppress("DEPRECATION")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
this.fullScreen(this)
val action = this.getIntent().getAction()
if (action == ACTION_DOWNLOAD_FINISH) {
setTimeout(fun(){
getGlobalNotificationProgressFinishCallBack()?.invoke()
setGlobalNotificationProgressFinishCallBack(fun(){})
}
, 100)
this.overridePendingTransition(0, 0)
}
if (action == ACTION_DOWNLOAD_PROGRESS) {
setTimeout(fun(){
getGlobalNotificationProgressCallBack()?.invoke()
setGlobalNotificationProgressCallBack(fun(){})
}
, 100)
this.overridePendingTransition(0, 0)
}
setTimeout(fun(){
this.finish()
}
, 20)
}
@Suppress("DEPRECATION")
private fun fullScreen(activity: Activity) {
if (Build.VERSION.SDK_INT >= 19) {
if (Build.VERSION.SDK_INT >= 21) {
val window = activity.getWindow()
val decorView = window.getDecorView()
val option = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View.SYSTEM_UI_FLAG_LAYOUT_STABLE
decorView.setSystemUiVisibility(option)
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
window.setStatusBarColor(Color.TRANSPARENT)
} else {
val window = activity.getWindow()
val attributes = window.getAttributes()
val flagTranslucentStatus = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS
attributes.flags = attributes.flags or flagTranslucentStatus
window.setAttributes(attributes)
}
}
}
}
val DOWNLOAD_PROGRESS_NOTIFICATION_ID: Int = 7890
val DC_DOWNLOAD_CHANNEL_ID = "下载文件"
val DC_DOWNLOAD_CHANNEL_NAME = "用于显示现在进度的渠道"
var notificationBuilder: Notification.Builder? = null
var timeId: Number = -1
var histroyProgress: Number = 0
var isProgress = false
fun createNotificationProgress(options: CreateNotificationProgressOptions): Unit {
val content = options.content
val progress = options.progress
val onClick = options.onClick
if (progress == 100) {
clearTimeout(timeId)
val context = UTSAndroid.getAppContext() as Context
realCreateNotificationProgress(options.title ?: getAppName(context), content, progress, onClick)
reset()
return
}
histroyProgress = progress
if (timeId != -1) {
return
}
val context = UTSAndroid.getAppContext() as Context
if (!isProgress) {
realCreateNotificationProgress(options.title ?: getAppName(context), content, histroyProgress, onClick)
isProgress = true
} else {
timeId = setTimeout(fun(){
realCreateNotificationProgress(options.title ?: getAppName(context), content, histroyProgress, onClick)
timeId = -1
}
, 1000)
}
}
fun cancelNotificationProgress(): Unit {
val context = UTSAndroid.getAppContext() as Context
val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
notificationManager.cancel(DOWNLOAD_PROGRESS_NOTIFICATION_ID)
reset()
}
fun realCreateNotificationProgress(title: String, content: String, progress: Number, cb: (() -> Unit)?): Unit {
setGlobalNotificationProgressCallBack(cb)
val context = UTSAndroid.getAppContext() as Context
val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
createDownloadChannel(notificationManager)
val builder = createNotificationBuilder(context)
builder.setProgress(100, progress.toInt(), false)
builder.setContentTitle(title)
builder.setContentText(content)
builder.setContentIntent(createPendingIntent(context, ACTION_DOWNLOAD_PROGRESS))
notificationManager.notify(DOWNLOAD_PROGRESS_NOTIFICATION_ID, builder.build())
}
fun finishNotificationProgress(options: FinishNotificationProgressOptions) {
setGlobalNotificationProgressFinishCallBack(options.onClick)
val context = UTSAndroid.getAppContext() as Context
val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
createDownloadChannel(notificationManager)
val builder = createNotificationBuilder(context)
builder.setProgress(0, 0, false)
builder.setContentTitle(options.title ?: getAppName(context))
builder.setContentText(options.content)
builder.setAutoCancel(true)
builder.setContentIntent(createPendingIntent(context, ACTION_DOWNLOAD_FINISH))
notificationManager.notify(DOWNLOAD_PROGRESS_NOTIFICATION_ID, builder.build())
reset()
}
fun reset() {
isProgress = false
notificationBuilder = null
histroyProgress = 0
if (timeId != -1) {
clearTimeout(timeId)
timeId = -1
}
}
fun createPendingIntent(context: Context, action: String): PendingIntent {
val intent = Intent(action)
intent.setComponent(ComponentName(context.getPackageName(), "uts.sdk.modules.utsProgressNotification.TransparentActivity"))
var flags = PendingIntent.FLAG_UPDATE_CURRENT
if (Build.VERSION.SDK_INT >= 23) {
flags = PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
}
return PendingIntent.getActivity(context, DOWNLOAD_PROGRESS_NOTIFICATION_ID, intent, flags)
}
fun createDownloadChannel(notificationManager: NotificationManager) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val channel = NotificationChannel(DC_DOWNLOAD_CHANNEL_ID, DC_DOWNLOAD_CHANNEL_NAME, NotificationManager.IMPORTANCE_LOW)
notificationManager.createNotificationChannel(channel)
}
}
@Suppress("DEPRECATION")
fun createNotificationBuilder(context: Context): Notification.Builder {
if (notificationBuilder == null) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
notificationBuilder = Notification.Builder(context, DC_DOWNLOAD_CHANNEL_ID)
} else {
notificationBuilder = Notification.Builder(context)
}
notificationBuilder!!.setSmallIcon(context.getApplicationInfo().icon)
notificationBuilder!!.setOngoing(true)
notificationBuilder!!.setSound(null)
}
return notificationBuilder!!
}
@Suppress("DEPRECATION")
fun getAppName(context: Context): String {
var appName = ""
try {
val packageManager = context.getPackageManager()
val applicationInfo = packageManager.getApplicationInfo(context.getPackageName(), 0)
appName = packageManager.getApplicationLabel(applicationInfo) as String
}
catch (e: Exception) {
e.printStackTrace()
}
return appName
}
open class CreateNotificationProgressOptionsJSONObject : UTSJSONObject() {
open var title: String? = null
open lateinit var content: String
open lateinit var progress: Number
open var onClick: UTSCallback? = null
}
open class FinishNotificationProgressOptionsJSONObject : UTSJSONObject() {
open var title: String? = null
open lateinit var content: String
open lateinit var onClick: UTSCallback
}
open class TransparentActivityByJs : TransparentActivity {
constructor() : super() {}
open fun onCreateByJs(savedInstanceState: Bundle?) {
return this.onCreate(savedInstanceState)
}
}
fun createNotificationProgressByJs(options: CreateNotificationProgressOptionsJSONObject): Unit {
return createNotificationProgress(CreateNotificationProgressOptions(title = options.title, content = options.content, progress = options.progress, onClick = fun(): Unit {
options.onClick?.invoke()
}
))
}
fun cancelNotificationProgressByJs(): Unit {
return cancelNotificationProgress()
}
fun finishNotificationProgressByJs(options: FinishNotificationProgressOptionsJSONObject) {
return finishNotificationProgress(FinishNotificationProgressOptions(title = options.title, content = options.content, onClick = fun(): Unit {
options.onClick()
}
))
}

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -212,7 +212,7 @@
"uni-app": {
"control": "uni-v3",
"vueVersion": "3",
"compilerVersion": "4.54",
"compilerVersion": "4.63",
"nvueCompiler": "uni-app",
"renderer": "auto",
"nvue": {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

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