增加结束订单功能,并在生产订单和报工页面限制已结束订单的编辑操作
| | |
| | | }); |
| | | } |
| | | |
| | | // 生产订单-修改 |
| | | export function updateProductOrder(data) { |
| | | return request({ |
| | | url: "/productionOrder/updateOrder", |
| | | method: "post", |
| | | data: data, |
| | | }); |
| | | } |
| | | |
| | | export function delProductOrder(ids) { |
| | | return request({ |
| | | url: `/productionOrder/delete`, |
| | |
| | | class="lims-table"> |
| | | <el-table-column align="center" |
| | | type="selection" |
| | | :selectable="selectable" |
| | | width="55" |
| | | v-if="isSelection" /> |
| | | <el-table-column align="center" |
| | |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | selectable: { |
| | | type: Function, |
| | | default: () => true, |
| | | }, |
| | | isShowPagination: { |
| | | type: Boolean, |
| | | default: true, |
| | |
| | | style="margin-right: 10px;"> |
| | | 卡片视图 |
| | | </el-button> |
| | | <el-button type="primary" |
| | | <el-button v-if="editable" |
| | | type="primary" |
| | | @click="handleAdd">新增</el-button> |
| | | </div> |
| | | </div> |
| | |
| | | link |
| | | size="small" |
| | | @click="handleEdit(scope.row)" |
| | | :disabled="scope.row.isComplete">编辑</el-button> |
| | | :disabled="scope.row.isComplete || !editable">编辑</el-button> |
| | | <el-button type="danger" |
| | | link |
| | | size="small" |
| | | @click="handleDelete(scope.row)" |
| | | :disabled="scope.row.isComplete">删除</el-button> |
| | | :disabled="scope.row.isComplete || !editable">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | style="margin-right: 10px;"> |
| | | 表格视图 |
| | | </el-button> |
| | | <el-button type="primary" |
| | | <el-button v-if="editable" |
| | | type="primary" |
| | | @click="handleAdd">新增</el-button> |
| | | </div> |
| | | </div> |
| | |
| | | link |
| | | size="small" |
| | | @click="handleEdit(item)" |
| | | :disabled="item.isComplete">编辑</el-button> |
| | | :disabled="item.isComplete || !editable">编辑</el-button> |
| | | <el-button type="info" |
| | | link |
| | | size="small" |
| | |
| | | link |
| | | size="small" |
| | | @click="handleDelete(item)" |
| | | :disabled="item.isComplete">删除</el-button> |
| | | :disabled="item.isComplete || !editable">删除</el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | style="margin-top: 20px;"> |
| | | <div class="section-title">BOM 结构</div> |
| | | <div class="section-actions" |
| | | v-if="pageType === 'order'"> |
| | | v-if="pageType === 'order' && editable"> |
| | | <el-button v-if="!bomDataValue.isEdit" |
| | | type="primary" |
| | | @click="bomDataValue.isEdit = true"> |
| | |
| | | @confirm="handleProductSelect" |
| | | single /> |
| | | <!-- 参数列表对话框 --> |
| | | <!-- :editable="!routeInfo.status" --> |
| | | <ProcessParamListDialog v-model="showParamListDialog" |
| | | :title="`${currentProcess ? (currentProcess.processName || currentProcess.technologyOperationName || currentProcess.operationName) : ''} - 参数列表`" |
| | | :route-id="routeId" |
| | |
| | | :process="currentProcess" |
| | | :page-type="pageType" |
| | | :param-list="paramList" |
| | | :editable="editable" |
| | | @getsyncProcessParamItem="getsyncProcessParamItem" |
| | | @refresh="refreshParamList" /> |
| | | </div> |
| | |
| | | const routeId = computed(() => route.query.id); |
| | | const orderId = computed(() => route.query.orderId); |
| | | const pageType = computed(() => route.query.type); |
| | | const editable = computed(() => route.query.editable !== "false"); |
| | | |
| | | const tableLoading = ref(false); |
| | | const tableData = ref([]); |
| | |
| | | // 初始化拖拽排序 |
| | | const initSortable = () => { |
| | | destroySortable(); |
| | | if (!editable.value) return; |
| | | |
| | | if (viewMode.value === "table") { |
| | | // 表格视图的拖拽排序 |
| | |
| | | controls-position="right" |
| | | placeholder="输入实际数量" |
| | | style="width: 100%;" |
| | | :disabled="row.returned" |
| | | :disabled="row.returned || orderRow?.end" |
| | | @change="val => handleActualQtyChange(row, val)" /> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button type="warning" |
| | | <el-button v-if="!orderRow?.end" |
| | | type="warning" |
| | | :loading="materialReturnConfirming" |
| | | :disabled="!canOpenReturnSummary" |
| | | @click="openReturnSummaryDialog"> |
| | |
| | | value="3" /> |
| | | <el-option label="已取消" |
| | | value="4" /> |
| | | <el-option label="已结束" |
| | | value="5" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | |
| | | :tableLoading="tableLoading" |
| | | :row-class-name="tableRowClassName" |
| | | :isSelection="true" |
| | | :selectable="row => !row.endOrder" |
| | | @selection-change="handleSelectionChange" |
| | | @pagination="pagination"> |
| | | <template #completionStatus="{ row }"> |
| | |
| | | listProcessBom, |
| | | delProductOrder, |
| | | getProductOrderSource, |
| | | updateProductOrder, |
| | | } from "@/api/productionManagement/productionOrder.js"; |
| | | import { listMain as getOrderProcessRouteMain } from "@/api/productionManagement/productProcessRoute.js"; |
| | | import MaterialLedgerDialog from "@/views/productionManagement/productionOrder/components/MaterialLedgerDialog.vue"; |
| | |
| | | prop: "npsNo", |
| | | width: "150px", |
| | | }, |
| | | // 1.待开始、2.进行中、3.已完成、4.已取消 |
| | | // 1.待开始、2.进行中、3.已完成、4.已取消、5.已结束 |
| | | { |
| | | label: "状态", |
| | | prop: "status", |
| | |
| | | ? "进行中" |
| | | : val === 3 |
| | | ? "已完成" |
| | | : val === 5 |
| | | ? "已结束" |
| | | : "已取消", |
| | | formatType: val => |
| | | val === 1 |
| | |
| | | ? "warning" |
| | | : val === 3 |
| | | ? "success" |
| | | : "danger", |
| | | : val === 5 |
| | | ? "danger" |
| | | : "info", |
| | | }, |
| | | { |
| | | label: "产品名称", |
| | |
| | | label: "操作", |
| | | align: "center", |
| | | fixed: "right", |
| | | width: 260, |
| | | width: 280, |
| | | operation: [ |
| | | { |
| | | name: "工艺路线", |
| | |
| | | { |
| | | name: "绑定工艺路线", |
| | | type: "text", |
| | | showHide: row => !row.processRouteCode, |
| | | showHide: row => !row.processRouteCode && !row.endOrder, |
| | | clickFun: row => { |
| | | openBindRouteDialog(row, "add"); |
| | | }, |
| | |
| | | { |
| | | name: "更换工艺路线", |
| | | type: "text", |
| | | showHide: row => row.processRouteCode, |
| | | showHide: row => row.processRouteCode && !row.endOrder, |
| | | clickFun: row => { |
| | | openBindRouteDialog(row, "change"); |
| | | }, |
| | |
| | | name: "领料", |
| | | type: "text", |
| | | color: "#5EC7AB", |
| | | showHide: row => !row.endOrder, |
| | | clickFun: row => { |
| | | openMaterialDialog(row); |
| | | }, |
| | |
| | | name: "补料", |
| | | type: "text", |
| | | color: "#5EC7AB", |
| | | showHide: row => !row.endOrder, |
| | | clickFun: row => { |
| | | openMaterialSupplementDialog(row); |
| | | }, |
| | |
| | | { |
| | | name: "打印领料单", |
| | | type: "text", |
| | | color: "#409eff", |
| | | color: "#5EC7AB", |
| | | showHide: row => !row.endOrder, |
| | | clickFun: row => { |
| | | handlePrint(row); |
| | | }, |
| | |
| | | model: row.model, |
| | | }, |
| | | }); |
| | | }, |
| | | }, |
| | | { |
| | | name: "结束订单", |
| | | type: "text", |
| | | color: "red", |
| | | showHide: row => !row.endOrder, |
| | | clickFun: row => { |
| | | handleEndOrder(row); |
| | | }, |
| | | }, |
| | | ], |
| | |
| | | quantity: row.quantity || 0, |
| | | orderId, |
| | | type: "order", |
| | | editable: !row.endOrder, |
| | | }, |
| | | }); |
| | | } catch (e) { |
| | |
| | | }); |
| | | }; |
| | | |
| | | // 结束订单 |
| | | const handleEndOrder = row => { |
| | | ElMessageBox.confirm(`是否确认结束订单:${row.npsNo}?`, "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | const params = { |
| | | id: row.id, |
| | | endOrder: true, |
| | | }; |
| | | updateProductOrder(params).then(() => { |
| | | proxy.$modal.msgSuccess("结束订单成功"); |
| | | getList(); |
| | | }); |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | |
| | | const handleConfirmRoute = () => {}; |
| | | |
| | | onMounted(() => { |
| | |
| | | @refresh="getList" /> |
| | | <FileList v-if="fileDialogVisible" |
| | | v-model:visible="fileDialogVisible" |
| | | :editable="!currentWorkOrderRow?.endOrder" |
| | | :record-type="'production_operation_task'" |
| | | :record-id="currentWorkOrderId" /> |
| | | </div> |
| | |
| | | clickFun: row => { |
| | | showReportDialog(row); |
| | | }, |
| | | showHide: row => !row.endOrder, |
| | | disabled: row => { |
| | | if (row.planQuantity <= 0) return true; |
| | | if (!row.userIds) return false; |
| | |
| | | const printTransferCard = () => { |
| | | window.print(); |
| | | }; |
| | | const currentWorkOrderRow = ref(null); |
| | | |
| | | const openWorkOrderFiles = row => { |
| | | currentWorkOrderId.value = row.id; |
| | | currentWorkOrderRow.value = row; |
| | | fileDialogVisible.value = true; |
| | | }; |
| | | |