添加供应商入驻流程
This commit is contained in:
parent
4db7e738d2
commit
82a52c3b6c
|
|
@ -0,0 +1,94 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/bizSuppliers/nuBizSuppliersApply/list',
|
||||
listPage = '/bizSuppliers/nuBizSuppliersApply/listPage',
|
||||
getModifyHistoryInfo = '/bizSuppliers/nuBizSuppliersApply/getModifyHistoryInfo',
|
||||
getModifyInfo = '/bizSuppliers/nuBizSuppliersApply/getModifyInfo',
|
||||
save='/bizSuppliers/nuBizSuppliersApply/add',
|
||||
edit='/bizSuppliers/nuBizSuppliersApply/edit',
|
||||
audit='/bizSuppliers/nuBizSuppliersApply/audit',
|
||||
bgAudit='/bizSuppliers/nuBizSuppliersApply/bgAudit',
|
||||
deleteOne = '/bizSuppliers/nuBizSuppliersApply/delete',
|
||||
deleteBatch = '/bizSuppliers/nuBizSuppliersApply/deleteBatch',
|
||||
importExcel = '/bizSuppliers/nuBizSuppliersApply/importExcel',
|
||||
exportXls = '/bizSuppliers/nuBizSuppliersApply/exportXls',
|
||||
}
|
||||
|
||||
export const getModifyHistoryInfo = (params) => {
|
||||
return defHttp.post({ url: Api.getModifyHistoryInfo, params });
|
||||
};
|
||||
export const getModifyInfo = (params) => {
|
||||
return defHttp.post({ url: Api.getModifyInfo, params });
|
||||
};
|
||||
/**
|
||||
* 审批提交
|
||||
* @param params
|
||||
*/
|
||||
export const auditSubmit = (params) => {
|
||||
return defHttp.post({ url: Api.audit, params });
|
||||
};
|
||||
export const bgAuditSubmit = (params) => {
|
||||
return defHttp.post({ url: Api.bgAudit, params });
|
||||
};
|
||||
/**
|
||||
* 导出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 });
|
||||
export const listPage = (params) => defHttp.get({ url: Api.listPage, 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,185 @@
|
|||
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: 'suppliersName'
|
||||
},
|
||||
{
|
||||
title: '供应商性质',
|
||||
align: "center",
|
||||
dataIndex: 'suppliersNature_dictText',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '负责人',
|
||||
align: "center",
|
||||
dataIndex: 'personInCharge',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '联系电话',
|
||||
align: "center",
|
||||
dataIndex: 'contactNumber',
|
||||
width: 100
|
||||
},
|
||||
// {
|
||||
// title: '供应状态',
|
||||
// align: "center",
|
||||
// dataIndex: 'supplyState_dictText'
|
||||
// },
|
||||
{
|
||||
title: '供应商地址',
|
||||
align: "center",
|
||||
dataIndex: 'suppliersAddress'
|
||||
},
|
||||
{
|
||||
title: '开户行',
|
||||
align: "center",
|
||||
dataIndex: 'openingBank'
|
||||
},
|
||||
{
|
||||
title: '开户行账号',
|
||||
align: "center",
|
||||
dataIndex: 'openingBankNo'
|
||||
},
|
||||
{
|
||||
title: '资质照片',
|
||||
align: "center",
|
||||
dataIndex: 'imgPath',
|
||||
customRender: render.renderImage,
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '审核状态',
|
||||
align: "center",
|
||||
dataIndex: 'applyStatus',
|
||||
customRender: ({ text, record }) => {
|
||||
var applyStatus = '';
|
||||
if (text == '1' || text == '4') {
|
||||
applyStatus = '待审核';
|
||||
} else if (text == '2') {
|
||||
applyStatus = '审核通过';
|
||||
} else if (text == '3' || text == '5') {
|
||||
applyStatus = '审核驳回';
|
||||
}
|
||||
return applyStatus;
|
||||
},
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '审核内容',
|
||||
align: "center",
|
||||
dataIndex: 'applyContent',
|
||||
width: 150
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
//列表数据
|
||||
export const columns2: BasicColumn[] = [
|
||||
{
|
||||
title: '供应商名称',
|
||||
align: "center",
|
||||
dataIndex: 'suppliersName'
|
||||
},
|
||||
{
|
||||
title: '供应商性质',
|
||||
align: "center",
|
||||
dataIndex: 'suppliersNature_dictText',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '负责人',
|
||||
align: "center",
|
||||
dataIndex: 'personInCharge',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '联系电话',
|
||||
align: "center",
|
||||
dataIndex: 'contactNumber',
|
||||
width: 100
|
||||
},
|
||||
// {
|
||||
// title: '供应状态',
|
||||
// align: "center",
|
||||
// dataIndex: 'supplyState_dictText'
|
||||
// },
|
||||
{
|
||||
title: '供应商地址',
|
||||
align: "center",
|
||||
dataIndex: 'suppliersAddress'
|
||||
},
|
||||
{
|
||||
title: '开户行',
|
||||
align: "center",
|
||||
dataIndex: 'openingBank'
|
||||
},
|
||||
{
|
||||
title: '开户行账号',
|
||||
align: "center",
|
||||
dataIndex: 'openingBankNo'
|
||||
},
|
||||
{
|
||||
title: '资质照片',
|
||||
align: "center",
|
||||
dataIndex: 'imgPath',
|
||||
customRender: render.renderImage,
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '审核状态',
|
||||
align: "center",
|
||||
dataIndex: 'applyStatus',
|
||||
customRender: ({ text, record }) => {
|
||||
var applyStatus = '';
|
||||
if (text == '1' || text == '4') {
|
||||
applyStatus = '待审核';
|
||||
} else if (text == '2') {
|
||||
applyStatus = '审核通过';
|
||||
} else if (text == '3' || text == '5') {
|
||||
applyStatus = '审核驳回';
|
||||
}
|
||||
return applyStatus;
|
||||
},
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '审核内容',
|
||||
align: "center",
|
||||
dataIndex: 'applyContent',
|
||||
width: 150
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
suppliersName: {title: '供应商名称',order: 0,view: 'text', type: 'string',},
|
||||
suppliersNature: {title: '供应商性质',order: 1,view: 'list', type: 'string',dictCode: '',},
|
||||
suppliersAddress: {title: '供应商地址',order: 2,view: 'text', type: 'string',},
|
||||
personInCharge: {title: '负责人',order: 3,view: 'text', type: 'string',},
|
||||
contactNumber: {title: '联系电话',order: 4,view: 'text', type: 'string',},
|
||||
supplyState: {title: '供应状态',order: 5,view: 'list', type: 'string',dictCode: '',},
|
||||
openingBank: {title: '开户行',order: 6,view: 'text', type: 'string',},
|
||||
openingBankNo: {title: '开户行账号',order: 7,view: 'text', type: 'string',},
|
||||
imgPath: {title: '资质照片',order: 8,view: 'image', type: 'string',},
|
||||
status: {title: '审核状态',order: 9,view: 'text', type: 'string',},
|
||||
auditContent: {title: '审核内容',order: 10,view: 'text', type: 'string',},
|
||||
};
|
||||
|
||||
export const applyObj = {
|
||||
suppliersName: '供应商名称',
|
||||
suppliersNature: '供应商性质',
|
||||
suppliersAddress: '供应商地址',
|
||||
personInCharge: '负责人',
|
||||
contactNumber: '联系电话',
|
||||
openingBank: '开户行',
|
||||
openingBankNo: '开户行账号',
|
||||
imgPath: '营业执照',
|
||||
};
|
||||
|
|
@ -0,0 +1,238 @@
|
|||
<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="suppliersName">
|
||||
<template #label><span title="供应商名称">供应商名</span></template>
|
||||
<JInput v-model:value="queryParam.suppliersName" placeholder="请输入供应商名称" />
|
||||
</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>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<NuBizSuppliersApplyModal ref="registerModal" @success="handleSuccess"></NuBizSuppliersApplyModal>
|
||||
<NuBizSuppliersAuditHistoryModal ref="registerHistoryModal" @success="handleSuccess"></NuBizSuppliersAuditHistoryModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="bizSuppliers-nuBizSuppliersApply" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, superQuerySchema } from './NuBizSuppliersApply.data';
|
||||
import { listPage, deleteOne, batchDelete, getImportUrl, getExportUrl } from './NuBizSuppliersApply.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import NuBizSuppliersAuditHistoryModal from './NuBizSuppliersAuditHistoryModal.vue'
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
||||
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
const registerHistoryModal = ref();
|
||||
const userStore = useUserStore();
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '供应商申请信息',
|
||||
api: listPage,
|
||||
columns,
|
||||
canResize:false,
|
||||
useSearchForm: false,
|
||||
actionColumn: {
|
||||
width: 220,
|
||||
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:8,
|
||||
xl:8,
|
||||
xxl:8
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: 24,
|
||||
sm: 16,
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 信息变更审核
|
||||
* @param record
|
||||
*/
|
||||
function handleUpEdit(record: Recordable) {
|
||||
record.status = null;
|
||||
record.applyContent = null;
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.upInfoEdit(record);
|
||||
}
|
||||
/**
|
||||
* 审核历史详情
|
||||
*/
|
||||
function handleHistoryList(record: Recordable) {
|
||||
registerHistoryModal.value.disableSubmit = true;
|
||||
registerHistoryModal.value.edit(record);
|
||||
}
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '新供应商审核',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
ifShow: record.applyStatus == '1'
|
||||
},
|
||||
{
|
||||
label: '信息变更审核',
|
||||
onClick: handleUpEdit.bind(null, record),
|
||||
ifShow: record.applyStatus == '4'
|
||||
},
|
||||
{
|
||||
label: '审核历史',
|
||||
onClick: handleHistoryList.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}, {
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
auth: 'bizSuppliers:nu_biz_suppliers_apply: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,231 @@
|
|||
<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="suppliersName">
|
||||
<template #label><span title="供应商名称">供应商名称</span></template>
|
||||
<j-input placeholder="请输入供应商名称" v-model:value="queryParam.suppliersName" allow-clear></j-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="personInCharge">
|
||||
<template #label><span title="负责人">负责人</span></template>
|
||||
<j-input placeholder="请输入负责人" v-model:value="queryParam.personInCharge" allow-clear></j-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="applyStatus">
|
||||
<template #label><span title="审核状态">审核状态</span></template>
|
||||
<a-select v-model:value="queryParam.applyStatus" placeholder="请选择审核状态" style="width: 200px"
|
||||
:disabled="false">
|
||||
<a-select-option value="1,2,3,4,5">全部</a-select-option>
|
||||
<a-select-option value="1,4">待审核</a-select-option>
|
||||
<a-select-option value="2">审核通过</a-select-option>
|
||||
<a-select-option value="3,5">审核驳回</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :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>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
<!-- <template v-if="column.dataIndex ==='imgPath'">
|
||||
<j-image-upload :fileMax="1" :value="opeMediaAddress + text" disabled></j-image-upload>
|
||||
</template> -->
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<NuBizSuppliersApplyHistoryModal ref="registerModal" @success="handleSuccess"></NuBizSuppliersApplyHistoryModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="configSuppliersApply-nuConfigSuppliersApply" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns2, superQuerySchema } from './NuBizSuppliersApply.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './NuBizSuppliersApply.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import NuBizSuppliersApplyHistoryModal from './components/NuConfigSuppliersApplyHistoryModal.vue'
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import JInput from '/@/components/Form/src/jeecg/components/JInput.vue';
|
||||
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
|
||||
const opeMediaAddress = import.meta.env.VITE_OPE_MEDIA_ADDRESS
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
const registerDetailModal = ref();
|
||||
const suppliersId = ref<any>('');
|
||||
const userStore = useUserStore();
|
||||
const { createMessage } = useMessage();
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: 'nu_config_suppliers_apply',
|
||||
api: list,
|
||||
columns:columns2,
|
||||
canResize: false,
|
||||
useSearchForm: false,
|
||||
actionColumn: {
|
||||
width: 100,
|
||||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: async (params) => {
|
||||
if (!queryParam.applyStatus) {
|
||||
// queryParam.applyStatus = '1,2,3,4,5'
|
||||
}
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
const labelCol = reactive({
|
||||
xs: 24,
|
||||
sm: 4,
|
||||
xl: 6,
|
||||
xxl: 6
|
||||
});
|
||||
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 handleDetail(record: Recordable) {
|
||||
console.log("🚀 ~ handleDetail ~ record:", record)
|
||||
if(record.optType == '变更'){
|
||||
registerModal.value.disableSubmit = true;
|
||||
registerModal.value.edit(record);
|
||||
}else if(record.optType == '入驻'){
|
||||
registerModal.value.disableSubmit = true;
|
||||
registerModal.value.editDitail(record);
|
||||
}else{
|
||||
createMessage.error('错误数据,请联系管员');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
function searchQuery() {
|
||||
queryParam.suppliersId = suppliersId.value;
|
||||
reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function searchReset() {
|
||||
formRef.value.resetFields();
|
||||
selectedRowKeys.value = [];
|
||||
//刷新数据
|
||||
searchQuery();
|
||||
}
|
||||
|
||||
//初始化
|
||||
function init(record) {
|
||||
console.log("🚀 ~ init ~ record:", record)
|
||||
suppliersId.value = record.suppliersId;
|
||||
searchQuery();
|
||||
}
|
||||
|
||||
|
||||
defineExpose({
|
||||
init,
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.jeecg-basic-table-form-container {
|
||||
padding: 0;
|
||||
|
||||
.table-page-search-submitButtons {
|
||||
display: block;
|
||||
margin-bottom: 14px;
|
||||
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,94 @@
|
|||
<template>
|
||||
|
||||
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true"
|
||||
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '14px' }" @close="handleCancel">
|
||||
<NuBizSuppliersAuditHistoryList ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false">
|
||||
</NuBizSuppliersAuditHistoryList>
|
||||
<template #footer>
|
||||
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
|
||||
<a-button type="primary" @click="handleOk" v-if="!disableSubmit">确认</a-button>
|
||||
</template>
|
||||
</a-drawer>
|
||||
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import NuBizSuppliersAuditHistoryList from './NuBizSuppliersAuditHistoryList.vue'
|
||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||
|
||||
const title = ref<string>('');
|
||||
const width = ref<string>('1400');
|
||||
const visible = ref<boolean>(false);
|
||||
const disableSubmit = ref<boolean>(false);
|
||||
const registerForm = ref();
|
||||
const upInfoForm = ref();
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
title.value = '新增';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.add();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param record
|
||||
*/
|
||||
function edit(record) {
|
||||
title.value = "审核历史";
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.init(record);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 确定按钮点击事件
|
||||
*/
|
||||
function handleOk() {
|
||||
registerForm.value.submitForm();
|
||||
}
|
||||
|
||||
/**
|
||||
* form保存回调事件
|
||||
*/
|
||||
function submitCallback() {
|
||||
handleCancel();
|
||||
emit('success');
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消按钮回调事件
|
||||
*/
|
||||
function handleCancel() {
|
||||
visible.value = false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息变更确认
|
||||
*/
|
||||
function handleUpInfoOk() {
|
||||
upInfoForm.value.submitForm();
|
||||
}
|
||||
|
||||
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 = '/bizSuppliers/nuBizSuppliersInfo/list',
|
||||
save='/bizSuppliers/nuBizSuppliersInfo/add',
|
||||
edit='/bizSuppliers/nuBizSuppliersInfo/edit',
|
||||
deleteOne = '/bizSuppliers/nuBizSuppliersInfo/delete',
|
||||
deleteBatch = '/bizSuppliers/nuBizSuppliersInfo/deleteBatch',
|
||||
importExcel = '/bizSuppliers/nuBizSuppliersInfo/importExcel',
|
||||
exportXls = '/bizSuppliers/nuBizSuppliersInfo/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,73 @@
|
|||
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: 'suppliersName'
|
||||
},
|
||||
{
|
||||
title: '供应商性质',
|
||||
align: "center",
|
||||
dataIndex: 'suppliersNature_dictText'
|
||||
},
|
||||
{
|
||||
title: '供应商地址',
|
||||
align: "center",
|
||||
dataIndex: 'suppliersAddress'
|
||||
},
|
||||
{
|
||||
title: '负责人',
|
||||
align: "center",
|
||||
dataIndex: 'personInCharge'
|
||||
},
|
||||
{
|
||||
title: '联系电话',
|
||||
align: "center",
|
||||
dataIndex: 'contactNumber'
|
||||
},
|
||||
// {
|
||||
// title: '供应状态',
|
||||
// align: "center",
|
||||
// dataIndex: 'supplyState_dictText'
|
||||
// },
|
||||
{
|
||||
title: '开户行',
|
||||
align: "center",
|
||||
dataIndex: 'openingBank'
|
||||
},
|
||||
{
|
||||
title: '开户行账号',
|
||||
align: "center",
|
||||
dataIndex: 'openingBankNo'
|
||||
},
|
||||
{
|
||||
title: '资质照片',
|
||||
align: "center",
|
||||
dataIndex: 'imgPath',
|
||||
customRender: render.renderImage,
|
||||
},
|
||||
{
|
||||
title: '创建日期',
|
||||
align: "center",
|
||||
dataIndex: 'createTime'
|
||||
},
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
suppliersName: {title: '供应商名称',order: 0,view: 'text', type: 'string',},
|
||||
suppliersNature: {title: '供应商性质',order: 1,view: 'list', type: 'string',dictCode: 'suppliers_nature',},
|
||||
suppliersAddress: {title: '供应商地址',order: 2,view: 'text', type: 'string',},
|
||||
personInCharge: {title: '负责人',order: 3,view: 'text', type: 'string',},
|
||||
contactNumber: {title: '联系电话',order: 4,view: 'text', type: 'string',},
|
||||
supplyState: {title: '供应状态',order: 5,view: 'list', type: 'string',dictCode: 'supply_status',},
|
||||
openingBank: {title: '开户行',order: 6,view: 'text', type: 'string',},
|
||||
openingBankNo: {title: '开户行账号',order: 7,view: 'text', type: 'string',},
|
||||
imgPath: {title: '资质照片',order: 8,view: 'image', type: 'string',},
|
||||
createTime: {title: '创建日期',order: 9,view: 'datetime', type: 'string',},
|
||||
};
|
||||
|
|
@ -0,0 +1,252 @@
|
|||
<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="suppliersName">
|
||||
<template #label><span title="供应商名称">供应商名</span></template>
|
||||
<JInput v-model:value="queryParam.suppliersName" placeholder="请输入供应商名称"/>
|
||||
</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>
|
||||
<a-button type="primary" v-auth="'bizSuppliers:nu_biz_suppliers_info:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||
<a-button type="primary" v-auth="'bizSuppliers:nu_biz_suppliers_info:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
|
||||
<j-upload-button type="primary" v-auth="'bizSuppliers:nu_biz_suppliers_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="'bizSuppliers:nu_biz_suppliers_info:deleteBatch'">批量操作
|
||||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<NuBizSuppliersInfoModal ref="registerModal" @success="handleSuccess"></NuBizSuppliersInfoModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="bizSuppliers-nuBizSuppliersInfo" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, superQuerySchema } from './NuBizSuppliersInfo.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './NuBizSuppliersInfo.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import NuBizSuppliersInfoModal from './components/NuBizSuppliersInfoModal.vue'
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
||||
|
||||
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:8,
|
||||
xl:8,
|
||||
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: handleDetail.bind(null, record),
|
||||
}
|
||||
// {
|
||||
// label: '编辑',
|
||||
// onClick: handleEdit.bind(null, record),
|
||||
// auth: 'bizSuppliers:nu_biz_suppliers_info:edit'
|
||||
// },
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}, {
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
auth: 'bizSuppliers:nu_biz_suppliers_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,261 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<div class="container2">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-table :dataSource="filteredTableData" :columns="columns" :pagination="false" bordered size="small"
|
||||
:rowClassName="setRowClassName">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex === 'd1'">
|
||||
<span>{{ applyObj[record.d1] }}</span>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'd2' && isImg(record.d1)">
|
||||
<JImageUpload v-if="!!record.d2" :fileMax="1" :value="record.d2" disabled>
|
||||
</JImageUpload>
|
||||
<span v-else>未上传</span>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'd3' && isImg(record.d1)">
|
||||
<JImageUpload v-if="!!record.d3" :fileMax="1" :value="record.d3" disabled>
|
||||
</JImageUpload>
|
||||
<span v-else>未上传</span>
|
||||
</template>
|
||||
<template
|
||||
v-if="column.dataIndex === 'd2' && (record.d1 == 'orgProvince' || record.d1 == 'orgCity' || record.d1 == 'orgDistrict')">
|
||||
<span>{{ provinceOptions[record.d2] }}</span>
|
||||
</template>
|
||||
<template
|
||||
v-if="column.dataIndex === 'd3' && (record.d1 == 'orgProvince' || record.d1 == 'orgCity' || record.d1 == 'orgDistrict')">
|
||||
<span>{{ provinceOptions[record.d3] }}</span>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'd2' && record.d1 == 'orgBuildingArea'">
|
||||
<span>{{ record.d2 }}㎡</span>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'd3' && record.d1 == 'orgBuildingArea'">
|
||||
<span>{{ record.d3 }}㎡</span>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'd2' && record.d1 == 'endTime'">
|
||||
<span>{{ record.d2 == '9999-12-31' ? '长期' : record.d2 }}</span>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'd3' && record.d1 == 'endTime'">
|
||||
<span>{{ record.d3 == '9999-12-31' ? '长期' : record.d3 }}</span>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-form style="margin-top: 14px;height: 100px;" ref="formRef" layout="horizontal" :model="formData"
|
||||
:label-col="labelCol" :wrapper-col="wrapperCol">
|
||||
<a-row :gutter="16">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="审核状态" name="status" v-bind="validateInfos.status">
|
||||
<a-select v-model:value="formData.status" style="width: 200px" placeholder="请选择审核状态">
|
||||
<a-select-option value="modifyPass">审核通过</a-select-option>
|
||||
<a-select-option value="modifyFail">审核驳回</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12" v-if="formData.status == 'modifyFail'">
|
||||
<a-form-item label="驳回原因" name="applyContent" v-bind="validateInfos.applyContent">
|
||||
<a-textarea :maxlength="50" show-count v-model:value="formData.applyContent" placeholder="请输入驳回原因(如驳回)"
|
||||
style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, computed, onMounted } from 'vue';
|
||||
import { Table as ATable, Input, Row, Col, Form } from 'ant-design-vue';
|
||||
import { applyObj } from '../NuBizSuppliersApply.data'
|
||||
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
|
||||
import { getModifyInfo, bgAuditSubmit } from '../NuBizSuppliersApply.api';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { initDictOptions } from '/@/utils/dict';
|
||||
|
||||
const opeMediaAddress = import.meta.env.VITE_OPE_MEDIA_ADDRESS
|
||||
const formRef = ref();
|
||||
const AForm = Form;
|
||||
const AFormItem = Form.Item;
|
||||
const useForm = Form.useForm;
|
||||
const { createMessage } = useMessage();
|
||||
const confirmLoading = ref<boolean>(false);
|
||||
// 表单标签布局配置
|
||||
const labelCol = { span: 6 }; // 标签宽度
|
||||
const wrapperCol = { span: 18 }; // 控件宽度
|
||||
const isImg = (v_) => {
|
||||
return v_ == 'imgPath'
|
||||
}
|
||||
const provinceOptions = ref({})
|
||||
const formData = reactive<Record<string, any>>({
|
||||
status: undefined,
|
||||
applyContent: '',
|
||||
id: '',
|
||||
pkId: '',
|
||||
openId:'',
|
||||
});
|
||||
const validatorRules = reactive({
|
||||
status: [{ required: true, message: '请选择审核状态!' },],
|
||||
applyContent: [
|
||||
{
|
||||
validator: async (_rule, value) => {
|
||||
if (formData.status === 'modifyFail' && !value) {
|
||||
return Promise.reject('请输入驳回原因!');
|
||||
}
|
||||
return Promise.resolve();
|
||||
},
|
||||
},
|
||||
],
|
||||
})
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||
const tableData = ref([]);
|
||||
const emit = defineEmits(['ok']);
|
||||
// 计算属性,过滤掉不需要显示的字段
|
||||
const filteredTableData = computed(() => {
|
||||
return tableData.value.filter(item =>
|
||||
item.d1 !== 'id'
|
||||
&& item.d1 !== 'supplyState'
|
||||
&& item.d1 !== 'wechartId'
|
||||
&& item.d1 !== 'delFlag'
|
||||
&& item.d1 !== 'createBy'
|
||||
&& item.d1 !== 'createTime'
|
||||
&& item.d1 !== 'updateBy'
|
||||
&& item.d1 !== 'updateTime'
|
||||
&& item.d1 !== 'sysOrgCode'
|
||||
&& item.d1 !== 'izEnabled'
|
||||
&& item.d1 !== 'sourceType'
|
||||
&& item.d1 !== 'openId'
|
||||
);
|
||||
});
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: '名称',
|
||||
dataIndex: 'd1',
|
||||
key: 'd1',
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
title: '变更前',
|
||||
dataIndex: 'd2',
|
||||
key: 'd2',
|
||||
},
|
||||
{
|
||||
title: '变更后',
|
||||
dataIndex: 'd3',
|
||||
key: 'd3',
|
||||
}
|
||||
];
|
||||
|
||||
// 设置行类名
|
||||
const setRowClassName = (record) => {
|
||||
return record.d2 !== record.d3 && record.d1 !== 'createTime' ? 'highlight-row' : '';
|
||||
};
|
||||
|
||||
const fieldMap = {
|
||||
suppliersName: 'suppliersName',
|
||||
suppliersNature: 'suppliersNature',
|
||||
suppliersAddress: 'suppliersAddress',
|
||||
personInCharge: 'personInCharge',
|
||||
contactNumber: 'contactNumber',
|
||||
openingBank: 'openingBank',
|
||||
openingBankNo: 'openingBankNo',
|
||||
imgPath: 'imgPath',
|
||||
};
|
||||
|
||||
async function show(record) {
|
||||
let data = await getModifyInfo({ id: record.id })
|
||||
|
||||
formData.id = record.id
|
||||
formData.suppliersId = record.suppliersId
|
||||
|
||||
// 存储id和pkId到formData
|
||||
Object.keys(fieldMap).forEach(fieldName => {
|
||||
const record = data.find(item => item.d1 === fieldName);
|
||||
if (record) {
|
||||
formData[fieldName] = record.d3;
|
||||
}
|
||||
});
|
||||
|
||||
tableData.value = data.map(item => ({
|
||||
...item,
|
||||
// 处理null/undefined显示为空字符串
|
||||
d2: item.d2 ?? '',
|
||||
d3: item.d3 ?? ''
|
||||
}));
|
||||
}
|
||||
|
||||
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 = false;
|
||||
|
||||
if (formData.startTime) {
|
||||
formData.startTime = formData.startTime.replace(/-/g, '.');
|
||||
}
|
||||
if (formData.endTime) {
|
||||
formData.endTime = formData.endTime.replace(/-/g, '.');
|
||||
}
|
||||
await bgAuditSubmit(formData)
|
||||
.then((res) => {
|
||||
confirmLoading.value = false;
|
||||
emit('ok');
|
||||
})
|
||||
}
|
||||
|
||||
// 初始化numberValues
|
||||
onMounted(async () => {
|
||||
const dictData = await initDictOptions('sys_category,name,id,first_letter is not null order by code asc', '');
|
||||
dictData.reduce((prev, next) => {
|
||||
if (next) {
|
||||
provinceOptions.value[next['value']] = next['text'] || next['label']
|
||||
}
|
||||
return prev;
|
||||
}, []);
|
||||
});
|
||||
|
||||
defineExpose({
|
||||
show,
|
||||
submitForm
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.container2 {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.antd-modal-form {
|
||||
// padding: 14px;
|
||||
}
|
||||
|
||||
:deep(.ant-table-cell) {
|
||||
padding: 8px 12px !important;
|
||||
}
|
||||
|
||||
// 高亮行样式
|
||||
:deep(.highlight-row) {
|
||||
background-color: #fff1f0 !important; // 浅红色背景
|
||||
}
|
||||
|
||||
// 表单样式调整
|
||||
:deep(.ant-form-item) {
|
||||
// margin-bottom: 16px;
|
||||
}
|
||||
|
||||
:deep(.ant-table-cell-row-hover) {
|
||||
// border: 1px solid red;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,246 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<JFormContainer :disabled="disabled">
|
||||
<template #detail>
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
||||
name="NuConfigSuppliersApplyForm">
|
||||
<a-row>
|
||||
<a-col :span="24" style="border-bottom: 2px solid #f7f7f7; margin-bottom: 14px;">
|
||||
<SectionDivider :title="'基本信息'" />
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="供应商名称" v-bind="validateInfos.suppliersName"
|
||||
id="NuConfigSuppliersApplyForm-suppliersName" name="suppliersName">
|
||||
<a-input v-model:value="formData.suppliersName" placeholder="请输入供应商名称" disabled></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="供应商性质" v-bind="validateInfos.suppliersNature_dictText"
|
||||
id="NuConfigSuppliersApplyForm-suppliersNature_dictText" name="suppliersNature_dictText">
|
||||
<a-input v-model:value="formData.suppliersNature_dictText" placeholder="请输入供应商性质" disabled></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="供应商地址" v-bind="validateInfos.suppliersAddress"
|
||||
id="NuConfigSuppliersApplyForm-suppliersAddress" name="suppliersAddress">
|
||||
<a-textarea v-model:value="formData.suppliersAddress" placeholder="请输入供应商地址" rows="2" disabled></a-textarea>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="负责人" v-bind="validateInfos.personInCharge"
|
||||
id="NuConfigSuppliersApplyForm-personInCharge" name="personInCharge">
|
||||
<a-input v-model:value="formData.personInCharge" placeholder="请输入负责人" disabled></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="联系电话" v-bind="validateInfos.contactNumber"
|
||||
id="NuConfigSuppliersApplyForm-contactNumber" name="contactNumber">
|
||||
<a-input v-model:value="formData.contactNumber" placeholder="请输入联系电话" disabled></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="开户行" v-bind="validateInfos.openingBank" id="NuConfigSuppliersApplyForm-openingBank"
|
||||
name="openingBank">
|
||||
<a-input v-model:value="formData.openingBank" placeholder="请输入开户行" disabled></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="开户行账号" v-bind="validateInfos.openingBankNo"
|
||||
id="NuConfigSuppliersApplyForm-openingBankNo" name="openingBankNo">
|
||||
<a-input v-model:value="formData.openingBankNo" placeholder="请输入开户行账号" disabled></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="营业执照" v-bind="validateInfos.imgPath" id="NuConfigSuppliersApplyForm-imgPath"
|
||||
name="imgPath">
|
||||
<!-- <a-input v-model:value="formData.imgPath" placeholder="请输入营业执照" disabled ></a-input> -->
|
||||
<j-image-upload v-if="formData.imgPath" :fileMax="1" :value="opeMediaAddress + formData.imgPath"
|
||||
disabled></j-image-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" style="border-bottom: 2px solid #f7f7f7; margin-bottom: 14px;" >
|
||||
<SectionDivider :title="'审核信息'" />
|
||||
</a-col>
|
||||
<a-col :span="24" >
|
||||
<a-form-item label="审核状态" v-bind="validateInfos.applyStatus" id="NuConfigSuppliersApplyForm-applyStatus"
|
||||
name="applyStatus">
|
||||
<!-- <a-input v-model:value="formData.applyStatus" placeholder="请输入审核状态" ></a-input> -->
|
||||
<a-select v-model:value="formData.applyStatus" placeholder="请选择审核状态" style="width: 200px"
|
||||
:disabled="false">
|
||||
<a-select-option value="1">待审核</a-select-option>
|
||||
<a-select-option value="2">审核通过</a-select-option>
|
||||
<a-select-option value="3">审核驳回</a-select-option>
|
||||
<a-select-option value="4">待审核</a-select-option>
|
||||
<a-select-option value="5">审核驳回</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" v-show="formData.applyStatus == 3 || formData.applyStatus == 5">
|
||||
<a-form-item label="驳回原因" v-bind="validateInfos.applyContent" id="NuConfigSuppliersApplyForm-applyContent"
|
||||
name="applyContent">
|
||||
<a-textarea :maxlength="50" show-count v-model:value="formData.applyContent" placeholder="请输入驳回原因" rows="4"></a-textarea>
|
||||
</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 '../NuBizSuppliersApply.api';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
|
||||
const opeMediaAddress = import.meta.env.VITE_OPE_MEDIA_ADDRESS
|
||||
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: '',
|
||||
suppliersName: '',
|
||||
suppliersNature: '',
|
||||
suppliersAddress: '',
|
||||
personInCharge: '',
|
||||
contactNumber: '',
|
||||
supplyState: '',
|
||||
openingBank: '',
|
||||
openingBankNo: '',
|
||||
wechartId: '',
|
||||
imgPath: '',
|
||||
applyStatus: '',
|
||||
applyContent: '',
|
||||
suppliersNature_dictText: '',
|
||||
applyId: '',
|
||||
suppliersId: '',
|
||||
sourceType: '',
|
||||
});
|
||||
const { createMessage } = useMessage();
|
||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 6 } });
|
||||
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
|
||||
const labelCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 2 } });
|
||||
const wrapperCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 20 } });
|
||||
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(',');
|
||||
}
|
||||
}
|
||||
}
|
||||
if (model.applyStatus == '1') {
|
||||
createMessage.warning('请选择审核状态');
|
||||
confirmLoading.value = false;
|
||||
return;
|
||||
}
|
||||
if (model.applyStatus == 3 && !model.applyContent) {
|
||||
createMessage.warning('请填写驳回原因');
|
||||
confirmLoading.value = false;
|
||||
return;
|
||||
}
|
||||
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: 0px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,232 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<JFormContainer :disabled="true">
|
||||
<template #detail>
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="NuBizSuppliersApplyForm">
|
||||
<a-row>
|
||||
<a-col :span="24" style="border-bottom: 2px solid #f7f7f7; margin-bottom: 14px;" v-if="!disabled">
|
||||
<SectionDivider :title="'供应商信息'" />
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="供应商名称" v-bind="validateInfos.suppliersName" id="NuBizSuppliersApplyForm-suppliersName" name="suppliersName">
|
||||
<a-input v-model:value="formData.suppliersName" placeholder="请输入供应商名称" ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="供应商性质" v-bind="validateInfos.suppliersNature" id="NuBizSuppliersApplyForm-suppliersNature" name="suppliersNature">
|
||||
<j-dict-select-tag v-model:value="formData.suppliersNature" dictCode="suppliers_nature" placeholder="请选择供应商性质" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="供应商地址" v-bind="validateInfos.suppliersAddress" id="NuBizSuppliersApplyForm-suppliersAddress" name="suppliersAddress">
|
||||
<a-input v-model:value="formData.suppliersAddress" placeholder="请输入供应商地址" ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="负责人" v-bind="validateInfos.personInCharge" id="NuBizSuppliersApplyForm-personInCharge" name="personInCharge">
|
||||
<a-input v-model:value="formData.personInCharge" placeholder="请输入负责人" ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="联系电话" v-bind="validateInfos.contactNumber" id="NuBizSuppliersApplyForm-contactNumber" name="contactNumber">
|
||||
<a-input v-model:value="formData.contactNumber" placeholder="请输入联系电话" ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="开户行" v-bind="validateInfos.openingBank" id="NuBizSuppliersApplyForm-openingBank" name="openingBank">
|
||||
<a-input v-model:value="formData.openingBank" placeholder="请输入开户行" ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="开户行账号" v-bind="validateInfos.openingBankNo" id="NuBizSuppliersApplyForm-openingBankNo" name="openingBankNo">
|
||||
<a-input v-model:value="formData.openingBankNo" placeholder="请输入开户行账号" ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="资质照片" v-bind="validateInfos.imgPath" id="NuBizSuppliersApplyForm-imgPath" name="imgPath">
|
||||
<j-image-upload :fileMax="1" v-model:value="formData.imgPath" ></j-image-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</template>
|
||||
</JFormContainer>
|
||||
<JFormContainer :disabled="disabled">
|
||||
<template #detail>
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="NuBizSuppliersApplyForm">
|
||||
<a-row>
|
||||
<a-col :span="24" style="border-bottom: 2px solid #f7f7f7; margin-bottom: 14px;" v-if="!disabled">
|
||||
<SectionDivider :title="'审核信息'" />
|
||||
</a-col>
|
||||
<a-col :span="24" v-if="!disabled">
|
||||
<a-form-item label="审核状态" v-bind="validateInfos.applyStatus" id="NuConfigSuppliersApplyForm-applyStatus"
|
||||
name="applyStatus">
|
||||
<a-select v-model:value="formData.status" style="width: 200px" placeholder="请选择审核状态">
|
||||
<a-select-option value="modifyPass">审核通过</a-select-option>
|
||||
<a-select-option value="modifyFail">审核驳回</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24" v-show="formData.status == 'modifyFail'" v-if="!disabled">
|
||||
<a-form-item label="驳回原因" v-bind="validateInfos.applyContent" id="NuConfigSuppliersApplyForm-applyContent"
|
||||
name="applyContent">
|
||||
<a-textarea :maxlength="50" show-count v-model:value="formData.applyContent" placeholder="请输入驳回原因" rows="4"></a-textarea>
|
||||
</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 JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
|
||||
import { getValueType } from '/@/utils';
|
||||
import { auditSubmit } from '../NuBizSuppliersApply.api';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||
import { duplicateValidate } from '/@/utils/helper/validator'
|
||||
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: '',
|
||||
suppliersName: '',
|
||||
suppliersNature: '',
|
||||
suppliersAddress: '',
|
||||
personInCharge: '',
|
||||
contactNumber: '',
|
||||
supplyState: '',
|
||||
openingBank: '',
|
||||
openingBankNo: '',
|
||||
imgPath: '',
|
||||
status: '',
|
||||
auditContent: '',
|
||||
openId:'',
|
||||
});
|
||||
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({
|
||||
// suppliersName: [{ required: false}, { validator: suppliersNameDuplicatevalidate }],
|
||||
});
|
||||
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 auditSubmit(formData)
|
||||
.then((res) => {
|
||||
emit('ok');
|
||||
})
|
||||
confirmLoading.value = false;
|
||||
// await auditSubmit(model, isUpdate.value)
|
||||
// .then((res) => {
|
||||
// if (res.success) {
|
||||
// emit('ok');
|
||||
// } else {
|
||||
// createMessage.warning(res.message);
|
||||
// }
|
||||
// })
|
||||
// .finally(() => {
|
||||
// confirmLoading.value = false;
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
// async function suppliersNameDuplicatevalidate(_r, value) {
|
||||
// return duplicateValidate('nu_biz_suppliers_apply', 'suppliers_name', value, formData.openId || '')
|
||||
// }
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
submitForm,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.antd-modal-form {
|
||||
padding: 14px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,271 @@
|
|||
<template>
|
||||
<div class="container2" >
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-table :dataSource="filteredTableData" :columns="columns" :pagination="false" bordered size="small"
|
||||
:rowClassName="setRowClassName">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex === 'd1'">
|
||||
<span>{{ applyObj[record.d1] }}</span>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'd2' && isImg(record.d1)">
|
||||
<JImageUpload v-if="!!record.d2" :fileMax="1" :value="record.d2" disabled>
|
||||
</JImageUpload>
|
||||
<span v-else>未上传</span>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'd3' && isImg(record.d1)">
|
||||
<JImageUpload v-if="!!record.d3" :fileMax="1" :value="record.d3" disabled>
|
||||
</JImageUpload>
|
||||
<span v-else>未上传</span>
|
||||
</template>
|
||||
<template
|
||||
v-if="column.dataIndex === 'd2' && (record.d1 == 'orgProvince' || record.d1 == 'orgCity' || record.d1 == 'orgDistrict')">
|
||||
<span>{{ provinceOptions[record.d2] }}</span>
|
||||
</template>
|
||||
<template
|
||||
v-if="column.dataIndex === 'd3' && (record.d1 == 'orgProvince' || record.d1 == 'orgCity' || record.d1 == 'orgDistrict')">
|
||||
<span>{{ provinceOptions[record.d3] }}</span>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'd2' && record.d1 == 'orgBuildingArea'">
|
||||
<span>{{ record.d2 }}㎡</span>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'd3' && record.d1 == 'orgBuildingArea'">
|
||||
<span>{{ record.d3 }}㎡</span>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'd2' && record.d1 == 'endTime'">
|
||||
<span>{{ record.d2 == '9999-12-31' ? '长期' : record.d2 }}</span>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'd3' && record.d1 == 'endTime'">
|
||||
<span>{{ record.d3 == '9999-12-31' ? '长期' : record.d3 }}</span>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<JFormContainer :disabled="true">
|
||||
<template #detail>
|
||||
<a-form style="margin-top: 14px;height: 100px;" ref="formRef" layout="horizontal" :model="formData"
|
||||
:label-col="labelCol" :wrapper-col="wrapperCol" >
|
||||
<a-row :gutter="16">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="审核状态" name="status" v-bind="validateInfos.status">
|
||||
<a-select v-model:value="formData.status" style="width: 200px" placeholder="请选择审核状态">
|
||||
<a-select-option value="modifyStatus">待审核</a-select-option>
|
||||
<a-select-option value="modifyPass">审核通过</a-select-option>
|
||||
<a-select-option value="modifyFail">审核驳回</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12" v-if="formData.status == 'modifyFail'">
|
||||
<a-form-item label="驳回原因" name="applyContent" v-bind="validateInfos.applyContent">
|
||||
<a-textarea :maxlength="50" show-count v-model:value="formData.applyContent" placeholder="请输入驳回原因(如驳回)"
|
||||
style="width: 100%" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</template>
|
||||
</JFormContainer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, computed, onMounted } from 'vue';
|
||||
import { Table as ATable, Input, Row, Col, Form } from 'ant-design-vue';
|
||||
import { applyObj } from '../NuBizSuppliersApply.data'
|
||||
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
|
||||
import { getModifyHistoryInfo, auditSubmit } from '../NuBizSuppliersApply.api';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { initDictOptions } from '/@/utils/dict';
|
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||
|
||||
const opeMediaAddress = import.meta.env.VITE_OPE_MEDIA_ADDRESS
|
||||
const formRef = ref();
|
||||
const AForm = Form;
|
||||
const AFormItem = Form.Item;
|
||||
const useForm = Form.useForm;
|
||||
const { createMessage } = useMessage();
|
||||
// 表单标签布局配置
|
||||
const labelCol = { span: 6 }; // 标签宽度
|
||||
const wrapperCol = { span: 18 }; // 控件宽度
|
||||
const isImg = (v_) => {
|
||||
return v_ == 'imgPath'
|
||||
}
|
||||
const provinceOptions = ref({})
|
||||
const formData = reactive<Record<string, any>>({
|
||||
status: undefined,
|
||||
applyContent: '',
|
||||
id: '',
|
||||
pkId: ''
|
||||
});
|
||||
const validatorRules = reactive({
|
||||
})
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||
const tableData = ref([]);
|
||||
const emit = defineEmits(['ok']);
|
||||
// 计算属性,过滤掉不需要显示的字段
|
||||
const filteredTableData = computed(() => {
|
||||
return tableData.value.filter(item =>
|
||||
item.d1 !== 'id'
|
||||
&& item.d1 !== 'supplyState'
|
||||
&& item.d1 !== 'wechartId'
|
||||
&& item.d1 !== 'delFlag'
|
||||
&& item.d1 !== 'createBy'
|
||||
&& item.d1 !== 'createTime'
|
||||
&& item.d1 !== 'updateBy'
|
||||
&& item.d1 !== 'updateTime'
|
||||
&& item.d1 !== 'sysOrgCode'
|
||||
&& item.d1 !== 'izEnabled'
|
||||
&& item.d1 !== 'sourceType'
|
||||
|
||||
&& item.d1 !== 'applyStatus'
|
||||
&& item.d1 !== 'applyContent'
|
||||
&& item.d1 !== 'applyId'
|
||||
&& item.d1 !== 'suppliersId'
|
||||
&& item.d1 !== 'izHistory'
|
||||
&& item.d1 !== 'applyOrg'
|
||||
&& item.d1 !== 'optType'
|
||||
&& item.d1 !== 'openId'
|
||||
&& item.d1 !== 'izRejected'
|
||||
);
|
||||
});
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: '名称',
|
||||
dataIndex: 'd1',
|
||||
key: 'd1',
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
title: '变更前',
|
||||
dataIndex: 'd2',
|
||||
key: 'd2',
|
||||
},
|
||||
{
|
||||
title: '变更后',
|
||||
dataIndex: 'd3',
|
||||
key: 'd3',
|
||||
}
|
||||
];
|
||||
|
||||
// 设置行类名
|
||||
const setRowClassName = (record) => {
|
||||
return record.d2 !== record.d3 && record.d1 !== 'createTime' ? 'highlight-row' : '';
|
||||
};
|
||||
|
||||
const fieldMap = {
|
||||
suppliersName: 'suppliersName',
|
||||
suppliersNature: 'suppliersNature',
|
||||
suppliersAddress: 'suppliersAddress',
|
||||
personInCharge: 'personInCharge',
|
||||
contactNumber: 'contactNumber',
|
||||
openingBank: 'openingBank',
|
||||
openingBankNo: 'openingBankNo',
|
||||
imgPath: 'imgPath',
|
||||
};
|
||||
|
||||
async function show(record) {
|
||||
console.log("🚀 ~ show ~ record:", record)
|
||||
let data = await getModifyHistoryInfo({ id: record.id })
|
||||
|
||||
formData.id = record.id
|
||||
formData.suppliersId = record.suppliersId
|
||||
|
||||
if(record.applyStatus == '5' || record.applyStatus == '3'){
|
||||
formData.status = 'modifyFail'
|
||||
}else if(record.applyStatus == '2'){
|
||||
formData.status = 'modifyPass'
|
||||
}else if(record.applyStatus == '4'){
|
||||
formData.status = 'modifyStatus'
|
||||
}
|
||||
formData.applyContent = record.applyContent
|
||||
|
||||
// 存储id和pkId到formData
|
||||
Object.keys(fieldMap).forEach(fieldName => {
|
||||
const record = data.find(item => item.d1 === fieldName);
|
||||
if (record) {
|
||||
formData[fieldName] = record.d3;
|
||||
}
|
||||
});
|
||||
console.log("🚀 ~ show ~ formData:", formData)
|
||||
|
||||
tableData.value = data.map(item => ({
|
||||
...item,
|
||||
// 处理null/undefined显示为空字符串
|
||||
d2: item.d2 ?? '',
|
||||
d3: item.d3 ?? ''
|
||||
}));
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
if (formData.startTime) {
|
||||
formData.startTime = formData.startTime.replace(/-/g, '.');
|
||||
}
|
||||
if (formData.endTime) {
|
||||
formData.endTime = formData.endTime.replace(/-/g, '.');
|
||||
}
|
||||
auditSubmit(formData)
|
||||
.then((res) => {
|
||||
emit('ok');
|
||||
})
|
||||
}
|
||||
|
||||
// 初始化numberValues
|
||||
onMounted(async () => {
|
||||
const dictData = await initDictOptions('sys_category,name,id,first_letter is not null order by code asc', '');
|
||||
dictData.reduce((prev, next) => {
|
||||
if (next) {
|
||||
provinceOptions.value[next['value']] = next['text'] || next['label']
|
||||
}
|
||||
return prev;
|
||||
}, []);
|
||||
});
|
||||
|
||||
defineExpose({
|
||||
show,
|
||||
submitForm
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.container2 {
|
||||
// padding: 16px;
|
||||
}
|
||||
|
||||
.antd-modal-form {
|
||||
// padding: 14px;
|
||||
}
|
||||
|
||||
:deep(.ant-table-cell) {
|
||||
padding: 8px 12px !important;
|
||||
}
|
||||
|
||||
// 高亮行样式
|
||||
:deep(.highlight-row) {
|
||||
background-color: #fff1f0 !important; // 浅红色背景
|
||||
}
|
||||
|
||||
// 表单样式调整
|
||||
:deep(.ant-form-item) {
|
||||
// margin-bottom: 16px;
|
||||
}
|
||||
|
||||
:deep(.ant-table-cell-row-hover) {
|
||||
// border: 1px solid red;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
<template>
|
||||
|
||||
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true"
|
||||
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '14px' }" @close="handleCancel">
|
||||
<NuBizSuppliersApplyHistoryForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false">
|
||||
</NuBizSuppliersApplyHistoryForm>
|
||||
<template #footer>
|
||||
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
|
||||
<a-button type="primary" @click="handleOk" v-if="!disableSubmit">确认</a-button>
|
||||
</template>
|
||||
</a-drawer>
|
||||
|
||||
|
||||
<a-drawer :title="title" :width="width" v-model:visible="visibleDetail" :closable="true"
|
||||
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '14px' }" @close="handleCancel">
|
||||
<NuBizSuppliersApplyDetailForm ref="registerFormDetail" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false">
|
||||
</NuBizSuppliersApplyDetailForm>
|
||||
<template #footer>
|
||||
<a-button type="primary" style="margin-right: 8px" @click="handleCancelDetail">关闭</a-button>
|
||||
<a-button type="primary" @click="handleOk" v-if="!disableSubmit">确认</a-button>
|
||||
</template>
|
||||
</a-drawer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import NuBizSuppliersApplyHistoryForm from './NuBizSuppliersApplyHistoryForm.vue'
|
||||
import NuBizSuppliersApplyDetailForm from './NuBizSuppliersApplyDetailForm.vue'
|
||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||
|
||||
const title = ref<string>('');
|
||||
const width = ref<string>('800');
|
||||
const visible = ref<boolean>(false);
|
||||
const visibleDetail = ref<boolean>(false);
|
||||
const disableSubmit = ref<boolean>(false);
|
||||
const registerForm = ref();
|
||||
const registerFormDetail = ref();
|
||||
const upInfoForm = ref();
|
||||
const upInfoVisible = ref<boolean>(false);
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param record
|
||||
*/
|
||||
function edit(record) {
|
||||
title.value = "审核历史比对";
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.show(record);
|
||||
});
|
||||
}
|
||||
function editDitail(record) {
|
||||
title.value = "详情";
|
||||
visibleDetail.value = true;
|
||||
nextTick(() => {
|
||||
registerFormDetail.value.edit(record);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 确定按钮点击事件
|
||||
*/
|
||||
function handleOk() {
|
||||
registerForm.value.submitForm();
|
||||
}
|
||||
|
||||
/**
|
||||
* form保存回调事件
|
||||
*/
|
||||
function submitCallback() {
|
||||
handleCancel();
|
||||
emit('success');
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消按钮回调事件
|
||||
*/
|
||||
function handleCancel() {
|
||||
visible.value = false;
|
||||
}
|
||||
function handleCancelDetail() {
|
||||
visibleDetail.value = false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息变更确认
|
||||
*/
|
||||
function handleUpInfoOk() {
|
||||
upInfoForm.value.submitForm();
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
edit,
|
||||
editDitail,
|
||||
disableSubmit,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
/**隐藏样式-modal确定按钮 */
|
||||
.jee-hidden {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
<style lang="less" scoped></style>
|
||||
|
|
@ -0,0 +1,107 @@
|
|||
<template>
|
||||
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true"
|
||||
:footer-style="{ textAlign: 'right' }" :bodyStyle="{padding:'0px'}" @close="handleCancel">
|
||||
<NuBizSuppliersApplyForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></NuBizSuppliersApplyForm>
|
||||
<template #footer>
|
||||
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
|
||||
<a-button type="primary" @click="handleOk" v-if="!disableSubmit">确认</a-button>
|
||||
</template>
|
||||
</a-drawer>
|
||||
<a-drawer :title="title" :width="width" v-model:visible="bgvisible" :closable="true"
|
||||
:footer-style="{ textAlign: 'right' }" :bodyStyle="{padding:'0px'}" @close="handleBgCancel">
|
||||
<NuBizSuppliersApplyBgForm ref="registerForm" @ok="submitBgCallback" :formDisabled="disableSubmit" :formBpm="false"></NuBizSuppliersApplyBgForm>
|
||||
<template #footer>
|
||||
<a-button type="primary" style="margin-right: 8px" @click="handleBgCancel">关闭</a-button>
|
||||
<a-button type="primary" @click="handleOk" v-if="!disableSubmit">确认</a-button>
|
||||
</template>
|
||||
</a-drawer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import NuBizSuppliersApplyForm from './NuBizSuppliersApplyForm.vue'
|
||||
import NuBizSuppliersApplyBgForm from './NuBizSuppliersApplyBgForm.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 bgvisible = 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 upInfoEdit(record) {
|
||||
title.value = '信息变更审核';
|
||||
bgvisible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.show(record);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 确定按钮点击事件
|
||||
*/
|
||||
function handleOk() {
|
||||
registerForm.value.submitForm();
|
||||
}
|
||||
|
||||
/**
|
||||
* form保存回调事件
|
||||
*/
|
||||
function submitCallback() {
|
||||
handleCancel();
|
||||
emit('success');
|
||||
}
|
||||
function submitBgCallback() {
|
||||
handleBgCancel();
|
||||
emit('success');
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消按钮回调事件
|
||||
*/
|
||||
function handleCancel() {
|
||||
visible.value = false;
|
||||
}
|
||||
function handleBgCancel() {
|
||||
bgvisible.value = false;
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
upInfoEdit,
|
||||
disableSubmit,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
/**隐藏样式-modal确定按钮 */
|
||||
.jee-hidden {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
<style lang="less" scoped></style>
|
||||
|
|
@ -0,0 +1,190 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<JFormContainer :disabled="disabled">
|
||||
<template #detail>
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="NuBizSuppliersInfoForm">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="供应商名称" v-bind="validateInfos.suppliersName" id="NuBizSuppliersInfoForm-suppliersName" name="suppliersName">
|
||||
<a-input v-model:value="formData.suppliersName" placeholder="请输入供应商名称" ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="供应商性质" v-bind="validateInfos.suppliersNature" id="NuBizSuppliersInfoForm-suppliersNature" name="suppliersNature">
|
||||
<j-dict-select-tag v-model:value="formData.suppliersNature" dictCode="suppliers_nature" placeholder="请选择供应商性质" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="供应商地址" v-bind="validateInfos.suppliersAddress" id="NuBizSuppliersInfoForm-suppliersAddress" name="suppliersAddress">
|
||||
<a-input v-model:value="formData.suppliersAddress" placeholder="请输入供应商地址" ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="负责人" v-bind="validateInfos.personInCharge" id="NuBizSuppliersInfoForm-personInCharge" name="personInCharge">
|
||||
<a-input v-model:value="formData.personInCharge" placeholder="请输入负责人" ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="联系电话" v-bind="validateInfos.contactNumber" id="NuBizSuppliersInfoForm-contactNumber" name="contactNumber">
|
||||
<a-input v-model:value="formData.contactNumber" placeholder="请输入联系电话" ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="开户行" v-bind="validateInfos.openingBank" id="NuBizSuppliersInfoForm-openingBank" name="openingBank">
|
||||
<a-input v-model:value="formData.openingBank" placeholder="请输入开户行" ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="开户行账号" v-bind="validateInfos.openingBankNo" id="NuBizSuppliersInfoForm-openingBankNo" name="openingBankNo">
|
||||
<a-input v-model:value="formData.openingBankNo" placeholder="请输入开户行账号" ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="资质照片" v-bind="validateInfos.imgPath" id="NuBizSuppliersInfoForm-imgPath" name="imgPath">
|
||||
<j-image-upload :fileMax="1" v-model:value="formData.imgPath" ></j-image-upload>
|
||||
</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 JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
|
||||
import { getValueType } from '/@/utils';
|
||||
import { saveOrUpdate } from '../NuBizSuppliersInfo.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: '',
|
||||
suppliersName: '',
|
||||
suppliersNature: '',
|
||||
suppliersAddress: '',
|
||||
personInCharge: '',
|
||||
contactNumber: '',
|
||||
supplyState: '',
|
||||
openingBank: '',
|
||||
openingBankNo: '',
|
||||
imgPath: '',
|
||||
});
|
||||
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,82 @@
|
|||
<template>
|
||||
<a-drawer :title="title" :width="width" v-model:visible="visible" :closable="true"
|
||||
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '14px' }" @close="handleCancel">
|
||||
<NuBizSuppliersInfoForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></NuBizSuppliersInfoForm>
|
||||
<template #footer>
|
||||
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
|
||||
<a-button type="primary" @click="handleOk" v-if="!disableSubmit">确认</a-button>
|
||||
</template>
|
||||
</a-drawer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import NuBizSuppliersInfoForm from './NuBizSuppliersInfoForm.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,403 @@
|
|||
<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="title">
|
||||
<template #label><span title="机构名称">机构名称</span></template>
|
||||
<a-input placeholder="请输入机构名称/负责人/电话" v-model:value="queryParam.title" allow-clear></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<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>
|
||||
<a-col :lg="12" style="text-align: right;">
|
||||
<a-button type="primary" preIcon="ant-design:cloud-sync-outlined" @click="handleJingxiang"
|
||||
style="margin-right: 10px;">镜像</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:file-text-twotone" @click="handleViewLogs"
|
||||
style="margin-right: 10px;">日志</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:safety-certificate-twotone" @click="handleElderTagMainFunc"
|
||||
style="margin-right: 10px;">标准标签库</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:copy-outlined" @click="handleElderBackups"
|
||||
style="margin-right: 10px;">标签备份</a-button>
|
||||
<!-- <a-badge :count="609" style="margin-right: 10px;"> -->
|
||||
<!-- <a-button type="primary" preIcon="ant-design:eye-outlined" style="margin-right: 10px;"
|
||||
@click="handleLookNewDirectives">新增标签</a-button> -->
|
||||
<!-- </a-badge> -->
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
|
||||
<OrgListCom ref="orgListComRef" :title="queryParam.title" @handleOrgDetail="handleDetail" :showDetail=true
|
||||
:showDMTip="true">
|
||||
</OrgListCom>
|
||||
|
||||
<ElderTagModal ref="elderTagModal" />
|
||||
<SyncStepListModal ref="syncStepListModal" />
|
||||
<a-drawer title="详情" width="85vw" v-if="listVisible" v-model:visible="listVisible"
|
||||
:bodyStyle="{ padding:'14px', height: '70vh', display: 'flex', flexDirection: 'column', overflow: 'auto' }"
|
||||
wrapClassName="org-list-modal" @cancel="handleCancelList">
|
||||
<ElderTagList ref="listRef"></ElderTagList>
|
||||
<template #footer>
|
||||
<a-button @click="handleCancelList" type="primary" style="float:right;">关闭</a-button>
|
||||
</template>
|
||||
</a-drawer>
|
||||
<a-drawer title="日志" width="85vw" v-model:visible="logsVisible"
|
||||
:bodyStyle="{ padding:'14px',height: '70vh', display: 'flex', flexDirection: 'column', overflow: 'auto' }"
|
||||
wrapClassName="org-list-modal" @cancel="handleCancelLogs">
|
||||
<a-row style="overflow-x: hidden !important; background-color: white;">
|
||||
<a-col :span="2" :push="22" style="margin-top: 18px;margin-left: 30px;">
|
||||
<a-button type="primary" @click="handleRefreshLogs" title="刷新">
|
||||
刷新
|
||||
</a-button>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<AsyncListComponent ref="logsRef" :type="'elderTag'" @handleDetail="handleDetail"></AsyncListComponent>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<template #footer>
|
||||
<a-button @click="handleCancelLogs" type="primary" style="float:right;">关闭</a-button>
|
||||
</template>
|
||||
</a-drawer>
|
||||
<!-- 标准指令库 -->
|
||||
<a-drawer v-model:visible="elderTagMainVisible" title="标准标签库" width="85vw" :footer-style="{ textAlign: 'right' }"
|
||||
:bodyStyle="{ padding:'14px', height: '70vh', display: 'flex', flexDirection: 'column', overflow: 'auto' }"
|
||||
wrapClassName="org-list-modal" @cancel="handleCancelelderTagMain">
|
||||
<template #footer>
|
||||
<a-button @click="handleCancelelderTagMain" type="primary" style="margin-right: 10px;">关闭</a-button>
|
||||
<a-button @click="handleAsyncelderTagMain" type="primary">确认</a-button>
|
||||
</template>
|
||||
<OrgListCom ref="elderTagMainComRef" :showElderTagMain=true :showDirectiveChoose="true"
|
||||
@handleOrgDetail="handleDetail" :showDetail=true @handleOrgChoose="elderTagMainFunc">
|
||||
</OrgListCom>
|
||||
</a-drawer>
|
||||
<!-- 新增标签 -->
|
||||
<a-drawer v-model:visible="newElderTagVisible" title="新增标签" width="85vw" :footer-style="{ textAlign: 'right' }"
|
||||
:bodyStyle="{ height: '80vh', display: 'flex', flexDirection: 'column', overflow: 'auto' }"
|
||||
wrapClassName="org-list-modal" @cancel="handleCancelNewElderTag">
|
||||
<template #footer>
|
||||
<a-button @click="handleCancelNewElderTag" type="primary">关闭</a-button>
|
||||
</template>
|
||||
<div >
|
||||
<CanAddElderTagList ref="canAddElderTagRef" :elderTagMainOrgInfo="elderTagMainOrgInfo" :existETIds="existETIds"
|
||||
@refreshExistIds="refreshDMExistedIds"></CanAddElderTagList>
|
||||
</div>
|
||||
</a-drawer>
|
||||
<!-- 标签备份 -->
|
||||
<a-drawer v-model:visible="elderTagBackupsOpen" title="标签备份" width="85vw" :footer-style="{ textAlign: 'right' }"
|
||||
:bodyStyle="{ padding: '14px', height: '80vh', display: 'flex', flexDirection: 'column', overflow: 'auto' }"
|
||||
wrapClassName="org-list-modal" @cancel="handleElderBackupsClose">
|
||||
<template #footer>
|
||||
<a-button @click="handleElderBackupsClose" type="primary">关闭</a-button>
|
||||
</template>
|
||||
<div >
|
||||
<ElderBkMainList v-if="elderTagBackupsOpen" ref="backupsRef"></ElderBkMainList>
|
||||
</div>
|
||||
</a-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="synchronization-directive2" lang="ts">
|
||||
import { ref, reactive, computed, onMounted, watch, nextTick } from 'vue'
|
||||
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
||||
// 以下为服务指令引用:
|
||||
import { list, asyncFunc, departList } from '@/views/services/serviceDirective/ConfigServiceDirective.api';
|
||||
import { Pagination } from 'ant-design-vue';
|
||||
import ElderTagModal from '/@/views/synchronization/eldertag/eldertag/components/ElderTagModal.vue';
|
||||
import SyncStepListModal from '/@/views/synchronization/eldertag/syncStep/SyncStepListModal.vue';
|
||||
//机构信息
|
||||
import { getOrgInfo } from '/@/views/admin/orgapplyinfo/OrgApplyInfo.api';
|
||||
//机构列表
|
||||
import OrgListCom from '/@/views/synchronization/eldertag/orgCom/OrgListCom.vue'
|
||||
//可新增指令
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import AsyncListComponent from '@/components/dataAsync/AsyncMainList0731.vue'
|
||||
import { getElderTagMain, changeElderTagMain } from '/@/api/common/api'
|
||||
import { idListByDS } from '/@/views/synchronization/eldertag/eldertag/ElderTag.api';
|
||||
import CanAddElderTagList from '/@/views/synchronization/eldertag/canaddet/CanAddElderTagList.vue'
|
||||
import ElderTagList from '/@/views/synchronization/eldertag/eldertag/ElderTagList.vue'
|
||||
import ElderBkMainList from '/@/views/elder/elderbk/ElderBkMainList.vue'
|
||||
|
||||
const { createMessage } = useMessage()
|
||||
const canAddElderTagRef = ref()
|
||||
const newElderTagVisible = ref(false)
|
||||
const elderTagMainComRef = ref();
|
||||
const newDirectiveRef = ref()
|
||||
const logsRef = ref()
|
||||
const formRef = ref();
|
||||
const elderTagModal = ref();
|
||||
const syncStepListModal = ref();
|
||||
const orgTableList = ref<any>([]);
|
||||
const queryParam = reactive<any>({});
|
||||
const pageParams = ref({ pageNo: 1, pageSize: 8 })
|
||||
const orgListComRef = ref()
|
||||
const logsVisible = ref(false)
|
||||
const elderTagMainVisible = ref(false)
|
||||
const { createConfirm } = useMessage();
|
||||
const existETIds = ref([])//指令库已存在指令id
|
||||
const elderTagMainOrgInfo = ref()
|
||||
const listVisible = ref(false)
|
||||
const listRef = ref(false)
|
||||
const elderTagBackupsOpen = ref(false)
|
||||
const backupsRef = ref()//指令快照
|
||||
|
||||
const labelCol = reactive({
|
||||
xs: 24,
|
||||
sm: 4,
|
||||
xl: 6,
|
||||
xxl: 4
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: 24,
|
||||
sm: 20,
|
||||
});
|
||||
|
||||
/**
|
||||
* 镜像
|
||||
*/
|
||||
function handleJingxiang() {
|
||||
syncStepListModal.value.init(null);
|
||||
syncStepListModal.value.disableSubmit = true;
|
||||
}
|
||||
/**
|
||||
* 详情
|
||||
* @param record
|
||||
*/
|
||||
function handleDetail(record) {
|
||||
listVisible.value = true
|
||||
nextTick(() => {
|
||||
listRef.value.init(record.orgCode, record)
|
||||
})
|
||||
}
|
||||
|
||||
function handleCancelList() {
|
||||
listVisible.value = false
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
function searchQuery() {
|
||||
orgListComRef.value?.reload();
|
||||
}
|
||||
|
||||
function reload() {
|
||||
//刷新数据
|
||||
queryParam.pageSize = pageParams.value.pageSize;
|
||||
queryParam.pageNo = pageParams.value.pageNo;
|
||||
getOrgInfo(queryParam).then(res => {
|
||||
orgTableList.value = res;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function searchReset() {
|
||||
queryParam.title = null
|
||||
orgListComRef.value?.searchReset()
|
||||
}
|
||||
|
||||
/**
|
||||
* 日志
|
||||
*/
|
||||
function handleViewLogs() {
|
||||
logsVisible.value = true
|
||||
handleRefreshLogs()
|
||||
}
|
||||
|
||||
function handleLookNewDirectives() {
|
||||
newElderTagVisible.value = true
|
||||
refreshDMExistedIds(elderTagMainOrgInfo.value, true)
|
||||
}
|
||||
|
||||
//关闭日志模态框
|
||||
function handleCancelLogs() {
|
||||
logsVisible.value = false
|
||||
}
|
||||
|
||||
//刷新日志
|
||||
function handleRefreshLogs() {
|
||||
logsRef.value?.searchQuery()
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭新增指令
|
||||
*/
|
||||
function handleCancelNewElderTag() {
|
||||
newElderTagVisible.value = false
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 打开指令库
|
||||
*/
|
||||
function handleElderTagMainFunc() {
|
||||
elderTagMainVisible.value = true
|
||||
elderTagMainComRef.value?.reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭指令库
|
||||
*/
|
||||
function handleCancelelderTagMain() {
|
||||
elderTagMainVisible.value = false
|
||||
}
|
||||
|
||||
//刷新已有指令库
|
||||
function refreshDMExistedIds(dmOrgInfo, izReset = false, izQuery = true) {
|
||||
idListByDS({ dataSourceCode: dmOrgInfo.orgCode }).then(res => {
|
||||
existETIds.value = res.records
|
||||
if (izReset) {
|
||||
canAddElderTagRef.value?.searchReset()
|
||||
} else {
|
||||
canAddElderTagRef.value?.reload()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
watch(elderTagMainOrgInfo, (newValue, oldValue) => {
|
||||
refreshDMExistedIds(newValue)
|
||||
}, { deep: true })
|
||||
|
||||
const tempDM = ref()
|
||||
/**
|
||||
* 指令库对应机构信息
|
||||
*/
|
||||
function elderTagMainFunc(orgInfo_) {
|
||||
tempDM.value = orgInfo_
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认指令库
|
||||
*/
|
||||
function handleAsyncelderTagMain() {
|
||||
elderTagMainOrgInfo.value = tempDM.value
|
||||
changeElderTagMain(elderTagMainOrgInfo.value.orgCode).then(() => {
|
||||
createMessage.success('标准指令库已变更')
|
||||
handleCancelelderTagMain()
|
||||
canAddElderTagRef.value?.reload()
|
||||
orgListComRef.value?.reload()
|
||||
}).catch(() => {
|
||||
createMessage.error('指令库变更失败,请稍后再试')
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看指令快照
|
||||
*/
|
||||
function handleElderBackups() {
|
||||
elderTagBackupsOpen.value = true
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭指令快照
|
||||
*/
|
||||
function handleElderBackupsClose() {
|
||||
elderTagBackupsOpen.value = false
|
||||
}
|
||||
|
||||
// 自动请求并暴露内部方法
|
||||
onMounted(() => {
|
||||
reload();
|
||||
orgListComRef.value?.reload();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.jeecg-basic-table-form-container {
|
||||
padding: 0;
|
||||
margin-bottom: 14px;
|
||||
|
||||
.table-page-search-submitButtons {
|
||||
display: block;
|
||||
margin-bottom: 0px;
|
||||
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: 14px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
:deep(.ant-picker),
|
||||
:deep(.ant-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.cardTitle {
|
||||
background: #1ea0fa;
|
||||
width: 100%;
|
||||
margin: -28px -24px;
|
||||
padding-top: 15px;
|
||||
border-radius: 5px 5px 0px 0px;
|
||||
color: white;
|
||||
height: 55px;
|
||||
display: block;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.zxClass {
|
||||
font-size: 12px;
|
||||
background: linear-gradient(to right, #1ea0fa, #017de9);
|
||||
border-radius: 8px;
|
||||
height: 25px;
|
||||
color: white;
|
||||
line-height: 25px;
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
.ellipsis-one-lines {
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 1;
|
||||
/* 限制文本为2行 */
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.content-refresh-btn {
|
||||
position: absolute;
|
||||
top: 60px;
|
||||
right: 20px;
|
||||
z-index: 1;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue