zhuliu hai 1 ano
pai
achega
03ff63a12a

+ 1 - 1
src/utils/model/route.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <upload style="height: 200px;width:100%;" :fileList="tableData"></upload>
+    <upload :fileList="tableData"></upload>
   </div>
 </template>
 <script>

+ 2 - 1
src/utils/model/upload/index.vue

@@ -152,7 +152,7 @@ export default {
 <style lang="scss" scoped>
 .myUpload{
     width: calc(100% - 0px);
-    height: 100%;
+    height:180px;
     padding: 5px;
 }
 .myUpload1 {
@@ -183,6 +183,7 @@ export default {
       list-style-type: none;
       padding: 0 10px;
       li{
+        line-height: initial;
         padding:5px 10px;
         border-radius: 5px;
         display: flex;

+ 10 - 5
src/views/components/dialog/ClientTable.vue

@@ -30,7 +30,7 @@
             <template slot-scope="scope">
               <div>
                 <el-checkbox
-                  :checked="personIds.indexOf(scope.row.id) != -1"
+                  :checked="(personIds.indexOf(scope.row.id) != -1 || personIds.indexOf(scope.row.id+'')!=-1)"
                   @change="getCheck(scope.row)"
                   v-if="showCheck"
                 ></el-checkbox>
@@ -116,15 +116,19 @@ export default {
   },
   watch: {
     personIds(val) {
-      this.showCheck = false;
-      this.$nextTick(() => {
-        this.showCheck = true;
-      });
+      this.updateCheck()
     },
   },
   computed: {},
 
   methods: {
+	//跟新选择框
+	updateCheck(){
+		this.showCheck = false;
+		this.$nextTick(() => {
+			this.showCheck = true;
+		});
+	},
     getList() {
       this.loading = true;
       this.$api
@@ -133,6 +137,7 @@ export default {
           this.tableData = response.data;
           this.total = response.pageColumn.total;
           this.loading = false;
+		 
         })
         .catch((error) => {
           this.loading = false;

+ 5 - 5
src/views/product/components/dialog/addEditCategory.vue

@@ -39,7 +39,7 @@
                   <i class="el-icon-delete" @click.stop="handleRemove"></i>
                 </span>
               </span>
-                <el-image ref="image" style="width:100%;height: 100%;" :src="form.systemFileList[0].id?$p2 + form.systemFileList[0].url:form.systemFileList[0].url" :preview-src-list="form.systemFileList?form.systemFileList.map(item=>{return item.id? $p2 + item.url:item.url}):[]"></el-image>
+                <el-image ref="image" style="width:100%;height: 100%;" :src="form.systemFileList[0].guid?`http://192.168.1.14:8801/fileManager/downloadFile?fileId=${form.systemFileList[0].guid}`:form.systemFileList[0].url" :preview-src-list="form.systemFileList?form.systemFileList.map(item=>{return item.guid? `http://192.168.1.14:8801/fileManager/downloadFile?fileId=${item.guid}`:item.url}):[]"></el-image>
             </span>
             <i v-else class="el-icon-plus avatar-uploader-icon"></i>
           </el-upload>
@@ -155,7 +155,7 @@ export default {
       this.form.showType1 = this.form.showType
       this.$set(this.form,'showType',val)
       this.$set(this.form,'persons',[])
-      this.$set(this.form,'showPersonId',[])
+      this.$set(this.form,'showPersonIds',[])
       if(this.form.showType == 2 || this.form.showType == 3){
         this.showDialog(1)
       }
@@ -168,7 +168,7 @@ export default {
         this.$refs.choosePerson.open(this.form.adminIds,this.form.adminPersons)
         return false
       }
-      this.$refs.choosePerson.open(this.form.showPersonId,this.form.persons)
+      this.$refs.choosePerson.open(this.form.showPersonIds,this.form.persons)
     },
     //获取人员信息
     getPersonIds({personIds,persons}){
@@ -184,7 +184,7 @@ export default {
       }
       if(personIds.length>0){
         this.$set(this.form,'persons',persons)
-        this.$set(this.form,'showPersonId',personIds)
+        this.$set(this.form,'showPersonIds',personIds)
       }else{
         if(this.form.showType == this.form.showType1){
           this.$set(this.form,'showType',0)
@@ -193,7 +193,7 @@ export default {
         }
         
         this.$set(this.form,'persons',[])
-        this.$set(this.form,'showPersonId',[])
+        this.$set(this.form,'showPersonIds',[])
       }
     },
 

+ 6 - 6
src/views/product/components/dialog/addEditProduct.vue

@@ -6,7 +6,6 @@
         <el-form-item label="所属产品类别" prop="productCategoryId">
           <el-select
             v-model="form.productCategoryId"
-            multiple
             filterable
             remote
             reserve-keyword
@@ -144,7 +143,7 @@ export default {
     ...mapGetters(['userinfo'])
   },
   mounted() { 
-    this.getProductCategory();
+    
   },
   methods: {
     // 上传的change
@@ -179,6 +178,7 @@ export default {
           this.title = '新增外公司产品'
         }
       }
+      this.getProductCategory();
       this.dialogVisible = true;
     },
     // 弹窗确定
@@ -281,7 +281,7 @@ export default {
       this.form.showType1 = this.form.showType
       this.$set(this.form,'showType',val)
       this.$set(this.form,'persons',[])
-      this.$set(this.form,'showPersonId',[])
+      this.$set(this.form,'showPersonIds',[])
       if(this.form.showType == 2 || this.form.showType == 3){
         this.showDialog(1)
       }
@@ -294,7 +294,7 @@ export default {
         this.$refs.choosePerson.open(this.form.adminIds,this.form.adminPersons)
         return false
       }
-      this.$refs.choosePerson.open(this.form.showPersonId,this.form.persons)
+      this.$refs.choosePerson.open(this.form.showPersonIds,this.form.persons)
     },
     //获取人员信息
     getPersonIds({personIds,persons}){
@@ -310,7 +310,7 @@ export default {
       }
       if(personIds.length>0){
         this.$set(this.form,'persons',persons)
-        this.$set(this.form,'showPersonId',personIds)
+        this.$set(this.form,'showPersonIds',personIds)
       }else{
         if(this.form.showType == this.form.showType1){
           this.$set(this.form,'showType',0)
@@ -319,7 +319,7 @@ export default {
         }
         
         this.$set(this.form,'persons',[])
-        this.$set(this.form,'showPersonId',[])
+        this.$set(this.form,'showPersonIds',[])
       }
     },
 

+ 1 - 1
src/views/product/components/dialog/marketing.vue

@@ -87,7 +87,7 @@ export default {
   data() {
     return {
       // 营销数据弹窗的title
-      title: '',
+      title: '营销数据',
       // 控制营销数据弹窗的显示与消失
       dialogVisible: false,
       // 查询营销数据的字段

+ 7 - 5
src/views/product/components/framework/viewIndex.vue

@@ -3,13 +3,13 @@
   <div class="framework">
     <el-container>
       <el-header>
-        <div style="display: flex;justify-content: space-between;">
-          <div style="margin-left: 10px;">
+        <div style="display: flex;justify-content: space-between;align-items:center;width:100%;padding:0 10px;">
+          <div>
             <p>产品名称:{{ row.productName }}</p>
           </div>
           <div>
-            <el-dropdown split-button type="primary" @click="handleCommand('0')" @command="handleCommand($event)">
-              <p>导 入</p>
+            <el-dropdown split-button type="primary" size="small" @click="handleCommand('0')" @command="handleCommand($event)">
+              <span>导 入</span>
               <el-dropdown-menu slot="dropdown">
                 <el-dropdown-item command="1">复制</el-dropdown-item>
               </el-dropdown-menu>
@@ -429,5 +429,7 @@ export default {
 }
 </style>
 <style lang="scss" scoped>
-.framework {}
+.framework {
+  width: 100%;
+}
 </style>

+ 44 - 2
src/views/product/components/index.vue

@@ -34,7 +34,7 @@
       </el-header>
       <el-main>
         <div style="height: 100%;">
-          <component :is="componentType" :tableData="tableData" :queryParams="queryParams" :searchOption="searchOption"  @options="handleOption" @on-sort="handleSort"></component>
+          <component :is="componentType" :tableData="tableData" :queryParams="queryParams" :searchOption="searchOption" :handleMessage="handleMessage"  @options="handleOption" @on-sort="handleSort" @optionsSon="handleOption2"></component>
         </div>
       </el-main>
       <el-footer class="pagination">
@@ -47,6 +47,7 @@
 
     <addEditCategory ref="addEditCategory" @getMessage="getMessage"></addEditCategory>
     <addEditProduct ref="addEditProduct" @getMessage="getMessage"></addEditProduct>
+    <marketing ref="marketing"></marketing>
     <myImageViewer v-if="showImg" :on-close="closeViewer" :src="imgSrc"></myImageViewer>
   </div>
 </template>
@@ -55,12 +56,13 @@
 import categoryTable from './view/categoryTable.vue'
 import addEditCategory from './dialog/addEditCategory.vue'
 import addEditProduct from './dialog/addEditProduct.vue'
-
+import marketing from './dialog/marketing.vue'
 export default {
   components: {
     categoryTable,
     addEditCategory,
     addEditProduct,
+    marketing
   },
   data() {
     return {
@@ -185,6 +187,46 @@ export default {
           break;
       }
     },
+    //孙组件操作列方法
+    handleOption2({ option, row }){
+      switch (option) {
+        case '0'://编辑
+          this.$refs.addEditProduct.open(row)
+          break;
+        case '1'://预览图片
+          
+          break;
+        case '2'://产品架构
+          this.toFramework(row)
+          break;
+        case '3'://产品的营销数据
+          this.$refs.marketing.open(row)
+          break;
+        case '4'://产品的营销数据
+
+          break;
+        case '5'://产品的营销数据
+
+          break;
+        case '6'://商品化专利
+          this.toCommodity(row)
+          break;
+          
+        default:
+          break;
+      }
+    },
+     // 进入商品化专利
+     toCommodity(row) {
+      let router = this.$router.resolve({
+        path: '/commodity',
+        query: {
+          
+        }
+      })
+      window.open(router.href,'_blank')
+    },
+
      // 进入产品类别分类架构(与产品架构一致)
     toFramework(row) {
       let router = this.$router.resolve({

+ 24 - 1
src/views/product/components/mixins/product.js

@@ -1,3 +1,26 @@
 export default {
-    
+    methods: {
+        //获取删除的id
+        deletes(row){
+            this.deleteData([row.id])
+        },
+        //删除数据
+        deleteData(ids){
+            this.$confirm('此操作将删除该产品类别, 是否继续?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+            }).then(() => {
+            // 调用接口
+            this.$api.deleteProduct(ids).then(res => {
+                if (res.code == 200) {
+                // this.getList()
+                this.updateData()
+                this.$message.success('删除成功!');
+                }
+            })
+            }).catch(() => {
+            });
+        },
+    },
 }

+ 2 - 56
src/views/product/components/view/categoryTable.vue

@@ -35,23 +35,16 @@
         </template>
       </el-table-column>
     </el-table>
-
-    <addEditProduct ref="addEditProduct" ></addEditProduct>
-    <marketing ref="marketing"></marketing>
   </div>
 </template>
 
 <script>
 import { getTableHeight } from '@/views/components/mixins'
 import productTable from './productTable.vue'
-import addEditProduct from '../dialog/addEditProduct.vue'
-import marketing from '../dialog/marketing.vue'
 export default {
   mixins:[getTableHeight],
   components: {
     productTable,
-    addEditProduct,
-    marketing,
   },
   props: {
     tableData: {
@@ -107,55 +100,8 @@ export default {
   mounted() {
   },
   methods: {
-    // 子组件的编辑等事件
-    handleOptionSon({ val, row }) {
-      switch (val) {
-        case '0'://编辑
-          this.$refs.addEditProduct.open(row)
-          break;
-        case '1'://预览图片
-          
-          break;
-        case '2'://产品架构
-          this.toFramework(row)
-          break;
-        case '3'://产品的营销数据
-          this.$refs.marketing.open(row)
-          break;
-        case '4'://产品的营销数据
-
-          break;
-        case '5'://产品的营销数据
-
-          break;
-        case '6'://商品化专利
-          this.toCommodity(row)
-          break;
-          
-        default:
-          break;
-      }
-    },
-    // 进入商品化专利
-    toCommodity(row) {
-      let router = this.$router.resolve({
-        path: '/commodity',
-        query: {
-          
-        }
-      })
-      window.open(router.href,'_blank')
-    },
-    // 进入产品架构
-    toFramework(row) {
-      let router = this.$router.resolve({
-        path: '/frameworkIndex',
-        query: {
-          row:JSON.stringify(row)
-        }
-      })
-      window.open(router.href,'_blank')
-    },
+ 
+   
     // 展开行打开或者关闭事件
     handleExpand(row, rowList) {
       row.productData =row.productData || []

+ 153 - 7
src/views/product/components/view/productTable.vue

@@ -4,14 +4,15 @@
     <el-table :data="tableData" header-row-class-name="custom-table-header" 
       v-el-table-infinite-scroll="getList"
       :infinite-scroll-distance="10"
-      :infinite-scroll-disabled="disabled">
+      :infinite-scroll-disabled="disabled"
+      @sort-change="sortChange">
       <el-table-column label="#" width="60" type="index" align="center">
         <template slot-scope="scope">
           <span>{{ (scope.$index + 1) }}</span>
         </template>
       </el-table-column>
 
-      <el-table-column label="产品名称" prop="productName" align="center"> </el-table-column>
+      <!-- <el-table-column label="产品名称" prop="productName" align="center"> </el-table-column>
       <el-table-column label="上市时间" prop="marketTime" align="center"> 
         <template slot-scope="scope">
           <div>
@@ -24,8 +25,16 @@
       </el-table-column>
       <el-table-column label="参考许可费率" prop="licenseRate" align="center"> </el-table-column>
       <el-table-column label="创建人" prop="createPersonName" align="center"> </el-table-column>
-      <el-table-column label="产品说明" prop="productExplain" align="center"> </el-table-column>
-
+      <el-table-column label="产品说明" prop="productExplain" align="center"> </el-table-column> -->
+      <el-table-column v-for="item in column" :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, item.value)">{{ scope.row[item.value] }}</el-link>
+          </div>
+          <div v-else v-html="$commonJS.getColumnData(scope.row, item)">
+          </div>
+        </template>
+      </el-table-column>
       <el-table-column label="操作" align="center" width="150px">
         <template slot-scope="scope">
           <el-dropdown split-button type="primary" size="small" @click="handleCommand('0', scope.row)"
@@ -71,7 +80,50 @@ export default {
     row:'',
     searchOption:{
       default:{}
-    }
+    },
+    column:{
+      default:()=>{
+        return [
+          {
+            value:'name',
+            type:'String',
+            name:'类别名称'
+          },
+          {
+            value:'marketTime',
+            type:'DateTime',
+            name:'上市时间'
+          },
+          {
+            value:'companyName',
+            type:'String',
+            name:'所属公司'
+          },
+          {
+            value:'licenseRate',
+            type:'String',
+            name:'许可费率'
+          },
+          {
+            value:'description',
+            type:'String',
+            name:'产品说明'
+          },
+          {
+            value:'createName',
+            type:'String',
+            name:'创建人'
+          },
+          {
+            value:'createTime',
+            type:'DataTime',
+            name:'创建时间'
+          },
+        ]
+      }
+    },
+    handleMessage:''
+
   },
   data() {
     return {
@@ -87,6 +139,13 @@ export default {
       }
     }
   },
+  watch: {
+    handleMessage(val){
+      if(val){
+        this.updateData()
+      }
+    }
+  },
   mounted() {
     if(!this.row){
       this.disabled = true
@@ -95,9 +154,70 @@ export default {
     }
   },
   methods: {
+    //更新数据
+    updateData(){
+      if(this.action.type == 1){
+        if(this.tableData.length == 1){
+          return false
+        }
+        var startIndex = this.tableData.findIndex(item=>{
+              return item.id == this.action.id
+          })
+          this.tableData.splice(startIndex,1)
+          var str = this.$commonJS.objectToString(this.searchOption) 
+        let params = {
+          ...this.params,
+          searchQuery:str?' AND ':'' + `category_id=${this.row.id}`,//检索条件
+          orderDTOList: this.sort,//排序
+        }
+        this.getList2(params,1)
+      }else if(this.action.type == 2){
+        let params = {
+          ...this.params,
+          searchQuery:`product_id=${this.action.id}`,//检索条件
+        }
+        this.getList2(params,2)
+      }
+    },
+
+    getList2(params,type){
+      
+      this.$api.queryProduct(params).then(res => {
+        if (res.code == 200) {
+          if(type == 1){
+            var startIndex = (params.current-1)*size
+            var endIndex = this.tableData.length
+            var len = endIndex - startIndex
+            this.tableData.splice(startIndex,len,...res.data.data)
+            this.params.total = res.data.total
+          }else if(type == 2){
+            var startIndex = this.tableData.findIndex(item=>{
+              return item.id == this.action.id
+            })
+            this.tableData.splice(startIndex,1,...res.data.data)
+          }
+          
+        }
+      }).catch(err => {
+      })
+    },
     // 编辑下拉菜单
-    handleCommand(val, row) {
-      this.$emit('optionsSon',{val,row})
+    handleCommand(option, row) {
+      if(option == 7){
+        this.action={
+          type:'1',
+          id:row.id
+        } 
+        this.deletes(row)
+        return false
+      }else{
+        this.action={
+          type:'2',
+          id:row.id
+        } 
+      }
+      
+      this.$emit('optionsSon',{option,row})
     },
     //获取数据
     getList() {
@@ -132,6 +252,32 @@ export default {
         this.isFlag = false
       }, 1000)
     },
+     // 排序方法
+     sortChange({ column, prop, order }) {
+      this.sort=[]//如需要多个字段排序,则不需要清空
+      if (order == null) {
+        return;
+      }
+      var orderType = {
+        ascending: 0,
+        descending: 1
+      }
+      var params = this.sort.find(item => {
+        return item.orderBy == prop
+      })
+      if (params) {
+        params.orderType = orderType[order]
+      } else {
+        params = {}
+        params.orderBy = prop
+        params.orderType = orderType[order]
+        this.sort.push(params)
+      }
+      this.params.current = 0
+      this.disabled = false
+      this.tableData.splice(0)
+      this.getList()
+    },
   },
 }
 </script>