huangbin 4 lat temu
rodzic
commit
5fe12b1509

+ 0 - 4
src/views/order/commodity_contract/components/commodity_contract_settlement/index.vue

@@ -65,10 +65,6 @@ export default defineComponent({
             tableName: 'table_pcweb_spot_trade_bottom_commodity_contract_settlement',
             recordList: getRecordItemTab(),
         };
-        // 资金变化,重新加载数据
-        Bus.$on('moneyChangedNtf_UI', () => {
-            queryTableAction();
-        });
         return {
             ...handleComposeOrderTable<WrDeliveryDetail>(param),
             loading,

+ 107 - 0
src/views/order/commodity_contract/components/commodity_contract_summary/components/commodity_contract_summary_settlement/index.vue

@@ -0,0 +1,107 @@
+<template>
+  <!-- 交收-->
+  <Drawer :title="'交收'"
+          :placement="'bottom'"
+          :visible="visible"
+          @cancel="cancel">
+    <div class="listed">
+      <div class="formBar">
+        <a-form class="inlineForm dialogForm"
+                ref="formRef"
+                :model="formState"
+                :rules="rules">
+          <a-row :gutter="24">
+            <a-col :span="24">
+              <a-form-item label="交收数量"
+                           name="num">
+                <a-input-number class="commonInput"
+                                v-model:value="formState.num"
+                                style="width: 100%" />
+                <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
+              </a-form-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="24"
+                 type="flex"
+                 justify="center">
+            <a-col :span="24">
+              <a-form-item class="tc">
+                <a-button class="listedBtn"
+                          :loading="loading"
+                          :disabled="loading"
+                          @click="submit">提交</a-button>
+              </a-form-item>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+    </div>
+  </Drawer>
+</template>
+
+<script lang="ts">
+import { defineComponent, PropType, ref } from 'vue';
+import Drawer from '@/common/components/drawer/index.vue';
+import { WrPerformancePlan, WrPosition } from '@/services/go/wrtrade/interface';
+import { ModalEnum } from '@/common/constants/modalNameEnum';
+import { _closeModal } from '@/common/setup/modal/modal';
+import { handleForm } from './setup';
+import { validateAction } from '@/common/setup/form';
+import { FormState } from './interface';
+import UploadImg from '@/common/components/uploadImg/index.vue';
+import { getUploadImg } from '@/common/setup/upload';
+import { PerformanceContractedApplyReq, PerformanceDelayApplyReq } from '@/services/proto/performance/interface';
+import { getSelectedAccount, getSelectedAccountId, getUserId } from '@/services/bus/account';
+import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
+import { performanceContractedApply, performanceDelayApply } from '@/services/proto/performance';
+import { BuyOrSell } from '@/common/constants/enumCommon';
+import Long from 'long';
+
+export default defineComponent({
+    name: ModalEnum.commodity_contract_summary_settlement,
+    components: { Drawer, UploadImg },
+    emits: ['cancel', 'update'],
+    props: {
+        selectedRow: {
+            type: Object as PropType<WrPerformancePlan>,
+            default: {},
+        },
+        buyOrSell: {
+            type: Number as PropType<BuyOrSell>,
+            default: BuyOrSell.buy,
+        },
+    },
+    setup(props, context) {
+        const { visible, cancel } = _closeModal(context);
+        const loading = ref<boolean>(false);
+        const { rules, formState, formRef } = handleForm();
+        function submit() {
+            // validateAction<FormState>(formRef, formState).then((param) => {
+            //     // 违约申请
+            //     const paramReq: PerformanceContractedApplyReq = {
+            //         PerformancePlanID: Long.fromString(props.selectedRow.performanceplanid), // uint64 履约计划ID
+            //         BreachType: props.selectedRow.buyaccountid === getSelectedAccountId() ? 2 : 1, // uint32 违约方类型 买履约是2 卖履约是1 (刘工说是黄工说的 )
+            //         Applicant: getUserId(), // uint64 违约申请人
+            //         ApplyRemark: param.remark, // string 申请备注
+            //         Attachment: '', // string 附件
+            //     };
+            //     requestResultLoadingAndInfo(performanceContractedApply, paramReq, loading, ['申请违约成功', '申请违约失败:']).then(() => {
+            //         cancel(true);
+            //     });
+            // });
+        }
+        return {
+            visible,
+            cancel,
+            submit,
+            loading,
+            rules,
+            formState,
+            formRef,
+        };
+    },
+});
+</script>
+
+<style lang="less" scoped>
+</style>;

+ 4 - 0
src/views/order/commodity_contract/components/commodity_contract_summary/components/commodity_contract_summary_settlement/interface.ts

@@ -0,0 +1,4 @@
+export interface FormState {
+    // price: number,
+    num: number,
+}

+ 15 - 0
src/views/order/commodity_contract/components/commodity_contract_summary/components/commodity_contract_summary_settlement/setup.ts

@@ -0,0 +1,15 @@
+import { reactive, ref, UnwrapRef } from "vue";
+import { FormState } from "./interface";
+
+export function handleForm() {
+    const formRef = ref();
+    const formState: UnwrapRef<FormState> = reactive({
+        // price: 0,
+        num: 0
+    })
+    const rules = {
+        // price: [{ require, message: '请输入挂牌价', trigger: 'blur', }],
+        num: [{ require, message: '请输入交收数量', trigger: 'blur', type: 'number' }],
+    }
+    return { rules, formState, formRef }
+}

+ 115 - 0
src/views/order/commodity_contract/components/commodity_contract_summary/components/commodity_contract_summary_transfer/index.vue

@@ -0,0 +1,115 @@
+<template>
+  <!-- 转让-->
+  <Drawer :title="'转让'"
+          :placement="'bottom'"
+          :visible="visible"
+          @cancel="cancel">
+    <div class="listed">
+      <div class="formBar">
+        <a-form class="inlineForm dialogForm"
+                ref="formRef"
+                :model="formState"
+                :rules="rules">
+          <a-row :gutter="24">
+            <a-col :span="24">
+              <a-form-item label="挂牌价"
+                           name="price">
+                <a-input-number class="commonInput"
+                                v-model:value="formState.price"
+                                style="width: 100%" />
+              </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="挂牌数量"
+                           name="num">
+                <a-input-number class="commonInput"
+                                v-model:value="formState.num"
+                                style="width: 100%" />
+                <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
+              </a-form-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="24"
+                 type="flex"
+                 justify="center">
+            <a-col :span="24">
+              <a-form-item class="tc">
+                <a-button class="listedBtn"
+                          :loading="loading"
+                          :disabled="loading"
+                          @click="submit">提交</a-button>
+              </a-form-item>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+    </div>
+  </Drawer>
+</template>
+
+<script lang="ts">
+import { defineComponent, PropType, ref } from 'vue';
+import Drawer from '@/common/components/drawer/index.vue';
+import { WrPerformancePlan, WrPosition } from '@/services/go/wrtrade/interface';
+import { ModalEnum } from '@/common/constants/modalNameEnum';
+import { _closeModal } from '@/common/setup/modal/modal';
+import { handleForm } from './setup';
+import { validateAction } from '@/common/setup/form';
+import { FormState } from './interface';
+import UploadImg from '@/common/components/uploadImg/index.vue';
+import { getUploadImg } from '@/common/setup/upload';
+import { PerformanceContractedApplyReq, PerformanceDelayApplyReq } from '@/services/proto/performance/interface';
+import { getSelectedAccount, getSelectedAccountId, getUserId } from '@/services/bus/account';
+import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
+import { performanceContractedApply, performanceDelayApply } from '@/services/proto/performance';
+import { BuyOrSell } from '@/common/constants/enumCommon';
+import Long from 'long';
+
+export default defineComponent({
+    name: ModalEnum.commodity_contract_summary_transfer,
+    components: { Drawer, UploadImg },
+    emits: ['cancel', 'update'],
+    props: {
+        selectedRow: {
+            type: Object as PropType<WrPerformancePlan>,
+            default: {},
+        },
+        buyOrSell: {
+            type: Number as PropType<BuyOrSell>,
+            default: BuyOrSell.buy,
+        },
+    },
+    setup(props, context) {
+        const { visible, cancel } = _closeModal(context);
+        const loading = ref<boolean>(false);
+        const { rules, formState, formRef } = handleForm();
+        function submit() {
+            // validateAction<FormState>(formRef, formState).then((param) => {
+            //     // 违约申请
+            //     const paramReq: PerformanceContractedApplyReq = {
+            //         PerformancePlanID: Long.fromString(props.selectedRow.performanceplanid), // uint64 履约计划ID
+            //         BreachType: props.selectedRow.buyaccountid === getSelectedAccountId() ? 2 : 1, // uint32 违约方类型 买履约是2 卖履约是1 (刘工说是黄工说的 )
+            //         Applicant: getUserId(), // uint64 违约申请人
+            //         ApplyRemark: param.remark, // string 申请备注
+            //         Attachment: '', // string 附件
+            //     };
+            //     requestResultLoadingAndInfo(performanceContractedApply, paramReq, loading, ['申请违约成功', '申请违约失败:']).then(() => {
+            //         cancel(true);
+            //     });
+            // });
+        }
+        return {
+            visible,
+            cancel,
+            submit,
+            loading,
+            rules,
+            formState,
+            formRef,
+        };
+    },
+});
+</script>
+
+<style lang="less" scoped>
+</style>;

+ 4 - 0
src/views/order/commodity_contract/components/commodity_contract_summary/components/commodity_contract_summary_transfer/interface.ts

@@ -0,0 +1,4 @@
+export interface FormState {
+    price: number,
+    num: number,
+}

+ 15 - 0
src/views/order/commodity_contract/components/commodity_contract_summary/components/commodity_contract_summary_transfer/setup.ts

@@ -0,0 +1,15 @@
+import { reactive, ref, UnwrapRef } from "vue";
+import { FormState } from "./interface";
+
+export function handleForm() {
+    const formRef = ref();
+    const formState: UnwrapRef<FormState> = reactive({
+        price: 0,
+        num: 0,
+    })
+    const rules = {
+        price: [{ require, message: '请输入挂牌价', trigger: 'blur', type: 'number' }],
+        num: [{ require, message: '请输入挂牌数量', trigger: 'blur', type: 'number' }],
+    }
+    return { rules, formState, formRef }
+}

+ 3 - 1
src/views/order/commodity_contract/components/commodity_contract_summary/index.vue

@@ -33,7 +33,7 @@
 
 <script lang="ts">
 import { enumOrderComponents } from '@/common/constants/enumOrderComponents';
-import { queryTableList, BtnList, defineAsyncComponent, defineComponent } from '@/common/export/commonTable';
+import { queryTableList, BtnList, defineAsyncComponent, defineComponent, ModalEnum } from '@/common/export/commonTable';
 import { getRecordItemTab } from '@/common/setup/order/orderData';
 import { handleComposeOrderTable } from '@/common/setup/table/compose';
 import { ComposeOrderTableParam } from '@/common/setup/table/interface';
@@ -47,6 +47,8 @@ export default defineComponent({
     name: enumOrderComponents.commodity_contract_summary,
     components: {
         BtnList,
+        [ModalEnum.commodity_contract_summary_settlement]: defineAsyncComponent(() => import('./components/commodity_contract_summary_settlement/index.vue')),
+        [ModalEnum.commodity_contract_summary_transfer]: defineAsyncComponent(() => import('./components/commodity_contract_summary_transfer/index.vue')),
     },
     setup() {
         // 表格列表数据