瀏覽代碼

客户管家提交相关代码

Lijy 11 月之前
父節點
當前提交
8e9aae65f5

+ 8 - 2
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/attachment.vue

@@ -16,7 +16,7 @@
                 <el-table-column prop="name" label="附件名称" width="180" />
                 <el-table-column prop="size" label="附件大小" width="120" />
                 <el-table-column prop="userName" label="上传人" width="120" />
-                <el-table-column prop="createTime" label="上传时间" width="180" />
+                <el-table-column prop="createTime" label="上传时间" width="180" sortable />
                 <el-table-column label="操作" width="180" fixed="right">
                     <template #default="scope">
                         <el-button link type="primary" size="large" @click="fileDownload(scope.row)">下载</el-button>
@@ -50,6 +50,7 @@ import { UploadRequestOptions } from 'element-plus';
 import { ref, reactive, onMounted, onUnmounted, defineExpose, inject, watchEffect } from 'vue'
 import { URL_DETELEFILE, URL_REFFILENAME, URL_UPLOADFILE } from '../api';
 import { confirmAction, downloadFile } from '@/utils/tools';
+import { formatDate } from '@/utils/times';
 
 const emits = defineEmits(['refreshData']);
 const globalPopup = inject<GlobalPopup>('globalPopup')
@@ -118,7 +119,12 @@ function showVisible(item: any) {
 
 watchEffect(() => {
     information.value = props.data
-    attachmenttable.value = (props.data.files || [])
+    attachmenttable.value = (props.data.files || []).map((item: any) => {
+        return {
+            ...item,
+            createTime: formatDate(new Date(item.createTime))
+        }
+    })
 });
 
 // 生命周期钩子

+ 21 - 11
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/information.vue

@@ -11,21 +11,25 @@
         <div class="form flex flex-wrap justify-between">
             <div class="formItem flex pt-2 pb-1">
                 <div class="w-20 text-right text-gray-500">客户名称:</div>
-                <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1">{{ information.customName }}</div>
+                <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1" v-ellipsis-tooltip>{{
+                    information.customName }}</div>
             </div>
             <div class="formItem flex pt-2 pb-1">
                 <div class="w-22 text-right text-gray-500">客户来源:</div>
-                <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1">{{ information.customSourceValue }}
+                <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1">{{
+                    information.customSourceValue }}
                 </div>
             </div>
             <div class="formItem flex pt-2 pb-1">
                 <div class="w-22 text-right text-gray-500">电话号码:</div>
-                <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1">{{ information.companyPhone }}
+                <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1" v-ellipsis-tooltip>{{
+                    information.companyPhone }}
                 </div>
             </div>
             <div class="formItem flex pt-2 pb-1">
                 <div class="w-22 text-right text-gray-500">邮箱:</div>
-                <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1">{{ information.email }}</div>
+                <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1" v-ellipsis-tooltip>{{
+                    information.email }}</div>
             </div>
             <div class="formItem flex pt-2 pb-1">
                 <div class="w-22 text-right text-gray-500">客户行业:</div>
@@ -34,7 +38,8 @@
             </div>
             <div class="formItem flex pt-2 pb-1">
                 <div class="w-22 text-right text-gray-500">客户级别:</div>
-                <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1">{{ information.customerLevelValue
+                <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1">{{
+                    information.customerLevelValue
                 }}</div>
             </div>
             <div class="formItem flex pt-2 pb-1">
@@ -48,7 +53,8 @@
             </div>
             <div class="formItem flex pt-2 pb-1">
                 <div class="w-22 text-right text-gray-500">创建人:</div>
-                <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1">{{ information.creatorName }}</div>
+                <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1">{{ information.creatorName }}
+                </div>
             </div>
             <div class="formItem flex pt-2 pb-1">
                 <div class="w-22 text-right text-gray-500">创建时间:</div>
@@ -57,7 +63,7 @@
             </div>
             <div class="formItem flex pt-2 pb-1" style="width: 100%;">
                 <div class="w-22 text-right text-gray-500">备注:</div>
-                <div class="flex-1 ml-1 text ">
+                <div class="flex-1 ml-1 text " v-ellipsis-tooltip>
                     {{ information.customDesc }}
                 </div>
             </div>
@@ -91,7 +97,8 @@
                 <div class="flex justify-between items-center border-b pb-3 dialog-header">
                     <h4 :id="titleId">{{ '编辑客户' }}</h4>
                     <div>
-                        <el-button type="primary" @click="saveCustomer()" :loading="allLoading.saveLading">保存</el-button>
+                        <el-button type="primary" @click="saveCustomer()"
+                            :loading="allLoading.saveLading">保存</el-button>
                         <el-button @click="closeVisible('editCustomerVisible')">取消</el-button>
                     </div>
                 </div>
@@ -144,7 +151,9 @@ const allVisible = reactive({
 function saveCustomer() {
     generateForm.value?.getData().then((res: any) => {
         allLoading.saveLading = true
-        post(URL_EDITSAVE, { ...generateFormValue.value, ...res }).then((_res) => {
+        let formVal = { ...generateFormValue.value, ...res }
+        delete formVal.createTime
+        post(URL_EDITSAVE, { ...formVal }).then((_res) => {
             globalPopup?.showSuccess('操作成功')
             closeVisible('editCustomerVisible')
             emits('refreshData')
@@ -188,11 +197,12 @@ function claimCustomer() {
 }
 
 function editCustomer() {
-    const { id, companyPhone, customName, inchargerId, createTime, customSourceId, customerIndustryId, customerLevelId, email, telPhone } = information.value
+    const { id, companyPhone, customName, inchargerId, createTime, customSourceId, customerIndustryId, customerLevelId, email, telPhone, customDesc } = information.value
     const formVal = {
         id, customName, inchargerId, customerIndustryId, customerLevelId, email, customSourceId,
         createTime: formatDate(new Date(createTime)),
-        telPhone, companyPhone
+        telPhone, companyPhone,
+        customDesc
     }
     generateFormValue.value = formVal
     allLoading.generateFormDataLoading = true

+ 1 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/detail/index.vue

@@ -7,7 +7,7 @@
         </el-link>
       </div>
       <div class="mr-8">
-        <el-select v-model="values" placeholder="请选择" style="width: 150px" @change="getDetail()">
+        <el-select v-model="values" placeholder="请选择" style="width: 250px" @change="getDetail()">
           <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
         </el-select>
       </div>

+ 27 - 7
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/index.vue

@@ -12,7 +12,7 @@
                 <el-option v-for="item in fixedData.ClueSources" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
-            <el-form-item label="电话号码">
+            <el-form-item label="公司号码">
               <el-input v-model="customerCriteriaForm.telPhone" clearable placeholder="请输入"></el-input>
             </el-form-item>
             <el-form-item label="邮箱">
@@ -20,7 +20,8 @@
             </el-form-item>
             <el-form-item label="客户行业">
               <el-select v-model="customerCriteriaForm.customerIndustryId" placeholder="请选择" clearable>
-                <el-option v-for="item in fixedData.CustomIndustry" :key="item.id" :label="item.name" :value="item.id" />
+                <el-option v-for="item in fixedData.CustomIndustry" :key="item.id" :label="item.name"
+                  :value="item.id" />
               </el-select>
             </el-form-item>
             <el-form-item label="客户级别">
@@ -58,11 +59,12 @@
           <el-button type="primary" @click="batchDeteleItem()" :disabled="batchTableData.length <= 0">批量删除</el-button>
           <el-button type="primary" @click="showVisible('deteleCustomerVisible')">回收站</el-button>
           <el-button type="primary" @click="showVisible('importVisible')">导入</el-button>
-          <el-button type="primary" @click="exportCustomerTableList()" :loading="allLoading.exoprtLoading">导出</el-button>
+          <el-button type="primary" @click="exportCustomerTableList()"
+            :loading="allLoading.exoprtLoading">导出</el-button>
         </div>
         <div class="flex-1 w-full overflow-hidden">
           <el-table ref="customerTableRef" :data="customerTable" border v-loading="allLoading.customerTableLading"
-            style="width: 100%;height: 100%;" @selection-change="changeBatch">
+            style="width: 100%;height: 100%;" @selection-change="changeBatch" @sort-change="sortChange">
             <el-table-column type="selection" width="55" />
             <el-table-column prop="customName" label="客户名称" width="180">
               <template #default="scope">
@@ -75,7 +77,7 @@
             <el-table-column prop="companyPhone" label="公司电话" width="180"></el-table-column>
             <el-table-column prop="email" label="邮箱" width="200"></el-table-column>
             <el-table-column prop="customerIndustryValue" label="客户行业" width="180"></el-table-column>
-            <el-table-column prop="customerLevelValue" label="客户级别" width="180"></el-table-column>
+            <el-table-column prop="customerLevelValue" label="客户级别" width="180" sortable></el-table-column>
             <el-table-column prop="inchargerName" label="负责人" width="190"></el-table-column>
             <el-table-column prop="creatorName" label="创建人" width="180"></el-table-column>
             <el-table-column prop="newCreateTime" label="创建时间" width="180"></el-table-column>
@@ -90,8 +92,8 @@
           </el-table>
         </div>
         <div class="flex justify-end pt-3">
-          <el-pagination layout="total, prev, pager, next, sizes" :total="customerTotalTable" :hide-on-single-page="true"
-            @size-change="handleSizeChange" @current-change="handleCurrentChange" />
+          <el-pagination layout="total, prev, pager, next, sizes" :total="customerTotalTable"
+            :hide-on-single-page="true" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
         </div>
       </div>
     </div>
@@ -209,6 +211,7 @@ interface customerCriteriaFormType { // 线索筛选条件类型
   customerIndustryId: string | number,
   customerLevelId: string | number,
   inchargerId: string | number,
+  isDesc?: string | number,
   startTime: string | number,
   endTime: string | number,
   pageIndex: string | number,
@@ -226,6 +229,7 @@ const customerCriteriaForm = reactive<customerCriteriaFormType>({ // 筛选条
   customerIndustryId: '',
   customerLevelId: '',
   inchargerId: '',
+  isDesc: '',
   startTime: getFirstDayOfMonth(new Date()),
   endTime: formatDate(new Date()),
   pageIndex: 1,
@@ -276,6 +280,21 @@ const transferPersonnel = ref('')
 
 
 // 定义方法
+function sortChange(data: any) {
+  customerCriteriaForm.pageIndex = 1
+  switch (data.order) {
+    case 'ascending':
+      customerCriteriaForm.isDesc = 1
+      break
+    case 'descending':
+      customerCriteriaForm.isDesc = 0
+      break
+    default:
+      customerCriteriaForm.isDesc = ''
+  }
+  getCustomerTable()
+}
+
 async function importBusiness(param: UploadRequestOptions) {
   allLoading.importLoading = true
   const formData = new FormData();
@@ -364,6 +383,7 @@ function editCustomerSave(flag: boolean) {
       ...customerTemplateValue.value,
       ...res
     }
+    delete formVal.createTime
     post(URL_EDITSAVE, { ...formVal }).then((_res) => {
       allVisible.editCustomerVisible = flag
       globalPopup?.showSuccess('保存成功')

+ 13 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/product/component/attachment.vue

@@ -20,6 +20,7 @@
                 <el-table-column label="操作" width="180" fixed="right">
                     <template #default="scope">
                         <el-button link type="primary" size="large" @click="fileDownload(scope.row)">下载</el-button>
+                        <el-button link type="primary" size="large" @click="fileDownload2(scope.row)">下载2</el-button>
                         <el-button link type="primary" size="large" @click="showVisible(scope.row)">重命名</el-button>
                         <el-button link type="danger" size="large" @click="deteleFile(scope.row)">删除</el-button>
                     </template>
@@ -74,7 +75,18 @@ const props = defineProps<{
 
 // 下载文件
 function fileDownload(item: any) {
-    downloadFile(item.url, `${item.attachmentName}${item.attachmentSuffix}`)
+    downloadFile(item.url, `${removeSuffix(item.attachmentName, item.attachmentSuffix)}${item.attachmentSuffix}`)
+}
+
+function fileDownload2(item: any) {
+    downloadFile(item.serverName, `${removeSuffix(item.attachmentName, item.attachmentSuffix)}${item.attachmentSuffix}`)
+}
+
+function removeSuffix(str: string, suffix: string) {
+    if (str.endsWith(suffix)) {
+        return str.slice(0, -suffix.length);
+    }
+    return str;
 }
 
 // 保存重命名