Explorar o código

Merge branch 'ch/jinrui1.0' of eta_mini/eta_mini_crm_front into debug_jr

leichen hai 2 semanas
pai
achega
dab53784ed

+ 12 - 8
src/views/customer/components/ContactTable.vue

@@ -5,6 +5,7 @@ import { ElMessage, ElMessageBox } from 'element-plus'
 import { computed } from 'vue'
 import MoveUser from './MoveUser.vue'
 import AddContact from './AddContact.vue'
+import UserStatisticDetail from '../reportStatistic/components/UserStatisticDetail.vue'
 
 const route = useRoute()
 const router = useRouter()
@@ -152,6 +153,15 @@ function handleAddContact(row, type = 'edit') {
   showAddContact.value = true
 }
 
+const showDetail=ref(false)
+const readTimesUserId=ref(0)
+const activeUserName=ref('')
+function handleGoReadTimes(e){
+  readTimesUserId.value=e.UserId
+  activeUserName.value=e.RealName
+  showDetail.value=true
+}
+
 </script>
 
 <template>
@@ -197,17 +207,10 @@ function handleAddContact(row, type = 'edit') {
             <span v-else-if="column.key === 'IsSubscribed'">{{
               row.IsSubscribed ? "是" : "否"
             }}</span>
-            <span v-else-if="column.key === 'ValidStartTime'"
-              >{{ formatTime(row.ValidStartTime, "YYYY-MM-DD") }}~{{
-                formatTime(row.ValidEndTime, "YYYY-MM-DD")
-              }}</span
-            >
             <span v-else-if="column.key === 'RegisterTime'">{{
               formatTime(row.RegisterTime)
             }}</span>
-            <span v-else-if="column.key === 'CreateTime'">{{
-              formatTime(row.CreateTime)
-            }}</span>
+            <span v-else-if="column.key === 'ReadTimes'"  :style="row.ReadTimes > 0 ?'color: #075EEE;' : ''" @click="handleGoReadTimes(row)">{{ row.ReadTimes}}</span>
             <span v-else>{{ row[column.key] }}</span>
           </template>
         </el-table-column>
@@ -259,6 +262,7 @@ function handleAddContact(row, type = 'edit') {
     @success="getUserList"
     :contactTatle="contactTatle"
   />
+  <UserStatisticDetail v-model:show="showDetail" :userId="readTimesUserId" :userName="activeUserName"/>
 </template>
 
 <style lang="scss" scoped>

+ 9 - 15
src/views/customer/reportStatistic/components/UserStatisticDetail.vue

@@ -27,11 +27,13 @@ const tableColOpt = [
   },
   {
     label: '阅读时间',
-    key: 'CreateTime'
+    key: 'CreateTime',
+    width: 170,
   },
   {
     label: '停留时间',
-    key: 'ReadDuration'
+    key: 'ReadDuration',
+    width: 100,
   },
 ]
 const list = ref([])
@@ -72,15 +74,6 @@ watch(() => show.value, (n) => {
   }
 })
 
-function formatClassifyName(e){
-  if(e.ClassifyName3){
-    return `${e.ClassifyName1}/${e.ClassifyName2}/${e.ClassifyName3}`
-  }else if(e.ClassifyName2){
-    return `${e.ClassifyName1}/${e.ClassifyName2}`
-  }else{
-    return e.ClassifyName1
-  }
-}
 
 </script>
 
@@ -113,13 +106,14 @@ function formatClassifyName(e){
           :key="column.key"
           :prop="column.key"
           :label="column.label"
+          :width="column.width"
         >
           <template #default="{ row }">
-            <span v-if="column.key === 'CreateTime'">{{
-              formatTime(row.CreateTime)
+            <span v-if="column.key === 'ClassifyNameThird'">{{
+              row.ClassifyNameFirst + '/' + row.ClassifyNameSecond + '/' + row.ClassifyNameThird
             }}</span>
-            <span v-else-if="column.key === 'ClassifyName1'">{{
-              formatClassifyName(row)
+            <span v-else-if="column.key === 'CreateTime'">{{
+              formatTime(row.CreateTime)
             }}</span>
             <span v-else>{{ row[column.key] }}</span>
           </template>

+ 2 - 2
src/views/system/userList/components/DepartWrap.vue

@@ -293,8 +293,8 @@ function getFormTitle(e) {
                 <svg-icon
                   name="edit2"
                   size="16px"
-                  v-if="hasPermission('department:edit')"
-                  @click.stop="handleDepartOpt(node, data, 'edit')"
+                  v-if="hasPermission(permissionBtn.systemManageBtn.user_deleteDept)"
+                  @click.stop="handleDepartOpt(node, data, 'edit')" 
                 ></svg-icon>
                 <el-dropdown>
                   <svg-icon

+ 6 - 23
src/views/system/userList/components/EditUser.vue

@@ -17,6 +17,7 @@ const isEditAdmin=computed(()=>{
 watch(
   ()=>show.value,
   (n)=>{
+    formRef.value ? formRef.value.clearValidate() : '';
     if(n&&props.data){
       // console.log(props.data);
       formState=reactive({
@@ -26,7 +27,6 @@ watch(
         areacode: props.data.AreaCode,
         mobile: props.data.Phone,
         depart: props.data.SysDepartmentId,
-        email: props.data.Email,
         role: props.data.SysRoleId,
         province: props.data.Province,
         city: props.data.City,
@@ -40,7 +40,6 @@ watch(
         areacode: '86',
         mobile: '',
         depart: '',
-        email: '',
         role: '',
         province: '',
         city: '',
@@ -101,8 +100,8 @@ const formRules = {
   name: [{ required: true, message: '姓名不能为空', trigger: 'blur' }],
   mobile: [{
     validator: (rule, value, callback) => {
-      if (value === '' && !formState.email) {
-        callback(new Error('手机号码和邮箱至少填一个'));
+      if (value === '') {
+        callback(new Error('请输入手机号码'));
       } else if (value && formState.areacode === '86' && !isMobileNo(value || '')) {
         callback(new Error('请输入正确的手机号格式'));
       } else if (formState.areacode !== '86' && isNaN(value?.trim())) {
@@ -112,17 +111,6 @@ const formRules = {
       }
     }, trigger: 'blur'
   }],
-  email: [{
-    validator: (rule, value, callback) => {
-      if (value === '' && !formState.mobile) {
-        callback(new Error('手机号码和邮箱至少填一个'));
-      } else if (value && !patternEmail.test(value)) {
-        callback(new Error('请输入正确的邮箱格式'));
-      } else {
-        callback();
-      }
-    }, trigger: 'blur'
-  }],
   depart: [{ required: true, message: '部门分组不能为空', trigger: 'change' }],
   role: [{ required: true, message: '角色不能为空', trigger: 'change' }],
 }
@@ -134,7 +122,6 @@ let formState = reactive({
   areacode: '86',
   mobile: '',
   depart: '',
-  email: '',
   role: '',
   province: '',
   city: '',
@@ -153,7 +140,6 @@ async function handleSave() {
     realname: formState.name,
     phone: formState.mobile,
     areacode: formState.areacode,
-    email: formState.email,
     Province: formState.province,
     City: formState.city,
     sysdepartmentid: formState.depart,
@@ -194,8 +180,8 @@ async function handleSave() {
       <el-form-item label="用户名" prop="account">
         <el-input
           v-model="formState.account"
-          placeholder="建议使用邮箱前缀或者手机号码"
-          clearable
+          placeholder="请输入用户名"
+          clearable 
           :disabled="isEditAdmin"
         />
       </el-form-item>
@@ -237,7 +223,7 @@ async function handleSave() {
           style="width: 60%; margin-left: 5%"
         />
       </el-form-item>
-      <el-form-item label="所属部门" prop="depart" v-if="!props.data&&!isEditAdmin">
+      <el-form-item label="所属部门" prop="depart" v-if="!isEditAdmin">
         <el-cascader
           style="width: 100%"
           :options="departArr"
@@ -254,9 +240,6 @@ async function handleSave() {
         >
         </el-cascader>
       </el-form-item>
-      <el-form-item label="邮箱" prop="email">
-        <el-input v-model="formState.email" placeholder="请输入邮箱" />
-      </el-form-item>
       <el-form-item label="分配角色" prop="role">
         <el-select v-model="formState.role" placeholder="分配角色" :disabled="isEditAdmin">
           <el-option