|
@@ -6,8 +6,9 @@
|
|
<el-input v-model="queryParams.productName" size="small" placeholder="请输入产品名称" style="width: 200px;margin-right: 10px;"></el-input>
|
|
<el-input v-model="queryParams.productName" size="small" placeholder="请输入产品名称" style="width: 200px;margin-right: 10px;"></el-input>
|
|
<el-input v-model="queryParams.companyName" size="small" placeholder="请输入产品所属公司名称" style="width: 200px;margin-right: 10px;"></el-input>
|
|
<el-input v-model="queryParams.companyName" size="small" placeholder="请输入产品所属公司名称" style="width: 200px;margin-right: 10px;"></el-input>
|
|
<el-button type="primary" size="small" @click="getList2">查询</el-button>
|
|
<el-button type="primary" size="small" @click="getList2">查询</el-button>
|
|
- <el-button type="primary" size="small" @click="handleAdd" v-if="$permission('/workspace/product/addCategory')">新增类别</el-button>
|
|
|
|
- <el-dropdown @command="handleCommandAdd">
|
|
|
|
|
|
+ <el-button type="primary" size="small" @click="handleAdd" v-if="(!patentNo||sign==2) && $permission('/workspace/product/addCategory')">新增类别</el-button>
|
|
|
|
+ <el-button type="primary" size="small" @click="addProduct" v-if="patentNo&&sign!=2">添加</el-button>
|
|
|
|
+ <el-dropdown @command="handleCommandAdd" v-if="!patentNo||sign==2">
|
|
<el-button type="primary" size="small">
|
|
<el-button type="primary" size="small">
|
|
新增产品<i class="el-icon-arrow-down el-icon--right"></i>
|
|
新增产品<i class="el-icon-arrow-down el-icon--right"></i>
|
|
</el-button>
|
|
</el-button>
|
|
@@ -16,6 +17,7 @@
|
|
<el-dropdown-item command="2">新增外公司产品</el-dropdown-item>
|
|
<el-dropdown-item command="2">新增外公司产品</el-dropdown-item>
|
|
</el-dropdown-menu>
|
|
</el-dropdown-menu>
|
|
</el-dropdown>
|
|
</el-dropdown>
|
|
|
|
+ <el-button type="primary" size="small" @click="submitProduct" v-if="sign==2" style="margin-left:10px">保存</el-button>
|
|
</div>
|
|
</div>
|
|
<div style="display: flex;">
|
|
<div style="display: flex;">
|
|
<span style="margin-right: 10px;">分组查询:</span>
|
|
<span style="margin-right: 10px;">分组查询:</span>
|
|
@@ -33,7 +35,22 @@
|
|
header-row-class-name="custom-table-header"
|
|
header-row-class-name="custom-table-header"
|
|
@sort-change="sortChange"
|
|
@sort-change="sortChange"
|
|
style="width: 100%">
|
|
style="width: 100%">
|
|
- <!-- type="expand"开启后展开行 -->
|
|
|
|
|
|
+ <el-table-column label="#" align="center" v-if="sign == 2">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <div>
|
|
|
|
+ <el-checkbox-group
|
|
|
|
+ v-model="productIds"
|
|
|
|
+ style="display: inline-block"
|
|
|
|
+ >
|
|
|
|
+ <el-checkbox
|
|
|
|
+ :label="scope.row.id"
|
|
|
|
+ >
|
|
|
|
+ <span></span>
|
|
|
|
+ </el-checkbox>
|
|
|
|
+ </el-checkbox-group>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
<el-table-column prop="productName" label="产品名称" sortable="custom" align="center">
|
|
<el-table-column prop="productName" label="产品名称" sortable="custom" align="center">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<div class="items">
|
|
<div class="items">
|
|
@@ -84,7 +101,7 @@
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
<!-- 折叠面板 -->
|
|
<!-- 折叠面板 -->
|
|
- <productCollapse v-else :tableData="tableData" :sign="sign" @editCollapse="handleEditCollapse" @deleteCollapse="deleteCollapse" @sortCollapse="sortCollapse" @categoryEdit="categoryEdit" @rowClickName="rowClick"></productCollapse>
|
|
|
|
|
|
+ <productCollapse v-else :tableData="tableData" :sign="sign" :productIdList.sync="productIds" @editCollapse="handleEditCollapse" @deleteCollapse="deleteCollapse" @sortCollapse="sortCollapse" @categoryEdit="categoryEdit" @rowClickName="rowClick"></productCollapse>
|
|
<!-- 分页 -->
|
|
<!-- 分页 -->
|
|
<div style="display: flex;justify-content: center; margin-top: 20px;">
|
|
<div style="display: flex;justify-content: center; margin-top: 20px;">
|
|
<el-pagination
|
|
<el-pagination
|
|
@@ -146,7 +163,7 @@
|
|
<i class="el-icon-zoom-in" @click.stop="handlePictureCardPreview"></i>
|
|
<i class="el-icon-zoom-in" @click.stop="handlePictureCardPreview"></i>
|
|
<i class="el-icon-delete" @click.stop="handleRemove"></i></span>
|
|
<i class="el-icon-delete" @click.stop="handleRemove"></i></span>
|
|
</span>
|
|
</span>
|
|
- <el-image ref="image" style="width:100%;height: 100%;" :src="productForm.pictures[0].id? $p2 + productForm.pictures[0].url:productForm.pictures[0].url" :preview-src-list="productForm.pictures"></el-image>
|
|
|
|
|
|
+ <el-image ref="image" style="width:100%;height: 100%;" :src="productForm.pictures[0].id? $p + productForm.pictures[0].url:productForm.pictures[0].url" :preview-src-list="productForm.pictures"></el-image>
|
|
</span>
|
|
</span>
|
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
</el-upload>
|
|
</el-upload>
|
|
@@ -174,12 +191,12 @@
|
|
append-to-body
|
|
append-to-body
|
|
:close-on-click-modal="false"
|
|
:close-on-click-modal="false"
|
|
:before-close="categoryClose">
|
|
:before-close="categoryClose">
|
|
- <el-form :rules="categoryRules" ref="categoryForm" :model="categoryForm" label-width="110">
|
|
|
|
|
|
+ <el-form :rules="categoryRules" ref="categoryForm" :model="categoryForm" label-width="110px">
|
|
<el-form-item label="名称 " prop="productCategoryName">
|
|
<el-form-item label="名称 " prop="productCategoryName">
|
|
<el-input v-model="categoryForm.productCategoryName" placeholder="请输入名称"></el-input>
|
|
<el-input v-model="categoryForm.productCategoryName" placeholder="请输入名称"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="参考许可费率 " prop="licenseRate">
|
|
<el-form-item label="参考许可费率 " prop="licenseRate">
|
|
- <el-input v-model="categoryForm.licenseRate" placeholder="请输入参考许可费率(许可费率介于0-1之间)"></el-input>
|
|
|
|
|
|
+ <el-input v-model="categoryForm.licenseRate" placeholder="请输入参考许可费率(参考许可费率介于0-1之间)"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="图片 ">
|
|
<el-form-item label="图片 ">
|
|
<el-upload ref="upload" action="#" :auto-upload="false" :on-change="handleChange1" list-type="picture" :show-file-list="false">
|
|
<el-upload ref="upload" action="#" :auto-upload="false" :on-change="handleChange1" list-type="picture" :show-file-list="false">
|
|
@@ -190,7 +207,7 @@
|
|
<i class="el-icon-delete" @click.stop="handleRemove"></i>
|
|
<i class="el-icon-delete" @click.stop="handleRemove"></i>
|
|
</span>
|
|
</span>
|
|
</span>
|
|
</span>
|
|
- <el-image ref="image" style="width:100%;height: 100%;" :src="categoryForm.pictures[0].id?$p2 + categoryForm.pictures[0].url:categoryForm.pictures[0].url" :preview-src-list="categoryForm.pictures"></el-image>
|
|
|
|
|
|
+ <el-image ref="image" style="width:100%;height: 100%;" :src="categoryForm.pictures[0].id?$p + categoryForm.pictures[0].url:categoryForm.pictures[0].url" :preview-src-list="categoryForm.pictures"></el-image>
|
|
</span>
|
|
</span>
|
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
</el-upload>
|
|
</el-upload>
|
|
@@ -205,18 +222,37 @@
|
|
<el-button type="primary" @click="categorySure">确 定</el-button>
|
|
<el-button type="primary" @click="categorySure">确 定</el-button>
|
|
</span>
|
|
</span>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+ <el-dialog
|
|
|
|
+ title="产品清单"
|
|
|
|
+ :visible.sync="ProductVisible"
|
|
|
|
+ width="1300px"
|
|
|
|
+ append-to-body
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
+ :before-close="ProductClose">
|
|
|
|
+ <div>
|
|
|
|
+ <productDialog :sign="2" :patentNo="patentNo" @submit="getSubmitStatus" v-if="ProductVisible"></productDialog>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <!-- <span slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button @click="categoryClose">取 消</el-button>
|
|
|
|
+ <el-button type="primary" @click="categorySure">确 定</el-button>
|
|
|
|
+ </span> -->
|
|
|
|
+ </el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import productDialog from './product.vue'
|
|
import MarketingData from './marketingData.vue'
|
|
import MarketingData from './marketingData.vue'
|
|
import productCollapse from './productCollapse.vue'
|
|
import productCollapse from './productCollapse.vue'
|
|
import { commonMethods } from './mixins'
|
|
import { commonMethods } from './mixins'
|
|
export default {
|
|
export default {
|
|
|
|
+ name:'productDialog',
|
|
props:['clientName','sign','patentNo'],
|
|
props:['clientName','sign','patentNo'],
|
|
components:{
|
|
components:{
|
|
MarketingData,
|
|
MarketingData,
|
|
productCollapse,
|
|
productCollapse,
|
|
|
|
+ productDialog
|
|
},
|
|
},
|
|
mixins:[commonMethods],
|
|
mixins:[commonMethods],
|
|
data() {
|
|
data() {
|
|
@@ -238,6 +274,8 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return {
|
|
return {
|
|
|
|
+ ProductVisible:false,
|
|
|
|
+ productIds:[],
|
|
input: '',
|
|
input: '',
|
|
rowData:{},
|
|
rowData:{},
|
|
left:'left',
|
|
left:'left',
|
|
@@ -276,7 +314,7 @@ export default {
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
userinfo() {
|
|
userinfo() {
|
|
- return this.$store.state.admin.userinfo
|
|
|
|
|
|
+ return this.$store.state.user.userinfo
|
|
}
|
|
}
|
|
},
|
|
},
|
|
watch:{
|
|
watch:{
|
|
@@ -292,6 +330,34 @@ export default {
|
|
await this.getListCategory()
|
|
await this.getListCategory()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ //打开选择产品弹窗
|
|
|
|
+ addProduct(){
|
|
|
|
+ this.ProductVisible = true
|
|
|
|
+ },
|
|
|
|
+ //关闭选择产品弹窗
|
|
|
|
+ ProductClose(){
|
|
|
|
+
|
|
|
|
+ this.ProductVisible = false
|
|
|
|
+ },
|
|
|
|
+ //保存选择的产品
|
|
|
|
+ submitProduct(){
|
|
|
|
+ var params={
|
|
|
|
+ patentNos:this.patentNo,
|
|
|
|
+ productIds:this.productIds
|
|
|
|
+ }
|
|
|
|
+ this.$api.PatentAndProduct(params).then(response=>{
|
|
|
|
+ if(response.code == 200){
|
|
|
|
+ this.productIds = []
|
|
|
|
+ this.$emit('submit',true)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ getSubmitStatus(val){
|
|
|
|
+ if(val){
|
|
|
|
+ this.ProductClose()
|
|
|
|
+ this.getList()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
// 面板的产品类别编辑
|
|
// 面板的产品类别编辑
|
|
categoryEdit(row) {
|
|
categoryEdit(row) {
|
|
this.categoryCommand('1',row)
|
|
this.categoryCommand('1',row)
|
|
@@ -400,6 +466,9 @@ export default {
|
|
},
|
|
},
|
|
//查询产品
|
|
//查询产品
|
|
async getList() {
|
|
async getList() {
|
|
|
|
+ if(this.sign == 2){
|
|
|
|
+ this.queryParams.patentNo = null
|
|
|
|
+ }
|
|
await this.$api.queryProducts(this.queryParams).then(res => {
|
|
await this.$api.queryProducts(this.queryParams).then(res => {
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
this.tableData = res.data.list
|
|
this.tableData = res.data.list
|
|
@@ -521,7 +590,7 @@ export default {
|
|
previewPictures(row) {
|
|
previewPictures(row) {
|
|
if (row.pictures && row.pictures.length>0) {
|
|
if (row.pictures && row.pictures.length>0) {
|
|
var item = row.pictures[0]//图片每条信息
|
|
var item = row.pictures[0]//图片每条信息
|
|
- var FileUrl = this.$p2 + row.pictures[0].url//每张图片的url
|
|
|
|
|
|
+ var FileUrl = this.$p + row.pictures[0].url//每张图片的url
|
|
var isPicture = 1
|
|
var isPicture = 1
|
|
const router = this.$router.resolve({
|
|
const router = this.$router.resolve({
|
|
path: '/checkFile',
|
|
path: '/checkFile',
|
|
@@ -577,6 +646,9 @@ export default {
|
|
this.$api.addNewProducts(formData).then(res => {
|
|
this.$api.addNewProducts(formData).then(res => {
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
this.$message.success("新增产品成功")
|
|
this.$message.success("新增产品成功")
|
|
|
|
+ if(this.sign == 1){
|
|
|
|
+ this.$emit('productId',false)
|
|
|
|
+ }
|
|
this.getList()
|
|
this.getList()
|
|
this.close()
|
|
this.close()
|
|
}
|
|
}
|
|
@@ -617,6 +689,7 @@ export default {
|
|
this.$set(this.categoryForm,'pictures', [{url:file.url}])
|
|
this.$set(this.categoryForm,'pictures', [{url:file.url}])
|
|
this.file=[file.raw]
|
|
this.file=[file.raw]
|
|
},
|
|
},
|
|
|
|
+
|
|
},
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|