/**************************折线图******************************/ app.controller('QuanGuoChouJianCtrl', ['$scope', 'YPJBXXGL', '$uibModal', '$sessionStorage', '$state', '$http', '$filter', 'mainUrl', 'wyOdataNodeService', 'stConfig', '$timeout', function ($scope, YPJBXXGL, $uibModal, $sessionStorage, $state, $http, $filter, mainUrl, wyOdataNodeService, stConfig, $timeout, $uibModalInstance, item) { ////默认变量 //$scope.stateAll = 0;//抽检状态--下拉框 //$scope.TJTable = [];//查询条件数组 //$scope.wherestr = "";//查询条件string格式 //$scope.AllQGCJXX = function () { // console.log($scope.TJTable); // var wherestr = angular.toJson($scope.TJTable); // $scope.wherestr = wherestr; // $scope.layuiTable(); // //增加日志20211109 // addlog("全国抽检信息", "查询[" + $scope.wherestr + "]") //} ////layui表格 //$scope.layuiTable = function () { // if ($scope.stateAll==0) { // layui.use('table', function () { // var table = layui.table; // table.render({ // elem: '#QuanGuoChouJianTable' // , url: '/QuanGuoChouJian/GetQuanGuoChouJian?state=' + $scope.stateAll + '&wherestr=' + $scope.wherestr // , cols: [[ // { field: 'XH', width: 40, title: 'ID', sort: true } // , { field: 'SCQYMC', width: 120, title: '生产企业名称' } // , { field: 'SCQYDZ', width: 120, title: '生产企业地址', sort: true } // , { field: 'BCYDWMC', width: 130, title: '被抽样单位名称' } // , { field: 'BCYDWSF', title: '被抽样单位所在省份', minWidth: 160 } // , { field: 'SPMC', width: 110, title: '食品名称', sort: true } // , { field: 'GGXH', width: 110, title: '规格型号', sort: true } // , { field: 'SCRQ_PH', width: 130, title: '生产日期/批号' } // , { field: 'FL', width: 120, title: '分类', sort: true } // , { field: 'JYJG', width: 120, title: '检验机构', sort: true } // , { field: 'LY', width: 110, title: '来源(期)', sort: true } // , { field: 'LY2', width: 120, title: '来源(市局)', sort: true } // , { field: 'time', width: 110, title: '发布时间', sort: true} // ]] // , page: true // , done: function (res) { // $("#countid").html(); // $("#countid").append("10000"); // } // }); // }); // } // if ($scope.stateAll == 1) { // layui.use('table', function () { // var table = layui.table; // table.render({ // elem: '#test' // , url: '/home/AllQGCJXX?state=' + $scope.stateAll + '&wherestr=' + $scope.wherestr // , cols: [[ // { field: 'XH', width: 40, title: 'ID', sort: true } // , { field: 'SCQYMC', width: 120, title: '生产企业名称' } // , { field: 'SCQYDZ', width: 120, title: '生产企业地址', sort: true } // , { field: 'BCYDWMC', width: 130, title: '被抽样单位名称' } // , { field: 'BCYDWDZ', title: '被抽样单位所在地址', minWidth: 150 } // , { field: 'SPMC', width: 120, title: '食品名称', sort: true } // , { field: 'GGXH', width: 120, title: '规格型号', sort: true } // , { field: 'SB', width: 100, title: '商标', sort: true } // , { field: 'SCRQ_PH', width: 130, title: '生产日期/批号' } // , { field: 'BHGXM_JYJG_BZZ', width: 200, title: '不合格项目║检验结果║标准值' } // , { field: 'FL', width: 110, title: '分类', sort: true } // , { field: 'JYJG', width: 110, title: '检验机构', sort: true } // , { field: 'PZWH', width: 120, title: '批准文号', sort: true } // , { field: 'CPLB', width: 110, title: '产品类别', sort: true } // , { field: 'LY', width: 110, title: '来源(期)', sort: true } // , { field: 'LY2', width: 120, title: '来源(市局)', sort: true } // , { field: 'time', width: 110, title: '发布时间', sort: true } // ]] // , page: true // , done: function (res) { // $("#countid").html(); // $("#countid").append("10000"); // } // }); // }); // } //} //$scope.layuiTable(); //$scope.myttt = "等待查询结果"; //$scope.Myjson = [ // { "type": 1, "mytext": "生产企业名称", "PY": "SCQYMC" }, // { "type": 1, "mytext": "生产企业地址", "PY": "SCQYDZ" }, // { "type": 1, "mytext": "被抽样单位名称", "PY": "BCYDWMC" }, // { "type": 1, "mytext": "被抽样单位省份(合格)", "PY": "BCYDWSF" }, // { "type": 1, "mytext": "被抽样单位地址(不合格)", "PY": "BCYDWDZ" }, // { "type": 1, "mytext": "食品名称", "PY": "SPMC" }, // { "type": 1, "mytext": "规格型号", "PY": "GGXH" }, // { "type": 1, "mytext": "商标", "PY": "SB" }, // { "type": 1, "mytext": "分类", "PY": "FL" }, // { "type": 1, "mytext": "检验机构", "PY": "JYJG" }, // { "type": 1, "mytext": "来源(期)", "PY": "LY" }, // { "type": 1, "mytext": "来源(市局)", "PY": "LY2" }, // { "type": 1, "mytext": "发布日期", "PY": "str_to_date(time, '%Y-%m-%d')" }, //]; ////、定性值、、、、限量值、限量值单位、检测值、检测值单位、判定 //$scope.Myjson1 = [ // { "myvalue": 1, "mytext": "等于" }, // { "myvalue": 7, "mytext": "不等于" }, // { "myvalue": 2, "mytext": "包含" }, // { "myvalue": 8, "mytext": "不包含" }, // { "myvalue": 3, "mytext": "大于" }, // { "myvalue": 4, "mytext": "小于" }, // { "myvalue": 5, "mytext": "大于等于" }, // { "myvalue": 6, "mytext": "小于等于" }, //] ////时间格式 //function add0(m) { return m < 10 ? '0' + m : m } //function format(shijianchuo) { // //shijianchuo是整数,否则要parseInt转换 // var time = new Date(shijianchuo); // var y = time.getFullYear(); // var m = time.getMonth() + 1; // var d = time.getDate(); // //var h = time.getHours(); // //var mm = time.getMinutes(); // //var s = time.getSeconds(); // return y + '/' + add0(m) + '/' + add0(d);// + ' ' + add0(h) + ':' + add0(mm) + ':' + add0(s); //} ///***********************样品综合查询**************************/ ////添加条件 //$scope.TJTable = []; //$scope.RWLYSHOW = false; //$scope.SouSuoShow = true; //$scope.addTJ = function (tjtype) { // if ($scope.TJTable.length <= 0) { // tjtype = ""; // } // if (!$scope.isdate) { // var str = $("#dept").val(); // if (str != "? undefined:undefined ?") { // $scope.mytxt = str; // } // var aa = { // "lianjietype": tjtype, // "CXTJPY": $scope.mysel.PY, // "CXTJ": $scope.mysel.mytext, // "CXLX": $scope.mysel1.mytext, // "CXLXid": $scope.mysel1.myvalue, // "CXNR": $scope.mytxt, // } // if (aa.CXTJ == "选择" || aa.CXLX == "选择" || (str == "" && $scope.RWLYSHOW)) { // return; // } // var myll = Enumerable.From($scope.TJTable).Where(function (x) { return x.CXTJ == aa.CXTJ && x.CXLX == aa.CXLX && x.CXNR == aa.CXNR }).ToArray(); // if (myll.length > 0) { // alert("您已经添加过此条件"); // } else { // $scope.TJTable.push(aa); // } // } else { // var kaishishijian = format($scope.datebegin); // var jieshushijian = format($scope.dateend); // var aa1 = { // "lianjietype": tjtype, // "CXTJPY": $scope.mysel.mytext == "执行年月" ? "ZXNY_KS" : $scope.mysel.PY, // "CXTJ": $scope.mysel.mytext == "执行年月" ? "执行年月开始" : $scope.mysel.mytext, // "CXLX": "大于等于", // "CXLXid": 5, // "CXNR": kaishishijian, // } // var aa2 = { // "lianjietype": "and", // "CXTJPY": $scope.mysel.mytext == "执行年月" ? "ZXNY_JS" : $scope.mysel.PY, // "CXTJ": $scope.mysel.mytext == "执行年月" ? "执行年月结束" : $scope.mysel.mytext, // "CXLX": "小于等于", // "CXLXid": 6, // "CXNR": jieshushijian, // } // $scope.TJTable.push(aa1); // $scope.TJTable.push(aa2); // } //} ////删除条件 //$scope.deleteTJ = function (index) { // var aa = $scope.TJTable.indexOf(index); // $scope.TJTable.splice(aa, 1); //} ////改变事件 //$scope.MyjsonChange = function () { // $scope.RELYdata = []; // $scope.myselpublic = undefined; // $scope.mytxt = ""; // switch ($scope.mysel.PY) { // case "str_to_date(time, '%Y-%m-%d')": // $scope.isdate = true; // $scope.RWLYSHOW = false; // $scope.SouSuoShow = false; // break; // default: // $scope.isdate = false; // $scope.RWLYSHOW = false; // $scope.SouSuoShow = true; // } // $timeout(function () { // $("#dept").trigger("chosen:updated"); // }, 100, false); //} //操作日志,目前没有用得上,虽然前面做了绑定,最后还是用了jquery的方法 $scope.searchJson = { BCSCQYMC: "", YPMC: "", BHGXM: "" } $scope.showtip = "只导出5000条以内" $scope.search = function () { console.log($("#BCSCQYMC").val(), $("#YPMC").val(), $("#BHGXM").val()) $scope.loadlog() } //$scope.exportcsv = function () { // //$("#ouser").val(), $("#otype").val(), $("#ocontent").val() // //$http.get( // // "/operateLog/ExportCsv?operateUser=" + $("#ouser").val() + // // "&operateType=" + $("#otype").val() + // // "&operateContent=" + $("#ocontent").val() // // ).then(function (mydata) { // // console.log("导出成功") // // }) // var strUrl = "/operateLog/ExportCsv?operateUser=" + $("#ouser").val() + // "&operateType=" + $("#otype").val() + // "&operateContent=" + $("#ocontent").val(); // $scope.showtip = "只导出5000条以内,正在导出,请稍等" // window.location.href = strUrl; // $scope.showtip = "只导出5000条以内" //} $scope.loadlog = function () { layui.use('table', function () { var table = layui.table; table.render({ elem: '#QuanGuoChouJianTable' , url: '/QuanGuoChouJian/GetQuanGuoChouJian' , where: { 'BCSCQYMC': $("#BCSCQYMC").val(), 'YPMC': $("#YPMC").val(), 'BHGXM': $("#BHGXM").val() } , parseData: function (res) { //res 即为原始返回的数据 return { "code": res.code, "data": res.data, //解析数据列表 "count": res.count }; } //, width: 800 , height: 700 , cols: [[ { field: 'ID', width: 100, align: 'center', title: '编号', sort: true } , { field: 'BCSCQYMC', width: 300, align: 'center', title: '标称生产企业名称', sort: true } , { field: 'BCSCQYDZ', width: 200, align: 'center', title: '标称生产企业地址', sort: true } , { field: 'BCYDWMC', width: 500, align: 'center', title: '被抽样单位名称', sort: true } , { field: 'BCYDWDZ', width: 200, align: 'center', title: '被抽样单位地址', sort: true } , { field: 'YPMC', width: 200, align: 'center', title: '样品名称', sort: true } , { field: 'GGXH', width: 200, align: 'center', title: '规格型号', sort: true } , { field: 'SB', width: 200, align: 'center', title: '商标', sort: true } , { field: 'SCRQ', width: 200, align: 'center', title: '生产日期', sort: true } , { field: 'BHGXM', width: 200, align: 'center', title: '不合格项目', sort: true } , { field: 'JCZ', width: 200, align: 'center', title: '检测值', sort: true } , { field: 'BZZ', width: 200, align: 'center', title: '标准值', sort: true } , { field: 'BZ', width: 200, align: 'center', title: '备注', sort: true } ]] , page: true , done: function (res, curr, count) { //$("table").width("100 %") } }); }); //获取下拉菜单的相关选项内容 $http.get(Gaddress + "/QuanGuoChouJian/getQueryConditions").then(function (mydata) { $scope.QueryCondition = mydata.data; }) } $scope.loadlog(); }])