【update】 起草组报名

This commit is contained in:
danshihao
2024-01-15 17:00:02 +08:00
parent d2a8498a27
commit b181a9ea2a
5 changed files with 21 additions and 9 deletions
+13 -5
View File
@@ -83,8 +83,17 @@ Page({
},
// 提交
formSubmit(e) {
// 企业联系人1必填
if (!this.data.personList[0].contactsId) {
wx.showToast({
title: '请选择企业联系人1',
icon: 'none',
duration: 2000
})
return
}
// 企业联系人不能重复
const personIds = this.data.personList.map(item => item.contactsId)
const personIds = this.data.personList.filter(item => item.contactsId).map(item => item.contactsId)
if (Array.from(new Set(personIds)).length !== personIds.length) {
wx.showToast({
title: '请选择不同的联系人',
@@ -105,7 +114,7 @@ Page({
// 工作组
case 'work':
// 联络人列表
params.payWorkingGroupSubItemContactsList = this.data.personList
params.payWorkingGroupSubItemContactsList = this.data.personList.filter(item => item.contactsId)
UserApi.editWorkContactsInfo(params).then(res => {
if (res.success) {
wx.showToast({
@@ -134,7 +143,7 @@ Page({
// 起草组
case 'draft':
// 联络人列表
params.payDraftingGroupSubItemContactsList = this.data.personList
params.payDraftingGroupSubItemContactsList = this.data.personList.filter(item => item.contactsId)
UserApi.editDraftContactsInfo(params).then(res => {
if (res.success) {
wx.showToast({
@@ -161,7 +170,6 @@ Page({
})
break
}
UserApi.editWorkContactsInfo
},
goBack(){
wx.navigateBack()
@@ -254,7 +262,7 @@ Page({
/**
* 声明周期函数--监听页面显示
*/
onShow: function () {
onShow: function () {
console.log('选择的用户', this.data.selectedPersonIndex, this.data.selectedPerson);
if (this.data.selectedPersonIndex !== null && this.data.selectedPersonIndex !== undefined) {
const { id, name } = this.data.selectedPerson || {}
+1 -1
View File
@@ -51,7 +51,7 @@
<!-- 备注 -->
<view class="form-item textarea">
<text class="item-label validate">备注</text>
<text class="item-label">备注</text>
<textarea placeholder="请输入备注" name="remarks" value="{{model.remarks}}" maxlength="200" />
</view>