发布测试版 2.5.0

This commit is contained in:
2021-11-28 12:06:10 +08:00
parent 672cc966db
commit 8408038188
807 changed files with 94347 additions and 47563 deletions
@@ -1,99 +0,0 @@
<style>
html {
overflow: hidden;
}
.form-panel-header {
box-shadow: none;
}
.product_formula_form {
margin-top: 50px;
}
.content-body {
margin: 0;
}
.ag-theme-balham .ag-root {
border-bottom: 0;
}
.form-panel {
background-color: transparent;
}
</style>
<div class="form-panel" id="tab-content-product_formula">
<div class="form-panel-header">
<a data-toggle="dialog-view" data-url="product/product/dialog" data-form_id="product_formula" data-id="product_id" data-name="product_name" data-title="产品" data-is_grid="1" data-multi="1" class="btn btn-sm btn-default"><i class="fa fa-plus-circle"></i> 添加</a>
<a class="btn btn-default btn-sm" id="product_formula_delete"><i class="fa fa-times"></i> 删除</a>
<a class="btn btn-default btn-sm" id="product_formula-form-submit"><i class="fa fa-check"></i> 保存</a>
<a data-toggle="layer-frame-close" class="btn btn-default btn-sm"><i class="fa fa-sign-out"></i> 退出</a>
</div>
<form class="product_formula_form" method="post" action="{{url('configSave')}}" id="product_formula" name="product_formula">
<div id="grid_product_formula" style="width:100%;" class="ag-theme-balham"></div>
<input type="hidden" name="id" value="{{$id}}">
</form>
</div>
<script>
(function($) {
var id = '{{$id}}';
var options = {
title:'',
master: 'product_formula',
table: 'product_formula',
heightTop: 0
};
options.columns = [
{field:"id",hide:true},
{hide:true,field:"product_id"},
{hide:true,field:"material_id"},
{cellClass:"text-center",headerName:"存货编码",width:120,field:"product_code"},
{suppressNavigable: false, headerName:"产品名称",editable:true,width:220,cellEditorParams:{form_type:"dialog",title:"产品",type:"product",field:"product_name",url:"product/product/dialog",query:{form_id:"product_formula",id:"product_id",name:"product_name"}},cellEditor:"dialogCellEditor",field:"product_name"},
{cellClass:"text-center",headerName:"规格型号",width:120,field:"product_spec"},
{cellClass:"text-center",headerName:"计量单位",width:80,field:"product_unit"},
{suppressNavigable: false, type:'number', cellClass:"text-right",headerName:"用量",editable:true,width:80,field:"quantity"},
{suppressNavigable: false, type:'number', cellClass:"text-right",headerName:"出品率",editable:true,width:80,field:"ratio"},
];
options.links = {
product_id: {
product_id:'id',
product_code:"code",
product_name:"name",
product_spec:"spec",
product_unit:"unit_id_name",
}
};
var grid = gridForm("product_formula", options);
grid.dataKey = 'product_id';
grid.remoteDataUrl = '{{url()}}';
grid.remoteParams = {id: id};
gdoo.event.set('product_formula.product_id', {
query(query) {
},
onSelect() {
return true;
}
});
grid.remoteData();
$('#product_formula_delete').on('click', function() {
var rows = grid.api.getSelectedRows();
if (rows.length > 0) {
grid.api.deleteRow({id: rows[0].id});
}
});
ajaxSubmit('product_formula', function(res) {
if (res.status) {
toastrSuccess(res.data);
location.reload();
} else {
toastrError(res.data);
}
});
formGridList['product_formula'] = [grid];
gdoo.forms[product_formula] = grid;
})(jQuery);
</script>
@@ -1,4 +0,0 @@
<form class="form-horizontal form-controller" method="post" id="{{$form['table']}}" name="{{$form['table']}}">
{{$form['tpl']}}
</form>
@@ -1,64 +0,0 @@
<div class="gdoo-list-page" id="{{$header['master_table']}}-page">
<div class="gdoo-list panel">
<div class="gdoo-list-header">
<gdoo-grid-header :header="header" :grid="grid" :action="action" />
</div>
<div class='gdoo-list-grid'>
<div id="{{$header['master_table']}}-grid" class="ag-theme-balham"></div>
</div>
</div>
</div>
<script>
Vue.createApp({
components: {
gdooGridHeader,
},
setup(props, ctx) {
var table = '{{$header["master_table"]}}';
var config = new gdoo.grid(table);
var grid = config.grid;
grid.remoteDataUrl = '{{url()}}';
grid.autoColumnsToFit = true;
var action = config.action;
// 双击行执行的方法
action.rowDoubleClick = action.edit;
action.config = function() {
var me = this;
var grid = config.grid;
var rows = grid.api.getSelectedRows();
if (rows.length == 1) {
var data = rows[0];
var url = app.url('produce/material/config', {id: data.id});
layer.open({
title: false,
area: ['100%', '100%'],
skin: 'layui-layer-gdoo',
scrollbar: false,
closeBtn: false,
type: 2,
content: url,
});
} else {
toastrError('只能修改一条数据。');
}
}
var setup = config.setup;
Vue.onMounted(function() {
var gridDiv = config.div(136);
// 初始化数据
grid.remoteData({page: 1}, function(res) {
config.init(res);
});
});
return setup;
}
}).mount("#{{$header['master_table']}}-page");
</script>
@@ -47,12 +47,12 @@
var table = 'material_plan';
var search = JSON.parse('{{json_encode($search)}}');
var cols = [
{field: "product_name", headerName: "成品品种", sortable: false, suppressMenu: true, width: 140, rowSpan: rowSpan, cellClassRules: cellClassRules},
{field: "product_name", headerName: "成品名称", sortable: false, suppressMenu: true, width: 140, rowSpan: rowSpan, cellClassRules: cellClassRules},
{field: "product_spec", headerName: "规格型号", sortable: false, suppressMenu: true, cellClass: "text-center", width: 120, rowSpan: rowSpan, cellClassRules: cellClassRules},
{field: "product_unit", headerName: "计量单位", sortable: false, suppressMenu: true, cellClass: "text-center", width: 60, rowSpan: rowSpan, cellClassRules: cellClassRules},
{field: "product_num", headerName: "计划数量", sortable: false, suppressMenu: true, cellClass: "text-right", width: 80, rowSpan: rowSpan, cellClassRules: cellClassRules},
{field: "category_name", headerName: "品种", sortable: false, suppressMenu: true, width: 140},
{field: "material_name", headerName: "名称", sortable: false, suppressMenu: true, width: 100},
{field: "category_name", headerName: "物料分类", sortable: false, suppressMenu: true, width: 140},
{field: "material_name", headerName: "物料名称", sortable: false, suppressMenu: true, width: 100},
{field: "material_num", headerName: "数量", sortable: false, suppressMenu: true, cellClass: "text-right", calcFooter: "sum", type: "number", width: 60},
{field: "total_num", headerName: "计划用料数量", sortable: false, suppressMenu: true, cellClass: "text-right", calcFooter: "sum", type: "number", width: 70},
{field: "remark", headerName: "备注", sortable: false, suppressMenu: true, cellClass: "text-right", calcFooter: "sum", type: "number", width: 70}
@@ -61,7 +61,7 @@
var grid = new agGridOptions();
grid.suppressRowTransform = true;
var gridDiv = document.querySelector("#material_plan-grid");
gridDiv.style.height = getPanelHeight(48);
gridDiv.style.height = getPanelHeight(12);
grid.remoteDataUrl = '{{url()}}';
grid.remoteParams = search.query;
@@ -24,8 +24,8 @@ var params = JSON.parse('{{json_encode($query)}}');
grid.columnDefs = [
{cellClass:'text-center', headerName: '', field: 'sn', type: 'sn', suppressSizeToFit: true, width: 40},
{cellClass:'text-left', field: 'product_name', headerName: '产品名称', width: 140},
{cellClass:'text-center', field: 'category_name', headerName: '品种', width: 120},
{cellClass:'text-center', field: 'material_name', headerName: '名称', width: 100},
{cellClass:'text-center', field: 'category_name', headerName: '物料分类', width: 120},
{cellClass:'text-center', field: 'material_name', headerName: '物料名称', width: 100},
{cellClass:'text-right', field:'material_num', headerName: '数量', width: 80, calcFooter: "sum", type: "number"},
{cellClass:'text-right', field:'total_num', headerName: '计划用料数量', width: 100, calcFooter: "sum", type: "number"},
];
@@ -24,8 +24,8 @@ var params = JSON.parse('{{json_encode($query)}}');
grid.defaultColDef.sortable = false;
grid.columnDefs = [
{cellClass:'text-center', headerName: '', field: 'sn', type: 'sn', suppressSizeToFit: true, width: 40},
{cellClass:'text-left', field: 'category_name', headerName: '品种', width: 100},
{cellClass:'text-left', field: 'material_name', headerName: '名称', width: 80},
{cellClass:'text-left', field: 'category_name', headerName: '物料分类', width: 100},
{cellClass:'text-left', field: 'material_name', headerName: '物料名称', width: 80},
{cellClass:'text-right', field:'material_num', headerName: '数量', width: 80, calcFooter: "sum", type: "number"},
{cellClass:'text-right', field:'total_num', headerName: '计划用料数量', width: 80, calcFooter: "sum", type: "number"},
];
@@ -1,90 +0,0 @@
<div class="form-panel">
<div class="form-panel-header">
<a data-toggle="dialog-view" data-url="product/product/dialog" data-form_id="product_formula" data-id="product_id" data-name="product_name" data-title="产品" data-is_grid="1" data-multi="1" class="btn btn-sm btn-default"><i class="fa fa-plus-circle"></i> 添加</a>
<a class="btn btn-default btn-sm" id="product_formula_delete"><i class="fa fa-times"></i> 删除</a>
<a class="btn btn-default btn-sm" id="product_formula-form-submit"><i class="fa fa-check"></i> 保存</a>
<a data-toggle="layer-frame-close" class="btn btn-default btn-sm"><i class="fa fa-sign-out"></i> 退出</a>
</div>
<form class="product_formula_form" method="post" action="{{url('configSave')}}" id="product_formula" name="product_formula">
<div id="grid_product_formula" style="width:100%;" class="ag-theme-balham"></div>
<input type="hidden" name="id" value="{{$id}}">
</form>
</div>
<style>
.form-panel-header {
box-shadow: none;
}
.product_formula_form {
margin-top: 50px;
}
.content-body {
margin: 0;
}
</style>
<script>
(function($) {
var id = '{{$id}}';
var options = {
title:'',
master: 'product_formula',
table: 'product_formula',
heightTop: 0
};
options.columns = [
{field:"id",hide:true},
{hide:true,field:"product_id"},
{hide:true,field:"material_id"},
{cellClass:"text-center",headerName:"存货编码",width:120,field:"product_code"},
{suppressNavigable: false, headerName:"产品名称",editable:true,width:220,cellEditorParams:{form_type:"dialog",title:"产品",type:"product",field:"product_name",url:"product/product/dialog",query:{form_id:"product_formula",id:"product_id",name:"product_name"}},cellEditor:"dialogCellEditor",field:"product_name"},
{cellClass:"text-center",headerName:"规格型号",width:120,field:"product_spec"},
{cellClass:"text-center",headerName:"计量单位",width:80,field:"product_unit"},
{suppressNavigable: false, cellClass:"text-right",headerName:"用量",editable:true,width:80,field:"quantity"},
{suppressNavigable: false, cellClass:"text-right",headerName:"出品率",editable:true,width:80,field:"ratio"},
];
options.links = {
product_id: {
product_id:'id',
product_code:"code",
product_name:"name",
product_spec:"spec",
product_unit:"unit_id_name",
}
};
var grid = gridForm("product_formula", options);
grid.dataKey = 'product_id';
grid.remoteDataUrl = '{{url()}}';
grid.remoteParams = {id: id};
gdoo.event.set('product_formula.product_id', {
query(query) {
},
onSelect() {
return true;
}
});
grid.remoteData();
$('#product_formula_delete').on('click', function() {
var rows = grid.api.getSelectedRows();
if (rows.length > 0) {
grid.api.deleteRow({id: rows[0].id});
}
});
ajaxSubmit('product_formula', function(res) {
if (res.status) {
toastrSuccess(res.data);
location.reload();
} else {
toastrError(res.data);
}
});
formGridList['product_formula'] = [grid];
gdoo.forms[product_formula] = grid;
})(jQuery);
</script>
@@ -34,7 +34,7 @@
var search = JSON.parse('{{json_encode($search)}}');
var cols = [
{field: "sn", cellClass: "text-center", suppressSizeToFit: true, headerName: "", type: 'sn', width: 40},
{field: "product_name", headerName: "成品品种", sortable: false, suppressMenu: true, width: 140},
{field: "product_name", headerName: "成品名称", sortable: false, suppressMenu: true, width: 140},
{field: "product_spec", headerName: "规格型号", sortable: false, suppressMenu: true, cellClass: "text-center", width: 120},
{field: "product_unit", headerName: "计量单位", sortable: false, suppressMenu: true, cellClass: "text-center", width: 60},
{field: "plan_num", headerName: "计划数量", sortable: false, suppressMenu: true, cellClass: "text-right", width: 80},
@@ -46,7 +46,7 @@
var grid = new agGridOptions();
grid.suppressRowTransform = true;
var gridDiv = document.querySelector("#material_plan-grid");
gridDiv.style.height = getPanelHeight(48);
gridDiv.style.height = getPanelHeight(12);
grid.remoteDataUrl = '{{url()}}';
grid.remoteParams = search.query;