Commit c02602ef by linjinhong

生产单信息添加素材规格字段

parent 90c24383
[{"head_setting":{"gridShow":1,"gridValue":0,"unit":"inch","language":"cn","autoPrint":false,"gridSpacing":1},"version":"1.0.11","print_setting":{"printer":"","xy":"","byInk":2,"byInkVolume":1,"byDoublePrint":3,"bEcoMode":false,"bMaterialBlack":false,"byHighlight":5,"printNum":1,"bFastMode":false,"bUniPrint":false,"bDivide":false,"bPause":false,"byMask":3,"bTransColor":false,"byChoke":2,"minWhiteInkType":0,"bySaturation":5,"byBrightness":5,"byContrast":5,"iCyanBalance":0,"iMagentaBalance":0,"iBlackBalance":0,"iYellowBalance":0,"byMinWhite":1,"bMultiple":false},"production_no":"GCPSC250530092","print_time":"2025-05-30 14:41:29","position_unit":{"x":460.1,"rate":0.9987730061349693,"sx":0,"zIndex":0,"sh":0,"sw":0,"sy":0,"y":463.1,"w":546.1,"h":546.1,"r":0},"position_after_px":{"x":"0.2","rate":1.1247895622895623,"sx":0,"zIndex":0,"sh":0,"sw":0,"sy":0,"y":"0.2","w":"26.8","h":"30.1","r":0},"position_before_px":{"url":"D:\\work\\electron-printer\\print\\Input\\986671a8-dd05-4292-affc-5312074d3a05.png","fileName":"986671a8-dd05-4292-affc-5312074d3a05.png","rate":1.1247895622895623,"w":807.8399999999999,"zIndex":0,"x":5.080000000000041,"y":5.675000000000011,"h":908.65,"r":0},"send_api_data":{"printer":"","xy":"","byInk":2,"byInkVolume":1,"byDoublePrint":3,"bEcoMode":false,"bMaterialBlack":false,"byHighlight":5,"printNum":1,"bFastMode":false,"bUniPrint":false,"bDivide":false,"bPause":false,"byMask":3,"bTransColor":false,"byChoke":2,"minWhiteInkType":0,"bySaturation":5,"byBrightness":5,"byContrast":5,"iCyanBalance":0,"iMagentaBalance":0,"iBlackBalance":0,"iYellowBalance":0,"byMinWhite":1,"bMultiple":false,"byPlatenSize":1,"cmd":"GTXproCMD.exe print -X \"Profile\\986671a8-dd05-4292-affc-5312074d3a05.xml\" -I \"Input\\986671a8-dd05-4292-affc-5312074d3a05.png\" -A \"Output\\986671a8-dd05-4292-affc-5312074d3a05.arxp\" -S 40014501 -L 00300033 -D 0 -W 1","fileName":"986671a8-dd05-4292-affc-5312074d3a05.png","print_cmd":"GTXproCMD.exe send -A \"Output\\986671a8-dd05-4292-affc-5312074d3a05.arxp\" -P \"导出为WPS PDF"}}]
\ No newline at end of file
...@@ -63,14 +63,14 @@ export default { ...@@ -63,14 +63,14 @@ export default {
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.scrollbarBox{ .scrollbarBox {
overflow-x: auto; overflow-x: auto;
overflow-y: hidden; overflow-y: hidden;
width: 100%; width: 100%;
white-space: nowrap; white-space: nowrap;
} }
.title { .title {
padding: 10px; padding: 5px 10px;
font-size: 20px; font-size: 20px;
font-weight: 700; font-weight: 700;
} }
......
...@@ -57,10 +57,10 @@ export default { ...@@ -57,10 +57,10 @@ export default {
setting: { setting: {
gridShow: 1, gridShow: 1,
gridValue: 0, gridValue: 0,
unit: "mm", unit: "inch",
language: "cn", language: "cn",
autoPrint: false, autoPrint: false,
gridSpacing: 10, gridSpacing: 1,
}, },
imgList: [], imgList: [],
detail: null, detail: null,
...@@ -106,10 +106,12 @@ export default { ...@@ -106,10 +106,12 @@ export default {
}, },
watch: { watch: {
setting: { setting: {
handler() { handler(val) {
this.$dataStore.set("setting", this.setting); this.$dataStore.set("setting", val);
console.log(val, "val");
bus.$emit("busEmit", { type: "updateSystemSetting" }); bus.$emit("busEmit", { type: "updateSystemSetting" });
}, },
deep: true, deep: true,
}, },
}, },
...@@ -306,6 +308,7 @@ export default { ...@@ -306,6 +308,7 @@ export default {
} }
); );
this.detail = findByPodProductionNo.data; this.detail = findByPodProductionNo.data;
console.log("detail111111", findByPodProductionNo);
let imageResList = []; let imageResList = [];
let designImagesCanvasJsonList = this.detail.drParam; let designImagesCanvasJsonList = this.detail.drParam;
if (designImagesCanvasJsonList) { if (designImagesCanvasJsonList) {
...@@ -418,7 +421,7 @@ export default { ...@@ -418,7 +421,7 @@ export default {
} catch (err) { } catch (err) {
console.log(err); console.log(err);
if (!err.data) { if (!err.data) {
this.$message.error("该生产单号不存在"); this.$message.error("该生产单号未拣胚或已完成");
} }
this.productionNo = ""; this.productionNo = "";
this.$refs.searchRef.focus(); this.$refs.searchRef.focus();
......
...@@ -6,6 +6,7 @@ export default { ...@@ -6,6 +6,7 @@ export default {
data() { data() {
return { return {
drawerShow: false, drawerShow: false,
setting: {},
form: { form: {
x: 0, x: 0,
rate: 0, rate: 0,
...@@ -43,10 +44,23 @@ export default { ...@@ -43,10 +44,23 @@ export default {
}, },
item: { item: {
handler() { handler() {
console.log(789, this.item);
if (this.item) { if (this.item) {
this.getCurrentItem(this.item);
}
},
immediate: true,
deep: true,
},
},
methods: {
pxToUnit,
unitToPx,
getCurrentItem(item) {
let setting = this.$dataStore.get("setting"); let setting = this.$dataStore.get("setting");
this.item.y = this.item.y - this.item.h / 2; this.item.y = item.y - item.h / 2;
this.item.x = this.item.x - this.item.w / 2; this.item.x = item.x - item.w / 2;
this.$dataStore.set( this.$dataStore.set(
"position_before_px", "position_before_px",
JSON.parse(JSON.stringify(this.item)) JSON.parse(JSON.stringify(this.item))
...@@ -71,15 +85,7 @@ export default { ...@@ -71,15 +85,7 @@ export default {
`position_after_px`, `position_after_px`,
JSON.parse(JSON.stringify(this.form)) JSON.parse(JSON.stringify(this.form))
); );
}
},
immediate: true,
deep: true,
},
}, },
methods: {
pxToUnit,
unitToPx,
formChange(t) { formChange(t) {
if (t && t === "w") { if (t && t === "w") {
this.form.h = this.form.w * this.form.rate; this.form.h = this.form.w * this.form.rate;
...@@ -289,7 +295,7 @@ export default { ...@@ -289,7 +295,7 @@ export default {
<style lang="less" scoped> <style lang="less" scoped>
.img-form { .img-form {
padding: 10px; padding: 5px 10px;
border: 1px solid #ececec; border: 1px solid #ececec;
} }
......
...@@ -260,8 +260,18 @@ export default { ...@@ -260,8 +260,18 @@ export default {
}, },
immediate: true, immediate: true,
}, },
systemSetting: {
handler(newValue) {
if (this.imgList.length > 0) {
this.$refs.imgSetting?.getCurrentItem(this.imgList[this.selectIndex]);
}
},
deep: true,
},
}, },
methods: { methods: {
// 重构为可手动触发的方法
changePrintDialogShow() { changePrintDialogShow() {
this.printDialogShow = !this.printDialogShow; this.printDialogShow = !this.printDialogShow;
}, },
...@@ -986,6 +996,7 @@ export default { ...@@ -986,6 +996,7 @@ export default {
break; break;
case "updateSystemSetting": case "updateSystemSetting":
this.systemSetting = this.$dataStore.get("setting"); this.systemSetting = this.$dataStore.get("setting");
break; break;
case "uploadImage": case "uploadImage":
this.addFile(value, () => { this.addFile(value, () => {
...@@ -1044,6 +1055,7 @@ export default { ...@@ -1044,6 +1055,7 @@ export default {
<template> <template>
<div class="page-main"> <div class="page-main">
<img-setting <img-setting
ref="imgSetting"
@ev="ev" @ev="ev"
@change="formChange" @change="formChange"
:item="returnItem" :item="returnItem"
...@@ -1064,7 +1076,7 @@ export default { ...@@ -1064,7 +1076,7 @@ export default {
class="img-item" class="img-item"
style="width: 50%;" style="width: 50%;"
> >
<img width="150px" :src="img.url" /> <img :src="img.url" />
</div> </div>
</div> </div>
</template> </template>
...@@ -1192,6 +1204,51 @@ export default { ...@@ -1192,6 +1204,51 @@ export default {
</div> </div>
<div>{{ detail.startStockingTime }}</div> <div>{{ detail.startStockingTime }}</div>
</div> </div>
<div
v-if="detail.mssWidth && detail.mssHeight"
class="div-item"
style="flex: 100%;"
>
<div>素材规格:</div>
<div class="item-value">
mm:&nbsp;(&nbsp; w:
{{
((Number(detail.mssWidth) * WHproportion * 10) / 10).toFixed(
1
)
}}
&nbsp; h:
{{
((Number(detail.mssHeight) * WHproportion * 10) / 10).toFixed(
1
)
}}&nbsp;)
</div>
</div>
<div
v-if="detail.mssWidth && detail.mssHeight"
class="div-item"
style="flex: 100%;"
>
<div style="opacity: 0;">素材规格:</div>
<div class="item-value">
inch:&nbsp;(&nbsp;w:
{{
(
((Number(detail.mssWidth) / 25.4) * WHproportion * 10) /
10
).toFixed(1)
}}
&nbsp;h:
{{
(
((Number(detail.mssHeight) / 25.4) * WHproportion * 10) /
10
).toFixed(1)
}}&nbsp;)
</div>
</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -1691,6 +1748,9 @@ img { ...@@ -1691,6 +1748,9 @@ img {
.product-information { .product-information {
border: 1px solid #ececec; border: 1px solid #ececec;
border-top: none; border-top: none;
.title {
padding: 5px 10px;
}
.div-content { .div-content {
padding: 0 10px; padding: 0 10px;
display: flex; display: flex;
...@@ -1699,7 +1759,7 @@ img { ...@@ -1699,7 +1759,7 @@ img {
display: flex; display: flex;
flex: 50%; flex: 50%;
font-size: 12px; font-size: 12px;
margin-bottom: 6px; margin-bottom: 5px;
.item-label { .item-label {
flex: 1; flex: 1;
text-align: right; text-align: right;
...@@ -1711,7 +1771,7 @@ img { ...@@ -1711,7 +1771,7 @@ img {
} }
} }
.title { .title {
padding: 10px; padding: 5px 10px;
font-size: 20px; font-size: 20px;
font-weight: 700; font-weight: 700;
} }
......
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