Commit 8b1a087f authored by xinzhedeai's avatar xinzhedeai

code better

parent 52588906
......@@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0, viewprot-fit:cover">
<title>高区应急系统</title>
<title>高区应急系统-首页</title>
<script type="text/javascript" src="./js/includeHead.js"></script>
<style>
.wrapper .item {
......
......@@ -6,65 +6,14 @@ window.addEventListener("load", function() {
el: '#app',
data() {
return {
value: '',
a: 'ssss',
checked: '1',
username: '',
password: '',
showPopup: false,
showPopup1: false,
columns: ['杭州', '宁波', '温州', '绍兴', '湖州', '嘉兴', '金华', '衢州'],
minDate: new Date(2020, 0, 1),
maxDate: new Date(2025, 10, 1),
currentDate: new Date(2021, 0, 17),
createDate: '',
radio: '1',
showCalender: false,
date: new Date(2025, 10, 1),
show: true,
fileList: [
// { url: 'https://img01.yzcdn.cn/vant/leaf.jpg' },
// Uploader 根据文件后缀来判断是否为图片文件,
],
}
},
mounted() {
},
methods: {
nav(type){
location.href = './views/'+ type +'.html';
gemhoUtil.navigatePage('./views/'+ type +'.html')
},
formatDate(date) {
return `${date.getFullYear() + 1}/${date.getMonth() + 1}/${date.getDate()}`;
},
onConfirm(date) {
console.log('dat********e', date)
// const [start, end] = date;
// VUE.show = false;
// this.date = `${this.formatDate(start)} - ${this.formatDate(end)}`;
},
afterRead(file) {
// 此时可以自行将文件上传至服务器
console.log(file);
},
confirmDate(value) {
console.log('value', value)
this.createDate = this.formatDate(new Date(value))
VUE.showPopup = false
console.log('value', VUE.showPopup)
},
onConfirm1(value, index) {
this.value = value;
this.showPopup1 = false;
},
onConfirm4calender(value, index) {
this.value = value;
this.showCalender = false;
},
onChange1(picker, value, index) {},
onCancel1() {},
},
});
});
\ No newline at end of file
......@@ -149,7 +149,7 @@ var http = {
a.style = 'display: none';
var url = window.URL.createObjectURL(blob);
a.href = url;
a.setAttribute('download', 'YH-'+ getTargetDateYMD().replaceAll('-', '') +'.docx')
a.setAttribute('download', 'YH-'+ gemhoUtil.getTargetDateYMD().replaceAll('-', '') +'.docx')
a.click();
a.remove();
window.URL.revokeObjectURL(url);
......
......@@ -5,23 +5,20 @@ if(getPageN() === 'index'){
}else{
contextPath = '..'
}
// css
// css
document.write('<link rel="icon" href="https://whjqaqscxt.weihai.cn/favicon.ico">');
document.write('<link rel="stylesheet" type="text/css" href="' + contextPath + '/css/normalize.css" />');
document.write('<link rel="stylesheet" type="text/css" href="' + contextPath + '/css/vant.css" />');
document.write('<link rel="stylesheet" type="text/css" href="' + contextPath + '/css/common.css?rev=' + jsVersion + '" />');
//plupload
// js
// <script type="text/javascript" src="' + contextPath + '/js/vant.min.js"></script>\
document.write('<script type="text/javascript" src="' + contextPath + '/js/vue.min.js"></script>\
<script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/vant/2.12.54/vant.min.js"></script>\
<script type="text/javascript" src="' + contextPath + '/js/flexible.js"></script>\
<script type="text/javascript" src="' + contextPath + '/js/axios.min.js"></script>\
<script type="text/javascript" src="' + contextPath + '/js/util.js"></script>\
<script type="text/javascript" src="' + contextPath + '/js/common.js"></script>\
<script type="text/javascript" src="' + contextPath + '/js/flexible.js"></script>\
<script type="text/javascript" src="' + contextPath + '/js/util.js?rev=' + jsVersion + '"></script>\
<script type="text/javascript" src="' + contextPath + '/js/common.js?rev=' + jsVersion + '"></script>\
<script type="text/javascript" src="' + contextPath + '/js/http.js?rev=' + jsVersion + '"></script>');
......
'use strict';
//环境路径
var port = window.location.port;
var contextPath = '';
var comboChangeFlag = "true"
//Timstamp 函数, durian请求体用
function makeStamp(d) { // Date d
var y = d.getFullYear(), M = d.getMonth() + 1, D = d.getDate(), h = d
.getHours(), m = d.getMinutes(), s = d.getSeconds(), ss = d
.getMilliseconds(),
pad = function(x) {
x = x + '';
if (x.length === 1) {
return '0' + x;
}
return x;
};
return y + pad(M) + pad(D) + pad(h) + pad(m) + pad(s) + pad(ss);
}
function getTargetDate(dayLength, type) {
var dayLength = dayLength || 0;
var tempDate = new Date();
tempDate.setDate(tempDate.getDate() + dayLength);
var year = tempDate.getFullYear();
var month = tempDate.getMonth() + 1 < 10 ? "0" + (tempDate.getMonth() + 1) : tempDate.getMonth() + 1;
var day = tempDate.getDate() < 10 ? "0" + tempDate.getDate() : tempDate.getDate();
var time = '';
time = type === "start" ? " 00:00:00" : " 23:59:59";
return year + "-" + month + "-" + day + time;
}
// 时间 YYYY-MM-DD HH:MM
function getTargetDateYMDHM(dayLength, type) {
var dayLength = dayLength || 0;
var tempDate = new Date();
tempDate.setDate(tempDate.getDate() + dayLength);
var year = tempDate.getFullYear();
var month = tempDate.getMonth() + 1 < 10 ? "0" + (tempDate.getMonth() + 1) : tempDate.getMonth() + 1;
var day = tempDate.getDate() < 10 ? "0" + tempDate.getDate() : tempDate.getDate();
var time = '';
time = type === "start" ? " 00:00" : " 23:59";
return year + "-" + month + "-" + day + time;
}
function getTargetDateYMD(dayLength, type) {
var dayLength = dayLength || 0;
var tempDate = new Date();
tempDate.setDate(tempDate.getDate() + dayLength);
var year = tempDate.getFullYear();
var month = tempDate.getMonth() + 1 < 10 ? "0" + (tempDate.getMonth() + 1) : tempDate.getMonth() + 1;
var day = tempDate.getDate() < 10 ? "0" + tempDate.getDate() : tempDate.getDate();
return year + "-" + month + "-" + day;
}
function getTargetDateYM(dayLength, type) {
var dayLength = dayLength || 0;
var tempDate = new Date();
tempDate.setDate(tempDate.getDate() + dayLength);
var year = tempDate.getFullYear();
var month = tempDate.getMonth() + 1 < 10 ? "0" + (tempDate.getMonth() + 1) : tempDate.getMonth() + 1;
// var day = tempDate.getDate() < 10 ? "0" + tempDate.getDate() : tempDate.getDate();
return year + "-" + month;
var contextPath = ''
var gemhoUtil = window.gemhoUtil || {}
gemhoUtil.getTargetDateYMD = function(dayLength, type) {
var dayLength = dayLength || 0;
var tempDate = new Date();
tempDate.setDate(tempDate.getDate() + dayLength);
var year = tempDate.getFullYear();
var month = tempDate.getMonth() + 1 < 10 ? "0" + (tempDate.getMonth() + 1) : tempDate.getMonth() + 1;
var day = tempDate.getDate() < 10 ? "0" + tempDate.getDate() : tempDate.getDate();
return year + "-" + month + "-" + day;
}
gemhoUtil.getTargetDateYM = function(dayLength, type) {
var dayLength = dayLength || 0;
var tempDate = new Date();
tempDate.setDate(tempDate.getDate() + dayLength);
var year = tempDate.getFullYear();
var month = tempDate.getMonth() + 1 < 10 ? "0" + (tempDate.getMonth() + 1) : tempDate.getMonth() + 1;
return year + "-" + month;
}
/**
*
......@@ -68,7 +25,7 @@ function getTargetDateYM(dayLength, type) {
* @author: zjb
*
*/
function getPageName() {
gemhoUtil.getPageName = function() {
var pathname = window.location.pathname;
if (pathname) {
pathname = pathname.split('/');
......@@ -78,46 +35,6 @@ function getPageName() {
}
}
/**
*
* @functionName: getOS
* @Description: get operating system
* @author: zjb
*
*/
function getOS() {
var ua = navigator.userAgent.toLowerCase();
if (ua.indexOf('windows nt 6.3') != -1) {
return 'Windows 8';
} else if (ua.indexOf('windows nt 6.1') != -1) {
return 'Windows 7';
} else if (ua.indexOf('windows nt 6.0') != -1) {
return 'Windows Vista';
} else if (ua.indexOf('windows nt 5.2') != -1) {
return 'Windows 2003';
} else if (ua.indexOf('windows nt 5.1') != -1) {
return 'Windows XP';
} else if (ua.indexOf('windows nt 5.0') != -1) {
return 'Windows 2000';
} else if (ua.indexOf('windows') != -1 || ua.indexOf('win32') != -1) {
return 'Windows';
} else if (ua.indexOf('macintosh') != -1 || ua.indexOf('mac os x') != -1) {
return 'Macintosh';
} else if (ua.indexOf('adobeair') != -1) {
return 'Adobeair';
} else if (ua.indexOf('linux') != -1) {
return 'Linux';
} else if (ua.indexOf('iphone') != -1) {
return 'iPhone';
} else if (ua.indexOf('ipad') != -1) {
return 'iPad';
} else if (ua.indexOf('android') != -1) {
return 'Android';
} else {
return 'Unknow';
}
}
/**
*
* @functionName: getNavigator
......@@ -125,7 +42,7 @@ function getOS() {
* @author: zjb
*
*/
function getNavigator() {
gemhoUtil.getNavigator = function() {
var ua = navigator.userAgent.toLowerCase();
if (ua.indexOf('chrome') != -1) {
return 'Chrome';
......@@ -135,39 +52,11 @@ function getNavigator() {
return 'Safari';
} else if (ua.indexOf('opera') != -1) {
return 'Opera';
} else if(ua.indexOf('trident') != -1 && ua.indexOf('rv:11') != -1) {
return 'IE 11.0';
} else if (ua.indexOf('msie 10.0') != -1) {
return 'IE 10.0';
} else if (ua.indexOf('msie 9.0') != -1) {
return 'IE 9.0';
} else if (ua.indexOf('msie 8.0') != -1) {
return 'IE 8.0';
} else {
return 'Unknow';
}
}
/**
*
* @functionName: isPC
* @Description: 判断使用设备是否为PC
* @author: zjb
*
*/
function isPC() {
var userAgentInfo = navigator.userAgent;
var agents = new Array('Android', 'iPhone', 'SymbianOS', 'Windows Phone', 'iPad', 'iPod');
var flag = true;
for (var v = 0; v < agents.length; v++) {
if (userAgentInfo.indexOf(agents[v]) > 0) {
flag = false;
break;
}
}
return flag;
}
/**
*
* @functionName: getParameter
......@@ -175,31 +64,31 @@ function isPC() {
* @author: zjb
*
*/
function getParameter(name) {
gemhoUtil.getParameter = function(name) {
var search = location.search;
if(!search) {
if (!search) {
return false;
}
search = search.split('?')
var data = search[1].split('=');
if(search[1].indexOf(name) == (-1)) {
return '';
return;
if (search[1].indexOf(name) == (-1)) {
return '';
return;
}
if(search[1].indexOf('&') == (-1)) {
data = search[1].split('=');
return data[1];
if (search[1].indexOf('&') == (-1)) {
data = search[1].split('=');
return data[1];
} else {
data = search[1].split('&');
for(var i = 0; i <= data.length - 1; i++){
var l_data=data[i].split('=');
if(l_data[0] == name) {
return l_data[1];
break;
} else {
continue;
}
}
data = search[1].split('&');
for (var i = 0; i <= data.length - 1; i++) {
var l_data = data[i].split('=');
if (l_data[0] == name) {
return l_data[1];
break;
} else {
continue;
}
}
}
}
......@@ -210,9 +99,10 @@ function getParameter(name) {
* @author: zjb
*
*/
function setParameter() {
if (arguments.length >= 1) {
var url = arguments[0], paramsObj = arguments[1];
gemhoUtil.setParameter = function() {
if (arguments.length) {
var url = arguments[0],
paramsObj = arguments[1];
if (paramsObj) {
var parameter = '';
for (var x in paramsObj) {
......@@ -221,46 +111,27 @@ function setParameter() {
url += '?' + parameter.substr(0, parameter.length - 1);
}
return url;
} else {
customUtil.layerAlert("setParameter : 参数错误, 支持2个参数(url-必填, paramsObj)", 2);
}
}
/**
*
* @functionName: trim
* @Description: 由于IE8不支持trim方法,此处自定义
* @author: zjb
*
*/
String.prototype.trim = function() {
return this.replace(/(^\s*)|(\s*$)/g, '');
}
/**
* @functionName: setCookie
* @Description: set cookies
* @author: zjb
*/
function setCookie(name, value, days) {
if(name === 'whMap'|| name === 'columnArr'){ // 页面搜索条件记录 更改存取方式
localStorage.setItem(name, value);
return;
}
var len = arguments.length;
gemhoUtil.setCookie = function(name, value, days) {
var len = arguments.length;
if (len == 2) {
var exp = new Date();
exp.setTime(exp.getTime() + 30*24*60*60*1000);
document.cookie = name + '=' + escape (value) + ';expires=' + exp.toGMTString() + ';path=/';
var exp = new Date();
exp.setTime(exp.getTime() + 30 * 24 * 60 * 60 * 1000);
document.cookie = name + '=' + escape(value) + ';expires=' + exp.toGMTString() + ';path=/';
} else if (len == 3) {
var exp = new Date();
exp.setDate(exp.getDate() + parseInt(days));
exp.setHours(1, 0, 0, 0);
document.cookie = name + '=' + escape (value) + ';expires=' + exp.toGMTString() + ';path=/';
} else {
customUtil.layerAlert("SetCookie参数错误!", 2);
document.cookie = name + '=' + escape(value) + ';expires=' + exp.toGMTString() + ';path=/';
}
}
}
/**
*
......@@ -269,31 +140,15 @@ function setCookie(name, value, days) {
* @author: zjb
*
*/
function getCookie(name) {
if(name === 'whMap'|| name === 'columnArr'){ // 页面搜索条件记录 更改存取方式
gemhoUtil.getCookie = function(name) {
if (name === 'whMap' || name === 'columnArr') { // 页面搜索条件记录 更改存取方式
return localStorage.getItem(name);
}
var arr,reg=new RegExp('(^| )'+name+'=([^;]*)(;|$)');
if(arr=document.cookie.match(reg))
return unescape(arr[2]);
else
return null;
}
/**
*
* @functionName: jumpBack
* @Description: 从详情页跳回
* @author: zjb
*
*/
function jumpBack(destination) {
var from = getParameter('from');
if (!from || from == destination) {
window.location.href = destination + '.html';
} else {
window.close();
}
var arr, reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)');
if (arr = document.cookie.match(reg))
return unescape(arr[2]);
else
return null;
}
/**
......@@ -303,290 +158,24 @@ function jumpBack(destination) {
* @author: zjb
*
*/
function delCookie(name) {
var exp = new Date();
exp.setTime(exp.getTime() - 1);
var cval = getCookie(name);
if(cval != null)
document.cookie = name + '=' + cval + ';expires=' + exp.toGMTString() + ';path=/';
}
/**
*
* @functionName: serializeObject
* @Description: form序列化成object
* @author: zjb
* @param: form
*/
var serializeObject = function() {
if (arguments.length === 1) {
var form = arguments[0], o = {};
$.each(form.serializeArray(), function(index) {
if (o[this['name']]) {
o[this['name']] = o[this['name']] + ',' + this['value'].trim();
} else {
o[this['name']] = this['value'].trim();
}
});
return o;
} else {
customUtil.layerAlert("serializeObject : 参数错误, 支持1个参数(form)", 2);
}
};
/**
*
* @functionName: formatDate
* @Description: 格式化Date对象
* @author: zjb
* @param: date, symbol-选填
*/
function formatDate() {
if (arguments.length > 0 && arguments.length < 3) {
var date = arguments[0], symbol = (arguments[1] ? arguments[1] : '-');
if (!date) {
return '';
}
if (!(date instanceof Date)) {
date = date.split(/\s/)[0].split('-');
date = new Date(date[0], parseInt(date[1]) - 1, date[2]);
}
var year = date.getFullYear(), month = date.getMonth() + 1, day = date.getDate();
month = month < 10 ? '0' + month : month;
day = day < 10 ? '0' + day : day;
return year + symbol + month + symbol + day;
} else {
customUtil.layerAlert("formatDate : 参数错误, 支持2个参数(date, symbol-选填)", 2);
}
}
/**
*
* @functionName: formatTime
* @Description: 格式化Date对象的time
* @author: zjb
* @param: date
*/
function formatTime() {
if (arguments.length === 1) {
var date = arguments[0];
if (!date) {
return '';
}
if (!(date instanceof Date)) {
date = date.split(/\s/);
if (!date[1]) {
return '';
}
var time = date[1].split(':');
if (!time[2]) {
time[2] = '00';
}
date = date[0].split('-');
date = new Date(date[0], parseInt(date[1]) - 1, date[2], time[0], time[1], time[2]);
}
var hour = date.getHours(), minute = date.getMinutes(), second = date.getSeconds();
hour = hour < 10 ? '0' + hour : hour;
minute = minute < 10 ? '0' + minute : minute;
second = second < 10 ? '0' + second : second;
return hour + ':' + minute + ':' + second;
} else {
customUtil.layerAlert("formatTime : 参数错误, 支持1个参数(date)", 2);
}
}
/**
*
* @functionName: objToStr
* @Description: 将JSON转换为String, 作为参数传进函数
* @author: zjb
* @param: obj
*/
function objToStr(obj) {
if (arguments.length === 1) {
for(var key in obj) {
if (typeof(obj[key]) === 'string' && obj[key].indexOf('[') > -1) {
obj[key] = obj[key].replace(/\\\"/g, '\"');
obj[key] = obj[key].replace(/\"/g, '\\\"');
}
}
return JSON.stringify(obj).replace(/\s/g, '&nbsp;');
} else {
customUtil.layerAlert("objToStr : 参数错误, 支持1个参数(obj)", 2);
}
gemhoUtil.delCookie = function(name) {
var exp = new Date();
exp.setTime(exp.getTime() - 1);
var cval = getCookie(name);
if (cval != null)
document.cookie = name + '=' + cval + ';expires=' + exp.toGMTString() + ';path=/';
}
/**
*
* @functionName:
* @Description: 获取url页面名称方法
* @author: haliluya
* @param: date
* @desc : 2017-2-15 09:37:28
*/
function getPageName() {
gemhoUtil.getPageName = function() {
var pageN = window.location.pathname;
pageN = pageN.substring(pageN.lastIndexOf("/")+1,pageN.indexOf("."));
if(pageN) return pageN;
}
/**
* 根据一个link字符串获取页面的名称
*/
function getPageNameByLink(link){
var link = link ? link : 'index';
return link.substring(link.lastIndexOf("/") + 1, link.indexOf("."));
}
/**
* @desc 获取当前日期(0)、前几天(负数)、后几天(正数)
* @param day
* @returns
*/
function getDay(day){
var today = new Date();
var milliseconds = today.getTime() + 1000*60*60*24*day;
today.setTime(milliseconds);
var tYear = today.getFullYear();
var tMonth = today.getMonth();
var tDate = today.getDate();
tMonth = doHandleMonth(tMonth + 1);
tDate = doHandleMonth(tDate);
return tYear+"-"+tMonth+"-"+tDate;
}
function doHandleMonth(month){
var m = month;
if(month.toString().length == 1){
m = "0" + month;
}
return m;
}
function blankReplace(str){
return str || '';
}
// 日期 年月日时分秒 2018-08-01 22:22:22
function getYmdHms4laydate(d) { // Date d
var y = d.getFullYear(), M = d.getMonth() + 1, D = d.getDate(), h = d
.getHours(), mi = d.getMinutes(), s = d.getSeconds();
var pad = function(x) {
x = x + '';
if (x.length === 1) {
return '0' + x;
}
return x;
};
return [y, pad(M), pad(D)].join('-') + ' ' + [pad(h), pad(mi), pad(s)].join(':');
}
//日期 年月日时分 2018-08-01 22:22
function getYmdHm4laydate(d) { // Date d
var y = d.getFullYear(), M = d.getMonth() + 1, D = d.getDate(), h = d
.getHours(), mi = d.getMinutes();
var pad = function(x) {
x = x + '';
if (x.length === 1) {
return '0' + x;
}
return x;
};
return [y, pad(M), pad(D)].join('-') + ' ' + [pad(h), pad(mi)].join(':');
}
//日期 年月日时分 2018-8-1
function formatDateByLaydate(d){
var y = d.getFullYear(), M = d.getMonth() + 1, D = d.getDate();
return [y, M, D].join('-');
}
//日期 年月日时分 2018-08-01
function formatDateByLaydate1(d){
var y = d.getFullYear(), M = d.getMonth() + 1, D = d.getDate();
var pad = function(x) {
x = x + '';
if (x.length === 1) {
return '0' + x;
}
return x;
};
return [y, pad(M), pad(D)].join('-');
}
// datagrid 列内容鼠标悬浮详情显示
function getMore4title(value){
if(value !== 0){
value = (value)|| "";
}
return '<span title="'+ value +'">'+ value +'</span>';
}
//datagrid 列内容鼠标悬浮详情显示需要过滤<时
function getMore4titleForExp(value){
if(value !== 0){
value = (value)|| "";
if(isString(value)){
value=value.replace(/</g,"&lt;");
value=value.replace(/\"/g,"");
}
}
return '<span title="'+ value +'">'+ value +'</span>';
}
function isString(str){
return (typeof str=='string')&&str.constructor==String;
}
//获取商品总金额
function getTotalPInfo4pGrid(target){
var rows = $(target).datagrid('getData').rows;
var sumMoney = 0;
if(rows.length){
rows.forEach(function(item, index){
sumMoney += ((item.productPrice || 0) * (item.productAmount || 0)) * 1;
})
}
return {
productTotalMoney: sumMoney,
total: rows.length
}
}
//获取包裹列表所有包裹的总重量和总数目
function getTotalW4pGrid(target){
var rows = $(target).datagrid('getData').rows;
var sumWeight=0, sumCnt = 0;
if(rows.length){
rows.forEach(function(item, index){
sumWeight += (item.packageWeight || 0) * 1;
})
}
return {
packageTotalW: sumWeight.toFixed(2),
total: rows.length
}
}
// 数字科学计数显示
function numFormat(s, n) {
if(!s){return 0}
n = n > 0 && n <= 20 ? n : 2;
s = parseInt((s + "").replace(/[^\d\.-]/g, "")).toFixed(n) + "";
var l = s.split(".")[0].split("").reverse(), r = s.split(".")[1];
var t = "";
for (var i = 0; i < l.length; i++) {
t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? "," : "");
}
return t.split("").reverse().join("");
}
/**
*
* @param path
* @returns 下载文件 更新版本号
*/
function downloadFile(path){
location.href = contextPath + path +'?rev='+ (+new Date());
pageN = pageN.substring(pageN.lastIndexOf("/") + 1, pageN.indexOf("."));
if (pageN) return pageN;
}
/**
......@@ -595,14 +184,15 @@ function downloadFile(path){
* @returns
* @demo navigatePage('/warehouse/company/companyDetail.html?companyId=1002');
*/
function navigatePage(path){
if(!path){return;}
gemhoUtil.navigatePage = function(path) {
if (!path) {
return;
}
var url = contextPath;
if(path.indexOf('?') > -1){ // 带有参数
url += path + '&rev='+ (+new Date())
}else{
url += path + '?rev='+ (+new Date())
if (path.indexOf('?') > -1) { // 带有参数
url += path + '&rev=' + (+new Date())
} else {
url += path + '?rev=' + (+new Date())
}
location.href = url;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script type="text/javascript" src="../js/includeHead.js"></script>
</head>
<body>
</body>
</html>
\ No newline at end of file
......@@ -51,8 +51,7 @@
<body>
<div id="app" class="page-wrapper">
<div class="search-wrapper">
<van-search v-model="companyName" placeholder="请输入搜索关键词" @search="onSearch" @clear="onClear" />
<van-search v-model="companyName" placeholder="请输入公司名称" @search="onSearch" @clear="onClear" />
</div>
<div class="list-content-wrapper" v-cloak>
......@@ -61,9 +60,7 @@
<van-cell v-for="item in list" :key="item">
<div class="list-item-wrapper" @click="nav(item)">
<p class="bgImg">
<!-- <span id=""> -->
{{item.companyName}}
<!-- </span> -->
</p>
<p class="list-content-fz">企业负责人: {{item.companyChargePer}}</p>
<p class="list-content-fz">联系方式:{{item.companyChargeTel}}</p>
......@@ -71,8 +68,6 @@
</van-cell>
</van-list>
</div>
<!-- div>img+div>h2+span+span
</div>
</body>
</html>
\ No newline at end of file
......@@ -17,11 +17,10 @@ window.addEventListener("load", function() {
}
},
mounted() {
// this.getList()
},
methods: {
nav(item){
location.href='./yh-list.html?companyId='+item.companyId+'&rev='+(+new Date())
gemhoUtil.navigatePage('./yh-list.html?companyId='+item.companyId);
},
resetSearchForm(){
this.page = 0
......
......@@ -71,20 +71,14 @@ window.addEventListener("load", function() {
hdRectificationDateModel: '',
showPopup4hdRectificationDate: false,
fileList: [],
// columns4findQuestion: ['杭州', '宁波', '温州', '绍兴', '湖州', '嘉兴', '金华', '衢州'],
// findQuestion: '',
}
},
mounted() {
if(getParameter('type') === 'detail'){
if(gemhoUtil.getParameter('type') === 'detail'){
this.editAble = false
this.detail()
}else if(getParameter('type') === 'edit'){
}else if(gemhoUtil.getParameter('type') === 'edit'){
this.editAble = true
this.detail()
}else{ // 新增
......
......@@ -51,8 +51,6 @@
</van-cell>
</van-list>
</div>
<!-- div>img+div>h2+span+span
</div>
</body>
</html>
\ No newline at end of file
......@@ -27,10 +27,7 @@ window.addEventListener("load", function() {
vant.Toast({
message: '操作成功',
})
// this.list.splice(index, 1);
this.loading = false; // 加载状态结束
console.log('导出响应结果', res)
})
},
del(item, index){
......@@ -40,7 +37,6 @@ window.addEventListener("load", function() {
message: '此操作将删除所选项,确认删除?',
})
.then(() => {
// on confirm
http.delete('/api/thHiddenDanger',{
id: [item.hdId]
}).then((res)=>{
......@@ -60,19 +56,19 @@ window.addEventListener("load", function() {
// location.h ref='./yh-list.html'
},
add(){
location.href='./yh-list-detail.html?companyId='+getParameter('companyId')+'&type=add'
gemhoUtil.navigatePage('./yh-list-detail.html?companyId='+gemhoUtil.getParameter('companyId')+'&type=add')
},
detail(item){
location.href='./yh-list-detail.html?companyId='+getParameter('companyId')+'&hdId='+item.hdId+'&type=detail'
gemhoUtil.navigatePage('./yh-list-detail.html?companyId='+gemhoUtil.getParameter('companyId')+'&hdId='+item.hdId+'&type=detail')
},
edit(item){
location.href='./yh-list-detail.html?companyId='+getParameter('companyId')+'&hdId='+item.hdId+'&type=edit'
gemhoUtil.navigatePage('./yh-list-detail.html?companyId='+gemhoUtil.getParameter('companyId')+'&hdId='+item.hdId+'&type=edit')
},
getList(){
http.get('/api/thHiddenDanger',{
page: this.page++,// 每次请求增加下一页
size: this.size,
companyId: getParameter('companyId'),
companyId: gemhoUtil.getParameter('companyId'),
county: localStorage.getItem('appCounty'),
sort: 'hdId,desc',
}).then((res)=>{
......
......@@ -72,7 +72,7 @@ window.addEventListener("load", function() {
methods: {
detail(){
var hdId = getParameter('hdId')
var hdId = gemhoUtil.getParameter('hdId')
http.get('/api/hiddenDangerToVerify', {
page: 0, // 每次请求增加下一页
size: 1,
......
......@@ -15,10 +15,13 @@ window.addEventListener("load", function() {
size: 10,
total: 0,
companyName: '',
curVerifyStatus: '',
curVerifyStatus: '全部',
curVerifyStatusVal: '',
showPopup4verifyStatus: false,
verifyStatusList: [{
name: "全部",
value: '',
},{
name: "待审核",
value: 3,
},
......@@ -65,9 +68,6 @@ window.addEventListener("load", function() {
console.log('search', val)
this.getList()
},
nav(item) {
// location.href='./yh-list.html'
},
pass(item, index){
console.log(item)
vant.Dialog.confirm({
......@@ -113,8 +113,8 @@ window.addEventListener("load", function() {
})
},
detail(item) {
location.href = './yh-verify-detail.html?companyId=' + getParameter('companyId') +
'&hdId=' + item.hdId + '&type=detail'
gemhoUtil.navigatePage('./yh-verify-detail.html?companyId=' + gemhoUtil.getParameter('companyId') +
'&hdId=' + item.hdId + '&type=detail')
},
getList() {
http.get('/api/hiddenDangerToVerify', {
......@@ -125,20 +125,16 @@ window.addEventListener("load", function() {
enName: this.companyName,
sort: 'verify_status,asc',
}).then((res) => {
this.loading = false; // 加载状态结束
console.log('响应结果', res.content)
this.list.push(...res.content);
this.total = res.totalElements
console.log('响应结果list', this.list)
console.log('响应结果totalElements', res.totalElements)
if (this.page * this.size >= this.total) {
this.finished = true; // 下滑不在刷新数据
}
})
}
},
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment