转售管理-审核 新增下浮百分比功能

This commit is contained in:
jia 2023-08-14 17:35:01 +08:00
parent f454b8da87
commit b6794b7fe9

View File

@ -117,6 +117,9 @@
<el-radio :label="-1">拒绝</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="ruleForm.status===1 && isExamine" label="自动下浮百分比" prop="float_rate">
<el-input v-model="ruleForm.float_rate" placeholder="请输入百分比" />
</el-form-item>
<el-form-item v-if="ruleForm.status===-1 && isExamine" label="原因" prop="refusal">
<el-input v-model="ruleForm.refusal" type="textarea" placeholder="请输入原因" />
</el-form-item>
@ -141,6 +144,16 @@
// +----------------------------------------------------------------------
import { resaleList, resaleShow, resaleStatus, resaleDetail } from '@/api/product'
import log from '@/libs/util.log';
const scoreWeightValidate = (rule, value, callback) => {
const testReg = /^(?:[1-9]?\d|100)$/;
if (testReg.test(value)) {
callback();
} else {
callback(new Error("0-100的数字"));
}
}
export default {
name: 'communityTopic',
data() {
@ -161,6 +174,7 @@ export default {
username: "",
category_id: "",
is_show: '',
float_rate: 0
},
statusList: [
@ -170,7 +184,7 @@ export default {
{ label: "下架", value: -2 },
],
cateSelect:[{value:1, label: "调货"}, {value: 2, label: "打折"}],
cateSelect: [{ value: 1, label: "调货" }, { value: 2, label: "打折" }],
topicSelect: [],
dialogVisible: false,
loading: false,
@ -183,7 +197,15 @@ export default {
],
refusal: [
{ required: true, message: '请填写拒绝原因', trigger: 'blur' }
],
float_rate: [
{ required: true, message: "请输入下浮百分比", trigger: ["blur", "change"] },
{
validator: scoreWeightValidate,
trigger: 'blur'
}
]
},
ruleForm: {
refusal: '',
@ -191,9 +213,10 @@ export default {
},
}
},
mounted() {
this.getList(1)
},
@ -224,8 +247,9 @@ export default {
},
// 1: -1:
onSubmit(item) {
if (this.ruleForm.status == 1) {
resaleStatus(item.community_id, { "status": 1 }).then((res) => {
resaleStatus(item.community_id, { "status": 1 ,float_rate:this.ruleForm.float_rate}).then((res) => {
this.$message.success(res.message)
this.dialogVisible = false
this.formData = res.data