城阳pc工作端前端代码
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.

248 lines
4.9 KiB

<template>
4 years ago
<div class="epidemic-form">
<div class="dialog-h-content scroll-h">
<el-form ref="ref_form1"
:inline="true"
:model="formData"
:rules="dataRule"
class="form">
<el-form-item label="通知渠道"
prop="noticeWay"
label-width="150px"
style="display: block">
<el-checkbox-group v-model="formData.noticeWay">
<el-checkbox key="1"
label="1">小程序通知</el-checkbox>
<el-checkbox key="2"
label="2">短信通知</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="通知内容"
prop="noticeContent"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
type="textarea"
maxlength="1000"
show-word-limit
:autosize="{ minRows: 4, maxRows: 10 }"
clearable
placeholder="请输入通知内容"
v-model="formData.noticeContent"></el-input>
</el-form-item>
</el-form>
</div>
<div class="form_div_btn">
<el-button size="small"
@click="handleCancle"> </el-button>
<el-button size="small"
type="primary"
:disabled="btnDisable"
@click="handleComfirm"> </el-button>
</div>
</div>
</template>
<script>
import { Loading } from 'element-ui' // 引入Loading服务
import { requestPost } from '@/js/dai/request'
import { mapGetters } from 'vuex'
let loading // 加载动画
export default {
data () {
return {
activeName: "second",
gridList: [],
btnDisable: false,
formData: {
noticeWay: [],
noticeContent: '',
},
4 years ago
selectionAll: []
}
},
components: {},
async mounted () {
},
methods: {
4 years ago
async initForm (selectionAll) {
4 years ago
this.$refs['ref_form1'].resetFields();
this.selectionAll = selectionAll
},
async handleComfirm () {
this.btnDisable = true
setTimeout(() => {
this.btnDisable = false
}, 5000)
await this.sendNotice()
},
async sendNotice () {
console.log(this.formData)
return false
let url = ''
4 years ago
url = '/gov/project/memoConcern/update'
// url = "http://yapi.elinkservice.cn/mock/245/gov/project/memoConcern/update"
const { data, code, msg } = await requestPost(url, this.formData)
if (code === 0) {
this.$message({
type: 'success',
message: '操作成功'
})
this.resetData()
4 years ago
this.$emit('dialogCancle')
this.btnDisable = false
4 years ago
} else {
this.btnDisable = false
this.$message.error(msg)
}
},
handleCancle () {
this.resetData()
this.$emit('dialogCancle')
},
resetData () {
this.formData = {
name: '',
idCard: '',
phone: '',
remark: '',
noticeWay: [],
noticeContent: '',
}
},
handleSizeChange (val) {
this.pageSize = val
this.pageNo = 1
this.loadTable()
},
handleCurrentChange (val) {
this.pageNo = val
this.loadTable()
},
// 开启加载动画
startLoading () {
loading = Loading.service({
lock: true, // 是否锁定
text: '正在加载……', // 加载中需要显示的文字
background: 'rgba(0,0,0,.7)' // 背景颜色
})
},
// 结束加载动画
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
tableHeight () {
return 200
},
...mapGetters(['clientHeight', 'iframeHeight']),
dataRule () {
return {
name: [
{ required: true, message: '姓名不能为空', trigger: 'blur' }
],
idCard: [
{ required: true, message: '身份证号不能为空', trigger: 'blur' }
],
phone: [
{ required: true, message: '手机号不能为空', trigger: 'blur' },
],
checkTime: [
{ required: true, message: '检测时间不能为空', trigger: 'blur' },
],
address: [
{ required: false },
],
result: [
{ required: true },
],
address: [
{ required: false },
],
noticeWay: [
{ required: false },
],
noticeContent: [
{ required: false },
],
}
},
},
props: {
// serviceList: {
// type: Array,
// default: []
// },
}
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/modules/management/epidemic.scss";
</style>