This commit is contained in:
2026-01-12 09:34:09 +08:00
15 changed files with 464 additions and 427 deletions

View File

@ -41,6 +41,7 @@
'' ''
); );
res.forEach((x) => { res.forEach((x) => {
x.fileUrl = '/api' + x.fileUrl
instance?.cmd.do('insertHTML', '<img src="' + x.fileUrl + '"></img>'); instance?.cmd.do('insertHTML', '<img src="' + x.fileUrl + '"></img>');
}); });
} catch (error) { } catch (error) {

View File

@ -0,0 +1,211 @@
<template>
<div style="width: 100%">
<a-button type="primary" style="margin-bottom: 10px" @click="addContractAgree" v-if="!disabled">新增行</a-button>
<a-table :columns="columns" :data-source="dataListContractAgree" :pagination="false" :scroll="{x: 1300}">
<template #headerCell="{ column }">
<template v-if="column.dataIndex == 'dateFrom'">
<span><span class="redStyle">*</span>开始日期</span>
</template>
<template v-if="column.dataIndex == 'dateTo'">
<span><span class="redStyle">*</span>结束日期</span>
</template>
<template v-if="column.dataIndex == 'baseInc'">
<span><span class="redStyle">*</span>基础量/增量</span>
</template>
<template v-if="column.dataIndex == 'sort'">
<span><span class="redStyle">*</span>优先级</span>
</template>
<template v-if="column.dataIndex == 'qtyGjMonth'">
<span><span class="redStyle">*</span>月气量(吉焦)</span>
</template>
<template v-if="column.dataIndex == 'qtyM3Month'">
<span><span class="redStyle">*</span>月气量(万方)</span>
</template>
</template>
<template #bodyCell="{ column, record, index }">
<template v-if="column.dataIndex === 'dateFrom'">
<a-date-picker v-model:value="record.dateFrom" format="YYYY-MM-DD" :value-format="'YYYY-MM-DD'" :disabled="disabled" @change="dateFromTb(dayjs(record.dateFrom || null), index, record)" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'dateTo'">
<a-date-picker v-model:value="record.dateTo" format="YYYY-MM-DD" :value-format="'YYYY-MM-DD'" :disabled="disabled" @change="dateToTb(dayjs(record.dateTo || null), index, record)" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'sort'">
<a-input-number v-model:value="record.sort" :disabled="disabled" :min="0" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'baseInc'">
<a-select v-model:value="record.baseInc" :disabled="disabled" style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.baseIncList" :key="item.code" :value="item.code">
{{ item.name }}
</a-select-option>
</a-select>
</template>
<template v-if="column.dataIndex === 'rateM3Gj'">
<a-input-number v-model:value="record.rateM3Gj" :disabled="disabled" :min="0" @change="numChange('rateM3Gj', record, index)" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'qtyGjMonth'">
<a-input-number v-model:value="record.qtyGjMonth" :disabled="disabled" :min="0" @change="numChange('qtyGjMonth', record, index)" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'qtyM3Month'">
<a-input-number v-model:value="record.qtyM3Month" :disabled="disabled" :min="0" @change="numChange('qtyM3Month', record, index)" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'zfbyTypeCode'">
<a-select v-model:value="record.zfbyTypeCode" :disabled="disabled" style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.zfbyTypeCodeList" :key="item.code" :value="item.code">
{{ item.name }}
</a-select-option>
</a-select>
</template>
<template v-if="column.dataIndex === 'zfbyValue'">
<a-input-number v-model:value="record.zfbyValue" :disabled="disabled" :min="0" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'note'">
<a-input v-model:value="record.note" :disabled="disabled" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'operation'">
<a v-if="!disabled" style="margin-right: 10px" @click="btnCheck(record, index)">删除</a>
</template>
</template>
</a-table>
</div>
</template>
<script lang="ts" setup>
import { Card } from 'ant-design-vue';
import { ref, watch} from 'vue';
import { useRouter } from 'vue-router';
import { useI18n } from '/@/hooks/web/useI18n';
import { Modal } from 'ant-design-vue';
import { useModal } from '/@/components/Modal';
import { message } from 'ant-design-vue';
import dayjs from 'dayjs';
const router = useRouter();
const { t } = useI18n();
const dataListContractAgree = ref([])
const columns= ref([
{ title: t('序号'), dataIndex: 'index', key: 'index', sorter: true, customRender: (column) => `${column.index + 1}` ,width: 80},
{ title: t('开始日期'), dataIndex: 'dateFrom', sorter: true, width:160},
{ title: t('结束日期'), dataIndex: 'dateTo', sorter: true, width: 160},
{ title: t('基础量/增量'), dataIndex: 'baseInc', sorter: true, width: 130},
{ title: t('优先级'), dataIndex: 'sort', sorter: true, width: 100},
{ title: t('比值(方/吉焦)'), dataIndex: 'rateM3Gj', sorter: true, width: 150},
{ title: t('月气量(吉焦)'), dataIndex: 'qtyGjMonth', sorter: true, width: 150},
{ title: t('月气量(万方)'), dataIndex: 'qtyM3Month', sorter: true, width: 150},
{ title: t('日气量(吉焦)'), dataIndex: 'qtyGjDay', sorter: true, width: 120},
{ title: t('日气量(万方)'), dataIndex: 'qtyM3Day', sorter: true, width: 120},
{ title: t('照付不议类型'), dataIndex: 'zfbyTypeCode', sorter: true, width: 120},
{ title: t('照付不议比例%/量数值'), dataIndex: 'zfbyValue', sorter: true, width: 120},
{ title: t('备注'), dataIndex: 'note', sorter: true, width: 200},
{ title: t('操作'), dataIndex: 'operation', width: 80, fixed: 'right',align: 'center'},
]);
const [register, { openModal:openModal}] = useModal();
const props = defineProps({
disabled: Boolean,
list: Array,
optionSelect: Object
});
const emit = defineEmits(['change']);
const addContractAgree = () => {
dataListContractAgree.value.push({
dateFrom: null, dateTo: null, rateM3Gj: null, qtyGjMonth: null, qtyM3Month: null, qtyGjDay: null, qtyM3Day: null
})
}
const dateFromTb = (startValue, index, record) => {
if (!startValue) return
const endValue = dataListContractAgree.value[index]?.dateTo;
if (!startValue || !endValue) {
return false
}
if (startValue.valueOf() > endValue.valueOf()) {
message.warning('结束日期须大于等于开始日期')
dataListContractAgree.value[index].dateFrom = ''
return
}
dayCount(record)
}
const dateToTb = (endValue, index, record) => {
if (!endValue) return
const startValue = dataListContractAgree.value[index]?.dateFrom;
if (!endValue || !startValue) {
return false
}
if (startValue.valueOf() > endValue.valueOf()) {
message.warning('结束日期须大于等于开始日期')
dataListContractAgree.value.splice(index, 1, { ...dataListContractAgree.value[index], dateTo: '' });
return
}
dayCount(record)
}
const numChange = (key, record) => {
if (key == 'qtyGjMonth') {
numCount2(record)
dayCount(record)
}
if (key == 'qtyM3Month') {
numCount1(record)
dayCount(record)
}
if (key == 'rateM3Gj') {
numCount1(record)
numCount2(record)
dayCount(record)
}
}
const numCount1 = (record) => {
// 月气量(吉焦) =月气量(方)qty_m3_month*rate_m3_gj (比值(方/吉焦)
record.qtyGjMonth = (Number(record.qtyM3Month) || 0) * (Number(record.rateM3Gj) || 0)
record.qtyGjMonth = record.qtyGjMonth ? record.qtyGjMonth.toFixed(4) : '0'
}
const numCount2 = (record) => {
// 月气量(方) = 月气量(吉焦) qty_gj_month/rate_m3_gj/10000 显示时字段值/10000保存时页面值*10000
record.qtyM3Month = Number(record.rateM3Gj) ? (Number(record.qtyGjMonth) || 0) /Number(record.rateM3Gj) : 0
record.qtyM3Month = record.qtyM3Month ? record.qtyM3Month.toFixed(4) : '0'
}
const dayCount = (record) => {
// 日气量(吉焦) = 月气量(吉焦)qty_gj_month/开始日期到结束日期的天数;计算结果保留整数
const days = dayjs(record.dateTo).diff(dayjs(record.dateFrom), 'day');
record.qtyGjDay = days ? (Number(record.qtyGjMonth) || 0) /days : 0
record.qtyGjDay = parseInt(record.qtyGjDay)
// 日气量(方) = 月气量(万方)/开始日期到结束日期的天数计算结果保留4位小数显示时字段值/10000保存时页面值*10000
record.qtyM3Day = days ? (Number(record.qtyM3Month) || 0) /days : 0
record.qtyM3Day = record.qtyM3Day ? record.qtyM3Day.toFixed(4) : '0'
}
const btnCheck = (record, index) => {
dataListContractAgree.value.splice(index, 1)
}
const getQtyList = () => {
return dataListContractAgree.value
}
watch(
() => props.disabled,
(val) => {
if (val) {
let idx2 = columns.value.findIndex(v =>v.dataIndex == 'operation')
idx2>-1 && columns.value.splice(idx2, 1)
}
},
{
immediate: true,
deep: true,
}
);
watch(
() => props.list,
async (val) => {
dataListContractAgree.value = val || []
},
{
immediate: true,
deep: true,
}
);
defineExpose({
getQtyList,
});
</script>
<style lang="less" scoped>
.redStyle {
color: red;
}
</style>

View File

@ -1,21 +1,19 @@
<template> <template>
<div> <div>
<Card title="签报列表" :bordered="false" > <a-button type="primary" style="margin-bottom: 10px" v-if="!disabled" @click="onAppro">关联签报</a-button>
<a-button type="primary" style="margin-bottom: 10px" v-if="!disabled" @click="onAppro">关联签报</a-button> <a-table :columns="columns" :data-source="dataList" :pagination="false">
<a-table :columns="columns" :data-source="dataList" :pagination="false"> <template #bodyCell="{ column, record, index }">
<template #bodyCell="{ column, record, index }"> <template v-if="column.dataIndex === 'file'">
<template v-if="column.dataIndex === 'file'"> <div v-for="item in (record.lngFileUploadList )">
<div v-for="item in (record.lngFileUploadList )"> <a @click="handleDownload(item)">{{item.fileOrg}}</a>
<a @click="handleDownload(item)">{{item.fileOrg}}</a> </div>
</div>
</template>
<template v-if="column.dataIndex === 'operation'">
<a style="margin-right: 10px" @click="btnCheck('view', record, index)">查看</a>
<a v-if="!disabled" style="margin-right: 10px" @click="btnCheck('delete', record, index)">删除</a>
</template>
</template> </template>
</a-table> <template v-if="column.dataIndex === 'operation'">
</Card> <a style="margin-right: 10px" @click="btnCheck('view', record, index)">查看</a>
<a v-if="!disabled" style="margin-right: 10px" @click="btnCheck('delete', record, index)">删除</a>
</template>
</template>
</a-table>
<approListModal @register="register" @success="handleSuccess" /> <approListModal @register="register" @success="handleSuccess" />
</div> </div>
</template> </template>
@ -121,8 +119,6 @@
() => props.disabled, () => props.disabled,
(val) => { (val) => {
if (val) { if (val) {
let idx2 = columns.value.findIndex(v =>v.dataIndex == 'operation')
idx2>-1 && columns.value.splice(idx2, 1)
} }
}, },
{ {

View File

@ -1,21 +1,19 @@
<template> <template>
<div> <div>
<Card title="关联合同信息" :bordered="false" > <a-button type="primary" style="margin-bottom: 10px" v-if="!disabled" @click="onContractFactList">关联合同</a-button>
<a-button type="primary" style="margin-bottom: 10px" v-if="!disabled" @click="onAppro">关联合同</a-button> <a-table :columns="columns" :data-source="dataList" :pagination="false" :scroll="{x: 1000}">
<a-table :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 === 'file'">
<template v-if="column.dataIndex === 'file'"> <div v-for="item in (record.lngFileUploadList )">
<div v-for="item in (record.lngFileUploadList )"> <a @click="handleDownload(item)">{{item.fileOrg}}</a>
<a @click="handleDownload(item)">{{item.fileOrg}}</a> </div>
</div>
</template>
<template v-if="column.dataIndex === 'operation'">
<a style="margin-right: 10px" @click="btnCheck('view', record, index)">查看</a>
<a v-if="!disabled" style="margin-right: 10px" @click="btnCheck('delete', record, index)">删除</a>
</template>
</template> </template>
</a-table> <template v-if="column.dataIndex === 'operation'">
</Card> <a style="margin-right: 10px" @click="btnCheck('view', record, index)">查看</a>
<a v-if="!disabled" style="margin-right: 10px" @click="btnCheck('delete', record, index)">删除</a>
</template>
</template>
</a-table>
<contractFactListModal @register="register" @success="handleSuccess" /> <contractFactListModal @register="register" @success="handleSuccess" />
</div> </div>
</template> </template>
@ -58,7 +56,7 @@
const fileName = info.response ? info.response.data.fileOrg : info.fileOrg; const fileName = info.response ? info.response.data.fileOrg : info.fileOrg;
downloadByUrl({ url, fileName: fileName}); downloadByUrl({ url, fileName: fileName});
}; };
const onAppro = (val)=> { const onContractFactList = (val)=> {
openModal(true,{isUpdate: false}) openModal(true,{isUpdate: false})
} }
const handleSuccess = (val) =>{ const handleSuccess = (val) =>{
@ -123,8 +121,6 @@
() => props.disabled, () => props.disabled,
(val) => { (val) => {
if (val) { if (val) {
let idx2 = columns.value.findIndex(v =>v.dataIndex == 'operation')
idx2>-1 && columns.value.splice(idx2, 1)
} }
}, },
{ {

View File

@ -51,14 +51,14 @@ export const tabListData: TabItem[] = [
// unreadNum: 0, // unreadNum: 0,
// }, // },
{ {
key: '4', key: '3',
name: t('工作流'), name: t('工作流'),
list: [], list: [],
read: [], read: [],
unreadNum: 0, unreadNum: 0,
}, },
{ {
key: '5', key: '4',
name: t('系统通知'), name: t('系统通知'),
list: [], list: [],
unreadNum: 0, unreadNum: 0,

View File

@ -12,8 +12,8 @@
{{ item.name }} {{ item.name }}
<span v-if="item.unreadNum !== 0">({{ item.unreadNum }})</span> <span v-if="item.unreadNum !== 0">({{ item.unreadNum }})</span>
</template> </template>
<!--工作流程-->
<div v-if="item.key === '4'" class="min-h-88"> <div v-if="item.key === '3'" class="min-h-88">
<div> <div>
<div class="list-item"> <div class="list-item">
<span class="header-title">{{ t('流程审批') }}</span> <span class="header-title">{{ t('流程审批') }}</span>
@ -65,7 +65,7 @@
</div> </div>
</div> </div>
<!--系统通知消息--> <!--系统通知消息-->
<div v-else-if="item.key === '5'" class="h-88"> <div v-else-if="item.key === '4'" class="h-88">
<div v-if="item.list.length > 0" class="h-82"> <div v-if="item.list.length > 0" class="h-82">
<div <div
class="list-item readed-mark" class="list-item readed-mark"
@ -214,7 +214,7 @@
try { try {
if (import.meta.env.VITE_GLOB_DISABLE_NEWS !== 'true') { if (import.meta.env.VITE_GLOB_DISABLE_NEWS !== 'true') {
let res = await getOaNews(1); let res = await getOaNews(1);
res.list.forEach((o) => { (res || []).forEach((o) => {
if (!o.readId) listData.value[0].unreadNum += 1; if (!o.readId) listData.value[0].unreadNum += 1;
listData.value[0].list.push({ listData.value[0].list.push({
id: o.id, id: o.id,
@ -228,7 +228,7 @@
}); });
}); });
let res1 = await getOaNews(2); let res1 = await getOaNews(2);
res1.list.forEach((o) => { (res1 || []).forEach((o) => {
if (!o.readId) listData.value[1].unreadNum += 1; if (!o.readId) listData.value[1].unreadNum += 1;
listData.value[1].list.push({ listData.value[1].list.push({
id: o.id, id: o.id,
@ -244,21 +244,23 @@
let res2 = await getOaMessage(); let res2 = await getOaMessage();
res2.forEach((o) => { res2.forEach((o) => {
if (o.messageType === 0) { if (o.messageType === 0) {
// 日程
// if (!o.isRead) listData.value[2].unreadNum += 1;
// listData.value[2].list.push({
// id: o.id,
// avatar: '',
// title: o.messageContent,
// description: '',
// datetime: o.sendTime,
// timeFormat: o.timeFormat,
// color: '',
// type: '3',
// read: o.isRead
// });
} else if (o.messageType == 1) {
// 工作流 listData.value[3]
if (!o.isRead) listData.value[2].unreadNum += 1; if (!o.isRead) listData.value[2].unreadNum += 1;
listData.value[2].list.push({ listData.value[2].list.push({
id: o.id,
avatar: '',
title: o.messageContent,
description: '',
datetime: o.sendTime,
timeFormat: o.timeFormat,
color: '',
type: '3',
read: o.isRead
});
} else if (o.messageType == 1) {
if (!o.isRead) listData.value[3].unreadNum += 1;
listData.value[3].list.push({
id: o.id, id: o.id,
avatar: '', avatar: '',
title: o.messageContent, title: o.messageContent,
@ -273,8 +275,9 @@
read: o.isRead read: o.isRead
}); });
} else if (o.messageType == 2) { } else if (o.messageType == 2) {
if (!o.isRead) listData.value[3].unreadNum += 1; //工作流 listData.value[3]
listData.value[3].read?.push({ if (!o.isRead) listData.value[2].unreadNum += 1;
listData.value[2].read?.push({
id: o.id, id: o.id,
avatar: '', avatar: '',
title: o.messageContent, title: o.messageContent,
@ -292,14 +295,16 @@
//系统消息 //系统消息
let res4 = import.meta.env.VITE_DISABLE_NOTE === 'true' ? { list: [] } : await queryLoginUserNotices({ limit: 1, size: 10 }); let res4 = import.meta.env.VITE_DISABLE_NOTE === 'true' ? { list: [] } : await queryLoginUserNotices({ limit: 1, size: 10 });
listData.value[4].list = res4.list; //listData.value[4]
listData.value[4].unreadNum = res4.list.filter((item) => item.isRead == 0).length; listData.value[3].list = res4.list;
listData.value[3].unreadNum = res4.list.filter((item) => item.isRead == 0).length;
} }
let res3 = await getScheduleMsg(); let res3 = await getScheduleMsg();
res3.list.forEach((item) => (item.read = item.isRead)); res3.list.forEach((item) => (item.read = item.isRead));
listData.value[2].unreadNum = res3.list.filter((x) => !x.isRead).length; // 日程
listData.value[2].list.push(...res3.list); // listData.value[2].unreadNum = res3.list.filter((x) => !x.isRead).length;
// listData.value[2].list.push(...res3.list);
console.log('message', listData.value); console.log('message', listData.value);
} catch (error) { } catch (error) {
console.error('message error', error); console.error('message error', error);

View File

@ -1,8 +1,9 @@
<template> <template>
<a-spin :spinning="spinning" tip="加载中..."> <a-spin :spinning="spinning" tip="加载中...">
<div class="page-bg-wrap formViewStyle"> <div class="page-bg-wrap formViewStyle" :class="isViewForm ? 'pdcss':''">
<a-form ref="formRef" :model="formState" :rules="rules" v-bind="layout"> <a-form ref="formRef" :model="formState" :rules="rules" v-bind="isViewFormTask?layoutNew:layout">
<Card title="" :bordered="false" > <viewForm v-if='isViewFormTask' :formState="formState" :isDisable="isDisable" :optionSelect="optionSelect"></viewForm>
<Card title="" :bordered="false" v-else>
<a-row> <a-row>
<a-col :span="8"> <a-col :span="8">
<a-form-item label="编号" name="code"> <a-form-item label="编号" name="code">
@ -111,7 +112,7 @@
import UploadList from '/@/components/Form/src/components/UploadList.vue'; import UploadList from '/@/components/Form/src/components/UploadList.vue';
import deptUserModal from '/@/components/common/deptUserModal.vue'; import deptUserModal from '/@/components/common/deptUserModal.vue';
import deptListModal from '/@/components/common/deptListModal.vue'; import deptListModal from '/@/components/common/deptListModal.vue';
import viewForm from './viewForm.vue';
import { Modal } from 'ant-design-vue'; import { Modal } from 'ant-design-vue';
import { useUserStore } from '/@/store/modules/user'; import { useUserStore } from '/@/store/modules/user';
const userStore = useUserStore(); const userStore = useUserStore();
@ -140,6 +141,8 @@
const formId = ref(currentRoute.value?.params?.id); const formId = ref(currentRoute.value?.params?.id);
const pageType = ref(currentRoute.value.query?.type); const pageType = ref(currentRoute.value.query?.type);
const pageId = ref(currentRoute.value.query?.id) const pageId = ref(currentRoute.value.query?.id)
const isViewForm = currentRoute.value.path.includes('viewForm')
const isViewFormTask = currentRoute.value.path.includes('processtasks')
const spinning = ref(false); const spinning = ref(false);
const curIdx = ref(null) const curIdx = ref(null)
@ -167,6 +170,10 @@
labelCol: { span: 8 }, labelCol: { span: 8 },
wrapperCol: { span: 16 }, wrapperCol: { span: 16 },
} }
const layoutNew = {
labelCol: { span: 6 },
wrapperCol: { span: 18 },
}
const dataFile = ref([]); const dataFile = ref([]);
let optionSelect= reactive({ let optionSelect= reactive({
approCodeList: [], approCodeList: [],
@ -318,5 +325,7 @@
margin-bottom: 12px; margin-bottom: 12px;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
} }
.pdcss {
padding: 6px 12px !important;
}
</style> </style>

View File

@ -0,0 +1,99 @@
<template>
<Card title="" :bordered="false" >
<a-row>
<a-col :span="12">
<a-form-item label="编号" name="code">
<a-input v-model:value="formState.code" disabled />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="标题" name="title">
<a-input v-model:value="formState.title" :disabled="isDisable" placeholder="请输入标题"/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="签报类型" name="typeCode">
<a-select v-model:value="formState.typeCode" :disabled="isDisable" placeholder="请选择签报类型" style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.typeCodeList" :key="item.code" :value="item.code">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- <a-col :span="8">
<a-form-item label="密级" name="securityCode">
<a-select v-model:value="formState.securityCode" :disabled="isDisable" placeholder="请选择密级" style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.securityCodeList" :key="item.code" :value="item.code">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col> -->
<a-col :span="12">
<a-form-item label="缓急" name="urgencyCode">
<a-select v-model:value="formState.urgencyCode" :disabled="isDisable" placeholder="请选择缓急" style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.urgencyCodeList" :key="item.code" :value="item.code">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="拟稿人" name="empName">
<a-input v-model:value="formState.empName" :disabled="isDisable" placeholder="请选择拟稿人" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="拟稿人所属部门" name="bDeptName">
<a-input v-model:value="formState.bDeptName" :disabled="isDisable" placeholder="请选择拟稿人部门"/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="拟稿人所属公司" name="comName">
<a-input v-model:value="formState.comName" disabled/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="拟稿日期" name="dateAppro">
<a-date-picker v-model:value="formState.dateAppro" :disabled="isDisable" style="width: 100%" placeholder="请选择评价日期" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="审批状态" name="approCode">
<a-select v-model:value="formState.approCode" disabled style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.approCodeList" :key="item.code" :value="item.code">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="内容摘要" name="content" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
<a-textarea v-model:value="formState.content" :disabled="isDisable" placeholder="请输入备注最多1000字" :maxlength="1000" :auto-size="{ minRows: 1, }"/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="备注" name="note" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
<a-textarea v-model:value="formState.note" :disabled="isDisable" placeholder="请输入备注最多200字" :maxlength="200" :auto-size="{ minRows: 1, maxRows: 5 }"/>
</a-form-item>
</a-col>
</a-row>
</Card>
</template>
<script lang="ts" setup>
import { Card } from 'ant-design-vue';
const props = defineProps({
isDisable: Boolean,
optionSelect: Object,
formState: Object
});
</script>
<style lang="less" scoped>
</style>

View File

@ -1,6 +1,6 @@
<template> <template>
<a-spin :spinning="spinning" tip="加载中..."> <a-spin :spinning="spinning" tip="加载中...">
<div class="page-bg-wrap formViewStyle"> <div class="page-bg-wrap formViewStyle" :class="isViewForm ? 'pdcss':''">
<a-form ref="formRef" :model="formState" :rules="rules" v-bind="layout"> <a-form ref="formRef" :model="formState" :rules="rules" v-bind="layout">
<Card title="合同要素" :bordered="false" > <Card title="合同要素" :bordered="false" >
<a-row> <a-row>
@ -214,7 +214,9 @@
<Card title="附件信息" :bordered="false" > <Card title="附件信息" :bordered="false" >
<UploadList :disabled="isDisable" :list="dataFile" :value="formState.filePath" :tableName="tableName" :columnName="columnName" @change="uploadListChange"/> <UploadList :disabled="isDisable" :list="dataFile" :value="formState.filePath" :tableName="tableName" :columnName="columnName" @change="uploadListChange"/>
</Card> </Card>
<correlationApproList :list="dataListAppro" :disabled="isDisable" @change="getApproList"></correlationApproList> <Card title="签报列表" :bordered="false" >
<correlationApproList :list="dataListAppro" :disabled="isDisable" @change="getApproList"></correlationApproList>
</Card>
</a-form> </a-form>
</div> </div>
<deptUserModal @register="register" @success="handleSuccess"/> <deptUserModal @register="register" @success="handleSuccess"/>
@ -278,6 +280,7 @@
const formId = ref(currentRoute.value?.params?.id); const formId = ref(currentRoute.value?.params?.id);
const pageType = ref(currentRoute.value.query?.type); const pageType = ref(currentRoute.value.query?.type);
const pageId = ref(currentRoute.value.query?.id) const pageId = ref(currentRoute.value.query?.id)
const isViewForm = currentRoute.value.path.includes('viewForm')
const spinning = ref(false); const spinning = ref(false);
const curIdx = ref(null) const curIdx = ref(null)
@ -328,17 +331,6 @@
{ title: t('备注'), dataIndex: 'note', sorter: true, width: 200}, { title: t('备注'), dataIndex: 'note', sorter: true, width: 200},
{ title: t('操作'), dataIndex: 'operation', width: 120, fixed: 'right',align: 'center'}, { title: t('操作'), dataIndex: 'operation', width: 120, fixed: 'right',align: 'center'},
]); ]);
const columnsAppro= ref([
{ title: t('序号'), dataIndex: 'index', key: 'index', sorter: true, customRender: (column) => `${column.index + 1}` ,width: 100},
{ title: t('标题'), dataIndex: 'title', sorter: true, width:100},
{ title: t('编号'), dataIndex: 'code', sorter: true},
{ title: t('签报类型'), dataIndex: 'typeName', sorter: true, width: 140},
{ title: t('拟稿人'), dataIndex: 'empName', sorter: true, width: 140},
{ title: t('拟稿人所属部门'), dataIndex: 'bDeptName', sorter: true, width: 140},
{ title: t('拟稿时间'), dataIndex: 'dateAppro', sorter: true, width: 140},
{ title: t('附件'), dataIndex: 'file', sorter: true, width: 140},
{ title: t('操作'), dataIndex: 'operation', width: 120, fixed: 'right',align: 'center'},
]);
const dataList = ref([]) const dataList = ref([])
const dataFile = ref([]); const dataFile = ref([]);
const dataListAppro = ref([]) const dataListAppro = ref([])
@ -377,6 +369,11 @@
getOption() getOption()
if (pageId.value) { if (pageId.value) {
getInfo(pageId.value) getInfo(pageId.value)
if (currentRoute.value.query?.disabled) {
isDisable.value = true
let idx = columns.value.findIndex(v =>v.dataIndex == 'operation')
idx>-1 && columns.value.splice(idx, 1)
}
} else { } else {
formState.empName = userInfo.name formState.empName = userInfo.name
formState.empId = userInfo.id formState.empId = userInfo.id
@ -623,6 +620,9 @@
min-height: 44px; min-height: 44px;
margin-bottom: 12px; margin-bottom: 12px;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
} }
.pdcss {
padding: 6px 12px !important;
}
</style> </style>

View File

@ -8,7 +8,7 @@ export const formConfig = {
export const searchFormSchema: FormSchema[] = [ export const searchFormSchema: FormSchema[] = [
{ {
field: 'kNo', field: 'kName',
label: '合同号/名称', label: '合同号/名称',
component: 'Input', component: 'Input',
}, },
@ -54,6 +54,7 @@ export const columns: BasicColumn[] = [
align: 'left', align: 'left',
sorter: true, sorter: true,
width: 120
}, },
{ {
@ -63,19 +64,20 @@ export const columns: BasicColumn[] = [
align: 'left', align: 'left',
sorter: true, sorter: true,
width: 120
}, },
{ {
dataIndex: 'approCode', dataIndex: 'approName',
title: '状态', title: '状态',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
width: 100,
sorter: true, sorter: true,
}, },
{ {
dataIndex: 'cpTableName', dataIndex: 'pointUpName',
title: '上载点', title: '上载点',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
@ -84,16 +86,16 @@ export const columns: BasicColumn[] = [
}, },
{ {
dataIndex: 'onlineSign', dataIndex: 'transName',
title: '是否托运', title: '是否托运',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
width: 100,
sorter: true, sorter: true,
}, },
{ {
dataIndex: 'comId', dataIndex: 'comName',
title: '合同主体', title: '合同主体',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',

View File

@ -110,7 +110,7 @@
<h4>上载点</h4> <h4>上载点</h4>
<a-button type="primary" style="margin-bottom: 10px;margin-right: 10px;" @click="addUpLoad" v-if="!isDisable">新增</a-button> <a-button type="primary" style="margin-bottom: 10px;margin-right: 10px;" @click="addUpLoad" v-if="!isDisable">新增</a-button>
<a-button type="primary" @click="deleteUpLoad" v-if="!isDisable">删除</a-button> <a-button type="primary" @click="deleteUpLoad" v-if="!isDisable">删除</a-button>
<div v-for="(item, idx) in dataListPoint"> <div v-for="(item, idx) in dataListPoint" class="tbStyle">
<a-row> <a-row>
<a-col :span="8"> <a-col :span="8">
<a-form-item name="pointUpName"> <a-form-item name="pointUpName">
@ -125,7 +125,7 @@
<template #label> <template #label>
<span><span style="color:red">*</span>是否托运</span> <span><span style="color:red">*</span>是否托运</span>
</template> </template>
<a-select v-model:value="item.transSign" style="width: 100%" allow-clear> <a-select v-model:value="item.transSign" :disabled="isDisable" style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.transSignList" :key="item.code" :value="item.code"> <a-select-option v-for="item in optionSelect.transSignList" :key="item.code" :value="item.code">
{{ item.name }} {{ item.name }}
</a-select-option> </a-select-option>
@ -144,7 +144,7 @@
</template> </template>
<div style="position: relative;"> <div style="position: relative;">
<a-textarea style="width:95%;" v-model:value="item.pointDelyName" :disabled="isDisable" readonly placeholder="请选择交割点" :auto-size="{ minRows: 1, maxRows: 5 }"/> <a-textarea style="width:95%;" v-model:value="item.pointDelyName" :disabled="isDisable" readonly placeholder="请选择交割点" :auto-size="{ minRows: 1, maxRows: 5 }"/>
<a-button :icon="h(SearchOutlined)" class="iconStyle" @click="onSearchDownLoad('dely', idx)" /> <a-button v-if="!isDisable" :icon="h(SearchOutlined)" class="iconStyle" @click="onSearchDownLoad('dely', idx)" />
<!-- <a-input-search v-model:value="item.pointDelyName" :disabled="isDisable" placeholder="请选择交割点" readonly @search="onSearchDownLoad('dely', idx)"/> --> <!-- <a-input-search v-model:value="item.pointDelyName" :disabled="isDisable" placeholder="请选择交割点" readonly @search="onSearchDownLoad('dely', idx)"/> -->
</div> </div>
</a-form-item> </a-form-item>
@ -152,81 +152,18 @@
</a-row> </a-row>
</div> </div>
</Card> </Card>
<Card title="合同约定" :bordered="false" > <Card title="合同约定" :bordered="false" >
<div style="width: 100%"> <contractQtyList :list="dataListContractAgree" :disabled="isDisable" :optionSelect="optionSelect" ref="contractQty"></contractQtyList>
<a-button type="primary" style="margin-bottom: 10px" @click="addContractAgree" v-if="!isDisable">新增行</a-button>
<a-table style="width: 100%" :columns="columns" :data-source="dataListContractAgree" :pagination="false" :scroll="{x: 300}">
<template #headerCell="{ column }">
<template v-if="column.dataIndex == 'dateFrom'">
<span><span class="redStyle">*</span>开始日期</span>
</template>
<template v-if="column.dataIndex == 'dateTo'">
<span><span class="redStyle">*</span>结束日期</span>
</template>
<template v-if="column.dataIndex == 'baseInc'">
<span><span class="redStyle">*</span>基础量/增量</span>
</template>
<template v-if="column.dataIndex == 'sort'">
<span><span class="redStyle">*</span>优先级</span>
</template>
<template v-if="column.dataIndex == 'qtyGjMonth'">
<span><span class="redStyle">*</span>月气量(吉焦)</span>
</template>
<template v-if="column.dataIndex == 'qtyM3Month'">
<span><span class="redStyle">*</span>月气量(万方)</span>
</template>
</template>
<template #bodyCell="{ column, record, index }">
<template v-if="column.dataIndex === 'dateFrom'">
<a-date-picker v-model:value="record.dateFrom" :disabled="isDisable" @change="dateFromTb(record.dateFrom, index, record)" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'dateTo'">
<a-date-picker v-model:value="record.dateTo" :disabled="isDisable" @change="dateToTb(record.dateTo, index, record)" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'sort'">
<a-input-number v-model:value="record.sort" :disabled="isDisable" :min="0" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'baseInc'">
<a-select v-model:value="record.baseInc" :disabled="isDisable" style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.baseIncList" :key="item.code" :value="item.code">
{{ item.name }}
</a-select-option>
</a-select>
</template>
<template v-if="column.dataIndex === 'rateM3Gj'">
<a-input-number v-model:value="record.rateM3Gj" :disabled="isDisable" :min="0" @change="numChange('rateM3Gj', record, index)" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'qtyGjMonth'">
<a-input-number v-model:value="record.qtyGjMonth" :disabled="isDisable" :min="0" @change="numChange('qtyGjMonth', record, index)" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'qtyM3Month'">
<a-input-number v-model:value="record.qtyM3Month" :disabled="isDisable" :min="0" @change="numChange('qtyM3Month', record, index)" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'zfbyTypeCode'">
<a-select v-model:value="record.zfbyTypeCode" :disabled="isDisable" style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.zfbyTypeCodeList" :key="item.code" :value="item.code">
{{ item.name }}
</a-select-option>
</a-select>
</template>
<template v-if="column.dataIndex === 'zfbyValue'">
<a-input-number v-model:value="record.zfbyValue" :disabled="isDisable" :min="0" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'note'">
<a-input v-model:value="record.note" :disabled="isDisable" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'operation'">
<a v-if="!isDisable" style="margin-right: 10px" @click="btnCheck(record, index)">删除</a>
</template>
</template>
</a-table>
</div>
</Card> </Card>
<Card title="附件信息" :bordered="false" > <Card title="附件信息" :bordered="false" >
<UploadList :disabled="isDisable" :list="dataFile" :value="formState.filePath" :tableName="tableName" :columnName="columnName" @change="uploadListChange"/> <UploadList :disabled="isDisable" :list="dataFile" :value="formState.filePath" :tableName="tableName" :columnName="columnName" @change="uploadListChange"/>
</Card> </Card>
<correlationContractFactList :list="dataListContractFact" :disabled="isDisable" @change="getApproContractFactList"></correlationContractFactList> <Card title="关联合同信息" :bordered="false" >
<correlationApproList :list="dataListAppro" :disabled="isDisable" @change="getApproList"></correlationApproList> <correlationContractFactList :list="dataListContractFact" :disabled="isDisable" @change="getApproContractFactList"></correlationContractFactList>
</Card>
<Card title="签报列表" :bordered="false" >
<correlationApproList :list="dataListAppro" :disabled="isDisable" @change="getApproList"></correlationApproList>
</Card>
</a-form> </a-form>
</div> </div>
<deptUserModal @register="register" @success="handleSuccess"/> <deptUserModal @register="register" @success="handleSuccess"/>
@ -264,6 +201,8 @@
import contractFactListModal from '/@/components/common/contractFactListModal.vue'; import contractFactListModal from '/@/components/common/contractFactListModal.vue';
import downloadPointModal from '/@/components/common/downloadPointModal.vue'; import downloadPointModal from '/@/components/common/downloadPointModal.vue';
import supplierListModal from '/@/components/common/supplierListModal.vue'; import supplierListModal from '/@/components/common/supplierListModal.vue';
import contractQtyList from '/@/components/common/contractQtyList.vue';
import { useUserStore } from '/@/store/modules/user'; import { useUserStore } from '/@/store/modules/user';
const userStore = useUserStore(); const userStore = useUserStore();
@ -292,7 +231,8 @@
const formId = ref(currentRoute.value?.params?.id); const formId = ref(currentRoute.value?.params?.id);
const pageType = ref(currentRoute.value.query?.type); const pageType = ref(currentRoute.value.query?.type);
const pageId = ref(currentRoute.value.query?.id) const pageId = ref(currentRoute.value.query?.id)
const contractQty=ref()
const spinning = ref(false); const spinning = ref(false);
const curIdx = ref(null) const curIdx = ref(null)
const { notification } = useMessage(); const { notification } = useMessage();
@ -325,22 +265,6 @@
labelCol: { span: 8 }, labelCol: { span: 8 },
wrapperCol: { span: 16 }, wrapperCol: { span: 16 },
} }
const columns= ref([
{ title: t('序号'), dataIndex: 'index', key: 'index', sorter: true, customRender: (column) => `${column.index + 1}` ,width: 80},
{ title: t('开始日期'), dataIndex: 'dateFrom', sorter: true, width:150},
{ title: t('结束日期'), dataIndex: 'dateTo', sorter: true, width: 150},
{ title: t('基础量/增量'), dataIndex: 'baseInc', sorter: true, width: 130},
{ title: t('优先级'), dataIndex: 'sort', sorter: true, width: 100},
{ title: t('比值(方/吉焦)'), dataIndex: 'rateM3Gj', sorter: true, width: 150},
{ title: t('月气量(吉焦)'), dataIndex: 'qtyGjMonth', sorter: true, width: 150},
{ title: t('月气量(万方)'), dataIndex: 'qtyM3Month', sorter: true, width: 150},
{ title: t('日气量(吉焦)'), dataIndex: 'qtyGjDay', sorter: true, width: 120},
{ title: t('日气量(万方)'), dataIndex: 'qtyM3Day', sorter: true, width: 120},
{ title: t('照付不议类型'), dataIndex: 'zfbyTypeCode', sorter: true, width: 120},
{ title: t('照付不议比例%/量数值'), dataIndex: 'zfbyValue', sorter: true, width: 120},
{ title: t('备注'), dataIndex: 'note', sorter: true, width: 200},
{ title: t('操作'), dataIndex: 'operation', width: 80, fixed: 'right',align: 'center'},
]);
const selectType = ref() const selectType = ref()
const isShow = ref(false) const isShow = ref(false)
const dataListContractAgree = ref([]) const dataListContractAgree = ref([])
@ -378,10 +302,7 @@
() => props.disabled, () => props.disabled,
(val) => { (val) => {
isDisable.value = val isDisable.value = val
if (val) {
let idx = columns.value.findIndex(v =>v.dataIndex == 'operation')
idx>-1 && columns.value.splice(idx, 1)
}
}, },
{ {
immediate: true immediate: true
@ -427,6 +348,9 @@
v.dateFrom = v.dateFrom ? dayjs(v.dateFrom) : null v.dateFrom = v.dateFrom ? dayjs(v.dateFrom) : null
v.dateTo = v.dateTo ? dayjs(v.dateTo) : null v.dateTo = v.dateTo ? dayjs(v.dateTo) : null
}); });
dataListAppro.value.forEach(v => {
v.approId = v.id
})
} catch (error) { } catch (error) {
spinning.value = false spinning.value = false
@ -488,67 +412,7 @@
} }
return endValue.valueOf() <= startValue.valueOf(); return endValue.valueOf() <= startValue.valueOf();
} }
const dateFromTb = (startValue, index, record) => {
if (!startValue) return
const endValue = dataListContractAgree.value[index]?.dateTo;
if (!startValue || !endValue) {
return false
}
if (startValue.valueOf() > endValue.valueOf()) {
message.warning('结束日期须大于等于开始日期')
dataListContractAgree.value[index].dateFrom = ''
return
}
dayCount(record)
}
const dateToTb = (endValue, index, record) => {
if (!endValue) return
const startValue = dataListContractAgree.value[index]?.dateFrom;
if (!endValue || !startValue) {
return false
}
if (startValue.valueOf() > endValue.valueOf()) {
message.warning('结束日期须大于等于开始日期')
dataListContractAgree.value.splice(index, 1, { ...dataListContractAgree.value[index], dateTo: '' });
return
}
dayCount(record)
}
const numChange = (key, record) => {
if (key == 'qtyGjMonth') {
numCount2(record)
dayCount(record)
}
if (key == 'qtyM3Month') {
numCount1(record)
dayCount(record)
}
if (key == 'rateM3Gj') {
numCount1(record)
numCount2(record)
dayCount(record)
}
}
const numCount1 = (record) => {
// 月气量(吉焦) =月气量(方)qty_m3_month*rate_m3_gj (比值(方/吉焦)
record.qtyGjMonth = (Number(record.qtyM3Month) || 0) * (Number(record.rateM3Gj) || 0)
record.qtyGjMonth = record.qtyGjMonth ? record.qtyGjMonth.toFixed(4) : '0'
}
const numCount2 = (record) => {
// 月气量(方) = 月气量(吉焦) qty_gj_month/rate_m3_gj/10000 显示时字段值/10000保存时页面值*10000
record.qtyM3Month = Number(record.rateM3Gj) ? (Number(record.qtyGjMonth) || 0) /Number(record.rateM3Gj) : 0
record.qtyM3Month = record.qtyM3Month ? record.qtyM3Month.toFixed(4) : '0'
}
const dayCount = (record) => {
// 日气量(吉焦) = 月气量(吉焦)qty_gj_month/开始日期到结束日期的天数;计算结果保留整数
const days = dayjs(record.dateTo).diff(dayjs(record.dateFrom), 'day');
record.qtyGjDay = days ? (Number(record.qtyGjMonth) || 0) /days : 0
record.qtyGjDay = parseInt(record.qtyGjDay)
// 日气量(方) = 月气量(万方)/开始日期到结束日期的天数计算结果保留4位小数显示时字段值/10000保存时页面值*10000
record.qtyM3Day = days ? (Number(record.qtyM3Month) || 0) /days : 0
record.qtyM3Day = record.qtyM3Day ? record.qtyM3Day.toFixed(4) : '0'
}
const onSearch = (val)=> { const onSearch = (val)=> {
openModalDept(true,{isUpdate: false}) openModalDept(true,{isUpdate: false})
} }
@ -569,11 +433,7 @@
openModalDownLoad(true,{isUpdate: false, type: val}) openModalDownLoad(true,{isUpdate: false, type: val})
}); });
} }
const addContractAgree = () => {
dataListContractAgree.value.push({
dateFrom: null, dateTo: null, rateM3Gj: null, qtyGjMonth: null, qtyM3Month: null, qtyGjDay: null, qtyM3Day: null
})
}
const addUpLoad = ()=> { const addUpLoad = ()=> {
dataListPoint.value.push({ dataListPoint.value.push({
"pointUpCode": "", "pointUpCode": "",
@ -635,11 +495,13 @@
let nameList = val.map(v=>v.fullName) let nameList = val.map(v=>v.fullName)
dataListPoint.value[curIdx.value].pointDelyName = nameList.join(',') dataListPoint.value[curIdx.value].pointDelyName = nameList.join(',')
dataListPoint.value[curIdx.value].lngContractPurPngPointSalesList = val || [] dataListPoint.value[curIdx.value].lngContractPurPngPointSalesList = val || []
dataListPoint.value[curIdx.value].lngContractPurPngPointSalesList.forEach(v => {
v.id = ''
v.pointDelyCode = v.code
})
} }
} }
const btnCheck = (record, index) => {
dataListContractAgree.value.splice(index, 1)
}
function unique(arr, u_key) { function unique(arr, u_key) {
const map = new Map() const map = new Map()
arr.forEach((item, index) => { arr.forEach((item, index) => {
@ -658,9 +520,9 @@
async function handleSubmit(type) { async function handleSubmit(type) {
try { try {
await formRef.value.validateFields(); await formRef.value.validateFields();
let arr = JSON.parse(JSON.stringify(dataListContractAgree.value)) let arr = contractQty.value.getQtyList()
for(let i=0; i<arr.length; i++) { for(let i=0; i<arr.length; i++) {
let isFlag = !arr[i].dateFrom || !arr[i].dateTo || !arr[i].baseInc || arr[i].rateM3Gj == null || arr[i].rateM3Gj == '' || arr[i].qtyGjMonth == null || arr[i].qtyGjMonth == ''|| arr[i].qtyM3Month == null || arr[i].qtyM3Month == '' let isFlag = !arr[i].dateFrom || !arr[i].dateTo || !arr[i].baseInc || arr[i].qtyGjMonth == null || arr[i].qtyGjMonth === ''|| arr[i].qtyM3Month == null || arr[i].qtyM3Month === ''
if (isFlag) { if (isFlag) {
message.warn('请完善合同约定必选项') message.warn('请完善合同约定必选项')
return return
@ -670,17 +532,18 @@
arr[i].qtyM3Month = Number(arr[i].qtyM3Month)*10000 arr[i].qtyM3Month = Number(arr[i].qtyM3Month)*10000
arr[i].qtyM3Day = Number(arr[i].qtyM3Day)*10000 arr[i].qtyM3Day = Number(arr[i].qtyM3Day)*10000
} }
let arr1 = []
for(let i=0; i<dataListPoint.value.length; i++) { for(let i=0; i<dataListPoint.value.length; i++) {
if (!dataListPoint.value[i].pointUpCode || !dataListPoint.value[i].transSign || !dataListPoint.value[i].lngContractPurPngPointSalesList.length) { if (!dataListPoint.value[i].pointUpCode || !dataListPoint.value[i].transSign || !dataListPoint.value[i].lngContractPurPngPointSalesList.length) {
message.warn('请完善交割点必选项') message.warn('请完善交割点必选项')
return return
} }
arr1.concat(dataListPoint.value[i].lngContractPurPngPointSalesList || [])
dataListPoint.value[i].lngContractPurPngPointSalesList.forEach(v => {
v.pointUpCode = dataListPoint.value[i].pointUpCode
v.transSign = dataListPoint.value[i].transSign
})
} }
let arr1 = []
dataListAppro.value.forEach(v=>{
v.approId = ''
arr1.concat(v.lngContractPurPngPointSalesList || [])
})
let newArr = arr1.map(v=>v.pointDelyCode) let newArr = arr1.map(v=>v.pointDelyCode)
let codeList = dataListPoint.value.map(v =>v.pointUpCode) let codeList = dataListPoint.value.map(v =>v.pointUpCode)
const isRepeat=codeList.some((item,index,arr)=>arr.indexOf(item)!=index); const isRepeat=codeList.some((item,index,arr)=>arr.indexOf(item)!=index);
@ -772,5 +635,10 @@
color: rgba(0, 0, 0, 0.45); color: rgba(0, 0, 0, 0.45);
// top: 0; // top: 0;
} }
.tbStyle {
border: 1px dashed #d9d9d9;
padding: 10px;
margin-bottom: 10px;
}
</style> </style>

View File

@ -52,7 +52,7 @@ export const columns: BasicColumn[] = [
title: '有效期开始', title: '有效期开始',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
width: 120,
sorter: true, sorter: true,
}, },
@ -61,7 +61,7 @@ export const columns: BasicColumn[] = [
title: '有效期结束', title: '有效期结束',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
width: 120,
sorter: true, sorter: true,
}, },
@ -70,7 +70,7 @@ export const columns: BasicColumn[] = [
title: '状态', title: '状态',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
width: 100,
sorter: true, sorter: true,
}, },
@ -84,11 +84,11 @@ export const columns: BasicColumn[] = [
}, },
{ {
dataIndex: 'transSignName', dataIndex: 'transName',
title: '是否托运', title: '是否托运',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
width: 120,
sorter: true, sorter: true,
}, },

View File

@ -135,7 +135,7 @@
<template #label> <template #label>
<span><span style="color:red">*</span>是否托运</span> <span><span style="color:red">*</span>是否托运</span>
</template> </template>
<a-select v-model:value="item.transSign" style="width: 100%" allow-clear> <a-select v-model:value="item.transSign" :disabled="isDisable" style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.transSignList" :key="item.code" :value="item.code"> <a-select-option v-for="item in optionSelect.transSignList" :key="item.code" :value="item.code">
{{ item.name }} {{ item.name }}
</a-select-option> </a-select-option>
@ -155,80 +155,17 @@
</div> </div>
</Card> </Card>
<Card title="合同约定" :bordered="false" > <Card title="合同约定" :bordered="false" >
<div style="width: 100%"> <contractQtyList :list="dataListContractAgree" :disabled="isDisable" :optionSelect="optionSelect" ref="contractQty"></contractQtyList>
<a-button type="primary" style="margin-bottom: 10px" @click="addContractAgree" v-if="!isDisable">新增行</a-button>
<a-table style="width: 100%" :columns="columns" :data-source="dataListContractAgree" :pagination="false" :scroll="{x: 300}">
<template #headerCell="{ column }">
<template v-if="column.dataIndex == 'dateFrom'">
<span><span class="redStyle">*</span>开始日期</span>
</template>
<template v-if="column.dataIndex == 'dateTo'">
<span><span class="redStyle">*</span>结束日期</span>
</template>
<template v-if="column.dataIndex == 'baseInc'">
<span><span class="redStyle">*</span>基础量/增量</span>
</template>
<template v-if="column.dataIndex == 'sort'">
<span><span class="redStyle">*</span>优先级</span>
</template>
<template v-if="column.dataIndex == 'qtyGjMonth'">
<span><span class="redStyle">*</span>月气量(吉焦)</span>
</template>
<template v-if="column.dataIndex == 'qtyM3Month'">
<span><span class="redStyle">*</span>月气量(万方)</span>
</template>
</template>
<template #bodyCell="{ column, record, index }">
<template v-if="column.dataIndex === 'dateFrom'">
<a-date-picker v-model:value="record.dateFrom" :disabled="isDisable" @change="dateFromTb(record.dateFrom, index, record)" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'dateTo'">
<a-date-picker v-model:value="record.dateTo" :disabled="isDisable" @change="dateToTb(record.dateTo, index, record)" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'sort'">
<a-input-number v-model:value="record.sort" :disabled="isDisable" :min="0" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'baseInc'">
<a-select v-model:value="record.baseInc" :disabled="isDisable" style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.baseIncList" :key="item.code" :value="item.code">
{{ item.name }}
</a-select-option>
</a-select>
</template>
<template v-if="column.dataIndex === 'rateM3Gj'">
<a-input-number v-model:value="record.rateM3Gj" :disabled="isDisable" :min="0" @change="numChange('rateM3Gj', record, index)" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'qtyGjMonth'">
<a-input-number v-model:value="record.qtyGjMonth" :disabled="isDisable" :min="0" @change="numChange('qtyGjMonth', record, index)" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'qtyM3Month'">
<a-input-number v-model:value="record.qtyM3Month" :disabled="isDisable" :min="0" @change="numChange('qtyM3Month', record, index)" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'zfbyTypeCode'">
<a-select v-model:value="record.zfbyTypeCode" :disabled="isDisable" style="width: 100%" allow-clear>
<a-select-option v-for="item in optionSelect.zfbyTypeCodeList" :key="item.code" :value="item.code">
{{ item.name }}
</a-select-option>
</a-select>
</template>
<template v-if="column.dataIndex === 'zfbyValue'">
<a-input-number v-model:value="record.zfbyValue" :disabled="isDisable" :min="0" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'note'">
<a-input v-model:value="record.note" :disabled="isDisable" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'operation'">
<a v-if="!isDisable" style="margin-right: 10px" @click="btnCheck(record, index)">删除</a>
</template>
</template>
</a-table>
</div>
</Card> </Card>
<Card title="附件信息" :bordered="false" > <Card title="附件信息" :bordered="false" >
<UploadList :disabled="isDisable" :list="dataFile" :value="formState.filePath" :tableName="tableName" :columnName="columnName" @change="uploadListChange"/> <UploadList :disabled="isDisable" :list="dataFile" :value="formState.filePath" :tableName="tableName" :columnName="columnName" @change="uploadListChange"/>
</Card> </Card>
<correlationContractFactList :list="dataListContractFact" :disabled="isDisable" @change="getApproContractFactList"></correlationContractFactList> <Card title="关联合同信息" :bordered="false" >
<correlationApproList :list="dataListAppro" :disabled="isDisable" @change="getApproList"></correlationApproList> <correlationContractFactList :list="dataListContractFact" :disabled="isDisable" @change="getApproContractFactList"></correlationContractFactList>
</Card>
<Card title="签报列表" :bordered="false" >
<correlationApproList :list="dataListAppro" :disabled="isDisable" @change="getApproList"></correlationApproList>
</Card>
</a-form> </a-form>
</div> </div>
<deptUserModal @register="register" @success="handleSuccess"/> <deptUserModal @register="register" @success="handleSuccess"/>
@ -264,6 +201,7 @@
import contractFactListModal from '/@/components/common/contractFactListModal.vue'; import contractFactListModal from '/@/components/common/contractFactListModal.vue';
import downloadPointModal from '/@/components/common/downloadPointModal.vue'; import downloadPointModal from '/@/components/common/downloadPointModal.vue';
import customerListModal from '/@/components/common/customerListModal.vue'; import customerListModal from '/@/components/common/customerListModal.vue';
import contractQtyList from '/@/components/common/contractQtyList.vue';
import { useUserStore } from '/@/store/modules/user'; import { useUserStore } from '/@/store/modules/user';
const userStore = useUserStore(); const userStore = useUserStore();
@ -292,7 +230,8 @@
const formId = ref(currentRoute.value?.params?.id); const formId = ref(currentRoute.value?.params?.id);
const pageType = ref(currentRoute.value.query?.type); const pageType = ref(currentRoute.value.query?.type);
const pageId = ref(currentRoute.value.query?.id) const pageId = ref(currentRoute.value.query?.id)
const contractQty = ref()
const spinning = ref(false); const spinning = ref(false);
const curIdx = ref(null) const curIdx = ref(null)
const { notification } = useMessage(); const { notification } = useMessage();
@ -326,22 +265,6 @@
labelCol: { span: 8 }, labelCol: { span: 8 },
wrapperCol: { span: 16 }, wrapperCol: { span: 16 },
} }
const columns= ref([
{ title: t('序号'), dataIndex: 'index', key: 'index', sorter: true, customRender: (column) => `${column.index + 1}` ,width: 80},
{ title: t('开始日期'), dataIndex: 'dateFrom', sorter: true, width:150},
{ title: t('结束日期'), dataIndex: 'dateTo', sorter: true, width: 150},
{ title: t('基础量/增量'), dataIndex: 'baseInc', sorter: true, width: 130},
{ title: t('优先级'), dataIndex: 'sort', sorter: true, width: 100},
{ title: t('比值(方/吉焦)'), dataIndex: 'rateM3Gj', sorter: true, width: 150},
{ title: t('月气量(吉焦)'), dataIndex: 'qtyGjMonth', sorter: true, width: 150},
{ title: t('月气量(万方)'), dataIndex: 'qtyM3Month', sorter: true, width: 150},
{ title: t('日气量(吉焦)'), dataIndex: 'qtyGjDay', sorter: true, width: 120},
{ title: t('日气量(万方)'), dataIndex: 'qtyM3Day', sorter: true, width: 120},
{ title: t('照付不议类型'), dataIndex: 'zfbyTypeCode', sorter: true, width: 120},
{ title: t('照付不议比例%/量数值'), dataIndex: 'zfbyValue', sorter: true, width: 120},
{ title: t('备注'), dataIndex: 'note', sorter: true, width: 200},
{ title: t('操作'), dataIndex: 'operation', width: 80, fixed: 'right',align: 'center'},
]);
const columnsUp = ref([ const columnsUp = ref([
{ title: t('序号'), dataIndex: 'index', key: 'index', sorter: true, customRender: (column) => `${column.index + 1}` ,width: 80}, { title: t('序号'), dataIndex: 'index', key: 'index', sorter: true, customRender: (column) => `${column.index + 1}` ,width: 80},
{ title: t('交割点'), dataIndex: 'pointDelyName', sorter: true, width:150}, { title: t('交割点'), dataIndex: 'pointDelyName', sorter: true, width:150},
@ -400,10 +323,6 @@
() => props.disabled, () => props.disabled,
(val) => { (val) => {
isDisable.value = val isDisable.value = val
if (val) {
let idx = columns.value.findIndex(v =>v.dataIndex == 'operation')
idx>-1 && columns.value.splice(idx, 1)
}
}, },
{ {
immediate: true immediate: true
@ -524,67 +443,6 @@
return false return false
} }
return endValue.valueOf() <= startValue.valueOf(); return endValue.valueOf() <= startValue.valueOf();
}
const dateFromTb = (startValue, index, record) => {
if (!startValue) return
const endValue = dataListContractAgree.value[index]?.dateTo;
if (!startValue || !endValue) {
return false
}
if (startValue.valueOf() > endValue.valueOf()) {
message.warning('结束日期须大于等于开始日期')
dataListContractAgree.value[index].dateFrom = ''
return
}
dayCount(record)
}
const dateToTb = (endValue, index, record) => {
if (!endValue) return
const startValue = dataListContractAgree.value[index]?.dateFrom;
if (!endValue || !startValue) {
return false
}
if (startValue.valueOf() > endValue.valueOf()) {
message.warning('结束日期须大于等于开始日期')
dataListContractAgree.value.splice(index, 1, { ...dataListContractAgree.value[index], dateTo: '' });
return
}
dayCount(record)
}
const numChange = (key, record) => {
if (key == 'qtyGjMonth') {
numCount2(record)
dayCount(record)
}
if (key == 'qtyM3Month') {
numCount1(record)
dayCount(record)
}
if (key == 'rateM3Gj') {
numCount1(record)
numCount2(record)
dayCount(record)
}
}
const numCount1 = (record) => {
// 月气量(吉焦) =月气量(方)qty_m3_month*rate_m3_gj (比值(方/吉焦)
record.qtyGjMonth = (Number(record.qtyM3Month) || 0) * (Number(record.rateM3Gj) || 0)
record.qtyGjMonth = record.qtyGjMonth ? record.qtyGjMonth.toFixed(4) : '0'
}
const numCount2 = (record) => {
// 月气量(方) = 月气量(吉焦) qty_gj_month/rate_m3_gj/10000 显示时字段值/10000保存时页面值*10000
record.qtyM3Month = Number(record.rateM3Gj) ? (Number(record.qtyGjMonth) || 0) /Number(record.rateM3Gj) : 0
record.qtyM3Month = record.qtyM3Month ? record.qtyM3Month.toFixed(4) : '0'
}
const dayCount = (record) => {
// 日气量(吉焦) = 月气量(吉焦)qty_gj_month/开始日期到结束日期的天数;计算结果保留整数
const days = dayjs(record.dateTo).diff(dayjs(record.dateFrom), 'day');
record.qtyGjDay = days ? (Number(record.qtyGjMonth) || 0) /days : 0
record.qtyGjDay = parseInt(record.qtyGjDay)
// 日气量(方) = 月气量(万方)/开始日期到结束日期的天数计算结果保留4位小数显示时字段值/10000保存时页面值*10000
record.qtyM3Day = days ? (Number(record.qtyM3Month) || 0) /days : 0
record.qtyM3Day = record.qtyM3Day ? record.qtyM3Day.toFixed(4) : '0'
} }
const onSearch = (val)=> { const onSearch = (val)=> {
openModalDept(true,{isUpdate: false}) openModalDept(true,{isUpdate: false})
@ -602,11 +460,6 @@
curIdx.value = index curIdx.value = index
openModalDownLoad(true,{isUpdate: false, type: val}) openModalDownLoad(true,{isUpdate: false, type: val})
} }
const addContractAgree = () => {
dataListContractAgree.value.push({
dateFrom: null, dateTo: null, rateM3Gj: null, qtyGjMonth: null, qtyM3Month: null, qtyGjDay: null, qtyM3Day: null
})
}
const addUpLoad = ()=> { const addUpLoad = ()=> {
dataListPoint.value.push({ dataListPoint.value.push({
"pointTransCode": "", "pointTransCode": "",
@ -673,9 +526,6 @@
dataListPoint.value[curIdx.value].purList = await getPurList(dataListPoint.value[curIdx.value].pointDelyCode) dataListPoint.value[curIdx.value].purList = await getPurList(dataListPoint.value[curIdx.value].pointDelyCode)
} }
} }
const btnCheck = (record, index) => {
dataListContractAgree.value.splice(index, 1)
}
function unique(arr, u_key) { function unique(arr, u_key) {
const map = new Map() const map = new Map()
arr.forEach((item, index) => { arr.forEach((item, index) => {
@ -694,9 +544,9 @@
async function handleSubmit(type) { async function handleSubmit(type) {
try { try {
await formRef.value.validateFields(); await formRef.value.validateFields();
let arr = JSON.parse(JSON.stringify(dataListContractAgree.value)) let arr = contractQty.value.getQtyList()
for(let i=0; i<arr.length; i++) { for(let i=0; i<arr.length; i++) {
let isFlag = !arr[i].dateFrom || !arr[i].dateTo || !arr[i].baseInc || arr[i].rateM3Gj == null || arr[i].rateM3Gj == '' || arr[i].qtyGjMonth == null || arr[i].qtyGjMonth == ''|| arr[i].qtyM3Month == null || arr[i].qtyM3Month == '' let isFlag = !arr[i].dateFrom || !arr[i].dateTo || !arr[i].baseInc || arr[i].qtyGjMonth == null || arr[i].qtyGjMonth === ''|| arr[i].qtyM3Month == null || arr[i].qtyM3Month === ''
if (isFlag) { if (isFlag) {
message.warn('请完善合同约定必选项') message.warn('请完善合同约定必选项')
return return

View File

@ -118,7 +118,7 @@ export const formProps: FormProps = {
clearable: false, clearable: false,
disabled: false, disabled: false,
staticOptions: [], staticOptions: [],
defaultSelect: 'Facts', defaultSelect: '',
datasourceType: 'dic', datasourceType: 'dic',
params: { itemId: NewsCategoryDic.ID }, params: { itemId: NewsCategoryDic.ID },
labelField: 'name', labelField: 'name',

View File

@ -114,7 +114,7 @@ export const formProps: FormProps = {
clearable: false, clearable: false,
disabled: false, disabled: false,
staticOptions: [], staticOptions: [],
defaultSelect: 'Facts', defaultSelect: '',
datasourceType: 'dic', datasourceType: 'dic',
params: { itemId: NewsCategoryDic.ID }, params: { itemId: NewsCategoryDic.ID },
labelField: 'name', labelField: 'name',