From 02eb974bcf9f85a4a6594540fab97007abef4291 Mon Sep 17 00:00:00 2001
From: Mr.Shi <1878285526@qq.com>
Date: 星期二, 19 九月 2023 09:19:24 +0800
Subject: [PATCH] 企业端
---
company_admin/src/plugins/download.js | 2
company_admin/src/api/business/category.js | 5 +
company_admin/.env | 2
company_admin/src/api/business/goods.js | 2
company_admin/src/components/business/selectProductItem.vue | 6 +
company_admin/.env.production | 4
company_admin/src/views/business/pageConfiguration.vue | 2
company_admin/src/components/business/OperaCategoryWindow.vue | 4
company_admin/src/components/business/selectProduct.vue | 153 +++++++++++++++++++------------------
company_admin/src/views/business/brand.vue | 6
company_admin/src/views/business/goods.vue | 7 +
company_admin/src/components/business/OperaBrandWindow.vue | 4
12 files changed, 108 insertions(+), 89 deletions(-)
diff --git a/company_admin/.env b/company_admin/.env
index ec64a9c..7e8f7be 100644
--- a/company_admin/.env
+++ b/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'
diff --git a/company_admin/.env.production b/company_admin/.env.production
index eb6b15b..9f0deac 100644
--- a/company_admin/.env.production
+++ b/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/'
diff --git a/company_admin/src/api/business/category.js b/company_admin/src/api/business/category.js
index f0a40c7..91a328e 100644
--- a/company_admin/src/api/business/category.js
+++ b/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)
}
\ No newline at end of file
diff --git a/company_admin/src/api/business/goods.js b/company_admin/src/api/business/goods.js
index 2f57596..d31232f 100644
--- a/company_admin/src/api/business/goods.js
+++ b/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
})
diff --git a/company_admin/src/components/business/OperaBrandWindow.vue b/company_admin/src/components/business/OperaBrandWindow.vue
index c9df637..99fbd46 100644
--- a/company_admin/src/components/business/OperaBrandWindow.vue
+++ b/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,
diff --git a/company_admin/src/components/business/OperaCategoryWindow.vue b/company_admin/src/components/business/OperaCategoryWindow.vue
index 89cde75..7b28532 100644
--- a/company_admin/src/components/business/OperaCategoryWindow.vue
+++ b/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
diff --git a/company_admin/src/components/business/selectProduct.vue b/company_admin/src/components/business/selectProduct.vue
index 8137bca..cdea603 100644
--- a/company_admin/src/components/business/selectProduct.vue
+++ b/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>
\ No newline at end of file
diff --git a/company_admin/src/components/business/selectProductItem.vue b/company_admin/src/components/business/selectProductItem.vue
index 50edba6..94f612e 100644
--- a/company_admin/src/components/business/selectProductItem.vue
+++ b/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
// 鑾峰彇鍒嗙被鍒楄〃
diff --git a/company_admin/src/plugins/download.js b/company_admin/src/plugins/download.js
index 87e98f0..39ba4c5 100644
--- a/company_admin/src/plugins/download.js
+++ b/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
// 褰撲笅杞芥帴鍙f病鏈夋垚鍔熻繑鍥炴祦骞朵笖鎺ュ彛杩斿洖鐨勬槸JSON鏃堕渶瑕佸鍝嶅簲娴佽繘琛岃В鏋愬苟鎻愮ず閿欒銆傦紙澶勭悊涓嬭浇鎺ュ彛鍑虹幇鏈煡寮傚父鐨勬儏鍐碉級
if (response.headers['content-type'] === 'application/json') {
const blob = new Blob([response.data])
diff --git a/company_admin/src/views/business/brand.vue b/company_admin/src/views/business/brand.vue
index cae7979..eb27ae8 100644
--- a/company_admin/src/views/business/brand.vue
+++ b/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)
}
diff --git a/company_admin/src/views/business/goods.vue b/company_admin/src/views/business/goods.vue
index 5998a93..869907a 100644
--- a/company_admin/src/views/business/goods.vue
+++ b/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>
diff --git a/company_admin/src/views/business/pageConfiguration.vue b/company_admin/src/views/business/pageConfiguration.vue
index 6c4a2a4..193fcfc 100644
--- a/company_admin/src/views/business/pageConfiguration.vue
+++ b/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">
--
Gitblit v1.9.3