You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

163 lines
4.1 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<div>
<xy-dialog ref="dialog" :is-show.sync="isShow" :width='50' :type="'form'" :title="'督办提醒'"
:form="form" :rules='rules' @submit="submit">
<template v-slot:title>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>提醒内容
</div>
<div class="xy-table-item-content">
<el-input v-model="form.title" type="textarea" placeholder="请输入提醒内容" clearable
style="width: 400px;"></el-input>
</div>
</div>
</template>
<template v-slot:users>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>接收人:
</div>
<div class="xy-table-item-content">
<el-checkbox-group v-model="checkList">
<el-checkbox v-for="item in checkArr" :label="item.accept_admin_id">{{item.accept_admin.name}}</el-checkbox>
</el-checkbox-group>
</div>
</div>
</template>
<template v-slot:footerContent>
<Button type="primary" style='margin-left:5px;margin-bottom:5px;'
@click="submit">发送</Button>
<Button type="primary" ghost style='margin-left:5px;margin-bottom:5px;' @click="isShow=false">取消</Button>
</template>
</xy-dialog>
</div>
</template>
<script>
import {
Message
} from 'element-ui'
import {
saveNotice
} from '@/api/task/unit.js'
import {deepCopy} from "@/utils/index.js"
export default {
components: {
},
data() {
return {
isShow: false,
type: 'add',
id: '',
checkList:[],
checkArr:[],
formObj: {},
form: {
title:'您有一条安全生产任务需要办理',
users:[]
},
rules: {
// carry_type: [{
// required: true,
// message: '请选择'
// }],
// start_date: [{
// required: true,
// message: '请选择'
// }],
// end_date: [{
// required: true,
// message: '请选择'
// }],
}
}
},
created() {
},
methods: {
setForm(e) {
if (e) {
let arr = []
let Arr = []
this.form.title = `"${e.name}"任务请及时处理(安全生产管理平台)`
this.form.mission_id = e.id
e.mission_distribute.map(item=>{
// if(item.admin_type>1){
arr.push(item.accept_admin_id)
Arr.push(item)
// }
})
this.checkList = arr
this.checkArr = Arr
}
},
submit() {
let uArr = []
if(!this.form.title){
this.$Message.warning("请输入提醒内容")
return
}
if(this.checkList.length>0){
this.checkList.map(item=>{
uArr.push({
user_id:item
})
})
this.form.users = uArr
}else{
this.$Message.warning("请选择接收人")
return
}
saveNotice(this.form).then(res => {
Message({
type: 'success',
message: '提交成功'
})
this.$emit('refresh')
this.isShow = false
})
},
},
watch: {
isShow(newVal) {
if (newVal) {
} else {
this.id = ''
this.checkList = []
this.checkArr = []
this.$refs['dialog'].reset()
}
},
}
}
</script>
<style scoped lang="scss">
::v-deep .title,
::v-deep .users {
flex-basis: 100%;
}
::v-deep .el-form>div {
align-items: flex-start !important;
}
.xy-table-item {
padding-right: 0
}
::v-deep .xy-table-item-label {
padding-right: 0
}
</style>