Merge branch 'dev' of http://47.94.165.164:13000/geg-gas/geg-gas-web into dev
This commit is contained in:
@ -8,10 +8,21 @@ enum Api {
|
|||||||
List = '/plan/planYearDemandHdr/list',
|
List = '/plan/planYearDemandHdr/list',
|
||||||
Info = '/plan/planYearDemandHdr/info',
|
Info = '/plan/planYearDemandHdr/info',
|
||||||
LngPlanYearDemandHdr = '/plan/planYearDemandHdr',
|
LngPlanYearDemandHdr = '/plan/planYearDemandHdr',
|
||||||
|
reject = '/plan/planYearDemandHdr/reject',
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
export async function rejectLngPlanYearDemandHdr(lngPlanYearDemandHdr: Recordable, mode: ErrorMessageMode = 'modal') {
|
||||||
|
return defHttp.post<boolean>(
|
||||||
|
{
|
||||||
|
url: Api.reject,
|
||||||
|
params: lngPlanYearDemandHdr,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorMessageMode: mode,
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -12,11 +12,47 @@ enum Api {
|
|||||||
save = '/plan/planYearDemandHdrEc/save',
|
save = '/plan/planYearDemandHdrEc/save',
|
||||||
saveAndSubmit = '/plan/planYearDemandHdrEc/saveAndSubmit',
|
saveAndSubmit = '/plan/planYearDemandHdrEc/saveAndSubmit',
|
||||||
toChange = '/plan/planYearDemandHdrEc/toChange',
|
toChange = '/plan/planYearDemandHdrEc/toChange',
|
||||||
|
CuPlanYear = '/magic-api/plan/planYearDemandHdrSelectCuPlanYear',
|
||||||
|
CuPlanYearVerNo = '/magic-api/plan/planYearDemandHdrSelectCuPlanYearVerNo',
|
||||||
|
CheckCuPlanState = '/magic-api/plan/planYearDemandHdrCheckCuPlanState',
|
||||||
|
|
||||||
Export = '/plan/planYearDemandHdrEc/export',
|
Export = '/plan/planYearDemandHdrEc/export',
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
export async function checkCuPlanState(cuCode: string, mode: ErrorMessageMode = 'modal') {
|
||||||
|
return defHttp.get<any>(
|
||||||
|
{ url: Api.CheckCuPlanState, params: { cuCode } },
|
||||||
|
{ errorMessageMode: mode },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
export async function getCuMaxPlanYear(cuCode: string, mode: ErrorMessageMode = 'modal') {
|
||||||
|
return defHttp.get<any>(
|
||||||
|
{ url: Api.CuPlanYear, params: { cuCode } },
|
||||||
|
{ errorMessageMode: mode },
|
||||||
|
);
|
||||||
|
}
|
||||||
|
export async function getCuPlanYearVerNo(cuCode: string, planYear: string, mode: ErrorMessageMode = 'modal') {
|
||||||
|
return defHttp.get<any>(
|
||||||
|
{
|
||||||
|
url: Api.CuPlanYearVerNo,
|
||||||
|
params: { cuCode, planYear },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorMessageMode: mode,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
export async function getCuPlanYear(cuCode: String, mode: ErrorMessageMode = 'modal') {
|
||||||
|
return defHttp.get<LngPlanYearDemandHdrPageModel>(
|
||||||
|
{
|
||||||
|
url: Api.CuPlanYear,
|
||||||
|
params: { cuCode },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
errorMessageMode: mode,
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
export async function getUpdateLngPlanYearDemandHdr(id: String, mode: ErrorMessageMode = 'modal') {
|
export async function getUpdateLngPlanYearDemandHdr(id: String, mode: ErrorMessageMode = 'modal') {
|
||||||
return defHttp.get<LngPlanYearDemandHdrPageModel>(
|
return defHttp.get<LngPlanYearDemandHdrPageModel>(
|
||||||
|
|||||||
@ -18,7 +18,7 @@ export const searchFormSchema: FormSchema[] = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'cuName',
|
field: 'cuSname',
|
||||||
label: '客户',
|
label: '客户',
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
},
|
},
|
||||||
@ -44,7 +44,7 @@ export const columns: BasicColumn[] = [
|
|||||||
title: '年度',
|
title: '年度',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width: 100,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -53,12 +53,12 @@ export const columns: BasicColumn[] = [
|
|||||||
title: '版本号',
|
title: '版本号',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width: 100,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
dataIndex: 'cuName',
|
dataIndex: 'cuSname',
|
||||||
title: '客户',
|
title: '客户',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
@ -89,7 +89,7 @@ export const columns: BasicColumn[] = [
|
|||||||
title: '状态',
|
title: '状态',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width: 80,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@ -180,11 +180,16 @@ import Index from '/@/views/sys/error-log/index.vue';
|
|||||||
dataList.value.forEach((v, idx)=> {
|
dataList.value.forEach((v, idx)=> {
|
||||||
// LNG(万方)=LNG(吨)*气化率/10000;
|
// LNG(万方)=LNG(吨)*气化率/10000;
|
||||||
v.lngNum = Number(v.lng || 0) * Number(rateTonM3.value || 0)/10000
|
v.lngNum = Number(v.lng || 0) * Number(rateTonM3.value || 0)/10000
|
||||||
// v.lngNum = Number(v.lngNum) ? v.lngNum : ''
|
|
||||||
// 小计=管道气(万方)+LNG(万方);
|
// 小计=管道气(万方)+LNG(万方);
|
||||||
v.total = Number(v.qty || 0) + Number(v.lngNum || 0)
|
v.total = Number(v.qty || 0) + Number(v.lngNum || 0)
|
||||||
// v.total = Number(v.total) ? v.total : ''
|
|
||||||
// console.log(Number(v.total), 52354)
|
let a = (v.lng==null || v.lng==undefined)
|
||||||
|
let b = (v.qty==null || v.qty==undefined)
|
||||||
|
v.lngNum = (a&&b) ? null: v.lngNum
|
||||||
|
v.total = (a&&b) ? null: v.total
|
||||||
|
v.lng = (v.lng==null || v.lng==undefined) ? null : v.lng
|
||||||
|
v.qty = (v.qty==null || v.qty==undefined) ? null: v.qty
|
||||||
|
|
||||||
if (idx<12) {
|
if (idx<12) {
|
||||||
qytTotal+=(Number(v.qty)||0)
|
qytTotal+=(Number(v.qty)||0)
|
||||||
lngTotal+=(Number(v.lng)||0)
|
lngTotal+=(Number(v.lng)||0)
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
import { ref, computed, onMounted, onUnmounted, } from 'vue';
|
import { ref, computed, onMounted, onUnmounted, } from 'vue';
|
||||||
|
|
||||||
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
|
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
|
||||||
import { getLngPlanYearDemandHdrPage, deleteLngPlanYearDemandHdr} from '/@/api/plan/PlanYearDemandHdr';
|
import { getLngPlanYearDemandHdrPage, deleteLngPlanYearDemandHdr, rejectLngPlanYearDemandHdr} from '/@/api/plan/PlanYearDemandHdr';
|
||||||
import { PageWrapper } from '/@/components/Page';
|
import { PageWrapper } from '/@/components/Page';
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
import { useI18n } from '/@/hooks/web/useI18n';
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
@ -104,7 +104,7 @@
|
|||||||
showResetButton: true,
|
showResetButton: true,
|
||||||
},
|
},
|
||||||
beforeFetch: (params) => {
|
beforeFetch: (params) => {
|
||||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
|
return { ...params, FormId: formIdComputedRef.value, PK: 'id',page: params.limit };
|
||||||
},
|
},
|
||||||
afterFetch: (res) => {
|
afterFetch: (res) => {
|
||||||
tableRef.value.setToolBarWidth();
|
tableRef.value.setToolBarWidth();
|
||||||
@ -115,7 +115,7 @@
|
|||||||
|
|
||||||
striped: false,
|
striped: false,
|
||||||
actionColumn: {
|
actionColumn: {
|
||||||
width: 160,
|
width: 140,
|
||||||
title: '操作',
|
title: '操作',
|
||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
slots: { customRender: 'action' },
|
slots: { customRender: 'action' },
|
||||||
@ -128,40 +128,17 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
function dbClickRow(record) {
|
function dbClickRow(record) {
|
||||||
if (!actionButtonConfig?.value.some(element => element.code == 'view')) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const { processId, taskIds, schemaId } = record.workflowData || {};
|
|
||||||
if (taskIds && taskIds.length) {
|
|
||||||
router.push({
|
router.push({
|
||||||
path: '/flow/' + schemaId + '/' + (processId || '') + '/approveFlow',
|
path: '/plan/PlanYearDemandHdr/createForm',
|
||||||
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/PlanYearDemandHdr/' + record.id + '/viewForm',
|
|
||||||
query: {
|
query: {
|
||||||
formPath: 'plan/PlanYearDemandHdr',
|
formPath: 'plan/PlanYearDemandHdr',
|
||||||
formName: formName,
|
formName: '查看' + formName,
|
||||||
formId:currentRoute.value.meta.formId
|
formId: currentRoute.value.meta.formId,
|
||||||
}
|
id: record.id,
|
||||||
|
type: 'view',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function buttonClick(code) {
|
function buttonClick(code) {
|
||||||
|
|
||||||
@ -180,16 +157,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleView(record: Recordable) {
|
function handleView(record: Recordable) {
|
||||||
router.push({
|
dbClickRow(record);
|
||||||
path: '/plan/PlanYearDemandHdr/createForm',
|
|
||||||
query: {
|
|
||||||
formPath: 'plan/PlanYearDemandHdr',
|
|
||||||
formName: '查看' + formName,
|
|
||||||
formId: currentRoute.value.meta.formId,
|
|
||||||
id: record.id,
|
|
||||||
type: 'view',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
function handleReject (record: Recordable) {
|
function handleReject (record: Recordable) {
|
||||||
curData.value = record
|
curData.value = record
|
||||||
@ -200,11 +168,10 @@
|
|||||||
}
|
}
|
||||||
const handleRejectReply = async (val) => {
|
const handleRejectReply = async (val) => {
|
||||||
let obj = {
|
let obj = {
|
||||||
"result": "R",
|
"reply": val.reply,
|
||||||
"remark": val.reply,
|
"id": curData.value.id
|
||||||
"data": [{datePlan: curData.value.datePlan}]
|
|
||||||
}
|
}
|
||||||
await approveLngPngAppro(obj)
|
await rejectLngPlanYearDemandHdr(obj)
|
||||||
isOpen.value = false
|
isOpen.value = false
|
||||||
handleSuccess();
|
handleSuccess();
|
||||||
notification.success({
|
notification.success({
|
||||||
@ -233,27 +200,29 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
function getActions(record: Recordable):ActionItem[] {
|
function getActions(record: Recordable):ActionItem[] {
|
||||||
|
let actionsList: ActionItem[] = []
|
||||||
const actionsList: ActionItem[] = actionButtonConfig.value?.map((button) => {
|
let rejectBtn: ActionItem[] = []
|
||||||
if (!record.workflowData?.processId) {
|
let viewBtn: ActionItem[] = [];
|
||||||
return {
|
actionButtonConfig.value?.map((button) => {
|
||||||
icon: button?.icon,
|
if (['view', 'copyData','compare', 'datalog', 'export'].includes(button.code)) {
|
||||||
tooltip: button?.name,
|
viewBtn.push({
|
||||||
color: button.code === 'delete' ? 'error' : undefined,
|
|
||||||
onClick: btnEvent[button.code].bind(null, record),
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
if (button.code === 'view') {
|
|
||||||
return {
|
|
||||||
icon: button?.icon,
|
icon: button?.icon,
|
||||||
tooltip: button?.name,
|
tooltip: button?.name,
|
||||||
onClick: btnEvent[button.code].bind(null, record),
|
onClick: btnEvent[button.code].bind(null, record),
|
||||||
};
|
});
|
||||||
} else {
|
|
||||||
return {};
|
|
||||||
}
|
}
|
||||||
|
if (['reject'].includes(button.code)) {
|
||||||
|
rejectBtn.push({
|
||||||
|
icon: button?.icon,
|
||||||
|
tooltip: button?.name,
|
||||||
|
onClick: btnEvent[button.code].bind(null, record),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (record.approCode == 'YTJ' && record.maxPlanYear == record.planYear && record.lastSign=='Y') {
|
||||||
|
actionsList = actionsList.concat(rejectBtn);
|
||||||
|
}
|
||||||
|
actionsList = actionsList.concat(viewBtn);
|
||||||
return actionsList;
|
return actionsList;
|
||||||
}
|
}
|
||||||
async function mergeCustomListRenderConfig(){
|
async function mergeCustomListRenderConfig(){
|
||||||
|
|||||||
@ -26,7 +26,7 @@ export const columns: BasicColumn[] = [
|
|||||||
title: '年度',
|
title: '年度',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width: 100,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ export const columns: BasicColumn[] = [
|
|||||||
title: '版本号',
|
title: '版本号',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width: 100,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ export const columns: BasicColumn[] = [
|
|||||||
title: '状态',
|
title: '状态',
|
||||||
componentType: 'input',
|
componentType: 'input',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
width: 80,
|
||||||
sorter: true,
|
sorter: true,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="8">
|
<a-col :span="8">
|
||||||
<a-form-item label="年度" name="planYear">
|
<a-form-item label="年度" name="planYear">
|
||||||
<a-date-picker v-if="!pageType" :inputReadOnly="true" v-model:value="formState.planYear" picker='year' style="width: 100%" :disabled="isDisable||pageType=='edit'" placeholder="请选择" @change="yearChange" />
|
<a-date-picker v-if="!pageType" :inputReadOnly="true" v-model:value="formState.planYear" picker='year' style="width: 100%" :disabled="isDisable||pageType=='edit'" placeholder="请选择" @change="yearChange" :disabledDate="disabledYear" />
|
||||||
<div v-else>{{ formState.planYear }}</div>
|
<div v-else>{{ formState.planYear }}</div>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
@ -34,9 +34,9 @@
|
|||||||
{{ (optionSelect.approCodeList.find(v=>v.code == formState.approCode) || {}).name }}
|
{{ (optionSelect.approCodeList.find(v=>v.code == formState.approCode) || {}).name }}
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="8">
|
<a-col :span="24">
|
||||||
<a-form-item label="备注" name="note">
|
<a-form-item label="备注" name="note" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||||
{{ formState.note }}
|
<a-textarea v-model:value="formState.note" :disabled="isDisable" placeholder="请输入备注,最多200字" :maxlength="200" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
@ -86,7 +86,7 @@
|
|||||||
import { getDictionary } from '/@/api/sales/Customer';
|
import { getDictionary } from '/@/api/sales/Customer';
|
||||||
import { useModal } from '/@/components/Modal';
|
import { useModal } from '/@/components/Modal';
|
||||||
import ImportModal from '/@/components/Import/src/ImportModal.vue';
|
import ImportModal from '/@/components/Import/src/ImportModal.vue';
|
||||||
import { saveLngPlanYearDemandHdr,saveAndSubmitLngPlanYearDemandHdr,getUpdateLngPlanYearDemandHdr, getLngPlanYearDemandHdr, exportLngPlanYearDemandHdr} from '/@/api/plan/PlanYearDemandHdrEc';
|
import { saveLngPlanYearDemandHdr,saveAndSubmitLngPlanYearDemandHdr,getUpdateLngPlanYearDemandHdr, getLngPlanYearDemandHdr, exportLngPlanYearDemandHdr,getCuPlanYear, getCuPlanYearVerNo} from '/@/api/plan/PlanYearDemandHdrEc';
|
||||||
import { downloadByData } from '/@/utils/file/download';
|
import { downloadByData } from '/@/utils/file/download';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { getAppEnvConfig } from '/@/utils/env';
|
import { getAppEnvConfig } from '/@/utils/env';
|
||||||
@ -126,7 +126,7 @@
|
|||||||
const { notification } = useMessage();
|
const { notification } = useMessage();
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
||||||
const formState = reactive({
|
const formState = reactive<Recordable>({
|
||||||
approCode: 'WTJ'
|
approCode: 'WTJ'
|
||||||
});
|
});
|
||||||
const rateTonM3 = ref()
|
const rateTonM3 = ref()
|
||||||
@ -142,6 +142,7 @@
|
|||||||
{ title: t('小计(万方)'), dataIndex: 'total'},
|
{ title: t('小计(万方)'), dataIndex: 'total'},
|
||||||
]);
|
]);
|
||||||
formState.cuCode = currentRoute.value.query?.cuCode
|
formState.cuCode = currentRoute.value.query?.cuCode
|
||||||
|
const curYear = ref()
|
||||||
const layout = {
|
const layout = {
|
||||||
labelCol: { span: 8 },
|
labelCol: { span: 8 },
|
||||||
wrapperCol: { span: 16 },
|
wrapperCol: { span: 16 },
|
||||||
@ -186,7 +187,12 @@
|
|||||||
}
|
}
|
||||||
getSysRate()
|
getSysRate()
|
||||||
getOption()
|
getOption()
|
||||||
|
getYear()
|
||||||
});
|
});
|
||||||
|
async function getYear () {
|
||||||
|
let data = await getCuPlanYear(formState.cuCode)
|
||||||
|
curYear.value = data?.planYear
|
||||||
|
}
|
||||||
async function getSysRate () {
|
async function getSysRate () {
|
||||||
let a = await getParameter({code: 'RATE_TON_M3'})||[]
|
let a = await getParameter({code: 'RATE_TON_M3'})||[]
|
||||||
rateTonM3.value = a[0]?.valueNum1
|
rateTonM3.value = a[0]?.valueNum1
|
||||||
@ -204,6 +210,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const updateData = (data)=> {
|
const updateData = (data)=> {
|
||||||
|
dataList.value = []
|
||||||
let arr = data?.lngPlanYearDemandList || [];
|
let arr = data?.lngPlanYearDemandList || [];
|
||||||
let objPng = {}
|
let objPng = {}
|
||||||
let objLng = {}
|
let objLng = {}
|
||||||
@ -266,6 +273,13 @@
|
|||||||
if (!record) {
|
if (!record) {
|
||||||
v.lngNum = Number(v.lng || 0) * Number(rateTonM3.value || 0)/10000
|
v.lngNum = Number(v.lng || 0) * Number(rateTonM3.value || 0)/10000
|
||||||
v.total = Number(v.qty || 0) + Number(v.lngNum || 0)
|
v.total = Number(v.qty || 0) + Number(v.lngNum || 0)
|
||||||
|
|
||||||
|
let a = (v.lng==null || v.lng==undefined)
|
||||||
|
let b = (v.qty==null || v.qty==undefined)
|
||||||
|
v.lngNum = (a&&b) ? '': v.lngNum
|
||||||
|
v.total = (a&&b) ? '': v.total
|
||||||
|
v.lng = (v.lng!=null || v.lng!=undefined) ? v.lng : ''
|
||||||
|
v.qty = (v.qty!=null || v.qty!=undefined) ? v.qty : ''
|
||||||
}
|
}
|
||||||
if (idx<12) {
|
if (idx<12) {
|
||||||
qytTotal+=(Number(v.qty)||0)
|
qytTotal+=(Number(v.qty)||0)
|
||||||
@ -306,8 +320,19 @@
|
|||||||
async function getOption() {
|
async function getOption() {
|
||||||
optionSelect.approCodeList = await getDictionary('LNG_APPRO2')
|
optionSelect.approCodeList = await getDictionary('LNG_APPRO2')
|
||||||
}
|
}
|
||||||
const yearChange = (val) => {
|
const disabledYear = (current: dayjs.Dayjs) => {
|
||||||
|
const minYear = Math.max(
|
||||||
|
curYear.value ? Number(curYear.value) : 0,
|
||||||
|
dayjs().year()
|
||||||
|
);
|
||||||
|
return current && current.year() < minYear;
|
||||||
|
}
|
||||||
|
|
||||||
|
const yearChange = async (val: dayjs.Dayjs) => {
|
||||||
|
if (!val) return;
|
||||||
|
const planYear = dayjs(val).format('YYYY');
|
||||||
|
const data = await getCuPlanYearVerNo(formState.cuCode, planYear);
|
||||||
|
formState.demandVerNo = data?.demandVerNo ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function close() {
|
function close() {
|
||||||
@ -318,6 +343,7 @@
|
|||||||
}
|
}
|
||||||
async function handleSubmit(type) {
|
async function handleSubmit(type) {
|
||||||
try {
|
try {
|
||||||
|
await formRef.value.validateFields();
|
||||||
let objLng = {catCode:'LNG'}
|
let objLng = {catCode:'LNG'}
|
||||||
let objPng = {catCode:'PNG'}
|
let objPng = {catCode:'PNG'}
|
||||||
dataList.value.forEach((v,idx)=> {
|
dataList.value.forEach((v,idx)=> {
|
||||||
@ -342,7 +368,7 @@
|
|||||||
let request = type == 'save' ? saveLngPlanYearDemandHdr : saveAndSubmitLngPlanYearDemandHdr
|
let request = type == 'save' ? saveLngPlanYearDemandHdr : saveAndSubmitLngPlanYearDemandHdr
|
||||||
let obj = {
|
let obj = {
|
||||||
...formState,
|
...formState,
|
||||||
planYear: formState.planYear ? dayjs(formState.planYear).format('YYYY') : null,
|
planYear: (formState.planYear&&!pageId.value) ? dayjs(formState.planYear).format('YYYY') : formState.planYear,
|
||||||
lngPlanYearDemandList: arr
|
lngPlanYearDemandList: arr
|
||||||
}
|
}
|
||||||
await request(obj)
|
await request(obj)
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
<template #toolbar>
|
<template #toolbar>
|
||||||
<template v-for="button in tableButtonConfig" :key="button.code">
|
<template v-for="button in tableButtonConfig" :key="button.code">
|
||||||
<a-button v-if="button.isDefault" :type="button.type" @click="buttonClick(button.code)">
|
<a-button v-if="button.isDefault" :type="button.type" :disabled="button.code === 'add' && addDisabled" @click="buttonClick(button.code)">
|
||||||
<template #icon><Icon :icon="button.icon" /></template>
|
<template #icon><Icon :icon="button.icon" /></template>
|
||||||
{{ button.name }}
|
{{ button.name }}
|
||||||
</a-button>
|
</a-button>
|
||||||
@ -35,7 +35,7 @@
|
|||||||
import { Modal } from 'ant-design-vue';
|
import { Modal } from 'ant-design-vue';
|
||||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||||
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
|
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
|
||||||
import { getLngPlanYearDemandHdrPage, deleteLngPlanYearDemandHdr, exportLngPlanYearDemandHdr,getPlanYearTip} from '/@/api/plan/PlanYearDemandHdrEc';
|
import { getLngPlanYearDemandHdrPage, deleteLngPlanYearDemandHdr, exportLngPlanYearDemandHdr,getPlanYearTip, checkCuPlanState, getCuMaxPlanYear} from '/@/api/plan/PlanYearDemandHdrEc';
|
||||||
import { PageWrapper } from '/@/components/Page';
|
import { PageWrapper } from '/@/components/Page';
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
import { useI18n } from '/@/hooks/web/useI18n';
|
import { useI18n } from '/@/hooks/web/useI18n';
|
||||||
@ -58,6 +58,8 @@
|
|||||||
const userInfo = userStore.getUserInfo;
|
const userInfo = userStore.getUserInfo;
|
||||||
const curCuCode = ref('')
|
const curCuCode = ref('')
|
||||||
const yearTip = ref()
|
const yearTip = ref()
|
||||||
|
const addDisabled = ref(false)
|
||||||
|
const cuMaxPlanYear = ref<number | null>(null)
|
||||||
|
|
||||||
const { notification } = useMessage();
|
const { notification } = useMessage();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
@ -109,8 +111,9 @@
|
|||||||
fieldMapToTime: [],
|
fieldMapToTime: [],
|
||||||
showResetButton: true,
|
showResetButton: true,
|
||||||
},
|
},
|
||||||
|
immediate: false,
|
||||||
beforeFetch: (params) => {
|
beforeFetch: (params) => {
|
||||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id', page: params.limit, cuCode: curCuCode.value };
|
return { ...params, FormId: formIdComputedRef.value, PK: 'id',limit:params.limit||1, page: params.limit||1, cuCode: curCuCode.value };
|
||||||
},
|
},
|
||||||
afterFetch: (res) => {
|
afterFetch: (res) => {
|
||||||
tableRef.value.setToolBarWidth();
|
tableRef.value.setToolBarWidth();
|
||||||
@ -209,10 +212,11 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
function handleRefresh() {
|
function handleRefresh() {
|
||||||
|
checkBtn()
|
||||||
reload();
|
reload();
|
||||||
}
|
}
|
||||||
function handleSuccess() {
|
function handleSuccess() {
|
||||||
|
checkBtn()
|
||||||
reload();
|
reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -241,9 +245,17 @@
|
|||||||
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
const checkBtn = async() => {
|
||||||
|
const checkRes = await checkCuPlanState(curCuCode.value)
|
||||||
|
addDisabled.value = Number((checkRes?.count ?? 0)) !== 0
|
||||||
|
}
|
||||||
onMounted(async() => {
|
onMounted(async() => {
|
||||||
const res = await getCompDept(userInfo.id)
|
const res = await getCompDept(userInfo.id)
|
||||||
curCuCode.value = res?.comp?.cuCode
|
curCuCode.value = res?.comp?.cuCode
|
||||||
|
reload({searchInfo:{'limit':1,'size':10,'page':1, cuCode: curCuCode.value}});
|
||||||
|
checkBtn()
|
||||||
|
const maxYearRes = await getCuMaxPlanYear(curCuCode.value)
|
||||||
|
cuMaxPlanYear.value = maxYearRes?.planYear ? Number(maxYearRes.planYear) : null
|
||||||
|
|
||||||
const data = await getPlanYearTip()
|
const data = await getPlanYearTip()
|
||||||
yearTip.value = data?.msg
|
yearTip.value = data?.msg
|
||||||
@ -267,26 +279,44 @@
|
|||||||
});
|
});
|
||||||
function getActions(record: Recordable):ActionItem[] {
|
function getActions(record: Recordable):ActionItem[] {
|
||||||
|
|
||||||
const actionsList: ActionItem[] = actionButtonConfig.value?.map((button) => {
|
let actionsList: ActionItem[] = []
|
||||||
if (!record.workflowData?.processId) {
|
let editBtn: ActionItem[] = []
|
||||||
return {
|
let updateBtn: ActionItem[] = []
|
||||||
icon: button?.icon,
|
let viewBtn: ActionItem[] = [];
|
||||||
tooltip: button?.name,
|
actionButtonConfig.value?.map((button) => {
|
||||||
color: button.code === 'delete' ? 'error' : undefined,
|
if (['view', 'copyData','compare', 'datalog', 'export'].includes(button.code)) {
|
||||||
onClick: btnEvent[button.code].bind(null, record),
|
viewBtn.push({
|
||||||
};
|
|
||||||
} else {
|
|
||||||
if (button.code === 'view') {
|
|
||||||
return {
|
|
||||||
icon: button?.icon,
|
icon: button?.icon,
|
||||||
tooltip: button?.name,
|
tooltip: button?.name,
|
||||||
onClick: btnEvent[button.code].bind(null, record),
|
onClick: btnEvent[button.code].bind(null, record),
|
||||||
};
|
});
|
||||||
} else {
|
|
||||||
return {};
|
|
||||||
}
|
}
|
||||||
|
if (['edit','delete'].includes(button.code)) {
|
||||||
|
editBtn.push({
|
||||||
|
icon: button?.icon,
|
||||||
|
tooltip: button?.name,
|
||||||
|
onClick: btnEvent[button.code].bind(null, record),
|
||||||
|
color: button.code === 'delete' ? 'error' : undefined,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (['update'].includes(button.code)) {
|
||||||
|
updateBtn.push({
|
||||||
|
icon: button?.icon,
|
||||||
|
tooltip: button?.name,
|
||||||
|
onClick: btnEvent[button.code].bind(null, record),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (record.approCode == 'WTJ' || record.approCode == 'YBH') {
|
||||||
|
actionsList = actionsList.concat(editBtn);
|
||||||
|
}
|
||||||
|
const curYear = new Date().getFullYear();
|
||||||
|
const planYear = Number(record.planYear);
|
||||||
|
const canUpdate = cuMaxPlanYear.value !== null && planYear === cuMaxPlanYear.value && planYear >= curYear && record.approCode === 'YTJ' && record.lastSign === 'Y';
|
||||||
|
if (canUpdate) {
|
||||||
|
actionsList = actionsList.concat(updateBtn);
|
||||||
|
}
|
||||||
|
actionsList = actionsList.concat(viewBtn);
|
||||||
return actionsList;
|
return actionsList;
|
||||||
}
|
}
|
||||||
async function mergeCustomListRenderConfig(){
|
async function mergeCustomListRenderConfig(){
|
||||||
|
|||||||
Reference in New Issue
Block a user