Browse Source

Merge branch 'master' of http://47.100.37.243:10191/wutt/manHourHousekeeper

Min 1 year ago
parent
commit
8f92c4c100
19 changed files with 211 additions and 117 deletions
  1. 19 2
      fhKeeper/formulahousekeeper/customerBuler-crm/src/components/TaskModal/index.vue
  2. 1 1
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/contacts/api.ts
  3. 1 1
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/contacts/component/deteleTables.vue
  4. 2 2
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/contacts/component/information.vue
  5. 2 3
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/contacts/component/relatedBusiness.vue
  6. 10 9
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/contacts/index.vue
  7. 1 1
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/api.ts
  8. 9 3
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/attachment.vue
  9. 3 3
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/deteleTables.vue
  10. 22 12
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/information.vue
  11. 9 3
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/operationRecord.vue
  12. 13 14
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/relatedBusiness.vue
  13. 11 11
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/relatedContacts.vue
  14. 16 16
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/relatedOrders.vue
  15. 1 1
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/detail/index.vue
  16. 38 16
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/index.vue
  17. 13 1
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/product/component/attachment.vue
  18. 2 2
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/tasks/api.ts
  19. 38 16
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/tasks/index.vue

+ 19 - 2
fhKeeper/formulahousekeeper/customerBuler-crm/src/components/TaskModal/index.vue

@@ -33,7 +33,7 @@
           </template>
           <template v-for="item in TASK_TYPE_FIELD">
             <el-select v-model="form[item.field]" v-if="form.taskType == item.type" placeholder="请选择" clearable
-              filterable :disabled="disabledList && disabledList.includes(item.field)">
+              filterable :disabled="disabledList && disabledList.includes(item.field)" @change="(e: any) => {taskFormChange(e, item.field)}">
               <el-option v-for="v in taskTypeValueData" :key="v.id" :value="v[item.valueIndex]"
                 :label="v[item.labelIndex]" />
             </el-select>
@@ -41,7 +41,7 @@
         </el-form-item>
         <el-form-item label="联系人:" v-if="TASK_TYPE.find(v => v.value == (form.taskType || '1'))?.show">
           <el-select v-model="form.contactsId" placeholder="请选择" clearable filterable
-            :disabled="disabledList && disabledList.includes('contactsId')">
+            :disabled="(disabledList && disabledList.includes('contactsId'))">
             <el-option v-for="item in contactValueData" :key="item.id" :value="item.id" :label="item.name" />
           </el-select>
         </el-form-item>
@@ -135,6 +135,7 @@ import { Delete, Plus } from "@element-plus/icons-vue"
 import { FormInstance, dayjs } from 'element-plus';
 import { getFromValue } from '@/utils/tools';
 import { Props, Emits } from './type';
+import { URL_GETALL } from '@/pages/contacts/api';
 const props = defineProps<Props>()
 const emits = defineEmits<Emits>();
 watch(() => props.saveLoading, (val) => {
@@ -214,6 +215,22 @@ const form = ref<any>({});
 const formRef = ref<FormInstance>();
 const generateFormRef = ref<InstanceType<typeof GenerateForm>>();
 const generateFormData = ref<any>({ ...defaultGenerateFormData });
+function taskFormChange(e: any, field: 'customId' | 'businessOpportunityId' | 'orderId' | 'clueId') {
+  const fieldMap = {
+    'customId': 'customerId',
+    'businessOpportunityId': 'businessId',
+    'orderId': 'salesId',
+    'clueId': ''
+  };
+  let fieldStr = fieldMap[field] || '';
+  updateContactPerson(e, fieldStr)
+}
+function updateContactPerson(val: any, field: string) {
+  let formVal = field ? { [field]: val } : {}
+  get(URL_GETALL, { ...formVal }).then(({ data }) => {
+    contactValueData.value = data;//联系人
+  })
+}
 function closeVisible() {
   formRef.value?.resetFields();
   generateFormData.value = { ...defaultGenerateFormData };

+ 1 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/contacts/api.ts

@@ -29,7 +29,7 @@ export const actionButtons: any[] = [
 ]
 
 export const tableColumns: TableColumn[] = [
-    { prop: 'name', label: '联系人', event: 'toDetali', width: '150' },
+    { prop: 'name', label: '联系人姓名', event: 'toDetali', width: '150' },
     { prop: 'customName', label: '客户名称', width: '150' },
     { prop: 'phone', label: '电话号码', width: '200' },
     { prop: 'email', label: '邮箱', width: '200' },

+ 1 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/contacts/component/deteleTables.vue

@@ -89,7 +89,7 @@ function batchOperation(type: operationType) {
 }
 
 function businessOperationItem(value: string | number, label: string, type: operationType, batch: boolean = false) {
-    confirmAction(`确定${batch ? '批量' : ''}${type}【${label}】商机吗?`).then(() => {
+    confirmAction(`确定${batch ? '批量' : ''}${type}【${label}】联系人吗?`).then(() => {
         let url = type == '恢复' ? URL_RESTORE : URL_DETELEITEM
         post(url, { ids: value }).then(res => {
             if (res.code != 'ok') {

+ 2 - 2
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/contacts/component/information.vue

@@ -5,13 +5,13 @@
             <div>
                 <el-button type="primary" v-if="!info.ownerId">认领</el-button>
                 <el-button type="primary" v-else @click="operationCli(false)">转移</el-button>
-                <el-button type="primary" @click="editInfo(info)">编辑</el-button>
+                <el-button type="primary" v-permission="['contactsEdit']" @click="editInfo(info)">编辑</el-button>
             </div>
         </div>
         <div class="form flex flex-wrap justify-between">
             <div v-for="item in formItems" :key="item.label" class="formItem flex pt-2 pb-1" :style="{ width: item.width }">
                 <div :class="item.labelClass">{{ item.label }}:</div>
-                <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1">{{ item.value }}</div>
+                <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1" v-ellipsis-tooltip>{{ item.value }}</div>
             </div>
         </div>
 

+ 2 - 3
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/contacts/component/relatedBusiness.vue

@@ -2,7 +2,7 @@
     <div class="relatedTasks pl-4 pr-4 pt-3 pb-3 h-full flex flex-col">
         <div class="flex justify-between">
             <div class="title">相关商机</div>
-            <div>
+            <div v-permission="['businessAddAnEdit']">
                 <el-button type="primary" @click="addBusiness()">新建商机</el-button>
             </div>
         </div>
@@ -15,14 +15,13 @@
                         }}</el-button>
                     </template>
                 </el-table-column>
-                <el-table-column prop="customerName" label="客户名称" width="130" />
+                <el-table-column prop="customerName" label="客户名称" width="140" />
                 <el-table-column prop="inchargerName" label="负责人" width="130" />
                 <el-table-column prop="amountOfMoney" label="商机金额" width="130" />
                 <el-table-column prop="expectedTransactionDate" label="预计成交时间" width="170" />
                 <el-table-column prop="stageValue" label="商机阶段" width="130" />
                 <el-table-column prop="creatorName" label="创建人" width="130" />
                 <el-table-column prop="createTime" label="创建时间" width="130" />
-                <el-table-column prop="modifyTime" label="修改时间" width="130" />
             </el-table>
         </div>
 

+ 10 - 9
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/contacts/index.vue

@@ -26,11 +26,11 @@
         <div class="flex justify-end pb-3">
           <!-- 操作按钮 -->
           <!-- <el-button v-for="(button, index) in actionButtons" :key="index" type="primary">{{ button.text }}</el-button> -->
-          <el-button type="primary" @click="editContacts(false)">新建联系人</el-button>
+          <el-button type="primary" v-permission="['contactsAdd']" @click="editContacts(false)">新建联系人</el-button>
           <el-button type="primary" @click="batchDeteleItem" :disabled="batchTableData.length <= 0">批量删除</el-button>
           <el-button type="primary" @click="showVisible('deteleContactsVisible')">回收站</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" v-permission="['contactsImport']" @click="showVisible('importVisible')">导入</el-button>
+          <el-button type="primary" v-permission="['contactsExport']" @click="exportCustomerTableList()" :loading="allLoading.exoprtLoading">导出</el-button>
         </div>
         <div class="flex-1 w-full overflow-hidden">
           <!-- 表格 -->
@@ -49,11 +49,11 @@
                 </template>
               </template>
             </el-table-column>
-            <el-table-column :label="'操作'" :width="'200px'" fixed="right">
+            <el-table-column :label="'操作'" :width="'200px'" fixed="right" v-permission="['contactsEdit', 'tasksAdd']">
               <template #default="scope">
-                <el-button link type="primary" size="large" @click="editContacts(scope.row)">编辑</el-button>
-                <el-button link type="primary" size="large" @click="newTask(scope.row)">新建任务</el-button>
-                <el-button link type="danger" size="large"
+                <el-button link type="primary" size="large" v-permission="['contactsEdit']" @click="editContacts(scope.row)">编辑</el-button>
+                <el-button link type="primary" size="large" v-permission="['tasksAdd']" @click="newTask(scope.row)">新建任务</el-button>
+                <el-button link type="danger" size="large" v-permission="['contactsEdit']"
                   @click="contactsDeteleItem(scope.row.id, scope.row.customName)">删除</el-button>
               </template>
             </el-table-column>
@@ -250,8 +250,9 @@ function batchDeteleItem() {
 }
 
 function contactsDeteleItem(value: string | number, label: string, batch: boolean = false) {
-  confirmAction(`确定${batch ? '批量' : ''}删除【${label}】客户吗?`).then(() => {
-    let url = batch ? URL_BATCHDETELE : URL_DETELERECYCLE
+  confirmAction(`确定${batch ? '批量' : ''}删除【${label}】联系人吗?`).then(() => {
+    // let url = batch ? URL_BATCHDETELE : URL_DETELERECYCLE
+    let url = URL_DETELERECYCLE
     post(url, { ids: value }).then(res => {
       if (res.code != 'ok') {
         globalPopup?.showError(res.msg)

+ 1 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/api.ts

@@ -1,5 +1,5 @@
 export const MOD = '/customer'
-export const IMPORTMOD = 'Custom'
+export const IMPORTMOD = 'Customer'
 export const PREFIX = '/custom'
 export const GETSYSFILED = '/sys-dict/getListByCode'
 export const GETPERSONNEL = '/user/getSimpleActiveUserList'

+ 9 - 3
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/attachment.vue

@@ -2,7 +2,7 @@
     <div class="attachment pl-4 pr-4 pt-3 pb-3 h-full flex flex-col">
         <div class="flex justify-between">
             <div class="title">附件</div>
-            <div>
+            <div v-permission="['customerEdit']">
                 <el-upload ref="uploadRef" :http-request="httpUploadFile" :limit="1" :show-file-list="false"
                     element-loading-text="正在上传">
                     <template #trigger>
@@ -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))
+        }
+    })
 });
 
 // 生命周期钩子

+ 3 - 3
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/deteleTables.vue

@@ -30,9 +30,9 @@
                     <el-table-column label="操作" fixed="right" width="120">
                         <template #default="scope">
                             <el-button link type="primary" size="large"
-                                @click="operationItem(scope.row.id, scope.row.name, '恢复')">恢复</el-button>
+                                @click="operationItem(scope.row.id, scope.row.customName, '恢复')">恢复</el-button>
                             <el-button link type="danger" size="large"
-                                @click="operationItem(scope.row.id, scope.row.name, '删除')">删除</el-button>
+                                @click="operationItem(scope.row.id, scope.row.customName, '删除')">删除</el-button>
                         </template>
                     </el-table-column>
                 </el-table>
@@ -87,7 +87,7 @@ watch(() => props.visibles, (newVal) => {
 
 function batchOperation(type: operationType) {
     const value = batchTableData.value.map((item: any) => item.id).join(',')
-    const label = batchTableData.value.map((item: any) => item.name).join(',')
+    const label = batchTableData.value.map((item: any) => item.customName).join(',')
     operationItem(value, label, type, true)
 }
 

+ 22 - 12
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/information.vue

@@ -5,27 +5,31 @@
             <div>
                 <el-button type="primary" @click="claimCustomer()" v-if="!information.inchargerName">认领</el-button>
                 <el-button type="primary" @click="transferCli()">转移</el-button>
-                <el-button type="primary" @click="editCustomer()">编辑</el-button>
+                <el-button type="primary" v-permission="['customerEdit']" @click="editCustomer()">编辑</el-button>
             </div>
         </div>
         <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

+ 9 - 3
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/operationRecord.vue

@@ -5,14 +5,15 @@
         </div>
         <div class="flex-1 overflow-auto pt-5">
             <el-table :data="operationRecordtable" border style="width: 100%;height: 278px;">
-                <el-table-column prop="creaTime" label="操作时间" width="140" />
-                <el-table-column prop="username" label="操作人" width="120" />
+                <el-table-column prop="creatTime" label="操作时间" width="140" />
+                <el-table-column prop="userName" label="操作人" width="120" />
                 <el-table-column prop="name" label="操作内容" />
             </el-table>
         </div>
     </div>
 </template>
 <script lang="ts" setup>
+import { formatDate } from '@/utils/times';
 import { ref, reactive, onMounted, onUnmounted, defineExpose, inject, watchEffect } from 'vue'
 
 const operationRecordtable = ref([])
@@ -25,7 +26,12 @@ const props = defineProps<{
 watchEffect(() => {
     const { data } = props
     information.value = data
-    operationRecordtable.value = data.actionLogs || []
+    operationRecordtable.value = (data.actionLogs || []).map((item: any) => {
+        return {
+            ...item,
+            creatTime: formatDate(new Date(item.creatTime))
+        }
+    })
 })
 
 // 生命周期钩子

+ 13 - 14
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/relatedBusiness.vue

@@ -2,27 +2,26 @@
     <div class="relatedTasks pl-4 pr-4 pt-3 pb-3 h-full flex flex-col">
         <div class="flex justify-between">
             <div class="title">相关商机</div>
-            <div>
+            <div v-permission="['businessAddAnEdit']">
                 <el-button type="primary" @click="editNewBusiness()">新建商机</el-button>
             </div>
         </div>
         <div class="flex-1 overflow-auto pt-3">
             <el-table :data="relatedTaskstable" border style="width: 100%;height: 300px;">
-                <el-table-column prop="taskName" label="商机名称">
+                <el-table-column prop="taskName" label="name">
                     <template #default="scope">
                         <el-button link type="primary" size="large">{{
-                            scope.row.taskName
-                        }}</el-button>
+                            scope.row.name
+                            }}</el-button>
                     </template>
                 </el-table-column>
-                <el-table-column prop="priority" label="客户名称" width="130" />
-                <el-table-column prop="status" label="负责人" width="130" />
-                <el-table-column prop="executor" label="商机金额" width="130" />
-                <el-table-column prop="startTime" label="预计成交时间" width="130" />
-                <el-table-column prop="endTime" label="商机阶段" width="130" />
-                <el-table-column prop="endTime" label="创建人" width="130" />
-                <el-table-column prop="endTime" label="创建时间" width="130" />
-                <el-table-column prop="endTime" label="修改时间" width="130" />
+                <el-table-column prop="customerName" label="客户名称" width="130" />
+                <el-table-column prop="inchargerName" label="负责人" width="130" />
+                <el-table-column prop="amountOfMoney" label="商机金额" width="130" />
+                <el-table-column prop="expectedTransactionDate" label="预计成交时间" width="200" />
+                <el-table-column prop="stageValue" label="商机阶段" width="140" />
+                <el-table-column prop="creatorName" label="创建人" width="130" />
+                <el-table-column prop="createTime" label="创建时间" width="130" />
             </el-table>
         </div>
 
@@ -87,7 +86,7 @@ const allLoading = reactive({
 function editBusiness(visibles: boolean) {
     businessTemplateRef.value?.getData().then((res: any) => {
         let productTableListData = relatedProductsRef?.value?.returnData()
-        if(!productTableListData || judgmentaAmounteEqual({ ...businessTemplateValue.value, ...res }, productTableListData)) {
+        if (!productTableListData || judgmentaAmounteEqual({ ...businessTemplateValue.value, ...res }, productTableListData)) {
             return
         }
         productTableListData.forEach((item: any) => {
@@ -168,7 +167,7 @@ function getProductTableList() {
 watchEffect(() => {
     const { data } = props
     information.value = data
-    relatedTaskstable.value = []
+    relatedTaskstable.value = (data.businessOpportunitys || [])
 })
 
 // 生命周期钩子

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

@@ -2,7 +2,7 @@
     <div class="relatedTasks pl-4 pr-4 pt-3 pb-3 h-full flex flex-col">
         <div class="flex justify-between">
             <div class="title">相关联系人</div>
-            <div>
+            <div v-permission="['contactsAdd']">
                 <el-button type="primary" @click="editContacts(information)">新建联系人</el-button>
             </div>
         </div>
@@ -13,20 +13,20 @@
                         {{ scope.$index + 1 }}
                     </template>
                 </el-table-column>
-                <el-table-column prop="taskName" label="联系人姓名">
+                <el-table-column prop="name" label="联系人姓名">
                     <template #default="scope">
                         <el-button link type="primary" size="large">{{
-                            scope.row.taskName
+                            scope.row.name
                         }}</el-button>
                     </template>
                 </el-table-column>
-                <el-table-column prop="priority" label="电话号码" width="130" />
-                <el-table-column prop="status" label="邮箱" width="130" />
-                <el-table-column prop="executor" label="职务" width="130" />
-                <el-table-column prop="startTime" label="性别" width="130" />
-                <el-table-column prop="endTime" label="负责人" width="130" />
-                <el-table-column prop="endTime" label="创建人" width="130" />
-                <el-table-column prop="endTime" label="创建时间" width="130" />
+                <el-table-column prop="phone" label="电话号码" width="130" />
+                <el-table-column prop="email" label="邮箱" width="130" />
+                <el-table-column prop="position" label="职务" width="130" />
+                <el-table-column prop="sexValue" label="性别" width="130" />
+                <el-table-column prop="ownerName" label="负责人" width="130" />
+                <el-table-column prop="creatorName" label="创建人" width="130" />
+                <el-table-column prop="createTime" label="创建时间" width="130" />
             </el-table>
         </div>
 
@@ -116,7 +116,7 @@ const allVisible = reactive({
 watchEffect(() => {
     const { data } = props
     information.value = data
-    relatedCustomertable.value = []
+    relatedCustomertable.value = (data.contacts || [])
 })
 
 async function getSystemField() {

+ 16 - 16
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/component/relatedOrders.vue

@@ -2,29 +2,29 @@
     <div class="relatedTasks pl-4 pr-4 pt-3 pb-3 h-full flex flex-col">
         <div class="flex justify-between">
             <div class="title">相关销售订单</div>
-            <div>
+            <div v-permission="['orderAdd']">
                 <el-button type="primary" @click="editOrder()">新建销售订单</el-button>
             </div>
         </div>
         <div class="flex-1 overflow-auto pt-3">
             <el-table :data="relatedOrders" border style="width: 100%;height: 300px;">
-                <el-table-column prop="priority" label="订单编号" width="130" />
-                <el-table-column prop="taskName" label="订单名称">
+                <el-table-column prop="orderCode" label="订单编号" width="130" />
+                <el-table-column prop="orderName" label="订单名称" min-width="200">
                     <template #default="scope">
                         <el-button link type="primary" size="large">{{
-                            scope.row.taskName
-                        }}</el-button>
+                            scope.row.orderName
+                            }}</el-button>
                     </template>
                 </el-table-column>
-                <el-table-column prop="priority" label="客户名称" width="130" />
-                <el-table-column prop="status" label="订单金额" width="130" />
-                <el-table-column prop="executor" label="已回款" width="130" />
-                <el-table-column prop="startTime" label="未回款" width="130" />
-                <el-table-column prop="endTime" label="订单类型" width="130" />
-                <el-table-column prop="endTime" label="下单时间" width="130" />
-                <el-table-column prop="endTime" label="负责人" width="130" />
-                <el-table-column prop="endTime" label="创建人" width="130" />
-                <el-table-column prop="endTime" label="创建时间" width="130" />
+                <el-table-column prop="customName" label="客户名称" width="130" />
+                <el-table-column prop="price" label="订单金额(¥)" width="130" />
+                <el-table-column prop="receivedPayment" label="已回款(¥)" width="130" />
+                <el-table-column prop="unReceivedPayment" label="未回款(¥)" width="130" />
+                <el-table-column prop="typeName" label="订单类型" width="130" />
+                <el-table-column prop="placeTime" label="下单时间" width="200" />
+                <el-table-column prop="inchargerName" label="负责人" width="130" />
+                <el-table-column prop="creatorName" label="创建人" width="130" />
+                <el-table-column prop="createTime" label="创建时间" width="200" />
             </el-table>
         </div>
 
@@ -122,7 +122,7 @@ function saveOrder(flag: boolean) {
 function editOrder() {
     showVisible('editOrderVisible')
     allLoading.orderTemplateLoadinng = true
-    
+
     orderTemplateValue.value = { customId: information.value.id }
     productTableListValue.value = []
     setTimeout(() => {
@@ -176,7 +176,7 @@ function getProductTableList() {
 watchEffect(() => {
     const { data } = props
     information.value = data
-    relatedOrders.value = []
+    relatedOrders.value = (data.salesOrders || [])
 })
 
 // 生命周期钩子

+ 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>

+ 38 - 16
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="客户级别">
@@ -52,46 +53,48 @@
     <div class="flex-1 p-5 overflow-auto">
       <div class="bg-white w-full h-full p-3 shadow-md rounded-md flex flex-col">
         <div class="flex justify-end pb-3">
-          <el-button type="primary" @click="editCustomer(false)">新建客户</el-button>
+          <el-button type="primary" v-permission="['customerAdd']" @click="editCustomer(false)">新建客户</el-button>
           <el-button type="primary" @click="showVisible('batchTransferVisible')"
             :disabled="batchTableData.length <= 0">批量转移</el-button>
           <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" v-permission="['customerImport']" @click="showVisible('importVisible')">导入</el-button>
+          <el-button type="primary" v-permission="['customerExport']" @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">
+          <el-table ref="customerTableRef" :show-overflow-tooltip="tableShowOverflowTooltip" :data="customerTable" border v-loading="allLoading.customerTableLading"
+            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">
-                <el-button link type="primary" size="large" @click.prevent="toCustomerTableDetail(scope.row)">{{
+                <!-- <el-button link type="primary" size="large" @click.prevent="toCustomerTableDetail(scope.row)">{{
                   scope.row.customName
-                }}</el-button>
+                }}</el-button> -->
+                <div class="table-text-textnowrap" @click.prevent="toCustomerTableDetail(scope.row)">{{ scope.row.customName }}</div>
               </template>
             </el-table-column>
             <el-table-column prop="customSourceValue" label="客户来源" width="180"></el-table-column>
             <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>
-            <el-table-column label="操作" fixed="right" width="200">
+            <el-table-column label="操作" fixed="right" width="200" v-permission="['customerEdit', 'tasksAdd', 'customerEdit']">
               <template #default="scope">
-                <el-button link type="primary" size="large" @click="editCustomer(scope.row)">编辑</el-button>
-                <el-button link type="primary" size="large" @click="newTask(scope.row)">新建任务</el-button>
-                <el-button link type="danger" size="large"
+                <el-button link type="primary" size="large" v-permission="['customerEdit']" @click="editCustomer(scope.row)">编辑</el-button>
+                <el-button link type="primary" size="large" v-permission="['tasksAdd']" @click="newTask(scope.row)">新建任务</el-button>
+                <el-button link type="danger" size="large" v-permission="['customerEdit']"
                   @click="customerDeteleItem(scope.row.id, scope.row.customName)">删除</el-button>
               </template>
             </el-table-column>
           </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>
@@ -181,6 +184,7 @@ import { useRouter, useRoute } from "vue-router";
 import { GenerateForm } from '@zmjs/form-design';
 import { createTask } from "@/components/TaskModal/taskFunction";
 import { ElTable, UploadRequestOptions } from "element-plus";
+import { tableShowOverflowTooltip } from '@/utils/globalVariables'
 
 import TaskModal from '@/components/TaskModal/index.vue'
 import DeteleBusiness from './component/deteleTables.vue'
@@ -209,6 +213,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 +231,7 @@ const customerCriteriaForm = reactive<customerCriteriaFormType>({ // 筛选条
   customerIndustryId: '',
   customerLevelId: '',
   inchargerId: '',
+  isDesc: '',
   startTime: getFirstDayOfMonth(new Date()),
   endTime: formatDate(new Date()),
   pageIndex: 1,
@@ -276,6 +282,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 +385,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;
 }
 
 // 保存重命名

+ 2 - 2
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/tasks/api.ts

@@ -30,9 +30,9 @@ export const defaultSearchForm = {
 };
 export const PRIORITY = [
   //优先级
-  { label: "", value: 2 },
+  { label: "", value: 2 },
   { label: "中", value: 1 },
-  { label: "", value: 0 },
+  { label: "", value: 0 },
 ];
 export const STATUS: StatusType[] = [
   //任务状态

+ 38 - 16
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/tasks/index.vue

@@ -15,7 +15,7 @@
             <el-form-item label="客户名称:" label-width="7em" prop="customName">
               <el-input v-model="searchForm.customName" placeholder="请输入" />
             </el-form-item>
-            <el-form-item label="联系人:" label-width="7em" prop="contactsName">
+            <el-form-item label="联系人号码:" label-width="7em" prop="contactsName">
               <el-input v-model="searchForm.contactsName" placeholder="请输入" />
             </el-form-item>
             <el-form-item label="执行人:" label-width="7em" prop="executorName">
@@ -52,13 +52,14 @@
     <div class="flex-1 p-5 overflow-auto">
       <div class="bg-white w-full h-full p-3 shadow-md rounded-md flex flex-col">
         <div class="ml-auto p-3">
-          <el-button type="primary" @click="createTasks()">创建任务</el-Button>
+          <el-button type="primary" v-permission="['tasksAdd']" @click="createTasks()">创建任务</el-Button>
           <el-button type="primary" :disabled="len == 0" :loading="btnLoading" @click="deleteTasks()">批量删除</el-Button>
-          <el-button type="primary" @click="openImportModal()">导入</el-Button>
-          <el-button type="primary" :loading="btnLoading" @click="exportTasks()">导出</el-Button>
+          <el-button type="primary" v-permission="['tasksImport']" @click="openImportModal()">导入</el-Button>
+          <!-- <el-button type="primary" :loading="btnLoading" @click="exportTasks()">导出</el-Button> -->
+          <el-button type="primary" v-permission="['tasksExport']" :loading="btnLoading" @click="newExportTasks()">导出</el-Button>
         </div>
         <div class="flex-1 overflow-y-auto">
-          <el-table :data="tableData" style="width: 100%;height: 100%;" ref="tableRef" v-loading="loading">
+          <el-table :data="tableData" :show-overflow-tooltip="tableShowOverflowTooltip" style="width: 100%;height: 100%;" ref="tableRef" v-loading="loading">
             <el-table-column type="selection" width="55" />
             <el-table-column prop="taskName" label="任务名称" header-align="center" align="center" show-overflow-tooltip
               width="200" />
@@ -75,19 +76,11 @@
                 </el-text>
               </template>
             </el-table-column>
-            <el-table-column prop="customName" label="执行人" width="120" header-align="center" align="center" />
+            <el-table-column prop="executorNames" label="执行人" width="120" header-align="center" align="center" />
             <el-table-column prop="startDate" label="开始时间" width="200" :sortable="true" header-align="center"
               align="center" value-format="YYYY-MM-DD" />
             <el-table-column prop="endDate" label="截止时间" width="200" :sortable="true" header-align="center"
               align="center" value-format="YYYY-MM-DD" />
-            <el-table-column prop="contactsName" label="联系人" header-align="center" align="center" width="120">
-              <template #default="scope">
-                <el-link :underline="false" type="primary" @click="goDetail(scope.row, 'contacts', 'contactsId')">
-                  {{ scope.row.contactsName }}
-                </el-link>
-              </template>
-            </el-table-column>
-            <el-table-column prop="contactsTel" label="联系人号码" header-align="center" align="center" width="140" />
             <el-table-column prop="customName" label="客户名称" header-align="center" align="center" width="120">
               <template #default="scope">
                 <el-link :underline="false" type="primary" @click="goDetail(scope.row, 'customer', 'customId')">
@@ -117,8 +110,16 @@
                 </el-link>
               </template>
             </el-table-column>
+            <el-table-column prop="contactsName" label="联系人名称" header-align="center" align="center" width="120">
+              <template #default="scope">
+                <el-link :underline="false" type="primary" @click="goDetail(scope.row, 'contacts', 'contactsId')">
+                  {{ scope.row.contactsName }}
+                </el-link>
+              </template>
+            </el-table-column>
+            <el-table-column prop="contactsTel" label="联系人号码" header-align="center" align="center" width="140" />
 
-            <el-table-column fixed="right" label="操作" header-align="center" align="center" width="150">
+            <el-table-column fixed="right" label="操作" header-align="center" align="center" width="160" v-permission="['tasksEdit']">
 
               <template #default="scope">
                 <el-button link type="primary" @click.prevent="editRow(scope.row)">
@@ -165,6 +166,7 @@ import ImportModal from './ImportModal.vue';
 import ExportModal from './ExportModal.vue';
 import { post, uploadFile } from '@/utils/request';
 import { getFromValue, confirmAction, downloadFile } from '@/utils/tools';
+import { tableShowOverflowTooltip } from '@/utils/globalVariables'
 import { pushMap } from './type';
 const router = useRouter()
 const { getFunctionList } = useStore()
@@ -216,6 +218,23 @@ const tableRef = ref<InstanceType<typeof ElTable>>();
 const loading = ref<boolean>(false);
 const totalCount = ref<number>(0);
 const tableData = ref<any[]>([])
+
+function newExportTasks() {
+  btnLoading.value = true
+  const { startDate, endDate } = searchForm.value;
+  let params = {
+    ...searchForm.value,
+    startDate: startDate && dayjs(startDate).format('YYYY-MM-DD 00:00:00'),
+    endDate: endDate && dayjs(endDate).format('YYYY-MM-DD 23:59:59')
+  }
+  post(EXPORT_DATA_BY_TASK_ID, {...getFromValue(params)}).then((res) => {
+    globalPopup?.showSuccess("导出成功")
+    downloadFile(res.data, "任务列表.xlsx");
+  }).finally(() => {
+    btnLoading.value = false
+  })
+}
+
 function search() {
   loading.value = true;
   const { startDate, endDate } = searchForm.value;
@@ -228,7 +247,10 @@ function search() {
     loading.value = false;
     const { total, record } = data;
     totalCount.value = total;
-    tableData.value = record;
+    tableData.value = record.map((item: any) => ({
+      ...item,
+      executorNames: item.taskExecutors?.join(',') ?? ''
+    }));
   }).catch(err => {
     globalPopup?.showError(err);
     loading.value = false;