Ver código fonte

借款申请表单

lamphua 1 ano atrás
pai
commit
6defd24d35

+ 24
- 22
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcProjectController.java Ver arquivo

193
         cmcProject.setIsFinished("0");
193
         cmcProject.setIsFinished("0");
194
         cmcProject.setRemark(formDataJson.getString("remark"));
194
         cmcProject.setRemark(formDataJson.getString("remark"));
195
         String workList = formDataJson.getString("workList");
195
         String workList = formDataJson.getString("workList");
196
-        workList = workList.substring(1, workList.length() - 1);
197
-        if (workList.split("}").length > 1) {
198
-            cmcProjectWorkService.deleteCmcProjectWorkByProjectId(formDataJson.getString("projectId"));
199
-            for (int i = 0; i < workList.split("}").length; i++) {
200
-                String workArri = workList.split("}")[i] + "}";
201
-                if (i > 0)
202
-                    workArri = workArri.substring(1);
203
-                JSONObject workArrObject = JSONObject.parse(workArri);
196
+        if (workList != null) {
197
+            workList = workList.substring(1, workList.length() - 1);
198
+            if (workList.split("}").length > 1) {
199
+                cmcProjectWorkService.deleteCmcProjectWorkByProjectId(formDataJson.getString("projectId"));
200
+                for (int i = 0; i < workList.split("}").length; i++) {
201
+                    String workArri = workList.split("}")[i] + "}";
202
+                    if (i > 0)
203
+                        workArri = workArri.substring(1);
204
+                    JSONObject workArrObject = JSONObject.parse(workArri);
205
+                    CmcProjectWork cmcProjectWork = new CmcProjectWork();
206
+                    cmcProjectWork.setWorkId(new SnowFlake().generateId());
207
+                    cmcProjectWork.setProjectId(formDataJson.getString("projectId"));
208
+                    cmcProjectWork.setContent(workArrObject.getString("content"));
209
+                    cmcProjectWork.setScale(workArrObject.getString("scale"));
210
+                    cmcProjectWork.setUnit(workArrObject.getString("unit"));
211
+                    cmcProjectWork.setWorkload(workArrObject.getString("workload"));
212
+                    cmcProjectWork.setDeadline(DateUtils.dateTime("yyyy-MM-dd", workArrObject.getString("deadline")));
213
+                    cmcProjectWork.setRemark(workArrObject.getString("remark"));
214
+                    cmcProjectWorkService.insertCmcProjectWork(cmcProjectWork);
215
+                }
216
+            }
217
+            else {
218
+                JSONObject workArrObject = JSONObject.parse(workList);
219
+                cmcProjectWorkService.deleteCmcProjectWorkByProjectId(formDataJson.getString("projectId"));
204
                 CmcProjectWork cmcProjectWork = new CmcProjectWork();
220
                 CmcProjectWork cmcProjectWork = new CmcProjectWork();
205
                 cmcProjectWork.setWorkId(new SnowFlake().generateId());
221
                 cmcProjectWork.setWorkId(new SnowFlake().generateId());
206
                 cmcProjectWork.setProjectId(formDataJson.getString("projectId"));
222
                 cmcProjectWork.setProjectId(formDataJson.getString("projectId"));
213
                 cmcProjectWorkService.insertCmcProjectWork(cmcProjectWork);
229
                 cmcProjectWorkService.insertCmcProjectWork(cmcProjectWork);
214
             }
230
             }
215
         }
231
         }
216
-        else {
217
-            JSONObject workArrObject = JSONObject.parse(workList);
218
-            cmcProjectWorkService.deleteCmcProjectWorkByProjectId(formDataJson.getString("projectId"));
219
-            CmcProjectWork cmcProjectWork = new CmcProjectWork();
220
-            cmcProjectWork.setWorkId(new SnowFlake().generateId());
221
-            cmcProjectWork.setProjectId(formDataJson.getString("projectId"));
222
-            cmcProjectWork.setContent(workArrObject.getString("content"));
223
-            cmcProjectWork.setScale(workArrObject.getString("scale"));
224
-            cmcProjectWork.setUnit(workArrObject.getString("unit"));
225
-            cmcProjectWork.setWorkload(workArrObject.getString("workload"));
226
-            cmcProjectWork.setDeadline(DateUtils.dateTime("yyyy-MM-dd", workArrObject.getString("deadline")));
227
-            cmcProjectWork.setRemark(workArrObject.getString("remark"));
228
-            cmcProjectWorkService.insertCmcProjectWork(cmcProjectWork);
229
-        }
230
         return toAjax(cmcProjectService.updateCmcProject(cmcProject));
232
         return toAjax(cmcProjectService.updateCmcProject(cmcProject));
231
     }
233
     }
232
 
234
 

+ 37
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcBorrow.java Ver arquivo

3
 import java.math.BigDecimal;
3
 import java.math.BigDecimal;
4
 import java.util.Date;
4
 import java.util.Date;
5
 import com.fasterxml.jackson.annotation.JsonFormat;
5
 import com.fasterxml.jackson.annotation.JsonFormat;
6
+import com.ruoyi.common.core.domain.entity.SysUser;
6
 import org.apache.commons.lang3.builder.ToStringBuilder;
7
 import org.apache.commons.lang3.builder.ToStringBuilder;
7
 import org.apache.commons.lang3.builder.ToStringStyle;
8
 import org.apache.commons.lang3.builder.ToStringStyle;
8
 import com.ruoyi.common.annotation.Excel;
9
 import com.ruoyi.common.annotation.Excel;
25
     @Excel(name = "项目id")
26
     @Excel(name = "项目id")
26
     private String projectId;
27
     private String projectId;
27
 
28
 
29
+    private CmcProject project;
30
+
28
     /** 借款类型 */
31
     /** 借款类型 */
29
     @Excel(name = "借款类型")
32
     @Excel(name = "借款类型")
30
     private String borrowType;
33
     private String borrowType;
33
     @Excel(name = "借款事由")
36
     @Excel(name = "借款事由")
34
     private String applyReason;
37
     private String applyReason;
35
 
38
 
39
+    /** 借款部门 */
40
+    @Excel(name = "借款部门")
41
+    private String applyDept;
42
+
36
     /** 借款人 */
43
     /** 借款人 */
37
     @Excel(name = "借款人")
44
     @Excel(name = "借款人")
38
     private Long applier;
45
     private Long applier;
39
 
46
 
47
+    private SysUser applierUser;
48
+
40
     /** 借款日期 */
49
     /** 借款日期 */
41
     @JsonFormat(pattern = "yyyy-MM-dd")
50
     @JsonFormat(pattern = "yyyy-MM-dd")
42
     @Excel(name = "借款日期", width = 30, dateFormat = "yyyy-MM-dd")
51
     @Excel(name = "借款日期", width = 30, dateFormat = "yyyy-MM-dd")
133
     {
142
     {
134
         return projectId;
143
         return projectId;
135
     }
144
     }
145
+    public void setProject(CmcProject project)
146
+    {
147
+        this.project = project;
148
+    }
149
+
150
+    public CmcProject getProject()
151
+    {
152
+        return project;
153
+    }
136
     public void setBorrowType(String borrowType) 
154
     public void setBorrowType(String borrowType) 
137
     {
155
     {
138
         this.borrowType = borrowType;
156
         this.borrowType = borrowType;
151
     {
169
     {
152
         return applyReason;
170
         return applyReason;
153
     }
171
     }
172
+    public void setApplyDept(String applyDept)
173
+    {
174
+        this.applyDept = applyDept;
175
+    }
176
+
177
+    public String getApplyDept()
178
+    {
179
+        return applyDept;
180
+    }
154
     public void setApplier(Long applier) 
181
     public void setApplier(Long applier) 
155
     {
182
     {
156
         this.applier = applier;
183
         this.applier = applier;
160
     {
187
     {
161
         return applier;
188
         return applier;
162
     }
189
     }
190
+    public void setApplierUser(SysUser applierUser)
191
+    {
192
+        this.applierUser = applierUser;
193
+    }
194
+
195
+    public SysUser getApplierUser()
196
+    {
197
+        return applierUser;
198
+    }
163
     public void setApplyDate(Date applyDate) 
199
     public void setApplyDate(Date applyDate) 
164
     {
200
     {
165
         this.applyDate = applyDate;
201
         this.applyDate = applyDate;
331
             .append("borrowType", getBorrowType())
367
             .append("borrowType", getBorrowType())
332
             .append("applyReason", getApplyReason())
368
             .append("applyReason", getApplyReason())
333
             .append("applier", getApplier())
369
             .append("applier", getApplier())
370
+            .append("applyDept", getApplyDept())
334
             .append("applyDate", getApplyDate())
371
             .append("applyDate", getApplyDate())
335
             .append("applyAmount", getApplyAmount())
372
             .append("applyAmount", getApplyAmount())
336
             .append("managerAmount", getManagerAmount())
373
             .append("managerAmount", getManagerAmount())

+ 51
- 24
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcBorrowMapper.xml Ver arquivo

10
         <result property="borrowType"    column="borrow_type"    />
10
         <result property="borrowType"    column="borrow_type"    />
11
         <result property="applyReason"    column="apply_reason"    />
11
         <result property="applyReason"    column="apply_reason"    />
12
         <result property="applier"    column="applier"    />
12
         <result property="applier"    column="applier"    />
13
+        <result property="applyDept"    column="apply_dept"    />
13
         <result property="applyDate"    column="apply_date"    />
14
         <result property="applyDate"    column="apply_date"    />
14
         <result property="applyAmount"    column="apply_amount"    />
15
         <result property="applyAmount"    column="apply_amount"    />
15
         <result property="managerAmount"    column="manager_amount"    />
16
         <result property="managerAmount"    column="manager_amount"    />
28
         <result property="managerTime"    column="manager_time"    />
29
         <result property="managerTime"    column="manager_time"    />
29
         <result property="zjlTime"    column="zjl_time"    />
30
         <result property="zjlTime"    column="zjl_time"    />
30
         <result property="lendTime"    column="lend_time"    />
31
         <result property="lendTime"    column="lend_time"    />
32
+        <association property="applierUser"    javaType="SysUser"         resultMap="SysUserResult" />
33
+        <association property="dept"    javaType="SysDept"         resultMap="SysDeptResult" />
34
+        <association property="project"    javaType="CmcProject"         resultMap="CmcProjectResult" />
35
+    </resultMap>
36
+
37
+    <resultMap type="SysUser" id="SysUserResult">
38
+        <result property="userId"    column="user_id"    />
39
+        <result property="nickName"    column="nick_name"    />
40
+    </resultMap>
41
+
42
+    <resultMap type="SysDept" id="SysDeptResult">
43
+        <result property="deptId"    column="dept_id"    />
44
+        <result property="deptName"    column="dept_name"    />
45
+    </resultMap>
46
+
47
+    <resultMap type="CmcProject" id="CmcProjectResult">
48
+        <result property="projectId"    column="project_id"    />
49
+        <result property="projectNumber"    column="project_number"    />
50
+        <result property="projectName"    column="project_name"    />
31
     </resultMap>
51
     </resultMap>
32
 
52
 
33
     <sql id="selectCmcBorrowVo">
53
     <sql id="selectCmcBorrowVo">
34
-        select borrow_jd, project_id, borrow_type, apply_reason, applier, apply_date, apply_amount, manager_amount, dept_comment, dept_user_id, xm_user_id, xm_comment, manager_comment, manager_user_id, zjl_user_id, zjl_comment, cw_user_id, cw_comment, dept_time, xm_time, manager_time, zjl_time, lend_time from cmc_borrow
54
+        select b.borrow_jd, b.project_id, p.project_number, p.project_name, b.borrow_type, b.apply_reason, b.applier, u.nick_name, d.dept_name, b.apply_date, b.apply_amount, b.manager_amount, b.dept_comment, b.dept_user_id, b.xm_user_id, b.xm_comment, b.manager_comment, b.manager_user_id, b.zjl_user_id, b.zjl_comment, b.cw_user_id, b.cw_comment, b.dept_time, b.xm_time, b.manager_time, b.zjl_time, b.lend_time from cmc_borrow as b
55
+        left join sys_user as u on u.user_id = b.applier
56
+        left join sys_dept as d on d.dept_id = b.apply_dept
57
+        left join cmc_project as p on b.project_id = p.project_id
35
     </sql>
58
     </sql>
36
 
59
 
37
     <select id="selectCmcBorrowList" parameterType="CmcBorrow" resultMap="CmcBorrowResult">
60
     <select id="selectCmcBorrowList" parameterType="CmcBorrow" resultMap="CmcBorrowResult">
38
         <include refid="selectCmcBorrowVo"/>
61
         <include refid="selectCmcBorrowVo"/>
39
         <where>  
62
         <where>  
40
-            <if test="projectId != null  and projectId != ''"> and project_id = #{projectId}</if>
41
-            <if test="borrowType != null  and borrowType != ''"> and borrow_type = #{borrowType}</if>
42
-            <if test="applyReason != null  and applyReason != ''"> and apply_reason = #{applyReason}</if>
43
-            <if test="applier != null "> and applier = #{applier}</if>
44
-            <if test="applyDate != null "> and apply_date = #{applyDate}</if>
45
-            <if test="applyAmount != null "> and apply_amount = #{applyAmount}</if>
46
-            <if test="managerAmount != null "> and manager_amount = #{managerAmount}</if>
47
-            <if test="deptComment != null  and deptComment != ''"> and dept_comment = #{deptComment}</if>
48
-            <if test="deptUserId != null "> and dept_user_id = #{deptUserId}</if>
49
-            <if test="xmUserId != null "> and xm_user_id = #{xmUserId}</if>
50
-            <if test="xmComment != null  and xmComment != ''"> and xm_comment = #{xmComment}</if>
51
-            <if test="managerComment != null  and managerComment != ''"> and manager_comment = #{managerComment}</if>
52
-            <if test="managerUserId != null "> and manager_user_id = #{managerUserId}</if>
53
-            <if test="zjlUserId != null "> and zjl_user_id = #{zjlUserId}</if>
54
-            <if test="zjlComment != null  and zjlComment != ''"> and zjl_comment = #{zjlComment}</if>
55
-            <if test="cwUserId != null "> and cw_user_id = #{cwUserId}</if>
56
-            <if test="cwComment != null  and cwComment != ''"> and cw_comment = #{cwComment}</if>
57
-            <if test="deptTime != null "> and dept_time = #{deptTime}</if>
58
-            <if test="xmTime != null "> and xm_time = #{xmTime}</if>
59
-            <if test="managerTime != null "> and manager_time = #{managerTime}</if>
60
-            <if test="zjlTime != null "> and zjl_time = #{zjlTime}</if>
61
-            <if test="lendTime != null "> and lend_time = #{lendTime}</if>
63
+            <if test="projectId != null  and projectId != ''"> and b.project_id = #{projectId}</if>
64
+            <if test="borrowType != null  and borrowType != ''"> and b.borrow_type = #{borrowType}</if>
65
+            <if test="applyReason != null  and applyReason != ''"> and b.apply_reason = #{applyReason}</if>
66
+            <if test="applyDept != null  and applyDept != ''"> and b.apply_dept = #{applyDept}</if>
67
+            <if test="applier != null "> and b.applier = #{applier}</if>
68
+            <if test="applyDate != null "> and b.apply_date = #{applyDate}</if>
69
+            <if test="applyAmount != null "> and b.apply_amount = #{applyAmount}</if>
70
+            <if test="managerAmount != null "> and b.manager_amount = #{managerAmount}</if>
71
+            <if test="deptComment != null  and deptComment != ''"> and b.dept_comment = #{deptComment}</if>
72
+            <if test="deptUserId != null "> and b.dept_user_id = #{deptUserId}</if>
73
+            <if test="xmUserId != null "> and b.xm_user_id = #{xmUserId}</if>
74
+            <if test="xmComment != null  and xmComment != ''"> and b.xm_comment = #{xmComment}</if>
75
+            <if test="managerComment != null  and managerComment != ''"> and b.manager_comment = #{managerComment}</if>
76
+            <if test="managerUserId != null "> and b.manager_user_id = #{managerUserId}</if>
77
+            <if test="zjlUserId != null "> and b.zjl_user_id = #{zjlUserId}</if>
78
+            <if test="zjlComment != null  and zjlComment != ''"> and b.zjl_comment = #{zjlComment}</if>
79
+            <if test="cwUserId != null "> and b.cw_user_id = #{cwUserId}</if>
80
+            <if test="cwComment != null  and cwComment != ''"> and b.cw_comment = #{cwComment}</if>
81
+            <if test="deptTime != null "> and b.dept_time = #{deptTime}</if>
82
+            <if test="xmTime != null "> and b.xm_time = #{xmTime}</if>
83
+            <if test="managerTime != null "> and b.manager_time = #{managerTime}</if>
84
+            <if test="zjlTime != null "> and b.zjl_time = #{zjlTime}</if>
85
+            <if test="lendTime != null "> and b.lend_time = #{lendTime}</if>
62
         </where>
86
         </where>
63
     </select>
87
     </select>
64
     
88
     
65
     <select id="selectCmcBorrowByBorrowJd" parameterType="String" resultMap="CmcBorrowResult">
89
     <select id="selectCmcBorrowByBorrowJd" parameterType="String" resultMap="CmcBorrowResult">
66
         <include refid="selectCmcBorrowVo"/>
90
         <include refid="selectCmcBorrowVo"/>
67
-        where borrow_jd = #{borrowJd}
91
+        where b.borrow_jd = #{borrowJd}
68
     </select>
92
     </select>
69
         
93
         
70
     <insert id="insertCmcBorrow" parameterType="CmcBorrow">
94
     <insert id="insertCmcBorrow" parameterType="CmcBorrow">
75
             <if test="borrowType != null">borrow_type,</if>
99
             <if test="borrowType != null">borrow_type,</if>
76
             <if test="applyReason != null">apply_reason,</if>
100
             <if test="applyReason != null">apply_reason,</if>
77
             <if test="applier != null">applier,</if>
101
             <if test="applier != null">applier,</if>
102
+            <if test="applyDept != null">apply_dept,</if>
78
             <if test="applyDate != null">apply_date,</if>
103
             <if test="applyDate != null">apply_date,</if>
79
             <if test="applyAmount != null">apply_amount,</if>
104
             <if test="applyAmount != null">apply_amount,</if>
80
             <if test="managerAmount != null">manager_amount,</if>
105
             <if test="managerAmount != null">manager_amount,</if>
100
             <if test="borrowType != null">#{borrowType},</if>
125
             <if test="borrowType != null">#{borrowType},</if>
101
             <if test="applyReason != null">#{applyReason},</if>
126
             <if test="applyReason != null">#{applyReason},</if>
102
             <if test="applier != null">#{applier},</if>
127
             <if test="applier != null">#{applier},</if>
128
+            <if test="applyDept != null">#{applyDept},</if>
103
             <if test="applyDate != null">#{applyDate},</if>
129
             <if test="applyDate != null">#{applyDate},</if>
104
             <if test="applyAmount != null">#{applyAmount},</if>
130
             <if test="applyAmount != null">#{applyAmount},</if>
105
             <if test="managerAmount != null">#{managerAmount},</if>
131
             <if test="managerAmount != null">#{managerAmount},</if>
128
             <if test="borrowType != null">borrow_type = #{borrowType},</if>
154
             <if test="borrowType != null">borrow_type = #{borrowType},</if>
129
             <if test="applyReason != null">apply_reason = #{applyReason},</if>
155
             <if test="applyReason != null">apply_reason = #{applyReason},</if>
130
             <if test="applier != null">applier = #{applier},</if>
156
             <if test="applier != null">applier = #{applier},</if>
157
+            <if test="applyDept != null">apply_dept = #{applyDept},</if>
131
             <if test="applyDate != null">apply_date = #{applyDate},</if>
158
             <if test="applyDate != null">apply_date = #{applyDate},</if>
132
             <if test="applyAmount != null">apply_amount = #{applyAmount},</if>
159
             <if test="applyAmount != null">apply_amount = #{applyAmount},</if>
133
             <if test="managerAmount != null">manager_amount = #{managerAmount},</if>
160
             <if test="managerAmount != null">manager_amount = #{managerAmount},</if>

+ 3
- 2
oa-back/sql/sql.sql
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


+ 327
- 0
oa-ui/src/views/flowable/form/borrowForm.vue Ver arquivo

1
+<template>
2
+  <div class="app-container">
3
+    <el-form ref="form" :model="form" :rules="rules" label-width="80px">
4
+      <el-form-item label="项目编号:" prop="projectId" v-if="taskForm.procDefName == '借款审批'">
5
+                <el-select v-model="form.projectId" filterable placeholder="请选择" @change="handleSelectProject"
6
+                  :disabled="taskName != '借款申请'" clearable>
7
+                  <el-option v-for="item in projectList" :key="item.value" :label="item.projectNumber"
8
+                    :value="item.projectId">
9
+                  </el-option>
10
+                </el-select>
11
+                <el-descriptions border v-if="isSelect" style="margin-top: 10px;" :column="1">
12
+                  <el-descriptions-item label="项目编号" label-class-name="my-label">{{ chooseProject.projectNumber
13
+                  }}</el-descriptions-item>
14
+                  <el-descriptions-item label="项目名称" label-class-name="my-label">{{ chooseProject.projectName
15
+                  }}</el-descriptions-item>
16
+                  <el-descriptions-item label="项目负责人" label-class-name="my-label">{{ chooseProject.projectLeaderUser ? chooseProject.projectLeaderUser.nickName : ''
17
+                  }}</el-descriptions-item>
18
+                  <el-descriptions-item label="承担部门" label-class-name="my-label">
19
+                    <el-tag size="small">{{ chooseProject.undertakingDept }}</el-tag>
20
+                  </el-descriptions-item>
21
+                  <el-descriptions-item label="项目类型" label-class-name="my-label">{{ chooseProject.projectType
22
+                  }}</el-descriptions-item>
23
+                </el-descriptions>
24
+              </el-form-item>
25
+      <el-form-item label="借款事由" prop="applyReason">
26
+        <el-input v-model="form.applyReason" placeholder="请输入借款事由" />
27
+      </el-form-item>
28
+      <el-form-item label="申请人" prop="user.nickName">
29
+        {{ form.applierUser ? form.applierUser.nickName : form.user.nickName }}
30
+      </el-form-item>
31
+      <el-form-item label="申请部门" prop="dept.deptName">
32
+        {{ form.dept.deptName }}
33
+      </el-form-item>
34
+      <el-form-item label="申请时间:" prop="date">
35
+                    <el-date-picker style="width:140px;" v-model="form.applyDate" value-format="yyyy-MM-dd" type="date"
36
+                      placeholder="选择日期" :disabled="taskName != '借款申请'">
37
+                    </el-date-picker>
38
+                  </el-form-item>
39
+      <el-form-item label="申请金额" prop="applyAmount">
40
+        <el-input v-model="form.applyAmount" placeholder="请输入申请金额" />
41
+      </el-form-item>
42
+      <el-form-item label="核准金额" prop="managerAmount">
43
+        <el-input v-model="form.managerAmount" placeholder="请输入核准金额" />
44
+      </el-form-item>
45
+      <el-form-item label="部门意见" prop="deptComment">
46
+        <el-input v-model="form.deptComment" placeholder="请输入部门意见" />
47
+      </el-form-item>
48
+      <el-form-item label="部门审批人" prop="deptUserId">
49
+        <el-input v-model="form.deptUserId" placeholder="请输入部门审批人" />
50
+      </el-form-item>
51
+      <el-form-item label="项目部审批人" prop="xmUserId">
52
+        <el-input v-model="form.xmUserId" placeholder="请输入项目部审批人" />
53
+      </el-form-item>
54
+      <el-form-item label="项目部审批意见" prop="xmComment">
55
+        <el-input v-model="form.xmComment" placeholder="请输入项目部审批意见" />
56
+      </el-form-item>
57
+      <el-form-item label="分管审批意见" prop="managerComment">
58
+        <el-input v-model="form.managerComment" placeholder="请输入分管审批意见" />
59
+      </el-form-item>
60
+      <el-form-item label="分管审批人" prop="managerUserId">
61
+        <el-input v-model="form.managerUserId" placeholder="请输入分管审批人" />
62
+      </el-form-item>
63
+      <el-form-item label="总经理审批人" prop="zjlUserId">
64
+        <el-input v-model="form.zjlUserId" placeholder="请输入总经理审批人" />
65
+      </el-form-item>
66
+      <el-form-item label="总经理审批意见" prop="zjlComment">
67
+        <el-input v-model="form.zjlComment" placeholder="请输入总经理审批意见" />
68
+      </el-form-item>
69
+      <el-form-item label="财务部经办人" prop="cwUserId">
70
+        <el-input v-model="form.cwUserId" placeholder="请输入财务部经办人" />
71
+      </el-form-item>
72
+      <el-form-item label="财务部支付备注" prop="cwComment">
73
+        <el-input v-model="form.cwComment" placeholder="请输入财务部支付备注" />
74
+      </el-form-item>
75
+      <el-form-item label="部门审批时间" prop="deptTime">
76
+        <el-date-picker clearable v-model="form.deptTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择部门审批时间">
77
+        </el-date-picker>
78
+      </el-form-item>
79
+      <el-form-item label="项目部审批时间" prop="xmTime">
80
+        <el-date-picker clearable v-model="form.xmTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择项目部审批时间">
81
+        </el-date-picker>
82
+      </el-form-item>
83
+      <el-form-item label="分管审批时间" prop="managerTime">
84
+        <el-date-picker clearable v-model="form.managerTime" type="date" value-format="yyyy-MM-dd"
85
+          placeholder="请选择分管审批时间">
86
+        </el-date-picker>
87
+      </el-form-item>
88
+      <el-form-item label="总经理审批时间" prop="zjlTime">
89
+        <el-date-picker clearable v-model="form.zjlTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择总经理审批时间">
90
+        </el-date-picker>
91
+      </el-form-item>
92
+      <el-form-item label="借款支付时间" prop="lendTime">
93
+        <el-date-picker clearable v-model="form.lendTime" type="date" value-format="yyyy-MM-dd" placeholder="请选择借款支付时间">
94
+        </el-date-picker>
95
+      </el-form-item>
96
+    </el-form>
97
+    <div slot="footer" class="dialog-footer">
98
+      <el-button type="primary" @click="submitForm">确 定</el-button>
99
+      <el-button @click="cancel">取 消</el-button>
100
+    </div>
101
+  </div>
102
+</template>
103
+
104
+<script>
105
+import { listBorrow, getBorrow, delBorrow, addBorrow, updateBorrow } from "@/api/oa/borrow/borrow";
106
+import { listProject, getProject } from "@/api/oa/project/project";
107
+
108
+export default {
109
+  name: "Borrow",
110
+  props: {
111
+    taskName: {
112
+      type: String,
113
+      required: true
114
+    },
115
+    taskForm: {
116
+      type: Object,
117
+      required: true
118
+    }
119
+  },
120
+  data() {
121
+    return {
122
+      // 遮罩层
123
+      loading: true,
124
+      // 选中数组
125
+      ids: [],
126
+      // 非单个禁用
127
+      single: true,
128
+      // 非多个禁用
129
+      multiple: true,
130
+      // 显示搜索条件
131
+      showSearch: true,
132
+      // 总条数
133
+      total: 0,
134
+      // cmc借款申请表格数据
135
+      borrowList: [],
136
+      // 弹出层标题
137
+      title: "",
138
+      // 是否显示弹出层
139
+      open: false,
140
+      // 查询参数
141
+      queryParams: {
142
+        pageNum: 1,
143
+        pageSize: 10,
144
+        projectId: null,
145
+        borrowType: null,
146
+        applyReason: null,
147
+        applier: null,
148
+        applyDate: null,
149
+        applyAmount: null,
150
+        managerAmount: null,
151
+        deptComment: null,
152
+        deptUserId: null,
153
+        xmUserId: null,
154
+        xmComment: null,
155
+        managerComment: null,
156
+        managerUserId: null,
157
+        zjlUserId: null,
158
+        zjlComment: null,
159
+        cwUserId: null,
160
+        cwComment: null,
161
+        deptTime: null,
162
+        xmTime: null,
163
+        managerTime: null,
164
+        zjlTime: null,
165
+        lendTime: null
166
+      },
167
+      projectList: [],
168
+      chooseProject: {},
169
+      isSelect: false,
170
+      // 表单参数
171
+      form: {
172
+        user: {
173
+          nickName: '',
174
+        },
175
+        dept: {
176
+          deptName: '',
177
+        },
178
+        applyDate: undefined,
179
+      },
180
+      // 表单校验
181
+      rules: {
182
+      }
183
+    };
184
+  },
185
+  created() {
186
+    this.form.applyDate = new Date();
187
+    this.form.user.nickName = this.$store.getters.name;
188
+    this.form.dept.deptName = this.$store.getters.deptName;
189
+    this.getProjectList();
190
+    this.getList();
191
+  },
192
+  methods: {
193
+    /** 查询cmc借款申请列表 */
194
+    getList() {
195
+      this.loading = true;
196
+      listBorrow(this.queryParams).then(response => {
197
+        this.borrowList = response.rows;
198
+        this.total = response.total;
199
+        this.loading = false;
200
+      });
201
+    },
202
+    // 查询项目列表
203
+    getProjectList() {
204
+      this.loading = true
205
+      listProject({
206
+        pageNum: 1,
207
+        pageSize: 99999999
208
+      }).then(response => {
209
+        this.projectList = response.rows;
210
+      })
211
+    },
212
+    // 选择项目
213
+    handleSelectProject(val) {
214
+      if (val != "" && val != undefined && val != null) {
215
+        getProject(val).then(res => {
216
+          this.chooseProject = res.data;
217
+          this.isSelect = true
218
+        })
219
+      } else {
220
+        this.isSelect = false
221
+      }
222
+    },
223
+    // 取消按钮
224
+    cancel() {
225
+      this.open = false;
226
+      this.reset();
227
+    },
228
+    // 表单重置
229
+    reset() {
230
+      this.form = {
231
+        borrowJd: null,
232
+        projectId: null,
233
+        borrowType: null,
234
+        applyReason: null,
235
+        applier: null,
236
+        applyDate: null,
237
+        applyAmount: null,
238
+        managerAmount: null,
239
+        deptComment: null,
240
+        deptUserId: null,
241
+        xmUserId: null,
242
+        xmComment: null,
243
+        managerComment: null,
244
+        managerUserId: null,
245
+        zjlUserId: null,
246
+        zjlComment: null,
247
+        cwUserId: null,
248
+        cwComment: null,
249
+        deptTime: null,
250
+        xmTime: null,
251
+        managerTime: null,
252
+        zjlTime: null,
253
+        lendTime: null
254
+      };
255
+      this.resetForm("form");
256
+    },
257
+    /** 搜索按钮操作 */
258
+    handleQuery() {
259
+      this.queryParams.pageNum = 1;
260
+      this.getList();
261
+    },
262
+    /** 重置按钮操作 */
263
+    resetQuery() {
264
+      this.resetForm("queryForm");
265
+      this.handleQuery();
266
+    },
267
+    // 多选框选中数据
268
+    handleSelectionChange(selection) {
269
+      this.ids = selection.map(item => item.borrowJd)
270
+      this.single = selection.length !== 1
271
+      this.multiple = !selection.length
272
+    },
273
+    /** 新增按钮操作 */
274
+    handleAdd() {
275
+      this.reset();
276
+      this.open = true;
277
+      this.title = "添加cmc借款申请";
278
+    },
279
+    /** 修改按钮操作 */
280
+    handleUpdate(row) {
281
+      this.reset();
282
+      const borrowJd = row.borrowJd || this.ids
283
+      getBorrow(borrowJd).then(response => {
284
+        this.form = response.data;
285
+        this.open = true;
286
+        this.title = "修改cmc借款申请";
287
+      });
288
+    },
289
+    /** 提交按钮 */
290
+    submitForm() {
291
+      this.$refs["form"].validate(valid => {
292
+        if (valid) {
293
+          if (this.form.borrowJd != null) {
294
+            updateBorrow(this.form).then(response => {
295
+              this.$modal.msgSuccess("修改成功");
296
+              this.open = false;
297
+              this.getList();
298
+            });
299
+          } else {
300
+            addBorrow(this.form).then(response => {
301
+              this.$modal.msgSuccess("新增成功");
302
+              this.open = false;
303
+              this.getList();
304
+            });
305
+          }
306
+        }
307
+      });
308
+    },
309
+    /** 删除按钮操作 */
310
+    handleDelete(row) {
311
+      const borrowJds = row.borrowJd || this.ids;
312
+      this.$modal.confirm('是否确认删除cmc借款申请编号为"' + borrowJds + '"的数据项?').then(function () {
313
+        return delBorrow(borrowJds);
314
+      }).then(() => {
315
+        this.getList();
316
+        this.$modal.msgSuccess("删除成功");
317
+      }).catch(() => { });
318
+    },
319
+    /** 导出按钮操作 */
320
+    handleExport() {
321
+      this.download('oa/borrow/export', {
322
+        ...this.queryParams
323
+      }, `borrow_${new Date().getTime()}.xlsx`)
324
+    }
325
+  }
326
+};
327
+</script>

+ 4
- 1
oa-ui/src/views/flowable/task/todo/detail/index.vue Ver arquivo

31
           <project-process :taskName="taskName" :taskForm="taskForm" v-else-if="taskForm.procDefName == '项目流转'"
31
           <project-process :taskName="taskName" :taskForm="taskForm" v-else-if="taskForm.procDefName == '项目流转'"
32
             @goBack="goBack"></project-process>
32
             @goBack="goBack"></project-process>
33
           <add-budget :taskName="taskName" :taskForm="taskForm" v-else-if="taskForm.procDefName == '项目预算'" @goBack="goBack"></add-budget>
33
           <add-budget :taskName="taskName" :taskForm="taskForm" v-else-if="taskForm.procDefName == '项目预算'" @goBack="goBack"></add-budget>
34
+          <borrow-form :taskName="taskName" :taskForm="taskForm" v-else-if="taskForm.procDefName == '借款审批'" @goBack="goBack"></borrow-form>          
34
           <el-row type="flex" justify="center" v-show="isShowApprove()">
35
           <el-row type="flex" justify="center" v-show="isShowApprove()">
35
             <el-button v-if="!formKeyExist" icon="el-icon-edit-outline" type="success" size="mini"
36
             <el-button v-if="!formKeyExist" icon="el-icon-edit-outline" type="success" size="mini"
36
               @click="handleComplete">审核通过
37
               @click="handleComplete">审核通过
179
 import deviceForm from "@/views/flowable/form/deviceForm";
180
 import deviceForm from "@/views/flowable/form/deviceForm";
180
 import projectProcess from "@/views/flowable/form/projectProcess/index.vue"
181
 import projectProcess from "@/views/flowable/form/projectProcess/index.vue"
181
 import AddBudget from '@/views/oa/budget/addBudget.vue';
182
 import AddBudget from '@/views/oa/budget/addBudget.vue';
183
+import borrowForm from '@/views/flowable/form/borrowForm.vue';
182
 
184
 
183
 export default {
185
 export default {
184
   name: "Record",
186
   name: "Record",
196
     carForm,
198
     carForm,
197
     deviceForm,
199
     deviceForm,
198
     projectProcess,
200
     projectProcess,
199
-    AddBudget
201
+    AddBudget,
202
+    borrowForm
200
   },
203
   },
201
   props: {},
204
   props: {},
202
   data() {
205
   data() {

Carregando…
Cancelar
Salvar