|
@@ -28,7 +28,6 @@
|
|
|
:rowKey="(record) => record.id"
|
|
|
:columns="columns"
|
|
|
:data="loadData"
|
|
|
- :showPagination="false"
|
|
|
bordered>
|
|
|
<!-- 仓位 -->
|
|
|
<template slot="storingLocation" slot-scope="text, record">
|
|
@@ -46,7 +45,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { warehouseFindAll, warehouseDel } from '@/api/warehouse'
|
|
|
+import { warehouseList, warehouseDel } from '@/api/warehouse'
|
|
|
import { STable } from '@/components'
|
|
|
import warehouseEditModal from './editModal.vue'
|
|
|
export default {
|
|
@@ -54,27 +53,32 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
queryParam: { // 查询条件
|
|
|
- name: '', // 仓库名称
|
|
|
+ name: '' // 仓库名称
|
|
|
},
|
|
|
disabled: false, // 查询、重置按钮是否可操作
|
|
|
columns: [
|
|
|
+ { title: '序号', dataIndex: 'no', width: 70, align: 'center' },
|
|
|
{ title: '仓库名称', dataIndex: 'name', align: 'center', ellipsis: true, customRender: function (text) { return text || '--' } },
|
|
|
- { title: '排序', dataIndex: 'sort', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
+ { title: '排序', dataIndex: 'sort', width: 160, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
|
|
|
{ title: '仓位', scopedSlots: { customRender: 'storingLocation' }, align: 'center' },
|
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: 240, align: 'center' }
|
|
|
],
|
|
|
// 加载数据方法 必须为 Promise 对象
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
|
- return warehouseFindAll( this.queryParam ).then(res => {
|
|
|
+ return warehouseList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
const data = res.data
|
|
|
+ const no = (data.pageNo - 1) * data.pageSize
|
|
|
+ for (var i = 0; i < data.list.length; i++) {
|
|
|
+ data.list[i].no = no + i + 1
|
|
|
+ }
|
|
|
this.disabled = false
|
|
|
return data
|
|
|
})
|
|
|
},
|
|
|
- openModal: false, // 新增编辑 弹框
|
|
|
- itemId: '', // 当前id
|
|
|
- nowData: null // 当前记录数据
|
|
|
+ openModal: false, // 新增编辑 弹框
|
|
|
+ itemId: '', // 当前id
|
|
|
+ nowData: null // 当前记录数据
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -84,29 +88,29 @@ export default {
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
// 新增/编辑
|
|
|
- handleEdit(row){
|
|
|
+ handleEdit (row) {
|
|
|
this.itemId = row ? row.id : null
|
|
|
- this.nowData = row ? row : null
|
|
|
+ this.nowData = row || null
|
|
|
this.openModal = true
|
|
|
},
|
|
|
// 新增/编辑 成功
|
|
|
- handleOk(){
|
|
|
+ handleOk () {
|
|
|
this.$refs.table.refresh(true)
|
|
|
},
|
|
|
// 关闭弹框
|
|
|
- closeModal(){
|
|
|
+ closeModal () {
|
|
|
this.itemId = ''
|
|
|
this.openModal = false
|
|
|
},
|
|
|
// 删除
|
|
|
- handleDel(row){
|
|
|
+ handleDel (row) {
|
|
|
const _this = this
|
|
|
this.$confirm({
|
|
|
title: '提示',
|
|
|
content: '删除后不可恢复,确定要进行删除吗?',
|
|
|
okText: '确定',
|
|
|
cancelText: '取消',
|
|
|
- centered: true,
|
|
|
+ centered: true,
|
|
|
onOk () {
|
|
|
warehouseDel({
|
|
|
id: row.id
|
|
@@ -120,11 +124,11 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
// 查看仓位
|
|
|
- goStoringLocation(row){
|
|
|
+ goStoringLocation (row) {
|
|
|
this.$router.push({ path: `/inventoryManagement/storingLocation/${row.id}`, query: { name: row.name } })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
-<style lang="less"></style>
|
|
|
+<style lang="less"></style>
|