|
@@ -0,0 +1,191 @@
|
|
|
|
+<template>
|
|
|
|
+ <div>
|
|
|
|
+ <a-card size="small" :bordered="false">
|
|
|
|
+ <!-- 搜索条件 -->
|
|
|
|
+ <div ref="tableSearch" class="table-page-search-wrapper newTableSearchName">
|
|
|
|
+ <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
|
|
|
|
+ <a-row :gutter="15">
|
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
|
+ <a-form-model-item label="所在区域/分区">
|
|
|
|
+ <subarea id="rebateSettingsList-subareaSn" v-model="queryParam.subareaSn"></subarea>
|
|
|
|
+ </a-form-model-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :md="6" :sm="24">
|
|
|
|
+ <a-form-item label="经销商">
|
|
|
|
+ <a-input id="rebateSettingsList-dealerName" v-model.trim="queryParam.dealerName" allowClear placeholder="请输入经销商名称"/>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :md="8" :sm="24">
|
|
|
|
+ <a-form-item label="客服/区域负责人/销售总监">
|
|
|
|
+ <a-input id="rebateSettingsList-dealerName" v-model.trim="queryParam.dealerName" allowClear placeholder="请输入客服/区域负责人/销售总监"/>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ </a-col>
|
|
|
|
+ <a-col :md="24" :sm="24" style="margin-top: 10px;text-align:center;">
|
|
|
|
+ <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="rebateSettingsList-refresh">查询</a-button>
|
|
|
|
+ <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="rebateSettingsList-reset">重置</a-button>
|
|
|
|
+ <a-button
|
|
|
|
+ style="margin-left: 5px"
|
|
|
|
+ type="primary"
|
|
|
|
+ class="button-warning"
|
|
|
|
+ @click="handleExport"
|
|
|
|
+ :disabled="disabled"
|
|
|
|
+ id="allocateBillList-export">导出</a-button>
|
|
|
|
+ </a-col>
|
|
|
|
+ </a-row>
|
|
|
|
+ </a-form>
|
|
|
|
+ </div>
|
|
|
|
+ </a-card>
|
|
|
|
+ <a-card size="small" :bordered="false" class="dealerZoneSearch-wrap">
|
|
|
|
+ <a-spin :spinning="spinning" tip="Loading...">
|
|
|
|
+ <!-- 列表 -->
|
|
|
|
+ <s-table
|
|
|
|
+ class="sTable fixPagination"
|
|
|
|
+ ref="table"
|
|
|
|
+ :style="{ height: tableHeight+84.5+'px' }"
|
|
|
|
+ size="small"
|
|
|
|
+ :rowKey="(record) => record.id"
|
|
|
|
+ :columns="columns"
|
|
|
|
+ :showPagination="false"
|
|
|
|
+ :data="loadData"
|
|
|
|
+ :scroll="{ y: tableHeight }"
|
|
|
|
+ :defaultLoadData="false"
|
|
|
|
+ bordered>
|
|
|
|
+ </s-table>
|
|
|
|
+ </a-spin>
|
|
|
|
+ </a-card>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+import { commonMixin } from '@/utils/mixin'
|
|
|
|
+import { STable, VSelect } from '@/components'
|
|
|
|
+import { subareaQueryIncludeAreaAll, subareaDeleteBySn } from '@/api/subarea'
|
|
|
|
+import subarea from '@/views/common/subarea.js'
|
|
|
|
+export default {
|
|
|
|
+ name: 'DealerZoneSearch',
|
|
|
|
+ mixins: [commonMixin],
|
|
|
|
+ components: { STable, VSelect, subarea },
|
|
|
|
+ data () {
|
|
|
|
+ return {
|
|
|
|
+ spinning: false,
|
|
|
|
+ disabled: false, // 查询、重置按钮是否可操作
|
|
|
|
+ tableHeight: 0,
|
|
|
|
+ queryParam: {
|
|
|
|
+ subareaSn: undefined,
|
|
|
|
+ dealerName: ''
|
|
|
|
+ },
|
|
|
|
+ columns: [
|
|
|
|
+ { title: '经销商名称', dataIndex: 'subareaName', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '所属区域', dataIndex: 'subareaName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '所属分区', dataIndex: 'subareaName', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '客服', dataIndex: 'subareaName', width: '16%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '区域负责人', dataIndex: 'subareaName', width: '18%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
|
+ { title: '销售总监', dataIndex: 'subareaName', width: '30%', align: 'center', customRender: function (text) { return text || '--' } }
|
|
|
|
+ ],
|
|
|
|
+ // 加载数据方法 必须为 Promise 对象
|
|
|
|
+ loadData: parameter => {
|
|
|
|
+ // this.disabled = true
|
|
|
|
+ // this.spinning = true
|
|
|
|
+ return subareaQueryIncludeAreaAll(parameter).then(res => {
|
|
|
|
+ let data
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ data = res.data
|
|
|
|
+ const no = 0
|
|
|
|
+ for (var i = 0; i < data.length; i++) {
|
|
|
|
+ data[i].no = no + i + 1
|
|
|
|
+ }
|
|
|
|
+ this.disabled = false
|
|
|
|
+ }
|
|
|
|
+ this.spinning = false
|
|
|
|
+ return data
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ openModal: false, // 编辑 弹框
|
|
|
|
+ nowData: null,
|
|
|
|
+ itemId: null // 当前产品id
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ handleExport () {},
|
|
|
|
+ // 重置
|
|
|
|
+ resetSearchForm () {
|
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
|
+ },
|
|
|
|
+ // 删除
|
|
|
|
+ handleDel (row) {
|
|
|
|
+ const _this = this
|
|
|
|
+ this.$confirm({
|
|
|
|
+ title: '提示',
|
|
|
|
+ content: '确定要删除吗?删除后,经销商解除区域归属,人员解除管辖区域,删除后数据不可恢复。',
|
|
|
|
+ centered: true,
|
|
|
|
+ onOk () {
|
|
|
|
+ _this.spinning = true
|
|
|
|
+ subareaDeleteBySn({ sn: row.subareaSn }).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ _this.$message.success(res.message)
|
|
|
|
+ _this.$refs.table.refresh()
|
|
|
|
+ _this.spinning = false
|
|
|
|
+ } else {
|
|
|
|
+ _this.spinning = false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 编辑
|
|
|
|
+ handleEdit (row) {
|
|
|
|
+ this.itemId = row && row.subareaSn ? row.subareaSn : null
|
|
|
|
+ this.nowData = row
|
|
|
|
+ this.openModal = true
|
|
|
|
+ },
|
|
|
|
+ // 关闭弹框
|
|
|
|
+ closeModal () {
|
|
|
|
+ this.itemId = null
|
|
|
|
+ this.nowData = null
|
|
|
|
+ this.openModal = false
|
|
|
|
+ },
|
|
|
|
+ pageInit () {
|
|
|
|
+ const _this = this
|
|
|
|
+ this.$nextTick(() => { // 页面渲染完成后的回调
|
|
|
|
+ _this.setTableH()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ setTableH () {
|
|
|
|
+ const tableSearchH = this.$refs.tableSearch.offsetHeight
|
|
|
|
+ this.tableHeight = window.innerHeight - tableSearchH - 235
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ watch: {
|
|
|
|
+ '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
|
|
|
|
+ this.setTableH()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ mounted () {
|
|
|
|
+ if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
|
|
|
|
+ this.pageInit()
|
|
|
|
+ this.resetSearchForm()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ activated () {
|
|
|
|
+ // 如果是新页签打开,则重置当前页面
|
|
|
|
+ if (this.$store.state.app.isNewTab) {
|
|
|
|
+ this.pageInit()
|
|
|
|
+ this.resetSearchForm()
|
|
|
|
+ }
|
|
|
|
+ // 仅刷新列表,不重置页面
|
|
|
|
+ if (this.$store.state.app.updateList) {
|
|
|
|
+ this.pageInit()
|
|
|
|
+ this.$refs.table.refresh()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ beforeRouteEnter (to, from, next) {
|
|
|
|
+ next(vm => {})
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</script>
|
|
|
|
+<style lang="less">
|
|
|
|
+ .dealerZoneSearch-wrap{
|
|
|
|
+ height: 100%;
|
|
|
|
+ margin-top:6px;
|
|
|
|
+ }
|
|
|
|
+</style>
|