form.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695
  1. <template>
  2. <div>
  3. <el-drawer class="custom-drawer-form" :title="title" size="800px" append-to-body :visible.sync="drawer"
  4. direction="rtl" :before-close="close" destroy-on-close>
  5. <el-container>
  6. <el-main>
  7. <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="130px" label-position="left"
  8. class="demo-ruleForm">
  9. <el-form-item label="专利数据库名称" prop="name">
  10. <el-input v-model="ruleForm.name" placeholder="请输入专利数据库名称"></el-input>
  11. </el-form-item>
  12. <template>
  13. <div>
  14. <el-form-item label="委托方" prop="entrustName" v-if="userinfo.tenantType == 1">
  15. <mySelectButton size='large' style="width:100%" @click="handleSelect" >
  16. <div style="width:100%">
  17. <el-autocomplete style="width:100%" v-model="ruleForm.entrustName" ref="client" value-key="name" :fetch-suggestions="querySearch" v-SelectLazyLoading="loadClient"
  18. @input="input" placeholder="请输入内容" :trigger-on-focus="false" @select="handleChange">
  19. </el-autocomplete>
  20. </div>
  21. </mySelectButton>
  22. </el-form-item>
  23. <el-form-item label="委托部门" prop="departmentId" v-else>
  24. <mySelectTree style="width:100%" v-model="ruleForm.departmentId" :options="departmentList">
  25. </mySelectTree>
  26. </el-form-item>
  27. </div>
  28. </template>
  29. <el-form-item label="负责部门" prop="departmentId">
  30. <mySelectTree style="width:100%" v-model="ruleForm.departmentId" :options="departmentList"></mySelectTree>
  31. </el-form-item>
  32. <el-form-item label="负责人" prop="headId">
  33. <el-select style="width:100%" v-model="ruleForm.headId" filterable remote clearable placeholder="请选择"
  34. :loading="personnelList.loading" v-SelectLazyLoading="loadHead" :remote-method="remoteMethod">
  35. <el-option v-for="item in personnelList.data" :key="item.id" :label="item.name" :value="item.id">
  36. </el-option>
  37. </el-select>
  38. </el-form-item>
  39. <el-form-item label="事件" prop="event" >
  40. <mySelectButton size='large' style="width:100%" @click="addEvent" >
  41. <div style="width:100%">
  42. <el-select style="width:100%" v-model="ruleForm.eventId" @change="changeEvent" filterable remote :disabled="eventList.disabled" clearable placeholder="请选择"
  43. :loading="eventList.loading" v-SelectLazyLoading="loadEvent" :remote-method="remoteEvent">
  44. <el-option v-for="item in eventList.data" :key="item.id" :label="item.name" :value="item.id">
  45. </el-option>
  46. </el-select>
  47. </div>
  48. <span slot="button">
  49. <i class="el-icon-plus"></i>
  50. </span>
  51. </mySelectButton>
  52. </el-form-item>
  53. <template>
  54. <div>
  55. <el-form-item label="应用场景" prop="scenarioIds">
  56. <el-checkbox-group v-model="ruleForm.scenarioIds" @change="onChange" :disabled="Boolean(ruleForm.eventId)">
  57. <el-checkbox v-for="item in commonData" :key="item.id"
  58. :label="parseInt(item.id)">{{ item.name }}</el-checkbox>
  59. </el-checkbox-group>
  60. </el-form-item>
  61. <el-form-item label="调查类型" prop="matterIds" v-if="show == true">
  62. <el-checkbox-group v-model="ruleForm.matterIds">
  63. <template >
  64. <el-checkbox v-for="(item, index) in dictAssociateData" :key="index" :label="parseInt(item.id)">
  65. {{ item.name }}
  66. </el-checkbox>
  67. </template>
  68. </el-checkbox-group>
  69. </el-form-item>
  70. </div>
  71. </template>
  72. <template>
  73. <div>
  74. <el-form-item label="产品类别/产品" prop="productId">
  75. <div>
  76. <div v-if="ruleForm.products">
  77. {{ ruleForm.products.name }}
  78. <span style="color:blue">
  79. ({{ ruleForm.products.treeType==2?'产品':'产品类别' }})
  80. </span>
  81. <span><i class="el-icon-error cursor_pointer" @click="delProduct"></i></span>
  82. </div>
  83. <el-button size="small" v-else @click="choseProduct">+ 选择</el-button>
  84. </div>
  85. </el-form-item>
  86. <el-form-item label="分类架构" prop="structureId" v-if="ruleForm.products && ruleForm.products.fieldId">
  87. <my-select-Tree style="width:100%" :options="structureList" :props="StructureProp" v-model="ruleForm.structureId"></my-select-Tree>
  88. </el-form-item>
  89. </div>
  90. </template>
  91. <el-row :gutter="24">
  92. <el-col :span="12">
  93. <el-form-item label="合同号" prop="contractNo">
  94. <el-input v-model="ruleForm.contractNo" placeholder="请输入合同号"></el-input>
  95. </el-form-item>
  96. </el-col>
  97. <el-col :span="12">
  98. <el-form-item label="内部案卷" prop="volumeNumber">
  99. <el-input v-model="ruleForm.volumeNumber" placeholder="请输入内部案卷"></el-input>
  100. </el-form-item>
  101. </el-col>
  102. </el-row>
  103. <el-row :gutter="24">
  104. <el-col :span="12">
  105. <el-form-item label="委案日" prop="commissionCaseDay">
  106. <el-date-picker v-model="ruleForm.commissionCaseDay" value-format="yyyy-MM-dd" type="date" placeholder="请选择委案日"
  107. class="width_100"></el-date-picker>
  108. </el-form-item>
  109. </el-col>
  110. <el-col :span="12">
  111. <el-form-item label="处理状态" prop="status">
  112. <el-select v-model="ruleForm.status" placeholder="请输入处理状态" class="width_100">
  113. <el-option :value="0" label="处理中"></el-option>
  114. <el-option :value="1" label="已完成"></el-option>
  115. </el-select>
  116. </el-form-item>
  117. </el-col>
  118. </el-row>
  119. <el-row :gutter="24">
  120. <el-col :span="12">
  121. <el-form-item label="是否更新" prop="ifUpdate">
  122. <el-select v-model="ruleForm.ifUpdate" placeholder="请选择是否更新" class="width_100">
  123. <el-option :value="false" label="否"></el-option>
  124. <el-option :value="true" label="是"></el-option>
  125. </el-select>
  126. </el-form-item>
  127. </el-col>
  128. <el-col :span="12" v-if="ruleForm.ifUpdate">
  129. <el-form-item label="更新周期" required>
  130. <el-select v-model="ruleForm.updateTime" @change="getDateType" placeholder="请选择更新周期" class="width_100">
  131. <el-option v-for="item in $constants.updateCycle" :key="item.value" :value="item.value" :label="item.label"></el-option>
  132. </el-select>
  133. </el-form-item>
  134. </el-col>
  135. </el-row>
  136. <el-row :gutter="24">
  137. <el-col :span="24">
  138. <el-form-item label="更新具体时间" v-if="ruleForm.ifUpdate && ruleForm.updateTime" >
  139. <my-Time-Choose :type="ruleForm.updateTime" @value="getValue" :cron="ruleForm.crons" style="width:300px"></my-Time-Choose>
  140. </el-form-item>
  141. </el-col>
  142. </el-row>
  143. <el-form-item label="附件" prop="systemFileList">
  144. <myUpload :file-list="ruleForm.systemFileList" @on-change="onchangeFile" @on-remove="onRemove" style="height: 180px;" :autoUpload="true"></myUpload>
  145. </el-form-item>
  146. <el-form-item label="备注" prop="description">
  147. <el-input v-model="ruleForm.description" placeholder="请输入备注" type="textarea"></el-input>
  148. </el-form-item>
  149. </el-form>
  150. </el-main>
  151. <el-footer class="footer-common">
  152. <el-button @click="close">取 消</el-button>
  153. <el-button type="primary" @click="submit" :loading="loading">确 定</el-button>
  154. </el-footer>
  155. </el-container>
  156. </el-drawer>
  157. <el-dialog title="选择委托方" :visible.sync="visible" width="800px" :append-to-body="true" :close-on-click-modal="false" destroy-on-close :before-close="close2"
  158. top="10vh">
  159. <ClientTable :choseClient="true" @getClient="getClient"></ClientTable>
  160. </el-dialog>
  161. <el-dialog title="选择产品或产品类别" :visible.sync="productVisible" width="1000px" :append-to-body="true" :close-on-click-modal="false" destroy-on-close :before-close="closeProduct">
  162. <div style="height:550px">
  163. <product :isChoose="true" @chooseItem="chooseItem"></product>
  164. </div>
  165. </el-dialog>
  166. <addEvent ref="addEvent" @isSuccess="handleSuccess"></addEvent>
  167. </div>
  168. </template>
  169. <script>
  170. import ClientTable from '@/views/client'
  171. import { mapGetters } from 'vuex';
  172. import product from '@/views/product/components/index.vue'
  173. import addEvent from '@/views/event/components/dialog/addEvent.vue';
  174. import { cron } from "@/utils/model/time/mixins";
  175. export default {
  176. components: {
  177. ClientTable,
  178. product,
  179. addEvent
  180. },
  181. mixins:[cron],
  182. props: {
  183. commonData: Array
  184. },
  185. data() {
  186. return {
  187. //抽屉标题
  188. title: '',
  189. //抽屉开关标识
  190. drawer: false,
  191. //表单数据
  192. ruleForm: {},
  193. //表单规则
  194. rules: {
  195. name: [{ required: true, message: '请输入专题库名称', trigger: 'blur' },],
  196. headId:[{ required: true, message: '请选择负责人', trigger: 'change' }]
  197. },
  198. //控制选择委托方弹窗
  199. visible: false,
  200. //部门列表
  201. departmentList: [],
  202. //人员列表
  203. personnelList: {
  204. queryParams:{
  205. current:1,
  206. size:10
  207. },
  208. data:[]
  209. },
  210. //确认按钮
  211. loading: false,
  212. //显示调查类型
  213. show: false,
  214. //调查类型列表
  215. dictAssociateData: [],
  216. //用来获取调查类型
  217. test: {
  218. value: '1',
  219. type: 'ENTERPRISE_APPLICATION_SCENARIO',
  220. flag: 1
  221. },
  222. //事件列表
  223. eventList:{
  224. queryParams:{
  225. current:1,
  226. size:10
  227. },
  228. data:[]
  229. },
  230. //选择产品或产品类别
  231. productVisible:false,
  232. //产品或产品类别架构
  233. structureList:[],
  234. StructureProp:{
  235. value:'id',
  236. label: 'name',
  237. children: 'child'
  238. },
  239. //委托方
  240. clientList:{
  241. queryParams:{
  242. current:1,
  243. size:10
  244. },
  245. data:[],
  246. cb:null
  247. },
  248. };
  249. },
  250. watch: {},
  251. computed: {
  252. ...mapGetters(['userinfo'])
  253. },
  254. created() { },
  255. mounted() {
  256. },
  257. methods: {
  258. //切换更新周期
  259. getDateType(val){
  260. this.ruleForm.crons = ''
  261. },
  262. getValue(val){
  263. if (this.ruleForm.dateType=='') {
  264. this.$message.error('请先选择更新周期')
  265. return false
  266. }
  267. this.ruleForm.crons=val
  268. },
  269. //获取架构id
  270. getStructureId(val){
  271. },
  272. //获取选中的值
  273. chooseItem({row,type}){
  274. this.ruleForm.products = {
  275. treeType:type,
  276. fieldId:row.id,
  277. name:row.name,
  278. valueIds:[]
  279. }
  280. this.closeProduct()
  281. this.getFramework()
  282. },
  283. //获取产品架构集合
  284. getFramework(){
  285. let params = {
  286. type: this.ruleForm.products.treeType == 3?1:this.ruleForm.products.treeType,//类型:1产品类别,2产品,3技术分类,4自定义树
  287. typeId: this.ruleForm.products.fieldId,//产品或类别id
  288. }
  289. this.$api.queryTreeNodeTree(params).then(res => {
  290. if (res.code == 200) {
  291. this.structureList = res.data.data
  292. }
  293. }).catch(err => {
  294. })
  295. },
  296. //删除选择的产品或产品类别
  297. delProduct(){
  298. this.ruleForm.products = null
  299. this.$forceUpdate()
  300. // this.ruleForm.products=null
  301. },
  302. //打开选择产品或产品类别弹窗
  303. choseProduct(){
  304. this.productVisible = true
  305. },
  306. //关闭弹窗
  307. closeProduct(){
  308. this.productVisible = false
  309. },
  310. //打开弹窗
  311. async open(form, title) {
  312. this.ruleForm = JSON.parse(JSON.stringify(form))
  313. //获取部门列表
  314. this.getDepartment()
  315. if(this.ruleForm.scenarioIds && this.ruleForm.scenarioIds.length!=0){
  316. this.show=true
  317. this.onChange()
  318. }else{
  319. this.ruleForm.scenarioIds = []
  320. this.show=false
  321. }
  322. this.eventList.data = []
  323. this.eventList.name = ''
  324. this.eventList.disabled = false
  325. var hasEvent = false
  326. if(this.ruleForm.eventId){
  327. this.eventList.disabled = true
  328. hasEvent = true
  329. }
  330. if(this.ruleForm.eventIds && this.ruleForm.eventIds.length>0){
  331. this.ruleForm.eventId = this.ruleForm.eventIds[0]
  332. hasEvent = true
  333. }
  334. if(hasEvent){
  335. if(this.ruleForm.eventId){
  336. let params = {
  337. current:1,
  338. size:1,
  339. searchQuery:`id=${this.ruleForm.eventId}`,//检索条件
  340. orderDTOList: [
  341. {
  342. orderBy: "createTime",
  343. orderType: 1
  344. },
  345. ]//排序
  346. }
  347. await this.$api.queryEvent(params).then(response => {
  348. if(response.code == 200){
  349. this.eventList.data.push(...response.data.data)
  350. this.eventList.queryParams.total = response.data.total
  351. }
  352. })
  353. this.changeEvent(this.ruleForm.eventId)
  354. }else{
  355. this.getEventList()
  356. }
  357. }else{
  358. this.getEventList()
  359. }
  360. this.personnelList.data = []
  361. this.personnelList.queryParams.name = ''
  362. if(this.ruleForm.headId){
  363. this.personnelList.queryParams.id = this.ruleForm.headId
  364. await this.getPersonnelList(1)
  365. this.personnelList.queryParams.id = null
  366. }
  367. //获取人员列表
  368. this.getPersonnelList()
  369. if(this.ruleForm.crons){
  370. this.ruleForm.updateTime = this.getType(this.ruleForm.crons)
  371. }
  372. if(this.ruleForm.products){
  373. this.getFramework()
  374. }
  375. this.title = title
  376. this.drawer = true
  377. },
  378. //关闭抽屉
  379. close() {
  380. this.drawer = false
  381. this.clientList.queryParams.name = ''
  382. this.personnelList.queryParams.name = ''
  383. },
  384. //获取部门列表
  385. getDepartment() {
  386. this.$api.getPermissionDepartmentList().then((response) => {
  387. this.departmentList = response.data;
  388. });
  389. },
  390. /**
  391. * 事件
  392. */
  393. //打开事件弹窗
  394. addEvent(){
  395. var form = {
  396. scenarioId : this.scenarioId
  397. }
  398. this.$refs.addEvent.open(form, 1)
  399. },
  400. //事件新增成功
  401. handleSuccess(){
  402. this.eventList.data=[]
  403. this.eventList.queryParams.current = 1
  404. this.eventList.name = ''
  405. this.getEventList()
  406. },
  407. //切换事件
  408. changeEvent(val){
  409. if(!val){
  410. this.ruleForm.scenarioIds = []
  411. this.show = false
  412. this.$set(this.ruleForm,'matterIds',[])
  413. this.remoteEvent('')
  414. return
  415. }
  416. if(!this.ruleForm.matterIds){
  417. this.$set(this.ruleForm,'matterIds',[])
  418. }
  419. var obj = this.eventList.data.find(item=>{
  420. return item.id == val
  421. })
  422. if(obj){
  423. this.ruleForm.scenarioIds = [obj.scenarioId]
  424. this.show = true
  425. this.onChange()
  426. }
  427. },
  428. //懒加载事件
  429. loadEvent(){
  430. if(this.eventList.queryParams.current * this.eventList.queryParams.size>=this.eventList.queryParams.total){
  431. return false
  432. }
  433. this.eventList.queryParams.current += 1
  434. this.getEventList()
  435. },
  436. //远程搜索
  437. remoteEvent(query){
  438. this.eventList.data=[]
  439. this.eventList.queryParams.current = 1
  440. this.eventList.name = query.trim()
  441. this.getEventList(1)
  442. },
  443. //获取事件列表
  444. async getEventList(type){
  445. this.eventList.loading = true;
  446. let params = {
  447. ...this.eventList.queryParams,//分页信息
  448. searchQuery:this.eventList.name?`name=${this.eventList.name}`:'',//检索条件
  449. orderDTOList: [
  450. {
  451. orderBy: "createTime",
  452. orderType: 1
  453. },
  454. ]//排序
  455. }
  456. await this.$api.queryEvent(params).then(response => {
  457. if(response.code == 200){
  458. this.eventList.loading = false;
  459. if (!type) {
  460. if (this.ruleForm.eventId) {
  461. var index = response.data.data.findIndex(item => {
  462. return item.id == this.ruleForm.eventId
  463. })
  464. if (index != -1) {
  465. response.data.data.splice(index, 1)
  466. }
  467. }
  468. this.eventList.queryParams.total = response.data.total
  469. }
  470. this.eventList.data.push(...response.data.data)
  471. // this.eventList.queryParams.total = response.data.total
  472. }
  473. })
  474. },
  475. //获取人员列表(懒加载)
  476. loadHead(){
  477. if(this.personnelList.queryParams.current * this.personnelList.queryParams.size>=this.personnelList.queryParams.total){
  478. return false
  479. }
  480. this.personnelList.queryParams.current += 1
  481. this.getPersonnelList()
  482. },
  483. async getPersonnelList(type) {
  484. this.personnelList.loading = true;
  485. await this.$api.getPermissionPersonnel(this.personnelList.queryParams).then((response) => {
  486. if(response.code == 200){
  487. this.personnelList.loading = false;
  488. if(!type){
  489. var index = response.data.findIndex(item=>{
  490. return item.id == this.ruleForm.headId
  491. })
  492. if(index!=-1){
  493. response.data.splice(index,1)
  494. }
  495. this.personnelList.queryParams.total=response.pageColumn.total
  496. }
  497. this.personnelList.data.push(...response.data)
  498. }
  499. })
  500. },
  501. //人员远程搜索
  502. remoteMethod(query) {
  503. this.personnelList.data=[]
  504. this.personnelList.queryParams.current = 1
  505. this.personnelList.queryParams.name = query
  506. this.getPersonnelList(1)
  507. },
  508. //远程搜索委托方(建议调取接口获取)
  509. async querySearch(queryString, cb) {
  510. this.clientList.queryParams.current = 1
  511. this.clientList.queryParams.name = queryString
  512. this.clientList.data = []
  513. this.clientList.cb = cb
  514. await this.getClientList()
  515. // 调用 callback 返回建议列表的数据
  516. // cb(this.clientList.data);
  517. },
  518. loadClient(){
  519. if(this.clientList.queryParams.current * this.clientList.queryParams.size>=this.clientList.queryParams.total){
  520. return false
  521. }
  522. this.clientList.queryParams.current += 1
  523. this.getClientList()
  524. },
  525. //获取委托方
  526. async getClientList(){
  527. await this.$api.getAdminClientList(this.clientList.queryParams).then(res => {
  528. if (res.code == 200) {
  529. this.clientList.data.push(...res.data.records)
  530. this.clientList.queryParams.total = res.data.total
  531. this.clientList.cb(this.clientList.data);
  532. }
  533. })
  534. },
  535. //输入框输入事件(委托方)
  536. input() {
  537. this.$set(this.ruleForm, 'entrustId', -1)
  538. },
  539. //切换选择委托方
  540. handleChange(row) {
  541. this.$set(this.ruleForm, 'entrustId', row.id)
  542. this.$set(this.ruleForm, 'entrustName', row.name)
  543. this.close2()
  544. },
  545. //打开选择委托方弹窗
  546. handleSelect() {
  547. this.visible = true
  548. },
  549. //获取委托方信息
  550. getClient(row) {
  551. this.$set(this.ruleForm, 'entrustId', row.id)
  552. this.$set(this.ruleForm, 'entrustName', row.name)
  553. this.close2()
  554. },
  555. //关闭委托方弹窗
  556. close2() {
  557. this.visible = false
  558. },
  559. //调查类型选择切换
  560. onChange() {
  561. if (this.ruleForm.scenarioIds.length != 0) {
  562. this.show = true
  563. this.$api.getMatter(this.ruleForm.scenarioIds).then(response => {
  564. this.dictAssociateData = response.data.data
  565. })
  566. } else {
  567. this.show = false
  568. }
  569. },
  570. // 上传的文件监听
  571. onchangeFile(file, fileList) {
  572. if(!this.ruleForm.systemFileList){
  573. this.$set(this.ruleForm,'systemFileList',[])
  574. }
  575. if (file.guid) {
  576. let index = this.ruleForm.systemFileList.findIndex(item => {
  577. return item.uid == file.uid
  578. })
  579. if (index != -1) {
  580. this.ruleForm.systemFileList.splice(index, 1, file)
  581. }
  582. } else {
  583. this.ruleForm.systemFileList.push(file.raw)
  584. }
  585. },
  586. // 删除上传的文件
  587. onRemove(file, fileList) {
  588. let index = this.ruleForm.systemFileList.findIndex(item => {
  589. return item.uid == file.uid
  590. })
  591. if (index != -1) {
  592. this.ruleForm.systemFileList.splice(index, 1)
  593. }
  594. },
  595. //提交数据
  596. submit() {
  597. this.$refs.ruleForm.validate((valid) => {
  598. if (valid) {
  599. this.show = false
  600. this.loading = true
  601. this.ruleForm.trees = []
  602. if(this.ruleForm.products){
  603. if(this.ruleForm.structureId){
  604. this.ruleForm.products.valueIds.push(this.ruleForm.structureId)
  605. }
  606. this.ruleForm.trees.push(this.ruleForm.products)
  607. }
  608. var scenarioIds = JSON.parse(JSON.stringify(this.ruleForm.scenarioIds))
  609. if(this.ruleForm.eventId){
  610. this.ruleForm.events = []
  611. this.ruleForm.scenarioIds = []
  612. if(this.ruleForm.matterIds.length>0){
  613. this.ruleForm.matterIds.forEach(item=>{
  614. this.ruleForm.events.push(
  615. {
  616. matterId:item,
  617. scenarioId:scenarioIds[0],
  618. eventId:this.ruleForm.eventId
  619. }
  620. )
  621. })
  622. }else{
  623. this.ruleForm.events.push(
  624. {
  625. matterId:null,
  626. scenarioId:scenarioIds[0],
  627. eventId:this.ruleForm.eventId
  628. }
  629. )
  630. }
  631. }
  632. // 判断文件是否都上传完毕
  633. var guids = this.$commonJS.checkUploadFile(this.ruleForm.systemFileList)
  634. if(!guids){
  635. return false
  636. }
  637. this.ruleForm.fileGuids = guids
  638. if (this.ruleForm.id) {
  639. this.$api.updatePatentProject(this.ruleForm).then(response => {
  640. this.loading = false
  641. this.$message.success('编辑成功')
  642. this.$emit('submit', 0)
  643. this.close()
  644. }).catch(error => {
  645. this.loading = false
  646. })
  647. } else {
  648. this.$api.addPatentProject(this.ruleForm).then(response => {
  649. this.loading = false
  650. this.$message.success('新增成功')
  651. this.$emit('submit', 1)
  652. this.close()
  653. }).catch(error => {
  654. this.ruleForm.scenarioIds = JSON.parse(JSON.stringify(scenarioIds))
  655. this.show = true
  656. this.loading = false
  657. })
  658. }
  659. }
  660. })
  661. },
  662. },
  663. };
  664. </script>
  665. <style lang="scss" scoped></style>