Kaynağa Gözat

拉取代码

Lljy-ai 4 yıl önce
ebeveyn
işleme
eeae4fa2de

+ 19 - 0
fhKeeper/formulahousekeeper/timesheet/src/Amount .js

@@ -0,0 +1,19 @@
+/* 数字金额逢三加, 比如 123,464.23 */
+export function numberToCurrency(value) {
+    if (!value) return '0.00'
+    // 将数值截取,保留两位小数
+    value = value.toFixed(2)
+    // 获取整数部分
+    const intPart = Math.trunc(value)
+    // 整数部分处理,增加,
+    const intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
+    // 预定义小数部分
+    let floatPart = '.00'
+    // 将数值截取为小数部分和整数部分
+    const valueArray = value.toString().split('.')
+    if (valueArray.length === 2) { // 有小数部分
+      floatPart = valueArray[1].toString() // 取得小数部分
+      return intPartFormat + '.' + floatPart
+    }
+    return intPartFormat + floatPart
+  }

+ 28 - 6
fhKeeper/formulahousekeeper/timesheet/src/views/project/earning.vue

@@ -47,27 +47,27 @@
                         <el-table-column  label="基线成本" >
                             <el-table-column prop="baseMan" label="人员成本">
                                 <template slot-scope="scope">
-                                ¥{{scope.row.baseMan}}
+                                ¥{{scope.row.baseMan | numberToCurrency}}
                                 </template>
                             </el-table-column>
                             <el-table-column prop="baseFee" label="费用">
                                 <template slot-scope="scope">
-                                ¥{{scope.row.baseFee}}
+                                ¥{{scope.row.baseFee | numberToCurrency}}
                                 </template>
                             </el-table-column>
                             <el-table-column prop="baseOutsourcing" label="外包费用">
                                 <template slot-scope="scope">
-                                ¥{{scope.row.baseOutsourcing}}
+                                ¥{{scope.row.baseOutsourcing | numberToCurrency}}
                                 </template>
                             </el-table-column>
                             <el-table-column prop="baseRisk1" label="风险预留金额1" width="150">
                                 <template slot-scope="scope">
-                                ¥{{scope.row.baseRisk1}}
+                                ¥{{scope.row.baseRisk1 | numberToCurrency}}
                                 </template>
                             </el-table-column>
                             <el-table-column prop="baseRisk2" label="风险预留金额2" width="150">
                                 <template slot-scope="scope">
-                                ¥{{scope.row.baseRisk2}}
+                                ¥{{scope.row.baseRisk2 | numberToCurrency}}
                                 </template>
                             </el-table-column>
                         </el-table-column>
@@ -151,6 +151,21 @@
                 
             };
         },
+        filters: {
+            numberToCurrency(value) {
+                if (!value) return '0.00'
+                value = value.toFixed(2)
+                const intPart = Math.trunc(value)
+                const intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
+                let floatPart = '.00'
+                const valueArray = value.toString().split('.')
+                if (valueArray.length === 2) { // 有小数部分
+                floatPart = valueArray[1].toString() // 取得小数部分
+                return intPartFormat + '.' + floatPart
+                }
+                return intPartFormat + floatPart
+            }
+        },
         methods: {
             getProfitSnapshot() {
                 let _this = this;
@@ -359,4 +374,11 @@
             this.getProfitSnapshot();
         }
     };
-</script>
+</script>
+
+<style scoped>
+    .cell{
+        padding-left: 0 !important;
+        text-align: center !important;
+    }
+</style>

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

@@ -16,7 +16,7 @@
                     <el-row :gutter="10">
                         <el-col :span="5" ><span class="gray_label">项目编码: </span></el-col><el-col :span="7" ><span >{{project.projectCode}}</span></el-col>
                         <el-col :span="5" ><span class="gray_label">项目金额:</span></el-col><el-col :span="7" >
-                        <span >{{project.contractAmount == null?'-':project.contractAmount}} 元</span></el-col>
+                        <span >{{project.contractAmount == null?'-':project.contractAmount | numberToCurrency}} 元</span></el-col>
                     </el-row>
                     <el-row :gutter="10">
                         <el-col :span="5" ><span class="gray_label">项目级别: </span></el-col><el-col :span="7" ><span >{{levelTxt[project.level]}}</span></el-col>
@@ -38,17 +38,17 @@
                     <div><label>成本基线<el-link v-if="user.id == project.creatorId || user.id == project.inchargerId" @click="showEditBase" style="float:right;"><i class="el-icon-edit"  ></i></el-link></label>
                     <el-row :gutter="10">
                         <el-col :span="5" ><span class="gray_label">人工成本:</span></el-col><el-col :span="7" ><span>
-                            ¥{{project.baseMan==null?'-':project.baseMan}}</span></el-col>
+                            ¥{{project.baseMan==null?'-':project.baseMan | numberToCurrency}}</span></el-col>
                         <el-col :span="5" ><span class="gray_label">费用:</span></el-col><el-col :span="7" ><span>
-                        ¥{{project.baseFee==null?'-':project.baseFee}}</span></el-col></el-row>
+                        ¥{{project.baseFee==null?'-':project.baseFee | numberToCurrency}}</span></el-col></el-row>
                         <el-row :gutter="10"><el-col :span="5" ><span class="gray_label">外包费用:</span></el-col><el-col :span="7" ><span>
-                        ¥{{project.baseOutsourcing==null?'-':project.baseOutsourcing}}</span></el-col>
+                        ¥{{project.baseOutsourcing==null?'-':project.baseOutsourcing | numberToCurrency}}</span></el-col>
                         <el-col :span="5" ><span class="gray_label">风险预留金额1:</span></el-col><el-col :span="7" ><span>
-                        ¥{{project.baseRisk1==null?'-':project.baseRisk1}}</span></el-col></el-row>
+                        ¥{{project.baseRisk1==null?'-':project.baseRisk1 | numberToCurrency}}</span></el-col></el-row>
                         <el-row :gutter="10"><el-col :span="5" ><span class="gray_label">风险预留金额2:</span></el-col><el-col :span="7" ><span>
-                        ¥{{project.baseRisk2==null?'-':project.baseRisk2}}</span></el-col>
+                        ¥{{project.baseRisk2==null?'-':project.baseRisk2 | numberToCurrency}}</span></el-col>
                         <el-col :span="5" ><span class="gray_label">总成本:</span></el-col><el-col :span="7" ><span>
-                        ¥{{project.budget==null?'-':project.budget}}</span></el-col>
+                        ¥{{project.budget==null?'-':project.budget | numberToCurrency}}</span></el-col>
                     </el-row>
                     </div>
                 </div>
@@ -281,6 +281,21 @@
                 }
             };
         },
+        filters: {
+            numberToCurrency(value) {
+                if (!value) return '0.00'
+                value = value.toFixed(2)
+                const intPart = Math.trunc(value)
+                const intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
+                let floatPart = '.00'
+                const valueArray = value.toString().split('.')
+                if (valueArray.length === 2) { // 有小数部分
+                floatPart = valueArray[1].toString() // 取得小数部分
+                return intPartFormat + '.' + floatPart
+                }
+                return intPartFormat + floatPart
+            }
+        },
         methods: {
             adjustBase() {
                 //如果没有做修改,不提交数据

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

@@ -93,7 +93,7 @@
         </el-col>
 
         <!--新增界面-->
-        <el-dialog :title="title" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass="customWidth" width="600px">
+        <el-dialog :title="title" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass="customWidth" width="800px">
             <el-form ref="form1" :model="addForm" :rules="rules" label-width="120px">
                 <el-form-item label="项目编号" >
                     <el-input v-model="addForm.code" :disabled="user.role==0" placeholder="请输入项目编号" clearable></el-input>
@@ -121,13 +121,13 @@
                     placeholder="整数" clearable @keyup.native="number"></el-input><span style="margin-left:10px;">元</span> -->
 
                 <!-- 增加合同金额字段 -->
-                        <span style="margin-left:50px;margin-right:10px;" v-if="user.company.packageProject==1">合同金额</span>
+                        <span style="margin-left:63px;margin-right:10px;" v-if="user.company.packageProject==1">合同金额</span>
                         <el-input v-model="addForm.contractAmount" style="width:33%;"
                         placeholder="整数" clearable @keyup.native="number"></el-input><span style="margin-left:10px;">元</span>
                 <!-- 增加合同金额字段 -->   
 
                 </el-form-item>
-                <el-form-item label="开始日期" prop="planStartDate" v-if="user.company.packageProject==1" >
+                <el-form-item label="开始日期" prop="planStartDate" v-if="user.company.packageProject==1" style="float: left" >
                     <el-date-picker v-model="addForm.planStartDate" 
                      :editable="false" 
                      format="yyyy-MM-dd" 
@@ -135,7 +135,7 @@
                      :clearable="false" type="date" 
                      placeholder="选择日期"></el-date-picker>
                 </el-form-item>
-                <el-form-item label="截止日期" prop="planEndDate" v-if="user.company.packageProject==1" >
+                <el-form-item label="截止日期" prop="planEndDate" v-if="user.company.packageProject==1" style="float: left" >
                     <el-date-picker v-model="addForm.planEndDate" 
                      :editable="false" 
                      format="yyyy-MM-dd" 
@@ -145,45 +145,46 @@
                 </el-form-item>
             <!-- 项目基线 -->
                 <!-- <div style="width: 100%;border: 1px solid #ddd"></div> -->
-                <el-divider ></el-divider>
-                <div style="margin: 20px 0 30px 0">
+                
+                <div style="margin: 90px 0 30px 0">
+                    <el-divider></el-divider>
                     <span class="el-dialog__title">成本基线</span>
                 </div>
             <!-- 人工成本 -->
             <span class="rg_span">
-                <span style="margin-left:50px;margin-right:10px;" v-if="user.company.packageProject==1">人工成本</span>
-                <el-input @input="addUpfun(addForm.baseMan)" v-model="addForm.baseMan" style="width:22%; margin-bottom: 20px"
+                <span style="width:120px;display: inline-block;" v-if="user.company.packageProject==1">人工成本</span>
+                <el-input @input="addUpfun(addForm.baseMan)" v-model="addForm.baseMan" style="width:200px; margin-bottom: 20px"
                 placeholder="整数" clearable @keyup.native="number"></el-input><span style="margin-left:10px;">元</span>
             </span>
             <!-- 费用 -->
             <span class="rg_span">
-                <span style="margin-left:50px;margin-right:10px;" v-if="user.company.packageProject==1">费用</span>
-                <el-input @input="addUpfun(addForm.baseFee)" v-model="addForm.baseFee" style="width:22%;"
+                <span style="width:120px;display: inline-block;" v-if="user.company.packageProject==1">费用</span>
+                <el-input @input="addUpfun(addForm.baseFee)" v-model="addForm.baseFee" style="width:200px;"
                 placeholder="整数" clearable @keyup.native="number"></el-input><span style="margin-left:10px;">元</span>
             </span>
             <!-- 外包费用 -->
-            <div class="rg_span">
-                <span style="margin-left:50px;margin-right:10px;" v-if="user.company.packageProject==1">外包费用</span>
-                <el-input @input="addUpfun(addForm.baseOutsourcing)" v-model="addForm.baseOutsourcing" style="width:22%;"
+            <div class="rg_span" style="margin-bottom: 20px;">
+                <span style=" width:120px;display: inline-block;" v-if="user.company.packageProject==1">外包费用</span>
+                <el-input @input="addUpfun(addForm.baseOutsourcing)" v-model="addForm.baseOutsourcing" style="width:200px;"
                 placeholder="整数" clearable @keyup.native="number"></el-input><span style="margin-left:10px;">元</span>
             </div>
             <!-- 预留风险金额1 -->
-            <div style="margin-bottom: 20px">
-                <span style="margin-left:50px;margin-right:10px;" v-if="user.company.packageProject==1">预留风险金额1</span>
-                <el-input @input="addUpfun(addForm.baseRisk1)" v-model="addForm.baseRisk1" style="width:22%;"
+            <div style="display: inline-block;" class="rg_span">
+                <span style="width:120px;display: inline-block;text-align: right;" v-if="user.company.packageProject==1">预留风险金额1</span>
+                <el-input @input="addUpfun(addForm.baseRisk1)" v-model="addForm.baseRisk1" style="width:200px;"
                 placeholder="整数" clearable @keyup.native="number"></el-input><span style="margin-left:10px;">元</span>
             </div>
             <!-- 预留风险金额2 -->
-            <div style="margin-bottom: 20px">
-                <span style="margin-left:50px;margin-right:10px;" v-if="user.company.packageProject==1">预留风险金额2</span>
-                <el-input @input="addUpfun(addForm.baseRisk2)" v-model="addForm.baseRisk2" style="width:22%;"
+            <div class="rg_span">
+                <span style="width:120px;display: inline-block;text-align: right;" v-if="user.company.packageProject==1">预留风险金额2</span>
+                <el-input @input="addUpfun(addForm.baseRisk2)" v-model="addForm.baseRisk2" style="width:200px;"
                 placeholder="整数" clearable @keyup.native="number"></el-input><span style="margin-left:10px;">元</span>
             </div>
             <!-- 合计 -->
-            <div style="margin-bottom: 20px">
+            <div style="margin-top: 20px">
                 <span style="margin-left:50px;margin-right:10px;" v-if="user.company.packageProject==1">合计</span>
                  <span v-if="addForm.budget <= 0 || addForm.budget == undefined">0</span>
-                 <span>{{addForm.budget}}</span>
+                 <span v-else>{{addForm.budget | numberToCurrency}}</span>
                 <span style="margin-left:10px;">元</span>
             </div>
 
@@ -259,7 +260,6 @@
 </style>
 <script>
     import util from "../../common/js/util";
-
     export default {
         data() {
             return {
@@ -298,6 +298,27 @@
                 }
             };
         },
+        // 过滤器
+        filters: {
+            numberToCurrency(value) {
+                if (!value) return '0.00'
+                // 将数值截取,保留两位小数
+                value = value.toFixed(2)
+                // 获取整数部分
+                const intPart = Math.trunc(value)
+                // 整数部分处理,增加,
+                const intPartFormat = intPart.toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
+                // 预定义小数部分
+                let floatPart = '.00'
+                // 将数值截取为小数部分和整数部分
+                const valueArray = value.toString().split('.')
+                if (valueArray.length === 2) { // 有小数部分
+                floatPart = valueArray[1].toString() // 取得小数部分
+                return intPartFormat + '.' + floatPart
+                }
+                return intPartFormat + floatPart
+            }
+        },
         methods: {
             number(){  
         //      this.addForm.budget = this.addForm.budget.replace(/[^\.\d]/g,'');
@@ -564,16 +585,22 @@
             },
             // 项目基线合计
             addUpfun(je) {
+                var a = '0'
                 var q = '0'
                 var w = '0'
                 var e = '0'
                 var r = '0'
-                this.addForm.baseMan === undefined || this.addForm.baseMan === NaN ? this.addForm.baseMa = '0' : this.addForm.baseMan
+                //  this.addForm.baseMan === undefined || this.addForm.baseMan === NaN ? this.addForm.baseMa = '0' : this.addForm.baseMan
+                if (this.addForm.baseMan == undefined || this.addForm.baseMan == NaN) {
+                    a = 0
+                } else {
+                    a = this.addForm.baseMan
+                }
                 if (this.addForm.baseFee !== undefined) q = this.addForm.baseFee
                 if (this.addForm.baseOutsourcing !== undefined) w = this.addForm.baseOutsourcing
                 if (this.addForm.baseRisk1 !== undefined) e = this.addForm.baseRisk1
                 if (this.addForm.baseRisk2 !== undefined) r = this.addForm.baseRisk2
-                this.addForm.budget = +this.addForm.baseMan + +q + +w + +e + +r
+                this.addForm.budget = +a + +q + +w + +e + +r
             },
             submitInsert() {
                 this.$refs.form1.validate(valid => {
@@ -719,6 +746,15 @@
 
 <style lang="scss" scoped>
 .rg_span{
-    margin-bottom: 20px;
+    display: inline-block;
+}
+.rg_span span {
+    text-align: right;
+    box-sizing: border-box;
+    padding-right: 10px;
+}
+.el-dialog__title {
+    display: inline-table;
+    margin-top: 20px;
 }
 </style>

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

@@ -335,18 +335,36 @@
                         <p style="padding-left: 20px;">文本框输入的内容</p>
                         <!-- <el-button type="text" @click="open" style="text-align: center;color:#dddddd;">查看完整状态</el-button> -->
                         <!-- <p style="text-align: center;">查看完整状态</p> -->
-                        <el-button type="text" @click="innerVisible = true">查看完整状态</el-button>
+                        <el-button type="text" @click="innerVisibless = true">查看完整状态</el-button>
                     </div>
 
                     <!-- 任务进展完整状态 -->
-                    <el-dialog title="提示" :visible.sync="innerVisible" width="300px">
+                    <el-dialog title="提示" :visible.sync="innerVisibless" width="500px">
                     <div class="integrity">
-                        <h3 style="font-weight: normal;">任务进展:2</h3>
-                        <span class=""><i class="el-icon-circle-plus"></i>填写进展</span>
+                        <h3 style="font-weight: normal;display: inline-block;margin: 0 0 20px 0;">任务进展:2</h3>
+                        <span class="write"><i class="el-icon-circle-plus"></i>填写进展</span>
+                         <el-divider></el-divider>
+
+                         <!--  -->
+                            <div class="block">
+                                <el-timeline style="padding:20px 0 0 0;">
+                                    <el-timeline-item
+                                    v-for="(activity, index) in activities"
+                                    :key="index"
+                                    :icon="activity.icon"
+                                    :type="activity.type"
+                                    :color="activity.color"
+                                    :size="activity.size"
+                                    :timestamp="activity.timestamp">
+                                    {{activity.content}}
+                                    </el-timeline-item>
+                                </el-timeline>
+                            </div>
+                         <!--  -->
                     </div>
                     <span slot="footer" class="dialog-footer">
-                        <el-button @click="innerVisible = false">取 消</el-button>
-                        <el-button type="primary" @click="innerVisible = false">确 定</el-button>
+                        <el-button @click="innerVisibless = false">取 消</el-button>
+                        <el-button type="primary" @click="innerVisibless = false">确 定</el-button>
                     </span>
                     </el-dialog>
 
@@ -702,7 +720,25 @@ toolbar: 'bold italic underline strikethrough | fontsizeselect | forecolor backc
                 // cityOptions : ['渣渣灰', '小小', '嘿嘿', '嘀嘀','版本', '更新', '快速', '欧克'],
                 // checkedCities: []
                 checkList: ['小红'],
-                innerVisible: false // 任务展示弹出层
+                innerVisibless: false, // 任务展示弹出层
+                activities: [{
+                    content: '支持使用图标',
+                    timestamp: '2018-04-12 20:46',
+                    size: 'large',
+                    type: 'primary',
+                    icon: 'el-icon-more'
+                    }, {
+                    content: '支持自定义颜色',
+                    timestamp: '2018-04-03 20:46',
+                    color: '#0bbd87'
+                    }, {
+                    content: '支持自定义尺寸',
+                    timestamp: '2018-04-03 20:46',
+                    size: 'large'
+                    }, {
+                    content: '默认样式的节点',
+                    timestamp: '2018-04-03 20:46'
+                }]
             };
         },
         methods: {
@@ -2249,5 +2285,8 @@ toolbar: 'bold italic underline strikethrough | fontsizeselect | forecolor backc
 .integrity {
     padding: 15px;
 }
-.write {}
+.write {
+    float: right;
+    color: #1B9AEE;
+}
 </style>