Browse Source

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

Min 11 tháng trước cách đây
mục cha
commit
3d391bfe1d

+ 3 - 3
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/order/api.ts

@@ -27,9 +27,9 @@ export const tableColumns: TableColumn[] = [
     { prop: 'orderName', label: '订单名称', width: '150' },
     { prop: 'customName', label: '客户名称', width: '200' },
     { prop: 'businessOpportunityName', label: '商机名称', width: '200' },
-    { prop: 'price', label: '订单金额', width: '100' },
-    { prop: 'receivedPayment', label: '已回款', width: '100' },
-    { prop: 'unReceivedPayment', label: '未回款', width: '100' },
+    { prop: 'price', label: '订单金额(¥)', width: '100' },
+    { prop: 'receivedPayment', label: '已回款(¥)', width: '100' },
+    { prop: 'unReceivedPayment', label: '未回款(¥)', width: '100' },
     { prop: 'status', label: '回放状态', width: '100' },
     { prop: 'typeName', label: '订单类型', width: '200' },
     { prop: 'placeTime', label: '下单时间', width: '200' },

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

@@ -72,6 +72,7 @@ const props = defineProps<{
     data: any,
     information: any
 }>()
+const uploadRef = ref()
 
 // 下载文件
 function fileDownload(item: any) {
@@ -134,7 +135,9 @@ async function httpUploadFile(param: UploadRequestOptions) {
     formData.append('file', param.file)
     formData.append('moduleId', id)
     formData.append('moduleCode', MODUCODE)
-    const res = await uploadFile(UPLOADATTACHMENT, formData)
+    const res = await uploadFile(UPLOADATTACHMENT, formData).finally(() => {
+        uploadRef.value.clearFiles()
+    })
     allLoading.uploadLoading = false
     if (res.code == 'ok') {
         globalPopup?.showSuccess('上传成功')

+ 23 - 6
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/product/component/information.vue

@@ -3,18 +3,19 @@
         <div class="flex justify-between">
             <div class="title">基本信息</div>
             <div>
-                <el-button type="primary" @click="showVisible('proudDialogVisible')">转移</el-button>
-                <el-button type="primary" @click="editProduct(info)">编辑</el-button>
+                <el-button type="primary" @click="claimProduct()" v-loading="allLoading.claimLoading" v-if="!info.inchargerName">认领</el-button>
+                <el-button type="primary" @click="showVisible('proudDialogVisible')" v-if="info.inchargerName">转移</el-button>
+                <el-button type="primary" v-permission="['productEdit']" @click="editProduct(info)">编辑</el-button>
             </div>
         </div>
         <div class="form flex flex-wrap justify-between">
             <div class="formItem flex pt-2 pb-1">
                 <div class="w-20 text-right text-gray-500">产品编号:</div>
-                <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1">{{ info.productCode }}</div>
+                <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1" v-ellipsis-tooltip>{{ info.productCode }}</div>
             </div>
             <div class="formItem flex pt-2 pb-1">
                 <div class="w-22 text-right text-gray-500">产品名称:</div>
-                <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1">{{ info.productName }}</div>
+                <div class="flex-1 overflow-hidden text-ellipsis whitespace-nowrap ml-1" v-ellipsis-tooltip>{{ info.productName }}</div>
             </div>
             <div class="formItem flex pt-2 pb-1">
                 <div class="w-22 text-right text-gray-500">产品类别:</div>
@@ -50,7 +51,7 @@
             </div>
             <div class="formItem flex pt-2 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>
                     {{ info.descs }}
                 </div>
             </div>
@@ -129,7 +130,8 @@ const dialogVisible = reactive({
 const allLoading = reactive({
     productLoading: false,
     generateFormLading: false,
-    saveBtnLoading: false
+    saveBtnLoading: false,
+    claimLoading: false
 })
 const allText = reactive({
     productText: '转移产品'
@@ -185,6 +187,21 @@ function transferProduct() {
     })
 }
 
+function claimProduct() {
+    const ids = info.value?.id
+    const inchargerId = userInfo.id
+    allLoading.claimLoading = true
+    post(GETINCHARGER, { id: ids, userId: inchargerId }).then((res) => {
+        if (res.code == 'ok') {
+            globalPopup?.showSuccess('操作成功')
+            dialogVisible.proudDialogVisible = false
+            emits('getInformationData')
+        }
+    }).finally(() => {
+        allLoading.claimLoading = false
+    })
+}
+
 // 显示弹窗
 function showVisible(filed: keyof typeof dialogVisible) {
     if (filed == 'proudDialogVisible') {

+ 23 - 10
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/product/component/relatedBusiness.vue

@@ -4,25 +4,25 @@
             <div class="title">相关商机</div>
         </div>
         <div class="flex-1 overflow-auto pt-3">
-            <el-table :data="relatedTaskstable" border style="width: 100%;height: 100%;">
-                <el-table-column prop="taskName" label="任务名称">
+            <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"
+                    :width="item.width">
                     <template #default="scope">
-                        <el-button link type="primary" size="large">{{
-                            scope.row.taskName
-                        }}</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>
-                <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>
         </div>
     </div>
 </template>
 <script lang="ts" setup>
 import { ref, reactive, onMounted, onUnmounted, defineExpose, inject, watchEffect } from 'vue'
+import { tableColumn, MOD } from '@/pages/business/api'
+import { tableShowOverflowTooltip } from '@/utils/globalVariables'
+import router from '@/router';
 
 const relatedTaskstable = ref([])
 const information: any = ref({})
@@ -38,6 +38,19 @@ function receiveAssignment(item: any) {
     information.value = item.information
 }
 
+function dealWithTableColumn(row: any, eventName: string) {
+  if (eventName == 'toClueTableDetail') {
+    toBusinessTableDetail(row)
+  }
+}
+
+function toBusinessTableDetail(row: any) {
+  router.push({
+    path: `${MOD}/detail`,
+    query: { id: row.id }
+  })
+}
+
 watchEffect(() => {
     receiveAssignment(props)
 });

+ 17 - 14
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/product/component/products.vue

@@ -1,7 +1,7 @@
 <template>
     <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 class="title">相关销售订单</div>
         </div>
         <div class="flex-1 overflow-auto pt-3">
             <el-table :data="relatedTaskstable" border style="width: 100%;height: 300px;">
@@ -10,28 +10,24 @@
                         {{ scope.$index + 1 }}
                     </template>
                 </el-table-column>
-                <el-table-column prop="taskName" label="产品名称">
+                <el-table-column v-for="(column, index) in tableColumns" :key="index" :prop="column.prop"
+                    :label="column.label" :width="column.width">
                     <template #default="scope">
-                        <el-button link type="primary" size="large">{{
-                            scope.row.taskName
-                        }}</el-button>
+                        <template v-if="column.event === 'toDetali'">
+                            <el-button link type="primary" size="large" @click="toDetali(scope.row)">{{
+                                scope.row[column.prop]
+                                }}</el-button>
+                        </template>
                     </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>
         </div>
     </div>
 </template>
 <script lang="ts" setup>
 import { ref, reactive, onMounted, onUnmounted, defineExpose, inject, watchEffect } from 'vue'
+import { tableColumns, MOD } from '@/pages/order/api'
+import router from '@/router';
 
 const relatedTaskstable = ref([])
 
@@ -44,6 +40,13 @@ function receiveAssignment(item: any) {
     relatedTaskstable.value = item.data
 }
 
+function toDetali(row: any) {
+  router.push({
+    path: `${MOD}/detail`,
+    query: { id: row.id }
+  })
+}
+
 watchEffect(() => {
     receiveAssignment(props)
 });

+ 5 - 4
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/product/detail/index.vue

@@ -7,7 +7,7 @@
         </el-link>
       </div>
       <div class="mr-8">
-        <el-select v-model="value" placeholder="请选择" style="width: 150px" @change="getDetail(false)">
+        <el-select v-model="addressParameters" placeholder="请选择" style="width: 250px" @change="getDetail(false)">
           <el-option v-for="item in options" :key="item.id" :label="item.productName" :value="item.id" />
         </el-select>
       </div>
@@ -34,7 +34,7 @@
 
       <div class="w-full h-auto flex justify-between mt-2">
         <div class="bg-white shadow-md rounded-md w-full">
-          <Products :data="products" />
+          <RelatedSalesOrder :data="products" />
         </div>
       </div>
     </div>
@@ -52,9 +52,10 @@ import Information from '../component/information.vue'
 import Attachment from '../component/attachment.vue'
 import RelatedBusiness from '../component/relatedBusiness.vue';
 import OperationRecord from '../component/operationRecord.vue';
-import Products from '../component/products.vue';
+import RelatedSalesOrder from '../component/relatedSalesOrder.vue';
 import { GETBUSINESS, GETDETAIL, GETCENTERLIST, GETORDER, MODUCODE, GETATTACHMENT, GETTABLELIST } from "../api";
 import { post } from "@/utils/request";
+import { number } from "echarts";
 
 const route = useRoute()
 const globalPopup = inject<GlobalPopup>('globalPopup')
@@ -121,7 +122,7 @@ function getProductList() {
 
 onMounted(() => {
   const { id } = route.query
-  addressParameters.value = id
+  addressParameters.value = (id || '') ? Number(id) : ''
   getProductList()
   getDetail(true)
 })

+ 15 - 13
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/product/index.vue

@@ -11,17 +11,17 @@
               <el-input v-model="filterProductForm.productName" clearable placeholder="请输入"></el-input>
             </el-form-item>
             <el-form-item label="产品类别">
-              <el-select v-model="filterProductForm.type" placeholder="请选择" clearable>
+              <el-select v-model="filterProductForm.type" placeholder="请选择" clearable filterable>
                 <el-option v-for="item in fixedData.ProductType" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
             <el-form-item label="状态">
-              <el-select v-model="filterProductForm.status" placeholder="请选择">
-                <el-option v-for="item in fixedData.Personnel" :key="item.id" :label="item.name" :value="item.id" />
+              <el-select v-model="filterProductForm.status" placeholder="请选择" filterable clearable>
+                <el-option v-for="item in SELECTSTATUS" :key="item.value" :label="item.label" :value="item.value" />
               </el-select>
             </el-form-item>
             <el-form-item label="负责人">
-              <el-select v-model="filterProductForm.userId" placeholder="请选择">
+              <el-select v-model="filterProductForm.userId" placeholder="请选择" filterable clearable>
                 <el-option v-for="item in fixedData.Personnel" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
@@ -44,22 +44,23 @@
     <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="editProduct(false)">新建产品</el-button>
+          <el-button type="primary" v-permission="['productAdd']" @click="editProduct(false)">新建产品</el-button>
           <el-button type="primary" @click="batchDelete()">批量删除</el-button>
           <el-button type="primary" @click="showDeteleProduct(true)">回收站</el-button>
-          <el-button type="primary" @click="dialogVisible.importVisible = true">导入</el-button>
-          <el-button type="primary" @click="exportProductTableList()" :loading="allLoading.exoprtLoading">导出</el-button>
+          <el-button type="primary" v-permission="['productImport']" @click="dialogVisible.importVisible = true">导入</el-button>
+          <el-button type="primary" v-permission="['productExport']" @click="exportProductTableList()" :loading="allLoading.exoprtLoading">导出</el-button>
         </div>
         <div class="flex-1 w-full overflow-hidden">
-          <el-table ref="productTableRef" :data="productTableList" border v-loading="allLoading.productTableLading"
+          <el-table ref="productTableRef" :show-overflow-tooltip="tableShowOverflowTooltip" :data="productTableList" border v-loading="allLoading.productTableLading"
             style="width: 100%;height: 100%;">
             <el-table-column type="selection" width="55" />
             <el-table-column prop="productCode" label="产品编号" width="180"></el-table-column>
             <el-table-column prop="productName" label="产品名称" width="180">
               <template #default="scope">
-                <el-button link type="primary" size="large" @click="toProductDetail(scope.row)">{{
+                <!-- <el-button link type="primary" size="large" @click="toProductDetail(scope.row)">{{
                   scope.row.productName
-                }}</el-button>
+                }}</el-button> -->
+                <div class="table-text-textnowrap" @click.prevent="toProductDetail(scope.row)">{{ scope.row.productName }}</div>
               </template>
             </el-table-column>
             <el-table-column prop="typeName" label="产品类别" width="180"></el-table-column>
@@ -74,7 +75,7 @@
             <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="createTime" label="创建时间" width="180"></el-table-column>
-            <el-table-column label="操作" fixed="right" width="200">
+            <el-table-column label="操作" fixed="right" width="200" v-permission="['productEdit']">
               <template #default="scope">
                 <el-button link type="primary" size="large" @click.stop="editProduct(scope.row)">编辑</el-button>
                 <el-button link type="danger" size="large" @click.stop="deteleRow([scope.row])">删除</el-button>
@@ -136,9 +137,10 @@
 
 <script lang="ts" setup>
 import { ref, reactive, onMounted, inject } from "vue";
-import { GETSYSFILED, MOD, MODUCODE, GETPERSONNEL, GETTEMPLATE, GETTABLELIST, ADDPRODUCT, ALLDETELE, UPLOADFILE, EXPORTTIME } from './api'
+import { GETSYSFILED, MOD, MODUCODE, GETPERSONNEL, GETTEMPLATE, GETTABLELIST, ADDPRODUCT, ALLDETELE, UPLOADFILE, EXPORTTIME, SELECTSTATUS } from './api'
 import { getAllListByCode, getFromValue, resetFromValue, getFirstDayOfMonth, downloadFile, formatDate, createTaskFromType, confirmAction, downloadTemplate } from '@/utils/tools'
 import { FormInstance, FormRules, ElMessageBox, ElTable, UploadRequestOptions } from 'element-plus'
+import { tableShowOverflowTooltip } from '@/utils/globalVariables'
 import { post, get, uploadFile } from "@/utils/request";
 import { useRouter, useRoute } from "vue-router";
 import { GenerateForm } from '@zmjs/form-design';
@@ -311,7 +313,7 @@ function handleCurrentChange(val: number) {
 }
 
 function resetFilter() {
-  let newResetForm = resetFromValue(filterProductForm, { startTime: getFirstDayOfMonth(new Date()), endTime: formatDate(new Date()), pageIndex: 1, pageFrom: 10 })
+  let newResetForm = resetFromValue(filterProductForm, { startTime: getFirstDayOfMonth(new Date()), endTime: formatDate(new Date()), pageIndex: 1, pageSize: 10 })
   Object.assign(filterProductForm, newResetForm)
   getProductTableList()
 }

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

@@ -8,7 +8,7 @@
               <el-input v-model="filterCriteriaForm.clueName" clearable placeholder="请输入"></el-input>
             </el-form-item>
             <el-form-item label="线索来源">
-              <el-select v-model="filterCriteriaForm.clueSourceId" placeholder="请选择" clearable>
+              <el-select v-model="filterCriteriaForm.clueSourceId" placeholder="请选择" clearable filterable>
                 <el-option v-for="item in fixedData.ClueSources" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
@@ -19,17 +19,17 @@
               <el-input v-model="filterCriteriaForm.email" clearable placeholder="请输入"></el-input>
             </el-form-item>
             <el-form-item label="客户行业">
-              <el-select v-model="filterCriteriaForm.customerIndustryId" placeholder="请选择">
+              <el-select v-model="filterCriteriaForm.customerIndustryId" placeholder="请选择" filterable clearable>
                 <el-option v-for="item in fixedData.CustomIndustry" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
             <el-form-item label="客户级别">
-              <el-select v-model="filterCriteriaForm.customerLevelId" placeholder="请选择">
+              <el-select v-model="filterCriteriaForm.customerLevelId" placeholder="请选择" filterable clearable>
                 <el-option v-for="item in fixedData.CustomLevel" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>
             <el-form-item label="负责人">
-              <el-select v-model="filterCriteriaForm.inchargerId" placeholder="请选择">
+              <el-select v-model="filterCriteriaForm.inchargerId" placeholder="请选择" filterable clearable>
                 <el-option v-for="item in fixedData.Personnel" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </el-form-item>