富文本回显

main
fanfan 9 months ago
parent 6ac14aeccb
commit 5971a9b182
  1. 6
      src/views/order/Detail.vue
  2. 41
      src/views/order/modules/RemarkForm.vue

@ -130,7 +130,9 @@
<span>{{ record.buyer_remark ? record.buyer_remark : '-' }}</span> <span>{{ record.buyer_remark ? record.buyer_remark : '-' }}</span>
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="商家备注"> <a-descriptions-item label="商家备注">
<span>{{ record.merchant_remark ? record.merchant_remark : '-' }}</span> <!-- <div v-html="record.merchant_remark" v-if="record.merchant_remark"></div> -->
<!-- <Ueditor v-if="record.merchant_remark" v-decorator="['record.merchant_remark']" /> -->
<span style="color: #d6893b;cursor: pointer;" @click="handleMerchantRemark">查看备注</span>
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item v-if="record.trade" label="第三方支付订单号"> <a-descriptions-item v-if="record.trade" label="第三方支付订单号">
<span>{{ record.trade ? record.trade.out_trade_no : '-' }}</span> <span>{{ record.trade ? record.trade.out_trade_no : '-' }}</span>
@ -374,6 +376,7 @@ import { inArray } from '@/utils/util'
import * as Api from '@/api/order' import * as Api from '@/api/order'
import { GoodsItem, UserItem } from '@/components/Table' import { GoodsItem, UserItem } from '@/components/Table'
import { DeliveryForm, ExtractForm, CancelForm, PrinterForm, PriceForm, RemarkForm } from './modules' import { DeliveryForm, ExtractForm, CancelForm, PrinterForm, PriceForm, RemarkForm } from './modules'
import { Ueditor} from '@/components'
import { import {
OrderTypeEnum, OrderTypeEnum,
DeliveryStatusEnum, DeliveryStatusEnum,
@ -429,6 +432,7 @@ export default {
PrinterForm, PrinterForm,
PriceForm, PriceForm,
RemarkForm, RemarkForm,
Ueditor
}, },
data() { data() {
return { return {

@ -17,7 +17,7 @@
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
extra="商家备注内容仅后台可见,用户端不可见" extra="商家备注内容仅后台可见,用户端不可见"
> >
<Ueditor v-decorator="['content']" /> <Ueditor v-decorator="['content']" />
</a-form-item> </a-form-item>
</a-form> </a-form>
</a-spin> </a-spin>
@ -30,9 +30,9 @@ import * as Api from '@/api/order/event'
import { Ueditor } from '@/components' import { Ueditor } from '@/components'
export default { export default {
components: { components: {
Ueditor Ueditor,
}, },
data () { data() {
return { return {
// //
title: '商家备注', title: '商家备注',
@ -47,15 +47,13 @@ export default {
// //
form: this.$form.createForm(this), form: this.$form.createForm(this),
// //
record: {} record: {},
} }
}, },
created () { created() {},
},
methods: { methods: {
// //
show (record) { show(record) {
// //
this.visible = true this.visible = true
// //
@ -65,18 +63,24 @@ export default {
}, },
// //
setFieldsValue () { setFieldsValue() {
const { record, $nextTick, form: { setFieldsValue } } = this const {
record,
$nextTick,
form: { setFieldsValue },
} = this
$nextTick(() => { $nextTick(() => {
setFieldsValue({ content: record.merchant_remark }) setFieldsValue({ content: record.merchant_remark })
}) })
}, },
// //
handleSubmit (e) { handleSubmit(e) {
e.preventDefault() e.preventDefault()
// //
const { form: { validateFields } } = this const {
form: { validateFields },
} = this
validateFields((errors, values) => { validateFields((errors, values) => {
// api // api
!errors && this.onFormSubmit(values) !errors && this.onFormSubmit(values)
@ -84,16 +88,16 @@ export default {
}, },
// //
handleCancel () { handleCancel() {
this.visible = false this.visible = false
this.form.resetFields() this.form.resetFields()
}, },
// api // api
onFormSubmit (values) { onFormSubmit(values) {
this.isLoading = true this.isLoading = true
Api.updateRemark({ orderId: this.record.order_id, form: values }) Api.updateRemark({ orderId: this.record.order_id, form: values })
.then(result => { .then((result) => {
// //
this.$message.success(result.message, 1.5) this.$message.success(result.message, 1.5)
// //
@ -101,9 +105,8 @@ export default {
// //
this.$emit('handleSubmit', values) this.$emit('handleSubmit', values)
}) })
.finally(() => this.isLoading = false) .finally(() => (this.isLoading = false))
} },
},
}
} }
</script> </script>

Loading…
Cancel
Save