修改一些可见的bug,优化运费模板中地址选择问题
This commit is contained in:
		
							parent
							
								
									e359e674cf
								
							
						
					
					
						commit
						92aa9fccaf
					
				@ -17,10 +17,10 @@ export default {
 | 
			
		||||
   * @description api请求基础路径
 | 
			
		||||
   */
 | 
			
		||||
  api_dev: {
 | 
			
		||||
    common: 'https://common-api.pickmall.cn',
 | 
			
		||||
    common: 'http://192.168.0.103:8890/',
 | 
			
		||||
    buyer: 'https://buyer-api.pickmall.cn',
 | 
			
		||||
    seller: 'https://store-api.pickmall.cn',
 | 
			
		||||
    manager: 'https://admin-api.pickmall.cn'
 | 
			
		||||
    manager: 'http://192.168.0.103:8887'
 | 
			
		||||
  },
 | 
			
		||||
  api_prod: {
 | 
			
		||||
    common: 'https://common-api.pickmall.cn',
 | 
			
		||||
 | 
			
		||||
@ -53,7 +53,7 @@
 | 
			
		||||
        <div class="right-container">
 | 
			
		||||
          <div class="border-b">{{ infoData.goodsName }}</div>
 | 
			
		||||
          <div class="border-b">
 | 
			
		||||
            <div class="div-height"> 店铺名称:{{ infoData.sellerName }}</div>
 | 
			
		||||
            <div class="div-height"> 店铺名称:{{ infoData.storeName }}</div>
 | 
			
		||||
            <div class="div-height"> 订单号:{{ infoData.orderNo }}</div>
 | 
			
		||||
          </div>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -72,11 +72,11 @@
 | 
			
		||||
          <div class="counts">{{$store.state.notices.refund|| 0}}</div>
 | 
			
		||||
          <div>待审核售后</div>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="todo-item" @click="navigateTo('distribution')">
 | 
			
		||||
        <div class="todo-item" >
 | 
			
		||||
          <div class="counts">{{$store.state.notices.distributionCash|| 0}}</div>
 | 
			
		||||
          <div>待审核分销提现</div>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="todo-item" @click="navigateTo('billList')">
 | 
			
		||||
        <div class="todo-item" @click="navigateTo('accountStatementBill')">
 | 
			
		||||
          <div class="counts">{{$store.state.notices.waitPayBill|| 0}}</div>
 | 
			
		||||
          <div>待审核分账</div>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
@ -1,127 +0,0 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <Modal :mask-closable="false" :value="switched" v-model="switched" title="选择地址" @on-ok="submit" @on-cancel="cancel">
 | 
			
		||||
    <div class="flex">
 | 
			
		||||
      <Spin size="large" fix v-if="spinShow"></Spin>
 | 
			
		||||
      <Tree ref="tree" class="tree" :data="data" expand-node show-checkbox multiple></Tree>
 | 
			
		||||
    </div>
 | 
			
		||||
  </Modal>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { getAllCity } from "@/api/index";
 | 
			
		||||
export default {
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      switched: false, // 控制模态框显隐
 | 
			
		||||
      spinShow: false, // 加载状态
 | 
			
		||||
      data: [], // 地区数据
 | 
			
		||||
      selectedWay: [], // 选择的地区
 | 
			
		||||
      callBackData: "", // 打开组件的回显数据
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    this.init();
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    cancel() {
 | 
			
		||||
      this.switched = false;
 | 
			
		||||
      // this.$emit("close",true)
 | 
			
		||||
    },
 | 
			
		||||
    open(val) {
 | 
			
		||||
      if (val) {
 | 
			
		||||
        this.callBackData = val;
 | 
			
		||||
        this.data = JSON.parse(JSON.stringify(this.data));
 | 
			
		||||
        val.areaId.split(",").forEach((ids) => {
 | 
			
		||||
          this.data.forEach((item) => {
 | 
			
		||||
            if (item.id == ids) {
 | 
			
		||||
              item.selected = true;
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
            item.children &&
 | 
			
		||||
              item.children.forEach((child) => {
 | 
			
		||||
                if (child.id == ids) {
 | 
			
		||||
                  child.checked = true;
 | 
			
		||||
                }
 | 
			
		||||
              });
 | 
			
		||||
          });
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        console.log(this.data);
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      this.switched = true;
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    submit() {
 | 
			
		||||
      // 筛选出省市
 | 
			
		||||
      let list = this.$refs.tree.getCheckedAndIndeterminateNodes();
 | 
			
		||||
      let sort = [];
 | 
			
		||||
      list.forEach((item) => {
 | 
			
		||||
        item.selectedList = [];
 | 
			
		||||
        if (item.level == "province") {
 | 
			
		||||
          sort.push({
 | 
			
		||||
            ...item,
 | 
			
		||||
          });
 | 
			
		||||
        }
 | 
			
		||||
        sort.forEach((sortItem, sortIndex) => {
 | 
			
		||||
          if (item.level != "province" && sortItem.id == item.parentId) {
 | 
			
		||||
            sortItem.selectedList.push({
 | 
			
		||||
              ...item,
 | 
			
		||||
            });
 | 
			
		||||
          }
 | 
			
		||||
        });
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
      this.$emit(
 | 
			
		||||
        "selected",
 | 
			
		||||
        list.filter((item) => {
 | 
			
		||||
          return item.level == "province";
 | 
			
		||||
        })
 | 
			
		||||
      );
 | 
			
		||||
 | 
			
		||||
      this.cancel();
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    init() {
 | 
			
		||||
      getAllCity().then((res) => {
 | 
			
		||||
        if (res.result) {
 | 
			
		||||
          res.result.forEach((item) => {
 | 
			
		||||
            item.children.forEach((child) => {
 | 
			
		||||
              child.title = child.name;
 | 
			
		||||
            });
 | 
			
		||||
 | 
			
		||||
            let data = {
 | 
			
		||||
              title: item.name,
 | 
			
		||||
 | 
			
		||||
              ...item,
 | 
			
		||||
            };
 | 
			
		||||
            this.data.push(data);
 | 
			
		||||
            this.selectedWay.push({ name: data.title, id: data.id });
 | 
			
		||||
          });
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style scoped lang="scss">
 | 
			
		||||
.flex {
 | 
			
		||||
  display: flex;
 | 
			
		||||
  position: relative;
 | 
			
		||||
}
 | 
			
		||||
.tree {
 | 
			
		||||
  flex: 2;
 | 
			
		||||
}
 | 
			
		||||
.form {
 | 
			
		||||
  flex: 8;
 | 
			
		||||
}
 | 
			
		||||
.button-list {
 | 
			
		||||
  margin-left: 80px;
 | 
			
		||||
  > * {
 | 
			
		||||
    margin: 0 4px;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
/deep/ .ivu-modal-body {
 | 
			
		||||
  height: 400px !important;
 | 
			
		||||
  overflow: auto;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
@ -48,10 +48,10 @@
 | 
			
		||||
                  style="width: 200px"
 | 
			
		||||
                ></DatePicker>
 | 
			
		||||
              </Form-item>
 | 
			
		||||
              <Form-item label="商家名称" prop="sellerName">
 | 
			
		||||
              <Form-item label="商家名称" prop="storeName">
 | 
			
		||||
                <Input
 | 
			
		||||
                  type="text"
 | 
			
		||||
                  v-model="searchForm.sellerName"
 | 
			
		||||
                  v-model="searchForm.storeName"
 | 
			
		||||
                  placeholder="请输入商家名称"
 | 
			
		||||
                  clearable
 | 
			
		||||
                  style="width: 200px"
 | 
			
		||||
@ -143,7 +143,7 @@
 | 
			
		||||
          orderSn: "",
 | 
			
		||||
          memberName: "",
 | 
			
		||||
          serviceStatus: "",
 | 
			
		||||
          sellerName:"",
 | 
			
		||||
          storeName:"",
 | 
			
		||||
          sn: "",
 | 
			
		||||
 | 
			
		||||
        },
 | 
			
		||||
@ -151,7 +151,7 @@
 | 
			
		||||
        form: {
 | 
			
		||||
          // 添加或编辑表单对象初始化数据
 | 
			
		||||
          sn: "",
 | 
			
		||||
          sellerName: "",
 | 
			
		||||
          storeName: "",
 | 
			
		||||
          startTime: "",
 | 
			
		||||
          endTime: "",
 | 
			
		||||
          billPrice: "",
 | 
			
		||||
 | 
			
		||||
@ -2,35 +2,41 @@
 | 
			
		||||
  <div class="search">
 | 
			
		||||
    <Row>
 | 
			
		||||
      <Col>
 | 
			
		||||
        <Card>
 | 
			
		||||
          <Row @keydown.enter.native="handleSearch">
 | 
			
		||||
            <Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
 | 
			
		||||
              <Form-item label="订单号" prop="sn">
 | 
			
		||||
                <Input type="text" v-model="searchForm.sn" placeholder="订单/交易号" clearable style="width: 200px"/>
 | 
			
		||||
              </Form-item>
 | 
			
		||||
              <Form-item label="付款状态" prop="orderStatus">
 | 
			
		||||
                <Select v-model="searchForm.payStatus" placeholder="请选择" clearable style="width: 200px">
 | 
			
		||||
                  <Option value="UNPAID">未付款</Option>
 | 
			
		||||
                  <Option value="PAID">已付款</Option>
 | 
			
		||||
                </Select>
 | 
			
		||||
              </Form-item>
 | 
			
		||||
              <Form-item label="支付时间">
 | 
			
		||||
                <DatePicker v-model="searchForm" type="datetimerange" format="yyyy-MM-dd" clearable
 | 
			
		||||
                            @on-change="selectDateRange" placeholder="选择起始时间" style="width: 200px"></DatePicker>
 | 
			
		||||
              </Form-item>
 | 
			
		||||
              <Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
 | 
			
		||||
            </Form>
 | 
			
		||||
          </Row>
 | 
			
		||||
          <Row class="padding-row">
 | 
			
		||||
            <Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom"
 | 
			
		||||
                   @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table>
 | 
			
		||||
          </Row>
 | 
			
		||||
          <Row type="flex" justify="end" class="page">
 | 
			
		||||
            <Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize"
 | 
			
		||||
                  @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]"
 | 
			
		||||
                  size="small" show-total show-elevator show-sizer></Page>
 | 
			
		||||
          </Row>
 | 
			
		||||
        </Card>
 | 
			
		||||
      <Card>
 | 
			
		||||
        <Row @keydown.enter.native="handleSearch">
 | 
			
		||||
          <Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
 | 
			
		||||
            <Form-item label="订单号" prop="sn">
 | 
			
		||||
              <Input type="text" v-model="searchForm.sn" placeholder="订单/交易号" clearable style="width: 200px" />
 | 
			
		||||
            </Form-item>
 | 
			
		||||
            <Form-item label="付款状态" prop="orderStatus">
 | 
			
		||||
              <Select v-model="searchForm.payStatus" placeholder="请选择" clearable style="width: 200px">
 | 
			
		||||
                <Option value="UNPAID">未付款</Option>
 | 
			
		||||
                <Option value="PAID">已付款</Option>
 | 
			
		||||
              </Select>
 | 
			
		||||
            </Form-item>
 | 
			
		||||
            <Form-item label="支付方式" prop="orderStatus">
 | 
			
		||||
              <Select v-model="searchForm.paymentMethod" placeholder="请选择" clearable style="width: 200px">
 | 
			
		||||
                <Option value="WECHAT">微信</Option>
 | 
			
		||||
                <Option value="ALIPAY">支付宝</Option>
 | 
			
		||||
                <Option value="WALLET">余额</Option>
 | 
			
		||||
                <Option value="BANK_TRANSFER">银行转账</Option>
 | 
			
		||||
                <Option value="">暂未付款</Option>
 | 
			
		||||
              </Select>
 | 
			
		||||
            </Form-item>
 | 
			
		||||
            <Form-item label="支付时间">
 | 
			
		||||
              <DatePicker v-model="searchForm" type="datetimerange" format="yyyy-MM-dd" clearable @on-change="selectDateRange" placeholder="选择起始时间" style="width: 200px"></DatePicker>
 | 
			
		||||
            </Form-item>
 | 
			
		||||
            <Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
 | 
			
		||||
          </Form>
 | 
			
		||||
        </Row>
 | 
			
		||||
        <Row class="padding-row">
 | 
			
		||||
          <Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table>
 | 
			
		||||
        </Row>
 | 
			
		||||
        <Row type="flex" justify="end" class="page">
 | 
			
		||||
          <Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]"
 | 
			
		||||
            size="small" show-total show-elevator show-sizer></Page>
 | 
			
		||||
        </Row>
 | 
			
		||||
      </Card>
 | 
			
		||||
      </Col>
 | 
			
		||||
    </Row>
 | 
			
		||||
  </div>
 | 
			
		||||
@ -68,16 +74,57 @@ export default {
 | 
			
		||||
        {
 | 
			
		||||
          title: "支付方式",
 | 
			
		||||
          key: "paymentMethod",
 | 
			
		||||
          width: 100,
 | 
			
		||||
          width: 120,
 | 
			
		||||
          align: "center",
 | 
			
		||||
          render: (h, params) => {
 | 
			
		||||
            if (params.row.paymentMethod === "WECHAT") {
 | 
			
		||||
              return h("div", [h("span", {}, "微信")]);
 | 
			
		||||
              return h("div", [
 | 
			
		||||
                h(
 | 
			
		||||
                  "Tag",
 | 
			
		||||
                  {
 | 
			
		||||
                    props: {
 | 
			
		||||
                      color: "green",
 | 
			
		||||
                    },
 | 
			
		||||
                  },
 | 
			
		||||
                  "微信"
 | 
			
		||||
                ),
 | 
			
		||||
              ]);
 | 
			
		||||
            } else if (params.row.paymentMethod === "ALIPAY") {
 | 
			
		||||
              return h("div", [h("span", {}, "支付宝")]);
 | 
			
		||||
              return h("div", [
 | 
			
		||||
                h(
 | 
			
		||||
                  "Tag",
 | 
			
		||||
                  {
 | 
			
		||||
                    props: {
 | 
			
		||||
                      color: "blue",
 | 
			
		||||
                    },
 | 
			
		||||
                  },
 | 
			
		||||
                  "支付宝"
 | 
			
		||||
                ),
 | 
			
		||||
              ]);
 | 
			
		||||
            } else if (params.row.paymentMethod === "WALLET") {
 | 
			
		||||
              return h("div", [h("span", {}, "余额支付")]);
 | 
			
		||||
              return h("div", [
 | 
			
		||||
                h(
 | 
			
		||||
                  "Tag",
 | 
			
		||||
                  {
 | 
			
		||||
                    props: {},
 | 
			
		||||
                  },
 | 
			
		||||
                  "余额支付"
 | 
			
		||||
                ),
 | 
			
		||||
              ]);
 | 
			
		||||
            } else if (params.row.paymentMethod === "BANK_TRANSFER") {
 | 
			
		||||
              return h("div", [h("span", {}, "银行转帐")]);
 | 
			
		||||
              return h("div", [
 | 
			
		||||
                h(
 | 
			
		||||
                  "Tag",
 | 
			
		||||
                  {
 | 
			
		||||
                    props: {
 | 
			
		||||
                      color: "orange",
 | 
			
		||||
                    },
 | 
			
		||||
                  },
 | 
			
		||||
                  "银行转帐"
 | 
			
		||||
                ),
 | 
			
		||||
              ]);
 | 
			
		||||
            } else {
 | 
			
		||||
              return h("div", [h("Tag", {}, "暂未付款")]);
 | 
			
		||||
            }
 | 
			
		||||
          },
 | 
			
		||||
        },
 | 
			
		||||
@ -85,19 +132,24 @@ export default {
 | 
			
		||||
          title: "第三方流水",
 | 
			
		||||
          key: "receivableNo",
 | 
			
		||||
          minWidth: 130,
 | 
			
		||||
          render: (h, params) => {
 | 
			
		||||
            return h("div", [
 | 
			
		||||
              h("span", {}, params.row.receivableNo || "暂无流水号"),
 | 
			
		||||
            ]);
 | 
			
		||||
          },
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          title: "客户端",
 | 
			
		||||
          key: "clientType",
 | 
			
		||||
          width: 130,
 | 
			
		||||
          render: (h, params) => {
 | 
			
		||||
            if (params.row.clientType === "WECHAT_MP") {
 | 
			
		||||
            if (params.row.clientType === "WECHAT_MP" || params.row.clientType === '小程序') {
 | 
			
		||||
              return h("div", [h("span", {}, "小程序")]);
 | 
			
		||||
            } else if (params.row.clientType === "APP") {
 | 
			
		||||
              return h("div", [h("span", {}, "APP")]);
 | 
			
		||||
            } else if (params.row.clientType === "PC") {
 | 
			
		||||
              return h("div", [h("span", {}, "PC网页")]);
 | 
			
		||||
            } else if (params.row.clientType === "H5") {
 | 
			
		||||
            } else if (params.row.clientType === "H5" || params.row.clientType === 'wap') {
 | 
			
		||||
              return h("div", [h("span", {}, "移动端")]);
 | 
			
		||||
            }
 | 
			
		||||
          },
 | 
			
		||||
@ -106,6 +158,11 @@ export default {
 | 
			
		||||
          title: "支付时间",
 | 
			
		||||
          key: "paymentTime",
 | 
			
		||||
          width: 200,
 | 
			
		||||
          render: (h, params) => {
 | 
			
		||||
            return h("div", [
 | 
			
		||||
              h("span", {}, params.row.paymentTime || "暂无支付时间"),
 | 
			
		||||
            ]);
 | 
			
		||||
          },
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          title: "订单金额",
 | 
			
		||||
@ -204,7 +261,7 @@ export default {
 | 
			
		||||
      });
 | 
			
		||||
      this.total = this.data.length;
 | 
			
		||||
      this.loading = false;
 | 
			
		||||
    }
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    this.init();
 | 
			
		||||
 | 
			
		||||
@ -99,6 +99,15 @@
 | 
			
		||||
            key: "storeAddressPath",
 | 
			
		||||
            width: 300,
 | 
			
		||||
            sortable: false,
 | 
			
		||||
            render: (h, params) => {
 | 
			
		||||
            return h(
 | 
			
		||||
              "Tag",
 | 
			
		||||
              {
 | 
			
		||||
 | 
			
		||||
              },
 | 
			
		||||
              params.row.storeAddressPath ||  "暂未填写"
 | 
			
		||||
            );
 | 
			
		||||
          },
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            title: "是否自营",
 | 
			
		||||
 | 
			
		||||
@ -111,7 +111,16 @@ export default {
 | 
			
		||||
          title: "店铺地址",
 | 
			
		||||
          key: "storeAddressPath",
 | 
			
		||||
          width: 300,
 | 
			
		||||
          tooltip: true
 | 
			
		||||
          tooltip: true,
 | 
			
		||||
          render: (h, params) => {
 | 
			
		||||
            return h(
 | 
			
		||||
              "Tag",
 | 
			
		||||
              {
 | 
			
		||||
 | 
			
		||||
              },
 | 
			
		||||
              params.row.storeAddressPath ||  "暂未填写"
 | 
			
		||||
            );
 | 
			
		||||
          },
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
          title: "是否自营",
 | 
			
		||||
 | 
			
		||||
@ -6,6 +6,7 @@ import Vue from 'vue';
 | 
			
		||||
 | 
			
		||||
const app = {
 | 
			
		||||
    state: {
 | 
			
		||||
        shipTemplates:"",
 | 
			
		||||
        styleStore:"", //移动端楼层装修中选择风格存储
 | 
			
		||||
        loading: false, // 全局加载动画
 | 
			
		||||
        added: false, // 加载路由标识
 | 
			
		||||
@ -30,7 +31,7 @@ const app = {
 | 
			
		||||
                path: '',
 | 
			
		||||
                name: 'home_index'
 | 
			
		||||
            }
 | 
			
		||||
        ], 
 | 
			
		||||
        ],
 | 
			
		||||
        // 面包屑数组 左侧菜单
 | 
			
		||||
        menuList: [],
 | 
			
		||||
        routers: [
 | 
			
		||||
 | 
			
		||||
@ -7,7 +7,7 @@
 | 
			
		||||
  </Modal>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
import { getChildRegion, getAllCity } from "@/api/index";
 | 
			
		||||
import { getAllCity } from "@/api/index";
 | 
			
		||||
export default {
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
@ -22,46 +22,84 @@ export default {
 | 
			
		||||
    this.init();
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    /**
 | 
			
		||||
     * 关闭
 | 
			
		||||
     */
 | 
			
		||||
    cancel() {
 | 
			
		||||
      this.switched = false;
 | 
			
		||||
      // this.$emit("close",true)
 | 
			
		||||
    },
 | 
			
		||||
    open(val) {
 | 
			
		||||
      if (val) {
 | 
			
		||||
        this.callBackData = val;
 | 
			
		||||
        this.data = JSON.parse(JSON.stringify(this.data));
 | 
			
		||||
        val.areaId.split(",").forEach((ids) => {
 | 
			
		||||
          this.data.forEach((item) => {
 | 
			
		||||
            if (item.id == ids) {
 | 
			
		||||
              item.selected = true;
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
            item.children &&
 | 
			
		||||
              item.children.forEach((child) => {
 | 
			
		||||
      // 关闭的时候所有数据设置成disabled为true
 | 
			
		||||
      this.data.forEach((item) => {
 | 
			
		||||
        this.$set(item, "disabled", false);
 | 
			
		||||
        item.children.forEach((child) => {
 | 
			
		||||
          this.$set(child, "disabled", false);
 | 
			
		||||
        });
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 打开地图选择器
 | 
			
		||||
     * @param {val} 回调的数据
 | 
			
		||||
     * @param {index} 当前操作的运费模板的索引
 | 
			
		||||
     */
 | 
			
		||||
    open(val, index) {
 | 
			
		||||
      if (val) {
 | 
			
		||||
        //已选中的地址
 | 
			
		||||
        let checkedData = this.$store.state.shipTemplate;
 | 
			
		||||
 | 
			
		||||
        // 禁止选中的地址
 | 
			
		||||
        let disabledData = checkedData.filter((item, i) => {
 | 
			
		||||
          return i != index;
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        disabledData.forEach((dis) => {
 | 
			
		||||
          // 循环出已经选中的地址id
 | 
			
		||||
          dis.areaId.split(",").forEach((ids) => {
 | 
			
		||||
            // 循环出省份
 | 
			
		||||
            this.data.forEach((item) => {
 | 
			
		||||
              // 如果当前省份下市区全部选中则选中该省份
 | 
			
		||||
              if (dis.selectedAll) {
 | 
			
		||||
                dis.area.split(",").forEach((area) => {
 | 
			
		||||
                  if (area == item.name) {
 | 
			
		||||
                    this.$set(item, "disabled", true);
 | 
			
		||||
                  }
 | 
			
		||||
                });
 | 
			
		||||
              }
 | 
			
		||||
              // 将市区继续循环
 | 
			
		||||
              item.children.forEach((child, childIndex) => {
 | 
			
		||||
                // 判断当前市区是否是已选中状态
 | 
			
		||||
                if (child.id == ids) {
 | 
			
		||||
                  child.checked = true;
 | 
			
		||||
                  this.$set(child, "disabled", true);
 | 
			
		||||
                }
 | 
			
		||||
              });
 | 
			
		||||
            });
 | 
			
		||||
          });
 | 
			
		||||
        });
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      this.switched = true;
 | 
			
		||||
      this.switched ? (this.switched = true) : (this.switched = true);
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 提交并筛选出省市
 | 
			
		||||
     */
 | 
			
		||||
    submit() {
 | 
			
		||||
      // 筛选出省市
 | 
			
		||||
      let list = this.$refs.tree.getCheckedAndIndeterminateNodes();
 | 
			
		||||
 | 
			
		||||
      let sort = [];
 | 
			
		||||
      list.forEach((item) => {
 | 
			
		||||
      list.forEach((item, i) => {
 | 
			
		||||
        item.selectedList = [];
 | 
			
		||||
        if (item.level == "province") {
 | 
			
		||||
        item.selectedAll = false;
 | 
			
		||||
        // 筛选出当前的省份
 | 
			
		||||
        if (item.level == "province" && !item.disabled) {
 | 
			
		||||
          sort.push({
 | 
			
		||||
            ...item,
 | 
			
		||||
          });
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // 筛选出当前选中的市
 | 
			
		||||
        sort.forEach((sortItem, sortIndex) => {
 | 
			
		||||
          if (item.level != "province" && sortItem.id == item.parentId) {
 | 
			
		||||
          if (item.level != "province" && sortItem.id == item.parentId && !item.disabled) {
 | 
			
		||||
            sortItem.selectedList.push({
 | 
			
		||||
              ...item,
 | 
			
		||||
            });
 | 
			
		||||
@ -69,12 +107,24 @@ export default {
 | 
			
		||||
        });
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
      this.$emit(
 | 
			
		||||
        "selected",
 | 
			
		||||
        list.filter((item) => {
 | 
			
		||||
          return item.level == "province";
 | 
			
		||||
        })
 | 
			
		||||
      );
 | 
			
		||||
      // 判断如果当前省是否全选
 | 
			
		||||
      this.data.forEach((whether) => {
 | 
			
		||||
        sort.forEach((item) => {
 | 
			
		||||
          // 如果当前省匹配
 | 
			
		||||
          if (
 | 
			
		||||
            item.id == whether.id &&
 | 
			
		||||
            item.selectedList.length == whether.children.length
 | 
			
		||||
          ) {
 | 
			
		||||
            // 给一个全选子级的标识符
 | 
			
		||||
            item.selectedList.forEach((child) => {
 | 
			
		||||
              this.$set(child, "selectedAll", true);
 | 
			
		||||
            });
 | 
			
		||||
            this.$set(item, "selectedAll", true);
 | 
			
		||||
          }
 | 
			
		||||
        });
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
      this.$emit("selected", sort);
 | 
			
		||||
 | 
			
		||||
      this.cancel();
 | 
			
		||||
    },
 | 
			
		||||
@ -93,8 +143,10 @@ export default {
 | 
			
		||||
              ...item,
 | 
			
		||||
            };
 | 
			
		||||
            this.data.push(data);
 | 
			
		||||
 | 
			
		||||
            this.selectedWay.push({ name: data.title, id: data.id });
 | 
			
		||||
          });
 | 
			
		||||
          console.log(this.data);
 | 
			
		||||
        }
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user