Commit b82f74ed by cwq0219

新增服务4s店

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