|
@@ -21,27 +21,28 @@
|
|
|
<el-table v-loading="isLoading" :data="list" border style="width: 100%" height="660">
|
|
|
<el-table-column prop="shopName" fixed label="供应商名称" align="center" />
|
|
|
<el-table-column prop="linkMan" label="联系人" align="center" />
|
|
|
- <el-table-column prop="mobile" label="手机号" align="center">
|
|
|
+ <el-table-column prop="contractMobile" label="手机号" align="center">
|
|
|
<template slot-scope="{ row }">
|
|
|
- {{ row.mobile ? row.mobile : '---' }}
|
|
|
+ {{ row.contractMobile ? row.contractMobile : '---' }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="shopStatus" label="供应商状态" align="center" width="100">
|
|
|
+ <el-table-column prop="status" label="供应商状态" align="center" width="100">
|
|
|
<template slot-scope="{ row }">
|
|
|
- <el-tag v-if="row.shopStatus === 90" type="success" size="small">已上线</el-tag>
|
|
|
+ <el-tag v-if="row.status === 90" type="success" size="small">已上线</el-tag>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="status" label="logo" align="center" width="180">
|
|
|
<template slot-scope="{ row }">
|
|
|
- <el-popover placement="top-start" title="" width="180" trigger="hover">
|
|
|
- <img :src="row.productImage" alt="" style="width: 150px; height: 150px" />
|
|
|
- <img slot="reference" :src="row.productImage" alt="" style="width: 80px; height: 80px" />
|
|
|
+ <el-popover v-if="row.logo" placement="top-start" title="" width="180" trigger="hover">
|
|
|
+ <img :src="row.logo" alt="" style="width: 94px; height: 50px" />
|
|
|
+ <img slot="reference" :src="row.logo" alt="" style="width: 94px; height: 50px" />
|
|
|
</el-popover>
|
|
|
+ <span v-else>---</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="addTime" label="最近报表时间" align="center">
|
|
|
+ <el-table-column prop="recentlyTime" label="最近报表时间" align="center">
|
|
|
<template slot-scope="{ row }">
|
|
|
- {{ row.addTime ? row.addTime : '---' }}
|
|
|
+ {{ row.recentlyTime ? row.recentlyTime : '---' }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="addTime" label="添加时间" align="center">
|
|
@@ -67,14 +68,14 @@
|
|
|
:page-size="100"
|
|
|
:page.sync="listQuery.pageNum"
|
|
|
:limit.sync="listQuery.pageSize"
|
|
|
- @pagination="getCustomerShopList"
|
|
|
+ @pagination="getMarkShopList"
|
|
|
/>
|
|
|
<!-- 选择供应商弹窗 -->
|
|
|
<shop-dialog v-if="shopDialogVisible" ref="shopDialog" @confirm="handleAddShopConfirm" @cancel="handleCancel" />
|
|
|
<!-- 设置统计状态 -->
|
|
|
<el-dialog title="设置统计状态" :visible.sync="dialogFormVisible" width="500px">
|
|
|
<el-form ref="dataForm" :model="renewCustome" :rules="rules" label-position="right">
|
|
|
- <el-form-item prop="image" label="logo">
|
|
|
+ <el-form-item prop="logo" label="logo">
|
|
|
<div class="form-el-upload" style="width: 148px; height: 148px">
|
|
|
<el-upload
|
|
|
class="avatar-uploader"
|
|
@@ -86,8 +87,8 @@
|
|
|
>
|
|
|
<div v-loading="loadImgLoading" class="avatar" style="width: 148px; height: 148px; display: block">
|
|
|
<img
|
|
|
- v-if="renewCustome.image"
|
|
|
- :src="renewCustome.image"
|
|
|
+ v-if="renewCustome.logo"
|
|
|
+ :src="renewCustome.logo"
|
|
|
style="width: 148px; height: 148px; display: block"
|
|
|
@error="reloadImage"
|
|
|
@load="loadSucess"
|
|
@@ -112,8 +113,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getCustomerShopList, saveCustomerShop, renewCustomerShop } from '@/api/user/customer/customer'
|
|
|
-import ShopDialog from './components/shop-dialog'
|
|
|
+import { getMarkShopList, saveMarketShop, uploadShopLogo } from '@/api/user/customer/customer'
|
|
|
+import ShopDialog from './components/shop-market-dialog'
|
|
|
export default {
|
|
|
name: 'RecordList',
|
|
|
components: { ShopDialog },
|
|
@@ -131,17 +132,18 @@ export default {
|
|
|
total: 0,
|
|
|
shopDialogVisible: false,
|
|
|
dialogFormVisible: false,
|
|
|
+ loadImgLoading: false,
|
|
|
renewCustome: {
|
|
|
id: '',
|
|
|
- image: ''
|
|
|
+ logo: ''
|
|
|
},
|
|
|
rules: {
|
|
|
- image: [{ required: true, message: '请上传弹窗图片', trigger: 'blur' }]
|
|
|
+ logo: [{ required: true, message: '请上传弹窗图片', trigger: 'blur' }]
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- etToken() {
|
|
|
+ getToken() {
|
|
|
return {
|
|
|
token: this.$store.getters.token
|
|
|
}
|
|
@@ -159,7 +161,7 @@ export default {
|
|
|
getList() {
|
|
|
this.list = []
|
|
|
this.listQuery.pageNum = 1
|
|
|
- this.getCustomerShopList()
|
|
|
+ this.getMarkShopList()
|
|
|
},
|
|
|
// 确认选择供应商
|
|
|
handleAddShopConfirm(data) {
|
|
@@ -168,28 +170,28 @@ export default {
|
|
|
data.forEach((ele) => {
|
|
|
shopIds.push(ele.shopId)
|
|
|
})
|
|
|
- this.saveCustomerShop({ shopIds: shopIds.join(',') })
|
|
|
+ this.saveMarketShop({ shopIds: shopIds.join(',') })
|
|
|
},
|
|
|
// 取消选择供应商
|
|
|
handleCancel() {
|
|
|
this.shopDialogVisible = false
|
|
|
this.$refs.shopDialog.visible = false
|
|
|
},
|
|
|
- // 确认设置统计状态
|
|
|
+ // 上传logo
|
|
|
handleConfirm() {
|
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- this.renewCustomerShop(this.renewCustome)
|
|
|
+ this.uploadShopLogo(this.renewCustome)
|
|
|
} else {
|
|
|
return false
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
// 获取潜客搜集供应商列表
|
|
|
- async getCustomerShopList() {
|
|
|
+ async getMarkShopList() {
|
|
|
try {
|
|
|
this.isLoading = true
|
|
|
- const res = await getCustomerShopList(this.listQuery)
|
|
|
+ const res = await getMarkShopList(this.listQuery)
|
|
|
this.list = res.data.results
|
|
|
this.total = res.data.totalRecord
|
|
|
this.isLoading = false
|
|
@@ -198,9 +200,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 保存添加统计供应商
|
|
|
- async saveCustomerShop(params) {
|
|
|
+ async saveMarketShop(params) {
|
|
|
try {
|
|
|
- await saveCustomerShop(params)
|
|
|
+ await saveMarketShop(params)
|
|
|
this.shopDialogVisible = false
|
|
|
this.$message.success('操作成功')
|
|
|
this.getList()
|
|
@@ -208,10 +210,10 @@ export default {
|
|
|
console.log(error)
|
|
|
}
|
|
|
},
|
|
|
- // 统计状态
|
|
|
- async renewCustomerShop(params) {
|
|
|
+ // 上传logo
|
|
|
+ async uploadShopLogo(params) {
|
|
|
try {
|
|
|
- await renewCustomerShop(params)
|
|
|
+ await uploadShopLogo(params)
|
|
|
this.dialogFormVisible = false
|
|
|
this.$message.success('操作成功')
|
|
|
this.getList()
|
|
@@ -219,19 +221,18 @@ export default {
|
|
|
console.log(error)
|
|
|
}
|
|
|
},
|
|
|
- // 查看详情
|
|
|
+ // 操作
|
|
|
handleRecordDetail(type, row) {
|
|
|
switch (type) {
|
|
|
- case 1: // 潜客统计列表
|
|
|
+ case 1: // 上传logo
|
|
|
this.renewCustome.id = row.id
|
|
|
- this.renewCustome.status = row.status
|
|
|
console.log('renewCustome', this.renewCustome)
|
|
|
this.dialogFormVisible = true
|
|
|
break
|
|
|
- case 2: // 相关文章
|
|
|
+ case 2: // 跳转数据报表
|
|
|
this.$router.push({
|
|
|
path: '/user/customer/market-report-list',
|
|
|
- query: { shopId: row.shopId, shopName: row.shopName }
|
|
|
+ query: { marketId: row.id, shopName: row.shopName }
|
|
|
})
|
|
|
break
|
|
|
}
|
|
@@ -241,7 +242,7 @@ export default {
|
|
|
this.loadImgLoading = true
|
|
|
this.$nextTick(() => {
|
|
|
setTimeout(() => {
|
|
|
- this.form.image = res.data
|
|
|
+ this.renewCustome.logo = res.data
|
|
|
}, 1000 * 2)
|
|
|
})
|
|
|
},
|
|
@@ -262,7 +263,7 @@ export default {
|
|
|
reloadImage() {
|
|
|
this.loadImgLoading = true
|
|
|
setTimeout(() => {
|
|
|
- this.temp.classifyImage = this.temp.classifyImage.split('?')[0] + '?r=' + Math.floor(Math.random() * 1000)
|
|
|
+ this.renewCustome.logo = this.renewCustome.logo.split('?')[0] + '?r=' + Math.floor(Math.random() * 1000)
|
|
|
}, 1000 * 2)
|
|
|
},
|
|
|
loadSucess() {
|