From 58b41dc039c5c9d1b758c9e190a7c35225ad7585 Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期四, 05 三月 2026 18:04:25 +0800
Subject: [PATCH] #
---
pages/InManagement/ContainerBinding/Container_Binding.vue | 175 ++++++++++++++++++++++++++++++++--------------------------
1 files changed, 97 insertions(+), 78 deletions(-)
diff --git a/pages/InManagement/ContainerBinding/Container_Binding.vue b/pages/InManagement/ContainerBinding/Container_Binding.vue
index 5124566..1a90005 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>
@@ -86,33 +86,9 @@
</view>
<view class="card-content">
- <view class="info-row">
- <text class="info-label">鍝佸悕</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-value">
- {{ item.specs || '-' }}
- </text>
- </view>
- <view class="info-col">
- <text class="info-label">鎵瑰彿</text>
- <text class="info-value highlight">
- {{ item.batch || '-' }}
- </text>
- </view>
- </view>
- <view class="info-row">
- <view class="info-col">
- <text class="info-label">鏁伴噺</text>
- <text class="info-value qty">
- {{ item.anfme }}
- </text>
- </view>
+ <view class="info-row" v-for="(field, idx) in displayFields" :key="idx">
+ <text class="info-label">{{ $t(field.label) }}</text>
+ <text class="info-value">{{ item[field.field] || '-' }}</text>
</view>
</view>
@@ -121,7 +97,7 @@
type="primary"
size="small"
plain
- text="淇敼"
+ :text="$t('container.modify')"
@click="revise(item, i)"
customStyle="width: 140rpx; margin: 0;"
></u-button>
@@ -130,7 +106,7 @@
type="error"
size="small"
plain
- text="绉婚櫎"
+ :text="$t('container.remove')"
@click="remove(item, i)"
customStyle="width: 140rpx; margin: 0;"
></u-button>
@@ -140,7 +116,7 @@
<u-empty
v-if="dataList.length === 0"
mode="list"
- text="鏆傛棤鍟嗗搧锛岃鎵弿鐗╂枡鐮佹坊鍔�"
+ :text="$t('container.emptyList')"
marginTop="40"
></u-empty>
</view>
@@ -151,7 +127,7 @@
<view class="btn-wrap">
<u-button
type="info"
- text="閲嶇疆"
+ :text="$t('container.reset')"
@click="resetConfirmBtn"
></u-button>
</view>
@@ -161,7 +137,7 @@
>
<u-button
type="primary"
- text="纭缁勬墭"
+ :text="$t('container.confirmComb')"
@click="combConfirmBtn"
:disabled="dataList.length === 0"
:throttleTime="1500"
@@ -177,41 +153,44 @@
@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--input
- v-model="batch"
- placeholder="杈撳叆鎵瑰彿"
- border="surround"
- ></u--input>
- </u-form-item>
- <u-form-item label="鏁伴噺">
+ <u-form-item
+ v-for="(ef, efIdx) in editFields"
+ :key="efIdx"
+ :label="$t(ef.label)"
+ >
<u-number-box
- v-model="count"
+ v-if="ef.type === 'number'"
+ v-model="editFormData[ef.field]"
:step="0.01"
:max="9999999"
- @change="changeValue"
></u-number-box>
+ <u--input
+ v-else
+ v-model="editFormData[ef.field]"
+ :placeholder="$t('settings.inputPlaceholder')"
+ border="surround"
+ ></u--input>
</u-form-item>
</u--form>
</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 +201,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 +250,42 @@
showRevise: false,
showRemove: false,
showComb: false,
- showReset: false
+ showReset: false,
+ orderCombNeedSplit: true,
+ orderCombSeparator: ';',
+ orderCombArrayIndex: 0,
+ orderCombStartPos: 3,
+ displayFields: [
+ { field: 'maktx', label: 'container.matName' },
+ { field: 'specs', label: 'container.matSpec' },
+ { field: 'batch', label: 'container.matBatch' },
+ { field: 'anfme', label: 'container.matQty' }
+ ],
+ editFields: [
+ { field: 'batch', label: 'container.matBatch', type: 'text' },
+ { field: 'anfme', label: 'container.matQty', type: 'number' }
+ ],
+ editFormData: {}
+ }
+ },
+ 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
+ if (settings.containerBindingFields && settings.containerBindingFields.length > 0) {
+ this.displayFields = settings.containerBindingFields
+ }
+ if (settings.containerBindingEditFields && settings.containerBindingEditFields.length > 0) {
+ this.editFields = settings.containerBindingEditFields
+ }
+ } else {
+ this.orderCombNeedSplit = true
+ this.orderCombSeparator = ';'
+ this.orderCombArrayIndex = 0
+ this.orderCombStartPos = 3
}
},
methods: {
@@ -281,7 +295,7 @@
if (len > 0 && len !== 8 && len !== 9) {
this.$showToast({
type: 'error',
- message: '鎵樼洏鐮佹湁璇閲嶈瘯'
+ message: this.$t('toast.palletError')
})
this.barcodeFocuss()
return
@@ -305,9 +319,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 +359,7 @@
if (!data && data !== null) {
this.$showToast({
type: 'error',
- message: msg || '鏌ヨ澶辫触'
+ message: msg || this.$t('toast.queryFail')
})
}
}
@@ -378,21 +398,20 @@
},
revise(item, i) {
this.editMatnr = this.dataList[i].matnr
- this.count = this.dataList[i].anfme
- this.batch = this.dataList[i].batch
- this.weight = this.dataList[i].weight
this.rowNum = i
+ var formData = {}
+ this.editFields.forEach(ef => {
+ formData[ef.field] = this.dataList[i][ef.field] !== undefined ? String(this.dataList[i][ef.field]) : ''
+ })
+ this.editFormData = formData
this.showRevise = true
},
- changeValue(e) {
- this.count = e.value
- },
reviseConfirm() {
- this.dataList[this.rowNum].anfme = this.count
- this.dataList[this.rowNum].batch = this.batch
- this.dataList[this.rowNum].weight = this.weight
+ this.editFields.forEach(ef => {
+ this.dataList[this.rowNum][ef.field] = this.editFormData[ef.field]
+ })
this.editMatnr = ''
- this.$showToast({ type: 'success', message: '淇敼鎴愬姛' })
+ this.$showToast({ type: 'success', message: this.$t('toast.modifySuccess') })
this.showRevise = false
},
remove(item, i) {
@@ -401,7 +420,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 +429,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 +440,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 +461,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 +470,7 @@
} else {
this.$showToast({
type: 'error',
- message: msg || '缁勬墭澶辫触'
+ message: msg || this.$t('toast.combFail')
})
}
} catch (err) {
@@ -464,7 +483,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