四邻
This commit is contained in:
		| @@ -3,13 +3,13 @@ | ||||
|  | ||||
|     <div class="item"> | ||||
|       <div><span>*</span>四邻对象</div> | ||||
|       <AiSelect class="right" v-model="form.type" dict="agriculturalType"/> | ||||
|       <AiSelect class="right" v-model="form.id" :list="userList"/> | ||||
|     </div> | ||||
|  | ||||
|     <div class="item"> | ||||
|       <div><span>*</span>事件日期</div> | ||||
|       <div @click="isShowDate = true"> | ||||
|         <span v-if="form.checkTime" >{{ form.checkTime }}</span> | ||||
|         <span v-if="form.linksageDate" >{{ form.linksageDate }}</span> | ||||
|         <span v-else style="color: #999;">请选择</span> | ||||
|         <u-icon name="arrow-right" color="#ddd"/> | ||||
|       </div> | ||||
| @@ -19,9 +19,9 @@ | ||||
|     <div> | ||||
|       <div class="title"><span style="color: #FF4466">*</span>事件描述</div> | ||||
|       <div> | ||||
|         <u-input type="textarea" v-model="form.name" placeholder="请输入事件内容描述" height="200" maxlength="500"/> | ||||
|         <u-input type="textarea" v-model="form.description" placeholder="请输入事件内容描述" height="200" maxlength="500"/> | ||||
|       </div> | ||||
|       <div class="tips">{{form.name.length}}/500</div> | ||||
|       <div class="tips">{{form.description.length}}/500</div> | ||||
|     </div> | ||||
|  | ||||
|     <div class="btn"> | ||||
| @@ -44,37 +44,55 @@ export default { | ||||
|       }, | ||||
|       isShowDate: false, | ||||
|       form: { | ||||
|         type: '', | ||||
|         checkTime: '', | ||||
|         name: '', | ||||
|         partyId: '' | ||||
|         id: '', | ||||
|         linksageDate: '', | ||||
|         description: '', | ||||
|       }, | ||||
|       userList: [] | ||||
|     } | ||||
|   }, | ||||
|   onShow() { | ||||
|     this.$dict.load('agriculturalType') | ||||
|     this.getFourResident() | ||||
|     this.getUserList() | ||||
|   }, | ||||
|   methods: { | ||||
|     onDateChange(e) { | ||||
|       this.form.checkTime = `${e.year}-${e.month}-${e.day}` | ||||
|       this.form.linksageDate = `${e.year}-${e.month}-${e.day}` | ||||
|     }, | ||||
|     getFourResident() { | ||||
|       this.$instance.post('/app/apppartyfourresident/listFourResident', null, { | ||||
|         params: { | ||||
|           size: 10, | ||||
|           partyId: this.form.partyId, | ||||
|         }, | ||||
|       }).then((res) => { | ||||
|         if (res.code == 0) { | ||||
|           this.userList = res.data.records | ||||
|     getUserList() { | ||||
|       this.$instance.post('/app/apppartyfourresident/listFourResidentByApplet').then((res) => { | ||||
|         if(res?.data) { | ||||
|           res.data.map((item) => { | ||||
|             this.userList.push({ | ||||
|               label: item.name, | ||||
|               value: item.id, | ||||
|             }) | ||||
|           }) | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     confirm() { | ||||
|       if(!this.form.checkTime) | ||||
|       this.$instance.post('/app/apppartyfourlinkage/addOrUpdate') | ||||
|       if(!this.form.id) { | ||||
|         return this.$u.toast('请选择四邻对象') | ||||
|       } | ||||
|       if(!this.form.linksageDate) { | ||||
|         return this.$u.toast('请选择事件日期') | ||||
|       } | ||||
|       if(!this.form.description) { | ||||
|         return this.$u.toast('请输入事件描述') | ||||
|       } | ||||
|  | ||||
|       this.$instance.post('/app/apppartyfourlinkage/addOrUpdate',{ | ||||
|         ...this.form | ||||
|       }).then(res => { | ||||
|         if(res.code == 0) { | ||||
|           this.$u.toast('添加联动记录成功') | ||||
|           uni.$emit('update') | ||||
|           setTimeout(() => { | ||||
|             uni.navigateBack() | ||||
|           },600) | ||||
|         } | ||||
|       }) | ||||
|     } | ||||
|  | ||||
|   } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user