| | |
| | | step="1" |
| | | placeholder="请输入本次生产数量" |
| | | style="width: 100%" |
| | | :class="{ 'over-limit': reportForm.quantity > reportForm.planQuantity }" |
| | | @input="handleQuantityInput" |
| | | /> |
| | | </el-form-item> |
| | |
| | | step="1" |
| | | placeholder="请输入报废数量" |
| | | @input="handleScrapQtyInput" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item label="加放数" prop="addQty"> |
| | | <el-input |
| | | v-model.number="reportForm.addQty" |
| | | type="number" |
| | | min="0" |
| | | step="1" |
| | | placeholder="请输入加放数" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item label="审核人" prop="auditUserId"> |
| | | <el-select |
| | | v-model="reportForm.auditUserId" |
| | | placeholder="请选择审核人" |
| | | clearable |
| | | filterable |
| | | @change="handleReviewerIdChange" |
| | | > |
| | | <el-option |
| | | v-for="user in userOptions" |
| | | :key="user.userId" |
| | | :label="user.nickName" |
| | | :value="user.userId" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <!-- <el-col :span="12">--> |
| | | <!-- <el-form-item label="审核人" prop="auditUserId">--> |
| | | <!-- <el-select--> |
| | | <!-- v-model="reportForm.auditUserId"--> |
| | | <!-- placeholder="请选择审核人"--> |
| | | <!-- clearable--> |
| | | <!-- filterable--> |
| | | <!-- @change="handleReviewerIdChange"--> |
| | | <!-- >--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="user in userOptions"--> |
| | | <!-- :key="user.userId"--> |
| | | <!-- :label="user.nickName"--> |
| | | <!-- :value="user.userId"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | |
| | | </el-row> |
| | | </el-form> |
| | |
| | | } |
| | | |
| | | proxy.$modal.msgSuccess("排产已保存"); |
| | | scheduleDialogVisible.value = false; |
| | | resetCreateScheduleRows(); |
| | | getList(); |
| | | await getList(); |
| | | } catch (error) { |
| | | console.error("保存排产失败", error); |
| | | ElMessage.error("保存排产失败,请重试"); |
| | |
| | | label: "生产订单号", |
| | | prop: "productOrderNpsNo", |
| | | width: "140", |
| | | formatData: val => (val && val.length > 4 ? val.slice(0, -4) : val || ""), |
| | | }, |
| | | { |
| | | label: "产品名称", |
| | | prop: "productName", |
| | | width: "140", |
| | | label: "成品名称", |
| | | prop: "finalProductModel", |
| | | minWidth: 200, |
| | | overHidden: false |
| | | }, |
| | | { |
| | | label: "规格", |
| | | prop: "model", |
| | | }, |
| | | { |
| | | label: "单位", |
| | | prop: "unit", |
| | | }, |
| | | // { |
| | | // label: "加工品名称", |
| | | // prop: "productName", |
| | | // width: "140", |
| | | // }, |
| | | // { |
| | | // label: "加工品规格", |
| | | // prop: "model", |
| | | // }, |
| | | // { |
| | | // label: "加工品单位", |
| | | // prop: "unit", |
| | | // }, |
| | | { |
| | | label: "工序名称", |
| | | prop: "processName", |
| | |
| | | clickFun: row => { |
| | | showReportDialog(row); |
| | | }, |
| | | // 用户当前id |
| | | // // 用户当前id |
| | | disabled: row => row.completeQuantity >= row.planQuantity || |
| | | !isCurrentUserInUserIds(row) |
| | | !isCurrentUserInUserIds(row) || row.hasUnreportedMachine |
| | | }, |
| | | { |
| | | name: "生产排产", |
| | |
| | | planQuantity: 0, |
| | | quantity: null, |
| | | scrapQty: null, |
| | | addQty: 0, |
| | | startTime: "", |
| | | endTime: "", |
| | | userName: "", |
| | |
| | | teamList: [], |
| | | deviceId: null, |
| | | }); |
| | | |
| | | function removeLastFour(str) { |
| | | if (!str) return ''; // 空值保护 |
| | | return str.toString().slice(0, -4); // 核心:截取 0 到 倒数第4位 |
| | | } |
| | | // 本次生产数量验证规则 |
| | | const validateQuantity = (rule, value, callback) => { |
| | | if (value === null || value === undefined || value === "") { |
| | |
| | | await Promise.all(updates); |
| | | ElMessage.success("审核成功"); |
| | | auditDialogVisible.value = false; |
| | | getList(); |
| | | await getList(); |
| | | } finally { |
| | | auditLoading.value = false; |
| | | } |
| | |
| | | scrapQty: [{validator: validateScrapQty, trigger: "blur"}], |
| | | startTime: [{required: true, message: "请选择开始时间", trigger: "change"}], |
| | | endTime: [{required: true, message: "请选择结束时间", trigger: "change"}], |
| | | auditUserId: [{required: true, message: "请选择审核人", trigger: "change"}], |
| | | // auditUserId: [{required: true, message: "请选择审核人", trigger: "change"}], |
| | | teamList: [{required: true, message: "请选择班组", trigger: "change"}], |
| | | deviceId: [{required: true, message: "请选择设备", trigger: "change"}], |
| | | }; |
| | |
| | | } |
| | | const num = Number(value); |
| | | if (isNaN(num)) { |
| | | return; |
| | | } |
| | | // 如果超过待生产数量 |
| | | if (num > reportForm.planQuantity) { |
| | | proxy.$modal.msgWarning("本次生产数量不能大于待生产数量"); |
| | | reportForm.quantity = reportForm.planQuantity; |
| | | return; |
| | | } |
| | | // 如果小于1,清除 |
| | |
| | | /** 搜索按钮操作 */ |
| | | const handleQuery = () => { |
| | | page.current = 1; |
| | | getList(); |
| | | getList(); |
| | | }; |
| | | const pagination = obj => { |
| | | page.current = obj.page; |
| | |
| | | reportForm.replenishQty = 0; |
| | | reportForm.teamList = []; |
| | | reportForm.scrapQty = 0; |
| | | reportForm.addQty = 0; |
| | | reportForm.userIds = row.userIds || []; |
| | | |
| | | const ids = (row.userIds || "") |
| | |
| | | .filter(Boolean); |
| | | |
| | | reportForm.userIdsList = userTeamOptions.value |
| | | .filter(item => ids.includes(String(item.userId))) |
| | | // .filter(item => ids.includes(String(item.userId))) |
| | | .map(item => ({ |
| | | userId: item.userId, |
| | | nickName: item.nickName |
| | |
| | | return; |
| | | } |
| | | |
| | | if (quantity > reportForm.planQuantity) { |
| | | ElMessageBox.alert("本次生产数量不能超过待生产数量", "提示", { |
| | | confirmButtonText: "确定", |
| | | }); |
| | | return; |
| | | } |
| | | // if (quantity > reportForm.planQuantity) { |
| | | // ElMessageBox.alert("本次生产数量不能超过待生产数量", "提示", { |
| | | // confirmButtonText: "确定", |
| | | // }); |
| | | // return; |
| | | // } |
| | | |
| | | const submitData = { |
| | | ...reportForm, |
| | |
| | | height: 140px !important; |
| | | } |
| | | } |
| | | .el-table .cell { |
| | | white-space: normal !important; |
| | | word-break: break-all; |
| | | } |
| | | |
| | | .over-limit .el-input__inner { |
| | | color: #f56c6c !important; |
| | | } |
| | | </style> |