|
@@ -1,9 +1,11 @@
|
|
|
<script setup lang="ts">
|
|
|
-import { ref, unref } from "vue";
|
|
|
+import { ref } from "vue";
|
|
|
+import { usePermission } from "/@/hooks/usePermission";
|
|
|
+import EditModel from "./components/edit-dialog.vue";
|
|
|
import { PageSearch, usePageSearch } from "/@/components/PageSearch";
|
|
|
import searchConfig from "./config/search.config";
|
|
|
import contentConfig from "./config/content.config";
|
|
|
-// import PageAuth from "/@/components/PageAuth";
|
|
|
+
|
|
|
import { PageModal, usePageModal } from "/@/components/PageModalShell";
|
|
|
import modalConfig from "./config/modal.config";
|
|
|
import { PageContent } from "/@/components/PageContent";
|
|
@@ -17,17 +19,18 @@ import {
|
|
|
createDefaultData
|
|
|
} from "/@/components/BasicForm";
|
|
|
|
|
|
-import addModel from "./cpns/addModel.vue";
|
|
|
+import addModel from "./components/addModel.vue";
|
|
|
import { useResponseHandle } from "/@/hooks/useAsync";
|
|
|
-import LadderModal from "./cpns/ladder-modal.vue";
|
|
|
-import LadderTable from "./cpns/ladder-table.vue";
|
|
|
+import LadderTable from "./components/ladder-table.vue";
|
|
|
import { ComCard } from "/@/components/RemoteSelect";
|
|
|
import OrderDialog from "/@/components/PageListModal";
|
|
|
import { ElForm, ElMessage } from "element-plus";
|
|
|
import ListModal from "/@/components/ListModal";
|
|
|
+const pageName = "exchangeStock";
|
|
|
+const { hasPermissionWithCode, permissions } = usePermission(pageName);
|
|
|
+const modelRef = ref<InstanceType<typeof EditModel>>(null);
|
|
|
const responseHandle = useResponseHandle();
|
|
|
-const ladderModalRef = ref<InstanceType<typeof LadderModal>>(null);
|
|
|
-const modelRef = ref<InstanceType<typeof OrderDialog>>(null);
|
|
|
+const modelOrderRef = ref<InstanceType<typeof OrderDialog>>(null);
|
|
|
const actionModalRef = ref<InstanceType<typeof addModel>>(null);
|
|
|
const { pageContentRef, handleResetClick, handleSearchClick } = usePageSearch(
|
|
|
undefined,
|
|
@@ -79,7 +82,7 @@ async function handleDetailData(id, type) {
|
|
|
}
|
|
|
function modularShow() {
|
|
|
if (!formData.value.group_id) return ElMessage.warning("请选择公司卡类型!");
|
|
|
- modelRef.value.show(formData.value.group_id, "1");
|
|
|
+ modelOrderRef.value.show(formData.value.group_id, "1");
|
|
|
}
|
|
|
function handleAddOrder(list) {
|
|
|
console.log(list);
|
|
@@ -103,61 +106,75 @@ function aa(id) {
|
|
|
console.log(id);
|
|
|
ListModalRef.value.show(id);
|
|
|
}
|
|
|
+function handleAddChangeCheck(item: any, id: string, type: string) {
|
|
|
+ modelRef.value.show(item, id, type);
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
- <!-- <PageAuth :pageName="pageName"> -->
|
|
|
- <PageSearch
|
|
|
- :form-config="searchConfig"
|
|
|
- @search-btn-click="handleSearchClick"
|
|
|
- @reset-btn-click="handleResetClick"
|
|
|
- />
|
|
|
- <PageContent
|
|
|
- ref="pageContentRef"
|
|
|
- :content-config="contentConfig"
|
|
|
- @create-btn-click="handleCreateData"
|
|
|
- @preview-btn-click="({ id }) => handleDetailData(id, 'preview')"
|
|
|
- @update-btn-click="({ id }) => handleDetailData(id, 'update')"
|
|
|
- @log-btn-click="({ id }) => aa(id)"
|
|
|
- />
|
|
|
-
|
|
|
- <PageModal
|
|
|
- ref="pageModalRef"
|
|
|
- :modal-config="modalConfig"
|
|
|
- :default-info="defaultInfo"
|
|
|
- @confirm-btn-click="handleConfrim"
|
|
|
- >
|
|
|
- <BasicForm
|
|
|
- ref="basicFormRef"
|
|
|
- v-bind="projectFormConfig"
|
|
|
- :form-data="formData"
|
|
|
- :rules="projectFormRules"
|
|
|
- :disabled="false"
|
|
|
- label-width="120px"
|
|
|
+ <PageAuth :pageName="pageName">
|
|
|
+ <PageSearch
|
|
|
+ :form-config="searchConfig"
|
|
|
+ @search-btn-click="handleSearchClick"
|
|
|
+ @reset-btn-click="handleResetClick"
|
|
|
>
|
|
|
- <template #group_id>
|
|
|
- <ComCard v-model="formData.group_id" placeholder="公司卡类型" />
|
|
|
+ <template #action>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="handleAddChangeCheck({}, '', 'create')"
|
|
|
+ v-if="hasPermissionWithCode('002')"
|
|
|
+ >
|
|
|
+ 新增
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
+ </PageSearch>
|
|
|
+ <PageContent
|
|
|
+ ref="pageContentRef"
|
|
|
+ :powers="permissions"
|
|
|
+ :content-config="contentConfig"
|
|
|
+ @preview-btn-click="row => handleAddChangeCheck(row, row.id, 'view')"
|
|
|
+ @update-btn-click="row => handleAddChangeCheck(row, row.id, 'edit')"
|
|
|
+ @log-btn-click="({ id }) => aa(id)"
|
|
|
+ />
|
|
|
|
|
|
- <template #list>
|
|
|
- <LadderTable
|
|
|
- :readonly="false"
|
|
|
- :ladder="formData.list"
|
|
|
- @choose="() => modularShow()"
|
|
|
- @update="({ data, index }) => ladderModalRef.onDisplay(data, index)"
|
|
|
- @delete="index => formData.list.splice(index, 1)"
|
|
|
- />
|
|
|
- </template>
|
|
|
- <template #footer>
|
|
|
- <div class="w-full flex justify-end">
|
|
|
- <ElButton type="primary" @click="handleCreate">保存</ElButton>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </BasicForm>
|
|
|
- </PageModal>
|
|
|
-
|
|
|
- <OrderDialog ref="modelRef" @save-btn-click="handleAddOrder" />
|
|
|
- <addModel ref="actionModalRef" @submitOk="Create" />
|
|
|
- <ListModal ref="ListModalRef" :modalConfig="ListModalConfig" />
|
|
|
- <!-- </PageAuth> -->
|
|
|
+ <PageModal
|
|
|
+ ref="pageModalRef"
|
|
|
+ :modal-config="modalConfig"
|
|
|
+ :default-info="defaultInfo"
|
|
|
+ @confirm-btn-click="handleConfrim"
|
|
|
+ >
|
|
|
+ <BasicForm
|
|
|
+ ref="basicFormRef"
|
|
|
+ v-bind="projectFormConfig"
|
|
|
+ :form-data="formData"
|
|
|
+ :rules="projectFormRules"
|
|
|
+ :disabled="false"
|
|
|
+ label-width="120px"
|
|
|
+ >
|
|
|
+ <template #group_id>
|
|
|
+ <ComCard v-model="formData.group_id" placeholder="公司卡类型" />
|
|
|
+ </template>
|
|
|
+ <!-- //ladderModalRef.onDisplay(data, -->
|
|
|
+ <!-- index)" =>formData.list.splice(index, 1)" -->
|
|
|
+ <template #list>
|
|
|
+ <LadderTable
|
|
|
+ :readonly="false"
|
|
|
+ :ladder="formData.list"
|
|
|
+ @choose="() => modularShow()"
|
|
|
+ @update="({ data, index }) => formData.list.splice(index, 1)"
|
|
|
+ @delete="index => formData.list.splice(index, 1)"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ <template #footer>
|
|
|
+ <div class="w-full flex justify-end">
|
|
|
+ <ElButton type="primary" @click="handleCreate">保存</ElButton>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </BasicForm>
|
|
|
+ </PageModal>
|
|
|
+ <EditModel ref="modelRef" @reload="pageContentRef.onSearch()" />
|
|
|
+ <OrderDialog ref="modelOrderRef" @save-btn-click="handleAddOrder" />
|
|
|
+ <!-- <addModel ref="actionModalRef" @submitOk="Create" /> -->
|
|
|
+ <ListModal ref="ListModalRef" :modalConfig="ListModalConfig" />
|
|
|
+ </PageAuth>
|
|
|
</template>
|