|
@@ -0,0 +1,74 @@
|
|
|
|
+<template>
|
|
|
|
+ <avue-crud ref="crud" :page="page" :data="dataList" :table-loading="dataListLoading" :option="tableOption">
|
|
|
|
+ <template slot-scope="scope" slot="kind">
|
|
|
|
+ <el-tag v-if="scope.row.kind" size="small" :type="scope.row.kind === '自营' ? 'primary' : 'success'">
|
|
|
|
+ {{ scope.row.kind }}
|
|
|
|
+ </el-tag>
|
|
|
|
+ </template>
|
|
|
|
+
|
|
|
|
+ <template slot-scope="{row,index}" slot="menu">
|
|
|
|
+ <el-button type="primary" icon="el-icon-edit" size="small"
|
|
|
|
+ @click="$router.push({ name: 'prodInfo', params: { id: row.id.toString() } })">修改</el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </avue-crud>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script lang="ts">
|
|
|
|
+import Vue from 'vue'
|
|
|
|
+import { tableOption } from '@/avue/crud/prodList.js'
|
|
|
|
+import httpx from '@/utils/httpx'
|
|
|
|
+import { IPage } from '@/utils/vo'
|
|
|
|
+import { isInteger } from 'lodash'
|
|
|
|
+
|
|
|
|
+export default Vue.extend({
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ dataForm: {
|
|
|
|
+ prodName: ''
|
|
|
|
+ },
|
|
|
|
+ dataList: [],
|
|
|
|
+ page: {
|
|
|
|
+ total: 0, // 总页数
|
|
|
|
+ currentPage: 1, // 当前页数
|
|
|
|
+ pageSize: 10 // 每页显示多少条
|
|
|
|
+ },
|
|
|
|
+ dataListSelections: [],
|
|
|
|
+ dataListLoading: false,
|
|
|
|
+ tableOption: tableOption,
|
|
|
|
+ resourcesUrl: process.env.VUE_APP_RESOURCES_URL,
|
|
|
|
+ id: 0,
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ mounted() {
|
|
|
|
+ const id_str = this.$route.params.id
|
|
|
|
+ const id = parseInt(id_str)
|
|
|
|
+ if (isNaN(id) || !isInteger(id)) {
|
|
|
|
+ //@ts-ignore
|
|
|
|
+ this.$shortcut.notFound()
|
|
|
|
+ } else {
|
|
|
|
+ this.id = id
|
|
|
|
+ this.getDataList()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ methods: {
|
|
|
|
+ // 获取数据列表
|
|
|
|
+ getDataList(page?: IPage, params?: null, done?: Function) {
|
|
|
|
+ this.dataListLoading = true
|
|
|
|
+ httpx.post(httpx.makeurl('/rooms/roomGoods'), {
|
|
|
|
+ id: this.id,
|
|
|
|
+ limit: page == null ? this.page.pageSize : page.pageSize,
|
|
|
|
+ page: page == null ? this.page.currentPage : page.currentPage,
|
|
|
|
+ }).then(({ data }) => {
|
|
|
|
+ this.dataList = data.goodsEntityList
|
|
|
|
+ this.page.total = data.total
|
|
|
|
+ this.dataListLoading = false
|
|
|
|
+ if (done) {
|
|
|
|
+ done()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ }
|
|
|
|
+})
|
|
|
|
+</script>
|