|
@@ -4,24 +4,24 @@
|
|
|
direction="rtl" :before-close="close" destroy-on-close>
|
|
|
<el-container>
|
|
|
<el-main>
|
|
|
- <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="130px" label-position="left"
|
|
|
+ <el-form :model="ruleForm" :rules="rules" ref="ruleForm1" label-width="130px" label-position="left"
|
|
|
class="demo-ruleForm">
|
|
|
<el-form-item label="专题库名称" prop="name">
|
|
|
<el-input v-model="ruleForm.name" placeholder="请输入专题库名称"></el-input>
|
|
|
</el-form-item>
|
|
|
<template>
|
|
|
<div>
|
|
|
- <el-form-item label="委托方" prop="name" v-if="userinfo.tenantType == 1">
|
|
|
+ <el-form-item label="委托方" prop="entrustName" v-if="userinfo.tenantType == 1">
|
|
|
|
|
|
<mySelectButton size='large' style="width:100%" @click="handleSelect">
|
|
|
<div slot="select" style="width:100%">
|
|
|
- <el-autocomplete style="width:100%" v-model="ruleForm.clientName" :fetch-suggestions="querySearch"
|
|
|
+ <el-autocomplete style="width:100%" v-model="ruleForm.entrustName" ref="client" :fetch-suggestions="querySearch" v-SelectLazyLoading="loadClient"
|
|
|
@input="input" placeholder="请输入内容" :trigger-on-focus="false" @select="handleChange">
|
|
|
</el-autocomplete>
|
|
|
</div>
|
|
|
</mySelectButton>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="委托部门" prop="name" v-else>
|
|
|
+ <el-form-item label="委托部门" prop="departmentId" v-else>
|
|
|
<mySelectTree style="width:100%" v-model="ruleForm.departmentId" :options="departmentList">
|
|
|
</mySelectTree>
|
|
|
</el-form-item>
|
|
@@ -32,8 +32,8 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="负责人" prop="person">
|
|
|
<el-select style="width:100%" v-model="ruleForm.headId" filterable remote clearable placeholder="请选择"
|
|
|
- :loading="loading" v-SelectLazyLoading="lazyLoading" :remote-method="remoteMethod">
|
|
|
- <el-option v-for="item in personnelList" :key="item.id" :label="item.name" :value="item.id">
|
|
|
+ :loading="loading" v-SelectLazyLoading="loadHead" :remote-method="remoteMethod">
|
|
|
+ <el-option v-for="item in personnelList.data" :key="item.id" :label="item.name" :value="item.id">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
@@ -62,8 +62,8 @@
|
|
|
:label="parseInt(item.value)">{{ item.label }}</el-checkbox>
|
|
|
</el-checkbox-group>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="调查类型" prop="typeList" v-if="show == true">
|
|
|
- <el-checkbox-group v-model="ruleForm.typeList">
|
|
|
+ <el-form-item label="调查类型" prop="matterIds" v-if="show == true">
|
|
|
+ <el-checkbox-group v-model="ruleForm.matterIds">
|
|
|
<template v-for="(item, index) in dictAssociateData">
|
|
|
<el-checkbox :label="parseInt(item.dictChildValue)">
|
|
|
{{ item.dictChildLabel }}
|
|
@@ -85,12 +85,6 @@
|
|
|
<div>
|
|
|
<el-form-item label="产品类别/产品" prop="productId" v-if="$permission('/workspace/product')">
|
|
|
<div>
|
|
|
- <!-- <mySelectButton size='large' style="width:100%">
|
|
|
- <div slot="select" style="width:100%">
|
|
|
- <mySelectTree style="width:100%" v-model="ruleForm.departmentId" :options="departmentList">
|
|
|
- </mySelectTree>
|
|
|
- </div>
|
|
|
- </mySelectButton> -->
|
|
|
<div v-if="ruleForm.products">
|
|
|
{{ ruleForm.products.name }}
|
|
|
<span style="color:blue">
|
|
@@ -134,6 +128,33 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="是否更新" prop="ifUpdate">
|
|
|
+ <el-select v-model="ruleForm.ifUpdate" placeholder="请选择是否更新" class="width_100">
|
|
|
+ <el-option :value="false" label="否"></el-option>
|
|
|
+ <el-option :value="true" label="是"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" v-if="ruleForm.ifUpdate">
|
|
|
+ <el-form-item label="更新周期" required>
|
|
|
+ <el-select v-model="ruleForm.updateTime" @change="getDateType" placeholder="请选择更新周期" class="width_100">
|
|
|
+ <el-option value="day" label="每天"></el-option>
|
|
|
+ <el-option value="week" label="每周"></el-option>
|
|
|
+ <el-option value="month" label="每月"></el-option>
|
|
|
+ <el-option value="year" label="每年"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="24">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="更新具体时间" v-if="ruleForm.ifUpdate && ruleForm.updateTime" >
|
|
|
+ <my-Time-Choose :type="ruleForm.updateTime" @value="getValue" :cron="ruleForm.crons" style="width:300px"></my-Time-Choose>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
<el-form-item label="备注" prop="description">
|
|
|
<el-input v-model="ruleForm.description" placeholder="请输入备注" type="textarea"></el-input>
|
|
|
</el-form-item>
|
|
@@ -188,7 +209,13 @@ export default {
|
|
|
//部门列表
|
|
|
departmentList: [],
|
|
|
//人员列表
|
|
|
- personnelList: [],
|
|
|
+ personnelList: {
|
|
|
+ queryParams:{
|
|
|
+ current:1,
|
|
|
+ size:10
|
|
|
+ },
|
|
|
+ data:[]
|
|
|
+ },
|
|
|
//负责人下拉加载
|
|
|
loading: false,
|
|
|
//显示调查类型
|
|
@@ -227,6 +254,14 @@ export default {
|
|
|
showEvent:true,
|
|
|
//选择产品或产品类别
|
|
|
productVisible:false,
|
|
|
+ //委托方
|
|
|
+ clientList:{
|
|
|
+ queryParams:{
|
|
|
+ current:1,
|
|
|
+ size:10
|
|
|
+ },
|
|
|
+ data:[]
|
|
|
+ }
|
|
|
|
|
|
};
|
|
|
},
|
|
@@ -238,6 +273,17 @@ export default {
|
|
|
mounted() {
|
|
|
},
|
|
|
methods: {
|
|
|
+ //切换更新周期
|
|
|
+ getDateType(val){
|
|
|
+ this.ruleForm.crons = ''
|
|
|
+ },
|
|
|
+ getValue(val){
|
|
|
+ if (this.ruleForm.dateType=='') {
|
|
|
+ this.$message.error('请先选择更新周期')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ this.ruleForm.crons=val
|
|
|
+ },
|
|
|
//获取架构id
|
|
|
getStructureId(val){
|
|
|
|
|
@@ -261,7 +307,6 @@ export default {
|
|
|
//打开选择产品或产品类别弹窗
|
|
|
choseProduct(){
|
|
|
this.productVisible = true
|
|
|
-
|
|
|
},
|
|
|
//关闭弹窗
|
|
|
closeProduct(){
|
|
@@ -320,10 +365,18 @@ export default {
|
|
|
this.departmentList = response.data;
|
|
|
});
|
|
|
},
|
|
|
- //获取人员列表
|
|
|
+ //获取人员列表(懒加载)
|
|
|
+ loadHead(){
|
|
|
+ if(this.personnelList.queryParams.current * this.personnelList.queryParams.size>=this.personnelList.queryParams.total){
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ this.personnelList.queryParams.current += 1
|
|
|
+ this.getPersonnelList()
|
|
|
+ },
|
|
|
getPersonnelList() {
|
|
|
- this.$api.getPermissionPersonnelList().then((response) => {
|
|
|
- this.personnelList = response.data
|
|
|
+ this.$api.getPermissionPersonnel(this.personnelList.queryParams).then((response) => {
|
|
|
+ this.personnelList.data.push(...response.data)
|
|
|
+ this.personnelList.queryParams.total=response.pageColumn.total
|
|
|
})
|
|
|
},
|
|
|
//关闭抽屉
|
|
@@ -331,22 +384,32 @@ export default {
|
|
|
this.drawer = false
|
|
|
},
|
|
|
//远程搜索(建议调取接口获取)
|
|
|
- querySearch(queryString, cb) {
|
|
|
- // var clientList = this.clientList;
|
|
|
- // var results = (queryString ? clientList.filter(this.createFilter(queryString)) : clientList).map(item=>{
|
|
|
- // return {
|
|
|
- // value:item.name,
|
|
|
- // name:item.name,
|
|
|
- // id:item.id
|
|
|
- // }
|
|
|
- // });
|
|
|
+ async querySearch(queryString, cb) {
|
|
|
+ this.clientList.queryParams.current = 1
|
|
|
+ this.clientList.queryParams.name = queryString
|
|
|
+ this.clientList.data = []
|
|
|
+ await this.getClientList()
|
|
|
// // 调用 callback 返回建议列表的数据
|
|
|
- // cb(results);
|
|
|
+ cb(this.clientList.data);
|
|
|
+ },
|
|
|
+ loadClient(){
|
|
|
+ this.clientList.queryParams.current += 1
|
|
|
+ this.getClientList('load')
|
|
|
},
|
|
|
- createFilter(queryString) {
|
|
|
- return (clientList) => {
|
|
|
- return (clientList.name && clientList.name.toLowerCase().indexOf(queryString.toLowerCase()) != -1);
|
|
|
- };
|
|
|
+ //获取委托方
|
|
|
+ async getClientList(type){
|
|
|
+ await this.$api.getAdminClientList(this.clientList.queryParams).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ res.data.records.forEach(item => {
|
|
|
+ item.value = item.name
|
|
|
+ });
|
|
|
+ if(type){
|
|
|
+ this.$refs['client'].$data.suggestions.push(...res.data.records)
|
|
|
+ }else{
|
|
|
+ this.clientList.data.push(...res.data.records)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
//输入框输入事件(委托方)
|
|
|
input() {
|
|
@@ -355,7 +418,7 @@ export default {
|
|
|
//切换选择委托方
|
|
|
handleChange(row) {
|
|
|
this.$set(this.ruleForm, 'entrustId', row.id)
|
|
|
- this.$set(this.ruleForm, 'clientName', row.name)
|
|
|
+ this.$set(this.ruleForm, 'entrustName', row.name)
|
|
|
this.close2()
|
|
|
},
|
|
|
//打开选择委托方弹窗
|
|
@@ -365,7 +428,7 @@ export default {
|
|
|
//获取委托方信息
|
|
|
getClient(row) {
|
|
|
this.$set(this.ruleForm, 'entrustId', row.id)
|
|
|
- this.$set(this.ruleForm, 'clientName', row.name)
|
|
|
+ this.$set(this.ruleForm, 'entrustName', row.name)
|
|
|
this.close2()
|
|
|
},
|
|
|
//关闭委托方弹窗
|
|
@@ -428,7 +491,7 @@ export default {
|
|
|
this.loading = false
|
|
|
})
|
|
|
} else {
|
|
|
- this.$api.addProject(this.ruleForm).then(response => {
|
|
|
+ this.$api.addPatentProject(this.ruleForm).then(response => {
|
|
|
this.loading = false
|
|
|
let permissions = this.permissions
|
|
|
permissions[response.data] = 0
|