Commit 800e9a6e authored by chicheng's avatar chicheng

批次相关调整

parent 6024e992
<template>
<view class="NavBar">
<!-- <u-navbar
:title="title"
:autoBack="true"
>
</u-navbar> -->
<uni-nav-bar shadow :left-icon="left" :right-icon="right" :title="title" color="#fff" :border='border' @clickLeft="handleBack" @clickRight="$emit(`clickRight`)" backgroundColor="#6200ee"/>
</view>
</template>
<script>
export default {
name:"NavBar",
data() {
return {
};
},
props: {
title: {
type: String,
default: ''
},
left: {
type: String,
default: 'left'
},
right: {
type: String,
default: ''
},
border: {
type: Boolean,
default: false
},
},
methods:{
handleBack() {
uni.navigateBack();
},
},
}
</script>
<style lang="scss">
.NavBar {
::v-deep .uni-navbar__header {
height:60px !important;
}
::v-deep .uni-navbar__header-container-inner {
justify-content: flex-start;
}
::v-deep .uni-nav-bar-text {
font-size: 20px;
}
::v-deep .uni-navbar__header-btns-left {
display: none;
}
::v-deep .uniui-checkbox{
font-size: 47px !important;
}
::v-deep .uniui-person{
font-size: 47px !important;
}
}
</style>
\ No newline at end of file
<template>
<view class="NavBar">
<!-- <u-navbar
:title="title"
:autoBack="true"
>
</u-navbar> -->
<uni-nav-bar shadow :left-icon="left" :title="title" color="#fff" :border='border' @clickLeft="handleBack" backgroundColor="#6200ee" :left-width="0" :right-width="160">
<template slot="right">
<view class="nav-right-icons">
<view v-if="extraRight" class="nav-right-icon" @click="$emit('clickExtraRight')">
<uni-icons :type="extraRight" size="28" color="#fff" />
</view>
<view v-if="right" class="nav-right-icon" style="margin-left:12rpx" @click="$emit('clickRight')">
<uni-icons :type="right" size="28" color="#fff" />
</view>
</view>
</template>
</uni-nav-bar>
</view>
</template>
<script>
export default {
name:"NavBar",
data() {
return {
};
},
props: {
title: {
type: String,
default: ''
},
left: {
type: String,
default: 'left'
},
right: {
type: String,
default: ''
},
extraRight: {
type: String,
default: ''
},
border: {
type: Boolean,
default: false
},
},
methods:{
handleBack() {
uni.navigateBack();
},
},
}
</script>
<style lang="scss">
.NavBar {
::v-deep .uni-navbar__header {
height:60px !important;
}
::v-deep .uni-navbar__header-container-inner {
justify-content: flex-start;
}
::v-deep .uni-nav-bar-text {
font-size: 20px;
}
::v-deep .uni-navbar__header-btns-left {
display: none;
}
.nav-right-icons {
display: flex;
flex-direction: row;
align-items: center;
}
.nav-right-icon {
padding: 8rpx;
display: flex;
align-items: center;
justify-content: center;
}
}
</style>
......@@ -230,5 +230,14 @@
"立即升级": "อัปเกรดทันที",
"领用套数": "จํานวนชุดที่จะใช้",
"采购发票": "ใบแจ้งหนี้การจัดซื้อ",
"请按顺序先进先出": "กรุณาตรวจสอบตามลำดับการสิ้นสุดก่อน"
"请按顺序先进先出": "กรุณาตรวจสอบตามลำดับการสิ้นสุดก่อน",
"扫码到货": "สแกนรับสินค้า",
"请扫描条码": "กรุณาสแกนบาร์โค้ด",
"继续扫码": "สแกนต่อ",
"编辑明细": "แก้ไขรายละเอียด",
"扫码结果": "ผลการสแกน",
"pcs": "pcs",
"图号": "หมายเลขแบบ",
"生产日期": "วันที่ผลิต",
"有效日期": "วันหมดอายุ"
}
......@@ -181,53 +181,62 @@
"库存数:": "库存数:",
"采购到货": "采购到货",
"到货仓": "到货仓",
"请选择到货仓": "请选择到货仓",
"确认成功": "确认成功",
"到货确认": "到货确认",
"确认": "确认",
"提交成功": "提交成功",
"提交失败": "提交失败",
"请勿重复提交": "请勿重复提交",
"提交数据不能为空": "提交数据不能为空",
"库存盘点": "库存盘点",
"盘点作业": "盘点作业",
"盘点明细": "盘点明细",
"盘点产品号不能为空": "盘点产品号不能为空",
"当前已经存在盘点产品": "当前已经存在盘点产品",
"该产品不存在": "该产品不存在",
"请输入盘点产品号": "请输入盘点产品号",
"库房/储位": "库房/储位",
"库存数": "库存数",
"盘点数": "盘点数",
"请输入盘点数": "请输入盘点数",
"盘点数量不能大于库存数量": "盘点数量不能大于库存数量",
"新增库存": "新增库存",
"新增数": "新增数",
"请输入新增数": "请输入新增数",
"选择仓库": "选择仓库",
"选择储位": "选择储位",
"调拨数不能为空": "调拨数不能为空",
"调入库存不能为空": "调入库存不能为空",
"调入储位不能为空": "调入储位不能为空",
"该数据已存在": "该数据已存在",
"请输入储位": "请输入储位",
"库存调拨": "库存调拨",
"至少需要录入一批调拨数据": "至少需要录入一批调拨数据",
"请输入调拨产品号": "请输入调拨产品号",
"调拨明细": "调拨明细",
"当前储位": "当前储位",
"调入储位": "调入储位",
"调拨确认": "调拨确认",
"该调拨产品号数据已存在": "该调拨产品号数据已存在",
"调拨总数不能大于库存数": "调拨总数不能大于库存数",
"调拨数": "调拨数",
"请输入调拨数": "请输入调拨数",
"调入仓库": "调入仓库",
"调拨数不能大于库存数": "调拨数不能大于库存数",
"检测到有新版本!": "检测到有新版本!",
"请升级app到最新版本!": "请升级app到最新版本!",
"暂不升级": "暂不升级",
"立即升级": "立即升级",
"领用套数": "领用套数",
"采购发票": "采购发票"
}
\ No newline at end of file
"请选择到货仓": "请选择到货仓",
"确认成功": "确认成功",
"到货确认": "到货确认",
"确认": "确认",
"提交成功": "提交成功",
"提交失败": "提交失败",
"请勿重复提交": "请勿重复提交",
"提交数据不能为空": "提交数据不能为空",
"库存盘点": "库存盘点",
"盘点作业": "盘点作业",
"盘点明细": "盘点明细",
"盘点产品号不能为空": "盘点产品号不能为空",
"当前已经存在盘点产品": "当前已经存在盘点产品",
"该产品不存在": "该产品不存在",
"请输入盘点产品号": "请输入盘点产品号",
"库房/储位": "库房/储位",
"库存数": "库存数",
"盘点数": "盘点数",
"请输入盘点数": "请输入盘点数",
"盘点数量不能大于库存数量": "盘点数量不能大于库存数量",
"新增库存": "新增库存",
"新增数": "新增数",
"请输入新增数": "请输入新增数",
"选择仓库": "选择仓库",
"选择储位": "选择储位",
"调拨数不能为空": "调拨数不能为空",
"调入库存不能为空": "调入库存不能为空",
"调入储位不能为空": "调入储位不能为空",
"该数据已存在": "该数据已存在",
"请输入储位": "请输入储位",
"库存调拨": "库存调拨",
"至少需要录入一批调拨数据": "至少需要录入一批调拨数据",
"请输入调拨产品号": "请输入调拨产品号",
"调拨明细": "调拨明细",
"当前储位": "当前储位",
"调入储位": "调入储位",
"调拨确认": "调拨确认",
"该调拨产品号数据已存在": "该调拨产品号数据已存在",
"调拨总数不能大于库存数": "调拨总数不能大于库存数",
"调拨数": "调拨数",
"请输入调拨数": "请输入调拨数",
"调入仓库": "调入仓库",
"调拨数不能大于库存数": "调拨数不能大于库存数",
"检测到有新版本!": "检测到有新版本!",
"请升级app到最新版本!": "请升级app到最新版本!",
"暂不升级": "暂不升级",
"立即升级": "立即升级",
"领用套数": "领用套数",
"采购发票": "采购发票",
"扫码到货": "扫码到货",
"请扫描条码": "请扫描条码",
"继续扫码": "继续扫码",
"编辑明细": "编辑明细",
"扫码结果": "扫码结果",
"pcs": "pcs",
"图号": "图号",
"生产日期": "生产日期",
"有效日期": "有效日期"
}
......@@ -51,7 +51,9 @@
<scanningList
:item="item"
:idx="index"
:editable="false"
@deleGonds="deleGonds"
@updateItem="updateItem"
/>
</view>
</ContentLoadingMore>
......@@ -153,8 +155,21 @@ import BottomBtn from "@/components/BottomBtn/index.vue";
newGoodsList.forEach(newItem => {
const existingIndex = this.goodsList.findIndex(item => item.joinlabel === newItem.joinlabel);
if (existingIndex > -1) {
// 如果已存在,直接替换数量(因为scanning页面已经处理了累加逻辑)
// 保持原有到货数量合并逻辑
this.goodsList[existingIndex].arrivalQuantity = Number(newItem.arrivalQuantity);
// 同步日期与批号(若提供)
if (Object.prototype.hasOwnProperty.call(newItem, 'productionDate')) {
this.goodsList[existingIndex].productionDate = newItem.productionDate;
}
if (Object.prototype.hasOwnProperty.call(newItem, 'effectiveDate')) {
this.goodsList[existingIndex].effectiveDate = newItem.effectiveDate;
}
if (Object.prototype.hasOwnProperty.call(newItem, 'batchNo')) {
this.goodsList[existingIndex].batchNo = newItem.batchNo;
}
if (Object.prototype.hasOwnProperty.call(newItem, 'mb022')) {
this.goodsList[existingIndex].mb022 = newItem.mb022;
}
} else {
// 如果不存在,添加新项
this.goodsList.push(newItem);
......@@ -172,6 +187,12 @@ import BottomBtn from "@/components/BottomBtn/index.vue";
deleGonds(idx) {
this.goodsList.splice(idx, 1);
},
updateItem(payload) {
const { idx, key, value } = payload || {}
if (typeof idx === 'number' && key) {
this.$set(this.goodsList, idx, { ...this.goodsList[idx], [key]: value })
}
},
goSubmit(){
if (!this.goodsList.length) return;
if(!this.daohuoForm.warehouse) return this.$u.toast(i18n.t('请选择到货仓'));
......@@ -179,7 +200,17 @@ import BottomBtn from "@/components/BottomBtn/index.vue";
this.$u.api.confirmArrival({
warehouse: this.daohuoForm.warehouse,
invoiceNo: this.daohuoForm.invoiceNo,
details: this.goodsList.map(v => ({arrivalQuantity: v.arrivalQuantity, materialNo: v.materialNo, purchaseNo: v.purchaseNo, purchaseSerial: v.purchaseSerial, purchaseType: v.purchaseType, supplierNo: v.supplierNo}))
details: this.goodsList.map(v => ({
arrivalQuantity: v.arrivalQuantity,
materialNo: v.materialNo,
purchaseNo: v.purchaseNo,
purchaseSerial: v.purchaseSerial,
purchaseType: v.purchaseType,
supplierNo: v.supplierNo,
productionDate: v.productionDate,
effectiveDate: v.effectiveDate,
batchNo: v.batchNo
}))
})
.then(res => {
this.loading = false;
......@@ -264,4 +295,4 @@ import BottomBtn from "@/components/BottomBtn/index.vue";
margin-top: 20rpx;
}
</style>
\ No newline at end of file
......@@ -6,15 +6,24 @@
<view style="padding: 0 10px;">
<view class="scan-input-container">
<input
style="width: 100%; height: 60px; border: 1px solid #ddd; border-radius: 8px; padding: 0 15px; font-size: 16px;"
style="flex: 1; height: 60px; border: 1px solid #ddd; border-radius: 8px; padding: 0 15px; font-size: 16px;"
type="text"
v-model="input"
:focus="isFocus"
:disabled="isEditMode"
@focus="focus"
@blur="blur"
@confirm="inputCC"
:placeholder="$t('请扫描条码')"
/>
<u-button
type="default"
size="mini"
@click="toggleEditMode"
class="mode-toggle-btn"
>
{{ isEditMode ? $t('继续扫码') : $t('编辑明细') }}
</u-button>
</view>
<view v-if="goodsList.length > 0" class="scan-result-title">{{$t('扫码结果')}}</view>
......@@ -25,7 +34,9 @@
<scanningList
:item="item"
:idx="index"
:editable="isEditMode"
@deleGonds="deleGonds"
@updateItem="updateItem"
/>
</view>
</ContentLoadingMore>
......@@ -52,6 +63,8 @@ export default {
return {
goodsList: [],
isFocus: false,
isEditMode: false,
isEditingDetails: false,
input: '',
btnArr: [
{
......@@ -78,6 +91,7 @@ export default {
},
methods: {
focus(){
if (this.isEditMode || this.isEditingDetails) return;
this.$nextTick(() => {
setTimeout(()=>{
uni.hideKeyboard();
......@@ -88,7 +102,9 @@ export default {
this.isFocus = false;
this.$nextTick(() => {
setTimeout(()=>{
this.isFocus = true;
if (!this.isEditMode && !this.isEditingDetails) {
this.isFocus = true;
}
},500);
});
},
......@@ -108,7 +124,8 @@ export default {
"materialNo": arr[4],
"purchaseNo": arr[2],
"purchaseSerial": arr[3],
"purchaseType": arr[1]
"purchaseType": arr[1],
"supplierNo": arr[0]
})
if (!data.success) return this.input = ''
const index = this.goodsList.findIndex(v => v.joinlabel === arr.slice(0, 5).join('-'))
......@@ -130,20 +147,8 @@ export default {
mb001: arr[4]
})
// 根据mb022属性判断批次管理
let batchNo = ''
if (data.data && data.data.invmb.mb022 === 'Y') {
// 批次管理:生成批号:品号+客户+日期yyyyMMdd
const today = new Date()
const dateStr = today.getFullYear().toString() +
(today.getMonth() + 1).toString().padStart(2, '0') +
today.getDate().toString().padStart(2, '0')
const customer = arr[0] // 使用供应商号作为客户,如果没有则使用默认值
batchNo = arr[4] + customer + dateStr
} else {
// 非批次管理:使用默认批次号
batchNo = data.data && data.data.defBatchNo ? data.data.defBatchNo : ''
}
// 直接使用后端返回的默认批次号
const batchNo = (data && data.data && data.data.defBatchNo) ? data.data.defBatchNo : ''
this.goodsList.push({
supplierNo: arr[0],
......@@ -156,6 +161,23 @@ export default {
mb002: data1.data['mb002'],
mb029: data1.data['mb029'],
batchNo: batchNo,
productionDate: (() => {
const today = new Date()
const yy = today.getFullYear()
const mm = String(today.getMonth() + 1).padStart(2, '0')
const dd = String(today.getDate()).padStart(2, '0')
return `${yy}${mm}${dd}`
})(),
effectiveDate: (() => {
const shelf = Number(data1.data['udf07']) || 0
if (!shelf) return ''
const today = new Date()
today.setDate(today.getDate() + shelf)
const yy = today.getFullYear()
const mm = String(today.getMonth() + 1).padStart(2, '0')
const dd = String(today.getDate()).padStart(2, '0')
return `${yy}${mm}${dd}`
})(),
joinlabel: arr.slice(0, 5).join('-')
})
}
......@@ -174,6 +196,30 @@ export default {
}
}
},
updateItem(payload) {
const { idx, key, value } = payload || {}
if (typeof idx === 'number' && key) {
this.$set(this.goodsList, idx, { ...this.goodsList[idx], [key]: value })
const pages = getCurrentPages();
const prevPage = pages[pages.length - 2];
if (prevPage && prevPage.$vm) {
prevPage.$vm.updateGoodsList(this.goodsList);
}
}
},
toggleEditMode() {
this.isEditMode = !this.isEditMode
if (this.isEditMode) {
this.isFocus = false
uni.hideKeyboard()
} else {
this.$nextTick(() => {
setTimeout(() => {
this.isFocus = true
}, 300)
})
}
},
deleGonds(idx) {
this.goodsList.splice(idx, 1);
// 删除后也同步到主页面
......@@ -194,6 +240,15 @@ export default {
.scan-input-container {
margin: 20rpx 0;
display: flex;
align-items: center;
}
.mode-toggle-btn {
margin-left: 12rpx;
height: 60px;
line-height: 60px;
white-space: nowrap;
}
.scan-result-title {
......@@ -229,4 +284,4 @@ page {
width: 100%;
height: 100%;
}
</style>
\ No newline at end of file
</style>
......@@ -3,22 +3,67 @@
<view class="listItemTitle">
<view class="item" style="border-bottom: 1px solid #d8dbdf;">
<view>{{item.purchaseNo}}|{{item.purchaseSerial}}</view>
<view>{{item.arrivalQuantity}}pcs
<view>{{item.arrivalQuantity}}{{$t('pcs')}}
<text style="margin-left: 40rpx"><u-icon name="minus" color="#000" size="32" @click="deleGonds(idx)"></u-icon></text>
</view>
</view>
<view class="item">
<view>品号:{{item.materialNo}}</view>
<view>{{$t('品号:')}}{{item.materialNo}}</view>
</view>
<view class="item">品名:{{ item.mb002 }}</view>
<view class="item">图号:{{ item.mb029 }}</view>
<view class="item">批号:{{ item.batchNo }}</view>
<view class="item">{{$t('品名:')}}{{ item.mb002 }}</view>
<view class="item">{{$t('图号')}}{{ item.mb029 }}</view>
<view class="item">
<view>{{$t('批号:')}}</view>
<view style="flex: 1; text-align: left;">
<view v-if="!editable">{{ item.batchNo || '-' }}</view>
<input
v-else
type="text"
:value="item.batchNo"
@input="onBatchNoInput"
@focus="onEditStart"
@blur="onEditEnd"
style="width: 420rpx; display: inline-block; text-align: right; border: 1px solid #ddd; border-radius: 6px; padding: 0 10px; height: 60rpx; font-size: 28rpx;"
:placeholder="$t('请输入批号')"
/>
</view>
</view>
<view class="item">
<view>{{$t('生产日期')}}</view>
<view style="flex: 1; text-align: left;">
<view v-if="!editable">{{ formatNoDash(item.productionDate) || '-' }}</view>
<uni-datetime-picker
v-else
type="date"
:border="false"
:clearIcon="true"
:value="formatWithDash(item.productionDate)"
@change="onProdDateChange"
/>
</view>
</view>
<view class="item">
<view>{{$t('有效日期')}}</view>
<view style="flex: 1; text-align: left;">
<view v-if="!editable">{{ formatNoDash(item.effectiveDate) || '-' }}</view>
<uni-datetime-picker
v-else
type="date"
:border="false"
:clearIcon="true"
:value="formatWithDash(item.effectiveDate)"
:start="formatWithDash(item.productionDate) || ''"
@change="onEffDateChange"
/>
</view>
</view>
</view>
</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';
......@@ -38,7 +83,11 @@ export default {
idx: {
type: Number,
default: 0
}
},
editable: {
type: Boolean,
default: true
}
},
computed:{
},
......@@ -52,7 +101,55 @@ export default {
methods: {
deleGonds(idx) {
this.$emit('deleGonds',idx)
}
},
onProdDateChange(val) {
const prodDash = typeof val === 'string' ? val : (val && val.detail ? val.detail.value : val)
const prodNoDash = this.formatNoDash(prodDash)
this.$emit('updateItem', { idx: this.idx, key: 'productionDate', value: prodNoDash })
const shelf = Number(this.item.udf07) || 0
if (shelf > 0 && prodNoDash) {
const eDateDash = this.addDays(this.formatWithDash(prodNoDash), shelf)
this.$emit('updateItem', { idx: this.idx, key: 'effectiveDate', value: this.formatNoDash(eDateDash) })
}
},
onEffDateChange(val) {
const effDash = typeof val === 'string' ? val : (val && val.detail ? val.detail.value : val)
const prodDash = this.formatWithDash(this.item.productionDate)
if (this.item.productionDate && effDash && effDash < prodDash) {
this.$emit('updateItem', { idx: this.idx, key: 'effectiveDate', value: this.item.productionDate })
} else {
this.$emit('updateItem', { idx: this.idx, key: 'effectiveDate', value: this.formatNoDash(effDash) })
}
},
addDays(yyyyMMdd, days) {
const [y, m, d] = yyyyMMdd.split('-').map(n => Number(n))
const dt = new Date(y, (m || 1) - 1, d || 1)
dt.setDate(dt.getDate() + days)
const yy = dt.getFullYear()
const mm = String(dt.getMonth() + 1).padStart(2, '0')
const dd = String(dt.getDate()).padStart(2, '0')
return `${yy}-${mm}-${dd}`
},
onBatchNoInput(e) {
const val = typeof e === 'string' ? e : (e && e.detail ? e.detail.value : '')
this.$emit('updateItem', { idx: this.idx, key: 'batchNo', value: val })
},
onEditStart() {
this.$emit('editing', true)
},
onEditEnd() {
this.$emit('editing', false)
},
formatNoDash(val) {
return val ? String(val).replace(/-/g, '') : ''
},
formatWithDash(val) {
if (!val) return ''
const s = String(val)
if (s.includes('-')) return s
if (s.length === 8) return `${s.slice(0,4)}-${s.slice(4,6)}-${s.slice(6)}`
return s
}
}
};
</script>
......
......@@ -59,14 +59,14 @@ import i18n from '../../lang/index'
export default {
data() {
return {
form: {
boxCode: null,
workOrderType: null,
workOrderNo: null,
quantity: null,
},
queryDetails: [], // 保存查询到的明细数据
loading: false
form: {
boxCode: null,
workOrderType: '5101',
workOrderNo: null,
quantity: null,
},
queryDetails: [], // 保存查询到的明细数据
loading: false
};
},
methods: {
......
......@@ -80,7 +80,6 @@
<u-form-item prop="batchNo" :label="$t('批号:')">
<input
v-model.number="form.batchNo"
disabled
type="text"
@confirm="submit"
>
......@@ -180,7 +179,7 @@ import i18n from '../../lang/index'
form: {
tg010: '01',
tg001: '5801',
tg014: '5101',
tg014: '510',
tg015: null,
// tc006: null,
// tb005: null,
......@@ -227,19 +226,13 @@ import i18n from '../../lang/index'
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
this.form.batchNo = moctaData.batchNo
} else {
this.form.batchNo=""
this.form.batchNo=""
this.$u.toast(i18n.t('未找到工单信息'))
}
}).catch(err => {
this.form.batchNo=""
this.form.batchNo=""
this.$u.toast(i18n.t('查询工单失败'))
})
},
......@@ -277,7 +270,7 @@ import i18n from '../../lang/index'
this.form = {
tg010: '01',
tg001: '5801',
tg014: '5101',
tg014: '510',
tg015: null,
// tc006: null,
// tb005: null,
......@@ -318,7 +311,7 @@ import i18n from '../../lang/index'
border: none !important;
}
}
}
</style>
\ No newline at end of file
This diff is collapsed.
......@@ -66,7 +66,7 @@
<view class="itemtitle">
<text>{{item.tb006}}</text>
<view>
<text style="color: #006400">{{item.quantity}}</text>
<text style="color: #006400">{{calcTotalQuantity(item)}}</text>
</view>
</view>
<view>
......@@ -91,7 +91,7 @@
</view>
<view>
<text>{{$t('领料数量')}}</text>
<text>{{item.quantity}}</text>
<text>{{calcTotalQuantity(item)}}</text>
</view>
</view>
</view>
......@@ -134,6 +134,14 @@ import i18n from '../../lang/index'
this.chargaArr = data.moctes
this.info = data
}
uni.$on('moctcForCreateUpdate', (data) => {
if(this.info && data.ta001 === this.info.ta001 && data.ta002 === this.info.ta002) {
this.getValue(data)
}
})
},
onUnload() {
uni.$off('moctcForCreateUpdate')
},
data() {
return {
......@@ -150,6 +158,13 @@ import i18n from '../../lang/index'
created() {
},
methods: {
calcTotalQuantity(item) {
const base = Number(item.quantity) || 0
const batchSum = this.chargaArr
.filter(v => v.batch && v.tb003 === item.tb003)
.reduce((pre, cur) => pre + (Number(cur.quantity) || 0), 0)
return Math.round((base + batchSum) * 1000000) / 1000000
},
filterCK(e){
console.log('e', e.detail.value)
if(!e.detail.value) {
......@@ -292,4 +307,4 @@ import i18n from '../../lang/index'
}
</style>
\ No newline at end of file
......@@ -16,12 +16,19 @@
:placeholder="$t('请输入调拨数')" @change="handleChangeNum" />
</uni-forms-item>
<uni-forms-item :label="`${$t('调入仓库')}:`">
<zxz-uni-data-select filterable v-model="info.allocateWarehouse" dataKey="text" dataValue="value"
:localdata="warehouseRange" @change="handleChange" />
<zxz-uni-data-select
filterable
v-model="info.allocateWarehouse"
dataKey="text"
dataValue="value"
:localdata="warehouseRange"
@change="handleChange"
@inputChange="handleWarehouseInput"
/>
</uni-forms-item>
<uni-forms-item :label="`${$t('调入储位')}:`">
<zxz-uni-data-select filterable v-model="info.allocateLocation" dataKey="text" dataValue="value"
:localdata="storageRange" />
<uni-forms-item :label="`${$t('调入储位')}:`">
<zxz-uni-data-select filterable v-model="info.allocateLocation" dataKey="text" dataValue="value"
:localdata="storageRange" />
</uni-forms-item>
</uni-forms>
</view>
......@@ -74,7 +81,7 @@
return {
...item,
value: item.mc001,
text: item.mc002,
text: `${item.mc001}|${item.mc002}`,
}
})
})
......@@ -108,6 +115,13 @@
handleChange() {
this.getStorageList();
},
handleWarehouseInput(val) {
const code = String(val || '').trim();
if (!code) return;
const match = this.warehouseRange.find(w => w.value === code);
this.info.allocateWarehouse = match ? match.value : code;
this.getStorageList();
},
}
}
</script>
......@@ -150,4 +164,4 @@
}
}
}
</style>
\ No newline at end of file
</style>
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