| | |
| | | data: { |
| | | addContractInfo: { |
| | | communityId: vc.getCurrentCommunity().communityId, |
| | | communities: [], |
| | | contractId: '', |
| | | contractName: '', |
| | | contractCode: '', |
| | |
| | | }, |
| | | _initMethod: function () { |
| | | vc.component._initAddContractInfo(); |
| | | $that._loadCommunities(); |
| | | $that._loadAddContractType(); |
| | | $that._loadAddContractParkA(); |
| | | $that._loadAddContractParkB(); |
| | |
| | | param: "", |
| | | errInfo: "合同签订时间不能为空" |
| | | } |
| | | ], |
| | | 'addContractInfo.communityId': [ |
| | | { |
| | | limit: "required", |
| | | param: "", |
| | | errInfo: "请选择所属小区" |
| | | } |
| | | ] |
| | | }); |
| | | }, |
| | |
| | | vc.toast(vc.validate.errInfo); |
| | | return; |
| | | } |
| | | $that.addContractInfo.communityId = vc.getCurrentCommunity().communityId; |
| | | // 使用下拉框选中的communityId传递给接口 |
| | | // addContractInfo.communityId 已通过 v-model 绑定,包含用户选择的值 |
| | | |
| | | vc.http.apiPost( |
| | | '/contract/saveContract', |
| | |
| | | staffName: '', |
| | | nextUserId: '' |
| | | }; |
| | | }, |
| | | _loadCommunities: function () { |
| | | let param = { |
| | | params: { |
| | | page: 1, |
| | | row: 100 |
| | | } |
| | | }; |
| | | //发送get请求 |
| | | vc.http.apiGet('/community.listCommunitys', |
| | | param, |
| | | function (json, res) { |
| | | let _communityInfo = JSON.parse(json); |
| | | if (_communityInfo.code == 0) { |
| | | $that.addContractInfo.communities = _communityInfo.communitys || []; |
| | | } |
| | | }, |
| | | function (errInfo, error) { |
| | | console.log('请求失败处理'); |
| | | } |
| | | ); |
| | | }, |
| | | _loadAddContractType: function () { |
| | | let param = { |
| | |
| | | } |
| | | ); |
| | | }, |
| | | _changeCommunity: function () { |
| | | // 小区变更时的处理逻辑 |
| | | }, |
| | | _goBack: function () { |
| | | vc.goBack(); |
| | | }, |