From 29d52b87325bc8406d6f6beb73939007e947e6fd Mon Sep 17 00:00:00 2001
From: wbc <2597324127@qq.com>
Date: 星期三, 24 十二月 2025 17:42:57 +0800
Subject: [PATCH] 生产报工模糊查询装配条件
---
H5/Js/Scbg.js | 47 ++++++++++++++++++++++++++++++++++-------------
H5/Scbg.aspx | 8 ++++++++
2 files changed, 42 insertions(+), 13 deletions(-)
diff --git a/H5/Js/Scbg.js b/H5/Js/Scbg.js
index cbafb1f..2a8e4f9 100644
--- a/H5/Js/Scbg.js
+++ b/H5/Js/Scbg.js
@@ -1,4 +1,4 @@
-锘縱ar vm = new Vue({
+var vm = new Vue({
el: '#app',
data: function () {
return {
@@ -27,6 +27,7 @@
active: 0,
show: false,
actions: [],
+ filterCondition: "瑁呴厤杞﹂棿",
}
},
mounted() {
@@ -62,8 +63,6 @@
},
methods: {
getInfo() {
- this.show = true;
-
var that = this;
that.isLoading = true;
that.AxiosHttp("post", 'MesStaff/GetList', {
@@ -72,11 +71,28 @@
.then(function (res) {
var json = res;
if (json.status == 0) {
- that.actions = json.data.tbBillList.map(item => {
- return { name: item.staffName }
- });
-
that.stafList = json.data.tbBillList;
+
+ let searchText = that.filterCondition ? String(that.filterCondition).trim().toLowerCase() : "";
+ let filteredList = that.stafList;
+
+ if (searchText) {
+ filteredList = that.stafList.filter(item => {
+ let sName = item.staffName ? String(item.staffName).toLowerCase() : "";
+ let sNo = item.staffNo ? String(item.staffNo).toLowerCase() : "";
+ return sName.includes(searchText) || sNo.includes(searchText);
+ });
+ }
+
+ if (filteredList.length === 0) {
+ that.$toast("鏈壘鍒板尮閰嶇殑鍛樺伐");
+ that.actions = [];
+ } else {
+ that.actions = filteredList.map(item => {
+ return { name: item.staffName, data: item }
+ });
+ that.show = true;
+ }
}
else {
that.$toast.fail(json.message);
@@ -99,14 +115,19 @@
// 鍙互閫氳繃 close-on-click-action 灞炴�у紑鍚嚜鍔ㄦ敹璧�
this.show = false;
- let staf = this.stafList.filter(it => it.staffName === item.name);
-
- if (staf.length > 0) {
- this.stafName = staf[0].staffName;
- this.stafId = staf[0].staffNo;
+ if (item.data) {
+ this.stafName = item.data.staffName;
+ this.stafId = item.data.staffNo;
this.$refs.barcode.focus();
} else {
- this.$toast("鏈壘鍒板尮閰嶇殑 staffName");
+ let staf = this.stafList.filter(it => it.staffName === item.name);
+ if (staf.length > 0) {
+ this.stafName = staf[0].staffName;
+ this.stafId = staf[0].staffNo;
+ this.$refs.barcode.focus();
+ } else {
+ this.$toast("鏈壘鍒板尮閰嶇殑 staffName");
+ }
}
//this.GetMesItemBlDetailByBillNo();
//this.$toast(item.name);
diff --git a/H5/Scbg.aspx b/H5/Scbg.aspx
index c6eeb18..e0f2508 100644
--- a/H5/Scbg.aspx
+++ b/H5/Scbg.aspx
@@ -18,6 +18,14 @@
<van-cell-group>
<van-field
value=""
+ label="鏌ヨ鏉′欢"
+ clearable
+ placeholder="璇疯緭鍏ユ煡璇㈡潯浠�"
+ :right-icon-size="19"
+ v-model="filterCondition"
+ ></van-field>
+ <van-field
+ value=""
label="鍛樺伐缂栧彿"
clearable
placeholder="閫夋嫨"
--
Gitblit v1.9.3