| | |
| | | |
| | | # 接口前缀 |
| | | # VUE_APP_API_PREFIX = '/preselect_interface/' |
| | | VUE_APP_API_PREFIX = '/interface' |
| | | VUE_APP_API_PREFIX = '/preselect_web_interface' |
| | |
| | | |
| | | # 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/' |
| | | |
| | |
| | | // 企业根据ID修改 |
| | | export function companyUpdateById (data) { |
| | | return request.post('/business/category/companyUpdateById', data) |
| | | } |
| | | |
| | | // 表 - H5 |
| | | export function list (data) { |
| | | return request.post('/business/category/list', data) |
| | | } |
| | |
| | | |
| | | // 导出模板 |
| | | export function exportDoc (params) { |
| | | return request.get('/business/goods/export', params, { |
| | | return request.post('/business/goods/export', params, { |
| | | trim: true, |
| | | download: true |
| | | }) |
| | |
| | | <el-upload |
| | | :action="action" |
| | | :file-list="form.fileList" |
| | | :data="{ folder: 'projects' }" |
| | | :data="{ folder: 'brand_img' }" |
| | | list-type="picture-card" |
| | | :limit="1" |
| | | :on-success="fileSuccess" |
| | |
| | | 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, |
| | |
| | | <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, |
| | |
| | | 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 |
| | |
| | | <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 { |
| | |
| | | }, |
| | | // 验证规则 |
| | | rules: { |
| | | categoryId: [ |
| | | categoryId: [ |
| | | { required: true, message: '商品类别不能为空', trigger: 'blur' } |
| | | ], |
| | | type: [ |
| | |
| | | }) |
| | | }, |
| | | 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> |
| | | |
| | |
| | | // 表单数据 |
| | | form: { |
| | | categoryId: '', |
| | | categoryId1: '', |
| | | type: 0, |
| | | rate: '', |
| | | name: '', |
| | |
| | | // 调用新建接口 |
| | | this.isWorking = true |
| | | createPlat({ |
| | | categoryId: this.form.categoryId, |
| | | categoryId: this.form.categoryId1, |
| | | goodsParamList: this.form.goodsParamList, |
| | | rate: this.form.rate, |
| | | type: this.form.type |
| | |
| | | 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 |
| | | // 获取分类列表 |
| | |
| | | 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]) |
| | |
| | | <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> |
| | |
| | | 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) |
| | | } |
| | |
| | | </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> |
| | |
| | | :data="{ folder: 'web_param' }" |
| | | list-type="picture-card" |
| | | :on-exceed="exceed" |
| | | :limit="1" |
| | | :file-list="fileList2" |
| | | :on-success="fileSuccess2" |
| | | :on-remove="handleRemove2"> |
| | |
| | | :data="{ folder: 'web_param' }" |
| | | list-type="picture-card" |
| | | :on-exceed="exceed" |
| | | :limit="1" |
| | | :file-list="fileList3" |
| | | :on-success="fileSuccess3" |
| | | :on-remove="handleRemove3"> |