huangbin hace 4 años
padre
commit
1844058432

+ 146 - 135
src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/components/delisting/index.vue

@@ -1,141 +1,152 @@
 <template>
-    <!-- 挂牌求购 -->
-    <Drawer
-        :title="isBuy() ? '摘牌买入' : '摘牌卖出' "
-        :placement="'right'"
-        :visible="visible"
-        @cancel="cancel"
-        class="top"
-    >
-        <div class="post_buying">
-            <a-form class="inlineForm dialogForm" ref="formRef" :model="formState" :rules="rules">
-                <div class="formBar">
-                    <a-row :gutter="24">
-                        <a-col :span="24">
-                            <a-form-item label="交易账户" name="accountid">
-                                <a-select
-                                    class="inlineFormSelect"
-                                    style="width: 260px"
-                                    v-model:value="formState.accountid"
-                                    placeholder="请选择"
-                                >
-                                    <a-select-option
-                                        v-for="item in accountList"
-                                        :value="item.accountid"
-                                        :key="item.accountid"
-                                    >{{item.accountid}}</a-select-option>
-                                </a-select>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24">
-                            <a-form-item label="挂牌方">
-                                <span class="white">{{selectedRow.username}}</span>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24" v-if="!isFloat()">
-                            <a-form-item label="价格类型">
-                                <span class="white">固定价</span>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24" v-if="isFloat()">
-                            <a-form-item label="挂牌估算价">
-                                <span class="white">3444</span>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24" v-if="isFloat()">
-                            <a-form-item label="卖出价格" name="priceType">
-                                <a-radio-group
-                                    class="commonRadioGroup"
-                                    v-model:value="formState.priceType"
-                                >
-                                    <a-radio :value="1">市价</a-radio>
-                                    <a-radio :value="2">限价</a-radio>
-                                </a-radio-group>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24" v-if="isFloat() && isLimit()">
-                            <a-form-item label="摘牌价格" name="price" class="inputIconBox">
-                                <a-input-number
-                                    class="commonInput"
-                                    style="width: 260px"
-                                    :min="0"
-                                    v-model:value="formState.price"
-                                />
-                                <MinusOutlined @click="decreasePrice" />
-                                <PlusOutlined @click="increasePrice" />
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24">
-                            <a-form-item label="挂牌数量">
-                                <span class="white">{{selectedRow.orderqty}}</span>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24" v-if="!useUserType()">
-                            <a-form-item label="摘牌数量">
-                                <span class="white">{{formState.num}}</span>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24" v-if="useUserType()">
-                            <a-form-item label="摘牌数量" name="num" class="inputIconBox">
-                                <a-input-number
-                                    class="commonInput"
-                                    style="width: 260px"
-                                    :min="0"
-                                    :max="99"
-                                    v-model:value="formState.num"
-                                />
-                                <MinusOutlined @click="decreasePrice" />
-                                <PlusOutlined @click="increasePrice" />
-                                <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24" v-if="useUserType()" class="mt-10">
-                            <a-form-item>
-                                <a-slider
-                                    :min="0"
-                                    v-model:value="formState.num"
-                                    :max="selectedRow.orderqty"
-                                    class="formSlider"
-                                />
-                                <div class="unit">
-                                    <span>0</span>
-                                    <span>{{selectedRow.orderqty}}{{selectedRow.enumdicname}}</span>
-                                </div>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24" class="relative mt20" v-if="!isFloat()">
-                            <a-form-item :label="'摘牌金额'">
-                                <span class="white ml8">{{getMoney()}}</span>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24" class="relative mt20" v-if="isFloat()">
-                            <a-form-item :label="'估算金额'">
-                                <span class="white ml8">{{getMoney()}}</span>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24" v-if="getMargin()">
-                            <a-form-item :label="'履约保证金'">
-                                <span class="white ml8">{{getMargin()}}</span>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24">
-                            <a-form-item label="可用资金">
-                                <span class="white ml8">{{canUseMoney()}}</span>
-                            </a-form-item>
-                        </a-col>
-                    </a-row>
+  <!-- 挂牌求购 -->
+  <Drawer :title="!isBuy() ? '摘牌买入' : '摘牌卖出' "
+          :placement="'right'"
+          :visible="visible"
+          @cancel="cancel"
+          class="top">
+    <div class="post_buying">
+      <a-form class="inlineForm dialogForm"
+              ref="formRef"
+              :model="formState"
+              :rules="rules">
+        <div class="formBar">
+          <a-row :gutter="24">
+            <a-col :span="24">
+              <a-form-item label="交易账户"
+                           name="accountid">
+                <a-select class="inlineFormSelect"
+                          style="width: 260px"
+                          v-model:value="formState.accountid"
+                          placeholder="请选择">
+                  <a-select-option v-for="item in accountList"
+                                   :value="item.accountid"
+                                   :key="item.accountid">{{item.accountid}}</a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="挂牌方">
+                <span class="white">{{selectedRow.username}}</span>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24"
+                   v-if="!isFloat()">
+              <a-form-item label="价格类型">
+                <span class="white">固定价</span>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24"
+                   v-if="isFloat()">
+              <a-form-item label="挂牌估算价">
+                <span class="white">3444</span>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24"
+                   v-if="isFloat()">
+              <a-form-item label="卖出价格"
+                           name="priceType">
+                <a-radio-group class="commonRadioGroup"
+                               v-model:value="formState.priceType">
+                  <a-radio :value="1">市价</a-radio>
+                  <a-radio :value="2">限价</a-radio>
+                </a-radio-group>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24"
+                   v-if="isFloat() && isLimit()">
+              <a-form-item label="摘牌价格"
+                           name="price"
+                           class="inputIconBox">
+                <a-input-number class="commonInput"
+                                style="width: 260px"
+                                :min="0"
+                                v-model:value="formState.price" />
+                <MinusOutlined @click="decreasePrice" />
+                <PlusOutlined @click="increasePrice" />
+              </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="挂牌数量">
+                <span class="white">{{selectedRow.orderqty}}</span>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24"
+                   v-if="!useUserType()">
+              <a-form-item label="摘牌数量">
+                <span class="white">{{formState.num}}</span>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24"
+                   v-if="useUserType()">
+              <a-form-item label="摘牌数量"
+                           name="num"
+                           class="inputIconBox">
+                <a-input-number class="commonInput"
+                                style="width: 260px"
+                                :min="0"
+                                :max="99"
+                                v-model:value="formState.num" />
+                <MinusOutlined @click="decreasePrice" />
+                <PlusOutlined @click="increasePrice" />
+                <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24"
+                   v-if="useUserType()"
+                   class="mt-10">
+              <a-form-item>
+                <a-slider :min="0"
+                          v-model:value="formState.num"
+                          :max="selectedRow.orderqty"
+                          class="formSlider" />
+                <div class="unit">
+                  <span>0</span>
+                  <span>{{selectedRow.orderqty}}{{selectedRow.enumdicname}}</span>
                 </div>
-                <a-row :gutter="24">
-                    <a-col :span="24" class="fixedBtns">
-                        <a-form-item class="btnCenter">
-                            <a-button class="listedBtn" @click="submit">{{isBuy() ? '买入' : '卖出'}}</a-button>
-                            <a-button class="ml10 cancelBtn" @click="cancel">取消</a-button>
-                        </a-form-item>
-                    </a-col>
-                </a-row>
-            </a-form>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24"
+                   class="relative mt20"
+                   v-if="!isFloat()">
+              <a-form-item :label="'摘牌金额'">
+                <span class="white ml8">{{getMoney()}}</span>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24"
+                   class="relative mt20"
+                   v-if="isFloat()">
+              <a-form-item :label="'估算金额'">
+                <span class="white ml8">{{getMoney()}}</span>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24"
+                   v-if="getMargin()">
+              <a-form-item :label="'履约保证金'">
+                <span class="white ml8">{{getMargin()}}</span>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24">
+              <a-form-item label="可用资金">
+                <span class="white ml8">{{canUseMoney()}}</span>
+              </a-form-item>
+            </a-col>
+          </a-row>
         </div>
-    </Drawer>
+        <a-row :gutter="24">
+          <a-col :span="24"
+                 class="fixedBtns">
+            <a-form-item class="btnCenter">
+              <a-button class="listedBtn"
+                        @click="submit">{{!isBuy() ? '买入' : '卖出'}}</a-button>
+              <a-button class="ml10 cancelBtn"
+                        @click="cancel">取消</a-button>
+            </a-form-item>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+  </Drawer>
 </template>
 
 <script lang="ts">

+ 30 - 24
src/views/order/commodity_contract/components/commodity_contract_bargain/components/commodity_contract_bargain_refuse_order/index.vue

@@ -1,27 +1,32 @@
 <template>
   <!-- 商品合约 议价单 撤单 -->
   <a-modal class="commonModal"
-           title="原因"
+           title="拒绝"
            v-model:visible="visible"
            centered
+           @click="cancel"
            :maskClosable="false">
     <template #footer>
       <a-button key="submit"
+                @click="cancel"
                 class="cancelBtn">取消</a-button>
       <a-button key="submit"
                 type="primary"
-                :loading="loading">提交</a-button>
+                @click="submit">提交</a-button>
     </template>
     <a-form class="inlineForm"
-            ref="formRef">
+            ref="formRef"
+            :model="formState"
+            :rules="rules">
       <a-row :gutter="24">
         <a-col :span="24">
           <a-form-item label="原因"
                        class="relative"
-                       name="Remark">
+                       name="AuditRemark">
             <a-textarea class="dialogInput"
                         style="width: 100%"
                         placeholder="请输入原因"
+                        v-model:value="formState.AuditRemark"
                         readonly
                         :autosize="{ minRows: 8, maxRows: 24 }" />
           </a-form-item>
@@ -34,16 +39,18 @@
 <script lang="ts">
 import Drawer from '@/common/components/drawer/index.vue';
 import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
+import { validateAction } from '@/common/setup/form/validateAction';
 import { _closeModal } from '@/common/setup/modal/modal';
 import { geLoginID_number } from '@/services/bus/login';
 import { QueryTjmdTransferApplyRsp } from '@/services/go/Tjmd/interface';
 import { tradeHoldTransferApplyAuditReq } from '@/services/proto/warehousetrade';
 import { TradeHoldTransferApplyAuditReqType } from '@/services/proto/warehousetrade/interface';
-import { Modal } from 'ant-design-vue';
 import { defineComponent, PropType, ref } from 'vue';
+import { FormState } from './interface';
+import { handleForm } from './setup';
 
 export default defineComponent({
-    name: 'commodity_contract_bargain_cancel_order',
+    name: 'commodity_contract_bargain_refuse_order',
     components: { Drawer },
     emits: ['cancel', 'update'],
     props: {
@@ -55,31 +62,30 @@ export default defineComponent({
     setup(props, context) {
         const { visible, cancel } = _closeModal(context);
         const loading = ref<boolean>(false);
-
+        const { rules, formState, formRef } = handleForm();
         function submit() {
-            const param: TradeHoldTransferApplyAuditReqType = {
-                ApplyID: props.selectedRow.applyid,
-                ApplyStatus: 1, // 1:撤销2:拒绝3:通过
-                AuditSrc: 2,
-                AuditorID: geLoginID_number()!.toString(),
-                AuditRemark: '',
-            };
-            requestResultLoadingAndInfo(tradeHoldTransferApplyAuditReq, param, loading, ['撤单成功', '撤单失败:']).then(() => {
-                // Bus.$emit('spotTrade', true);
-                cancel(true);
+            validateAction<FormState>(formRef, formState).then((res) => {
+                const param: TradeHoldTransferApplyAuditReqType = {
+                    ApplyID: props.selectedRow.applyid,
+                    ApplyStatus: 2, // 1:撤销2:拒绝3:通过
+                    AuditSrc: 2,
+                    AuditorID: geLoginID_number()!.toString(),
+                    AuditRemark: res.AuditRemark,
+                };
+                requestResultLoadingAndInfo(tradeHoldTransferApplyAuditReq, param, loading, ['撤单成功', '撤单失败:']).then(() => {
+                    // Bus.$emit('spotTrade', true);
+                    cancel(true);
+                });
             });
         }
 
-        Modal.confirm({
-            title: '撤单',
-            content: '是否确认撤单!',
-            onOk: submit,
-            onCancel: cancel,
-        });
-
         return {
             visible,
             cancel,
+            submit,
+            rules,
+            formState,
+            formRef,
         };
     },
 });

+ 4 - 0
src/views/order/commodity_contract/components/commodity_contract_bargain/components/commodity_contract_bargain_refuse_order/interface.ts

@@ -0,0 +1,4 @@
+
+export interface FormState {
+    AuditRemark: string,
+}

+ 15 - 0
src/views/order/commodity_contract/components/commodity_contract_bargain/components/commodity_contract_bargain_refuse_order/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({
+        AuditRemark: '',
+    })
+    const rules = {
+        AuditRemark: [
+            { require, message: '请输入拒绝原因', trigger: 'blur', },
+        ],
+    }
+    return { rules, formState, formRef }
+}

+ 2 - 2
src/views/order/commodity_contract/components/commodity_contract_bargain/index.vue

@@ -23,7 +23,7 @@
       <template #applytime="{ text }">
         <span>{{ formatTime(text) }}</span>
       </template>
-      <template #transferamount="{ record }">
+      <template #transferamount="{ record , text}">
         <div>
           <!-- 审核拒绝 -->
           <a-tooltip placement="bottom"
@@ -87,7 +87,7 @@ export default defineComponent({
         BtnList,
         commodity_contract_bargain_submit_order: defineAsyncComponent(() => import('./components/commodity_contract_bargain_submit_order/index.vue')),
         commodity_contract_bargain_cancel_order: defineAsyncComponent(() => import('./components/commodity_contract_bargain_cancel_order/index.vue')),
-        // commodity_contract_summary_deal_closed: defineAsyncComponent(() => import('./components/commodity_contract_summary_deal_closed/index.vue')),
+        commodity_contract_bargain_refuse_order: defineAsyncComponent(() => import('./components/commodity_contract_bargain_refuse_order/index.vue')),
     },
     setup() {
         // 类型 1-我的申请 2-对方申请

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

@@ -20,44 +20,6 @@
               <div class="middle">数量/价格/金额</div>
               <div class="right">到期日/盈亏</div>
             </div>
-            <!-- <a-checkbox-group class="commonCheckboxGroup"
-                              v-model:value="checked"
-                              @change="checkGroupChange">
-              <div class="lineBar"
-                   v-for="(item, index) in tableList"
-                   :key="index + '11'">
-                <div class="line1">
-                  <div class>
-                    <a-checkbox @change="checkboxChange(item)"
-                                :value="item.tradeid"></a-checkbox>
-                  </div>
-                  <div class="name">{{item.username}}</div>
-                </div>
-                <div class="line2">
-                  <div class="left">
-                    <div>{{item.wrtypename}}</div>
-                    <div>{{item.warehousename}}</div>
-                  </div>
-                  <div class="middle">
-                    <div>{{item.pricemove}}</div>
-                    <div>{{toFixed0(item.avalidqty)}}{{item.enumdicname}}</div>
-                  </div>
-                  <div class="right">
-                    <template class="inputNumberBlock"
-                              :class="isChecked(item.ladingbillid) ? '' : 'disabled'">
-                      <a-input-number class="dialogInput dialogInput34"
-                                      v-model:value="item.num"
-                                      style="width: 130px !important; height: 34px;"
-                                      :disabled="!isChecked(item.ladingbillid)"
-                                      :max="toFixed0(item.avalidqty)"
-                                      :min="0"></a-input-number>
-                      <MinusOutlined @click="decrease(item)" />
-                      <PlusOutlined @click="increase(item)" />
-                    </template>
-                  </div>
-                </div>
-              </div>
-                        </a-checkbox-group>-->
             <a-checkbox-group class="commonCheckboxGroup"
                               v-model:value="checked"
                               @change="checkGroupChange">
@@ -70,7 +32,7 @@
                                 :value="item.tradeid"></a-checkbox>
                   </div>
                   <div class="name">{{item.tradeid}}</div>
-                  <div class="date">{{item.tradetime}}</div>
+                  <div class="date">{{formatTime(item.tradetime, 'd')}}</div>
                 </div>
                 <div class="line2">
                   <div class="left">{{item.buyorsell === BuyOrSell.buy ? '买入' : '卖出'}}</div>
@@ -143,6 +105,7 @@ import Long from 'long';
 import { defineComponent, PropType } from 'vue';
 import { BargainList, FormState } from './interface';
 import { handleForm, useCheckd, usePrice } from './setup';
+import { formatTime } from '@/common/methods';
 
 export default defineComponent({
     name: ModalEnum.commodity_contract_summary_settlement,
@@ -221,6 +184,7 @@ export default defineComponent({
             checkGroupChange,
             checkboxChange,
             BuyOrSell,
+            formatTime,
         };
     },
 });