This commit is contained in:
DESKTOP-369JRHT\12997 2024-11-05 18:04:38 +08:00
parent e56315291c
commit f3eb217f5e
3 changed files with 55 additions and 40 deletions

View File

@ -123,7 +123,7 @@ export default {
}
.table-box {
width: 100%;
height: 66vh;
height: 81vh;
overflow: auto;
background: #FFF;
box-sizing: border-box;
@ -133,7 +133,8 @@ export default {
}
.hui_box{
box-sizing: border-box;
padding: 15px;
padding: 10px;
padding-bottom: 0px;
background: #f6f8f9;
}
.top-box{

View File

@ -87,14 +87,14 @@
</div>
<el-dialog center :title="title" :close-on-click-modal="false" :visible.sync="open" width="42%" append-to-body>
<el-form :model="form" label-width="80px" >
<el-form ref="form" :model="form" :rules="rules" label-width="80px" >
<!-- 通知名称 -->
<el-form-item label="通知名称" :required="true">
<el-form-item label="通知名称" prop="notificationName" :required="true">
<el-input v-model="form.notificationName" placeholder="请输入通知名称" ></el-input>
</el-form-item>
<!-- 通知类型 -->
<el-form-item label="通知类型" :required="true">
<el-form-item label="通知类型" prop="notificationType" :required="true">
<el-select v-model="form.notificationType" placeholder="请选择通知类型" style="width: 100%">
<el-option label="到期通知" value="到期通知"></el-option>
<el-option label="库存预警" value="库存预警"></el-option>
@ -104,7 +104,7 @@
</el-form-item>
<!-- 通知模板 -->
<el-form-item label="通知模板" :required="true">
<el-form-item label="通知模板" prop="templateContent" :required="true">
<el-input type="textarea" v-model="form.templateContent" :rows="3" placeholder="请输入通知内容"
:maxlength="200" show-word-limit ></el-input>
<div>
@ -115,7 +115,7 @@
</div>
</el-form-item>
<!-- 接收角色 -->
<el-form-item label="接收角色" :required="true">
<el-form-item label="接收角色" prop="recipientRoles" :required="true">
<el-select v-model="form.recipientRoles" multiple placeholder="请选择角色" style="width: 100%">
<el-option v-for="item in dutyList1" :label="item.dutyName" :value="item.dutyId"></el-option>
</el-select>
@ -125,7 +125,7 @@
<el-switch v-model="form.templateStatus" active-color="#13ce66" inactive-color="#ff4949"></el-switch>
</el-form-item>
<!-- 发送条件 -->
<el-form-item label="发送条件" style="margin-bottom: 10px" :required="true">
<el-form-item label="发送条件" prop="conditions" style="margin-bottom: 10px" :required="true">
<div v-for="(condition, index) in form.conditions" :key="index" class="condition-group"
style="margin-bottom: 10px">
<el-select v-model="condition.field" placeholder="请选择条件" style="width: 35%;margin-right: 10px"
@ -151,7 +151,7 @@
</el-form>
<div style="display: flex; justify-content: center; align-items: center;margin-top: 30px">
<el-button @click="handleReset">取消</el-button>
<el-button type="primary" @click="handleSubmit">保存</el-button>
<el-button type="primary" @click="handleSubmit('form' )">保存</el-button>
</div>
</el-dialog>
</div>
@ -206,6 +206,24 @@ export default {
legalRepresentativeContact: '',
appStatus: '',
},
rules: {
notificationName: [
{ required: true, message: '不能为空', trigger: 'blur' },
],
notificationType:[
{ required: true, message: '不能为空', trigger: 'blur' },
],
templateContent:[
{ required: true, message: '不能为空', trigger: 'blur' },
],
recipientRoles:[
{ required: true, message: '不能为空', trigger: 'blur' },
],
conditions:[
{ required: true, message: '不能为空', trigger: 'blur' },
],
},
roleList: [],
};
},
@ -264,23 +282,12 @@ export default {
// });
// },
handleSubmit() {
handleSubmit(formName) {
this.$refs[formName].validate((valid) =>{
if (valid) {
//
this.open = false
//
console.log('提交设备信息数据:', this.form);
if (this.form.conditions.length === 0 || this.form.conditions[0].field == '') {
this.form.conditions = ''
this.$message({
type: 'info',
message: '请选择发送条件!'
});
return
} else {
this.form.conditions = JSON.stringify(this.form.conditions)
}
this.form.recipientRoles = JSON.stringify(this.form.recipientRoles)
if (this.form.id) {
updateSysNotifyApi(this.form).then(res => {
if (res.code === 200) {
@ -296,6 +303,13 @@ export default {
}
})
}
}
})
},
handleReset() {
this.open = false

View File

@ -1271,7 +1271,7 @@ export default
background: #fff;
box-sizing: border-box;
padding: 20px;
margin-top: 20px;
margin-top:15px;
}
.anniu-h {