From eb9838ebbf1017bbe2fbe981dfc4be2bf26528e7 Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期一, 02 三月 2026 09:25:36 +0800
Subject: [PATCH] #
---
pages/InManagement/ContainerBinding/Container_Binding.vue | 102 +++++++++++++++++++++++++++++++-------------------
1 files changed, 63 insertions(+), 39 deletions(-)
diff --git a/pages/InManagement/ContainerBinding/Container_Binding.vue b/pages/InManagement/ContainerBinding/Container_Binding.vue
index 5124566..096e17f 100644
--- a/pages/InManagement/ContainerBinding/Container_Binding.vue
+++ b/pages/InManagement/ContainerBinding/Container_Binding.vue
@@ -2,7 +2,7 @@
<view class="page-container">
<!-- 澶撮儴瀵艰埅 -->
<u-navbar
- title="缁勬墭"
+ :title="$t('container.title')"
:fixed="true"
:placeholder="true"
bgColor="#ffffff"
@@ -25,13 +25,13 @@
color="#409eff"
customStyle="margin-right: 10rpx;"
></u-icon>
- <text class="label-text">鎵樼洏鐮�</text>
+ <text class="label-text">{{ $t('container.palletCode') }}</text>
</view>
</template>
<view class="input-wrap">
<u--input
v-model="barcode"
- placeholder="鎵爜 / 杈撳叆鎵樼洏鐮�"
+ :placeholder="$t('container.scanPallet')"
clearable
border="none"
:focus="barcodeFocus"
@@ -47,13 +47,13 @@
color="#409eff"
customStyle="margin-right: 10rpx;"
></u-icon>
- <text class="label-text">鐗╂枡鐮�</text>
+ <text class="label-text">{{ $t('container.matCode') }}</text>
</view>
</template>
<view class="input-wrap">
<u--input
v-model="matnr"
- placeholder="鎵爜 / 杈撳叆鐗╂枡鐮�"
+ :placeholder="$t('container.scanMat')"
clearable
border="none"
:focus="matFocus"
@@ -70,7 +70,7 @@
<view class="list-header">
<view class="title-indicator"></view>
<text class="header-title">
- 鍟嗗搧鍒楄〃 ({{ dataList.length }})
+ {{ $t('container.matList') }} ({{ dataList.length }})
</text>
</view>
@@ -87,20 +87,20 @@
<view class="card-content">
<view class="info-row">
- <text class="info-label">鍝佸悕</text>
+ <text class="info-label">{{ $t('container.matName') }}</text>
<text class="info-value">
{{ item.maktx || '-' }}
</text>
</view>
<view class="info-row">
<view class="info-col">
- <text class="info-label">瑙勬牸</text>
+ <text class="info-label">{{ $t('container.matSpec') }}</text>
<text class="info-value">
{{ item.specs || '-' }}
</text>
</view>
<view class="info-col">
- <text class="info-label">鎵瑰彿</text>
+ <text class="info-label">{{ $t('container.matBatch') }}</text>
<text class="info-value highlight">
{{ item.batch || '-' }}
</text>
@@ -108,7 +108,7 @@
</view>
<view class="info-row">
<view class="info-col">
- <text class="info-label">鏁伴噺</text>
+ <text class="info-label">{{ $t('container.matQty') }}</text>
<text class="info-value qty">
{{ item.anfme }}
</text>
@@ -121,7 +121,7 @@
type="primary"
size="small"
plain
- text="淇敼"
+ :text="$t('container.modify')"
@click="revise(item, i)"
customStyle="width: 140rpx; margin: 0;"
></u-button>
@@ -130,7 +130,7 @@
type="error"
size="small"
plain
- text="绉婚櫎"
+ :text="$t('container.remove')"
@click="remove(item, i)"
customStyle="width: 140rpx; margin: 0;"
></u-button>
@@ -140,7 +140,7 @@
<u-empty
v-if="dataList.length === 0"
mode="list"
- text="鏆傛棤鍟嗗搧锛岃鎵弿鐗╂枡鐮佹坊鍔�"
+ :text="$t('container.emptyList')"
marginTop="40"
></u-empty>
</view>
@@ -151,7 +151,7 @@
<view class="btn-wrap">
<u-button
type="info"
- text="閲嶇疆"
+ :text="$t('container.reset')"
@click="resetConfirmBtn"
></u-button>
</view>
@@ -161,7 +161,7 @@
>
<u-button
type="primary"
- text="纭缁勬墭"
+ :text="$t('container.confirmComb')"
@click="combConfirmBtn"
:disabled="dataList.length === 0"
:throttleTime="1500"
@@ -177,23 +177,23 @@
@close="showRevise = false"
>
<view class="popup-card">
- <view class="popup-header"><text>淇敼淇℃伅</text></view>
+ <view class="popup-header"><text>{{ $t('container.modifyInfo') }}</text></view>
<view class="popup-body">
<u--form
labelWidth="80"
labelPosition="left"
>
- <u-form-item label="缂栫爜">
+ <u-form-item :label="$t('container.code')">
<text class="popup-text-val">{{ editMatnr }}</text>
</u-form-item>
- <u-form-item label="鎵瑰彿">
+ <u-form-item :label="$t('container.matBatch')">
<u--input
v-model="batch"
- placeholder="杈撳叆鎵瑰彿"
+ :placeholder="$t('matSelected.inputBatch')"
border="surround"
></u--input>
</u-form-item>
- <u-form-item label="鏁伴噺">
+ <u-form-item :label="$t('container.matQty')">
<u-number-box
v-model="count"
:step="0.01"
@@ -205,13 +205,13 @@
</view>
<view class="popup-footer">
<u-button
- text="鍙栨秷"
+ :text="$t('common.cancel')"
@click="showRevise = false"
customStyle="margin-right: 20rpx; flex: 1;"
></u-button>
<u-button
type="primary"
- text="纭"
+ :text="$t('common.confirm')"
@click="reviseConfirm"
customStyle="flex: 1;"
></u-button>
@@ -222,24 +222,24 @@
<!-- 妯℃�佹 -->
<u-modal
:show="showRemove"
- title="纭绉婚櫎"
- content="鏄惁绉婚櫎璇ュ晢鍝侊紵"
+ :title="$t('container.confirmRemove')"
+ :content="$t('container.removeMsg')"
showCancelButton
@confirm="removeConfirm"
@cancel="showRemove = false"
></u-modal>
<u-modal
:show="showComb"
- title="纭缁勬墭"
- content="纭灏嗗晢鍝佺粍鎵樺叆搴擄紵"
+ :title="$t('container.confirmComb')"
+ :content="$t('container.combMsg')"
showCancelButton
@confirm="comb"
@cancel="showComb = false"
></u-modal>
<u-modal
:show="showReset"
- title="纭閲嶇疆"
- content="鏄惁娓呯┖鎵�鏈夊晢鍝侊紵"
+ :title="$t('container.confirmReset')"
+ :content="$t('container.resetMsg')"
showCancelButton
@confirm="resetConfirm"
@cancel="showReset = false"
@@ -271,7 +271,25 @@
showRevise: false,
showRemove: false,
showComb: false,
- showReset: false
+ showReset: false,
+ orderCombNeedSplit: true,
+ orderCombSeparator: ';',
+ orderCombArrayIndex: 0,
+ orderCombStartPos: 3
+ }
+ },
+ onShow() {
+ let settings = uni.getStorageSync('appSettings')
+ if (settings) {
+ this.orderCombNeedSplit = settings.orderCombNeedSplit !== false
+ this.orderCombSeparator = settings.orderCombSeparator || ';'
+ this.orderCombArrayIndex = settings.orderCombArrayIndex !== undefined ? Number(settings.orderCombArrayIndex) : 0
+ this.orderCombStartPos = settings.orderCombStartPos !== undefined ? Number(settings.orderCombStartPos) : 3
+ } else {
+ this.orderCombNeedSplit = true
+ this.orderCombSeparator = ';'
+ this.orderCombArrayIndex = 0
+ this.orderCombStartPos = 3
}
},
methods: {
@@ -281,7 +299,7 @@
if (len > 0 && len !== 8 && len !== 9) {
this.$showToast({
type: 'error',
- message: '鎵樼洏鐮佹湁璇閲嶈瘯'
+ message: this.$t('toast.palletError')
})
this.barcodeFocuss()
return
@@ -305,9 +323,15 @@
},
async findMat(val) {
if (!this.matnr) return
+ let matnr1 = this.matnr
+ if (this.orderCombNeedSplit) {
+ let m = this.matnr.split(this.orderCombSeparator)
+ let targetChunk = m[this.orderCombArrayIndex] || m[0]
+ matnr1 = targetChunk.slice(this.orderCombStartPos)
+ }
try {
const { code, data, msg } = await findMatAuth(
- { matnr: this.matnr },
+ { matnr: matnr1 },
{ custom: { catch: true } }
)
if (code === 200 && data) {
@@ -339,7 +363,7 @@
if (!data && data !== null) {
this.$showToast({
type: 'error',
- message: msg || '鏌ヨ澶辫触'
+ message: msg || this.$t('toast.queryFail')
})
}
}
@@ -392,7 +416,7 @@
this.dataList[this.rowNum].batch = this.batch
this.dataList[this.rowNum].weight = this.weight
this.editMatnr = ''
- this.$showToast({ type: 'success', message: '淇敼鎴愬姛' })
+ this.$showToast({ type: 'success', message: this.$t('toast.modifySuccess') })
this.showRevise = false
},
remove(item, i) {
@@ -401,7 +425,7 @@
},
removeConfirm() {
this.dataList.splice(this.removeNum, 1)
- this.$showToast({ type: 'success', message: '绉婚櫎鎴愬姛' })
+ this.$showToast({ type: 'success', message: this.$t('toast.removeSuccess') })
this.showRemove = false
},
combConfirmBtn() {
@@ -410,7 +434,7 @@
},
async comb() {
if (this.barcode === '') {
- this.$showToast({ type: 'error', message: '璇锋壂鎻忔墭鐩樻潯鐮�' })
+ this.$showToast({ type: 'error', message: this.$t('toast.scanPalletCode') })
this.showComb = false
return
}
@@ -421,7 +445,7 @@
) {
this.$showToast({
type: 'error',
- message: this.dataList[i].matnr + '缁勬墭鏁伴噺涓嶈兘涓�0'
+ message: this.$t('toast.qtyNotZeroMat').replace('{0}', this.dataList[i].matnr)
})
this.showComb = false
return
@@ -442,7 +466,7 @@
if (code === 200) {
this.resst()
- this.$showToast({ type: 'success', message: '缁勬墭鎴愬姛' })
+ this.$showToast({ type: 'success', message: this.$t('toast.combSuccess') })
} else if (code === 403) {
this.$showToast({ type: 'error', message: msg })
setTimeout(() => {
@@ -451,7 +475,7 @@
} else {
this.$showToast({
type: 'error',
- message: msg || '缁勬墭澶辫触'
+ message: msg || this.$t('toast.combFail')
})
}
} catch (err) {
@@ -464,7 +488,7 @@
resetConfirm() {
this.dataList = []
this.barcode = ''
- this.$showToast({ type: 'success', message: '閲嶇疆瀹屾垚' })
+ this.$showToast({ type: 'success', message: this.$t('toast.resetComplete') })
this.showReset = false
},
resst() {
--
Gitblit v1.9.1