Commit 75afe767 by zhuzhequan

添加自动打印逻辑

parent e9809902
...@@ -239,7 +239,7 @@ export default { ...@@ -239,7 +239,7 @@ export default {
bus.$emit("busEmit", { bus.$emit("busEmit", {
type: "sendFile", type: "sendFile",
value: res.data, value: res.data,
// size: { width: this.detail.mssWidth || 500, height: this.detail.mssHeight || 500 } size: { width: this.detail.mssWidth || 500, height: this.detail.mssHeight || 500 }
}); });
this.productionNo = ""; this.productionNo = "";
......
...@@ -5,7 +5,6 @@ import ImgSetting from "./imgSetting.vue"; ...@@ -5,7 +5,6 @@ import ImgSetting from "./imgSetting.vue";
import bus from "@/bus"; import bus from "@/bus";
import PrintDialog from "@/views/design/head/printDialog.vue"; import PrintDialog from "@/views/design/head/printDialog.vue";
import { mmToPx } from "@/utils"; import { mmToPx } from "@/utils";
import { raw } from "express";
const img = require("../../../assets/bg_tshirt_shadow.png"); const img = require("../../../assets/bg_tshirt_shadow.png");
export default { export default {
...@@ -79,6 +78,7 @@ export default { ...@@ -79,6 +78,7 @@ export default {
data() { data() {
return { return {
actionList: [], actionList: [],
hasSize:false,
parentWidth: 0, parentWidth: 0,
systemSetting: {}, systemSetting: {},
imgHeight: 0, imgHeight: 0,
...@@ -601,6 +601,11 @@ export default { ...@@ -601,6 +601,11 @@ export default {
}); });
break; break;
case "sendFile": case "sendFile":
if(size.width && size.height) {
this.hasSize = true
}else{
this.hasSize = false
}
this.imgList = []; this.imgList = [];
this.selectIndex = -1; this.selectIndex = -1;
if (value.length > 0) { if (value.length > 0) {
...@@ -708,6 +713,10 @@ export default { ...@@ -708,6 +713,10 @@ export default {
</div> </div>
</div> </div>
<img class="template-img" draggable="false" :src="img" alt="" /> <img class="template-img" draggable="false" :src="img" alt="" />
<div class="print-tip" v-if="imgList.length">
<b style="color: green" v-if="hasSize ">该生产单无需拖动设计,直接打印</b>
<b style="color: red" v-else>该生产单需要拖动设计打印</b>
</div>
</div> </div>
<print-dialog <print-dialog
...@@ -722,6 +731,7 @@ export default { ...@@ -722,6 +731,7 @@ export default {
" "
></i> ></i>
</print-dialog> </print-dialog>
</div> </div>
</div> </div>
<img-setting <img-setting
...@@ -746,6 +756,12 @@ export default { ...@@ -746,6 +756,12 @@ export default {
</template> </template>
<style lang="less" scoped> <style lang="less" scoped>
.print-tip{
position: absolute;
bottom: 130px;
font-size: 24px;
left: 35%;
}
.page-main { .page-main {
flex: 1; flex: 1;
flex-shrink: 0; flex-shrink: 0;
...@@ -829,6 +845,7 @@ export default { ...@@ -829,6 +845,7 @@ export default {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
position: relative; position: relative;
} }
.sucaitu { .sucaitu {
...@@ -867,6 +884,7 @@ export default { ...@@ -867,6 +884,7 @@ export default {
height: 100%; height: 100%;
cursor: move; cursor: move;
border: 1px dashed transparent; border: 1px dashed transparent;
} }
} }
......
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