Browse Source

提交相关代码

Lijy 11 months ago
parent
commit
c0427262e1

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

@@ -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="newCreateTime" label="上传时间" width="180" />
                 <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 { post, uploadFile } from '@/utils/request';
 import { confirmAction, downloadFile } from '@/utils/tools';
 import { ref, reactive, onMounted, onUnmounted, defineEmits, defineExpose, inject, watchEffect } from 'vue'
 import { DETELEFILEFILE, REFIENAMEFILE, UPLOADFILEFILE } from '../api';
+import { formatDate } from '@/utils/times';
 
 const emits = defineEmits(['refreshData']);
 const globalPopup = inject<GlobalPopup>('globalPopup')
@@ -119,7 +120,12 @@ async function httpUploadFile(param: UploadRequestOptions) {
 
 watchEffect(() => {
     information.value = props.information
-    attachmenttable.value = (props.information.uploadFilePList || [])
+    attachmenttable.value = (props.information.uploadFilePList || []).map((item: any) => {
+        return {
+            ...item,
+            newCreateTime: formatDate(new Date(item.createTime))
+        }
+    })
 });
 
 // 生命周期钩子

+ 21 - 11
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/business/component/information.vue

@@ -11,37 +11,46 @@
             </div>
         </div>
         <div class="form flex flex-wrap justify-between">
-            <div class="formItem flex pt-5 pb-1">
+            <div class="formItem flex pt-3 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.name }}</div>
+                <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1" v-ellipsis-tooltip>{{ information.name }}</div>
             </div>
-            <div class="formItem flex pt-5 pb-1">
+            <div class="formItem flex pt-3 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.customerName }}
+                <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1" v-ellipsis-tooltip>{{ information.customerName }}
                 </div>
             </div>
-            <div class="formItem flex pt-5 pb-1">
+            <div class="formItem flex pt-3 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.contactsName }}
                 </div>
             </div>
-            <div class="formItem flex pt-5 pb-1">
+            <div class="formItem flex pt-3 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.amountOfMoney || 0
+                <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1" v-ellipsis-tooltip>{{ information.amountOfMoney || 0
                 }} 元</div>
             </div>
-            <div class="formItem flex pt-5 pb-1">
+            <div class="formItem flex pt-3 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.inchargerName }}</div>
             </div>
-            <div class="formItem flex pt-5 pb-1">
+            <div class="formItem flex pt-3 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.expectedTransactionDate }}</div>
             </div>
-            <div class="formItem flex pt-5 pb-1" style="width: 100%;">
+            <div class="formItem flex pt-3 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>
+            <div class="formItem flex pt-3 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.createTime }}</div>
+            </div>
+            <div class="formItem flex pt-3 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.remark }}
                 </div>
             </div>
@@ -204,6 +213,7 @@ function claimBusiness() {
 function editBusiness() {
     generateForm.value?.getData().then((res: any) => {
         let formVal = {
+            id: information.value.id,
             ...res,
             expectedTransactionDate: res.expectedTransactionDate ? formatDateTime(new Date(res.expectedTransactionDate)) : '',
             businessItemProductList: JSON.stringify(productTableListValue.value)

+ 29 - 14
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/business/detail/index.vue

@@ -7,7 +7,7 @@
         </el-link>
       </div>
       <div class="mr-8">
-        <el-select v-model="optionVal" placeholder="请选择" style="width: 150px" filterable @change="selectChange()">
+        <el-select v-model="optionVal" placeholder="请选择" style="width: 250px" filterable @change="selectChange()">
           <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
         </el-select>
       </div>
@@ -19,29 +19,35 @@
           <div class="text-nowrap">{{ item.plan }}</div>
         </div>
       </div>
-      <div class="relative rounded-md flex items-center itemPing backGray endStep item pl-6 pr-6 mr-4 resetStyle" v-if="currentStage >= 0">
+      <div class="relative rounded-md flex items-center itemPing backGray endStep item pl-6 pr-6 mr-4 resetStyle"
+        v-if="currentStage >= 0">
         <el-select v-model="stageStatusVal" placeholder="结束" style="width: 100px" class="selectClas"
           @change="advanceChange()">
           <el-option v-for="(item, index) in stageListOption" :key="index" :label="item.label" :value="item.value" />
         </el-select>
       </div>
-      <div class="relative rounded-md flex items-center justify-around backOrange endStep item pl-6 pr-6 mr-4 resetStyle" v-if="businessInfo.stageValue == '输单'" style="padding-top: 6px;padding-bottom: 6px;">
+      <div
+        class="relative rounded-md flex items-center justify-around backOrange endStep item pl-6 pr-6 mr-4 resetStyle"
+        v-if="businessInfo.stageValue == '输单'" style="padding-top: 6px;padding-bottom: 6px;">
         <div>{{ businessInfo.stageValue }}</div>
         <div class="ml-5">0%</div>
       </div>
-      <div class="relative rounded-md flex items-center justify-around backWan endStep item pl-6 pr-6 mr-4 resetStyle" v-if="businessInfo.stageValue == '赢单'" style="padding-top: 6px;padding-bottom: 6px;">
+      <div class="relative rounded-md flex items-center justify-around backWan endStep item pl-6 pr-6 mr-4 resetStyle"
+        v-if="businessInfo.stageValue == '赢单'" style="padding-top: 6px;padding-bottom: 6px;">
         <div>{{ businessInfo.stageValue }}</div>
         <div class="ml-4"> 100%</div>
       </div>
-      <div class="relative rounded-md flex items-center justify-around backGray endStep item pl-6 pr-6 mr-4 resetStyle" v-if="businessInfo.stageValue == '无效'" style="padding-top: 6px;padding-bottom: 6px;">
+      <div class="relative rounded-md flex items-center justify-around backGray endStep item pl-6 pr-6 mr-4 resetStyle"
+        v-if="businessInfo.stageValue == '无效'" style="padding-top: 6px;padding-bottom: 6px;">
         <div>{{ businessInfo.stageValue }}</div>
         <div class="ml-5">0%</div>
       </div>
-      <div class="bg-[#075985] rounded-md text itemPing pl-2 pr-2 flex items-center aloneText" @click="advancementStage()"
+      <div class="bg-[#075985] rounded-md text itemPing pl-2 pr-2 flex items-center aloneText"
         v-if="currentStage != -1">
-        <el-link :underline="false" v-if="(currentStage + 1) != stageList.length">推进至下个阶段【{{ stageList[currentStage +
-          1]?.name }}】</el-link>
-        <el-link :underline="false" v-else>赢单</el-link>
+        <el-link :underline="false" v-if="(currentStage + 1) != stageList.length"
+          @click="advancementStage(false)">推进至下个阶段【{{ stageList[currentStage +
+            1]?.name }}】</el-link>
+        <el-link :underline="false" v-else class="ml-4 mr-4" @click="advancementStage(true)">赢单</el-link>
       </div>
     </div>
     <!-- 内容 -->
@@ -91,7 +97,7 @@
     </el-dialog>
   </div>
 </template>
-  
+
 <script lang="ts" setup>
 import { ref, reactive, onMounted, inject } from "vue";
 import type { FormInstance, FormRules } from 'element-plus'
@@ -118,7 +124,7 @@ const route = useRoute()
 const globalPopup = inject<GlobalPopup>('globalPopup')
 const detailCompinentsData = ref([])
 const optionVal = ref<any>('')
-const stageStatusVal = ref('')
+const stageStatusVal = ref<any>('')
 const stageStatusValOriginally = ref('')
 const advanceVal = ref('')
 const options = ref<optionType[]>([])
@@ -142,9 +148,16 @@ function refreshData() {
   getDetail()
 }
 
-function advancementStage() {
+function advancementStage(flag: boolean) {
   console.log('点击了推进阶段')
-  advanceSave(false)
+  if (!flag) {
+    allLoading.advanceSaveLoading = true
+    advancementStageNext(true)
+    return
+  }
+  let val = stageListOption.value.find((item: any) => item.label == '赢单')
+  stageStatusVal.value = Number(val?.value || '')
+  advanceChange()
 }
 
 function advanceChange() {
@@ -289,7 +302,7 @@ onMounted(() => {
   }, 500)
 })
 </script>
-  
+
 <style lang="scss" scoped>
 .businessDetail {
   .selected {
@@ -319,10 +332,12 @@ onMounted(() => {
     background-color: #F4F5F7;
     color: #000;
   }
+
   .backOrange {
     background-color: #FF5531;
     color: #fff;
   }
+
   .backWan {
     background-color: #075985;
     color: #fff;

+ 23 - 10
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/business/index.vue

@@ -8,7 +8,7 @@
               <el-input v-model="businessOpportunityForm.name" clearable placeholder="请输入"></el-input>
             </el-form-item>
             <el-form-item label="商机阶段">
-              <el-select v-model="businessOpportunityForm.stageId" placeholder="请选择">
+              <el-select v-model="businessOpportunityForm.stageId" placeholder="请选择" clearable>
                 <el-option v-for="item in fixedData.BusinessStage" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
@@ -19,12 +19,13 @@
               <el-input v-model="businessOpportunityForm.contactPerson" clearable placeholder="请输入"></el-input>
             </el-form-item>
             <el-form-item label="产品">
-              <el-select v-model="businessOpportunityForm.product" placeholder="请选择">
-                <el-option v-for="item in fixedData.Personnel" :key="item.id" :label="item.name" :value="item.id" />
+              <el-select v-model="businessOpportunityForm.product" placeholder="请选择" clearable>
+                <el-option v-for="item in fixedData.ProductArr" :key="item.value" :label="item.label"
+                  :value="item.value" />
               </el-select>
             </el-form-item>
             <el-form-item label="负责人">
-              <el-select v-model="businessOpportunityForm.inchargerId" placeholder="请选择">
+              <el-select v-model="businessOpportunityForm.inchargerId" placeholder="请选择" clearable>
                 <el-option v-for="item in fixedData.Personnel" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
@@ -61,13 +62,13 @@
         </div>
         <div class="flex-1 w-full overflow-hidden">
           <el-table ref="businessTableRef" :data="businessTable" border v-loading="allLoading.businessTableLading"
-            @selection-change="changeBatch" style="width: 100%;height: 100%;">
+            :show-overflow-tooltip="tableShowOverflowTooltip" @selection-change="changeBatch"
+            style="width: 100%;height: 100%;">
             <el-table-column type="selection" width="55" />
             <el-table-column v-for="(item, index) in tableColumn" :prop="item.prop" :label="item.label" :key="index"
               :width="item.width">
               <template #default="scope">
-                <el-button link type="primary" size="large" @click="dealWithTableColumn(scope.row, item.eventName)"
-                  v-if="item.eventName">{{ scope.row[item.prop] }}</el-button>
+                <div class="table-text-textnowrap" v-if="item.eventName" @click="dealWithTableColumn(scope.row, item.eventName)">{{ scope.row[item.prop] }}</div>
                 <template v-else>{{ scope.row[item.prop] }}</template>
               </template>
             </el-table-column>
@@ -183,10 +184,12 @@ import { getAllListByCode, getFromValue, resetFromValue, getFirstDayOfMonth, cre
 import { createTask } from '@/components/TaskModal/taskFunction'
 import { formatDateTime } from '@/utils/times'
 import { GenerateForm } from '@zmjs/form-design';
+import { tableShowOverflowTooltip } from '@/utils/globalVariables'
 import RelatedProducts from '@/components/relatedProducts/relatedProducts.vue'
 import TaskModal from '@/components/TaskModal/index.vue'
 import DeteleBusiness from './component/deteleTables.vue'
 import StageSetting from './component/stageSetting.vue'
+import { GETTABLELISTPRODUCT } from "../order/api";
 
 const route = useRoute()
 const router = useRouter()
@@ -244,7 +247,8 @@ const businessOpportunityForm = reactive<businessOpportunityFormType>({
 })
 const fixedData = reactive({
   BusinessStage: [] as fixedDataInterface[],
-  Personnel: [] as personnelInterface[]
+  Personnel: [] as personnelInterface[],
+  ProductArr: [] as productInterface[]
 })
 const productTableList = ref([])
 const productTableListValue = ref([])
@@ -253,8 +257,8 @@ const productTableListValue = ref([])
 function editBusiness(visibles: boolean) {
   businessTemplateRef.value?.getData().then((res: any) => {
     let productTableListData = relatedProductsRef?.value?.returnData()
-    console.log(!productTableListData, judgmentaAmounteEqual({...businessTemplateValue.value, ...res}, productTableListData))
-    if(!productTableListData || judgmentaAmounteEqual({...businessTemplateValue.value, ...res}, productTableListData)) {
+    console.log(!productTableListData, judgmentaAmounteEqual({ ...businessTemplateValue.value, ...res }, productTableListData))
+    if (!productTableListData || judgmentaAmounteEqual({ ...businessTemplateValue.value, ...res }, productTableListData)) {
       return
     }
 
@@ -481,6 +485,15 @@ async function getSystemField() {
     }
   })
 
+  post(GETTABLELISTPRODUCT, { pageIndex: -1, pageSize: -1 }).then(({ data }) => {
+    fixedData.ProductArr = (data.record || []).map((item: any) => {
+      const { id, productName } = item
+      return {
+        value: id, label: productName
+      }
+    })
+  })
+
   const res = await get(GETGENERATEFOEM)
   businessTemplate.value = JSON.parse(res.data[0].config)
 }

+ 5 - 0
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/business/type.d.ts

@@ -33,4 +33,9 @@ interface businessTableColumnInterface {
   width: string;
   eventName?: string;
   event?: () => void;
+}
+
+interface productInterface {
+  value: string | number;
+  label: string;
 }

+ 19 - 3
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/thread/index.vue

@@ -61,7 +61,7 @@
         </div>
         <div class="flex-1 w-full overflow-hidden">
           <el-table :show-overflow-tooltip="tableShowOverflowTooltip" ref="clueTableRef" :data="clueTable" border v-loading="allLoading.clueTableLading"
-            style="width: 100%;height: 100%;" @selection-change="changeBatch">
+            style="width: 100%;height: 100%;" @selection-change="changeBatch" @sort-change="sortChange">
             <el-table-column type="selection" width="55" />
             <el-table-column prop="clueName" label="线索名称" width="180">
               <template #default="scope">
@@ -72,7 +72,7 @@
             <el-table-column prop="phone" label="电话号码" width="180"></el-table-column>
             <el-table-column prop="email" label="邮箱" width="180"></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="createName" label="创建人" width="180"></el-table-column>
             <el-table-column prop="createTime" label="创建时间" width="180"></el-table-column>
@@ -208,6 +208,7 @@ const filterCriteriaForm = reactive<filterCriteriaFormType>({ // 筛选条件for
   inchargerId: '',
   startTime: getFirstDayOfMonth(new Date()),
   endTime: formatDate(new Date()),
+  isDesc: '',
   pageIndex: 1,
   pageFrom: 10
 })
@@ -236,7 +237,7 @@ const fixedData = reactive({
   ClueSources: [] as fixedDataInterface[],
   CustomIndustry: [] as fixedDataInterface[],
   CustomLevel: [] as fixedDataInterface[],
-  Personnel: [] as personnelInterface[]
+  Personnel: [] as personnelInterface[],
 })
 const clueTable = ref([]) // 线索table数据
 const clueTotalTable = ref(0) // 线索 table 数据总数
@@ -258,6 +259,21 @@ const transferForm = reactive({
 
 
 // 定义方法
+function sortChange(data: any) {
+  filterCriteriaForm.pageIndex = 1
+  switch (data.order) {
+    case 'ascending':
+      filterCriteriaForm.isDesc = 1
+      break
+    case 'descending':
+      filterCriteriaForm.isDesc = 0
+      break
+    default:
+      filterCriteriaForm.isDesc = ''
+  }
+  getClueTable()
+}
+
 function exportTheadTableList() {
   allLoading.exoprtLoading = true
   let valueForm = getFromValue(filterCriteriaForm)

+ 2 - 1
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/thread/type.d.ts

@@ -9,5 +9,6 @@ interface filterCriteriaFormType { // 线索筛选条件类型
   startTime: string | number,
   endTime: string | number,
   pageIndex: number,
-  pageFrom: number
+  pageFrom: number,
+  isDesc?: number | string
 }