liuhairui 3 лет назад
Родитель
Сommit
f56ad3c9e8

+ 113 - 46
public/assets/js/backend/dashboard.js

@@ -4,62 +4,129 @@ define(['jquery', 'bootstrap', 'backend', 'addtabs', 'table', 'echarts', 'echart
         index: function () {
             // 基于准备好的dom,初始化echarts实例
             var myChart = Echarts.init(document.getElementById('echart'), 'walden');
-
-            // 指定图表的配置项和数据
+            // console.log(myChart);
+            //
+            // // $.ajax({
+            // //     type: 'post',
+            // //     //传输类型
+            // //     async: false,
+            // //     //同步执行
+            // //     url: 'Dashboard/ecDashboard',
+            // //     //web.xml中注册的Servlet的url-pattern
+            // //     data: {},
+            // //     dataType: 'json',
+            // //         //返回数据形式为json
+            // //         success: function(result) {
+            // //             console.log(result);
+            // //         },
+            // //         // error:function(errorMsg) {
+            // //         //     alert("加载数据失败");
+            // //         // }
+            // // });//AJAX
+            //
+            // // 指定图表的配置项和数据
             var option = {
                 title: {
-                    text: '',
-                    subtext: ''
+                    text: '订单趋势图表'
                 },
-                color: [
-                    "#18d1b1",
-                    "#3fb1e3",
-                    "#626c91",
-                    "#a0a7e6",
-                    "#c4ebad",
-                    "#96dee8"
-                ],
                 tooltip: {
-                    trigger: 'axis'
+                    trigger: 'axis',
                 },
-                legend: {
-                    data: [__('Register user')]
+                // toolbox: {//图片下载
+                //     feature: {
+                //         saveAsImage: {}
+                //     }
+                // },
+                grid: {//图表大小
+                    left: '3%',
+                    right: '4%',
+                    bottom: '3%',
+                    containLabel: true
                 },
-                toolbox: {
-                    show: false,
-                    feature: {
-                        magicType: {show: true, type: ['stack', 'tiled']},
-                        saveAsImage: {show: true}
+                xAxis: [
+                    {
+                        type: 'category',
+                        boundaryGap: false,
+                        data: Config.column//日期
                     }
-                },
-                xAxis: {
-                    type: 'category',
-                    boundaryGap: false,
-                    data: Config.column
-                },
-                yAxis: {},
-                grid: [{
-                    left: 'left',
-                    top: 'top',
-                    right: '10',
-                    bottom: 30
-                }],
-                series: [{
-                    name: __('Register user'),
-                    type: 'line',
-                    smooth: true,
-                    areaStyle: {
-                        normal: {}
-                    },
-                    lineStyle: {
-                        normal: {
-                            width: 1.5
-                        }
+                ],
+                yAxis: [
+                    {
+                        type: 'value'
+                    }
+                ],
+                series: [
+                    {
+                        name: '订单',
+                        type: 'line',
+                        stack: 'Total',
+                        // label: {//显示数据文字
+                        //     show: true,
+                        //     position: 'top'
+                        // },
+                        areaStyle: {},
+                        emphasis: {
+                            focus: 'series'
+                        },
+                        data: [120, 132, 101, 134, 90, 230, 210]
                     },
-                    data: Config.userdata
-                }]
+                ]
             };
 
+            // var option = {
+            //     title: {
+            //         text: '',
+            //         subtext: ''
+            //     },
+            //     color: [
+            //         "#18d1b1",
+            //         "#3fb1e3",
+            //         "#626c91",
+            //         "#a0a7e6",
+            //         "#c4ebad",
+            //         "#96dee8"
+            //     ],
+            //     tooltip: {
+            //         trigger: 'axis'
+            //     },
+            //     legend: {
+            //         data: [__('Register user')]
+            //     },
+            //     toolbox: {
+            //         show: false,
+            //         feature: {
+            //             magicType: {show: true, type: ['stack', 'tiled']},
+            //             saveAsImage: {show: true}
+            //         }
+            //     },
+            //     xAxis: {
+            //         type: 'category',
+            //         boundaryGap: false,
+            //         data: Config.column
+            //     },
+            //     yAxis: {},
+            //     grid: [{
+            //         left: 'left',
+            //         top: 'top',
+            //         right: '10',
+            //         bottom: 30
+            //     }],
+            //     series: [{
+            //         name: __('Register user'),
+            //         type: 'line',
+            //         smooth: true,
+            //         areaStyle: {
+            //             normal: {}
+            //         },
+            //         lineStyle: {
+            //             normal: {
+            //                 width: 1.5
+            //             }
+            //         },
+            //         data: Config.userdata
+            //     }]
+            // };
+
             // 使用刚指定的配置项和数据显示图表。
             myChart.setOption(option);
 

+ 12 - 0
public/assets/js/backend/feeding.js

@@ -49,9 +49,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','jQuery.print','jquery
             var num=0;
             $('#c-bach').keydown((e)=>{
                 let key = e.which;
+                console.log(key)
                 if(key == 13){
                     if(num === 0){
                         var bach = $("#c-bach").val();
+                        console.log(bach)
                         if (bach == ''){
                             layer.confirm('批次号不能为空,请输入批次号');return false;
                         }
@@ -60,6 +62,16 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','jQuery.print','jquery
                             data:{bach:bach},//批次号
                             url:"feeding/get_task",
                             success(res){
+                                if(res.code == 0){
+                                    layer.confirm(res.msg,{
+                                        title:['信息'],
+                                        area:['80%','60%'],
+                                    });
+                                    var msg = new SpeechSynthesisUtterance(res.msg);
+                                    window.speechSynthesis.speak(msg);
+                                    return false;
+                                    // layer.confirm(res.msg);return false;
+                                }
                                 $("#table").append("<input id='name' type='hidden' value='"+res.data[0].name+"'>");
                                 //批次号重复/做下拉选择
                                 if(res.data.length>1){

+ 3 - 1
public/assets/js/backend/formula.js

@@ -11,7 +11,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                     del_url: 'formula/del',
                     multi_url: 'formula/multi',
                     import_url: 'formula/import',
-                    table: 'formula',
+                    table: 'formula', 
                 }
             });
 
@@ -389,6 +389,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                     var number = $('#c-number').val();
                     var remark = $('#c-remark').val();
                     var mid = $('#c-mid').val();
+                    var oid = $('#c-order-uncompleted').val();
                     if (verify == -1){
                         layer.confirm("数据格式不对,请仔细核查!");return false;
                     }
@@ -402,6 +403,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                     baseData.push(number);
                     baseData.push(remark);
                     baseData.push(mid);
+                    baseData.push(oid);
                     Fast.api.ajax({
                         url:'formula/task?ids='+ids,
                         data:{baseData:baseData}

+ 6 - 6
public/assets/js/backend/product.js

@@ -108,8 +108,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','jQuery.print'], funct
                             str += "<tr class='tablestr"+i+" tablestr'><td><input class='form-control' type='text' name='row[batch][]' readonly value='"+res.bach+"'></td>";
                             str += "<td><input class='form-control' type='text' name='row[pname][]' readonly value='"+res.pname+"'></td>";
                             str += "<td><input class='form-control' type='text' name='row[material][]' readonly value='"+res.material+"'></td>";
-                            str += "<td><input class='form-control' type='number' name='row[weight][]' data-rule='required' value=''></td>";
-                            str += "<td><input class='form-control' type='text' name='row[specifications][]' value='"+ (res.specifications?res.specifications:'')+"'></td>";
+                            // str += "<td><input class='form-control' type='number' name='row[weight][]' data-rule='required' value=''></td>";
+                            // str += "<td><input class='form-control' type='text' name='row[specifications][]' value='"+ (res.specifications?res.specifications:'')+"'></td>";
                             str += "<td><input class='form-control' type='text' name='row[unit][]'  value=''></td>";
                             str += "<td><input class='form-control' type='text' name='row[time][]' readonly value='"+res.time+"'></td>";
                             str += "<input type='hidden' value='"+i+"'>";
@@ -120,8 +120,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','jQuery.print'], funct
                                         <td>${res.pname}</td>
                                         <td>${res.material}</td>
                                         <td></td>
-                                        <td>${res.specifications}</td>
-                                        <td></td>
+                                        <!--<td>${res.specifications}</td>-->
+                                        <!--<td></td>-->
                                     </tr>`;
                             //写入页面
                             $("#print_gy").append(html);
@@ -186,8 +186,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','jQuery.print'], funct
                         var weight =  $(".tablestr:eq("+i+")").children("tr td:eq(3)").children().val();
                         var specifications =  $(".tablestr:eq("+i+")").children("tr td:eq(4)").children().val();
                         var unit =  $(".tablestr:eq("+i+")").children("tr td:eq(5)").children().val();
-                        $(".print:eq("+i+")").children("tr td:eq(3)").html(weight);
-                        $(".print:eq("+i+")").children("tr td:eq(4)").html(specifications);
+                        // $(".print:eq("+i+")").children("tr td:eq(3)").html(weight);
+                        // $(".print:eq("+i+")").children("tr td:eq(4)").html(specifications);
                         $(".print:eq("+i+")").children("tr td:eq(5)").html(unit);
                     }
                     if(!$("#c-pickor").val()){

+ 1 - 0
public/assets/js/backend/task.js

@@ -30,6 +30,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {field: 'bach', title: __('Bach'), operate: 'LIKE'},
                         {field: 'drawer_name', title: __('Drawer_name'), operate: 'LIKE'},
                         {field: 'examine_name', title: __('Examine_name'), operate: 'LIKE'},
+                        {field: 'machine', title: __('Machine'), operate: 'LIKE'},
                         {field: 'number', title: __('Number'), operate: 'LIKE'},
                         {field: 'remark', title: __('Remark'), operate: 'LIKE'},
                         {field: 'fid', title: __('Fid')},