瀏覽代碼

询盘双重审核进度

chenlei1231 6 天之前
父節點
當前提交
98a3ccc56a

+ 1 - 0
src/views/adweb/enquiry/AdwebEnquiry.data.ts

@@ -1,5 +1,6 @@
 import { BasicColumn, FormSchema } from '/@/components/Table';
 import { rules } from '@/utils/helper/validator';
+
 //列表数据
 export const columns: BasicColumn[] = [
   {

+ 75 - 70
src/views/adweb/enquiry/AdwebEnquiryList.vue

@@ -85,7 +85,7 @@
     </a-row>
 
     <!--引用表格-->
-    <BasicTable @register="registerTable" :rowSelection="rowSelection">
+    <BasicTable @register="registerTable" :rowSelection="rowSelection" :columns="enquiryColumns">
       <template #alertAfter>
         <a-divider type="vertical" />
         <a @click="enquiryReady">标为已读</a>
@@ -268,7 +268,7 @@
   import { BasicTable } from '/@/components/Table';
   import { useListPage } from '/@/hooks/system/useListPage';
   import { columns } from './AdwebEnquiry.data';
-  import { batchDelete, deleteOne, getExportUrl, getImportUrl, list } from './AdwebEnquiry.api';
+  import { batchDelete, getExportUrl, getImportUrl, list } from './AdwebEnquiry.api';
   import AdwebEnquiryModal from './components/AdwebEnquiryModal.vue';
   import { useUserStore } from '/@/store/modules/user';
   import { getAction, postAction } from '@/api/manage/manage';
@@ -283,6 +283,7 @@
   import dayjs, { Dayjs } from 'dayjs';
   import EnquiryTrack from '@/views/adweb/enquiry/modules/enquiryTrack.vue';
   import EnquiryVerifyProcess from '@/views/adweb/enquiry/modules/enquiryVerifyProcess.vue';
+  import { getSubscribePlan } from '@/views/adweb/site/AdwebSite.api';
 
   const dateFormat = 'YYYY-MM-DD';
   type RangeValue = [Dayjs, Dayjs];
@@ -299,47 +300,6 @@
   const registerModal = ref();
   const selectSiteRef = ref(null);
   const { createMessage } = useMessage();
-  //注册table数据
-  const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
-    tableProps: {
-      title: '询盘信息',
-      api: list,
-      columns,
-      canResize: false,
-      useSearchForm: false,
-      actionColumn: {
-        width: 180,
-        maxWidth: 220,
-        minWidth: 180,
-        fixed: 'right',
-      },
-      striped: true,
-      bordered: false,
-      immediate: false, // 不直接触发,通过reload事件触发接口
-      beforeFetch: (params) => {
-        //  如果查询条件中没有设置状态,则默认查出所有状态数据
-        if (queryParam.userEffective == undefined) {
-          queryParam.userEffective = '1,2';
-        }
-
-        return Object.assign(params, queryParam);
-      },
-    },
-    exportConfig: {
-      name: '询盘列表',
-      url: getExportUrl,
-      params: queryParam,
-    },
-    importConfig: {
-      url: getImportUrl,
-      success: handleSuccess,
-    },
-  });
-  const [
-    registerTable,
-    { reload, clearSelectedRowKeys, updateTableDataRecord, findTableDataRecord, getDataSource },
-    { rowSelection, selectedRowKeys },
-  ] = tableContext;
 
   // 询盘数量
   const enquiryNums = ref({
@@ -365,7 +325,7 @@
   // 选中跟进人
   let selectedUserId = ref<any>(undefined);
 
-  let userEffectiveOption = ref<[]>([]);
+  let userEffectiveOption = ref([]);
 
   // 当前用户角色
   const userRole = ref('');
@@ -396,6 +356,50 @@
   // 访问记录
   const enquiryTrackRef = ref();
 
+  const isSpecialSubscribePlan = ref(false);
+
+  const enquiryColumns = ref<any>(columns);
+  //注册table数据
+  const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
+    tableProps: {
+      title: '询盘信息',
+      api: list,
+      canResize: false,
+      useSearchForm: false,
+      actionColumn: {
+        width: 180,
+        maxWidth: 220,
+        minWidth: 180,
+        fixed: 'right',
+      },
+      striped: true,
+      bordered: false,
+      immediate: false, // 不直接触发,通过reload事件触发接口
+      beforeFetch: (params) => {
+        //  如果查询条件中没有设置状态,则默认查出所有状态数据
+        if (queryParam.userEffective == undefined) {
+          queryParam.userEffective = '1,2';
+        }
+
+        return Object.assign(params, queryParam);
+      },
+    },
+    exportConfig: {
+      name: '询盘列表',
+      url: getExportUrl,
+      params: queryParam,
+    },
+    importConfig: {
+      url: getImportUrl,
+      success: handleSuccess,
+    },
+  });
+  const [
+    registerTable,
+    { reload, clearSelectedRowKeys, updateTableDataRecord, findTableDataRecord, getDataSource },
+    { rowSelection, selectedRowKeys },
+  ] = tableContext;
+
   onBeforeMount(() => {
     siteCode.value = localStorage.getItem('siteCode');
     getTurnInquiryCode();
@@ -405,13 +409,27 @@
   onMounted(async () => {
     userRole.value = useUserStore().userInfo?.roles.join(',');
 
-    console.log(useUserStore().userInfo?.roles.join(','), 'useUserStore().roleList');
-    getEffectiveList();
+    // console.log(useUserStore().userInfo?.roles.join(','), 'useUserStore().roleList');
+    // getEffectiveList();
   });
 
   function getSiteList(selectedSiteInfo: any) {
     queryParam.siteId = selectedSiteInfo.id;
 
+    // 判断当前站点是否属于苏豪通全托管套餐,如果是,则显示审核进度列,否则不显示
+    getSubscribePlan().then((res) => {
+      // 根据接口返回结果判断是否隐藏敏感信息列
+      if (res.planName !== '苏豪通全托管') {
+        enquiryColumns.value = enquiryColumns.value.filter((col) => col.dataIndex !== 'verifyProgress');
+      } else {
+        // 显示敏感信息列
+        enquiryColumns.value = columns;
+        isSpecialSubscribePlan.value = true;
+      }
+
+      getEffectiveList();
+    });
+
     getTableAndNum(true);
   }
 
@@ -638,6 +656,11 @@
       .then(function (res) {
         if (res.code == 200) {
           userEffectiveOption.value = JSON.parse(res.result);
+
+          // 针对苏豪全托管套餐,隐藏直接设置有效询盘
+          if (isSpecialSubscribePlan.value) {
+            userEffectiveOption.value = userEffectiveOption.value.filter((item) => item.value !== '1');
+          }
         } else {
           createMessage.error('获取询盘分类失败!');
         }
@@ -798,29 +821,6 @@
   }
 
   /**
-   * 编辑事件
-   */
-  function handleEdit(record: Recordable) {
-    registerModal.value.disableSubmit = false;
-    registerModal.value.edit(record);
-  }
-
-  /**
-   * 详情
-   */
-  function handleDetail(record: Recordable) {
-    registerModal.value.disableSubmit = true;
-    registerModal.value.edit(record);
-  }
-
-  /**
-   * 删除事件
-   */
-  async function handleDelete(record) {
-    await deleteOne({ id: record.id }, handleSuccess);
-  }
-
-  /**
    * 批量删除事件
    */
   async function batchHandleDelete() {
@@ -835,7 +835,12 @@
   }
 
   function handleProcess(record, type) {
-    enquiryVerifyProcessRef.value.init(record, type);
+    if (record.userEffective == 1 && record.verifyNum == null) {
+      createMessage.warning('该询盘是历史有效询盘!');
+      return;
+    } else {
+      enquiryVerifyProcessRef.value.init(record, type);
+    }
   }
 
   /**

+ 21 - 16
src/views/adweb/enquiry/AdwebWasteEnquiryList.vue

@@ -211,7 +211,7 @@
   import { nextTick, onBeforeMount, onMounted, reactive, ref } from 'vue';
   import { BasicTable } from '/@/components/Table';
   import { useListPage } from '/@/hooks/system/useListPage';
-  import { wasteColumns } from './AdwebEnquiry.data';
+  import { columns, wasteColumns } from './AdwebEnquiry.data';
   import { batchDelete, getExportUrl, getImportUrl, list } from './AdwebEnquiry.api';
   import AdwebEnquiryModal from './components/AdwebEnquiryModal.vue';
   import { useUserStore } from '/@/store/modules/user';
@@ -227,6 +227,7 @@
   import blackList from '@/views/adweb/enquiry/modules/blackList.vue';
   import enquiryTrackRecord from '@/views/adweb/enquiry/modules/enquiryTrackRecord.vue';
   import EnquiryTrack from '@/views/adweb/enquiry/modules/enquiryTrack.vue';
+  import { getSubscribePlan } from '@/views/adweb/site/AdwebSite.api';
 
   const dateFormat = 'YYYY-MM-DD';
   type RangeValue = [Dayjs, Dayjs];
@@ -281,19 +282,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: '' }]);
 
@@ -320,13 +308,15 @@
   // 选中跟进人
   let selectedUserId = ref<any>(undefined);
 
-  let userEffectiveOption = ref<[]>([]);
+  let userEffectiveOption = ref([]);
 
   // 当前用户角色
   const userRole = ref<any>([]);
 
   // 已经选择的站点code
   const siteCode = ref<any>('');
+  // 是否是苏豪全托管套餐
+  const isSpecialSubscribePlan = ref(false);
 
   const isForwardSite = ref<boolean>(false);
 
@@ -360,12 +350,22 @@
 
   onMounted(async () => {
     userRole.value = userStore.getRoleList;
-    getEffectiveList();
+    // getEffectiveList();
   });
 
   function getSiteList(selectedSiteInfo: any) {
     queryParam.siteId = selectedSiteInfo.id;
 
+    // 判断当前站点是否属于苏豪通全托管套餐,如果是,则显示审核进度列,否则不显示
+    getSubscribePlan().then((res) => {
+      // 根据接口返回结果判断是否隐藏敏感信息列
+      if (res.planName === '苏豪通全托管') {
+        isSpecialSubscribePlan.value = true;
+      }
+
+      getEffectiveList();
+    });
+
     getTableAndNum(true);
   }
   function filterStatus(value: number) {
@@ -548,6 +548,11 @@
       .then(function (res) {
         if (res.code == 200) {
           userEffectiveOption.value = JSON.parse(res.result);
+
+          // 针对苏豪全托管套餐,隐藏直接设置有效询盘
+          if (isSpecialSubscribePlan.value) {
+            userEffectiveOption.value = userEffectiveOption.value.filter((item) => item.value !== '1');
+          }
         } else {
           createMessage.error('获取询盘分类失败!');
         }

+ 0 - 1
src/views/adweb/enquiry/modules/enquiryDetail.vue

@@ -240,7 +240,6 @@ v-if="edition === 1" :href="record.fromPage.substring(record.fromPage.indexOf('h
       onChangeUserEffect(e){
         let that = this
 
-        console.log(e.target.value, "e.target.valuee.target.value");
         if(e.target.value === 0){
           that.wasteEnquiryVisible = true
         }else{

+ 115 - 64
src/views/adweb/enquiry/modules/enquiryVerifyProcess.vue

@@ -1,83 +1,111 @@
 <template>
   <a-drawer :title="title" placement="right" :closable="true" :visible="visible" @close="onClose" destroyOnClose :width="600">
-    <a-steps :current="current" direction="vertical" class="self_step">
-      <a-step v-for="(item, index) in stepData" :key="index">
-        <template #title>
-          <div v-if="item.status == 1" style="width: 100%; line-height: 21px">
-            <a-icon type="check-circle" :style="{ fontSize: '14px', color: 'green', marginRight: '5px' }" />
-            <span>{{ item.name }}</span>
-            <a-button
-              style="margin-left: 16px"
-              ghost
-              v-if="!isCustomer"
-              type="primary"
-              size="small"
-              @click="finishOrRollbackStep(item.id, 0, null, item.nodeType, item.description)"
-            >
-              撤销
-            </a-button>
-
-            <span style="margin-left: 40px">{{ item.finTime }}</span>
-          </div>
-          <div style="width: 100%; line-height: 21px" v-else-if="index === current">
-            <a-icon type="clock-circle" :style="{ fontSize: '14px', color: 'blue', marginRight: '5px' }" />
-            <span :style="{ color: 'blue' }">{{ item.name }}</span>
-            <a-button
-              style="margin-left: 16px"
-              v-if="showFinBtn && !isCustomer"
-              ghost
-              type="primary"
-              size="small"
-              @click="finishOrRollbackStep(item.id, 1, item.finTime, item.nodeType, item.description)"
-            >
-              完成
-            </a-button>
-            {{ item.finTime }}
-          </div>
-          <div style="width: 100%; line-height: 21px" v-else>
-            <a-icon type="clock-circle" :style="{ fontSize: '14px', color: '#606266', marginRight: '5px' }" />
-            <span :style="{ color: '#606266' }">{{ item.name }}</span>
-            <a-button
-              style="margin-left: 16px"
-              v-if="showFinBtn && !isCustomer"
-              ghost
-              type="primary"
-              size="small"
-              @click="finishOrRollbackStep(item.id, 1, item.finTime, item.nodeType, item.description)"
-              >完成</a-button
-            >
-          </div>
-        </template>
-        <template #description>
-          <div style="margin: 2.5px 0" v-if="item.timeDesc !== null">{{ item.timeDesc }}</div>
-          <div style="margin: 2.5px 0" v-if="item.description !== null">
-            <a-textarea v-model:value="item.description" :rows="8" placeholder="请输入审核日志记录" />
-          </div>
-        </template>
-      </a-step>
-    </a-steps>
+    <a-spin :spinning="loading">
+      <a-steps :current="current" direction="vertical" class="self_step">
+        <a-step v-for="(item, index) in stepData" :key="index">
+          <template #title>
+            <div v-if="item.status == 1" style="width: 100%; line-height: 21px">
+              <span>{{ item.name }}</span>
+              <a-button
+                style="margin-left: 16px"
+                ghost
+                disabled
+                v-if="!isCustomer"
+                type="primary"
+                size="small"
+                @click="finishOrRollbackStep(item.id, 0, null, item.nodeType, item.description)"
+              >
+                撤销
+              </a-button>
+
+              <span style="margin-left: 40px">{{ item.finTime }}</span>
+            </div>
+
+            <div style="margin: 2.5px 0" v-if="item.finName !== null">
+              <span>审核人: {{ item.finName }}</span>
+            </div>
+
+            <div style="width: 100%; line-height: 21px" v-else-if="index === current">
+              <span :style="{ color: 'blue' }">{{ item.name }}</span>
+              <a-button
+                style="margin-left: 16px"
+                v-if="showFinBtn && !isCustomer"
+                ghost
+                type="primary"
+                size="small"
+                @click="finishOrRollbackStep(item.id, 1, item.finTime, item.nodeType, item.description)"
+              >
+                完成
+              </a-button>
+              {{ item.finTime }}
+            </div>
+            <div style="width: 100%; line-height: 21px" v-else>
+              <span :style="{ color: '#606266' }">{{ item.name }}</span>
+              <a-button
+                style="margin-left: 16px"
+                v-if="showFinBtn && !isCustomer"
+                ghost
+                type="primary"
+                size="small"
+                @click="finishOrRollbackStep(item.id, 1, item.finTime, item.nodeType, item.description)"
+                >完成</a-button
+              >
+            </div>
+          </template>
+          <template #description>
+            <div style="margin: 2.5px 0" v-if="item.timeDesc !== null">{{ item.timeDesc }}</div>
+            <div style="margin: 2.5px 0" v-if="item.status == 1">
+              <a-textarea v-model:value="item.description" disabled="disabled" :rows="8" placeholder="请输入审核日志记录" />
+            </div>
+            <div style="margin: 2.5px 0" v-if="item.status == 0">
+              <a-textarea v-model:value="item.description" :rows="8" placeholder="请输入审核日志记录" />
+            </div>
+          </template>
+        </a-step>
+      </a-steps>
+    </a-spin>
   </a-drawer>
 </template>
 
 <script lang="ts" setup>
   import '/@/assets/less/common.less';
   import { getAction, postAction } from '/@/api/manage/manage';
-  import { reactive, ref } from 'vue';
+  import { computed, reactive, ref } from 'vue';
   import { useMessage } from '@/hooks/web/useMessage';
-
+  import { RoleEnum } from '@/enums/roleEnum';
+  import { useUserStore } from '@/store/modules/user';
+  const userStore = useUserStore();
   const visible = ref(false);
   const title = ref('询盘审核流程');
   const url = ref('');
   const current = ref(0);
-  let stepData = ref([{ id: '', status: 0, name: '未提交', description: '未提交', nodeType: 4, finTime: '', timeDesc: '' }]);
+  let stepData = ref([{ id: '', status: 0, name: '未提交', description: '未提交', nodeType: 4, finName: '', finTime: '', timeDesc: '', finUid: '' }]);
   let record = reactive({});
   const showFinBtn = ref(false);
   const isCustomer = ref(false);
-  const finishTime = ref('');
-  const dateFormat = 'YYYY-MM-DD HH:mm:ss';
+  // const finishTime = ref('');
+  // const dateFormat = 'YYYY-MM-DD HH:mm:ss';
+
+  const loading = ref(false);
   const emit = defineEmits(['close', 'reload']);
   const { createMessage } = useMessage();
 
+  const isAdmin = computed(() => {
+    return (
+      userStore.getRoleList.includes(RoleEnum.ADMIN) ||
+      userStore.getRoleList.includes(RoleEnum.ADWEB_ADMIN) ||
+      userStore.getRoleList.includes(RoleEnum.SEO_ADMIN) ||
+      userStore.getRoleList.includes(RoleEnum.ADWEB_SITE_MANAGER) ||
+      userStore.getRoleList.includes(RoleEnum.ADWEB_SEO_MANAGER) ||
+      userStore.getRoleList.includes(RoleEnum.ADWEB_CHANNEL_ADMIN)
+    );
+  });
+
+  const enquiryMaster = ref(false);
+
+  // 判断询盘所有者是否已经审核过该询盘
+  const enquiryMasterHasBeenVerify = ref(false);
+
   function init(r, t) {
     record = r;
     visible.value = true;
@@ -89,6 +117,11 @@
       url.value = '/adweb/executeNode/querySiteBuildFlow?siteCode=' + r.code;
     }
     showStep();
+
+    // 判断当前询盘是否属于当前登录用户
+    if (r.uid == userStore.userInfo?.id) {
+      enquiryMaster.value = true;
+    }
   }
   function onClose() {
     emit('close');
@@ -97,9 +130,10 @@
   function showStep() {
     stepData.value = [];
 
-    console.log(123123123);
+    loading.value = true;
     getAction(url.value, {})
       .then((res) => {
+        loading.value = false;
         if (res.code === 200) {
           stepData.value = res.result;
           // 当前步骤
@@ -116,7 +150,8 @@
         }
       })
       .catch((e) => {
-        createMessage.warn('获取数据失败!');
+        createMessage.warn('获取数据失败!' + e.message());
+        loading.value = false;
       });
   }
 
@@ -128,11 +163,25 @@
   }
 
   function finishOrRollbackStep(id, status, finishTime, nodeType, description) {
+    for (let i = 0; i < stepData.value.length; i++) {
+      // 判断当前登录用户是否是询盘所有者,并且是否已经审核过询盘
+      if (enquiryMaster.value && stepData.value[i].status === 1 && stepData.value[i].finUid === record.uid) {
+        createMessage.warn('询盘所有者已经审核过,请等待其他管理员审核!');
+        return;
+      }
+
+      if (isAdmin.value && stepData.value[i].status === 1 && stepData.value[i].finUid !== record.uid) {
+        createMessage.warn('管理员用户已经审核过,请等待询盘所有者审核!');
+        return;
+      }
+    }
+
     if (status == 1 && description == '') {
       createMessage.warn('审核日志记录不能为空');
       return;
     }
 
+    loading.value = true;
     let params = {
       id: id,
       status: status,
@@ -148,6 +197,8 @@
         showStep();
         emit('reload');
       }
+
+      loading.value = false;
     });
   }
 
@@ -177,7 +228,7 @@
 
       .ant-steps-item-description {
         div {
-          padding-left: 20px;
+          //padding-left: 20px;
           font-size: 14px;
         }
       }

+ 3 - 2
src/views/adweb/modules/flowProcessEdit.vue

@@ -166,14 +166,15 @@
     if (i == 0) {
       return;
     }
-    data.value.splice(i - 1, 0, data[i]);
+    data.value.splice(i - 1, 0, data.value[i]);
     data.value.splice(i + 1, 1);
   }
   function down(r, i) {
+    console.log(data.value, 'data.value');
     if (i == data.value.length - 1) {
       return;
     }
-    data.value.splice(i + 2, 0, data[i]);
+    data.value.splice(i + 2, 0, data.value[i]);
     data.value.splice(i, 1);
   }
   function deleteRow(i) {

+ 8 - 0
src/views/adweb/site/AdwebSite.api.ts

@@ -22,6 +22,7 @@ enum Api {
   bindGoogleAdsAccount = '/marketing/googleads/account/add', // 添加绑定接口地址
   getFaceBookAccount = '/marketing/facebook/account/get',
   bindFaceBookAccount = '/marketing/facebook/account/add',
+  getSubscribePlan = '/adweb/adwebSite/getSubscribePlanBySite',
 }
 
 /**
@@ -113,3 +114,10 @@ export const isSohoeb2b = () => {
     userStore.getRoleList.includes(RoleEnum.ADWEB_CHANNEL_ADMIN) && userStore.getLoginInfo.tenantList.some((obj) => obj.name.includes('苏豪纺织集团'))
   );
 };
+export const getSubscribePlan = () => {
+  const params: Record<string, any> = {
+    siteId: localStorage.getItem('siteID'),
+  };
+
+  return defHttp.get({ url: Api.getSubscribePlan, params });
+};