ソースを参照

接单小票机

shish 3 年 前
コミット
72c3d1dc5d

+ 5 - 1
ghsApp/src/admin/home/me.vue

@@ -99,7 +99,11 @@
             </tui-list-cell>
             </tui-list-cell>
 
 
             <tui-list-cell @click="pageTo({ url: '/admin/shop/print' })" class="line-cell" :hover="false" :arrow="true">
             <tui-list-cell @click="pageTo({ url: '/admin/shop/print' })" class="line-cell" :hover="false" :arrow="true">
-              <view class="tui-title">小票机设置</view>
+              <view class="tui-title">接单小票机</view>
+            </tui-list-cell>
+
+            <tui-list-cell @click="pageTo({ url: '/admin/shop/wcPrint' })" class="line-cell" :hover="false" :arrow="true">
+              <view class="tui-title">外采小票机</view>
             </tui-list-cell>
             </tui-list-cell>
 
 
             <tui-list-cell @click="pageTo({ url: '/admin/shop/trumpet' })" class="line-cell" :hover="false" :arrow="true">
             <tui-list-cell @click="pageTo({ url: '/admin/shop/trumpet' })" class="line-cell" :hover="false" :arrow="true">

+ 157 - 0
ghsApp/src/admin/shop/wcPrint.vue

@@ -0,0 +1,157 @@
+<template>
+  <view class="app-content">
+    <view>
+      <form @submit="formSubmit">
+        <view class="module-com input-line-wrap">
+          
+          <tui-list-cell class="line-cell" :hover="false">
+            <view class="tui-title">小票机编号1:</view>
+            <input v-model="form.wcPrintSn" @focus="form.wcPrintSn=''" placeholder-class="phcolor" class="tui-input" name="wcPrintSn" placeholder="请填写编号,SN码" maxlength="50" type="number" />
+          </tui-list-cell>
+          <tui-list-cell class="line-cell" :hover="false">
+            <view class="tui-title">小票机密钥1:</view>
+            <input v-model="form.wcPrintKey" @focus="form.wcPrintKey=''" placeholder-class="phcolor" class="tui-input" name="wcPrintKey" placeholder="请填写密钥,KEY码" maxlength="50" type="text" />
+          </tui-list-cell>
+<view style="margin-top:50upx;">
+          <tui-list-cell class="line-cell" :hover="false">
+            <view class="tui-title">小票机编号2:</view>
+            <input v-model="form.wcPrintSn2" @focus="form.wcPrintSn2=''" placeholder-class="phcolor" class="tui-input" name="wcPrintSn2" placeholder="请填写编号,SN码" maxlength="50" type="number" />
+          </tui-list-cell>
+          <tui-list-cell class="line-cell" :hover="false">
+            <view class="tui-title">小票机密钥2:</view>
+            <input v-model="form.wcPrintKey2" @focus="form.wcPrintKey2=''" placeholder-class="phcolor" class="tui-input" name="wcPrintKey2" placeholder="请填写密钥,KEY码" maxlength="50" type="text" />
+          </tui-list-cell>
+</view>
+<view style="margin-top:50upx;">
+          <tui-list-cell class="line-cell" :hover="false">
+            <view class="tui-title">小票机编号3:</view>
+            <input v-model="form.wcPrintSn3" @focus="form.wcPrintSn3=''" placeholder-class="phcolor" class="tui-input" name="wcPrintSn3" placeholder="请填写编号,SN码" maxlength="50" type="number" />
+          </tui-list-cell>
+          <tui-list-cell class="line-cell" :hover="false">
+            <view class="tui-title">小票机密钥3:</view>
+            <input v-model="form.wcPrintKey3" @focus="form.wcPrintKey3=''" placeholder-class="phcolor" class="tui-input" name="wcPrintKey3" placeholder="请填写密钥,KEY码" maxlength="50" type="text" />
+          </tui-list-cell>
+</view>
+        </view>
+
+        <view class="confirm-btn">
+          <button class="admin-button-com big blue" formType="submit">
+            提交
+          </button>
+        </view>
+        <view style="padding-left:40upx;margin-top:50upx;font-size:32upx;">
+
+          <view>
+            <view style="font-weight:bold;">小票机</view>
+            <view style="margin-top:10upx;">飞鹅小票机 4G 带切刀(自动切纸)</view>
+            <view style="margin-top:10upx;">热敏打印纸 57x50</view>
+          </view>
+
+        </view>
+      </form>
+    </view>
+
+  </view>
+</template>
+
+<script>
+import TuiListCell from "@/components/plugin/list-cell";
+import AppAvatarModule from "@/components/module/app-avatar";
+const form = require("@/utils/formValidation.js");
+import { addWcPrint,getPrint } from "@/api/shop";
+export default {
+  name: "shopPrint",
+  components: {
+    TuiListCell,
+    AppAvatarModule,
+  },
+  data() {
+    return {
+      form: {
+        wcPrintKey: "",
+        wcPrintSn: "",
+        wcPrintKey2: "",
+        wcPrintSn2: "",
+        wcPrintKey3: "",
+        wcPrintSn3: ""
+      },
+      roleList: [],
+      roleSelData: {},
+      miniCodeSrc: "",
+      memberData: {},
+    };
+  },
+  methods: {
+    async init() {
+        const { data } = await getPrint()
+        this.form.wcPrintKey = data.wcPrintKey
+        this.form.wcPrintSn = data.wcPrintSn
+        this.form.wcPrintKey2 = data.wcPrintKey2
+        this.form.wcPrintSn2 = data.wcPrintSn2
+        this.form.wcPrintKey3 = data.wcPrintKey3
+        this.form.wcPrintSn3 = data.wcPrintSn3
+        this.$forceUpdate()
+    },
+    confirmFn() {
+      addWcPrint(this.form).then((res) => {
+        this.$msg(res.msg);
+        if(res.code == 1){
+          setTimeout(() => {
+            uni.navigateBack();
+          }, 1000)
+        }
+      });
+    },
+    formSubmit(e) {
+      let rules = [
+        {
+          name: "wcPrintSn",
+          rule: ["required"],
+          msg: ["请填写小票机编号"],
+        },
+        {
+          name: "wcPrintKey",
+          rule: ["required"],
+          msg: ["请填写小票机密钥"],
+        },
+      ]
+      this.confirmFn();
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.app-content {
+  min-height: calc(100vh - 20upx);
+  padding-top: 20upx;
+}
+.prompt-text {
+  color: $fontColor3;
+  padding-left: 30upx;
+  margin-bottom: 30upx;
+}
+.module-com {
+  margin-bottom: 20upx;
+  .member-wrap {
+    .member-det {
+      font-size: 24upx;
+      margin-left: 20upx;
+    }
+  }
+  .remark-wrap {
+    align-items: flex-start;
+    .remark {
+      height: 240upx;
+    }
+  }
+}
+// 按钮
+.confirm-btn {
+  width: calc(100% - 60upx);
+  margin: 60upx 30upx 20upx;
+  .admin-button-com {
+    width: 100%;
+  }
+}
+</style>

+ 4 - 0
ghsApp/src/api/shop/index.js

@@ -84,6 +84,10 @@ export const currentShop = data => {
 	return https.get('/shop/current-shop', data)
 	return https.get('/shop/current-shop', data)
 }
 }
 
 
+export const addWcPrint = data => {
+	return https.get('/shop-ext/add-wc-print', data)
+}
+
 //添加云打印机
 //添加云打印机
 export const addCloudPrint = data => {
 export const addCloudPrint = data => {
 	return https.get('/shop-ext/add-print', data)
 	return https.get('/shop-ext/add-print', data)

+ 2 - 1
ghsApp/src/pages.json

@@ -183,7 +183,8 @@
 			"pages": [
 			"pages": [
 				{"path": "list","style": {"navigationBarTitleText": "门店"}},
 				{"path": "list","style": {"navigationBarTitleText": "门店"}},
 				{"path": "add","style": {"navigationBarTitleText": ""}},
 				{"path": "add","style": {"navigationBarTitleText": ""}},
-				{"path": "print","style": {"navigationBarTitleText": "云打印"}},
+				{"path": "print","style": {"navigationBarTitleText": "小票机"}},
+				{"path": "wcPrint","style": {"navigationBarTitleText": "外采小票机"}},
 				{"path": "trumpet","style": {"navigationBarTitleText": "云音箱"}},
 				{"path": "trumpet","style": {"navigationBarTitleText": "云音箱"}},
 				{"path": "changeShop","style": {"navigationBarTitleText": "切换门店"}},
 				{"path": "changeShop","style": {"navigationBarTitleText": "切换门店"}},
 				{"path": "sk","style": {"navigationBarTitleText": "设置快捷开单门店"}},
 				{"path": "sk","style": {"navigationBarTitleText": "设置快捷开单门店"}},