修补选择组件

This commit is contained in:
liaozetao
2024-01-09 12:11:42 +08:00
parent faf0250aae
commit fdc01127e2
3 changed files with 22 additions and 11 deletions

View File

@@ -1,3 +1,4 @@
import request from "@/utils/request";
import '@/utils/ajaxfileupload';
export const uploadFile = id => {
@@ -20,4 +21,16 @@ export const uploadFile = id => {
}
});
});
};
export const uploadGift = (id) => {
let formData = new FormData();
formData.append('file', $(id)[0].files[0]);
return new Promise((resolve, reject) => {
request.post('/admin/gift/upload', formData).then(res => {
resolve(res);
}).catch(e => {
reject(e);
});
});
};

View File

@@ -62,7 +62,7 @@
<div class="modal-body">
<form id="roomType" class="form-horizontal">
房间类型:
<select id="permitType" name="permitType" data-btn-class="btn-warning">
<select id="permitType" name="permitType" class="form-control" data-btn-class="btn-warning">
<option value="1">牌照房</option>
<option value="2">普通房</option>
<option value="3">新秀房</option>
@@ -268,7 +268,6 @@ export default {
},
methods: {
initData() {
ComboboxHelper.build(null, '#permitType');
$(function () {
//选择select时触发
$("#sendDays").change(function () {
@@ -502,7 +501,7 @@ export default {
}
var data = $('#table').bootstrapTable('getRowByUniqueId', erbanNo);
$("#roomTypeUid").val(data.room.uid);
ComboboxHelper.setDef("#permitType", data.room.isPermitRoom);
$('#permitType').val(data.room.isPermitRoom);
$("#roomTypeModal").modal('show');
});
@@ -587,7 +586,7 @@ export default {
dataType: 'json',
data: {
uid: $('#roomTypeUid').val(),
permitType: ComboboxHelper.getSelected("#permitType")
permitType: $('#permitType').val(),
},
success: function (res) {
if (res.code == 200) {

View File

@@ -128,7 +128,8 @@
</div>
</div>
</div>
<div class="modal fade" id="giftModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel" style="height: 100%; overflow: hidden; overflow: scroll;">
<div class="modal fade" id="giftModal" tabindex="-1" role="dialog" aria-labelledby="modalLabel"
style="height: 100%; overflow: hidden; overflow: scroll;">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
@@ -552,8 +553,6 @@ import TableHelper from '@/utils/bootstrap-table-helper';
import ComboboxHelper from '@/assets/plugins/bootstrap-combobox/js/bootstrap-combobox-helper';
import { formatTime, showLoading, hideLoading } from '@/utils/maintainer';
//ComboboxHelper.build(null, '#condition_type');
//ComboboxHelper.build(null, '#nobleId');
export default {
name: "GiftManageView",
setup() {
@@ -887,7 +886,7 @@ export default {
}
});
}
})
$("#nobleId").on('change', function () {
@@ -1565,13 +1564,13 @@ function roomGiftTableInit() {
switch (val) {
case 1:
return '牌照房';
case 2:
return '非牌照房';
case 3:
return '新秀房';
}
}
},