wms-pda迁移

This commit is contained in:
2025-05-09 17:15:16 +08:00
parent 6a09472e86
commit e8b07fcece
580 changed files with 75351 additions and 133 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,650 @@
<!-- 入库回退下架 -->
<template>
<view class="shpage ckhtsxjpage">
<!-- 标题栏 -->
<view class="mianheade mianheade2" @click="goback()">
<image src="../../static/img/n_baiback.png" class="blacBackico"></image>
<text class="pagetitle">入库回退下架</text>
</view>
<!-- 固定内容-->
<view class="sh_gdInfo">
<view class="item itembg2">
<view class="it">
<text class="t1">仓库:</text>
<text class="t2">{{ warehouseName }}</text>
</view>
</view>
<view class="item" :class="{ itembg2: xlhstrList.length > 0 }" :style="{ 'pointer-events': xlhstrList.length > 0 ? 'none' : '' }">
<view class="it itsp">
<text class="t1">
<text class="redtag">*</text>
箱号:
</text>
<input
v-model.trim="xhNo"
class="inpt1"
type="text"
@focus="inputfocus($event, 'box')"
@blur="inputblur($event, '')"
@confirm="inputConfirm($event, 'box')"
:focus="focusInput == 'box'"
/>
<image src="../../static/img/smico.png" class="searchico" @click="scanImg('box')"></image>
</view>
</view>
<view class="item" :class="{ itembg2: !xhNo }" :style="{ 'pointer-events': !xhNo ? 'none' : '' }">
<view class="it itsp">
<text class="t1">序列号:</text>
<input
v-model.trim="xlhVal"
class="inpt1"
type="text"
@focus="inputfocus($event, 'xlh')"
@blur="inputblur($event, '')"
@confirm="inputConfirm($event, 'xlh')"
:focus="focusInput == 'xlh'"
/>
<image src="../../static/img/smico.png" class="searchico" @click="scanImg('xlh')"></image>
</view>
</view>
<view class="item itembg2">
<view class="it itsp">
<text class="t1">
<text class="redtag">*</text>
下架数量:
</text>
<input v-model.trim="xjNum" class="inpt1" type="number" :disabled="true" />
</view>
</view>
<view class="item item2">
<view class="it2 it50">
<text class="t1">{{ yxjTotalNum }}</text>
<text class="t2">已下架总数量</text>
</view>
<view class="it2 it50" @click="xhmodelOpen">
<text class="t1 rednum">{{ boxstrList.length }}</text>
<text class="t2">已扫描箱数</text>
</view>
</view>
</view>
<!-- 列表内容-->
<view class="shlb cgsjrklb f_cgsjrklb" :style="{ 'margin-top': heights.top + 'px', height: heights.body + 'px' }">
<view class="item" v-for="(item, index) in dataList" :key="item.boxBillNo">
<view class="it" style="border: none">
<text class="txt titstr">{{ item.boxBillNo }}</text>
<view class="cssj_it ckhtit" v-for="(it, indexs) in item.details" :key="it.specifications">
<view class="tlinb">
<text class="txt ntxtcolor">{{ it.specifications }}</text>
<view class="nwemxflex">
<text class="txt">{{ it.materialNumber }}</text>
<view class="fgline"></view>
<text class="txt">数量 {{ it.wuToatal }}</text>
</view>
</view>
<view class="txtNum nslbzflex">
<view class="n-sl-bz">
<view class="tinput">
<text class="ntxtcolor nbtxt">下架数量</text>
<u-input
v-model="it.qty"
border="surround"
clearable
class="inpt"
type="number"
:disabled="it.itxlhlist.length > 0 || dqXH !== item.boxBillNo"
@focus="inputfocus($event, 'xjNum', item.boxBillNo)"
@blur="inputblur($event, '')"
@confirm="inputConfirm($event, 'xjNum')"
@input="xjNumInput($event, 'xjNum', index, item.boxBillNo)"
></u-input>
</view>
<view class="tinput" @click="openRemarTk(it.remark,index,indexs)">
<text class="ntxtcolor nbtxt">备注</text>
<u-input v-model="it.remark" border="surround" clearable class="inpt" type="text" style="pointer-events: none"></u-input>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<!-- 已上架箱号-->
<u-modal :show="xhlistshow" title="已扫箱信息" @confirm="xhlistshow = false">
<view style="display: flex; flex-direction: column; overflow-y: auto; max-height: 60vh; overflow-y: auto">
<view v-for="(item, index) in boxstrList">{{ item }}</view>
</view>
</u-modal>
<!-- 底部按钮固定-->
<view class="footbts">
<view class="bt bt1" @click="qktkshow = true">清空下架数量</view>
<view class="bt bt2" @click="wcNxetFn">完成/下一单</view>
</view>
<!--清空二次确认弹框-->
<u-modal :show="qktkshow" :title="qktkTitle" :content="qktkContent" @confirm="qktkconfirm" :showCancelButton="true" @cancel="qktkshow = false"></u-modal>
<!--备注弹框-->
<u-modal :show="remarkshow" title="备注" @confirm="remarkconfirm" :showCancelButton="true" @cancel="remarkshow = false">
<textarea v-model="dqremarkVal" auto-height :maxlength="100" class="remaktinpt" placeholder="请输入备注信息" />
</u-modal>
</view>
</template>
<script>
export default {
data() {
return {
heights: {
top: 0,
body: 0
},
xhlistshow: false,
focusInput: 'box', // 自动聚焦
focusTag: '', // 判斷聚焦
warehouseName: '', // 仓库名称
warehouseCode: '', // 仓库编码
cwNum: '', // 仓位的值
cwselectList: [], //仓位下拉集合
cwcode: '', // 仓位code
xhNo: '', // 箱号的值
boxstrList: [], // 缓存的箱号信息(多个)
xlhVal: '', // 序列号的值
xlhstrList: [], // 缓存的序列號信息(多个)
xjNum: '', // 上架数量
yxjTotalNum: 0, // 已上架总数量
filterable: true,
dataList: [], // 明细列表数据
dqBoxInfo: {}, // 扫描当前箱的物料信息
qktkshow: false, //清空二次确认弹框
qktkTitle: '确定清空',
qktkContent: '是否清空当前页面已经扫描的箱号信息/序列号信息和统计数值?',
dqboxNO: '', //用来是否保存当前输入箱号的值
dqboxXlh: '', //用来是否保存当前输入xlh的值
erpOrgCode: '',
dqXH: '', // 点回车确认的当前箱号
APPdevice: uni.getStorageSync('devicePixelRatio'), // 缓存设备的像素比用来区分普通安卓normalAnroid还是pda
requestStatus: false, // 请求状态识别变量
remarkshow: false, // 当前备注弹框
dqremarkVal:'',//当前弹框显示备注内容
remarkidx:[],//记录当前编辑的是那个明细的备注
twoData:[],
scanTracker: {
lastScanTime: 0,
lastScanCode: null
} // 源头处理扫码段时间内重复扫
};
},
watch: {
xhNo(n) {
if (!n) {
this.dqboxNO = '';
}
},
xlhVal(n) {
if (!n) {
this.dqboxXlh = '';
}
}
},
onReady() {
this.heights = this.$util.setlistHeight('.sh_gdInfo', '.footbts');
},
onLoad() {
//获取广播扫码监听
this.$broadcastScan.init(this.getScancode);
this.$broadcastScan.start();
this.stopScanCode();
this.startScanCode();
},
onHide() {
this.$broadcastScan.stop();
this.stopScanCode();
},
onShow() {
this.$broadcastScan.start();
this.startScanCode();
},
onBackPress(e) {
this.$util.appgoBack(e, 'otherUnderwearIndex');
return true;
},
methods: {
// 开启广播
startScanCode() {
uni.$on('xwscan', (res) => {
const now = Date.now();
const timeSinceLastScan = now - this.scanTracker.lastScanTime;
// 如果扫描的箱码和上次相同并且时间间隔小于500ms则不作处理
if (res.code === this.scanTracker.lastScanCode && timeSinceLastScan < 4000) {
return;
} else {
// 更新扫描跟踪信息
this.scanTracker.lastScanTime = now;
this.scanTracker.lastScanCode = res.code;
this.getScancode(res.code);
}
});
},
// 关闭广播
stopScanCode() {
uni.$off('xwscan');
},
// 打开当前明细行备注弹框
openRemarTk(remarkStr,index,indexs){
this.remarkshow=true
this.dqremarkVal = remarkStr
this.remarkidx=[index,indexs]
},
// 确认修改弹框备注
remarkconfirm(){
this.dataList[this.remarkidx[0]].details[this.remarkidx[1]].remark=this.dqremarkVal
this.remarkshow=false
},
// 打开查看箱号
xhmodelOpen() {
if (this.boxstrList.length > 0) {
this.xhlistshow = true;
}
},
//明细上架数量输入实时监听
xjNumInput(val, type, index, dqXH) {
if (val) {
this.yxjTotalNum = this.$util.sumNestedObjectValues(this.dataList, 'details', 'qty');
this.dqXH = dqXH;
this.setxjNUM();
}
},
// 完成
wcNxetFn() {
if (this.boxstrList.length == 0 || !this.yxjTotalNum) {
uni.showToast({
title: '请先输入必填值',
icon: 'none',
duration: 1000
});
return;
}
let formdata = {
method: 2,
orgCode: this.erpOrgCode,
stockCode: this.warehouseCode,
subStockCode: this.cwcode,
details: []
};
console.log(this.dataList, '=this.dataList=');
this.dataList.forEach((it) => {
if (it.details && it.details.length > 0) {
it.details.forEach((k) => {
formdata.details.push({
boxId: k.boxId,
serialNumberBoxId: k.boxId,
materialNumber: k.materialNumber,
qty: k.qty,
subStockCode: k.subStockCode,
serialNumbers: k.itxlhlist,
remark: k.remark
});
});
}
});
console.log('入库回退下架1', this.dataList, formdata);
if (this.requestStatus) {
return false;
}
this.requestStatus = true;
this.$api.post('/BackRecord/OffShelf', formdata).then((res) => {
if (res.status == 200) {
uni.showToast({
title: '成功',
icon: 'none',
duration: 1000
});
setTimeout(() => {
uni.navigateTo({
url: '/pages/otherUnderwear/inStockDown'
});
}, 200);
// this.$router.go(0)
}
});
setTimeout(() => {
this.requestStatus = false;
}, 1500);
},
// 普通安卓设备碘酒扫描图标扫描
scanImg(type) {
if (this.APPdevice == 'normalAnroid') {
this.$util.doScanQrCode().then((res) => {
this.focusInput = type;
this.focusTag = type;
this.getScancode(res.result);
});
}
},
// 获取扫描的值
getScancode(code) {
console.log('获取扫描的值', this.focusTag, code);
if (this.focusTag == 'box') {
// 有些PDA会自带换行符trim函数处理下
this.xhNo = '';
this.xhNo = code.trim();
this.getboxinfo();
}
// 序列号
if (this.focusTag == 'xlh') {
this.xlhVal = '';
this.xlhVal = code.trim();
this.getXlhInfo();
//根据序列号去更新对应的明细规格型号的上架数量的值 扫描一个数量加一,重复扫描要提示
}
},
// 清空二次确认
qktkconfirm() {
this.boxstrList = [];
this.twoData=[]
this.xlhstrList = [];
this.dataList = [];
this.xhNo = '';
this.xlhVal = '';
this.yxjTotalNum = 0;
this.xjNum = null;
this.qktkshow = false;
this.warehouseCode = '';
this.warehouseName = '';
},
// 輸入失去焦點
inputblur(val, type) {},
// 输入聚焦
inputfocus(val, type, dqXH) {
this.focusTag = type;
if (type == 'xjNum') {
this.dqXH = dqXH;
// 统计当前箱子的下架数量总和
this.setxjNUM();
}
},
//当前限制 下架数量重新统计
setxjNUM() {
this.xjNum = 0;
this.dataList.forEach((it) => {
if (it.details && it.details.length > 0 && it.boxBillNo == this.dqXH) {
it.details.forEach((k) => {
this.xjNum = this.xjNum + parseInt(k.qty ? k.qty : 0);
});
}
});
},
// 区分不同的扫描数据、输入数据做处理显示 box
setSMstr(str) {
let lth = str.length - this.dqboxNO.length;
if (lth > 1) {
// 扫描的值
this.xhNo = str.substring(this.dqboxNO.length);
} else {
this.dqboxNO = str;
this.xhNo = str;
}
},
// 区分不同的扫描数据、输入数据做处理显示 xlh
setSMxlhstr(str) {
console.log('扫描的的值', str, this.xlhVal, this.dqboxXlh);
let lth = str.length - this.dqboxXlh.length;
if (lth > 1) {
// 扫描的值
this.xlhVal = str.substring(this.dqboxXlh.length);
console.log('处理扫描的的值', str, this.xlhVal, this.dqboxXlh);
} else {
this.dqboxXlh = str;
this.xlhVal = str;
}
},
// 输入确认
inputConfirm(val, type) {
if (val) {
if (this.focusTag == 'box') {
this.setSMstr(val.target.value);
this.getboxinfo();
}
if (this.focusTag == 'xlh') {
this.setSMxlhstr(val.target.value);
this.getXlhInfo();
}
}
},
// 扫描框数据重置,光标聚焦
setSMinputbox() {
this.focusInput = '';
setTimeout(() => {
this.xhNo = '';
this.dqboxNO = '';
this.focusInput = 'box';
this.xlhVal = '';
this.dqboxXlh = '';
this.xjNum = '';
}, 200);
},
// 根据箱号获取箱信息
getboxinfo() {
if (!this.xhNo) {
this.setSMinputbox();
uni.showToast({
title: '请扫描或输入箱号',
icon: 'none',
duration: 1000
});
return;
}
if (this.boxstrList.includes(this.xhNo)) {
this.setSMinputbox();
uni.showToast({
title: '该箱号已扫描',
icon: 'none',
duration: 1000
});
return;
}
this.focusInput = '';
this.$api
.get('/SysConfig/GetBoxSynthesis', {
boxBillNo: this.xhNo
})
.then((res) => {
if (res.status == 200) {
// 如果查询的箱号正常返回数据,就缓存改箱号信息
if (res.data) {
if (!res.data.stock) {
this.setSMinputbox();
uni.showToast({
title: '该箱号未上架',
icon: 'none',
duration: 1000
});
return;
}
// 缓存当前箱的物料信息
res.data.details.forEach((it) => {
it.boxId = res.data.id;
});
this.dqBoxInfo = JSON.parse(JSON.stringify(res.data));
if (res.data.details) {
res.data.details = res.data.details.filter((detail) => detail.qty > 0);
}
res.data.details.forEach((it) => {
it.wuToatal = JSON.parse(JSON.stringify(it.qty));
it.itxlhlist = [];
it.stockCode = res.data.stockCode;
it.subStockCode = res.data.subStockCode;
it.boxId = it.boxId;
it.remark = '';
});
this.dataList = [res.data].concat(this.dataList);
// 上架数量 当前扫箱的数量
this.xjNum = res.data.totalQty;
// 计算已上架总数量
this.yxjTotalNum = this.$util.sumNestedObjectValues(this.dataList, 'details', 'qty');
// 仓库
this.warehouseCode = res.data.stockCode;
this.warehouseName = res.data.stock;
this.cwcode = res.data.subStockCode;
this.erpOrgCode = res.data.orgCode;
//清空当前框数据 自动聚焦箱号
this.focusInput = 'box';
this.dqboxNO = res.data.boxBillNo;
this.xhNo = res.data.boxBillNo;
// 回车当前箱号
this.dqXH = res.data.boxBillNo;
// 缓存箱号
this.boxstrList.push(this.xhNo);
uni.showToast({
title: '获取成功',
icon: 'none',
duration: 1000
});
}
} else {
this.setSMinputbox();
}
});
},
// 扫描框数据重置,光标聚焦
setSMinputxlh() {
this.focusInput = '';
setTimeout(() => {
this.xlhVal = '';
this.dqboxXlh = '';
this.focusInput = 'xlh';
this.xjNum = null;
}, 200);
},
// 根据序列号获取箱信息
getXlhInfo() {
if (!this.xlhVal) {
this.setSMinputxlh();
uni.showToast({
title: '该扫描或输入序列号',
icon: 'none',
duration: 1000
});
return;
}
if (this.xlhstrList.includes(this.xlhVal) || this.twoData.includes(this.xlhVal)) {
this.setSMinputxlh();
uni.showToast({
title: '该序列号已扫描',
icon: 'none',
duration: 1000
});
return;
}
this.focusInput = '';
//根据序列号或规格型号搜索物料信息
this.$api
.get('/SysConfig/GetMaterial', {
serialNumber: this.xlhVal,
IsOps: true,
serialStatus: 3
})
.then((res) => {
if (res.status == 200) {
if (!res.data.serialNumber) {
this.setSMinputxlh();
uni.showToast({
title: '扫描的不是序列号',
icon: 'none',
duration: 1000
});
return;
}
if (!res.data.isBoxInventory) {
this.setSMinputxlh();
uni.showToast({
title: '序列号未上架入库',
icon: 'none',
duration: 1000
});
return;
}
if (res.data.isOldOps && res.data.boxId !== 0 && res.data.boxId !== this.dqBoxInfo.id) {
this.setSMinputxlh();
uni.showToast({
title: '该序列号不存在所扫箱内',
icon: 'none',
duration: 1000
});
return;
}
// 提取列表的物料id
let materialCodelist = [];
materialCodelist = this.dqBoxInfo.details.flatMap((obj) => obj.serialNumbers);
let czoldxlhtag = this.dqBoxInfo.details.findIndex((it) => it.materialNumber == res.data.materialNumber);
if (czoldxlhtag == -1 && res.data.isOldOps) {
this.setSMinputxlh();
uni.showToast({
title: '该序列号对应物料无箱库存',
icon: 'none',
duration: 1000
});
return;
}
// 判断当前扫描的序列号是否存在当前箱,不存在就提示
if (materialCodelist.includes(res.data.serialNumber) || (czoldxlhtag !== -1 && res.data.isOldOps)) {
this.xjNum = 1;
// 找到这条物料对应的明细的规格物料上架数量加一,切不可在编辑
let indexobj = null;
indexobj = this.$util.findMaterialCodePosition(this.dataList, res.data.materialNumber);
if (indexobj || indexobj == 0) {
// 如果是第一次扫,就清空上架数量,切锁住输入框不能在输入
if (this.dataList[indexobj.objectIndex].details[indexobj.detailIndex].itxlhlist.length == 0) {
this.dataList[indexobj.objectIndex].details[indexobj.detailIndex].qty = 0;
}
++this.dataList[indexobj.objectIndex].details[indexobj.detailIndex].qty;
this.dataList[indexobj.objectIndex].details[indexobj.detailIndex].itxlhlist.push(res.data.serialNumber);
}
// 计算已上架总数量
this.yxjTotalNum = this.$util.sumNestedObjectValues(this.dataList, 'details', 'qty');
// 设置光标和输入框的值
this.focusInput = 'xlh';
this.dqboxXlh = res.data.serialNumber;
this.xlhVal = res.data.serialNumber;
// 缓存序列号
this.xlhstrList.push(res.data.serialNumber);
//缓存2件装序列号
if(res.data.isTwo==2) {
this.twoData.push(res.data.twoSerialNumber)
}
uni.showToast({
title: '获取成功',
icon: 'none',
duration: 1000
});
} else {
this.setSMinputxlh();
uni.showToast({
title: '该序列号不存在所扫箱内',
icon: 'none',
duration: 1000
});
}
} else {
this.setSMinputxlh();
}
});
},
goback() {
uni.navigateTo({
url: '/pages/otherUnderwear/index'
});
}
}
};
</script>
<style lang="scss">
@import '@/static/public.scss';
.mianheade2 {
.pagetitle {
margin-left: 26%;
}
}
</style>

View File

@@ -0,0 +1,90 @@
<!--入库 -->
<template>
<view class="rkpage">
<!-- 标题栏 -->
<view class="mianheade" @click="goback()">
<image src="../../static/img/n_back.png" class="blacBackico"></image>
<text class="pagetitle">其他库内操作</text>
</view>
<view class="rkMuen">
<view class="item it50" @click="otherPage(1)">
<image src="../../static/img/qtrk_m1.png" class="rkico"></image>
<text class="t1" >快速改箱/装箱</text>
</view>
</view>
<view class="rkMuen">
<view class="item it50" @click="otherPage(2)">
<image src="../../static/img/qtrk_m3.png" class="rkico"></image>
<text class="t1" > 整箱移货下架</text>
</view>
<view class="item it50" @click="otherPage(3)">
<image src="../../static/img/qtrk_m2.png" class="rkico"></image>
<text class="t1">整箱移货上架</text>
</view>
</view>
<view class="rkMuen">
<view class="item it50" @click="otherPage(4)">
<image src="../../static/img/qtrk_m4.png" class="rkico"></image>
<text class="t1">出库回退上架</text>
</view>
<view class="item it50" @click="otherPage(5)">
<image src="../../static/img/qtrk_m5.png" class="rkico"></image>
<text class="t1">入库回退下架</text>
</view>
</view>
<view class="rkMuen">
<view class="item it50" @click="otherPage(6)">
<image src="../../static/img/outbound.png" class="rkico"></image>
<text class="t1">库存查询</text>
</view>
<view class="item it50" @click="otherPage(7)">
<image src="../../static/img/inventory.png" class="rkico"></image>
<text class="t1">出库箱信息</text>
</view>
</view>
</view>
</template>
<script>
//跳转路径集合
const TO_URLS = {
1:"/pages/otherUnderwear/fastSetbox",// 快速改箱/装箱
2:"/pages/otherUnderwear/moveBoxDown",// 整箱移货下架
3:"/pages/otherUnderwear/moveBoxup",// 整箱移货上架
4:"/pages/otherUnderwear/outStockUp",// 出库回退上架
5:"/pages/otherUnderwear/inStockDown",// 出库回退下架
6:"/pages/otherUnderwear/outbound",// 库存查询
7:"/pages/otherUnderwear/inventory"// 出库箱信息
}
export default {
data(){
return {
}
},
onBackPress(e) {
this.$util.appgoBack(e,'index')
return true
},
methods: {
goback() {
uni.navigateTo({
url: "/pages/index"
})
},
otherPage(type) {
uni.navigateTo({
url: TO_URLS[type]
})
}
}
}
</script>
<style lang="scss">
@import "@/static/public.scss";
.pagetitle{
margin-left: 28% !important;
}
</style>

View File

@@ -0,0 +1,401 @@
<!-- 出库箱查询 -->
<template>
<view class="shpage gx_zxpage">
<z-paging ref="paging" v-model="dataList" @query="queryList">
<template #top>
<!-- 标题 -->
<view class="mianheade mianheade2" @click="goback()">
<image src="../../static/img/n_baiback.png" class="blacBackico"></image>
<text class="pagetitle">出库箱信息</text>
</view>
<!-- 仓库&出库箱信息 -->
<view class="sh_gdInfo">
<view class="item" :class="{ itembg2: outboundOrderNumber }" :style="{ 'pointer-events': outboundOrderNumber ? 'none' : '' }">
<view class="it">
<text class="t1">
<text class="redtag">*</text>
仓库:
</text>
<w-select
class="wwselectit"
v-model.trim="warehouseName"
defaultValue="请选择"
:list="warehouseList"
valueName="name"
keyName="name"
@change="handleWareHouseChange"
@focus="inputfocus($event, 'ck')"
ref="wselectck"
></w-select>
</view>
</view>
<!-- 出库单号 -->
<view class="item" :class="{ itembg2: !warehouseName }" :style="{ 'pointer-events': !warehouseName ? 'none' : '' }">
<view class="it itsp">
<text class="t1">
<text class="redtag">*</text>
出库单号:
</text>
<w-select
style="margin-left: 20rpx; flex: 1"
v-model.trim="outboundOrderNumber"
defaultValue="模糊搜索"
:list="outboundOrderList"
valueName="billNo"
keyName="billNo"
@change="handleOutboundOrderChange"
:showClose="true"
:focus="focusInput == 'outboundOrderNumber'"
@focus="focusInput = 'outboundOrderNumber'"
:filterable="filterable"
:pagingSet="isPagingSet"
:wselectTotal="total"
@onBottomPage="onBottomPage"
:pageNo="pageNo"
:loadingFlag="loadingFlag"
@clearnFn="clearnFn"
selectTag="ckfsWselect"
></w-select>
</view>
</view>
</view>
<!-- 分割 -->
<view :style="{height:navHeight+formHeight+30+'rpx'}"></view>
<view class="th-box" >
<view class="th-item" style="" >
<view class="th br" style="width: 80rpx;">序号</view>
<view class="th br" style="width: 250rpx;">箱号</view>
<view class="th " style="width: 330rpx;">规格型号</view>
<!-- <view class="th" style="width: 140rpx;">出库数量</view> -->
</view>
</view>
</template>
<!-- border-bttom-radius: 12rpx; -->
<view :class="dataList.length ? 'td-box1' :'td-box'">
<view class="td-item" style="" v-for="(item,index) in dataList" :key="index" >
<view class="td br wd" style="width: 80rpx;">{{item.indexNumber}}</view>
<view class="td br wd" style="width: 250rpx;">{{item.boxBillNo}}</view>
<view class="td wd" style="width: 330rpx;">{{item.specifications}}({{item.qty}})</view>
<!-- <view class="td wd" style="width: 140rpx;">{{item.qty}}</view> -->
</view>
</view>
</z-paging>
</view>
</template>
<script>
export default {
data() {
return {
navHeight:0,
formHeight:0,
dataList:[],
focusInput: '', //自动聚焦
outboundOrderList:[],//出库单号列表
outboundOrderNumber:'',//出库单号
isPagingSet: true, // 是否开启出库单下拉分页
warehouseName: '', // 选择后的仓库名称
warehouseCode: '', // 选择后的仓库编码
warehouseList:[],//仓库列表数据
loadingFlag: 0, //分頁提示
pageNo: 1,//分页
filterable: true,
total:0,//出库单号列表数量
timer:null,
timer1:null,
};
},
onReady() {
this.getElHeight(".sh_gdInfo",1)
this.getElHeight(".mianheade",2)
},
onLoad() {
this.getStock();
},
onBackPress(e) {
//物理设备返回按钮,otherUnderwearIndex是返回当前/otherUnderwear/index下
this.$util.appgoBack(e, 'otherUnderwearIndex');
return true;
},
watch: {
outboundOrderNumber(n) {
if(!n) {
this.tableReload()
return
}
this.pageNo = 1;
this.outboundOrderList=[]
this.getOutboundOrderData(n)
},
},
methods: {
//获取元素高度
getElHeight(el,type){
this.$nextTick(()=>{
uni.createSelectorQuery().select(el).boundingClientRect((data) => {
if(type===1) {
/* #ifdef H5 */
this.navHeight = data.height
/*#endif*/
/*#ifdef APP-PLUS*/
this.navHeight = data.height+14
/*#endif*/
}else if(type===2) {
/* #ifdef H5 */
this.formHeight = data.height
/*#endif*/
/*#ifdef APP-PLUS*/
this.formHeight = data.height+14
/*#endif*/
}
}).exec();
})
},
//根据出库单号获取对应的下拉数据
getOutboundOrderData(val) {
// this.outboundOrderList=[]
clearTimeout(this.timer);
this.isPagingSet = false;
if (this.outboundOrderList.length >= this.total && this.pageNo >= 2) {
this.loadingFlag = 2;
return;
}
this.timer = setTimeout(() => {
this.$api
.post('/OutStockTask/GetOutStockTaskNosByNoBox', {
billNo: val,
pageSize: 10,
pageNo: this.pageNo,
stockCode: this.warehouseCode
})
.then((res) => {
if (res.status == 200) {
this.total = res.totalCount;
let newarr = res.data.map((item) => {
return {
billNo: item
};
});
// this.outboundOrderList.concat(newarr);
this.outboundOrderList = [...this.outboundOrderList,...newarr]
this.isPagingSet = true;
this.loadingFlag = 1;
} else {
this.isPagingSet = true;
this.total = res.totalCount;
console.log('走到了这里吗')
this.outboundOrderList=[]
}
}).catch(err=>{
this.outboundOrderList=[]
})
}, 1000);
},
//仓库
handleWareHouseChange(e) {
this.warehouseName = e.name;
this.warehouseCode = e.code+`_$${e.erpOrgCode}`;
this.outboundOrderList=[]
// this.$refs.paging.complete([]);
this.tableReload()
this.getOutboundOrderData(this.outboundOrderNumber);
this.focusInput=""
//选择仓库后获取该仓库的出库单号
setTimeout(()=>{
this.focusInput="outboundOrderNumber"
},300)
},
//出库单号改变
handleOutboundOrderChange(e){
console.log(this.outboundOrderNumber,'=outboundOrderNumber=')
this.queryList(1,10)
},
//表格刷新
tableReload() {
this.$refs.paging.reload().catch(() => {});
},
//清空出库单号值
clearnFn(val) {
this.outboundOrderNumber=''
this.outboundOrderList=[]
// this.$refs.paging.complete([]);
this.tableReload()
this.focusInput=""
//选择仓库后获取该仓库的出库单号
setTimeout(()=>{
this.focusInput="outboundOrderNumber"
},300)
this.getOutboundOrderData(this.outboundOrderNumber);
},
// 出库订单号查询分页
onBottomPage(val) {
this.pageNo = val;
this.loadingFlag = 1;
this.getOutboundOrderData(this.outboundOrderNumber);
},
//获取仓库数据
getStock() {
this.$api.get('/SysConfig/GetUcStock').then((res) => {
if (res.status == 200) {
this.warehouseList = res.data;
}
});
},
//请求时非200情况下z-paging组件设置和本地数据重置
setRefsPagingComplete() {
this.$refs.paging.complete(false);
this.outboundOrderNumber=""
this.focusInput="outboundOrderNumber"
},
//获取单号下的数据
queryList(pageNo, pageSize) {
if(!this.outboundOrderNumber) {
return
}
clearTimeout(this.timer1);
const params = {
pageNo:pageNo || 1,
pageSize: 10,
billNo:this.outboundOrderNumber,
};
this.timer1 = setTimeout(() => {
this.$api
.post(`/OutStockTask/GetInfoByNo`,params)
.then((res) => {
if (res.status == 200) {
this.$refs.paging.complete(res.data.details);
} else {
this.$refs.paging.complete(false);
this.setRefsPagingComplete()
}
}).catch(res=>{
this.setRefsPagingComplete()
})
},1000)
},
//回退
goback() {
uni.navigateTo({
url: '/pages/otherUnderwear/index'
});
},
}
};
</script>
<style lang="scss">
@import "@/static/public.scss";
.mianheade2 {
.pagetitle {
margin-left: 30%;
}
}
.item1 {
position: relative;
height: 150rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0rpx 30rpx;
}
.item1-detail {
padding: 5rpx 15rpx;
border-radius: 10rpx;
font-size: 28rpx;
color: white;
background-color: #007AFF;
}
.item1-line {
position: absolute;
bottom: 0rpx;
left: 0rpx;
height: 1px;
width: 100%;
background-color: #eeeeee;
}
.table--border {
// border:1rpx solid red
}
.th {
color: #505050;
// border-right: 1rpx solid #E3E5E8;
background-color:#F0F2F5;
display: flex;
align-items: center;
justify-content: center;
padding: 10rpx;
font-weight: 900;
height: 44rpx;
}
.th-box {
margin: 0 24rpx;
padding:20rpx 20rpx 0 20rpx;
background-color: #fff;
border-top-left-radius: 12rpx;
border-top-right-radius: 12rpx;
}
.th-item {
box-sizing: border-box;
display:flex;
font-size:13px;
border: 1rpx solid #E3E5E8;
border-top: 1rpx solid #E3E5E8;
border-top-left-radius: 12rpx;
border-top-right-radius: 12rpx;
}
.td-box {
margin: 0 24rpx;
padding:0 20rpx 20rpx 20rpx;
background-color: #fff;
// border-bottom-left-radius: 12rpx;
// border-bottom-right-radius: 12rpx;
}
.td-box1 {
margin: 0 24rpx;
padding:0 20rpx 20rpx 20rpx;
background-color: #fff;
border-bottom-left-radius: 12rpx;
border-bottom-right-radius: 12rpx;
}
.td-item {
box-sizing: border-box;
display:flex;
font-size:13px;
border: 1rpx solid #E3E5E8;
border-top:none;
border-bottom-left-radius: 12rpx;
border-bottom-right-radius: 12rpx;
}
.td {
display: flex;
align-items: center;
justify-content:center;
text-align: center;
min-height: 140rpx;
background-color: #fff;
padding: 10rpx;
// border-right: 1rpx solid #E3E5E8;
// border-left: 1rpx solid #E3E5E8;
}
.br {
border-right: 1rpx solid #E3E5E8;
}
.wd {
word-wrap: break-word;
white-space:normal ;
word-break: break-all;
}
</style>

View File

@@ -0,0 +1,331 @@
<!-- 整箱移货下架 -->
<template>
<view class="shpage zxyhsjpage">
<!-- 标题栏 -->
<view class="mianheade mianheade2" @click="goback()">
<image src="../../static/img/n_baiback.png" class="blacBackico"></image>
<text class="pagetitle">整箱移货下架</text>
</view>
<!-- 固定内容-->
<view class="sh_gdInfo">
<view class="item itembg2">
<view class="it">
<text class="t1">仓库: </text>
<text class="t2">{{warehouseName}}</text>
</view>
</view>
<view class="item">
<view class="it itsp">
<text class="t1"><text class="redtag">*</text>箱号: </text>
<input v-model="boxNo" class="inpt1" type="text" @focus="inputfocus($event,'box')"
@blur="inputblur($event,'')" @confirm="inputConfirm($event,'box')"
:focus="focusInput == 'box'" />
<image src="../../static/img/smico.png" class="searchico" @click="scanImg('box')"></image>
</view>
</view>
<view class="item itembg2">
<view class="it">
<text class="t1">仓位: </text>
<text class="t2">{{cwName}}</text>
</view>
</view>
<view class="item item2">
<view class="it2 it50">
<text class="t1">{{boxstrList.length}}</text>
<text class="t2">已扫描箱数</text>
</view>
<view class="it2 it50">
<text class="t1 rednum">{{totalNum}}</text>
<text class="t2">总数量</text>
</view>
</view>
</view>
<!-- 列表内容-->
<view class="shlb cgsjrklb jscklb" :style="{'margin-top':heights.top+'px','height':heights.body+'px'}">
<view class="item" v-for="(item,index) in dataList" :key="index">
<view class="it">
<!-- 箱号 -->
<text class="txt titstr">{{item.boxBillNo}}</text>
<view v-for="(cit,index) in item.details" class="ibgt" :key="index+'a'">
<text class="txt">{{cit.specifications}}</text>
<view class="txt txtflexnum">
<text class="txt">{{cit.materialNumber}}</text>
<text class="txt"> {{cit.qty}}</text>
</view>
</view>
</view>
</view>
</view>
<!-- 底部按钮固定-->
<view class="footbts">
<view class="bt bt1" @click="qktkshow = true">清空下架数量</view>
<view class="bt bt2" @click="wcNxetFn">完成/下一单</view>
</view>
<!--清空二次确认弹框-->
<u-modal :show="qktkshow" :title="qktkTitle" :content='qktkContent' @confirm="qktkconfirm"
:showCancelButton='true' @cancel="qktkshow = false" @></u-modal>
</view>
</template>
<script>
export default {
data() {
return {
heights: {
top: 0,
body: 0,
},
focusInput: 'box', // 自动聚焦
warehouseName: '', // 仓库名称 根据箱号带出来的会实时更新
boxNo: '', // 箱号的值
cwIds: [], // 仓位id集合
boxstrList: [], // 缓存的箱号信息(多个)
cwName: '', // 仓位名
totalNum: 0, // 总数量
dataList: [], // 列表明细数据
focusTag: '', // 判断聚焦
qktkshow: false, //清空二次确认弹框
qktkTitle: '确定清空下架数量?',
qktkContent: "清空后页面数据将不保存",
tjdata: [], // 页面提交数据
dqboxNO: '', //用来是否保存当前输入箱号的值
APPdevice: uni.getStorageSync('devicePixelRatio'), // 缓存设备的像素比用来区分普通安卓normalAnroid还是pda
requestStatus: false, // 请求状态识别变量
scanTracker: {
lastScanTime: 0,
lastScanCode: null
}, // 源头处理扫码段时间内重复扫
}
},
watch: {
boxNo(n) {
if (!n) {
this.dqboxNO = ''
}
},
chooseValue(n, o) {}
},
onReady() {
this.heights = this.$util.setlistHeight('.sh_gdInfo', '.footbts')
},
onLoad() {
//获取广播扫码监听
this.$broadcastScan.init(this.getScancode)
this.$broadcastScan.start();
this.stopScanCode()
this.startScanCode()
},
onHide() {
this.$broadcastScan.stop();
this.stopScanCode()
},
onShow() {
this.$broadcastScan.start();
this.startScanCode()
},
onBackPress(e) {
this.$util.appgoBack(e,'otherUnderwearIndex')
return true
},
methods: {
// 开启广播
startScanCode() {
uni.$on('xwscan', (res) => {
const now = Date.now();
const timeSinceLastScan = now - this.scanTracker.lastScanTime;
// 如果扫描的箱码和上次相同并且时间间隔小于500ms则不作处理
if ((res.code === this.scanTracker.lastScanCode) && (timeSinceLastScan < 4000)) {
return;
} else {
// 更新扫描跟踪信息
this.scanTracker.lastScanTime = now;
this.scanTracker.lastScanCode = res.code;
this.getScancode(res.code)
}
})
},
// 关闭广播
stopScanCode() {
uni.$off('xwscan')
},
// 完成完成/下一单
wcNxetFn() {
if (this.boxstrList.length == 0) {
uni.showToast({
title: '请先输入必填值',
icon: 'none',
duration: 1000
})
return
}
// 节流
if (this.requestStatus) {
return false;
}
this.requestStatus = true
this.$api.post('/MoveBoxRecord/Down_Save', this.tjdata).then(res => {
if (res.status == 200) {
uni.showToast({
title: '成功',
icon: 'none',
duration: 1000
})
setTimeout(() => {
uni.navigateTo({
url: '/pages/otherUnderwear/moveBoxDown'
})
}, 200);
// this.$router.go(0)
}
})
setTimeout(() => {
this.requestStatus = false;
}, 1500);
},
// 清空二次确认
qktkconfirm() {
this.warehouseName = ''
this.cwName = ''
this.boxNo = ''
this.boxstrList = []
this.dataList = []
this.tjdata = []
this.totalNum = 0
this.cwId = ''
this.qktkshow = false
},
// 区分不同的扫描数据、输入数据做处理显示 box
setSMstr(str) {
let lth = str.length - this.dqboxNO.length
console.log('区分不同的扫描数据、输入数据做处理显示 box', str, this.dqboxNO, lth, str.substring(this.dqboxNO.length))
if (lth > 1) {
// 扫描的值
this.boxNo = str.substring(this.dqboxNO.length)
} else {
this.dqboxNO = str
this.boxNo = str
}
},
// 输入确认
inputConfirm(val, type) {
if (val) {
if (this.focusTag == 'box') {
this.setSMstr(val.target.value)
this.getboxinfo()
}
}
},
// 輸入失去焦點
inputblur(val, type) {
this.focusTag = type
// console.log('輸入失去焦點', val, type)
},
// 输入聚焦
inputfocus(val, type) {
this.focusTag = type
},
// 普通安卓设备碘酒扫描图标扫描
scanImg(type) {
if (this.APPdevice == "normalAnroid") {
this.$util.doScanQrCode().then(res => {
this.focusInput = type
this.focusTag = type
this.getScancode(res.result)
})
}
},
// 获取扫描的值
getScancode(code) {
if (this.focusTag == 'box') {
// 有些PDA会自带换行符trim函数处理下
this.boxNo = ''
this.boxNo = code.trim()
this.getboxinfo()
}
},
// 扫描框数据重置,光标聚焦
setSMinputbox() {
this.focusInput = ''
setTimeout(() => {
this.boxNo = ''
this.focusInput = 'box'
this.dqboxNO = ''
}, 200)
},
// 根据箱号获取信息
getboxinfo() {
if (!this.boxNo) {
this.setSMinputbox()
uni.showToast({
title: '请扫描需要上架的箱号',
icon: 'none',
duration: 1000
})
return
}
if (this.boxstrList.includes(this.boxNo)) {
this.setSMinputbox()
uni.showToast({
title: '该箱号已扫描',
icon: 'none',
duration: 1000
})
return
}
this.focusInput = ''
this.$api.get('/Inventory/GetBoxInventoryDetails/' + this.boxNo).then(res => {
if (res.status == 200) {
let thetotalQty = res.data.totalQty ? res.data.totalQty : 0
let newDetails = [];
for (let i = 0; i < res.data.details.length; i++) {
if (res.data.details[i].qty !== 0) {
newDetails.push(res.data.details[i]);
}
}
res.data.details = newDetails
// 页面提交数据
this.tjdata.push({
boxId: res.data.boxId,
subStockCode: res.data.subStockCode,
qty: thetotalQty,
details: res.data.details
})
this.cwName = res.data.subStock
this.warehouseName = res.data.stock
this.dataList.push(res.data)
// 缓存当前箱
this.boxstrList.push(res.data.boxBillNo)
//扫描当前箱
this.boxNo = res.data.boxBillNo
this.dqboxNO = res.data.boxBillNo
// 总数量
this.totalNum = this.totalNum + thetotalQty
uni.showToast({
title: '获取成功',
icon: 'none',
duration: 1000
})
}
//清空当前框数据 自动聚焦箱号
this.setSMinputbox()
})
},
goback() {
uni.navigateTo({
url: "/pages/otherUnderwear/index"
})
}
}
}
</script>
<style lang="scss">
@import "@/static/public.scss";
.mianheade2 {
.pagetitle {
margin-left: 30%;
}
}
</style>

View File

@@ -0,0 +1,390 @@
<!-- 整箱移货上架 -->
<template>
<view class="shpage zxyhsjpage">
<!-- 标题栏 -->
<view class="mianheade mianheade2" @click="goback()">
<image src="../../static/img/n_baiback.png" class="blacBackico"></image>
<text class="pagetitle">整箱移货上架</text>
</view>
<!-- 固定内容-->
<view class="sh_gdInfo">
<view class="item itembg2">
<view class="it">
<text class="t1"><text class="redtag">*</text>仓库: </text>
<text class="t2">{{warehouseName}}</text>
</view>
</view>
<view class="item" :class="{'itembg2':boxstrList&&boxstrList.length>0}"
:style="{'pointer-events':boxstrList&&boxstrList.length>0?'none':''}">
<view class="it itsp">
<text class="t1"><text class="redtag">*</text>目标仓位号: </text>
<w-select class="wwselectit" v-model='cwNum' defaultValue="模糊搜索" :list='cwselectList'
valueName='name' keyName="name" @change='cwchange' :filterable='filterable' ref="wselect1"
@focus="inputfocus($event,'cw')" :focus="focusInput=='cw'" :showClose='true'>
</w-select>
<image src="../../static/img/smico.png" class="searchico" @click="scanImg('cw')"></image>
</view>
</view>
<view class="item" :class="{'itembg2':!cwcode}" :style="{'pointer-events':!cwcode?'none':''}">
<view class="it itsp">
<text class="t1"><text class="redtag">*</text>箱号: </text>
<input v-model="boxNo" class="inpt1" type="text" @focus="inputfocus($event,'box')"
@blur="inputblur($event,'')" @confirm="inputConfirm($event,'box')"
:focus="focusInput == 'box'" />
<image src="../../static/img/smico.png" class="searchico" @click="scanImg('box')"></image>
</view>
</view>
<view class="item item2">
<view class="it2 it50">
<text class="t1">{{boxstrList.length}}</text>
<text class="t2">已扫描箱数</text>
</view>
<view class="it2 it50">
<text class="t1 rednum">{{totalNum}}</text>
<text class="t2">总数量</text>
</view>
</view>
</view>
<!-- 列表内容-->
<view class="shlb cgsjrklb jscklb" :style="{'margin-top':heights.top+'px','height':heights.body+'px'}">
<view class="item" v-for="(item,index) in dataList" :key="index">
<view class="it">
<!-- 箱号 -->
<text class="txt titstr">{{item.boxBillNo}}</text>
<view v-for="(cit,index) in item.details" class="ibgt" :key="cit.specifications">
<text class="txt">{{cit.specifications}}</text>
<view class="txt txtflexnum">
<text class="txt">{{cit.materialNumber}}</text>
<text class="txt"> {{cit.qty}}</text>
</view>
</view>
</view>
</view>
</view>
<!-- 底部按钮固定-->
<view class="footbts">
<view class="bt bt1" @click="qktkshow = true">清空上架数量</view>
<view class="bt bt2" @click="wcNxetFn">完成/下一单</view>
</view>
<!--清空二次确认弹框-->
<u-modal :show="qktkshow" :title="qktkTitle" :content='qktkContent' @confirm="qktkconfirm"
:showCancelButton='true' @cancel="qktkshow = false"></u-modal>
</view>
</template>
<script>
export default {
data() {
return {
heights: {
top: 0,
body: 0,
},
focusInput: 'cw', // 自动聚焦
filterable: true, //下拉模糊搜索是否开启
warehouseName: '', // 仓库名称 根据箱号带出来的会实时更新
warehouseCode: '', // 仓库编码
cwNum: '', // 仓位值
cwselectList: [], //仓位下拉集合
cwcode: '', // 仓位code
boxNo: '', //箱号值
boxstrList: [], // 缓存的箱号信息(多个)
totalNum: 0, // 总数量
dataList: [], // 明细数据
focusTag: '', // 判断聚焦
qktkshow: false, //清空二次确认弹框
qktkTitle: '确定清空上架数量?',
qktkContent: "清空后页面数据将不保存",
tjdata: [], // 页面提交数据
dqboxNO: '', //用来是否保存当前输入箱号的值
APPdevice: uni.getStorageSync('devicePixelRatio'), // 缓存设备的像素比用来区分普通安卓normalAnroid还是pda
requestStatus: false, // 请求状态识别变量
scanTracker: {
lastScanTime: 0,
lastScanCode: null
}, // 源头处理扫码段时间内重复扫
}
},
watch: {
boxNo(n) {
if (!n) {
this.dqboxNO = ''
}
},
// 仓位下拉数据
cwNum(n, o) {
if(!n){
this.cwselectList =[]
this.cwcode = null
this.warehouseCode = null
this.warehouseName = null
this.orgCode = null
} else {
this.getcwList(n)
}
}
},
onReady() {
this.heights = this.$util.setlistHeight('.sh_gdInfo', '.footbts')
},
onLoad() {
//获取广播扫码监听
this.$broadcastScan.init(this.getScancode)
this.$broadcastScan.start();
this.stopScanCode()
this.startScanCode()
},
onHide() {
this.$broadcastScan.stop();
this.stopScanCode()
},
onShow() {
this.$broadcastScan.start();
this.startScanCode()
},
onBackPress(e) {
this.$util.appgoBack(e,'otherUnderwearIndex')
return true
},
methods: {
// 开启广播
startScanCode() {
uni.$on('xwscan', (res) => {
const now = Date.now();
const timeSinceLastScan = now - this.scanTracker.lastScanTime;
// 如果扫描的箱码和上次相同并且时间间隔小于500ms则不作处理
if ((res.code === this.scanTracker.lastScanCode) && (timeSinceLastScan < 4000)) {
return;
} else {
// 更新扫描跟踪信息
this.scanTracker.lastScanTime = now;
this.scanTracker.lastScanCode = res.code;
this.getScancode(res.code)
}
})
},
// 关闭广播
stopScanCode() {
uni.$off('xwscan')
},
// 完成完成/下一单
wcNxetFn() {
if (!this.cwcode || this.boxstrList.length == 0) {
uni.showToast({
title: '请先输入必填值',
icon: 'none',
duration: 1500
})
return
}
// 节流
if (this.requestStatus) {
return false;
}
this.requestStatus = true
this.$api.post('/MoveBoxRecord/Up_Save', this.tjdata).then(res => {
if (res.status == 200) {
uni.showToast({
title: '成功',
icon: 'none',
duration: 1500
})
setTimeout(() => {
uni.navigateTo({
url: '/pages/otherUnderwear/moveBoxup'
})
}, 200);
// this.$router.go(0)
}
})
setTimeout(() => {
this.requestStatus = false;
}, 1500);
},
// 清空二次确认
qktkconfirm() {
this.boxNo = ''
this.boxstrList = []
this.dataList = []
this.tjdata = []
this.totalNum = 0
this.qktkshow = false
this.focusInput =''
setTimeout(() =>{
if(!this.cwcode){
this.focusInput ='cw'
} else {
this.focusInput = 'box'
}
}, 200)
},
// 区分不同的扫描数据、输入数据做处理显示 box
setSMstr(str) {
let lth = str.length - this.dqboxNO.length
if (lth > 1) {
// 扫描的值
this.boxNo = str.substring(this.dqboxNO.length)
} else {
this.dqboxNO = str
this.boxNo = str
}
},
// 输入确认
inputConfirm(val, type) {
if (val) {
if (this.focusTag == 'box') {
this.setSMstr(val.target.value)
this.getboxinfo()
}
}
},
// 輸入失去焦點
inputblur(val, type) {},
// 输入聚焦
inputfocus(val, type) {
this.focusTag = type
if (type == 'cw') {
this.focusInput = 'cw'
}
},
// 获取仓位下拉数据
getcwList(val) {
if (!val) return
this.$api.get('/SysConfig/GetSubUcStockByName', {
name: val
}).then(res => {
if (res.status == 200) {
this.cwselectList = res.data
if (this.cwselectList && this.cwselectList.length == 1) {
this.cwNum = this.cwselectList[0].name
this.cwchange(this.cwselectList[0])
this.$refs.wselect1.optionsShow = false
this.$refs.wselect1.isShow = false
}
}
})
},
// 仓位下拉选择
cwchange(e) {
this.cwcode = e.code
this.stockId = e.stockId
this.warehouseCode = e.stockCode
this.warehouseName = e.stockName
this.focusInput = 'box'
},
// 普通安卓设备碘酒扫描图标扫描
scanImg(type) {
if (this.APPdevice == "normalAnroid") {
this.$util.doScanQrCode().then(res => {
this.focusInput = type
this.focusTag = type
this.getScancode(res.result)
})
}
},
// 获取扫描的值
getScancode(code) {
if (this.focusTag == 'box') {
// 有些PDA会自带换行符trim函数处理下
this.boxNo = ''
this.boxNo = code.trim()
this.getboxinfo()
}
// 序列号
if (this.focusTag == 'cw') {
this.cwNum = ''
this.cwNum = code.trim()
this.$refs.wselect1.inputData = code.trim()
this.getcwList()
//根据序列号去更新对应的明细规格型号的上架数量的值 扫描一个数量加一,重复扫描要提示
}
},
// 扫描框数据重置,光标聚焦
setSMinputbox() {
this.focusInput = ''
setTimeout(() => {
this.boxNo = ''
this.focusInput = 'box'
this.dqboxNO = ''
}, 200)
},
// 根据箱号获取信息
getboxinfo() {
if (!this.boxNo) {
this.setSMinputbox()
uni.showToast({
title: '请扫描需要上架的箱号',
icon: 'none',
duration: 1000
})
return
}
if (this.boxstrList.includes(this.boxNo)) {
this.setSMinputbox()
uni.showToast({
title: '该箱号已扫描',
icon: 'none',
duration: 1000
})
return
}
this.focusInput = ''
this.$api.get('/SysConfig/GetBox_MoveBoxRecord', {
boxBillNo: this.boxNo,
}).then(res => {
if (res.status == 200) {
if (res.data.subStockCode) {
this.setSMinputbox()
uni.showToast({
title: '箱号已上架入库',
icon: 'none',
duration: 1500
})
return
}
// 页面提交数据
let thetotalQty = 0
thetotalQty = this.$util.sumObjectArrayValues(res.data.details, 'qty')
this.tjdata.push({
boxId: res.data.id,
subStockCode: this.cwcode,
qty: thetotalQty,
details: res.data.details
})
this.dataList.push(res.data)
// 总数量
this.totalNum = this.totalNum + thetotalQty
// 缓存箱号
this.boxstrList.push(res.data.boxBillNo)
// 扫描当前
this.dqboxNO = res.data.boxBillNo
this.boxNo = res.data.boxBillNo
uni.showToast({
title: '获取成功',
icon: 'none',
duration: 1000
})
}
//清空当前框数据 自动聚焦箱号
this.setSMinputbox()
})
},
goback() {
uni.navigateTo({
url: "/pages/otherUnderwear/index"
})
}
}
}
</script>
<style lang="scss">
@import "@/static/public.scss";
.mianheade2 {
.pagetitle {
margin-left: 30%;
}
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,561 @@
<!-- 库存查询 -->
<template>
<view class="shpage gx_zxpage">
<z-paging ref="paging" v-model="dataList" @query="queryList">
<template #top>
<!-- 标题 -->
<view class="mianheade mianheade2" @click="goback()">
<image src="../../static/img/n_baiback.png" class="blacBackico"></image>
<text class="pagetitle">库存查询</text>
</view>
<!-- 仓库&出库箱信息 -->
<view class="sh_gdInfo">
<view class="item" :class="{ itembg2: inputVal }" :style="{ 'pointer-events': inputVal ? 'none' : '' }">
<view class="it">
<text class="t1">
<text class="redtag">*</text>
仓库:
</text>
<w-select
class="wwselectit"
v-model.trim="warehouseName"
defaultValue="请选择"
:list="warehouseList"
valueName="name"
keyName="name"
@change="handleWareHouseChange"
@focus="inputfocus($event, 'ck')"
ref="wselectck"
></w-select>
</view>
</view>
<!-- 無聊 -->
<view class="item" :class="{ itembg2: !warehouseName }" :style="{ 'pointer-events': !warehouseName ? 'none' : '' }">
<view class="" style="display: flex;padding: 10rpx 0; margin:0 40rpx;border-bottom: 1rpx solid #E3E5E8; box-sizing: border-box;">
<view style="border-right: 1rpx solid #E3E5E8;padding-right: 16rpx;">
<uni-data-select
v-model="selectValue"
:localdata="options"
@change="hanldeSelectChange"
:clear="false"
></uni-data-select>
</view>
<view style="display: flex; align-items: center;justify-content: center;">
<u-input :focus="focusTag==='box'" @clear="handleClear" border="bottom" :style="{width: inputWidth}" style="font-size: 14px; height:32rpx;"clearable v-model="inputVal" @confirm="handleInputConfirm()"
></u-input>
</view>
<view style="display: flex;align-items: center;"@click="scanImg('box')">
<image src="../../static/img/smico.png" class="searchico" style="margin-left:0;"></image>
</view>
</view>
</view>
</view>
<view :style="{height:navHeight+formHeight+30+'rpx'}"></view>
<view style="padding: 20rpx 16rpx 0;background-color: #fff;margin:0 24rpx;border-top-left-radius: 12rpx;border-top-right-radius: 12rpx;">
<!-- 详情 -->
<view style="font-size: 14px;padding-left:12rpx;color: #717275;">
<view v-if="selectValue===1">
<view style="padding-bottom: 10rpx;">
<text>查询物料为</text>
<text style="margin: 0 10rpx;">:</text>
<text style="color:#222222">{{specifications}}</text>
</view>
<view style="padding-bottom: 10rpx; display: flex;">
<view style="width: 140rpx;text-align-last: justify;">物料编码</view>
<view style="margin: 0 10rpx;">:</view>
<view style="color:#222222" >{{materialNumber}}</view>
</view>
<view style="padding-bottom: 10rpx; display: flex;">
<view style="width: 140rpx;text-align-last: justify;">物料名称</view>
<view style="margin: 0 10rpx;">:</view>
<view style="color:#222222">{{materialName}}</view>
</view>
<view style="padding-bottom: 10rpx; display: flex;">
<view style="width: 140rpx;text-align-last: justify;">库存总数</view>
<view style="margin: 0 10rpx;">:</view>
<view style="color:#222222">{{totalQty}}</view>
</view>
</view>
<!-- 箱号详情 -->
<view v-if="selectValue===2">
<view style="padding-bottom: 10rpx; display: flex;">
<view>查询箱号为</view>
<view style="margin: 0 10rpx;">:</view>
<view style="color:#4178D5" @click="goInventory()">{{boxBillNo}}</view>
</view>
<view style="padding-bottom: 10rpx;display: flex;">
<view style="width: 140rpx;text-align-last: justify;">所在仓位</view>
<view style="margin: 0 10rpx;">:</view>
<view style="color:#222222">{{subStock}}</view>
</view>
<view style="padding-bottom: 10rpx;display: flex;">
<view style="width: 140rpx;text-align-last: justify;">库存总数</view>
<view style="margin: 0 10rpx;">:</view>
<view style="color:#222222">{{totalQty}}</view>
</view>
</view>
<!-- 仓位详情 -->
<view v-if="selectValue===3">
<view style="padding-bottom: 10rpx;display: flex;">
<view>查询仓位为</view>
<view style="margin: 0 10rpx;">:</view>
<view style="color:#222222">{{subStock}}</view>
</view>
<view style="padding-bottom: 10rpx;display: flex;">
<view style="width: 140rpx;text-align-last: justify;">库存总数</view>
<view style="margin: 0 10rpx;">:</view>
<view style="color:#222222">{{totalQty}}</view>
</view>
</view>
<view style="font-weight: 900;padding-top: 10rpx;padding-bottom: 12rpx;color:#222222">
库存详情 :
</view>
</view>
<!-- 库存详情表格 -->
<!-- 物料 -->
<view class="th-item" v-if="selectValue===1" >
<view class="th br" style="width: 210rpx;">箱号</view>
<view class="th br" style="width: 360rpx;">仓位</view>
<view class="th" style="width: 80rpx;">数量</view>
</view>
<!-- 箱号 -->
<view class="th-item" v-if="selectValue===2">
<view class="th br" style="width: 570rpx;">规格型号</view>
<view class="th" style="width: 80rpx;">数量</view>
</view>
<!-- 仓位 -->
<view class="th-item" v-if="selectValue===3">
<view class="th br" style="width: 210rpx;">箱号</view>
<view class="th br" style="width: 360rpx;">规格型号</view>
<view class="th" style="width: 80rpx;">数量</view>
</view>
</view>
</template>
<!-- border-bottom-left-radius: 12rpx;border-bottom-right-radius: 12rpx; -->
<view :class="dataList.length ? 'c-box':'c-box1'">
<!-- 物料 -->
<view v-if="selectValue===1">
<view class="td-item" v-for="(item,index) in dataList" :key="index" >
<view class="td br wd" style="width: 210rpx;color:#4178D5" @click="goInventory(item)">{{item.boxBillNo}}</view>
<view class="td br wd" style="width: 360rpx;">{{item.subStock}}</view>
<view class="td wd" style="width: 80rpx;">{{item.qty}}</view>
</view>
</view>
<!-- 箱号 -->
<view v-if="selectValue===2">
<view class="td-item" v-for="(item,index) in dataList" :key="index" >
<view class="td br wd" style="width: 570rpx;">{{item.specifications}}</view>
<view class="td wd" style="width: 80rpx;">{{item.qty}}</view>
</view>
</view>
<!-- 仓位 -->
<view v-if="selectValue===3">
<view class="td-item" v-for="(item,index) in dataList" :key="index" >
<view class="td br wd" style="width: 210rpx;color:#4178D5" @click="goInventory(item)">{{item.boxBillNo}}</view>
<view class="td br wd" style="width: 360rpx;">{{item.specifications}}</view>
<view class="td wd" style="width: 80rpx;">{{item.qty}}</view>
</view>
</view>
</view>
</z-paging>
</view>
</template>
<script>
export default {
data() {
return {
navHeight:0,
formHeight:0,
options:[
{value:1,text:'物料'},
{value:2,text:'箱号'},
{value:3,text:'仓位'}
],
selectValue:1,//下拉框值
materialName:"",//物料名称
materialNumber:"",//物料编码
specifications:"",//规格型号
totalQty:"",//总数量
subStock:"",//仓位名称
boxBillNo:"CTN00051426",//箱号
dataList: [],//列表数据
focusTag: '', // 判断聚焦
warehouseName: '', // 选择后的仓库名称
warehouseCode: '', // 选择后的仓库编码
warehouseList:[],//仓库列表数据
inputVal:'',//input输入值
timer:null,
inputWidth:"470rpx",
timer1:null,
APPdevice: uni.getStorageSync('devicePixelRatio'), // 缓存设备的像素比用来区分普通安卓normalAnroid还是pda
scanTracker: {
lastScanTime: 0,
lastScanCode: null
} // 源头处理扫码段时间内重复扫
};
},
onReady() {
this.getElHeight(".sh_gdInfo",1)
this.getElHeight(".mianheade",2)
/* #ifdef H5 */
this.inputWidth = '470rpx'
/*#endif*/
/*#ifdef APP-PLUS*/
this.inputWidth = '422rpx'
/*#endif*/
},
onLoad() {
//获取广播扫码监听
this.$broadcastScan.init(this.getScancode);
this.$broadcastScan.start();
this.stopScanCode();
this.startScanCode();
this.getStock()
// this.$refs.paging.complete([]);
// this.queryList(1,10);
},
onHide() {
this.$broadcastScan.stop();
this.stopScanCode();
},
onShow() {
this.$broadcastScan.start();
this.startScanCode();
},
onBackPress(e) {
this.$util.appgoBack(e, 'otherUnderwearIndex');
return true;
},
watch: {
inputVal(n) {
if(!n) {
this.dataList=[]
//表格刷新
this.tableReload()
return
}
},
},
methods: {
//获取元素高度
getElHeight(el,type){
this.$nextTick(()=>{
uni.createSelectorQuery().select(el).boundingClientRect((data) => {
if (data) {
if(type===1) {
/* #ifdef H5 */
this.navHeight = data.height
/*#endif*/
/*#ifdef APP-PLUS*/
this.navHeight = data.height+20
/*#endif*/
}else if(type===2) {
/* #ifdef H5 */
this.formHeight = data.height
/*#endif*/
/*#ifdef APP-PLUS*/
this.formHeight = data.height+20
/*#endif*/
}
}
}).exec();
})
},
// 开启广播
startScanCode() {
uni.$on('xwscan', (res) => {
const now = Date.now();
const timeSinceLastScan = now - this.scanTracker.lastScanTime;
// 如果扫描的箱码和上次相同并且时间间隔小于500ms则不作处理
if (res.code === this.scanTracker.lastScanCode && timeSinceLastScan < 4000) {
return;
} else {
// 更新扫描跟踪信息
this.scanTracker.lastScanTime = now;
this.scanTracker.lastScanCode = res.code;
this.getScancode(res.code);
}
});
},
// 关闭广播
stopScanCode() {
uni.$off('xwscan');
},
// 普通安卓设备碘酒扫描图标扫描
scanImg(type) {
if (this.APPdevice == 'normalAnroid') {
this.$util.doScanQrCode().then((res) => {
this.focusTag = type;
this.getScancode(res.result);
});
}
},
// 获取扫描的值
getScancode(code, index, wlcode) {
// 有些PDA会自带换行符trim函数处理下
this.inputVal = '';
this.dataList=[];
this.inputVal= code.trim();
//表格刷新
this.tableReload()
this.queryList(1,10);
},
//仓库
handleWareHouseChange(e) {
//仓库名称
this.warehouseName = e.name;
//仓库code
this.warehouseCode = e.code+`_$${e.erpOrgCode}`;
this.tableReload()
this.setInputTagBox()
},
//获取仓库数据
getStock() {
this.$api.get('/SysConfig/GetUcStock').then((res) => {
if (res.status == 200) {
this.warehouseList = res.data;
}
});
},
//软键盘确认
handleInputConfirm() {
this.dataList=[];
//表格刷新
this.tableReload()
this.queryList(1,10);
},
//清空获取的值
clearValue(){
this.materialName="";//物料名称
this.materialNumber="";//物料编码
this.specifications="";//规格型号
this.totalQty="";//总数量
this.subStock="";//仓位名称
this.boxBillNo="";//箱号
this.inputVal = "";//input输入框
this.dataList =[];//表格数据
},
//表格刷新
tableReload() {
this.$refs.paging.reload().catch(() => {});
},
//下拉框改变
hanldeSelectChange(e) {
this.clearValue();
//表格刷新
this.tableReload()
this.setInputTagBox()
},
//设置input聚焦
setInputTagBox() {
this.focusTag="";
setTimeout(()=>{
this.focusTag="box";
},200)
},
//库存详情赋值
setDetailsValue(data) {
const {materialNumber,materialName,specifications,subStock,boxBillNo,totalQty} = data
console.log(totalQty,'=totalQty=')
this.totalQty = totalQty ;
this.materialNumber = materialNumber;
this.materialName = materialName;
this.specifications = specifications;
this.subStock = subStock ;
this.boxBillNo = boxBillNo;
},
//表格數據
queryList(pageNo, pageSize) {
//空值直接return
if(!this.inputVal) {
return
}
clearTimeout(this.timer1);
//根据不同的this.selectValue值匹配不同的后端接口
//说明:1为物料 2为箱号 3仓位
const url = {
1:"/Inventory/GetPagedListBoxByMaterial",
2:"/Inventory/GetPagedListBoxByBox",
3:"/Inventory/GetPagedListBoxBySubStock",
};
//根据不同的this.selectValue的值匹配不同的参数传给后端
const selectValCloneParams = {
1:'materialNumber',
2:'boxBillNo',
3:'subStock'
};
//接口基本參數
const params = {
pageNo:pageNo,
pageSize: 10,
stockCode:this.warehouseCode,//仓库编码
};
//选择后的this.selectValue值
let paramsItem = selectValCloneParams[this.selectValue]
//将选择后的selectValue和用户输入的input值添加到params中
params[paramsItem] = this.inputVal;
this.timer1 = setTimeout(() => {
this.$api
.post(url[this.selectValue],params)
.then((res) => {
if (res.status == 200) {
//如果res.data.details是一个空数组直接返回不进行赋值操作
// if(!res.data.totalCount) {
// this.$refs.paging.complete(res.data.details);
// return;
// }
this.$refs.paging.complete(res.data.details);
this.setDetailsValue(res.data)
} else {
this.$refs.paging.complete(false);
this.inputVal=""
this.setInputTagBox()
}
}).catch(res=>{
this.$refs.paging.complete(false);
this.inputVal=""
this.setInputTagBox()
})
},1000)
},
handleClear() {
this.clearValue()
this.setInputTagBox()
},
//跳转到盘点
goInventory(item) {
let boxBillNo = item && item.boxBillNo ? item.boxBillNo:this.boxBillNo
//跳转盘点時需要去掉warehouseCodeClone拼接的org老接口的warehouseCodeClone是没有进行org拼接的.
let warehouseCodeClone = JSON.stringify(this.warehouseCode)
let warehouseCode = JSON.parse(warehouseCodeClone).split("_")[0];
uni.navigateTo({
url:`/pages/Inventory/index?warehouseName=${this.warehouseName}&warehouseCode=${warehouseCode}&boxBillNo=${boxBillNo}`
})
},
//回退
goback() {
uni.navigateTo({
url: '/pages/otherUnderwear/index'
});
},
}
};
</script>
<style lang="scss">
@import "@/static/public.scss";
.mianheade2 {
.pagetitle {
margin-left: 30%;
}
}
.item1 {
position: relative;
height: 150rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0rpx 30rpx;
}
.item1-detail {
padding: 5rpx 15rpx;
border-radius: 10rpx;
font-size: 28rpx;
color: white;
background-color: #007AFF;
}
.item1-line {
position: absolute;
bottom: 0rpx;
left: 0rpx;
height: 1px;
width: 100%;
background-color: #eeeeee;
}
::v-deep .uni-select {
border:none !important;
height:24px;
width: 100rpx;
padding-right: 0;
padding-left: 3rpx;
text-align: center;
margin-left: -7rpx;
}
.th {
color: #505050;
// border-right: 1rpx solid #E3E5E8;
background-color:#F0F2F5;
display: flex;
align-items: center;
justify-content: center;
padding: 10rpx;
font-weight: 900;
height: 44rpx;
}
.th-item {
box-sizing: border-box;
display:flex;
font-size:13px;
border: 1rpx solid #E3E5E8;
border-top-left-radius: 12rpx;
border-top-right-radius: 12rpx;
}
.td-item {
box-sizing: border-box;
display:flex;
font-size:13px;
border: 1rpx solid #E3E5E8;
border-top:none;
}
.td {
display: flex;
align-items: center;
justify-content:center;
text-align: center;
min-height: 90rpx;
background-color: #fff;
padding: 10rpx;
}
.br {
border-right: 1rpx solid #E3E5E8;
}
.wd {
word-wrap: break-word;
white-space:normal ;
word-break: break-all;
}
.c-box {
padding:0rpx 16rpx 20rpx 16rpx;
background-color: #fff;
margin:0 24rpx;
border-bottom-left-radius: 12rpx;
border-bottom-right-radius: 12rpx;
}
.c-box1 {
padding:0rpx 16rpx 20rpx 16rpx;
background-color: #fff;
margin:0 24rpx;
}
</style>