|
@@ -42,7 +42,7 @@
|
|
<div class="left-bot">设置的店铺电话会打印在A4纸张上</div>
|
|
<div class="left-bot">设置的店铺电话会打印在A4纸张上</div>
|
|
</div>
|
|
</div>
|
|
<div class="right" @click="openSettingPhone">
|
|
<div class="right" @click="openSettingPhone">
|
|
- <div class="right-name">{{picturePrintMobile}}</div>
|
|
|
|
|
|
+ <div class="right-name">{{picturePrintMobileType === 1 ? '统一设置' : '各店铺电话'}}</div>
|
|
<i class="el-icon-arrow-right"></i>
|
|
<i class="el-icon-arrow-right"></i>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -84,12 +84,12 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- 设置联系电话 -->
|
|
<!-- 设置联系电话 -->
|
|
- <el-dialog title="电话设置" :visible.sync="showSettingPhone" width="500px">
|
|
|
|
|
|
+ <el-dialog title="电话设置" :visible.sync="showSettingPhone" width="500px" @close="getConfig">
|
|
<el-select size="small" v-model="picturePrintMobileType" placeholder="请选择">
|
|
<el-select size="small" v-model="picturePrintMobileType" placeholder="请选择">
|
|
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
|
|
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
- <el-input class="unify-phone" size="small" v-if="picturePrintMobileType===1" v-model="unifyPhone" placeholder="请输入统一的电话号码"></el-input>
|
|
|
|
|
|
+ <el-input class="unify-phone" size="small" v-if="picturePrintMobileType===1" v-model="picturePrintMobile" placeholder="请输入统一的电话号码"></el-input>
|
|
<span slot="footer" class="dialog-footer">
|
|
<span slot="footer" class="dialog-footer">
|
|
<el-button size="small" @click="showSettingPhone = false">取 消</el-button>
|
|
<el-button size="small" @click="showSettingPhone = false">取 消</el-button>
|
|
<el-button size="small" type="primary" @click="confirmSettingPhone">确 定</el-button>
|
|
<el-button size="small" type="primary" @click="confirmSettingPhone">确 定</el-button>
|
|
@@ -142,7 +142,13 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { getNewShopList, deviceAdd, shopDeviceList } from "../../../api/shop";
|
|
|
|
|
|
+import {
|
|
|
|
+ getNewShopList,
|
|
|
|
+ deviceAdd,
|
|
|
|
+ shopDeviceList,
|
|
|
|
+ deviceDelete,
|
|
|
|
+ getCloudDevice,
|
|
|
|
+} from "../../../api/shop";
|
|
import { getConfig, updateConfig } from "../../../api/setting.js";
|
|
import { getConfig, updateConfig } from "../../../api/setting.js";
|
|
import { mapState, mapMutations, mapGetters, mapActions } from "vuex";
|
|
import { mapState, mapMutations, mapGetters, mapActions } from "vuex";
|
|
|
|
|
|
@@ -184,7 +190,6 @@ export default {
|
|
],
|
|
],
|
|
showSettingPhone: false,
|
|
showSettingPhone: false,
|
|
picturePrintMobileType: 2,
|
|
picturePrintMobileType: 2,
|
|
- unifyPhone: "",
|
|
|
|
options: [
|
|
options: [
|
|
{
|
|
{
|
|
value: 2,
|
|
value: 2,
|
|
@@ -206,6 +211,7 @@ export default {
|
|
deviceName: "",
|
|
deviceName: "",
|
|
deviceType: 28,
|
|
deviceType: 28,
|
|
shopId: 0,
|
|
shopId: 0,
|
|
|
|
+ lkyPrintType: 1,
|
|
},
|
|
},
|
|
showModule: false,
|
|
showModule: false,
|
|
moduleSrc: "",
|
|
moduleSrc: "",
|
|
@@ -213,6 +219,7 @@ export default {
|
|
cloudList: [],
|
|
cloudList: [],
|
|
openModuleIndex: 0,
|
|
openModuleIndex: 0,
|
|
showTitle: "选择默认模板",
|
|
showTitle: "选择默认模板",
|
|
|
|
+ memberType: 1,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
// 监听属性 类似于data概念
|
|
// 监听属性 类似于data概念
|
|
@@ -225,6 +232,16 @@ export default {
|
|
this.getNewShopList();
|
|
this.getNewShopList();
|
|
this.getCloudPrinterList();
|
|
this.getCloudPrinterList();
|
|
this.getConfig();
|
|
this.getConfig();
|
|
|
|
+ let userInfo = JSON.parse(localStorage.getItem("userInfo"));
|
|
|
|
+ this.memberType = userInfo.memberType;
|
|
|
|
+ if (this.memberType === 3) {
|
|
|
|
+ this.options = [
|
|
|
|
+ {
|
|
|
|
+ value: 2,
|
|
|
|
+ label: "各店铺联系电话",
|
|
|
|
+ },
|
|
|
|
+ ];
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// 生命周期 - 挂载完成(可以访问DOM元素)
|
|
// 生命周期 - 挂载完成(可以访问DOM元素)
|
|
mounted() {},
|
|
mounted() {},
|
|
@@ -258,7 +275,7 @@ export default {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- changePrinterShop() {
|
|
|
|
|
|
+ changePrinterShop(e) {
|
|
if (e.at(-1)) {
|
|
if (e.at(-1)) {
|
|
this.form.shopIdList = e.filter((v) => {
|
|
this.form.shopIdList = e.filter((v) => {
|
|
return v;
|
|
return v;
|
|
@@ -296,19 +313,51 @@ export default {
|
|
confirmSettingPhone() {
|
|
confirmSettingPhone() {
|
|
if (
|
|
if (
|
|
this.picturePrintMobileType === 1 &&
|
|
this.picturePrintMobileType === 1 &&
|
|
- !this.$tool.mobile(this.unifyPhone)
|
|
|
|
|
|
+ !this.$tool.mobile(this.picturePrintMobile)
|
|
) {
|
|
) {
|
|
- this.$message.error("请输入正确的电话号码!");
|
|
|
|
|
|
+ return this.$message.error("请输入正确的电话号码!");
|
|
}
|
|
}
|
|
this.updateConfig({
|
|
this.updateConfig({
|
|
picturePrintMobileType: this.picturePrintMobileType,
|
|
picturePrintMobileType: this.picturePrintMobileType,
|
|
picturePrintMobile: this.picturePrintMobile,
|
|
picturePrintMobile: this.picturePrintMobile,
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ deletePrinter(v) {
|
|
|
|
+ this.$confirm("此操作将删除打印云盒, 是否继续?", "提示", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
+ type: "warning",
|
|
|
|
+ center: true,
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ deviceDelete({ id: v.id }).then((res) => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: "success",
|
|
|
|
+ message: "删除成功!",
|
|
|
|
+ });
|
|
|
|
+ this.getCloudPrinterList();
|
|
|
|
+ } else {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: "error",
|
|
|
|
+ message: res.msg,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: "info",
|
|
|
|
+ message: "已取消删除",
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
getNewShopList() {
|
|
getNewShopList() {
|
|
getNewShopList().then((res) => {
|
|
getNewShopList().then((res) => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
- res.data.unshift({ id: 0, name: "全部门店" });
|
|
|
|
|
|
+ if (this.memberType === 2) {
|
|
|
|
+ res.data.unshift({ id: 0, name: "全部门店" });
|
|
|
|
+ }
|
|
this.shopList = res.data;
|
|
this.shopList = res.data;
|
|
} else {
|
|
} else {
|
|
this.$message({
|
|
this.$message({
|
|
@@ -404,7 +453,7 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
getCloudPrinterList() {
|
|
getCloudPrinterList() {
|
|
- shopDeviceList({ deviceType: 28 }).then((res) => {
|
|
|
|
|
|
+ shopDeviceList({ deviceType: 28, lkyPrintType: 1 }).then((res) => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
this.printerList = res.data;
|
|
this.printerList = res.data;
|
|
} else {
|
|
} else {
|