feat: 🚀 订阅功能
This commit is contained in:
80
src/views/foundation/subscribe/warehousing/index.vue
Normal file
80
src/views/foundation/subscribe/warehousing/index.vue
Normal file
@@ -0,0 +1,80 @@
|
||||
<!-- 质检单 -->
|
||||
<template>
|
||||
<div class="table-box">
|
||||
<div style="padding-bottom: 16px">
|
||||
<PermissionButton
|
||||
:buttons="dataStore.buttons"
|
||||
@handleButtonClickCallback="handleButtonClickCallback"
|
||||
></PermissionButton>
|
||||
</div>
|
||||
|
||||
<ProTable
|
||||
ref="proTable"
|
||||
:columns="dataStore.columns"
|
||||
:request-api="getMaterialListApi"
|
||||
:init-param="dataStore.initParam"
|
||||
@selectionChange="selectionChange"
|
||||
>
|
||||
<template v-slot:search>
|
||||
<SearchForm
|
||||
@search="handleSearch"
|
||||
@reset="handleReset"
|
||||
:searchParams="dataStore.initParam"
|
||||
:formData="dataStore.formData"
|
||||
/>
|
||||
</template>
|
||||
</ProTable>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="foundationSubscribeWarehousing">
|
||||
import ProTable from "@/components/ProTable/index.vue";
|
||||
|
||||
// import { useMsg } from "@/hooks/useMsg";
|
||||
import PermissionButton from "@/components/PermissionButton/index.vue";
|
||||
import { getMaterialListApi } from "@/api/modules/foundationMaterial";
|
||||
import SearchForm from "@/components/SearchForm/index.vue";
|
||||
import { RULE_FORM, FORM_DATA, COLUMNS, BUTTON } from "./constant/list/index";
|
||||
//表格TS
|
||||
import { ProTableInstance } from "@/components/ProTable/interface";
|
||||
import { useUserStore } from "@/stores/modules/user";
|
||||
import { btnClick } from "./init";
|
||||
//深拷贝方法
|
||||
import { cloneDeep } from "lodash-es";
|
||||
// 获取 ProTable 元素,调用其获取刷新数据方法(还能获取到当前查询参数,方便导出携带参数)
|
||||
const proTable = ref<ProTableInstance>();
|
||||
|
||||
// 获取用户信息(组织id)
|
||||
const userStore = useUserStore();
|
||||
// 数据源
|
||||
const dataStore = reactive<any>({
|
||||
columns: COLUMNS, //列表配置项
|
||||
initParam: cloneDeep(RULE_FORM), // 初始化搜索条件|重置搜索条件
|
||||
ruleForm: cloneDeep(RULE_FORM), // 搜索条件
|
||||
formData: FORM_DATA, //搜索配置项
|
||||
buttons: cloneDeep(BUTTON),
|
||||
options: [], //规格型号
|
||||
selectionList: [], //选中表格的行
|
||||
loading: false
|
||||
});
|
||||
//设置组织数组
|
||||
dataStore.formData[5].options = userStore.orgIdArr;
|
||||
// 表格选择事件
|
||||
const selectionChange = (selection: any) => {
|
||||
dataStore.selectionList = selection;
|
||||
};
|
||||
const handleButtonClickCallback = (item: any) => {
|
||||
const { type } = item;
|
||||
btnClick[type](item, dataStore.selectionList, proTable);
|
||||
};
|
||||
const handleSearch = () => {};
|
||||
const handleReset = () => {};
|
||||
</script>
|
||||
|
||||
<style scope lang="scss">
|
||||
.down-dialog-box {
|
||||
.el-dialog__body {
|
||||
padding: 0 16px 40px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user