Merge remote-tracking branch 'origin/master'
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 2.5 KiB |
|
@ -0,0 +1,72 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/configMaterialInfo/configMaterialInfo/list',
|
||||
save='/configMaterialInfo/configMaterialInfo/add',
|
||||
edit='/configMaterialInfo/configMaterialInfo/edit',
|
||||
deleteOne = '/configMaterialInfo/configMaterialInfo/delete',
|
||||
deleteBatch = '/configMaterialInfo/configMaterialInfo/deleteBatch',
|
||||
importExcel = '/configMaterialInfo/configMaterialInfo/importExcel',
|
||||
exportXls = '/configMaterialInfo/configMaterialInfo/exportXls',
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出api
|
||||
* @param params
|
||||
*/
|
||||
export const getExportUrl = Api.exportXls;
|
||||
|
||||
/**
|
||||
* 导入api
|
||||
*/
|
||||
export const getImportUrl = Api.importExcel;
|
||||
|
||||
/**
|
||||
* 列表接口
|
||||
* @param params
|
||||
*/
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
/**
|
||||
* 删除单个
|
||||
* @param params
|
||||
* @param handleSuccess
|
||||
*/
|
||||
export const deleteOne = (params,handleSuccess) => {
|
||||
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param params
|
||||
* @param handleSuccess
|
||||
*/
|
||||
export const batchDelete = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存或者更新
|
||||
* @param params
|
||||
* @param isUpdate
|
||||
*/
|
||||
export const saveOrUpdate = (params, isUpdate) => {
|
||||
let url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
||||
}
|
|
@ -0,0 +1,109 @@
|
|||
import {BasicColumn} from '/@/components/Table';
|
||||
import {FormSchema} from '/@/components/Table';
|
||||
import { rules} from '/@/utils/helper/validator';
|
||||
import { render } from '/@/utils/common/renderUtils';
|
||||
import { getWeekMonthQuarterYear } from '/@/utils';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '货品名称',
|
||||
align: "center",
|
||||
dataIndex: 'materialName'
|
||||
},
|
||||
{
|
||||
title: '货品编码',
|
||||
align: "center",
|
||||
dataIndex: 'materialNo',
|
||||
width:'100px'
|
||||
},
|
||||
{
|
||||
title: '规格型号',
|
||||
align: "center",
|
||||
dataIndex: 'specificationModel'
|
||||
},
|
||||
{
|
||||
title: '销售单价',
|
||||
align: "center",
|
||||
dataIndex: 'salesUnitPrice',
|
||||
width:'100px'
|
||||
},
|
||||
{
|
||||
title: '参考单价',
|
||||
align: "center",
|
||||
dataIndex: 'referenceUnitPrice',
|
||||
width:'100px'
|
||||
},
|
||||
{
|
||||
title: '货品单位',
|
||||
align: "center",
|
||||
dataIndex: 'materialUnits',
|
||||
width:'100px'
|
||||
},
|
||||
{
|
||||
title: '供应商',
|
||||
align: "center",
|
||||
dataIndex: 'suppliers_dictText',
|
||||
width:'200px'
|
||||
},
|
||||
{
|
||||
title: '物料类别',
|
||||
align: "center",
|
||||
dataIndex: 'categoryId_dictText',
|
||||
width:'100px'
|
||||
},
|
||||
{
|
||||
title: '物料类型',
|
||||
align: "center",
|
||||
dataIndex: 'typeId_dictText',
|
||||
width:'100px'
|
||||
},
|
||||
{
|
||||
title: '用药类型',
|
||||
align: "center",
|
||||
dataIndex: 'medicationId_dictText',
|
||||
width:'100px'
|
||||
},
|
||||
// {
|
||||
// title: '物料图片',
|
||||
// align: "center",
|
||||
// dataIndex: 'materialImg',
|
||||
// customRender: render.renderImage,
|
||||
// },
|
||||
// {
|
||||
// title: '物料标识',
|
||||
// align: "center",
|
||||
// dataIndex: 'materialIdent',
|
||||
// customRender: render.renderImage,
|
||||
// },
|
||||
{
|
||||
title: '是否启用',
|
||||
align: "center",
|
||||
dataIndex: 'izEnabled_dictText',
|
||||
width:'100px'
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
categoryId: {title: '物料类别',order: 0,view: 'radio', type: 'string',dictTable: "nu_config_material_category", dictCode: 'id', dictText: 'category_name',},
|
||||
typeId: {title: '物料类型',order: 1,view: 'radio', type: 'string',dictTable: "nu_config_material_type", dictCode: 'id', dictText: 'type_name',},
|
||||
medicationId: {title: '用药类型',order: 2,view: 'radio', type: 'string',dictTable: "nu_config_material_medication", dictCode: 'id', dictText: 'medication_name',},
|
||||
materialName: {title: '货品名称',order: 3,view: 'text', type: 'string',},
|
||||
materialNo: {title: '货品编码',order: 4,view: 'text', type: 'string',},
|
||||
specificationModel: {title: '规格型号',order: 5,view: 'text', type: 'string',},
|
||||
salesUnitPrice: {title: '销售单价',order: 6,view: 'number', type: 'number',},
|
||||
referenceUnitPrice: {title: '参考单价',order: 7,view: 'number', type: 'number',},
|
||||
materialUnits: {title: '货品单位',order: 8,view: 'text', type: 'string',},
|
||||
multiUnitSwitch: {title: '多单位开关',order: 9,view: 'switch', type: 'string',},
|
||||
oneUnit: {title: '父级单位',order: 10,view: 'text', type: 'string',},
|
||||
oneUnitProportion: {title: '父级单位兑换比例',order: 11,view: 'number', type: 'number',},
|
||||
oneUnitPrice: {title: '父级单位价格',order: 12,view: 'number', type: 'number',},
|
||||
twoUnit: {title: '爷级单位',order: 13,view: 'text', type: 'string',},
|
||||
twoUnitProportion: {title: '爷级单位兑换比例',order: 14,view: 'number', type: 'number',},
|
||||
twoUnitPrice: {title: '爷级单位价格',order: 15,view: 'number', type: 'number',},
|
||||
multiUnitType: {title: '多单位采购默认使用 0子集 1父级 2爷级',order: 16,view: 'text', type: 'string',},
|
||||
suppliers: {title: '供应商',order: 17,view: 'text', type: 'string',},
|
||||
materialImg: {title: '物料图片',order: 18,view: 'image', type: 'string',},
|
||||
materialIdent: {title: '物料标识',order: 19,view: 'image', type: 'string',},
|
||||
izEnabled: {title: '是否启用',order: 20,view: 'radio', type: 'string',dictCode: ' iz_enabled',},
|
||||
};
|
|
@ -0,0 +1,302 @@
|
|||
<template>
|
||||
<div class="p-2">
|
||||
<!--查询区域-->
|
||||
<div class="jeecg-basic-table-form-container">
|
||||
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="materialName">
|
||||
<template #label><span title="货品名称">货品名称</span></template>
|
||||
<j-input placeholder="请输入货品名称" v-model:value="queryParam.materialName" allow-clear ></j-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="materialNo">
|
||||
<template #label><span title="货品编码">货品编码</span></template>
|
||||
<j-input placeholder="请输入货品编码" v-model:value="queryParam.materialNo" allow-clear ></j-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="pinyin">
|
||||
<template #label><span title="拼音检索">拼音检索</span></template>
|
||||
<j-input placeholder="请输入拼音" v-model:value="queryParam.pinyin" allow-clear ></j-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="izEnabled">
|
||||
<template #label><span title="是否启用">是否启用</span></template>
|
||||
<j-dict-select-tag type='list' placeholder="请选择是否启用" v-model:value="queryParam.izEnabled" dictCode="iz_enabled" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
||||
<a-col :lg="6">
|
||||
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
|
||||
</a-col>
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" >
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<div style="padding:10px 0 0 0;">
|
||||
<a-badge :count="count" style="z-index: 9;" offset="-1">
|
||||
<a-button type="primary" @click="handleAdd"> 请购车</a-button>
|
||||
</a-badge>
|
||||
</div>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
</template>
|
||||
</BasicTable>
|
||||
|
||||
|
||||
<!-- 表单区域 -->
|
||||
<ConfigMaterialInfoModal ref="registerModal" @success="handleSuccess"></ConfigMaterialInfoModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="configMaterialInfo-configMaterialInfo" setup>
|
||||
import { ref, reactive,onMounted } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, superQuerySchema } from './JxcInfo.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './JxcInfo.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import ConfigMaterialInfoModal from '/@/views/invoicing/ConfigMaterial/components/ConfigMaterialInfoModal.vue'
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import JSwitch from '/@/components/Form/src/jeecg/components/JSwitch.vue';
|
||||
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
|
||||
import { JInput } from '/@/components/Form';
|
||||
import type { TreeProps } from 'ant-design-vue';
|
||||
import { DownOutlined } from '@ant-design/icons-vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import type { CollapseProps } from 'ant-design-vue';
|
||||
|
||||
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
const userStore = useUserStore();
|
||||
const count = ref<number>(5);
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '物料信息',
|
||||
api: list,
|
||||
columns,
|
||||
canResize:false,
|
||||
useSearchForm: false,
|
||||
showIndexColumn: true,
|
||||
actionColumn: {
|
||||
width: 100,
|
||||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: async (params) => {
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: "物料信息",
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
const labelCol = reactive({
|
||||
xs:24,
|
||||
sm:6,
|
||||
xl:6,
|
||||
xxl:6
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: 24,
|
||||
sm: 20,
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.add();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record: Recordable) {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
registerModal.value.disableSubmit = true;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除事件
|
||||
*/
|
||||
async function handleDelete(record) {
|
||||
await deleteOne({ id: record.id }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '请购',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
function searchQuery() {
|
||||
reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function searchReset() {
|
||||
formRef.value.resetFields();
|
||||
selectedRowKeys.value = [];
|
||||
queryParam.treeId = null;
|
||||
//刷新数据
|
||||
reload();
|
||||
}
|
||||
|
||||
|
||||
// 自动请求并暴露内部方法
|
||||
onMounted(() => {
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.jeecg-basic-table-form-container {
|
||||
padding: 0;
|
||||
.table-page-search-submitButtons {
|
||||
display: block;
|
||||
margin-bottom: 24px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.query-group-cust{
|
||||
min-width: 100px !important;
|
||||
}
|
||||
.query-group-split-cust{
|
||||
width: 30px;
|
||||
display: inline-block;
|
||||
text-align: center
|
||||
}
|
||||
.ant-form-item:not(.ant-form-item-with-help){
|
||||
margin-bottom: 16px;
|
||||
height: 32px;
|
||||
}
|
||||
:deep(.ant-picker),:deep(.ant-input-number){
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.all-card {
|
||||
width: 80px;
|
||||
height: 730px;
|
||||
// background-color: rgb(217, 230, 239);
|
||||
// display: flex;
|
||||
/* justify-content: flex-end; */
|
||||
align-items: flex-end;
|
||||
flex-direction: column;
|
||||
// padding-top: 10px;
|
||||
}
|
||||
|
||||
.card {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 80px;
|
||||
height: 120px;
|
||||
flex-direction: column;
|
||||
background-color: rgb(243, 248, 251);
|
||||
/* border-radius: 25px; */
|
||||
}
|
||||
|
||||
.card-target {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 80px;
|
||||
height: 120px;
|
||||
flex-direction: column;
|
||||
background-color: #fff;
|
||||
border-top-left-radius: 30px;
|
||||
border-bottom-left-radius: 30px;
|
||||
/* position: relative; */
|
||||
/* border-radius: 10px; */
|
||||
}
|
||||
|
||||
.sanjiao-down {
|
||||
position: absolute;
|
||||
bottom: -26px;
|
||||
left: 17px;
|
||||
width: 64px;
|
||||
/* 上边长度 */
|
||||
height: 27px;
|
||||
/* 右边长度 */
|
||||
background-color: #fff;
|
||||
/* 三角形填充色 */
|
||||
/* 三点依次为:右上 (100% 0),右下 (100% 100%),左上 (0 0) */
|
||||
clip-path: polygon(100% 0, 100% 100%, 0 0);
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.sanjiao-up {
|
||||
position: absolute;
|
||||
top: -26px;
|
||||
left: 17px;
|
||||
width: 64px;
|
||||
height: 27px;
|
||||
background-color: #fff;
|
||||
/* 三点依次为:右下 (100% 100%),左下 (0 100%),右上 (100% 0) */
|
||||
clip-path: polygon(100% 100%, 0 100%, 100% 0);
|
||||
z-index: 999;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,72 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/nuInvoicingQgdInfo/nuInvoicingQgdInfo/list',
|
||||
save='/nuInvoicingQgdInfo/nuInvoicingQgdInfo/add',
|
||||
edit='/nuInvoicingQgdInfo/nuInvoicingQgdInfo/edit',
|
||||
deleteOne = '/nuInvoicingQgdInfo/nuInvoicingQgdInfo/delete',
|
||||
deleteBatch = '/nuInvoicingQgdInfo/nuInvoicingQgdInfo/deleteBatch',
|
||||
importExcel = '/nuInvoicingQgdInfo/nuInvoicingQgdInfo/importExcel',
|
||||
exportXls = '/nuInvoicingQgdInfo/nuInvoicingQgdInfo/exportXls',
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出api
|
||||
* @param params
|
||||
*/
|
||||
export const getExportUrl = Api.exportXls;
|
||||
|
||||
/**
|
||||
* 导入api
|
||||
*/
|
||||
export const getImportUrl = Api.importExcel;
|
||||
|
||||
/**
|
||||
* 列表接口
|
||||
* @param params
|
||||
*/
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
/**
|
||||
* 删除单个
|
||||
* @param params
|
||||
* @param handleSuccess
|
||||
*/
|
||||
export const deleteOne = (params,handleSuccess) => {
|
||||
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param params
|
||||
* @param handleSuccess
|
||||
*/
|
||||
export const batchDelete = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存或者更新
|
||||
* @param params
|
||||
* @param isUpdate
|
||||
*/
|
||||
export const saveOrUpdate = (params, isUpdate) => {
|
||||
let url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
import {BasicColumn} from '/@/components/Table';
|
||||
import {FormSchema} from '/@/components/Table';
|
||||
import { rules} from '/@/utils/helper/validator';
|
||||
import { render } from '/@/utils/common/renderUtils';
|
||||
import { getWeekMonthQuarterYear } from '/@/utils';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '请购单编号',
|
||||
align: "center",
|
||||
dataIndex: 'mainNo'
|
||||
},
|
||||
{
|
||||
title: '物料编码',
|
||||
align: "center",
|
||||
dataIndex: 'wlMaterialNo'
|
||||
},
|
||||
{
|
||||
title: '物料名称',
|
||||
align: "center",
|
||||
dataIndex: 'wlName'
|
||||
},
|
||||
{
|
||||
title: '采购单位',
|
||||
align: "center",
|
||||
dataIndex: 'wlUnits'
|
||||
},
|
||||
{
|
||||
title: '规格型号',
|
||||
align: "center",
|
||||
dataIndex: 'wlSpecificationModel'
|
||||
},
|
||||
{
|
||||
title: '上限',
|
||||
align: "center",
|
||||
dataIndex: 'wlUpperLimit'
|
||||
},
|
||||
{
|
||||
title: '下限',
|
||||
align: "center",
|
||||
dataIndex: 'wlLowerLimit'
|
||||
},
|
||||
{
|
||||
title: '供应商名称',
|
||||
align: "center",
|
||||
dataIndex: 'suppliersName'
|
||||
},
|
||||
{
|
||||
title: '请购数量',
|
||||
align: "center",
|
||||
dataIndex: 'purchaseQuantity'
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
mainNo: {title: '请购单编号',order: 0,view: 'text', type: 'string',},
|
||||
wlMaterialNo: {title: '物料编码',order: 1,view: 'text', type: 'string',},
|
||||
wlName: {title: '物料名称',order: 2,view: 'text', type: 'string',},
|
||||
wlUnits: {title: '采购单位',order: 3,view: 'text', type: 'string',},
|
||||
wlSpecificationModel: {title: '规格型号',order: 4,view: 'text', type: 'string',},
|
||||
wlUpperLimit: {title: '上限',order: 5,view: 'text', type: 'string',},
|
||||
wlLowerLimit: {title: '下限',order: 6,view: 'text', type: 'string',},
|
||||
suppliersName: {title: '供应商名称',order: 7,view: 'text', type: 'string',},
|
||||
purchaseQuantity: {title: '请购数量',order: 8,view: 'number', type: 'number',},
|
||||
};
|
|
@ -0,0 +1,235 @@
|
|||
<template>
|
||||
<div class="p-2">
|
||||
<!--查询区域-->
|
||||
<div class="jeecg-basic-table-form-container">
|
||||
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||
<a-row :gutter="24">
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" v-auth="'nuInvoicingQgdInfo:nu_invoicing_qgd_info:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||
<a-button type="primary" v-auth="'nuInvoicingQgdInfo:nu_invoicing_qgd_info:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
|
||||
<j-upload-button type="primary" v-auth="'nuInvoicingQgdInfo:nu_invoicing_qgd_info:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item key="1" @click="batchHandleDelete">
|
||||
<Icon icon="ant-design:delete-outlined"></Icon>
|
||||
删除
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button v-auth="'nuInvoicingQgdInfo:nu_invoicing_qgd_info:deleteBatch'">批量操作
|
||||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<!-- 高级查询 -->
|
||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
|
||||
</template>
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<NuInvoicingQgdInfoModal ref="registerModal" @success="handleSuccess"></NuInvoicingQgdInfoModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="nuInvoicingQgdInfo-nuInvoicingQgdInfo" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, superQuerySchema } from './NuInvoicingQgdInfo.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './NuInvoicingQgdInfo.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import NuInvoicingQgdInfoModal from './components/NuInvoicingQgdInfoModal.vue'
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
const userStore = useUserStore();
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '请购单-请购信息',
|
||||
api: list,
|
||||
columns,
|
||||
canResize:false,
|
||||
useSearchForm: false,
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: async (params) => {
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: "请购单-请购信息",
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
const labelCol = reactive({
|
||||
xs:24,
|
||||
sm:4,
|
||||
xl:6,
|
||||
xxl:4
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: 24,
|
||||
sm: 20,
|
||||
});
|
||||
|
||||
// 高级查询配置
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
/**
|
||||
* 高级查询事件
|
||||
*/
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).map((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
searchQuery();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.add();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record: Recordable) {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
registerModal.value.disableSubmit = true;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除事件
|
||||
*/
|
||||
async function handleDelete(record) {
|
||||
await deleteOne({ id: record.id }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
auth: 'nuInvoicingQgdInfo:nu_invoicing_qgd_info:edit'
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}, {
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
auth: 'nuInvoicingQgdInfo:nu_invoicing_qgd_info:delete'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
function searchQuery() {
|
||||
reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function searchReset() {
|
||||
formRef.value.resetFields();
|
||||
selectedRowKeys.value = [];
|
||||
//刷新数据
|
||||
reload();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.jeecg-basic-table-form-container {
|
||||
padding: 0;
|
||||
.table-page-search-submitButtons {
|
||||
display: block;
|
||||
margin-bottom: 24px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.query-group-cust{
|
||||
min-width: 100px !important;
|
||||
}
|
||||
.query-group-split-cust{
|
||||
width: 30px;
|
||||
display: inline-block;
|
||||
text-align: center
|
||||
}
|
||||
.ant-form-item:not(.ant-form-item-with-help){
|
||||
margin-bottom: 16px;
|
||||
height: 32px;
|
||||
}
|
||||
:deep(.ant-picker),:deep(.ant-input-number){
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,193 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<JFormContainer :disabled="disabled">
|
||||
<template #detail>
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="NuInvoicingQgdInfoForm">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="请购单编号" v-bind="validateInfos.mainNo" id="NuInvoicingQgdInfoForm-mainNo" name="mainNo">
|
||||
<a-input v-model:value="formData.mainNo" placeholder="请输入请购单编号" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="物料编码" v-bind="validateInfos.wlMaterialNo" id="NuInvoicingQgdInfoForm-wlMaterialNo" name="wlMaterialNo">
|
||||
<a-input v-model:value="formData.wlMaterialNo" placeholder="请输入物料编码" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="物料名称" v-bind="validateInfos.wlName" id="NuInvoicingQgdInfoForm-wlName" name="wlName">
|
||||
<a-input v-model:value="formData.wlName" placeholder="请输入物料名称" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="采购单位" v-bind="validateInfos.wlUnits" id="NuInvoicingQgdInfoForm-wlUnits" name="wlUnits">
|
||||
<a-input v-model:value="formData.wlUnits" placeholder="请输入采购单位" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="规格型号" v-bind="validateInfos.wlSpecificationModel" id="NuInvoicingQgdInfoForm-wlSpecificationModel" name="wlSpecificationModel">
|
||||
<a-input v-model:value="formData.wlSpecificationModel" placeholder="请输入规格型号" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="上限" v-bind="validateInfos.wlUpperLimit" id="NuInvoicingQgdInfoForm-wlUpperLimit" name="wlUpperLimit">
|
||||
<a-input v-model:value="formData.wlUpperLimit" placeholder="请输入上限" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="下限" v-bind="validateInfos.wlLowerLimit" id="NuInvoicingQgdInfoForm-wlLowerLimit" name="wlLowerLimit">
|
||||
<a-input v-model:value="formData.wlLowerLimit" placeholder="请输入下限" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="供应商名称" v-bind="validateInfos.suppliersName" id="NuInvoicingQgdInfoForm-suppliersName" name="suppliersName">
|
||||
<a-input v-model:value="formData.suppliersName" placeholder="请输入供应商名称" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="请购数量" v-bind="validateInfos.purchaseQuantity" id="NuInvoicingQgdInfoForm-purchaseQuantity" name="purchaseQuantity">
|
||||
<a-input-number v-model:value="formData.purchaseQuantity" placeholder="请输入请购数量" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</template>
|
||||
</JFormContainer>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { getValueType } from '/@/utils';
|
||||
import { saveOrUpdate } from '../NuInvoicingQgdInfo.api';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||
const props = defineProps({
|
||||
formDisabled: { type: Boolean, default: false },
|
||||
formData: { type: Object, default: () => ({})},
|
||||
formBpm: { type: Boolean, default: true }
|
||||
});
|
||||
const formRef = ref();
|
||||
const useForm = Form.useForm;
|
||||
const emit = defineEmits(['register', 'ok']);
|
||||
const formData = reactive<Record<string, any>>({
|
||||
id: '',
|
||||
mainNo: '',
|
||||
wlMaterialNo: '',
|
||||
wlName: '',
|
||||
wlUnits: '',
|
||||
wlSpecificationModel: '',
|
||||
wlUpperLimit: '',
|
||||
wlLowerLimit: '',
|
||||
suppliersName: '',
|
||||
purchaseQuantity: undefined,
|
||||
});
|
||||
const { createMessage } = useMessage();
|
||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
|
||||
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
|
||||
const confirmLoading = ref<boolean>(false);
|
||||
//表单验证
|
||||
const validatorRules = reactive({
|
||||
});
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||
|
||||
// 表单禁用
|
||||
const disabled = computed(()=>{
|
||||
if(props.formBpm === true){
|
||||
if(props.formData.disabled === false){
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return props.formDisabled;
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
edit({});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
function edit(record) {
|
||||
nextTick(() => {
|
||||
resetFields();
|
||||
const tmpData = {};
|
||||
Object.keys(formData).forEach((key) => {
|
||||
if(record.hasOwnProperty(key)){
|
||||
tmpData[key] = record[key]
|
||||
}
|
||||
})
|
||||
//赋值
|
||||
Object.assign(formData, tmpData);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交数据
|
||||
*/
|
||||
async function submitForm() {
|
||||
try {
|
||||
// 触发表单验证
|
||||
await validate();
|
||||
} catch ({ errorFields }) {
|
||||
if (errorFields) {
|
||||
const firstField = errorFields[0];
|
||||
if (firstField) {
|
||||
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
}
|
||||
return Promise.reject(errorFields);
|
||||
}
|
||||
confirmLoading.value = true;
|
||||
const isUpdate = ref<boolean>(false);
|
||||
//时间格式化
|
||||
let model = formData;
|
||||
if (model.id) {
|
||||
isUpdate.value = true;
|
||||
}
|
||||
//循环数据
|
||||
for (let data in model) {
|
||||
//如果该数据是数组并且是字符串类型
|
||||
if (model[data] instanceof Array) {
|
||||
let valueType = getValueType(formRef.value.getProps, data);
|
||||
//如果是字符串类型的需要变成以逗号分割的字符串
|
||||
if (valueType === 'string') {
|
||||
model[data] = model[data].join(',');
|
||||
}
|
||||
}
|
||||
}
|
||||
await saveOrUpdate(model, isUpdate.value)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
createMessage.success(res.message);
|
||||
emit('ok');
|
||||
} else {
|
||||
createMessage.warning(res.message);
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
confirmLoading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
submitForm,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.antd-modal-form {
|
||||
padding: 14px;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,77 @@
|
|||
<template>
|
||||
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||
<NuInvoicingQgdInfoForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></NuInvoicingQgdInfoForm>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import NuInvoicingQgdInfoForm from './NuInvoicingQgdInfoForm.vue'
|
||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||
|
||||
const title = ref<string>('');
|
||||
const width = ref<number>(800);
|
||||
const visible = ref<boolean>(false);
|
||||
const disableSubmit = ref<boolean>(false);
|
||||
const registerForm = ref();
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
title.value = '新增';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.add();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param record
|
||||
*/
|
||||
function edit(record) {
|
||||
title.value = disableSubmit.value ? '详情' : '编辑';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.edit(record);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 确定按钮点击事件
|
||||
*/
|
||||
function handleOk() {
|
||||
registerForm.value.submitForm();
|
||||
}
|
||||
|
||||
/**
|
||||
* form保存回调事件
|
||||
*/
|
||||
function submitCallback() {
|
||||
handleCancel();
|
||||
emit('success');
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消按钮回调事件
|
||||
*/
|
||||
function handleCancel() {
|
||||
visible.value = false;
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
disableSubmit,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
/**隐藏样式-modal确定按钮 */
|
||||
.jee-hidden {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
<style lang="less" scoped></style>
|
|
@ -0,0 +1,72 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/nuInvoicingQgdMain/nuInvoicingQgdMain/list',
|
||||
save='/nuInvoicingQgdMain/nuInvoicingQgdMain/add',
|
||||
edit='/nuInvoicingQgdMain/nuInvoicingQgdMain/edit',
|
||||
deleteOne = '/nuInvoicingQgdMain/nuInvoicingQgdMain/delete',
|
||||
deleteBatch = '/nuInvoicingQgdMain/nuInvoicingQgdMain/deleteBatch',
|
||||
importExcel = '/nuInvoicingQgdMain/nuInvoicingQgdMain/importExcel',
|
||||
exportXls = '/nuInvoicingQgdMain/nuInvoicingQgdMain/exportXls',
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出api
|
||||
* @param params
|
||||
*/
|
||||
export const getExportUrl = Api.exportXls;
|
||||
|
||||
/**
|
||||
* 导入api
|
||||
*/
|
||||
export const getImportUrl = Api.importExcel;
|
||||
|
||||
/**
|
||||
* 列表接口
|
||||
* @param params
|
||||
*/
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
/**
|
||||
* 删除单个
|
||||
* @param params
|
||||
* @param handleSuccess
|
||||
*/
|
||||
export const deleteOne = (params,handleSuccess) => {
|
||||
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param params
|
||||
* @param handleSuccess
|
||||
*/
|
||||
export const batchDelete = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存或者更新
|
||||
* @param params
|
||||
* @param isUpdate
|
||||
*/
|
||||
export const saveOrUpdate = (params, isUpdate) => {
|
||||
let url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
import {BasicColumn} from '/@/components/Table';
|
||||
import {FormSchema} from '/@/components/Table';
|
||||
import { rules} from '/@/utils/helper/validator';
|
||||
import { render } from '/@/utils/common/renderUtils';
|
||||
import { getWeekMonthQuarterYear } from '/@/utils';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '请购单号',
|
||||
align: "center",
|
||||
dataIndex: 'qgdNo'
|
||||
},
|
||||
{
|
||||
title: '请购状态 0未下单 1已下单',
|
||||
align: "center",
|
||||
dataIndex: 'status'
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
qgdNo: {title: '请购单号',order: 0,view: 'number', type: 'number',},
|
||||
status: {title: '请购状态 0未下单 1已下单',order: 1,view: 'number', type: 'number',},
|
||||
};
|
|
@ -0,0 +1,235 @@
|
|||
<template>
|
||||
<div class="p-2">
|
||||
<!--查询区域-->
|
||||
<div class="jeecg-basic-table-form-container">
|
||||
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||
<a-row :gutter="24">
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" v-auth="'nuInvoicingQgdMain:nu_invoicing_qgd_main:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||
<a-button type="primary" v-auth="'nuInvoicingQgdMain:nu_invoicing_qgd_main:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
|
||||
<j-upload-button type="primary" v-auth="'nuInvoicingQgdMain:nu_invoicing_qgd_main:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item key="1" @click="batchHandleDelete">
|
||||
<Icon icon="ant-design:delete-outlined"></Icon>
|
||||
删除
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button v-auth="'nuInvoicingQgdMain:nu_invoicing_qgd_main:deleteBatch'">批量操作
|
||||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
<!-- 高级查询 -->
|
||||
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
|
||||
</template>
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<NuInvoicingQgdMainModal ref="registerModal" @success="handleSuccess"></NuInvoicingQgdMainModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="nuInvoicingQgdMain-nuInvoicingQgdMain" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, superQuerySchema } from './NuInvoicingQgdMain.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './NuInvoicingQgdMain.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import NuInvoicingQgdMainModal from './components/NuInvoicingQgdMainModal.vue'
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
const userStore = useUserStore();
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '请购单',
|
||||
api: list,
|
||||
columns,
|
||||
canResize:false,
|
||||
useSearchForm: false,
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: async (params) => {
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: "请购单",
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
const labelCol = reactive({
|
||||
xs:24,
|
||||
sm:4,
|
||||
xl:6,
|
||||
xxl:4
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: 24,
|
||||
sm: 20,
|
||||
});
|
||||
|
||||
// 高级查询配置
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
/**
|
||||
* 高级查询事件
|
||||
*/
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).map((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
searchQuery();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.add();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record: Recordable) {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
registerModal.value.disableSubmit = true;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除事件
|
||||
*/
|
||||
async function handleDelete(record) {
|
||||
await deleteOne({ id: record.id }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
auth: 'nuInvoicingQgdMain:nu_invoicing_qgd_main:edit'
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}, {
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
auth: 'nuInvoicingQgdMain:nu_invoicing_qgd_main:delete'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
function searchQuery() {
|
||||
reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function searchReset() {
|
||||
formRef.value.resetFields();
|
||||
selectedRowKeys.value = [];
|
||||
//刷新数据
|
||||
reload();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.jeecg-basic-table-form-container {
|
||||
padding: 0;
|
||||
.table-page-search-submitButtons {
|
||||
display: block;
|
||||
margin-bottom: 24px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.query-group-cust{
|
||||
min-width: 100px !important;
|
||||
}
|
||||
.query-group-split-cust{
|
||||
width: 30px;
|
||||
display: inline-block;
|
||||
text-align: center
|
||||
}
|
||||
.ant-form-item:not(.ant-form-item-with-help){
|
||||
margin-bottom: 16px;
|
||||
height: 32px;
|
||||
}
|
||||
:deep(.ant-picker),:deep(.ant-input-number){
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,151 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<JFormContainer :disabled="disabled">
|
||||
<template #detail>
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="NuInvoicingQgdMainForm">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="请购单号" v-bind="validateInfos.qgdNo" id="NuInvoicingQgdMainForm-qgdNo" name="qgdNo">
|
||||
<a-input-number v-model:value="formData.qgdNo" placeholder="请输入请购单号" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="请购状态 0未下单 1已下单" v-bind="validateInfos.status" id="NuInvoicingQgdMainForm-status" name="status">
|
||||
<a-input-number v-model:value="formData.status" placeholder="请输入请购状态 0未下单 1已下单" style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</template>
|
||||
</JFormContainer>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { getValueType } from '/@/utils';
|
||||
import { saveOrUpdate } from '../NuInvoicingQgdMain.api';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||
const props = defineProps({
|
||||
formDisabled: { type: Boolean, default: false },
|
||||
formData: { type: Object, default: () => ({})},
|
||||
formBpm: { type: Boolean, default: true }
|
||||
});
|
||||
const formRef = ref();
|
||||
const useForm = Form.useForm;
|
||||
const emit = defineEmits(['register', 'ok']);
|
||||
const formData = reactive<Record<string, any>>({
|
||||
id: '',
|
||||
qgdNo: undefined,
|
||||
status: undefined,
|
||||
});
|
||||
const { createMessage } = useMessage();
|
||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
|
||||
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
|
||||
const confirmLoading = ref<boolean>(false);
|
||||
//表单验证
|
||||
const validatorRules = reactive({
|
||||
});
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||
|
||||
// 表单禁用
|
||||
const disabled = computed(()=>{
|
||||
if(props.formBpm === true){
|
||||
if(props.formData.disabled === false){
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return props.formDisabled;
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
edit({});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
function edit(record) {
|
||||
nextTick(() => {
|
||||
resetFields();
|
||||
const tmpData = {};
|
||||
Object.keys(formData).forEach((key) => {
|
||||
if(record.hasOwnProperty(key)){
|
||||
tmpData[key] = record[key]
|
||||
}
|
||||
})
|
||||
//赋值
|
||||
Object.assign(formData, tmpData);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交数据
|
||||
*/
|
||||
async function submitForm() {
|
||||
try {
|
||||
// 触发表单验证
|
||||
await validate();
|
||||
} catch ({ errorFields }) {
|
||||
if (errorFields) {
|
||||
const firstField = errorFields[0];
|
||||
if (firstField) {
|
||||
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
}
|
||||
return Promise.reject(errorFields);
|
||||
}
|
||||
confirmLoading.value = true;
|
||||
const isUpdate = ref<boolean>(false);
|
||||
//时间格式化
|
||||
let model = formData;
|
||||
if (model.id) {
|
||||
isUpdate.value = true;
|
||||
}
|
||||
//循环数据
|
||||
for (let data in model) {
|
||||
//如果该数据是数组并且是字符串类型
|
||||
if (model[data] instanceof Array) {
|
||||
let valueType = getValueType(formRef.value.getProps, data);
|
||||
//如果是字符串类型的需要变成以逗号分割的字符串
|
||||
if (valueType === 'string') {
|
||||
model[data] = model[data].join(',');
|
||||
}
|
||||
}
|
||||
}
|
||||
await saveOrUpdate(model, isUpdate.value)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
createMessage.success(res.message);
|
||||
emit('ok');
|
||||
} else {
|
||||
createMessage.warning(res.message);
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
confirmLoading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
submitForm,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.antd-modal-form {
|
||||
padding: 14px;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,77 @@
|
|||
<template>
|
||||
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||
<NuInvoicingQgdMainForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></NuInvoicingQgdMainForm>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import NuInvoicingQgdMainForm from './NuInvoicingQgdMainForm.vue'
|
||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||
|
||||
const title = ref<string>('');
|
||||
const width = ref<number>(800);
|
||||
const visible = ref<boolean>(false);
|
||||
const disableSubmit = ref<boolean>(false);
|
||||
const registerForm = ref();
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
title.value = '新增';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.add();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param record
|
||||
*/
|
||||
function edit(record) {
|
||||
title.value = disableSubmit.value ? '详情' : '编辑';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.edit(record);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 确定按钮点击事件
|
||||
*/
|
||||
function handleOk() {
|
||||
registerForm.value.submitForm();
|
||||
}
|
||||
|
||||
/**
|
||||
* form保存回调事件
|
||||
*/
|
||||
function submitCallback() {
|
||||
handleCancel();
|
||||
emit('success');
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消按钮回调事件
|
||||
*/
|
||||
function handleCancel() {
|
||||
visible.value = false;
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
disableSubmit,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
/**隐藏样式-modal确定按钮 */
|
||||
.jee-hidden {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
<style lang="less" scoped></style>
|
|
@ -8,10 +8,10 @@
|
|||
<NuIotTqApiRequestLogList ref="nuIotTqApiRequestLogListModal9"></NuIotTqApiRequestLogList>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="10" tab="电表拉闸" force-render>
|
||||
<NuIotTqApiRequestLogList ref="nuIotTqApiRequestLogListModal10"></NuIotTqApiRequestLogList>
|
||||
<NuIotTqApiRequestLogList2 ref="nuIotTqApiRequestLogListModal10"></NuIotTqApiRequestLogList2>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="11" tab="电表合闸" force-render>
|
||||
<NuIotTqApiRequestLogList ref="nuIotTqApiRequestLogListModal11"></NuIotTqApiRequestLogList>
|
||||
<NuIotTqApiRequestLogList2 ref="nuIotTqApiRequestLogListModal11"></NuIotTqApiRequestLogList2>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
</div>
|
||||
|
@ -21,6 +21,7 @@
|
|||
import { ref, reactive } from 'vue';
|
||||
|
||||
import NuIotTqApiRequestLogList from '/@/views/iot/tq/nuIotTqApiRequestLog/NuIotTqApiRequestLogList.vue';
|
||||
import NuIotTqApiRequestLogList2 from '/@/views/iot/tq/nuIotTqApiRequestLog/NuIotTqApiRequestLogList2.vue';
|
||||
|
||||
const activeKey= ref('3');
|
||||
const dbsbInfo = ref<any>({});
|
||||
|
|
|
@ -2,16 +2,16 @@
|
|||
<div class="p-2">
|
||||
<a-tabs v-model:activeKey="activeKey" type="card" @change="handleChange">
|
||||
<a-tab-pane key="42" tab="抄表" >
|
||||
<NuIotTqApiRequestLogList ref="nuIotTqApiRequestLogListModal42"></NuIotTqApiRequestLogList>
|
||||
<NuIotTqApiRequestLogList3 ref="nuIotTqApiRequestLogListModal42"></NuIotTqApiRequestLogList3>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="49" tab="清零" force-render>
|
||||
<NuIotTqApiRequestLogList ref="nuIotTqApiRequestLogListModal49"></NuIotTqApiRequestLogList>
|
||||
<NuIotTqApiRequestLogList3 ref="nuIotTqApiRequestLogListModal49"></NuIotTqApiRequestLogList3>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="43" tab="开阀" force-render>
|
||||
<NuIotTqApiRequestLogList ref="nuIotTqApiRequestLogListModal43"></NuIotTqApiRequestLogList>
|
||||
<NuIotTqApiRequestLogList2 ref="nuIotTqApiRequestLogListModal43"></NuIotTqApiRequestLogList2>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="53" tab="关阀" force-render>
|
||||
<NuIotTqApiRequestLogList ref="nuIotTqApiRequestLogListModal43"></NuIotTqApiRequestLogList>
|
||||
<NuIotTqApiRequestLogList2 ref="nuIotTqApiRequestLogListModal53"></NuIotTqApiRequestLogList2>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
</div>
|
||||
|
@ -20,7 +20,8 @@
|
|||
<script lang="ts" name="departUtils-sysDepart" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
|
||||
import NuIotTqApiRequestLogList from '/@/views/iot/tq/nuIotTqApiRequestLog/NuIotTqApiRequestLogList.vue';
|
||||
import NuIotTqApiRequestLogList3 from '/@/views/iot/tq/nuIotTqApiRequestLog/NuIotTqApiRequestLogList3.vue';
|
||||
import NuIotTqApiRequestLogList2 from '/@/views/iot/tq/nuIotTqApiRequestLog/NuIotTqApiRequestLogList2.vue';
|
||||
|
||||
const activeKey= ref('42');
|
||||
const dbsbInfo = ref<any>({});
|
||||
|
|
|
@ -14,7 +14,7 @@ export const columns: BasicColumn[] = [
|
|||
dataIndex: 'nuName'
|
||||
},
|
||||
{
|
||||
title: '表号',
|
||||
title: 'SN',
|
||||
align: "center",
|
||||
dataIndex: 'address'
|
||||
},
|
||||
|
@ -106,7 +106,7 @@ export const searchFormSchema: FormSchema[] = [
|
|||
colProps: { span: 6 },
|
||||
},
|
||||
{
|
||||
label: '表号',
|
||||
label: 'SN',
|
||||
field: 'address',
|
||||
component: 'Input',
|
||||
colProps: { span: 6 },
|
||||
|
|
|
@ -6,8 +6,14 @@
|
|||
<a-row :gutter="24">
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="address">
|
||||
<template #label><span title="同步类型">表号</span></template>
|
||||
<a-input placeholder="请输入同步类型" v-model:value="queryParam.address" allow-clear ></a-input>
|
||||
<template #label><span title="SN">SN</span></template>
|
||||
<a-input placeholder="请输入SN" v-model:value="queryParam.address" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="nuId">
|
||||
<template #label><span title="护理单元">护理单元</span></template>
|
||||
<j-dict-select-tag type='list' v-model:value="queryParam.nuId" :dictCode="`nu_base_info,nu_name,id`" placeholder="请选护理单元" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
|
@ -19,46 +25,63 @@
|
|||
</div>
|
||||
<a-row>
|
||||
<a-col v-for="(item,index) in tableData.records" :key="index" :xs="24" :sm="24" :md="12" :lg="12" :xl="8" :xxl="6" style="padding: 8px;">
|
||||
<a-card style="width: 100%;border-radius: 8px;">
|
||||
<template #title >
|
||||
<div class="cardTitle">
|
||||
<a-row>
|
||||
<a-col :span="12">
|
||||
<span style="margin-left:15px;font-size:14px;">表号:{{item.address}}</span>
|
||||
<a-card style="width: 100%;border-radius: 8px;" :headStyle="{ height: '60px', padding: '0 24px' }" :bodyStyle="{ padding: '24px 24px 4px 24px' }">
|
||||
<template #title>
|
||||
<a-row style="font-weight: normal;">
|
||||
<a-col :span="18" style="font-size: 14px;">
|
||||
<div>SN:<span style="font-weight: bold;">{{item.address}}</span></div>
|
||||
<div style="font-size: 12px;">抄表时间:{{item.readTime?item.readTime:'未抄表'}}</div>
|
||||
</a-col>
|
||||
<a-col :span="12" style="text-align: right;">
|
||||
<span style="margin-right:15px;font-size:14px;">{{item.relayState=='1'?'在线':'离线'}}</span>
|
||||
<a-col :span="6" style="text-align: center;padding-top: 4px;">
|
||||
<div :class="item.relayState=='1'?'zxClass':'lxClass'">{{item.relayState=='1'?'在线':'离线'}}</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
</template>
|
||||
<p>
|
||||
<span>护理单元名称:{{item.nuName?item.nuName:'未配置'}}</span>
|
||||
</p>
|
||||
<p>
|
||||
<span>上次抄表时间:{{item.readTime?item.readTime:'未抄表'}}</span>
|
||||
</p>
|
||||
<p style="margin-top: 20px;">
|
||||
<span><Statistic title="用电量(KWH)" :value="item.eleValue?item.eleValue:'无'" style="text-align:center;" /></span>
|
||||
</p>
|
||||
<a-row>
|
||||
<a-col :span="12" style="margin-top: -10px;">{{item.nuName?item.nuName:'未配置'}}</a-col>
|
||||
<a-col :span="12" style="text-align: right;margin-top: -10px;">
|
||||
<span style="text-align: right;background:#f6f6f6;padding: 2px 10px;border-radius:5px;">NUID: {{item.nuId?item.nuId:'未配置'}}</span>
|
||||
</a-col>
|
||||
<a-col :span="14" style="text-align: right;font-size: 44px;font-weight: bold;margin-top:18px;">
|
||||
<span>{{item.eleValue?item.eleValue:'0.00'}}</span>
|
||||
</a-col>
|
||||
<a-col :span="8" style="padding: 12px 0 0 5px;margin-top:18px;">
|
||||
<div style="font-size: 12px;margin: 5px 0 -5px 2px;padding:2px;">KWH</div>
|
||||
<div style="margin-top:-3px;"><span style="background:#eeeeee;padding: 2px;border-radius:5px;font-size:11px;">用电量</span></div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-divider />
|
||||
<p style="text-align:center;">
|
||||
<span>
|
||||
<a @click="handleRead(item)">抄表</a>
|
||||
<a-divider type="vertical" />
|
||||
<a @click="handleControlLz(item)">拉闸</a>
|
||||
<a-divider type="vertical" />
|
||||
<a @click="handleControlHz(item)">合闸</a>
|
||||
<a-divider type="vertical" />
|
||||
<a @click="handleReset(item)">清零</a>
|
||||
<a-divider type="vertical" />
|
||||
<a @click="showApiLog(item)">日志</a>
|
||||
</span>
|
||||
<span style="display:inline-block;" @click="handleRead(item)">
|
||||
<span class="tbClass"><img src="../../../../assets/iot/a1.png" style="width:20px;" /></span><br/>
|
||||
<span class="antTitle">抄表</span>
|
||||
</span>
|
||||
<span style="display:inline-block;margin-left:10%;" @click="handleControlLz(item)">
|
||||
<span class="tbClass"><img src="../../../../assets/iot/a5.png" style="width:20px;" /></span><br/>
|
||||
<span class="antTitle">拉闸</span>
|
||||
</span>
|
||||
<span style="display:inline-block;margin-left:10%;" @click="handleControlHz(item)">
|
||||
<span class="tbClass"><img src="../../../../assets/iot/a2.png" style="width:20px;" /></span><br/>
|
||||
<span class="antTitle">合闸</span>
|
||||
</span>
|
||||
<span style="display:inline-block;margin-left:10%;" @click="handleReset(item)">
|
||||
<span class="tbClass"><img src="../../../../assets/iot/a3.png" style="width:20px;" /></span><br/>
|
||||
<span class="antTitle">清零</span>
|
||||
</span>
|
||||
<span style="display:inline-block;margin-left:10%;" @click="showApiLog(item)">
|
||||
<span class="tbClass"><img src="../../../../assets/iot/a4.png" style="width:20px;" /></span><br/>
|
||||
<span class="antTitle">日志</span>
|
||||
</span>
|
||||
</p>
|
||||
</a-card>
|
||||
</a-col>
|
||||
<a-col v-if="tableData.total==0" >
|
||||
<div style="margin: 30px auto;">
|
||||
<a-empty />
|
||||
</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<div
|
||||
<div v-if="tableData.total > 0"
|
||||
style="float:right;bottom: 20px;z-index: 999;padding: 8px 16px;border-radius: 4px;display: flex;align-items: center;">
|
||||
<span style="margin-right: 10px;">共 {{ tableData.total }} 条数据</span>
|
||||
<Pagination showLessItems v-model:current="pageParams.pageNo" :pageSize="pageParams.pageSize" size="small"
|
||||
|
@ -76,6 +99,8 @@
|
|||
import {Modal} from "ant-design-vue";
|
||||
import {list, eleReset, eleControl, eleRead } from './electricity.api';
|
||||
import { Pagination } from 'ant-design-vue';
|
||||
import { JInput } from '/@/components/Form';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
|
||||
import ApiLogModal from "@/views/iot/tq/electricity/apilog/ApiLogModal.vue";
|
||||
import { set } from 'lodash-es';
|
||||
|
@ -215,4 +240,31 @@ const pageParams = ref({ pageNo: 1, pageSize: 8 })
|
|||
display: block;
|
||||
position: absolute;
|
||||
}
|
||||
.zxClass{
|
||||
font-size:14px;
|
||||
background: linear-gradient(to right, #1ea0fa, #017de9);
|
||||
border-radius: 8px;
|
||||
height: 35px;
|
||||
color: white;
|
||||
line-height: 35px;
|
||||
}
|
||||
|
||||
.lxClass{
|
||||
font-size:14px;
|
||||
background: linear-gradient(to right, #cccccc, #cccccc);
|
||||
border-radius: 8px;
|
||||
height: 35px;
|
||||
color: white;
|
||||
line-height: 35px;
|
||||
}
|
||||
.tbClass{
|
||||
background: #f6f6f6;
|
||||
padding: 8px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.antTitle{
|
||||
margin-top: 10px;
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -6,60 +6,104 @@ import { getWeekMonthQuarterYear } from '/@/utils';
|
|||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '表号',
|
||||
title: 'SN',
|
||||
align: "center",
|
||||
dataIndex: 'address'
|
||||
},
|
||||
// {
|
||||
// title: '类型',
|
||||
// align: "center",
|
||||
// dataIndex: 'type_dictText'
|
||||
// },
|
||||
{
|
||||
title: '类型',
|
||||
align: "center",
|
||||
dataIndex: 'type_dictText'
|
||||
},
|
||||
{
|
||||
title: '请求时的值',
|
||||
align: "center",
|
||||
dataIndex: 'requestValue'
|
||||
},
|
||||
{
|
||||
title: '请求时间',
|
||||
title: '操作时间',
|
||||
align: "center",
|
||||
dataIndex: 'requestTime'
|
||||
},
|
||||
{
|
||||
title: '请求状态',
|
||||
title: '上次电表值',
|
||||
align: "center",
|
||||
dataIndex: 'requestStatus_dictText'
|
||||
dataIndex: 'requestValue'
|
||||
},
|
||||
{
|
||||
title: '请求描述',
|
||||
align: "center",
|
||||
dataIndex: 'requestRemark'
|
||||
},
|
||||
{
|
||||
title: '反馈值',
|
||||
title: '电表值',
|
||||
align: "center",
|
||||
dataIndex: 'resolveValue'
|
||||
},
|
||||
{
|
||||
title: '反馈时间',
|
||||
title: '状态',
|
||||
align: "center",
|
||||
dataIndex: 'resolveTime'
|
||||
dataIndex: 'resolveStatus'
|
||||
},
|
||||
// {
|
||||
// title: '本次反馈时间',
|
||||
// align: "center",
|
||||
// dataIndex: 'resolveTime'
|
||||
// },
|
||||
// {
|
||||
// title: '本次抄表状态',
|
||||
// align: "center",
|
||||
// dataIndex: 'resolveStatus_dictText'
|
||||
// },
|
||||
// {
|
||||
// title: '反馈描述',
|
||||
// align: "center",
|
||||
// dataIndex: 'resolveRemark',
|
||||
// defaultHidden: true
|
||||
// },
|
||||
];
|
||||
|
||||
//列表数据
|
||||
export const columns2: BasicColumn[] = [
|
||||
{
|
||||
title: 'SN',
|
||||
align: "center",
|
||||
dataIndex: 'address'
|
||||
},
|
||||
{
|
||||
title: '反馈状态',
|
||||
title: '操作时间',
|
||||
align: "center",
|
||||
dataIndex: 'resolveStatus_dictText'
|
||||
dataIndex: 'requestTime'
|
||||
},
|
||||
{
|
||||
title: '反馈描述',
|
||||
title: '状态',
|
||||
align: "center",
|
||||
dataIndex: 'resolveRemark'
|
||||
dataIndex: 'resolveStatus'
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
//列表数据
|
||||
export const columns3: BasicColumn[] = [
|
||||
{
|
||||
title: 'SN',
|
||||
align: "center",
|
||||
dataIndex: 'address'
|
||||
},
|
||||
{
|
||||
title: '操作时间',
|
||||
align: "center",
|
||||
dataIndex: 'requestTime'
|
||||
},
|
||||
{
|
||||
title: '上次水表值',
|
||||
align: "center",
|
||||
dataIndex: 'requestValue'
|
||||
},
|
||||
{
|
||||
title: '水表值',
|
||||
align: "center",
|
||||
dataIndex: 'resolveValue'
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
align: "center",
|
||||
dataIndex: 'resolveStatus'
|
||||
},
|
||||
];
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
address: {title: '表号',order: 0,view: 'text', type: 'string',},
|
||||
address: {title: 'SN',order: 0,view: 'text', type: 'string',},
|
||||
type: {title: '类型',order: 1,view: 'list', type: 'string',dictCode: 'dbsb_type',},
|
||||
requestValue: {title: '请求时的值',order: 2,view: 'text', type: 'string',},
|
||||
requestTime: {title: '请求时间',order: 3,view: 'text', type: 'string',},
|
||||
|
|
|
@ -1,32 +1,5 @@
|
|||
<template>
|
||||
<div class="p-2">
|
||||
<!--查询区域-->
|
||||
<div class="jeecg-basic-table-form-container">
|
||||
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="requestStatus">
|
||||
<template #label><span title="请求状态">请求状态</span></template>
|
||||
<j-select-multiple placeholder="请选择请求状态" v-model:value="queryParam.requestStatus" dictCode="dbsb_status" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="resolveStatus">
|
||||
<template #label><span title="反馈状态">反馈状态</span></template>
|
||||
<j-select-multiple placeholder="请选择反馈状态" v-model:value="queryParam.resolveStatus" dictCode="dbsb_status" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
||||
<a-col :lg="6">
|
||||
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
|
||||
</a-col>
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable">
|
||||
<!--插槽:table标题-->
|
||||
|
|
|
@ -0,0 +1,224 @@
|
|||
<template>
|
||||
<div class="p-2">
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
|
||||
</template>
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<NuIotTqApiRequestLogModal ref="registerModal" @success="handleSuccess"></NuIotTqApiRequestLogModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="nuIotTqApiRequestLog-nuIotTqApiRequestLog" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns2, superQuerySchema } from './NuIotTqApiRequestLog.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './NuIotTqApiRequestLog.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import NuIotTqApiRequestLogModal from './components/NuIotTqApiRequestLogModal.vue'
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
|
||||
import { columns } from '../../tplink/camera/camera.data';
|
||||
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
const userStore = useUserStore();
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: 'api请求日志',
|
||||
api: list,
|
||||
columns: columns2,
|
||||
canResize:false,
|
||||
useSearchForm: false,
|
||||
immediate: false,
|
||||
showActionColumn: false,
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: async (params) => {
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: "api请求日志",
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
const labelCol = reactive({
|
||||
xs:24,
|
||||
sm:8,
|
||||
xl:6,
|
||||
xxl:8
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: 24,
|
||||
sm: 16,
|
||||
});
|
||||
|
||||
// 高级查询配置
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
/**
|
||||
* 高级查询事件
|
||||
*/
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).map((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
searchQuery();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.add();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record: Recordable) {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
registerModal.value.disableSubmit = true;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除事件
|
||||
*/
|
||||
async function handleDelete(record) {
|
||||
await deleteOne({ id: record.id }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
auth: 'nuIotTqApiRequestLog:nu_iot_tq_api_request_log:edit'
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}, {
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
auth: 'nuIotTqApiRequestLog:nu_iot_tq_api_request_log:delete'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
function searchQuery() {
|
||||
reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function searchReset() {
|
||||
formRef.value.resetFields();
|
||||
selectedRowKeys.value = [];
|
||||
//刷新数据
|
||||
reload();
|
||||
}
|
||||
|
||||
function init(record) {
|
||||
console.log("🚀 ~ init ~ record:", record)
|
||||
queryParam.cid = record.cid;
|
||||
queryParam.type = record.type;
|
||||
reload();
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
init,
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.jeecg-basic-table-form-container {
|
||||
padding: 0;
|
||||
.table-page-search-submitButtons {
|
||||
display: block;
|
||||
margin-bottom: 24px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.query-group-cust{
|
||||
min-width: 100px !important;
|
||||
}
|
||||
.query-group-split-cust{
|
||||
width: 30px;
|
||||
display: inline-block;
|
||||
text-align: center
|
||||
}
|
||||
.ant-form-item:not(.ant-form-item-with-help){
|
||||
margin-bottom: 16px;
|
||||
height: 32px;
|
||||
}
|
||||
:deep(.ant-picker),:deep(.ant-input-number){
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,224 @@
|
|||
<template>
|
||||
<div class="p-2">
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
|
||||
</template>
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<NuIotTqApiRequestLogModal ref="registerModal" @success="handleSuccess"></NuIotTqApiRequestLogModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="nuIotTqApiRequestLog-nuIotTqApiRequestLog" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns3, superQuerySchema } from './NuIotTqApiRequestLog.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './NuIotTqApiRequestLog.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import NuIotTqApiRequestLogModal from './components/NuIotTqApiRequestLogModal.vue'
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
|
||||
import { columns } from '../../tplink/camera/camera.data';
|
||||
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
const userStore = useUserStore();
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: 'api请求日志',
|
||||
api: list,
|
||||
columns: columns3,
|
||||
canResize:false,
|
||||
useSearchForm: false,
|
||||
immediate: false,
|
||||
showActionColumn: false,
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: async (params) => {
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: "api请求日志",
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
const labelCol = reactive({
|
||||
xs:24,
|
||||
sm:8,
|
||||
xl:6,
|
||||
xxl:8
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: 24,
|
||||
sm: 16,
|
||||
});
|
||||
|
||||
// 高级查询配置
|
||||
const superQueryConfig = reactive(superQuerySchema);
|
||||
|
||||
/**
|
||||
* 高级查询事件
|
||||
*/
|
||||
function handleSuperQuery(params) {
|
||||
Object.keys(params).map((k) => {
|
||||
queryParam[k] = params[k];
|
||||
});
|
||||
searchQuery();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.add();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record: Recordable) {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
registerModal.value.disableSubmit = true;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除事件
|
||||
*/
|
||||
async function handleDelete(record) {
|
||||
await deleteOne({ id: record.id }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除事件
|
||||
*/
|
||||
async function batchHandleDelete() {
|
||||
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
auth: 'nuIotTqApiRequestLog:nu_iot_tq_api_request_log:edit'
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}, {
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
auth: 'nuIotTqApiRequestLog:nu_iot_tq_api_request_log:delete'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
function searchQuery() {
|
||||
reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function searchReset() {
|
||||
formRef.value.resetFields();
|
||||
selectedRowKeys.value = [];
|
||||
//刷新数据
|
||||
reload();
|
||||
}
|
||||
|
||||
function init(record) {
|
||||
console.log("🚀 ~ init ~ record:", record)
|
||||
queryParam.cid = record.cid;
|
||||
queryParam.type = record.type;
|
||||
reload();
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
init,
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.jeecg-basic-table-form-container {
|
||||
padding: 0;
|
||||
.table-page-search-submitButtons {
|
||||
display: block;
|
||||
margin-bottom: 24px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.query-group-cust{
|
||||
min-width: 100px !important;
|
||||
}
|
||||
.query-group-split-cust{
|
||||
width: 30px;
|
||||
display: inline-block;
|
||||
text-align: center
|
||||
}
|
||||
.ant-form-item:not(.ant-form-item-with-help){
|
||||
margin-bottom: 16px;
|
||||
height: 32px;
|
||||
}
|
||||
:deep(.ant-picker),:deep(.ant-input-number){
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -5,8 +5,8 @@
|
|||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="NuIotTqApiRequestLogForm">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="表号" v-bind="validateInfos.address" id="NuIotTqApiRequestLogForm-address" name="address">
|
||||
<a-input v-model:value="formData.address" placeholder="请输入表号" allow-clear ></a-input>
|
||||
<a-form-item label="SN" v-bind="validateInfos.address" id="NuIotTqApiRequestLogForm-address" name="address">
|
||||
<a-input v-model:value="formData.address" placeholder="请输入SN" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
|
|
|
@ -6,8 +6,14 @@
|
|||
<a-row :gutter="24">
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="address">
|
||||
<template #label><span title="同步类型">表号</span></template>
|
||||
<a-input placeholder="请输入同步类型" v-model:value="queryParam.address" allow-clear ></a-input>
|
||||
<template #label><span title="SN">SN</span></template>
|
||||
<a-input placeholder="请输入SN" v-model:value="queryParam.address" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="nuId">
|
||||
<template #label><span title="护理单元">护理单元</span></template>
|
||||
<j-dict-select-tag type='list' v-model:value="queryParam.nuId" :dictCode="`nu_base_info,nu_name,id`" placeholder="请选护理单元" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
|
@ -19,46 +25,63 @@
|
|||
</div>
|
||||
<a-row>
|
||||
<a-col v-for="(item,index) in tableData.records" :key="index" :xs="24" :sm="24" :md="12" :lg="12" :xl="8" :xxl="6" style="padding: 8px;">
|
||||
<a-card style="width: 100%;border-radius: 8px;">
|
||||
<template #title >
|
||||
<div class="cardTitle">
|
||||
<a-row>
|
||||
<a-col :span="12">
|
||||
<span style="margin-left:15px;font-size:14px;">表号:{{item.address}}</span>
|
||||
<a-card style="width: 100%;border-radius: 8px;" :headStyle="{ height: '60px', padding: '0 24px' }" :bodyStyle="{ padding: '24px 24px 4px 24px' }">
|
||||
<template #title>
|
||||
<a-row style="font-weight: normal;">
|
||||
<a-col :span="18" style="font-size: 14px;">
|
||||
<div>SN:<span style="font-weight: bold;">{{item.address}}</span></div>
|
||||
<div style="font-size: 12px;">抄表时间:{{item.readTime?item.readTime:'未抄表'}}</div>
|
||||
</a-col>
|
||||
<a-col :span="12" style="text-align: right;">
|
||||
<span style="margin-right:15px;font-size:14px;">{{item.relayState=='1'?'在线':'离线'}}</span>
|
||||
<a-col :span="6" style="text-align: center;padding-top: 4px;">
|
||||
<div :class="item.relayState=='1'?'zxClass':'lxClass'">{{item.relayState=='1'?'在线':'离线'}}</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
</template>
|
||||
<p>
|
||||
<span>护理单元名称:{{item.nuName?item.nuName:'未配置'}}</span>
|
||||
</p>
|
||||
<p>
|
||||
<span>上次抄表时间:{{item.readTime?item.readTime:'未抄表'}}</span>
|
||||
</p>
|
||||
<p style="margin-top: 20px;">
|
||||
<span><Statistic title="用水量m³" :value="item.eleValue?item.eleValue:'无'" style="text-align:center;" /></span>
|
||||
</p>
|
||||
<a-row>
|
||||
<a-col :span="12" style="margin-top: -10px;">{{item.nuName?item.nuName:'未配置'}}</a-col>
|
||||
<a-col :span="12" style="text-align: right;margin-top: -10px;">
|
||||
<span style="text-align: right;background:#f6f6f6;padding: 2px 10px;border-radius:5px;">NUID: {{item.nuId?item.nuId:'未配置'}}</span>
|
||||
</a-col>
|
||||
<a-col :span="14" style="text-align: right;font-size: 44px;font-weight: bold;margin-top:18px;">
|
||||
<span>{{item.eleValue?item.eleValue:'0.00'}}</span>
|
||||
</a-col>
|
||||
<a-col :span="8" style="padding: 12px 0 0 5px;margin-top:18px;">
|
||||
<div style="font-size: 12px;margin: 8px 0 -5px 2px;">m³</div>
|
||||
<div style="margin-top:-3px;"><span style="background:#eeeeee;padding: 2px;border-radius:5px;font-size:11px;">用水量</span></div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-divider />
|
||||
<p style="text-align:center;">
|
||||
<span>
|
||||
<a @click="handleRead(item)">抄表</a>
|
||||
<a-divider type="vertical" />
|
||||
<a @click="handleControlLz(item)">开阀</a>
|
||||
<a-divider type="vertical" />
|
||||
<a @click="handleControlHz(item)">关阀</a>
|
||||
<a-divider type="vertical" />
|
||||
<a @click="handleReset(item)">清零</a>
|
||||
<a-divider type="vertical" />
|
||||
<a @click="showApiLog(item)">日志</a>
|
||||
</span>
|
||||
<span style="display:inline-block;" @click="handleRead(item)">
|
||||
<span class="tbClass"><img src="../../../../assets/iot/a1.png" style="width:20px;" /></span><br/>
|
||||
<span class="antTitle">抄表</span>
|
||||
</span>
|
||||
<span style="display:inline-block;margin-left:10%;" @click="handleControlLz(item)">
|
||||
<span class="tbClass"><img src="../../../../assets/iot/a5.png" style="width:20px;" /></span><br/>
|
||||
<span class="antTitle">开阀</span>
|
||||
</span>
|
||||
<span style="display:inline-block;margin-left:10%;" @click="handleControlHz(item)">
|
||||
<span class="tbClass"><img src="../../../../assets/iot/a2.png" style="width:20px;" /></span><br/>
|
||||
<span class="antTitle">关阀</span>
|
||||
</span>
|
||||
<span style="display:inline-block;margin-left:10%;" @click="handleReset(item)">
|
||||
<span class="tbClass"><img src="../../../../assets/iot/a3.png" style="width:20px;" /></span><br/>
|
||||
<span class="antTitle">清零</span>
|
||||
</span>
|
||||
<span style="display:inline-block;margin-left:10%;" @click="showApiLog(item)">
|
||||
<span class="tbClass"><img src="../../../../assets/iot/a4.png" style="width:20px;" /></span><br/>
|
||||
<span class="antTitle">日志</span>
|
||||
</span>
|
||||
</p>
|
||||
</a-card>
|
||||
</a-col>
|
||||
<a-col v-if="tableData.total==0" >
|
||||
<div style="margin: 30px auto;">
|
||||
<a-empty />
|
||||
</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<div
|
||||
<div v-if="tableData.total > 0"
|
||||
style="float:right;bottom: 20px;z-index: 999;padding: 8px 16px;border-radius: 4px;display: flex;align-items: center;">
|
||||
<span style="margin-right: 10px;">共 {{ tableData.total }} 条数据</span>
|
||||
<Pagination showLessItems v-model:current="pageParams.pageNo" :pageSize="pageParams.pageSize" size="small"
|
||||
|
@ -78,6 +101,7 @@
|
|||
import { Pagination } from 'ant-design-vue';
|
||||
|
||||
import ApiLogModal from "@/views/iot/tq/electricity/apilog/WaterApiLogModal.vue";
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import { set } from 'lodash-es';
|
||||
|
||||
const formRef = ref();
|
||||
|
@ -215,4 +239,31 @@ const pageParams = ref({ pageNo: 1, pageSize: 8 })
|
|||
display: block;
|
||||
position: absolute;
|
||||
}
|
||||
.zxClass{
|
||||
font-size:14px;
|
||||
background: linear-gradient(to right, #1ea0fa, #017de9);
|
||||
border-radius: 8px;
|
||||
height: 35px;
|
||||
color: white;
|
||||
line-height: 35px;
|
||||
}
|
||||
|
||||
.lxClass{
|
||||
font-size:14px;
|
||||
background: linear-gradient(to right, #cccccc, #cccccc);
|
||||
border-radius: 8px;
|
||||
height: 35px;
|
||||
color: white;
|
||||
line-height: 35px;
|
||||
}
|
||||
.tbClass{
|
||||
background: #f6f6f6;
|
||||
padding: 8px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.antTitle{
|
||||
margin-top: 10px;
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -14,7 +14,7 @@ export const columns: BasicColumn[] = [
|
|||
dataIndex: 'nuName'
|
||||
},
|
||||
{
|
||||
title: '设备序号',
|
||||
title: 'SN',
|
||||
align: "center",
|
||||
dataIndex: 'sn'
|
||||
},
|
||||
|
@ -99,7 +99,7 @@ export const searchFormSchema: FormSchema[] = [
|
|||
colProps: { span: 6 },
|
||||
},
|
||||
{
|
||||
label: '设备序号',
|
||||
label: 'SN',
|
||||
field: 'sn',
|
||||
component: 'Input',
|
||||
colProps: { span: 6 },
|
||||
|
@ -127,7 +127,7 @@ export const formSchema: FormSchema[] = [
|
|||
ifShow: false,
|
||||
},
|
||||
{
|
||||
label: '设备序号',
|
||||
label: 'SN',
|
||||
field: 'sn',
|
||||
component: 'Input',
|
||||
dynamicDisabled: ({ values }) => {
|
||||
|
@ -347,108 +347,49 @@ export const formSchema: FormSchema[] = [
|
|||
//列表数据
|
||||
export const logColumns: BasicColumn[] = [
|
||||
{
|
||||
title: '设备序号',
|
||||
title: 'SN',
|
||||
align: "center",
|
||||
dataIndex: 'sn'
|
||||
},
|
||||
{
|
||||
title: '操作时间',
|
||||
title: '抄表时间',
|
||||
align: "center",
|
||||
dataIndex: 'optTime'
|
||||
},
|
||||
// {
|
||||
// title: '数据上报时间',
|
||||
// align: "center",
|
||||
// dataIndex: 'reportingTime'
|
||||
// },
|
||||
// {
|
||||
// title: '操作人',
|
||||
// align: "center",
|
||||
// dataIndex: 'optBy'
|
||||
// },
|
||||
{
|
||||
title: '操作人',
|
||||
title: '温度',
|
||||
align: "center",
|
||||
dataIndex: 'optBy'
|
||||
dataIndex: 'temperature',
|
||||
},
|
||||
{
|
||||
title: '操作类型',
|
||||
title: '湿度',
|
||||
align: "center",
|
||||
dataIndex: 'optType',
|
||||
dataIndex: 'humidity',
|
||||
},
|
||||
// {
|
||||
// title: '设备状态',
|
||||
// align: "center",
|
||||
// dataIndex: 'status',
|
||||
// customRender:({record})=>{
|
||||
// return record.status?(record.status=='0'?'在线':'离线'):'';
|
||||
// },
|
||||
// },
|
||||
{
|
||||
title: '状态',
|
||||
align: "center",
|
||||
dataIndex: 'status',
|
||||
customRender:({record})=>{
|
||||
if(record.optType == 'insert'){
|
||||
return '新增';
|
||||
}else if(record.optType == 'update'){
|
||||
return '修改';
|
||||
}else if(record.optType == 'delete'){
|
||||
return '删除';
|
||||
}else{
|
||||
return '';
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '记录间隔',
|
||||
align: "center",
|
||||
dataIndex: 'recordInterval'
|
||||
},
|
||||
{
|
||||
title: '上报间隔',
|
||||
align: "center",
|
||||
dataIndex: 'reportingInterval'
|
||||
},
|
||||
{
|
||||
title: '历史数据上报时刻',
|
||||
align: "center",
|
||||
dataIndex: 'historyReportTime'
|
||||
},
|
||||
{
|
||||
title: '历史数据上报间隔',
|
||||
align: "center",
|
||||
dataIndex: 'historyInterval'
|
||||
},
|
||||
{
|
||||
title: '温度预警-上限',
|
||||
align: "center",
|
||||
dataIndex: 'temperatureHigh'
|
||||
},
|
||||
{
|
||||
title: '温度预警-下限',
|
||||
align: "center",
|
||||
dataIndex: 'temperatureLow'
|
||||
},
|
||||
{
|
||||
title: '温度缓冲值',
|
||||
align: "center",
|
||||
dataIndex: 'temperatureBuffer'
|
||||
},
|
||||
{
|
||||
title: '湿度预警-上限',
|
||||
align: "center",
|
||||
dataIndex: 'humidityHigh'
|
||||
},
|
||||
{
|
||||
title: '湿度预警-下限',
|
||||
align: "center",
|
||||
dataIndex: 'humidityLow'
|
||||
},
|
||||
{
|
||||
title: '湿度缓冲值',
|
||||
align: "center",
|
||||
dataIndex: 'humidityBuffer'
|
||||
},
|
||||
{
|
||||
title: '断电报警',
|
||||
align: "center",
|
||||
dataIndex: 'izOutages',
|
||||
customRender:({record})=>{
|
||||
return record.izOutages?(record.izOutages=='0'?'开启':'关闭'):'';
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '低电报警',
|
||||
align: "center",
|
||||
dataIndex: 'izLowBattery',
|
||||
customRender:({record})=>{
|
||||
return record.izLowBattery?(record.izLowBattery=='0'?'开启':'关闭'):'';
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '上下线通知',
|
||||
align: "center",
|
||||
dataIndex: 'izOnline',
|
||||
customRender:({record})=>{
|
||||
return record.izOnline?(record.izOnline=='0'?'开启':'关闭'):'';
|
||||
return record.status?(record.status=='0'?'抄表成功':'抄表失败'):'';
|
||||
},
|
||||
},
|
||||
];
|
||||
|
@ -473,7 +414,7 @@ export const logQuerySchema: FormSchema[] = [
|
|||
//列表数据
|
||||
export const alarmColumns: BasicColumn[] = [
|
||||
{
|
||||
title: '设备序号',
|
||||
title: 'SN',
|
||||
align: "center",
|
||||
dataIndex: 'sn'
|
||||
},
|
||||
|
|