Explorar o código

增加省市区

1
mo %!s(int64=2) %!d(string=hai) anos
pai
achega
301cd61b0b

+ 9 - 0
src/views/teamDetail/api.js

@@ -95,4 +95,13 @@ export const getConvertDeatil = data => request2({
   method: 'get'
 })
 
+
+export const getMusicGroupAddr = data => request2({
+  url: '/api-web/musicGroupShippingAddress/queryPage',
+  data,
+  params: data,
+  method: 'get',
+  requestType: 'form'
+})
+
 // courseScheduleConvert/queryCourse

+ 118 - 17
src/views/teamDetail/teamListComponent/eidtTeamAddr.vue

@@ -1,28 +1,129 @@
 <template>
-  <div class="eidtAddrWrap">
-    <eidtAddr />
-    <el-button class="saveBtn" type="primary">保 存</el-button>
+  <div class="">
+    <div class="">
+      <el-button type="primary" @click="addAddr">新建地址</el-button>
+      <div class="tableWrap">
+        <el-table
+          :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+          :data="tableList"
+        >
+          <el-table-column label="地址编号" prop="sn" width="100px"  align="center">
+          </el-table-column>
+          <el-table-column label="详细地址" align="left" prop="name">
+          </el-table-column>
+          <el-table-column label="操作" prop="sn" width="100px"  align="center">
+            <template slot-scope="scope">
+              <el-button
+                @click="resetAddr(scope.row)"
+
+                type="text"
+                >修改</el-button
+              >
+              <el-button
+                @click="deleteAddr(scope.row)"
+
+                type="text"
+                >删除</el-button
+              >
+            </template>
+          </el-table-column>
+        </el-table>
+        <pagination
+          sync
+          :total.sync="rules.total"
+          :page.sync="rules.page"
+          :limit.sync="rules.limit"
+          :page-sizes="rules.page_size"
+          @pagination="getList"
+        />
+      </div>
+    </div>
+    <el-dialog :visible.sync="addrVisiable" :title="activeRow&&activeRow.id?'修改地址':'新增地址'" width="400px">
+      <eidtAddr v-if="addrVisiable" :form="activeRow"/>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="addrVisiable = false">取 消</el-button>
+        <el-button type="primary" @click="submitAddr"
+          >确 定</el-button
+        >
+      </div>
+    </el-dialog>
   </div>
 </template>
 <script>
-import eidtAddr from './modals/eidtAddr'
+
+import { getMusicGroupAddr} from '../api'
+import qs from "qs";
+import eidtAddr from './modals/eidtAddr.vue'
+import pagination from "@/components/Pagination/index";
 export default {
-  components:{
-    eidtAddr
-  },
-  data(){
+  components:{pagination,eidtAddr},
+  data() {
     return {
+      teamid: "",
+      tableList: [],
+      Fsearch: null,
+      Frules: null,
+      team_status: "",
+      musicalInstrumentsProvideStatus: 0, // 是否确认发货  1已发货
+      hasVerifyMusicalList:true,
+      rules: {
+        // 分页规则
+        limit: 10, // 限制显示条数
+        page: 1, // 当前页
+        total: 0, // 总条数
+        page_size: [10, 20, 40, 50], // 选择限制显示条数
+      },
+      activeRow:null,
+      addrVisiable:false
+    };
+  },
+  mounted() {
+    this.init();
+  },
+  activated() {
+    // this.init();
+  },
+  computed: {
 
-    }
-  }
-}
+  },
+  methods: {
+    init() {
+      this.team_status = this.$route.query.team_status;
+      this.teamid = this.$route.query.id;
+      this.getList()
+
+    },
+    getList(){
+      console.log('getList')
+      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) => {
+          if (res.code == 200) {
+            this.tableList = res.data.rows ? res.data.rows : [];
+            this.rules.total = res.data.total;
+          }
+        });
+        // this.getMusicInfo()
+      }
+    },
+    onCancel() {
+      this.$store.dispatch("delVisitedViews", this.$route);
+      this.$router.push({ path: "/teamList" });
+    },
+    resetAddr(row){},
+    deleteAddr(row){},
+    addAddr(){
+      this.activeRow = null;
+      this.addrVisiable = true;
+    },
+    submitAddr(){}
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-  .eidtAddrWrap {
-    width: 350px;
-  }
-  .saveBtn {
-    float: right;
-  }
 </style>

+ 26 - 10
src/views/teamDetail/teamListComponent/modals/eidtAddr.vue

@@ -91,31 +91,43 @@
 </template>
 <script>
 import { areaQueryChild, getParentArea } from "@/api/specialSetting";
+
 export default {
+  props:['form'],
   data() {
     return {
       forms:{
         consigneeName:'',
         mobile:'',
-
+        detailAddress:'',
+        musicGroupId:'',
+        regionProvince:'',
+        regionCity:'',
+        regionCounty:''
       },
       provinceList:[],
-      cityList:[]
+      cityList:[],
+      countyList:[]
 
     };
   },async mounted(){
     await this.getAreaList();
-    if (this.forms.areaId) {
-      await getParentArea({ id: this.forms.areaId }).then(async res => {
+    if (this.forms.regionCity) {
+      await getParentArea({ id: this.forms.regionCity }).then(async res => {
         if (res.code == 200 && res.data) {
-          await this.getAreaList(res.data.id, () => {
-            this.$set(this.forms, "province", res.data.id);
-            this.$set(this.forms, "city", this.forms.areaId);
+          await this.getAreaList(res.data.id,'regionCity', () => {
+            this.$set(this.forms, "regionProvince", res.data.id);
+            this.$set(this.forms, "regionCity", this.forms.regionCity);
+
           });
+
         }
       });
+      if(this.forms.regionCity){
+        await this.getAreaList(this.forms.regionCity,'regionCounty');
+      }
     } else {
-      this.$set(this.forms, "province", null);
+      this.$set(this.forms, "regionProvince", null);
       this.$set(this.forms, "city", null);
     }
   },
@@ -124,7 +136,7 @@ export default {
       this.forms.city = null;
       this.getAreaList(val);
     },
-    getAreaList(parentId, callback) {
+    getAreaList(parentId,type, callback) {
       parentId = parentId ? parentId : 0;
       areaQueryChild({ parentId: parentId }).then(res => {
         if (res.code == 200 && res.data) {
@@ -136,7 +148,11 @@ export default {
             });
           });
           if (parentId) {
-            this.cityList = tempData;
+            if(type =='regionCounty'){
+              this.countyList = tempData;
+            }else {
+              this.cityList = tempData;
+            }
           } else {
             this.provinceList = tempData;
           }