Bladeren bron

新增采购计划表单,新增勘察菜单

余思翰 7 maanden geleden
bovenliggende
commit
2b196c4456

+ 7
- 7
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcProcurePlanMapper.xml Bestand weergeven

@@ -19,21 +19,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
19 19
     </resultMap>
20 20
 
21 21
     <sql id="selectCmcProcurePlanVo">
22
-        select procure_plan_id, procure_apply_id, name, series, unit, price, num, amount, procure_way, usage, remark from cmc_procure_plan
22
+        select procure_plan_id, procure_apply_id, `name`, series, unit, price, num, amount, procure_way, `usage`, remark from cmc_procure_plan
23 23
     </sql>
24 24
 
25 25
     <select id="selectCmcProcurePlanList" parameterType="CmcProcurePlan" resultMap="CmcProcurePlanResult">
26 26
         <include refid="selectCmcProcurePlanVo"/>
27 27
         <where>  
28 28
             <if test="procureApplyId != null  and procureApplyId != ''"> and procure_apply_id = #{procureApplyId}</if>
29
-            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
29
+            <if test="name != null  and name != ''"> and `name` like concat('%', #{name}, '%')</if>
30 30
             <if test="series != null  and series != ''"> and series = #{series}</if>
31 31
             <if test="unit != null  and unit != ''"> and unit = #{unit}</if>
32 32
             <if test="price != null "> and price = #{price}</if>
33 33
             <if test="num != null "> and num = #{num}</if>
34 34
             <if test="amount != null "> and amount = #{amount}</if>
35 35
             <if test="procureWay != null  and procureWay != ''"> and procure_way = #{procureWay}</if>
36
-            <if test="usage != null  and usage != ''"> and usage = #{usage}</if>
36
+            <if test="usage != null  and usage != ''"> and `usage` = #{usage}</if>
37 37
         </where>
38 38
     </select>
39 39
     
@@ -46,14 +46,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
46 46
         insert into cmc_procure_plan
47 47
         <trim prefix="(" suffix=")" suffixOverrides=",">
48 48
             <if test="procureApplyId != null">procure_apply_id,</if>
49
-            <if test="name != null">name,</if>
49
+            <if test="name != null">`name`,</if>
50 50
             <if test="series != null">series,</if>
51 51
             <if test="unit != null">unit,</if>
52 52
             <if test="price != null">price,</if>
53 53
             <if test="num != null">num,</if>
54 54
             <if test="amount != null">amount,</if>
55 55
             <if test="procureWay != null">procure_way,</if>
56
-            <if test="usage != null">usage,</if>
56
+            <if test="usage != null">`usage`,</if>
57 57
             <if test="remark != null">remark,</if>
58 58
          </trim>
59 59
         <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -74,14 +74,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
74 74
         update cmc_procure_plan
75 75
         <trim prefix="SET" suffixOverrides=",">
76 76
             <if test="procureApplyId != null">procure_apply_id = #{procureApplyId},</if>
77
-            <if test="name != null">name = #{name},</if>
77
+            <if test="name != null">`name` = #{name},</if>
78 78
             <if test="series != null">series = #{series},</if>
79 79
             <if test="unit != null">unit = #{unit},</if>
80 80
             <if test="price != null">price = #{price},</if>
81 81
             <if test="num != null">num = #{num},</if>
82 82
             <if test="amount != null">amount = #{amount},</if>
83 83
             <if test="procureWay != null">procure_way = #{procureWay},</if>
84
-            <if test="usage != null">usage = #{usage},</if>
84
+            <if test="usage != null">`usage` = #{usage},</if>
85 85
             <if test="remark != null">remark = #{remark},</if>
86 86
         </trim>
87 87
         where procure_plan_id = #{procurePlanId}

+ 2
- 2
oa-ui/src/api/oa/procure/procurePlan.js Bestand weergeven

@@ -36,9 +36,9 @@ export function updateProcurePlan(data) {
36 36
 }
37 37
 
38 38
 // 删除采购计划
39
-export function delProcurePlan(procurePlanId) {
39
+export function delProcurePlan(procureApplyId) {
40 40
   return request({
41
-    url: '/oa/procurePlan/' + procurePlanId,
41
+    url: '/oa/procurePlan/' + procureApplyId,
42 42
     method: 'delete'
43 43
   })
44 44
 }

+ 8
- 1
oa-ui/src/utils/deleteResource.js Bestand weergeven

@@ -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-08-16 15:04:21
5
+ * @LastEditTime: 2024-09-20 13:59:08
6 6
  */
7 7
 import request from '@/utils/request'
8 8
 
@@ -96,6 +96,13 @@ const apiEndpoints = [
96 96
       '/oa/declare/:id'
97 97
     ]
98 98
   },
99
+  {
100
+    procDefName: '采购审批',
101
+    apiUrl: [
102
+      '/oa/procureApproval/:id',
103
+      '/oa/procurePlan/:id'
104
+    ]
105
+  },
99 106
 ]
100 107
 
101 108
 // 编写一个方法来处理删除请求,并同时发送所有API请求  

+ 5
- 3
oa-ui/src/views/flowable/form/budget/components/chooseDevice.vue Bestand weergeven

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2024-06-21 18:51:51
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-09-04 09:57:21
5
+ * @LastEditTime: 2024-09-20 09:49:18
6 6
 -->
7 7
 <template>
8 8
   <div>
@@ -134,7 +134,9 @@ export default {
134 134
     },
135 135
     getNameList() {
136 136
       listDeviceName().then(res => {
137
-        this.nameList = res.data
137
+        this.nameList = res.data.filter(function (item) {
138
+          return item !== null;
139
+        });
138 140
       })
139 141
     },
140 142
     handleSelectionChange(val) {
@@ -201,7 +203,7 @@ export default {
201 203
     formatChooseList() {
202 204
       if (this.chooseList.name) {
203 205
         return this.chooseList.name + '-' + this.chooseList.series + '-' + this.chooseList.brand
204
-      }else{
206
+      } else {
205 207
         return null
206 208
       }
207 209
     }

+ 6
- 2
oa-ui/src/views/flowable/form/components/auditorRow.vue Bestand weergeven

@@ -34,13 +34,16 @@ export default {
34 34
   data() {
35 35
     return {
36 36
       localSignature: '',
37
-      loaclSignTime: ''
37
+      loaclSignTime: '',
38
+      localSignatureUserId: undefined
38 39
     }
39 40
   },
40 41
   watch: {
41 42
     signature(newval) {
42
-      if (newval)
43
+      if (newval) {
43 44
         this.localSignature = this.getUserName(newval);
45
+        this.localSignatureUserId = newval;
46
+      }
44 47
     },
45 48
     signTime(newval) {
46 49
       if (newval)
@@ -50,6 +53,7 @@ export default {
50 53
   mounted() {
51 54
     if (this.isCurrent) {
52 55
       this.localSignature = this.$store.getters.name;
56
+      this.localSignatureUserId = this.$store.getters.userId;
53 57
       this.loaclSignTime = parseTime(new Date(), '{y}-{m}-{d}');
54 58
     } else {
55 59
       this.localSignature = this.signature;

+ 10
- 4
oa-ui/src/views/flowable/form/components/conditionDisplay.vue Bestand weergeven

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2024-04-23 17:08:16
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-08-16 15:26:43
5
+ * @LastEditTime: 2024-09-20 16:45:23
6 6
 -->
7 7
 <template>
8 8
   <div>
@@ -34,6 +34,8 @@
34 34
     <device-form :key="'device'+taskForm.taskId" :taskForm="taskForm" :taskName="''" :formDisabled="true" v-else-if="taskForm.procDefName == '设备审批'"></device-form>
35 35
     <change-form :key="'change'+taskForm.taskId" :taskForm="taskForm" :taskName="''" v-else-if="taskForm.procDefName == '项目变更'"></change-form>
36 36
     <declare :key="'work'+taskForm.taskId" :taskForm="taskForm" :taskName="''" :formDisabled="true" v-else-if="taskForm.procDefName == '工作填报'"></declare>
37
+    <procure-form :key="'procure'+taskForm.taskId"  :taskForm="taskForm" :taskName="''" :isFlow ="true" v-else-if="taskForm.procDefName == '采购审批'"></procure-form>
38
+    <outsource-form :key="'outsource'+taskForm.taskId"  :taskForm="taskForm" :taskName="''" :isFlow ="true" v-else-if="taskForm.procDefName == '项目委外'"></outsource-form>
37 39
   </div>
38 40
 </template>
39 41
 
@@ -61,8 +63,10 @@ import BrandForm from '../business/brandForm.vue';
61 63
 import DepositForm from '../finance/depositForm.vue';
62 64
 import DeviceForm from '../oa/deviceForm.vue';
63 65
 import changeForm from "../changeForm.vue";
64
-import workFilling from "../work/declareForm.vue";
65
-import declare from "../work/declareForm.vue";
66
+import workFilling from "@/views/flowable/form/work/declareForm.vue";
67
+import declare from "@/views/flowable/form/work/declareForm.vue";
68
+import procureForm from "@/views/flowable/form/procure/procureForm.vue";
69
+import outsourceForm from '@/views/flowable/form/outsource/outsourceForm.vue';
66 70
 export default {
67 71
   props: {
68 72
     passingParam: {
@@ -98,7 +102,9 @@ export default {
98 102
     DepositForm,
99 103
     DeviceForm,
100 104
     changeForm,
101
-    declare
105
+    declare,
106
+    procureForm,
107
+    outsourceForm
102 108
   },
103 109
   data() {
104 110
     return {

+ 12
- 4
oa-ui/src/views/flowable/form/components/detailDisplay.vue Bestand weergeven

@@ -46,6 +46,10 @@
46 46
       @goBack="goBack"></change-form>
47 47
     <declare-form :taskName="taskName" :taskForm="taskForm" v-else-if="taskForm.procDefName == '工作填报'"
48 48
       @goBack="goBack"></declare-form>
49
+    <procure-form :taskName="taskName" :taskForm="taskForm" v-else-if="taskForm.procDefName == '采购审批'"
50
+      @goBack="goBack"></procure-form>
51
+    <outsource-form :taskName="taskName" :taskForm="taskForm" v-else-if="taskForm.procDefName == '项目委外'"
52
+      @goBack="goBack"></outsource-form>
49 53
   </div>
50 54
 </template>
51 55
 
@@ -74,7 +78,9 @@ import archiveForm from '@/views/flowable/form/archiveForm.vue';
74 78
 import settleForm from '@/views/flowable/form/settleForm.vue';
75 79
 import settleOther from '@/views/flowable/form/settleOther.vue';
76 80
 import changeForm from '@/views/flowable/form/changeForm.vue';
77
-import declareForm from '../work/declareForm.vue';
81
+import declareForm from '@/views/flowable/form/work/declareForm.vue';
82
+import procureForm from '@/views/flowable/form/procure/procureForm.vue';
83
+import outsourceForm from '@/views/flowable/form/outsource/outsourceForm.vue';
78 84
 export default {
79 85
   components: {
80 86
     ScTable,
@@ -101,7 +107,9 @@ export default {
101 107
     settleForm,
102 108
     settleOther,
103 109
     changeForm,
104
-    declareForm
110
+    declareForm,
111
+    procureForm,
112
+    outsourceForm
105 113
   },
106 114
   props: {
107 115
     taskForm: {
@@ -111,8 +119,8 @@ export default {
111 119
       type: String
112 120
     }
113 121
   },
114
-  methods:{
115
-    goBack(){
122
+  methods: {
123
+    goBack() {
116 124
       this.$emit('goBack')
117 125
     }
118 126
   }

+ 67
- 0
oa-ui/src/views/flowable/form/outsource/outsourceForm.vue Bestand weergeven

@@ -0,0 +1,67 @@
1
+<!--
2
+ * @Author: ysh
3
+ * @Date: 2024-09-20 16:09:07
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2024-09-20 16:46:18
6
+-->
7
+<template>
8
+  <div class="app-container">
9
+    <el-row :gutter="20">
10
+      <el-col :span="isFlow ? 18 : 24" :xs="24">
11
+        <el-form ref="form" :model="form" :rules="rules" label-width="100px" :disabled="taskName == ''">
12
+          <h2 style="text-align: center;">项目委外审批表</h2>
13
+        </el-form>
14
+      </el-col>
15
+      <el-col :span="6" :xs="24" v-if="isFlow">
16
+        <el-card>
17
+          <h2 style="text-align: center;">流程进度</h2>
18
+          <div>
19
+            <flow :flowData="flowData" />
20
+          </div>
21
+        </el-card>
22
+      </el-col>
23
+    </el-row>
24
+  </div>
25
+</template>
26
+
27
+<script>
28
+import flow from '@/views/flowable/task/todo/detail/flow';
29
+import { flowXmlAndNode } from "@/api/flowable/definition";
30
+export default {
31
+  components: { flow },
32
+  props: {
33
+    taskName: {
34
+      type: String,
35
+      required: true
36
+    },
37
+    taskForm: {
38
+      type: Object,
39
+      required: true
40
+    },
41
+    isFlow: {
42
+      type: Boolean,
43
+      default: true
44
+    },
45
+  },
46
+  data() {
47
+    return {
48
+      flowData:{}
49
+    }
50
+  },
51
+  created() {
52
+    this.initFlow();
53
+    // this.initForm();
54
+  },
55
+  methods: {
56
+    initFlow() {
57
+      if (this.isFlow) {
58
+        flowXmlAndNode({ procInsId: this.taskForm.procInsId, deployId: this.taskForm.deployId }).then(res => {
59
+          this.flowData = res.data;
60
+        })
61
+      }
62
+    },
63
+  },
64
+}
65
+</script>
66
+
67
+<style lang="scss" scoped></style>

+ 163
- 0
oa-ui/src/views/flowable/form/procure/plan.vue Bestand weergeven

@@ -0,0 +1,163 @@
1
+<template>
2
+  <div style="width:100%;">
3
+    <table border="1" style="width:100%">
4
+      <tr>
5
+        <td style="width:55px;">序号</td>
6
+        <td>采购内容</td>
7
+        <td style="width:50px;" v-if="taskName == '采购申请'|| taskName == '编制计划'">操作</td>
8
+      </tr>
9
+      <tr v-for="(item, index) in itemList" :key="index">
10
+        <td>
11
+          {{ index + 1 }}
12
+        </td>
13
+        <td>
14
+          <el-descriptions :column="4" border size="mini">
15
+            <el-descriptions-item label="名称" :span="4">
16
+              <el-input v-model="item.name"></el-input>
17
+            </el-descriptions-item>
18
+            <el-descriptions-item label="规格型号" :span="4">
19
+              <el-input v-model="item.series"></el-input>
20
+            </el-descriptions-item>
21
+            <el-descriptions-item label="单位">
22
+              <el-input v-model="item.unit" maxlength="5" show-word-limit></el-input>
23
+            </el-descriptions-item>
24
+            <el-descriptions-item label="参考单价">
25
+              <el-input v-model="item.price" @blur="getAmount(item)"></el-input>
26
+            </el-descriptions-item>
27
+            <el-descriptions-item label="数量">
28
+              <el-input v-model="item.num" @blur="getAmount(item)"></el-input>
29
+            </el-descriptions-item>
30
+            <el-descriptions-item label="总价">
31
+              <el-input v-model="item.amount"></el-input>
32
+            </el-descriptions-item>
33
+            <el-descriptions-item label="购买方式">
34
+              <el-input v-model="item.procureWay" maxlength="5" show-word-limit></el-input>
35
+            </el-descriptions-item>
36
+            <el-descriptions-item label="用途">
37
+              <el-input type="textarea" v-model="item.usage" maxlength="10" show-word-limit></el-input>
38
+            </el-descriptions-item>
39
+            <el-descriptions-item label="备注" :span="3">
40
+              <el-input type="textarea" v-model="item.remark"></el-input>
41
+            </el-descriptions-item>
42
+          </el-descriptions>
43
+        </td>
44
+        <td v-if="taskName == '采购申请' || taskName == '编制计划'">
45
+          <div class="delete-btn" @click="deleItem(index)">
46
+            <i class="el-icon-circle-close"></i>
47
+          </div>
48
+        </td>
49
+      </tr>
50
+    </table>
51
+    <el-button @click="addItem" icon="el-icon-plus" type="primary" size="mini"></el-button>
52
+  </div>
53
+</template>
54
+
55
+<script>
56
+import { listProcurePlan, getProcurePlan, addProcurePlan, updateProcurePlan, delProcurePlan } from "@/api/oa/procure/procurePlan";
57
+export default {
58
+  props: {
59
+    procureApplyId: {
60
+      type: String,
61
+      default: ''
62
+    },
63
+    taskName: {
64
+      type: String,
65
+      default: ''
66
+    }
67
+  },
68
+  data() {
69
+    return {
70
+      itemList: [],
71
+      formTotal: 0
72
+    }
73
+  },
74
+  created() {
75
+    this.initList()
76
+  },
77
+  methods: {
78
+    initList() {
79
+      const queryParams = {
80
+        pageSize: 999,
81
+        procureApplyId: this.procureApplyId
82
+      }
83
+      listProcurePlan(queryParams).then(res => {
84
+        if (res.total != 0) {
85
+          this.formTotal = 1
86
+          this.itemList = res.rows;
87
+        } else {
88
+          this.itemList = [{
89
+            name: '',
90
+            series: '',
91
+            unit: '',
92
+            price: 0,
93
+            num: 1,
94
+            amount: 0,
95
+            procureWay: '',
96
+            usage: '',
97
+            remark: ''
98
+          }]
99
+        }
100
+      })
101
+    },
102
+    getAmount(item) {
103
+      const price = Number(item.price);
104
+      const num = Number(item.num);
105
+      if (!isNaN(price) && !isNaN(num)) {
106
+        // 计算总价  
107
+        const amount = price * num;
108
+        this.$set(item, 'amount', amount)
109
+      }
110
+    },
111
+    addItem() {
112
+      this.itemList.push({
113
+        name: '',
114
+        series: '',
115
+        unit: '',
116
+        price: 0,
117
+        num: 1,
118
+        amount: 0,
119
+        procureWay: '',
120
+        usage: '',
121
+        remark: ''
122
+      })
123
+    },
124
+    deleItem(index) {
125
+      let arr = this.itemList;
126
+      if (arr.length == 1) {
127
+        return;
128
+      }
129
+      if (index >= 0 && index < arr.length) {
130
+        arr.splice(index, 1);
131
+      }
132
+    }
133
+  },
134
+}
135
+</script>
136
+
137
+<style lang="scss" scoped>
138
+@import "@/assets/styles/element-reset.scss";
139
+
140
+table {
141
+  /*边框*/
142
+  /* border: 1px solid black; */
143
+  text-align: center;
144
+  border-collapse: collapse;
145
+  border: 1px solid #a5abb0;
146
+
147
+  /*设置背景颜色*/
148
+  /* background-color: #bfa; */
149
+  td {
150
+    padding: 5px;
151
+    font-size: 14px;
152
+  }
153
+}
154
+
155
+.delete-btn {
156
+  color: #F56C6C;
157
+  cursor: pointer;
158
+
159
+  i {
160
+    font-size: 25px;
161
+  }
162
+}
163
+</style>

+ 256
- 0
oa-ui/src/views/flowable/form/procure/procureForm.vue Bestand weergeven

@@ -0,0 +1,256 @@
1
+<!--
2
+ * @Author: ysh
3
+ * @Date: 2024-09-19 13:45:43
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2024-09-20 15:05:52
6
+-->
7
+<template>
8
+  <div class="app-container">
9
+    <el-row :gutter="20">
10
+      <el-col :span="isFlow ? 18 : 24" :xs="24">
11
+        <el-form ref="form" :model="form" :rules="rules" label-width="100px" :disabled="taskName == ''">
12
+          <h2 style="text-align: center;">采购申请表</h2>
13
+          <el-row :gutter="20">
14
+            <el-col :span="7" :xs="24">
15
+              <el-form-item label="申请人:" prop="applier">
16
+                {{ getUserName(form.applier) }}
17
+              </el-form-item>
18
+            </el-col>
19
+            <el-col :span="7" :xs="24">
20
+              <el-form-item label="申请部门:" prop="applyDept">
21
+                {{ getDeptName(form.applyDept) }}
22
+              </el-form-item>
23
+            </el-col>
24
+            <el-col :span="7" :xs="24">
25
+              <el-form-item label="申请时间:" prop="date">
26
+                {{ form.applyTime }}
27
+              </el-form-item>
28
+            </el-col>
29
+          </el-row>
30
+          <el-form-item label="购置说明:" prop="applyReason">
31
+            <el-input type="textarea" v-model="form.applyReason" :autosize="{ minRows: 4 }"
32
+              :disabled="taskName != '采购申请'"></el-input>
33
+          </el-form-item>
34
+          <el-form-item label="采购计划表:">
35
+            <plan ref="planRef" :procureApplyId="form.procureApplyId" :taskName="taskName"></plan>
36
+          </el-form-item>
37
+          <el-form-item label="分管审核意见:" prop="managerComment" label-width="130px">
38
+            <el-input type="textarea" v-model="form.managerComment" :autosize="{ minRows: 4 }"
39
+              :disabled="taskName != '分管审核'"></el-input>
40
+            <auditor-row ref="fgRef" :isCurrent="taskName == '分管审核'"
41
+              :signature="form.managerUserId ? form.managerUserId : null"
42
+              :signTime="form.managerTime"></auditor-row>
43
+          </el-form-item>
44
+          <el-form-item label="总经理审批意见:" prop="zjlComment" label-width="130px">
45
+            <el-input type="textarea" v-model="form.zjlComment" :autosize="{ minRows: 4 }"
46
+              :disabled="taskName != '总经理审批'"></el-input>
47
+            <auditor-row ref="zjlRef" :isCurrent="taskName == '总经理审批'"
48
+              :signature="form.zjlUserId ? form.zjlUserId : null" :signTime="form.zjlTime"></auditor-row>
49
+          </el-form-item>
50
+        </el-form>
51
+        <el-row style="text-align: center;" v-if="taskName != ''">
52
+          <el-button type="warning" @click="saves()">保存</el-button>
53
+          <el-button type="primary" @click="completeApply()">提交</el-button>
54
+        </el-row>
55
+      </el-col>
56
+      <el-col :span="6" :xs="24" v-if="isFlow">
57
+        <el-card>
58
+          <h2 style="text-align: center;">流程进度</h2>
59
+          <div>
60
+            <flow :flowData="flowData" />
61
+          </div>
62
+        </el-card>
63
+      </el-col>
64
+    </el-row>
65
+
66
+    <el-dialog title="选择下个流程审批人" :visible.sync="completeOpen" width="60%" append-to-body>
67
+      <el-form ref="taskForm" :model="taskForm">
68
+        <el-form-item prop="targetKey">
69
+          <flow-user v-if="checkSendUser" :checkType="checkType" @handleUserSelect="handleUserSelect"></flow-user>
70
+        </el-form-item>
71
+      </el-form>
72
+      <span slot="footer" class="dialog-footer">
73
+        <el-button @click="completeOpen = false">取 消</el-button>
74
+        <el-button type="primary" @click="taskComplete()">确 定</el-button>
75
+      </span>
76
+    </el-dialog>
77
+  </div>
78
+</template>
79
+
80
+<script>
81
+import flow from '@/views/flowable/task/todo/detail/flow';
82
+import { flowXmlAndNode } from "@/api/flowable/definition";
83
+import { parseTime } from "@/utils/ruoyi";
84
+import { complete, rejectTask, returnList, returnTask, getNextFlowNode, delegate, flowTaskForm, } from "@/api/flowable/todo";
85
+import { getUsersDeptLeaderByDept, getUsersManageLeaderByDept, getUserByPost } from '@/api/system/post'
86
+import { listProcureApproval, getProcureApproval, addProcureApproval, updateProcureApproval, delProcureApproval } from "@/api/oa/procure/procureApproval";
87
+import { listProcurePlan, getProcurePlan, addProcurePlan, updateProcurePlan, delProcurePlan } from "@/api/oa/procure/procurePlan";
88
+import plan from './plan.vue'
89
+import AuditorRow from '../components/auditorRow.vue';
90
+import FlowUser from '@/components/flow/User';
91
+export default {
92
+  components: { flow, FlowUser, plan, AuditorRow },
93
+  props: {
94
+    taskName: {
95
+      type: String,
96
+      required: true
97
+    },
98
+    taskForm: {
99
+      type: Object,
100
+      required: true
101
+    },
102
+    isFlow: {
103
+      type: Boolean,
104
+      default: true
105
+    },
106
+  },
107
+  created() {
108
+    this.initFlow();
109
+    this.initForm();
110
+  },
111
+  data() {
112
+    return {
113
+      flowData: {},
114
+      form: {
115
+        deptId: undefined,
116
+        applyTime: undefined,
117
+        applier: undefined,
118
+      },
119
+      rules: {
120
+        applyReason: [
121
+          { required: true, message: '请输入购置说明', trigger: 'blur' }
122
+        ]
123
+      },
124
+      formTotal: 0,
125
+      checkSendUser: false,
126
+      completeOpen: false,
127
+      completeTitle: '',
128
+      checkType: 'single',
129
+    }
130
+  },
131
+  methods: {
132
+    initFlow() {
133
+      if (this.isFlow) {
134
+        flowXmlAndNode({ procInsId: this.taskForm.procInsId, deployId: this.taskForm.deployId }).then(res => {
135
+          this.flowData = res.data;
136
+        })
137
+      }
138
+    },
139
+    initForm() {
140
+      const formId = this.taskForm.formId;
141
+      getProcureApproval(formId).then(res => {
142
+        if (res.data) {
143
+          this.formTotal = 1
144
+          this.form = res.data
145
+        } else {
146
+        }
147
+        if (this.taskName == '采购申请') {
148
+          this.form.applier = this.$store.getters.userId;
149
+          this.form.applyDept = this.$store.getters.deptId;
150
+          this.form.applyTime = parseTime(new Date(), "{y}-{m}-{d}")
151
+        } else if (this.taskName == '分管审核') {
152
+          this.rules = {
153
+            managerComment: [
154
+              { required: true, message: '请输入审核意见', trigger: 'blur' }
155
+            ]
156
+          }
157
+        } else if (this.taskName == '总经理审批') {
158
+          this.rules = {
159
+            zjlComment: [
160
+              { required: true, message: '请输入审核意见', trigger: 'blur' }
161
+            ]
162
+          }
163
+        }
164
+      })
165
+    },
166
+    // 保存表单
167
+    async saves() {
168
+      if (this.formTotal) {
169
+        if (this.taskName == '分管审核') {
170
+          this.form.managerUserId = this.$refs.fgRef.localSignatureUserId;
171
+          this.form.managerTime = this.$refs.fgRef.loaclSignTime;
172
+        } else if (this.taskName == '总经理审批') {
173
+          this.form.zjlUserId = this.$refs.zjlRef.localSignatureUserId;
174
+          this.form.zjlTime = this.$refs.zjlRef.loaclSignTime;
175
+        }
176
+        await updateProcureApproval(this.form)
177
+      } else {
178
+        this.form.procureApplyId = this.taskForm.formId
179
+        await addProcureApproval(this.form)
180
+      }
181
+      this.savePlan();
182
+      this.$message.success('保存成功')
183
+    },
184
+    // 保存采购计划
185
+    async savePlan() {
186
+      const planList = this.$refs.planRef.itemList;
187
+      const isAdd = this.$refs.planRef.formTotal;
188
+      const procureApplyId = this.taskForm.formId;
189
+      if (isAdd)
190
+        await delProcurePlan(procureApplyId)
191
+      for (let plan of planList) {
192
+        plan.procureApplyId = procureApplyId
193
+        await addProcurePlan(plan)
194
+      }
195
+    },
196
+    completeApply() {
197
+      const params = { taskId: this.taskForm.taskId };
198
+      this.$refs['form'].validate(valid => {
199
+        if (valid) {
200
+          this.saves();
201
+          getNextFlowNode(params).then(async res => {
202
+            if (this.taskName == '采购申请') {
203
+              this.checkSendUser = true;
204
+              this.completeOpen = true;
205
+            } else if (this.taskName == '编制计划') {
206
+              let managerList = []
207
+              let result = await getUsersManageLeaderByDept({ deptId: this.form.applyDept });
208
+              result.data.forEach(element => {
209
+                managerList.push(element.userId)
210
+              });
211
+              this.$set(this.taskForm.variables, "approvalList", managerList);
212
+              this.successComplete();
213
+            } else if (this.taskName == '分管审核') {
214
+              let result = await getUserByPost({ postName: '总经理' })
215
+              this.$set(this.taskForm.variables, "approval", result.data[0].userId);
216
+              this.successComplete();
217
+            } else if (this.taskName == '总经理审批') {
218
+              this.successComplete();
219
+            }
220
+          })
221
+        } else {
222
+          this.$message.error('请完善必填项')
223
+        }
224
+      })
225
+    },
226
+    successComplete() {
227
+      complete(this.taskForm).then(response => {
228
+        this.$modal.msgSuccess(response.msg);
229
+        this.$emit('goBack')
230
+      })
231
+    },
232
+    // 用户信息选中数据
233
+    handleUserSelect(selection) {
234
+      if (selection) {
235
+        //不多选
236
+        this.$set(this.taskForm.variables, "approval", selection.userId.toString());
237
+      }
238
+    },
239
+    /** 用户审批任务 */
240
+    taskComplete() {
241
+      if (!this.taskForm.variables && this.checkSendUser) {
242
+        this.$modal.msgError("请选择流程接收人员!");
243
+        return;
244
+      }
245
+      if (this.taskForm) {
246
+        this.successComplete();
247
+      }
248
+    },
249
+  },
250
+
251
+}
252
+</script>
253
+
254
+<style lang="scss" scoped>
255
+@import "@/assets/styles/element-reset.scss";
256
+</style>

+ 11
- 10
oa-ui/src/views/flowable/task/todo/detail/index.vue Bestand weergeven

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2024-01-03 09:23:11
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-08-16 09:18:46
5
+ * @LastEditTime: 2024-09-19 13:44:13
6 6
 -->
7 7
 <template>
8 8
   <div class="app-container">
@@ -477,15 +477,16 @@ export default {
477 477
     },
478 478
     // 是否显示审批通过
479 479
     isShowApprove() {
480
-      if (this.taskName == '员工填报' || this.taskForm.procDefName == '用车审批' || this.taskForm.procDefName == '设备审批' || this.taskForm.procDefName == '项目流转'
481
-        || (this.taskForm.procDefName == '项目预算' && this.taskName != '预算审核') || this.taskForm.procDefName == '借款审批' || this.taskForm.procDefName == '安全交底' ||
482
-        this.taskForm.procDefName == '技术交底' || this.taskForm.procDefName == '技术方案' || this.taskForm.procDefName == '承接合同评审' || this.taskForm.procDefName == '分包合同评审'
483
-        || this.taskForm.procDefName == '品牌项目支付' || this.taskForm.procDefName == '保证金审批' || this.taskForm.procDefName == '成果归档' || this.taskForm.procDefName == '项目结算'
484
-        || this.taskForm.procDefName == '项目变更' || this.taskForm.procDefName == '其他结算' ||this.taskForm.procDefName == '工作填报') {
485
-        return false
486
-      } else {
487
-        return true
488
-      }
480
+      return false
481
+      // if (this.taskName == '员工填报' || this.taskForm.procDefName == '用车审批' || this.taskForm.procDefName == '设备审批' || this.taskForm.procDefName == '项目流转'
482
+      //   || (this.taskForm.procDefName == '项目预算' && this.taskName != '预算审核') || this.taskForm.procDefName == '借款审批' || this.taskForm.procDefName == '安全交底' ||
483
+      //   this.taskForm.procDefName == '技术交底' || this.taskForm.procDefName == '技术方案' || this.taskForm.procDefName == '承接合同评审' || this.taskForm.procDefName == '分包合同评审'
484
+      //   || this.taskForm.procDefName == '品牌项目支付' || this.taskForm.procDefName == '保证金审批' || this.taskForm.procDefName == '成果归档' || this.taskForm.procDefName == '项目结算'
485
+      //   || this.taskForm.procDefName == '项目变更' || this.taskForm.procDefName == '其他结算' ||this.taskForm.procDefName == '工作填报') {
486
+      //   return false
487
+      // } else {
488
+      //   return true
489
+      // }
489 490
     }
490 491
   },
491 492
 };

+ 2
- 2
oa-ui/src/views/oa/project/index.vue Bestand weergeven

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2024-02-27 14:49:15
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-09-13 16:26:08
5
+ * @LastEditTime: 2024-09-20 16:56:04
6 6
 -->
7 7
 <template>
8 8
   <div class="project-wrapper">
@@ -70,7 +70,7 @@
70 70
     <!-- 项目列表 -->
71 71
     <el-card style="margin-top: 20px;">
72 72
       <div slot="header" class="card-header">
73
-        <div style="font-weight: bold;font-size: 20px;">项目列表</div>
73
+        <div style="font-weight: bold;font-size: 20px;">测绘项目列表</div>
74 74
         <div>
75 75
           <el-button style="float: right;margin-right: 10px;" type="success" size="mini" icon="el-icon-plus"
76 76
             @click="handleRegister">登记项目</el-button>

+ 617
- 0
oa-ui/src/views/oa/project/invest.vue Bestand weergeven

@@ -0,0 +1,617 @@
1
+<!--
2
+ * @Author: ysh
3
+ * @Date: 2024-02-27 14:49:15
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2024-09-20 16:55:07
6
+-->
7
+<template>
8
+  <div class="project-wrapper">
9
+    <!-- 搜索栏 -->
10
+    <el-row>
11
+      <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="88px">
12
+        <el-form-item label="项目编号" prop="projectNumber">
13
+          <el-input v-model="queryParams.projectNumber" placeholder="请输入项目编号" clearable
14
+            @keyup.enter.native="handleQuery" />
15
+        </el-form-item>
16
+        <el-form-item label="项目名称" prop="projectName">
17
+          <el-input v-model="queryParams.projectName" placeholder="请输入项目名称" clearable
18
+            @keyup.enter.native="handleQuery" />
19
+        </el-form-item>
20
+        <el-form-item label="项目负责人" prop="projectLeader">
21
+          <el-select v-model="queryParams.projectLeader" clearable filterable placeholder="请输入项目负责人" size="large"
22
+            style="width: 240px" @keyup.enter.native="handleQuery">
23
+            <el-option v-for="item in userList" :key="item.userId" :label="item.nickName" :value="item.userId" />
24
+          </el-select>
25
+        </el-form-item>
26
+        <el-form-item label="状态" prop="isFinished">
27
+          <el-select v-model="queryParams.isFinished" clearable>
28
+            <el-option label="进行中" value="0"></el-option>
29
+            <el-option label="已结束" value="1"></el-option>
30
+          </el-select>
31
+        </el-form-item>
32
+        <el-form-item>
33
+          <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
34
+        </el-form-item>
35
+      </el-form>
36
+    </el-row>
37
+    <!-- 项目统计 -->
38
+    <!-- <el-row>
39
+      <el-col>
40
+        <el-row :gutter="20">
41
+          <el-col :span="8" :xs="24">
42
+            <div class="static-box">
43
+              <div class="title">今年项目数量</div>
44
+              <div class="box-content">
45
+                <div class="box-left">
46
+                  <div class="number">48</div>
47
+                </div>
48
+                <dir class="box-right">
49
+                  <div style="display: flex;">
50
+                    <div>院内</div>
51
+                    <div class="progress"><el-progress :percentage="100" :stroke-width="14"></el-progress></div>
52
+                  </div>
53
+                  <div style="display: flex;" class="mt10">
54
+                    <div>院外</div>
55
+                    <div class="progress"><el-progress :percentage="100" :stroke-width="14"></el-progress></div>
56
+                  </div>
57
+                </dir>
58
+              </div>
59
+            </div>
60
+          </el-col>
61
+          <el-col :span="8" :xs="24">
62
+
63
+          </el-col>
64
+          <el-col :span="8" :xs="24">
65
+
66
+          </el-col>
67
+        </el-row>
68
+      </el-col>
69
+    </el-row> -->
70
+    <!-- 项目列表 -->
71
+    <el-card style="margin-top: 20px;">
72
+      <div slot="header" class="card-header">
73
+        <div style="font-weight: bold;font-size: 20px;">勘察项目列表</div>
74
+        <div>
75
+          <el-button style="float: right;margin-right: 10px;" type="success" size="mini" icon="el-icon-plus"
76
+            @click="handleRegister">登记项目</el-button>
77
+          <el-button style="float: right;margin-right: 10px;" type="warning" size="mini" icon="el-icon-download"
78
+            @click="handleExport">导出项目</el-button>
79
+        </div>
80
+      </div>
81
+      <el-table v-loading="loading" :data="projectList" style="margin-top: 30px;">
82
+        <el-table-column type="index" width="50">
83
+        </el-table-column>
84
+        <el-table-column prop="isFinshed" align="center" label="状态" width="90px">
85
+          <template slot-scope="scope">
86
+            <el-tag :type="scope.row.isFinished === '0' ? 'success' : 'warning'" disable-transitions>
87
+              {{ scope.row.isFinished == '0' ? '进行中' : '已结束' }}
88
+            </el-tag>
89
+          </template>
90
+        </el-table-column>
91
+        <el-table-column prop="percentage" align="center" label="生产进度" width="120px">
92
+          <template slot-scope="scope">
93
+            <el-progress :text-inside="true" :stroke-width="26" :status="formatStatus(scope.row.percentage)"
94
+              :percentage="scope.row.percentage" text-color="#fff"></el-progress>
95
+          </template>
96
+        </el-table-column>
97
+        <el-table-column label="项目编号" align="center" key="projectNumber" prop="projectNumber" width="120px" />
98
+        <el-table-column label="项目名称" align="center" key="projectName" prop="projectName" />
99
+        <el-table-column label="承担部门" align="center" key="undertakingDeptName" prop="undertakingDeptName" />
100
+        <el-table-column label="项目负责人" align="center" key="projectLeaderName" prop="projectLeaderUser.nickName"
101
+          width="120px" />
102
+        <el-table-column label="项目级别" align="center" key="projectLevel" prop="projectLevel" width="120px">
103
+          <template slot-scope="scope">
104
+            <el-tag :type="scope.row.projectLevel ? (scope.row.projectLevel === '0' ? 'info' : 'danger') : 'info'"
105
+              disable-transitions>
106
+              {{ scope.row.projectLevel ? (scope.row.projectLevel == '0' ? '一般项目' : '重大项目') : '一般项目' }}
107
+            </el-tag>
108
+          </template>
109
+        </el-table-column>
110
+        <el-table-column label="项目类型" align="center" key="projectType" prop="projectType" width="120px" />
111
+        <el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
112
+          <template slot-scope="scope" v-if="scope.row.userId !== 1">
113
+            <el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)"
114
+              v-hasPermi="['oa:project:query']">查看</el-button>
115
+            <!-- <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
116
+              v-hasPermi="['oa:project:edit']">修改</el-button> -->
117
+            <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
118
+              v-hasPermi="['oa:project:remove']">删除</el-button>
119
+          </template>
120
+        </el-table-column>
121
+      </el-table>
122
+      <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
123
+        :autoScroll="false" @pagination="getList" />
124
+    </el-card>
125
+    <!-- 新建项目 -->
126
+    <el-dialog :title="title" :visible.sync="addOpen" append-to-body>
127
+      <el-form :model="addForm" :rules="rules" label-width="100px">
128
+        <el-form-item label="项目编号:" prop="projectNumber">
129
+          <el-input v-model="addForm.projectNumber"></el-input>
130
+        </el-form-item>
131
+        <el-form-item label="项目名称:" prop="projectName">
132
+          <el-input v-model="addForm.projectName"></el-input>
133
+        </el-form-item>
134
+        <el-form-item label="项目负责人:" prop="projectLeader">
135
+          <el-tag effect="plain" type="warning" style="margin-right: 10px;"
136
+            v-if="addForm.projectLeaderName != undefined">{{
137
+        addForm.projectLeaderName }}</el-tag>
138
+          <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="choosePeople">选择</el-button>
139
+        </el-form-item>
140
+        <el-form-item label="项目类型:" prop="projectType">
141
+          <el-input v-model="addForm.projectType"></el-input>
142
+        </el-form-item>
143
+        <el-form-item label="项目级别:" prop="projectLevel">
144
+          <el-radio v-model="addForm.projectLevel" label="0">一般项目</el-radio>
145
+          <el-radio v-model="addForm.projectLevel" label="1">重大项目</el-radio>
146
+        </el-form-item>
147
+        <el-form-item label="项目来源:" prop="projectSource">
148
+          <el-radio v-model="addForm.projectSource" label="0">院内</el-radio>
149
+          <el-radio v-model="addForm.projectSource" label="1">院外</el-radio>
150
+        </el-form-item>
151
+        <el-form-item label="甲方单位:" prop="partyA">
152
+          <el-input v-model="addForm.partyA"></el-input>
153
+        </el-form-item>
154
+        <el-form-item label="联系人:" prop="contactPerson">
155
+          <el-input v-model="addForm.contactPerson"></el-input>
156
+        </el-form-item>
157
+        <el-form-item label="联系电话:" prop="telephone">
158
+          <el-input v-model="addForm.telephone"></el-input>
159
+        </el-form-item>
160
+        <el-form-item label="项目概况:" prop="projectRegistrant">
161
+          <table border="1">
162
+            <tr>
163
+              <td style="width:250px;">工作内容</td>
164
+              <td>等级或比例尺</td>
165
+              <td>单位</td>
166
+              <td>工作量</td>
167
+              <td style="width:100px;">要求完成时间</td>
168
+              <td>备注</td>
169
+            </tr>
170
+            <tr v-for="(work, index) in workList" :key="index">
171
+              <td>
172
+                <el-input v-model="work.content" type="textarea" autosize clearable></el-input>
173
+              </td>
174
+              <td>
175
+                <el-input v-model="work.scale" clearable></el-input>
176
+              </td>
177
+              <td>
178
+                <el-input v-model="work.unit" clearable></el-input>
179
+              </td>
180
+              <td>
181
+                <el-input v-model="work.workload" clearable></el-input>
182
+              </td>
183
+              <td>
184
+                <el-date-picker style="width:140px;" v-model="work.deadline" value-format="yyyy-MM-dd" type="date"
185
+                  placeholder="选择日期">
186
+                </el-date-picker>
187
+              </td>
188
+              <td>
189
+                <el-input v-model="work.remark" type="textarea" autosize clearable></el-input>
190
+              </td>
191
+              <td>
192
+                <el-button type="danger" icon="el-icon-minus" size="mini" circle
193
+                  @click="deletWorkItem(index)"></el-button>
194
+              </td>
195
+            </tr>
196
+          </table>
197
+
198
+          <el-button icon="el-icon-plus" size="mini" @click="addWorkList"></el-button>
199
+        </el-form-item>
200
+        <el-form-item label="项目登记人:" prop="projectRegistrant">
201
+          <el-input v-model="addForm.projectRegistrant"></el-input>
202
+        </el-form-item>
203
+        <el-form-item label="备注:" prop="projectRegistrant">
204
+          <el-input v-model="addForm.remark" type="textarea" rows="3"></el-input>
205
+        </el-form-item>
206
+
207
+      </el-form>
208
+      <div slot="footer" class="dialog-footer" style="text-align: center;">
209
+        <el-button type="primary" @click="confirmAddForm">确 定</el-button>
210
+        <el-button @click="cancel">取 消</el-button>
211
+      </div>
212
+      <!-- 人员选择对话框 -->
213
+      <el-dialog width="30%" title="选择项目负责人" :visible.sync="peopleVisible" append-to-body>
214
+        <el-form>
215
+          <el-form-item label="部门:">
216
+            <el-select v-model="peopleForm.deptId" @change="handleChangeDept">
217
+              <el-option v-for="item in peopleForm.deptList" :key="item.deptId" :label="item.deptName"
218
+                :value="item.deptId" v-if="item.deptName != '四川中水成勘院测绘工程有限责任公司'">
219
+              </el-option>
220
+            </el-select>
221
+          </el-form-item>
222
+          <el-form-item label="人员:">
223
+            <el-select v-model="peopleForm.userId">
224
+              <el-option v-for="item in peopleForm.userList" :key="item.userId" :label="item.nickName"
225
+                :value="item.userId">
226
+              </el-option>
227
+            </el-select>
228
+          </el-form-item>
229
+          <el-form-item>
230
+            <el-button @click="confirmPeople" type="primary">确定</el-button>
231
+            <el-button @click="cancelChoosePeople">取消</el-button>
232
+          </el-form-item>
233
+        </el-form>
234
+      </el-dialog>
235
+
236
+      <!-- 修改项目 -->
237
+      <el-dialog :title="title" :visible.sync="modifyOpen">
238
+
239
+      </el-dialog>
240
+
241
+    </el-dialog>
242
+  </div>
243
+</template>
244
+
245
+<script>
246
+import { listInvestProject, submitProject, modifyProject, delProject } from "@/api/oa/project/project";
247
+import { listProjectProgress, getProjectProgress } from "@/api/oa/project/projectProgress";
248
+import { listDept } from '@/api/system/dept';
249
+import { listUser, getUser } from '@/api/system/user';
250
+import { mapGetters } from 'vuex';
251
+import { checkPermi } from '@/utils/permission';
252
+import { listDefinition } from "@/api/flowable/definition";
253
+import { definitionStart, flowXmlAndNode } from "@/api/flowable/definition";
254
+import { todoList, getNextFlowNodeByStart } from "@/api/flowable/todo";
255
+import { Snowflake } from '@/utils/snowFlake.js'
256
+
257
+export default {
258
+  name: 'Invest',
259
+  computed: {
260
+    ...mapGetters(['deptId', 'userId'])
261
+  },
262
+  data() {
263
+    return {
264
+      userList: [],
265
+      // 查询参数
266
+      queryParams: {
267
+        pageNum: 1,
268
+        pageSize: 10,
269
+        projectNumber: '',
270
+        projectLeader: undefined,
271
+        projectName: '',
272
+      },
273
+      projectList: [],
274
+      total: 0,
275
+      loading: true,
276
+      addOpen: false,
277
+      modifyOpen: false,
278
+      title: '',
279
+      addForm: {},
280
+      rules: {
281
+        projectNumber: [{ required: true, message: '请输入项目编号', trigger: 'blur' }],
282
+        projectName: [{ required: true, message: '请输入项目名称', trigger: 'blur' }]
283
+      },
284
+      peopleVisible: false,
285
+      peopleForm: {
286
+        deptId: '',
287
+        deptList: [],
288
+        userId: '',
289
+        userList: []
290
+      },
291
+      workList: [{
292
+        content: '',
293
+        scale: '',
294
+        unit: '',
295
+        workload: '',
296
+        deadline: '',
297
+        remark: ''
298
+      }],
299
+    }
300
+  },
301
+  created() {
302
+    this.getList();
303
+    this.getDeptList();
304
+    this.getUserList();
305
+  },
306
+  methods: {
307
+    // 查询项目列表
308
+    async getList() {
309
+      this.loading = true
310
+      if (this.deptId > 106 && this.deptId != 109) {
311
+        let response = await checkPermi(['oa:allproject:query'])
312
+        if (response == false) {
313
+          this.queryParams.undertakingDept = this.deptId
314
+        }
315
+      }
316
+      listInvestProject(this.queryParams).then(response => {
317
+        this.projectList = response.rows;
318
+        this.total = response.total;
319
+        this.loading = false;
320
+        for (let project of this.projectList) {
321
+          getProjectProgress(project.projectId).then(res => {
322
+            if (res.data) {
323
+              let len = res.data.length
324
+              if (len != 0) {
325
+                this.$set(project, 'percentage', Number(res.data[len - 1].percentage))
326
+              } else {
327
+                this.$set(project, 'percentage', 0)
328
+              }
329
+              if (project.isFinished == '1') {
330
+                this.$set(project, 'percentage', 100)
331
+              }
332
+            }
333
+          })
334
+        }
335
+      })
336
+    },
337
+    getDeptList() {
338
+      listDept({
339
+        deptName: undefined,
340
+        status: undefined
341
+      }).then(res => {
342
+        this.peopleForm.deptList = res.data
343
+      })
344
+    },
345
+    getUserList() {
346
+      listUser({ pageNum: 1, pageSize: 9999 }).then(res => {
347
+        this.userList = res.rows
348
+      })
349
+    },
350
+    handleQuery() {
351
+      this.queryParams.pageNum = 1;
352
+      this.getList();
353
+    },
354
+    handleAdd() {
355
+      this.title = '新增项目'
356
+      this.addOpen = true
357
+    },
358
+    handleView(row) {
359
+      let id = row.projectId
360
+      this.$router.push({
361
+        path: '/project/info',
362
+        query: { projectId: id }
363
+      })
364
+    },
365
+    handleUpdate(row) {
366
+      this.addForm = row;
367
+      this.title = '修改项目信息';
368
+      this.addOpen = true;
369
+    },
370
+    handleDelete(row) {
371
+      const projectIds = row.projectId || this.ids;
372
+      const projectNumbers = row.projectNumber || this.ids;
373
+      this.$modal.confirm('是否确认删除项目编号为"' + projectNumbers + '"的数据项?').then(function () {
374
+        return delProject(projectIds);
375
+      }).then(() => {
376
+        this.getList();
377
+        this.$modal.msgSuccess("删除成功");
378
+      }).catch(() => { });
379
+    },
380
+    confirmAddForm() {
381
+      this.addForm.workList = this.workList;
382
+      let formData = new FormData();
383
+      let form = JSON.stringify(this.addForm);
384
+      formData.append("form", form);
385
+      if (this.title == '新增项目')
386
+        submitProject(formData).then(response => {
387
+          this.$modal.msgSuccess("新增成功");
388
+          this.addOpen = false;
389
+          this.getList();
390
+        });
391
+      else
392
+        modifyProject(formData).then(response => {
393
+          this.$modal.msgSuccess("修改成功");
394
+          this.addOpen = false;
395
+          this.getList();
396
+        });
397
+    },
398
+    // 人员选择
399
+    choosePeople() {
400
+      this.peopleVisible = true;
401
+    },
402
+    // 改变部门选择
403
+    handleChangeDept(deptId) {
404
+      this.peopleForm.userId = '';
405
+      listUser({ pageSize: 999999, deptId }).then(res => {
406
+        this.peopleForm.userList = res.rows
407
+      })
408
+    },
409
+    // 确定项目负责人
410
+    confirmPeople() {
411
+      this.addForm.projectLeader = this.peopleForm.userId;
412
+      this.addForm.projectLeaderName = this.tagLeader()
413
+      this.peopleVisible = false
414
+    },
415
+    tagLeader() {
416
+      if (this.addForm.projectLeader == '' || this.addForm.projectLeader == undefined || this.addForm.projectLeader == null) {
417
+        return undefined
418
+      } else {
419
+        for (let user of this.peopleForm.userList) {
420
+          if (this.addForm.projectLeader == user.userId) {
421
+            return user.nickName
422
+          }
423
+        }
424
+      }
425
+    },
426
+    cancel() {
427
+      this.peopleForm.deptId = '';
428
+      this.peopleForm.userId = '';
429
+      this.addOpen = false;
430
+      this.addForm = {}
431
+    },
432
+    addWorkList() {
433
+      this.workList.push({
434
+        content: '',
435
+        scale: '',
436
+        unit: '',
437
+        workload: '',
438
+        deadline: '',
439
+        remark: ''
440
+      });
441
+    },
442
+    deletWorkItem(index) {
443
+      let arr = this.workList
444
+      if (arr.length == 1) {
445
+        return
446
+      }
447
+      if (index >= 0 && index < arr.length) {
448
+        arr.splice(index, 1);
449
+      }
450
+    },
451
+    cancelChoosePeople() {
452
+      this.peopleForm.deptId = '';
453
+      this.peopleForm.userId = '';
454
+      this.peopleVisible = false;
455
+    },
456
+    formatStatus(row) {
457
+      if (row <= 20) {
458
+        return 'exception'
459
+      } else if (row > 20 && row <= 50) {
460
+        return 'warning'
461
+      } else if (row > 50 && row <= 80) {
462
+        return ''
463
+      } else {
464
+        return 'success'
465
+      }
466
+    },
467
+    async handleRegister() {
468
+      let response = await listDefinition({
469
+        pageNum: 1,
470
+        pageSize: 9999,
471
+        name: "项目流转",
472
+        category: "project",
473
+      })
474
+      if (response.data.total == 1) {
475
+        let obj = response.data.records[0]
476
+        this.$confirm("是否发起项目流转?", '提示', {
477
+          confirmButtonText: '确定',
478
+          cancelButtonText: '取消',
479
+          type: 'warning'
480
+        }).then(() => {
481
+          this.handleStartProcess(obj)
482
+        }).catch(() => { });
483
+      }
484
+    },
485
+    handleExport() {
486
+      this.queryParams.pageSize = 99999
487
+      this.download('oa/project/export', {
488
+        ...this.queryParams
489
+      }, `project_${new Date().getTime()}.xlsx`).then(() => {
490
+        this.queryParams.pageSize = 10
491
+      })
492
+    },
493
+    handleStartProcess(row) {
494
+      let formId = new Snowflake(1n, 1n, 0n).nextId().toString();
495
+      getNextFlowNodeByStart({ deploymentId: row.deploymentId, variables: { formId: formId } }).then(res => {
496
+        let data = res.data;
497
+        const variables = {};
498
+        const formData = {};
499
+        formData.disabled = true;
500
+        formData.formBtns = false;
501
+        formData.formId = formId
502
+        if (row.id) {
503
+          variables.variables = formData;
504
+          let routePath = this.getRoutePath(row);
505
+          definitionStart(row.id, JSON.stringify(variables)).then(res => {
506
+            this.$modal.msgSuccess(res.msg);
507
+            let procInstanceId = res.data;
508
+            todoList({
509
+              pageNum: 1,
510
+              pageSize: 99999999, processInsId: procInstanceId
511
+            }).then(toDoRes => {
512
+              let records = toDoRes.data.records;
513
+              if (records.length == 1) {
514
+                records = records[0]
515
+              }
516
+              this.$router.push({
517
+                path: routePath,
518
+                query: {
519
+                  procInsId: records.procInsId,
520
+                  executionId: records.executionId,
521
+                  deployId: records.deployId,
522
+                  taskId: records.taskId,
523
+                  taskName: records.taskName,
524
+                  startUser: records.startUserName + '-' + records.startDeptName,
525
+                  formId: formData.formId,
526
+                  procDefName: records.procDefName
527
+                }
528
+              })
529
+            })
530
+          })
531
+        }
532
+      })
533
+    },
534
+    getRoutePath(row) {
535
+      let path;
536
+      for (let p of this.publicData.pathRoute) {
537
+        if (p.name == row.name) {
538
+          path = p.path
539
+          break
540
+        } else {
541
+          path = '/flowable/task/todo/detail/index'
542
+        }
543
+      }
544
+      return path
545
+    },
546
+  },
547
+}
548
+</script>
549
+
550
+<style lang="scss" scoped>
551
+.project-wrapper {
552
+  padding: 25px;
553
+  background-color: #f5f5f5;
554
+}
555
+
556
+.table-header {
557
+  background-color: #f5f5f5;
558
+}
559
+
560
+.card-header {
561
+  display: flex;
562
+  justify-content: space-between;
563
+  padding: 0 10px;
564
+}
565
+
566
+table {
567
+  /*居中*/
568
+  margin: 0 auto;
569
+  /*边框*/
570
+  /* border: 1px solid black; */
571
+  text-align: center;
572
+  border-collapse: collapse;
573
+  /*设置背景颜色*/
574
+  /* background-color: #bfa; */
575
+}
576
+
577
+.static-box {
578
+  width: 100%;
579
+  height: 120px;
580
+  background-color: #fff;
581
+  border-radius: 6px;
582
+  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
583
+
584
+  .title {
585
+    padding-left: 30px;
586
+    padding-top: 10px;
587
+    font-size: 18px;
588
+  }
589
+
590
+  .box-content {
591
+    display: flex;
592
+
593
+    .box-left {
594
+      padding: 10px;
595
+
596
+      .number {
597
+        padding-left: 20px;
598
+        font-size: 36px;
599
+        font-family: Arial, Helvetica, sans-serif;
600
+        line-height: 70px;
601
+        min-width: 100px;
602
+      }
603
+    }
604
+
605
+    .box-right {
606
+      flex: 1;
607
+      padding: 0 10px;
608
+
609
+      .progress {
610
+        flex: 1;
611
+        padding-left: 10px;
612
+      }
613
+    }
614
+  }
615
+
616
+}
617
+</style>

Laden…
Annuleren
Opslaan