客户需求
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
<a-form-item label="计划日期" name="datePlan">{{ formState.datePlan }}</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="当日/次日" name="kName">{{ formState.datePlan }}</a-form-item>
|
||||
<a-form-item label="当日/次日" name="dayDesc">{{ formState.dayDesc }}</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="合同" name="kName">{{ formState.kName}}</a-form-item>
|
||||
@ -61,10 +61,12 @@
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="开机方式" name="" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||
<span>连运</span>{{ formState.powerCont }}台
|
||||
<span>调峰</span>{{ formState.powerPeak }}台
|
||||
<span>停机</span>{{ formState.powerStop }}台
|
||||
<span>其他</span>{{ formState.powerOther }}台
|
||||
<div style="display: flex;">
|
||||
<div class="dot"><span style="background:#04F21C"></span>连运<i>{{ formState.powerCont }}</i>台</div>
|
||||
<div class="dot"><span style="background:#FFFF00"></span>调峰<i>{{ formState.powerCont }}</i>台</div>
|
||||
<div class="dot"><span style="background:#D9001B"></span>停机<i>{{ formState.powerStop }}</i>台</div>
|
||||
<div class="dot"><span style="background:#CA90FF"></span>其他<i>{{ formState.powerOther }}</i>台</div>
|
||||
</div>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
@ -76,26 +78,28 @@
|
||||
<a-table style="width: 100%" :columns="columns" :data-source="dataList" :pagination="false" :scroll="{x: 1000}">
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-if="column.dataIndex === 'qtySalesGj'">
|
||||
<a-input-number v-model:value="record.qtySalesGj" :min="0" @change="numChange" style="width: 100%" />
|
||||
<a-input-number v-model:value="record.qtySalesGj" :disabled="record.alterSign=='D' || disable" :min="0" @change="numChange" style="width: 100%" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'qtySalesM3'">
|
||||
<a-input-number v-model:value="record.qtySalesM3" :min="0" @change="numChange" style="width: 100%" />
|
||||
<a-input-number v-model:value="record.qtySalesM3" :disabled="record.alterSign=='D' || disable" :min="0" @change="numChange" style="width: 100%" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'note'">
|
||||
<a-input v-model:value="record.note" style="width: 100%" />
|
||||
<a-input v-model:value="record.note" :disabled="record.alterSign=='D' || disable" style="width: 100%" />
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { json } from 'stream/consumers';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { ref, computed, onMounted, onBeforeMount, nextTick, defineAsyncComponent, reactive, defineComponent, watch} from 'vue';
|
||||
const { t } = useI18n();
|
||||
const props = defineProps({
|
||||
disabled: false,
|
||||
id: ''
|
||||
formObj: {},
|
||||
list: [],
|
||||
disable: false
|
||||
|
||||
});
|
||||
const columns= ref([
|
||||
@ -109,42 +113,69 @@
|
||||
{ title: t('批复量(方)'), dataIndex: 'qtySalesM3', sorter: true, width: 200},
|
||||
{ title: t('备注'), dataIndex: 'note', sorter: true, width: 200},
|
||||
]);
|
||||
const formState = reactive({})
|
||||
const formState = ref()
|
||||
const dataList = ref([])
|
||||
async function numChange () {
|
||||
let num = 0;
|
||||
let num = 1;
|
||||
dataList.forEach(v => {
|
||||
let num1 = 0;
|
||||
dataList.value.forEach(v => {
|
||||
num+=(Number(v.qtySalesGj) || 0)
|
||||
num1+=(Number(v.qtySalesM3) || 0)
|
||||
})
|
||||
formState.qtySalesGj = num
|
||||
formState.qtySalesM3 = num1
|
||||
formState.value.qtySalesGj = num
|
||||
formState.value.qtySalesM3 = num1
|
||||
}
|
||||
function getFormValue () {
|
||||
let obj = {
|
||||
formInfo: formState.value,
|
||||
list: dataList.value
|
||||
}
|
||||
return obj
|
||||
}
|
||||
watch(
|
||||
() => props.id,
|
||||
() => props.formObj,
|
||||
(val) => {
|
||||
if (val) {
|
||||
formState.value = val
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
{
|
||||
immediate: true,
|
||||
deep: true,
|
||||
}
|
||||
);
|
||||
watch(
|
||||
() => props.disabled,
|
||||
() => props.list,
|
||||
(val) => {
|
||||
|
||||
dataList.value = val
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
immediate: true,
|
||||
deep: true,
|
||||
}
|
||||
);
|
||||
|
||||
defineExpose({
|
||||
getFormValue
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
||||
|
||||
.dot {
|
||||
margin-right: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
i{
|
||||
padding: 5px;
|
||||
font-style: normal;
|
||||
}
|
||||
span{
|
||||
width: 10px !important;
|
||||
height: 10px !important;
|
||||
border-radius: 50%;
|
||||
background: red;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -1,104 +1,30 @@
|
||||
<template>
|
||||
<a-spin :spinning="spinning" tip="加载中...">
|
||||
<div class="page-bg-wrap formViewStyle pdcss">
|
||||
<div class="top-toolbar" v-if="currentRoute.query.type!=='compare'">
|
||||
<a-button style="margin-right: 10px" @click="close">
|
||||
<slot name="icon"><close-outlined /></slot>关闭
|
||||
</a-button>
|
||||
<a-button style="margin-right: 10px" type="primary" @click="checkBtn('agree')" v-if="!currentRoute.query.type">
|
||||
<slot name="icon"><check-circle-outlined /></slot>通过
|
||||
</a-button>
|
||||
<a-button style="margin-right: 10px" @click="checkBtn('reject')" v-if="!currentRoute.query.type">
|
||||
<slot name="icon"><stop-outlined /></slot>驳回
|
||||
</a-button>
|
||||
</div>
|
||||
<a-form ref="formRef" :model="formState" :rules="rules" v-bind="layout">
|
||||
<a-row>
|
||||
<a-row v-if="currentRoute.query.type!=='compare'">
|
||||
<a-col :span="24">
|
||||
<a-form-item label="批复意见" name="reply" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||
<a-textarea v-model:value="formState.reply" :disabled="isDisable" placeholder="请输入备注" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||
<a-textarea v-model:value="formState.reply" :disabled="currentRoute.query.type=='view'" placeholder="请输入备注" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<Card title="日计划审批" :bordered="false" >
|
||||
<a-row>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="计划日期" name="datePlan">{{ formState.datePlan }}</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="当日/次日" name="kName">{{ formState.datePlan }}</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="合同" name="kName">{{ formState.kName}}</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="合同量(吉焦)" name="qtyContractGj">{{ formState.qtyContractGj }}</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="合同量(方)" name="qtyContractM3">{{ formState.qtyContractM3 }}</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="月合同量执行进度%" name="rateK">{{ formState.rateK }}</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="计划量(吉焦)" name="qtyPlanGj">{{ formState.qtyPlanGj }}</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="计划量(方)" name="qtyPlanM3">{{ formState.qtyPlanM3 }}</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="月计划量执行进度%" name="rateMp">{{ formState.rateMp }}</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="指定量(吉焦)" name="qtyDemandGj">{{ formState.qtyDemandGj }}</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="指定量(方)" name="qtyDemandM3">{{ formState.qtyDemandM3 }}</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="月时间进度%" name="rateS">{{ formState.rateS }}</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="批复量(吉焦)" name="qtySalesGj">{{ formState.qtySalesGj }}</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="批复量(方)" name="qtySalesM3">{{ formState.qtySalesM3 }}</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="比值(方/吉焦)" name="rateM3Gj">{{ formState.rateM3Gj }}</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="交易主体" name="name">{{ formState.name }}</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="版本号" name="verNo">{{ formState.verNo }}</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="下载点" name="fullName" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||
{{ formState.fullName }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="审批状态" name="approName">{{ formState.approName }}</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="开机方式" name="" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||
<div style="display: flex;">
|
||||
<div class="dot"><span></span>连运<i>{{ formState.powerCont }}</i>台</div>
|
||||
<div class="dot"><span></span>调峰<i>{{ formState.powerCont }}</i>台</div>
|
||||
<div class="dot"><span></span>停机<i>{{ formState.powerStop }}</i>台</div>
|
||||
<div class="dot"><span></span>其他<i>{{ formState.powerOther }}</i>台</div>
|
||||
</div>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="备注" name="note" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||
{{ formState.note }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-table style="width: 100%" :columns="columns" :data-source="dataList" :pagination="false" :scroll="{x: 1000}">
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-if="column.dataIndex === 'qtySalesGj'">
|
||||
<a-input-number v-model:value="record.qtySalesGj" :min="0" @change="numChange" style="width: 100%" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'qtySalesM3'">
|
||||
<a-input-number v-model:value="record.qtySalesM3" :min="0" @change="numChange" style="width: 100%" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'note'">
|
||||
<a-input v-model:value="record.note" style="width: 100%" />
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
<Card :title="title" :bordered="false" >
|
||||
<basicForm ref="basicFormRef" :formObj="formState" :list="dataList" :disable="currentRoute.query.type"></basicForm>
|
||||
</Card>
|
||||
<Card :title="title" :bordered="false" v-if="currentRoute.query.type=='compare'">
|
||||
<basicForm ref="basicFormRef" :formObj="formState" :list="dataList" :disable="currentRoute.query.type"></basicForm>
|
||||
</Card>
|
||||
</a-form>
|
||||
</div>
|
||||
@ -110,6 +36,7 @@
|
||||
import { useRouter } from 'vue-router';
|
||||
import { FromPageType, RecordType } from '/@/enums/workflowEnum';
|
||||
import { ref, computed, onMounted, onBeforeMount, nextTick, defineAsyncComponent, reactive, defineComponent, watch} from 'vue';
|
||||
import { CheckCircleOutlined, StopOutlined, CloseOutlined, } from '@ant-design/icons-vue';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
import { useMultipleTabStore } from '/@/store/modules/multipleTab';
|
||||
@ -117,18 +44,16 @@
|
||||
import type { Rule } from 'ant-design-vue/es/form';
|
||||
import { getDictionary } from '/@/api/sales/Customer';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { addLngPngAppro,updateLngPngAppro, getLngPngAppro } from '/@/api/dayPlan/PngAppro';
|
||||
import { getLngPngAppro,approveLngPngAppro,getLngPngApproCompare } from '/@/api/dayPlan/PngAppro';
|
||||
import dayjs from 'dayjs';
|
||||
import { getAppEnvConfig } from '/@/utils/env';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import basicForm from './basicForm.vue'
|
||||
|
||||
const userStore = useUserStore();
|
||||
const userInfo = userStore.getUserInfo;
|
||||
|
||||
const tableName = 'ContractSales';
|
||||
const columnName = 'ContractSales'
|
||||
|
||||
const formType = ref('2'); // 0 新建 1 修改 2 查看
|
||||
const formRef = ref();
|
||||
const props = defineProps({
|
||||
@ -162,54 +87,68 @@
|
||||
const [register, { openModal:openModal}] = useModal();
|
||||
const rules= reactive({
|
||||
// kNo: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
// kName: [{ required: true, message: "该项为必填项", trigger: 'change' }],
|
||||
});
|
||||
const layout = {
|
||||
labelCol: { span: 9 },
|
||||
wrapperCol: { span: 18 },
|
||||
}
|
||||
const columns= ref([
|
||||
{ title: t('序号'), dataIndex: 'index', key: 'index', sorter: true, customRender: (column) => `${column.index + 1}` ,width: 100},
|
||||
{ title: t('上载点'), dataIndex: 'pointUpName', sorter: true, width:200},
|
||||
{ title: t('供应商'), dataIndex: 'suSname', sorter: true, width: 130},
|
||||
{ title: t('采购合同'), dataIndex: 'kName', sorter: true, width: 200},
|
||||
{ title: t('指定量(吉焦)'), dataIndex: 'qtyDemandGj', sorter: true, width: 300},
|
||||
{ title: t('指定量(方)'), dataIndex: 'qtyDemandM3', sorter: true, width: 200},
|
||||
{ title: t('批复量(吉焦)'), dataIndex: 'qtySalesGj', sorter: true, width: 200},
|
||||
{ title: t('批复量(方)'), dataIndex: 'qtySalesM3', sorter: true, width: 200},
|
||||
{ title: t('备注'), dataIndex: 'note', sorter: true, width: 200},
|
||||
]);
|
||||
const title = ref('日计划审批')
|
||||
const dataList = ref([])
|
||||
const basicFormRef = ref()
|
||||
let optionSelect= reactive({
|
||||
approCodeList: [],
|
||||
});
|
||||
watch(
|
||||
() => props.id,
|
||||
(val) => {
|
||||
if (val) {
|
||||
getInfo(val)
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
watch(
|
||||
() => props.disabled,
|
||||
(val) => {
|
||||
isDisable.value = val
|
||||
},
|
||||
{
|
||||
immediate: true
|
||||
}
|
||||
);
|
||||
onMounted(() => {
|
||||
getOption()
|
||||
if (pageId.value) {
|
||||
if (currentRoute.value.query.type=='compare') {
|
||||
getCompareInfo(pageId.value)
|
||||
return
|
||||
}
|
||||
getInfo(pageId.value)
|
||||
}
|
||||
|
||||
});
|
||||
async function getCompareInfo(id) {
|
||||
spinning.value = true
|
||||
try {
|
||||
let data = await getLngPngApproCompare(id)
|
||||
spinning.value = false
|
||||
Object.assign(formState, {...data})
|
||||
Object.assign(dataList.value, formState.lngPngApproPurList || [{}])
|
||||
const startDate = dayjs(formState.datePlan);
|
||||
const endDate = dayjs(new Date());
|
||||
const diffInDays = endDate.diff(startDate, 'day');
|
||||
if (diffInDays == 0) {
|
||||
formState.dayDesc = '当日'
|
||||
} else if (diffInDays == 1) {
|
||||
formState.dayDesc = '次日'
|
||||
} else if (diffInDays > 1) {
|
||||
formState.dayDesc = diffInDays + '日后'
|
||||
} else {
|
||||
formState.dayDesc = ''
|
||||
}
|
||||
formState.qtyContractM3 = Number(formState.qtyContractM3)/10000
|
||||
formState.qtyPlanM3 = Number(formState.qtyPlanM3)/10000
|
||||
formState.qtyDemandM3 = Number(formState.qtyDemandM3)/10000
|
||||
formState.qtySalesM3 = Number(formState.qtySalesM3)/10000
|
||||
let num = 0;
|
||||
let num1 = 0;
|
||||
dataList.value.forEach(v => {
|
||||
v.qtyDemandM3 = Number(v.qtyDemandM3)/10000
|
||||
v.qtySalesM3 = Number(v.qtySalesM3)/10000
|
||||
num+=(Number(v.qtySalesGj) || 0)
|
||||
num1+=(Number(v.qtySalesM3) || 0)
|
||||
});
|
||||
formState.qtySalesGj = num
|
||||
formState.qtySalesM3 = num1
|
||||
|
||||
} catch (error) {
|
||||
console.log(error, 'error')
|
||||
spinning.value = false
|
||||
}
|
||||
|
||||
}
|
||||
async function getInfo(id) {
|
||||
spinning.value = true
|
||||
try {
|
||||
@ -217,26 +156,38 @@
|
||||
spinning.value = false
|
||||
Object.assign(formState, {...data})
|
||||
Object.assign(dataList.value, formState.lngPngApproPurList || [{}])
|
||||
const startDate = dayjs(formState.datePlan);
|
||||
const endDate = dayjs(new Date());
|
||||
const diffInDays = endDate.diff(startDate, 'day');
|
||||
if (diffInDays == 0) {
|
||||
formState.dayDesc = '当日'
|
||||
} else if (diffInDays == 1) {
|
||||
formState.dayDesc = '次日'
|
||||
} else if (diffInDays > 1) {
|
||||
formState.dayDesc = diffInDays + '日后'
|
||||
} else {
|
||||
formState.dayDesc = ''
|
||||
}
|
||||
formState.qtyContractM3 = Number(formState.qtyContractM3)/10000
|
||||
formState.qtyPlanM3 = Number(formState.qtyPlanM3)/10000
|
||||
formState.qtyDemandM3 = Number(formState.qtyDemandM3)/10000
|
||||
formState.qtySalesM3 = Number(formState.qtySalesM3)/10000
|
||||
let num = 0;
|
||||
let num1 = 0;
|
||||
dataList.value.forEach(v => {
|
||||
v.qtyM3Month = Number(v.qtyM3Month)/10000
|
||||
v.qtyM3Day = Number(v.qtyM3Day)/10000
|
||||
v.qtyDemandM3 = Number(v.qtyDemandM3)/10000
|
||||
v.qtySalesM3 = Number(v.qtySalesM3)/10000
|
||||
num+=(Number(v.qtySalesGj) || 0)
|
||||
num1+=(Number(v.qtySalesM3) || 0)
|
||||
});
|
||||
formState.qtySalesGj = num
|
||||
formState.qtySalesM3 = num1
|
||||
|
||||
} catch (error) {
|
||||
console.log(error, 'error')
|
||||
spinning.value = false
|
||||
}
|
||||
}
|
||||
async function numChange () {
|
||||
let num = 0;
|
||||
let num1 = 1;
|
||||
dataList.forEach(v => {
|
||||
num+=(Number(v.qtySalesGj) || 0)
|
||||
num1+=(Number(v.qtySalesM3) || 0)
|
||||
})
|
||||
formState.qtySalesGj = num
|
||||
formState.qtySalesM3 = num1
|
||||
}
|
||||
async function getOption() {
|
||||
optionSelect.approCodeList = await getDictionary('LNG_APPRO')
|
||||
|
||||
@ -244,64 +195,53 @@
|
||||
function close() {
|
||||
tabStore.closeTab(currentRoute.value, router);
|
||||
}
|
||||
async function getFormValue() {
|
||||
return formState
|
||||
}
|
||||
async function handleSubmit(type) {
|
||||
async function checkBtn(type) {
|
||||
let data = basicFormRef.value.getFormValue()
|
||||
console.log(data, 'data')
|
||||
let arr = JSON.parse(JSON.stringify(data.list))
|
||||
arr.forEach(v=> {
|
||||
v.qtyDemandM3 = Number(v.qtyDemandM3)*10000
|
||||
v.qtySalesM3 = Number(v.qtySalesM3)*10000
|
||||
})
|
||||
let obj = {
|
||||
...data.formInfo,
|
||||
qtyContractM3: Number(data.formInfo.qtyContractM3)*10000,
|
||||
qtyPlanM3: Number(data.formInfo.qtyPlanM3)*10000,
|
||||
qtyDemandM3: Number(data.formInfo.qtyDemandM3)*10000,
|
||||
qtySalesM3: Number(data.formInfo.qtySalesM3)*10000,
|
||||
lngPngApproPurList:arr
|
||||
}
|
||||
let params = {
|
||||
result: type == 'agree' ? 'C' : 'R',
|
||||
remark: formState.reply,
|
||||
data: obj
|
||||
}
|
||||
spinning.value = true;
|
||||
try {
|
||||
await formRef.value.validateFields();
|
||||
let obj = {
|
||||
...formState,
|
||||
lngContractSalesPngPointList: dataListPoint.value,
|
||||
lngContractSalesPngQtyList: arr,
|
||||
lngFileUploadList: dataFile.value,
|
||||
lngContractFactRelList: dataListContractFact.value,
|
||||
lngContractApproRelList: dataListAppro.value,
|
||||
|
||||
}
|
||||
spinning.value = true;
|
||||
let request = !formState.id ? addLngPngAppro :updateLngPngAppro
|
||||
|
||||
try {
|
||||
const data = await request(obj);
|
||||
// 新增保存
|
||||
if (data?.id) {
|
||||
getInfo(data?.id)
|
||||
if (type == 'reject') {
|
||||
if (!formState.reply) {
|
||||
message.warn('请输入批复意见')
|
||||
return
|
||||
}
|
||||
// 同意保存不提示
|
||||
if (!type) {
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: data?.id ? t('新增成功!') : t('修改成功!')
|
||||
}); //提示消息
|
||||
}
|
||||
return data?.id ? data : obj
|
||||
|
||||
} finally {
|
||||
spinning.value = false;
|
||||
}
|
||||
|
||||
} catch (errorInfo) {
|
||||
spinning.value = false;
|
||||
errorInfo?.errorFields?.length && notification.warning({
|
||||
await approveLngPngAppro(params);
|
||||
spinning.value = false;
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: '请完善信息'
|
||||
});
|
||||
return false
|
||||
description: type == 'agree' ? '审批通过':'已驳回'
|
||||
}); //提示消息
|
||||
setTimeout(() => {
|
||||
bus.emit(FORM_LIST_MODIFIED, {});
|
||||
close();
|
||||
}, 500);
|
||||
}catch (errorInfo) {
|
||||
spinning.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
handleSubmit,
|
||||
getFormValue
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
:deep(.ant-form-item .ant-form-item-label) {
|
||||
width: 135px !important;
|
||||
max-width: 135px !important;
|
||||
}
|
||||
.page-bg-wrap {
|
||||
background-color: #fff;
|
||||
}
|
||||
@ -312,7 +252,7 @@
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
.pdcss {
|
||||
padding: 6px 12px !important;
|
||||
padding:0px 12px 6px 12px !important;
|
||||
}
|
||||
.dot {
|
||||
margin-right: 10px;
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex === 'approName'">
|
||||
<a @click="btnCheck('approName')">{{ record.approName }}</a>
|
||||
<a @click="btnCheck(record)">{{ record.approName }}</a>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<TableAction :actions="getActions(record)" />
|
||||
@ -60,7 +60,7 @@
|
||||
|
||||
import useEventBus from '/@/hooks/event/useEventBus';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
|
||||
|
||||
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
|
||||
|
||||
const { notification } = useMessage();
|
||||
@ -94,6 +94,8 @@
|
||||
|
||||
const { currentRoute } = useRouter();
|
||||
const router = useRouter();
|
||||
const path = currentRoute.value?.path
|
||||
console.log(currentRoute, 'router55555555555555', path)
|
||||
const formIdComputedRef = ref();
|
||||
formIdComputedRef.value = currentRoute.value.meta.formId
|
||||
const schemaIdComputedRef = ref();
|
||||
@ -113,7 +115,20 @@
|
||||
const [registerModal, { openModal}] = useModal();
|
||||
const [registerApproStatus, { openModal: openModalApproStatus}] = useModal();
|
||||
|
||||
const formName='销售审批';
|
||||
let formName='管道气销售审批';
|
||||
let curPath = 'dayPlan/PngAppro/index'
|
||||
if (path.includes('dayPlan/PngAppro/index')) {
|
||||
formName='管道气销售审批'
|
||||
curPath = 'dayPlan/PngAppro/index'
|
||||
}
|
||||
if (path.includes('dayPlan/pngPipeAppro/index')) {
|
||||
formName='管道气管道审批'
|
||||
curPath = 'dayPlan/pngPipeAppro'
|
||||
}
|
||||
if (path.includes('dayPlan/pngReceiveStationAppro/index')) {
|
||||
formName='管道气接收站审批'
|
||||
curPath = 'dayPlan/pngReceiveStationAppro'
|
||||
}
|
||||
const [registerTable, { reload, clearSelectedRowKeys, setTableData }] = useTable({
|
||||
title: '' || (formName + '列表'),
|
||||
api: getLngPngApproPage,
|
||||
@ -166,10 +181,8 @@
|
||||
},
|
||||
|
||||
});
|
||||
const btnCheck = (type)=> {
|
||||
if (type == 'approName') {
|
||||
openModalApproStatus(true,{isUpdate: false});
|
||||
}
|
||||
const btnCheck = (record)=> {
|
||||
openModalApproStatus(true,{isUpdate: false,id:record.id});
|
||||
}
|
||||
function onSelectChange(rowKeys: string[]) {
|
||||
selectedKeys.value = rowKeys;
|
||||
@ -199,14 +212,24 @@
|
||||
}
|
||||
});
|
||||
} else {
|
||||
router.push({
|
||||
path: '/form/PngAppro/' + record.id + '/viewForm',
|
||||
router.push({
|
||||
path: '/dayPlan/PngAppro/createForm',
|
||||
query: {
|
||||
formPath: 'dayPlan/PngAppro',
|
||||
formPath: curPath,
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId
|
||||
formId:currentRoute.value.meta.formId,
|
||||
id: record.id,
|
||||
type: 'view'
|
||||
}
|
||||
});
|
||||
// router.push({
|
||||
// path: '/form/PngAppro/' + record.id + '/viewForm',
|
||||
// query: {
|
||||
// formPath: 'dayPlan/PngAppro',
|
||||
// formName: formName,
|
||||
// formId:currentRoute.value.meta.formId
|
||||
// }
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
@ -235,7 +258,7 @@
|
||||
router.push({
|
||||
path: '/dayPlan/PngAppro/createForm',
|
||||
query: {
|
||||
formPath: 'dayPlan/PngAppro',
|
||||
formPath: curPath,
|
||||
formName: formName,
|
||||
formId:currentRoute.value.meta.formId,
|
||||
id: record.id
|
||||
@ -243,7 +266,16 @@
|
||||
});
|
||||
}
|
||||
function handleCompare (record: Recordable) {
|
||||
|
||||
router.push({
|
||||
path: '/dayPlan/PngAppro/createForm',
|
||||
query: {
|
||||
formPath: curPath,
|
||||
formName: formName+'对比',
|
||||
formId:currentRoute.value.meta.formId,
|
||||
id: record.demandOrgId,
|
||||
type: 'compare'
|
||||
}
|
||||
});
|
||||
}
|
||||
function handleBatchApprove () {
|
||||
setTableData([{verNo: 5, cuCode: 444, approName: '未提交'}])
|
||||
|
||||
Reference in New Issue
Block a user