Jelajahi Sumber

样式修改

marymelisa 4 tahun lalu
induk
melakukan
3a82ff9ca5

+ 29 - 1
src/services/proto/contract/interface.ts

@@ -1,6 +1,6 @@
 // 合同操作请求 0 29 170
 export interface ErmcpContractOperateApplyReq {
-    OperateApplyID?: number //   合同id
+    OperateApplyID?: number // 操作申请ID
     OperateType: number // uint32 操作类型-1:登记2:确认3:拒绝4:撤销
     Remark?: string // string 备注
     Info: ErmcpContractOperateApplyInfo // ErmcpContractOperateApplyInfo 合同操作信息
@@ -48,3 +48,31 @@ export interface ContractOperateApplyInfo {
     DetailJson: Uint8Array; // bytes 明细JSON
     AttachUrl: Uint8Array; // bytes 附件
 }
+
+
+/*********************************** 这里有一堆用于登记的请求结构 ************************************/
+// 点价登记
+export interface SomePriceReq{
+    PricedPrice: number;
+    PricedQty: number;
+}
+
+// 交收登记
+export interface SettlementReq{
+    ReckonRealQty?: number  // 交收量
+    ReckonOtherAmount?: number // 其它费用
+    AddMargin?: number // 追加保证金
+    DecMargin?: number // 减少保证金
+    ReckonAdjustAmount?: number // 调整金额
+}
+
+// 款项登记
+export interface FundsReq{
+    PayAmount: number
+    DeductAmount: number
+}
+
+// 发票登记
+export interface InvoiceReq{
+    InvoiceAmount: number
+}

+ 5 - 5
src/services/proto/hedgeplan/interface.ts

@@ -1,6 +1,6 @@
 // 套保计划请求 0 29 164
 export interface ErmcpHedgePlanReq {
-    HedgePlanID: number // uint64 套保计划ID(601+Unix秒时间戳(10位)+xxxxxx)
+    HedgePlanID?: number // uint64 套保计划ID(601+Unix秒时间戳(10位)+xxxxxx)
     HedgePlanNo?: string // string 套保计划名称
     ContractType?: number // int32 计划类型-1:采购-1:销售
     AreaUserID?: number// uint64 机构ID
@@ -14,7 +14,7 @@ export interface ErmcpHedgePlanReq {
     ApplySrc?: number // int32 申请来源 - 1:管理端 2:终端
     ApplyId?: number // uint64 申请人
     Remark?: string // string 计划备注
-    OperateType: number // int32 操作类型-1:保存草稿2:提交申请
+    OperateType?: number // int32 操作类型-1:保存草稿2:提交申请
 
     WRStandardID?: number; // uint64 现货品类ID
     AccountID?: number; // uint64 期货账户ID(默认为0,也可不传)
@@ -27,7 +27,7 @@ export interface ErmcpHedgePlanReq {
 }
 
 // 套保计划响应 0 29 165
-export interface  ErmcpHedgePlanRsp {
+export interface ErmcpHedgePlanRsp {
     RetCode: number // int32 返回码
     RetDesc: string // string 描述信息
 }
@@ -45,7 +45,7 @@ export interface HedgePlanOperateReq {
 }
 
 // 套保计划操作响应 0 18 3
-export interface  HedgePlanOperateRsp {
+export interface HedgePlanOperateRsp {
     RetCode: number; // int32 返回码
     RetDesc: string; // string 描述信息
     HedgePlanID: number; // uint64 套保计划ID(601+Unix秒时间戳(10位)+xxxxxx)
@@ -55,7 +55,7 @@ export interface  HedgePlanOperateRsp {
 }
 
 // 套保计划信息 0 18 1
-export interface  HedgePlanInfo {
+export interface HedgePlanInfo {
     HedgePlanNo: string; // string 套保计划编号
     ContractType: number; // int32 计划类型-1:采购-1:销售
     AreaUserID: number; // uint32 机构ID

+ 21 - 9
src/utils/objHandle/index.ts

@@ -44,16 +44,28 @@ export function mergeTwoObj(a: any, b: any, callBack?: Function) {
  * @param data 
  * @returns 
  */
-export function objectToUint8Array(data: object): Uint8Array {
-    const encode = encodeURI(JSON.stringify(data));// 对字符串进行编码
-    const base64String = btoa(encode);// 对编码的字符串转化base64
-    const padding = '='.repeat((4 - base64String.length % 4) % 4);
-    // const base64 = (base64String + padding).replace(/\-/g, '+').replace(/_/g, '/');
-    const base64 = (base64String + padding).replace(/-/g, '+').replace(/_/g, '/');
-    const rawData = window.atob(base64);
+export function objectToUint8Array(data: object) {
+    const rawData: string = JSON.stringify(data);
     const outputArray = new Uint8Array(rawData.length);
-    for (let i = 0; i < rawData.length; ++i) {
+    for (var i = 0; i < rawData.length; ++i) {
         outputArray[i] = rawData.charCodeAt(i);
     }
     return outputArray;
-}
+}
+
+// export function objectToUint8Array(data: object): Uint8Array {
+//     const encode = encodeURI(JSON.stringify(data));// 对字符串进行编码
+//     debugger
+//     const base64String = btoa(encode);// 对编码的字符串转化base64
+//     const padding = '='.repeat((4 - base64String.length % 4) % 4);
+//     // const base64 = (base64String + padding).replace(/\-/g, '+').replace(/_/g, '/');
+//     // const base64 = (base64String + padding).replace(/-/g, '+').replace(/_/g, '/');
+//     const base64 = (base64String + padding).replace(/\-/g, '+').replace(/_/g, '/');
+//     const rawData = window.atob(base64);
+//     const outputArray = new Uint8Array(rawData.length);
+//     for (let i = 0; i < rawData.length; ++i) {
+//         outputArray[i] = rawData.charCodeAt(i);
+//     }
+//     return outputArray;
+// }
+

+ 89 - 93
src/views/business/plan/components/audit/index.vue

@@ -14,89 +14,90 @@
                 type="primary"
                 :loading="loading"
                 @click="pass">审核通过</a-button>
-        <a-button key="submit"
-                  type="primary"
-                  :loading="loading"
-                  @click="refuse">审核拒绝</a-button>
+      <a-button key="submit"
+                type="primary"
+                :loading="loading"
+                @click="refuse">审核拒绝</a-button>
     </template>
-    <a-form class="inlineForm"
-            :form="form"
-            @submit="handleSearch">
+     <a-form class="inlineForm"
+              :form="form"
+              @submit="handleSearch">
       <fieldset class="formFieldSet">
-          <legend>基本信息</legend>
-              <a-row :gutter="24">
-                  <a-col :span="12">
-                      <a-form-item label="计划类型">
-                          <span class="white">{{ getPlanContractType(selectedRow.contracttype) }}</span>
-                      </a-form-item>
-                  </a-col>
-                  <a-col :span="12">
-                      <a-form-item label="计划名称">
-                          <span class="white">{{ formatValue(selectedRow.hedgeplanno) }}</span>
-                      </a-form-item>
-                  </a-col>
-              </a-row>
-              <a-row :gutter="24">
-                  <a-col :span="12">
-                      <a-form-item label="现货品种">
-                          <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</span>
-                      </a-form-item>
-                  </a-col>
-                  <a-col :span="12">
-                      <a-form-item label="标仓系数">
-                          <span class="white">{{ formatValue(selectedRow.convertfactor) }}</span>
-                      </a-form-item>
-                  </a-col>
-              </a-row>
-              <a-row :gutter="24">
-                  <a-col :span="12">
-                      <a-form-item label="计划量">
-                          <span class="white">{{ formatValue(selectedRow.planqty) }}</span>
-                      </a-form-item>
-                  </a-col>
-                  <a-col :span="12">
-                      <a-form-item label="备注">
-                          <span class="white">{{ formatValue(selectedRow.remark) }}</span>
-                      </a-form-item>
-                  </a-col>
-              </a-row>
-      </fieldset>
-      <fieldset class="formFieldSet">
-          <legend>其它信息</legend>
-          <a-row :gutter="24">
-              <a-col :span="12">
-                  <a-form-item label="交易用户">
-                      <span class="white">{{ formatValue(selectedRow.tradeusername) }}</span>
-                  </a-form-item>
-              </a-col>
-              <a-col :span="12">
-                  <a-form-item label="结算币种">
-                      <span class="white">{{ formatValue(selectedRow.currencyname) }}</span>
-                  </a-form-item>
-              </a-col>
-          </a-row>
-          <a-row :gutter="24">
-              <a-col :span="12">
-                  <a-form-item label="备注">
-                      <span class="white">{{ formatValue(selectedRow.remark) }}</span>
-                  </a-form-item>
-              </a-col>
-          </a-row>
-      </fieldset>
-      </a-form>
+        <legend>基本信息</legend>
+        <a-row :gutter="24">
+          <a-col :span="12">
+            <a-form-item label="计划类型">
+              <span class="white">{{ getPlanContractType(selectedRow.contracttype) }}</span>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="计划名称">
+              <span class="white">{{ formatValue(selectedRow.hedgeplanno) }}</span>
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="12">
+            <a-form-item label="现货品种">
+              <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</span>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="标仓系数">
+              <span class="white">{{ formatValue(selectedRow.convertfactor) }}</span>
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row :gutter="24">
+          <a-col :span="12">
+            <a-form-item label="计划量">
+              <span class="white">{{ formatValue(selectedRow.planqty) }}</span>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-item label="备注">
+              <span class="white">{{ formatValue(selectedRow.remark) }}</span>
+            </a-form-item>
+          </a-col>
+        </a-row>
+      
+    </fieldset>
+    <fieldset class="formFieldSet">
+      <legend>其它信息</legend>
+      <a-row :gutter="24">
+        <a-col :span="12">
+          <a-form-item label="交易用户">
+            <span class="white">{{ formatValue(selectedRow.tradeusername) }}</span>
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="结算币种">
+            <span class="white">{{ formatValue(selectedRow.currencyname) }}</span>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-col :span="12">
+          <a-form-item label="备注">
+            <span class="white">{{ formatValue(selectedRow.remark) }}</span>
+          </a-form-item>
+        </a-col>
+      </a-row>
+    </fieldset>
+    </a-form>
   </a-modal>
 </template>
 
 <script lang="ts">
-import {defineComponent, PropType, ref} from 'vue';
+import { defineComponent, PropType, ref } from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
-import {Modal} from "ant-design-vue";
-import {ErmcpHedgePlanReq} from "@/services/proto/hedgeplan/interface";
-import Long from "long";
-import {changeStatus} from "@/views/business/plan/components/setup";
-import {Ermcp3HedgePlan} from "@/services/go/ermcp/plan/interface";
-import {getPlanContractType} from "@/views/business/plan/setup";
-import {formatValue} from "@/common/methods";
+import { Modal } from 'ant-design-vue';
+import { ErmcpHedgePlanReq } from '@/services/proto/hedgeplan/interface';
+import Long from 'long';
+import { changeStatus } from '@/views/business/plan/components/setup';
+import { Ermcp3HedgePlan } from '@/services/go/ermcp/plan/interface';
+import { getPlanContractType } from '@/views/business/plan/setup';
+import { formatValue } from '@/common/methods';
 
 export default defineComponent({
     name: 'plan_audit_audit',
@@ -120,16 +121,14 @@ export default defineComponent({
                     const params: ErmcpHedgePlanReq = {
                         HedgePlanID: Long.fromString(props.selectedRow.hedgeplanid),
                         OperateType: 4,
-                        Remark: '通过'
-                    }
+                        Remark: '通过',
+                    };
                     changeStatus(params, 4, loading)
-                        .then(res => {
-                            cancel()
-                            context.emit('refresh')
-                        })
-                        .catch(err => {
-
+                        .then((res) => {
+                            cancel();
+                            context.emit('refresh');
                         })
+                        .catch((err) => {});
                 },
                 onCancel() {
                     console.log('Cancel');
@@ -137,7 +136,7 @@ export default defineComponent({
             });
         }
         // 审核拒绝
-        function refuse(){
+        function refuse() {
             Modal.confirm({
                 title: '是否确认审核拒绝',
                 okText: '审核拒绝',
@@ -146,15 +145,13 @@ export default defineComponent({
                     const params: ErmcpHedgePlanReq = {
                         HedgePlanID: Long.fromString(props.selectedRow.hedgeplanid),
                         OperateType: 5,
-                    }
+                    };
                     changeStatus(params, 5, loading)
-                        .then(res => {
-                            cancel()
-                            context.emit('refresh')
-                        })
-                        .catch(err => {
-
+                        .then((res) => {
+                            cancel();
+                            context.emit('refresh');
                         })
+                        .catch((err) => {});
                 },
                 onCancel() {
                     console.log('Cancel');
@@ -169,7 +166,6 @@ export default defineComponent({
             pass,
             getPlanContractType,
             formatValue,
-
         };
     },
 });

+ 13 - 14
src/views/business/purchase/components/funds/index.vue

@@ -153,6 +153,8 @@ import { getPriceTypeName } from '@/views/business/purchase/setup';
 import { operationContractReq } from '@/services/proto/contract';
 import { message } from 'ant-design-vue';
 import { objectToUint8Array } from '@/utils/objHandle';
+import {FundsReq, InvoiceReq} from "@/services/proto/contract/interface";
+import {fundsReq, invoiceReq} from "@/views/business/purchase/components/setup";
 
 export default defineComponent({
     name: 'purchase_pending_funds',
@@ -163,7 +165,7 @@ export default defineComponent({
             default: {},
         },
     },
-    setup(props) {
+    setup(props,context) {
         const { visible, cancel } = closeModal('purchase_pending_funds');
         const loading = ref<boolean>(false);
         const formRef = ref();
@@ -183,23 +185,20 @@ export default defineComponent({
             const wrapEl = unref(formRef);
             wrapEl.validate().then(() => {
                 loading.value = true;
-                operationContractReq({
-                    OperateType: 1, // uint32 操作类型-1:登记2:确认3:拒绝4:撤销
-                    Info: {
-                        OperateApplyType: 1, // uint32 操作申请类型-1:点价2:结算3:款项4:发票
-                        RelatedID: 1, // uint64 现货合同ID(602+Unix秒时间戳(10位)+xxxxxx)
-                        DetailJson: objectToUint8Array(formState), // bytes 明细JSON {}
-                    },
-                })
+                const params : FundsReq = {
+                    PayAmount: 98,
+                    DeductAmount: 90
+                }
+                // 发出发票登记
+                fundsReq(
+                    props.selectedRow.spotcontractid,
+                    params,
+                    loading)
                     .then(() => {
-                        message.success('登记成功!');
-                        loading.value = false;
                         cancel();
+                        context.emit('refresh')
                     })
                     .catch((err) => {
-                        message.error(err);
-                        loading.value = false;
-                        cancel();
                     });
             });
         }

+ 12 - 14
src/views/business/purchase/components/invoice/index.vue

@@ -153,6 +153,8 @@ import { getPriceTypeName } from '@/views/business/purchase/setup';
 import { operationContractReq } from '@/services/proto/contract';
 import { message } from 'ant-design-vue';
 import { objectToUint8Array } from '@/utils/objHandle';
+import {InvoiceReq, SettlementReq} from "@/services/proto/contract/interface";
+import {invoiceReq, settlementReq} from "@/views/business/purchase/components/setup";
 
 export default defineComponent({
     name: 'purchase_pending_invoice',
@@ -163,7 +165,7 @@ export default defineComponent({
             default: {},
         },
     },
-    setup(props) {
+    setup(props,context) {
         const { visible, cancel } = closeModal('purchase_pending_invoice');
         const loading = ref<boolean>(false);
         const formRef = ref();
@@ -183,23 +185,19 @@ export default defineComponent({
             const wrapEl = unref(formRef);
             wrapEl.validate().then(() => {
                 loading.value = true;
-                operationContractReq({
-                    OperateType: 1, // uint32 操作类型-1:登记2:确认3:拒绝4:撤销
-                    Info: {
-                        OperateApplyType: 1, // uint32 操作申请类型-1:点价2:结算3:款项4:发票
-                        RelatedID: 1, // uint64 现货合同ID(602+Unix秒时间戳(10位)+xxxxxx)
-                        DetailJson: objectToUint8Array(formState), // bytes 明细JSON {}
-                    },
-                })
+                const params : InvoiceReq = {
+                    InvoiceAmount: 123,
+                }
+                // 发出发票登记
+                invoiceReq(
+                    props.selectedRow.spotcontractid,
+                    params,
+                    loading)
                     .then(() => {
-                        message.success('登记成功!');
-                        loading.value = false;
                         cancel();
+                        context.emit('refresh')
                     })
                     .catch((err) => {
-                        message.error(err);
-                        loading.value = false;
-                        cancel();
                     });
             });
         }

+ 17 - 14
src/views/business/purchase/components/settlement/index.vue

@@ -153,6 +153,8 @@ import { getPriceTypeName } from '@/views/business/purchase/setup';
 import { operationContractReq } from '@/services/proto/contract';
 import { message } from 'ant-design-vue';
 import { objectToUint8Array } from '@/utils/objHandle';
+import {settlementReq} from "@/views/business/purchase/components/setup";
+import {SettlementReq} from "@/services/proto/contract/interface";
 
 export default defineComponent({
     name: 'purchase_pending_settlement',
@@ -163,7 +165,7 @@ export default defineComponent({
             default: {},
         },
     },
-    setup(props) {
+    setup(props,context) {
         const { visible, cancel } = closeModal('purchase_pending_settlement');
         const loading = ref<boolean>(false);
         const formRef = ref();
@@ -183,23 +185,24 @@ export default defineComponent({
             const wrapEl = unref(formRef);
             wrapEl.validate().then(() => {
                 loading.value = true;
-                operationContractReq({
-                    OperateType: 1, // uint32 操作类型-1:登记2:确认3:拒绝4:撤销
-                    Info: {
-                        OperateApplyType: 1, // uint32 操作申请类型-1:点价2:结算3:款项4:发票
-                        RelatedID: 1, // uint64 现货合同ID(602+Unix秒时间戳(10位)+xxxxxx)
-                        DetailJson: objectToUint8Array(formState), // bytes 明细JSON {}
-                    },
-                })
+
+                const params : SettlementReq = {
+                    ReckonRealQty: 10,  // 交收量
+                    ReckonOtherAmount: 11,// 其它费用
+                    AddMargin: 12, // 追加保证金
+                    // DecMargin: number // 减少保证金
+                    ReckonAdjustAmount: 13 // 调整金额
+                }
+                // 发出交收请求
+                settlementReq(
+                    props.selectedRow.spotcontractid,
+                    params,
+                    loading)
                     .then(() => {
-                        message.success('登记成功!');
-                        loading.value = false;
                         cancel();
+                        context.emit('refresh')
                     })
                     .catch((err) => {
-                        message.error(err);
-                        loading.value = false;
-                        cancel();
                     });
             });
         }

+ 95 - 0
src/views/business/purchase/components/setup.ts

@@ -0,0 +1,95 @@
+/**
+ * 登记相关
+ *
+ * 采购 - 待点价 - 点价登记
+ * 采购 - 履约交收 - (交收登记, 款项登记, 发票登记, 入库登记)
+ *
+ */
+
+import {
+    ErmcpContractOperateApplyReq,
+    FundsReq,
+    InvoiceReq,
+    SettlementReq,
+    SomePriceReq
+} from "@/services/proto/contract/interface";
+import {operationContractReq} from "@/services/proto/contract";
+import Long from "long";
+import {commonResultInfo, getRequestResultInfo} from "@/common/methods/request";
+import {purchaseStateSign} from "@/views/business/purchase/setup";
+import {hedgePlanReq} from "@/services/proto/hedgeplan";
+import {Ref} from "vue";
+import {objectToUint8Array} from "@/utils/objHandle";
+
+/**
+ * 这里负责 点价登记, 交收登记, 款项登记, 发票登记, 入库登记
+ */
+
+/**
+ * 点价登记
+ * @param spotcontractid 合同id
+ * @param req 点价价格以及数量
+ */
+export function somePriceReq(spotcontractid: string, req: SomePriceReq, loading: Ref<boolean>): Promise<string> {
+    return operationContractRsp(1,
+        operationContractReqBuilder(req, spotcontractid, 1),
+        loading)
+}
+
+/**
+ * 交收登记
+ */
+export function settlementReq(spotcontractid: string, req: SettlementReq, loading: Ref<boolean>): Promise<string> {
+    return operationContractRsp(2,
+        operationContractReqBuilder(req, spotcontractid, 2),
+        loading)
+}
+
+/**
+ * 款项登记
+ */
+export function fundsReq(spotcontractid: string, req: FundsReq, loading: Ref<boolean>): Promise<string> {
+    return operationContractRsp(3,
+        operationContractReqBuilder(req, spotcontractid, 3),
+        loading)
+}
+
+/**
+ * 发票登记
+ */
+export function invoiceReq(spotcontractid: string, req: InvoiceReq, loading: Ref<boolean>): Promise<string> {
+    return operationContractRsp(4,
+        operationContractReqBuilder(req, spotcontractid, 4),
+        loading)
+}
+
+
+/**
+ * 请求报文组装
+ * @param req 特定的请求包结构
+ * @param id 操作的合同id
+ * @param type 操作类型
+ */
+export function operationContractReqBuilder(req: Object, id: string, type: number): ErmcpContractOperateApplyReq {
+    return {
+        OperateType: 1, // uint32 操作类型-1:登记2:确认3:拒绝4:撤销
+        Info: {
+            OperateApplyType: type, // uint32 操作申请类型-1:点价2:结算3:款项4:发票
+            RelatedID: Long.fromString(id), // uint64 现货合同ID(602+Unix秒时间戳(10位)+xxxxxx)
+            DetailJson: objectToUint8Array(req), // bytes 明细JSON {}
+        },
+    } as ErmcpContractOperateApplyReq
+}
+
+
+/**
+ * 登记返回处理
+ * @param type 登记类型
+ * @param req 请求数据
+ * @param loading
+ */
+export function operationContractRsp(type: number, req: ErmcpContractOperateApplyReq, loading: Ref<boolean>): Promise<string> {
+    const sign = getRequestResultInfo(purchaseStateSign, type)  // 接口请求后的返回提示 这里统一进行管理
+    const result = operationContractReq(req)
+    return commonResultInfo(result, sign, loading)
+}

+ 182 - 175
src/views/business/purchase/components/someprice/index.vue

@@ -1,159 +1,162 @@
 <template>
-  <!-- 点价登记-->
-  <a-modal class="commonModal someprice"
-           :title="selectedRow.contracttype===1? '采购合同-点价登记': '销售合同-点价登记'"
-           v-model:visible="visible"
-           @cancel="cancel"
-           centered
-           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">
-        <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="定价.
+    <!-- 点价登记-->
+    <a-modal class="commonModal someprice"
+             :title="selectedRow.contracttype===1? '采购合同-点价登记': '销售合同-点价登记'"
+             v-model:visible="visible"
+             @cancel="cancel"
+             centered
+             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">
+                <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">{{ getPriceTypeName(selectedRow.pricetype) }}</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item :label="selectedRow.contracttype===1? '采购方': '销售方'">
-              <span class="white">{{ formatValue(selectedRow.accountname) }}</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="现货品种">
-              <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</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.qty + selectedRow.enumdicname) }}</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="合同暂定价">
-              <span class="white">{{ formatValue(selectedRow.price) }}</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.goodsname) }}</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-      </a-form>
-    </fieldset>
-    <fieldset class="formFieldSet">
-      <legend>已登记信息</legend>
-      <a-form class="inlineForm">
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="已定价量">
-              <span class="white">{{ selectedRow.pricedqty + selectedRow.enumdicname }}</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="已点均价">
-              <span class="white">{{ formatValue(selectedRow.pricedavg) }}</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-      </a-form>
-    </fieldset>
-    <fieldset class="formFieldSet">
-      <legend>本次点价信息</legend>
-      <a-form class="inlineForm"
-              ref="formRef"
-              :model="formState"
-              :rules="formStateRules">
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="点价价格"
-                         name="PricedPrice">
-              <a-input-number class="dialogInput"
-                              style="width: 200px"
-                              v-model:value="formState.PricedPrice"
-                              :min="0"
-                              placeholder="请输入点价价格" />
-            </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>
+                            <span class="white">{{ getPriceTypeName(selectedRow.pricetype) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item :label="selectedRow.contracttype===1? '采购方': '销售方'">
+                            <span class="white">{{ formatValue(selectedRow.accountname) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="现货品种">
+                            <span class="white">{{ formatValue(selectedRow.deliverygoodsname) }}</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.qty + selectedRow.enumdicname) }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="合同暂定价">
+                            <span class="white">{{ formatValue(selectedRow.price) }}</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.goodsname) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+            </a-form>
+        </fieldset>
+        <fieldset class="formFieldSet">
+            <legend>已登记信息</legend>
+            <a-form class="inlineForm">
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="已定价量">
+                            <span class="white">{{ selectedRow.pricedqty + selectedRow.enumdicname }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="已点均价">
+                            <span class="white">{{ formatValue(selectedRow.pricedavg) }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+            </a-form>
+        </fieldset>
+        <fieldset class="formFieldSet">
+            <legend>本次点价信息</legend>
+            <a-form class="inlineForm"
+                    ref="formRef"
+                    :model="formState"
+                    :rules="formStateRules">
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="点价价格"
+                                     name="PricedPrice">
+                            <a-input-number class="dialogInput"
+                                            style="width: 200px"
+                                            v-model:value="formState.PricedPrice"
+                                            :min="0"
+                                            placeholder="请输入点价价格"/>
+                        </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">{{ Number(selectedRow.pricemove) + Number(formState.PricedPrice) }}</span>
-            </a-form-item>
-          </a-col>
-          <a-col :span="12">
-            <a-form-item label="点价数量"
-                         class="relative"
-                         name="PricedQty">
-              <a-input-number class="dialogInput"
-                              style="width: 200px"
-                              v-model:value="formState.PricedQty"
-                              :min="0"
-                              :max="selectedRow.unpricedqty"
-                              placeholder="请输入点价数量" />
-              <div class="tip">
-                <span>未定价量<span class="white">{{selectedRow.unpricedqty}}{{selectedRow.enumdicname}}</span> </span>
-                <a class="blue ml10"
-                   @click="formState.PricedQty = selectedRow.unpricedqty"> 全部登记</a>
-              </div>
-            </a-form-item>
-          </a-col>
-        </a-row>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="商品价格">
+                            <span class="white">{{
+                                    Number(selectedRow.pricemove) + Number(formState.PricedPrice)
+                                }}</span>
+                        </a-form-item>
+                    </a-col>
+                    <a-col :span="12">
+                        <a-form-item label="点价数量"
+                                     class="relative"
+                                     name="PricedQty">
+                            <a-input-number class="dialogInput"
+                                            style="width: 200px"
+                                            v-model:value="formState.PricedQty"
+                                            :min="0"
+                                            :max="selectedRow.unpricedqty"
+                                            placeholder="请输入点价数量"/>
+                            <div class="tip">
+                                <span>未定价量<span
+                                    class="white">{{ selectedRow.unpricedqty }}{{ selectedRow.enumdicname }}</span> </span>
+                                <a class="blue ml10"
+                                   @click="formState.PricedQty = selectedRow.unpricedqty"> 全部登记</a>
+                            </div>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
 
-        <a-row :gutter="24">
-          <a-col :span="12">
-            <a-form-item label="点价金额">
-              <span class="white">{{( Number(selectedRow.pricemove) + Number(formState.PricedPrice)) * formState.PricedQty }}</span>
-            </a-form-item>
-          </a-col>
-        </a-row>
-      </a-form>
-    </fieldset>
-  </a-modal>
+                <a-row :gutter="24">
+                    <a-col :span="12">
+                        <a-form-item label="点价金额">
+                            <span class="white">{{
+                                    (Number(selectedRow.pricemove) + Number(formState.PricedPrice)) * formState.PricedQty
+                                }}</span>
+                        </a-form-item>
+                    </a-col>
+                </a-row>
+            </a-form>
+        </fieldset>
+    </a-modal>
 </template>
 
 <script lang="ts">
-import { defineComponent, PropType, reactive, ref, unref } from 'vue';
-import { closeModal } from '@/common/setup/modal/index';
-import { formatValue } from '@/common/methods';
-import { Ermcp3SellBuyContract } from '@/services/go/ermcp/purchase/interface';
-import { getPriceTypeName } from '@/views/business/purchase/setup';
-import { operationContractReq } from '@/services/proto/contract';
-import { message } from 'ant-design-vue';
-import Long from 'long';
-import { objectToUint8Array } from '@/utils/objHandle';
+import {defineComponent, PropType, reactive, ref, unref} from 'vue';
+import {closeModal} from '@/common/setup/modal/index';
+import {formatValue} from '@/common/methods';
+import {Ermcp3SellBuyContract} from '@/services/go/ermcp/purchase/interface';
+import {getPriceTypeName} from '@/views/business/purchase/setup';
+import {SomePriceReq} from "@/services/proto/contract/interface";
+import {somePriceReq} from "@/views/business/purchase/components/setup";
 
 export default defineComponent({
     name: 'purchase_pending_someprice',
@@ -164,11 +167,12 @@ export default defineComponent({
             default: {},
         },
     },
-    setup(props) {
-        const { visible, cancel } = closeModal('purchase_pending_someprice');
+    setup(props, context) {
+        const {visible, cancel} = closeModal('purchase_pending_someprice');
         const loading = ref<boolean>(false);
         const formRef = ref();
-        const formState = reactive({ PricedPrice: 0, PricedQty: 0 });
+        const formState = reactive({PricedPrice: 0, PricedQty: 0});
+
         const numberIstrue = (rule: any, value: any) => {
             if (!value) {
                 return Promise.reject(new Error('请输入正确的值'));
@@ -177,32 +181,33 @@ export default defineComponent({
             }
         };
         const formStateRules = {
-            PricedPrice: [{ required: true, validator: numberIstrue, trigger: 'blur', type: 'number' }],
-            PricedQty: [{ required: true, validator: numberIstrue, trigger: 'blur', type: 'number' }],
+            PricedPrice: [{required: true, validator: numberIstrue, trigger: 'blur', type: 'number'}],
+            PricedQty: [{required: true, validator: numberIstrue, trigger: 'blur', type: 'number'}],
         };
+
         function submit() {
             const wrapEl = unref(formRef);
             wrapEl.validate().then(() => {
-                loading.value = true;
-                operationContractReq({
-                    OperateType: 1, // uint32 操作类型-1:登记2:确认3:拒绝4:撤销
-                    Info: {
-                        OperateApplyType: 1, // uint32 操作申请类型-1:点价2:结算3:款项4:发票
-                        RelatedID: Long.fromString(props.selectedRow.spotcontractid), // uint64 现货合同ID(602+Unix秒时间戳(10位)+xxxxxx)
-                        DetailJson: objectToUint8Array(formState), // bytes 明细JSON {}
-                    },
-                })
-                    .then(() => {
-                        message.success('登记成功!');
-                        loading.value = false;
-                        cancel();
-                    })
-                    .catch((err) => {
-                        message.error(err);
-                        loading.value = false;
-                        cancel();
-                    });
-            });
+                    loading.value = true;
+
+                    const params: SomePriceReq = {
+                        PricedPrice: Number(formState.PricedPrice),
+                        PricedQty:  Number(formState.PricedQty)
+                    }
+                    // 发出点价请求
+                    somePriceReq(
+                        props.selectedRow.spotcontractid,
+                        params, loading)
+                        .then(res => {
+                            cancel()
+                            context.emit('refresh')
+                        })
+                        .catch(err => {
+
+                        })
+                }
+
+            );
         }
 
         return {
@@ -217,7 +222,8 @@ export default defineComponent({
             getPriceTypeName,
         };
     },
-});
+})
+;
 </script>
 
 <style lang="less">
@@ -227,6 +233,7 @@ export default defineComponent({
             padding: 24px;
         }
     }
+
     legend {
         width: auto;
         margin-left: 20px;

+ 6 - 6
src/views/business/purchase/list/all/index.vue

@@ -20,17 +20,17 @@
       </a-table>
     </contextMenu>
     <!-- 详情 -->
-    <Detail :selectedRow="selectedRow" />
+    <Detail  :selectedRow="selectedRow" @refresh="queryTable"/>
     <!-- 采购点价登记 -->
-    <SomePrice :selectedRow="selectedRow" />
+    <SomePrice :selectedRow="selectedRow" @refresh="queryTable"/>
     <!-- 交收登记 -->
-    <Settlement :selectedRow="selectedRow" />
+    <Settlement  :selectedRow="selectedRow" @refresh="queryTable"/>
     <!-- 款项登记 -->
-    <Funds :selectedRow="selectedRow" />
+    <Funds  :selectedRow="selectedRow" @refresh="queryTable"/>
     <!-- 发票登记 -->
-    <Invoice :selectedRow="selectedRow" />
+    <Invoice  :selectedRow="selectedRow" @refresh="queryTable"/>
     <!-- 入库登记 -->
-    <Storage :selectedRow="selectedRow" />
+    <Storage  :selectedRow="selectedRow" @refresh="queryTable"/>
   </div>
 </template>
 

+ 2 - 2
src/views/business/purchase/list/pending/index.vue

@@ -20,9 +20,9 @@
       </a-table>
     </contextMenu>
     <!-- 详情 -->
-    <Detail :selectedRow="selectedRow" />
+    <Detail :selectedRow="selectedRow" @refresh="queryTable"/>
     <!-- 采购点价登记 -->
-    <SomePrice :selectedRow="selectedRow" />
+    <SomePrice :selectedRow="selectedRow" @refresh="queryTable"/>
   </div>
 </template>
 

+ 5 - 5
src/views/business/purchase/list/performance/index.vue

@@ -20,15 +20,15 @@
       </a-table>
     </contextMenu>
     <!-- 详情 -->
-    <Detail />
+    <Detail :selectedRow="selectedRow" @refresh="queryTable"/>
     <!-- 交收登记 -->
-    <Settlement />
+    <Settlement  :selectedRow="selectedRow" @refresh="queryTable"/>
     <!-- 款项登记 -->
-    <Funds />
+    <Funds :selectedRow="selectedRow" @refresh="queryTable"/>
     <!-- 发票登记 -->
-    <Invoice />
+    <Invoice  :selectedRow="selectedRow" @refresh="queryTable"/>
     <!-- 入库登记 -->
-    <Storage />
+    <Storage  :selectedRow="selectedRow" @refresh="queryTable"/>
   </div>
 </template>
 

+ 13 - 0
src/views/business/purchase/setup.ts

@@ -1,3 +1,5 @@
+import {ResultInfo} from "@/common/methods/request";
+
 /**
  * 定价类型 - 1:一口价 2:点价 3:暂定价
  * @param pricetype 定价类型
@@ -17,3 +19,14 @@ export function getPriceTypeName(pricetype: number): string {
     }
     return result
 }
+
+/************** 接口相关提示 **************** /
+ *
+ */
+// 登记操作 点价登记, 交收登记, 款项登记, 发票登记
+export const purchaseStateSign = new Map<number, ResultInfo>([
+    [1, ['点价登记成功', '点价登记失败:']],
+    [2, ['交收登记成功', '交收登记失败:']],
+    [3, ['款项登记成功', '款项登记失败:']],
+    [4, ['发票登记成功', '发票登记失败:']],
+])

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

@@ -181,12 +181,11 @@ import { formatTime, formatValue } from '@/common/methods';
 import { getBizTypeName, getContractStatusName, getContractTypeName, getPriceTypeName } from '@/views/information/spot-contract/setup';
 import { Ermcp3ContractRsp } from '@/services/go/ermcp/spot-contract/interface';
 import { orderContractOperateControl } from '@/views/information/spot-contract/components/setup';
-import { message, Modal } from 'ant-design-vue';
+import { Modal } from 'ant-design-vue';
 import { SpotContractOperateReq } from '@/services/proto/spotcontract/interface';
-import Long from 'long';
 
 export default defineComponent({
-    name: 'spot-contract-detail',
+    name: 'spot-contract-finish',
     components: {},
     props: {
         selectedRow: {
@@ -199,6 +198,7 @@ export default defineComponent({
         const maskClosableFlag = ref<boolean>(false);
         const loading = ref<boolean>(false);
         function submit() {
+            context.emit('refresh');
             Modal.confirm({
                 title: '是否确认完结',
                 okText: '确认完结',

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

@@ -38,7 +38,7 @@
       </a-table>
     </contextMenu>
     <!-- 新增现货合同 -->
-    <AddSpotContract />
+    <AddSpotContract @refresh="queryTable" />
     <!-- 现货合同: 详情 -->
     <SpotContractDeatil :selectedRow="selectedRow"
                         @refresh="queryTable" />

+ 1 - 0
src/views/information/spot-contract/list/performance/index.vue

@@ -99,6 +99,7 @@ export default defineComponent({
             getPriceTypeName,
             getContractStatusName,
             getContractTypeName,
+            queryTable,
         };
     },
 });

+ 56 - 75
src/views/information/spot-contract/list/unsubmitted/index.vue

@@ -1,84 +1,65 @@
 <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 hiddenFirstCol"
-                     :pagination="false"
-                     :expandedRowKeys="expandedRowKeys"
-                     :customRow="Rowclick"
-                     rowKey="key"
-                     :data-source="tableList">
-                <!-- 额外的展开行 -->
-                <template #expandedRowRender="{  }">
-                    <BtnList :btnList="forDataBtn"/>
-                </template>
-                <!-- <template #userinfotype="{ text }">
+  <!-- 现货合同: 未提交-->
+  <div class="spot-contract-not-commit"
+       :loading="loading">
+    <filterCustomTable @search="search">
+      <BtnList :btnList="commonBtn" />
+    </filterCustomTable>
+    <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 #userinfotype="{ text }">
                   <a>{{ text === '2' ? '企业' : '个人'}}</a>
                 </template> -->
-                <template #biztype="{ text }">
-                    <a>{{ getBizTypeName(text) }}</a>
-                </template>
+        <template #biztype="{ text }">
+          <a>{{ getBizTypeName(text) }}</a>
+        </template>
 
-                <template #pricetype="{ text }">
-                    <a>{{ getPriceTypeName(text) }}</a>
-                </template>
+        <template #pricetype="{ text }">
+          <a>{{ getPriceTypeName(text) }}</a>
+        </template>
 
-                <template #contracctstatus="{ text }">
-                    <a>{{ getContractStatusName(text) }}</a>
-                </template>
+        <template #contracctstatus="{ text }">
+          <a>{{ getContractStatusName(text) }}</a>
+        </template>
 
-                <template #contracttype="{ text }">
-                    <a>{{ getContractTypeName(text) }}</a>
-                </template>
-            </a-table>
-        </contextMenu>
-        <!-- 新增现货合同 -->
-        <AddSpotContract  @refresh="queryTable"/>
-        <!-- 现货合同: 详情 -->
-        <SpotContractDeatil :selectedRow="selectedRow"
-                            @refresh="queryTable"/>
-        <!-- 现货合同: 修改 -->
-        <ModifySpotContract :selectedRow="selectedRow"
-                            @refresh="queryTable"/>
-        <!-- 现货合同: 删除 -->
-        <DeleteSpotContract :selectedRow="selectedRow"
-                            @refresh="queryTable"/>
-        <!-- 现货合同: 重新提交 -->
-        <ResubmitSpotContract/>
-    </div>
+        <template #contracttype="{ text }">
+          <a>{{ getContractTypeName(text) }}</a>
+        </template>
+      </a-table>
+    </contextMenu>
+    <!-- 新增现货合同 -->
+    <AddSpotContract @refresh="queryTable" />
+    <!-- 现货合同: 详情 -->
+    <SpotContractDeatil :selectedRow="selectedRow"
+                        @refresh="queryTable" />
+    <!-- 现货合同: 修改 -->
+    <ModifySpotContract :selectedRow="selectedRow"
+                        @refresh="queryTable" />
+    <!-- 现货合同: 删除 -->
+    <DeleteSpotContract :selectedRow="selectedRow"
+                        @refresh="queryTable" />
+    <!-- 现货合同: 重新提交 -->
+    <ResubmitSpotContract :selectedRow="selectedRow"
+                          @refresh="queryTable" />
+  </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 {
-    getBizTypeName,
-    getContractStatusName,
-    getContractTypeName,
-    getPriceTypeName
-} from "@/views/information/spot-contract/setup";
+import { queryTableList, getFilterTableCB, Ermcp3ContractRsp } from '../index';
+import { getBizTypeName, getContractStatusName, getContractTypeName, getPriceTypeName } from '@/views/information/spot-contract/setup';
 
 export default defineComponent({
     name: 'spot-contract-not-commit',
@@ -94,13 +75,13 @@ 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) {

+ 1 - 1
src/views/manage/business-review/components/somepriceDetail/index.vue

@@ -62,7 +62,7 @@
                 <a-row :gutter="24">
                     <a-col :span="12">
                         <a-form-item label="升贴水">
-                            <span class="white">{{ formatValue(selectedRow.sellusername) }}</span>
+                            <span class="white">{{ formatValue(selectedRow.pricemove) }}</span>
                         </a-form-item>
                     </a-col>
                     <a-col :span="12">