Просмотр исходного кода

commit 提交代码 融资管理

yu jie 4 лет назад
Родитель
Сommit
f3f8aa68f6

+ 86 - 0
src/common/constants/enumsName.ts

@@ -320,6 +320,8 @@ export function getRegularStateName(type: number): string {
     return result
 }
 
+// 1:待确认 2:已确认 3:确认拒绝 4:已支付保证金 5:已激活 6:已违约 7:到期结束 8:延期结束 9:违约结束 10:已注销 11:已关闭 99:未提交
+
 //1:待确认 2:已确认 3:确认拒绝 4:已支付保证金 5:已激活 6:已违约 7:到期结束 8:延期结束 9:违约结束 10:已注销 11:已关闭 99:未提交
 export function getContractName(type: number): string {
     let result = "--";
@@ -791,6 +793,90 @@ export function getReceiptName(type: number) {
     return result
 }
 
+/**
+ * 融资类型
+ * @param type
+ */
+export function getFinanceTypeName(type: number) {
+    let result = "--"
+    switch (type) {
+        case 1:
+            result = '融资回购'
+            break
+    }
+    return result
+}
+
+/**
+ * 融资申请状态 申请状态 - 1:待审核 2.审核中 3:审核通过 4:审核拒绝 5:审核失败 6:已撤销 7:自动审核 8:融资失败
+ */
+export function getApplyStatusFinanceName(type: number) {
+    let result = "--"
+    switch (type) {
+        case 1:
+            result = '待审核'
+            break
+        case 2:
+            result = '审核中'
+            break
+        case 3:
+            result = '审核通过'
+            break
+        case 4:
+            result = '审核拒绝'
+            break
+        case 5:
+            result = '审核失败'
+            break
+        case 6:
+            result = '已撤销'
+            break
+        case 7:
+            result = '自动审核'
+            break
+        case 8:
+            result = '融资失败'
+            break
+    }
+    return result
+}
+
+/**
+ * //合同状态 - 1:待确认 2:已确认 3:确认拒绝 4:已支付保证金 5:已激活 6:已违约 7:到期结束 8:延期结束 9:违约结束 1number;
+ //:已注销 11:已关闭 99:未提交
+ * @param type
+ */
+export function getScfContractStatusName(type: number) {
+    let result = "--"
+    switch (type) {
+        case 1:
+            result = '待审核'
+            break
+        case 2:
+            result = '审核中'
+            break
+        case 3:
+            result = '审核通过'
+            break
+        case 4:
+            result = '审核拒绝'
+            break
+        case 5:
+            result = '审核失败'
+            break
+        case 6:
+            result = '已撤销'
+            break
+        case 7:
+            result = '自动审核'
+            break
+        case 8:
+            result = '融资失败'
+            break
+    }
+    return result
+}
+
 
 /**
  * 资金操作类型

+ 1 - 0
src/views/information/goods/components/modify/index.vue

@@ -35,6 +35,7 @@
             <a-form-item label="现货品种代码"
                          name="deliverygoodscode">
               <a-input class="dialogInput"
+                       readonly
                        style="width: 200px"
                        v-model:value="formState.deliverygoodscode"
                        placeholder="请输入现货品种代码" />

+ 1 - 1
src/views/information/goods/components/spotDetail/index.vue

@@ -31,7 +31,7 @@
           <a-col :span="12">
             <a-form-item label="现货品种代码"
                          name="deliverygoodscode">
-              <span class="white">{{ formatValue(selectedRow.data.deliverygoodsname) }}</span>
+              <span class="white">{{ formatValue(selectedRow.data.deliverygoodscode) }}</span>
             </a-form-item>
           </a-col>
         </a-row>

+ 5 - 4
src/views/information/spot-contract/components/detail/index.vue

@@ -52,8 +52,8 @@
         </template>
 
         <!-- 款项类型 -->
-        <template #kxtype="{record }">
-          <a>{{ kxtypeName(record.contracttype) }}</a>
+        <template #kxtype="{ text, record }">
+          <a>{{ stateName(record.kxtype ,record.contracttype) }}</a>
         </template>
 
         <!-- 金额-->
@@ -99,7 +99,7 @@ import { ErmcpLoginUserEx } from '@/services/go/ermcp/account/interface';
 import InfoDetail from '../infoDetail/index.vue';
 import {getApplyStatusName, getReceiptName} from '@/common/constants/enumsName';
 import { getTableColumns } from '@/common/setup/table';
-import { invoiceStatusName } from '@/views/manage/finance-review/setup';
+import {invoiceStatusName, stateName} from '@/views/manage/finance-review/setup';
 import { getPlanContractType } from '@/views/business/plan/setup';
 import { InOutTypeName } from '@/views/manage/inventory-review/setup';
 import { kxtypeName } from '@/views/manage/finance-review/setup';
@@ -222,7 +222,8 @@ export default defineComponent({
             InOutTypeName,
             kxtypeName,
             formatValue,
-            getReceiptName
+            getReceiptName,
+            stateName
         };
     },
 });

+ 1 - 0
src/views/manage/finance-review/setup.ts

@@ -67,6 +67,7 @@ export function kxtypeName(type: number): string {
  */
 export function stateName(deductamount: number, contracttype: number) {
     let result = "--";
+    debugger
     if (deductamount === undefined || deductamount === 0) {
         if (contracttype === 1) {  // 采购
             result = "付款"

+ 44 - 36
src/views/market/spot_trade/components/buy-sell-market/components/financing_delisting/index.vue

@@ -174,7 +174,7 @@
 import { defineAsyncComponent, defineComponent, onMounted, PropType, ref } from 'vue';
 import Drawer from '@/common/components/drawer/index.vue';
 import { WrOrderQuote, WrOrderQuoteDetail } from '@/services/go/wrtrade/interface';
-import { getAccountTypeList } from '@/services/bus/account';
+import {getAccountTypeList, getSelectedAccountId, getUserId} from '@/services/bus/account';
 import { ModalEnum } from '@/common/constants/modalNameEnum';
 import { _closeModal } from '@/common/setup/modal/modal';
 import { handleForm, handleSpotWarrant } from './setup';
@@ -187,6 +187,12 @@ import { handleNumAndMoney, getWrPosition, selecedFinance } from './setup';
 import { handleIs } from '../../setup';
 import { getCanUseMoney } from '@/services/bus/account';
 import Bus from '@/utils/eventBus/index';
+import {ListingForm} from "@/views/market/spot_trade/components/buy-sell-market/components/financing_delisting/interface";
+import {HdWRDealOrderReq} from "@/services/proto/warehousetrade/interface";
+import {v4 as uuidv4} from "uuid";
+import moment from "moment";
+import {requestResultLoadingAndInfo} from "@/common/methods/request/resultInfo";
+import {HdWRDealOrder} from "@/services/proto/warehousetrade";
 
 export default defineComponent({
     name: ModalEnum.spot_trade_warehouse_delisting,
@@ -242,41 +248,43 @@ export default defineComponent({
             formState.case = `${item.productname}-${item.username}-${item.financingdays}天-${(item.marginratio * 100).toFixed(2)}%-${item.interestratemode === 3 ? item.interestrate : (item.interestrate * 10000).toFixed(2)}%-${item.interestsettlemode === 1 ? '按日结息' : '按月结息'}-${item.interestminlen}天起息`;
         }
         function submit() {
-            // validateAction<ListingForm>(formRef, formState).then((res) => {
-            //     // 首先确定  这是仓单贸易的有仓单挂摘牌 HasWr = 1
-            //     // 其次判断  摘牌 1。摘买 (需要通过自己的仓单进行摘买)  2。摘卖 (不需要通过仓单)
-            //     const param: HdWRDealOrderReq = {
-            //         UserID: getUserId(), // uint32 用户ID
-            //         AccountID: getSelectedAccountId(), // uint64 资金账号
-            //         RelatedWRTradeOrderID: props.selectedRow.wrtradeorderid, // uint64 关联委托单号(摘牌委托关联挂牌委托单ID)
-            //         WRTransferUserID: props.selectedRow.userid, // uint32 仓单受让用户
-            //         OrderQty: res.num as number, // uint64 委托数量
-            //         OrderSrc: 0, // uint32 委托来源
-            //         ClientSerialNo: uuidv4(), // string 客户端流水号
-            //         ClientOrderTime: moment(new Date()).format('YYYY-MM-DD HH:mm:ss'), // string 客户端委托时间
-            //         ClientType: 4, // uint32 终端类型
-            //         OperatorID: getUserId(), // uint64 操作员账号ID
-            //         BuyOrSell: 0, // uint32 买卖方向
-            //         ApplyID: 0, // uint64 申请ID
-            //         // LadingBillId: 0, // uint64 提单id(wrholdlb的LadingBillId字段),卖的时候填写
-            //         SubNum: 0, // uint64 提单子单号(wrholdlb的SubNum字段),卖的时候填写
-            //         WRFactorTypeId: props.parantSelectedRow.wrfactortypeid, // uint64 仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写
-            //         TradeDate: moment().format('YYYYMMDD'), // string 交易日
-            //         DeliveryMonth: '', // string 交收月
-            //         HasWr: isSale() ? 0 : 1, // uint32 是否有仓单-0:没有仓单 1:有仓单
-            //     };
-            //     // 摘买方向
-            //     if (isBuy()) {
-            //         param.BuyOrSell = 1;
-            //         param.LadingBillId = res.LadingBillId;
-            //     } else {
-            //         param.BuyOrSell = 0;
-            //     }
-            //     requestResultLoadingAndInfo(HdWRDealOrder, param, loading, ['摘牌成功', '摘牌失败:']).then(() => {
-            // Bus.$emit('financing_manager', true);
-            //         cancel(true);
-            //     });
-            // });
+            validateAction<ListingForm>(formRef, formState).then((res) => {
+                // 首先确定  这是仓单贸易的有仓单挂摘牌 HasWr = 1
+                // 其次判断  摘牌 1。摘买 (需要通过自己的仓单进行摘买)  2。摘卖 (不需要通过仓单)
+                const param: HdWRDealOrderReq = {
+                    UserID: getUserId(), // uint32 用户ID
+                    AccountID: getSelectedAccountId(), // uint64 资金账号
+                    RelatedWRTradeOrderID: props.selectedRow.wrtradeorderid, // uint64 关联委托单号(摘牌委托关联挂牌委托单ID)
+                    WRTransferUserID: props.selectedRow.userid, // uint32 仓单受让用户
+                    OrderQty: res.num as number, // uint64 委托数量
+                    OrderSrc: 0, // uint32 委托来源
+                    ClientSerialNo: uuidv4(), // string 客户端流水号
+                    ClientOrderTime: moment(new Date()).format('YYYY-MM-DD HH:mm:ss'), // string 客户端委托时间
+                    ClientType: 4, // uint32 终端类型
+                    OperatorID: getUserId(), // uint64 操作员账号ID
+                    BuyOrSell: 0, // uint32 买卖方向
+                    ApplyID: 0, // uint64 申请ID
+                    // LadingBillId: 0, // uint64 提单id(wrholdlb的LadingBillId字段),卖的时候填写
+                    SubNum: 0, // uint64 提单子单号(wrholdlb的SubNum字段),卖的时候填写
+                    WRFactorTypeId: props.parantSelectedRow.wrfactortypeid, // uint64 仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写
+                    TradeDate: moment().format('YYYYMMDD'), // string 交易日
+                    DeliveryMonth: '', // string 交收月
+                    HasWr: isWR(), // uint32 是否有仓单-0:没有仓单 1:有仓单
+                    IsFinancing: 1, // uint32 是否融资购买(买摘牌时有效)-0:否 1:是
+                    ProductDetailID: res.caseId, // uint64 金融机构产品组合ID(融资购买时有效)
+                };
+                // 摘买方向
+                if (isBuy()) {
+                    param.BuyOrSell = 1;
+                    param.LadingBillId = res.LadingBillId;
+                } else {
+                    param.BuyOrSell = 0;
+                }
+
+                requestResultLoadingAndInfo(HdWRDealOrder, param, loading, ['融资摘牌成功', '融资摘牌失败:']).then(() => {
+                    cancel(true);
+                });
+            });
         }
 
         return {

+ 15 - 8
src/views/order/financing_manager/components/financing_manager_apply_order/components/cancel/index.vue

@@ -11,6 +11,12 @@ import { WrFinanceBuyApply } from '@/services/go/wrtrade/interface';
 import { ModalEnum } from '@/common/constants/modalNameEnum';
 import { _closeModal } from '@/common/setup/modal/modal';
 import { Modal } from 'ant-design-vue';
+import {WRTradeFinanceBuyCancel} from "@/services/proto/warehousetrade";
+import {requestResultLoadingAndInfo} from "@/common/methods/request/resultInfo";
+import {WRTradeFinanceBuyCancelReq} from "@/services/proto/warehousetrade/interface";
+import {getSelectedAccountId} from "@/services/bus/account";
+import {v4 as uuidv4} from "uuid";
+import Long from "long";
 
 export default defineComponent({
     name: ModalEnum.financing_manager_apply_cancel,
@@ -32,14 +38,15 @@ export default defineComponent({
             onCancel: cancel,
         });
         function submit() {
-            // 激活接口 (就是交收)
-            // const paramReq: PerformanceActivateReq = {
-            //     PerformancePlanID: Number(props.selectedRow.performanceplanid), // uint64 履约计划ID
-            //     ApplyAccountID: getSelectedAccountId(), // uint64 发起方账号ID
-            // };
-            // requestResultLoadingAndInfo(performanceActivate, paramReq, loading, ['交收成功', '交收失败:']).then(() => {
-            //     cancel(true);
-            // });
+            // 挂牌撤单请求
+            const paramReq: WRTradeFinanceBuyCancelReq = {
+                AccountID: getSelectedAccountId(), // uint64 资金账号
+                FinanceApplyID : Long.fromString(props.selectedRow.financeapplyid), // uint64 融资申请单ID
+                ClientSerialNo: uuidv4(), // 客户端流水号 // string 客户端流水号
+            };
+            requestResultLoadingAndInfo(WRTradeFinanceBuyCancel, paramReq, loading, ['撤销成功', '撤销失败:']).then(() => {
+                cancel(true);
+            });
         }
         return {
             visible,

+ 13 - 0
src/views/order/financing_manager/components/financing_manager_apply_order/index.vue

@@ -20,6 +20,16 @@
                  class="btn-list-sticky"
                  @click="openComponent" />
       </template>
+        <!-- 类型 -->
+        <template #financetype="{ text }">
+            <a>{{ getFinanceTypeName(text) }}</a>
+        </template>
+
+        <!-- 状态 -->
+        <template #applystatus="{ text }">
+            <a>{{ getApplyStatusFinanceName(text) }}</a>
+        </template>
+
       <template #createtime="{ record }">
         <a>{{ formatTime(record.createtime) }}</a>
       </template>
@@ -42,6 +52,7 @@ import { ComposeOrderTableParam } from '@/common/setup/table/interface';
 import { formatTime } from '@/common/methods';
 import Bus from '@/utils/eventBus/index';
 import { expandIcon } from '@/common/setup/table/clolumn';
+import {getApplyStatusFinanceName, getFinanceTypeName} from "@/common/constants/enumsName";
 
 export default defineComponent({
     name: enumOrderComponents.financing_manager_apply_order,
@@ -72,6 +83,8 @@ export default defineComponent({
             tableList,
             formatTime,
             expandIcon,
+            getFinanceTypeName,
+            getApplyStatusFinanceName,
         };
     },
 });

+ 14 - 7
src/views/order/financing_manager/components/financing_manager_contract/components/buyback/index.vue

@@ -93,6 +93,11 @@ import { _closeModal } from '@/common/setup/modal/modal';
 import { handleForm } from './setup';
 import { validateAction } from '@/common/setup/form';
 import { FormState } from './interface';
+import {WarehouseRepurchase} from "@/services/proto/warehousetrade";
+import {requestResultLoadingAndInfo} from "@/common/methods/request/resultInfo";
+import {WarehouseRepurchaseReq} from "@/services/proto/warehousetrade/interface";
+import {getTimeValue} from "@/utils/time";
+import Long from "long";
 
 export default defineComponent({
     name: ModalEnum.financing_manager_contract_repurchase_warrant,
@@ -110,13 +115,15 @@ export default defineComponent({
         const { rules, formState, formRef } = handleForm();
         function submit() {
             validateAction<FormState>(formRef, formState).then((param) => {
-                // const param: PerformanceManualConfirmReq = {
-                //     PerformancePlanStepID: Long.fromString(props.selectedRow.curstepid),
-                //     PerformanceExecuteSide: 1,
-                // };
-                // requestResultLoadingAndInfo(performanceManualConfirm, param, loading, ['回购仓单成功', '回购仓单失败:']).then(() => {
-                //     cancel(true);
-                // });
+                const paramReq: WarehouseRepurchaseReq = {
+                    ExtBusinessID: getTimeValue(), // uint64 外部业务流水号
+                    SCFContractID: Long.fromString(props.selectedRow.scfcontractid), // uint64 SCF合同ID
+                    SCFContractType: props.selectedRow.scfcontracttype, // int32 合同类型
+                    WRPositionQty: param.num // uint64 仓单头寸数量
+                };
+                requestResultLoadingAndInfo(WarehouseRepurchase, paramReq, loading, ['回购仓单成功', '回购仓单失败:']).then(() => {
+                    cancel(true);
+                });
             });
         }
 

+ 13 - 7
src/views/order/financing_manager/components/financing_manager_contract/components/pay/index.vue

@@ -55,6 +55,11 @@ import Drawer from '@/common/components/drawer/index.vue';
 import { WrScfContract } from '@/services/go/wrtrade/interface';
 import { ModalEnum } from '@/common/constants/modalNameEnum';
 import { _closeModal } from '@/common/setup/modal/modal';
+import {PaymentArrears} from "@/services/proto/warehousetrade";
+import {requestResultLoadingAndInfo} from "@/common/methods/request/resultInfo";
+import {PaymentArrearsReq} from "@/services/proto/warehousetrade/interface";
+import {getTimeValue} from "@/utils/time";
+import * as Long from "long";
 
 export default defineComponent({
     name: ModalEnum.financing_manager_contract_pay_arrears,
@@ -70,13 +75,14 @@ export default defineComponent({
         const { visible, cancel } = _closeModal(context);
         const loading = ref<boolean>(false);
         function submit() {
-            // const param: PerformanceManualConfirmReq = {
-            //     PerformancePlanStepID: Long.fromString(props.selectedRow.curstepid),
-            //     PerformanceExecuteSide: 1,
-            // };
-            // requestResultLoadingAndInfo(performanceManualConfirm, param, loading, ['付款成功', '付款失败:']).then(() => {
-            //     cancel(true);
-            // });
+            const param: PaymentArrearsReq = {
+                ExtBusinessID: getTimeValue(), // uint64 外部业务流水号
+                SCFContractID: Long.fromString(props.selectedRow.scfcontractid), // uint64 SCF合同ID
+                SCFContractType: props.selectedRow.scfcontracttype, // int32 合同类型
+            };
+            requestResultLoadingAndInfo(PaymentArrears, param, loading, ['付款成功', '付款失败:']).then(() => {
+                cancel(true);
+            });
         }
 
         return {

+ 12 - 0
src/views/order/financing_manager/components/financing_manager_contract/index.vue

@@ -20,6 +20,15 @@
                  class="btn-list-sticky"
                  @click="openComponent" />
       </template>
+        <!-- 类型 -->
+        <template #financetype="{ text }">
+            <a>{{ getFinanceTypeName(text) }}</a>
+        </template>
+
+        <!-- 状态 -->
+        <template #scfcontractstatus="{ text }">
+            <a>{{ getContractName(text) }}</a>
+        </template>
       <template #createtime="{ record }">
         <a>{{ formatTime(record.createtime) }}</a>
       </template>
@@ -41,6 +50,7 @@ import { handleComposeOrderTable } from '@/common/setup/table/compose';
 import { ComposeOrderTableParam } from '@/common/setup/table/interface';
 import { formatTime } from '@/common/methods';
 import { expandIcon } from '@/common/setup/table/clolumn';
+import {getContractName, getFinanceTypeName} from "@/common/constants/enumsName";
 
 export default defineComponent({
     name: enumOrderComponents.financing_manager_contract,
@@ -68,6 +78,8 @@ export default defineComponent({
             tableList,
             formatTime,
             expandIcon,
+            getContractName,
+            getFinanceTypeName,
         };
     },
 });