Commit 78306451 by 李伟康

commit 修复BUG

1 parent 3beeba04
...@@ -46,7 +46,6 @@ ...@@ -46,7 +46,6 @@
ref="qualityTable" ref="qualityTable"
:searchForm="searchFormSearch" :searchForm="searchFormSearch"
:tableParams="tableParams" :tableParams="tableParams"
:beforeSearchFn="beforeSearchFn"
:pageConf="pageConf" :pageConf="pageConf"
:noDataImg="url" :noDataImg="url"
:border="true" :border="true"
...@@ -54,7 +53,7 @@ ...@@ -54,7 +53,7 @@
:span-method="arraySpanMethod" :span-method="arraySpanMethod"
:tableData="tableList" :tableData="tableList"
:tableTotal="tableTotal" :tableTotal="tableTotal"
@refreshTable="jumpPage" @refreshTable="refreshTable"
> >
<div <div
slot="store" slot="store"
...@@ -171,7 +170,7 @@ export default { ...@@ -171,7 +170,7 @@ export default {
url: url, url: url,
tableList: [], tableList: [],
tableTotal: 0, tableTotal: 0,
page: { pageConfig: {
pageSize: 10, pageSize: 10,
pageNum: 1 pageNum: 1
}, },
...@@ -405,22 +404,13 @@ export default { ...@@ -405,22 +404,13 @@ export default {
} }
}, },
created () { created () {
this.getList() this.refreshTable()
}, },
mounted () { mounted () {
this.getServiceStore() this.getServiceStore()
}, },
methods: { methods: {
async getList () {
await this.beforeSearchFn()
const { total, list } = await this.$apis.quality.getReclistWithPage({
...this.page,
...this.searchFormSearch
})
this.restructureData(list)
this.tableTotal = total
},
getServiceStore () { getServiceStore () {
this.$apis.quality this.$apis.quality
.listShop4sByRef({ .listShop4sByRef({
...@@ -517,25 +507,36 @@ export default { ...@@ -517,25 +507,36 @@ export default {
if (this.searchForm.phoneNumber && this.searchForm.phoneNumber.length < 4) { if (this.searchForm.phoneNumber && this.searchForm.phoneNumber.length < 4) {
return return
} }
this.getList() this.refreshTable()
}, },
handleReset () { handleReset () {
this.searchForm = this.$options.data.call(this).searchForm this.searchForm = this.$options.data.call(this).searchForm
this.getList() this.refreshTable()
}, },
jumpPage (page) { async refreshTable (pageCon) {
this.page = page if (pageCon) this.pageConfig = pageCon
this.getList() else this.pageConfig = {
pageSize: 10,
pageNum: 1,
}
await this.beforeSearchFn()
const { total, list } = await this.$apis.quality.getReclistWithPage({
...this.pageConfig,
...this.searchFormSearch
})
this.$refs.qualityTable.page = this.pageConfig
this.restructureData(list)
this.tableTotal = total
}, },
restructureData (data) { restructureData (data) {
this.tableList = [] this.tableList = []
let dataList = this.setTableFinishFun(data), let dataList = this.setTableFinishFun(data),
{ page } = this { pageConfig } = this
if (dataList && dataList.length > 0) { if (dataList && dataList.length > 0) {
dataList = dataList.map((item, index) => { dataList = dataList.map((item, index) => {
if (item.batchNum != null) item.batchNum = String(item.batchNum) if (item.batchNum != null) item.batchNum = String(item.batchNum)
if (item.enterReceptionBatch != null) item.enterReceptionBatch = String(item.enterReceptionBatch) if (item.enterReceptionBatch != null) item.enterReceptionBatch = String(item.enterReceptionBatch)
item.num = (index + 1) + (page.pageSize * (page.pageNum - 1)) item.num = (index + 1) + (pageConfig.pageSize * (pageConfig.pageNum - 1))
return item return item
}) })
this.tableList = dataList.reduce((prev, cur, index, arr) => { this.tableList = dataList.reduce((prev, cur, index, arr) => {
......
...@@ -384,6 +384,9 @@ export default { ...@@ -384,6 +384,9 @@ export default {
margin-bottom: 8px; margin-bottom: 8px;
} }
} }
/deep/.el-table tbody tr:last-child td{
border-bottom: 1px solid #ebeef5;
}
} }
.theader { .theader {
width: 100%; width: 100%;
......
...@@ -141,7 +141,10 @@ export default { ...@@ -141,7 +141,10 @@ export default {
mounted () { mounted () {
const { key } = this.$route.query const { key } = this.$route.query
if (key) { if (key) {
const quality_detail_object = JSON.parse(sessionStorage.getItem(key) || {}) const quality_detail_object = JSON.parse(sessionStorage.getItem(key) || '{}')
if (!quality_detail_object?.list) return this.$router.push({
path: '/qualityManage/index'
})
this.currentNum = quality_detail_object.currentNum || 0 this.currentNum = quality_detail_object.currentNum || 0
this.qualityDetailList = quality_detail_object.list || [] this.qualityDetailList = quality_detail_object.list || []
} else this.$router.go(-1) } else this.$router.go(-1)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!