lex 1 year ago
parent
commit
9aacddbb3a

+ 32 - 35
src/views/businessManager/orderManager/salesList.vue

@@ -61,7 +61,7 @@
         </el-form-item>
         <el-form-item>
           <el-select
-          :disabled="!searchForm.organIdList.length>0"
+            :disabled="!searchForm.organIdList.length > 0"
             clearable
             filterable
             placeholder="请选择所属学校"
@@ -239,7 +239,7 @@
             align="center"
             width="100"
             prop="sellCost"
-            label="销售成本(元)"
+            label="采购价(元)"
           >
             <template slot-scope="scope">{{
               (scope.row.sellCost * scope.row.num) | moneyFormat
@@ -430,12 +430,10 @@ import pagination from "@/components/Pagination/index";
 import {
   getSellOrder,
   updateSellOrder,
-  refundSellOrder,
+  refundSellOrder
 } from "@/api/orderManager";
 import { queryByOrganId } from "@/api/systemManage";
-import {
-  getCooperation
-} from "@/api/buildTeam";
+import { getCooperation } from "@/api/buildTeam";
 import { paymentChannelStatus } from "@/utils/searchArray";
 import { Export } from "@/utils/downLoadFile";
 import dayjs from "dayjs";
@@ -458,7 +456,7 @@ export default {
         userName: "",
         orderDate: [],
         /** 发货日期 */
-        deliveryDate: [],
+        deliveryDate: []
       },
       tableList: [],
       organList: [],
@@ -468,31 +466,31 @@ export default {
         limit: 10, // 限制显示条数
         page: 1, // 当前页
         total: 0, // 总条数
-        page_size: [10, 20, 40, 50], // 选择限制显示条数
+        page_size: [10, 20, 40, 50] // 选择限制显示条数
       },
       backStatus: false,
       formLabelWidth: "150px",
       form: {
         id: null,
         sellCost: null,
-        eduTeacherId: null,
+        eduTeacherId: null
       },
       rules: {
-        sellCost: [{ required: true, message: "请输入金额", trigger: "input" }],
+        sellCost: [{ required: true, message: "请输入金额", trigger: "input" }]
       },
       refundForm: {
-        money: null,
+        money: null
       },
       refundRules: {
-        money: [{ required: true, message: "请输入退费金额", trigger: "blur" }],
+        money: [{ required: true, message: "请输入退费金额", trigger: "blur" }]
       },
       cooperations: [],
-      restaurants: [],
+      restaurants: []
     };
   },
   mounted() {
     this.$store.dispatch("setBranchs");
-    getCooperation({ rows: 1000 }).then((res) => {
+    getCooperation({ rows: 1000 }).then(res => {
       if (res.code == 200) {
         this.cooperations = res.data.rows;
       }
@@ -516,9 +514,9 @@ export default {
     },
     onTeachingSubmit(formName, status) {
       // 添加数据
-      this.$refs[formName].validate((valid) => {
+      this.$refs[formName].validate(valid => {
         if (valid) {
-          updateSellOrder(this.form).then((res) => {
+          updateSellOrder(this.form).then(res => {
             if (res.code == 200) {
               this.$message.success("操作成功");
               this.backStatus = false;
@@ -539,13 +537,13 @@ export default {
         page: this.pageInfo.page,
         rows: this.pageInfo.limit,
         ...getTimes(orderDate, ["startTime", "endTime"]),
-        ...getTimes(deliveryDate, ["deliveryStartTime", "deliveryEndTime"]),
+        ...getTimes(deliveryDate, ["deliveryStartTime", "deliveryEndTime"])
       };
 
       getSellOrder({
         ...params,
-        organIdList: [...this.searchForm.organIdList].join(),
-      }).then((res) => {
+        organIdList: [...this.searchForm.organIdList].join()
+      }).then(res => {
         let result = res.data;
         if (res.code == 200) {
           this.tableList = result.rows;
@@ -573,8 +571,8 @@ export default {
         const json = JSON.parse(this.detail.sellCost2);
         restaurants = [
           { value: String(json.sellCost || "") },
-          { value: String(json.SellCost2 || "") },
-        ].filter((item) => !!item);
+          { value: String(json.SellCost2 || "") }
+        ].filter(item => !!item);
       } catch (error) {}
       // this.createFilter(queryString)
       // let results = queryString ? restaurants.filter((restaurant) => {
@@ -589,20 +587,20 @@ export default {
     },
     refund(data) {
       refundSellOrder(data)
-        .then((res) => {
+        .then(res => {
           this.getList();
           this.$message.success("退费成功");
         })
-        .catch((res) => {
+        .catch(res => {
           if (res.code === 100) {
             this.$confirm(res.msg, "提示", {
               confirmButtonText: "确定",
               cancelButtonText: "取消",
-              type: "warning",
+              type: "warning"
             }).then(() => {
               this.refund({
                 ...data,
-                reTry: true,
+                reTry: true
               });
             });
           } else {
@@ -622,7 +620,7 @@ export default {
       this.form = {
         id: row.id,
         sellCost: String(row.sellCost),
-        eduTeacherId: row.eduTeacherId ? row.eduTeacherId : null,
+        eduTeacherId: row.eduTeacherId ? row.eduTeacherId : null
       };
       // applyRefundAudit()
     },
@@ -633,7 +631,7 @@ export default {
         page: this.pageInfo.page,
         rows: this.pageInfo.limit,
         ...getTimes(orderDate, ["startTime", "endTime"]),
-        ...getTimes(deliveryDate, ["deliveryStartTime", "deliveryEndTime"]),
+        ...getTimes(deliveryDate, ["deliveryStartTime", "deliveryEndTime"])
       };
       Export(
         this,
@@ -642,28 +640,27 @@ export default {
           fileName: `销售列表导出.xls`,
           params: cleanDeep({
             ...params,
-            organIdList: [...this.searchForm.organIdList].join(),
-          }),
+            organIdList: [...this.searchForm.organIdList].join()
+          })
         },
         "是否确认导出报表?"
       );
     },
-   async changeOrgan(value){
-       if (!value) {
+    async changeOrgan(value) {
+      if (!value) {
         this.cooperations = [];
         this.searchForm.cooperationOrganId = null;
         return;
       }
       // 合作单位
-      await queryByOrganId({ organId: value.join(',') }).then((res) => {
+      await queryByOrganId({ organId: value.join(",") }).then(res => {
         if (res.code == 200) {
           this.cooperations = res.data;
           this.searchForm.cooperationOrganId = null;
         }
       });
     }
-  },
+  }
 };
 </script>
-<style lang="scss">
-</style>
+<style lang="scss"></style>

+ 26 - 1
src/views/businessManager/shopManager/model/combinationProducts.vue

@@ -104,7 +104,7 @@
           placeholder="请选择品牌"
         >
           <el-option
-            v-for="(item, index) in goodsBrand"
+            v-for="(item, index) in goodsCategoryList"
             :key="index"
             :label="item.label"
             :value="item.value"
@@ -534,6 +534,7 @@ export default {
   data() {
     return {
       formLabelWidth: "160px",
+      goodsCategoryList: [],
       form: {
         sn: null,
         brand: null,
@@ -765,6 +766,8 @@ export default {
             goodsId: item.mallGoodsId,
             skuStockId: item.sku,
             skuCode: item.skuCode,
+            brandId: item.brandId,
+            brandName: item.brandName,
             price: item.price,
             publishStatus: item.goodsStatus,
             productSn: item.productSn,
@@ -804,6 +807,8 @@ export default {
         if (row.organIdList) {
           form.organIdList = row.organIdList.split(",");
         }
+
+        this.getBrandCatatory();
       } catch (e) {
         //
         console.log(e, "1212");
@@ -828,6 +833,21 @@ export default {
       }
       return ids;
     },
+    getBrandCatatory() {
+      const goodsList = this.form.goodsList;
+      const tempList = [];
+      goodsList.forEach(item => {
+        const index = tempList.findIndex(temp => temp.value == item.brandId);
+        if (index === -1) {
+          tempList.push({
+            label: item.brandName,
+            value: item.brandId
+          });
+        }
+      });
+
+      this.goodsCategoryList = tempList;
+    },
     onShopSubmit(formName) {
       if (this.form.goodsList.length <= 0) {
         this.$message.error("请至少添加一个子商品");
@@ -926,6 +946,9 @@ export default {
           if (index !== -1) {
             this.form.goodsList.splice(index, 1);
           }
+
+          this.getBrandCatatory();
+          this.form.brand = null;
         })
         .catch(() => {});
     },
@@ -968,6 +991,8 @@ export default {
         }
       });
       this.form.goodsList.push(...goodsList);
+
+      this.getBrandCatatory();
     }
   }
 };

+ 14 - 11
src/views/resetTeaming/goodsModal/payGoodsInfo.vue

@@ -95,6 +95,7 @@
 
 <script>
 import {
+  categoryListTree,
   api_queryGoodsCategoryList,
   api_queryGoodsBrandList
 } from "@/api/businessManager";
@@ -139,21 +140,23 @@ export default {
     /** 商品分类 */
     async getCategory() {
       let params = {
-        // delFlag: 0,
+        delFlag: 0,
         rows: 9999
       };
       try {
-        const { data } = await api_queryGoodsCategoryList(params);
-        console.log(data, "data");
-        const result = data || [];
-        let tempArray = [];
-        result.forEach(row => {
-          tempArray.push({
-            label: row.name,
-            value: row.id
-          });
+        categoryListTree(params).then(res => {
+          let result = res.data;
+          if (res.code == 200) {
+            let tempArray = [];
+            result.rows.forEach(row => {
+              tempArray.push({
+                label: row.name,
+                value: row.id
+              });
+            });
+            this.categoryList = tempArray;
+          }
         });
-        this.categoryList = tempArray;
       } catch {}
     },
     /** 商品品牌 */

+ 2 - 0
src/views/resetTeaming/index.vue

@@ -147,6 +147,7 @@
           " -->
           <forecastNameList
             v-if="activeIndex == '9'"
+            @changeActive="handleClick"
             :isedit="team_status == 'PRE_APPLY'"
           />
         </el-tab-pane>
@@ -410,6 +411,7 @@ export default {
       }
     },
     handleClick(val) {
+      console.log(val, "val");
       this.teamid = this.$route.query.id;
       // if (val.name != 1 && this.$refs.teamBaseInfo) {
       //   await this.$refs.teamBaseInfo.setStore();

+ 4 - 0
src/views/resetTeaming/modals/review-detail.vue

@@ -429,6 +429,10 @@
         prop="responsiblePersonName"
         label="责任人"
       >
+        <template slot-scope="scope">
+                {{ scope.row.responsiblePersonName }}
+                ({{ scope.row.responsiblePersonPhone }})
+            </template>
       </el-table-column>
       <el-table-column prop="refundAmount" label="回款金额"> </el-table-column>
       <el-table-column prop="refundDate" label="回款状态">

+ 77 - 46
src/views/teamBuild/forecastName.vue

@@ -9,7 +9,10 @@
         </p> -->
 
     <div class="btnList">
-      <auth :auths="['musicGroup/sendParentMeetingNotice']" v-if="isedit || $route.query.team_status=='DRAFT'">
+      <auth
+        :auths="['musicGroup/sendParentMeetingNotice']"
+        v-if="isedit || $route.query.team_status == 'DRAFT'"
+      >
         <el-button type="primary" @click="extendPaymentStatus = true"
           >预报名家长会通知</el-button
         >
@@ -58,8 +61,8 @@
           <el-input
             v-model.trim="searchForm.name"
             clearable
-                @keyup.enter.native="
-              (e) => {
+            @keyup.enter.native="
+              e => {
                 e.target.blur();
                 $refs.searchForm.save();
                 search();
@@ -355,7 +358,7 @@
     <el-dialog
       title="新增回访"
       width="760px"
-       v-if="visitVisible"
+      v-if="visitVisible"
       :close-on-click-modal="false"
       :visible.sync="visitVisible"
     >
@@ -396,6 +399,7 @@
 </template>
 
 <script>
+import { getMusicGroupAddr } from "../teamDetail/api";
 import pagination from "@/components/Pagination/index";
 import qrCode from "@/components/QrCode/index";
 import { permission } from "@/utils/directivePage";
@@ -403,16 +407,22 @@ import { vaildStudentUrl, vaildTeachingUrl } from "@/utils/validate";
 import { Export } from "@/utils/downLoadFile";
 import visitModel from "@/views/withdrawal-application/modals/visit";
 import intentionModel from "./modals/intention";
-import parentsMeeting from './modals/parentsMeeting'
+import parentsMeeting from "./modals/parentsMeeting";
 import {
   queryPreApplyList,
   finishPreApply,
   sendParentMeetingNotice,
-  getSysMessageConfig,
+  getSysMessageConfig
 } from "./api";
 export default {
   name: "forecastName",
-  components: { pagination, qrCode, visitModel, intentionModel,parentsMeeting },
+  components: {
+    pagination,
+    qrCode,
+    visitModel,
+    intentionModel,
+    parentsMeeting
+  },
   props: ["isedit"],
   data() {
     const query = this.$route.query;
@@ -432,7 +442,7 @@ export default {
         selectionSubjectId: null,
         isAllowAdjust: null,
         cloudTeacherMethod: null,
-        kitPurchaseMethod: null,
+        kitPurchaseMethod: null
       },
       tableList: [],
       pageInfo: {
@@ -440,7 +450,7 @@ export default {
         limit: 10, // 限制显示条数
         page: 1, // 当前页
         total: 0, // 总条数
-        page_size: [10, 20, 40, 50], // 选择限制显示条数
+        page_size: [10, 20, 40, 50] // 选择限制显示条数
       },
       visitVisible: false,
       subjectVisible: false,
@@ -448,33 +458,32 @@ export default {
       extendPaymentStatus: false,
       extendForm: {
         meetingDate: null,
-        address: null,
+        address: null
       },
       extendRule: {
         meetingDate: [
-          { required: true, message: "请选择家长会时间", trigger: "change" },
+          { required: true, message: "请选择家长会时间", trigger: "change" }
         ],
         address: [
-          { required: true, message: "请输入家长会地址", trigger: "blur" },
-        ],
+          { required: true, message: "请输入家长会地址", trigger: "blur" }
+        ]
       },
       preLookVisible: false,
       sysMsg: "",
       subjectList: [],
-      tenantId:null
-
+      tenantId: null
     };
   },
   async mounted() {
-    this.tenantId=   this.$helpers.tenantId
+    this.tenantId = this.$helpers.tenantId;
     await this.$store.dispatch("setSubjects");
     // 获取短信推送模板
     this.subjectList = [...this.selects.subjects];
     this.subjectList.push({ id: -1, name: "无" });
     const rus = await getSysMessageConfig({
-      type: "STUDENT_SMS_IM_MUSIC_GROUP_PARENT_MEETING_NOTICE",
+      type: "STUDENT_SMS_IM_MUSIC_GROUP_PARENT_MEETING_NOTICE"
     });
-    this.sysMsg = rus.data?.content||'';
+    this.sysMsg = rus.data?.content || "";
     this.getList();
   },
   methods: {
@@ -499,9 +508,9 @@ export default {
           url: "/api-web/studentRegistration/preRegisterExport",
           params: {
             ...params,
-            musicGroupId: this.musicGroupId,
+            musicGroupId: this.musicGroupId
           },
-          fileName: "预报名列表.xls",
+          fileName: "预报名列表.xls"
         },
         "是否确认导出报表?"
       );
@@ -512,7 +521,7 @@ export default {
           ...this.searchForm,
           musicGroupId: this.musicGroupId,
           page: this.pageInfo.page,
-          rows: this.pageInfo.limit,
+          rows: this.pageInfo.limit
         });
         this.tableList = result.data.rows;
         this.pageInfo.total = result.data.total;
@@ -520,20 +529,36 @@ export default {
     },
     async onPaymentGroup(type) {
       try {
-        this.$confirm("您是否确定开启乐团缴费?", "提示", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning",
-        }).then(async () => {
-          const result = await finishPreApply({
-            isCheckStudentNum: type == 1 ? false : true,
-            musicGroupId: this.musicGroupId,
+        const { data } = await getMusicGroupAddr({
+          musicGroupId: this.musicGroupId,
+          page: 1,
+          rows: 10
+        });
+        console.log(data, "data");
+        if (Array.isArray(data.rows) && data.rows.length > 0) {
+          this.$confirm("您是否确定开启乐团缴费?", "提示", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          }).then(async () => {
+            const result = await finishPreApply({
+              isCheckStudentNum: type == 1 ? false : true,
+              musicGroupId: this.musicGroupId
+            });
+            this.$store.dispatch("delVisitedViews", this.$route);
+            this.$router.push({
+              path: "/teamList"
+            });
           });
-          this.$store.dispatch("delVisitedViews", this.$route);
-          this.$router.push({
-            path: "/teamList",
+        } else {
+          this.$confirm("请先设置开团商品收货地址?", "提示", {
+            confirmButtonText: "去设置",
+            cancelButtonText: "取消",
+            type: "warning"
+          }).then(async () => {
+            this.$listeners.changeActive("10");
           });
-        });
+        }
       } catch (error) {}
     },
     addVisited(rows) {
@@ -548,32 +573,32 @@ export default {
         visitTime: "",
         visitType: "",
         feedback: "",
-        realName: rows.userName,
+        realName: rows.userName
       };
       // this.visitDetail = rows
     },
     onClose(formName) {
-        this.extendForm= {
+      this.extendForm = {
         meetingDate: null,
-        address: null,
-      }
-    //  this.$refs[formName].$refs[formName].resetFields();
+        address: null
+      };
+      //  this.$refs[formName].$refs[formName].resetFields();
     },
     onExtendPayment(formName) {
       // console.log(formName)
       // console.log(this.$refs)
       // return
-      this.$refs[formName].$refs[formName].validate(async (valid) => {
+      this.$refs[formName].$refs[formName].validate(async valid => {
         if (valid) {
           try {
             await this.$confirm("您是否确定发送家长会通知?", "提示", {
               confirmButtonText: "确定",
               cancelButtonText: "取消",
-              type: "warning",
+              type: "warning"
             });
             await sendParentMeetingNotice({
               ...this.extendForm,
-              musicGroupId: this.musicGroupId,
+              musicGroupId: this.musicGroupId
             });
             this.$message.success("家长会通知已发送");
             this.extendPaymentStatus = false;
@@ -591,12 +616,12 @@ export default {
             return time.getTime() + 86400000 < Date.now();
             //开始时间不选时,结束时间最大值小于等于当天
           }
-        },
+        }
       };
     },
     preLook(val) {
       this.preLookVisible = true;
-    },
+    }
   },
   computed: {
     sysMsgStr() {
@@ -612,10 +637,16 @@ export default {
         return ``;
       }
     },
-    detailUrl(){
-      return  vaildTeachingUrl() + "/#/preApplySubject?musicGroupId=" + this.$route.query.id+'&tenantId='+this.tenantId
+    detailUrl() {
+      return (
+        vaildTeachingUrl() +
+        "/#/preApplySubject?musicGroupId=" +
+        this.$route.query.id +
+        "&tenantId=" +
+        this.tenantId
+      );
     }
-  },
+  }
 };
 </script>
 

+ 31 - 12
src/views/teamBuild/forecastNameList.vue

@@ -1,30 +1,49 @@
 <template>
   <div>
-    <el-tabs v-model="activeName" >
-      <el-tab-pane  label="启蒙课问卷" name="first"  v-if="permission('/initiationList')"><initiationList v-if="activeName=='first'" :isedit="team_status == 'PRE_APPLY'"/></el-tab-pane>
-      <el-tab-pane label="预报名信息" name="second"  v-if="permission('/teamForecastName')"><forecastName v-if="activeName=='second'" :isedit="team_status == 'PRE_APPLY'"/></el-tab-pane>
+    <el-tabs v-model="activeName">
+      <el-tab-pane
+        label="启蒙课问卷"
+        name="first"
+        v-if="permission('/initiationList')"
+        ><initiationList
+          v-if="activeName == 'first'"
+          :isedit="team_status == 'PRE_APPLY'"
+      /></el-tab-pane>
+      <el-tab-pane
+        label="预报名信息"
+        name="second"
+        v-if="permission('/teamForecastName')"
+        ><forecastName
+          v-if="activeName == 'second'"
+          @changeActive="handleClick"
+          :isedit="team_status == 'PRE_APPLY'"
+      /></el-tab-pane>
     </el-tabs>
   </div>
 </template>
 <script>
-import forecastName from './forecastName'
-import initiationList from './initiationList'
+import forecastName from "./forecastName";
+import initiationList from "./initiationList";
 import { permission } from "@/utils/directivePage";
 export default {
-  components:{forecastName,initiationList},
+  components: { forecastName, initiationList },
   data() {
     return {
-      activeName:'first',
-      team_status :this.$route.query.team_status
+      activeName: "first",
+      team_status: this.$route.query.team_status
     };
   },
   mounted() {},
   methods: {
-        permission(str) {
+    permission(str) {
       return permission(str);
     },
-  },
+    handleClick(val) {
+      this.$emit("changeActive", { name: val });
+
+      sessionStorage.setItem("teamDetailedListEidtTeamAddr", "eidtTeamAddr");
+    }
+  }
 };
 </script>
-<style lang="scss" scoped>
-</style>
+<style lang="scss" scoped></style>

+ 7 - 0
src/views/teamDetail/teamDetailedList.vue

@@ -41,6 +41,13 @@ export default {
     eidtTeamAddr
   },
   mounted() {
+    // 显示默认
+    const tabName = sessionStorage.getItem("teamDetailedListEidtTeamAddr");
+    if (["waitTeamList", "endTeamList", "eidtTeamAddr"].includes(tabName)) {
+      this.activeName = tabName;
+      sessionStorage.removeItem("teamDetailedListEidtTeamAddr");
+    }
+
     this.$bus.$on("changeAddrTab", obj => {
       this.activeName = obj;
     });

+ 67 - 54
src/views/teamDetail/teamListComponent/eidtTeamAddr.vue

@@ -2,14 +2,26 @@
   <div class="">
     <div class="">
       <auth auths="musicGroupShippingAddress/add">
-        <el-button type="primary" class="addBtn" @click="addAddr">新建地址</el-button></auth>
+        <el-button
+          type="primary"
+          class="addBtn"
+          @click="addAddr"
+          :disabled="tableList.length >= 1"
+          >新建地址</el-button
+        ></auth
+      >
 
       <div class="tableWrap">
         <el-table
           :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
           :data="tableList"
         >
-          <el-table-column label="地址编号" prop="id" width="100px"  align="center">
+          <el-table-column
+            label="地址编号"
+            prop="id"
+            width="100px"
+            align="center"
+          >
           </el-table-column>
           <el-table-column label="省" align="left" prop="regionProvince">
           </el-table-column>
@@ -19,24 +31,18 @@
           </el-table-column>
           <el-table-column label="详细地址" align="left" prop="detailAddress">
           </el-table-column>
-          <el-table-column label="操作" prop="sn" width="100px"  align="center">
+          <el-table-column label="操作" prop="sn" width="100px" align="center">
             <template slot-scope="scope">
               <auth auths="musicGroupShippingAddress/update">
-              <el-button
-                @click="resetAddr(scope.row)"
-
-                type="text"
-                >修改</el-button
-              >
-            </auth>
-            <auth auths="musicGroupShippingAddress/delete">
-              <el-button
-                @click="deleteAddr(scope.row)"
-
-                type="text"
-                >删除</el-button
-              >
-            </auth>
+                <el-button @click="resetAddr(scope.row)" type="text"
+                  >修改</el-button
+                >
+              </auth>
+              <!-- <auth auths="musicGroupShippingAddress/delete">
+                <el-button @click="deleteAddr(scope.row)" type="text"
+                  >删除</el-button
+                >
+              </auth> -->
             </template>
           </el-table-column>
         </el-table>
@@ -50,25 +56,31 @@
         />
       </div>
     </div>
-    <el-dialog :visible.sync="addrVisiable" :title="activeRow&&activeRow.id?'修改地址':'新增地址'" width="500px">
-      <eidtAddr v-if="addrVisiable" :form="activeRow" ref='eidtAddr' @getList='getList'/>
+    <el-dialog
+      :visible.sync="addrVisiable"
+      :title="activeRow && activeRow.id ? '修改地址' : '新增地址'"
+      width="500px"
+    >
+      <eidtAddr
+        v-if="addrVisiable"
+        :form="activeRow"
+        ref="eidtAddr"
+        @getList="getList"
+      />
       <div slot="footer" class="dialog-footer">
         <el-button @click="addrVisiable = false">取 消</el-button>
-        <el-button type="primary" @click="submitAddr"
-          >确 定</el-button
-        >
+        <el-button type="primary" @click="submitAddr">确 定</el-button>
       </div>
     </el-dialog>
   </div>
 </template>
 <script>
-
-import { getMusicGroupAddr,deleteMusicGroupAddr} from '../api'
+import { getMusicGroupAddr, deleteMusicGroupAddr } from "../api";
 import qs from "qs";
-import eidtAddr from './modals/eidtAddr.vue'
+import eidtAddr from "./modals/eidtAddr.vue";
 import pagination from "@/components/Pagination/index";
 export default {
-  components:{pagination,eidtAddr},
+  components: { pagination, eidtAddr },
   data() {
     return {
       teamid: "",
@@ -77,16 +89,16 @@ export default {
       Frules: null,
       team_status: "",
       musicalInstrumentsProvideStatus: 0, // 是否确认发货  1已发货
-      hasVerifyMusicalList:true,
+      hasVerifyMusicalList: true,
       rules: {
         // 分页规则
         limit: 10, // 限制显示条数
         page: 1, // 当前页
         total: 0, // 总条数
-        page_size: [10, 20, 40, 50], // 选择限制显示条数
+        page_size: [10, 20, 40, 50] // 选择限制显示条数
       },
-      activeRow:null,
-      addrVisiable:false
+      activeRow: null,
+      addrVisiable: false
     };
   },
   mounted() {
@@ -95,25 +107,26 @@ export default {
   activated() {
     // this.init();
   },
-  computed: {
-
-  },
+  computed: {},
   methods: {
     init() {
       this.team_status = this.$route.query.team_status;
       this.teamid = this.$route.query.id;
-      this.getList()
-
+      this.getList();
     },
-    getList(){
-      this.addrVisiable=false;
+    getList() {
+      this.addrVisiable = false;
       if (this.teamid) {
         // getTeamList({ musicGroupId: this.teamid }).then(res=>{
         //   if(res.code == 200){
         //     this.hasVerifyMusicalList = res?.data?.rows[0]?.hasVerifyMusicalList
         //   }
         // })
-        getMusicGroupAddr({ musicGroupId: this.teamid,page:this.rules.page,rows:this.rules.limit }).then((res) => {
+        getMusicGroupAddr({
+          musicGroupId: this.teamid,
+          page: this.rules.page,
+          rows: this.rules.limit
+        }).then(res => {
           if (res.code == 200) {
             this.tableList = res.data.rows ? res.data.rows : [];
             this.rules.total = res.data.total;
@@ -126,30 +139,30 @@ export default {
       this.$store.dispatch("delVisitedViews", this.$route);
       this.$router.push({ path: "/teamList" });
     },
-    resetAddr(row){
+    resetAddr(row) {
       this.activeRow = row;
       this.addrVisiable = true;
     },
-   async deleteAddr(row){
-    try{
-      await this.$confirm("是否确认删除此收货地址?", "提示", {
-          type: "warning",
+    async deleteAddr(row) {
+      try {
+        await this.$confirm("是否确认删除此收货地址?", "提示", {
+          type: "warning"
         });
-      const res = await deleteMusicGroupAddr({id:row.id})
-      this.$message.success('删除成功')
-      this.getList()
-    }catch(e){
-      console.log(e)
-    }
+        const res = await deleteMusicGroupAddr({ id: row.id });
+        this.$message.success("删除成功");
+        this.getList();
+      } catch (e) {
+        console.log(e);
+      }
     },
-    addAddr(){
+    addAddr() {
       this.activeRow = null;
       this.addrVisiable = true;
     },
-    submitAddr(){
-      this.$refs.eidtAddr.submit()
+    submitAddr() {
+      this.$refs.eidtAddr.submit();
     }
-  },
+  }
 };
 </script>
 

+ 25 - 25
src/views/teamDetail/teamListComponent/modals/eidtAddr.vue

@@ -5,7 +5,7 @@
         label="联系人"
         prop="consigneeName"
         :rules="[
-          { required: true, message: '请输入联系人姓名', trigger: 'blur' },
+          { required: true, message: '请输入联系人姓名', trigger: 'blur' }
         ]"
       >
         <el-input
@@ -21,6 +21,7 @@
         <el-input
           v-model.trim="forms.mobile"
           placeholder="请输入手机号"
+          :maxlength="11"
         ></el-input>
       </el-form-item>
       <el-form-item label="所在城市" required>
@@ -29,7 +30,7 @@
           <el-form-item
             prop="regionProvinceId"
             :rules="[
-              { required: true, message: '请选择省', trigger: 'change' },
+              { required: true, message: '请选择省', trigger: 'change' }
             ]"
             style="margin-right: 0"
           >
@@ -52,7 +53,7 @@
           <el-form-item
             prop="regionCityId"
             :rules="[
-              { required: true, message: '请选择市', trigger: 'change' },
+              { required: true, message: '请选择市', trigger: 'change' }
             ]"
             style="margin-right: 0"
           >
@@ -76,7 +77,7 @@
           <el-form-item
             prop="regionCountyId"
             :rules="[
-              { required: true, message: '请选择地区', trigger: 'change' },
+              { required: true, message: '请选择地区', trigger: 'change' }
             ]"
             style="margin-right: 0"
           >
@@ -102,7 +103,7 @@
         label="详细地址"
         prop="detailAddress"
         :rules="[
-          { required: true, message: '请输入详细地址', trigger: 'blur' },
+          { required: true, message: '请输入详细地址', trigger: 'blur' }
         ]"
       >
         <el-input
@@ -117,7 +118,7 @@
 </template>
 <script>
 import { areaQueryChild, getParentArea } from "@/api/specialSetting";
-import { addMusicGroupAddr,resetMusicGroupAddr } from "../../api";
+import { addMusicGroupAddr, resetMusicGroupAddr } from "../../api";
 export default {
   props: ["form"],
   data() {
@@ -127,27 +128,26 @@ export default {
         mobile: "",
         detailAddress: "",
         musicGroupId: "",
-        regionProvinceId: "",
-        regionCityId: "",
-        regionCountyId: "",
-
+        regionProvinceId: null,
+        regionCityId: null,
+        regionCountyId: null
       },
       provinceList: [],
       cityList: [],
-      countyList: [],
+      countyList: []
     };
   },
   async mounted() {
-    if(this.form){
-      this.forms = {...this.form}
+    if (this.form) {
+      this.forms = { ...this.form };
     }
     await this.getAreaList();
     if (this.forms.regionCityId) {
-      await getParentArea({ id: this.forms.regionCityId }).then(async (res) => {
+      await getParentArea({ id: this.forms.regionCityId }).then(async res => {
         if (res.code == 200 && res.data) {
           await this.getAreaList(res.data.id, "regionCityId", () => {
-            this.$set(this.forms, "regionProvinceId", res.data.id+'');
-            this.$set(this.forms, "regionCityId", this.forms.regionCityId );
+            this.$set(this.forms, "regionProvinceId", res.data.id + "");
+            this.$set(this.forms, "regionCityId", this.forms.regionCityId);
             this.$set(this.forms, "regionCountyId", this.forms.regionCountyId);
           });
         }
@@ -165,21 +165,21 @@ export default {
     onChangeProvince(val) {
       this.forms.regionCityId = null;
       this.forms.regionCountyId = null;
-      this.getAreaList(val+'', "");
+      this.getAreaList(val + "", "");
     },
     onChangeCity(val) {
       this.forms.regionCountyId = null;
-      this.getAreaList(val+'', "regionCountyId");
+      this.getAreaList(val + "", "regionCountyId");
     },
     getAreaList(parentId, type, callback) {
       parentId = parentId ? parentId : 0;
-      areaQueryChild({ parentId: parentId }).then((res) => {
+      areaQueryChild({ parentId: parentId }).then(res => {
         if (res.code == 200 && res.data) {
           let tempData = [];
-          res.data.forEach((item) => {
+          res.data.forEach(item => {
             tempData.push({
               label: item.name,
-              value: item.id+'',
+              value: item.id + ""
             });
           });
           if (parentId) {
@@ -199,9 +199,9 @@ export default {
       });
     },
     async submit() {
-      this.$refs.form.validate(async (flag) => {
+      this.$refs.form.validate(async flag => {
         if (flag) {
-          this.forms.musicGroupId = this.$route.query.id
+          this.forms.musicGroupId = this.$route.query.id;
           if (this.forms.id) {
             // 修改  resetMusicGroupAddr
             try {
@@ -223,8 +223,8 @@ export default {
           }
         }
       });
-    },
-  },
+    }
+  }
 };
 </script>