优化供应链分类

This commit is contained in:
shane 2022-06-22 11:13:51 +08:00
parent ef042ccab7
commit c4a7347d82
4 changed files with 181 additions and 151 deletions

View File

@ -1,43 +1,59 @@
<div id = "addChainSupplierCatalogModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" >
<div id="addChainSupplierCatalogModel" class="modal fade" tabindex="-1" 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="addChainSupplierCatalog"></vc:i18n></span></h3>
<h3 class="m-t-none m-b "><span>
<vc:i18n name="添加供应商分类" namespace="addChainSupplierCatalog"></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='addChainSupplierCatalog'></vc:i18n></span></label>
<div class="col-sm-10">
<input v-model="addChainSupplierCatalogInfo.catalogName" type="text" :placeholder="vc.i18n('必填,请填写分类名称','addChainSupplierCatalog')" class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label"><span><vc:i18n name='供应商ID' namespace='addChainSupplierCatalog'></vc:i18n></span></label>
<div class="col-sm-10">
<input v-model="addChainSupplierCatalogInfo.csId" type="text" :placeholder="vc.i18n('必填请填写供应商ID','addChainSupplierCatalog')" class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label"><span><vc:i18n name='对端接口参数' namespace='addChainSupplierCatalog'></vc:i18n></span></label>
<div class="col-sm-10">
<input v-model="addChainSupplierCatalogInfo.intfUrlParam" type="text" :placeholder="vc.i18n('必填,请填写对端接口参数','addChainSupplierCatalog')" class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label"><span><vc:i18n name='排序' namespace='addChainSupplierCatalog'></vc:i18n></span></label>
<div class="col-sm-10">
<input v-model="addChainSupplierCatalogInfo.seq" type="text" :placeholder="vc.i18n('必填,请填写排序','addChainSupplierCatalog')" class="form-control">
</div>
</div>
<label class="col-sm-2 col-form-label"><span>
<vc:i18n name='分类名称' namespace='addChainSupplierCatalog'></vc:i18n>
</span></label>
<div class="col-sm-10">
<input v-model="addChainSupplierCatalogInfo.catalogName" type="text"
:placeholder="vc.i18n('必填,请填写分类名称','addChainSupplierCatalog')"
class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label"><span>
<vc:i18n name='对端接口参数' namespace='addChainSupplierCatalog'></vc:i18n>
</span></label>
<div class="col-sm-10">
<input v-model="addChainSupplierCatalogInfo.intfUrlParam" type="text"
:placeholder="vc.i18n('必填,请填写对端接口参数','addChainSupplierCatalog')"
class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label"><span>
<vc:i18n name='排序' namespace='addChainSupplierCatalog'></vc:i18n>
</span></label>
<div class="col-sm-10">
<input v-model="addChainSupplierCatalogInfo.seq" type="text"
:placeholder="vc.i18n('必填,请填写排序','addChainSupplierCatalog')"
class="form-control">
</div>
</div>
<div class="ibox-content">
<button class="btn btn-primary float-right" type="button" v-on:click="saveChainSupplierCatalogInfo()" ><i class="fa fa-check"></i>&nbsp;
<span><vc:i18n name="保存"></vc:i18n></span>
<button class="btn btn-primary float-right" type="button"
v-on:click="saveChainSupplierCatalogInfo()"><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>
<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>
@ -45,4 +61,4 @@
</div>
</div>
</div>
</div>
</div>

View File

@ -18,6 +18,7 @@
}
},
_initMethod: function () {
vc.component.addChainSupplierCatalogInfo.csId = vc.getParam('csId');
},
_initEvent: function () {

View File

@ -1,44 +1,57 @@
<div id = "editChainSupplierCatalogModel" class="modal fade" tabindex="-1" 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="editChainSupplierCatalog"></vc:i18n></span></h3>
<div class="ibox-content">
<div>
<div>
<div class="form-group row">
<span><vc:i18n name='分类名称' namespace='editChainSupplierCatalog'></vc:i18n></span> </label>
<div class="col-sm-10">
<input v-model="editChainSupplierCatalogInfo.catalogName" type="text" :placeholder="vc.i18n('必填,请填写分类名称','editChainSupplierCatalog')" class="form-control">
</div>
</div>
<div class="form-group row">
<span><vc:i18n name='供应商ID' namespace='editChainSupplierCatalog'></vc:i18n></span> </label>
<div class="col-sm-10">
<input v-model="editChainSupplierCatalogInfo.csId" type="text" :placeholder="vc.i18n('必填请填写供应商ID','editChainSupplierCatalog')" class="form-control">
</div>
</div>
<div class="form-group row">
<span><vc:i18n name='对端接口参数' namespace='editChainSupplierCatalog'></vc:i18n></span> </label>
<div class="col-sm-10">
<input v-model="editChainSupplierCatalogInfo.intfUrlParam" type="text" :placeholder="vc.i18n('必填,请填写对端接口参数','editChainSupplierCatalog')" class="form-control">
</div>
</div>
<div class="form-group row">
<span><vc:i18n name='排序' namespace='editChainSupplierCatalog'></vc:i18n></span> </label>
<div class="col-sm-10">
<input v-model="editChainSupplierCatalogInfo.seq" type="text" :placeholder="vc.i18n('必填,请填写排序','editChainSupplierCatalog')" class="form-control">
</div>
</div>
<div class="ibox-content">
<button class="btn btn-primary float-right" type="button" v-on:click="editChainSupplierCatalog()" ><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 id="editChainSupplierCatalogModel" class="modal fade" tabindex="-1" 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="editChainSupplierCatalog"></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='editChainSupplierCatalog'></vc:i18n>
</span> </label>
<div class="col-sm-10">
<input v-model="editChainSupplierCatalogInfo.catalogName" type="text"
:placeholder="vc.i18n('必填,请填写分类名称','editChainSupplierCatalog')" class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label"><span>
<vc:i18n name='对端接口参数' namespace='editChainSupplierCatalog'></vc:i18n>
</span> </label>
<div class="col-sm-10">
<input v-model="editChainSupplierCatalogInfo.intfUrlParam" type="text"
:placeholder="vc.i18n('必填,请填写对端接口参数','editChainSupplierCatalog')" class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col-sm-2 col-form-label"><span>
<vc:i18n name='排序' namespace='editChainSupplierCatalog'></vc:i18n>
</span> </label>
<div class="col-sm-10">
<input v-model="editChainSupplierCatalogInfo.seq" type="text"
:placeholder="vc.i18n('必填,请填写排序','editChainSupplierCatalog')" class="form-control">
</div>
</div>
<div class="ibox-content">
<button class="btn btn-primary float-right" type="button" v-on:click="editChainSupplierCatalog()"><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>
</div>

View File

@ -1,129 +1,129 @@
(function(vc,vm){
(function (vc, vm) {
vc.extends({
data:{
editChainSupplierCatalogInfo:{
catalogId:'',
catalogName:'',
csId:'',
intfUrlParam:'',
seq:'',
data: {
editChainSupplierCatalogInfo: {
catalogId: '',
catalogName: '',
csId: '',
intfUrlParam: '',
seq: '',
}
},
_initMethod:function(){
_initMethod: function () {
},
_initEvent:function(){
vc.on('editChainSupplierCatalog','openEditChainSupplierCatalogModal',function(_params){
},
_initEvent: function () {
vc.on('editChainSupplierCatalog', 'openEditChainSupplierCatalogModal', function (_params) {
vc.component.refreshEditChainSupplierCatalogInfo();
$('#editChainSupplierCatalogModel').modal('show');
vc.copyObject(_params, vc.component.editChainSupplierCatalogInfo );
vc.copyObject(_params, vc.component.editChainSupplierCatalogInfo);
vc.component.editChainSupplierCatalogInfo.communityId = vc.getCurrentCommunity().communityId;
});
},
methods:{
editChainSupplierCatalogValidate:function(){
return vc.validate.validate({
editChainSupplierCatalogInfo:vc.component.editChainSupplierCatalogInfo
},{
'editChainSupplierCatalogInfo.catalogName':[
{
limit:"required",
param:"",
errInfo:"分类名称不能为空"
methods: {
editChainSupplierCatalogValidate: function () {
return vc.validate.validate({
editChainSupplierCatalogInfo: vc.component.editChainSupplierCatalogInfo
}, {
'editChainSupplierCatalogInfo.catalogName': [
{
limit: "required",
param: "",
errInfo: "分类名称不能为空"
},
{
limit:"maxLength",
param:"30",
errInfo:"供应商分类名称不能超过32"
{
limit: "maxLength",
param: "30",
errInfo: "供应商分类名称不能超过32"
},
],
'editChainSupplierCatalogInfo.csId':[
{
limit:"required",
param:"",
errInfo:"供应商ID不能为空"
'editChainSupplierCatalogInfo.csId': [
{
limit: "required",
param: "",
errInfo: "供应商ID不能为空"
},
{
limit:"maxLength",
param:"32",
errInfo:"供应商ID不能为空"
{
limit: "maxLength",
param: "32",
errInfo: "供应商ID不能为空"
},
],
'editChainSupplierCatalogInfo.intfUrlParam':[
{
limit:"required",
param:"",
errInfo:"对端接口参数不能为空"
'editChainSupplierCatalogInfo.intfUrlParam': [
{
limit: "required",
param: "",
errInfo: "对端接口参数不能为空"
},
{
limit:"maxLength",
param:"64",
errInfo:"对端接口参数不能为空"
{
limit: "maxLength",
param: "64",
errInfo: "对端接口参数不能为空"
},
],
'editChainSupplierCatalogInfo.seq':[
{
limit:"required",
param:"",
errInfo:"排序不能为空"
'editChainSupplierCatalogInfo.seq': [
{
limit: "required",
param: "",
errInfo: "排序不能为空"
},
{
limit:"maxLength",
param:"10",
errInfo:"排序不能为空"
{
limit: "maxLength",
param: "10",
errInfo: "排序不能为空"
},
],
'editChainSupplierCatalogInfo.catalogId':[
{
limit:"required",
param:"",
errInfo:"供应商分类ID不能为空"
'editChainSupplierCatalogInfo.catalogId': [
{
limit: "required",
param: "",
errInfo: "供应商分类ID不能为空"
}]
});
},
editChainSupplierCatalog:function(){
if(!vc.component.editChainSupplierCatalogValidate()){
});
},
editChainSupplierCatalog: function () {
if (!vc.component.editChainSupplierCatalogValidate()) {
vc.toast(vc.validate.errInfo);
return ;
return;
}
vc.http.apiPost(
'chainSupplierCatalog.updateChainSupplierCatalog',
JSON.stringify(vc.component.editChainSupplierCatalogInfo),
{
emulateJSON:true
},
function(json,res){
emulateJSON: true
},
function (json, res) {
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
let _json = JSON.parse(json);
if (_json.code == 0) {
//关闭model
$('#editChainSupplierCatalogModel').modal('hide');
vc.emit('chainSupplierCatalogManage','listChainSupplierCatalog',{});
return ;
vc.emit('chainSupplierCatalogManage', 'listChainSupplierCatalog', {});
return;
}
vc.message(_json.msg);
},
function(errInfo,error){
},
function (errInfo, error) {
console.log('请求失败处理');
vc.message(errInfo);
});
});
},
refreshEditChainSupplierCatalogInfo:function(){
vc.component.editChainSupplierCatalogInfo= {
catalogId:'',
catalogName:'',
csId:'',
intfUrlParam:'',
seq:'',
refreshEditChainSupplierCatalogInfo: function () {
vc.component.editChainSupplierCatalogInfo = {
catalogId: '',
catalogName: '',
csId: '',
intfUrlParam: '',
seq: '',
}
}
}
});
})(window.vc,window.vc.component);
})(window.vc, window.vc.component);