| | |
| | | var vm = new Vue({ |
| | | var vm = new Vue({ |
| | | el: '#app', |
| | | data: function () { |
| | | return { |
| | |
| | | active: 0, |
| | | show: false, |
| | | actions: [], |
| | | filterCondition: "装配车间", |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | }, |
| | | methods: { |
| | | getInfo() { |
| | | this.show = true; |
| | | |
| | | var that = this; |
| | | that.isLoading = true; |
| | | that.AxiosHttp("post", 'MesStaff/GetList', { |
| | |
| | | .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); |
| | |
| | | // 可以通过 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); |