feat: 🚀 订阅功能
This commit is contained in:
7
src/views/foundation/set/data/constant/list/button.ts
Normal file
7
src/views/foundation/set/data/constant/list/button.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export const BUTTON = [
|
||||
{
|
||||
text: "导出",
|
||||
permission: "reportManagementInstantBtnExport",
|
||||
type: "export"
|
||||
}
|
||||
];
|
||||
4
src/views/foundation/set/data/constant/list/index.ts
Normal file
4
src/views/foundation/set/data/constant/list/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import { FORM_DATA, RULE_FORM } from "./search";
|
||||
import { COLUMNS } from "./table";
|
||||
import { BUTTON } from "./button";
|
||||
export { FORM_DATA, RULE_FORM, COLUMNS, BUTTON };
|
||||
80
src/views/foundation/set/data/constant/list/search.ts
Normal file
80
src/views/foundation/set/data/constant/list/search.ts
Normal file
@@ -0,0 +1,80 @@
|
||||
interface FormItem {
|
||||
prop: string;
|
||||
label?: string;
|
||||
placeholder?: string;
|
||||
type: string;
|
||||
isCopy?: boolean;
|
||||
optionProps?: any;
|
||||
startPlaceholder?: string;
|
||||
endPlaceholder?: string;
|
||||
options?: any;
|
||||
isArray?: boolean;
|
||||
startDate?: string; //开始时间(传入后台需要的参数)
|
||||
endDate?: string; //结束时间(传入后台需要的参数)
|
||||
startProp?: string;
|
||||
endProp?: string;
|
||||
isInteger?: boolean;
|
||||
}
|
||||
export const FORM_DATA: FormItem[] = [
|
||||
{
|
||||
prop: "securityNumbers",
|
||||
placeholder: "请输入来源单号",
|
||||
type: "input",
|
||||
isArray: true,
|
||||
label: "来源单号: "
|
||||
},
|
||||
{
|
||||
prop: "lotNumbers",
|
||||
placeholder: "请选择供应商",
|
||||
type: "select",
|
||||
isArray: true,
|
||||
label: "供应商: ",
|
||||
options: []
|
||||
},
|
||||
{
|
||||
prop: "securityNumbers",
|
||||
placeholder: "请输入质检人",
|
||||
type: "input",
|
||||
isArray: true,
|
||||
label: "质检人: "
|
||||
},
|
||||
{
|
||||
prop: "Time",
|
||||
type: "daterange",
|
||||
options: [],
|
||||
startPlaceholder: "质检开始日期",
|
||||
endPlaceholder: "质检结束日期",
|
||||
startDate: "createBeginDate",
|
||||
endDate: "createEndDate",
|
||||
label: "质检时间: "
|
||||
},
|
||||
{
|
||||
prop: "lotNumbers",
|
||||
placeholder: "请选择组织",
|
||||
type: "select",
|
||||
isArray: true,
|
||||
label: "组织: "
|
||||
},
|
||||
|
||||
{
|
||||
prop: "materialNumber",
|
||||
placeholder: "请输入規格型号",
|
||||
type: "selectRemote1",
|
||||
isArray: true,
|
||||
options: [],
|
||||
label: "物料编码: "
|
||||
},
|
||||
{
|
||||
prop: "lotNumbers",
|
||||
placeholder: "请选择质检状态",
|
||||
type: "select",
|
||||
isArray: true,
|
||||
label: "质检状态: "
|
||||
}
|
||||
];
|
||||
|
||||
export const RULE_FORM = {
|
||||
page: 1,
|
||||
size: 50,
|
||||
orgCode: 0
|
||||
};
|
||||
107
src/views/foundation/set/data/constant/list/table.ts
Normal file
107
src/views/foundation/set/data/constant/list/table.ts
Normal file
@@ -0,0 +1,107 @@
|
||||
export const COLUMNS = [
|
||||
{ type: "selection", fixed: "left", width: 40 },
|
||||
{
|
||||
align: "left",
|
||||
fixed: true,
|
||||
label: "质检单",
|
||||
prop: "securityNumber",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "质检状态",
|
||||
prop: "id",
|
||||
width: 160
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "销售订单号",
|
||||
prop: "specifications",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "来源单号",
|
||||
prop: "createTime",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "下载次数",
|
||||
prop: "downLoadNumber",
|
||||
width: 80
|
||||
},
|
||||
|
||||
{
|
||||
align: "left",
|
||||
label: "质检类型",
|
||||
prop: "downLoadTime",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "供应商",
|
||||
prop: "downLoadTime",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "组织",
|
||||
prop: "downLoadTime",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "规格型号",
|
||||
prop: "downLoadTime",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "物料编码",
|
||||
prop: "downLoadTime",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "物料名称",
|
||||
prop: "downLoadTime",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "应质检数量",
|
||||
prop: "downLoadTime",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "良品数",
|
||||
prop: "downLoadTime",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "次品数",
|
||||
prop: "downLoadTime",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "质检人",
|
||||
prop: "downLoadTime",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "质检时间",
|
||||
prop: "downLoadTime",
|
||||
width: 200
|
||||
},
|
||||
{
|
||||
align: "left",
|
||||
label: "创建时间",
|
||||
prop: "downLoadTime",
|
||||
width: 200
|
||||
}
|
||||
];
|
||||
102
src/views/foundation/set/data/index.vue
Normal file
102
src/views/foundation/set/data/index.vue
Normal file
@@ -0,0 +1,102 @@
|
||||
<!-- 质检单 -->
|
||||
<template>
|
||||
<div class="table-box">
|
||||
<div style="padding-bottom: 16px">
|
||||
<PermissionButton
|
||||
:buttons="dataStore.buttons"
|
||||
@handleButtonClickCallback="handleButtonClickCallback"
|
||||
></PermissionButton>
|
||||
</div>
|
||||
|
||||
<ProTable
|
||||
ref="proTable"
|
||||
:formData="dataStore.formData"
|
||||
:columns="dataStore.columns"
|
||||
:request-api="getMaterialListApi"
|
||||
:init-param="dataStore.initParam"
|
||||
@selectionChange="selectionChange"
|
||||
:orgCode="dataStore.ruleForm.orgCode"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="foundationSetData">
|
||||
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 { useAuthStore } from "@/stores/modules/auth";
|
||||
|
||||
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
|
||||
});
|
||||
|
||||
// 表格选择事件
|
||||
const selectionChange = (selection: any) => {
|
||||
dataStore.selectionList = selection;
|
||||
};
|
||||
const handleButtonClickCallback = (item: any) => {
|
||||
const { type } = item;
|
||||
btnClick[type](item);
|
||||
};
|
||||
// // 规格型号
|
||||
// const remoteMethod1 = async (query: any) => {
|
||||
// datas.loading = true;
|
||||
// if (!query) {
|
||||
// datas.loading = false;
|
||||
// return;
|
||||
// }
|
||||
// let valClone = query.replace(/^\s*|\s*$/g, "");
|
||||
// if (!valClone.length) {
|
||||
// datas.loading = false;
|
||||
// return;
|
||||
// }
|
||||
// const result = await getMaterialListApi(valClone);
|
||||
// if (result.status === 200) {
|
||||
// const { data } = result;
|
||||
// datas.options = data;
|
||||
// }
|
||||
// datas.loading = false;
|
||||
// };
|
||||
|
||||
watch(
|
||||
() => userStore.orgCode,
|
||||
newVal => {
|
||||
dataStore.ruleForm.orgCode = newVal;
|
||||
dataStore.initParam.orgCode = newVal;
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
deep: true
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<style scope lang="scss">
|
||||
.down-dialog-box {
|
||||
.el-dialog__body {
|
||||
padding: 0 16px 40px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
13
src/views/foundation/set/data/init/btnClick.ts
Normal file
13
src/views/foundation/set/data/init/btnClick.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
// 直接导出函数,无需额外包装对象
|
||||
export const handleExport = (item: any) => {
|
||||
console.log("导出操作", item);
|
||||
};
|
||||
|
||||
export const handleRefresh = (item: any) => {
|
||||
console.log("刷新操作", item);
|
||||
};
|
||||
|
||||
export const btnClick: any = {
|
||||
export: handleExport,
|
||||
refresh: handleRefresh
|
||||
};
|
||||
2
src/views/foundation/set/data/init/index.ts
Normal file
2
src/views/foundation/set/data/init/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
import { btnClick } from "./btnClick";
|
||||
export { btnClick };
|
||||
Reference in New Issue
Block a user