소스 검색

'产品相关接口调试'

zhangyu 4 년 전
부모
커밋
6f6cbe47ed

+ 9 - 4
src/components/brand/detail/sagaBrandDetail.vue

@@ -96,15 +96,18 @@
       },
       getProductList() {
         let params = {
+          GroupId: this.dictionary.groupId,
+          Type: this.dictionary.dictionaryType,
+          ProjectId: this.dictionary.projectId,
           Filters: `BrandID='${this.$route.query.BrandID}'`
         }
         prodTypeQuery(params, res => {
           this.total = res.Total
-          this.table = res.Content.map(i => ({...i, brandName: this.$route.query.BrandCname}))
+          this.table = res.Content.map(i => ({...i, Brand: this.$route.query}))
         })
       },
       deleteProdType(val) {
-        let {brandName, ...params} = val
+        let {Brand, ...params} = val
         prodTypeDelete([params], res => {
           this.$message.success('删除成功')
           this.getProductList()
@@ -131,12 +134,14 @@
           }
         }
         let params = {
+          GroupId: this.dictionary.groupId,
+          Type: this.dictionary.dictionaryType,
+          ProjectId: this.dictionary.projectId,
           Filters: `prodCode='${val.Code}';BrandID='${this.$route.query.BrandID}'`
         }
         prodTypeQuery(params, res => {
           this.total = res.Total
-          this.table = res.Content.map(i => ({...i, brandName: this.$route.query.BrandCname}))
-
+          this.table = res.Content.map(i => ({...i, Brand: this.$route.query}))
         })
       },
       deleteCurrent(index) {

+ 2 - 2
src/components/brand/sagaBrand.vue

@@ -2,7 +2,7 @@
  * @Author: zhangyu
  * @Date: 2020-05-08 16:06:03
  * @Info:
- * @LastEditTime: 2020-05-18 10:27:15
+ * @LastEditTime: 2020-05-25 11:28:07
  -->
 <template>
   <div class="saga-brand-box" ref="brandBox">
@@ -122,7 +122,7 @@ export default {
       } else {
         console.log('跳转到产品页面')
         console.log(brand)
-        this.$router.push({path: 'brand/brandDetail', query: {BrandCname: brand.BrandCname, BrandID:brand.BrandID, BrandName: brand.BrandID}})
+        this.$router.push({path: 'brand/brandDetail', query: brand})
       }
     },
     handleClickLetter(e) { //点击字母锚点

+ 9 - 3
src/components/product/detail/sagaProductDetail.vue

@@ -160,15 +160,18 @@
           "Cascade": [
             {"Name": "brand"}
           ],
+          GroupId: this.dictionary.groupId,
+          Type: this.dictionary.dictionaryType,
+          ProjectId: this.dictionary.projectId,
           Filters: `prodCode='${this.$route.query.code}'`
         }
         prodTypeQuery(params, res => {
           this.total = res.Total
-          this.table = res.Content.map(i => ({...i, brandName: i.Brand.BrandCname}))
+          this.table = res.Content
         })
       },
       deleteProdType(val) {
-        let {brandName, ...params} = val
+        let {Brand, ...params} = val
         prodTypeDelete([params], res => {
           this.$message.success('删除成功')
           this.getDate()
@@ -223,12 +226,15 @@
             "Cascade": [
               {"Name": "brand"}
             ],
+            GroupId: this.dictionary.groupId,
+            Type: this.dictionary.dictionaryType,
+            ProjectId: this.dictionary.projectId,
             Filters: `prodCode='${this.$route.query.code}';(${str})`
 
           }
           prodTypeQuery(params, res => {
             this.total = res.Total
-            this.table = res.Content.map(i => ({...i, brandName: i.Brand.BrandCname}))
+            this.table = res.Content
           })
         } else {
           this.getProductList()

+ 8 - 6
src/components/public/detailTable.vue

@@ -1,8 +1,12 @@
 <template>
   <div>
     <el-table :data="table" style="width: 100%" :header-cell-style="{background:'#F6F6F6',color:'#646A73'}">
-      <el-table-column prop="ProdCname" label="产品类型" align="center"/>
-      <el-table-column prop="brandName" label="品牌" align="center"/>
+      <el-table-column prop="prodCname" label="产品类型" align="center"/>
+      <el-table-column label="品牌" align="center">
+        <template slot-scope="scope">
+          {{ `${scope.row.Brand.BrandCname}${scope.row.Brand.BrandName?`(${scope.row.Brand.BrandName})`:''}` }}
+        </template>
+      </el-table-column>
       <el-table-column prop="Model" label="型号" align="center"/>
       <el-table-column label="管理" align="center">
         <template slot-scope="scope">
@@ -18,7 +22,6 @@
           </el-button>
         </template>
       </el-table-column>
-
     </el-table>
     <el-dialog
       title="提示"
@@ -46,10 +49,9 @@
     },
     methods: {
       handleEdit(index, row) {
-        let {brandName, ...params} = row
         this.$router.push({
-          path: '/supplement',
-          query: params
+          name: 'supplement',
+          params: row
         })
       },
       handleDelete(index, row) {

+ 157 - 169
src/components/public/uploadFiles.vue

@@ -1,12 +1,6 @@
 <template>
-
   <div id="uploadFile">
-    <el-upload
-      class="upload-file"
-      action
-      drag
-      :show-file-list="false"
-      :http-request="uploadAndSubmit">
+    <el-upload class="upload-file" action drag :show-file-list="false" :http-request="uploadAndSubmit">
       <i class="el-icon-upload"></i>
       <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
     </el-upload>
@@ -14,186 +8,180 @@
       <p class="file-list">
         <span class="file-name" :title="item.Name">{{item.Name}}</span>
         <!-- <i title="下载" class="el-icon-download" style="margin-left:10px; cursor:pointer" @click="download(item)"></i>-->
-        <span v-if="!readOnly"
-              title="删除"
-              class="el-icon-circle-close file-icon"
-              @click="deleteFile(index,item)"></span>
+        <span v-if="!readOnly" title="删除" class="el-icon-circle-close file-icon" @click="deleteFile(index,item)"></span>
       </p>
     </div>
   </div>
-
 </template>
 
 <script>
-  import tools from "@/utils/tools";
-
-  export default {
-    props: {
-      keysArr: {
-        type: [Array, String],
-        default: function () {
-          return []
-        }
-      },
-      readOnly: {
-        type: Boolean,
-        default: false
-      },
-      defined: null,
-
-
-    },
-    data() {
-      return {
-        filesArr: [],
+import tools from "@/utils/tools";
+
+export default {
+props: {
+  keysArr: {
+    type: [Array, String],
+    default: function () {
+      return []
+    }
+  },
+  readOnly: {
+    type: Boolean,
+    default: false
+  },
+  defined: String,
+},
+data() {
+  return {
+    filesArr: [],
+  };
+},
+created() {
+  this.fileFalg()
+  // this.resetFile()
+},
+computed: {},
+methods: {
+  //判断是否为空
+  fileFalg() {
+    let type = typeof (this.keysArr)
+    if (type == 'string') {
+      this.filesArr = [this.keysArr]
+    } else {
+      this.filesArr = tools.deepCopy(this.keysArr)
+    }
+    this.filesArr = tools.deepCopy(this.keysArr)
+    if (!this.keysArr) {
+      this.filesArr = []
+    }
+  },
+  resetFile() {
+    this.filesArr = []
+  },
+
+
+  //点击下载
+  // download(item) {
+  //   if (item.Key) {
+  //     let a = document.createElement("a");
+  //     a.href = `/image-service/common/file_get/${item.Key}?systemId=dataPlatform`;
+  //     a.download = `${item.Name}`;
+  //     a.click();
+  //     document.body.removeChild(a);
+  //   } else {
+  //     this.$message({
+  //       message: "无该获取该文件资源链接!",
+  //       type: "error"
+  //     });
+  //   }
+  // },
+
+  //删除图片
+  deleteFile(i, key) {
+    this.filesArr.splice(i, 1);
+    this.$emit("change", this.filesArr, this.defined);
+  },
+
+  //上传
+  uploadAndSubmit(item) {
+    let file = item.file;
+    let size = item.file.size;
+    if (size > 50 * 1024 * 1024) { //文件大于50M
+      this.$message.error('文件不可大于50M,请重新上传')
+      return false
+    } else {
+      let reader = new FileReader();
+      let vm = this;
+      let fileType = file.name.split(".");
+      let type = fileType[fileType.length - 1];
+      let key = "&key=" + fileType[0] + file.uid + "." + type
+      // let CreateTime = tools.formatDate(new Date(file.lastModified))
+      reader.onloadstart = function () {
+        // 这个事件在读取开始时触发
+      };
+      reader.onprogress = function (p) {
+        // 这个事件在读取进行中定时触发
+        let value = (p.loaded / size) * 100;
       };
-    },
-    created() {
-      this.fileFalg()
-      // this.resetFile()
-    },
-    computed: {},
-    methods: {
-      //判断是否为空
-      fileFalg() {
-        let type = typeof (this.keysArr)
-        if (type == 'string') {
-          this.filesArr = [this.keysArr]
-        } else {
-          this.filesArr = tools.deepCopy(this.keysArr)
-        }
-        this.filesArr = tools.deepCopy(this.keysArr)
-        if (!this.keysArr) {
-          this.filesArr = []
-        }
-      },
-      resetFile() {
-        this.filesArr = []
-      },
-
-
-      //点击下载
-      // download(item) {
-      //   if (item.Key) {
-      //     let a = document.createElement("a");
-      //     a.href = `/image-service/common/file_get/${item.Key}?systemId=dataPlatform`;
-      //     a.download = `${item.Name}`;
-      //     a.click();
-      //     document.body.removeChild(a);
-      //   } else {
-      //     this.$message({
-      //       message: "无该获取该文件资源链接!",
-      //       type: "error"
-      //     });
-      //   }
-      // },
-
-      //删除图片
-      deleteFile(i, key) {
-        this.filesArr.splice(i, 1);
-        this.$emit("change", this.filesArr, this.defined);
-      },
 
-      //上传
-      uploadAndSubmit(item) {
-        let file = item.file;
-        let size = item.file.size;
-        if (size > 50 * 1024 * 1024) { //文件大于50M
-          this.$message.error('文件不可大于50M,请重新上传')
-          return false
+      reader.onload = function () {
+        // 这个事件在读取成功结束后触发
+      };
+      reader.onloadend = function () {
+        // 这个事件在读取结束后,无论成功或者失败都会触发
+        if (reader.error) {
         } else {
-          let reader = new FileReader();
-          let vm = this;
-          let fileType = file.name.split(".");
-          let type = fileType[fileType.length - 1];
-          let key = "&key=" + fileType[0] + file.uid + "." + type
-          // let CreateTime = tools.formatDate(new Date(file.lastModified))
-          reader.onloadstart = function () {
-            // 这个事件在读取开始时触发
-          };
-          reader.onprogress = function (p) {
-            // 这个事件在读取进行中定时触发
-            let value = (p.loaded / size) * 100;
-          };
-
-          reader.onload = function () {
-            // 这个事件在读取成功结束后触发
-          };
-          reader.onloadend = function () {
-            // 这个事件在读取结束后,无论成功或者失败都会触发
-            if (reader.error) {
-            } else {
-              // document.getElementById("bytesRead").textContent = file.size;
-              // 构造 XMLHttpRequest 对象,发送文件 Binary 数据
-              var xhr = new XMLHttpRequest();
-              xhr.open(
-                /* method */
-                "POST",
-                /* target url */
-                "/image-service/common/file_upload?systemId=dataPlatform&secret=9e0891a7a8c8e885&overwrite=true" + key
-                /*, async, default to true */
-              );
-              //xhr.overrideMimeType("application/octet-stream");
-              xhr.send(reader.result);
-              xhr.onreadystatechange = function () {
-                if (xhr.readyState == 4) {
-                  console.log(xhr)
-                  if (xhr.status == 200) {
-                    let fileObject = {
-                      Key: key.split("=")[1],
-                      Type: type,
-                      Name: file.name,
-                      // CreateTime,
-                      SystemId: 'dataPlatform'
-                    }
-
-                    vm.filesArr.push(fileObject);
-                    vm.$emit("change", vm.filesArr, vm.defined);
-                  } else {
-                    this.$message.error(res.data.ResultMsg)
-                  }
+          // document.getElementById("bytesRead").textContent = file.size;
+          // 构造 XMLHttpRequest 对象,发送文件 Binary 数据
+          var xhr = new XMLHttpRequest();
+          xhr.open(
+            /* method */
+            "POST",
+            /* target url */
+            "/image-service/common/file_upload?systemId=dataPlatform&secret=9e0891a7a8c8e885&overwrite=true" + key
+            /*, async, default to true */
+          );
+          //xhr.overrideMimeType("application/octet-stream");
+          xhr.send(reader.result);
+          xhr.onreadystatechange = function () {
+            if (xhr.readyState == 4) {
+              console.log(xhr)
+              if (xhr.status == 200) {
+                let fileObject = {
+                  Key: key.split("=")[1],
+                  Type: type,
+                  Name: file.name,
+                  // CreateTime,
+                  SystemId: 'dataPlatform'
                 }
-              };
+
+                vm.filesArr.push(fileObject);
+                vm.$emit("change", vm.filesArr, vm.defined);
+              } else {
+                this.$message.error(res.data.ResultMsg)
+              }
             }
           };
-          reader.readAsArrayBuffer(file);
         }
-
-      }
-    },
-    watch: {
-      keysArr: function (val) {
-        this.fileFalg()
-      }
+      };
+      reader.readAsArrayBuffer(file);
     }
-  };
+
+  }
+},
+watch: {
+  keysArr: function (val) {
+    this.fileFalg()
+  }
+}
+};
 </script>
 <style lang="less" scoped>
-  #uploadFile {
-    .file-list {
-      border: 1px solid #E9E9E9;
-      height: 48px;
-      width: 360px;
-      line-height: 48px;
-      border-radius: 4px;
-      margin-bottom: 10px;
-
-      .file-name {
-        display: inline-block;
-        margin-left: 10px;
-        width: 300px;
-        overflow: hidden;
-        text-overflow: ellipsis;
-        white-space: nowrap;
-      }
+#uploadFile {
+  .file-list {
+    border: 1px solid #e9e9e9;
+    height: 48px;
+    width: 360px;
+    line-height: 48px;
+    border-radius: 4px;
+    margin-bottom: 10px;
+
+    .file-name {
+      display: inline-block;
+      margin-left: 10px;
+      width: 300px;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      white-space: nowrap;
+    }
 
-      .file-icon {
-        float: right;
-        cursor: pointer;
-        line-height: 48px;
-        margin-right: 15px
-      }
+    .file-icon {
+      float: right;
+      cursor: pointer;
+      line-height: 48px;
+      margin-right: 15px;
     }
   }
+}
 </style>
 

+ 82 - 48
src/components/supplement/sagaSupplement.vue

@@ -31,8 +31,8 @@
         </section>
         <section class="d_jump">
           <p class="title"><i class="iconfont iconjuxing" style="color:#3A8DDE;"></i>技术参数</p>
-          <template v-for="(item,index) in TechnicalData">
-            <el-form-item :label="item.Name">
+          <template v-for="item in TechnicalData">
+            <el-form-item :label="item.Name" :key="item.Code">
               <el-input
                 v-if="item.InputMode == 'B1' || item.InputMode == 'B2'"
                 v-model="ruleForm.ProdParam[item.Code]"/>
@@ -45,20 +45,32 @@
               </el-input>
 
               <el-select
-                v-else-if="item.InputMode == 'D1' || item.InputMode == 'E2'"
+                v-else-if="item.InputMode == 'D1' || item.InputMode == 'E2' || item.InputMode == 'D1L'"
                 placeholder="请选择"
-                v-model="ruleForm.ProdParam[item.Code]">
-                <el-option :key="op.Name" :label="op.Name" :value="op.Code" v-for="op in item.options"></el-option>
+                v-model="ruleForm.ProdParam[item.Code]"
+                clearable>
+                <el-option :key="`${item.Code}-${op.code}`" :label="op.name" :value="op.code" v-for="op in item.DataSource"></el-option>
               </el-select>
 
-              <!--              <el-select-->
-              <!--                v-else-if="item.InputMode == 'D2'"-->
-              <!--                placeholder="请选择"-->
-              <!--                v-model="ruleForm.ProdParam[item.Code]"-->
-              <!--                multiple-->
-              <!--                collapse-tags>-->
-              <!--                <el-option :key="op.Name" :label="op.Name" :value="op.Code" v-for="op in item.options"></el-option>-->
-              <!--              </el-select>-->
+              <el-select
+                v-else-if="item.InputMode == 'D2'"
+                placeholder="请选择"
+                v-model="ruleForm.ProdParam[item.Code]"
+                clearable
+                multiple
+                collapse-tags>
+                <el-option :key="`${item.Code}-${op.code}`" :label="op.name" :value="op.code" v-for="op in item.DataSource"></el-option>
+              </el-select>
+
+              <el-select
+                v-else-if="item.InputMode == 'D3'"
+                placeholder="请选择"
+                v-model="ruleForm.ProdParam[item.Code]"
+                clearable
+                multiple
+                collapse-tags>
+                <el-option :key="`${item.Code}-${op.code}`" :label="op.name" :value="op.code" v-for="op in item.DataSource"></el-option>
+              </el-select>
 
               <el-date-picker
                 v-else-if="item.InputMode == 'C6'"
@@ -69,7 +81,7 @@
                 start-placeholder="开始日期"
                 end-placeholder="结束日期"/>
 
-              <el-cascader
+              <!-- <el-cascader
                 v-else-if="item.InputMode == 'D1L'"
                 placeholder="请选择"
                 :options="item.options"
@@ -78,7 +90,7 @@
                 filterable
                 :show-all-levels="false"
                 clearable
-                style="width: 200px"/>
+                style="width: 200px"/> -->
 
               <el-input
                 v-else-if="item.InputMode == 'L'||item.InputMode == 'L1'||item.InputMode == 'L2'||item.InputMode == 'M'"
@@ -97,17 +109,14 @@
 
             </el-form-item>
           </template>
-
-
         </section>
         <section class="d_jump">
           <p class="title"><i class="iconfont iconjuxing" style="color:#3A8DDE;"></i>附件信息</p>
-          <template v-for="(item,index) in AttachmentInfo">
-            <el-form-item :label="item.Name">
-              <uploadFiles :readOnly="read" :keysArr="keysArr" @change="changeItem" v-model="ruleForm.ProdFile[item.Code]"/>
+          <template v-for="item in AttachmentInfo">
+            <el-form-item :label="item.Name" :key="item.Code">
+              <uploadFiles :readOnly="read" :defined="item.Code" :keysArr="ruleForm.ProdFile[item.Code]" @change="changeItem"/>
             </el-form-item>
           </template>
-
         </section>
       </el-form>
     </div>
@@ -116,9 +125,9 @@
 
 <script>
   import uploadFiles from "@/components/public/uploadFiles"
-  import {defFuncidQuery, prodRecordQuery} from "@/api/product"
-  import {brandQueryByKeyword, brandRecordQuery} from "@/api/brand"
-  import {mapGetters} from "vuex"
+  import { prodTypeCreate, prodTypeUpdate, defFuncidQuery, prodRecordQuery } from "@/api/product"
+  import { brandQueryByKeyword, brandRecordQuery } from "@/api/brand"
+  import { mapGetters } from "vuex"
 
   export default {
     components: {uploadFiles},
@@ -127,7 +136,6 @@
       this.getBrandNum5()
     },
     mounted() {
-      console.log(this.$route.query)
       let listener = document.querySelector('.saga-brand-box')
       listener.addEventListener('scroll', this.onScroll)
     },
@@ -143,16 +151,15 @@
         TechnicalData: [],
         AttachmentInfo: [],
         read: false,
-        keysArr: [],
         loading: false,
-        bbs: [],
+        defaultBrandList: [],
         brandList: [],
         productList: [],
         stepActive: '0',
         tabPosition: 'left',
         ruleForm: {
           ProdCode: '',
-          BrandID: [],
+          BrandID: '',
           Model: '',
           ProdParam: {},
           ProdFile: {},
@@ -189,18 +196,26 @@
           }
         })
         this.productList = res.Content
+        if (this.$route.params.ProdID) {//如果是修改,加载信息点
+          this.handleChangeProduct(this.$route.params.ProdCode)
+        }
       })
     },
-    getBrandNum5() {// 获取最新创建过产品型号的5个品牌
-      let params = {
-        Type: this.dictionary.dictionaryType,
-        GroupId: this.dictionary.groupId,
-        ProjectId: this.dictionary.projectId,
+    getBrandNum5() {// 获取最新创建过产品型号的5个品牌(如果是修改的话只显示修改产品的品牌)
+      if (this.$route.params.ProdID) {
+        this.defaultBrandList = [this.$route.params.Brand]
+        this.brandList = [this.$route.params.Brand]
+      } else {
+        let params = {
+          Type: this.dictionary.dictionaryType,
+          GroupId: this.dictionary.groupId,
+          ProjectId: this.dictionary.projectId,
+        }
+        brandRecordQuery(params, res => {
+          this.defaultBrandList = res.Content
+          this.brandList = res.Content
+        })
       }
-      brandRecordQuery(params, res => {
-        this.bbs = res.Content
-        this.brandList = res.Content
-      })
     },
     handleChangeProduct(item) {// 切换产品类型
       let param = {
@@ -211,16 +226,27 @@
       }
       defFuncidQuery(param, res => {
         this.TechnicalData = []
-        res.Content.TechnicalData.forEach(i => {
-          for (let key in i) {
-            i[key].forEach(i => this.TechnicalData.push(i))
+        this.ruleForm.ProdParam = {}
+        this.ruleForm.ProdFile = {}
+        res.Content.TechnicalData.forEach(group => {
+          for (let key in group) {
+            group[key].forEach(i => {
+              if (i.DataType == 'ENUM' || i.DataType == 'MENUM') {
+                i.DataSource = JSON.parse(i.DataSource)
+              }
+              this.TechnicalData.push(i)
+            })
           }
         })
         this.AttachmentInfo = res.Content.AttachmentInfo
+        if (this.$route.params.ProdID) {//判断是否是修改,回显修改内容
+          let {Brand, ProdID, prodCname, ...ruleForm} = this.$route.params
+          this.ruleForm = Object.assign(this.ruleForm, ruleForm)
+        }
       })
     },
     handleChangeBrand(item) {// 切换品牌
-      debugger
+      console.log(item)
     },
     jump(tab, event) {
       this.stepActive = tab.index
@@ -264,11 +290,10 @@
         if (jump[i].offsetTop >= scrolled) {
           this.stepActive = i.toString()
           break
-
         }
       }
     },
-    remoteMethods(query) {
+    remoteMethods(query) {// 品牌搜索(显示50条)
       if (query !== '') {
         this.loading = true
         brandQueryByKeyword({keyword: query, PageSize: 50,}, res => {
@@ -276,23 +301,32 @@
           this.brandList = res.Content
         })
       } else {
-        this.brandList = this.bbs
+        this.brandList = this.defaultBrandList
       }
     },
     submitForm() {
       this.$refs.ruleForm.validate((valid) => {
         if (valid) {
           console.log(this.ruleForm);
-          debugger
+          if (this.$route.params.ProdID) {//修改
+            prodTypeUpdate({ProdID:this.$route.params.ProdID, ...this.ruleForm}, res => {
+              this.$message.success('修改成功!')
+              this.$router.go(-1)
+            })
+          } else {//添加
+            prodTypeCreate(this.ruleForm, res => {
+              this.$message.success('创建成功!')
+              this.$router.push('/product')
+            })
+          }
         } else {
           console.log('error submit!!');
           return false;
         }
       });
     },
-    changeItem(file) {
-      let arr = []
-      file.forEach(({ Key }) => arr.push({ Key }))
+    changeItem(files, code) {
+      this.ruleForm.ProdFile[code] = files
     }
   },
   watch: {}

+ 47 - 55
src/components/supplement/supplementTool.vue

@@ -3,75 +3,67 @@
     <div class="saga-toolbar-main">
       <p class="supplement-title"><i class="iconfont iconjuxing" style="color:#3A8DDE;"></i>添加产品</p>
       <span class="fr">
-      <el-button>取消</el-button>
-      <el-button type="primary" @click="addProduct">创建</el-button>
-      <el-button type="primary">创建并继续</el-button>
+      <el-button @click="handleClickCancel">取消</el-button>
+      <el-button type="primary" @click="addProduct">{{isUpdate?'保存':'创建'}}</el-button>
+      <el-button v-show="!isUpdate" type="primary">创建并继续</el-button>
       </span>
     </div>
-
-
   </div>
 </template>
 
 <script>
-
-
-  export default {
-
-
-    created() {
-    },
-    mounted() {
+export default {
+  created() {
+    this.isUpdate = this.$route.query.BrandID? true: false
+  },
+  mounted() {},
+  data() {
+    return {
+      isUpdate: false
+    }
+  },
+  methods: {
+    addProduct() {
+      this.$emit('addProduct')
     },
-    data() {
-      return {}
+    handleClickCancel() {//取消
+      this.$router.go(-1)
     },
-    methods: {
-      addProduct() {
-        this.$emit('addProduct')
-      }
-    }
   }
+}
 </script>
 <style lang="scss" scoped>
-  .saga-toolbar-box {
-    position: absolute;
-    top: 48px;
-    left: 0;
-    width: 100%;
-    height: 70px;
-    background: #fff;
-    box-shadow: 0px 0px 4px 0px rgba(0,0,0,0.5);
-    z-index: 11;
-
-    .saga-toolbar-main {
-      width: 1200px;
-      height: 100%;
-      margin: auto;
-      padding-top: 20px;
-
-    }
+.saga-toolbar-box {
+  position: absolute;
+  top: 48px;
+  left: 0;
+  width: 100%;
+  height: 70px;
+  background: #fff;
+  box-shadow: 0px 0px 4px 0px rgba(0,0,0,0.5);
+  z-index: 11;
 
-    .supplement-title {
-      color: #1F2329;
-      font-size: 16px;
-      font-weight: 500;
-      margin-left: 8px;
-      margin-top: 5px;
-      display: inline-block;
-
-      img {
-        vertical-align: middle;
-      }
-    }
+  .saga-toolbar-main {
+    width: 1200px;
+    height: 100%;
+    margin: auto;
+    padding-top: 20px;
   }
 
-  .fr {
-    float: right;;
+  .supplement-title {
+    color: #1F2329;
+    font-size: 16px;
+    font-weight: 500;
+    margin-left: 8px;
+    margin-top: 5px;
+    display: inline-block;
+    img {
+      vertical-align: middle;
+    }
   }
+}
 
-  /*.color-primary {*/
-  /*  background: #3A8DDE;*/
-  /*  color: #fff;*/
-  /*}*/
+.fr {
+  float: right;;
+}
 </style>