|
|
@@ -1,4 +1,9 @@
|
|
|
+import { TradeMode } from '@/common/constants/enumCommon';
|
|
|
+import { validateCommon } from '@/common/setup/validate';
|
|
|
+import { getGoodsGroupsByTradeMode, getGoodsList } from '@/services/bus/goods';
|
|
|
+import { Goods } from "@/services/go/ermcp/goodsInfo/interface";
|
|
|
import { WrHoldLB } from "@/services/go/wrtrade/interface";
|
|
|
+import { RuleObject } from 'ant-design-vue/lib/form/interface';
|
|
|
import { reactive, ref, UnwrapRef } from "vue";
|
|
|
import { ListingForm } from "./interface";
|
|
|
|
|
|
@@ -9,12 +14,33 @@ export function handlePasswordForm(data: WrHoldLB) {
|
|
|
FixedPrice: 0,
|
|
|
OrderQty: 0,
|
|
|
PriceMove: 1,
|
|
|
+ goodsgroupid: undefined,
|
|
|
+ goodsid: undefined,
|
|
|
})
|
|
|
+ const v_group = async (rule: RuleObject, value: number) => {
|
|
|
+ if (formState.goodsgroupid) {
|
|
|
+ return validateCommon(value, '请选择合约');
|
|
|
+ } else {
|
|
|
+ return Promise.reject('请选择商品')
|
|
|
+ }
|
|
|
+ };
|
|
|
const rules = {
|
|
|
FixedPrice: [{ required: true, message: '请输入挂牌价格', trigger: 'blur', type: 'number', min: 1, }],
|
|
|
OrderQty: [{ required: true, message: '请输入挂牌数量', trigger: 'blur', type: 'number', min: 1, ma: data.enableqty }],
|
|
|
- // comfirePassword: [{ required: true, validator: validatePassword, trigger: 'blur' }],
|
|
|
+ PriceMove: [{ required: true, message: '请输入升贴水', trigger: 'blur', type: 'number', }],
|
|
|
+ goodsid: [{ required: true, validator: v_group }],
|
|
|
|
|
|
}
|
|
|
return { rules, formState, formRef }
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+export function handleGoods() {
|
|
|
+ const goodsGroup = getGoodsGroupsByTradeMode(TradeMode.quote99);
|
|
|
+ const allGoods = getGoodsList()
|
|
|
+ const goodsList = ref<Goods[]>([])
|
|
|
+ function groupsChange(id: number) {
|
|
|
+ goodsList.value = allGoods.filter(e => e.goodsgroupid === id)
|
|
|
+ }
|
|
|
+ return { goodsGroup, goodsList, groupsChange }
|
|
|
+}
|