From b6794b7fe90db8a71fd6bee4541984e73bed6b8a Mon Sep 17 00:00:00 2001 From: jia <1451658316@qq.com> Date: Mon, 14 Aug 2023 17:35:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=AC=E5=94=AE=E7=AE=A1=E7=90=86-=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=20=E6=96=B0=E5=A2=9E=E4=B8=8B=E6=B5=AE=E7=99=BE?= =?UTF-8?q?=E5=88=86=E6=AF=94=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/product/ProductResale/index.vue | 30 ++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) 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