2.9-测序文件

测序文件

目前为 2023-07-05 提交的版本。查看 最新版本

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.gf.qytechs.cn/scripts/470210/1215771/29-%E6%B5%8B%E5%BA%8F%E6%96%87%E4%BB%B6.js

function 测序文件(){
	console.log('新的测序文件界面')
	var local_同一个版号中根据实验状态总结=localStorage.getItem('同一个版号中根据实验状态总结');
	var html=$('iframe[src="/seq/AutoFileUploadList.aspx"]')//测序样品页面
	html=html.contents().find('body').eq(0)
	var toolbar=html.find('.toolbar').eq(0)  // 找到了toolbar工具栏
	//var table=html.find('.ui-jqgrid-btable').eq(0)  // 找到了样品的table
	//添加toolbar工具栏按钮
	添加toolbar按钮(html)
	//添加toolbar工具栏按钮
	function 添加toolbar按钮(html){
		if (toolbar.find('.weiyiyici').length==0){
			//添加标记
			toolbar.addClass('weiyiyici')
			//添加修改样品名称按钮
			if (local_同一个版号中根据实验状态总结=='true'){
				toolbar.append('<span><input type="text" id="text_banhao"   placeholder="板号" size="5"/><button id="button_zongjie" onclick="return false">总结</font></button></span>')
				
				//点击添加样品前缀按钮执行如下函数
				toolbar.find('#button_zongjie').click(function(){
					根据实验状态总结()
				})
			}
		}
	}
	//根据实验状态总结
	function 根据实验状态总结(){
		板号=html.find('#text_banhao').eq(0).val()
		if(板号===""){console.log('空板号');return false}
		//报告生产界面查询BDT 数据
		$.ajaxSettings.async = false; //get请求默认是异步的,在这里改为同步
		$.get("/seq/xmldata/xmlSeqDBT.aspx?banhao="+板号,
			function (data,status) {
				console.log(data)
				客户名_arr=文本_取中间文本_批量(data,'<seqo_cust_name>','<\\/seqo_cust_name>')
				生产编号_arr=文本_取中间文本_批量(data,'<seqs_prod_id>','<\\/seqs_prod_id>')
				样品名称_arr=文本_取中间文本_批量(data,'<seqs_sam_num>','<\\/seqs_sam_num>')
				引物_arr=文本_取中间文本_批量(data,'<seqs_primer>','<\\/seqs_primer>')
				状态_arr=文本_取中间文本_批量(data,'<seqs_process>','<\\/seqs_process>')
				产品信息_arr=文本_取中间文本_批量(data,'<prod_info>','<\\/prod_info>')
				报告异常_arr=文本_取中间文本_批量(data,'<seqs_report_error','\\/')
				订单号_arr=文本_取中间文本_批量(data,'<seqo_order_id>','<\\/seqo_order_id>')
			});
		if (客户名_arr.length==0){
			alert('没搜到数据')
			return false
		}
		console.log(客户名_arr)
		console.log(生产编号_arr)
		console.log(样品名称_arr)
		console.log(引物_arr)
		console.log(产品信息_arr)
		console.log(报告异常_arr)
		console.log(订单号_arr)
		//样品状态 不是 报告成功的,全部改成  非报告成功
		for (var i=0;i<状态_arr.length;i++){
			if (状态_arr[i].indexOf('报告成功')==-1){
				状态_arr[i]='非报告成功'
			}else{
				状态_arr[i]='报告成功'
			}
		}
		console.log(状态_arr)
		//根据产品信息数组获取孔号数组
		孔号_arr=[]
		for (var i=0;i<产品信息_arr.length;i++){
			console.log(产品信息_arr[i].split('.'))
			孔号_arr.push(产品信息_arr[i].split('.')[-2])
		}
		console.log(孔号_arr)
	}
	//添加前后缀
	function 添加前后缀(前后缀,id){
		//如果没有选择的行,那么退出
		if(table.find('tbody').find("[aria-selected='true']").size()==0){return false} 
		if(html.find(id).eq(0).val()===""){return false}
		selecteds=table.find('tbody').find("[aria-selected='true']")
		selecteds.each(function(){
			ids=$(this).find('[aria-describedby=list_undefined]').text()  //获取生产编号
			product_number=$(this).find('[aria-describedby=list_seqs_sam_num]').text()  //获取最开始的样品编号
			if (前后缀=='前缀'){
				new_product_number=toolbar.find('#text_qianzhui').eq(0).val()+product_number  //获取最新的样品编号
			}
			if (前后缀=='后缀'){
				new_product_number=product_number+toolbar.find('#text_houzhui').eq(0).val()  //获取最新的样品编号
			}
			//post请求 更改样品编号
			$.post("/seq/ashx/SeqSampleHandler.ashx",
				{action:"piliang_edit",ids:ids.slice(2),newValue:"seqs_sam_num="+new_product_number,rules_txt:"样品编号"},
				function (data,status) {console.log(data);}
			);
			html.find('.ui-pg-input').eq(0).focus()
			alert('修改了 '+table.find('tbody').find("[aria-selected='true']").size()+' 条反应的样品名称,光标自动定位在页数,直接按回车或更改页数可以查看更改结果')
			return false
		})
	}
	
	
}

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址