供应商功能开发完成 包括配置

This commit is contained in:
wuxw 2022-11-17 01:50:57 +08:00
parent c5bbc90654
commit e7df2bb656
4 changed files with 127 additions and 0 deletions

View File

@ -0,0 +1,39 @@
<div id="configSupplierModel" 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="configSupplier"></vc:i18n>
</span></h3>
<div class="ibox-content">
<div>
<div>
<div class="form-group row" v-for="(item,index) in configSupplierInfo.configs" :key="index">
<label class="col-sm-2 col-form-label">{{item.name}}</label>
<div class="col-sm-10">
<input v-model="item.columnValue" type="text"
:placeholder="item.remark" class="form-control">
</div>
</div>
<div class="ibox-content">
<button class="btn btn-primary float-right" type="button"
v-on:click="saveConfigSupplierInfo()"><i class="fa fa-check"></i>&nbsp;
<span>
<vc:i18n name="保存"></vc:i18n>
</span>
</button>
<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>

View File

@ -0,0 +1,77 @@
(function (vc) {
vc.extends({
data: {
configSupplierInfo: {
supplierId: '',
configs:[]
}
},
_initMethod: function () {
},
_initEvent: function () {
vc.on('configSupplier', 'openConfigModal', function (_param) {
vc.copyObject(_param,$that.configSupplierInfo);
$('#configSupplierModel').modal('show');
$that._loadSupplierConfigs();
});
},
methods: {
saveConfigSupplierInfo: function () {
vc.http.apiPost(
'/supplierType.saveSupplierConfig',
JSON.stringify(vc.component.configSupplierInfo),
{
emulateJSON: true
},
function (json, res) {
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
let _json = JSON.parse(json);
if (_json.code == 0) {
//关闭model
$('#configSupplierModel').modal('hide');
vc.component.clearConfigtSupplierInfo();
return;
}
vc.toast(_json.msg);
},
function (errInfo, error) {
console.log('请求失败处理');
vc.toast(errInfo);
});
},
clearConfigtSupplierInfo: function () {
vc.component.configSupplierInfo = {
supplierId: '',
configs:[]
};
},
_loadSupplierConfigs:function(){
if(!$that.configSupplierInfo.supplierId){
return;
}
let _param = {
params:{
supplierId:$that.configSupplierInfo.supplierId,
page:1,
row:100
}
}
//发送get请求
vc.http.apiGet('/supplierType.listSupplierConfig',
_param,
function (json, res) {
let _marketSmsManageInfo = JSON.parse(json);
$that.configSupplierInfo.configs = _marketSmsManageInfo.data;
}, function (errInfo, error) {
console.log('请求失败处理');
}
);
}
}
});
})(window.vc);

View File

@ -132,6 +132,13 @@
<vc:i18n name='修改'></vc:i18n>
</span></button>
</div>
<div class="btn-group">
<button class="btn-white btn btn-xs"
v-on:click="_openConfigSupplierModel(supplier)"><span>
<vc:i18n name='配置'></vc:i18n>
</span></button>
</div>
<div class="btn-group">
<button class="btn-white btn btn-xs"
v-on:click="_openDeleteSupplierModel(supplier)"><span>
@ -159,5 +166,6 @@
<vc:create path="scm/addSupplier" callBackListener="" callBackFunction=""></vc:create>
<vc:create path="scm/editSupplier"></vc:create>
<vc:create path="scm/deleteSupplier"></vc:create>
<vc:create path="scm/configSupplier" callBackListener="" callBackFunction=""></vc:create>
</div>

View File

@ -69,6 +69,9 @@
_openEditSupplierModel: function (_supplier) {
vc.emit('editSupplier', 'openEditSupplierModal', _supplier);
},
_openConfigSupplierModel: function (_supplier) {
vc.emit('configSupplier', 'openConfigModal', _supplier);
},
_openDeleteSupplierModel: function (_supplier) {
vc.emit('deleteSupplier', 'openDeleteSupplierModal', _supplier);
},