Browse Source

样式调整

marymelisa 4 years ago
parent
commit
6978855852

+ 3 - 3
src/common/setup/validate/index.ts

@@ -5,9 +5,9 @@
  * @returns 
  * @returns 
  */
  */
 export function validateCommon(value: any, errInfo: string) {
 export function validateCommon(value: any, errInfo: string) {
-    if (value) {
-        return Promise.resolve();
-    } else {
+    if (value === undefined || value === null || value === '') {
         return Promise.reject(errInfo);
         return Promise.reject(errInfo);
+    } else {
+        return Promise.resolve();
     }
     }
 }
 }

+ 10 - 3
src/layout/components/header.vue

@@ -50,6 +50,9 @@ import { openModal } from '@/common/setup/modal/index';
 import { UserOutlined } from '@ant-design/icons-vue';
 import { UserOutlined } from '@ant-design/icons-vue';
 import Setting from '@/views/setting/index.vue';
 import Setting from '@/views/setting/index.vue';
 import { getUserName } from '@/services/bus/user';
 import { getUserName } from '@/services/bus/user';
+import { logout } from '@/services/bus/login';
+import APP from '@/services';
+import Router from '@/router';
 
 
 // 设置
 // 设置
 const setFn = () => {
 const setFn = () => {
@@ -66,9 +69,13 @@ const setFn = () => {
     ];
     ];
     const { openAction } = openModal('logout');
     const { openAction } = openModal('logout');
     function chooseSetMenu(path: string) {
     function chooseSetMenu(path: string) {
-        // chooseSetupItem.value = path;
-        openAction();
-        console.log(path);
+        if (path === 'logout') {
+            logout();
+            APP.closeServer();
+            Router.replace('/login');
+        } else {
+            openAction();
+        }
         visible.value = false;
         visible.value = false;
     }
     }
 
 

+ 0 - 1
src/services/bus/error.ts

@@ -1,4 +1,3 @@
-import APP from '@/services';
 import { ErrorCodeList } from '@/services/dataCenter/interafce/error';
 import { ErrorCodeList } from '@/services/dataCenter/interafce/error';
 import { localStorageUtil } from '@/utils/storage';
 import { localStorageUtil } from '@/utils/storage';
 
 

+ 7 - 7
src/services/proto/contract/index.ts

@@ -1,9 +1,9 @@
-import {buildProtoReq50, parseProtoRsp50} from "@/services/socket/protobuf/buildReq";
 import APP from "@/services";
 import APP from "@/services";
-import {Callback} from "@/utils/websocket";
-import {ErmcpContractOperateApplyReq} from "@/services/proto/contract/interface";
-import {getSelectedAccountId, getUserId} from "@/services/bus/account";
-import {getUUID} from "@/utils/qt/common";
+import { getSelectedAccountId, getUserId } from "@/services/bus/account";
+import { ErmcpContractOperateApplyReq } from "@/services/proto/contract/interface";
+import { buildProtoReq50, parseProtoRsp50 } from "@/services/socket/protobuf/buildReq";
+import { getUUID } from "@/utils/qt/common";
+import { Callback } from "@/utils/websocket";
 
 
 /**
 /**
  * 合同
  * 合同
@@ -20,7 +20,7 @@ export const operationContractReq = (param: ErmcpContractOperateApplyReq): Promi
         const params = {
         const params = {
             protobufName: 'ErmcpContractOperateApplyReq',
             protobufName: 'ErmcpContractOperateApplyReq',
             funCodeName: 'ErmcpContractOperateApplyReq',
             funCodeName: 'ErmcpContractOperateApplyReq',
-            reqParams:  { OperateApplyID, OperateSrc, UserID, ClientTicket, ...param },
+            reqParams: { OperateApplyID, OperateSrc, UserID, ClientTicket, ...param },
             msgHeadParams: {
             msgHeadParams: {
                 AccountID: getSelectedAccountId(),
                 AccountID: getSelectedAccountId(),
                 MarketID: 18,
                 MarketID: 18,
@@ -37,7 +37,7 @@ export const operationContractReq = (param: ErmcpContractOperateApplyReq): Promi
                     reject(result);
                     reject(result);
                 }
                 }
             },
             },
-            onFail: (err) => reject(err.message),
+            onFail: (err) => reject(err.message)
         } as Callback);
         } as Callback);
     });
     });
 }
 }

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

@@ -1,10 +1,9 @@
 import APP from "@/services";
 import APP from "@/services";
 import { getSelectedAccountId, getUserId } from "@/services/bus/account";
 import { getSelectedAccountId, getUserId } from "@/services/bus/account";
-import {GldErmcpSpotContractOperateReq, SpotContractOperateReq} from "@/services/proto/spotcontract/interface";
+import { GldErmcpSpotContractOperateReq, SpotContractOperateReq } from "@/services/proto/spotcontract/interface";
 import { buildProtoReq50, parseProtoRsp50 } from "@/services/socket/protobuf/buildReq";
 import { buildProtoReq50, parseProtoRsp50 } from "@/services/socket/protobuf/buildReq";
 import { Callback } from "@/utils/websocket";
 import { Callback } from "@/utils/websocket";
 import { v4 as uuidv4 } from 'uuid';
 import { v4 as uuidv4 } from 'uuid';
-import {getTimeValue} from "@/utils/time";
 
 
 /**(重点提醒 这里属于管理端接口,仅用于新增)以上来自android代码  回头需要确认
 /**(重点提醒 这里属于管理端接口,仅用于新增)以上来自android代码  回头需要确认
  * 新增 / 修改采购合同报文 (很多修改合同操作也在这)
  * 新增 / 修改采购合同报文 (很多修改合同操作也在这)
@@ -59,7 +58,6 @@ export const spotContractStatus = (param: SpotContractOperateReq): Promise<any>
     const reqParams = {
     const reqParams = {
         ...param, OperateSrc, ClientTicket, UserID
         ...param, OperateSrc, ClientTicket, UserID
     }
     }
-    debugger
     return new Promise((resolve, reject) => {
     return new Promise((resolve, reject) => {
         const params = {
         const params = {
             protobufName: 'SpotContractOperateReq',
             protobufName: 'SpotContractOperateReq',

+ 162 - 147
src/views/business/purchase/components/someprice/index.vue

@@ -1,143 +1,156 @@
 <template>
 <template>
-    <!-- 点价登记-->
-    <a-modal class="commonModal custom-detail"
-             :title="selectedRow.contracttype===1? '采购合同-点价登记': '销售合同-点价登记'"
-             v-model:visible="visible"
-             @cancel="cancel"
-             width="890px">
-        <template #footer>
-            <a-button key="submit"
-                      class="cancelBtn"
-                      @click="cancel">取消
-            </a-button>
-            <a-button key="submit"
-                    type="primary"
-                    :loading="loading"
-                    @click="submit">点价登记
-            </a-button>
-        </template>
-        <fieldset class="formFieldSet">
-            <legend>合同基本信息</legend>
-            <a-form class="inlineForm">
-                <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 custom-detail"
+           :title="selectedRow.contracttype===1? '采购合同-点价登记': '销售合同-点价登记'"
+           v-model:visible="visible"
+           @cancel="cancel"
+           width="890px">
+    <template #footer>
+      <a-button key="submit"
+                class="cancelBtn"
+                @click="cancel">取消
+      </a-button>
+      <a-button key="submit"
+                type="primary"
+                :loading="loading"
+                @click="submit">点价登记
+      </a-button>
+    </template>
+    <fieldset class="formFieldSet">
+      <legend>合同基本信息</legend>
+      <a-form class="inlineForm">
+        <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="点价数量" name="PricedQty" class="relative">
-                            <a-input-number  class="dialogInput"  style="width: 200px" v-model:value="formState.PricedQty" :min="0" :max="selectedRow.unpricedqty" placeholder="请输入点价数量"/>
-                            <div class="itemTip">
-                                <span class="white">未定价量{{selectedRow.unpricedqty}}{{selectedRow.enumdicname}} </span>
-                                <span class="white" @click="formState.PricedQty = selectedRow.unpricedqty"> 全部登记</span>
-                            </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="itemTip">
+                  <span class="white">未定价量{{selectedRow.unpricedqty}}{{selectedRow.enumdicname}} </span>
+                  <span class="white" @click="formState.PricedQty = selectedRow.unpricedqty"> 全部登记</span>
+              </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>
 </template>
 
 
 <script lang="ts">
 <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 { 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 { operationContractReq } from '@/services/proto/contract';
 import { message } from 'ant-design-vue';
 import { message } from 'ant-design-vue';
+import Long from 'long';
 
 
 export default defineComponent({
 export default defineComponent({
     name: 'purchase_pending_someprice',
     name: 'purchase_pending_someprice',
@@ -149,12 +162,12 @@ export default defineComponent({
         },
         },
     },
     },
     setup(props) {
     setup(props) {
-        const {visible, cancel} = closeModal('purchase_pending_someprice');
+        const { visible, cancel } = closeModal('purchase_pending_someprice');
         const loading = ref<boolean>(false);
         const loading = ref<boolean>(false);
         function objectToUint8Array(data: object) {
         function objectToUint8Array(data: object) {
-            const encode = encodeURI(JSON.stringify(data));// 对字符串进行编码
-            const base64String = btoa(encode);// 对编码的字符串转化base64
-            const padding = '='.repeat((4 - base64String.length % 4) % 4);
+            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);
             const rawData = window.atob(base64);
             const outputArray = new Uint8Array(rawData.length);
             const outputArray = new Uint8Array(rawData.length);
@@ -176,7 +189,7 @@ export default defineComponent({
         const formStateRules = {
         const formStateRules = {
             PricedPrice: [{ 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' }],
             PricedQty: [{ required: true, validator: numberIstrue, trigger: 'blur', type: 'number' }],
-        }
+        };
         function submit() {
         function submit() {
             const wrapEl = unref(formRef);
             const wrapEl = unref(formRef);
             wrapEl.validate().then(() => {
             wrapEl.validate().then(() => {
@@ -186,18 +199,20 @@ export default defineComponent({
                     OperateType: 1, // uint32 操作类型-1:登记2:确认3:拒绝4:撤销
                     OperateType: 1, // uint32 操作类型-1:登记2:确认3:拒绝4:撤销
                     Info: {
                     Info: {
                         OperateApplyType: 1, // uint32 操作申请类型-1:点价2:结算3:款项4:发票
                         OperateApplyType: 1, // uint32 操作申请类型-1:点价2:结算3:款项4:发票
-                        RelatedID: 1, // 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();
+                        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();
+                    });
             });
             });
         }
         }
 
 

+ 22 - 14
src/views/information/spot-contract/components/add/index.vue

@@ -10,11 +10,11 @@
     <template #footer>
     <template #footer>
       <a-button key="submit"
       <a-button key="submit"
                 class="cancelBtn"
                 class="cancelBtn"
-                @click="cancel">保存草稿</a-button>
+                @click="submit(1)">保存草稿</a-button>
       <a-button key="submit"
       <a-button key="submit"
                 type="primary"
                 type="primary"
                 :loading="loading"
                 :loading="loading"
-                @click="submit">提交审核</a-button>
+                @click="submit(2)">提交审核</a-button>
     </template>
     </template>
     <a-form class="inlineForm"
     <a-form class="inlineForm"
             ref="formRef"
             ref="formRef"
@@ -81,16 +81,14 @@
               </a-form-item>
               </a-form-item>
             </a-col>
             </a-col>
             <a-col :span="12">
             <a-col :span="12">
-              <a-form-item label="销售方"
-                           name="SellUserID">
+              <a-form-item label="销售方">
                 <span class="white">{{getUserName()}}</span>
                 <span class="white">{{getUserName()}}</span>
               </a-form-item>
               </a-form-item>
             </a-col>
             </a-col>
           </template>
           </template>
           <template v-else>
           <template v-else>
             <a-col :span="12">
             <a-col :span="12">
-              <a-form-item label="采购方"
-                           name="BuyUserID">
+              <a-form-item label="采购方">
                 <span class="white">{{getUserName()}}</span>
                 <span class="white">{{getUserName()}}</span>
               </a-form-item>
               </a-form-item>
             </a-col>
             </a-col>
@@ -414,13 +412,16 @@
 </template>
 </template>
 
 
 <script lang="ts">
 <script lang="ts">
-import { defineComponent, ref } from 'vue';
+import { defineComponent, ref, toRaw } from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
 import { closeModal } from '@/common/setup/modal/index';
 import { initData } from '@/common/methods';
 import { initData } from '@/common/methods';
 import { handleFromState, handleContract, handlevalidate, handleDeliveryGoods, handlePrice, handleDate } from './setup';
 import { handleFromState, handleContract, handlevalidate, handleDeliveryGoods, handlePrice, handleDate } from './setup';
 import { getUserName } from '@/services/bus/user';
 import { getUserName } from '@/services/bus/user';
 import { getGoodsList } from '@/services/bus/goods';
 import { getGoodsList } from '@/services/bus/goods';
 import { Goods } from '@/services/go/ermcp/goodsInfo/interface';
 import { Goods } from '@/services/go/ermcp/goodsInfo/interface';
+import { ValidateErrorEntity } from 'ant-design-vue/lib/form/interface';
+import { FormState } from './interface';
+import moment from 'moment';
 
 
 export default defineComponent({
 export default defineComponent({
     name: 'add-spot-contract',
     name: 'add-spot-contract',
@@ -446,7 +447,7 @@ export default defineComponent({
             WrStandardID: [{ required: true, validator: v_WrStandard, trigger: 'blur' }],
             WrStandardID: [{ required: true, validator: v_WrStandard, trigger: 'blur' }],
             SpotGoodsBrandID: [{ required: true, validator: v_SpotGoodsBrand, trigger: 'blur' }],
             SpotGoodsBrandID: [{ required: true, validator: v_SpotGoodsBrand, trigger: 'blur' }],
             GoodsID: [{ required: true, validator: v_Goods, trigger: 'blur' }],
             GoodsID: [{ required: true, validator: v_Goods, trigger: 'blur' }],
-            ConvertFactor: [{ required: true, message: '请选择品类', trigger: 'blur' }],
+            // ConvertFactor: [{ required: true, message: '请选择品类', trigger: 'blur' }],
             SpotGoodsDesc: [{ required: true, message: '请输入商品规格', trigger: 'blur' }],
             SpotGoodsDesc: [{ required: true, message: '请输入商品规格', trigger: 'blur' }],
             PriceType: [{ required: true, validator: v_PriceType, trigger: 'blur' }],
             PriceType: [{ required: true, validator: v_PriceType, trigger: 'blur' }],
             CurrencyID: [{ required: true, validator: v_Currency, trigger: 'blur' }],
             CurrencyID: [{ required: true, validator: v_Currency, trigger: 'blur' }],
@@ -462,12 +463,18 @@ export default defineComponent({
         const { deliveryDate, priceDate, disabledDate } = handleDate();
         const { deliveryDate, priceDate, disabledDate } = handleDate();
         // 现货商品列表
         // 现货商品列表
         const goodsList = ref<Goods[]>([]);
         const goodsList = ref<Goods[]>([]);
-        function submit() {
-            loading.value = true;
-            setTimeout(() => {
-                loading.value = false;
-                cancel();
-            }, 2000);
+        function submit(OperateType: number) {
+            formRef.value
+                .validate()
+                .then(() => {
+                    const param = toRaw(formState);
+                    console.log('deliveryDate', moment(deliveryDate.value[0], 'YYYY/MM/DD'));
+                    console.log('priceDate', priceDate);
+                    console.log('values', formState);
+                })
+                .catch((error: ValidateErrorEntity<FormState>) => {
+                    console.log('error', error);
+                });
         }
         }
         initData(() => {
         initData(() => {
             queryCustomList();
             queryCustomList();
@@ -478,6 +485,7 @@ export default defineComponent({
             visible,
             visible,
             cancel,
             cancel,
             submit,
             submit,
+            formRef,
             loading,
             loading,
             maskClosableFlag: false,
             maskClosableFlag: false,
             formState,
             formState,

+ 6 - 5
src/views/information/spot-contract/components/setup.ts

@@ -1,13 +1,14 @@
+import { getRequestResultInfo } from "@/common/methods/request";
 import { orderContract, spotContractStatus } from "@/services/proto/spotcontract";
 import { orderContract, spotContractStatus } from "@/services/proto/spotcontract";
 import {
 import {
     GldErmcpSpotContractOperateReq,
     GldErmcpSpotContractOperateReq,
     GldSpotContractInfo,
     GldSpotContractInfo,
     SpotContractOperateReq
     SpotContractOperateReq
 } from "@/services/proto/spotcontract/interface";
 } from "@/services/proto/spotcontract/interface";
+import { ContractStateSign, GldContractStateSign } from "@/views/information/spot-contract/setup";
+import { message } from "ant-design-vue";
+import Long from 'long';
 import { ref } from "vue";
 import { ref } from "vue";
-import {getRequestResultInfo} from "@/common/methods/request";
-import {ContractStateSign, GldContractStateSign} from "@/views/information/spot-contract/setup";
-import {message} from "ant-design-vue";
 
 
 /**
 /**
  * 合同操作相关
  * 合同操作相关
@@ -52,11 +53,11 @@ export function changeOrderContract() {
  */
  */
 export function OrderContractControl() {
 export function OrderContractControl() {
     const loading = ref<boolean>(false);
     const loading = ref<boolean>(false);
-    loading.value = true
 
 
     function orderContractState(id: string, type: number): Promise<string> {
     function orderContractState(id: string, type: number): Promise<string> {
+        loading.value = true
         const reqs: SpotContractOperateReq = {
         const reqs: SpotContractOperateReq = {
-            SpotContractID: Number(id),
+            SpotContractID: Long.fromString(id),
             OperateType: type,
             OperateType: type,
             Remark: '',
             Remark: '',
         }
         }

+ 14 - 15
src/views/information/warehouse-info/compoments/setup.ts

@@ -1,7 +1,7 @@
-import {warehouseStateChangeReq} from "@/services/proto/warehouse";
-import {WarehouseStateChangeReq} from "@/services/proto/warehouse/interface";
-import {getSelectedAccountId} from "@/services/bus/account";
-import {ref} from "vue";
+import { getSelectedAccountId } from "@/services/bus/account";
+import { warehouseStateChangeReq } from "@/services/proto/warehouse";
+import { WarehouseStateChangeReq } from "@/services/proto/warehouse/interface";
+import { ref } from "vue";
 
 
 export const enum wareType {
 export const enum wareType {
     normal = 1, // 正常
     normal = 1, // 正常
@@ -12,7 +12,7 @@ export const enum wareType {
  * 更变仓库信息状态
  * 更变仓库信息状态
  * @param type normal: 将停用恢复成正常  stop: 将正常设置为停用
  * @param type normal: 将停用恢复成正常  stop: 将正常设置为停用
  */
  */
-export function stopOrResumeWarehouse(type: wareType){
+export function stopOrResumeWarehouse(type: wareType) {
     const loading = ref<boolean>(false);
     const loading = ref<boolean>(false);
     let warehousestatus = 1;
     let warehousestatus = 1;
     switch (type) {
     switch (type) {
@@ -27,32 +27,31 @@ export function stopOrResumeWarehouse(type: wareType){
      * 提交切换状态请求
      * 提交切换状态请求
      * @param warehouseid 操作的仓库id
      * @param warehouseid 操作的仓库id
      */
      */
-    function changeStatus(warehouseid: number): Promise<string>{
-        let accountid = getSelectedAccountId()?.toNumber()
+    function changeStatus(warehouseid: number): Promise<string> {
+        const accountid = getSelectedAccountId()?.toNumber()
         const req: WarehouseStateChangeReq = {
         const req: WarehouseStateChangeReq = {
             accountid: accountid === undefined ? 0 : accountid,
             accountid: accountid === undefined ? 0 : accountid,
             warehouseid: warehouseid,
             warehouseid: warehouseid,
             warehousestatus: warehousestatus
             warehousestatus: warehousestatus
         }
         }
-        debugger
         return warehouseStateChangeReq(req)
         return warehouseStateChangeReq(req)
             .then(res => {
             .then(res => {
-                if(warehousestatus === 1){
+                if (warehousestatus === 1) {
                     return Promise.resolve("恢复成功")
                     return Promise.resolve("恢复成功")
-                }else{
+                } else {
                     return Promise.resolve("停用成功")
                     return Promise.resolve("停用成功")
                 }
                 }
             })
             })
             .catch(err => {
             .catch(err => {
-                if(warehousestatus === 1){
-                    return Promise.reject("恢复失败:"+ err)
-                }else{
-                    return Promise.reject("停用失败:"+ err)
+                if (warehousestatus === 1) {
+                    return Promise.reject("恢复失败:" + err)
+                } else {
+                    return Promise.reject("停用失败:" + err)
                 }
                 }
             })
             })
             .finally(() => {
             .finally(() => {
                 loading.value = false
                 loading.value = false
             })
             })
     }
     }
-    return {loading, changeStatus}
+    return { loading, changeStatus }
 }
 }