|
@@ -1,154 +1,52 @@
|
|
|
<template>
|
|
<template>
|
|
|
<!-- 过滤客户资料表格 -->
|
|
<!-- 过滤客户资料表格 -->
|
|
|
- <div class="filter-custom-table">
|
|
|
|
|
- <a-select label-in-value
|
|
|
|
|
- class="conditionSelect"
|
|
|
|
|
- style="width: 120px"
|
|
|
|
|
- v-model:value="contracttype"
|
|
|
|
|
- placeholder="全部合同类型"
|
|
|
|
|
- @change="handleChange">
|
|
|
|
|
- <a-select-option value="1">采购</a-select-option>
|
|
|
|
|
- <a-select-option value="-1">销售</a-select-option>
|
|
|
|
|
- </a-select>
|
|
|
|
|
- <a-select label-in-value
|
|
|
|
|
- class="conditionSelect"
|
|
|
|
|
- style="width: 120px"
|
|
|
|
|
- v-model:value="pricetype"
|
|
|
|
|
- placeholder="全部定价类型"
|
|
|
|
|
- @change="handlePricetype">
|
|
|
|
|
- <a-select-option value="1">一口价</a-select-option>
|
|
|
|
|
- <a-select-option value="2">点价</a-select-option>
|
|
|
|
|
- <a-select-option value="3">暂定价</a-select-option>
|
|
|
|
|
- </a-select>
|
|
|
|
|
- <a-input v-model:value="contractno"
|
|
|
|
|
- class="tableConditionInput"
|
|
|
|
|
- placeholder="模糊搜索合同编号" />
|
|
|
|
|
- <a-input v-model:value="negative"
|
|
|
|
|
- class="tableConditionInput"
|
|
|
|
|
- placeholder="模糊搜索对手方" />
|
|
|
|
|
- <a-button class="selectBtn"
|
|
|
|
|
- @click="search">查询</a-button>
|
|
|
|
|
- <a-button class="selectBtn"
|
|
|
|
|
- @click="reset">重置</a-button>
|
|
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <FilterOption :selectList="selectList"
|
|
|
|
|
+ :inputList="inputList"
|
|
|
|
|
+ :fixedBtnList="fixedBtnList" />
|
|
|
<slot></slot>
|
|
<slot></slot>
|
|
|
-
|
|
|
|
|
- <!-- 新增弹窗 -->
|
|
|
|
|
-
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
|
-import { defineComponent, ref, SetupContext } from 'vue';
|
|
|
|
|
-
|
|
|
|
|
-// 搜索
|
|
|
|
|
-function handleSearch(context: SetupContext) {
|
|
|
|
|
- const contractno = ref<string>('');
|
|
|
|
|
- const negative = ref<string>('');
|
|
|
|
|
- interface Value {
|
|
|
|
|
- key: string;
|
|
|
|
|
- value: string;
|
|
|
|
|
- }
|
|
|
|
|
- // 全部合同类型
|
|
|
|
|
- let useType = '';
|
|
|
|
|
- const contracttype = ref<number | undefined>(undefined);
|
|
|
|
|
- function handleChange(value: Value) {
|
|
|
|
|
- useType = value.value;
|
|
|
|
|
- search();
|
|
|
|
|
- }
|
|
|
|
|
- // 全部定价类型
|
|
|
|
|
- const pricetype = ref<number | undefined>(undefined);
|
|
|
|
|
- let cachePricetype = '';
|
|
|
|
|
- function handlePricetype(value: Value) {
|
|
|
|
|
- cachePricetype = value.value;
|
|
|
|
|
- search();
|
|
|
|
|
- }
|
|
|
|
|
- function search() {
|
|
|
|
|
- const result = { contractno: [contractno.value], negative: [negative.value], contracttype: [useType], pricetype: [cachePricetype] };
|
|
|
|
|
- context.emit('search', result);
|
|
|
|
|
- }
|
|
|
|
|
- function reset() {
|
|
|
|
|
- contractno.value = '';
|
|
|
|
|
- negative.value = '';
|
|
|
|
|
-
|
|
|
|
|
- contracttype.value = undefined;
|
|
|
|
|
- useType = '';
|
|
|
|
|
- pricetype.value = undefined;
|
|
|
|
|
- cachePricetype = '';
|
|
|
|
|
- search();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- return { contractno, negative, search, reset, contracttype, handleChange, pricetype, handlePricetype };
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
|
|
+import FilterOption from '@/common/components/filter/index.vue';
|
|
|
|
|
+import { defineComponent } from 'vue';
|
|
|
|
|
+import { handleFilter, InputList, SelectList } from '@/common/setup/filter';
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
name: 'filter-spot-contract-table',
|
|
name: 'filter-spot-contract-table',
|
|
|
- components: {},
|
|
|
|
|
|
|
+ components: { FilterOption },
|
|
|
setup(props, context) {
|
|
setup(props, context) {
|
|
|
|
|
+ const select: SelectList[] = [
|
|
|
|
|
+ {
|
|
|
|
|
+ value: undefined,
|
|
|
|
|
+ key: 'contracttype',
|
|
|
|
|
+ placeholder: '全部合同类型',
|
|
|
|
|
+ list: [
|
|
|
|
|
+ { value: 1, lable: '采购' },
|
|
|
|
|
+ { value: -1, lable: '销售' },
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ value: undefined,
|
|
|
|
|
+ key: 'pricetype',
|
|
|
|
|
+ placeholder: '全部定价类型',
|
|
|
|
|
+ list: [
|
|
|
|
|
+ { value: 1, lable: '一口价' },
|
|
|
|
|
+ { value: 2, lable: '点价' },
|
|
|
|
|
+ { value: 3, lable: '暂定价' },
|
|
|
|
|
+ ],
|
|
|
|
|
+ },
|
|
|
|
|
+ ];
|
|
|
|
|
+ const input: InputList[] = [
|
|
|
|
|
+ { value: '', placeholder: '模糊搜索合同编号', key: 'contractno' },
|
|
|
|
|
+ { value: '', placeholder: '模糊搜索对手方', key: 'negative' },
|
|
|
|
|
+ ];
|
|
|
return {
|
|
return {
|
|
|
- ...handleSearch(context),
|
|
|
|
|
|
|
+ ...handleFilter(select, input, context),
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="less">
|
|
<style lang="less">
|
|
|
-.filter-custom-table {
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- display: inline-flex;
|
|
|
|
|
- padding-top: 9px;
|
|
|
|
|
- padding-bottom: 6px;
|
|
|
|
|
-}
|
|
|
|
|
-.ant-select-single:not(.ant-select-customize-input) {
|
|
|
|
|
- margin-right: 10px;
|
|
|
|
|
- // background: #252D34;
|
|
|
|
|
- // .rounded-corners(3px);
|
|
|
|
|
- .ant-select-selector {
|
|
|
|
|
- height: 30px;
|
|
|
|
|
- padding: 0 8px;
|
|
|
|
|
- background: @m-grey9;
|
|
|
|
|
- border: none;
|
|
|
|
|
- .rounded-corners(3px);
|
|
|
|
|
- color: @m-grey10;
|
|
|
|
|
- .ant-select-arrow {
|
|
|
|
|
- right: 8px;
|
|
|
|
|
- color: @m-grey1;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- .ant-select-arrow {
|
|
|
|
|
- color: @m-grey1;
|
|
|
|
|
- }
|
|
|
|
|
- .ant-select-selection-item {
|
|
|
|
|
- color: @m-white1;
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-.conditionSelect + .conditionSelect {
|
|
|
|
|
- margin-left: 10px;
|
|
|
|
|
-}
|
|
|
|
|
-.selectBtn.ant-btn {
|
|
|
|
|
- margin-left: 10px;
|
|
|
|
|
- width: 80px;
|
|
|
|
|
- height: 30px;
|
|
|
|
|
- line-height: 30px;
|
|
|
|
|
- text-align: center;
|
|
|
|
|
- background: linear-gradient(0deg, @m-grey15 0%, @m-grey16 98%);
|
|
|
|
|
- border: 0;
|
|
|
|
|
- color: @m-white0;
|
|
|
|
|
- font-size: 14px;
|
|
|
|
|
- .rounded-corners(3px);
|
|
|
|
|
- &:hover,
|
|
|
|
|
- &:focus {
|
|
|
|
|
- background: linear-gradient(0deg, @m-grey15-hover 0%, @m-grey16-hover 98%);
|
|
|
|
|
- color: rgba(@m-white0, 0.8);
|
|
|
|
|
- border: 0;
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-.operBtn.ant-btn:extend(.selectBtn.ant-btn) {
|
|
|
|
|
- background: linear-gradient(0deg, @m-blue6 0%, @m-blue7 99%);
|
|
|
|
|
- &:hover,
|
|
|
|
|
- &:focus {
|
|
|
|
|
- background: linear-gradient(0deg, @m-blue6-hover 0%, @m-blue7-hover 99%);
|
|
|
|
|
- color: rgba(@m-white0, 0.8);
|
|
|
|
|
- border: 0;
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
</style>;
|
|
</style>;
|