|
|
@@ -1,104 +1,95 @@
|
|
|
<template>
|
|
|
- <!-- 交收-->
|
|
|
- <Drawer
|
|
|
- :title="'交收'"
|
|
|
- :placement="'right'"
|
|
|
- class="bottom486"
|
|
|
- :visible="visible"
|
|
|
- @cancel="cancel"
|
|
|
- >
|
|
|
- <div class="listed c_c_s_s">
|
|
|
- <a-form class="inlineForm dialogForm" ref="formRef" :model="formState" :rules="rules">
|
|
|
- <div class="formBar">
|
|
|
- <div class="formtop">
|
|
|
- <div class="firstTitle">
|
|
|
- <span>合约数量 10,</span>
|
|
|
- <span>可交收数量 50 吨</span>
|
|
|
- </div>
|
|
|
- <div class="secondLine">
|
|
|
- <div class="left">持有人/商品/仓库</div>
|
|
|
- <div class="middle">升贴水/数量</div>
|
|
|
- <div class="right">选择数量</div>
|
|
|
- </div>
|
|
|
- <a-checkbox-group
|
|
|
- class="commonCheckboxGroup"
|
|
|
- v-model:value="checked"
|
|
|
- @change="change"
|
|
|
- >
|
|
|
- <div
|
|
|
- class="lineBar"
|
|
|
- v-for="(item, index) in tableList"
|
|
|
- :key="index + '11'"
|
|
|
- >
|
|
|
- <div class="line1">
|
|
|
- <div class>
|
|
|
- <a-checkbox :value="item.ladingbillid"></a-checkbox>
|
|
|
- </div>
|
|
|
- <div class="name">{{item.username}}</div>
|
|
|
- </div>
|
|
|
- <div class="line2">
|
|
|
- <div class="left">
|
|
|
- <div>{{item.wrtypename}}</div>
|
|
|
- <div>{{item.warehousename}}</div>
|
|
|
- </div>
|
|
|
- <div class="middle">
|
|
|
- <div>{{item.pricemove}}</div>
|
|
|
- <div>{{item.avalidqty}}{{item.enumdicname}}</div>
|
|
|
- </div>
|
|
|
- <div class="right">
|
|
|
- <template
|
|
|
- class="inputNumberBlock"
|
|
|
- :class="isChecked(item.ladingbillid) ? '' : 'disabled'"
|
|
|
- >
|
|
|
- <a-input-number
|
|
|
- class="dialogInput dialogInput34"
|
|
|
- v-model:value="item.num"
|
|
|
- style="width: 130px !important; height: 34px;"
|
|
|
- :disabled="!isChecked(item.ladingbillid)"
|
|
|
- :min="0"
|
|
|
- ></a-input-number>
|
|
|
- <MinusOutlined />
|
|
|
- <PlusOutlined />
|
|
|
- </template>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </a-checkbox-group>
|
|
|
- </div>
|
|
|
+ <!-- 交收-->
|
|
|
+ <Drawer :title="'交收'"
|
|
|
+ :placement="'right'"
|
|
|
+ class="bottom486"
|
|
|
+ :visible="visible"
|
|
|
+ @cancel="cancel">
|
|
|
+ <div class="listed c_c_s_s">
|
|
|
+ <a-form class="inlineForm dialogForm"
|
|
|
+ ref="formRef">
|
|
|
+ <div class="formBar">
|
|
|
+ <div class="formtop">
|
|
|
+ <div class="firstTitle">
|
|
|
+ <span>合约数量 {{selectedRow.enableqty}}</span>
|
|
|
+ <span>可交收数量 {{getCanSettlementNum()}} {{selectedRow.goodunit}}</span>
|
|
|
+ </div>
|
|
|
+ <div class="secondLine">
|
|
|
+ <div class="left">持有人/商品/仓库</div>
|
|
|
+ <div class="middle">升贴水/数量</div>
|
|
|
+ <div class="right">选择数量</div>
|
|
|
+ </div>
|
|
|
+ <a-checkbox-group class="commonCheckboxGroup"
|
|
|
+ v-model:value="checked"
|
|
|
+ @change="checkGroupChange">
|
|
|
+ <div class="lineBar"
|
|
|
+ v-for="(item, index) in tableList"
|
|
|
+ :key="index + '11'">
|
|
|
+ <div class="line1">
|
|
|
+ <div class>
|
|
|
+ <a-checkbox @change="checkboxChange(item)"
|
|
|
+ :value="item.ladingbillid"></a-checkbox>
|
|
|
+ </div>
|
|
|
+ <div class="name">{{item.username}}</div>
|
|
|
</div>
|
|
|
- <div class="fixedBtns">
|
|
|
- <div class="formbottom">
|
|
|
- <div class="line1">
|
|
|
- <div>
|
|
|
- <span>已点选数量</span>
|
|
|
- <span class="white">40吨</span>
|
|
|
- <span>,需合约数量</span>
|
|
|
- <span class="white">8</span>
|
|
|
- </div>
|
|
|
- <div class="yellow">升贴水1100</div>
|
|
|
- </div>
|
|
|
- <div class="line2">
|
|
|
- <div>点价合约</div>
|
|
|
- <div class="right">
|
|
|
- <div>C2109</div>
|
|
|
- <div>1398.00</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="line3">预估贷款:71,000.00</div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <a-form-item class="btnCenter mt10">
|
|
|
- <a-button
|
|
|
- class="listedBtn"
|
|
|
- :loading="loading"
|
|
|
- :disabled="loading"
|
|
|
- @click="submit"
|
|
|
- >提交</a-button>
|
|
|
- </a-form-item>
|
|
|
+ <div class="line2">
|
|
|
+ <div class="left">
|
|
|
+ <div>{{item.wrtypename}}</div>
|
|
|
+ <div>{{item.warehousename}}</div>
|
|
|
+ </div>
|
|
|
+ <div class="middle">
|
|
|
+ <div>{{item.pricemove}}</div>
|
|
|
+ <div>{{item.avalidqty}}{{item.enumdicname}}</div>
|
|
|
+ </div>
|
|
|
+ <div class="right">
|
|
|
+ <template class="inputNumberBlock"
|
|
|
+ :class="isChecked(item.ladingbillid) ? '' : 'disabled'">
|
|
|
+ <a-input-number class="dialogInput dialogInput34"
|
|
|
+ v-model:value="item.num"
|
|
|
+ style="width: 130px !important; height: 34px;"
|
|
|
+ :disabled="!isChecked(item.ladingbillid)"
|
|
|
+ :max="item.avalidqty"
|
|
|
+ :min="0"></a-input-number>
|
|
|
+ <MinusOutlined @click="decrease(item)" />
|
|
|
+ <PlusOutlined @click="increase(item)" />
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </a-form>
|
|
|
+ </div>
|
|
|
+ </a-checkbox-group>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="fixedBtns">
|
|
|
+ <div class="formbottom">
|
|
|
+ <div class="line1">
|
|
|
+ <div>
|
|
|
+ <span>已点选数量</span>
|
|
|
+ <span class="white">{{selctedNum()}} {{selectedRow.goodunit}}</span>
|
|
|
+ <span>,需合约数量</span>
|
|
|
+ <span class="white">{{getNeedContractNum()}}</span>
|
|
|
+ </div>
|
|
|
+ <div class="yellow">升贴水1100</div>
|
|
|
+ </div>
|
|
|
+ <div class="line2">
|
|
|
+ <div>点价合约</div>
|
|
|
+ <div class="right">
|
|
|
+ <div>{{selectedRow.goodscode}}</div>
|
|
|
+ <div>{{getDeliveryGoodsPrice()}}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="line3">预估贷款:{{getEstimatedPayment()}}</div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <a-form-item class="btnCenter mt10">
|
|
|
+ <a-button class="listedBtn"
|
|
|
+ :loading="loading"
|
|
|
+ :disabled="loading"
|
|
|
+ @click="submit">提交</a-button>
|
|
|
+ </a-form-item>
|
|
|
</div>
|
|
|
- </Drawer>
|
|
|
+ </a-form>
|
|
|
+ </div>
|
|
|
+ </Drawer>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
@@ -109,7 +100,7 @@ import { ModalEnum } from '@/common/constants/modalNameEnum';
|
|
|
import { _closeModal } from '@/common/setup/modal/modal';
|
|
|
// import { handleForm } from './setup';
|
|
|
import { validateAction } from '@/common/setup/form';
|
|
|
-import { FormState } from './interface';
|
|
|
+import { DBType, FormState } from './interface';
|
|
|
|
|
|
import UploadImg from '@/common/components/uploadImg/index.vue';
|
|
|
import { getUploadImg } from '@/common/setup/upload';
|
|
|
@@ -125,11 +116,7 @@ import { useQueryData } from '@/common/setup/request';
|
|
|
import { queryWrDeliveryAvalidHoldLB } from '@/services/go/wrtrade';
|
|
|
import { QueryTradePositionRsp } from '@/services/go/ermcp/order/interface';
|
|
|
import { PlusOutlined, MinusOutlined } from '@ant-design/icons-vue';
|
|
|
-
|
|
|
-interface DBType extends WrDeliveryAvalidHoldLB {
|
|
|
- checked: boolean;
|
|
|
- num: number;
|
|
|
-}
|
|
|
+import { handleCheck, getTableList, handleCalculation } from './setup';
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: ModalEnum.commodity_contract_summary_settlement,
|
|
|
@@ -148,25 +135,10 @@ export default defineComponent({
|
|
|
setup(props, context) {
|
|
|
const { visible, cancel } = _closeModal(context);
|
|
|
const loading = ref<boolean>(false);
|
|
|
-
|
|
|
- const param: QueryWrDeliveryAvalidHoldLBReq = {
|
|
|
- goodsid: props.selectedRow.goodsid,
|
|
|
- accountid: getSelectedAccountId(),
|
|
|
- };
|
|
|
- const tableList = ref<DBType[]>([]);
|
|
|
- queryWrDeliveryAvalidHoldLB(param).then((res) => {
|
|
|
- tableList.value = res.map((e) => {
|
|
|
- return { ...e, checked: false, num: 0 };
|
|
|
- });
|
|
|
- });
|
|
|
-
|
|
|
- const checked = ref<string>();
|
|
|
- function change(checkedValue: string[]) {
|
|
|
- checked.value = checkedValue[checkedValue.length - 1];
|
|
|
- }
|
|
|
- function isChecked(value: string) {
|
|
|
- return value === checked.value;
|
|
|
- }
|
|
|
+ // 合约交收可点选仓单
|
|
|
+ const { tableList } = getTableList(props.selectedRow.goodsid);
|
|
|
+ // check 是否选中逻辑
|
|
|
+ const { checked, selected, checkGroupChange, isChecked, checkboxChange } = handleCheck();
|
|
|
|
|
|
function submit() {
|
|
|
// validateAction<FormState>(formRef, formState).then((param) => {
|
|
|
@@ -189,12 +161,11 @@ export default defineComponent({
|
|
|
submit,
|
|
|
tableList,
|
|
|
loading,
|
|
|
- change,
|
|
|
+ checkGroupChange,
|
|
|
+ checkboxChange,
|
|
|
checked,
|
|
|
isChecked,
|
|
|
- // rules,
|
|
|
- // formState,
|
|
|
- // formRef,
|
|
|
+ ...handleCalculation(props.selectedRow),
|
|
|
};
|
|
|
},
|
|
|
});
|