|
@@ -10,54 +10,75 @@
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
|
import FilterOption from '@/common/components/filter/index.vue';
|
|
import FilterOption from '@/common/components/filter/index.vue';
|
|
|
-import { defineComponent } from 'vue';
|
|
|
|
|
|
|
+import { defineComponent, ref } from 'vue';
|
|
|
import { handleFilter, InputList, SelectList } from '@/common/setup/filter';
|
|
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 { getWarehouseTypeEnumList } from '@/common/constants/enumsList';
|
|
|
|
|
+
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
name: 'filter-spot-contract-table',
|
|
name: 'filter-spot-contract-table',
|
|
|
components: { FilterOption },
|
|
components: { FilterOption },
|
|
|
setup(props, context) {
|
|
setup(props, context) {
|
|
|
- const select: SelectList[] = [
|
|
|
|
|
|
|
+ const select = ref<SelectList[]>([
|
|
|
{
|
|
{
|
|
|
value: undefined,
|
|
value: undefined,
|
|
|
key: 'deliverygoodsid',
|
|
key: 'deliverygoodsid',
|
|
|
placeholder: '全部现货品种',
|
|
placeholder: '全部现货品种',
|
|
|
- list: [
|
|
|
|
|
- { value: 1, lable: '采购' },
|
|
|
|
|
- { value: -1, lable: '销售' },
|
|
|
|
|
- ],
|
|
|
|
|
|
|
+ list: [],
|
|
|
|
|
+ change: DGChange,
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
value: undefined,
|
|
value: undefined,
|
|
|
key: 'wrstandardid',
|
|
key: 'wrstandardid',
|
|
|
placeholder: '全部品类',
|
|
placeholder: '全部品类',
|
|
|
- list: [
|
|
|
|
|
- { value: 1, lable: '一口价' },
|
|
|
|
|
- { value: 2, lable: '点价' },
|
|
|
|
|
- { value: 3, lable: '暂定价' },
|
|
|
|
|
- ],
|
|
|
|
|
|
|
+ list: [],
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
value: undefined,
|
|
value: undefined,
|
|
|
key: 'spotgoodsbrandid',
|
|
key: 'spotgoodsbrandid',
|
|
|
placeholder: '全部品牌',
|
|
placeholder: '全部品牌',
|
|
|
- list: [
|
|
|
|
|
- { value: 1, lable: '一口价' },
|
|
|
|
|
- { value: 2, lable: '点价' },
|
|
|
|
|
- { value: 3, lable: '暂定价' },
|
|
|
|
|
- ],
|
|
|
|
|
|
|
+ list: [],
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
value: undefined,
|
|
value: undefined,
|
|
|
key: 'warehouseinfoid',
|
|
key: 'warehouseinfoid',
|
|
|
placeholder: '全部仓库',
|
|
placeholder: '全部仓库',
|
|
|
- list: [
|
|
|
|
|
- { value: 1, lable: '一口价' },
|
|
|
|
|
- { value: 2, lable: '点价' },
|
|
|
|
|
- { value: 3, lable: '暂定价' },
|
|
|
|
|
- ],
|
|
|
|
|
|
|
+ list: [],
|
|
|
},
|
|
},
|
|
|
- ];
|
|
|
|
|
|
|
+ ]);
|
|
|
const input: InputList[] = [];
|
|
const input: InputList[] = [];
|
|
|
|
|
+ initData(() => {
|
|
|
|
|
+ // 现货品种列表
|
|
|
|
|
+ select.value[0].list = APP.get('DeliveryGoodsList')
|
|
|
|
|
+ .filter((e: ErmcpDeliveryGoodsDetailEx) => {
|
|
|
|
|
+ return e.data.isvalid === 1;
|
|
|
|
|
+ })
|
|
|
|
|
+ .map((el: ErmcpDeliveryGoodsDetailEx) => {
|
|
|
|
|
+ const { deliverygoodsid, deliverygoodsname } = el.data;
|
|
|
|
|
+ return { value: deliverygoodsid, lable: deliverygoodsname };
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ function DGChange(value: any) {
|
|
|
|
|
+ select.value[1].value = undefined;
|
|
|
|
|
+ select.value[2].value = undefined;
|
|
|
|
|
+ const temp = APP.get('DeliveryGoodsList').find((el: ErmcpDeliveryGoodsDetailEx) => el.data.deliverygoodsid === value.key);
|
|
|
|
|
+ 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 };
|
|
|
|
|
+ });
|
|
|
return {
|
|
return {
|
|
|
...handleFilter(select, input, context),
|
|
...handleFilter(select, input, context),
|
|
|
};
|
|
};
|