diff --git a/src/views/product/ProductResale/index.vue b/src/views/product/ProductResale/index.vue index cf81f46..7244723 100644 --- a/src/views/product/ProductResale/index.vue +++ b/src/views/product/ProductResale/index.vue @@ -117,6 +117,9 @@ 拒绝 + + + @@ -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