Преглед на файлове

Merge remote-tracking branch 'origin/master'

xkwg преди 4 години
родител
ревизия
bcfeac3109

+ 12 - 11
src/common/setup/table/button.ts

@@ -1,7 +1,7 @@
 import { ModalName } from '@/common/constants/modalName';
 import { OperationTabMenu } from '@/services/go/commonService/interface';
 import { sessionStorageUtil } from "@/utils/storage";
-import { inject, onUnmounted, ref, Ref } from 'vue';
+import { inject, ref, Ref, toRaw, unref } from 'vue';
 import { openModal } from "../modal";
 import { BtnClassName, BtnList, ButtonListKey } from './interface';
 
@@ -24,6 +24,16 @@ function getClassName(val: string): BtnClassName {
     return result
 }
 
+export function getThirdMenuData(): OperationTabMenu[] {
+    const permissionData = inject('thirdMenuList') as Ref<OperationTabMenu[]>;
+    const temp = unref(permissionData)
+    const name = 'permissionData'
+    // 存入sessionStorageUtil 是为了处理页面刷新的情况(这个时候重新从服务获取数据,但页面已经先加载了,vue 中的 依赖注入在异步中不能建立通信)
+    const data: OperationTabMenu[] = temp.length ? toRaw(temp) : sessionStorageUtil.getItem(name)
+    sessionStorageUtil.setItem(name, data)
+    return data;
+}
+
 /**
  * 获取表格操作按钮列表
  * @param menuType 
@@ -32,12 +42,7 @@ function getClassName(val: string): BtnClassName {
  */
 export function getBtnList(menuType: keyof ButtonListKey, hasDetail: boolean) {
     // 获取 数据
-    const permissionData = inject('thirdMenuList') as Ref<OperationTabMenu[]>;
-    const name = 'permissionData'
-    // 存入sessionStorageUtil 是为了处理页面刷新的情况(这个时候重新从服务获取数据,但页面已经先加载了,vue 中的 依赖注入在异步中不能建立通信)
-    const data: OperationTabMenu[] = permissionData.value.length ? permissionData.value : sessionStorageUtil.getItem(name) ? sessionStorageUtil.getItem(name) : []
-    sessionStorageUtil.setItem(name, data)
-
+    const data = getThirdMenuData()
     const commonBtn = ref<BtnList[]>([]); // 通用按钮列表,不用选中数据才显示
     const forDataBtn = ref<BtnList[]>([]); // 针对数据按钮列表,选中某条数据才显示
 
@@ -64,9 +69,5 @@ export function getBtnList(menuType: keyof ButtonListKey, hasDetail: boolean) {
         const { openAction } = openModal('detail')
         forDataBtn.value.push({ lable: '详情', callback: openAction, className: getClassName('') })
     }
-
-    onUnmounted(() => {
-        sessionStorageUtil.removeItem(name)
-    });
     return { commonBtn, forDataBtn }
 }

+ 3 - 0
src/common/setup/table/interface.ts

@@ -21,6 +21,9 @@ export interface ButtonListKey {
     spot_contract_performance: string; // 现货合同 履约中
     spot_contract_finished: string; // 现货合同 已完成
 
+    goods_info_spot_normal: string; // 现货品种 正常
+    goods_info_spot_disable: string; // 现货品种 停用
+
     warehouse_info_normal: string; // 仓库信息 正常
     warehouse_info_disabled: string; // 仓库信息 停用
 

+ 13 - 0
src/common/setup/validate/index.ts

@@ -0,0 +1,13 @@
+/**
+ * 通用空值验证方法
+ * @param value 
+ * @param errInfo 
+ * @returns 
+ */
+export function validateCommon(value: any, errInfo: string) {
+    if (value) {
+        return Promise.resolve();
+    } else {
+        return Promise.reject(errInfo);
+    }
+}

+ 8 - 7
src/services/go/ermcp/goodsInfo/index.ts

@@ -1,6 +1,7 @@
 /** ================================= 信息 - 现货商品信息 ================================**/
 
 import APP from '@/services';
+import { getUserId } from "@/services/bus/account";
 import { commonSearch_go } from '@/services/go/index';
 import {
     Ermcp3Brand, Ermcp3GoodsGroup, Ermcp3MiddleGoodsDetailEx,
@@ -9,7 +10,6 @@ import {
     ErmcpDeliveryGoodsReq,
     ErmcpDeliveryGoodsRsp, ErmcpMiddleGoodsModel
 } from './interface';
-import {getUserId} from "@/services/bus/account";
 
 /**
  * 查询现货商品 /Ermcp3/QueryDeliveryGoods
@@ -64,9 +64,10 @@ export function QueryDeliveryGoodsDetail(deliverygoodsid?: number): Promise<Ermc
  * @param excludecfg 排除套保品中已关联的商品组 1-排除
  * @constructor
  */
-export function QueryGoodsfGroup(excludecfg: number): Promise<Ermcp3GoodsGroup[]> {
+export function QueryGoodsfGroup(excludecfg?: number): Promise<Ermcp3GoodsGroup[]> {
     const areauserid = APP.get('userAccount').memberuserid; // 所属机构id
-    return commonSearch_go('Ermcp3/QueryGoodsGroup', { areauserid, excludecfg }).catch((err) => {
+    const param = excludecfg ? { areauserid, excludecfg } : { areauserid }
+    return commonSearch_go('/Ermcp3/QueryGoodsGroup', param).catch((err) => {
         throw new Error(`查询期货商品组: ${err.message}`);
     });
 }
@@ -77,9 +78,9 @@ export function QueryGoodsfGroup(excludecfg: number): Promise<Ermcp3GoodsGroup[]
  * @param status 状态 0-停用 1-正常
  * @constructor
  */
-export function QueryMiddleGoods(status: number):  Promise<ErmcpMiddleGoodsModel[]> {
+export function QueryMiddleGoods(status: number): Promise<ErmcpMiddleGoodsModel[]> {
     const userid = getUserId(); // 所属机构id
-    return commonSearch_go('Ermcp/QueryMiddleGoods', { userid, status }).catch((err) => {
+    return commonSearch_go('/Ermcp/QueryMiddleGoods', { userid, status }).catch((err) => {
         throw new Error(`查询套保品种: ${err.message}`);
     });
 }
@@ -89,9 +90,9 @@ export function QueryMiddleGoods(status: number):  Promise<ErmcpMiddleGoodsModel
  * @param middlegoodsid 套保品种id
  * @constructor
  */
-export function QueryMiddleGoodsDetail(middlegoodsid: number):  Promise<Ermcp3MiddleGoodsDetailEx[]> {
+export function QueryMiddleGoodsDetail(middlegoodsid: number): Promise<Ermcp3MiddleGoodsDetailEx[]> {
     const areauserid = APP.get('userAccount').memberuserid; // 所属机构id
-    return commonSearch_go('Ermcp3/QueryMiddleGoodsDetail', { areauserid, middlegoodsid }).catch((err) => {
+    return commonSearch_go('/Ermcp3/QueryMiddleGoodsDetail', { areauserid, middlegoodsid }).catch((err) => {
         throw new Error(`查询套保品种详情(套保品种/商品详情): ${err.message}`);
     });
 }

+ 4 - 4
src/services/index.ts

@@ -1,6 +1,6 @@
-import { funCode } from '@/services/funcode/index';
 import { checkTokenLoop } from '@/services/bus/token';
 import { NeedClearSourceDataType, NoClearSourceDataType } from '@/services/dataCenter/interface';
+import { funCode } from '@/services/funcode/index';
 import { serviceURL } from '@/services/request/index';
 import timerUtil from '@/utils/timer/timerUtil';
 import { Callback, MTP2WebSocket, ReconnectChangeState } from '@/utils/websocket/index';
@@ -29,10 +29,10 @@ export default new (class LifeCycleCtr {
         trade: new MTP2WebSocket<Package50>(1),
     };
 
-    constructor() {}
+    constructor() { }
 
     /** 数据中心初始化 */
-    initDataCenter(): void {}
+    initDataCenter(): void { }
 
     /**
      * 从数据中心获取普通数据
@@ -137,7 +137,7 @@ export default new (class LifeCycleCtr {
     closeServer(): void {
         this.Socket['trade'].close();
         this.dataCenter.reset();
-        sessionStorage.clear();
+        // sessionStorage.clear();
         // localStorageUtil.removeItem('loginData');
         timerUtil.clearAll();
     }

+ 1 - 1
src/utils/storage/sessionStorage.ts

@@ -1,4 +1,4 @@
-import { toBase64, parseBase64 } from './base64/index';
+import { parseBase64, toBase64 } from './base64/index';
 
 /**
  * 封装LocalStorage,做了 JSON序列化, URI 组件编码,base-64编码 处理

+ 34 - 29
src/views/information/goods/components/add/index.vue

@@ -303,21 +303,22 @@
                            :rules="rules.wrsconvertdetails.middlegoodsid">
                 <a-select class="inlineFormSelect"
                           style="width: 200px"
+                          @change="middleChange(domain.middlegoodsid, domain)"
                           v-model:value="domain.middlegoodsid"
-                          placeholder="请选择品类">
-                  <a-select-option v-for="item in unitList"
-                                   :value="item.enumitemname"
-                                   :key="item.autoid">
-                    {{item.enumdicname}}
+                          placeholder="请选择套保品种">
+                  <a-select-option v-for="item in goodsGroup"
+                                   :value="item.groupcategroyid"
+                                   :key="item.groupcategroyid">
+                    {{item.goodsgroupname}}
                   </a-select-option>
                 </a-select>
               </a-form-item>
             </a-col>
             <a-col :span="6">
-              <a-form-item :name="['wrsconvertdetails', index, 'unitid']">
+              <a-form-item :name="['wrsconvertdetails', index, 'unitidName']">
                 <a-input class="dialogInput"
                          readonly
-                         v-model:value="domain.unitid"
+                         v-model:value="domain.unitidName"
                          placeholder="选择套保品种后自动填入"></a-input>
               </a-form-item>
             </a-col>
@@ -405,28 +406,26 @@
 </template>
 
 <script lang="ts">
-import { defineComponent, ref, reactive, toRaw, UnwrapRef } from 'vue';
+import { defineComponent, ref, toRaw } 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, handleFromState } from './setup';
-import { DeliveryGoodsApplyReq } from '@/services/proto/delivery/interface';
+import { handleAdd, handleFromState, handleGoodsGroup, getGoodsUnit } from './setup';
 import { getGoodsUnitList } from '../../setup';
 import { RuleObject, ValidateErrorEntity } from 'ant-design-vue/es/form/interface';
-import { FormState } from './interface';
-
-const validateCommon = (value: any, errInfo: string) => {
-    if (value) {
-        return Promise.resolve();
-    } else {
-        return Promise.reject(errInfo);
-    }
-};
+import { FormState, WRSConvertDetailEx } from './interface';
+import { validateCommon } from '@/common/setup/validate';
 
+/**
+ * 检验单位
+ */
 const validateUnit = async (rule: RuleObject, value: number) => {
     return validateCommon(value, '请选择单位');
 };
 
+/**
+ *
+ */
 const valideteWR = async (rule: RuleObject, value: number) => {
     return validateCommon(value, '请选择品类');
 };
@@ -533,11 +532,6 @@ export default defineComponent({
                 .catch((error: ValidateErrorEntity<FormState>) => {
                     console.log('error', error);
                 });
-            // loading.value = true;
-            // setTimeout(() => {
-            //     loading.value = false;
-            //     cancel();
-            // }, 2000);
         }
 
         // 表单
@@ -559,11 +553,21 @@ export default defineComponent({
                 middlegoodsid: { required: true, validator: valideteWR, trigger: 'change' },
                 convertratio: { required: true, message: '请输入套保系数', trigger: 'blur' },
             },
-            // nickname: [{ required: true, message: '请输入企业简称', trigger: 'blur' }],
-            // cardtype: [{ required: true, message: '请选择证件类型', trigger: 'change' }],
         };
-
-        initData(() => {});
+        const { goodsGroup, getGoodsGroup } = handleGoodsGroup();
+        /**
+         * 切换套保品种时候,获取对应的单位
+         */
+        function middleChange(id: number, value: WRSConvertDetailEx) {
+            const obj = goodsGroup.value.find((e) => e.groupcategroyid === id);
+            if (obj) {
+                value.unitidName = getGoodsUnit(obj.agreeunit);
+                value.unitid = obj.agreeunit;
+            }
+        }
+        initData(() => {
+            getGoodsGroup();
+        });
         return {
             visible,
             cancel,
@@ -573,7 +577,8 @@ export default defineComponent({
             deleteOne,
             rules,
             unitList,
-
+            goodsGroup,
+            middleChange,
             submit,
             loading,
             dataSource,

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

@@ -15,6 +15,7 @@ export interface GLDDGFactoryItemEx {
 export interface WRSConvertDetailEx {
     middlegoodsid: number | undefined // uint64 套保品种ID(接口为3.1及以下版本时传套保品种ID,否则传期货品种ID)
     unitid: number | null// uint64 单位ID
+    unitidName: string;
     convertratio: number | null// double 套保系数
 }
 export interface FormState {

+ 39 - 2
src/views/information/goods/components/add/setup.ts

@@ -1,9 +1,16 @@
+import { getItemEnum } from '@/services/bus/allEnum';
+import { QueryGoodsfGroup } from '@/services/go/ermcp/goodsInfo';
+import { Ermcp3GoodsGroup } from '@/services/go/ermcp/goodsInfo/interface';
 import { addDeliveryGoodsApply } from '@/services/proto/delivery';
 import { DeliveryGoodsApplyReq } from '@/services/proto/delivery/interface';
 import { message } from 'ant-design-vue';
 import { reactive, ref, UnwrapRef } from 'vue';
 import { FormState } from './interface';
 
+/**
+ * 处理新增
+ * @returns 
+ */
 export function handleAdd() {
     const loading = ref<boolean>(false);
     function addAction(param: DeliveryGoodsApplyReq) {
@@ -17,6 +24,10 @@ export function handleAdd() {
     return { loading, addAction }
 }
 
+/**
+ * 处理表单数据
+ * @returns 
+ */
 export function handleFromState() {
     const formState: UnwrapRef<FormState> = reactive({
         deliverygoodscode: '', // string 交割商品代码(新增时有值)
@@ -32,7 +43,7 @@ export function handleFromState() {
             { dgfactoryitemvalue: '', }
         ], //   GLDDGFactoryItemEx 现货商品品牌数据
         wrsconvertdetails: [
-            { middlegoodsid: undefined, unitid: null, convertratio: null, }
+            { middlegoodsid: undefined, unitid: null, unitidName: '', convertratio: null, }
         ], // WRSConvertDetailEx 现货商品折算配置明细数据
     });
     type Key = 'gldwrstandards' | 'glddgfactoryItems' | 'wrsconvertdetails'
@@ -46,7 +57,7 @@ export function handleFromState() {
         } else if (key === 'glddgfactoryItems') {
             formState[key].push({ dgfactoryitemvalue: '', })
         } else if (key === 'wrsconvertdetails') {
-            formState[key].push({ middlegoodsid: undefined, unitid: null, convertratio: null, })
+            formState[key].push({ middlegoodsid: undefined, unitid: null, unitidName: '', convertratio: null, })
         }
     }
     /**
@@ -60,3 +71,29 @@ export function handleFromState() {
     return { formState, addOne, deleteOne }
 }
 
+/**
+ * 获取期货商品组
+ * @returns 
+ */
+export function handleGoodsGroup() {
+    const goodsGroup = ref<Ermcp3GoodsGroup[]>([])
+    function getGoodsGroup() {
+        QueryGoodsfGroup().then(res => {
+            console.log('获取期货商品组', res);
+
+            goodsGroup.value = res;
+        }).catch(err => {
+            message.error(err)
+        })
+    }
+    return { goodsGroup, getGoodsGroup }
+}
+
+/**
+ * 获取合约单位
+ * @returns 
+ */
+export function getGoodsUnit(unit: number): string {
+    const obj = getItemEnum('goodsunit').find(e => e.enumitemname === unit);
+    return obj ? obj.enumdicname : '--'
+}

+ 163 - 0
src/views/information/goods/components/disable/index.vue

@@ -0,0 +1,163 @@
+<template>
+  <!-- 停用客户资料-->
+  <a-modal class="commonModal warehouse-disable"
+           title="停用客户资料"
+           v-model:visible="visible"
+           centered
+           :maskClosable="maskClosableFlag"
+           @cancel="cancel"
+           width="890px">
+    <template #footer>
+      <a-button key="submit"
+                class="cancelBtn"
+                @click="cancel">取消</a-button>
+      <a-button key="submit"
+                type="primary"
+                :loading="loading"
+                @click="submit">确认停用</a-button>
+    </template>
+    <a-form class="inlineForm"
+            :form="form"
+            @submit="handleSearch">
+      <a-row :gutter="24">
+        <a-col :span="12">
+          <a-form-item label="客户类型">
+            <span class="white">{{ 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, 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";
+import {Modal} from "ant-design-vue";
+
+export default defineComponent({
+    name: 'custom-disable',
+    components: {},
+    props: {
+        selectedRow: {
+            type: Object as PropType<QueryCustomInfoType>,
+            default: {},
+        },
+    },
+    setup(props) {
+        const { visible, cancel } = closeModal('custom_info_btn_disable');
+        const maskClosableFlag = ref<boolean>(false);
+        const  {loading, ModifyUserInfo} = updateUserAccount();
+        function submit() {
+            Modal.confirm({
+                title: '是否确认停用客户资料',
+                okText: '确认停用',
+                cancelText: '取消',
+                onOk() {
+                    ModifyUserInfo(props.selectedRow.userid, 6, cancel);
+                },
+                onCancel() {
+                    console.log('Cancel');
+                },
+            });
+        }
+        return {
+            visible,
+            cancel,
+            submit,
+            loading,
+            maskClosableFlag,
+            formatValue,
+            getStatusName,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+.warehouse-disable {
+}
+</style>

+ 4 - 14
src/views/information/goods/components/leftMenu/index.vue

@@ -33,22 +33,13 @@ const handleMenu = (context: SetupContext) => {
     const collapsed = ref<boolean>(false);
     const selectedKeys = ref<string[]>(['1-0']);
     const openKeys = ref<string[]>(['1']);
-    const preOpenKeys = ref<string[]>(['1']);
-
-    // 控制菜单是否隐藏
-    function collapse(collapsed: boolean) {
-        if (collapsed) {
-            preOpenKeys.value = openKeys.value;
-            openKeys.value = [];
-        } else {
-            openKeys.value = preOpenKeys.value;
-        }
-    }
 
     function menuClick(value: any) {
+        console.log('value', value);
+
         context.emit('chooseMenu', value.key);
     }
-    return { collapsed, selectedKeys, openKeys, collapse, menuClick };
+    return { collapsed, selectedKeys, openKeys, menuClick };
 };
 
 export default defineComponent({
@@ -61,12 +52,11 @@ export default defineComponent({
     },
     components: {},
     setup(props, context) {
-        const { collapsed, selectedKeys, openKeys, collapse, menuClick } = handleMenu(context);
+        const { collapsed, selectedKeys, openKeys, menuClick } = handleMenu(context);
 
         return {
             menuClick,
             collapsed,
-            collapse,
             selectedKeys,
             openKeys,
         };

+ 256 - 0
src/views/information/goods/components/modify/index.vue

@@ -0,0 +1,256 @@
+<template>
+  <!-- 修改客户资料 -->
+  <a-modal class="commonModal modify-custom"
+           title="修改客户资料"
+           v-if="visible"
+           v-model:visible="visible"
+           centered
+           :maskClosable="maskClosableFlag"
+           @cancel="cancel"
+           width="890px">
+    <template #footer>
+      <a-button key="submit"
+                type="primary"
+                :loading="loading"
+                @click="submit">完成</a-button>
+    </template>
+    <a-form class="inlineForm"
+            :form="form"
+            @submit="handleSearch">
+      <a-row :gutter="24">
+        <a-col :span="12">
+          <a-form-item label="客户类型">
+            <a-select class="typeSelect"
+                      style="width: 200px"
+                      placeholder="请选择客户类型">
+              <a-select-option value="1">
+                客户一
+              </a-select-option>
+              <a-select-option value="2">
+                客户二
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="企业名称">
+            <a-input class="dialogInput"
+                     style="width: 200px"
+                     placeholder="请输入企业名称" />
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-col :span="12">
+          <a-form-item label="企业简称">
+            <a-input class="dialogInput"
+                     style="width: 200px"
+                     placeholder="请输入企业简称" />
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="证件类型">
+            <a-select class="inlineFormSelect"
+                      style="width: 200px"
+                      placeholder="请选择证件类型">
+              <a-select-option value="1">
+                客户一
+              </a-select-option>
+              <a-select-option value="2">
+                客户二
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-col :span="12">
+          <a-form-item label="法定代表人">
+            <a-input class="dialogInput"
+                     style="width: 200px"
+                     placeholder="请输入法定代表人" />
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="证件号码">
+            <a-input class="dialogInput"
+                     style="width: 200px"
+                     placeholder="请输入证件号码" />
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-col :span="12">
+          <a-form-item label="纳税人识别号">
+            <a-input class="dialogInput"
+                     style="width: 200px"
+                     placeholder="请输入纳税人识别号" />
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="营业执照">
+            <div class="upload">
+              <a-upload action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
+                        :transform-file="transformFile">
+                <a-button class="uploadBtn">上传</a-button>
+              </a-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="联系人">
+            <a-input class="dialogInput"
+                     style="width: 200px"
+                     placeholder="请输入联系人" />
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item label="联系人手机号">
+            <a-input class="dialogInput"
+                     style="width: 200px"
+                     placeholder="请输入联系人手机号" />
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-col :span="12">
+          <a-form-item label="联系电话">
+            <a-input class="dialogInput"
+                     style="width: 200px"
+                     placeholder="请输入联系电话" />
+          </a-form-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-item>
+            &nbsp;
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-col :span="24">
+          <a-form-item label="通讯地址">
+            <a-select class="inlineFormSelect"
+                      style="width: 205px"
+                      placeholder="请选择省">
+              <a-select-option value="1">
+                客户一
+              </a-select-option>
+              <a-select-option value="2">
+                客户二
+              </a-select-option>
+            </a-select>
+            <a-select class="inlineFormSelect"
+                      style="width: 205px"
+                      placeholder="请选择市">
+              <a-select-option value="1">
+                客户一
+              </a-select-option>
+              <a-select-option value="2">
+                客户二
+              </a-select-option>
+            </a-select>
+            <a-select class="inlineFormSelect"
+                      style="width: 205px"
+                      placeholder="请选择县(区)">
+              <a-select-option value="1">
+                客户一
+              </a-select-option>
+              <a-select-option value="2">
+                客户二
+              </a-select-option>
+            </a-select>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row :gutter="24">
+        <a-col :span="24">
+          <a-form-item label="&nbsp;">
+            <a-input class="dialogInput"
+                     style="width: 635px"
+                     placeholder="请输入详细地址" />
+          </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: 635px"
+                     placeholder="请输入备注" />
+          </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 { initData } from '@/common/methods/index';
+
+export default defineComponent({
+    name: 'modify-custom',
+    components: {},
+    props: {
+        // selectedRow: {
+        //   type:
+        // }
+    },
+    setup() {
+        // const { visible, cancel } = closeModal('modifyCustomInfo');
+        const { visible, cancel } = closeModal('custom_info_btn_modify');
+
+        const loading = ref<boolean>(false);
+        const maskClosableFlag = ref<boolean>(false);
+        function submit() {
+            loading.value = true;
+            setTimeout(() => {
+                loading.value = false;
+                cancel();
+            }, 2000);
+        }
+        initData(() => {});
+        return {
+            visible,
+            cancel,
+            submit,
+            loading,
+            maskClosableFlag,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+.modify-custom {
+    .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;
+        }
+    }
+}
+</style
+>;

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

@@ -0,0 +1,165 @@
+<template>
+    <!-- 恢复客户资料-->
+    <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, 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";
+import {Modal} from "ant-design-vue";
+
+export default defineComponent({
+    name: 'modify-custom',
+    components: {},
+    props: {
+        selectedRow: {
+            type: Object as PropType<QueryCustomInfoType>,
+            default: {},
+        },
+    },
+    setup(props) {
+        const {visible, cancel} = closeModal('custom_info_btn_recover');
+        const {loading, ModifyUserInfo} = updateUserAccount();
+        // 恢复方法
+        function recover(){
+            Modal.confirm({
+                title: '是否确认恢复客户资料',
+                okText: '确认恢复',
+                cancelText: '取消',
+                onOk() {
+                    ModifyUserInfo(props.selectedRow.userid, 4, cancel);
+                },
+                onCancel() {
+                    console.log('Cancel');
+                },
+            });
+        }
+        return {
+            visible,
+            cancel,
+            recover,
+            loading,
+            formatValue,
+            getStatusName,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+.modify-custom {
+}
+</style
+>;

+ 5 - 2
src/views/information/goods/list/spot-variety/index.vue

@@ -21,7 +21,7 @@
 </template>
 
 <script lang="ts">
-import { defineComponent } from 'vue';
+import { defineComponent, ref } from 'vue';
 
 import filterCustomTable from '@/views/information/goods/components/filterTable/index.vue';
 import leftMenu from '@/views/information/goods/components/leftMenu/index.vue';
@@ -29,7 +29,8 @@ 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, handleGDStatue } from '../../setup';
+import { getThirdMenuData } from '@/common/setup/table/button';
 
 export default defineComponent({
     name: 'spot-variety',
@@ -40,8 +41,10 @@ export default defineComponent({
         AddGoods,
     },
     setup() {
+        // 控制弹窗
         const { openAction: addAction } = openModal('spot_contract_btn_add');
         const { loading, selctedDeliveryGoods, chooseDG, menuList, queryDG } = handleDG();
+        const { isNormal, changeStatue } = handleGDStatue();
 
         initData(() => {
             // 加载数据在这里

+ 52 - 5
src/views/information/goods/setup.ts

@@ -1,9 +1,10 @@
+import { getThirdMenuData } from '@/common/setup/table/button';
 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';
+import { reactive, Ref, ref } from 'vue';
 
 /**
  * 初始化 现货品种对象数据
@@ -46,17 +47,41 @@ export function initMenu(): MenuList[] {
     ]
 }
 
+interface MenuType {
+    menuList: Ref<MenuList[]>;
+    menuMap: Map<string, number>;
+}
+/**
+ * 获取菜单数据
+ * @returns MenuType
+ */
+function getInitMenuData(): MenuType {
+    const list = getThirdMenuData();
+    const obj = list.find(e => e.code === 'goods_info_spot'); // 现货品种 数据
+    const menuMap = new Map<string, number>();  // key 正常和停用对应的code,value是它们所在的索引值
+    const menuList = ref<MenuList[]>([])
+    if (obj && obj.children) {
+        obj.children.forEach((e, i) => {
+            const { code, title } = e;
+            menuMap.set(code, i)
+            menuList.value.push({ key: code, title, children: [] })
+        })
+    }
+    return { menuList, menuMap }
+}
+
 /**
  * 获取现货品种数据
  * @returns 
  */
 export function handleDG() {
+    const { menuList, menuMap } = getInitMenuData()
     const loading = ref<boolean>(false);
     // 现货品种列表
     const deliveryGoodsList = ref<ErmcpDeliveryGoodsDetailEx[]>([])
     // 选中的具体某一天现货品种数据
     const selctedDeliveryGoods = reactive<ErmcpDeliveryGoodsDetailEx>(initDG())
-    const menuList = ref<MenuList[]>(initMenu());
+    // const menuList = ref<MenuList[]>(initMenu());
     // 获取现货品种数据
     function queryDG(param?: number) {
         loading.value = true;
@@ -65,9 +90,19 @@ export function handleDG() {
             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)
+                    const normal = 'goods_info_spot_normal', disable = 'goods_info_spot_disable';
+                    const result = { key: deliverygoodsid.toString(), title: deliverygoodsname }
+                    if (dgstatus) { //1:正常
+                        if (menuMap.has(normal)) {
+                            const index = menuMap.get(normal) as number;
+                            menuList.value[index].children?.push(result)
+                        }
+                    } else {    // 0:未激活 
+                        if (menuMap.has(disable)) {
+                            const index = menuMap.get(disable) as number;
+                            menuList.value[index].children?.push(result)
+                        }
+                    }
                 }
             })
             // 获取默认第一条数据
@@ -105,4 +140,16 @@ export function getGoodsUnit(unit: number) {
  */
 export function getGoodsUnitList() {
     return getItemEnum('goodsunit')
+}
+
+/**
+ * 处理现货品种的状态
+ * @returns 
+ */
+export function handleGDStatue() {
+    const isNormal = ref<boolean>(true) // true => 正常; false => 停用
+    function changeStatue(value: boolean) {
+        isNormal.value = value;
+    }
+    return { isNormal, changeStatue }
 }