| | |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="是否首检:" |
| | | prop="isFirstInspect"> |
| | | <el-radio-group v-model="form.isFirstInspect" |
| | | class="sampling-radio-group" |
| | | :disabled="isViewMode"> |
| | | <el-radio-button :label="1">是</el-radio-button> |
| | | <el-radio-button :label="0">否</el-radio-button> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="是否抽检:" |
| | | prop="isSampling"> |
| | | <el-radio-group v-model="form.isSampling" |
| | |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12" |
| | | v-if="form.isSampling === 1"> |
| | | </el-row> |
| | | <el-row :gutter="30" |
| | | v-if="form.isSampling === 1"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="抽检数量:" |
| | | prop="samplingQuantity"> |
| | | <el-input-number :step="0.01" |
| | |
| | | checkCompany: "", |
| | | isSampling: 0, |
| | | samplingQuantity: "", |
| | | isFirstInspect: 0, |
| | | isStockIn: 0, |
| | | }, |
| | | rules: { |
| | |
| | | checkCompany: [{ required: false, message: "请输入", trigger: "blur" }], |
| | | isSampling: [{ required: true, message: "请选择是否抽检", trigger: "change" }], |
| | | samplingQuantity: [{ required: true, message: "请输入抽检数量", trigger: "blur" }], |
| | | isFirstInspect: [{ required: true, message: "请选择是否首检", trigger: "change" }], |
| | | }, |
| | | }); |
| | | const userList = ref([]); |
| | |
| | | checkCompany: "", |
| | | isSampling: 0, |
| | | samplingQuantity: "", |
| | | isFirstInspect: 0, |
| | | isStockIn: 0, |
| | | }; |
| | | testStandardOptions.value = []; |
| | |
| | | width: 230 |
| | | }, |
| | | { |
| | | label: "是否首检", |
| | | prop: "isFirstInspect", |
| | | width: 100, |
| | | dataType: "tag", |
| | | formatData: (params) => { |
| | | return Number(params) === 1 ? "是" : "否"; |
| | | }, |
| | | formatType: (params) => { |
| | | return Number(params) === 1 ? "success" : "info"; |
| | | }, |
| | | }, |
| | | { |
| | | label: "检验员", |
| | | prop: "checkName", |
| | | }, |
| | |
| | | type="primary" |
| | | @click="openForm('view', scope.row)">详情 |
| | | </el-button> |
| | | <el-button link |
| | | type="primary" |
| | | @click="openForm('edit', scope.row)" |
| | | :disabled="!scope.row.isEdit || scope.row.hasProductionRecord || !canEditLedger(scope.row)">编辑 |
| | | </el-button> |
| | | <el-tooltip :content="editDisabledReason(scope.row)" |
| | | :disabled="!editDisabledReason(scope.row)" |
| | | placement="top"> |
| | | <span> |
| | | <el-button link |
| | | type="primary" |
| | | @click="openForm('edit', scope.row)" |
| | | :disabled="isLedgerEditDisabled(scope.row)">编辑 |
| | | </el-button> |
| | | </span> |
| | | </el-tooltip> |
| | | <el-button link |
| | | type="primary" |
| | | @click="openFileDialog(scope.row)">附件 |
| | |
| | | }; |
| | | const canEditLedger = row => isCurrentUserMaintainer(row); |
| | | const canDeleteLedger = row => isCurrentUserMaintainer(row); |
| | | /** |
| | | * 需要生产的订单:生产计划已下发(含部分下发)后不可编辑; |
| | | * 走库存的订单:已发货后不可编辑,否则可以编辑。 |
| | | */ |
| | | const editDisabledReason = row => { |
| | | if (!row) return ""; |
| | | if (!canEditLedger(row)) return "当前系统登录人不是维护人,不能编辑数据"; |
| | | if (row.hasProductionRecord) return "生产计划已下发,不能编辑"; |
| | | if (!row.isEdit) return "订单已发货,不能编辑"; |
| | | return ""; |
| | | }; |
| | | const isLedgerEditDisabled = row => !!editDisabledReason(row); |
| | | const sensitiveAmountFormatter = (row, column, cellValue) => { |
| | | if (!isCurrentUserMaintainer(row)) { |
| | | return "*****"; |
| | |
| | | }; |
| | | // 打开弹框 |
| | | const openForm = async (type, row) => { |
| | | if (type === "edit" && row && !canEditLedger(row)) { |
| | | proxy.$modal.msgWarning("当前系统登录人不是维护人,不能编辑数据"); |
| | | return; |
| | | if (type === "edit" && row) { |
| | | const disabledReason = editDisabledReason(row); |
| | | if (disabledReason) { |
| | | proxy.$modal.msgWarning(disabledReason); |
| | | return; |
| | | } |
| | | } |
| | | operationType.value = type; |
| | | form.value = {}; |
| | |
| | | |
| | | /** |
| | | * 判断是否可以发货 |
| | | * 只有在产品状态是充足,发货状态是待发货和审核拒绝的时候才可以发货 |
| | | * @param row 行数据 |
| | | */ |
| | | const canShip = row => { |
| | | // 产品状态必须是充足(approveStatus === 1) |
| | | if (row.approveStatus !== 1) { |
| | | return false; |
| | | } |
| | | |
| | | // 获取发货状态 |
| | | const shippingStatus = row.shippingStatus; |
| | | |
| | |
| | | // 检查是否可以发货 |
| | | if (!canShip(row)) { |
| | | proxy.$modal.msgWarning( |
| | | "只有在产品状态是充足,发货状态是待发货或审核拒绝的时候才可以发货" |
| | | "只有在发货状态是待发货、审核拒绝或部分发货的时候才可以发货" |
| | | ); |
| | | return; |
| | | } |