Ver Fonte

Merge branch 'master' of http://47.100.37.243:10080/wutt/manHourHousekeeper

cs há 2 anos atrás
pai
commit
8176f5d406
20 ficheiros alterados com 636 adições e 467 exclusões
  1. 2 203
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/DingDingController.java
  2. 4 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java
  3. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/DingDingService.java
  4. 195 8
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/DingDingServiceImpl.java
  5. 9 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java
  6. 4 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/WorkDayCalculateUtils.java
  7. 1 1
      fhKeeper/formulahousekeeper/timesheet/src/components/select.vue
  8. 3 3
      fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue
  9. 21 1
      fhKeeper/formulahousekeeper/timesheet/src/views/project/projectInside.vue
  10. 22 1
      fhKeeper/formulahousekeeper/timesheet/src/views/task/list.vue
  11. 187 187
      fhKeeper/formulahousekeeper/timesheet_h5/package-lock.json
  12. 3 7
      fhKeeper/formulahousekeeper/timesheet_h5/public/index.html
  13. 1 1
      fhKeeper/formulahousekeeper/timesheet_h5/src/components/Footer.vue
  14. 3 0
      fhKeeper/formulahousekeeper/timesheet_h5/src/main.js
  15. 1 1
      fhKeeper/formulahousekeeper/timesheet_h5/src/utils/request.js
  16. 24 13
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/cost/cost.vue
  17. 42 4
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/expense/details.vue
  18. 77 19
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/expense/index.vue
  19. 19 11
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/index/index.vue
  20. 17 4
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/task/editask.vue

Diff do ficheiro suprimidas por serem muito extensas
+ 2 - 203
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/DingDingController.java


+ 4 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java

@@ -183,6 +183,7 @@ public class ReportController {
         List<Report> reportList = new ArrayList<>();
         String token = request.getHeader("Token");
         User user = userService.getById(token);
+        System.out.println("填报人:"+user.getName());
         Company company = companyService.getById(user.getCompanyId());
         //检查当前人员账号是否停用
         if (user.getIsActive() == 0) {
@@ -274,6 +275,9 @@ public class ReportController {
                     for (Integer b : basecostId) {
                         System.out.println("预算项id="+b);
                     }
+                    HttpRespMsg msg = new HttpRespMsg();
+                    msg.setError("请选择预算来源");
+                    return msg;
                 }
                 //有预警类型的预算成本,默认给选上
                 for (int i=0;i<projectId.length; i++) {

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/DingDingService.java

@@ -18,7 +18,7 @@ public interface DingDingService {
 
     HttpRespMsg getUserByCode(String code, String corpid);
 
-    public HttpRespMsg testAsync();
+    public void asyncHandleMsg(String decryptMsg);
 
     HttpRespMsg syncCorpInfo(String corpid);
 

Diff do ficheiro suprimidas por serem muito extensas
+ 195 - 8
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/DingDingServiceImpl.java


+ 9 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java

@@ -436,7 +436,7 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
             if (userId == null) {
                 //获取企业下的全部员工
                 List<User> users = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId).isNotNull("corpwx_userid").eq("is_active", 1));
-                System.out.println("获取考勤记录users size==" + users.size());
+                System.out.println("获取考勤记录users size==" + users.size()+", companyId="+companyId+", "+corpInfo.getCorpName());
                 corpwxUserIds = users.stream().map(User::getCorpwxUserid).collect(Collectors.toList());
                 totalLength = corpwxUserIds.size();
                 batchCount = totalLength / batchSize + (totalLength % batchSize == 0 ? 0 : 1);
@@ -834,6 +834,10 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                                     String dateEnd = localDate.getYear() + "/" + (isOldFormat ? s[2] : s[3]);
                                     LocalDate sDate = LocalDate.parse(dateStart, mdFormat);
                                     LocalDate eDate = LocalDate.parse(dateEnd, mdFormat);
+                                    //跨年情况的校验
+                                    if (eDate.isBefore(sDate)) {
+                                        eDate = eDate.plusYears(1);
+                                    }
                                     if (sDate.isEqual(eDate)) {
                                         //请假在一天内
                                         if (leaveEnd.equals("下午")) {
@@ -858,6 +862,10 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                                         if (showLog) System.out.println("跨天请假@@@@");
                                         if (showLog)
                                             System.out.println("当天==" + localDate + ", sDate=" + sDate + ", 比较=" + (localDate.isEqual(sDate)));
+                                        if (sDate.isAfter(eDate)) {
+                                            System.out.println("请假日期有误,開始日期="+dtf.format(sDate)+", 結束日期="+dtf.format(eDate));
+                                            break;
+                                        }
                                         //跨天请假,获取期间的非工作日,加进去
                                         List<LocalDate> localDates = WorkDayCalculateUtils.getNonWorkDaysListInRange(dtf.format(sDate) ,dtf.format(eDate));
                                         for (LocalDate curLdate : localDates) {
@@ -1018,7 +1026,6 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                                         seconds = wxDuration;
                                     }
                                     double curLeaveTime = convertDayTimeToHours(DateTimeUtil.getHoursFromSeconds(seconds));
-                                    System.out.println("j="+j+", curLeaveTime="+curLeaveTime);
                                     ct.setAskLeaveTime(leaveTime + curLeaveTime);
                                     break;
                                 case 2://补卡

+ 4 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/WorkDayCalculateUtils.java

@@ -129,7 +129,11 @@ public class WorkDayCalculateUtils {
         int daysOffset = 0;
         LocalDate localStartDate = LocalDate.parse(startDate, dateTimeFormatter);
         LocalDate localEndDate = LocalDate.parse(endDate, dateTimeFormatter);
+        if (localEndDate.isBefore(localStartDate)) {
+            System.err.println("结束日期"+startDate+"不得小于开始日期"+endDate);
+        }
         List<LocalDate> list = new ArrayList<>();
+        int i = 0;
         while(true) {
             localStartDate = localStartDate.plusDays(daysOffset);
             if (!isWorkDay(localStartDate)) {

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/components/select.vue

@@ -298,6 +298,7 @@ export default {
         },
         liClick(item, itemIndex) {
             let nameId = item.id || item.auditorId
+            this.selectName = item.name || item.auditorName
             if(!this.multiSelect) {
                 console.log('我进来了', this.flg)
                 if(this.flgs) {
@@ -316,7 +317,6 @@ export default {
                     }
                     this.$emit("selectCal", obj)
                 }
-                this.selectName = item.name || item.auditorName
                 this.transitionBoxLiIdx = ''
                 this.show = false
                 this.classDiv = false

+ 3 - 3
fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue

@@ -1308,7 +1308,7 @@ export default {
                   this.groupWorktimeList.right = []
                   this.getGroupWorktimeList()
                 }else{
-                  this.getList();
+                  this.getList(true);
                 }
             },
 
@@ -1334,10 +1334,10 @@ export default {
                 this.groupWorktimeList.left = []
                 this.getGroupWorktimeAll()
             },
-            getList() {
+            getList(e) {
               if(this.ins == 15) {
                 this.rangeDatas = null
-              } else {
+              } else if(!e){
                 this.rangeDatas = this.getCurrentRangeTime()
               }
                 if (this.ins == 0) {

+ 21 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/project/projectInside.vue

@@ -784,7 +784,12 @@
                                                 <ww-open-data type='userName' :openid='item.userName'></ww-open-data>
                                             </p>
                                         <!-- </p> -->
-                                        <em>{{item.content}}</em>
+                                        <em>
+                                            <!-- {{item.content}} -->
+                                            <p style="display: inline-block;padding: 0;margin: 0;" v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.content.name'></ww-open-data></p>
+                                            <p style="display: inline-block;padding: 0;margin: 0;" v-if="user.userNameNeedTranslate != 1">{{item.content.name}}</p>
+                                            {{item.content.con}}
+                                        </em>
                                     </div>
                                     <span>{{item.createTime | relativeTime}}</span>
                                 </li>
@@ -2439,6 +2444,21 @@
                 this.http.post('/task-comment/getList', {taskId: e == 1 ? task.taskId : task.id},
                 res => {
                     if (res.code == "ok") {
+                        for(var i in res.data) {
+                            if(res.data[i].content.indexOf(res.data[i].userName) != '-1') {
+                                let obj = {
+                                    name: res.data[i].userName,
+                                    con: res.data[i].content.split(res.data[i].userName)[1]
+                                }
+                                res.data[i].content = obj
+                            } else {
+                                let obj = {
+                                    name: '',
+                                    con: res.data[i].content
+                                }
+                                res.data[i].content = obj
+                            }
+                        }
                         this.commentList = res.data
                         this.sppk(this.commentList) // 获取参与人的方法
                     } else {

+ 22 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/task/list.vue

@@ -446,7 +446,12 @@
                                         <!-- <p>{{item.userName}}</p> -->
                                         <p v-if="user.userNameNeedTranslate != '1'">{{item.userName}}</p>
                                         <p v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='item.userName'></ww-open-data></p>
-                                        <em>{{item.content}}</em>
+                                        <em>
+                                            <!-- {{item.content}} -->
+                                            <p style="display: inline-block;padding: 0;margin: 0;" v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='item.content.name'></ww-open-data></p>
+                                            <p style="display: inline-block;padding: 0;margin: 0;" v-if="user.userNameNeedTranslate != 1">{{item.content.name}}</p>
+                                            {{item.content.con}}
+                                        </em>
                                     </div>
                                     <span>{{item.createTime | relativeTime}}</span>
                                 </li>
@@ -1315,7 +1320,23 @@ import { error } from 'dingtalk-jsapi';
                 this.http.post('/task-comment/getList', {taskId: task.id},
                 res => {
                     if (res.code == "ok") {
+                        for(var i in res.data) {
+                            if(res.data[i].content.indexOf(res.data[i].userName) != '-1') {
+                                let obj = {
+                                    name: res.data[i].userName,
+                                    con: res.data[i].content.split(res.data[i].userName)[1]
+                                }
+                                res.data[i].content = obj
+                            } else {
+                                let obj = {
+                                    name: '',
+                                    con: res.data[i].content
+                                }
+                                res.data[i].content = obj
+                            }
+                        }
                         this.commentList = res.data
+                        console.log(res.data, '数据')
                         this.sppk(this.commentList) // 获取参与人的方法
                     } else {
                         this.$message({

Diff do ficheiro suprimidas por serem muito extensas
+ 187 - 187
fhKeeper/formulahousekeeper/timesheet_h5/package-lock.json


+ 3 - 7
fhKeeper/formulahousekeeper/timesheet_h5/public/index.html

@@ -8,21 +8,17 @@
     <!-- <link rel="icon" href="<%= BASE_URL %>favicon.ico"> -->
     <link rel="shortcut icon" type="image/x-icon" href="./favicon.ico"/>
     <title>工时管家</title>
+    <!-- <script src="/axios.min.js"></script> -->
     <link rel="stylesheet" href="https://at.alicdn.com/t/font_1456778_1mgn5degp7t.css">
     <!-- <script src="https://cdn.bootcss.com/axios/0.19.0-beta.1/axios.min.js"></script> -->
     <!-- <script src="https://cdn.bootcdn.net/ajax/libs/axios/0.25.0/axios.min.js"></script> -->
     <!-- <script src="../src/assets/axios.min.js"></script> -->
     <!-- <script src="https://unpkg.com/axios/dist/axios.min.js"></script> -->
-    <script src="./axios.min.js"></script> 
+    <!-- <script src="./axios.min.js"></script>  -->
     <!-- 引入企业微信js -->
     <script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js" referrerpolicy="origin"></script>
     <script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js" referrerpolicy="origin"></script>
-    <script language="javascript"> 
-        function killerrors() {
-            return true;
-        }
-        window.onerror = killerrors;
-      </script>
+
     <meta name="wpk-bid" content="dta_2_71020">
         <script>
         var isDingtalk = navigator && /DingTalk/.test(navigator.userAgent);var isProductEnv = window &&window.location &&window.location.host 

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/components/Footer.vue

@@ -14,7 +14,7 @@
         </li>
         <li class="item" v-if="cost">
             <router-link to="/cost" class="flex2 aic f20 text" active-class="active">
-                <van-icon class="text" name="bar-chart-o" />
+                <van-icon class="text" name="after-sale" />
                 <p class="mt-5 text f12">成本统计</p>
             </router-link>
         </li>

+ 3 - 0
fhKeeper/formulahousekeeper/timesheet_h5/src/main.js

@@ -9,6 +9,9 @@ import $axios from "@/utils/request";
 import mixin from "./mixin/index";
 import store from "./store/index";
 
+import axios from 'axios'; /* 引入axios进行地址访问*/
+Vue.prototype.$http = axios;
+
 import "@/components/Vant";
 
 import { Form , Toast , Grid, GridItem , DatetimePicker , Popover,

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/utils/request.js

@@ -1,4 +1,4 @@
-// import axios from "axios";
+import axios from "axios";
 import store from "../store";
 import router from "../router";
 import qs from "qs"

+ 24 - 13
fhKeeper/formulahousekeeper/timesheet_h5/src/views/cost/cost.vue

@@ -26,18 +26,18 @@
                 <van-cell v-for="item in timeCostList" :key="item.id" style="padding: 2px 4px;background-color: transparent;">
                     <div style="padding: 0.26667rem 0.42667rem;background-color: #fff;">
                         <van-row>
-                            <van-col span="6" style="text-align:center">项目名称</van-col>
+                            <van-col span="6" style="text-align:center;color:#969799">项目名称</van-col>
                             <van-col span="18">{{item.project}}</van-col>
                         </van-row>
                         <van-row>
-                            <van-col span="6" style="text-align:center">项目编号</van-col>
+                            <van-col span="6" style="text-align:center;color:#969799">项目编号</van-col>
                             <van-col span="18">{{item.projectCode}}</van-col>
                         </van-row>
-                        <van-row style="color:#969799">
-                            <van-col span="4" style="text-align:center">工时</van-col>
-                            <van-col span="6">{{item.cost}} h</van-col>
-                            <van-col span="4" style="text-align:center">成本:</van-col>
-                            <van-col span="10">¥ {{item.costMoney}}</van-col>
+                        <van-row>
+                            <van-col v-if="countHours" span="4" style="text-align:center;color:#969799">工时</van-col>
+                            <van-col v-if="countHours" span="5" style="text-align:right">{{item.cost.toFixed(1)}} h</van-col>
+                            <van-col v-if="countCost" span="5" style="text-align:right;color:#969799">成本</van-col>
+                            <van-col v-if="countCost" span="8" style="text-align:right">¥ {{item.costMoney.toFixed(2)}}</van-col>
                         </van-row>
                     </div>
                 </van-cell>
@@ -46,14 +46,14 @@
                 <van-cell v-for="item in timeCostList" :key="item.category" style="padding: 2px 4px;background-color: transparent;">
                     <div style="padding: 0.26667rem 0.42667rem;background-color: #fff;">
                         <van-row>
-                            <van-col span="6" style="text-align:center">分类名称</van-col>
+                            <van-col span="6" style="text-align:center;color:#969799">分类名称</van-col>
                             <van-col span="18">{{item.categoryName}}</van-col>
                         </van-row>
-                        <van-row style="color:#969799">
-                            <van-col span="4" style="text-align:center">工时</van-col>
-                            <van-col span="6">{{item.cost}} h</van-col>
-                            <van-col span="4" style="text-align:center">成本:</van-col>
-                            <van-col span="10">¥ {{item.costMoney}}</van-col>
+                        <van-row>
+                            <van-col v-if="countHours" span="4" style="text-align:center;color:#969799">工时</van-col>
+                            <van-col v-if="countHours" span="5" style="text-align:right">{{item.cost.toFixed(1)}} h</van-col>
+                            <van-col v-if="countCost" span="5" style="text-align:right;color:#969799">成本</van-col>
+                            <van-col v-if="countCost" span="8" style="text-align:right">¥ {{item.costMoney.toFixed(2)}}</van-col>
                         </van-row>
                     </div>
                 </van-cell>
@@ -73,6 +73,8 @@ export default {
     },
     data() {
         return {
+            countCost: false,
+            countHours: false,
             active: 0,
             listLoading: false,
             minDate: new Date(2020,0,1),
@@ -84,6 +86,15 @@ export default {
         }
     },
     mounted() {
+        let user = JSON.parse(localStorage.userInfo)
+        for(let i in user.functionList){
+            if(user.functionList[i].name == '查看工时统计'){
+                this.countHours = true
+            }
+            if(user.functionList[i].name == '查看成本统计'){
+                this.countCost = true
+            }
+        }
         let end = new Date()
         let start = new Date(end.getFullYear(),end.getMonth(),1)
         this.costDate = [this.formatDate(start),this.formatDate(end)]

+ 42 - 4
fhKeeper/formulahousekeeper/timesheet_h5/src/views/expense/details.vue

@@ -46,6 +46,7 @@
                         createDateShow = false;
                         $forceUpdate();
                     "
+                    v-model="currentDate1"
                     :min-date="minDate"
                     :max-date="maxDate"
                 />
@@ -53,7 +54,7 @@
             <!-- 发票张数 -->
             <van-field label="发票张数" :readonly="!canEdit">
                 <template #input>
-                    <van-stepper v-model="editForm.ticketNum" :disabled="!canEdit" />
+                    <van-stepper v-model="editForm.ticketNum" :disabled="true" />
                 </template>
             </van-field>
             <!-- 费用类型 -->
@@ -96,7 +97,7 @@
                         name="delete-o"
                         class="deletebtn"
                         @click="deleteInvoice(index)"
-                        v-if="canEdit"
+                        v-if="canEdit && index != 0"
                     />
                     <van-field
                         label="所属项目:"
@@ -104,6 +105,7 @@
                         @click="(in_projectShow = true), (invoiceIndex = index)"
                         readonly
                         clickable
+                        required
                     >
                         <template #input>{{
                             formshowText.inProjectName[index]
@@ -115,6 +117,7 @@
                         @click="(in_dateShow = true), (invoiceIndex = index)"
                         readonly
                         clickable
+                        required
                     ></van-field>
                     <van-field
                         label="发票种类:"
@@ -122,6 +125,7 @@
                         @click="(in_typeShow = true), (invoiceIndex = index)"
                         readonly
                         clickable
+                        required
                     >
                         <template #input>{{
                             inTypeList[item.invoiceType]
@@ -133,6 +137,7 @@
                         @click="(in_exTypeShow = true), (invoiceIndex = index)"
                         readonly
                         clickable
+                        required
                     ></van-field>
                     <van-field
                         label="费用金额(含税):"
@@ -140,6 +145,7 @@
                         type="number"
                         @input="costCount"
                         :readonly="!canEdit"
+                        required
                     ></van-field>
                     <van-field
                         label="发票号:"
@@ -195,6 +201,7 @@
                     <van-datetime-picker
                         type="date"
                         title="选择费用日期"
+                        v-model="currentDate2"
                         @confirm="inDateChange"
                         @cancel="
                             in_dateShow = false;
@@ -254,6 +261,8 @@ export default {
             user: JSON.parse(localStorage.userInfo),
             canEdit: this.$route.params.canEdit,
             canExamine: false,
+            currentDate1 : new Date(),
+            currentDate2 : new Date(),
             minDate: new Date(2020,0,1),
             maxDate: new Date(2025,11,31),
             editForm: {
@@ -406,8 +415,37 @@ export default {
                 this.$toast.fail('请选择填报日期')
                 return
             }
-            if(this.invoiceList.length == 0){
-                this.$toast.fail('请添加发票')
+            console.log(this.invoiceList);
+            let required1 = false
+            let required2 = false
+            let required3 = false
+            let required4 = false
+            let required5 = false
+            for(let i in this.invoiceList){
+                if(!this.invoiceList[i].projectId){
+                    required1 = '所属项目'
+                }
+                if(!this.invoiceList[i].happenDate){
+                    required2 = '费用日期'
+                }
+                if(!this.invoiceList[i].invoiceType){
+                    required3 = '发票种类'
+                }
+                if(!this.invoiceList[i].expenseType){
+                    required4 = '费用类型'
+                }
+                if(!this.invoiceList[i].amount){
+                    required5 = '费用金额(含税)'
+                }
+            }
+            if(required1 || required2 || required3 || required4 || required5){
+                let requiredStr = (required1 ? required1 + '、' : '')
+                                + (required2 ? required2 + '、' : '')
+                                + (required3 ? required3 + '、' : '')
+                                + (required4 ? required4 + '、' : '')
+                                + (required5 ? required5 + '、' : '')
+                requiredStr = requiredStr.substring(0,requiredStr.length - 1)
+                this.$toast.fail('请添加发票的[' + requiredStr + ']')
                 return
             }
             delete this.editForm.invoiceList

+ 77 - 19
fhKeeper/formulahousekeeper/timesheet_h5/src/views/expense/index.vue

@@ -37,6 +37,7 @@
                     type="date"
                     title="选择填报日期"
                     @confirm="createDateChange"
+                    v-model="currentDate1"
                     @cancel="createDateShow = false;$forceUpdate();"
                     :min-date="minDate"
                     :max-date="maxDate"/>
@@ -44,7 +45,7 @@
                 <!-- 发票张数 -->
                 <van-field label="发票张数">
                     <template #input>
-                        <van-stepper v-model="editForm.ticketNum"/>
+                        <van-stepper v-model="editForm.ticketNum" disable-input @plus="ticNumChange(1)" @minus="ticNumChange(0)"/>
                     </template>
                 </van-field>
                 <!-- 费用类型 -->
@@ -67,16 +68,16 @@
                 <div class="invoice" v-if="invoiceList.length != 0">
                     <div v-for="item,index in invoiceList" :key="item.id" style="position:relative" :class="index == 0 ? '' : 'invoice_item'">
                         <!-- <van-button class="deletebtn" size="mini" type="default" @click="deleteInvoice(index)">删除</van-button> -->
-                        <van-icon name="delete-o" class="deletebtn" @click="deleteInvoice(index)" />
-                        <van-field label="所属项目:" v-model="item.projectId" @click="in_projectShow = true,invoiceIndex = index" readonly clickable>
+                        <van-icon name="delete-o" class="deletebtn" v-if="index != 0" @click="deleteInvoice(index)" />
+                        <van-field label="所属项目:" v-model="item.projectId" @click="in_projectShow = true,invoiceIndex = index" readonly clickable required>
                             <template #input>{{formshowText.inProjectName[index]}}</template>
                         </van-field>
-                        <van-field label="费用日期:" v-model="item.happenDate" @click="in_dateShow = true,invoiceIndex = index" readonly clickable></van-field>
-                        <van-field label="发票种类:" v-model="item.invoiceType" @click="in_typeShow = true,invoiceIndex = index" readonly clickable>
+                        <van-field label="费用日期:" v-model="item.happenDate" @click="in_dateShow = true,invoiceIndex = index" readonly clickable required></van-field>
+                        <van-field label="发票种类:" v-model="item.invoiceType" @click="in_typeShow = true,invoiceIndex = index" readonly clickable required>
                             <template #input>{{inTypeList[item.invoiceType]}}</template>
                         </van-field>
-                        <van-field label="费用类型:" v-model="item.expenseType" @click="in_exTypeShow = true,invoiceIndex = index" readonly clickable></van-field>
-                        <van-field label="费用金额(含税):" v-model="item.amount" type="number" @input="costCount"></van-field>
+                        <van-field label="费用类型:" v-model="item.expenseType" @click="in_exTypeShow = true,invoiceIndex = index" readonly clickable required></van-field>
+                        <van-field label="费用金额(含税):" v-model="item.amount" type="number" @input="costCount" required></van-field>
                         <van-field label="发票号:" v-model="item.invoiceNo"></van-field>
                         <van-field label="税率%:" v-model="item.taxPercent"></van-field>
                         <van-field label="税额:" readonly>
@@ -108,6 +109,7 @@
                         type="date"
                         title="选择费用日期"
                         @confirm="inDateChange"
+                        v-model="currentDate2"
                         @cancel="in_dateShow = false;$forceUpdate();"
                         :min-date="minDate"
                         :max-date="maxDate"/>
@@ -234,6 +236,8 @@ export default {
             user: JSON.parse(localStorage.userInfo),
             userList: [],
             canExamine: false,
+            currentDate1: new Date(),
+            currentDate2: new Date(),
             minDate: new Date(2020,0,1),
             maxDate: new Date(2025,11,31),
 
@@ -258,18 +262,18 @@ export default {
             invoiceIndex: 0,
             totalCost: 0,
             invoiceList: [
-                // {
-                //     projectId: '',
-                //     happenDate: '',
-                //     invoiceType: '',
-                //     expenseType: '',
-                //     amount: '',
-                //     invoiceNo: '',
-                //     taxPercent: '',
-                //     taxValue: '',
-                //     remark: '',
-                //     pic: ''
-                // }
+                {
+                    projectId: '',
+                    happenDate: '',
+                    invoiceType: '',
+                    expenseType: '',
+                    amount: '',
+                    invoiceNo: '',
+                    taxPercent: '',
+                    taxValue: '',
+                    remark: '',
+                    pic: '',
+                }
             ],
             in_projectShow: false,
             in_dateShow: false,
@@ -380,6 +384,26 @@ export default {
             this.typeShow = false
             this.inexTypeList = this.allexTypeList.filter(a=>a.mainType == this.editForm.type)
         },
+        ticNumChange(value){
+            
+            if(value){
+                this.invoiceList.push({
+                    projectId: '',
+                    happenDate: '',
+                    invoiceType: '',
+                    expenseType: '',
+                    amount: '',
+                    invoiceNo: '',
+                    taxPercent: '',
+                    taxValue: '',
+                    remark: '',
+                    pic: '',
+                })
+            }else{
+                this.invoiceList.pop()
+            }
+            console.log(value,this.invoiceList);
+        },
 
         // 发票
         inProjectChange(value,key){
@@ -414,10 +438,12 @@ export default {
                 pic: '',
             })
             this.uploader.push([])
+            this.editForm.ticketNum = this.invoiceList.length
         },
         deleteInvoice(index){
             this.invoiceList.splice(index,1)
             this.uploader.splice(index,1)
+            this.editForm.ticketNum = this.invoiceList.length
         },
 
         // 上传报销凭证
@@ -453,6 +479,38 @@ export default {
                 this.$toast.fail('请选择填报日期')
                 return
             }
+            let required1 = false
+            let required2 = false
+            let required3 = false
+            let required4 = false
+            let required5 = false
+            for(let i in this.invoiceList){
+                if(!this.invoiceList[i].projectId){
+                    required1 = '所属项目'
+                }
+                if(!this.invoiceList[i].happenDate){
+                    required2 = '费用日期'
+                }
+                if(!this.invoiceList[i].invoiceType){
+                    required3 = '发票种类'
+                }
+                if(!this.invoiceList[i].expenseType){
+                    required4 = '费用类型'
+                }
+                if(!this.invoiceList[i].amount){
+                    required5 = '费用金额(含税)'
+                }
+            }
+            if(required1 || required2 || required3 || required4 || required5){
+                let requiredStr = (required1 ? required1 + '、' : '')
+                                + (required2 ? required2 + '、' : '')
+                                + (required3 ? required3 + '、' : '')
+                                + (required4 ? required4 + '、' : '')
+                                + (required5 ? required5 + '、' : '')
+                requiredStr = requiredStr.substring(0,requiredStr.length - 1)
+                this.$toast.fail('请添加发票的[' + requiredStr + ']')
+                return
+            }
             if(this.invoiceList.length == 0){
                 this.$toast.fail('请添加发票')
                 return

+ 19 - 11
fhKeeper/formulahousekeeper/timesheet_h5/src/views/index/index.vue

@@ -28,7 +28,8 @@
             return {
                 isCorpWX:false,
                 isWX:false,
-                user: JSON.parse(localStorage.userInfo),
+                // user: JSON.parse(localStorage.userInfo) || '',
+                user: '',
                 unreadNum:0,
                 images: [
                     // require('../../assets/img/index/banner_1.png'),
@@ -39,16 +40,19 @@
             };
         },
         created() {
+            if(localStorage.userInfo) {
+                this.user = JSON.parse(localStorage.userInfo)
+            }
         },
         mounted() {
             // 手机上看控制台
-            // if(this.user.companyName == '比基尼小镇'){
-                // let consoleScript = document.createElement("script");
-                // consoleScript.src = "https://cdn.bootcss.com/vConsole/3.3.4/vconsole.min.js";
-                // consoleScript.onload = function () {
-                //     new VConsole()
-                // }
-                // document.head.appendChild(consoleScript);
+            // if(this.user.companyId == '7'){
+            //     let consoleScript = document.createElement("script");
+            //     consoleScript.src = "https://cdn.bootcss.com/vConsole/3.3.4/vconsole.min.js";
+            //     consoleScript.onload = function () {
+            //         new VConsole()
+            //     }
+            //     document.head.appendChild(consoleScript);
             // }
             var ua = navigator.userAgent.toLowerCase();
             if (ua.indexOf("wxwork") > 0) {
@@ -60,7 +64,11 @@
             if (localStorage.userInfo != null) {
                 that.getAccountInfo();
             } else {
-                this.$router.push("/login");
+                if(window.location.href.indexOf('userId') != '-1') {
+                    that.getAccountInfo()
+                } else {
+                    this.$router.push("/login");
+                }
             }
            
         },
@@ -105,7 +113,7 @@
                         this.routers.push({name: '项目管理',url: '/project',icon: 'label-o'})
                     }
                     if(list[i].name == '导入日报审核') {
-                        this.routers.push({name: '导入日报审核',url: '/audit',icon: 'label-o'})
+                        this.routers.push({name: '导入日报审核',url: '/audit',icon: 'completed'})
                     }
                     if(list[i].name == '费用报销') {
                         this.routers.push({
@@ -218,7 +226,7 @@
                         this.user = res.data;
                         this.getModule()
                         this.getMessage();
-                        this.bindIfNessary();
+                        // this.bindIfNessary();
                     } 
                 }).catch(err=> {
                     alert('err=' + err);

+ 17 - 4
fhKeeper/formulahousekeeper/timesheet_h5/src/views/task/editask.vue

@@ -22,10 +22,11 @@
                     <van-datetime-picker
                     type="date"
                     title="选择开始时间"
+                    v-model="currentDate1"
                     @confirm="startDateChange"
                     @cancel="startDateShow = false;$forceUpdate();"
                     :min-date="minDate"
-                    :max-date="taskform.endDate ? new Date(taskform.endDate) : maxDate"/>
+                    :max-date="maxDate"/>
                 </van-popup>
                 <!-- 截止时间 -->
                 <van-field v-model="taskform.endDate" label="截止时间" placeholder="请选择截止时间" @click="endDateShow = true" readonly clickable></van-field>
@@ -33,9 +34,10 @@
                     <van-datetime-picker
                     type="date"
                     title="选择截止时间"
+                    v-model="currentDate2"
                     @confirm="endDateChange"
                     @cancel="endDateShow = false;$forceUpdate();"
-                    :min-date="taskform.startDate ? new Date(taskform.startDate) : minDate"
+                    :min-date="minDate"
                     :max-date="maxDate"/>
                 </van-popup>
                 <!-- 完成时间 -->
@@ -44,6 +46,7 @@
                     <van-datetime-picker
                     type="date"
                     title="选择完成时间"
+                    v-model="currentDate3"
                     @confirm="finishDateChange"
                     @cancel="finishDateShow = false;$forceUpdate();"
                     :min-date="minDate"
@@ -71,7 +74,6 @@
                     <div style="minHeight:300px;">
                         <van-radio-group v-model="executor.item">
                             <van-radio v-for="uitem in executor.searchList" :key="uitem.id" :name="uitem" style="padding:10px">
-                                <span>{{uitem.name}}</span>
                                 <span v-if="user.userNameNeedTranslate != 1">{{uitem.name}}</span>
                                 <span v-else><ww-open-data type='userName' :openid='uitem.name'></ww-open-data></span>
                             </van-radio>
@@ -114,6 +116,9 @@ export default {
             title: '编辑任务',
             user: JSON.parse(localStorage.userInfo),
             taskId: JSON.parse(sessionStorage.taskId),
+            currentDate1: new Date(),
+            currentDate2: new Date(),
+            currentDate3: new Date(),
             minDate: new Date(2020,0,1),
             maxDate: new Date(2025,11,31),
             canEdit: true,
@@ -285,7 +290,15 @@ export default {
                     this.taskform.createDate = null;
                     this.taskform.indate = null;
                     let projectManagement = false
-
+                    if(this.taskform.startDate){
+                        this.currentDate1 = new Date(this.taskform.startDate)
+                    }
+                    if(this.taskform.endDate){
+                        this.currentDate2 = new Date(this.taskform.endDate)
+                    }
+                    if(this.taskform.finishDate){
+                        this.currentDate3 = new Date(this.taskform.finishDate)
+                    }
                     // 判断编辑权限
                     for(let i in this.user.functionList){
                         if(this.user.functionList[i].name == '查看全部项目'){