Ver código fonte

客户管家提交客户模块相关代码

Lijy 11 meses atrás
pai
commit
44f894e3b4

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

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

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

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

@@ -5,7 +5,7 @@
             <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">

+ 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 || [])
 })
 
 // 生命周期钩子

+ 12 - 10
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/index.vue

@@ -53,24 +53,25 @@
     <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()"
+          <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"
+          <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>
@@ -81,11 +82,11 @@
             <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>
@@ -183,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'