<template>
|
<div class="adapterCategories-container">
|
<el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
|
<el-form :model="queryParamsAdapterCategories" ref="queryForm" labelWidth="90">
|
<el-row>
|
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10">
|
<el-form-item label="关键字">
|
<el-input v-model="queryParamsAdapterCategories.searchKey" clearable="" placeholder="单据大类名称,创建人,修改人"/>
|
|
</el-form-item>
|
</el-col>
|
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIAdapterCategories">
|
<el-form-item label="单据大类名称">
|
<el-input v-model="queryParamsAdapterCategories.categoryName" clearable="" placeholder="请输入单据大类名称"/>
|
|
</el-form-item>
|
</el-col>
|
<el-col :xs="24" :sm="12" :md="12" :lg="8" :xl="4" class="mb10" v-if="showAdvanceQueryUIAdapterCategories">
|
<el-form-item label="适配器数量">
|
<el-input-number v-model="queryParamsAdapterCategories.adapterNumber" clearable="" placeholder="请输入适配器数量"/>
|
|
</el-form-item>
|
</el-col>
|
<el-col :xs="24" :sm="12" :md="12" :lg="6" :xl="6" class="mb10">
|
<el-form-item>
|
<el-button-group style="display: flex; align-items: center;">
|
<el-button type="primary" icon="ele-Search" @click="handleQueryAdapterCategories" v-auth="'adapterCategories:page'" :disabled="disabled_btnAdapterCategories"> 查询 </el-button>
|
<el-button icon="ele-Refresh" @click="resetAdapterCategories"> 重置 </el-button>
|
<el-button icon="ele-ZoomIn" @click="changeAdvanceQueryUIAdapterCategories" v-if="!showAdvanceQueryUIAdapterCategories" style="margin-left:5px;"> 高级查询 </el-button>
|
<el-button icon="ele-ZoomOut" @click="changeAdvanceQueryUIAdapterCategories" v-if="showAdvanceQueryUIAdapterCategories" style="margin-left:5px;"> 隐藏 </el-button>
|
<el-button type="primary" style="margin-left:5px;" icon="ele-Plus" @click="openAddAdapterCategories" v-auth="'adapterCategories:add'"> 新增 </el-button>
|
<el-button type="primary" style="margin-left:5px;" icon="ele-Upload" @click="openImportExcelAdapterCategories" v-auth="'adapterCategories:importExcel'" > 导入 </el-button>
|
<el-button type="primary" style="margin-left:5px;" icon="ele-Download" @click="handleExportExcelAdapterCategories" v-auth="'adapterCategories:exportExcel'" > 导出 </el-button>
|
</el-button-group>
|
</el-form-item>
|
|
</el-col>
|
</el-row>
|
</el-form>
|
</el-card>
|
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
|
<el-table
|
ref="tableRefAdapterCategories"
|
:data="tableDataAdapterCategories"
|
style="width: 100%"
|
v-loading="loadingAdapterCategories"
|
tooltip-effect="light"
|
row-key="id"
|
@sort-change="sortChangeAdapterCategories"
|
:summary-method="getExportTitle" show-summary border="">
|
<el-table-column fixed="left" type="index" label="序号" width="55" align="center"/>
|
|
<el-table-column fixed="left" label="适配器使用记录" prop="purchaseNo" width="130" align="left" show-overflow-tooltip>
|
<template #default="scope">
|
<span class="under_line" @click="openDrawer(1, scope.row)">
|
{{ scope.row.id }}
|
</span>
|
</template>
|
</el-table-column>
|
|
<el-table-column prop="categoryName" label="单据大类名称" show-overflow-tooltip="" />
|
<el-table-column prop="adapterNumber" label="适配器数量" show-overflow-tooltip="" />
|
<el-table-column prop="createTime" label="创建时间" width="130" :formatter="formatDate_T_Time" show-overflow-tooltip="" />
|
<el-table-column prop="updateTime" label="修改时间" width="130" :formatter="formatDate_T_Time" show-overflow-tooltip="" />
|
<el-table-column prop="createUserName" label="创建人" show-overflow-tooltip="" />
|
<el-table-column prop="updateUserName" label="修改人" show-overflow-tooltip="" />
|
<el-table-column label="操作" width="140" align="center" fixed="right" show-overflow-tooltip="" v-if="auth('adapterCategories:update') || auth('adapterCategories:delete')">
|
<template #default="scope">
|
<el-button icon="ele-Edit" size="small" text="" type="primary" @click="openEditAdapterCategories(scope.row)" v-auth="'adapterCategories:update'"> 编辑 </el-button>
|
<el-button icon="ele-Delete" size="small" text="" type="primary" @click="delAdapterCategories(scope.row)" v-auth="'adapterCategories:delete'"> 删除 </el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
<el-pagination
|
v-model:currentPage="tableParamsAdapterCategories.page"
|
v-model:page-size="tableParamsAdapterCategories.pageSize"
|
:total="tableParamsAdapterCategories.total"
|
:page-sizes="[10, 20, 50, 100, 200, 500]"
|
small=""
|
background=""
|
@size-change="handleSizeChangeAdapterCategories"
|
@current-change="handleCurrentChangeAdapterCategories"
|
layout="total, sizes, prev, pager, next, jumper"
|
/>
|
<printDialogAdapterCategories
|
ref="printDialogRefAdapterCategories"
|
:title="printAdapterCategoriesTitle"
|
@reloadTable="handleQueryAdapterCategories" />
|
<editDialogAdapterCategories
|
ref="editDialogRefAdapterCategories"
|
:title="editAdapterCategoriesTitle"
|
@reloadTable="handleQueryAdapterCategories"
|
/>
|
<importExcelDialog
|
ref="importExcelDialogRefAdapterCategories"
|
:title="importExcelTitleAdapterCategories"
|
@parentUploadFun="handleImportExcelAdapterCategories"
|
@parentDownFun="handleDownExcelAdapterCategories"
|
/>
|
</el-card>
|
<open-allprop titleAuthor="1" hexiao="0" ref="propALlProp" @getTabelData="handleQuery"></open-allprop>
|
</div>
|
</template>
|
|
<script lang="ts" setup="" name="adapterCategories">
|
import { ref , getCurrentInstance, nextTick, onMounted} from "vue";
|
import { ElMessageBox, ElMessage } from "element-plus";
|
import { auth } from '/@/utils/authFunction';
|
import { getDictDataItem as di, getDictDataList as dl } from '/@/utils/dict-utils';
|
import { formatDate,formatDate_T_Date,formatDate_T_Time,defaultTimeRange } from '/@/utils/formatTime';
|
import importExcelDialog from '/@/components/importExcel/index.vue' //引入导入组件
|
import { exportPageExcel } from '/@/utils/exportPageExcel' //引入导出方法
|
|
import { ExcellTableDataExport } from "/@/hooks/exportTableDataExcell";
|
import OpenAllprop from "./component/openAllprop.vue";
|
|
import printDialogAdapterCategories from '/@/views/system/print/component/hiprint/preview.vue'
|
import editDialogAdapterCategories from '/@/views/main/SoftwareAdapterService/adapterCategories/component/editDialog.vue'
|
import { pageAdapterCategories, deleteAdapterCategories,importExcelAdapterCategories,downloadExcelTemplateAdapterCategories,getRecordAdapterList } from '/@/api/main/SoftwareAdapterService/adapterCategories';
|
const { proxy }: any = getCurrentInstance();
|
|
|
/***************************************************[适配器大类管理操作]开始***************************************************/
|
const showAdvanceQueryUIAdapterCategories = ref(false);
|
const tableRefAdapterCategories = ref(null);
|
const printDialogRefAdapterCategories = ref();
|
const editDialogRefAdapterCategories = ref();
|
const loadingAdapterCategories = ref(false);
|
const disabled_btnAdapterCategories = ref(false);
|
const tableDataAdapterCategories = ref<any>([]);
|
const queryParamsAdapterCategories = ref<any>({});
|
const getRecordAdapterListData = ref<any>({});
|
const tableParamsAdapterCategories = ref({
|
page: 1,
|
pageSize: 10,
|
total: 0,
|
});
|
|
const printAdapterCategoriesTitle = ref("");
|
const editAdapterCategoriesTitle = ref("");
|
|
// 改变高级查询的控件显示状态
|
const changeAdvanceQueryUIAdapterCategories = () => {
|
showAdvanceQueryUIAdapterCategories.value = !showAdvanceQueryUIAdapterCategories.value;
|
}
|
|
// 查询适配器大类管理
|
const handleQueryAdapterCategories = async () => {
|
loadingAdapterCategories.value = true;
|
disabled_btnAdapterCategories.value = true;
|
var res = await pageAdapterCategories(Object.assign(queryParamsAdapterCategories.value, tableParamsAdapterCategories.value));
|
if(res.data.type=="success"){
|
tableDataAdapterCategories.value = res.data.result?.items ?? [];
|
tableParamsAdapterCategories.value.total = res.data.result?.total;
|
}
|
loadingAdapterCategories.value = false;
|
disabled_btnAdapterCategories.value = false;
|
};
|
//通过适配器大类id获取适配器使用记录详情
|
// const getAdapterLogDetails = async() =>{
|
// var ddd = await getRecordAdapterList();
|
// //getRecordAdapterListData.value = await getRecordAdapterList();
|
// };
|
|
// 重置适配器大类管理查询
|
const resetAdapterCategories = async () => {
|
queryParamsAdapterCategories.value = {}
|
};
|
|
// 适配器大类管理列排序
|
const sortChangeAdapterCategories = async (column: any) => {
|
queryParamsAdapterCategories.value.field = column.prop;
|
queryParamsAdapterCategories.value.order = column.order;
|
await handleQueryAdapterCategories();
|
};
|
|
// 打开新增适配器大类管理页面
|
const openAddAdapterCategories = () => {
|
editAdapterCategoriesTitle.value = '添加适配器大类管理';
|
editDialogRefAdapterCategories.value.openDialog(1,{});
|
};
|
|
// 打开打印适配器大类管理页面
|
const openPrintAdapterCategories = async (row: any) => {
|
printAdapterCategoriesTitle.value = '打印适配器大类管理';
|
}
|
|
// 打开编辑适配器大类管理页面
|
const openEditAdapterCategories = (row: any) => {
|
editAdapterCategoriesTitle.value = '编辑适配器大类管理';
|
editDialogRefAdapterCategories.value.openDialog(2,row);
|
};
|
|
// 删除适配器大类管理
|
const delAdapterCategories = (row: any) => {
|
ElMessageBox.confirm(`确定要删除吗?`, "提示", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning",
|
})
|
.then(async () => {
|
loadingAdapterCategories.value = true;
|
var ret = await deleteAdapterCategories(row);
|
if(ret.data.type=="success"){
|
ElMessage.success("删除成功");
|
}
|
loadingAdapterCategories.value = false;
|
handleQueryAdapterCategories();
|
})
|
.catch(() => {});
|
};
|
|
// 改变适配器大类管理页面容量
|
const handleSizeChangeAdapterCategories = (val: number) => {
|
tableParamsAdapterCategories.value.pageSize = val;
|
handleQueryAdapterCategories();
|
};
|
|
|
const moveType = 10;//移动类型 入库
|
// ------------封装导出功能--前端导出+表格标题---------------
|
const jsonExcellTableExport = {
|
titleName: "", //导出表格名称
|
interfaceListName: '',//导出接口名称
|
}
|
const { getExportTitle, handleExportExcell, formExport, entozhExcell } = ExcellTableDataExport(jsonExcellTableExport)
|
// --------------end 封装导出功能--前端导出+表格标题-----------------
|
// ---------------新增-----------------------
|
const showProp = (item?: any) => {
|
if (item == 1) {
|
proxy.$refs['propALlProp'].openDialog(1);
|
} else {
|
proxy.$refs['propALlProp'].openDialog(2, item);
|
}
|
}
|
// ---------------详情-----------------------
|
const openDrawer = (type: number, item?: any) => {
|
|
proxy.$refs['propALlProp'].openDrawer(type, item, entozhExcell);
|
}
|
|
// 改变适配器大类管理页码序号
|
const handleCurrentChangeAdapterCategories = (val: number) => {
|
tableParamsAdapterCategories.value.page = val;
|
handleQueryAdapterCategories();
|
};
|
|
/***************************************************[适配器大类管理操作]结束***************************************************/
|
/***************************************************[适配器大类管理导入]开始***************************************************/
|
const importExcelTitleAdapterCategories = ref("");
|
const importExcelDialogRefAdapterCategories = ref();
|
//打开导入界面
|
const openImportExcelAdapterCategories = () => {
|
importExcelTitleAdapterCategories.value = '导入适配器大类管理';
|
importExcelDialogRefAdapterCategories.value.openDialog({});
|
};
|
//导入数据
|
const handleImportExcelAdapterCategories = async (formData:Blob) => {
|
var result = await importExcelAdapterCategories(formData);
|
importExcelDialogRefAdapterCategories.value.callBackUploadFun(result.data);//回调导入子页面的方法
|
if(result.data.type=="success"){
|
handleQueryAdapterCategories();
|
}
|
};
|
//下载导入模板
|
const handleDownExcelAdapterCategories = async () => {
|
var result = await downloadExcelTemplateAdapterCategories();
|
importExcelDialogRefAdapterCategories.value.callBackDownFun(result);//回调导入子页面的方法
|
};
|
/***************************************************[适配器大类管理导入]结束***************************************************/
|
/***************************************************[适配器大类管理导出]开始***************************************************/
|
//定义当前页面的方法组
|
const functionMapAdapterCategories = {
|
formatDate_T_Date,
|
formatDate_T_Time
|
};
|
//点击导出按钮
|
const handleExportExcelAdapterCategories = async (formData:Blob) => {
|
loadingAdapterCategories.value = true;
|
disabled_btnAdapterCategories.value = true;
|
var new_tableParamsAdapterCategories=JSON.parse(JSON.stringify(tableParamsAdapterCategories.value));
|
new_tableParamsAdapterCategories.page = 1;
|
new_tableParamsAdapterCategories.pageSize = 100000;
|
var res = await pageAdapterCategories(Object.assign(queryParamsAdapterCategories.value, new_tableParamsAdapterCategories));
|
if(res.data.type=="success"){
|
exportExcelAdapterCategories(res.data.result?.items ?? []);
|
}
|
loadingAdapterCategories.value = false;
|
disabled_btnAdapterCategories.value = false;
|
};
|
//导出
|
const exportExcelAdapterCategories = async (exportDataList:Array) => {
|
exportPageExcel(exportDataList, tableRefAdapterCategories,"适配器大类管理",functionMapAdapterCategories);
|
};
|
/***************************************************[适配器大类管理导出]结束***************************************************/
|
// 适配器大类管理页面加载时
|
onMounted(async () => {
|
});
|
|
handleQueryAdapterCategories();
|
</script>
|
<style scoped>
|
:deep(.el-input),
|
:deep(.el-select),
|
:deep(.el-input-number) {
|
width: 100%;
|
}
|
|
.under_line {
|
color: #F18201;
|
text-decoration: underline;
|
cursor: pointer;
|
}
|
</style>
|