mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-24 05:46:03 +08:00
优化代码
This commit is contained in:
parent
7357f7f7c4
commit
15a8437c30
@ -23,8 +23,7 @@
|
||||
<div class="col-sm-10">
|
||||
<select class="custom-select" v-model="addMachinePrinterInfo.implBean">
|
||||
<option selected disabled value="">{{vc.i18n('必填,请选择门禁厂家','addMachinePrinter')}}</option>
|
||||
<option value="feie">{{vc.i18n('飞蛾小票打印机','addMachinePrinter')}}</option>
|
||||
<option value="10002">{{vc.i18n('其他','addMachinePrinter')}}</option>
|
||||
<option :value="item.statusCd" v-for="(item,index) in addMachinePrinterInfo.implBeans">{{item.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -11,10 +11,13 @@
|
||||
machineName: '',
|
||||
machineCode: '',
|
||||
implBean: '',
|
||||
|
||||
implBeans:[]
|
||||
}
|
||||
},
|
||||
_initMethod: function() {
|
||||
vc.getDict('machine_printer','impl_bean',function(_data){
|
||||
$that.addMachinePrinterInfo.implBeans=_data;
|
||||
})
|
||||
|
||||
},
|
||||
_initEvent: function() {
|
||||
@ -102,11 +105,12 @@
|
||||
});
|
||||
},
|
||||
clearAddMachinePrinterInfo: function() {
|
||||
let _implBeans = $that.addMachinePrinterInfo.implBeans;
|
||||
vc.component.addMachinePrinterInfo = {
|
||||
machineName: '',
|
||||
machineCode: '',
|
||||
implBean: '',
|
||||
|
||||
implBeans:_implBeans
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,45 +1,47 @@
|
||||
<div id="addPrinterRuleFeeModel" class="modal fade" 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 "><span>
|
||||
<div id="addPrinterRuleFeeModel" class="modal fade" 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 "><span>
|
||||
<vc:i18n name="缴费自动打印" namespace="addPrinterRuleFee"></vc:i18n>
|
||||
</span></h3>
|
||||
<div class="ibox-content">
|
||||
<div>
|
||||
<div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label"><span>
|
||||
<div class="ibox-content">
|
||||
<div>
|
||||
<div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label"><span>
|
||||
<vc:i18n name='费用' namespace='addPrinterRuleFee'></vc:i18n>
|
||||
</span></label>
|
||||
<div class="col-sm-10">
|
||||
<select class="custom-select" v-model="addPrinterRuleFeeInfo.feeConfigId">
|
||||
<div class="col-sm-10">
|
||||
<select class="custom-select" v-model="addPrinterRuleFeeInfo.feeId">
|
||||
<option selected disabled value="">{{vc.i18n('必填,请选择费用','addPrinterRuleFee')}}
|
||||
</option>
|
||||
<option :value="item.configId" v-for="(item,index) in addPrinterRuleFeeInfo.feeConfigs">
|
||||
{{item.feeName}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="ibox-content">
|
||||
<button class="btn btn-primary float-right" type="button" v-on:click="savePrinterRuleFeeInfo()"><i
|
||||
<div class="ibox-content">
|
||||
<button class="btn btn-primary float-right" type="button" v-on:click="savePrinterRuleFeeInfo()"><i
|
||||
class="fa fa-check"></i>
|
||||
<span>
|
||||
<vc:i18n name="保存"></vc:i18n>
|
||||
</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;" data-dismiss="modal">
|
||||
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
|
||||
data-dismiss="modal">
|
||||
<span>
|
||||
<vc:i18n name="取消"></vc:i18n>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -9,7 +9,7 @@
|
||||
addPrinterRuleFeeInfo: {
|
||||
prfId: '',
|
||||
ruleId: '',
|
||||
feeConfigId: '',
|
||||
feeId: '',
|
||||
feeConfigs: []
|
||||
|
||||
}
|
||||
@ -42,7 +42,7 @@
|
||||
errInfo: "规则ID不能超过30"
|
||||
},
|
||||
],
|
||||
'addPrinterRuleFeeInfo.feeConfigId': [{
|
||||
'addPrinterRuleFeeInfo.feeId': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "费用不能为空"
|
||||
@ -91,7 +91,7 @@
|
||||
vc.component.addPrinterRuleFeeInfo = {
|
||||
prfId: '',
|
||||
ruleId: '',
|
||||
feeConfigId: '',
|
||||
feeId: '',
|
||||
feeConfigs: []
|
||||
|
||||
};
|
||||
|
||||
@ -23,8 +23,7 @@
|
||||
<div class="col-sm-10">
|
||||
<select class="custom-select" v-model="editMachinePrinterInfo.implBean">
|
||||
<option selected disabled value="">{{vc.i18n('必填,请选择门禁厂家' ,'editMachinePrinter')}}</option>
|
||||
<option value="feie">{{vc.i18n('飞蛾小票打印机' ,'editMachinePrinter')}} </option>
|
||||
<option value="10002">{{vc.i18n('其他' ,'editMachinePrinter')}} </option>
|
||||
<option :value="item.statusCd" v-for="(item,index) in editMachinePrinterInfo.implBeans">{{item.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -7,11 +7,13 @@
|
||||
machineName: '',
|
||||
machineCode: '',
|
||||
implBean: '',
|
||||
|
||||
implBeans:[]
|
||||
}
|
||||
},
|
||||
_initMethod: function() {
|
||||
|
||||
vc.getDict('machine_printer','impl_bean',function(_data){
|
||||
$that.editMachinePrinterInfo.implBeans=_data;
|
||||
})
|
||||
},
|
||||
_initEvent: function() {
|
||||
vc.on('editMachinePrinter', 'openEditMachinePrinterModal', function(_params) {
|
||||
@ -96,12 +98,13 @@
|
||||
});
|
||||
},
|
||||
refreshEditMachinePrinterInfo: function() {
|
||||
let _implBeans = $that.editMachinePrinterInfo.implBeans;
|
||||
vc.component.editMachinePrinterInfo = {
|
||||
machineId: '',
|
||||
machineName: '',
|
||||
machineCode: '',
|
||||
implBean: '',
|
||||
|
||||
implBeans:_implBeans
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -202,7 +202,7 @@
|
||||
}
|
||||
};
|
||||
//发送get请求
|
||||
vc.http.apiGet('repair.listRepairSettings',
|
||||
vc.http.apiGet('/repair.listRepairSettings',
|
||||
param,
|
||||
function (json, res) {
|
||||
var _repairSettingManageInfo = JSON.parse(json);
|
||||
|
||||
@ -60,7 +60,7 @@
|
||||
<td class="text-center">{{machinePrinter.machineId}}</td>
|
||||
<td class="text-center">{{machinePrinter.machineName}}</td>
|
||||
<td class="text-center">{{machinePrinter.machineCode}}</td>
|
||||
<td class="text-center">{{machinePrinter.implBean}}</td>
|
||||
<td class="text-center">{{machinePrinter.implBeanName}}</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
<button class="btn-white btn btn-xs" v-on:click="_openEditMachinePrinterModel(machinePrinter)"><span><vc:i18n name='修改'></vc:i18n></span></button>
|
||||
|
||||
@ -58,8 +58,51 @@
|
||||
<button class="btn btn-primary float-right" type="button" v-on:click="_printPurchaseApplyDiv()">
|
||||
<i class="fa fa-check"></i> 打印
|
||||
</button>
|
||||
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;" v-on:click="_closePage()">
|
||||
<button class="btn btn-white float-right margin-right" type="button" v-on:click="_openCloudPrint()">
|
||||
<i class="fa fa-check"></i> 云打印
|
||||
</button>
|
||||
<button type="button" class="btn btn-white float-right margin-right" v-on:click="_closePage()">
|
||||
<span><vc:i18n name="取消" namespace="printSmallPayFee"></vc:i18n></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div id="cloudPrintModel" class="modal fade" 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 ">
|
||||
<span><vc:i18n name="云打印" namespace="printSmallPayFee"></vc:i18n></span>
|
||||
</h3>
|
||||
<div class="ibox-content">
|
||||
<div>
|
||||
<div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label"><span><vc:i18n name="打印机" namespace="printSmallPayFee"></vc:i18n></span></label>
|
||||
<div class="col-sm-10">
|
||||
<select class="custom-select" v-model="printSmallPayFeeInfo.machineId">
|
||||
<option selected disabled value="">{{vc.i18n('必填,请选择打印机','printSmallPayFee')}}</option>
|
||||
<option :value="item.machineId" v-for="(item,index) in printSmallPayFeeInfo.machines">{{item.machineName}}({{item.machineCode}})</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label"><span><vc:i18n name="数量" namespace="printSmallPayFee"></vc:i18n></span></label>
|
||||
<div class="col-sm-10"><input v-model="printSmallPayFeeInfo.quantity" type="number" :placeholder="vc.i18n('必填,请填写数量','printSmallPayFee')" class="form-control"></div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<button class="btn btn-primary float-right" type="button" v-on:click="_cloudPrintPayFeeDetail()">
|
||||
<i class="fa fa-check"></i> 提交
|
||||
</button>
|
||||
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
|
||||
data-dismiss="modal">
|
||||
<span><vc:i18n name="取消" namespace="addFloor"></vc:i18n></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -12,7 +12,10 @@
|
||||
wechatName: '',
|
||||
content: '',
|
||||
qrImg: '',
|
||||
payObjName: ''
|
||||
payObjName: '',
|
||||
machineId:'',
|
||||
quantity:'1',
|
||||
machines:[]
|
||||
},
|
||||
printFlag: '0'
|
||||
},
|
||||
@ -124,6 +127,73 @@
|
||||
_closePage: function () {
|
||||
window.opener = null;
|
||||
window.close();
|
||||
},
|
||||
_openCloudPrint:function(){
|
||||
$('#cloudPrintModel').modal('show');
|
||||
$that._listMachinePrinter();
|
||||
},
|
||||
_listMachinePrinter: function(_page, _rows) {
|
||||
let param = {
|
||||
params: {
|
||||
page: 1,
|
||||
row: 100,
|
||||
communityId: vc.getCurrentCommunity().communityId
|
||||
}
|
||||
};
|
||||
|
||||
//发送get请求
|
||||
vc.http.apiGet('/printer.listMachinePrinter',
|
||||
param,
|
||||
function(json, res) {
|
||||
var _couponPropertyPoolManageInfo = JSON.parse(json);
|
||||
vc.component.printSmallPayFeeInfo.machines = _couponPropertyPoolManageInfo.data;
|
||||
|
||||
if($that.printSmallPayFeeInfo.machines && $that.printSmallPayFeeInfo.machines.length > 0){
|
||||
$that.printSmallPayFeeInfo.machineId = $that.printSmallPayFeeInfo.machines[0].machineId;
|
||||
}
|
||||
|
||||
},
|
||||
function(errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
}
|
||||
);
|
||||
},
|
||||
_cloudPrintPayFeeDetail:function(){
|
||||
let _detailIds = [];
|
||||
$that.printSmallPayFeeInfo.fees.forEach(_data=>{
|
||||
_detailIds.push(_data.detailId);
|
||||
})
|
||||
if(_detailIds.length < 1){
|
||||
vc.toast('未包含费用');
|
||||
return ;
|
||||
}
|
||||
let _data = {
|
||||
communityId:vc.getCurrentCommunity().communityId,
|
||||
machineId:$that.printSmallPayFeeInfo.machineId,
|
||||
quantity:$that.printSmallPayFeeInfo.quantity,
|
||||
detailId:_detailIds.join(',')
|
||||
}
|
||||
vc.http.apiPost(
|
||||
'/print.printPayFeeDetail',
|
||||
JSON.stringify(_data), {
|
||||
emulateJSON: true
|
||||
},
|
||||
function (json, res) {
|
||||
let _json = JSON.parse(json);
|
||||
if (_json.code == 0) {
|
||||
//关闭model
|
||||
$('#cloudPrintModel').modal('hide');
|
||||
vc.toast("提交成功");
|
||||
return;
|
||||
} else {
|
||||
vc.toast(_json.msg);
|
||||
}
|
||||
},
|
||||
function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
vc.component.addFloorInfo.errorInfo = errInfo;
|
||||
vc.toast(errInfo)
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -5,13 +5,17 @@
|
||||
<title>收据单</title>
|
||||
</head>
|
||||
<body>
|
||||
<vc:create path="frame/bodyTop"></vc:create>
|
||||
<!-- 1231 -->
|
||||
<div id="component">
|
||||
</div>
|
||||
</body>
|
||||
<!-- import CSS -->
|
||||
<link rel="stylesheet" href="/css/bootstrap/bootstrap.min.css" />
|
||||
<link rel="stylesheet" href="/css/vc-ui.css" />
|
||||
<link rel="stylesheet" href="/css/vc.css" />
|
||||
<script src="/js/bootstrap/jquery-3.3.1.min.js"></script>
|
||||
<script src="/js/bootstrap/bootstrap.min.js"></script>
|
||||
<script src="/js/vue/vue.min.js"></script>
|
||||
<script src="/js/vue/vue-resource.min.js"></script>
|
||||
<script src="/vcCore/vcFramework.js"></script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user