huangbin 4 år sedan
förälder
incheckning
86868ada4e

+ 6 - 2
src/common/methods/request/resultInfo.ts

@@ -80,8 +80,12 @@ export function controlResultInfo(fn: Promise<any>, msgInfo: [string, string] =
  */
 export function controlResultErrInfo(fn: Promise<any>) {
     return fn.then(res => {
-        console.log('查询数据成功:', res)
-        return res
+        // 列表数据需要一个key,要不然会报错,统一处理
+        const result = res.map((e: any, i: number) => {
+            return { ...e, key: String(i) };
+        })
+        console.log('查询数据成功:', result)
+        return result
     }).catch(err => {
         console.error('查询数据失败:', err)
         message.error(err)

+ 4 - 0
src/services/go/ermcp/qhj/index.ts

@@ -92,6 +92,10 @@ export function queryContract(req: QueryContractReq): Promise<QhjContract[]> {
  * @param req
  */
 export function queryCustomerInfo(req: QueryCustomerInfoReq): Promise<QhjCustomer> {
+    const userid = getUsrId();
+    req.userid = userid;
+    console.log(req);
+
     return commonSearch_go('/Qhj/QueryCustomerInfo', req).catch((err) => {
         throw new Error(`查询客户资料: ${err.message}`);
     });

+ 4 - 4
src/services/go/ermcp/qhj/interface.ts

@@ -280,10 +280,10 @@ export interface QhjContract {
 export interface QueryCustomerInfoReq {
     userid: number  //          用户ID
     querytype: number //        查询类型 1:未提交(网上开户表) 2:待审核(网上开户表) 3:正常 4:停用
-    userinfotype: number//      客户类型 1-个人 2-企业
-    customername: string//      客户名称(模糊匹配)
-    nickname: string//          昵称(模糊匹配)
-    includesub: number//        是否包含子级 1-包含
+    userinfotype?: number//      客户类型 1-个人 2-企业
+    customername?: string//      客户名称(模糊匹配)
+    nickname?: string//          昵称(模糊匹配)
+    includesub?: number//        是否包含子级 1-包含
 }
 
 /*

+ 2 - 5
src/services/proto/warehouse/index.ts

@@ -1,14 +1,12 @@
-import APP from "@/services";
-import { getSelectedAccountId, getUserId } from "@/services/bus/account";
+import { getUserId } from "@/services/bus/account";
 import { getLongTypeLoginID } from "@/services/bus/login";
 import {
     AreaInOutApplyAuditPassReq, AuditERMCPAreaInOutStockApplyReq, ERMCPAreaInOutStockApplyReq,
     WarehouseApplyReq,
     WarehouseStateChangeReq
 } from "@/services/proto/warehouse/interface";
-import { buildProtoReq50, parseProtoRsp50, protoMiddleware } from "@/services/socket/protobuf/buildReq";
+import { protoMiddleware } from "@/services/socket/protobuf/buildReq";
 import { getUUID } from "@/utils/qt/common";
-import { Callback } from "@/utils/websocket";
 
 /**
  * 新增 / 修改 仓库信息请求  修改需要传仓库id
@@ -58,6 +56,5 @@ export const ermcpInOutStockApplyReq = (param: ERMCPAreaInOutStockApplyReq): Pro
     param.UserID = getUserId()
     param.ApplySrc = 2
     param.ApplyId = Number(getLongTypeLoginID())
-    debugger
     return protoMiddleware<ERMCPAreaInOutStockApplyReq>(param, 'ERMCPAreaInOutStockApplyReq', 'ERMCPAreaInOutStockApplyRsp', 2)
 }

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

@@ -1,12 +0,0 @@
-import { ResultInfo } from "@/common/methods/request/interface";
-
-
-
-/************** 接口相关提示 **************** /
- *
- */
-
-export const ChangeCustomInfoSign = new Map<number, ResultInfo>([
-    [1, ['修改客户资料草稿成功', '修改客户资料草稿失败:']],
-    [2, ['修改客户资料成功', '修改客户资料失败:']],
-])

+ 8 - 9
src/views/platinum/platinum_customer_info/compoments/add/index.vue

@@ -318,15 +318,15 @@ export default defineComponent({
         // 证件类型
         const cardTypeList = ref<AllEnums[]>(getCardType());
         // 表单
-        const {formRef, formState, rules} = handleForm();
+        const { formRef, formState, rules } = handleForm();
         // 地址
-        const {cityList, districtList, provinceList, getCityList, getDistrictList} = getAddress();
+        const { cityList, districtList, provinceList, getCityList, getDistrictList } = getAddress();
         // 营业执照
-        const {getFirstImg: getAttachmentImg, uploadImgAction: attachmentUpLoad} = getUploadImg();
+        const { getFirstImg: getAttachmentImg, uploadImgAction: attachmentUpLoad } = getUploadImg();
         // 背面证件照地址
-        const {getFirstImg: getBackImg, uploadImgAction: cardbackphotourlUpLoad} = getUploadImg();
+        const { getFirstImg: getBackImg, uploadImgAction: cardbackphotourlUpLoad } = getUploadImg();
         // 正面证件照地址
-        const {getFirstImg: getFrontImg, uploadImgAction: cardfrontphotourlUpLoad} = getUploadImg();
+        const { getFirstImg: getFrontImg, uploadImgAction: cardfrontphotourlUpLoad } = getUploadImg();
 
         //查询所属机构列表
         const { areaList, getAreaList } = handleAreaList();
@@ -356,17 +356,16 @@ export default defineComponent({
                     cardfrontphotourl: isPersonal() ? getFrontImg() : '', // 正面照片
                     cardbackphotourl: isPersonal() ? getBackImg() : '', // 背面证件照地址
                     ipaddress: param.ipaddress, // 证件地址
-                    cityid: param.cityid as number !== undefined ? param.cityid as number : 0, //城市
-                    districtid: param.districtid as number !== undefined ? param.districtid as number : 0, // 地区
+                    cityid: (param.cityid as number) !== undefined ? (param.cityid as number) : 0, //城市
+                    districtid: (param.districtid as number) !== undefined ? (param.districtid as number) : 0, // 地区
                     // countryid: param.,9
-                    provinceid: param.provinceid as number !== undefined ? param.provinceid as number : 0, //省
+                    provinceid: (param.provinceid as number) !== undefined ? (param.provinceid as number) : 0, //省
                     contactname: param.contactname, // 联系人
                     legalpersonname: param.legalpersonname, // 法人姓名(企业)
                     taxpayernum: param.taxpayernum, // 纳税人识别号
                     email: param.email, // email
                     proxystatementurl: isPersonal() ? '' : getAttachmentImg(), // 营业执照
                 };
-                debugger
                 requestResultLoadingAndInfo(addCustomerInfoOperate, reqParam, loading, OperateType === 1 ? ['保存草稿成功', '保存草稿失败:'] : ['新增客户资料成功', '新增客户资料失败:']).then(() => {
                     cancel();
                     context.emit('refresh');

+ 1 - 3
src/views/platinum/platinum_customer_info/compoments/modify/index.vue

@@ -347,6 +347,7 @@ export default defineComponent({
         const countryid = ref<number>(0);
         watchEffect(() => {
             if (visible.value) {
+                getAreaList(loading);
                 userid.value = props.selectedRow.userid;
                 mergeTwoObj(formState, props.selectedRow);
                 const { provinceid, cityid, proxystatementurl, cardfrontphotourl, cardbackphotourl } = props.selectedRow;
@@ -366,9 +367,6 @@ export default defineComponent({
                 }
             }
         });
-        initData(() => {
-            getAreaList(loading);
-        });
         function submit(OperateType: 1 | 2) {
             validateAction<FormState>(formRef, formState).then((param) => {
                 const reqParam: CustomerInfoOperateReq = {

+ 2 - 2
src/views/platinum/platinum_customer_info/list/normal-use/index.vue

@@ -57,10 +57,10 @@ export default defineComponent({
         // 表格操作按钮列表
         const { commonBtn, forDataBtn } = getBtnList('platinum_custom_info_normal', true);
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList(3);
+        const { loading, tableList, queryTable } = queryTableList();
         initData(() => {
             // 获取列表数据
-            queryTable();
+            queryTable(3);
             // 注册表头信息 过滤
             registerColumn('table_pcweb_qhj_customer_info', ['userinfotype', 'nickname', 'contactname', 'mobile']);
         });

+ 8 - 17
src/views/platinum/platinum_customer_info/list/setup.ts

@@ -1,7 +1,6 @@
-import { QueryCustomInfo } from '@/services/go/ermcp/customInfo';
+import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { QueryCustomInfoType } from '@/services/go/ermcp/customInfo/interface';
-import { QueryCustomInfoEnum } from '@/services/go/ermcp/customInfo/type';
-import { message } from 'ant-design-vue';
+import { queryCustomerInfo } from '@/services/go/ermcp/qhj';
 import { ref } from 'vue';
 
 /**
@@ -9,24 +8,16 @@ import { ref } from 'vue';
  * @param type 
  * @returns 
  */
-export function queryTableList(type: QueryCustomInfoEnum) {
+export function queryTableList() {
     // 加载状态
     const loading = ref<boolean>(false);
     // 表格数据
     const tableList = ref<QueryCustomInfoType[]>([]);
-    function queryTable() {
-        QueryCustomInfo(type)
-            .then((res) => {
-                tableList.value = res.map((e, i) => {
-                    return { ...e, key: String(i) };
-                });
-                loading.value = false;
-                console.log('查询列表', tableList);
-            })
-            .catch((err) => {
-                message.error(err);
-                loading.value = false;
-            });
+    function queryTable(querytype: 1 | 2 | 3 | 4) {
+        const param = { querytype }
+        queryResultLoadingAndInfo(queryCustomerInfo, loading, param).then(res => {
+            tableList.value = res
+        })
     }
     return { loading, tableList, queryTable }
 }

+ 2 - 2
src/views/platinum/platinum_customer_info/list/stop-use/index.vue

@@ -59,10 +59,10 @@ export default defineComponent({
         // 表格操作按钮列表
         const { commonBtn, forDataBtn } = getBtnList('platinum_customer_info_stop', true);
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList(4);
+        const { loading, tableList, queryTable } = queryTableList();
         initData(() => {
             // 获取列表数据
-            queryTable();
+            queryTable(4);
             // 注册表头信息 过滤
             registerColumn('table_pcweb_qhj_customer_info', ['userinfotype', 'nickname', 'contactname', 'mobile']);
         });

+ 2 - 2
src/views/platinum/platinum_customer_info/list/unsubmit/index.vue

@@ -58,10 +58,10 @@ export default defineComponent({
         // 表格操作按钮列表
         const { commonBtn, forDataBtn } = getBtnList('platinum_customer_info_unsubmit', true);
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList(1);
+        const { loading, tableList, queryTable } = queryTableList();
         initData(() => {
             // 获取列表数据
-            queryTable();
+            queryTable(2);
             // 注册表头信息 过滤
             registerColumn('table_pcweb_qhj_customer_info', ['userinfotype', 'nickname', 'contactname', 'mobile']);
         });

+ 0 - 12
src/views/platinum/platinum_customer_info/setup.ts

@@ -1,12 +0,0 @@
-import { ResultInfo } from "@/common/methods/request/interface";
-
-
-
-/************** 接口相关提示 **************** /
- *
- */
-
-export const ChangeCustomInfoSign = new Map<number, ResultInfo>([
-    [1, ['修改客户资料草稿成功', '修改客户资料草稿失败:']],
-    [2, ['修改客户资料成功', '修改客户资料失败:']],
-])