店小秘-扫描发货手动输入补全工具
// ==UserScript==
// @name 店小秘-扫描发货手动输入补全工具
// @namespace Scriptcat
// @match https://www.dianxiaomi.com/package/scanPackShipped.htm
// @grant GM_xmlhttpRequest
// @license MIT
// @require https://scriptcat.org/lib/3085/0.0.4.2/%E9%80%9A%E7%94%A8%E5%87%BD%E6%95%B0.js
// @version 1.4.1
// @author -
// @description 2024/5/20 16:26:34
// ==/UserScript==
window.onload = async function(){
var taskList = [];
let url = "https://www.dianxiaomi.com/package/list.htm";
let data = {
"pageNo": 1,
"pageSize": 300,
"shopId": "-1",
"state": "allocated_has",
"platform": "",
"isSearch": 0,
"searchType": "orderId",
"authId": "-1",
"startTime": "",
"endTime": "",
"country": "",
"orderField": "order_pay_time",
"isVoided": 0,
"isRemoved": 0,
"ruleId": "-1",
"sysRule": "",
"applyType": "",
"applyStatus": "",
"printJh": -1,
"printMd": -1,
"commitPlatform": "",
"productStatus": "",
"jhComment": -1,
"storageId": 0,
"isOversea": -1,
"isFree": 0,
"isBatch": 0,
"history": "",
"custom": -1,
"timeOut": 0,
"refundStatus": 0,
"buyerAccount": "",
"forbiddenStatus": -1,
"forbiddenReason": 0,
"behindTrack": -1,
"orderId": ""
}
let book = await tool.getTotalPage(url,data);
let orderList = [];
for(page of book){
orderList = orderList.concat(page.find("#orderListTable tr[data-orderid]").map(function(){return $(this).children("td:eq(5)").find("a[title='点击查看物流追踪']").text()}).toArray());
}
let acomp = $("#scanShippingInput").autocomplete({source:orderList})
$("#scanShippingInput").on("input",function(){
var val = $(this).val();
if(orderList.includes(val)){
acomp.autocomplete( "disable" );
}else{
acomp.autocomplete( "enable" );
}
})
}