Prechádzať zdrojové kódy

Merge branch 'master' of http://47.101.159.18:3000/Muchinfo/MTP2.0_WEB

marymelisa 4 rokov pred
rodič
commit
f3dbd5a616
31 zmenil súbory, kde vykonal 1433 pridanie a 861 odobranie
  1. 1 1
      public/config/app.config.json
  2. 1 1
      src/services/bus/account.ts
  3. 2 2
      src/services/go/ermcp/customInfo/index.ts
  4. 1 1
      src/services/go/ermcp/goodsInfo/interface.ts
  5. 11 6
      src/services/proto/delivery/index.ts
  6. 6 6
      src/services/proto/delivery/interface.ts
  7. 2 3
      src/services/request/serviceURL.ts
  8. 0 2
      src/utils/objHandle/index.ts
  9. 1 1
      src/views/information/custom/compoments/add/index.vue
  10. 4 3
      src/views/information/custom/compoments/cancel/index.vue
  11. 3 2
      src/views/information/custom/compoments/check/index.vue
  12. 105 11
      src/views/information/custom/compoments/delete/index.vue
  13. 3 2
      src/views/information/custom/compoments/detail/index.vue
  14. 29 21
      src/views/information/custom/compoments/disable/index.vue
  15. 131 25
      src/views/information/custom/compoments/recover/index.vue
  16. 65 3
      src/views/information/custom/compoments/setup.ts
  17. 62 43
      src/views/information/custom/list/checkpending/index.vue
  18. 58 39
      src/views/information/custom/list/normal-use/index.vue
  19. 1 0
      src/views/information/custom/list/setup.ts
  20. 58 39
      src/views/information/custom/list/stop-use/index.vue
  21. 58 39
      src/views/information/custom/list/unsubmit/index.vue
  22. 12 1
      src/views/information/custom/setup.ts
  23. 379 230
      src/views/information/goods/components/add/index.vue
  24. 33 0
      src/views/information/goods/components/add/interface.ts
  25. 34 0
      src/views/information/goods/components/add/setup.ts
  26. 6 8
      src/views/information/goods/components/leftMenu/index.vue
  27. 253 276
      src/views/information/goods/components/rightSpot/index.vue
  28. 0 13
      src/views/information/goods/components/rightSpot/setup.ts
  29. 6 8
      src/views/information/goods/list/spot-variety/index.vue
  30. 0 75
      src/views/information/goods/list/spot-variety/setup.ts
  31. 108 0
      src/views/information/goods/setup.ts

+ 1 - 1
public/config/app.config.json

@@ -1,3 +1,3 @@
 {
-    "apiUrl": "http://192.168.31.175:8080/cfg?key=test_175"
+    "apiUrl": "http://218.17.158.45:21001/cfg?key=test_175"
 }

+ 1 - 1
src/services/bus/account.ts

@@ -99,6 +99,6 @@ export function getCanUserMoney() {
 /**
  * 获取选中的资金账号(目前 写死第一个,后期账号切换的时候在进行修改)
  */
-export function getSelectedAccount(): LongType | null {
+export function getSelectedAccountId(): LongType | null {
     return getAccount_longType()
 }

+ 2 - 2
src/services/go/ermcp/customInfo/index.ts

@@ -69,11 +69,11 @@ export function QueryDeleteUserInfoApply(userId: number): Promise<BaseResponse>
 
 /**
  * 更新用户状态 /User/UpdateUserAccountStatus
+ * @param userID 需要修改的账户id
  * @param accountStatus 账户状态 - 4:正常 6:注销(停用)
  * @constructor
  */
-export function UpdateUserAccountStatus(accountStatus: number): Promise<BaseResponse> {
-    const userID = APP.get('userAccount').memberuserid;
+export function UpdateUserAccountStatus(userID: number, accountStatus: number): Promise<BaseResponse> {
     return commonUpdate_go('/User/UpdateUserAccountStatus', { userID, accountStatus }, ).catch((err) => {
         throw new Error(`更新用户状态: ${err.message}`);
     });

+ 1 - 1
src/services/go/ermcp/goodsInfo/interface.ts

@@ -102,7 +102,7 @@ export interface ErmcpDeliveryGoods {
 export interface Ermcp3MiddleGoodsDetail2 {
     convertratio: number  // 套保系数(折算系数)
     gplist: Ermcp3GoodsGroupEx[] // 关联商品组列表
-    mg: ErmcpMiddleGoodsModel[] // 套保品种
+    mg: ErmcpMiddleGoodsModel // 套保品种
 }
 
 /**

+ 11 - 6
src/services/proto/delivery/index.ts

@@ -1,7 +1,9 @@
-import {buildProtoReq50, parseProtoRsp50} from "@/services/socket/protobuf/buildReq";
 import APP from "@/services";
-import {Callback} from "@/utils/websocket";
-import {DeliveryGoodsApplyReq} from "@/services/proto/delivery/interface";
+import { getSelectedAccountId, getUserId } from '@/services/bus/account';
+import { getLongTypeLoginID } from '@/services/bus/login';
+import { DeliveryGoodsApplyReq } from "@/services/proto/delivery/interface";
+import { buildProtoReq50, parseProtoRsp50 } from "@/services/socket/protobuf/buildReq";
+import { Callback } from "@/utils/websocket";
 
 /**
  * 现货品种申请请求
@@ -11,15 +13,18 @@ export const addDeliveryGoodsApply = (param: DeliveryGoodsApplyReq): Promise<any
     return new Promise((resolve, reject) => {
         const req = {
             version: "3.2",
+            accountid: getSelectedAccountId(),
+            userid: getUserId(),
+            loginid: getLongTypeLoginID(),
         };
         const params = {
             protobufName: 'DeliveryGoodsApplyReq',
             funCodeName: 'DeliveryGoodsApplyReq',
             reqParams: Object.assign(req, param),
             msgHeadParams: {
-                AccountID: param.accountid,
-                MarketID: 18,
-                GoodsID: 0,
+                AccountID: getSelectedAccountId(),
+                MarketID: 18,   // 目前写死
+                GoodsID: 0, // 目前写死
             }
         };
         const package50 = buildProtoReq50(params);

+ 6 - 6
src/services/proto/delivery/interface.ts

@@ -1,14 +1,14 @@
 // 现货品种申请请求 0 29 124
 export interface DeliveryGoodsApplyReq {
-    accountid: string  // header 需要用到
-    userid: number // uint64 用户ID
-    loginid: number // uint64 登录ID
+    // accountid: string  // header 需要用到
+    // userid: number // uint64 用户ID
+    // loginid: number // uint64 登录ID
     deliverygoodscode?: string // string 交割商品代码(新增时有值)
     deliverygoodsname?: string // string 交割商品名称(新增时有值)
     deliverygoodsid?: number// uint64 交割商品id(修改时有值)
-    unitid: number // uint64 单位ID
+    unitid: number  // uint64 单位ID
     type: number// int32 类型 1 新增 2 修改
-    remark: number // string 备注
+    remark: string // string 备注
     gldwrstandards: GLDWRStandardEx[]; //        GLDWRStandardEx 现货商品型号数据
     glddgfactoryItems: GLDDGFactoryItemEx[] //   GLDDGFactoryItemEx 现货商品品牌数据
     wrsconvertdetails: WRSConvertDetailEx[] // WRSConvertDetailEx 现货商品折算配置明细数据
@@ -19,7 +19,7 @@ export interface DeliveryGoodsApplyReq {
 export interface GLDWRStandardEx {
     wrstandardid?: number // uint64 型号ID(修改时有值)
     wrstandardname: string // string 型号名称
-    unitid: number// uint64 单位ID
+    unitid: number // uint64 单位ID
     convertfactor: number// double 标仓系数(接口为3.1及以上版本时传)
 }
 

+ 2 - 3
src/services/request/serviceURL.ts

@@ -72,12 +72,11 @@ export const commonSearchUrl = (url: string): string => {
 
 export const setServiceURL = (config: URL): void => {
     console.log('URL', config);
-    serviceURL = config;
-
-    // // 外网环境(175),外包同事使用
+    // 外网环境(175),外包同事使用
     // if (process.env.NODE_ENV === 'development') {
     //     serviceURL.goCommonSearchUrl = 'http://218.17.158.45:21001/api';
     //     serviceURL.quoteUrl = 'ws://218.17.158.45:21004';
     //     serviceURL.tradeUrl = 'ws://218.17.158.45:21005';
     // }
+    serviceURL = config;
 };

+ 0 - 2
src/utils/objHandle/index.ts

@@ -11,9 +11,7 @@ interface ObjType {
  */
 export function mergeObj(a: ObjType, ...rest: ObjType[]): void {
     Object.keys(a).forEach((key) => {
-        debugger
         rest.forEach((param) => {
-            debugger
             if (Reflect.has(param, key)) {
                 a[key] = param[key];
             }

+ 1 - 1
src/views/information/custom/compoments/add/index.vue

@@ -274,7 +274,7 @@ import { defineComponent, ref, reactive, toRaw, UnwrapRef } from 'vue';
 import { getCardType, initFormState, handleApply } from './setup';
 import { AllEnums } from '@/services/go/commonService/interface';
 import { FormState } from './interface';
-import { ValidateErrorEntity } from 'ant-design-vue/es/form/interface';
+import { RuleObject, ValidateErrorEntity } from 'ant-design-vue/es/form/interface';
 
 export default defineComponent({
     name: 'add-custom',

+ 4 - 3
src/views/information/custom/compoments/cancel/index.vue

@@ -37,7 +37,7 @@
               </a-col>
               <a-col :span="12">
                   <a-form-item label="证件类型">
-                      <span class="white">{{ formatValue(selectedRow.cardtypename) }}</span>
+                      <span class="white">{{ getCardTypeName(selectedRow.cardtype) }}</span>
                   </a-form-item>
               </a-col>
           </a-row>
@@ -49,7 +49,7 @@
               </a-col>
               <a-col :span="12">
                   <a-form-item label="证件号码">
-                      <span class="white">{{ formatValue(selectedRow.cardnum) }}</span>
+                      <span class="white">{{ getCardTypeName(selectedRow.cardnum) }}</span>
                   </a-form-item>
               </a-col>
           </a-row>
@@ -115,7 +115,7 @@ import { closeModal } from '@/common/setup/modal/index';
 import { Modal } from 'ant-design-vue';
 import {ModifyUserInfoApplyReq, ModifyUserInfoReq, QueryCustomInfoType} from "@/services/go/ermcp/customInfo/interface";
 import {formatValue} from "@/common/methods";
-import {getStatusName} from "@/views/information/custom/setup";
+import {getCardTypeName, getStatusName} from "@/views/information/custom/setup";
 import {cancelCustomInfo} from "@/views/information/custom/compoments/setup";
 import {getUserId} from "@/services/bus/account";
 
@@ -165,6 +165,7 @@ export default defineComponent({
             loading,
             formatValue,
             getStatusName,
+            getCardTypeName,
         };
     },
 });

+ 3 - 2
src/views/information/custom/compoments/check/index.vue

@@ -41,7 +41,7 @@
               </a-col>
               <a-col :span="12">
                   <a-form-item label="证件类型">
-                      <span class="white">{{ formatValue(selectedRow.cardtypename) }}</span>
+                      <span class="white">{{ getCardTypeName(selectedRow.cardtype) }}</span>
                   </a-form-item>
               </a-col>
           </a-row>
@@ -118,7 +118,7 @@ import {defineComponent, PropType, ref} from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
 import {ModifyUserInfoReq, QueryCustomInfoType} from "@/services/go/ermcp/customInfo/interface";
 import {formatValue} from "@/common/methods";
-import {getStatusName} from "@/views/information/custom/setup";
+import {getCardTypeName, getStatusName} from "@/views/information/custom/setup";
 import {cancelCustomInfo, checkCustomInfo} from "@/views/information/custom/compoments/setup";
 import {UserInfoCheckMangeReq} from "@/services/proto/accountinfo/interface";
 import {getSelectedAccount, getUserId} from "@/services/bus/account";
@@ -158,6 +158,7 @@ export default defineComponent({
             refuseSubmit,
             formatValue,
             getStatusName,
+            getCardTypeName,
         };
     },
 });

+ 105 - 11
src/views/information/custom/compoments/delete/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <!-- 恢复客户资料-->
+  <!-- 删除客户资料-->
   <a-modal class="recover-custom"
            title="恢复客户资料"
            v-model:visible="visible"
@@ -9,27 +9,121 @@
       <a-button key="submit"
                 type="primary"
                 :loading="loading"
-                @click="submit">完成</a-button>
+                @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">{{ 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="营业执照">
+                      <a class="blue">查看附件</a>
+                  </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>
 
 <script lang="ts">
-import { defineComponent, ref } from 'vue';
+import {defineComponent, PropType, ref} from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
+import {deleteUserInfo} from "@/views/information/custom/compoments/setup";
+import {QueryCustomInfoType} from "@/services/go/ermcp/customInfo/interface";
 
 export default defineComponent({
     name: 'recover-custom',
     components: {},
-    setup() {
+    props: {
+        selectedRow: {
+            type: Object as PropType<QueryCustomInfoType>,
+            default: {},
+        },
+    },
+    setup(props) {
         const { visible, cancel } = closeModal('custom_info_btn_delete');
-        const loading = ref<boolean>(false);
-        function submit() {
-            loading.value = true;
-            setTimeout(() => {
-                loading.value = false;
-                cancel();
-            }, 2000);
+        const {loading, deleteCustomerInfo} = deleteUserInfo();
+        function submit(){
+            deleteCustomerInfo(props.selectedRow.userid, cancel)
         }
         return {
             visible,

+ 3 - 2
src/views/information/custom/compoments/detail/index.vue

@@ -36,7 +36,7 @@
         </a-col>
         <a-col :span="12">
           <a-form-item label="证件类型">
-            <span class="white">{{ formatValue(selectedRow.cardtypename) }}</span>
+            <span class="white">{{ getCardTypeName(selectedRow.cardtype) }}</span>
           </a-form-item>
         </a-col>
       </a-row>
@@ -113,7 +113,7 @@ import { defineComponent, PropType, reactive, ref, watchEffect } from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
 import { QueryCustomInfoType } from '@/services/go/ermcp/customInfo/interface';
 import { mergeObj } from '@/utils/objHandle';
-import { getStatusName } from '@/views/information/custom/setup';
+import {getCardTypeName, getStatusName} from '@/views/information/custom/setup';
 import { formatValue, formatTime } from '@/common/methods';
 
 export default defineComponent({
@@ -146,6 +146,7 @@ export default defineComponent({
             formatValue,
             getStatusName,
             maskClosableFlag,
+            getCardTypeName,
         };
     },
 });

+ 29 - 21
src/views/information/custom/compoments/disable/index.vue

@@ -22,43 +22,43 @@
       <a-row :gutter="24">
         <a-col :span="12">
           <a-form-item label="客户类型">
-            <span class="white">企业</span>
+            <span class="white">{{ selectedRow.userinfotype === '2' ? '企业' : '个人' }}</span>
           </a-form-item>
         </a-col>
         <a-col :span="12">
           <a-form-item label="企业名称">
-            <span class="white">深圳市前海矿业有限公司</span>
+            <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">前海矿业</span>
+            <span class="white">{{ formatValue(selectedRow.nickname) }}</span>
           </a-form-item>
         </a-col>
         <a-col :span="12">
           <a-form-item label="证件类型">
-            <span class="white">营业执照</span>
+            <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">李顺利</span>
+            <span class="white">{{ formatValue(selectedRow.legalpersonname) }}</span>
           </a-form-item>
         </a-col>
         <a-col :span="12">
           <a-form-item label="证件号码">
-            <span class="white">4328648236492432</span>
+            <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">57465736DR46456</span>
+            <span class="white">{{ formatValue(selectedRow.taxpayernum) }}</span>
           </a-form-item>
         </a-col>
         <a-col :span="12">
@@ -70,38 +70,38 @@
       <a-row :gutter="24">
         <a-col :span="12">
           <a-form-item label="联系人">
-            <span class="white">王平</span>
+            <span class="white">{{ formatValue(selectedRow.contactname) }}</span>
           </a-form-item>
         </a-col>
         <a-col :span="12">
           <a-form-item label="联系人手机号">
-            <span class="white">13745653421</span>
+            <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">0755-34342544</span>
+            <span class="white">{{ formatValue(selectedRow.telphone) }}</span>
           </a-form-item>
         </a-col>
         <a-col :span="12">
           <a-form-item label="状态">
-            <span class="green">正常</span>
+            <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">广东省深圳市南山区前海街道路平路1324号</span>
+            <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"></span>
+            <span class="white">{{ formatValue(selectedRow.remark) }}</span>
           </a-form-item>
         </a-col>
       </a-row>
@@ -110,22 +110,28 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, ref } from 'vue';
+import {defineComponent, PropType, ref} from 'vue';
 import { closeModal } from '@/common/setup/modal/index';
+import {updateUserAccount} from "@/views/information/custom/compoments/setup";
+import {QueryCustomInfoType} from "@/services/go/ermcp/customInfo/interface";
+import {formatValue} from "@/common/methods";
+import {getStatusName} from "@/views/information/custom/setup";
 
 export default defineComponent({
     name: 'custom-disable',
     components: {},
-    setup() {
+    props: {
+        selectedRow: {
+            type: Object as PropType<QueryCustomInfoType>,
+            default: {},
+        },
+    },
+    setup(props) {
         const { visible, cancel } = closeModal('custom_info_btn_disable');
-        const loading = ref<boolean>(false);
         const maskClosableFlag = ref<boolean>(false);
+        const  {loading, ModifyUserInfo} = updateUserAccount();
         function submit() {
-            loading.value = true;
-            setTimeout(() => {
-                loading.value = false;
-                cancel();
-            }, 2000);
+            ModifyUserInfo(props.selectedRow.userid, 6, cancel);
         }
         return {
             visible,
@@ -133,6 +139,8 @@ export default defineComponent({
             submit,
             loading,
             maskClosableFlag,
+            formatValue,
+            getStatusName,
         };
     },
 });

+ 131 - 25
src/views/information/custom/compoments/recover/index.vue

@@ -1,41 +1,147 @@
 <template>
-  <!-- 恢复客户资料-->
-  <a-modal class="modify-custom"
-           title="恢复客户资料"
-           v-model:visible="visible"
-           @cancel="cancel"
-           width="890px">
-    <template #footer>
-      <a-button key="submit"
-                type="primary"
-                :loading="loading"
-                @click="submit">完成</a-button>
-    </template>
-  </a-modal>
+    <!-- 恢复客户资料-->
+    <a-modal class="modify-custom"
+             title="恢复客户资料"
+             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="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>
 
 <script lang="ts">
-import { defineComponent, ref } from 'vue';
-import { closeModal } from '@/common/setup/modal/index';
+import {defineComponent, PropType, ref} from 'vue';
+import {closeModal} from '@/common/setup/modal/index';
+import {QueryCustomInfoType} from "@/services/go/ermcp/customInfo/interface";
+import {formatValue} from "@/common/methods";
+import {getStatusName} from "@/views/information/custom/setup";
+import {updateUserAccount} from "@/views/information/custom/compoments/setup";
 
 export default defineComponent({
     name: 'modify-custom',
     components: {},
-    setup() {
-        const { visible, cancel } = closeModal('custom_info_btn_recover');
-        const loading = ref<boolean>(false);
-        function submit() {
-            loading.value = true;
-            setTimeout(() => {
-                loading.value = false;
-                cancel();
-            }, 2000);
+    props: {
+        selectedRow: {
+            type: Object as PropType<QueryCustomInfoType>,
+            default: {},
+        },
+    },
+    setup(props) {
+        const {visible, cancel} = closeModal('custom_info_btn_recover');
+        const {loading, ModifyUserInfo} = updateUserAccount();
+        // 恢复方法
+        function recover(){
+            ModifyUserInfo(props.selectedRow.userid, 4, cancel);
         }
         return {
             visible,
             cancel,
-            submit,
+            recover,
             loading,
+            formatValue,
+            getStatusName,
         };
     },
 });

+ 65 - 3
src/views/information/custom/compoments/setup.ts

@@ -1,4 +1,4 @@
-import {QueryModifyUserInfo } from "@/services/go/ermcp/customInfo";
+import {QueryDeleteUserInfoApply, QueryModifyUserInfo, UpdateUserAccountStatus} from "@/services/go/ermcp/customInfo";
 import { ModifyUserInfoReq} from "@/services/go/ermcp/customInfo/interface";
 import {ref} from "vue";
 import { message } from 'ant-design-vue';
@@ -31,6 +31,41 @@ export function cancelCustomInfo(){
 }
 
 /**
+ * 更新用户状态 用在停用或是启用
+ * 4:正常 6:注销(停用)
+ */
+export function updateUserAccount(){
+    const loading = ref<boolean>(false);
+    // 这里调用的是修改客户申请接口
+    function ModifyUserInfo(userID: number, accountStatus: number, callback: Function){
+        UpdateUserAccountStatus(userID, accountStatus)
+            .then((res) => {
+                if(res.result){
+                    if(accountStatus === 4){
+                        message.success("恢复成功")
+                    }else{
+                        message.success("停用成功")
+                    }
+                    console.log('更新用户资料成功 accountStatus = ' + accountStatus);
+                    callback()
+                }else{
+                    if(accountStatus === 4){
+                        message.error("恢复失败:" + res.message)
+                    }else{
+                        message.error("停用失败:" + res.message)
+                    }
+                }
+            })
+            .catch((err) => {cancelCustomInfo
+                message.error("请求失败")
+            }).finally(() => {
+            loading.value = false
+        })
+    }
+    return {loading, ModifyUserInfo}
+}
+
+/**
  * 审核客户资料 这里是走proto接口
  */
 export function checkCustomInfo(){
@@ -40,12 +75,13 @@ export function checkCustomInfo(){
         userInfoCheck(req)
             .then((res) => {
                 if(res.RetCode == 200){
+                    debugger
                     message.success("审核成功")
                     console.log('审核客户资料成功');
-                    callback()
                 }else{
-                    message.error("审核成功:" + res.RetDesc)
+                    message.success("审核成功:" + res.RetDesc)
                 }
+                callback()
             })
             .catch((err) => {
                 message.error("提交失败")
@@ -56,4 +92,30 @@ export function checkCustomInfo(){
     return {loading, checkCustomerInfo}
 }
 
+/**
+ * 删除客户资料
+ */
+export function deleteUserInfo(){
+    const loading = ref<boolean>(false);
+    // 这里调用的是修改客户申请接口
+    function deleteCustomerInfo(userId: number, callback: Function){
+        QueryDeleteUserInfoApply(userId)
+            .then((res) => {
+                if(res.result){
+                    message.success("删除成功")
+                    console.log('撤销客户资料成功');
+                    callback()
+                }else{
+                    message.error("删除失败:" + res.message)
+                }
+            })
+            .catch((err) => {cancelCustomInfo
+                message.error("删除失败")
+            }).finally(() => {
+            loading.value = false
+        })
+    }
+    return {loading, deleteCustomerInfo}
+}
+
 

+ 62 - 43
src/views/information/custom/list/checkpending/index.vue

@@ -1,47 +1,62 @@
 <template>
-  <!-- 客户信息: 正常 -->
-  <div class="custom_info_checkpending"
-       :loading="loading">
-    <filterCustomTable @search="search">
-      <BtnList :btnList="commonBtn" />
-    </filterCustomTable>
-    <contextMenu :contextMenuList="forDataBtn">
-      <a-table :columns="columns"
-               class="topTable hiddenFirstCol"
-               :pagination="false"
-               :expandedRowKeys="expandedRowKeys"
-               :customRow="Rowclick"
-               rowKey="key"
-               :data-source="tableList">
-        <!-- 额外的展开行 -->
-        <template #expandedRowRender="{  }">
-          <BtnList :btnList="forDataBtn" />
-        </template>
-        <template #userinfotype="{ text }">
-          <a>{{ text === '2' ? '企业' : '个人' }}</a>
-        </template>
-      </a-table>
-    </contextMenu>
-    <!-- 新增 -->
-    <AddCustom />
-    <!-- 详情 -->
-    <CustomDetail :selectedRow="selectedRow" />
-    <!-- 修改 -->
-    <ModifyCustom :selectedRow="selectedRow" />
-    <!-- 停用 -->
-    <DisableCustom />
-    <!-- 撤销 -->
-    <Cancel :selectedRow="selectedRow" />
-    <!-- 审核客户资料 -->
-    <Check :selectedRow="selectedRow" />
-  </div>
+    <!-- 客户信息: 正常 -->
+    <div class="custom_info_checkpending"
+         :loading="loading">
+        <filterCustomTable @search="search">
+            <BtnList :btnList="commonBtn"/>
+        </filterCustomTable>
+        <contextMenu :contextMenuList="forDataBtn">
+            <a-table :columns="columns"
+                     class="topTable hiddenFirstCol"
+                     :pagination="false"
+                     :expandedRowKeys="expandedRowKeys"
+                     :customRow="Rowclick"
+                     rowKey="key"
+                     :data-source="tableList">
+                <!-- 额外的展开行 -->
+                <template #expandedRowRender="{  }">
+                    <BtnList :btnList="forDataBtn"/>
+                </template>
+                <template #userinfotype="{ text }">
+                    <a>{{ text === '2' ? '企业' : '个人' }}</a>
+                </template>
+                <template #status="{ text }">
+                    <a>{{ getStatusName(text) }}</a>
+                </template>
+                <template #cardtype="{ text }">
+                    <a>{{ getCardTypeName(text) }}</a>
+                </template>
+            </a-table>
+        </contextMenu>
+        <!-- 新增 -->
+        <AddCustom/>
+        <!-- 详情 -->
+        <CustomDetail :selectedRow="selectedRow"/>
+        <!-- 修改 -->
+        <ModifyCustom :selectedRow="selectedRow"/>
+        <!-- 停用 -->
+        <DisableCustom/>
+        <!-- 撤销 -->
+        <Cancel :selectedRow="selectedRow"/>
+        <!-- 审核客户资料 -->
+        <Check :selectedRow="selectedRow"/>
+    </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
+import {
+    defineComponent,
+    initData,
+    getTableColumns,
+    getTableEvent,
+    getBtnList,
+    contextMenu,
+    BtnList
+} from '@/common/export/table';
 
-import { filterCustomTable, CustomDetail, ModifyCustom, DisableCustom, AddCustom, Cancel, Check } from '../../compoments';
-import { queryTableList, getFilterTableCB, QueryCustomInfoType } from '../index';
+import {filterCustomTable, CustomDetail, ModifyCustom, DisableCustom, AddCustom, Cancel, Check} from '../../compoments';
+import {queryTableList, getFilterTableCB, QueryCustomInfoType} from '../index';
+import {getCardTypeName, getStatusName} from "@/views/information/custom/setup";
 
 export default defineComponent({
     name: 'custom_info_checkpending',
@@ -58,25 +73,27 @@ export default defineComponent({
     },
     setup() {
         // 表头数据
-        const { columns, registerColumn, updateColumn, filteredInfo } = getTableColumns();
+        const {columns, registerColumn, updateColumn, filteredInfo} = getTableColumns();
         // 表格事件
-        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<QueryCustomInfoType>({});
+        const {expandedRowKeys, selectedRow, Rowclick} = getTableEvent<QueryCustomInfoType>({});
         // 表格操作按钮列表
-        const { commonBtn, forDataBtn } = getBtnList('custom_info_checkpending', true);
+        const {commonBtn, forDataBtn} = getBtnList('custom_info_checkpending', true);
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList(2);
+        const {loading, tableList, queryTable} = queryTableList(2);
         initData(() => {
             // 获取列表数据
             queryTable();
             // 注册表头信息 过滤
             registerColumn('table_pcweb_userinfo', getFilterTableCB);
         });
+
         // 查询
         function search(value: any) {
             filteredInfo.value = value;
             // 更新表信息
             updateColumn();
         }
+
         return {
             columns,
             filteredInfo,
@@ -88,6 +105,8 @@ export default defineComponent({
             loading,
             tableList,
             search,
+            getStatusName,
+            getCardTypeName,
         };
     },
 });

+ 58 - 39
src/views/information/custom/list/normal-use/index.vue

@@ -1,43 +1,58 @@
 <template>
-  <!-- 客户信息: 正常 -->
-  <div class="custom-normal"
-       :loading="loading">
-    <filterCustomTable @search="search">
-      <BtnList :btnList="commonBtn" />
-    </filterCustomTable>
-    <contextMenu :contextMenuList="forDataBtn">
-      <a-table :columns="columns"
-               class="topTable hiddenFirstCol"
-               :pagination="false"
-               :expandedRowKeys="expandedRowKeys"
-               :customRow="Rowclick"
-               rowKey="key"
-               :data-source="tableList">
-        <!-- 额外的展开行 -->
-        <template #expandedRowRender="{  }">
-          <BtnList :btnList="forDataBtn" />
-        </template>
-        <template #userinfotype="{ text }">
-          <a>{{ text === '2' ? '企业' : '个人' }}</a>
-        </template>
-      </a-table>
-    </contextMenu>
-    <!-- 新增 -->
-    <AddCustom />
-    <!-- 详情 -->
-    <CustomDetail :selectedRow="selectedRow" />
-    <!-- 修改 -->
-    <ModifyCustom :selectedRow="selectedRow" />
-    <!-- 停用 -->
-    <DisableCustom />
-  </div>
+    <!-- 客户信息: 正常 -->
+    <div class="custom-normal"
+         :loading="loading">
+        <filterCustomTable @search="search">
+            <BtnList :btnList="commonBtn"/>
+        </filterCustomTable>
+        <contextMenu :contextMenuList="forDataBtn">
+            <a-table :columns="columns"
+                     class="topTable hiddenFirstCol"
+                     :pagination="false"
+                     :expandedRowKeys="expandedRowKeys"
+                     :customRow="Rowclick"
+                     rowKey="key"
+                     :data-source="tableList">
+                <!-- 额外的展开行 -->
+                <template #expandedRowRender="{  }">
+                    <BtnList :btnList="forDataBtn"/>
+                </template>
+                <template #userinfotype="{ text }">
+                    <a>{{ text === '2' ? '企业' : '个人' }}</a>
+                </template>
+                <template #status="{ text }">
+                    <a>{{ getStatusName(text) }}</a>
+                </template>
+                <template #cardtype="{ text }">
+                    <a>{{ getCardTypeName(text) }}</a>
+                </template>
+            </a-table>
+        </contextMenu>
+        <!-- 新增 -->
+        <AddCustom/>
+        <!-- 详情 -->
+        <CustomDetail :selectedRow="selectedRow"/>
+        <!-- 修改 -->
+        <ModifyCustom :selectedRow="selectedRow"/>
+        <!-- 停用 -->
+        <DisableCustom :selectedRow="selectedRow"/>
+    </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
+import {
+    defineComponent,
+    initData,
+    getTableColumns,
+    getTableEvent,
+    getBtnList,
+    contextMenu,
+    BtnList
+} from '@/common/export/table';
 
-import { filterCustomTable, CustomDetail, ModifyCustom, DisableCustom, AddCustom } from '../../compoments';
-import { queryTableList, getFilterTableCB, QueryCustomInfoType } from '../index';
+import {filterCustomTable, CustomDetail, ModifyCustom, DisableCustom, AddCustom} from '../../compoments';
+import {queryTableList, getFilterTableCB, QueryCustomInfoType} from '../index';
+import {getCardTypeName, getStatusName} from "@/views/information/custom/setup";
 
 export default defineComponent({
     name: 'custom-normal',
@@ -52,25 +67,27 @@ export default defineComponent({
     },
     setup() {
         // 表头数据
-        const { columns, registerColumn, updateColumn, filteredInfo } = getTableColumns();
+        const {columns, registerColumn, updateColumn, filteredInfo} = getTableColumns();
         // 表格事件
-        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<QueryCustomInfoType>({});
+        const {expandedRowKeys, selectedRow, Rowclick} = getTableEvent<QueryCustomInfoType>({});
         // 表格操作按钮列表
-        const { commonBtn, forDataBtn } = getBtnList('custom_info_normal', true);
+        const {commonBtn, forDataBtn} = getBtnList('custom_info_normal', true);
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList(3);
+        const {loading, tableList, queryTable} = queryTableList(3);
         initData(() => {
             // 获取列表数据
             queryTable();
             // 注册表头信息 过滤
             registerColumn('table_pcweb_userinfo', getFilterTableCB);
         });
+
         // 查询
         function search(value: any) {
             filteredInfo.value = value;
             // 更新表信息
             updateColumn();
         }
+
         return {
             columns,
             filteredInfo,
@@ -82,6 +99,8 @@ export default defineComponent({
             loading,
             tableList,
             search,
+            getStatusName,
+            getCardTypeName,
         };
     },
 });

+ 1 - 0
src/views/information/custom/list/setup.ts

@@ -4,6 +4,7 @@ import { QueryCustomInfoType } from '@/services/go/ermcp/customInfo/interface';
 import { QueryCustomInfoEnum } from '@/services/go/ermcp/customInfo/type';
 import { message } from 'ant-design-vue';
 import { ref } from 'vue';
+import {getStatusName} from "@/views/information/custom/setup";
 
 /**
  * 获取表格列表数据

+ 58 - 39
src/views/information/custom/list/stop-use/index.vue

@@ -1,44 +1,59 @@
 <template>
-  <!-- 客户信息: 停用 -->
-  <div class="custom-normal"
-       :loading="loading">
-    <filterCustomTable @search="search">
-      <BtnList :btnList="commonBtn" />
-    </filterCustomTable>
-    <contextMenu :contextMenuList="forDataBtn">
-      <a-table :columns="columns"
-               class="topTable"
-               :expandedRowKeys="expandedRowKeys"
-               :customRow="Rowclick"
-               :pagination="false"
-               rowKey="key"
-               :data-source="customList">
-        <!-- 额外的展开行 -->
-        <template #expandedRowRender="{  }">
-          <BtnList :btnList="forDataBtn" />
-        </template>
-        <template #userinfotype="{ text }">
-          <a>{{ text === '2' ? '企业' : '个人' }}</a>
-        </template>
-      </a-table>
-    </contextMenu>
-    <!-- 新增 -->
-    <AddCustom />
-    <!-- 详情 -->
-    <CustomDetail />
-    <!-- 删除 -->
-    <DeleteCustom />
-    <!-- 恢复客户资料 -->
-    <RecoverCustom />
-  </div>
+    <!-- 客户信息: 停用 -->
+    <div class="custom-normal"
+         :loading="loading">
+        <filterCustomTable @search="search">
+            <BtnList :btnList="commonBtn"/>
+        </filterCustomTable>
+        <contextMenu :contextMenuList="forDataBtn">
+            <a-table :columns="columns"
+                     class="topTable"
+                     :expandedRowKeys="expandedRowKeys"
+                     :customRow="Rowclick"
+                     :pagination="false"
+                     rowKey="key"
+                     :data-source="tableList">
+                <!-- 额外的展开行 -->
+                <template #expandedRowRender="{  }">
+                    <BtnList :btnList="forDataBtn"/>
+                </template>
+                <template #userinfotype="{ text }">
+                    <a>{{ text === '2' ? '企业' : '个人' }}</a>
+                </template>
+                <template #status="{ text }">
+                    <a>{{ getStatusName(text) }}</a>
+                </template>
+                <template #cardtype="{ text }">
+                    <a>{{ getCardTypeName(text) }}</a>
+                </template>
+            </a-table>
+        </contextMenu>
+        <!-- 新增 -->
+        <AddCustom/>
+        <!-- 详情 -->
+        <CustomDetail :selectedRow="selectedRow"/>
+        <!-- 删除 -->
+        <DeleteCustom :selectedRow="selectedRow"/>
+        <!-- 恢复客户资料 -->
+        <RecoverCustom :selectedRow="selectedRow"/>
+    </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
+import {
+    defineComponent,
+    initData,
+    getTableColumns,
+    getTableEvent,
+    getBtnList,
+    contextMenu,
+    BtnList
+} from '@/common/export/table';
 
-import { filterCustomTable, CustomDetail, DeleteCustom, RecoverCustom, AddCustom } from '../../compoments';
+import {filterCustomTable, CustomDetail, DeleteCustom, RecoverCustom, AddCustom} from '../../compoments';
 
-import { queryTableList, getFilterTableCB, QueryCustomInfoType } from '../index';
+import {queryTableList, getFilterTableCB, QueryCustomInfoType} from '../index';
+import {getCardTypeName, getStatusName} from "@/views/information/custom/setup";
 
 export default defineComponent({
     name: 'custom-normal',
@@ -53,25 +68,27 @@ export default defineComponent({
     },
     setup() {
         // 表头数据
-        const { columns, registerColumn, updateColumn, filteredInfo } = getTableColumns();
+        const {columns, registerColumn, updateColumn, filteredInfo} = getTableColumns();
         // 表格事件
-        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<QueryCustomInfoType>({});
+        const {expandedRowKeys, selectedRow, Rowclick} = getTableEvent<QueryCustomInfoType>({});
         // 表格操作按钮列表
-        const { commonBtn, forDataBtn } = getBtnList('custom_info_disabled', true);
+        const {commonBtn, forDataBtn} = getBtnList('custom_info_disabled', true);
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList(3);
+        const {loading, tableList, queryTable} = queryTableList(4);
         initData(() => {
             // 获取列表数据
             queryTable();
             // 注册表头信息 过滤
             registerColumn('table_pcweb_userinfo', getFilterTableCB);
         });
+
         // 查询
         function search(value: any) {
             filteredInfo.value = value;
             // 更新表信息
             updateColumn();
         }
+
         return {
             columns,
             filteredInfo,
@@ -83,6 +100,8 @@ export default defineComponent({
             loading,
             tableList,
             search,
+            getStatusName,
+            getCardTypeName,
         };
     },
 });

+ 58 - 39
src/views/information/custom/list/unsubmit/index.vue

@@ -1,44 +1,59 @@
 <template>
-  <!-- 客户信息: 正常 -->
-  <div class="custom_info_unsubmit"
-       :loading="loading">
-    <filterCustomTable @search="search">
-      <BtnList :btnList="commonBtn" />
-    </filterCustomTable>
-    <contextMenu :contextMenuList="forDataBtn">
-      <a-table :columns="columns"
-               class="topTable hiddenFirstCol"
-               :pagination="false"
-               :expandedRowKeys="expandedRowKeys"
-               :customRow="Rowclick"
-               rowKey="key"
-               :data-source="tableList">
-        <!-- 额外的展开行 -->
-        <template #expandedRowRender="{  }">
-          <BtnList :btnList="forDataBtn" />
-        </template>
-        <template #userinfotype="{ text }">
-          <a>{{ text === '2' ? '企业' : '个人' }}</a>
-        </template>
-      </a-table>
-    </contextMenu>
-    <!-- 新增 -->
-    <AddCustom />
-    <!-- 详情 -->
-    <CustomDetail :selectedRow="selectedRow" />
-    <!-- 修改 -->
-    <ModifyCustom :selectedRow="selectedRow" />
-    <!-- 停用 -->
-    <DisableCustom />
+    <!-- 客户信息: 正常 -->
+    <div class="custom_info_unsubmit"
+         :loading="loading">
+        <filterCustomTable @search="search">
+            <BtnList :btnList="commonBtn"/>
+        </filterCustomTable>
+        <contextMenu :contextMenuList="forDataBtn">
+            <a-table :columns="columns"
+                     class="topTable hiddenFirstCol"
+                     :pagination="false"
+                     :expandedRowKeys="expandedRowKeys"
+                     :customRow="Rowclick"
+                     rowKey="key"
+                     :data-source="tableList">
+                <!-- 额外的展开行 -->
+                <template #expandedRowRender="{  }">
+                    <BtnList :btnList="forDataBtn"/>
+                </template>
+                <template #userinfotype="{ text }">
+                    <a>{{ text === '2' ? '企业' : '个人' }}</a>
+                </template>
+                <template #status="{ text }">
+                    <a>{{ getStatusName(text) }}</a>
+                </template>
+                <template #cardtype="{ text }">
+                    <a>{{ getCardTypeName(text) }}</a>
+                </template>
+            </a-table>
+        </contextMenu>
+        <!-- 新增 -->
+        <AddCustom/>
+        <!-- 详情 -->
+        <CustomDetail :selectedRow="selectedRow"/>
+        <!-- 修改 -->
+        <ModifyCustom :selectedRow="selectedRow"/>
+        <!-- 停用 -->
+        <DisableCustom/>
 
-  </div>
+    </div>
 </template>
 
 <script lang="ts">
-import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
+import {
+    defineComponent,
+    initData,
+    getTableColumns,
+    getTableEvent,
+    getBtnList,
+    contextMenu,
+    BtnList
+} from '@/common/export/table';
 
-import { filterCustomTable, CustomDetail, ModifyCustom, DisableCustom, AddCustom } from '../../compoments';
-import { queryTableList, getFilterTableCB, QueryCustomInfoType } from '../index';
+import {filterCustomTable, CustomDetail, ModifyCustom, DisableCustom, AddCustom} from '../../compoments';
+import {queryTableList, getFilterTableCB, QueryCustomInfoType} from '../index';
+import {getCardTypeName, getStatusName} from "@/views/information/custom/setup";
 
 export default defineComponent({
     name: 'custom_info_unsubmit',
@@ -53,25 +68,27 @@ export default defineComponent({
     },
     setup() {
         // 表头数据
-        const { columns, registerColumn, updateColumn, filteredInfo } = getTableColumns();
+        const {columns, registerColumn, updateColumn, filteredInfo} = getTableColumns();
         // 表格事件
-        const { expandedRowKeys, selectedRow, Rowclick } = getTableEvent<QueryCustomInfoType>({});
+        const {expandedRowKeys, selectedRow, Rowclick} = getTableEvent<QueryCustomInfoType>({});
         // 表格操作按钮列表
-        const { commonBtn, forDataBtn } = getBtnList('custom_info_unsubmit', true);
+        const {commonBtn, forDataBtn} = getBtnList('custom_info_unsubmit', true);
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList(1);
+        const {loading, tableList, queryTable} = queryTableList(1);
         initData(() => {
             // 获取列表数据
             queryTable();
             // 注册表头信息 过滤
             registerColumn('table_pcweb_userinfo', getFilterTableCB);
         });
+
         // 查询
         function search(value: any) {
             filteredInfo.value = value;
             // 更新表信息
             updateColumn();
         }
+
         return {
             columns,
             filteredInfo,
@@ -83,6 +100,8 @@ export default defineComponent({
             loading,
             tableList,
             search,
+            getStatusName,
+            getCardTypeName,
         };
     },
 });

+ 12 - 1
src/views/information/custom/setup.ts

@@ -1,3 +1,5 @@
+import {getItemEnum} from "@/services/bus/allEnum";
+
 /**
  * 获取客户资料状态
  * @param state
@@ -25,4 +27,13 @@ export function getStatusName(state: number) : string{
             break
     }
     return result
-}
+}
+
+/**
+ * 设置证件类型
+ * @param type
+ */
+export function getCardTypeName(type: number): string{
+    const cardName = getItemEnum('certificatetype').find(e => e.enumitemname === type);
+    return cardName ? cardName.enumdicname : "--"
+}

+ 379 - 230
src/views/information/goods/components/add/index.vue

@@ -14,56 +14,155 @@
                 :loading="loading"
                 @click="submit">完成</a-button>
     </template>
-    <a-form class="inlineForm">
+    <a-form class="inlineForm"
+            ref="formRef"
+            :model="formState"
+            :rules="rules">
       <fieldset class="formFieldSet">
         <legend>基本信息</legend>
         <a-row :gutter="24">
           <a-col :span="12">
-            <a-form-item label="现货品种名称">
+            <a-form-item label="现货品种名称"
+                         name="deliverygoodsname">
               <a-input class="dialogInput"
-                      style="width: 200px"
-                      placeholder="请输入现货品种名称" />
+                       v-model:value="formState.deliverygoodsname"
+                       style="width: 200px"
+                       placeholder="请输入现货品种名称" />
             </a-form-item>
           </a-col>
           <a-col :span="12">
-            <a-form-item label="现货品种代码">
+            <a-form-item label="现货品种代码"
+                         name="deliverygoodscode">
               <a-input class="dialogInput"
-                      style="width: 200px"
-                      placeholder="请输入现货品种代码" />
+                       style="width: 200px"
+                       v-model:value="formState.deliverygoodscode"
+                       placeholder="请输入现货品种代码" />
             </a-form-item>
           </a-col>
         </a-row>
         <a-row :gutter="24">
           <a-col :span="24">
-            <a-form-item label="单位">
+            <a-form-item label="单位"
+                         name="unitid">
               <a-select class="inlineFormSelect"
                         style="width: 200px"
+                        v-model:value="formState.unitid"
                         placeholder="请选择单位">
-                <a-select-option value="1">
-                  客户一
-                </a-select-option>
-                <a-select-option value="2">
-                  客户二
+                <a-select-option v-for="item in unitList"
+                                 :value="item.enumitemname"
+                                 :key="item.autoid">
+                  {{item.enumdicname}}
                 </a-select-option>
               </a-select>
             </a-form-item>
           </a-col>
         </a-row>
         <a-row :gutter="24">
-        <a-col :span="24">
-          <a-form-item label="备注">
-            <a-input class="dialogInput"
-                     style="width: 562px"
-                     placeholder="请输入备注" />
-          </a-form-item>
-        </a-col>
-      </a-row>
+          <a-col :span="24">
+            <a-form-item label="备注"
+                         name="remark">
+              <a-input class="dialogInput"
+                       v-model:value="formState.remark"
+                       style="width: 562px"
+                       placeholder="请输入备注" />
+            </a-form-item>
+          </a-col>
+        </a-row>
       </fieldset>
       <fieldset class="formFieldSet">
         <legend>品类信息</legend>
-        <a-table  class="dialogTable" :columns="columns" :data-source="dataSource" :pagination="false">
+        <a-row :gutter="24">
+          <a-col :span="6">
+            <span>
+              <span class="red">*</span>
+              品类
+            </span>
+          </a-col>
+          <a-col :span="6">
+            <span>
+              <span class="red">*</span>
+              单位
+            </span>
+          </a-col>
+          <a-col :span="6">
+            <span>
+              <span class="red">*</span>
+              标仓系数
+            </span>
+          </a-col>
+          <a-col :span="6">
+            <span>
+              操作
+            </span>
+          </a-col>
+          <template v-for="(domain, index) in formState.gldwrstandards"
+                    :key="domain.index + 'domain'">
+            <a-col :span="6">
+              <a-form-item :name="['wrstandardname', index]"
+                           :rules="rules.gldwrstandards.wrstandardname">
+                <a-input class="dialogInput"
+                         v-model:value="domain.wrstandardname"
+                         placeholder="请输入品类"></a-input>
+              </a-form-item>
+            </a-col>
+            <a-col :span="6">
+              <a-form-item :name="['unitid', index]"
+                           :rules="rules.gldwrstandards.unitid">
+                <a-select class="inlineFormSelect"
+                          style="width: 200px"
+                          v-model:value="domain.unitid"
+                          placeholder="请选择单位">
+                  <a-select-option v-for="item in unitList"
+                                   :value="item.enumitemname"
+                                   :key="item.autoid">
+                    {{item.enumdicname}}
+                  </a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+            <a-col :span="6">
+              <a-form-item :name="['convertfactor', index]"
+                           :rules="rules.gldwrstandards.convertfactor">
+                <a-input class="dialogInput"
+                         v-model:value="domain.convertfactor"
+                         placeholder="请输入标仓系数"></a-input>
+              </a-form-item>
+            </a-col>
+            <a-col :span="6">
+              <a-button class="plusBtn"
+                        v-if="index > 0">
+                <template #icon>
+                  <MinusOutlined />
+                </template>
+              </a-button>
+              <a-button class="minusBtn">
+                <template #icon>
+                  <PlusOutlined />
+                </template>
+              </a-button>
+            </a-col>
+          </template>
+        </a-row>
+        <!-- <a-form-item
+      v-for="(domain, index) in dynamicValidateForm.gldwrstandards"
+      :key="domain.index + 'domain'"
+      v-bind="index === 0 ? formItemLayout : {}"
+      :name="['domains', index, 'value']"
+      :rules="{
+        required: true,
+        message: 'domain can not be null',
+        trigger: 'change',
+      }"
+    >
+
+            </a-form-item> -->
+        <a-table class="dialogTable"
+                 :columns="columns"
+                 :data-source="dataSource"
+                 :pagination="false">
           <template #type>
-            <a-input class="dialogInput" placeholder="请输入品类"></a-input>
+            <a-input class="dialogInput"
+                     placeholder="请输入品类"></a-input>
           </template>
           <template #customType>
             <span>
@@ -72,13 +171,14 @@
             </span>
           </template>
           <template #unit>
-            <a-select class="dialogSelect" placeholder="请选择单位">
-                <a-select-option value="1">
-                    一口价
-                </a-select-option>
-                <a-select-option value="2">
-                    一口价2
-                </a-select-option>
+            <a-select class="dialogSelect"
+                      placeholder="请选择单位">
+              <a-select-option value="1">
+                一口价
+              </a-select-option>
+              <a-select-option value="2">
+                一口价2
+              </a-select-option>
             </a-select>
           </template>
           <template #customUnit>
@@ -88,7 +188,8 @@
             </span>
           </template>
           <template #coefficient>
-            <a-input class="dialogInput" placeholder="请输入标仓系数"></a-input>
+            <a-input class="dialogInput"
+                     placeholder="请输入标仓系数"></a-input>
           </template>
           <template #customCoefficient>
             <span>
@@ -112,9 +213,13 @@
       </fieldset>
       <fieldset class="formFieldSet">
         <legend>品牌信息</legend>
-        <a-table  class="dialogTable" :columns="columns1" :data-source="dataSource1" :pagination="false">
+        <a-table class="dialogTable"
+                 :columns="columns1"
+                 :data-source="dataSource1"
+                 :pagination="false">
           <template #type>
-            <a-input class="dialogInput" placeholder="请输入品牌"></a-input>
+            <a-input class="dialogInput"
+                     placeholder="请输入品牌"></a-input>
           </template>
           <template #customType>
             <span>
@@ -138,15 +243,19 @@
       </fieldset>
       <fieldset class="formFieldSet">
         <legend>套保品种信息</legend>
-        <a-table  class="dialogTable" :columns="columns" :data-source="dataSource" :pagination="false">
+        <a-table class="dialogTable"
+                 :columns="columns"
+                 :data-source="dataSource"
+                 :pagination="false">
           <template #type>
-             <a-select class="dialogSelect" placeholder="请选择套保品种">
-                <a-select-option value="1">
-                    一口价
-                </a-select-option>
-                <a-select-option value="2">
-                    一口价2
-                </a-select-option>
+            <a-select class="dialogSelect"
+                      placeholder="请选择套保品种">
+              <a-select-option value="1">
+                一口价
+              </a-select-option>
+              <a-select-option value="2">
+                一口价2
+              </a-select-option>
             </a-select>
           </template>
           <template #customType>
@@ -156,7 +265,7 @@
             </span>
           </template>
           <template #unit>
-           <span class="white">选择套保品种后自动填入</span>
+            <span class="white">选择套保品种后自动填入</span>
           </template>
           <template #customUnit>
             <span>
@@ -164,7 +273,8 @@
             </span>
           </template>
           <template #coefficient>
-            <a-input class="dialogInput" placeholder="请输入套保系数"></a-input>
+            <a-input class="dialogInput"
+                     placeholder="请输入套保系数"></a-input>
           </template>
           <template #customCoefficient>
             <span>
@@ -191,99 +301,114 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, ref } from 'vue';
-import { closeModal, openModal } from '@/common/setup/modal/index';
+import { defineComponent, ref, reactive, toRaw, UnwrapRef } from 'vue';
+import { closeModal } from '@/common/setup/modal/index';
 import { initData } from '@/common/methods/index';
 import { PlusOutlined, MinusOutlined } from '@ant-design/icons-vue';
+import { handleAdd, initFormState } from './setup';
+import { DeliveryGoodsApplyReq } from '@/services/proto/delivery/interface';
+import { getGoodsUnitList } from '../../setup';
+import { RuleObject, ValidateErrorEntity } from 'ant-design-vue/es/form/interface';
+
+const validateUnit = async (rule: RuleObject, value: number) => {
+    if (value) {
+        return Promise.resolve();
+    } else {
+        return Promise.reject('请选择单位');
+    }
+};
 
 export default defineComponent({
     name: 'addSpotVariety',
     components: {
-      PlusOutlined,
-      MinusOutlined,
+        PlusOutlined,
+        MinusOutlined,
     },
     setup() {
+        // 控制关闭弹窗
         const { visible, cancel } = closeModal('spot_contract_btn_add');
-        const loading = ref<boolean>(false);
-        const maskClosableFlag = ref<boolean>(false);
+        // 下单方法
+        const { loading, addAction } = handleAdd();
+        // 单位列表
+        const unitList = getGoodsUnitList();
         const columns = [
-          {
-            dataIndex: 'type',
-            key: 'type',
-            slots: { title: 'customType', customRender: 'type' },
-            width: 200,
-            align: 'center'
-          },
-          {
-            dataIndex: 'unit',
-            key: 'unit',
-            slots: { title: 'customUnit', customRender: 'unit' },
-            width: 200,
-            align: 'center'
-          },
-          {
-            dataIndex: 'coefficient',
-            key: 'coefficient',
-            slots: { title: 'customCoefficient', customRender: 'coefficient' },
-            width: 200,
-            align: 'center'
-          },
-          {
-            title: '操作',
-            key: 'action',
-            slots: { customRender: 'action' },
-            align: 'center'
-          },
+            {
+                dataIndex: 'type',
+                key: 'type',
+                slots: { title: 'customType', customRender: 'type' },
+                width: 200,
+                align: 'center',
+            },
+            {
+                dataIndex: 'unit',
+                key: 'unit',
+                slots: { title: 'customUnit', customRender: 'unit' },
+                width: 200,
+                align: 'center',
+            },
+            {
+                dataIndex: 'coefficient',
+                key: 'coefficient',
+                slots: { title: 'customCoefficient', customRender: 'coefficient' },
+                width: 200,
+                align: 'center',
+            },
+            {
+                title: '操作',
+                key: 'action',
+                slots: { customRender: 'action' },
+                align: 'center',
+            },
         ];
 
         const dataSource = [
-          {
-            key: '1',
-            type: 'John Brown',
-            age: 32,
-            address: 'New York No. 1 Lake Park',
-            tags: ['nice', 'developer'],
-          },
-          {
-            key: '2',
-            name: 'Jim Green',
-            age: 42,
-            address: 'London No. 1 Lake Park',
-            tags: ['loser'],
-          },
+            {
+                key: '1',
+                type: 'John Brown',
+                age: 32,
+                address: 'New York No. 1 Lake Park',
+                tags: ['nice', 'developer'],
+            },
+            {
+                key: '2',
+                name: 'Jim Green',
+                age: 42,
+                address: 'London No. 1 Lake Park',
+                tags: ['loser'],
+            },
         ];
 
         const columns1 = [
-          {
-            dataIndex: 'type',
-            key: 'type',
-            slots: { title: 'customType', customRender: 'type' },
-            width: 598,
-            align: 'center'
-          },
-          {
-            title: '操作',
-            key: 'action',
-            slots: { customRender: 'action' },
-            align: 'center'
-          },
+            {
+                dataIndex: 'type',
+                key: 'type',
+                slots: { title: 'customType', customRender: 'type' },
+                width: 598,
+                align: 'center',
+            },
+            {
+                title: '操作',
+                key: 'action',
+                slots: { customRender: 'action' },
+                align: 'center',
+            },
         ];
 
         const dataSource1 = [
-          {
-            key: '1',
-            type: 'John Brown',
-            age: 32,
-            address: 'New York No. 1 Lake Park',
-            tags: ['nice', 'developer'],
-          },
-          {
-            key: '2',
-            name: 'Jim Green',
-            age: 42,
-            address: 'London No. 1 Lake Park',
-            tags: ['loser'],
-          },
+            {
+                key: '1',
+                type: 'John Brown',
+                age: 32,
+                address: 'New York No. 1 Lake Park',
+                tags: ['nice', 'developer'],
+            },
+            {
+                key: '2',
+                name: 'Jim Green',
+                age: 42,
+                address: 'London No. 1 Lake Park',
+                tags: ['loser'],
+            },
         ];
         function submit() {
             loading.value = true;
@@ -292,17 +417,39 @@ export default defineComponent({
                 cancel();
             }, 2000);
         }
+
+        // 表单
+        const formRef = ref();
+        const formState: UnwrapRef<DeliveryGoodsApplyReq> = reactive(initFormState());
+        const rules = {
+            deliverygoodsname: [{ required: true, message: '请输入现货品种名称', trigger: 'blur' }],
+            // unitid: [{ required: true, message: '请选择单位', trigger: 'change' }],
+            unitid: [{ required: true, validator: validateUnit, trigger: 'change' }],
+            gldwrstandards: {
+                unitid: { required: true, validator: validateUnit, trigger: 'change' },
+                wrstandardname: { required: true, message: '请输入品类', trigger: 'blur' },
+                convertfactor: { required: true, message: '请输入标仓系数', trigger: 'blur' },
+            },
+            // nickname: [{ required: true, message: '请输入企业简称', trigger: 'blur' }],
+            // cardtype: [{ required: true, message: '请选择证件类型', trigger: 'change' }],
+        };
+
         initData(() => {});
         return {
             visible,
             cancel,
+            formRef,
+            formState,
+            rules,
+            unitList,
+
             submit,
             loading,
             dataSource,
             columns,
             dataSource1,
             columns1,
-            maskClosableFlag
+            maskClosableFlag: false,
         };
     },
 });
@@ -310,126 +457,128 @@ export default defineComponent({
 
 <style lang="less">
 .addSpotVariety {
-  width: 100%;
-  height: 100%;
-  // padding: 30px;
-  .formFieldSet {
-    border: 1px solid @m-grey19;
-    padding: 0 20px 20px;
-  }
-  .formFieldSet+.formFieldSet {
-    margin-top: 35px;
-  }
-  .ant-form {
-    legend {
-      width: auto;
-      margin-left: 20px;
-      font-size: 16px;
-      color: @m-white0;
-      border-bottom: 0;
-      padding: 0 10px;
+    width: 100%;
+    height: 100%;
+    // padding: 30px;
+    .formFieldSet {
+        border: 1px solid @m-grey19;
+        padding: 0 20px 20px;
     }
-  }
-  .ant-form.inlineForm .ant-row.ant-form-item .ant-form-item-label {
-    width: 120px !important;
-  }
-  .upload {
-      display: inline-flex;
-      .ant-btn.uploadBtn {
-          width: 60px;
-          height: 30px;
-          background: @m-blue0;
-          border: 0;
-          padding: 0;
-          text-align: center;
-          font-size: 14px;
-          color: @m-white0;
-          .rounded-corners(3px);
-          &:hover {
-              background: rgba(@m-blue0, 0);
-              color: rgba(@m-white0, 0.8);
-          }
-      }
-      .look {
-          color: @m-blue0;
-          font-size: 14px;
-          margin-left: 10px;
-          cursor: pointer;
-      }
-  }
-  .red {
-    color: @m-red1;
-  }
-  .ant-btn.minusBtn,.ant-btn.plusBtn {
-    width: 26px;
-    height: 26px;
-    .inlineflex;
-    justify-content: center;
-    background: @m-blue0;
-    .rounded-corners(3px);
-    border: 0;
-    .anticon  {
-      font-size: 12px;
-      color: @m-white0;
-      align-self: center;
-      align-items: center;
+    .formFieldSet + .formFieldSet {
+        margin-top: 35px;
     }
-    &:hover,&:focus {
-      background: rgba(@m-blue0, .8);
-      .anticon {
-        color: rgba(@m-white0, .8);
-      }
+    .ant-form {
+        legend {
+            width: auto;
+            margin-left: 20px;
+            font-size: 16px;
+            color: @m-white0;
+            border-bottom: 0;
+            padding: 0 10px;
+        }
     }
-  }
-  .ant-btn.plusBtn{
-    margin-right: 10px;
-    background: transparent;
-    border: 1px solid #3A87F7;
-    .anticon {
-      color: @m-blue0;
+    .ant-form.inlineForm .ant-row.ant-form-item .ant-form-item-label {
+        width: 120px !important;
     }
-  }
-  .white {
-    color: @m-white0;
-  }
-  .dialogTable {
-    .ant-table {
-      .ant-table-content {
-        .ant-table-body {
-          table {
-            tr {
-              td {
-                padding: 0;
-                .ant-input.dialogInput {
-                  height: 34px;
-                  line-height: 34px;
-                  border: 0;
-                  border-radius: 0;
-                }
-                .dialogSelect.ant-select-single {
-                  float: left;
-                  margin-right: 0;
-                  .ant-select-selector {
-                    padding: 0 10px;
-                    height: 34px;
-                    background: @m-grey21;
-                    border: 0;
-                    border-radius: 0;
-                    .ant-select-selection-placeholder {
-                      color: @m-grey10;
-                      text-align: left;
+    .upload {
+        display: inline-flex;
+        .ant-btn.uploadBtn {
+            width: 60px;
+            height: 30px;
+            background: @m-blue0;
+            border: 0;
+            padding: 0;
+            text-align: center;
+            font-size: 14px;
+            color: @m-white0;
+            .rounded-corners(3px);
+            &:hover {
+                background: rgba(@m-blue0, 0);
+                color: rgba(@m-white0, 0.8);
+            }
+        }
+        .look {
+            color: @m-blue0;
+            font-size: 14px;
+            margin-left: 10px;
+            cursor: pointer;
+        }
+    }
+    .red {
+        color: @m-red1;
+    }
+    .ant-btn.minusBtn,
+    .ant-btn.plusBtn {
+        width: 26px;
+        height: 26px;
+        .inlineflex;
+        justify-content: center;
+        background: @m-blue0;
+        .rounded-corners(3px);
+        border: 0;
+        .anticon {
+            font-size: 12px;
+            color: @m-white0;
+            align-self: center;
+            align-items: center;
+        }
+        &:hover,
+        &:focus {
+            background: rgba(@m-blue0, 0.8);
+            .anticon {
+                color: rgba(@m-white0, 0.8);
+            }
+        }
+    }
+    .ant-btn.plusBtn {
+        margin-right: 10px;
+        background: transparent;
+        border: 1px solid #3a87f7;
+        .anticon {
+            color: @m-blue0;
+        }
+    }
+    .white {
+        color: @m-white0;
+    }
+    .dialogTable {
+        .ant-table {
+            .ant-table-content {
+                .ant-table-body {
+                    table {
+                        tr {
+                            td {
+                                padding: 0;
+                                .ant-input.dialogInput {
+                                    height: 34px;
+                                    line-height: 34px;
+                                    border: 0;
+                                    border-radius: 0;
+                                }
+                                .dialogSelect.ant-select-single {
+                                    float: left;
+                                    margin-right: 0;
+                                    .ant-select-selector {
+                                        padding: 0 10px;
+                                        height: 34px;
+                                        background: @m-grey21;
+                                        border: 0;
+                                        border-radius: 0;
+                                        .ant-select-selection-placeholder {
+                                            color: @m-grey10;
+                                            text-align: left;
+                                        }
+                                    }
+                                    .ant-select-arrow {
+                                        color: @m-blue0;
+                                    }
+                                }
+                            }
+                        }
                     }
-                  }
-                  .ant-select-arrow {
-                    color: @m-blue0;
-                  }
                 }
-              }
             }
-          }
         }
-      }
     }
-  }
 }
 </style>

+ 33 - 0
src/views/information/goods/components/add/interface.ts

@@ -0,0 +1,33 @@
+export interface GLDWRStandardEx {
+    wrstandardid?: number // uint64 型号ID(修改时有值)
+    wrstandardname: string // string 型号名称
+    unitid: number | undefined// uint64 单位ID
+    convertfactor: number// double 标仓系数(接口为3.1及以上版本时传)
+    callback: Function;
+}
+
+// 现货商品品牌数据 0 29 173
+export interface GLDDGFactoryItemEx {
+    dgfactoryitemid?: number // uint64 品牌ID(修改时有值)
+    dgfactoryitemvalue: string // string 品牌名称
+    callback: Function;
+}
+
+// 现货商品折算配置明细数据 0 29 127
+export interface WRSConvertDetailEx {
+    middlegoodsid: number // uint64 套保品种ID(接口为3.1及以下版本时传套保品种ID,否则传期货品种ID)
+    unitid: number // uint64 单位ID
+    convertratio: number // double 套保系数
+    callback: Function;
+}
+export interface FormState {
+    deliverygoodscode?: string // string 交割商品代码(新增时有值)
+    deliverygoodsname?: string // string 交割商品名称(新增时有值)
+    deliverygoodsid?: number// uint64 交割商品id(修改时有值)
+    unitid: number | undefined // uint64 单位ID (undefined 用于前端,传入服务时必须是number类型)
+    type: number// int32 类型 1 新增 2 修改
+    remark: string // string 备注
+    gldwrstandards: GLDWRStandardEx[]; //        GLDWRStandardEx 现货商品型号数据
+    glddgfactoryItems: GLDDGFactoryItemEx[] //   GLDDGFactoryItemEx 现货商品品牌数据
+    wrsconvertdetails: WRSConvertDetailEx[] // WRSConvertDetailEx 现货商品折算配置明细数据
+}

+ 34 - 0
src/views/information/goods/components/add/setup.ts

@@ -0,0 +1,34 @@
+import { addDeliveryGoodsApply } from '@/services/proto/delivery';
+import { DeliveryGoodsApplyReq } from '@/services/proto/delivery/interface';
+import { message } from 'ant-design-vue';
+import { ref } from 'vue';
+import { FormState } from './interface';
+
+export function handleAdd() {
+    const loading = ref<boolean>(false);
+    function addAction(param: DeliveryGoodsApplyReq) {
+        loading.value = true;
+        addDeliveryGoodsApply(param).then(() => {
+            message.success('新增现货品种成功!')
+        }).catch(err => {
+            message.error(err.message)
+        }).finally(() => loading.value = false)
+    }
+    return { loading, addAction }
+}
+
+export function initFormState(callback: Function): FormState {
+    return {
+        deliverygoodscode: '', // string 交割商品代码(新增时有值)
+        deliverygoodsname: '', // string 交割商品名称(新增时有值)
+        deliverygoodsid: 0,// uint64 交割商品id(修改时有值)
+        unitid: undefined, // uint64 单位ID
+        type: 1,// int32 类型 1 新增 2 修改
+        remark: '', // string 备注
+        gldwrstandards: [
+            { wrstandardname: '', unitid: undefined, convertfactor: 0, callback }
+        ], //        GLDWRStandardEx 现货商品型号数据
+        glddgfactoryItems: [], //   GLDDGFactoryItemEx 现货商品品牌数据
+        wrsconvertdetails: [], // WRSConvertDetailEx 现货商品折算配置明细数据
+    }
+}

+ 6 - 8
src/views/information/goods/components/leftMenu/index.vue

@@ -24,11 +24,12 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, ref, PropType } from 'vue';
+import { defineComponent, ref, PropType, SetupContext } from 'vue';
 import { MenuList } from '@/services/go/ermcp/goodsInfo/interface';
+import { initMenu } from '../../setup';
 
 // 菜单栏
-const handleMenu = () => {
+const handleMenu = (context: SetupContext) => {
     const collapsed = ref<boolean>(false);
     const selectedKeys = ref<string[]>(['1-0']);
     const openKeys = ref<string[]>(['1']);
@@ -45,7 +46,7 @@ const handleMenu = () => {
     }
 
     function menuClick(value: any) {
-        console.log(value);
+        context.emit('chooseMenu', value.key);
     }
     return { collapsed, selectedKeys, openKeys, collapse, menuClick };
 };
@@ -54,16 +55,13 @@ export default defineComponent({
     name: 'leftMenu',
     props: {
         menuList: {
-            default: [
-                { key: '1', title: '正常', children: [] },
-                { key: '2', title: '停用', children: [] },
-            ],
+            default: initMenu,
             type: Object as PropType<MenuList[]>,
         },
     },
     components: {},
     setup(props, context) {
-        const { collapsed, selectedKeys, openKeys, collapse, menuClick } = handleMenu();
+        const { collapsed, selectedKeys, openKeys, collapse, menuClick } = handleMenu(context);
 
         return {
             menuClick,

+ 253 - 276
src/views/information/goods/components/rightSpot/index.vue

@@ -1,310 +1,287 @@
 <template>
-    <div class="rightSpot">
-        <div class="title">
-            <div class="tltLeft">
-                <span class="blue">
-                    <svg class="icon svg-icon" aria-hidden="true">
-                        <use xlink:href="#icon-shuzhuangtu"></use>
-                    </svg>
-                    铜杆(吨)
-                </span>
-                <span class="green ml10">正常</span>
-            </div>
-            <div class="tltBtns">
-                <a-button class="blueBtn">修改</a-button>
-                <a-button class="redBtn">停用</a-button>
-            </div>
-        </div>
-        <div class="spotCont">
-            <a-collapse class="spotCollapse" :bordered="false">
-                <template #expandIcon="props">
-                    <svg class="icon svg-icon" aria-hidden="true" v-if="props.isActive == 0">
-                        <use xlink:href="#icon-shouqi1"></use>
-                    </svg>
-                    <svg class="icon svg-icon" aria-hidden="true" v-else>
-                        <use xlink:href="#icon-shouqi2"></use>
-                    </svg>
+  <div class="rightSpot">
+    <div class="title">
+      <div class="tltLeft">
+        <span class="blue">
+          <svg class="icon svg-icon"
+               aria-hidden="true">
+            <use xlink:href="#icon-shuzhuangtu"></use>
+          </svg>
+          {{selctedDeliveryGoods.data.deliverygoodsname}}({{getGoodsUnit(selctedDeliveryGoods.data.agreeunit)}})
+        </span>
+        <span class="green ml10">{{selctedDeliveryGoods.data.dgstatus ? '正常' : '停用'}}</span>
+      </div>
+      <div class="tltBtns">
+        <a-button class="blueBtn">修改</a-button>
+        <a-button class="redBtn">停用</a-button>
+      </div>
+    </div>
+    <div class="spotCont">
+      <a-collapse class="spotCollapse"
+                  :bordered="false">
+        <template #expandIcon="props">
+          <svg class="icon svg-icon"
+               aria-hidden="true"
+               v-if="props.isActive == 0">
+            <use xlink:href="#icon-shouqi1"></use>
+          </svg>
+          <svg class="icon svg-icon"
+               aria-hidden="true"
+               v-else>
+            <use xlink:href="#icon-shouqi2"></use>
+          </svg>
+        </template>
+        <a-collapse-panel key="1">
+          <template #header>
+            <a-row class="headRow">
+              <a-col :span="8">品类({{selctedDeliveryGoods.gmlist.length}})</a-col>
+              <a-col :span="8">单位</a-col>
+              <a-col :span="8">标仓系数</a-col>
+            </a-row>
+          </template>
+          <a-row class="contRow"
+                 v-for="(item, i) in selctedDeliveryGoods.gmlist"
+                 :key="i + '11'">
+            <a-col :span="8">{{item.wrstandardname}}</a-col>
+            <a-col :span="8">{{item.enumdicname}}</a-col>
+            <a-col :span="8">{{item.convertfactor}}</a-col>
+          </a-row>
+        </a-collapse-panel>
+        <a-collapse-panel key="2">
+          <template #header>
+            <a-row class="headRow">
+              <a-col :span="24">品牌({{selctedDeliveryGoods.gblist.length}})</a-col>
+            </a-row>
+          </template>
+          <a-row class="contRow"
+                 v-for="(item, i) in selctedDeliveryGoods.gblist"
+                 :key="i + '22'">
+            <a-col :span="24">{{item.brandname}}</a-col>
+          </a-row>
+        </a-collapse-panel>
+        <a-collapse-panel key="3">
+          <template #header>
+            <a-row class="headRow">
+              <a-col :span="8">套保品种({{selctedDeliveryGoods.mgList.length}})</a-col>
+              <a-col :span="8">单位</a-col>
+              <a-col :span="8">套保系数</a-col>
+            </a-row>
+          </template>
+          <template v-for="(item, i) in selctedDeliveryGoods.mgList"
+                    :key="i + '33'">
+            <a-row class="contRow">
+              <a-col :span="8">{{item.mg.middlegoodsname}}</a-col>
+              <a-col :span="8">{{item.mg.enumdicname}}</a-col>
+              <a-col :span="8">{{item.convertratio}}</a-col>
+            </a-row>
+            <a-collapse default-active-key="4-0">
+              <template #expandIcon="props">
+                <svg class="icon svg-icon"
+                     aria-hidden="true"
+                     v-if="props.isActive == 0">
+                  <use xlink:href="#icon-shouqi1"></use>
+                </svg>
+                <svg class="icon svg-icon"
+                     aria-hidden="true"
+                     v-else>
+                  <use xlink:href="#icon-shouqi2"></use>
+                </svg>
+              </template>
+              <a-collapse-panel>
+                <template #header>
+                  <a-row class="headRow">
+                    <a-col :span="8">{{item.mg.relatedgoodstype === 1 ? '期货合约' : '期货品种'}}({{item.gplist.length}})</a-col>
+                    <a-col :span="8">单位</a-col>
+                    <a-col :span="8">品种系数</a-col>
+                  </a-row>
                 </template>
-                <a-collapse-panel key="1">
-                    <template #header>
-                        <a-row class="headRow">
-                            <a-col :span="8">品类(3)</a-col>
-                            <a-col :span="8">单位</a-col>
-                            <a-col :span="8">标仓系数</a-col>
-                        </a-row>
-                    </template>
-                    <a-row class="contRow">
-                        <a-col :span="8">10mm</a-col>
-                        <a-col :span="8">吨</a-col>
-                        <a-col :span="8">1.0</a-col>
-                    </a-row>
-                    <a-row class="contRow">
-                        <a-col :span="8">12mm</a-col>
-                        <a-col :span="8">吨</a-col>
-                        <a-col :span="8">1.1</a-col>
-                    </a-row>
-                    <a-row class="contRow">
-                        <a-col :span="8">15mm</a-col>
-                        <a-col :span="8">吨</a-col>
-                        <a-col :span="8">1.2</a-col>
-                    </a-row>
-                </a-collapse-panel>
-                <a-collapse-panel key="2">
-                    <template #header>
-                        <a-row class="headRow">
-                            <a-col :span="24">品牌(2)</a-col>
-                        </a-row>
-                    </template>
-                    <a-row class="contRow">
-                        <a-col :span="24">江铜</a-col>
-                    </a-row>
-                    <a-row class="contRow">
-                        <a-col :span="24">云铜</a-col>
-                    </a-row>
-                </a-collapse-panel>
-                <a-collapse-panel key="3">
-                    <template #header>
-                        <a-row class="headRow">
-                            <a-col :span="8">套保品种(2)</a-col>
-                            <a-col :span="8">单位</a-col>
-                            <a-col :span="8">套保系数</a-col>
-                        </a-row>
-                    </template>
-                    <a-row class="contRow">
-                        <a-col :span="8">江铜</a-col>
-                        <a-col :span="8">江铜</a-col>
-                        <a-col :span="8">江铜</a-col>
-                    </a-row>
-                    <a-collapse default-active-key="4">
-                        <template #expandIcon="props">
-                            <svg class="icon svg-icon" aria-hidden="true" v-if="props.isActive == 0">
-                                <use xlink:href="#icon-shouqi1"></use>
-                            </svg>
-                            <svg class="icon svg-icon" aria-hidden="true" v-else>
-                                <use xlink:href="#icon-shouqi2"></use>
-                            </svg>
-                        </template>
-                        <a-collapse-panel key="4">
-                            <template #header>
-                                <a-row class="headRow">
-                                    <a-col :span="8">期货品种(2)</a-col>
-                                    <a-col :span="8">单位</a-col>
-                                    <a-col :span="8">品种系数</a-col>
-                                </a-row>
-                            </template>
-                            <a-row class="contRow">
-                                <a-col :span="8">江铜</a-col>
-                                <a-col :span="8">江铜</a-col>
-                                <a-col :span="8">江铜</a-col>
-                            </a-row>
-                        </a-collapse-panel>
-                    </a-collapse>
-                    <a-row class="contRow">
-                        <a-col :span="8">江铜</a-col>
-                        <a-col :span="8">江铜</a-col>
-                        <a-col :span="8">江铜</a-col>
-                    </a-row>
-                    <a-collapse default-active-key="4">
-                        <template #expandIcon="props">
-                            <svg class="icon svg-icon" aria-hidden="true" v-if="props.isActive == 0">
-                                <use xlink:href="#icon-shouqi1"></use>
-                            </svg>
-                            <svg class="icon svg-icon" aria-hidden="true" v-else>
-                                <use xlink:href="#icon-shouqi2"></use>
-                            </svg>
-                        </template>
-                        <a-collapse-panel key="4">
-                            <template #header>
-                                <a-row class="headRow">
-                                    <a-col :span="8">期货品种(2)</a-col>
-                                    <a-col :span="8">单位</a-col>
-                                    <a-col :span="8">品种系数</a-col>
-                                </a-row>
-                            </template>
-                            <a-row class="contRow">
-                                <a-col :span="8">江铜</a-col>
-                                <a-col :span="8">江铜</a-col>
-                                <a-col :span="8">江铜</a-col>
-                            </a-row>
-                            <a-row class="contRow">
-                                <a-col :span="8">江铜</a-col>
-                                <a-col :span="8">江铜</a-col>
-                                <a-col :span="8">江铜</a-col>
-                            </a-row>
-                        </a-collapse-panel>
-                    </a-collapse>
-                </a-collapse-panel>
+                <a-row class="contRow"
+                       v-for="(sub, j) in item.gplist"
+                       :key="j + 'kkk'">
+                  <a-col :span="8">{{sub.goodsgroupname}}</a-col>
+                  <a-col :span="8">{{sub.enumdicname}}</a-col>
+                  <a-col :span="8">{{sub.convertratio}}</a-col>
+                </a-row>
+              </a-collapse-panel>
             </a-collapse>
-        </div>
+          </template>
+        </a-collapse-panel>
+      </a-collapse>
     </div>
+  </div>
 </template>
 
 <script lang="ts">
-    import { defineComponent, ref, PropType } from 'vue';
-    import APP from '@/services';
-    import { initData } from '@/common/methods';
-    import { queryDeliveryGoods } from './setup';
-    export default defineComponent({
-        name: 'rightSpot',
-        props: {},
-        components: {},
-        setup(props, context) {
-            const { goodsList } = queryDeliveryGoods({});
-            initData(() => {});
-            return {
-                goodsList,
-            };
+import { defineComponent, ref, PropType } from 'vue';
+import { handleDG, getGoodsUnit } from '../../setup';
+import { ErmcpDeliveryGoodsDetailEx } from '@/services/go/ermcp/goodsInfo/interface';
+import APP from '@/services';
+import { initData } from '@/common/methods';
+
+export default defineComponent({
+    name: 'rightSpot',
+    props: {
+        selctedDeliveryGoods: {
+            default: handleDG,
+            type: Object as PropType<ErmcpDeliveryGoodsDetailEx>,
         },
-    });
+    },
+    components: {},
+    setup(props, context) {
+        initData(() => {});
+        return { getGoodsUnit };
+    },
+});
 </script>
 
 <style lang="less">
-    .rightSpot {
+.rightSpot {
+    width: 100%;
+    height: 100%;
+    padding: 10px 12px;
+    .flex;
+    flex-direction: column;
+    .title {
         width: 100%;
-        height: 100%;
-        padding: 10px 12px;
+        height: 35px;
         .flex;
-        flex-direction: column;
-        .title {
-            width: 100%;
-            height: 35px;
-            .flex;
-            justify-content: space-between;
-            div {
-                align-self: center;
-                align-items: center;
-            }
-            .tltLeft {
-                font-size: 16px;
-                .icon {
-                    font-size: 20px;
-                    fill: @m-blue0;
-                    margin-right: 10px;
-                }
-            }
-            .tltBtns {
-                .ant-btn + .ant-btn {
-                    margin-left: 10px;
-                }
+        justify-content: space-between;
+        div {
+            align-self: center;
+            align-items: center;
+        }
+        .tltLeft {
+            font-size: 16px;
+            .icon {
+                font-size: 20px;
+                fill: @m-blue0;
+                margin-right: 10px;
             }
         }
-        .spotCont {
-            width: 100%;
-            padding: 0 30px;
+        .tltBtns {
+            .ant-btn + .ant-btn {
+                margin-left: 10px;
+            }
         }
     }
-    .blue {
-        color: @m-blue0;
+    .spotCont {
+        width: 100%;
+        padding: 0 30px;
     }
-    .green {
-        color: @m-green0;
+}
+.blue {
+    color: @m-blue0;
+}
+.green {
+    color: @m-green0;
+}
+.ml10 {
+    margin-left: 10px;
+}
+.blueBtn {
+    width: 80px;
+    height: 26px;
+    text-align: center;
+    background: linear-gradient(0deg, @m-blue2, @m-blue0);
+    box-shadow: -1px 0px 0px 0px #121618;
+    .rounded-corners(3px);
+    border: 0;
+    color: @m-white0;
+    font-size: 14px;
+    &:hover,
+    &:focus {
+        background: linear-gradient(0deg, @m-blue2-hover, @m-blue0-hover);
+        color: @m-white0-hover;
     }
-    .ml10 {
-        margin-left: 10px;
+}
+.redBtn {
+    width: 80px;
+    height: 26px;
+    background: linear-gradient(0deg, @m-red0, @m-red1);
+    .rounded-corners(3px);
+    border: 0;
+    color: @m-white0;
+    font-size: 14px;
+    &:hover,
+    &:focus {
+        background: linear-gradient(0deg, @m-red0-hover, @m-red1-hover);
+        color: @m-white0-hover;
     }
-    .blueBtn {
-        width: 80px;
-        height: 26px;
-        text-align: center;
-        background: linear-gradient(0deg, @m-blue2, @m-blue0);
-        box-shadow: -1px 0px 0px 0px #121618;
-        .rounded-corners(3px);
+}
+.ant-collapse {
+    background-color: transparent;
+    border: 0;
+    .ant-collapse-item {
         border: 0;
-        color: @m-white0;
-        font-size: 14px;
-        &:hover,
-        &:focus {
-            background: linear-gradient(0deg, @m-blue2-hover, @m-blue0-hover);
-            color: @m-white0-hover;
+        .ant-collapse-header {
+            background-color: transparent;
+            border-bottom: 0;
         }
-    }
-    .redBtn {
-        width: 80px;
-        height: 26px;
-        background: linear-gradient(0deg, @m-red0, @m-red1);
-        .rounded-corners(3px);
-        border: 0;
-        color: @m-white0;
-        font-size: 14px;
-        &:hover,
-        &:focus {
-            background: linear-gradient(0deg, @m-red0-hover, @m-red1-hover);
-            color: @m-white0-hover;
+        .ant-collapse-content {
+            background-color: transparent;
+            border-top: 0;
         }
     }
-    .ant-collapse {
-        background-color: transparent;
-        border: 0;
-        .ant-collapse-item {
-            border: 0;
-            .ant-collapse-header {
-                background-color: transparent;
-                border-bottom: 0;
-            }
-            .ant-collapse-content {
-                background-color: transparent;
-                border-top: 0;
+}
+.ant-collapse.spotCollapse.ant-collapse-borderless {
+    margin-top: 10px;
+    background-color: transparent;
+    .ant-collapse-item {
+        border-bottom: 0;
+        .ant-collapse-header {
+            color: @m-grey17;
+            font-size: 14px;
+            border-bottom: 1px solid @m-grey18;
+            padding: 10px 8px 10px 44px;
+            height: 43px;
+            .ant-collapse-arrow {
+                fill: @m-grey17;
+                width: 16px;
+                height: 16px;
+                font-size: 16px;
+                left: 0;
             }
         }
-    }
-    .ant-collapse.spotCollapse.ant-collapse-borderless {
-        margin-top: 10px;
-        background-color: transparent;
-        .ant-collapse-item {
-            border-bottom: 0;
-            .ant-collapse-header {
-                color: @m-grey17;
-                font-size: 14px;
-                border-bottom: 1px solid @m-grey18;
-                padding: 10px 8px 10px 44px;
-                height: 43px;
-                .ant-collapse-arrow {
-                    fill: @m-grey17;
-                    width: 16px;
-                    height: 16px;
+        .ant-collapse-content {
+            .ant-collapse-content-box {
+                padding: 0 0 0 30px;
+                background-color: transparent;
+                .ant-row.contRow {
+                    width: 100%;
+                    height: 40px;
+                    line-height: 40px;
                     font-size: 16px;
-                    left: 0;
-                }
-            }
-            .ant-collapse-content {
-                .ant-collapse-content-box {
-                    padding: 0 0 0 30px;
-                    background-color: transparent;
-                    .ant-row.contRow {
-                        width: 100%;
-                        height: 40px;
-                        line-height: 40px;
-                        font-size: 16px;
-                        color: @m-white1;
-                        margin-bottom: 10px;
-                        background: #0f161c;
-                        border: 1px solid #172b56;
-                        border-radius: 3px;
-                        padding-left: 14px;
-                        padding-right: 12px;
-                        .ant-col:last-child {
-                            text-align: right;
-                        }
-                        .ant-col:first-child {
-                            text-align: left;
-                        }
+                    color: @m-white1;
+                    margin-bottom: 10px;
+                    background: #0f161c;
+                    border: 1px solid #172b56;
+                    border-radius: 3px;
+                    padding-left: 14px;
+                    padding-right: 12px;
+                    .ant-col:last-child {
+                        text-align: right;
                     }
-                    .contRow:first-child {
-                        margin-top: 9px;
-                    }
-                    .contRow:last-child {
-                        margin-bottom: 20px;
+                    .ant-col:first-child {
+                        text-align: left;
                     }
                 }
+                .contRow:first-child {
+                    margin-top: 9px;
+                }
+                .contRow:last-child {
+                    margin-bottom: 20px;
+                }
             }
         }
     }
-    .ant-row.headRow {
-        .ant-col:first-child {
-            text-align: left;
-        }
-        .ant-col:nth-child(3) {
-            text-align: right;
-        }
-    }</style
+}
+.ant-row.headRow {
+    .ant-col:first-child {
+        text-align: left;
+    }
+    .ant-col:nth-child(3) {
+        text-align: right;
+    }
+}
+</style
 >;

+ 0 - 13
src/views/information/goods/components/rightSpot/setup.ts

@@ -1,13 +0,0 @@
-import { QueryDeliveryGoods } from '@/services/go/ermcp/goodsInfo';
-import { ErmcpDeliveryGoodsReq, ErmcpDeliveryGoodsRsp } from '@/services/go/ermcp/goodsInfo/interface';
-import { ref } from 'vue';
-
-export function queryDeliveryGoods(req: ErmcpDeliveryGoodsReq) {
-    let goodsList = ref<ErmcpDeliveryGoodsRsp[] | []>([]);
-    QueryDeliveryGoods(req).then((res) => {
-        goodsList.value = res;
-    });
-    return {
-        goodsList,
-    };
-}

+ 6 - 8
src/views/information/goods/list/spot-variety/index.vue

@@ -9,10 +9,10 @@
     <div class="spotTableCont">
       <div class="leftSpot">
         <leftMenu :menuList="menuList"
-                  @chooseMenu="chooseMenu"></leftMenu>
+                  @chooseMenu="chooseDG"></leftMenu>
       </div>
       <div class="rightCont">
-        <rightSpot></rightSpot>
+        <rightSpot :selctedDeliveryGoods="selctedDeliveryGoods"></rightSpot>
       </div>
     </div>
     <!-- 新增商品 -->
@@ -29,7 +29,7 @@ import rightSpot from '@/views/information/goods/components/rightSpot/index.vue'
 import { openModal } from '@/common/setup/modal/index';
 import { initData } from '@/common/methods/index';
 import AddGoods from '@/views/information/goods/components/add/index.vue';
-import { handleDG } from './setup';
+import { handleDG } from '../../setup';
 
 export default defineComponent({
     name: 'spot-variety',
@@ -41,15 +41,13 @@ export default defineComponent({
     },
     setup() {
         const { openAction: addAction } = openModal('spot_contract_btn_add');
-        const { loading, deliveryGoodsList, menuList, queryDG } = handleDG();
-        function chooseMenu(key: string) {
-            deliveryGoodsList.value.find((e) => e.data.deliverygoodsid === Number(key));
-        }
+        const { loading, selctedDeliveryGoods, chooseDG, menuList, queryDG } = handleDG();
+
         initData(() => {
             // 加载数据在这里
             queryDG();
         });
-        return { addAction, loading, menuList };
+        return { addAction, loading, selctedDeliveryGoods, chooseDG, menuList };
     },
 });
 </script>

+ 0 - 75
src/views/information/goods/list/spot-variety/setup.ts

@@ -1,75 +0,0 @@
-import { QueryDeliveryGoodsDetail } from '@/services/go/ermcp/goodsInfo';
-import { ErmcpDeliveryGoodsDetailEx, MenuList } from '@/services/go/ermcp/goodsInfo/interface';
-import { mergeObj } from '@/utils/objHandle';
-import { message } from 'ant-design-vue';
-import { reactive, ref } from 'vue';
-
-/**
- * 获取现货品种数据
- * @returns 
- */
-export function handleDG() {
-    const loading = ref<boolean>(false);
-    // 现货品种列表
-    const deliveryGoodsList = ref<ErmcpDeliveryGoodsDetailEx[]>([])
-    // 选中的具体某一天现货品种数据
-    const selctedDeliveryGoods = reactive<ErmcpDeliveryGoodsDetailEx>({
-        data: {
-            agreeunit: 0,
-            areauserid: 0,
-            auditflag: 0,
-            categoryid: 0,
-            deliverygoodscode: '',
-            deliverygoodsid: 0,
-            deliverygoodsname: '--',
-            deliverygoodstype: 0,
-            dgstatus: 0,
-            enumdicname: '--',
-            goodsunitid: 0,
-            isvalid: 0,
-            qtydecimalplace: 0,
-            remark: '',
-            standardqty: 0,
-            standardqtyrange: 0
-        },
-        gblist: [],
-        gmlist: [],
-        mgList: [],
-    })
-    const menuList = ref<MenuList[]>([
-        { key: '1', title: '正常', children: [] },
-        { key: '2', title: '停用', children: [] },
-    ]);
-    // 获取现货品种数据
-    function queryDG(param?: number) {
-        loading.value = true;
-        QueryDeliveryGoodsDetail(param).then(res => {
-            deliveryGoodsList.value = res;
-            res.forEach(e => {
-                const { dgstatus, isvalid, deliverygoodsname, deliverygoodsid } = e.data
-                if (isvalid) { // 有效 
-                    const index = dgstatus ? 0 : 1; // 0:未激活 1:正常
-                    const obj = { key: deliverygoodsid.toString(), title: deliverygoodsname }
-                    menuList.value[index].children?.push(obj)
-                }
-            })
-            // 获取默认第一条数据
-            if (menuList.value[0].children?.length) {
-                chooseDG(menuList.value[0].children[0].key)
-            } else if (menuList.value[1].children?.length) {
-                chooseDG(menuList.value[1].children[0].key)
-            }
-            console.log('selctedDeliveryGoods', selctedDeliveryGoods);
-        }).catch(err => {
-            message.error(err)
-        }).finally(() => loading.value = false)
-    }
-    // 选择某条现货数据
-    function chooseDG(key: string) {
-        const obj = deliveryGoodsList.value.find(e => e.data.deliverygoodsid === Number(key))
-        if (obj) {
-            mergeObj(selctedDeliveryGoods, obj)
-        }
-    }
-    return { loading, deliveryGoodsList, menuList, queryDG, selctedDeliveryGoods, chooseDG }
-}

+ 108 - 0
src/views/information/goods/setup.ts

@@ -0,0 +1,108 @@
+import { getItemEnum } from '@/services/bus/allEnum';
+import { QueryDeliveryGoodsDetail } from '@/services/go/ermcp/goodsInfo';
+import { ErmcpDeliveryGoodsDetailEx, MenuList } from '@/services/go/ermcp/goodsInfo/interface';
+import { mergeObj } from '@/utils/objHandle';
+import { message } from 'ant-design-vue';
+import { reactive, ref } from 'vue';
+
+/**
+ * 初始化 现货品种对象数据
+ * @returns 
+ */
+export function initDG(): ErmcpDeliveryGoodsDetailEx {
+    return {
+        data: {
+            agreeunit: 0,
+            areauserid: 0,
+            auditflag: 0,
+            categoryid: 0,
+            deliverygoodscode: '',
+            deliverygoodsid: 0,
+            deliverygoodsname: '--',
+            deliverygoodstype: 0,
+            dgstatus: 0,
+            enumdicname: '--',
+            goodsunitid: 0,
+            isvalid: 0,
+            qtydecimalplace: 0,
+            remark: '',
+            standardqty: 0,
+            standardqtyrange: 0
+        },
+        gblist: [],
+        gmlist: [],
+        mgList: [],
+    }
+}
+
+/**
+ * 初始化 菜单数据
+ * @returns 
+ */
+export function initMenu(): MenuList[] {
+    return [
+        { key: '1', title: '正常', children: [] },
+        { key: '2', title: '停用', children: [] },
+    ]
+}
+
+/**
+ * 获取现货品种数据
+ * @returns 
+ */
+export function handleDG() {
+    const loading = ref<boolean>(false);
+    // 现货品种列表
+    const deliveryGoodsList = ref<ErmcpDeliveryGoodsDetailEx[]>([])
+    // 选中的具体某一天现货品种数据
+    const selctedDeliveryGoods = reactive<ErmcpDeliveryGoodsDetailEx>(initDG())
+    const menuList = ref<MenuList[]>(initMenu());
+    // 获取现货品种数据
+    function queryDG(param?: number) {
+        loading.value = true;
+        QueryDeliveryGoodsDetail(param).then(res => {
+            deliveryGoodsList.value = res;
+            res.forEach(e => {
+                const { dgstatus, isvalid, deliverygoodsname, deliverygoodsid } = e.data
+                if (isvalid) { // 有效 
+                    const index = dgstatus ? 0 : 1; // 0:未激活 1:正常
+                    const obj = { key: deliverygoodsid.toString(), title: deliverygoodsname }
+                    menuList.value[index].children?.push(obj)
+                }
+            })
+            // 获取默认第一条数据
+            if (menuList.value[0].children?.length) {
+                chooseDG(menuList.value[0].children[0].key)
+            } else if (menuList.value[1].children?.length) {
+                chooseDG(menuList.value[1].children[0].key)
+            }
+        }).catch(err => {
+            message.error(err)
+        }).finally(() => loading.value = false)
+    }
+    // 选择某条现货数据
+    function chooseDG(key: string) {
+        const obj = deliveryGoodsList.value.find(e => e.data.deliverygoodsid === Number(key))
+        if (obj) {
+            mergeObj(selctedDeliveryGoods, obj)
+            console.log('selctedDeliveryGoods', selctedDeliveryGoods);
+        }
+    }
+    return { loading, deliveryGoodsList, menuList, queryDG, selctedDeliveryGoods, chooseDG }
+}
+
+/**
+ * 获取合约单位
+ * @returns 
+ */
+export function getGoodsUnit(unit: number) {
+    return getGoodsUnitList().find(e => e.enumitemname === unit)?.enumdicname
+}
+
+/**
+ * 获取现货品种单位列表
+ * @returns 
+ */
+export function getGoodsUnitList() {
+    return getItemEnum('goodsunit')
+}