|
@@ -12,7 +12,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
<el-button @click="openDialog()" color="#11a983">
|
|
<el-button @click="openDialog()" color="#11a983">
|
|
|
<i-ep-plus/>
|
|
<i-ep-plus/>
|
|
|
- 增加门店
|
|
|
|
|
|
|
+ 增加门店品牌
|
|
|
</el-button>
|
|
</el-button>
|
|
|
<el-button type="primary" @click="refreshTableInfo">
|
|
<el-button type="primary" @click="refreshTableInfo">
|
|
|
<i-ep-refresh/>
|
|
<i-ep-refresh/>
|
|
@@ -20,6 +20,8 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div class="table-con">
|
|
<div class="table-con">
|
|
|
<el-table
|
|
<el-table
|
|
|
|
|
+ :max-height="tableHeight"
|
|
|
|
|
+ v-loading="loading"
|
|
|
:data="tableData"
|
|
:data="tableData"
|
|
|
highlight-current-row
|
|
highlight-current-row
|
|
|
border
|
|
border
|
|
@@ -30,8 +32,8 @@
|
|
|
<i-ep-edit/>
|
|
<i-ep-edit/>
|
|
|
编辑
|
|
编辑
|
|
|
</el-button>
|
|
</el-button>
|
|
|
- <el-button v-if="row.enable==1" link @click="handleDisable(row.id,0)" type="warning">禁用</el-button>
|
|
|
|
|
- <el-button v-if="row.enable==0" type="success" link @click="handleDisable(row.id,1)">启用</el-button>
|
|
|
|
|
|
|
+ <el-button v-if="row.storeInfo.voidFlag==0" link @click="handleDisable(row.id,1)" type="warning">禁用</el-button>
|
|
|
|
|
+ <el-button v-if="row.storeInfo.voidFlag==1" type="success" link @click="handleDisable(row.id,0)">启用</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
@@ -66,10 +68,10 @@
|
|
|
prop="status"
|
|
prop="status"
|
|
|
label="状态">
|
|
label="状态">
|
|
|
<template #default="{row}">
|
|
<template #default="{row}">
|
|
|
- <el-tag v-if="row.storeInfo.voidFlag==0" type="success">
|
|
|
|
|
|
|
+ <el-tag v-if="row.voidFlag==0" type="success">
|
|
|
正常
|
|
正常
|
|
|
</el-tag>
|
|
</el-tag>
|
|
|
- <el-tag v-else="row.storeInfo.voidFlag==1" type="danger">
|
|
|
|
|
|
|
+ <el-tag v-else="row.voidFlag==1" type="danger">
|
|
|
停用
|
|
停用
|
|
|
</el-tag>
|
|
</el-tag>
|
|
|
</template>
|
|
</template>
|
|
@@ -85,17 +87,25 @@
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
|
|
+ <pagination
|
|
|
|
|
+ v-if="total > 0"
|
|
|
|
|
+ v-model:total="total"
|
|
|
|
|
+ v-model:page="queryPage.pageIndex"
|
|
|
|
|
+ v-model:limit="queryPage.pageSize"
|
|
|
|
|
+ @pagination="getTableData"
|
|
|
|
|
+ />
|
|
|
</div>
|
|
</div>
|
|
|
-<!-- <child-dialog ref="childDialog" @dialogChange="dialogChange"></child-dialog>-->
|
|
|
|
|
|
|
+ <child-dialog ref="childDialog" @dialogChange="dialogChange"></child-dialog>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
-import {queryViewStoreInfo} from "@/api/store";
|
|
|
|
|
-// import ChildDialog from './compt/childDialog.vue'
|
|
|
|
|
|
|
+import {queryViewStoreInfo,voidStoreBrand} from "@/api/store";
|
|
|
|
|
+import ChildDialog from './compt/childDialog.vue'
|
|
|
|
|
+import {useTable} from '@/hooks/useTable'
|
|
|
|
|
|
|
|
let disableLock = ref('')
|
|
let disableLock = ref('')
|
|
|
const childDialog = ref<any>()
|
|
const childDialog = ref<any>()
|
|
|
-let tableData = ref([])
|
|
|
|
|
|
|
+
|
|
|
//增加编辑
|
|
//增加编辑
|
|
|
function openDialog(item?: any) {
|
|
function openDialog(item?: any) {
|
|
|
childDialog.value.dialogVisible = true;
|
|
childDialog.value.dialogVisible = true;
|
|
@@ -113,43 +123,61 @@ function openDialog(item?: any) {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-function getTableData() {
|
|
|
|
|
- const params = {}
|
|
|
|
|
- queryViewStoreInfo(params).then((response) => {
|
|
|
|
|
- if (response.httpCode == 200) {
|
|
|
|
|
- const { data } = response
|
|
|
|
|
- console.log(data);
|
|
|
|
|
- tableData.value = data
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
-}
|
|
|
|
|
-function handleSearch() {
|
|
|
|
|
|
|
|
|
|
-}
|
|
|
|
|
|
|
+//禁用删除
|
|
|
function handleDisable(id, status) {
|
|
function handleDisable(id, status) {
|
|
|
|
|
+ ElMessageBox.confirm("确认操作?", "警告", {
|
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
|
+ type: "warning",
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ const postData = {
|
|
|
|
|
+ id: id,
|
|
|
|
|
+ voidFlag: status
|
|
|
|
|
+ }
|
|
|
|
|
+ const params = {
|
|
|
|
|
+ "storeBrand": JSON.stringify(postData)
|
|
|
|
|
+ }
|
|
|
|
|
+ voidStoreBrand(params).then((response) => {
|
|
|
|
|
+ if (response.httpCode == 200) {
|
|
|
|
|
+ ElMessage.success("操作成功");
|
|
|
|
|
+ getTableData();
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
-function refreshTableInfo() {
|
|
|
|
|
|
|
|
|
|
|
|
+//修改成功后传递事件
|
|
|
|
|
+function dialogChange() {
|
|
|
|
|
+ getTableData()
|
|
|
}
|
|
}
|
|
|
-onMounted(() => {
|
|
|
|
|
- getTableData();
|
|
|
|
|
-});
|
|
|
|
|
|
|
+
|
|
|
const queryForm = reactive({
|
|
const queryForm = reactive({
|
|
|
keyWord: '',
|
|
keyWord: '',
|
|
|
- enable: 1
|
|
|
|
|
|
|
+ voidFlag: 0
|
|
|
})
|
|
})
|
|
|
watch(
|
|
watch(
|
|
|
() => disableLock.value,
|
|
() => disableLock.value,
|
|
|
(disableLock) => {
|
|
(disableLock) => {
|
|
|
if (disableLock) {
|
|
if (disableLock) {
|
|
|
- queryForm.enable = 0
|
|
|
|
|
|
|
+ queryForm.voidFlag = 1
|
|
|
getTableData()
|
|
getTableData()
|
|
|
} else {
|
|
} else {
|
|
|
- queryForm.enable = 1
|
|
|
|
|
|
|
+ queryForm.voidFlag = 0
|
|
|
getTableData()
|
|
getTableData()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
);
|
|
);
|
|
|
|
|
+const {
|
|
|
|
|
+ tableData,
|
|
|
|
|
+ queryPage,
|
|
|
|
|
+ total,
|
|
|
|
|
+ loading,
|
|
|
|
|
+ getTableData,
|
|
|
|
|
+ tableHeight,
|
|
|
|
|
+ handleSearch,//搜索
|
|
|
|
|
+ refreshTableInfo,//刷新
|
|
|
|
|
+} = useTable(queryViewStoreInfo, queryForm);
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|