Kaynağa Gözat

数据格式化完成

11
mo 4 yıl önce
ebeveyn
işleme
26277f425c

+ 40 - 37
src/views/teamDetail/componentClass/calenderStudentList.vue

@@ -9,26 +9,10 @@
       :hideMoney="true"
     />
     <otherform :form="other" ref="other" />
-<<<<<<< HEAD
     <div style="margin-bottom: 20px">
-      <el-button type="primary">一件修改差价</el-button>
+      <el-button type="primary" @click="dialogVisible = true">一件修改差价</el-button>
       <el-button type="primary" @click="init">还原差价</el-button>
     </div>
-=======
-
-    <!-- <div v-for="(item,index) in conrseTypeList" :key="index" style="margin-bottom:30px">
-      <el-alert :title="getTypeName(item.courseType)" :closable="false" class="alert" type="info">
-      </el-alert>
-       <descriptions :column="2">
-        <descriptions-item label="原价:">
-          <el-input v-model="item.courseOriginalPrice" size='mini'></el-input>
-        </descriptions-item>
-      <descriptions-item label="现价:">
-             <el-input v-model="item.courseCurrentPrice" size='mini'></el-input>
-      </descriptions-item>
-      </descriptions>
-    </div> -->
->>>>>>> Inspection
     <el-table
       :data="dataList"
       :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
@@ -65,12 +49,8 @@
               v-for="(item, index) in scope.row.courseList"
               :key="index"
             >
-<<<<<<< HEAD
               {{ item.courseCurrentPrice }}
               <!-- <el-input v-model="item.courseCurrentPrice"></el-input> -->
-=======
-              <el-input v-model="item.courseCurrentPrice" size='mini'></el-input>
->>>>>>> Inspection
             </div>
           </div>
         </template>
@@ -101,17 +81,22 @@
               v-for="(item, index) in scope.row.courseList"
               :key="index"
             >
-<<<<<<< HEAD
               <el-input v-model="item.courseOriginalPrice"></el-input>
               <!-- {{item.courseOriginalPrice}} -->
-=======
-              <el-input v-model="item.courseOriginalPrice" size='mini'></el-input>
->>>>>>> Inspection
             </div>
           </div>
         </template>
       </el-table-column>
     </el-table>
+    <el-dialog title="一键修改差价" :visible.sync="dialogVisible" append-to-body width="500px" v-if="dialogVisible">
+      <calenderStudentList :conrseTypeList='conrseTypeList' ref='calenderStudentList'/>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="setAllprice"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
   </div>
 </template>
 <script>
@@ -120,9 +105,10 @@ import paymentCycle from "@/views/resetTeaming/modals/payment-cycle";
 import otherform from "@/views/resetTeaming/modals/other";
 import { getTimes } from "@/utils";
 import { spanGroupMergeClassSplitClassAffirm } from "@/api/buildTeam";
-import {filterCourseType} from "@/constant"
+import { courseType, filterCourseType } from "@/constant";
 import descriptions from "@/components/Descriptions";
 Vue.use(descriptions);
+import calenderStudentList from './resetCourseMasker'
 export default {
   props: [
     "studentIds",
@@ -134,6 +120,7 @@ export default {
   components: {
     paymentCycle,
     otherform,
+    calenderStudentList
   },
   data() {
     return {
@@ -145,11 +132,10 @@ export default {
       },
       other: {},
       dataList: [],
-<<<<<<< HEAD
       copyList: {},
-=======
       conrseTypeList: [],
->>>>>>> Inspection
+      filterCourseType,
+      dialogVisible:false
     };
   },
   mounted() {
@@ -277,20 +263,37 @@ export default {
         }
       });
       this.dataList = Object.values(data);
-      // this.getNewClassType(this.dataList[0]?.courseList);
+      this.getNewClassType(this.dataList[0]?.courseList);
     },
     getNewClassType(arr) {
-      console.log(this.$options)
       this.conrseTypeList = arr.map((item) => {
         return {
-          courseType: item.courseType,
-          courseCurrentPrice: item.courseCurrentPrice,
-          courseOriginalPrice: item.courseOriginalPrice,
-        };
+          type:item.courseType,
+          typeName:this.filterCourseType[item.courseType]+'补缴',
+          price:''
+        }
       });
+
     },
-    getTypeName(type){
-      return filterCourseType[type]
+    setAllprice(){
+      this.$refs.calenderStudentList.$refs.visitForm.validate(res=>{
+        if(res){
+          this.mergeInfoList.forEach(merge=>{
+            this.conrseTypeList.forEach(courseType=>{
+              if(merge.courseType == courseType.type){
+                // 修改为新值
+                merge.courseOriginalPrice = courseType.price
+              }
+            })
+          })
+           this.$refs.calenderStudentList.$refs.visitForm.resetFields();
+           this.dialogVisible = false
+          // this.conrseTypeList
+          // this.mergeInfoList
+
+        }
+      })
+
     }
   },
 };

+ 34 - 0
src/views/teamDetail/componentClass/resetCourseMasker.vue

@@ -0,0 +1,34 @@
+<template>
+  <div>
+    <el-form :model="courseTypeForm"
+    label-width="120px"
+      label-position="right"
+      ref="visitForm">
+      <el-form-item v-for="(item,index) in this.conrseTypeList" :key='index' :label="item.typeName" :prop="'conrseTypeList.'+index+'.price'" :rules="[{
+      required: true, message: '补缴金额不能为空', trigger: 'blur'
+    },{
+      required: true, message: '请输入正确的金额', trigger: 'blur', pattern: /^(\+)?\d+(\.\d+)?$/,
+    }]">
+        <el-input v-model="item.price" placeholder="请输入补缴金额"></el-input>
+      </el-form-item>
+    </el-form>
+  </div>
+</template>
+<script>
+export default {
+  props:['conrseTypeList'],
+  data(){
+    return{
+      courseTypeForm:{
+        conrseTypeList:this.conrseTypeList
+      }
+    }
+  },
+  mounted(){
+
+  }
+}
+</script>
+<style lang="scss">
+
+</style>