Files
geg-gas-web/src/views/dayPlan/PngMeasureSalesPur/components/searchForm.vue

167 lines
6.2 KiB
Vue
Raw Normal View History

2026-01-19 17:55:47 +08:00
<template>
<a-form ref="formRef" :model="formState" v-bind="layout">
<a-row>
<a-col :span="6">
<a-form-item label="计量日期" name="dateMea" >
2026-03-11 13:47:57 +08:00
<RangePicker v-model:value="formState.dateMea" />
2026-01-19 17:55:47 +08:00
</a-form-item>
</a-col>
<a-col :span="7">
<a-form-item label="客户名称/简称/编码" name="cuSname">
2026-01-20 10:05:13 +08:00
<a-input v-model:value="formState.cuSname" placeholder="请输入客户名称/简称/编码" />
2026-01-19 17:55:47 +08:00
</a-form-item>
</a-col>
<a-col :span="7">
<a-form-item label="供应商名称/简称/编码" name="suSname">
2026-01-20 10:05:13 +08:00
<a-input v-model:value="formState.suSname" placeholder="请输入供应商名称/简称/编码" />
2026-01-19 17:55:47 +08:00
</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>
2026-02-02 10:43:46 +08:00
<!-- <a-col :span="6" v-if="isAdvanced">
2026-01-19 17:55:47 +08:00
<a-form-item label="计划日期" name="reply" >
<a-range-picker v-model:value="formState.datePlan" />
</a-form-item>
2026-02-02 10:43:46 +08:00
</a-col> -->
<a-col :span="6" v-if="isAdvanced">
2026-01-19 17:55:47 +08:00
<a-form-item label="上载点" name="pointUpName">
2026-02-02 10:43:46 +08:00
<a-input v-model:value="formState.pointUpName" placeholder="请输入" />
<!-- <a-input-search v-model:value="formState.pointUpName" readonly placeholder="请选择上载点" @search="onSearchDownLoad('up')" /> -->
2026-01-19 17:55:47 +08:00
</a-form-item>
</a-col>
<a-col :span="7" v-if="isAdvanced">
<a-form-item label="下载点" name="pointDelyName">
2026-02-02 10:43:46 +08:00
<a-input v-model:value="formState.pointDelyName" placeholder="请输入" />
<!-- <a-input-search v-model:value="formState.pointDelyName" readonly placeholder="请选择下载点" @search="onSearchDownLoad('dely')"/> -->
</a-form-item>
</a-col>
<a-col :span="7" v-if="isAdvanced">
<a-form-item label="状态" name="statusCode">
<a-select v-model:value="formState.statusCode" :disabled="isDisable" placeholder="请选择" style="width: 100%" allow-clear >
<a-select-option v-for="item in statusList" :key="item.value" :value="item.value">
{{ item.label }}
</a-select-option>
</a-select>
<!-- <a-input-search v-model:value="formState.pointDelyName" readonly placeholder="请选择下载点" @search="onSearchDownLoad('dely')"/> -->
2026-01-19 17:55:47 +08:00
</a-form-item>
</a-col>
</a-row>
</a-form>
<downloadPointModal @register="register" @success="handleSuccessDownLoad" />
</template>
<script lang="ts" setup>
import { useRouter } from 'vue-router';
2026-03-11 13:47:57 +08:00
import { RangePicker } from '/@/components/RangePicker';
2026-01-19 17:55:47 +08:00
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)
2026-02-02 10:43:46 +08:00
const statusList = [
{label: '计量中', value: 'JLZ'},
{label: '结算中', value: 'JSZ'},
{label: '已结算', value: 'YJS'},
{label: '计量完成', value: 'JLWC'},
]
2026-01-19 17:55:47 +08:00
onMounted(() => {
});
2026-01-20 10:05:13 +08:00
const emit = defineEmits(['search', 'reset', 'toggle']);
2026-01-19 17:55:47 +08:00
function toggleAdvanced() {
isAdvanced.value = !isAdvanced.value
2026-01-20 10:05:13 +08:00
emit('toggle', isAdvanced.value)
2026-01-19 17:55:47 +08:00
}
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 = () => {
2026-01-20 10:05:13 +08:00
let obj = {
...formState.value,
2026-02-02 10:43:46 +08:00
// startDate: formState.value.datePlan ? dayjs(formState.value.datePlan[0]).format('YYYY-MM-DD') : '',
// endDate: formState.value.datePlan ? dayjs(formState.value.datePlan[1]).format('YYYY-MM-DD') : '',
2026-01-20 17:32:35 +08:00
dateMeaStart: formState.value.dateMea ? dayjs(formState.value.dateMea[0]).format('YYYY-MM-DD') : '',
dateMeaEnd: formState.value.dateMea ? dayjs(formState.value.dateMea[1]).format('YYYY-MM-DD') : '',
2026-01-20 10:05:13 +08:00
}
2026-02-02 10:43:46 +08:00
// delete obj.datePlan
2026-01-20 10:05:13 +08:00
delete obj.dateMea
emit('search', obj)
2026-01-19 17:55:47 +08:00
}
const onReset = () => {
formState.value ={ page: 1,size: 10}
emit('reset', formState.value)
}
</script>
<style lang="less" scoped>
.btnFoot {
display: flex;
align-items: center;
}
2026-01-20 10:05:13 +08:00
.ant-form-item {
margin-bottom: 8px !important;
}
:deep( .ant-col-6) {
width: 320px !important;
max-width: 320px !important;;
}
:deep(.ant-col-6 .ant-form-item-label) {
width: 70px !important;
max-width: 70px !important;
}
:deep(.ant-col-6 .ant-form-item-control) {
width: 240px !important;
max-width: 240px !important;
}
2026-01-19 17:55:47 +08:00
</style>