| | |
| | | <u-select v-model="typeShow" mode="single-column" :list="typeList" @confirm="typeConfirm"> |
| | | </u-select> |
| | | </u-form-item> |
| | | |
| | | <u-form-item label-position='top' prop="content" label="汇报内容" :required="true"> |
| | | <u-input type='textarea' v-model="form.content" placeholder="请输入汇报内容" /> |
| | | </u-form-item> |
| | | <u-form-item label-position='top' prop="typeText" label="接收人" :required="true"> |
| | | <u-input v-model="form.typeText" type="select" placeholder="请选择接收人" :border="false" |
| | | |
| | | <u-form-item label-position='top' prop="recipientText" label="接收人" :required="true"> |
| | | |
| | | <u-input v-model="form.recipientText" type="select" placeholder="请选择接收人" :border="false" |
| | | @click="recipientClick" /> |
| | | <u-select v-model="recipientShow" mode="single-column" :list="typeList" @confirm="typeConfirm"> |
| | | <u-select v-model="recipientShow" mode="mutil-column-auto" :list="recipientList" |
| | | @confirm="recipientConfirm"> |
| | | </u-select> |
| | | |
| | | </u-form-item> |
| | | |
| | | </u-form> |
| | |
| | | label: '月报' |
| | | } |
| | | ], |
| | | recipientList: [], |
| | | |
| | | form: { |
| | | content: '', |
| | | category: '', |
| | | type: '', |
| | | recipient: '', |
| | | categoryText: '', |
| | | typeText: '' |
| | | typeText: '', |
| | | recipientText: '' |
| | | }, |
| | | rules: { |
| | | categoryText: [{ |
| | |
| | | required: true, |
| | | message: '汇报内容不能少于5个字', |
| | | trigger: ['change', 'blur'], |
| | | }] |
| | | }], |
| | | recipientText: [{ |
| | | required: true, |
| | | message: '请选择接收人', |
| | | trigger: ['change', 'blur'], |
| | | }], |
| | | } |
| | | }; |
| | | }, |
| | |
| | | this.categoryShow = true; |
| | | }, |
| | | typeClick() { |
| | | |
| | | this.typeShow = true; |
| | | |
| | | }, |
| | | recipientClick() { |
| | | if (this.form.category == '') { |
| | |
| | | }); |
| | | return; |
| | | } else { |
| | | this.recipientShow = true; |
| | | uni.request({ |
| | | url: this.$store.state.piAPI + "/blade-system/dept/lazy-tree-user-app?type=" + this.form |
| | | .category, |
| | | method: "get", |
| | | data: { |
| | | |
| | | }, |
| | | success: (res) => { |
| | | this.recipientList = [] |
| | | res.data.forEach(item => { |
| | | if (item.hasChildren) { |
| | | this.recipientList.push(item) |
| | | } |
| | | }) |
| | | this.recipientShow = true; |
| | | } |
| | | }); |
| | | |
| | | } |
| | | }, |
| | | categoryConfirm(e) { |
| | | if (this.form.categoryText != e[0].label) { |
| | | this.form.recipient = '' |
| | | this.form.recipientText = '' |
| | | } |
| | | |
| | | this.form.category = e[0].value |
| | | this.form.categoryText = e[0].label |
| | | |
| | | }, |
| | | typeConfirm(e) { |
| | | this.form.type = e[0].value |
| | | this.form.typeText = e[0].label |
| | | }, |
| | | recipientConfirm(e) { |
| | | if (e.length > 1) { |
| | | this.form.recipient = e[1].value |
| | | this.form.recipientText = e[1].label |
| | | } else { |
| | | this.form.recipient = e[0].value |
| | | this.form.recipientText = e[0].label |
| | | } |
| | | |
| | | }, |
| | | initiateClick() { |
| | | this.$refs.uForm.validate(valid => { |
| | | if (valid) { |
| | | uni.request({ |
| | | url: this.$store.state.piAPI + "/workReport/submit?deptId=" + this.$store.state |
| | | .UserData.dept_id + '&userId=' + this.$store.state.puserID, |
| | | url: this.$store.state.piAPI + "/workReport/submit", |
| | | method: "post", |
| | | data: { |
| | | type: this.form.type, |
| | |
| | | content: this.form.content, |
| | | userId: this.$store.state.puserID, |
| | | deptId: this.$store.state.UserData.dept_id, |
| | | receivedIds: "1416717479708815362" |
| | | receivedIds: this.form.recipient |
| | | }, |
| | | success: (res) => { |
| | | if (res.data.msg == "操作成功") { |