Преглед на файлове

修复页面搜索代码

沐梦. преди 1 седмица
родител
ревизия
44235d1800

+ 17 - 4
src/views/customer/highseas/index.vue

@@ -49,11 +49,20 @@
           </el-col>
           <el-col :span="6">
             <el-form-item label="部门" prop="belongingDepartmentId" class="custom-form-item">
-              <el-input v-model="queryParams.belongingDepartmentId" placeholder="请输入部门" clearable />
+              <el-tree-select
+                v-model="queryParams.belongingDepartmentId"
+                :data="deptOptions"
+                :props="{ value: 'deptId', label: 'deptName', children: 'children' }"
+                value-key="deptId"
+                placeholder="请选择部门"
+                check-strictly
+                clearable
+                style="width: 100%"
+              />
             </el-form-item>
           </el-col>          <el-col :span="6">
-            <el-form-item label="合作状态" prop="cooperation" class="custom-form-item">
-              <el-select v-model="queryParams.cooperation" placeholder="请选择" clearable style="width: 100%">
+            <el-form-item label="合作状态" prop="status" class="custom-form-item">
+              <el-select v-model="queryParams.status" placeholder="请选择" clearable style="width: 100%">
                 <el-option v-for="item in cooperationOptions" :key="item.value" :label="item.label" :value="item.value" />
               </el-select>
             </el-form-item>
@@ -157,6 +166,7 @@ import { listPool, claimPool } from "@/api/customer/customerPool";
 import { listIndustryCategory } from "@/api/customer/industryCategory";
 import { listLevel } from "@/api/customer/customerLevel";
 import { listComStaff } from "@/api/system/comStaff/index";
+import { deptTreeSelect } from "@/api/system/dept";
 import { debounce } from 'lodash-es';
 import CustomerDetail from "./detail.vue";
 
@@ -172,6 +182,7 @@ const dataList = ref([]);
 const industryOptions = ref([]);
 const levelOptions = ref([]);
 const staffOptions = ref([]);
+const deptOptions = ref([]);
 const infoRef = ref(null);
 const tableRef = ref(null);
 
@@ -187,7 +198,6 @@ const queryParams = reactive({
   serviceStaffId: undefined,
   belongingDepartmentId: undefined,
   status: undefined,
-  cooperation: undefined,
   enterpriseSource: undefined,
   procurementType: undefined,
   isApprove: undefined,
@@ -221,6 +231,9 @@ const getOptions = async () => {
     
     const staffRes = await listComStaff({ pageSize: 1000 });
     staffOptions.value = staffRes.rows || staffRes.data || [];
+
+    const deptRes = await deptTreeSelect();
+    deptOptions.value = proxy.handleTree(deptRes.data, "deptId");
   } catch (err) {
     console.error('获取选项失败:', err);
   }

+ 16 - 4
src/views/customer/valid/index.vue

@@ -55,15 +55,24 @@
           </el-col>
           <el-col :span="6">
             <el-form-item label="部门" prop="belongingDepartmentId" class="custom-form-item">
-              <el-input v-model="queryParams.belongingDepartmentId" placeholder="请输入部门" clearable />
+              <el-tree-select
+                v-model="queryParams.belongingDepartmentId"
+                :data="deptOptions"
+                :props="{ value: 'deptId', label: 'deptName', children: 'children' }"
+                value-key="deptId"
+                placeholder="请选择部门"
+                check-strictly
+                clearable
+                style="width: 100%"
+              />
             </el-form-item>
           </el-col>        </el-row>
 
         <!-- 第三行 -->
         <el-row :gutter="20" class="mt-15">
           <el-col :span="6">
-            <el-form-item label="合作状态" prop="cooperation" class="custom-form-item">
-              <el-select v-model="queryParams.cooperation" placeholder="请选择" clearable style="width: 100%">
+            <el-form-item label="合作状态" prop="status" class="custom-form-item">
+              <el-select v-model="queryParams.status" placeholder="请选择" clearable style="width: 100%">
                 <el-option v-for="item in cooperationOptions" :key="item.value" :label="item.label" :value="item.value" />
               </el-select>
             </el-form-item>
@@ -180,6 +189,7 @@ import { listValidCustomer, releaseToPool, listCompanyOption, transferSalesPerso
 import { listIndustryCategory } from "@/api/customer/industryCategory";
 import { listLevel } from "@/api/customer/customerLevel";
 import { listComStaff } from "@/api/system/comStaff/index";
+import { deptTreeSelect } from "@/api/system/dept";
 import { debounce } from 'lodash-es';
 import CustomerDetail from "./detail.vue";
 
@@ -198,6 +208,7 @@ const industryOptions = ref([]);
 const staffOptions = ref([]);
 const companyOptions = ref([]);
 const levelOptions = ref([]);
+const deptOptions = ref([]);
 
 const activeTab = ref('all');
 const tabs = [
@@ -229,7 +240,7 @@ const queryParams = reactive({
   salesPersonId: undefined,
   serviceStaffId: undefined,
   belongingDepartmentId: undefined,
-  cooperation: undefined,
+  status: undefined,
   enterpriseTypeId: undefined
 });
 
@@ -341,6 +352,7 @@ const initOptions = async () => {
   listIndustryCategory().then(res => industryOptions.value = res.data || []);
   listLevel().then(res => levelOptions.value = res.rows || []);
   listComStaff({ pageSize: 1000 }).then(res => staffOptions.value = res.rows || res.data || []);
+  deptTreeSelect().then(res => deptOptions.value = proxy.handleTree(res.data, "deptId"));
 };
 
 onMounted(() => {

+ 43 - 6
src/views/saleManage/leads/detail.vue

@@ -115,11 +115,7 @@
                     {{ scope.row.department || scope.row.deptName }}
                   </template>
                 </el-table-column>
-                <el-table-column label="职位" align="center" min-width="120" show-overflow-tooltip>
-                  <template #default="scope">
-                    {{ scope.row.position || scope.row.roleName }}
-                  </template>
-                </el-table-column>
+                <el-table-column label="职位" align="center" prop="position" min-width="120" show-overflow-tooltip />
                 <el-table-column label="项目角色" align="center" width="120">
                   <template #default="scope">
                     <dict-tag :options="projectRoleOptions" :value="scope.row.projectRole" />
@@ -202,13 +198,24 @@
           <!-- 附件 Tab -->
           <div v-show="activeTab === 'attachment'" class="tab-content">
             <div class="attachment-section">
+              <div style="margin-bottom: 12px; display: flex; justify-content: flex-end;">
+                <el-upload
+                  :action="uploadFileUrl"
+                  :headers="headers"
+                  :on-success="handleUploadSuccess"
+                  :show-file-list="false"
+                  multiple
+                >
+                  <el-button type="primary" icon="Upload">上传附件</el-button>
+                </el-upload>
+              </div>
               <el-table :data="detailFileList" border class="attach-table">
                 <el-table-column label="文件名称" prop="name" show-overflow-tooltip />
                 <el-table-column label="文件类型" prop="type" width="120" align="center" />
                 <el-table-column label="上传时间" prop="uploadTime" width="170" align="center" />
                 <el-table-column label="操作" width="150" align="center">
                   <template #default="scope">
-                    <el-link :href="scope.row.url" :underline="false" target="_blank" type="primary" style="margin-right: 10px;">下载</el-link>
+                    <el-link type="primary" :underline="false" @click="handleDownloadFile(scope.row)" style="margin-right: 10px;">下载</el-link>
                     <el-link type="danger" :underline="false" @click="handleDeleteFile(scope.row)">删除</el-link>
                   </template>
                 </el-table-column>
@@ -864,6 +871,26 @@ const loadOssFiles = async () => {
   }
 };
 
+const handleUploadSuccess = async (res) => {
+  if (res.code === 200) {
+    const file = res.data;
+    const ossId = file.ossId;
+    const currentFileNo = form.value.fileNo ? form.value.fileNo.split(',').filter(Boolean) : [];
+    currentFileNo.push(ossId);
+    const newFileNo = currentFileNo.join(',');
+    try {
+      await updateLeads({ id: form.value.id, fileNo: newFileNo });
+      form.value.fileNo = newFileNo;
+      loadOssFiles();
+      proxy.$modal.msgSuccess("上传成功");
+    } catch (e) {
+      proxy.$modal.msgError("附件保存失败");
+    }
+  } else {
+    proxy.$modal.msgError(res.msg || "上传失败");
+  }
+};
+
 const handleAnalysisUploadSuccess = (res) => {
   if (res.code === 200) {
     const file = res.data;
@@ -1191,6 +1218,16 @@ const handleDeleteContact = (row) => {
   });
 };
 
+const handleDownloadFile = (row) => {
+  if (row.ossId) {
+    proxy.$download.oss(row.ossId);
+  } else if (row.url) {
+    window.open(row.url, '_blank');
+  } else {
+    proxy.$modal.msgError("下载地址不存在");
+  }
+};
+
 const handleDeleteFile = (row) => {
   proxy.$modal.confirm(`确认删除附件「${row.name}」吗?`).then(async () => {
     const currentFileNos = form.value.fileNo ? form.value.fileNo.split(',') : [];

+ 3 - 1
src/views/saleManage/leads/index.vue

@@ -195,7 +195,7 @@
         <!-- 15. 项目状态 -->
         <el-table-column label="项目状态" align="center" prop="status" width="100">
           <template #default="scope">
-            <dict-tag :options="saleStatusOptions" :value="scope.row.status" />
+            <dict-tag :options="saleStatusOptions" :value="scope.row.status" :show-value="false" />
           </template>
         </el-table-column>
         <el-table-column label="操作" align="center" width="180" fixed="right">
@@ -505,6 +505,8 @@ const handleClaim = (row) => {
   claimOpen.value = true;
 };
 
+
+
 const submitClaim = () => {
   if (!claimForm.leader) {
     proxy.$modal.msgError("请选择项目负责人");

+ 2 - 6
src/views/saleManage/opportunity/detail.vue

@@ -128,11 +128,7 @@
                       {{ scope.row.deptName || scope.row.department }}
                     </template>
                   </el-table-column>
-                  <el-table-column label="职位" align="center">
-                    <template #default="scope">
-                      {{ scope.row.position || scope.row.roleName || scope.row.role }}
-                    </template>
-                  </el-table-column>
+                  <el-table-column label="职位" align="center" prop="position" />
                   <el-table-column label="项目角色" align="center">
                     <template #default="scope">
                       {{ scope.row.projectRole || scope.row.role }}
@@ -259,7 +255,7 @@
         <el-table-column label="联系人" align="center" prop="contactName" width="120" />
         <el-table-column label="部门" align="center" prop="deptName" width="130" />
         <el-table-column label="客户名称" align="center" prop="customerName" min-width="180" show-overflow-tooltip />
-        <el-table-column label="职位" align="center" prop="roleName" width="110" />
+        <el-table-column label="职位" align="center" prop="position" width="110" />
         <el-table-column label="手机号码" align="center" prop="phone" width="120" />
         <el-table-column label="办公电话" align="center" prop="officePhone" width="120" />
       </el-table>

+ 9 - 10
src/views/saleManage/opportunity/index.vue

@@ -177,9 +177,7 @@
         </el-table-column>
         <el-table-column label="项目状态" align="center" prop="status" width="100">
           <template #default="{ row }">
-            <span class="status-tag" :class="getStatusClass(row.status)">
-              {{ getSaleStatusLabel(row.status) }}
-            </span>
+            <dict-tag :options="saleStatusOptions" :value="row.status" :show-value="false" />
           </template>
         </el-table-column>
         <el-table-column label="成交结果" align="center" prop="dealResult" width="100">
@@ -394,6 +392,8 @@ const getList = async () => {
         leader: queryParams.managerId, deptNo: queryParams.deptId,
         productSupport: queryParams.productSupport,
         status: queryParams.projectStatus,
+        result: queryParams.result,
+        dealResult: queryParams.result,
         timeType: queryParams.timeType,
         tabType: activeTab.value === 'list' ? undefined : activeTab.value
       },
@@ -529,19 +529,18 @@ const handleBatchDelete = () => {
 
 /* ========== 辅助方法 ========== */
 const getSaleStatusLabel = (status) => {
-  if (String(status) === '0') return '跟进中';
-  if (String(status) === '1') return '结案';
-
   if (!saleStatusOptions.value || saleStatusOptions.value.length === 0) return status;
   const item = saleStatusOptions.value.find(i => String(i.value) === String(status));
   return item ? item.label : status;
 };
 
 const getStatusClass = (status) => {
-  const s = String(status);
-  if (s === '0') return 'status-following';
-  if (s === '1') return 'status-success';
-  return 'status-following'; // 默认也使用橙色
+  if (!saleStatusOptions.value || saleStatusOptions.value.length === 0) return 'status-following';
+  const item = saleStatusOptions.value.find(i => String(i.value) === String(status));
+  // 根据字典的特定值或属性来决定样式,这里如果字典有listClass可以使用
+  if (item && item.listClass === 'success') return 'status-success';
+  if (item && item.label === '结案') return 'status-success';
+  return 'status-following'; // 默认橙色/蓝色
 };
 
 const findProjectLevelName = (id) => {

+ 3 - 6
src/views/saleManage/platformSelection/detail.vue

@@ -128,11 +128,7 @@
                       </template>
                     </el-table-column>
                     <el-table-column label="部门" prop="deptName" align="center" show-overflow-tooltip />
-                    <el-table-column label="职位" align="center" show-overflow-tooltip>
-                      <template #default="scope">
-                        {{ scope.row.position || scope.row.roleName || scope.row.role }}
-                      </template>
-                    </el-table-column>
+                    <el-table-column label="职位" align="center" prop="position" show-overflow-tooltip />
                     <el-table-column label="项目角色" align="center">
                       <template #default="scope">
                         {{ getProjectRoleLabel(scope.row.projectRole) }}
@@ -452,8 +448,9 @@
     <el-table :data="associateList" v-loading="associateLoading" border @selection-change="handleSelectionChange" max-height="400px">
       <el-table-column type="selection" width="55" />
       <el-table-column label="姓名" align="center" prop="contactName" width="120" />
+      <el-table-column label="客户名称" align="center" prop="customerName" show-overflow-tooltip />
       <el-table-column label="部门" align="center" prop="deptName" show-overflow-tooltip />
-      <el-table-column label="职位" align="center" prop="roleName" width="150" />
+      <el-table-column label="职位" align="center" prop="position" width="150" />
       <el-table-column label="手机号码" align="center" prop="phone" width="150" />
     </el-table>
     <template #footer>

+ 2 - 1
src/views/saleManage/platformSelection/index.vue

@@ -432,7 +432,8 @@ const drawerOptions = computed(() => ({
 const getList = async () => {
   loading.value = true;
   try {
-    const res = await listPlatformSelection(proxy.addDateRange(queryParams, dateRange.value));
+    const params = { ...queryParams, dealResult: queryParams.result };
+    const res = await listPlatformSelection(proxy.addDateRange(params, dateRange.value));
     const list = res.rows || [];
     
     // 补全成交结果数据

+ 2 - 6
src/views/saleManage/projectSelection/detail.vue

@@ -133,11 +133,7 @@
                       {{ scope.row.deptName || scope.row.department }}
                     </template>
                   </el-table-column>
-                  <el-table-column label="职位" align="center">
-                    <template #default="scope">
-                      {{ scope.row.position || scope.row.roleName || scope.row.role }}
-                    </template>
-                  </el-table-column>
+                  <el-table-column label="职位" align="center" prop="position" />
                   <el-table-column label="项目角色" align="center">
                     <template #default="scope">
                       {{ scope.row.projectRole || scope.row.role }}
@@ -427,7 +423,7 @@
         <el-table-column label="联系人" align="center" prop="contactName" width="120" />
         <el-table-column label="部门" align="center" prop="deptName" width="130" />
         <el-table-column label="客户名称" align="center" prop="customerName" min-width="180" show-overflow-tooltip />
-        <el-table-column label="职位" align="center" prop="roleName" width="110" />
+        <el-table-column label="职位" align="center" prop="position" width="110" />
         <el-table-column label="手机号码" align="center" prop="phone" width="120" />
         <el-table-column label="办公电话" align="center" prop="officePhone" width="120" />
       </el-table>

+ 2 - 1
src/views/saleManage/projectSelection/index.vue

@@ -430,7 +430,8 @@ const queryParams = reactive({
 const getList = async () => {
   loading.value = true;
   try {
-    const res = await listProjectSelection(proxy.addDateRange(queryParams, dateRange.value));
+    const params = { ...queryParams, dealResult: queryParams.result };
+    const res = await listProjectSelection(proxy.addDateRange(params, dateRange.value));
     const list = res.rows || [];
     
     // 异步补全成交结果数据