buhuazhen
6 天以前 168c23ac6a1c021407f905323525c8d411857e57
src/views/salesManagement/salesLedger/index.vue
@@ -572,7 +572,7 @@
                  </el-form-item>
               </el-col> -->
      <el-col :span="12">
                  <el-form-item label="待发货数量:">
                  <el-form-item label="待发货数量:" prop="remainAmount">
                     <el-input v-model="deliveryForm.remainAmount" disabled placeholder="请输入待发货数量"></el-input>
                  </el-form-item>
               </el-col>
@@ -869,6 +869,18 @@
  deliveryRules: {
    type: [
      { required: true, message: "请选择发货类型", trigger: "change" }
    ],
    remainAmount: [
      {
        validator: (rule, value, callback) => {
          const remain = Number(value) || 0;
          if (remain <= 0) {
            return callback(new Error("待发货数量需要大于0"));
          }
          return callback();
        },
        trigger: "change",
      }
    ],
    deliveryMode: [
      { required: true, message: "请选择发货模式", trigger: "change" }
@@ -2142,30 +2154,18 @@
 * @param row 行数据
 */
const getShippingStatusText = (row) => {
   // 如果已发货(有发货日期或车牌号),显示"已发货"
   if (row.shippingDate || row.shippingCarNumber) {
      return '已发货';
   }
   // 获取发货状态字段
   const status = row.shippingStatus;
   // 如果状态为空或未定义,默认为"待发货"
   if (status === null || status === undefined || status === '') {
   const total = Number(row?.quantity || 0);
   const shipped = Number(row?.partSendAmount || 0);
   if (shipped <= 0) {
      return '待发货';
   }
   // 状态是字符串
   const statusStr = String(status).trim();
   const statusTextMap = {
      '待发货': '待发货',
      '待审核': '待审核',
      '审核中': '审核中',
      '审核拒绝': '审核拒绝',
      '审核通过': '审核通过',
      '已发货': '已发货'
   };
   return statusTextMap[statusStr] || '待发货';
   if (shipped < total) {
      return '发货中';
   }
   if (shipped >= total && total > 0) {
      return '已发货';
   }
   return '待发货';
};
/**
@@ -2173,30 +2173,18 @@
 * @param row 行数据
 */
const getShippingStatusType = (row) => {
   // 如果已发货(有发货日期或车牌号),显示绿色
   if (row.shippingDate || row.shippingCarNumber) {
      return 'success';
   }
   // 获取发货状态字段
   const status = row.shippingStatus;
   // 如果状态为空或未定义,默认为灰色(待发货)
   if (status === null || status === undefined || status === '') {
   const total = Number(row?.quantity || 0);
   const shipped = Number(row?.partSendAmount || 0);
   if (shipped <= 0) {
      return 'info';
   }
   // 状态是字符串
   const statusStr = String(status).trim();
   const typeTextMap = {
      '待发货': 'info',
      '待审核': 'info',
      '审核中': 'warning',
      '审核拒绝': 'danger',
      '审核通过': 'success',
      '已发货': 'success'
   };
   return typeTextMap[statusStr] || 'info';
   if (shipped < total) {
      return 'warning';
   }
   if (shipped >= total && total > 0) {
      return 'success';
   }
   return 'info';
};
const getRemainAmount = (row) => {