Browse Source

commit 删除现货合同

xkwg 4 years ago
parent
commit
408dd99913

+ 1 - 1
src/services/proto/spotcontract/index.ts

@@ -4,7 +4,7 @@ import {Callback} from "@/utils/websocket";
 import {GldErmcpSpotContractOperateReq} from "@/services/proto/spotcontract/interface";
 
 /**(重点提醒 这里属于管理端接口,仅用于新增)以上来自android代码  回头需要确认
- * 获取新增采购合同报文
+ * 新增 / 修改采购合同报文 (很多修改合同操作也在这)
  * @param
  * @param param
  */

+ 172 - 159
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,173 +16,182 @@
                 :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";
 
 export default defineComponent({
     name: 'delete-spot-contract',
     components: {},
+    props: {
+        selectedRow: {
+            type: Object as PropType<Ermcp3ContractRsp>,
+            default: {},
+        },
+    },
     setup() {
         const { visible, cancel } = closeModal('spot_contract_btn_delete');
         const loading = ref<boolean>(false);
@@ -200,6 +209,10 @@ export default defineComponent({
             submit,
             loading,
             maskClosableFlag,
+            formatValue,
+            getPriceTypeName,
+            getContractStatusName,
+            formatTime,
         };
     },
 });

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

@@ -0,0 +1,24 @@
+import {GldErmcpSpotContractOperateReq} from "@/services/proto/spotcontract/interface";
+import {orderContract} from "@/services/proto/spotcontract";
+import {ref} from "vue";
+
+/**
+ * 删除未提交合同
+ */
+export function deleteOrderContract(){
+    const loading = ref<boolean>(false);
+
+    function orderContractState(req: GldErmcpSpotContractOperateReq): Promise<string>{
+       return orderContract(req)
+            .then(res => {
+                return Promise.reject("删除成功")
+            })
+            .catch(err => {
+                return Promise.resolve("删除失败:" + err)
+            }).finally(() => {
+               loading.value = false
+           })
+    }
+
+    return {loading, orderContractState}
+}

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

@@ -1,45 +1,63 @@
 <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> -->
+            </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';
 
 export default defineComponent({
     name: 'spot-contract-not-commit',
@@ -55,19 +73,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 +105,7 @@ export default defineComponent({
             loading,
             tableList,
             search,
+            queryTable,
         };
     },
 });