|
@@ -791,8 +791,8 @@ const getRequestObject = (cmd = "print") => {
|
|
|
return request;
|
|
|
};
|
|
|
const clickNewbiePrint = (row) => {
|
|
|
+ let printer = "";
|
|
|
if (selectData.value[0].expressDeliveryId) {
|
|
|
- let printer = "";
|
|
|
let list = expressDeliveryList.value.filter((item) => item.id === selectData.value[0].expressDeliveryId);
|
|
|
if (list && list.length > 0) {
|
|
|
if (list[0].printer) {
|
|
@@ -804,46 +804,99 @@ const clickNewbiePrint = (row) => {
|
|
|
} else {
|
|
|
return ElMessage("请先设置快递");
|
|
|
}
|
|
|
- proxy.post("/cainiao/takeNum", { id: row.id }).then((res) => {
|
|
|
- let request = getRequestObject();
|
|
|
- request.task = new Object();
|
|
|
- request.task.taskID = getUUID(8, 10);
|
|
|
- request.task.preview = false;
|
|
|
- request.task.printer = printer;
|
|
|
- let documents = [];
|
|
|
- let list = res;
|
|
|
- for (let i = 0; i < list.length; i++) {
|
|
|
- if (list[i].packingList && list[i].packingList.length > 0) {
|
|
|
- for (let j = 0; j < list[i].packingList.length; j++) {
|
|
|
- if (list[i].packingList[j].detail || list[i].packingList[j].customTemplateUrl) {
|
|
|
- documents.push({
|
|
|
- documentID: list[i].packingList[j].data.waybillCode,
|
|
|
- contents: [
|
|
|
- list[i].packingList[j],
|
|
|
- {
|
|
|
- data: {
|
|
|
- detail: list[i].packingList[j].detail,
|
|
|
- },
|
|
|
- templateURL: list[i].packingList[j].customTemplateUrl,
|
|
|
+ let request = getRequestObject();
|
|
|
+ request.task = new Object();
|
|
|
+ request.task.taskID = getUUID(8, 10);
|
|
|
+ request.task.preview = false;
|
|
|
+ request.task.printer = printer;
|
|
|
+ let documents = [];
|
|
|
+ let list = [
|
|
|
+ {
|
|
|
+ code: 200,
|
|
|
+ msg: "操作成功",
|
|
|
+ data: {
|
|
|
+ objectId: "1711311206182879234",
|
|
|
+ waybillCode: "773247789869960",
|
|
|
+ printData:
|
|
|
+ '{"data":{"_dataFrom":"waybill","_page_config":{"REQUEST_LAYERED_IMAGE":false},"adsInfo":{"adId":"3","advertisementType":"PSA","bannerUrl":"https://ad-cdn.cainiao.com/img/3/1672122736541.png","miniBannerUrl":"https://ad-cdn.cainiao.com/img/3/1672122733813.png","useCustomArea":false},"cpCode":"STO","extraInfo":{},"needEncrypt":false,"orderChannelsType":"OTHERS","packageInfo":{"items":[{"count":2,"name":"TPE双层(61*0.6cm):183*61*0.6体位线款,紫罗兰Y07+浅紫Y11"}]},"parent":false,"recipient":{"address":{"detail":"1","province":"广东"},"mobile":"1","name":"江美娟"},"routingExtraInfo":{},"routingInfo":{"consolidation":{"name":"东莞中转包"},"origin":{"code":"350300","name":"福建福清公司"},"receiveBranch":{},"sortation":{"name":"651"},"startCenter":{},"terminalCenter":{}},"sender":{"address":{"city":"福州市","detail":"三山镇横坑村金园路18号胜德体育工厂","district":"福清市","province":"福建省"},"mobile":"15960106051","name":"陈云钦","phone":"15960106051"},"shippingOption":{"code":"STANDARD_EXPRESS","title":"标准快递"},"waybillCode":"773247789869960"},"signature":"MD:gzJjxtDYsG7PkkMio0WcWg==","templateURL":"https://cloudprint.cainiao.com/template/standard/288948/66","ver":"waybill_print_secret_version_1"}',
|
|
|
+ parentWaybillCode: null,
|
|
|
+ extraInfo: null,
|
|
|
+ cpCode: "STO",
|
|
|
+ realCpCode: "STO",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ for (let i = 0; i < list.length; i++) {
|
|
|
+ if (list[i].packingList && list[i].packingList.length > 0) {
|
|
|
+ for (let j = 0; j < list[i].packingList.length; j++) {
|
|
|
+ if (list[i].packingList[j].detail || list[i].packingList[j].customTemplateUrl) {
|
|
|
+ documents.push({
|
|
|
+ documentID: list[i].packingList[j].data.waybillCode,
|
|
|
+ contents: [
|
|
|
+ list[i].packingList[j],
|
|
|
+ {
|
|
|
+ data: {
|
|
|
+ detail: list[i].packingList[j].detail,
|
|
|
},
|
|
|
- ],
|
|
|
- });
|
|
|
- } else {
|
|
|
- documents.push({
|
|
|
- documentID: list[i].packingList[j].data.waybillCode,
|
|
|
- contents: [list[i].packingList[j]],
|
|
|
- });
|
|
|
- }
|
|
|
+ templateURL: list[i].packingList[j].customTemplateUrl,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ documents.push({
|
|
|
+ documentID: list[i].packingList[j].data.waybillCode,
|
|
|
+ contents: [list[i].packingList[j]],
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- request.task.documents = documents;
|
|
|
- if (ws.value.readyState !== 1) {
|
|
|
- initWebSocket(true, request);
|
|
|
- } else {
|
|
|
- send(request);
|
|
|
- }
|
|
|
- });
|
|
|
+ }
|
|
|
+ request.task.documents = documents;
|
|
|
+ if (ws.value.readyState !== 1) {
|
|
|
+ initWebSocket(true, request);
|
|
|
+ } else {
|
|
|
+ send(request);
|
|
|
+ }
|
|
|
+ // proxy.post("/cainiao/takeNum", { id: row.id }).then((res) => {
|
|
|
+ // let request = getRequestObject();
|
|
|
+ // request.task = new Object();
|
|
|
+ // request.task.taskID = getUUID(8, 10);
|
|
|
+ // request.task.preview = false;
|
|
|
+ // request.task.printer = printer;
|
|
|
+ // let documents = [];
|
|
|
+ // let list = res;
|
|
|
+ // for (let i = 0; i < list.length; i++) {
|
|
|
+ // if (list[i].packingList && list[i].packingList.length > 0) {
|
|
|
+ // for (let j = 0; j < list[i].packingList.length; j++) {
|
|
|
+ // if (list[i].packingList[j].detail || list[i].packingList[j].customTemplateUrl) {
|
|
|
+ // documents.push({
|
|
|
+ // documentID: list[i].packingList[j].data.waybillCode,
|
|
|
+ // contents: [
|
|
|
+ // list[i].packingList[j],
|
|
|
+ // {
|
|
|
+ // data: {
|
|
|
+ // detail: list[i].packingList[j].detail,
|
|
|
+ // },
|
|
|
+ // templateURL: list[i].packingList[j].customTemplateUrl,
|
|
|
+ // },
|
|
|
+ // ],
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // documents.push({
|
|
|
+ // documentID: list[i].packingList[j].data.waybillCode,
|
|
|
+ // contents: [list[i].packingList[j]],
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // request.task.documents = documents;
|
|
|
+ // if (ws.value.readyState !== 1) {
|
|
|
+ // initWebSocket(true, request);
|
|
|
+ // } else {
|
|
|
+ // send(request);
|
|
|
+ // }
|
|
|
+ // });
|
|
|
};
|
|
|
const openExpressCode = ref(false);
|
|
|
const formExpressCode = reactive({
|