|
@@ -1,149 +1,208 @@
|
|
<template>
|
|
<template>
|
|
<a-card :bordered="false" class="setmealAttr-wrap">
|
|
<a-card :bordered="false" class="setmealAttr-wrap">
|
|
|
|
+ <v-select v-show="false" code="BELONG_COMPANY" ref="belongCompany" ></v-select>
|
|
<!-- 搜索条件 -->
|
|
<!-- 搜索条件 -->
|
|
<div class="setmealAttr-searchForm">
|
|
<div class="setmealAttr-searchForm">
|
|
- <a-form ref="searchForm" @keyup.enter.native="$refs.table.refresh(true)">
|
|
|
|
|
|
+ <a-form ref="searchForm" @keyup.enter.native="searchFun">
|
|
<a-row :gutter="48">
|
|
<a-row :gutter="48">
|
|
<a-col :span="6">
|
|
<a-col :span="6">
|
|
- <a-form-item label="合作商" :label-col="{ span: 7 }" :wrapper-col="{ span: 17 }">
|
|
|
|
|
|
+ <a-form-item label="合作商" required :label-col="{ span: 7 }" :wrapper-col="{ span: 17 }">
|
|
<a-select
|
|
<a-select
|
|
id="setmealAttr-partner"
|
|
id="setmealAttr-partner"
|
|
allowClear
|
|
allowClear
|
|
show-search
|
|
show-search
|
|
option-filter-prop="children"
|
|
option-filter-prop="children"
|
|
placeholder="请选择合作商"
|
|
placeholder="请选择合作商"
|
|
- v-model="searchForm.partner"
|
|
|
|
- @change="pageInit">
|
|
|
|
- <a-select-option v-for="(item, index) in partnerList" :key="index" :value="item.value">{{ item.name }}</a-select-option>
|
|
|
|
|
|
+ v-model="searchForm.salesChannelNo">
|
|
|
|
+ <a-select-option v-for="(item, index) in partnerList" :key="index" :value="item.salesChannelNo">{{ item.salesChannelName }}</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="6">
|
|
<a-col :span="6">
|
|
<a-form-item label="套餐名称" :label-col="{ span: 7 }" :wrapper-col="{ span: 17 }">
|
|
<a-form-item label="套餐名称" :label-col="{ span: 7 }" :wrapper-col="{ span: 17 }">
|
|
- <a-input v-model.trim="searchForm.bundleName" id="setmealAttr-bundleName" placeholder="请输入套餐名称" allowClear />
|
|
|
|
|
|
+ <a-input v-model.trim="searchForm.bundle.name" id="setmealAttr-bundleName" placeholder="请输入套餐名称" allowClear />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</a-col>
|
|
</a-col>
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
- <a-button class="handle-btn serach-btn" id="setmealAttr-serach" type="primary" @click="$refs.table.refresh(true)">查询</a-button>
|
|
|
|
|
|
+ <a-button class="handle-btn serach-btn" id="setmealAttr-serach" type="primary" @click="searchFun">查询</a-button>
|
|
<a-button class="handle-btn" type="" id="setmealAttr-reset" @click="handleReset">重置</a-button>
|
|
<a-button class="handle-btn" type="" id="setmealAttr-reset" @click="handleReset">重置</a-button>
|
|
</a-col>
|
|
</a-col>
|
|
</a-row>
|
|
</a-row>
|
|
</a-form>
|
|
</a-form>
|
|
</div>
|
|
</div>
|
|
<!-- 未选择合作商 -->
|
|
<!-- 未选择合作商 -->
|
|
- <div class="unChoose" v-if="!searchForm.partner">
|
|
|
|
|
|
+ <div class="unChoose" v-if="!isSearch">
|
|
<a-icon type="exclamation-circle" theme="filled" :style="{ fontSize: '18px', color: '#ff9900', verticalAlign: 'sub', marginRight: '5px' }" />
|
|
<a-icon type="exclamation-circle" theme="filled" :style="{ fontSize: '18px', color: '#ff9900', verticalAlign: 'sub', marginRight: '5px' }" />
|
|
<span>请先选择合作商</span>
|
|
<span>请先选择合作商</span>
|
|
</div>
|
|
</div>
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
<a-table
|
|
<a-table
|
|
- v-if="searchForm.partner"
|
|
|
|
|
|
+ v-if="isSearch"
|
|
class="table"
|
|
class="table"
|
|
ref="table"
|
|
ref="table"
|
|
size="default"
|
|
size="default"
|
|
:rowKey="record => record.id"
|
|
:rowKey="record => record.id"
|
|
:columns="columns"
|
|
:columns="columns"
|
|
:dataSource="loadData"
|
|
:dataSource="loadData"
|
|
|
|
+ :pagination="paginationProps"
|
|
bordered>
|
|
bordered>
|
|
- <!-- 客户信息 -->
|
|
|
|
- <p slot="custInfo" slot-scope="text, record">
|
|
|
|
- <span v-if="record.custMobile">{{ record.custMobile }}</span>
|
|
|
|
|
|
+ <!-- 所属地区 -->
|
|
|
|
+ <p slot="areas" slot-scope="text, record">
|
|
|
|
+ <span v-if="record.addrProvinceName">{{ record.addrProvinceName }}{{ record.addrCityName }}{{ record.addrDistrictName }}</span>
|
|
|
|
+ <span v-else>--</span>
|
|
|
|
+ </p>
|
|
|
|
+ <!-- 分公司名称 -->
|
|
|
|
+ <p slot="belongCompany" slot-scope="text, record">
|
|
|
|
+ <span v-if="record.belongCompany">{{ $refs.belongCompany.getNameByCode(record.belongCompany) }}</span>
|
|
<span v-else>--</span>
|
|
<span v-else>--</span>
|
|
</p>
|
|
</p>
|
|
<!-- 操作 -->
|
|
<!-- 操作 -->
|
|
<span slot="action" slot-scope="text, record"><a-button type="primary" id="setmealAttr-set" @click="setAttr(record)">设置套餐属性</a-button></span>
|
|
<span slot="action" slot-scope="text, record"><a-button type="primary" id="setmealAttr-set" @click="setAttr(record)">设置套餐属性</a-button></span>
|
|
</a-table>
|
|
</a-table>
|
|
<!-- 设置套餐属性 -->
|
|
<!-- 设置套餐属性 -->
|
|
- <attr-modal :openModal="openModal" :setmealId="setmealId" @close="openModal=false" />
|
|
|
|
|
|
+ <attr-modal :openModal="openModal" :setmealId="setmealId" :setmealData="setmealData" @close="closeModal" />
|
|
</a-card>
|
|
</a-card>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { STable } from '@/components'
|
|
|
|
|
|
+import { STable, VSelect } from '@/components'
|
|
import AttrModal from './attrModal.vue'
|
|
import AttrModal from './attrModal.vue'
|
|
|
|
+import { mapGetters } from 'vuex'
|
|
|
|
+import { salesChannelList } from '@/api/FinancialManagement'
|
|
|
|
+import { salesChannelGoodsList } from '@/api/SetmealSales'
|
|
export default {
|
|
export default {
|
|
- components: { STable, AttrModal },
|
|
|
|
|
|
+ components: { STable, VSelect, AttrModal },
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
// 查询参数
|
|
// 查询参数
|
|
searchForm: {
|
|
searchForm: {
|
|
- bundleName: '', // 套餐名称
|
|
|
|
- partner: undefined // 合作商
|
|
|
|
|
|
+ bundle: { name: '' }, // 套餐名称
|
|
|
|
+ salesChannelNo: undefined // 合作商
|
|
},
|
|
},
|
|
- partnerList: [{ value: 1, name: '合作商1' }, { value: 2, name: '合作商2' }, { value: 3, name: '合作商3' }, { value: 4, name: '合作商4' }], // 合作商 下拉数据
|
|
|
|
|
|
+ partnerList: [], // 合作商 下拉数据
|
|
columns: [
|
|
columns: [
|
|
{ title: '序号', dataIndex: 'no', width: 60, align: 'center' },
|
|
{ title: '序号', dataIndex: 'no', width: 60, align: 'center' },
|
|
- { title: '合作商名称', dataIndex: 'partner', width: 100, align: 'center' },
|
|
|
|
- { title: '套餐名称', dataIndex: 'bundleName', width: 100, align: 'center' },
|
|
|
|
- { title: '套餐别名', dataIndex: 'bundleNames', width: 100, align: 'center' },
|
|
|
|
- { title: '所属地区', dataIndex: 'number', width: 100, align: 'center' },
|
|
|
|
- { title: '所属项目名称', dataIndex: 'orderDate', width: 100, align: 'center' },
|
|
|
|
- { title: '分公司名称', dataIndex: 'payedAmount', width: 100, align: 'center' },
|
|
|
|
- { title: '折扣比例', dataIndex: 'payedAmounts', width: 80, align: 'center' },
|
|
|
|
|
|
+ { title: '合作商名称', dataIndex: 'salesChannelName', width: 100, align: 'center' },
|
|
|
|
+ { title: '套餐名称', dataIndex: 'bundle.name', width: 100, align: 'center' },
|
|
|
|
+ { title: '套餐别名', width: 100, align: 'center', customRender: (record, text) => { return record ? (record.goodsAlias ? record.goodsAlias : '--') : '--' } },
|
|
|
|
+ { title: '所属地区', scopedSlots: { customRender: 'areas' }, width: 100, align: 'center' },
|
|
|
|
+ { title: '所属项目名称', width: 100, align: 'center', customRender: (record, text) => { return record ? (record.belongProject ? record.belongProject : '--') : '--' } },
|
|
|
|
+ { title: '分公司名称', scopedSlots: { customRender: 'belongCompany' }, width: 100, align: 'center' },
|
|
|
|
+ { title: '折扣比例', width: 80, align: 'center', customRender: (record, text) => { return record ? (record.useDiscountRate ? record.useDiscountRate + '%' : '--') : '--' } },
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center' }
|
|
{ title: '操作', scopedSlots: { customRender: 'action' }, width: 100, align: 'center' }
|
|
],
|
|
],
|
|
loadData: [], // 表格数据
|
|
loadData: [], // 表格数据
|
|
setmealId: '', // 套餐id
|
|
setmealId: '', // 套餐id
|
|
- openModal: false // 设置套餐属性弹框
|
|
|
|
|
|
+ openModal: false, // 设置套餐属性弹框
|
|
|
|
+ pageNo: 1, // 分页页码
|
|
|
|
+ pageSize: 10, // 分页 每页多少条
|
|
|
|
+ paginationProps: {
|
|
|
|
+ showSizeChanger: true, // 是否可以改变 pageSize
|
|
|
|
+ total: 0, // 分页总条数
|
|
|
|
+ onShowSizeChange: (current, pageSize) => this.changePageSize(current, pageSize),
|
|
|
|
+ onChange: (current) => this.changePage(current)
|
|
|
|
+ },
|
|
|
|
+ setmealData: null, // 套餐属性数据
|
|
|
|
+ isSearch: false // 是否点击查询
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ computed: {
|
|
|
|
+ ...mapGetters(['authUserInfo'])
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
|
|
+ searchFun () {
|
|
|
|
+ this.isSearch = !!this.searchForm.salesChannelNo
|
|
|
|
+ this.pageInit(1)
|
|
|
|
+ },
|
|
// 页面初始化
|
|
// 页面初始化
|
|
- pageInit () {
|
|
|
|
- if (this.searchForm.partner) {
|
|
|
|
|
|
+ pageInit (pageNo, pageSize) {
|
|
|
|
+ if (this.searchForm.salesChannelNo) {
|
|
|
|
+ this.pageNo = pageNo || this.pageNo
|
|
|
|
+ this.pageSize = pageSize || this.pageSize
|
|
// 请求列表数据
|
|
// 请求列表数据
|
|
- this.loadData = [
|
|
|
|
- {
|
|
|
|
- id: 1,
|
|
|
|
- no: 1,
|
|
|
|
- partner: '合作商1',
|
|
|
|
- bundleName: '车内精致洗护套餐',
|
|
|
|
- bundleNames: '洗护套餐',
|
|
|
|
- number: '陕西省西安市',
|
|
|
|
- orderDate: '项目名称11',
|
|
|
|
- payedAmount: '上海有限公司',
|
|
|
|
- payedAmounts: '45%'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: 2,
|
|
|
|
- no: 2,
|
|
|
|
- partner: '合作商2',
|
|
|
|
- bundleName: '车内精致洗护套餐',
|
|
|
|
- bundleNames: '洗护套餐',
|
|
|
|
- number: '海南市',
|
|
|
|
- orderDate: '项目名称22',
|
|
|
|
- payedAmount: '海南有限公司',
|
|
|
|
- payedAmounts: '5%'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- id: 3,
|
|
|
|
- no: 3,
|
|
|
|
- partner: '合作商3',
|
|
|
|
- bundleName: '车内精致洗护套餐',
|
|
|
|
- bundleNames: '洗护套餐',
|
|
|
|
- number: '省天津市',
|
|
|
|
- orderDate: '项目名称33',
|
|
|
|
- payedAmount: '天津有限公司',
|
|
|
|
- payedAmounts: '80%'
|
|
|
|
|
|
+ salesChannelGoodsList({
|
|
|
|
+ salesChannelNo: this.searchForm.salesChannelNo,
|
|
|
|
+ bundle: { name: this.searchForm.bundle.name },
|
|
|
|
+ pageNo: this.pageNo,
|
|
|
|
+ pageSize: this.pageSize
|
|
|
|
+ }).then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ const data = res.data
|
|
|
|
+ if (res.data.count > 10) {
|
|
|
|
+ this.paginationProps = {
|
|
|
|
+ showSizeChanger: true, // 是否可以改变 pageSize
|
|
|
|
+ total: 0, // 分页总条数
|
|
|
|
+ onShowSizeChange: (current, pageSize) => this.changePageSize(current, pageSize),
|
|
|
|
+ onChange: (current) => this.changePage(current)
|
|
|
|
+ }
|
|
|
|
+ this.paginationProps.total = res.data.count || 0
|
|
|
|
+ } else {
|
|
|
|
+ this.paginationProps = false
|
|
|
|
+ }
|
|
|
|
+ const no = (data.pageNo - 1) * data.pageSize
|
|
|
|
+ for (var i = 0; i < data.list.length; i++) {
|
|
|
|
+ data.list[i].no = no + i + 1
|
|
|
|
+ }
|
|
|
|
+ this.loadData = data.list
|
|
|
|
+ } else {
|
|
|
|
+ this.loadData = []
|
|
}
|
|
}
|
|
- ]
|
|
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ this.isSearch = false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ // 分页 一页多少条change
|
|
|
|
+ changePageSize (current, pageSize) {
|
|
|
|
+ this.pageNo = current
|
|
|
|
+ this.pageSize = pageSize
|
|
|
|
+ this.pageInit()
|
|
|
|
+ },
|
|
|
|
+ // 分页 页码change
|
|
|
|
+ changePage (current) {
|
|
|
|
+ this.pageNo = current
|
|
|
|
+ this.pageInit()
|
|
|
|
+ },
|
|
// 设置套餐属性
|
|
// 设置套餐属性
|
|
setAttr (row) {
|
|
setAttr (row) {
|
|
this.setmealId = row.id
|
|
this.setmealId = row.id
|
|
|
|
+ this.setmealData = row
|
|
this.openModal = true
|
|
this.openModal = true
|
|
},
|
|
},
|
|
// 重置
|
|
// 重置
|
|
handleReset () {
|
|
handleReset () {
|
|
- this.searchForm.bundleName = ''
|
|
|
|
- this.searchForm.partner = undefined
|
|
|
|
- this.$refs.table.refresh(true)
|
|
|
|
|
|
+ this.searchForm.bundle.name = ''
|
|
|
|
+ this.searchForm.salesChannelNo = undefined
|
|
|
|
+ this.isSearch = false
|
|
|
|
+ this.pageInit(1)
|
|
|
|
+ },
|
|
|
|
+ // 关闭
|
|
|
|
+ closeModal () {
|
|
|
|
+ this.openModal = false
|
|
|
|
+ this.setmealData = null
|
|
|
|
+ this.pageInit()
|
|
|
|
+ },
|
|
|
|
+ // 获取渠道商下的合作商信息
|
|
|
|
+ getSalesChannel () {
|
|
|
|
+ salesChannelList().then(res => {
|
|
|
|
+ if (res.status == 200) {
|
|
|
|
+ this.partnerList = res.data
|
|
|
|
+ const salesChannelType = this.authUserInfo.extInfo.channel.salesChannelType
|
|
|
|
+ if (salesChannelType == 'SALLER') { // 合作商
|
|
|
|
+ this.searchForm.salesChannelNo = res.data.length > 0 ? res.data[0].salesChannelNo : undefined
|
|
|
|
+ }
|
|
|
|
+ this.pageInit(1)
|
|
|
|
+ } else {
|
|
|
|
+ this.partnerList = []
|
|
|
|
+ this.searchForm.salesChannelNo = undefined
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
},
|
|
},
|
|
beforeRouteEnter (to, from, next) {
|
|
beforeRouteEnter (to, from, next) {
|
|
next(vm => {
|
|
next(vm => {
|
|
- vm.pageInit()
|
|
|
|
|
|
+ vm.isSearch = false
|
|
|
|
+ vm.getSalesChannel()
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|