|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<el-dialog :title="title" :visible.sync="dialogVisible" width="850px" :before-close="handleClose">
|
|
|
- <el-form :model="form" status-icon :rules="rules" ref="form" label-width="120px" class="demo-ruleForm">
|
|
|
+ <el-form :model="form" status-icon :rules="rules" ref="form" label-width="120px" class="demo-form">
|
|
|
<template>
|
|
|
<!-- 研发项目 -->
|
|
|
<el-divider content-position="left">研发项目</el-divider>
|
|
@@ -104,33 +104,59 @@
|
|
|
</el-col>
|
|
|
|
|
|
</el-row>
|
|
|
+ <template v-if="!form.id">
|
|
|
+ <div>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="事件:">
|
|
|
+ <mySelectButton size='large' style="width:100%" @click="addEvent">
|
|
|
+ <div style="width:100%">
|
|
|
+ <el-select style="width:100%" v-model="form.eventId" @change="changeEvent" filterable remote
|
|
|
+ clearable placeholder="请选择" :loading="eventList.loading" v-SelectLazyLoading="loadEvent"
|
|
|
+ :remote-method="remoteEvent">
|
|
|
+ <el-option v-for="item in eventList.data" :key="item.id" :label="item.name" :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ </mySelectButton>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row v-if="show == true">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="调查类型:" prop="matterIds">
|
|
|
+ <el-checkbox-group v-model="form.matterIds">
|
|
|
+ <template>
|
|
|
+ <el-checkbox v-for="item in dictAssociates" :key="item.id" :label="parseInt(item.id)">
|
|
|
+ {{ item.name }}
|
|
|
+ </el-checkbox>
|
|
|
+ </template>
|
|
|
+ </el-checkbox-group>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
- <el-form-item label="事件:">
|
|
|
- <mySelectButton size='large' style="width:100%" @click="addEvent">
|
|
|
- <div style="width:100%">
|
|
|
- <el-select style="width:100%" v-model="form.eventId" @change="changeEvent" filterable remote clearable
|
|
|
- placeholder="请选择" :loading="eventList.loading" v-SelectLazyLoading="loadEvent"
|
|
|
- :remote-method="remoteEvent">
|
|
|
- <el-option v-for="item in eventList.data" :key="item.id" :label="item.name" :value="item.id">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </div>
|
|
|
- </mySelectButton>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row v-if="show == true">
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="调查类型:" prop="matterIds">
|
|
|
- <el-checkbox-group v-model="form.matterIds">
|
|
|
- <template>
|
|
|
- <el-checkbox v-for="item in dictAssociates" :key="item.id" :label="parseInt(item.id)">
|
|
|
- {{ item.name }}
|
|
|
- </el-checkbox>
|
|
|
- </template>
|
|
|
- </el-checkbox-group>
|
|
|
- </el-form-item>
|
|
|
+ <template>
|
|
|
+ <div>
|
|
|
+ <el-form-item label="委托方" prop="entrustId" v-if="userinfo.tenantType == 1">
|
|
|
+ <mySelectButton size='large' style="width:100%" @click="handleSelect">
|
|
|
+ <div style="width:100%">
|
|
|
+ <el-autocomplete style="width:100%" v-model="form.entrustName" ref="client" value-key="name"
|
|
|
+ :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="departmentId" v-else>
|
|
|
+ <mySelectTree style="width:100%" v-model="form.departmentId" :options="departmentList"></mySelectTree>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-row>
|
|
@@ -168,14 +194,22 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
<choosePerson ref="choosePerson" @getPersonIds="getPersonIds"></choosePerson>
|
|
|
+
|
|
|
+ <el-dialog title="选择委托方" :visible.sync="visible" width="800px" append-to-body destroy-on-close :before-close="close2"
|
|
|
+ top="10vh">
|
|
|
+ <ClientTable :choseClient="true" @getClient="getClient"></ClientTable>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { mapGetters } from 'vuex'
|
|
|
import choosePerson from '@/views/components/dialog/person.vue'
|
|
|
+import ClientTable from '@/views/client'
|
|
|
export default {
|
|
|
components: {
|
|
|
choosePerson,
|
|
|
+ ClientTable,
|
|
|
},
|
|
|
props: {},
|
|
|
data() {
|
|
@@ -217,6 +251,18 @@ export default {
|
|
|
},
|
|
|
data: []
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 委托方
|
|
|
+ */
|
|
|
+ clientList: {
|
|
|
+ queryParams: {
|
|
|
+ current: 1,
|
|
|
+ size: 10
|
|
|
+ },
|
|
|
+ data: [],
|
|
|
+ cb: null
|
|
|
+ },
|
|
|
+ visible: false,
|
|
|
// 控制调查类型是否显示
|
|
|
show: false,
|
|
|
//调查类型列表
|
|
@@ -224,13 +270,74 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
watch: {},
|
|
|
- computed: {},
|
|
|
+ computed: {
|
|
|
+ ...mapGetters(['webSocket', 'userinfo']),
|
|
|
+ },
|
|
|
created() { },
|
|
|
mounted() {
|
|
|
// 获取人员列表
|
|
|
this.getPermissionPersonnel();
|
|
|
},
|
|
|
methods: {
|
|
|
+ /**
|
|
|
+ * 客户/委托方
|
|
|
+ * @param {*} query
|
|
|
+ */
|
|
|
+ //远程搜索委托方(建议调取接口获取)
|
|
|
+ async querySearch(queryString, cb) {
|
|
|
+ this.clientList.queryParams.current = 1
|
|
|
+ this.clientList.queryParams.name = queryString
|
|
|
+ this.clientList.data = []
|
|
|
+ this.clientList.cb = cb
|
|
|
+ await this.getClientList()
|
|
|
+ // 调用 callback 返回建议列表的数据
|
|
|
+ // cb(this.clientList.data);
|
|
|
+ },
|
|
|
+ loadClient() {
|
|
|
+ if (this.clientList.queryParams.current * this.clientList.queryParams.size >= this.clientList.queryParams.total) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ this.clientList.queryParams.current += 1
|
|
|
+ this.getClientList()
|
|
|
+ },
|
|
|
+ //获取委托方
|
|
|
+ async getClientList() {
|
|
|
+ await this.$api.getAdminClientList(this.clientList.queryParams).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.clientList.data.push(...res.data.records)
|
|
|
+ this.clientList.queryParams.total = res.data.total
|
|
|
+ this.clientList.cb(this.clientList.data);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //输入框输入事件(委托方)
|
|
|
+ input() {
|
|
|
+ this.$set(this.form, 'entrustId', -1)
|
|
|
+ },
|
|
|
+ //切换选择委托方
|
|
|
+ handleChange(row) {
|
|
|
+ this.$set(this.form, 'entrustId', row.id)
|
|
|
+ this.$set(this.form, 'entrustName', row.name)
|
|
|
+ this.close2()
|
|
|
+ },
|
|
|
+ //打开选择委托方弹窗
|
|
|
+ handleSelect() {
|
|
|
+ this.visible = true
|
|
|
+ },
|
|
|
+ //获取委托方信息
|
|
|
+ getClient(row) {
|
|
|
+ this.$set(this.form, 'entrustId', row.id)
|
|
|
+ this.$set(this.form, 'entrustName', row.name)
|
|
|
+ this.close2()
|
|
|
+ },
|
|
|
+ //关闭委托方弹窗
|
|
|
+ close2() {
|
|
|
+ this.visible = false
|
|
|
+ },
|
|
|
+
|
|
|
+ /*
|
|
|
+ * 事件
|
|
|
+ */
|
|
|
//打开事件弹窗
|
|
|
addEvent() {
|
|
|
|
|
@@ -294,6 +401,7 @@ export default {
|
|
|
await this.onChange()
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
//调查类型选择切换
|
|
|
async onChange() {
|
|
|
if (this.form.scenarioIds.length != 0) {
|
|
@@ -330,6 +438,10 @@ export default {
|
|
|
})
|
|
|
return arr.join('、')
|
|
|
},
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 研发编号
|
|
|
+ */
|
|
|
// 研发编号懒加载方法
|
|
|
load() {
|
|
|
if (this.rdNumberArr.queryParams.current * this.rdNumberArr.queryParams.size >= this.rdNumberArr.queryParams.total) {
|
|
@@ -361,6 +473,11 @@ export default {
|
|
|
this.rdNumberArr.cb = cb
|
|
|
await this.getRdProjectByNumber()
|
|
|
},
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 人员列表
|
|
|
+ * @param {*} query
|
|
|
+ */
|
|
|
// 人员列表远程搜索
|
|
|
remoteMethodPerson(query) {
|
|
|
this.personnelList.data = []
|
|
@@ -398,6 +515,10 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 上传文件处理
|
|
|
+ * */
|
|
|
// 上传的文件监听
|
|
|
onchangeFile(file, fileList) {
|
|
|
if (file.guid) {
|
|
@@ -406,7 +527,6 @@ export default {
|
|
|
})
|
|
|
if (index != -1) {
|
|
|
this.form.systemFileList.splice(index, 1, file)
|
|
|
- this.form.fileGuids.push(file.guid)
|
|
|
}
|
|
|
} else {
|
|
|
this.form.systemFileList.push(file.raw)
|
|
@@ -415,50 +535,19 @@ export default {
|
|
|
},
|
|
|
// 删除上传的文件
|
|
|
onRemove(file, fileList) {
|
|
|
- if (file.guid) {
|
|
|
- let index = this.form.systemFileList.findIndex(item => {
|
|
|
- return item.guid == file.guid
|
|
|
- })
|
|
|
- if (index!=-1) {
|
|
|
- this.form.systemFileList.splice(index, 1)
|
|
|
- }
|
|
|
- let index2 = this.form.fileGuids.findIndex(item => {
|
|
|
- return item == file.guid
|
|
|
- })
|
|
|
- if (index2 != -1) {
|
|
|
- this.form.fileGuids.splice(index2, 1)
|
|
|
- }
|
|
|
- } else {
|
|
|
- let index3 = this.form.systemFileList.findIndex(item => {
|
|
|
- return item.uid == file.uid
|
|
|
- })
|
|
|
- if (index3 != -1) {
|
|
|
- this.form.fileGuids.splice(index3, 1)
|
|
|
- }
|
|
|
+ let index = this.form.systemFileList.findIndex(item => {
|
|
|
+ return item.uid == file.uid
|
|
|
+ })
|
|
|
+ if (index != -1) {
|
|
|
+ this.form.systemFileList.splice(index, 1)
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
+
|
|
|
//打开弹窗
|
|
|
async open(form) {
|
|
|
if (form && form.id) {
|
|
|
this.form = JSON.parse(JSON.stringify(form))
|
|
|
- // 事件
|
|
|
- if (this.form.eventIds && this.form.eventIds.length > 0) {
|
|
|
- this.form.eventId = this.form.eventIds[0]
|
|
|
- this.onChange()
|
|
|
- this.eventList.queryParams.id = this.form.eventId[0]
|
|
|
- await this.getEventList(1)
|
|
|
- this.eventList.queryParams.id = null
|
|
|
- this.show = true
|
|
|
- } else {
|
|
|
- this.show = false
|
|
|
- }
|
|
|
- // 文件
|
|
|
- if (this.form.systemFileList && this.form.systemFileList.length > 0) {
|
|
|
- this.$set(this.form, 'fileGuids', [])
|
|
|
- this.form.systemFileList.forEach(item => {
|
|
|
- this.form.fileGuids.push(item.guid)
|
|
|
- })
|
|
|
- }
|
|
|
// 负责人
|
|
|
if (this.form.headId) {
|
|
|
this.personnelList.queryParams.id = this.form.headId
|
|
@@ -483,7 +572,7 @@ export default {
|
|
|
this.title = '新增专利挖掘项目'
|
|
|
}
|
|
|
this.getPermissionPersonnel()
|
|
|
- this.getEventList()
|
|
|
+ // this.getEventList()
|
|
|
this.dialogVisible = true
|
|
|
},
|
|
|
//关闭弹窗
|
|
@@ -501,12 +590,19 @@ export default {
|
|
|
submit() {
|
|
|
this.$refs.form.validate((valid) => {
|
|
|
if (valid) {
|
|
|
- // 判断文件是否全部上传完毕
|
|
|
- if ((this.form.fileGuids && this.form.fileGuids.length) != (this.form.systemFileList && this.form.systemFileList.length)) {
|
|
|
- this.$message.error('您有文件未上传完毕,请您稍等片刻~~~')
|
|
|
- return false
|
|
|
+ // 判断文件是否都上传完毕
|
|
|
+ if (this.form.systemFileList && this.form.systemFileList.length > 0) {
|
|
|
+ this.form.fileGuids = []
|
|
|
+ for (let i = 0; i < this.form.systemFileList.length; i++) {
|
|
|
+ if (this.form.systemFileList[i].guid) {
|
|
|
+ this.form.fileGuids.push(this.form.systemFileList[i].guid)
|
|
|
+ } else {
|
|
|
+ this.$message.error('文件未全部上传,请耐心等待')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- if (this.form.scenarioIds && this.form.scenarioIds.length>0) {
|
|
|
+ if (this.form.scenarioIds && this.form.scenarioIds.length > 0) {
|
|
|
var scenarioIds = JSON.parse(JSON.stringify(this.form.scenarioIds))
|
|
|
}
|
|
|
if (this.form.eventId) {
|
|
@@ -532,9 +628,13 @@ export default {
|
|
|
this.$api.addPatentDigProject(this.form).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.$message.success('新增专利挖掘项目成功')
|
|
|
- this.$emit('isSuccess', true)
|
|
|
+ this.$emit('isSuccess', '新增成功')
|
|
|
this.handleClose()
|
|
|
}
|
|
|
+ }).catch(error => {
|
|
|
+ // 如果报告未创建成功,则赋值
|
|
|
+ this.form.scenarioIds = JSON.parse(JSON.stringify(scenarioIds))
|
|
|
+ this.show = true
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -542,7 +642,7 @@ export default {
|
|
|
this.$api.updatePatentDigProject(this.form).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.$message.success('更新专利挖掘项目成功')
|
|
|
- this.$emit('isSuccess', true)
|
|
|
+ this.$emit('isSuccess', '更新成功')
|
|
|
this.handleClose()
|
|
|
}
|
|
|
})
|
|
@@ -570,13 +670,13 @@ export default {
|
|
|
destroyed() {
|
|
|
// 清空事件相关
|
|
|
this.form.eventIds = []
|
|
|
- this.eventList.queryParams.current=1
|
|
|
+ this.eventList.queryParams.current = 1
|
|
|
// 清空负责人相关
|
|
|
this.form.involvedPersons = []
|
|
|
this.form.adminIds = []
|
|
|
this.form.adminPersons = []
|
|
|
this.personnelList.data = []
|
|
|
- this.personnelList.queryParams.current=1
|
|
|
+ this.personnelList.queryParams.current = 1
|
|
|
},
|
|
|
};
|
|
|
</script>
|