浏览代码

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

Min 10 月之前
父节点
当前提交
162f4554d4

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

@@ -37,8 +37,8 @@ export const tableColumn: businessTableColumnInterface[] = [
     { prop: "customerName", label: "客户名称", width: "180" },
     { prop: "contactsName", label: "联系人", width: "180", eventName: "showName" },
     { prop: "amountOfMoney", label: "商机金额", width: "180" },
+    { prop: "expectedTransactionDate", label: "预计成交时间", width: "180" },
     { prop: "stageValue", label: "商机阶段", width: "180" },
-    { prop: "expectedTransactionDate", label: "预计成交", width: "180" },
     { prop: "inchargerName", label: "负责人", width: "180" },
     { prop: "creatorName", label: "创建人", width: "180" },
     { prop: "createTime", label: "创建时间", width: "180" }

+ 3 - 3
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/business/component/products.vue

@@ -100,10 +100,10 @@ function editProduct() {
 function editProductShow() {
     const productList = information.value.businessItemProducts || []
     const list = productList.map((item: any) => {
-        const { id, productName, productId, productCode, unit, unitName, typeName, type, price, inventory, orderProductDetail, num, discount, sealPrice, totalPrice, quantity } = item
+        const { id, productName, productId, productCode, unit, unitName, productType, type, price, inventory, sellingPrice, orderProductDetail, num, discount, sealPrice, totalPrice, quantity } = item
         return {
-            id, productId: productId, productName, productCode, unit, unitName, typeName, type, price, inventory,
-            num, discount, sealPrice, totalPrice, quantity
+            id, productId: productId, productName, productCode, unitName: unit, typeName: productType, type, price, inventory,
+            num, discount, sealPrice, totalPrice, quantity, sellingPrice
         }
     })
     productTableListValue.value = list

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

@@ -240,6 +240,7 @@ function claimCustomer() {
 function editCustomer() {
   const {
     id,
+    contactsName,
     companyPhone,
     customName,
     inchargerId,
@@ -249,7 +250,8 @@ function editCustomer() {
     customerLevelId,
     email,
     telPhone,
-    customDesc
+    customDesc,
+    address
   } = information.value;
   const formVal = {
     id,
@@ -257,12 +259,14 @@ function editCustomer() {
     inchargerId,
     customerIndustryId,
     customerLevelId,
+    contactsName,
     email,
     customSourceId,
     createTime: formatDate(new Date(createTime)),
     telPhone,
     companyPhone,
-    customDesc
+    customDesc,
+    address
   };
   generateFormValue.value = formVal;
   allLoading.generateFormDataLoading = true;

+ 5 - 2
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/customer/index.vue

@@ -404,11 +404,14 @@ function editCustomerSave(flag: boolean) {
 
 function editCustomer(row: any) { // row 有数据代表编辑
   if (row) {
-    const { id, companyPhone, customName, inchargerId, createTime, customSourceId, customerIndustryId, customerLevelId, email, telPhone } = row
+    const { id, companyPhone, customName, inchargerId, createTime, customSourceId, customerIndustryId, customerLevelId, email, telPhone, customDesc, address, contactsName } = row
     const formVal = {
       id, customName, inchargerId, customerIndustryId, customerLevelId, email, customSourceId,
       createTime: formatDate(new Date(createTime)),
-      telPhone, companyPhone
+      telPhone, companyPhone,
+      address,
+      customDesc,
+      contactsName
     }
     allLoading.customerTemplateRefLoading = true
     setTimeout(() => {

+ 15 - 2
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/product/component/relatedBusiness.vue

@@ -6,7 +6,7 @@
         <div class="flex-1 overflow-auto pt-3">
             <el-table :data="relatedTaskstable" :show-overflow-tooltip="tableShowOverflowTooltip" border
                 style="width: 100%;height: 100%;">
-                <el-table-column v-for="(item, index) in tableColumn" :prop="item.prop" :label="item.label" :key="index"
+                <el-table-column v-for="(item, index) in newTableColumn" :prop="item.prop" :label="item.label" :key="index"
                     :width="item.width">
                     <template #default="scope">
                         <div class="table-text-textnowrap" v-if="item.eventName"
@@ -23,9 +23,11 @@ import { ref, reactive, onMounted, onUnmounted, defineExpose, inject, watchEffec
 import { tableColumn, MOD } from '@/pages/business/api'
 import { tableShowOverflowTooltip } from '@/utils/globalVariables'
 import router from '@/router';
+import { formatDate } from '@/utils/times';
 
 const relatedTaskstable = ref([])
 const information: any = ref({})
+const newTableColumn: any = ref([])
 
 const props = defineProps<{
     data: any,
@@ -34,7 +36,12 @@ const props = defineProps<{
 
 // 接收参数赋值
 function receiveAssignment(item: any) {
-    relatedTaskstable.value = item.data
+    relatedTaskstable.value = item.data.map((item: any) => {
+        return {
+            ...item,
+            expectedTransactionDate: item.expectedTransactionDate ? formatDate(new Date(item.expectedTransactionDate)) : ''
+        }
+    })
     information.value = item.information
 }
 
@@ -58,6 +65,12 @@ watchEffect(() => {
 // 生命周期钩子
 onMounted(() => {
     receiveAssignment(props)
+    newTableColumn.value = tableColumn.filter((item: any) => {
+        return !['联系人', '负责人'].includes(item.label)
+    })
+    newTableColumn.value.splice(2, 0, {
+        prop: "inchargerName", label: "负责人", width: "180"
+    })
 });
 </script>
 <style scoped lang="scss">

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

@@ -56,7 +56,7 @@ watchEffect(() => {
 // 生命周期钩子
 onMounted(() => {
     newTableColumns.value = tableColumns.filter((item: any) => {
-        const excludedProps = ['businessOpportunityName', 'orderStartDate', 'orderEndDate', 'companySignerName', 'inchargerName', 'customSignerName'];
+        const excludedProps = ['businessOpportunityName', 'orderStartDate', 'orderEndDate', 'companySignerName', 'customSignerName'];
         return !excludedProps.includes(item.prop);
     })
     receiveAssignment(props)

+ 4 - 2
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/tasks/index.vue

@@ -165,7 +165,7 @@ import TaskModal from '@/components/TaskModal/index.vue';
 import ImportModal from './ImportModal.vue';
 import ExportModal from './ExportModal.vue';
 import { post, uploadFile } from '@/utils/request';
-import { getFromValue, confirmAction, downloadFile } from '@/utils/tools';
+import { getFromValue, confirmAction, downloadFile, createTaskFromType } from '@/utils/tools';
 import { tableShowOverflowTooltip } from '@/utils/globalVariables'
 import { pushMap } from './type';
 const router = useRouter()
@@ -174,6 +174,7 @@ const globalPopup = inject<GlobalPopup>('globalPopup')
 const pagePermission = ref<any[]>();
 const taskModalVisible = ref(false);
 const taskForm = ref<any>();
+const taskModalVisibleKey = ref<number>(1)
 const isEdit = ref(false);
 const len = computed(() => {
   return tableRef.value?.getSelectionRows().length
@@ -278,7 +279,8 @@ function currentChange(currentPage: number): void {
 
 function createTasks() {
   taskModalVisible.value = true;
-  taskForm.value = null;
+  // taskForm.value = null;
+  taskForm.value = createTaskFromType(0);
   isEdit.value = false;
 }
 function deleteTasks() {

+ 19 - 12
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/CustomServiceImpl.java

@@ -40,6 +40,7 @@ import java.lang.reflect.Method;
 import java.net.URLEncoder;
 import java.util.*;
 import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 /**
  * <p>
@@ -234,7 +235,6 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
     @Override
     public HttpRespMsg getInfo(Custom custom, HttpServletRequest request) {
         Custom custom1 = customMapper.getInfo(custom.getId());
-
         // 附件列表
         custom1.setFiles(uploadFileMapper.selectByInfoList("custom", custom1.getId()));
         //商机列表
@@ -274,16 +274,24 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
         List<Task> tasks = taskMapper.selectList(new QueryWrapper<Task>().in("custom_id", custom1.getId()));
         if (tasks.size()>0){
             List<String> ids = tasks.stream()
-                    .flatMap(task -> Arrays.stream(task.getExecutorId().split(",")))
+                    .flatMap(task -> Optional.ofNullable(task.getExecutorId())
+                            .map(executorIds -> Arrays.stream(executorIds.split(",")))
+                            .orElseGet(Stream::empty))
                     .distinct()
                     .collect(Collectors.toList());
-            List<User> users = userMapper.selectList(new QueryWrapper<User>().in("id", ids));
-            Map<String, String> map = users.stream().collect(Collectors.toMap(User::getId, User::getName));
-            for (Task task : tasks) {
-                List<String> executorNames = Arrays.stream(task.getExecutorId().split(","))
-                        .map(map::get)
-                        .collect(Collectors.toList());
-                task.setExecutorNames(executorNames);
+
+            if (!ids.isEmpty()) {
+                List<User> users = userMapper.selectList(new QueryWrapper<User>().in("id", ids));
+                Map<String, String> map = users.stream().collect(Collectors.toMap(User::getId, User::getName));
+
+                for (Task task : tasks) {
+                    List<String> executorNames = Optional.ofNullable(task.getExecutorId())
+                            .map(idsStr -> Arrays.stream(idsStr.split(","))
+                                    .map(map::get)
+                                    .collect(Collectors.toList()))
+                            .orElseGet(Collections::emptyList);
+                    task.setExecutorNames(executorNames);
+                }
             }
         }
 
@@ -378,7 +386,7 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
     }
 
 
-    @Value(value = "${upload.file}")
+    @Value(value = "${upload.path}")
     private String filePath;
 
     @Override
@@ -406,7 +414,7 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
                 long size = file.getSize();
                 double v = (double) size / (1024 * 1024);
                 String format = String.format("%.2f MB", v);
-                uf.setPath("/file/" + realName);
+                uf.setPath(filePath + realName);
                 uf.setCode("custom");
                 System.out.println(format);
                 uf.setSize(format);
@@ -461,7 +469,6 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
             // 读取文件的字节流
             os.write(FileUtil.readFileByBytes(uploadFile1));
             os.flush();
-
         } catch (IOException e) {
             msg.setError(MessageUtils.message("file.error"));
             e.printStackTrace();

+ 24 - 7
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/CustomMapper.xml

@@ -48,7 +48,11 @@
         c.contacts_name,
         c.custom_name,
         c.email,
+        c.tel_phone,
         c.company_phone,
+        c.custom_desc,
+        c.incharger_id,
+        c.address,
         c.create_time,
         c.customer_level_id,
         (select name from sys_dict where customer_level_id = id and code = 'CustomLevel') customerLevelValue,
@@ -140,7 +144,11 @@
         select c.id,
         c.custom_name,
         c.email,
+        c.tel_phone,
+        c.contacts_name,
         c.company_phone,
+        c.custom_desc,
+        c.address,
         c.create_time,
         c.customer_level_id,
         (select name from sys_dict where customer_level_id = id and code = 'CustomLevel') customerLevelValue,
@@ -155,11 +163,12 @@
         (select `name` from `user` where id = creator_id) creatorName
         from custom c
         left join sys_dict sd on c.customer_level_id = sd.id
-        where c.company_id = #{companyId}
-        and c.is_delete =#{isDelete}
-        and c.incharger_id in
+        where
+        (c.incharger_id in
         (SELECT id from `user` WHERE department_id = (SELECT department_id from `user` WHERE id = #{userId}))
-        or c.incharger_id is null
+        or c.incharger_id is null)
+        and c.company_id = #{companyId}
+        and c.is_delete =#{isDelete}
         <if test="inchargerId != null and inchargerId != ''  ">
             and c.incharger_id =#{inchargerId}
         </if>
@@ -238,7 +247,13 @@
         select id,
         custom_name,
         email,
+        contacts_name
+        tel_phone,contacts_name,
         company_phone,
+        custom_desc,
+        contacts_name
+        incharger_id,
+        address,
         create_time,
         customer_level_id,
         (select name from sys_dict where customer_level_id = id and code = 'CustomLevel') customerLevelValue,
@@ -253,8 +268,8 @@
         from custom
         where company_id = #{companyId}
         and is_delete =#{isDelete}
-        and incharger_id = #{userId}
-        or incharger_id is null
+        and (incharger_id = #{userId}
+        or incharger_id is null)
         <if test="inchargerId != null and inchargerId != ''  ">
             and incharger_id =#{inchargerId}
         </if>
@@ -287,7 +302,7 @@
         from custom
         where company_id = #{companyId}
         and is_delete = #{isDelete}
-        and incharger_id = #{inchargerId}
+        and incharger_id = #{userId}
         or incharger_id is null
         <if test="inchargerId != null and inchargerId != ''  ">
             and incharger_id =#{inchargerId}
@@ -323,8 +338,10 @@
                customer_level_id,
                email,
                tel_phone,
+               company_phone,
                address,
                custom_code,
+               incharger_id,
                tel_phone,
                fax,
                create_time,