Commit a33f2146 by 前端

更新again again again

1 parent a8a26ace
...@@ -250,5 +250,52 @@ export default { ...@@ -250,5 +250,52 @@ export default {
data: params data: params
}) })
}, },
// 快递到家地址信息查询
queryExpressInformation(params){
params.method = 'marketing.api.self.red.envelope.customer.write.detail.query'
return http({
url,
data: params
})
},
// 新建活动模板
newActivityTemplate(params){
params.method = 'marketing.api.self.red.envelope.template.save'
return http({
url,
data: params,
returnAll:true
})
},
// 快递到家地址信息配置列表
expressConfigList(params){
params.method = 'marketing.api.self.red.envelope.customer.write.config.list'
return http({
url,
data: params
})
},
// 活动模板管理列表、
activeTmpManageList(params){
params.method = 'marketing.api.self.red.envelope.template.page'
return http({
url,
data: params
})
},
// 商品核销发货
goodsAreWrittenOffAndShipped(params){
params.method = 'marketing.api.self.red.envelope.send.out.goods'
return http({
url,
data: params,
returnAll:true
})
}
} }
<template>
<div>
<div id="div-demo"></div>
</div>
</template>
<script>
import E from 'wangeditor'
export default {
name: 'textBox',
data() {
return {
editor: '',
content: '',
editorOption: {}
}
},
props: {
excludeMenus: {
type: Array,
default: () => ['code']
},
boxHeight:{
type: Number,
default: 240
}
},
mounted() {
this.getEdit()
},
methods: {
handleEditorClick(e) {
const target = e.target;
console.log(target.nodeName)
if (target.nodeName === 'VIDEO') {
// 视频被点击,移动光标到视频后面
// const range = document.createRange();
// const selection = window.getSelection();
// range.setStartAfter(target); // 设置范围的起点为视频元素之后
// range.collapse(true); // 折叠范围
// selection.removeAllRanges(); // 清除所有范围
// selection.addRange(range); // 添加新范围
}
},
getEdit() {
const _this = this
this.editor = new E('#div-demo')
this.editor.config.uploadImgShowBase64 = true
this.editor.config.showMenuTooltips = true
this.editor.config.menuTooltipPosition = 'down'
this.editor.config.height = this.boxHeight
this.editor.config.width = 500
this.editor.config.excludeMenus = this.excludeMenus
this.editor.config.pasteIgnoreImg = true
// this.editor.config.uploadImgHooks = {
// before: (xhr, editer, files) => {
// if(files[0].name === 'image.png') {
// return {
// prevent: true,
// msg: '请您将截图以上传图片的方式显示在文本框中!'
// }
// }
// }
// }
this.editor.config.onchange = html => {
// console.log(html);
this.content = html // 绑定当前逐渐地值
this.$emit('change', this.content) // 将内容同步到父组件中
}
this.editor.config.onfocus = () => {
this.$emit('focus')
}
// 上传图片
this.editor.config.customUploadImg = function(resultFiles, insertImgFn) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
_this.$message.error('上传图片大小不能超过' + limitSize + 'MB!')
return true
}
reader.readAsDataURL(file)
reader.onload = e => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
_this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
// console.log(res)
insertImgFn(res)
}
})
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
// 上传图片,返回结果,将图片插入到编辑器中
}
}
// 上传视频
this.editor.config.customUploadVideo = function(resultFiles, insertVideoFn) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
_this.$message.error('上传视频大小不能超过' + limitSize + 'MB!')
return true
}
reader.readAsDataURL(file)
reader.onload = e => {
const videoFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + videoFile.split(',')[1]
_this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
// console.log(res)
insertVideoFn(res)
}
})
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
// 上传图片,返回结果,将图片插入到编辑器中
}
}
this.editor.config.onchangeTimeout = 5000
this.editor.create()
// 绑定点击事件处理器
this.editor.$textElem.on('click', this.handleEditorClick)
},
setEdit(html) {
this.$nextTick(() => {
this.editor.txt.html(html)
})
},
forbidEdit() {
// this.editor.$textElem.attr('contenteditable', false)
this.editor.disable()
}
}
}
</script>
<style lang="scss" scoped>
#div-demo {
// margin: 16px 300px 0 0;
}
.el-form .editor {
margin-top: 20px;
}
.myQuillEditor {
background-color: #fff;
height: 200px;
}
</style>
<style>
.w-e-text-container {
z-index: 1 !important;
}
.w-e-toolbar {
z-index: 2 !important;
}
</style>
...@@ -13,41 +13,43 @@ export default { ...@@ -13,41 +13,43 @@ export default {
searchFormData: [ searchFormData: [
{ {
label: '模板名称', label: '模板名称',
name: 'wechatName', name: 'templateName',
type: 'input', type: 'input',
maxlength: 100 maxlength: 100
}, },
{ {
label: '所属渠道', label: '所属渠道',
name: 'userPhone', name: 'merchantName',
type: 'input', type: 'input',
maxlength: 100 maxlength: 100
} }
], ],
getListApi: this.$apis.redenvelope.drawListApi, getListApi: this.$apis.redenvelope.activeTmpManageList,
tableParams: { tableParams: {
listName: 'list', listName: 'data',
tableOption: false, tableOption: false,
tableColumns: [ tableColumns: [
{ {
label: '模板名称', label: '模板名称',
prop: 'userPhone', prop: 'templateName',
minWidth: 100 minWidth: 100
}, },
{ {
label: '所属渠道', label: '所属渠道',
prop: 'wechatName', prop: 'merchantName',
minWidth: 100 minWidth: 100
}, },
{ {
label: '活动形式', label: '活动形式',
prop: 'link', prop: 'activityType',
minWidth: 100 formatter: cell => {
return {0: '随机红包', 1: '九宫格', 2: '翻牌', 3: '大转盘'}[cell.activityType]
}
}, },
{ {
label: '创建时间', label: '创建时间',
minWidth: 100, minWidth: 100,
prop:'activityName' prop:'createdTime'
} }
] ]
}, },
......
...@@ -78,5 +78,5 @@ export default { ...@@ -78,5 +78,5 @@ export default {
</script> </script>
<style scoped lang='scss'> <style scoped lang='scss'>
//@import "../common/style.scss"; @import "../common/style.scss";
</style> </style>
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
<!-- 快递信息 --> <!-- 快递信息 -->
<div class="form-section"> <div class="form-section">
<h3 class="section-title">核销信息</h3> <h3 class="section-title">核销信息</h3>
<el-form-item label="核销码" prop="logisticsNumber" :rules="[{ required: true, message: '核销码不能为空', trigger: 'blur' }]"> <el-form-item label="核销码" prop="cancelNumber" :rules="[{ required: true, message: '核销码不能为空', trigger: 'blur' }]">
<el-input v-model="form.logisticsNumber"></el-input> <el-input v-model="form.cancelNumber"></el-input>
</el-form-item> </el-form-item>
</div> </div>
</el-form> </el-form>
...@@ -52,15 +52,16 @@ export default { ...@@ -52,15 +52,16 @@ export default {
size: 'small', size: 'small',
disabled: false, disabled: false,
form: { form: {
logisticsCompany: '', cancelNumber: '',
logisticsNumber: '',
} }
} }
}, },
methods:{ methods:{
handleConfirm(){ handleConfirm(){
this.validateForm().then(() => { this.validateForm().then(() => {
this.$emit('submit', this.form); this.$emit('submit', {
...this.form,id:this.cancelObj.id
});
this.handleClose(); this.handleClose();
}).catch(error => { }).catch(error => {
this.$message.error(error.message); this.$message.error(error.message);
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
<el-form-item label="物流公司" prop="logisticsCompany" :rules="[{ required: true, message: '物流公司不能为空', trigger: 'blur' }]"> <el-form-item label="物流公司" prop="logisticsCompany" :rules="[{ required: true, message: '物流公司不能为空', trigger: 'blur' }]">
<el-input v-model="form.logisticsCompany"></el-input> <el-input v-model="form.logisticsCompany"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="物流单号" prop="logisticsNumber" :rules="[{ required: true, message: '物流单号不能为空', trigger: 'blur' }]"> <el-form-item label="物流单号" prop="logisticsOrderNo" :rules="[{ required: true, message: '物流单号不能为空', trigger: 'blur' }]">
<el-input v-model="form.logisticsNumber"></el-input> <el-input v-model="form.logisticsOrderNo"></el-input>
</el-form-item> </el-form-item>
</div> </div>
</el-form> </el-form>
...@@ -56,13 +56,17 @@ export default { ...@@ -56,13 +56,17 @@ export default {
type: String, type: String,
default: '50%' default: '50%'
}, },
goodsObj:{
type: Object,
default: () => {}
},
infoSections: Array // 传入的数据结构数组 infoSections: Array // 传入的数据结构数组
}, },
data() { data() {
return { return {
form: { form: {
logisticsCompany: '', logisticsCompany: '',
logisticsNumber: '', logisticsOrderNo: '',
} }
}; };
}, },
...@@ -83,7 +87,7 @@ export default { ...@@ -83,7 +87,7 @@ export default {
}, },
submitForm() { submitForm() {
this.validateForm().then(() => { this.validateForm().then(() => {
this.$emit('submit', this.form); this.$emit('submit', {...this.form,...this.goodsObj});
this.closeDrawer(); this.closeDrawer();
}).catch(error => { }).catch(error => {
this.$message.error(error.message); this.$message.error(error.message);
......
...@@ -105,7 +105,7 @@ export default { ...@@ -105,7 +105,7 @@ export default {
{ {
label: '奖品名称', label: '奖品名称',
minWidth: 100, minWidth: 100,
prop: 'activityName', prop: 'prizeName',
}, },
{ {
label: '核销类型', label: '核销类型',
...@@ -167,18 +167,45 @@ export default { ...@@ -167,18 +167,45 @@ export default {
return sectionIndex return sectionIndex
}, },
// 列表发货处理 // 列表发货处理
handleDeliverGoods(row) { async handleDeliverGoods(row) {
await this.getExpressInfo(row)
this.goodsObj ={id:row.awardInfoId}
this.updateInfoSections(row, '基本信息'); this.updateInfoSections(row, '基本信息');
this.isDrawerVisible = true; this.isDrawerVisible = true;
}, },
// 通过接口获取快递到家信息
async getExpressInfo(row) {
try {
const receiveGoodsIndex = this.infoSections.findIndex(item => item.title === '收货信息');
if (receiveGoodsIndex === -1) {
// 如果找不到收货信息的索引,可能需要处理或提示
return;
}
const params = { awardInfoId: row.awardInfoId };
const res = await this.$apis.redenvelope.queryExpressInformation(params);
res.writeDetailList.forEach(expressItem => {
const infoItem = this.infoSections[receiveGoodsIndex].items.find(info => info.label === expressItem.describeMsg);
if (infoItem) {
infoItem.value = expressItem.detail;
}
});
} catch (error) {
// 异常处理逻辑,例如显示错误消息
this.$message.error('获取快递信息失败');
}
},
// 列表核销处理 // 列表核销处理
cancelAfterVerification(row){ cancelAfterVerification(row){
let basicInfoIndex = this.updateInfoSections(row, '基本信息'); let basicInfoIndex = this.updateInfoSections(row, '基本信息');
this.cancelObj = { this.cancelObj = {
show: true, show: true,
title: '核销', title: '核销',
id: row.id || '', id: row.awardInfoId || '',
infoSections:[this.infoSections[basicInfoIndex]] infoSections:[this.infoSections[basicInfoIndex]]
} }
} }
......
...@@ -45,9 +45,22 @@ ...@@ -45,9 +45,22 @@
<DeliverGoods :title="'发货'" <DeliverGoods :title="'发货'"
:visible.sync="isDrawerVisible" :visible.sync="isDrawerVisible"
:infoSections="infoSections" :infoSections="infoSections"
:goodsObj = "goodsObj"
@submit="handleShipping"></DeliverGoods> @submit="handleShipping"></DeliverGoods>
<CancelAfterVerification :cancelObj.sync="cancelObj" @submit="handleCancel"></CancelAfterVerification> <CancelAfterVerification ref="afterVerification" :cancelObj.sync="cancelObj" @submit="handleCancel"></CancelAfterVerification>
<GLDialog
title="提示"
:has-footer="false"
:visible.sync="tipsObj.show"
mode="small"
>
<template #default>
<div class="over-box">
<div :class="tipsObj.iconType"></div>
<div class="tips">{{ tipsObj.text }}</div>
</div>
</template>
</GLDialog>
</div> </div>
</template> </template>
...@@ -66,6 +79,12 @@ export default { ...@@ -66,6 +79,12 @@ export default {
}, },
data() { data() {
return { return {
tipsObj:{
show:false,
text:'',
iconType:'el-icon-success'
},
goodsObj:{},
isDrawerVisible:false, isDrawerVisible:false,
infoSections: [ infoSections: [
{ {
...@@ -80,13 +99,13 @@ export default { ...@@ -80,13 +99,13 @@ export default {
{ {
title: '收货信息', title: '收货信息',
items: [ items: [
{ label: '收件人', value: '张三' }, { label: '收件人', value: '',key:'activityName' },
{ label: '联系电话', value: '0987654321' }, { label: '联系电话', value: '',key:'activityName' },
{ label: '身份证', value: '张三' }, { label: '身份证', value: '',key:'activityName' },
{ label: '收货地址', value: '0987654321' }, { label: '收货地址', value: '',key:'activityName' },
{ label: '小区名称', value: '张三' }, { label: '小区名称', value: '',key:'activityName' },
{ label: '楼栋', value: '0987654321' }, { label: '楼栋', value: '',key:'activityName' },
{ label: '房号', value: '0987654321' } { label: '房号', value: '',key:'activityName' }
] ]
}, },
], ],
...@@ -96,15 +115,49 @@ export default { ...@@ -96,15 +115,49 @@ export default {
mounted() { mounted() {
}, },
methods: { methods: {
handleShipping(form) { async handleOperation(form, operationType) {
// 处理发货逻辑 const { id, logisticsOrderNo, logisticsCompany, cancelNumber } = form;
console.log(form) const params = operationType === 'shipping' ? {
console.log('发起请求') awardInfoId: id,
logisticsOrderNo,
logisticsCompany
} : {
awardInfoId: id,
code: cancelNumber
};
try {
const res = await this.$apis.redenvelope.goodsAreWrittenOffAndShipped(params);
if (res.code == 0 && res.data == true) {
this.tipsObj = {
show:true,
iconType:'el-icon-success',
text: operationType === 'shipping' ? '发货成功' : '核销成功'
}
if (operationType === 'shipping') {
this.isDrawerVisible = false;
} else {
this.$refs.afterVerification.handleClose();
}
this.handleSearch();
} else {
this.tipsObj = {
show:true,
iconType:'el-icon-error',
text: res.message
}
}
} catch (error) {
this.$message.error('操作失败');
}
}, },
handleCancel(form){
console.log(form) handleShipping(form) {
console.log('核销') this.handleOperation(form, 'shipping');
},
handleCancel(form) {
this.handleOperation(form, 'cancel');
}, },
getParams() { getParams() {
let params = JSON.parse(JSON.stringify(this.searchForm)) let params = JSON.parse(JSON.stringify(this.searchForm))
...@@ -117,4 +170,19 @@ export default { ...@@ -117,4 +170,19 @@ export default {
<style scoped lang='scss'> <style scoped lang='scss'>
@import "../common/style.scss"; @import "../common/style.scss";
.over-box{
.el-icon-success {
font-size: 48px;
color: #67c23a;
}
.el-icon-error {
font-size: 48px;
color: #EB4E4E;
}
.tips{
color: #333333;
font-size: 16px;
font-weight: 600;
}
}
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!