|
@@ -6,7 +6,7 @@
|
|
|
</view>
|
|
|
|
|
|
<view class="forms">
|
|
|
- <view class="title2">张三的金科环境项目日志</view>
|
|
|
+ <view class="title2">{{ userName }}的金科环境项目日志</view>
|
|
|
<view class="title-sub">日志详情</view>
|
|
|
<uni-forms label-position="left" class="form" ref="form" :rules="rules">
|
|
|
<view class="box" v-for="item in formData" :key="item.key">
|
|
@@ -82,7 +82,6 @@ import {
|
|
|
approvalEditLog,
|
|
|
} from "@/services/daily";
|
|
|
import { mapState, mapActions } from "vuex";
|
|
|
-import { formatDate } from "../../uni_modules/uni-dateformat/components/uni-dateformat/date-format";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -123,6 +122,13 @@ export default {
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(["projectList"]),
|
|
|
+ userName() {
|
|
|
+ if (this.log_id) {
|
|
|
+ return this.formData[0].author_name;
|
|
|
+ }
|
|
|
+ const user = uni.getStorageSync("user");
|
|
|
+ return user.CName;
|
|
|
+ },
|
|
|
},
|
|
|
methods: {
|
|
|
...mapActions(["queryProjectList"]),
|
|
@@ -131,12 +137,10 @@ export default {
|
|
|
return item ? item.project_name : "-";
|
|
|
},
|
|
|
selectProject(key, e) {
|
|
|
- console.log("---------befor----------", this.formData);
|
|
|
const select = this.projectList[e.target.value];
|
|
|
const item = this.formData.find((item) => item.key == key);
|
|
|
item.code_id = select.id;
|
|
|
item.project_name = select.project_name;
|
|
|
- console.log("---------after----------", this.formData);
|
|
|
// this.formData = [...this.formData];
|
|
|
},
|
|
|
addFormData() {
|
|
@@ -144,8 +148,6 @@ export default {
|
|
|
key: +new Date(),
|
|
|
project_name: "",
|
|
|
});
|
|
|
-
|
|
|
- console.log("---------addFormData----------", this.formData);
|
|
|
},
|
|
|
removeFormData(key) {
|
|
|
let index = this.formData.findIndex((item) => item.key == key);
|