调整商户修改页面

This commit is contained in:
曾成 2020-04-26 17:03:51 +08:00
parent 01de18cd94
commit 3cdc0c4629
5 changed files with 135 additions and 67 deletions

View File

@ -0,0 +1,31 @@
<div id="editStoreAttrModel" 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">{{editStoreAttr.name}}</label>
<div class="col-sm-10">
<input v-model="editStoreAttr.value" type="text"
placeholder="商户属性必填" class="form-control">
</div>
</div>
<div class="ibox-content">
<button class="btn btn-primary float-right" type="button"
v-on:click="submitEditStoreAttr()"><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,82 @@
(function (vc, vm) {
vc.extends({
data: {
editStoreAttr: {
attrId:'',
value:'',
name:'',
}
},
_initMethod: function () {
},
_initEvent: function () {
vc.on("editStoreAttr", "openEditStoreAttrModal", function (_param) {
vc.component.clearEditStoreAttr();
vc.component.refreshEditStoreAttr(_param);
$('#editStoreAttrModel').modal('show');
});
},
methods: {
refreshEditStoreAttr(_storeAttr){
var _storeAttr = _storeAttr._storeAttr;
vc.component.editStoreAttr.attrId = _storeAttr.attrId;
vc.component.editStoreAttr.value = _storeAttr.value;
vc.component.editStoreAttr.name = _storeAttr.name;
},
clearEditStoreAttr(){
vc.component.editStoreAttr= {
attrId:'',
value:'',
name:''
}
},
editStoreAttrValidate: function () {
return vc.validate.validate({
editStoreAttrInfo: vc.component.editStoreAttr
}, {
'editStoreAttrInfo.value': [
{
limit: "required",
param: "",
errInfo: "必填"
},
{
limit: "maxLength",
param: "50",
errInfo: "属性值不能超过50位"
},
],
'editStoreAttrInfo.attrId': [
{
limit: "required",
param: "",
errInfo: "属性id不能为空"
}
]
});
},
submitEditStoreAttr:function () {
if (!vc.component.editStoreAttrValidate()) {
vc.toast(vc.validate.errInfo);
return;
}
vc.http.apiPost('storeAttr.updateStoreAttr',
JSON.stringify(vc.component.editStoreAttr),
function (json, res) {
}, function (bodyText, res) {
if (res.status == 200) {
$('#editStoreAttrModel').modal('hide');
vc.emit('storeInfoManage', 'getStoreInfo', {});
return;
}
vc.toast(bodyText);
}
);
}
}
});
})(window.vc, window.vc.component);

View File

@ -104,33 +104,6 @@
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) {

View File

@ -57,43 +57,30 @@
</div>
<div class="row">
<div class="col-lg-12">
<div class="ibox">
<div class="ibox ">
<div class="ibox-title">
<h5>商户属性</h5>
<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>
<table class="footable table table-stripped toggle-arrow-tiny" data-page-size="15">
<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>
<tr v-for="(storeAttr, key) in listStoreManageInfo.listStores[0].storeAttrDtoList">
<td class="text-center">{{storeAttr.name}}</td>
<td class="text-center">{{storeAttr.value}}</td>
<td class="text-right">
<div class="btn-group">
<button class="btn-white btn btn-xs"
v-on:click="_openEditStoreAttrModel(storeAttr)">修改
</button>
</div>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="7">
@ -103,8 +90,11 @@
</tfoot>
</table>
</div>
</div>
</div>
</div>
<vc:create name="editStoreInfo"></vc:create>
<vc:create name="editStoreAttr"></vc:create>
</div>

View File

@ -7,7 +7,6 @@
listStores: [],
total: 0,
records: 1,
moreCondition: false,
conditions: {
name: '',
storeTypeCd: '',
@ -55,15 +54,8 @@
_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(){
_openEditStoreAttrModel(_storeAttr){
vc.emit('editStoreAttr', 'openEditStoreAttrModal', {_storeAttr});
}