Browse Source

乐团接完

1
mo 3 years ago
parent
commit
212514e155

+ 47 - 21
src/views/categroyManager/modals/baseInfo.vue

@@ -206,26 +206,52 @@
           </el-tooltip>
         </el-form-item> -->
         </div>
-          <el-form-item label="活动售价" prop="marketPrice">
-            <el-input
-              style="width: 400px"
-              type="number"
-              v-model.trim="baseForm.marketPrice"
-              :disabled="isDisabled || status != 'DRAFT'"
-            >
-              <template slot="append">元</template>
-            </el-input>
-            <el-tooltip placement="top" popper-class="mTooltip">
-              <div slot="content">
-                该字段仅用于关联的营销活动中本方案的销售价格,后台、老师端为学员创建课程不受此价格影响
-              </div>
-              <i
-                class="el-icon-question micon el-tooltip"
-                style="font-size: 18px; color: #f56c6c"
-              ></i>
-            </el-tooltip>
-          </el-form-item>
-        <el-form-item label="活动原价" prop="originalPrice">
+        <el-form-item
+          label="活动售价"
+          prop="marketPrice"
+          :rules="[
+            {
+              required: true,
+              message: '请选输入活动售价',
+              trigger: 'blur',
+            },
+            {
+              pattern:
+                /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
+              message: '请输入正确的金额',
+            },
+          ]"
+        >
+          <el-input
+            style="width: 400px"
+            type="number"
+            v-model.trim="baseForm.marketPrice"
+            :disabled="isDisabled || status != 'DRAFT'"
+          >
+            <template slot="append">元</template>
+          </el-input>
+          <el-tooltip placement="top" popper-class="mTooltip">
+            <div slot="content">
+              该字段仅用于关联的营销活动中本方案的销售价格,后台、老师端为学员创建课程不受此价格影响
+            </div>
+            <i
+              class="el-icon-question micon el-tooltip"
+              style="font-size: 18px; color: #f56c6c"
+            ></i>
+          </el-tooltip>
+        </el-form-item>
+        <el-form-item
+          label="活动原价"
+          prop="originalPrice"
+          :rules="[
+            { required: true, message: '请选输入活动原价', trigger: 'blur' },
+            {
+              pattern:
+                /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,
+              message: '请输入正确的金额',
+            },
+          ]"
+        >
           <el-input
             style="width: 400px"
             type="number"
@@ -419,7 +445,7 @@ export default {
     },
     changeActivityChannel(val) {
       this.$emit("resetPayInfo");
-      this.$emit("resetBaseChannel",val);
+      this.$emit("resetBaseChannel", val);
     },
     submitFrom() {
       this.$refs.form.validate((isok) => {

+ 55 - 44
src/views/resetTeaming/components/payInfoDetail.vue

@@ -101,6 +101,10 @@
                   () => {
                     if (teamCourseDisabled) return;
                     teamCourse = !teamCourse;
+                    if (teamCourse && form.eclass.length < 0) {
+                      form.eclass = [];
+                      form.eclass.push({});
+                    }
                   }
                 "
               >
@@ -120,6 +124,10 @@
                   () => {
                     if (memberDisabled) return;
                     member = !member;
+                    if (member && form.memberList.length < 0) {
+                      form.memberList = [];
+                      form.memberList.push({});
+                    }
                   }
                 "
               >
@@ -140,6 +148,10 @@
                   () => {
                     if (leBaoDisabled) return;
                     leBao = !leBao;
+                    if (leBao && form.leBaoList.length < 0) {
+                      form.leBaoList = [];
+                      form.leBaoList.push({});
+                    }
                   }
                 "
               >
@@ -159,6 +171,10 @@
                   () => {
                     if (teamActiveDisabled) return;
                     teamActive = !teamActive;
+                    if (teamActive && form.activeList.length < 0) {
+                      form.activeList = [];
+                      form.activeList.push({});
+                    }
                   }
                 "
               >
@@ -278,6 +294,7 @@ export default {
       organId: null,
       leBaoInfo: null,
       isShowLeBao: false,
+      isSetCourseSettingsId: false,
       activeList: [{}],
       submitList: [],
       organizationCourseUnitPriceSettingsByType: null,
@@ -325,18 +342,18 @@ export default {
       await this.getMemberList(); // 获取会员(团练保信息)
       await this.getLeBao(); // 获取乐保
       await this.getActive(); // 获取活动
-
-      console.log(this.$route.query.calenderId,'calenderId');
       if (this.$route.query.calenderId) {
         // 说明是修改  查缴项目详情
         getMusicGroupPaymentCalenderDetail({
           id: this.$route.query.calenderId,
         }).then((res) => {
           if (res.code == 200) {
-            if (res.data.member) {
-              // 团练保
-              this.member = true;
-              this.$set(this.form, "memberList"[{ ...res.data.member }]);
+            if (res.data?.calender?.musicGroupOrganizationCourseSettingId) {
+              this.form.leixing = "1";
+              this.form.musicGroupOrganizationCourseSettingId =
+                res.data?.calender?.musicGroupOrganizationCourseSettingId;
+            } else {
+              this.form.leixing = "2";
             }
             this.$set(this.form, "paymentDate", [
               res.data?.calender?.startPaymentDate,
@@ -348,32 +365,35 @@ export default {
               "payUserType",
               res.data?.calender?.payUserType
             );
-            if (res.data?.calender?.musicGroupOrganizationCourseSettingId) {
-              this.leixing = "1";
-              this.$set(
-                this.form,
-                "musicGroupOrganizationCourseSettingId",
-                res.data?.calender?.musicGroupOrganizationCourseSettingId
-              );
-            } else {
-              this.leixing = "2";
+
+            if (res.data.member) {
+              // 团练保
+              this.member = true;
+              this.$set(this.form, "memberList", [{ ...res.data.member }]);
             }
             if (res.data.repair) {
               this.leBao = true;
-              this.$set(this.form, "leBaoList"[{ ...res.data.repair }]);
+              this.$set(this.form, "leBaoList", [{ ...res.data.repair }]);
             }
             if (res.data?.course?.length > 0) {
-              this.teamCourse = true;
-              this.$set(this.form, "eclass", res.data.course);
+              this.$nextTick(() => {
+                this.teamCourse = true;
+                this.isSetCourseSettingsId = true;
+                this.$set(this.form, "eclass", res.data?.course);
+              });
             }
             if (res.data?.activity?.length > 0) {
               this.teamActive = true;
-              this.$set(this.form, "activity", res.data.activity);
+
+              this.$set(this.form, "activeList", res.data.activity);
+              this.form.activeList.forEach(active=>{
+                active.vipGroupCategoryNames = active.categoryName
+              })
             }
           }
         });
       }
-        if (this.submitList.length > 0) {
+      if (this.submitList.length > 0) {
         this.$bus.$emit("showguide", this.submitList);
         return;
       }
@@ -601,55 +621,38 @@ export default {
       if (!val) {
         this.$set(this.form, "eclass", null);
       } else {
-        this.$set(this.form, "eclass", [{}]);
+        // this.$set(this.form, "eclass", [{}]);
       }
     },
     member(val) {
       if (!val) {
         this.$set(this.form, "memberList", null);
       } else {
-        this.$set(this.form, "memberList", [
-          {
-            periodEnum: "",
-            num: "",
-            actualAmount: "",
-            memberRankSettingId: "",
-            optionalFlag: null,
-          },
-        ]);
+        // this.$set(this.form, "memberList", [{}]);
       }
     },
     teamActive(val) {
       if (!val) {
         this.$set(this.form, "activeList", null);
       } else {
-        this.$set(this.form, "activeList", [{}]);
+        // this.$set(this.form, "activeList", [{}]);
       }
     },
     leBao(val) {
       if (!val) {
         this.$set(this.form, "leBaoList", null);
       } else {
-        this.$set(this.form, "leBaoList", [
-          {
-            num: 0,
-            actualAmount: "",
-            originalAmount: "",
-          },
-        ]);
+        // this.$set(this.form, "leBaoList", [{}]);
       }
     },
     async "form.musicGroupOrganizationCourseSettingId"(val) {
       // && !this.rowDetail
 
-      if (val && !this.isSetCourseSettingsId) {
+      if (val && !this.isSetCourseSettingsId&&!this.$route.query.calenderId) {
         try {
           const res = await queryByMusicGroupOrganizationCourseSettingsId({
             id: val,
           });
-          // this.form.eclass = res.data.filter((item) => {
-          //   return !item.isStudentOptional || this.paymentType !== undefined;
-          // }) || [{}];
           this.$set(this.form, "eclass", res.data);
           // this.syncAllMoney();
         } catch (error) {}
@@ -660,14 +663,22 @@ export default {
       this.cycles = [{}];
       this.collapse = [0];
       this.cycle = {};
-      this.$set(this.form, "musicGroupOrganizationCourseSettingId", undefined);
+      if (val != "1") {
+        this.$set(
+          this.form,
+          "musicGroupOrganizationCourseSettingId",
+          undefined
+        );
+      }
+
       // this.$set(this.cycle, "paymentAmount", undefined);
       // this.$set(this.other, "memo", null);
-      if (val === "1") {
+      if (val === "1" && !this.isSetCourseSettingsId) {
         this.$set(this.form, "eclass", []);
       } else if (val === "2") {
         this.$set(this.form, "eclass", [{}]);
       }
+      this.isSetCourseSettingsId = false;
     },
   },
   computed: {

+ 2 - 1
src/views/resetTeaming/modals/payMember.vue

@@ -202,8 +202,9 @@
               :precision="0"
               :min="0"
               @change="change"
-               :disabled="!form.memberList[scope.$index].memberRankSettingId"
+               :disabled="true"
               placeholder="请输入原价"
+
             />
           </el-form-item>
         </template>

+ 8 - 2
src/views/resetTeaming/modals/payTeamActive.vue

@@ -155,6 +155,7 @@
               :precision="0"
               :min="0"
               placeholder="请输入原价"
+              :disabled="true"
             />
           </el-form-item>
         </template>
@@ -193,9 +194,14 @@ export default {
     courseItemChange(row, index,id) {
       this.activeList.forEach(element => {
         if(id == element.id){
+          if(element.courseType == 'PRACTICE'){
+              this.$set(this.form.activeList[index],'vipGroupCategoryNames','网管课')
+          }else{
+              this.$set(this.form.activeList[index],'vipGroupCategoryNames',element.vipGroupCategoryNames)
+          }
           // this.$set(this.form.activeList[index],'name',element.name)
-           this.$set(this.form.activeList[index],'num',element.maxCourseNum)
-          this.$set(this.form.activeList[index],'vipGroupCategoryNames',element.vipGroupCategoryNames)
+          this.$set(this.form.activeList[index],'num',element.maxCourseNum)
+
           this.$set(this.form.activeList[index],'actualAmount',element.marketPrice)
           this.$set(this.form.activeList[index],'originalAmount',element.originalPrice)
         }

+ 1 - 4
src/views/resetTeaming/modals/payTeamCourse.vue

@@ -185,6 +185,7 @@
               :controls="false"
               :precision="0"
               :min="0"
+              :disabled="true"
               placeholder="请输入原价"
             />
           </el-form-item>
@@ -222,10 +223,6 @@ export default {
     };
   },
   mounted() {
-    console.log(
-      this.courseUnitPriceSettingsByType,
-      "courseUnitPriceSettingsByType"
-    );
   },
   methods: {
     courseItemChange(row, index) {},

+ 2 - 2
src/views/resetTeaming/modals/review-detail.vue

@@ -275,8 +275,8 @@
           scope.row.optionalFlag ? "是" : "否"
         }}</template>
       </el-table-column>
-      <el-table-column label="活动课程" width="100px">
-        <template slot-scope="scope">{{ scope.row.num }}</template>
+      <el-table-column label="活动课程"  prop="categoryName" width="100px">
+        <template slot-scope="scope">{{ scope.row.categoryName }}</template>
       </el-table-column>
 
       <el-table-column prop="num" label="数量" width="100px"> </el-table-column>