加工 管输
This commit is contained in:
@ -53,11 +53,6 @@
|
||||
<a-input-search v-model:value="formState.bDeptName" disabled placeholder="请选择业务部门" readonly @search="onSearch"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="电话" name="tel">
|
||||
<a-input v-model:value="formState.tel" :disabled="isDisable" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="币种" name="curCode">
|
||||
<a-select v-model:value="formState.curCode" :disabled="isDisable" placeholder="请选择币种" style="width: 100%" allow-clear>
|
||||
@ -153,9 +148,6 @@
|
||||
<a-button type="primary" style="margin-bottom: 10px" @click="handleAdd(idx)" v-if="!isDisable">新增行</a-button>
|
||||
<a-table style="width: 100%" :columns="columnsPrice" :data-source="item.lngPriceProcDtlList" :pagination="false">
|
||||
<template #headerCell="{ column }">
|
||||
<template v-if="column.dataIndex == 'sortDesc'">
|
||||
<span><span class="redStyle">*</span>约定</span>
|
||||
</template>
|
||||
<template v-if="column.dataIndex == 'qtyGj'">
|
||||
<span><span class="redStyle">*</span>阶梯内气量(吉焦)</span>
|
||||
</template>
|
||||
@ -165,6 +157,9 @@
|
||||
<template v-if="column.dataIndex == 'priceLngGj'">
|
||||
<span><span class="redStyle">*</span>液态加工费率(元/吉焦)</span>
|
||||
</template>
|
||||
<template v-if="column.dataIndex == 'rateTonGj'">
|
||||
<span><span class="redStyle">*</span>吨/吉焦</span>
|
||||
</template>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-if="column.dataIndex === 'sortDesc'">
|
||||
@ -225,7 +220,7 @@
|
||||
import type { Rule } from 'ant-design-vue/es/form';
|
||||
import { getDictionary } from '/@/api/sales/Customer';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { addLngContract,updateLngContract, getLngContract } from '/@/api/contract/ContractProc';
|
||||
import { addLngContract,updateLngContract, getLngContract,getParameter } from '/@/api/contract/ContractProc';
|
||||
import { getLngAppro,getCompDept } from '/@/api/approve/Appro';
|
||||
import dayjs from 'dayjs';
|
||||
import { h } from 'vue';
|
||||
@ -242,6 +237,7 @@
|
||||
import supplierListModal from '/@/components/common/supplierListModal.vue';
|
||||
import { getAllCurrency } from '/@/api/contract/ContractFact';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import { DataFormat, FormatOption, DATE_FORMAT, FormatType } from '/@/utils/dataFormat';
|
||||
|
||||
const userStore = useUserStore();
|
||||
const userInfo = userStore.getUserInfo;
|
||||
@ -299,6 +295,7 @@
|
||||
labelCol: { span: 8 },
|
||||
wrapperCol: { span: 16 },
|
||||
}
|
||||
const rateCode = ref()
|
||||
const curIdx = ref(null)
|
||||
const dataFile = ref([]);
|
||||
const dataListAppro = ref([])
|
||||
@ -315,7 +312,8 @@
|
||||
}
|
||||
])
|
||||
const columnsPrice= ref([
|
||||
{ title: t('序号'), dataIndex: 'index', key: 'index', customRender: (column) => `${column.index + 1}` ,width: 80},
|
||||
// { title: t('序号'), dataIndex: 'index', key: 'index', customRender: (column) => `${column.index + 1}` ,width: 80},
|
||||
{ title: t('阶梯'), dataIndex: 'sort',width: 80},
|
||||
{ title: t('约定'), dataIndex: 'sortDesc'},
|
||||
{ title: t('吨/吉焦'), dataIndex: 'rateTonGj', width: 150},
|
||||
{ title: t('阶梯内气量(吉焦)'), dataIndex: 'qtyGj', width: 200},
|
||||
@ -348,7 +346,7 @@
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
onMounted(() => {
|
||||
onMounted(async () => {
|
||||
getOption()
|
||||
if (pageId.value) {
|
||||
getInfo(pageId.value)
|
||||
@ -357,6 +355,8 @@
|
||||
formState.empId = userInfo.id
|
||||
formState.tel = userInfo.mobile
|
||||
}
|
||||
let a = await getParameter({code: 'RATE_TON_GJ'})||[]
|
||||
rateCode.value = a[0]?.valueNum1
|
||||
|
||||
});
|
||||
const dateToCodeChange = (idx, val) => {
|
||||
@ -378,7 +378,7 @@
|
||||
const disabledCurrentYear = (current) => {
|
||||
let date = new Date().getFullYear()
|
||||
if (dataListPrice.value[curIdx.value].dateFromNew) {
|
||||
date = new Date(dataListPrice.value[curIdx.value].dateFromNew,).getFullYear()
|
||||
date = new Date(dataListPrice.value[curIdx.value].dateFromNew).getFullYear()
|
||||
}
|
||||
return current && new Date(current).getFullYear() !== date;
|
||||
};
|
||||
@ -407,6 +407,16 @@
|
||||
v.dateFromNew = v.dateFrom ? dayjs(v.dateFrom) : null
|
||||
v.dateToF = v.dateToF ? dayjs(v.dateToF) : null
|
||||
v.dateToY = v.dateToY ? dayjs(v.dateToY) : null
|
||||
|
||||
v.lngPriceProcDtlList = v.lngPriceProcDtlList || []
|
||||
if (isDisable.value) {
|
||||
v.lngPriceProcDtlList =DataFormat.format(v.lngPriceProcDtlList, [
|
||||
FormatOption.createQty('qtyGj'),
|
||||
FormatOption.createQty('rateTonGj'),
|
||||
FormatOption.createAmt('priceLngGj'),
|
||||
FormatOption.createAmt('pricePngGj'),
|
||||
]);
|
||||
}
|
||||
})
|
||||
dataListAppro.value.forEach(v => {
|
||||
// v.approId = v.id
|
||||
@ -495,10 +505,11 @@
|
||||
})
|
||||
}
|
||||
const deleteProc= (index) => {
|
||||
if (dataListPrice.value.length ==1)return
|
||||
dataListPrice.value.splice(index, 1)
|
||||
}
|
||||
const handleAdd = (idx)=> {
|
||||
dataListPrice.value[idx].lngPriceProcDtlList.push({sortDesc: '',rateTonGj:'',qtyGj:'',pricePngGj:'',priceLngGj:'',sort:dataListPrice.value[idx].lngPriceProcDtlList.length+1})
|
||||
dataListPrice.value[idx].lngPriceProcDtlList.push({sortDesc: '',rateTonGj:rateCode.value,qtyGj:'',pricePngGj:'',priceLngGj:'',sort:dataListPrice.value[idx].lngPriceProcDtlList.length+1})
|
||||
}
|
||||
const handleDelete= (idx,index) => {
|
||||
dataListPrice.value[idx].lngPriceProcDtlList.splice(index, 1)
|
||||
@ -580,9 +591,9 @@
|
||||
dataListPrice.value[k].staCode = formState.lngContractProcList[0].staCode
|
||||
let arr = dataListPrice.value[k].lngPriceProcDtlList || []
|
||||
for(let i=0; i<arr.length; i++) {
|
||||
let isFlag = arr[i].qtyGj == null || arr[i].qtyGj === ''|| arr[i].pricePngGj == null || arr[i].pricePngGj === '' || arr[i].priceLngGj == null || arr[i].priceLngGj === ''
|
||||
let isFlag = arr[i].rateTonGj == null || arr[i].rateTonGj === ''|| arr[i].pricePngGj == null || arr[i].pricePngGj === '' || arr[i].priceLngGj == null || arr[i].priceLngGj === ''
|
||||
let isFlagNew = false
|
||||
if (arr[i].sort <arr.length && (arr[i].sortDesc == '' || arr[i].sortDesc == null)) {
|
||||
if (arr[i].sort <arr.length && (arr[i].qtyGj == '' || arr[i].qtyGj == null)) {
|
||||
isFlagNew = true
|
||||
}
|
||||
if (isFlag || isFlagNew) {
|
||||
|
||||
Reference in New Issue
Block a user