Просмотр исходного кода

上传维修检定附件前选择费用类型

lamphua 2 недель назад
Родитель
Сommit
fcb72a24a4

+ 3
- 2
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java Просмотреть файл

308
         user.setCreateBy(getUsername());
308
         user.setCreateBy(getUsername());
309
         if (user.getPoliticalAffiliation() == null || user.getPoliticalAffiliation().equals(""))
309
         if (user.getPoliticalAffiliation() == null || user.getPoliticalAffiliation().equals(""))
310
             user.setPoliticalAffiliation("13");
310
             user.setPoliticalAffiliation("13");
311
-        String pinyin = Pinyin4jUtil.getPinyin(user.getNickName());
312
-        user.setPinyin(pinyin.contains(",") ? pinyin.split(",")[0] : pinyin);
311
+//        String pinyin = Pinyin4jUtil.getPinyin(user.getNickName());
312
+//        user.setPinyin(pinyin.contains(",") ? pinyin.split(",")[0] : pinyin);
313
+        user.setPinyin(user.getUserName());
313
         Long[] roleIds = new Long[1];
314
         Long[] roleIds = new Long[1];
314
         roleIds[0] = 2L;
315
         roleIds[0] = 2L;
315
         user.setRoleIds(roleIds);
316
         user.setRoleIds(roleIds);

+ 19
- 3
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcProjectWorkload.java Просмотреть файл

20
     /** 工作量id */
20
     /** 工作量id */
21
     private Long workloadId;
21
     private Long workloadId;
22
 
22
 
23
-    /** 项目id */
24
-    @Excel(name = "项目id")
23
+    /** 项目id */    
25
     private String projectId;
24
     private String projectId;
25
+    @Excel(name = "项目编号")
26
+    private String projectNumber;
27
+    @Excel(name = "项目名称")
28
+    private String projectName;
29
+
30
+    /** 项目信息 */
31
+    private CmcProject project;
26
 
32
 
27
     /** 工作内容 */
33
     /** 工作内容 */
28
     @Excel(name = "工作内容")
34
     @Excel(name = "工作内容")
29
     private String content;
35
     private String content;
30
-
31
     /** 等级或比例尺 */
36
     /** 等级或比例尺 */
32
     @Excel(name = "等级或比例尺")
37
     @Excel(name = "等级或比例尺")
33
     private String scale;
38
     private String scale;
108
     {
113
     {
109
         return finishTime;
114
         return finishTime;
110
     }
115
     }
116
+    public void setProject(CmcProject project)
117
+    {
118
+        this.project = project;
119
+        this.projectNumber = project == null ? "" : project.getProjectNumber();
120
+        this.projectName = project == null ? "" : project.getProjectName();
121
+    }
122
+
123
+    public CmcProject getProject()
124
+    {
125
+        return project;
126
+    }
111
 
127
 
112
     @Override
128
     @Override
113
     public String toString() {
129
     public String toString() {

+ 13
- 5
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcProjectWorkloadMapper.xml Просмотреть файл

13
         <result property="workload"    column="workload"    />
13
         <result property="workload"    column="workload"    />
14
         <result property="finishTime"    column="finish_time"    />
14
         <result property="finishTime"    column="finish_time"    />
15
         <result property="remark"    column="remark"    />
15
         <result property="remark"    column="remark"    />
16
+        <association property="project"    javaType="CmcProject"         resultMap="CmcProjectResult" />
17
+    </resultMap>
18
+
19
+    <resultMap type="CmcProject" id="CmcProjectResult">
20
+        <result property="projectId"    column="project_id"    />
21
+        <result property="projectNumber"    column="project_number"    />
22
+        <result property="projectName"    column="project_name"    />
16
     </resultMap>
23
     </resultMap>
17
 
24
 
18
     <sql id="selectCmcProjectWorkloadVo">
25
     <sql id="selectCmcProjectWorkloadVo">
19
-        select workload_id, project_id, content, scale, unit, workload, finish_time, remark from cmc_project_workload
26
+        select pw.workload_id, pw.project_id, pw.content, pw.scale, pw.unit, pw.workload, pw.finish_time, pw.remark, p.project_number, p.project_name from cmc_project_workload as pw
27
+        left join cmc_project as p on pw.project_id = p.project_id
20
     </sql>
28
     </sql>
21
 
29
 
22
     <select id="selectCmcProjectWorkloadList" parameterType="CmcProjectWorkload" resultMap="CmcProjectWorkloadResult">
30
     <select id="selectCmcProjectWorkloadList" parameterType="CmcProjectWorkload" resultMap="CmcProjectWorkloadResult">
23
         <include refid="selectCmcProjectWorkloadVo"/>
31
         <include refid="selectCmcProjectWorkloadVo"/>
24
         <where>  
32
         <where>  
25
-            <if test="projectId != null  and projectId != ''"> and project_id = #{projectId}</if>
26
-            <if test="content != null  and content != ''"> and content like concat('%', #{content}, '%')</if>
27
-            <if test="scale != null  and scale != ''"> and scale like concat('%', #{scale}, '%')</if>
28
-            <if test="unit != null  and unit != ''"> and unit like concat('%', #{unit}, '%')</if>
33
+            <if test="projectId != null  and projectId != ''"> and pw.project_id = #{projectId}</if>
34
+            <if test="content != null  and content != ''"> and pw.content like concat('%', #{content}, '%')</if>
35
+            <if test="scale != null  and scale != ''"> and pw.scale like concat('%', #{scale}, '%')</if>
36
+            <if test="unit != null  and unit != ''"> and pw.unit like concat('%', #{unit}, '%')</if>
29
             <if test="workload != null  and workload != ''"> and workload = #{workload}</if>
37
             <if test="workload != null  and workload != ''"> and workload = #{workload}</if>
30
             <if test="finishTime != null "> and finish_time like concat('%', #{finishTime}, '%')</if>
38
             <if test="finishTime != null "> and finish_time like concat('%', #{finishTime}, '%')</if>
31
         </where>
39
         </where>

+ 8
- 1
oa-ui/src/views/oa/device/expense.vue Просмотреть файл

202
       form: {},
202
       form: {},
203
       // 表单校验
203
       // 表单校验
204
       rules: {
204
       rules: {
205
+        expenseType: [
206
+          { required: true, message: '请选择费用类型', trigger: 'change' }
207
+        ]
205
       },
208
       },
206
       deviceList: [],
209
       deviceList: [],
207
       alldeviceList: [],
210
       alldeviceList: [],
293
         this.form = response.data;
296
         this.form = response.data;
294
         this.open = true;
297
         this.open = true;
295
         this.title = "修改设备维保记录";
298
         this.title = "修改设备维保记录";
296
-        expenseTypePath(this.form.expenseType);
299
+        this.expenseTypePath(this.form.expenseType);
297
       });
300
       });
298
     },
301
     },
299
     /** 提交按钮 */
302
     /** 提交按钮 */
371
     },
374
     },
372
     //费用附件路径
375
     //费用附件路径
373
     getExpensePath(val) {
376
     getExpensePath(val) {
377
+      if (!this.form.expenseType) {
378
+        this.$modal.msgError("请先选择费用类型");
379
+        return;
380
+      }
374
       let arr = val.split('/upload')
381
       let arr = val.split('/upload')
375
       this.form.document = arr[1]
382
       this.form.document = arr[1]
376
       if (val == "") {
383
       if (val == "") {

Загрузка…
Отмена
Сохранить