|
@@ -43,7 +43,7 @@
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item :label="$t('weekDay.date')">
|
|
|
|
|
|
+ <el-form-item :label="$t('weekDay.date')" v-if="false">
|
|
<el-date-picker
|
|
<el-date-picker
|
|
v-model="dataTime"
|
|
v-model="dataTime"
|
|
type="daterange"
|
|
type="daterange"
|
|
@@ -55,8 +55,8 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item style="margin-left:20px;">
|
|
<el-form-item style="margin-left:20px;">
|
|
- <el-button @click="batchApprove(true)" style="margin-left:10px;" :loading="batchApproveLoading" :disabled="multipleSelection.length==0" size="mini">{{ $t('Batchthrough') }}</el-button>
|
|
|
|
- <el-button @click="batchApprove(false)" :disabled="multipleSelection.length==0" size="mini">{{ $t('Batchrejected') }}</el-button>
|
|
|
|
|
|
+ <el-button @click="batchCallThrough()" style="margin-left:10px;" :loading="batchApproveLoading" :disabled="multipleSelection.length==0" size="mini">{{ $t('Batchthrough') }}</el-button>
|
|
|
|
+ <el-button @click="batchRejection()" :disabled="multipleSelection.length==0" size="mini">{{ $t('Batchrejected') }}</el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item style="margin-left:20px;">
|
|
<el-form-item style="margin-left:20px;">
|
|
<el-link type="primary" @click="recordList(),recordDialogVisible = true,pageIndexList = 1,pageSizeList = 20">{{ $t('Auditrecords') }}</el-link>
|
|
<el-link type="primary" @click="recordList(),recordDialogVisible = true,pageIndexList = 1,pageSizeList = 20">{{ $t('Auditrecords') }}</el-link>
|
|
@@ -70,11 +70,12 @@
|
|
|
|
|
|
<!--列表-->
|
|
<!--列表-->
|
|
<div class="reviewTable" ref="reviewTable">
|
|
<div class="reviewTable" ref="reviewTable">
|
|
- <el-table :data="list" style="width: 100%">
|
|
|
|
|
|
+ <el-table :data="list" style="width: 100%" @selection-change="weeklyReportRowSelect">
|
|
|
|
+ <el-table-column type="selection" width="55"></el-table-column>
|
|
<el-table-column type="expand">
|
|
<el-table-column type="expand">
|
|
<template slot-scope="props">
|
|
<template slot-scope="props">
|
|
<div style="padding: 10px 30px">
|
|
<div style="padding: 10px 30px">
|
|
- <el-table :data="props.row.dataList" style="width: 100%" border @selection-change="(e) => weeklyReportItemSelect(e, props.row)">
|
|
|
|
|
|
+ <el-table :data="props.row.dataList" style="width: 100%" border @selection-change="(e) => weeklyReportItemSelect(e, props.row)" :span-method="({rowIndex, columnIndex}) => mergeCellsRow({ rowIndex, columnIndex, dataLength: props.row.dataList.length, columnLength: props.row.dataList.length })">
|
|
<el-table-column type="selection" width="55"></el-table-column>
|
|
<el-table-column type="selection" width="55"></el-table-column>
|
|
<el-table-column label="日期" prop="userName">
|
|
<el-table-column label="日期" prop="userName">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
@@ -91,8 +92,8 @@
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</template>
|
|
</template>
|
|
<el-table-column label="操作" fixed="right" width="220">
|
|
<el-table-column label="操作" fixed="right" width="220">
|
|
- <el-button type="success" size="small" :disabled="props.row.selectItem.length <= 0">通过</el-button>
|
|
|
|
- <el-button type="danger" size="small" :disabled="props.row.selectItem.length <= 0">驳回</el-button>
|
|
|
|
|
|
+ <el-button type="success" size="small" :disabled="props.row.selectItem.length <= 0" @click="rowMeans(props.row)">通过</el-button>
|
|
|
|
+ <el-button type="danger" size="small" :disabled="props.row.selectItem.length <= 0" @click="rowRejection(props.row)">驳回</el-button>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
</div>
|
|
</div>
|
|
@@ -398,6 +399,7 @@
|
|
reason: ''
|
|
reason: ''
|
|
},
|
|
},
|
|
undoBathFormLoading: false,
|
|
undoBathFormLoading: false,
|
|
|
|
+ tableSelectRow: []
|
|
};
|
|
};
|
|
},
|
|
},
|
|
filters: {
|
|
filters: {
|
|
@@ -768,8 +770,122 @@
|
|
return tablePush;
|
|
return tablePush;
|
|
},
|
|
},
|
|
weeklyReportItemSelect(val, row) {
|
|
weeklyReportItemSelect(val, row) {
|
|
- console.log(val, row)
|
|
|
|
|
|
+ const { itemIndex } = row
|
|
|
|
+ const selectItemVal = val.map(item => item.weekDayTxt)
|
|
|
|
+ this.list[itemIndex].selectItem = selectItemVal
|
|
},
|
|
},
|
|
|
|
+ weeklyReportRowSelect(val) {
|
|
|
|
+ this.multipleSelection = val
|
|
|
|
+ },
|
|
|
|
+ rowMeans(val) {
|
|
|
|
+ const row = this.list[val.itemIndex]
|
|
|
|
+ const { daySummaryList, selectItem } = row
|
|
|
|
+ const newList = daySummaryList.filter(item => selectItem.includes(item.weekDayTxt))
|
|
|
|
+ const mergedProjectList = newList.map(item => item.projectList).reduce((acc, curr) => acc.concat(curr), []);
|
|
|
|
+ const idList = mergedProjectList.map(item => item.id)
|
|
|
|
+ this.callThrough(idList.join(','))
|
|
|
|
+ },
|
|
|
|
+ batchCallThrough() {
|
|
|
|
+ const val = this.multipleSelection
|
|
|
|
+ const dataList = val.flatMap(item =>
|
|
|
|
+ item.daySummaryList.flatMap(daySummary =>
|
|
|
|
+ daySummary.projectList
|
|
|
|
+ )
|
|
|
|
+ );
|
|
|
|
+ const ids = dataList.map(item => item.id)
|
|
|
|
+ this.callThrough(ids.join(','))
|
|
|
|
+ },
|
|
|
|
+ callThrough(ids) {
|
|
|
|
+ this.http.post(`/report/approve`, { reportIds: ids },
|
|
|
|
+ res => {
|
|
|
|
+ if (res.code == "ok") {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '操作成功',
|
|
|
|
+ type: "success"
|
|
|
|
+ });
|
|
|
|
+ this.getList()
|
|
|
|
+ } else {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: res.msg,
|
|
|
|
+ type: "error"
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ error => {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: error,
|
|
|
|
+ type: "error"
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ rowRejection(val) {
|
|
|
|
+ const row = this.list[val.itemIndex]
|
|
|
|
+ const { daySummaryList, selectItem } = row
|
|
|
|
+ const newList = daySummaryList.filter(item => selectItem.includes(item.weekDayTxt))
|
|
|
|
+ console.log(newList, '<==== newList')
|
|
|
|
+ const mergedProjectList = newList.map(item => item.projectList).reduce((acc, curr) => acc.concat(curr), []);
|
|
|
|
+ const idList = mergedProjectList.map(item => item.id)
|
|
|
|
+ const text = newList.map(item => item.weekDayTxt)
|
|
|
|
+ this.$prompt(`确定驳回【${text.join(',')}】这些日报吗?`, '', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ inputPattern: /^(?!\s*$).+/,
|
|
|
|
+ inputErrorMessage: '请输入驳回原因',
|
|
|
|
+ inputPlaceholder: '请输入驳回原因'
|
|
|
|
+ }).then(({ value }) => {
|
|
|
|
+ this.rejectionReport(idList.join(','), value)
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ batchRejection() {
|
|
|
|
+ const val = this.multipleSelection
|
|
|
|
+ const dataList = val.flatMap(item =>
|
|
|
|
+ item.daySummaryList.flatMap(daySummary =>
|
|
|
|
+ daySummary.projectList
|
|
|
|
+ )
|
|
|
|
+ );
|
|
|
|
+ const ids = dataList.map(item => item.id)
|
|
|
|
+ this.$prompt(`确定驳回选中的这些日报吗?`, '', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ inputPattern: /^(?!\s*$).+/,
|
|
|
|
+ inputErrorMessage: '请输入驳回原因',
|
|
|
|
+ inputPlaceholder: '请输入驳回原因'
|
|
|
|
+ }).then(({ value }) => {
|
|
|
|
+ this.rejectionReport(ids.join(','), value)
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ rejectionReport(ids, reason) {
|
|
|
|
+ this.http.post(`/report/batchDenyReport`, { ids, reason },
|
|
|
|
+ res => {
|
|
|
|
+ if (res.code == "ok") {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '操作成功',
|
|
|
|
+ type: "success"
|
|
|
|
+ });
|
|
|
|
+ this.getList()
|
|
|
|
+ } else {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: res.msg,
|
|
|
|
+ type: "error"
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ error => {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: error,
|
|
|
|
+ type: "error"
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ mergeCellsRow({ rowIndex, columnIndex, dataLength, columnLength }) {
|
|
|
|
+ if (columnIndex === (+(columnLength || 0) + 2)) {
|
|
|
|
+ if (rowIndex === 0) {
|
|
|
|
+ return [dataLength, 1]; // 合并最后一列的所有行
|
|
|
|
+ }
|
|
|
|
+ return [0, 0]; // 不显示其他行
|
|
|
|
+ }
|
|
|
|
+ return [1, 1]; // 其他列不合并
|
|
|
|
+ },
|
|
//获取待审核的数据列表
|
|
//获取待审核的数据列表
|
|
getList(e) {
|
|
getList(e) {
|
|
this.listLoading = true;
|
|
this.listLoading = true;
|
|
@@ -800,15 +916,21 @@
|
|
res => {
|
|
res => {
|
|
this.listLoading = false;
|
|
this.listLoading = false;
|
|
if (res.code == "ok") {
|
|
if (res.code == "ok") {
|
|
- // for (let entry of res.data) {
|
|
|
|
- // let reviewerNames = (entry.data || []).map(item => item.projectAuditorName);
|
|
|
|
- // let uniqueReviewerNames = [...new Set(reviewerNames)];
|
|
|
|
- // entry.reviewerNames = uniqueReviewerNames;
|
|
|
|
- // }
|
|
|
|
- const newList = res.data.map(item => {
|
|
|
|
|
|
+ if(!res.data) {
|
|
|
|
+ this.listBackup = []
|
|
|
|
+ this.list = []
|
|
|
|
+ let total = 0
|
|
|
|
+ this.reviewTableObj = {
|
|
|
|
+ reviewTableTotal: total,
|
|
|
|
+ reviewTableIndex: 1,
|
|
|
|
+ reviewTableSize: this.reviewTableObj.reviewTableSize
|
|
|
|
+ }
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ const newList = (res.data || []).map((item, index) => {
|
|
const daySummaryList = (item.daySummaryList || []).filter(item => (item.projectList || []).length > 0)
|
|
const daySummaryList = (item.daySummaryList || []).filter(item => (item.projectList || []).length > 0)
|
|
const dataList = daySummaryList.map(item => {
|
|
const dataList = daySummaryList.map(item => {
|
|
- const projectList = item.projectList.reduce((acc, curr) => {
|
|
|
|
|
|
+ const projectList = (item.projectList || []).reduce((acc, curr) => {
|
|
acc[curr.project] = curr;
|
|
acc[curr.project] = curr;
|
|
return acc;
|
|
return acc;
|
|
}, {});
|
|
}, {});
|
|
@@ -827,6 +949,7 @@
|
|
daySummaryList,
|
|
daySummaryList,
|
|
projectNameList,
|
|
projectNameList,
|
|
dataList,
|
|
dataList,
|
|
|
|
+ itemIndex:index,
|
|
selectItem: []
|
|
selectItem: []
|
|
}
|
|
}
|
|
})
|
|
})
|