| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <!-- 搜索表单 -->
- <template>
- <ele-card :body-style="{ paddingBottom: '8px' }">
- <ProSearch
- :items="formItems"
- ref="searchRef"
- @search="search"
- :offset="1"
- />
- </ele-card>
- </template>
- <script setup>
- import { reactive, ref, defineEmits } from 'vue';
- import ProSearch from '@/components/CommonPage/ProSearch2.vue';
- let { proxy } = getCurrentInstance();
- const emit = defineEmits(['search']);
- const godownList = ref([]);
- const formItems = computed(() => {
- return [
- {
- type: 'daterange',
- label: '日期',
- prop: 'time',
- props: {
- format: 'YYYY-MM-DD',
- valueFormat: 'YYYY-MM-DD',
- onChange: (value) => {
- searchRef.value?.setData({
- statisticDateStart: value ? value[0] : '',
- statisticDateEnd: value ? value[1] : ''
- });
- }
- },
- colProps: {
- span: 6
- }
- },
- {
- type: 'select',
- label: '仓库名称',
- prop: 'godownId',
- options: godownList.value.map((d) => {
- return { label: d.godownName, value: d.id };
- }),
- props: {
- placeholder: '请选择或输入搜索',
- filterable: true
- }
- }
- ];
- });
- const initKeys = reactive({
- statisticDateStart: '',
- statisticDateEnd: '',
- godownId: ''
- });
- function getStoreList(name = '') {
- return proxy.$http.post(`/baseinfo/godown/searchGodown?name=${name}`);
- }
- getStoreList().then((res) => {
- godownList.value = res.data.data;
- });
- const searchRef = ref(null);
- /** 搜索 */
- const search = (data) => {
- emit('search', { ...data });
- };
- </script>
|