fix: 修正销售发货验证并优化黑名单表单显示
为待发货数量字段添加表单验证规则,确保发货数量大于0
重构发货状态判断逻辑,基于已发货数量与总数量的比较计算状态
简化供应商黑名单表单,隐藏非必要字段并调整维护人字段位置
| | |
| | | </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" |
| | |
| | | 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 |
| | |
| | | /> |
| | | </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 |
| | |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-row> --> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="联系人:" prop="contactUserName"> |
| | |
| | | </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%" |
| | |
| | | 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> |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-row> --> |
| | | </el-form> |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | |
| | | 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", |
| | |
| | | prop: "contactUserPhone", |
| | | width: 150, |
| | | }, |
| | | { |
| | | label: "维护人", |
| | | prop: "maintainUserName", |
| | | }, |
| | | // { |
| | | // label: "维护人", |
| | | // prop: "maintainUserName", |
| | | // }, |
| | | |
| | | { |
| | | label: "维护时间", |
| | | prop: "maintainTime", |
| | | width:100 |
| | | }, |
| | | // { |
| | | // label: "维护时间", |
| | | // prop: "maintainTime", |
| | | // width:100 |
| | | // }, |
| | | { |
| | | dataType: "action", |
| | | label: "操作", |
| | |
| | | </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> |
| | |
| | | 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" } |
| | |
| | | * @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 '待发货'; |
| | | }; |
| | | |
| | | /** |
| | |
| | | * @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) => { |