Преглед на файлове

年度预算修改审批流程 (费用申请页面年度预算 费用管理页面年度预算 待审批页面)

梁世豪 преди 9 месеца
родител
ревизия
76527bb0d2
променени са 20 файла, в които са добавени 1562 реда и са изтрити 51 реда
  1. 83 7
      src/main/java/com/liang/controller/PrjAnnualBudgetRecordController.java
  2. 9 1
      src/main/java/com/liang/controller/PrjAnnualbudgetController.java
  3. 93 0
      src/main/java/com/liang/controller/PrjApproverecordController.java
  4. 2 0
      src/main/java/com/liang/dao/PrjAnnualBudgetRecordDao.java
  5. 3 0
      src/main/java/com/liang/dao/PrjAnnualbudgetdetailDao.java
  6. 1 0
      src/main/java/com/liang/service/PrjAnnualBudgetRecordService.java
  7. 3 0
      src/main/java/com/liang/service/PrjAnnualbudgetdetailService.java
  8. 5 0
      src/main/java/com/liang/service/impl/PrjAnnualBudgetRecordServiceImpl.java
  9. 9 4
      src/main/java/com/liang/service/impl/PrjAnnualbudgetdetailServiceImpl.java
  10. 7 4
      src/main/resources/mapper/PrjAnnualBudgetRecordDao.xml
  11. 9 0
      src/main/resources/mapper/PrjAnnualbudgetdetailDao.xml
  12. 5 0
      src/main/resources/mapper/PrjApproverecordDao.xml
  13. 321 0
      src/main/resources/templates/annualbudget/finish_xg_approve.html
  14. 17 0
      src/main/resources/templates/annualbudget/list.html
  15. 32 0
      src/main/resources/templates/annualbudget/mylist.html
  16. 24 35
      src/main/resources/templates/annualbudget/updateApply_annualbudget.html
  17. 662 0
      src/main/resources/templates/annualbudget/view_xgsq.html
  18. 99 0
      src/main/resources/templates/annualbudget/xglist_approve.html
  19. 145 0
      src/main/resources/templates/annualbudget/xgview_record.html
  20. 33 0
      src/main/resources/templates/prjapproverecord/list.html

+ 83 - 7
src/main/java/com/liang/controller/PrjAnnualBudgetRecordController.java

@@ -1,8 +1,10 @@
1 1
 package com.liang.controller;
2
+//import java.util.Date;
2 3
 import com.google.common.collect.Lists;
3 4
 
4 5
 import com.github.pagehelper.PageHelper;
5 6
 import com.github.pagehelper.PageInfo;
7
+import com.liang.common.JsonTool;
6 8
 import com.liang.common.base.BaseController;
7 9
 import com.liang.common.base.BaseResult;
8 10
 import com.liang.common.enums.PostInfoEnum;
@@ -41,12 +43,10 @@ public class PrjAnnualBudgetRecordController extends BaseController {
41 43
 
42 44
     @Resource
43 45
     private PrjAnnualbudgetService prjAnnualbudgetService;
44
-
45
-    @Resource
46
-    private SysPostInfoService sysPostInfoService;
47 46
     @Resource
48 47
     private PrjApproverecordService prjApproverecordService;
49 48
 
49
+
50 50
     /**
51 51
      * 在年度预算修改记录表中添加修改前的数据(年度预算明细)
52 52
      *
@@ -112,18 +112,94 @@ public class PrjAnnualBudgetRecordController extends BaseController {
112 112
     }
113 113
     @ResponseBody
114 114
     @RequestMapping(value = "/addUpdateApplyRecord", method = RequestMethod.POST)
115
-    @Transactional
116 115
     public BaseResult addUpdateApplyRecord(
117
-                             @RequestParam("budgets") List<PrjAnnualBudgetRecord> record) {
118
-//插入到修改申请表中
116
+            @RequestBody String data) {
117
+        List<PrjAnnualBudgetRecord> record =new ArrayList<>();
118
+        List<PrjAnnualbudgetdetail> budgetDetails = JsonTool.parseArray(data, PrjAnnualbudgetdetail.class);
119
+        for (int i = 0; i <budgetDetails.size() ; i++) {
120
+            PrjAnnualBudgetRecord prjAnnualBudgetRecord =new PrjAnnualBudgetRecord();
121
+            prjAnnualBudgetRecord.setFymc(budgetDetails.get(i).getFymc());
122
+            prjAnnualBudgetRecord.setYsje(budgetDetails.get(i).getYsje());
123
+            prjAnnualBudgetRecord.setNys(budgetDetails.get(i).getNys());
124
+            prjAnnualBudgetRecord.setBm(budgetDetails.get(i).getBm());
125
+            prjAnnualBudgetRecord.setFj(budgetDetails.get(i).getFj());
126
+            prjAnnualBudgetRecord.setNf(budgetDetails.get(i).getNf());
127
+            prjAnnualBudgetRecord.setXmz(budgetDetails.get(i).getXmz());
128
+            prjAnnualBudgetRecord.setByj(budgetDetails.get(i).getByj());
129
+            prjAnnualBudgetRecord.setXmzys(budgetDetails.get(i).getXmzys());
130
+            prjAnnualBudgetRecord.setBjsj(new Date(System.currentTimeMillis()));
131
+            prjAnnualBudgetRecord.setXgr(getSysUserId());
132
+            record.add(prjAnnualBudgetRecord);
133
+        }
134
+//先删除表中的预留数据(只能保存一份)
135
+        prjAnnualBudgetRecordService.deleteHistoryRecord(budgetDetails.get(0).getNys());
136
+//插入到修改申请表中(临时保存表)
119 137
         int i = prjAnnualBudgetRecordService.addHistoryRecord(record);
120
-
121 138
         if (i>0){
122 139
             return BaseResult.success();
123 140
         }else {
124 141
             return BaseResult.failure("");
125 142
         }
126 143
     }
144
+    /**
145
+     * 审批列表
146
+     *
147
+     * @return
148
+     */
149
+    @RequestMapping(value = "/forApproveList", method = RequestMethod.GET)
150
+    public String forApproveList() {
151
+        return "annualbudget/xglist_approve";
152
+    }
153
+    /**
154
+     * 查看数据
155
+     *
156
+     * @return
157
+     */
158
+    @RequestMapping(value = "/forView/{id}", method = RequestMethod.GET)
159
+    public String forView(Model model, @PathVariable Integer id) {
160
+        List<PrjAnnualbudgetdetail> budgetList = prjAnnualbudgetdetailService.getBudgetList(id);
161
+        List<PrjAnnualBudgetRecord> record = prjAnnualBudgetRecordService.queryRecordByNdysid(id);
162
+        model.addAttribute("prjAnnualbudget",budgetList);
163
+        model.addAttribute("prjAnnualbudgetRecord",record);
164
+        return "annualbudget/xgview_record";
165
+    }
166
+
167
+    /**
168
+     * 将中间表中的数据同步到年度预算列表中
169
+     * */
170
+    @ResponseBody
171
+    @RequestMapping(value = "/doUpdate/{xmid}", method = RequestMethod.POST)
172
+    public BaseResult bathUpdate( @PathVariable Integer xmid) {
173
+//  1.获取年度预算中间表情数据
174
+        List<PrjAnnualBudgetRecord> record = prjAnnualBudgetRecordService.queryRecordByNdysid(xmid);
175
+//  2.修改年度预算明细表的内容
176
+        int  i =prjAnnualbudgetdetailService.updateXg(record);
177
+        if (i>0){
178
+// 3.保存成功后删除中间表中的数据
179
+            prjAnnualBudgetRecordService.deleteHistoryRecord(xmid);
180
+            return BaseResult.success();
181
+        }else {
182
+            return BaseResult.failure("记录保存失败");
183
+        }
184
+
185
+
186
+    }
127 187
 
188
+    @RequestMapping(value = "/forApproveUpdate/{xmid}", method = RequestMethod.GET)
189
+    public String forApproveUpdate(Model model, @PathVariable Integer xmid, @RequestParam String spzt) {
190
+        //系统当前用户
191
+        SysUserInfo userInfo = getSysUserInfo();
192
+        model.addAttribute("userInfo", userInfo);
193
+
194
+        Map<String, String> paraMap1 = new HashMap<>();
195
+        paraMap1.put("xmid", xmid.toString());
196
+        paraMap1.put("zt", spzt);
197
+        paraMap1.put("wc", "0");
198
+        List<PrjApproverecord> approveList = prjApproverecordService.getApproveByXmId(paraMap1);
199
+        if (approveList.size() > 0) {
200
+            model.addAttribute("approveInfo", approveList.get(0));
201
+        }
202
+        return "annualbudget/finish_xg_approve";
203
+    }
128 204
 
129 205
 }

+ 9 - 1
src/main/java/com/liang/controller/PrjAnnualbudgetController.java

@@ -73,7 +73,8 @@ public class PrjAnnualbudgetController extends BaseController {
73 73
 
74 74
     @Resource
75 75
     private SysUserInfoService sysUserInfoService;
76
-
76
+    @Resource
77
+    private  PrjAnnualBudgetRecordService prjAnnualBudgetRecordService;
77 78
     @Resource
78 79
     private PrjCompletecompanyService prjCompletecompanyService;
79 80
 
@@ -203,6 +204,13 @@ public class PrjAnnualbudgetController extends BaseController {
203 204
 
204 205
         return "annualbudget/mylist";
205 206
     }
207
+        @RequestMapping(value = "/ViewXGSQ", method = RequestMethod.GET)
208
+        public String ViewXGSQ(Model model) {
209
+//            获取待审批修改申请列表
210
+//            prjAnnualBudgetRecordService.getSpList();
211
+
212
+            return "annualbudget/view_xgsq";
213
+        }
206 214
 
207 215
     @ResponseBody
208 216
     @RequestMapping(value = "/mylist", method = RequestMethod.POST)

+ 93 - 0
src/main/java/com/liang/controller/PrjApproverecordController.java

@@ -12,6 +12,7 @@ import com.liang.entity.*;
12 12
 import com.liang.service.PrjApproverecordService;
13 13
 import com.liang.service.StaBudgetapprovalService;
14 14
 import com.liang.service.SysDictInfoService;
15
+import com.liang.service.SysUserPostService;
15 16
 import io.swagger.annotations.ApiOperation;
16 17
 import org.springframework.data.domain.Page;
17 18
 import org.springframework.data.domain.PageRequest;
@@ -24,6 +25,7 @@ import org.springframework.web.bind.annotation.*;
24 25
 
25 26
 import javax.annotation.Resource;
26 27
 import java.text.DateFormat;
28
+import java.time.LocalDateTime;
27 29
 import java.time.format.DateTimeFormatter;
28 30
 import java.util.*;
29 31
 
@@ -46,6 +48,8 @@ public class PrjApproverecordController extends BaseController {
46 48
 
47 49
     @Resource
48 50
     private StaBudgetapprovalService staBudgetapprovalService;
51
+    @Resource
52
+    private SysUserPostService sysUserPostService;
49 53
 
50 54
     /**
51 55
      * 分页查询
@@ -132,6 +136,39 @@ public class PrjApproverecordController extends BaseController {
132 136
 
133 137
         return BaseResult.success(result);
134 138
     }
139
+    /**
140
+     * 年度预算修改申请列表
141
+     * */
142
+    @ResponseBody
143
+    @RequestMapping(value = "/xgsqList", method = RequestMethod.POST)
144
+    public BaseResult xgsqList(@RequestParam("page") Integer pageNum,
145
+                           @RequestParam("limit") Integer pageSize
146
+                            ) {
147
+        PageHelper.startPage(pageNum, pageSize);
148
+
149
+        Map<String, String> paraMap = new HashMap<>();
150
+        SysUserInfo userInfo = getSysUserInfo();
151
+        if (!userInfo.getAccount().equals("admin")) {
152
+            paraMap.put("userId", userInfo.getUserId().toString());
153
+        }
154
+            paraMap.put("tablename","prj_AnnualBudgetRecord");
155
+// 获取待审批的年度预算修改申请
156
+        List<PrjApproverecord> xglist = prjApproverecordService.getApproveList(paraMap);
157
+
158
+        for (int i = 0; i < xglist.size(); i++) {
159
+            xglist.get(i).setSpzt(xglist.get(i).getZt());
160
+        }
161
+
162
+        PageInfo<PrjApproverecord> pageinfo = new PageInfo<>(xglist);
163
+        //取出查询结果
164
+        List<PrjApproverecord> rows = pageinfo.getList();
165
+        int total = (int) pageinfo.getTotal();
166
+        Map<String, Object> result = new HashMap<>();
167
+        result.put(RESULT_ROWS, rows);
168
+        result.put(RESULT_TOTAL, total);
169
+
170
+        return BaseResult.success(result);
171
+    }
135 172
 
136 173
     /**
137 174
      * 保存数据(提交审批:可研报告,任务书,年度预算,报账)
@@ -184,6 +221,62 @@ public class PrjApproverecordController extends BaseController {
184 221
             return BaseResult.failure("保存失败!");
185 222
         }
186 223
     }
224
+    /**
225
+     * 保存年度预算修改申请
226
+    * */
227
+    @ResponseBody
228
+    @RequestMapping(value = "/doUpdatApprove", method = RequestMethod.POST)
229
+    public BaseResult doUpdatApprove(PrjApproverecord approverecord) {
230
+//        获取审批列表信息
231
+        SysUserInfo sysUserInfo = getSysUserInfo();
232
+        List<PrjApproverecord> recordList = new ArrayList<>();//提交人
233
+
234
+        LocalDateTime currentTime = LocalDateTime.now();
235
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");//提交时间
236
+
237
+        Map<String, String> paraMap2 = new HashMap<>();//提交人
238
+        paraMap2.put("postName", "科技项目管理专责");
239
+        paraMap2.put("postId","39");
240
+        List<SysUserPost> userPostList = sysUserPostService.getPostUserList(paraMap2);
241
+        Integer shr = userPostList.get(0).getUserId();
242
+
243
+        PrjApproverecord record1 = new PrjApproverecord();
244
+        record1.setXm(approverecord.getXm());
245
+        record1.setXmid(approverecord.getXmid());
246
+        record1.setZt(approverecord.getZt());
247
+        record1.setTablename("prj_AnnualBudgetRecord");
248
+        record1.setSpcz("预算申请修改");
249
+        record1.setTjr(sysUserInfo.getUserId());
250
+        record1.setTjsj(currentTime.format(formatter));
251
+        record1.setShr(record1.getTjr());
252
+        record1.setShsj(record1.getTjsj());
253
+        record1.setSfsjsh(true);//是否需要上级审核
254
+        record1.setSjshr(shr);
255
+        record1.setSjshgw(39);//上级审核岗位
256
+        record1.setSffh(false);//是否返回
257
+        record1.setYcshr(false);//隐藏审核人
258
+        record1.setWc(true);//完成
259
+        recordList.add(record1);
260
+
261
+        PrjApproverecord record2 = new PrjApproverecord();
262
+        record2.setXm(approverecord.getXm());
263
+        record2.setXmid(approverecord.getXmid());
264
+        record2.setTablename("prj_AnnualBudgetRecord");
265
+        record2.setTjr(sysUserInfo.getUserId());
266
+        record2.setTjsj(currentTime.format(formatter));
267
+        record2.setZt(PostInfoEnum.KJXMGLZZ.postName() + "审批");//状态
268
+        record2.setWc(false);//完成
269
+        record2.setShr(shr);//审核人
270
+        record2.setShgw(39);//审核岗位
271
+        recordList.add(record2);
272
+
273
+        int num = prjApproverecordService.insertBatch(recordList);
274
+        if (num > 0) {
275
+            return BaseResult.success("保存成功!", approverecord);
276
+        } else {
277
+            return BaseResult.failure("保存失败!");
278
+        }
279
+    }
187 280
 
188 281
     /**
189 282
      * 保存数据(提交审批:费用申请)

+ 2 - 0
src/main/java/com/liang/dao/PrjAnnualBudgetRecordDao.java

@@ -33,4 +33,6 @@ public interface PrjAnnualBudgetRecordDao {
33 33
      * @return
34 34
      */
35 35
     List<PrjAnnualBudgetRecord> queryRecordByNdysid(int nys);
36
+
37
+    void deleteHistoryRecord(Integer nys);
36 38
 }

+ 3 - 0
src/main/java/com/liang/dao/PrjAnnualbudgetdetailDao.java

@@ -1,5 +1,6 @@
1 1
 package com.liang.dao;
2 2
 
3
+import com.liang.entity.PrjAnnualBudgetRecord;
3 4
 import com.liang.entity.PrjAnnualbudgetdetail;
4 5
 import com.liang.entity.PrjBudget;
5 6
 import com.liang.vo.PrjAnnualbudgetYzxqkVo;
@@ -140,5 +141,7 @@ public interface PrjAnnualbudgetdetailDao {
140 141
     Double getXMZYS(String id);
141 142
 
142 143
     void updateSPTGZT(@Param("nys") Integer id, @Param("fymc") String fymc, @Param("sptgzt") String xgjlxz);
144
+
145
+    int updateXG(@Param("record") PrjAnnualBudgetRecord budget);
143 146
 }
144 147
 

+ 1 - 0
src/main/java/com/liang/service/PrjAnnualBudgetRecordService.java

@@ -32,4 +32,5 @@ public interface PrjAnnualBudgetRecordService {
32 32
     List<PrjAnnualBudgetRecord> queryRecordByNdysid(int nys);
33 33
 
34 34
 
35
+    void deleteHistoryRecord(Integer nys);
35 36
 }

+ 3 - 0
src/main/java/com/liang/service/PrjAnnualbudgetdetailService.java

@@ -1,5 +1,6 @@
1 1
 package com.liang.service;
2 2
 
3
+import com.liang.entity.PrjAnnualBudgetRecord;
3 4
 import com.liang.entity.PrjAnnualbudgetdetail;
4 5
 import org.apache.ibatis.annotations.Param;
5 6
 import org.springframework.data.domain.Page;
@@ -95,4 +96,6 @@ public interface PrjAnnualbudgetdetailService {
95 96
     List<PrjAnnualbudgetdetail> getXGJL(int xmid);
96 97
 
97 98
     Double getXMZYS(String id);
99
+
100
+    int updateXg(List<PrjAnnualBudgetRecord> record);
98 101
 }

+ 5 - 0
src/main/java/com/liang/service/impl/PrjAnnualBudgetRecordServiceImpl.java

@@ -39,4 +39,9 @@ public class PrjAnnualBudgetRecordServiceImpl implements PrjAnnualBudgetRecordSe
39 39
     public List<PrjAnnualBudgetRecord> queryRecordByNdysid(int nys) {
40 40
         return prjAnnualBudgetRecordDao.queryRecordByNdysid(nys);
41 41
     }
42
+
43
+    @Override
44
+    public void deleteHistoryRecord(Integer nys) {
45
+        prjAnnualBudgetRecordDao.deleteHistoryRecord(nys);
46
+    }
42 47
 }

+ 9 - 4
src/main/java/com/liang/service/impl/PrjAnnualbudgetdetailServiceImpl.java

@@ -3,11 +3,8 @@ package com.liang.service.impl;
3 3
 import com.liang.dao.PrjAnnualbudgetXgjlDao;
4 4
 import com.liang.dao.PrjBudgetDao;
5 5
 import com.liang.dao.PrjCompletecompanyDao;
6
-import com.liang.entity.PrjAnnualbudgetXgjl;
7
-import com.liang.entity.PrjAnnualbudgetdetail;
6
+import com.liang.entity.*;
8 7
 import com.liang.dao.PrjAnnualbudgetdetailDao;
9
-import com.liang.entity.PrjBudget;
10
-import com.liang.entity.PrjCompletecompany;
11 8
 import com.liang.service.PrjAnnualbudgetXgjlService;
12 9
 import com.liang.service.PrjAnnualbudgetdetailService;
13 10
 import org.springframework.stereotype.Service;
@@ -307,4 +304,12 @@ public class PrjAnnualbudgetdetailServiceImpl implements PrjAnnualbudgetdetailSe
307 304
         return xmzys;
308 305
     }
309 306
 
307
+    @Override
308
+    public int updateXg(List<PrjAnnualBudgetRecord> record) {
309
+        int count = 0;
310
+        for (PrjAnnualBudgetRecord budget : record) {
311
+            count += this.prjAnnualbudgetdetailDao.updateXG(budget);
312
+        }
313
+        return count;    }
314
+
310 315
 }

+ 7 - 4
src/main/resources/mapper/PrjAnnualBudgetRecordDao.xml

@@ -5,7 +5,7 @@
5 5
     <resultMap type="com.liang.entity.PrjAnnualBudgetRecord" id="PrjAnnualBudgetRecordMap">
6 6
         <result property="id" column="ID" jdbcType="INTEGER"/>
7 7
         <result property="fymc" column="FYMC" jdbcType="VARCHAR"/>
8
-        <result property="ysje" column="YSJE" jdbcType="NUMERIC"/>
8
+        <result property="ysje" column="YSJE" jdbcType="DECIMAL"/>
9 9
         <result property="nys" column="NYS" jdbcType="INTEGER"/>
10 10
         <result property="bm" column="BM" jdbcType="VARCHAR"/>
11 11
         <result property="fj" column="FJ" jdbcType="VARCHAR"/>
@@ -13,12 +13,15 @@
13 13
         <result property="px" column="PX" jdbcType="VARCHAR"/>
14 14
         <result property="hjbm" column="HJBM" jdbcType="VARCHAR"/>
15 15
         <result property="bz" column="BZ" jdbcType="VARCHAR"/>
16
-        <result property="xmz" column="XMZ" jdbcType="NUMERIC"/>
17
-        <result property="byj" column="BYJ" jdbcType="NUMERIC"/>
18
-        <result property="xmzys" column="XMZYS" jdbcType="NUMERIC"/>
16
+        <result property="xmz" column="XMZ" jdbcType="DECIMAL"/>
17
+        <result property="byj" column="BYJ" jdbcType="DECIMAL"/>
18
+        <result property="xmzys" column="XMZYS" jdbcType="DECIMAL"/>
19 19
         <result property="bjsj" column="BJSJ" jdbcType="TIMESTAMP"/>
20 20
         <result property="xgr" column="XGR" jdbcType="INTEGER"/>
21 21
     </resultMap>
22
+    <delete id="deleteHistoryRecord">
23
+        DELETE FROM prj_AnnualBudgetRecord WHERE nys = #{nys}
24
+    </delete>
22 25
 
23 26
     <!--查询单个-->
24 27
     <select id="queryDetailByNys" resultType="com.liang.entity.PrjAnnualBudgetRecord">

+ 9 - 0
src/main/resources/mapper/PrjAnnualbudgetdetailDao.xml

@@ -504,6 +504,15 @@
504 504
         where NYS = #{nys}
505 505
           AND FYMC = #{fymc}
506 506
     </update>
507
+    <update id="updateXG">
508
+            update prj_AnnualBudgetDetail
509
+            set XMZYS   = #{record.xmzys},
510
+                YSJE    = #{record.ysje},
511
+                XMZ     = #{record.xmz},
512
+                BYJ     = #{record.byj}
513
+            where NYS = #{record.nys}
514
+            and FYMC = #{record.fymc}
515
+    </update>
507 516
 
508 517
     <!--通过主键删除-->
509 518
     <delete id="deleteById">

+ 5 - 0
src/main/resources/mapper/PrjApproverecordDao.xml

@@ -451,6 +451,8 @@
451 451
         '报账'
452 452
         WHEN TABLENAME = 'sta_PayApproval' THEN
453 453
         '付款申请'
454
+        WHEN TABLENAME = 'prj_AnnualBudgetRecord' THEN
455
+        '年度预算修改申请'
454 456
         END AS XMLXMC,
455 457
         CASE
456 458
 
@@ -571,6 +573,9 @@
571 573
         <if test="tableName != null and tableName != ''">
572 574
             and a.TABLENAME = #{tableName}
573 575
         </if>
576
+        <if test=" tableName == 'prj_AnnualBudget'">
577
+            or a.TABLENAME = 'prj_AnnualBudgetRecord'
578
+        </if>
574 579
         <choose>
575 580
             <when test="sortName != null and sortName != '' and sortOrder != null and sortOrder != ''">
576 581
                 order by ${sortName} ${sortOrder} DESC

+ 321 - 0
src/main/resources/templates/annualbudget/finish_xg_approve.html

@@ -0,0 +1,321 @@
1
+<!DOCTYPE html>
2
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
3
+<head>
4
+    <meta charset="UTF-8">
5
+    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
6
+    <title>编辑</title>
7
+    <link rel="stylesheet" th:href="@{/lib/layui/css/layui.css}" media="all">
8
+    <link rel="stylesheet" th:href="@{/css/public.css}" media="all">
9
+    <link rel="stylesheet" th:href="@{/lib/font-awesome-4.7.0/css/font-awesome.min.css}" media="all">
10
+    <style>
11
+        body {
12
+            background-color: #ffffff;
13
+        }
14
+    </style>
15
+</head>
16
+<body>
17
+<form class="layui-form" action="" lay-filter="formDemo">
18
+    <div class="layui-form layuimini-form" style="padding-bottom: 100px">
19
+        <div class="layui-form-item layui-inline" style="width: 100%">
20
+            <label class="layui-form-label" style="width: 70px">年度预算</label>
21
+            <div class="layui-input-inline" style="width: 865px">
22
+                <input type="hidden" id="id" name="id" class="layui-input" th:value="${approveInfo.id}">
23
+                <input type="hidden" id="xmid" name="xmid" class="layui-input" th:value="${approveInfo.xmid}">
24
+                <input type="hidden" id="tablename" name="tablename" class="layui-input"
25
+                       th:value="${approveInfo.tablename}">
26
+                <input type="text" id="xm" name="xm" class="layui-input" readonly th:value="${approveInfo.xm}">
27
+            </div>
28
+        </div>
29
+        <div class="layui-form-item layui-inline" style="width: 100%">
30
+            <label class="layui-form-label" style="width: 70px">状态</label>
31
+            <div class="layui-input-inline" style="width: 600px">
32
+                <input type="hidden" id="spzt" name="spzt" class="layui-input" th:value="${approveInfo.zt}">
33
+                <input type="text" id="zt" name="zt" class="layui-input" readonly th:value="${approveInfo.zt}">
34
+            </div>
35
+            <div class="layui-input-inline" style="width: 255px">
36
+                <input type="text" value="年度预算修改申请" class="layui-input" readonly>
37
+            </div>
38
+        </div>
39
+        <div class="layui-form-item layui-inline" style="width: 100%">
40
+            <label class="layui-form-label" style="width: 70px">审批操作</label>
41
+            <div class="layui-input-inline" style="width: 865px">
42
+                <select id="spcz" name="spcz" class="layui-input" lay-filter="spcz">
43
+                    <option value="审批通过">审批通过</option>
44
+                    <option value="返回修改">返回修改</option>
45
+                </select>
46
+            </div>
47
+        </div>
48
+
49
+        <!--        <div class="layui-form-item layui-inline" style="width: 100%">-->
50
+        <!--            <label class="layui-form-label" style="width: 65px">意见</label>-->
51
+        <!--            <div class="layui-input-inline" style="width: 870px" id="jyDiv1">-->
52
+        <!--                <textarea id="yj" name="yj" class="layui-textarea" th:text="同意" style="width: 870px;height: 100px"></textarea>-->
53
+        <!--            </div>-->
54
+        <!--            <div class="layui-input-inline" style="width: 870px; display: none" id="jyDiv2">-->
55
+        <!--                <textarea id="yj2" name="yj2" class="layui-textarea" style="width: 870px;height: 100px"></textarea>-->
56
+        <!--            </div>-->
57
+        <!--        </div>-->
58
+        <div class="layui-form-item layui-inline" style="width: 100%">
59
+            <label class="layui-form-label" style="width: 65px">意见</label>
60
+            <div class="layui-input-inline" style="width: 870px" id="jyDiv1">
61
+                <textarea id="yj" name="yj" class="layui-textarea" style="width: 870px;height: 100px"></textarea>
62
+            </div>
63
+        </div>
64
+
65
+        <div class="layui-form-item layui-inline" style="width: 100%">
66
+            <label class="layui-form-label" style="width: 95px">选择常用语</label>
67
+            <div class="layui-input-inline" style="width: 750px">
68
+                <select name="xmlx" id="xmlx" lay-filter="xmlx">
69
+                    <option value="">[无]</option>
70
+                    <!--<option th:each="cyyList:${cyyList}" th:text="${cyyList.cyy}"
71
+                            th:value="${cyyList. id}"></option>-->
72
+                </select>
73
+            </div>
74
+            <button type="button" class="layui-btn" lay-filter="cyySaveBtn" style="width: 80px">常用语</button>
75
+        </div>
76
+        <!--        <div class="layui-form-item layui-inline" style="width: 100%">-->
77
+        <!--            <label class="layui-form-label" style="width: 95px">选择常用语</label>-->
78
+        <!--            <div class="layui-input-inline" style="width: 750px">-->
79
+        <!--                <input type="text" id="cyy" name="cyy" class="layui-input" readonly>-->
80
+        <!--            </div>-->
81
+        <!--            <button type="button" class="layui-btn" lay-filter="cyySaveBtn" style="width: 80px">常用语</button>-->
82
+        <!--        </div>-->
83
+        <div class="layui-form-item layui-inline" style="width: 100%">
84
+            <label class="layui-form-label" style="width: 70px">提交人</label>
85
+            <div class="layui-input-inline" style="width: 370px">
86
+                <input type="hidden" id="tjr" name="tjr" class="layui-input" th:value="${approveInfo.tjr}">
87
+                <input type="text" id="tjrxm" name="tjrxm" class="layui-input" readonly th:value="${approveInfo.tjrxm}">
88
+            </div>
89
+            <label class="layui-form-label" style="width: 80px">提交时间</label>
90
+            <div class="layui-input-inline" style="width: 375px">
91
+                <input type="text" id="tjsj" name="tjsj" class="layui-input" readonly th:value="${approveInfo.tjsj}">
92
+            </div>
93
+        </div>
94
+        <div class="layui-form-item layui-inline" style="width: 100%">
95
+            <label class="layui-form-label" style="width: 70px">审核人</label>
96
+            <div class="layui-input-inline" style="width: 370px">
97
+                <input type="hidden" id="userId" name="userId" class="layui-input" th:value="${userInfo.userId}">
98
+                <input type="hidden" id="shr" name="shr" class="layui-input" th:value="${approveInfo.shr}">
99
+                <input type="text" id="shrxm" name="shrxm" class="layui-input" th:value="${approveInfo.shrxm}" readonly>
100
+            </div>
101
+            <label class="layui-form-label" style="width: 80px">审核时间</label>
102
+            <div class="layui-input-inline" style="width: 375px">
103
+                <input type="text" id="shsj" name="shsj" class="layui-input">
104
+            </div>
105
+        </div>
106
+
107
+        <!-- 右侧悬浮按钮 -->
108
+        <div class="right-bottom-btn">
109
+            <button type="button" class="layui-btn" lay-filter="viewNdysBtn">
110
+                <i class="layui-icon layui-icon-file"></i>查看年度预算
111
+            </button>
112
+            <button type="button" class="layui-btn" lay-filter="viewSplistBtn">
113
+                <i class="layui-icon layui-icon-file"></i>审批列表
114
+            </button>
115
+            <button type="button" class="layui-btn" lay-submit lay-filter="saveBtn">
116
+                <i class="layui-icon layui-icon-ok"></i>提交
117
+            </button>
118
+            <button class="layui-btn" lay-filter="cancleBtn">
119
+                <i class="layui-icon layui-icon-close"></i>取消
120
+            </button>
121
+        </div>
122
+    </div>
123
+</form>
124
+
125
+<script th:src="@{/lib/jquery-3.4.1/jquery-3.4.1.min.js}" charset="utf-8"></script>
126
+<script th:src="@{/lib/layui/layui.js}" charset="utf-8"></script>
127
+<script th:src="@{/lib/coco-message/coco-message.js}" charset="utf-8"></script>
128
+<script th:src="@{/lib/xm-select-v1.2.2/xm-select.js}" charset="utf-8"></script>
129
+<script th:src="@{/js/lay-config.js}" charset="utf-8"></script>
130
+<script type="text/javascript" th:inline="javascript">
131
+    function getInit() {
132
+        var userId = document.getElementById('userId').value;
133
+        //初始化常用语
134
+        $.ajax({
135
+            type: "get",
136
+            url: AjaxUtil.ctx + "prjProject/init_cyy/" + userId,
137
+            async: true,
138
+            success: function (data) {
139
+                var cyyList = [];
140
+                for (var item in data) {
141
+                    cyyList.push(data[item]);
142
+                }
143
+
144
+                for (var i = 0; i < cyyList.length; i++) {
145
+                    $("#xmlx").append("<option value = '" + cyyList[i].id + "'>" + cyyList[i].cyy + "</option>");
146
+                    //重新渲染
147
+                    layui.form.render("select");
148
+                }
149
+            }
150
+        })
151
+    }
152
+
153
+    AjaxUtil.ctx = /*[[@{/}]]*/'';
154
+    layui.use(['form', 'tableSelect', 'laydate', 'element'], function () {
155
+        var form = layui.form,
156
+            layer = layui.layer,
157
+            laydate = layui.laydate,
158
+            element = layui.element;
159
+        var updateflag = 0;
160
+
161
+        var xmApproval = parent.getXmApproval();
162
+
163
+        //提交时间
164
+        laydate.render({
165
+            elem: '#shsj',
166
+            type: 'datetime',
167
+            value: new Date()
168
+        });
169
+
170
+        // element.render('checkbox');
171
+        // form.on('select(spcz)', function (data) {
172
+        //     if (data.value == "审批通过") {
173
+        //         document.getElementById('jyDiv1').style.display = 'block';
174
+        //         document.getElementById('jyDiv2').style.display = 'none';
175
+        //     }
176
+        //     else {
177
+        //         document.getElementById('jyDiv1').style.display = 'none';
178
+        //         document.getElementById('jyDiv2').style.display = 'block';
179
+        //     }
180
+        // });
181
+        // 渲染复选框元素
182
+        element.render('checkbox');
183
+
184
+        // 监听下拉菜单选择事件
185
+        form.on('select(xmlx)', function () {
186
+            // 获取选中的选项
187
+            var selectedOption = document.getElementById('xmlx').options[document.getElementById('xmlx').selectedIndex];
188
+            var newValue = selectedOption.text; // 获取选项文本
189
+
190
+            // 更新元素内容和值
191
+            // var yj2 = document.getElementById('yj2');
192
+            var yj = document.getElementById('yj');
193
+
194
+            // yj2.innerText = newValue;
195
+            yj.innerText = newValue;
196
+            // yj2.value = newValue;
197
+            yj.value = newValue;
198
+
199
+            // 修改意见内容
200
+            var modifiedValue = prompt("请输入修改后的意见内容:", newValue); // 提示用户输入修改后的内容
201
+
202
+            // 更新元素值
203
+            // yj2.value = modifiedValue;
204
+            yj.value = modifiedValue;
205
+
206
+            // 最后展示修改后的意见
207
+            console.log("修改后的意见是" + modifiedValue);
208
+        });
209
+
210
+
211
+        //初始化
212
+        getInit();
213
+        //gst ccy 监听常用语按钮
214
+        $("button[lay-filter='cyySaveBtn']").click(function () {
215
+            parent.layer.open({
216
+                title: '查看常用',
217
+                type: 2,
218
+                shade: 0.3,
219
+                maxmin: true,
220
+                shadeClose: true,
221
+                area: ['1080px', layerheight + 'px'],
222
+                // content: AjaxUtil.ctx + '/prjProject/forCyy/' + $("#userId").val(),
223
+                content: AjaxUtil.ctx + 'prjProject/forCyyy',
224
+                end: function (index) {
225
+                    $("#xmlx").empty();
226
+                    $("#xmlx").append("<option>[无]</option>");
227
+                    getInit();
228
+                }
229
+            });
230
+        });
231
+
232
+        // 监听查看年度预算按钮
233
+        $("button[lay-filter='viewNdysBtn']").click(function () {
234
+            parent.layer.open({
235
+                title: '查看年度预算',
236
+                type: 2,
237
+                shade: 0.3,
238
+                maxmin: true,
239
+                shadeClose: true,
240
+                area: ['1010px', layerheight + 'px'],
241
+                content: AjaxUtil.ctx + 'prjAnnualbudget/forView/' + xmApproval.xmid,
242
+                end: function (index) {
243
+                    layer.close(index);
244
+                }
245
+            });
246
+        });
247
+
248
+        // 监听审批列表按钮
249
+        $("button[lay-filter='viewSplistBtn']").click(function () {
250
+            parent.layer.open({
251
+                title: '审批列表',
252
+                type: 2,
253
+                shade: 0.3,
254
+                maxmin: true,
255
+                shadeClose: true,
256
+                area: ['1300px', '750px'],
257
+                content: AjaxUtil.ctx + 'prjAnnualbudget/forApproveList',
258
+                end: function (index) {
259
+                    layer.close(index);
260
+                }
261
+            });
262
+        });
263
+
264
+        // 监听提交按钮
265
+        form.on('submit(saveBtn)', function (data) {
266
+            var zt = $("#zt").val();
267
+            var shr = $("#shr").val();
268
+            var userId = $("#userId").val();
269
+            if (userId != shr)
270
+                Message.error("您不是指定的审核人!", 1500);
271
+            else if (zt == '数据不匹配')
272
+                Message.error("数据不匹配,请联系管理员处理!", 1500);
273
+            else {
274
+                //基本信息
275
+                layer.load(0, {shade: 0.1});
276
+                //1.修改审批列表的状态
277
+                AjaxUtil.post({
278
+                    url: AjaxUtil.ctx + "prjApproverecord/doUpdateApprove",
279
+                    data: data.field,
280
+                    success: function (res) {
281
+                        layer.load(0, {shade: 0.1});
282
+                        //2.修改年度预算列表中的值
283
+                        AjaxUtil.post({
284
+                            url: AjaxUtil.ctx + "PrjAnnualBudgetRecord/doUpdate/" + xmApproval.xmid,
285
+                            data: data.field,
286
+                            success: function (res) {
287
+                                //3.添加修改记录
288
+                                AjaxUtil.post({
289
+                                    url: AjaxUtil.ctx + 'PrjAnnualBudgetRecord/addBudgetRecord/' + xmApproval.xmid,
290
+                                    data: data.field,
291
+                                    success: function (res) {
292
+                                        // layer.close(index);
293
+                                        if (res.code === 0) {
294
+                                            Message.success("申请数据修改成功",1500)
295
+                                        } else {
296
+                                            Message.error("申请数据添加失败", 2000);
297
+                                        }
298
+                                        var iframeIndex = parent.layer.getFrameIndex(window.name);
299
+                                        parent.layer.close(iframeIndex);
300
+                                    }
301
+                                });                            },
302
+                            error: function (error) {
303
+                            }
304
+                        });
305
+
306
+                    },
307
+                    error: function (error) {
308
+                    }
309
+                });
310
+            }
311
+        });
312
+
313
+        // 监听取消按钮
314
+        $("button[lay-filter='cancleBtn']").click(function () {
315
+            var iframeIndex = parent.layer.getFrameIndex(window.name);
316
+            parent.layer.close(iframeIndex);
317
+        });
318
+    });
319
+</script>
320
+</body>
321
+</html>

+ 17 - 0
src/main/resources/templates/annualbudget/list.html

@@ -116,6 +116,10 @@
116 116
                         id="tbYzx">
117 117
                     同步已执行
118 118
                 </button>
119
+                <button class="layui-btn layui-btn-sm" lay-event="viewXgsq"
120
+                        id="viewXgsq">
121
+                    查看修改申请
122
+                </button>
119 123
             </div>
120 124
         </script>
121 125
         <script>
@@ -709,6 +713,19 @@
709 713
                     });
710 714
 
711 715
                 }
716
+            }else  if (obj.event ="viewXgsq"){
717
+                var index = layer.open({
718
+                    title: '修改申请',
719
+                    type: 2,
720
+                    shade: 0.3,
721
+                    maxmin: true,
722
+                    shadeClose: true,
723
+                    area: ['1300px', layerheight + 'px'],
724
+                    content:  AjaxUtil.ctx+ "prjAnnualbudget/ViewXGSQ",
725
+                    end: function () {
726
+                        layer.close(index);
727
+                    }
728
+                });
712 729
             }
713 730
     });
714 731
 

+ 32 - 0
src/main/resources/templates/annualbudget/mylist.html

@@ -118,6 +118,9 @@
118 118
                 <!--                <button class="layui-btn layui-btn-sm" lay-event="exportExcel">-->
119 119
                 <!--                    <i class="layui-icon layui-icon-export" style="font-size: 10px;"></i>导出列表-->
120 120
                 <!--                </button>-->
121
+                <button class="layui-btn layui-btn-sm data-add-btn" lay-event="updateApply">
122
+                    <i class="layui-icon layui-icon-list" style="font-size: 10px;"></i>修改申请
123
+                </button>
121 124
             </div>
122 125
         </script>
123 126
         <table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
@@ -600,6 +603,35 @@
600 603
                         });
601 604
                     });
602 605
                 }
606
+            } else if (obj.event === 'updateApply') {
607
+                var dataBudget = table.cache["currentTableId"];
608
+                if (dataBudget.length == 0)
609
+                    return;
610
+                var checkStatus = table.checkStatus('currentTableId')
611
+                    , data = checkStatus.data;
612
+                if (data == null || data.length === 0) {
613
+                    Message.warning("请选择要修改的年度预算!", 1500);
614
+                } else if (data.length > 1) {
615
+                    Message.warning("请选择一条记录进行修改!", 1500);
616
+                } else if (data[0].spzt != "审批结束") {
617
+                    Message.warning("该年度预算还未审批结束!", 1500);
618
+                }
619
+                else {
620
+                    layer.open({
621
+                        title: '编辑年度预算',
622
+                        type: 2,
623
+                        shade: 0.3,
624
+                        maxmin: true,
625
+                        shadeClose: true,
626
+                        area: ['1010px', layerheight + 'px'],
627
+                        content: AjaxUtil.ctx + 'prjAnnualbudget/forUpdateApply/' + data[0].id,
628
+                        content: AjaxUtil.ctx + 'prjAnnualbudget/forUpdateApply/' + data[0].id,
629
+                        end: function () {
630
+                            if (updateflag == 1)
631
+                                currTable.reload();
632
+                            updateflag = 0;
633
+                        }
634
+                    });                }
603 635
             } else if (obj.event === 'exportExcel') {
604 636
                 var dataBudget = table.cache["currentTableId"];
605 637
                 if (dataBudget.length == 0)

+ 24 - 35
src/main/resources/templates/annualbudget/updateApply_annualbudget.html

@@ -207,11 +207,11 @@
207 207
             layer = layui.layer,
208 208
             treeTable = layui.treeTable,
209 209
             laydate = layui.laydate;
210
-
211 210
         var rwsId = $("#rws").val(),
212 211
             ysId = $("#id").val();
213 212
         var zjfy = 0;
214
-
213
+        var xm = [[${annualbudget.mc}]];
214
+        var xmid = [[${annualbudget.id}]];
215 215
         //申请时间
216 216
         laydate.render({
217 217
             elem: '#sqsj',
@@ -263,7 +263,6 @@
263 263
             dataType: "json",
264 264
             success: function (result) {
265 265
                 dataBudget = result;
266
-                console.log(dataBudget)
267 266
             }
268 267
         });
269 268
         var insTb;
@@ -298,10 +297,6 @@
298 297
                         {field: 'ysje', width: '10%', title: '预算金额'},
299 298
                         {field: 'xmz', width: '9%', title: '项目组', edit: 'number'},
300 299
                         {field: "byj", width: '9%', title: '备用金'}
301
-                        // {field: 'ysqje', width: '11%', title: '已申请金额'},
302
-                        // {field: 'ybzje', width: '11%', title: '已报账金额'},
303
-                        // {field: 'byjysq', width: '11%', title: '备用金已申请'},
304
-                        // {field: 'byjybz', width: '11%', title: '备用金已报账'}
305 300
                     ]
306 301
                 ],
307 302
                 edit: function (obj) {
@@ -494,12 +489,14 @@
494 489
         function getBudget(budgets, data) {
495 490
             var budget = {
496 491
                 "id": data.id,
492
+                "fymc":data.fymc,
493
+                "nys":data.nys,
494
+                "fj":data.fj,
495
+                "bm":data.bm,
497 496
                 "xmzys": data.xmzys,
498 497
                 "ysje": data.ysje,
499 498
                 "xmz": data.xmz,
500
-                "byj": data.byj,
501
-                "xtjsyzx": data.xtjsyzx,
502
-                "sjyzx": data.sjyzx
499
+                "byj": data.byj
503 500
             };
504 501
             budgets.push(budget);
505 502
             if (data.children != undefined) {
@@ -563,41 +560,33 @@
563 560
             for (var i = 0; i < data.length; i++) {
564 561
                 getBudget(budgets, data[i]);
565 562
             }
566
-
567 563
             var index = layer.load(0, {shade: 0.1});
568 564
             //添加修改记录
569 565
             AjaxUtil.post({
570 566
                 url: AjaxUtil.ctx + 'PrjAnnualBudgetRecord/addUpdateApplyRecord/',
571
-                data:budgets,
567
+                contentType: "application/json",
568
+                data: JSON.stringify(budgets),
572 569
                 success: function (res) {
573 570
                     layer.close(index);
574 571
                     if (res.code === 0) {
572
+                        var project = {
573
+                            "xm":xm,
574
+                            "xmid":xmid,
575
+                            "zt":"未提交"
576
+
577
+                        }
578
+            //添加审批记录
575 579
                         AjaxUtil.post({
576
-                            url: AjaxUtil.ctx + "prjApproverecord/doAddApprove",
577
-                            data: data.field,
580
+                            url: AjaxUtil.ctx + "prjApproverecord/doUpdatApprove",
581
+                            data:project,
578 582
                             success: function (res) {
579
-                                //更新审批状态
580
-                                var project = {
581
-                                    "id": xmApproval.xmid,
582
-                                    // "spzt": '部门主任审批'
583
-                                    "spzt": '科技项目管理专责审批'
584
-                                }
585
-                                console.log(data.field)
583
+                                Message.success(res.message, 2000);
586 584
                                 layer.load(0, {shade: 0.1});
587
-                                AjaxUtil.post({
588
-                                    url: AjaxUtil.ctx + "prjAnnualbudget/updateSpzt",
589
-                                    contentType: "application/json",
590
-                                    data: JSON.stringify(project),
591
-                                    success: function (res) {
592
-                                        parent.setUpdateFlag();
593
-
594
-                                        var iframeIndex = parent.layer.getFrameIndex(window.name);
595
-                                        parent.layer.close(iframeIndex);
596
-                                    },
597
-                                    error: function (error) {
598
-                                    }
599
-                                });
600
-                            },
585
+                                setTimeout(function() {
586
+                                    parent.layer.close(parent.layer.getFrameIndex(window.name)); // 关闭子窗口
587
+                                }, 1500);
588
+                                // parent.layer.close(parent.layer.getFrameIndex(window.name));// 关闭子窗口
589
+                                },
601 590
                             error: function (error) {
602 591
                             }
603 592
                         });

+ 662 - 0
src/main/resources/templates/annualbudget/view_xgsq.html

@@ -0,0 +1,662 @@
1
+<!DOCTYPE html>
2
+<html lang="en" xmlns:th="http://www.thymeleaf.org">
3
+<head>
4
+  <meta charset="UTF-8">
5
+  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
6
+  <title>修改申请待审批</title>
7
+  <link rel="stylesheet" th:href="@{/lib/layui/css/layui.css}" media="all">
8
+  <link rel="stylesheet" th:href="@{/css/public.css}" media="all">
9
+  <link rel="stylesheet" th:href="@{/lib/font-awesome-4.7.0/css/font-awesome.min.css}" media="all">
10
+</head>
11
+<body>
12
+<div class="layuimini-container">
13
+  <div class="layuimini-main">
14
+    <script type="text/html" id="toolbarDemo">
15
+      <div class="layui-btn-container">
16
+        <button class="layui-btn layui-btn-sm layui-btn-normal" lay-event="view">
17
+          <i class="layui-icon layui-icon-file" style="font-size: 10px;"></i>查看
18
+        </button>
19
+        <button class="layui-btn layui-btn-sm layui-btn-normal" lay-event="spOption">
20
+          <i class="layui-icon layui-icon-edit" style="font-size: 10px;"></i>审核
21
+        </button>
22
+        <button class="layui-btn layui-btn-sm layui-btn-normal" lay-event="spList">
23
+          <i class="layui-icon layui-icon-list" style="font-size: 10px;"></i>审批列表
24
+        </button>
25
+        <!--                <button class="layui-btn layui-btn-sm" lay-event="exportList">-->
26
+        <!--                    <i class="layui-icon layui-icon-export" style="font-size: 10px;"></i>导出列表-->
27
+        <!--                </button>-->
28
+      </div>
29
+    </script>
30
+
31
+    <table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
32
+
33
+  </div>
34
+</div>
35
+<script th:src="@{/lib/jquery-3.4.1/jquery-3.4.1.min.js}" charset="utf-8"></script>
36
+<script th:src="@{/lib/layui/layui.js}" charset="utf-8"></script>
37
+<script th:src="@{/lib/coco-message/coco-message.js}" charset="utf-8"></script>
38
+<script th:src="@{/js/lay-config.js}" charset="utf-8"></script>
39
+<script th:src="@{/lib/xm-select-v1.2.2/xm-select.js}" charset="utf-8"></script>
40
+<script th:inline="javascript" type="text/javascript">
41
+  AjaxUtil.ctx = /*[[@{/}]]*/'';
42
+  var updateflag = 0;
43
+  var xmApproval = {};
44
+  layui.use(['form', 'table'], function () {
45
+    var form = layui.form,
46
+            table = layui.table;
47
+
48
+    var currTable = table.render({
49
+      elem: '#currentTableId',
50
+      url: AjaxUtil.ctx + 'prjApproverecord/xgsqList',
51
+      method: 'post',
52
+      toolbar: '#toolbarDemo',
53
+      defaultToolbar: ['filter', 'exports', 'print'],
54
+      cols: [
55
+        [
56
+          {type: "checkbox", fixed: 'left'},
57
+          {type: 'numbers', align: 'center'},
58
+          {field: 'spzt', width: '12%', title: '审批状态', sort: true},
59
+          {field: 'xmlxmc', width: '10%', title: '类型', sort: true},
60
+          {field: 'xm', width: '35%', title: '项目/申请', sort: true},
61
+          // {field: 'zt', width: '12%',title: '状态', sort: true},
62
+          {field: 'tjrxm', width: '8%', title: '提交人', align: 'center'},
63
+          {field: 'tjsj', width: '12%', title: '提交时间', align: 'center'}
64
+          // {title: '操作', toolbar: '#currentTableBar', align: 'center', fixed: 'right'}
65
+        ]
66
+      ],
67
+      sortName: 'xm',
68
+      autoSort: false,
69
+      limits: [10, 15, 20, 25, 50, 100],
70
+      limit: 10,
71
+      page: true,
72
+      skin: 'grid',
73
+      parseData: function (res) { //res 即为原始返回的数据
74
+        return {
75
+          "code": res.code, //解析接口状态
76
+          "msg": res.message, //解析提示文本
77
+          "count": res.data.total, //解析数据长度
78
+          "data": res.data.rows //解析数据列表
79
+        };
80
+      },
81
+      done: function (res, curr, count) { // done为数据渲染完的回调
82
+        // 测试打印出后端返回的权限列表
83
+        // let permissionSet = [[${permissionSet}]];
84
+        // console.log(JSON.stringify(permissionSet));
85
+      }
86
+    });
87
+
88
+    // 监听搜索操作
89
+    form.on('submit(data-search-btn)', function (data) {
90
+      // 执行搜索重载
91
+      currTable.reload({
92
+        page: {
93
+          curr: 1 // 页码从1开始
94
+        },
95
+        where: form.val("search-form")
96
+      });
97
+      return false;
98
+    });
99
+
100
+    // 监听重置操作
101
+    form.on('submit(data-reset-btn)', function (data) {
102
+      form.val("search-form", {
103
+        "xm": '',
104
+        "erpbh": '',
105
+        "xmlx": '',
106
+        "spzt": '',
107
+        "tablename":''
108
+      });
109
+      // 执行搜索重载
110
+      currTable.reload({
111
+        page: {
112
+          curr: 1
113
+        },
114
+        where: form.val("search-form")
115
+      });
116
+      return false;
117
+    });
118
+
119
+    // 监听排序事件
120
+    table.on('sort(currentTableFilter)', function (obj) { //注:sort 是工具条事件名,test 是 table 原始容器的属性 lay-filter="对应的值"
121
+      currTable.reload({
122
+        initSort: obj, //记录初始排序,如果不设的话,将无法标记表头的排序状态。
123
+        where: { //请求参数(注意:这里面的参数可任意定义,并非下面固定的格式)
124
+          sortName: toLine(obj.field), //排序字段
125
+          sortOrder: toLine(obj.type) //排序方式
126
+        }
127
+      });
128
+    });
129
+
130
+    // 监听行工具事件
131
+    table.on('toolbar(currentTableFilter)', function (obj) {
132
+      if (obj.event == 'view') {
133
+        var projects = table.cache["currentTableId"];
134
+        if (projects.length == 0)
135
+          return;
136
+
137
+        var checkStatus = table.checkStatus('currentTableId')
138
+                , data = checkStatus.data;
139
+        if (data == null || data.length === 0) {
140
+          Message.warning("请选择要查看的记录!", 1500);
141
+        } else if (data.length > 1) {
142
+          Message.warning("请选择一条记录进行查看!", 1500);
143
+        } else {
144
+          var height = 1090;
145
+          var title = '查看' + data[0].xmlxmc;
146
+          var content = AjaxUtil.ctx;
147
+          if (data[0].tablename == 'prj_Project')
148
+            content += 'prjProject/forView/' + data[0].xmid;
149
+          else if (data[0].tablename == 'prj_AnnualBudgetRecord') {
150
+            height = 1015;
151
+            content += 'PrjAnnualBudgetRecord/forView/' + data[0].xmid
152
+          }
153
+          layer.open({
154
+            title: title,
155
+            type: 2,
156
+            shade: 0.3,
157
+            maxmin: true,
158
+            shadeClose: true,
159
+            area: [height + 'px', layerheight + 'px'],
160
+            content: content,
161
+            end: function (index) {
162
+              layer.close(index);
163
+            }
164
+          });
165
+        }
166
+      } else if (obj.event === 'spOption') {
167
+        var projects = table.cache["currentTableId"];
168
+        if (projects.length == 0)
169
+          return;
170
+
171
+        var checkStatus = table.checkStatus('currentTableId')
172
+                , data = checkStatus.data;
173
+        if (data == null || data.length === 0) {
174
+          Message.warning("请选择要审批的记录!", 1500);
175
+        } else if (data.length > 1) {
176
+          for (var index in data) {
177
+            bathSP(data[index])
178
+            if (index == (data.length - 1)) {
179
+              var tc = layer.alert('操作成功', function (index) {
180
+                // 执行搜索重载
181
+                currTable.reload({
182
+                  page: {
183
+                    curr: 1
184
+                  },
185
+                  where: form.val("search-form")
186
+                });
187
+                layer.close(tc);
188
+              });
189
+            }
190
+          }
191
+
192
+        } else {
193
+          var content = oneSP(data)
194
+          layer.open({
195
+            title: '审批意见',
196
+            type: 2,
197
+            shade: 0.3,
198
+            maxmin: true,
199
+            shadeClose: true,
200
+            area: ['1025px', layerheight + 'px'],
201
+            content: content,
202
+            end: function () {
203
+              if (updateflag == 1)
204
+                currTable.reload();
205
+              updateflag = 0;
206
+            }
207
+          });
208
+        }
209
+      } else if (obj.event === 'spList') {
210
+        var projects = table.cache["currentTableId"];
211
+        if (projects.length == 0)
212
+          return;
213
+
214
+        var checkStatus = table.checkStatus('currentTableId')
215
+                , data = checkStatus.data;
216
+        if (data == null || data.length === 0) {
217
+          Message.warning("请选择要查看的记录!", 1500);
218
+        } else if (data.length > 1) {
219
+          Message.warning("请选择一条记录进行查看!", 1500);
220
+        } else {
221
+          xmApproval = {
222
+            "xmid": data[0].xmid,
223
+            "xm": data[0].xm
224
+          };
225
+
226
+          var content = AjaxUtil.ctx;
227
+          if (data[0].tablename == 'sta_FeasibilityReport')
228
+            content += 'reportinfo';
229
+          else if (data[0].tablename == 'prj_Project')
230
+            content += 'prjProject';
231
+          else if (data[0].tablename == 'prj_AnnualBudget')
232
+            content += 'prjAnnualbudget';
233
+          else if (data[0].tablename == 'sta_BudgetApproval')
234
+            content += 'staBudgetapproval';
235
+          else if (data[0].tablename == 'sta_Reimbursement')
236
+            content += 'staReimbursement';
237
+          else if (data[0].tablename == 'prj_AnnualBudgetRecord')
238
+            content += 'PrjAnnualBudgetRecord';
239
+          else if (data[0].tablename == 'sta_PayApproval')
240
+            content += 'staPayapproval';
241
+          content += '/forApproveList?mc=' + data[0].xm;
242
+
243
+          var index = layer.open({
244
+            title: '审批列表',
245
+            type: 2,
246
+            shade: 0.3,
247
+            maxmin: true,
248
+            shadeClose: true,
249
+            area: ['1300px', '750px'],
250
+            content: content,
251
+            end: function () {
252
+              layer.close(index);
253
+            }
254
+          });
255
+        }
256
+      }
257
+    });
258
+
259
+    //双击
260
+    table.on('rowDouble(currentTableFilter)', function (obj) {
261
+      var projects = table.cache["currentTableId"];
262
+      if (projects.length == 0)
263
+        return;
264
+
265
+      var checkStatus = table.checkStatus('currentTableId')
266
+              , data = checkStatus.data;
267
+      if (data == null || data.length === 0) {
268
+        Message.warning("请选择要审批的记录!", 1500);
269
+      } else if (data.length > 1) {
270
+        for (var index in data) {
271
+          bathSP(data[index])
272
+          if (index == (data.length - 1)) {
273
+            var tc = layer.alert('操作成功', function (index) {
274
+              // 执行搜索重载
275
+              currTable.reload({
276
+                page: {
277
+                  curr: 1
278
+                },
279
+                where: form.val("search-form")
280
+              });
281
+              layer.close(tc);
282
+            });
283
+          }
284
+        }
285
+
286
+      } else {
287
+        var content = oneSP(data)
288
+        layer.open({
289
+          title: '审批意见',
290
+          type: 2,
291
+          shade: 0.3,
292
+          maxmin: true,
293
+          shadeClose: true,
294
+          area: ['1025px', layerheight + 'px'],
295
+          content: content,
296
+          end: function () {
297
+            if (updateflag == 1)
298
+              currTable.reload();
299
+            updateflag = 0;
300
+          }
301
+        });
302
+      }
303
+    });
304
+  });
305
+
306
+  function oneSP(data) {
307
+    var content = AjaxUtil.ctx;
308
+    if (data[0].tablename == 'sta_FeasibilityReport') {
309
+      xmApproval = {
310
+        "xmid": data[0].xmid,
311
+        "xm": data[0].xm,
312
+        "ysje": data[0].kysje
313
+      };
314
+      content += 'reportinfo/forApproveUpdate/' + data[0].xmid + '/' + data[0].kysje + '?spzt=' + data[0].spzt;
315
+    } else if (data[0].tablename == 'prj_Project') {
316
+      xmApproval = {
317
+        "xmid": data[0].xmid,
318
+        "xm": data[0].xm,
319
+        "ysje": data[0].rysje
320
+      };
321
+      content += 'prjProject/forApproveUpdate/' + data[0].xmid + '/' + data[0].rysje + '?spzt=' + data[0].spzt;
322
+    } else if (data[0].tablename == 'prj_AnnualBudget') {
323
+      xmApproval = {
324
+        "xmid": data[0].xmid,
325
+        "xm": data[0].xm,
326
+        "xmzys": data[0].xmzys
327
+      };
328
+      content += 'prjAnnualbudget/forApproveUpdate/' + data[0].xmid + '?spzt=' + data[0].spzt;
329
+    } else if (data[0].tablename == 'prj_AnnualBudgetRecord') {
330
+      xmApproval = {
331
+        "xmid": data[0].xmid,
332
+        "xm": data[0].xm,
333
+        "xmzys": data[0].xmzys
334
+      };
335
+      content += 'PrjAnnualBudgetRecord/forApproveUpdate/' + data[0].xmid + '?spzt=' + data[0].spzt;
336
+    } else if (data[0].tablename == 'sta_BudgetApproval') {
337
+      xmApproval = {
338
+        "xmid": data[0].xmid,
339
+        "xm": data[0].xm,
340
+        "xmzys": data[0].xmzys
341
+      };
342
+      content += 'staBudgetapproval/forApproveUpdate/' + data[0].xmid + '/' + data[0].sqje + '?spzt=' + data[0].spzt;
343
+    } else if (data[0].tablename == 'sta_Reimbursement') {
344
+      xmApproval = {
345
+        "xmid": data[0].xmid,
346
+        "xm": data[0].xm,
347
+        "zt": data[0].spzt,
348
+        "bzje": data[0].bzje
349
+      };
350
+      content += 'staReimbursement/forApproveUpdate/' + data[0].xmid + '/' + data[0].bzje + '?spzt=' + data[0].spzt;
351
+    } else if (data[0].tablename == 'sta_PayApproval') {
352
+      xmApproval = {
353
+        "xmid": data[0].xmid,
354
+        "xm": data[0].xm,
355
+        "zt": data[0].spzt,
356
+        "htje": data[0].htje
357
+      };
358
+      content += 'staPayapproval/forApproveUpdate/' + data[0].xmid + '/' + data[0].htje + '?spzt=' + data[0].spzt;
359
+    }
360
+    return content;
361
+  }
362
+
363
+  function bathSP(data) {
364
+    if (data.tablename == 'sta_FeasibilityReport') {
365
+      var xmApprovalBath = {
366
+        "xmid": data.xmid,
367
+        "xm": data.xm,
368
+        "ysje": data.kysje
369
+      };
370
+      AjaxUtil.get({
371
+        url: AjaxUtil.ctx + 'reportinfo/forApproveUpdate/' + data.xmid + '/' + data.kysje + '?spzt=' + data.spzt,
372
+        data: data.field,
373
+        success: function (res) {
374
+          console.log(res);
375
+          AjaxUtil.post({
376
+            url: AjaxUtil.ctx + "prjApproverecord/doUpdateApprove",
377
+            data: res.data.field,
378
+            success: function (res) {
379
+              //更新审批状态
380
+              var project = {
381
+                "id": xmApprovalBath.xmid,
382
+                "spzt": '审批结束'
383
+              }
384
+              AjaxUtil.post({
385
+                url: AjaxUtil.ctx + "reportinfo/updateSpzt",
386
+                contentType: "application/json",
387
+                data: JSON.stringify(project),
388
+                success: function (res) {
389
+                  return true;
390
+                },
391
+                error: function (error) {
392
+                }
393
+              });
394
+            },
395
+            error: function (error) {
396
+            }
397
+          });
398
+        },
399
+        error: function (error) {
400
+        }
401
+      });
402
+
403
+
404
+    } else if (data.tablename == 'prj_Project') {
405
+      var xmApprovalBath = {
406
+        "xmid": data.xmid,
407
+        "xm": data.xm,
408
+        "ysje": data.rysje
409
+      };
410
+      AjaxUtil.get({
411
+        url: AjaxUtil.ctx + 'prjProject/bathUpdate/' + data.xmid + '/' + data.rysje + '?spzt=' + data.spzt,
412
+        data: data.field,
413
+        success: function (res) {
414
+          console.log(res);
415
+          AjaxUtil.post({
416
+            url: AjaxUtil.ctx + "prjApproverecord/doUpdateApprove",
417
+            data: res.approveInfo,
418
+            success: function (res) {
419
+              //更新审批状态
420
+              var project = {
421
+                "id": xmApprovalBath.xmid,
422
+                "spzt": '审批结束'
423
+              }
424
+              AjaxUtil.post({
425
+                url: AjaxUtil.ctx + "prjProject/updateSpzt",
426
+                contentType: "application/json",
427
+                data: JSON.stringify(project),
428
+                success: function (res) {
429
+                  return true;
430
+                },
431
+                error: function (error) {
432
+                }
433
+              });
434
+            },
435
+            error: function (error) {
436
+            }
437
+          });
438
+        },
439
+        error: function (error) {
440
+        }
441
+      });
442
+    } else if (data.tablename == 'prj_AnnualBudget') {
443
+      var xmApprovalBath = {
444
+        "xmid": data.xmid,
445
+        "xm": data.xm,
446
+        "xmzys": data.xmzys
447
+      };
448
+      AjaxUtil.get({
449
+        url: AjaxUtil.ctx + 'prjAnnualbudget/bathUpdate/' + data.xmid + '?spzt=' + data.spzt,
450
+        data: data.field,
451
+        success: function (res) {
452
+          console.log(res);
453
+          AjaxUtil.post({
454
+            url: AjaxUtil.ctx + "prjApproverecord/doUpdateApprove",
455
+            data: res.approveInfo,
456
+            success: function (res) {
457
+              //更新审批状态
458
+              var project = {
459
+                "id": xmApprovalBath.xmid,
460
+                "spzt": '审批结束'
461
+              }
462
+              AjaxUtil.post({
463
+                url: AjaxUtil.ctx + "prjAnnualbudget/updateSpzt",
464
+                contentType: "application/json",
465
+                data: JSON.stringify(project),
466
+                success: function (res) {
467
+                  return true;
468
+                },
469
+                error: function (error) {
470
+                }
471
+              });
472
+            },
473
+            error: function (error) {
474
+            }
475
+          });
476
+        },
477
+        error: function (error) {
478
+        }
479
+      });
480
+    } else if (data.tablename == 'prj_AnnualBudgetRecord') {
481
+      var xmApprovalBath = {
482
+        "xmid": data.xmid,
483
+        "xm": data.xm,
484
+        "xmzys": data.xmzys
485
+      };
486
+          //修改审批记录表
487
+          AjaxUtil.post({
488
+            url: AjaxUtil.ctx + "prjApproverecord/doUpdateApprove",
489
+            data: res.approveInfo,
490
+            success: function (res) {
491
+
492
+              var project = {
493
+                "id": xmApprovalBath.xmid,
494
+                "spzt": '审批结束'
495
+              }
496
+              //修改年度预算明细表
497
+            },
498
+            error: function (error) {
499
+            }
500
+          });
501
+    } else if (data.tablename == 'sta_BudgetApproval') {
502
+      var xmApprovalBath = {
503
+        "xmid": data.xmid,
504
+        "xm": data.xm,
505
+        "zt": data.spzt,
506
+        "sqje": data.sqje
507
+      };
508
+      AjaxUtil.get({
509
+        url: AjaxUtil.ctx + 'staBudgetapproval/bathUpdate/' + data.xmid + '/' + data.rysje + '?spzt=' + data.spzt,
510
+        data: data.field,
511
+        success: function (bathUpdateRes) {
512
+          console.log(bathUpdateRes.approveInfo);
513
+          AjaxUtil.post({
514
+            url: AjaxUtil.ctx + "prjApproverecord/doUpdateApproveFysq",
515
+            data: bathUpdateRes.approveInfo,
516
+            success: function (res) {
517
+              console.log(res);
518
+              //更新审批状态
519
+              var project = {
520
+                "id": xmApprovalBath.xmid,
521
+                "spzt": '',
522
+                "sqje": xmApprovalBath.sqje,
523
+                "operations":"bathsp"
524
+              }
525
+              if (bathUpdateRes.approveInfo.spcz == '返回修改') {
526
+                project.spzt = '未提交(返回)';
527
+              } else if (bathUpdateRes.approveInfo.zt == '部门主任审批') {
528
+                project.spzt = '科技项目管理专责审批';
529
+              } else if (bathUpdateRes.approveInfo.zt == '科技项目管理专责审批') {
530
+                project.spzt = '科技部部门主任审批';
531
+              } else if (bathUpdateRes.approveInfo.zt == '科技部部门主任审批') {
532
+                project.spzt = '主管院领导审批';
533
+              } else if (bathUpdateRes.approveInfo.zt == '主管院领导审批') {
534
+                if (xmApprovalBath.sqje < 1000000) {
535
+                  project.spzt = '审批结束';
536
+                } else {
537
+                  project.spzt = '院长审批';
538
+                }
539
+              } else if (bathUpdateRes.approveInfo.zt === '院长审批') {
540
+                project.spzt = '审批结束';
541
+              }
542
+              AjaxUtil.post({
543
+                url: AjaxUtil.ctx + "staBudgetapproval/updateSpzt",
544
+                contentType: "application/json",
545
+                data: JSON.stringify(project),
546
+                success: function (res) {
547
+
548
+                },
549
+                error: function (error) {
550
+                }
551
+              });
552
+            },
553
+            error: function (error) {
554
+            }
555
+          });
556
+        },
557
+        error: function (error) {
558
+        }
559
+      });
560
+    } else if (data.tablename == 'sta_Reimbursement') {
561
+      var xmApprovalBath = {
562
+        "xmid": data.xmid,
563
+        "xm": data.xm,
564
+        "zt": data.spzt,
565
+        "bzje": data.bzje
566
+      };
567
+      AjaxUtil.get({
568
+        url: AjaxUtil.ctx + 'staReimbursement/bathUpdate/' + data.xmid + '/' + data.bzje + '?spzt=' + data.spzt,
569
+        data: data.field,
570
+        success: function (bathUpdateRes) {
571
+          console.log(bathUpdateRes.approveInfo);
572
+          AjaxUtil.post({
573
+            url: AjaxUtil.ctx + "prjApproverecord/doUpdateApprove",
574
+            data: bathUpdateRes.approveInfo,
575
+            success: function (res) {
576
+              //更新审批状态
577
+              var project = {
578
+                "id": xmApprovalBath.xmid,
579
+                "spzt": '审批结束'
580
+              }
581
+              AjaxUtil.post({
582
+                url: AjaxUtil.ctx + "staReimbursement/updateSpzt",
583
+                contentType: "application/json",
584
+                data: JSON.stringify(project),
585
+                success: function (res) {
586
+                  return true;
587
+                },
588
+                error: function (error) {
589
+                }
590
+              });
591
+            },
592
+            error: function (error) {
593
+            }
594
+          });
595
+        },
596
+        error: function (error) {
597
+        }
598
+      });
599
+    } else if (data.tablename == 'sta_PayApproval') {
600
+      var xmApprovalBath = {
601
+        "xmid": data.xmid,
602
+        "xm": data.xm,
603
+        "zt": data.spzt,
604
+        "htje": data.htje
605
+      };
606
+      AjaxUtil.get({
607
+        url: AjaxUtil.ctx + 'staPayapproval/bathUpdate/' + data.xmid + '/' + data.htje + '?spzt=' + data.spzt,
608
+        data: data.field,
609
+        success: function (bathUpdateRes) {
610
+          console.log(bathUpdateRes.approveInfo);
611
+          AjaxUtil.post({
612
+            url: AjaxUtil.ctx + "prjApproverecord/doUpdateApproveFksq",
613
+            data: bathUpdateRes.approveInfo,
614
+            success: function (res) {
615
+              if (res.code == 0) {
616
+                //更新审批状态
617
+                var project = {
618
+                  "id": xmApprovalBath.xmid,
619
+                  "spzt": ''
620
+                }
621
+                if (bathUpdateRes.approveInfo.spcz == '返回修改') {
622
+                  project.spzt = '未提交(返回)';
623
+                } else if (bathUpdateRes.approveInfo.zt == '科技项目管理专责1审批') {
624
+                  project.spzt = '科技项目管理专责2审批';
625
+                } else if (bathUpdateRes.approveInfo.zt == '科技项目管理专责2审批') {
626
+                  project.spzt = '科技部部门主任审批';
627
+                } else if (bathUpdateRes.approveInfo.zt === '科技部部门主任审批') {
628
+                  project.spzt = '审批结束';
629
+                }
630
+
631
+                AjaxUtil.post({
632
+                  url: AjaxUtil.ctx + "staPayapproval/updateSpzt",
633
+                  contentType: "application/json",
634
+                  data: JSON.stringify(project),
635
+                  success: function (res) {
636
+                    return true;
637
+                  },
638
+                  error: function (error) {
639
+                  }
640
+                });
641
+              }
642
+            },
643
+            error: function (error) {
644
+            }
645
+          });
646
+        },
647
+        error: function (error) {
648
+        }
649
+      });
650
+    }
651
+  }
652
+
653
+  function setUpdateFlag() {
654
+    updateflag = 1;
655
+  }
656
+
657
+  function getXmApproval() {
658
+    return xmApproval;
659
+  }
660
+</script>
661
+</body>
662
+</html>

+ 99 - 0
src/main/resources/templates/annualbudget/xglist_approve.html

@@ -0,0 +1,99 @@
1
+<!DOCTYPE html>
2
+<html lang="en" xmlns:th="http://www.thymeleaf.org">
3
+<head>
4
+  <meta charset="UTF-8">
5
+  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
6
+  <title>审批列表</title>
7
+  <link rel="stylesheet" th:href="@{/lib/layui/css/layui.css}" media="all">
8
+  <link rel="stylesheet" th:href="@{/css/public.css}" media="all">
9
+  <link rel="stylesheet" th:href="@{/lib/font-awesome-4.7.0/css/font-awesome.min.css}" media="all">
10
+</head>
11
+<body>
12
+<div class="layuimini-container">
13
+  <div class="layuimini-main">
14
+    <form class="layui-form" action="" lay-filter="formDemo">
15
+      <div class="layui-form-item" style="margin: 20px 0px 0px 5px">
16
+        <input type="text" style="width: 70px; border: 0px" value="年度预算:" readonly>
17
+        <input type="text" name="xm" id="xm" style="width: 1000px; border: 0px" readonly>
18
+      </div>
19
+      <table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
20
+
21
+      <!-- 右侧悬浮按钮 -->
22
+      <div class="layui-form layuimini-form" style="padding-bottom: 100px">
23
+        <div class="right-bottom-btn">
24
+          <button class="layui-btn" lay-filter="cancleBtn">
25
+            <i class="layui-icon layui-icon-close"></i>关闭
26
+          </button>
27
+        </div>
28
+      </div>
29
+    </form>
30
+  </div>
31
+</div>
32
+<script th:src="@{/lib/jquery-3.4.1/jquery-3.4.1.min.js}" charset="utf-8"></script>
33
+<script th:src="@{/lib/layui/layui.js}" charset="utf-8"></script>
34
+<script th:src="@{/lib/coco-message/coco-message.js}" charset="utf-8"></script>
35
+<script th:src="@{/js/lay-config.js}" charset="utf-8"></script>
36
+<script th:src="@{/lib/xm-select-v1.2.2/xm-select.js}" charset="utf-8"></script>
37
+<script th:inline="javascript" type="text/javascript">
38
+  AjaxUtil.ctx = /*[[@{/}]]*/'';
39
+  layui.use(['form', 'table'], function () {
40
+
41
+    var form = layui.form,
42
+            table = layui.table;
43
+
44
+    var xmApprove = parent.getXmApproval();
45
+    $("#xm").val(xmApprove.xm);
46
+    form.render();
47
+
48
+    var currTable = table.render({
49
+      elem: '#currentTableId',
50
+      url: AjaxUtil.ctx + 'prjApproverecord/spList/' + xmApprove.xmid+'/prj_AnnualBudgetRecord',
51
+      method: 'post',
52
+      // toolbar: '#toolbarDemo',
53
+      // defaultToolbar: ['filter', 'exports', 'print'],
54
+      cols: [
55
+        [
56
+          {type: 'numbers', align: 'center'},
57
+          {field: 'zt', width: '15%', title: '审批状态'},
58
+          // {field: 'tjrxm', width: '10%', title: '提交人'},
59
+          {field: 'tjsj', width: '16%', title: '提交时间', align: 'center'},
60
+          {
61
+            field: 'wc', width: '6%', title: '完成', align: 'center', templet: function (d) {
62
+              if (1 == d.wc) {
63
+                return '<span class="layui-badge layui-bg-blue">是</span>';
64
+              } else {
65
+                return '<span class="layui-badge layui-bg-orange">否</span>';
66
+              }
67
+            }
68
+          },
69
+          {field: 'shrxm', width: '10%', title: '审核人', align: 'center'},
70
+          {field: 'shsj', width: '16%', title: '审核时间', align: 'center'},
71
+          {field: 'spcz', width: '12%', title: '审批操作', align: 'center'},
72
+          {field: 'yj', title: '意见'}
73
+        ]
74
+      ],
75
+      sortName: 'jtsj',
76
+      autoSort: false,
77
+      limits: [10, 15, 20, 25, 50, 100],
78
+      limit: 10,
79
+      page: true,
80
+      skin: 'grid',
81
+      parseData: function (res) { //res 即为原始返回的数据
82
+        return {
83
+          "code": res.code, //解析接口状态
84
+          "msg": res.message, //解析提示文本
85
+          "count": res.data.total, //解析数据长度
86
+          "data": res.data.rows //解析数据列表
87
+        };
88
+      }
89
+    });
90
+
91
+    // 监听取消按钮
92
+    $("button[lay-filter='cancleBtn']").click(function () {
93
+      var iframeIndex = parent.layer.getFrameIndex(window.name);
94
+      parent.layer.close(iframeIndex);
95
+    });
96
+  });
97
+</script>
98
+</body>
99
+</html>

+ 145 - 0
src/main/resources/templates/annualbudget/xgview_record.html

@@ -0,0 +1,145 @@
1
+<!DOCTYPE html>
2
+<html lang="en" xmlns:th="http://www.thymeleaf.org">
3
+<head>
4
+    <meta charset="UTF-8">
5
+    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
6
+    <title>修改记录</title>
7
+    <link rel="stylesheet" th:href="@{/lib/layui/css/layui.css}" media="all">
8
+    <link rel="stylesheet" th:href="@{/css/public.css}" media="all">
9
+    <link rel="stylesheet" th:href="@{/lib/font-awesome-4.7.0/css/font-awesome.min.css}" media="all">
10
+</head>
11
+<style>
12
+    .table-container {
13
+        display: flex;
14
+        justify-content: space-between;
15
+    }
16
+    .table-wrapper {
17
+        width: 48%;
18
+    }
19
+</style>
20
+<body>
21
+<div class="layuimini-container">
22
+    <div class="layuimini-main">
23
+        <form class="layui-form" action="" lay-filter="formDemo">
24
+            <div class="table-container">
25
+                <div class="table-wrapper">
26
+                    <h1 style="">新数据</h1>
27
+                <table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
28
+                </div>
29
+                <div class="table-wrapper">
30
+                    <h1 style="">旧数据</h1>
31
+                    <table class="layui-hide" id="currentTableId1" lay-filter="currentTableFilter"></table>
32
+                </div>
33
+            </div>
34
+            <div class="table-container">
35
+                <div class="table-wrapper">
36
+                    <table id="newDataTable" lay-filter="newDataFilter"></table>
37
+                </div>
38
+                <div class="table-wrapper">
39
+                    <table id="oldDataTable" lay-filter="oldDataFilter"></table>
40
+                </div>
41
+            </div>
42
+            <!-- 右侧悬浮按钮 -->
43
+            <div class="layui-form layuimini-form" style="padding-bottom: 100px">
44
+                <div class="right-bottom-btn">
45
+                    <button class="layui-btn" lay-filter="cancleBtn">
46
+                        <i class="layui-icon layui-icon-close"></i>关闭
47
+                    </button>
48
+                </div>
49
+            </div>
50
+        </form>
51
+    </div>
52
+</div>
53
+<script th:src="@{/lib/jquery-3.4.1/jquery-3.4.1.min.js}" charset="utf-8"></script>
54
+<script th:src="@{/lib/layui/layui.js}" charset="utf-8"></script>
55
+<script th:src="@{/lib/coco-message/coco-message.js}" charset="utf-8"></script>
56
+<script th:src="@{/js/lay-config.js}" charset="utf-8"></script>
57
+<script th:src="@{/lib/xm-select-v1.2.2/xm-select.js}" charset="utf-8"></script>
58
+<script th:inline="javascript" type="text/javascript">
59
+    AjaxUtil.ctx = /*[[@{/}]]*/'';
60
+    layui.use(['form', 'treeTable', 'tableSelect', 'laydate','table'], function () {
61
+
62
+        var form = layui.form,
63
+            table = layui.table;
64
+        var prjAnnualbudgetRecord =[[${prjAnnualbudgetRecord}]];
65
+        var prjAnnualbudget =[[${prjAnnualbudget}]];
66
+        form.render();
67
+        // 合并数据
68
+        var mergedData = prjAnnualbudget.concat(prjAnnualbudgetRecord);
69
+        var newcols =[
70
+            {type: 'numbers', align: 'center'},
71
+            {field: 'fymc', width: '30%', title: '费用名称'},
72
+            {field: 'xmzys', width: '20%', title: '项目总预算'},
73
+            {field: 'ysje', width: '16%', title: '预算金额'},
74
+            {field: 'xmz', width: '16%', title: '项目组'},
75
+            {field: 'byj', width: '16%', title: '备用金'},
76
+
77
+        ]
78
+        var currTable = table.render({
79
+            elem: '#currentTableId',
80
+            data: prjAnnualbudgetRecord,
81
+            method: 'post',
82
+            cols:[newcols],
83
+            autoSort: false,
84
+            limits: [20, 25, 50, 100],
85
+            limit: 30,
86
+            maxmin:true,
87
+            page: true,
88
+            skin: 'grid',
89
+            parseData: function (res) { //res 即为原始返回的数据
90
+                return {
91
+                    "code": res.code, //解析接口状态
92
+                    "msg": res.message, //解析提示文本
93
+                    "count": res.data.total, //解析数据长度
94
+                    "data": res.data.rows, //解析数据列表
95
+                };
96
+            }
97
+        });
98
+        var currTable = table.render({
99
+            elem: '#currentTableId1',
100
+            data: prjAnnualbudget,
101
+            method: 'post',
102
+            cols:[newcols],
103
+            autoSort: false,
104
+            limits: [20, 25, 50, 100],
105
+            limit: 30,
106
+            maxmin:true,
107
+            page: true,
108
+            skin: 'grid',
109
+            parseData: function (res) { //res 即为原始返回的数据
110
+                return {
111
+                    "code": res.code, //解析接口状态
112
+                    "msg": res.message, //解析提示文本
113
+                    "count": res.data.total, //解析数据长度
114
+                    "data": res.data.rows, //解析数据列表
115
+                };
116
+            }
117
+        });
118
+        // var render = table.render({
119
+        //         elem:'#currentTableId',
120
+        //         data: prjAnnualbudget,
121
+        //         cols:[newcols],
122
+        //         autoSort: false,
123
+        //         limits: [20, 25, 50, 100],
124
+        //         limit: 30,
125
+        //         maxmin:true,
126
+        //         page: true,
127
+        //         skin: 'grid',
128
+        //         parseData: function (res) { //res 即为原始返回的数据
129
+        //             return {
130
+        //                 "code": res.code, //解析接口状态
131
+        //                 "msg": res.message, //解析提示文本
132
+        //                 "count": res.data.total, //解析数据长度
133
+        //                 "data": res.data.rows, //解析数据列表
134
+        //             };
135
+        //         }
136
+        // });
137
+        // 监听取消按钮
138
+        $("button[lay-filter='cancleBtn']").click(function () {
139
+            var iframeIndex = parent.layer.getFrameIndex(window.name);
140
+            parent.layer.close(iframeIndex);
141
+        });
142
+    });
143
+</script>
144
+</body>
145
+</html>

+ 33 - 0
src/main/resources/templates/prjapproverecord/list.html

@@ -217,6 +217,9 @@
217 217
                         width = 750;
218 218
                         height = 950;
219 219
                         content += 'staPayapproval/forView/' + data[0].xmid
220
+                    } else if (data[0].tablename == 'prj_AnnualBudgetRecord') {
221
+                        height = 1015;
222
+                        content += 'PrjAnnualBudgetRecord/forView/' + data[0].xmid
220 223
                     }
221 224
                     layer.open({
222 225
                         title: title,
@@ -302,6 +305,8 @@
302 305
                         content += 'staBudgetapproval';
303 306
                     else if (data[0].tablename == 'sta_Reimbursement')
304 307
                         content += 'staReimbursement';
308
+                    else if (data[0].tablename == 'prj_AnnualBudgetRecord')
309
+                        content += 'PrjAnnualBudgetRecord';
305 310
                     else if (data[0].tablename == 'sta_PayApproval')
306 311
                         content += 'staPayapproval';
307 312
                     content += '/forApproveList?mc=' + data[0].xm;
@@ -433,6 +438,13 @@
433 438
                 "xmzys": data[0].xmzys
434 439
             };
435 440
             content += 'prjAnnualbudget/forApproveUpdate/' + data[0].xmid + '?spzt=' + data[0].spzt;
441
+        }  else if (data[0].tablename == 'prj_AnnualBudgetRecord') {
442
+            xmApproval = {
443
+                "xmid": data[0].xmid,
444
+                "xm": data[0].xm,
445
+                "xmzys": data[0].xmzys
446
+            };
447
+            content += 'PrjAnnualBudgetRecord/forApproveUpdate/' + data[0].xmid + '?spzt=' + data[0].spzt;
436 448
         } else if (data[0].tablename == 'sta_BudgetApproval') {
437 449
             xmApproval = {
438 450
                 "xmid": data[0].xmid,
@@ -578,6 +590,27 @@
578 590
                 error: function (error) {
579 591
                 }
580 592
             });
593
+        }else if (data.tablename == 'prj_AnnualBudgetRecord') {
594
+            var xmApprovalBath = {
595
+                "xmid": data.xmid,
596
+                "xm": data.xm,
597
+                "xmzys": data.xmzys
598
+            };
599
+            //修改审批记录表
600
+            AjaxUtil.post({
601
+                url: AjaxUtil.ctx + "prjApproverecord/doUpdateApprove",
602
+                data: res.approveInfo,
603
+                success: function (res) {
604
+
605
+                    var project = {
606
+                        "id": xmApprovalBath.xmid,
607
+                        "spzt": '审批结束'
608
+                    }
609
+                    //修改年度预算明细表
610
+                },
611
+                error: function (error) {
612
+                }
613
+            });
581 614
         } else if (data.tablename == 'sta_BudgetApproval') {
582 615
             var xmApprovalBath = {
583 616
                 "xmid": data.xmid,