|
|
@@ -1,39 +1,115 @@
|
|
|
<template>
|
|
|
<!-- 过滤客户资料表格 -->
|
|
|
<div class="filterTable">
|
|
|
- <FilterOption :selectList="selectList"
|
|
|
- :inputList="inputList"
|
|
|
- :fixedBtnList="fixedBtnList" />
|
|
|
- <slot></slot>
|
|
|
+ <div class="filter-custom-table">
|
|
|
+ <a-select label-in-value
|
|
|
+ class="conditionSelect"
|
|
|
+ style="width: 120px"
|
|
|
+ v-model:value="selectedReportType"
|
|
|
+ @change="update"
|
|
|
+ placeholder="请选择报表类型">
|
|
|
+ <a-select-option v-for="item in reportType"
|
|
|
+ :key="item.value">
|
|
|
+ {{item.lable}}
|
|
|
+ </a-select-option>
|
|
|
+ </a-select>
|
|
|
+ <a-space direction="vertical">
|
|
|
+ <a-date-picker v-model:value="date"
|
|
|
+ @change="update"
|
|
|
+ :format="dateFormat" />
|
|
|
+ </a-space>
|
|
|
+ <!-- <FilterOption :selectList="selectList"
|
|
|
+ :inputList="[]"
|
|
|
+ :fixedBtnList="fixedBtnList" /> -->
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
import FilterOption from '@/common/components/filter/index.vue';
|
|
|
import { defineComponent } from 'vue';
|
|
|
-import { handleFilter, InputList, SelectList } from '@/common/setup/filter';
|
|
|
+import { handleReprotType } from '../../../setup';
|
|
|
+import { ref } from 'vue';
|
|
|
+import { Moment } from 'moment';
|
|
|
+import moment from 'moment';
|
|
|
+import { handleFilter, SelectList } from '@/common/setup/filter';
|
|
|
+import { initData } from '@/common/methods';
|
|
|
+import { handlerManagerList } from '@/common/setup/user';
|
|
|
+import { QueryMiddleGoodsDetail } from '@/services/go/ermcp/goodsInfo';
|
|
|
+import { SelectOption } from '@/common/setup/filter/interface';
|
|
|
+
|
|
|
export default defineComponent({
|
|
|
- name: 'business-review-filter-table',
|
|
|
+ name: 'exposure-filter-table',
|
|
|
components: { FilterOption },
|
|
|
setup(props, context) {
|
|
|
+ const { selectedReportType, reportType } = handleReprotType();
|
|
|
+
|
|
|
+ const dateFormat = 'YYYYMMDD';
|
|
|
+ const date = ref<Moment>(moment(new Date(), 'YYYYMMDD'));
|
|
|
+
|
|
|
+ function update() {
|
|
|
+ const obj = { type: selectedReportType.value.key, date: moment(date.value).format(dateFormat) };
|
|
|
+ context.emit('update', obj);
|
|
|
+ }
|
|
|
const select: SelectList[] = [
|
|
|
{
|
|
|
value: undefined,
|
|
|
- key: 'contracttype',
|
|
|
- placeholder: '全部合同类型',
|
|
|
- list: [
|
|
|
- { value: 1, lable: '采购' },
|
|
|
- { value: -1, lable: '销售' },
|
|
|
- ],
|
|
|
+ key: 'userId',
|
|
|
+ placeholder: '全部交易用户',
|
|
|
+ list: [],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: undefined,
|
|
|
+ key: 'warehousetype',
|
|
|
+ placeholder: '全部套保品种',
|
|
|
+ list: [],
|
|
|
},
|
|
|
];
|
|
|
- const input: InputList[] = [
|
|
|
- { value: '', placeholder: '模糊搜索对手方', key: 'buyusernameOrsellusername' },
|
|
|
- { value: '', placeholder: '模糊搜索合同编号', key: 'contractno' },
|
|
|
- { value: '', placeholder: '模糊搜索现货品种', key: 'deliverygoodsname' },
|
|
|
- ];
|
|
|
+ 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;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // 获取套保品种
|
|
|
+ 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;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ // initData(() => {
|
|
|
+ // Promise.all([getUserList(), getTBList()]).then((res) => {
|
|
|
+ // select[0].list = res[0]; // 交易用户
|
|
|
+ // select[1].list = res[1]; // 套保品种
|
|
|
+ // updateSelected(select);
|
|
|
+ // });
|
|
|
+ // });
|
|
|
return {
|
|
|
- ...handleFilter(select, input, context),
|
|
|
+ reportType,
|
|
|
+ selectedReportType,
|
|
|
+ selectList,
|
|
|
+ inputList,
|
|
|
+ fixedBtnList,
|
|
|
+ date,
|
|
|
+ dateFormat,
|
|
|
+ update,
|
|
|
};
|
|
|
},
|
|
|
});
|
|
|
@@ -41,3 +117,4 @@ export default defineComponent({
|
|
|
|
|
|
<style lang="less">
|
|
|
</style>;
|
|
|
+
|