This commit is contained in:
linfso 2024-09-04 07:39:54 +08:00
parent 163fbf5ec1
commit fdc8fb4a85

View File

@ -126,6 +126,7 @@ export default {
},
created() {
// this.queryData();
this.recordLatestBill();
},
watch: {
// "billCode": {
@ -152,13 +153,20 @@ export default {
recordLatestBill(billCode){
const storage = window.localStorage.getItem('queryDataStorage') ? JSON.parse(window.localStorage.getItem('queryDataStorage')) : {}
this.latestBillList = storage["latestBillList"] ? storage["latestBillList"] : [];
if(billCode){
this.latestBillList.push(billCode);
let list= this.latestBillList.filter(function(item, index, arr) {
return arr.indexOf(item, 0) === index;
})
this.latestBillList=list;
}
if(this.latestBillList&&this.latestBillList.length>0){
this.latestBillList= this.latestBillList.reverse()
storage["latestBillList"] = this.latestBillList
window.localStorage.setItem('queryDataStorage', JSON.stringify(storage))
}
},
latestClick(item){