客户需求
This commit is contained in:
115
src/api/dayPlan/Demand/index.ts
Normal file
115
src/api/dayPlan/Demand/index.ts
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
import { LngPngDemandPageModel, LngPngDemandPageParams, LngPngDemandPageResult } from './model/DemandModel';
|
||||||
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
|
import { ErrorMessageMode } from '/#/axios';
|
||||||
|
|
||||||
|
enum Api {
|
||||||
|
Page = '/dayPlan/demand/page',
|
||||||
|
List = '/dayPlan/demand/list',
|
||||||
|
Info = '/dayPlan/demand/info',
|
||||||
|
LngPngDemand = '/dayPlan/demand',
|
||||||
|
|
||||||
|
|
||||||
|
Export = '/dayPlan/demand/export',
|
||||||
|
|
||||||
|
|
||||||
|
DataLog = '/dayPlan/demand/datalog',
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 查询LngPngDemand分页列表
|
||||||
|
*/
|
||||||
|
export async function getLngPngDemandPage(params: LngPngDemandPageParams, mode: ErrorMessageMode = 'modal') {
|
||||||
|
return defHttp.get<LngPngDemandPageResult>(
|
||||||
|
{
|
||||||
|
url: Api.Page,
|
||||||
|
params,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorMessageMode: mode,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 获取LngPngDemand信息
|
||||||
|
*/
|
||||||
|
export async function getLngPngDemand(id: String, mode: ErrorMessageMode = 'modal') {
|
||||||
|
return defHttp.get<LngPngDemandPageModel>(
|
||||||
|
{
|
||||||
|
url: Api.Info,
|
||||||
|
params: { id },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorMessageMode: mode,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 新增LngPngDemand
|
||||||
|
*/
|
||||||
|
export async function addLngPngDemand(lngPngDemand: Recordable, mode: ErrorMessageMode = 'modal') {
|
||||||
|
return defHttp.post<boolean>(
|
||||||
|
{
|
||||||
|
url: Api.LngPngDemand,
|
||||||
|
params: lngPngDemand,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorMessageMode: mode,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 更新LngPngDemand
|
||||||
|
*/
|
||||||
|
export async function updateLngPngDemand(lngPngDemand: Recordable, mode: ErrorMessageMode = 'modal') {
|
||||||
|
return defHttp.put<boolean>(
|
||||||
|
{
|
||||||
|
url: Api.LngPngDemand,
|
||||||
|
params: lngPngDemand,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorMessageMode: mode,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 删除LngPngDemand(批量删除)
|
||||||
|
*/
|
||||||
|
export async function deleteLngPngDemand(ids: string[], mode: ErrorMessageMode = 'modal') {
|
||||||
|
return defHttp.delete<boolean>(
|
||||||
|
{
|
||||||
|
url: Api.LngPngDemand,
|
||||||
|
data: ids,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorMessageMode: mode,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 导出LngPngDemand
|
||||||
|
*/
|
||||||
|
export async function exportLngPngDemand(
|
||||||
|
params?: object,
|
||||||
|
mode: ErrorMessageMode = 'modal'
|
||||||
|
) {
|
||||||
|
return defHttp.download(
|
||||||
|
{
|
||||||
|
url: Api.Export,
|
||||||
|
method: 'GET',
|
||||||
|
params,
|
||||||
|
responseType: 'blob',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorMessageMode: mode,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
66
src/api/dayPlan/Demand/model/DemandModel.ts
Normal file
66
src/api/dayPlan/Demand/model/DemandModel.ts
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
import { BasicPageParams, BasicFetchResult } from '/@/api/model/baseModel';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: LngPngDemand分页参数 模型
|
||||||
|
*/
|
||||||
|
export interface LngPngDemandPageParams extends BasicPageParams {
|
||||||
|
verNo: string;
|
||||||
|
|
||||||
|
datePlan: string;
|
||||||
|
|
||||||
|
pointDelyCode: string;
|
||||||
|
|
||||||
|
qtyDemandGj: string;
|
||||||
|
|
||||||
|
qtyDemandM3: string;
|
||||||
|
|
||||||
|
priceSalesGj: string;
|
||||||
|
|
||||||
|
priceSalesM3: string;
|
||||||
|
|
||||||
|
ksId: string;
|
||||||
|
|
||||||
|
id: string;
|
||||||
|
|
||||||
|
orgId: string;
|
||||||
|
|
||||||
|
note: string;
|
||||||
|
|
||||||
|
reply: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: LngPngDemand分页返回值模型
|
||||||
|
*/
|
||||||
|
export interface LngPngDemandPageModel {
|
||||||
|
id: string;
|
||||||
|
|
||||||
|
verNo: string;
|
||||||
|
|
||||||
|
datePlan: string;
|
||||||
|
|
||||||
|
pointDelyCode: string;
|
||||||
|
|
||||||
|
qtyDemandGj: string;
|
||||||
|
|
||||||
|
qtyDemandM3: string;
|
||||||
|
|
||||||
|
priceSalesGj: string;
|
||||||
|
|
||||||
|
priceSalesM3: string;
|
||||||
|
|
||||||
|
ksId: string;
|
||||||
|
|
||||||
|
note: string;
|
||||||
|
|
||||||
|
reply: string;
|
||||||
|
|
||||||
|
orgId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: LngPngDemand分页返回值结构
|
||||||
|
*/
|
||||||
|
export type LngPngDemandPageResult = BasicFetchResult<LngPngDemandPageModel>;
|
||||||
@ -8,12 +8,54 @@ enum Api {
|
|||||||
List = '/dayPlan/pngAppro/list',
|
List = '/dayPlan/pngAppro/list',
|
||||||
Info = '/dayPlan/pngAppro/info',
|
Info = '/dayPlan/pngAppro/info',
|
||||||
LngPngAppro = '/dayPlan/pngAppro',
|
LngPngAppro = '/dayPlan/pngAppro',
|
||||||
|
approve = '/dayPlan/pngAppro/approveXS',
|
||||||
|
|
||||||
|
records = '/magic-api/approve/records',
|
||||||
|
compare = '/dayPlan/pngAppro/compare'
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @description: 获取LngPngAppro信息
|
||||||
|
*/
|
||||||
|
export async function getLngPngApproCompare(demandOrgId: String, mode: ErrorMessageMode = 'modal') {
|
||||||
|
return defHttp.get<LngPngApproPageModel>(
|
||||||
|
{
|
||||||
|
url: Api.compare,
|
||||||
|
params: { demandOrgId },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorMessageMode: mode,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @description: 审批LngPngAppro
|
||||||
|
*/
|
||||||
|
export async function approveLngPngAppro(lngPngAppro: Recordable, mode: ErrorMessageMode = 'modal') {
|
||||||
|
return defHttp.post<boolean>(
|
||||||
|
{
|
||||||
|
url: Api.approve,
|
||||||
|
params: lngPngAppro,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorMessageMode: mode,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @description: 获取LngPngAppro审批记录
|
||||||
|
*/
|
||||||
|
export async function getLngPngApproRecords(id: String, mode: ErrorMessageMode = 'modal') {
|
||||||
|
return defHttp.get<LngPngApproPageModel>(
|
||||||
|
{
|
||||||
|
url: Api.records,
|
||||||
|
params: { id },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorMessageMode: mode,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* @description: 查询LngPngAppro分页列表
|
* @description: 查询LngPngAppro分页列表
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -8,12 +8,26 @@ enum Api {
|
|||||||
List = '/dayPlan/pngMeasureSalesPur/list',
|
List = '/dayPlan/pngMeasureSalesPur/list',
|
||||||
Info = '/dayPlan/pngMeasureSalesPur/info',
|
Info = '/dayPlan/pngMeasureSalesPur/info',
|
||||||
LngPngMeasureSalesPur = '/dayPlan/pngMeasureSalesPur',
|
LngPngMeasureSalesPur = '/dayPlan/pngMeasureSalesPur',
|
||||||
|
PageAdd = '/magic-api/dayPlan/dayPlanSelectList',
|
||||||
|
|
||||||
Export = '/dayPlan/pngMeasureSalesPur/export',
|
Export = '/dayPlan/pngMeasureSalesPur/export',
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @description: 查询LngPngMeasureSalesPur分页列表
|
||||||
|
*/
|
||||||
|
export async function getLngPngMeasureSalesPurPageAdd(params: LngPngMeasureSalesPurPageParams, mode: ErrorMessageMode = 'modal') {
|
||||||
|
return defHttp.get<LngPngMeasureSalesPurPageResult>(
|
||||||
|
{
|
||||||
|
url: Api.PageAdd,
|
||||||
|
params,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorMessageMode: mode,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description: 查询LngPngMeasureSalesPur分页列表
|
* @description: 查询LngPngMeasureSalesPur分页列表
|
||||||
|
|||||||
112
src/components/common/ContractSalesListModal.vue
Normal file
112
src/components/common/ContractSalesListModal.vue
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<BasicModal v-bind="$attrs" @register="registerModal" width="60%" :title="getTitle" @ok="handleSubmit"
|
||||||
|
@visible-change="handleVisibleChange" >
|
||||||
|
<BasicTable @register="registerTable" class="contractFactListModal"></BasicTable>
|
||||||
|
</BasicModal>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, computed, unref, nextTick } from 'vue';
|
||||||
|
import { BasicModal, useModalInner, useModal } from '/@/components/Modal';
|
||||||
|
import { BasicForm, useForm } from '/@/components/Form/index';
|
||||||
|
import { BasicTable, useTable, FormSchema, BasicColumn, TableAction } from '/@/components/Table';
|
||||||
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
|
import { getLngContract } from '/@/api/contract/ContractSales';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
const codeFormSchema: FormSchema[] = [
|
||||||
|
{ field: 'kName', label: '合同号/名称', component: 'Input'},
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
const columns: BasicColumn[] = [
|
||||||
|
{ title: t('合同号'), dataIndex: 'kNo', sorter: true},
|
||||||
|
{ title: t('合同名称'), dataIndex: 'kName', sorter: true},
|
||||||
|
{ title: t('客户'), dataIndex: 'cpName', sorter: true},
|
||||||
|
{ title: t('有效期开始'), dataIndex: 'dateFrom', sorter: true},
|
||||||
|
{ title: t('有效期结束'), dataIndex: 'dateTo', sorter: true,},
|
||||||
|
{ title: t('交割点'), dataIndex: 'pointUpName', sorter: true,},
|
||||||
|
{ title: t('合同主体'), dataIndex: 'comName', sorter: true,},
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
const emit = defineEmits(['success', 'register']);
|
||||||
|
|
||||||
|
const { notification } = useMessage();
|
||||||
|
const isUpdate = ref(true);
|
||||||
|
const rowId = ref('');
|
||||||
|
const selectedKeys = ref<string[]>([]);
|
||||||
|
const selectedValues = ref([]);
|
||||||
|
const props = defineProps({
|
||||||
|
selectType: { type: String, default: 'checkbox' },
|
||||||
|
|
||||||
|
});
|
||||||
|
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||||
|
|
||||||
|
setModalProps({ confirmLoading: false });
|
||||||
|
|
||||||
|
isUpdate.value = !!data?.isUpdate;
|
||||||
|
});
|
||||||
|
|
||||||
|
const [registerTable, { getDataSource, setTableData, updateTableDataRecord, reload }] = useTable({
|
||||||
|
title: t('管道气销售合同列表'),
|
||||||
|
api: getLngContract,
|
||||||
|
columns,
|
||||||
|
|
||||||
|
bordered: true,
|
||||||
|
pagination: true,
|
||||||
|
canResize: false,
|
||||||
|
formConfig: {
|
||||||
|
labelCol:{span: 9, offSet:10},
|
||||||
|
schemas: codeFormSchema,
|
||||||
|
showResetButton: true,
|
||||||
|
},
|
||||||
|
immediate: false, // 设置为不立即调用
|
||||||
|
beforeFetch: (params) => {
|
||||||
|
return { ...params,approCode: 'YSP'};
|
||||||
|
},
|
||||||
|
rowSelection: {
|
||||||
|
type: props.selectType,
|
||||||
|
onChange: onSelectChange
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const handleVisibleChange = (visible: boolean) => {
|
||||||
|
if (visible) {
|
||||||
|
nextTick(() => {
|
||||||
|
reload();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
function onSelectChange(rowKeys: string[], e) {
|
||||||
|
selectedKeys.value = rowKeys;
|
||||||
|
selectedValues.value = e
|
||||||
|
}
|
||||||
|
const getTitle = computed(() => (!unref(isUpdate) ? t('合同列表') : t('')));
|
||||||
|
|
||||||
|
async function handleSubmit() {
|
||||||
|
if (!selectedValues.value.length) {
|
||||||
|
notification.warning({
|
||||||
|
message: t('提示'),
|
||||||
|
description: t('请选择合同')
|
||||||
|
});
|
||||||
|
return
|
||||||
|
}
|
||||||
|
closeModal();
|
||||||
|
emit('success', selectedValues.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<style >
|
||||||
|
.contractFactListModal .basicCol{
|
||||||
|
position: inherit !important;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -12,7 +12,7 @@
|
|||||||
import { BasicTable, useTable, FormSchema, BasicColumn, TableAction } from '/@/components/Table';
|
import { BasicTable, useTable, FormSchema, BasicColumn, TableAction } from '/@/components/Table';
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
import { useI18n } from '/@/hooks/web/useI18n';
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
import { getLngSupplierPage } from '/@/api/supplier/Supplier';
|
import { getLngPngApproRecords} from '/@/api/dayPlan/PngAppro';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const columns: BasicColumn[] = [
|
const columns: BasicColumn[] = [
|
||||||
@ -24,16 +24,18 @@
|
|||||||
|
|
||||||
const emit = defineEmits(['success', 'register']);
|
const emit = defineEmits(['success', 'register']);
|
||||||
const isUpdate = ref(true);
|
const isUpdate = ref(true);
|
||||||
|
const id = ref('')
|
||||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||||
|
|
||||||
setModalProps({ confirmLoading: false });
|
setModalProps({ confirmLoading: false });
|
||||||
|
|
||||||
isUpdate.value = !!data?.isUpdate;
|
isUpdate.value = !!data?.isUpdate;
|
||||||
|
id.value = data.id
|
||||||
});
|
});
|
||||||
|
|
||||||
const [registerTable, {}] = useTable({
|
const [registerTable, {}] = useTable({
|
||||||
title: t('审批状态'),
|
title: t('审批状态'),
|
||||||
api: getLngSupplierPage,
|
api: getLngPngApproRecords,
|
||||||
columns,
|
columns,
|
||||||
formConfig: {
|
formConfig: {
|
||||||
rowProps: {
|
rowProps: {
|
||||||
@ -51,7 +53,7 @@
|
|||||||
showTableSetting: false,
|
showTableSetting: false,
|
||||||
immediate: true, // 设置为不立即调用
|
immediate: true, // 设置为不立即调用
|
||||||
beforeFetch: (params) => {
|
beforeFetch: (params) => {
|
||||||
return { ...params,};
|
return (id.value);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const getTitle = computed(() => (!unref(isUpdate) ? t('审批状态') : t('')));
|
const getTitle = computed(() => (!unref(isUpdate) ? t('审批状态') : t('')));
|
||||||
|
|||||||
@ -275,7 +275,15 @@ export const PAGE_CUSTOM_ROUTE: AppRouteRecordRaw[] = [{
|
|||||||
name: 'PngAppro',
|
name: 'PngAppro',
|
||||||
component: () => import('/@/views/dayPlan/PngAppro/components/createForm.vue'),
|
component: () => import('/@/views/dayPlan/PngAppro/components/createForm.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
title: (route) => '管道气审批'
|
title: (route) => route.query.formName
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/dayPlan/PngMeasureSalesPur/createForm',
|
||||||
|
name: 'PngMeasureSalesPur',
|
||||||
|
component: () => import('/@/views/dayPlan/PngMeasureSalesPur/components/createForm.vue'),
|
||||||
|
meta: {
|
||||||
|
title: (route) => route.query.formName
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|||||||
110
src/views/dayPlan/Demand/components/DemandModal.vue
Normal file
110
src/views/dayPlan/Demand/components/DemandModal.vue
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
<template>
|
||||||
|
|
||||||
|
<BasicModal v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit" @cancel="handleClose" :paddingRight="15" :bodyStyle="{ minHeight: '400px !important' }">
|
||||||
|
<ModalForm ref="formRef" :fromPage="FromPageType.MENU" />
|
||||||
|
</BasicModal>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, computed, reactive } from 'vue';
|
||||||
|
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||||
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
|
import { formProps } from './config';
|
||||||
|
import ModalForm from './Form.vue';
|
||||||
|
import { FromPageType } from '/@/enums/workflowEnum';
|
||||||
|
|
||||||
|
const emit = defineEmits(['success', 'register']);
|
||||||
|
|
||||||
|
const { notification } = useMessage();
|
||||||
|
const formRef = ref();
|
||||||
|
const state = reactive({
|
||||||
|
formModel: {},
|
||||||
|
isUpdate: true,
|
||||||
|
isView: false,
|
||||||
|
isCopy: false,
|
||||||
|
rowId: '',
|
||||||
|
});
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||||
|
state.isUpdate = !!data?.isUpdate;
|
||||||
|
state.isView = !!data?.isView;
|
||||||
|
state.isCopy = !!data?.isCopy;
|
||||||
|
|
||||||
|
setModalProps({
|
||||||
|
destroyOnClose: true,
|
||||||
|
maskClosable: false,
|
||||||
|
showCancelBtn: !state.isView,
|
||||||
|
showOkBtn: !state.isView,
|
||||||
|
canFullscreen: true,
|
||||||
|
width: 900,
|
||||||
|
});
|
||||||
|
if (state.isUpdate || state.isView || state.isCopy) {
|
||||||
|
state.rowId = data.id;
|
||||||
|
if (state.isView) {
|
||||||
|
await formRef.value.setDisabledForm();
|
||||||
|
}
|
||||||
|
await formRef.value.setFormDataFromId(state.rowId);
|
||||||
|
} else {
|
||||||
|
formRef.value.resetFields();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const getTitle = computed(() => (state.isView ? '查看' : !state.isUpdate ? '新增' : '编辑'));
|
||||||
|
|
||||||
|
async function saveModal() {
|
||||||
|
let saveSuccess = false;
|
||||||
|
try {
|
||||||
|
const values = await formRef.value?.validate();
|
||||||
|
//添加隐藏组件
|
||||||
|
if (formProps.hiddenComponent?.length) {
|
||||||
|
formProps.hiddenComponent.forEach((component) => {
|
||||||
|
values[component.bindField] = component.value;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (values !== false) {
|
||||||
|
try {
|
||||||
|
if (!state.isUpdate || state.isCopy) {
|
||||||
|
saveSuccess = await formRef.value.add(values);
|
||||||
|
} else {
|
||||||
|
saveSuccess = await formRef.value.update({ values, rowId: state.rowId });
|
||||||
|
}
|
||||||
|
return saveSuccess;
|
||||||
|
} catch (error) {}
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
return saveSuccess;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleSubmit() {
|
||||||
|
try {
|
||||||
|
const saveSuccess = await saveModal();
|
||||||
|
setModalProps({ confirmLoading: true });
|
||||||
|
if (saveSuccess) {
|
||||||
|
if (!state.isUpdate || state.isCopy) {
|
||||||
|
//false 新增
|
||||||
|
notification.success({
|
||||||
|
message: 'Tip',
|
||||||
|
description: t('新增成功!'),
|
||||||
|
}); //提示消息
|
||||||
|
} else {
|
||||||
|
notification.success({
|
||||||
|
message: 'Tip',
|
||||||
|
description: t('修改成功!'),
|
||||||
|
}); //提示消息
|
||||||
|
}
|
||||||
|
closeModal();
|
||||||
|
formRef.value.resetFields();
|
||||||
|
emit('success');
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
setModalProps({ confirmLoading: false });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleClose() {
|
||||||
|
formRef.value.resetFields();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
224
src/views/dayPlan/Demand/components/Form.vue
Normal file
224
src/views/dayPlan/Demand/components/Form.vue
Normal file
@ -0,0 +1,224 @@
|
|||||||
|
<template>
|
||||||
|
<SimpleForm
|
||||||
|
ref="systemFormRef"
|
||||||
|
:formProps="data.formDataProps"
|
||||||
|
:formModel="{}"
|
||||||
|
:isWorkFlow="props.fromPage!=FromPageType.MENU"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { reactive, ref,onBeforeMount,onMounted } from 'vue';
|
||||||
|
import { formProps, formEventConfigs ,formConfig} from './config';
|
||||||
|
import SimpleForm from '/@/components/SimpleForm/src/SimpleForm.vue';
|
||||||
|
import { addLngPngDemand, getLngPngDemand, updateLngPngDemand, deleteLngPngDemand } from '/@/api/dayPlan/Demand';
|
||||||
|
import { cloneDeep } from 'lodash-es';
|
||||||
|
import { FormDataProps } from '/@/components/Designer/src/types';
|
||||||
|
import { usePermission } from '/@/hooks/web/usePermission';
|
||||||
|
import { useFormConfig } from '/@/hooks/web/useFormConfig';
|
||||||
|
import { FromPageType } from '/@/enums/workflowEnum';
|
||||||
|
import { createFormEvent, getFormDataEvent, loadFormEvent, submitFormEvent,} from '/@/hooks/web/useFormEvent';
|
||||||
|
import { changeWorkFlowForm, changeSchemaDisabled } from '/@/hooks/web/useWorkFlowForm';
|
||||||
|
import { WorkFlowFormParams } from '/@/model/workflow/bpmnConfig';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
|
||||||
|
const { filterFormSchemaAuth } = usePermission();
|
||||||
|
const { mergeFormSchemas,mergeFormEventConfigs } = useFormConfig();
|
||||||
|
const { currentRoute } = useRouter();
|
||||||
|
|
||||||
|
const RowKey = 'id';
|
||||||
|
const emits = defineEmits(['changeUploadComponentIds','loadingCompleted', 'form-mounted']);
|
||||||
|
const props = defineProps({
|
||||||
|
fromPage: {
|
||||||
|
type: Number,
|
||||||
|
default: FromPageType.MENU,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const systemFormRef = ref();
|
||||||
|
const data: { formDataProps: FormDataProps } = reactive({
|
||||||
|
formDataProps: {schemas:[]} as FormDataProps,
|
||||||
|
});
|
||||||
|
const state = reactive({
|
||||||
|
formModel: {},
|
||||||
|
});
|
||||||
|
|
||||||
|
let customFormEventConfigs=[];
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
try {
|
||||||
|
// 合并渲染覆盖配置中的字段配置、表单事件配置
|
||||||
|
await mergeCustomFormRenderConfig();
|
||||||
|
|
||||||
|
if (props.fromPage == FromPageType.MENU) {
|
||||||
|
setMenuPermission();
|
||||||
|
await createFormEvent(customFormEventConfigs, state.formModel,
|
||||||
|
systemFormRef.value,
|
||||||
|
formProps.schemas); //表单事件:初始化表单
|
||||||
|
await loadFormEvent(customFormEventConfigs, state.formModel,
|
||||||
|
systemFormRef.value,
|
||||||
|
formProps.schemas); //表单事件:加载表单
|
||||||
|
} else if (props.fromPage == FromPageType.FLOW) {
|
||||||
|
emits('loadingCompleted'); //告诉系统表单已经加载完毕
|
||||||
|
// loadingCompleted后 工作流页面直接利用Ref调用setWorkFlowForm方法
|
||||||
|
} else if (props.fromPage == FromPageType.PREVIEW) {
|
||||||
|
// 预览 无需权限,表单事件也无需执行
|
||||||
|
} else if (props.fromPage == FromPageType.DESKTOP) {
|
||||||
|
// 桌面设计 表单事件需要执行
|
||||||
|
emits('loadingCompleted'); //告诉系统表单已经加载完毕
|
||||||
|
await createFormEvent(customFormEventConfigs, state.formModel,
|
||||||
|
systemFormRef.value,
|
||||||
|
formProps.schemas); //表单事件:初始化表单
|
||||||
|
await loadFormEvent(customFormEventConfigs, state.formModel,
|
||||||
|
systemFormRef.value,
|
||||||
|
formProps.schemas); //表单事件:加载表单
|
||||||
|
}
|
||||||
|
emits('form-mounted', formProps);
|
||||||
|
} catch (error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
async function mergeCustomFormRenderConfig() {
|
||||||
|
let cloneProps=cloneDeep(formProps);
|
||||||
|
let fEventConfigs=cloneDeep(formEventConfigs);
|
||||||
|
if (formConfig.useCustomConfig) {
|
||||||
|
if(props.fromPage !== FromPageType.FLOW){
|
||||||
|
let formPath=currentRoute.value.query.formPath;
|
||||||
|
//1.合并字段配置
|
||||||
|
cloneProps.schemas=await mergeFormSchemas({formSchema:cloneProps.schemas!,formPath:formPath});
|
||||||
|
//2.合并表单事件配置
|
||||||
|
fEventConfigs=await mergeFormEventConfigs({formEventConfigs:fEventConfigs,formPath:formPath});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
data.formDataProps=cloneProps;
|
||||||
|
customFormEventConfigs=fEventConfigs;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据菜单页面权限,设置表单属性(必填,禁用,显示)
|
||||||
|
function setMenuPermission() {
|
||||||
|
data.formDataProps.schemas = filterFormSchemaAuth(data.formDataProps.schemas!);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 校验form 通过返回表单数据
|
||||||
|
async function validate() {
|
||||||
|
let values = [];
|
||||||
|
try {
|
||||||
|
values = await systemFormRef.value?.validate();
|
||||||
|
//添加隐藏组件
|
||||||
|
if (data.formDataProps.hiddenComponent?.length) {
|
||||||
|
data.formDataProps.hiddenComponent.forEach((component) => {
|
||||||
|
values[component.bindField] = component.value;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
}
|
||||||
|
return values;
|
||||||
|
}
|
||||||
|
// 根据行唯一ID查询行数据,并设置表单数据 【编辑】
|
||||||
|
async function setFormDataFromId(rowId, skipUpdate) {
|
||||||
|
try {
|
||||||
|
const record = await getLngPngDemand(rowId);
|
||||||
|
if (skipUpdate) {
|
||||||
|
return record;
|
||||||
|
}
|
||||||
|
setFieldsValue(record);
|
||||||
|
state.formModel = record;
|
||||||
|
await getFormDataEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:获取表单数据
|
||||||
|
return record;
|
||||||
|
} catch (error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 辅助设置表单数据
|
||||||
|
function setFieldsValue(record) {
|
||||||
|
systemFormRef.value.setFieldsValue(record);
|
||||||
|
}
|
||||||
|
// 重置表单数据
|
||||||
|
async function resetFields() {
|
||||||
|
await systemFormRef.value.resetFields();
|
||||||
|
}
|
||||||
|
// 设置表单数据全部为Disabled 【查看】
|
||||||
|
async function setDisabledForm(isDisabled) {
|
||||||
|
data.formDataProps.schemas = changeSchemaDisabled(cloneDeep(data.formDataProps.schemas),isDisabled);
|
||||||
|
}
|
||||||
|
// 获取行键值
|
||||||
|
function getRowKey() {
|
||||||
|
return RowKey;
|
||||||
|
}
|
||||||
|
// 更新api表单数据
|
||||||
|
async function update({ values, rowId }) {
|
||||||
|
try {
|
||||||
|
values[RowKey] = rowId;
|
||||||
|
state.formModel = values;
|
||||||
|
let saveVal = await updateLngPngDemand(values);
|
||||||
|
await submitFormEvent(customFormEventConfigs, state.formModel,
|
||||||
|
systemFormRef.value,
|
||||||
|
formProps.schemas); //表单事件:提交表单
|
||||||
|
return saveVal;
|
||||||
|
} catch (error) {}
|
||||||
|
}
|
||||||
|
// 新增api表单数据
|
||||||
|
async function add(values) {
|
||||||
|
try {
|
||||||
|
state.formModel = values;
|
||||||
|
let saveVal = await addLngPngDemand(values);
|
||||||
|
await submitFormEvent(customFormEventConfigs, state.formModel,
|
||||||
|
systemFormRef.value,
|
||||||
|
formProps.schemas); //表单事件:提交表单
|
||||||
|
return saveVal;
|
||||||
|
} catch (error) {}
|
||||||
|
}
|
||||||
|
// 根据工作流页面权限,设置表单属性(必填,禁用,显示)
|
||||||
|
async function setWorkFlowForm(obj: WorkFlowFormParams) {
|
||||||
|
try {
|
||||||
|
const cloneProps=cloneDeep(formProps);
|
||||||
|
customFormEventConfigs=cloneDeep(formEventConfigs);
|
||||||
|
if (formConfig.useCustomConfig) {
|
||||||
|
const parts = obj.formConfigKey.split('_');
|
||||||
|
const formId=parts[1];
|
||||||
|
cloneProps.schemas=await mergeFormSchemas({formSchema:cloneProps.schemas!,formId:formId});
|
||||||
|
customFormEventConfigs=await mergeFormEventConfigs({formEventConfigs:customFormEventConfigs,formId:formId});
|
||||||
|
}
|
||||||
|
|
||||||
|
let flowData = changeWorkFlowForm(cloneProps, obj);
|
||||||
|
let { buildOptionJson, uploadComponentIds, formModels, isViewProcess } = flowData;
|
||||||
|
data.formDataProps = buildOptionJson;
|
||||||
|
emits('changeUploadComponentIds', uploadComponentIds); //工作流中必须保存上传组件id【附件汇总需要】
|
||||||
|
if (isViewProcess) {
|
||||||
|
setDisabledForm(); //查看
|
||||||
|
}
|
||||||
|
state.formModel = formModels;
|
||||||
|
if(formModels[RowKey]) {
|
||||||
|
setFormDataFromId(formModels[RowKey], false)
|
||||||
|
} else {
|
||||||
|
setFieldsValue(formModels)
|
||||||
|
}
|
||||||
|
} catch (error) {}
|
||||||
|
await createFormEvent(customFormEventConfigs, state.formModel,
|
||||||
|
systemFormRef.value,
|
||||||
|
formProps.schemas); //表单事件:初始化表单
|
||||||
|
await loadFormEvent(customFormEventConfigs, state.formModel,
|
||||||
|
systemFormRef.value,
|
||||||
|
formProps.schemas); //表单事件:加载表单
|
||||||
|
}
|
||||||
|
function getFormModel() {
|
||||||
|
return systemFormRef.value.formModel
|
||||||
|
}
|
||||||
|
async function handleDelete(id) {
|
||||||
|
return await deleteLngPngDemand([id]);
|
||||||
|
}
|
||||||
|
defineExpose({
|
||||||
|
setFieldsValue,
|
||||||
|
resetFields,
|
||||||
|
validate,
|
||||||
|
add,
|
||||||
|
update,
|
||||||
|
setFormDataFromId,
|
||||||
|
setDisabledForm,
|
||||||
|
setMenuPermission,
|
||||||
|
setWorkFlowForm,
|
||||||
|
getRowKey,
|
||||||
|
getFormModel,
|
||||||
|
handleDelete
|
||||||
|
});
|
||||||
|
</script>
|
||||||
201
src/views/dayPlan/Demand/components/basicForm.vue
Normal file
201
src/views/dayPlan/Demand/components/basicForm.vue
Normal file
@ -0,0 +1,201 @@
|
|||||||
|
<template>
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="计划日期" name="datePlan">
|
||||||
|
<a-date-picker v-model:value="formState.datePlan" :disabled-date="disabledDateStart" style="width: 100%" placeholder="请选择计划日期" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="合同" name="kName">
|
||||||
|
<a-input-search v-model:value="formState.kName" :disabled="isDisable" placeholder="请选择合同" readonly @search="onSearch"/>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="下载点" name="fullName" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||||
|
{{ formState.fullName }}
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="合同量(吉焦)" name="qtyContractGj">{{ formState.qtyContractGj }}</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="合同量(方)" name="qtyContractM3">{{ formState.qtyContractM3 }}</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="月合同量执行进度%" name="rateK">{{ formState.rateK }}</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="计划量(吉焦)" name="qtyPlanGj">{{ formState.qtyPlanGj }}</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="计划量(方)" name="qtyPlanM3">{{ formState.qtyPlanM3 }}</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="月计划量执行进度%" name="rateMp">{{ formState.rateMp }}</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="指定量(吉焦)" name="qtyDemandGj">{{ formState.qtyDemandGj }}</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="指定量(方)" name="qtyDemandM3">{{ formState.qtyDemandM3 }}</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="月时间进度%" name="rateS">{{ formState.rateS }}</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="批复量(吉焦)" name="qtySalesGj">{{ formState.qtySalesGj }}</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="批复量(方)" name="qtySalesM3">{{ formState.qtySalesM3 }}</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="比值(方/吉焦)" name="rateM3Gj">{{ formState.rateM3Gj }}</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="交易主体" name="name">{{ formState.name }}</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="版本号" name="verNo">{{ formState.verNo }}</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-form-item label="审批状态" name="approName">{{ formState.approName }}</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="开机方式" name="" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||||
|
<div style="display: flex;">
|
||||||
|
<div class="dot"><span style="background:#04F21C"></span>连运<i>{{ formState.powerCont }}</i>台</div>
|
||||||
|
<div class="dot"><span style="background:#FFFF00"></span>调峰<i>{{ formState.powerCont }}</i>台</div>
|
||||||
|
<div class="dot"><span style="background:#D9001B"></span>停机<i>{{ formState.powerStop }}</i>台</div>
|
||||||
|
<div class="dot"><span style="background:#CA90FF"></span>其他<i>{{ formState.powerOther }}</i>台</div>
|
||||||
|
</div>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="备注" name="note" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||||
|
{{ formState.note }}
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-table style="width: 100%" :columns="columns" :data-source="dataList" :pagination="false" :scroll="{x: 1000}">
|
||||||
|
<template #bodyCell="{ column, record, index }">
|
||||||
|
<template v-if="column.dataIndex === 'qtySalesGj'">
|
||||||
|
<a-input-number v-model:value="record.qtySalesGj" :disabled="record.alterSign=='D' || disable" :min="0" @change="numChange" style="width: 100%" />
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex === 'qtySalesM3'">
|
||||||
|
<a-input-number v-model:value="record.qtySalesM3" :disabled="record.alterSign=='D' || disable" :min="0" @change="numChange" style="width: 100%" />
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex === 'note'">
|
||||||
|
<a-input v-model:value="record.note" :disabled="record.alterSign=='D' || disable" style="width: 100%" />
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</a-table>
|
||||||
|
<ContractSalesListModal @register="registerContractSales" @success="handleSuccessContractSales" selectType="radio" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
|
import { ref, computed, onMounted, onBeforeMount, nextTick, defineAsyncComponent, reactive, defineComponent, watch} from 'vue';
|
||||||
|
import ContractSalesListModal from '/@/components/common/ContractSalesListModal.vue';
|
||||||
|
import { useModal } from '/@/components/Modal';
|
||||||
|
|
||||||
|
const { t } = useI18n();
|
||||||
|
const [registerContractSales, { openModal:openModalContractSales}] = useModal();
|
||||||
|
const props = defineProps({
|
||||||
|
formObj: {},
|
||||||
|
list: [],
|
||||||
|
disable: false
|
||||||
|
|
||||||
|
});
|
||||||
|
const columns= ref([
|
||||||
|
{ title: t('序号'), dataIndex: 'index', key: 'index', sorter: true, customRender: (column) => `${column.index + 1}` ,width: 100},
|
||||||
|
{ title: t('上载点'), dataIndex: 'pointUpName', sorter: true, width:200},
|
||||||
|
{ title: t('供应商'), dataIndex: 'suSname', sorter: true, width: 130},
|
||||||
|
{ title: t('采购合同'), dataIndex: 'kName', sorter: true, width: 200},
|
||||||
|
{ title: t('指定量(吉焦)'), dataIndex: 'qtyDemandGj', sorter: true, width: 300},
|
||||||
|
{ title: t('指定量(方)'), dataIndex: 'qtyDemandM3', sorter: true, width: 200},
|
||||||
|
{ title: t('批复量(吉焦)'), dataIndex: 'qtySalesGj', sorter: true, width: 200},
|
||||||
|
{ title: t('批复量(方)'), dataIndex: 'qtySalesM3', sorter: true, width: 200},
|
||||||
|
{ title: t('备注'), dataIndex: 'note', sorter: true, width: 200},
|
||||||
|
]);
|
||||||
|
const formState = reactive({})
|
||||||
|
const dataList = ref([])
|
||||||
|
async function numChange () {
|
||||||
|
let num = 0;
|
||||||
|
let num1 = 1;
|
||||||
|
dataList.forEach(v => {
|
||||||
|
num+=(Number(v.qtySalesGj) || 0)
|
||||||
|
num1+=(Number(v.qtySalesM3) || 0)
|
||||||
|
})
|
||||||
|
formState.qtySalesGj = num
|
||||||
|
formState.qtySalesM3 = num1
|
||||||
|
}
|
||||||
|
const onSearch = (val)=> {
|
||||||
|
openModalContractSales(true,{isUpdate: false})
|
||||||
|
}
|
||||||
|
const handleSuccessContractSales = (val) => {
|
||||||
|
|
||||||
|
}
|
||||||
|
const disabledDateStart = (current) => {
|
||||||
|
const today = new Date();
|
||||||
|
today.setHours(0, 0, 0, 0); // 清除时分秒,确保比较时不考虑时间部分
|
||||||
|
// 获取明天的日期
|
||||||
|
const tomorrow = new Date();
|
||||||
|
tomorrow.setDate(tomorrow.getDate() + 2);
|
||||||
|
tomorrow.setHours(0, 0, 0, 0); // 清除时分秒
|
||||||
|
// 当前日期小于今天或大于明天,则禁用
|
||||||
|
return current < today || current > tomorrow;
|
||||||
|
}
|
||||||
|
function getFormValue () {
|
||||||
|
let obj = {
|
||||||
|
formInfo: formState,
|
||||||
|
list: dataList.value
|
||||||
|
}
|
||||||
|
return obj
|
||||||
|
}
|
||||||
|
watch(
|
||||||
|
() => props.formObj,
|
||||||
|
(val) => {
|
||||||
|
if (val) {
|
||||||
|
Object.assign(formState, {...val})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
immediate: true,
|
||||||
|
deep: true,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
watch(
|
||||||
|
() => props.list,
|
||||||
|
(val) => {
|
||||||
|
dataList.value = val
|
||||||
|
},
|
||||||
|
{
|
||||||
|
immediate: true,
|
||||||
|
deep: true,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
defineExpose({
|
||||||
|
getFormValue
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
|
||||||
|
.dot {
|
||||||
|
margin-right: 10px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
i{
|
||||||
|
padding: 5px;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
span{
|
||||||
|
width: 10px !important;
|
||||||
|
height: 10px !important;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: red;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
890
src/views/dayPlan/Demand/components/config.ts
Normal file
890
src/views/dayPlan/Demand/components/config.ts
Normal file
@ -0,0 +1,890 @@
|
|||||||
|
import { FormProps, FormSchema } from '/@/components/Form';
|
||||||
|
import { BasicColumn } from '/@/components/Table';
|
||||||
|
|
||||||
|
export const formConfig = {
|
||||||
|
useCustomConfig: false,
|
||||||
|
};
|
||||||
|
|
||||||
|
export const searchFormSchema: FormSchema[] = [
|
||||||
|
{
|
||||||
|
field: 'verNo',
|
||||||
|
label: '版本号',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'datePlan',
|
||||||
|
label: '计划日期',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'pointDelyCode',
|
||||||
|
label: '下载点',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'qtyDemandGj',
|
||||||
|
label: '指定量 (吉焦)',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'qtyDemandM3',
|
||||||
|
label: '指定量 (万方)',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'priceSalesGj',
|
||||||
|
label: '批复量 (吉焦)',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'priceSalesM3',
|
||||||
|
label: '批复量 (万方)',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'ksId',
|
||||||
|
label: '合同',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'id',
|
||||||
|
label: 'id',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'orgId',
|
||||||
|
label: 'orgId',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'note',
|
||||||
|
label: '备注',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'reply',
|
||||||
|
label: '批复意见',
|
||||||
|
component: 'Input',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export const columns: BasicColumn[] = [
|
||||||
|
{
|
||||||
|
dataIndex: 'verNo',
|
||||||
|
title: '版本号',
|
||||||
|
componentType: 'input',
|
||||||
|
align: 'left',
|
||||||
|
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
dataIndex: 'datePlan',
|
||||||
|
title: '计划日期',
|
||||||
|
componentType: 'input',
|
||||||
|
align: 'left',
|
||||||
|
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
dataIndex: 'pointDelyCode',
|
||||||
|
title: '下载点',
|
||||||
|
componentType: 'input',
|
||||||
|
align: 'left',
|
||||||
|
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
dataIndex: 'qtyDemandGj',
|
||||||
|
title: '指定量 (吉焦)',
|
||||||
|
componentType: 'input',
|
||||||
|
align: 'left',
|
||||||
|
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
dataIndex: 'qtyDemandM3',
|
||||||
|
title: '指定量 (万方)',
|
||||||
|
componentType: 'input',
|
||||||
|
align: 'left',
|
||||||
|
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
dataIndex: 'priceSalesGj',
|
||||||
|
title: '批复量 (吉焦)',
|
||||||
|
componentType: 'input',
|
||||||
|
align: 'left',
|
||||||
|
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
dataIndex: 'priceSalesM3',
|
||||||
|
title: '批复量 (万方)',
|
||||||
|
componentType: 'input',
|
||||||
|
align: 'left',
|
||||||
|
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
dataIndex: 'ksId',
|
||||||
|
title: '合同',
|
||||||
|
componentType: 'input',
|
||||||
|
align: 'left',
|
||||||
|
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
dataIndex: 'note',
|
||||||
|
title: '备注',
|
||||||
|
componentType: 'input',
|
||||||
|
align: 'left',
|
||||||
|
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
dataIndex: 'reply',
|
||||||
|
title: '批复意见',
|
||||||
|
componentType: 'input',
|
||||||
|
align: 'left',
|
||||||
|
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
dataIndex: 'id',
|
||||||
|
title: 'id',
|
||||||
|
componentType: 'input',
|
||||||
|
align: 'left',
|
||||||
|
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
dataIndex: 'orgId',
|
||||||
|
title: 'orgId',
|
||||||
|
componentType: 'input',
|
||||||
|
align: 'left',
|
||||||
|
|
||||||
|
sorter: true,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
//表单事件
|
||||||
|
export const formEventConfigs = {
|
||||||
|
0: [
|
||||||
|
{
|
||||||
|
type: 'circle',
|
||||||
|
color: '#2774ff',
|
||||||
|
text: '开始节点',
|
||||||
|
icon: '#icon-kaishi',
|
||||||
|
bgcColor: '#D8E5FF',
|
||||||
|
isUserDefined: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
color: '#F6AB01',
|
||||||
|
icon: '#icon-chushihua',
|
||||||
|
text: '初始化表单',
|
||||||
|
bgcColor: '#f9f5ea',
|
||||||
|
isUserDefined: false,
|
||||||
|
nodeInfo: { processEvent: [] },
|
||||||
|
},
|
||||||
|
],
|
||||||
|
1: [
|
||||||
|
{
|
||||||
|
color: '#B36EDB',
|
||||||
|
icon: '#icon-shujufenxi',
|
||||||
|
text: '获取表单数据',
|
||||||
|
detail: '(新增无此操作)',
|
||||||
|
bgcColor: '#F8F2FC',
|
||||||
|
isUserDefined: false,
|
||||||
|
nodeInfo: { processEvent: [] },
|
||||||
|
},
|
||||||
|
],
|
||||||
|
2: [
|
||||||
|
{
|
||||||
|
color: '#F8625C',
|
||||||
|
icon: '#icon-jiazai',
|
||||||
|
text: '加载表单',
|
||||||
|
bgcColor: '#FFF1F1',
|
||||||
|
isUserDefined: false,
|
||||||
|
nodeInfo: { processEvent: [] },
|
||||||
|
},
|
||||||
|
],
|
||||||
|
3: [
|
||||||
|
{
|
||||||
|
color: '#6C6AE0',
|
||||||
|
icon: '#icon-jsontijiao',
|
||||||
|
text: '提交表单',
|
||||||
|
bgcColor: '#F5F4FF',
|
||||||
|
isUserDefined: false,
|
||||||
|
nodeInfo: { processEvent: [] },
|
||||||
|
},
|
||||||
|
],
|
||||||
|
4: [
|
||||||
|
{
|
||||||
|
type: 'circle',
|
||||||
|
color: '#F8625C',
|
||||||
|
text: '结束节点',
|
||||||
|
icon: '#icon-jieshuzhiliao',
|
||||||
|
bgcColor: '#FFD6D6',
|
||||||
|
isLast: true,
|
||||||
|
isUserDefined: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
export const formProps: FormProps = {
|
||||||
|
labelCol: { span: 3, offset: 0 },
|
||||||
|
labelAlign: 'right',
|
||||||
|
layout: 'horizontal',
|
||||||
|
size: 'default',
|
||||||
|
schemas: [
|
||||||
|
{
|
||||||
|
key: '507eb62c43774f02bf7ced2f940e3f80',
|
||||||
|
field: 'id',
|
||||||
|
label: 'id',
|
||||||
|
type: 'input',
|
||||||
|
component: 'Input',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
defaultValue: '',
|
||||||
|
componentProps: {
|
||||||
|
width: '100%',
|
||||||
|
span: '',
|
||||||
|
defaultValue: '',
|
||||||
|
labelWidthMode: 'fix',
|
||||||
|
labelFixWidth: 120,
|
||||||
|
responsive: false,
|
||||||
|
respNewRow: false,
|
||||||
|
placeholder: '请输入id',
|
||||||
|
prefix: '',
|
||||||
|
suffix: '',
|
||||||
|
addonBefore: '',
|
||||||
|
addonAfter: '',
|
||||||
|
disabled: false,
|
||||||
|
allowClear: false,
|
||||||
|
showLabel: true,
|
||||||
|
required: false,
|
||||||
|
rules: [],
|
||||||
|
events: {},
|
||||||
|
isSave: false,
|
||||||
|
isShow: false,
|
||||||
|
scan: false,
|
||||||
|
style: { width: '100%' },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '9b1a78bbef2e4f1d90631cbb6b91fbfb',
|
||||||
|
field: 'orgId',
|
||||||
|
label: 'orgId',
|
||||||
|
type: 'input',
|
||||||
|
component: 'Input',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
defaultValue: '',
|
||||||
|
componentProps: {
|
||||||
|
width: '100%',
|
||||||
|
span: '',
|
||||||
|
defaultValue: '',
|
||||||
|
labelWidthMode: 'fix',
|
||||||
|
labelFixWidth: 120,
|
||||||
|
responsive: false,
|
||||||
|
respNewRow: false,
|
||||||
|
placeholder: '请输入orgId',
|
||||||
|
prefix: '',
|
||||||
|
suffix: '',
|
||||||
|
addonBefore: '',
|
||||||
|
addonAfter: '',
|
||||||
|
disabled: false,
|
||||||
|
allowClear: false,
|
||||||
|
showLabel: true,
|
||||||
|
required: false,
|
||||||
|
rules: [],
|
||||||
|
events: {},
|
||||||
|
isSave: false,
|
||||||
|
isShow: false,
|
||||||
|
scan: false,
|
||||||
|
style: { width: '100%' },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '9623c0b4246d42e4946ee8921534451a',
|
||||||
|
field: 'verNo',
|
||||||
|
label: '版本号',
|
||||||
|
type: 'input',
|
||||||
|
component: 'Input',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
defaultValue: '',
|
||||||
|
componentProps: {
|
||||||
|
width: '100%',
|
||||||
|
span: '',
|
||||||
|
defaultValue: '',
|
||||||
|
labelWidthMode: 'fix',
|
||||||
|
labelFixWidth: 120,
|
||||||
|
responsive: false,
|
||||||
|
respNewRow: false,
|
||||||
|
placeholder: '请输入版本号',
|
||||||
|
prefix: '',
|
||||||
|
suffix: '',
|
||||||
|
addonBefore: '',
|
||||||
|
addonAfter: '',
|
||||||
|
disabled: false,
|
||||||
|
allowClear: false,
|
||||||
|
showLabel: true,
|
||||||
|
required: false,
|
||||||
|
rules: [],
|
||||||
|
events: {},
|
||||||
|
isSave: false,
|
||||||
|
isShow: true,
|
||||||
|
scan: false,
|
||||||
|
style: { width: '100%' },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'aa582ae47b85467386f9520d298308a1',
|
||||||
|
field: 'datePlan',
|
||||||
|
label: '计划日期',
|
||||||
|
type: 'input',
|
||||||
|
component: 'Input',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
defaultValue: '',
|
||||||
|
componentProps: {
|
||||||
|
width: '100%',
|
||||||
|
span: '',
|
||||||
|
defaultValue: '',
|
||||||
|
labelWidthMode: 'fix',
|
||||||
|
labelFixWidth: 120,
|
||||||
|
responsive: false,
|
||||||
|
respNewRow: false,
|
||||||
|
placeholder: '请输入计划日期',
|
||||||
|
prefix: '',
|
||||||
|
suffix: '',
|
||||||
|
addonBefore: '',
|
||||||
|
addonAfter: '',
|
||||||
|
disabled: false,
|
||||||
|
allowClear: false,
|
||||||
|
showLabel: true,
|
||||||
|
required: false,
|
||||||
|
rules: [],
|
||||||
|
events: {},
|
||||||
|
isSave: false,
|
||||||
|
isShow: true,
|
||||||
|
scan: false,
|
||||||
|
style: { width: '100%' },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '215b645570b844c3a7c5da5ddb283b1b',
|
||||||
|
field: 'pointDelyCode',
|
||||||
|
label: '下载点',
|
||||||
|
type: 'input',
|
||||||
|
component: 'Input',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
defaultValue: '',
|
||||||
|
componentProps: {
|
||||||
|
width: '100%',
|
||||||
|
span: '',
|
||||||
|
defaultValue: '',
|
||||||
|
labelWidthMode: 'fix',
|
||||||
|
labelFixWidth: 120,
|
||||||
|
responsive: false,
|
||||||
|
respNewRow: false,
|
||||||
|
placeholder: '请输入下载点',
|
||||||
|
prefix: '',
|
||||||
|
suffix: '',
|
||||||
|
addonBefore: '',
|
||||||
|
addonAfter: '',
|
||||||
|
disabled: false,
|
||||||
|
allowClear: false,
|
||||||
|
showLabel: true,
|
||||||
|
required: false,
|
||||||
|
rules: [],
|
||||||
|
events: {},
|
||||||
|
isSave: false,
|
||||||
|
isShow: true,
|
||||||
|
scan: false,
|
||||||
|
style: { width: '100%' },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '30eaa4cefe5c4cbf91fae935ad28fda4',
|
||||||
|
field: 'qtyDemandGj',
|
||||||
|
label: '指定量 (吉焦)',
|
||||||
|
type: 'input',
|
||||||
|
component: 'Input',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
defaultValue: '',
|
||||||
|
componentProps: {
|
||||||
|
width: '100%',
|
||||||
|
span: '',
|
||||||
|
defaultValue: '',
|
||||||
|
labelWidthMode: 'fix',
|
||||||
|
labelFixWidth: 120,
|
||||||
|
responsive: false,
|
||||||
|
respNewRow: false,
|
||||||
|
placeholder: '请输入指定量 (吉焦)',
|
||||||
|
prefix: '',
|
||||||
|
suffix: '',
|
||||||
|
addonBefore: '',
|
||||||
|
addonAfter: '',
|
||||||
|
disabled: false,
|
||||||
|
allowClear: false,
|
||||||
|
showLabel: true,
|
||||||
|
required: false,
|
||||||
|
rules: [],
|
||||||
|
events: {},
|
||||||
|
isSave: false,
|
||||||
|
isShow: true,
|
||||||
|
scan: false,
|
||||||
|
style: { width: '100%' },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '509628684d3c4c4badd25da8498cab71',
|
||||||
|
field: 'qtyDemandM3',
|
||||||
|
label: '指定量 (万方)',
|
||||||
|
type: 'input',
|
||||||
|
component: 'Input',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
defaultValue: '',
|
||||||
|
componentProps: {
|
||||||
|
width: '100%',
|
||||||
|
span: '',
|
||||||
|
defaultValue: '',
|
||||||
|
labelWidthMode: 'fix',
|
||||||
|
labelFixWidth: 120,
|
||||||
|
responsive: false,
|
||||||
|
respNewRow: false,
|
||||||
|
placeholder: '请输入指定量 (万方)',
|
||||||
|
prefix: '',
|
||||||
|
suffix: '',
|
||||||
|
addonBefore: '',
|
||||||
|
addonAfter: '',
|
||||||
|
disabled: false,
|
||||||
|
allowClear: false,
|
||||||
|
showLabel: true,
|
||||||
|
required: false,
|
||||||
|
rules: [],
|
||||||
|
events: {},
|
||||||
|
isSave: false,
|
||||||
|
isShow: true,
|
||||||
|
scan: false,
|
||||||
|
style: { width: '100%' },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '3d0487b5b7324aa8b81ad4f97987fa5c',
|
||||||
|
field: 'priceSalesGj',
|
||||||
|
label: '批复量 (吉焦)',
|
||||||
|
type: 'input',
|
||||||
|
component: 'Input',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
defaultValue: '',
|
||||||
|
componentProps: {
|
||||||
|
width: '100%',
|
||||||
|
span: '',
|
||||||
|
defaultValue: '',
|
||||||
|
labelWidthMode: 'fix',
|
||||||
|
labelFixWidth: 120,
|
||||||
|
responsive: false,
|
||||||
|
respNewRow: false,
|
||||||
|
placeholder: '请输入批复量 (吉焦)',
|
||||||
|
prefix: '',
|
||||||
|
suffix: '',
|
||||||
|
addonBefore: '',
|
||||||
|
addonAfter: '',
|
||||||
|
disabled: false,
|
||||||
|
allowClear: false,
|
||||||
|
showLabel: true,
|
||||||
|
required: false,
|
||||||
|
rules: [],
|
||||||
|
events: {},
|
||||||
|
isSave: false,
|
||||||
|
isShow: true,
|
||||||
|
scan: false,
|
||||||
|
style: { width: '100%' },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '1087c1af09fa4465adcb09080062a4be',
|
||||||
|
field: 'priceSalesM3',
|
||||||
|
label: '批复量 (万方)',
|
||||||
|
type: 'input',
|
||||||
|
component: 'Input',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
defaultValue: '',
|
||||||
|
componentProps: {
|
||||||
|
width: '100%',
|
||||||
|
span: '',
|
||||||
|
defaultValue: '',
|
||||||
|
labelWidthMode: 'fix',
|
||||||
|
labelFixWidth: 120,
|
||||||
|
responsive: false,
|
||||||
|
respNewRow: false,
|
||||||
|
placeholder: '请输入批复量 (万方)',
|
||||||
|
prefix: '',
|
||||||
|
suffix: '',
|
||||||
|
addonBefore: '',
|
||||||
|
addonAfter: '',
|
||||||
|
disabled: false,
|
||||||
|
allowClear: false,
|
||||||
|
showLabel: true,
|
||||||
|
required: false,
|
||||||
|
rules: [],
|
||||||
|
events: {},
|
||||||
|
isSave: false,
|
||||||
|
isShow: true,
|
||||||
|
scan: false,
|
||||||
|
style: { width: '100%' },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '3d67cfdee39f454c8a4c1a60a6fb4278',
|
||||||
|
field: 'ksId',
|
||||||
|
label: '合同',
|
||||||
|
type: 'input',
|
||||||
|
component: 'Input',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
defaultValue: '',
|
||||||
|
componentProps: {
|
||||||
|
width: '100%',
|
||||||
|
span: '',
|
||||||
|
defaultValue: '',
|
||||||
|
labelWidthMode: 'fix',
|
||||||
|
labelFixWidth: 120,
|
||||||
|
responsive: false,
|
||||||
|
respNewRow: false,
|
||||||
|
placeholder: '请输入合同',
|
||||||
|
prefix: '',
|
||||||
|
suffix: '',
|
||||||
|
addonBefore: '',
|
||||||
|
addonAfter: '',
|
||||||
|
disabled: false,
|
||||||
|
allowClear: false,
|
||||||
|
showLabel: true,
|
||||||
|
required: false,
|
||||||
|
rules: [],
|
||||||
|
events: {},
|
||||||
|
isSave: false,
|
||||||
|
isShow: true,
|
||||||
|
scan: false,
|
||||||
|
style: { width: '100%' },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'c20eeb953fbb4125871b3d214ac9e9cb',
|
||||||
|
field: 'note',
|
||||||
|
label: '备注',
|
||||||
|
type: 'input',
|
||||||
|
component: 'Input',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
defaultValue: '',
|
||||||
|
componentProps: {
|
||||||
|
width: '100%',
|
||||||
|
span: '',
|
||||||
|
defaultValue: '',
|
||||||
|
labelWidthMode: 'fix',
|
||||||
|
labelFixWidth: 120,
|
||||||
|
responsive: false,
|
||||||
|
respNewRow: false,
|
||||||
|
placeholder: '请输入备注',
|
||||||
|
prefix: '',
|
||||||
|
suffix: '',
|
||||||
|
addonBefore: '',
|
||||||
|
addonAfter: '',
|
||||||
|
disabled: false,
|
||||||
|
allowClear: false,
|
||||||
|
showLabel: true,
|
||||||
|
required: false,
|
||||||
|
rules: [],
|
||||||
|
events: {},
|
||||||
|
isSave: false,
|
||||||
|
isShow: true,
|
||||||
|
scan: false,
|
||||||
|
style: { width: '100%' },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'baa1072f803542a78321c5ed9343cd71',
|
||||||
|
field: 'reply',
|
||||||
|
label: '批复意见',
|
||||||
|
type: 'input',
|
||||||
|
component: 'Input',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
defaultValue: '',
|
||||||
|
componentProps: {
|
||||||
|
width: '100%',
|
||||||
|
span: '',
|
||||||
|
defaultValue: '',
|
||||||
|
labelWidthMode: 'fix',
|
||||||
|
labelFixWidth: 120,
|
||||||
|
responsive: false,
|
||||||
|
respNewRow: false,
|
||||||
|
placeholder: '请输入批复意见',
|
||||||
|
prefix: '',
|
||||||
|
suffix: '',
|
||||||
|
addonBefore: '',
|
||||||
|
addonAfter: '',
|
||||||
|
disabled: false,
|
||||||
|
allowClear: false,
|
||||||
|
showLabel: true,
|
||||||
|
required: false,
|
||||||
|
rules: [],
|
||||||
|
events: {},
|
||||||
|
isSave: false,
|
||||||
|
isShow: true,
|
||||||
|
scan: false,
|
||||||
|
style: { width: '100%' },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'de7d4ef3aa2749d49aa65ee6400e9c05',
|
||||||
|
label: '表格组件',
|
||||||
|
field: 'lngPngDemandPurList',
|
||||||
|
type: 'form',
|
||||||
|
component: 'SubForm',
|
||||||
|
required: true,
|
||||||
|
colProps: { span: 24 },
|
||||||
|
componentProps: {
|
||||||
|
mainKey: 'lngPngDemandPurList',
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
key: 'cf499d1978bd41a9b56df297e78a1f5f',
|
||||||
|
title: '供应商',
|
||||||
|
dataIndex: 'suCode',
|
||||||
|
componentType: 'Input',
|
||||||
|
defaultValue: '',
|
||||||
|
componentProps: {
|
||||||
|
width: '100%',
|
||||||
|
span: '',
|
||||||
|
defaultValue: '',
|
||||||
|
labelWidthMode: 'fix',
|
||||||
|
labelFixWidth: 120,
|
||||||
|
responsive: false,
|
||||||
|
respNewRow: false,
|
||||||
|
placeholder: '请输入供应商',
|
||||||
|
prefix: '',
|
||||||
|
suffix: '',
|
||||||
|
addonBefore: '',
|
||||||
|
addonAfter: '',
|
||||||
|
disabled: false,
|
||||||
|
allowClear: false,
|
||||||
|
showLabel: true,
|
||||||
|
required: false,
|
||||||
|
rules: [],
|
||||||
|
events: {},
|
||||||
|
isSave: false,
|
||||||
|
isShow: true,
|
||||||
|
scan: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '67e93d9212c94609a514c4edaccc1b31',
|
||||||
|
title: '上载点',
|
||||||
|
dataIndex: 'pointUpCode',
|
||||||
|
componentType: 'Input',
|
||||||
|
defaultValue: '',
|
||||||
|
componentProps: {
|
||||||
|
width: '100%',
|
||||||
|
span: '',
|
||||||
|
defaultValue: '',
|
||||||
|
labelWidthMode: 'fix',
|
||||||
|
labelFixWidth: 120,
|
||||||
|
responsive: false,
|
||||||
|
respNewRow: false,
|
||||||
|
placeholder: '请输入上载点',
|
||||||
|
prefix: '',
|
||||||
|
suffix: '',
|
||||||
|
addonBefore: '',
|
||||||
|
addonAfter: '',
|
||||||
|
disabled: false,
|
||||||
|
allowClear: false,
|
||||||
|
showLabel: true,
|
||||||
|
required: false,
|
||||||
|
rules: [],
|
||||||
|
events: {},
|
||||||
|
isSave: false,
|
||||||
|
isShow: true,
|
||||||
|
scan: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '745dd4f8a280445e94e3104ae4f67324',
|
||||||
|
title: '指定量 (吉焦)',
|
||||||
|
dataIndex: 'qtyDemandGj',
|
||||||
|
componentType: 'Input',
|
||||||
|
defaultValue: '',
|
||||||
|
componentProps: {
|
||||||
|
width: '100%',
|
||||||
|
span: '',
|
||||||
|
defaultValue: '',
|
||||||
|
labelWidthMode: 'fix',
|
||||||
|
labelFixWidth: 120,
|
||||||
|
responsive: false,
|
||||||
|
respNewRow: false,
|
||||||
|
placeholder: '请输入指定量(吉焦)',
|
||||||
|
prefix: '',
|
||||||
|
suffix: '',
|
||||||
|
addonBefore: '',
|
||||||
|
addonAfter: '',
|
||||||
|
disabled: false,
|
||||||
|
allowClear: false,
|
||||||
|
showLabel: true,
|
||||||
|
required: false,
|
||||||
|
rules: [],
|
||||||
|
events: {},
|
||||||
|
isSave: false,
|
||||||
|
isShow: true,
|
||||||
|
scan: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'e9ebeeded6844f58a36f9e4a795086a4',
|
||||||
|
title: '指定量 (方)',
|
||||||
|
dataIndex: 'qtyDemandM3',
|
||||||
|
componentType: 'Input',
|
||||||
|
defaultValue: '',
|
||||||
|
componentProps: {
|
||||||
|
width: '100%',
|
||||||
|
span: '',
|
||||||
|
defaultValue: '',
|
||||||
|
labelWidthMode: 'fix',
|
||||||
|
labelFixWidth: 120,
|
||||||
|
responsive: false,
|
||||||
|
respNewRow: false,
|
||||||
|
placeholder: '请输入指定量 (方)',
|
||||||
|
prefix: '',
|
||||||
|
suffix: '',
|
||||||
|
addonBefore: '',
|
||||||
|
addonAfter: '',
|
||||||
|
disabled: false,
|
||||||
|
allowClear: false,
|
||||||
|
showLabel: true,
|
||||||
|
required: false,
|
||||||
|
rules: [],
|
||||||
|
events: {},
|
||||||
|
isSave: false,
|
||||||
|
isShow: true,
|
||||||
|
scan: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'a6d9c9839a9142a3a0376d09c061b284',
|
||||||
|
title: '批复量 (吉焦)',
|
||||||
|
dataIndex: 'qtySalesGj',
|
||||||
|
componentType: 'Input',
|
||||||
|
defaultValue: '',
|
||||||
|
componentProps: {
|
||||||
|
width: '100%',
|
||||||
|
span: '',
|
||||||
|
defaultValue: '',
|
||||||
|
labelWidthMode: 'fix',
|
||||||
|
labelFixWidth: 120,
|
||||||
|
responsive: false,
|
||||||
|
respNewRow: false,
|
||||||
|
placeholder: '请输入批复量 (吉焦)',
|
||||||
|
prefix: '',
|
||||||
|
suffix: '',
|
||||||
|
addonBefore: '',
|
||||||
|
addonAfter: '',
|
||||||
|
disabled: false,
|
||||||
|
allowClear: false,
|
||||||
|
showLabel: true,
|
||||||
|
required: false,
|
||||||
|
rules: [],
|
||||||
|
events: {},
|
||||||
|
isSave: false,
|
||||||
|
isShow: true,
|
||||||
|
scan: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '5eaffb7d44e64e9484c369d037873708',
|
||||||
|
title: '批复量 (方)',
|
||||||
|
dataIndex: 'qtySalesM3',
|
||||||
|
componentType: 'Input',
|
||||||
|
defaultValue: '',
|
||||||
|
componentProps: {
|
||||||
|
width: '100%',
|
||||||
|
span: '',
|
||||||
|
defaultValue: '',
|
||||||
|
labelWidthMode: 'fix',
|
||||||
|
labelFixWidth: 120,
|
||||||
|
responsive: false,
|
||||||
|
respNewRow: false,
|
||||||
|
placeholder: '请输入批复量 (方)',
|
||||||
|
prefix: '',
|
||||||
|
suffix: '',
|
||||||
|
addonBefore: '',
|
||||||
|
addonAfter: '',
|
||||||
|
disabled: false,
|
||||||
|
allowClear: false,
|
||||||
|
showLabel: true,
|
||||||
|
required: false,
|
||||||
|
rules: [],
|
||||||
|
events: {},
|
||||||
|
isSave: false,
|
||||||
|
isShow: true,
|
||||||
|
scan: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: '4858ef81ff9148b7bd0deb7ded6ef196',
|
||||||
|
title: '备注',
|
||||||
|
dataIndex: 'note',
|
||||||
|
componentType: 'Input',
|
||||||
|
defaultValue: '',
|
||||||
|
componentProps: {
|
||||||
|
width: '100%',
|
||||||
|
span: '',
|
||||||
|
defaultValue: '',
|
||||||
|
labelWidthMode: 'fix',
|
||||||
|
labelFixWidth: 120,
|
||||||
|
responsive: false,
|
||||||
|
respNewRow: false,
|
||||||
|
placeholder: '请输入备注',
|
||||||
|
prefix: '',
|
||||||
|
suffix: '',
|
||||||
|
addonBefore: '',
|
||||||
|
addonAfter: '',
|
||||||
|
disabled: false,
|
||||||
|
allowClear: false,
|
||||||
|
showLabel: true,
|
||||||
|
required: false,
|
||||||
|
rules: [],
|
||||||
|
events: {},
|
||||||
|
isSave: false,
|
||||||
|
isShow: true,
|
||||||
|
scan: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{ title: '操作', key: 'action', fixed: 'right', width: '50px' },
|
||||||
|
],
|
||||||
|
span: '24',
|
||||||
|
preloadType: 'api',
|
||||||
|
apiConfig: {},
|
||||||
|
itemId: '',
|
||||||
|
dicOptions: [],
|
||||||
|
useSelectButton: false,
|
||||||
|
buttonName: '选择数据',
|
||||||
|
showLabel: true,
|
||||||
|
showComponentBorder: true,
|
||||||
|
showFormBorder: true,
|
||||||
|
showIndex: false,
|
||||||
|
isShow: true,
|
||||||
|
multipleHeads: [],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
showActionButtonGroup: false,
|
||||||
|
buttonLocation: 'center',
|
||||||
|
actionColOptions: { span: 24 },
|
||||||
|
showResetButton: false,
|
||||||
|
showSubmitButton: false,
|
||||||
|
hiddenComponent: [],
|
||||||
|
};
|
||||||
225
src/views/dayPlan/Demand/components/createForm.vue
Normal file
225
src/views/dayPlan/Demand/components/createForm.vue
Normal file
@ -0,0 +1,225 @@
|
|||||||
|
<template>
|
||||||
|
<a-spin :spinning="spinning" tip="加载中...">
|
||||||
|
<div class="page-bg-wrap formViewStyle">
|
||||||
|
<a-form ref="formRef" :model="formState" :rules="rules" v-bind="layout">
|
||||||
|
<Card :title="title" :bordered="false" >
|
||||||
|
<basicForm ref="basicFormRef" :formObj="formState" :list="dataList" :disable="currentRoute.query.type"></basicForm>
|
||||||
|
</Card>
|
||||||
|
<Card :title="title" :bordered="false" v-if="currentRoute.query.type=='compare'">
|
||||||
|
<basicForm ref="basicFormRef" :formObj="formState" :list="dataList" :disable="currentRoute.query.type"></basicForm>
|
||||||
|
</Card>
|
||||||
|
</a-form>
|
||||||
|
</div>
|
||||||
|
</a-spin>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { Card } from 'ant-design-vue';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
import { FromPageType, RecordType } from '/@/enums/workflowEnum';
|
||||||
|
import { ref, computed, onMounted, onBeforeMount, nextTick, defineAsyncComponent, reactive, defineComponent, watch} from 'vue';
|
||||||
|
import { CheckCircleOutlined, StopOutlined, CloseOutlined, } from '@ant-design/icons-vue';
|
||||||
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
|
import { useMultipleTabStore } from '/@/store/modules/multipleTab';
|
||||||
|
import useEventBus from '/@/hooks/event/useEventBus';
|
||||||
|
import type { Rule } from 'ant-design-vue/es/form';
|
||||||
|
import { getDictionary } from '/@/api/sales/Customer';
|
||||||
|
import { useModal } from '/@/components/Modal';
|
||||||
|
import { getLngPngAppro,approveLngPngAppro } from '/@/api/dayPlan/PngAppro';
|
||||||
|
import dayjs from 'dayjs';
|
||||||
|
import { getAppEnvConfig } from '/@/utils/env';
|
||||||
|
import { message } from 'ant-design-vue';
|
||||||
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
|
import basicForm from './basicForm.vue'
|
||||||
|
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const userInfo = userStore.getUserInfo;
|
||||||
|
|
||||||
|
const formType = ref('2'); // 0 新建 1 修改 2 查看
|
||||||
|
const formRef = ref();
|
||||||
|
const props = defineProps({
|
||||||
|
disabled: false,
|
||||||
|
id: ''
|
||||||
|
|
||||||
|
});
|
||||||
|
const { bus, FORM_LIST_MODIFIED } = useEventBus();
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
const { currentRoute } = router;
|
||||||
|
const isDisable = ref(false);
|
||||||
|
const { formPath } = currentRoute.value.query;
|
||||||
|
const pathArr = [];
|
||||||
|
|
||||||
|
const tabStore = useMultipleTabStore();
|
||||||
|
const formProps = ref(null);
|
||||||
|
const formId = ref(currentRoute.value?.params?.id);
|
||||||
|
const pageType = ref(currentRoute.value.query?.type);
|
||||||
|
const pageId = ref(currentRoute.value.query?.id)
|
||||||
|
|
||||||
|
const contractQty = ref()
|
||||||
|
const spinning = ref(false);
|
||||||
|
const curIdx = ref(null)
|
||||||
|
const { notification } = useMessage();
|
||||||
|
const { t } = useI18n();
|
||||||
|
const hasDel = ref(false)
|
||||||
|
const formState = reactive({
|
||||||
|
|
||||||
|
});
|
||||||
|
const [register, { openModal:openModal}] = useModal();
|
||||||
|
const rules= reactive({
|
||||||
|
// kNo: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
|
});
|
||||||
|
const layout = {
|
||||||
|
labelCol: { span: 9 },
|
||||||
|
wrapperCol: { span: 18 },
|
||||||
|
}
|
||||||
|
const title = ref('日计划审批')
|
||||||
|
const dataList = ref([])
|
||||||
|
const basicFormRef = ref()
|
||||||
|
let optionSelect= reactive({
|
||||||
|
approCodeList: [],
|
||||||
|
});
|
||||||
|
watch(
|
||||||
|
() => props.id,
|
||||||
|
(val) => {
|
||||||
|
if (val) {
|
||||||
|
getInfo(val)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
immediate: true
|
||||||
|
}
|
||||||
|
);
|
||||||
|
onMounted(() => {
|
||||||
|
getOption()
|
||||||
|
if (pageId.value) {
|
||||||
|
getInfo(pageId.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
async function getInfo(id) {
|
||||||
|
spinning.value = true
|
||||||
|
try {
|
||||||
|
let data = await getLngPngAppro(id)
|
||||||
|
spinning.value = false
|
||||||
|
Object.assign(formState, {...data})
|
||||||
|
Object.assign(dataList.value, formState.lngPngApproPurList || [{}])
|
||||||
|
const startDate = dayjs(formState.datePlan);
|
||||||
|
const endDate = dayjs(new Date());
|
||||||
|
const diffInDays = endDate.diff(startDate, 'day');
|
||||||
|
if (diffInDays == 0) {
|
||||||
|
formState.dayDesc = '当日'
|
||||||
|
} else if (diffInDays == 1) {
|
||||||
|
formState.dayDesc = '次日'
|
||||||
|
} else if (diffInDays > 1) {
|
||||||
|
formState.dayDesc = diffInDays + '日后'
|
||||||
|
} else {
|
||||||
|
formState.dayDesc = ''
|
||||||
|
}
|
||||||
|
formState.qtyContractM3 = Number(formState.qtyContractM3)/10000
|
||||||
|
formState.qtyPlanM3 = Number(formState.qtyPlanM3)/10000
|
||||||
|
formState.qtyDemandM3 = Number(formState.qtyDemandM3)/10000
|
||||||
|
formState.qtySalesM3 = Number(formState.qtySalesM3)/10000
|
||||||
|
|
||||||
|
dataList.value.forEach(v => {
|
||||||
|
v.qtyDemandM3 = Number(v.qtyDemandM3)/10000
|
||||||
|
v.qtySalesM3 = Number(v.qtySalesM3)/10000
|
||||||
|
});
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error, 'error')
|
||||||
|
spinning.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function numChange () {
|
||||||
|
let num = 0;
|
||||||
|
let num1 = 1;
|
||||||
|
dataList.value.forEach(v => {
|
||||||
|
num+=(Number(v.qtySalesGj) || 0)
|
||||||
|
num1+=(Number(v.qtySalesM3) || 0)
|
||||||
|
})
|
||||||
|
formState.qtySalesGj = num
|
||||||
|
formState.qtySalesM3 = num1
|
||||||
|
}
|
||||||
|
async function getOption() {
|
||||||
|
optionSelect.approCodeList = await getDictionary('LNG_APPRO')
|
||||||
|
|
||||||
|
}
|
||||||
|
function close() {
|
||||||
|
tabStore.closeTab(currentRoute.value, router);
|
||||||
|
}
|
||||||
|
async function checkBtn(type) {
|
||||||
|
let data = basicFormRef.value.getFormValue()
|
||||||
|
console.log(data, 'data')
|
||||||
|
let arr = JSON.parse(JSON.stringify(data.list))
|
||||||
|
arr.forEach(v=> {
|
||||||
|
v.qtyDemandM3 = Number(v.qtyDemandM3)*10000
|
||||||
|
v.qtySalesM3 = Number(v.qtySalesM3)*10000
|
||||||
|
})
|
||||||
|
let obj = {
|
||||||
|
...data.formInfo,
|
||||||
|
qtyContractM3: Number(data.formInfo.qtyContractM3)*10000,
|
||||||
|
qtyPlanM3: Number(data.formInfo.qtyPlanM3)*10000,
|
||||||
|
qtyDemandM3: Number(data.formInfo.qtyDemandM3)*10000,
|
||||||
|
qtySalesM3: Number(data.formInfo.qtySalesM3)*10000,
|
||||||
|
lngPngApproPurList:arr
|
||||||
|
}
|
||||||
|
let params = {
|
||||||
|
result: type == 'agree' ? 'C' : 'R',
|
||||||
|
remark: formState.reply,
|
||||||
|
data: obj
|
||||||
|
}
|
||||||
|
spinning.value = true;
|
||||||
|
try {
|
||||||
|
if (type == 'reject') {
|
||||||
|
if (!formState.reply) {
|
||||||
|
message.warn('请输入批复意见')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await approveLngPngAppro(params);
|
||||||
|
spinning.value = false;
|
||||||
|
notification.success({
|
||||||
|
message: 'Tip',
|
||||||
|
description: type == 'agree' ? '审批通过':'已驳回'
|
||||||
|
}); //提示消息
|
||||||
|
setTimeout(() => {
|
||||||
|
bus.emit(FORM_LIST_MODIFIED, {});
|
||||||
|
close();
|
||||||
|
}, 500);
|
||||||
|
}catch (errorInfo) {
|
||||||
|
spinning.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.page-bg-wrap {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-toolbar {
|
||||||
|
min-height: 44px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
}
|
||||||
|
.dot {
|
||||||
|
margin-right: 10px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
i{
|
||||||
|
padding: 5px;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
span{
|
||||||
|
width: 10px !important;
|
||||||
|
height: 10px !important;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: red;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
295
src/views/dayPlan/Demand/components/workflowPermission.ts
Normal file
295
src/views/dayPlan/Demand/components/workflowPermission.ts
Normal file
@ -0,0 +1,295 @@
|
|||||||
|
export const permissionList = [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
view: true,
|
||||||
|
edit: true,
|
||||||
|
disabled: false,
|
||||||
|
isSaveTable: false,
|
||||||
|
tableName: '',
|
||||||
|
fieldName: 'id',
|
||||||
|
fieldId: 'id',
|
||||||
|
isSubTable: false,
|
||||||
|
showChildren: true,
|
||||||
|
type: 'input',
|
||||||
|
key: '507eb62c43774f02bf7ced2f940e3f80',
|
||||||
|
children: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
view: true,
|
||||||
|
edit: true,
|
||||||
|
disabled: false,
|
||||||
|
isSaveTable: false,
|
||||||
|
tableName: '',
|
||||||
|
fieldName: 'orgId',
|
||||||
|
fieldId: 'orgId',
|
||||||
|
isSubTable: false,
|
||||||
|
showChildren: true,
|
||||||
|
type: 'input',
|
||||||
|
key: '9b1a78bbef2e4f1d90631cbb6b91fbfb',
|
||||||
|
children: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
view: true,
|
||||||
|
edit: true,
|
||||||
|
disabled: false,
|
||||||
|
isSaveTable: false,
|
||||||
|
tableName: '',
|
||||||
|
fieldName: '版本号',
|
||||||
|
fieldId: 'verNo',
|
||||||
|
isSubTable: false,
|
||||||
|
showChildren: true,
|
||||||
|
type: 'input',
|
||||||
|
key: '9623c0b4246d42e4946ee8921534451a',
|
||||||
|
children: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
view: true,
|
||||||
|
edit: true,
|
||||||
|
disabled: false,
|
||||||
|
isSaveTable: false,
|
||||||
|
tableName: '',
|
||||||
|
fieldName: '计划日期',
|
||||||
|
fieldId: 'datePlan',
|
||||||
|
isSubTable: false,
|
||||||
|
showChildren: true,
|
||||||
|
type: 'input',
|
||||||
|
key: 'aa582ae47b85467386f9520d298308a1',
|
||||||
|
children: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
view: true,
|
||||||
|
edit: true,
|
||||||
|
disabled: false,
|
||||||
|
isSaveTable: false,
|
||||||
|
tableName: '',
|
||||||
|
fieldName: '下载点',
|
||||||
|
fieldId: 'pointDelyCode',
|
||||||
|
isSubTable: false,
|
||||||
|
showChildren: true,
|
||||||
|
type: 'input',
|
||||||
|
key: '215b645570b844c3a7c5da5ddb283b1b',
|
||||||
|
children: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
view: true,
|
||||||
|
edit: true,
|
||||||
|
disabled: false,
|
||||||
|
isSaveTable: false,
|
||||||
|
tableName: '',
|
||||||
|
fieldName: '指定量 (吉焦)',
|
||||||
|
fieldId: 'qtyDemandGj',
|
||||||
|
isSubTable: false,
|
||||||
|
showChildren: true,
|
||||||
|
type: 'input',
|
||||||
|
key: '30eaa4cefe5c4cbf91fae935ad28fda4',
|
||||||
|
children: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
view: true,
|
||||||
|
edit: true,
|
||||||
|
disabled: false,
|
||||||
|
isSaveTable: false,
|
||||||
|
tableName: '',
|
||||||
|
fieldName: '指定量 (万方)',
|
||||||
|
fieldId: 'qtyDemandM3',
|
||||||
|
isSubTable: false,
|
||||||
|
showChildren: true,
|
||||||
|
type: 'input',
|
||||||
|
key: '509628684d3c4c4badd25da8498cab71',
|
||||||
|
children: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
view: true,
|
||||||
|
edit: true,
|
||||||
|
disabled: false,
|
||||||
|
isSaveTable: false,
|
||||||
|
tableName: '',
|
||||||
|
fieldName: '批复量 (吉焦)',
|
||||||
|
fieldId: 'priceSalesGj',
|
||||||
|
isSubTable: false,
|
||||||
|
showChildren: true,
|
||||||
|
type: 'input',
|
||||||
|
key: '3d0487b5b7324aa8b81ad4f97987fa5c',
|
||||||
|
children: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
view: true,
|
||||||
|
edit: true,
|
||||||
|
disabled: false,
|
||||||
|
isSaveTable: false,
|
||||||
|
tableName: '',
|
||||||
|
fieldName: '批复量 (万方)',
|
||||||
|
fieldId: 'priceSalesM3',
|
||||||
|
isSubTable: false,
|
||||||
|
showChildren: true,
|
||||||
|
type: 'input',
|
||||||
|
key: '1087c1af09fa4465adcb09080062a4be',
|
||||||
|
children: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
view: true,
|
||||||
|
edit: true,
|
||||||
|
disabled: false,
|
||||||
|
isSaveTable: false,
|
||||||
|
tableName: '',
|
||||||
|
fieldName: '合同',
|
||||||
|
fieldId: 'ksId',
|
||||||
|
isSubTable: false,
|
||||||
|
showChildren: true,
|
||||||
|
type: 'input',
|
||||||
|
key: '3d67cfdee39f454c8a4c1a60a6fb4278',
|
||||||
|
children: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
view: true,
|
||||||
|
edit: true,
|
||||||
|
disabled: false,
|
||||||
|
isSaveTable: false,
|
||||||
|
tableName: '',
|
||||||
|
fieldName: '备注',
|
||||||
|
fieldId: 'note',
|
||||||
|
isSubTable: false,
|
||||||
|
showChildren: true,
|
||||||
|
type: 'input',
|
||||||
|
key: 'c20eeb953fbb4125871b3d214ac9e9cb',
|
||||||
|
children: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
view: true,
|
||||||
|
edit: true,
|
||||||
|
disabled: false,
|
||||||
|
isSaveTable: false,
|
||||||
|
tableName: '',
|
||||||
|
fieldName: '批复意见',
|
||||||
|
fieldId: 'reply',
|
||||||
|
isSubTable: false,
|
||||||
|
showChildren: true,
|
||||||
|
type: 'input',
|
||||||
|
key: 'baa1072f803542a78321c5ed9343cd71',
|
||||||
|
children: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
view: true,
|
||||||
|
edit: true,
|
||||||
|
disabled: false,
|
||||||
|
isSubTable: true,
|
||||||
|
showChildren: false,
|
||||||
|
tableName: 'lngPngDemandPurList',
|
||||||
|
fieldName: '表格组件',
|
||||||
|
fieldId: 'lngPngDemandPurList',
|
||||||
|
type: 'form',
|
||||||
|
key: 'de7d4ef3aa2749d49aa65ee6400e9c05',
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
view: true,
|
||||||
|
edit: true,
|
||||||
|
disabled: false,
|
||||||
|
isSubTable: true,
|
||||||
|
isSaveTable: false,
|
||||||
|
showChildren: false,
|
||||||
|
tableName: 'lngPngDemandPurList',
|
||||||
|
fieldName: '供应商',
|
||||||
|
fieldId: 'suCode',
|
||||||
|
key: 'cf499d1978bd41a9b56df297e78a1f5f',
|
||||||
|
children: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
view: true,
|
||||||
|
edit: true,
|
||||||
|
disabled: false,
|
||||||
|
isSubTable: true,
|
||||||
|
isSaveTable: false,
|
||||||
|
showChildren: false,
|
||||||
|
tableName: 'lngPngDemandPurList',
|
||||||
|
fieldName: '上载点',
|
||||||
|
fieldId: 'pointUpCode',
|
||||||
|
key: '67e93d9212c94609a514c4edaccc1b31',
|
||||||
|
children: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
view: true,
|
||||||
|
edit: true,
|
||||||
|
disabled: false,
|
||||||
|
isSubTable: true,
|
||||||
|
isSaveTable: false,
|
||||||
|
showChildren: false,
|
||||||
|
tableName: 'lngPngDemandPurList',
|
||||||
|
fieldName: '指定量 (吉焦)',
|
||||||
|
fieldId: 'qtyDemandGj',
|
||||||
|
key: '745dd4f8a280445e94e3104ae4f67324',
|
||||||
|
children: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
view: true,
|
||||||
|
edit: true,
|
||||||
|
disabled: false,
|
||||||
|
isSubTable: true,
|
||||||
|
isSaveTable: false,
|
||||||
|
showChildren: false,
|
||||||
|
tableName: 'lngPngDemandPurList',
|
||||||
|
fieldName: '指定量 (方)',
|
||||||
|
fieldId: 'qtyDemandM3',
|
||||||
|
key: 'e9ebeeded6844f58a36f9e4a795086a4',
|
||||||
|
children: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
view: true,
|
||||||
|
edit: true,
|
||||||
|
disabled: false,
|
||||||
|
isSubTable: true,
|
||||||
|
isSaveTable: false,
|
||||||
|
showChildren: false,
|
||||||
|
tableName: 'lngPngDemandPurList',
|
||||||
|
fieldName: '批复量 (吉焦)',
|
||||||
|
fieldId: 'qtySalesGj',
|
||||||
|
key: 'a6d9c9839a9142a3a0376d09c061b284',
|
||||||
|
children: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
view: true,
|
||||||
|
edit: true,
|
||||||
|
disabled: false,
|
||||||
|
isSubTable: true,
|
||||||
|
isSaveTable: false,
|
||||||
|
showChildren: false,
|
||||||
|
tableName: 'lngPngDemandPurList',
|
||||||
|
fieldName: '批复量 (方)',
|
||||||
|
fieldId: 'qtySalesM3',
|
||||||
|
key: '5eaffb7d44e64e9484c369d037873708',
|
||||||
|
children: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
view: true,
|
||||||
|
edit: true,
|
||||||
|
disabled: false,
|
||||||
|
isSubTable: true,
|
||||||
|
isSaveTable: false,
|
||||||
|
showChildren: false,
|
||||||
|
tableName: 'lngPngDemandPurList',
|
||||||
|
fieldName: '备注',
|
||||||
|
fieldId: 'note',
|
||||||
|
key: '4858ef81ff9148b7bd0deb7ded6ef196',
|
||||||
|
children: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
430
src/views/dayPlan/Demand/index.vue
Normal file
430
src/views/dayPlan/Demand/index.vue
Normal file
@ -0,0 +1,430 @@
|
|||||||
|
<template>
|
||||||
|
<PageWrapper dense fixedHeight contentFullHeight contentClass="flex">
|
||||||
|
<BasicTable @register="registerTable" ref="tableRef" @row-dbClick="dbClickRow">
|
||||||
|
|
||||||
|
<template #toolbar>
|
||||||
|
<template v-for="button in tableButtonConfig" :key="button.code">
|
||||||
|
<a-button v-if="button.isDefault" :type="button.type" @click="buttonClick(button.code)">
|
||||||
|
<template #icon><Icon :icon="button.icon" /></template>
|
||||||
|
{{ button.name }}
|
||||||
|
</a-button>
|
||||||
|
<a-button v-else :type="button.type">
|
||||||
|
<template #icon><Icon :icon="button.icon" /></template>
|
||||||
|
{{ button.name }}
|
||||||
|
</a-button>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.dataIndex === 'action'">
|
||||||
|
<TableAction :actions="getActions(record)" />
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</BasicTable>
|
||||||
|
<DemandModal @register="registerModal" @success="handleSuccess" />
|
||||||
|
<ImportModal @register="registerImportModal" importUrl="/dayPlan/demand/import" @success="handleImportSuccess"/>
|
||||||
|
|
||||||
|
<DataLog :logId="logId" :logPath="logPath" v-model:visible="modalVisible"/>
|
||||||
|
</PageWrapper>
|
||||||
|
</template>
|
||||||
|
<script lang="ts" setup>
|
||||||
|
const modalVisible = ref(false);
|
||||||
|
const logId = ref('')
|
||||||
|
const logPath = ref('/dayPlan/demand/datalog');
|
||||||
|
import { DataLog } from '/@/components/pcitc';
|
||||||
|
import { ref, computed, onMounted, onUnmounted, createVNode,
|
||||||
|
|
||||||
|
} from 'vue';
|
||||||
|
|
||||||
|
import { Modal } from 'ant-design-vue';
|
||||||
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||||
|
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
|
||||||
|
import { getLngPngDemandPage, deleteLngPngDemand, exportLngPngDemand} from '/@/api/dayPlan/Demand';
|
||||||
|
import { PageWrapper } from '/@/components/Page';
|
||||||
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
|
import { usePermission } from '/@/hooks/web/usePermission';
|
||||||
|
import { useFormConfig } from '/@/hooks/web/useFormConfig';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
import { setIndexFlowStatus } from '/@/utils/flow/index'
|
||||||
|
import { getLngPngDemand } from '/@/api/dayPlan/Demand';
|
||||||
|
import { useModal,BasicModal } from '/@/components/Modal';
|
||||||
|
import LookProcess from '/@/views/workflow/task/components/LookProcess.vue';
|
||||||
|
import LaunchProcess from '/@/views/workflow/task/components/LaunchProcess.vue';
|
||||||
|
import ApprovalProcess from '/@/views/workflow/task/components/ApprovalProcess.vue';
|
||||||
|
import { getDraftInfo } from '/@/api/workflow/process';
|
||||||
|
import { isValidJSON } from '/@/utils/event/design';
|
||||||
|
|
||||||
|
import DemandModal from './components/DemandModal.vue';
|
||||||
|
import { ImportModal } from '/@/components/Import';
|
||||||
|
import { downloadByData } from '/@/utils/file/download';
|
||||||
|
import {formConfig, searchFormSchema, columns } from './components/config';
|
||||||
|
import Icon from '/@/components/Icon/index';
|
||||||
|
import FlowRecord from '/@/views/workflow/task/components/flow/FlowRecord.vue';
|
||||||
|
|
||||||
|
import useEventBus from '/@/hooks/event/useEventBus';
|
||||||
|
import { cloneDeep } from 'lodash-es';
|
||||||
|
|
||||||
|
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
|
||||||
|
|
||||||
|
const { notification } = useMessage();
|
||||||
|
const { t } = useI18n();
|
||||||
|
defineEmits(['register']);
|
||||||
|
const { filterColumnAuth, filterButtonAuth } = usePermission();
|
||||||
|
const { mergeColumns,mergeSearchFormSchema,mergeButtons } = useFormConfig();
|
||||||
|
|
||||||
|
const filterColumns = cloneDeep(filterColumnAuth(columns));
|
||||||
|
const customConfigColums =ref(filterColumns);
|
||||||
|
const customSearchFormSchema =ref(searchFormSchema);
|
||||||
|
|
||||||
|
const tableRef = ref();
|
||||||
|
//所有按钮
|
||||||
|
const buttons = ref([{"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true},{"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true,"isUse":true},{"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"name":"数据日志","code":"datalog","icon":"ant-design:profile-outlined","isDefault":true,"isUse":true},{"name":"快速导入","code":"import","icon":"ant-design:import-outlined","isDefault":true,"isUse":true},{"name":"快速导出","code":"export","icon":"ant-design:export-outlined","isDefault":true,"isUse":true},{"name":"发起审批","code":"startwork","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"查看流转记录","code":"flowRecord","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true}]);
|
||||||
|
//展示在列表内的按钮
|
||||||
|
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord']);
|
||||||
|
const buttonConfigs = computed(()=>{
|
||||||
|
return filterButtonAuth(buttons.value);
|
||||||
|
})
|
||||||
|
|
||||||
|
const tableButtonConfig = computed(() => {
|
||||||
|
return buttonConfigs.value?.filter((x) => !actionButtons.value.includes(x.code));
|
||||||
|
});
|
||||||
|
|
||||||
|
const actionButtonConfig = computed(() => {
|
||||||
|
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
|
||||||
|
});
|
||||||
|
|
||||||
|
const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,datalog : handleDatalog,import : handleImport,export : handleExport,startwork : handleStartwork,flowRecord : handleFlowRecord,delete : handleDelete,}
|
||||||
|
|
||||||
|
const { currentRoute } = useRouter();
|
||||||
|
const router = useRouter();
|
||||||
|
const formIdComputedRef = ref();
|
||||||
|
formIdComputedRef.value = currentRoute.value.meta.formId
|
||||||
|
const schemaIdComputedRef = ref();
|
||||||
|
schemaIdComputedRef.value = currentRoute.value.meta.schemaId
|
||||||
|
const visibleLookProcessRef = ref(false);
|
||||||
|
const processIdRef = ref('');
|
||||||
|
|
||||||
|
const visibleLaunchProcessRef = ref(false);
|
||||||
|
const schemaIdRef = ref('');
|
||||||
|
const formDataRef = ref();
|
||||||
|
const rowKeyData = ref();
|
||||||
|
const draftsId = ref();
|
||||||
|
|
||||||
|
const visibleApproveProcessRef = ref(false);
|
||||||
|
const taskIdRef = ref('');
|
||||||
|
const visibleFlowRecordModal = ref(false);
|
||||||
|
const [registerModal, { openModal }] = useModal();
|
||||||
|
const [registerImportModal, { openModal: openImportModal }] = useModal();
|
||||||
|
|
||||||
|
const formName='日计划-客户需求';
|
||||||
|
const [registerTable, { reload, }] = useTable({
|
||||||
|
title: '' || (formName + '列表'),
|
||||||
|
api: getLngPngDemandPage,
|
||||||
|
rowKey: 'id',
|
||||||
|
columns: customConfigColums,
|
||||||
|
formConfig: {
|
||||||
|
rowProps: {
|
||||||
|
gutter: 16,
|
||||||
|
},
|
||||||
|
schemas: customSearchFormSchema,
|
||||||
|
fieldMapToTime: [],
|
||||||
|
showResetButton: false,
|
||||||
|
},
|
||||||
|
beforeFetch: (params) => {
|
||||||
|
return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
|
||||||
|
},
|
||||||
|
afterFetch: (res) => {
|
||||||
|
tableRef.value.setToolBarWidth();
|
||||||
|
|
||||||
|
},
|
||||||
|
useSearchForm: true,
|
||||||
|
showTableSetting: true,
|
||||||
|
|
||||||
|
striped: false,
|
||||||
|
actionColumn: {
|
||||||
|
width: 160,
|
||||||
|
title: '操作',
|
||||||
|
dataIndex: 'action',
|
||||||
|
slots: { customRender: 'action' },
|
||||||
|
},
|
||||||
|
tableSetting: {
|
||||||
|
size: false,
|
||||||
|
setting: false,
|
||||||
|
},
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
function dbClickRow(record) {
|
||||||
|
if (!actionButtonConfig?.value.some(element => element.code == 'view')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const { processId, taskIds, schemaId } = record.workflowData || {};
|
||||||
|
if (taskIds && taskIds.length) {
|
||||||
|
router.push({
|
||||||
|
path: '/flow/' + schemaId + '/' + (processId || '') + '/approveFlow',
|
||||||
|
query: {
|
||||||
|
taskId: taskIds[0],
|
||||||
|
formName: formName,
|
||||||
|
formId:currentRoute.value.meta.formId
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else if (schemaId && !taskIds && processId) {
|
||||||
|
router.push({
|
||||||
|
path: '/flow/' + schemaId + '/' + processId + '/approveFlow',
|
||||||
|
query: {
|
||||||
|
readonly: 1,
|
||||||
|
taskId: '',
|
||||||
|
formName: formName,
|
||||||
|
formId:currentRoute.value.meta.formId
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
router.push({
|
||||||
|
path: '/form/Demand/' + record.id + '/viewForm',
|
||||||
|
query: {
|
||||||
|
formPath: 'dayPlan/Demand',
|
||||||
|
formName: formName,
|
||||||
|
formId:currentRoute.value.meta.formId
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function buttonClick(code) {
|
||||||
|
|
||||||
|
btnEvent[code]();
|
||||||
|
}
|
||||||
|
function handleDatalog (record: Recordable) {
|
||||||
|
modalVisible.value = true
|
||||||
|
logId.value = record.id
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleAdd() {
|
||||||
|
if (schemaIdComputedRef.value) {
|
||||||
|
router.push({
|
||||||
|
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow'
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
router.push({
|
||||||
|
path: '/form/Demand/0/createForm',
|
||||||
|
query: {
|
||||||
|
formPath: 'dayPlan/Demand',
|
||||||
|
formName: formName,
|
||||||
|
formId:currentRoute.value.meta.formId
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleEdit(record: Recordable) {
|
||||||
|
|
||||||
|
router.push({
|
||||||
|
path: '/form/Demand/' + record.id + '/updateForm',
|
||||||
|
query: {
|
||||||
|
formPath: 'dayPlan/Demand',
|
||||||
|
formName: formName,
|
||||||
|
formId:currentRoute.value.meta.formId
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function handleDelete(record: Recordable) {
|
||||||
|
deleteList([record.id]);
|
||||||
|
}
|
||||||
|
function deleteList(ids) {
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示信息',
|
||||||
|
icon: createVNode(ExclamationCircleOutlined),
|
||||||
|
content: '是否确认删除?',
|
||||||
|
okText: '确认',
|
||||||
|
cancelText: '取消',
|
||||||
|
onOk() {
|
||||||
|
deleteLngPngDemand(ids).then((_) => {
|
||||||
|
handleSuccess();
|
||||||
|
notification.success({
|
||||||
|
message: 'Tip',
|
||||||
|
description: t('删除成功!'),
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onCancel() {},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function handleRefresh() {
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
function handleSuccess() {
|
||||||
|
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleView(record: Recordable) {
|
||||||
|
|
||||||
|
dbClickRow(record);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleExport() {
|
||||||
|
const res = await exportLngPngDemand({ isTemplate: false });
|
||||||
|
downloadByData(
|
||||||
|
res.data,
|
||||||
|
'Demand.xlsx',
|
||||||
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleImport() {
|
||||||
|
openImportModal(true, {
|
||||||
|
title: '快速导入',
|
||||||
|
downLoadUrl:'/dayPlan/demand/export',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function handleImportSuccess(){
|
||||||
|
reload()
|
||||||
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
|
||||||
|
if (schemaIdComputedRef.value) {
|
||||||
|
bus.on(FLOW_PROCESSED, handleRefresh);
|
||||||
|
bus.on(CREATE_FLOW, handleRefresh);
|
||||||
|
} else {
|
||||||
|
bus.on(FORM_LIST_MODIFIED, handleRefresh);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 合并渲染覆盖配置中的列表配置,包括展示字段配置、搜索字段配置、按钮配置
|
||||||
|
mergeCustomListRenderConfig();
|
||||||
|
});
|
||||||
|
onUnmounted(() => {
|
||||||
|
if (schemaIdComputedRef.value) {
|
||||||
|
bus.off(FLOW_PROCESSED, handleRefresh);
|
||||||
|
bus.off(CREATE_FLOW, handleRefresh);
|
||||||
|
} else {
|
||||||
|
bus.off(FORM_LIST_MODIFIED, handleRefresh);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
function getActions(record: Recordable):ActionItem[] {
|
||||||
|
|
||||||
|
let actionsList: ActionItem[] = [];
|
||||||
|
let editAndDelBtn: ActionItem[] = [];
|
||||||
|
let hasFlowRecord = false;
|
||||||
|
actionButtonConfig.value?.map((button) => {
|
||||||
|
if (['view', 'copyData'].includes(button.code)) {
|
||||||
|
actionsList.push({
|
||||||
|
icon: button?.icon,
|
||||||
|
tooltip: button?.name,
|
||||||
|
onClick: btnEvent[button.code].bind(null, record),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (['edit', 'delete'].includes(button.code)) {
|
||||||
|
editAndDelBtn.push({
|
||||||
|
icon: button?.icon,
|
||||||
|
tooltip: button?.name,
|
||||||
|
color: button.code === 'delete' ? 'error' : undefined,
|
||||||
|
onClick: btnEvent[button.code].bind(null, record),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (button.code === 'flowRecord') hasFlowRecord = true;
|
||||||
|
});
|
||||||
|
if (record.workflowData?.enabled) {
|
||||||
|
//与工作流有关联的表单
|
||||||
|
if (record.workflowData.status) {
|
||||||
|
actionsList.unshift(setIndexFlowStatus(record.workflowData))
|
||||||
|
} else {
|
||||||
|
actionsList = actionsList.concat(editAndDelBtn);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!record.workflowData?.processId) {
|
||||||
|
//与工作流没有关联的表单并且在当前页面新增的数据 如选择编辑、删除按钮则加上
|
||||||
|
actionsList = actionsList.concat(editAndDelBtn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return actionsList;
|
||||||
|
}
|
||||||
|
function handleStartwork(record: Recordable) {
|
||||||
|
const { processId, schemaId } = record.workflowData;
|
||||||
|
router.push({
|
||||||
|
path: '/flow/' + schemaId + '/' + (processId || '') + '/approveFlow',
|
||||||
|
query: {
|
||||||
|
readonly: 1,
|
||||||
|
taskId: '',
|
||||||
|
formName: formName
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function handleFlowRecord(record: Recordable) {
|
||||||
|
if (record.workflowData) {
|
||||||
|
visibleFlowRecordModal.value = true;
|
||||||
|
processIdRef.value = record.workflowData?.processId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleLaunchProcess(record: Recordable) {
|
||||||
|
const schemaId=record.workflowData?.schemaId||schemaIdComputedRef.value;
|
||||||
|
if(schemaId){
|
||||||
|
if(record.workflowData?.draftId){
|
||||||
|
let res = await getDraftInfo(record.workflowData.draftId);
|
||||||
|
if (isValidJSON(res.formData)) {
|
||||||
|
localStorage.setItem('draftsJsonStr', res.formData);
|
||||||
|
router.push({
|
||||||
|
path: '/flow/' + schemaId + '/'+record.workflowData.draftId+'/createFlow'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const result = await getLngPngDemand(record['id']);
|
||||||
|
const form={};
|
||||||
|
const key="form_"+schemaId+"_"+record['id'];
|
||||||
|
form[key]=result;
|
||||||
|
localStorage.setItem('formJsonStr', JSON.stringify(form));
|
||||||
|
router.push({
|
||||||
|
path: '/flow/' + schemaId + '/0/createFlow',
|
||||||
|
query: {
|
||||||
|
fromKey: key
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function handleApproveProcess(record: Recordable) {
|
||||||
|
const { processId, taskIds, schemaId } = record.workflowData;
|
||||||
|
router.push({
|
||||||
|
path: '/flow/' + schemaId + '/' + processId + '/approveFlow',
|
||||||
|
query: {
|
||||||
|
taskId: taskIds[0],
|
||||||
|
formName: formName
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function handleCloseLaunch() {
|
||||||
|
visibleLaunchProcessRef.value = false;
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
function handleCloseApproval() {
|
||||||
|
visibleApproveProcessRef.value = false;
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
async function mergeCustomListRenderConfig(){
|
||||||
|
if (formConfig.useCustomConfig) {
|
||||||
|
let formId=currentRoute.value.meta.formId;
|
||||||
|
//1.合并展示字段配置
|
||||||
|
let cols= await mergeColumns(customConfigColums.value,formId);
|
||||||
|
customConfigColums.value=cols;
|
||||||
|
//2.合并搜索字段配置
|
||||||
|
let sFormSchema= await mergeSearchFormSchema(customSearchFormSchema.value,formId);
|
||||||
|
customSearchFormSchema.value=sFormSchema;
|
||||||
|
//3.合并按钮配置
|
||||||
|
let btns= await mergeButtons(buttons.value,formId);
|
||||||
|
buttons.value=btns;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="less" scoped>
|
||||||
|
:deep(.ant-table-selection-col) {
|
||||||
|
width: 50px;
|
||||||
|
}
|
||||||
|
.show{
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.hide{
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -4,7 +4,7 @@
|
|||||||
<a-form-item label="计划日期" name="datePlan">{{ formState.datePlan }}</a-form-item>
|
<a-form-item label="计划日期" name="datePlan">{{ formState.datePlan }}</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-form-item label="当日/次日" name="kName">{{ formState.datePlan }}</a-form-item>
|
<a-form-item label="当日/次日" name="dayDesc">{{ formState.dayDesc }}</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-form-item label="合同" name="kName">{{ formState.kName}}</a-form-item>
|
<a-form-item label="合同" name="kName">{{ formState.kName}}</a-form-item>
|
||||||
@ -61,10 +61,12 @@
|
|||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item label="开机方式" name="" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
<a-form-item label="开机方式" name="" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||||
<span>连运</span>{{ formState.powerCont }}台
|
<div style="display: flex;">
|
||||||
<span>调峰</span>{{ formState.powerPeak }}台
|
<div class="dot"><span style="background:#04F21C"></span>连运<i>{{ formState.powerCont }}</i>台</div>
|
||||||
<span>停机</span>{{ formState.powerStop }}台
|
<div class="dot"><span style="background:#FFFF00"></span>调峰<i>{{ formState.powerCont }}</i>台</div>
|
||||||
<span>其他</span>{{ formState.powerOther }}台
|
<div class="dot"><span style="background:#D9001B"></span>停机<i>{{ formState.powerStop }}</i>台</div>
|
||||||
|
<div class="dot"><span style="background:#CA90FF"></span>其他<i>{{ formState.powerOther }}</i>台</div>
|
||||||
|
</div>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
@ -76,13 +78,13 @@
|
|||||||
<a-table style="width: 100%" :columns="columns" :data-source="dataList" :pagination="false" :scroll="{x: 1000}">
|
<a-table style="width: 100%" :columns="columns" :data-source="dataList" :pagination="false" :scroll="{x: 1000}">
|
||||||
<template #bodyCell="{ column, record, index }">
|
<template #bodyCell="{ column, record, index }">
|
||||||
<template v-if="column.dataIndex === 'qtySalesGj'">
|
<template v-if="column.dataIndex === 'qtySalesGj'">
|
||||||
<a-input-number v-model:value="record.qtySalesGj" :min="0" @change="numChange" style="width: 100%" />
|
<a-input-number v-model:value="record.qtySalesGj" :disabled="record.alterSign=='D' || disable" :min="0" @change="numChange" style="width: 100%" />
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'qtySalesM3'">
|
<template v-if="column.dataIndex === 'qtySalesM3'">
|
||||||
<a-input-number v-model:value="record.qtySalesM3" :min="0" @change="numChange" style="width: 100%" />
|
<a-input-number v-model:value="record.qtySalesM3" :disabled="record.alterSign=='D' || disable" :min="0" @change="numChange" style="width: 100%" />
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'note'">
|
<template v-if="column.dataIndex === 'note'">
|
||||||
<a-input v-model:value="record.note" style="width: 100%" />
|
<a-input v-model:value="record.note" :disabled="record.alterSign=='D' || disable" style="width: 100%" />
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</a-table>
|
</a-table>
|
||||||
@ -90,12 +92,14 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import { json } from 'stream/consumers';
|
||||||
import { useI18n } from '/@/hooks/web/useI18n';
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
import { ref, computed, onMounted, onBeforeMount, nextTick, defineAsyncComponent, reactive, defineComponent, watch} from 'vue';
|
import { ref, computed, onMounted, onBeforeMount, nextTick, defineAsyncComponent, reactive, defineComponent, watch} from 'vue';
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
disabled: false,
|
formObj: {},
|
||||||
id: ''
|
list: [],
|
||||||
|
disable: false
|
||||||
|
|
||||||
});
|
});
|
||||||
const columns= ref([
|
const columns= ref([
|
||||||
@ -109,42 +113,69 @@
|
|||||||
{ title: t('批复量(方)'), dataIndex: 'qtySalesM3', sorter: true, width: 200},
|
{ title: t('批复量(方)'), dataIndex: 'qtySalesM3', sorter: true, width: 200},
|
||||||
{ title: t('备注'), dataIndex: 'note', sorter: true, width: 200},
|
{ title: t('备注'), dataIndex: 'note', sorter: true, width: 200},
|
||||||
]);
|
]);
|
||||||
const formState = reactive({})
|
const formState = ref()
|
||||||
const dataList = ref([])
|
const dataList = ref([])
|
||||||
async function numChange () {
|
async function numChange () {
|
||||||
let num = 0;
|
let num = 0;
|
||||||
let num = 1;
|
let num1 = 0;
|
||||||
dataList.forEach(v => {
|
dataList.value.forEach(v => {
|
||||||
num+=(Number(v.qtySalesGj) || 0)
|
num+=(Number(v.qtySalesGj) || 0)
|
||||||
num1+=(Number(v.qtySalesM3) || 0)
|
num1+=(Number(v.qtySalesM3) || 0)
|
||||||
})
|
})
|
||||||
formState.qtySalesGj = num
|
formState.value.qtySalesGj = num
|
||||||
formState.qtySalesM3 = num1
|
formState.value.qtySalesM3 = num1
|
||||||
|
}
|
||||||
|
function getFormValue () {
|
||||||
|
let obj = {
|
||||||
|
formInfo: formState.value,
|
||||||
|
list: dataList.value
|
||||||
|
}
|
||||||
|
return obj
|
||||||
}
|
}
|
||||||
watch(
|
watch(
|
||||||
() => props.id,
|
() => props.formObj,
|
||||||
(val) => {
|
(val) => {
|
||||||
if (val) {
|
if (val) {
|
||||||
|
formState.value = val
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
immediate: true
|
immediate: true,
|
||||||
|
deep: true,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
watch(
|
watch(
|
||||||
() => props.disabled,
|
() => props.list,
|
||||||
(val) => {
|
(val) => {
|
||||||
|
dataList.value = val
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
immediate: true
|
immediate: true,
|
||||||
|
deep: true,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
defineExpose({
|
||||||
|
getFormValue
|
||||||
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
|
||||||
|
.dot {
|
||||||
|
margin-right: 10px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
i{
|
||||||
|
padding: 5px;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
span{
|
||||||
|
width: 10px !important;
|
||||||
|
height: 10px !important;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: red;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,104 +1,30 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-spin :spinning="spinning" tip="加载中...">
|
<a-spin :spinning="spinning" tip="加载中...">
|
||||||
<div class="page-bg-wrap formViewStyle pdcss">
|
<div class="page-bg-wrap formViewStyle pdcss">
|
||||||
|
<div class="top-toolbar" v-if="currentRoute.query.type!=='compare'">
|
||||||
|
<a-button style="margin-right: 10px" @click="close">
|
||||||
|
<slot name="icon"><close-outlined /></slot>关闭
|
||||||
|
</a-button>
|
||||||
|
<a-button style="margin-right: 10px" type="primary" @click="checkBtn('agree')" v-if="!currentRoute.query.type">
|
||||||
|
<slot name="icon"><check-circle-outlined /></slot>通过
|
||||||
|
</a-button>
|
||||||
|
<a-button style="margin-right: 10px" @click="checkBtn('reject')" v-if="!currentRoute.query.type">
|
||||||
|
<slot name="icon"><stop-outlined /></slot>驳回
|
||||||
|
</a-button>
|
||||||
|
</div>
|
||||||
<a-form ref="formRef" :model="formState" :rules="rules" v-bind="layout">
|
<a-form ref="formRef" :model="formState" :rules="rules" v-bind="layout">
|
||||||
<a-row>
|
<a-row v-if="currentRoute.query.type!=='compare'">
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item label="批复意见" name="reply" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
<a-form-item label="批复意见" name="reply" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||||
<a-textarea v-model:value="formState.reply" :disabled="isDisable" placeholder="请输入备注" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
<a-textarea v-model:value="formState.reply" :disabled="currentRoute.query.type=='view'" placeholder="请输入备注" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
<Card title="日计划审批" :bordered="false" >
|
<Card :title="title" :bordered="false" >
|
||||||
<a-row>
|
<basicForm ref="basicFormRef" :formObj="formState" :list="dataList" :disable="currentRoute.query.type"></basicForm>
|
||||||
<a-col :span="8">
|
</Card>
|
||||||
<a-form-item label="计划日期" name="datePlan">{{ formState.datePlan }}</a-form-item>
|
<Card :title="title" :bordered="false" v-if="currentRoute.query.type=='compare'">
|
||||||
</a-col>
|
<basicForm ref="basicFormRef" :formObj="formState" :list="dataList" :disable="currentRoute.query.type"></basicForm>
|
||||||
<a-col :span="8">
|
|
||||||
<a-form-item label="当日/次日" name="kName">{{ formState.datePlan }}</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="8">
|
|
||||||
<a-form-item label="合同" name="kName">{{ formState.kName}}</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="8">
|
|
||||||
<a-form-item label="合同量(吉焦)" name="qtyContractGj">{{ formState.qtyContractGj }}</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="8">
|
|
||||||
<a-form-item label="合同量(方)" name="qtyContractM3">{{ formState.qtyContractM3 }}</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="8">
|
|
||||||
<a-form-item label="月合同量执行进度%" name="rateK">{{ formState.rateK }}</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="8">
|
|
||||||
<a-form-item label="计划量(吉焦)" name="qtyPlanGj">{{ formState.qtyPlanGj }}</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="8">
|
|
||||||
<a-form-item label="计划量(方)" name="qtyPlanM3">{{ formState.qtyPlanM3 }}</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="8">
|
|
||||||
<a-form-item label="月计划量执行进度%" name="rateMp">{{ formState.rateMp }}</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="8">
|
|
||||||
<a-form-item label="指定量(吉焦)" name="qtyDemandGj">{{ formState.qtyDemandGj }}</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="8">
|
|
||||||
<a-form-item label="指定量(方)" name="qtyDemandM3">{{ formState.qtyDemandM3 }}</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="8">
|
|
||||||
<a-form-item label="月时间进度%" name="rateS">{{ formState.rateS }}</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="8">
|
|
||||||
<a-form-item label="批复量(吉焦)" name="qtySalesGj">{{ formState.qtySalesGj }}</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="8">
|
|
||||||
<a-form-item label="批复量(方)" name="qtySalesM3">{{ formState.qtySalesM3 }}</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="8">
|
|
||||||
<a-form-item label="比值(方/吉焦)" name="rateM3Gj">{{ formState.rateM3Gj }}</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="8">
|
|
||||||
<a-form-item label="交易主体" name="name">{{ formState.name }}</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="8">
|
|
||||||
<a-form-item label="版本号" name="verNo">{{ formState.verNo }}</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item label="下载点" name="fullName" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
|
||||||
{{ formState.fullName }}
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="8">
|
|
||||||
<a-form-item label="审批状态" name="approName">{{ formState.approName }}</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item label="开机方式" name="" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
|
||||||
<div style="display: flex;">
|
|
||||||
<div class="dot"><span></span>连运<i>{{ formState.powerCont }}</i>台</div>
|
|
||||||
<div class="dot"><span></span>调峰<i>{{ formState.powerCont }}</i>台</div>
|
|
||||||
<div class="dot"><span></span>停机<i>{{ formState.powerStop }}</i>台</div>
|
|
||||||
<div class="dot"><span></span>其他<i>{{ formState.powerOther }}</i>台</div>
|
|
||||||
</div>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item label="备注" name="note" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
|
||||||
{{ formState.note }}
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
<a-table style="width: 100%" :columns="columns" :data-source="dataList" :pagination="false" :scroll="{x: 1000}">
|
|
||||||
<template #bodyCell="{ column, record, index }">
|
|
||||||
<template v-if="column.dataIndex === 'qtySalesGj'">
|
|
||||||
<a-input-number v-model:value="record.qtySalesGj" :min="0" @change="numChange" style="width: 100%" />
|
|
||||||
</template>
|
|
||||||
<template v-if="column.dataIndex === 'qtySalesM3'">
|
|
||||||
<a-input-number v-model:value="record.qtySalesM3" :min="0" @change="numChange" style="width: 100%" />
|
|
||||||
</template>
|
|
||||||
<template v-if="column.dataIndex === 'note'">
|
|
||||||
<a-input v-model:value="record.note" style="width: 100%" />
|
|
||||||
</template>
|
|
||||||
</template>
|
|
||||||
</a-table>
|
|
||||||
</Card>
|
</Card>
|
||||||
</a-form>
|
</a-form>
|
||||||
</div>
|
</div>
|
||||||
@ -110,6 +36,7 @@
|
|||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { FromPageType, RecordType } from '/@/enums/workflowEnum';
|
import { FromPageType, RecordType } from '/@/enums/workflowEnum';
|
||||||
import { ref, computed, onMounted, onBeforeMount, nextTick, defineAsyncComponent, reactive, defineComponent, watch} from 'vue';
|
import { ref, computed, onMounted, onBeforeMount, nextTick, defineAsyncComponent, reactive, defineComponent, watch} from 'vue';
|
||||||
|
import { CheckCircleOutlined, StopOutlined, CloseOutlined, } from '@ant-design/icons-vue';
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
import { useI18n } from '/@/hooks/web/useI18n';
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
import { useMultipleTabStore } from '/@/store/modules/multipleTab';
|
import { useMultipleTabStore } from '/@/store/modules/multipleTab';
|
||||||
@ -117,18 +44,16 @@
|
|||||||
import type { Rule } from 'ant-design-vue/es/form';
|
import type { Rule } from 'ant-design-vue/es/form';
|
||||||
import { getDictionary } from '/@/api/sales/Customer';
|
import { getDictionary } from '/@/api/sales/Customer';
|
||||||
import { useModal } from '/@/components/Modal';
|
import { useModal } from '/@/components/Modal';
|
||||||
import { addLngPngAppro,updateLngPngAppro, getLngPngAppro } from '/@/api/dayPlan/PngAppro';
|
import { getLngPngAppro,approveLngPngAppro,getLngPngApproCompare } from '/@/api/dayPlan/PngAppro';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { getAppEnvConfig } from '/@/utils/env';
|
import { getAppEnvConfig } from '/@/utils/env';
|
||||||
import { message } from 'ant-design-vue';
|
import { message } from 'ant-design-vue';
|
||||||
import { useUserStore } from '/@/store/modules/user';
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
|
import basicForm from './basicForm.vue'
|
||||||
|
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const userInfo = userStore.getUserInfo;
|
const userInfo = userStore.getUserInfo;
|
||||||
|
|
||||||
const tableName = 'ContractSales';
|
|
||||||
const columnName = 'ContractSales'
|
|
||||||
|
|
||||||
const formType = ref('2'); // 0 新建 1 修改 2 查看
|
const formType = ref('2'); // 0 新建 1 修改 2 查看
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@ -162,54 +87,68 @@
|
|||||||
const [register, { openModal:openModal}] = useModal();
|
const [register, { openModal:openModal}] = useModal();
|
||||||
const rules= reactive({
|
const rules= reactive({
|
||||||
// kNo: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
// kNo: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
// kName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
|
||||||
});
|
});
|
||||||
const layout = {
|
const layout = {
|
||||||
labelCol: { span: 9 },
|
labelCol: { span: 9 },
|
||||||
wrapperCol: { span: 18 },
|
wrapperCol: { span: 18 },
|
||||||
}
|
}
|
||||||
const columns= ref([
|
const title = ref('日计划审批')
|
||||||
{ title: t('序号'), dataIndex: 'index', key: 'index', sorter: true, customRender: (column) => `${column.index + 1}` ,width: 100},
|
|
||||||
{ title: t('上载点'), dataIndex: 'pointUpName', sorter: true, width:200},
|
|
||||||
{ title: t('供应商'), dataIndex: 'suSname', sorter: true, width: 130},
|
|
||||||
{ title: t('采购合同'), dataIndex: 'kName', sorter: true, width: 200},
|
|
||||||
{ title: t('指定量(吉焦)'), dataIndex: 'qtyDemandGj', sorter: true, width: 300},
|
|
||||||
{ title: t('指定量(方)'), dataIndex: 'qtyDemandM3', sorter: true, width: 200},
|
|
||||||
{ title: t('批复量(吉焦)'), dataIndex: 'qtySalesGj', sorter: true, width: 200},
|
|
||||||
{ title: t('批复量(方)'), dataIndex: 'qtySalesM3', sorter: true, width: 200},
|
|
||||||
{ title: t('备注'), dataIndex: 'note', sorter: true, width: 200},
|
|
||||||
]);
|
|
||||||
const dataList = ref([])
|
const dataList = ref([])
|
||||||
|
const basicFormRef = ref()
|
||||||
let optionSelect= reactive({
|
let optionSelect= reactive({
|
||||||
approCodeList: [],
|
approCodeList: [],
|
||||||
});
|
});
|
||||||
watch(
|
|
||||||
() => props.id,
|
|
||||||
(val) => {
|
|
||||||
if (val) {
|
|
||||||
getInfo(val)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
immediate: true
|
|
||||||
}
|
|
||||||
);
|
|
||||||
watch(
|
|
||||||
() => props.disabled,
|
|
||||||
(val) => {
|
|
||||||
isDisable.value = val
|
|
||||||
},
|
|
||||||
{
|
|
||||||
immediate: true
|
|
||||||
}
|
|
||||||
);
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getOption()
|
getOption()
|
||||||
if (pageId.value) {
|
if (pageId.value) {
|
||||||
|
if (currentRoute.value.query.type=='compare') {
|
||||||
|
getCompareInfo(pageId.value)
|
||||||
|
return
|
||||||
|
}
|
||||||
getInfo(pageId.value)
|
getInfo(pageId.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
async function getCompareInfo(id) {
|
||||||
|
spinning.value = true
|
||||||
|
try {
|
||||||
|
let data = await getLngPngApproCompare(id)
|
||||||
|
spinning.value = false
|
||||||
|
Object.assign(formState, {...data})
|
||||||
|
Object.assign(dataList.value, formState.lngPngApproPurList || [{}])
|
||||||
|
const startDate = dayjs(formState.datePlan);
|
||||||
|
const endDate = dayjs(new Date());
|
||||||
|
const diffInDays = endDate.diff(startDate, 'day');
|
||||||
|
if (diffInDays == 0) {
|
||||||
|
formState.dayDesc = '当日'
|
||||||
|
} else if (diffInDays == 1) {
|
||||||
|
formState.dayDesc = '次日'
|
||||||
|
} else if (diffInDays > 1) {
|
||||||
|
formState.dayDesc = diffInDays + '日后'
|
||||||
|
} else {
|
||||||
|
formState.dayDesc = ''
|
||||||
|
}
|
||||||
|
formState.qtyContractM3 = Number(formState.qtyContractM3)/10000
|
||||||
|
formState.qtyPlanM3 = Number(formState.qtyPlanM3)/10000
|
||||||
|
formState.qtyDemandM3 = Number(formState.qtyDemandM3)/10000
|
||||||
|
formState.qtySalesM3 = Number(formState.qtySalesM3)/10000
|
||||||
|
let num = 0;
|
||||||
|
let num1 = 0;
|
||||||
|
dataList.value.forEach(v => {
|
||||||
|
v.qtyDemandM3 = Number(v.qtyDemandM3)/10000
|
||||||
|
v.qtySalesM3 = Number(v.qtySalesM3)/10000
|
||||||
|
num+=(Number(v.qtySalesGj) || 0)
|
||||||
|
num1+=(Number(v.qtySalesM3) || 0)
|
||||||
|
});
|
||||||
|
formState.qtySalesGj = num
|
||||||
|
formState.qtySalesM3 = num1
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error, 'error')
|
||||||
|
spinning.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
async function getInfo(id) {
|
async function getInfo(id) {
|
||||||
spinning.value = true
|
spinning.value = true
|
||||||
try {
|
try {
|
||||||
@ -217,26 +156,38 @@
|
|||||||
spinning.value = false
|
spinning.value = false
|
||||||
Object.assign(formState, {...data})
|
Object.assign(formState, {...data})
|
||||||
Object.assign(dataList.value, formState.lngPngApproPurList || [{}])
|
Object.assign(dataList.value, formState.lngPngApproPurList || [{}])
|
||||||
|
const startDate = dayjs(formState.datePlan);
|
||||||
|
const endDate = dayjs(new Date());
|
||||||
|
const diffInDays = endDate.diff(startDate, 'day');
|
||||||
|
if (diffInDays == 0) {
|
||||||
|
formState.dayDesc = '当日'
|
||||||
|
} else if (diffInDays == 1) {
|
||||||
|
formState.dayDesc = '次日'
|
||||||
|
} else if (diffInDays > 1) {
|
||||||
|
formState.dayDesc = diffInDays + '日后'
|
||||||
|
} else {
|
||||||
|
formState.dayDesc = ''
|
||||||
|
}
|
||||||
|
formState.qtyContractM3 = Number(formState.qtyContractM3)/10000
|
||||||
|
formState.qtyPlanM3 = Number(formState.qtyPlanM3)/10000
|
||||||
|
formState.qtyDemandM3 = Number(formState.qtyDemandM3)/10000
|
||||||
|
formState.qtySalesM3 = Number(formState.qtySalesM3)/10000
|
||||||
|
let num = 0;
|
||||||
|
let num1 = 0;
|
||||||
dataList.value.forEach(v => {
|
dataList.value.forEach(v => {
|
||||||
v.qtyM3Month = Number(v.qtyM3Month)/10000
|
v.qtyDemandM3 = Number(v.qtyDemandM3)/10000
|
||||||
v.qtyM3Day = Number(v.qtyM3Day)/10000
|
v.qtySalesM3 = Number(v.qtySalesM3)/10000
|
||||||
|
num+=(Number(v.qtySalesGj) || 0)
|
||||||
|
num1+=(Number(v.qtySalesM3) || 0)
|
||||||
});
|
});
|
||||||
|
formState.qtySalesGj = num
|
||||||
|
formState.qtySalesM3 = num1
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error, 'error')
|
console.log(error, 'error')
|
||||||
spinning.value = false
|
spinning.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
async function numChange () {
|
|
||||||
let num = 0;
|
|
||||||
let num1 = 1;
|
|
||||||
dataList.forEach(v => {
|
|
||||||
num+=(Number(v.qtySalesGj) || 0)
|
|
||||||
num1+=(Number(v.qtySalesM3) || 0)
|
|
||||||
})
|
|
||||||
formState.qtySalesGj = num
|
|
||||||
formState.qtySalesM3 = num1
|
|
||||||
}
|
|
||||||
async function getOption() {
|
async function getOption() {
|
||||||
optionSelect.approCodeList = await getDictionary('LNG_APPRO')
|
optionSelect.approCodeList = await getDictionary('LNG_APPRO')
|
||||||
|
|
||||||
@ -244,64 +195,53 @@
|
|||||||
function close() {
|
function close() {
|
||||||
tabStore.closeTab(currentRoute.value, router);
|
tabStore.closeTab(currentRoute.value, router);
|
||||||
}
|
}
|
||||||
async function getFormValue() {
|
async function checkBtn(type) {
|
||||||
return formState
|
let data = basicFormRef.value.getFormValue()
|
||||||
}
|
console.log(data, 'data')
|
||||||
async function handleSubmit(type) {
|
let arr = JSON.parse(JSON.stringify(data.list))
|
||||||
try {
|
arr.forEach(v=> {
|
||||||
await formRef.value.validateFields();
|
v.qtyDemandM3 = Number(v.qtyDemandM3)*10000
|
||||||
|
v.qtySalesM3 = Number(v.qtySalesM3)*10000
|
||||||
|
})
|
||||||
let obj = {
|
let obj = {
|
||||||
...formState,
|
...data.formInfo,
|
||||||
lngContractSalesPngPointList: dataListPoint.value,
|
qtyContractM3: Number(data.formInfo.qtyContractM3)*10000,
|
||||||
lngContractSalesPngQtyList: arr,
|
qtyPlanM3: Number(data.formInfo.qtyPlanM3)*10000,
|
||||||
lngFileUploadList: dataFile.value,
|
qtyDemandM3: Number(data.formInfo.qtyDemandM3)*10000,
|
||||||
lngContractFactRelList: dataListContractFact.value,
|
qtySalesM3: Number(data.formInfo.qtySalesM3)*10000,
|
||||||
lngContractApproRelList: dataListAppro.value,
|
lngPngApproPurList:arr
|
||||||
|
}
|
||||||
|
let params = {
|
||||||
|
result: type == 'agree' ? 'C' : 'R',
|
||||||
|
remark: formState.reply,
|
||||||
|
data: obj
|
||||||
}
|
}
|
||||||
spinning.value = true;
|
spinning.value = true;
|
||||||
let request = !formState.id ? addLngPngAppro :updateLngPngAppro
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const data = await request(obj);
|
if (type == 'reject') {
|
||||||
// 新增保存
|
if (!formState.reply) {
|
||||||
if (data?.id) {
|
message.warn('请输入批复意见')
|
||||||
getInfo(data?.id)
|
return
|
||||||
}
|
}
|
||||||
// 同意保存不提示
|
}
|
||||||
if (!type) {
|
await approveLngPngAppro(params);
|
||||||
|
spinning.value = false;
|
||||||
notification.success({
|
notification.success({
|
||||||
message: 'Tip',
|
message: 'Tip',
|
||||||
description: data?.id ? t('新增成功!') : t('修改成功!')
|
description: type == 'agree' ? '审批通过':'已驳回'
|
||||||
}); //提示消息
|
}); //提示消息
|
||||||
}
|
setTimeout(() => {
|
||||||
return data?.id ? data : obj
|
bus.emit(FORM_LIST_MODIFIED, {});
|
||||||
|
close();
|
||||||
} finally {
|
}, 500);
|
||||||
spinning.value = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}catch (errorInfo) {
|
}catch (errorInfo) {
|
||||||
spinning.value = false;
|
spinning.value = false;
|
||||||
errorInfo?.errorFields?.length && notification.warning({
|
|
||||||
message: 'Tip',
|
|
||||||
description: '请完善信息'
|
|
||||||
});
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({
|
|
||||||
handleSubmit,
|
|
||||||
getFormValue
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
:deep(.ant-form-item .ant-form-item-label) {
|
|
||||||
width: 135px !important;
|
|
||||||
max-width: 135px !important;
|
|
||||||
}
|
|
||||||
.page-bg-wrap {
|
.page-bg-wrap {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
@ -312,7 +252,7 @@
|
|||||||
border-bottom: 1px solid #eee;
|
border-bottom: 1px solid #eee;
|
||||||
}
|
}
|
||||||
.pdcss {
|
.pdcss {
|
||||||
padding: 6px 12px !important;
|
padding:0px 12px 6px 12px !important;
|
||||||
}
|
}
|
||||||
.dot {
|
.dot {
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.dataIndex === 'approName'">
|
<template v-if="column.dataIndex === 'approName'">
|
||||||
<a @click="btnCheck('approName')">{{ record.approName }}</a>
|
<a @click="btnCheck(record)">{{ record.approName }}</a>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.dataIndex === 'action'">
|
<template v-if="column.dataIndex === 'action'">
|
||||||
<TableAction :actions="getActions(record)" />
|
<TableAction :actions="getActions(record)" />
|
||||||
@ -94,6 +94,8 @@
|
|||||||
|
|
||||||
const { currentRoute } = useRouter();
|
const { currentRoute } = useRouter();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const path = currentRoute.value?.path
|
||||||
|
console.log(currentRoute, 'router55555555555555', path)
|
||||||
const formIdComputedRef = ref();
|
const formIdComputedRef = ref();
|
||||||
formIdComputedRef.value = currentRoute.value.meta.formId
|
formIdComputedRef.value = currentRoute.value.meta.formId
|
||||||
const schemaIdComputedRef = ref();
|
const schemaIdComputedRef = ref();
|
||||||
@ -113,7 +115,20 @@
|
|||||||
const [registerModal, { openModal}] = useModal();
|
const [registerModal, { openModal}] = useModal();
|
||||||
const [registerApproStatus, { openModal: openModalApproStatus}] = useModal();
|
const [registerApproStatus, { openModal: openModalApproStatus}] = useModal();
|
||||||
|
|
||||||
const formName='销售审批';
|
let formName='管道气销售审批';
|
||||||
|
let curPath = 'dayPlan/PngAppro/index'
|
||||||
|
if (path.includes('dayPlan/PngAppro/index')) {
|
||||||
|
formName='管道气销售审批'
|
||||||
|
curPath = 'dayPlan/PngAppro/index'
|
||||||
|
}
|
||||||
|
if (path.includes('dayPlan/pngPipeAppro/index')) {
|
||||||
|
formName='管道气管道审批'
|
||||||
|
curPath = 'dayPlan/pngPipeAppro'
|
||||||
|
}
|
||||||
|
if (path.includes('dayPlan/pngReceiveStationAppro/index')) {
|
||||||
|
formName='管道气接收站审批'
|
||||||
|
curPath = 'dayPlan/pngReceiveStationAppro'
|
||||||
|
}
|
||||||
const [registerTable, { reload, clearSelectedRowKeys, setTableData }] = useTable({
|
const [registerTable, { reload, clearSelectedRowKeys, setTableData }] = useTable({
|
||||||
title: '' || (formName + '列表'),
|
title: '' || (formName + '列表'),
|
||||||
api: getLngPngApproPage,
|
api: getLngPngApproPage,
|
||||||
@ -166,10 +181,8 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
});
|
});
|
||||||
const btnCheck = (type)=> {
|
const btnCheck = (record)=> {
|
||||||
if (type == 'approName') {
|
openModalApproStatus(true,{isUpdate: false,id:record.id});
|
||||||
openModalApproStatus(true,{isUpdate: false});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
function onSelectChange(rowKeys: string[]) {
|
function onSelectChange(rowKeys: string[]) {
|
||||||
selectedKeys.value = rowKeys;
|
selectedKeys.value = rowKeys;
|
||||||
@ -200,13 +213,23 @@
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
router.push({
|
router.push({
|
||||||
path: '/form/PngAppro/' + record.id + '/viewForm',
|
path: '/dayPlan/PngAppro/createForm',
|
||||||
query: {
|
query: {
|
||||||
formPath: 'dayPlan/PngAppro',
|
formPath: curPath,
|
||||||
formName: formName,
|
formName: formName,
|
||||||
formId:currentRoute.value.meta.formId
|
formId:currentRoute.value.meta.formId,
|
||||||
|
id: record.id,
|
||||||
|
type: 'view'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// router.push({
|
||||||
|
// path: '/form/PngAppro/' + record.id + '/viewForm',
|
||||||
|
// query: {
|
||||||
|
// formPath: 'dayPlan/PngAppro',
|
||||||
|
// formName: formName,
|
||||||
|
// formId:currentRoute.value.meta.formId
|
||||||
|
// }
|
||||||
|
// });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,7 +258,7 @@
|
|||||||
router.push({
|
router.push({
|
||||||
path: '/dayPlan/PngAppro/createForm',
|
path: '/dayPlan/PngAppro/createForm',
|
||||||
query: {
|
query: {
|
||||||
formPath: 'dayPlan/PngAppro',
|
formPath: curPath,
|
||||||
formName: formName,
|
formName: formName,
|
||||||
formId:currentRoute.value.meta.formId,
|
formId:currentRoute.value.meta.formId,
|
||||||
id: record.id
|
id: record.id
|
||||||
@ -243,7 +266,16 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
function handleCompare (record: Recordable) {
|
function handleCompare (record: Recordable) {
|
||||||
|
router.push({
|
||||||
|
path: '/dayPlan/PngAppro/createForm',
|
||||||
|
query: {
|
||||||
|
formPath: curPath,
|
||||||
|
formName: formName+'对比',
|
||||||
|
formId:currentRoute.value.meta.formId,
|
||||||
|
id: record.demandOrgId,
|
||||||
|
type: 'compare'
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
function handleBatchApprove () {
|
function handleBatchApprove () {
|
||||||
setTableData([{verNo: 5, cuCode: 444, approName: '未提交'}])
|
setTableData([{verNo: 5, cuCode: 444, approName: '未提交'}])
|
||||||
|
|||||||
232
src/views/dayPlan/PngMeasureSalesPur/components/createForm.vue
Normal file
232
src/views/dayPlan/PngMeasureSalesPur/components/createForm.vue
Normal file
@ -0,0 +1,232 @@
|
|||||||
|
<template>
|
||||||
|
<a-spin :spinning="spinning" tip="加载中...">
|
||||||
|
<div class="page-bg-wrap formViewStyle pdcss">
|
||||||
|
<div class="top-toolbar">
|
||||||
|
<a-button style="margin-right: 10px" @click="close">
|
||||||
|
<slot name="icon"><close-outlined /></slot>取消
|
||||||
|
</a-button>
|
||||||
|
<a-button style="margin-right: 10px" type="primary" @click="checkBtn">
|
||||||
|
<slot name="icon"><save-outlined /></slot>保存
|
||||||
|
</a-button>
|
||||||
|
</div>
|
||||||
|
<a-form ref="formRef" :model="formState" :rules="rules" v-bind="layout">
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="7">
|
||||||
|
<a-form-item label="计量日期" name="reply" >
|
||||||
|
<a-date-picker v-model:value="formState.datePlan" :disabled-date="disabledDateStart" style="width: 100%" placeholder="请选择计划日期" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="7">
|
||||||
|
<a-form-item label="客户名称/简称/编码" name="kName">
|
||||||
|
<a-input v-model:value="formState.kName" placeholder="请选择合同" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="7">
|
||||||
|
<a-form-item label="供应商名称/简称/编码" name="kName">
|
||||||
|
<a-input v-model:value="formState.kName" placeholder="请选择合同" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="3">
|
||||||
|
<a-button style="margin: 0 10px" type="primary" @click="onSearch">搜索</a-button>
|
||||||
|
<a-button @click="onReset">重置</a-button>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="7">
|
||||||
|
<a-form-item label="计划日期" name="reply" >
|
||||||
|
<a-date-picker v-model:value="formState.datePlan" :disabled-date="disabledDateStart" style="width: 100%" placeholder="请选择计划日期" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="7">
|
||||||
|
<a-form-item label="上载点" name="kName">
|
||||||
|
<a-input v-model:value="formState.kName" placeholder="请选择上载点" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="7">
|
||||||
|
<a-form-item label="下载点" name="kName">
|
||||||
|
<a-input v-model:value="formState.kName" placeholder="请选择下载点" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
|
||||||
|
</a-form>
|
||||||
|
<BasicTable @register="registerTable" class="contractFactListModal"></BasicTable>
|
||||||
|
</div>
|
||||||
|
</a-spin>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { Card } from 'ant-design-vue';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
import { FromPageType, RecordType } from '/@/enums/workflowEnum';
|
||||||
|
import { ref, computed, onMounted, onBeforeMount, nextTick, defineAsyncComponent, reactive, defineComponent, watch} from 'vue';
|
||||||
|
import { SaveOutlined, } from '@ant-design/icons-vue';
|
||||||
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
|
import { useMultipleTabStore } from '/@/store/modules/multipleTab';
|
||||||
|
import useEventBus from '/@/hooks/event/useEventBus';
|
||||||
|
import type { Rule } from 'ant-design-vue/es/form';
|
||||||
|
import { getDictionary } from '/@/api/sales/Customer';
|
||||||
|
import { useModal } from '/@/components/Modal';
|
||||||
|
import { getLngPngAppro,approveLngPngAppro,getLngPngApproCompare } from '/@/api/dayPlan/PngAppro';
|
||||||
|
import dayjs from 'dayjs';
|
||||||
|
import { getAppEnvConfig } from '/@/utils/env';
|
||||||
|
import { message } from 'ant-design-vue';
|
||||||
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
|
import { BasicTable, useTable, FormSchema, BasicColumn, TableAction } from '/@/components/Table';
|
||||||
|
import { getLngPngMeasureSalesPurPageAdd } from '/@/api/dayPlan/PngMeasureSalesPur';
|
||||||
|
import {formConfig, searchFormSchema, columns } from './config';
|
||||||
|
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const userInfo = userStore.getUserInfo;
|
||||||
|
|
||||||
|
const formType = ref('2'); // 0 新建 1 修改 2 查看
|
||||||
|
const formRef = ref();
|
||||||
|
const props = defineProps({
|
||||||
|
disabled: false,
|
||||||
|
id: ''
|
||||||
|
|
||||||
|
});
|
||||||
|
const { bus, FORM_LIST_MODIFIED } = useEventBus();
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
const { currentRoute } = router;
|
||||||
|
const isDisable = ref(false);
|
||||||
|
const { formPath } = currentRoute.value.query;
|
||||||
|
const pathArr = [];
|
||||||
|
|
||||||
|
const tabStore = useMultipleTabStore();
|
||||||
|
const formProps = ref(null);
|
||||||
|
const formId = ref(currentRoute.value?.params?.id);
|
||||||
|
const pageType = ref(currentRoute.value.query?.type);
|
||||||
|
const pageId = ref(currentRoute.value.query?.id)
|
||||||
|
|
||||||
|
const spinning = ref(false);
|
||||||
|
const { t } = useI18n();
|
||||||
|
const hasDel = ref(false)
|
||||||
|
const formState = reactive({
|
||||||
|
|
||||||
|
});
|
||||||
|
const [register, { openModal:openModal}] = useModal();
|
||||||
|
const rules= reactive({
|
||||||
|
// kNo: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||||
|
});
|
||||||
|
const layout = {
|
||||||
|
labelCol: { span: 9 },
|
||||||
|
wrapperCol: { span: 18 },
|
||||||
|
}
|
||||||
|
const basicFormRef = ref()
|
||||||
|
let optionSelect= reactive({
|
||||||
|
approCodeList: [],
|
||||||
|
});
|
||||||
|
onMounted(() => {
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
const emit = defineEmits(['success', 'register']);
|
||||||
|
|
||||||
|
const { notification } = useMessage();
|
||||||
|
const selectedKeys = ref<string[]>([]);
|
||||||
|
const selectedValues = ref([]);
|
||||||
|
|
||||||
|
const [registerTable, { reload }] = useTable({
|
||||||
|
title: t('管道气计量新增列表'),
|
||||||
|
api: getLngPngMeasureSalesPurPageAdd,
|
||||||
|
columns,
|
||||||
|
|
||||||
|
pagination: true,
|
||||||
|
canResize: false,
|
||||||
|
formConfig: {
|
||||||
|
labelCol:{span: 9},
|
||||||
|
schemas: [],
|
||||||
|
showResetButton: false,
|
||||||
|
showSubmitButton: false
|
||||||
|
},
|
||||||
|
immediate: true,
|
||||||
|
beforeFetch: (params) => {
|
||||||
|
return { ...params,...formState};
|
||||||
|
},
|
||||||
|
rowSelection: {
|
||||||
|
type: 'checkbox',
|
||||||
|
onChange: onSelectChange
|
||||||
|
},
|
||||||
|
});
|
||||||
|
function onSelectChange(rowKeys: string[], e) {
|
||||||
|
selectedKeys.value = rowKeys;
|
||||||
|
selectedValues.value = e
|
||||||
|
}
|
||||||
|
const onSearch = () => {
|
||||||
|
reload()
|
||||||
|
}
|
||||||
|
const onReset = () => {
|
||||||
|
formState = {
|
||||||
|
page: 1,
|
||||||
|
size: 10
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function close() {
|
||||||
|
tabStore.closeTab(currentRoute.value, router);
|
||||||
|
}
|
||||||
|
async function checkBtn(type) {
|
||||||
|
let data = basicFormRef.value.getFormValue()
|
||||||
|
console.log(data, 'data')
|
||||||
|
let arr = JSON.parse(JSON.stringify(data.list))
|
||||||
|
arr.forEach(v=> {
|
||||||
|
v.qtyDemandM3 = Number(v.qtyDemandM3)*10000
|
||||||
|
v.qtySalesM3 = Number(v.qtySalesM3)*10000
|
||||||
|
})
|
||||||
|
let obj = {
|
||||||
|
...data.formInfo,
|
||||||
|
qtyContractM3: Number(data.formInfo.qtyContractM3)*10000,
|
||||||
|
qtyPlanM3: Number(data.formInfo.qtyPlanM3)*10000,
|
||||||
|
qtyDemandM3: Number(data.formInfo.qtyDemandM3)*10000,
|
||||||
|
qtySalesM3: Number(data.formInfo.qtySalesM3)*10000,
|
||||||
|
lngPngApproPurList:arr
|
||||||
|
}
|
||||||
|
let params = {
|
||||||
|
result: type == 'agree' ? 'C' : 'R',
|
||||||
|
remark: formState.reply,
|
||||||
|
data: obj
|
||||||
|
}
|
||||||
|
spinning.value = true;
|
||||||
|
try {
|
||||||
|
if (type == 'reject') {
|
||||||
|
if (!formState.reply) {
|
||||||
|
message.warn('请输入批复意见')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await approveLngPngAppro(params);
|
||||||
|
spinning.value = false;
|
||||||
|
notification.success({
|
||||||
|
message: 'Tip',
|
||||||
|
description: type == 'agree' ? '审批通过':'已驳回'
|
||||||
|
}); //提示消息
|
||||||
|
setTimeout(() => {
|
||||||
|
bus.emit(FORM_LIST_MODIFIED, {});
|
||||||
|
close();
|
||||||
|
}, 500);
|
||||||
|
}catch (errorInfo) {
|
||||||
|
spinning.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.page-bg-wrap {
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-toolbar {
|
||||||
|
min-height: 44px;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
border-bottom: 1px solid #eee;
|
||||||
|
}
|
||||||
|
.pdcss {
|
||||||
|
padding:0px 12px 6px 12px !important;
|
||||||
|
}
|
||||||
|
:deep(.ant-table-title) {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
@ -90,7 +90,7 @@
|
|||||||
|
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
//所有按钮
|
//所有按钮
|
||||||
const buttons = ref([{"isUse":true,"name":"保存","code":"save","icon":"ant-design:save-outlined","isDefault":false},{"isUse":true,"name":"保存并确认","code":"submit","icon":"ant-design:check-outlined","isDefault":false},{"isUse":true,"name":"取消确认","code":"cancel","icon":"ant-design:rollback-outlined","isDefault":false},{"isUse":true,"name":"导出","code":"export","icon":"ant-design:export-outlined","isDefault":true},{"isUse":true,"name":"导入","code":"import","icon":"ant-design:import-outlined","isDefault":true},{"isUse":true,"name":"删除","code":"batchdelete","icon":"ant-design:delete-outlined","isDefault":true},{"isUse":true,"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true}]);
|
const buttons = ref([{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"type":"primary"},{"isUse":true,"name":"保存","code":"save","icon":"ant-design:save-outlined","isDefault":false},{"isUse":true,"name":"保存并确认","code":"submit","icon":"ant-design:check-outlined","isDefault":false},{"isUse":true,"name":"取消确认","code":"cancel","icon":"ant-design:rollback-outlined","isDefault":false},{"isUse":true,"name":"导出","code":"export","icon":"ant-design:export-outlined","isDefault":true},{"isUse":true,"name":"导入","code":"import","icon":"ant-design:import-outlined","isDefault":true},{"isUse":true,"name":"删除","code":"batchdelete","icon":"ant-design:delete-outlined","isDefault":true},{"isUse":true,"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true}]);
|
||||||
//展示在列表内的按钮
|
//展示在列表内的按钮
|
||||||
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord']);
|
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord']);
|
||||||
const buttonConfigs = computed(()=>{
|
const buttonConfigs = computed(()=>{
|
||||||
@ -105,7 +105,7 @@
|
|||||||
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
|
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
|
||||||
});
|
});
|
||||||
|
|
||||||
const btnEvent = {refresh : handleRefresh,batchdelete : handleBatchdelete,import : handleImport,export : handleExport,}
|
const btnEvent = {add : handleAdd, refresh : handleRefresh,batchdelete : handleBatchdelete,import : handleImport,export : handleExport,}
|
||||||
|
|
||||||
const { currentRoute } = useRouter();
|
const { currentRoute } = useRouter();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@ -199,6 +199,19 @@
|
|||||||
record.rateM3Gj = record.rateM3Gj.toFixed(6)
|
record.rateM3Gj = record.rateM3Gj.toFixed(6)
|
||||||
updateTableDataRecord(record.id, record)
|
updateTableDataRecord(record.id, record)
|
||||||
}
|
}
|
||||||
|
function handleAdd() {
|
||||||
|
|
||||||
|
router.push({
|
||||||
|
path: '/dayPlan/PngMeasureSalesPur/createForm',
|
||||||
|
query: {
|
||||||
|
formPath: 'dayPlan/PngMeasureSalesPur',
|
||||||
|
formName: formName,
|
||||||
|
formId:currentRoute.value.meta.formId,
|
||||||
|
type:'add'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
function dbClickRow(record) {
|
function dbClickRow(record) {
|
||||||
if (!actionButtonConfig?.value.some(element => element.code == 'view')) {
|
if (!actionButtonConfig?.value.some(element => element.code == 'view')) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -7,6 +7,7 @@ export const customFormConfig = {
|
|||||||
'addAppro',
|
'addAppro',
|
||||||
'contractFactApprove',
|
'contractFactApprove',
|
||||||
'addContractPurPng',
|
'addContractPurPng',
|
||||||
'addContractSales'
|
'addContractSales',
|
||||||
|
'addDemand'
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user