Browse Source

queryForm.js 增加dateTimeLocal控件用于 日期选择器(年月日时分秒)

Zhouzhendong 5 years ago
parent
commit
8bbe344bea

+ 18 - 5
resources/js/queryForm/queryForm.js

@@ -142,7 +142,7 @@ const query = function getQueryForm(data) {
                 if ([null, '', undefined].includes(condition.type) && ![null, undefined].includes(condition.name)) {
                     condition.type = 'input';
                 }
-                if (['dateTime_dateTime', 'input_input'].includes(condition.type)) {
+                if (['dateTime_dateTime','dateTimeLocal', 'input_input'].includes(condition.type)) {
                     td = $("<td  style='width: 330px'</td>")
                 } else if (['select_multiple_select', 'time', 'dateTime_select'].includes(condition.type)) {
                     td = $("<td  style='width: 280px'</td>");
@@ -171,7 +171,7 @@ const query = function getQueryForm(data) {
             conditions.forEach(function (condition, index, array) {
                 if (['input', 'select', 'dateTime', 'input_select'].includes(condition.type)) {
                     _width += 260;
-                } else if (['dateTime_dateTime', 'input_input'].includes(condition.type)) {
+                } else if (['dateTime_dateTime','dateTimeLocal', 'input_input'].includes(condition.type)) {
                     _width += 330;
                 } else if (['select_multiple_select','search_select'].includes(condition.type)) {
                     _width += 280;
@@ -339,6 +339,7 @@ const query = function getQueryForm(data) {
             || (type === "search_select" && getSearchSelect(condition))
             || (type === "input_select" && getInputSelect(condition))
             || (type === "dateTime" && getdateTime(condition))
+            || (type === "dateTimeLocal" && getDateTimeLocal(condition))
             || (type === "time" && getTime(condition))
             || (type === "input_input" && getInputInput(condition))
             || (type === "dateTime_dateTime" && getdateTimedateTime(condition))
@@ -433,6 +434,18 @@ const query = function getQueryForm(data) {
         return dateTime;
     }
 
+    // dateTimeLocal
+    //dateTimeLocal
+    function getDateTimeLocal(condition) {
+        let dateTimeLocal = $("<input name = '"+ condition.name +"' type='datetime-local' step='01' class='form-control form-control-sm' style='vertical-align: middle; max-width: 280px;' placeholder='" + condition.placeholder + "' autocomplete='off' data-toggle='tooltip' data-placement='top' >");
+        dateTimeLocal.attr('title', condition.tip === undefined ? '' : condition.tip);
+        dateTimeLocal.bind('input propertychange', function () {
+            let dom = {name: condition.name, type: 'dateTimeLocal', value: this.value, mold: 'dateTimeLocal'};
+            modifyData(dom);
+        });
+        return dateTimeLocal;
+    }
+
     // time
     function getTime(condition) {
         let div = $("<div class='form-inline'></div>");
@@ -1051,7 +1064,7 @@ const query = function getQueryForm(data) {
     }
 
     function redenerSearchFormOnData(key, value, mold) {
-        if (mold === 'input' ||mold === 'dateTime') {
+        if (mold === 'input' ||mold === 'dateTime' || mold === 'dateTimeLocal') {
             rendererSearchFormOnInput(key, value, mold);
         } else if (mold === 'select') {
             rendererSearchFormOnSelect(key, value, mold);
@@ -1068,7 +1081,7 @@ const query = function getQueryForm(data) {
     function switchData() {
         _this.condition.forEach(function (conditions) {
             conditions.forEach(function (condition) {
-                if (['input', 'select', 'dateTime', 'search_select', 'time', 'select_multiple_select','checkbox'].includes(condition.type)) {
+                if (['input', 'select', 'dateTime','dateTimeLocal', 'search_select', 'time', 'select_multiple_select','checkbox'].includes(condition.type)) {
                     if (!condition.select) {
                         condition.select = '';
                     }
@@ -1166,7 +1179,7 @@ const query = function getQueryForm(data) {
             // }
             _data[key].select = value;
 
-            if (['input', 'dateTime'].includes(mold)) {
+            if (['input', 'dateTime', 'dateTimeLocal'].includes(mold)) {
                 rendererSearchFormOnInput(key, value, mold);
             } else if (['select'].includes(mold)) {
                 rendererSearchFormOnSelect(key, value, mold);

+ 28 - 4
resources/views/store/checkingReceive/show.blade.php

@@ -88,11 +88,11 @@
         </div>
         <div class="row text-primary ml-1 mr-2 mt-1 mb-1 w-100" style="background-color: #c3e3b5">
             <span class="ml-md-1">任务ID: <b class="text-dark">@{{ storeCheckingReceive.id }}</b></span>
-            <span class="ml-md-3">货主: <b class="text-dark">@{{ storeCheckingReceive.owner_name }}</b></span>
+            <span class="ml-md-3"> &nbsp;货主: <b class="text-dark">@{{ storeCheckingReceive.owner_name }}</b></span>
             <span class="ml-md-3">创建时间: <b class="text-dark">@{{ storeCheckingReceive.created_at }}</b></span>
             <span class="ml-md-3">ASN号: <b class="text-dark">@{{ storeCheckingReceive.asn }}</b></span>
         </div>
-        <!-- pc -->
+        <!-- pc >544 -->
         <div class="d-none d-sm-block">
             <table class="table table-sm text-nowrap table-bordered d-none" id="headerRoll"></table>
             <table class="table table-striped table-sm text-nowrap table-hover mt-1" id="headerParent">
@@ -118,10 +118,34 @@
                 </tr>
             </table>
         </div>
+        <!-- phone <544 -->
         <div class="d-xl-none">
-            123
+            <div v-for="(storeCheckingReceiveItem) in storeCheckingReceiveItems" class="mt-1 border border-1 rounded">
+                <div class="row">
+                    <div class="col-12 row">
+                        <label class="text-primary col-4 mr-0">商品条码:</label>
+                        <div class="col-8 ml-0">
+                            <span v-for="commodity_barcode in storeCheckingReceiveItem.commodity_barcodes">
+                                <small>@{{ commodity_barcode.code }}</small><br>
+                            </span>
+                        </div>
+                    </div>
+                </div>
+                <div class="row">
+                    <div class="col-12">
+                        <label class="text-muted">商品名称:</label>@{{ storeCheckingReceiveItem.commodity_name }}
+                    </div>
+                </div>
+                <div class="row">
+                    <div class="col-6">
+                        <label class="text-muted">格口号:</label>@{{ storeCheckingReceiveItem.bin_number }}
+                    </div>
+                    <div class="col-6">
+                        <label class="text-muted">实盘数:</label>@{{ storeCheckingReceiveItem.counted_amount }}
+                    </div>
+                </div>
+            </div>
         </div>
-        <!-- phone -->
     </div>
 @stop