Browse Source

Merge branch '03/03GRADE' into test

lex-xin 4 years ago
parent
commit
33ea1f7fab
1 changed files with 35 additions and 92 deletions
  1. 35 92
      src/views/teamBuild/signupList.vue

+ 35 - 92
src/views/teamBuild/signupList.vue

@@ -808,43 +808,21 @@
       </div>
     </el-dialog>
 
-    <el-dialog title="订单详情" :visible.sync="orderVisible" width="600px">
-      <el-form :model="orderForm" :inline="true">
-        <!--     name: '',
-        totalAmount: '',
-        subject: '',
-        subjectFee: '',
-        axe: '',
-        axePrice: '',
-        others: '',
-        othersPrice: '' -->
-        <el-form-item label="学员姓名">
-          <el-input v-model.trim="orderForm.name" disabled=""></el-input>
-        </el-form-item>
-        <el-form-item label="实缴金额">
-          <el-input v-model.trim="orderForm.totalAmount" disabled=""></el-input>
-        </el-form-item>
-        <el-form-item label="实际专业">
-          <el-input v-model.trim="orderForm.subject" disabled=""></el-input>
-        </el-form-item>
-        <el-form-item label="课程费用">
-          <el-input v-model.trim="orderForm.subjectFee" disabled=""></el-input>
-        </el-form-item>
-        <el-form-item label="选择乐器">
-          <el-input v-model.trim="orderForm.axe" disabled=""></el-input>
-        </el-form-item>
-        <el-form-item label="乐器价格">
-          <el-input v-model.trim="orderForm.axePrice" disabled=""></el-input>
-        </el-form-item>
-        <el-form-item label="教辅组合">
-          <el-input v-model.trim="orderForm.others" disabled=""></el-input>
-        </el-form-item>
-        <el-form-item label="组合价格">
-          <el-input v-model.trim="orderForm.othersPrice" disabled=""></el-input>
-        </el-form-item>
-      </el-form>
+    <el-dialog title="订单详情" :visible.sync="orderVisible" width="800px">
+      <template v-if="orderForm.length > 0">
+        <descriptions :column="2">
+          <template v-for="(item, index) in orderForm">
+            <descriptions-item :key="index" :label="item.name">{{ item.price | moneyFormat }}元</descriptions-item>
+            <descriptions-item :key="index" label="订单创建时间">{{ item.createTime }}</descriptions-item>
+          </template>
+        </descriptions>
+      </template>
+      <el-row v-else>
+        <el-col :span="24">
+          <empty desc="暂无订单详情" />
+        </el-col>
+      </el-row>
       <div slot="footer" class="dialog-footer">
-        <!-- <el-button>取 消</el-button> -->
         <el-button type="primary" @click="orderVisible = false"
           >确 定</el-button
         >
@@ -990,7 +968,8 @@ import { permission } from "@/utils/directivePage";
 import cleanDeep from "clean-deep";
 import changeVoice from "./modals/change-voice";
 import visit from "@/views/withdrawal-application/modals/visit";
-import quiteTeam from "@/views/teamDetail/components/modals/quite-team";
+import quiteTeam from "@/views/teamDetail/components/modals/quite-team"
+import { courseType } from '@/constant/index'
 export default {
   name: "signupList",
   components: {
@@ -1060,16 +1039,7 @@ export default {
       },
       activeId: "",
       soundList: [],
-      orderForm: {
-        name: "",
-        totalAmount: "",
-        subject: "",
-        subjectFee: "",
-        axe: "",
-        axePrice: "",
-        others: "",
-        othersPrice: "",
-      },
+      orderForm: [],
       paymentStatus: false,
       paymentForm: {
         paymentExpireDate: null,
@@ -1184,7 +1154,6 @@ export default {
         this.ischeckCanReg = await (
           await checkCanReg({ musicGroupId: this.id })
         ).data;
-        console.log(this.ischeckCanReg);
       } catch (e) {
         console.log(e);
       }
@@ -1529,7 +1498,6 @@ export default {
     },
     // 修改专业
     resetSubject(row) {
-      console.log(row);
       this.activeId = row.studentId;
       this.maskForm.subject = row.actualSubjectId;
       this.subjectVisible = true;
@@ -1601,45 +1569,27 @@ export default {
         }
       });
     },
-    lookdetail(row) {
-      this.orderVisible = true;
-      this.activeId = row.studentId;
-      this.orderForm.name = row.studentName;
-      this.orderForm.subject = row.subjectName;
-      getStudentFeeDetail({
+    async lookdetail(row) {
+      await getStudentFeeDetail({
         musicGroupId: this.id,
         studentId: row.studentId,
       }).then((res) => {
         if (res.code == 200) {
-          if (res.data) {
-            this.orderForm.totalAmount = res.data.totalAmount;
-            // this.orderForm.subjectFee = res.data.courseFee;
-            let goodStr = "";
-            let goodPrice = 0;
-            let otherStr = "";
-            let othersPrice = 0;
-            for (let i in res.data.goods) {
-              if (res.data.goods[i].goodsType == "INSTRUMENT") {
-                goodStr += res.data.goods[i].goodsName + ",";
-                goodPrice += parseFloat(res.data.goods[i].musicalFee);
-                // this.orderForm.axe = res.data.goods[i].goodsName;
-                // this.orderForm.axePrice = res.data.goods[i].musicalFee;
-              } else if (res.data.goods[i].goodsType == "ACCESSORIES") {
-                otherStr += res.data.goods[i].goodsName + ",";
-                othersPrice += parseFloat(res.data.goods[i].musicalFee);
-                // this.orderForm.others = res.data.goods[i].goodsName;
-                // this.orderForm.othersPrice = res.data.goods[i].musicalFee;
-              } else if (res.data.goods[i].goodsType == "COURSE") {
-                this.orderForm.subjectFee = res.data.goods[i].musicalFee;
-              }
+          const paymentList = res.data || []
+          paymentList.forEach(item => {
+            if(item.type == 'MAINTENANCE') {
+              item.name = '乐器保养'
             }
-            this.orderForm.others = otherStr.substring(0, otherStr.length - 1);
-            this.orderForm.othersPrice = othersPrice;
-            this.orderForm.axe = goodStr.substring(0, goodStr.length - 1);
-            this.orderForm.axePrice = goodPrice;
-          }
+            if(courseType[item.type]) {
+              item.name = courseType[item.type]
+            }
+          })
+          this.orderForm = paymentList
         }
       });
+
+      this.activeId = row.studentId;
+      this.orderVisible = true;
     },
     saveIsEdit() {
       // 提交数据
@@ -1758,7 +1708,6 @@ export default {
         for (const item of res.data.rows) {
           if (item.id === row.id) {
             this.rowDetail = { ...item, userId: item.studentId };
-            // console.log(this.rowDetail)
             this.changeVoiceVisible = true;
           }
         }
@@ -1952,16 +1901,7 @@ export default {
     },
     orderVisible(val) {
       if (!val) {
-        this.orderForm = {
-          name: "",
-          totalAmount: "",
-          subject: "",
-          subjectFee: "",
-          axe: "",
-          axePrice: "",
-          others: "",
-          othersPrice: "",
-        };
+        this.orderForm = []
       }
     },
     qrcodeStatus(val) {
@@ -2171,4 +2111,7 @@ export default {
     line-height: 25px;
   }
 }
+/deep/.description-title {
+  margin-bottom: 0;
+}
 </style>