ggooalice il y a 2 ans
Parent
commit
84c1f4ebb6

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

@@ -112,7 +112,7 @@
                     {{scope.row.projectName}}
                   </template>
                 </el-table-column>
-                <el-table-column prop="inchargerName" label="负责人"  width="130">
+                <el-table-column prop="inchargerName" label="项目经理"  width="130">
                   <template slot-scope="scope" >
                     {{scope.row.inchargerName}}
                   </template>

+ 137 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/expense/expense.vue

@@ -51,6 +51,7 @@
       <h3 ref="headHe" style="padding-left: 220px">{{shuz[ins]}}</h3>
       <p style="float: right;margin-right: 25px;"><el-button type="primary" @click="submits" size="mini">提交</el-button></p>
       <p style="float: right;margin-right: 25px;"><el-button type="primary" @click="submitUpload" size="mini">批量上传</el-button></p>
+      <p style="float: right;margin-right: 25px;"><el-button type="primary" @click="customTypeOp" size="mini" v-if="permissions.costAll">费用类型管理</el-button></p>
     </div>
     <!-- 上面部分 -->
     <div ref="staff" style="margin: 20px 20px 0 220px; width: 81.5%" >
@@ -135,7 +136,7 @@
                 </el-select>
               </template>
             </el-table-column>
-            <el-table-column label="费用类型" width="155px">
+            <el-table-column label="费用类型" width="175px">
               <template slot-scope="scope">
                 <el-select size="small" v-model="scope.row.expenseType" placeholder="费用类型" style="width: 150px" >
                   <el-option v-for="(item, index) in expenseTypeList" :key="index" :label="item.typeName" :value="item.typeName" ></el-option>
@@ -460,6 +461,48 @@
               </div>
             </div>
         </el-dialog>
+
+        <!-- 费用类型自定义 -->
+        <el-dialog title="费用类型管理" v-if="customTypeDialog" :visible.sync="customTypeDialog" customClass="customWidth" width="600px">
+          <el-table :data="customTypeList" style="height:400px" :loading="customTypeListLoading">
+            <el-table-column prop="typeName" label="费用名称" min-width="150"></el-table-column>
+            <el-table-column label="费用类型" min-width="150">
+              <template slot-scope="scope">
+                <span>{{scope.row.mainType == 0 ? '一般费用' : (scope.row.mainType == 1 ? '差旅费用' : '外包费用')}}</span>
+              </template>
+            </el-table-column>
+            <el-table-column label="操作" width="150">
+              <template slot-scope="scope">
+                <el-button @click="customTypeEditOp(scope.row)" size="small" type="primary">编辑</el-button>
+                <el-button @click="customTypeEditDelete(scope.row)" size="small" type="danger">删除</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
+          <span slot="footer" class="dialog-footer">
+            <el-button @click="customTypeDialog = false" size="medium">取消</el-button>
+            <el-button type="primary" @click="customTypeEditOp()" size="medium">新增类型</el-button>
+          </span>
+
+          <!-- 新增/编辑费用类型 -->
+          <el-dialog title="新增/编辑费用类型" v-if="customTypeEditDialog" :visible.sync="customTypeEditDialog" customClass="customWidth" width="400px" append-to-body>
+            <el-form label-width="80px" :rules="editTypeDataRules" ref="editTypeDataForm" :model="editTypeData">
+              <el-form-item label="所属类型" style="margin:30px 0">
+                <el-select v-model="editTypeData.mainType" size="medium" style="width:90%">
+                  <el-option label="一般费用" :value="0"></el-option>
+                  <el-option label="差旅费用" :value="1"></el-option>
+                  <el-option label="外包费用" :value="2"></el-option>
+                </el-select>
+              </el-form-item>
+              <el-form-item label="类型名称" style="margin:30px 0" prop="typeName">
+                <el-input id="editTypeDataInput" size="medium" v-model="editTypeData.typeName" placeholder="自定义费用类型名称" style="width:90%" @keyup.native="editTypeDataInput('editTypeDataInput')"></el-input>
+              </el-form-item>
+            </el-form>
+            <span slot="footer" class="dialog-footer">
+              <el-button @click="customTypeEditDialog = false" size="medium">取消</el-button>
+              <el-button type="primary" @click="customTypeEditSure" size="medium">确认</el-button>
+            </span>
+          </el-dialog>
+        </el-dialog>
   </section>
 </template>
 
@@ -521,7 +564,17 @@ export default {
       apl: '',
       diz: 'http://worktime.ttkuaiban.com',
       importDialog: false,
-      importingData: false
+      importingData: false,
+
+      // 费用类型自定义
+      customTypeDialog: false,
+      customTypeList: [],
+      customTypeListLoading: false,
+      customTypeEditDialog: false,
+      editTypeData: {},
+      editTypeDataRules:{
+        typeName: [{ required: true, message: "请输入自定义费用类型名称", trigger: "blur" }],
+      },
     };
   },
   computed: {
@@ -569,6 +622,85 @@ export default {
       }
   },
   methods: {
+    // 费用类型自定义
+    customTypeOp(){
+      this.customTypeDialog = true
+      this.customTypeListLoading = true
+      this.getExpList()
+    },
+    customTypeEditOp(row){
+      this.customTypeEditDialog = true
+      if(row){
+        this.editTypeData = row
+      }else{
+        this.editTypeData = {
+          mainType: 0,
+          typeName: '',
+          companyId: this.user.companyId
+        }
+      }
+    },
+    customTypeEditSure(){
+      this.$refs.editTypeDataForm.validate(valid => {
+        if (valid) {
+          this.http.post('/expense-type/addOrMod',this.editTypeData,
+          res => {
+            if(res.code == 'ok'){
+              this.customTypeEditDialog = false
+              this.customTypeOp()
+            }else{
+              this.$message({
+                message: res.msg,
+                type: 'error'
+              })
+            }
+          },err => {
+            this.$message({
+              message: err,
+              type: 'error'
+            })
+          })
+        }})
+    },
+    customTypeEditDelete(row){
+      this.$confirm('该操作可能造成已有数据丢失,确定要删除吗?','提示',{
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(()=>{
+        this.http.post('/expense-type/delete',{
+          id: row.id
+        },
+        res => {
+          if(res.code == 'ok'){
+            this.customTypeEditDialog = false
+            this.customTypeOp()
+          }else{
+            this.$message({
+              message: res.msg,
+              type: 'error'
+            })
+          }
+        },err => {
+          this.$message({
+            message: err,
+            type: 'error'
+          })
+        })
+      }).catch(()=>{
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
+        })
+      })
+    },
+    editTypeDataInput(typeName){
+      let inpu = document.getElementById(typeName);
+      inpu.value = inpu.value.replace(/^\s*|\s*$/g, '')
+    },
+
+
+
     submitUpload(){
       this.importDialog = true
     },
@@ -688,8 +820,10 @@ export default {
       this.http.post('/expense-type/getList', {
         },
         res => {
+          this.customTypeListLoading = false
             if (res.code == "ok") {
                 this.allExpList = res.data;
+                this.customTypeList = res.data
                 this.expenseTypeList = this.allExpList.filter(a=>a.mainType == 0);
             } else {
                 this.$message({
@@ -699,6 +833,7 @@ export default {
             }
         },
         error => {
+          this.customTypeListLoading = false
             this.$message({
                 message: error,
                 type: "error"

+ 18 - 8
fhKeeper/formulahousekeeper/timesheet/src/views/project/cost.vue

@@ -30,6 +30,7 @@
 
             <el-radio-group v-model="radio" @change="getEchart" style="margin-left:10px;">
                 <el-radio-button label="项目"></el-radio-button>
+                <el-radio-button label="主项目" v-if="user.timeType.mainProjectState"></el-radio-button>
                 <el-radio-button label="项目分类"></el-radio-button>
                 <el-radio-button label="部门"></el-radio-button>
                 <el-radio-button label="人员"></el-radio-button>
@@ -750,16 +751,20 @@
                 var _this = this;
                 var param = {};
                 if (this.dateRange != null) {
-                    param = {startDate:this.user.timeType.fixMonthcost==0?this.dateRange[0]:this.dateRange, 
-                    endDate: this.user.timeType.fixMonthcost==0?this.dateRange[1]:this.dateRange};
+                    param = {
+                        startDate:this.user.timeType.fixMonthcost==0?this.dateRange[0]:this.dateRange, 
+                        endDate: this.user.timeType.fixMonthcost==0?this.dateRange[1]:this.dateRange
+                    };
                     // console.log(param);
                 }
                 var url = '';
                 if (this.radio=='项目') {
                     url = this.port.project.listCost;
-                } else if (this.radio=='项目分类') {
+                }else if(this.radio == '主项目'){
+                    url = '/project/getTimeCostByMainProject'
+                    param.userId = this.user.id
+                }else if (this.radio=='项目分类') {
                     url = '/project/getTimeCostByCategory';
-                    
                     // param.parentDeptId = this.parentDeptId;
                     // param.userId = this.user.id
                 } else if (this.radio=='部门') {
@@ -796,13 +801,18 @@
                         var list
                         var totalMoneyCost;
                         var totalHours = 0.0;
-                        if(this.radio == '项目' || this.radio == '项目分类' || this.radio=='部门') {
+                        if(this.radio == '项目' || this.radio == '项目分类' || this.radio=='部门' || this.radio == '主项目') {
                             list = res.data.costList
                             totalMoneyCost = ((this.radio=='项目' || this.radio == '项目分类')?res.data.totalMoneyCost:res.data.totalCostMoney);
 
                             for(var i in list) {
-                                if(this.radio=='项目') {
-                                    xList.push(list[i].project);
+                                if(this.radio=='项目' || this.radio == '主项目') {
+                                    if(this.radio == '项目'){
+                                        xList.push(list[i].project);
+                                    }else{
+                                        xList.push(list[i].mainProjectName);
+                                    }
+                                    
                                     let item = {
                                         "value": this.yAxisValue==0?(list[i].costMoney ? list[i].costMoney.toFixed(2) : 0) || list[i].costMoney:(list[i].cost ? list[i].cost.toFixed(1) : 0),
                                         "id": list[i].id || i,
@@ -889,7 +899,7 @@
                             this.zhishin = totalMoneyCost.toFixed(2)
                         } 
 
-                        if(this.radio == '项目' || this.radio == '人员' || this.radio == '项目分类' || this.radio=='部门') {
+                        if(this.radio == '项目' || this.radio == '主项目' || this.radio == '人员' || this.radio == '项目分类' || this.radio=='部门') {
                             var option = {
                                 title: {
                                     text: '工时成本总计:' + ((this.permissions.countCost) ? '成本' + this.zhishin + '元,' : '') + ((this.permissions.countHours) ? '时长' + totalHours + '小时' : ''),

+ 8 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/project/detail.vue

@@ -18,6 +18,7 @@
         <el-col :span="24"  style="margin-top:10px;padding-bottom: 0px;text-align:center;">
             <el-radio-group v-model="radio" @change="getList">
                 <el-radio-button label="人员"></el-radio-button>
+                <el-radio-button label="任务分组" v-if="user.company.packageProject != 0"></el-radio-button>
                 <el-radio-button label="子项目" v-if="user.timeType.mainProjectState != '1'"></el-radio-button>
                 <el-radio-button label="阶段" v-if="user.company.packageProject != 0"></el-radio-button>
             </el-radio-group>
@@ -65,6 +66,8 @@
                 var url = "";
                 if (this.radio=='人员') {
                     url = this.port.project.projectCost;
+                } else if (this.radio=='任务分组') {
+                    url = '/project/getCostByGroup';
                 } else if (this.radio=='子项目') {
                     url = '/sub-project/getTimeCost';
                 } else {
@@ -91,7 +94,11 @@
                         var xList = [],yList = [] , list = res.data.costList;
                         this.cost = res.data.totalMoneyCost;
                         for(var i in list) {
-                            xList.push(list[i].name);
+                            if(this.radio == '任务分组'){
+                                xList.push(list[i].GroupName);
+                            }else{
+                                xList.push(list[i].name);
+                            }
                             yList.push({
                                 "value": this.yAxisValue==0?list[i].costMoney:list[i].cost,
                                 "cost": list[i].cost,

+ 8 - 8
fhKeeper/formulahousekeeper/timesheet/src/views/project/info.vue

@@ -51,7 +51,7 @@
                     <div><label>相关人员</label>
                     <el-link v-if="user.id == project.creatorId || user.id == project.inchargerId" @click="showEditPar" style="float:right;"><i class="el-icon-edit"  ></i></el-link>
                     </div>
-                    <div style="margin-top:10px;color:#999;">负责人</div>
+                    <div style="margin-top:10px;color:#999;">项目经理</div>
                     <div><el-link style="margin:10px" @click="showUser(project.inchargerId)">{{project.inchargerName}}</el-link></div>
                     <div style="margin-top:10px;color:#999;">日报审核人</div>
                     <div>
@@ -207,32 +207,32 @@
         </el-dialog>
 
         <!-- 合同金额修改记录 -->
-        <el-dialog title="合同金额修改记录" v-if="contractRecordDialog" :visible.sync="contractRecordDialog" :close-on-click-modal="false" customClass="customWidth" width="900px">
+        <el-dialog title="合同金额修改记录" v-if="contractRecordDialog" :visible.sync="contractRecordDialog" :close-on-click-modal="false" customClass="customWidth" width="1000px">
             <el-table :data="contractRecordData" height="400px" :loading="contractRecordLoading">
-                <el-table-column label="操作人" prop="name" min-width="70">
+                <el-table-column label="操作人" prop="name" min-width="150">
                     <template slot-scope="scope">
                         <!-- <span>{{users.filter(item => item.id == scope.row.editUserId)[0].name}}</span> -->
                         <span>{{filterUserContract(scope.row.editUserId)}}</span>
                     </template>
                 </el-table-column>
-                <el-table-column label="修改时间" prop="date" min-width="140">
+                <el-table-column label="修改时间" prop="date" min-width="180">
                     <template slot-scope="scope">
                         <!-- <span>{{scope.row.updateDate[0] + '-' + scope.row.updateDate[1] + '-' + scope.row.updateDate[2] + '\u3000' + scope.row.updateDate[3] + ':' + scope.row.updateDate[4] + ':' + scope.row.updateDate[5]}}</span> -->
                         <span>{{tempDateContract(scope.row.updateDate)}}</span>
                     </template>
                 </el-table-column>
-                <el-table-column label="原金额" prop="oldContractAmount" min-width="140">
+                <el-table-column label="原金额" prop="oldContractAmount" min-width="180">
                     <template slot-scope="scope">
                         <span>{{scope.row.oldContractAmount.toFixed(2)}} 元</span>
                     </template>
                 </el-table-column>
-                <el-table-column label="修改情况" prop="record" min-width="140">
+                <el-table-column label="修改情况" prop="record" min-width="180">
                     <template slot-scope="scope">
                         <span>{{scope.row.oldContractAmount - scope.row.newContractAmount > 0 ? '减少' : '增加'}}</span>
                         <span>{{scope.row.oldContractAmount - scope.row.newContractAmount > 0 ? (scope.row.oldContractAmount - scope.row.newContractAmount).toFixed(2) : (scope.row.newContractAmount - scope.row.oldContractAmount).toFixed(2)}} 元</span>
                     </template>
                 </el-table-column>
-                <el-table-column label="修改原因" prop="reason" min-width="210"></el-table-column>
+                <el-table-column label="修改原因" prop="reason" min-width="300"></el-table-column>
             </el-table>
         </el-dialog>
 
@@ -317,7 +317,7 @@
                         <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id"></el-option>
                     </el-select>
                 </el-form-item>
-                <el-form-item label="主要负责人" >
+                <el-form-item label="项目经理" >
                     <el-select v-model="addForm.inchargerId"  filterable placeholder="请选择负责人" style="width:100%;" >
                         <el-option v-for="item in project.participationList" :key="item.id" :label="item.name" :value="item.id"></el-option>
                     </el-select>

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

@@ -149,7 +149,7 @@
             </el-table-column>
             <el-table-column prop="projectMainName" label="主项目" sortable="custom" min-width="250" v-if="user.timeType.mainProjectState == '1'">
             </el-table-column>
-            <el-table-column prop="inchargerName" label="负责人" sortable="custom" min-width="150">
+            <el-table-column prop="inchargerName" label="项目经理" sortable="custom" min-width="150">
                 <template slot-scope="scope">
                     <el-link type="primary" :underline="false" @click="showUser(scope.row.inchargerId)">{{scope.row.inchargerName}}</el-link>
                 </template>
@@ -360,7 +360,7 @@
                     <el-input  @focus="showChooseMembTree" v-model="addForm.userNames"></el-input>
                     </el-tooltip>
                 </el-form-item>
-                <el-form-item label="负责人" ><el-select v-model="addForm.inchargerId"  :disabled="(addForm.userId.length==0 && addForm.isPublic == 0) || (!permissions.projectManagement && user.id != addForm.creatorId)" filterable placeholder="请选择负责人" style="width:32%;" >
+                <el-form-item label="项目经理" ><el-select v-model="addForm.inchargerId"  :disabled="(addForm.userId.length==0 && addForm.isPublic == 0) || (!permissions.projectManagement && user.id != addForm.creatorId)" filterable placeholder="请选择项目经理" style="width:32%;" >
                         <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id"></el-option>
                     </el-select>
                 </el-form-item>
@@ -380,7 +380,7 @@
                 <!-- 增加合同金额字段 -->
                         <span style="margin-left:63px;margin-right:10px;" v-if="user.company.packageProject==1">合同金额</span>
                         <el-input id="contractAmount" v-model="addForm.contractAmount" style="width:33%;"
-                        placeholder="整数" clearable  @keyup.native="restrictNumber('contractAmount')" :disabled="true"></el-input><span style="margin-left:10px;">元</span>
+                        placeholder="整数" clearable  @keyup.native="restrictNumber('contractAmount')" :disabled="title == '新增项目' ? false : true"></el-input><span style="margin-left:10px;">元</span>
                 <!-- 增加合同金额字段 -->
                 </el-form-item>
                 <el-form-item label="开始日期" prop="planStartDate"  >

+ 2 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/count/count.vue

@@ -33,7 +33,7 @@
     </div>
 
 
-    <div id="main" style="width:250px;height:250px;margin:0 auto"></div>
+    <div style="width:100%;height:250px;background-color:#fff"><div id="main" style="width:250px;height:250px;margin:0 auto"></div></div>
     <van-sticky offset-top="1.35333rem">
         <div style="background:#fff;">
     <van-tabs v-model="stateActive" :fixed="false" @change="stateChange" class="stateActiveClass" color="#20a0ff">
@@ -324,6 +324,7 @@ body{
 }
 .stateActiveClass .van-tab__text--ellipsis{
     -webkit-line-clamp: initial;
+    padding-bottom: 0.1rem;
 }
 .title111 {
     background-color: #20a0ff;