Browse Source

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

 Conflicts:
	fhKeeper/formulahousekeeper/timesheet/src/views/corpreport/list.vue
cs 2 years ago
parent
commit
3b3854807a

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

@@ -104,7 +104,67 @@ public class ReportController {
         return msg;
         return msg;
     }
     }
 
 
+    /**
+     * 通过传入时间段来获取时长
+     * @return
+     */
+    @RequestMapping("/getHoursByTimeRange")
+    public HttpRespMsg getHoursByTimeRange(String timeJsonStr) {
+        String token = request.getHeader("TOKEN");
 
 
+        HttpRespMsg msg = new HttpRespMsg();
+        JSONArray array = JSONArray.parseArray(timeJsonStr);
+        List<WorktimeItem> worktimeItemList = new ArrayList<>();
+        for (int i = 0; i < array.size(); i++) {
+            JSONObject object = array.getJSONObject(i);
+            WorktimeItem worktimeItem = new WorktimeItem();
+            worktimeItem.setStartTime(object.getString("startTime"));
+            worktimeItem.setEndTime(object.getString("endTime"));
+            worktimeItemList.add(worktimeItem);
+        }
+        User user = userMapper.selectById(token);
+        List<TimeAutoExclude> excludeTimeList = timeAutoExcludeMapper.selectList(new QueryWrapper<TimeAutoExclude>().eq("company_id", user.getCompanyId()));
+
+        int totalMinutes = 0;
+        for (WorktimeItem worktimeItem : worktimeItemList) {
+            String startTime = worktimeItem.getStartTime();
+            String endTime = worktimeItem.getEndTime();
+            SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
+            long time = 0;
+            try {
+                time = sdf.parse(endTime).getTime() - sdf.parse(startTime).getTime();
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+            int excludeTime = 0;
+            if (excludeTimeList.size() > 0) {
+                for (TimeAutoExclude exclude : excludeTimeList) {
+                    if (!(exclude.getEndTime().compareTo(startTime) < 0 || exclude.getStartTime().compareTo(endTime) > 0)) {
+                        //有交叉的情况,结束时间取较早的,开始时间取较晚的
+                        String mEndTime = exclude.getEndTime().compareTo(endTime) <0 ? exclude.getEndTime() : endTime;
+                        String mStartTime = exclude.getStartTime().compareTo(startTime) > 0 ? exclude.getStartTime() : startTime;
+                        //落在休息时间范围内,需要计算去掉的时间
+                        long subtractTime = 0;
+                        try {
+                            subtractTime = sdf.parse(mEndTime).getTime() - sdf.parse(mStartTime).getTime();
+                        } catch (ParseException e) {
+                            e.printStackTrace();
+                        }
+                        excludeTime += subtractTime;
+                    }
+                }
+            }
+            if (excludeTime > 0) {
+                time -= excludeTime;//去掉休息时间
+            }
+            int minutes = (int)time/1000/60;
+            totalMinutes += minutes;
+        }
+        double hours = totalMinutes*1.0f/60;
+        DecimalFormat df = new DecimalFormat("0.00");
+        msg.data = df.format(hours);
+        return msg;
+    }
     /**
     /**
      * 根据时间 按照人分类 获取报告信息
      * 根据时间 按照人分类 获取报告信息
      * date 日期 格式yyyy-mm-dd
      * date 日期 格式yyyy-mm-dd

+ 7 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/TimeType.java

@@ -17,7 +17,7 @@ import lombok.experimental.Accessors;
  * </p>
  * </p>
  *
  *
  * @author Seyason
  * @author Seyason
- * @since 2023-04-12
+ * @since 2023-04-13
  */
  */
 @Data
 @Data
 @EqualsAndHashCode(callSuper = false)
 @EqualsAndHashCode(callSuper = false)
@@ -462,6 +462,12 @@ public class TimeType extends Model<TimeType> {
     @TableField("wait_check_alert_time")
     @TableField("wait_check_alert_time")
     private String waitCheckAlertTime;
     private String waitCheckAlertTime;
 
 
+    /**
+     * 0-否 1-是  是否开启简易费用报销
+     */
+    @TableField("easy_expense")
+    private Integer easyExpense;
+
 
 
     @Override
     @Override
     protected Serializable pkVal() {
     protected Serializable pkVal() {

+ 25 - 13
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -481,9 +481,11 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                         JSONArray array = JSONArray.parseArray(picStr.replaceAll("@", ","));
                         JSONArray array = JSONArray.parseArray(picStr.replaceAll("@", ","));
                         List<String> picList = new ArrayList<>();
                         List<String> picList = new ArrayList<>();
                         for (int i=0;i<array.size(); i++) {
                         for (int i=0;i<array.size(); i++) {
-                            String string = array.getString(i);
-                            string = "/upload/" + string + ".jpg";
-                            picList.add(string);
+                            String picName = array.getString(i);
+                            if (!picName.contains(".")) {
+                                picName += ".jpg";
+                            }
+                            picList.add("/upload/" + picName);
                         }
                         }
                         report.put("pics", picList);
                         report.put("pics", picList);
                     }
                     }
@@ -565,7 +567,11 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     JSONArray array = JSONArray.parseArray(r.getPicStr().replaceAll("@", ","));
                     JSONArray array = JSONArray.parseArray(r.getPicStr().replaceAll("@", ","));
                     List<String> list = new ArrayList<>();
                     List<String> list = new ArrayList<>();
                     for (int i=0;i<array.size(); i++) {
                     for (int i=0;i<array.size(); i++) {
-                        list.add("/upload/"+array.getString(i)+".jpg");
+                        String picName = array.getString(i);
+                        if (!picName.contains(".")) {
+                            picName += ".jpg";
+                        }
+                        list.add("/upload/"+picName);
                     }
                     }
                     r.setPics(list);
                     r.setPics(list);
                 }
                 }
@@ -1235,9 +1241,11 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                         JSONArray array = JSONArray.parseArray(picStr.replaceAll("@", ","));
                         JSONArray array = JSONArray.parseArray(picStr.replaceAll("@", ","));
                         List<String> picList = new ArrayList<>();
                         List<String> picList = new ArrayList<>();
                         for (int i=0;i<array.size(); i++) {
                         for (int i=0;i<array.size(); i++) {
-                            String string = array.getString(i);
-                            string = "/upload/" + string + ".jpg";
-                            picList.add(string);
+                            String picName = array.getString(i);
+                            if (!picName.contains(".")) {
+                                picName += ".jpg";
+                            }
+                            picList.add("/upload/" + picName);
                         }
                         }
                         report.put("pics", picList);
                         report.put("pics", picList);
                     }
                     }
@@ -3390,9 +3398,11 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                         JSONArray array = JSONArray.parseArray(picStr.replaceAll("@", ","));
                         JSONArray array = JSONArray.parseArray(picStr.replaceAll("@", ","));
                         List<String> picList = new ArrayList<>();
                         List<String> picList = new ArrayList<>();
                         for (int i=0;i<array.size(); i++) {
                         for (int i=0;i<array.size(); i++) {
-                            String string = array.getString(i);
-                            string = "/upload/" + string + ".jpg";
-                            picList.add(string);
+                            String picName = array.getString(i);
+                            if (!picName.contains(".")) {
+                                picName += ".jpg";
+                            }
+                            picList.add("/upload/" + picName);
                         }
                         }
                         report.put("pics", picList);
                         report.put("pics", picList);
                     }
                     }
@@ -3486,9 +3496,11 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                         JSONArray array = JSONArray.parseArray(picStr.replaceAll("@", ","));
                         JSONArray array = JSONArray.parseArray(picStr.replaceAll("@", ","));
                         List<String> picList = new ArrayList<>();
                         List<String> picList = new ArrayList<>();
                         for (int i=0;i<array.size(); i++) {
                         for (int i=0;i<array.size(); i++) {
-                            String string = array.getString(i);
-                            string = "/upload/" + string + ".jpg";
-                            picList.add(string);
+                            String picName = array.getString(i);
+                            if (!picName.contains(".")) {
+                                picName += ".jpg";
+                            }
+                            picList.add("/upload/" + picName);
                         }
                         }
                         report.put("pics", picList);
                         report.put("pics", picList);
                     }
                     }

File diff suppressed because it is too large
+ 2 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/TimeTypeMapper.xml


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

@@ -956,7 +956,7 @@
                     </span>
                     </span>
                   </template>
                   </template>
                 </el-table-column>
                 </el-table-column>
-                <el-table-column  prop="departmentName" :label="$t('departmentsuod')" >
+                <el-table-column  prop="departmentName" :label="$t('departmentsuod')" v-if="this.user.timeType.easyExpense==0">
                   <template slot-scope="scope" >
                   <template slot-scope="scope" >
                     <span v-if="user.userNameNeedTranslate == '1'">
                     <span v-if="user.userNameNeedTranslate == '1'">
                       <ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data>
                       <ww-open-data type='departmentName' :openid='scope.row.departmentName'></ww-open-data>
@@ -976,22 +976,22 @@
                   
                   
                 </el-table-column> -->
                 </el-table-column> -->
                 <el-table-column prop="expenseType" :label="$t('costtype')"></el-table-column>
                 <el-table-column prop="expenseType" :label="$t('costtype')"></el-table-column>
-                <el-table-column prop="invoiceType" :label="$t('ppertype')">
+                <el-table-column prop="invoiceType" :label="$t('ppertype')" v-if="this.user.timeType.easyExpense==0">
                   <template slot-scope="scope">
                   <template slot-scope="scope">
                     {{scope.row.invoiceType == null?'':(scope.row.invoiceType == 0 ? '增值税专用发票' : '增值税普通发票')}}
                     {{scope.row.invoiceType == null?'':(scope.row.invoiceType == 0 ? '增值税专用发票' : '增值税普通发票')}}
                   </template>
                   </template>
                 </el-table-column>
                 </el-table-column>
-                <el-table-column prop="amount" :label="$t('amountof')+'('+ $t('tax') +')'">
+                <el-table-column prop="amount" :label="this.user.timeType.easyExpense==0?$t('amountof')+'('+ $t('tax') +')': $t('amountof')"   align="right">
                   <template slot-scope="scope">
                   <template slot-scope="scope">
                         {{scope.row.amount}}
                         {{scope.row.amount}}
                     </template>
                     </template>
                 </el-table-column>
                 </el-table-column>
-                <el-table-column prop="amount" :label="$t('taxs')">
+                <el-table-column prop="amount" :label="$t('taxs')"   align="right" v-if="this.user.timeType.easyExpense==0">
                   <template slot-scope="scope">
                   <template slot-scope="scope">
                         {{scope.row.taxValue == null?'0.00':scope.row.taxValue.toFixed(2)}}
                         {{scope.row.taxValue == null?'0.00':scope.row.taxValue.toFixed(2)}}
                     </template>
                     </template>
                 </el-table-column>
                 </el-table-column>
-                <el-table-column prop="amount" :label="$t('amountof')+'('+ $t('notax') +')'">
+                <el-table-column prop="amount" :label="$t('amountof')+'('+ $t('notax') +')'"   align="right" v-if="this.user.timeType.easyExpense==0">
                   <template slot-scope="scope">
                   <template slot-scope="scope">
                         {{(scope.row.amount-scope.row.taxValue).toFixed(2)}}
                         {{(scope.row.amount-scope.row.taxValue).toFixed(2)}}
                     </template>
                     </template>

+ 13 - 13
fhKeeper/formulahousekeeper/timesheet/src/views/expense/expense.vue

@@ -81,7 +81,7 @@
               </el-col>
               </el-col>
             </el-form-item>
             </el-form-item>
             <!-- 发票张数 -->
             <!-- 发票张数 -->
-            <el-form-item :label="$t('invoicenumber')">
+            <el-form-item :label="$t('invoicenumber')" v-if="this.user.timeType.easyExpense==0">
               <el-input v-model="addForm.ticketNum" style="width: 150px"></el-input>
               <el-input v-model="addForm.ticketNum" style="width: 150px"></el-input>
             </el-form-item>
             </el-form-item>
             <!-- 费用主类型 -->
             <!-- 费用主类型 -->
@@ -139,7 +139,7 @@
                 </el-date-picker>
                 </el-date-picker>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
-            <el-table-column :label="$t('invoices')" width="175px">
+            <el-table-column :label="$t('invoices')" width="175px" v-if="this.user.timeType.easyExpense==0">
               <template slot-scope="scope">
               <template slot-scope="scope">
                 <el-select size="small" v-model="scope.row.invoiceType" :placeholder="$t('pleaseselectthetypeoffee')" style="width: 150px;">
                 <el-select size="small" v-model="scope.row.invoiceType" :placeholder="$t('pleaseselectthetypeoffee')" style="width: 150px;">
                   <el-option :label="$t('vATspecialinvoice')" value="0"></el-option>
                   <el-option :label="$t('vATspecialinvoice')" value="0"></el-option>
@@ -154,22 +154,22 @@
                 </el-select>
                 </el-select>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
-            <el-table-column :label="$t('amountoffees')" width="135px">
+            <el-table-column :label="this.user.timeType.easyExpense==0?$t('amountoffees'):'费用金额'" width="135px">
               <template slot-scope="scope">
               <template slot-scope="scope">
                 <el-input size="small" :id="'upam'+scope.$index" v-model="scope.row.amount" @input="zhi(scope.$index)" @change="shiqu(scope.row.amount)" @keyup.native="restrictNumber('upam'+scope.$index)"></el-input>
                 <el-input size="small" :id="'upam'+scope.$index" v-model="scope.row.amount" @input="zhi(scope.$index)" @change="shiqu(scope.row.amount)" @keyup.native="restrictNumber('upam'+scope.$index)"></el-input>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
-            <el-table-column prop="invoiceNo" :label="$t('invoiceno')" width="135px">
+            <el-table-column prop="invoiceNo" :label="$t('invoiceno')" width="135px" v-if="this.user.timeType.easyExpense==0">
               <template slot-scope="scope">
               <template slot-scope="scope">
                 <el-input size="small" v-model.number="scope.row.invoiceNo"></el-input>
                 <el-input size="small" v-model.number="scope.row.invoiceNo"></el-input>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
-            <el-table-column :label="$t('shui-shuai')" width="135px">
+            <el-table-column :label="$t('shui-shuai')" width="135px" v-if="this.user.timeType.easyExpense==0">
               <template slot-scope="scope">
               <template slot-scope="scope">
                 <el-input size="small" type= "number"  v-model="scope.row.taxPercent" @input="zhi(scope.$index)"></el-input>
                 <el-input size="small" type= "number"  v-model="scope.row.taxPercent" @input="zhi(scope.$index)"></el-input>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
-            <el-table-column :label="$t('taxs')" width="135px">
+            <el-table-column :label="$t('taxs')" width="135px" v-if="this.user.timeType.easyExpense==0">
               <template slot-scope="scope">
               <template slot-scope="scope">
                 <el-input size="small" v-model="scope.row.taxValue" @input="zhis(scope.$index)"></el-input>
                 <el-input size="small" v-model="scope.row.taxValue" @input="zhis(scope.$index)"></el-input>
               </template>
               </template>
@@ -280,8 +280,8 @@
                 </template>
                 </template>
               </el-table-column>
               </el-table-column>
               <el-table-column prop="createDate" :label="$t('fillinthedate')" ></el-table-column>
               <el-table-column prop="createDate" :label="$t('fillinthedate')" ></el-table-column>
-              <el-table-column prop="ticketNum" :label="$t('invoicenumber')" ></el-table-column>
-              <el-table-column prop="type" :label="$t('ppertype')" >
+              <el-table-column prop="ticketNum" :label="$t('invoicenumber')" v-if="this.user.timeType.easyExpense==0"></el-table-column>
+              <el-table-column prop="type" :label="$t('ppertype')" v-if="this.user.timeType.easyExpense==0">
                 <template slot-scope="scope">
                 <template slot-scope="scope">
                   {{scope.row.expenseMainTypeName}}
                   {{scope.row.expenseMainTypeName}}
                 </template>
                 </template>
@@ -410,7 +410,7 @@
                 <span v-else>{{scope.row.happenDate}}</span>
                 <span v-else>{{scope.row.happenDate}}</span>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
-            <el-table-column prop="invoiceType" :label="$t('invoices')" width="172">
+            <el-table-column prop="invoiceType" :label="$t('invoices')" width="172" v-if="this.user.timeType.easyExpense==0">
               <template slot-scope="scope">
               <template slot-scope="scope">
                 <el-select size="small" v-if="!flg" v-model="scope.row.invoiceType" :placeholder="$t('pleaseselectthetypeoffee')" style="width: 150px;">
                 <el-select size="small" v-if="!flg" v-model="scope.row.invoiceType" :placeholder="$t('pleaseselectthetypeoffee')" style="width: 150px;">
                   <el-option :label="$t('vATspecialinvoice')" :value="0"></el-option>
                   <el-option :label="$t('vATspecialinvoice')" :value="0"></el-option>
@@ -427,25 +427,25 @@
                 <span v-else>{{scope.row.expenseType}}</span>
                 <span v-else>{{scope.row.expenseType}}</span>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
-            <el-table-column prop="amount" :label="$t('amountoffees')" width="172">
+            <el-table-column prop="amount" :label="this.user.timeType.easyExpense==0?$t('amountoffees'):'费用金额'" width="172">
               <template slot-scope="scope">
               <template slot-scope="scope">
                 <el-input size="small"  v-if="!flg" :id="'am'+scope.$index" v-model="scope.row.amount" @input="zhiNum(scope.$index, scope)" @change="kan" @keyup.native="restrictNumber('am'+scope.$index)"></el-input>
                 <el-input size="small"  v-if="!flg" :id="'am'+scope.$index" v-model="scope.row.amount" @input="zhiNum(scope.$index, scope)" @change="kan" @keyup.native="restrictNumber('am'+scope.$index)"></el-input>
                 <span v-else>¥{{scope.row.amount}}</span>
                 <span v-else>¥{{scope.row.amount}}</span>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
-            <el-table-column prop="invoiceNo" :label="$t('invoiceno')" width="172">
+            <el-table-column prop="invoiceNo" :label="$t('invoiceno')" width="172" v-if="this.user.timeType.easyExpense==0">
               <template slot-scope="scope">
               <template slot-scope="scope">
                 <el-input size="small" v-if="!flg" v-model.number="scope.row.invoiceNo"></el-input>
                 <el-input size="small" v-if="!flg" v-model.number="scope.row.invoiceNo"></el-input>
                 <span v-else>{{scope.row.invoiceNo}}</span>
                 <span v-else>{{scope.row.invoiceNo}}</span>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
-            <el-table-column prop="taxPercent" :label="$t('shui-shuai')" width="172">
+            <el-table-column prop="taxPercent" :label="$t('shui-shuai')" width="172" v-if="this.user.timeType.easyExpense==0">
               <template slot-scope="scope">
               <template slot-scope="scope">
                 <el-input size="small"  v-if="!flg" v-model="scope.row.taxPercent" @input="zhiNum(scope.$index, scope)"></el-input>
                 <el-input size="small"  v-if="!flg" v-model="scope.row.taxPercent" @input="zhiNum(scope.$index, scope)"></el-input>
                 <span v-else>{{scope.row.taxPercent}}</span>
                 <span v-else>{{scope.row.taxPercent}}</span>
               </template>
               </template>
             </el-table-column>
             </el-table-column>
-            <el-table-column prop="taxValue" :label="$t('taxs')+'('+$t('yuan')+')'" width="172">
+            <el-table-column prop="taxValue" :label="$t('taxs')+'('+$t('yuan')+')'" width="172" v-if="this.user.timeType.easyExpense==0">
               <template slot-scope="scope">
               <template slot-scope="scope">
                 <el-input size="small"  v-if="!flg" v-model="scope.row.taxValue"></el-input>
                 <el-input size="small"  v-if="!flg" v-model="scope.row.taxValue"></el-input>
                 <span v-else>¥{{scope.row.taxValue}}</span>
                 <span v-else>¥{{scope.row.taxValue}}</span>

+ 118 - 67
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -590,15 +590,17 @@
                             :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
                             :disabled="workForm.domains.length==0?true:(workForm.domains[index].state>=2?false:true)"></el-input>
                         </el-form-item>
                         </el-form-item>
                         <!-- 拍照上传 -->
                         <!-- 拍照上传 -->
-                        <el-form-item label="图片上传" v-if="user.companyId == '7' || user.companyId == '10'">
+                        <el-form-item label="图片上传" v-if="user.timeType.choseFromAlbum == 1">
                             <div class="photos">
                             <div class="photos">
-                                <div class="photos_img" v-for="(p, ip) in domain.pics" :key="ip">
-                                    <img
-                                        style="width: 120px; height: 120px; margin-right:10px;"
-                                        :src="p" />
-                                </div>
-                                <div @click="addImg(index)" class="photos_img">
-                                    <img src="../../assets/image/aacbc.png" />
+                                <div>
+                                    <el-upload
+                                        list-type="picture-card"
+                                        :http-request="(file) => {return addImg(file, index)}"
+                                        :on-preview="(file) => {return handlePictureCardPreview(file, index)}"
+                                        :before-remove="(file, fileList) => {return delImg(file, fileList, index)}"
+                                        :file-list="domain.imgListUrl" :limit="9">
+                                        <i class="el-icon-plus"></i>
+                                    </el-upload>
                                 </div>
                                 </div>
                             </div>
                             </div>
                         </el-form-item>
                         </el-form-item>
@@ -769,8 +771,9 @@
                                 :src="pic" 
                                 :src="pic" 
                                 :preview-src-list="domain.pics">
                                 :preview-src-list="domain.pics">
                             </el-image>
                             </el-image>
-                        </p> -->
-                        <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider>
+                        </p>
+                        <el-divider v-if="workForm.domains.length>1" style="margin-bottom:10px;"></el-divider> -->
+
                     </div>
                     </div>
                     <span id="workFormsItemBottom"></span>
                     <span id="workFormsItemBottom"></span>
                     <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
                     <el-link v-if="showAddMore" type="primary" :underline="false" @click="addDomain(reportTimeType.type)" style="margin-left:40px;">{{$t('other.addMore')}}</el-link>
@@ -2014,7 +2017,6 @@
                             console.log('进一')
                             console.log('进一')
                             for(let m in domains[i].worktimeList){
                             for(let m in domains[i].worktimeList){
                                 if(domains[i].worktimeList[m].startTime && domains[i].worktimeList[m].endTime){
                                 if(domains[i].worktimeList[m].startTime && domains[i].worktimeList[m].endTime){
-                                    // hours += this.getHour(domains[i].worktimeList[m].startTime, domains[i].worktimeList[m].endTime)
                                     let selectionTime = this.getHour(domains[i].worktimeList[m].startTime, domains[i].worktimeList[m].endTime)
                                     let selectionTime = this.getHour(domains[i].worktimeList[m].startTime, domains[i].worktimeList[m].endTime)
                                     let subtractedData = 0
                                     let subtractedData = 0
                                     console.log(selectionTime)
                                     console.log(selectionTime)
@@ -2031,7 +2033,6 @@
                             }
                             }
                         }else{
                         }else{
                             if(this.user.timeType.type == 2){
                             if(this.user.timeType.type == 2){
-                            console.log('进2')
                                 if(domains[i].startTime && domains[i].endTime){
                                 if(domains[i].startTime && domains[i].endTime){
                                     // let selectionTime = this.getHourMinutes(domains[i].startTime, domains[i].endTime)
                                     // let selectionTime = this.getHourMinutes(domains[i].startTime, domains[i].endTime)
                                     let selectionTime = this.getHour(domains[i].startTime, domains[i].endTime)
                                     let selectionTime = this.getHour(domains[i].startTime, domains[i].endTime)
@@ -2047,7 +2048,6 @@
                                     // hours += this.getHour(domains[i].startTime, domains[i].endTime)
                                     // hours += this.getHour(domains[i].startTime, domains[i].endTime)
                                 }
                                 }
                             }else{
                             }else{
-                            console.log('进3')
                                 hours += domains[i].workingTime ? parseFloat(domains[i].workingTime) : 0
                                 hours += domains[i].workingTime ? parseFloat(domains[i].workingTime) : 0
                             }
                             }
                         }
                         }
@@ -2118,58 +2118,58 @@
                     })
                     })
                 })
                 })
             },
             },
+            handlePictureCardPreview(file, index) {
+                console.log(file, index)
+                let arr = []
+                let imgArr = this.workForm.domains[index].imgListUrl
+                for(var i in imgArr) {
+                    arr.push(imgArr[i].url)
+                }
+                console.log(arr, '图片数据')
+                const $viewer = this.$viewerApi({
+                    images: arr
+                });
+
+            },
             // 图片上传
             // 图片上传
-            addImg(index) {
-                var that = this;
-                // if (that.workForm.domains[index].pics == null) {
-                //     that.workForm.domains[index].pics = [];
-                //     that.workForm.domains[index].iospics = [];
-                // }
-                // that.workForm.domains[index].pics.push('wxLocalResource://imageidQzpcVXNlcnNcTEpZXERlc2t0b3Bc5oG25pCe5Zu+54mHXGhwLmpwZw==')
-                // console.log(that.workForm.domains)
-                wx.chooseImage({
-                    count: 3, // 默认9
-                    sizeType: ['compressed'],
-                    sourceType: ['album'],
-                    defaultCameraMode: "batch",
-                    success: function (res) {
-                        console.log(res, '数据')
-                        var localIds = res.localIds;
-                        wx.getLocalImgData({
-                            localId: localIds[0], // 图片的localID
-                            success: function (res) {
-                                var localData = res.localData;
-                                console.log('转之后的', localData, res)
-                                if (that.workForm.domains[index].pics == null) {
-                                    that.workForm.domains[index].pics = [];
-                                    that.workForm.domains[index].iospics = [];
-                                }
-                                if (that.user.companyId == 7) {
-                                    that.workForm.domains[index].pics = that.workForm.domains[index].pics.concat(localData); 
-                                } else {
-                                    that.workForm.domains[index].pics = localData;
-                                }
-                                that.$forceUpdate(); 
-                                if (that.workForm.domains[index].serverPics == null) {
-                                    that.workForm.domains[index].serverPics = [];
-                                }
-                                for (var i=0;i<localIds.length; i++) {
-                                    wx.uploadImage({
-                                        localId: localIds[i], // 需要上传的图片的本地ID,由chooseImage接口获得
-                                        isShowProgressTips: 1, // 默认为1,显示进度提示
-                                        success: function (res) {
-                                            var serverId = res.serverId; // 返回图片的服务器端ID
-                                            that.workForm.domains[index].serverPics.push(serverId);
-
-                                            console.log(that.workForm.domains, '数据')
-                                        }
-                                    });
-                                }
-                            }
+            addImg(e, index) {
+                console.log(e, '数据')
+                let formData = new FormData()
+                formData.append('multipartFile', e.file)
+                this.http.uploadFile('/common/uploadFile', formData,
+                res => {
+                    if (res.code == "ok") {
+                        this.$message({
+                            message: this.$t('uploadedsuccessfully'),
+                            type: "success"
                         });
                         });
-                        
+                        if(!this.workForm.domains[index].imgList) {
+                            this.workForm.domains[index].imgList = []
+                            this.workForm.domains[index].imgListUrl = []
+                        }
+                        this.workForm.domains[index].imgList.push(res.data)
+                        this.workForm.domains[index].imgListUrl.push({ name: '990' ,url: '/upload/' + res.data})
+                    } else {
+                        this.$message({message: res.msg,type: "error"});
                     }
                     }
-                })
+                    console.log(this.workForm.domains[index])
+                },
+                error => {this.$message({message: error,type: "error"});
+                });
+            },
+
+            // 删除图片
+            delImg(file,fileList, index) {
+                console.log(file, fileList)
+                let idx = 0
+                for(let i in fileList) {
+                    if(fileList[i].uid == file.uid) {
+                        idx = i
+                    }
+                }
+                this.workForm.domains[index].imgList.splice(idx, 1)
+                this.workForm.domains[index].imgListUrl.splice(idx, 1)
+                console.log(this.workForm.domains[index])
             },
             },
             test(){
             test(){
                 console.log('test',this.workForm.domains);
                 console.log('test',this.workForm.domains);
@@ -2777,15 +2777,16 @@
                 var sl = this.workForm.domains
                 var sl = this.workForm.domains
                 var quanbu = 0 
                 var quanbu = 0 
                 var zhi = ''
                 var zhi = ''
+                let timeArr = []
                 for(var i in sl) {
                 for(var i in sl) {
                     for(var j in sl[i].worktimeList){
                     for(var j in sl[i].worktimeList){
                         let addUp = 0
                         let addUp = 0
                         if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
                         if(sl[i].worktimeList[j].startTime && sl[i].worktimeList[j].endTime) {
                             let selectionTime = this.getHour(sl[i].worktimeList[j].startTime, sl[i].worktimeList[j].endTime)
                             let selectionTime = this.getHour(sl[i].worktimeList[j].startTime, sl[i].worktimeList[j].endTime)
                             let subtractedData = 0
                             let subtractedData = 0
-                            console.log(selectionTime)
                             let arr = JSON.parse(JSON.stringify(this.vacationTime))
                             let arr = JSON.parse(JSON.stringify(this.vacationTime))
                             arr.unshift({s: sl[i].worktimeList[j].startTime, e: sl[i].worktimeList[j].endTime})
                             arr.unshift({s: sl[i].worktimeList[j].startTime, e: sl[i].worktimeList[j].endTime})
+                            timeArr.push({startTime: sl[i].worktimeList[j].startTime, endTime: sl[i].worktimeList[j].endTime})
                             for(var j in arr) {
                             for(var j in arr) {
                                 subtractedData += +this.timeOverlap(j, arr)
                                 subtractedData += +this.timeOverlap(j, arr)
                             }
                             }
@@ -2800,8 +2801,21 @@
                         }
                         }
                     }
                     }
                 }
                 }
-                // this.jsTime = quanbu
                 this.$set(this, 'jsTime', quanbu)
                 this.$set(this, 'jsTime', quanbu)
+                this.getTimeHours(timeArr)
+            },
+            // 调用接口或去数据
+            getTimeHours(arr) {
+                this.http.post('/report/getHoursByTimeRange',{
+                    timeJsonStr: JSON.stringify(arr)
+                },res => {
+                    this.$set(this, 'jsTime', res.data)
+                },err => {
+                    this.$message({
+                        message: err,
+                        type: 'error'
+                    })
+                })
             },
             },
             removeTimeItem(item, index) {
             removeTimeItem(item, index) {
                 item.worktimeList.splice(index, 1);
                 item.worktimeList.splice(index, 1);
@@ -4702,6 +4716,19 @@
                                 if (list.report[i].state == 0){
                                 if (list.report[i].state == 0){
                                     this.canCancelInDialog = true
                                     this.canCancelInDialog = true
                                 }
                                 }
+                                // 加判断
+                                if(this.user.timeType.choseFromAlbum == 1) {
+                                    let arrList = []
+                                    for(var k in list.report[i].pics) {
+                                        let obj = {
+                                            name: k,
+                                            url: list.report[i].pics[k]
+                                        }
+                                        arrList.push(obj)
+                                    }
+                                    arr[i].imgListUrl = arrList
+                                    arr[i].imgList = list.report[i].pics
+                                }
                             }
                             }
                             this.reportCanDelete = candelete
                             this.reportCanDelete = candelete
                             this.workForm = {
                             this.workForm = {
@@ -4711,6 +4738,7 @@
                                 userId:null,
                                 userId:null,
                                 time: list.time
                                 time: list.time
                             }
                             }
+                            console.log('workForm', this.workForm)
                         } else {
                         } else {
                             this.workForm = {
                             this.workForm = {
                                 createDate: this.workForm.createDate,
                                 createDate: this.workForm.createDate,
@@ -5315,7 +5343,6 @@
                         if (((dateAr[k].s <= dateAr[idx].s && dateAr[k].e >= dateAr[idx].s) || (dateAr[k].s <= dateAr[idx].s && dateAr[k].e <= dateAr[idx].e))) {
                         if (((dateAr[k].s <= dateAr[idx].s && dateAr[k].e >= dateAr[idx].s) || (dateAr[k].s <= dateAr[idx].s && dateAr[k].e <= dateAr[idx].e))) {
                             // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
                             // 选择的时间包含设置的休息时间段 (选择的开始时间和结束时间大于设置的休息时间段)
                             if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
                             if(dateAr[idx].s > dateAr[k].s && dateAr[idx].e < dateAr[k].e) {
-                                // zhi += 2
                                 zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
                                 zhi += +this.getHour(dateAr[idx].s, dateAr[idx].e)
                             }
                             }
                             // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
                             // 选择的时间包含在设置的休息时间 (选择的开始时间和结束时间都处于在设置的休息时间段内)
@@ -6020,8 +6047,13 @@
                 this.isDraft = isDraft;
                 this.isDraft = isDraft;
                 this.$refs.workForm.validate(valid => {
                 this.$refs.workForm.validate(valid => {
                     if (valid) {
                     if (valid) {
-                        
-                if(this.totalReportHours < this.user.timeType.allday){
+                        var timesHours = 0
+                        if(this.reportTimeType.multiWorktime == 1) {
+                            timesHours = this.totalReportHours
+                        } else {
+                            timesHours = jsTime
+                        }
+                if(timesHours < this.user.timeType.allday){
                     this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
                     this.$confirm('当日工时不足' + this.user.timeType.allday.toFixed(1) + '小时,是否确定提交?', '提示', {
                         confirmButtonText: '确定',
                         confirmButtonText: '确定',
                         cancelButtonText: '取消',
                         cancelButtonText: '取消',
@@ -6306,6 +6338,20 @@
                                 formData.append("progress", this.workForm.domains[i].progress);
                                 formData.append("progress", this.workForm.domains[i].progress);
                                 formData.append("workingTime", this.workForm.domains[i].workingTime);
                                 formData.append("workingTime", this.workForm.domains[i].workingTime);
                             }
                             }
+
+                            if(this.user.timeType.choseFromAlbum == 1 ) {
+                                console.log(this.workForm.domains[i].imgList)
+                                if(this.workForm.domains[i].imgList) {
+                                    let imgListFor = this.workForm.domains[i].imgList
+                                    for(var b in imgListFor) {
+                                        imgListFor[b] = imgListFor[b].replace('/upload/', '')
+                                    }
+                                    console.log(imgListFor)
+                                    let m = JSON.stringify(imgListFor);
+                                    m = m.replace(/,/g,"@");//replaceAll(',','@');企业微信不兼容replaceAll
+                                    formData.append("picStr", m);
+                                }
+                            }
                             
                             
                             
                             
                             //处理多个时间事项
                             //处理多个时间事项
@@ -6867,6 +6913,10 @@
 </style>
 </style>
 
 
 <style lang="scss">
 <style lang="scss">
+/*去除upload组件过渡效果*/
+.photos .el-upload-list__item {
+  transition: none !important;
+}
     .daily {
     .daily {
         .el-card__body {
         .el-card__body {
             height: 80%;
             height: 80%;
@@ -6898,6 +6948,7 @@
 </style>
 </style>
 
 
 <style scoped>
 <style scoped>
+
 /* 项目标签的样式 */
 /* 项目标签的样式 */
     .el-tag + .el-tag {
     .el-tag + .el-tag {
         margin-left: 10px;
         margin-left: 10px;

+ 7 - 3
fhKeeper/formulahousekeeper/timesheet_h5/src/views/expense/details.vue

@@ -51,7 +51,7 @@
                 />
                 />
             </van-popup>
             </van-popup>
             <!-- 发票张数 -->
             <!-- 发票张数 -->
-            <van-field label="发票张数" :readonly="!canEdit">
+            <van-field label="发票张数" :readonly="!canEdit" v-if="user.timeType.easyExpense==0">
                 <template #input>
                 <template #input>
                     <van-stepper v-model="editForm.ticketNum" :disabled="!canEdit" disable-input @plus="ticNumChange(1)" @minus="ticNumChange(0)" />
                     <van-stepper v-model="editForm.ticketNum" :disabled="!canEdit" disable-input @plus="ticNumChange(1)" @minus="ticNumChange(0)" />
                 </template>
                 </template>
@@ -115,6 +115,7 @@
                         readonly
                         readonly
                         clickable
                         clickable
                         required
                         required
+                        v-if="user.timeType.easyExpense==0"
                     >
                     >
                         <template #input>{{
                         <template #input>{{
                             inTypeList[item.invoiceType]
                             inTypeList[item.invoiceType]
@@ -129,7 +130,7 @@
                         required
                         required
                     ></van-field>
                     ></van-field>
                     <van-field
                     <van-field
-                        label="费用金额(含税):"
+                        :label="`${user.timeType.easyExpense==0?'费用金额(含税)':'费用金额'}`"
                         v-model="item.amount"
                         v-model="item.amount"
                         type="number"
                         type="number"
                         :readonly="!canEdit"
                         :readonly="!canEdit"
@@ -139,15 +140,18 @@
                         label="发票号:"
                         label="发票号:"
                         v-model="item.invoiceNo"
                         v-model="item.invoiceNo"
                         readonly
                         readonly
+                        v-if="user.timeType.easyExpense==0"
                     ></van-field>
                     ></van-field>
                     <van-field
                     <van-field
                         label="税率%:"
                         label="税率%:"
                         v-model="item.taxPercent"
                         v-model="item.taxPercent"
                         :readonly="!canEdit"
                         :readonly="!canEdit"
+                        v-if="user.timeType.easyExpense==0"
                     ></van-field>
                     ></van-field>
                     <van-field
                     <van-field
                         label="税额:"
                         label="税额:"
                         readonly
                         readonly
+                        v-if="user.timeType.easyExpense==0"
                     ><template #input>¥{{getTaxValue(item.amount,item.taxPercent)}}</template></van-field>
                     ><template #input>¥{{getTaxValue(item.amount,item.taxPercent)}}</template></van-field>
                     <van-field label="备注:" v-model="item.remark" :readonly="!canEdit"></van-field>
                     <van-field label="备注:" v-model="item.remark" :readonly="!canEdit"></van-field>
                     <van-field
                     <van-field
@@ -201,7 +205,7 @@
                     />
                     />
                 </van-popup>
                 </van-popup>
                 <!-- 发票种类 -->
                 <!-- 发票种类 -->
-                <van-popup v-model="in_typeShow" position="bottom" v-if="canEdit">
+                <van-popup v-model="in_typeShow" position="bottom" v-if="canEdit && user.timeType.easyExpense==0" >
                     <van-picker
                     <van-picker
                         show-toolbar
                         show-toolbar
                         :columns="inTypeList"
                         :columns="inTypeList"

+ 14 - 13
fhKeeper/formulahousekeeper/timesheet_h5/src/views/expense/index.vue

@@ -41,7 +41,7 @@
                             @cancel="createDateShow = false; $forceUpdate();" :min-date="minDate" :max-date="maxDate" />
                             @cancel="createDateShow = false; $forceUpdate();" :min-date="minDate" :max-date="maxDate" />
                     </van-popup>
                     </van-popup>
                     <!-- 发票张数 -->
                     <!-- 发票张数 -->
-                    <van-field label="发票张数">
+                    <van-field label="发票张数" v-if="user.timeType.easyExpense==0">
                         <template #input>
                         <template #input>
                             <van-stepper v-model="editForm.ticketNum" disable-input @plus="ticNumChange(1)"
                             <van-stepper v-model="editForm.ticketNum" disable-input @plus="ticNumChange(1)"
                                 @minus="ticNumChange(0)" />
                                 @minus="ticNumChange(0)" />
@@ -72,16 +72,16 @@
                             </van-field>
                             </van-field>
                             <van-field label="费用日期:" v-model="item.happenDate"
                             <van-field label="费用日期:" v-model="item.happenDate"
                                 @click="in_dateShow = true, invoiceIndex = index" readonly clickable required></van-field>
                                 @click="in_dateShow = true, invoiceIndex = index" readonly clickable required></van-field>
-                            <van-field label="发票种类:" v-model="item.invoiceType"
+                            <van-field label="发票种类:" v-model="item.invoiceType" v-if="user.timeType.easyExpense==0"
                                 @click="in_typeShow = true, invoiceIndex = index" readonly clickable required>
                                 @click="in_typeShow = true, invoiceIndex = index" readonly clickable required>
                                 <template #input>{{ inTypeList[item.invoiceType] }}</template>
                                 <template #input>{{ inTypeList[item.invoiceType] }}</template>
                             </van-field>
                             </van-field>
                             <van-field label="费用类型:" v-model="item.expenseType"
                             <van-field label="费用类型:" v-model="item.expenseType"
                                 @click="in_exTypeShow = true, invoiceIndex = index" readonly clickable required></van-field>
                                 @click="in_exTypeShow = true, invoiceIndex = index" readonly clickable required></van-field>
-                            <van-field label="费用金额(含税):" v-model="item.amount" type="number" 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>
+                            <van-field :label="`${user.timeType.easyExpense==0?'费用金额(含税)':'费用金额'}`" v-model="item.amount" type="number" required></van-field>
+                            <van-field label="发票号:" v-model="item.invoiceNo" v-if="user.timeType.easyExpense==0"></van-field>
+                            <van-field label="税率%:" v-model="item.taxPercent" v-if="user.timeType.easyExpense==0"></van-field>
+                            <van-field label="税额:" readonly v-if="user.timeType.easyExpense==0">
                                 <template #input>¥{{ getTaxValue(item.amount, item.taxPercent) }}</template>
                                 <template #input>¥{{ getTaxValue(item.amount, item.taxPercent) }}</template>
                             </van-field>
                             </van-field>
                             <van-field label="备注:" v-model="item.remark" autosize></van-field>
                             <van-field label="备注:" v-model="item.remark" autosize></van-field>
@@ -156,7 +156,7 @@
                                 <span v-else>{{ item.ownerName }}</span>
                                 <span v-else>{{ item.ownerName }}</span>
                             </div>
                             </div>
                             <div><span>填报日期:</span><span>{{ item.createDate }}</span></div>
                             <div><span>填报日期:</span><span>{{ item.createDate }}</span></div>
-                            <div><span>发票张数:</span><span>{{ item.ticketNum }}</span></div>
+                            <div v-if="user.timeType.easyExpense==0"><span>发票张数:</span><span>{{ item.ticketNum }}</span></div>
                             <div><span>费用类型:</span><span>{{ item.expenseMainTypeName }}</span></div>
                             <div><span>费用类型:</span><span>{{ item.expenseMainTypeName }}</span></div>
                             <!-- <div><span>状态:</span><span>{{item.status}}</span></div> -->
                             <!-- <div><span>状态:</span><span>{{item.status}}</span></div> -->
                             <!-- <div><span>驳回原因:</span><span>{{item.denyReason}}</span></div> -->
                             <!-- <div><span>驳回原因:</span><span>{{item.denyReason}}</span></div> -->
@@ -203,7 +203,7 @@
                                 <span v-else>{{ item.ownerName }}</span>
                                 <span v-else>{{ item.ownerName }}</span>
                             </div>
                             </div>
                             <div><span>填报日期:</span><span>{{ item.createDate }}</span></div>
                             <div><span>填报日期:</span><span>{{ item.createDate }}</span></div>
-                            <div><span>发票张数:</span><span>{{ item.ticketNum }}</span></div>
+                            <div v-if="user.timeType.easyExpense==0"><span>发票张数:</span><span>{{ item.ticketNum }}</span></div>
                             <div><span>费用类型:</span><span>{{ item.expenseMainTypeName }}</span></div>
                             <div><span>费用类型:</span><span>{{ item.expenseMainTypeName }}</span></div>
                             <!-- <div><span>状态:</span><span>{{item.status}}</span></div> -->
                             <!-- <div><span>状态:</span><span>{{item.status}}</span></div> -->
                             <!-- <div><span>驳回原因:</span><span>{{item.denyReason}}</span></div> -->
                             <!-- <div><span>驳回原因:</span><span>{{item.denyReason}}</span></div> -->
@@ -353,8 +353,8 @@ export default {
             this.getUserList()
             this.getUserList()
         }
         }
         this.getProjectList()
         this.getProjectList()
-        this.getExTypeList()
         this.getExpensMainTypes()
         this.getExpensMainTypes()
+        this.getExTypeList()
     },
     },
     methods: {
     methods: {
         back() {
         back() {
@@ -505,14 +505,14 @@ export default {
                 if (!this.invoiceList[i].happenDate) {
                 if (!this.invoiceList[i].happenDate) {
                     required2 = '费用日期'
                     required2 = '费用日期'
                 }
                 }
-                if (!this.invoiceList[i].invoiceType) {
-                    required3 = '发票种类'
-                }
+                // if (!this.invoiceList[i].invoiceType) {
+                //     required3 = '发票种类'
+                // }
                 if (!this.invoiceList[i].expenseType) {
                 if (!this.invoiceList[i].expenseType) {
                     required4 = '费用类型'
                     required4 = '费用类型'
                 }
                 }
                 if (!this.invoiceList[i].amount) {
                 if (!this.invoiceList[i].amount) {
-                    required5 = '费用金额(含税)'
+                    required5 = this.user.timeType.easyExpense==0?'费用金额(含税)':'费用金额'
                 }
                 }
             }
             }
             if (required1 || required2 || required3 || required4 || required5) {
             if (required1 || required2 || required3 || required4 || required5) {
@@ -559,6 +559,7 @@ export default {
                                     // }
                                     // }
                                     this.formshowText.name = ''
                                     this.formshowText.name = ''
                                     this.formshowText.inProjectName = []
                                     this.formshowText.inProjectName = []
+                                    this.expenseMainType.text=''
                                     this.invoiceList = []
                                     this.invoiceList = []
                                     this.uploader = []
                                     this.uploader = []
                                     this.formshowText.name = this.user.name;
                                     this.formshowText.name = this.user.name;