songshankun
2023-10-19 fbe9459ed908eef6c25c3bcd244d0a7e74dfa792
src/views/productManage/product/AddProductDialog.vue
@@ -1,14 +1,14 @@
<template>
  <div class="add-common">
    <el-dialog
      :title="editCommonConfig.title + '产品'"
      :title="modalTitle + '产品'"
      :visible.sync="editConfig.visible"
      :width="dialogWidth"
      :before-close="handleClose"
    >
      <!-- 头 -->
      <div slot="title" class="dialog-header">
        <span>{{ editCommonConfig.title + "产品" }}</span>
        <span>{{ modalTitle + "产品" }}</span>
        <div class="header_btns">
          <span class="btn">
            <i class="el-icon-printer"></i>
@@ -474,13 +474,24 @@
        return {
          visible: false,
          title: "新建",
          infomation: {}
          infomation: {},
          autoEdit:false
        }
      }
    }
  },
  components: {},
  computed: {},
  computed: {
    modalTitle(){
      if (this.editConfig.title === '编辑' && this.editConfig.autoEdit){
        return '编辑'
      }else if (this.editConfig.title === '编辑') {
        return !this.showEdit ? '编辑' : '查看'
      }else {
        return '新建'
      }
    }
  },
  data() {
    return {
      dialogWidth: "50%",
@@ -538,6 +549,9 @@
    this.setTableForm()
    this.setBottonView()
    this.statisticsMap.inLibrary = this.editConfig?.infomation?.amount ?? 0
    if (this.editConfig.autoEdit){
      this.editClick()
    }
  },
  methods: {
    // 获取产品类别