feature/0423
wanghousheng 9 months ago
parent c9fa00edec
commit 685c66d19b
  1. 28
      src/views/goods/Create.vue
  2. 4
      src/views/server/Index.vue
  3. 16
      src/views/server/modules/Add.vue
  4. 22
      src/views/server/modules/Edit.vue

@ -36,7 +36,6 @@
:dropdownStyle="{ maxHeight: '500px', overflow: 'auto' }" :dropdownStyle="{ maxHeight: '500px', overflow: 'auto' }"
:treeData="formData.categoryList" :treeData="formData.categoryList"
treeCheckable treeCheckable
treeCheckStrictly
allowClear allowClear
v-decorator="['categorys', { rules: [{ required: true, message: '请至少选择1个商品分类' }] }]" v-decorator="['categorys', { rules: [{ required: true, message: '请至少选择1个商品分类' }] }]"
></a-tree-select> ></a-tree-select>
@ -377,7 +376,10 @@
<span>{{ province.name }}</span> <span>{{ province.name }}</span>
<template v-if="province.citys.length"> <template v-if="province.citys.length">
<span>(</span> <span>(</span>
<span class="city-name" v-for="(city, cidx) in province.citys" :key="cidx" <span
class="city-name"
v-for="(city, cidx) in province.citys"
:key="cidx"
>{{ city.name }}{{ province.citys.length > cidx + 1 ? '、' : '' }}</span >{{ city.name }}{{ province.citys.length > cidx + 1 ? '、' : '' }}</span
> >
<span>)</span> <span>)</span>
@ -534,7 +536,7 @@ import { AreasModal } from '@/components/Modal'
const defaultItem = { const defaultItem = {
key: 0, key: 0,
region: [], region: [],
region_text: [], region_text: []
} }
export default { export default {
components: { components: {
@ -544,7 +546,7 @@ export default {
Ueditor, Ueditor,
InputNumberGroup, InputNumberGroup,
MultiSpec, MultiSpec,
AreasModal, AreasModal
}, },
data () { data () {
return { return {
@ -570,11 +572,11 @@ export default {
title: '销售区域', title: '销售区域',
dataIndex: 'region_text', dataIndex: 'region_text',
width: '400px', width: '400px',
scopedSlots: { customRender: 'region_text' }, scopedSlots: { customRender: 'region_text' }
}, }
], ],
// //
citysCount: null, citysCount: null
} }
}, },
// //
@ -632,7 +634,7 @@ export default {
// //
const { const {
form: { validateFields }, form: { validateFields },
ruleList, ruleList
} = this } = this
validateFields((errors, values) => { validateFields((errors, values) => {
// tab // tab
@ -668,7 +670,7 @@ export default {
['goods_type', 'goods_name', 'categorys', 'imagesIds', 'delivery_id', 'is_ind_delivery_type', 'delivery_type'], ['goods_type', 'goods_name', 'categorys', 'imagesIds', 'delivery_id', 'is_ind_delivery_type', 'delivery_type'],
['spec_type', 'goods_price', 'is_restrict', 'restrict_total', 'restrict_single'], ['spec_type', 'goods_price', 'is_restrict', 'restrict_total', 'restrict_single'],
['content'], ['content'],
['alone_grade_equity', 'first_money', 'second_money', 'third_money'], ['alone_grade_equity', 'first_money', 'second_money', 'third_money']
] ]
const field = Object.keys(errors).shift() const field = Object.keys(errors).shift()
for (const key in tabsFieldsMap) { for (const key in tabsFieldsMap) {
@ -722,7 +724,7 @@ export default {
// //
handleAreaSubmit (result) { handleAreaSubmit (result) {
const { const {
custom: { scene, item }, custom: { scene, item }
} = result } = result
item.region = result.selectedCityIds item.region = result.selectedCityIds
item.region_text = result.selectedText item.region_text = result.selectedText
@ -755,10 +757,10 @@ export default {
onOk () { onOk () {
app.ruleList.splice(index, 1) app.ruleList.splice(index, 1)
modal.destroy() modal.destroy()
}, }
}) })
}, }
}, }
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>

@ -127,8 +127,8 @@ const columns = [
scopedSlots: { customRender: 'server_price' } scopedSlots: { customRender: 'server_price' }
}, },
{ {
title: '成本价', title: '划线价',
dataIndex: 'cost_price', dataIndex: 'line_price',
scopedSlots: { customRender: 'cost_price' } scopedSlots: { customRender: 'cost_price' }
}, },
{ {

@ -38,7 +38,7 @@
<a-input-number <a-input-number
:min="0.01" :min="0.01"
:precision="2" :precision="2"
v-decorator="['cost_price', { initialValue: 1, rules: [{ required: true, message: '请输入成本价' }] }]" v-decorator="['line_price', { initialValue: 1, rules: [{ required: true, message: '请输入划线价' }] }]"
/> />
<span class="ml-10"></span> <span class="ml-10"></span>
</a-form-item> </a-form-item>
@ -94,7 +94,7 @@ import { SelectImage, Ueditor } from '@/components'
export default { export default {
components: { components: {
SelectImage, SelectImage,
Ueditor, Ueditor
}, },
props: { props: {
// //
@ -106,18 +106,18 @@ export default {
title: '', title: '',
// //
labelCol: { labelCol: {
span: 7, span: 7
}, },
// //
wrapperCol: { wrapperCol: {
span: 13, span: 13
}, },
// modal() // modal()
visible: false, visible: false,
// modal() loading // modal() loading
confirmLoading: false, confirmLoading: false,
// //
form: this.$form.createForm(this), form: this.$form.createForm(this)
} }
}, },
methods: { methods: {
@ -141,7 +141,7 @@ export default {
e.preventDefault() e.preventDefault()
// //
const { const {
form: { validateFields }, form: { validateFields }
} = this } = this
validateFields((errors, values) => { validateFields((errors, values) => {
// api // api
@ -172,7 +172,7 @@ export default {
.finally((result) => { .finally((result) => {
this.confirmLoading = false this.confirmLoading = false
}) })
}, }
}, }
} }
</script> </script>

@ -34,11 +34,11 @@
/> />
<span class="ml-10"></span> <span class="ml-10"></span>
</a-form-item> </a-form-item>
<a-form-item label="成本价" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item label="划线价" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input-number <a-input-number
:min="0.01" :min="0.01"
:precision="2" :precision="2"
v-decorator="['cost_price', { initialValue: 1, rules: [{ required: true, message: '请输入成本价' }] }]" v-decorator="['line_price', { initialValue: 1, rules: [{ required: true, message: '请输入划线价' }] }]"
/> />
<span class="ml-10"></span> <span class="ml-10"></span>
</a-form-item> </a-form-item>
@ -94,7 +94,7 @@ import { SelectImage, Ueditor } from '@/components'
export default { export default {
components: { components: {
SelectImage, SelectImage,
Ueditor, Ueditor
}, },
props: { props: {
// //
@ -106,11 +106,11 @@ export default {
title: '', title: '',
// //
labelCol: { labelCol: {
span: 7, span: 7
}, },
// //
wrapperCol: { wrapperCol: {
span: 13, span: 13
}, },
// modal() // modal()
visible: false, visible: false,
@ -119,7 +119,7 @@ export default {
// //
form: this.$form.createForm(this), form: this.$form.createForm(this),
// //
record: {}, record: {}
} }
}, },
methods: { methods: {
@ -145,7 +145,7 @@ export default {
// //
setFieldsValue () { setFieldsValue () {
const { const {
form: { setFieldsValue }, form: { setFieldsValue }
} = this } = this
// //
this.$nextTick(() => { this.$nextTick(() => {
@ -161,7 +161,7 @@ export default {
'content', 'content',
'comment_rate', 'comment_rate',
'sold', 'sold',
'comment_num', 'comment_num'
]) ])
) )
}) })
@ -171,7 +171,7 @@ export default {
e.preventDefault() e.preventDefault()
// //
const { const {
form: { validateFields }, form: { validateFields }
} = this } = this
validateFields((errors, values) => { validateFields((errors, values) => {
// api // api
@ -202,7 +202,7 @@ export default {
.finally((result) => { .finally((result) => {
this.confirmLoading = false this.confirmLoading = false
}) })
}, }
}, }
} }
</script> </script>

Loading…
Cancel
Save