Forráskód Böngészése

feat(售后服务/销售订单): 根据环境变量6,给润天写死销售部门默认营销部,售后 涉及事业部门默认研发部,业务员默认营销部和技术服务部人员

liujt 5 hónapja
szülő
commit
da26ebbb54

+ 12 - 0
src/api/system/organization/index.js

@@ -25,6 +25,18 @@ export async function getUserPage (params) {
   return Promise.reject(new Error(res.data.message));
 }
 
+/**
+ * 查询多个部门下的员工
+ * @param data 机构信息
+ */
+export async function getUserByGroupIds (data) {
+  const res = await request.post('/main/user/getUserByGroupIds', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
 /**
  * 添加机构
  * @param data 机构信息

+ 6 - 0
src/views/saleManage/saleOrder/components/addDialog.vue

@@ -1578,6 +1578,12 @@
             this.form.needProduce = 4;
             this.form.relationType = 4;
           }
+
+          //润天默认值
+          if (this.clientEnvironmentId == 6) {
+            this.form.salesDeptId = '1998632792148717569';
+            this.form.salesDeptName = '营销部';
+          }
         } else {
           this.isUpdate = true;
           this.getSaleOrderDetail(row.id);

+ 18 - 2
src/views/salesServiceManagement/components/info.vue

@@ -1083,7 +1083,7 @@ import spareParts from '@/views/salesServiceManagement/components/sparePartsList
 import { getToken } from '@/utils/token-util';
 import { getByCode } from '@/api/system/dictionary-data'; // 字典接口
 import { listOrganizations } from '@/api/system/organization';
-import { getUserPage } from '@/api/system/organization';
+import { getUserPage, getUserByGroupIds } from '@/api/system/organization';
 import GYSparentList from '@/views/purchasingManage/supplierManage/components/parentList.vue';
 import bpmDetail from '@/views/bpm/processInstance/detail.vue'; // 引入流程详情组件
  const defaultForm = {
@@ -1127,6 +1127,9 @@ export default {
   },
   computed: {
     ...mapGetters(['getDictValue']),
+    clientEnvironmentId() {
+      return this.$store.state.user.info.clientEnvironmentId;
+    },
     sxtValueLabelMap() {
       return this.sxtList.reduce((map, item) => {
         map[item.value] = item.label;
@@ -1566,6 +1569,11 @@ export default {
           idField: 'id',
           parentIdField: 'parentId'
         });
+        // 润天默认  6
+        if(this.clientEnvironmentId == 6 && this.type == 'add') {
+          this.form.involveDeptId = '1998632521465114626';
+          this.form.involveDeptName = '研发部';
+        }
       } catch (error) {
         console.error('获取涉及事业部门数据失败:', error);
         this.$message.error('获取涉及事业部门数据失败');
@@ -1619,7 +1627,15 @@ export default {
           pageNum: 1,
           size:1000
         });
-        this.userList = res?.list || [];
+
+        // 营销部 营销部(装备) 营销部(智能) 技术服务部  技术服务部(智能) 技术服务部(装备)
+        const rtRes = await getUserByGroupIds(['1998632792148717569', '1896791540202254338', '1998627729057558530', '1998632872721297409', '1998627861299769345', '1896791598125592578']);
+        if(this.clientEnvironmentId == 6) {
+          this.userList = rtRes || [];
+        } else {
+          this.userList = res?.list || [];
+        }
+        console.log('rtRes', rtRes);
       } catch (error) {
         console.error('获取用户列表失败:', error);
         this.$message.error('获取用户列表失败');