buhuazhen
6 天以前 168c23ac6a1c021407f905323525c8d411857e57
fix: 修正销售发货验证并优化黑名单表单显示

为待发货数量字段添加表单验证规则,确保发货数量大于0
重构发货状态判断逻辑,基于已发货数量与总数量的比较计算状态
简化供应商黑名单表单,隐藏非必要字段并调整维护人字段位置
已修改2个文件
213 ■■■■ 文件已修改
src/views/basicData/supplierManage/components/BlacklistTab.vue 135 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/salesLedger/index.vue 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/supplierManage/components/BlacklistTab.vue
@@ -56,6 +56,23 @@
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="维护人:" prop="maintainUserId">
              <el-select
                  v-model="form.maintainUserId"
                  placeholder="请选择"
                  clearable
                  disabled
              >
                <el-option
                    v-for="item in userList"
                    :key="item.nickName"
                    :label="item.nickName"
                    :value="item.userId"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <!-- <el-col :span="12">
            <el-form-item
                label="纳税人识别号:"
                prop="taxpayerIdentificationNum"
@@ -66,9 +83,9 @@
                  clearable
              />
            </el-form-item>
          </el-col>
          </el-col> -->
        </el-row>
        <el-row :gutter="30">
        <!-- <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="公司地址:" prop="companyAddress">
              <el-input
@@ -87,8 +104,8 @@
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
        </el-row> -->
        <!-- <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="开户行:" prop="bankAccountName">
              <el-input
@@ -107,7 +124,7 @@
              />
            </el-form-item>
          </el-col>
        </el-row>
        </el-row> -->
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="联系人:" prop="contactUserName">
@@ -128,25 +145,9 @@
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="维护人:" prop="maintainUserId">
              <el-select
                  v-model="form.maintainUserId"
                  placeholder="请选择"
                  clearable
                  disabled
              >
                <el-option
                    v-for="item in userList"
                    :key="item.nickName"
                    :label="item.nickName"
                    :value="item.userId"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
        <!-- <el-row :gutter="30"> -->
          <!-- <el-col :span="12">
            <el-form-item label="维护时间:" prop="maintainTime">
              <el-date-picker
                  style="width: 100%"
@@ -158,9 +159,9 @@
                  clearable
              />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="30">
          </el-col> -->
        <!-- </el-row> -->
        <!-- <el-row :gutter="30">
          <el-col :span="12">
            <el-form-item label="供应商类型:" prop="supplierType">
              <el-select v-model="form.supplierType" placeholder="请选择" clearable>
@@ -179,7 +180,7 @@
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        </el-row> -->
      </el-form>
      <template #footer>
        <div class="dialog-footer">
@@ -259,36 +260,36 @@
    prop: "supplierName",
    width: 250,
  },
  {
    label: "供应商类型",
    prop: "supplierType",
    width: 120,
  },
  {
    label: "纳税人识别号",
    prop: "taxpayerIdentificationNum",
    width: 230,
  },
  {
    label: "公司地址",
    prop: "companyAddress",
    width: 220,
  },
  {
    label: "联系方式",
    prop: "companyPhone",
    width:150
  },
  {
    label: "开户行",
    prop: "bankAccountName",
    width: 220,
  },
  {
    label: "账号",
    prop: "bankAccountNum",
    width: 220,
  },
  // {
  //   label: "供应商类型",
  //   prop: "supplierType",
  //   width: 120,
  // },
  // {
  //   label: "纳税人识别号",
  //   prop: "taxpayerIdentificationNum",
  //   width: 230,
  // },
  // {
  //   label: "公司地址",
  //   prop: "companyAddress",
  //   width: 220,
  // },
  // {
  //   label: "联系方式",
  //   prop: "companyPhone",
  //   width:150
  // },
  // {
  //   label: "开户行",
  //   prop: "bankAccountName",
  //   width: 220,
  // },
  // {
  //   label: "账号",
  //   prop: "bankAccountNum",
  //   width: 220,
  // },
  {
    label: "联系人",
    prop: "contactUserName",
@@ -298,16 +299,16 @@
    prop: "contactUserPhone",
    width: 150,
  },
  {
    label: "维护人",
    prop: "maintainUserName",
  },
  // {
  //   label: "维护人",
  //   prop: "maintainUserName",
  // },
  {
    label: "维护时间",
    prop: "maintainTime",
    width:100
  },
  // {
  //   label: "维护时间",
  //   prop: "maintainTime",
  //   width:100
  // },
  {
    dataType: "action",
    label: "操作",
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) => {