main
王文龙 2024-03-11 16:39:52 +08:00
parent 1d1d04d05d
commit 8928c7ac07
3 changed files with 60 additions and 20 deletions

View File

@ -277,6 +277,7 @@ export default {
_renderRichTextArr(item) { _renderRichTextArr(item) {
const { value, editorModules } = this const { value, editorModules } = this
const { key, disabled = false, options } = item const { key, disabled = false, options } = item
const length = value[key].length
const removeItem = (index) => { const removeItem = (index) => {
value[key].splice(index, 1) value[key].splice(index, 1)
// this.$set(this.value, key, richArr) // this.$set(this.value, key, richArr)
@ -285,6 +286,16 @@ export default {
value[key].push({ title: '', content: '' }) value[key].push({ title: '', content: '' })
// this.$set(this.value, key, richArr) // this.$set(this.value, key, richArr)
} }
const handlerMove = (index, type) => {
const _item = value[key][index]
if (type === 'up') {
value[key].splice(index, 1)
value[key].splice(index - 1, 0, _item)
} else {
value[key].splice(index, 1)
value[key].splice(index + 1, 0, _item)
}
}
return ( return (
<div> <div>
{value[key].map((item, index) => ( {value[key].map((item, index) => (
@ -304,22 +315,42 @@ export default {
</div> </div>
<SpRichText v-model={item.content} /> <SpRichText v-model={item.content} />
</div> </div>
<el-popconfirm <div style='display: flex;flex-direction:column;juctify-content:center;padding: 0px 20px; margin-left: 50px;'>
confirm-button-type='danger' {index !== 0 && (
confirm-button-text='删除' <el-tooltip class='item' effect='dark' content='向上移动' placement='top'>
cancel-button-text='取消' <i
icon='el-icon-info' class='el-icon-top'
icon-color='red' style='font-size: 30px; color: #000;margin-bottom: 10px'
onConfirm={() => removeItem(index)} onClick={() => handlerMove(index, 'up')}
title='确认删除当前项?' />
> </el-tooltip>
<div )}
slot='reference' <el-popconfirm
class='iconfont icon-trash-alt1' confirm-button-type='danger'
// onClick={() => removeItem(index)} confirm-button-text='删除'
style='font-size: 30px;padding: 0px 20px; margin-left: 50px; color: #F56C6C;' cancel-button-text='取消'
/> icon='el-icon-info'
</el-popconfirm> icon-color='red'
onConfirm={() => removeItem(index)}
title='确认删除当前项?'
>
<div
slot='reference'
class='iconfont icon-trash-alt1'
// onClick={() => removeItem(index)}
style='font-size: 30px; color: #F56C6C;'
/>
</el-popconfirm>
{index < length - 1 && (
<el-tooltip class='item' effect='dark' content='向下移动' placement='bottom'>
<i
class='el-icon-bottom'
style='font-size: 30px; color: #000;margin-top: 10px'
onClick={() => handlerMove(index, 'down')}
/>
</el-tooltip>
)}
</div>
</div> </div>
))} ))}
<el-button type='warning' size='small' onClick={addItem} style='margin:20px 0 0 20px;'> <el-button type='warning' size='small' onClick={addItem} style='margin:20px 0 0 20px;'>

View File

@ -179,7 +179,7 @@
:name="item.value" :name="item.value"
/> />
<el-table v-loading="loading" border :data="tableList"> <el-table v-loading="loading" border :data="tableList">
<el-table-column width="220" prop="order_id" label="订单信息"> <el-table-column width="200" prop="order_id" label="订单信息">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="order-num"> <div class="order-num">
{{ scope.row.order_id }} {{ scope.row.order_id }}
@ -205,13 +205,17 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="100" label="商品货号">
<template slot-scope="{ row }">
<p v-for="item in row.items">{{ item.item_bn }}</p>
</template>
</el-table-column>
<el-table-column prop="total_fee" width="120" label="订单金额(¥)"> <el-table-column prop="total_fee" width="120" label="订单金额(¥)">
<template slot-scope="scope"> <template slot-scope="scope">
{{ (scope.row.total_fee / 100).toFixed(2) }} {{ (scope.row.total_fee / 100).toFixed(2) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="100" label="运费(¥)"> <el-table-column width="0" label="运费(¥)">
<template slot-scope="scope"> <template slot-scope="scope">
{{ (scope.row.freight_fee || 0) / 100 }} {{ (scope.row.freight_fee || 0) / 100 }}
</template> </template>

View File

@ -75,11 +75,16 @@
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="item_spec_desc" label="规格"> <el-table-column prop="item_spec_desc" width="120" label="规格">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.item_spec_desc ? scope.row.item_spec_desc : '单规格' }} {{ scope.row.item_spec_desc ? scope.row.item_spec_desc : '单规格' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="item_spec_desc" width="100" label="商品货号">
<template slot-scope="{ row }">
<p>{{ row.item_bn }}</p>
</template>
</el-table-column>
<el-table-column prop="price" label="单价(¥)" width="100"> <el-table-column prop="price" label="单价(¥)" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
{{ (scope.row.price / 100).toFixed(2) }} {{ (scope.row.price / 100).toFixed(2) }}