Commit e6648b2c authored by 何远江's avatar 何远江

装箱功能修改

parent c43b1c9e
...@@ -57,6 +57,8 @@ const install = (Vue, vm) => { ...@@ -57,6 +57,8 @@ const install = (Vue, vm) => {
sapLgpla: (params = {}, client = sapClient) => vm.$u.post(config.adminPath + '/sap/bc/erp_ep/search/sch_LGPLA?sap-language=ZH&sap-client=' + client, params), sapLgpla: (params = {}, client = sapClient) => vm.$u.post(config.adminPath + '/sap/bc/erp_ep/search/sch_LGPLA?sap-language=ZH&sap-client=' + client, params),
// 装箱 // 装箱
sapCasePlnr: (params = {}, client = sapClient) => vm.$u.post(config.adminPath + '/sap/bc/erp_ep/pda_case/pda_case_plnr?sap-language=ZH&sap-client=' + client, params), sapCasePlnr: (params = {}, client = sapClient) => vm.$u.post(config.adminPath + '/sap/bc/erp_ep/pda_case/pda_case_plnr?sap-language=ZH&sap-client=' + client, params),
// 装箱信息查询
sapCaseInfo: (params = {}, client = sapClient) => vm.$u.post(config.adminPath + '/sap/bc/erp_ep/pda_case/pda_case_sch?sap-language=ZH&sap-client=' + client, params),
sapCasePlnr2: (params = {}, client = sapClient) => vm.$u.post(config.adminPath + '/sap/bc/erp_ep/pda_case/pda_case_plnr2?sap-language=ZH&sap-client=' + client, params), sapCasePlnr2: (params = {}, client = sapClient) => vm.$u.post(config.adminPath + '/sap/bc/erp_ep/pda_case/pda_case_plnr2?sap-language=ZH&sap-client=' + client, params),
// 待盘点 // 待盘点
sapInventory: (params = {}, client = sapClient) => vm.$u.post(config.adminPath + '/sap/bc/erp_ep/search/sch_inventory?sap-language=ZH&sap-client='+ client, params), sapInventory: (params = {}, client = sapClient) => vm.$u.post(config.adminPath + '/sap/bc/erp_ep/search/sch_inventory?sap-language=ZH&sap-client='+ client, params),
......
<template> <template>
<!-- <view class="bottomBtn" :class="{'btnContent': btnArr.length === 1}"> --> <!-- <view class="bottomBtn" :class="{'btnContent': btnArr.length === 1}"> -->
<view class="bottomBtn"> <view class="bottomBtn">
<view v-for="(item, index) in btnArr" :key="index"> <view v-for="(item, index) in btnArr" :key="index" class="btns">
<u-button class="widthBtn" :class="item.style" :type="item.type" @click='handleClick(item)'> <u-button class="widthBtn" :class="item.style" :type="item.type" @click='handleClick(item)'>
{{item.text}} {{item.text}}
</u-button> </u-button>
...@@ -30,24 +30,29 @@ export default { ...@@ -30,24 +30,29 @@ export default {
</script> </script>
<style scoped> <style scoped>
.bottomBtn { .bottomBtn {
width: 100%;
position: fixed; position: fixed;
display: flex; display: flex;
bottom: 0; bottom: 0;
left: 0; left: 0;
z-index: 10; z-index: 10;
width: 750rpx;
height: 140rpx; height: 140rpx;
justify-content: space-around; justify-content: space-around;
align-items: center; align-items: center;
background: #fff; background: #fff;
.u-btn { padding: 0 10rpx;
width: 300rpx ; /* .u-btn {
} flex: 1;
} */
.btns {
flex: 1;
margin-right: 10rpx;
}
} }
.btnContent{ .btnContent{
justify-content: space-around; justify-content: space-around;
} }
.widthBtn{ /* .widthBtn{
width: 300rpx ; width: 300rpx ;
} } */
</style> </style>
\ No newline at end of file
...@@ -230,6 +230,8 @@ ...@@ -230,6 +230,8 @@
} }
this.$u.toast(res[0].MESSAGE) this.$u.toast(res[0].MESSAGE)
this.goBack() this.goBack()
} else {
this.$u.toast('提交盘点数据未返回成功消息!')
} }
}) })
}, },
......
<template> <template>
<view class="metering"> <view class="metering">
<!-- <uni-forms :modelValue="form"> <view class="btn">
<uni-forms-item label="长" name="long"> <uni-easyinput
<uni-easyinput type="text" v-model="form.long" placeholder="请输入姓名" /> prefixIcon="search"
</uni-forms-item> class="topSearch"
</uni-forms> --> v-model="blpl"
<u-row gutter="16" class="itemRow"> :disabled="isEdit"
placeholder="请扫描箱码"
@change="handleInputNlpla"
></uni-easyinput>
</view>
<u-row gutter="16" class="itemRow" style="margin-top: 10rpx;">
<u-col span="3"> <u-col span="3">
长(cm): 长(cm):
</u-col> </u-col>
<u-col span="6"> <u-col span="6">
<uni-easyinput v-model="form.long" @input="updateWeight"></uni-easyinput> <uni-easyinput v-model="form.LONG" @input="updateWeight"></uni-easyinput>
</u-col> </u-col>
</u-row> </u-row>
<u-row gutter="16" class="itemRow"> <u-row gutter="16" class="itemRow">
...@@ -18,7 +23,7 @@ ...@@ -18,7 +23,7 @@
宽(cm): 宽(cm):
</u-col> </u-col>
<u-col span="6"> <u-col span="6">
<uni-easyinput v-model="form.wide" @input="updateWeight"></uni-easyinput> <uni-easyinput v-model="form.WIDE" @input="updateWeight"></uni-easyinput>
</u-col> </u-col>
</u-row> </u-row>
<u-row gutter="16" class="itemRow"> <u-row gutter="16" class="itemRow">
...@@ -26,7 +31,7 @@ ...@@ -26,7 +31,7 @@
高(cm): 高(cm):
</u-col> </u-col>
<u-col span="6"> <u-col span="6">
<uni-easyinput v-model="form.high" @input="updateWeight"></uni-easyinput> <uni-easyinput v-model="form.HIGH" @input="updateWeight"></uni-easyinput>
</u-col> </u-col>
</u-row> </u-row>
<u-row gutter="16" class="itemRow"> <u-row gutter="16" class="itemRow">
...@@ -34,7 +39,7 @@ ...@@ -34,7 +39,7 @@
毛重(kg): 毛重(kg):
</u-col> </u-col>
<u-col span="6"> <u-col span="6">
<uni-easyinput v-model="form.brgew"></uni-easyinput> <uni-easyinput v-model="form.BRGEW"></uni-easyinput>
</u-col> </u-col>
</u-row> </u-row>
<u-row gutter="16" class="itemRow"> <u-row gutter="16" class="itemRow">
...@@ -42,7 +47,7 @@ ...@@ -42,7 +47,7 @@
箱重(kg): 箱重(kg):
</u-col> </u-col>
<u-col span="6"> <u-col span="6">
<uni-easyinput v-model="form.zxntgew" @input="updateWeight"></uni-easyinput> <uni-easyinput v-model="form.ZXNTGEW" @input="updateWeight"></uni-easyinput>
</u-col> </u-col>
</u-row> </u-row>
<u-row gutter="16" class="itemRow"> <u-row gutter="16" class="itemRow">
...@@ -58,7 +63,7 @@ ...@@ -58,7 +63,7 @@
装箱备注: 装箱备注:
</u-col> </u-col>
<u-col span="8"> <u-col span="8">
<u-input v-model="form.zxtext" type="textarea" :border="true" height="70" ></u-input> <u-input v-model="form.ZXTEXT" type="textarea" :border="true" height="70" ></u-input>
</u-col> </u-col>
</u-row> </u-row>
<u-row gutter="16" class="itemRow"> <u-row gutter="16" class="itemRow">
...@@ -66,7 +71,7 @@ ...@@ -66,7 +71,7 @@
备注: 备注:
</u-col> </u-col>
<u-col span="8"> <u-col span="8">
<u-input v-model="form.ztext" type="textarea" :border="true" height="70" ></u-input> <u-input v-model="form.ZTEXT" type="textarea" :border="true" height="70" ></u-input>
</u-col> </u-col>
</u-row> </u-row>
...@@ -79,7 +84,7 @@ export default { ...@@ -79,7 +84,7 @@ export default {
}, },
data() { data() {
return { return {
blpl: '',
}; };
}, },
created() { created() {
...@@ -90,14 +95,41 @@ export default { ...@@ -90,14 +95,41 @@ export default {
default: function () { default: function () {
return {}; return {};
} }
},
isEdit: {
type: Boolean,
default: false
},
isBL: {
type: Boolean,
default: false
}
},
watch: {
form: {
handler(nv) {
if (this.isBL) {
this.blpl = nv.ZCODE
} else {
this.blpl = nv.PLNR
}
},
deep:true
} }
}, },
computed:{ computed:{
weight(){ weight(){
return (this.form.brgew-0) - (this.form.zxntgew-0) return (this.form.BRGEW-0) - (this.form.ZXNTGEW-0)
} }
}, },
methods: { methods: {
handleInputNlpla(e) {
console.log(e, 'handleInputNlpla');
this.$emit('plinput', e)
},
setWeightEdit() {
},
updateWeight(e) { updateWeight(e) {
console.log(e, '----') console.log(e, '----')
const reg = /^\d+\*\d+\*\d+\-\d+(\.\d+)+$/ const reg = /^\d+\*\d+\*\d+\-\d+(\.\d+)+$/
...@@ -106,11 +138,11 @@ export default { ...@@ -106,11 +138,11 @@ export default {
console.log('扫码11111'); console.log('扫码11111');
const arr = e.split('*') const arr = e.split('*')
setTimeout(() => { setTimeout(() => {
this.form.long = arr[0] this.form.LONG = arr[0]
this.form.wide = arr[1] this.form.WIDE = arr[1]
const data = arr[2].split('-') const data = arr[2].split('-')
this.form.high = data[0] this.form.HIGH = data[0]
this.form.zxntgew = data[1] this.form.ZXNTGEW = data[1]
}, 500) }, 500)
} }
} }
......
const mockData = {
bls: [
{
"ZCODE": "BL24070000041",
"PLNR": "10000820240402000001|10000320004",
"WERKS": "1000",
"KUNNR": "",
"ZZXFS": "BL+PL",
"ZSTATUS": "N",
"ZXSPE": "56*41*32",
"ZXVOLUM": 0.073,
"ZXNTGEW": 1.250,
"NTGEW": 20.750,
"BRGEW": 22.000,
"ZXTEXT": "",
"ZTEXT": "",
"ZIFSHMARK": "Y",
"VBELN": "",
"UNAME": "TS-LIUQI",
"DATUM": "20240709",
"UZEIT": "084744",
"MNAME": "",
"MDATE": "00000000",
"MTIME": "000000",
"AUNAME": "",
"AUDATE": "00000000",
"AUTIME": "000000"
},
{
"ZCODE": "BL24070000041",
"PLNR": "10000820240402000003|10000320003",
"WERKS": "1000",
"KUNNR": "",
"ZZXFS": "BL+PL",
"ZSTATUS": "N",
"ZXSPE": "56*41*32",
"ZXVOLUM": 0.073,
"ZXNTGEW": 1.250,
"NTGEW": 20.750,
"BRGEW": 22.000,
"ZXTEXT": "",
"ZTEXT": "",
"ZIFSHMARK": "Y",
"VBELN": "",
"UNAME": "TS-LIUQI",
"DATUM": "20240709",
"UZEIT": "084744",
"MNAME": "",
"MDATE": "00000000",
"MTIME": "000000",
"AUNAME": "",
"AUDATE": "00000000",
"AUTIME": "000000"
},
{
"ZCODE": "BL24060000034",
"PLNR": "PL16",
"WERKS": "1000",
"KUNNR": "0000600009",
"ZZXFS": "BL+PL",
"ZSTATUS": "N",
"ZXSPE": "10*10*10",
"ZXVOLUM": 0.001,
"ZXNTGEW": 1.000,
"NTGEW": 10.000,
"BRGEW": 11.000,
"ZXTEXT": "123",
"ZTEXT": "321",
"ZIFSHMARK": "Y",
"VBELN": "",
"UNAME": "admin",
"DATUM": "20240621",
"UZEIT": "195225",
"MNAME": "CHENWL",
"MDATE": "20240708",
"MTIME": "174601",
"AUNAME": "",
"AUDATE": "00000000",
"AUTIME": "000000"
},
{
"ZCODE": "BL24060000034",
"PLNR": "PL17",
"WERKS": "1000",
"KUNNR": "0000600009",
"ZZXFS": "BL+PL",
"ZSTATUS": "N",
"ZXSPE": "10*10*10",
"ZXVOLUM": 0.001,
"ZXNTGEW": 1.000,
"NTGEW": 10.000,
"BRGEW": 11.000,
"ZXTEXT": "123",
"ZTEXT": "321",
"ZIFSHMARK": "Y",
"VBELN": "",
"UNAME": "admin",
"DATUM": "20240621",
"UZEIT": "195225",
"MNAME": "CHENWL",
"MDATE": "20240708",
"MTIME": "174601",
"AUNAME": "",
"AUDATE": "00000000",
"AUTIME": "000000"
}
],
pls: [
{
"ZCODE": "BL24070000085",
"PLNR": "PL0006000400001000000455021",
"WERKS": "1000",
"KUNNR": "0000600247",
"ZZXFS": "PL",
"ZSTATUS": "N",
"ZXSPE": "56*41*32",
"ZXVOLUM": 0.073,
"ZXNTGEW": 1.250,
"NTGEW": 48.750,
"BRGEW": 50.000,
"ZXTEXT": "",
"ZTEXT": "",
"ZIFSHMARK": "Y",
"VBELN": "",
"UNAME": "admin",
"DATUM": "20240709",
"UZEIT": "162212",
"MNAME": "TS-LIUQI",
"MDATE": "20240726",
"MTIME": "154440",
"AUNAME": "",
"AUDATE": "00000000",
"AUTIME": "000000"
},
{
"ZCODE": "BL24070000072",
"PLNR": "10000001240424000004|10000000002",
"WERKS": "1000",
"KUNNR": "0000600005",
"ZZXFS": "PL",
"ZSTATUS": "N",
"ZXSPE": "56*41*32",
"ZXVOLUM": 0.073,
"ZXNTGEW": 1.250,
"NTGEW": 20.750,
"BRGEW": 22.000,
"ZXTEXT": "",
"ZTEXT": "",
"ZIFSHMARK": "Y",
"VBELN": "",
"UNAME": "TS-LIUQI",
"DATUM": "20240709",
"UZEIT": "084744",
"MNAME": "",
"MDATE": "00000000",
"MTIME": "000000",
"AUNAME": "",
"AUDATE": "00000000",
"AUTIME": "000000"
},
{
"ZCODE": "BL24070000071",
"PLNR": "10000001240424000004|10000000001",
"WERKS": "1000",
"KUNNR": "0000600005",
"ZZXFS": "PL",
"ZSTATUS": "N",
"ZXSPE": "56*41*32",
"ZXVOLUM": 0.073,
"ZXNTGEW": 1.250,
"NTGEW": 20.750,
"BRGEW": 22.000,
"ZXTEXT": "",
"ZTEXT": "",
"ZIFSHMARK": "Y",
"VBELN": "",
"UNAME": "TS-LIUQI",
"DATUM": "20240709",
"UZEIT": "084744",
"MNAME": "",
"MDATE": "00000000",
"MTIME": "000000",
"AUNAME": "",
"AUDATE": "00000000",
"AUTIME": "000000"
}
]
}
/**
* 模拟查询PL和BL
* @param {*} val
* @param {*} type false:PL, true:BL
*/
export const requestMock = (val, type = false) => {
const datas = mockData[type ? 'bls' : 'pls']
return datas.filter(item => {
if (type) {
return item.ZCODE == val
}
return item.PLNR == val
})
}
\ No newline at end of file
<template> <template>
<view class="lists"> <view class="lists">
<StickyNavBar :class="{'meteringTab':current !== 0}"> <StickyNavBar :class="{ meteringTab: current !== 0 }">
<NavBar title="装箱"></NavBar> <NavBar title="装箱"></NavBar>
<view class="selectSheet"> <view class="selectSheet">
<u-tabs :list="list" :is-scroll="false" :current="current" @change="changeTab"></u-tabs> <u-tabs
</view> :list="list"
<view class="" v-if="current === 0"> :is-scroll="false"
<view class="btn"> :current="current"
<view class="boxSelect"> @change="changeTab"
<u-picker v-model="show" mode="selector" :default-selector="[0]" range-key="text" ></u-tabs>
:range="actionSheetList" @confirm="actionSheetCallback"></u-picker> </view>
<u-input v-model="form.ZZXFS" placeholder="请选择装箱方式" type="select" :border="true" <view class="" v-if="current === 0">
@click="show = true" /> <view class="btn">
</view> <view class="boxSelect">
<uni-easyinput prefixIcon="search" class="topSearch" v-model="blNum" focus placeholder="请扫描箱码" <u-picker
@change="handleInputNlpla" :disabled="form.ZZXFS === 'PL'"></uni-easyinput> v-model="show"
<uni-easyinput prefixIcon="search" :disabled="isDisabled" v-model="wxparams" :focus="isFocus" mode="selector"
placeholder="请扫描产品包装条码/外箱码" @input="handleInputPlnr"></uni-easyinput> :default-selector="[0]"
</view> range-key="text"
<view class="total"> :range="actionSheetList"
<view class="left">明细</view> @confirm="actionSheetCallback"
<view class="right"> ></u-picker>
数量: <u-input
<text class="">{{ goodsList.length }}</text> v-model="form.ZZXFS"
</view> placeholder="请选择装箱方式"
</view> type="select"
</view> :border="true"
</StickyNavBar> @click="show = true"
<relationships v-show="current === 0" :list="goodsList" @deleGonds="deleGonds" /> />
<metering v-show="current === 1" :form="form" /> </view>
<unpacking v-show="current === 2" /> <uni-easyinput
<BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle" v-if="current !== 2"></BottomBtn> prefixIcon="search"
</view> class="topSearch"
v-model="blNum"
focus
placeholder="请扫描箱码"
@change="handleInputNlpla"
:disabled="form.ZZXFS === 'PL'"
></uni-easyinput>
<uni-easyinput
prefixIcon="search"
:disabled="isDisabled"
v-model="wxparams"
:focus="isFocus"
placeholder="请扫描产品包装条码/外箱码"
@input="handleInputPlnr"
></uni-easyinput>
<checkbox-group style="margin-top: 10rpx;" @change="checkedChange">
<checkbox value="r1" :checked="checkedBox" />是否审核
</checkbox-group>
</view>
<view class="total">
<view class="left">明细</view>
<view class="right">
数量:
<text class="">{{ goodsList.length }}</text>
</view>
</view>
</view>
</StickyNavBar>
<relationships
v-show="current === 0"
:list="goodsList"
:isEdit="isEdit"
@deleGonds="deleGonds"
/>
<metering
v-show="current === 1"
:form="form"
:isBL="isBL"
:isEdit="isEdit"
@plinput="changePLBLForm"
/>
<unpacking v-show="current === 2" />
<BottomBtn
:btnArr="btnArr"
@getBtnHandle="getBtnHandle"
v-if="current !== 2"
></BottomBtn>
</view>
</template> </template>
<script> <script>
import StickyNavBar from '@/components/StickyNavBar/index.vue'; import StickyNavBar from "@/components/StickyNavBar/index.vue";
import ContentLoadingMore from '@/components/ContentLoadingMore/index.vue'; import ContentLoadingMore from "@/components/ContentLoadingMore/index.vue";
import BottomBtn from '@/components/BottomBtn/index.vue'; import BottomBtn from "@/components/BottomBtn/index.vue";
import relationships from './relationships.vue'; import relationships from "./relationships.vue";
import metering from './metering.vue'; import metering from "./metering.vue";
import unpacking from './unpacking.vue'; import unpacking from "./unpacking.vue";
import { import { parseTime } from "@/utils/ruoyi";
parseTime import { requestMock } from "./mock";
} from "@/utils/ruoyi"; export default {
components: {
export default { StickyNavBar,
components: { ContentLoadingMore,
StickyNavBar, BottomBtn,
ContentLoadingMore, relationships,
BottomBtn, metering,
relationships, unpacking,
metering, },
unpacking data() {
}, return {
data() { type: "select",
return { show: false,
value: '', border: true,
type: 'select', // 是否编辑状态
show: false, isEdit: false,
border: true, isBL: false,
list: [{ list: [
name: '装箱关联' {
},{ name: "装箱关联",
name: '计量称重' },
},{ {
name: '解除装箱' name: "计量称重",
} },
], {
current: 0, name: "解除装箱",
status: 'loadmore', },
btnArr: [{ ],
style: '', current: 0,
type: 'warning', checkedBox: false,
text: '返回', status: "loadmore",
way: 'goBack' btnArr: [
}, {
{ style: "",
style: '', type: "warning",
type: 'primary', text: "返回",
text: '提交', way: "goBack",
way: 'goSubmit' },
} {
], style: "",
wxparams: '', type: "primary",
blNum: '', text: "重置",
isFocus: false, way: "resetState",
isDisabled: false, },
orderBoxNum: '', {
show: false, style: "",
actionSheetList: [{ type: "primary",
text: 'BL+PL' text: "提交",
}, way: "goSubmit",
{ },
text: 'PL' ],
}, // 扫描的PL
], wxparams: "",
form: { // 扫描的BL
ZZXFS: 'BL+PL', blNum: "",
zxspe: '', //箱规格(cm) isFocus: false,
zxvolum: '', //体积(m132) isDisabled: false,
zxntgew: '', //箱重(kg) actionSheetList: [
ntgew: '', //净重(kg) {
brgew: '', //毛重(kg) text: "BL+PL",
long: '', //长 },
wide: '', //宽 {
high: '', //高 text: "PL",
updkz: 'I', },
datum: '', //扫描日期 ],
uzeit: '', //扫描时间 form: {
uname: 'admin', //扫描人 ZZXFS: "BL+PL",
zxtext: '', ZXSPE: "", //箱规格(cm)
ztext: '', ZXVOLUM: "", //体积(m132)
}, ZXNTGEW: "", //箱重(kg)
goodsList: [], NTGEW: "", //净重(kg)
}; BRGEW: "", //毛重(kg)
LONG: "", //长
WIDE: "", //宽
HIGH: "", //高
updkz: "I",
datum: "", //扫描日期
uzeit: "", //扫描时间
uname: "admin", //扫描人
ZXTEXT: "",
ZTEXT: "",
},
goodsList: [],
};
},
computed: {},
methods: {
/**
* 重置
*/
resetState() {
this.goodsList = []
this.form = {
ZZXFS: "BL+PL",
ZXSPE: "", //箱规格(cm)
ZXVOLUM: "", //体积(m132)
ZXNTGEW: "", //箱重(kg)
NTGEW: "", //净重(kg)
BRGEW: "", //毛重(kg)
LONG: "", //长
WIDE: "", //宽
HIGH: "", //高
updkz: "I",
datum: "", //扫描日期
uzeit: "", //扫描时间
uname: "admin", //扫描人
ZXTEXT: "",
ZTEXT: "",
}
this.isBL = false;
this.isEdit = false;
},
checkedChange(){
this.checkedBox = !this.checkedBox
}, },
// onLoad(option) { searchCaseInfo(blpl) {
// if(option && option.order){ // 判空
// this.orderBoxNum = option.order if (!blpl) return;
// } // 是否BL
// }, const isBL = blpl.startsWith("BL");
methods: { this.isBL = isBL;
goSubmit() {
if (this.goodsList.length === 0) { // 验证是否有重复
this.$u.toast('暂无提交数据'); if (this.goodsList.find((v) => v.ZCODE == blpl || v.PLNR == blpl)) {
return this.$u.toast("请勿重复扫描!");
} return this.reset();
if (!this.blNum && this.form.ZZXFS === 'BL+PL') { }
this.$u.toast('请扫描箱码'); // 查询是否装箱
return const params = {
} ZCODE: isBL ? blpl : "",
if (!this.form.long || !this.form.wide || !this.form.high || !this.form.brgew || !this.form.zxntgew) { PLNR: isBL ? "" : blpl,
uni.showModal({ };
title: '提示', this.$u.api.sapApi.sapCaseInfo(params).then(({ DATA: res }) => {
content: '还未填写计量称重信息!是否继续提交?', this.isEdit = !!res.length && isBL;
success: (res) => { // 如果已经装箱
if (res.confirm) { if (res.length) {
console.log('用户点击确定'); // 扫描的PL
this.subRequest() if (!isBL) {
} else if (res.cancel) { const [plInfo] = res;
console.log('用户点击取消'); // 如果有规格,需要解析出长宽高
} if (/^\d+\*\d+\*\d+$/.test(plInfo.ZXSPE)) {
} const [LONG, WIDE, HIGH] = plInfo.ZXSPE.split("*");
}); plInfo.LONG = LONG;
} else { plInfo.WIDE = WIDE;
this.subRequest() plInfo.HIGH = HIGH;
} }
}, this.goodsList.push({ ...plInfo });
// 请求发送 } else {
subRequest() { this.goodsList = res.map((v) => {
const arr = [] // 如果有规格,需要解析出长宽高
this.goodsList.forEach(ele => { if (/^\d+\*\d+\*\d+$/.test(v.ZXSPE)) {
arr.push({ const [LONG, WIDE, HIGH] = v.ZXSPE.split("*");
plnr: ele, v.LONG = LONG;
werks: this.vuex_user_factory, v.WIDE = WIDE;
...this.form, v.HIGH = HIGH;
kunnr: "", }
zxspe: this.form.long + '*' + this.form.wide + '*' + this.form.high, return v;
zxvolum: (this.form.long * this.form.wide * this.form.high) / 1000000, });
ntgew: (this.form.brgew - 0) - (this.form.zxntgew - 0), this.form = this.goodsList[0];
zcode: this.form.ZZXFS === 'PL' ? '' : this.blNum, }
datum: parseTime(new Date(), '{y}{m}{d}'), } else {
uzeit: parseTime(new Date(), '{h}{i}{s}'), if (!isBL) {
}) console.log("没有装箱的PL");
}); const plInfo = { PLNR: blpl };
this.$u.api.sapApi // 获取已经扫描过的最后一个PL信息,如果存在需要他的称重信息
.sapCasePlnr(arr) const lastPLInfo = this.goodsList.at(-1);
.then((res) => { const weightInfo = {
if (!Array.isArray(res)) { ZXVOLUM: "",
return ZXNTGEW: "",
} NTGEW: "",
if (res.every((item) => item.TYPE === 'S')) { BRGEW: "",
this.$u.toast(res[0].MESSAGE); LONG: "",
this.resetData() WIDE: "",
} HIGH: "",
const foundObject = res.find(item => item.TYPE === 'E'); };
if (foundObject && foundObject.MESSAGE) { if (lastPLInfo) {
this.$u.toast(foundObject.MESSAGE); weightInfo.ZXVOLUM = lastPLInfo.ZXVOLUM;
} weightInfo.ZXNTGEW = lastPLInfo.ZXNTGEW;
}); weightInfo.NTGEW = lastPLInfo.NTGEW;
}, weightInfo.BRGEW = lastPLInfo.BRGEW;
// 重置数据 weightInfo.LONG = lastPLInfo.LONG;
resetData() { weightInfo.WIDE = lastPLInfo.WIDE;
this.$nextTick(() => { weightInfo.HIGH = lastPLInfo.HIGH;
this.goodsList = []; }
this.form.brgew = '' this.goodsList.push({ ...plInfo, ...weightInfo });
this.current = 0 }
}) }
}, console.log(this.goodsList, "goodsList-----");
// 删除
deleGonds(idx) { // 默认设置为扫描的第一项
this.goodsList.splice(idx, 1); if (!this.form.PLNR) {
}, this.form = this.goodsList[0];
handleInputNlpla(e) { }
console.log(`output->e`, e) });
}, },
reset() { goSubmit() {
setTimeout(() => { if (this.goodsList.length === 0) {
this.isFocus = true; this.$u.toast("暂无提交数据");
this.isDisabled = false; return;
this.wxparams = '' }
}, 1000);
}, if (!this.blNum && this.form.ZZXFS === "BL+PL") {
handleInputPlnr(e) { this.$u.toast("请扫描箱码");
this.isFocus = false; return;
this.isDisabled = true; }
if (this.goodsList.some((item) => item === e)) { // 是否超过45kg
this.$u.toast('已经存在当前条码'); const NTGEW = this.goodsList.reduce((acc, cur) => acc + +cur.NTGEW, 0);
this.reset() if (NTGEW > 45) {
return uni.showModal({
} title: "提示",
e && this.goodsList.push(e) content: "净重超过45KG,是否继续提交?",
this.reset() success: (res) => {
}, if (res.confirm) {
// 点击actionSheet回调 console.log("用户点击确定");
actionSheetCallback(index) { this.subRequest();
this.form.ZZXFS = this.actionSheetList[index].text; } else if (res.cancel) {
if (this.form.ZZXFS === 'PL') { console.log("用户点击取消");
this.blNum = '' }
} },
}, });
// 加载更多 } else {
onReachBottom() { this.subRequest();
console.log('加载更多inventoryCounting'); }
},
getBtnHandle(row) { // if (
console.log('getBtnHandle', row); // !this.form.long ||
this[row.way](); // !this.form.wide ||
}, // !this.form.high ||
goBack() { // !this.form.brgew ||
console.log('返回了'); // !this.form.zxntgew
uni.navigateBack(); // ) {
}, // uni.showModal({
changeTab(index) { // title: "提示",
this.current = index; // content: "还未填写计量称重信息!是否继续提交?",
} // success: (res) => {
} // if (res.confirm) {
}; // console.log("用户点击确定");
// this.subRequest();
// } else if (res.cancel) {
// console.log("用户点击取消");
// }
// },
// });
// } else {
// }
},
// 请求发送
subRequest() {
const arr = [];
this.goodsList.forEach((ele) => {
arr.push({
...ele,
werks: this.vuex_user_factory,
zxspe: ele.LONG + "*" + ele.WIDE + "*" + ele.HIGH,
ntgew: +ele.BRGEW - ele.ZXNTGEW,
zcode: this.form.ZZXFS === "PL" ? "" : this.blNum,
datum: parseTime(new Date(), "{y}{m}{d}"),
uzeit: parseTime(new Date(), "{h}{i}{s}"),
zstatus: this.checkedBox ? 'Y': 'N'
});
});
this.$u.api.sapApi.sapCasePlnr(arr).then((res) => {
if (!Array.isArray(res)) {
return;
}
if (res.every((item) => item.TYPE === "S")) {
this.$u.toast(res[0].MESSAGE);
this.resetData();
}
const foundObject = res.find((item) => item.TYPE === "E");
if (foundObject && foundObject.MESSAGE) {
this.$u.toast(foundObject.MESSAGE);
}
});
},
// 重置数据
resetData() {
this.$nextTick(() => {
this.goodsList = [];
this.form.brgew = "";
this.current = 0;
});
},
// 删除
deleGonds(idx) {
this.goodsList.splice(idx, 1);
},
/**
* 扫描BL
* 查询是否已经有装箱,有装箱情况只能做修改称重操作
* @param {*} e
*/
handleInputNlpla(e) {
this.searchCaseInfo(e);
},
changePLBLForm(blpl) {
console.log("changePLBLForm", "00000");
if (!this.isBL) {
const info = this.goodsList.find((v) => v.PLNR == blpl);
this.form = info;
}
},
reset() {
setTimeout(() => {
this.isFocus = true;
this.isDisabled = false;
this.wxparams = "";
}, 1000);
},
handleInputPlnr(e) {
this.isFocus = false;
this.isDisabled = true;
if (this.goodsList.some((item) => item === e)) {
this.$u.toast("已经存在当前条码");
this.reset();
return;
}
this.searchCaseInfo(e);
this.reset();
return;
e && this.goodsList.push(e);
this.reset();
},
// 点击actionSheet回调
actionSheetCallback(index) {
this.form.ZZXFS = this.actionSheetList[index].text;
if (this.form.ZZXFS === "PL") {
this.blNum = "";
}
},
// 加载更多
onReachBottom() {
console.log("加载更多inventoryCounting");
},
getBtnHandle(row) {
console.log("getBtnHandle", row);
this[row.way]();
},
goBack() {
console.log("返回了");
uni.navigateBack();
},
changeTab(index) {
this.current = index;
},
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.selectSheet { .selectSheet {
border-bottom: 1px solid #ccc; border-bottom: 1px solid #ccc;
} }
/deep/ .u-sticky {
top: 0 !important;
background: #fff;
}
.contentMore { /deep/ .u-sticky {
margin: 20rpx; top: 0 !important;
} background: #fff;
}
page { .contentMore {
background: #f8f8f8; margin: 20rpx;
} }
.headerTitle { page {
padding: 20rpx; background: #f8f8f8;
font-weight: 600; }
.items { .headerTitle {
line-height: 40rpx; padding: 20rpx;
} font-weight: 600;
}
.btn { .items {
padding: 20rpx; line-height: 40rpx;
background: #fff; }
}
.boxSelect { .btn {
margin-bottom: 20rpx; padding: 20rpx;
} background: #fff;
}
.total { .boxSelect {
background: #fff; margin-bottom: 20rpx;
color: #000; }
padding: 0rpx 40rpx; }
display: flex;
justify-content: space-between;
font-size: 32rpx;
.line { .total {
margin: 0px 10rpx; background: #fff;
} color: #000;
} padding: 0rpx 40rpx;
display: flex;
justify-content: space-between;
font-size: 32rpx;
.meteringTab { .line {
margin: 0px 10rpx;
}
}
// height: 200rpx; .meteringTab {
/deep/.u-sticky-wrap { // height: 200rpx;
height: 170rpx !important; /deep/.u-sticky-wrap {
} height: 170rpx !important;
} }
}
.topSearch { .topSearch {
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
</style> </style>
...@@ -6,14 +6,13 @@ ...@@ -6,14 +6,13 @@
<!-- <scanningList :item='item'/> --> <!-- <scanningList :item='item'/> -->
<view class="listItemTitle"> <view class="listItemTitle">
<view> <view>
<view class="item">PL号:{{ list[index] }}</view> <view class="item">PL号:{{ item.PLNR }}</view>
<!-- <view class="item">物料编号:{{ item.MATNR }}</view> <!-- <view class="item">物料编号:{{ item.MATNR }}</view>
<view class="item">物料描述:{{ item.MAKTX }}</view> <view class="item">物料描述:{{ item.MAKTX }}</view>
<view class="item">数量:{{ item.MAKTX }}</view> --> <view class="item">数量:{{ item.MAKTX }}</view> -->
</view> </view>
<u-button size="mini" type="primary" plain @click="deleGonds(index)"> <u-button v-if="!isEdit" size="mini" type="primary" plain @click="deleGonds(index)">
<u-icon name="trash" size="28"></u-icon> <u-icon name="trash" size="28"></u-icon>
删除
</u-button> </u-button>
</view> </view>
</view> </view>
...@@ -43,6 +42,10 @@ export default { ...@@ -43,6 +42,10 @@ export default {
return []; return [];
} }
}, },
isEdit: {
type: Boolean,
default: false
}
}, },
data() { data() {
return { return {
...@@ -102,6 +105,7 @@ export default { ...@@ -102,6 +105,7 @@ export default {
}); });
}, },
deleGonds(idx) { deleGonds(idx) {
console.log(idx, '--0000----');
this.$emit('deleGonds',idx) this.$emit('deleGonds',idx)
}, },
// 加载更多 // 加载更多
...@@ -157,7 +161,7 @@ export default { ...@@ -157,7 +161,7 @@ export default {
padding: 20rpx; padding: 20rpx;
border-bottom: 2px solid #f8f8f8; border-bottom: 2px solid #f8f8f8;
.u-btn { .u-btn {
width: 150rpx; // width: 150rpx;
margin: 0px; margin: 0px;
margin-top: 10rpx; margin-top: 10rpx;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment