Browse Source

Merge remote-tracking branch 'origin/master'

yu.jie 4 years ago
parent
commit
8337c0447c

+ 5 - 4
src/views/business/plan/components/add/index.vue

@@ -148,14 +148,16 @@ import { closeModal } from '@/common/setup/modal/index';
 import { formatTime, initData } from '@/common/methods/index';
 import { formatTime, initData } from '@/common/methods/index';
 import { getPayCurrencyTypeEnumList, getSpotContractTypeEnumList } from '@/common/constants/enumsList';
 import { getPayCurrencyTypeEnumList, getSpotContractTypeEnumList } from '@/common/constants/enumsList';
 import { AllEnums } from '@/services/go/commonService/interface';
 import { AllEnums } from '@/services/go/commonService/interface';
-import { changeStatus, getMiddleGoodsD, handleForm, handleTrader } from '../setup';
+import { getMiddleGoodsD, handleForm, handleTrader } from '../setup';
 import { ValidateErrorEntity } from 'ant-design-vue/lib/form/interface';
 import { ValidateErrorEntity } from 'ant-design-vue/lib/form/interface';
 import { FormState } from '@/views/information/spot-contract/components/interface';
 import { FormState } from '@/views/information/spot-contract/components/interface';
 import { ErmcpHedgePlanReq } from '@/services/proto/hedgeplan/interface';
 import { ErmcpHedgePlanReq } from '@/services/proto/hedgeplan/interface';
 import { getLongTypeLoginID } from '@/services/bus/login';
 import { getLongTypeLoginID } from '@/services/bus/login';
 import { LongType } from '@/services/socket/login/interface';
 import { LongType } from '@/services/socket/login/interface';
 import APP from '@/services';
 import APP from '@/services';
+import { hedgePlanReq } from '@/services/proto/hedgeplan';
 import { getAreaUserId } from '@/services/bus/user';
 import { getAreaUserId } from '@/services/bus/user';
+import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 
 
 export default defineComponent({
 export default defineComponent({
     name: 'add-custom',
     name: 'add-custom',
@@ -197,11 +199,10 @@ export default defineComponent({
                         Remark: param.Remark,
                         Remark: param.Remark,
                         Tradeuserid: param.Tradeuserid, // 交易用户id
                         Tradeuserid: param.Tradeuserid, // 交易用户id
                     };
                     };
-                    changeStatus(reqParam, OperateType, loading).then(() => {
+                    requestResultLoadingAndInfo(hedgePlanReq, reqParam, loading, OperateType === 1 ? ['保存草稿成功', '保存草稿失败:'] : ['提交申请成功', '提交申请失败:']).then(() => {
+                        context.emit('refresh');
                         cancel();
                         cancel();
-                        context.emit('refresh', true);
                     });
                     });
-                    console.log('param', param);
                 })
                 })
                 .catch((error: ValidateErrorEntity<FormState>) => {
                 .catch((error: ValidateErrorEntity<FormState>) => {
                     console.log('error', error);
                     console.log('error', error);

+ 38 - 43
src/views/business/plan/components/audit/index.vue

@@ -19,9 +19,9 @@
                 :loading="loading"
                 :loading="loading"
                 @click="refuse">审核拒绝</a-button>
                 @click="refuse">审核拒绝</a-button>
     </template>
     </template>
-     <a-form class="inlineForm"
-              :form="form"
-              @submit="handleSearch">
+    <a-form class="inlineForm"
+            :form="form"
+            @submit="handleSearch">
       <fieldset class="formFieldSet">
       <fieldset class="formFieldSet">
         <legend>基本信息</legend>
         <legend>基本信息</legend>
         <a-row :gutter="24">
         <a-row :gutter="24">
@@ -60,30 +60,30 @@
             </a-form-item>
             </a-form-item>
           </a-col>
           </a-col>
         </a-row>
         </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>
+
+      </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-form>
   </a-modal>
   </a-modal>
 </template>
 </template>
@@ -94,11 +94,11 @@ import { closeModal } from '@/common/setup/modal/index';
 import { Modal } from 'ant-design-vue';
 import { Modal } from 'ant-design-vue';
 import { ErmcpHedgePlanReq } from '@/services/proto/hedgeplan/interface';
 import { ErmcpHedgePlanReq } from '@/services/proto/hedgeplan/interface';
 import Long from 'long';
 import Long from 'long';
-import { changeStatus } from '@/views/business/plan/components/setup';
 import { Ermcp3HedgePlan } from '@/services/go/ermcp/plan/interface';
 import { Ermcp3HedgePlan } from '@/services/go/ermcp/plan/interface';
 import { getPlanContractType } from '@/views/business/plan/setup';
 import { getPlanContractType } from '@/views/business/plan/setup';
 import { formatValue } from '@/common/methods';
 import { formatValue } from '@/common/methods';
-
+import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
+import { hedgePlanReq } from '@/services/proto/hedgeplan';
 export default defineComponent({
 export default defineComponent({
     name: 'plan_audit_audit',
     name: 'plan_audit_audit',
     components: {},
     components: {},
@@ -122,16 +122,13 @@ export default defineComponent({
                         HedgePlanID: Long.fromString(props.selectedRow.hedgeplanid),
                         HedgePlanID: Long.fromString(props.selectedRow.hedgeplanid),
                         OperateType: 4,
                         OperateType: 4,
                         Remark: '通过',
                         Remark: '通过',
-                        Currencyid: props.selectedRow.currencyid,  // 结算币种id
+                        Currencyid: props.selectedRow.currencyid, // 结算币种id
                         Tradeuserid: props.selectedRow.tradeuserid, // 交易用户id
                         Tradeuserid: props.selectedRow.tradeuserid, // 交易用户id
-
                     };
                     };
-                    changeStatus(params, 4, loading)
-                        .then((res) => {
-                            cancel();
-                            context.emit('refresh');
-                        })
-                        .catch((err) => {});
+                    requestResultLoadingAndInfo(hedgePlanReq, params, loading, ['审核通过', '审核失败:']).then(() => {
+                        context.emit('refresh');
+                        cancel();
+                    });
                 },
                 },
                 onCancel() {
                 onCancel() {
                     console.log('Cancel');
                     console.log('Cancel');
@@ -149,12 +146,10 @@ export default defineComponent({
                         HedgePlanID: Long.fromString(props.selectedRow.hedgeplanid),
                         HedgePlanID: Long.fromString(props.selectedRow.hedgeplanid),
                         OperateType: 5,
                         OperateType: 5,
                     };
                     };
-                    changeStatus(params, 5, loading)
-                        .then((res) => {
-                            cancel();
-                            context.emit('refresh');
-                        })
-                        .catch((err) => {});
+                    requestResultLoadingAndInfo(hedgePlanReq, params, loading, ['审核拒绝通过', '审核拒绝失败:']).then(() => {
+                        context.emit('refresh');
+                        cancel();
+                    });
                 },
                 },
                 onCancel() {
                 onCancel() {
                     console.log('Cancel');
                     console.log('Cancel');

+ 101 - 104
src/views/business/plan/components/cancel/index.vue

@@ -1,101 +1,102 @@
 <template>
 <template>
-    <!-- 计划撤销-->
-    <a-modal class="commonModal custom-detail"
-             title="计划撤销"
-             v-model:visible="visible"
-             centered
-             :maskClosable="maskClosableFlag"
-             @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>
-        <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>
-    </a-modal>
+  <!-- 计划撤销-->
+  <a-modal class="commonModal custom-detail"
+           title="计划撤销"
+           v-model:visible="visible"
+           centered
+           :maskClosable="maskClosableFlag"
+           @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>
+    <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>
+  </a-modal>
 </template>
 </template>
 
 
 <script lang="ts">
 <script lang="ts">
-import {defineComponent, PropType, ref} from 'vue';
-import {closeModal} from '@/common/setup/modal/index';
-import {Ermcp3HedgePlan} from "@/services/go/ermcp/plan/interface";
-import {formatValue} from "@/common/methods";
-import {getPlanContractType} from "@/views/business/plan/setup";
-import {Modal} from "ant-design-vue";
-import {cancelPlan} from "@/views/business/plan/components/setup";
-import {HedgePlanOperateReq} from "@/services/proto/hedgeplan/interface";
-import * as Long from "long";
+import { defineComponent, PropType, ref } from 'vue';
+import { closeModal } from '@/common/setup/modal/index';
+import { Ermcp3HedgePlan } from '@/services/go/ermcp/plan/interface';
+import { formatValue } from '@/common/methods';
+import { getPlanContractType } from '@/views/business/plan/setup';
+import { Modal } from 'ant-design-vue';
+import { HedgePlanOperateReq } from '@/services/proto/hedgeplan/interface';
+import * as Long from 'long';
+import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
+import { oldHedgePlanReq } from '@/services/proto/hedgeplan';
 
 
 export default defineComponent({
 export default defineComponent({
     name: 'plan_audit_cancel',
     name: 'plan_audit_cancel',
@@ -107,7 +108,7 @@ export default defineComponent({
         },
         },
     },
     },
     setup(props, context) {
     setup(props, context) {
-        const {visible, cancel} = closeModal('plan_audit_cancel');
+        const { visible, cancel } = closeModal('plan_audit_cancel');
         const maskClosableFlag = ref<boolean>(false);
         const maskClosableFlag = ref<boolean>(false);
         const loading = ref<boolean>(false);
         const loading = ref<boolean>(false);
 
 
@@ -120,15 +121,11 @@ export default defineComponent({
                     const params: HedgePlanOperateReq = {
                     const params: HedgePlanOperateReq = {
                         HedgePlanID: Long.fromString(props.selectedRow.hedgeplanid),
                         HedgePlanID: Long.fromString(props.selectedRow.hedgeplanid),
                         OperateType: 5,
                         OperateType: 5,
-                    }
-                    cancelPlan(params,  loading)
-                        .then(res => {
-                            cancel()
-                            context.emit('refresh')
-                        })
-                        .catch(err =>{
-                            
-                        })
+                    };
+                    requestResultLoadingAndInfo(oldHedgePlanReq, params, loading, ['撤销成功', '撤销失败:']).then(() => {
+                        context.emit('refresh');
+                        cancel();
+                    });
                 },
                 },
                 onCancel() {
                 onCancel() {
                     console.log('Cancel');
                     console.log('Cancel');

+ 74 - 77
src/views/business/plan/components/delete/index.vue

@@ -13,83 +13,84 @@
                 @click="submit">完成</a-button>
                 @click="submit">完成</a-button>
     </template>
     </template>
     <a-form class="inlineForm"
     <a-form class="inlineForm"
-                  :form="form"
-                  @submit="handleSearch">
+            :form="form"
+            @submit="handleSearch">
       <fieldset class="formFieldSet">
       <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>
+        <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>
       <fieldset class="formFieldSet">
       <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>
+        <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>
       </fieldset>
-      </a-form>
+    </a-form>
   </a-modal>
   </a-modal>
 </template>
 </template>
 
 
 <script lang="ts">
 <script lang="ts">
-import {defineComponent, PropType, ref} from 'vue';
+import { defineComponent, PropType, ref } from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
 import { closeModal } from '@/common/setup/modal/index';
-import {Ermcp3HedgePlan} from "@/services/go/ermcp/plan/interface";
-import {formatValue} from "@/common/methods";
-import {getPlanContractType} from "@/views/business/plan/setup";
-import {Modal} from "ant-design-vue";
-import {changeStatus} from "@/views/business/plan/components/setup";
-import {ErmcpHedgePlanReq, HedgePlanOperateReq} from "@/services/proto/hedgeplan/interface";
-import * as Long from "long";
+import { Ermcp3HedgePlan } from '@/services/go/ermcp/plan/interface';
+import { formatValue } from '@/common/methods';
+import { getPlanContractType } from '@/views/business/plan/setup';
+import { Modal } from 'ant-design-vue';
+import { ErmcpHedgePlanReq } from '@/services/proto/hedgeplan/interface';
+import * as Long from 'long';
+import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
+import { hedgePlanReq } from '@/services/proto/hedgeplan';
 
 
 export default defineComponent({
 export default defineComponent({
     name: 'plan_uncommitted_delete',
     name: 'plan_uncommitted_delete',
@@ -112,15 +113,11 @@ export default defineComponent({
                     const params: ErmcpHedgePlanReq = {
                     const params: ErmcpHedgePlanReq = {
                         HedgePlanID: Long.fromString(props.selectedRow.hedgeplanid),
                         HedgePlanID: Long.fromString(props.selectedRow.hedgeplanid),
                         OperateType: 3,
                         OperateType: 3,
-                    }
-                    changeStatus(params, 3, loading)
-                        .then(res => {
-                            cancel()
-                            context.emit('refresh')
-                        })
-                        .catch(err => {
-
-                        })
+                    };
+                    requestResultLoadingAndInfo(hedgePlanReq, params, loading, ['删除成功', '删除失败:']).then(() => {
+                        context.emit('refresh');
+                        cancel();
+                    });
                 },
                 },
                 onCancel() {
                 onCancel() {
                     console.log('Cancel');
                     console.log('Cancel');

+ 5 - 4
src/views/business/plan/components/modify/index.vue

@@ -145,7 +145,7 @@ import { closeModal } from '@/common/setup/modal/index';
 import { formatTime, initData } from '@/common/methods/index';
 import { formatTime, initData } from '@/common/methods/index';
 import { getPayCurrencyTypeEnumList, getSpotContractTypeEnumList } from '@/common/constants/enumsList';
 import { getPayCurrencyTypeEnumList, getSpotContractTypeEnumList } from '@/common/constants/enumsList';
 import { AllEnums } from '@/services/go/commonService/interface';
 import { AllEnums } from '@/services/go/commonService/interface';
-import { changeStatus, getMiddleGoodsD, handleForm, handleTrader } from '../setup';
+import { getMiddleGoodsD, handleForm, handleTrader } from '../setup';
 import { ValidateErrorEntity } from 'ant-design-vue/lib/form/interface';
 import { ValidateErrorEntity } from 'ant-design-vue/lib/form/interface';
 import { FormState } from '@/views/information/spot-contract/components/interface';
 import { FormState } from '@/views/information/spot-contract/components/interface';
 import { ErmcpHedgePlanReq } from '@/services/proto/hedgeplan/interface';
 import { ErmcpHedgePlanReq } from '@/services/proto/hedgeplan/interface';
@@ -155,6 +155,8 @@ import APP from '@/services';
 import { mergeTwoObj } from '@/utils/objHandle';
 import { mergeTwoObj } from '@/utils/objHandle';
 import { Ermcp3HedgePlan } from '@/services/go/ermcp/plan/interface';
 import { Ermcp3HedgePlan } from '@/services/go/ermcp/plan/interface';
 import { getAreaUserId } from '@/services/bus/user';
 import { getAreaUserId } from '@/services/bus/user';
+import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
+import { hedgePlanReq } from '@/services/proto/hedgeplan';
 
 
 export default defineComponent({
 export default defineComponent({
     name: 'plan_uncommitted_modify',
     name: 'plan_uncommitted_modify',
@@ -210,11 +212,10 @@ export default defineComponent({
                         Remark: param.Remark,
                         Remark: param.Remark,
                         Tradeuserid: param.Tradeuserid, // 交易用户id
                         Tradeuserid: param.Tradeuserid, // 交易用户id
                     };
                     };
-                    changeStatus(reqParam, OperateType, loading).then(() => {
+                    requestResultLoadingAndInfo(hedgePlanReq, reqParam, loading, ['修改计划成功', '修改计划失败:']).then(() => {
+                        context.emit('refresh');
                         cancel();
                         cancel();
-                        context.emit('refresh', true);
                     });
                     });
-                    console.log('param', param);
                 })
                 })
                 .catch((error: ValidateErrorEntity<FormState>) => {
                 .catch((error: ValidateErrorEntity<FormState>) => {
                     console.log('error', error);
                     console.log('error', error);

+ 1 - 29
src/views/business/plan/components/setup.ts

@@ -1,43 +1,15 @@
-import { commonResultInfo, getRequestResultInfo } from "@/common/methods/request";
 import { validateCommon } from "@/common/setup/validate";
 import { validateCommon } from "@/common/setup/validate";
 import APP from '@/services';
 import APP from '@/services';
 import { QueryAccMgrLoginUser } from "@/services/go/ermcp/account";
 import { QueryAccMgrLoginUser } from "@/services/go/ermcp/account";
 import { ErmcpLoginUserEx } from "@/services/go/ermcp/account/interface";
 import { ErmcpLoginUserEx } from "@/services/go/ermcp/account/interface";
 import { Ermcp3Wrstandard, ErmcpDeliveryGoodsDetailEx } from "@/services/go/ermcp/goodsInfo/interface";
 import { Ermcp3Wrstandard, ErmcpDeliveryGoodsDetailEx } from "@/services/go/ermcp/goodsInfo/interface";
-import { hedgePlanReq, oldHedgePlanReq } from "@/services/proto/hedgeplan";
-import { ErmcpHedgePlanReq, HedgePlanOperateReq } from "@/services/proto/hedgeplan/interface";
-import { deletePlanSign, hedgePlanSign } from "@/views/business/plan/setup";
 import { message } from "ant-design-vue";
 import { message } from "ant-design-vue";
 import { RuleObject } from "ant-design-vue/lib/form/interface";
 import { RuleObject } from "ant-design-vue/lib/form/interface";
-import { reactive, ref, Ref, UnwrapRef } from "vue";
+import { reactive, ref, UnwrapRef } from "vue";
 import { FormState } from "./interface";
 import { FormState } from "./interface";
 
 
 
 
 /**
 /**
- * 操作类型-1:保存草稿2:提交申请3:删除4审核通过5审核拒绝
- * @param id HedgePlanID
- * @param type
- */
-export function changeStatus(req: ErmcpHedgePlanReq, type: number, loading: Ref<boolean>): Promise<string> {
-    loading.value = true;
-    const sign = getRequestResultInfo(hedgePlanSign, type)  // 接口请求后的返回提示 这里统一进行管理
-    const result = hedgePlanReq(req)
-    return commonResultInfo(result, sign, loading)
-}
-
-/**
- * 撤销套保计划
- * @param req 撤销套保计划请求
- * @param loading
- */
-export function cancelPlan(req: HedgePlanOperateReq, loading: Ref<boolean>): Promise<string> {
-    loading.value = true;
-    const sign = getRequestResultInfo(deletePlanSign, 5)  // 接口请求后的返回提示 这里统一进行管理
-    const result = oldHedgePlanReq(req)
-    return commonResultInfo(result, sign, loading)
-}
-
-/**
  * 表单
  * 表单
  */
  */
 export function handleForm() {
 export function handleForm() {

+ 8 - 20
src/views/business/purchase/components/setup.ts

@@ -6,6 +6,8 @@
  *
  *
  */
  */
 
 
+import { commonResultInfo, getRequestResultInfo } from "@/common/methods/request";
+import { operationContractReq } from "@/services/proto/contract";
 import {
 import {
     ErmcpContractOperateApplyReq,
     ErmcpContractOperateApplyReq,
     FundsReq,
     FundsReq,
@@ -13,15 +15,10 @@ import {
     SettlementReq,
     SettlementReq,
     SomePriceReq
     SomePriceReq
 } from "@/services/proto/contract/interface";
 } from "@/services/proto/contract/interface";
-import {operationContractReq} from "@/services/proto/contract";
+import { objectToUint8Array } from "@/utils/objHandle";
+import { purchaseStateSign } from "@/views/business/purchase/setup";
 import Long from "long";
 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";
-import {ermcpInOutStockApplyReq} from "@/services/proto/warehouse";
-import {ERMCPAreaInOutStockApplyReq} from "@/services/proto/warehouse/interface";
+import { Ref } from "vue";
 
 
 /**
 /**
  * 这里负责 点价登记, 交收登记, 款项登记, 发票登记, 入库登记
  * 这里负责 点价登记, 交收登记, 款项登记, 发票登记, 入库登记
@@ -50,7 +47,7 @@ export function settlementReq(spotcontractid: string, req: SettlementReq, loadin
 /**
 /**
  * 款项登记
  * 款项登记
  */
  */
-export function fundsReq(spotcontractid: string, req: FundsReq, loading: Ref<boolean>,Remark:String): Promise<string> {
+export function fundsReq(spotcontractid: string, req: FundsReq, loading: Ref<boolean>, Remark: String): Promise<string> {
     return operationContractRsp(3,
     return operationContractRsp(3,
         operationContractReqBuilder(req, spotcontractid, 3),
         operationContractReqBuilder(req, spotcontractid, 3),
         loading)
         loading)
@@ -65,15 +62,6 @@ export function invoiceReq(spotcontractid: string, req: InvoiceReq, loading: Ref
         loading)
         loading)
 }
 }
 
 
-/**
- * 入库登记
- */
-export function storageReq(req: ERMCPAreaInOutStockApplyReq, loading: Ref<boolean>): Promise<string>{
-    const sign = getRequestResultInfo(purchaseStateSign, 5)  // 接口请求后的返回提示 这里统一进行管理
-    const result = ermcpInOutStockApplyReq(req)
-    return commonResultInfo(result, sign, loading)
-}
-
 
 
 /**
 /**
  * 请求报文组装
  * 请求报文组装
@@ -81,10 +69,10 @@ export function storageReq(req: ERMCPAreaInOutStockApplyReq, loading: Ref<boolea
  * @param id 操作的合同id
  * @param id 操作的合同id
  * @param type 操作类型
  * @param type 操作类型
  */
  */
-export function operationContractReqBuilder(req: Object, id: string, type: number,Remark?:String): ErmcpContractOperateApplyReq {
+export function operationContractReqBuilder(req: Object, id: string, type: number, Remark?: String): ErmcpContractOperateApplyReq {
     return {
     return {
         OperateType: 1, // uint32 操作类型-1:登记2:确认3:拒绝4:撤销
         OperateType: 1, // uint32 操作类型-1:登记2:确认3:拒绝4:撤销
-        Remark:'',
+        Remark: '',
         Info: {
         Info: {
             OperateApplyType: type, // uint32 操作申请类型-1:点价2:结算3:款项4:发票
             OperateApplyType: type, // uint32 操作申请类型-1:点价2:结算3:款项4:发票
             RelatedID: Long.fromString(id), // uint64 现货合同ID(602+Unix秒时间戳(10位)+xxxxxx)
             RelatedID: Long.fromString(id), // uint64 现货合同ID(602+Unix秒时间戳(10位)+xxxxxx)

+ 8 - 13
src/views/business/purchase/components/storage/index.vue

@@ -131,12 +131,10 @@
 </template>
 </template>
 
 
 <script lang="ts">
 <script lang="ts">
-import { defineComponent, PropType, ref, unref, reactive, watchEffect } from 'vue';
+import { defineComponent, PropType, ref, unref, watchEffect } from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
 import { closeModal } from '@/common/setup/modal/index';
-import { SomePriceReq } from '@/services/proto/contract/interface';
-import { somePriceReq, storageReq } from '@/views/business/purchase/components/setup';
 import { Ermcp3SellBuyContract } from '@/services/go/ermcp/purchase/interface';
 import { Ermcp3SellBuyContract } from '@/services/go/ermcp/purchase/interface';
-import { Ermcp3AreaStockApply, ERMCPAreaInOutStockApplyReq } from '@/services/proto/warehouse/interface';
+import { ERMCPAreaInOutStockApplyReq } from '@/services/proto/warehouse/interface';
 import { QueryAreaStockApply, QueryWareHouse } from '@/services/go/ermcp/warehouse-info/index';
 import { QueryAreaStockApply, QueryWareHouse } from '@/services/go/ermcp/warehouse-info/index';
 import * as Long from 'long';
 import * as Long from 'long';
 import { formatValue } from '@/common/methods';
 import { formatValue } from '@/common/methods';
@@ -144,10 +142,10 @@ import { handleForm } from './setup';
 import APP from '@/services';
 import APP from '@/services';
 import { initData } from '@/common/methods';
 import { initData } from '@/common/methods';
 import { ErmcpWareHouseInfo } from '@/views/information/warehouse-info/list';
 import { ErmcpWareHouseInfo } from '@/views/information/warehouse-info/list';
-import { QueryMiddleGoodsChange } from '@/services/go/ermcp/goodsInfo';
-import { ErmcpMiddleGoodsChangeLog } from '@/services/go/ermcp/goodsInfo/interface';
+import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { message } from 'ant-design-vue';
 import { message } from 'ant-design-vue';
 import { Ermcp3AreaStockApplySum } from '@/services/go/ermcp/warehouse-info/interface';
 import { Ermcp3AreaStockApplySum } from '@/services/go/ermcp/warehouse-info/interface';
+import { ermcpInOutStockApplyReq } from '@/services/proto/warehouse';
 
 
 export default defineComponent({
 export default defineComponent({
     name: 'purchase_pending_storage',
     name: 'purchase_pending_storage',
@@ -201,13 +199,10 @@ export default defineComponent({
                     Qty: formState.Qty || 0, // double 数量t
                     Qty: formState.Qty || 0, // double 数量t
                     ApplyRemark: '', // string 申请备注
                     ApplyRemark: '', // string 申请备注
                 };
                 };
-                // 入库
-                storageReq(params, loading)
-                    .then((res) => {
-                        cancel();
-                        context.emit('refresh');
-                    })
-                    .catch((err) => {});
+                requestResultLoadingAndInfo(ermcpInOutStockApplyReq, params, loading, ['入库登记成功', '入库登记失败:']).then(() => {
+                    context.emit('refresh');
+                    cancel();
+                });
             });
             });
         }
         }
         return {
         return {

+ 0 - 18
src/views/information/custom/compoments/setup.ts

@@ -1,18 +0,0 @@
-import {
-    QueryModifyUserInfoApply,
-} from "@/services/go/ermcp/customInfo";
-import {ModifyUserInfoApplyReq} from "@/services/go/ermcp/customInfo/interface";
-import {Ref} from "vue";
-import {commonResultInfo, getRequestResultInfo} from "@/common/methods/request";
-import {ChangeCustomInfoSign} from "@/views/information/custom/setup";
-
-/**
- * 修改用户申请
- * @param type: 2新 增, type: 1保存草稿
- */
-export function modifyUserInfo(type: number, userInfoApply: ModifyUserInfoApplyReq, loading: Ref<boolean>): Promise<string>{
-    loading.value = true;
-    const sign = getRequestResultInfo(ChangeCustomInfoSign, type)  // 接口请求后的返回提示 这里统一进行管理
-    const result = QueryModifyUserInfoApply(userInfoApply)
-    return commonResultInfo(result, sign, loading)
-}

+ 123 - 123
src/views/information/goods/components/recover/index.vue

@@ -1,126 +1,126 @@
 <template>
 <template>
-    <!-- 恢复客户资料-->
-    <a-modal class="modify-custom"
-             title="恢复客户资料"
-             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="recover">完成
-            </a-button>
-        </template>
-        <a-form class="inlineForm"
-                :form="form"
-                @submit="handleSearch">
-            <a-row :gutter="24">
-                <a-col :span="12">
-                    <a-form-item label="客户类型">
-                        <span class="white">{{ selectedRow.userinfotype === '2' ? '企业' : '个人' }}</span>
-                    </a-form-item>
-                </a-col>
-                <a-col :span="12">
-                    <a-form-item label="企业名称">
-                        <span class="white">{{ formatValue(selectedRow.customername) }}</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.nickname) }}</span>
-                    </a-form-item>
-                </a-col>
-                <a-col :span="12">
-                    <a-form-item label="证件类型">
-                        <span class="white">{{ formatValue(selectedRow.cardtypename) }}</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.legalpersonname) }}</span>
-                    </a-form-item>
-                </a-col>
-                <a-col :span="12">
-                    <a-form-item label="证件号码">
-                        <span class="white">{{ formatValue(selectedRow.cardnum) }}</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.taxpayernum) }}</span>
-                    </a-form-item>
-                </a-col>
-                <a-col :span="12">
-                    <a-form-item label="营业执照">
-                        <div class="upload">
-                            <div class="look">查看附件</div>
-                        </div>
-                    </a-form-item>
-                </a-col>
-            </a-row>
-            <a-row :gutter="24">
-                <a-col :span="12">
-                    <a-form-item label="联系人">
-                        <span class="white">{{ formatValue(selectedRow.contactname) }}</span>
-                    </a-form-item>
-                </a-col>
-                <a-col :span="12">
-                    <a-form-item label="联系人手机号">
-                        <span class="white">{{ formatValue(selectedRow.mobile) }}</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.telphone) }}</span>
-                    </a-form-item>
-                </a-col>
-                <a-col :span="12">
-                    <a-form-item label="状态">
-                        <span class="green">{{ formatValue(getStatusName(selectedRow.status)) }}</span>
-                    </a-form-item>
-                </a-col>
-            </a-row>
-            <a-row :gutter="24">
-                <a-col :span="24">
-                    <a-form-item label="通讯地址">
-                        <span class="white">{{ formatValue(selectedRow.address) }}</span>
-                    </a-form-item>
-                </a-col>
-            </a-row>
-            <a-row :gutter="24">
-                <a-col :span="24">
-                    <a-form-item label="备注">
-                        <span class="white">{{ formatValue(selectedRow.remark) }}</span>
-                    </a-form-item>
-                </a-col>
-            </a-row>
-        </a-form>
-    </a-modal>
+  <!-- 恢复客户资料-->
+  <a-modal class="modify-custom"
+           title="恢复客户资料"
+           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="recover">完成
+      </a-button>
+    </template>
+    <a-form class="inlineForm"
+            :form="form"
+            @submit="handleSearch">
+      <a-row :gutter="24">
+        <a-col :span="12">
+          <a-form-item label="客户类型">
+            <span class="white">{{ selectedRow.userinfotype === '2' ? '企业' : '个人' }}</span>
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="企业名称">
+            <span class="white">{{ formatValue(selectedRow.customername) }}</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.nickname) }}</span>
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="证件类型">
+            <span class="white">{{ formatValue(selectedRow.cardtypename) }}</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.legalpersonname) }}</span>
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="证件号码">
+            <span class="white">{{ formatValue(selectedRow.cardnum) }}</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.taxpayernum) }}</span>
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="营业执照">
+            <div class="upload">
+              <div class="look">查看附件</div>
+            </div>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-col :span="12">
+          <a-form-item label="联系人">
+            <span class="white">{{ formatValue(selectedRow.contactname) }}</span>
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="联系人手机号">
+            <span class="white">{{ formatValue(selectedRow.mobile) }}</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.telphone) }}</span>
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="状态">
+            <span class="green">{{ formatValue(getStatusName(selectedRow.status)) }}</span>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-col :span="24">
+          <a-form-item label="通讯地址">
+            <span class="white">{{ formatValue(selectedRow.address) }}</span>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-col :span="24">
+          <a-form-item label="备注">
+            <span class="white">{{ formatValue(selectedRow.remark) }}</span>
+          </a-form-item>
+        </a-col>
+      </a-row>
+    </a-form>
+  </a-modal>
 </template>
 </template>
 
 
 <script lang="ts">
 <script lang="ts">
-import {defineComponent, PropType, ref} from 'vue';
-import {closeModal} from '@/common/setup/modal/index';
-import {QueryCustomInfoType, UpdateUserAccountReq} from "@/services/go/ermcp/customInfo/interface";
-import {formatValue} from "@/common/methods";
+import { defineComponent, PropType, ref } from 'vue';
+import { closeModal } from '@/common/setup/modal/index';
+import { QueryCustomInfoType, UpdateUserAccountReq } from '@/services/go/ermcp/customInfo/interface';
+import { formatValue } from '@/common/methods';
 import { getStatusName } from '@/common/constants/enumsName';
 import { getStatusName } from '@/common/constants/enumsName';
-import {Modal} from "ant-design-vue";
-import {requestResultLoadingAndInfo} from "@/common/methods/request/resultInfo";
-import {UpdateUserAccountStatus} from "@/services/go/ermcp/customInfo";
+import { Modal } from 'ant-design-vue';
+import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
+import { UpdateUserAccountStatus } from '@/services/go/ermcp/customInfo';
 
 
 export default defineComponent({
 export default defineComponent({
     name: 'modify-custom',
     name: 'modify-custom',
@@ -132,10 +132,10 @@ export default defineComponent({
         },
         },
     },
     },
     setup(props, context) {
     setup(props, context) {
-        const {visible, cancel} = closeModal('custom_info_btn_recover');
-        const {loading, ModifyUserInfo} = updateUserAccount();
+        const { visible, cancel } = closeModal('custom_info_btn_recover');
+        const loading = ref<boolean>(false);
         // 恢复方法
         // 恢复方法
-        function recover(){
+        function recover() {
             Modal.confirm({
             Modal.confirm({
                 title: '是否确认恢复客户资料',
                 title: '是否确认恢复客户资料',
                 okText: '确认恢复',
                 okText: '确认恢复',
@@ -143,8 +143,8 @@ export default defineComponent({
                 onOk() {
                 onOk() {
                     let reqParams: UpdateUserAccountReq = {
                     let reqParams: UpdateUserAccountReq = {
                         userID: props.selectedRow.userid,
                         userID: props.selectedRow.userid,
-                        accountStatus: 4
-                    }
+                        accountStatus: 4,
+                    };
                     requestResultLoadingAndInfo(UpdateUserAccountStatus, reqParams, loading, ['恢复成功', '恢复失败:']).then(() => {
                     requestResultLoadingAndInfo(UpdateUserAccountStatus, reqParams, loading, ['恢复成功', '恢复失败:']).then(() => {
                         cancel();
                         cancel();
                         context.emit('refresh');
                         context.emit('refresh');

+ 94 - 91
src/views/information/warehouse-info/compoments/disable/index.vue

@@ -1,86 +1,89 @@
 <template>
 <template>
-    <!-- 停用仓库信息-->
-    <a-modal class="commonModal warehouse-disable"
-             title="停用仓库信息"
-             v-model:visible="visible"
-             centered
-             :maskClosable="maskClosableFlag"
-             @cancel="cancel"
-             width="890px">
-        <template #footer>
-            <a-button key="cancel"
-                      class="cancelBtn"
-                      @click="cancel">取消
-            </a-button>
-            <a-button key="submit"
-                      type="primary"
-                      :loading="loading"
-                      @click="submit">确认停用
-            </a-button>
-        </template>
-        <a-form class="inlineForm"
-                :form="form"
-                @submit="handleSearch">
-            <a-row :gutter="24">
-                <a-col :span="12">
-                    <a-form-item label="仓库类型">
-                        <span class="white">{{ getWareHouseTypeName(selectedRow.warehousetype) }}</span>
-                    </a-form-item>
-                </a-col>
-                <a-col :span="12">
-                    <a-form-item label="仓库名称">
-                        <span class="white">{{ formatValue(selectedRow.warehousename) }}</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.warehousecode) }}</span>
-                    </a-form-item>
-                </a-col>
-                <a-col :span="12">
-                    <a-form-item label="联系人">
-                        <span class="white">{{ formatValue(selectedRow.contactname) }}</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.contactnum) }}</span>
-                    </a-form-item>
-                </a-col>
-                <a-col :span="12">
-                    <a-form-item label="状态">
-                        <span class="white">{{ gerWareHouseStatusName(selectedRow.warehousestatus) }}</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.address) }}</span>
-                    </a-form-item>
-                </a-col>
-                <a-col :span="12">
-                    <a-form-item label="详细地址">
-                        <span class="white">{{ formatValue(selectedRow.address) }}</span>
-                    </a-form-item>
-                </a-col>
-            </a-row>
-        </a-form>
-    </a-modal>
+  <!-- 停用仓库信息-->
+  <a-modal class="commonModal warehouse-disable"
+           title="停用仓库信息"
+           v-model:visible="visible"
+           centered
+           :maskClosable="maskClosableFlag"
+           @cancel="cancel"
+           width="890px">
+    <template #footer>
+      <a-button key="cancel"
+                class="cancelBtn"
+                @click="cancel">取消
+      </a-button>
+      <a-button key="submit"
+                type="primary"
+                :loading="loading"
+                @click="submit">确认停用
+      </a-button>
+    </template>
+    <a-form class="inlineForm"
+            :form="form"
+            @submit="handleSearch">
+      <a-row :gutter="24">
+        <a-col :span="12">
+          <a-form-item label="仓库类型">
+            <span class="white">{{ getWareHouseTypeName(selectedRow.warehousetype) }}</span>
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="仓库名称">
+            <span class="white">{{ formatValue(selectedRow.warehousename) }}</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.warehousecode) }}</span>
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="联系人">
+            <span class="white">{{ formatValue(selectedRow.contactname) }}</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.contactnum) }}</span>
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="状态">
+            <span class="white">{{ gerWareHouseStatusName(selectedRow.warehousestatus) }}</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.address) }}</span>
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="详细地址">
+            <span class="white">{{ formatValue(selectedRow.address) }}</span>
+          </a-form-item>
+        </a-col>
+      </a-row>
+    </a-form>
+  </a-modal>
 </template>
 </template>
 
 
 <script lang="ts">
 <script lang="ts">
-import {defineComponent, PropType, ref} from 'vue';
-import {closeModal} from '@/common/setup/modal/index';
-import {stopOrResumeWarehouse, wareType} from "@/views/information/warehouse-info/compoments/setup";
-import {ErmcpWareHouseInfo} from "@/services/go/ermcp/warehouse-info/interface";
-import {message, Modal} from "ant-design-vue";
-import {gerWareHouseStatusName, getWareHouseTypeName} from "@/views/information/warehouse-info/setup";
-import {formatValue} from "@/common/methods";
+import { defineComponent, PropType, ref } from 'vue';
+import { closeModal } from '@/common/setup/modal/index';
+import { ErmcpWareHouseInfo } from '@/services/go/ermcp/warehouse-info/interface';
+import { Modal } from 'ant-design-vue';
+import { gerWareHouseStatusName, getWareHouseTypeName } from '@/views/information/warehouse-info/setup';
+import { formatValue } from '@/common/methods';
+import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
+import { getSelectedAccountId } from '@/services/bus/account';
+import { WarehouseStateChangeReq } from '@/services/proto/warehouse/interface';
+import { warehouseStateChangeReq } from '@/services/proto/warehouse';
 
 
 export default defineComponent({
 export default defineComponent({
     name: 'warehouse_info_btn_disable',
     name: 'warehouse_info_btn_disable',
@@ -92,9 +95,9 @@ export default defineComponent({
         },
         },
     },
     },
     setup(props, context) {
     setup(props, context) {
-        const {visible, cancel} = closeModal('warehouse_info_btn_disable');
+        const { visible, cancel } = closeModal('warehouse_info_btn_disable');
         const maskClosableFlag = ref<boolean>(false);
         const maskClosableFlag = ref<boolean>(false);
-        const {loading, changeStatus} = stopOrResumeWarehouse(wareType.stop);
+        const loading = ref<boolean>(false);
 
 
         function submit() {
         function submit() {
             loading.value = true;
             loading.value = true;
@@ -104,16 +107,16 @@ export default defineComponent({
                 cancelText: '取消',
                 cancelText: '取消',
                 onOk() {
                 onOk() {
                     console.log('OK');
                     console.log('OK');
-                    changeStatus(props.selectedRow.autoid)
-                        .then(res => {
-
-                            message.success(res)
-                            context.emit('refresh')
-                            cancel()
-                        })
-                        .catch(err => {
-                            message.error(err)
-                        })
+                    const accountid = getSelectedAccountId()?.toNumber();
+                    const req: WarehouseStateChangeReq = {
+                        accountid: accountid === undefined ? 0 : accountid,
+                        warehouseid: props.selectedRow.autoid,
+                        warehousestatus: 2,
+                    };
+                    requestResultLoadingAndInfo(warehouseStateChangeReq, req, loading, ['停用仓库成功', '停用仓库失败:']).then(() => {
+                        context.emit('refresh');
+                        cancel();
+                    });
                 },
                 },
                 onCancel() {
                 onCancel() {
                     console.log('Cancel');
                     console.log('Cancel');

+ 94 - 91
src/views/information/warehouse-info/compoments/recover/index.vue

@@ -1,86 +1,89 @@
 <template>
 <template>
-    <!-- 恢复仓库信息-->
-    <a-modal class="commonModal modify-custom"
-             title="恢复仓库信息"
-             v-model:visible="visible"
-             centered
-             :maskClosable="maskClosableFlag"
-             @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>
-        <a-form class="inlineForm"
-                :form="form"
-                @submit="handleSearch">
-            <a-row :gutter="24">
-                <a-col :span="12">
-                    <a-form-item label="仓库类型">
-                        <span class="white">{{ getWareHouseTypeName(selectedRow.warehousetype) }}</span>
-                    </a-form-item>
-                </a-col>
-                <a-col :span="12">
-                    <a-form-item label="仓库名称">
-                        <span class="white">{{ formatValue(selectedRow.warehousename) }}</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.warehousecode) }}</span>
-                    </a-form-item>
-                </a-col>
-                <a-col :span="12">
-                    <a-form-item label="联系人">
-                        <span class="white">{{ formatValue(selectedRow.contactname) }}</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.contactnum) }}</span>
-                    </a-form-item>
-                </a-col>
-                <a-col :span="12">
-                    <a-form-item label="状态">
-                        <span class="white">{{ gerWareHouseStatusName(selectedRow.warehousestatus) }}</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.address) }}</span>
-                    </a-form-item>
-                </a-col>
-                <a-col :span="12">
-                    <a-form-item label="详细地址">
-                        <span class="white">{{ formatValue(selectedRow.address) }}</span>
-                    </a-form-item>
-                </a-col>
-            </a-row>
-        </a-form>
-    </a-modal>
+  <!-- 恢复仓库信息-->
+  <a-modal class="commonModal modify-custom"
+           title="恢复仓库信息"
+           v-model:visible="visible"
+           centered
+           :maskClosable="maskClosableFlag"
+           @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>
+    <a-form class="inlineForm"
+            :form="form"
+            @submit="handleSearch">
+      <a-row :gutter="24">
+        <a-col :span="12">
+          <a-form-item label="仓库类型">
+            <span class="white">{{ getWareHouseTypeName(selectedRow.warehousetype) }}</span>
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="仓库名称">
+            <span class="white">{{ formatValue(selectedRow.warehousename) }}</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.warehousecode) }}</span>
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="联系人">
+            <span class="white">{{ formatValue(selectedRow.contactname) }}</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.contactnum) }}</span>
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="状态">
+            <span class="white">{{ gerWareHouseStatusName(selectedRow.warehousestatus) }}</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.address) }}</span>
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="详细地址">
+            <span class="white">{{ formatValue(selectedRow.address) }}</span>
+          </a-form-item>
+        </a-col>
+      </a-row>
+    </a-form>
+  </a-modal>
 </template>
 </template>
 
 
 <script lang="ts">
 <script lang="ts">
-import {defineComponent, PropType, ref} from 'vue';
-import {closeModal} from '@/common/setup/modal/index';
-import {ErmcpWareHouseInfo} from "@/services/go/ermcp/warehouse-info/interface";
-import {stopOrResumeWarehouse, wareType} from "@/views/information/warehouse-info/compoments/setup";
-import {message, Modal} from "ant-design-vue";
-import {gerWareHouseStatusName, getWareHouseTypeName} from "@/views/information/warehouse-info/setup";
-import {formatValue} from "@/common/methods";
+import { defineComponent, PropType, ref } from 'vue';
+import { closeModal } from '@/common/setup/modal/index';
+import { ErmcpWareHouseInfo } from '@/services/go/ermcp/warehouse-info/interface';
+import { Modal } from 'ant-design-vue';
+import { gerWareHouseStatusName, getWareHouseTypeName } from '@/views/information/warehouse-info/setup';
+import { formatValue } from '@/common/methods';
+import { getSelectedAccountId } from '@/services/bus/account';
+import { WarehouseStateChangeReq } from '@/services/proto/warehouse/interface';
+import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
+import { warehouseStateChangeReq } from '@/services/proto/warehouse';
 
 
 export default defineComponent({
 export default defineComponent({
     name: 'warehouse_info_btn_recover',
     name: 'warehouse_info_btn_recover',
@@ -92,8 +95,8 @@ export default defineComponent({
         },
         },
     },
     },
     setup(props, context) {
     setup(props, context) {
-        const {visible, cancel} = closeModal('warehouse_info_btn_recover');
-        const {loading, changeStatus} = stopOrResumeWarehouse(wareType.normal);
+        const { visible, cancel } = closeModal('warehouse_info_btn_recover');
+        const loading = ref<boolean>(false);
         const maskClosableFlag = ref<boolean>(false);
         const maskClosableFlag = ref<boolean>(false);
 
 
         function submit() {
         function submit() {
@@ -103,16 +106,16 @@ export default defineComponent({
                 okText: '确认恢复',
                 okText: '确认恢复',
                 cancelText: '取消',
                 cancelText: '取消',
                 onOk() {
                 onOk() {
-                    console.log('OK');
-                    changeStatus(props.selectedRow.autoid)
-                        .then(res => {
-                            message.success(res)
-                            context.emit('refresh')
-                            cancel()
-                        })
-                        .catch(err => {
-                            message.error(err)
-                        })
+                    const accountid = getSelectedAccountId()?.toNumber();
+                    const req: WarehouseStateChangeReq = {
+                        accountid: accountid === undefined ? 0 : accountid,
+                        warehouseid: props.selectedRow.autoid,
+                        warehousestatus: 1,
+                    };
+                    requestResultLoadingAndInfo(warehouseStateChangeReq, req, loading, ['恢复仓库成功', '恢复仓库失败:']).then(() => {
+                        context.emit('refresh');
+                        cancel();
+                    });
                 },
                 },
                 onCancel() {
                 onCancel() {
                     console.log('Cancel');
                     console.log('Cancel');

+ 2 - 56
src/views/information/warehouse-info/compoments/setup.ts

@@ -1,66 +1,12 @@
 import { commonResultInfo, getRequestResultInfo } from "@/common/methods/request";
 import { commonResultInfo, getRequestResultInfo } from "@/common/methods/request";
 import { validateCommon } from "@/common/setup/validate";
 import { validateCommon } from "@/common/setup/validate";
-import { getSelectedAccountId } from "@/services/bus/account";
-import { addWarehouseApply, warehouseStateChangeReq } from "@/services/proto/warehouse";
-import { WarehouseApplyReq, WarehouseStateChangeReq } from "@/services/proto/warehouse/interface";
+import { addWarehouseApply } from "@/services/proto/warehouse";
+import { WarehouseApplyReq } from "@/services/proto/warehouse/interface";
 import { message } from "ant-design-vue";
 import { message } from "ant-design-vue";
 import { RuleObject } from "ant-design-vue/lib/form/interface";
 import { RuleObject } from "ant-design-vue/lib/form/interface";
 import { reactive, Ref, ref } from "vue";
 import { reactive, Ref, ref } from "vue";
 import { warehouseApplyRequestResultMsg } from "../setup";
 import { warehouseApplyRequestResultMsg } from "../setup";
 
 
-export const enum wareType {
-    normal = 1, // 正常
-    stop = 2, // 停用
-}
-
-/**
- * 更变仓库信息状态
- * @param type normal: 将停用恢复成正常  stop: 将正常设置为停用
- */
-export function stopOrResumeWarehouse(type: wareType) {
-    const loading = ref<boolean>(false);
-    let warehousestatus = 1;
-    switch (type) {
-        case wareType.normal:
-            warehousestatus = 1  // 恢复
-            break;
-        case wareType.stop:
-            warehousestatus = 2  // 停用
-            break;
-    }
-    /**
-     * 提交切换状态请求
-     * @param warehouseid 操作的仓库id
-     */
-    function changeStatus(warehouseid: number): Promise<string> {
-        const accountid = getSelectedAccountId()?.toNumber()
-        const req: WarehouseStateChangeReq = {
-            accountid: accountid === undefined ? 0 : accountid,
-            warehouseid: warehouseid,
-            warehousestatus: warehousestatus
-        }
-        return warehouseStateChangeReq(req)
-            .then(res => {
-                if (warehousestatus === 1) {
-                    return Promise.resolve("恢复成功")
-                } else {
-                    return Promise.resolve("停用成功")
-                }
-            })
-            .catch(err => {
-                if (warehousestatus === 1) {
-                    return Promise.reject("恢复失败:" + err)
-                } else {
-                    return Promise.reject("停用失败:" + err)
-                }
-            })
-            .finally(() => {
-                loading.value = false
-            })
-    }
-    return { loading, changeStatus }
-}
-
 export interface FormState {
 export interface FormState {
     type: number // int32 类型 1 新增 2 修改
     type: number // int32 类型 1 新增 2 修改
     warehouseid?: number // uint64 仓库ID
     warehouseid?: number // uint64 仓库ID