Browse Source

fix: 询盘管理区分国内/海外

周玉环 4 ngày trước cách đây
mục cha
commit
eaa8912d72

+ 2 - 0
xinkeaboard-seller/src/components/SiteSelector/index.js

@@ -1,10 +1,12 @@
 import { Select } from "antd";
 import { connect } from "dva";
 import router from 'umi/router';
+import { webSiteContactRelation } from "@/utils/utils"
 
 const SiteSelector = ({ siteList, currentSite, dispatch }) => {
   const handleChange = (value) => {
     dispatch({ type: "global/setCurrentSite", payload: value });
+    dispatch({ type: "global/setCurrentContactType", payload: webSiteContactRelation[value] });
   };
   return (
     siteList.length ?  (

+ 9 - 1
xinkeaboard-seller/src/models/global.js

@@ -1,5 +1,5 @@
 import { queryNotices } from '@/services/api';
-import { sldCommonService } from '@/utils/utils';
+import { sldCommonService, webSiteContactRelation } from '@/utils/utils';
 export default {
   namespace: 'global',
 
@@ -8,6 +8,7 @@ export default {
     notices: [],
     siteList: [],
     currentSite: '',
+    contactType: ''
   },
 
   effects: {
@@ -82,6 +83,7 @@ export default {
       const currentSite = yield select(state => state.global.currentSite);
       if (!currentSite) {
         yield put({type: 'setCurrentSite', payload: response.data[0]?.value})
+        yield put({type: 'setCurrentContactType', payload: webSiteContactRelation[response.data[0]?.value]})
       }
     },
   },
@@ -100,6 +102,12 @@ export default {
         currentSite: payload,
       };
     },
+    setCurrentContactType(state, { payload }) {
+      return {
+        ...state,
+        contactType: payload,
+      };
+    },
     changeLayoutCollapsed(state, { payload }) {
       return {
         ...state,

+ 15 - 5
xinkeaboard-seller/src/pages/order/enquiry/enquiry_lists.js

@@ -29,9 +29,10 @@ import Search from '@/components/Search/Search';
 import Link from 'umi/link';
 
 let pageSize = list_com_page_size_10;
-@connect(({ order, common }) => ({
+@connect(({ order, common, global }) => ({
   order,
   common,
+  global,
 }))
 @Form.create()
 export default class EnquiryLists extends Component {
@@ -71,7 +72,7 @@ export default class EnquiryLists extends Component {
         },
         {
           type: 'input',
-          label: `${sldComLanguage('电话')}`,
+          label: `${sldComLanguage('手机号')}`,
           name: 'phone',
           initialValue: '',
         },
@@ -221,7 +222,7 @@ export default class EnquiryLists extends Component {
 
         },
         {
-          title: `${sldComLanguage('电话')}`,
+          title: `${sldComLanguage('手机号')}`,
           dataIndex: 'phone',
           align: 'center',
 
@@ -354,10 +355,19 @@ export default class EnquiryLists extends Component {
         label: `${sldComLanguage('姓名')}`,
         name: 'name',
         placeholder: `${sldComLanguage('请输入姓名')}`,
-      }, {
+      }, 
+      {
+        type: 'input',
+        label: `${sldComLanguage('手机号')}`,
+        name: 'phone',
+        hide: props.global.contactType === 'email',
+        placeholder: `${sldComLanguage('请输入手机号')}`,
+      },
+      {
         type: 'input',
         label: `${sldComLanguage('邮箱')}`,
         name: 'email',
+        hide: props.global.contactType === 'mobile',
         placeholder: `${sldComLanguage('请输入邮箱')}`,
       },{
         type: 'select',
@@ -724,7 +734,7 @@ export default class EnquiryLists extends Component {
 
         <div style={{ position: 'relative' }}>
           <div className={global.tableListForm}>
-            <Search search_data={search_data}
+            <Search search_data={search_data.filter(item => !item.hide)}
                     seaSubmit={(data) => this.search(data)} seaReset={() => this.seaReset()}
             />
           </div>

+ 5 - 0
xinkeaboard-seller/src/utils/utils.js

@@ -1865,3 +1865,8 @@ export function safeJsonParse(value, defaultValue) {
     return defaultValue ?? {}
   }
 }
+
+export const webSiteContactRelation = {
+  '1': 'email', // 海外用户
+  '2': 'mobile' // 国内分销商
+}