feat: add usdt field to freight deduction
This commit is contained in:
parent
0358c01e0a
commit
24ea065feb
@ -2037,6 +2037,7 @@ export default {
|
||||
type: 'Type',
|
||||
quantity: 'Quantity',
|
||||
balance: 'Balance',
|
||||
amount: 'USDT',
|
||||
origin: 'Source',
|
||||
remark: 'Remark',
|
||||
createdAt: 'Created At'
|
||||
@ -2473,6 +2474,7 @@ export default {
|
||||
form: {
|
||||
gold: 'Gold',
|
||||
amount: 'Amount',
|
||||
deductUsdt: 'USDT',
|
||||
rechargeType: 'Recharge Type',
|
||||
remark: 'Remark',
|
||||
contactInfo: 'Contact Info',
|
||||
@ -2482,6 +2484,7 @@ export default {
|
||||
shipGoldQuantity: 'Please enter shipped gold quantity',
|
||||
deductGoldQuantity: 'Please enter deducted gold quantity',
|
||||
amount: 'Please enter amount',
|
||||
deductUsdt: 'Please enter deducted USDT amount',
|
||||
rechargeType: 'Please select recharge type',
|
||||
remark: 'Please enter remark',
|
||||
contactInfo: 'Please enter contact info',
|
||||
@ -2499,6 +2502,7 @@ export default {
|
||||
validation: {
|
||||
required: 'Required field',
|
||||
requiredNotEmpty: 'Required field cannot be empty',
|
||||
requiredAndNonNegative: 'Required field and cannot be less than 0',
|
||||
requiredAndGreaterThanZero: 'Required field and must be greater than 0'
|
||||
},
|
||||
formEdit: {
|
||||
|
||||
@ -2036,6 +2036,7 @@ export default {
|
||||
type: '类型',
|
||||
quantity: '数量',
|
||||
balance: '余额',
|
||||
amount: 'USDT',
|
||||
origin: '来源',
|
||||
remark: '备注',
|
||||
createdAt: '创建时间'
|
||||
@ -2472,6 +2473,7 @@ export default {
|
||||
form: {
|
||||
gold: '金币',
|
||||
amount: '金额',
|
||||
deductUsdt: 'USDT',
|
||||
rechargeType: '充值类型',
|
||||
remark: '备注',
|
||||
contactInfo: '联系方式',
|
||||
@ -2481,6 +2483,7 @@ export default {
|
||||
shipGoldQuantity: '请输入发货金币数量',
|
||||
deductGoldQuantity: '请输入扣款金币数量',
|
||||
amount: '请输入金额',
|
||||
deductUsdt: '请输入扣除的USDT金额',
|
||||
rechargeType: '请选择充值类型',
|
||||
remark: '请输入备注',
|
||||
contactInfo: '请输入联系方式',
|
||||
@ -2498,6 +2501,7 @@ export default {
|
||||
validation: {
|
||||
required: '必填字段',
|
||||
requiredNotEmpty: '必填字段不可为空',
|
||||
requiredAndNonNegative: '必填字段,且不能小于0',
|
||||
requiredAndGreaterThanZero: '必填字段,且必须大于0'
|
||||
},
|
||||
formEdit: {
|
||||
|
||||
@ -138,6 +138,12 @@
|
||||
align="center"
|
||||
min-width="100"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="amount"
|
||||
:label="$t('pages.userFreightInfoList.table.amount')"
|
||||
align="center"
|
||||
min-width="100"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="originName"
|
||||
:label="$t('pages.userFreightInfoList.table.origin')"
|
||||
|
||||
@ -291,8 +291,11 @@
|
||||
:placeholder="type ? $t('pages.userFreight.placeholder.shipGoldQuantity') : $t('pages.userFreight.placeholder.deductGoldQuantity')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="type == true" :label="$t('pages.userFreight.form.amount')" prop="amount">
|
||||
<el-input v-model.trim="formData.amount" :placeholder="$t('pages.userFreight.placeholder.amount')" />
|
||||
<el-form-item :label="type ? $t('pages.userFreight.form.amount') : $t('pages.userFreight.form.deductUsdt')" prop="amount">
|
||||
<el-input
|
||||
v-model.trim="formData.amount"
|
||||
:placeholder="type ? $t('pages.userFreight.placeholder.amount') : $t('pages.userFreight.placeholder.deductUsdt')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="type == true"
|
||||
@ -393,6 +396,31 @@ export default {
|
||||
name: "UserPropsTable",
|
||||
components: { Pagination, FormEdit, RunningWater, SellerInfo },
|
||||
data() {
|
||||
const blank = value => value === undefined || value === null || String(value).trim() === "";
|
||||
const validateEarnPoints = (rule, value, callback) => {
|
||||
if (blank(value)) {
|
||||
callback(new Error(this.$t("pages.userFreight.validation.requiredNotEmpty")));
|
||||
return;
|
||||
}
|
||||
const quantity = Number(value);
|
||||
if (!Number.isFinite(quantity) || quantity < 0 || (this.type && quantity <= 0)) {
|
||||
callback(new Error(this.type ? this.$t("pages.userFreight.validation.requiredAndGreaterThanZero") : this.$t("pages.userFreight.validation.requiredAndNonNegative")));
|
||||
return;
|
||||
}
|
||||
callback();
|
||||
};
|
||||
const validateAmount = (rule, value, callback) => {
|
||||
if (blank(value)) {
|
||||
callback(new Error(this.$t("pages.userFreight.validation.requiredNotEmpty")));
|
||||
return;
|
||||
}
|
||||
const amount = Number(value);
|
||||
if (!Number.isFinite(amount) || amount <= 0) {
|
||||
callback(new Error(this.$t("pages.userFreight.validation.requiredAndGreaterThanZero")));
|
||||
return;
|
||||
}
|
||||
callback();
|
||||
};
|
||||
const commonRules = [
|
||||
{ required: true, message: this.$t("pages.userFreight.validation.required"), trigger: "blur" }
|
||||
];
|
||||
@ -439,12 +467,8 @@ export default {
|
||||
updateLoading: false, //更新提交加载中
|
||||
formRules: {
|
||||
userId: commonRules,
|
||||
earnPoints: {
|
||||
required: true,
|
||||
message: this.$t("pages.userFreight.validation.requiredNotEmpty"),
|
||||
trigger: "blur"
|
||||
},
|
||||
amount: commonRules,
|
||||
earnPoints: [{ validator: validateEarnPoints, trigger: "blur" }],
|
||||
amount: [{ validator: validateAmount, trigger: "blur" }],
|
||||
rechargeType: commonRules,
|
||||
sysOrigin: commonRules,
|
||||
supportedCountries: commonRules,
|
||||
@ -552,6 +576,8 @@ export default {
|
||||
userId: row.userId,
|
||||
earnPoints: "",
|
||||
sysOrigin: row.sysOrigin,
|
||||
amount: "",
|
||||
rechargeType: "",
|
||||
remark: ""
|
||||
};
|
||||
that.goldInputBoxVisible = true;
|
||||
@ -598,7 +624,7 @@ export default {
|
||||
})
|
||||
.catch(er => {
|
||||
that.listLoading = false;
|
||||
that.$opsMessage.success();
|
||||
that.$opsMessage.fail();
|
||||
console.error(er);
|
||||
});
|
||||
return;
|
||||
@ -613,7 +639,7 @@ export default {
|
||||
})
|
||||
.catch(er => {
|
||||
that.listLoading = false;
|
||||
that.$opsMessage.success();
|
||||
that.$opsMessage.fail();
|
||||
console.error(er);
|
||||
});
|
||||
});
|
||||
|
||||
@ -46,6 +46,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="balance" :label="$t('pages.userFreight.table.balance')" align="center" />
|
||||
<el-table-column prop="amount" :label="$t('pages.userFreight.form.deductUsdt')" align="center" />
|
||||
<el-table-column prop="originName" :label="$t('pages.userFreight.runningWater.source')" align="center" />
|
||||
<el-table-column prop="remark" :label="$t('pages.userFreight.form.remark')" align="center" min-width="200" />
|
||||
<el-table-column prop="createTime" :label="$t('pages.userFreight.table.createdAt')" align="center" width="200">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user