This commit is contained in:
熊成强 2020-10-26 11:01:12 +08:00
parent 83c54f0843
commit c07bdf5fbb
10 changed files with 251 additions and 79 deletions

View File

@ -209,8 +209,8 @@ export default {
//
close () {
// console.log('isShow: ', this.isShow)
// this.show = true
// this.$emit('update:isShow', false)
this.show = true
this.$emit('update:isShow', false)
// this.$forceUpdate()
},
//

View File

@ -40,6 +40,7 @@ export function personlGetForm (arr = []) {
})
}
const key = 'staffId'
arr = arr.sort((a, b) => a[key] - b[key])
params.list = arr
for (let i in arr) {
if (i < 1) { params.title = params.title + (i === '0' ? '' : ',') + arr[i].name }
@ -64,6 +65,8 @@ export function departGetForm (arr = []) {
}
const key = 'departmentId'
const key1 = 'departmentName'
arr = arr.sort((a, b) => a[key] - b[key])
console.log('arr: ', arr)
params.list = arr
for (let i in arr) {
if (i < 1) {

View File

@ -12,7 +12,7 @@
</template>
<script>
import ApprovalList from './ConfirmList'
import ApprovalList from './ApprovalList'
export default {
props: ['info'],
data () {
@ -36,9 +36,11 @@ export default {
}
},
beforeMount () {},
mounted () {
created () {
this.form = this.info
console.log('info: ', this.info)
},
mounted () {
},
methods: {},
watch: {

View File

@ -90,7 +90,7 @@ export default {
options: [
{
id: 1,
name: '1级主管'
name: '直接主管'
}, {
id: 2,
name: '2级主管'
@ -120,11 +120,50 @@ export default {
},
computed: {},
beforeMount () {},
created () {
this.list = this.handleListFor(this.info)
},
mounted () {
this.list = this.info
console.log('info: ', this.info)
},
methods: {
//
handleListFor (list) {
if (list.length === 0) return []
list = list.map(i => {
i.isShow = false
i = Object.assign({}, this.handleOptType(i), i)
i.isActive = i.optType === 0 ? 0 : 1
i.roleDtos = JSON.parse(JSON.stringify(this.roleDtos)).map(j => {
j.checked = i.roleIds ? i.roleIds.includes(String(j.id)) : false
return j
})
return i
})
const arr = JSON.parse(JSON.stringify(list))
arr[0].isCick = true
this.itemInfo = arr[0]
return arr
},
handleOptType (i) {
console.log('i: ', i)
// itemInfo.isActive
const obj = {}
if (i.optType === 0) {
obj.isActive = 0
const a = this.$personlGetForm(i.staffs)
obj.optIds = a.value
obj.list = a
obj.name = a.list.length > 0 ? this.handleTitle(a) : '未指定成员'
return obj
}
if (i.optType === -1) {
return obj
} else {
obj.name = this.options.filter(j => j.id === i.optType)[0].name
obj.isActive = 1
return obj
}
},
handleTitle (item) {
return item.list.length > 0 ? (item.title + '等' + item.list.length + '人') : '指定成员'
// itemInfo.list.list.length===0?(itemInfo.list.title + '' + itemInfo.list.list.length + '' ):""
@ -187,6 +226,19 @@ export default {
this.itemInfo = this.list[0]
}
}
},
handleIsEmit (n) {
n.map(i => {
i.roleIds = ''
i.roleDtos.map(j => {
if (j.type !== 1 && j.checked) i.roleIds += j.id + ','
})
i.roleIds = i.roleIds.substring(0, i.roleIds.length - 1)
i.optType = i.isActive === 0 ? 0 : i.optType
})
console.log('n: ', n)
this.$emit('update:info', this.list)
this.$forceUpdate()
}
},
watch: {
@ -196,16 +248,7 @@ export default {
list: {
deep: true,
handler (n, o) {
n.map(i => {
i.roleIds = ''
i.roleDtos.map(j => {
if (j.type !== 1 && j.checked) i.roleIds += j.id + ','
})
i.roleIds = i.roleIds.substring(0, i.roleIds.length - 1)
})
console.log('n: ', n)
this.$emit('update:info', this.list)
this.$forceUpdate()
this.handleIsEmit(n)
}
},
itemInfo: {
@ -213,6 +256,7 @@ export default {
handler (n, o) {
console.log('nxcq: ', n)
if (n.isActive !== 0) {
if (n.optType === 0) n.optType = 1
n.name = this.options.filter(i => i.id === n.optType)[0].name
} else {
if (n.list) {

View File

@ -37,8 +37,13 @@ export default {
}
},
beforeMount () {},
beforeCreate () {
},
created () {
this.form = Object.assign({}, this.info)
},
mounted () {
this.form = this.info
},
methods: {},
watch: {

View File

@ -83,14 +83,16 @@ export default {
},
data () {
return {
itemInfo: {},
itemInfo: {
isShow: false
},
form: {
radio: 3
},
options: [
{
id: 1,
name: '1级主管'
name: '直接主管'
}, {
id: 2,
name: '2级主管'
@ -119,13 +121,56 @@ export default {
}
},
computed: {},
beforeMount () {},
created () {
this.list = this.handleListFor(this.info)
// console.log(' this.list : ', this.list)
},
beforeMount () {
},
mounted () {
this.list = this.info
console.log('info: ', this.info)
},
methods: {
//
handleListFor (list) {
if (list.length === 0) return []
list = list.map(i => {
i.isShow = false
i = Object.assign({}, this.handleOptType(i), i)
i.isActive = i.optType === 0 ? 0 : 1
i.roleDtos = JSON.parse(JSON.stringify(this.roleDtos)).map(j => {
j.checked = i.roleIds ? i.roleIds.includes(String(j.id)) : false
return j
})
return i
})
const arr = JSON.parse(JSON.stringify(list))
arr[0].isCick = true
this.itemInfo = arr[0]
return arr
},
handleOptType (i) {
console.log('i: ', i)
// itemInfo.isActive
const obj = {}
if (i.optType === 0) {
obj.isActive = 0
const a = this.$personlGetForm(i.staffs)
obj.optIds = a.value
obj.list = a
obj.name = a.list.length > 0 ? this.handleTitle(a) : '未指定成员'
return obj
}
if (i.optType === -1) {
return obj
} else {
obj.name = this.options.filter(j => j.id === i.optType)[0].name
obj.isActive = 1
return obj
}
},
handleTitle (item) {
console.log('item: ', item)
return item.list.length > 0 ? (item.title + '等' + item.list.length + '人') : '指定成员'
// itemInfo.list.list.length===0?(itemInfo.list.title + '' + itemInfo.list.list.length + '' ):""
},
@ -147,7 +192,7 @@ export default {
item.isCick = true
this.itemInfo = item
console.log('this.itemInfo: ', this.itemInfo)
this.$forceUpdate()
// this.$forceUpdate()
},
//
handleAdd () {
@ -187,6 +232,23 @@ export default {
this.itemInfo = this.list[0]
}
}
},
handleIsEmit (n) {
let arr = JSON.parse(JSON.stringify(n))
if (arr.length !== 0) {
arr = arr.map(i => {
i.roleIds = ''
i.roleDtos.map(j => {
if (j.type !== 1 && j.checked) i.roleIds += j.id + ','
})
i.roleIds = i.roleIds.substring(0, i.roleIds.length - 1)
i.optType = i.isActive === 0 ? 0 : i.optType
return i
})
console.log('arr: ', arr)
this.$emit('update:info', arr)
this.$forceUpdate()
}
}
},
watch: {
@ -196,31 +258,25 @@ export default {
list: {
deep: true,
handler (n, o) {
n.map(i => {
i.roleIds = ''
i.roleDtos.map(j => {
if (j.type !== 1 && j.checked) i.roleIds += j.id + ','
})
i.roleIds = i.roleIds.substring(0, i.roleIds.length - 1)
})
console.log('n: ', n)
this.$emit('update:info', this.list)
this.$forceUpdate()
this.handleIsEmit(n)
}
},
itemInfo: {
deep: true,
handler (n, o) {
console.log('nxcq: ', n)
if (n.isActive !== 0) {
n.name = this.options.filter(i => i.id === n.optType)[0].name
const arr = n
console.log('arr: ', arr)
if (arr.isActive !== 0) {
if (arr.optType === 0) arr.optType = 1
arr.name = this.options.filter(i => i.id === arr.optType)[0].name
} else {
if (n.list) {
n.name = this.handleTitle(n.list)
if (arr.list) {
arr.name = this.handleTitle(arr.list)
} else {
n.name = '未指定成员'
arr.name = '未指定成员'
}
}
// this.$emit('update:info', this.list)
// n.roleIds = ''
// n.roleDtos.map(i => {
// n.roleIds += ''

View File

@ -38,9 +38,12 @@ export default {
}
},
beforeMount () {},
mounted () {
created () {
this.form = this.info
console.log('info: ', this.info)
},
mounted () {
},
methods: {},
watch: {

View File

@ -97,7 +97,7 @@ export default {
options: [
{
id: 1,
name: '1级主管'
name: '直接主管'
}, {
id: 2,
name: '2级主管'
@ -128,10 +128,48 @@ export default {
computed: {},
beforeMount () {},
mounted () {
this.list = this.info
this.list = this.handleListFor(this.info)
console.log('info: ', this.info)
},
methods: {
//
handleListFor (list) {
if (list.length === 0) return []
list = list.map(i => {
i.weight1 = i.weight * 100
i.isShow = false
i = Object.assign({}, this.handleOptType(i), i)
i.isActive = i.optType === 0 ? 0 : 1
i.roleDtos = JSON.parse(JSON.stringify(this.roleDtos)).map(j => {
j.checked = i.roleIds ? i.roleIds.includes(String(j.id)) : false
return j
})
return i
})
const arr = JSON.parse(JSON.stringify(list))
arr[0].isCick = true
this.itemInfo = arr[0]
return arr
},
handleOptType (i) {
// itemInfo.isActive
const obj = {}
if (i.optType === 0) {
obj.isActive = 0
const a = this.$personlGetForm(i.staffs)
obj.optIds = a.value
obj.list = a
obj.name = a.list.length > 0 ? this.handleTitle(a) : '未指定成员'
return obj
}
if (i.optType === -1) {
return obj
} else {
obj.name = this.options.filter(j => j.id === i.optType)[0].name
obj.isActive = 1
return obj
}
},
handleTitle (item) {
return item.list.length > 0 ? (item.title + '等' + item.list.length + '人') : '指定成员'
// itemInfo.list.list.length===0?(itemInfo.list.title + '' + itemInfo.list.list.length + '' ):""
@ -196,6 +234,18 @@ export default {
this.itemInfo = this.list[0]
}
}
},
handleIsEmit (n) {
n.map(i => {
i.roleIds = ''
i.roleDtos.map(j => {
if (j.type !== 1 && j.checked) i.roleIds += j.id + ','
})
i.roleIds = i.roleIds.substring(0, i.roleIds.length - 1)
})
console.log('n: ', n)
this.$emit('update:info', this.list)
this.$forceUpdate()
}
},
watch: {
@ -205,23 +255,14 @@ export default {
list: {
deep: true,
handler (n, o) {
n.map(i => {
i.roleIds = ''
i.roleDtos.map(j => {
if (j.type !== 1 && j.checked) i.roleIds += j.id + ','
})
i.roleIds = i.roleIds.substring(0, i.roleIds.length - 1)
})
console.log('n: ', n)
this.$emit('update:info', this.list)
this.$forceUpdate()
this.handleIsEmit(n)
}
},
itemInfo: {
deep: true,
handler (n, o) {
console.log('nxcq: ', n)
if (n.isActive !== 0) {
if (n.optType === 0) n.optType = 1
n.name = this.options.filter(i => i.id === n.optType)[0].name
}
n.weight = n.weight1 / 100

View File

@ -94,20 +94,34 @@ export default {
},
beforeMount () {},
mounted () {
this.handleGetByFlowManagerId()
const id = this.$route.query.id || ''
this.id = id
if (id) {
this.handleGetByFlowManagerId(id)
} else {
this.handleGetByFlowManagerId(0)
}
// this.handleGetByFlowManagerId(24)
},
methods: {
//
async handleGetByFlowManagerId (id = 1) {
async handleGetByFlowManagerId (groupId = 0) {
try {
const res = await getByFlowManagerId({
id: 1,
groupId: 24
groupId
})
this.processLsit = res
this.processLsitCopy.map(i => {
this.info[i.componment + 'Info'] = this.processLsit.filter(j => j.name === i.name)[0]
if (groupId === 0) {
this.info[i.componment + 'Info'].chartDetails = {
id: i.id,
status: 0,
recordSimpleDtos: []
}
}
})
this.isActive = this.processLsit[0].name
this.noInfo = true

View File

@ -27,7 +27,7 @@ console.log('saveDetailProcs: ', saveDetailProcs)
export default {
data () {
return {
active: 3,
active: 1,
//
basisForm: {
// id: 8,
@ -63,30 +63,34 @@ export default {
async handSaveBasisc () {
console.log('this.processInfo: ', this.processInfo)
for (let i in this.processInfo) {
console.log('processInfo: ', i)
try {
let res = await saveDetailProcs(this.processInfo[i].chartDetails)
console.log('res: ', res)
} catch (error) {
console.log('error: ', error)
}
}
console.log('this.basisForm: ', this.basisForm)
try {
let res = await saveBaseSet(this.basisForm)
let res2 = await saveTemSet(this.templateForm)
// console.log('this.basisForm: ', this.basisForm)
// try {
// let res = await saveBaseSet(this.basisForm)
// this.basisForm = res
// this.templateForm.evaluationGroupId = res.id
// console.log('res: ', res)
// } catch (error) {
// this.$message.error(error.msg)
// }
this.basisForm = res
this.templateForm.evaluationGroupId = res.id
for (let i in this.processInfo) {
console.log('processInfo: ', i)
let res3 = await saveDetailProcs(Object.assign({}, this.processInfo[i].chartDetails, {evaluationGroupId: res.id}))
console.log('res: ', res3)
}
console.log('res: ', res)
this.$message({
message: '保存成功',
type: 'success',
onClose: () => {
this.$router.replace({name: 'workbench-group'})
}
})
} catch (error) {
this.$message.error(error.msg)
}
// console.log('this.templateForm: ', JSON.stringify(this.templateForm))
// try {
// let res = await saveTemSet(this.templateForm)
// let res2 = await saveTemSet(this.templateForm)
// // this.basisForm = res
// console.log('res: ', res)
// console.log('res: ', res2)
// } catch (error) {
// this.$message.error(error.msg)
// }