Ver código fonte

commit 计划

xkwg 4 anos atrás
pai
commit
75525683da

+ 14 - 3
src/services/go/ermcp/plan/interface.ts

@@ -1,13 +1,16 @@
 export interface Ermcp3HedgePlan{
+    accountid	:number;//资金账号
     areauserid	:number;//用户ID
     audittime	:string;//审核时间
     contracttype	:number;//计划类型 - 1:采购 -1:销售
     convertfactor	:number;//标仓系数
     createtime	:string;//创建时间
+    currencyid	:number;//币种id
+    currencyname	:string;//币种名称
     deliverygoodscode	:string;//现货品种代码
     deliverygoodsid	:number;//现货品种ID
-    deliverygoodsname	:string;//现货品种名称8
-    enumdicname	:string;//单位名称
+    deliverygoodsname	:string;//现货品种名称
+    enumdicname	:string;//单位名称(现货商品)
     hedgeplanid	:string;//套保计划ID(6number;
 //1+Unix秒时间戳(1number;
 //位)+xxxxxx)
@@ -19,6 +22,14 @@ export interface Ermcp3HedgePlan{
     producttype	:number;//产品类型 - 1:标准仓单 2:等标 3:非标
     remark	:string;//备注
     spotgoodsdesc	:string;//商品型号
-    unitid	:number;//单位id
+    taaccountname	:string;//资金账号名称
+    tradeuserid	:number;//交易用户id
+    tradeusername	:string;//交易用户名称
+    unitid	:number;//单位id(现货商品)
     updatetime	:string;//更新时间
+    wrstandardcode	:string;//品类代码
+    wrstandardid	:number;//品类id
+    wrstandardname	:string;//品类名称
+    wrunitid	:number;//品类单位id
+    wrunitidame	:string;//品类单位名称
 }

+ 5 - 2
src/services/proto/hedgeplan/index.ts

@@ -3,20 +3,23 @@ import {buildProtoReq50, parseProtoRsp50} from "@/services/socket/protobuf/build
 import APP from "@/services";
 import {Callback} from "@/utils/websocket";
 import {ErmcpHedgePlanReq} from "@/services/proto/hedgeplan/interface";
+import {getSelectedAccountId} from "@/services/bus/account";
 
 /**
  * 套保计划操作请求
  * @param param.hedgePlanID Long 套保计划id
  * @param param.OperateType Int 操作类型-1:保存草稿2:提交申请3:审核通过4:审核拒绝5:撤回
  */
-export const operationContractReq = (param: ErmcpHedgePlanReq): Promise<any> => {
+export const hedgePlanReq = (param: ErmcpHedgePlanReq): Promise<any> => {
+    param.ApplySrc = 1; // 申请来源 - 1:管理端 2:终端
+
     return new Promise((resolve, reject) => {
         const params = {
             protobufName: 'ErmcpHedgePlanReq',
             funCodeName: 'ErmcpHedgePlanReq',
             reqParams:  param,
             msgHeadParams: {
-                AccountID: param.accountid,
+                AccountID: getSelectedAccountId(),
                 MarketID: 18,
                 GoodsID: 0,
             }

+ 13 - 14
src/services/proto/hedgeplan/interface.ts

@@ -1,20 +1,19 @@
 // 套保计划请求 0 29 164
 export interface ErmcpHedgePlanReq {
-    accountid: string  // header 需要用到
     HedgePlanID: number // uint64 套保计划ID(601+Unix秒时间戳(10位)+xxxxxx)
-    HedgePlanNo: string // string 套保计划名称
-    ContractType: number // int32 计划类型-1:采购-1:销售
-    AreaUserID: number// uint64 机构ID
-    DeliveryGoodsID: number// uint64 现货品种ID
-    ProductType: number // int32 产品类型-1:标准仓单2:等标3:非标
-    SpotGoodsDesc: string // string 商品型号
-    PlanQty: number // double 计划数量
-    ConvertFactor: number // double 标仓系数
-    PlanTime: string // string 计划时间
-    TradeDate: string // string 交易日(yyyyMMdd)
-    ApplySrc: number // int32 申请来源 - 1:管理端 2:终端
-    ApplyId: number // uint64 申请人
-    Remark: string // string 计划备注
+    HedgePlanNo?: string // string 套保计划名称
+    ContractType?: number // int32 计划类型-1:采购-1:销售
+    AreaUserID?: number// uint64 机构ID
+    DeliveryGoodsID?: number// uint64 现货品种ID
+    ProductType?: number // int32 产品类型-1:标准仓单2:等标3:非标
+    SpotGoodsDesc?: string // string 商品型号
+    PlanQty?: number // double 计划数量
+    ConvertFactor?: number // double 标仓系数
+    PlanTime?: string // string 计划时间
+    TradeDate?: string // string 交易日(yyyyMMdd)
+    ApplySrc?: number // int32 申请来源 - 1:管理端 2:终端
+    ApplyId?: number // uint64 申请人
+    Remark?: string // string 计划备注
     OperateType: number // int32 操作类型-1:保存草稿2:提交申请
 }
 

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

@@ -34,7 +34,6 @@ export const orderContract = (param: GldErmcpSpotContractOperateReq): Promise<an
         APP.sendTradingServer(package50, undefined, {
             onSuccess: (res) => {
                 const { isSuccess, result } = parseProtoRsp50(res, 'GldErmcpSpotContractOperateRsp');
-                debugger
                 if (isSuccess) {
                     resolve(result);
                 } else {

+ 124 - 29
src/views/business/plan/components/cancel/index.vue

@@ -1,49 +1,144 @@
 <template>
-  <!-- 计划撤销-->
-  <a-modal class="custom-detail"
-           title="计划撤销"
-           v-model:visible="visible"
-           centered
-           :maskClosable="maskClosableFlag"
-           @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>
-    plan_audit_cancel
-  </a-modal>
+    <!-- 计划撤销-->
+    <a-modal class="custom-detail"
+             title="计划撤销"
+             v-model:visible="visible"
+             centered
+             :maskClosable="maskClosableFlag"
+             @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>
+        <fieldset class="formFieldSet">
+            <legend>基本信息</legend>
+            <a-form class="inlineForm"
+                    :form="form"
+                    @submit="handleSearch">
+                <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>
+            </a-form>
+        </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-modal>
 </template>
 
 <script lang="ts">
-import { defineComponent, ref } from 'vue';
-import { closeModal } from '@/common/setup/modal/index';
+import {defineComponent, PropType, ref} from 'vue';
+import {closeModal} from '@/common/setup/modal/index';
+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 {PlanStatus} from "@/views/business/plan/components/setup";
 
 export default defineComponent({
     name: 'plan_audit_cancel',
     components: {},
-    setup() {
-        const { visible, cancel } = closeModal('plan_audit_cancel');
-        const loading = ref<boolean>(false);
+    props: {
+        selectedRow: {
+            type: Object as PropType<Ermcp3HedgePlan>,
+            default: {},
+        },
+    },
+    setup(props, context) {
+        const {visible, cancel} = closeModal('plan_audit_cancel');
+        const {loading, changeStatus} = PlanStatus()
         const maskClosableFlag = ref<boolean>(false);
+
         function submit() {
-            loading.value = true;
-            setTimeout(() => {
-                loading.value = false;
-                cancel();
-            }, 2000);
+            Modal.confirm({
+                title: '是否确认撤销',
+                okText: '确认撤销',
+                cancelText: '取消',
+                onOk() {
+                    // 撤销合同
+                    changeStatus(props.selectedRow.hedgeplanid, 5)
+                        .then(res => {
+                            context.emit('refresh')
+                            cancel()
+                        })
+                        .catch(err => {
+
+                        })
+                },
+                onCancel() {
+                    console.log('Cancel');
+                },
+            });
         }
+
         return {
             visible,
             cancel,
             submit,
             loading,
             maskClosableFlag,
+            formatValue,
+            getPlanContractType,
         };
     },
 });

+ 81 - 8
src/views/business/plan/components/delete/index.vue

@@ -11,31 +11,104 @@
                 :loading="loading"
                 @click="submit">完成</a-button>
     </template>
+      <fieldset class="formFieldSet">
+          <legend>基本信息</legend>
+          <a-form class="inlineForm"
+                  :form="form"
+                  @submit="handleSearch">
+              <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>
+          </a-form>
+      </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-modal>
 </template>
 
 <script lang="ts">
-import { defineComponent, ref } from 'vue';
+import {defineComponent, PropType, ref} from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
+import {PlanStatus} from "@/views/business/plan/components/setup";
+import {Ermcp3HedgePlan} from "@/services/go/ermcp/plan/interface";
+import {formatValue} from "@/common/methods";
+import {getPlanContractType} from "@/views/business/plan/setup";
 
 export default defineComponent({
     name: 'plan_uncommitted_delete',
     components: {},
-    setup() {
+    props: {
+        selectedRow: {
+            type: Object as PropType<Ermcp3HedgePlan>,
+            default: {},
+        },
+    },
+    setup(props, context) {
         const { visible, cancel } = closeModal('plan_uncommitted_delete');
-        const loading = ref<boolean>(false);
+        const {loading, changeStatus} = PlanStatus()
         function submit() {
-            loading.value = true;
-            setTimeout(() => {
-                loading.value = false;
-                cancel();
-            }, 2000);
+
         }
         return {
             visible,
             cancel,
             submit,
             loading,
+            formatValue,
+            getPlanContractType,
         };
     },
 });

+ 96 - 69
src/views/business/plan/components/detail/index.vue

@@ -1,68 +1,96 @@
 <template>
-  <!-- 套保计划详情-->
-  <a-modal class="add-custom custom-detail"
-           title="套保计划详情"
-           v-model:visible="visible"
-           @cancel="cancel"
-           width="890px">
-    <template #footer>
-      <a-button key="submit"
-                type="primary"
-                :loading="loading"
-                @click="submit">关闭</a-button>
-    </template>
-    <a-form class="inlineForm"
-            :form="form"
-            @submit="handleSearch">
-      <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>
-    </a-form>
-  </a-modal>
+    <!-- 套保计划详情-->
+    <a-modal class="add-custom custom-detail"
+             title="套保计划详情"
+             v-model:visible="visible"
+             @cancel="cancel"
+             width="890px">
+        <template #footer>
+            <a-button key="submit"
+                      type="primary"
+                      :loading="loading"
+                      @click="submit">关闭
+            </a-button>
+        </template>
+        <fieldset class="formFieldSet">
+            <legend>基本信息</legend>
+            <a-form class="inlineForm"
+                    :form="form"
+                    @submit="handleSearch">
+                <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>
+            </a-form>
+        </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-modal>
 </template>
 
 <script lang="ts">
-import { defineComponent, PropType, reactive, ref, watchEffect } from 'vue';
-import { closeModal } from '@/common/setup/modal/index';
-import { QueryCustomInfoType } from '@/services/go/ermcp/customInfo/interface';
-import { mergeObj } from '@/utils/objHandle';
-import { getStatusName } from '@/views/information/custom/setup';
-import { Ermcp3HedgePlan } from '@/services/go/ermcp/plan/interface';
-import { formatValue } from '@/common/methods';
-import { getPlanContractType } from '@/views/business/plan/setup';
+import {defineComponent, PropType, reactive, ref, watchEffect} from 'vue';
+import {closeModal} from '@/common/setup/modal/index';
+import {QueryCustomInfoType} from '@/services/go/ermcp/customInfo/interface';
+import {mergeObj} from '@/utils/objHandle';
+import {getStatusName} from '@/views/information/custom/setup';
+import {Ermcp3HedgePlan} from '@/services/go/ermcp/plan/interface';
+import {formatValue} from '@/common/methods';
+import {getPlanContractType} from '@/views/business/plan/setup';
+import {PlanStatus} from "@/views/business/plan/components/setup";
+import {Modal} from "ant-design-vue";
 
 export default defineComponent({
     name: 'plan-detail',
@@ -73,16 +101,15 @@ export default defineComponent({
             default: {},
         },
     },
-    setup() {
-        const { visible, cancel } = closeModal('detail');
-        const loading = ref<boolean>(false);
+    setup(props, context) {
+        const {visible, cancel} = closeModal('detail');
+        const {loading, changeStatus} = PlanStatus()
+
         function submit() {
-            loading.value = true;
-            setTimeout(() => {
-                loading.value = false;
-                cancel();
-            }, 2000);
+            context.emit('refresh')
+            cancel()
         }
+
         return {
             visible,
             cancel,

+ 42 - 0
src/views/business/plan/components/setup.ts

@@ -0,0 +1,42 @@
+import {ref} from "vue";
+import {hedgePlanReq} from "@/services/proto/hedgeplan";
+import {ErmcpHedgePlanReq} from "@/services/proto/hedgeplan/interface";
+import {message} from "ant-design-vue";
+import {getRequestResultInfo} from "@/common/methods/request";
+import {hedgePlanSign} from "@/views/business/plan/setup";
+import Long from "long";
+
+/**
+ * 套保计划状态管理
+ * @constructor
+ */
+export function PlanStatus() {
+    const loading = ref<boolean>(false);
+
+    /**
+     * 1:保存草稿2:提交申请3:审核通过4:审核拒绝5:撤回
+     * @param id HedgePlanID
+     * @param type
+     */
+    function changeStatus(id: String, type: number): Promise<string> {
+        loading.value = true
+        const params: ErmcpHedgePlanReq = {
+            HedgePlanID: Long.fromString(id),
+            OperateType: type
+        }
+        const sign = getRequestResultInfo(hedgePlanSign, type)  // 接口请求后的返回提示 这里统一进行管理
+        debugger
+        return hedgePlanReq(params)
+            .then(res => {
+                message.success(sign[0])
+                return Promise.resolve(res)
+            })
+            .catch(err => {
+                message.error(sign[1] + err)
+                return Promise.reject(sign[1] + err)
+            })
+    }
+
+    return {loading, changeStatus}
+}
+

+ 61 - 40
src/views/business/plan/list/audit/index.vue

@@ -1,43 +1,59 @@
 <template>
-  <!-- 计划: 审核中-->
-  <div class="plan_uncommitted"
-       :loading="loading">
-    <Filter @search="search">
-      <BtnList :btnList="commonBtn" />
-    </Filter>
-    <contextMenu :contextMenuList="forDataBtn">
-      <a-table :columns="columns"
-               class="topTable hiddenFirstCol"
-               :pagination="false"
-               :expandedRowKeys="expandedRowKeys"
-               :customRow="Rowclick"
-               rowKey="key"
-               :data-source="tableList">
-        <!-- 额外的展开行 -->
-        <template #expandedRowRender="{  }">
-          <BtnList :btnList="forDataBtn" />
-        </template>
-        <!-- <template #warehousetype="{ text }">
-          <span>{{ getWareHouseType(text) }}</span>
-        </template>
-        <template #warehousestatus="{ text }">
-          <span>{{ getWareHouseStatus(text) }}</span>
-        </template> -->
-      </a-table>
-    </contextMenu>
-    <!-- 详情 -->
-    <Detail />
-    <!-- 撤销 -->
-    <Cancel />
-    <!-- 审核 -->
-    <Audit />
-  </div>
+    <!-- 计划: 审核中-->
+    <div class="plan_uncommitted"
+         :loading="loading">
+        <Filter @search="search">
+            <BtnList :btnList="commonBtn"/>
+        </Filter>
+        <contextMenu :contextMenuList="forDataBtn">
+            <a-table :columns="columns"
+                     class="topTable hiddenFirstCol"
+                     :pagination="false"
+                     :expandedRowKeys="expandedRowKeys"
+                     :customRow="Rowclick"
+                     rowKey="key"
+                     :data-source="tableList">
+                <!-- 额外的展开行 -->
+                <template #expandedRowRender="{  }">
+                    <BtnList :btnList="forDataBtn"/>
+                </template>
+
+                <template #contracttype="{ text }">
+                    <a>{{ getPlanContractType(text) }}</a>
+                </template>
+                <template #hedgeplanstatus="{ text }">
+                    <a>{{ getPlanStatusName(text) }}</a>
+                </template>
+                <!-- <template #warehousetype="{ text }">
+                  <span>{{ getWareHouseType(text) }}</span>
+                </template>
+                <template #warehousestatus="{ text }">
+                  <span>{{ getWareHouseStatus(text) }}</span>
+                </template> -->
+            </a-table>
+        </contextMenu>
+        <!-- 详情 -->
+        <Detail :selectedRow="selectedRow" @refresh="queryTable"/>
+        <!-- 撤销 -->
+        <Cancel :selectedRow="selectedRow" @refresh="queryTable"/>
+        <!-- 审核 -->
+        <Audit :selectedRow="selectedRow" @refresh="queryTable"/>
+    </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
-import { getFilterTableCB, queryTableList, Ermcp3HedgePlan } from '../index';
-import { Add, Detail, Filter, Recommit, Cancel, Audit } from '../../components';
+import {
+    defineComponent,
+    initData,
+    getTableColumns,
+    getTableEvent,
+    getBtnList,
+    contextMenu,
+    BtnList
+} from '@/common/export/table';
+import {getFilterTableCB, queryTableList, Ermcp3HedgePlan} from '../index';
+import {Add, Detail, Filter, Recommit, Cancel, Audit} from '../../components';
+import {getPlanContractType, getPlanStatusName} from "@/views/business/plan/setup";
 
 export default defineComponent({
     name: 'plan_uncommitted',
@@ -53,19 +69,21 @@ export default defineComponent({
     },
     setup() {
         // 表头数据
-        const { columns, registerColumn, updateColumn, filteredInfo } = getTableColumns();
+        const {columns, registerColumn, updateColumn, filteredInfo} = getTableColumns();
         // 表格事件
-        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<Ermcp3HedgePlan>({});
+        const {expandedRowKeys, selectedRow, Rowclick} = getTableEvent<Ermcp3HedgePlan>({});
         // 表格操作按钮列表
-        const { commonBtn, forDataBtn } = getBtnList('plan_audit', true);
+        const {commonBtn, forDataBtn} = getBtnList('plan_audit', true);
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList('1');
+        const {loading, tableList, queryTable} = queryTableList('1');
+
         // 查询
         function search(value: any) {
             filteredInfo.value = value;
             // 更新表信息
             updateColumn();
         }
+
         initData(() => {
             // 获取列表数据
             queryTable();
@@ -83,6 +101,9 @@ export default defineComponent({
             loading,
             tableList,
             search,
+            getPlanStatusName,
+            getPlanContractType,
+            queryTable,
         };
     },
 });

+ 60 - 40
src/views/business/plan/list/running/index.vue

@@ -1,43 +1,58 @@
 <template>
-  <!-- 计划: 执行中-->
-  <div class="plan_running"
-       :loading="loading">
-    <Filter @search="search">
-      <BtnList :btnList="commonBtn" />
-    </Filter>
-    <contextMenu :contextMenuList="forDataBtn">
-      <a-table :columns="columns"
-               class="topTable hiddenFirstCol"
-               :pagination="false"
-               :expandedRowKeys="expandedRowKeys"
-               :customRow="Rowclick"
-               rowKey="key"
-               :data-source="tableList">
-        <!-- 额外的展开行 -->
-        <template #expandedRowRender="{  }">
-          <BtnList :btnList="forDataBtn" />
-        </template>
-        <!-- <template #warehousetype="{ text }">
-          <span>{{ getWareHouseType(text) }}</span>
-        </template>
-        <template #warehousestatus="{ text }">
-          <span>{{ getWareHouseStatus(text) }}</span>
-        </template> -->
-      </a-table>
-    </contextMenu>
-    <!-- 详情 -->
-    <Detail />
-    <!-- 撤销 -->
-    <Cancel />
-    <!-- 审核 -->
-    <Audit />
-  </div>
+    <!-- 计划: 执行中-->
+    <div class="plan_running"
+         :loading="loading">
+        <Filter @search="search">
+            <BtnList :btnList="commonBtn"/>
+        </Filter>
+        <contextMenu :contextMenuList="forDataBtn">
+            <a-table :columns="columns"
+                     class="topTable hiddenFirstCol"
+                     :pagination="false"
+                     :expandedRowKeys="expandedRowKeys"
+                     :customRow="Rowclick"
+                     rowKey="key"
+                     :data-source="tableList">
+                <!-- 额外的展开行 -->
+                <template #expandedRowRender="{  }">
+                    <BtnList :btnList="forDataBtn"/>
+                </template>
+                <template #contracttype="{ text }">
+                    <a>{{ getPlanContractType(text) }}</a>
+                </template>
+                <template #hedgeplanstatus="{ text }">
+                    <a>{{ getPlanStatusName(text) }}</a>
+                </template>
+                <!-- <template #warehousetype="{ text }">
+                  <span>{{ getWareHouseType(text) }}</span>
+                </template>
+                <template #warehousestatus="{ text }">
+                  <span>{{ getWareHouseStatus(text) }}</span>
+                </template> -->
+            </a-table>
+        </contextMenu>
+        <!-- 详情 -->
+        <Detail :selectedRow="selectedRow" @refresh="queryTable"/>
+        <!-- 撤销 -->
+        <Cancel :selectedRow="selectedRow" @refresh="queryTable"/>
+        <!-- 审核 -->
+        <Audit :selectedRow="selectedRow" @refresh="queryTable"/>
+    </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
-import { getFilterTableCB, queryTableList, Ermcp3HedgePlan } from '../index';
-import { Add, Detail, Filter, Recommit } from '../../components';
+import {
+    defineComponent,
+    initData,
+    getTableColumns,
+    getTableEvent,
+    getBtnList,
+    contextMenu,
+    BtnList
+} from '@/common/export/table';
+import {getFilterTableCB, queryTableList, Ermcp3HedgePlan} from '../index';
+import {Add, Detail, Filter, Recommit} from '../../components';
+import {getPlanContractType, getPlanStatusName} from "@/views/business/plan/setup";
 
 export default defineComponent({
     name: 'spot-contract-peddding',
@@ -51,19 +66,21 @@ export default defineComponent({
     },
     setup() {
         // 表头数据
-        const { columns, registerColumn, updateColumn, filteredInfo } = getTableColumns();
+        const {columns, registerColumn, updateColumn, filteredInfo} = getTableColumns();
         // 表格事件
-        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<Ermcp3HedgePlan>({});
+        const {expandedRowKeys, selectedRow, Rowclick} = getTableEvent<Ermcp3HedgePlan>({});
         // 表格操作按钮列表
-        const { commonBtn, forDataBtn } = getBtnList('plan_running', true);
+        const {commonBtn, forDataBtn} = getBtnList('plan_running', true);
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList('2');
+        const {loading, tableList, queryTable} = queryTableList('2');
+
         // 查询
         function search(value: any) {
             filteredInfo.value = value;
             // 更新表信息
             updateColumn();
         }
+
         initData(() => {
             // 获取列表数据
             queryTable();
@@ -81,6 +98,9 @@ export default defineComponent({
             loading,
             tableList,
             search,
+            getPlanStatusName,
+            getPlanContractType,
+            queryTable,
         };
     },
 });

+ 64 - 44
src/views/business/plan/list/uncommitted/index.vue

@@ -1,47 +1,62 @@
 <template>
-  <!-- 计划: 未提交-->
-  <div class="plan-uncommitted"
-       :loading="loading">
-    <Filter @search="search">
-      <BtnList :btnList="commonBtn" />
-    </Filter>
-    <contextMenu :contextMenuList="forDataBtn">
-      <a-table :columns="columns"
-               class="topTable hiddenFirstCol"
-               :pagination="false"
-               :expandedRowKeys="expandedRowKeys"
-               :customRow="Rowclick"
-               rowKey="key"
-               :data-source="tableList">
-        <!-- 额外的展开行 -->
-        <template #expandedRowRender="{  }">
-          <BtnList :btnList="forDataBtn" />
-        </template>
-        <!-- <template #warehousetype="{ text }">
-          <span>{{ getWareHouseType(text) }}</span>
-        </template>
-        <template #warehousestatus="{ text }">
-          <span>{{ getWareHouseStatus(text) }}</span>
-        </template> -->
-      </a-table>
-    </contextMenu>
-    <!-- 详情 -->
-    <Detail />
-    <!-- 新增 -->
-    <Add />
-    <!-- 修改 -->
-    <Modfiy />
-    <!-- 重新提交 -->
-    <Recommit />
-    <!-- 删除-->
-    <Delete />
-  </div>
+    <!-- 计划: 未提交-->
+    <div class="plan-uncommitted"
+         :loading="loading">
+        <Filter @search="search">
+            <BtnList :btnList="commonBtn"/>
+        </Filter>
+        <contextMenu :contextMenuList="forDataBtn">
+            <a-table :columns="columns"
+                     class="topTable hiddenFirstCol"
+                     :pagination="false"
+                     :expandedRowKeys="expandedRowKeys"
+                     :customRow="Rowclick"
+                     rowKey="key"
+                     :data-source="tableList">
+                <!-- 额外的展开行 -->
+                <template #expandedRowRender="{  }">
+                    <BtnList :btnList="forDataBtn"/>
+                </template>
+                <template #contracttype="{ text }">
+                    <a>{{ getPlanContractType(text) }}</a>
+                </template>
+                <template #hedgeplanstatus="{ text }">
+                    <a>{{ getPlanStatusName(text) }}</a>
+                </template>
+                <!-- <template #warehousetype="{ text }">
+                  <span>{{ getWareHouseType(text) }}</span>
+                </template>
+                <template #warehousestatus="{ text }">
+                  <span>{{ getWareHouseStatus(text) }}</span>
+                </template> -->
+            </a-table>
+        </contextMenu>
+        <!-- 详情 -->
+        <Detail :selectedRow="selectedRow" @refresh="queryTable"/>
+        <!-- 新增 -->
+        <Add :selectedRow="selectedRow" @refresh="queryTable"/>
+        <!-- 修改 -->
+        <Modfiy :selectedRow="selectedRow" @refresh="queryTable"/>
+        <!-- 重新提交 -->
+        <Recommit :selectedRow="selectedRow" @refresh="queryTable"/>
+        <!-- 删除-->
+        <Delete :selectedRow="selectedRow" @refresh="queryTable"/>
+    </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
-import { getFilterTableCB, queryTableList, Ermcp3HedgePlan } from '../index';
-import { Add, Delete, Detail, Filter, Modfiy, Recommit } from '../../components';
+import {
+    defineComponent,
+    initData,
+    getTableColumns,
+    getTableEvent,
+    getBtnList,
+    contextMenu,
+    BtnList
+} from '@/common/export/table';
+import {getFilterTableCB, queryTableList, Ermcp3HedgePlan} from '../index';
+import {Add, Delete, Detail, Filter, Modfiy, Recommit} from '../../components';
+import {getPlanContractType, getPlanStatusName} from "@/views/business/plan/setup";
 
 export default defineComponent({
     name: 'plan-uncommitted',
@@ -57,19 +72,21 @@ export default defineComponent({
     },
     setup() {
         // 表头数据
-        const { columns, registerColumn, updateColumn, filteredInfo } = getTableColumns();
+        const {columns, registerColumn, updateColumn, filteredInfo} = getTableColumns();
         // 表格事件
-        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<Ermcp3HedgePlan>({});
+        const {expandedRowKeys, selectedRow, Rowclick} = getTableEvent<Ermcp3HedgePlan>({});
         // 表格操作按钮列表
-        const { commonBtn, forDataBtn } = getBtnList('plan_uncommitted', true);
+        const {commonBtn, forDataBtn} = getBtnList('plan_uncommitted', true);
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList('0');
+        const {loading, tableList, queryTable} = queryTableList('0');
+
         // 查询
         function search(value: any) {
             filteredInfo.value = value;
             // 更新表信息
             updateColumn();
         }
+
         initData(() => {
             // 获取列表数据
             queryTable();
@@ -87,6 +104,9 @@ export default defineComponent({
             loading,
             tableList,
             search,
+            getPlanStatusName,
+            getPlanContractType,
+            queryTable,
         };
     },
 });

+ 47 - 1
src/views/business/plan/setup.ts

@@ -1,3 +1,5 @@
+import {ResultInfo} from "@/common/methods/request/interface";
+
 /**
  * 计划类型 - 1:采购 -1:销售
  * @param contracttype 返回计划类型
@@ -13,4 +15,48 @@ export function getPlanContractType(contracttype: number): string{
             break
     }
     return result
-}
+}
+
+/**
+ * 获取计划状态名称
+ * @param hedgeplanstatus //0:未提交 1:待审核 2:执行中 3:正常完结 4:审核拒绝 5:异常完结 6:已撤回
+ */
+export function getPlanStatusName(hedgeplanstatus: number): string{
+    let result = "--";
+    switch (hedgeplanstatus) {
+        case 0:
+            result = "未提交";
+            break
+        case 1:
+            result = "待审核";
+            break
+        case 2:
+            result = "执行中";
+            break
+        case 3:
+            result = "正常完结";
+            break
+        case 4:
+            result = "审核拒绝";
+            break
+        case 5:
+            result = "异常完结";
+            break
+        case 6:
+            result = "已撤回";
+            break
+    }
+    return result
+}
+
+/************** 接口相关提示 **************** /
+ *
+ */
+// 操作类型-1:保存草稿2:提交申请3:审核通过4:审核拒绝5:撤回
+export const hedgePlanSign = new Map<number, ResultInfo>([
+    [1, ['保存草稿成功', '保存草稿失败:']],
+    [2, ['提交申请成功', '提交申请失败:']],
+    [3, ['审核通过', '审核失败:']],
+    [4, ['审核拒绝成功', '审核拒绝失败:']],
+    [5, ['撤回成功', '撤回失败:']],
+])