Commit 23be16ad authored by Mac's avatar Mac

验证修改

parent 8baf9fc1
......@@ -159,16 +159,9 @@
//保存岗位
savePost() {
var tempRole = [];
if(this.objOption.PostName==''){
this.$q.notify({
type: 'negative',
position: 'top',
message: `请填写岗位名称`
})
return
}
if (this.RoleList && this.RoleList.length > 0) {
this.$refs.PostName.validate()
if(!this.$refs.PostName.hasError){
if (this.RoleList && this.RoleList.length > 0) {
this.RoleList.forEach(x => {
this.value.forEach(j => {
if (x.RoleId == j) {
......@@ -210,6 +203,7 @@
}).catch(() => {
this.saveLoading = false
})
}
}
},
}
......
......@@ -135,7 +135,7 @@
<q-card-section class="q-pt-none">
<div class="row wrap">
<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"
:multiple="true" :defaultExpandAll="true" labelKey="DeptName" childrenKey="ChildList" tipText="To"
@getChild="getChild" classStr="col-6 q-pr-lg q-pb-lg"></selectTree>
......@@ -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"
label="编号" v-if="nNumber!=null " />
<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>
<ext-editor :defaultMsg="addMsg.Content" classStr="col-12" @getEditValue="getEditValue"></ext-editor>
<el-upload style="margin-top: 20px" :http-request="uploadFile2" :file-list="fileList"
......@@ -591,52 +591,57 @@
this.persistent = false
},
save_t(val) {
this.addMsg.NoticeState = val //发布状态
this.saveLoading = true;
var tempStr = "";
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.$refs.From.validate()
this.$refs.Title.validate()
if(!this.$refs.From.hasError && !this.$refs.Title.hasError){
this.addMsg.NoticeState = val //发布状态
this.saveLoading = true;
var tempStr = "";
if (this.tempManager2 && this.tempManager2.length > 0) {
this.tempManager2.forEach(item => {
tempStr += "," + item;
});
}
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();
if (tempStr && tempStr != '') {
//去掉第一个字符
tempStr = tempStr.substr(1);
}
}).catch(() => {
this.saveLoading = false
})
this.addMsg.CopyPeople = tempStr;
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) {
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