Commit 4d525de0 authored by “yiyousong”'s avatar “yiyousong”

修改添加部门

parent 191f38fe
...@@ -46,9 +46,11 @@ ...@@ -46,9 +46,11 @@
<a-form-model-item label="所属部门" prop="deptCode"> <a-form-model-item label="所属部门" prop="deptCode">
<a-select <a-select
showSearch showSearch
v-model="baseform.deptCode" v-model="curDpt"
optionFilterProp="label" optionFilterProp="label"
placeholder="请选择部门" placeholder="请选择部门"
labelInValue
@change="changeDpt"
> >
<a-select-option <a-select-option
v-for="v in deptData" v-for="v in deptData"
...@@ -333,6 +335,7 @@ export default { ...@@ -333,6 +335,7 @@ export default {
performHierarchyShowItem: [], // 形式层级选项 performHierarchyShowItem: [], // 形式层级选项
certification: [], // 认证点击选项 certification: [], // 认证点击选项
typeItem: [], // 主题类型选项 typeItem: [], // 主题类型选项
curDpt: {}, // 当前选中部门
baseform: { baseform: {
matterName: "", // 事项 名称 matterName: "", // 事项 名称
englishName: "", // 事项英文名称 englishName: "", // 事项英文名称
...@@ -340,6 +343,7 @@ export default { ...@@ -340,6 +343,7 @@ export default {
sort: "", // 排序 sort: "", // 排序
belongDept: undefined, //所属部门 belongDept: undefined, //所属部门
deptCode: undefined, //所属部门编号 deptCode: undefined, //所属部门编号
deptName: "", // 部门名称
legalTimeLimitShow: "", // 法定办结时限 legalTimeLimitShow: "", // 法定办结时限
promiseTimeLimitShow: "", // 承诺办结时限 promiseTimeLimitShow: "", // 承诺办结时限
isChargesShow: "", //是否收费 isChargesShow: "", //是否收费
...@@ -391,15 +395,15 @@ export default { ...@@ -391,15 +395,15 @@ export default {
}, },
}, },
created() { created() {
if (!this.baseform.matterNo) { this.getDeptListData();
this.baseform.matterNo = this.$nanoid();
// this.baseform.matterNo = new Date().getTime();
}
if (this.$route.query.edit == 1) { if (this.$route.query.edit == 1) {
let matterId = this.$route.query.matterId; let matterId = this.$route.query.matterId;
this.getMatterInfo(matterId); this.getMatterInfo(matterId);
} }
this.getDeptListData(); if (!this.baseform.matterNo) {
this.baseform.matterNo = this.$nanoid();
// this.baseform.matterNo = new Date().getTime();
}
}, },
methods: { methods: {
// 获取部门列表 // 获取部门列表
...@@ -409,6 +413,11 @@ export default { ...@@ -409,6 +413,11 @@ export default {
if (code === 1) { if (code === 1) {
this.deptData = data.data; this.deptData = data.data;
this.baseform.deptCode = this.deptData[0].deptNumber; this.baseform.deptCode = this.deptData[0].deptNumber;
this.baseform.deptName = this.deptData[0].name;
this.curDpt = {
key: this.deptData[0].deptNumber,
label: this.deptData[0].name,
};
} }
}, },
// 编辑时获取信息 // 编辑时获取信息
...@@ -416,8 +425,17 @@ export default { ...@@ -416,8 +425,17 @@ export default {
let res = await getMatterInfo({ id }); let res = await getMatterInfo({ id });
if (res.data.code === 1) { if (res.data.code === 1) {
this.baseform = res.data.data; this.baseform = res.data.data;
this.curDpt = {
key: this.baseform.deptCode,
label: this.baseform.deptName,
};
} }
}, },
// 切换部门
changeDpt(val) {
this.baseform.deptCode = val.key;
this.baseform.deptName = val.label;
},
// 保存 // 保存
handleOk() { handleOk() {
this.$refs.form.validate(async (valid) => { this.$refs.form.validate(async (valid) => {
...@@ -442,6 +460,7 @@ export default { ...@@ -442,6 +460,7 @@ export default {
} }
}); });
}, },
// 重置 // 重置
handleReset() { handleReset() {
let _this = this; let _this = this;
...@@ -458,6 +477,7 @@ export default { ...@@ -458,6 +477,7 @@ export default {
_this.isTimely = undefined; // 是否及时办理 _this.isTimely = undefined; // 是否及时办理
_this.isPromise = undefined; // 承诺是否及时办理 _this.isPromise = undefined; // 承诺是否及时办理
_this.isLinked = undefined; // 是否有联办机构 _this.isLinked = undefined; // 是否有联办机构
_this.form.deptName = "";
_this.$refs.form.resetFields(); _this.$refs.form.resetFields();
}, },
onCancel() { onCancel() {
......
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