|
@@ -152,8 +152,8 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="选择打印机">
|
|
|
<el-select style="width:300px;" v-model="form.deviceName" placeholder="请选择打印机">
|
|
|
- <el-option v-for="item in cloudList" :key="item.id" :value="`${ item.printerName }(USB${item.port})`">
|
|
|
- <div>{{ item.printerName }}(USB{{item.port}})</div>
|
|
|
+ <el-option v-for="item in cloudList" :key="item.id" :value="`${ item.driverName }(USB${item.port})`">
|
|
|
+ <div>{{ item.driverName }}(USB{{item.port}})</div>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
<el-button type="success" @click="getCloudPrinterInfo">获取打印机信息</el-button>
|
|
@@ -464,16 +464,16 @@ export default {
|
|
|
},
|
|
|
...mapMutations(["SET_USERINFO"]),
|
|
|
saveCard() {
|
|
|
- if (this.params.sizeType === 0) {
|
|
|
- if (this.params.cardWidth < 195) {
|
|
|
- this.$refs.cardWidth.focus();
|
|
|
- return this.$message.error(`自定义纸张宽度不可小于195毫米!`);
|
|
|
- }
|
|
|
- if (this.params.cardHeight < 145) {
|
|
|
- this.$refs.cardHeight.focus();
|
|
|
- return this.$message.error(`自定义纸张高度不可小于145毫米!`);
|
|
|
- }
|
|
|
- }
|
|
|
+ // if (this.params.sizeType === 0) {
|
|
|
+ // if (this.params.cardWidth < 195) {
|
|
|
+ // this.$refs.cardWidth.focus();
|
|
|
+ // return this.$message.error(`自定义纸张宽度不可小于195毫米!`);
|
|
|
+ // }
|
|
|
+ // if (this.params.cardHeight < 145) {
|
|
|
+ // this.$refs.cardHeight.focus();
|
|
|
+ // return this.$message.error(`自定义纸张高度不可小于145毫米!`);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
cloudConfigAdd(this.params).then((res) => {
|
|
|
console.log("添加贺卡配置信息", res);
|
|
|
if (res.code === 200) {
|
|
@@ -488,19 +488,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
printTest() {
|
|
|
- if (this.params.sizeType === 0) {
|
|
|
- if (this.params.cardWidth < 195) {
|
|
|
- this.$refs.cardWidth.focus();
|
|
|
- return this.$message.error(`自定义纸张宽度不可小于195毫米!`);
|
|
|
- }
|
|
|
- if (this.params.cardHeight < 145) {
|
|
|
- this.$refs.cardHeight.focus();
|
|
|
- return this.$message.error(`自定义纸张高度不可小于145毫米!`);
|
|
|
- }
|
|
|
- }
|
|
|
- let html = this.cardHtml;
|
|
|
- if (this.params.direction === 2) {
|
|
|
- html = `<style type="text/css">
|
|
|
+ let html = `<style type="text/css">
|
|
|
@font-face {
|
|
|
font-family: ${this.params.fontFamily};
|
|
|
src: url("https://h5.liebaoai.cn/font/${
|
|
@@ -515,10 +503,29 @@ export default {
|
|
|
font-weight: normal;
|
|
|
font-style: normal;
|
|
|
}
|
|
|
+ .card-a4 {
|
|
|
+ display: flex;
|
|
|
+ justify-content: ${
|
|
|
+ this.params.htmlContentAlign ? "center" : "flex-start"
|
|
|
+ };
|
|
|
+ align-items: ${
|
|
|
+ this.params.direction === 2 ? "center" : "flex-start"
|
|
|
+ };
|
|
|
+ height: 297mm;
|
|
|
+ width: 210mm;
|
|
|
+ }
|
|
|
.card-left {
|
|
|
position: relative;
|
|
|
- height: ${this.params.cardWidth}mm;
|
|
|
- width: ${this.params.cardHeight}mm;
|
|
|
+ height: ${
|
|
|
+ this.params.direction === 1
|
|
|
+ ? this.params.cardHeight
|
|
|
+ : this.params.cardWidth
|
|
|
+ }mm;
|
|
|
+ width: ${
|
|
|
+ this.params.direction === 1
|
|
|
+ ? this.params.cardWidth
|
|
|
+ : this.params.cardHeight
|
|
|
+ }mm;
|
|
|
display:flex;
|
|
|
${this.contentStyle(1)[0]}
|
|
|
}
|
|
@@ -532,10 +539,14 @@ export default {
|
|
|
${this.contentStyle(1)[1]}
|
|
|
}
|
|
|
</style>
|
|
|
- <div class="card-left">
|
|
|
- <div class="card-con">亲爱的,生日快乐!</div>
|
|
|
+ <div class="card-a4">
|
|
|
+ <div class="card-left">
|
|
|
+ <div class="card-con">
|
|
|
+ 今天有了你,世界更精彩;今晚有了你,星空更灿烂;今生拥有你,人间更温暖。生日快乐!每个生日都有礼物,都有祝福,无论你有多少个愿望,多少个梦想,我的礼物是我的心,陪着你成长!生日快乐!
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>`;
|
|
|
- }
|
|
|
+
|
|
|
let params = {
|
|
|
orderId: 0,
|
|
|
shopId: this.params.shopIdList[0],
|
|
@@ -612,7 +623,7 @@ export default {
|
|
|
this.cloudList = res.data;
|
|
|
let cloud = this.cloudList[0];
|
|
|
if (!cloud) return;
|
|
|
- this.form.deviceName = `${cloud.printerName}(USB${cloud.port})`;
|
|
|
+ this.form.deviceName = `${cloud.driverName}(USB${cloud.port})`;
|
|
|
} else {
|
|
|
this.$message({
|
|
|
type: "error",
|