优化进销存库存上传下载

This commit is contained in:
gyq
2024-06-20 09:06:35 +08:00
parent 2026193f0f
commit 7605011b63
13 changed files with 372 additions and 191 deletions

View File

@@ -5,7 +5,8 @@
<el-input v-model="query.name" clearable placeholder="供应商" @keyup.enter.native="getTableData"
style="width: 200px;" />
<el-select v-model="query.type" placeholder="付款状态">
<el-option :label="item.label" :value="item.value" v-for="item in types" :key="item.id"></el-option>
<el-option label="待支付" value="0"></el-option>
<el-option label="已完结" value="1"></el-option>
</el-select>
<el-button type="primary" @click="getTableData">查询</el-button>
<el-button @click="resetHandle">重置</el-button>
@@ -37,7 +38,7 @@
</el-table-column>
<el-table-column label="上笔进货日期" prop="lastTransactAt">
<template v-slot="scope">
{{ dayjs(scope.row.lastTransactAt).format('YYYY-MM-DD HH:mm:ss') }}
{{ scope.row.lastTransactAt && dayjs(scope.row.lastTransactAt).format('YYYY-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
<el-table-column label="操作" width="80">
@@ -77,7 +78,6 @@ export default {
}
},
mounted() {
this.dictDetail()
this.getTableData()
},
methods: {
@@ -111,14 +111,6 @@ export default {
paginationChange(e) {
this.tableData.page = e - 1
this.getTableData()
},
async dictDetail() {
const { content } = await dictDetail({
dictName: 'purveyor_transact_status',
size: 100,
page: 0
})
this.types = content
}
}
}

View File

@@ -3,7 +3,7 @@
<div class="head-container">
<el-radio-group v-model="query.time" @change="timeChange">
<el-radio-button :label="item.value" v-for="item in timeList" :key="item.label">{{ item.label
}}</el-radio-button>
}}</el-radio-button>
</el-radio-group>
</div>
<div class="head-container" v-if="query.time == 'custom'">
@@ -14,7 +14,8 @@
<div class="head-container">
<div class="filter_wrap">
<el-select v-model="query.type" placeholder="付款状态">
<el-option :label="item.label" :value="item.value" v-for="item in types" :key="item.id"></el-option>
<el-option label="待支付" value="0"></el-option>
<el-option label="已完结" value="1"></el-option>
</el-select>
<el-button type="primary" @click="getTableData">查询</el-button>
<el-button @click="resetHandle">重置</el-button>
@@ -98,7 +99,9 @@
</el-table-column>
<el-table-column label="状态" prop="status">
<template v-slot="scope">
<el-tag type="info">{{ types.find(item => item.value == scope.row.status).label }}</el-tag>
<el-tag type="info">
{{ types.find(item => item.value == scope.row.status).label }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="备注" prop="remark"></el-table-column>
@@ -162,7 +165,20 @@ export default {
value: 'custom'
}
],
types: [],
types: [
{
value: 0,
label: '待付款'
},
{
value: 1,
label: '已付款'
},
{
value: '-1',
label: '作废'
}
],
selectCount: 0,
query: {
type: '',
@@ -181,7 +197,6 @@ export default {
}
},
mounted() {
this.dictDetail()
this.getTableData()
this.tbShopPurveyorTransactSum()
},
@@ -217,14 +232,6 @@ export default {
this.tableData.page = e - 1
this.getTableData()
},
async dictDetail() {
const { content } = await dictDetail({
dictName: 'purveyor_transact_status',
size: 100,
page: 0
})
this.types = content
},
// 选择时间
timeChange(e) {
this.query.createdAt = []

View File

@@ -5,7 +5,8 @@
<el-input v-model="query.name" clearable placeholder="供应商" @keyup.enter.native="getTableData"
style="width: 200px;" />
<el-select v-model="query.type" placeholder="付款状态">
<el-option :label="item.label" :value="item.value" v-for="item in types" :key="item.id"></el-option>
<el-option label="待支付" value="0"></el-option>
<el-option label="已完结" value="1"></el-option>
</el-select>
<el-button type="primary" @click="getTableData">查询</el-button>
<el-button @click="resetHandle">重置</el-button>
@@ -37,7 +38,7 @@
</el-table-column>
<el-table-column label="上笔进货日期" prop="lastTransactAt">
<template v-slot="scope">
{{ dayjs(scope.row.lastTransactAt).format('YYYY-MM-DD HH:mm:ss') }}
{{ scope.row.lastTransactAt && dayjs(scope.row.lastTransactAt).format('YYYY-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
<el-table-column label="操作" width="80">
@@ -50,13 +51,14 @@
</el-table>
</div>
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
@current-change="paginationChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
@current-change="paginationChange" @size-change="pagesizeChange"
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
</div>
</template>
<script>
import dayjs from 'dayjs'
import { tbShopPurveyorTransactGet, dictDetail } from '@/api/invoicing'
import { tbShopPurveyorTransactGet } from '@/api/invoicing'
export default {
data() {
return {
@@ -77,7 +79,6 @@ export default {
}
},
mounted() {
this.dictDetail()
this.getTableData()
},
methods: {
@@ -112,13 +113,9 @@ export default {
this.tableData.page = e - 1
this.getTableData()
},
async dictDetail() {
const { content } = await dictDetail({
dictName: 'purveyor_transact_status',
size: 100,
page: 0
})
this.types = content
pagesizeChange(e) {
this.tableData.size = e
this.getTableData()
}
}
}

View File

@@ -2,8 +2,8 @@
<div class="app-container">
<div class="head-container">
<div class="filter_wrap">
<el-input v-model="query.name" size="small" clearable placeholder="供应商" @keyup.enter.native="getTableData"
style="width: 200px;" />
<el-input v-model="query.name" size="small" clearable placeholder="供应商"
@keyup.enter.native="getTableData" style="width: 200px;" />
<el-button type="primary" @click="getTableData">查询</el-button>
<el-button @click="resetHandle">重置</el-button>
</div>
@@ -32,7 +32,8 @@
</el-table>
</div>
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
@current-change="paginationChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
@current-change="paginationChange" @size-change="pagesizeChange"
layout="total, sizes, prev, pager, next, jumper"></el-pagination>
<addSupplier ref="addSupplier" @success="getTableData" />
</div>
</template>
@@ -100,6 +101,10 @@ export default {
this.tableData.page = 0;
this.getTableData()
},
pagesizeChange(e) {
this.tableData.size = e
this.getTableData()
},
// 分页回调
paginationChange(e) {
this.tableData.page = e - 1