mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-24 05:46:03 +08:00
优化代码
This commit is contained in:
parent
f5a205de49
commit
a7cefc8051
@ -28,12 +28,12 @@
|
||||
_initEvent: function () {
|
||||
//切换 至费用页面
|
||||
vc.on('simplifyContract', 'switch', function (_param) {
|
||||
if (_param.roomId == '') {
|
||||
if (_param.ownerId == '') {
|
||||
return;
|
||||
}
|
||||
$that.clearContractInfoInfo();
|
||||
vc.copyObject(_param, $that.simplifyRoomFeeInfo);
|
||||
$that.contractInfo.conditions.objId = _param.roomId;
|
||||
$that.contractInfo.conditions.objId = _param.ownerId;
|
||||
$that._listContractInfo(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||
});
|
||||
|
||||
@ -79,7 +79,7 @@
|
||||
window.open("/print.html#/pages/admin/printContract?contractTypeId=" + _contract.contractType + "&contractId=" + _contract.contractId);
|
||||
},
|
||||
_viewContract: function (_contract) {
|
||||
//vc.jumpToPage("/admin.html#/pages/admin/contractDetailView?contractId=" + _contract.contractId);
|
||||
vc.jumpToPage("/admin.html#/pages/common/contractApplyDetail?contractId="+_contract.contractId);
|
||||
},
|
||||
clearContractInfoInfo: function () {
|
||||
$that.contractInfo = {
|
||||
|
||||
@ -223,7 +223,33 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-10">
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">合同附件</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="row " style="margin-left: 0px;">
|
||||
<button type="button" class="btn btn-primary" @click="addFileStep()">添加附件</button>
|
||||
</div>
|
||||
<div v-for="(item,index) in addContractInfo.contractFilePo">
|
||||
<div class="row margin-0 margin-top">
|
||||
<div class="col-sm-1 text-center">
|
||||
<label class="col-form-label">第{{index+1}}个</label>
|
||||
</div>
|
||||
<input type="file" class="custom-file-input form-control" name="excelTemplate"
|
||||
style="width: 11%;opacity: 1;" v-on:change="getFile($event,index)" accept=".png,.pdf,.jpg">
|
||||
<label class="col-sm-5 col-form-label padding-lr-sm text-right">{{item.fileRealName}}</label>
|
||||
<div>
|
||||
<button type="button" class="btn btn-link" @click="deleteStep(item)">删除附件</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@ -295,6 +321,7 @@
|
||||
class="fa fa-check"></i> 提交</button>
|
||||
</div>
|
||||
</div>
|
||||
<vc:create path="property/searchRoom" emitChooseRoom="addContract" emitLoadData="addContract" roomFlag=""></vc:create>
|
||||
<vc:create path="property/searchRoom" emitChooseRoom="addContract" emitLoadData="addContract" roomFlag="">
|
||||
</vc:create>
|
||||
<vc:create path="property/searchOwner" emitChooseOwner="addContract" emitLoadData="addContract"></vc:create>
|
||||
</div>
|
||||
@ -422,27 +422,29 @@
|
||||
$that.addContractInfo.contractFilePo.push(_file);
|
||||
},
|
||||
|
||||
|
||||
|
||||
deleteStep: function (_step) {
|
||||
for (var i = 0; i < $that.addContractInfo.contractFilePo.length; i++) {
|
||||
if ($that.addContractInfo.contractFilePo[i].seq == _step.seq) {
|
||||
|
||||
|
||||
$that.addContractInfo.contractFilePo.splice(i, 1);
|
||||
}
|
||||
}
|
||||
},
|
||||
getFile: function (e, index) {
|
||||
getFile: function (e,index) {
|
||||
vc.component.addContractInfo.tempfile = e.target.files[0];
|
||||
$that.addContractInfo.contractFilePo[index].fileRealName = vc.component.addContractInfo.tempfile.name;
|
||||
this._importData(index);
|
||||
},
|
||||
_importData: function (index) {
|
||||
// 导入数据
|
||||
if (!vc.component.checkFileType(vc.component.addContractInfo.tempfile.name.split('.')[1])) {
|
||||
let _fileName = vc.component.addContractInfo.tempfile.name;
|
||||
let _suffix = _fileName.substring(_fileName.lastIndexOf('.') + 1);
|
||||
if (!vc.component.checkFileType(_suffix.toLowerCase())) {
|
||||
vc.toast('操作失败,请上传图片、PDF格式的文件');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var param = new FormData();
|
||||
param.append("uploadFile", vc.component.addContractInfo.tempfile);
|
||||
vc.http.upload(
|
||||
@ -471,7 +473,7 @@
|
||||
});
|
||||
},
|
||||
checkFileType: function (fileType) {
|
||||
const acceptTypes = ['png', 'pdf', 'jpg'];
|
||||
const acceptTypes = ['png','pdf','jpg'];
|
||||
for (var i = 0; i < acceptTypes.length; i++) {
|
||||
if (fileType === acceptTypes[i]) {
|
||||
return true;
|
||||
|
||||
@ -148,6 +148,11 @@
|
||||
<a class="nav-link" v-bind:class="{active:simplifyAcceptanceInfo._currentTab == 'simplifyCarFee'}"
|
||||
v-on:click="changeTab('simplifyCarFee')">停车费用</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link"
|
||||
v-bind:class="{active:simplifyAcceptanceInfo._currentTab == 'simplifyContract'}"
|
||||
v-on:click="changeTab('simplifyContract')">业主合同</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link"
|
||||
v-bind:class="{active:simplifyAcceptanceInfo._currentTab == 'simplifyOwnerMember'}"
|
||||
@ -187,11 +192,7 @@
|
||||
v-bind:class="{active:simplifyAcceptanceInfo._currentTab == 'simplifyShopsHireLog'}"
|
||||
v-on:click="changeTab('simplifyShopsHireLog')">房屋绑定记录</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link"
|
||||
v-bind:class="{active:simplifyAcceptanceInfo._currentTab == 'simplifyContract'}"
|
||||
v-on:click="changeTab('simplifyContract')">业主合同</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user