Prechádzať zdrojové kódy

合并代码,解决冲突

huangbin 4 rokov pred
rodič
commit
152800192f

+ 15 - 5
src/services/proto/spotcontract/index.ts

@@ -1,22 +1,32 @@
 import APP from "@/services";
-import { getSelectedAccountId } from '@/services/bus/account';
+import { getSelectedAccountId, getUserId } from "@/services/bus/account";
 import { GldErmcpSpotContractOperateReq } from "@/services/proto/spotcontract/interface";
 import { buildProtoReq50, parseProtoRsp50 } from "@/services/socket/protobuf/buildReq";
 import { Callback } from "@/utils/websocket";
+import { v4 as uuidv4 } from 'uuid';
 
 /**(重点提醒 这里属于管理端接口,仅用于新增)以上来自android代码  回头需要确认
- * 获取新增采购合同报文
+ * 新增 / 修改采购合同报文 (很多修改合同操作也在这)
  * @param
  * @param param
  */
 export const orderContract = (param: GldErmcpSpotContractOperateReq): Promise<any> => {
+
+    const OperateSrc = 2; // uint32 操作来源-1:管理端2:终端
+    const ClientTicket: string = uuidv4();  // 客户端流水号
+    const UserID: number = getUserId(); // 用户id
+
+    const reqParams = {
+        ...param, OperateSrc, ClientTicket, UserID
+    }
+
     return new Promise((resolve, reject) => {
         const params = {
             protobufName: 'GldErmcpSpotContractOperateReq',
             funCodeName: 'GldErmcpSpotContractOperateReq',
-            reqParams: param,
+            reqParams: reqParams,
             msgHeadParams: {
-                AccountID: getSelectedAccountId() === null ? 0 : getSelectedAccountId(),
+                AccountID: getSelectedAccountId(),
                 MarketID: 18,
                 GoodsID: 0,
             }
@@ -34,4 +44,4 @@ export const orderContract = (param: GldErmcpSpotContractOperateReq): Promise<an
             onFail: (err) => reject(err.message),
         } as Callback);
     });
-}
+}

+ 10 - 4
src/services/proto/spotcontract/interface.ts

@@ -2,12 +2,18 @@
 export interface GldErmcpSpotContractOperateReq {
     SpotContractID: number // uint64 现货合同ID(602+Unix秒时间戳(10位)+xxxxxx)
     OperateType: number // uint32 操作类型-1:保存草稿2:提交申请3:审核通过4:审核拒绝5:撤回6:正常完结7:异常终止
-    OperateSrc: number // uint32 操作来源-1:管理端2:终端
-    UserID: number // uint64 操作用户ID
     Remark: string // string 操作备注
-    ClientTicket: string // string 客户端流水号
-    Info: GldSpotContractInfo // GldSpotContractInfo 现货合同信息
+    Info?: GldSpotContractInfo // GldSpotContractInfo 现货合同信息
 }
+
+/**
+ * 修改现货合同状态
+ */
+export interface SpotContractStatusModifyReq {
+    SpotContractID: number // uint64 现货合同ID(602+Unix秒时间戳(10位)+xxxxxx)
+    OperateType: number // uint32 操作类型-1:保存草稿2:提交申请3:审核通过4:审核拒绝5:撤回6:正常完结7:异常终止
+}
+
 // 现货合同操作响应 0 29 168
 export interface GldErmcpSpotContractOperateRsp {
     RetCode: number // int32 返回码

+ 196 - 165
src/views/information/spot-contract/components/cancel/index.vue

@@ -1,6 +1,6 @@
 <template>
   <!-- 现货合同撤销-->
-  <a-modal class="add-custom custom-detail"
+  <a-modal class="add-custom custom-detail commonModal addSpotVariety"
            title="现货合同撤销"
            v-model:visible="visible"
            centered
@@ -16,183 +16,210 @@
                 :loading="loading"
                 @click="submit">确认撤销</a-button>
     </template>
-    <a-form class="inlineForm">
-      <fieldset class="formFieldSet">
-        <legend>基本信息</legend>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="合同编号">
-              <span class="white">NPCQ-2020121001</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="合同类型">
-              <span class="white">采购合同</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="业务类型">
-              <span class="white">套保</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="采购方">
-                <span class="white">河北石家庄刚强矿石公司</span>
-            </a-form-item>
-          </a-col>
-      </a-row>
-      <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="销售方">
-             <span class="white">菏泽已成钢材有限公司</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="合同附件">
-                <div class="upload">
-                    <div class="look">查看附件</div>
-                </div>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="24">
-            <a-form-item label="状态">
-             <span class="yellow">待审核</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">螺纹钢12</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="品类">
-              <span class="white">10mm</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="品牌">
-              <span class="white">江铜</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="标仓系数">
-                <span class="white">1.1</span>
-            </a-form-item>
-          </a-col>
-      </a-row>
-      <a-row :gutter="24">
-          <a-col :span="24">
-            <a-form-item label="商品规格">
-              <span class="white">符合国际GB/T1196-2008AL99.70规定,其中铝含量不低于99.7%</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">点价</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="数量">
-              <span class="white">菏泽已成钢材有限公司</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="点价合约">
-              <span class="white">CU2011</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="升贴水">
-              <span class="white">100元/吨</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="点价期">
-              <span class="white">2020-12-10~2021-02-10</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="交收期">
-              <span class="white">2020-12-10~2021-02-10</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">13700元</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="业务员">
-              <span class="white">李顺利(lishunli)</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="跟单员">
-              <span class="white">王平(wangping)</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="期货账户">
-                <span class="white">25000000001</span>
-            </a-form-item>
-          </a-col>
-      </a-row>
-      <a-row :gutter="24">
-          <a-col :span="24">
-            <a-form-item label="备注">
-              <span class="white">符合国际GB/T1196-2008AL99.70规定,其中铝含量不低于99.7%</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-      </fieldset>
-    </a-form>
+      <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">{{ formatValue(selectedRow.contractno) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="合同类型">
+                          <span class="white">{{ formatValue(selectedRow.contractno) }}</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.biztype) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="采购方">
+                          <span class="white">{{ formatValue(selectedRow.buyusername) }}</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.sellusername) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="合同附件">
+                          <span class="white">{{ formatValue(selectedRow.contracctstatus) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item label="状态">
+                          <span class="yellow">{{ formatValue(getContractStatusName(selectedRow.contracctstatus)) }}</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.deliverygoodsname) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="品类">
+                          <span class="white">{{ formatValue(selectedRow.wrstandardname) }}</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.brandname) }}</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.spotgoodsdesc) }}</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">{{ getPriceTypeName(formatValue(selectedRow.pricetype)) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="数量">
+                          <span class="white">{{ formatValue(selectedRow.qty) }}</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.goodscode) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="升贴水">
+                          <span class="white">{{ formatValue(selectedRow.pricemove) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item label="点价期">
+                          <span class="white">{{ formatValue(formatTime(selectedRow.startdate, "d") + '--' + formatTime(selectedRow.enddate, "d")) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="交收期">
+                          <span class="white">{{ formatValue(formatTime(selectedRow.deliverystartdate, "d") + '--' + formatTime(selectedRow.deliveryenddate, "d"))}}</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.contractmargin) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="业务员">
+                          <span class="white">{{ formatValue(selectedRow.saleuserlogincode) }}</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.meruserlogincode) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="期货账户">
+                          <span class="white">{{ formatValue(selectedRow.accountid) }}</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">
-import { defineComponent, ref } from 'vue';
+import {defineComponent, PropType, ref} from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
+import {Ermcp3ContractRsp} from "@/services/go/ermcp/spot-contract/interface";
+import {formatTime, formatValue} from "@/common/methods";
+import {getContractStatusName, getPriceTypeName} from "@/views/information/spot-contract/setup";
+import {message, Modal} from "ant-design-vue";
+import {deleteOrderContract} from "@/views/information/spot-contract/components/setup";
 
 export default defineComponent({
     name: 'spot-contract-detail',
     components: {},
-    setup() {
+    props: {
+        selectedRow: {
+            type: Object as PropType<Ermcp3ContractRsp>,
+            default: {},
+        },
+    },
+    setup(props, context) {
         const { visible, cancel } = closeModal('spot_contract_btn_cancel');
-        const loading = ref<boolean>(false);
+        const {loading, orderContractState} = deleteOrderContract()
         const maskClosableFlag = ref<boolean>(false);
         function submit() {
             loading.value = true;
-            setTimeout(() => {
-                loading.value = false;
-                cancel();
-            }, 2000);
+            Modal.confirm({
+                title: '是否确认撤销',
+                okText: '确认撤销',
+                cancelText: '取消',
+                onOk() {
+                    // 删除客户资料
+                    orderContractState(props.selectedRow.spotcontractid)
+                        .then(res => {
+                            message.success(res);
+                            // 通知上层  刷新数据
+                            context.emit('refresh');
+                            cancel();
+                        }).catch(err => {
+                        message.error(err);
+                    });
+                },
+                onCancel() {
+                    console.log('Cancel');
+                },
+            });
         }
         return {
             visible,
@@ -200,6 +227,10 @@ export default defineComponent({
             submit,
             loading,
             maskClosableFlag,
+            formatValue,
+            getPriceTypeName,
+            getContractStatusName,
+            formatTime,
         };
     },
 });

+ 196 - 165
src/views/information/spot-contract/components/delete/index.vue

@@ -1,6 +1,6 @@
 <template>
   <!-- 删除现货合同--->
-  <a-modal class="recover-custom"
+  <a-modal class="recover-custom commonModal addSpotVariety"
            title="删除现货合同"
            v-model:visible="visible"
            centered
@@ -16,183 +16,210 @@
                 :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">{{ formatValue(selectedRow.contractno) }}</span>
-              </a-form-item>
-            </a-col>
-            <a-col :span="12">
-              <a-form-item label="合同类型">
-                <span class="white">{{ formatValue(selectedRow.contractno) }}</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.biztype) }}</span>
-              </a-form-item>
-            </a-col>
-            <a-col :span="12">
-              <a-form-item label="采购方">
-                <span class="white">{{ formatValue(selectedRow.buyusername) }}</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.sellusername) }}</span>
-              </a-form-item>
-            </a-col>
-            <a-col :span="12">
-              <a-form-item label="合同附件">
-                <span class="white">{{ formatValue(selectedRow.contracctstatus) }}</span>
-              </a-form-item>
-            </a-col>
-          </a-row>
-          <a-row :gutter="24">
-            <a-col :span="12">
-              <a-form-item label="状态">
-                <span class="blue">{{ formatValue(getContractStatusName(selectedRow.contracctstatus)) }}</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.deliverygoodsname) }}</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="品类">
-              <span class="white">{{ formatValue(selectedRow.wrstandardname) }}</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.brandname) }}</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.spotgoodsdesc) }}</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">{{ getPriceTypeName(formatValue(selectedRow.pricetype)) }}</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="数量">
-              <span class="white">{{ formatValue(selectedRow.qty) }}</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.goodscode) }}</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="升贴水">
-              <span class="white">{{ formatValue(selectedRow.pricemove) }}</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="点价期">
-              <span class="white">{{ formatValue(formatTime(selectedRow.startdate, "d") + '--' + formatTime(selectedRow.enddate, "d")) }}</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="交收期">
-              <span class="white">{{ formatValue(formatTime(selectedRow.deliverystartdate, "d") + '--' + formatTime(selectedRow.deliveryenddate, "d"))}}</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.contractmargin) }}</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="业务员">
-              <span class="white">{{ formatValue(selectedRow.saleuserlogincode) }}</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.meruserlogincode) }}</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="期货账户">
-              <span class="white">{{ formatValue(selectedRow.accountid) }}</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-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">{{ formatValue(selectedRow.contractno) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="合同类型">
+                          <span class="white">{{ formatValue(selectedRow.contractno) }}</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.biztype) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="采购方">
+                          <span class="white">{{ formatValue(selectedRow.buyusername) }}</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.sellusername) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="合同附件">
+                          <span class="white">{{ formatValue(selectedRow.contracctstatus) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item label="状态">
+                          <span class="yellow">{{ formatValue(getContractStatusName(selectedRow.contracctstatus)) }}</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.deliverygoodsname) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="品类">
+                          <span class="white">{{ formatValue(selectedRow.wrstandardname) }}</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.brandname) }}</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.spotgoodsdesc) }}</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">{{ getPriceTypeName(formatValue(selectedRow.pricetype)) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="数量">
+                          <span class="white">{{ formatValue(selectedRow.qty) }}</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.goodscode) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="升贴水">
+                          <span class="white">{{ formatValue(selectedRow.pricemove) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item label="点价期">
+                          <span class="white">{{ formatValue(formatTime(selectedRow.startdate, "d") + '--' + formatTime(selectedRow.enddate, "d")) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="交收期">
+                          <span class="white">{{ formatValue(formatTime(selectedRow.deliverystartdate, "d") + '--' + formatTime(selectedRow.deliveryenddate, "d"))}}</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.contractmargin) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="业务员">
+                          <span class="white">{{ formatValue(selectedRow.saleuserlogincode) }}</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.meruserlogincode) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="期货账户">
+                          <span class="white">{{ formatValue(selectedRow.accountid) }}</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">
-import { defineComponent, ref } from 'vue';
+import {defineComponent, PropType, ref} from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
+import {Ermcp3ContractRsp} from "@/services/go/ermcp/spot-contract/interface";
+import {formatTime, formatValue} from "@/common/methods";
+import {getContractStatusName, getPriceTypeName} from "@/views/information/spot-contract/setup";
+import {message, Modal} from "ant-design-vue";
+import {deleteOrderContract} from "@/views/information/spot-contract/components/setup";
 
 export default defineComponent({
     name: 'delete-spot-contract',
     components: {},
-    setup() {
+    props: {
+        selectedRow: {
+            type: Object as PropType<Ermcp3ContractRsp>,
+            default: {},
+        },
+    },
+    setup(props, context) {
         const { visible, cancel } = closeModal('spot_contract_btn_delete');
-        const loading = ref<boolean>(false);
+        const {loading, orderContractState} = deleteOrderContract()
         const maskClosableFlag = ref<boolean>(false);
         function submit() {
             loading.value = true;
-            setTimeout(() => {
-                loading.value = false;
-                cancel();
-            }, 2000);
+            Modal.confirm({
+                title: '是否确认删除',
+                okText: '确认删除',
+                cancelText: '取消',
+                onOk() {
+                    // 删除客户资料
+                    orderContractState(props.selectedRow.spotcontractid)
+                        .then(res => {
+                            message.success(res);
+                            // 通知上层  刷新数据
+                            context.emit('refresh');
+                            cancel();
+                        }).catch(err => {
+                        message.error(err);
+                    });
+                },
+                onCancel() {
+                    console.log('Cancel');
+                },
+            });
         }
         return {
             visible,
@@ -200,6 +227,10 @@ export default defineComponent({
             submit,
             loading,
             maskClosableFlag,
+            formatValue,
+            getPriceTypeName,
+            getContractStatusName,
+            formatTime,
         };
     },
 });

+ 196 - 165
src/views/information/spot-contract/components/finish/index.vue

@@ -16,190 +16,221 @@
                 :loading="loading"
                 @click="submit">确认完结</a-button>
     </template>
-    <a-form class="inlineForm">
-      <fieldset class="formFieldSet">
-        <legend>基本信息</legend>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="合同编号">
-              <span class="white">NPCQ-2020121001</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="合同类型">
-              <span class="white">采购合同</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="业务类型">
-              <span class="white">套保</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="采购方">
-                <span class="white">河北石家庄刚强矿石公司</span>
-            </a-form-item>
-          </a-col>
-      </a-row>
-      <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="销售方">
-             <span class="white">菏泽已成钢材有限公司</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="合同附件">
-                <div class="upload">
-                    <div class="look">查看附件</div>
-                </div>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="24">
-            <a-form-item label="状态">
-             <span class="green">正常</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">螺纹钢12</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="品类">
-              <span class="white">10mm</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="品牌">
-              <span class="white">江铜</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="标仓系数">
-                <span class="white">1.1</span>
-            </a-form-item>
-          </a-col>
-      </a-row>
-      <a-row :gutter="24">
-          <a-col :span="24">
-            <a-form-item label="商品规格">
-              <span class="white">符合国际GB/T1196-2008AL99.70规定,其中铝含量不低于99.7%</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">点价</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="数量">
-              <span class="white">菏泽已成钢材有限公司</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="点价合约">
-              <span class="white">CU2011</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="升贴水">
-              <span class="white">100元/吨</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="点价期">
-              <span class="white">2020-12-10~2021-02-10</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="交收期">
-              <span class="white">2020-12-10~2021-02-10</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">13700元</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="业务员">
-              <span class="white">李顺利(lishunli)</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="跟单员">
-              <span class="white">王平(wangping)</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="期货账户">
-                <span class="white">25000000001</span>
-            </a-form-item>
-          </a-col>
-      </a-row>
-      <a-row :gutter="24">
-          <a-col :span="24">
-            <a-form-item label="备注">
-              <span class="white">符合国际GB/T1196-2008AL99.70规定,其中铝含量不低于99.7%</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-      </fieldset>
-    </a-form>
+      <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">{{ formatValue(selectedRow.contractno) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="合同类型">
+                          <span class="white">{{ formatValue(selectedRow.contractno) }}</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.biztype) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="采购方">
+                          <span class="white">{{ formatValue(selectedRow.buyusername) }}</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.sellusername) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="合同附件">
+                          <span class="white">{{ formatValue(selectedRow.contracctstatus) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item label="状态">
+                          <span class="yellow">{{ formatValue(getContractStatusName(selectedRow.contracctstatus)) }}</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.deliverygoodsname) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="品类">
+                          <span class="white">{{ formatValue(selectedRow.wrstandardname) }}</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.brandname) }}</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.spotgoodsdesc) }}</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">{{ getPriceTypeName(formatValue(selectedRow.pricetype)) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="数量">
+                          <span class="white">{{ formatValue(selectedRow.qty) }}</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.goodscode) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="升贴水">
+                          <span class="white">{{ formatValue(selectedRow.pricemove) }}</span>
+                      </a-form-item>
+                  </a-col>
+              </a-row>
+              <a-row :gutter="24">
+                  <a-col :span="12">
+                      <a-form-item label="点价期">
+                          <span class="white">{{ formatValue(formatTime(selectedRow.startdate, "d") + '--' + formatTime(selectedRow.enddate, "d")) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="交收期">
+                          <span class="white">{{ formatValue(formatTime(selectedRow.deliverystartdate, "d") + '--' + formatTime(selectedRow.deliveryenddate, "d"))}}</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.contractmargin) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="业务员">
+                          <span class="white">{{ formatValue(selectedRow.saleuserlogincode) }}</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.meruserlogincode) }}</span>
+                      </a-form-item>
+                  </a-col>
+                  <a-col :span="12">
+                      <a-form-item label="期货账户">
+                          <span class="white">{{ formatValue(selectedRow.accountid) }}</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">
-import { defineComponent, ref } from 'vue';
+import {defineComponent, PropType, ref} from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
+import {formatTime, formatValue} from "@/common/methods";
+import {getContractStatusName, getPriceTypeName} from "@/views/information/spot-contract/setup";
+import {Ermcp3ContractRsp} from "@/services/go/ermcp/spot-contract/interface";
+import {deleteOrderContract} from "@/views/information/spot-contract/components/setup";
+import {message, Modal} from "ant-design-vue";
 
 export default defineComponent({
     name: 'spot-contract-detail',
     components: {},
-    setup() {
+    props: {
+        selectedRow: {
+            type: Object as PropType<Ermcp3ContractRsp>,
+            default: {},
+        },
+    },
+    setup(props, context) {
         const { visible, cancel } = closeModal('spot_contract_btn_finish');
-        const loading = ref<boolean>(false);
+        const {loading, orderContractState} = deleteOrderContract()
         const maskClosableFlag = ref<boolean>(false);
         function submit() {
             loading.value = true;
-            setTimeout(() => {
-                loading.value = false;
-                cancel();
-            }, 2000);
+            Modal.confirm({
+                title: '是否确认完结',
+                okText: '确认完结',
+                cancelText: '取消',
+                onOk() {
+                    // 删除客户资料
+                    orderContractState(props.selectedRow.spotcontractid)
+                        .then(res => {
+                            message.success(res);
+                            // 通知上层  刷新数据
+                            context.emit('refresh');
+                            cancel();
+                        }).catch(err => {
+                        message.error(err);
+                    });
+                },
+                onCancel() {
+                    console.log('Cancel');
+                },
+            });
         }
         return {
             visible,
             cancel,
             submit,
             loading,
-            maskClosableFlag
+            maskClosableFlag,
+            formatValue,
+            getPriceTypeName,
+            getContractStatusName,
+            formatTime,
         };
     },
 });

+ 32 - 0
src/views/information/spot-contract/components/setup.ts

@@ -0,0 +1,32 @@
+import {GldErmcpSpotContractOperateReq} from "@/services/proto/spotcontract/interface";
+import {orderContract} from "@/services/proto/spotcontract";
+import {ref} from "vue";
+import {getSelectedAccountId} from "@/services/bus/account";
+
+
+/**
+ * 删除未提交合同 // uint32 操作类型-1:保存草稿2:提交申请3:审核通过4:审核拒绝5:撤回6:正常完结7:异常终止
+ */
+export function deleteOrderContract(){
+    const loading = ref<boolean>(false);
+
+    function orderContractState(id: string): Promise<string>{
+        const reqs : GldErmcpSpotContractOperateReq = {
+            SpotContractID: Number(id),
+            OperateType: 6,
+            Remark: '',
+        }
+       return orderContract(reqs)
+            .then(res => {
+                return Promise.reject("删除成功")
+            })
+            .catch(err => {
+                return Promise.resolve("删除失败:" + err)
+            }).finally(() => {
+               loading.value = false
+           })
+    }
+
+    return {loading, orderContractState}
+}
+

+ 65 - 37
src/views/information/spot-contract/list/checkpending/index.vue

@@ -1,40 +1,62 @@
 <template>
-  <!-- 现货合同: 待审核-->
-  <div class="spot-contract-peddding"
-       :loading="loading">
-    <filterCustomTable @search="search">
-      <BtnList :btnList="commonBtn" />
-    </filterCustomTable>
-    <contextMenu :contextMenuList="forDataBtn">
-      <a-table :columns="columns"
-               class="topTable hiddenFirstCol"
-               :pagination="false"
-               rowKey="key"
-               :expandedRowKeys="expandedRowKeys"
-               :customRow="Rowclick"
-               :data-source="spotContractList">
-        <!-- 额外的展开行 -->
-        <template #expandedRowRender="{  }">
-          <BtnList :btnList="forDataBtn" />
-        </template>
-        <!-- <template #userinfotype="{ text }">
-          <a>{{ text === '2' ? '企业' : '个人'}}</a>
-        </template> -->
-      </a-table>
-    </contextMenu>
-    <!-- 现货合同: 详情 -->
-    <SpotContractDeatil :selectedRow="selectedRow" />
-    <!-- 现货合同: 审核 -->
-    <Check />
-    <!-- 现货合同: 撤销 -->
-    <Cancel />
-  </div>
+    <!-- 现货合同: 待审核-->
+    <div class="spot-contract-peddding"
+         :loading="loading">
+        <filterCustomTable @search="search">
+            <BtnList :btnList="commonBtn"/>
+        </filterCustomTable>
+        <contextMenu :contextMenuList="forDataBtn">
+            <a-table :columns="columns"
+                     class="topTable hiddenFirstCol"
+                     :pagination="false"
+                     rowKey="key"
+                     :expandedRowKeys="expandedRowKeys"
+                     :customRow="Rowclick"
+                     :data-source="tableList">
+                <!-- 额外的展开行 -->
+                <template #expandedRowRender="{  }">
+                    <BtnList :btnList="forDataBtn"/>
+                </template>
+                <!-- <template #userinfotype="{ text }">
+                  <a>{{ text === '2' ? '企业' : '个人'}}</a>
+                </template> -->
+
+                <template #biztype="{ text }">
+                    <a>{{ getBizTypeName(text) }}</a>
+                </template>
+
+                <template #pricetype="{ text }">
+                    <a>{{ getPriceTypeName(text) }}</a>
+                </template>
+
+                <template #contracctstatus="{ text }">
+                    <a>{{ getContractStatusName(text) }}</a>
+                </template>
+
+            </a-table>
+        </contextMenu>
+        <!-- 现货合同: 详情 -->
+        <SpotContractDeatil :selectedRow="selectedRow" @refresh="queryTable"/>
+        <!-- 现货合同: 审核 -->
+        <Check :selectedRow="selectedRow" @refresh="queryTable"/>
+        <!-- 现货合同: 撤销 -->
+        <Cancel :selectedRow="selectedRow" @refresh="queryTable"/>
+    </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
-import { AddSpotContract, SpotContractDeatil, Check, Cancel, filterCustomTable } from '../../components';
-import { queryTableList, getFilterTableCB, Ermcp3ContractRsp } from '../index';
+import {
+    defineComponent,
+    initData,
+    getTableColumns,
+    getTableEvent,
+    getBtnList,
+    contextMenu,
+    BtnList
+} from '@/common/export/table';
+import {AddSpotContract, SpotContractDeatil, Check, Cancel, filterCustomTable} from '../../components';
+import {queryTableList, getFilterTableCB, Ermcp3ContractRsp} from '../index';
+import {getBizTypeName, getContractStatusName, getPriceTypeName} from "@/views/information/spot-contract/setup";
 
 export default defineComponent({
     name: 'spot-contract-peddding',
@@ -49,19 +71,21 @@ export default defineComponent({
     },
     setup() {
         // 表头数据
-        const { columns, registerColumn, updateColumn, filteredInfo } = getTableColumns();
+        const {columns, registerColumn, updateColumn, filteredInfo} = getTableColumns();
         // 表格事件
-        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<Ermcp3ContractRsp>({});
+        const {expandedRowKeys, selectedRow, Rowclick} = getTableEvent<Ermcp3ContractRsp>({});
         // 表格操作按钮列表
-        const { commonBtn, forDataBtn } = getBtnList('spot_contract_checkpending', true);
+        const {commonBtn, forDataBtn} = getBtnList('spot_contract_checkpending', true);
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList(2);
+        const {loading, tableList, queryTable} = queryTableList(2);
+
         // 查询
         function search(value: any) {
             filteredInfo.value = value;
             // 更新表信息
             updateColumn();
         }
+
         initData(() => {
             // 获取列表数据
             queryTable();
@@ -79,6 +103,10 @@ export default defineComponent({
             loading,
             tableList,
             search,
+            queryTable,
+            getBizTypeName,
+            getPriceTypeName,
+            getContractStatusName,
         };
     },
 });

+ 17 - 2
src/views/information/spot-contract/list/finished/index.vue

@@ -12,7 +12,7 @@
                :expandedRowKeys="expandedRowKeys"
                :customRow="Rowclick"
                rowKey="key"
-               :data-source="spotContractList">
+               :data-source="tableList">
         <!-- 额外的展开行 -->
         <template #expandedRowRender="{  }">
           <BtnList :btnList="forDataBtn" />
@@ -20,12 +20,23 @@
         <!-- <template #userinfotype="{ text }">
           <a>{{ text === '2' ? '企业' : '个人'}}</a>
         </template> -->
+          <template #biztype="{ text }">
+              <a>{{ getBizTypeName(text) }}</a>
+          </template>
+
+          <template #pricetype="{ text }">
+              <a>{{ getPriceTypeName(text) }}</a>
+          </template>
+
+          <template #contracctstatus="{ text }">
+              <a>{{ getContractStatusName(text) }}</a>
+          </template>
       </a-table>
     </contextMenu>
     <!-- 新增现货合同 -->
     <AddSpotContract />
     <!-- 现货合同: 详情 -->
-    <SpotContractDeatil :selectedRow="selectedRow" />
+    <SpotContractDeatil :selectedRow="selectedRow" @refresh="queryTable"/>
   </div>
 </template>
 
@@ -34,6 +45,7 @@ import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList,
 import { AddSpotContract, SpotContractDeatil, filterCustomTable } from '../../components';
 
 import { queryTableList, getFilterTableCB, Ermcp3ContractRsp } from '../index';
+import {getBizTypeName, getContractStatusName, getPriceTypeName} from "@/views/information/spot-contract/setup";
 
 export default defineComponent({
     name: 'spot-contract-done',
@@ -76,6 +88,9 @@ export default defineComponent({
             loading,
             tableList,
             search,
+            getBizTypeName,
+            getPriceTypeName,
+            getContractStatusName,
         };
     },
 });

+ 18 - 3
src/views/information/spot-contract/list/performance/index.vue

@@ -12,7 +12,7 @@
                :expandedRowKeys="expandedRowKeys"
                :customRow="Rowclick"
                rowKey="key"
-               :data-source="spotContractList">
+               :data-source="tableList">
         <!-- 额外的展开行 -->
         <template #expandedRowRender="{  }">
           <BtnList :btnList="forDataBtn" />
@@ -20,12 +20,23 @@
         <!-- <template #userinfotype="{ text }">
           <a>{{ text === '2' ? '企业' : '个人'}}</a>
         </template> -->
+          <template #biztype="{ text }">
+              <a>{{ getBizTypeName(text) }}</a>
+          </template>
+
+          <template #pricetype="{ text }">
+              <a>{{ getPriceTypeName(text) }}</a>
+          </template>
+
+          <template #contracctstatus="{ text }">
+              <a>{{ getContractStatusName(text) }}</a>
+          </template>
       </a-table>
     </contextMenu>
     <!-- 现货合同: 详情 -->
-    <SpotContractDeatil :selectedRow="selectedRow" />
+    <SpotContractDeatil :selectedRow="selectedRow" @refresh="queryTable"/>
     <!-- 现货合同: 正常完结 -->
-    <Finish />
+    <Finish :selectedRow="selectedRow" @refresh="queryTable"/>
   </div>
 </template>
 
@@ -34,6 +45,7 @@ import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList,
 import { AddSpotContract, SpotContractDeatil, filterCustomTable, Finish } from '../../components';
 
 import { queryTableList, getFilterTableCB, Ermcp3ContractRsp } from '../index';
+import {getBizTypeName, getContractStatusName, getPriceTypeName} from "@/views/information/spot-contract/setup";
 
 export default defineComponent({
     name: 'spot-contract-performance',
@@ -77,6 +89,9 @@ export default defineComponent({
             loading,
             tableList,
             search,
+            getBizTypeName,
+            getPriceTypeName,
+            getContractStatusName,
         };
     },
 });

+ 77 - 41
src/views/information/spot-contract/list/unsubmitted/index.vue

@@ -1,45 +1,75 @@
 <template>
-  <!-- 现货合同: 未提交-->
-  <div class="spot-contract-not-commit"
-       :loading="loading">
-    <filterCustomTable @search="search">
-      <BtnList :btnList="commonBtn" />
-    </filterCustomTable>
-    <contextMenu :contextMenuList="forDataBtn">
-      <a-table :columns="columns"
-               class="topTable"
-               :pagination="false"
-               :expandedRowKeys="expandedRowKeys"
-               :customRow="Rowclick"
-               rowKey="key"
-               :data-source="spotContractList">
-        <!-- 额外的展开行 -->
-        <template #expandedRowRender="{  }">
-          <BtnList :btnList="forDataBtn" />
-        </template>
-        <!-- <template #userinfotype="{ text }">
-          <a>{{ text === '2' ? '企业' : '个人'}}</a>
-        </template> -->
-      </a-table>
-    </contextMenu>
-    <!-- 新增现货合同 -->
-    <AddSpotContract />
-    <!-- 现货合同: 详情 -->
-    <SpotContractDeatil :selectedRow="selectedRow" />
-    <!-- 现货合同: 修改 -->
-    <ModifySpotContract />
-    <!-- 现货合同: 删除 -->
-    <DeleteSpotContract />
-    <!-- 现货合同: 重新提交 -->
-    <ResubmitSpotContract />
-  </div>
+    <!-- 现货合同: 未提交-->
+    <div class="spot-contract-not-commit"
+         :loading="loading">
+        <filterCustomTable @search="search">
+            <BtnList :btnList="commonBtn"/>
+        </filterCustomTable>
+        <contextMenu :contextMenuList="forDataBtn">
+            <a-table :columns="columns"
+                     class="topTable"
+                     :pagination="false"
+                     :expandedRowKeys="expandedRowKeys"
+                     :customRow="Rowclick"
+                     rowKey="key"
+                     :data-source="tableList">
+                <!-- 额外的展开行 -->
+                <template #expandedRowRender="{  }">
+                    <BtnList :btnList="forDataBtn"/>
+                </template>
+                <!-- <template #userinfotype="{ text }">
+                  <a>{{ text === '2' ? '企业' : '个人'}}</a>
+                </template> -->
+                <template #biztype="{ text }">
+                    <a>{{ getBizTypeName(text) }}</a>
+                </template>
+
+                <template #pricetype="{ text }">
+                    <a>{{ getPriceTypeName(text) }}</a>
+                </template>
+
+                <template #contracctstatus="{ text }">
+                    <a>{{ getContractStatusName(text) }}</a>
+                </template>
+            </a-table>
+        </contextMenu>
+        <!-- 新增现货合同 -->
+        <AddSpotContract/>
+        <!-- 现货合同: 详情 -->
+        <SpotContractDeatil :selectedRow="selectedRow"
+                            @refresh="queryTable"/>
+        <!-- 现货合同: 修改 -->
+        <ModifySpotContract :selectedRow="selectedRow"
+                            @refresh="queryTable"/>
+        <!-- 现货合同: 删除 -->
+        <DeleteSpotContract :selectedRow="selectedRow"
+                            @refresh="queryTable"/>
+        <!-- 现货合同: 重新提交 -->
+        <ResubmitSpotContract/>
+    </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
-import { AddSpotContract, SpotContractDeatil, filterCustomTable, ModifySpotContract, DeleteSpotContract, ResubmitSpotContract } from '../../components';
+import {
+    defineComponent,
+    initData,
+    getTableColumns,
+    getTableEvent,
+    getBtnList,
+    contextMenu,
+    BtnList
+} from '@/common/export/table';
+import {
+    AddSpotContract,
+    SpotContractDeatil,
+    filterCustomTable,
+    ModifySpotContract,
+    DeleteSpotContract,
+    ResubmitSpotContract
+} from '../../components';
 
-import { queryTableList, getFilterTableCB, Ermcp3ContractRsp } from '../index';
+import {queryTableList, getFilterTableCB, Ermcp3ContractRsp} from '../index';
+import {getBizTypeName, getContractStatusName, getPriceTypeName} from "@/views/information/spot-contract/setup";
 
 export default defineComponent({
     name: 'spot-contract-not-commit',
@@ -55,19 +85,21 @@ export default defineComponent({
     },
     setup() {
         // 表头数据
-        const { columns, registerColumn, updateColumn, filteredInfo } = getTableColumns();
+        const {columns, registerColumn, updateColumn, filteredInfo} = getTableColumns();
         // 表格事件
-        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<Ermcp3ContractRsp>({});
+        const {expandedRowKeys, selectedRow, Rowclick} = getTableEvent<Ermcp3ContractRsp>({});
         // 表格操作按钮列表
-        const { commonBtn, forDataBtn } = getBtnList('spot_contract_unsubmitted', true);
+        const {commonBtn, forDataBtn} = getBtnList('spot_contract_unsubmitted', true);
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList(1);
+        const {loading, tableList, queryTable} = queryTableList(1);
+
         // 查询
         function search(value: any) {
             filteredInfo.value = value;
             // 更新表信息
             updateColumn();
         }
+
         initData(() => {
             // 获取列表数据
             queryTable();
@@ -85,6 +117,10 @@ export default defineComponent({
             loading,
             tableList,
             search,
+            queryTable,
+            getBizTypeName,
+            getPriceTypeName,
+            getContractStatusName,
         };
     },
 });

+ 17 - 0
src/views/information/spot-contract/setup.ts

@@ -47,4 +47,21 @@ export function getPriceTypeName(state: number): string {
             break
     }
     return result
+}
+
+/**
+ * 业务类型返回 业务类型 1-套保 2-套利
+ * @param state
+ */
+export function getBizTypeName(state: number): string {
+    let result = "--";
+    switch (state) {
+        case 1:
+            result = "套保";
+            break
+        case 2:
+            result = "套利";
+            break
+    }
+    return result
 }