|
|
@@ -39,172 +39,176 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import {
|
|
|
- mapGetters
|
|
|
- } from 'vuex'
|
|
|
+import {
|
|
|
+ mapGetters
|
|
|
+} from 'vuex'
|
|
|
|
|
|
- export default {
|
|
|
- name: 'wfmultihistory',
|
|
|
- props: {
|
|
|
- visible: {
|
|
|
- type: Boolean,
|
|
|
- default: false
|
|
|
- },
|
|
|
- entryinfo: {}
|
|
|
- },
|
|
|
- created () {
|
|
|
- this.getHistoryTask()
|
|
|
- },
|
|
|
- computed: {
|
|
|
- ...mapGetters({
|
|
|
- session: 'session'
|
|
|
- })
|
|
|
- },
|
|
|
- watch: {
|
|
|
- entryinfo: {
|
|
|
- handler: function (newVal, oldVal) {
|
|
|
- this.getHistoryTask()
|
|
|
- },
|
|
|
- deep: true
|
|
|
- }
|
|
|
+export default {
|
|
|
+ name: 'wfmultihistory',
|
|
|
+ props: {
|
|
|
+ visible: {
|
|
|
+ type: Boolean,
|
|
|
+ default: false
|
|
|
},
|
|
|
-
|
|
|
- data () {
|
|
|
- return {
|
|
|
- baseurl: process.env.baseURL,
|
|
|
- process: '',
|
|
|
- business: '',
|
|
|
- instance: '',
|
|
|
- selfVisible: this.visible, // 避免vue双向绑定警告
|
|
|
- historyTask: [],
|
|
|
- userlist: []
|
|
|
- }
|
|
|
- },
|
|
|
- methods: {
|
|
|
- getHistoryTask () {
|
|
|
- let _this = this
|
|
|
- this.$axios.get('/audithistory/list?id=' + this.entryinfo.business)
|
|
|
- .then(res => {
|
|
|
- let instanceIds = ''
|
|
|
- console.log('单-多历史任务', res.data)
|
|
|
- for (let idx in res.data.item) {
|
|
|
- instanceIds += res.data.item[idx].WorkflowId + ','
|
|
|
- }
|
|
|
- instanceIds += _this.entryinfo.instance + ','
|
|
|
- _this.getHistoryMultiTask(instanceIds)
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- // handle error
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
+ entryinfo: {}
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ this.getHistoryTask()
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapGetters({
|
|
|
+ session: 'session'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ entryinfo: {
|
|
|
+ handler: function (newVal, oldVal) {
|
|
|
+ this.getHistoryTask()
|
|
|
},
|
|
|
- getHistoryMultiTask (instanceIds) {
|
|
|
- let _this = this
|
|
|
- const params = {
|
|
|
- process: _this.entryinfo.process,
|
|
|
- business: _this.entryinfo.business,
|
|
|
- instance: instanceIds
|
|
|
- }
|
|
|
- this.$axios.get('/workflow/historymultitask', {
|
|
|
- params
|
|
|
+ deep: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ baseurl: process.env.baseURL,
|
|
|
+ process: '',
|
|
|
+ business: '',
|
|
|
+ instance: '',
|
|
|
+ selfVisible: this.visible, // 避免vue双向绑定警告
|
|
|
+ historyTask: [],
|
|
|
+ userlist: []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getHistoryTask () {
|
|
|
+ let _this = this
|
|
|
+ this.$axios.get('/audithistory/list?id=' + this.entryinfo.business)
|
|
|
+ .then(res => {
|
|
|
+ let instanceIds = ''
|
|
|
+ console.log('单-多历史任务', res.data)
|
|
|
+ for (let idx in res.data.item) {
|
|
|
+ instanceIds += res.data.item[idx].WorkflowId + ','
|
|
|
+ }
|
|
|
+ instanceIds += _this.entryinfo.instance + ','
|
|
|
+ _this.getHistoryMultiTask(instanceIds)
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
})
|
|
|
- .then(res => {
|
|
|
- console.log('多-多历史任务', res.data)
|
|
|
- // _this.historyTask = res.data.items
|
|
|
- this.tmp_historyTask = res.data.items
|
|
|
- let useridstr = ''
|
|
|
- for (let i = 0; i < this.tmp_historyTask.length; i++) {
|
|
|
- if (this.tmp_historyTask[i].assignee !== '') {
|
|
|
- useridstr = useridstr + this.tmp_historyTask[i].assignee + ','
|
|
|
- }
|
|
|
- if (this.tmp_historyTask[i].users !== '') {
|
|
|
- useridstr = useridstr + this.tmp_historyTask[i].users + ','
|
|
|
- }
|
|
|
+ },
|
|
|
+ getHistoryMultiTask (instanceIds) {
|
|
|
+ let _this = this
|
|
|
+ const params = {
|
|
|
+ process: _this.entryinfo.process,
|
|
|
+ business: _this.entryinfo.business,
|
|
|
+ instance: instanceIds
|
|
|
+ }
|
|
|
+ this.$axios.get('/workflow/historymultitask', {
|
|
|
+ params
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ console.log('多-多历史任务', res.data)
|
|
|
+ console.log('22222222222')
|
|
|
+ // _this.historyTask = res.data.items
|
|
|
+ this.tmp_historyTask = res.data.items
|
|
|
+ let useridstr = ''
|
|
|
+ for (let i = 0; i < this.tmp_historyTask.length; i++) {
|
|
|
+ if (this.tmp_historyTask[i].assignee !== '') {
|
|
|
+ useridstr = useridstr + this.tmp_historyTask[i].assignee + ','
|
|
|
}
|
|
|
- if (useridstr) {
|
|
|
- useridstr = useridstr.substring(0, useridstr.length - 1)
|
|
|
- this.getuserlist(useridstr)
|
|
|
+ if (this.tmp_historyTask[i].users !== '') {
|
|
|
+ useridstr = useridstr + this.tmp_historyTask[i].users + ','
|
|
|
}
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- // handle error
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
- },
|
|
|
- assigneeToAssignee (val) {
|
|
|
+ }
|
|
|
+ if (useridstr) {
|
|
|
+ console.log(useridstr.length, '22222222222')
|
|
|
+ useridstr = useridstr.substring(0, useridstr.length - 1)
|
|
|
+ this.getuserlist(useridstr)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ assigneeToAssignee (val) {
|
|
|
+ if (this.userlist) {
|
|
|
for (let i = 0; i < this.userlist.length; i++) {
|
|
|
if (val == this.userlist[i].Id) {
|
|
|
return this.userlist[i].Realname
|
|
|
}
|
|
|
}
|
|
|
- },
|
|
|
- assigneeToUsers (users) {
|
|
|
- let userNames = ''
|
|
|
- let userArr = users.split(',')
|
|
|
- for (let idx = 0; idx < userArr.length; idx++) {
|
|
|
- let val = userArr[idx]
|
|
|
- for (let i = 0; i < this.userlist.length; i++) {
|
|
|
- if (parseInt(val) == parseInt(this.userlist[i].Id)) {
|
|
|
- userNames += this.userlist[i].Realname + ', '
|
|
|
- }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ assigneeToUsers (users) {
|
|
|
+ let userNames = ''
|
|
|
+ let userArr = users.split(',')
|
|
|
+ for (let idx = 0; idx < userArr.length; idx++) {
|
|
|
+ let val = userArr[idx]
|
|
|
+ for (let i = 0; i < this.userlist.length; i++) {
|
|
|
+ if (parseInt(val) == parseInt(this.userlist[i].Id)) {
|
|
|
+ userNames += this.userlist[i].Realname + ', '
|
|
|
}
|
|
|
}
|
|
|
- if (userNames.length > 0) {
|
|
|
- userNames = userNames.substring(0, userNames.length - 2)
|
|
|
- }
|
|
|
- return userNames
|
|
|
- },
|
|
|
- getuserlist (val) {
|
|
|
- this.$axios.post('workflow/userlist_post?userids=' + val)
|
|
|
- .then(res => {
|
|
|
- // response
|
|
|
- this.userlist = res.data.items
|
|
|
- this.historyTask = this.tmp_historyTask
|
|
|
- })
|
|
|
- .catch(err => {
|
|
|
- // handle error
|
|
|
- console.error(err)
|
|
|
- })
|
|
|
- },
|
|
|
- timestampToTime (val) {
|
|
|
- var date = new Date(val) // 时间戳为10位需*1000,时间戳为13位的话不需乘1000
|
|
|
- var Y = date.getFullYear() + '-'
|
|
|
- var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
|
|
|
- var D = date.getDate() + ' '
|
|
|
- var h = date.getHours() + ':'
|
|
|
- var m = date.getMinutes() + ':'
|
|
|
- var s = date.getSeconds()
|
|
|
- return Y + M + D + h + m + s
|
|
|
- },
|
|
|
- jstimehandle (val) {
|
|
|
- if (val === '') {
|
|
|
- return '----'
|
|
|
- } else if (val === '0001-01-01T08:00:00+08:00') {
|
|
|
- return '----'
|
|
|
- } else if (val === '5000-01-01T23:59:59+08:00') {
|
|
|
- return '永久'
|
|
|
- } else if (val === '1970-01-01 8:0:0') {
|
|
|
- return '----'
|
|
|
- } else if (val === '1970-01-1 8:0:0') {
|
|
|
- return '----'
|
|
|
- } else {
|
|
|
- val = val.replace('T', ' ')
|
|
|
- return val.substring(0, 19)
|
|
|
- }
|
|
|
+ }
|
|
|
+ if (userNames.length > 0) {
|
|
|
+ userNames = userNames.substring(0, userNames.length - 2)
|
|
|
+ }
|
|
|
+ return userNames
|
|
|
+ },
|
|
|
+ getuserlist (val) {
|
|
|
+ this.$axios.post('workflow/userlist_post?userids=' + val)
|
|
|
+ .then(res => {
|
|
|
+ // response
|
|
|
+ this.userlist = res.data.items
|
|
|
+ this.historyTask = this.tmp_historyTask
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ // handle error
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ timestampToTime (val) {
|
|
|
+ var date = new Date(val) // 时间戳为10位需*1000,时间戳为13位的话不需乘1000
|
|
|
+ var Y = date.getFullYear() + '-'
|
|
|
+ var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
|
|
|
+ var D = date.getDate() + ' '
|
|
|
+ var h = date.getHours() + ':'
|
|
|
+ var m = date.getMinutes() + ':'
|
|
|
+ var s = date.getSeconds()
|
|
|
+ return Y + M + D + h + m + s
|
|
|
+ },
|
|
|
+ jstimehandle (val) {
|
|
|
+ if (val === '') {
|
|
|
+ return '----'
|
|
|
+ } else if (val === '0001-01-01T08:00:00+08:00') {
|
|
|
+ return '----'
|
|
|
+ } else if (val === '5000-01-01T23:59:59+08:00') {
|
|
|
+ return '永久'
|
|
|
+ } else if (val === '1970-01-01 8:0:0') {
|
|
|
+ return '----'
|
|
|
+ } else if (val === '1970-01-1 8:0:0') {
|
|
|
+ return '----'
|
|
|
+ } else {
|
|
|
+ val = val.replace('T', ' ')
|
|
|
+ return val.substring(0, 19)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style>
|
|
|
- .samplerecoveope .el-radio {
|
|
|
- padding: 8px 15px 0 0;
|
|
|
- margin-left: -2px;
|
|
|
- }
|
|
|
- .dialog-footer img{
|
|
|
- position: relative;
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- }
|
|
|
+.samplerecoveope .el-radio {
|
|
|
+ padding: 8px 15px 0 0;
|
|
|
+ margin-left: -2px;
|
|
|
+}
|
|
|
+.dialog-footer img{
|
|
|
+ position: relative;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+}
|
|
|
|
|
|
</style>
|