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