Pārlūkot izejas kodu

关闭乐团修改

wolyshaw 4 gadi atpakaļ
vecāks
revīzija
91e3fa9b0a
1 mainītis faili ar 26 papildinājumiem un 11 dzēšanām
  1. 26 11
      src/views/teamBuild/modals/close-studens.vue

+ 26 - 11
src/views/teamBuild/modals/close-studens.vue

@@ -31,13 +31,22 @@
         </el-table-column>
         <el-table-column prop="surplusCourseFee" align="center" label="退费金额(元)" width="150">
           <template slot-scope="scope">
-            <el-form-item :prop="'' + scope.row.userId">
+            <el-form-item
+              :show-message="false"
+              :prop="'' + scope.row.userId"
+              style="margin-bottom: 0;"
+              :rules="[{
+                required: true,
+                message: ''
+              }]"
+            >
               <el-input-number
                 :min="0"
                 :max="scope.row.surplusCourseFee"
                 size="mini"
                 :controls="false"
-                :precision="0"
+                :precision="2"
+                :step="0.01"
                 v-model="moneys[scope.row.userId]"
                 placeholder="请输入退费金额"
               />
@@ -80,16 +89,22 @@ export default {
     },
     async submit() {
       try {
-        await this.$confirm('是否确认关闭乐团', '提示', {
-          type: 'warning'
+        this.$refs.form.validate(async valid => {
+          if (valid) {
+            await this.$confirm('是否确认关闭乐团', '提示', {
+              type: 'warning'
+            })
+            await closeMusicGroup({
+              musicGroupId: this.detail?.id,
+              userReBack: this.moneys
+            })
+            this.$message.success('关闭成功')
+            this.$emit('submited')
+            this.$emit('close')
+          } else {
+            this.$$message.error('请填写完成退费金额')
+          }
         })
-        await closeMusicGroup({
-          musicGroupId: this.detail?.id,
-          userReBack: this.moneys
-        })
-        this.$message.success('关闭成功')
-        this.$emit('submited')
-        this.$emit('close')
       } catch (error) {}
     }
   }