<template>
|
<div class="rightContent">
|
<div class="top">
|
<SearchCommonView
|
:add-title="'新建'"
|
:placeholder="'请输入单号'"
|
:amount-view="false"
|
@addCommonClick="addBtnClick"
|
@searchClick="getList"
|
/>
|
</div>
|
<div class="list-view">
|
<div class="table">
|
<TableCommonView
|
ref="tableListRef"
|
:table-list="tableList"
|
:show-checkcol="false"
|
@tableRowClick="tableRowClick"
|
></TableCommonView>
|
</div>
|
<div class="btn-pager">
|
<PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
|
</div>
|
</div>
|
<!-- 新建/编辑 -->
|
<AddProductCategoryDialog v-if="editConfig.visible" :edit-common-config="editConfig" />
|
</div>
|
</template>
|
|
<script>
|
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
|
import { getProductList } from "@/api/product/product"
|
// import DetailProduct from "@/views/productManage/product/DetailProduct"
|
import AddProductCategoryDialog from "@/views/productManage/productCategory/AddProductCategoryDialog"
|
|
export default {
|
name: "ProductCategory",
|
props: {},
|
components: { AddProductCategoryDialog },
|
mixins: [pageMixin],
|
computed: {},
|
data() {
|
return {
|
tableList: {},
|
searchOptions: [],
|
editConfig: {
|
visible: false,
|
title: "新建",
|
infomation: {}
|
}
|
}
|
},
|
created() {
|
this.setTable()
|
this.getData()
|
},
|
methods: {
|
setTable() {
|
this.tableList = {
|
tableInfomation: [],
|
selectBox: true,
|
tableColumn: [
|
{
|
label: "产品类型",
|
prop: "id",
|
isShowColumn: true,
|
default: true
|
}
|
]
|
}
|
},
|
// 请求数据
|
async getData(val, content) {
|
await getProductList({
|
[val]: content,
|
page: this.pagerOptions.currPage,
|
pageSize: this.pagerOptions.pageSize
|
}).then((res) => {
|
if (res.data.code === 200) {
|
const list = res.data.data.list.map((item) => {
|
return {
|
...item,
|
supplierNumber: item.supplier.number,
|
status: "就绪",
|
preTime: "2023-09-04 11:20:00"
|
}
|
})
|
this.tableList.tableInfomation = list || []
|
this.pagerOptions.totalCount = res.data.data.total
|
}
|
})
|
},
|
// 搜索
|
getList(val) {
|
console.log(val)
|
},
|
// 行点击
|
tableRowClick(row) {
|
console.log(row)
|
this.editConfig.visible = true
|
this.editConfig.title = "编辑"
|
this.editConfig.infomation = { ...row }
|
},
|
// 新建
|
addBtnClick() {
|
this.editConfig.visible = true
|
this.editConfig.title = "新建"
|
}
|
}
|
}
|
</script>
|
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
<style lang="scss" scoped>
|
// .rightContent {
|
// height: 100%;
|
// background: #e6ecf2;
|
// padding: 10px;
|
// .top {
|
// margin-bottom: 20px;
|
// height: 60px;
|
// background: #fff;
|
// border-radius: 8px;
|
// }
|
// .list-view {
|
// height: calc(100% - 120px);
|
// }
|
// }
|
</style>
|