This commit is contained in:
2026-01-20 18:48:58 +08:00
20 changed files with 1335 additions and 475 deletions

View File

@ -5,15 +5,78 @@ import { ErrorMessageMode } from '/#/axios';
enum Api {
// Page = '/dayPlan/pngAppro/page',
Page = '/magic-api/dayPlan/pngApproXs/page',
PageJsz = '/magic-api/dayPlan/pngApproJsz/page',
PageGd = '/magic-api//dayPlan/pngApproGd/page',
List = '/dayPlan/pngAppro/list',
Info = '/dayPlan/pngAppro/info',
LngPngAppro = '/dayPlan/pngAppro',
approve = '/dayPlan/pngAppro/approveXS',
approveSZ = '/dayPlan/pngAppro/approveJSZ',
approveGD = '/dayPlan/pngAppro/approveGD',
records = '/magic-api/approve/records',
compare = '/dayPlan/pngAppro/compare'
}
/**
* @description: 审批LngPngAppro
*/
export async function approveLngPngApproSZ(lngPngAppro: Recordable, mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.approveSZ,
params: lngPngAppro,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 审批LngPngAppro
*/
export async function approveLngPngApproGD(lngPngAppro: Recordable, mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.approveGD,
params: lngPngAppro,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 查询LngPngAppro分页列表
*/
export async function getLngPngApproPageGd(params: LngPngApproPageParams, mode: ErrorMessageMode = 'modal') {
return defHttp.get<LngPngApproPageResult>(
{
url: Api.PageGd,
params,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 查询LngPngAppro分页列表
*/
export async function getLngPngApproPageJsz(params: LngPngApproPageParams, mode: ErrorMessageMode = 'modal') {
return defHttp.get<LngPngApproPageResult>(
{
url: Api.PageJsz,
params,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 获取LngPngAppro信息
*/

View File

@ -11,8 +11,37 @@ enum Api {
PageAdd = '/magic-api/dayPlan/dayPlanSelectList',
Export = '/dayPlan/pngMeasureSalesPur/export',
Cancel = '/dayPlan/pngMeasureSalesPur/cancel',
Reject = '/dayPlan/pngMeasureSalesPur/reject'
}
/**
* @description: 驳回LngPngMeasureSalesPur
*/
export async function rejectLngPngMeasureSalesPur(lngPngMeasureSalesPur: Recordable, mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.Reject,
params: lngPngMeasureSalesPur,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 取消LngPngMeasureSalesPur
*/
export async function cancelLngPngMeasureSalesPur(lngPngMeasureSalesPur: Recordable, mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.Cancel,
params: lngPngMeasureSalesPur,
},
{
errorMessageMode: mode,
},
);
}
/**
* @description: 查询LngPngMeasureSalesPur分页列表

View File

@ -1,6 +1,6 @@
<template>
<div>
<BasicModal v-bind="$attrs" @register="registerModal" width="60%" :title="getTitle" :showOkBtn="false" :showCancelBtn="false">
<BasicModal v-bind="$attrs" @register="registerModal" width="60%" :title="getTitle" :showOkBtn="false" :showCancelBtn="false" @visible-change="handleVisibleChange">
<BasicTable @register="registerTable"></BasicTable>
</BasicModal>
</div>
@ -16,10 +16,10 @@
const { t } = useI18n();
const columns: BasicColumn[] = [
{ dataIndex: 'suCode', title: '审批人', align: 'left', sorter: true },
{ dataIndex: 'suName', title: '审批时间', align: 'left', sorter: true },
{ dataIndex: 'suSname', title: '通过/驳回', align: 'left', sorter: true },
{ dataIndex: 'dI', title: '驳回原因', align: 'left', sorter: true },
{ dataIndex: 'userName', title: '审批人', align: 'left', sorter: true },
{ dataIndex: 'createDate', title: '审批时间', align: 'left', sorter: true },
{ dataIndex: 'cfmRej', title: '通过/驳回', align: 'left', sorter: true },
{ dataIndex: 'reply', title: '驳回原因', align: 'left', sorter: true },
];
const emit = defineEmits(['success', 'register']);
@ -33,7 +33,7 @@
id.value = data.id
});
const [registerTable, {}] = useTable({
const [registerTable, {reload}] = useTable({
title: t('审批状态'),
api: getLngPngApproRecords,
columns,
@ -51,11 +51,18 @@
canResize: false,
useSearchForm: false,
showTableSetting: false,
immediate: true, // 设置为不立即调用
immediate: false, // 设置为不立即调用
beforeFetch: (params) => {
return (id.value);
},
});
const handleVisibleChange = (visible: boolean) => {
if (visible) {
nextTick(() => {
reload();
});
}
};
const getTitle = computed(() => (!unref(isUpdate) ? t('审批状态') : t('')));
</script>
<style lang="less" scoped>

View File

@ -160,9 +160,7 @@
/>
</template>
</Popover>
<ModalPanel :visible="viewOpen" :width="800" :title="viewData.briefHead" @submit="handleViewClose" @close="handleViewClose">
<ViewModal v-if="viewOpen" :viewData="viewData" />
</ModalPanel>
<ViewModal @register="registerModal" />
</div>
</template>
<script lang="ts">
@ -181,11 +179,12 @@
import ApprovalProcess from '/@/views/workflow/task/components/ApprovalProcess.vue';
import LookProcess from '/@/views/workflow/task/components/LookProcess.vue';
import ViewModal from '/@/views/dataconfig/oaNews/components/View.vue';
import { ModalPanel } from '/@/components/ModalPanel/index';
import ViewModal from '/@/views/dataconfig/oaNews/components/viewModal.vue';
import { useI18n } from '/@/hooks/web/useI18n';
import { useRouter } from 'vue-router';
import { useModal } from '/@/components/Modal';
const { t } = useI18n();
export default defineComponent({
components: {
@ -197,9 +196,9 @@
ApprovalProcess,
LookProcess,
ViewModal,
ModalPanel
},
setup() {
const [registerModal, { openModal }] = useModal();
const router = useRouter();
const Approval = ref<{
taskId?: string;
@ -221,15 +220,13 @@
const listData = ref(tabListData);
const simpleImage = ref(Empty.PRESENTED_IMAGE_SIMPLE);
const viewOpen = ref(false);
const viewData = ref({});
function handleView(record) {
viewData.value = {...record};
viewOpen.value = true;
}
function handleViewClose() {
viewOpen.value = false;
openModal(true, {
isUpdate: true,
record
})
}
getDatas();
//停止循环获取通知
// times.value = setInterval(() => {
@ -445,10 +442,9 @@
LookData,
t,
goToRouter,
viewData,
viewOpen,
handleView,
handleViewClose
openModal,
registerModal
};
}
});

View File

@ -164,7 +164,7 @@
</a-col>
<a-col :span="8">
<a-form-item label="联系电话" name="tel">
<a-input-search v-model:value="formState.tel" :disabled="isDisable" placeholder="请输入电话" />
<a-input v-model:value="formState.tel" :disabled="isDisable" placeholder="请输入电话" />
</a-form-item>
</a-col>
<a-col :span="8">

View File

@ -0,0 +1,49 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" :title="getTitle" @cancel="handleClose" :paddingRight="15" :bodyStyle="{ minHeight: '400px !important' }">
<View :viewData="viewData" />
</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 { usePermission } from '/@/hooks/web/usePermission';
import { add, getInfo, edit } from '/@/api/system/oa';
import View from './View.vue'
import { formProps } from './newsConfig';
const emit = defineEmits(['success', 'register']);
const { notification } = useMessage();
const { filterFormSchemaAuth } = usePermission();
const formRef = ref();
const state = reactive({
formModel: {},
isUpdate: true,
isView: false,
isCopy: false,
rowId: ''
});
const viewData = ref({})
const { t } = useI18n();
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
state.isUpdate = !!data?.isUpdate;
state.isView = !!data?.isView;
viewData.value = data.record
setModalProps({
destroyOnClose: true,
maskClosable: false,
showCancelBtn: false,
showOkBtn: false,
canFullscreen: true,
width: 800
});
});
const getTitle = computed(() => (viewData.value.briefHead));
function handleClose() {
}
</script>

View File

@ -21,9 +21,10 @@
</BasicTable>
<NewsModal @register="registerModal" @success="handleSuccess" />
<ModalPanel :visible="viewOpen" :width="800" :title="viewData.briefHead" @submit="handleViewClose" @close="handleViewClose">
<ViewModal @register="registerModalView" />
<!-- <ModalPanel :visible="viewOpen" :width="800" :title="viewData.briefHead" @submit="handleViewClose" @close="handleViewClose">
<ViewModal v-if="viewOpen" :viewData="viewData" />
</ModalPanel>
</ModalPanel> -->
</PageWrapper>
</template>
<script lang="ts" setup>
@ -42,7 +43,8 @@
import { useModal } from '/@/components/Modal';
import NewsModal from './components/NewsModal.vue';
import ViewModal from './components/View.vue';
// import ViewModal from './components/View.vue';
import ViewModal from './components/viewModal.vue'
import { searchFormSchema, columns } from './components/newsConfig';
import Icon from '/@/components/Icon/index';
import { OaType } from '../../../enums/oa';
@ -115,6 +117,7 @@
const formIdComputedRef = computed(() => currentRoute.value.meta.formId as string);
const [registerModal, { openModal }] = useModal();
const [registerModalView, { openModal:openModalView }] = useModal();
const [registerTable, { reload }] = useTable({
title: '新闻列表',
@ -211,8 +214,12 @@
}
function handleView(record: Recordable) {
viewData.value = record;
viewOpen.value = true;
openModalView(true, {
isUpdate: true,
record
});
// viewData.value = record;
// viewOpen.value = true;
}
function handleViewClose() {
viewOpen.value = false;

View File

@ -19,11 +19,11 @@
</template>
</template>
</BasicTable>
<ViewModal @register="registerModalView" />
<NoticesModal @register="registerModal" @success="handleSuccess" />
<ModalPanel :visible="viewOpen" :width="800" :title="viewData.briefHead" @submit="handleViewClose" @close="handleViewClose">
<!-- <ModalPanel :visible="viewOpen" :width="800" :title="viewData.briefHead" @submit="handleViewClose" @close="handleViewClose">
<ViewModal v-if="viewOpen" :viewData="viewData" />
</ModalPanel>
</ModalPanel> -->
</PageWrapper>
</template>
<script lang="ts" setup>
@ -42,7 +42,8 @@
import { useModal } from '/@/components/Modal';
import NoticesModal from './components/NoticesModal.vue';
import ViewModal from './components/View.vue';
// import ViewModal from './components/View.vue';
import ViewModal from './components/viewModal.vue'
import { searchFormSchema, columns } from './components/noticesConfig';
import Icon from '/@/components/Icon/index';
import { OaType } from '../../../enums/oa';
@ -116,7 +117,7 @@
const formIdComputedRef = computed(() => currentRoute.value.meta.formId as string);
const [registerModal, { openModal }] = useModal();
const [registerModalView, { openModal:openModalView }] = useModal();
const [registerTable, { reload }] = useTable({
title: '通知公告列表',
api: getList,
@ -212,8 +213,12 @@
}
function handleView(record: Recordable) {
viewData.value = record;
viewOpen.value = true;
openModalView(true, {
isUpdate: true,
record
});
// viewData.value = record;
// viewOpen.value = true;
}
function handleViewClose() {
viewOpen.value = false;

View File

@ -6,65 +6,42 @@ export const formConfig = {
};
export const searchFormSchema: FormSchema[] = [
{
field: 'verNo',
label: '版本号',
component: 'Input',
},
{
field: 'datePlan',
label: '计划日期',
component: 'Input',
},
{
field: 'pointDelyCode',
field: 'pointDelyName',
label: '下载点',
component: 'Input',
},
{
field: 'qtyDemandGj',
label: '指定量 (吉焦)',
field: 'kName',
label: '销售合同名称/编码',
component: 'Input',
},
{
field: 'qtyDemandM3',
label: '指定量 (万方)',
component: 'Input',
field: 'approCode',
label: '审批状态',
component: 'XjrSelect',
componentProps: {
datasourceType: 'dic',
params: { itemId: '1990669393069129729' },
labelField: 'name',
valueField: 'value',
getPopupContainer: () => document.body,
},
},
{
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',
field: 'approCode',
label: '审批状态',
component: 'XjrSelect',
componentProps: {
datasourceType: 'dic',
params: { itemId: '1990669393069129729' },
labelField: 'name',
valueField: 'value',
getPopupContainer: () => document.body,
},
},
];

View File

@ -1,5 +1,5 @@
<template>
<PageWrapper dense fixedHeight contentFullHeight contentClass="flex">
<PageWrapper dense fixedHeight contentFullHeight contentClass="flex Demandtyle">
<BasicTable @register="registerTable" ref="tableRef" @row-dbClick="dbClickRow">
<template #toolbar>
@ -128,7 +128,7 @@
},
schemas: customSearchFormSchema,
fieldMapToTime: [],
showResetButton: false,
showResetButton: true,
},
beforeFetch: (params) => {
return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
@ -417,6 +417,11 @@
}
};
</script>
<style lang="less">
.Demandtyle .cusSearchForm .advanceRow> div:nth-of-type(3){
display: none;
}
</style>
<style lang="less" scoped>
:deep(.ant-table-selection-col) {
width: 50px;
@ -427,4 +432,15 @@
.hide{
display: none !important;
}
:deep( .ant-col-8:nth-child(2)) {
width: 360px !important;
max-width: 320px !important;;
}
:deep(.ant-col-8:nth-child(2) .ant-form-item-label) {
width: 160px !important;
}
:deep(.ant-col-8:nth-child(2) .ant-form-item-label .ant-form-item-no-colon) {
width: 160px !important;
max-width: 160px !important;
}
</style>

View File

@ -4,7 +4,7 @@
<a-form-item label="计划日期" name="datePlan">{{ formState.datePlan }}</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="当日/次日" name="dayDesc">{{ formState.dayDesc }}</a-form-item>
<a-form-item label="当日/次日" name="daysSign">{{ formState.daysSign }}</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="合同" name="kName">{{ formState.kName}}</a-form-item>
@ -46,14 +46,14 @@
<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-form-item label="交易主体" name="comName">{{ formState.comName }}</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 label="下载点" name="poinDelyName" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
{{ formState.pointDelyName }}
</a-form-item>
</a-col>
<a-col :span="8">
@ -75,7 +75,7 @@
</a-form-item>
</a-col>
</a-row>
<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: 100}">
<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%" />
@ -104,14 +104,14 @@ import { useI18n } from '/@/hooks/web/useI18n';
});
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: 'pointUpName', sorter: true, width:400},
{ title: t('供应商'), dataIndex: 'suName', sorter: true, width: 400},
{ title: t('采购合同'), dataIndex: 'kpName', sorter: true, width: 400},
{ 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},
{ title: t('备注'), dataIndex: 'note', sorter: true, width: 300},
]);
const formState = ref()
const dataList = ref([])

View File

@ -45,7 +45,7 @@ export const columns: BasicColumn[] = [
title: '版本号',
componentType: 'input',
align: 'left',
width: 80,
sorter: true,
},
@ -54,12 +54,12 @@ export const columns: BasicColumn[] = [
title: '计划日期',
componentType: 'input',
align: 'left',
width: 100,
sorter: true,
},
{
dataIndex: 'cuCode',
dataIndex: 'cuName',
title: '客户',
componentType: 'input',
align: 'left',
@ -68,7 +68,7 @@ export const columns: BasicColumn[] = [
},
{
dataIndex: 'demandId',
dataIndex: 'poinDelyName',
title: '下载点',
componentType: 'input',
align: 'left',
@ -140,7 +140,7 @@ export const columns: BasicColumn[] = [
},
{
dataIndex: 'lastVerSign',
dataIndex: 'kName',
title: '销售合同',
componentType: 'input',
align: 'left',
@ -149,7 +149,7 @@ export const columns: BasicColumn[] = [
},
{
dataIndex: 'alterSign',
dataIndex: 'alterName',
title: '变更',
componentType: 'input',
align: 'left',

View File

@ -1,19 +1,21 @@
<template>
<a-spin :spinning="spinning" tip="加载中...">
<div class="page-bg-wrap formViewStyle pdcss">
<div class="top-toolbar" v-if="currentRoute.query.type!=='compare'">
<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('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>
<template v-if="currentRoute.query.type!=='compare'">
<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>
</template>
</div>
<a-form ref="formRef" :model="formState" :rules="rules" v-bind="layout">
<a-row v-if="currentRoute.query.type!=='compare'">
<a-row v-if="!currentRoute.query.type">
<a-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="currentRoute.query.type=='view'" placeholder="请输入备注" :auto-size="{ minRows: 2, maxRows: 5 }"/>
@ -23,8 +25,8 @@
<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 :title="titleNew" :bordered="false" v-if="currentRoute.query.type=='compare'&&titleNew">
<basicForm ref="basicFormRef" :formObj="formStateNew" :list="dataListNew" :disable="currentRoute.query.type"></basicForm>
</Card>
</a-form>
</div>
@ -44,7 +46,7 @@
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 { getLngPngAppro,approveLngPngAppro,getLngPngApproCompare,approveLngPngApproSZ,approveLngPngApproGD } from '/@/api/dayPlan/PngAppro';
import dayjs from 'dayjs';
import { getAppEnvConfig } from '/@/utils/env';
import { message } from 'ant-design-vue';
@ -83,6 +85,9 @@
const hasDel = ref(false)
const formState = reactive({
});
const formStateNew = reactive({
});
const [register, { openModal:openModal}] = useModal();
const rules= reactive({
@ -93,7 +98,9 @@
wrapperCol: { span: 18 },
}
const title = ref('日计划审批')
const titleNew = ref('')
const dataList = ref([])
const dataListNew = ref([])
const basicFormRef = ref()
let optionSelect= reactive({
approCodeList: [],
@ -112,39 +119,27 @@
async function getCompareInfo(id) {
spinning.value = true
try {
let data = await getLngPngApproCompare(id)
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 = ''
if (data.length == 1) {
let obj = changeData(data[0])
Object.assign(formState, {...obj.params})
Object.assign(dataList.value, obj.list || [{}])
title.value = '版本V'+ formState.verNo
}
if (data.length > 1) {
let obj = changeData(data[0])
Object.assign(formState, {...obj.params})
Object.assign(dataList.value, obj.list || [{}])
title.value = '版本V'+ formState.verNo
let obj1 = changeData(data[1])
Object.assign(formStateNew, {...obj1.params})
Object.assign(dataListNew.value, obj1.list || [{}])
titleNew.value = '版本V'+ formStateNew.verNo
}
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
}
@ -154,40 +149,46 @@
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 = ''
let obj = changeData(data)
Object.assign(formState, {...obj.params})
Object.assign(dataList.value, obj.list || [{}])
} catch (error) {
spinning.value = false
}
formState.qtyContractM3 = Number(formState.qtyContractM3)/10000
formState.qtyPlanM3 = Number(formState.qtyPlanM3)/10000
formState.qtyDemandM3 = Number(formState.qtyDemandM3)/10000
formState.qtySalesM3 = Number(formState.qtySalesM3)/10000
}
const changeData = (obj) => {
let arr = obj.lngPngApproPurList || [{}]
// const startDate = dayjs(obj.datePlan);
// const endDate = dayjs(new Date());
// const diffInDays = endDate.diff(startDate, 'day');
// if (diffInDays == 0) {
// obj.dayDesc = '当日'
// } else if (diffInDays == 1) {
// obj.dayDesc = '次日'
// } else if (diffInDays > 1) {
// obj.dayDesc = diffInDays + '日后'
// } else {
// obj.dayDesc = ''
// }
obj.qtyContractM3 = Number(obj.qtyContractM3)/10000
obj.qtyPlanM3 = Number(obj.qtyPlanM3)/10000
obj.qtyDemandM3 = Number(obj.qtyDemandM3)/10000
obj.qtySalesM3 = Number(obj.qtySalesM3)/10000
let num = 0;
let num1 = 0;
dataList.value.forEach(v => {
arr.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
obj.qtySalesGj = num
obj.qtySalesM3 = num1
return {
list : arr,
params: obj
}
}
}
async function getOption() {
optionSelect.approCodeList = await getDictionary('LNG_APPRO')
@ -197,7 +198,6 @@
}
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
@ -214,7 +214,7 @@
let params = {
result: type == 'agree' ? 'C' : 'R',
remark: formState.reply,
data: obj
data: [obj]
}
spinning.value = true;
try {
@ -224,7 +224,17 @@
return
}
}
await approveLngPngAppro(params);
let request = ''
if (formPath.includes('dayPlan/PngAppro/index')) {
request = approveLngPngAppro
}
if (formPath.includes('dayPlan/pngPipeAppro/index')) {
request = approveLngPngApproGD
}
if (formPath.includes('dayPlan/pngReceiveStationAppro/index')) {
request = approveLngPngApproSZ
}
await request(params);
spinning.value = false;
notification.success({
message: 'Tip',

View File

@ -44,7 +44,8 @@
import { useFormConfig } from '/@/hooks/web/useFormConfig';
import { useRouter } from 'vue-router';
import { setIndexFlowStatus } from '/@/utils/flow/index'
import { getLngPngAppro } from '/@/api/dayPlan/PngAppro';
import { getLngPngAppro,getLngPngApproPageGd, getLngPngApproPageJsz, approveLngPngApproSZ, approveLngPngApproGD, approveLngPngAppro
} from '/@/api/dayPlan/PngAppro';
import { useModal,BasicModal } from '/@/components/Modal';
import LookProcess from '/@/views/workflow/task/components/LookProcess.vue';
import LaunchProcess from '/@/views/workflow/task/components/LaunchProcess.vue';
@ -95,7 +96,6 @@
const { currentRoute } = useRouter();
const router = useRouter();
const path = currentRoute.value?.path
console.log(currentRoute, 'router55555555555555', path)
const formIdComputedRef = ref();
formIdComputedRef.value = currentRoute.value.meta.formId
const schemaIdComputedRef = ref();
@ -108,7 +108,7 @@
const formDataRef = ref();
const rowKeyData = ref();
const draftsId = ref();
const selectedKeys = ref([])
const visibleApproveProcessRef = ref(false);
const taskIdRef = ref('');
const visibleFlowRecordModal = ref(false);
@ -117,21 +117,29 @@
let formName='管道气销售审批';
let curPath = 'dayPlan/PngAppro/index'
let request = ''
let requestApprove = ''
if (path.includes('dayPlan/PngAppro/index')) {
formName='管道气销售审批'
curPath = 'dayPlan/PngAppro/index'
request = getLngPngApproPage
requestApprove = approveLngPngAppro
}
if (path.includes('dayPlan/pngPipeAppro/index')) {
formName='管道气管道审批'
curPath = 'dayPlan/pngPipeAppro'
request = getLngPngApproPageGd
requestApprove = approveLngPngApproGD
}
if (path.includes('dayPlan/pngReceiveStationAppro/index')) {
formName='管道气接收站审批'
curPath = 'dayPlan/pngReceiveStationAppro'
request = getLngPngApproPageJsz
requestApprove = approveLngPngApproSZ
}
const [registerTable, { reload, clearSelectedRowKeys, setTableData }] = useTable({
title: '' || (formName + '列表'),
api: getLngPngApproPage,
api: request,
rowKey: 'id',
columns: customConfigColums,
formConfig: {
@ -182,7 +190,7 @@
});
const btnCheck = (record)=> {
openModalApproStatus(true,{isUpdate: false,id:record.id});
openModalApproStatus(true,{isUpdate: false,id:record.demandId});
}
function onSelectChange(rowKeys: string[]) {
selectedKeys.value = rowKeys;
@ -277,8 +285,32 @@
}
});
}
function handleBatchApprove () {
setTableData([{verNo: 5, cuCode: 444, approName: '未提交'}])
async function handleBatchApprove () {
if (!selectedKeys.value.length) {
notification.warning({
message: 'Tip',
description: t('请选择需要审批的数据'),
});
return;
}
let arr = selectedKeys.value.map(v=> {
return {
id: v
}
})
let obj = {
"result": "C",
"remark": "",
"data": arr
}
await requestApprove(obj)
handleSuccess();
notification.success({
message: 'Tip',
description: t('审批成功!'),
});
clearSelectedRowKeys()
}
onMounted(() => {

View File

@ -39,7 +39,8 @@ export const columns: BasicColumn[] = [
title: '计划日期',
componentType: 'input',
align: 'left',
width: 120,
ellipsis: true,
sorter: true,
},
@ -48,16 +49,34 @@ export const columns: BasicColumn[] = [
title: '计量日期',
componentType: 'input',
align: 'left',
width: 120,
sorter: true,
},
{
dataIndex: 'cuSname',
title: '供应商简称',
title: '客户',
componentType: 'input',
align: 'left',
ellipsis: true,
width: 200,
sorter: true,
},
{
dataIndex: 'pointDelyName',
title: '下载点',
componentType: 'input',
align: 'left',
ellipsis: true,
width: 200,
sorter: true,
},
{
dataIndex: 'suSname',
title: '供应商',
componentType: 'input',
align: 'left',
ellipsis: true,
width: 200,
sorter: true,
},
@ -66,16 +85,8 @@ export const columns: BasicColumn[] = [
title: '上载点',
componentType: 'input',
align: 'left',
sorter: true,
},
{
dataIndex: 'pointDelyName',
title: '下载点',
componentType: 'input',
align: 'left',
ellipsis: true,
width: 200,
sorter: true,
},
@ -129,7 +140,7 @@ export const columns: BasicColumn[] = [
title: '客户确认人',
componentType: 'input',
align: 'left',
width: 110,
sorter: true,
},
@ -138,7 +149,7 @@ export const columns: BasicColumn[] = [
title: '客户确认时间',
componentType: 'input',
align: 'left',
width: 150,
sorter: true,
},
@ -147,7 +158,7 @@ export const columns: BasicColumn[] = [
title: '内部确认人',
componentType: 'input',
align: 'left',
width: 110,
sorter: true,
},
@ -156,16 +167,25 @@ export const columns: BasicColumn[] = [
title: '内部确认时间',
componentType: 'input',
align: 'left',
width: 150,
sorter: true,
},
{
dataIndex: 'ksNmae',
title: '销售合同',
componentType: 'input',
align: 'left',
ellipsis: true,
width: 200,
sorter: true,
},
{
dataIndex: 'kpName',
title: '采购合同',
componentType: 'input',
align: 'left',
ellipsis: true,
width: 200,
sorter: true,
},
@ -174,7 +194,7 @@ export const columns: BasicColumn[] = [
title: '附件',
componentType: 'input',
align: 'left',
width: 200,
sorter: true,
},
@ -192,7 +212,8 @@ export const columns: BasicColumn[] = [
title: '备注',
componentType: 'input',
align: 'left',
ellipsis: true,
width: 200,
sorter: true,
},
];

View File

@ -9,128 +9,55 @@
<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>
<searchForm @search="onSearch" @reset="onReset" ></searchForm>
<BasicTable @register="registerTable"></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 { getLngPngMeasureSalesPurPageAdd, addLngPngMeasureSalesPur } from '/@/api/dayPlan/PngMeasureSalesPur';
import {formConfig, searchFormSchema, columns } from './config';
import searchForm from './searchForm.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 spinning = ref(false);
const { t } = useI18n();
const hasDel = ref(false)
const formState = reactive({
});
const formState = ref({});
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,
columns: columns,
pagination: true,
canResize: false,
@ -142,7 +69,7 @@
},
immediate: true,
beforeFetch: (params) => {
return { ...params,...formState};
return { ...params,...formState.value};
},
rowSelection: {
type: 'checkbox',
@ -153,54 +80,31 @@
selectedKeys.value = rowKeys;
selectedValues.value = e
}
const onSearch = () => {
const onSearch = (val) => {
formState.value = val
reload()
}
const onReset = () => {
formState = {
page: 1,
size: 10
}
formState.value ={ 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
async function checkBtn() {
if (!selectedValues.value.length) {
message.warn('请选择数据')
return
}
spinning.value = true;
try {
if (type == 'reject') {
if (!formState.reply) {
message.warn('请输入批复意见')
return
}
}
await approveLngPngAppro(params);
await addLngPngMeasureSalesPur(selectedValues.value);
spinning.value = false;
notification.success({
message: 'Tip',
description: type == 'agree' ? '审批通过':'已驳回'
}); //提示消息
description: '保存成功'
});
setTimeout(() => {
bus.emit(FORM_LIST_MODIFIED, {});
close();

View File

@ -0,0 +1,149 @@
<template>
<a-form ref="formRef" :model="formState" v-bind="layout">
<a-row>
<a-col :span="6">
<a-form-item label="计量日期" name="dateMea" >
<a-range-picker v-model:value="formState.dateMea" />
</a-form-item>
</a-col>
<a-col :span="7">
<a-form-item label="客户名称/简称/编码" name="cuSname">
<a-input v-model:value="formState.cuSname" placeholder="请输入客户名称/简称/编码" />
</a-form-item>
</a-col>
<a-col :span="7">
<a-form-item label="供应商名称/简称/编码" name="suSname">
<a-input v-model:value="formState.suSname" placeholder="请输入供应商名称/简称/编码" />
</a-form-item>
</a-col>
<a-col :span="4">
<div class="btnFoot">
<a-button style="margin: 0 10px" type="primary" @click="onSearch">搜索</a-button>
<a-button @click="onReset">重置</a-button>
<AButton type="link" size="small" @click="toggleAdvanced">
{{ isAdvanced ? t('收起') : t('展开') }}
<BasicArrow class="ml-1" :expand="!isAdvanced" up />
</AButton>
</div>
</a-col>
<a-col :span="6" v-if="isAdvanced">
<a-form-item label="计划日期" name="reply" >
<a-range-picker v-model:value="formState.datePlan" />
</a-form-item>
</a-col>
<a-col :span="7" v-if="isAdvanced">
<a-form-item label="上载点" name="pointUpName">
<a-input-search v-model:value="formState.pointUpName" readonly placeholder="请选择上载点" @search="onSearchDownLoad('up')" />
</a-form-item>
</a-col>
<a-col :span="7" v-if="isAdvanced">
<a-form-item label="下载点" name="pointDelyName">
<a-input-search v-model:value="formState.pointDelyName" readonly placeholder="请选择下载点" @search="onSearchDownLoad('dely')"/>
</a-form-item>
</a-col>
</a-row>
</a-form>
<downloadPointModal @register="register" @success="handleSuccessDownLoad" />
</template>
<script lang="ts" setup>
import { useRouter } from 'vue-router';
import { ref, computed, onMounted, onBeforeMount, nextTick, defineAsyncComponent, reactive, defineComponent, watch} from '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 { useModal } from '/@/components/Modal';
import dayjs from 'dayjs';
import { message } from 'ant-design-vue';
import { useUserStore } from '/@/store/modules/user';
import downloadPointModal from '/@/components/common/downloadPointModal.vue';
import { Button as AButton, ButtonProps } from '/@/components/Button';
import { BasicArrow } from '/@/components/Basic';
const userStore = useUserStore();
const { bus, FORM_LIST_MODIFIED } = useEventBus();
const router = useRouter();
const { currentRoute } = router;
const tabStore = useMultipleTabStore();
const spinning = ref(false);
const { t } = useI18n();
const formState = ref({});
const [register, { openModal:openModal}] = useModal();
const layout = {
labelCol: { span: 9 },
wrapperCol: { span: 15 },
}
const isAdvanced = ref(false)
onMounted(() => {
});
const emit = defineEmits(['search', 'reset', 'toggle']);
function toggleAdvanced() {
isAdvanced.value = !isAdvanced.value
emit('toggle', isAdvanced.value)
}
const onSearchDownLoad = (val)=> {
openModal(true,{isUpdate: false, type: val})
}
const handleSuccessDownLoad = (val, type)=> {
if (type === 'up') {
formState.value.pointUpName = val[0].fullName
formState.value.pointUpCode = val[0].code
} else {
formState.value.pointDelyName = val[0].fullName
formState.value.pointDelyCode = val[0].code
}
}
const onSearch = () => {
let obj = {
...formState.value,
startDate: formState.value.datePlan ? dayjs(formState.value.datePlan[0]).format('YYYY-MM-DD') : '',
endDate: formState.value.datePlan ? dayjs(formState.value.datePlan[1]).format('YYYY-MM-DD') : '',
dateMeaStart: formState.value.dateMea ? dayjs(formState.value.dateMea[0]).format('YYYY-MM-DD') : '',
dateMeaEnd: formState.value.dateMea ? dayjs(formState.value.dateMea[1]).format('YYYY-MM-DD') : '',
}
delete obj.datePlan
delete obj.dateMea
delete obj.pointUpName
delete obj.pointDelyName
emit('search', obj)
}
const onReset = () => {
formState.value ={ page: 1,size: 10}
emit('reset', formState.value)
}
</script>
<style lang="less" scoped>
.btnFoot {
display: flex;
align-items: center;
}
.ant-form-item {
margin-bottom: 8px !important;
}
:deep( .ant-col-6) {
width: 320px !important;
max-width: 320px !important;;
}
:deep(.ant-col-6 .ant-form-item-label) {
width: 70px !important;
max-width: 70px !important;
}
:deep(.ant-col-6 .ant-form-item-control) {
width: 240px !important;
max-width: 240px !important;
}
</style>

View File

@ -1,43 +1,49 @@
<template>
<div class="pd">
<div>
<template v-for="button in tableButtonConfig" :key="button.code" >
<a-button class="pr" v-if="button.isDefault" :type="button.type" @click="buttonClick(button.code)">
<template #icon><Icon :icon="button.icon" /></template>
{{ button.name }}
</a-button>
<a-button class="pr" v-else :type="button.type">
<template #icon><Icon :icon="button.icon" /></template>
{{ button.name }}
</a-button>
</template>
</div>
<div :class="isExpend ? 'formStyle' : ''">
<searchForm @toggle="toggle" @search="onSearch" @reset="onReset"></searchForm>
</div>
</div>
<PageWrapper dense fixedHeight contentFullHeight contentClass="flex" class="PngMeasureSalesPurStyle">
<BasicTable @register="registerTable" ref="tableRef" :row-selection="{ selectedRowKeys: selectedKeys, onChange: onSelectChange }" @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, index }">
<template v-if="column.dataIndex === 'qtyMeaGj'">
<a-input-number v-model:value="record.qtyMeaGj" v-if="statusCode==='N'|| statusCode==='JLZ'" @change="numChange(record)" :min="0" style="width: 100%" />
<div v-else>{{ record.qtyMeaGj }}</div>
</template>
<template v-if="column.dataIndex === 'qtyMeaM3'">
<a-input-number v-model:value="record.qtyMeaM3" v-if="statusCode==='N'|| statusCode==='JLZ'" @change="numChange(record)" :min="0" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'lngFileUploadList'">
<div>
<Upload :file-list="record.lngFileUploadList" :showUploadList="false" v-model:value="tableId" v-model:tableName="tableName" v-model:columnName="columnName"
:multiple="true" :dataDelete="true" :isShowTip="false" :isShowBtnIcon="false" @click="onUpload(index)" @change="uploadChange" :showDownloadIcon="false"/>
<div v-for="(item, idx) in record.lngFileUploadList">
<a @click="handleDownload(item)">{{item.fileOrg}}</a>
<span @click="deleteFile(record, idx)" class="delIcon"><DeleteOutlined /></span>
</div>
</div>
</template>
<template v-if="column.dataIndex === 'action'">
<TableAction :actions="getActions(record)" />
</template>
</template>
</BasicTable>
<a-table :loading="loading" :columns="columns" :data-source="tableData" :row-selection="{ selectedRowKeys: selectedKeys, onChange: onSelectChange }"
rowKey="id" :pagination="pagination" @row-dbClick="dbClickRow" :scroll="{x: 2000}">
<template #bodyCell="{ column, record, index }">
<template v-if="column.dataIndex === 'qtyMeaGj'">
<a-input-number v-model:value="record.qtyMeaGj" v-if="statusCode==='N'|| statusCode==='JLZ'" @change="numChange(record, index)" :min="0" style="width: 100%" />
<div v-else>{{ record.qtyMeaGj }}</div>
</template>
<template v-if="column.dataIndex === 'qtyMeaM3'">
<a-input-number v-model:value="record.qtyMeaM3" v-if="statusCode==='N'|| statusCode==='JLZ'" @change="numChange(record, index)" :min="0" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'lngFileUploadList'">
<div>
<Upload :file-list="record.lngFileUploadList" :showUploadList="false" v-model:value="tableId" v-model:tableName="tableName" v-model:columnName="columnName"
:multiple="true" :dataDelete="true" :isShowTip="false" :isShowBtnIcon="false" @click="onUpload(index)" @change="uploadChange" :showDownloadIcon="false"/>
<div v-for="(item, idx) in record.lngFileUploadList">
<a @click="handleDownload(item)">{{item.fileOrg}}</a>
<span @click="deleteFile(record, idx, index)" class="delIcon"><DeleteOutlined /></span>
</div>
</div>
</template>
<template v-if="column.dataIndex === 'action'">
<TableAction :actions="getActions(record)" />
</template>
</template>
</a-table>
<PngMeasureSalesPurModal @register="registerModal" @success="handleSuccess" />
<ImportModal @register="registerImportModal" importUrl="/dayPlan/pngMeasureSalesPur/import" @success="handleImportSuccess"/>
@ -54,7 +60,9 @@
import { Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
import { getLngPngMeasureSalesPurPage, deleteLngPngMeasureSalesPur, exportLngPngMeasureSalesPur} from '/@/api/dayPlan/PngMeasureSalesPur';
import { getLngPngMeasureSalesPurPage, deleteLngPngMeasureSalesPur, exportLngPngMeasureSalesPur, addLngPngMeasureSalesPur, updateLngPngMeasureSalesPur,
cancelLngPngMeasureSalesPur, rejectLngPngMeasureSalesPur
} from '/@/api/dayPlan/PngMeasureSalesPur';
import { PageWrapper } from '/@/components/Page';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
@ -62,7 +70,6 @@
import { useFormConfig } from '/@/hooks/web/useFormConfig';
import { useRouter } from 'vue-router';
import { setIndexFlowStatus } from '/@/utils/flow/index'
import { getLngPngMeasureSalesPur } from '/@/api/dayPlan/PngMeasureSalesPur';
import { useModal } from '/@/components/Modal';
import PngMeasureSalesPurModal from './components/PngMeasureSalesPurModal.vue';
import { ImportModal } from '/@/components/Import';
@ -75,6 +82,8 @@
import { parseDownloadUrl} from '/@/api/system/file';
import { downloadByUrl } from '/@/utils/file/download';
import { DeleteOutlined } from '@ant-design/icons-vue';
import searchForm from './components/searchForm.vue'
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
@ -89,8 +98,31 @@
const customSearchFormSchema =ref(searchFormSchema);
const tableRef = ref();
const tableData = ref([])
const total = ref(0);
const currentPage = ref(1);
const pageSize = ref(10);
const loading = ref(false)
// 分页配置
const pagination = computed(() => ({
total: total.value,
current: currentPage.value,
pageSize: pageSize.value,
showQuickJumper: true,
showSizeChanger: true,
showTotal: (total: number) => `${total}条数据`,
pageSizeOptions: ["10", "20", "50", "80", "100"],
onShowSizeChange: (current, pageSize) => {
pageSize.value = pageSize;
loadData()
},
onChange: (current, size) => {
pageSize.value = size;
loadData()
},
}));
//所有按钮
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 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":true},{"isUse":true,"name":"保存并确认","code":"submit","icon":"ant-design:check-outlined","isDefault":true},{"isUse":true,"name":"取消确认","code":"cancel","icon":"ant-design:rollback-outlined","isDefault":true},{"isUse":true,"name":"驳回","code":"reject","icon":"ant-design:stop-outlined","isDefault":true},{"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 buttonConfigs = computed(()=>{
@ -105,7 +137,8 @@
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
});
const btnEvent = {add : handleAdd, refresh : handleRefresh,batchdelete : handleBatchdelete,import : handleImport,export : handleExport,}
const btnEvent = {add : handleAdd, refresh : handleRefresh,batchdelete : handleBatchdelete,import : handleImport,export : handleExport,
save: handleSave, submit: handleSubmit, cancel: handleCancel, reject: handleReject}
const { currentRoute } = useRouter();
const router = useRouter();
@ -124,80 +157,56 @@
const columnName = 'PngMeasureSalesPur';
const formName='管道气采购计量';
const [registerTable, { reload, clearSelectedRowKeys, getDataSource, updateTableDataRecord }] = useTable({
title: '' || (formName + '列表'),
api: getLngPngMeasureSalesPurPage,
rowKey: 'id',
columns: customConfigColums,
formConfig: {
rowProps: {
gutter: 16,
},
schemas: customSearchFormSchema,
submitButtonOptions: {
text: '搜索',
onClick: () => {
clearSelectedRowKeys()
},
},
resetButtonOptions: {
text: '重置',
onClick: () => {
clearSelectedRowKeys()
},
},
fieldMapToTime: [['datePlan', ['startDate', 'endDate'], 'YYYY-MM-DD HH:mm:ss ', true]],
showResetButton: true,
},
beforeFetch: (params) => {
return { ...params, FormId: formIdComputedRef.value, PK: 'id',page: params.limit};
},
afterFetch: (res) => {
tableRef.value.setToolBarWidth();
},
useSearchForm: true,
showTableSetting: true,
striped: false,
// actionColumn: {
// width: 160,
// title: '操作',
// dataIndex: 'action',
// slots: { customRender: 'action' },
// },
rowSelection: {
type: 'checkbox',
onChange: onSelectChange
},
tableSetting: {
size: false,
setting: false,
},
customRow,
});
const loadData = async () => {
loading.value = true;
try {
const res = await getLngPngMeasureSalesPurPage({
limit: currentPage.value,
size: pageSize.value,
page: currentPage.value,
...formState.value,
});
tableData.value = res.list;
total.value = res.total || res.length || 0;
} catch (error) {
console.error('获取列表失败:', error);
} finally {
loading.value = false;
}
};
const isExpend = ref(false)
const formState = ref({})
const toggle = (val)=> {
isExpend.value = val
}
const onSearch = (val)=> {
formState.value = val
handleSuccess()
}
const onReset = (val)=> {
formState.value ={ page: 1,size: 10}
handleSuccess()
}
const onUpload = (index) => {
curIdx.value = index
}
const uploadChange = (val) => {
let data = getDataSource()
let record = data[curIdx.value]
record.lngFileUploadList = val
updateTableDataRecord(record.id, record)
tableData.value[curIdx.value].lngFileUploadList = val
}
const deleteFile = (record, idx) => {
const deleteFile = (record, idx, index) => {
record.lngFileUploadList.splice(idx, 1)
updateTableDataRecord(record.id, record)
tableData.value[index] = record
}
const handleDownload = (info) => {
const url = parseDownloadUrl(info.response ? info.response.data.fileUrl : info.fileUrl);
const fileName = info.response ? info.response.data.fileOrg : info.fileOrg;
downloadByUrl({ url, fileName: fileName});
};
const numChange = (record) => {
const numChange = (record, index) => {
record.rateM3Gj = Number(record.qtyMeaGj) ? (Number(record.qtyMeaM3) || 0 ) / Number(record.qtyMeaGj) : '0'
record.rateM3Gj = record.rateM3Gj.toFixed(6)
updateTableDataRecord(record.id, record)
tableData.value[index] = record
}
function handleAdd() {
@ -211,6 +220,68 @@
}
});
}
async function handleReject() {
if (!selectedRowsData.value.length) {
notification.warning({
message: 'Tip',
description: t('请选择需要驳回的数据'),
});
return;
}
await rejectLngPngMeasureSalesPur(selectedRowsData.value)
handleSuccess();
notification.success({
message: 'Tip',
description: t('已驳回!'),
});
}
async function handleCancel() {
if (!selectedRowsData.value.length) {
notification.warning({
message: 'Tip',
description: t('请选择需要取消的数据'),
});
return;
}
await cancelLngPngMeasureSalesPur(selectedRowsData.value)
handleSuccess();
notification.success({
message: 'Tip',
description: t('取消成功!'),
});
}
async function handleSubmit() {
if (!selectedRowsData.value.length) {
notification.warning({
message: 'Tip',
description: t('请选择需要确认的数据'),
});
return;
}
await updateLngPngMeasureSalesPur(selectedRowsData.value)
handleSuccess();
notification.success({
message: 'Tip',
description: t('确认成功!'),
});
}
async function handleSave() {
if (!selectedRowsData.value.length) {
notification.warning({
message: 'Tip',
description: t('请选择需要保存的数据'),
});
return;
}
await addLngPngMeasureSalesPur(selectedRowsData.value)
handleSuccess();
notification.success({
message: 'Tip',
description: t('保存成功!'),
});
}
function dbClickRow(record) {
if (!actionButtonConfig?.value.some(element => element.code == 'view')) {
@ -249,7 +320,6 @@
}
function buttonClick(code) {
btnEvent[code]();
}
function handleDatalog (record: Recordable) {
@ -304,28 +374,13 @@
selectedRowsData.value = selectedRows;
}
function customRow(record: Recordable) {
return {
onClick: () => {
let selectedRowKeys = [...selectedKeys.value];
if (selectedRowKeys.indexOf(record.id) >= 0) {
let index = selectedRowKeys.indexOf(record.id);
selectedRowKeys.splice(index, 1);
} else {
selectedRowKeys.push(record.id);
}
selectedKeys.value = selectedRowKeys;
},
};
}
function handleRefresh() {
reload();
loadData();
}
function handleSuccess() {
selectedKeys.value = [];
selectedRowsData.value = [];
reload();
selectedKeys.value = [];
selectedRowsData.value = [];
loadData();
}
async function handleExport() {
const res = await exportLngPngMeasureSalesPur({ isTemplate: false });
@ -343,7 +398,7 @@
});
}
function handleImportSuccess(){
reload()
loadData()
}
onMounted(() => {
@ -353,9 +408,8 @@
} else {
bus.on(FORM_LIST_MODIFIED, handleRefresh);
}
// 合并渲染覆盖配置中的列表配置,包括展示字段配置、搜索字段配置、按钮配置
mergeCustomListRenderConfig();
loadData()
});
onUnmounted(() => {
if (schemaIdComputedRef.value) {
@ -389,20 +443,8 @@
});
return actionsList;
}
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">
.PngMeasureSalesPurStyle .cusSearchForm .advanceRow> div:nth-of-type(3){
@ -419,24 +461,6 @@
:deep(.ant-table-selection-col) {
width: 50px;
}
:deep( .ant-col-8:nth-child(1)) {
width: 320px !important;
max-width: 320px !important;;
}
:deep(.ant-col-8:nth-child(1) .ant-form-item-label) {
width: 80px !important;
}
:deep( .ant-col-8:nth-child(2)) {
width: 360px !important;
max-width: 320px !important;;
}
:deep(.ant-col-8:nth-child(2) .ant-form-item-label) {
width: 160px !important;
}
:deep(.ant-col-8:nth-child(2) .ant-form-item-label .ant-form-item-no-colon) {
width: 160px !important;
max-width: 160px !important;
}
.show{
display: flex;
}
@ -448,4 +472,33 @@
cursor: pointer;
margin-bottom: 5px;
}
.pd {
padding: 6px 4px 0px 8px;
position: relative;
}
.pr {
margin-right: 4px;
margin-bottom: 8px;
}
.pr:nth-child(1) {
margin-left: 4px;
}
.formStyle {
position: absolute;
max-height: 400px;
z-index: 6;
background: #fff;
border: 1px solid rgba(204, 204, 204, 0.47);
box-shadow: 1px 2px 10px #ccc;
top: 0;
left: 0;
right: 0;
padding: 12px 0 8px 15px;
align-items: self-start !important;
justify-content: space-between;
margin: 2px 4px 12px 8px;
}
:deep(.ant-table-title) {
display: none !important;
}
</style>

View File

@ -0,0 +1,540 @@
<template>
<div class="pd">
<div>
<template v-for="button in tableButtonConfig" :key="button.code" >
<a-button class="pr" v-if="button.isDefault" :type="button.type" @click="buttonClick(button.code)">
<template #icon><Icon :icon="button.icon" /></template>
{{ button.name }}
</a-button>
<a-button class="pr" v-else :type="button.type">
<template #icon><Icon :icon="button.icon" /></template>
{{ button.name }}
</a-button>
</template>
</div>
<div :class="isExpend ? 'formStyle' : ''">
<searchForm @toggle="toggle" @search="onSearch" @reset="onReset"></searchForm>
</div>
</div>
<PageWrapper dense fixedHeight contentFullHeight contentClass="flex" class="PngMeasureSalesPurStyle">
<BasicTable @register="registerTable" ref="tableRef" :row-selection="{ selectedRowKeys: selectedKeys, onChange: onSelectChange }" @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, index }">
<template v-if="column.dataIndex === 'qtyMeaGj'">
<a-input-number v-model:value="record.qtyMeaGj" v-if="statusCode==='N'|| statusCode==='JLZ'" @change="numChange(record)" :min="0" style="width: 100%" />
<div v-else>{{ record.qtyMeaGj }}</div>
</template>
<template v-if="column.dataIndex === 'qtyMeaM3'">
<a-input-number v-model:value="record.qtyMeaM3" v-if="statusCode==='N'|| statusCode==='JLZ'" @change="numChange(record)" :min="0" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'lngFileUploadList'">
<div>
<Upload :file-list="record.lngFileUploadList" :showUploadList="false" v-model:value="tableId" v-model:tableName="tableName" v-model:columnName="columnName"
:multiple="true" :dataDelete="true" :isShowTip="false" :isShowBtnIcon="false" @click="onUpload(index)" @change="uploadChange" :showDownloadIcon="false"/>
<div v-for="(item, idx) in record.lngFileUploadList">
<a @click="handleDownload(item)">{{item.fileOrg}}</a>
<span @click="deleteFile(record, idx)" class="delIcon"><DeleteOutlined /></span>
</div>
</div>
</template>
<template v-if="column.dataIndex === 'action'">
<TableAction :actions="getActions(record)" />
</template>
</template>
</BasicTable>
<PngMeasureSalesPurModal @register="registerModal" @success="handleSuccess" />
<ImportModal @register="registerImportModal" importUrl="/dayPlan/pngMeasureSalesPur/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/pngMeasureSalesPur/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 { getLngPngMeasureSalesPurPage, deleteLngPngMeasureSalesPur, exportLngPngMeasureSalesPur, addLngPngMeasureSalesPur, updateLngPngMeasureSalesPur,
cancelLngPngMeasureSalesPur, rejectLngPngMeasureSalesPur
} from '/@/api/dayPlan/PngMeasureSalesPur';
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 { useModal } from '/@/components/Modal';
import PngMeasureSalesPurModal from './components/PngMeasureSalesPurModal.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 useEventBus from '/@/hooks/event/useEventBus';
import { cloneDeep } from 'lodash-es';
import Upload from '/@/components/Form/src/components/Upload.vue';
import { parseDownloadUrl} from '/@/api/system/file';
import { downloadByUrl } from '/@/utils/file/download';
import { DeleteOutlined } from '@ant-design/icons-vue';
import searchForm from './components/searchForm.vue'
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([{"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":true},{"isUse":true,"name":"保存并确认","code":"submit","icon":"ant-design:check-outlined","isDefault":true},{"isUse":true,"name":"取消确认","code":"cancel","icon":"ant-design:rollback-outlined","isDefault":true},{"isUse":true,"name":"驳回","code":"reject","icon":"ant-design:stop-outlined","isDefault":true},{"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 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, refresh : handleRefresh,batchdelete : handleBatchdelete,import : handleImport,export : handleExport,
save: handleSave, submit: handleSubmit, cancel: handleCancel, reject: handleReject}
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 selectedKeys = ref<string[]>([]);
const selectedRowsData = ref<any[]>([]);
const curIdx = ref()
const [registerModal, { openModal }] = useModal();
const [registerImportModal, { openModal: openImportModal }] = useModal();
const tableId = '';
const tableName = 'PngMeasureSalesPur';
const columnName = 'PngMeasureSalesPur';
const formName='管道气采购计量';
const [registerTable, { reload, clearSelectedRowKeys, getDataSource, updateTableDataRecord }] = useTable({
title: '' || (formName + '列表'),
api: getLngPngMeasureSalesPurPage,
rowKey: 'id',
immediate: false,
columns: customConfigColums,
formConfig: {
schemas: [],
showResetButton: false,
showSubmitButton: false
},
beforeFetch: (params) => {
return { ...params, FormId: formIdComputedRef.value, PK: 'id',page: params.limit, ...formState.value};
},
afterFetch: (res) => {
tableRef.value.setToolBarWidth();
},
useSearchForm: true,
showTableSetting: true,
striped: false,
rowSelection: {
type: 'checkbox',
onChange: onSelectChange
},
tableSetting: {
size: false,
setting: false,
},
customRow,
});
const isExpend = ref(false)
const formState = ref({})
const toggle = (val)=> {
isExpend.value = val
}
const onSearch = (val)=> {
formState.value = val
reload()
}
const onReset = (val)=> {
formState.value ={ page: 1,size: 10}
reload()
}
const onUpload = (index) => {
curIdx.value = index
}
const uploadChange = (val) => {
let data = getDataSource()
let record = data[curIdx.value]
record.lngFileUploadList = val
updateTableDataRecord(record.id, record)
}
const deleteFile = (record, idx) => {
record.lngFileUploadList.splice(idx, 1)
updateTableDataRecord(record.id, record)
}
const handleDownload = (info) => {
const url = parseDownloadUrl(info.response ? info.response.data.fileUrl : info.fileUrl);
const fileName = info.response ? info.response.data.fileOrg : info.fileOrg;
downloadByUrl({ url, fileName: fileName});
};
const numChange = (record) => {
record.rateM3Gj = Number(record.qtyMeaGj) ? (Number(record.qtyMeaM3) || 0 ) / Number(record.qtyMeaGj) : '0'
record.rateM3Gj = record.rateM3Gj.toFixed(6)
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'
}
});
}
async function handleReject() {
if (!selectedRowsData.value.length) {
notification.warning({
message: 'Tip',
description: t('请选择需要驳回的数据'),
});
return;
}
await rejectLngPngMeasureSalesPur(selectedRowsData.value)
handleSuccess();
notification.success({
message: 'Tip',
description: t('已驳回!'),
});
clearSelectedRowKeys()
}
async function handleCancel() {
if (!selectedRowsData.value.length) {
notification.warning({
message: 'Tip',
description: t('请选择需要取消的数据'),
});
return;
}
await cancelLngPngMeasureSalesPur(selectedRowsData.value)
handleSuccess();
notification.success({
message: 'Tip',
description: t('取消成功!'),
});
clearSelectedRowKeys()
}
async function handleSubmit() {
if (!selectedRowsData.value.length) {
notification.warning({
message: 'Tip',
description: t('请选择需要确认的数据'),
});
return;
}
await updateLngPngMeasureSalesPur(selectedRowsData.value)
handleSuccess();
notification.success({
message: 'Tip',
description: t('确认成功!'),
});
clearSelectedRowKeys()
}
async function handleSave() {
if (!selectedRowsData.value.length) {
notification.warning({
message: 'Tip',
description: t('请选择需要保存的数据'),
});
return;
}
await addLngPngMeasureSalesPur(selectedRowsData.value)
handleSuccess();
notification.success({
message: 'Tip',
description: t('保存成功!'),
});
clearSelectedRowKeys()
}
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/PngMeasureSalesPur/' + record.id + '/viewForm',
query: {
formPath: 'dayPlan/PngMeasureSalesPur',
formName: formName,
formId:currentRoute.value.meta.formId
}
});
}
}
function buttonClick(code) {
btnEvent[code]();
}
function handleDatalog (record: Recordable) {
modalVisible.value = true
logId.value = record.id
}
function handleBatchdelete() {
if (!selectedKeys.value.length) {
notification.warning({
message: 'Tip',
description: t('请选择需要删除的数据'),
});
return;
}
//与工作流相关的数据不能进行批量删除
const cantDelete = selectedRowsData.value.filter((x) => {
return (
(x.workflowData?.enabled && x.workflowData?.status) ||
(!x.workflowData?.enabled && !!x.workflowData?.processId)
);
});
if (cantDelete.length) {
notification.warning({
message: 'Tip',
description: t('含有不能删除的数据'),
});
return;
}
deleteList(selectedKeys.value);
}
function deleteList(ids) {
Modal.confirm({
title: '提示信息',
icon: createVNode(ExclamationCircleOutlined),
content: '是否确认删除?',
okText: '确认',
cancelText: '取消',
onOk() {
deleteLngPngMeasureSalesPur(ids).then((_) => {
handleSuccess();
notification.success({
message: 'Tip',
description: t('删除成功!'),
});
});
},
onCancel() {},
});
}
function onSelectChange(selectedRowKeys: [], selectedRows) {
selectedKeys.value = selectedRowKeys;
selectedRowsData.value = selectedRows;
}
function customRow(record: Recordable) {
return {
onClick: () => {
let selectedRowKeys = [...selectedKeys.value];
if (selectedRowKeys.indexOf(record.id) >= 0) {
let index = selectedRowKeys.indexOf(record.id);
selectedRowKeys.splice(index, 1);
} else {
selectedRowKeys.push(record.id);
}
selectedKeys.value = selectedRowKeys;
},
};
}
function handleRefresh() {
reload();
}
function handleSuccess() {
selectedKeys.value = [];
selectedRowsData.value = [];
reload();
}
async function handleExport() {
const res = await exportLngPngMeasureSalesPur({ isTemplate: false });
downloadByData(
res.data,
'PngMeasureSalesPur.xlsx',
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
);
}
function handleImport() {
openImportModal(true, {
title: '快速导入',
downLoadUrl:'/dayPlan/pngMeasureSalesPur/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[] {
const actionsList: ActionItem[] = actionButtonConfig.value?.map((button) => {
if (!record.workflowData?.processId) {
return {
icon: button?.icon,
tooltip: button?.name,
color: button.code === 'delete' ? 'error' : undefined,
onClick: btnEvent[button.code].bind(null, record),
};
} else {
if (button.code === 'view') {
return {
icon: button?.icon,
tooltip: button?.name,
onClick: btnEvent[button.code].bind(null, record),
};
} else {
return {};
}
}
});
return actionsList;
}
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">
.PngMeasureSalesPurStyle .cusSearchForm .advanceRow> div:nth-of-type(3){
display: none;
}
.PngMeasureSalesPurStyle .cusSearchForm .advanceRow> div:nth-of-type(2){
display: none;
}
.PngMeasureSalesPurStyle .w-full .advanceRow> div:nth-of-type(4){
display: none;
}
</style>
<style lang="less" scoped>
:deep(.ant-table-selection-col) {
width: 50px;
}
.show{
display: flex;
}
.hide{
display: none !important;
}
.delIcon {
margin-left: 10px;
cursor: pointer;
margin-bottom: 5px;
}
.pd {
padding: 6px 4px 0px 8px;
position: relative;
}
.pr {
margin-right: 4px;
margin-bottom: 8px;
}
.pr:nth-child(1) {
margin-left: 4px;
}
.formStyle {
position: absolute;
max-height: 400px;
z-index: 6;
background: #fff;
border: 1px solid rgba(204, 204, 204, 0.47);
box-shadow: 1px 2px 10px #ccc;
top: 0;
left: 0;
right: 0;
padding: 12px 0 8px 15px;
align-items: self-start !important;
justify-content: space-between;
margin: 2px 4px 12px 8px;
}
:deep(.ant-table-title) {
display: none !important;
}
</style>

View File

@ -74,7 +74,9 @@
// 根据行唯一ID查询行数据并设置表单数据 【编辑】
async function setFormDataFromId(rowId, skipUpdate) {
try {
const record = await getXjrNotice(rowId);
let record = await getXjrNotice(rowId);
record.status = ''+record.status
record.publisherType = ''+record.publisherType
if (skipUpdate) {
return record;
}