Explorar el Código

调整公式成本统计的bug

Lijy hace 2 años
padre
commit
4a310a0d26

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

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

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

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

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

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