Mr.Shi
2023-09-19 02eb974bcf9f85a4a6594540fab97007abef4291
企业端
已修改12个文件
197 ■■■■ 文件已修改
company_admin/.env 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
company_admin/.env.production 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
company_admin/src/api/business/category.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company_admin/src/api/business/goods.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
company_admin/src/components/business/OperaBrandWindow.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company_admin/src/components/business/OperaCategoryWindow.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company_admin/src/components/business/selectProduct.vue 153 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company_admin/src/components/business/selectProductItem.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company_admin/src/plugins/download.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
company_admin/src/views/business/brand.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company_admin/src/views/business/goods.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company_admin/src/views/business/pageConfiguration.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
company_admin/.env
@@ -9,4 +9,4 @@
# 接口前缀
# VUE_APP_API_PREFIX = '/preselect_interface/'
VUE_APP_API_PREFIX = '/interface'
VUE_APP_API_PREFIX = '/preselect_web_interface'
company_admin/.env.production
@@ -3,7 +3,9 @@
# VUE_APP_API = 'https://dmtest.ahapp.net/preselect_interface/'
VUE_APP_API = 'http://127.0.0.1/'
# VUE_APP_API = 'http://127.0.0.1/'
VUE_APP_API = 'https://dmtest.ahapp.net/preselect_web_interface/'
# VUE_APP_API = 'https://dm.ahapp.net/preselect_interface/'
company_admin/src/api/business/category.js
@@ -53,4 +53,9 @@
// 企业根据ID修改
export function companyUpdateById (data) {
  return request.post('/business/category/companyUpdateById', data)
}
// 表 - H5
export function list (data) {
  return request.post('/business/category/list', data)
}
company_admin/src/api/business/goods.js
@@ -17,7 +17,7 @@
// 导出模板
export function exportDoc (params) {
  return request.get('/business/goods/export', params, {
  return request.post('/business/goods/export', params, {
    trim: true,
    download: true
  })
company_admin/src/components/business/OperaBrandWindow.vue
@@ -13,7 +13,7 @@
            <el-upload
            :action="action"
            :file-list="form.fileList"
            :data="{ folder: 'projects' }"
            :data="{ folder: 'brand_img' }"
            list-type="picture-card"
            :limit="1"
            :on-success="fileSuccess"
@@ -39,7 +39,7 @@
    components: { GlobalWindow },
    data () {
      return {
        action: process.env.VUE_APP_API_PREFIX + '/public/uploadLocal',
        action: process.env.VUE_APP_API_PREFIX + '/public/upload',
        // 表单数据
        form: {
          id: null,
company_admin/src/components/business/OperaCategoryWindow.vue
@@ -133,7 +133,7 @@
  <script>
  import BaseOpera from '@/components/base/BaseOpera'
  import GlobalWindow from '@/components/common/GlobalWindow'
  import { create, updateById, baseCategoryList, companyCreate, companyUpdateById } from '@/api/business/category.js'
  import { baseCategoryList, companyCreate, companyUpdateById } from '@/api/business/category.js'
  export default {
    name: 'OperaCategoryWindow',
    extends: BaseOpera,
@@ -264,7 +264,7 @@
            this.form.sortnum = item.sortnum
            let arr = []
            item.baseCateParamList.forEach((row, index) => {
              arr.push({ name: row.name, isselect: index <= 1 ? 1 : 0, isshow: 1 })
              arr.push({ name: row.name, baseCateParamId: row.id, isselect: index <= 1 ? 1 : 0, isshow: 1 })
            })
            this.form.tableData = arr
            this.form.imgurl = item.imgurl
company_admin/src/components/business/selectProduct.vue
@@ -1,36 +1,36 @@
<template>
    <GlobalWindow :title="title" :visible.sync="visible" :confirm-working="isWorking" @confirm="confirm">
      <el-form :model="form" ref="form" :rules="rules">
        <el-form-item label="商品类别" prop="categoryId">
            <el-select v-model="form.categoryId" placeholder="请选择">
                <el-option
                    v-for="item in categoryList"
                    :key="item.id"
                    :label="item.name"
                    :value="item.id">
                </el-option>
            </el-select>
        </el-form-item>
        <el-form-item label="商品范围" prop="type">
            <el-radio-group v-model="form.type">
                <el-radio :label="0">全部</el-radio>
                <el-radio :label="1">部分</el-radio>
            </el-radio-group>
        </el-form-item>
        <el-form-item label="加价系数" prop="rate">
          <el-input v-model="form.rate" placeholder="平台采购价*加价系数,作为参考出手价,建议输入大于1的数字" v-trim />
        </el-form-item>
      </el-form>
      <!-- 选择平台商品 -->
      <selectProductItem ref="selectProductItem" @result="result" />
    </GlobalWindow>
  </template>
  <GlobalWindow :title="title" :visible.sync="visible" :confirm-working="isWorking" @confirm="confirm">
    <el-form :model="form" ref="form" :rules="rules">
      <el-form-item label="商品类别" prop="categoryId">
        <el-select v-model="form.categoryId" placeholder="请选择">
          <el-option
            v-for="item in categoryList"
            :key="item.id"
            :label="item.name"
            :value="`${item.platCateId},${item.id}`">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="商品范围" prop="type">
        <el-radio-group v-model="form.type">
          <el-radio :label="0">全部</el-radio>
          <el-radio :label="1">部分</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="加价系数" prop="rate">
        <el-input v-model="form.rate" placeholder="平台采购价*加价系数,作为参考出手价,建议输入大于1的数字" v-trim />
      </el-form-item>
    </el-form>
    <!-- 选择平台商品 -->
    <selectProductItem ref="selectProductItem" @result="result" />
  </GlobalWindow>
</template>
    
  <script>
<script>
  import BaseOpera from '@/components/base/BaseOpera'
  import GlobalWindow from '@/components/common/GlobalWindow'
  import selectProductItem from '@/components/business/selectProductItem'
  import { baseCategoryList } from '@/api/business/category.js'
  import { list } from '@/api/business/category.js'
  import { createPlat } from '@/api/business/goods'
  export default {
@@ -48,7 +48,7 @@
        },
        // 验证规则
        rules: {
            categoryId: [
          categoryId: [
            { required: true, message: '商品类别不能为空', trigger: 'blur' }
          ],
          type: [
@@ -67,53 +67,56 @@
      })
    },
    methods: {
        result() {
          // this.$emit('success')
          this.$emit('result')
          this.visible = false
        },
        confirm() {
            this.$refs.form.validate((valid) => {
                if (!valid) return
                // 新建
                if (this.form.type == 0) {
                    this.isWorking = true
                    createPlat({
                        categoryId: this.form.categoryId,
                        rate: this.form.rate,
                        type: this.form.type
                    }).then(res => {
                        this.visible = false
                        this.$tip.apiSuccess('操作成功')
                        // this.$emit('success')
                        this.$emit('result')
                    })
                    .catch(e => {
                        this.$tip.apiFailed(e)
                    })
                    .finally(() => {
                        this.isWorking = false
                    })
                } else {
                    this.$refs.selectProductItem.open('选择平台商品', this.form)
                }
      result() {
        // this.$emit('success')
        this.$emit('result')
        this.visible = false
      },
      confirm() {
        this.$refs.form.validate((valid) => {
          if (!valid) return
          // 新建
          if (this.form.type == 0) {
            this.isWorking = true
            createPlat({
              categoryId: this.form.categoryId.split(',')[1],
              rate: this.form.rate,
              type: this.form.type
            }).then(res => {
              this.visible = false
              this.$tip.apiSuccess('操作成功')
              // this.$emit('success')
              this.$emit('result')
            })
        },
        /**
         * 打开窗口
         * @title 窗口标题
         * @target 编辑的对象
         */
        open (title, target) {
            this.title = title
            this.visible = true
            // 获取分类列表
            baseCategoryList({ type: 1 })
              .then(res => {
                this.categoryList = res
              })
        }
            .catch(e => {
              this.$tip.apiFailed(e)
            })
            .finally(() => {
              this.isWorking = false
            })
          } else {
            this.$refs.selectProductItem.open('选择平台商品', this.form)
          }
        })
      },
      /**
       * 打开窗口
       * @title 窗口标题
       * @target 编辑的对象
       */
      open (title, target) {
        this.title = title
        this.visible = true
        this.form.categoryId = ''
        this.form.type = 0
        this.form.rate = ''
        // 获取分类列表
        list({ type: 1 })
          .then(res => {
            this.categoryList = res
          })
      }
    }
  }
  </script>
</script>
    
company_admin/src/components/business/selectProductItem.vue
@@ -81,6 +81,7 @@
            // 表单数据
            form: {
                categoryId: '',
                categoryId1: '',
                type: 0,
                rate: '',
                name: '',
@@ -136,7 +137,7 @@
            // 调用新建接口
            this.isWorking = true
            createPlat({
                categoryId: this.form.categoryId,
                categoryId: this.form.categoryId1,
                goodsParamList: this.form.goodsParamList,
                rate: this.form.rate,
                type: this.form.type
@@ -161,7 +162,8 @@
        open(title, target) {
            this.title = title
            this.visible = true
            this.form.categoryId = target.categoryId
            this.form.categoryId = Number(target.categoryId.split(',')[0])
            this.form.categoryId1 = Number(target.categoryId.split(',')[1])
            this.form.rate = Number(target.rate)
            this.form.type = target.type
            // 获取分类列表
company_admin/src/plugins/download.js
@@ -2,7 +2,7 @@
import message from './message'
export default function (response, decode = true, mime = 'application/octet-stream') {
  debugger
  // debugger
  // 当下载接口没有成功返回流并且接口返回的是JSON时需要对响应流进行解析并提示错误。(处理下载接口出现未知异常的情况)
  if (response.headers['content-type'] === 'application/json') {
    const blob = new Blob([response.data])
company_admin/src/views/business/brand.vue
@@ -30,8 +30,8 @@
                <el-image
                v-if="row.imgurl"
                style="width: 70px; height: 70px"
                :src="row.prefixUrl + row.imgurl"
                :preview-src-list="[row.prefixUrl + row.imgurl]"
                :src="row.imgfullurl"
                :preview-src-list="[row.imgfullurl]"
                fit="cover"></el-image>
            </template>
          </el-table-column>
@@ -97,7 +97,7 @@
                name: row.name,
                sortnum: row.sortnum,
                imgurl: row.imgurl,
                fileList: row.imgurl ? [ {url: row.prefixUrl + row.imgurl} ] : []
                fileList: row.imgfullurl ? [ {url: row.imgfullurl} ] : []
            }
            this.$refs.operaBrandWindow.open('编辑品牌', obj)
        }
company_admin/src/views/business/goods.vue
@@ -87,7 +87,12 @@
          </el-table-column>
          <el-table-column prop="brandName" label="品牌" min-width="100px"></el-table-column>
          <el-table-column prop="categoryName" label="类别" min-width="100px"></el-table-column>
          <el-table-column prop="baseZdPrice" label="指导价(元)" min-width="100px"></el-table-column>
          <el-table-column label="指导价(元)" min-width="100px">
            <template slot-scope="{row}">
              <span v-if="row.type == 0">{{ row.zdPrice }}</span>
              <span v-else>{{ row.baseZdPrice }}</span>
            </template>
          </el-table-column>
          <el-table-column prop="basePrice" label="采购价(元)" min-width="100px"></el-table-column>
          <el-table-column prop="price" label="入手价(元)" min-width="100px"></el-table-column>
          <el-table-column prop="createDate" label="创建时间" min-width="100px"></el-table-column>
company_admin/src/views/business/pageConfiguration.vue
@@ -37,6 +37,7 @@
                :data="{ folder: 'web_param' }"
                list-type="picture-card"
                :on-exceed="exceed"
                :limit="1"
                :file-list="fileList2"
                :on-success="fileSuccess2"
                :on-remove="handleRemove2">
@@ -52,6 +53,7 @@
                :data="{ folder: 'web_param' }"
                list-type="picture-card"
                :on-exceed="exceed"
                :limit="1"
                :file-list="fileList3"
                :on-success="fileSuccess3"
                :on-remove="handleRemove3">