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

修改

Co-authored-by: Copilot <copilot@github.com>
hurx преди 5 дни
родител
ревизия
c0316dde35

+ 2 - 0
src/api/order/orderMain/types.ts

@@ -96,6 +96,8 @@ export interface OrderMainVO {
    */
   userDept: string;
 
+  userDeptName: string;
+
   /**
    * 商品总数量
    */

+ 27 - 26
src/views/customer/customerFile/customerInfo/index.vue

@@ -100,34 +100,35 @@
 
     <el-card shadow="never">
       <template #header>
-        <el-row :gutter="10" class="mb8">
-          <el-col :span="17"><span>客户信息列表</span> </el-col>
-          <el-col :span="1.5">
+        <!-- 1. 添加 type="flex" 和 justify="space-between" -->
+        <!-- 2. align="middle" 可以让文字和按钮垂直居中 -->
+        <el-row :gutter="10" class="mb8" type="flex" justify="space-between" align="middle">
+          <!-- 左侧标题 -->
+          <span style="font-size: 16px; font-weight: 500">客户信息列表</span>
+
+          <!-- 右侧按钮组 -->
+          <!-- 这里的 flex-wrap: nowrap 保证了按钮挤在一起也不换行 -->
+          <div style="display: flex; flex-wrap: nowrap; gap: 10px">
             <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['customer:customerInfo:add']">新增</el-button>
-          </el-col>
-          <el-col :span="1.5">
-            <el-button type="primary" plain :disabled="single" @click="handleTransferSalesPerson" v-hasPermi="['customer:customerInfo:edit']"
-              >转移业务负责人</el-button
-            >
-          </el-col>
-          <el-col :span="1.5">
-            <el-button type="primary" plain :disabled="single" @click="handleTransferServiceStaff" v-hasPermi="['customer:customerInfo:edit']"
-              >转移客服支持</el-button
-            >
-          </el-col>
-          <el-col :span="1.5">
-            <el-button type="primary" plain :disabled="single" @click="updateCreditAmountBtn" v-hasPermi="['customer:customerInfo:edit']"
-              >修改临时额度</el-button
-            >
-          </el-col>
-          <el-col :span="1.5">
-            <el-button type="primary" plain :disabled="single" @click="setCustomerInfoTagBtn" v-hasPermi="['customer:customerInfo:edit']"
-              >设置标签</el-button
-            >
-          </el-col>
-          <el-col :span="1.5">
+
+            <el-button type="primary" plain :disabled="single" @click="handleTransferSalesPerson" v-hasPermi="['customer:customerInfo:edit']">
+              转移业务负责人
+            </el-button>
+
+            <el-button type="primary" plain :disabled="single" @click="handleTransferServiceStaff" v-hasPermi="['customer:customerInfo:edit']">
+              转移客服支持
+            </el-button>
+
+            <el-button type="primary" plain :disabled="single" @click="updateCreditAmountBtn" v-hasPermi="['customer:customerInfo:edit']">
+              修改临时额度
+            </el-button>
+
+            <el-button type="primary" plain :disabled="single" @click="setCustomerInfoTagBtn" v-hasPermi="['customer:customerInfo:edit']">
+              设置标签
+            </el-button>
+
             <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['customer:customerInfo:export']">导出</el-button>
-          </el-col>
+          </div>
         </el-row>
       </template>
 

+ 10 - 2
src/views/customer/customerFile/customerInfo/overview/baseInfo.vue

@@ -5,10 +5,10 @@
       <template #header>
         <div class="flex justify-between items-center">
           <span class="font-medium">企业基本信息 </span>
+          <el-button type="primary" style="float: right" @click="handleSave">保存</el-button>
           <!-- <span class="font-medium"
             >企业基本信息 / <span style="color: #ff0033">客户编号:{{ customerNumber }}</span></span
           > -->
-          <el-button type="primary" @click="handleSave">保存</el-button>
         </div>
       </template>
       <el-form ref="formRef" :model="form" :rules="rules" label-width="140px">
@@ -320,7 +320,7 @@
       <template #header>
         <div class="flex justify-between items-center">
           <span class="font-medium">ERP销售信息</span>
-          <el-button type="primary" @click="handleSave">保存</el-button>
+          <!-- <el-button type="primary" @click="handleSave">保存</el-button> -->
         </div>
       </template>
       <el-form ref="salesFormRef" :model="salesForm" :rules="salesRules" label-width="140px">
@@ -1232,6 +1232,14 @@ const handleSave = async () => {
   }
 
   try {
+    if (!salesForm.salesPersonId) {
+      ElMessage.warning('请选择业务人员!');
+      return;
+    }
+    if (!salesForm.serviceStaffId) {
+      ElMessage.warning('请选择客服人员!');
+      return;
+    }
     // 2. 串行验证,任何一步失败都会抛出异常,进入 catch
     // 注意:ElementPlus 的 validate 失败时会 reject 一个包含错误信息的对象
     await formRef.value.validate();

+ 4 - 4
src/views/order/orderAssignment/splitAssignDialog.vue

@@ -152,7 +152,7 @@
               </el-select>
             </div>
           </el-col>
-          <el-col :span="12" v-show="assignForm.targetType === 'zy'">
+          <!-- <el-col :span="12" v-show="assignForm.targetType === 'zy'">
             <div class="target-input-wrapper">
               <span class="required-mark">*</span>
               <span class="label">自营客户: </span>
@@ -160,7 +160,7 @@
                 <el-option v-for="item in customerList" :key="item.id" :label="item.name" :value="item.id" />
               </el-select>
             </div>
-          </el-col>
+          </el-col> -->
           <el-col :span="12" v-show="assignForm.targetType === 'srm'">
             <div class="target-input-wrapper">
               <span class="required-mark">*</span>
@@ -516,8 +516,8 @@ const submitAssign = async () => {
   }
 
   // 验证分配目标
-  if (!assignForm.targetId) {
-    proxy?.$modal.msgWarning(`请选择${assignForm.targetType === 'srm' ? '供应商' : '伙伴商'}`);
+  if (assignForm.targetType == 'srm' && !assignForm.targetId) {
+    proxy?.$modal.msgWarning(`请选择${assignForm.targetType === 'srm' ? '供应商' : ''}`);
     return;
   }
 

+ 20 - 7
src/views/order/saleOrder/sendDetail.vue

@@ -84,7 +84,7 @@
           </div>
           <div class="detail-item">
             <span class="label">下单部门:</span>
-            <span>{{ orderDetail.userDept }}</span>
+            <span>{{ orderDetail.userDeptName }}</span>
           </div>
           <div class="detail-item">
             <span class="label">订单状态:</span>
@@ -133,9 +133,9 @@
         <el-table-column prop="unsentQuantity" label="未发货数量" />
       </el-table>
     </el-card>
-    <div class="mt-2 text-right">
+    <div class="mt-2 text-right" style="margin-right: 8px; margin-bottom: 10px">
       <span
-        >商品数:{{ totalQuantity }}, 其中有<span style="color: #f56c6c">{{ totalQuantitySent }}已经发货</span></span
+        >商品数:{{ totalQuantity }} , 其中有 <span style="color: #f56c6c">{{ totalQuantitySent }} 已经发货</span></span
       >
     </div>
     <!-- 信息汇总 -->
@@ -182,9 +182,9 @@
                 <span>发货单号:{{ (deliver as any).deliverCode || '--' }}</span>
                 <span>发货时间:{{ (deliver as any).createTime || '--' }}</span>
                 <span>发货方式:{{ getDictLabel(deliver_method, deliver.deliverMethod || '--') }}</span>
-                <span>送货人:{{ deliver.deliverMan || '--' }}</span>
-                <span>手机:{{ deliver.phone || '--' }}</span>
-                <span style="margin-left: 30px">物流状态:{{ deliver.logisticsStatus || '--' }}</span>
+                <span v-if="deliver.deliverMethod == '0'">收货人:{{ deliver.deliverMan || '--' }}</span>
+                <span>手机:{{ deliver.phone || deliver.consigneePhone }}</span>
+                <span style="margin-left: 30px" v-if="deliver.deliverMethod == '1'">物流单号:{{ deliver.logisticNo || '--' }}</span>
                 <span style="margin-left: 20px">发货备注:{{ deliver.deliverRemark || '--' }}</span>
               </div>
             </el-col>
@@ -263,7 +263,7 @@ import { CustomerInfoVO } from '@/api/customer/customerFile/customerInfo/types';
 import { getInvoiceType } from '@/api/customer/invoiceType';
 import { InvoiceTypeVO } from '@/api/customer/invoiceType/types';
 import { selectNewOneLog } from '@/api/order/orderStatusLog';
-
+import { getDept } from '@/api/system/dept';
 import LogisticsDetail from './logisticsDetail.vue';
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 const { order_status, payment_status, fee_type, pay_method, deliver_method } = toRefs<any>(
@@ -333,6 +333,16 @@ const totalQuantitySent = computed(() => {
   }, 0);
 });
 
+// 获取部门详细信息
+const getDeptDetail = async (deptId: string) => {
+  try {
+    const res = await getDept(deptId);
+    return res.data?.deptName || deptId;
+  } catch (error) {
+    return deptId;
+  }
+};
+
 // 获取订单详情
 const getOrderDetail = async () => {
   const orderId = route.query.id || route.params.id;
@@ -383,6 +393,9 @@ const getOrderDetail = async () => {
     if (orderDetail.value.customerId) {
       await getCustomerDetail(orderDetail.value.customerId);
     }
+    if (orderDetail.value.userDept) {
+      orderDetail.value.userDeptName = await getDeptDetail(orderDetail.value.userDept);
+    }
 
     // 获取发票类型信息
     // if (orderDetail.value.invoiceType) {