|
@@ -10,7 +10,7 @@
|
|
|
</div>
|
|
|
<div class="left-bot">根据您的制作和配送的场景选择适合的模板</div>
|
|
|
<div class="module-list">
|
|
|
- <div class="module" v-for="(module,index) in moduleList" :key=index>
|
|
|
+ <div @click="openModule(index)" class="module" v-for="(module,index) in moduleList" :key='index'>
|
|
|
<div class="img-wrap">
|
|
|
<img class="img" src="../../../../static/image/print-module.png" alt="">
|
|
|
</div>
|
|
@@ -23,7 +23,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="item" v-for="(v,i) in list" :key=i>
|
|
|
+ <!-- <div class="item" v-for="(v,i) in list" :key=i>
|
|
|
<div class="left">
|
|
|
<div class="left-top">
|
|
|
<div class="name">{{v.name}}</div>
|
|
@@ -33,7 +33,7 @@
|
|
|
<div class="right">
|
|
|
<el-switch @change="change(v)" v-model="v.value" :active-value="1" :inactive-value="0" active-color="#FC7200" inactive-color="#999" />
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
<div class="item">
|
|
|
<div class="left">
|
|
|
<div class="left-top">
|
|
@@ -128,6 +128,16 @@
|
|
|
<el-button type="primary" @click="cloudPrinterManager">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
+ <!-- A4打印模板 -->
|
|
|
+ <el-dialog title="选择默认模板" :visible.sync="showModule" width="850px" top="5vh">
|
|
|
+ <div style="height: 70vh">
|
|
|
+ <iframe :src="moduleSrc" width="800px" height="100%" frameborder="0"></iframe>
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="showModule = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="saveModule">使 用</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -194,6 +204,10 @@ export default {
|
|
|
deviceType: 28,
|
|
|
shopId: 0,
|
|
|
},
|
|
|
+ showModule: false,
|
|
|
+ moduleSrc: "",
|
|
|
+ origin: "",
|
|
|
+ cloudList: [],
|
|
|
};
|
|
|
},
|
|
|
// 监听属性 类似于data概念
|
|
@@ -202,12 +216,54 @@ export default {
|
|
|
watch: {},
|
|
|
// 生命周期 - 创建完成(可以访问当前this实例)
|
|
|
created() {
|
|
|
+ this.origin = window.location.origin;
|
|
|
this.getNewShopList();
|
|
|
},
|
|
|
// 生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
mounted() {},
|
|
|
// 方法集合
|
|
|
methods: {
|
|
|
+ getCloudPrinterInfo() {
|
|
|
+ if (!this.form.deviceSn) {
|
|
|
+ return this.$message.warning(`请输入云盒序列号!`);
|
|
|
+ }
|
|
|
+ if (!this.form.deviceSecret) {
|
|
|
+ return this.$message.warning(`请输入云盒秘钥!`);
|
|
|
+ }
|
|
|
+ let params = {
|
|
|
+ deviceId: this.form.deviceSn,
|
|
|
+ deviceKey: this.form.deviceSecret,
|
|
|
+ printerType: 1,
|
|
|
+ };
|
|
|
+ getCloudDevice(params).then((res) => {
|
|
|
+ console.log("云盒信息", res);
|
|
|
+ if (!res.code) {
|
|
|
+ this.cloudList = res.data;
|
|
|
+ let cloud = this.cloudList[0];
|
|
|
+ if (!cloud) return;
|
|
|
+ this.form.deviceName = `${cloud.driverName}(USB${cloud.port})`;
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: "error",
|
|
|
+ message: res.msg,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ changePrinterShop() {
|
|
|
+ if (e.at(-1)) {
|
|
|
+ this.form.shopIdList = e.filter((v) => {
|
|
|
+ return v;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.form.shopIdList = [0];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ openModule(index) {
|
|
|
+ this.showModule = true;
|
|
|
+ this.moduleSrc = `order-print-module/module${index}.html`;
|
|
|
+ },
|
|
|
+ saveModule() {},
|
|
|
openSettingPhone() {
|
|
|
this.showSettingPhone = true;
|
|
|
},
|
|
@@ -310,6 +366,7 @@ export default {
|
|
|
background-color: #fc7200;
|
|
|
border-color: #fc7200;
|
|
|
}
|
|
|
+
|
|
|
.setting-model {
|
|
|
.title {
|
|
|
position: relative;
|