huangbin 4 年之前
父節點
當前提交
445a155400

+ 11 - 0
src/services/go/wrtrade/index.ts

@@ -22,6 +22,7 @@ import {
     QueryWrMarketTradeConfigReq,
     QueryWrOrderDetailReq,
     QueryWrPerformancePlanStepReq,
+    QueryWrPerformanceStepTypeRsp,
     QueryWrPositionReq,
     QueryWrScfContractInterestReq,
     QueryWrSpecialMatchOrderReq,
@@ -385,3 +386,13 @@ export function queryQueryPermancePlanTmp(param: QueryPermancePlanTmpReq): Promi
     });
 }
 
+/**
+ * /WrTrade2/QueryWrPerformanceStepType 查询履约步骤枚举
+ * @param queryWrPerformanceStepType
+ */
+export function queryWrPerformanceStepType(): Promise<QueryWrPerformanceStepTypeRsp[]> {
+    return commonSearch_go('/WrTrade2/QueryWrPerformanceStepType', {}).catch((err) => {
+        throw new Error(`查询议价单: ${err}`);
+    });
+}
+

+ 6 - 0
src/services/go/wrtrade/interface.ts

@@ -1140,4 +1140,10 @@ export interface QueryPermancePlanTmpRsp {
     lstStep: WrGoodsPerformanceStep[],// 步骤信息列表
     //:通用 1:交割 2:仓单贸易 3:预售集采 7:竞拍-竞价式 8:竞拍-大宗式 9:荷兰式–失效枚举:4:竞拍-降价式 (无仓单) 5:挂牌期权 6:竞拍-降价式
     userid: number;//所属用户
+}
+
+export interface QueryWrPerformanceStepTypeRsp {
+    canauto: number; // 能否自动确认 - 0:不可自动确认 1:可自动确认 (可设置自动确认步骤: 1:买方支付 3:买方自提 5:买方确认货 7:买方确认票)
+    steptypeid: number; // 步骤类型ID - 1:买方支付 2:卖方收款 3:买方自提 4:卖方发货 5:买方确认货 6:卖方发票 7:买方确认票 8:仓单转移
+    steptypename: string; // 步骤类型名称
 }

+ 13 - 3
src/services/proto/performance/index.ts

@@ -1,14 +1,15 @@
 /*************     履约相关 proto 接口    ***************/
 
 
-import {protoMiddleware} from "@/services/socket/protobuf/buildReq";
 import {
+    AddPerformanceTemp,
     PerformanceActivateReq,
     PerformanceContractedApplyReq,
     PerformanceDelayApplyReq,
     PerformanceManualConfirmReq, PerformanceModifyContactReq
 } from "@/services/proto/performance/interface";
-import {HeadEnum} from "@/services/socket/protobuf/protoHeader";
+import { protoMiddleware } from "@/services/socket/protobuf/buildReq";
+import { HeadEnum } from "@/services/socket/protobuf/protoHeader";
 
 /**
  * 履约手动确认 (支付 发票 发货)
@@ -46,6 +47,15 @@ export const performanceModifyContact = (param: PerformanceModifyContactReq): Pr
  * 履约激活请求
  * @param param
  */
-export const performanceActivate = (param: PerformanceActivateReq):Promise<any> => {
+export const performanceActivate = (param: PerformanceActivateReq): Promise<any> => {
     return protoMiddleware<PerformanceActivateReq>(param, 'PerformanceActivateReq', 'PerformanceActivateRsp', HeadEnum.tradeMode17)
 }
+
+/**
+ * 新增履约模板
+ * @param param
+ * @returns
+ */
+export const addPerformanceTemp = (param: AddPerformanceTemp): Promise<any> => {
+    return protoMiddleware<AddPerformanceTemp>(param, 'PerformancePlanTemplateReq', 'PerformancePlanTemplateReq', HeadEnum.tradeMode17)
+}

+ 26 - 7
src/services/proto/performance/interface.ts

@@ -7,27 +7,27 @@ export interface PerformanceContractedApplyReq {
     Attachment: string // string 附件
 }
 // 违约申请应答 0 20 10
-export interface  PerformanceContractedApplyRsp {
+export interface PerformanceContractedApplyRsp {
     RetCode: number // int32 返回码
     RetDesc: string // string 描述信息
     PerformancePlanID: number // uint64 履约计划ID
 }
 // 延期申请请求 0 20 5
-export interface  PerformanceDelayApplyReq {
+export interface PerformanceDelayApplyReq {
     PerformancePlanStepID: number // uint64 履约计划步骤ID
     delaydays: number // uint32 申请延期天数
     applicant: number // uint64 申请人
     applyremark: string // string 申请备注
 }
 // 延期申请应答 0 20 6
-export interface  PerformanceDelayApplyRsp {
+export interface PerformanceDelayApplyRsp {
     RetCode: number // int32 返回码
     RetDesc: string // string 描述信息
     PerformancePlanStepID: number // uint64 履约计划步骤ID
     applicant: number // uint64 申请人
 }
 // 履约手动确认请求 0 20 3
-export interface  PerformanceManualConfirmReq {
+export interface PerformanceManualConfirmReq {
     PerformancePlanStepID: number // uint64 履约计划步骤ID
     OverShortAmount?: number // double 溢短金额
     PerformanceExecuteSide?: number // uint32 履约步骤执行方 1买方 2 卖方
@@ -36,7 +36,7 @@ export interface  PerformanceManualConfirmReq {
     ExpressFee?: number // double 运费金额
 }
 // 履约手动确认应答 0 20 4
-export interface  PerformanceManualConfirmRsp {
+export interface PerformanceManualConfirmRsp {
     RetCode: number // int32 返回码
     RetDesc: string // string 描述信息
     PerformancePlanStepID: number // uint64 履约计划步骤ID
@@ -57,14 +57,33 @@ export interface PerformanceModifyContactRsp {
 }
 
 // 履约激活请求 0 20 21
-export interface  PerformanceActivateReq {
+export interface PerformanceActivateReq {
     PerformancePlanID: number // uint64 履约计划ID
     ApplyAccountID: number // uint64 发起方账号ID
 }
 // 履约激活应答 0 20 22
-export interface  PerformanceActivateRsp {
+export interface PerformanceActivateRsp {
     RetCode: number // int32 返回码
     RetDesc: string // string 描述信息
     PerformancePlanID: number  // uint64 履约计划ID
 }
 
+export interface PerfomanceStempTempInfo {
+    steptypeid: number // 履约计划模板ID
+    stepindex: number //步骤序号
+    stepvalue: number // 步骤值
+    isauto: number // 是否自动是否自动 - 0:不自动 1:自动
+    remark: string // 备注
+    stepdays: number // 距离上一步天数
+}
+
+export interface AddPerformanceTemp {
+    autoid: number // 履约计划模板主键不为0且不为空修改否则新增
+    templatename: string // 模板名称
+    takemode: number // 提货方式
+    type: number // 模板类型
+    performancesteps: PerfomanceStempTempInfo[], //履约步骤
+    userid: number // 所属用户
+    paymenttype: number // 支付方式
+    creatorid: number //  操作人
+}

+ 128 - 130
src/views/market/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_blocs/components/post-buying/addPermance.vue

@@ -1,99 +1,108 @@
 <template>
-    <!--新增履约模板-->
-    <Drawer
-        :title="'新增履约模板'"
-        :placement="'right'"
-        :visible="visible"
-        @cancel="cancel"
-        class="top486"
-    >
-        <a-spin :spinning="loading">
-            <div class="listed">
-                <a-form class="inlineForm dialogForm">
-                    <div class="formBar">
-                        <a-row :gutter="24">
-                            <a-col :span="24">
-                                <a-form-item label="模版名称">
-                                    <a-input
-                                        class="commonInput"
-                                        value="30天账期"
-                                        style="width: 260px"
-                                    />
-                                </a-form-item>
-                            </a-col>
-                        </a-row>
-                        <a-row class="tableTitle">
-                            <a-col :span="7">步骤类型</a-col>
-                            <a-col :span="6">步骤值(%)</a-col>
-                            <a-col :span="7">距离上一步天数</a-col>
-                            <a-col :span="4">操作</a-col>
-                        </a-row>
-                        <a-row class="tableContent">
-                            <a-col :span="7">
-                                <a-select
-                                    class="inlineFormSelect dialogTableSelect"
-                                    style="width: 108px"
-                                    placeholder="请选择"
-                                    v-model:value="form.pay"
-                                >
-                                    <a-select-option key="1" value="1">买方支付</a-select-option>
-                                </a-select>
-                            </a-col>
-                            <a-col :span="6">
-                                <a-input
-                                    class="commonInput dialogTableInput"
-                                    style="width: 100px"
-                                    v-model:value="step1"
-                                ></a-input>
-                            </a-col>
-                            <a-col :span="7">
-                                <a-input
-                                    class="commonInput dialogTableInput"
-                                    style="width: 122px"
-                                    v-model:value="day1"
-                                ></a-input>
-                            </a-col>
-                            <a-col :span="4">
-                                <svg class="icon svg-icon" aria-hidden="true">
-                                    <use xlink:href="#icon-shanchu" />
-                                </svg>
-                                <PlusCircleOutlined />
-                            </a-col>
-                        </a-row>
-                        <div class="noticeTip">
-                            <div>注意事项:</div>
-                            <div>1、买方支付汇总值必须为100%;</div>
-                            <div>2、卖方收款汇总值必须为100%;</div>
-                            <div>3、配置卖方收款之前要有买方支付,且其值不能多于买方支付的值。</div>
-                        </div>
-                    </div>
-                    <a-row :gutter="24">
-                        <a-col :span="24" class="fixedBtns">
-                            <a-form-item class="btnCenter">
-                                <a-button class="listedBtn">确定</a-button>
-                            </a-form-item>
-                        </a-col>
-                    </a-row>
-                </a-form>
+  <!--新增履约模板-->
+  <Drawer :title="'新增履约模板'"
+          :placement="'right'"
+          :visible="visible"
+          @cancel="cancel"
+          class="top486">
+    <a-spin :spinning="loading">
+      <div class="listed">
+        <a-form class="inlineForm dialogForm">
+          <div class="formBar">
+            <a-row :gutter="24">
+              <a-col :span="24">
+                <a-form-item label="模版名称">
+                  <a-input class="commonInput"
+                           value="30天账期"
+                           style="width: 260px" />
+                </a-form-item>
+              </a-col>
+            </a-row>
+            <a-row class="tableTitle">
+              <a-col :span="7">步骤类型</a-col>
+              <a-col :span="6">步骤值(%)</a-col>
+              <a-col :span="7">距离上一步天数</a-col>
+              <a-col :span="4">操作</a-col>
+            </a-row>
+            <a-row class="tableContent"
+                   v-for="(parent, index) in tableList"
+                   :key="index + '11'">
+              <a-col :span="7">
+                <a-form-item :name="['domains',index, 'steptypeid']">
+                  <a-select class="inlineFormSelect dialogTableSelect"
+                            style="width: 108px"
+                            placeholder="请选择"
+                            @change="stepTypeChange(parent)"
+                            v-model:value="parent.steptypeid">
+                    <a-select-option v-for="item in list"
+                                     :key="item.steptypeid"
+                                     :value="item.steptypeid">{{item.steptypename}}
+                    </a-select-option>
+                  </a-select>
+                </a-form-item>
+              </a-col>
+              <a-col :span="6">
+                <a-form-item :name="['domains',index, 'stepvalue']">
+                  <a-input-number class="commonInput dialogTableInput"
+                                  style="width: 100px"
+                                  type="number"
+                                  v-model:value="parent.stepvalue"></a-input-number>
+                </a-form-item>
+              </a-col>
+              <a-col :span="7">
+                <a-form-item :name="['domains',index, 'stepdays']">
+                  <a-input-number class="commonInput dialogTableInput"
+                                  style="width: 122px"
+                                  type="number"
+                                  v-model:value="parent.stepdays"></a-input-number>
+                </a-form-item>
+              </a-col>
+              <a-col :span="4">
+                <svg class="icon svg-icon"
+                     @click="deleteTemp(index)"
+                     aria-hidden="true">
+                  <use xlink:href="#icon-shanchu" />
+                </svg>
+                <PlusCircleOutlined v-if="index === (tableList.length - 1)"
+                                    @click="addTemp(index)" />
+              </a-col>
+            </a-row>
+            <div class="noticeTip">
+              <div>注意事项:</div>
+              <div>1、买方支付汇总值必须为100%;</div>
+              <div>2、卖方收款汇总值必须为100%;</div>
+              <div>3、配置卖方收款之前要有买方支付,且其值不能多于买方支付的值。</div>
             </div>
-        </a-spin>
-    </Drawer>
+          </div>
+          <a-row :gutter="24">
+            <a-col :span="24"
+                   class="fixedBtns">
+              <a-form-item class="btnCenter">
+                <a-button class="listedBtn"
+                          @click="submit">确定</a-button>
+              </a-form-item>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+    </a-spin>
+  </Drawer>
 </template>
 
 <script lang="ts">
-import { defineComponent, PropType, ref } from 'vue';
+import { defineComponent, PropType, reactive, ref, UnwrapRef } from 'vue';
 import { Des } from '@/common/components/commonDes';
 import { _closeModal } from '@/common/setup/modal/modal';
 import Drawer from '@/common/components/drawer/index.vue';
 import { PlusOutlined, MinusOutlined, SearchOutlined, PlusCircleOutlined } from '@ant-design/icons-vue';
-import { QueryWrFriendApplyRsp } from '@/services/go/wrtrade/interface';
+import { QueryWrFriendApplyRsp, QueryWrPerformanceStepTypeRsp } from '@/services/go/wrtrade/interface';
 import { TempWrOrderQuoteDetail } from '@/views/market/spot_trade/components/post_buying/interface';
-import { queryQueryWrFriend } from '@/services/go/wrtrade';
+import { queryQueryWrFriend, queryWrPerformanceStepType } from '@/services/go/wrtrade';
 import { message } from 'ant-design-vue';
-
-interface FriendList extends QueryWrFriendApplyRsp {
-    checked: boolean;
-}
+import { useQueryData } from '@/common/setup/request';
+import { AddPerformanceTemp, PerfomanceStempTempInfo } from '@/services/proto/performance/interface';
+import { validateAction } from '@/common/setup/form';
+import { PermanceTemp, PermanceTempForm } from './interface';
 
 export default defineComponent({
     emits: ['cancel', 'update'],
@@ -102,51 +111,38 @@ export default defineComponent({
     setup(props, context) {
         const { visible, cancel } = _closeModal(context);
         const loading = ref<boolean>(false);
-        const searchValue = ref<string>('');
-        const myFriends = ref<FriendList[]>([]);
-        // 模板字段
-        const form = {
-            pay: '1',
-            step1: '',
-            day1: '',
-        };
-        // 查询好友列表
-        function queryMyFriend(value?: string) {
-            loading.value = true;
-            queryQueryWrFriend(value)
-                .then((res) => {
-                    if (res) {
-                        myFriends.value = [];
-                        res.forEach((el) => {
-                            myFriends.value.push({ ...el, checked: false });
-                        });
-                    }
-                })
-                .catch((err: string) => message.error(err))
-                .finally(() => {
-                    loading.value = false;
-                });
+        const { list } = useQueryData<QueryWrPerformanceStepTypeRsp>(queryWrPerformanceStepType);
+        const temp: PermanceTemp = { steptypeid: undefined, stepindex: 1, stepvalue: null, isauto: 0, remark: '', stepdays: null };
+        const tableList = ref<PermanceTemp[]>([temp]);
+        // 新增
+        function addTemp(index: number) {
+            tableList.value.push(temp);
+        }
+        // 删除
+        function deleteTemp(index: number) {
+            tableList.value.splice(index, 1);
         }
-        queryMyFriend();
-        function getViewFriends() {
-            if (searchValue.value) {
-                return myFriends.value.filter((el) => String(el.frienduserid).includes(searchValue.value));
-            } else {
-                return myFriends.value;
+        function stepTypeChange(item: PermanceTemp) {
+            const stepType = list.value.find((el) => el.steptypeid === item.steptypeid)!;
+            const { steptypename } = stepType;
+            // 买方支付汇总值必须为100%;
+            // 卖方收款汇总值必须为100%;
+            if (steptypename === '买方支付汇总' || steptypename === '卖方收款汇总') {
+                item.stepvalue = 100;
             }
         }
+        // 表单
+        const formRef = ref();
+        const formState: UnwrapRef<PermanceTempForm> = reactive({ domains: [] });
+        const rules = {
+            domains: {
+                steptypeid: { required: true, message: '请选择步骤类型', trigger: 'change' },
+                stepvalue: { required: true, message: '请输入步骤值', trigger: 'blur' },
+                stepdays: { required: true, message: '请输入距离上一步天数', trigger: 'blur' },
+            },
+        };
         function submit() {
-            const result: string[] = [];
-            myFriends.value.forEach((el) => {
-                if (el.checked) {
-                    result.push(el.frienduserid);
-                }
-            });
-            if (result.length) {
-                context.emit('update', result);
-            } else {
-                message.warn('请选择朋友');
-            }
+            validateAction<PermanceTempForm>(formRef, formState).then((res) => {});
         }
         function handleSearch(value: string) {
             // const findResult = myFriends.value.find((e) => String(e.frienduserid).includes(value));
@@ -158,13 +154,15 @@ export default defineComponent({
         }
         return {
             loading,
-            myFriends,
+            list,
+            tableList,
+            addTemp,
+            deleteTemp,
+            stepTypeChange,
+
             cancel,
             visible,
             submit,
-            searchValue,
-            getViewFriends,
-            form,
         };
     },
 });

+ 12 - 0
src/views/market/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_blocs/components/post-buying/interface.ts

@@ -10,3 +10,15 @@ export interface FormParam {
     vidaliteTime: Moment,
 }
 
+export interface PermanceTemp {
+    steptypeid: number | undefined;
+    stepvalue: number | null;
+    stepdays: number | null;
+    isauto: number; // 是否自动是否自动 - 0:不自动 1:自动
+    remark: string; // 备注
+    stepindex: number; //步骤序号
+}
+
+export interface PermanceTempForm {
+    domains: PermanceTemp[]
+}