| | |
| | | :data="tableData" |
| | | border |
| | | :preserve-expanded-content="false" |
| | | :default-expand-all="true" |
| | | style="width: 100%" |
| | | > |
| | | <el-table-column type="expand"> |
| | |
| | | </el-form-item> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="diskQuantity" |
| | | label="盘数(盘)"> |
| | | <template #default="{ row, $index }"> |
| | | <el-form-item :prop="`dataList.${$index}.diskQuantity`" |
| | | :rules="[{ required: true, message: '请输入盘数', trigger: ['blur','change'] }]" |
| | | style="margin: 0"> |
| | | <el-input-number v-model="row.diskQuantity" |
| | | :min="0" |
| | | :precision="0" |
| | | :step="1" |
| | | controls-position="right" |
| | | style="width: 100%" |
| | | :disabled="!dataValue.isEdit" /> |
| | | </el-form-item> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" fixed="right" width="100"> |
| | | <template #default="{ row, $index }"> |
| | | <el-button type="danger" |
| | |
| | | </el-form> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="产品编码" prop="productCode" /> |
| | | <el-table-column label="BOM编号" prop="bomNo" /> |
| | | <el-table-column label="产品名称" prop="productName" /> |
| | | <el-table-column label="规格型号" prop="model" /> |
| | | <el-table-column label="单位" prop="unit" /> |
| | | </el-table> |
| | | |
| | | <product-select-dialog v-if="dataValue.showProductDialog" |
| | |
| | | } |
| | | }); |
| | | |
| | | // 从路由参数获取产品信息 |
| | | const routeBomNo = computed(() => route.query.bomNo || ''); |
| | | const routeProductName = computed(() => route.query.productName || ''); |
| | | const routeProductModelName = computed(() => route.query.productModelName || ''); |
| | | |
| | | const dataValue = reactive({ |
| | | dataList: [], |
| | |
| | | { |
| | | productName: "", |
| | | model: "", |
| | | unit: "", |
| | | productCode: "", |
| | | bomNo: "", |
| | | } |
| | | ]) |
| | | |
| | |
| | | |
| | | const fetchData = async () => { |
| | | const { data } = await queryList(routeId.value); |
| | | tableData[0].productName = data.productName; |
| | | tableData[0].model = data.model; |
| | | tableData[0].unit = data.unit; |
| | | tableData[0].productCode = data.productCode; |
| | | dataValue.dataList = data.productStructureList; |
| | | // 产品信息从路由参数获取,优先使用路由参数 |
| | | dataValue.dataList = data || []; |
| | | }; |
| | | |
| | | const fetchProcessOptions = async () => { |
| | |
| | | row[0].productName; |
| | | dataValue.dataList[dataValue.currentRowIndex].model = row[0].model; |
| | | dataValue.dataList[dataValue.currentRowIndex].productModelId = row[0].id; |
| | | dataValue.dataList[dataValue.currentRowIndex].unit = row[0].unit || ""; |
| | | dataValue.showProductDialog = false; |
| | | }; |
| | | |
| | |
| | | dataValue.loading = true; |
| | | if (valid) { |
| | | add({ |
| | | parentId: routeId.value, |
| | | bomId: routeId.value, |
| | | productStructureList: dataValue.dataList || [], |
| | | }).then(res => { |
| | | router.push({ |
| | |
| | | unitQuantity: 0, |
| | | demandedQuantity: 0, |
| | | unit: "", |
| | | diskQuantity: 0, |
| | | }); |
| | | }; |
| | | |