diff --git a/inventory_check/models.py b/inventory_check/models.py index 759a269..bdf8206 100644 --- a/inventory_check/models.py +++ b/inventory_check/models.py @@ -18,7 +18,6 @@ class Inventory(db.Model): tag = db.Column(db.Text) amount = db.Column(db.Integer) checked = db.Column(db.Boolean, default=False) - name = db.Column(db.Text) # mtime = db.Column(db.Date) diff --git a/inventory_check/static/js/script.js b/inventory_check/static/js/script.js index 6a33d2b..18ab8c7 100644 --- a/inventory_check/static/js/script.js +++ b/inventory_check/static/js/script.js @@ -16,8 +16,8 @@ function checknext() { var id = parseInt(idelement.innerText, 10); // 第二个参数10表示解析的基数,这里是十进制 var tagelement = document.getElementById("inventory-tag"); var tag = tagelement.innerText; - var name = "A" var msg = document.getElementById("flash-msg"); + var location = document.getElementById("inventory-location"); // var params = new URLSearchParams({ // checked: 1, // id: id, @@ -29,7 +29,7 @@ function checknext() { headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({id: id, amount: amount.value, name: name}) + body: JSON.stringify({id: id, amount: amount.value}) }) .then(response => response.json()) .then(data => { @@ -38,57 +38,9 @@ function checknext() { tagelement.innerText = data.tag; idelement.innerText = data.id; msg.innerText = data.checkedone + " 盘点数 " + data.checkedamount; + location.innerText = data.location; }) .catch(error => console.error('Error:', error)); } -// function apiAuth() { -// if (!window.h5sdk) { -// alert("请在飞书客户端中打开"); -// return; -// } - -// window.h5sdk.ready(() => { -// tt.requestAccess({ -// appID: "your_app_id", -// scopeList: [], -// success(res) { -// // 将 code 发送到服务端 -// fetch(`/callback?code=${res.code}`) -// .then(response => response.json()) -// .then(data => { -// console.log("用户信息:", data); -// // 在页面上展示用户姓名 -// document.getElementById("username").innerText = data.name; -// }); -// }, -// fail(err) { -// console.error("获取授权码失败:", err); -// } -// }); -// }); -// } -// apiAuth(); - -function apiAuth() { - tt.requestAccess({ - appID: "cli_a70da4f71bf1d00c", - scopeList: [], - success(res) { - // 将 code 发送到服务端 - fetch(`/callback?code=${res.code}`) - .then(response => response.json()) - .then(data => { - // console.log("用户信息:", data); - // 在页面上展示用户姓名 - document.getElementById("username").innerText = data.name; - }); - }, - fail(err) { - console.error("获取授权码失败:", err); - } - }); - }; - -apiAuth(); \ No newline at end of file diff --git a/inventory_check/templates/base.html b/inventory_check/templates/base.html index 77704a1..378e79d 100644 --- a/inventory_check/templates/base.html +++ b/inventory_check/templates/base.html @@ -16,9 +16,8 @@ {% block content %}{% endblock %} diff --git a/inventory_check/templates/check.html b/inventory_check/templates/check.html index 1e7c2eb..4d2adfc 100644 --- a/inventory_check/templates/check.html +++ b/inventory_check/templates/check.html @@ -7,7 +7,7 @@
标签 | -数量 | -已盘 | -
---|---|---|
一月 | -¥3400 | -¥3400 | -
一月 | -¥3400 | -¥3400 | -
一月 | -¥3400 | -¥3400 | -
一月 | -¥3400 | -¥3400 | -
一月 | -¥3400 | -¥3400 | -
一月 | -¥3400 | -¥3400 | -