huminmin
10 小时以前 8f9e65a587ee29b607010f83025456ee28c9b0d6
src/views/productionManagement/productStructure/StructureEdit.vue
@@ -19,6 +19,15 @@
               @click="cancelEdit"
               style="margin-bottom: 10px">取消
    </el-button>
    <el-table
        :data="tableData"
        border
        :preserve-expanded-content="false"
        style="width: 100%"
    >
      <el-table-column type="expand">
        <template #default="props">
    <el-form ref="form"
             :model="dataValue">
      <el-table :data="dataValue.dataList"
@@ -143,6 +152,14 @@
        </el-table-column>
      </el-table>
    </el-form>
        </template>
      </el-table-column>
      <el-table-column label="产品编码" prop="productCode" />
      <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"
                           v-model:model-value="dataValue.showProductDialog"
                           @confirm="handleProduct" />
@@ -187,8 +204,8 @@
      type: Boolean,
      default: false,
    },
    productModelId: {
      type: Number,
    record: {
      type: Object,
      required: true,
    },
  });
@@ -213,18 +230,27 @@
    isEdit: false,
  });
  const tableData = [
    {
      productName: props.record.productName,
      model: props.record.model,
      unit: props.record.unit,
      productCode: props.record.productCode,
    }
  ]
  const openDialog = index => {
    dataValue.currentRowIndex = index;
    dataValue.showProductDialog = true;
  };
  const fetchData = async () => {
    const { data } = await queryList(props.productModelId);
    const { data } = await queryList(props.record.id);
    dataValue.dataList = data;
  };
  const fetchProcessOptions = async () => {
    const { data } = await list(props.productModelId);
    const { data } = await list(props.record.id);
    dataValue.processOptions = data;
  };
@@ -245,7 +271,7 @@
        dataValue.loading = true;
        if (valid) {
          add({
            parentId: props.productModelId,
            parentId: props.record.id,
            productStructureList: dataValue.dataList || [],
          }).then(res => {
            ElMessage.success("保存成功");