huminmin
9 小时以前 8f9e65a587ee29b607010f83025456ee28c9b0d6
修改产品结构详情
已修改2个文件
42 ■■■■ 文件已修改
src/views/productionManagement/productStructure/StructureEdit.vue 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/productStructure/index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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("保存成功");
src/views/productionManagement/productStructure/index.vue
@@ -15,14 +15,14 @@
            type="primary"
            text
            @click="() =>{
              currentRowId = row.id;
              currentRow = row;
              showEdit = true;
            }"
        >{{ row.productName }}
        </el-button>
      </template>
    </PIMTable>
    <StructureEdit v-if="showEdit" v-model:show-model="showEdit" :product-model-id="currentRowId"/>
    <StructureEdit v-if="showEdit" v-model:show-model="showEdit" :record="currentRow"/>
  </div>
</template>
@@ -57,7 +57,7 @@
const tableLoading = ref(false);
const showEdit = ref(false);
const selectedRows = ref([]);
const currentRowId = ref(0);
const currentRow = ref({});
const page = reactive({
  current: 1,
  size: 10,