Przeglądaj źródła

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

Min 1 rok temu
rodzic
commit
4eec9d3f26

+ 22 - 11
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/business/index.vue

@@ -66,23 +66,23 @@
                 }}</el-button>
               </template>
             </el-table-column>
-            <el-table-column prop="clueSourceId" label="客户名称" width="180"></el-table-column>
-            <el-table-column prop="phone" label="联系人" width="180">
+            <el-table-column prop="customerName" label="客户名称" width="180"></el-table-column>
+            <el-table-column prop="contactsName" label="联系人" width="180">
               <template #default="scope">
                 <el-button link type="primary" size="large">{{
-                  scope.row.phone
+                  scope.row.contactsName
                 }}</el-button>
               </template>
             </el-table-column>
-            <el-table-column prop="email" label="商机金额" width="180"></el-table-column>
-            <el-table-column prop="customerIndustryId" label="商机阶段" width="180"></el-table-column>
-            <el-table-column prop="customerLevelId" label="预计成交" width="180"></el-table-column>
-            <el-table-column prop="inchargerId" label="负责人" width="180"></el-table-column>
-            <el-table-column prop="createName" label="创建人" width="180"></el-table-column>
+            <el-table-column prop="amountOfMoney" label="商机金额" width="180"></el-table-column>
+            <el-table-column prop="stageValue" label="商机阶段" width="180"></el-table-column>
+            <el-table-column prop="expectedTransactionDate" label="预计成交" width="180"></el-table-column>
+            <el-table-column prop="inchargerName" label="负责人" width="180"></el-table-column>
+            <el-table-column prop="creatorName" label="创建人" width="180"></el-table-column>
             <el-table-column prop="createTime" label="创建时间" width="180"></el-table-column>
             <el-table-column label="操作" fixed="right" width="200">
               <template #default="scope">
-                <el-button link type="primary" size="large">编辑</el-button>
+                <el-button link type="primary" size="large" @click="editShowVisible('newBusinessisible', scope.row)">编辑</el-button>
                 <el-button link type="primary" size="large">新建任务</el-button>
                 <el-button link type="danger" size="large">删除</el-button>
               </template>
@@ -127,6 +127,7 @@ import { GETSYSFILED, MOD, GETPERSONNEL, GETGENERATEFOEM, GETBUSINESSLIST, UPDAT
 import { GETTABLELIST } from '@/pages/product/api'
 import { post, get } from "@/utils/request";
 import { getAllListByCode, getFromValue, resetFromValue, getFirstDayOfMonth, getLastDayOfMonth, formatDate } from '@/utils/tools'
+import { formatDateTime } from '@/utils/times'
 import { GenerateForm } from '@zmjs/form-design';
 import RelatedProducts from './component/relatedProducts.vue'
 
@@ -178,7 +179,7 @@ function editBusiness(visibles: boolean) {
     let productTableListData = relatedProductsRef?.value?.returnData()
     let newForm = {
       ...res,
-      expectedTransactionDate: res.expectedTransactionDate ? formatDate(new Date(res.expectedTransactionDate)) : '',
+      expectedTransactionDate: res.expectedTransactionDate ? formatDateTime(new Date(res.expectedTransactionDate)) : '',
       businessItemProductList: productTableListData ? JSON.stringify(productTableListData) : []
     }
     allLoading.businessSaveLading = true
@@ -195,6 +196,11 @@ function editBusiness(visibles: boolean) {
   })
 }
 
+function editShowVisible(type: keyof typeof allVisible, item: any) {
+  console.log(item, '选择数据')
+  showVisible(type)
+}
+
 function showVisible(type: keyof typeof allVisible) { // 显示弹窗
   allVisible[type] = true
 }
@@ -211,7 +217,12 @@ function getBusinessTableList() {
   const formValue = getFromValue(businessOpportunityForm)
   post(GETBUSINESSLIST, { ...formValue }).then((res) => {
     const { data, total } = res.data
-    businessTable.value = data
+    businessTable.value = data.map((item: any) => {
+      return {
+        ...item,
+        expectedTransactionDate: formatDate(new Date(item.expectedTransactionDate))
+      }
+    })
     businessTotalTable.value = total
   })
 }

+ 6 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/utils/request.ts

@@ -31,6 +31,7 @@ instance.interceptors.response.use(
   (response: AxiosResponse) => {
     // 对响应数据进行处理
     if (response.status != 200) {
+      ElNotification.closeAll()
       ElNotification({
         message: showMessage(response.status), // 传入响应码,匹配响应码对应信息,
         type: "error",
@@ -39,6 +40,11 @@ instance.interceptors.response.use(
     return response;
   },
   (error: AxiosError) => {
+    ElNotification.closeAll()
+    ElNotification({
+      message: showMessage(error.request.status), // 传入响应码,匹配响应码对应信息,
+      type: "error",
+    });
     // 处理响应错误
     return Promise.reject(error);
   }

+ 15 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/utils/times.ts

@@ -29,3 +29,18 @@ export function formatDate(date: Date) {
   const day = date.getDate().toString().padStart(2, "0");
   return `${year}-${month}-${day}`;
 }
+
+/**
+ * 将 Date 对象格式化为 "YYYY-MM-DD HH:mm:ss" 的形式
+ * @param date 日期 new Date()
+ * @returns
+ */
+export function formatDateTime(date: Date) {
+  const year = date.getFullYear();
+  const month = (1 + date.getMonth()).toString().padStart(2, "0");
+  const day = date.getDate().toString().padStart(2, "0");
+  const hour = date.getHours().toString().padStart(2, "0");
+  const minute = date.getMinutes().toString().padStart(2, "0");
+  const second = date.getSeconds().toString().padStart(2, "0");
+  return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
+}