Ver código fonte

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

Min 10 meses atrás
pai
commit
232dab3a54

+ 0 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/components/TaskModal/index.vue

@@ -24,7 +24,6 @@
             <el-option v-for="item in PRIORITY " :key="item.value" :value="item.value" :label="item.label" />
           </el-select>
         </el-form-item>
-        {{ form.taskType }}
         <el-form-item :label="form.taskType">
           <template #label>
             <el-select v-model="form.taskType" class="border resetSelect" style="width: 100px" @change="changeTaskType"

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

@@ -20,8 +20,8 @@
                         }}</el-button>
                     </template>
                 </el-table-column>
-                <el-table-column prop="typeName" label="产品类型" width="130" />
-                <el-table-column prop="unitName" label="单位" width="130" />
+                <el-table-column prop="productType" label="产品类型" width="130" />
+                <el-table-column prop="unit" label="单位" width="130" />
                 <el-table-column prop="price" label="标准价格" width="130" />
                 <el-table-column prop="inventory" label="库存" width="130" />
                 <el-table-column prop="sellingPrice" label="售价" width="130" />

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

@@ -54,7 +54,7 @@
                 <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="['contactsDelete']"
-                  @click="contactsDeteleItem(scope.row.id, scope.row.customName)">删除</el-button>
+                  @click="contactsDeteleItem(scope.row.id, scope.row.name)">删除</el-button>
               </template>
             </el-table-column>
           </el-table>

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

@@ -91,7 +91,7 @@ function getDetail() {
   post(URL_GETDETAIL, { id: values.value }).then((res) => {
     res.data.newCreateTime = formatDate(new Date(res.data.createTime)),
       information.value = res.data
-      detailCompinentsData.value = res.data.taskList || []
+      detailCompinentsData.value = res.data.tasks || []
   }).finally(() => {
     allLoading.customerDetailLoading = false
   })

+ 0 - 4
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/order/component/rebate.vue

@@ -105,10 +105,6 @@ function saveRebate() {
         globalPopup?.showWarning(Number(mony.value as string) < 0 ? '请不要输入负数' : '请输入金额')
         return
     }
-    if(Number(mony.value as string) > theRebate.value) {
-        globalPopup?.showWarning('回款金额超过了未回款金额')
-        return
-    }
     allLoading.rebateLoading = true
     const { url, formVal } = Object.keys(monyItem.value).length === 0
         ? { url: URL_ADDREBATE, formVal: { orderId: info.value.id, money: mony.value } }

+ 1 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/order/index.vue

@@ -299,6 +299,7 @@ function saveOrder(flag: boolean) {
       placeTime: res.placeTime ? formatDate(res.placeTime) : '',
       orderProductDetailString: produt
     }
+    console.log((formVal.price || 0), (formVal.receivedPayment || 0), (formVal.price || 0) < (formVal.receivedPayment || 0))
     if((formVal.price || 0) < (formVal.receivedPayment || 0)) {
       globalPopup?.showError('已回款金额不能大于订单金额')
       return

+ 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: 0 },
   { label: "中", value: 1 },
-  { label: "高", value: 0 },
+  { label: "高", value: 2 },
 ];
 export const STATUS: StatusType[] = [
   //任务状态

+ 3 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/thread/detail/components/information.vue

@@ -205,6 +205,9 @@ function transferBusiness() {
         if(!productTableListData || judgmentaAmounteEqual({ ...res }, productTableListData)) {
             return
         }
+        productTableListData.forEach((item: any) => {
+            delete item.id
+        })
         let newForm = {
             ...res,
             expectedTransactionDate: res.expectedTransactionDate ? formatDateTime(new Date(res.expectedTransactionDate)) : '',

+ 3 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/store/index.ts

@@ -51,7 +51,9 @@ export const useStore = defineStore<
       this.asyncRoutesMark = false;
     },
   },
-  persist: true, // 是否持久化
+  persist: {
+    storage: sessionStorage, // 存储在 sessionStorage 中
+  }, // 是否持久化
 });
 if (import.meta.hot) {
   import.meta.hot.accept(acceptHMRUpdate(useStore, import.meta.hot));

+ 1 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/utils/customInstructions.ts

@@ -7,7 +7,7 @@ const PermissionDirective: Directive = { // 数组, 权限 code 和 布尔值
     // mounted(el: HTMLElement, binding: { value: (string | boolean)[] }, vnode: any) {
     updated(el: HTMLElement, binding: { value: (string | boolean)[] }, vnode: any) {
         const routePath: string = vnode.ctx.appContext.config.globalProperties.$route.path;
-        const userInfo: { userInfo: { functionList: { code: string }[] } } | null = JSON.parse(localStorage.getItem('storeInfo') || '');
+        const userInfo: { userInfo: { functionList: { code: string }[] } } | null = JSON.parse(sessionStorage.getItem('storeInfo') || '');
         const authorityCodes: string[] = (userInfo?.userInfo?.functionList || []).map(({ code }) => code);
         const permissions: (string | boolean)[] = binding.value;
         const hasPermission: any[] = (binding.value || []).filter(item => typeof item !== 'boolean');

+ 2 - 2
fhKeeper/formulahousekeeper/customerBuler-crm/src/utils/tools.ts

@@ -283,11 +283,11 @@ export function judgmentaAmounteEqual(mob: any, arr: any) {
     ElNotification.closeAll();
     ElNotification({
       title: '提示',
-      message: `商机金额${amounte > totalAmounte ? '大于' : '小于'}产品总金额,请修改`,
+      message: `商机金额${amounte > totalAmounte ? '大于' : '小于'}产品总金额,${amounte > totalAmounte ? '' : '请修改'}`,
       type: 'warning',
     });
     flag = true;
   }
 
-  return flag;
+  return (amounte > totalAmounte) ? false : flag;
 }

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

@@ -239,10 +239,10 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
         custom1.setFiles(uploadFileMapper.selectByInfoList("custom", custom1.getId()));
         //商机列表
         List<BusinessOpportunity> bos = businessOpportunityMapper.selectList(new QueryWrapper<BusinessOpportunity>().eq("customer_id", custom1.getId()));
-        if (bos.size() >0){
+        if (bos.size() > 0) {
             List<Integer> sIds = bos.stream().map(BusinessOpportunity::getStageId).distinct().collect(Collectors.toList());
             List<Stage> stages = stageMapper.selectList(new QueryWrapper<Stage>().in("id", sIds));
-            Map<Integer, String> stageValue =  stages.stream()
+            Map<Integer, String> stageValue = stages.stream()
                     .collect(Collectors.toMap(Stage::getId, Stage::getName));
             custom1.setBusinessOpportunitys(bos);
             for (BusinessOpportunity bo : bos) {
@@ -258,7 +258,7 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
                     })
                     .distinct() // 去重
                     .collect(Collectors.toList());
-            if (userIds.size()>0){
+            if (userIds.size() > 0) {
                 List<User> users = userMapper.selectList(new QueryWrapper<User>().in("id", userIds));
                 Map<String, String> userIdToNameMap = users.stream()
                         .collect(Collectors.toMap(User::getId, User::getName));
@@ -272,12 +272,39 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
         //操作记录
         List<ActionLog> actionLogs = actionLogMapper.selectByInfoListCustom(custom.getId());
         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(",")))
+                    .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);
+            }
+        }
+
+
         custom1.setTasks(tasks);
         custom1.setActionLogs(actionLogs);
         //联系人
         custom1.setContacts(contactsMapper.selectList((new QueryWrapper<Contacts>().eq("custom_id", custom1.getId()))));
         //订单
-        custom1.setSalesOrders(salesOrderMapper.selectList((new QueryWrapper<SalesOrder>().eq("custom_id", custom1.getId()))));
+        List<SalesOrder> orders = salesOrderMapper.selectList((new QueryWrapper<SalesOrder>().eq("custom_id", custom1.getId())));
+        if (orders.size() > 0 ){
+            List<Integer> tids = orders.stream().map(SalesOrder::getType).collect(Collectors.toList());
+            List<SysDict> sysDicts = sysDictMapper.selectList(new QueryWrapper<SysDict>().eq("code", "OrderType").in("id", tids));
+            Map<Integer, String> map = sysDicts.stream()
+                    .collect(Collectors.toMap(SysDict::getId, SysDict::getName));
+            for (SalesOrder order : orders) {
+                order.setCustomName(custom1.getCustomName());
+                order.setTypeName(map.get(order.getType()));
+            }
+        }
+        custom1.setSalesOrders(orders);
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         httpRespMsg.setData(custom1);
         return httpRespMsg;

+ 3 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/CustomMapper.xml

@@ -59,6 +59,7 @@
         c.incharger_id,
         (select `name` from `user` where id = incharger_id) inchargerName,
         c.creator_id,
+        c.create_time,
         (select `name` from `user` where id = creator_id) creatorName
         from custom c
         left join sys_dict sd on c.customer_level_id = sd.id
@@ -150,6 +151,7 @@
         c.incharger_id,
         (select `name` from `user` where id = incharger_id) inchargerName,
         c.creator_id,
+        c.create_time,
         (select `name` from `user` where id = creator_id) creatorName
         from custom c
         left join sys_dict sd on c.customer_level_id = sd.id
@@ -251,7 +253,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}

+ 29 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list.vue

@@ -241,14 +241,37 @@
                             <span v-else>
                                 <span v-if="user.userNameNeedTranslate != '1'">
                                     <span v-if="user.company.companyName != '成都明夷电子科技有限公司'">
-                                        {{scope.row.isDeptAudit==0?$t('other.Tobereviewedbytheprojectreviewer'):($t('other.await')+scope.row.auditDeptName+('('+scope.row.deptAuditorName+')')+$t('other.audit'))}}
+                                        <!-- {{scope.row.isDeptAudit==0?$t('other.Tobereviewedbytheprojectreviewer'):($t('other.await')+scope.row.auditDeptName+('('+scope.row.deptAuditorName+')')+$t('other.audit'))}} -->
+                                        <span v-if="scope.row.isDeptAudit==0">
+                                            <span>
+                                                {{ $t('other.waitForTheProjectReviewer') }}<span>(
+                                                    <template v-for="(auditItem, auditindexs) in (scope.row.reviewerNames || [])">
+                                                        <TranslationOpenDataText type='userName' :openid='auditItem'></TranslationOpenDataText>
+                                                        <span v-if="auditindexs < scope.row.reviewerNames.length-1">,</span>
+                                                    </template>
+                                                    )</span>{{ $t('other.audit') }}
+                                            </span>
+                                        </span>
+                                        <span v-else>
+                                            {{ ($t('other.await')+scope.row.auditDeptName+('('+scope.row.deptAuditorName+')')+$t('other.audit')) }}
+                                        </span>
                                     </span>
                                     <span v-else>
                                         待审核
                                     </span>
                                 </span>
                                 <span v-if="user.userNameNeedTranslate == '1'">
-                                    <span v-if="scope.row.isDeptAudit==0">{{$t('other.Tobereviewedbytheprojectreviewer')}}</span>
+                                    <!-- <span v-if="scope.row.isDeptAudit==0">{{$t('other.Tobereviewedbytheprojectreviewer')}}</span> -->
+                                     <span v-if="scope.row.isDeptAudit==0">
+                                        <span>
+                                            {{ $t('other.waitForTheProjectReviewer') }}<span>(
+                                                <template v-for="(auditItem, auditindexs) in (scope.row.reviewerNames || [])">
+                                                    <TranslationOpenDataText type='userName' :openid='auditItem'></TranslationOpenDataText>
+                                                    <span v-if="auditindexs < scope.row.reviewerNames.length-1">,</span>
+                                                </template>
+                                                )</span>{{ $t('other.audit') }}
+                                        </span>
+                                     </span>
                                     <span v-else>
                                         {{$t('other.await')}}
                                         <TranslationOpenDataText type='departmentName' :openid='scope.row.auditDeptName'></TranslationOpenDataText>
@@ -884,7 +907,11 @@
                 res => {
                     this.listLoading = false;
                     if (res.code == "ok") {
+                        for (let entry of res.data) {
+                            entry.reviewerNames = (entry.data || []).map(item => item.projectAuditorName);
+                        }
                         this.listBackup = JSON.parse(JSON.stringify(res.data));
+                        console.log(this.listBackup, "《====== 赋值")
                         this.list = this.currentChangePage(10, 1, res.data);
                         let total = res.data.length || 0
                         this.reviewTableObj = {