ソースを参照

产品类别的类型改为1

zhuliu 1 年間 前
コミット
76a1b7198d

+ 2 - 2
src/views/product/components/details/components/basicMessage.vue

@@ -1,6 +1,6 @@
 <template>
   <div v-loading="loading">
-    <el-form v-if="type == '3'" :model="row" label-width="110px" style="margin:0 auto;width:50%">
+    <el-form v-if="type == '1'" :model="row" label-width="110px" style="margin:0 auto;width:50%">
         <el-form-item label="类别名称" prop="name">
           <myTooltip :content="row.name" >
             <div class="noWrap" v-html="$commonJS.getColumnData(row, {type:'String',value:'name'})"></div>
@@ -128,7 +128,7 @@ export default {
     if(Object.keys(this.row).length>0){
       return false
     }
-    if(this.type == '3'){
+    if(this.type == '1'){
       this.getProductCategory()
     }else{
       this.getProduct()

+ 1 - 1
src/views/product/components/details/components/index.vue

@@ -63,7 +63,7 @@ import marketAndTrend from './marketAndTrend.vue';
     },
     methods: {
         getMenu(){
-            if(this.type == '3'){
+            if(this.type == '1'){
                 this.menu = [
                     {
                         label:'基本信息',

+ 1 - 1
src/views/product/components/details/index.vue

@@ -17,7 +17,7 @@ export default {
   },
   watch: {},
   computed: {
-    //类型2是产品,3是产品类别
+    //类型2是产品,1是产品类别
     type(){
         return this.$route.query.type
     },

+ 6 - 6
src/views/product/components/echarts/components/echarts.vue

@@ -23,7 +23,7 @@
                         </el-option>
                     </el-select>
                 </el-form-item>
-                <el-form-item label="公司" v-if="type == 3">
+                <el-form-item label="公司" v-if="type == 1">
                     <el-select v-model="queryParams.companyName" @change="changeEcharts()" clearable  placeholder="请选择公司">
                         <el-option
                             v-for="item in companyList"
@@ -52,7 +52,7 @@
             
         </div>
         <div>
-            <component v-if="type == 3" :is="component" :ref="components" :domId="components" :NewForm="form"  @form="getForm"></component>
+            <component v-if="type == 1" :is="component" :ref="components" :domId="components" :NewForm="form"  @form="getForm"></component>
             <component :is='component' :ref="component"  :NewForm="form" @form="getForm"></component>  
         </div>  
         <el-drawer
@@ -157,8 +157,8 @@ export default {
             var relation = this.relationList.find(i=>{
                 return i.value == this.queryParams.relation
             })
-            var name = this.name + (this.type==3?'产品类别':'产品') + '趋势图'
-           if(this.type==3){
+            var name = this.name + (this.type==1?'产品类别':'产品') + '趋势图'
+           if(this.type==1){
                 this.$refs[this.components].open(this.chartData.filter(item=>{
                     return !item.productId
                 }),'趋势总图',relation.label,this.queryParams.timeUnit)
@@ -190,7 +190,7 @@ export default {
                 saleArea:this.queryParams.area,
                 companyName:this.queryParams.companyName,
            }
-           if(this.type == 3){
+           if(this.type == 1){
                 params.categoryId = this.id
            }else{
                 params.productId = this.id
@@ -214,7 +214,7 @@ export default {
         //获取所有公司和地区
         getAllCompanyAndArea(){
             var params = {}
-            if(this.type == 3){
+            if(this.type == 1){
                 params.categoryId = this.id
             }else{
                 params.productId = this.id

+ 1 - 1
src/views/product/components/echarts/index.vue

@@ -19,7 +19,7 @@ export default{
         id(){
             return this.$route.query.id
         },
-        //趋势图类型2是产品,3是产品类别
+        //趋势图类型2是产品,1是产品类别
         type(){
             return this.$route.query.type
         },

+ 1 - 1
src/views/product/components/index.vue

@@ -185,7 +185,7 @@ export default {
           this.$refs.addEditCategory.open(row)
           break;
         case '1'://趋势图
-          this.showTrend(row,3)
+          this.showTrend(row,1)
           break;
         case '2'://预览图片
           this.checkImage(row)

+ 5 - 1
src/views/product/components/mixins/index.js

@@ -3,11 +3,15 @@ export default {
         /**
          * 
          * @param {object} row 为当前数据
-         * @param {String} type '2'为产品,'3'为产品类别
+         * @param {String} type '2'为产品,'1'为产品类别
          * @returns 
          */
         handleItem(row,type){
             if(this.isChoose){
+                //type'2'为产品,'3'为产品类别
+                if(type == 1){
+                    type = 3
+                }
                 this.$emit('chooseItem',{row:row,type:type})
                 return false
             }

+ 1 - 1
src/views/product/components/view/categoryTable.vue

@@ -13,7 +13,7 @@
       <el-table-column v-for="item in column" :render-header=" $commonJS.renderHeaderMethods" :key="item.value" :prop="item.value" :label="item.name" align="center" sortable="custom">
         <template slot-scope="scope">
           <div v-if="['name'].includes(item.value)">
-            <el-link @click="handleItem(scope.row, '3')" type="primary">
+            <el-link @click="handleItem(scope.row, '1')" type="primary">
               <span  v-html="$commonJS.getColumnData(scope.row, item)"></span>
             </el-link>
           </div>