Commit 99cc9a96 authored by 沈翠玲's avatar 沈翠玲

到货单

parent 31279af9
......@@ -51,10 +51,16 @@ const install = (Vue, vm) => {
createforstorage: (params = {}) => vm.$u.postJson(config.adminPath + '/sfctb/createforstorage', params),
stockSaleOutList: (params = {}) => vm.$u.postJson(config.adminPath + '/stockSaleOut/list', params),
stockList: (params = {}) => vm.$u.postJson(config.adminPath + '/stockSaleOut/stockList', params),
confirmStock: (params = {}) => vm.$u.postJson(config.adminPath + '/stockSaleOut/confirm', params),
getforinvmlinfo: (params = {}) => vm.$u.postJson(config.adminPath + '/invml/getforinvmlinfo', params),
validateArrival: (params = {}) => vm.$u.postJson(config.adminPath + '/stockArrival/validate', params),
confirmArrival: (params = {}) => vm.$u.postJson(config.adminPath + '/stockArrival/confirm', params),
warehouseList: (params = {}) => vm.$u.postJson(config.adminPath + '/warehouseArrive/list', params),
};
}
export default {
install
}
......@@ -140,5 +140,41 @@
"未连接到服务器": "ไม่ได้เชื่อมต่อกับเซิร์ฟเวอร์",
"失败": "ล้มเหลว",
"未知错误": "ข้อผิดพลาดที่ไม่รู้จัก",
"获取用户语言失败": "ล้มเหลวในการรับภาษาผู้ใช้"
"获取用户语言失败": "ล้มเหลวในการรับภาษาผู้ใช้",
"录入到货单": "ใส่ลงในใบส่งสินค้า",
"供应商代码": "รหัสผู้ขาย",
"到货供应商": "ผู้จัดจำหน่ายขาเข้า",
"到货明细": "รายละเอียดการมาถึง",
"一个到货单无法录入两个供应商订单": "ใบสั่งซื้อสินค้าหนึ่งใบไม่สามารถป้อนคำสั่งซื้อของผู้จำหน่ายสองรายได้",
"销售出库": "การขายออกจากคลัง",
"销货单创建": "การสร้างใบขาย",
"请扫描单号": "กรุณาสแกนหมายเลขเดี่ยว",
"步骤一 扫描单号": "ขั้นตอนที่ 1 สแกนหมายเลขเดียว",
"摄像头对准": "การจัดตำแหน่งกล้อง",
"出货通知单号二维码": "หมายเลขใบแจ้งการจัดส่ง QR Code",
"点击扫描或": "คลิกสแกน หรือ",
"点选单号": "ชี้หมายเลขแผ่น",
"交货单:{0}": "การจัดส่ง: {0}",
"拣货明细": "รายละเอียดการหยิบสินค้า",
"计划出库日期:{0}": "กำหนดวันออกจากคลังสินค้า: {0}",
"请扫描盘点条码": "กรุณาสแกนบาร์โค้ด",
"返回": "กลับ",
"提交": "ส่ง",
"保存成功": "บันทึกความสำเร็จ",
"产品编号:{0}": "รหัสสินค้า: {0}",
"产品名称:{0}": "ชื่อสินค้า: {0}",
"领料": "ปลอกคอ",
"未配货": "ไม่จัดส่ง",
"库存明细": "รายละเอียดสินค้าคงคลัง",
"选择库存": "เลือกสินค้า",
"库房/储位:{0}|{1}": "คลังสินค้า / พื้นที่จัดเก็บ: {0}} {1}",
"库存数:{0}pcs": "จำนวนสต็อก: {0}pcs",
"出货数:": "จำนวนการจัดส่ง:",
"库存数:": "จำนวนสต็อก:",
"采购到货": "ซื้อมาถึง",
"到货仓": "ไปยังคลังสินค้า",
"请选择到货仓": "กรุณาเลือกไปยังคลังสินค้า",
"确认成功": "ยืนยันความสำเร็จ",
"到货确认": "ยืนยันการมาถึง",
"确认": "ยืนยัน"
}
......@@ -146,5 +146,35 @@
"到货供应商": "到货供应商",
"到货明细": "到货明细",
"一个到货单无法录入两个供应商订单": "一个到货单无法录入两个供应商订单",
"销售出库": "销售出库"
"销售出库": "销售出库",
"销货单创建": "销货单创建",
"请扫描单号": "请扫描单号",
"步骤一 扫描单号": "步骤一 扫描单号",
"摄像头对准": "摄像头对准",
"出货通知单号二维码": "出货通知单号二维码",
"点击扫描或": "点击扫描或",
"点选单号": "点选单号",
"交货单:{0}": "交货单:{0}",
"拣货明细": "拣货明细",
"计划出库日期:{0}": "计划出库日期:{0}",
"请扫描盘点条码": "请扫描盘点条码",
"返回": "返回",
"提交": "提交",
"保存成功": "保存成功",
"产品编号:{0}": "产品编号:{0}",
"产品名称:{0}": "产品名称:{0}",
"领料": "领料",
"未配货": "未配货",
"库存明细": "库存明细",
"选择库存": "选择库存",
"库房/储位:{0}|{1}": "库房/储位:{0}|{1}",
"库存数:{0}pcs": "库存数:{0}pcs",
"出货数:": "出货数:",
"库存数:": "库存数:",
"采购到货": "采购到货",
"到货仓": "到货仓",
"请选择到货仓": "请选择到货仓",
"确认成功": "确认成功",
"到货确认": "到货确认",
"确认": "确认"
}
\ No newline at end of file
......@@ -5,7 +5,14 @@
</StickyNavBar>
<view style="padding: 0 10px;">
<u-form ref="daohuoForm" :modelValue="daohuoForm" :rules="rules" labelWidth="200">
<u-form-item prop="cc001" class="under" :label="$t('到货供应商')">
<u-form-item prop="warehouse" class="under" :label="$t('到货仓')">
<uni-data-select
v-model="daohuoForm.warehouse"
:clear="false"
:localdata="typeData"
></uni-data-select>
</u-form-item>
<u-form-item prop="supplierNo" class="under" :label="$t('到货供应商')">
<input
v-model="input"
type="text"
......@@ -15,7 +22,7 @@
</input>
</u-form-item>
</u-form>
<view>{{$t('到货明细')}}</view>
<view v-if="goodsList.length > 0">{{$t('到货明细')}}</view>
</view>
<ContentLoadingMore class="cardbox" :list="goodsList">
<view class="cardContent" v-for="(item, index) in goodsList">
......@@ -23,7 +30,6 @@
:item="item"
:idx="index"
@deleGonds="deleGonds"
:list="list"
/>
</view>
</ContentLoadingMore>
......@@ -51,17 +57,18 @@ import BottomBtn from "@/components/BottomBtn/index.vue";
totalNum: 0,
show: true,
goodsList: [],
typeData: [],
btnArr: [
{
style: "",
type: "warning",
text: "返回",
text: i18n.t('返回'),
way: "goBack",
},
{
style: "",
type: "primary",
text: "到货确认",
text: i18n.t('到货确认'),
way: "goSubmit",
},
],
......@@ -69,77 +76,90 @@ import BottomBtn from "@/components/BottomBtn/index.vue";
input: '',
loading: false,
daohuoForm: {
cc001: "3701"
supplierNo: "",
warehouse: null
},
rules: {
cc001: { required: true,type: 'string', trigger: ['blur'], errorMessage: "11" },
cc002: { required: true, type: 'string',trigger: ['blur'], errorMessage: "11" }
supplierNo: { required: true,type: 'string', trigger: ['blur'], errorMessage: "11" },
purchaseType: { required: true, type: 'string',trigger: ['blur'], errorMessage: "11" }
},
}
},
created() {
this.warehouseList()
},
methods: {
warehouseList() {
this.$u.api.warehouseList().then(res => {
if(res.success) {
this.typeData = res.data.map(v => ({text: v.warehouseName, value: v.warehouseName}))
}
})
},
getBtnHandle(row) {
this[row.way]();
},
goBack() {
uni.navigateBack();
},
inputCC(e){
async inputCC(e){
if(e && e.detail.value) {
// 2028-330-20250106001-0019-A1010004-5
if(e.detail.value.includes("-")){
const arr = e.detail.value.split("-")
if (arr.length === 6) {
if (arr[0] !== this.daohuoForm.cc001) return this.$u.toast(i18n.t('一个到货单无法录入两个供应商订单'))
const index = this.goodsList.findIndex(v => v.joinlabel = arr.slice(0, 5).join('-'))
if (arr[0] !== this.daohuoForm.supplierNo && this.daohuoForm.supplierNo) return this.$u.toast(i18n.t('一个到货单无法录入两个供应商订单'))
const data = await this.$u.api.validateArrival({
"materialNo": arr[4],
"purchaseNo": arr[2],
"purchaseSerial": arr[3],
"purchaseType": arr[1]
})
if (!data.success) return
const index = this.goodsList.findIndex(v => v.joinlabel === arr.slice(0, 5).join('-'))
if (index > -1) {
this.goodsList[index]['cc006'] = Number(this.goodsList[index]['cc006']) + Number(arr[5])
this.goodsList[index]['arrivalQuantity'] = Number(this.goodsList[index]['arrivalQuantity']) + Number(arr[5])
} else {
const data1 = await this.$u.api
.getforinvmbinfo({
mb001: arr[4]
})
this.goodsList.push({
cc001: arr[0],
cc002: arr[1],
cc003: arr[2],
cc004: arr[3],
cc005: arr[4],
cc006: arr[5],
supplierNo: arr[0],
purchaseType: arr[1],
purchaseNo: arr[2],
purchaseSerial: arr[3],
materialNo: arr[4],
arrivalQuantity: arr[5],
udf07: data1.data['udf07'],
mb002: data1.data['mb002'],
joinlabel: arr.slice(0, 5).join('-')
})
}
this.input = ''
this.daohuoForm.cc001 = arr[0]
this.daohuoForm.supplierNo = arr[0]
}
} else {
}
}
},
deleGonds(idx) {
this.list = this.list.filter((item) => {
return item.qrcode !== this.goodsList[idx].qrcode;
})
this.goodsList.splice(idx, 1);
},
goSubmit(){
if (!this.goodsList.length) return;
if(!this.daohuoForm.cc001) return this.$u.toast(i18n.t('请输入到货单别'));
if(!this.daohuoForm.cc002) return this.$u.toast(i18n.t('请输入到货单号'));
if(!this.daohuoForm.warehouse) return this.$u.toast(i18n.t('请选择到货仓'));
this.loading = true;
this.$u.api.getforcreate({
cc001: this.daohuoForm.cc001,
cc002: this.daohuoForm.cc002
this.$u.api.confirmStock({
warehouse: this.daohuoForm.warehouse,
details: this.goodsList.map(v => ({arrivalQuantity: v.arrivalQuantity, materialNo: v.materialNo, purchaseNo: v.purchaseNo, purchaseSerial: v.purchaseSerial, purchaseType: v.purchaseType, supplierNo: v.supplierNo}))
})
.then(res => {
this.loading = false;
if (res.success) {
if (res.data) {
if(!res.data.purths || res.data.purths.length === 0) return this.$u.toast(i18n.t('到货单已经完成入库'));
uni.navigateTo({
url: '/pages/forcreate/Info?info=' + encodeURIComponent(JSON.stringify(res.data))
});
} else {
this.$u.toast(i18n.t('到货单不存在或未检验'));
}
this.$u.toast(i18n.t('确认成功'));
this.goodsList = []
this.daohuoForm.supplierNo = ''
} else {
this.$u.toast(res.errorMessage);
}
......@@ -150,6 +170,9 @@ import BottomBtn from "@/components/BottomBtn/index.vue";
</script>
<style lang="scss" scoped>
.page {
background: #fff;
}
.btn {
padding: 20rpx;
background: #fff;
......@@ -184,14 +207,16 @@ import BottomBtn from "@/components/BottomBtn/index.vue";
}
}
.cardbox {
min-height: calc(100vh - 540rpx);
padding: 0rpx 20rpx;
border: 1px solid #dadde2;
border-radius: 5px;
background: #f3f3f5;
margin: 0rpx 20rpx;
margin-top: 20rpx;
}
.cardContent {
border-radius: 8px;
background: #fff;
margin-bottom: 20rpx;
margin-top: 20rpx;
}
/deep/ .u-sticky {
top: 0 !important;
......@@ -203,7 +228,7 @@ import BottomBtn from "@/components/BottomBtn/index.vue";
}
.cardbox {
min-height: calc(100vh - 480rpx);
min-height: calc(100vh - 520rpx);
padding: 0rpx 20rpx;
margin-top: 20rpx;
}
......
<template>
<view>
<view class="listItemTitle">
<view>
<view class="item">入库条码:{{ item.qrcode }}</view>
<view class="item">工单编号:{{ item.workorderNo }}</view>
<view class="item">产品编号:{{ item.sapItemCode }}</view>
<view class="item">产品描述:{{ item.itemName }}</view>
<view class="item">入库仓位:{{ item.NLPLA }}</view>
<view class="item">入库数量:{{ filterQuantity() }} {{ item.unitOfMeasure }}</view>
<view class="item">loss数量:{{ filterLoss() }} {{ item.unitOfMeasure }}</view>
<view class="item">样品数量:{{ filterSampleNum() }} {{ item.unitOfMeasure }}</view>
</view>
<u-button size="mini" type="primary" plain @click="deleGonds(idx)">
<u-icon name="trash" size="28"></u-icon>
删除
</u-button>
</view>
<view class="listBottom">
<view class="bottomTitle" @click="show = !show">
<view class="desc">卷条码明细</view>
<view class="topIcons">
<view v-if="show">
<u-icon name="arrow-down" color="#aaa" size="32"></u-icon>
展开
</view>
<view v-else>
<u-icon name="arrow-up" color="#aaa" size="32"></u-icon>
收起
</view>
<view class="item" style="border-bottom: 1px solid #d8dbdf;">
<view>{{item.purchaseNo}}|{{item.purchaseSerial}}</view>
<view>{{item.arrivalQuantity}}pcs
<text style="margin-left: 40rpx"><u-icon name="minus" color="#000" size="32" @click="deleGonds(idx)"></u-icon></text>
</view>
</view>
<view v-if="!show" class="bottomBox">
<view class="bottomItem" v-for="(ele, idx) in list" :key="ele.qrcode+idx" v-if="ele.qrcode === item.qrcode">
<view class="items">尺码:{{ ele.standardSize }}</view>
<view class="items">数量:{{ ele.quantity }} {{ ele.unitOfMeasure }}</view>
<view class="items">loss数量:{{ ele.lossNum }} {{ ele.unitOfMeasure }}</view>
<view class="items">样品数量:{{ ele.sampleNum }} {{ ele.unitOfMeasure }}</view>
</view>
<view class="item">
<view>品号:{{item.materialNo}}</view>
</view>
<view class="item">品名:{{ item.mb002 }}</view>
<view class="item">图号:{{ item.mb029 }}</view>
</view>
<!-- <BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle"></BottomBtn> -->
</view>
</template>
......@@ -60,12 +34,6 @@ export default {
return {};
}
},
list: {
type: Array,
default: function () {
return [];
}
},
idx: {
type: Number,
default: 0
......@@ -83,15 +51,6 @@ export default {
methods: {
deleGonds(idx) {
this.$emit('deleGonds',idx)
},
filterQuantity() {
return this.list.filter(v => v.qrcode == this.item.qrcode).reduce((acc, cur) => acc + cur.quantity, 0)
},
filterLoss() {
return this.list.filter(v => v.qrcode == this.item.qrcode).reduce((acc, cur) => acc + cur.lossNum, 0)
},
filterSampleNum() {
return this.list.filter(v => v.qrcode == this.item.qrcode).reduce((acc, cur) => acc + cur.sampleNum, 0)
}
}
};
......@@ -142,8 +101,7 @@ page {
}
}
.listItemTitle {
display: flex;
justify-content: space-between;
width: 100%;
padding: 20rpx;
border-bottom: 2px solid #f8f8f8;
.u-btn {
......@@ -152,8 +110,11 @@ page {
margin-top: 10rpx;
}
.item {
width: 100%;
line-height: 50rpx;
color: #333;
display: flex;
justify-content: space-between;
font-size: 28rpx;
font-weight: 500;
word-break: break-all;
......
......@@ -69,12 +69,12 @@ import i18n from '../../lang/index'
url: '/pages/invmbinfo/Main'
},
{
src: require('@/static/images/infor.png'),
text: i18n.t('到货单'),
src: require('@/static/images/keyin.png'),
text: i18n.t('采购到货'),
url: '/pages/dhd/Main'
},
{
src: require('@/static/images/infor.png'),
src: require('@/static/images/item.png'),
text: i18n.t('销售出库'),
url: '/pages/saleck/Main'
}
......
<template>
<view>
<StickyNavBar>
<NavBar title="销售出库"></NavBar>
<NavBar :title="$t('销售出库')"></NavBar>
<view class="btn">
<uni-easyinput
prefixIcon="search"
:disabled="isDisabled"
v-model="wxparams"
:focus="isFocus"
placeholder="请扫描单号"
:placeholder="$t('请扫描单号')"
@confirm="handleConfirm"
></uni-easyinput>
</view>
</StickyNavBar>
<view class="cardBox">
<text class="cardBoxTip">
步骤一 扫描单号
</text>
<text class="cardBoxTip">{{$t('步骤一 扫描单号')}}</text>
<u-image class='cardBoxImg' :src="bgSrc" width="560rpx" height="400rpx"></u-image>
<view class="cardBoxTip2">{{$t('摄像头对准')}}</view>
<view class="cardBoxTip3">{{$t('出货通知单号二维码')}}</view>
<view class="cardBoxTip2">
摄像头对准
</view>
<view class="cardBoxTip3">
出货通知单号二维码
</view>
<view class="cardBoxTip2">
<text class="tipLeft">
点击扫描或
</text>
<text class="tipRight">
点选单号
</text>
<text class="tipLeft">{{$t('点击扫描或')}}</text>
<text class="tipRight">{{$t('点选单号')}}</text>
</view>
</view>
</view>
</template>
<script>
import i18n from '../../lang/index'
import StickyNavBar from '@/components/StickyNavBar/index.vue';
import ContentLoadingMore from '@/components/ContentLoadingMore/index.vue';
export default {
......
......@@ -4,12 +4,12 @@
<view class="cardContent" v-for="(item, index) in goodsList">
<view class="listItemTitle" @click="handleClick(item)">
<view>
<view class="item">产品编号:{{ item.applyNo }}</view>
<view class="item">{{$t('产品编号:{0}', [ item.ml001 ])}}</view>
<!-- <view class="item">物料编号:{{ item.sapItemCode }}</view> -->
<!-- <view class="item">物料描述:{{ item.itemName }}</view> -->
<view class="item">产品名称:{{ item.workunitName }}</view>
<view class="item">库房/储位:{{ item.materialType ? '补料': '领料' }}</view>
<view class="item">库存数:{{ item.grantNum? '配货中' : '未配货' }}</view>
<view class="item">{{$t('产品名称:{0}', [ item.materialName ])}}</view>
<view class="item">{{$t('库房/储位:{0}|{1}', [ item.ml002 , item.ml003 ])}}</view>
<view class="item">{{$t('库存数:')}}{{item.ml005}}</view>
</view>
</view>
</view>
......@@ -19,6 +19,8 @@
</template>
<script>
import i18n from '../../../lang/index'
import ContentLoadingMore from '@/components/ContentLoadingMore/index.vue';
export default {
components: {
......@@ -28,6 +30,9 @@ export default {
order: {
type: String
},
currentKc: {
type: Object
}
},
data() {
return {
......@@ -45,7 +50,7 @@ export default {
status: 'loadmore'
};
},
created() {
activated() {
if(this.order) {
this.getPlnr(this.order);
}
......@@ -56,23 +61,32 @@ export default {
},
getPlnr(order) {
this.totalNum = 0;
this.isDisabled = true;
this.$u.api.mesApi
if (this.currentKc) {
this.$u.api
.getforinvmlinfo({
ml001: this.currentKc.materialNo
}).then((res) => {
if (res && res.success) {
this.goodsList = res.data;
} else {
this.$u.toast(res.msg);
}
})
} else {
this.$u.api
.stockList({
saleOutNo: order
})
.then((res) => {
setTimeout(() => {
this.isDisabled = false;
}, 1000);
if (res && res.code - 200 === 0) {
this.goodsList = this.goodsList.concat(res.rows);
this.total = res.total
if (res && res.success) {
this.goodsList = res.data;
} else {
this.$u.toast(res.msg);
}
});
}
}
}
};
</script>
......
<template>
<view>
<view class="listItemTitle">
<view>
<view class="item">交货单:{{ applyNo }}</view>
<view @click="handleDetail(null)">
<view class="item">{{$t('交货单:{0}', [ applyNo ])}}</view>
</view>
</view>
<view class="listBottom">
<view class="bottomTitle">
<view class="desc">拣货明细</view>
<view class="desc">{{$t('拣货明细')}}</view>
</view>
<view class="bottomBox">
<view class="bottomItem" v-for="(ele, idx) in goodlist" :key="ele.materialNo+idx" >
<view class="box-top">
<view class="left">
<view class="items">{{ ele.materialNo }}|{{ ele.materialName }}</view>
<view class="items">计划出库日期:{{ ele.planOutDate }}</view>
<view class="items">{{$t('计划出库日期:{0}', [ ele.planOutDate ])}}</view>
</view>
<view class="right">
<u-icon name="plus" color="#000" size="32" @click.stop="addKC(ele)"></u-icon>
<view class="items">{{outQuantity(ele.materialNo)}}/{{deliverQuantity(ele.materialNo)}}</view>
<u-icon name="plus" color="#000" size="32" @click="addKC(ele)"></u-icon>
<view class="items">{{outQuantity(ele.materialNo)}}/{{ele.deliverQuantity}}pcs</view>
</view>
</view>
<view class="detail-box">
<view v-for="(item, index) in list" :key="item.materialNo + '444' + index">
<view class="detail-line" v-if="item.materialNo === ele.materialNo && item.outQuantity">
<template v-for="(item, index) in list">
<view class="detail-line-wrap" v-if="item.materialNo === ele.materialNo && item.outQuantity" :key="item.materialNo + '444' + index" @click="handleDetail(item)">
<view class="detail-line">
<text>{{item.warehouse}}|{{item.location}}</text>
<text style="margin-left: auto">{{item.outQuantity}}/{{item.deliverQuantity}}</text>
<text style="margin-left: auto">{{item.outQuantity}}pcs</text>
</view>
</view>
</template>
</view>
</view>
</view>
</view>
<u-modal :show="show" title="">
<uni-easyinput v-model="wxparams" placeholder="请扫描盘点条码">
<uni-easyinput v-model="wxparams" :placeholder="$t('请扫描盘点条码')">
</uni-easyinput>
</u-modal>
<!-- <BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle"></BottomBtn> -->
<BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle"></BottomBtn>
</view>
</template>
<script>
import i18n from '../../../lang/index'
import StickyNavBar from '@/components/StickyNavBar/index.vue';
import ContentLoadingMore from '@/components/ContentLoadingMore/index.vue';
import BottomBtn from '@/components/BottomBtn/index.vue';
......@@ -64,20 +68,20 @@ export default {
show: false,
applyNo: '',
wxparams: '',
list: [{good: 1, list: [{name: 1}]}],
list: [],
goodlist: [],
btnArr: [
{
style: '',
type: 'warning',
text: '返回',
text: i18n.t('返回'),
way: 'goBack'
},
{
style: '',
type: 'primary',
text: '提交',
text: i18n.t('确认'),
way: 'goSubmit'
}
],
......@@ -87,7 +91,23 @@ export default {
},
computed: {
},
created(){
created () {
uni.$on('sendkcData', (data, info) => {
data.forEach((vvvv) => {
if (vvvv.outQuantity) {
this.list.push({
"deliverQuantity": info.deliverQuantity,
"location": vvvv.ml003,
"materialName": info.materialName,
"materialNo": info.materialNo,
"outQuantity": vvvv.outQuantity,
"planOutDate": info.planOutDate,
"unit": info.materialNo,
"warehouse": vvvv.ml002
})
}
})
});
if(this.order) {
this.$u.api
.stockSaleOutList({
......@@ -102,6 +122,7 @@ export default {
if (index < 0){
this.goodlist.push({
"materialName": v.materialName,
"deliverQuantity": v.deliverQuantity,
"materialNo": v.materialNo,
"planOutDate": v.planOutDate,
"unit": v.unit
......@@ -113,12 +134,43 @@ export default {
}
},
beforeDestroy() {
// 移除监听事件,防止内存泄漏
uni.$off('sendkcData');
},
methods: {
handleDetail(item){
this.$emit('kcdetail', item)
},
goBack() {
uni.navigateBack();
},
goSubmit() {
if (this.list.length === 0) {
return;
}
const arr = this.list.filter(v => v.outQuantity)
if (arr.length === 0) {
return;
}
this.$u.api.confirmStock({
applyNo: this.applyNo,
data: arr
}).then(res => {
if (res.success) {
this.$u.toast(i18n.t('保存成功'))
uni.navigateBack()
}
})
},
addKC(ele) {
uni.navigateTo({
url: `/pages/saleck/selectCK?info=${encodeURIComponent(JSON.stringify(ele))}`
});
},
getBtnHandle(row) {
this[row.way]();
},
deliverQuantity(materialNo) {
const y = JSON.parse(JSON.stringify(this.list))
const arr = y.filter(i => i.materialNo = materialNo)
......@@ -127,7 +179,8 @@ export default {
outQuantity(materialNo) {
const y = JSON.parse(JSON.stringify(this.list))
const arr = y.filter(i => i.materialNo = materialNo)
return isNaN(arr.reduce((pre, cur) => pre + Number(cur.outQuantity), 0)) ? 0 : arr.reduce((pre, cur) => pre + Number(cur.outQuantity), 0)
const num = arr.reduce((pre, cur) => pre + (cur.outQuantity ? Number(cur.outQuantity) : 0), 0)
return isNaN(num) ? 0 : num
},
deleGonds(row, idx) {
this.$emit('deleGonds', row, idx);
......@@ -249,7 +302,7 @@ page {
padding: 20rpx;
display: flex;
justify-content: space-between;
border-bottom: 1px solid #d4d7dc;
.right {
text-align: right;
}
......@@ -257,10 +310,17 @@ page {
.detail-box {
padding: 20rpx;
background: #fff;
}
.detail-line-wrap {
&:first-child {
border-top: 1px solid #d4d7dc;
}
}
.detail-line {
background: rgb(243, 243, 245);
display: flex;
padding: 0px 10rpx;
border: 1px solid #d4d7dc;
height: 80rpx;
line-height: 80rpx;
......
......@@ -2,12 +2,16 @@
<view class="page">
<StickyNavBar>
<u-tabs :list="tabList" :is-scroll="false" :current="current" @change="handleTabChange"></u-tabs>
<component :is="tabList[current].comName" :order="order"></component>
<keep-alive>
<component :is="tabList[current].comName" :order="order" :currentKc="currentKc" @kcdetail="(v) => currentKc = v"></component>
</keep-alive>
</StickyNavBar>
</view>
</template>
<script>
import i18n from '../../lang/index'
import StickyNavBar from '@/components/StickyNavBar/index.vue';
import lhmx from './components/lhmx.vue';
import kcmx from './components/kcmx.vue';
......@@ -21,11 +25,12 @@
return {
current: 0,
order: '',
currentKc: null,
tabList: [{
name: '拣货明细',
name: i18n.t('拣货明细'),
comName: 'lhmx'
}, {
name: '库存明细',
name: i18n.t('库存明细'),
comName: 'kcmx'
}],
};
......
<template>
<view class="page">
<StickyNavBar>
<NavBar title="选择库存"></NavBar>
<NavBar :title="$t('选择库存')"></NavBar>
<view class="info">{{ info.materialNo }}|{{ info.materialName }}</view>
</StickyNavBar>
<ContentLoadingMore class="cardbox" :loadmore='true' :status="status" :list='goodsList'>
<ContentLoadingMore class="cardbox" :loadmore='true' :list='goodsList'>
<view class="cardContent" v-for="(item, index) in goodsList">
<view class="listItemTitle" @click="handleClick(item)">
<view>
<view class="item">库房/储位:{{ item.applyNo }}</view>
<view class="item">库存数:{{ item.workunitName }}</view>
<view class="item">出货数:<uni-easyinput
prefixIcon="search"
v-model="item.workunitName"
<view class="item">{{$t('库房/储位:{0}|{1}', [ item.ml002 , item.ml003 ])}}</view>
<view class="item">{{$t('库存数:{0}pcs', [ item.ml005 ])}}</view>
<view class="item">{{$t('出货数:')}}<uni-easyinput
v-model="item.outQuantity"
placeholder=""
></uni-easyinput></view>
</view>
......@@ -24,12 +23,18 @@
</template>
<script>
import i18n from '../../lang/index'
import ContentLoadingMore from '@/components/ContentLoadingMore/index.vue';
import BottomBtn from '@/components/BottomBtn/index.vue';
import StickyNavBar from '@/components/StickyNavBar/index.vue';
import lhmx from './components/lhmx.vue';
import kcmx from './components/kcmx.vue';
export default {
components: {
StickyNavBar,
ContentLoadingMore,
BottomBtn,
lhmx,
kcmx
},
......@@ -37,24 +42,18 @@
return {
current: 0,
info: {},
tabList: [{
name: '拣货明细',
comName: 'lhmx'
}, {
name: '库存明细',
comName: 'kcmx'
}],
goodsList: [],
btnArr: [
{
style: '',
type: 'warning',
text: '返回',
text: i18n.t('返回'),
way: 'goBack'
},
{
style: '',
type: 'primary',
text: '提交',
text: i18n.t('提交'),
way: 'goSubmit'
}
]
......@@ -64,7 +63,17 @@
onLoad(option) {
if (option && option.info) {
this.info = JSON.parse(decodeURIComponent(option.info))
this.$u.api
.getforinvmlinfo({
ml001: this.info.materialNo
}).then(({data}) => {
if (data) {
data.forEach(element => {
element['outQuantity'] = 0
});
this.goodsList = data
}
})
}
},
watch: {
......@@ -83,6 +92,10 @@
return;
}
const data = JSON.parse(JSON.stringify(this.goodsList));
console.log('datadatadata0', data)
uni.$emit('sendkcData', data, this.info);
uni.navigateBack();
},
handleTabChange(index) {
this.current = index;
......@@ -95,6 +108,11 @@
page {
background: #f8f8f8;
}
.info {
height: 120rpx;
padding: 0 20rpx;
line-height: 120rpx;
}
.headerTitle {
padding: 20rpx;
......@@ -147,14 +165,14 @@
.cardbox {
min-height: calc(100vh - 480rpx);
padding: 0rpx 20rpx;
padding: 0 20rpx;
margin-top: 20rpx;
}
.cardContent {
border-radius: 8px;
background: #fff;
margin-bottom: 20rpx;
margin-top: 20rpx;
}
.listItemTitle {
......@@ -173,7 +191,9 @@
line-height: 50rpx;
color: #333;
font-size: 28rpx;
display: flex;
font-weight: 500;
align-items: center;
word-break: break-all;
font-weight: 600;
}
......
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