Commit bbc7c9a4 authored by 李驰骋's avatar 李驰骋

销售出库、库存调拨、库存盘点页面添加批号显示

parent 2739beed
...@@ -99,7 +99,10 @@ ...@@ -99,7 +99,10 @@
"验收数量+报废数量+验退数量不能大于进货数量": "จำนวนที่ตรวจรับ + จำนวนที่ถูกตัดจำหน่าย + จำนวนที่คืนไม่สามารถมากกว่าจำนวนการสั่งซื้อได้", "验收数量+报废数量+验退数量不能大于进货数量": "จำนวนที่ตรวจรับ + จำนวนที่ถูกตัดจำหน่าย + จำนวนที่คืนไม่สามารถมากกว่าจำนวนการสั่งซื้อได้",
"委外进货单检验信息": "ข้อมูลการตรวจสอบการสั่งซื้อภายนอก", "委外进货单检验信息": "ข้อมูลการตรวจสอบการสั่งซื้อภายนอก",
"无批号": "ไม่มีหมายเลขล็อต", "无批号": "ไม่มีหมายเลขล็อต",
"批次号:": "หมายเลขชุด", "无批次号": "ไม่มีหมายเลขชุด",
"批次号:": "หมายเลขชุด:",
"请输入批次号": "กรุณาใส่หมายเลขชุด",
"批次号不能为空": "หมายเลขชุดไม่สามารถว่างได้",
"查询库存失败": "การค้นหาสินค้าคงคลังล้มเหลว", "查询库存失败": "การค้นหาสินค้าคงคลังล้มเหลว",
"未找到该物料的库存信息": "ไม่พบข้อมูลสินค้าคงคลังสำหรับวัสดุนี้", "未找到该物料的库存信息": "ไม่พบข้อมูลสินค้าคงคลังสำหรับวัสดุนี้",
"报废数量": "จำนวนที่ถูกตัดจำหน่าย", "报废数量": "จำนวนที่ถูกตัดจำหน่าย",
......
...@@ -99,7 +99,10 @@ ...@@ -99,7 +99,10 @@
"验收数量+报废数量+验退数量不能大于进货数量": "验收数量+报废数量+验退数量不能大于进货数量", "验收数量+报废数量+验退数量不能大于进货数量": "验收数量+报废数量+验退数量不能大于进货数量",
"委外进货单检验信息": "委外进货单检验信息", "委外进货单检验信息": "委外进货单检验信息",
"无批号": "无批号", "无批号": "无批号",
"批次号:": "批次号", "无批次号": "无批次号",
"批次号:": "批次号:",
"请输入批次号": "请输入批次号",
"批次号不能为空": "批次号不能为空",
"查询库存失败": "查询库存失败", "查询库存失败": "查询库存失败",
"未找到该物料的库存信息": "未找到该物料的库存信息", "未找到该物料的库存信息": "未找到该物料的库存信息",
"报废数量": "报废数量", "报废数量": "报废数量",
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<input <input
v-model="form.tg014" v-model="form.tg014"
type="text" type="text"
@confirm="inputCC" @blur="inputCC"
> >
</input> </input>
</u-form-item> </u-form-item>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
v-model="form.tg015" v-model="form.tg015"
focus focus
type="text" type="text"
@confirm="inputCC" @blur="inputCC"
> >
</input> </input>
</u-form-item> </u-form-item>
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
</u-form-item> </u-form-item>
<u-form-item prop="tg036" :label="$t('库位:')"> <u-form-item prop="tg036" :label="$t('库位:')">
<input <input
v-model.number="form.tg036" v-model="form.tg036"
type="text" type="text"
@confirm="submit" @confirm="submit"
> >
...@@ -77,15 +77,15 @@ ...@@ -77,15 +77,15 @@
> >
</input> </input>
</u-form-item> --> </u-form-item> -->
<!-- <u-form-item prop="tc032" :label="$t('批号:')"> <u-form-item prop="batchNo" :label="$t('批号:')">
<input <input
v-model.number="form.tc032" v-model.number="form.batchNo"
disabled
type="text" type="text"
@confirm="submit" @confirm="submit"
> >
</input> </input>
</u-form-item> --> </u-form-item>
<u-form-item prop="tg011" :label="$t('数量:')"> <u-form-item prop="tg011" :label="$t('数量:')">
<input <input
v-model="form.tg011" v-model="form.tg011"
...@@ -187,7 +187,8 @@ import i18n from '../../lang/index' ...@@ -187,7 +187,8 @@ import i18n from '../../lang/index'
tg036: null, tg036: null,
// tb008: null, // tb008: null,
// tc032: null, // tc032: null,
// tg011: null, tg011: null,
batchNo: null,
// tc020: null, // tc020: null,
// tc021: null, // tc021: null,
} }
...@@ -203,12 +204,45 @@ import i18n from '../../lang/index' ...@@ -203,12 +204,45 @@ import i18n from '../../lang/index'
if (arr.length === 2) { if (arr.length === 2) {
this.form.tg014 = arr[0] this.form.tg014 = arr[0]
this.form.tg015 = arr[1] this.form.tg015 = arr[1]
// 查询工单信息并生成批次号
this.queryMoctaAndGenerateBatch()
} }
} else { } else {
this.submit() // 查询工单信息并生成批次号
this.queryMoctaAndGenerateBatch()
} }
} }
}, },
// 查询工单信息并生成批次号
queryMoctaAndGenerateBatch() {
if (!this.form.tg014 || !this.form.tg015) {
return
}
const params = {
ta001: this.form.tg014, // 工单单别
ta002: this.form.tg015 // 工单单号
}
this.$u.api.getMocta(params).then(res => {
if (res.success && res.data) {
const moctaData = res.data
// 生成批次号:品号(ta006)+工厂编号(ta019)+日期yyyyMMdd
const today = new Date()
const dateStr = today.getFullYear().toString() +
(today.getMonth() + 1).toString().padStart(2, '0') +
today.getDate().toString().padStart(2, '0')
this.form.batchNo = (moctaData.ta006 || '').trim() + (moctaData.ta019 || '').trim() + dateStr
} else {
this.form.batchNo=""
this.$u.toast(i18n.t('未找到工单信息'))
}
}).catch(err => {
this.form.batchNo=""
this.$u.toast(i18n.t('查询工单失败'))
})
},
submit(row) { submit(row) {
if (!this.form['tg001']) { if (!this.form['tg001']) {
return this.$u.toast(i18n.t('请输入入库单别')) return this.$u.toast(i18n.t('请输入入库单别'))
...@@ -251,6 +285,7 @@ import i18n from '../../lang/index' ...@@ -251,6 +285,7 @@ import i18n from '../../lang/index'
// tb008: null, // tb008: null,
// tc032: null, // tc032: null,
tg011: null, tg011: null,
batchNo: null,
// tc020: null, // tc020: null,
// tc021: null, // tc021: null,
} }
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<!-- <view class="item">物料描述:{{ item.itemName }}</view> --> <!-- <view class="item">物料描述:{{ item.itemName }}</view> -->
<view class="item">{{$t('产品名称:{0}', [ item.materialName ])}}</view> <view class="item">{{$t('产品名称:{0}', [ item.materialName ])}}</view>
<view class="item">{{$t('库房/储位:{0}|{1}', [ item.ml002 , item.ml003 ])}}</view> <view class="item">{{$t('库房/储位:{0}|{1}', [ item.ml002 , item.ml003 ])}}</view>
<view class="item">{{$t('批次号:')}}{{item.ml004}}</view>
<view class="item">{{$t('库存数:')}}{{item.ml005}}</view> <view class="item">{{$t('库存数:')}}{{item.ml005}}</view>
</view> </view>
</view> </view>
......
...@@ -25,7 +25,10 @@ ...@@ -25,7 +25,10 @@
<template v-for="(item, index) in list"> <template v-for="(item, index) in list">
<view class="detail-line-wrap" v-if="item.materialNo === ele.materialNo && item.deliverQuantity === ele.deliverQuantity && item.outQuantity" :key="item.materialNo + '444' + index" @click="handleDetail(item)"> <view class="detail-line-wrap" v-if="item.materialNo === ele.materialNo && item.deliverQuantity === ele.deliverQuantity && item.outQuantity" :key="item.materialNo + '444' + index" @click="handleDetail(item)">
<view class="detail-line"> <view class="detail-line">
<view class="left-info">
<text>{{item.warehouse}}|{{item.location}}</text> <text>{{item.warehouse}}|{{item.location}}</text>
<text class="batch-info" v-if="item.batchNo">{{item.batchNo}}</text>
</view>
<text style="margin-left: auto">{{item.outQuantity}}pcs</text> <text style="margin-left: auto">{{item.outQuantity}}pcs</text>
</view> </view>
</view> </view>
...@@ -89,6 +92,13 @@ export default { ...@@ -89,6 +92,13 @@ export default {
}, },
created () { created () {
uni.$on('sendkcData', (data, info) => { uni.$on('sendkcData', (data, info) => {
// 先移除相同物料的旧数据
this.list = this.list.filter(item =>
!(item.materialNo === info.materialNo &&
item.deliverQuantity === info.deliverQuantity)
);
// 添加新数据
data.forEach((vvvv) => { data.forEach((vvvv) => {
if (vvvv.outQuantity) { if (vvvv.outQuantity) {
this.list.push({ this.list.push({
...@@ -99,7 +109,8 @@ export default { ...@@ -99,7 +109,8 @@ export default {
"outQuantity": vvvv.outQuantity, "outQuantity": vvvv.outQuantity,
"planOutDate": info.planOutDate, "planOutDate": info.planOutDate,
"unit": info.unit, "unit": info.unit,
"warehouse": vvvv.ml002 "warehouse": vvvv.ml002,
"batchNo": vvvv.ml004
}) })
} }
}) })
...@@ -160,8 +171,19 @@ export default { ...@@ -160,8 +171,19 @@ export default {
}) })
}, },
addKC(ele) { addKC(ele) {
// 获取当前物料的已录入数据
const existingData = this.list.filter(item =>
item.materialNo === ele.materialNo &&
item.deliverQuantity === ele.deliverQuantity
);
const params = {
info: ele,
existingData: existingData
};
uni.navigateTo({ uni.navigateTo({
url: `/pages/saleck/selectCK?info=${encodeURIComponent(JSON.stringify(ele))}` url: `/pages/saleck/selectCK?params=${encodeURIComponent(JSON.stringify(params))}`
}); });
}, },
getBtnHandle(row) { getBtnHandle(row) {
...@@ -311,13 +333,25 @@ export default { ...@@ -311,13 +333,25 @@ export default {
.detail-line { .detail-line {
background: rgb(243, 243, 245); background: rgb(243, 243, 245);
display: flex; display: flex;
padding: 0px 10rpx; padding: 10rpx;
border: 1px solid #d4d7dc; border: 1px solid #d4d7dc;
height: 80rpx; min-height: 80rpx;
line-height: 80rpx;
border-radius: 5px; border-radius: 5px;
margin-top: 10px; margin-top: 10px;
align-items: center;
}
.left-info {
display: flex;
flex-direction: column;
justify-content: center;
flex: 1;
gap: 5rpx;
}
.batch-info {
font-size: 22rpx;
color: #666;
line-height: 1.2;
} }
} }
} }
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
<view class="listItemTitle" @click="handleClick(item)"> <view class="listItemTitle" @click="handleClick(item)">
<view> <view>
<view class="item">{{$t('库房/储位:{0}|{1}', [ item.ml002 , item.ml003 ])}}</view> <view class="item">{{$t('库房/储位:{0}|{1}', [ item.ml002 , item.ml003 ])}}</view>
<view class="item">{{$t('批次号:')}}{{item.ml004}}</view>
<view class="item">{{$t('最近入库日:')}}{{item.ml009}}</view>
<view class="item">{{$t('库存数:{0}pcs', [ item.ml005 ])}}</view> <view class="item">{{$t('库存数:{0}pcs', [ item.ml005 ])}}</view>
<view class="item">{{$t('出货数:')}}<uni-easyinput <view class="item">{{$t('出货数:')}}<uni-easyinput
v-model="item.outQuantity" v-model="item.outQuantity"
...@@ -61,8 +63,11 @@ import i18n from '../../lang/index' ...@@ -61,8 +63,11 @@ import i18n from '../../lang/index'
}, },
computed: {}, computed: {},
onLoad(option) { onLoad(option) {
if (option && option.info) { if (option && option.params) {
this.info = JSON.parse(decodeURIComponent(option.info)) const params = JSON.parse(decodeURIComponent(option.params))
this.info = params.info
const existingData = params.existingData || []
this.$u.api this.$u.api
.getforinvmlinfo({ .getforinvmlinfo({
ml001: this.info.materialNo ml001: this.info.materialNo
...@@ -70,6 +75,15 @@ import i18n from '../../lang/index' ...@@ -70,6 +75,15 @@ import i18n from '../../lang/index'
if (data) { if (data) {
data.forEach(element => { data.forEach(element => {
element['outQuantity'] = 0 element['outQuantity'] = 0
// 恢复已录入的数量
const existingItem = existingData.find(item =>
item.warehouse === element.ml002 &&
item.location === element.ml003 &&
item.batchNo === element.ml004
)
if (existingItem) {
element['outQuantity'] = existingItem.outQuantity
}
}); });
this.goodsList = data this.goodsList = data
} }
......
...@@ -20,6 +20,10 @@ ...@@ -20,6 +20,10 @@
<zxz-uni-data-select filterable v-model="formData.location" dataKey="text" dataValue="value" <zxz-uni-data-select filterable v-model="formData.location" dataKey="text" dataValue="value"
:localdata="storageRange" /> :localdata="storageRange" />
</uni-forms-item> </uni-forms-item>
<uni-forms-item :label="`${$t('批次号')}:`">
<uni-easyinput v-model="formData.batchNo" trim="all"
:placeholder="$t('请输入批次号')" />
</uni-forms-item>
</uni-forms> </uni-forms>
</view> </view>
</view> </view>
...@@ -46,6 +50,7 @@ ...@@ -46,6 +50,7 @@
stockQuantity: "", stockQuantity: "",
warehouse: "", warehouse: "",
location: "", location: "",
batchNo: "",
} }
} }
}, },
...@@ -97,6 +102,9 @@ ...@@ -97,6 +102,9 @@
if (!this.formData.location) { if (!this.formData.location) {
return this.$u.toast(i18n.t('调入储位不能为空')); return this.$u.toast(i18n.t('调入储位不能为空'));
} }
if (!this.formData.batchNo) {
return this.$u.toast(i18n.t('批次号不能为空'));
}
if (this.list.some((item) => { if (this.list.some((item) => {
return item.warehouse == this.formData.warehouse && item.location == this.formData.location; return item.warehouse == this.formData.warehouse && item.location == this.formData.location;
})) { })) {
......
...@@ -10,6 +10,9 @@ ...@@ -10,6 +10,9 @@
<view class="info"> <view class="info">
<view class="item inventory-info"> <view class="item inventory-info">
{{$t('库房/储位')}}{{item.warehouse}}|{{item.location}} {{$t('库房/储位')}}{{item.warehouse}}|{{item.location}}
<view class="batch-info" v-if="item.batchNo">
{{$t('批次号')}}{{item.batchNo}}
</view>
</view> </view>
<view class="item inventory-data"> <view class="item inventory-data">
{{$t('库存数')}}{{item.stockQuantity || 0}} {{$t('库存数')}}{{item.stockQuantity || 0}}
...@@ -108,6 +111,12 @@ ...@@ -108,6 +111,12 @@
.item { .item {
text-align: left; text-align: left;
} }
.batch-info {
font-size: 24rpx;
color: #666;
margin-top: 8rpx;
}
} }
.physical-inventory { .physical-inventory {
......
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
<view class="text"> <view class="text">
{{item.warehouse}}|{{item.location}} {{item.warehouse}}|{{item.location}}
</view> </view>
<view class="batch-text" v-if="item.batchNo">
{{item.batchNo}}
</view>
</view> </view>
<view class="right"> <view class="right">
<view class="text"> <view class="text">
...@@ -123,7 +126,8 @@ ...@@ -123,7 +126,8 @@
warehouse: item.ml002, warehouse: item.ml002,
location: item.ml003, location: item.ml003,
physicalQuantity: item.ml005, physicalQuantity: item.ml005,
stockQuantity: item.ml005 stockQuantity: item.ml005,
batchNo: item.ml004 || ''
} }
}); });
setTimeout(() => { setTimeout(() => {
...@@ -166,6 +170,7 @@ ...@@ -166,6 +170,7 @@
physicalQuantity: Number(item.physicalQuantity), physicalQuantity: Number(item.physicalQuantity),
stockQuantity: Number(item.stockQuantity), stockQuantity: Number(item.stockQuantity),
warehouse: item.warehouse, warehouse: item.warehouse,
batchNo: item.batchNo || '',
} }
}) })
this.$u.api.stockConfirmApi({ this.$u.api.stockConfirmApi({
...@@ -300,6 +305,11 @@ ...@@ -300,6 +305,11 @@
.text { .text {
font-size: 28rpx; font-size: 28rpx;
} }
.batch-text {
font-size: 24rpx;
color: #666;
margin-top: 8rpx;
}
} }
.right { .right {
......
...@@ -10,6 +10,9 @@ ...@@ -10,6 +10,9 @@
<u-icon v-else name="minus" size="36" @click="handleDel"></u-icon> <u-icon v-else name="minus" size="36" @click="handleDel"></u-icon>
</view> </view>
</view> </view>
<view class="batch-info">
<view class="batch-text">{{$t('批次号')}}{{info.ml004 || $t('无批次号')}}</view>
</view>
<uni-forms :modelValue="info" :label-width="90" label-align="right"> <uni-forms :modelValue="info" :label-width="90" label-align="right">
<uni-forms-item :label="`${$t('调拨数')}:`"> <uni-forms-item :label="`${$t('调拨数')}:`">
<uni-easyinput v-model="info.allocateQuantity" type="number" trim="all" <uni-easyinput v-model="info.allocateQuantity" type="number" trim="all"
...@@ -124,6 +127,16 @@ ...@@ -124,6 +127,16 @@
} }
} }
.batch-info {
padding: 12rpx 24rpx;
border-bottom: 1px solid #f0f0f0;
.batch-text {
font-size: 26rpx;
color: #666;
}
}
/deep/.uni-forms { /deep/.uni-forms {
.uni-forms-item { .uni-forms-item {
margin: 24rpx; margin: 24rpx;
......
...@@ -28,6 +28,9 @@ ...@@ -28,6 +28,9 @@
<view class="text current-storage"> <view class="text current-storage">
{{$t('当前储位')}}{{`${ele.ml002}|${ele.ml003}`}} {{$t('当前储位')}}{{`${ele.ml002}|${ele.ml003}`}}
</view> </view>
<view class="text batch-no">
{{$t('批次号')}}{{ele.ml004 || $t('无批次号')}}
</view>
<view class="text transfer-storage"> <view class="text transfer-storage">
{{$t('调入储位')}} {{$t('调入储位')}}
{{ele.allocateLocation ? `${ele.allocateWarehouse}|${ele.allocateLocation}`: ''}} {{ele.allocateLocation ? `${ele.allocateWarehouse}|${ele.allocateLocation}`: ''}}
...@@ -151,7 +154,8 @@ ...@@ -151,7 +154,8 @@
location: ele.ml003, location: ele.ml003,
materialNo: ele.ml001, materialNo: ele.ml001,
warehouse: ele.ml002, warehouse: ele.ml002,
materialName: ele.materialName materialName: ele.materialName,
batchNo: ele.ml004
} }
}) })
}).flat(Infinity); }).flat(Infinity);
...@@ -267,6 +271,12 @@ ...@@ -267,6 +271,12 @@
.text { .text {
font-size: 28rpx; font-size: 28rpx;
} }
.batch-no {
font-size: 26rpx;
color: #666;
margin: 8rpx 0;
}
} }
.right { .right {
......
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