客户需求
This commit is contained in:
232
src/views/dayPlan/PngMeasureSalesPur/components/createForm.vue
Normal file
232
src/views/dayPlan/PngMeasureSalesPur/components/createForm.vue
Normal file
@ -0,0 +1,232 @@
|
||||
<template>
|
||||
<a-spin :spinning="spinning" tip="加载中...">
|
||||
<div class="page-bg-wrap formViewStyle pdcss">
|
||||
<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">
|
||||
<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>
|
||||
</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 {formConfig, searchFormSchema, columns } from './config';
|
||||
|
||||
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 [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,
|
||||
|
||||
pagination: true,
|
||||
canResize: false,
|
||||
formConfig: {
|
||||
labelCol:{span: 9},
|
||||
schemas: [],
|
||||
showResetButton: false,
|
||||
showSubmitButton: false
|
||||
},
|
||||
immediate: true,
|
||||
beforeFetch: (params) => {
|
||||
return { ...params,...formState};
|
||||
},
|
||||
rowSelection: {
|
||||
type: 'checkbox',
|
||||
onChange: onSelectChange
|
||||
},
|
||||
});
|
||||
function onSelectChange(rowKeys: string[], e) {
|
||||
selectedKeys.value = rowKeys;
|
||||
selectedValues.value = e
|
||||
}
|
||||
const onSearch = () => {
|
||||
reload()
|
||||
}
|
||||
const onReset = () => {
|
||||
formState = {
|
||||
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
|
||||
}
|
||||
spinning.value = true;
|
||||
try {
|
||||
if (type == 'reject') {
|
||||
if (!formState.reply) {
|
||||
message.warn('请输入批复意见')
|
||||
return
|
||||
}
|
||||
}
|
||||
await approveLngPngAppro(params);
|
||||
spinning.value = false;
|
||||
notification.success({
|
||||
message: 'Tip',
|
||||
description: type == 'agree' ? '审批通过':'已驳回'
|
||||
}); //提示消息
|
||||
setTimeout(() => {
|
||||
bus.emit(FORM_LIST_MODIFIED, {});
|
||||
close();
|
||||
}, 500);
|
||||
}catch (errorInfo) {
|
||||
spinning.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.page-bg-wrap {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.top-toolbar {
|
||||
min-height: 44px;
|
||||
margin-bottom: 12px;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
.pdcss {
|
||||
padding:0px 12px 6px 12px !important;
|
||||
}
|
||||
:deep(.ant-table-title) {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user