Prechádzať zdrojové kódy

手机端费用报销支持按项目审批
车间工时管家增加系统设置模块

seyason 1 rok pred
rodič
commit
c3f6934acc

+ 62 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/SysConfigController.java

@@ -1,10 +1,18 @@
 package com.management.platform.controller;
 
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.management.platform.entity.SysConfig;
+import com.management.platform.mapper.SysConfigMapper;
+import com.management.platform.util.HttpRespMsg;
 import org.springframework.web.bind.annotation.RequestMapping;
 
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import java.util.HashMap;
+
 /**
  * <p>
  *  前端控制器
@@ -16,6 +24,60 @@ import org.springframework.web.bind.annotation.RestController;
 @RestController
 @RequestMapping("/sys-config")
 public class SysConfigController {
+    public static final String KEY_APP_NAME = "APP_NAME";
+    public static final String KEY_APP_LOGO = "APP_LOGO";
+    @Resource
+    private SysConfigMapper sysConfigMapper;
+
+    @RequestMapping("/getAppSetting")
+    private HttpRespMsg getAppSetting(){
+        HttpRespMsg msg = new HttpRespMsg();
+        SysConfig nameConfig = sysConfigMapper.selectOne(new QueryWrapper<SysConfig>().eq("param_key", KEY_APP_NAME));
+        SysConfig logoConfig = sysConfigMapper.selectOne(new QueryWrapper<SysConfig>().eq("param_key", KEY_APP_LOGO));
+        HashMap map = new HashMap();
+        if (nameConfig == null || logoConfig == null) {
+            msg.setError("请进入系统后在基础配置模块设置应用的logo和名称");
+        } else {
+            map.put("appLogo", logoConfig.getParamValue());
+            map.put("appName", nameConfig.getParamValue());
+            msg.setData(map);
+        }
+
+        return msg;
+    }
+
+    @RequestMapping("/saveAppSetting")
+    private HttpRespMsg saveAppSetting(String appName, String appLogo) {
+        SysConfig nameConfig = sysConfigMapper.selectOne(new QueryWrapper<SysConfig>().eq("param_key", KEY_APP_NAME));
+        if (nameConfig == null) {
+            nameConfig = new SysConfig();
+            nameConfig.setParamKey(KEY_APP_NAME);
+            nameConfig.setParamValue(appName);
+        } else {
+            nameConfig.setParamValue(appName);
+        }
+        if (nameConfig.getId() == null) {
+            sysConfigMapper.insert(nameConfig);
+        } else {
+            sysConfigMapper.updateById(nameConfig);
+        }
+
+        SysConfig logoConfig = sysConfigMapper.selectOne(new QueryWrapper<SysConfig>().eq("param_key", KEY_APP_LOGO));
+        if (logoConfig == null) {
+            logoConfig = new SysConfig();
+            logoConfig.setParamKey(KEY_APP_LOGO);
+            logoConfig.setParamValue(appLogo);
+        } else {
+            logoConfig.setParamValue(appLogo);
+        }
+        if (logoConfig.getId() == null) {
+            sysConfigMapper.insert(logoConfig);
+        } else {
+            sysConfigMapper.updateById(logoConfig);
+        }
+
+        return new HttpRespMsg();
+    }
 
 }
 

+ 12 - 2
fhKeeper/formulahousekeeper/timesheet-workshop/src/routes.js

@@ -14,13 +14,12 @@ import prodList from './views/product/list.vue'
 import cost from './views/project/cost.vue'
 import proDetail from './views/project/detail.vue'
 import depDetail from './views/project/detailDep.vue'
-import projectInside from  './views/project/projectInside.vue'
 
 // 团队管理
 import team from './views/team/index.vue'
 
 // 系统设置
-import timetype from './views/settings/timetype.vue';
+import settings from './views/settings/settings.vue';
 
 
 //企业报表
@@ -142,6 +141,17 @@ export const allRouters = [
             { path: '/role', component: quanx, name: '角色权限'},
         ],
     },
+    {
+        path: '/',
+        component: Home,
+        name: '系统设置',
+        iconCls: 'iconfont firerock-iconquanxian1',
+        leaf: true,//只有一个节点
+        children: [
+            { path: '/settings', component: settings, name: '角色权限'},
+        ],
+    },
+    
     {
         path: '/404',
         component: NotFound,

+ 4 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -3004,7 +3004,10 @@
                     });
                     }
                 );
-                this.getWorkTimeForMinYi();
+                //明夷硬编码获取
+                if (this.user.company.companyName == this.mingyiName) {
+                    this.getWorkTimeForMinYi();
+                }
             },
             getWorkTimeForMinYi(){
                 this.http.post('/user-fv-time/getMinYiWorkHour',{ 

+ 61 - 9
fhKeeper/formulahousekeeper/timesheet_h5/src/views/expense/details.vue

@@ -171,6 +171,27 @@
                             />
                         </template>
                     </van-field>
+                    <van-field
+                        label="状态" >
+                        <template #input>
+                            <span :class="statusClass[item.status]">{{
+                                    statusList[item.status] }}</span>
+                        </template>
+                    </van-field>
+
+                    <van-field
+                        label="操作" v-if="isAudit && item.isIncharger && item.status == 1"
+                    >
+                    <template #input>
+                        <div  style="float:right;">
+                            <van-button  type="info" :loading="item.approveLoading"
+                                @click.stop="approveSingle(item)">通过</van-button>
+                            <van-button style="margin-left:25px" type="danger" :loading="item.approveLoading"
+                                @click.stop="denySingle(item)">驳回</van-button>
+                        </div>
+                    </template>
+                    </van-field>
+                    
                 </div>
             </div>
             <div class="addinvoice" v-if="canEdit"><van-button size="small" icon="plus" type="info" plain hairline @click="addInvoice">添加发票</van-button></div>
@@ -252,9 +273,11 @@
 export default {
     data() {
         return {
+            statusList: ['审核通过', '待审核', '已驳回', '已撤销'],
+            statusClass: ['', 'waiting', 'rejected', ''],
+            isAudit: false,
             user: JSON.parse(localStorage.userInfo),
             canEdit: this.$route.params.canEdit,
-            canExamine: false,
             currentDate1 : new Date(),
             currentDate2 : new Date(),
             minDate: new Date(2020,0,1),
@@ -320,17 +343,10 @@ export default {
     },
     mounted() {
         console.log(this.$route.params);
-        for(let i in this.user.functionList){
-            if(this.user.functionList[i].name == '费用审核'){
-                this.canExamine = true
-            }
-        }
+        this.isAudit = this.$route.params.isAudit;
         
         this.getDetail()
         if(this.canEdit){
-            // if(this.canExamine){
-            //     this.getUserList()
-            // }
             this.getProjectList()
         }
         this.getExpensMainTypes()
@@ -540,6 +556,7 @@ export default {
                     this.invoiceList = res.data.invoiceList
                     for(let i in res.data.invoiceList){
                         this.formshowText.inProjectName.push(res.data.invoiceList[i].projectName)
+                        res.data.invoiceList[i].approveLoading = false;
                         if(res.data.invoiceList[i].pic){
                             this.uploader[i] = [{url:'/upload/' + res.data.invoiceList[i].pic}]
                         }else{
@@ -583,6 +600,34 @@ export default {
                 }
             }).catch(err=> {this.$toast.clear();console.log(err)});
         },
+        // 单据审核
+        approveSingle(item) {
+            item.approveLoading = true;
+            this.$axios.post("/expense-sheet/approveSingleProject", { id: item.id })
+                .then(res => {
+                    if (res.code == "ok") {
+                        this.$toast.success('已通过')
+                        item.approveLoading = false
+                        this.getDetail();
+                    } else {
+                        this.$toast.fail('获取失败');
+                    }
+                }).catch(err => { this.$toast.clear(); console.log(err) });
+        },
+       
+        denySingle(item) {
+            item.approveLoading = true;
+            this.$axios.post("/expense-sheet/denySingleProject", {id: item.id})
+                .then(res => {
+                    if (res.code == "ok") {
+                        this.$toast.success('已驳回')
+                        item.approveLoading = false
+                        this.getDetail();
+                    } else {
+                        this.$toast.fail('获取失败');
+                    }
+                }).catch(err => { this.$toast.clear(); console.log(err) });
+        },
     },
 };
 </script>
@@ -621,6 +666,13 @@ export default {
             }
     }
 }
+.waiting {
+    color: orange;
+}
+
+.rejected {
+    color: red;
+}
 </style>
 <style>
 .edit_form .invoice .van-field__label{

+ 22 - 2
fhKeeper/formulahousekeeper/timesheet_h5/src/views/expense/index.vue

@@ -5,7 +5,7 @@
             <van-tabs v-model="active" @change="activeChange">
                 <van-tab title="费用报销" :name="0"></van-tab>
                 <van-tab title="单据列表" :name="1"></van-tab>
-                <van-tab title="单据审核" :name="2" v-if="canExamine"></van-tab>
+                <van-tab title="单据审核" :name="2"></van-tab>
             </van-tabs>
             <!-- #region 费用报销 -->
             <div class="edit" v-if="active == 0">
@@ -213,12 +213,16 @@
                             <div class="collapse_label_l">金额: ¥{{ item.totalAmount | numtosum }}</div>
                             <div class="collapse_label_r">状态:<span :class="statusClass[item.status]">{{
                                 statusList[item.status] }}</span></div>
-                            <div class="operation">
+                            <div class="operation" v-if="auditTypeItem.auditType == 0">
                                 <van-button size="small" type="info" :loading="item.approveLoading"
                                     @click.stop="approve(item)">通过</van-button>
                                 <van-button style="margin-left:15px" size="small" type="danger"
                                     @click.stop="denyToReason(item.id)">驳回</van-button>
                             </div>
+                            <div class="operation" v-if="auditTypeItem.auditType == 1">
+                                <van-button size="small" type="info"
+                                :to="{ name: 'expenseDetails', params: { id: item.id, canEdit: false, isAudit:true } }">审核</van-button>
+                            </div>
                         </template>
                         <div class="wrapper">
                             <div><span>票据编号:</span><span>{{ item.code }}</span></div>
@@ -257,6 +261,7 @@
 export default {
     data() {
         return {
+            auditTypeItem: {auditType: 0},
             active: sessionStorage.page ? JSON.parse(sessionStorage.page) : 0,
             user: JSON.parse(localStorage.userInfo),
             userList: [],
@@ -381,6 +386,7 @@ export default {
         this.getProjectList()
         this.getExpensMainTypes()
         this.getExTypeList()
+        this.getAuditType();
     },
     methods: {
         back() {
@@ -634,6 +640,20 @@ export default {
                 });
 
         },
+        getAuditType() {
+            this.$axios.post("/expense-audit-setting/get", {})
+                .then(res => {
+                    if (res.code == "ok") {
+                        this.auditTypeItem = res.data;
+                    } else {
+                        this.$message({
+                            message: res.msg,
+                            type: "error"
+                        });
+                    }
+                }).catch(err => { this.$toast.clear(); console.log(err) });
+        },
+        
 
         // 单据审核
         approve(item) {