|
|
@@ -40,7 +40,7 @@
|
|
|
|
|
|
<a-col :span="24">
|
|
|
<a-form-item label="挂牌数量" name="OrderQty">
|
|
|
- <a-input-number class="commonInput" style="width: 260px" :min="0" :max="getMaxNum()" v-model:value="formState.OrderQty" />
|
|
|
+ <a-input-number class="commonInput" style="width: 260px" :min="0" :max="listingType === 'buy' ? getMaxNum() : wrPosition.creditenableqty" v-model:value="formState.OrderQty" />
|
|
|
<span class="input-enumdicname">{{ selectedRow.enumdicname }}</span>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
@@ -51,11 +51,15 @@
|
|
|
</a-col>
|
|
|
<a-col :span="24" class="mt-10">
|
|
|
<a-form-item>
|
|
|
- <a-slider :min="0" v-model:value="formState.OrderQty" :max="getMaxNum()" class="formSlider" />
|
|
|
- <div class="unit">
|
|
|
+ <a-slider :min="0" v-model:value="formState.OrderQty" :max="listingType === 'buy' ? getMaxNum() : wrPosition.creditenableqty" class="formSlider" />
|
|
|
+ <div class="unit" v-if="listingType === 'buy'">
|
|
|
<span>{{ getMaxNum() ? selectedRow.minivalue : 0 }}</span>
|
|
|
<span>{{ getMaxNum() }}{{ selectedRow.enumdicname }}</span>
|
|
|
</div>
|
|
|
+ <div class="unit" v-else>
|
|
|
+ <span>{{ wrPosition.creditenableqty ? selectedRow.minivalue : 0 }}</span>
|
|
|
+ <span>{{ wrPosition.creditenableqty }}{{ selectedRow.enumdicname }}</span>
|
|
|
+ </div>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :span="24">
|
|
|
@@ -104,7 +108,7 @@
|
|
|
<a-row :gutter="24">
|
|
|
<a-col :span="24" class="fixedBtns">
|
|
|
<a-form-item class="btnCenter">
|
|
|
- <a-button class="listedBtn" @click="submit" :loading="loading">买入</a-button>
|
|
|
+ <a-button class="listedBtn" @click="submit" :loading="loading">{{ listingType === 'buy' ? '买入' : '卖出' }}</a-button>
|
|
|
<a-button class="ml10 cancelBtn" @click="cancel(false)" :disabled="loading">取消</a-button>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
@@ -173,6 +177,7 @@ export default defineComponent({
|
|
|
const { rules, formState, formRef } = handleForm(props.selectedRow);
|
|
|
const loading = ref<boolean>(false);
|
|
|
const accountList = getAccountTypeList([2]);
|
|
|
+ const wrPosition = ref<WrPosition>(); // 预售仓单头寸
|
|
|
const listingType = ref<'buy' | 'sell'>('buy'); // 挂牌方式
|
|
|
const showListingType = ref(false); // 是否显示挂牌方式
|
|
|
|
|
|
@@ -201,18 +206,17 @@ export default defineComponent({
|
|
|
// 获取持仓头寸
|
|
|
queryWrPosition({ haswr: 0, querytype: 2, }).then((res) => {
|
|
|
const { wrfactortypeid, wrstandardid, warehouseid, dgitemname } = props.selectedRow;
|
|
|
- let wrPosition: WrPosition | undefined = undefined;
|
|
|
|
|
|
if (wrfactortypeid) {
|
|
|
// 根据仓单要素id查询头寸
|
|
|
- wrPosition = res.find((e) => e.wrfactortypeid === wrfactortypeid);
|
|
|
+ wrPosition.value = res.find((e) => e.wrfactortypeid === wrfactortypeid);
|
|
|
} else {
|
|
|
// 根据商品、仓库、品牌查询持仓头寸
|
|
|
- wrPosition = res.find((e) => e.wrstandardid === wrstandardid && e.warehouseid === warehouseid && e.wrtypename.includes(dgitemname));
|
|
|
+ wrPosition.value = res.find((e) => e.wrstandardid === wrstandardid && e.warehouseid === warehouseid && e.wrtypename.includes(dgitemname));
|
|
|
}
|
|
|
|
|
|
// 卖方需要有仓单头寸 “预售可用额度”
|
|
|
- if (wrPosition && wrPosition?.creditenableqty > 0) {
|
|
|
+ if (wrPosition.value && wrPosition.value.creditenableqty > 0) {
|
|
|
showListingType.value = true;
|
|
|
}
|
|
|
})
|
|
|
@@ -295,7 +299,7 @@ export default defineComponent({
|
|
|
PerformanceTemplateID: res.permaceTempId, // 履约计划模板ID
|
|
|
UserID: getUserId(),
|
|
|
OperatorID: getUserId(), // 操作员账号ID
|
|
|
- BuyOrSell: 0, // 买卖方向 0买1卖
|
|
|
+ BuyOrSell: listingType.value === 'buy' ? 0 : 1, // 买卖方向 0买1卖
|
|
|
PriceDisplayMode: 1, // 浮动价显示方式 1:合并显示 2:分开显示
|
|
|
CanBargain: 0, // 挂牌是否可议价0:不可1:可-摘牌是否议价
|
|
|
Attachment1: '', // 附件1
|
|
|
@@ -319,7 +323,7 @@ export default defineComponent({
|
|
|
})
|
|
|
: [], // DGFactoryItems 要素类型明细集合(没有仓单要素ID填写)
|
|
|
};
|
|
|
- requestResultLoadingAndInfo(hdWROrder, param, loading, ['求购成功', '求购失败:']).then(() => {
|
|
|
+ requestResultLoadingAndInfo(hdWROrder, param, loading, ['挂牌成功', '挂牌失败:']).then(() => {
|
|
|
cancel(true);
|
|
|
});
|
|
|
});
|
|
|
@@ -333,6 +337,7 @@ export default defineComponent({
|
|
|
rules,
|
|
|
formState,
|
|
|
formRef,
|
|
|
+ wrPosition,
|
|
|
listingType,
|
|
|
showListingType,
|
|
|
isFloat,
|