| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720 |
- <template>
- <section>
- <!--列表-->
- <el-table :data="list" ref="multipleTable" v-if="showTable" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;"
- :default-expand-all="defaultExpandAllFlg" >
- <el-table-column type="selection" width="55"></el-table-column>
- <el-table-column type="expand" :label="''">
- <!-- <template slot-scope="props">
- <el-timeline>
-
- </el-timeline>
- </template> -->
- </el-table-column>
- <el-table-column prop="projectName" :label="'项目名称'" sortable>
- <template slot-scope="scope">
- <div>
- <span>
- {{scope.row.projectName}}
- </span>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="groupName" :label="'分组名称'" sortable>
- <template slot-scope="scope">
- <div>
- <span>
- {{scope.row.groupName}}
- </span>
- </div>
- </template>
- </el-table-column>
-
- <el-table-column prop="creator" :label="'提交人'" sortable>
- <template slot-scope="scope">
- <div>
- <span v-if="user.userNameNeedTranslate == '1'">
- <ww-open-data type='userName' :openid='scope.row.creator'></ww-open-data>
- </span>
- <span v-else>
- {{scope.row.creator}}
- </span>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="createTime" :label="'提交时间'" sortable>
- <template slot-scope="scope">
- <div>
- <span>
- {{scope.row.createTime}}
- </span>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="oldManDay" :label="'变更前预估工时'" sortable>
- <template slot-scope="scope">
- <div>
- <span>
- {{scope.row.oldManDay}}
- </span>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="changeManDay" :label="'预估工时变更'" sortable>
- <template slot-scope="scope">
- <div>
- <span>
- {{scope.row.changeManDay}}
- </span>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="nowManDay" :label="'变更后预估工时'" sortable>
- <template slot-scope="scope">
- <div>
- <span>
- {{scope.row.nowManDay}}
- </span>
- </div>
- </template>
- </el-table-column>
-
- <el-table-column prop="status" :label="$t('state.states')" sortable>
- <template slot-scope="scope">
- <span v-if="scope.row.status == 0" style="color:#DAA520;">{{ '待审核'}}</span>
- <span v-else-if="scope.row.status == 1" style="color:#32CD32;">{{ $t('state.alreadyPassed') }}</span>
- <span v-else-if="scope.row.status == 2" style="color:#FF0000;">{{ $t('state.rejected') }}</span>
- </template>
- </el-table-column>
- <el-table-column :label="$t('operation')" width="220">
- <template slot-scope="scope">
- <el-button v-if="scope.row.status==0" type="primary" :loading="logining" size="small" @click="review(scope.row.id,1)">{{ $t('btn.through') }}</el-button>
- <el-button v-if="scope.row.status==0" type="danger" :loading="logining" size="small" @click="review(scope.row.id,2)">{{ $t('btn.rejected') }}</el-button>
- </template>
- </el-table-column>
- </el-table>
- <!--工具条-->
- <!-- <el-col v-if="search.value != -1" :span="24" class="toolbar">
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :page-sizes="[20 , 50 , 80 , 100]"
- :page-size="20"
- layout="total, sizes, prev, pager, next"
- :total="total"
- style="float:right;"
- ></el-pagination>
- </el-col> -->
- </section>
- </template>
- <script>
- import util from "../../common/js/util";
- // 引入自定义组件
- import selectCat from "@/components/select.vue"
- // 引入自定义级联组件
- import vueCascader from "@/components/cascader.vue"
- import cascaderOption from "@/components/cascaderOption.vue"
- export default {
- components: {
- selectCat,
- vueCascader,
- cascaderOption
- },
- data() {
- return {
- yuzhongCompId: 3385,
- roleList:[{value: 1,label: 'CRC&LM'},{value: 2,label: 'PM'}],
- batchDenyLoading: false,
- batchDenyDialog: false,
- batchDenyData: {ids:'',reason:''},
- batchApproveLoading: false,
- denyForm:null,
- denyReasonDialog:false,
- isAllSelect:false,
- user: JSON.parse(sessionStorage.getItem("user")),
- permissions: JSON.parse(sessionStorage.getItem("permissions")),
- search: {
- projectId:null,
- departmentIdArray: null,
- departmentId:null,
- // date: null,
- startDate: null,
- endDate: null,
- state:0,
- userId: null,
- userIdArray: []
- },
- users: [],
- option:[],
- tableHeight: 0,
- listLoading: false,
- total: 0,
- page: 1,
- size: 20,
- list: [],
- logining: false,
- multipleSelection: [],
- usersList: [],
- searchUsersList: [],
- dataTime: [],
- recordDialogVisible: false,
- recordLists: [],
- totals: 0,
- pageIndexList: 1,
- pageSizeList: 20,
- undoForm: {
- // reason: '',
- // userId: '',
- // createDate: ''
- },
- undoFormDialog: false,
- detailsDialog: false,
- idx: 0, // 详情索引
- detailsList: [],
- undoFormLoading: false,
- approveinData: null,
- approveinDialog: false,
- isbatch: false,
- defaultExpandAllFlg: false,
- showTable: true
- };
- },
- filters: {
- // 过滤
- amounts(value) {
- var zhi = +value + 0
- return zhi.toFixed(1)
- }
- },
- methods: {
- viewOneReport(r) {
- this.http.post("/report/getAuditWorkflowList", {reportId:r.id},
- res => {
- if (res.code == "ok") {
- this.$set(r,'auditorList', res.data);
- }
- },
- error => {
- this.undoFormLoading = false
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- expandChange(row, expandedRows) {
- var reportList = row.data;
- for (var i=0;i<reportList.length; i++) {
- var r = reportList[i];
- if (r.auditorList) continue;
- this.http.post("/report/getAuditWorkflowList", {reportId:r.id},
- res => {
- if (res.code == "ok") {
- this.$set(r,'auditorList', res.data);
- }
- },
- error => {
- this.undoFormLoading = false
- this.$message({
- message: error,
- type: "error"
- });
- });
- }
- },
- detailsClick(item, i) {
- this.detailsDialog = true
- this.detailsList = item.membdateList
- this.idx = i
- },
- // 审核记录撤销点击确定
- clickCancel() {
- this.undoFormLoading = true
- this.http.post('/report/denyHisReport', this.undoForm,
- res => {
- this.undoFormLoading = false
- if (res.code == "ok") {
- this.$message({
- message: this.$t('Revocationofsuccess'),
- type: "success"
- });
- this.undoFormDialog = false
- this.recordList()
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.undoFormLoading = false
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- undoCli(item, i) {
- // console.log(item)
- this.undoFormDialog = true
- this.undoForm = {reason: ''}
- // this.undoForm.reason = ''
- if(i){
- this.undoForm.hisId = item.id
- }else{
- this.undoForm.hisId = item.membdateList[0].id
- }
-
- this.ioss = i
- // if(i == 0) {
- // this.undoForm.createDate = item.indate.split(' ')[0]
- // this.undoForm.userId = item.userId
- // } else {
- // this.undoForm.hisId = item.id
- // }
- },
- // 获取审核记录
- recordList() {
- // this.recordDialogVisible = true
- // return
- this.http.post( '/report-audit-log/getProjectReportAuditLog', {
- companyId: this.user.companyId,
- pageIndex: this.pageIndexList,
- pageSize: this.pageSizeList
- },
- res => {
- if (res.code == "ok") {
- for (var i in res.data.records) {
- res.data.records[i].result.indexOf(this.$t('btn.through')) == '-1' ? res.data.records[i].flg = false : res.data.records[i].flg = true
- }
- this.recordLists = res.data.records
- this.totals = res.data.total
- if(this.recordLists.length != 0){
- this.detailsList = this.recordLists[this.idx].membdateList
- }
-
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 获取部门列表
- getDepartment() {
- this.http.post( this.port.manage.depList, {},
- res => {
- if (res.code == "ok") {
- var list1 = JSON.parse(JSON.stringify(res.data));
-
- this.option = this.changeArr(list1);
- console.log(this.option, '部门')
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- handleSelectionChange(val) {
- this.multipleSelection = val;
- },
- batchApprove(isPass) {
- var ids = '';
- for (var i=0;i<this.multipleSelection.length; i++) {
- var line = this.multipleSelection[i];
- var array = line.data;
- if (this.user.company.companyName == '成都明夷电子科技有限公司') {
- ids += line.reportIds+',';
- } else {
- for (var m=0;m<array.length; m++) {
- ids += array[m].id+',';
- }
- }
- }
- if (ids.length > 0) {
- ids = ids.substring(0, ids.length-1);
- }
- //等待
- if(isPass){
- this.isbatch = true
- this.approveinData = {
- ids: ids
- }
- if(this.user.timeType.needEvaluate == 1){
- this.$set(this.approveinData,'evaluate','')
- this.approveinDialog = true
- }else{
- this.batchApproveLoading = true
- this.listLoading = true;
- this.batchApproveinfun()
- }
- }else{
- this.batchDenyDialog = true
- this.batchDenyData.ids = ids
- this.batchDenyData.reason = ''
- }
- },
- batchApproveinfun(){
- this.http.post('/report/batchApproveReport', this.approveinData,
- res => {
- this.batchApproveLoading = false
- this.listLoading = false;
- if (res.code == "ok") {
- this.approveinDialog = false
- this.getList();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- batchDenyClick(){
- this.batchDenyLoading = true
- this.listLoading = true;
- this.http.post('/report/batchDenyReport', this.batchDenyData,
- res => {
- this.batchDenyLoading = false;
- this.batchDenyDialog = false
- this.listLoading = false;
- if (res.code == "ok") {
- this.getList();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //分页
- handleCurrentChange(val) {
- this.page = val;
- this.getList();
- },
- handleSizeChange(val) {
- this.size = val;
- this.getList();
- },
- //分页
- handleCurrentChangeList(val) {
- this.pageIndexList = val;
- this.recordList();
- },
- handleSizeChangeList(val) {
- this.pageSizeList = val;
- this.recordList();
- },
- test(){
- console.log(this.search.userId);
- },
- searchUserIds(deptId){
- this.searchUsersList = this.usersList.filter(item => deptId == item.departmentId)
- },
- usersSearch(e){
- if(e == false){
- this.getList()
- }
- },
- //获取待审核的数据列表
- getList(e) {
- this.listLoading = true;
- this.http.post("/group-budget-review/list",{},
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- this.list = res.data;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- review(id,checkType){
- this.http.post("/group-budget-review/check", {id:id,checkType:checkType},
- 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"
- });
- });
- },
- approveinfun(){
- this.http.post(this.port.report.approve, this.approveinData,
- res => {
- this.logining = false;
- if (res.code == "ok") {
- this.approveinDialog = false
- this.$message({
- message: this.$t('message.Reviewsucceeded'),
- type: "success"
- });
- this.getList();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.logining = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 修改数组
- changeArr(arr) {
- for (var i = 0; i < arr.length; i++) {
- if(arr[i].id != -1 && arr[i].id != 0) {
- if (arr[i].children != null && arr[i].children.length>0) {
- arr[i].children = this.changeArr(arr[i].children);
- }
- arr[i].id && (arr[i].value = arr[i].id);
- delete arr[i].id;
- }
- }
- for(var i in arr) {
- if(arr[i].id == -1 || arr[i].id == 0) {
- arr.splice(i,1)
- }
- }
- return arr;
- },
-
- //获取项目列表
- getProjectList() {
- this.http.post( this.port.project.list, {},
- res => {
- if (res.code == "ok") {
- this.projectList = res.data;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- showDenyDialog(id,i, date, item) {
- this.denyReasonDialog = true;
- var ids = '';
- if (this.user.company.companyName == '成都明夷电子科技有限公司') {
- ids = item.reportIds;
- } else {
- var data = item.data;
- data.forEach(element => {
- ids +=(element.id+',');
- });
- }
-
- this.denyForm = {id: id ,i:i, date: date, reportIds: ids, reason:null};
- },
- // 未通过日报
- deny() {
- this.logining = true;
- this.http.post( this.port.report.deny, this.denyForm,
- res => {
- this.logining = false;
- if (res.code == "ok") {
- this.$message({
- message: this.denyForm.i==0?this.$t('message.rejectedsuccessfully'):this.$t('Revocationofsuccess'),
- type: "success"
- });
- this.getList();
- this.denyReasonDialog = false;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.logining = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 获取所有人员
- getUsers() {
- // this.http.post(this.port.manage.list, {
- // departmentId: -1,
- // pageIndex: 1,
- // // pageSize: 99999
- // pageSize: -1
- // },
- this.http.post('/user/getSimpleActiveUserList', {},
- res => {
- if (res.code == "ok") {
- this.usersList = res.data;
- this.searchUsersList = this.usersList
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 选择日期后触发
- dataTimes() {
- // console.log(this.dataTime)
- if(this.dataTime){
- this.search.startDate = this.dataTime[0]
- this.search.endDate = this.dataTime[1]
- }else{
- this.search.startDate = null
- this.search.endDate = null
- }
- this.getList()
- },
- // 自定义部门选择
- vueCasader(obj) {
- console.log(obj, '组件传过来的')
- if(obj.distinction == '1') {
- if(obj.id != '') {
- let arr = []
- arr.push(obj.id)
- this.search.departmentIdArray = arr
- } else {
- this.search.departmentIdArray = []
- }
- this.getList(1)
- }
- },
- selectCal(obj) {
- console.log(obj, '过来的数据')
- // search.userIdArray
- let userListId = obj.arrUserList
- let arr = []
- for(var i in userListId) {
- arr.push(userListId[i].id)
- }
- this.search.userIdArray = arr
- console.log(this.search.userIdArray, '数据看看')
- this.usersSearch(false)
- },
- defaultExpandAllFlgCli() {
- this.defaultExpandAllFlg = !this.defaultExpandAllFlg
- this.list = JSON.parse(JSON.stringify(this.list))
- this.$nextTick(()=>{this.$refs.multipleTable.doLayout()})
- this.showTable = false
- this.$nextTick(() => {
- this.showTable = true
- })
- }
- },
- created() {
- let height = window.innerHeight;
- this.tableHeight = height - 125;
- const that = this;
- window.onresize = function temp() {
- that.tableHeight = window.innerHeight - 125;
- };
- },
- mounted() {
- this.getList();
- // this.getDepartment();
- // this.getProjectList();
- // this.getUsers()
- }
- };
- </script>
- <style lang="scss">
- .propsbtn {
- display: inline-block;
- padding-left: 20px;
- }
- </style>
|