Browse Source

Merge branch 'cpq-dev' of wangfan/adweb3-web into master

chenpeiqing 1 month ago
parent
commit
86a5b67033

+ 18 - 20
src/components/Table/src/BasicTable.vue

@@ -20,7 +20,14 @@
     <a-form-item-rest>
       <!-- 【TV360X-377】关联记录必填影响到了table的输入框和页码样式 -->
       <a-form-item>
-        <Table ref="tableElRef" v-bind="getBindValues" :rowClassName="getRowClassName" v-show="getEmptyDataIsShowTable" @resizeColumn="handleResizeColumn" @change="handleTableChange">
+        <Table
+          ref="tableElRef"
+          v-bind="getBindValues"
+          :rowClassName="getRowClassName"
+          v-show="getEmptyDataIsShowTable"
+          @resize-column="handleResizeColumn"
+          @change="handleTableChange"
+        >
           <!-- antd的原生插槽直接传递 -->
           <template #[item]="data" v-for="item in slotNamesGroup.native" :key="item">
             <!-- update-begin--author:liaozhiyang---date:20240424---for:【issues/1146】BasicTable使用headerCell全选框出不来 -->
@@ -33,7 +40,7 @@
           </template>
           <template #headerCell="{ column }">
             <!-- update-begin--author:sunjianlei---date:220230630---for:【QQYUN-5571】自封装选择列,解决数据行选择卡顿问题 -->
-            <CustomSelectHeader v-if="isCustomSelection(column)" v-bind="selectHeaderProps"/>
+            <CustomSelectHeader v-if="isCustomSelection(column)" v-bind="selectHeaderProps" />
             <HeaderCell v-else :column="column" />
             <!-- update-end--author:sunjianlei---date:220230630---for:【QQYUN-5571】自封装选择列,解决数据行选择卡顿问题 -->
           </template>
@@ -42,7 +49,7 @@
             <!-- update-begin--author:liaozhiyang---date:220230717---for:【issues-179】antd3 一些警告以及报错(针对表格) -->
             <!-- update-begin--author:liusq---date:20230921---for:【issues/770】slotsBak异常报错的问题,增加判断column是否存在 -->
             <template v-if="data.column?.slotsBak?.customRender">
-            <!-- update-end--author:liusq---date:20230921---for:【issues/770】slotsBak异常报错的问题,增加判断column是否存在 -->
+              <!-- update-end--author:liusq---date:20230921---for:【issues/770】slotsBak异常报错的问题,增加判断column是否存在 -->
               <slot :name="data.column.slotsBak.customRender" v-bind="data || {}"></slot>
             </template>
             <template v-else>
@@ -69,7 +76,7 @@
   import { Table } from 'ant-design-vue';
   import { BasicForm, useForm } from '/@/components/Form/index';
   import { PageWrapperFixedHeightKey } from '/@/components/Page/injectionKey';
-  import CustomSelectHeader from './components/CustomSelectHeader.vue'
+  import CustomSelectHeader from './components/CustomSelectHeader.vue';
   import expandIcon from './components/ExpandIcon';
   import HeaderCell from './components/HeaderCell.vue';
   import TableSummary from './components/TableSummary';
@@ -88,7 +95,7 @@
   import { useTableFooter } from './hooks/useTableFooter';
   import { useTableForm } from './hooks/useTableForm';
   import { useDesign } from '/@/hooks/web/useDesign';
-  import { useCustomSelection } from "./hooks/useCustomSelection";
+  import { useCustomSelection } from './hooks/useCustomSelection';
 
   import { omit, pick } from 'lodash-es';
   import { basicProps } from './props';
@@ -168,14 +175,7 @@
         clearSelectedRowKeys,
         deleteSelectRowByKey,
         getExpandIconColumnIndex,
-      } = useCustomSelection(
-        getProps,
-        emit,
-        wrapRef,
-        getPaginationInfo,
-        tableData,
-        childrenColumnName
-      )
+      } = useCustomSelection(getProps, emit, wrapRef, getPaginationInfo, tableData, childrenColumnName);
       // update-end--author:sunjianlei---date:220230630---for:【QQYUN-5571】自封装选择列,解决数据行选择卡顿问题
 
       const {
@@ -218,7 +218,7 @@
         getProps,
         getPaginationInfo,
         // update-begin--author:sunjianlei---date:220230630---for:【QQYUN-5571】自封装选择列,解决数据行选择卡顿问题
-        handleCustomSelectColumn,
+        handleCustomSelectColumn
         // update-end--author:sunjianlei---date:220230630---for:【QQYUN-5571】自封装选择列,解决数据行选择卡顿问题
       );
 
@@ -291,11 +291,10 @@
         /*if (slots.expandedRowRender) {
           propsData = omit(propsData, 'scroll');
         }*/
-        //update-end---author:wangshuai ---date:20230214  for:[QQYUN-4237]代码生成 内嵌子表模式 没有滚动条------------ 
-
+        //update-end---author:wangshuai ---date:20230214  for:[QQYUN-4237]代码生成 内嵌子表模式 没有滚动条------------
         // update-begin--author:sunjianlei---date:220230630---for:【QQYUN-5571】自封装选择列,解决数据行选择卡顿问题
         // 自定义选择列,需要去掉原生的
-        delete propsData.rowSelection
+        delete propsData.rowSelection;
         // update-end--author:sunjianlei---date:220230630---for:【QQYUN-5571】自封装选择列,解决数据行选择卡顿问题
 
         // update-begin--author:liaozhiyang---date:20230919---for:【QQYUN-6387】展开写法(去掉报错)
@@ -404,13 +403,12 @@
       // update-begin--author:liaozhiyang---date:20231226---for:【issues/945】BasicTable组件设置默认展开不生效
       nextTick(() => {
         getProps.value.defaultExpandAllRows && expandAll();
-      })
+      });
       // update-end--author:sunjianlei---date:20231226---for:【issues/945】BasicTable组件设置默认展开不生效
       expose(tableAction);
 
       emit('register', tableAction, formActions);
 
-
       return {
         tableElRef,
         getBindValues,
@@ -424,7 +422,7 @@
         tableAction,
         redoHeight,
         handleResizeColumn: (w, col) => {
-        console.log('col',col);
+          console.log('col', col);
           col.width = w;
         },
         getFormProps: getFormProps as any,

+ 17 - 10
src/views/adweb/enquiry/AdwebEnquiry.data.ts

@@ -1,11 +1,12 @@
 import { BasicColumn } from '/@/components/Table';
+import { getAction } from '@/api/manage/manage';
 //列表数据
 export const columns: BasicColumn[] = [
   {
     title: '站点名称',
     align: 'left',
     dataIndex: 'siteName',
-    defaultHidden: true
+    defaultHidden: true,
   },
   {
     title: '姓名',
@@ -49,7 +50,7 @@ export const columns: BasicColumn[] = [
     dataIndex: 'fromIp',
     defaultHidden: true,
 
-    customRender: function ({ text, record }) {
+    customRender: function ({ text }) {
       if (text == null || text == '' || text == undefined) {
         return '--';
       } else {
@@ -89,7 +90,7 @@ export const columns: BasicColumn[] = [
     title: '来源国家',
     align: 'left',
     dataIndex: 'countryName',
-    customRender: function ({ text, record }) {
+    customRender: function ({ text }) {
       if (text == null || text == '' || text == undefined) {
         return '--';
       } else {
@@ -101,7 +102,7 @@ export const columns: BasicColumn[] = [
     title: '来源插件',
     align: 'left',
     dataIndex: 'pluginName',
-    defaultHidden: true
+    defaultHidden: true,
   },
   {
     title: '询盘时间',
@@ -119,6 +120,12 @@ export const columns: BasicColumn[] = [
       return !text ? '' : text.length > 16 ? text.substr(0, 16) : text;
     },
   },
+  {
+    title: '跟进人',
+    align: 'center',
+    dataIndex: 'principalUid',
+    width: 200,
+  },
 ];
 
 export const wasteColumns: BasicColumn[] = [
@@ -126,7 +133,7 @@ export const wasteColumns: BasicColumn[] = [
     title: '站点名称',
     align: 'left',
     dataIndex: 'siteName',
-    defaultHidden: true
+    defaultHidden: true,
   },
   {
     title: '姓名',
@@ -143,7 +150,7 @@ export const wasteColumns: BasicColumn[] = [
     title: '手机号',
     align: 'left',
     dataIndex: 'phone',
-    customRender: function ({ text, record }) {
+    customRender: function ({ text }) {
       if (text == null || text == '' || text == undefined) {
         return '--';
       } else {
@@ -157,7 +164,7 @@ export const wasteColumns: BasicColumn[] = [
     align: 'left',
     dataIndex: 'fromIp',
 
-    customRender: function ({ text, record }) {
+    customRender: function ({ text }) {
       if (text == null || text == '' || text == undefined) {
         return '--';
       } else {
@@ -197,7 +204,7 @@ export const wasteColumns: BasicColumn[] = [
     title: '来源国家',
     align: 'left',
     dataIndex: 'countryName',
-    customRender: function ({ text, record }) {
+    customRender: function ({ text }) {
       if (text == null || text == '' || text == undefined) {
         return '--';
       } else {
@@ -210,7 +217,7 @@ export const wasteColumns: BasicColumn[] = [
     align: 'left',
 
     dataIndex: 'recordCtime',
-    customRender: function ({ text, record }) {
+    customRender: function ({ text }) {
       return !text ? '' : text.length > 16 ? text.substr(0, 16) : text;
     },
   },
@@ -271,7 +278,7 @@ export const superQuerySchema = {
   name: { title: '姓名', order: 42, view: 'text', type: 'string' },
   email: { title: '邮箱地址', order: 43, view: 'text', type: 'string' },
   message: { title: '询盘信息', order: 44, view: 'textarea', type: 'string' },
-  company: { title: '公司名称', order: 45, view: 'text', type: 'string' },
+  company: { title: '用户名称', order: 45, view: 'text', type: 'string' },
   fromPage: { title: '来源页面', order: 46, view: 'text', type: 'string' },
   customerIp: { title: 'form表单传入Ip', order: 47, view: 'text', type: 'string' },
   phone: { title: '手机号', order: 48, view: 'text', type: 'string' },

+ 1 - 1
src/views/adweb/enquiry/AdwebEnquiryDistribution.vue

@@ -120,7 +120,7 @@
   const sendEmailOptions = ref('');
   const columns = [
     {
-      title: '用户名',
+      title: '企业名称',
       align: 'center',
       dataIndex: 'realname',
     },

+ 52 - 38
src/views/adweb/enquiry/AdwebEnquiryList.vue

@@ -86,24 +86,7 @@
         <a-divider type="vertical" />
         <a @click="enquiryReady">标为已读</a>
 
-        <template v-if="haveSubAccount && !isForwardSite">
-          <a-divider type="vertical" />
-          <a
-            :style="
-              userRole.indexOf('admin') > -1 ||
-              userRole.indexOf('adweb_admin') > -1 ||
-              userRole.indexOf('adweb_seo_manager') > -1 ||
-              userRole.indexOf('adweb_site_manager') > -1
-                ? 'pointer-events: none;'
-                : ''
-            "
-            @click="showEditPrincipalModal"
-          >
-            调整跟进人
-          </a>
-        </template>
-
-        <template v-if="isForwardSite" @click="forwardDetailAll">
+        <template v-if="isForwardSite">
           <a-divider type="vertical" />
           <a @click="forwardDetailAll"> 转发 </a>
         </template>
@@ -148,9 +131,33 @@
         </div>
       </template>
 
-      <template #bodyCell="{ column, record, index, text }">
+      <template #bodyCell="{ column, record, text }">
         <!-- 自定义显示字段       -->
 
+        <template v-if="column.key == 'principalUid'">
+          <template v-if="haveSubAccount">
+            <a-select
+              placeholder="请选择跟进人"
+              v-model:value="record.principalUid"
+              style="width: 180px"
+              showSearch
+              :filterOption="filterOption"
+              @change="selectPrincipal(record)"
+              :disabled="
+                userRole.indexOf('admin') > -1 ||
+                userRole.indexOf('adweb_admin') > -1 ||
+                userRole.indexOf('adweb_seo_manager') > -1 ||
+                userRole.indexOf('adweb_site_manager') > -1
+              "
+            >
+              <a-select-option key="ALL" value="ALL">所有人</a-select-option>
+              <a-select-option v-for="principal in subAccountOptions" :key="principal.id" :value="principal.id">
+                {{ principal.username }}
+              </a-select-option>
+            </a-select>
+          </template>
+          <template v-else>{{ record.principalName }}</template>
+        </template>
         <!-- 询盘状态 -->
         <template v-if="column.key == 'userEffective'">
           <a class="theme-color" v-if="text === 2" @click="showEnquiryDetail(record)">{{ record.userEffectiveStr }}</a>
@@ -309,22 +316,6 @@
     { rowSelection, selectedRowKeys },
   ] = tableContext;
 
-  // const labelCol = reactive({
-  //   xs: 24,
-  //   sm: 4,
-  //   xl: 6,
-  //   xxl: 4,
-  // });
-  // const wrapperCol = reactive({
-  //   xs: 24,
-  //   sm: 20,
-  // });
-  //
-  // let siteCode: string | null = ref('');
-
-  // 站点列表
-  let siteList = ref([{ id: '', code: '' }]);
-
   // 询盘数量
   const enquiryNums = ref({
     all: 0,
@@ -379,10 +370,13 @@
   onBeforeMount(() => {
     siteCode.value = localStorage.getItem('siteCode');
     getTurnInquiryCode();
+    getSubAccountOptions();
   });
 
   onMounted(async () => {
-    userRole.value = useUserStore().roleList;
+    userRole.value = useUserStore().userInfo?.roles.join(',');
+
+    console.log(useUserStore().userInfo?.roles.join(','), 'useUserStore().roleList');
     getEffectiveList();
   });
 
@@ -392,6 +386,27 @@
     getTableAndNum(true);
   }
 
+  // 单个产品,点击下拉框直接修改
+  function selectPrincipal(record) {
+    console.log(record);
+    let params = {
+      productId: record.id,
+      uid: record.principalUid === undefined ? 'ALL' : record.principalUid,
+    };
+    getAction('/adweb/adwebEnquiry/setPrincipal', params).then((res) => {
+      if (res.code == 200) {
+        createMessage.success('操作成功!');
+      } else {
+        if (res.code == 403 || res.code == 500) {
+          createMessage.warning(res.message);
+          reload();
+        } else {
+          createMessage.success('操作失败!');
+        }
+      }
+    });
+  }
+
   function filterCategory(value: string) {
     queryParam.userEffective = value;
   }
@@ -403,7 +418,6 @@
   //重新刷新页面数据及获取询盘数量
   function getTableAndNum(clearParam: boolean = false) {
     getEnquiryNums();
-    getSubAccountOptions();
     if (clearParam) {
       if (queryParam.readStatus) {
         delete queryParam.readStatus;
@@ -500,7 +514,7 @@
 
   // 获取子账户的下拉框选项
   function getSubAccountOptions() {
-    getAction('/usercountry/subAccounts/options?siteId=' + queryParam.siteId, null).then((res) => {
+    getAction('/usercountry/subAccounts/options?siteCode=' + siteCode.value, null).then((res) => {
       if (res.code === 200) {
         subAccountOptions.value = res.result;
         haveSubAccount.value = res.result !== null && res.result !== undefined && res.result.length > 0;

+ 1 - 1
src/views/adweb/enterprise/EnterpriseUserManage.data.ts

@@ -197,7 +197,7 @@ export const formSchema: FormSchema[] = [
     },
   },
   {
-    label: '公司名称',
+    label: '用户名称',
     field: 'realname',
     required: true,
     component: 'Input',

+ 1 - 1
src/views/system/tenant/tenant.data.ts

@@ -483,7 +483,7 @@ export const tenantUserSchema: FormSchema[] = [
     },
   },
   {
-    label: '公司名称',
+    label: '用户名称',
     field: 'realname',
     required: true,
     component: 'Input',

+ 6 - 10
src/views/system/user/user.data.ts

@@ -10,7 +10,7 @@ export const columns: BasicColumn[] = [
     width: 120,
   },
   {
-    title: '公司名称',
+    title: '用户名称',
     dataIndex: 'realname',
     width: 100,
   },
@@ -73,7 +73,7 @@ export const recycleColumns: BasicColumn[] = [
     width: 100,
   },
   {
-    title: '公司名称',
+    title: '用户名称',
     dataIndex: 'realname',
     width: 100,
   },
@@ -102,7 +102,7 @@ export const searchFormSchema: FormSchema[] = [
     //colProps: { span: 6 },
   },
   {
-    label: '公司名称',
+    label: '用户名称',
     field: 'realname',
     component: 'JInput',
     //colProps: { span: 6 },
@@ -189,7 +189,7 @@ export const formSchema: FormSchema[] = [
     dynamicRules: ({ values }) => rules.confirmPassword(values, true),
   },
   {
-    label: '公司名称',
+    label: '用户名称',
     field: 'realname',
     required: true,
     component: 'Input',
@@ -197,14 +197,11 @@ export const formSchema: FormSchema[] = [
   {
     label: '企业全称',
     field: 'companyName',
-    required: true,
     component: 'Input',
   },
   {
     label: '社会信用代码',
     field: 'socialCreditCode',
-    labelWidth: 120,
-    required: true,
     component: 'Input',
   },
   {
@@ -354,7 +351,6 @@ export const formSchema: FormSchema[] = [
     label: '手机号码',
     field: 'phone',
     component: 'Input',
-    required: true,
     dynamicRules: ({ model, schema }) => {
       return [
         { ...rules.duplicateCheckRule('sys_user', 'phone', model, schema, true)[0], trigger: 'blur' },
@@ -548,7 +544,7 @@ export const userTenantColumns: BasicColumn[] = [
     width: 120,
   },
   {
-    title: '公司名称',
+    title: '用户名称',
     dataIndex: 'realname',
     width: 100,
   },
@@ -593,7 +589,7 @@ export const userTenantFormSchema: FormSchema[] = [
     colProps: { span: 6 },
   },
   {
-    label: '公司名称',
+    label: '用户名称',
     field: 'realname',
     component: 'Input',
     colProps: { span: 6 },