|
|
@@ -1,85 +1,117 @@
|
|
|
<template>
|
|
|
- <!-- 过滤客户资料表格 -->
|
|
|
<div class="filterTable">
|
|
|
- <FilterOption :selectList="selectList" :inputList="inputList" :fixedBtnList="fixedBtnList" />
|
|
|
+ <FilterOption :selectList="selectList" />
|
|
|
<slot></slot>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
-import FilterOption from '@/common/components/filter/index.vue';
|
|
|
-import { defineComponent, ref } from 'vue';
|
|
|
-import { handleFilter, InputList, SelectList } from '@/common/setup/filter';
|
|
|
-import { initData } from '@/common/methods';
|
|
|
-import APP from '@/services';
|
|
|
-import { Ermcp3Brand, Ermcp3Wrstandard, ErmcpDeliveryGoodsDetailEx } from '@/services/go/ermcp/goodsInfo/interface';
|
|
|
+import { defineComponent } from 'vue';
|
|
|
+import { initData } from '@/common/export/table';
|
|
|
+import { Ermcp3AreaStock } from '@/services/go/ermcp/search-inventory/interface';
|
|
|
+import { Ermcp3DeliveryGoodsDetail } from '@/services/go/ermcp/goodsInfo/interface/deliverygoodsdetail'
|
|
|
import { getWarehouseTypeEnumList } from '@/common/constants/enumsList';
|
|
|
+import { GetDeliveryGoodsDetail } from "@/services/go/ermcp/goodsInfo";
|
|
|
+import { useFilter } from '@/common/components/filter/setup';
|
|
|
+import FilterOption from '@/common/components/filter/index.vue';
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'filter-spot-contract-table',
|
|
|
components: { FilterOption },
|
|
|
setup(props, context) {
|
|
|
- const select = ref<SelectList[]>([
|
|
|
+ // 现货品种列表
|
|
|
+ const deliveryGoodsList: Ermcp3DeliveryGoodsDetail[] = [];
|
|
|
+ const { selectList, search } = useFilter<Ermcp3AreaStock>(context);
|
|
|
+
|
|
|
+ selectList.value = [
|
|
|
{
|
|
|
- value: undefined,
|
|
|
key: 'deliverygoodsid',
|
|
|
- placeholder: '全部现货品种',
|
|
|
- list: [],
|
|
|
- change: DGChange,
|
|
|
+ alias: 'deliverygoodsname',
|
|
|
+ selectedValue: 0,
|
|
|
+ options: [
|
|
|
+ { label: '全部现货品种', value: 0 },
|
|
|
+ ],
|
|
|
+ onChange: (value: string | number) => {
|
|
|
+ selectList.value[1].selectedValue = 0;
|
|
|
+ selectList.value[1].options = [{ label: '全部商品', value: 0 }];
|
|
|
+
|
|
|
+ selectList.value[2].selectedValue = '';
|
|
|
+ selectList.value[2].options = [{ label: '全部品牌', value: '' }];
|
|
|
+
|
|
|
+ deliveryGoodsList.forEach((item) => {
|
|
|
+ if (item.deliverygoodsid === value) {
|
|
|
+ // 商品列表
|
|
|
+ item.wdlst.forEach((e) => {
|
|
|
+ selectList.value[1].options.push({
|
|
|
+ label: e.wrstandardname,
|
|
|
+ value: e.wrstandardid,
|
|
|
+ })
|
|
|
+ })
|
|
|
+ // 品牌列表
|
|
|
+ item.bdlst.forEach((e) => {
|
|
|
+ if (e.isvalid) {
|
|
|
+ selectList.value[2].options.push({
|
|
|
+ label: e.brandname,
|
|
|
+ value: e.brandname,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ search();
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
- value: undefined,
|
|
|
key: 'wrstandardid',
|
|
|
- placeholder: '全部商品',
|
|
|
- list: [],
|
|
|
+ alias: 'wrstandardname',
|
|
|
+ selectedValue: 0,
|
|
|
+ options: [
|
|
|
+ { label: '全部商品', value: 0 },
|
|
|
+ ],
|
|
|
+ onChange: search,
|
|
|
},
|
|
|
{
|
|
|
- value: undefined,
|
|
|
- key: 'spotgoodsbrandid',
|
|
|
- placeholder: '全部品牌',
|
|
|
- list: [],
|
|
|
+ key: 'brandname',
|
|
|
+ selectedValue: '',
|
|
|
+ options: [
|
|
|
+ { label: '全部品牌', value: '' },
|
|
|
+ ],
|
|
|
+ onChange: search,
|
|
|
},
|
|
|
{
|
|
|
- value: undefined,
|
|
|
- key: 'warehouseinfoid',
|
|
|
- placeholder: '全部仓库',
|
|
|
- list: [],
|
|
|
+ key: 'warehousetype',
|
|
|
+ alias: 'warehousecode',
|
|
|
+ selectedValue: 0,
|
|
|
+ options: [
|
|
|
+ { label: '全部仓库类型', value: 0 },
|
|
|
+ ],
|
|
|
+ onChange: search,
|
|
|
},
|
|
|
- ]);
|
|
|
- const input: InputList[] = [];
|
|
|
+ ]
|
|
|
+
|
|
|
+ // 数据初始化
|
|
|
initData(() => {
|
|
|
- // 现货品种列表
|
|
|
- select.value[0].list = APP.get('DeliveryGoodsList')
|
|
|
- .filter((e: ErmcpDeliveryGoodsDetailEx) => {
|
|
|
- return e.data.isvalid === 1;
|
|
|
+ GetDeliveryGoodsDetail().then((res) => {
|
|
|
+ deliveryGoodsList.push(...res.filter((item) => item.isvalid));
|
|
|
+ deliveryGoodsList.forEach((item) => {
|
|
|
+ selectList.value[0].options.push({
|
|
|
+ label: item.deliverygoodsname,
|
|
|
+ value: item.deliverygoodsid
|
|
|
+ })
|
|
|
})
|
|
|
- .map((el: ErmcpDeliveryGoodsDetailEx) => {
|
|
|
- const { deliverygoodsid, deliverygoodsname } = el.data;
|
|
|
- return { value: deliverygoodsid, lable: deliverygoodsname };
|
|
|
- });
|
|
|
- });
|
|
|
- function DGChange(id: number) {
|
|
|
- select.value[1].value = undefined;
|
|
|
- select.value[2].value = undefined;
|
|
|
- const temp = APP.get('DeliveryGoodsList').find((el: ErmcpDeliveryGoodsDetailEx) => el.data.deliverygoodsid === id);
|
|
|
- if (temp) {
|
|
|
- select.value[1].list = temp.gmlist.map((e: Ermcp3Wrstandard) => {
|
|
|
- const { wrstandardid, wrstandardname } = e;
|
|
|
- return { value: wrstandardid, lable: wrstandardname };
|
|
|
- });
|
|
|
- select.value[2].list = temp.gblist.map((e: Ermcp3Brand) => {
|
|
|
- const { brandid, brandname } = e;
|
|
|
- return { value: brandid, lable: brandname };
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- select.value[3].list = getWarehouseTypeEnumList().map((e) => {
|
|
|
- const { enumitemname, enumdicname } = e;
|
|
|
- return { value: enumitemname, lable: enumdicname };
|
|
|
- });
|
|
|
+ })
|
|
|
+
|
|
|
+ getWarehouseTypeEnumList().map((item) => {
|
|
|
+ selectList.value[3].options.push({
|
|
|
+ label: item.enumdicname,
|
|
|
+ value: item.enumitemname,
|
|
|
+ })
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
return {
|
|
|
- ...handleFilter(select, input, context),
|
|
|
- };
|
|
|
+ selectList,
|
|
|
+ }
|
|
|
},
|
|
|
-});
|
|
|
+})
|
|
|
</script>
|