Przeglądaj źródła

修改一张图,修改项目流转中去掉项目安排

余思翰 11 miesięcy temu
rodzic
commit
adc76a1581

+ 1
- 0
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcProjectMapper.xml Wyświetl plik

@@ -79,6 +79,7 @@
79 79
     <select id="selectCmcProjectList" parameterType="CmcProject" resultMap="CmcProjectResult">
80 80
         <include refid="selectCmcProjectVo"/>
81 81
         <where>
82
+            <if test="projectId != null  and projectId != ''"> and p.project_id = #{projectId}</if>
82 83
             <if test="projectNumber != null  and projectNumber != ''"> and p.project_number like concat('%', #{projectNumber}, '%')</if>
83 84
             <if test="projectName != null  and projectName != ''"> and p.project_name like concat('%', #{projectName}, '%')</if>
84 85
             <if test="projectLeader != null "> and p.project_leader = #{projectLeader}</if>

+ 8
- 1
oa-ui/src/utils/deleteResource.js Wyświetl plik

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2024-06-13 17:07:59
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-06-19 16:43:47
5
+ * @LastEditTime: 2024-07-02 17:43:54
6 6
  */
7 7
 import request from '@/utils/request'
8 8
 
@@ -42,6 +42,13 @@ const apiEndpoints = [
42 42
     apiUrl: [
43 43
       '/oa/carApproval/:id',
44 44
     ]
45
+  },
46
+  {
47
+    procDefName: '项目流转',
48
+    apiUrl: [
49
+      '/oa/project/:id',
50
+      '/oa/projectWork/:id',
51
+    ]
45 52
   }
46 53
 ]
47 54
 

+ 8
- 2
oa-ui/src/utils/maps.js Wyświetl plik

@@ -1,3 +1,9 @@
1
+/*
2
+ * @Author: ysh
3
+ * @Date: 2024-06-25 10:11:45
4
+ * @LastEditors: 
5
+ * @LastEditTime: 2024-07-01 13:54:24
6
+ */
1 7
 
2 8
 import TileLayer from 'ol/layer/Tile';
3 9
 import { Cluster, Vector as VectorSource, XYZ } from 'ol/source';
@@ -20,7 +26,7 @@ const ZhongKe = new TileLayer({
20 26
   properties: {
21 27
     name: '中科星图'
22 28
   },
23
-  visible: false
29
+  visible: true
24 30
 })
25 31
 
26 32
 // ArcGIS
@@ -42,7 +48,7 @@ const Autonavi = new TileLayer({
42 48
   properties: {
43 49
     name: '高德'
44 50
   },
45
-  visible: true
51
+  visible: false
46 52
 })
47 53
 // 谷歌
48 54
 const google = new TileLayer({

+ 259
- 26
oa-ui/src/views/file/index.vue Wyświetl plik

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2024-06-21 18:51:49
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-06-28 16:49:32
5
+ * @LastEditTime: 2024-07-01 17:05:09
6 6
 -->
7 7
 <template>
8 8
   <div class="warpper-container">
@@ -57,7 +57,7 @@
57 57
           <div class="title">项目编号:{{ clickFeacture.projectNumber }}</div>
58 58
           <el-descriptions :column="1" border>
59 59
             <el-descriptions-item label="名称" width="130px">
60
-              {{ clickFeacture.selectFeatures.values_.name }}
60
+              <!-- {{ clickFeacture.selectFeatures.values_.name }} -->
61 61
             </el-descriptions-item>
62 62
           </el-descriptions>
63 63
         </div>
@@ -170,6 +170,8 @@
170 170
         </div>
171 171
       </div>
172 172
     </div>
173
+
174
+
173 175
   </div>
174 176
 </template>
175 177
 
@@ -177,6 +179,7 @@
177 179
 import { Tianditu, ZhongKe, ArcGISBlue, Autonavi, google, terrain, vect } from '@/utils/maps'
178 180
 import { listProject, getProject } from '@/api/oa/project/project'
179 181
 import infoBox from './index/infoBox.vue';
182
+import sjxActive from '@/assets/images/gis/sjd.png';
180 183
 // ---------------------------------ol引用------------------------------------------------
181 184
 import 'ol/ol.css'
182 185
 import { Map, View } from 'ol';
@@ -212,6 +215,9 @@ export default {
212 215
       select: null,
213 216
       popup: null,
214 217
       clusters: null,
218
+      drawBox: null,
219
+
220
+      isDrawing: false,
215 221
       viewCenter: [105.55, 34.18],
216 222
       layersOpen: false,
217 223
       isOpenPro: false, //项目列表是否展开
@@ -227,15 +233,18 @@ export default {
227 233
         selectFeatures: null,
228 234
         selectProjectNumber: "",
229 235
         type: '',
230
-      }
236
+      },
237
+      seletctedCluters: []
231 238
     }
232 239
   },
233 240
   mounted() {
234 241
     this.setTableDomHeight();
235 242
     this.initMap();
243
+    this.observer();
236 244
     this.getProjectList();
237 245
   },
238 246
   methods: {
247
+    // 设置侧边项目目录的高度
239 248
     setTableDomHeight() {
240 249
       let dom = document.querySelector('.right-project');
241 250
       dom.style.height = window.innerHeight - 110 + 'px'; //减去110为页头的高度
@@ -250,6 +259,7 @@ export default {
250 259
         resolve()
251 260
       })
252 261
     },
262
+    // 初始化地图
253 263
     initMap() {
254 264
       this.view = new View({
255 265
         projection: "EPSG:4326", // 坐标系,有EPSG:4326和EPSG:3857
@@ -276,7 +286,7 @@ export default {
276 286
         target: 'maps',
277 287
         controls: defaultControls().extend([this.control]),
278 288
         layers: [
279
-          Autonavi,
289
+          Autonavi, Tianditu, ZhongKe,
280 290
           new TileLayer({//标注
281 291
             source: new XYZ({
282 292
               url: "http://webst02.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=8",
@@ -290,35 +300,122 @@ export default {
290 300
       })
291 301
       this.map.addOverlay(this.popup);
292 302
       this.mapClick(this.map, this.popup);
303
+      // this.clickFeacturePopInfo();
304
+      this.addKeyDownFun()
293 305
     },
306
+    observer() {
307
+      let that = this;
308
+      // 选择需要观察变动的节点
309
+      const targetNode = document.querySelector('.sidebar-container');
310
+      // 观察器的配置(需要观察什么变动)
311
+      const config = { attributes: true, childList: true, subtree: true }
312
+      // 当观察到变动时执行的回调函数
313
+      const callback = function (mutationsList, observer) {
314
+        for (let mutation of mutationsList) {
315
+          if (mutation.type === 'childList') {
316
+          } else if (mutation.type === 'attributes') {
317
+            that.map.updateSize();
318
+          }
319
+        }
320
+      }
321
+      // 创建一个观察器实例并传入回调函数
322
+      const observer = new MutationObserver(callback);
323
+      // 以上述配置开始观察目标节点
324
+      observer.observe(targetNode, config);
325
+    },
326
+    addKeyDownFun() {
327
+      // 添加键盘事件监听器  
328
+      window.addEventListener('keydown', (event) => {
329
+        if (event.key === 'Escape') { // 检查是否按下了 ESC 键  
330
+          // 停止当前的绘制(或清除框选)  
331
+          if (this.drawBox && this.drawBox.getActive()) {
332
+            this.drawBox.finishDrawing(); // 如果有正在进行的绘制,结束它  
333
+            // 如果需要清除之前的绘制结果,可以在这里添加逻辑  
334
+            this.map.removeInteraction(this.drawBox);
335
+          }
336
+        }
337
+      });
338
+    },
339
+    // 地图点击事件
294 340
     mapClick(map, popup) {
295 341
       let that = this;
296 342
       map.on('singleclick', function (evt) {
297
-        const coordinate = evt.coordinate;
298
-        let features = map.forEachFeatureAtPixel(evt.pixel, (feature) => {
299
-          return feature;
300
-        });
301
-        if (features != undefined && features != null && features != "") {
302
-          let feature = features.values_.features;
303
-          if (feature.length == 1) {
304
-            let num = feature[0].name
305
-            let projectId = feature[0].projectId
306
-            getProject(projectId).then(res => {
307
-              if (res.data) {
308
-                that.clickFeacture = res.data;
309
-                that.clickFeacture.type = 'projectPoint';
310
-                console.log(that.clickFeacture);
311
-                popup.setPosition(coordinate);
312
-              }
313
-            })
343
+        if (!that.isDrawing) {
344
+          const coordinate = evt.coordinate;
345
+          let features = map.forEachFeatureAtPixel(evt.pixel, function (feature) {
346
+            // 如果只需要知道有特征,而不关心具体是哪个,这里可以返回 true  
347
+            // OpenLayers 会继续查找更多特征,但我们不需要  
348
+            return true;
349
+          });
350
+
351
+          // features 现在是一个数组,包含了在点击像素位置找到的所有特征  
352
+          if (features && features.length > 0) {
353
+            // 如果只有一个特征  
354
+            if (features.length === 1) {
355
+              let feature = features[0]; // 直接从数组中取第一个特征  
356
+              let num = feature.get('name'); // 使用 get 方法来获取属性  
357
+              let projectId = feature.get('projectId');
358
+
359
+              // 假设 getProject 是一个返回 Promise 的函数  
360
+              getProject(projectId).then(res => {
361
+                if (res.data) {
362
+                  // 假设 this 在这里指向 Vue 组件实例或其他上下文  
363
+                  that.clickFeature = res.data;
364
+                  that.clickFeature.type = 'projectPoint';
365
+                  popup.setPosition(coordinate);
366
+                }
367
+              })
368
+            } else {
369
+              // 如果有多个特征,这里可以根据需要处理  
370
+              popup.setPosition(undefined);
371
+            }
314 372
           } else {
315 373
             popup.setPosition(undefined);
316 374
           }
317
-        } else {
318
-          popup.setPosition(undefined);
375
+
376
+
377
+          that.clusters.getFeatures(evt.pixel).then((clickedFeatures) => {
378
+            if (clickedFeatures.length) {
379
+              // Get clustered Coordinates
380
+              const features = clickedFeatures[0].get('features');
381
+              if (features.length > 1) {
382
+                const extent = boundingExtent(
383
+                  features.map((r) => r.getGeometry().getCoordinates())
384
+                );
385
+                that.map.getView().fit(extent, { duration: 1000, padding: [100, 100, 100, 100] });
386
+              }
387
+            }
388
+          });
319 389
         }
320 390
       })
321 391
     },
392
+    clickFeacturePopInfo() {
393
+      let that = this;
394
+      if (that.select !== null) {
395
+        that.map.removeInteraction(that.select);
396
+      }
397
+      that.select = new Select({
398
+        style: this.selectedStyle
399
+      })
400
+      if (that.select !== null) {
401
+        that.map.addInteraction(that.select);
402
+        that.select.on('select', function (e) {
403
+          if (e.target.getFeatures().getArray().length == 1) {
404
+            that.clickFeacture = e.target.getFeatures().getArray()[0];
405
+            let properties = that.clickFeacture.getProperties();
406
+            if (!properties.features) {
407
+              let fatherLayers = e.target.featureLayerAssociation_;
408
+              // for (let layers in fatherLayers) {
409
+              //   datas.selectProjectNumber = fatherLayers[layers].values_.title;
410
+              // }
411
+              let coordinate = e.mapBrowserEvent.coordinate;
412
+              that.popup.setPosition(coordinate);
413
+              that.clickFeacture.type = 'featurePoint';
414
+            }
415
+          }
416
+        })
417
+      }
418
+    },
322 419
     /* 关闭信息框 */
323 420
     closePopup() {
324 421
       this.popup.setPosition(undefined);
@@ -342,10 +439,76 @@ export default {
342 439
       this.map.getView().setZoom(5)
343 440
     },
344 441
     rectSelect() {
345
-
442
+      let that = this;
443
+      that.select = new Select({
444
+        condition: never,
445
+        style: that.selectedStyle
446
+      });
447
+      // 创建框选图层
448
+      let drawLayer = new VectorLayer({
449
+        source: new VectorSource(),
450
+      });
451
+      // 创建绘制工具
452
+      that.drawBox = new Draw({
453
+        source: drawLayer.getSource(),
454
+        type: 'Circle',
455
+        geometryFunction: createBox()
456
+      });
457
+      that.drawBox.on('drawstart', function () {
458
+        that.seletctedCluters = [];
459
+        that.select.getFeatures().clear();
460
+        that.isDrawing = true;
461
+        // drawLayer.getSource().clear();
462
+      });
463
+      // 结束绘制
464
+      that.drawBox.on('drawend', function (e) {
465
+        if (e.feature) {
466
+          // 获取框选范围
467
+          let geometry = e.feature.getGeometry();
468
+          let extent = geometry.getExtent();
469
+          // 查询框选范围内的所有点
470
+          that.getLayerByName('clusters').getSource().forEachFeatureIntersectingExtent(extent, function (feature) {
471
+            that.select.getFeatures().push(feature);
472
+          });
473
+          // 遍历被选中的要素
474
+          let selected = [];
475
+          let selectedFeatures = that.select.getFeatures();
476
+          for (let i = 0; i < selectedFeatures.getLength(); i++) {
477
+            let feature = selectedFeatures.item(i);
478
+            feature = feature.values_.features;
479
+            if (feature.length == 1) {
480
+              let name = feature[0].name;
481
+              selected.push(name);
482
+            } else {
483
+              for (let f of feature) {
484
+                let name = f.name;
485
+                selected.push(name);
486
+              }
487
+            }
488
+            that.seletctedCluters = selected;
489
+          }
490
+        }
491
+        that.isDrawing = false;
492
+      })
493
+      that.map.addInteraction(that.select);
494
+      that.map.addInteraction(that.drawBox);
346 495
     },
347 496
     polygonSelect() {
348 497
 
498
+    },
499
+    /* 通过图层名称获取图层 */
500
+    getLayerByName(name) {
501
+      let allLayers = this.map.getLayers().getArray();
502
+      let layer = undefined;
503
+      if (allLayers.length) {
504
+        for (let i = 0; i < allLayers.length; i++) {
505
+          if (allLayers[i].get('name') === name) {
506
+            layer = allLayers[i];
507
+            break;
508
+          }
509
+        }
510
+      }
511
+      return layer;
349 512
     },
350 513
     getProjectList() {
351 514
       this.loading = true
@@ -455,6 +618,76 @@ export default {
455 618
       }
456 619
       return style;
457 620
     },
621
+    /* 被选中的样式 */
622
+    selectedStyle(feature, resolution) {
623
+      let styleCache = {};
624
+      let f = feature.get('features');
625
+      if (f) {
626
+        const size = feature.get('features').length;
627
+        let style = styleCache[size];
628
+        if (!style) {
629
+          style = [
630
+            new Style({
631
+              image: new Circle({
632
+                radius: 20,
633
+                fill: new Fill({
634
+                  color: 'rgba(255,0,0,0.4)',
635
+                }),
636
+              }),
637
+              text: new Text({
638
+                text: this.getText(feature, resolution),
639
+                fill: new Fill({
640
+                  color: '#fff',
641
+                }),
642
+                stroke: new Stroke({
643
+                  color: 'rgba(0, 0, 0, 0.6)',
644
+                  width: 3,
645
+                }),
646
+                font: '18px Calibri,sans-serif',
647
+                offsetY: -30
648
+              })
649
+            }),
650
+            new Style({
651
+              image: new Circle({
652
+                radius: 14,
653
+                fill: new Fill({
654
+                  color: 'rgba(255,0,0,0.9)',
655
+                }),
656
+              }),
657
+              text: new Text({
658
+                text: size.toString(),
659
+                fill: new Fill({
660
+                  color: '#fff',
661
+                }),
662
+                stroke: new Stroke({
663
+                  color: 'rgba(0, 0, 0, 0.6)',
664
+                  width: 3,
665
+                }),
666
+              })
667
+            })
668
+          ];
669
+          styleCache[size] = style;
670
+        }
671
+        return style;
672
+      } else {
673
+        let style = new Style({
674
+          // fill: new Fill({
675
+          //   color: [75, 126, 255, 0.6]
676
+          // }),
677
+          stroke: new Stroke({
678
+            width: 2,
679
+            color: '#FFFFFF',
680
+            lineDash: [8, 4],
681
+            lineCap: 'butt'
682
+          }),
683
+          image: new Icon({
684
+            src: sjxActive,
685
+            crossOrigin: 'anonymous',
686
+          })
687
+        })
688
+        return style
689
+      }
690
+    },
458 691
     getText(feature, resolution) {
459 692
       let features = feature.values_.features;
460 693
       let reo = resolution * 100;
@@ -650,8 +883,8 @@ export default {
650 883
   border-radius: 10px;
651 884
   // border: 1px solid #cccccc;
652 885
   bottom: 17px;
653
-  left: -220px;
654
-  min-width: 461px;
886
+  left: -168px;
887
+  min-width: 361px;
655 888
 
656 889
   .ol-popup-closer {
657 890
     text-decoration: none;

+ 15
- 15
oa-ui/src/views/flowable/form/business/contractForm.vue Wyświetl plik

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2024-05-10 15:31:57
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-06-19 15:55:48
5
+ * @LastEditTime: 2024-07-02 09:46:00
6 6
 -->
7 7
 <template>
8 8
   <div class="app-container">
@@ -575,13 +575,13 @@ export default {
575 575
           document: '',
576 576
           commentTime: undefined
577 577
         },
578
-        {
579
-          deptId: 107,
580
-          userId: '',
581
-          comment: '',
582
-          document: '',
583
-          commentTime: undefined
584
-        },
578
+        // {
579
+        //   deptId: 107,
580
+        //   userId: '',
581
+        //   comment: '',
582
+        //   document: '',
583
+        //   commentTime: undefined
584
+        // },
585 585
         {
586 586
           deptId: 106,
587 587
           userId: '',
@@ -711,13 +711,13 @@ export default {
711 711
                   document: '',
712 712
                   commentTime: undefined
713 713
                 },
714
-                {
715
-                  deptId: 107,
716
-                  userId: '',
717
-                  comment: '',
718
-                  document: '',
719
-                  commentTime: undefined
720
-                },
714
+                // {
715
+                //   deptId: 107,
716
+                //   userId: '',
717
+                //   comment: '',
718
+                //   document: '',
719
+                //   commentTime: undefined
720
+                // },
721 721
                 {
722 722
                   deptId: 106,
723 723
                   userId: '',

+ 9
- 9
oa-ui/src/views/flowable/form/business/subContract.vue Wyświetl plik

@@ -1,8 +1,8 @@
1 1
 <!--
2 2
  * @Author: ysh
3 3
  * @Date: 2024-05-10 15:31:57
4
- * @LastEditors: wrh
5
- * @LastEditTime: 2024-06-28 14:26:25
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2024-07-02 10:11:22
6 6
 -->
7 7
 <template>
8 8
   <div class="app-container">
@@ -572,13 +572,13 @@ export default {
572 572
           document: '',
573 573
           commentTime: undefined
574 574
         },
575
-        {
576
-          deptId: 107,
577
-          userId: '',
578
-          comment: '',
579
-          document: '',
580
-          commentTime: undefined
581
-        },
575
+        // {
576
+        //   deptId: 107,
577
+        //   userId: '',
578
+        //   comment: '',
579
+        //   document: '',
580
+        //   commentTime: undefined
581
+        // },
582 582
         {
583 583
           deptId: 106,
584 584
           userId: '',

+ 87
- 29
oa-ui/src/views/flowable/form/projectProcess/addproject.vue Wyświetl plik

@@ -2,13 +2,13 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2024-03-18 11:00:04
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-06-18 14:52:40
5
+ * @LastEditTime: 2024-07-02 18:17:03
6 6
 -->
7 7
 <template>
8 8
   <div class="project-wrapper">
9 9
     <!-- 项目登记 -->
10
-    <h2 style="text-align: center">项目登记</h2>
11
-    <el-form :model="addForm" :rules="rules" label-width="100px" :disabled="disabled">
10
+    <h2 style="text-align: center" id="scrollToMe">项目登记及安排</h2>
11
+    <el-form ref="projectAdd" :model="addForm" :rules="rules" label-width="110px" :disabled="disabled">
12 12
       <el-form-item label="项目编号:" prop="projectNumber">
13 13
         <el-input v-model="addForm.projectNumber"></el-input>
14 14
       </el-form-item><el-form-item label="项目名称:" prop="projectName">
@@ -18,13 +18,13 @@
18 18
         <el-input v-model="addForm.projectType"></el-input>
19 19
       </el-form-item>
20 20
       <el-form-item label="项目级别:" prop="projectLevel">
21
-        <el-radio v-model="addForm.projectLevel" label="0">一般项目</el-radio>
22
-        <el-radio v-model="addForm.projectLevel" label="1">重大项目</el-radio>
21
+        <el-radio v-model="addForm.projectLevel" label="0" border>一般项目</el-radio>
22
+        <el-radio v-model="addForm.projectLevel" label="1" border>重大项目</el-radio>
23 23
       </el-form-item>
24 24
       <el-form-item label="项目来源:" prop="projectSource">
25 25
         <el-radio-group v-model="addForm.projectSource" @change="changeProjectSource">
26
-          <el-radio label="0">院内</el-radio>
27
-          <el-radio label="1">院外</el-radio>
26
+          <el-radio label="0" border>院内</el-radio>
27
+          <el-radio label="1" border>院外</el-radio>
28 28
         </el-radio-group>
29 29
       </el-form-item>
30 30
       <el-form-item label="合同编码:">
@@ -71,7 +71,8 @@
71 71
             </td>
72 72
             <td>
73 73
               <el-select v-model="work.unit" placeholder="请选择" clearable>
74
-                <el-option v-for="dict in dict.type.cmc_unit" :key="dict.value" :label="dict.label" :value="dict.label" />
74
+                <el-option v-for="dict in dict.type.cmc_unit" :key="dict.value" :label="dict.label"
75
+                  :value="dict.label" />
75 76
               </el-select>
76 77
             </td>
77 78
             <td>
@@ -94,11 +95,11 @@
94 95
 
95 96
         <el-button icon="el-icon-plus" size="mini" @click="addWorkList"></el-button>
96 97
       </el-form-item>
97
-      <el-form-item label="附件上传:" prop="taskDocument">
98
-        <FileUpload v-if="$route.query.taskName == '项目登记'" ref="orz" :limit="1" :filePathName="'项目任务书'"
99
-          :fileType="['doc', 'docx', 'xls', 'xlsx', 'pdf']" @input="setProjectDocument">
100
-        </FileUpload>
101
-        <div v-if="addForm.taskDocument && $route.query.taskName != '项目登记'" class="upload-list">
98
+      <!-- 项目安排 -->
99
+      <arrange-project ref="arrange" :taskForm="taskForm" :taskName="'项目登记'" :disabled="disabled"></arrange-project>
100
+      <!--  -->
101
+      <el-form-item label="任务书上传:" prop="taskDocument">
102
+        <div v-if="addForm.taskDocument" class="upload-list">
102 103
           <el-link type="primary" @click="reviewWord(`${baseUrl}${'/profile/upload' + addForm.taskDocument}`)">
103 104
             {{ getFileName(addForm.taskDocument) }}
104 105
           </el-link>
@@ -107,18 +108,21 @@
107 108
             <span class="el-icon-download">下载文件</span>
108 109
           </el-link>
109 110
         </div>
111
+        <FileUpload v-if="$route.query.taskName == '项目登记'" ref="orz" :limit="1" :filePathName="'项目任务书'"
112
+          :fileType="['doc', 'docx', 'xls', 'xlsx', 'pdf']" @input="setProjectDocument">
113
+        </FileUpload>
110 114
       </el-form-item>
111 115
       <el-form-item label="资料提交要求:" prop="projectRequest">
112
-        <el-input v-model="addForm.projectRequest" type="textarea" :autosize="{ minRows: 4, maxRows: 10}"></el-input>
116
+        <el-input v-model="addForm.projectRequest" type="textarea" :autosize="{ minRows: 4, maxRows: 10 }"></el-input>
113 117
       </el-form-item>
114 118
       <el-form-item label="备注:" prop="remark">
115
-        <el-input v-model="addForm.remark" type="textarea" :autosize="{ minRows: 4, maxRows: 10}"></el-input>
119
+        <el-input v-model="addForm.remark" type="textarea" :autosize="{ minRows: 4, maxRows: 10 }"></el-input>
116 120
       </el-form-item>
117 121
       <el-row>
118 122
         <el-col :span="6" :xs="24" :offset="12">
119 123
           <el-form-item label="项目登记人:" prop="registrantUser">
120 124
             <span class="auditor"> {{ addForm.projectRegistrantUser ? addForm.projectRegistrantUser.nickName :
121
-              registrantUser }} </span>
125
+      registrantUser }} </span>
122 126
           </el-form-item>
123 127
         </el-col>
124 128
         <el-col :span="6">
@@ -129,6 +133,7 @@
129 133
       </el-row>
130 134
     </el-form>
131 135
     <div slot="footer" class="dialog-footer" style="text-align: center">
136
+      <el-button type="warning" @click="save" :disabled="disabled">暂 存</el-button>
132 137
       <el-button type="primary" @click="confirmAddForm" :disabled="disabled">提 交</el-button>
133 138
       <!-- <el-button @click="cancel" :disabled="disabled">取 消</el-button> -->
134 139
     </div>
@@ -141,17 +146,18 @@
141 146
 <script>
142 147
 import { parseTime } from "@/utils/ruoyi";
143 148
 import { mapGetters } from "vuex";
144
-import { listProject, getProject, addProject, delProject } from "@/api/oa/project/project";
149
+import { listProject, getProject, addProject, updateProject, delProject } from "@/api/oa/project/project";
145 150
 import { getUser } from "@/api/system/user";
146 151
 import { getUsersDeptLeaderByDept } from "@/api/system/post";
147 152
 import { complete, rejectTask, returnList, returnTask, getNextFlowNode, delegate, flowTaskForm } from "@/api/flowable/todo";
148
-import { listProjectWork, addProjectWork } from "@/api/oa/project/projectWork";
153
+import { listProjectWork, addProjectWork, delProjectWork } from "@/api/oa/project/projectWork";
149 154
 import { listProjectContract, addProjectContract } from "@/api/oa/contract/projectContract";
150 155
 import { listContract, getContract, delContract, addContract, updateContract } from "@/api/oa/contract/contract";
151 156
 import { listPartyA } from "@/api/oa/partyA/partyA";
152 157
 import chooseContract from '../components/chooseContract.vue';
158
+import ArrangeProject from './arrangeProject.vue';
153 159
 export default {
154
-  components: { chooseContract },
160
+  components: { chooseContract, ArrangeProject },
155 161
   dicts: ['cmc_scale_grade', 'cmc_unit'],
156 162
   props: {
157 163
     disabled: {
@@ -171,6 +177,7 @@ export default {
171 177
       baseUrl: process.env.VUE_APP_BASE_API,
172 178
       openContract: false,
173 179
       registerTime: undefined,
180
+      formTotal: 0,
174 181
       // 查询参数
175 182
       queryParams: {
176 183
         pageNum: 1,
@@ -188,7 +195,6 @@ export default {
188 195
       addForm: {
189 196
         registerTime: undefined,
190 197
         projectRegistrant: "",
191
-        projectSource: "0",
192 198
         projectLevel: "0"
193 199
       },
194 200
       chooseContractInfo: {
@@ -217,14 +223,7 @@ export default {
217 223
   },
218 224
   created() {
219 225
     this.registerTime = parseTime(new Date(), '{y}-{m}-{d}')
220
-    if (this.$route.query.taskName != '项目登记') {
221
-      this.getProjectInfo();
222
-      this.getProjectWorkList();
223
-    } else {
224
-      this.addForm.projectRegistrant = this.userId;
225
-      this.registrantUser = this.name;
226
-    }
227
-
226
+    this.initProjectForm();
228 227
     this.getPartyAList();
229 228
     this.getContractDataList();
230 229
     // this.getList();
@@ -249,7 +248,17 @@ export default {
249 248
         this.loading = false;
250 249
       });
251 250
     },
252
-
251
+    async initProjectForm() {
252
+      let datas = await listProject({ projectId: this.taskForm.formId });
253
+      if (datas.rows.length > 0) {
254
+        this.formTotal = 1
255
+        this.getProjectInfo(this.taskForm.formId)
256
+        this.getProjectWorkList();
257
+      } else {
258
+        this.addForm.projectRegistrant = this.userId;
259
+        this.registrantUser = this.name;
260
+      }
261
+    },
253 262
     getProjectInfo() {
254 263
       getProject(this.taskForm.formId).then(res => {
255 264
         this.addForm = res.data;
@@ -286,6 +295,55 @@ export default {
286 295
       this.chooseContractInfo = val;
287 296
       this.openContract = false;
288 297
     },
298
+    // 暂存
299
+    async save() {
300
+      if (this.formTotal == 0) {
301
+        this.$refs['projectAdd'].validate((vaild) => {
302
+          if (vaild) {
303
+            this.addForm.projectId = this.taskForm.formId;
304
+            for (let work of this.workList) {
305
+              work.projectId = this.taskForm.formId;
306
+              addProjectWork(work);
307
+            }
308
+            let addLog = addProject(this.addForm).then(response => {
309
+              this.$modal.msgSuccess("新增成功");
310
+              this.getList();
311
+              this.$refs.arrange.save()
312
+            });
313
+            if (addLog.code == 200) {
314
+              this.$refs.arrange.save()
315
+            }
316
+            let contractId = this.chooseContractInfo.contractId ? this.chooseContractInfo.contractId : ''
317
+            let pcobj = { projectId: this.taskForm.formId, contractId }
318
+            if (contractId != '') {
319
+              addProjectContract(pcobj).then(response => {
320
+                this.$modal.msgSuccess("合同关联成功");
321
+              })
322
+            }
323
+          } else {
324
+            // this.$refs.scrollToMe.scrollIntoView({ behavior: 'smooth' }); 
325
+            let dom = document.getElementById('scrollToMe')
326
+            dom.scrollIntoView({ behavior: 'smooth' });
327
+          }
328
+        })
329
+      } else {
330
+        let updateLog = await updateProject(this.addForm).then(
331
+          this.$modal.msgSuccess("修改成功")
332
+        );
333
+        console.log(updateLog);
334
+        if (updateLog.code == 200) {
335
+          this.$refs.arrange.save()
336
+        }
337
+        delProjectWork(this.taskForm.formId).then(res => {
338
+          this.workList.forEach(work => {
339
+            work.projectId = this.taskForm.formId;
340
+            addProjectWork(work);
341
+          })
342
+
343
+        })
344
+      }
345
+
346
+    },
289 347
     confirmAddForm() {
290 348
       this.addForm.projectId = this.taskForm.formId;
291 349
       for (let work of this.workList) {

+ 47
- 37
oa-ui/src/views/flowable/form/projectProcess/arrangeProject.vue Wyświetl plik

@@ -2,11 +2,11 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2024-03-19 09:24:06
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-06-14 14:57:08
5
+ * @LastEditTime: 2024-07-02 17:36:44
6 6
 -->
7 7
 <template>
8 8
   <div class="app-container">
9
-    <h2 style="text-align: center;">项目安排</h2>
9
+    <!-- <h2 style="text-align: center;">项目安排</h2> -->
10 10
     <el-form :model="form" :rules="rules" label-width="120px" :disabled="disabled">
11 11
       <el-row :gutter="20">
12 12
         <el-col :span="12" :xs="24">
@@ -57,10 +57,7 @@
57 57
         </el-col>
58 58
         <el-col :span="12" :xs="24">
59 59
           <el-form-item label="组织交底文档:" prop="organizeDocument">
60
-            <FileUpload v-if="$route.query.taskName == '项目安排'" ref="orz" :limit="1" :filePathName="'组织交底文件'"
61
-              :fileType="['doc', 'docx', 'xls', 'xlsx', 'pdf']" @input="setOrganizeDocument">
62
-            </FileUpload>
63
-            <div v-if="form.organizeDocument && $route.query.taskName != '项目安排'" class="upload-list">
60
+            <div v-if="form.organizeDocument" class="upload-list">
64 61
               <el-link type="primary" @click="reviewWord(`${baseUrl}${'/profile/upload' + form.organizeDocument}`)">
65 62
                 {{ getFileName(form.organizeDocument) }}
66 63
               </el-link>
@@ -69,6 +66,9 @@
69 66
                 <span class="el-icon-download">下载文件</span>
70 67
               </el-link>
71 68
             </div>
69
+            <FileUpload v-if="taskName == '项目登记'" ref="orz" :limit="1" :filePathName="'组织交底文件'"
70
+              :fileType="['doc', 'docx', 'xls', 'xlsx', 'pdf']" @input="setOrganizeDocument">
71
+            </FileUpload>
72 72
           </el-form-item>
73 73
         </el-col>
74 74
       </el-row>
@@ -96,10 +96,10 @@
96 96
         </el-form-item>
97 97
       </el-form>
98 98
     </el-dialog>
99
-    <div slot="footer" class="dialog-footer" style="text-align: center;">
99
+    <!-- <div slot="footer" class="dialog-footer" style="text-align: center;">
100 100
       <el-button type="primary" @click="confirmPlanForm" :disabled="disabled">提 交</el-button>
101
-      <!-- <el-button @click="cancel" :disabled="disabled">取 消</el-button> -->
102
-    </div>
101
+      <el-button @click="cancel" :disabled="disabled">取 消</el-button>
102
+    </div> -->
103 103
   </div>
104 104
 </template>
105 105
 
@@ -112,12 +112,15 @@ import { listProject, getProject, addProject, updateProject, delProject, submitP
112 112
 export default {
113 113
   props: {
114 114
     disabled: {
115
-      type: Boolean,
116
-      require: true,
115
+      type: Boolean
117 116
     },
118 117
     taskForm: {
119 118
       type: Object,
120 119
       required: true
120
+    },
121
+    taskName:{
122
+      type: String,
123
+      required: true
121 124
     }
122 125
   },
123 126
   data() {
@@ -143,34 +146,35 @@ export default {
143 146
 
144 147
   },
145 148
   mounted() {
146
-    if (this.$route.query.taskName != '项目登记') {
147
-      // this.form.projectId = this.taskForm.formId;
148
-      this.getDeptList();
149
-      this.initForm();
150
-    }
149
+    this.getDeptList();
150
+    this.initForm();
151 151
   },
152 152
   methods: {
153
-    initForm() {
154
-      getProject(this.taskForm.formId).then(res => {
155
-        this.form = res.data;
156
-        if (this.form.undertakingDept != null && this.form.undertakingDept != "" && this.form.undertakingDept != undefined) {
157
-          this.form.deptId = this.form.undertakingDeptName.split(',')
158
-        }
159
-        if (this.form.projectLeaderUser) {
160
-          this.form.projectLeaderName = this.form.projectLeaderUser.nickName
161
-        }
162
-        this.$set(this.form, 'deptLeader', [])
163
-        if (this.form.undertakingDept) {
164
-          let arr = (this.form.undertakingDept.split(',')).map(Number)
165
-          this.$set(this.form, 'deptId', arr)
166
-          this.getDeptLeader(arr);
167
-        } else {
168
-          this.$set(this.form, 'deptId', [])
169
-        }
170
-        this.$store.commit('SET_PROJECTNUMBER', this.form.projectNumber)
171
-        this.$store.commit('SET_PROJECTNAME', this.form.projectName)
172
-        this.$store.commit('SET_PROJECT', this.form)
173
-      })
153
+    async initForm() {
154
+      let datas = await listProject({ projectId: this.taskForm.formId });
155
+      if (datas.rows.length > 0) {
156
+        getProject(this.taskForm.formId).then(res => {
157
+          this.form = res.data;
158
+          if (this.form.undertakingDept != null && this.form.undertakingDept != "" && this.form.undertakingDept != undefined) {
159
+            this.form.deptId = this.form.undertakingDeptName.split(',')
160
+          }
161
+          if (this.form.projectLeaderUser) {
162
+            this.form.projectLeaderName = this.form.projectLeaderUser.nickName
163
+          }
164
+          this.$set(this.form, 'deptLeader', [])
165
+          if (this.form.undertakingDept) {
166
+            let arr = (this.form.undertakingDept.split(',')).map(Number)
167
+            this.$set(this.form, 'deptId', arr)
168
+            this.getDeptLeader(arr);
169
+          } else {
170
+            this.$set(this.form, 'deptId', [])
171
+          }
172
+          this.$store.commit('SET_PROJECTNUMBER', this.form.projectNumber)
173
+          this.$store.commit('SET_PROJECTNAME', this.form.projectName)
174
+          this.$store.commit('SET_PROJECT', this.form)
175
+        })
176
+      }
177
+
174 178
     },
175 179
     getDeptList() {
176 180
       listDept({
@@ -223,6 +227,12 @@ export default {
223 227
       this.peopleForm.userId = '';
224 228
       this.peopleVisible = false;
225 229
     },
230
+    save() {
231
+      this.form.projectId = this.taskForm.formId;
232
+      this.form.undertakingDept = this.form.deptId.join(',');
233
+      console.log(this.form);
234
+      updateProject(this.form)
235
+    },
226 236
     confirmPlanForm() {
227 237
       this.$confirm('项目安排之后会自动发起预算编制、技术方案、安全交底三个子流程,将无法进行撤回操作,是否继续提交?', '提示', {
228 238
         confirmButtonText: '确定',

+ 6
- 6
oa-ui/src/views/flowable/form/projectProcess/index.vue Wyświetl plik

@@ -1,8 +1,8 @@
1 1
 <!--
2 2
  * @Author: ysh
3 3
  * @Date: 2024-02-27 14:49:15
4
- * @LastEditors: wrh
5
- * @LastEditTime: 2024-06-28 14:45:41
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2024-07-02 15:13:18
6 6
 -->
7 7
 
8 8
 <template>
@@ -13,9 +13,9 @@
13 13
           <el-tab-pane label="项目登记" name="项目登记">
14 14
             <addproject :taskForm="taskForm" :taskName="taskName" :disabled="taskName != '项目登记'" @goBack="goBack"></addproject>
15 15
           </el-tab-pane>
16
-          <el-tab-pane label="项目安排" name="项目安排">
16
+          <!-- <el-tab-pane label="项目安排" name="项目安排">
17 17
             <arrangeProject :taskForm="taskForm" :disabled="taskName != '项目安排'" @goBack="goBack"></arrangeProject>
18
-          </el-tab-pane>
18
+          </el-tab-pane> -->
19 19
           <el-tab-pane label="项目预算" name="项目预算">
20 20
             <budget-tab :taskForm="taskForm"  @goBack="goBack"></budget-tab>
21 21
           </el-tab-pane>
@@ -69,7 +69,7 @@ import ManageReview from './manageReview.vue'
69 69
 import ScConfirm from './scConfirm.vue'
70 70
 import InProgress from './inProgress.vue'
71 71
 import BudgetTab from './budgetTab.vue'
72
-import TechnicalTab from './planTab.vue'
72
+import planTab from './planTab.vue'
73 73
 import SafeTab from './safeTab.vue'
74 74
 export default {
75 75
   props: {
@@ -80,7 +80,7 @@ export default {
80 80
       type: Object,
81 81
     }
82 82
   },
83
-  components: { addproject, arrangeProject, businessReview, flow, ManageReview, ScConfirm, InProgress, BudgetTab, TechnicalTab, SafeTab },
83
+  components: { addproject, arrangeProject, businessReview, flow, ManageReview, ScConfirm, InProgress, BudgetTab, planTab, SafeTab },
84 84
   data() {
85 85
     return {
86 86
       activeName: '项目登记',

Ładowanie…
Anuluj
Zapisz