mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-24 21:59:12 +08:00
优化代码
This commit is contained in:
parent
7063792292
commit
002fa05252
@ -130,7 +130,7 @@
|
||||
<label class="col-sm-3 col-form-label padding-lr-sm text-right">开始时间</label>
|
||||
<div class="col-sm-9 padding-lr-xs">
|
||||
<input v-model="addContractInfo.startTime" type="text" placeholder="必填,请填写开始时间"
|
||||
class="form-control">
|
||||
class="form-control addStartTime">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -139,7 +139,7 @@
|
||||
<label class="col-sm-3 col-form-label padding-lr-sm text-right">结束时间</label>
|
||||
<div class="col-sm-9 padding-lr-xs">
|
||||
<input v-model="addContractInfo.endTime" type="text" placeholder="必填,请填写结束时间"
|
||||
class="form-control">
|
||||
class="form-control addEndTime">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -148,7 +148,7 @@
|
||||
<label class="col-sm-3 col-form-label padding-lr-sm text-right">签订时间</label>
|
||||
<div class="col-sm-9 padding-lr-xs">
|
||||
<input v-model="addContractInfo.signingTime" type="text" placeholder="必填,请填写签订时间"
|
||||
class="form-control">
|
||||
class="form-control addSigningTime">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -29,6 +29,18 @@
|
||||
},
|
||||
_initMethod: function () {
|
||||
$that._loadAddContractType();
|
||||
|
||||
vc.initDateTime('addStartTime',function(_value){
|
||||
$that.addContractInfo.startTime = _value;
|
||||
});
|
||||
vc.initDateTime('addEndTime',function(_value){
|
||||
$that.addContractInfo.endTime = _value;
|
||||
});
|
||||
|
||||
vc.initDateTime('addSigningTime',function(_value){
|
||||
$that.addContractInfo.signingTime = _value;
|
||||
});
|
||||
|
||||
},
|
||||
_initEvent: function () {
|
||||
vc.on('addContract', 'openAddContractModal', function () {
|
||||
|
||||
@ -1,113 +1,201 @@
|
||||
<div id = "editContractModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" >
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<h3 class="m-t-none m-b ">修改合同信息</h3>
|
||||
<div class="ibox-content">
|
||||
<div>
|
||||
<div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">合同名称</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="editContractInfo.contractName" type="text" placeholder="必填,请填写合同名称" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">合同编号</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="editContractInfo.contractCode" type="text" placeholder="必填,请填写合同编号" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">合同类型</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="custom-select" v-model="editContractInfo.contractType">
|
||||
<option selected disabled value="">必填,请选择合同类型</option>
|
||||
<option value="10001">小区文化</option>
|
||||
<option value="10002">其他</option>
|
||||
</select> </div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">甲方</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="editContractInfo.partyA" type="text" placeholder="必填,请填写甲方" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">乙方</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="editContractInfo.partyB" type="text" placeholder="必填,请填写乙方" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">甲方联系人</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="editContractInfo.aContacts" type="text" placeholder="必填,请填写甲方联系人" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">乙方联系人</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="editContractInfo.bContacts" type="text" placeholder="必填,请填写乙方联系人" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">甲方联系电话</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="editContractInfo.aLink" type="text" placeholder="必填,请填写甲方联系电话" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">乙方联系电话</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="editContractInfo.bLink" type="text" placeholder="必填,请填写乙方联系电话" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">经办人</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="editContractInfo.operator" type="text" placeholder="必填,请填写经办人" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">联系电话</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="editContractInfo.operatorLink" type="text" placeholder="必填,请填写联系电话" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">合同金额</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="editContractInfo.amount" type="text" placeholder="选填,请填写合同金额" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">开始时间</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="editContractInfo.startTime" type="text" placeholder="必填,请填写开始时间" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">结束时间</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="editContractInfo.endTime" type="text" placeholder="必填,请填写结束时间" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">签订时间</label>
|
||||
<div class="col-sm-10">
|
||||
<input v-model="editContractInfo.signingTime" type="text" placeholder="必填,请填写签订时间" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ibox-content">
|
||||
<button class="btn btn-primary float-right" type="button" v-on:click="editContract()" ><i class="fa fa-check"></i> 保存</button>
|
||||
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;" data-dismiss="modal">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="editContractModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<h3 class="m-t-none m-b ">变更合同</h3>
|
||||
<div class="ibox-content">
|
||||
<div>
|
||||
<div>
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 col-form-label padding-lr-sm text-right">合同名称</label>
|
||||
<div class="col-sm-9 padding-lr-xs">
|
||||
<input v-model="editContractInfo.contractName" type="text" placeholder="必填,请填写合同名称"
|
||||
class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 col-form-label padding-lr-sm text-right">合同编号</label>
|
||||
<div class="col-sm-9 padding-lr-xs">
|
||||
<input v-model="editContractInfo.contractCode" type="text" placeholder="必填,请填写合同编号"
|
||||
class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 col-form-label padding-lr-sm text-right">合同类型</label>
|
||||
<div class="col-sm-9 padding-lr-xs">
|
||||
<select class="custom-select" v-model="editContractInfo.contractType" disabled="disabled">
|
||||
<option selected disabled value="">必填,请选择合同类型</option>
|
||||
<option v-for="(item,index) in editContractInfo.contractTypes" :key="index"
|
||||
:value="item.contractTypeId">{{item.typeName}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 col-form-label padding-lr-sm text-right">甲方</label>
|
||||
<div class="col-sm-9 padding-lr-xs">
|
||||
<input v-model="editContractInfo.partyA" type="text" placeholder="必填,请填写甲方" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 col-form-label padding-lr-sm text-right">甲方联系人</label>
|
||||
<div class="col-sm-9 padding-lr-xs">
|
||||
<input v-model="editContractInfo.aContacts" type="text" placeholder="必填,请填写甲方联系人"
|
||||
class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 col-form-label padding-lr-sm text-right">甲方联系电话</label>
|
||||
<div class="col-sm-9 padding-lr-xs">
|
||||
<input v-model="editContractInfo.aLink" type="text" placeholder="必填,请填写甲方联系电话"
|
||||
class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 col-form-label padding-lr-sm text-right">乙方</label>
|
||||
<div class="col-sm-9 padding-lr-xs">
|
||||
<input v-model="editContractInfo.partyB" type="text" placeholder="必填,请填写乙方" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 col-form-label padding-lr-sm text-right">乙方联系人</label>
|
||||
<div class="col-sm-9 padding-lr-xs">
|
||||
<input v-model="editContractInfo.bContacts" type="text" placeholder="必填,请填写乙方联系人"
|
||||
class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 col-form-label padding-lr-sm text-right">乙方联系电话</label>
|
||||
<div class="col-sm-9 padding-lr-xs">
|
||||
<input v-model="editContractInfo.bLink" type="text" placeholder="必填,请填写乙方联系电话"
|
||||
class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 col-form-label padding-lr-sm text-right">经办人</label>
|
||||
<div class="col-sm-9 padding-lr-xs">
|
||||
<input v-model="editContractInfo.operator" type="text" placeholder="必填,请填写经办人"
|
||||
class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 col-form-label padding-lr-sm text-right">联系电话</label>
|
||||
<div class="col-sm-9 padding-lr-xs">
|
||||
<input v-model="editContractInfo.operatorLink" type="text" placeholder="必填,请填写联系电话"
|
||||
class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 col-form-label padding-lr-sm text-right">合同金额</label>
|
||||
<div class="col-sm-9 padding-lr-xs">
|
||||
<input v-model="editContractInfo.amount" type="text" placeholder="选填,请填写合同金额"
|
||||
class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 col-form-label padding-lr-sm text-right">开始时间</label>
|
||||
<div class="col-sm-9 padding-lr-xs">
|
||||
<input v-model="editContractInfo.startTime" type="text" placeholder="必填,请填写开始时间"
|
||||
class="form-control editStartTime">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 col-form-label padding-lr-sm text-right">结束时间</label>
|
||||
<div class="col-sm-9 padding-lr-xs">
|
||||
<input v-model="editContractInfo.endTime" type="text" placeholder="必填,请填写结束时间"
|
||||
class="form-control editEndTime">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 col-form-label padding-lr-sm text-right">签订时间</label>
|
||||
<div class="col-sm-9 padding-lr-xs">
|
||||
<input v-model="editContractInfo.signingTime" type="text" placeholder="必填,请填写签订时间"
|
||||
class="form-control editSigningTime">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-for="(item,index) in editContractInfo.contractTypeSpecs">
|
||||
<div class="row" v-if="index % 3 == 0">
|
||||
<div class="col-sm-4">
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-3 col-form-label padding-lr-sm text-right">{{item.specName}}</label>
|
||||
<div class="col-sm-9 padding-lr-xs">
|
||||
<input v-model="item.value" type="text" :placeholder="item.specHoldplace" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4" v-if="index < editContractInfo.contractTypeSpecs.length-1">
|
||||
<div class="form-group row">
|
||||
<label
|
||||
class="col-sm-3 col-form-label padding-lr-sm text-right">{{editContractInfo.contractTypeSpecs[index+1].specName}}</label>
|
||||
<div class="col-sm-9 padding-lr-xs">
|
||||
<input v-model="editContractInfo.contractTypeSpecs[index+1].value" type="text"
|
||||
:placeholder="editContractInfo.contractTypeSpecs[index+1].specHoldplace" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4" v-if="index < editContractInfo.contractTypeSpecs.length-2">
|
||||
<div class="form-group row">
|
||||
<label
|
||||
class="col-sm-3 col-form-label padding-lr-sm text-right">{{editContractInfo.contractTypeSpecs[index+2].specName}}</label>
|
||||
<div class="col-sm-9 padding-lr-xs">
|
||||
<input v-model="editContractInfo.contractTypeSpecs[index+2].value" type="text"
|
||||
:placeholder="editContractInfo.contractTypeSpecs[index+2].specHoldplace" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ibox-content">
|
||||
<button class="btn btn-primary float-right" type="button" v-on:click="editContract()"><i
|
||||
class="fa fa-check"></i> 保存</button>
|
||||
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
|
||||
data-dismiss="modal">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -19,18 +19,38 @@
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
signingTime: '',
|
||||
contractTypes: [],
|
||||
contractTypeSpecs: []
|
||||
|
||||
}
|
||||
},
|
||||
_initMethod: function () {
|
||||
vc.initDateTime('editStartTime', function (_value) {
|
||||
$that.editContractInfo.startTime = _value;
|
||||
});
|
||||
vc.initDateTime('editEndTime', function (_value) {
|
||||
$that.editContractInfo.endTime = _value;
|
||||
});
|
||||
|
||||
vc.initDateTime('editSigningTime', function (_value) {
|
||||
$that.editContractInfo.signingTime = _value;
|
||||
});
|
||||
|
||||
$that._loadEditContractType();
|
||||
},
|
||||
_initEvent: function () {
|
||||
vc.on('editContract', 'openEditContractModal', function (_params) {
|
||||
vc.component.refreshEditContractInfo();
|
||||
$('#editContractModel').modal('show');
|
||||
vc.copyObject(_params, vc.component.editContractInfo);
|
||||
vc.component.editContractInfo.communityId = vc.getCurrentCommunity().communityId;
|
||||
$that._loadContractType(_params);
|
||||
});
|
||||
$('#editContractModel').on('show.bs.modal', function (e) {
|
||||
$(this).css('display', 'block');
|
||||
let modalWidth = $(window).width() * 0.7;
|
||||
$(this).find('.modal-dialog').css({
|
||||
'max-width': modalWidth
|
||||
});
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
@ -252,6 +272,7 @@
|
||||
});
|
||||
},
|
||||
refreshEditContractInfo: function () {
|
||||
let _contractTypes = $that.editContractInfo.contractTypes;
|
||||
vc.component.editContractInfo = {
|
||||
contractId: '',
|
||||
contractName: '',
|
||||
@ -269,8 +290,61 @@
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
signingTime: '',
|
||||
|
||||
contractTypes: _contractTypes,
|
||||
contractTypeSpecs: []
|
||||
}
|
||||
},
|
||||
_loadEditContractType: function () {
|
||||
let param = {
|
||||
params: {
|
||||
page: 1,
|
||||
row: 100
|
||||
}
|
||||
}
|
||||
//发送get请求
|
||||
vc.http.apiGet('/contract/queryContractType',
|
||||
param,
|
||||
function (json, res) {
|
||||
var _contractTypeManageInfo = JSON.parse(json);
|
||||
vc.component.editContractInfo.contractTypes = _contractTypeManageInfo.data;
|
||||
}, function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
}
|
||||
);
|
||||
},
|
||||
_loadContractType: function (_params) {
|
||||
let _attrs = _params.attrs;
|
||||
let param = {
|
||||
params: {
|
||||
page: 1,
|
||||
row: 100,
|
||||
contractTypeId: $that.editContractInfo.contractType
|
||||
}
|
||||
}
|
||||
$that.editContractInfo.contractTypeSpecs = [];
|
||||
vc.http.apiGet('/contract/queryContractTypeSpec',
|
||||
param,
|
||||
function (json, res) {
|
||||
let _contractTypeSpecManageInfo = JSON.parse(json);
|
||||
_contractTypeSpecManageInfo.data.forEach(item => {
|
||||
_attrs.forEach(_attrItem => {
|
||||
if(item.specCd == _attrItem.specCd){
|
||||
item.value = _attrItem.value;
|
||||
}else{
|
||||
item.value = '';
|
||||
}
|
||||
|
||||
})
|
||||
if (item.specShow == 'Y') {
|
||||
item.values = [];
|
||||
//$that._loadAttrValue(item.specCd, item.values);
|
||||
$that.editContractInfo.contractTypeSpecs.push(item);
|
||||
}
|
||||
});
|
||||
}, function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -1440,6 +1440,25 @@
|
||||
return year + "" + month + "" + day + "" + hour + "" + minute + "" + second;
|
||||
};
|
||||
|
||||
vcFramework.initDateTime = function (_dateStr,_callBack) {
|
||||
$('.' + _dateStr).datetimepicker({
|
||||
language: 'zh-CN',
|
||||
fontAwesome: 'fa',
|
||||
format: 'yyyy-mm-dd hh:ii:ss',
|
||||
initTime: true,
|
||||
initialDate: new Date(),
|
||||
autoClose: 1,
|
||||
todayBtn: true
|
||||
|
||||
});
|
||||
$('.' + _dateStr).datetimepicker()
|
||||
.on('changeDate', function (ev) {
|
||||
var value = $('.' + _dateStr).val();
|
||||
//vc.component.addFeeConfigInfo.startTime = value;
|
||||
_callBack(value);
|
||||
});
|
||||
}
|
||||
|
||||
})(window.vcFramework);
|
||||
|
||||
|
||||
@ -2113,7 +2132,7 @@ vc 校验 工具类 -method
|
||||
(function (vcFramework) {
|
||||
let _staffPrivilege = vc.getData('hc_staff_privilege');
|
||||
|
||||
if(_staffPrivilege == null){
|
||||
if (_staffPrivilege == null) {
|
||||
_staffPrivilege = [];
|
||||
}
|
||||
vcFramework.hasPrivilege = (_privalege) => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user