客户 供应商审批按钮
This commit is contained in:
@ -40,17 +40,17 @@
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="确认函开始日" name="dateCfmFrom">
|
||||
<a-date-picker v-model:value="formState.dateCfmFrom" style="width: 100%" :disabled="isDisable" placeholder="请选择确认函开始日" />
|
||||
<a-date-picker v-model:value="formState.dateCfmFrom" style="width: 100%" :disabled="isDisable" :disabled-date="disabledDateCfmStart" placeholder="请选择确认函开始日" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="确认函结束日" name="dateCfmTo">
|
||||
<a-date-picker v-model:value="formState.dateCfmTo" style="width: 100%" :disabled="isDisable" placeholder="请选择确认函结束日" />
|
||||
<a-date-picker v-model:value="formState.dateCfmTo" style="width: 100%" :disabled="isDisable" :disabled-date="disabledDateCfmEnd" placeholder="请选择确认函结束日" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="供应商" name="cpName">
|
||||
<a-input-search v-model:value="formState.cpName" :disabled="isDisable" placeholder="请选择供应商" readonly @search="onSearchUser"/>
|
||||
<a-input-search v-model:value="formState.cpName" :disabled="isDisable" placeholder="请选择供应商" readonly @search="onSearcSupplier"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
@ -110,20 +110,16 @@
|
||||
<h4>上载点</h4>
|
||||
<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>
|
||||
<div v-for="item in dataListUpLoad">
|
||||
<div v-for="(item, idx) in dataListPoint">
|
||||
<a-row>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="上载点" name="pointUpCode">
|
||||
<a-select v-model:value="formState.pointUpCode" 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 label="上载点" name="pointUpName">
|
||||
<a-input-search v-model:value="item.pointUpName" :disabled="isDisable" placeholder="请选择上载点" readonly @search="onSearchDownLoad('up', idx)"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="是否托运" name="transSign">
|
||||
<a-select v-model:value="formState.transSign" style="width: 100%" allow-clear>
|
||||
<a-select v-model:value="item.transSign" style="width: 100%" allow-clear>
|
||||
<a-select-option v-for="item in optionSelect.transSignList" :key="item.code" :value="item.code">
|
||||
{{ item.name }}
|
||||
</a-select-option>
|
||||
@ -132,12 +128,16 @@
|
||||
</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="请输入备注" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||
<a-textarea v-model:value="item.note" :disabled="isDisable" placeholder="请输入备注" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||
</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="请输入交割点" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||
<a-form-item label="交割点" name="pointDelyName" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||
<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-button :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)"/> -->
|
||||
</div>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@ -146,13 +146,33 @@
|
||||
<Card title="合同约定" :bordered="false" >
|
||||
<div style="width: 100%">
|
||||
<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: 500}">
|
||||
<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" style="width: 100%" />
|
||||
<a-date-picker v-model:value="record.dateFrom" @change="dateFromTb(record.dateFrom, index, record)" style="width: 100%" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'dateTo'">
|
||||
<a-date-picker v-model:value="record.dateTo" style="width: 100%" />
|
||||
<a-date-picker v-model:value="record.dateTo" @change="dateToTb(record.dateTo, index, record)" style="width: 100%" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'sort'">
|
||||
<a-input-number v-model:value="record.sort" :min="0" style="width: 100%" />
|
||||
@ -165,13 +185,13 @@
|
||||
</a-select>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'rateM3Gj'">
|
||||
<a-input-number v-model:value="record.rateM3Gj" :min="0" style="width: 100%" />
|
||||
<a-input-number v-model:value="record.rateM3Gj" :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" :min="0" style="width: 100%" />
|
||||
<a-input-number v-model:value="record.qtyGjMonth" :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" :min="0" style="width: 100%" />
|
||||
<a-input-number v-model:value="record.qtyM3Month" :min="0" @change="numChange('qtyM3Month', record, index)" style="width: 100%" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'zfbyTypeCode'">
|
||||
<a-select v-model:value="record.zfbyTypeCode" style="width: 100%" allow-clear>
|
||||
@ -187,7 +207,7 @@
|
||||
<a-input v-model:value="record.note" style="width: 100%" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'operation'">
|
||||
<a v-if="!isDisable" style="margin-right: 10px" @click="btnCheck('cp', 'delete', record, index)">删除</a>
|
||||
<a v-if="!isDisable" style="margin-right: 10px" @click="btnCheck(record, index)">删除</a>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
@ -203,6 +223,8 @@
|
||||
<deptUserModal @register="register" @success="handleSuccess"/>
|
||||
<deptListModal @register="registerDept" @success="handleSuccessDept" />
|
||||
<contractFactListModal @register="registerContractFact" @success="handleSuccessContractFact" />
|
||||
<downloadPointModal v-if='isShow' @register="registerDownLoad" @success="handleSuccessDownLoad" :selectType="selectType" @cancel="cancel"/>
|
||||
<supplierListModal @register="registerSupplier" @success="handleSuccessSupplier" selectType="radio" />
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
@ -218,9 +240,11 @@
|
||||
import type { Rule } from 'ant-design-vue/es/form';
|
||||
import { getDictionary } from '/@/api/sales/Customer';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { addLngContractFact,updateLngContractFact,getAllCurrency,getAllUser, getLngContractFact } from '/@/api/contract/ContractFact';
|
||||
import { addLngContract,updateLngContract, getLngContract } from '/@/api/contract/ContractPurPng';
|
||||
import { getLngAppro,getCompDept } from '/@/api/approve/Appro';
|
||||
import dayjs from 'dayjs';
|
||||
import { h } from 'vue';
|
||||
import { SearchOutlined } from '@ant-design/icons-vue';
|
||||
import { getAppEnvConfig } from '/@/utils/env';
|
||||
import { message } from 'ant-design-vue';
|
||||
import UploadList from '/@/components/Form/src/components/UploadList.vue';
|
||||
@ -229,9 +253,10 @@
|
||||
import correlationApproList from '/@/components/common/correlationApproList.vue';
|
||||
import correlationContractFactList from '/@/components/common/correlationContractFactList.vue';
|
||||
import contractFactListModal from '/@/components/common/contractFactListModal.vue';
|
||||
|
||||
import { Modal } from 'ant-design-vue';
|
||||
import downloadPointModal from '/@/components/common/downloadPointModal.vue';
|
||||
import supplierListModal from '/@/components/common/supplierListModal.vue';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
|
||||
const userStore = useUserStore();
|
||||
const userInfo = userStore.getUserInfo;
|
||||
|
||||
@ -265,29 +290,26 @@
|
||||
const { t } = useI18n();
|
||||
const formState = reactive({
|
||||
approCode: 'WTJ',
|
||||
dateDraft: dayjs(new Date()),
|
||||
typeCode: 'PP',
|
||||
onlineSign: 'N',
|
||||
cpTableName: 'lng_supplier',
|
||||
curCode: 'CNY'
|
||||
});
|
||||
const [register, { openModal:openModal}] = useModal();
|
||||
const [registerDept, { openModal:openModalDept}] = useModal();
|
||||
const [registerContractFact, { openModal:openModalContractFact}] = useModal();
|
||||
const [registerDownLoad, { openModal:openModalDownLoad}] = useModal();
|
||||
const [registerSupplier, { openModal:openModalSupplier}] = useModal();
|
||||
const rules= reactive({
|
||||
kNo: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
kName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
relTypeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
kTypeCode1: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
periodTypeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
cpCount: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
amountTypeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
settleTypeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
bidSign: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
preApproSign: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
aheadSign: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
tempSign: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
impSign: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
cpName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
prcTypeCode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
uomCode: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
empName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
tel: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
bDeptName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
|
||||
dateTo:[{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
dateFrom:[{ required: true, message: "该项为必填项", trigger: 'change' }]
|
||||
});
|
||||
const layout = {
|
||||
labelCol: { span: 8 },
|
||||
@ -297,11 +319,11 @@
|
||||
{ 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: 180},
|
||||
{ title: t('基础量/增量'), dataIndex: 'baseInc', sorter: true, width: 130},
|
||||
{ title: t('优先级'), dataIndex: 'sort', sorter: true, width: 100},
|
||||
{ title: t('比值(方/吉焦)'), dataIndex: 'rateM3Gj', sorter: true, width: 180},
|
||||
{ title: t('月气量(吉焦)'), dataIndex: 'qtyGjMonth', sorter: true, width: 120},
|
||||
{ title: t('月气量(万方)'), dataIndex: 'qtyM3Month', sorter: true, width: 120},
|
||||
{ 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},
|
||||
@ -309,11 +331,18 @@
|
||||
{ title: t('备注'), dataIndex: 'note', sorter: true, width: 200},
|
||||
{ title: t('操作'), dataIndex: 'operation', width: 80, fixed: 'right',align: 'center'},
|
||||
]);
|
||||
const selectType = ref()
|
||||
const isShow = ref(false)
|
||||
const dataListContractAgree = ref([])
|
||||
const dataFile = ref([]);
|
||||
const dataListAppro = ref([])
|
||||
const dataListContractFact = ref([])
|
||||
const dataListUpLoad = ref([{}])
|
||||
const dataListPoint = ref([{
|
||||
"pointUpCode": "",
|
||||
"transSign": "",
|
||||
"note": null,
|
||||
"lngContractPurPngPointSalesList": []
|
||||
}])
|
||||
let optionSelect= reactive({
|
||||
approCodeList: [],
|
||||
kPriodList: [],
|
||||
@ -365,15 +394,27 @@
|
||||
async function getInfo(id) {
|
||||
spinning.value = true
|
||||
try {
|
||||
let data = await getLngContractFact(id)
|
||||
let data = await getLngContract(id)
|
||||
spinning.value = false
|
||||
Object.assign(formState, {...data})
|
||||
Object.assign(dataListPoint.value, formState.lngContractPurPngPointList || [{}])
|
||||
Object.assign(dataListContractAgree.value, formState.lngContractPurPngQtyList || [])
|
||||
Object.assign(dataFile.value, formState.lngFileUploadList || [])
|
||||
Object.assign(dataList.value, formState.lngContractFactCpList || [])
|
||||
Object.assign(dataListAppro.value, formState.lngApproVoList || [])
|
||||
formState.dateDraft = formState.dateDraft ? dayjs(formState.dateDraft) : null
|
||||
Object.assign(dataListContractFact.value, formState.lngContractFactRelList || [])
|
||||
Object.assign(dataListAppro.value, formState.lngContractApproRelList || [])
|
||||
formState.dateCfmFrom = formState.dateCfmFrom ? dayjs(formState.dateCfmFrom) : null
|
||||
formState.dateCfmTo = formState.dateCfmTo ? dayjs(formState.dateCfmTo) : null
|
||||
formState.dateSign = formState.dateSign ? dayjs(formState.dateSign) : null
|
||||
formState.dateFrom = formState.dateFrom ? dayjs(formState.dateFrom) : null
|
||||
formState.dateTo = formState.dateTo ? dayjs(formState.dateTo) : null
|
||||
formState.prcTypeCode = (formState?.lngContractPurPngList[0] || {}).uomCode
|
||||
formState.periodTypeCode = (formState?.lngContractPurPngList[0] || {}).periodTypeCode
|
||||
formState.uomCode = (formState?.lngContractPurPngList[0] || {}).uomCode
|
||||
|
||||
dataListContractAgree.forEach(v => {
|
||||
v.qtyM3Month = Number(v.qtyM3Month)/10000
|
||||
v.qtyM3Day = Number(v.qtyM3Day)/10000
|
||||
});
|
||||
|
||||
} catch (error) {
|
||||
spinning.value = false
|
||||
@ -414,32 +455,124 @@
|
||||
}
|
||||
return startValue.valueOf() >= endValue.valueOf();
|
||||
}
|
||||
const disabledDateEnd = (endValue) => {
|
||||
const startValue = formState?.dateFrom;
|
||||
const disabledDateEnd = (endValue) => {
|
||||
const startValue = formState?.dateFrom;
|
||||
if (!endValue || !startValue) {
|
||||
return false
|
||||
}
|
||||
return endValue.valueOf() <= startValue.valueOf();
|
||||
}
|
||||
const disabledDateCfmStart = (startValue) => {
|
||||
const endValue = formState?.dateCfmTo;
|
||||
if (!startValue || !endValue) {
|
||||
return false
|
||||
}
|
||||
return startValue.valueOf() >= endValue.valueOf();
|
||||
}
|
||||
const disabledDateCfmEnd = (endValue) => {
|
||||
const startValue = formState?.dateCfmFrom;
|
||||
if (!endValue || !startValue) {
|
||||
return false
|
||||
}
|
||||
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)=> {
|
||||
openModalDept(true,{isUpdate: false})
|
||||
}
|
||||
const onSearcSupplier = () => {
|
||||
openModalSupplier(true,{isUpdate: false})
|
||||
}
|
||||
const onSearchUser = (val)=> {
|
||||
openModal(true,{isUpdate: false})
|
||||
}
|
||||
const onContract = (val)=> {
|
||||
openModalContractFact(true,{isUpdate: false})
|
||||
|
||||
}
|
||||
const onSearchDownLoad = (val, index)=> {
|
||||
selectType.value = val=='up'? 'radio' : 'checkbox'
|
||||
curIdx.value = index
|
||||
isShow.value = true
|
||||
nextTick(() => {
|
||||
openModalDownLoad(true,{isUpdate: false, type: val})
|
||||
});
|
||||
}
|
||||
const addContractAgree = () => {
|
||||
dataListContractAgree.value.push({})
|
||||
dataListContractAgree.value.push({
|
||||
dateFrom: null, dateTo: null, rateM3Gj: null, qtyGjMonth: null, qtyM3Month: null, qtyGjDay: null, qtyM3Day: null
|
||||
})
|
||||
}
|
||||
const addUpLoad = ()=> {
|
||||
dataListUpLoad.value.push({})
|
||||
dataListPoint.value.push({
|
||||
"pointUpCode": "",
|
||||
"transSign": "",
|
||||
"note": null,
|
||||
"lngContractPurPngPointSalesList": []
|
||||
})
|
||||
}
|
||||
const deleteUpLoad = () => {
|
||||
if (dataListUpLoad.value.length == 1) return
|
||||
dataListUpLoad.value.pop()
|
||||
if (dataListPoint.value.length == 1) return
|
||||
dataListPoint.value.pop()
|
||||
}
|
||||
|
||||
const handleSuccess = (val) => {
|
||||
@ -454,9 +587,12 @@
|
||||
formState.comName = info.name
|
||||
formState.comId = info.id
|
||||
}
|
||||
const handleSuccessSupplier = (val) => {
|
||||
formState.cpCode = val[0].suCode
|
||||
formState.cpName = val[0].suName
|
||||
}
|
||||
const handleSuccessContractFact = (val) => {
|
||||
val.forEach(v => {
|
||||
v.approId = v.id
|
||||
v.id = null
|
||||
})
|
||||
if (!dataListContractFact.value.length) {
|
||||
@ -475,17 +611,22 @@
|
||||
})
|
||||
dataListContractFact.value = unique([...dataListContractFact.value, ...arr], 'kNo')
|
||||
}
|
||||
const btnCheck = (type, btn, record, index) => {
|
||||
curIdx.value = null
|
||||
if (type == 'cp') {
|
||||
if (btn == 'delete') {
|
||||
dataList.value.splice(index, 1)
|
||||
}
|
||||
if (btn == 'edit') {
|
||||
openModalContract(true, {record: record,isUpdate: true});
|
||||
}
|
||||
const cancel = () => {
|
||||
isShow.value = false
|
||||
}
|
||||
const handleSuccessDownLoad = (val, type) => {
|
||||
isShow.value = false
|
||||
if (type == 'up') {
|
||||
dataListPoint.value[curIdx.value].pointUpCode = val[0].code
|
||||
dataListPoint.value[curIdx.value].pointUpName = val[0].fullName
|
||||
} else {
|
||||
let nameList = val.map(v=>v.fullName)
|
||||
dataListPoint.value[curIdx.value].pointDelyName = nameList.join(',')
|
||||
dataListPoint.value[curIdx.value].lngContractPurPngPointSalesList = val || []
|
||||
}
|
||||
|
||||
}
|
||||
const btnCheck = (record, index) => {
|
||||
dataListContractAgree.value.splice(index, 1)
|
||||
}
|
||||
function unique(arr, u_key) {
|
||||
const map = new Map()
|
||||
@ -505,23 +646,41 @@
|
||||
async function handleSubmit(type) {
|
||||
try {
|
||||
await formRef.value.validateFields();
|
||||
|
||||
if (Number(formState.cpCount) !== dataList.value.length) {
|
||||
notification.warning({
|
||||
message: 'Tip',
|
||||
description: '相对数量需与相对方信息个数一致'
|
||||
});
|
||||
return
|
||||
let arr = JSON.parse(JSON.stringify(dataListContractAgree.value))
|
||||
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 == ''
|
||||
if (isFlag) {
|
||||
message.warn('请完善合同约定必选项')
|
||||
return
|
||||
}
|
||||
arr[i].dateFrom = dayjs(arr[i].dateFrom).format('YYYY-MM-DD HH:mm:ss')
|
||||
arr[i].dateTo = dayjs(arr[i].dateTo).format('YYYY-MM-DD HH:mm:ss')
|
||||
arr[i].qtyM3Month = Number(arr[i].qtyM3Month)*10000
|
||||
arr[i].qtyM3Day = Number(arr[i].qtyM3Day)*10000
|
||||
}
|
||||
dataListAppro.value.forEach(v=>{
|
||||
v.approId = ''
|
||||
})
|
||||
let obj = {
|
||||
...formState,
|
||||
lngContractPurPngPointList: dataListPoint.value,
|
||||
lngContractPurPngQtyList: arr,
|
||||
lngFileUploadList: dataFile.value,
|
||||
lngContractFactCpList: dataList.value,
|
||||
lngContractApproRelList: dataListAppro.value
|
||||
lngContractFactRelList: dataListContractFact.value,
|
||||
lngContractApproRelList: dataListAppro.value,
|
||||
lngContractPurPngList: [
|
||||
{
|
||||
...formState.lngContractPurPngList[0],
|
||||
"kId": formState.id,
|
||||
"prcTypeCode": formState.prcTypeCode,
|
||||
"periodTypeCode": formState.periodTypeCode,
|
||||
"uomCode": formState.uomCode,
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
spinning.value = true;
|
||||
let request = !formState.id ? addLngContractFact :updateLngContractFact
|
||||
let request = !formState.id ? addLngContract :updateLngContract
|
||||
|
||||
try {
|
||||
const data = await request(obj);
|
||||
@ -572,5 +731,13 @@
|
||||
margin-bottom: 12px;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
.redStyle {
|
||||
color: red;
|
||||
}
|
||||
.iconStyle {
|
||||
position: absolute;
|
||||
color: rgba(0, 0, 0, 0.45);
|
||||
// top: 0;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@ -211,15 +211,27 @@
|
||||
}
|
||||
|
||||
function handleEdit(record: Recordable) {
|
||||
|
||||
router.push({
|
||||
path: '/form/ContractPurPng/' + record.id + '/updateForm',
|
||||
query: {
|
||||
if (schemaIdComputedRef.value) {
|
||||
router.push({
|
||||
path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow',
|
||||
query: {
|
||||
formPath: 'contract/ContractPurPng',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
formId:currentRoute.value.meta.formId,
|
||||
type:'edit',
|
||||
id: record.id
|
||||
}
|
||||
});
|
||||
} else {
|
||||
router.push({
|
||||
path: '/form/ContractPurPng/' + record.id + '/updateForm',
|
||||
query: {
|
||||
formPath: 'contract/ContractPurPng',
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
function handleDelete(record: Recordable) {
|
||||
deleteList([record.id]);
|
||||
|
||||
Reference in New Issue
Block a user