Bläddra i källkod

排序组件,二次加工导入表头过滤,删除原有作废js

Zhouzhendong 5 år sedan
förälder
incheckning
a29f899554

+ 3 - 0
app/Http/Controllers/ProcessController.php

@@ -930,6 +930,8 @@ class ProcessController extends Controller
         $processContents=[];
         $errors = [];
         foreach ($commodities as $i => $commodity){
+            if ($i==0 && mb_strpos($commodity,'货主') && mb_strpos($commodity,'品名')
+                && mb_strpos($commodity,'数量'))continue;
             $commodity = explode("\t",$commodity); //拆分列
             $head="第".($i+1)."行";
             if (count($commodity)<count($request->rows)){
@@ -972,6 +974,7 @@ class ProcessController extends Controller
             else unset($errors[$head]);
             if (!is_object($owner)){
                 $str = $owner;
+                if (!$str) throw new \Exception('未找到货主!');
                 $owner=Owner::where('code',$str)->orWhere('name',$str)->first();
                 if (!$owner){
                     $owner = Owner::create([

+ 0 - 537
public/js/singles/rejectedIndex.js

@@ -1,537 +0,0 @@
-/******/ (function(modules) { // webpackBootstrap
-/******/ 	// The module cache
-/******/ 	var installedModules = {};
-/******/
-/******/ 	// The require function
-/******/ 	function __webpack_require__(moduleId) {
-/******/
-/******/ 		// Check if module is in cache
-/******/ 		if(installedModules[moduleId]) {
-/******/ 			return installedModules[moduleId].exports;
-/******/ 		}
-/******/ 		// Create a new module (and put it into the cache)
-/******/ 		var module = installedModules[moduleId] = {
-/******/ 			i: moduleId,
-/******/ 			l: false,
-/******/ 			exports: {}
-/******/ 		};
-/******/
-/******/ 		// Execute the module function
-/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
-/******/
-/******/ 		// Flag the module as loaded
-/******/ 		module.l = true;
-/******/
-/******/ 		// Return the exports of the module
-/******/ 		return module.exports;
-/******/ 	}
-/******/
-/******/
-/******/ 	// expose the modules object (__webpack_modules__)
-/******/ 	__webpack_require__.m = modules;
-/******/
-/******/ 	// expose the module cache
-/******/ 	__webpack_require__.c = installedModules;
-/******/
-/******/ 	// define getter function for harmony exports
-/******/ 	__webpack_require__.d = function(exports, name, getter) {
-/******/ 		if(!__webpack_require__.o(exports, name)) {
-/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
-/******/ 		}
-/******/ 	};
-/******/
-/******/ 	// define __esModule on exports
-/******/ 	__webpack_require__.r = function(exports) {
-/******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
-/******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
-/******/ 		}
-/******/ 		Object.defineProperty(exports, '__esModule', { value: true });
-/******/ 	};
-/******/
-/******/ 	// create a fake namespace object
-/******/ 	// mode & 1: value is a module id, require it
-/******/ 	// mode & 2: merge all properties of value into the ns
-/******/ 	// mode & 4: return value when already ns object
-/******/ 	// mode & 8|1: behave like require
-/******/ 	__webpack_require__.t = function(value, mode) {
-/******/ 		if(mode & 1) value = __webpack_require__(value);
-/******/ 		if(mode & 8) return value;
-/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
-/******/ 		var ns = Object.create(null);
-/******/ 		__webpack_require__.r(ns);
-/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
-/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
-/******/ 		return ns;
-/******/ 	};
-/******/
-/******/ 	// getDefaultExport function for compatibility with non-harmony modules
-/******/ 	__webpack_require__.n = function(module) {
-/******/ 		var getter = module && module.__esModule ?
-/******/ 			function getDefault() { return module['default']; } :
-/******/ 			function getModuleExports() { return module; };
-/******/ 		__webpack_require__.d(getter, 'a', getter);
-/******/ 		return getter;
-/******/ 	};
-/******/
-/******/ 	// Object.prototype.hasOwnProperty.call
-/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
-/******/
-/******/ 	// __webpack_public_path__
-/******/ 	__webpack_require__.p = "/";
-/******/
-/******/
-/******/ 	// Load entry module and return exports
-/******/ 	return __webpack_require__(__webpack_require__.s = 2);
-/******/ })
-/************************************************************************/
-/******/ ({
-
-/***/ "./resources/js/singles/rejectedIndex.js":
-/*!***********************************************!*\
-  !*** ./resources/js/singles/rejectedIndex.js ***!
-  \***********************************************/
-/*! no static exports found */
-/***/ (function(module, exports) {
-
-var vueList = new Vue({
-  el: "#list",
-  data: {
-    filterParams: {
-      created_at: '',
-      owner_id: '',
-      order_number: '',
-      logistic_number_return: '',
-      mobile_sender: '',
-      barcode_goods: '',
-      is_checked: '',
-      created_at_start: '',
-      created_at_end: '',
-      id_quality_label: '',
-      is_loaded: '',
-      checked_numbers: '',
-      paginate: '50'
-    },
-    checkBoxAll: [],
-    rejectedBills: rejectedBills,
-    rejectedBills_checkBoxes: [],
-    owners: owners,
-    qualityLabels: qualityLabels
-  },
-  mounted: function mounted() {
-    $(".tooltipTarget").tooltip({
-      'trigger': 'hover'
-    });
-    this.initInputs();
-    $('#list').removeClass('d-none');
-  },
-  methods: {
-    filterRun: function filterRun() {
-      var form = $("<form method='get'></form>");
-      this.filterParams['page'] = '';
-
-      for (var key in this.filterParams) {
-        if (this.filterParams[key]) {
-          form.append($("<input type='hidden' name='" + key + "' value='" + this.filterParams[key] + "'>"));
-        }
-      }
-
-      $("body").append(form);
-      form.submit();
-    },
-    created_at_startChange: function created_at_startChange(e) {
-      this.filterParams.created_at_start = e.target.value;
-      this.filterRun();
-    },
-    created_at_endChange: function created_at_endChange(e) {
-      this.filterParams.created_at_end = e.target.value;
-      this.filterRun();
-    },
-    owner_idChange: function owner_idChange(e) {
-      this.filterParams.owner_id = e.target.value;
-      this.filterRun();
-    },
-    is_checkedChange: function is_checkedChange(e) {
-      this.filterParams.is_checked = e.target.value;
-      this.filterRun();
-    },
-    id_quality_labelChange: function id_quality_labelChange(e) {
-      this.filterParams.id_quality_label = e.target.value;
-      this.filterRun();
-    },
-    is_loadedChange: function is_loadedChange(e) {
-      this.filterParams.is_loaded = e.target.value;
-      this.filterRun();
-    },
-    mobile_senderChange: function mobile_senderChange(e) {
-      this.filterParams.mobile_sender = e.target.value;
-      this.filterRun();
-    },
-    checked_numbersChange: function checked_numbersChange(e) {
-      this.filterParams.checked_numbers = e.target.value;
-      this.filterRun();
-    },
-    initInputs: function initInputs() {
-      var data = this; // let uriParts = decodeURI(location.href).split("?");
-      // if(uriParts.length>1){
-      //     let params = uriParts[1].split('&');
-      //     params.forEach(function(paramPair){
-      //         let pair=paramPair.split('=');
-      //         let key = pair[0], val = pair[1];
-      //         $('input[name="'+key+'"]').val(val);
-      //         $('select[name="'+key+'"]').val(val);
-      //         data.filterParams[key]=val;
-      //     });
-      // }
-
-      for (var key in paginateParams) {
-        var val = paginateParams[key];
-        $('input[name="' + key + '"]').val(val);
-        $('select[name="' + key + '"]').val(val);
-        data.filterParams[key] = val;
-      }
-    },
-    edit: function edit(e) {
-      var id = $(e.target).parents('tr').attr('data-id');
-      var editFullUri = editUrl + id + "/edit"; // location.href = editFullUri;
-
-      var form = $('<form action=\"' + editFullUri + '\" method="post" target="_blank"></form>');
-      form.append('<input type="hidden" name="filterParams" value=\'' + JSON.stringify(this.filterParams) + '\'/>');
-      form.append(csrfInput);
-      $('body').append(form);
-      form.submit();
-    },
-    destroy: function destroy(rejectedBill) {
-      if (!confirm('确定要删除退货信息“' + rejectedBill.owner.name + ':' + rejectedBill.logistic_number_return + '”吗?')) {
-        return;
-      }
-
-      var data = this;
-      var url = destroyUrl + rejectedBill.id;
-      axios["delete"](url, {
-        id: rejectedBill.id
-      }).then(function (response) {
-        if (response.data.success) {
-          for (var i = 0; i < data.rejectedBills.length; i++) {
-            if (data.rejectedBills[i].id === rejectedBill.id) {
-              data.rejectedBills.splice(i, 1);
-              break;
-            }
-          }
-
-          tempTip.setDuration(1000);
-          tempTip.showSuccess('删除退货信息"' + rejectedBill.owner.name + ':' + rejectedBill.logistic_number_return + '"成功!');
-        } else {
-          tempTip.setDuration(1000);
-          tempTip.show('删除退货信息"' + rejectedBill.owner.name + ':' + rejectedBill.logistic_number_return + '"失败!');
-        }
-      })["catch"](function (err) {
-        tempTip.setDuration(3000);
-        tempTip.show('删除退货信息失败!' + '网络错误:' + err);
-        console.log(err);
-      });
-    },
-    created_at_startEntering: function created_at_startEntering(e) {
-      if (e.key === 'Enter') {
-        this.created_at_startChange(e);
-      }
-    },
-    created_at_endEntering: function created_at_endEntering(e) {
-      if (e.key === 'Enter') {
-        this.created_at_endChange(e);
-      }
-    },
-    owner_idEntering: function owner_idEntering(e) {
-      if (e.key === 'Enter') {
-        e.target.value = $('#owner_id').val();
-        this.owner_idChange(e);
-        e.target.value = '';
-      }
-    },
-    locateOwner: function locateOwner(e) {
-      str = e.target.value.trim();
-      if (str === '') return;
-      $("#owner_id option").attr("selected", false);
-      var selectingOption = $("#owner_id").find("option:contains(" + str + ")").eq(0);
-      selectingOption.attr("selected", true); // this.filterParams.owner_id=selectingOption.val();
-    },
-    order_numberEntering: function order_numberEntering(e) {
-      if (e.key === 'Enter') {
-        this.filterParams.order_number = e.target.value;
-        this.filterRun();
-      }
-    },
-    barcode_goodsEntering: function barcode_goodsEntering(e) {
-      if (e.key === 'Enter') {
-        this.filterParams.barcode_goods = e.target.value;
-        this.filterRun();
-      }
-    },
-    logistic_number_returnEntering: function logistic_number_returnEntering(e) {
-      if (e.key === 'Enter') {
-        this.filterParams.logistic_number_return = e.target.value;
-        this.filterRun();
-      }
-    },
-    logistic_numberEntering: function logistic_numberEntering(e) {
-      if (e.key === 'Enter') {
-        this.filterParams.logistic_number = e.target.value;
-        this.filterRun();
-      }
-    },
-    cancelCheckConfirmAll: function cancelCheckConfirmAll() {
-      $('#checkConfirmingAll').tooltip('hide');
-      setTimeout(function () {
-        $(".tooltipTarget").tooltip({
-          'trigger': 'hover'
-        });
-      }, 10);
-      this.checkBoxAll = false;
-      this.rejectedBills.forEach(function (rejectedBill) {
-        if (rejectedBill.is_checked === -1) rejectedBill.is_checked = '0';
-      });
-    },
-    setIsLoaded_batch: function setIsLoaded_batch(e) {
-      var _this = this;
-
-      if (_this.rejectedBills_checkBoxes.length === 0) {
-        tempTip.show('没有勾选记录');
-        $(e.target).val("");
-        return;
-      }
-
-      var val = $(e.target).val();
-      var is_loaded = 0;
-      var is_loadedLabel = '否';
-
-      if (val === "1") {
-        is_loaded = 1;
-        is_loadedLabel = '是';
-      } else if (val === "2") {
-        is_loaded = 2;
-        is_loadedLabel = '待推单';
-      } else if (val === "null") {
-        is_loaded = 'null';
-        is_loadedLabel = '无需入库';
-      }
-
-      if (!confirm("确定要标记所有勾选入库情况为'" + is_loadedLabel + "'吗")) {
-        return;
-      }
-
-      axios.post(ajaxCheckUrl, {
-        ids: _this.rejectedBills_checkBoxes,
-        is_loaded: is_loaded
-      }).then(function (response) {
-        if (response.data.success) {
-          _this.rejectedBills_checkBoxes.forEach(function (id) {
-            _this.rejectedBills.forEach(function (bill) {
-              if (bill.id === id) {
-                bill.is_loaded = is_loaded;
-              }
-            });
-          });
-
-          tempTip.setDuration(1000);
-          tempTip.showSuccess('修改勾选记录的入库状态成功');
-        } else {
-          tempTip.setDuration(2500);
-          tempTip.show('修改勾选记录的入库状态失败,错误:' + response.data.fail_info);
-        }
-      })["catch"](function (e) {
-        alert('网络连接错误:' + e);
-        tempTip.setDuration(2500);
-        tempTip.show('审核勾选内容失败,网络连接错误:' + e);
-        console.log(e);
-      });
-      $(e.target).val("");
-    },
-    checkBoxAllToggle: function checkBoxAllToggle(e) {
-      var _this = this;
-
-      if (_this.rejectedBills_checkBoxes.length >= this.rejectedBills.length) {
-        _this.rejectedBills_checkBoxes = [];
-        _this.checkBoxAll = [];
-      } else {
-        _this.rejectedBills_checkBoxes = [];
-        this.rejectedBills.forEach(function (bill) {
-          _this.rejectedBills_checkBoxes.push(bill.id);
-
-          _this.checkBoxAll = [1];
-        });
-      }
-    },
-    checkAll: function checkAll() {
-      var _this = this;
-
-      if (_this.rejectedBills_checkBoxes.length === 0) {
-        tempTip.show('没有勾选记录');
-        return;
-      }
-
-      if (!confirm("确定要标记所有勾选内容为'已审核'吗")) {
-        return;
-      }
-
-      axios.post(ajaxCheckAllURL, {
-        ids: _this.rejectedBills_checkBoxes
-      }).then(function (response) {
-        if (response.data.success) {
-          response.data.rejecteds.forEach(function (rejected) {
-            _this.rejectedBills.forEach(function (rejectedBill) {
-              if (parseInt(rejectedBill.id) === parseInt(rejected.id)) {
-                rejectedBill.is_checked = 1;
-                rejectedBill.checked_numbers = rejected.checked_numbers;
-              }
-            });
-          });
-          tempTip.setDuration(1000);
-          tempTip.showSuccess('审核勾选内容成功');
-        } else {
-          tempTip.setDuration(2500);
-          tempTip.show('审核勾选内容失败,错误:' + response.data.fail_info);
-        }
-      })["catch"](function (e) {
-        alert('网络连接错误:' + e);
-        tempTip.setDuration(2500);
-        tempTip.show('审核勾选内容失败,网络连接错误:' + e);
-        console.log(e);
-      });
-    },
-    finishAll: function finishAll() {
-      var _this = this;
-
-      if (_this.rejectedBills_checkBoxes.length === 0) {
-        tempTip.show('没有勾选记录');
-        return;
-      }
-
-      if (!confirm("确定要标记所有勾选内容为'已完结'吗")) {
-        return;
-      }
-
-      axios.post(ajaxFinishAllUrl, {
-        ids: _this.rejectedBills_checkBoxes
-      }).then(function (response) {
-        if (response.data.success) {
-          _this.rejectedBills.forEach(function (rejectedBill) {
-            _this.rejectedBills_checkBoxes.forEach(function (checkedId) {
-              if (rejectedBill.id === checkedId) {
-                rejectedBill.is_finished = 1;
-              }
-            });
-          });
-
-          tempTip.setDuration(1000);
-          tempTip.showSuccess('标记勾选内容为完结成功');
-        } else {
-          tempTip.setDuration(2500);
-          tempTip.show('标记勾选内容为完结失败,错误:' + response.data.fail_info);
-        }
-      })["catch"](function (e) {
-        alert('网络连接错误:' + e);
-        tempTip.setDuration(2500);
-        tempTip.show('标记勾选内容完结失败,网络连接错误:' + e);
-        console.log(e);
-      });
-    },
-    exportExcel: function exportExcel(val) {
-      var _this = this;
-      var form;
-        alert(val);
-      if (val === "1") {
-        if (_this.rejectedBills_checkBoxes.length === 0) {
-          tempTip.show('没有勾选记录');
-          return;
-        }
-
-        form = $('<form action=\"' + exportExcelURL + '\" method="post" target="_blank"></form>');
-        form.append('<input type="hidden" name="ids" value=\'' + JSON.stringify(_this.rejectedBills_checkBoxes) + '\'/>');
-      }
-
-      if (val === "2") {
-        if (!confirm("确定要导出当前条件下全部页的结果吗?")) {
-          return;
-        }
-
-        if (total > 100000) {
-          tempTip.okWindow('当前导出记录超过100000条,将不会导出已完结的记录', '知道了');
-        }
-
-        form = $('<form action=\"' + exportExcelOnFilterParamsURL + '\" method="post" target="_blank"></form>');
-        form.append('<input type="hidden" name="filterParams" value=\'' + JSON.stringify(_this.filterParams) + '\'/>');
-      }
-
-      form.append(csrfInput);
-      $('#list').append(form);
-      form.submit();
-      tempTip.setDuration(5000);
-      tempTip.showSuccess("导出成功,如无结果则是被浏览器拦截新窗口,请尝试再次请求,或关闭浏览器对当前页面的弹出窗口拦截");
-    },
-    setPaginate: function setPaginate(e) {
-      var _this = this; // let val=$(e.target).val();
-
-
-      this.filterParams.paginate = e.target.value;
-      this.filterRun();
-    }
-  },
-  computed: {
-    isBeingFilterConditions: function isBeingFilterConditions() {
-      for (var key in this.filterParams) {
-        if (this.filterParams[key]) {
-          if (key === 'paginate') continue;
-          if (key === 'page') continue;
-          return true;
-        }
-      }
-
-      return false;
-    }
-  },
-  filters: {
-    yesNo: function yesNo(val) {
-      if (!val || val === 0 || val === '0') {
-        return '否';
-      }
-
-      return '是';
-    },
-    yesNoIsLoaded: function yesNoIsLoaded(val) {
-      switch (val) {
-        case 0:
-        case '0':
-          return '否';
-
-        case 1:
-        case '1':
-          return '是';
-
-        case 2:
-        case '2':
-          return '待推单';
-
-        case null:
-        case 'null':
-          return '无需入库';
-      }
-
-      return '';
-    }
-  }
-});
-
-/***/ }),
-
-/***/ 2:
-/*!*****************************************************!*\
-  !*** multi ./resources/js/singles/rejectedIndex.js ***!
-  \*****************************************************/
-/*! no static exports found */
-/***/ (function(module, exports, __webpack_require__) {
-
-module.exports = __webpack_require__(/*! D:\Reald\desktop\BsWAS\src\resources\js\singles\rejectedIndex.js */"./resources/js/singles/rejectedIndex.js");
-
-
-/***/ })
-
-/******/ });

+ 0 - 401
resources/js/singles/rejectedIndex.js

@@ -1,401 +0,0 @@
-let vueList=new Vue({
-    el:"#list",
-    data:{
-        filterParams:{created_at:'',owner_id:'',order_number:'',logistic_number_return:'',mobile_sender:'',barcode_goods:'',id_logistic_return:'',
-            is_checked:'',created_at_start:'',created_at_end:'',id_quality_label:'',is_loaded:'',checked_numbers:'',paginate:'50'},
-        checkBoxAll:[],
-        rejectedBills:rejectedBills,
-        rejectedBills_checkBoxes:[],
-        owners:owners,
-        logistics:logistics,
-        qualityLabels:qualityLabels,
-    },
-    mounted:function(){
-        $(".tooltipTarget").tooltip({'trigger':'hover'});
-        this.initInputs();
-        $('#list').removeClass('d-none');
-    },
-    methods:{
-        filterRun:function(){
-            let form=$("<form method='get'></form>");
-            this.filterParams['page']='';
-            for(let key in this.filterParams){
-                if(this.filterParams[key]){
-                    form.append($("<input type='hidden' name='"+key+"' value='"+this.filterParams[key]+"'>"));
-                }
-            }
-            $("body").append(form);
-            form.submit();
-        },
-        searchByFilters:function(e){
-            this.filterRun();
-        },
-        created_at_startChange:function(e){
-            this.filterParams.created_at_start=e.target.value;
-            this.filterRun();
-        },
-        created_at_endChange:function(e){
-            this.filterParams.created_at_end=e.target.value;
-            this.filterRun();
-        },
-        owner_idChange:function(e){
-            this.filterParams.owner_id=e.target.value;
-            this.filterRun();
-        },
-        is_checkedChange:function(e){
-            this.filterParams.is_checked=e.target.value;
-            this.filterRun();
-        },
-        id_quality_labelChange:function(e){
-            this.filterParams.id_quality_label=e.target.value;
-            this.filterRun();
-        },
-        is_loadedChange:function(e){
-            this.filterParams.is_loaded=e.target.value;
-            this.filterRun();
-        },
-        id_logistic_return_change:function(e){
-            this.filterParams.id_logistic_return=e.target.value;
-            this.filterRun();
-        },
-        initInputs:function(){
-            let data=this;
-            // let uriParts = decodeURI(location.href).split("?");
-            // if(uriParts.length>1){
-            //     let params = uriParts[1].split('&');
-            //     params.forEach(function(paramPair){
-            //         let pair=paramPair.split('=');
-            //         let key = pair[0], val = pair[1];
-            //         $('input[name="'+key+'"]').val(val);
-            //         $('select[name="'+key+'"]').val(val);
-            //         data.filterParams[key]=val;
-            //     });
-            // }
-            for(let key in paginateParams){
-                let val = paginateParams[key];
-                $('input[name="'+key+'"]').val(val);
-                $('select[name="'+key+'"]').val(val);
-                data.filterParams[key]=val;
-            }
-
-        },
-        edit:function(e){
-            let id = $(e.target).parents('tr').attr('data-id');
-            let editFullUri = editUrl+id+"/edit";
-            // location.href = editFullUri;
-            let form=$('<form action=\"'+editFullUri+'\" method="post" target="_blank"></form>');
-            form.append('<input type="hidden" name="filterParams" value=\''+JSON.stringify(this.filterParams)+'\'/>');
-            form.append(csrfInput);
-            $('body').append(form);
-            form.submit();
-        },
-        destroy:function(rejectedBill){
-            if(!confirm('确定要删除退货信息“' + rejectedBill.owner.name+':'+rejectedBill.logistic_number_return+ '”吗?')){return;}
-            let data=this;
-            let url = destroyUrl+rejectedBill.id;
-            axios.delete(url,{id:rejectedBill.id})
-                .then(function (response) {
-                    if(response.data.success){
-                        for (let i = 0; i < data.rejectedBills.length; i++) {
-                            if (data.rejectedBills[i].id===rejectedBill.id){
-                                data.rejectedBills.splice(i,1);
-                                break;
-                            }
-                        }
-                        tempTip.setDuration(1000);
-                        tempTip.showSuccess('删除退货信息"'+rejectedBill.owner.name+':'+rejectedBill.logistic_number_return+'"成功!')
-                    }else{
-                        tempTip.setDuration(1000);
-                        tempTip.show('删除退货信息"'+rejectedBill.owner.name+':'+rejectedBill.logistic_number_return+'"失败!')
-                    }
-                })
-                .catch(function (err) {
-                    tempTip.setDuration(3000);
-                    tempTip.show('删除退货信息失败!'+'网络错误:' + err);
-                    console.log(err);
-                });
-        },
-        submitFilterOnEnter:function(e){
-            if(e.key==='Enter'){
-                this.filterRun();
-            }
-        },
-        created_at_startEntering:function(e){
-            if(e.key==='Enter'){
-                this.created_at_startChange(e)
-            }
-        },
-        created_at_endEntering:function(e){
-            if(e.key==='Enter'){
-                this.created_at_endChange(e)
-            }
-        },
-        owner_idEntering:function(e){
-            if(e.key==='Enter'){
-                e.target.value=$('#owner_id').val();
-                this.owner_idChange(e);
-                e.target.value='';
-            }
-        },
-        locateOwner:function (e) {
-            str = e.target.value.trim()
-            if (str==='')return ;
-            $("#owner_id option").attr("selected",false);
-            let selectingOption=$("#owner_id").find("option:contains("+str+")").eq(0);
-            selectingOption.attr("selected",true);
-            this.filterParams.owner_id=selectingOption.val();
-        },
-        mobile_senderEntering:function(e){
-            this.filterParams.mobile_sender=e.target.value;
-            if(e.key==='Enter'){
-                this.filterRun();
-            }
-        },
-        order_numberEntering:function(e){
-            this.filterParams.order_number=e.target.value;
-            if(e.key==='Enter'){
-                this.filterRun();
-            }
-        },
-        barcode_goodsEntering:function(e){
-            this.filterParams.barcode_goods=e.target.value;
-            if(e.key==='Enter'){
-                this.filterRun();
-            }
-        },
-        checked_numbersEntering:function(e){
-            this.filterParams.checked_numbers=e.target.value;
-            if(e.key==='Enter'){
-                this.filterRun();
-            }
-        },
-        logistic_number_returnEntering:function(e){
-            this.filterParams.logistic_number_return=e.target.value;
-            if(e.key==='Enter'){
-                this.filterRun();
-            }
-        },
-        logistic_numberEntering:function(e){
-            this.filterParams.logistic_number=e.target.value;
-            if(e.key==='Enter'){
-                this.filterRun();
-            }
-        },
-        cancelCheckConfirmAll:function(){
-            $('#checkConfirmingAll').tooltip('hide');
-            setTimeout(function () {
-                $(".tooltipTarget").tooltip({'trigger':'hover'})
-            }, 10);
-            this.checkBoxAll=false;
-            this.rejectedBills.forEach(function(rejectedBill){
-                if(rejectedBill.is_checked===-1)
-                    rejectedBill.is_checked='0';
-            })
-        },
-        setIsLoaded_batch:function(val){
-            let _this=this;
-            if(_this.rejectedBills_checkBoxes.length===0){
-                tempTip.show('没有勾选记录');
-                $(e.target).val("");
-                return;
-            }
-            let is_loaded=0;
-            let is_loadedLabel='否';
-            if(parseInt(val)===1){
-                is_loaded=1;
-                is_loadedLabel='是';
-            }else if(parseInt(val)===2){
-                is_loaded=2;
-                is_loadedLabel='待推单';
-            }else if(parseInt(val)===4){
-                is_loaded=4;
-                is_loadedLabel='待确认';
-            }else if(val==="null"){
-                is_loaded='null';
-                is_loadedLabel='无需入库';
-            }
-            if(!confirm("确定要标记所有勾选入库情况为'"+is_loadedLabel+"'吗")){return;}
-            axios.post(ajaxCheckUrl,{ids:_this.rejectedBills_checkBoxes,is_loaded:is_loaded}).then(function(response){
-                if(response.data.success){
-                    _this.rejectedBills_checkBoxes.forEach(function(id){
-                        _this.rejectedBills.forEach(function(bill){
-                            if(bill.id===id){
-                                bill.is_loaded=is_loaded;
-                            }
-                        });
-                    });
-                    tempTip.setDuration(1000);
-                    tempTip.showSuccess('修改勾选记录的入库状态成功');
-                }else{
-                    tempTip.setDuration(2500);
-                    tempTip.show('修改勾选记录的入库状态失败,错误:'+response.data.fail_info);
-                }
-            }).catch(function (e) {
-                alert('网络连接错误:'+e);
-                tempTip.setDuration(2500);
-                tempTip.show('审核勾选内容失败,网络连接错误:'+e);
-                console.log(e);
-            });
-            $(e.target).val("")
-        },
-        checkBoxAllToggle:function(e){
-            let _this=this;
-            if(_this.rejectedBills_checkBoxes.length>=this.rejectedBills.length){
-                _this.rejectedBills_checkBoxes=[];
-                _this.checkBoxAll=[];
-            }
-            else{
-                _this.rejectedBills_checkBoxes=[];
-                this.rejectedBills.forEach(function(bill){
-                    _this.rejectedBills_checkBoxes.push(bill.id);
-                    _this.checkBoxAll=[1];
-                });
-            }
-        },
-        checkAll:function(){
-            let _this=this;
-            if(_this.rejectedBills_checkBoxes.length===0){
-                tempTip.show('没有勾选记录');
-                return
-            }
-            if(!confirm("确定要标记所有勾选内容为'已审核'吗")){return;}
-            axios.post(ajaxCheckAllURL,{ids:_this.rejectedBills_checkBoxes}).then(function(response){
-                if(response.data.success){
-                    response.data.rejecteds.forEach(function (rejected) {
-                        _this.rejectedBills.forEach(function(rejectedBill){
-                            if(parseInt(rejectedBill.id)===parseInt(rejected.id)){
-                                rejectedBill.is_checked=1;
-                                rejectedBill.checked_numbers=rejected.checked_numbers;
-                            }
-                        });
-                    });
-                    tempTip.setDuration(1000);
-                    tempTip.showSuccess('审核勾选内容成功');
-                }else{
-                    tempTip.setDuration(2500);
-                    tempTip.show('审核勾选内容失败,错误:'+response.data.fail_info);
-                }
-            }).catch(function (e) {
-                alert('网络连接错误:'+e);
-                tempTip.setDuration(2500);
-                tempTip.show('审核勾选内容失败,网络连接错误:'+e);
-                console.log(e);
-            })
-        },
-        confirmBeStored:function($e,id){
-            let _this=this;
-            axios.post(ajaxConfirmBeStoredUrl,{id:id}).then(function(response){
-                if(response.data.success){
-                    _this.rejectedBills.forEach(function(rejectedBill){
-                        if(rejectedBill.id===id){
-                            rejectedBill.is_loaded=1;
-                        }
-                    });
-                    tempTip.setDuration(1000);
-                    tempTip.showSuccess('确认入库成功');
-                }else{
-                    tempTip.setDuration(2500);
-                    tempTip.okWindow('数据异常无法确认!请在WMS确定入库状态后,勾选该条目手动修改相应入库状态!','知道了')
-                }
-            }).catch(function (e) {
-                alert('确认失败,网络连接错误:'+e);
-                tempTip.setDuration(2500);
-                tempTip.show('确认失败,网络连接错误:'+e);
-                console.log(e);
-            })
-        },
-        finishAll:function(){
-            let _this=this;
-            if(_this.rejectedBills_checkBoxes.length===0){
-                tempTip.show('没有勾选记录');
-                return
-            }
-            if(!confirm("确定要标记所有勾选内容为'已完结'吗")){return;}
-            axios.post(ajaxFinishAllUrl,{ids:_this.rejectedBills_checkBoxes}).then(function(response){
-                if(response.data.success){
-                    _this.rejectedBills.forEach(function(rejectedBill){
-                        _this.rejectedBills_checkBoxes.forEach(function (checkedId) {
-                            if(rejectedBill.id===checkedId){
-                                rejectedBill.is_finished=1;
-                            }
-                        });
-                    });
-                    tempTip.setDuration(1000);
-                    tempTip.showSuccess('标记勾选内容为完结成功');
-                }else{
-                    tempTip.setDuration(2500);
-                    tempTip.show('标记勾选内容为完结失败,错误:'+response.data.fail_info);
-                }
-            }).catch(function (e) {
-                alert('网络连接错误:'+e);
-                tempTip.setDuration(2500);
-                tempTip.show('标记勾选内容完结失败,网络连接错误:'+e);
-                console.log(e);
-            })
-        },
-        exportExcel:function(val){
-            let _this=this;
-            let form;
-            if(parseInt(val)===1){
-                if(_this.rejectedBills_checkBoxes.length===0){
-                    tempTip.show('没有勾选记录');
-                    return;
-                }
-                form=$('<form action=\"'+exportExcelURL+'\" method="post" target="_blank"></form>');
-                form.append('<input type="hidden" name="ids" value=\''+JSON.stringify(_this.rejectedBills_checkBoxes)+'\'/>');
-                form.append('<input type="hidden" name="created_at_start" value=\''+JSON.stringify(_this.created_at_start)+'\'/>');
-                form.append('<input type="hidden" name="created_at_end" value=\''+JSON.stringify(_this.created_at_end)+'\'/>');
-            }
-            if(parseInt(val)===2){
-                if(!confirm("确定要导出当前条件下全部页的结果吗?")){return;}
-                if(total>100000){
-                    tempTip.okWindow('当前导出记录超过100000条,将不会导出已完结的记录','知道了')
-                }
-                form=$('<form action=\"'+exportExcelOnFilterParamsURL+'\" method="post" target="_blank"></form>');
-                form.append('<input type="hidden" name="filterParams" value=\''+JSON.stringify(_this.filterParams)+'\'/>');
-
-            }
-            form.append(csrfInput);
-            $('#list').append(form);
-            form.submit();
-            tempTip.setDuration(5000);
-            tempTip.showSuccess("导出成功,如无结果则是被浏览器拦截新窗口,请尝试再次请求,或关闭浏览器对当前页面的弹出窗口拦截")
-        },
-        setPaginate:function(e){
-            let _this=this;
-            // let val=$(e.target).val();
-            this.filterParams.paginate=e.target.value;
-            this.filterRun();
-        },
-
-    },
-    computed:{
-        isBeingFilterConditions:function(){
-            for(let key in this.filterParams){
-                if(this.filterParams[key]){
-                    if(key==='paginate')continue;
-                    if(key==='page')continue;
-                    return true
-                }
-            }
-            return false;
-        }
-    },
-    filters:{
-        yesNo:function (val) {
-            if(!val||val===0||val==='0'){return '否'}
-            return '是'
-        },
-        yesNoIsLoaded:function (val) {
-            switch(val){
-                case 0:case '0':return '否';
-                case 1:case '1':return '是';
-                case 2:case '2':return '待推单';
-                case 3:case '3':return '交互异常';
-                case 4:case '4':return '待确认';
-                case null:case 'null':return '无需入库';
-            }
-            return '';
-        }
-    }
-});

+ 0 - 396
resources/js/singles/searchAnalyze.js

@@ -1,396 +0,0 @@
-
-let vueList=new Vue({
-    el:"#list",
-    data:{
-        filterParams:{created_at:'',owner_id:'',
-            //,order_number:'',logistic_number_return:'',mobile_sender:'',barcode_goods:'',
-            //is_checked:'',
-            created_at_start:'',created_at_end:'',
-            //id_quality_label:'',
-            //is_loaded:'',
-            //checked_numbers:'',
-           // paginate:'50'
-        },
-        checkBoxAll:[],
-        rejectedBills:rejectedBills,
-        rejectedBills_checkBoxes:[],
-        owners:owners,
-        qualityLabels:qualityLabels,
-    },
-    mounted:function(){
-        $(".tooltipTarget").tooltip({'trigger':'hover'});
-        this.initInputs();
-        $('#list').removeClass('d-none');
-    },
-    methods:{
-        filterRun:function(){
-            let form=$("<form method='get'></form>");
-            this.filterParams['page']='';
-            for(let key in this.filterParams){
-                if(this.filterParams[key]){
-                    form.append($("<input type='hidden' name='"+key+"' value='"+this.filterParams[key]+"'>"));
-                }
-            }
-            $("body").append(form);
-            form.submit();
-        },
-        searchByFilters:function(e){
-            this.filterRun();
-        },
-        created_at_startChange:function(e){
-            this.filterParams.created_at_start=e.target.value;
-            this.filterRun();
-        },
-        created_at_endChange:function(e){
-            this.filterParams.created_at_end=e.target.value;
-            this.filterRun();
-        },
-        owner_idChange:function(e){
-            this.filterParams.owner_id=e.target.value;
-            this.filterRun();
-        },
-        is_checkedChange:function(e){
-            this.filterParams.is_checked=e.target.value;
-            this.filterRun();
-        },
-        id_quality_labelChange:function(e){
-            this.filterParams.id_quality_label=e.target.value;
-            this.filterRun();
-        },
-        is_loadedChange:function(e){
-            this.filterParams.is_loaded=e.target.value;
-            this.filterRun();
-        },
-        initInputs:function(){
-            let data=this;
-            let uriParts = decodeURI(location.href).split("?");
-            if(uriParts.length>1){
-                let params = uriParts[1].split('&');
-                params.forEach(function(paramPair){
-                    let pair=paramPair.split('=');
-                    let key = pair[0], val = pair[1];
-                    $('input[name="'+key+'"]').val(val);
-                    $('select[name="'+key+'"]').val(val);
-                    data.filterParams[key]=val;
-                });
-            }
-            for(let key in paginateParams){
-                let val = paginateParams[key];
-                $('input[name="'+key+'"]').val(val);
-                $('select[name="'+key+'"]').val(val);
-                data.filterParams[key]=val;
-            }
-
-        },
-        // edit:function(e){
-        //     let id = $(e.target).parents('tr').attr('data-id');
-        //     let editFullUri = editUrl+id+"/edit";
-        //     // location.href = editFullUri;
-        //     let form=$('<form action=\"'+editFullUri+'\" method="post" target="_blank"></form>');
-        //     form.append('<input type="hidden" name="filterParams" value=\''+JSON.stringify(this.filterParams)+'\'/>');
-        //     form.append(csrfInput);
-        //     $('body').append(form);
-        //     form.submit();
-        // },
-        // destroy:function(rejectedBill){
-        //     if(!confirm('确定要删除退货信息“' + rejectedBill.owner.name+':'+rejectedBill.logistic_number_return+ '”吗?')){return;}
-        //     let data=this;
-        //     let url = destroyUrl+rejectedBill.id;
-        //     axios.delete(url,{id:rejectedBill.id})
-        //         .then(function (response) {
-        //             if(response.data.success){
-        //                 for (let i = 0; i < data.rejectedBills.length; i++) {
-        //                     if (data.rejectedBills[i].id===rejectedBill.id){
-        //                         data.rejectedBills.splice(i,1);
-        //                         break;
-        //                     }
-        //                 }
-        //                 tempTip.setDuration(1000);
-        //                 tempTip.showSuccess('删除退货信息"'+rejectedBill.owner.name+':'+rejectedBill.logistic_number_return+'"成功!')
-        //             }else{
-        //                 tempTip.setDuration(1000);
-        //                 tempTip.show('删除退货信息"'+rejectedBill.owner.name+':'+rejectedBill.logistic_number_return+'"失败!')
-        //             }
-        //         })
-        //         .catch(function (err) {
-        //             tempTip.setDuration(3000);
-        //             tempTip.show('删除退货信息失败!'+'网络错误:' + err);
-        //             console.log(err);
-        //         });
-        // },
-        submitFilterOnEnter:function(e){
-            if(e.key==='Enter'){
-                this.filterRun();
-            }
-        },
-        created_at_startEntering:function(e){
-            if(e.key==='Enter'){
-                this.created_at_startChange(e)
-            }
-        },
-        created_at_endEntering:function(e){
-            if(e.key==='Enter'){
-                this.created_at_endChange(e)
-            }
-        },
-        owner_idEntering:function(e){
-            if(e.key==='Enter'){
-                e.target.value=$('#owner_id').val();
-                this.owner_idChange(e);
-                e.target.value='';
-            }
-        },
-        locateOwner:function (e) {
-            str = e.target.value.trim()
-            if (str==='')return ;
-            $("#owner_id option").attr("selected",false);
-            let selectingOption=$("#owner_id").find("option:contains("+str+")").eq(0);
-            selectingOption.attr("selected",true);
-            this.filterParams.owner_id=selectingOption.val();
-        },
-        // mobile_senderEntering:function(e){
-        //     this.filterParams.mobile_sender=e.target.value;
-        //     if(e.key==='Enter'){
-        //         this.filterRun();
-        //     }
-        // },
-        // order_numberEntering:function(e){
-        //     this.filterParams.order_number=e.target.value;
-        //     if(e.key==='Enter'){
-        //         this.filterRun();
-        //     }
-        // },
-        // barcode_goodsEntering:function(e){
-        //     this.filterParams.barcode_goods=e.target.value;
-        //     if(e.key==='Enter'){
-        //         this.filterRun();
-        //     }
-        // },
-        // checked_numbersEntering:function(e){
-        //     this.filterParams.checked_numbers=e.target.value;
-        //     if(e.key==='Enter'){
-        //         this.filterRun();
-        //     }
-        // },
-        logistic_number_returnEntering:function(e){
-            this.filterParams.logistic_number_return=e.target.value;
-            if(e.key==='Enter'){
-                this.filterRun();
-            }
-        },
-        logistic_numberEntering:function(e){
-            this.filterParams.logistic_number=e.target.value;
-            if(e.key==='Enter'){
-                this.filterRun();
-            }
-        },
-        cancelCheckConfirmAll:function(){
-            $('#checkConfirmingAll').tooltip('hide');
-            setTimeout(function () {
-                $(".tooltipTarget").tooltip({'trigger':'hover'})
-            }, 10);
-            this.checkBoxAll=false;
-            this.rejectedBills.forEach(function(rejectedBill){
-                if(rejectedBill.is_checked===-1)
-                    rejectedBill.is_checked='0';
-            })
-        },
-        // setIsLoaded_batch:function(val){
-        //     let _this=this;
-        //     if(_this.rejectedBills_checkBoxes.length===0){
-        //         tempTip.show('没有勾选记录');
-        //         $(e.target).val("");
-        //         return;
-        //     }
-        //     let is_loaded=0;
-        //     let is_loadedLabel='否';
-        //     if(parseInt(val)===1){
-        //         is_loaded=1;
-        //         is_loadedLabel='是';
-        //     }else if(parseInt(val)===2){
-        //         is_loaded=2;
-        //         is_loadedLabel='待推单';
-        //     }else if(parseInt(val)===4){
-        //         is_loaded=4;
-        //         is_loadedLabel='待确认';
-        //     }else if(val==="null"){
-        //         is_loaded='null';
-        //         is_loadedLabel='无需入库';
-        //     }
-        //     if(!confirm("确定要标记所有勾选入库情况为'"+is_loadedLabel+"'吗")){return;}
-        //     axios.post(ajaxCheckUrl,{ids:_this.rejectedBills_checkBoxes,is_loaded:is_loaded}).then(function(response){
-        //         if(response.data.success){
-        //             _this.rejectedBills_checkBoxes.forEach(function(id){
-        //                 _this.rejectedBills.forEach(function(bill){
-        //                     if(bill.id===id){
-        //                         bill.is_loaded=is_loaded;
-        //                     }
-        //                 });
-        //             });
-        //             tempTip.setDuration(1000);
-        //             tempTip.showSuccess('修改勾选记录的入库状态成功');
-        //         }else{
-        //             tempTip.setDuration(2500);
-        //             tempTip.show('修改勾选记录的入库状态失败,错误:'+response.data.fail_info);
-        //         }
-        //     }).catch(function (e) {
-        //         alert('网络连接错误:'+e);
-        //         tempTip.setDuration(2500);
-        //         tempTip.show('审核勾选内容失败,网络连接错误:'+e);
-        //         console.log(e);
-        //     });
-        //     $(e.target).val("")
-        // },
-        checkBoxAllToggle:function(e){
-            let _this=this;
-            if(_this.rejectedBills_checkBoxes.length>=this.rejectedBills.length){
-                _this.rejectedBills_checkBoxes=[];
-                _this.checkBoxAll=[];
-            }
-            else{
-                _this.rejectedBills_checkBoxes=[];
-                this.rejectedBills.forEach(function(bill){
-                    _this.rejectedBills_checkBoxes.push(bill.id);
-                    _this.checkBoxAll=[1];
-                });
-            }
-        },
-        // checkAll:function(){
-        //     let _this=this;
-        //     if(_this.rejectedBills_checkBoxes.length===0){
-        //         tempTip.show('没有勾选记录');
-        //         return
-        //     }
-        //     if(!confirm("确定要标记所有勾选内容为'已审核'吗")){return;}
-        //     axios.post(ajaxCheckAllURL,{ids:_this.rejectedBills_checkBoxes}).then(function(response){
-        //         if(response.data.success){
-        //             response.data.rejecteds.forEach(function (rejected) {
-        //                 _this.rejectedBills.forEach(function(rejectedBill){
-        //                     if(parseInt(rejectedBill.id)===parseInt(rejected.id)){
-        //                         rejectedBill.is_checked=1;
-        //                         rejectedBill.checked_numbers=rejected.checked_numbers;
-        //                     }
-        //                 });
-        //             });
-        //             tempTip.setDuration(1000);
-        //             tempTip.showSuccess('审核勾选内容成功');
-        //         }else{
-        //             tempTip.setDuration(2500);
-        //             tempTip.show('审核勾选内容失败,错误:'+response.data.fail_info);
-        //         }
-        //     }).catch(function (e) {
-        //         alert('网络连接错误:'+e);
-        //         tempTip.setDuration(2500);
-        //         tempTip.show('审核勾选内容失败,网络连接错误:'+e);
-        //         console.log(e);
-        //     })
-        // },
-        // confirmBeStored:function($e,id){
-        //     let _this=this;
-        //     axios.post(ajaxConfirmBeStoredUrl,{id:id}).then(function(response){
-        //         if(response.data.success){
-        //             _this.rejectedBills.forEach(function(rejectedBill){
-        //                 if(rejectedBill.id===id){
-        //                     rejectedBill.is_loaded=1;
-        //                 }
-        //             });
-        //             tempTip.setDuration(1000);
-        //             tempTip.showSuccess('确认入库成功');
-        //         }else{
-        //             tempTip.setDuration(2500);
-        //             tempTip.okWindow('数据异常无法确认!请在WMS确定入库状态后,勾选该条目手动修改相应入库状态!','知道了')
-        //         }
-        //     }).catch(function (e) {
-        //         alert('确认失败,网络连接错误:'+e);
-        //         tempTip.setDuration(2500);
-        //         tempTip.show('确认失败,网络连接错误:'+e);
-        //         console.log(e);
-        //     })
-        // },
-        // finishAll:function(){
-        //     let _this=this;
-        //     if(_this.rejectedBills_checkBoxes.length===0){
-        //         tempTip.show('没有勾选记录');
-        //         return
-        //     }
-        //     if(!confirm("确定要标记所有勾选内容为'已完结'吗")){return;}
-        //     axios.post(ajaxFinishAllUrl,{ids:_this.rejectedBills_checkBoxes}).then(function(response){
-        //         if(response.data.success){
-        //             _this.rejectedBills.forEach(function(rejectedBill){
-        //                 _this.rejectedBills_checkBoxes.forEach(function (checkedId) {
-        //                     if(rejectedBill.id===checkedId){
-        //                         rejectedBill.is_finished=1;
-        //                     }
-        //                 });
-        //             });
-        //             tempTip.setDuration(1000);
-        //             tempTip.showSuccess('标记勾选内容为完结成功');
-        //         }else{
-        //             tempTip.setDuration(2500);
-        //             tempTip.show('标记勾选内容为完结失败,错误:'+response.data.fail_info);
-        //         }
-        //     }).catch(function (e) {
-        //         alert('网络连接错误:'+e);
-        //         tempTip.setDuration(2500);
-        //         tempTip.show('标记勾选内容完结失败,网络连接错误:'+e);
-        //         console.log(e);
-        //     })
-        // },
-        exportExcel:function(val){
-            let _this=this;
-            let form;
-             if(parseInt(val)===1){
-                if(_this.rejectedBills_checkBoxes.length===0){
-                    tempTip.show('没有勾选记录');
-                    return;
-                }
-                form=$('<form action=\"'+exportExcelURL+'\" method="post" target="_blank"></form>');
-                form.append('<input type="hidden" name="ids" value=\''+JSON.stringify(_this.rejectedBills_checkBoxes)+'\'/>');
-            }
-            if(parseInt(val)===2){
-                if(!confirm("确定要导出当前条件下全部页的结果吗?")){return;}
-               /* if(total>100000){
-                    tempTip.okWindow('当前导出记录超过100000条,将不会导出已完结的记录','知道了')
-                }*/
-                form=$('<form action=\"'+exportExcelOnFilterParamsURL+'\" method="post" target="_blank"></form>');
-                form.append('<input type="hidden" name="owner_id" value=\''+JSON.stringify(_this.filterParams.owner_id)+'\'/>');
-            }
-            form.append('<input type="hidden" name="created_at_start" value=\''+JSON.stringify(_this.filterParams.created_at_start)+'\'/>');
-            form.append('<input type="hidden" name="created_at_end" value=\''+JSON.stringify(_this.filterParams.created_at_end)+'\'/>');
-            form.append(csrfInput);
-            $('#list').append(form);
-            form.submit();
-            tempTip.setDuration(5000);
-            tempTip.showSuccess("导出成功,如无结果则是被浏览器拦截新窗口,请尝试再次请求,或关闭浏览器对当前页面的弹出窗口拦截")
-        },
-    },
-    computed:{
-        isBeingFilterConditions:function(){
-            for(let key in this.filterParams){
-                if(this.filterParams[key]){
-                    if(key==='paginate')continue;
-                    if(key==='page')continue;
-                    return true
-                }
-            }
-            return false;
-        }
-    },
-    // filters:{
-    //     yesNo:function (val) {
-    //         if(!val||val===0||val==='0'){return '否'}
-    //         return '是'
-    //     },
-    //     yesNoIsLoaded:function (val) {
-    //         switch(val){
-    //             case 0:case '0':return '否';
-    //             case 1:case '1':return '是';
-    //             case 2:case '2':return '待推单';
-    //             case 3:case '3':return '交互异常';
-    //             case 4:case '4':return '待确认';
-    //             case null:case 'null':return '无需入库';
-    //         }
-    //         return '';
-    //     }
-    // }
-});

+ 33 - 11
resources/js/utilities/sort.js

@@ -1,5 +1,6 @@
-var i=0;
-function sort(array = [{id:12,name:'a12458',value:'周及'},{id:15,name:'d12458',value:'蓝及'}]) {
+var result = [];
+var type = true;
+function sort(array , column , i) {
     let data = {};
     data['0']='';data['1']='';data['2']='';data['3']='';data['4']='';data['5']='';data['6']='';data['7']='';data['8']='';
     data['9']='';data['a']='';data['b']='';data['c']='';data['d']='';data['e']='';data['f']='';data['g']='';data['h']='';
@@ -9,24 +10,45 @@ function sort(array = [{id:12,name:'a12458',value:'周及'},{id:15,name:'d12458'
     data['J']='';data['K']='';data['L']='';data['M']='';data['N']='';data['O']='';data['P']='';data['Q']='';data['R']='';
     data['S']='';data['T']='';data['U']='';data['V']='';data['W']='';data['X']='';data['Y']='';data['Z']='';
     array.forEach(function (obj) {
-        if (!data[obj.name.charAt(i)])  data[obj.name.charAt(i)] = [obj];
-        data[obj.name.charAt(i)] = data[obj.name.charAt(i)].push(obj);
+        if (!data[obj[column].charAt(i)])  data[obj[column].charAt(i)] = [obj];
+        else data[obj[column].charAt(i)].push(obj);
     });
+    let recursion=[];
     for (let key in data){
         if (!data[key]){
             delete data[key];
             continue;
         }
         if (data[key].length > 1){
-            if ( !data[key].some(function (value, index) {
-                return value !== array[0];
-            })) continue;
-            else {
-                i=0;
-                data[key] = this.sort(data[key]);
+            if ( !(!data[key].some(function (value, index) {
+                return value[column] !== data[key][0][column];
+            }))){
+                recursion.push(key);
             }
         }
     }
-    i++;
+    if (recursion.length > 0){
+        i++;
+        recursion.forEach(function (key) {
+            data[key] = this.sort(data[key] ,column , i);
+        });
+    }
     return data;
+}
+
+function sortInit(array, column ,type, i=0 ) {
+    result = [];
+    if (type === 'up') this.type = true;
+    else this.type = false;
+    merge(sort(array, column, i));
+    return result;
+}
+
+function merge(object) {
+    for (let key in object){
+        if (Array.isArray(object[key])){
+            if (this.type) result.push.apply(result,object[key]);
+            else result.unshift.apply(result,object[key]);
+        }else merge(object[key]);
+    }
 }

+ 10 - 0
resources/sass/text.scss

@@ -48,3 +48,13 @@
     -ms-user-select: none; /* Internet Explorer/Edge */
     user-select: none;
 }
+.fa-sort {
+    cursor: pointer;
+    opacity: 0.3;
+}
+.fa-sort-up{
+    cursor: pointer;
+}
+.fa-sort-down{
+    cursor: pointer;
+}

+ 18 - 4
resources/views/process/index.blade.php

@@ -168,9 +168,15 @@
                     <th>序号</th>
                     <th>操作</th>
                     <th>状态</th>
-                    <th>任务号</th>
+                    <th>
+                        <span class="fa" :class="sort.code ? (sort.code=='up' ? 'fa-sort-up' : 'fa-sort-down') : 'fa-sort'" @click="sortData('code')"></span>
+                        任务号
+                    </th>
                     <th>经手人</th>
-                    <th>货主</th>
+                    <th>
+                        <span class="fa" :class="sort.owner_name ? (sort.owner_name=='up' ? 'fa-sort-up' : 'fa-sort-down') : 'fa-sort'" @click="sortData('owner_name')"></span>
+                        货主
+                    </th>
                     <th>加工类型</th>
                     <th>预期数量</th>
                     <th class="text-center">教程</th>
@@ -477,7 +483,7 @@
 @section('lastScript')
     <script type="text/javascript" src="{{asset('js/queryForm/export200804.js')}}"></script>
     <script type="text/javascript" src="{{asset('js/queryForm/queryForm200804.js')}}"></script>
-    <script type="text/javascript" src="{{asset('js/sort.js')}}"></script>
+    <script type="text/javascript" src="{{asset('js/utilities/sort.js')}}"></script>
     <script>
         new Vue({
             el:"#process",
@@ -523,6 +529,7 @@
                 date:'',
                 dateTextMap:{'start_date':'起','end_date':'终'},
                 sum:{!! $processes->total() !!},
+                sort : {},
             },
             watch:{
                 checkData:{
@@ -1576,7 +1583,14 @@
                         tempTip.show('该日无参与人加工信息,请先录入参与人加工信息!');
                         processDailyParticipant.readonly=true;
                     }
-                }
+                },
+                //点击排序
+                sortData(column){
+                    let type = 'up';
+                    if (this.sort[column]==='up') type = 'down';
+                    this.$set(this.sort,column,type);
+                    this.processes = sortInit(this.processes, column, type);
+                },
             },
         });
     </script>

+ 3 - 4
webpack.mix.js

@@ -12,10 +12,7 @@ const mix = require('laravel-mix');
  */
 
 mix.js('resources/js/app.js', 'public/js')
-    .sass('resources/sass/app.scss', 'public/css/app200721.css');
-mix.js('resources/js/singles/rejectedIndex.js', 'public/js/singles/rejectedIndex200728.js');
-mix.js('resources/js/singles/searchAnalyze.js', 'public/js/singles/searchAnalyze200513.js');
-
+    .sass('resources/sass/app.scss', 'public/css/app200806.css');
 mix.copy('resources/sass/fonts/','public/fonts');
 mix.copy('resources/icon','public/icon');
 mix.copy('resources/images','public/images');
@@ -24,3 +21,5 @@ mix.js('resources/js/trix.js','public/js/trix.js');
 mix.copy('resources/sass/trix.css','public/css/trix.css');
 mix.copy('resources/js/queryForm/queryForm.js','public/js/queryForm/queryForm200804.js');
 mix.copy('resources/js/queryForm/export.js','public/js/queryForm/export200804.js');
+mix.copy('resources/js/utilities/sort.js','public/js/utilities/sort.js');
+