This commit is contained in:
java110 2020-04-25 23:17:13 +08:00
commit 01de18cd94
4 changed files with 398 additions and 0 deletions

View File

@ -0,0 +1,66 @@
<div id="editStoreModel" 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 ">修改商户信息</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 readonly v-model="editStoreInfo.name" 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="editStoreInfo.address" 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="editStoreInfo.tel" 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="editStoreInfo.nearByLandmarks" type="text"
placeholder="必填,请填写附近地标" class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">地区 x坐标</label>
<div class="col-sm-10">
<input v-model="editStoreInfo.mapX" type="text"
placeholder="选择填请填写x坐标" class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label">地区 y坐标</label>
<div class="col-sm-10">
<input v-model="editStoreInfo.mapY" type="text"
placeholder="选填请填写y坐标" class="form-control">
</div>
</div>
<div class="ibox-content">
<button class="btn btn-primary float-right" type="button"
v-on:click="submitEditStoreInfo()"><i class="fa fa-check"></i>&nbsp;保存
</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>

View File

@ -0,0 +1,150 @@
(function (vc, vm) {
vc.extends({
data: {
editStoreInfo: {
storeId:'',
name:'',
address:'',
tel:'',
nearByLandmarks:'',
mapX:'',
mapY:'',
}
},
_initMethod: function () {
},
_initEvent: function () {
vc.on("editStoreInfo", "openEditStoreModal", function (_param) {
vc.component.clearEditStoreInfo();
vc.component.refreshEditStoreInfo(_param);
$('#editStoreModel').modal('show');
});
},
methods: {
refreshEditStoreInfo(_storeInfo){
_storeInfo = _storeInfo._storeInfo;
vc.component.editStoreInfo.storeId = _storeInfo.storeId;
vc.component.editStoreInfo.name = _storeInfo.name;
vc.component.editStoreInfo.address = _storeInfo.address;
vc.component.editStoreInfo.tel = _storeInfo.tel;
vc.component.editStoreInfo.nearByLandmarks = _storeInfo.nearByLandmarks;
vc.component.editStoreInfo.mapX = _storeInfo.mapX;
vc.component.editStoreInfo.mapY = _storeInfo.mapY;
},
clearEditStoreInfo(){
vc.component.editStoreInfo= {
storeId:'',
name:'',
address:'',
tel:'',
nearByLandmarks:'',
mapX:'',
mapY:'',
}
},
editStoreValidate: function () {
return vc.validate.validate({
editStoreInfo: vc.component.editStoreInfo
}, {
'editStoreInfo.name': [
{
limit: "required",
param: "",
errInfo: "商户名称必填"
},
{
limit: "maxLength",
param: "100",
errInfo: "商户名称不能超过100位"
},
],
'editStoreInfo.address': [
{
limit: "required",
param: "",
errInfo: "商户地址必填"
},
{
limit: "maxLength",
param: "200",
errInfo: "商户地址不能超过200位"
}
],
'editStoreInfo.tel': [
{
limit: "required",
param: "",
errInfo: "联系电话必填"
},
{
limit: "maxLength",
param: "11",
errInfo: "联系电话最多11位"
}
],
'editStoreInfo.nearByLandmarks': [
{
limit: "required",
param: "",
errInfo: "附件地标必填"
},
{
limit: "maxLength",
param: "200",
errInfo: "附件地标位置最多200位"
}
]
});
},
submitEditStoreInfo:function () {
if (!vc.component.editStoreValidate()) {
vc.toast(vc.validate.errInfo);
return;
}
// vc.http.post(
// 'editStore',
// 'update',
// JSON.stringify(vc.component.editStoreInfo),
// {
// emulateJSON: true
// },
// function (json, res) {
// if (res.status == 200) {
// $('#editStoreModel').modal('hide');
// vc.emit('storeInfoManage', 'getStoreInfo', {});
// return;
// }
// vc.toast(json);
// },
// function (errInfo, error) {
// console.log('请求失败处理');
//
// vc.toast(errInfo);
// });
// var param = {
// params: vc.component.editStoreInfo
// };
vc.http.apiPost('update.store.info',
JSON.stringify(vc.component.editStoreInfo),
function (json, res) {
}, function (bodyText, res) {
if (res.status == 200) {
$('#editStoreModel').modal('hide');
vc.emit('storeInfoManage', 'getStoreInfo', {});
return;
}
vc.toast(bodyText);
}
);
}
}
});
})(window.vc, window.vc.component);

View File

@ -0,0 +1,110 @@
<div class="animated fadeInRight ecommerce">
<div class="row">
<div class="col-lg-12">
<div class="ibox ">
<div class="ibox-title">
<h5>商户信息</h5>
<div class="ibox-tools" style="top:10px;">
</div>
</div>
<div class="ibox-content">
<table class="footable table table-stripped toggle-arrow-tiny"
data-page-size="15"
>
<thead>
<tr>
<th class="text-center">商户名称</th>
<th class="text-center">商户地址</th>
<th class="text-center">联系电话</th>
<th class="text-center">商户类型</th>
<th class="text-center">企业法人</th>
<th class="text-center">附近地标</th>
<th class="text-right">操作</th>
</tr>
</thead>
<tbody>
<tr v-for="listStore in listStoreManageInfo.listStores">
<td class="text-center">{{listStore.name}}</td>
<td class="text-center">{{listStore.address}}</td>
<td class="text-center">{{listStore.tel}}</td>
<td class="text-center">{{listStore.storeTypeName}}</td>
<td class="text-center">{{listStore.artificialPerson}}</td>
<td class="text-center">{{listStore.nearByLandmarks}}</td>
<td class="text-right">
<div class="btn-group">
<button class="btn-white btn btn-xs"
v-on:click="_openEditStoreInfoModel(listStore)">修改
</button>
</div>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="7">
<ul class="pagination float-right"></ul>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="ibox">
<div class="ibox-title">
<h5>商户属性</h5>
<div class="ibox-tools" style="top:10px;">
</div>
</div>
<div class="ibox-content">
<table class="footable table table-stripped toggle-arrow-tiny"
data-page-size="15"
>
<thead>
<tr>
<th class="text-center">企业法人</th>
<th class="text-center">注册资本</th>
<th class="text-center">成立日期</th>
<th class="text-center">经营范围</th>
<th class="text-center">登记机关</th>
<th class="text-right">操作</th>
</tr>
</thead>
<tbody>
<tr v-for="listStore in listStoreManageInfo.listStores">
<td class="text-center">{{listStore.A}}</td>
<td class="text-center">{{listStore.V}}</td>
<td class="text-center">{{listStore.A}}</td>
<td class="text-center">{{listStore.A}}</td>
<td class="text-center">{{listStore.A}}</td>
<td class="text-right">
<div class="btn-group">
<button class="btn-white btn btn-xs"
v-on:click="_openStoresAttributeModel(listStore)">修改
</button>
</div>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="7">
<ul class="pagination float-right"></ul>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
<vc:create name="editStoreInfo"></vc:create>
</div>

View File

@ -0,0 +1,72 @@
(function (vc) {
var DEFAULT_PAGE = 1;
var DEFAULT_ROWS = 10;
vc.extends({
data: {
listStoreManageInfo: {
listStores: [],
total: 0,
records: 1,
moreCondition: false,
conditions: {
name: '',
storeTypeCd: '',
tel: ''
}
}
},
_initMethod: function () {
vc.component._listListStores(DEFAULT_PAGE, DEFAULT_ROWS);
},
_initEvent: function () {
vc.on('storeInfoManage', 'getStoreInfo', function (_param) {
vc.component._listListStores(DEFAULT_PAGE, DEFAULT_ROWS);
});
},
methods: {
_listListStores: function (_page, _rows) {
vc.component.listStoreManageInfo.conditions.page = _page;
vc.component.listStoreManageInfo.conditions.row = _rows;
var param = {
params: vc.component.listStoreManageInfo.conditions
};
//发送get请求
vc.http.get('listStoreManage',
'getStoreInfo',
param,
function (json, res) {
var _listStoreManageInfo = JSON.parse(json);
vc.component.listStoreManageInfo.listStores = _listStoreManageInfo.stores;
vc.emit('pagination', 'init', {
total: vc.component.listStoreManageInfo.records,
currentPage: _page
});
}, function (errInfo, error) {
console.log('请求失败处理');
}
);
},
_queryListStoreMethod: function () {
vc.component._listListStores(DEFAULT_PAGE, DEFAULT_ROWS);
},
_openEditStoreInfoModel(_storeInfo){
vc.emit('editStoreInfo', 'openEditStoreModal', {_storeInfo});
},
_moreCondition: function () {
if (vc.component.listStoreManageInfo.moreCondition) {
vc.component.listStoreManageInfo.moreCondition = false;
} else {
vc.component.listStoreManageInfo.moreCondition = true;
}
},
_openStoresAttributeModel(){
}
}
});
})(window.vc);