li.shaoyi há 4 anos atrás
pai
commit
f12b5c89b7

+ 7 - 7
src/services/proto/hedgeplan/index.ts

@@ -23,10 +23,10 @@ export const hedgePlanReq = (param: ErmcpHedgePlanReq): Promise<any> => {
  * 老的计划操作接口 我只负责撤销 传5则进行撤销 !!!!! 注意
  * @param param
  */
-// export const oldHedgePlanReq = (param: HedgePlanOperateReq): Promise<any> => {
-//     param.OperateSrc = 2; // 操作来源-1:管理端2:终端
-//     param.ClientTicket = uuidv4(); // 流水号
-//     param.Remark = ''
-//     param.UserID = getUserId()
-//     return protoMiddleware<HedgePlanOperateReq>(param, 'HedgePlanOperateReq', 'HedgePlanOperateRsp', 2)
-// }
+export const oldHedgePlanReq = (param: HedgePlanOperateReq): Promise<any> => {
+    param.OperateSrc = 2; // 操作来源-1:管理端2:终端
+    param.ClientTicket = uuidv4(); // 流水号
+    param.Remark = ''
+    param.UserID = getUserId()
+    return protoMiddleware<HedgePlanOperateReq>(param, 'HedgePlanOperateReq', 'HedgePlanOperateRsp', 2)
+}

+ 89 - 76
src/views/business/plan/components/cancel/index.vue

@@ -1,74 +1,74 @@
 <template>
-    <!-- 计划撤销-->
-    <a-modal class="commonModal custom-detail" title="计划撤销" v-model:visible="visible" centered :maskClosable="false" @cancel="cancel" width="890px">
-        <template #footer>
-            <a-button key="submit" class="cancelBtn" @click="cancel">取消 </a-button>
-            <a-button key="submit" type="primary" :loading="loading" @click="submit">确认撤销 </a-button>
-        </template>
-        <a-form class="inlineForm" :form="form" @submit="handleSearch">
-            <fieldset class="formFieldSet">
-                <legend>基本信息</legend>
-                <a-row :gutter="24">
-                    <a-col :span="12">
-                        <a-form-item label="计划类型">
-                            <span class="white">{{ getPlanContractType(selectedRow.contracttype) }}</span>
-                        </a-form-item>
-                    </a-col>
-                    <a-col :span="12">
-                        <a-form-item label="计划名称">
-                            <span class="white">{{ formatValue(selectedRow.hedgeplanno) }}</span>
-                        </a-form-item>
-                    </a-col>
-                </a-row>
-                <a-row :gutter="24">
-                    <a-col :span="12">
-                        <a-form-item label="现货品种">
-                            <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</span>
-                        </a-form-item>
-                    </a-col>
-                    <a-col :span="12">
-                        <a-form-item label="标仓系数">
-                            <span class="white">{{ formatValue(selectedRow.convertfactor) }}</span>
-                        </a-form-item>
-                    </a-col>
-                </a-row>
-                <a-row :gutter="24">
-                    <a-col :span="12">
-                        <a-form-item label="计划量">
-                            <span class="white">{{ formatValue(selectedRow.planqty) }}</span>
-                        </a-form-item>
-                    </a-col>
-                    <a-col :span="12">
-                        <a-form-item label="备注">
-                            <span class="white">{{ formatValue(selectedRow.remark) }}</span>
-                        </a-form-item>
-                    </a-col>
-                </a-row>
-            </fieldset>
-            <fieldset class="formFieldSet">
-                <legend>其它信息</legend>
-                <a-row :gutter="24">
-                    <a-col :span="12">
-                        <a-form-item label="交易用户">
-                            <span class="white">{{ formatValue(selectedRow.tradeusername) }}</span>
-                        </a-form-item>
-                    </a-col>
-                    <a-col :span="12">
-                        <a-form-item label="结算币种">
-                            <span class="white">{{ formatValue(selectedRow.currencyname) }}</span>
-                        </a-form-item>
-                    </a-col>
-                </a-row>
-                <a-row :gutter="24">
-                    <a-col :span="12">
-                        <a-form-item label="备注">
-                            <span class="white">{{ formatValue(selectedRow.remark) }}</span>
-                        </a-form-item>
-                    </a-col>
-                </a-row>
-            </fieldset>
-        </a-form>
-    </a-modal>
+  <!-- 计划撤销-->
+  <a-modal class="commonModal custom-detail" title="计划撤销" v-model:visible="visible" centered :maskClosable="false" @cancel="cancel" width="890px">
+    <template #footer>
+      <a-button key="submit" class="cancelBtn" @click="cancel">取消 </a-button>
+      <a-button key="submit" type="primary" :loading="loading" @click="submit">确认撤销 </a-button>
+    </template>
+    <a-form class="inlineForm" :form="form" @submit="handleSearch">
+      <fieldset class="formFieldSet">
+        <legend>基本信息</legend>
+        <a-row :gutter="24">
+          <a-col :span="12">
+            <a-form-item label="计划类型">
+              <span class="white">{{ getPlanContractType(selectedRow.contracttype) }}</span>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="计划名称">
+              <span class="white">{{ formatValue(selectedRow.hedgeplanno) }}</span>
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="12">
+            <a-form-item label="现货品种">
+              <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</span>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="标仓系数">
+              <span class="white">{{ formatValue(selectedRow.convertfactor) }}</span>
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="12">
+            <a-form-item label="计划量">
+              <span class="white">{{ formatValue(selectedRow.planqty) }}</span>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="备注">
+              <span class="white">{{ formatValue(selectedRow.remark) }}</span>
+            </a-form-item>
+          </a-col>
+        </a-row>
+      </fieldset>
+      <fieldset class="formFieldSet">
+        <legend>其它信息</legend>
+        <a-row :gutter="24">
+          <a-col :span="12">
+            <a-form-item label="交易用户">
+              <span class="white">{{ formatValue(selectedRow.tradeusername) }}</span>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="结算币种">
+              <span class="white">{{ formatValue(selectedRow.currencyname) }}</span>
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="12">
+            <a-form-item label="备注">
+              <span class="white">{{ formatValue(selectedRow.remark) }}</span>
+            </a-form-item>
+          </a-col>
+        </a-row>
+      </fieldset>
+    </a-form>
+  </a-modal>
 </template>
 
 <script lang="ts">
@@ -77,10 +77,10 @@ import { Ermcp3HedgePlan } from '@/services/go/ermcp/plan/interface';
 import { formatValue } from '@/common/methods';
 import { getPlanContractType } from '@/views/business/plan/setup';
 import { Modal } from 'ant-design-vue';
-import { ErmcpHedgePlanReq } from '@/services/proto/hedgeplan/interface';
+import { HedgePlanOperateReq } from '@/services/proto/hedgeplan/interface';
 import * as Long from 'long';
 import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
-import { hedgePlanReq } from '@/services/proto/hedgeplan';
+import { oldHedgePlanReq } from '@/services/proto/hedgeplan';
 import { getPayCurrencyTypeEnumList } from '@/common/constants/enumsList';
 import { _closeModal } from '@/common/setup/modal/modal';
 
@@ -104,11 +104,24 @@ export default defineComponent({
                 okText: '确认撤销',
                 cancelText: '取消',
                 onOk() {
-                    const params: ErmcpHedgePlanReq = {
-                        HedgePlanID: Long.fromString(props.selectedRow.hedgeplanid),
-                        OperateType: 3,
+                    const { hedgeplanid, hedgeplanno, contracttype, areauserid, deliverygoodsid, wrstandardid, producttype, spotgoodsdesc, planqty, convertfactor, plantime } = props.selectedRow;
+                    const params: HedgePlanOperateReq = {
+                        HedgePlanID: Long.fromString(hedgeplanid),
+                        OperateType: 5,
+                        Info: {
+                            HedgePlanNo: hedgeplanno, // string 套保计划编号
+                            ContractType: contracttype, // int32 计划类型-1:采购-1:销售
+                            AreaUserID: areauserid, // uint32 机构ID
+                            DeliveryGoodsID: deliverygoodsid, // uint32 现货品种ID
+                            WrStandardID: wrstandardid, // uint32 现货商品ID
+                            ProductType: producttype, // uint32 产品类型-1:标准仓单2:等标3:非标
+                            SpotGoodsDesc: spotgoodsdesc, // string 商品型号
+                            PlanQty: planqty, // double 计划数量
+                            ConvertFactor: convertfactor, // double 标仓系数
+                            PlanTime: plantime, // string 计划时间
+                        },
                     };
-                    requestResultLoadingAndInfo(hedgePlanReq, params, loading, ['撤销成功', '撤销失败:']).then(() => {
+                    requestResultLoadingAndInfo(oldHedgePlanReq, params, loading, ['撤销成功', '撤销失败:']).then(() => {
                         cancel(true);
                     });
                 },

+ 12 - 39
src/views/market/futures/compoments/futures-trade/index.vue

@@ -1,62 +1,35 @@
 <template>
   <!-- 挂牌求购 -->
-  <Drawer :title="'挂牌求购'"
-          :placement="'right'"
-          :visible="visible"
-          @cancel="cancel"
-          class="top">
+  <Drawer :title="'挂牌求购'" :placement="'right'" :visible="visible" @cancel="cancel" class="top">
     <div class="post_buying">
-      <a-form class="inlineForm dialogForm"
-              ref="formRef"
-              :model="formState"
-              :rules="rules">
+      <a-form class="inlineForm dialogForm" ref="formRef" :model="formState" :rules="rules">
         <div class="formBar">
           <a-row :gutter="24">
             <a-col :span="24">
-              <a-form-item label="交易账户"
-                           name="accountid">
-                <a-select class="inlineFormSelect"
-                          style="width: 260px"
-                          v-model:value="formState.accountid"
-                          placeholder="请选择">
-                  <a-select-option v-for="item in accountList"
-                                   :value="item.accountid"
-                                   :key="item.accountid">{{ item.accountid }}</a-select-option>
+              <a-form-item label="交易账户" name="accountid">
+                <a-select class="inlineFormSelect" style="width: 260px" v-model:value="formState.accountid" placeholder="请选择">
+                  <a-select-option v-for="item in accountList" :value="item.accountid" :key="item.accountid">{{ item.accountid }}</a-select-option>
                 </a-select>
               </a-form-item>
             </a-col>
             <a-col :span="24">
-              <a-form-item label="挂牌价格"
-                           name="FixedPrice">
-                <a-input-number class="commonInput"
-                                style="width: 260px"
-                                :min="0"
-                                v-model:value="formState.FixedPrice" />
+              <a-form-item label="挂牌价格" name="FixedPrice">
+                <a-input-number class="commonInput" style="width: 260px" :min="0" v-model:value="formState.FixedPrice" />
               </a-form-item>
             </a-col>
             <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-form-item label="挂牌数量" name="OrderQty">
+                <a-input-number class="commonInput" style="width: 260px" :min="0" :max="getMaxNum()" v-model:value="formState.OrderQty" />
                 <span class="input-enumdicname">{{ selectedRow.enumdicname }}</span>
               </a-form-item>
             </a-col>
           </a-row>
         </div>
         <a-row :gutter="24">
-          <a-col :span="24"
-                 class="fixedBtns">
+          <a-col :span="24" class="fixedBtns">
             <a-form-item class="btnCenter">
-              <a-button class="listedBtn"
-                        @click="submit"
-                        :loading="loading">买入</a-button>
-              <a-button class="ml10 cancelBtn"
-                        @click="cancel"
-                        :disabled="loading">取消</a-button>
+              <a-button class="listedBtn" @click="submit" :loading="loading">买入</a-button>
+              <a-button class="ml10 cancelBtn" @click="cancel" :disabled="loading">取消</a-button>
             </a-form-item>
           </a-col>
         </a-row>

+ 36 - 19
src/views/market/futures/index.vue

@@ -1,13 +1,7 @@
 <template>
   <!--期货-->
   <div class="topTableHeight">
-    <a-table :columns="getColumnsList()"
-             :class="['srcollYTable', isBottom ? 'condSecondTabTable' : 'condSecondTabTableNoBottom', tableList.length ? 'noPlaceHolder' : 'hasPlaceHolder']"
-             :scroll="{ x: '100%', y: isBottom ? 'calc(100vh- 443px)' : 'calc(100vh - 196px)' }"
-             :pagination="false"
-             :loading="loading"
-             rowKey="key"
-             :data-source="tableList">
+    <a-table :columns="getColumnsList()" :class="['srcollYTable', isBottom ? 'condSecondTabTable' : 'condSecondTabTableNoBottom', tableList.length ? 'noPlaceHolder' : 'hasPlaceHolder']" :scroll="{ x: '100%', y: isBottom ? 'calc(100vh- 443px)' : 'calc(100vh - 196px)' }" :pagination="false" :loading="loading" :customRow="Rowclick" rowKey="key" :data-source="tableList">
       <template #totalturnover="{ text }">
         <span>{{changeUnit(text)}}</span>
       </template>
@@ -47,17 +41,10 @@
         <span :class="handleQuotePriceColor(text, record.presettle)">{{text}}</span>
       </template>
     </a-table>
-    <ThridMenu :list="tabList"
-               :selectedKey="index"
-               @selectMenu="changeTab" />
+    <ThridMenu :list="tabList" :selectedKey="index" @selectMenu="changeTab" />
     <!-- 右键 -->
-    <contextMenu :contextMenu="contextMenu"
-                 @cancel="closeContext"
-                 :list="buttons"></contextMenu>
-    <component :is="componentId"
-               v-if="componentId"
-               :selectedRow="selectedRow"
-               @cancel="closeComponent"></component>
+    <contextMenu :contextMenu="contextMenu" @cancel="closeContext" :list="buttons"></contextMenu>
+    <component :is="componentId" v-if="componentId" :selectedRow="selectedRow" @cancel="closeComponent"></component>
   </div>
 </template>
 
@@ -73,6 +60,10 @@ import { getColumnsList, useExternalexchange } from './setup';
 import { getTableButton } from '@/common/setup/table/button';
 import { contextMenu, defineAsyncComponent, defineComponent } from '@/common/export/commonTable';
 import { handleContextMenu } from '@/common/components/contextMenu/setup';
+import { TableEventCB } from '@/common/setup/table/interface';
+import { getTableEvent } from '@/common/export/table';
+import { ContextMenuTemp } from '@/common/components/contextMenu/interface';
+import { BtnListType } from '@/common/components/btnList/interface';
 
 export default defineComponent({
     name: 'spot_trade_order_transaction_swap',
@@ -97,6 +88,28 @@ export default defineComponent({
             // 重新发起订阅
             stopSubcribe = handleSubcriteOnDemandQuote<QueryQuoteDayRsp>(tableList);
         }
+
+        // 右键逻辑
+        const { contextMenu, closeContext: closeContextAction } = handleContextMenu();
+        // 右键回调函数
+        const eventsCB: TableEventCB = {
+            contextmenuCB: (record: QueryQuoteDayRsp, value: ContextMenuTemp) => {
+                // 控制打开右键
+                contextMenu.value = value;
+            },
+        };
+        // 表格事件
+        const { Rowclick } = getTableEvent<QueryQuoteDayRsp>(eventsCB);
+        // 控制异步组件
+        const { componentId, closeComponent, openComponent } = handleModalComponent(() => {}, selectedRow);
+        // 关闭右键
+        function closeContext(value: BtnListType | null) {
+            // 打开对应的弹窗组件
+            if (value) openComponent(value, selectedRow.value);
+            // 关闭右键
+            closeContextAction();
+        }
+
         return {
             index,
             loading,
@@ -110,8 +123,12 @@ export default defineComponent({
             quoteAmplituOfVibration,
             getColumnsList,
             buttons,
-            ...handleModalComponent(() => {}, selectedRow),
-            ...handleContextMenu(),
+            contextMenu,
+            closeContext,
+            Rowclick,
+            componentId,
+            closeComponent,
+            selectedRow,
         };
     },
 });