This commit is contained in:
gaoyuanwei 2022-07-13 18:58:35 +08:00
parent 21a5d058ef
commit 69668a0ae8
2 changed files with 208 additions and 48 deletions

View File

@ -21,6 +21,8 @@
</template> </template>
<script> <script>
import qs from 'qs'
export default { export default {
components: {}, components: {},
props: { props: {
@ -34,7 +36,9 @@ export default {
data () { data () {
return { return {
dataList: [], dataList: [],
dataView: [] dataView: [],
//
unit: ''
} }
}, },
watch: { watch: {
@ -52,11 +56,17 @@ export default {
console.log(this.dataView) console.log(this.dataView)
console.log(this.dataForm) console.log(this.dataForm)
// //
this.dataView.children[0].children[0].children[4].note1 = // this.dataView.children[0].children[0].children[4].note1 =
this.dataForm.description // this.dataForm.description
// //
this.dataView.children[0].children[0].children[0].note1 = // this.dataView.children[0].children[0].children[0].note1 =
this.dataForm.name // this.dataForm.name
//
this.dataView.children[2].children[1].children[0].note1 =
this.dataForm.shareCondition
//
this.dataView.children[2].children[1].children[1].note1 =
this.dataForm.shareType
this.dataForm.infoList.map((item, index) => { this.dataForm.infoList.map((item, index) => {
this.dataView.children.map((itemView, indexView) => { this.dataView.children.map((itemView, indexView) => {
// console.log('itemView', itemView) // console.log('itemView', itemView)
@ -72,22 +82,22 @@ export default {
this.dataView.children[indexView].children[0].children[ this.dataView.children[indexView].children[0].children[
indexSon indexSon
].note1 = this.dataForm.name ].note1 = this.dataForm.name
} else if (itemSon.name.indexOf('共享条件') != -1) {
this.dataView.children[indexView].children[0].children[
indexSon
].note1 = this.dataForm.shareCondition
} else if (itemSon.name.indexOf('共享方式') != -1) {
this.dataView.children[indexView].children[0].children[
indexSon
].note1 = this.dataForm.shareMode
} else if (itemSon.name.indexOf('共享类型') != -1) {
this.dataView.children[indexView].children[0].children[
indexSon
].note1 = this.dataForm.shareType
} else if (itemSon.name.indexOf('能力类型') != -1) { } else if (itemSon.name.indexOf('能力类型') != -1) {
this.dataView.children[indexView].children[0].children[ this.dataView.children[indexView].children[0].children[
indexSon indexSon
].note1 = this.dataForm.type ].note1 = this.dataForm.type
} else if (itemSon.name.indexOf('属部门') != -1) {
this.dataView.children[indexView].children[0].children[
indexSon
].note1 = this.unit
} else if (itemSon.name.indexOf('共享条件') != -1) {
this.dataView.children[indexView].children[indexViewSon].children[
indexSon
].note1 = this.dataForm.shareCondition
} else if (itemSon.name.indexOf('共享类型') != -1) {
this.dataView.children[indexView].children[indexViewSon].children[
indexSon
].note1 = this.dataForm.shareType
} else if (itemSon.name === item.attrType) { } else if (itemSon.name === item.attrType) {
this.dataView.children[indexView].children[ this.dataView.children[indexView].children[
indexViewSon indexViewSon
@ -141,7 +151,7 @@ export default {
} else if (itemSon.name.indexOf('属部门') != -1) { } else if (itemSon.name.indexOf('属部门') != -1) {
this.dataView.children[indexView].children[0].children[ this.dataView.children[indexView].children[0].children[
indexSon indexSon
].note1 = this.dataForm.deptId ].note1 = this.unit
} else if (itemSon.name.indexOf('部门联系人电话') != -1) { } else if (itemSon.name.indexOf('部门联系人电话') != -1) {
this.dataView.children[indexView].children[0].children[ this.dataView.children[indexView].children[0].children[
indexSon indexSon
@ -211,9 +221,19 @@ export default {
} }
}, },
computed: {}, computed: {},
methods: {}, methods: {
deptName () {
console.log(this.dataForm.deptId)
this.$http.get(`/sys/dept/${this.dataForm.deptId}`).then(({ data: res }) => {
console.log(res.data.name, 'res')
this.unit = res.data.name
})
}
},
created () {}, created () {},
mounted () {} mounted () {
this.deptName()
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -229,7 +249,7 @@ export default {
color: #333333; color: #333333;
font-size: 22px; font-size: 22px;
margin-bottom: 20px; margin-bottom: 20px;
background: url('~@/assets/img/sj-jx.png') no-repeat; background: url("~@/assets/img/sj-jx.png") no-repeat;
background-position-x: 15px; background-position-x: 15px;
} }
.dataContent { .dataContent {

View File

@ -28,13 +28,26 @@
</el-form> </el-form>
</div> </div>
<!-- 流程综合组件 --> <!-- 流程综合组件 -->
<ren-process-multiple <!-- <ren-process-multiple
v-if="processVisible" v-if="processVisible"
updateInstanceIdUrl="/processForm/tabilityapplication/updateInstanceId" updateInstanceIdUrl="/processForm/tabilityapplication/updateInstanceId"
saveFormUrl="/processForm/tabilityapplication" saveFormUrl="/processForm/tabilityapplication"
dataFormName="dataForm" dataFormName="dataForm"
ref="renProcessMultiple" ref="renProcessMultiple"
></ren-process-multiple> ></ren-process-multiple> -->
<!-- 审批 -->
<div class="agreeOr">
<h3>审批</h3>
<div>
<el-radio-group v-model="agreeOrList" style="width:230px;">
<el-radio-button label="同意" class="blueAll">同意</el-radio-button>
<el-radio-button label="退回" class="redAll">退回</el-radio-button>
</el-radio-group>
<el-input v-if="agreeOrList ==='同意' " v-model="inputAgree" placeholder="请输入同意意见"></el-input>
<el-input v-if="agreeOrList ==='退回'" v-model="inputNo" placeholder="请输入退回意见"></el-input>
<el-button class="inputBule" @click="agreeOrNot">提交</el-button>
</div>
</div>
</div> </div>
</template> </template>
@ -42,9 +55,12 @@
import processModule from '@/mixins/process-module' import processModule from '@/mixins/process-module'
import Applicationresources from './Application-resources.vue' import Applicationresources from './Application-resources.vue'
import ResourcesAndServices from './ResourcesAndServices.vue' import ResourcesAndServices from './ResourcesAndServices.vue'
import debounce from 'lodash/debounce'
import qs from 'qs'
export default { export default {
// //
mixins: [processModule], // mixins: [processModule],
components: { components: {
Applicationresources, Applicationresources,
ResourcesAndServices ResourcesAndServices
@ -70,10 +86,38 @@ export default {
coverageNotShow: true, coverageNotShow: true,
nameNotShow: false, nameNotShow: false,
algorithmShow: true, algorithmShow: true,
insertList: [] insertList: [],
inputAgree: '',
inputNo: '',
agreeOrList: '同意',
taskId: ''
} }
}, },
watch: {}, watch: {},
created () {
// KEY
console.log('params=================>', this.$route, this.$route.params)
this.taskId = this.$route.params.taskId
this.init()
console.log('fromList', this.$router.currentRoute.params.businessKey)
// this.dataForm = this.$router.currentRoute.params.params.params.resourceDTO
var callbacks = {
startProcessSuccessCallback: this.closeCurrentTab,
startProcessErrorCallback: this.startProcessErrorCallback,
taskHandleSuccessCallback: this.closeCurrentTab,
taskHandleErrorCallback: this.taskHandleErrorCallback,
formSaveSuccessCallback: null,
formSaveErrorCallback: null
}
//
this.initProcessMultiple(callbacks)
},
mounted () {
const businessKey = this.$router.currentRoute.params.businessKey
this.getInfo(businessKey)
this.methodsThree()
console.log(this.taskId, 'this.dataForm.taskId')
},
computed: {}, computed: {},
methods: { methods: {
getInfo (id) { getInfo (id) {
@ -101,35 +145,131 @@ export default {
console.log('id', this.$router.currentRoute.params.businessKey) console.log('id', this.$router.currentRoute.params.businessKey)
// } // }
}) })
}
}, },
created () { agreeOrNot: debounce(function () {
// this.dataForm = this.$router.currentRoute.params.id if (this.agreeOrList === '同意') {
this.init() console.log('this.dataForm.taskId', this.taskId)
console.log('fromList', this.$router.currentRoute.params.businessKey) const params = qs.stringify({
// this.dataForm = this.$router.currentRoute.params.params.params.resourceDTO taskId: this.taskId,
var callbacks = { comment: this.inputAgree
startProcessSuccessCallback: this.closeCurrentTab, })
startProcessErrorCallback: this.startProcessErrorCallback, console.log(params)
taskHandleSuccessCallback: this.closeCurrentTab, this.$http.post('/act/task/complete?' + params).then(({ data: res }) => {
taskHandleErrorCallback: this.taskHandleErrorCallback, if (res.code !== 0) {
formSaveSuccessCallback: null, this.$message.error(res.msg)
formSaveErrorCallback: null if (this.callbacks.taskHandleErrorCallback) {
this.callbacks.taskHandleErrorCallback(res)
} }
// return
this.initProcessMultiple(callbacks)
},
mounted () {
const businessKey = this.$router.currentRoute.params.businessKey
this.getInfo(businessKey)
this.methodsThree()
} }
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
if (this.callbacks.taskHandleSuccessCallback) {
this.callbacks.taskHandleSuccessCallback(res)
}
}
})
}).catch(() => {})
} else if (this.agreeOrList === '退回') {
console.log('this.dataForm.taskId', this.taskId)
const params = qs.stringify({
taskId: this.taskId,
comment: this.inputNo
})
this.$http.post('/act/task/backToFirst?', params).then(({ data: res }) => {
if (res.code !== 0) {
this.$message.error(res.msg)
if (this.callbacks.taskHandleErrorCallback) {
this.callbacks.taskHandleErrorCallback(res)
}
return
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
if (this.callbacks.taskHandleSuccessCallback) {
this.callbacks.taskHandleSuccessCallback(res)
}
}
})
})
}
}, 1000, { leading: true, trailing: false })
}
} }
</script> </script>
<style lang="scss"> <style scoped lang="scss">
.kuandukuandukuandu { .kuandukuandukuandu {
max-width: 1500px; max-width: 1500px;
} }
.wrapper { .wrapper {
} }
::v-deep .agreeOr > div {
display: flex;
align-items: center;
.el-input {
margin-right: 10px;
margin-left: 32px;
}
}
::v-deep .agreeOr > div:last-of-type {
margin-top: 15px;
}
.blueAll {
::v-deep .el-radio-button__inner {
width: 80px;
height: 32px;
line-height: 32px;
padding: 0;
border-radius: 2px;
background: #ffffff;
color: #0558e1;
border: 1px solid #0558e1;
}
::v-deep .el-radio-button__orig-radio:checked + .el-radio-button__inner {
box-shadow: unset !important;
background: #0558e1;
color: #ffffff;
}
}
.inputBule {
width: 55px;
height: 32px;
line-height: 32px;
padding: 0;
border-radius: 2px;
background: #0558e1;
color: #ffffff;
border: 1px solid #0558e1;
}
.redAll {
margin-left: 10px;
::v-deep .el-radio-button__inner {
width: 80px;
height: 32px;
line-height: 32px;
padding: 0;
border-radius: 2px;
border: 1px solid #e83a48;
background: #ffffff;
color: #e83a48;
margin-left: 10px;
}
::v-deep .el-radio-button__orig-radio:checked + .el-radio-button__inner {
box-shadow: unset !important;
color: #ffffff;
background: #e83a48;
}
}
.blueInput {
width: 55px;
}
</style> </style>