diff --git a/project/pingchang/apps/AppOrganizationChange/AppOrganizationChange.vue b/project/pingchang/apps/AppOrganizationChange/AppOrganizationChange.vue index e4eaa79e..1284f5c6 100644 --- a/project/pingchang/apps/AppOrganizationChange/AppOrganizationChange.vue +++ b/project/pingchang/apps/AppOrganizationChange/AppOrganizationChange.vue @@ -8,7 +8,6 @@ - - diff --git a/project/pingchang/apps/AppOrganizationChange/components/detailPanel.vue b/project/pingchang/apps/AppOrganizationChange/components/detailPanel.vue index 4a8eb6d9..de19d89f 100644 --- a/project/pingchang/apps/AppOrganizationChange/components/detailPanel.vue +++ b/project/pingchang/apps/AppOrganizationChange/components/detailPanel.vue @@ -1,35 +1,37 @@ - - 本届任职{{editable?"(必填)":""}} - 添加任职人员 - - + + + 添加任职人员 + + + - + - - + 编辑 + 删除 - - 本届候选人 - 添加候选人 - - + + + 添加候选人 + + + - + - - + 编辑 + 删除 - + @@ -42,149 +44,114 @@ 输入候选人姓名,用空格隔开 - - - + diff --git a/project/pingchang/apps/AppOrganizationChange/components/history.vue b/project/pingchang/apps/AppOrganizationChange/components/history.vue index 847a982b..20f9dd48 100644 --- a/project/pingchang/apps/AppOrganizationChange/components/history.vue +++ b/project/pingchang/apps/AppOrganizationChange/components/history.vue @@ -3,7 +3,7 @@ - 补录 + 补录 v.$attrs.selected.id }, + watch: { + oid: { + immediate: true, + handler() { + this.getList() + } + } + }, methods: { handleEdit(id) { this.$router.push({hash: "#makeup", query: {id}}) @@ -67,7 +75,7 @@ export default { }, getList() { const {oid: organizationId} = this - this.instance.post("/app/apporganizationgeneralelection/list", null, { + organizationId && this.instance.post("/app/apporganizationgeneralelection/list", null, { params: {...this.search, organizationId} }).then(res => { if (res?.data) { @@ -76,9 +84,6 @@ export default { }) } }, - created() { - this.getList() - }, } diff --git a/project/pingchang/apps/AppOrganizationChange/components/moment.vue b/project/pingchang/apps/AppOrganizationChange/components/moment.vue index 8f6dfb30..dd64c15b 100644 --- a/project/pingchang/apps/AppOrganizationChange/components/moment.vue +++ b/project/pingchang/apps/AppOrganizationChange/components/moment.vue @@ -1,90 +1,31 @@ - - - 修改 - - + - - - 添加任职人员 - - - - - - 编辑 - 删除 - - - - - - 添加候选人 - - - - - - 编辑 - 删除 - - - + - + 暂无换届信息 - + + 开始设置 - - - - - - - - - - - - - - - - - - - - diff --git a/project/pingchang/apps/AppOrganizationChange/components/organizationSetting.vue b/project/pingchang/apps/AppOrganizationChange/components/organizationSetting.vue index 6849e716..4dba4e4c 100644 --- a/project/pingchang/apps/AppOrganizationChange/components/organizationSetting.vue +++ b/project/pingchang/apps/AppOrganizationChange/components/organizationSetting.vue @@ -1,10 +1,10 @@ - + - + @@ -27,17 +27,21 @@ - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -59,28 +63,22 @@ export default { components: {DetailPanel}, inject: ['permissions', 'instance', 'dict'], data() { - let validUser = (rule, value, callback) => { - if (!value.length) { - return callback(new Error('请选择换届提醒人')); - } else { - callback(); - } - }; return { form: { type: "", userList: [], sessionTime: "", changeTime: "", - nextChangeTime: "" - }, - lists: { - candidateList: [], //本届候选人 - serveList: [] //本届任职 + nextChangeTime: "", + serveList: [], + candidateList: [] }, formRules: { - type: [{required: true, message: "请选择选举方式", trigger: "blur"}], - userList: [{required: true, validator: validUser, trigger: "blur"}], + type: [{required: true, message: "请选择换届类型", trigger: "change"}], + sessionTime: [{required: true, message: "请输入届次", trigger: "change"}], + userList: [{required: true, message: "请选择换届提醒人", trigger: "change"}], + changeTime: [{required: true, message: "请选择本次换届时间", trigger: "change"}], + nextChangeTime: [{required: true, message: "请选择下次换届时间", trigger: "change"}] }, chooseUserList: [], org: null @@ -88,26 +86,47 @@ export default { }, computed: { ...mapState(['user']), - isInit: v => !!v.form.id, - isNew: v => v.$route.query.new + isMakeUp: v => v.$route.hash == "#makeup", + pageTitle: v => v.isMakeUp ? "补录换届" : "换届设置" + }, + watch: { + 'form.type'() { + this.getNextChangeTime() + } }, created() { this.org = new this.MODEL.PartyOrg(this.$route.query.oid) - !this.isNew && this.getDetail() + !!this.$route.query.id ? this.getSession() : this.getDetail() }, methods: { cancel() { this.$router.back() }, + getNextChangeTime() { + const {type, changeTime} = this.form, sessionPeriod = {0: 3, 1: 5}[type] + this.form.nextChangeTime = type && changeTime ? this.$dateFormat(this.$moment(changeTime).add(sessionPeriod, "years")) : "" + }, + getSession() { + //根据id获取对应届次信息 + const {id} = this.$route.query + this.instance.post(`/app/apporganizationchangeconfig/queryDetailById`, null, { + pureBack: true, + params: {id} + }).then((res) => { + if (res?.data) { + this.form = res.data + } + }) + }, getDetail() { + //获取到当前届次信息 const {oid: organizationId} = this.$route.query this.instance.post(`/app/apporganizationchangeconfig/queryDetailByOrganizationId`, null, { + pureBack: true, params: {organizationId} }).then((res) => { if (res?.data) { this.form = res.data - let {candidateList, serveList} = this.form - this.lists = {candidateList, serveList} } }) }, @@ -122,10 +141,13 @@ export default { this.$refs.SettingForm.validate(v => { if (v) { const {id: organizationId, name: organizationName} = this.org - const action = `/app/apporganizationchangeconfig/${this.isInit ? 'update' : 'add'}` + if (this.isMakeUp && !this.$route.query.id) { + delete this.form.id + } + const action = `/app/apporganizationchangeconfig/${!!this.form.id ? 'update' : 'add'}` + const addOrMakeup = !this.isMakeUp this.instance.post(action, { - addOrMakeup: true, - ...this.form, organizationId, organizationName + ...this.form, organizationId, organizationName, addOrMakeup }).then(res => { if (res.code == 0) { this.$message.success('提交成功') @@ -143,8 +165,8 @@ export default { .organizationSetting { height: 100%; - ::v-deep .el-date-editor .el-input { - width: 100%; + .el-date-editor, .el-input { + width: 100% !important; } .tips {