Commit 44895c66 by linjinhong

fix:兼容新流程pod

parent e4af5316
......@@ -4,20 +4,24 @@ export const pathMap = {
CN: "factory/podJomallOrderProductCn/getProductCnByFactorySubOrderNumber",
US: "factory/podJomallOrderProductUs/getProductUsByFactorySubOrderNumber",
GC: "factory/podJomallOrderProduct/getSubOrderByThirdSubOrderNumber",
OP: "factory/podOrderOperation/getByOperationNo",
},
//下载素材接口
downloadBySubOrderNumber: {
CN: "factory/podJomallOrderProductCn/downloadDesignImages",
US: "factory/podJomallOrderProductUs/downloadDesignImages",
GC: "factory/podJomallOrder/downloadByProduction",
OP: "factory/podOrderOperation/downloadDesignImages",
USHLC: "factory/podJomallOrderProductUs/downloadCompatibleDesignImages",
CNHLC: "factory/podJomallOrderProductCn/downloadCompatibleDesignImages",
OPHLC: "factory/podOrderOperation/downloadCompatibleDesignImages",
},
//生产完成接口
completeDelivery: {
CN: "factory/podJomallOrderProductCn/completeDelivery",
US: "factory/podJomallOrderProductUs/completeDelivery",
GC: "factory/podJomallOrderProduct/completeDelivery",
OP: "factory/podOrderOperation/printerCompleteDelivery",
},
//惠立彩素材下载接口
processTransparentBackground: {
......
......@@ -163,10 +163,12 @@ export default {
url =
params.orderType == "CN"
? downloadBySubOrderNumber["CNHLC"]
: params.orderType == "OP"
? downloadBySubOrderNumber["OPHLC"]
: downloadBySubOrderNumber["USHLC"];
postUrl = `${env}/${url}?forceProduction=${forceProduction}`;
}
console.log("postUrl", postUrl);
const { data } = await axios.post(postUrl, [...params.ids], {
headers: { "jwt-token": token },
});
......@@ -214,24 +216,14 @@ export default {
const params = req.body;
try {
const urlArr = {
CN: {
field: "factorySubOrderNumber",
url:
"factory/podJomallOrderProductCn/getProductCnByFactorySubOrderNumber",
},
US: {
field: "factorySubOrderNumber",
url:
"factory/podJomallOrderProductUs/getProductUsByFactorySubOrderNumber",
},
GC: {
field: "thirdSubOrderNumber",
url: "factory/podJomallOrderProduct/getSubOrderByThirdSubOrderNumber",
},
const fieldMap = {
CN: "factorySubOrderNumber",
US: "factorySubOrderNumber",
GC: "thirdSubOrderNumber",
OP: "operationNo",
};
let url = urlArr[params.orderType].url;
let paramsField = urlArr[params.orderType].field;
let url = pathMap["findByPodProductionNo"][params.orderType];
let paramsField = fieldMap[params.orderType];
let { data } = await axios.get(`${env}/${url}`, {
params: {
......@@ -263,32 +255,21 @@ export default {
env = getHostApi().apiApiHost;
const token = req.headers["jwt-token"];
const params = req.body;
const urlArr = {
const fieldMap = {
CN: {
data: {
id: params.id,
podJomallOrderCnId: params.podJomallOrderCnId || "",
},
url: "factory/podJomallOrderProductCn/completeDelivery",
id: params.id,
podJomallOrderCnId: params.podJomallOrderCnId || "",
},
US: {
data: {
id: params.id,
podJomallOrderUsId: params.podJomallOrderUsId || "",
},
url: "factory/podJomallOrderProductUs/completeDelivery",
},
GC: {
data: { id: params.id },
url: "factory/podJomallOrderProduct/completeDelivery",
id: params.id,
podJomallOrderUsId: params.podJomallOrderUsId || "",
},
GC: { id: params.id },
OP: { ...params.data },
};
let url = urlArr[params.orderType].url;
let postData = urlArr[params.orderType].data;
// console.log("postData", postData);
// console.log("240url", url);
let url = pathMap["completeDelivery"][params.orderType];
let postData = fieldMap[params.orderType];
try {
let { data } = await axios.post(`${env}/${url}`, postData, {
headers: { "jwt-token": token },
......
......@@ -324,7 +324,7 @@ export default {
<div class="div-content">
<div :title="detail.podProductionNo" class="div-item">
<span>生产单号</span>
<span>{{ orderType == "OP" ? "工厂订单号" : "生产单号" }}</span>
<p>{{ detail.factorySubOrderNumber }}</p>
<p
style="margin-left: 5px"
......
......@@ -231,7 +231,7 @@ export default {
},
async setData(data) {
if (!data) return this.$message.warning("请扫描生产单号");
const params = {
let params = {
id: data.id,
orderType: this.orderType,
};
......@@ -239,6 +239,8 @@ export default {
params.podJomallOrderCnId = data.podJomallOrderCnId;
} else if (this.orderType === "US") {
params.podJomallOrderUsId = data.podJomallOrderUsId;
} else if (this.orderType === "OP") {
params.data = { ...data };
}
//如果为惠立彩则判断当前saveImgList字段中的power是否全是true 是则生产完成
const canCallApi =
......@@ -615,29 +617,22 @@ export default {
//判断生产单号是US CN GC(老pod),并设置 setOrderType
if (this.productionNo.includes("_")) {
const parts = this.productionNo.split("_");
const pscPart = parts.find((part) => part.includes("PSC"));
if (pscPart) {
this.$store.commit(
"setOrderType",
this.classifyField(this.productionNo),
);
} else {
this.$store.commit(
"setOrderType",
this.classifyField(this.productionNo),
);
}
this.$store.commit(
"setOrderType",
this.classifyField(this.productionNo),
);
} else {
let str;
if (this.productionNo.includes("PSC")) {
str = this.productionNo.split("PSC")[0];
} else if (this.productionNo.includes("OP")) {
str = "OP";
} else {
str = "GC";
}
this.$store.commit("setOrderType", str);
}
this.templateProductionNo = this.productionNo;
try {
//查询当前生产单号是否在本地数据
......@@ -702,15 +697,9 @@ export default {
},
classifyField(field) {
// 第一类:以"AAAF-CNPSC"开头
if (field.includes("CN")) {
return "CN";
}
// 第二类:以"AAAF-USPSC"开头
if (field.includes("US")) {
return "US";
}
// 第三类:所有其他情况
if (field.includes("CN")) return "CN";
if (field.includes("US")) return "US";
if (field.includes("OP")) return "OP";
return "GC";
},
changeActionIndex(t) {
......
......@@ -1465,10 +1465,23 @@ export default {
生产单信息
</div>
<div class="div-content">
<div :title="detail.podProductionNo" class="div-item">
<div class="item-label">生产单号:</div>
<div
:title="
orderType == `OP`
? detail.factoryOrderNumber
: detail.factorySubOrderNumber
"
class="div-item"
>
<div class="item-label">
{{ orderType == "OP" ? "工厂订单号" : "生产单号" }}:
</div>
<div class="item-value">
{{ detail.factorySubOrderNumber }}
{{
orderType == "OP"
? detail.factoryOrderNumber
: detail.factorySubOrderNumber
}}
<div
style="margin-left: 5px"
v-if="detail.podProductionNo"
......@@ -1480,17 +1493,44 @@ export default {
</div>
</div>
</div>
<div :title="detail.factorySubOrderNumber" class="div-item">
<div class="item-label">工厂单号:</div>
<div class="item-value">{{ detail.factorySubOrderNumber }}</div>
<div
:title="
orderType == `OP`
? detail.detail.factorySubOrderNumber
: detail.factorySubOrderNumber
"
class="div-item"
>
<div class="item-label">
{{ orderType == "OP" ? "工厂操作单号" : "工厂单号" }}:
</div>
<div class="item-value">
{{
orderType == "OP"
? detail.detail.factorySubOrderNumber
: detail.factorySubOrderNumber
}}
</div>
</div>
<div :title="detail.processName" class="div-item">
<div
:title="orderType == `OP` ? detail.craftName : detail.processName"
class="div-item"
>
<div class="item-label">生产工艺:</div>
<div class="item-value">{{ detail.processName }}</div>
<div class="item-value">
{{ orderType == "OP" ? detail.craftName : detail.processName }}
</div>
</div>
<div :title="detail.baseSku" class="div-item">
<div class="item-label">基版:</div>
<div class="item-value">{{ detail.baseSku }}</div>
<div
:title="orderType == `OP` ? detail.thirdskucode : detail.baseSku"
class="div-item"
>
<div class="item-label">
{{ orderType == "OP" ? "库存SKU" : "基版" }}
</div>
<div class="item-value">
{{ orderType == "OP" ? detail.thirdskucode : detail.baseSku }}
</div>
</div>
<div :title="detail.size" class="div-item">
<div class="item-label">尺寸:</div>
......@@ -1502,7 +1542,9 @@ export default {
</div>
<div :title="detail.num" class="div-item">
<div class="item-label">数量:</div>
<div class="item-value">{{ detail.num }}</div>
<div class="item-value">
{{ orderType == "OP" ? detail.quantity : detail.num }}
</div>
</div>
<div :title="detail.supplierItemNo" class="div-item">
<div class="item-label">货号:</div>
......@@ -1511,7 +1553,15 @@ export default {
<div :title="detail.color" class="div-item">
<div class="item-label">颜色:</div>
<div class="item-value">
{{ detail.baseSku ? detail.baseSku.split("_")[1] : null }}
{{
orderType == "OP"
? detail.thirdskucode
? detail.thirdskucode.split("_")[1]
: null
: detail.baseSku
? detail.baseSku.split("_")[1]
: null
}}
</div>
</div>
......@@ -2290,12 +2340,12 @@ img {
margin-bottom: 5px;
.item-label {
flex: 1;
text-align: right;
flex: 3%;
}
.item-value {
flex: 36%;
flex: 2;
}
}
}
......
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