|
@@ -4,9 +4,45 @@
|
|
|
|
|
|
<div class="login_form">
|
|
<div class="login_form">
|
|
<van-sticky :offset-top="46">
|
|
<van-sticky :offset-top="46">
|
|
- <van-field readonly clickable name="datetimePicker" :value="nowTime" label="时间选择" placeholder="点击选择时间"
|
|
|
|
- @click="showPicker = true" />
|
|
|
|
|
|
+ <van-cell title="时间选择" clickable :value="nowTime" @click="showPicker = true" />
|
|
</van-sticky>
|
|
</van-sticky>
|
|
|
|
+ <div v-if="user.manageDeptId != 0 || reportsCompany || reportsDept">
|
|
|
|
+ <van-sticky :offset-top="90">
|
|
|
|
+ <van-cell title="选择部门" clickable :value="departmentText" @click="selectDepartmentShow = true">
|
|
|
|
+ <template #extra>
|
|
|
|
+ <van-icon v-if="departmentText" name="close" class="clearSeach"
|
|
|
|
+ @click.stop="selectUserClear('dept')" />
|
|
|
|
+ </template>
|
|
|
|
+ <template #default>
|
|
|
|
+ <span v-if="user.userNameNeedTranslate == '1'">
|
|
|
|
+ <span v-if="departmentText">
|
|
|
|
+ <ww-open-data type='departmentName' :openid='departmentText'></ww-open-data>
|
|
|
|
+ </span>
|
|
|
|
+ </span>
|
|
|
|
+ <span v-else>{{ departmentText }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </van-cell>
|
|
|
|
+ </van-sticky>
|
|
|
|
+ <van-sticky :offset-top="134" class="one_report_select">
|
|
|
|
+ <van-cell title="选择人员" clickable :value="userNameValue" @click="selectUserShow = true"
|
|
|
|
+ value-class="userNameValue">
|
|
|
|
+ <template #extra>
|
|
|
|
+ <van-icon v-if="selectPeopleVal.name" name="close" class="clearSeach"
|
|
|
|
+ @click.stop="selectUserClear('user')" />
|
|
|
|
+ </template>
|
|
|
|
+ <template #default>
|
|
|
|
+ <span v-if="user.userNameNeedTranslate == '1'">
|
|
|
|
+ <span v-if="selectPeopleVal.name">
|
|
|
|
+ <ww-open-data type='userName' :openid='selectPeopleVal.name'></ww-open-data>
|
|
|
|
+ </span>
|
|
|
|
+ </span>
|
|
|
|
+ <span v-else>{{ userNameValue }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </van-cell>
|
|
|
|
+ </van-sticky>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+
|
|
<van-popup v-model="showPicker" position="bottom">
|
|
<van-popup v-model="showPicker" position="bottom">
|
|
<van-datetime-picker v-model="currentDate" type="date" :min-date="minDate" :max-date="maxDate"
|
|
<van-datetime-picker v-model="currentDate" type="date" :min-date="minDate" :max-date="maxDate"
|
|
@confirm="changeTime" @cancel="showPicker = false" />
|
|
@confirm="changeTime" @cancel="showPicker = false" />
|
|
@@ -33,8 +69,8 @@
|
|
</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div v-if="user.timeType.enableNewWeeklyfill == 1 && item.summary != null" style="margin-left:20px;"
|
|
<div v-if="user.timeType.enableNewWeeklyfill == 1 && item.summary != null" style="margin-left:20px;"
|
|
- v-html="'<b>'+item.summaryTitle+'</b><br>'+item.summary.replace(/\r\n/g, '<br>')">
|
|
|
|
-
|
|
|
|
|
|
+ v-html="'<b>' + item.summaryTitle + '</b><br>' + item.summary.replace(/\r\n/g, '<br>')">
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
<div v-for="(item1, index1) in item.data" class="one_report_data" :key="index1">
|
|
<div v-for="(item1, index1) in item.data" class="one_report_data" :key="index1">
|
|
<div class="project_title" style="font-weight:bold;">项目:{{ item1.project }} <span
|
|
<div class="project_title" style="font-weight:bold;">项目:{{ item1.project }} <span
|
|
@@ -73,12 +109,16 @@
|
|
<div style="color:red;" v-if="item1.state == 2 && item1.rejectReason != null">原因:{{
|
|
<div style="color:red;" v-if="item1.state == 2 && item1.rejectReason != null">原因:{{
|
|
item1.rejectReason }}
|
|
item1.rejectReason }}
|
|
</div>
|
|
</div>
|
|
- <div class="project_title" v-if="item1.subProjectName != null && user.companyId != yuzhongCompId">子项目:{{ item1.subProjectName }}</div>
|
|
|
|
- <div class="project_title" v-if="user.companyId == yuzhongCompId" >角色:{{item1.extraField1?roleList.find(r=>r.value==item1.extraField1).label:''}}</div>
|
|
|
|
|
|
+ <div class="project_title" v-if="item1.subProjectName != null && user.companyId != yuzhongCompId">
|
|
|
|
+ 子项目:{{ item1.subProjectName }}</div>
|
|
|
|
+ <div class="project_title" v-if="user.companyId == yuzhongCompId">
|
|
|
|
+ 角色:{{ item1.extraField1 ? roleList.find(r => r.value == item1.extraField1).label : '' }}</div>
|
|
<div class="project_title" v-if="user.company.packageProject == 1 && item1.groupName != null">
|
|
<div class="project_title" v-if="user.company.packageProject == 1 && item1.groupName != null">
|
|
任务分组:{{ item1.groupName }}</div>
|
|
任务分组:{{ item1.groupName }}</div>
|
|
- <div class="project_title" v-if="user.companyId == yuzhongCompId" >工作职责:{{item1.extraField2?item1.extraField2Name:''}}</div>
|
|
|
|
- <div class="project_title" v-if="user.companyId == yuzhongCompId" >工作内容:{{item1.extraField3?item1.extraField3Name:''}}</div>
|
|
|
|
|
|
+ <div class="project_title" v-if="user.companyId == yuzhongCompId">
|
|
|
|
+ 工作职责:{{ item1.extraField2 ? item1.extraField2Name : '' }}</div>
|
|
|
|
+ <div class="project_title" v-if="user.companyId == yuzhongCompId">
|
|
|
|
+ 工作内容:{{ item1.extraField3 ? item1.extraField3Name : '' }}</div>
|
|
<div class="project_title" v-if="user.company.packageProject == 1 && item1.stage != '-'">
|
|
<div class="project_title" v-if="user.company.packageProject == 1 && item1.stage != '-'">
|
|
投入阶段:{{ item1.stage }}</div>
|
|
投入阶段:{{ item1.stage }}</div>
|
|
<!--自定义维度 -->
|
|
<!--自定义维度 -->
|
|
@@ -149,16 +189,81 @@
|
|
<van-empty v-if="report.length == 0" description="暂无日报">
|
|
<van-empty v-if="report.length == 0" description="暂无日报">
|
|
<van-button round type="primary" class="bottom-button" @click="toWriteReport()">去填写</van-button>
|
|
<van-button round type="primary" class="bottom-button" @click="toWriteReport()">去填写</van-button>
|
|
</van-empty>
|
|
</van-empty>
|
|
|
|
+
|
|
|
|
+ <!-- 人员选择 -->
|
|
|
|
+ <van-popup v-model="selectUserShow" position="bottom" style="height: 90%">
|
|
|
|
+ <div class="popupDiv">
|
|
|
|
+ <div class="popupSearch">
|
|
|
|
+ <van-search v-model.trim="searchInputValue" placeholder="输入员工姓名搜索" @clear="userListSearch" @search="userListSearch"
|
|
|
|
+ shape="round" background="#F4F4F4"></van-search>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="popupCon conBorder" style="flex: 1;background-color: #fff;">
|
|
|
|
+ <div class="popupConBox">
|
|
|
|
+ <van-radio-group v-model="selectPeopleVal">
|
|
|
|
+ <van-radio v-for="uitem in showUserList" :key="uitem.id" :name="uitem" style="padding:10px"
|
|
|
|
+ class="popupItem marginNone borderNone">
|
|
|
|
+ <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName'
|
|
|
|
+ :openid='uitem.name'></ww-open-data></span>
|
|
|
|
+ <span v-else>{{ uitem.name ? uitem.name : '' }}</span>
|
|
|
|
+ </van-radio>
|
|
|
|
+ </van-radio-group>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="popupBtn">
|
|
|
|
+ <van-button style="width:100%;background: #1989fa;color: #ffffff;" round
|
|
|
|
+ @click="selectUserConfirm()">确定</van-button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </van-popup>
|
|
|
|
+
|
|
|
|
+ <!-- 部门选择 -->
|
|
|
|
+ <van-popup v-model="selectDepartmentShow" position="bottom" style="height: 90%">
|
|
|
|
+ <div class="popupDiv">
|
|
|
|
+ <div class="comPaceholder">
|
|
|
|
+ 已选择部门:
|
|
|
|
+ <span v-if="user.userNameNeedTranslate != '1'">
|
|
|
|
+ {{ selectDepartmentText.length > 0 ? selectDepartmentText[0].label : '请选择部门' }}
|
|
|
|
+ </span>
|
|
|
|
+ <span v-else>
|
|
|
|
+ <span v-if="selectDepartmentText.length > 0">
|
|
|
|
+ <ww-open-data type='departmentName' :openid='selectDepartmentText[0].label'></ww-open-data>
|
|
|
|
+ </span>
|
|
|
|
+ <span v-else>请选择部门</span>
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="popupCon conBorder comTree" style="flex: 1;">
|
|
|
|
+ <el-tree :data="departmentList" :props="defaultProps" @node-click="treeNodeClick">
|
|
|
|
+ <span class="custom-tree-node" slot-scope="{ node }">
|
|
|
|
+ <span v-if="user.userNameNeedTranslate == '1'">
|
|
|
|
+ <span>
|
|
|
|
+ <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
|
|
|
|
+ </span>
|
|
|
|
+ </span>
|
|
|
|
+ <span v-if="user.userNameNeedTranslate != '1'">
|
|
|
|
+ {{ node.label }}
|
|
|
|
+ </span>
|
|
|
|
+ </span>
|
|
|
|
+ </el-tree>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="popupBtn">
|
|
|
|
+ <van-button style="width:100%;background: #1989fa;color: #ffffff;" round
|
|
|
|
+ @click="treeBtn">确定</van-button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </van-popup>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
export default {
|
|
export default {
|
|
|
|
+ components: {},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
yuzhongCompId: 3385,
|
|
yuzhongCompId: 3385,
|
|
- roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
|
|
|
|
|
|
+ roleList: [{ value: 1, label: 'CRC&LM' }, { value: 2, label: 'PM' }],
|
|
tmpPics: [],
|
|
tmpPics: [],
|
|
imgShow: false,
|
|
imgShow: false,
|
|
hasWaiting: false,
|
|
hasWaiting: false,
|
|
@@ -173,6 +278,24 @@ export default {
|
|
report: [],
|
|
report: [],
|
|
fullDayTxt: ['全天', '上午', '下午'],
|
|
fullDayTxt: ['全天', '上午', '下午'],
|
|
statusTxt: ["待审核", "已通过", "已驳回", "待提交"],
|
|
statusTxt: ["待审核", "已通过", "已驳回", "待提交"],
|
|
|
|
+ selectUserShow: false,
|
|
|
|
+ searchInputValue: '',
|
|
|
|
+ userList: '',
|
|
|
|
+ showUserList: '',
|
|
|
|
+ userIdList: '',
|
|
|
|
+ userNameValue: '',
|
|
|
|
+ selectPeopleVal: {},
|
|
|
|
+
|
|
|
|
+ selectDepartmentShow: false,
|
|
|
|
+ selectDepartmentText: [],
|
|
|
|
+ departmentText: '',
|
|
|
|
+ departmentList: [],
|
|
|
|
+ defaultProps: {
|
|
|
|
+ children: 'children',
|
|
|
|
+ label: 'label'
|
|
|
|
+ },
|
|
|
|
+ reportsCompany: false,
|
|
|
|
+ reportsDept: false
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -182,12 +305,94 @@ export default {
|
|
this.imgShow = true;
|
|
this.imgShow = true;
|
|
this.tmpPics = item;
|
|
this.tmpPics = item;
|
|
},
|
|
},
|
|
-
|
|
|
|
// 返回
|
|
// 返回
|
|
back() {
|
|
back() {
|
|
history.back();
|
|
history.back();
|
|
},
|
|
},
|
|
|
|
+ getUsers() {
|
|
|
|
+ this.$axios.post("/user/getEmployeeList", {
|
|
|
|
+ departmentId: -1,
|
|
|
|
+ pageIndex: 1,
|
|
|
|
+ pageSize: -1
|
|
|
|
+ })
|
|
|
|
+ .then(res => {
|
|
|
|
+ if (res.code == "ok") {
|
|
|
|
+ this.userList = res.data.records;
|
|
|
|
+ this.showUserList = res.data.records
|
|
|
|
+ } else {
|
|
|
|
+ this.$toast.fail('获取失败');
|
|
|
|
+ }
|
|
|
|
+ }).catch(err => { this.$toast.clear(); });
|
|
|
|
+ },
|
|
|
|
+ getDepartmentList() {
|
|
|
|
+ this.$axios.post("/department/list", {})
|
|
|
|
+ .then(res => {
|
|
|
|
+ if (res.code == "ok") {
|
|
|
|
+ this.departmentList = res.data;
|
|
|
|
+ } else {
|
|
|
|
+ this.$toast.fail('获取失败');
|
|
|
|
+ }
|
|
|
|
+ }).catch(err => { this.$toast.clear(); });
|
|
|
|
+ },
|
|
|
|
+ userListSearch(val) {
|
|
|
|
+ const { userNameNeedTranslate } = this.user
|
|
|
|
+ if(!this.searchInputValue) {
|
|
|
|
+ this.showUserList = JSON.parse(JSON.stringify(this.userList))
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (userNameNeedTranslate != 1) {
|
|
|
|
+ const newUserList = JSON.parse(JSON.stringify(this.userList))
|
|
|
|
+ this.showUserList = newUserList.filter(item => item.name.indexOf(this.searchInputValue) != -1)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (userNameNeedTranslate == 1) {
|
|
|
|
+ this.$axios.post("/user/getEmployeeList", {
|
|
|
|
+ departmentId: -1, pageIndex: 1, pageSize: 200,
|
|
|
|
+ keyword: this.searchInputValue, status: '',
|
|
|
|
+ roleId: '', cursor: '', onlyDirect: 0, matchingType: 0
|
|
|
|
+ })
|
|
|
|
+ .then(res => {
|
|
|
|
+ if (res.code == "ok") {
|
|
|
|
+ const dataList = res.data.records
|
|
|
|
+ const userNameList = dataList.map(item => item.name)
|
|
|
|
+ const newUserList = JSON.parse(JSON.stringify(this.userList))
|
|
|
|
+ this.showUserList = newUserList.filter(item => userNameList.some(uItem => uItem.includes(item.name)))
|
|
|
|
+ console.log(userNameList)
|
|
|
|
+ } else {
|
|
|
|
+ this.$toast.fail('搜索失败');
|
|
|
|
+ }
|
|
|
|
+ }).catch(err => { this.$toast.clear(); });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ selectUserConfirm() {
|
|
|
|
+ console.log(this.selectPeopleVal)
|
|
|
|
|
|
|
|
+ this.selectUserShow = false
|
|
|
|
+ this.getReport()
|
|
|
|
+ },
|
|
|
|
+ selectUserClear(str) {
|
|
|
|
+ if (str == 'user') {
|
|
|
|
+ this.selectPeopleVal = {}
|
|
|
|
+ }
|
|
|
|
+ if (str == 'dept') {
|
|
|
|
+ this.departmentText = '',
|
|
|
|
+ this.selectDepartmentText = []
|
|
|
|
+ }
|
|
|
|
+ this.getReport()
|
|
|
|
+ },
|
|
|
|
+ treeNodeClick(item) {
|
|
|
|
+ this.selectDepartmentText = [item]
|
|
|
|
+ },
|
|
|
|
+ treeBtn() {
|
|
|
|
+ if (this.selectDepartmentText.length <= 0) {
|
|
|
|
+ this.$toast('请选择部门');
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.departmentText = this.selectDepartmentText[0].label
|
|
|
|
+ this.selectDepartmentShow = false
|
|
|
|
+ this.getReport()
|
|
|
|
+ },
|
|
// 时间转换
|
|
// 时间转换
|
|
format(date, pattern) {
|
|
format(date, pattern) {
|
|
pattern = pattern || "yyyy-MM-dd";
|
|
pattern = pattern || "yyyy-MM-dd";
|
|
@@ -226,7 +431,16 @@ export default {
|
|
forbidClick: true,
|
|
forbidClick: true,
|
|
duration: 0
|
|
duration: 0
|
|
});
|
|
});
|
|
- this.$axios.post("/report/getReportList", { date: this.nowTime })
|
|
|
|
|
|
+ let pames = {
|
|
|
|
+ date: this.nowTime,
|
|
|
|
+ }
|
|
|
|
+ if (this.selectPeopleVal.id) {
|
|
|
|
+ pames.userId = this.selectPeopleVal.id
|
|
|
|
+ }
|
|
|
|
+ if (this.departmentText && this.selectDepartmentText.length > 0) {
|
|
|
|
+ pames.deptId = this.selectDepartmentText[0].id
|
|
|
|
+ }
|
|
|
|
+ this.$axios.post("/report/getReportList", pames)
|
|
.then(res => {
|
|
.then(res => {
|
|
if (res.code == "ok") {
|
|
if (res.code == "ok") {
|
|
this.$toast.clear();
|
|
this.$toast.clear();
|
|
@@ -247,7 +461,7 @@ export default {
|
|
// 点击编辑
|
|
// 点击编辑
|
|
editor(item) {
|
|
editor(item) {
|
|
var path = '/edit';
|
|
var path = '/edit';
|
|
- if(this.user.timeType.enableNewWeeklyfill == 1) {
|
|
|
|
|
|
+ if (this.user.timeType.enableNewWeeklyfill == 1) {
|
|
//物奇要填到按周填报
|
|
//物奇要填到按周填报
|
|
path = '/weekEdit';
|
|
path = '/weekEdit';
|
|
}
|
|
}
|
|
@@ -261,7 +475,7 @@ export default {
|
|
// 去填写日报
|
|
// 去填写日报
|
|
toWriteReport() {
|
|
toWriteReport() {
|
|
var path = '/edit';
|
|
var path = '/edit';
|
|
- if(this.user.timeType.enableNewWeeklyfill == 1) {
|
|
|
|
|
|
+ if (this.user.timeType.enableNewWeeklyfill == 1) {
|
|
//物奇要填到按周填报
|
|
//物奇要填到按周填报
|
|
path = '/weekEdit';
|
|
path = '/weekEdit';
|
|
}
|
|
}
|
|
@@ -278,7 +492,18 @@ export default {
|
|
this.nowTime = sessionStorage.targetDate;
|
|
this.nowTime = sessionStorage.targetDate;
|
|
sessionStorage.removeItem('targetDate');
|
|
sessionStorage.removeItem('targetDate');
|
|
}
|
|
}
|
|
|
|
+ const { functionList } = this.user
|
|
|
|
+ for (var i in functionList) {
|
|
|
|
+ if (functionList[i].name == '查看全公司工时') {
|
|
|
|
+ this.reportsCompany = true
|
|
|
|
+ }
|
|
|
|
+ if (functionList[i].name == '查看本部门工时') {
|
|
|
|
+ this.查看本部门工时 = true
|
|
|
|
+ }
|
|
|
|
+ }
|
|
this.getReport();
|
|
this.getReport();
|
|
|
|
+ this.getUsers()
|
|
|
|
+ this.getDepartmentList()
|
|
}
|
|
}
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
@@ -293,6 +518,10 @@ export default {
|
|
font-size: 14px;
|
|
font-size: 14px;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+.one_report_select {
|
|
|
|
+ margin-bottom: 15px;
|
|
|
|
+}
|
|
|
|
+
|
|
.form_text {
|
|
.form_text {
|
|
margin: 15px 0 15px;
|
|
margin: 15px 0 15px;
|
|
padding: 0 12px;
|
|
padding: 0 12px;
|
|
@@ -314,6 +543,19 @@ export default {
|
|
line-height: 30px;
|
|
line-height: 30px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+.comPaceholder {
|
|
|
|
+ margin: 10px 15px;
|
|
|
|
+ background: #fff;
|
|
|
|
+ padding: 10px 10px;
|
|
|
|
+ border-radius: 6px;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ color: #606266;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.comTree {
|
|
|
|
+ background: #ffffff;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|
|
<style lang="less">
|
|
<style lang="less">
|
|
.van-nav-bar .van-icon,
|
|
.van-nav-bar .van-icon,
|
|
@@ -349,4 +591,15 @@ export default {
|
|
background-color: rgb(53, 130, 245);
|
|
background-color: rgb(53, 130, 245);
|
|
border-color: rgb(53, 130, 245);
|
|
border-color: rgb(53, 130, 245);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+.clearSeach {
|
|
|
|
+ line-height: 0.64rem;
|
|
|
|
+ position: relative;
|
|
|
|
+ left: 5px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.userNameValue {
|
|
|
|
+ white-space: nowrap;
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|