Commit 0b16d3ff by wusiyi

feat: 添加客户保存记录ID展示 #1004396

parent 1a3ca431
......@@ -21,14 +21,14 @@ const {
getLocation,
getOrderInfoMap,
setOrderInfo,
clearMaxLimitRecord,
clearMaxLimitRecord
} = require("@/server/utils/store");
export default {
components: {
PrintDialog,
VueDragResizeRotate,
ImgSetting,
ImgSetting
},
props: { factoryType: { type: String, default: "CN" } },
destroyed() {
......@@ -76,7 +76,7 @@ export default {
v: this.grid[this.systemSetting.gridValue].value,
h: this.grid[this.systemSetting.gridValue].h,
row: this.grid[this.systemSetting.gridValue].row,
col: this.grid[this.systemSetting.gridValue].col,
col: this.grid[this.systemSetting.gridValue].col
};
},
gridSpacing() {
......@@ -86,7 +86,7 @@ export default {
if (unit === "mm") {
return {
w: gridSpacing + "px",
h: gridSpacing + "px",
h: gridSpacing + "px"
};
} else if (unit === "inch") {
let w = this.grid[this.systemSetting.gridValue].w;
......@@ -96,7 +96,7 @@ export default {
return {
// w: gridSpacing * ((w - row + 1) / row) + "px",
w: gridSpacing * (w / row) + "px",
h: gridSpacing * (h / col) + "px",
h: gridSpacing * (h / col) + "px"
};
}
return { w: "480px", h: "540px" };
......@@ -108,7 +108,7 @@ export default {
if (unit === "mm") {
return {
w: gridSpacing + "px",
h: gridSpacing + "px",
h: gridSpacing + "px"
};
} else if (unit === "inch") {
let w = 480;
......@@ -117,7 +117,7 @@ export default {
let h = 540;
return {
w: gridSpacing * (w / row) + "px",
h: gridSpacing * (h / col) + "px",
h: gridSpacing * (h / col) + "px"
};
}
return { w: "480px", h: "540px" };
......@@ -157,8 +157,8 @@ export default {
"windowWH",
"countryList",
"desktoVersion",
"orderType",
]),
"orderType"
])
},
data() {
return {
......@@ -176,7 +176,7 @@ export default {
"hsva(120, 40, 94, 0.5)",
"hsl(181, 100%, 37%)",
"hsla(209, 100%, 56%, 0.73)",
"#c7158577",
"#c7158577"
],
actionList: [],
checkList: [],
......@@ -229,7 +229,7 @@ export default {
isMove: false,
isOver: false,
dialogVisible: false,
isForcedProduction: false,
isForcedProduction: false
};
},
watch: {
......@@ -237,7 +237,7 @@ export default {
async handler() {
this.$store.commit("changeImgList", this.imgList);
},
deep: true,
deep: true
// immediate: true,
},
selectIndex(val) {
......@@ -279,7 +279,7 @@ export default {
this.logList.unshift(
`订单:${this.detail.newId}-${
this.selectImgList.length > 1 ? this.faceType : "S"
}面 已查询`,
}面 已查询`
);
}
try {
......@@ -323,7 +323,7 @@ export default {
18: { left: "22%", top: "52%" },
21: { left: "22%", top: "56%" },
22: { left: "19%", top: "60%" },
24: { left: "12%", top: "56%" },
24: { left: "12%", top: "56%" }
};
// 查找对应的位置设置
......@@ -336,11 +336,11 @@ export default {
if (this.imgList?.length) {
this.getBackFile({
files: this.imgList,
size: this.detail.designImageSize || null,
size: this.detail.designImageSize || null
});
}
},
immediate: true,
immediate: true
},
isView: {
......@@ -358,7 +358,7 @@ export default {
this.imgDom = "";
}
},
immediate: true,
immediate: true
},
systemSetting: {
handler() {
......@@ -366,7 +366,7 @@ export default {
this.$refs.imgSetting?.getCurrentItem(this.imgList[this.selectIndex]);
}
},
deep: true,
deep: true
},
newDesktopDevice: {
handler(val) {
......@@ -380,8 +380,8 @@ export default {
this.$store.commit("setGrid");
}
},
immediate: true,
},
immediate: true
}
},
methods: {
// 重构为可手动触发的方法
......@@ -405,8 +405,8 @@ export default {
formData.append("file", files[i]);
let { data } = await that.$api.post("/uploadImage", formData, {
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
"Content-Type": "application/x-www-form-urlencoded"
}
});
that.selectImgIndex = 0;
that.addFile(data, () => {
......@@ -435,7 +435,7 @@ export default {
this.$set(
this.imgList[this.selectIndex],
"y",
Number(this.imgList[this.selectIndex].y) - 1,
Number(this.imgList[this.selectIndex].y) - 1
);
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)));
}
......@@ -444,7 +444,7 @@ export default {
this.$set(
this.imgList[this.selectIndex],
"y",
Number(this.imgList[this.selectIndex].y) + 1,
Number(this.imgList[this.selectIndex].y) + 1
);
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)));
}
......@@ -453,7 +453,7 @@ export default {
this.$set(
this.imgList[this.selectIndex],
"x",
Number(this.imgList[this.selectIndex].x) - 1,
Number(this.imgList[this.selectIndex].x) - 1
);
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)));
}
......@@ -462,7 +462,7 @@ export default {
this.$set(
this.imgList[this.selectIndex],
"x",
Number(this.imgList[this.selectIndex].x) + 1,
Number(this.imgList[this.selectIndex].x) + 1
);
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)));
}
......@@ -509,14 +509,14 @@ export default {
return mm1.width;
},
setDesignImg(title) {
let img = this.selectImgList.find((it) => it.title === title);
let img = this.selectImgList.find(it => it.title === title);
if (img) {
// console.log(this.detail.designImageSize, "this.detail.size");
this.getBackFile(
{ files: [img], size: this.detail.designImageSize },
() => {
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)));
},
}
);
}
},
......@@ -526,7 +526,7 @@ export default {
}
this.$nextTick(() => {
// this.selectImgIndexList.push(i)
let item = this.imgList.find((img) => img.fileName === it.fileName);
let item = this.imgList.find(img => img.fileName === it.fileName);
if (item) return;
this.selectImgIndex = index;
// console.log(this.detail.designImageSize);
......@@ -538,7 +538,7 @@ export default {
) {
size = {
width: this.detail.mssWidth,
height: this.detail.mssHeight,
height: this.detail.mssHeight
};
}
this.getBackFile({ files: [it], size }, () => {
......@@ -615,7 +615,7 @@ export default {
this.$set(
this.imgList[this.selectIndex],
"zIndex",
this.imgList[this.selectIndex].zIndex + 1,
this.imgList[this.selectIndex].zIndex + 1
);
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)));
break;
......@@ -625,7 +625,7 @@ export default {
this.$set(
this.imgList[this.selectIndex],
"zIndex",
this.imgList[this.selectIndex].zIndex - 1,
this.imgList[this.selectIndex].zIndex - 1
);
this.imgHistoryList.push(JSON.parse(JSON.stringify(this.imgList)));
break;
......@@ -738,14 +738,14 @@ export default {
},
getComputedName(title) {
let img = this.selectImgList.find(
(it) => it.title === title || it.title.includes(title),
it => it.title === title || it.title.includes(title)
);
return img?.designId;
},
getComputedTitle(title) {
// console.log(this.selectImgList, "this.selectImgList");
let img = this.selectImgList.find(
(it) => it.title === title || it.title.includes(title),
it => it.title === title || it.title.includes(title)
);
return img?.productionFile;
},
......@@ -815,7 +815,7 @@ export default {
x,
y,
h: height_px,
r: 0,
r: 0
});
that.selectIndex = that.imgList.length - 1;
......@@ -850,7 +850,7 @@ export default {
let that = this;
let bw = document.getElementById("line").clientWidth;
that.$nextTick(() => {
that.getImageSize(file.url).then((data) => {
that.getImageSize(file.url).then(data => {
let w = document.getElementById("line").clientWidth / 2;
let rate = data.height / data.width;
that.imgList = [];
......@@ -863,7 +863,7 @@ export default {
x: w,
y: (bw * (2 / 3) * rate) / 2,
h: bw * (2 / 3) * rate,
r: 0,
r: 0
});
that.selectIndex = that.imgList.length - 1;
that.showImgSetting = true;
......@@ -888,7 +888,7 @@ export default {
image.onload = function() {
resolve({
width: image.width,
height: image.height,
height: image.height
});
};
image.onerror = function() {
......@@ -962,7 +962,7 @@ export default {
this.checkList = JSON.parse(JSON.stringify(this.selectImgList));
try {
const processQueue = await Promise.all(
this.checkList.map(async (el) => {
this.checkList.map(async el => {
try {
const outputDir = path.dirname(el.productionFile);
......@@ -970,26 +970,26 @@ export default {
const outputPath = path.join(outputDir, outputFileName);
const params = {
inputPath: el.productionFile,
outputPath: outputPath,
outputPath: outputPath
};
const res = await this.$api.post("/processImage", params);
return {
fileName: outputFileName,
productionFile: res.msg[0]?.outputPath,
designId: el.designId,
designId: el.designId
};
} catch (error) {
console.error(`处理失败: ${el.productionFile}`, error);
}
}),
})
);
// 等待所有异步操作完成
await new Promise((resolve) => setTimeout(resolve, 100));
const newMap = new Map(processQueue.map((el) => [el.designId, el]));
await new Promise(resolve => setTimeout(resolve, 100));
const newMap = new Map(processQueue.map(el => [el.designId, el]));
this.selectImgList.forEach((el) => {
this.selectImgList.forEach(el => {
if (newMap.has(el.designId)) {
el.fileName = newMap.get(el.designId).fileName;
el.url = newMap.get(el.designId).productionFile;
......@@ -1000,7 +1000,7 @@ export default {
if (this.imgList.length) {
const fileNameExists = this.checkList.some(
(el) => el.fileName === this.imgList[0].fileName,
el => el.fileName === this.imgList[0].fileName
);
if (fileNameExists) {
this.imgList = [];
......@@ -1036,24 +1036,24 @@ export default {
{
ids: [this.detail.id],
device: this.newDesktopDevice,
orderType: this.orderType,
},
orderType: this.orderType
}
);
if (res.data.length === 0) return this.$message.warning("未找到素材图!");
let imgList = [];
res.data.forEach((el) => {
res.data.forEach(el => {
imgList = imgList.concat(el.list || []);
});
let arr = [];
res.data.forEach((el) => {
res.data.forEach(el => {
if (el.list) {
el.list.forEach((it) => {
el.list.forEach(it => {
arr.push(it);
});
}
});
res.data = arr
.filter((el) => el.type !== 1)
.filter(el => el.type !== 1)
.map((el, index) => {
el.designId = el.designId || index;
el.title = extractValue(el.designId);
......@@ -1192,8 +1192,8 @@ export default {
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
},
type: "warning"
}
).then(async () => {
try {
this.imgList = [];
......@@ -1226,7 +1226,7 @@ export default {
return text
.replace(
`订单:${this.detail.newId}`,
`<strong>订单:${this.detail.newId}</strong>`,
`<strong>订单:${this.detail.newId}</strong>`
)
.replace(/生产完成/, '<span style="color:#85ce61">生产完成</span>')
......@@ -1258,13 +1258,13 @@ export default {
},
async forcedProductionFN(bool) {
if (bool) this.isForcedProduction = true;
},
}
},
mounted() {
this.imgHeight = window.screen.height + "px";
this.systemSetting = this.$dataStore.get("setting");
bus.$on("busEmit", (v) => {
bus.$on("busEmit", v => {
let { type, value, size, productMark } = v;
switch (type) {
......@@ -1288,7 +1288,7 @@ export default {
) {
this.detail.designImageSize = {
width: this.detail.mssWidth,
height: this.detail.mssHeight,
height: this.detail.mssHeight
};
}
......@@ -1297,7 +1297,7 @@ export default {
this.indexChange(value);
break;
case "bg":
this.changeImageColor(value, (res) => {
this.changeImageColor(value, res => {
this.img = res;
});
break;
......@@ -1324,7 +1324,7 @@ export default {
if (v.faceType) {
this.faceType = v.faceType;
const index = this.selectImgList.findIndex(
(el) => el.title === v.faceType,
el => el.title === v.faceType
);
this.selectImgIndex = index;
}
......@@ -1336,13 +1336,13 @@ export default {
this.getBackFile(
{
files: [value[this.selectImgIndex]],
size: this.detail.designImageSize || null,
size: this.detail.designImageSize || null
},
() => {
this.imgHistoryList.push(
JSON.parse(JSON.stringify(this.imgList)),
JSON.parse(JSON.stringify(this.imgList))
);
},
}
);
}
}
......@@ -1365,7 +1365,7 @@ export default {
if (this.deviceStoreWatcher) {
this.deviceStoreWatcher(); // 调用 electron-store 监听器返回的函数,移除监听
}
},
}
};
</script>
......@@ -1486,7 +1486,7 @@ export default {
style="margin-left: 5px"
v-if="detail.podProductionNo"
:style="{
color: detail.customizedQuantity > 1 ? 'red' : '#67C23A',
color: detail.customizedQuantity > 1 ? 'red' : '#67C23A'
}"
>
{{ detail.customizedQuantity > 1 ? "多" : "单" }}
......@@ -1582,16 +1582,24 @@ export default {
<div class="item-label">工厂:</div>
<div class="item-value">{{ detail.factoryCode }}</div>
</div>
<div :title="detail.shopNumber" class="div-item" style="flex: 50%;">
<div>
店铺单号:
</div>
<div>
{{ detail.shopNumber }}
</div>
</div>
<div
:title="detail.shopNumber"
:title="detail.endProductId"
class="div-item"
style="flex: 100%;"
style="flex: 50%;"
>
<div>
店铺单号
客户保存记录ID
</div>
<div>
{{ detail.shopNumber }}
{{ detail.endProductId }}
</div>
</div>
<div
......@@ -1733,7 +1741,7 @@ export default {
:class="{ 'no-border-grid': systemSetting.gridShow !== 1 }"
:style="{
width: gridWH.row * 30 + 'px',
height: gridWH.col * 30 + 'px',
height: gridWH.col * 30 + 'px'
}"
class="grid"
style="border-style:dashed"
......@@ -1780,9 +1788,9 @@ export default {
:draggable="true"
:resizable="true"
:rotatable="true"
@dragstop="(a) => dragStop(a, item)"
@resizestop="(a) => resizeStop(a, item)"
@rotatestop="(a) => rotating(a, item)"
@dragstop="a => dragStop(a, item)"
@resizestop="a => resizeStop(a, item)"
@rotatestop="a => rotating(a, item)"
@drag="getDrag"
:angle="item.r"
>
......@@ -1822,7 +1830,7 @@ export default {
:class="{ 'no-border-grid': systemSetting.gridShow !== 1 }"
:style="{
width: gridWH.w + 'px',
height: gridWH.h + 'px',
height: gridWH.h + 'px'
}"
class="grid"
id="grid"
......@@ -1830,7 +1838,7 @@ export default {
<div
:style="{
height: gridSpacing.h,
lineHeight: gridSpacing.h,
lineHeight: gridSpacing.h
}"
class="grid-row"
v-for="it in 100"
......@@ -1855,7 +1863,7 @@ export default {
detail.adjustable &&
!isOver &&
!isMove &&
!selectImgList.some((el) => el.isCut) &&
!selectImgList.some(el => el.isCut) &&
newDesktopDevice !== 3
"
>
......@@ -1868,7 +1876,7 @@ export default {
productMark == 'custom_part' &&
detail.adjustable &&
selectImgList.length &&
!selectImgList.some((el) => el.isCut) &&
!selectImgList.some(el => el.isCut) &&
isOver &&
newDesktopDevice !== 3
"
......
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