|
@@ -1,9 +1,20 @@
|
|
|
<template>
|
|
<template>
|
|
|
<!-- 过滤客户资料表格 -->
|
|
<!-- 过滤客户资料表格 -->
|
|
|
<Filter @update="update">
|
|
<Filter @update="update">
|
|
|
- <!-- <FilterOption :selectList="selectList"
|
|
|
|
|
- :inputList="[]"
|
|
|
|
|
- :fixedBtnList="fixedBtnList" /> -->
|
|
|
|
|
|
|
+ <a-select label-in-value
|
|
|
|
|
+ class="conditionSelect ml10"
|
|
|
|
|
+ style="width: 120px"
|
|
|
|
|
+ v-model:value="selectedMd"
|
|
|
|
|
+ @change="mdChange"
|
|
|
|
|
+ placeholder="全部套保品种">
|
|
|
|
|
+ <a-select-option v-for="item in middleGoods"
|
|
|
|
|
+ :key="item.lable">
|
|
|
|
|
+ {{item.lable}}
|
|
|
|
|
+ </a-select-option>
|
|
|
|
|
+ </a-select>
|
|
|
|
|
+ <a-button class="selectBtn">查询</a-button>
|
|
|
|
|
+ <a-button class="selectBtn"
|
|
|
|
|
+ @click="reset">重置</a-button>
|
|
|
</Filter>
|
|
</Filter>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -11,74 +22,35 @@
|
|
|
import FilterOption from '@/common/components/filter/index.vue';
|
|
import FilterOption from '@/common/components/filter/index.vue';
|
|
|
import { defineComponent } from 'vue';
|
|
import { defineComponent } from 'vue';
|
|
|
import { ref } from 'vue';
|
|
import { ref } from 'vue';
|
|
|
-import { handleFilter, SelectList } from '@/common/setup/filter';
|
|
|
|
|
-import { handlerManagerList } from '@/common/setup/user';
|
|
|
|
|
-import { QueryMiddleGoodsDetail } from '@/services/go/ermcp/goodsInfo';
|
|
|
|
|
-import { SelectOption } from '@/common/setup/filter/interface';
|
|
|
|
|
import Filter from '../../../components/filter/index.vue';
|
|
import Filter from '../../../components/filter/index.vue';
|
|
|
-import { TypeAndTime } from '@/views/report/interface';
|
|
|
|
|
|
|
+import { handlMiddleGoods } from '@/views/report/setup';
|
|
|
|
|
+import { initData } from '@/common/methods';
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
name: 'exposure-filter-table',
|
|
name: 'exposure-filter-table',
|
|
|
components: { FilterOption, Filter },
|
|
components: { FilterOption, Filter },
|
|
|
setup(props, context) {
|
|
setup(props, context) {
|
|
|
- function update(value: TypeAndTime) {
|
|
|
|
|
|
|
+ const { middleGoods, getTBList } = handlMiddleGoods();
|
|
|
|
|
+ function update(value: any) {
|
|
|
context.emit('update', value);
|
|
context.emit('update', value);
|
|
|
}
|
|
}
|
|
|
- const select: SelectList[] = [
|
|
|
|
|
- {
|
|
|
|
|
- value: undefined,
|
|
|
|
|
- key: 'userId',
|
|
|
|
|
- placeholder: '全部交易用户',
|
|
|
|
|
- list: [],
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- value: undefined,
|
|
|
|
|
- key: 'warehousetype',
|
|
|
|
|
- placeholder: '全部套保品种',
|
|
|
|
|
- list: [],
|
|
|
|
|
- },
|
|
|
|
|
- ];
|
|
|
|
|
- const loading = ref<boolean>(false);
|
|
|
|
|
- // 交易用户
|
|
|
|
|
- const { tableList: userList, queryTable } = handlerManagerList(loading, 2);
|
|
|
|
|
- const { selectList, inputList, fixedBtnList, updateSelected } = handleFilter(select, [], context);
|
|
|
|
|
- // 获取交易用户
|
|
|
|
|
- function getUserList() {
|
|
|
|
|
- return queryTable().then(() => {
|
|
|
|
|
- const result: SelectOption[] = [];
|
|
|
|
|
- userList.value.forEach((e) => {
|
|
|
|
|
- e.userlist.forEach((el) => {
|
|
|
|
|
- result.push({ value: el.loginid, lable: `${el.loginname}-${el.logincode}` });
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
- return result;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ const selectedMd = ref(undefined);
|
|
|
|
|
+ function mdChange(id: any) {
|
|
|
|
|
+ context.emit('filter', { middlegoodsname: [id.key ? String(id.key) : ''] });
|
|
|
}
|
|
}
|
|
|
- // 获取套保品种
|
|
|
|
|
- function getTBList() {
|
|
|
|
|
- return QueryMiddleGoodsDetail().then((res) => {
|
|
|
|
|
- const result: SelectOption[] = [];
|
|
|
|
|
- res.forEach((e) => {
|
|
|
|
|
- const { isvalid, middlegoodsname, middlegoodsid } = e.mg;
|
|
|
|
|
- if (isvalid) {
|
|
|
|
|
- result.push({ value: middlegoodsid, lable: middlegoodsname });
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- return result;
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ function reset() {
|
|
|
|
|
+ selectedMd.value = undefined;
|
|
|
|
|
+ mdChange('');
|
|
|
}
|
|
}
|
|
|
- // initData(() => {
|
|
|
|
|
- // Promise.all([getUserList(), getTBList()]).then((res) => {
|
|
|
|
|
- // select[0].list = res[0]; // 交易用户
|
|
|
|
|
- // select[1].list = res[1]; // 套保品种
|
|
|
|
|
- // updateSelected(select);
|
|
|
|
|
- // });
|
|
|
|
|
- // });
|
|
|
|
|
|
|
+ initData(() => {
|
|
|
|
|
+ getTBList();
|
|
|
|
|
+ });
|
|
|
return {
|
|
return {
|
|
|
- selectList,
|
|
|
|
|
- inputList,
|
|
|
|
|
- fixedBtnList,
|
|
|
|
|
|
|
+ mdChange,
|
|
|
|
|
+ reset,
|
|
|
|
|
+ middleGoods,
|
|
|
|
|
+ update,
|
|
|
|
|
+ selectedMd,
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|