Browse Source

Merge branch 'milestone-20251215-多语言二期2' of http://39.101.133.168:8807/huangqizhen/gold-vue into milestone-20251215-多语言二期2

zhangyong/feature-20260113094820-现金重构
ZhangYong 1 month ago
parent
commit
43bea72617
  1. 5
      src/components/locales/lang/en.js
  2. 7
      src/components/locales/lang/zh-CN.js
  3. 34
      src/views/consume/gold/addCoinConsume.vue

5
src/components/locales/lang/en.js

@ -620,6 +620,11 @@ export default {
receiveAreaPlaceholder: "Select region",
price: "Price",
goodsNamePlaceholder: "Select product",
使用红包: "Use Red Envelope",
不使用红包: "Do Not Use Red Envelope",
选择红包: "Select Red Envelope",
请选择红包: "Please Select Red Envelope",
已抵扣: "Already Deducted",
payModel: "Collection",
refundType: "Refund Type",
refundTypePlaceholder: "Select type",

7
src/components/locales/lang/zh-CN.js

@ -620,6 +620,11 @@ export default {
receiveAreaPlaceholder: "请选择到账地区",
price: "原价",
goodsNamePlaceholder: "请选择商品",
使用红包: "使用红包",
不使用红包: "不使用红包",
选择红包: "选择红包",
请选择红包: "请选择红包",
已抵扣: "已抵扣",
payModel: "收款方式",
refundType: "退款类型",
refundTypePlaceholder: "请选择退款类型",
@ -690,7 +695,7 @@ export default {
consumptionTimes: "消费次数",
onlyStatisticsDataAfter20250101: "仅统计2025-01-01后的数据",
store: "所属门店",
// maxReductionAmount: "红包最大抵扣金额",
maxReductionAmount: "红包最大抵扣金额",
//金豆
currentPayableBean: "当前付费金豆",
currentFreeBean: "当前免费金豆",

34
src/views/consume/gold/addCoinConsume.vue

@ -64,7 +64,8 @@ const addConsume = ref({
taskGold: null, //
remark: "",//
adminId: null,// id
adminName: adminData.value.adminName
adminName: adminData.value.adminName,
redMoney: 1 // 使1-使0-使
})
const Ref = ref(null)
const rules = reactive({
@ -179,7 +180,7 @@ function validateInput() {
//
if (user.value.jwcode && sumGold > totalAvailableGold) {
if (addConsume.value.redMoney === 1) {
ElMessage.error('红包抵扣额不足');
ElMessage.error(t('elmessage.limitRedAmount'));
//
selectedReds.value = []
} else {
@ -193,7 +194,7 @@ function validateInput() {
return true;
}
// blursumGold
// blur +
function validateRedLimit() {
const sumGold = parseFloat(addConsume.value.sumGold);
const price = Number(addConsume.value.price || 0);
@ -245,7 +246,7 @@ function calculateCoins(sumGold) {
remaining = parseFloat((remaining - permanentUsed).toFixed(4));
}
// 3.
//
if (remaining > 0 && nowTaskGold > 0) {
const availableTaskGold = parseFloat(nowTaskGold.toFixed(4));
taskUsed = Math.min(availableTaskGold, remaining);
@ -352,7 +353,8 @@ function resetForm() {
taskGold: null,
remark: "",
adminId: adminData.value.id,
adminName: adminData.value.adminName
adminName: adminData.value.adminName,
redMoney: 1 // 使
}
//
@ -455,7 +457,7 @@ const addBefore = () => {
});
return;
}
if (!validateInput()) {
if (!validateInput() || !validateRedLimit()) {
return;
}
ReadCookies.value = `coinConsume:${addConsume.value.jwcode}:${addConsume.value.goodsName.value}`
@ -600,8 +602,6 @@ watch(
}
);
/* 红包逻辑已在当前分支移除 */
/*
====================红包逻辑=================================
*/
@ -738,17 +738,21 @@ onMounted(async function () {
<el-input v-model="addConsume.price" style="width: 120px" disabled />
</el-form-item>
<!-- <el-form-item prop="sumGold" :label="t('common_add.consumeTotalGold')">
<el-input v-model="addConsume.sumGold" style="width: 120px"
@blur="validateRedLimit()" />
</el-form-item> -->
<el-form-item prop="sumGold" :label="t('common_add.consumeTotalGold')">
<el-input v-model="addConsume.sumGold" style="width: 120px" @blur="validateRedLimit()" :disabled="addConsume.redMoney === 1" />
<el-radio v-model="addConsume.redMoney" :label="1" style="margin-left: 10px;">使用红包</el-radio>
<el-radio v-model="addConsume.redMoney" :label="0">不使用红包</el-radio>
<el-radio v-model="addConsume.redMoney" :label="1" style="margin-left: 10px;">{{ t('common_add.使用红包') }}</el-radio>
<el-radio v-model="addConsume.redMoney" :label="0">{{ t('common_add.不使用红包') }}</el-radio>
</el-form-item>
<el-form-item v-if="addConsume.redMoney === 1" label="选择红包">
<el-form-item v-if="addConsume.redMoney === 1" :label="t('common_add.选择红包')">
<el-select
v-model="selectedReds"
multiple
placeholder="请选择红包"
:placeholder="t('common_add.请选择红包')"
style="width: 200px"
value-key="id"
collapse-tags
@ -762,7 +766,7 @@ onMounted(async function () {
/>
</el-select>
<span style="margin-left: 10px; color: #666;">
已抵扣: {{ totalRedAmount }}
{{ t('common_add.已抵扣') }}: {{ totalRedAmount }}
</span>
</el-form-item>
@ -868,11 +872,11 @@ onMounted(async function () {
<p>{{ user.market }}</p>
</el-form-item>
</el-col>
<!-- <el-col :span="14">
<el-col :span="14">
<el-form-item :label="$t('common_add_user.maxReductionAmount')">
<p style="color: #2fa1ff">{{ user.red }} </p>
</el-form-item>
</el-col> -->
</el-col>
</el-row>
</el-form>
</el-card>

Loading…
Cancel
Save