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

138 lines
3.2 KiB

3 years ago
<template>
3 years ago
<div>
3 years ago
<div>
<div ref="lxHeader">
3 years ago
<lx-header icon="md-apps" style="margin-bottom: 10px; border: 0px; margin-top: 15px" text="产品管理">
3 years ago
<div slot="content"></div>
<slot>
<div>
3 years ago
<Input placeholder="关键字搜索" style="width: 200px; margin-right: 10px"/>
<Button style="margin-left: 10px" type="primary">查询</Button>
<Button style="margin-left: 10px" type="primary"
@click="$refs['addProduct'].type = 'add',$refs['addProduct'].isShow = true">新建产品
</Button>
3 years ago
</div>
</slot>
</lx-header>
</div>
</div>
3 years ago
<xy-table
:total="total"
:list="list"
:table-item="table"
@delete="destroy"
@editor="editor"
@pageSizeChange="e => select.page_size = e"
@pageIndexChange="e => {select.page = e;getList()}"></xy-table>
3 years ago
3 years ago
<add-product ref="addProduct" :product-sku="productSku" :product-type="productType"></add-product>
3 years ago
</div>
</template>
<script>
3 years ago
import {getList,destroy} from '@/api/product'
3 years ago
import {getparameter} from '@/api/system/dictionary'
import {getList as getTypes} from '@/api/productType'
3 years ago
import {getList as getSku} from '@/api/sku'
3 years ago
import addProduct from "@/views/product/productComponent/addProduct";
3 years ago
export default {
3 years ago
components: {
addProduct
3 years ago
},
3 years ago
data() {
3 years ago
return {
3 years ago
select:{
page:1,
page_size:10
},
3 years ago
productType: [],
productSku: [],
3 years ago
total:0,
3 years ago
list: [],
3 years ago
table: [
{
prop:'name',
label:'名称',
width:200,
fixed:'left',
align:'left'
},
{
prop:'product_type.name',
label:'业务板块',
width: 160
},
{
prop:'cycle',
label:'服务周期',
width: 160
},
{
prop:'purchase_price',
label:'采购单价',
align:'right',
width: 200
},
{
prop:'nurse_price',
label:'护工服务单价',
align:'right',
width:200
},
{
prop:'time_lenth',
label:'单次时长',
width: 160
},
{
prop:'',
label:'服务菜单明细',
minWidth:220
}
]
3 years ago
}
3 years ago
},
3 years ago
methods: {
async getList() {
3 years ago
const res = await getList(this.select)
this.list = res.data
this.total = res.total
console.log(this.list)
3 years ago
},
async getProductType() {
3 years ago
const res = await getTypes({page_size: 999},false)
3 years ago
this.productType = res.data
},
async getProductSku() {
3 years ago
const res = await getSku({page:1,page_size:999},false)
this.productSku = res.data
3 years ago
},
editor(row){
this.$refs['addProduct'].type = 'editor'
this.$refs['addProduct'].id = row.id
this.$refs['addProduct'].isShow = true
},
destroy(row){
destroy(row.id).then(res => {
this.$successMessage('destroy','订单')
this.getList()
})
3 years ago
}
},
mounted() {
this.getList()
this.getProductType()
this.getProductSku()
}
3 years ago
}
</script>
3 years ago
<style lang="scss" scoped>
3 years ago
</style>