瀏覽代碼

油墨电子秤优化

liuhairui 1 年之前
父節點
當前提交
b9f5accdcd

+ 1 - 1
application/admin/controller/Formula.php

@@ -461,7 +461,7 @@ class Formula extends Backend
             }
             $this->view->assign('erro',$erro);
 
-            $list['gyinfo'] = Db::name('formula_detail')->where('pid',$ids)->where('version',$list['version'])->field('id,material,percentage,gy_name,gy_num')->select();
+            $list['gyinfo'] = Db::name('formula_detail')->where('pid',$ids)->where('version',$list['version'])->field('id,material,percentage,gy_name,gy_num,version')->select();
 
             foreach ($list['gyinfo'] as $key=>$value){
                 $list['gyinfo'][$key]['percentage'] = decode($value['percentage']);

+ 2 - 2
application/admin/view/feeding/add.html

@@ -41,14 +41,14 @@
 
                 <label style="width: 90px; margin-left: 10px;">操作人员</label>
                 <select style="text-align: left; flex-grow: 1; width: 35%; margin: 0 auto; padding: 0px;" id="c-operator" class="control-label col-xs-12 col-sm-8 form-control" name="row[operator]">
-                    <option value="车间二号机">车间二号机</option>
+                    <option value="丙类车间">丙类车间</option>
                     {foreach $cjcz as $key=>$vv}
                     <option value="{$vv.name}">{$vv.name}</option>
                     {/foreach}
                 </select>
                 <label style="width: 90px; margin-left: 10px;">检验人员</label>
                 <select style="text-align: left; flex-grow: 1; width: 35%; margin: 0 auto; padding: 0px;" id="c-inspector" class="control-label col-xs-12 col-sm-8 form-control" name="row[inspector]">
-                    <option value="车间二号机">车间二号机</option>
+                    <option value="丙类车间">丙类车间</option>
                     {foreach $cjjy as $key=>$vvv}
                     <option value="{$vvv.name}">{$vvv.name}</option>
                     {/foreach}

+ 1 - 1
application/admin/view/formula/add.html

@@ -87,7 +87,7 @@
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-1">工艺信息:</label>
         <div id="nav" class="col-xs-12 col-sm-3">
-            <input id="add_material" class="form-control"  type="text" value="" placeholder="请输入原材料">
+            <input id="add_material" class="form-control"  type="text" value="" placeholder="请输入原材料,如多个原材料用/代替 列如:M-501/M-502">
         </div>
         <div class="col-xs-12 col-sm-3">
             <input id="add_percentage" class="form-control"  type="text" value="" placeholder="请输入百分比(%)">

+ 66 - 27
application/admin/view/formula/task.html

@@ -5,7 +5,8 @@
     .tg th{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
         font-weight:normal;overflow:hidden;padding:10px 5px;word-break:normal;}
     .tg .tg-ub5w{font-size:36px;text-align:center;vertical-align:middle;border: none}
-    .tg .tg-x1hj{font-size:22px;text-align:left;vertical-align:top;}
+    /*.tg .tg-x1hj{font-size:22px;text-align:left;vertical-align:top;}*/
+    .tg .tg-x1hj{font-size:22px;text-align:left;}
     .tg .tg-kghl{font-size:22px;text-align:left;vertical-align:middle;}
     .tg .tg-z7m5{font-size:22px;text-align:left;text-decoration:underline;vertical-align:top;border: none}
     .tg .tg-s5vw{font-size:22px;font-weight:bold;text-align:center;vertical-align:bottom;border: none}
@@ -127,50 +128,88 @@
         </table>
     </div>
     <!--===========================================================-->
-    <!--<div style="padding: 1000px 0 0 0">-->
-    <div style="display: none">
+    <div style="padding: 1000px 0 0 0">
+<!--    <div style="display: none">-->
         <div class="form-group" id="print_area">
             <div id="head">
+
                 <table class="tg" style="width: 800px;">
                     <thead>
-                    <!--<div id="qrcode" style="margin:0 0 -450px 500px;width: 80px;height: 80px;">-->
-                    <!--<img src="" id="myImage" alt=""/>-->
-                    <!--</div>-->
-                    <!--<div id="qrcode" style="width: 80px;height: 80px;border: 1px pink solid">-->
                     <img src="" id="myImage" class="qrcode" alt="" style="margin:0 0 -130px 500px;"/>
-                    <!--</div>-->
                     <tr>
                         <th class="tg-v8dz" colspan="6" >
-                            <!--<p id="formula_no"></p>-->
-                            <!--<hr style="border: 1px solid;margin-top: -5px">-->
+<!--                            这是二维码的地方-->
                         </th>
                     </tr>
                     </thead>
                     <tbody>
                     <tr>
-                        <td class="tg-s5vw"></td>
-                        <td class="tg-svyg"></td>
-                        <td class="tg-ub5w" colspan="2" rowspan="2">作业票&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
-                        <td class="tg-4qqe"></td>
-                        <td class="tg-s5vw"></td>
-                    </tr>
-                    <tr>
-                        <td class="tg-9d8n" style="border: none">日期:</td>
-                        <td class="tg-z7m5" id="date"></td>
-                        <td class="tg-9d8n">开票人</td>
-                        <td class="tg-9d8n">审核</td>
+                        <td class="tg-9d8n" style="border: none;">日期:</td>
+                        <td class="tg-z7m5" style="border: none; width: 10%;"><span id="date"></span></td>
+                        <td  class="tg-ub5w" style="text-align: center; border: none;">作业票</td>
+                        <td class="tg-x1hj" style="width: 11%;">开票人</td>
+                        <td class="tg-x1hj" style="width: 11%;">审核</td>
                     </tr>
                     <tr>
-                        <td class="tg-9d8n" style="border: none">批号:</td>
-                        <td class="tg-z7m5" id="bach"></td>
-                        <!--<td class="tg-kghl" style="border: none"><input type="text" id="formula" value="" style="width: 400px;text-align: center"></td>-->
-                        <td class="tg-kghl" style="border: none"><textarea type="text" id="formula" value="" disabled style="resize:none;width: 400px;overflow-x:hidden;overflow-y:hidden;height: 80px;text-align: center;font-size: 16px"></textarea></td>
-                        <td class="tg-0pky"></td>
+                        <td class="tg-9d8n" style="border: none;">批号:</td>
+                        <td class="tg-z7m5" style="border: none; width: 10%;"><span id="bach"></span></td>
+                        <td rowspan="2"  style="text-align: center; border: none;">
+                             <textarea type="text" id="formula" disabled style="resize: none; width: 400px; overflow-x: hidden; overflow-y: hidden; height: 78px; text-align: center; font-size: 16px;">
+
+                            </textarea>
+                        </td>
                         <td class="tg-x1hj" id="drawer_name"></td>
                         <td class="tg-x1hj" id="examine_name"></td>
                     </tr>
+                    <tr>
+                        <td class="tg-9d8n" style="width: 14%; border: none;">版本号:</td>
+                        <td class="tg-z7m5" style="border: none; width: 10%;"><span id="version">{$row['version']}</span></td>
+                        <td colspan="2" style="border: none;text-align: center;"> <!-- 将textarea放在新的一行,并跨越两列 -->
+
+                        </td>
+                    </tr>
                     </tbody>
                 </table>
+<!--                <table class="tg" style="width: 800px;">-->
+<!--                    <thead>-->
+<!--                    &lt;!&ndash;<div id="qrcode" style="margin:0 0 -450px 500px;width: 80px;height: 80px;">&ndash;&gt;-->
+<!--                    &lt;!&ndash;<img src="" id="myImage" alt=""/>&ndash;&gt;-->
+<!--                    &lt;!&ndash;</div>&ndash;&gt;-->
+<!--                    &lt;!&ndash;<div id="qrcode" style="width: 80px;height: 80px;border: 1px pink solid">&ndash;&gt;-->
+<!--                    <img src="" id="myImage" class="qrcode" alt="" style="margin:0 0 -130px 500px;"/>-->
+<!--                    &lt;!&ndash;</div>&ndash;&gt;-->
+<!--                    <tr>-->
+<!--                        <th class="tg-v8dz" colspan="6" >-->
+<!--                            &lt;!&ndash;<p id="formula_no"></p>&ndash;&gt;-->
+<!--                            &lt;!&ndash;<hr style="border: 1px solid;margin-top: -5px">&ndash;&gt;-->
+<!--                        </th>-->
+<!--                    </tr>-->
+<!--                    </thead>-->
+<!--                    <tbody>-->
+<!--                    <tr  style="border: 1px yellow solid">-->
+<!--                        <td class="tg-s5vw"></td>-->
+<!--                        <td class="tg-svyg"></td>-->
+<!--                        <td class="tg-ub5w" colspan="2" rowspan="2">作业票&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>-->
+<!--                        <td class="tg-4qqe"></td>-->
+<!--                        <td class="tg-s5vw"></td>-->
+<!--                    </tr>-->
+<!--                    <tr  style="border: 2px blue solid">-->
+<!--                        <td class="tg-9d8n" style="border: none;">日期:</td>-->
+<!--                        <td class="tg-z7m5" id="date"></td>-->
+<!--                        <td class="tg-9d8n">开票人</td>-->
+<!--                        <td class="tg-9d8n">审核</td>-->
+<!--                    </tr>-->
+<!--                    <tr style="border: 3px red solid;padding: 0px;margin: 0px">-->
+<!--                        <td class="tg-9d8n" style="border: none;">批号:</td>-->
+<!--                        <td class="tg-z7m5" id="bach"></td>-->
+<!--                        &lt;!&ndash;<td class="tg-kghl" style="border: none"><input type="text" id="formula" value="" style="width: 400px;text-align: center"></td>&ndash;&gt;-->
+<!--                        <td class="tg-kghl" style="border: none"><textarea type="text" id="formula" value="" disabled style="resize:none;width: 400px;overflow-x:hidden;overflow-y:hidden;height: 80px;text-align: center;font-size: 16px"></textarea></td>-->
+<!--                        <td class="tg-0pky"></td>-->
+<!--                        <td class="tg-x1hj" id="drawer_name"></td>-->
+<!--                        <td class="tg-x1hj" id="examine_name"></td>-->
+<!--                    </tr>-->
+<!--                    </tbody>-->
+<!--                </table>-->
             </div>
             <div style="height: 10px;"></div>
             <div id="body">
@@ -210,7 +249,7 @@
                         <td style="border: none">
                             <span>包装规格:</span>
                             <hr style="border: 1px solid;width: 150px;margin-top: -5px;">
-                            <div style="position: absolute;margin-left: 270px;margin-top: -36px;">KG/桶</div>
+                            <div style="position: absolute;margin-left: 270px;margin-top: -36px;"> KG/桶</div>
                         </td>
                         <td style="border: none">作业票回收日期:<hr style="border: 1px solid;width: 150px;margin-top: -5px;"></td>
                     </tr>

+ 0 - 92
application/api/controller/Index.php

@@ -13,98 +13,6 @@ class Index extends Api{
     /** 首页 **/
     public function index(){$this->success('请求成功');}
 
-    //甲类车间作业票列表
-    public function jl_workshops(){
-        $result = Db::table('mn_task')->alias('t')
-            ->field('
-                t.name,
-                t.bach,
-                t.machine,
-                t.number,
-                t.create,
-                t.kuodan,
-                CASE WHEN f.bach IS NULL THEN \'未投料\' ELSE \'已投料\' END AS fedding_status
-            ')
-            ->join('mn_feeding f','t.bach = f.bach','LEFT')
-            ->where('t.machine', 'like', '%甲类%')
-            ->where('t.create', '>=', date('Y-m-d', strtotime('-7 day')))
-            ->where('t.create', '<=', date('Y-m-d'))
-            ->order('t.create', 'desc')
-            ->select();
-//        echo "<pre>";print_r($result);echo "<pre>";die;
 
-        // 获取数据列定义
-        $list['columns'] = [
-            ['name' => '配方名称', 'id' => 'name', 'width' => '30', 'autoWrap' => "true", 'textAlign' => 'left'],
-            ['name' => '批次号', 'id' => 'bach', 'width' => '15', 'autoWrap' => "true", 'textAlign' => 'left'],
-            ['name' => '机台', 'id' => 'machine', 'width' => '15', 'autoWrap' => "true", 'textAlign' => 'left'],
-            ['name' => '生产量', 'id' => 'number', 'width' => '15', 'autoWrap' => "true", 'textAlign' => 'left'],
-            ['name' => '扩单重量', 'id' => 'kuodan', 'width' => '15', 'autoWrap' => "true", 'textAlign' => 'left'],
-            ['name' => '创建时间', 'id' => 'create', 'width' => '20', 'autoWrap' => "true", 'textAlign' => 'left'],
-            ['name' => '是否投料', 'id' => 'fedding_status', 'width' => '14', 'autoWrap' => "true", 'textAlign' => 'left'],
-        ];
-        foreach ($result as $v) {
-            $list['rows'][] = [
-                'name' => $v['name'],
-                'bach' => $v['bach'],
-                'machine' => $v['machine'],
-                'number' => $v['number'],
-                'kuodan' => $v['kuodan'],
-                'create' => $v['create'],
-                'fedding_status' => $v['fedding_status'],
-            ];
-        }
-        $res['status'] = 0;
-        $res['msg'] = '';
-        $res['data'] = $list;
-        return json($res);
-    }
-
-    //丙类车间作业票列表
-    public function bl_workshops(){
-        $result = Db::table('mn_task')->alias('t')
-            ->field('
-                t.name,
-                t.bach,
-                t.machine,
-                t.number,
-                t.create,
-                t.kuodan,
-                CASE WHEN f.bach IS NULL THEN \'未投料\' ELSE \'已投料\' END AS fedding_status
-            ')
-            ->join('mn_feeding f','t.bach = f.bach','LEFT')
-            ->where('t.machine', 'like', '%丙类%')
-            ->where('t.create', '>=', date('Y-m-d', strtotime('-7 day')))
-            ->where('t.create', '<=', date('Y-m-d'))
-            ->order('t.create', 'desc')
-            ->select();
-//        echo "<pre>";print_r($result);echo "<pre>";die;
-
-        // 获取数据列定义
-        $list['columns'] = [
-            ['name' => '配方名称', 'id' => 'name', 'width' => '30', 'autoWrap' => "true", 'textAlign' => 'left'],
-            ['name' => '批次号', 'id' => 'bach', 'width' => '15', 'autoWrap' => "true", 'textAlign' => 'left'],
-            ['name' => '机台', 'id' => 'machine', 'width' => '15', 'autoWrap' => "true", 'textAlign' => 'left'],
-            ['name' => '生产量', 'id' => 'number', 'width' => '15', 'autoWrap' => "true", 'textAlign' => 'left'],
-            ['name' => '扩单重量', 'id' => 'kuodan', 'width' => '15', 'autoWrap' => "true", 'textAlign' => 'left'],
-            ['name' => '创建时间', 'id' => 'create', 'width' => '20', 'autoWrap' => "true", 'textAlign' => 'left'],
-            ['name' => '是否投料', 'id' => 'fedding_status', 'width' => '14', 'autoWrap' => "true", 'textAlign' => 'left'],
-        ];
-        foreach ($result as $v) {
-            $list['rows'][] = [
-                'name' => $v['name'],
-                'bach' => $v['bach'],
-                'machine' => $v['machine'],
-                'number' => $v['number'],
-                'kuodan' => $v['kuodan'],
-                'create' => $v['create'],
-                'fedding_status' => $v['fedding_status'],
-            ];
-        }
-        $res['status'] = 0;
-        $res['msg'] = '';
-        $res['data'] = $list;
-        return json($res);
-    }
 
 }

+ 329 - 0
application/api/controller/Printingone.php

@@ -0,0 +1,329 @@
+<?php
+namespace app\api\controller;
+use app\common\controller\Api;
+use think\Db;javascript:;
+use Think\Exception;
+/** 首页接口*/
+class Printingone extends Api{
+    protected $noNeedLogin = ['*'];
+    protected $noNeedRight = ['*'];
+
+    /** 首页 */
+    public function index(){$this->success('湖州油墨api接口成功访问');}
+
+    //车间列表表头字段
+    function generateColumns() {
+        return [
+            ['name' => '批次号', 'id' => 'bach', 'width' => '10', 'autoWrap' => "true", 'textAlign' => 'left'],
+            ['name' => '配方名称', 'id' => 'name', 'width' => '20', 'textAlign' => 'left'],
+            ['name' => '机台', 'id' => 'machine', 'width' => '10', 'autoWrap' => "true", 'textAlign' => 'left'],
+            ['name' => '生产量(kg)', 'id' => 'number', 'width' => '10', 'autoWrap' => "true", 'textAlign' => 'left'],
+            ['name' => '扩单重量', 'id' => 'kuodan', 'width' => '13', 'autoWrap' => "true", 'textAlign' => 'left'],
+            ['name' => '创建时间', 'id' => 'create', 'width' => '17', 'autoWrap' => "true", 'textAlign' => 'left'],
+            ['name' => '是否投料', 'id' => 'fedding_status', 'width' => '10', 'autoWrap' => "true",'textAlign' => 'left'],
+        ];
+    }
+
+    // 通用的作业票列表方法
+    public function generateWorkshopList($machineType) {
+        // 获取当前日期
+        $today = date('Y-m-d 23:59:59');
+        // 计算五天前的日期
+        $fiveDaysAgo = date('Y-m-d 00:00:00');
+        $result = Db::connect('minnongyun')->table('mn_task')->alias('t')
+            ->field('
+                t.name,
+                t.bach,
+                t.machine,
+                t.number,
+                t.create,
+                t.kuodan,
+                CASE WHEN f.bach IS NULL THEN \'未投料\' ELSE \'已投料\' END AS fedding_status
+            ')
+            ->join('mn_feeding f','t.bach = f.bach','LEFT')
+            ->where('t.machine', 'like', '%' . $machineType . '%')
+            ->where('t.create', '>=', $fiveDaysAgo)
+            ->where('t.create', '<=', $today)
+            ->group('t.create')
+            ->order('t.create', 'desc')
+            ->select();
+        //echo "<pre>";print_r($result);echo "<pre>";
+
+        $new_result = [];
+        $new_result['columns'] = $this->generateColumns();
+        if (empty($result)) {
+            $res['status'] = 0;
+            $res['msg'] = '';
+            // 手动创建一个空的行数据
+            $new_result['rows'][] = [
+                'name' => '-',
+                'bach' => '-',
+                'machine' => '-',
+                'number' => '-',
+                'kuodan' => '-',
+                'create' => '-',
+                'fedding_status' => '-',
+            ];
+            $res['data'] = $new_result;
+            return json($res);
+        }
+        $color = 'rgb(91, 197, 106)';
+        foreach ($result as $key => $value) {
+            $new_result['rows'][$key]['name'] = $value['name'];
+            $new_result['rows'][$key]['bach'] = '24-'.$value['bach'];
+            $new_result['rows'][$key]['machine'] = mb_substr($value['machine'], 3);
+            $new_result['rows'][$key]['number'] = $value['number'];
+            $new_result['rows'][$key]['kuodan'] = $value['kuodan'];
+            $new_result['rows'][$key]['create'] = $value['create'];
+            $new_result['rows'][$key]['fedding_status'] = $value['fedding_status'];
+            if($value['fedding_status'] == '已投料'){
+                $new_result['rows'][$key]['name_color'] = $color;
+                $new_result['rows'][$key]['bach_color'] = $color;
+                $new_result['rows'][$key]['machine_color'] = $color;
+                $new_result['rows'][$key]['number_color'] = $color;
+                $new_result['rows'][$key]['kuodan_color'] = $color;
+                $new_result['rows'][$key]['create_color'] = $color;
+                $new_result['rows'][$key]['fedding_status_color'] = $color;
+            }
+        }
+        $res['status'] = 0;
+        $res['msg'] = '';
+        $res['data'] = $new_result;
+        return json($res);
+    }
+
+    // 甲类车间作业票列表->接口
+    public function jl_workshops() {
+        return $this->generateWorkshopList('甲类');
+    }
+
+    //甲类作业票数量->接口
+    public function jl_zypsl(){
+        // 获取当前日期
+        $today = date('Y-m-d 23:59:59');
+        // 计算五天前的日期
+        $fiveDaysAgo = date('Y-m-d 00:00:00');
+        $result = Db::connect('minnongyun')->table('mn_task')->alias('t')
+            ->field('
+                t.name,
+                t.bach,
+                t.machine,
+                t.number,
+                t.create,
+                t.kuodan,
+                CASE WHEN f.bach IS NULL THEN \'未投料\' ELSE \'已投料\' END AS fedding_status
+            ')
+            ->join('mn_feeding f','t.bach = f.bach','LEFT')
+            ->where('t.machine', 'like', '%' . '甲类' . '%')
+            ->where('t.create', '>=', $fiveDaysAgo)
+            ->where('t.create', '<=', $today)
+            ->group('t.create')
+            ->order('t.create', 'desc')
+            ->count('t.bach');
+        if($result==[]){
+            $res['data']=[['name'=>'作业票','value'=>0]];
+        }else{
+            $res['data']=[['name'=>'作业票','value'=>$result]];
+        }
+        $res['status']=0;
+        $res['msg']='';
+        return json($res);
+    }
+
+    //甲类未投料数量->接口
+    public function jl_weitsl(){
+        // 获取当前日期
+        $today = date('Y-m-d 23:59:59');
+        // 计算五天前的日期
+        $fiveDaysAgo = date('Y-m-d 00:00:00');
+        $result = Db::connect('minnongyun')->table('mn_task')->alias('t')
+            ->field('
+                t.name,
+                t.bach,
+                t.machine,
+                t.number,
+                t.create,
+                t.kuodan,
+                CASE WHEN f.bach IS NULL THEN \'未投料\' ELSE \'已投料\' END AS fedding_status
+            ')
+            ->join('mn_feeding f','t.bach = f.bach','LEFT')
+            ->where('t.machine', 'like', '%' . '甲类' . '%')
+            ->where('t.create', '>=', $fiveDaysAgo)
+            ->where('t.create', '<=', $today)
+            ->group('t.create')
+            ->order('t.create', 'desc')
+            ->select();
+        $Count = 0;
+        foreach ($result as $item) {
+            if ($item['fedding_status'] === '未投料') {
+                $Count++;
+            }
+        }
+        if($result==[]){
+            $res['data']=[['name'=>'未投料','value'=>0]];
+        }else{
+            $res['data']=[['name'=>'未投料','value'=>$Count]];
+        }
+        $res['status']=0;
+        $res['msg']='';
+        return json($res);
+    }
+
+    //甲类已投料数量->接口
+    public function jl_yitsl(){
+        // 获取当前日期
+        $today = date('Y-m-d 23:59:59');
+        // 计算五天前的日期
+        $fiveDaysAgo = date('Y-m-d 00:00:00');
+        $result = Db::connect('minnongyun')->table('mn_task')->alias('t')
+            ->field('
+                t.name,
+                t.bach,
+                t.machine,
+                t.number,
+                t.create,
+                t.kuodan,
+                CASE WHEN f.bach IS NULL THEN \'未投料\' ELSE \'已投料\' END AS fedding_status
+            ')
+            ->join('mn_feeding f','t.bach = f.bach','LEFT')
+            ->where('t.machine', 'like', '%' . '甲类' . '%')
+            ->where('t.create', '>=', $fiveDaysAgo)
+            ->where('t.create', '<=', $today)
+            ->group('t.create')
+            ->order('t.create', 'desc')
+            ->select();
+        $Count = 0;
+        foreach ($result as $item) {
+            if ($item['fedding_status'] === '已投料') {
+                $Count++;
+            }
+        }
+        if($result==[]){
+            $res['data']=[['name'=>'已投料','value'=>0]];
+        }else{
+            $res['data']=[['name'=>'已投料','value'=>$Count]];
+        }
+        $res['status']=0;
+        $res['msg']='';
+        return json($res);
+    }
+
+
+    // 丙类车间作业票列表->接口
+    public function bl_workshops() {
+        return $this->generateWorkshopList('丙类');
+    }
+
+    //丙类作业票数量->接口
+    public function bl_zypsl(){
+        // 获取当前日期
+        $today = date('Y-m-d 23:59:59');
+        // 计算五天前的日期
+        $fiveDaysAgo = date('Y-m-d 00:00:00');
+        $result = Db::connect('minnongyun')->table('mn_task')->alias('t')
+            ->field('
+                t.name,
+                t.bach,
+                t.machine,
+                t.number,
+                t.create,
+                t.kuodan,
+                CASE WHEN f.bach IS NULL THEN \'未投料\' ELSE \'已投料\' END AS fedding_status
+            ')
+            ->join('mn_feeding f','t.bach = f.bach','LEFT')
+            ->where('t.machine', 'like', '%' . '丙类' . '%')
+            ->where('t.create', '>=', $fiveDaysAgo)
+            ->where('t.create', '<=', $today)
+            ->group('t.create')
+            ->order('t.create', 'desc')
+            ->count('t.bach');
+        if($result==[]){
+            $res['data']=[['name'=>'作业票','value'=>0]];
+        }else{
+            $res['data']=[['name'=>'作业票','value'=>$result]];
+        }
+        $res['status']=0;
+        $res['msg']='';
+        return json($res);
+    }
+
+    //丙类未投料数量->接口
+    public function bl_weitsl(){
+        // 获取当前日期
+        $today = date('Y-m-d 23:59:59');
+        // 计算五天前的日期
+        $fiveDaysAgo = date('Y-m-d 00:00:00');
+        $result = Db::connect('minnongyun')->table('mn_task')->alias('t')
+            ->field('
+                t.name,
+                t.bach,
+                t.machine,
+                t.number,
+                t.create,
+                t.kuodan,
+                CASE WHEN f.bach IS NULL THEN \'未投料\' ELSE \'已投料\' END AS fedding_status
+            ')
+            ->join('mn_feeding f','t.bach = f.bach','LEFT')
+            ->where('t.machine', 'like', '%' . '丙类' . '%')
+            ->where('t.create', '>=', $fiveDaysAgo)
+            ->where('t.create', '<=', $today)
+            ->group('t.create')
+            ->order('t.create', 'desc')
+            ->select();
+        $Count = 0;
+        foreach ($result as $item) {
+            if ($item['fedding_status'] === '未投料') {
+                $Count++;
+            }
+        }
+        if($result==[]){
+            $res['data']=[['name'=>'未投料','value'=>0]];
+        }else{
+            $res['data']=[['name'=>'未投料','value'=>$Count]];
+        }
+        $res['status']=0;
+        $res['msg']='';
+        return json($res);
+    }
+
+    //丙类已投料数量->接口
+    public function bl_yitsl(){
+        // 获取当前日期
+        $today = date('Y-m-d 23:59:59');
+        // 计算五天前的日期
+        $fiveDaysAgo = date('Y-m-d 00:00:00');
+        $result = Db::connect('minnongyun')->table('mn_task')->alias('t')
+            ->field('
+                t.name,
+                t.bach,
+                t.machine,
+                t.number,
+                t.create,
+                t.kuodan,
+                CASE WHEN f.bach IS NULL THEN \'未投料\' ELSE \'已投料\' END AS fedding_status
+            ')
+            ->join('mn_feeding f','t.bach = f.bach','LEFT')
+            ->where('t.machine', 'like', '%' . '丙类' . '%')
+            ->where('t.create', '>=', $fiveDaysAgo)
+            ->where('t.create', '<=', $today)
+            ->group('t.create')
+            ->order('t.create', 'desc')
+            ->select();
+        $Count = 0;
+        foreach ($result as $item) {
+            if ($item['fedding_status'] === '已投料') {
+                $Count++;
+            }
+        }
+        if($result==[]){
+            $res['data']=[['name'=>'已投料','value'=>0]];
+        }else{
+            $res['data']=[['name'=>'已投料','value'=>$Count]];
+        }
+        $res['status']=0;
+        $res['msg']='';
+        return json($res);
+    }
+
+
+}

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

@@ -216,7 +216,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'jQuery.print', 'jque
                         if (dataNum === 0) {
                             // 如果数据是0,设置显示为空
                             $('#dzcshuju').text('');
-                            console.log("显示为空,因为数据是0");
                         } else {
                             // 数据不是0,正常显示数据
                             $('#dzcshuju').text(dataNum);

+ 216 - 0
runtime/temp/12172d2e9ead3ae6416d19705b878ed0.php

@@ -0,0 +1,216 @@
+<?php if (!defined('THINK_PATH')) exit(); /*a:4:{s:82:"D:\phpstudy_pro\WWW\minongyun\public/../application/admin\view\customer\index.html";i:1709714141;s:72:"D:\phpstudy_pro\WWW\minongyun\application\admin\view\layout\default.html";i:1709714141;s:69:"D:\phpstudy_pro\WWW\minongyun\application\admin\view\common\meta.html";i:1709714141;s:71:"D:\phpstudy_pro\WWW\minongyun\application\admin\view\common\script.html";i:1711415624;}*/ ?>
+<!DOCTYPE html>
+<html>
+    <head>
+        <meta charset="utf-8">
+<title><?php echo (isset($title) && ($title !== '')?$title:''); ?></title>
+<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
+<meta name="renderer" content="webkit">
+<meta name="referrer" content="never">
+<meta name="robots" content="noindex, nofollow">
+
+<link rel="shortcut icon" href="/assets/img/favicon.ico" />
+<!-- Loading Bootstrap -->
+<link href="/assets/css/backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.css?v=<?php echo \think\Config::get('site.version'); ?>" rel="stylesheet">
+
+<?php if(\think\Config::get('fastadmin.adminskin')): ?>
+<link href="/assets/css/skins/<?php echo \think\Config::get('fastadmin.adminskin'); ?>.css?v=<?php echo \think\Config::get('site.version'); ?>" rel="stylesheet">
+<?php endif; ?>
+
+<!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
+<!--[if lt IE 9]>
+  <script src="/assets/js/html5shiv.js"></script>
+  <script src="/assets/js/respond.min.js"></script>
+<![endif]-->
+<script type="text/javascript">
+    var require = {
+        config:  <?php echo json_encode($config); ?>
+    };
+</script>
+
+    </head>
+
+    <body class="inside-header inside-aside <?php echo defined('IS_DIALOG') && IS_DIALOG ? 'is-dialog' : ''; ?>">
+        <div id="main" role="main">
+            <div class="tab-content tab-addtabs">
+                <div id="content">
+                    <div class="row">
+                        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
+                            <section class="content-header hide">
+                                <h1>
+                                    <?php echo __('Dashboard'); ?>
+                                    <small><?php echo __('Control panel'); ?></small>
+                                </h1>
+                            </section>
+                            <?php if(!IS_DIALOG && !\think\Config::get('fastadmin.multiplenav') && \think\Config::get('fastadmin.breadcrumb')): ?>
+                            <!-- RIBBON -->
+                            <div id="ribbon">
+                                <ol class="breadcrumb pull-left">
+                                    <?php if($auth->check('dashboard')): ?>
+                                    <li><a href="dashboard" class="addtabsit"><i class="fa fa-dashboard"></i> <?php echo __('Dashboard'); ?></a></li>
+                                    <?php endif; ?>
+                                </ol>
+                                <ol class="breadcrumb pull-right">
+                                    <?php foreach($breadcrumb as $vo): ?>
+                                    <li><a href="javascript:;" data-url="<?php echo $vo['url']; ?>"><?php echo $vo['title']; ?></a></li>
+                                    <?php endforeach; ?>
+                                </ol>
+                            </div>
+                            <!-- END RIBBON -->
+                            <?php endif; ?>
+                            <div class="content">
+                                <div class="panel panel-default panel-intro">
+    <?php echo build_heading(); ?>
+
+    <div class="panel-body">
+        <div id="myTabContent" class="tab-content">
+            <div class="tab-pane fade active in" id="one">
+                <div class="widget-body no-padding">
+                    <div id="toolbar" class="toolbar">
+                        <a href="javascript:;" class="btn btn-primary btn-refresh" title="<?php echo __('Refresh'); ?>" ><i class="fa fa-refresh"></i> </a>
+                        <a href="javascript:;" class="btn btn-success btn-add <?php echo $auth->check('customer/add')?'':'hide'; ?>" title="<?php echo __('Add'); ?>" ><i class="fa fa-plus"></i> <?php echo __('Add'); ?></a>
+                        <!--<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled <?php echo $auth->check('customer/edit')?'':'hide'; ?>" title="<?php echo __('Edit'); ?>" ><i class="fa fa-pencil"></i> <?php echo __('Edit'); ?></a>-->
+                        <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled <?php echo $auth->check('customer/del')?'':'hide'; ?>" title="<?php echo __('Delete'); ?>" ><i class="fa fa-trash"></i> <?php echo __('Delete'); ?></a>
+                        
+
+                        <!--<div class="dropdown btn-group <?php echo $auth->check('customer/multi')?'':'hide'; ?>">-->
+                            <!--<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> <?php echo __('More'); ?></a>-->
+                            <!--<ul class="dropdown-menu text-left" role="menu">-->
+                                <!--<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> <?php echo __('Set to normal'); ?></a></li>-->
+                                <!--<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> <?php echo __('Set to hidden'); ?></a></li>-->
+                            <!--</ul>-->
+                        <!--</div>-->
+
+                        
+                    </div>
+                    <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
+                           data-show-toggle="false"
+                           data-operate-edit="<?php echo $auth->check('customer/edit'); ?>"
+                           data-operate-del="<?php echo $auth->check('customer/del'); ?>"
+                           width="100%">
+                    </table>
+                </div>
+            </div>
+
+        </div>
+    </div>
+</div>
+
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+        <script src="/assets/js/require<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js" data-main="/assets/js/require-backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js?v=<?php echo htmlentities($site['version']); ?>"></script>
+<input type="hidden" value="<?php echo \think\Session::get('admin.username'); ?>" name="" id="username">
+<input type="hidden" value="<?php echo \think\Session::get('admin.company'); ?>" name="" id="company">
+<script>
+    function watermark(element, config) {
+        // 获取元素的坐标
+        function getOffset(el) {
+            if (el.offsetParent) {
+                return {
+                    x: el.offsetLeft + getOffset(el.offsetParent).x,
+                    y: el.offsetTop + getOffset(el.offsetParent).y,
+                };
+            }
+            return {
+                x: el.offsetLeft,
+                y: el.offsetTop,
+            };
+        }
+        if (!element) return;
+        // 默认配置
+        const _config = {
+            text1: '张三',   //文本1
+            text2: '13868686868',   // 文本2
+            start_x: 0,      // x轴起始位置
+            start_y: 0,      // y轴起始位置
+            space_x: 100,    // x轴间距
+            space_y: 50,     // y轴间距
+            width: 210,      // 宽度
+            height: 80,      // 长度
+            fontSize: 14,    // 字体
+            color: '#aaa',   // 字色
+            alpha: 0.4,      // 透明度
+            rotate: 15,       // 倾斜度
+        };
+        // 替换默认配置
+        if (arguments.length === 2 && typeof arguments[1] === "object") {
+            const src = arguments[1] || {};
+            for (let key in src) {
+                if (src[key] && _config[key] && src[key] === _config[key]) {
+                    continue;
+                } else if (src[key]) {
+                    _config[key] = src[key];
+                }
+            }
+        }
+        // 节点的总宽度
+        const total_width = element.scrollWidth;
+        // 节点的总高度
+        const total_height = element.scrollHeight;
+        // 创建文本碎片,用于包含所有的插入节点
+        const mark = document.createDocumentFragment();
+        // 水印节点的起始坐标
+        const position = getOffset(element);
+        let x = position.x + _config.start_x, y = position.y + _config.start_y;
+        // 先循环y轴插入水印
+        do {
+            // 再循环x轴插入水印
+            do {
+                // 创建单个水印节点
+                const item = document.createElement('div');
+                item.className = 'watermark-item';
+                // 设置节点的样式
+                item.style.position = "absolute";
+                item.style.zIndex = 99999;
+                item.style.left = `${x}px`;
+                item.style.top = `${y}px`;
+                item.style.width = `${_config.width}px`;
+                item.style.height = `${_config.height}px`;
+                item.style.fontSize = `${_config.fontSize}px`;
+                item.style.color = _config.color;
+                item.style.textAlign = 'center';
+                item.style.opacity = _config.alpha;
+                item.style.filter = `alpha(opacity=${_config.alpha * 100})`;
+                // item.style.filter = `opacity(${_config.alpha * 100}%)`;
+                item.style.webkitTransform = `rotate(-${_config.rotate}deg)`;
+                item.style.MozTransform = `rotate(-${_config.rotate}deg)`;
+                item.style.msTransform = `rotate(-${_config.rotate}deg)`;
+                item.style.OTransform = `rotate(-${_config.rotate}deg)`;
+                item.style.transform = `rotate(-${_config.rotate}deg)`;
+                item.style.pointerEvents = 'none';    //让水印不遮挡页面的点击事件
+                // 创建text1水印节点
+                const text1 = document.createElement('div');
+                text1.appendChild(document.createTextNode(_config.text1));
+                item.append(text1);
+                // 创建text2水印节点
+                const text2 = document.createElement('div');
+                text2.appendChild(document.createTextNode(_config.text2));
+                item.append(text2);
+                // 添加水印节点到文本碎片
+                mark.append(item);
+                // x坐标递增
+                x = x + _config.width + _config.space_x;
+                // 超出文本右侧坐标停止插入
+            } while (total_width + position.x > x + _config.width);
+            // 重置x初始坐标
+            x = position.x + _config.start_x;
+            // y坐标递增
+            y = y + _config.height + _config.space_y;
+            // 超出文本底部坐标停止插入
+        } while (total_height + position.y > y + _config.height);
+        // 插入文档碎片
+        element.append(mark);
+    }
+    var username = document.getElementById('username');
+    var company = document.getElementById('company');
+    //找到存放水印的盒子
+    const element = document.getElementsByTagName('body')[0];
+    watermark(element,{text1:username.value,text2:company.value});
+</script>
+
+    </body>
+</html>

+ 417 - 0
runtime/temp/36daadbd0e56cbc6a8a6b2e248fdc8b5.php

@@ -0,0 +1,417 @@
+<?php if (!defined('THINK_PATH')) exit(); /*a:4:{s:78:"D:\phpstudy_pro\WWW\minongyun\public/../application/admin\view\order\task.html";i:1709714141;s:72:"D:\phpstudy_pro\WWW\minongyun\application\admin\view\layout\default.html";i:1709714141;s:69:"D:\phpstudy_pro\WWW\minongyun\application\admin\view\common\meta.html";i:1709714141;s:71:"D:\phpstudy_pro\WWW\minongyun\application\admin\view\common\script.html";i:1711415624;}*/ ?>
+<!DOCTYPE html>
+<html>
+    <head>
+        <meta charset="utf-8">
+<title><?php echo (isset($title) && ($title !== '')?$title:''); ?></title>
+<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
+<meta name="renderer" content="webkit">
+<meta name="referrer" content="never">
+<meta name="robots" content="noindex, nofollow">
+
+<link rel="shortcut icon" href="/assets/img/favicon.ico" />
+<!-- Loading Bootstrap -->
+<link href="/assets/css/backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.css?v=<?php echo \think\Config::get('site.version'); ?>" rel="stylesheet">
+
+<?php if(\think\Config::get('fastadmin.adminskin')): ?>
+<link href="/assets/css/skins/<?php echo \think\Config::get('fastadmin.adminskin'); ?>.css?v=<?php echo \think\Config::get('site.version'); ?>" rel="stylesheet">
+<?php endif; ?>
+
+<!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
+<!--[if lt IE 9]>
+  <script src="/assets/js/html5shiv.js"></script>
+  <script src="/assets/js/respond.min.js"></script>
+<![endif]-->
+<script type="text/javascript">
+    var require = {
+        config:  <?php echo json_encode($config); ?>
+    };
+</script>
+
+    </head>
+
+    <body class="inside-header inside-aside <?php echo defined('IS_DIALOG') && IS_DIALOG ? 'is-dialog' : ''; ?>">
+        <div id="main" role="main">
+            <div class="tab-content tab-addtabs">
+                <div id="content">
+                    <div class="row">
+                        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
+                            <section class="content-header hide">
+                                <h1>
+                                    <?php echo __('Dashboard'); ?>
+                                    <small><?php echo __('Control panel'); ?></small>
+                                </h1>
+                            </section>
+                            <?php if(!IS_DIALOG && !\think\Config::get('fastadmin.multiplenav') && \think\Config::get('fastadmin.breadcrumb')): ?>
+                            <!-- RIBBON -->
+                            <div id="ribbon">
+                                <ol class="breadcrumb pull-left">
+                                    <?php if($auth->check('dashboard')): ?>
+                                    <li><a href="dashboard" class="addtabsit"><i class="fa fa-dashboard"></i> <?php echo __('Dashboard'); ?></a></li>
+                                    <?php endif; ?>
+                                </ol>
+                                <ol class="breadcrumb pull-right">
+                                    <?php foreach($breadcrumb as $vo): ?>
+                                    <li><a href="javascript:;" data-url="<?php echo $vo['url']; ?>"><?php echo $vo['title']; ?></a></li>
+                                    <?php endforeach; ?>
+                                </ol>
+                            </div>
+                            <!-- END RIBBON -->
+                            <?php endif; ?>
+                            <div class="content">
+                                <style type="text/css">
+    .tg  {border-collapse:collapse;border-spacing:0;}
+    .tg td{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
+        overflow:hidden;padding:10px 5px;word-break:normal;}
+    .tg th{border-color:black;border-style:solid;border-width:1px;font-family:Arial, sans-serif;font-size:14px;
+        font-weight:normal;overflow:hidden;padding:10px 5px;word-break:normal;}
+    .tg .tg-ub5w{font-size:36px;vertical-align:middle;border: none}
+    .tg .tg-x1hj{font-size:22px;text-align:left;vertical-align:top;}
+    .tg .tg-kghl{font-size:22px;text-align:left;vertical-align:middle;}
+    .tg .tg-z7m5{font-size:22px;text-align:left;text-decoration:underline;vertical-align:top;border: none}
+    .tg .tg-s5vw{font-size:22px;font-weight:bold;text-align:center;vertical-align:bottom;border: none}
+    .tg .tg-v8dz{font-size:24px;text-align:left;vertical-align:top;border: none}
+    .tg .tg-svyg{font-size:22px;font-weight:bold;text-align:left;text-decoration:underline;vertical-align:bottom;border: none}
+    .tg .tg-4qqe{font-size:22px;font-weight:bold;text-align:center;vertical-align:top;border: none}
+    .tg .tg-9d8n{font-size:22px;text-align:left;vertical-align:top;}
+    .tg .tg-0pky{text-align:left;vertical-align:top;border: none}
+</style>
+<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
+    <div class="form-group">
+        <input style="display: none" id="ids" value="<?php echo $ids; ?>">
+        <label class="control-label col-xs-12 col-sm-1"><?php echo __('Name'); ?>:</label>
+        <div class="col-xs-12 col-sm-3">
+            <select id="c-name" class="form-control">
+                <option value="0">请选择配方</option>
+            <?php if(is_array($row) || $row instanceof \think\Collection || $row instanceof \think\Paginator): if( count($row)==0 ) : echo "" ;else: foreach($row as $key=>$vo): ?>
+                <option value="<?php echo $vo['id']; ?>" class="form-control"><?php echo $vo['name']; ?><?php echo $vo['version']; ?></option>
+            <?php endforeach; endif; else: echo "" ;endif; ?>
+            </select>
+<!--            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="" readonly>-->
+        </div>
+        <label class="control-label col-xs-12 col-sm-1">批次号:</label>
+        <div class="col-xs-12 col-sm-3">
+            <input id="hidden" type="hidden" value="<?php echo $bach; ?>">
+            <input id="c-bach" class="form-control" name="row[bach]" type="text" value="<?php echo $bach; ?>">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-1">开票人:</label>
+        <div class="col-xs-12 col-sm-3">
+            <select style="width: 380px;height: 35px" id="c-drawer_name"  class="control-label col-xs-12 col-sm-8 form-control selectpicker" name="row[drawer_name]">
+                <?php foreach($sckp as $key=>$vv): ?>
+                <option value="<?php echo $vv['name']; ?>"><?php echo $vv['name']; ?></option>
+                <?php endforeach; ?>
+            </select>
+            <!--<input id="c-drawer_name" data-rule="required" class="form-control" name="row[drawer_name]" type="text">-->
+        </div>
+        <label class="control-label col-xs-12 col-sm-1">审核人:</label>
+        <div class="col-xs-12 col-sm-3">
+            <select style="width: 380px;height: 35px" id="c-examine_name"  class="control-label col-xs-12 col-sm-8 form-control selectpicker" name="row[examine_name]">
+                <?php foreach($scsh as $key=>$vvv): ?>
+                <option value="<?php echo $vvv['name']; ?>" ><?php echo $vvv['name']; ?></option>
+                <?php endforeach; ?>
+            </select>
+            <!--<input id="c-examine_name" data-rule="required" class="form-control" name="row[examine_name]" type="text">-->
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-1">生产量(KG):</label>
+        <div class="col-xs-12 col-sm-3">
+            <input id="c-number" data-rule="required" class="form-control" name="row[number]" type="text">
+        </div>
+        <label class="control-label col-xs-12 col-sm-1"><?php echo __('Remark'); ?>:</label>
+        <div class="col-xs-12 col-sm-3">
+            <input id="c-remark" class="form-control" name="row[remark]" type="text">
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-1">机台选择:</label>
+        <div class="col-xs-12 col-sm-3">
+            <select id="c-mid" data-rule="required" class="control-label col-xs-12 col-sm-8 selectpicker" name="row[mid]">
+                <?php if(is_array($machineList) || $machineList instanceof \think\Collection || $machineList instanceof \think\Paginator): if( count($machineList)==0 ) : echo "" ;else: foreach($machineList as $key=>$machine): ?>
+                <option value="<?php echo $machine['name']; ?>" <?php if(in_array(($key), explode(',',""))): ?>selected<?php endif; ?>><?php echo $machine['name']; ?></option>
+                <?php endforeach; endif; else: echo "" ;endif; ?>
+            </select>
+        </div>
+    </div>
+    <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-1"></label>
+        <button type="button" id="add" class="btn btn-success">确定生成作业票</button>
+    </div>
+    <!--==========================================================================-->
+    <div class="form-group">
+        <table class="table table-striped table-bordered table-hover table-nowrap">
+            <thead><!--thead表格表头部位-->
+            <tr>
+                <th class="col-xs-12 col-sm-1">原材料</th>
+                <th class="col-xs-12 col-sm-1">百分比</th>
+                <th class="col-xs-12 col-sm-1">应加量(KG)</th>
+                <th class="col-xs-12 col-sm-6">操作记录</th>
+                <th class="col-xs-12 col-sm-1">工序号</th>
+            </tr>
+            </thead>
+
+            <tbody id="gy">
+                <!--tbody表格主体部位-->
+            </tbody>
+
+        </table>
+    </div>
+    <!--==========================================================================-->
+    <div style="display: none;">
+        <div class="form-group" id="print_area" >
+            <div id="head">
+                <table class="tg" style="width: 840px;">
+                    <thead>
+                    <div id="qrcode" style="margin:0 0 -450px 500px;width: 80px;height: 80px;">
+                        <img src="" id="myImage" alt=""/>
+                    </div>
+                    <tr>
+                        <th class="tg-v8dz" colspan="6">
+                            <!--<p id="formula_no"></p>-->
+                            <!--<hr style="border: 1px solid;margin-top: -5px">-->
+                        </th>
+                    </tr>
+                    <tbody>
+                    <tr>
+                        <td class="tg-s5vw"></td>
+                        <td class="tg-svyg"></td>
+                        <td class="tg-ub5w" colspan="2" rowspan="2">
+                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+                            作业票</td>
+                        <td class="tg-4qqe"></td>
+                        <td class="tg-s5vw"></td>
+                    </tr>
+                    <tr>
+                        <td class="tg-9d8n" style="border: none">日期:</td>
+                        <td class="tg-z7m5" id="date"></td>
+                        <td class="tg-9d8n">开票人</td>
+                        <td class="tg-9d8n">审核</td>
+                    </tr>
+                    <tr>
+                        <td class="tg-9d8n" style="border: none">批号:</td>
+                        <td class="tg-z7m5" id="bach"></td>
+                        <!--<td class="tg-kghl" style="border: none"><input type="text" id="formula" value="" style="width: 400px;text-align: center"></td>-->
+                        <td class="tg-kghl" style="border: none"><textarea type="text" id="formula" value="" style="resize:none;width: 400px;text-align: center;font-size: 16px"></textarea></td>
+                        <td class="tg-0pky"></td>
+                        <td class="tg-x1hj" id="drawer_name"></td>
+                        <td class="tg-x1hj" id="examine_name"></td>
+                    </tr>
+                    </tbody>
+
+                </table>
+            </div>
+            <div style="height: 20px;"></div>
+            <!--作业票整体下部分 div-->
+            <div id="body">
+                <!--作业票表格部分-->
+                <table class="tg" style="width: 840px;" id="print_gy">
+                    <tr>
+                        <th  style="text-align: center;">原材料</th>
+                        <!--<th style="text-align: center">百分比</th>-->
+                        <th  style="text-align: center">应加量(KG)</th>
+                        <th  style="text-align: center">实加量(KG)</th>
+                        <th  style="text-align: center">操作记录</th>
+                    </tr>
+                   <tbody id="print">
+                        <!--作业票表格主体部分-->
+                   </tbody>
+                </table>
+                <br><!--<div style="height: 5px; border: 5px red solid"></div>-->
+                <!--作业票签字部分-->
+                <table class="tg" style="width: 800px;">
+                    <tr>
+                        <td style="border: none">
+                            <span>包装规格:</span>
+                            <hr style="border: 1px solid;width: 150px;margin-top: -5px;">
+                            <div style="position: absolute;margin-left: 270px;margin-top: -36px;"> KG/桶</div>
+                        </td>
+                        <td style="border: none">作业票回收日期:<hr style="border: 1px solid;width: 150px;margin-top: -5px;"></td>
+                    </tr>
+                    <tr>
+                        <td style="border: none">操作人员:<hr style="border: 1px solid;width: 150px;margin-top: -5px;"></td>
+                        <td style="border: none">检验签字:<hr style="border: 1px solid;width: 150px;margin-top: -5px;"></td>
+                    </tr>
+                </table>
+            </div>
+        </div>
+    </div>
+    <div class="form-group layer-footer">
+        <label class="control-label col-xs-12 col-sm-2"></label>
+        <div class="col-xs-12 col-sm-8">
+            <button type="submit" class="btn btn-primary btn-embossed disabled submit">保存</button>
+            <button type="button" class="btn btn-default btn-embossed  print-link">打印预览</button>
+        </div>
+    </div>
+</form>
+
+<script type='text/javascript' src='/assets/js/jquery2.1.1.min.js'></script>
+<script type="text/javascript" src="/assets/js/jquery.qrcode.min.js"></script>
+<script type="text/javascript" src="/assets/js/jQuery.print.js"></script>
+<script >
+
+    jQuery(function($) { 'use strict';
+
+        $(".print-link").on('click', function() {
+            var status = 1;
+            var number = $('#c-number').val();
+            if (number == ''){
+                status = 2;
+            }
+            var bach = $('#c-bach').val();
+            if (bach == ''){
+                status = 2;
+            }
+            var drawer_name = $('#c-drawer_name').val();
+            if (drawer_name == ''){
+                status = 2;
+            }
+            var examine_name = $('#c-examine_name').val();
+            if (examine_name == ''){
+                status = 2;
+            }
+            if (status == 2){
+                layer.confirm('数据不能为空,请仔细核查');return false
+            }
+            // var ids = $('#ids').val();
+            // bach = bach + '-' + ids;
+            createQrcode(bach,80,80);
+            var img = document.getElementById("myImage"); /// get image element
+            var canvas = document.getElementsByTagName('canvas')[0];
+            img.src = canvas.toDataURL();                     /// update image
+            $.print('#print_area');
+            return false;
+        });
+        function createQrcode(txt,width,height) {
+            $("#qrcode").qrcode({
+                render: "canvas",//canvas和table两种渲染方式
+                width: width,
+                height: height,
+                correctLevel:3,//二维码纠错级别
+                background:"#ffffff",//背景颜色
+                foreground:"#000000", //二维码颜色
+                text:txt
+            });
+        }
+    });
+</script>
+
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+        <script src="/assets/js/require<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js" data-main="/assets/js/require-backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js?v=<?php echo htmlentities($site['version']); ?>"></script>
+<input type="hidden" value="<?php echo \think\Session::get('admin.username'); ?>" name="" id="username">
+<input type="hidden" value="<?php echo \think\Session::get('admin.company'); ?>" name="" id="company">
+<script>
+    function watermark(element, config) {
+        // 获取元素的坐标
+        function getOffset(el) {
+            if (el.offsetParent) {
+                return {
+                    x: el.offsetLeft + getOffset(el.offsetParent).x,
+                    y: el.offsetTop + getOffset(el.offsetParent).y,
+                };
+            }
+            return {
+                x: el.offsetLeft,
+                y: el.offsetTop,
+            };
+        }
+        if (!element) return;
+        // 默认配置
+        const _config = {
+            text1: '张三',   //文本1
+            text2: '13868686868',   // 文本2
+            start_x: 0,      // x轴起始位置
+            start_y: 0,      // y轴起始位置
+            space_x: 100,    // x轴间距
+            space_y: 50,     // y轴间距
+            width: 210,      // 宽度
+            height: 80,      // 长度
+            fontSize: 14,    // 字体
+            color: '#aaa',   // 字色
+            alpha: 0.4,      // 透明度
+            rotate: 15,       // 倾斜度
+        };
+        // 替换默认配置
+        if (arguments.length === 2 && typeof arguments[1] === "object") {
+            const src = arguments[1] || {};
+            for (let key in src) {
+                if (src[key] && _config[key] && src[key] === _config[key]) {
+                    continue;
+                } else if (src[key]) {
+                    _config[key] = src[key];
+                }
+            }
+        }
+        // 节点的总宽度
+        const total_width = element.scrollWidth;
+        // 节点的总高度
+        const total_height = element.scrollHeight;
+        // 创建文本碎片,用于包含所有的插入节点
+        const mark = document.createDocumentFragment();
+        // 水印节点的起始坐标
+        const position = getOffset(element);
+        let x = position.x + _config.start_x, y = position.y + _config.start_y;
+        // 先循环y轴插入水印
+        do {
+            // 再循环x轴插入水印
+            do {
+                // 创建单个水印节点
+                const item = document.createElement('div');
+                item.className = 'watermark-item';
+                // 设置节点的样式
+                item.style.position = "absolute";
+                item.style.zIndex = 99999;
+                item.style.left = `${x}px`;
+                item.style.top = `${y}px`;
+                item.style.width = `${_config.width}px`;
+                item.style.height = `${_config.height}px`;
+                item.style.fontSize = `${_config.fontSize}px`;
+                item.style.color = _config.color;
+                item.style.textAlign = 'center';
+                item.style.opacity = _config.alpha;
+                item.style.filter = `alpha(opacity=${_config.alpha * 100})`;
+                // item.style.filter = `opacity(${_config.alpha * 100}%)`;
+                item.style.webkitTransform = `rotate(-${_config.rotate}deg)`;
+                item.style.MozTransform = `rotate(-${_config.rotate}deg)`;
+                item.style.msTransform = `rotate(-${_config.rotate}deg)`;
+                item.style.OTransform = `rotate(-${_config.rotate}deg)`;
+                item.style.transform = `rotate(-${_config.rotate}deg)`;
+                item.style.pointerEvents = 'none';    //让水印不遮挡页面的点击事件
+                // 创建text1水印节点
+                const text1 = document.createElement('div');
+                text1.appendChild(document.createTextNode(_config.text1));
+                item.append(text1);
+                // 创建text2水印节点
+                const text2 = document.createElement('div');
+                text2.appendChild(document.createTextNode(_config.text2));
+                item.append(text2);
+                // 添加水印节点到文本碎片
+                mark.append(item);
+                // x坐标递增
+                x = x + _config.width + _config.space_x;
+                // 超出文本右侧坐标停止插入
+            } while (total_width + position.x > x + _config.width);
+            // 重置x初始坐标
+            x = position.x + _config.start_x;
+            // y坐标递增
+            y = y + _config.height + _config.space_y;
+            // 超出文本底部坐标停止插入
+        } while (total_height + position.y > y + _config.height);
+        // 插入文档碎片
+        element.append(mark);
+    }
+    var username = document.getElementById('username');
+    var company = document.getElementById('company');
+    //找到存放水印的盒子
+    const element = document.getElementsByTagName('body')[0];
+    watermark(element,{text1:username.value,text2:company.value});
+</script>
+
+    </body>
+</html>

+ 227 - 0
runtime/temp/5491598cef3cbc480f9e2e40ee5ccc9c.php

@@ -0,0 +1,227 @@
+<?php if (!defined('THINK_PATH')) exit(); /*a:4:{s:81:"D:\phpstudy_pro\WWW\minongyun\public/../application/admin\view\product\index.html";i:1709714141;s:72:"D:\phpstudy_pro\WWW\minongyun\application\admin\view\layout\default.html";i:1709714141;s:69:"D:\phpstudy_pro\WWW\minongyun\application\admin\view\common\meta.html";i:1709714141;s:71:"D:\phpstudy_pro\WWW\minongyun\application\admin\view\common\script.html";i:1711415624;}*/ ?>
+<!DOCTYPE html>
+<html>
+    <head>
+        <meta charset="utf-8">
+<title><?php echo (isset($title) && ($title !== '')?$title:''); ?></title>
+<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
+<meta name="renderer" content="webkit">
+<meta name="referrer" content="never">
+<meta name="robots" content="noindex, nofollow">
+
+<link rel="shortcut icon" href="/assets/img/favicon.ico" />
+<!-- Loading Bootstrap -->
+<link href="/assets/css/backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.css?v=<?php echo \think\Config::get('site.version'); ?>" rel="stylesheet">
+
+<?php if(\think\Config::get('fastadmin.adminskin')): ?>
+<link href="/assets/css/skins/<?php echo \think\Config::get('fastadmin.adminskin'); ?>.css?v=<?php echo \think\Config::get('site.version'); ?>" rel="stylesheet">
+<?php endif; ?>
+
+<!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
+<!--[if lt IE 9]>
+  <script src="/assets/js/html5shiv.js"></script>
+  <script src="/assets/js/respond.min.js"></script>
+<![endif]-->
+<script type="text/javascript">
+    var require = {
+        config:  <?php echo json_encode($config); ?>
+    };
+</script>
+
+    </head>
+
+    <body class="inside-header inside-aside <?php echo defined('IS_DIALOG') && IS_DIALOG ? 'is-dialog' : ''; ?>">
+        <div id="main" role="main">
+            <div class="tab-content tab-addtabs">
+                <div id="content">
+                    <div class="row">
+                        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
+                            <section class="content-header hide">
+                                <h1>
+                                    <?php echo __('Dashboard'); ?>
+                                    <small><?php echo __('Control panel'); ?></small>
+                                </h1>
+                            </section>
+                            <?php if(!IS_DIALOG && !\think\Config::get('fastadmin.multiplenav') && \think\Config::get('fastadmin.breadcrumb')): ?>
+                            <!-- RIBBON -->
+                            <div id="ribbon">
+                                <ol class="breadcrumb pull-left">
+                                    <?php if($auth->check('dashboard')): ?>
+                                    <li><a href="dashboard" class="addtabsit"><i class="fa fa-dashboard"></i> <?php echo __('Dashboard'); ?></a></li>
+                                    <?php endif; ?>
+                                </ol>
+                                <ol class="breadcrumb pull-right">
+                                    <?php foreach($breadcrumb as $vo): ?>
+                                    <li><a href="javascript:;" data-url="<?php echo $vo['url']; ?>"><?php echo $vo['title']; ?></a></li>
+                                    <?php endforeach; ?>
+                                </ol>
+                            </div>
+                            <!-- END RIBBON -->
+                            <?php endif; ?>
+                            <div class="content">
+                                <div class="panel panel-default panel-intro">
+
+    <div class="panel-heading">
+        <?php echo build_heading(null,FALSE); ?>
+        <ul class="nav nav-tabs" data-field="status">
+            <li class="<?php echo \think\Request::instance()->get('status') === null ? 'active' : ''; ?>"><a href="#t-all" data-value="" data-toggle="tab"><?php echo __('All'); ?></a></li>
+            <?php if(is_array($statusList) || $statusList instanceof \think\Collection || $statusList instanceof \think\Paginator): if( count($statusList)==0 ) : echo "" ;else: foreach($statusList as $key=>$vo): ?>
+            <li class="<?php echo \think\Request::instance()->get('status') === (string)$key ? 'active' : ''; ?>"><a href="#t-<?php echo $key; ?>" data-value="<?php echo $key; ?>" data-toggle="tab"><?php echo $vo; ?></a></li>
+            <?php endforeach; endif; else: echo "" ;endif; ?>
+        </ul>
+    </div>
+
+
+    <div class="panel-body">
+        <div id="myTabContent" class="tab-content">
+            <div class="tab-pane fade active in" id="one">
+                <div class="widget-body no-padding">
+                    <div id="toolbar" class="toolbar">
+                        <a href="javascript:;" class="btn btn-primary btn-refresh" title="<?php echo __('Refresh'); ?>" ><i class="fa fa-refresh"></i> </a>
+                        <a href="javascript:;" class="btn btn-success btn-add <?php echo $auth->check('product/add')?'':'hide'; ?>" data-params="status=1" title="<?php echo __('Add'); ?>" ><i class="fa fa-plus"></i> 领料</a>
+                        <a href="javascript:;" class="btn btn-success btn-add <?php echo $auth->check('product/add')?'':'hide'; ?>" data-params="status=2" title="<?php echo __('Add'); ?>" ><i class="fa fa-plus"></i> 退料</a>
+<!--                        <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled <?php echo $auth->check('product/edit')?'':'hide'; ?>" title="<?php echo __('Edit'); ?>" ><i class="fa fa-pencil"></i> <?php echo __('Edit'); ?></a>-->
+                        <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled <?php echo $auth->check('product/del')?'':'hide'; ?>" title="<?php echo __('Delete'); ?>" ><i class="fa fa-trash"></i> <?php echo __('Delete'); ?></a>
+                        
+
+                        <div class="dropdown btn-group <?php echo $auth->check('product/multi')?'':'hide'; ?>">
+                            <a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> <?php echo __('More'); ?></a>
+                            <ul class="dropdown-menu text-left" role="menu">
+                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> <?php echo __('Set to normal'); ?></a></li>
+                                <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> <?php echo __('Set to hidden'); ?></a></li>
+                            </ul>
+                        </div>
+
+                        
+                    </div>
+                    <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
+                           data-operate-edit=""
+                           data-operate-del="<?php echo $auth->check('product/del'); ?>"
+                           width="100%">
+                    </table>
+
+                </div>
+            </div>
+
+        </div>
+    </div>
+</div>
+
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+        <script src="/assets/js/require<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js" data-main="/assets/js/require-backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js?v=<?php echo htmlentities($site['version']); ?>"></script>
+<input type="hidden" value="<?php echo \think\Session::get('admin.username'); ?>" name="" id="username">
+<input type="hidden" value="<?php echo \think\Session::get('admin.company'); ?>" name="" id="company">
+<script>
+    function watermark(element, config) {
+        // 获取元素的坐标
+        function getOffset(el) {
+            if (el.offsetParent) {
+                return {
+                    x: el.offsetLeft + getOffset(el.offsetParent).x,
+                    y: el.offsetTop + getOffset(el.offsetParent).y,
+                };
+            }
+            return {
+                x: el.offsetLeft,
+                y: el.offsetTop,
+            };
+        }
+        if (!element) return;
+        // 默认配置
+        const _config = {
+            text1: '张三',   //文本1
+            text2: '13868686868',   // 文本2
+            start_x: 0,      // x轴起始位置
+            start_y: 0,      // y轴起始位置
+            space_x: 100,    // x轴间距
+            space_y: 50,     // y轴间距
+            width: 210,      // 宽度
+            height: 80,      // 长度
+            fontSize: 14,    // 字体
+            color: '#aaa',   // 字色
+            alpha: 0.4,      // 透明度
+            rotate: 15,       // 倾斜度
+        };
+        // 替换默认配置
+        if (arguments.length === 2 && typeof arguments[1] === "object") {
+            const src = arguments[1] || {};
+            for (let key in src) {
+                if (src[key] && _config[key] && src[key] === _config[key]) {
+                    continue;
+                } else if (src[key]) {
+                    _config[key] = src[key];
+                }
+            }
+        }
+        // 节点的总宽度
+        const total_width = element.scrollWidth;
+        // 节点的总高度
+        const total_height = element.scrollHeight;
+        // 创建文本碎片,用于包含所有的插入节点
+        const mark = document.createDocumentFragment();
+        // 水印节点的起始坐标
+        const position = getOffset(element);
+        let x = position.x + _config.start_x, y = position.y + _config.start_y;
+        // 先循环y轴插入水印
+        do {
+            // 再循环x轴插入水印
+            do {
+                // 创建单个水印节点
+                const item = document.createElement('div');
+                item.className = 'watermark-item';
+                // 设置节点的样式
+                item.style.position = "absolute";
+                item.style.zIndex = 99999;
+                item.style.left = `${x}px`;
+                item.style.top = `${y}px`;
+                item.style.width = `${_config.width}px`;
+                item.style.height = `${_config.height}px`;
+                item.style.fontSize = `${_config.fontSize}px`;
+                item.style.color = _config.color;
+                item.style.textAlign = 'center';
+                item.style.opacity = _config.alpha;
+                item.style.filter = `alpha(opacity=${_config.alpha * 100})`;
+                // item.style.filter = `opacity(${_config.alpha * 100}%)`;
+                item.style.webkitTransform = `rotate(-${_config.rotate}deg)`;
+                item.style.MozTransform = `rotate(-${_config.rotate}deg)`;
+                item.style.msTransform = `rotate(-${_config.rotate}deg)`;
+                item.style.OTransform = `rotate(-${_config.rotate}deg)`;
+                item.style.transform = `rotate(-${_config.rotate}deg)`;
+                item.style.pointerEvents = 'none';    //让水印不遮挡页面的点击事件
+                // 创建text1水印节点
+                const text1 = document.createElement('div');
+                text1.appendChild(document.createTextNode(_config.text1));
+                item.append(text1);
+                // 创建text2水印节点
+                const text2 = document.createElement('div');
+                text2.appendChild(document.createTextNode(_config.text2));
+                item.append(text2);
+                // 添加水印节点到文本碎片
+                mark.append(item);
+                // x坐标递增
+                x = x + _config.width + _config.space_x;
+                // 超出文本右侧坐标停止插入
+            } while (total_width + position.x > x + _config.width);
+            // 重置x初始坐标
+            x = position.x + _config.start_x;
+            // y坐标递增
+            y = y + _config.height + _config.space_y;
+            // 超出文本底部坐标停止插入
+        } while (total_height + position.y > y + _config.height);
+        // 插入文档碎片
+        element.append(mark);
+    }
+    var username = document.getElementById('username');
+    var company = document.getElementById('company');
+    //找到存放水印的盒子
+    const element = document.getElementsByTagName('body')[0];
+    watermark(element,{text1:username.value,text2:company.value});
+</script>
+
+    </body>
+</html>