diff --git a/src/lang/zh.js b/src/lang/zh.js index f23f34a3..e9123f2e 100644 --- a/src/lang/zh.js +++ b/src/lang/zh.js @@ -662,7 +662,10 @@ export default { notinvoiceQuantity: '未开票数', invoiceMoney: '已开票额', notinvoiceMoney: '未开票额', - invoice: '开票' + invoice: '开票', + deliveryNumber: '到货单号', + arrivalTime: '到货时间', + warehouseReceiptNumber: '入库单号' }, supplierPunishmentCount: { supplierName: '供应商名称', diff --git a/src/views/StockCount/stockOrderlist.vue b/src/views/StockCount/stockOrderlist.vue index 7b303ce2..e3e2f976 100644 --- a/src/views/StockCount/stockOrderlist.vue +++ b/src/views/StockCount/stockOrderlist.vue @@ -253,6 +253,16 @@ export default { _that = this }, methods: { + jundgeprice() { + const value = ['1-22-24-115'] + const roles = this.$store.getters && this.$store.getters.roles + const permissionRoles = value + const hasPermission = roles.some(role => { + return permissionRoles.includes(role) + }) + console.log('hasPermission=======', hasPermission) + return hasPermission + }, clickRow(val) { if (val.judgeStat === 0) { this.$refs.table.toggleRowSelection(val) diff --git a/src/views/StockCount/stockTrackList.vue b/src/views/StockCount/stockTrackList.vue index 98612159..8bf74b72 100644 --- a/src/views/StockCount/stockTrackList.vue +++ b/src/views/StockCount/stockTrackList.vue @@ -34,22 +34,62 @@ :label="$t('stockTrackList.supplierName')" prop="supplierName" width="200" + fixed="left" align="center"/> + + + + + + + + + + + {{ $t('public.search') }} - + {{ $t('public.export') }} @@ -43,11 +43,26 @@ {{ scope.row.arrivalNum }} - + + + { this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 140 }, 100) }, mounted() { - this.getlist() - this.changeName() + // this.changeName() setTimeout(() => { this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 140 }, 100) @@ -210,6 +223,55 @@ export default { _that = this }, methods: { + cutnull(data) { + for (let x = 0; x < data.length; x++) { + if (data[x] === null || data[x] === undefined || data[x] === '') { // 如果是null 把直接内容转为 '' + data.splice(x, 1) + x-- + } else { + if (Array.isArray(data[x])) { // 是数组遍历数组 递归继续处理 + data[x] = data[x].map(z => { + return this.cutnull(z) + }) + } + if (typeof (data[x]) === 'object') { // 是json 递归继续处理 + data[x] = this.cutnull(data[x]) + } + } + } + return data + }, + handleExport() { + for (let i = 0; i < this.list.length; i++) { + if (this.list[i].orderDelayVos) { + for (let j = 0; j < this.list[i].orderDelayVos.length; j++) { + this.list[i].orderDelayVos[j].supplierName = this.list[i].supplierName + } + } + } + const newarr = this.list.map(item => { + return item.orderDelayVos + }) + const newarr2 = this.cutnull([].concat.apply([], newarr)) + console.log('newarr2=', newarr2) + this.downloadLoading = true + import('@/vendor/Export2Excel').then(excel => { + const tHeader = ['供应商', '订单编号', '物品名称', '物品编码', '延迟天数', '实际到货日期', '应到货日期'] + const filterVal = ['supplierName', 'orderNumber', 'productName', 'productCode', 'days', 'actualDate', 'shouldDate'] + const data = this.formatJson(filterVal, newarr2) + excel.export_json_to_excel({ + header: tHeader, + data, + filename: '客户资料表' + }) + this.downloadLoading = false + }) + }, + formatJson(filterVal, jsonData) { + return jsonData.map(v => filterVal.map(j => { + return v[j] + })) + }, handleDetail2(row) { console.log('row', row) const param = {} @@ -311,6 +373,14 @@ export default { }, // 搜索 handleFilter() { + if (this.date.length < 2) { + this.$notify.error({ + title: 'wrong', + message: '请选择日期', + offset: 100 + }) + return false + } this.getemplist.pageNum = 1 if (this.date === null || this.date === undefined || this.date === '') { this.getemplist.beginTime = '' diff --git a/src/views/StockOrder/StockOrderList.vue b/src/views/StockOrder/StockOrderList.vue index 838e6c88..43dc0a23 100644 --- a/src/views/StockOrder/StockOrderList.vue +++ b/src/views/StockOrder/StockOrderList.vue @@ -456,6 +456,16 @@ export default { _that = this }, methods: { + jundgeprice() { + const value = ['1-22-24-115'] + const roles = this.$store.getters && this.$store.getters.roles + const permissionRoles = value + const hasPermission = roles.some(role => { + return permissionRoles.includes(role) + }) + console.log('hasPermission=======', hasPermission) + return hasPermission + }, getinformation() { if (this.$store.getters.empcontract) { console.log('getempcontract', this.$store.getters.empcontract)