剩余模块:生产退料
This commit is contained in:
parent
b1d8dec263
commit
eb2c8d2d7a
@ -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 BarcodePackBillScanData = async (data: object) => requst('/api/BarcodePackBill/ScanData', 'get', {...data})
|
||||||
//保存
|
//保存
|
||||||
export const BarcodePackBillSave = async (data: object) => requst('/api/BarcodePackBill/Save', 'post', {...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 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 PRDPPBOMView = async (data: object) => requst('/api/PRD_PPBOM/View', 'get', {...data})
|
||||||
export const PRDPPBOMScanData = async (data: object) => requst('/api/PRD_PPBOM/ScanData', '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 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 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 stockList = async (data: object) => requst('/api/Stock/List', 'get', {...data})
|
||||||
export const stockView = async (data: object) => requst('/api/Stock/View', 'get', {...data})
|
export const stockView = async (data: object) => requst('/api/Stock/View', 'get', {...data})
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import env from './env';
|
import env from './env';
|
||||||
// import uniChat from "./uniChat";
|
// 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
|
// #ifndef APP-PLUS
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
mask: true
|
mask: true
|
||||||
@ -10,6 +10,7 @@ export default function requst(url : string, type : string, params : any, header
|
|||||||
plus.nativeUI.showWaiting();
|
plus.nativeUI.showWaiting();
|
||||||
// #endif
|
// #endif
|
||||||
console.log('检查URL' + env.API_URL + url,)
|
console.log('检查URL' + env.API_URL + url,)
|
||||||
|
console.log('检查TOKEN' + 'Bearer '+ uni.getStorageSync('TOKEN'),)
|
||||||
console.log(params);
|
console.log(params);
|
||||||
var apiHeader = ''
|
var apiHeader = ''
|
||||||
var headerObj = {}
|
var headerObj = {}
|
||||||
@ -37,10 +38,8 @@ export default function requst(url : string, type : string, params : any, header
|
|||||||
console.log(result);
|
console.log(result);
|
||||||
let res = result.data;
|
let res = result.data;
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
console.log('请求成功')
|
|
||||||
resolve(res);
|
resolve(res);
|
||||||
} else if (res.code == 401) {
|
} else if (res.code == 401) {
|
||||||
console.log('请求失败')
|
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
plus.nativeUI.toast('登录状态失效,请重新登录');
|
plus.nativeUI.toast('登录状态失效,请重新登录');
|
||||||
// #endif
|
// #endif
|
||||||
@ -56,13 +55,15 @@ export default function requst(url : string, type : string, params : any, header
|
|||||||
// tools.jumpTo('/pages/client/account/login', {}, 0)
|
// tools.jumpTo('/pages/client/account/login', {}, 0)
|
||||||
resolve(res)
|
resolve(res)
|
||||||
} else {
|
} else {
|
||||||
setTimeout(() => {
|
if(!noMsg){
|
||||||
uni.showToast({
|
setTimeout(() => {
|
||||||
icon: 'none',
|
uni.showToast({
|
||||||
mask: true,
|
icon: 'none',
|
||||||
title: res.msg
|
mask: true,
|
||||||
|
title: res.msg
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
}
|
||||||
resolve(res)
|
resolve(res)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
746
components/fui-input/fui-input.vue
Normal file
746
components/fui-input/fui-input.vue
Normal 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: () => ({})
|
||||||
|
},
|
||||||
|
//兼容写法,type为text时也做Number处理,NaN时返回原值
|
||||||
|
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>
|
@ -17,9 +17,16 @@
|
|||||||
<slot name="right"></slot>
|
<slot name="right"></slot>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<up-popup :show="state.show" mode="top" :safeAreaInsetTop="true">
|
||||||
|
<view>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</up-popup>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import { reactive, defineProps } from 'vue';
|
||||||
|
|
||||||
// #ifdef APP-NVUE
|
// #ifdef APP-NVUE
|
||||||
const domModule = uni.requireNativePlugin('dom')
|
const domModule = uni.requireNativePlugin('dom')
|
||||||
domModule.addRule('fontFace', {
|
domModule.addRule('fontFace', {
|
||||||
@ -48,10 +55,13 @@
|
|||||||
default: 0
|
default: 0
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
const state = reactive({
|
||||||
|
show: false
|
||||||
|
})
|
||||||
//页面回调
|
//页面回调
|
||||||
function pageBack() {
|
function pageBack() {
|
||||||
let pages = getCurrentPages();
|
let pages = getCurrentPages();
|
||||||
console.log(pages)
|
console.log(pages)
|
||||||
if (pages.length === 1) {
|
if (pages.length === 1) {
|
||||||
uni.switchTab({ url: '/pages/main/home' })
|
uni.switchTab({ url: '/pages/main/home' })
|
||||||
} else {
|
} else {
|
||||||
|
@ -186,20 +186,22 @@
|
|||||||
|
|
||||||
//仓库校验
|
//仓库校验
|
||||||
if (Object.keys(state.warehouseData).length !== 0 && Object.keys(state.receiveBillScanData.StockId).length !== 0) {
|
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) {
|
if (state.receiveBillScanData.StockId.Number !== state.warehouseData.FNUMBER) {
|
||||||
uni.showModal({
|
// uni.showModal({
|
||||||
title: t('index.ts'), content: t('index.ymrckbt'), cancelText: t('index.qx'), confirmText: t('index.qd'),
|
// title: t('index.ts'), content: t('index.ymrckbt'), cancelText: t('index.qx'), confirmText: t('index.qd'),
|
||||||
success(res) {
|
// success(res) {
|
||||||
if (res.confirm) {
|
// if (res.confirm) {
|
||||||
state.scanFrame.warehouseStr = formatLangTextValue(state.receiveBillScanData.StockId.Name)
|
// state.scanFrame.warehouseStr = formatLangTextValue(state.receiveBillScanData.StockId.Name)
|
||||||
state.warehouseData = state.receiveBillScanData.StockId.MultiLanguageText
|
// state.warehouseData = state.receiveBillScanData.StockId
|
||||||
} else if (res.cancel) {
|
// } else if (res.cancel) {
|
||||||
console.log('用户点击取消');
|
// console.log('用户点击取消');
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
}
|
||||||
} else if (Object.keys(state.warehouseData).length == 0 && Object.keys(state.receiveBillScanData.StockId).length !== 0) {
|
} 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.scanFrame.warehouseStr = formatLangTextValue(state.receiveBillScanData.StockId.Name)
|
||||||
state.warehouseData = {
|
state.warehouseData = {
|
||||||
FIsOpenLocation: state.receiveBillScanData.StockId.IsOpenLocation,
|
FIsOpenLocation: state.receiveBillScanData.StockId.IsOpenLocation,
|
||||||
@ -244,11 +246,11 @@
|
|||||||
|
|
||||||
//反馈数据校验
|
//反馈数据校验
|
||||||
const dataVerifyFun = () => {
|
const dataVerifyFun = () => {
|
||||||
if (state.quantityStrState) {
|
// if (state.quantityStrState) {
|
||||||
uni.$u.toast('请检查您的数量')
|
// uni.$u.toast('请检查您的数量')
|
||||||
eimts('err')
|
// eimts('err')
|
||||||
return false
|
// return false
|
||||||
}
|
// }
|
||||||
if (state.receiveBillScanData.stashVerify) {
|
if (state.receiveBillScanData.stashVerify) {
|
||||||
if (state.scanFrame.warehouseStr == '') {
|
if (state.scanFrame.warehouseStr == '') {
|
||||||
uni.$u.toast(t('index.gmkxyzdck'))
|
uni.$u.toast(t('index.gmkxyzdck'))
|
||||||
|
@ -15,6 +15,7 @@ export const cn = {
|
|||||||
'cgrk': '采购入库',
|
'cgrk': '采购入库',
|
||||||
'scfl': '生产发料',
|
'scfl': '生产发料',
|
||||||
'scbl': '生产补料',
|
'scbl': '生产补料',
|
||||||
|
'sctl': '生产退料',
|
||||||
'sctc': '生产投产',
|
'sctc': '生产投产',
|
||||||
'scrk': '生产入库',
|
'scrk': '生产入库',
|
||||||
'sczx': '生产装箱',
|
'sczx': '生产装箱',
|
||||||
@ -146,6 +147,7 @@ export const cn = {
|
|||||||
'whqdlyqx':'未获取到蓝牙权限',
|
'whqdlyqx':'未获取到蓝牙权限',
|
||||||
'ljcg':'连接成功',
|
'ljcg':'连接成功',
|
||||||
'ljsb':'连接失败',
|
'ljsb':'连接失败',
|
||||||
'cjbqsb':'创建标签失败'
|
'cjbqsb':'创建标签失败',
|
||||||
|
'ljydk':'连接已断开,请重新连接'
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -15,6 +15,7 @@ export const en = {
|
|||||||
'cgrk': 'Good Receipt',
|
'cgrk': 'Good Receipt',
|
||||||
'scfl': 'Picking List',
|
'scfl': 'Picking List',
|
||||||
'scbl': 'Replenishment',
|
'scbl': 'Replenishment',
|
||||||
|
'sctl': 'Production Return',
|
||||||
'sctc': 'Production',
|
'sctc': 'Production',
|
||||||
'scrk': 'MO Receipt',
|
'scrk': 'MO Receipt',
|
||||||
'sczx': 'MO Packing',
|
'sczx': 'MO Packing',
|
||||||
@ -146,6 +147,7 @@ export const en = {
|
|||||||
'whqdlyqx':'Bluethooth is not connected',
|
'whqdlyqx':'Bluethooth is not connected',
|
||||||
'ljcg':'connection is successful.',
|
'ljcg':'connection is successful.',
|
||||||
'ljsb':'connection failed.',
|
'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.'
|
||||||
}
|
}
|
||||||
}
|
}
|
43
package.json
43
package.json
@ -1,25 +1,20 @@
|
|||||||
{
|
{
|
||||||
"id": "vcode-input",
|
"id": "fui-input",
|
||||||
"name": "验证码输入框",
|
"name": "Input 输入框(fui-input)",
|
||||||
"version": "2.0",
|
"version": "v2.3.0",
|
||||||
"description": "验证码输入框,密码输入框",
|
"description": "FirstUI Input 输入框,该组件是对原生input组件的增强,内置了常用布局样式,同时包含 input 所有功能。",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"验证码输入框",
|
"Input",
|
||||||
"支付密码输入框"
|
"输入框",
|
||||||
],
|
"fui-input",
|
||||||
"displayName": "验证码输入框",
|
"FirstUI",
|
||||||
"dcloudext": {
|
"Nvue"
|
||||||
"category": [
|
],
|
||||||
"前端组件",
|
"dcloudext": {
|
||||||
"通用组件"
|
"category": [
|
||||||
]
|
"前端组件",
|
||||||
},
|
"通用组件"
|
||||||
"dependencies": {
|
]
|
||||||
"@alipay/ams-checkout": "^1.9.0",
|
},
|
||||||
"@tencentcloud/chat": "^3.2.3",
|
"displayName": "Input 输入框(fui-input)"
|
||||||
"dayjs": "^1.11.10",
|
}
|
||||||
"tim-profanity-filter-plugin": "^1.1.0",
|
|
||||||
"tim-upload-plugin": "^1.3.0",
|
|
||||||
"vue-qr": "^4.0.9"
|
|
||||||
}
|
|
||||||
}
|
|
@ -57,6 +57,12 @@
|
|||||||
{
|
{
|
||||||
"path": "pages/supplement/material"
|
"path": "pages/supplement/material"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/returnMaterials/index"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/returnMaterials/material"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/ruleClaim/index"
|
"path": "pages/ruleClaim/index"
|
||||||
},
|
},
|
||||||
|
@ -15,8 +15,8 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="receive-listBox" ref="listBoxRef">
|
<view class="receive-listBox" ref="listBoxRef">
|
||||||
<scroll-view id="scroll-box" class="scroll-box" scroll-y="true"
|
<scroll-view id="scroll-box" class="scroll-box" scroll-y="true" :style="{'height':state.scrollHeight+'px'}"
|
||||||
:style="{'height':state.scrollHeight+'px'}" @scrolltolower="fnScrollBottom()">
|
@scrolltolower="fnScrollBottom()">
|
||||||
<view class="list-box-list" v-if="state.dataList.length > 0">
|
<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="data-item" v-for="(item, index) in state.dataList" :key="index" @click="toPrintFun(item)">
|
||||||
<view class="tit">{{ t('index.zxddh') }}:{{item.FBillNo}}</view>
|
<view class="tit">{{ t('index.zxddh') }}:{{item.FBillNo}}</view>
|
||||||
@ -24,7 +24,7 @@
|
|||||||
<view class="b-font">{{ t('receive.rq') }}:{{item.FDateFormat}}</view>
|
<view class="b-font">{{ t('receive.rq') }}:{{item.FDateFormat}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="state.dataList.length==0">
|
<view v-if="state.dataList.length==0">
|
||||||
<up-empty mode="list"></up-empty>
|
<up-empty mode="list"></up-empty>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
@ -54,19 +54,19 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
|
fnDataList()
|
||||||
})
|
})
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
const query = uni.createSelectorQuery().in(this);
|
const query = uni.createSelectorQuery().in(this);
|
||||||
query.select(".receive-listBox").boundingClientRect((data:any) => {
|
query.select(".receive-listBox").boundingClientRect((data : any) => {
|
||||||
state.scrollHeight = data.height
|
state.scrollHeight = data.height
|
||||||
}).exec();
|
}).exec();
|
||||||
fnDataList()
|
fnDataList()
|
||||||
})
|
})
|
||||||
const fnScrollBottom = () => {
|
const fnScrollBottom = () => {
|
||||||
console.log(state.page.pageIndex * state.page.pageSize,state.page.totalCount);
|
console.log(state.page.pageIndex * state.page.pageSize, state.page.totalCount);
|
||||||
if (state.page.pageIndex * state.page.pageSize <= state.page.totalCount) {
|
if (state.page.pageIndex * state.page.pageSize <= state.page.totalCount) {
|
||||||
state.page.pageIndex ++;
|
state.page.pageIndex++;
|
||||||
uni.showLoading({ mask: true });
|
uni.showLoading({ mask: true });
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
fnDataList();
|
fnDataList();
|
||||||
@ -76,9 +76,9 @@
|
|||||||
const fnToUrl = () => {
|
const fnToUrl = () => {
|
||||||
toPages('/pages/encasement/material')
|
toPages('/pages/encasement/material')
|
||||||
}
|
}
|
||||||
const toPrintFun = (row:any) => {
|
const toPrintFun = (row : any) => {
|
||||||
console.log(row);
|
console.log(row);
|
||||||
toPages('/pages/encasement/print',{...row})
|
toPages('/pages/encasement/print', { ...row })
|
||||||
}
|
}
|
||||||
const debounceTimer = ref()
|
const debounceTimer = ref()
|
||||||
const changeFun = (e : any) => {
|
const changeFun = (e : any) => {
|
||||||
@ -171,25 +171,29 @@
|
|||||||
.receive-listBox {
|
.receive-listBox {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|
||||||
.list-box-list{
|
.list-box-list {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
// margin: 20rpx auto;
|
// margin: 20rpx auto;
|
||||||
.data-item{
|
.data-item {
|
||||||
border: 1px solid #efeaea;
|
border: 1px solid #efeaea;
|
||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
box-shadow: 0rpx 15rpx 15rpx #efeaea;
|
box-shadow: 0rpx 15rpx 15rpx #efeaea;
|
||||||
padding: 20rpx 20rpx 0;
|
padding: 20rpx 20rpx 0;
|
||||||
margin-bottom: 20rpx;
|
margin-bottom: 20rpx;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
.tit{
|
|
||||||
|
.tit {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
padding: 20rpx 0;
|
padding: 20rpx 0;
|
||||||
}
|
}
|
||||||
.line-p{
|
|
||||||
|
.line-p {
|
||||||
border: 1px solid #efeaea;
|
border: 1px solid #efeaea;
|
||||||
}
|
}
|
||||||
.b-font{
|
|
||||||
|
.b-font {
|
||||||
font-size: 25rpx;
|
font-size: 25rpx;
|
||||||
padding: 20rpx 0;
|
padding: 20rpx 0;
|
||||||
}
|
}
|
||||||
@ -198,5 +202,4 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
@ -44,9 +44,9 @@
|
|||||||
<view>{{ item['FVHUBStock.FName'] }}</view>
|
<view>{{ item['FVHUBStock.FName'] }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="itemBox">
|
<view class="itemBox">
|
||||||
<view>{{ t('receive.ph') }}</view>
|
<view>{{ t('public.xxh') }}</view>
|
||||||
<view class="zongjian"></view>
|
<view class="zongjian"></view>
|
||||||
<view>{{ item.FVHUBFlot }}</view>
|
<view>{{ item.FVHUBJSON }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</uni-swipe-action-item>
|
</uni-swipe-action-item>
|
||||||
@ -142,6 +142,7 @@
|
|||||||
FVHUBScanQty: item.BarCodeQty + '', //扫描数量
|
FVHUBScanQty: item.BarCodeQty + '', //扫描数量
|
||||||
FVHUBEntryId: item.Id, //行ID
|
FVHUBEntryId: item.Id, //行ID
|
||||||
FVHUBFlot: item.FLot_Text, //批号
|
FVHUBFlot: item.FLot_Text, //批号
|
||||||
|
FVHUBJSON:item.MaxcessSNo, //序列号
|
||||||
FVHUBStock: {
|
FVHUBStock: {
|
||||||
FNUMBER: item.StockId.Number //仓库编号
|
FNUMBER: item.StockId.Number //仓库编号
|
||||||
},
|
},
|
||||||
@ -151,10 +152,15 @@
|
|||||||
}).then((res : any) => {
|
}).then((res : any) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
state.queryString = ''
|
state.queryString = ''
|
||||||
if (res.data.IsSuccess) {
|
if(res.code === 200) {
|
||||||
fnDataList();
|
if (res.data.IsSuccess) {
|
||||||
uni.$u.toast(t('public.cg'))
|
fnDataList();
|
||||||
|
uni.$u.toast(t('public.cg'))
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
uni.$u.toast(res.msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//删除数据
|
//删除数据
|
||||||
@ -210,15 +216,18 @@
|
|||||||
if (FDRes.code === 200) {
|
if (FDRes.code === 200) {
|
||||||
fnDataList();
|
fnDataList();
|
||||||
uni.$u.toast(t('public.cg'))
|
uni.$u.toast(t('public.cg'))
|
||||||
|
console.log('===================================================',BPRes.data.SuccessEntitys);
|
||||||
|
toPages('/pages/encasement/print',{
|
||||||
|
type:'Arr',
|
||||||
|
list:JSON.stringify(BPRes.data.SuccessEntitys)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
uni.$u.toast(t('public.noDataMessage'))
|
uni.$u.toast(t('public.noDataMessage'))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive, nextTick, onMounted, ref, computed, watch } from 'vue';
|
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 tkiQrcode from '@/components/tki-qrcode/tki-qrcode.vue'
|
||||||
import { PRD_MOEnterIntoPro, UHIK_BD_BarCodeMainFileSave, getPrintData } from '../../common/request/api/api';
|
import { PRD_MOEnterIntoPro, UHIK_BD_BarCodeMainFileSave, getPrintData } from '../../common/request/api/api';
|
||||||
import { timeFormat } from '@/uni_modules/uview-plus';
|
import { timeFormat } from '@/uni_modules/uview-plus';
|
||||||
@ -58,12 +58,20 @@
|
|||||||
},
|
},
|
||||||
bluetoothList: [],
|
bluetoothList: [],
|
||||||
sendData: '',
|
sendData: '',
|
||||||
printDataList:[]
|
printDataList: []
|
||||||
})
|
})
|
||||||
onLoad((pageData : any) => {
|
onLoad((pageData : any) => {
|
||||||
state.pageData = pageData
|
if(pageData.type === 'Arr'){
|
||||||
console.log(pageData);
|
state.pageData.FBillNo = JSON.parse(pageData.list)[0].Number
|
||||||
getPrintDataFun()
|
console.log('========================================',state.pageData);
|
||||||
|
console.log('========================================',JSON.parse(pageData.list));
|
||||||
|
getPrintDataFun()
|
||||||
|
} else {
|
||||||
|
state.pageData = pageData
|
||||||
|
console.log(pageData);
|
||||||
|
getPrintDataFun()
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
uni.getLocation({
|
uni.getLocation({
|
||||||
@ -71,24 +79,40 @@
|
|||||||
success(res) {
|
success(res) {
|
||||||
console.log('开启定位权限', res)
|
console.log('开启定位权限', res)
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
|
||||||
// uni.showToast({
|
|
||||||
// title: '请先打开定位功能:' + err,
|
|
||||||
// duration: 1500
|
|
||||||
// });
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
hasPermission()
|
hasPermission()
|
||||||
// #endif
|
// #endif
|
||||||
})
|
})
|
||||||
const getPrintDataFun = () => {
|
const getPrintDataFun = () => {
|
||||||
getPrintData({queryString:state.pageData.FBillNo}).then((res:any) => {
|
getPrintData({ queryString: state.pageData.FBillNo }).then((res : any) => {
|
||||||
state.printDataList = res.data
|
state.printDataList = res.data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//获取蓝牙权限并打开蓝牙
|
//获取蓝牙权限并打开蓝牙
|
||||||
const hasPermission = () => {
|
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) => {
|
blueModule.hasPermission((res : any) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
blueModule.isOpen((isOpenRes : any) => {
|
blueModule.isOpen((isOpenRes : any) => {
|
||||||
@ -97,7 +121,7 @@
|
|||||||
state.printingMachine.name = uni.getStorageSync('printInfo').name
|
state.printingMachine.name = uni.getStorageSync('printInfo').name
|
||||||
state.printingMachine.address = uni.getStorageSync('printInfo').address
|
state.printingMachine.address = uni.getStorageSync('printInfo').address
|
||||||
} else {
|
} else {
|
||||||
uni.setStorageSync('printInfo',{})
|
uni.setStorageSync('printInfo', {})
|
||||||
state.printingMachine.name = ''
|
state.printingMachine.name = ''
|
||||||
state.printingMachine.address = ''
|
state.printingMachine.address = ''
|
||||||
blueModule.openBT((openBTRes : any) => {
|
blueModule.openBT((openBTRes : any) => {
|
||||||
@ -129,6 +153,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getAddressFun = (row : any) => {
|
const getAddressFun = (row : any) => {
|
||||||
|
blueModule.disconnectAll((ret) => {
|
||||||
|
console.log(ret);
|
||||||
|
});
|
||||||
blueModule.connect({
|
blueModule.connect({
|
||||||
MACAddress: row.address,
|
MACAddress: row.address,
|
||||||
uuid: '00001101-0000-1000-8000-00805f9b34fb',
|
uuid: '00001101-0000-1000-8000-00805f9b34fb',
|
||||||
@ -141,16 +168,14 @@
|
|||||||
state.printingMachine.name = row.name
|
state.printingMachine.name = row.name
|
||||||
state.printingMachine.address = row.address
|
state.printingMachine.address = row.address
|
||||||
bluetoothListRef.value.close()
|
bluetoothListRef.value.close()
|
||||||
uni.setStorageSync('printInfo',{name:row.name,address:row.address})
|
uni.setStorageSync('printInfo', { name: row.name, address: row.address })
|
||||||
} else {
|
} else {
|
||||||
uni.$u.toast(t('index.ljsb'))
|
uni.$u.toast(t('index.ljsb'))
|
||||||
}
|
}
|
||||||
}, (data : any) => {
|
}, (data : any) => {
|
||||||
//接收的数据回调
|
|
||||||
console.log(data)
|
console.log(data)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const createLabel = () => {
|
const createLabel = () => {
|
||||||
var command = tsc.default.createNew()
|
var command = tsc.default.createNew()
|
||||||
command.setSize(100, 50)
|
command.setSize(100, 50)
|
||||||
@ -158,7 +183,7 @@
|
|||||||
command.setCls()
|
command.setCls()
|
||||||
command.setText(50, 30, "TSS24.BF2", 1, 1, state.printDataList[0].fBillNo)
|
command.setText(50, 30, "TSS24.BF2", 1, 1, state.printDataList[0].fBillNo)
|
||||||
command.setQR(50, 65, "L", 8, "A", state.printDataList[0].fBillNo)
|
command.setQR(50, 65, "L", 8, "A", state.printDataList[0].fBillNo)
|
||||||
state.printDataList.forEach((item,index) => {
|
state.printDataList.forEach((item, index) => {
|
||||||
command.setText(260, 64 + index * 40, "TSS24.BF2", 1, 1, `${item.fMaterialId} / ${item.fQty} / ${item.fSalOrderNo}`)
|
command.setText(260, 64 + index * 40, "TSS24.BF2", 1, 1, `${item.fMaterialId} / ${item.fQty} / ${item.fSalOrderNo}`)
|
||||||
})
|
})
|
||||||
command.setPagePrint()
|
command.setPagePrint()
|
||||||
@ -166,25 +191,31 @@
|
|||||||
}
|
}
|
||||||
const UHIK_BD_BarCodeMainFileSaveFun = () => {
|
const UHIK_BD_BarCodeMainFileSaveFun = () => {
|
||||||
let arr = []
|
let arr = []
|
||||||
state.printDataList.forEach((item:any) => {
|
state.printDataList.forEach((item : any) => {
|
||||||
arr.push({
|
arr.push({
|
||||||
FBarCodeRule:'03',
|
FBarCodeRule: '03',
|
||||||
FBarCode:item.fBillNo,
|
FBarCode: item.fBillNo,
|
||||||
FBillCode:item.fBillNo
|
FBillCode: item.fBillNo
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
UHIK_BD_BarCodeMainFileSave({
|
UHIK_BD_BarCodeMainFileSave({
|
||||||
Key:'qwe123!@#',
|
Key: 'qwe123!@#',
|
||||||
Items:arr
|
Items: arr
|
||||||
}).then((res:any) => {
|
}, true).then((res : any) => {
|
||||||
console.log('=====================================',res);
|
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 = () => {
|
const sendHexStr = () => {
|
||||||
createLabel()
|
createLabel()
|
||||||
UHIK_BD_BarCodeMainFileSaveFun()
|
UHIK_BD_BarCodeMainFileSaveFun()
|
||||||
if (state.sendData == null) {
|
if (state.sendData == null) {
|
||||||
// uni.$u.toast('请先生成指令')
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let hexStr = ''
|
let hexStr = ''
|
||||||
@ -216,6 +247,15 @@
|
|||||||
//结果
|
//结果
|
||||||
console.log('发送结果')
|
console.log('发送结果')
|
||||||
console.log(result)
|
console.log(result)
|
||||||
|
if (!result.success) {
|
||||||
|
uni.$u.toast(t('index.ljydk'))
|
||||||
|
uni.setStorageSync('printInfo', {})
|
||||||
|
state.printingMachine = {
|
||||||
|
name: '',
|
||||||
|
address: ''
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
realWriteData(sendloop, i + 1);
|
realWriteData(sendloop, i + 1);
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,9 @@
|
|||||||
<view class="type-item type-item-hl" @tap="toPages('/pages/supplement/index')">
|
<view class="type-item type-item-hl" @tap="toPages('/pages/supplement/index')">
|
||||||
<view class="type-item-text">{{ t('home.scbl') }}</view>
|
<view class="type-item-text">{{ t('home.scbl') }}</view>
|
||||||
</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 type-item-hl" @tap="toPages('/pages/ruleClaim/index')">
|
||||||
<view class="type-item-text">{{ t('index.ctll') }}</view>
|
<view class="type-item-text">{{ t('index.ctll') }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
<view class="list-box-list" v-if="state.dataList.length > 0">
|
<view class="list-box-list" v-if="state.dataList.length > 0">
|
||||||
<view class="data-item" @click.stop="fnToUrl(item)"
|
<view class="data-item" @click.stop="fnToUrl(item)"
|
||||||
v-for="(item, index) in state.dataList" :key="index">
|
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="line-p"></view>
|
||||||
<view class="b-font">{{ t('receive.rq') }}:{{item.FDateFormat}}</view>
|
<view class="b-font">{{ t('receive.rq') }}:{{item.FDateFormat}}</view>
|
||||||
</view>
|
</view>
|
||||||
@ -74,7 +74,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const fnToUrl = (item : any) => {
|
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 debounceTimer = ref()
|
||||||
const changeFun = (e : any) => {
|
const changeFun = (e : any) => {
|
||||||
@ -91,6 +91,7 @@
|
|||||||
queryString: state.queryString,
|
queryString: state.queryString,
|
||||||
pageIndex: state.page.pageIndex,
|
pageIndex: state.page.pageIndex,
|
||||||
pageSize: state.page.pageSize,
|
pageSize: state.page.pageSize,
|
||||||
|
FType:'Pick'
|
||||||
};
|
};
|
||||||
if (state.page.pageIndex == 1) {
|
if (state.page.pageIndex == 1) {
|
||||||
uni.showLoading({ mask: true });
|
uni.showLoading({ mask: true });
|
||||||
|
@ -97,6 +97,7 @@
|
|||||||
totalCount: 0
|
totalCount: 0
|
||||||
},
|
},
|
||||||
FBillNo: '',
|
FBillNo: '',
|
||||||
|
BillNo: '',
|
||||||
materialId: '',
|
materialId: '',
|
||||||
supplierName: '',
|
supplierName: '',
|
||||||
inputFocus: true,
|
inputFocus: true,
|
||||||
@ -149,12 +150,14 @@
|
|||||||
const getReceiveBillScanData = (val : string) => {
|
const getReceiveBillScanData = (val : string) => {
|
||||||
PRDPPBOMScanData({
|
PRDPPBOMScanData({
|
||||||
FBarCode: val,
|
FBarCode: val,
|
||||||
FBillNo: state.FBillNo,
|
FBillNo: state.BillNo,
|
||||||
IsFeed: 'true'
|
IsFeed: 'false'
|
||||||
}).then((res : any) => {
|
}).then((res : any) => {
|
||||||
if (res.data !== null) {
|
if (res.data !== null) {
|
||||||
console.log(res);
|
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 (Object.keys(state.shortcutDataFeedback).length) {
|
||||||
if (state.shortcutDataFeedback.scanFrameShowSate) {
|
if (state.shortcutDataFeedback.scanFrameShowSate) {
|
||||||
scanFrameRef.value.stateShow(true)
|
scanFrameRef.value.stateShow(true)
|
||||||
@ -189,7 +192,7 @@
|
|||||||
console.log(item);
|
console.log(item);
|
||||||
temporaryScanDraftSave({
|
temporaryScanDraftSave({
|
||||||
FVHUBFormId: "PRD_PPBOM", //数据类型
|
FVHUBFormId: "PRD_PPBOM", //数据类型
|
||||||
FVHUBFBillNo: state.FBillNo, //单据编号
|
FVHUBFBillNo: state.BillNo, //单据编号
|
||||||
FVHUBScanNumber: state.queryString, //条码
|
FVHUBScanNumber: state.queryString, //条码
|
||||||
FVHUBMaterialNumber: item.articlesStr, //物料编码
|
FVHUBMaterialNumber: item.articlesStr, //物料编码
|
||||||
FVHUBScanQty: item.quantityStr + '', //扫描数量
|
FVHUBScanQty: item.quantityStr + '', //扫描数量
|
||||||
@ -201,6 +204,7 @@
|
|||||||
FVHUBMaterial: {
|
FVHUBMaterial: {
|
||||||
FNUMBER: item.articlesStr
|
FNUMBER: item.articlesStr
|
||||||
},
|
},
|
||||||
|
FType: "Picking",
|
||||||
...JSON.parse(str),
|
...JSON.parse(str),
|
||||||
}).then((res : any) => {
|
}).then((res : any) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
@ -225,7 +229,7 @@
|
|||||||
const scanRecordFun = () => {
|
const scanRecordFun = () => {
|
||||||
toPages('/pages/records/index', {
|
toPages('/pages/records/index', {
|
||||||
FormId: 'PRD_PPBOM',
|
FormId: 'PRD_PPBOM',
|
||||||
FbillNo: state.FBillNo
|
FbillNo: state.BillNo
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -301,11 +305,13 @@
|
|||||||
const fnDataList = (FBillNo : any, statesItem : boolean = false) => {
|
const fnDataList = (FBillNo : any, statesItem : boolean = false) => {
|
||||||
let param = {
|
let param = {
|
||||||
id: FBillNo,
|
id: FBillNo,
|
||||||
|
IsFeed:'false'
|
||||||
};
|
};
|
||||||
uni.showLoading({ mask: true });
|
uni.showLoading({ mask: true });
|
||||||
PRDPPBOMView(param).then(res => {
|
PRDPPBOMView(param).then(res => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
|
state.BillNo = res.data.BillNo
|
||||||
state.dataList = []
|
state.dataList = []
|
||||||
let dataListArray = res.data.Entry;
|
let dataListArray = res.data.Entry;
|
||||||
if (dataListArray.length > 0) {
|
if (dataListArray.length > 0) {
|
||||||
|
@ -124,7 +124,7 @@
|
|||||||
*/
|
*/
|
||||||
const dataPushNotification = () => {
|
const dataPushNotification = () => {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示', content: '确定要推送此次数据吗', cancelText: '取消', confirmText: '确定',
|
title: t('public.ts'), content: t('public.tjMessage'), cancelText: t('public.cancel'), confirmText: t('public.confirm'),
|
||||||
success(res) {
|
success(res) {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
let EntryIds : any = []
|
let EntryIds : any = []
|
||||||
@ -166,14 +166,14 @@
|
|||||||
fStockFlexDetailDelete({ Ids: ids.toString() }).then((res : any) => {
|
fStockFlexDetailDelete({ Ids: ids.toString() }).then((res : any) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
fnDataList(state.materialId);
|
fnDataList(state.materialId);
|
||||||
uni.$u.toast('操作成功')
|
uni.$u.toast(t('public.cg'))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
uni.$u.toast('暂无扫描数据')
|
uni.$u.toast(t('index.zwsmsj'))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -225,7 +225,13 @@
|
|||||||
|
|
||||||
.list-box-list {
|
.list-box-list {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
.itemRight {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 34rpx;
|
||||||
|
background-color: #ff5a5d;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
}
|
||||||
.data-item {
|
.data-item {
|
||||||
border: 1px solid #efeaea;
|
border: 1px solid #efeaea;
|
||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
|
@ -256,8 +256,8 @@
|
|||||||
const dataPushNotification = () => {
|
const dataPushNotification = () => {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: t('public.ts'), content: t('public.tjMessage'), cancelText: t('public.cancel'), confirmText: t('public.confirm'),
|
title: t('public.ts'), content: t('public.tjMessage'), cancelText: t('public.cancel'), confirmText: t('public.confirm'),
|
||||||
success(res) {
|
success(resShow) {
|
||||||
if (res.confirm) {
|
if (resShow.confirm) {
|
||||||
let EntryIds : any = []
|
let EntryIds : any = []
|
||||||
let ids : any = []
|
let ids : any = []
|
||||||
let ScanEntry : any = []
|
let ScanEntry : any = []
|
||||||
@ -268,10 +268,10 @@
|
|||||||
};
|
};
|
||||||
uni.showLoading({ mask: true });
|
uni.showLoading({ mask: true });
|
||||||
//获取扫描数据里的所有数据
|
//获取扫描数据里的所有数据
|
||||||
temporaryScanList(param).then(res => {
|
temporaryScanList(param).then(resScan => {
|
||||||
if (res.code == 200) {
|
if (resScan.code == 200) {
|
||||||
if (res.data.list.length != 0) {
|
if (resScan.data.list.length != 0) {
|
||||||
res.data.list.forEach((item : any) => {
|
resScan.data.list.forEach((item : any) => {
|
||||||
EntryIds.push(item.FVHUBEntryId)
|
EntryIds.push(item.FVHUBEntryId)
|
||||||
ids.push(item.FID)
|
ids.push(item.FID)
|
||||||
ScanEntry.push({
|
ScanEntry.push({
|
||||||
@ -291,15 +291,18 @@
|
|||||||
AutoAudit: 'true',
|
AutoAudit: 'true',
|
||||||
ScanEntry: ScanEntry
|
ScanEntry: ScanEntry
|
||||||
}
|
}
|
||||||
}).then((res : any) => {
|
}).then((resPush : any) => {
|
||||||
console.log();
|
console.log();
|
||||||
if (res.code === 200) {
|
if (resPush.code === 200) {
|
||||||
fStockFlexDetailDelete({ Ids: ids.toString() }).then((res : any) => {
|
fStockFlexDetailDelete({ Ids: ids.toString() }).then((res : any) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
fnDataList(state.materialId);
|
fnDataList(state.materialId);
|
||||||
uni.$u.toast(t('public.cg'))
|
uni.$u.toast(t('public.cg'))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
console.log('==========================================', resPush);
|
||||||
|
uni.$u.toast(resPush.msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
<scroll-view id="scroll-box" class="scroll-box" scroll-y="true"
|
<scroll-view id="scroll-box" class="scroll-box" scroll-y="true"
|
||||||
:style="{'height':state.scrollHeight+'px'}" @scrolltolower="fnScrollBottom()">
|
:style="{'height':state.scrollHeight+'px'}" @scrolltolower="fnScrollBottom()">
|
||||||
<view class="list-box-list" v-if="state.dataList.length > 0">
|
<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="tit">{{ t('index.scddbh') }}:{{item.FBillNo}}</view>
|
||||||
<view class="line-p"></view>
|
<view class="line-p"></view>
|
||||||
<view class="b-font">{{ t('receive.rq') }}:{{item.FDateFormat}}</view>
|
<view class="b-font">{{ t('receive.rq') }}:{{item.FDateFormat}}</view>
|
||||||
@ -80,7 +80,6 @@
|
|||||||
const fnScrollBottom = () => {
|
const fnScrollBottom = () => {
|
||||||
console.log(state.page.pageIndex * state.page.pageSize, state.page.totalCount);
|
console.log(state.page.pageIndex * state.page.pageSize, state.page.totalCount);
|
||||||
if (state.page.pageIndex * state.page.pageSize <= state.page.totalCount) {
|
if (state.page.pageIndex * state.page.pageSize <= state.page.totalCount) {
|
||||||
debugger
|
|
||||||
state.page.pageIndex++;
|
state.page.pageIndex++;
|
||||||
uni.showLoading({ mask: true });
|
uni.showLoading({ mask: true });
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@ -98,16 +97,31 @@
|
|||||||
fnDataList(true)
|
fnDataList(true)
|
||||||
}, 500)
|
}, 500)
|
||||||
}
|
}
|
||||||
const viewIntoProFun = (item : object) => {
|
const viewIntoProFun = (item : object,typeVertical:string = 'details') => {
|
||||||
PRD_MOViewIntoPro({
|
PRD_MOViewIntoPro({
|
||||||
Number: state.queryString
|
Number: state.queryString
|
||||||
}).then((res : any) => {
|
}).then((res : any) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
pageDataInfoCom.putInProdPageData({ ...res.data, ...item, time: new Date().getTime(), type: state.type })
|
if(typeVertical === 'details'){
|
||||||
route({ url: '/pages/putInProd/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) => {
|
const fnDataList = (scanData : boolean = false) => {
|
||||||
let param = {
|
let param = {
|
||||||
|
@ -16,18 +16,6 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
</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-box" @click="printingMachineSelectFun">
|
||||||
<view class="input-item">
|
<view class="input-item">
|
||||||
<up-input :placeholder="t('index.qxzdyj')" border="none" clearable inputAlign="left" v-model="state.printingMachine.name"
|
<up-input :placeholder="t('index.qxzdyj')" border="none" clearable inputAlign="left" v-model="state.printingMachine.name"
|
||||||
@ -110,6 +98,28 @@
|
|||||||
|
|
||||||
//获取蓝牙权限并打开蓝牙
|
//获取蓝牙权限并打开蓝牙
|
||||||
const hasPermission = () => {
|
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) => {
|
blueModule.hasPermission((res : any) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
blueModule.isOpen((isOpenRes : any) => {
|
blueModule.isOpen((isOpenRes : any) => {
|
||||||
@ -203,7 +213,7 @@
|
|||||||
UHIK_BD_BarCodeMainFileSave({
|
UHIK_BD_BarCodeMainFileSave({
|
||||||
Key: 'qwe123!@#',
|
Key: 'qwe123!@#',
|
||||||
Items: arr
|
Items: arr
|
||||||
}).then((res : any) => {
|
},true).then((res : any) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
let i : number = 0;
|
let i : number = 0;
|
||||||
@ -277,6 +287,15 @@
|
|||||||
//结果
|
//结果
|
||||||
console.log('发送结果')
|
console.log('发送结果')
|
||||||
console.log(result)
|
console.log(result)
|
||||||
|
if (!result.success) {
|
||||||
|
uni.$u.toast(t('index.ljydk'))
|
||||||
|
uni.setStorageSync('printInfo', {})
|
||||||
|
state.printingMachine = {
|
||||||
|
name: '',
|
||||||
|
address: ''
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
realWriteData(sendloop, i + 1);
|
realWriteData(sendloop, i + 1);
|
||||||
}
|
}
|
||||||
|
206
pages/returnMaterials/index.vue
Normal file
206
pages/returnMaterials/index.vue
Normal 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>
|
428
pages/returnMaterials/material.vue
Normal file
428
pages/returnMaterials/material.vue
Normal 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>
|
@ -91,6 +91,7 @@
|
|||||||
queryString: state.queryString,
|
queryString: state.queryString,
|
||||||
pageIndex: state.page.pageIndex,
|
pageIndex: state.page.pageIndex,
|
||||||
pageSize: state.page.pageSize,
|
pageSize: state.page.pageSize,
|
||||||
|
FType:'Feed'
|
||||||
};
|
};
|
||||||
if (state.page.pageIndex == 1) {
|
if (state.page.pageIndex == 1) {
|
||||||
uni.showLoading({ mask: true });
|
uni.showLoading({ mask: true });
|
||||||
|
@ -6,17 +6,29 @@
|
|||||||
</l-header>
|
</l-header>
|
||||||
<view class="input-box">
|
<view class="input-box">
|
||||||
<view class="input-item">
|
<view class="input-item">
|
||||||
<up-input :placeholder="t('receive.code')" border="none" clearable inputAlign="left" inputmode="none"
|
<up-input :placeholder="t('receive.code')" border="none" clearable inputAlign="left" :focus="state.inputFocus"
|
||||||
:focus="state.inputFocus" v-model="state.queryString" @change="changeFun" ref="inputRef">
|
v-model="state.queryString" @change="changeFun" ref="inputRef">
|
||||||
<template #prefix>
|
<template #prefix>
|
||||||
<up-icon name="scan" color="#2979ff" size="24"></up-icon>
|
<up-icon name="scan" color="#2979ff" size="24"></up-icon>
|
||||||
</template>
|
</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>
|
</up-input>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="material-listBox">
|
<view class="material-listBox">
|
||||||
<scroll-view id="scroll-box" class="scroll-box" scroll-y="true"
|
<scroll-view id="scroll-box" class="scroll-box" scroll-y="true" :style="{'height':state.scrollHeight+'px'}">
|
||||||
:style="{'height':state.scrollHeight+'px'}">
|
|
||||||
<view class="list-box-list" v-if="state.dataList.length > 0">
|
<view class="list-box-list" v-if="state.dataList.length > 0">
|
||||||
<view class="data-item" v-for="(item, index) in state.dataList"
|
<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'}]"
|
:style="[{'background-color':interpolation(item)},{'margin-bottom':index + 1 === state.dataList.length ? '80px' : '20px'}]"
|
||||||
@ -89,6 +101,8 @@
|
|||||||
const { t, locale } = getI18n
|
const { t, locale } = getI18n
|
||||||
const state = reactive({
|
const state = reactive({
|
||||||
queryString: '',
|
queryString: '',
|
||||||
|
manualQueryString: '',
|
||||||
|
manualShow: false,
|
||||||
dataList: [],
|
dataList: [],
|
||||||
scrollHeight: 0,
|
scrollHeight: 0,
|
||||||
page: {
|
page: {
|
||||||
@ -97,6 +111,7 @@
|
|||||||
totalCount: 0
|
totalCount: 0
|
||||||
},
|
},
|
||||||
FBillNo: '',
|
FBillNo: '',
|
||||||
|
BillNo: '',
|
||||||
materialId: '',
|
materialId: '',
|
||||||
supplierName: '',
|
supplierName: '',
|
||||||
inputFocus: true,
|
inputFocus: true,
|
||||||
@ -145,21 +160,25 @@
|
|||||||
if (state.queryString !== '') getReceiveBillScanData(e)
|
if (state.queryString !== '') getReceiveBillScanData(e)
|
||||||
}, 500)
|
}, 500)
|
||||||
}
|
}
|
||||||
|
const confirmFun = (e:any) => {
|
||||||
|
getReceiveBillScanData(e)
|
||||||
|
}
|
||||||
//查询录入
|
//查询录入
|
||||||
const getReceiveBillScanData = (val : string) => {
|
const getReceiveBillScanData = (val : string) => {
|
||||||
PRDPPBOMScanData({
|
PRDPPBOMScanData({
|
||||||
FBarCode: val,
|
FBarCode: val,
|
||||||
FBillNo: state.FBillNo,
|
FBillNo: state.BillNo,
|
||||||
IsFeed: 'true'
|
IsFeed: 'true'
|
||||||
}).then((res : any) => {
|
}).then((res : any) => {
|
||||||
if (res.data !== null) {
|
if (res.data !== null) {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
|
const scanData = res.data
|
||||||
|
if( scanData.UnScanQty > scanData.BarCodeQty ) scanData.UnScanQty = scanData.BarCodeQty
|
||||||
scanFrameRef.value.getreceiveBillScanData({
|
scanFrameRef.value.getreceiveBillScanData({
|
||||||
|
|
||||||
...res.data,
|
...res.data,
|
||||||
queryString: state.queryString,
|
queryString: state.queryString,
|
||||||
scanFrameShowSate: state.shortcutDataFeedback.scanFrameShowSate,
|
scanFrameShowSate: state.shortcutDataFeedback.scanFrameShowSate,
|
||||||
quantityStateSup:'0',
|
quantityStateSup: '0',
|
||||||
})
|
})
|
||||||
if (Object.keys(state.shortcutDataFeedback).length) {
|
if (Object.keys(state.shortcutDataFeedback).length) {
|
||||||
if (state.shortcutDataFeedback.scanFrameShowSate) {
|
if (state.shortcutDataFeedback.scanFrameShowSate) {
|
||||||
@ -187,7 +206,7 @@
|
|||||||
//数据记录暂存
|
//数据记录暂存
|
||||||
const postTemporaryScanDraftSaveFun = (item : any) => {
|
const postTemporaryScanDraftSaveFun = (item : any) => {
|
||||||
const obj = {};
|
const obj = {};
|
||||||
if (item.warehouseData.FIsOpenLocation && Object.keys(item.locationData).length != 0) {
|
if (item.warehouseData.FIsOpenLocation && Object.keys(item.locationData).length != 0) {
|
||||||
const key = `FVHUBSTOCKFLEX__FF${item.locationData.FID}`; //仓位Id
|
const key = `FVHUBSTOCKFLEX__FF${item.locationData.FID}`; //仓位Id
|
||||||
obj[key] = { FNumber: item.locationData.FlexEntryId.Number }; //仓位编码
|
obj[key] = { FNumber: item.locationData.FlexEntryId.Number }; //仓位编码
|
||||||
}
|
}
|
||||||
@ -195,7 +214,7 @@
|
|||||||
console.log(item);
|
console.log(item);
|
||||||
temporaryScanDraftSave({
|
temporaryScanDraftSave({
|
||||||
FVHUBFormId: "PRD_PPBOM", //数据类型
|
FVHUBFormId: "PRD_PPBOM", //数据类型
|
||||||
FVHUBFBillNo: state.FBillNo, //单据编号
|
FVHUBFBillNo: state.BillNo, //单据编号
|
||||||
FVHUBScanNumber: state.queryString, //条码
|
FVHUBScanNumber: state.queryString, //条码
|
||||||
FVHUBMaterialNumber: item.articlesStr, //物料编码
|
FVHUBMaterialNumber: item.articlesStr, //物料编码
|
||||||
FVHUBScanQty: item.quantityStr + '', //扫描数量
|
FVHUBScanQty: item.quantityStr + '', //扫描数量
|
||||||
@ -207,6 +226,7 @@
|
|||||||
FVHUBMaterial: {
|
FVHUBMaterial: {
|
||||||
FNUMBER: item.articlesStr
|
FNUMBER: item.articlesStr
|
||||||
},
|
},
|
||||||
|
FType: "Feed",
|
||||||
...JSON.parse(str),
|
...JSON.parse(str),
|
||||||
}).then((res : any) => {
|
}).then((res : any) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
@ -231,7 +251,7 @@
|
|||||||
const scanRecordFun = () => {
|
const scanRecordFun = () => {
|
||||||
toPages('/pages/records/index', {
|
toPages('/pages/records/index', {
|
||||||
FormId: 'PRD_PPBOM',
|
FormId: 'PRD_PPBOM',
|
||||||
FbillNo: state.FBillNo
|
FbillNo: state.BillNo
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -305,13 +325,14 @@
|
|||||||
*/
|
*/
|
||||||
const fnDataList = (FBillNo : any, statesItem : boolean = false) => {
|
const fnDataList = (FBillNo : any, statesItem : boolean = false) => {
|
||||||
let param = {
|
let param = {
|
||||||
id: FBillNo,
|
Id: FBillNo,
|
||||||
IsInStock: 'true'
|
IsFeed: 'true',
|
||||||
};
|
};
|
||||||
uni.showLoading({ mask: true });
|
uni.showLoading({ mask: true });
|
||||||
PRDPPBOMView(param).then(res => {
|
PRDPPBOMView(param).then(res => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
|
state.BillNo = res.data.BillNo
|
||||||
state.dataList = []
|
state.dataList = []
|
||||||
let dataListArray = res.data.Entry;
|
let dataListArray = res.data.Entry;
|
||||||
if (dataListArray.length > 0) {
|
if (dataListArray.length > 0) {
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<l-header :title="t('home.llyz')" sticky></l-header>
|
<l-header :title="t('home.llyz')" sticky></l-header>
|
||||||
<view class="input-box">
|
<view class="input-box">
|
||||||
<view class="input-item">
|
<view class="input-item">
|
||||||
<up-input :placeholder="t('verify.grn')" border="none" clearable inputAlign="left"
|
<up-input :placeholder="t('verify.grn')" border="none" clearable inputAlign="left"
|
||||||
v-model="state.queryString" @change="changeFun">
|
v-model="state.queryString" @change="changeFun">
|
||||||
<template #prefix>
|
<template #prefix>
|
||||||
<up-icon name="search" color="#2979ff" size="24"></up-icon>
|
<up-icon name="search" color="#2979ff" size="24"></up-icon>
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<!-- 根据uni-app的input组件文档,H5和APP中只要声明了password参数(无论true还是false),type均失效,此时
|
<!-- 根据uni-app的input组件文档,H5和APP中只要声明了password参数(无论true还是false),type均失效,此时
|
||||||
为了防止type=number时,又存在password属性,type无效,此时需要设置password为undefined
|
为了防止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"
|
class="u-input__content__field-wrapper__field upinputRef" :style="[inputStyle]" :type="type"
|
||||||
:focus="focus" :cursor="cursor" :value="innerValue" :auto-blur="autoBlur"
|
:focus="focus" :cursor="cursor" :value="innerValue" :auto-blur="autoBlur"
|
||||||
:disabled="disabled || readonly" :maxlength="maxlength" :placeholder="placeholder"
|
:disabled="disabled || readonly" :maxlength="maxlength" :placeholder="placeholder"
|
||||||
@ -115,7 +115,7 @@
|
|||||||
// value绑定值的变化是由内部还是外部引起的
|
// value绑定值的变化是由内部还是外部引起的
|
||||||
changeFromInner: false,
|
changeFromInner: false,
|
||||||
// 过滤处理方法
|
// 过滤处理方法
|
||||||
innerFormatter: value => value
|
innerFormatter: value => value,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"version": "1",
|
"version": "1",
|
||||||
"env": {
|
"env": {
|
||||||
"compilerVersion": "4.54.2025030608-alpha"
|
"compilerVersion": "4.63.2025042307-alpha"
|
||||||
},
|
},
|
||||||
"files": {
|
"files": {
|
||||||
"utssdk/app-android/TransparentActivity.uts": {
|
"utssdk/app-android/TransparentActivity.uts": {
|
||||||
|
@ -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
1
unpackage/cache/wgt/__UNI__901D257/pages/encasement/print.css
vendored
Normal file
1
unpackage/cache/wgt/__UNI__901D257/pages/encasement/print.css
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -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
1
unpackage/cache/wgt/__UNI__901D257/pages/purchaseTa/index.css
vendored
Normal file
1
unpackage/cache/wgt/__UNI__901D257/pages/purchaseTa/index.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
unpackage/cache/wgt/__UNI__901D257/pages/purchaseTa/material.css
vendored
Normal file
1
unpackage/cache/wgt/__UNI__901D257/pages/purchaseTa/material.css
vendored
Normal file
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
1
unpackage/cache/wgt/__UNI__901D257/pages/putInProd/print.css
vendored
Normal file
1
unpackage/cache/wgt/__UNI__901D257/pages/putInProd/print.css
vendored
Normal file
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
1
unpackage/cache/wgt/__UNI__901D257/pages/ruleClaim/details.css
vendored
Normal file
1
unpackage/cache/wgt/__UNI__901D257/pages/ruleClaim/details.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
unpackage/cache/wgt/__UNI__901D257/pages/ruleClaim/index.css
vendored
Normal file
1
unpackage/cache/wgt/__UNI__901D257/pages/ruleClaim/index.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
unpackage/cache/wgt/__UNI__901D257/pages/ruleValidation/checklist.css
vendored
Normal file
1
unpackage/cache/wgt/__UNI__901D257/pages/ruleValidation/checklist.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
unpackage/cache/wgt/__UNI__901D257/pages/ruleValidation/index.css
vendored
Normal file
1
unpackage/cache/wgt/__UNI__901D257/pages/ruleValidation/index.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
unpackage/cache/wgt/__UNI__901D257/pages/ruleValidation/verification.css
vendored
Normal file
1
unpackage/cache/wgt/__UNI__901D257/pages/ruleValidation/verification.css
vendored
Normal file
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
1
unpackage/cache/wgt/__UNI__901D257/pages/verifyTa/index.css
vendored
Normal file
1
unpackage/cache/wgt/__UNI__901D257/pages/verifyTa/index.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
unpackage/cache/wgt/__UNI__901D257/pages/verifyTa/material.css
vendored
Normal file
1
unpackage/cache/wgt/__UNI__901D257/pages/verifyTa/material.css
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
unpackage/cache/wgt/__UNI__901D257/static/icons/jl-ac.png
vendored
Normal file
BIN
unpackage/cache/wgt/__UNI__901D257/static/icons/jl-ac.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.2 KiB |
BIN
unpackage/cache/wgt/__UNI__901D257/static/icons/jl.png
vendored
Normal file
BIN
unpackage/cache/wgt/__UNI__901D257/static/icons/jl.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.3 KiB |
BIN
unpackage/cache/wgt/__UNI__901D257/static/icons/mr-ac.png
vendored
Normal file
BIN
unpackage/cache/wgt/__UNI__901D257/static/icons/mr-ac.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.0 KiB |
BIN
unpackage/cache/wgt/__UNI__901D257/static/icons/mr.png
vendored
Normal file
BIN
unpackage/cache/wgt/__UNI__901D257/static/icons/mr.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.7 KiB |
File diff suppressed because one or more lines are too long
@ -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}
|
@ -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>
|
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"minSdkVersion": "19"
|
||||||
|
}
|
@ -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>
|
@ -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
17
unpackage/dist/build/app-plus/app-service.js
vendored
17
unpackage/dist/build/app-plus/app-service.js
vendored
File diff suppressed because one or more lines are too long
2
unpackage/dist/build/app-plus/manifest.json
vendored
2
unpackage/dist/build/app-plus/manifest.json
vendored
@ -212,7 +212,7 @@
|
|||||||
"uni-app": {
|
"uni-app": {
|
||||||
"control": "uni-v3",
|
"control": "uni-v3",
|
||||||
"vueVersion": "3",
|
"vueVersion": "3",
|
||||||
"compilerVersion": "4.54",
|
"compilerVersion": "4.63",
|
||||||
"nvueCompiler": "uni-app",
|
"nvueCompiler": "uni-app",
|
||||||
"renderer": "auto",
|
"renderer": "auto",
|
||||||
"nvue": {
|
"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
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user