00-公共函数

公共函数

当前为 2023-07-01 提交的版本,查看 最新版本

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.cn-greasyfork.org/scripts/469866/1213752/00-%E5%85%AC%E5%85%B1%E5%87%BD%E6%95%B0.js

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

//备注包含CNAS的行就标个颜色
function 公共_CNAS订单加急(html,搜索信息){
	
	//先运行一遍
	// html.find('#list').eq(0).find('[aria-describedby=list_seqo_product_company_name]').each(function(){
	// 	if($(this).text()!="北京分公司"){
	// 		$(this).attr('Bgcolor','#AeEEe7')
	// 	}
	// })
	
	
	
	html.find('table').find('tr').each(function(){
		备注信息=$(this).find(搜索信息)
		备注=$(this).find(搜索信息).text()
		console.log(备注)
		if(备注.toUpperCase().indexOf('CNAS')!==-1){
			//设置背景颜色
			$(this).find('td').attr('Bgcolor','#CDE2F7')
		}
	})
	//当table出现数据改变的时候
	$(html).find('#list').on('DOMNodeInserted',function(e) {
		//$(e.target)代表的每一行
		备注信息=$(e.target).find(搜索信息).innerText
		//备注=备注信息.text()
		console.log(备注信息)
		if(备注信息.toUpperCase().indexOf('CNAS')!==-1){
			//设置背景颜色
			$(this).find('td').attr('Bgcolor','#CDE2F7')
		}
	});
	
	// var table=html.find('table')
	// html.find('table').find('tr').each(function(){
	// 	备注信息=$(this).find(搜索信息)
	// 	//如果有标记 则退出
	// 	if(备注信息.hasClass('biaoji_cnas_jiaji')===true){
	// 		return false
	// 	}
	// 	//加个标记
	// 	备注信息.addClass('biaoji_cnas_jiaji')
	// 	备注=$(this).find(搜索信息).text()
	// 	if(备注.toUpperCase().indexOf('CNAS')!==-1){
	// 		//设置背景颜色
	// 		$(this).find('td').attr('Bgcolor','#CDE2F7')
	// 	}
	// })
}

//查询年月日的函数
function getday_y_n(d){
	var myDate = new Date();
	if(d=="yestday" || d==="hecheng_zuotian_riqi" || d=="zuori---"){myDate.setTime(myDate.getTime()-24*60*60*1000);}
	var year = (myDate.getFullYear()).toString(); //获取当前年
	var mon = (myDate.getMonth() + 1).toString(); //获取当前月
	var date = (myDate.getDate()).toString(); //获取当前日
	if(mon.length==1){
		mon="0"+mon
	}
	if(date.length==1){
		date="0"+date
	}
	if(d==="hecheng_zuotian_riqi"){
		return year+mon+date
	}else if(d=="---"){   //---指的格式为XXXX-XX-XX
		return year+"-"+mon+"-"+date
	}else if(d=="zuori---"){
		//返回昨天的日期 比如 2022-05-13
		return year+"-"+mon+"-"+date
	}else{
		return year+mon+date
	}
}
	
//延时函数
var sleep = function(time) {
	var startTime = new Date().getTime() + parseInt(time, 10);
	while(new Date().getTime() < startTime) {}
};