销售审批
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="dayDesc">{{ formState.dayDesc }}</a-form-item>
|
||||
<a-form-item label="当日/次日" name="daysSign">{{ formState.daysSign }}</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="合同" name="kName">{{ formState.kName}}</a-form-item>
|
||||
@ -46,14 +46,14 @@
|
||||
<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-form-item label="交易主体" name="comName">{{ formState.comName }}</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 label="下载点" name="poinDelyName" :label-col="{ span: 3 }" :wrapper-col="{ span: 24 }">
|
||||
{{ formState.pointDelyName }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
@ -75,7 +75,7 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-table style="width: 100%" :columns="columns" :data-source="dataList" :pagination="false" :scroll="{x: 1000}">
|
||||
<a-table style="width: 100%" :columns="columns" :data-source="dataList" :pagination="false" :scroll="{x: 100}">
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-if="column.dataIndex === 'qtySalesGj'">
|
||||
<a-input-number v-model:value="record.qtySalesGj" :disabled="record.alterSign=='D' || disable" :min="0" @change="numChange" style="width: 100%" />
|
||||
@ -104,14 +104,14 @@ import { useI18n } from '/@/hooks/web/useI18n';
|
||||
});
|
||||
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: 'pointUpName', sorter: true, width:400},
|
||||
{ title: t('供应商'), dataIndex: 'suName', sorter: true, width: 400},
|
||||
{ title: t('采购合同'), dataIndex: 'kpName', sorter: true, width: 400},
|
||||
{ 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},
|
||||
{ title: t('备注'), dataIndex: 'note', sorter: true, width: 300},
|
||||
]);
|
||||
const formState = ref()
|
||||
const dataList = ref([])
|
||||
|
||||
@ -45,7 +45,7 @@ export const columns: BasicColumn[] = [
|
||||
title: '版本号',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
width: 80,
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
@ -54,12 +54,12 @@ export const columns: BasicColumn[] = [
|
||||
title: '计划日期',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
width: 100,
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'cuCode',
|
||||
dataIndex: 'cuName',
|
||||
title: '客户',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
@ -68,7 +68,7 @@ export const columns: BasicColumn[] = [
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'demandId',
|
||||
dataIndex: 'poinDelyName',
|
||||
title: '下载点',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
@ -140,7 +140,7 @@ export const columns: BasicColumn[] = [
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'lastVerSign',
|
||||
dataIndex: 'kName',
|
||||
title: '销售合同',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
@ -149,7 +149,7 @@ export const columns: BasicColumn[] = [
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'alterSign',
|
||||
dataIndex: 'alterName',
|
||||
title: '变更',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
|
||||
@ -1,19 +1,21 @@
|
||||
<template>
|
||||
<a-spin :spinning="spinning" tip="加载中...">
|
||||
<div class="page-bg-wrap formViewStyle pdcss">
|
||||
<div class="top-toolbar" v-if="currentRoute.query.type!=='compare'">
|
||||
<div class="top-toolbar" >
|
||||
<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>
|
||||
<template v-if="currentRoute.query.type!=='compare'">
|
||||
<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>
|
||||
</template>
|
||||
</div>
|
||||
<a-form ref="formRef" :model="formState" :rules="rules" v-bind="layout">
|
||||
<a-row v-if="currentRoute.query.type!=='compare'">
|
||||
<a-row v-if="!currentRoute.query.type">
|
||||
<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="currentRoute.query.type=='view'" placeholder="请输入备注" :auto-size="{ minRows: 2, maxRows: 5 }"/>
|
||||
@ -23,8 +25,8 @@
|
||||
<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 :title="titleNew" :bordered="false" v-if="currentRoute.query.type=='compare'&&titleNew">
|
||||
<basicForm ref="basicFormRef" :formObj="formStateNew" :list="dataListNew" :disable="currentRoute.query.type"></basicForm>
|
||||
</Card>
|
||||
</a-form>
|
||||
</div>
|
||||
@ -44,7 +46,7 @@
|
||||
import type { Rule } from 'ant-design-vue/es/form';
|
||||
import { getDictionary } from '/@/api/sales/Customer';
|
||||
import { useModal } from '/@/components/Modal';
|
||||
import { getLngPngAppro,approveLngPngAppro,getLngPngApproCompare } from '/@/api/dayPlan/PngAppro';
|
||||
import { getLngPngAppro,approveLngPngAppro,getLngPngApproCompare,approveLngPngApproSZ,approveLngPngApproGD } from '/@/api/dayPlan/PngAppro';
|
||||
import dayjs from 'dayjs';
|
||||
import { getAppEnvConfig } from '/@/utils/env';
|
||||
import { message } from 'ant-design-vue';
|
||||
@ -83,6 +85,9 @@
|
||||
const hasDel = ref(false)
|
||||
const formState = reactive({
|
||||
|
||||
});
|
||||
const formStateNew = reactive({
|
||||
|
||||
});
|
||||
const [register, { openModal:openModal}] = useModal();
|
||||
const rules= reactive({
|
||||
@ -93,7 +98,9 @@
|
||||
wrapperCol: { span: 18 },
|
||||
}
|
||||
const title = ref('日计划审批')
|
||||
const titleNew = ref('')
|
||||
const dataList = ref([])
|
||||
const dataListNew = ref([])
|
||||
const basicFormRef = ref()
|
||||
let optionSelect= reactive({
|
||||
approCodeList: [],
|
||||
@ -112,39 +119,27 @@
|
||||
async function getCompareInfo(id) {
|
||||
spinning.value = true
|
||||
try {
|
||||
let data = await getLngPngApproCompare(id)
|
||||
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 = ''
|
||||
if (data.length == 1) {
|
||||
let obj = changeData(data[0])
|
||||
Object.assign(formState, {...obj.params})
|
||||
Object.assign(dataList.value, obj.list || [{}])
|
||||
title.value = '版本V'+ formState.verNo
|
||||
}
|
||||
if (data.length > 1) {
|
||||
let obj = changeData(data[0])
|
||||
Object.assign(formState, {...obj.params})
|
||||
Object.assign(dataList.value, obj.list || [{}])
|
||||
title.value = '版本V'+ formState.verNo
|
||||
|
||||
let obj1 = changeData(data[1])
|
||||
Object.assign(formStateNew, {...obj1.params})
|
||||
Object.assign(dataListNew.value, obj1.list || [{}])
|
||||
titleNew.value = '版本V'+ formStateNew.verNo
|
||||
}
|
||||
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
|
||||
}
|
||||
|
||||
@ -154,40 +149,46 @@
|
||||
try {
|
||||
let data = await getLngPngAppro(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 = ''
|
||||
let obj = changeData(data)
|
||||
Object.assign(formState, {...obj.params})
|
||||
Object.assign(dataList.value, obj.list || [{}])
|
||||
} catch (error) {
|
||||
spinning.value = false
|
||||
}
|
||||
formState.qtyContractM3 = Number(formState.qtyContractM3)/10000
|
||||
formState.qtyPlanM3 = Number(formState.qtyPlanM3)/10000
|
||||
formState.qtyDemandM3 = Number(formState.qtyDemandM3)/10000
|
||||
formState.qtySalesM3 = Number(formState.qtySalesM3)/10000
|
||||
}
|
||||
const changeData = (obj) => {
|
||||
let arr = obj.lngPngApproPurList || [{}]
|
||||
// const startDate = dayjs(obj.datePlan);
|
||||
// const endDate = dayjs(new Date());
|
||||
// const diffInDays = endDate.diff(startDate, 'day');
|
||||
// if (diffInDays == 0) {
|
||||
// obj.dayDesc = '当日'
|
||||
// } else if (diffInDays == 1) {
|
||||
// obj.dayDesc = '次日'
|
||||
// } else if (diffInDays > 1) {
|
||||
// obj.dayDesc = diffInDays + '日后'
|
||||
// } else {
|
||||
// obj.dayDesc = ''
|
||||
// }
|
||||
obj.qtyContractM3 = Number(obj.qtyContractM3)/10000
|
||||
obj.qtyPlanM3 = Number(obj.qtyPlanM3)/10000
|
||||
obj.qtyDemandM3 = Number(obj.qtyDemandM3)/10000
|
||||
obj.qtySalesM3 = Number(obj.qtySalesM3)/10000
|
||||
let num = 0;
|
||||
let num1 = 0;
|
||||
dataList.value.forEach(v => {
|
||||
arr.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
|
||||
obj.qtySalesGj = num
|
||||
obj.qtySalesM3 = num1
|
||||
return {
|
||||
list : arr,
|
||||
params: obj
|
||||
}
|
||||
}
|
||||
}
|
||||
async function getOption() {
|
||||
optionSelect.approCodeList = await getDictionary('LNG_APPRO')
|
||||
|
||||
@ -197,7 +198,6 @@
|
||||
}
|
||||
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
|
||||
@ -214,7 +214,7 @@
|
||||
let params = {
|
||||
result: type == 'agree' ? 'C' : 'R',
|
||||
remark: formState.reply,
|
||||
data: obj
|
||||
data: [obj]
|
||||
}
|
||||
spinning.value = true;
|
||||
try {
|
||||
@ -224,7 +224,17 @@
|
||||
return
|
||||
}
|
||||
}
|
||||
await approveLngPngAppro(params);
|
||||
let request = ''
|
||||
if (formPath.includes('dayPlan/PngAppro/index')) {
|
||||
request = approveLngPngAppro
|
||||
}
|
||||
if (formPath.includes('dayPlan/pngPipeAppro/index')) {
|
||||
request = approveLngPngApproGD
|
||||
}
|
||||
if (formPath.includes('dayPlan/pngReceiveStationAppro/index')) {
|
||||
request = approveLngPngApproSZ
|
||||
}
|
||||
await request(params);
|
||||
spinning.value = false;
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
|
||||
@ -44,7 +44,8 @@
|
||||
import { useFormConfig } from '/@/hooks/web/useFormConfig';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { setIndexFlowStatus } from '/@/utils/flow/index'
|
||||
import { getLngPngAppro } from '/@/api/dayPlan/PngAppro';
|
||||
import { getLngPngAppro,getLngPngApproPageGd, getLngPngApproPageJsz, approveLngPngApproSZ, approveLngPngApproGD, approveLngPngAppro
|
||||
} from '/@/api/dayPlan/PngAppro';
|
||||
import { useModal,BasicModal } from '/@/components/Modal';
|
||||
import LookProcess from '/@/views/workflow/task/components/LookProcess.vue';
|
||||
import LaunchProcess from '/@/views/workflow/task/components/LaunchProcess.vue';
|
||||
@ -95,7 +96,6 @@
|
||||
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();
|
||||
@ -108,7 +108,7 @@
|
||||
const formDataRef = ref();
|
||||
const rowKeyData = ref();
|
||||
const draftsId = ref();
|
||||
|
||||
const selectedKeys = ref([])
|
||||
const visibleApproveProcessRef = ref(false);
|
||||
const taskIdRef = ref('');
|
||||
const visibleFlowRecordModal = ref(false);
|
||||
@ -117,21 +117,29 @@
|
||||
|
||||
let formName='管道气销售审批';
|
||||
let curPath = 'dayPlan/PngAppro/index'
|
||||
let request = ''
|
||||
let requestApprove = ''
|
||||
if (path.includes('dayPlan/PngAppro/index')) {
|
||||
formName='管道气销售审批'
|
||||
curPath = 'dayPlan/PngAppro/index'
|
||||
request = getLngPngApproPage
|
||||
requestApprove = approveLngPngAppro
|
||||
}
|
||||
if (path.includes('dayPlan/pngPipeAppro/index')) {
|
||||
formName='管道气管道审批'
|
||||
curPath = 'dayPlan/pngPipeAppro'
|
||||
request = getLngPngApproPageGd
|
||||
requestApprove = approveLngPngApproGD
|
||||
}
|
||||
if (path.includes('dayPlan/pngReceiveStationAppro/index')) {
|
||||
formName='管道气接收站审批'
|
||||
curPath = 'dayPlan/pngReceiveStationAppro'
|
||||
request = getLngPngApproPageJsz
|
||||
requestApprove = approveLngPngApproSZ
|
||||
}
|
||||
const [registerTable, { reload, clearSelectedRowKeys, setTableData }] = useTable({
|
||||
title: '' || (formName + '列表'),
|
||||
api: getLngPngApproPage,
|
||||
api: request,
|
||||
rowKey: 'id',
|
||||
columns: customConfigColums,
|
||||
formConfig: {
|
||||
@ -182,7 +190,7 @@
|
||||
|
||||
});
|
||||
const btnCheck = (record)=> {
|
||||
openModalApproStatus(true,{isUpdate: false,id:record.id});
|
||||
openModalApproStatus(true,{isUpdate: false,id:record.demandId});
|
||||
}
|
||||
function onSelectChange(rowKeys: string[]) {
|
||||
selectedKeys.value = rowKeys;
|
||||
@ -277,8 +285,32 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
function handleBatchApprove () {
|
||||
setTableData([{verNo: 5, cuCode: 444, approName: '未提交'}])
|
||||
async function handleBatchApprove () {
|
||||
if (!selectedKeys.value.length) {
|
||||
notification.warning({
|
||||
message: 'Tip',
|
||||
description: t('请选择需要审批的数据'),
|
||||
});
|
||||
return;
|
||||
}
|
||||
let arr = selectedKeys.value.map(v=> {
|
||||
return {
|
||||
id: v
|
||||
}
|
||||
})
|
||||
|
||||
let obj = {
|
||||
"result": "C",
|
||||
"remark": "",
|
||||
"data": arr
|
||||
}
|
||||
await requestApprove(obj)
|
||||
handleSuccess();
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: t('审批成功!'),
|
||||
});
|
||||
clearSelectedRowKeys()
|
||||
|
||||
}
|
||||
onMounted(() => {
|
||||
|
||||
Reference in New Issue
Block a user