|
1 | 1 | <template>
|
2 | 2 | <!-- 搜索工作栏 -->
|
3 | 3 | <ContentWrap>
|
4 |
| - <el-form class="-mb-15px" :model="queryParams" ref="queryFormRef" :inline="true"> |
| 4 | + <el-form ref="queryFormRef" :inline="true" :model="queryParams" class="-mb-15px"> |
5 | 5 | <el-form-item label="门店手机" prop="phone">
|
6 | 6 | <el-input
|
7 | 7 | v-model="queryParams.phone"
|
8 |
| - placeholder="请输门店手机" |
| 8 | + class="!w-240px" |
9 | 9 | clearable
|
| 10 | + placeholder="请输门店手机" |
10 | 11 | @keyup.enter="handleQuery"
|
11 |
| - class="!w-240px" |
12 | 12 | />
|
13 | 13 | </el-form-item>
|
14 | 14 | <el-form-item label="门店名称" prop="name">
|
15 | 15 | <el-input
|
16 | 16 | v-model="queryParams.name"
|
17 |
| - placeholder="请输门店名称" |
| 17 | + class="!w-240px" |
18 | 18 | clearable
|
| 19 | + placeholder="请输门店名称" |
19 | 20 | @keyup.enter="handleQuery"
|
20 |
| - class="!w-240px" |
21 | 21 | />
|
22 | 22 | </el-form-item>
|
23 | 23 | <el-form-item label="门店状态" prop="status">
|
24 |
| - <el-select v-model="queryParams.status" placeholder="门店状态" clearable class="!w-240px"> |
| 24 | + <el-select v-model="queryParams.status" class="!w-240px" clearable placeholder="门店状态"> |
25 | 25 | <el-option
|
26 | 26 | v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
|
27 | 27 | :key="dict.value"
|
|
33 | 33 | <el-form-item label="创建时间" prop="createTime">
|
34 | 34 | <el-date-picker
|
35 | 35 | v-model="queryParams.createTime"
|
36 |
| - value-format="YYYY-MM-DD HH:mm:ss" |
37 |
| - type="datetimerange" |
38 |
| - start-placeholder="开始日期" |
39 |
| - end-placeholder="结束日期" |
40 | 36 | class="!w-240px"
|
| 37 | + end-placeholder="结束日期" |
| 38 | + start-placeholder="开始日期" |
| 39 | + type="datetimerange" |
| 40 | + value-format="YYYY-MM-DD HH:mm:ss" |
41 | 41 | />
|
42 | 42 | </el-form-item>
|
43 | 43 | <el-form-item>
|
44 |
| - <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button> |
45 |
| - <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button> |
46 |
| - <el-button |
47 |
| - type="primary" |
48 |
| - plain |
49 |
| - @click="openForm('create')" |
50 |
| - v-hasPermi="['trade:delivery:pick-up-store:create']" |
51 |
| - > |
52 |
| - <Icon icon="ep:plus" class="mr-5px" /> 新增 |
| 44 | + <el-button @click="handleQuery"> |
| 45 | + <Icon class="mr-5px" icon="ep:search" /> |
| 46 | + 搜索 |
| 47 | + </el-button> |
| 48 | + <el-button @click="resetQuery"> |
| 49 | + <Icon class="mr-5px" icon="ep:refresh" /> |
| 50 | + 重置 |
53 | 51 | </el-button>
|
54 | 52 | <el-button
|
55 |
| - type="success" |
| 53 | + v-hasPermi="['trade:delivery:pick-up-store:create']" |
56 | 54 | plain
|
57 |
| - @click="handleExport" |
58 |
| - :loading="exportLoading" |
59 |
| - v-hasPermi="['trade:delivery:pick-up-store:export']" |
| 55 | + type="primary" |
| 56 | + @click="openForm('create')" |
60 | 57 | >
|
61 |
| - <Icon icon="ep:download" class="mr-5px" /> 导出 |
| 58 | + <Icon class="mr-5px" icon="ep:plus" /> |
| 59 | + 新增 |
62 | 60 | </el-button>
|
63 | 61 | </el-form-item>
|
64 | 62 | </el-form>
|
|
75 | 73 | </el-table-column>
|
76 | 74 | <el-table-column label="门店名称" prop="name" />
|
77 | 75 | <el-table-column label="门店手机" prop="phone" />
|
78 |
| - <el-table-column label="门店详细地址" align="center" prop="detailAddress" /> |
79 |
| - <el-table-column label="开启状态" align="center" prop="status"> |
| 76 | + <el-table-column align="center" label="门店详细地址" prop="detailAddress" /> |
| 77 | + <el-table-column align="center" label="开启状态" prop="status"> |
80 | 78 | <template #default="scope">
|
81 | 79 | <dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
|
82 | 80 | </template>
|
83 | 81 | </el-table-column>
|
84 | 82 | <el-table-column
|
85 |
| - label="创建时间" |
| 83 | + :formatter="dateFormatter" |
86 | 84 | align="center"
|
| 85 | + label="创建时间" |
87 | 86 | prop="createTime"
|
88 | 87 | width="180"
|
89 |
| - :formatter="dateFormatter" |
90 | 88 | />
|
91 |
| - <el-table-column label="操作" align="center"> |
| 89 | + <el-table-column align="center" label="操作"> |
92 | 90 | <template #default="scope">
|
93 | 91 | <el-button
|
| 92 | + v-hasPermi="['trade:delivery:pick-up-store:update']" |
94 | 93 | link
|
95 | 94 | type="primary"
|
96 | 95 | @click="openForm('update', scope.row.id)"
|
97 |
| - v-hasPermi="['trade:delivery:pick-up-store:update']" |
98 | 96 | >
|
99 | 97 | 编辑
|
100 | 98 | </el-button>
|
101 | 99 | <el-button
|
| 100 | + v-hasPermi="['trade:delivery:pick-up-store:delete']" |
102 | 101 | link
|
103 | 102 | type="danger"
|
104 | 103 | @click="handleDelete(scope.row.id)"
|
105 |
| - v-hasPermi="['trade:delivery:pick-up-store:delete']" |
106 | 104 | >
|
107 | 105 | 删除
|
108 | 106 | </el-button>
|
|
113 | 111 | <!-- 表单弹窗:添加/修改 -->
|
114 | 112 | <DeliveryPickUpStoreForm ref="formRef" @success="getList" />
|
115 | 113 | </template>
|
116 |
| -<script setup lang="ts" name="DeliveryPickUpStore"> |
| 114 | +<script lang="ts" name="DeliveryPickUpStore" setup> |
117 | 115 | import * as DeliveryPickUpStoreApi from '@/api/mall/trade/delivery/pickUpStore'
|
118 | 116 | import DeliveryPickUpStoreForm from './PickUpStoreForm.vue'
|
119 | 117 | import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
120 | 118 | import { dateFormatter } from '@/utils/formatTime'
|
121 |
| -import download from '@/utils/download' |
| 119 | +
|
122 | 120 | const message = useMessage() // 消息弹窗
|
123 | 121 | const { t } = useI18n() // 国际化
|
124 | 122 |
|
125 | 123 | const total = ref(0) // 列表的总页数
|
126 | 124 | const loading = ref(true) // 列表的加载中
|
127 |
| -const exportLoading = ref(false) // 导出的加载中 |
128 | 125 | const list = ref<any[]>([]) // 列表的数据
|
129 | 126 | const queryParams = reactive({
|
130 | 127 | pageNo: 1,
|
@@ -179,21 +176,6 @@ const resetQuery = () => {
|
179 | 176 | handleQuery()
|
180 | 177 | }
|
181 | 178 |
|
182 |
| -/** 导出按钮操作 */ |
183 |
| -const handleExport = async () => { |
184 |
| - try { |
185 |
| - // 导出的二次确认 |
186 |
| - await message.exportConfirm() |
187 |
| - // 发起导出 |
188 |
| - exportLoading.value = true |
189 |
| - const data = await DeliveryPickUpStoreApi.exportDeliveryPickUpStoreApi(queryParams) |
190 |
| - download.excel(data, '自提门店.xls') |
191 |
| - } catch { |
192 |
| - } finally { |
193 |
| - exportLoading.value = false |
194 |
| - } |
195 |
| -} |
196 |
| -
|
197 | 179 | /** 初始化 **/
|
198 | 180 | onMounted(() => {
|
199 | 181 | getList()
|
|
0 commit comments