This commit is contained in:
‘huanghaiixia’
2026-01-19 17:55:47 +08:00
parent e97ba3bcfb
commit 3c71f0be6f
5 changed files with 201 additions and 132 deletions

View File

@ -51,10 +51,25 @@ export const columns: BasicColumn[] = [
sorter: true,
},
{
dataIndex: 'cuSname',
title: '供应商简称',
title: '客户',
componentType: 'input',
align: 'left',
sorter: true,
},
{
dataIndex: 'pointDelyName',
title: '下载点',
componentType: 'input',
align: 'left',
sorter: true,
},
{
dataIndex: 'suSname',
title: '供应商',
componentType: 'input',
align: 'left',
@ -70,15 +85,6 @@ export const columns: BasicColumn[] = [
sorter: true,
},
{
dataIndex: 'pointDelyName',
title: '下载点',
componentType: 'input',
align: 'left',
sorter: true,
},
{
dataIndex: 'qtySalesGj',
title: '批复量(吉焦)',
@ -159,7 +165,14 @@ export const columns: BasicColumn[] = [
sorter: true,
},
{
dataIndex: 'ksNmae',
title: '销售合同',
componentType: 'input',
align: 'left',
sorter: true,
},
{
dataIndex: 'kpName',
title: '采购合同',

View File

@ -9,128 +9,55 @@
<slot name="icon"><save-outlined /></slot>保存
</a-button>
</div>
<a-form ref="formRef" :model="formState" :rules="rules" v-bind="layout">
<a-row>
<a-col :span="7">
<a-form-item label="计量日期" name="reply" >
<a-date-picker v-model:value="formState.datePlan" :disabled-date="disabledDateStart" style="width: 100%" placeholder="请选择计划日期" />
</a-form-item>
</a-col>
<a-col :span="7">
<a-form-item label="客户名称/简称/编码" name="kName">
<a-input v-model:value="formState.kName" placeholder="请选择合同" />
</a-form-item>
</a-col>
<a-col :span="7">
<a-form-item label="供应商名称/简称/编码" name="kName">
<a-input v-model:value="formState.kName" placeholder="请选择合同" />
</a-form-item>
</a-col>
<a-col :span="3">
<a-button style="margin: 0 10px" type="primary" @click="onSearch">搜索</a-button>
<a-button @click="onReset">重置</a-button>
</a-col>
<a-col :span="7">
<a-form-item label="计划日期" name="reply" >
<a-date-picker v-model:value="formState.datePlan" :disabled-date="disabledDateStart" style="width: 100%" placeholder="请选择计划日期" />
</a-form-item>
</a-col>
<a-col :span="7">
<a-form-item label="上载点" name="kName">
<a-input v-model:value="formState.kName" placeholder="请选择上载点" />
</a-form-item>
</a-col>
<a-col :span="7">
<a-form-item label="下载点" name="kName">
<a-input v-model:value="formState.kName" placeholder="请选择下载点" />
</a-form-item>
</a-col>
</a-row>
</a-form>
<BasicTable @register="registerTable" class="contractFactListModal"></BasicTable>
<searchForm @search="onSearch" @reset="onReset" ></searchForm>
<BasicTable @register="registerTable"></BasicTable>
</div>
</a-spin>
</template>
<script lang="ts" setup>
import { Card } from 'ant-design-vue';
import { useRouter } from 'vue-router';
import { FromPageType, RecordType } from '/@/enums/workflowEnum';
import { ref, computed, onMounted, onBeforeMount, nextTick, defineAsyncComponent, reactive, defineComponent, watch} from 'vue';
import { SaveOutlined, } from '@ant-design/icons-vue';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
import { useMultipleTabStore } from '/@/store/modules/multipleTab';
import useEventBus from '/@/hooks/event/useEventBus';
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 dayjs from 'dayjs';
import { getAppEnvConfig } from '/@/utils/env';
import { message } from 'ant-design-vue';
import { useUserStore } from '/@/store/modules/user';
import { BasicTable, useTable, FormSchema, BasicColumn, TableAction } from '/@/components/Table';
import { getLngPngMeasureSalesPurPageAdd } from '/@/api/dayPlan/PngMeasureSalesPur';
import { getLngPngMeasureSalesPurPageAdd, addLngPngMeasureSalesPur } from '/@/api/dayPlan/PngMeasureSalesPur';
import {formConfig, searchFormSchema, columns } from './config';
import searchForm from './searchForm.vue';
const userStore = useUserStore();
const userInfo = userStore.getUserInfo;
const formType = ref('2'); // 0 新建 1 修改 2 查看
const formRef = ref();
const props = defineProps({
disabled: false,
id: ''
});
const { bus, FORM_LIST_MODIFIED } = useEventBus();
const router = useRouter();
const { currentRoute } = router;
const isDisable = ref(false);
const { formPath } = currentRoute.value.query;
const pathArr = [];
const tabStore = useMultipleTabStore();
const formProps = ref(null);
const formId = ref(currentRoute.value?.params?.id);
const pageType = ref(currentRoute.value.query?.type);
const pageId = ref(currentRoute.value.query?.id)
const spinning = ref(false);
const { t } = useI18n();
const hasDel = ref(false)
const formState = reactive({
});
const formState = ref({});
const [register, { openModal:openModal}] = useModal();
const rules= reactive({
// kNo: [{ required: true, message: "该项为必填项", trigger: 'change' }],
});
const layout = {
labelCol: { span: 9 },
wrapperCol: { span: 18 },
}
const basicFormRef = ref()
let optionSelect= reactive({
approCodeList: [],
});
onMounted(() => {
});
const emit = defineEmits(['success', 'register']);
const { notification } = useMessage();
const selectedKeys = ref<string[]>([]);
const selectedValues = ref([]);
const [registerTable, { reload }] = useTable({
title: t('管道气计量新增列表'),
api: getLngPngMeasureSalesPurPageAdd,
columns,
columns: columns,
pagination: true,
canResize: false,
@ -142,7 +69,7 @@
},
immediate: true,
beforeFetch: (params) => {
return { ...params,...formState};
return { ...params,...formState.value};
},
rowSelection: {
type: 'checkbox',
@ -153,54 +80,31 @@
selectedKeys.value = rowKeys;
selectedValues.value = e
}
const onSearch = () => {
const onSearch = (val) => {
formState.value = val
reload()
}
const onReset = () => {
formState = {
page: 1,
size: 10
}
formState.value ={ page: 1,size: 10}
}
function close() {
tabStore.closeTab(currentRoute.value, router);
}
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
async function checkBtn() {
if (!selectedValues.value.length) {
message.warn('请选择数据')
return
}
spinning.value = true;
try {
if (type == 'reject') {
if (!formState.reply) {
message.warn('请输入批复意见')
return
}
}
await approveLngPngAppro(params);
await addLngPngMeasureSalesPur(selectedValues.value);
spinning.value = false;
notification.success({
message: 'Tip',
description: type == 'agree' ? '审批通过':'已驳回'
}); //提示消息
description: '保存成功'
});
setTimeout(() => {
bus.emit(FORM_LIST_MODIFIED, {});
close();

View File

@ -0,0 +1,120 @@
<template>
<a-form ref="formRef" :model="formState" v-bind="layout">
<a-row>
<a-col :span="6">
<a-form-item label="计量日期" name="dateMea" >
<a-range-picker v-model:value="formState.dateMea" />
</a-form-item>
</a-col>
<a-col :span="7">
<a-form-item label="客户名称/简称/编码" name="cuSname">
<a-input v-model:value="formState.cuSname" placeholder="请输入" />
</a-form-item>
</a-col>
<a-col :span="7">
<a-form-item label="供应商名称/简称/编码" name="suSname">
<a-input v-model:value="formState.suSname" placeholder="请输入" />
</a-form-item>
</a-col>
<a-col :span="4">
<div class="btnFoot">
<a-button style="margin: 0 10px" type="primary" @click="onSearch">搜索</a-button>
<a-button @click="onReset">重置</a-button>
<AButton type="link" size="small" @click="toggleAdvanced">
{{ isAdvanced ? t('收起') : t('展开') }}
<BasicArrow class="ml-1" :expand="!isAdvanced" up />
</AButton>
</div>
</a-col>
<a-col :span="6" v-if="isAdvanced">
<a-form-item label="计划日期" name="reply" >
<a-range-picker v-model:value="formState.datePlan" />
</a-form-item>
</a-col>
<a-col :span="7" v-if="isAdvanced">
<a-form-item label="上载点" name="pointUpName">
<a-input-search v-model:value="formState.pointUpName" readonly placeholder="请选择上载点" @search="onSearchDownLoad('up')" />
</a-form-item>
</a-col>
<a-col :span="7" v-if="isAdvanced">
<a-form-item label="下载点" name="pointDelyName">
<a-input-search v-model:value="formState.pointDelyName" readonly placeholder="请选择下载点" @search="onSearchDownLoad('dely')"/>
</a-form-item>
</a-col>
</a-row>
</a-form>
<downloadPointModal @register="register" @success="handleSuccessDownLoad" />
</template>
<script lang="ts" setup>
import { useRouter } from 'vue-router';
import { ref, computed, onMounted, onBeforeMount, nextTick, defineAsyncComponent, reactive, defineComponent, watch} from 'vue';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
import { useMultipleTabStore } from '/@/store/modules/multipleTab';
import useEventBus from '/@/hooks/event/useEventBus';
import { useModal } from '/@/components/Modal';
import dayjs from 'dayjs';
import { message } from 'ant-design-vue';
import { useUserStore } from '/@/store/modules/user';
import downloadPointModal from '/@/components/common/downloadPointModal.vue';
import { Button as AButton, ButtonProps } from '/@/components/Button';
import { BasicArrow } from '/@/components/Basic';
const userStore = useUserStore();
const { bus, FORM_LIST_MODIFIED } = useEventBus();
const router = useRouter();
const { currentRoute } = router;
const tabStore = useMultipleTabStore();
const spinning = ref(false);
const { t } = useI18n();
const formState = ref({});
const [register, { openModal:openModal}] = useModal();
const layout = {
labelCol: { span: 9 },
wrapperCol: { span: 15 },
}
const isAdvanced = ref(false)
onMounted(() => {
});
const emit = defineEmits(['search', 'reset']);
function toggleAdvanced() {
isAdvanced.value = !isAdvanced.value
}
const onSearchDownLoad = (val)=> {
openModal(true,{isUpdate: false, type: val})
}
const handleSuccessDownLoad = (val, type)=> {
if (type === 'up') {
formState.value.pointUpName = val[0].fullName
formState.value.pointUpCode = val[0].code
} else {
formState.value.pointDelyName = val[0].fullName
formState.value.pointDelyCode = val[0].code
}
}
const onSearch = () => {
emit('search', formState.value)
}
const onReset = () => {
formState.value ={ page: 1,size: 10}
emit('reset', formState.value)
}
</script>
<style lang="less" scoped>
.btnFoot {
display: flex;
align-items: center;
}
</style>