|
|
@@ -2,7 +2,8 @@
|
|
|
<!-- 过滤 -->
|
|
|
<div class="filterTable">
|
|
|
<a-space>
|
|
|
- <a-date-picker class="commonDatePicker" v-model:value="date" />
|
|
|
+ <a-date-picker class="commonDatePicker"
|
|
|
+ v-model:value="date" />
|
|
|
</a-space>
|
|
|
<FilterOption :selectList="selectList"
|
|
|
:inputList="inputList"
|
|
|
@@ -16,25 +17,42 @@ import FilterOption from '@/common/components/filter/index.vue';
|
|
|
import { defineComponent, ref } from 'vue';
|
|
|
import { handleFilter, InputList, SelectList } from '@/common/setup/filter';
|
|
|
import { Moment } from 'moment';
|
|
|
+import { formatTime, initData } from '@/common/methods';
|
|
|
+import { getGoodsList } from '@/services/bus/goods';
|
|
|
+import { SlotParam } from '@/common/setup/filter/interface';
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'filter-platinum_pick_query',
|
|
|
components: { FilterOption },
|
|
|
setup(props, context) {
|
|
|
- const date = ref<Moment[]>();
|
|
|
+ const date = ref<Moment>();
|
|
|
const select: SelectList[] = [
|
|
|
{
|
|
|
value: undefined,
|
|
|
- key: 'contracttype1',
|
|
|
+ key: 'goodsid',
|
|
|
placeholder: '选择商品',
|
|
|
- list: [
|
|
|
- { value: 1, lable: '采购' },
|
|
|
- { value: -1, lable: '销售' },
|
|
|
- ],
|
|
|
+ list: [],
|
|
|
},
|
|
|
];
|
|
|
+ const slotParam: SlotParam = {
|
|
|
+ search(result: any) {
|
|
|
+ const time = date.value;
|
|
|
+ if (time) {
|
|
|
+ result.tradedate = formatTime(time, 'd');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ reset() {
|
|
|
+ date.value = undefined;
|
|
|
+ },
|
|
|
+ };
|
|
|
+
|
|
|
const input: InputList[] = [];
|
|
|
- const { selectList, inputList, fixedBtnList } = handleFilter(select, input, context);
|
|
|
+ const { selectList, inputList, fixedBtnList } = handleFilter(select, input, context, slotParam);
|
|
|
+ initData(() => {
|
|
|
+ select[0].list = getGoodsList().map((e) => {
|
|
|
+ return { value: e.goodsid, lable: e.goodsname };
|
|
|
+ });
|
|
|
+ });
|
|
|
return {
|
|
|
date,
|
|
|
selectList,
|