|
|
@@ -111,9 +111,16 @@
|
|
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
|
|
v-hasPermi="['system:store:edit']"></el-button>
|
|
|
</el-tooltip>
|
|
|
- <el-tooltip content="更多" placement="top">
|
|
|
- <el-button link type="primary" icon="More"></el-button>
|
|
|
- </el-tooltip>
|
|
|
+ <el-dropdown trigger="click" @command="(cmd: string) => handleCommand(cmd, scope.row)">
|
|
|
+ <el-button link type="primary" icon="More" style="margin-left: 10px"></el-button>
|
|
|
+ <template #dropdown>
|
|
|
+ <el-dropdown-menu>
|
|
|
+ <el-dropdown-item command="renew" icon="Clock">续期</el-dropdown-item>
|
|
|
+ <el-dropdown-item v-if="scope.row.status === 1" command="ban" icon="CircleClose">禁用</el-dropdown-item>
|
|
|
+ <el-dropdown-item v-if="scope.row.status === 3" command="enable" icon="CircleCheck">启用</el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </template>
|
|
|
+ </el-dropdown>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -264,12 +271,33 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <!-- 门店续期对话框 -->
|
|
|
+ <el-dialog title="门店续期" v-model="renewDialog.visible" width="400px" append-to-body>
|
|
|
+ <el-form :model="renewForm" label-width="80px">
|
|
|
+ <el-form-item label="到期日期" prop="to">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="renewForm.to"
|
|
|
+ type="datetime"
|
|
|
+ placeholder="选择到期日期时间"
|
|
|
+ value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
+ style="width: 100%"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitRenew">确 定</el-button>
|
|
|
+ <el-button @click="renewDialog.visible = false">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup name="Store" lang="ts">
|
|
|
-import { listStore, getStore, delStore, addStore, updateStore, listStoreStatus } from '@/api/system/store';
|
|
|
-import { StoreVO, StoreQuery, StoreForm, StoreStatusVO, SysStorePageBo } from '@/api/system/store/types';
|
|
|
+import { listStore, getStore, delStore, addStore, updateStore, listStoreStatus, renewStore, banStore, enableStore } from '@/api/system/store';
|
|
|
+import { StoreVO, StoreQuery, StoreForm, StoreStatusVO, SysStorePageBo, StoreRenewReq } from '@/api/system/store/types';
|
|
|
import { listOnStore } from '@/api/system/tenant';
|
|
|
import { listOnStore as listTenantCategoriesOnStore } from '@/api/system/tenantCategories';
|
|
|
import { listOnStore as listServiceOnStore } from '@/api/service/list';
|
|
|
@@ -370,6 +398,51 @@ const orderList = ref([
|
|
|
{ orderNo: 'ORD202402030005', service: '疫苗注射', customer: '王五', amount: '¥80', time: '2024-02-01 09:00', status: '已取消', statusType: 'info' }
|
|
|
]);
|
|
|
|
|
|
+const renewDialog = reactive({
|
|
|
+ visible: false,
|
|
|
+ title: '门店续期'
|
|
|
+});
|
|
|
+
|
|
|
+const renewForm = ref<StoreRenewReq>({
|
|
|
+ id: undefined as any,
|
|
|
+ to: ''
|
|
|
+});
|
|
|
+
|
|
|
+/** 续期按钮操作 */
|
|
|
+const handleRenew = (row: StoreVO) => {
|
|
|
+ renewForm.value.id = row.id as any;
|
|
|
+ renewForm.value.to = row.validity ? String(row.validity) : '';
|
|
|
+ renewDialog.visible = true;
|
|
|
+};
|
|
|
+
|
|
|
+/** 提交续期 */
|
|
|
+const submitRenew = async () => {
|
|
|
+ if (!renewForm.value.to) {
|
|
|
+ proxy?.$modal.msgError("请选择日期");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ await renewStore(renewForm.value);
|
|
|
+ proxy?.$modal.msgSuccess("续期成功");
|
|
|
+ renewDialog.visible = false;
|
|
|
+ getList();
|
|
|
+};
|
|
|
+
|
|
|
+/** 禁用按钮操作 */
|
|
|
+const handleBan = async (row: StoreVO) => {
|
|
|
+ await proxy?.$modal.confirm('确认禁用该门店吗?');
|
|
|
+ await banStore({ id: row.id });
|
|
|
+ proxy?.$modal.msgSuccess("禁用成功");
|
|
|
+ getList();
|
|
|
+};
|
|
|
+
|
|
|
+/** 启用按钮操作 */
|
|
|
+const handleEnable = async (row: StoreVO) => {
|
|
|
+ await proxy?.$modal.confirm('确认启用该门店吗?');
|
|
|
+ await enableStore({ id: row.id });
|
|
|
+ proxy?.$modal.msgSuccess("启用成功");
|
|
|
+ getList();
|
|
|
+};
|
|
|
+
|
|
|
/** 详情按钮操作 */
|
|
|
const handleDetail = async (row: StoreVO) => {
|
|
|
const res = await getStore(row.id);
|
|
|
@@ -453,6 +526,21 @@ const data = reactive<PageData<StoreForm, SysStorePageBo>>({
|
|
|
|
|
|
const { queryParams, form, rules } = toRefs(data);
|
|
|
|
|
|
+/** 统一处理下拉操作 */
|
|
|
+const handleCommand = (command: string, row: StoreVO) => {
|
|
|
+ switch (command) {
|
|
|
+ case 'renew':
|
|
|
+ handleRenew(row);
|
|
|
+ break;
|
|
|
+ case 'ban':
|
|
|
+ handleBan(row);
|
|
|
+ break;
|
|
|
+ case 'enable':
|
|
|
+ handleEnable(row);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
/** 查询门店管理列表 */
|
|
|
const getList = async () => {
|
|
|
loading.value = true;
|