You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

244 lines
8.2 KiB
Vue

<template>
<div>
<transition appear enter-active-class="animated fadeIn">
<q-table
class="my-sticky-header-table shadow-24"
:data="table_list"
row-key="id"
:separator="separator"
:loading="loading"
:filter="filter"
:columns="columns"
hide-bottom
:pagination.sync="pagination"
no-data-label="No data"
no-results-label="No data you want"
:table-style="{ height: height }"
flat
bordered
>
<template v-slot:top>
<q-btn-group push>
<q-btn :label="$t('refresh')" @click="reFresh()">
<q-tooltip content-class="bg-amber text-black shadow-4" :offset="[10, 10]" content-style="font-size: 12px">
{{ $t('refreshtip') }}
</q-tooltip>
</q-btn>
</q-btn-group>
<q-space />
<q-input outlined rounded dense debounce="300" color="primary" v-model="filter" :placeholder="$t('search')" @blur="getSearchList()" @keyup.enter="getSearchList()">
</q-input>
</template>
<template v-slot:body="props">
<q-tr :props="props">
<q-td key="asn_code" :props="props">
{{ props.row.asn_code }}
</q-td>
<q-td key="goods_code" :props="props">
{{ props.row.goods_code }}
</q-td>
<q-td key="goods_qty" :props="props">
{{ props.row.goods_qty }}
</q-td>
<q-td key="goods_actual_qty" :props="props">
{{ props.row.goods_actual_qty }}
</q-td>
<q-td key="goods_shortage_qty" :props="props">
{{ props.row.goods_shortage_qty }}
</q-td>
<q-td key="goods_more_qty" :props="props">
{{ props.row.goods_more_qty }}
</q-td>
<q-td key="goods_damage_qty" :props="props">
{{ props.row.goods_damage_qty }}
</q-td>
<q-td key="supplier" :props="props">
{{ props.row.supplier }}
</q-td>
<q-td key="creater" :props="props">
{{ props.row.creater }}
</q-td>
<q-td key="create_time" :props="props">
{{ props.row.create_time }}
</q-td>
<q-td key="update_time" :props="props">
{{ props.row.update_time }}
</q-td>
</q-tr>
</template>
</q-table>
</transition>
<template>
<div class="q-pa-lg flex flex-center">
<q-btn v-show="pathname_previous" flat push color="purple" :label="$t('previous')" icon="navigate_before" @click="getListPrevious()">
<q-tooltip content-class="bg-amber text-black shadow-4" :offset="[10, 10]" content-style="font-size: 12px">
{{ $t('previous') }}
</q-tooltip>
</q-btn>
<q-btn v-show="pathname_next" flat push color="purple" :label="$t('next')" icon-right="navigate_next" @click="getListNext()">
<q-tooltip content-class="bg-amber text-black shadow-4" :offset="[10, 10]" content-style="font-size: 12px">
{{ $t('next') }}
</q-tooltip>
</q-btn>
<q-btn v-show="!pathname_previous && !pathname_next" flat push color="dark" :label="$t('no_data')"></q-btn>
</div>
</template>
</div>
</template>
<router-view />
<script>
import { getauth } from 'boot/axios_request'
export default {
name: 'Pageasnfinish',
data () {
return {
openid: '',
login_name: '',
authin: '0',
pathname: 'asn/detail/?asn_status=5&ordering=-id',
pathname_previous: '',
pathname_next: '',
separator: 'cell',
loading: false,
height: '',
table_list: [],
bin_size_list: [],
bin_property_list: [],
warehouse_list: [],
columns: [
{ name: 'asn_code', required: true, label: this.$t('inbound.view_asn.asn_code'), align: 'left', field: 'asn_code' },
{ name: 'goods_code', label: this.$t('goods.view_goodslist.goods_code'), field: 'goods_code', align: 'center' },
{ name: 'goods_qty', label: this.$t('inbound.view_asn.goods_qty'), field: 'goods_qty', align: 'center' },
{ name: 'goods_actual_qty', label: this.$t('inbound.view_asn.goods_actual_qty'), field: 'goods_actual_qty', align: 'center' },
{ name: 'goods_shortage_qty', label: this.$t('inbound.view_asn.goods_shortage_qty'), field: 'goods_shortage_qty', align: 'center' },
{ name: 'goods_more_qty', label: this.$t('inbound.view_asn.goods_more_qty'), field: 'goods_more_qty', align: 'center' },
{ name: 'goods_damage_qty', label: this.$t('inbound.view_asn.goods_damage_qty'), field: 'goods_damage_qty', align: 'center' },
{ name: 'supplier', label: this.$t('baseinfo.view_supplier.supplier_name'), field: 'supplier', align: 'center' },
{ name: 'creater', label: this.$t('creater'), field: 'creater', align: 'center' },
{ name: 'create_time', label: this.$t('createtime'), field: 'create_time', align: 'center' },
{ name: 'update_time', label: this.$t('updatetime'), field: 'update_time', align: 'center' }
],
filter: '',
pagination: {
page: 1,
rowsPerPage: '30'
},
devi: window.device
}
},
methods: {
getList () {
var _this = this
if (_this.$q.localStorage.has('auth')) {
getauth(_this.pathname, {
}).then(res => {
_this.table_list = res.results
_this.pathname_previous = res.previous
_this.pathname_next = res.next
}).catch(err => {
_this.$q.notify({
message: err.detail,
icon: 'close',
color: 'negative'
})
})
} else {
}
},
getSearchList () {
var _this = this
if (_this.$q.localStorage.has('auth')) {
getauth(_this.pathname + '&asn_code__icontains=' + _this.filter, {
}).then(res => {
_this.table_list = res.results
_this.pathname_previous = res.previous
_this.pathname_next = res.next
}).catch(err => {
_this.$q.notify({
message: err.detail,
icon: 'close',
color: 'negative'
})
})
} else {
}
},
getListPrevious () {
var _this = this
if (_this.$q.localStorage.has('auth')) {
getauth(_this.pathname_previous, {
}).then(res => {
_this.table_list = res.results
_this.pathname_previous = res.previous
_this.pathname_next = res.next
}).catch(err => {
_this.$q.notify({
message: err.detail,
icon: 'close',
color: 'negative'
})
})
} else {
}
},
getListNext () {
var _this = this
if (_this.$q.localStorage.has('auth')) {
getauth(_this.pathname_next, {
}).then(res => {
_this.table_list = res.results
_this.pathname_previous = res.previous
_this.pathname_next = res.next
}).catch(err => {
_this.$q.notify({
message: err.detail,
icon: 'close',
color: 'negative'
})
})
} else {
}
},
reFresh () {
var _this = this
_this.getList()
}
},
created () {
var _this = this
if (_this.$q.localStorage.has('openid')) {
_this.openid = _this.$q.localStorage.getItem('openid')
} else {
_this.openid = ''
_this.$q.localStorage.set('openid', '')
}
if (_this.$q.localStorage.has('login_name')) {
_this.login_name = _this.$q.localStorage.getItem('login_name')
} else {
_this.login_name = ''
_this.$q.localStorage.set('login_name', '')
}
if (_this.$q.localStorage.has('auth')) {
_this.authin = '1'
_this.getList()
} else {
_this.authin = '0'
}
},
mounted () {
var _this = this
if (_this.$q.platform.is.electron) {
_this.height = String(_this.$q.screen.height - 290) + 'px'
} else {
_this.height = _this.$q.screen.height - 290 + '' + 'px'
}
},
updated () {
},
destroyed () {
}
}
</script>