Commit b82f74ed by cwq0219

新增服务4s店

1 parent 056477cd
...@@ -18,3 +18,9 @@ export function serviceGetMerchantList(data) { ...@@ -18,3 +18,9 @@ export function serviceGetMerchantList(data) {
data.method = `${path}merchant.page` data.method = `${path}merchant.page`
return request(data) return request(data)
} }
// 新增商户门店
export function addServiceMerchant(data) {
data.method = `${path}servicemerchantref.add`
return request(data)
}
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
@closeDialog="handleRelateStoreClose" @closeDialog="handleRelateStoreClose"
class="relateStore" class="relateStore"
> >
<slot></slot>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-table <el-table
...@@ -24,7 +25,11 @@ ...@@ -24,7 +25,11 @@
type="selection" type="selection"
width="55" width="55"
align="center" align="center"
:selectable="selectable"
></el-table-column> ></el-table-column>
<!-- <el-table-column>
<template slot-scope="scope">{{scope.row.beServed}}</template>
</el-table-column> -->
<el-table-column <el-table-column
prop="merchantName" prop="merchantName"
label="门店名称" label="门店名称"
...@@ -85,6 +90,10 @@ export default { ...@@ -85,6 +90,10 @@ export default {
storeSelected: { storeSelected: {
type: Array, type: Array,
default: () => [] default: () => []
},
storeSearchForm: {
type: Object,
default: () => { }
} }
}, },
...@@ -94,6 +103,9 @@ export default { ...@@ -94,6 +103,9 @@ export default {
}, },
methods: { methods: {
selectable(row, index) {
return row.hasOwnProperty('beServed') ? !row.beServed : true
},
recoverySelection() { recoverySelection() {
var exitIds = this.selectedData.map(item => item.merchantId) var exitIds = this.selectedData.map(item => item.merchantId)
this.selectingData.forEach(item => { this.selectingData.forEach(item => {
...@@ -102,9 +114,11 @@ export default { ...@@ -102,9 +114,11 @@ export default {
}, },
getSelectingList() { getSelectingList() {
this.storeApi({ this.storeApi({
...this.storeSearchForm,
currentPage: this.currentPage, currentPage: this.currentPage,
pageSize: this.pageSize pageSize: this.pageSize
}).then(res => { }).then(res => {
console.log(res)
this.selectingData = res.list this.selectingData = res.list
this.total = res.total this.total = res.total
this.$nextTick(() => { this.$nextTick(() => {
......
<!-- 服务4S店 --> <!-- 服务4S店 -->
<template> <template>
<d2-container class="commodity"> <d2-container class="service-store">
<el-form <el-form
:inline="true" :inline="true"
v-model="searchForm" v-model="searchForm"
...@@ -40,17 +40,46 @@ ...@@ -40,17 +40,46 @@
</d2-table> </d2-table>
<relate-store-dialog <relate-store-dialog
v-if="relateStoreVisible" v-if="relateStoreVisible"
ref="relateStore"
:relateStoreVisible="relateStoreVisible" :relateStoreVisible="relateStoreVisible"
:storeApi="storeApi" :storeApi="storeApi"
:storeSearchForm="storeSearchForm"
:storeSelected="storeSelected" :storeSelected="storeSelected"
@handleRelateStoreConfirm="handleRelateStoreConfirm" @handleRelateStoreConfirm="handleRelateStoreConfirm"
@handleRelateStoreClose="handleRelateStoreClose" @handleRelateStoreClose="handleRelateStoreClose"
></relate-store-dialog> >
<el-row slot>
<el-col
class="service-search"
:span="6"
>
<el-select v-model="storeSearchForm.channelType">
<el-option
v-for="item in baseData.channelType"
:key="item.value"
:label="item.name"
:value="item.value"
></el-option>
</el-select>
</el-col>
<el-col :span="8">
<el-input
v-model="storeSearchForm.merchantIdName"
placeholder="支持按门店、商户号搜索"
clearable
></el-input>
</el-col>
<el-button
type="primary"
@click="handleSearchStore"
>搜索</el-button>
</el-row>
</relate-store-dialog>
</d2-container> </d2-container>
</template> </template>
<script> <script>
import { getList, deleteMerchant, serviceGetMerchantList } from '@api/serviceStore' import { getList, deleteMerchant, serviceGetMerchantList, addServiceMerchant } from '@api/serviceStore'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { BaseData, userType, ghUserType } from '@/common/constants.js' import { BaseData, userType, ghUserType } from '@/common/constants.js'
export default { export default {
...@@ -107,6 +136,10 @@ export default { ...@@ -107,6 +136,10 @@ export default {
}] }]
}, },
// 关联门店 // 关联门店
storeSearchForm: {
channelType: 1,
merchantIdName: ''
},
relateStoreVisible: false, relateStoreVisible: false,
storeApi: serviceGetMerchantList, storeApi: serviceGetMerchantList,
storeSelected: [], storeSelected: [],
...@@ -145,14 +178,27 @@ export default { ...@@ -145,14 +178,27 @@ export default {
// console.log(form) // console.log(form)
this.relateStoreVisible = true this.relateStoreVisible = true
}, },
relateCloseReset() {
this.storeSearchForm = {
channelType: 1,
merchantIdName: ''
}
},
handleRelateStoreConfirm() { handleRelateStoreConfirm() {
this.relateStoreVisible = false addServiceMerchant({}).then(res => {
this.relateStoreVisible = false
this.relateCloseReset()
})
}, },
handleRelateStoreClose() { handleRelateStoreClose() {
this.relateStoreVisible = false this.relateStoreVisible = false
this.relateCloseReset()
},
handleSearchStore() {
this.$refs.relateStore.getSelectingList()
}, },
handleDelete(row) { handleDelete(row) {
console.log(row) // console.log(row)
this.$confirm('是否要进行删除操作?', '提示', { this.$confirm('是否要进行删除操作?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
...@@ -170,5 +216,8 @@ export default { ...@@ -170,5 +216,8 @@ export default {
} }
</script> </script>
<style scoped> <style>
.service-store .service-search {
margin-bottom: 10px;
}
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!