商户分类

master
fanfan 8 months ago
parent 9ba3f0f03e
commit 27f476f734
  1. 23
      src/api/shop/index.js
  2. 2
      src/common/model/goods/MultiSpec.js
  3. 6
      src/config/router.config.js
  4. 4
      src/views/goods/Copy.vue
  5. 2
      src/views/goods/Create.vue
  6. 8
      src/views/goods/Index.vue
  7. 2
      src/views/goods/Update.vue
  8. 4
      src/views/goods/distributionPrice/Index.vue
  9. 2
      src/views/goods/memberPrice/Index.vue
  10. 4
      src/views/goods/modules/MultiSpec.vue
  11. 2
      src/views/goods/modules/Update.vue
  12. 2
      src/views/server/modules/Add.vue
  13. 243
      src/views/shop/classification.vue

@ -9,7 +9,28 @@ const api = {
shopDetail: '/merchant/detail',
getUser: '/merchant/userinfo'
}
/**
* 商户分类新增
* @param {*} data
*/
export function setMerchantGoodsCate(data) {
return axios({
url: 'merchant/setMerchantGoodsCate',
method: 'post',
data
})
}
/**
* 商户分类获取
* @param {*} data
*/
export function getMerchantGoodsCate(data) {
return axios({
url: 'merchant/getMerchantGoodsCate',
method: 'post',
data
})
}
/**
* 商户列表
* @param {*} params

@ -30,7 +30,7 @@ const defaultColumns = [
scopedSlots: { customRender: 'goods_price' }
},
{
title: '成本价',
title: '行情价',
dataIndex: 'cost_price',
width: 120,
scopedSlots: { customRender: 'cost_price' }

@ -240,6 +240,12 @@ export const asyncRouterMap = [
component: () => import(/* webpackChunkName: "server" */ '@/views/shop/Index'),
meta: { title: '商户管理', keepAlive: false, permission: ['/shop/index'] },
},
{
path: '/shop/classification',
moduleKey: 'merchant-manage',
component: () => import(/* webpackChunkName: "server" */ '@/views/shop/classification'),
meta: { title: '商户分类', keepAlive: false, permission: ['/shop/classification'] },
},
],
},
// 商品管理

@ -154,10 +154,10 @@
<span class="ml-10"></span>
</a-form-item>
<a-form-item
label="成本价"
label="行情价"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
extra="成本价仅用于商品页展示"
extra="行情价仅用于商品页展示"
>
<a-input-number :min="0" :precision="2" v-decorator="['cost_price']" />
<span class="ml-10"></span>

@ -160,7 +160,7 @@
]" />
<span class="ml-10"></span>
</a-form-item>
<a-form-item label="成本价" :labelCol="labelCol" :wrapperCol="wrapperCol" extra="成本价仅用于商品页展示">
<a-form-item label="行情价" :labelCol="labelCol" :wrapperCol="wrapperCol" extra="行情价仅用于商品页展示">
<a-input-number :min="0" :precision="2" v-decorator="['cost_price']" />
<span class="ml-10"></span>
</a-form-item>

@ -232,7 +232,7 @@ const columns = [
sorter: true,
},
{
title: '成本价',
title: '行情价',
width: '80px',
dataIndex: 'cost_price_min',
scopedSlots: { customRender: 'cost_price_min' },
@ -301,6 +301,12 @@ const columns = [
dataIndex: 'sort',
sorter: true,
},
{
title: '更新时间',
width: '150px',
dataIndex: 'update_time',
sorter: true,
},
{
title: '添加时间',
width: '150px',

@ -222,7 +222,7 @@
/>
<span class="ml-10"></span>
</a-form-item>
<a-form-item label="成本价" :labelCol="labelCol" :wrapperCol="wrapperCol" extra="成本价仅用于商品页展示">
<a-form-item label="行情价" :labelCol="labelCol" :wrapperCol="wrapperCol" extra="行情价仅用于商品页展示">
<a-input-number :min="0.01" :precision="2" v-decorator="['cost_price']" />
<span class="ml-10"></span>
</a-form-item>

@ -11,8 +11,8 @@
<span>利润空间()</span>
</div>
<div class="ruleText"><span class="ruleTitle">分销说明</span>A.当加价率生效后分销价高于市场价分销价统一自动按以下标准执行
市场价-成本x_____% +成本=分销价 _____%为此时的加价率
B.当加价率生效后分销价高于会员价分销价进一步统一自动按以下标准执行会员价-成本x_____% +成本=分销价 _____%为此时的加价率</div>
市场价-行情x_____% +行情=分销价 _____%为此时的加价率
B.当加价率生效后分销价高于会员价分销价进一步统一自动按以下标准执行会员价-行情x_____% +行情=分销价 _____%为此时的加价率</div>
</a-form-item>
<a-form-item v-bind="formItemLayoutWithOutLabel">
<div style="width: 100%;">

@ -11,7 +11,7 @@
<span>利润空间()</span>
</div>
<div class="ruleText"><span class="ruleTitle">会员说明</span>A.当加价率生效后会员价高于市场价会员价统一自动按以下标准执行
市场价-成本x_____% +成本=会员价 _____%为此时的加价率</div>
市场价-行情x_____% +行情=会员价 _____%为此时的加价率</div>
</a-form-item>
<a-form-item v-bind="formItemLayoutWithOutLabel">
<div style="width: 100%;">

@ -61,7 +61,7 @@
/>
<a-input-number
v-model="multiSpecData.skuBatchForm.cost_price"
placeholder="成本价"
placeholder="行情价"
:min="0"
:precision="2"
/>
@ -101,7 +101,7 @@
<template slot="goods_price" slot-scope="text, item">
{{ item.goods_price }}
</template>
<!-- 成本 -->
<!-- 行情 -->
<template slot="cost_price" slot-scope="text, item">
{{ item.cost_price }}
</template>

@ -160,7 +160,7 @@
<a-input-number :min="0.01" :precision="2" v-decorator="['goods_price', { rules: [{ required: true, message: '请输入商品价格' }] }]" />
<span class="ml-10"></span>
</a-form-item>
<a-form-item label="成本价" :labelCol="labelCol" :wrapperCol="wrapperCol" extra="成本价仅用于商品页展示">
<a-form-item label="行情价" :labelCol="labelCol" :wrapperCol="wrapperCol" extra="行情价仅用于商品页展示">
<a-input-number :min="0.01" :precision="2" v-decorator="['cost_price']" />
<span class="ml-10"></span>
</a-form-item>

@ -34,7 +34,7 @@
/>
<span class="ml-10"></span>
</a-form-item>
<a-form-item label="成本价" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-form-item label="行情价" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input-number
:min="0.01"
:precision="2"

@ -0,0 +1,243 @@
<template>
<a-card :bordered="false">
<div class="card-title">{{ $route.meta.title }}</div>
<a-spin :spinning="isLoading">
<a-form :form="form" @submit="handleSubmit">
<a-form-item label="商户分类" :labelCol="labelCol" required>
<a-tree-select
style="width: 500px; margin-right: 8px; margin-top: 3px"
placeholder="请选择商户分类"
:dropdownStyle="{ maxHeight: '500px', overflow: 'auto' }"
:treeData="formData.categoryList"
treeCheckable
allowClear
treeCheckStrictly
v-decorator="[`category`]"
></a-tree-select>
</a-form-item>
<a-form-item :wrapperCol="{ span: wrapperCol.span, offset: labelCol.span }">
<a-button type="primary" html-type="submit">提交</a-button>
</a-form-item>
</a-form>
</a-spin>
</a-card>
</template>
<script>
import pick from 'lodash.pick'
import * as Api from '@/api/shop'
import GoodsModel from '@/common/model/goods/Index'
import { isEmpty } from '@/utils/util'
export default {
data() {
return {
//
labelCol: { span: 3 },
//
wrapperCol: { span: 10 },
// loading
isLoading: false,
//
form: this.$form.createForm(this),
//
formData: GoodsModel.formData,
record: {},
}
},
//
created() {
this.isLoading = true
// form
GoodsModel.getFromData().then(() => {
this.isLoading = false
})
this.form.getFieldDecorator('category', { initialValue: [], preserve: true })
this.getDetail()
},
methods: {
//
setFieldsValue() {
const { record, form, $nextTick } = this
record[`goods_cate`] = this.formatCategoryIds(record.goods_cate.split(','))
//
!isEmpty(form.getFieldsValue()) &&
$nextTick(() => {
form.setFieldsValue({
category: record.goods_cate,
})
this.$forceUpdate()
})
},
formatCategoryIds(categoryIds) {
return categoryIds.map((id) => {
return { value: id }
})
},
//
getDetail() {
this.isLoading = true
Api.getMerchantGoodsCate()
.then((result) => {
this.record = result.data.merchant
//
if (result.data.merchant) {
this.setFieldsValue()
}
})
.finally(() => (this.isLoading = false))
},
//
handleSubmit(e) {
e.preventDefault()
//
const {
form: { validateFields },
onFormSubmit,
} = this
validateFields((errors, values) => {
!errors && onFormSubmit(values)
})
},
// api
onFormSubmit(values) {
let ids = []
if (values.category.length > 0) {
values.category.forEach((item) => {
ids.push(item.value)
})
}
console.log(values, ids.join(','))
this.isLoading = true
Api.setMerchantGoodsCate({ form: { goods_cate: ids.length > 0 ? ids.join(',') : '' } })
.then((result) => {
//
this.$message.success(result.message, 1.5)
this.getDetail()
})
.catch(() => {
this.isLoading = false
})
.finally(() => (this.isLoading = false))
},
},
}
</script>
<style lang="less" scoped>
.msg {
width: 100%;
background: #ffe7e7;
border-radius: 0px 0px 0px 0px;
opacity: 1;
padding: 5px 25px;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 16px;
span {
width: 33%;
text-align: center;
}
}
/deep/.ant-form-item-control {
padding-left: 10px;
.ant-form-item-control {
padding-left: 0;
}
}
/deep/.ant-input-prefix {
font-weight: bold;
}
/deep/.ant-col-10 {
width: 80%;
}
.fan {
display: flex;
align-items: top;
}
.fan /deep/ .ant-form-item {
margin-bottom: 0;
}
.fen {
span {
color: #555;
width: 80px;
}
.input {
background-color: #fff;
border: 1px solid #d9d9d9;
height: 32px;
width: 180px;
margin-top: 10px;
padding-left: 10px;
}
input::-webkit-input-placeholder {
//
color: #bfbfbf;
}
input:-moz-placeholder {
//
color: #bfbfbf;
}
input:-ms-input-placeholder {
// ie
color: #bfbfbf;
}
}
.setRule {
margin-top: 20px;
}
.ruleTitle {
font-size: 14px;
font-family: PingFang SC, PingFang SC;
font-weight: 500;
color: #303030;
}
.ruleText {
margin-top: 8px;
font-size: 14px;
font-family: PingFang SC, PingFang SC;
font-weight: 400;
color: #8b8b8b;
line-height: 32px;
}
.inMax {
width: 100%;
text-align: center;
position: relative;
padding: 0;
font-variant: tabular-nums;
list-style: none;
display: inline-block;
width: 100%;
height: 32px;
padding: 0 26px 0 0;
color: rgba(0, 0, 0, 0.65);
font-size: 13px;
line-height: 32px;
background-color: #fff;
background-image: none;
border: 1px solid #d9d9d9;
border-radius: 2px;
-webkit-transition: all 0.3s;
transition: all 0.3s;
input {
border: none;
width: 45%;
margin: 0;
height: 100%;
text-align: center;
}
input:focus {
outline: none;
border: none;
}
input::-webkit-input-placeholder {
color: #bfbfbf;
}
.yuan {
position: absolute;
right: 10px;
top: 0px;
}
}
</style>
Loading…
Cancel
Save