|
@@ -3,7 +3,17 @@
|
|
<div class="content">
|
|
<div class="content">
|
|
<div v-loading.fullscreen.lock="loadingFull" />
|
|
<div v-loading.fullscreen.lock="loadingFull" />
|
|
<div class="search_box flexS">
|
|
<div class="search_box flexS">
|
|
- <el-input v-model="params.search_name" clearable placeholder="姓名" prefix-icon="el-icon-search"
|
|
|
|
|
|
+ <div v-for="(item, idx) in categoryList" :key="idx">
|
|
|
|
+ <el-select v-model="params[item.mark]" :placeholder="item.name" class="select" @change="toSearch()"
|
|
|
|
+ clearable @clear="toSearch()">
|
|
|
|
+ <el-option v-for="item in item.children" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
|
+ </el-select>
|
|
|
|
+ </div>
|
|
|
|
+ <el-select v-model="params.search_company" placeholder="所属企业" class="select" @change="toSearch()" clearable
|
|
|
|
+ @clear="toSearch()">
|
|
|
|
+ <el-option v-for="item in companyList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
|
+ </el-select>
|
|
|
|
+ <el-input v-model="params.search_name" clearable placeholder="名称" prefix-icon="el-icon-search"
|
|
@keyup.enter.native="toSearch()" @clear="toSearch()" />
|
|
@keyup.enter.native="toSearch()" @clear="toSearch()" />
|
|
<el-button type="primary" icon="el-icon-search" :loading="loadingFull" @click="toSearch()">搜索</el-button>
|
|
<el-button type="primary" icon="el-icon-search" :loading="loadingFull" @click="toSearch()">搜索</el-button>
|
|
<el-button @click="handleEdit(0)" type="primary" style="margin-right:24px;">添加</el-button>
|
|
<el-button @click="handleEdit(0)" type="primary" style="margin-right:24px;">添加</el-button>
|
|
@@ -21,6 +31,11 @@
|
|
<span>{{ row.industry && row.industry.name }}</span>
|
|
<span>{{ row.industry && row.industry.name }}</span>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
+ <el-table-column prop="industry" label="知识产权" align="center">
|
|
|
|
+ <template slot-scope="{ row }">
|
|
|
|
+ <span>{{ row.type && row.type.name }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
<el-table-column prop="company_id" label="所属企业" align="center">
|
|
<el-table-column prop="company_id" label="所属企业" align="center">
|
|
<template slot-scope="{ row }">
|
|
<template slot-scope="{ row }">
|
|
<span>{{ row.company && row.company.name }}</span>
|
|
<span>{{ row.company && row.company.name }}</span>
|
|
@@ -39,7 +54,7 @@
|
|
<el-drawer :title="type === 0 ? '添加知识产权' : '编辑知识产权'" :visible.sync="dialogVisible" width="35%">
|
|
<el-drawer :title="type === 0 ? '添加知识产权' : '编辑知识产权'" :visible.sync="dialogVisible" width="35%">
|
|
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="130px" class="demo-ruleForm">
|
|
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="130px" class="demo-ruleForm">
|
|
<el-form-item label="名称:" prop="name">
|
|
<el-form-item label="名称:" prop="name">
|
|
- <el-input v-model="ruleForm.name" placeholder="请输入姓名" />
|
|
|
|
|
|
+ <el-input v-model="ruleForm.name" placeholder="请输入名称" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="图片:">
|
|
<el-form-item label="图片:">
|
|
<el-upload ref="upload" action="" :show-file-list="false" :http-request="uploadImg">
|
|
<el-upload ref="upload" action="" :show-file-list="false" :http-request="uploadImg">
|
|
@@ -54,6 +69,11 @@
|
|
</div>
|
|
</div>
|
|
</el-upload>
|
|
</el-upload>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item label="申请时间:" prop="start_time">
|
|
|
|
+ <el-date-picker v-model="ruleForm.apply_time" type="datetime" placeholder="选择日期时间" style="width:300px"
|
|
|
|
+ value-format="yyyy-MM-dd" format="yyyy-MM-dd">
|
|
|
|
+ </el-date-picker>
|
|
|
|
+ </el-form-item>
|
|
<el-form-item label="所属企业:" prop="company_id">
|
|
<el-form-item label="所属企业:" prop="company_id">
|
|
<el-select v-model="ruleForm.company_id" placeholder="请选择所属企业">
|
|
<el-select v-model="ruleForm.company_id" placeholder="请选择所属企业">
|
|
<el-option v-for="item in companyList" :key="item.id" :label="item.name" :value="item.id" />
|
|
<el-option v-for="item in companyList" :key="item.id" :label="item.name" :value="item.id" />
|
|
@@ -61,26 +81,28 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item v-for="(item, i) in categoryList" :key="i" :label="item.name" :prop="item.mark">
|
|
<el-form-item v-for="(item, i) in categoryList" :key="i" :label="item.name" :prop="item.mark">
|
|
<el-select v-model="ruleForm[item.mark]" :placeholder="'请选择' + item.name" :ref="'template_' + i"
|
|
<el-select v-model="ruleForm[item.mark]" :placeholder="'请选择' + item.name" :ref="'template_' + i"
|
|
- @visible-change="(v) => visibleChange(v, `template_${i}`, item.id)" :style="{ width: '300px' }"
|
|
|
|
- filterable clearableruleFormruleForm>
|
|
|
|
|
|
+ :style="{ width: children.length > 0 ? '200px' : '300px' }" filterable clearableruleFormruleForm
|
|
|
|
+ value-key="id">
|
|
<el-option v-for="(temp, idx) in item.children" :key="idx" :label="temp.name" :value="temp.id">
|
|
<el-option v-for="(temp, idx) in item.children" :key="idx" :label="temp.name" :value="temp.id">
|
|
<span style="float: left" class="span-style">{{ temp.name }}</span>
|
|
<span style="float: left" class="span-style">{{ temp.name }}</span>
|
|
- <span style="float: right" class="span-style-delete" @click.stop="deleteItem(temp)">
|
|
|
|
- <i class="el-icon-delete" /></span>
|
|
|
|
|
|
+
|
|
<span style="float: right" class="span-style" @click.stop="editItem(item.id, 1, temp, i)">
|
|
<span style="float: right" class="span-style" @click.stop="editItem(item.id, 1, temp, i)">
|
|
<i class="el-icon-edit-outline" />
|
|
<i class="el-icon-edit-outline" />
|
|
</span>
|
|
</span>
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="是否研发机构" prop="is_research" required>
|
|
|
|
- <el-radio-group v-model="ruleForm.is_research">
|
|
|
|
- <el-radio :label="0">否</el-radio>
|
|
|
|
- <el-radio :label="1">是</el-radio>
|
|
|
|
- </el-radio-group>
|
|
|
|
|
|
+ <el-select v-model="checkedType" placeholder="请选择" v-if="item.mark === 'type' && children.length > 0"
|
|
|
|
+ style="margin-left:5px;" :ref="'template/' + i">
|
|
|
|
+ <el-option v-for="c in children" :key="c.id" :label="c.name" :value="c.id">
|
|
|
|
+ <span style="float: left" class="span-style">{{ c.name }}</span>
|
|
|
|
+ <span style="float: right" class="span-style" @click.stop="editItem(item.id, 1, c, i)">
|
|
|
|
+ <i class="el-icon-edit-outline" />
|
|
|
|
+ </span>
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="简介:" prop="introduction" required>
|
|
<el-form-item label="简介:" prop="introduction" required>
|
|
- <textarea name="" id="" cols="30" rows="10" v-model="ruleForm.introduction" placeholder="请输入人才简介" />
|
|
|
|
|
|
+ <textarea name="" id="" cols="30" rows="10" v-model="ruleForm.introduction" placeholder="请输知识产权简介" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-form-item>
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
@@ -96,12 +118,17 @@
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
-import { patentList, addPatent, editPatent, deletePatent, importPatent, patentCategory, companyAll } from '@/api/company'
|
|
|
|
|
|
+import { patentList, addPatent, editPatent, deletePatent, importPatent, patentCategory, companyAll, patentInfo } from '@/api/company'
|
|
import { uploadFile } from '@/api/upload.js'
|
|
import { uploadFile } from '@/api/upload.js'
|
|
import { addCategory, editCategory, deleteCategory } from '@/api/category'
|
|
import { addCategory, editCategory, deleteCategory } from '@/api/category'
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ typeList: [],
|
|
|
|
+ children: [],
|
|
|
|
+ checkedType: '',
|
|
|
|
+ fid: '', //新增专利的上一级id
|
|
|
|
+ typeId: '',
|
|
categoryList: [],
|
|
categoryList: [],
|
|
category: [],
|
|
category: [],
|
|
dialogVisible: false,
|
|
dialogVisible: false,
|
|
@@ -110,26 +137,22 @@ export default {
|
|
listDataTotal: 0,
|
|
listDataTotal: 0,
|
|
type: '',
|
|
type: '',
|
|
id: '',
|
|
id: '',
|
|
- options1: [],
|
|
|
|
- options2: [],
|
|
|
|
- options3: [],
|
|
|
|
companyList: [],
|
|
companyList: [],
|
|
ruleForm: {
|
|
ruleForm: {
|
|
name: '',
|
|
name: '',
|
|
company_id: '',
|
|
company_id: '',
|
|
- img: '',
|
|
|
|
|
|
+ apply_time: '',
|
|
industry: '',
|
|
industry: '',
|
|
- degree: '',
|
|
|
|
- introduction: '',
|
|
|
|
type: '',
|
|
type: '',
|
|
- is_research: ''
|
|
|
|
|
|
+ img: '',
|
|
|
|
+ introduction: ''
|
|
},
|
|
},
|
|
params: {
|
|
params: {
|
|
page_index: 1,
|
|
page_index: 1,
|
|
page_size: 10,
|
|
page_size: 10,
|
|
search_name: '',
|
|
search_name: '',
|
|
search_company: '',
|
|
search_company: '',
|
|
- search_type: ''
|
|
|
|
|
|
+ type: ''
|
|
},
|
|
},
|
|
rules: {
|
|
rules: {
|
|
name: [
|
|
name: [
|
|
@@ -145,16 +168,7 @@ export default {
|
|
{ required: true, message: '请选择行业类型', trigger: 'change' }
|
|
{ required: true, message: '请选择行业类型', trigger: 'change' }
|
|
],
|
|
],
|
|
type: [
|
|
type: [
|
|
- { required: true, message: '请选择人才类型', trigger: 'change' }
|
|
|
|
- ],
|
|
|
|
- degree: [
|
|
|
|
- { required: true, message: '请选择人才学历', trigger: 'change' }
|
|
|
|
- ],
|
|
|
|
- is_research: [
|
|
|
|
- { required: true, message: '请选择是否研发机构', trigger: 'change' }
|
|
|
|
- ],
|
|
|
|
- sort: [
|
|
|
|
- { required: true, message: '请输入排名', trigger: 'blur' }
|
|
|
|
|
|
+ { required: true, message: '请选择知识产权类型', trigger: 'change' }
|
|
],
|
|
],
|
|
introduction: [
|
|
introduction: [
|
|
{ required: true, message: '请输入简介', trigger: 'blur' }
|
|
{ required: true, message: '请输入简介', trigger: 'blur' }
|
|
@@ -167,7 +181,27 @@ export default {
|
|
this.getCategory()
|
|
this.getCategory()
|
|
this.getCompany()
|
|
this.getCompany()
|
|
},
|
|
},
|
|
|
|
+ computed: {
|
|
|
|
+ checkId() {
|
|
|
|
+ return this.fid
|
|
|
|
+ }
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
|
|
+
|
|
|
|
+ selectOne(params) {
|
|
|
|
+ const data = this.typeList.children.find((item) => {
|
|
|
|
+ return item.id === params
|
|
|
|
+ })
|
|
|
|
+ if (data && data.children) {
|
|
|
|
+ this.children = data.children
|
|
|
|
+ this.fid = data.id
|
|
|
|
+ } else {
|
|
|
|
+ this.children = []
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ handleChange(value) {
|
|
|
|
+ console.log(value)
|
|
|
|
+ },
|
|
// 修改类型
|
|
// 修改类型
|
|
editItem(fid, isEdit, info, idx) {
|
|
editItem(fid, isEdit, info, idx) {
|
|
this.addItem(fid, isEdit, info, idx)
|
|
this.addItem(fid, isEdit, info, idx)
|
|
@@ -184,22 +218,22 @@ export default {
|
|
const obj = this.categoryList[idx].children[index]
|
|
const obj = this.categoryList[idx].children[index]
|
|
val = obj.name
|
|
val = obj.name
|
|
}
|
|
}
|
|
- this.$prompt(' 请输入新的类型名称 ', isEdit === 1 ? '编辑' : '添加', {
|
|
|
|
|
|
+ this.$prompt(' 请输入新的名称 ', isEdit === 1 ? '编辑' : '添加', {
|
|
confirmButtonText: '确定',
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
cancelButtonText: '取消',
|
|
inputValue: val
|
|
inputValue: val
|
|
}).then(async ({ value }) => {
|
|
}).then(async ({ value }) => {
|
|
if (!value || value === '') {
|
|
if (!value || value === '') {
|
|
- this.$message.error('类型名称不能为空!')
|
|
|
|
|
|
+ this.$message.error('名称不能为空!')
|
|
} else {
|
|
} else {
|
|
const http = isEdit === 1 ? editCategory : addCategory
|
|
const http = isEdit === 1 ? editCategory : addCategory
|
|
const data = isEdit === 1 ? { fid, id: info.id, name: value } : { fid, name: value }
|
|
const data = isEdit === 1 ? { fid, id: info.id, name: value } : { fid, name: value }
|
|
http(data).then(res => {
|
|
http(data).then(res => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
- this.$message.success(isEdit === 1 ? '修改类型成功' : '添加类型成功')
|
|
|
|
|
|
+ this.$message.success(isEdit === 1 ? '修改成功' : '添加成功')
|
|
this.getCategory()
|
|
this.getCategory()
|
|
} else {
|
|
} else {
|
|
- this.$message.success(res.msg || isEdit === 1 ? '修改类型失败' : '添加类型失败')
|
|
|
|
|
|
+ this.$message.success(res.msg || isEdit === 1 ? '修改失败' : '添加失败')
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -239,7 +273,7 @@ export default {
|
|
el.style =
|
|
el.style =
|
|
"border-top:2px solid rgb(219 225 241); padding:0; color:rgb(64 158 255);font-size: 13px";
|
|
"border-top:2px solid rgb(219 225 241); padding:0; color:rgb(64 158 255);font-size: 13px";
|
|
el.innerHTML = `<li class="el-cascader-node text-center" style="height:37px;line-height: 50px;margin-left:10px;">
|
|
el.innerHTML = `<li class="el-cascader-node text-center" style="height:37px;line-height: 50px;margin-left:10px;">
|
|
- <span class="el-cascader-node__label"><i class="font-blue el-icon-plus"></i> 新增产品</span>
|
|
|
|
|
|
+ <span class="el-cascader-node__label"><i class="font-blue el-icon-plus"></i> 新增</span>
|
|
</li>`;
|
|
</li>`;
|
|
product.appendChild(el);
|
|
product.appendChild(el);
|
|
// 新增按钮点击事件
|
|
// 新增按钮点击事件
|
|
@@ -270,6 +304,13 @@ export default {
|
|
const { message, code, data } = res
|
|
const { message, code, data } = res
|
|
if (code === 200) {
|
|
if (code === 200) {
|
|
this.categoryList = data
|
|
this.categoryList = data
|
|
|
|
+ for (let i = 0; i < data.length; i++) {
|
|
|
|
+ if (data[i].mark === 'type') {
|
|
|
|
+ this.typeList = data[i]
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ console.log(this.categoryList)
|
|
|
|
+ console.log(this.typeList, 'typelist')
|
|
} else {
|
|
} else {
|
|
this.$message.error(message)
|
|
this.$message.error(message)
|
|
}
|
|
}
|
|
@@ -337,15 +378,14 @@ export default {
|
|
this.ruleForm = {
|
|
this.ruleForm = {
|
|
name: '',
|
|
name: '',
|
|
company_id: '',
|
|
company_id: '',
|
|
- img: '',
|
|
|
|
|
|
+ apply_time: '',
|
|
industry: '',
|
|
industry: '',
|
|
- degree: '',
|
|
|
|
- introduction: '',
|
|
|
|
type: '',
|
|
type: '',
|
|
- is_research: ''
|
|
|
|
|
|
+ img: '',
|
|
|
|
+ introduction: ''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- // 编辑或者添加人才信息
|
|
|
|
|
|
+ // 编辑或者添加
|
|
handleEdit(type, row) {
|
|
handleEdit(type, row) {
|
|
this.dialogVisible = true
|
|
this.dialogVisible = true
|
|
this.type = type
|
|
this.type = type
|
|
@@ -353,16 +393,31 @@ export default {
|
|
this.reset()
|
|
this.reset()
|
|
} else { // 编辑
|
|
} else { // 编辑
|
|
this.id = row.id
|
|
this.id = row.id
|
|
- this.ruleForm = {
|
|
|
|
- name: row.name,
|
|
|
|
- company_id: row.company_id,
|
|
|
|
- img: row.img,
|
|
|
|
- industry: row.industry && row.industry.id,
|
|
|
|
- degree: row.degree && row.degree.id,
|
|
|
|
- introduction: row.introduction,
|
|
|
|
- type: row.type && row.type.id,
|
|
|
|
- is_research: row.is_research
|
|
|
|
- }
|
|
|
|
|
|
+ patentInfo({ id: row.id }).then(res => {
|
|
|
|
+ const { code, data, msg } = res
|
|
|
|
+ if (code === 200) {
|
|
|
|
+ this.ruleForm = {
|
|
|
|
+ name: data.name,
|
|
|
|
+ company_id: data.company_id,
|
|
|
|
+ apply_time: data.apply_time,
|
|
|
|
+ industry: data.industry && data.industry.id,
|
|
|
|
+ img: data.img,
|
|
|
|
+ introduction: data.introduction
|
|
|
|
+ }
|
|
|
|
+ const id = data.type.child.id
|
|
|
|
+ this.ruleForm.type = id
|
|
|
|
+ if (data.type.child.child) {
|
|
|
|
+ // 两级选项
|
|
|
|
+ this.children.push(data.type.child.child)
|
|
|
|
+ this.checkedType = data.type && data.type.child.child.id
|
|
|
|
+ } else {
|
|
|
|
+ this.children = []
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(msg)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 获取列表
|
|
// 获取列表
|
|
@@ -389,8 +444,9 @@ export default {
|
|
this.$refs[formName].validate((valid) => {
|
|
this.$refs[formName].validate((valid) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
const http = this.type === 0 ? addPatent : editPatent
|
|
const http = this.type === 0 ? addPatent : editPatent
|
|
- const { name, company_id, img, industry, degree, introduction, type, is_research } = this.ruleForm
|
|
|
|
- const data = this.type === 0 ? this.ruleForm : { name, company_id, img, industry, degree, introduction, type, is_research, id: this.id }
|
|
|
|
|
|
+ this.ruleForm.type = this.checkedType ? this.checkedType : this.ruleForm.type
|
|
|
|
+ const { name, company_id, apply_time, industry, type, img, introduction } = this.ruleForm
|
|
|
|
+ const data = this.type === 0 ? this.ruleForm : { name, company_id, apply_time, industry, type, img, introduction, id: this.id }
|
|
http(data).then(res => {
|
|
http(data).then(res => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
this.$message.success(this.type === 0 ? '添加成功!' : '修改成功!')
|
|
this.$message.success(this.type === 0 ? '添加成功!' : '修改成功!')
|
|
@@ -410,7 +466,7 @@ export default {
|
|
// 删除确认
|
|
// 删除确认
|
|
handleDelete(row) {
|
|
handleDelete(row) {
|
|
const { id } = row
|
|
const { id } = row
|
|
- this.$confirm('确认要删除该人才信息吗?', '删除确认', {
|
|
|
|
|
|
+ this.$confirm('确认要删除该条内容吗?', '删除确认', {
|
|
confirmButtonText: '确定',
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
type: 'warning'
|