| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'picking/index' + location.search,
- add_url: 'picking/add',
- edit_url: 'picking/edit',
- del_url: 'picking/del',
- multi_url: 'picking/multi',
- table: 'picking',
- }
- });
- var table = $("#table");
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 'id',
- sortName: 'id',
- columns: [
- [
- {checkbox: true},
- {field: 'id', title: __('Id')},
- {field: 'picking', title: __('领料单编码')},
- {field: 'order', title: __('工单编号')},
- {field: 'matter', title: __('原墨名称')},
- {field: 'code', title: __('存货编码')},
- {field: 'weight', title: __('重量(kg)')},
- {field: 'create', title: __('创建时间')},
- {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
- ]
- ],
- showToggle:false,
- showColumns:false,
- showExport:false,
- // search: false,
- commonSearch: false,
- //可以控制是否默认显示搜索单表,false则隐藏,默认为false
- searchFormVisible: false,
- });
- // 为表格绑定事件
- Table.api.bindevent(table);
- },
- add: function () {
- Controller.api.bindevent();
- },
- edit: function () {
- Controller.api.bindevent();
- },
- order: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'picking/order' + location.search,
- add_url: 'picking/add',
- table: 'picking',
- }
- });
- var table = $("#table");
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 'id',
- sortName: 'Gy0_sbbh',
- columns: [
- [
- {checkbox: true,},
- {field: 'Gd_gdbh', title: __('工单编号'),},
- {field: 'Gd_cpmc', title: __('产品名称'),operate:false},
- {field: 'gd_statu', title: __('工单状态'),operate:false},
- {field: 'Gy0_sbbh', title: __('机台')},
- {field: 'Gy0_sj1', title: __('生产时间安排(开始)'),operate:false},
- {field: 'Gy0_sj2', title: __('生产时间安排(结束)'),operate:false},
- // {field: 'operate', title: __('操作'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
- ]
- ],
- showToggle:false,
- showColumns:false,
- showExport:false,
- // search: false,
- // commonSearch: false,
- //可以控制是否默认显示搜索单表,false则隐藏,默认为false
- // searchFormVisible: false,
- pageSize: 50,
- });
- $("#button").on("click",function(){
- var temp=table.bootstrapTable('getSelections');
- var ids = '';
- for (i=0;i<temp.length;i++){
- ids += temp[i].id+',';
- }
- if (ids == ''){
- return false;
- }
- Fast.config.openArea = ['100%','100%'];
- //发送给控制器
- Fast.api.open("Picking/picking?temp="+ids, "生成领料单", {
- });
-
- });
- $("#urgent").on("click",function () {
- var html = '';
- html+= '<div className="form-group" style="margin-left: 15px;margin-top: 15px;">';
- html+= '<label className="control-label col-xs-12 col-sm-2">请输入工单号(多个工单请用英文逗号隔开):</label>';
- html+= '<div className="col-xs-12 col-sm-8"><input className="form-control" id="order" name="" type="text" value="" data-rule="number" style="width: 350px"> </div>';
- html+= '<div class="form-group layer-footer" style="margin: 50px 0 0 50px"><button type="submit" class="btn btn-success btn-embossed sure" style="margin-left: 90px;">确定</button></div>';
- html+= '</div>';
- layer.open({
- type: 1,
- skin: 'layui-layer-rim', //加上边框
- area: ['420px', '240px'], //宽高
- content: html
- })
- })
- $(document).on('click','.sure',function (){
- var order = document.getElementById('order').value;
- if (order == ''){
- return false;
- }
- layer.close(layer.index);
- Fast.config.openArea = ['100%','100%'];
- //发送给控制器
- Fast.api.open("Picking/picking?temp="+order, "生成领料单", {
- });
- })
- // 为表格绑定事件
- Table.api.bindevent(table);
- },
- api: {
- bindevent: function () {
- Form.api.bindevent($("form[role=form]"));
- }
- }
- };
- return Controller;
- });
|