|
@@ -106,7 +106,7 @@
|
|
|
<el-row>
|
|
|
<el-col :span="24" v-if="form.parentId !== 0">
|
|
|
<el-form-item label="上级部门" prop="parentIdData">
|
|
|
- <DeptCascader v-model.sync="form.parentIdData"></DeptCascader>
|
|
|
+ <DeptCascader v-model="form.parentIdData"></DeptCascader>
|
|
|
<!--<el-cascader v-if="show" :key="modalKey" v-model="form.parentIdData" :props="props" ></el-cascader>-->
|
|
|
<!--<treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="选择上级部门" />-->
|
|
|
</el-form-item>
|
|
@@ -157,7 +157,7 @@
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="所属区划" required>
|
|
|
- <el-input v-model="form.locationName|| '无'" :disabled="true" v-if="form.deptId"/>
|
|
|
+ <el-input v-model="form.locationName" :disabled="true" v-if="form.deptId"/>
|
|
|
<RegionCascaderSelect valueProp="code" v-model="form.location" v-else></RegionCascaderSelect>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -175,6 +175,7 @@
|
|
|
import {addDept, delDept, getDept, listDept, updateDept} from "@/api/system/dept";
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
+import { Email,Mobile } from '@/utils/regular'
|
|
|
import {mapGetters, mapState} from "vuex";
|
|
|
import { decryptData_ECB, decryptRowData_ECB } from "@/api/tool/sm4";
|
|
|
|
|
@@ -220,18 +221,10 @@ export default {
|
|
|
{ required: true, message: "显示排序不能为空", trigger: "blur" }
|
|
|
],
|
|
|
email: [
|
|
|
- {
|
|
|
- type: "email",
|
|
|
- message: "请输入正确的邮箱地址",
|
|
|
- trigger: ["blur", "change"]
|
|
|
- }
|
|
|
+ { validator: Email, trigger: "blur" }
|
|
|
],
|
|
|
phone: [
|
|
|
- {
|
|
|
- pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
|
|
- message: "请输入正确的手机号码",
|
|
|
- trigger: "blur"
|
|
|
- }
|
|
|
+ {validator: Mobile, trigger: 'blur' }
|
|
|
],
|
|
|
}
|
|
|
};
|
|
@@ -255,7 +248,6 @@ export default {
|
|
|
item.hasChildren = true;
|
|
|
item.isZs = (tree.locationCode == item.locationCode ? "直属":"")
|
|
|
});
|
|
|
- console.log("zzz",data)
|
|
|
resolve(data);
|
|
|
},
|
|
|
async updateTreeData(node) {
|
|
@@ -366,7 +358,7 @@ export default {
|
|
|
this.reset();
|
|
|
getDept(row.deptId).then(response => {
|
|
|
this.open = true;
|
|
|
- this.form = response.data;
|
|
|
+ this.form = decryptData_ECB(response.data, ['leader', 'phone', 'email'], [1, 3, 5]);
|
|
|
// this.show = false;
|
|
|
this.form.parentIdData =[...row.ancestors.split(',').map(item=>{
|
|
|
return parseInt(item)
|
|
@@ -374,9 +366,6 @@ export default {
|
|
|
// this.$nextTick(() => {
|
|
|
// this.show = true;
|
|
|
// });
|
|
|
- console.log(this.form.parentIdData,'this.form.parentIdData');
|
|
|
- console.log(row,'this.form.parentIdData');
|
|
|
-
|
|
|
this.title = "修改部门";
|
|
|
});
|
|
|
},
|
|
@@ -384,20 +373,20 @@ export default {
|
|
|
submitForm: function() {
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
|
- if (this.form.location && this.form.parentIdData){
|
|
|
- if (this.form.location.length != this.form.parentIdData.length + 1
|
|
|
- && this.form.location.length != this.form.parentIdData.length
|
|
|
- ){
|
|
|
- this.$modal.msgError("所属区划只能是当前部门层级或者上一级(直属)");
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
- if (this.form.location){
|
|
|
- this.form.locationCode = this.form.location[this.form.location.length-1];
|
|
|
- }else{
|
|
|
- this.$modal.msgError("所属区划不能为空");
|
|
|
- return
|
|
|
- }
|
|
|
+ // if (this.form.location && this.form.parentIdData){
|
|
|
+ // if (this.form.location.length != this.form.parentIdData.length + 1
|
|
|
+ // && this.form.location.length != this.form.parentIdData.length
|
|
|
+ // ){
|
|
|
+ // this.$modal.msgError("所属区划只能是当前部门层级或者上一级(直属)");
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // if (this.form.location){
|
|
|
+ // this.form.locationCode = this.form.location[this.form.location.length-1];
|
|
|
+ // }else{
|
|
|
+ // this.$modal.msgError("所属区划不能为空");
|
|
|
+ // return
|
|
|
+ // }
|
|
|
if(this.form.parentIdData)
|
|
|
{
|
|
|
this.form.parentId=this.form.parentIdData[this.form.parentIdData.length-1]
|