|
@@ -10,7 +10,7 @@
|
|
|
<a-form :form="form" ref="form" @submit="handleSubmit">
|
|
|
<a-row class="search-cont">
|
|
|
<a-col span="8">
|
|
|
- <a-input id="goodsChooseModal-name" allowClear v-model.trim="queryParam.name" placeholder="商品名称"/>
|
|
|
+ <a-input id="goodsChooseModal-name" allowClear v-model.trim="queryParam.name" placeholder="商品名称" />
|
|
|
</a-col>
|
|
|
<a-col style="margin-left: 20px;" span="3">
|
|
|
<a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
|
|
@@ -26,8 +26,7 @@
|
|
|
:columns="columns"
|
|
|
:scroll="{y:500}"
|
|
|
:data="loadData"
|
|
|
- :bordered="false"
|
|
|
- >
|
|
|
+ :bordered="false">
|
|
|
<!-- 操作 -->
|
|
|
<template slot="action" slot-scope="text, record, index">
|
|
|
<a id="goodsChooseModal-choose" @click="handleSubmit">选择</a>
|
|
@@ -39,7 +38,9 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { STable } from '@/components'
|
|
|
+import {
|
|
|
+ STable
|
|
|
+} from '@/components'
|
|
|
export default {
|
|
|
name: 'SetPriceModal',
|
|
|
components: {
|
|
@@ -50,6 +51,11 @@ export default {
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
},
|
|
|
+ // 已选商品
|
|
|
+ chooseData: {
|
|
|
+ type: Array,
|
|
|
+ default: []
|
|
|
+ },
|
|
|
// 设置项id
|
|
|
itemId: {
|
|
|
type: [String, Number],
|
|
@@ -68,8 +74,7 @@ export default {
|
|
|
isshow (newValue, oldValue) {
|
|
|
if (newValue) {
|
|
|
if (this.itemId) {
|
|
|
- this.dataSource = []
|
|
|
- this.getDetail(this.itemId)
|
|
|
+ this.$refs.table.refresh(true)
|
|
|
}
|
|
|
} else {
|
|
|
this.cancel()
|
|
@@ -82,82 +87,83 @@ export default {
|
|
|
form: this.$form.createForm(this, {
|
|
|
name: 'GoodsChooseModal'
|
|
|
}),
|
|
|
- // 查询参数
|
|
|
+ // 查询参数
|
|
|
queryParam: {
|
|
|
name: ''
|
|
|
- },
|
|
|
+ },
|
|
|
// 表头
|
|
|
- columns: [
|
|
|
- {
|
|
|
- title: '序号',
|
|
|
- dataIndex: 'no',
|
|
|
- width: 60,
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- title: '商品名称',
|
|
|
- width: 200,
|
|
|
- align: 'center',
|
|
|
- customRender: (record) => {
|
|
|
- return record.bundleItem.itemClsName
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '商品价格(乐豆)',
|
|
|
- width: 150,
|
|
|
- align: 'center',
|
|
|
- customRender: (record) => {
|
|
|
- return record.bundleItem.itemName
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '供货商',
|
|
|
- width: 200,
|
|
|
- align: 'center',
|
|
|
- customRender: (record) => {
|
|
|
- return record.bundleItem.itemPrice
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '库存数量',
|
|
|
- width: 100,
|
|
|
- align: 'center',
|
|
|
- customRender: (record) => {
|
|
|
- return record.bundleItem.times
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '已售数量',
|
|
|
- dataIndex: 'times',
|
|
|
- width: 100,
|
|
|
- align: 'center'
|
|
|
- },
|
|
|
- {
|
|
|
- title: '操作',
|
|
|
- width: 150,
|
|
|
- align: 'center',
|
|
|
- scopedSlots: { customRender: 'action' }
|
|
|
+ columns: [{
|
|
|
+ title: '序号',
|
|
|
+ dataIndex: 'no',
|
|
|
+ width: 60,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '商品名称',
|
|
|
+ width: 200,
|
|
|
+ align: 'center',
|
|
|
+ customRender: (record) => {
|
|
|
+ return record.bundleItem.itemClsName
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '商品价格(乐豆)',
|
|
|
+ width: 150,
|
|
|
+ align: 'center',
|
|
|
+ customRender: (record) => {
|
|
|
+ return record.bundleItem.itemName
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '供货商',
|
|
|
+ width: 200,
|
|
|
+ align: 'center',
|
|
|
+ customRender: (record) => {
|
|
|
+ return record.bundleItem.itemPrice
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '库存数量',
|
|
|
+ width: 100,
|
|
|
+ align: 'center',
|
|
|
+ customRender: (record) => {
|
|
|
+ return record.bundleItem.times
|
|
|
}
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '已售数量',
|
|
|
+ dataIndex: 'times',
|
|
|
+ width: 100,
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '操作',
|
|
|
+ width: 150,
|
|
|
+ align: 'center',
|
|
|
+ scopedSlots: {
|
|
|
+ customRender: 'action'
|
|
|
+ }
|
|
|
+ }
|
|
|
],
|
|
|
- // 加载数据方法 必须为 Promise 对象
|
|
|
- loadData: parameter => {
|
|
|
- // const _this = this
|
|
|
- // return getPartnerList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
- // if (res.status == 200) {
|
|
|
- // const data = res.data
|
|
|
- // const no = (data.pageNo - 1) * data.pageSize
|
|
|
- // for (var i = 0; i < data.list.length; i++) {
|
|
|
- // data.list[i].no = no + i + 1
|
|
|
- // data.list[i].status = data.list[i].status == 1
|
|
|
- // }
|
|
|
- // // console.log(data)
|
|
|
- // return data
|
|
|
- // } else {
|
|
|
- // _this.$message.error('获取数据出错')
|
|
|
- // return []
|
|
|
- // }
|
|
|
- // })
|
|
|
- }
|
|
|
+ // 加载数据方法 必须为 Promise 对象
|
|
|
+ loadData: parameter => {
|
|
|
+ // const _this = this
|
|
|
+ // return getPartnerList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
+ // if (res.status == 200) {
|
|
|
+ // const data = res.data
|
|
|
+ // const no = (data.pageNo - 1) * data.pageSize
|
|
|
+ // for (var i = 0; i < data.list.length; i++) {
|
|
|
+ // data.list[i].no = no + i + 1
|
|
|
+ // data.list[i].status = data.list[i].status == 1
|
|
|
+ // }
|
|
|
+ // // console.log(data)
|
|
|
+ // return data
|
|
|
+ // } else {
|
|
|
+ // _this.$message.error('获取数据出错')
|
|
|
+ // return []
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -198,7 +204,7 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style scoped="true">
|
|
|
- .search-cont{
|
|
|
- margin-bottom: 20px;
|
|
|
- }
|
|
|
+ .search-cont {
|
|
|
+ margin-bottom: 20px;
|
|
|
+ }
|
|
|
</style>
|