Browse Source

【项目管理议题管理】【添加操作人部门下拉选项】-王公峰-2020-05-15

master
wanggongfeng 5 years ago
parent
commit
11d1d1b2b8
  1. 34
      src/views/modules/events/issue-process-detail-view.vue
  2. 36
      src/views/modules/events/issue-review-detail-view.vue
  3. 54
      src/views/modules/events/item-deal-detail-view.vue

34
src/views/modules/events/issue-process-detail-view.vue

@ -96,6 +96,17 @@
style="width: 720px;" style="width: 720px;"
:model="dataForm" :model="dataForm"
:rules="dataRule"> :rules="dataRule">
<el-form-item label="操作人部门" prop="handlerDeptIdRule">
<el-cascader
ref="name"
v-model="dataForm.handlerDeptIdRule"
:options="options"
:props="{ multiple: false, checkStrictly: true }"
@change="changeHandle"
clearable
>
</el-cascader>
</el-form-item>
<el-form-item label="处理:" <el-form-item label="处理:"
prop="state"> prop="state">
<el-select v-model="dataForm.state" <el-select v-model="dataForm.state"
@ -146,6 +157,7 @@ export default {
distributeTime: '', distributeTime: '',
advice: '', advice: '',
state: '', state: '',
handlerDeptIdRule: '',
issueProgressResultDTOS: [], issueProgressResultDTOS: [],
images: [] images: []
}, },
@ -161,11 +173,13 @@ export default {
verifyFlag: '4', verifyFlag: '4',
verifyTitle: '转为项目' verifyTitle: '转为项目'
}], }],
timeLineList: [] timeLineList: [],
options: []
} }
}, },
mounted () { mounted () {
this.dataForm.id = this.$route.query.id this.dataForm.id = this.$route.query.id
this.getOptions()
this.init() this.init()
}, },
filters: { filters: {
@ -194,6 +208,9 @@ export default {
], ],
state: [ state: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
handlerDeptIdRule: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
] ]
} }
} }
@ -202,6 +219,21 @@ export default {
backToItemDeal () { backToItemDeal () {
this.$parent.selectComponent = 'IssueProcessList' this.$parent.selectComponent = 'IssueProcessList'
}, },
getOptions () {
this.$http
.get(`/sys/user/deptOptions/getDeptAuthByUser`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.options = res.data.options
})
.catch(() => {})
},
changeHandle (value, selectedData) {
this.dataForm.handlerDept = this.$refs['name'].getCheckedNodes()[0].label
this.dataForm.handlerDeptId = this.$refs['name'].getCheckedNodes()[0].value
},
initBmap (latitude, longitude) { initBmap (latitude, longitude) {
this.map = new BMap.Map('map') this.map = new BMap.Map('map')
const point = new BMap.Point(longitude, latitude) const point = new BMap.Point(longitude, latitude)

36
src/views/modules/events/issue-review-detail-view.vue

@ -40,6 +40,17 @@
<div class="handle-operation"> <div class="handle-operation">
<div class="handle-operation-tip">处理操作</div> <div class="handle-operation-tip">处理操作</div>
<el-form ref="dataForm" label-width="120px" label-position="right" style="width: 720px;" :model="dataForm" :rules="dataRule"> <el-form ref="dataForm" label-width="120px" label-position="right" style="width: 720px;" :model="dataForm" :rules="dataRule">
<el-form-item label="操作人部门" prop="handlerDeptIdRule">
<el-cascader
ref="name"
v-model="dataForm.handlerDeptIdRule"
:options="options"
:props="{ multiple: false, checkStrictly: true }"
@change="changeHandle"
clearable
>
</el-cascader>
</el-form-item>
<el-form-item label="审核:" prop="eventState"> <el-form-item label="审核:" prop="eventState">
<el-radio v-model="dataForm.eventState" label="4">审核通过</el-radio> <el-radio v-model="dataForm.eventState" label="4">审核通过</el-radio>
<el-radio v-model="dataForm.eventState" label="2">驳回</el-radio> <el-radio v-model="dataForm.eventState" label="2">驳回</el-radio>
@ -78,6 +89,7 @@ export default {
nickName: '', nickName: '',
categoryId: '', categoryId: '',
advice: '', advice: '',
handlerDeptIdRule: '',
eventState: '4' eventState: '4'
}, },
isAble: false, isAble: false,
@ -85,11 +97,13 @@ export default {
previewImgList: [], previewImgList: [],
categoryVisible: true, categoryVisible: true,
urls: [], urls: [],
categoryOptions: [] categoryOptions: [],
options: []
} }
}, },
mounted () { mounted () {
this.dataForm.id = this.$route.query.id this.dataForm.id = this.$route.query.id
this.getOptions()
this.init() this.init()
}, },
computed: { computed: {
@ -103,6 +117,9 @@ export default {
], ],
advice: [ advice: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
handlerDeptIdRule: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
] ]
} }
} }
@ -128,6 +145,21 @@ export default {
} }
}) })
}, },
getOptions () {
this.$http
.get(`/sys/user/deptOptions/getDeptAuthByUser`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.options = res.data.options
})
.catch(() => {})
},
changeHandle (value, selectedData) {
this.dataForm.handlerDept = this.$refs['name'].getCheckedNodes()[0].label
this.dataForm.handlerDeptId = this.$refs['name'].getCheckedNodes()[0].value
},
getCategoryList () { getCategoryList () {
return this.$http.get('/events/category/list').then(({ data: res }) => { return this.$http.get('/events/category/list').then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
@ -176,7 +208,7 @@ export default {
// //
dataFormSubmitHandle: debounce(function () { dataFormSubmitHandle: debounce(function () {
this.dataForm.categoryId = this.categoryIds[this.categoryIds.length - 1] this.dataForm.categoryId = this.categoryIds[this.categoryIds.length - 1]
console.log(this.dataForm.categoryId) console.log(this.dataForm)
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate((valid) => {
if (!valid) { if (!valid) {
return false return false

54
src/views/modules/events/item-deal-detail-view.vue

@ -108,10 +108,20 @@
style="width: 720px;" style="width: 720px;"
:model="dataForm" :model="dataForm"
:rules="dataRule"> :rules="dataRule">
<el-form-item label="操作人部门" prop="handlerDeptIdRule">
<el-cascader
ref="name"
v-model="dataForm.handlerDeptIdRule"
:options="options"
:props="{ multiple: false, checkStrictly: true }"
@change="changeHandle"
>
</el-cascader>
</el-form-item>
<el-form-item label="处理:" <el-form-item label="处理:"
prop="handleCategory"> prop="handleCategory">
<el-select v-model="postDataForm.handleCategory" <el-select v-model="postDataForm.handleCategory"
placeholder="请选择"> placeholder="请选择" @visible-change="visibleChange">
<el-option v-for="handleResultDTO in dataForm.handleResultDTOS" <el-option v-for="handleResultDTO in dataForm.handleResultDTOS"
:key="handleResultDTO.processResult" :key="handleResultDTO.processResult"
:label="handleResultDTO.processName" :label="handleResultDTO.processName"
@ -252,7 +262,8 @@ export default {
outHandleAdvice: '', outHandleAdvice: '',
handleCategory: '', handleCategory: '',
issueLatitude: '', issueLatitude: '',
issueLongitude: '' issueLongitude: '',
handlerDeptIdRule: ''
}, },
isAble: false, isAble: false,
previewImgList: [], previewImgList: [],
@ -271,11 +282,13 @@ export default {
}, },
deptResultDTOSVisible: false, deptResultDTOSVisible: false,
evaluateDeptDTOSVisible: false, evaluateDeptDTOSVisible: false,
timeLineList: [] timeLineList: [],
options: []
} }
}, },
mounted () { mounted () {
this.dataForm.id = this.$route.query.id this.dataForm.id = this.$route.query.id
this.getOptions()
this.init() this.init()
}, },
filters: { filters: {
@ -342,6 +355,9 @@ export default {
], ],
evaluateDeptDTOS: [ evaluateDeptDTOS: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
handlerDeptIdRule: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
] ]
} }
} }
@ -379,6 +395,38 @@ export default {
backToItemDeal () { backToItemDeal () {
this.$parent.selectComponent = 'ItemDeal' this.$parent.selectComponent = 'ItemDeal'
}, },
getOptions () {
this.$http
.get(`/sys/user/deptOptions/getDeptAuthByUser`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.options = res.data.options
})
.catch(() => {})
},
visibleChange (val) {
if (this.dataForm.handleResultDTOS.length === 0 && this.dataForm.handlerDeptIdRule === '' && val === true) {
return this.$message.error('请先选择操作人部门!')
}
},
changeHandle (value, selectedData) {
this.postDataForm.handlerDept = this.$refs['name'].getCheckedNodes()[0].label
this.postDataForm.handlerDeptId = this.$refs['name'].getCheckedNodes()[0].value
this.getHandleResultDTOS()
},
//
getHandleResultDTOS () {
this.$http.post(`/events/item/getHandleResultDTOS`, { itemId: this.dataForm.id, deptId: this.postDataForm.handlerDeptId }).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm.handleResultDTOS = res.data.handleResultDTOS
this.dataForm.deptResultDTOS = res.data.deptResultDTOS
this.dataForm.evaluateDeptDTOS = res.data.evaluateDeptDTOS
}).catch(() => { })
},
initBmap (latitude, longitude) { initBmap (latitude, longitude) {
this.map = new BMap.Map('map') this.map = new BMap.Map('map')
const point = new BMap.Point(longitude, latitude) const point = new BMap.Point(longitude, latitude)

Loading…
Cancel
Save