fuliqi
2024-01-24 29c1e7eb5ac16e90d8991a86c1c071bc312ec8d9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<template>
    <div class="dealerMgt">
        <list-condition-template
            ref="table"
            :form="listQuery"
            :formLabel="formLabel"
            :tableData="tableData"
            :total="total"
            @page-info-change="pageInfoChange"
            :isExistBtn="true"
        >
            <template slot="otherElement">
              <el-col class="formLayout" :xs='12' :sm='12' :md='12' :lg='6' :offset="0">
                <el-form-item label="门店城市:" prop="aeraId">
                   <address-component  ref="addressComponent"  :adressArr.sync='adressArray'></address-component>
                </el-form-item>
              </el-col>
              <el-col :span="24" :offset="0" class="buttonPosition">
                <el-button size="mini" type="primary" @click="queryData">查询</el-button>
                <el-button size="mini" @click="resetQuery">重置</el-button>
              </el-col>
            </template>
            <template slot="columns">
                <el-table-column label="门店名称" prop="shopName" width="180px" show-overflow-tooltip></el-table-column>
                <el-table-column label="门店电话" width="180px"  prop="shopPhone"></el-table-column>
                <el-table-column label="门店联系人" prop="linkMan" width="120px"></el-table-column>
                <el-table-column label="联系电话" width="120px"  prop="linkPhone"></el-table-column>
                <el-table-column label="门店地址" min-width="100px" show-overflow-tooltip>
                   <template slot-scope="scope">
                     {{scope.row.province}}{{scope.row.city}}{{scope.row.aera}} {{scope.row.areaMapName}} {{scope.row.shopAddress}}
                   </template>
                </el-table-column>
                <el-table-column label="门店状态" prop="isDeleted" :formatter="formatter"></el-table-column>
                <el-table-column label="关联经销商" prop="ecMarketMerchant.merchantName" width="160px"></el-table-column>
                <el-table-column label="创建时间" prop="createTime" width="180px"></el-table-column>
                <el-table-column label="更新时间" prop="updateTime" width="180px">
                  <template slot-scope="scope">
                    {{scope.row.updateTime ? scope.row.updateTime : '暂无更新时间'}}
                  </template>
                </el-table-column>
            </template>
        </list-condition-template>
    </div>
</template>
<script>
import { ecMarketShopManageGetShopByBiz } from '../../../api/MarketingMgt/dealerMgt'
import addressComponent from '@/components/formTemplate/addressComponent.vue'
var _this = null
export default {
  components: { addressComponent },
  data () {
    return {
      tableData: [],
      adressArray: [],
      total: 0,
      listQuery: {
        shopName: null,
        linkMan: null,
        startDate: null,
        endDate: null,
        isDeleted: null,
        updateTime: null,
        aeraId: null
      },
      formLabel: [
        {
          model: 'startDate',
          label: '创建时间',
          type: 'date',
          pickerOptions: {
            disabledDate (time) {
              return _this.listQuery.endDate && time.getTime() >= new Date(_this.listQuery.endDate).getTime() + 86400000
            }
          },
          timeClass: 'start-time-style'
        },
        {
          model: 'endDate',
          label: '-',
          customLabel: '创建时间',
          type: 'date',
          labelWidth: '20px',
          pickerOptions: {
            disabledDate (time) {
              return _this.listQuery.startDate && time.getTime() <= new Date(_this.listQuery.startDate).getTime() - 86400000
            }
          },
          timeClass: 'end-time-style'
        },
        {
          model: 'shopName',
          label: '门店名称',
          type: 'input'
        },
        {
          model: 'linkMan',
          label: '联系人',
          type: 'input'
        },
        {
          model: 'isDeleted',
          label: '门店状态',
          type: 'select',
          opts: [
            {
              id: '0',
              name: '启用'
            },
            {
              id: '1',
              name: '停用'
            }
          ]
        },
        {
          model: 'updateTime',
          label: '更新时间',
          type: 'date'
        }
      ]
    }
  },
  /**
   * 数据变化后刷新列表
   */
  mounted () {
    this.queryList(this.$refs.table.getPageInfo())
    _this = this
  },
  methods: {
    // 删除
    delItem (row, index) {},
    /**
         * 编辑
         */
    updateItem (row, index) {},
    /**
         * '分页信息改变时查询列表
         */
    pageInfoChange (pageInfo) {
      this.queryList(pageInfo)
    },
    formatter (row, column, cellValue, index) {
      switch (row.isDeleted) {
        case '0': return '启用'
        case '1': return '停用'
        default: return ''
      }
    },
    /**
         * 重置
         */
    resetQuery () {
      this.adressArray = []
      this.listQuery.merchantId = null
      this.$route.params.merchantId = null
      this.$refs.table.reloadCurrent()
    },
    /**
         * 点击查询按钮
         */
    queryData () {
      this.$refs.table.changeCondition()
    },
    /**
         * 查询列表
         */
    queryList (pageInfo = { pageNum: 1, pageSize: 10 }) {
      const length = this.adressArray.length
      this.listQuery.aeraId = length ? this.adressArray[length - 1] : null
      this.listQuery.merchantId = this.$route.params.merchantId ? this.$route.params.merchantId : null
      ecMarketShopManageGetShopByBiz(Object.assign({ param: this.listQuery }, pageInfo)).then(res => {
        if (res.data) {
          this.tableData = res.data.list
          this.total = res.data.total
        }
      })
    }
  }
}
</script>
<style scoped lang="scss">
.dealerMgt{
  .formLayout{
   display: flex;
   .el-form-item{
     flex-grow:1;
     /deep/.el-cascader{
       width:calc(100% - 82px);
     }
   }
  }
}
</style>