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 () { close () {
// console.log('isShow: ', this.isShow) // console.log('isShow: ', this.isShow)
// this.show = true this.show = true
// this.$emit('update:isShow', false) this.$emit('update:isShow', false)
// this.$forceUpdate() // this.$forceUpdate()
}, },
// //

View File

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

View File

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

View File

@ -90,7 +90,7 @@ export default {
options: [ options: [
{ {
id: 1, id: 1,
name: '1级主管' name: '直接主管'
}, { }, {
id: 2, id: 2,
name: '2级主管' name: '2级主管'
@ -120,11 +120,50 @@ export default {
}, },
computed: {}, computed: {},
beforeMount () {}, beforeMount () {},
created () {
this.list = this.handleListFor(this.info)
},
mounted () { mounted () {
this.list = this.info
console.log('info: ', this.info)
}, },
methods: { 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) { handleTitle (item) {
return item.list.length > 0 ? (item.title + '等' + item.list.length + '人') : '指定成员' return item.list.length > 0 ? (item.title + '等' + item.list.length + '人') : '指定成员'
// itemInfo.list.list.length===0?(itemInfo.list.title + '' + itemInfo.list.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] 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: { watch: {
@ -196,16 +248,7 @@ export default {
list: { list: {
deep: true, deep: true,
handler (n, o) { handler (n, o) {
n.map(i => { this.handleIsEmit(n)
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()
} }
}, },
itemInfo: { itemInfo: {
@ -213,6 +256,7 @@ export default {
handler (n, o) { handler (n, o) {
console.log('nxcq: ', n) console.log('nxcq: ', n)
if (n.isActive !== 0) { if (n.isActive !== 0) {
if (n.optType === 0) n.optType = 1
n.name = this.options.filter(i => i.id === n.optType)[0].name n.name = this.options.filter(i => i.id === n.optType)[0].name
} else { } else {
if (n.list) { if (n.list) {

View File

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

View File

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

View File

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

View File

@ -97,7 +97,7 @@ export default {
options: [ options: [
{ {
id: 1, id: 1,
name: '1级主管' name: '直接主管'
}, { }, {
id: 2, id: 2,
name: '2级主管' name: '2级主管'
@ -128,10 +128,48 @@ export default {
computed: {}, computed: {},
beforeMount () {}, beforeMount () {},
mounted () { mounted () {
this.list = this.info this.list = this.handleListFor(this.info)
console.log('info: ', this.info) console.log('info: ', this.info)
}, },
methods: { 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) { handleTitle (item) {
return item.list.length > 0 ? (item.title + '等' + item.list.length + '人') : '指定成员' return item.list.length > 0 ? (item.title + '等' + item.list.length + '人') : '指定成员'
// itemInfo.list.list.length===0?(itemInfo.list.title + '' + itemInfo.list.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] 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: { watch: {
@ -205,23 +255,14 @@ export default {
list: { list: {
deep: true, deep: true,
handler (n, o) { handler (n, o) {
n.map(i => { this.handleIsEmit(n)
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()
} }
}, },
itemInfo: { itemInfo: {
deep: true, deep: true,
handler (n, o) { handler (n, o) {
console.log('nxcq: ', n)
if (n.isActive !== 0) { if (n.isActive !== 0) {
if (n.optType === 0) n.optType = 1
n.name = this.options.filter(i => i.id === n.optType)[0].name n.name = this.options.filter(i => i.id === n.optType)[0].name
} }
n.weight = n.weight1 / 100 n.weight = n.weight1 / 100

View File

@ -94,20 +94,34 @@ export default {
}, },
beforeMount () {}, beforeMount () {},
mounted () { 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: { methods: {
// //
async handleGetByFlowManagerId (id = 1) { async handleGetByFlowManagerId (groupId = 0) {
try { try {
const res = await getByFlowManagerId({ const res = await getByFlowManagerId({
id: 1, id: 1,
groupId: 24 groupId
}) })
this.processLsit = res this.processLsit = res
this.processLsitCopy.map(i => { this.processLsitCopy.map(i => {
this.info[i.componment + 'Info'] = this.processLsit.filter(j => j.name === i.name)[0] 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.isActive = this.processLsit[0].name
this.noInfo = true this.noInfo = true

View File

@ -27,7 +27,7 @@ console.log('saveDetailProcs: ', saveDetailProcs)
export default { export default {
data () { data () {
return { return {
active: 3, active: 1,
// //
basisForm: { basisForm: {
// id: 8, // id: 8,
@ -63,30 +63,34 @@ export default {
async handSaveBasisc () { async handSaveBasisc () {
console.log('this.processInfo: ', this.processInfo) console.log('this.processInfo: ', this.processInfo)
for (let i in this.processInfo) { console.log('this.basisForm: ', this.basisForm)
console.log('processInfo: ', i) try {
try { let res = await saveBaseSet(this.basisForm)
let res = await saveDetailProcs(this.processInfo[i].chartDetails) let res2 = await saveTemSet(this.templateForm)
console.log('res: ', res)
} catch (error) {
console.log('error: ', error)
}
}
// console.log('this.basisForm: ', this.basisForm) this.basisForm = res
// try { this.templateForm.evaluationGroupId = res.id
// let res = await saveBaseSet(this.basisForm) for (let i in this.processInfo) {
// this.basisForm = res console.log('processInfo: ', i)
// this.templateForm.evaluationGroupId = res.id let res3 = await saveDetailProcs(Object.assign({}, this.processInfo[i].chartDetails, {evaluationGroupId: res.id}))
// console.log('res: ', res) console.log('res: ', res3)
// } catch (error) { }
// this.$message.error(error.msg) 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)) // console.log('this.templateForm: ', JSON.stringify(this.templateForm))
// try { // try {
// let res = await saveTemSet(this.templateForm) // let res2 = await saveTemSet(this.templateForm)
// // this.basisForm = res // // this.basisForm = res
// console.log('res: ', res) // console.log('res: ', res2)
// } catch (error) { // } catch (error) {
// this.$message.error(error.msg) // this.$message.error(error.msg)
// } // }