Commit 23be16ad authored by Mac's avatar Mac

验证修改

parent 8baf9fc1
...@@ -159,16 +159,9 @@ ...@@ -159,16 +159,9 @@
//保存岗位 //保存岗位
savePost() { savePost() {
var tempRole = []; var tempRole = [];
if(this.objOption.PostName==''){ this.$refs.PostName.validate()
this.$q.notify({ if(!this.$refs.PostName.hasError){
type: 'negative', if (this.RoleList && this.RoleList.length > 0) {
position: 'top',
message: `请填写岗位名称`
})
return
}
if (this.RoleList && this.RoleList.length > 0) {
this.RoleList.forEach(x => { this.RoleList.forEach(x => {
this.value.forEach(j => { this.value.forEach(j => {
if (x.RoleId == j) { if (x.RoleId == j) {
...@@ -210,6 +203,7 @@ ...@@ -210,6 +203,7 @@
}).catch(() => { }).catch(() => {
this.saveLoading = false this.saveLoading = false
}) })
}
} }
}, },
} }
......
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
<q-card-section class="q-pt-none"> <q-card-section class="q-pt-none">
<div class="row wrap"> <div class="row wrap">
<q-input clearable filled class="col-6 q-pb-lg q-pr-lg" standout="bg-primary text-white" <q-input clearable filled class="col-6 q-pb-lg q-pr-lg" standout="bg-primary text-white"
v-model="addMsg.From" label="公文来源(FR)" :rules="[val => !!val || '公文来源(FR)']" /> v-model="addMsg.From" ref="From" label="公文来源(FR)" :rules="[val => !!val || '公文来源(FR)']" />
<selectTree class="col-6 q-pb-lg q-pr-lg" :treeData='DeptList' :defaultArray="returnString" nodeKey="DeptId" <selectTree class="col-6 q-pb-lg q-pr-lg" :treeData='DeptList' :defaultArray="returnString" nodeKey="DeptId"
:multiple="true" :defaultExpandAll="true" labelKey="DeptName" childrenKey="ChildList" tipText="To" :multiple="true" :defaultExpandAll="true" labelKey="DeptName" childrenKey="ChildList" tipText="To"
@getChild="getChild" classStr="col-6 q-pr-lg q-pb-lg"></selectTree> @getChild="getChild" classStr="col-6 q-pr-lg q-pb-lg"></selectTree>
...@@ -154,7 +154,7 @@ ...@@ -154,7 +154,7 @@
<q-input clearable class="col-6 q-pb-lg q-pr-lg" standout="bg-primary text-white" disable v-model="nNumber" <q-input clearable class="col-6 q-pb-lg q-pr-lg" standout="bg-primary text-white" disable v-model="nNumber"
label="编号" v-if="nNumber!=null " /> label="编号" v-if="nNumber!=null " />
<q-input clearable filled class="col-12 q-pb-lg q-pr-lg" standout="bg-primary text-white" <q-input clearable filled class="col-12 q-pb-lg q-pr-lg" standout="bg-primary text-white"
v-model="addMsg.Title" label="标题" :rules="[val => !!val || '标题']" /> v-model="addMsg.Title" ref="Title" label="标题" :rules="[val => !!val || '标题']" />
<div class="text-caption q-my-md q-px-xs text-grey-6">公告内容</div> <div class="text-caption q-my-md q-px-xs text-grey-6">公告内容</div>
<ext-editor :defaultMsg="addMsg.Content" classStr="col-12" @getEditValue="getEditValue"></ext-editor> <ext-editor :defaultMsg="addMsg.Content" classStr="col-12" @getEditValue="getEditValue"></ext-editor>
<el-upload style="margin-top: 20px" :http-request="uploadFile2" :file-list="fileList" <el-upload style="margin-top: 20px" :http-request="uploadFile2" :file-list="fileList"
...@@ -591,52 +591,57 @@ ...@@ -591,52 +591,57 @@
this.persistent = false this.persistent = false
}, },
save_t(val) { save_t(val) {
this.$refs.From.validate()
this.addMsg.NoticeState = val //发布状态 this.$refs.Title.validate()
this.saveLoading = true; if(!this.$refs.From.hasError && !this.$refs.Title.hasError){
var tempStr = ""; this.addMsg.NoticeState = val //发布状态
if (this.tempManager2 && this.tempManager2.length > 0) { this.saveLoading = true;
this.tempManager2.forEach(item => { var tempStr = "";
tempStr += "," + item; if (this.tempManager2 && this.tempManager2.length > 0) {
}); this.tempManager2.forEach(item => {
} tempStr += "," + item;
if (tempStr && tempStr != '') { });
//去掉第一个字符
tempStr = tempStr.substr(1);
}
this.addMsg.CopyPeople = tempStr;
this.addMsg.FileList = []
this.fileList.forEach((x) => {
let obj = {
FileName: x.name,
FileUrl: x.url
} }
this.addMsg.FileList.push(obj) if (tempStr && tempStr != '') {
}) //去掉第一个字符
let data = this.addMsg tempStr = tempStr.substr(1);
if (data.CopyPeople == '') {
data.CopyPeople = -1
}
if (data.To == '') {
data.To = -1
}
setNoticeInfo(data).then(res => {
this.saveLoading = false
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!',
position: 'top'
})
this.$emit("success")
this.persistent = false
this.getList();
} }
}).catch(() => { this.addMsg.CopyPeople = tempStr;
this.saveLoading = false this.addMsg.FileList = []
}) this.fileList.forEach((x) => {
let obj = {
FileName: x.name,
FileUrl: x.url
}
this.addMsg.FileList.push(obj)
})
let data = this.addMsg
if (data.CopyPeople == '') {
data.CopyPeople = -1
}
if (data.To == '') {
data.To = -1
}
setNoticeInfo(data).then(res => {
this.saveLoading = false
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!',
position: 'top'
})
this.$emit("success")
this.persistent = false
this.getList();
}
}).catch(() => {
this.saveLoading = false
})
}
}, },
EditConfig(id) { EditConfig(id) {
this.drawer = true; this.drawer = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment