zhengjinyi před 1 rokem
rodič
revize
14759f785a

+ 122 - 1
src/api/user/customer/customer.js

@@ -423,6 +423,110 @@ export function saveInformation(data) {
     data: data
     data: data
   })
   })
 }
 }
+/**
+ * 选择已上线供应商列表
+ * @param {*} shopName
+ * @param {*} pageNum,
+ * @param {*} pageSize
+ * @returns
+ */
+export function getMarketShopList(params) {
+  return request({
+    url: '/user/market/getShop',
+    method: 'get',
+    params
+  })
+}
+/**
+ * 营销供应商列表
+ * @param {*} shopName
+ * @param {*} pageNum,
+ * @param {*} pageSize
+ * @returns
+ */
+export function getMarkShopList(params) {
+  return request({
+    url: '/user/market/getMarkShopList',
+    method: 'get',
+    params
+  })
+}
+/**
+ * 保存数据报表供应商
+ * @param {*} shopIds
+ * @returns
+ */
+export function saveMarketShop(params) {
+  return request({
+    url: '/user/market/saveMarketShop',
+    method: 'get',
+    params
+  })
+}
+/**
+ * 保存logo
+ * @param {*} id
+ * @param {*} logo
+ * @returns
+ */
+export function uploadShopLogo(params) {
+  return request({
+    url: '/user/market/uploadShopLogo	',
+    method: 'get',
+    params
+  })
+}
+/**
+ * 数据报表列表
+ * @param {*} marketId
+ * @param {*} reportName
+ * @param {*} pageNum,
+ * @param {*} pageSize
+ * @returns
+ */
+export function getMarketReportList(params) {
+  return request({
+    url: '/user/market/getMarketReport',
+    method: 'get',
+    params
+  })
+}
+/**
+ * 数据报表编辑回显
+ * @param {*} id
+ * @returns
+ */
+export function getMarketReportById(params) {
+  return request({
+    url: '/user/market/getMarketReportById',
+    method: 'get',
+    params
+  })
+}
+/**
+ * 生成报表
+ * @param {*} id
+ * @returns
+ */
+export function updateVisible(params) {
+  return request({
+    url: '/user/market/updateVisible',
+    method: 'get',
+    params
+  })
+}
+/**
+ * 删除报表
+ * @param {*} id
+ * @returns
+ */
+export function deleteMarketReport(params) {
+  return request({
+    url: '/user/market/deleteMarketReport',
+    method: 'get',
+    params
+  })
+}
 /**
 /**
  * 上传数据文件
  * 上传数据文件
  * @param {*} reportDate 报表月份
  * @param {*} reportDate 报表月份
@@ -430,9 +534,26 @@ export function saveInformation(data) {
  * @param {*} reportFile 文件
  * @param {*} reportFile 文件
  * @returns
  * @returns
  */
  */
-export function saveMarketReport(params) {
+export function saveMarketReport(data) {
   return request({
   return request({
     url: '/user/market/saveMarketReport',
     url: '/user/market/saveMarketReport',
+    method: 'post',
+    data,
+    headers: {
+      'Content-Type': 'multipart/form-data'
+    }
+  })
+}
+/**
+ * 保存报表
+ * @param {*} reportDate 报表月份
+ * @param {*} reportName 报表名称
+ * @param {*} filePath 文件
+ * @returns
+ */
+export function saveReport(params) {
+  return request({
+    url: '/user/market/saveReport',
     method: 'get',
     method: 'get',
     params
     params
   })
   })

+ 1 - 0
src/views/library/tag/list.vue

@@ -403,6 +403,7 @@ export default {
     handleUploadSuccess(response, file, fileList) {
     handleUploadSuccess(response, file, fileList) {
       this.importForm.fileUrl = response.url
       this.importForm.fileUrl = response.url
       this.fileList = fileList
       this.fileList = fileList
+      console.log('fileList', this.fileList)
     },
     },
 
 
     // 上传文件删除
     // 上传文件删除

+ 150 - 0
src/views/user/customer/components/shop-market-dialog.vue

@@ -0,0 +1,150 @@
+<template>
+  <el-dialog
+    title="添加供应商"
+    :visible.sync="visible"
+    width="1200px"
+    :close-on-click-modal="false"
+    :show-close="false"
+  >
+    <div class="filter-container">
+      <div class="filter-control">
+        <span>供应商名称:</span>
+        <el-input
+          v-model="listQuery.shopName"
+          placeholder="供应商名称"
+          clearable
+          style="width: 160px"
+          @keyup.enter.native="getList"
+          @clear="getList"
+        />
+      </div>
+      <div class="filter-control">
+        <el-button type="primary" @click="getList"> 查询 </el-button>
+      </div>
+    </div>
+    <el-table
+      ref="table"
+      v-loading="isLoading"
+      :data="list"
+      height="400px"
+      border
+      @selection-change="handleSelectionChange"
+    >
+      <el-table-column type="selection" width="55" :selectable="selectable" />
+      <el-table-column label="供应商名称" prop="name" align="center" />
+      <el-table-column label="联系人" prop="linkMan" align="center" />
+      <el-table-column label="手机号" prop="contractMobile" align="center">
+        <template slot-scope="{ row }">
+          {{ row.contractMobile ? row.contractMobile : '---' }}
+        </template>
+      </el-table-column>
+      <el-table-column label="供应商状态" prop="status" align="center">
+        <template slot-scope="{ row }">
+          <el-tag v-if="row.status === 90" type="success" size="small">已上线</el-tag>
+        </template>
+      </el-table-column>
+    </el-table>
+    <!-- 页码 -->
+    <pagination
+      :total="total"
+      :page-sizes="[100, 200]"
+      :page-size="100"
+      :page.sync="listQuery.pageNum"
+      :limit.sync="listQuery.pageSize"
+      @pagination="getShopList"
+    />
+    <div slot="footer">
+      <el-button @click="handleCanle"> 取 消 </el-button>
+      <el-button type="primary" :disabled="disabled" @click="handleConfirm"> 确 定 </el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+import { getMarketShopList } from '@/api/user/customer/customer'
+
+export default {
+  name: 'ShopDialog',
+  filters: {
+    NumFormat(value) {
+      // 处理金额
+      return Number(value).toFixed(2)
+    }
+  },
+  data() {
+    return {
+      visible: true,
+      listQuery: {
+        pageNum: 1, // 页码
+        pageSize: 100, // 页面数据数
+        shopName: '' // 供应商公司名称
+      },
+      list: [],
+      total: 0,
+      shopsRadio: null,
+      isLoading: true
+    }
+  },
+  computed: {
+    disabled() {
+      return this.shopsRadio === null
+    }
+  },
+  created() {
+    this.getList()
+  },
+  methods: {
+    // 获取所有供应商列表
+    async getList() {
+      this.list = []
+      this.listQuery.pageNum = 1
+      this.getShopList()
+    },
+    // 获取所有供应商列表
+    async getShopList() {
+      try {
+        const res = await getMarketShopList(this.listQuery)
+        this.list = res.data.results
+        this.total = res.data.totalRecord
+        this.isLoading = false
+      } catch (error) {
+        console.log(error)
+      }
+    },
+    // 选择供应商
+    handleSelectionChange(row) {
+      this.shopsRadio = row
+      console.log('row', row)
+    },
+    // 确认选择供应商
+    handleConfirm() {
+      this.$emit('confirm', this.shopsRadio)
+    },
+    handleCanle() {
+      // 取消弹窗
+      this.$emit('cancel')
+    },
+    // 已选择的禁用勾选框
+    selectable(row) {
+      if (row.flag) {
+        return true
+      } else {
+        return false
+      }
+    },
+    checkedInput(event, type) {
+      let pattern = ''
+      switch (type) {
+        case 1:
+          pattern = /[^\d]/g
+          break
+        case 2:
+          pattern = /[^u4E00-u9FA5|d|a-zA-Z|rns,.?!,。?!…—&$=()-+/*{}[]]|s/g
+          break
+      }
+      return event.replace(pattern, '')
+    }
+  }
+}
+</script>
+<style lang="scss" scoped></style>

+ 33 - 29
src/views/user/customer/market-edit.vue

@@ -1,9 +1,7 @@
 <template>
 <template>
   <div class="app-container" style="width: 800px; margin: 0 auto">
   <div class="app-container" style="width: 800px; margin: 0 auto">
     <div class="form-tips">
     <div class="form-tips">
-      <p>
-        文件上传完成后,可先预览报表,若不是最终想要的数据效果,可先暂时保存,等数据最终确定了,再重新上传新文件,最后生成报表。
-      </p>
+      <p>文件上传完成,保存后进行预览报表。等数据最终确定了,可重新上传新文件,最后再生成报表。</p>
     </div>
     </div>
     <el-form ref="importForm" :model="form" label-width="100px">
     <el-form ref="importForm" :model="form" label-width="100px">
       <el-form-item label="报表月份:" prop="reportDate" :rules="rules.reportDate">
       <el-form-item label="报表月份:" prop="reportDate" :rules="rules.reportDate">
@@ -18,7 +16,7 @@
       <el-form-item label="报表名称:" prop="reportName" :rules="rules.reportName">
       <el-form-item label="报表名称:" prop="reportName" :rules="rules.reportName">
         <el-input v-model="form.reportName" placeholder="请输入报表名称" maxlength="30" style="width: 280px" />
         <el-input v-model="form.reportName" placeholder="请输入报表名称" maxlength="30" style="width: 280px" />
       </el-form-item>
       </el-form-item>
-      <el-form-item label="报表文件" prop="fileUrl" :rules="rules.fileUrl">
+      <el-form-item label="报表文件" prop="filePath" :rules="rules.filePath">
         <el-upload
         <el-upload
           ref="upload"
           ref="upload"
           accept=".zip, .rar"
           accept=".zip, .rar"
@@ -31,9 +29,9 @@
           :auto-upload="false"
           :auto-upload="false"
         >
         >
           <el-button slot="trigger" size="small" type="primary"> 选取文件 </el-button>
           <el-button slot="trigger" size="small" type="primary"> 选取文件 </el-button>
-          <div slot="tip" class="el-upload__tip">只能上传.zip,.rar格式文件</div>
+          <div slot="tip" class="el-upload__tip">只支持.zip 和 .rar 格式的压缩包文件</div>
         </el-upload>
         </el-upload>
-        <input v-show="false" v-model="form.fileUrl" type="text" />
+        <input v-show="false" v-model="form.filePath" type="text" />
       </el-form-item>
       </el-form-item>
     </el-form>
     </el-form>
     <div class="el-dialog__footer" style="text-align: left; margin-top: 100px">
     <div class="el-dialog__footer" style="text-align: left; margin-top: 100px">
@@ -44,7 +42,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import { saveMarketReport, getShopPopUp } from '@/api/user/customer/customer'
+import { saveMarketReport, saveReport, getMarketReportById } from '@/api/user/customer/customer'
 
 
 export default {
 export default {
   name: 'MarketEdit',
   name: 'MarketEdit',
@@ -52,7 +50,7 @@ export default {
     const defaultForm = () => {
     const defaultForm = () => {
       return {
       return {
         id: '',
         id: '',
-        reportFile: '', // 数据文件
+        filePath: '', // 数据文件
         reportDate: '', // 报表月份
         reportDate: '', // 报表月份
         reportName: '' // 报表月份
         reportName: '' // 报表月份
       }
       }
@@ -62,7 +60,7 @@ export default {
       loadImgLoading: false,
       loadImgLoading: false,
       fileList: [],
       fileList: [],
       rules: {
       rules: {
-        fileUrl: [{ required: true, message: '请导入数据文件', trigger: ['change'] }],
+        filePath: [{ required: true, message: '请选择压缩包文件', trigger: ['change'] }],
         reportDate: [{ required: true, message: '请选择报表数据月份', trigger: 'blur' }],
         reportDate: [{ required: true, message: '请选择报表数据月份', trigger: 'blur' }],
         reportName: [{ required: true, message: '请输入报表名称', trigger: 'blur' }]
         reportName: [{ required: true, message: '请输入报表名称', trigger: 'blur' }]
       }
       }
@@ -80,14 +78,14 @@ export default {
   },
   },
   created() {
   created() {
     if (this.$route.query.type === 'edit') {
     if (this.$route.query.type === 'edit') {
-      this.getShopPopUp({ shopId: this.$route.query.shopId })
+      this.getMarketReportById({ id: this.$route.query.id })
     }
     }
   },
   },
   methods: {
   methods: {
     // 获取供应商弹窗详情
     // 获取供应商弹窗详情
-    async getShopPopUp(params) {
+    async getMarketReportById(params) {
       try {
       try {
-        const res = await getShopPopUp(params)
+        const res = await getMarketReportById(params)
         this.form = { ...this.form, ...res.data }
         this.form = { ...this.form, ...res.data }
       } catch (error) {
       } catch (error) {
         console.log('error', error)
         console.log('error', error)
@@ -97,24 +95,16 @@ export default {
     async handleImportConfirm() {
     async handleImportConfirm() {
       try {
       try {
         await this.$refs.importForm.validate()
         await this.$refs.importForm.validate()
-        this.importSumbit()
+        this.saveReport()
       } catch (error) {
       } catch (error) {
         console.log(error)
         console.log(error)
       }
       }
     },
     },
-    async importSumbit() {
-      const file = this.fileList.length > 0 && this.fileList[0]
-      if (!file) return
+    // 保存数据报表
+    async saveReport() {
       try {
       try {
-        const formData = new FormData()
-        this.fileList = []
-        formData.append('keywordFile', file.raw)
-        this.form.reportFile = formData
-        await saveMarketReport(this.form)
-        this.$message.success('保存成功')
-        // setTimeout(() => {
-        //   this.$router.push({ path: '/user/customer/list' })
-        // }, 1000)
+        await saveReport(this.form)
+        this.$message.success('数据报表保存成功')
       } catch (error) {
       } catch (error) {
         console.log(error)
         console.log(error)
       }
       }
@@ -137,18 +127,32 @@ export default {
     },
     },
     // 文件上传成功
     // 文件上传成功
     handleUploadSuccess(response, file, fileList) {
     handleUploadSuccess(response, file, fileList) {
-      this.importForm.fileUrl = response.url
+      this.form.filePath = response.url
       this.fileList = fileList
       this.fileList = fileList
     },
     },
-
     // 上传文件删除
     // 上传文件删除
     handleUploadRemove(file, fileList) {
     handleUploadRemove(file, fileList) {
       this.fileList = fileList
       this.fileList = fileList
     },
     },
-
     handleUploadChange(file, fileList) {
     handleUploadChange(file, fileList) {
       this.fileList = fileList
       this.fileList = fileList
-      this.importForm.fileUrl = file.name
+      this.form.filePath = file.name
+      console.log('222222222222', this.fileList)
+      this.saveMarketReport()
+    },
+    // 上传文件
+    async saveMarketReport() {
+      const file = this.fileList.length > 0 && this.fileList[0]
+      if (!file) return
+      try {
+        const formData = new FormData()
+        this.fileList = []
+        formData.append('reportFile', file.raw)
+        const res = await saveMarketReport(formData)
+        this.form.filePath = res.data
+      } catch (error) {
+        console.log(error)
+      }
     },
     },
     backToList() {
     backToList() {
       this.$store.dispatch('tagsView/delView', this.$route).then(() => {
       this.$store.dispatch('tagsView/delView', this.$route).then(() => {

+ 37 - 36
src/views/user/customer/market-list.vue

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

+ 30 - 70
src/views/user/customer/market-report-list.vue

@@ -5,8 +5,8 @@
       <div class="filter-control">
       <div class="filter-control">
         <span>报表名称:</span>
         <span>报表名称:</span>
         <el-input
         <el-input
-          v-model="listQuery.consultName"
-          placeholder="姓名"
+          v-model="listQuery.reportName"
+          placeholder="报表名称"
           clearable
           clearable
           @keyup.enter.native="getList"
           @keyup.enter.native="getList"
           @clear="getList"
           @clear="getList"
@@ -50,15 +50,14 @@
       :page-size="100"
       :page-size="100"
       :page.sync="listQuery.pageNum"
       :page.sync="listQuery.pageNum"
       :limit.sync="listQuery.pageSize"
       :limit.sync="listQuery.pageSize"
-      @pagination="getCmInformationList"
+      @pagination="getMarketReportList"
     />
     />
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
-import { getCmInformationList, renewFollowUpStatus } from '@/api/user/customer/customer'
+import { getMarketReportList, updateVisible, deleteMarketReport } from '@/api/user/customer/customer'
 import { downloadWithUrl } from '@/utils'
 import { downloadWithUrl } from '@/utils'
-import { getServiceList } from '@/api/library/keyword'
 export default {
 export default {
   name: 'CustomerStatList',
   name: 'CustomerStatList',
   filters: {},
   filters: {},
@@ -68,41 +67,13 @@ export default {
       isLoading: true,
       isLoading: true,
       time: '',
       time: '',
       listQuery: {
       listQuery: {
-        shopId: this.$route.query.shopId,
-        consultName: '',
-        consultMobile: '',
+        marketId: this.$route.query.marketId,
+        reportName: '',
         pageNum: 1,
         pageNum: 1,
         pageSize: 100
         pageSize: 100
       },
       },
-      list: [
-        {
-          time: '2023-11',
-          title: '超清秀11月报表',
-          endTime: '2023-12-18 09:55:51'
-        },
-        {
-          time: '2023-10',
-          title: '超清秀10月报表',
-          endTime: '2023-12-18 09:55:51'
-        },
-        {
-          time: '2023-08',
-          title: '超清秀09月报表',
-          endTime: '2023-12-18 09:55:51'
-        }
-      ],
-      total: 0,
-      dialogFormVisible: false,
-      sellerList: [],
-      renewCustome: {
-        id: '',
-        serviceProviderId: '',
-        followUpStatus: ''
-      },
-      rules: {
-        followUpStatus: [{ required: true, message: '请设置跟进状态', trigger: 'blur' }],
-        serviceProviderId: [{ required: true, message: '请选择跟进人员', trigger: 'blur' }]
-      }
+      list: [],
+      total: 0
     }
     }
   },
   },
   computed: {},
   computed: {},
@@ -111,61 +82,40 @@ export default {
   },
   },
   mounted() {},
   mounted() {},
   methods: {
   methods: {
-    // 获取潜客统计列表
+    // 获取列表
     async getList() {
     async getList() {
       // this.list = []
       // this.list = []
       this.listQuery.pageNum = 1
       this.listQuery.pageNum = 1
-      this.getCmInformationList()
+      this.getMarketReportList()
     },
     },
-    // 获取潜客统计列表
-    async getCmInformationList() {
+    // 获取列表
+    async getMarketReportList() {
       try {
       try {
         this.isLoading = true
         this.isLoading = true
-        const res = await getCmInformationList(this.listQuery)
-        // this.list = res.data.results
+        const res = await getMarketReportList(this.listQuery)
+        this.list = res.data.results
         this.total = res.data.totalRecord
         this.total = res.data.totalRecord
         this.isLoading = false
         this.isLoading = false
       } catch (error) {
       } catch (error) {
         console.log(error)
         console.log(error)
       }
       }
     },
     },
-    // 确认设置跟进状态
-    handleConfirm() {
-      this.$refs['dataForm'].validate((valid) => {
-        if (valid) {
-          this.renewFollowUpStatus(this.renewCustome)
-        } else {
-          return false
-        }
-      })
-    },
-    // 设置状态
+    // 生成报表
     handleSitting(row) {
     handleSitting(row) {
       this.renewCustome.id = row.id
       this.renewCustome.id = row.id
       this.renewCustome.followUpStatus = row.followUpStatus
       this.renewCustome.followUpStatus = row.followUpStatus
-      this.getServiceList()
-      this.dialogFormVisible = true
+      this.updateVisible()
     },
     },
-    // 调用跟进状态API
-    async renewFollowUpStatus(params) {
+    // 调用生成报表API
+    async updateVisible(params) {
       try {
       try {
-        await renewFollowUpStatus(params)
-        this.dialogFormVisible = false
+        await updateVisible(params)
         this.$message.success('操作成功')
         this.$message.success('操作成功')
         this.getList()
         this.getList()
       } catch (error) {
       } catch (error) {
         console.log(error)
         console.log(error)
       }
       }
     },
     },
-    // 获取协销列表选项
-    async getServiceList() {
-      try {
-        const res = await getServiceList()
-        this.sellerList = res.data
-      } catch (error) {
-        console.log(error)
-      }
-    },
     // 删除报表
     // 删除报表
     async handleDeleteTag(row) {
     async handleDeleteTag(row) {
       try {
       try {
@@ -174,11 +124,21 @@ export default {
           cancelButtonText: '取消',
           cancelButtonText: '取消',
           type: 'warning'
           type: 'warning'
         })
         })
-        // this.deleteReport(row)
+        this.deleteMarketReport(row)
       } catch (error) {
       } catch (error) {
         this.$message.info('已取消删除操作')
         this.$message.info('已取消删除操作')
       }
       }
     },
     },
+    // 调用删除报备
+    async deleteMarketReport(row) {
+      try {
+        await deleteMarketReport(row.reportId)
+        this.$message.success('操作成功')
+        this.getList()
+      } catch (error) {
+        console.log(error)
+      }
+    },
     // 下载数据报表模板
     // 下载数据报表模板
     handleDownloadTemp() {
     handleDownloadTemp() {
       downloadWithUrl('/temp/market-import.xlsx', '供应商数据报表.xlsx')
       downloadWithUrl('/temp/market-import.xlsx', '供应商数据报表.xlsx')