update code

dev_xds
haha 2024-04-14 23:52:47 +08:00
parent 2fa278a1a9
commit d1bfb36b3b
1 changed files with 24 additions and 6 deletions

View File

@ -27,7 +27,7 @@
<el-col :span="8"> <el-col :span="8">
<el-form-item label="部门" prop="deptid"> <el-form-item label="部门" prop="deptid">
<treeselect v-model="form.deptid" :options="deptOptions" :show-count="true" <treeselect v-model="form.deptid" :options="deptOptions" :show-count="true"
placeholder="请选择归属部门" @select="doDeptChange()" /> placeholder="请选择归属部门" @select="doDeptChange(0)" />
<!-- <!--
<el-select v-model="form.deptid" filterable placeholder="请选择单位" style="width: 100%;" <el-select v-model="form.deptid" filterable placeholder="请选择单位" style="width: 100%;"
@change="doDeptChange()"> @change="doDeptChange()">
@ -144,10 +144,25 @@ export default {
} }
return it; return it;
}); });
this.form.authorName=""; if(init==0){
this.form.authorPhone=""; this.form.authorName="";
if (init) { this.form.authorPhone="";
if (this.oldData && this.userList.length > 0) { }else if(init==1){
let user=this.$store.state.user;
if(user){
let tmps=this.userList.filter(d=>d.userId==user.userId);
if(tmps.length>0){
let tmp=tmps[0];
let phone=tmp.phonenumber;
if(!phone){
phone=tmp.userId+" --- ";
}
this.form.authorPhone=phone;
}
}
}
else if (init==2) {
if (this.oldData && this.userList.length > 0) {
this.form.authorPhone = this.oldData.authorPhone; this.form.authorPhone = this.oldData.authorPhone;
this.form.authorName = this.oldData.authorName; this.form.authorName = this.oldData.authorName;
} }
@ -186,7 +201,7 @@ export default {
this.form.ord = ord; this.form.ord = ord;
this.isOpen = true; this.isOpen = true;
this.loadMag(true); this.loadMag(true);
this.loadDepts(true); this.loadDepts(2);
if (row) { if (row) {
this.form.title = row.title; this.form.title = row.title;
this.form.ord = row.ord; this.form.ord = row.ord;
@ -206,6 +221,9 @@ export default {
this.form.imageUrl = []; this.form.imageUrl = [];
this.form.content = ""; this.form.content = "";
this.form.images = ""; this.form.images = "";
if(user){
this.doDeptChange(1);
}
} }
}, },
submitForm() { submitForm() {