| | |
| | | vc.extends({ |
| | | data: { |
| | | addContractInfo: { |
| | | communityId: vc.getCurrentCommunity().communityId, |
| | | communities: [], |
| | | contractId: '', |
| | | contractName: '', |
| | | contractCode: '', |
| | | contractType: '', |
| | | aPartyaId: '', |
| | | bPartyaId: '', |
| | | cPartyaId: '', |
| | | partyA: '', |
| | | partyB: '', |
| | | partyC: '', |
| | | aContacts: '', |
| | | bContacts: '', |
| | | cContacts: '', |
| | | aLink: '', |
| | | bLink: '', |
| | | cLink: '', |
| | | operator: '', |
| | | operatorLink: '', |
| | | allNum: '', |
| | |
| | | contractFilePo: [], |
| | | tempfile: '', |
| | | contractPartyAs: [], |
| | | contractPartyBs: [], |
| | | contractPartyCs: [], |
| | | audit: '', |
| | | staffName: '', |
| | | nextUserId: '' |
| | |
| | | }, |
| | | _initMethod: function () { |
| | | vc.component._initAddContractInfo(); |
| | | $that._loadCommunities(); |
| | | $that._loadAddContractType(); |
| | | $that._loadAddContractParkA(); |
| | | $that._loadAddContractParkB(); |
| | | $that._loadAddContractParkC(); |
| | | if (vc.getParam("contractId")) { |
| | | $that.addContractInfo.contractParentId = vc.getParam("contractId"); |
| | | $that.addContractInfo.parentContractCode = vc.getParam("contractCode"); |
| | |
| | | event.target.value = formattedAmount; |
| | | }, |
| | | _initAddContractInfo: function () { |
| | | $that.addContractInfo.signingTime = vc.dateTimeFormat(new Date().getTime()); |
| | | // $that.addContractInfo.signingTime = vc.dateTimeFormat(new Date().getTime()); |
| | | $that.addContractInfo.signingTime = vc.dateFormat(new Date(), "yyyy-MM-dd"); |
| | | $('.addStartTime').datetimepicker({ |
| | | language: 'zh-CN', |
| | | fontAwesome: 'fa', |
| | |
| | | $('.addSigningTime').datetimepicker({ |
| | | language: 'zh-CN', |
| | | fontAwesome: 'fa', |
| | | format: 'yyyy-mm-dd hh:ii:ss', |
| | | format: 'yyyy-mm-dd', |
| | | minView: "month", |
| | | startView: "month", |
| | | initTime: true, |
| | | initialDate: new Date(), |
| | | autoClose: 1, |
| | |
| | | $('.addSigningTime').datetimepicker() |
| | | .on('changeDate', function (ev) { |
| | | var value = $(".addSigningTime").val(); |
| | | vc.component.addContractInfo.signingTime = value; |
| | | vc.component.addContractInfo.signingTime = value.split(' ')[0]; |
| | | }); |
| | | //防止多次点击时间插件失去焦点 |
| | | document.getElementsByClassName('form-control addStartTime')[0].addEventListener('click', myfunc) |
| | |
| | | errInfo: "乙方名称太长" |
| | | }, |
| | | ], |
| | | 'addContractInfo.aContacts': [ |
| | | { |
| | | limit: "required", |
| | | param: "", |
| | | errInfo: "甲方联系人不能为空" |
| | | }, |
| | | { |
| | | limit: "maxLength", |
| | | param: "64", |
| | | errInfo: "甲方联系人长度超过64位" |
| | | }, |
| | | ], |
| | | 'addContractInfo.bContacts': [ |
| | | { |
| | | limit: "required", |
| | | param: "", |
| | | errInfo: "乙方联系人不能为空" |
| | | }, |
| | | { |
| | | limit: "maxLength", |
| | | param: "64", |
| | | errInfo: "乙方联系人长度超过64位" |
| | | }, |
| | | ], |
| | | 'addContractInfo.aLink': [ |
| | | { |
| | | limit: "required", |
| | | param: "", |
| | | errInfo: "甲方联系电话不能为空" |
| | | } |
| | | ], |
| | | 'addContractInfo.bLink': [ |
| | | { |
| | | limit: "required", |
| | | param: "", |
| | | errInfo: "乙方联系电话不能为空" |
| | | } |
| | | ], |
| | | // 'addContractInfo.aContacts': [ |
| | | // { |
| | | // limit: "required", |
| | | // param: "", |
| | | // errInfo: "甲方联系人不能为空" |
| | | // }, |
| | | // { |
| | | // limit: "maxLength", |
| | | // param: "64", |
| | | // errInfo: "甲方联系人长度超过64位" |
| | | // }, |
| | | // ], |
| | | // 'addContractInfo.bContacts': [ |
| | | // { |
| | | // limit: "required", |
| | | // param: "", |
| | | // errInfo: "乙方联系人不能为空" |
| | | // }, |
| | | // { |
| | | // limit: "maxLength", |
| | | // param: "64", |
| | | // errInfo: "乙方联系人长度超过64位" |
| | | // }, |
| | | // ], |
| | | // 'addContractInfo.aLink': [ |
| | | // { |
| | | // limit: "required", |
| | | // param: "", |
| | | // errInfo: "甲方联系电话不能为空" |
| | | // } |
| | | // ], |
| | | // 'addContractInfo.bLink': [ |
| | | // { |
| | | // limit: "required", |
| | | // param: "", |
| | | // errInfo: "乙方联系电话不能为空" |
| | | // } |
| | | // ], |
| | | 'addContractInfo.operator': [ |
| | | { |
| | | limit: "required", |
| | |
| | | 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', |
| | | JSON.stringify($that.addContractInfo), { |
| | |
| | | clearAddContractInfo: function () { |
| | | let _contractTypes = $that.addContractInfo.contractTypes; |
| | | $that.addContractInfo = { |
| | | communityId: vc.getCurrentCommunity().communityId, |
| | | contractName: '', |
| | | contractCode: '', |
| | | contractType: '', |
| | | aPartyaId: '', |
| | | bPartyaId: '', |
| | | cPartyaId: '', |
| | | partyA: '', |
| | | partyB: '', |
| | | partyC: '', |
| | | aContacts: '', |
| | | bContacts: '', |
| | | cContacts: '', |
| | | aLink: '', |
| | | bLink: '', |
| | | cLink: '', |
| | | operator: '', |
| | | operatorLink: '', |
| | | amount: '', |
| | | startTime: '', |
| | | endTime: '', |
| | | signingTime: '', |
| | | signingTime: vc.dateFormat(new Date(), "yyyy-MM-dd"), |
| | | propertyCompany: '', // 物业公司名称(新增) |
| | | contractTerm: '', // 合同年限(新增) |
| | | isArchived: '', // 是否存档(新增) |
| | | contractReminderDate: '', // 合同提醒日期(新增) |
| | | signatoryAddress: '', // 签约方详细地址(新增) |
| | | contactEmail: '', // 签约方联系邮箱(新增) |
| | | contactWechat: '', // 签约方联系微信(新增) |
| | | remarks: '', // 合同备注信息(新增) |
| | | contractTypes: _contractTypes, |
| | | contractTypeSpecs: [], |
| | | allNum: '', |
| | |
| | | objPersonName: '', |
| | | objPersonId: '', |
| | | rooms: [], |
| | | contractFilePo: [], |
| | | tempfile: '', |
| | | contractPartyAs: [], |
| | | contractPartyBs: [], |
| | | contractPartyCs: [], |
| | | audit: '', |
| | | staffName: '', |
| | | nextUserId: '' |
| | | }; |
| | | }, |
| | | _loadAddContractType: function () { |
| | | _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 = { |
| | | params: { |
| | | page: 1, |
| | | row: 100, |
| | | communityId: vc.getCurrentCommunity().communityId, |
| | | |
| | | } |
| | | } |
| | | //发送get请求 |
| | |
| | | let param = { |
| | | params: { |
| | | page: 1, |
| | | row: 100 |
| | | row: 100, |
| | | typeId: 1, |
| | | communityId: vc.getCurrentCommunity().communityId, |
| | | |
| | | } |
| | | } |
| | | //发送get请求 |
| | |
| | | function (json, res) { |
| | | var _contractTypeManageInfo = JSON.parse(json); |
| | | $that.addContractInfo.contractPartyAs = _contractTypeManageInfo.data; |
| | | }, |
| | | function (errInfo, error) { |
| | | console.log('请求失败处理'); |
| | | } |
| | | ); |
| | | }, |
| | | _loadAddContractParkB: function () { |
| | | let param = { |
| | | params: { |
| | | page: 1, |
| | | row: 100, |
| | | typeId: 2, |
| | | communityId: vc.getCurrentCommunity().communityId, |
| | | |
| | | |
| | | } |
| | | } |
| | | //发送get请求 |
| | | vc.http.apiGet('/contractPartya/queryContractPartya', |
| | | param, |
| | | function (json, res) { |
| | | var _contractTypeManageInfo = JSON.parse(json); |
| | | $that.addContractInfo.contractPartyBs = _contractTypeManageInfo.data; |
| | | }, |
| | | function (errInfo, error) { |
| | | console.log('请求失败处理'); |
| | | } |
| | | ); |
| | | }, |
| | | _loadAddContractParkC: function () { |
| | | let param = { |
| | | params: { |
| | | page: 1, |
| | | row: 100, |
| | | typeId: 3, |
| | | communityId: vc.getCurrentCommunity().communityId, |
| | | |
| | | |
| | | } |
| | | } |
| | | //发送get请求 |
| | | vc.http.apiGet('/contractPartya/queryContractPartya', |
| | | param, |
| | | function (json, res) { |
| | | var _contractTypeManageInfo = JSON.parse(json); |
| | | $that.addContractInfo.contractPartyCs = _contractTypeManageInfo.data; |
| | | }, |
| | | function (errInfo, error) { |
| | | console.log('请求失败处理'); |
| | |
| | | params: { |
| | | page: 1, |
| | | row: 100, |
| | | contractTypeId: $that.addContractInfo.contractType |
| | | contractTypeId: $that.addContractInfo.contractType, |
| | | communityId: vc.getCurrentCommunity().communityId, |
| | | |
| | | } |
| | | } |
| | | $that.addContractInfo.contractTypeSpecs = []; |
| | |
| | | console.log('请求失败处理'); |
| | | } |
| | | ); |
| | | }, |
| | | _changeCommunity: function () { |
| | | // 小区变更时的处理逻辑 |
| | | }, |
| | | _goBack: function () { |
| | | vc.goBack(); |
| | |
| | | $that.addContractInfo.contractPartyAs.forEach(item => { |
| | | if (_partyA == item.partyA) { |
| | | $that.addContractInfo.aLink = item.aLink; |
| | | $that.addContractInfo.aPartyaId = item.partyaId; |
| | | $that.addContractInfo.aContacts = item.aContacts; |
| | | } |
| | | }) |
| | | }, |
| | | _changeContractPartyB: function () { |
| | | let _partyB = $that.addContractInfo.partyB; |
| | | $that.addContractInfo.contractPartyBs.forEach(item => { |
| | | if (_partyB == item.partyA) { |
| | | $that.addContractInfo.bLink = item.aLink; |
| | | $that.addContractInfo.bPartyaId = item.partyaId; |
| | | $that.addContractInfo.bContacts = item.aContacts; |
| | | } |
| | | }) |
| | | }, |
| | | _changeContractPartyC: function() { |
| | | let _partyC = $that.addContractInfo.partyC; |
| | | $that.addContractInfo.contractPartyCs.forEach(item => { |
| | | if (_partyC == item.partyA) { |
| | | $that.addContractInfo.cLink = item.aLink; |
| | | $that.addContractInfo.cPartyaId = item.partyaId; |
| | | $that.addContractInfo.cContacts = item.aContacts; |
| | | } |
| | | }); |
| | | }, |
| | | _searchOwner: function () { |
| | | vc.emit('searchOwner', 'openSearchOwnerModel', {}); |
| | | }, |