| | |
| | | class="section-header"> |
| | | <div class="section-title">工艺路线项目列表</div> |
| | | <div class="section-actions"> |
| | | <div class="sort-tip">拖拽表格排序</div> |
| | | <div v-if="!routeInfo.status" |
| | | class="sort-tip">拖拽表格排序</div> |
| | | <el-button icon="Grid" |
| | | @click="toggleView" |
| | | style="margin-right: 10px;"> |
| | | 卡片视图 |
| | | </el-button> |
| | | <el-button type="primary" |
| | | <el-button v-if="!routeInfo.status" |
| | | type="primary" |
| | | @click="handleAdd">新增</el-button> |
| | | </div> |
| | | </div> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" |
| | | v-if="!routeInfo.status" |
| | | align="center" |
| | | fixed="right" |
| | | width="150"> |
| | |
| | | <div class="section-header"> |
| | | <div class="section-title">工艺路线项目列表</div> |
| | | <div class="section-actions"> |
| | | <div class="sort-tip">长按拖拽卡片排序</div> |
| | | <div v-if="!routeInfo.status" |
| | | class="sort-tip">长按拖拽卡片排序</div> |
| | | <el-button icon="Menu" |
| | | @click="toggleView" |
| | | style="margin-right: 10px;"> |
| | | 表格视图 |
| | | </el-button> |
| | | <el-button type="primary" |
| | | v-if="!routeInfo.status" |
| | | @click="handleAdd">新增</el-button> |
| | | </div> |
| | | </div> |
| | |
| | | <el-button type="primary" |
| | | link |
| | | size="small" |
| | | v-if="!routeInfo.status" |
| | | @click="handleEdit(item)" |
| | | :disabled="item.isComplete">编辑</el-button> |
| | | <el-button type="info" |
| | |
| | | <el-button type="danger" |
| | | link |
| | | size="small" |
| | | v-if="!routeInfo.status" |
| | | @click="handleDelete(item)" |
| | | :disabled="item.isComplete">删除</el-button> |
| | | </div> |
| | |
| | | <div class="section-header"> |
| | | <div class="section-title">BOM</div> |
| | | <div class="section-actions" |
| | | v-if="pageType === 'order'"> |
| | | v-if="pageType === 'order' && !routeInfo.status"> |
| | | <el-button type="primary" |
| | | @click="toggleBomEdit"> |
| | | {{ bomDataValue.isEdit ? '取消' : '编辑' }} |
| | |
| | | :disabled="!bomDataValue.isEdit" /> |
| | | </el-form-item> |
| | | <span v-else>{{ row.unit }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="unitPrice" |
| | | label="单价"> |
| | | <template #default="{ row }"> |
| | | <el-form-item v-if="bomDataValue.isEdit" |
| | | style="margin: 0"> |
| | | <el-input-number v-model="row.unitPrice" |
| | | :min="0" |
| | | :step="1" |
| | | controls-position="right" |
| | | style="width: 100%" |
| | | :disabled="!bomDataValue.isEdit" /> |
| | | </el-form-item> |
| | | <span v-else>{{ row.unitPrice }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" |
| | |
| | | <ProcessParamListDialog v-model="showParamListDialog" |
| | | :title="`${currentProcess ? getProcessName(currentProcess.processId) : ''} - 参数列表`" |
| | | :route-id="routeId" |
| | | :editable="editable" |
| | | :editable="editable && !routeInfo.status" |
| | | :order-id="orderId" |
| | | :process="currentProcess" |
| | | :page-type="pageType" |
| | |
| | | const submitLoading = ref(false); |
| | | const cardsContainer = ref(null); |
| | | const tableRef = ref(null); |
| | | const viewMode = ref("table"); // table | card |
| | | const viewMode = ref("card"); // table | card |
| | | const routeInfo = ref({ |
| | | processRouteCode: "", |
| | | productName: "", |
| | |
| | | |
| | | // 获取工序列表 |
| | | const getProcessList = () => { |
| | | processList({}) |
| | | processList({ dateType: 1 }) |
| | | .then(res => { |
| | | processOptions.value = res.data || []; |
| | | }) |
| | |
| | | dictLabel: route.query.dictLabel || "", |
| | | bomId: route.query.bomId || null, |
| | | description: route.query.description || "", |
| | | status: !(route.query.status == 1 || route.query.status === "false"), |
| | | }; |
| | | if (pageType.value === "order") { |
| | | queryList2(route.query.orderId) |
| | |
| | | processId: "", |
| | | processName: "", |
| | | unitQuantity: 0, |
| | | unitPrice: 0, |
| | | unit: "", |
| | | children: [], |
| | | tempId: new Date().getTime(), |
| | |
| | | processId: "", |
| | | processName: "", |
| | | unitQuantity: 0, |
| | | unitPrice: 0, |
| | | unit: "", |
| | | children: [], |
| | | tempId: new Date().getTime(), |
| | |
| | | ElMessage.error("请填写单位产出所需数量"); |
| | | return false; |
| | | } |
| | | // 校验单价是否必填 |
| | | if ( |
| | | item.unitPrice === undefined || |
| | | item.unitPrice === null || |
| | | item.unitPrice === 0 |
| | | ) { |
| | | ElMessage.error("请填写单价"); |
| | | return false; |
| | | } |
| | | // 递归校验子项 |
| | | if (item.children && item.children.length > 0) { |
| | | if (!validateBomData(item.children)) { |
| | |
| | | productModelId: item.productModelId || null, |
| | | processId: item.processId || null, |
| | | unitQuantity: item.unitQuantity || 0, |
| | | unitPrice: item.unitPrice || 0, |
| | | demandedQuantity: item.demandedQuantity || null, |
| | | unit: item.unit || "", |
| | | tempId: item.tempId || new Date().getTime(), |
| | |
| | | |
| | | // 初始化拖拽排序 |
| | | const initSortable = () => { |
| | | if (routeInfo.value.status) return; |
| | | destroySortable(); |
| | | |
| | | if (viewMode.value === "table") { |