ruanqi 1 year ago
parent
commit
c36d688b08
  1. 132
      src/views/modules/orderIssure/soIssueNotify/searchIssureNotifyForCK.vue

132
src/views/modules/orderIssure/soIssueNotify/searchIssureNotifyForCK.vue

@ -1,5 +1,10 @@
<template>
<div class="mod-config yzz">
<div>
<span @click="favoriteFunction()">
<icon-svg :name="favorite?'xiangqufill':'xiangqu'" class="sl-svg"></icon-svg>
</span>
</div>
<el-form label-position="top" style="margin-top: 1px; margin-left: 0px;">
<el-form :inline="true" label-position="top" style="margin-top: 0px">
<el-form-item :label="'申请单号'">
@ -245,6 +250,11 @@
}from "@/api/orderIssure/soIssueNotify.js"
import Chooselist from '@/views/modules/common/Chooselist'
import {getEamWorkShop} from "@/api/factory/site.js";
import {
getTableDefaultListLanguage,
getTableUserListLanguage,
} from "@/api/table.js"
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js'
export default {
components: {
Chooselist
@ -280,6 +290,7 @@
dataListLoading: false,
currentRow:'',
headerData:'',
favorite: false,
columnList1:[
{
userId: this.$store.state.user.name,
@ -1213,6 +1224,127 @@
return ''
},
//
async getTableUserColumn(tableId, columnId) {
let queryTableUser = {
userId: this.$store.state.user.name,
functionId: this.$route.meta.menuId,
tableId: tableId,
status: true,
languageCode: this.$i18n.locale
}
await getTableUserListLanguage(queryTableUser).then(({data}) => {
if (data.rows.length > 0) {
//this.columnList1 = []
switch (columnId) {
case 1:
this.columnList1 = data.rows
break;
case 2:
this.columnList2 = data.rows
break;
case 3:
this.columnList3 = data.rows
break;
case 4:
this.columnList4 = data.rows
break;
// case 5:
// this.columnList5 = data.rows
// break;
}
} else {
this.getColumnList(tableId, columnId)
}
})
},
// tableDefault
async getColumnList (tableId, columnId) {
let queryTable= {
functionId: this.$route.meta.menuId,
tableId: tableId,
languageCode: this.$i18n.locale
}
await getTableDefaultListLanguage(queryTable).then(({data}) => {
if (!data.rows.length == 0) {
switch (columnId) {
case 1:
this.columnList1 = data.rows
break;
case 2:
this.columnList2 = data.rows
break;
case 3:
this.columnList3 = data.rows
break;
case 4:
this.columnList4 = data.rows
break;
// case 5:
// this.columnList5 = data.rows
// break;
}
} else {
// this.showDefault = true.
}
})
},
//
favoriteIsOk () {
let userFavorite = {
userId: this.$store.state.user.id,
languageCode: this.$i18n.locale
}
userFavoriteList(userFavorite).then(({data}) => {
for (let i = 0; i < data.list.length; i++) {
if (this.$route.meta.menuId === data.list[i].menuId) {
this.favorite = true
}
}
})
},
// OR
favoriteFunction () {
let userFavorite = {
userId: this.$store.state.user.id,
functionId: this.$route.meta.menuId,
}
if (this.favorite) {
removeUserFavorite(userFavorite).then(({data}) => {
this.$message.success(data.msg)
this.favorite = false
})
} else {
//
saveUserFavorite(userFavorite).then(({data}) => {
this.$message.success(data.msg)
this.favorite = true
})
}
},
},
created () {
//
// this.getButtonAuthData()
// site bu
// this.getSiteAndBuByUserName()
//
this.favoriteIsOk()
//
this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
this.getTableUserColumn(this.$route.meta.menuId+'table2',2)
this.getTableUserColumn(this.$route.meta.menuId+'table3',3)
this.getTableUserColumn(this.$route.meta.menuId+'table4',4)
// if (!this.authSearch) {
// //
// this.getDataList()
// }
},
}
</script>

Loading…
Cancel
Save