Commit a33f2146 by 前端

更新again again again

1 parent a8a26ace
......@@ -250,5 +250,52 @@ export default {
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 {
searchFormData: [
{
label: '模板名称',
name: 'wechatName',
name: 'templateName',
type: 'input',
maxlength: 100
},
{
label: '所属渠道',
name: 'userPhone',
name: 'merchantName',
type: 'input',
maxlength: 100
}
],
getListApi: this.$apis.redenvelope.drawListApi,
getListApi: this.$apis.redenvelope.activeTmpManageList,
tableParams: {
listName: 'list',
listName: 'data',
tableOption: false,
tableColumns: [
{
label: '模板名称',
prop: 'userPhone',
prop: 'templateName',
minWidth: 100
},
{
label: '所属渠道',
prop: 'wechatName',
prop: 'merchantName',
minWidth: 100
},
{
label: '活动形式',
prop: 'link',
minWidth: 100
prop: 'activityType',
formatter: cell => {
return {0: '随机红包', 1: '九宫格', 2: '翻牌', 3: '大转盘'}[cell.activityType]
}
},
{
label: '创建时间',
minWidth: 100,
prop:'activityName'
prop:'createdTime'
}
]
},
......
......@@ -78,5 +78,5 @@ export default {
</script>
<style scoped lang='scss'>
//@import "../common/style.scss";
@import "../common/style.scss";
</style>
......@@ -26,8 +26,8 @@
<!-- 快递信息 -->
<div class="form-section">
<h3 class="section-title">核销信息</h3>
<el-form-item label="核销码" prop="logisticsNumber" :rules="[{ required: true, message: '核销码不能为空', trigger: 'blur' }]">
<el-input v-model="form.logisticsNumber"></el-input>
<el-form-item label="核销码" prop="cancelNumber" :rules="[{ required: true, message: '核销码不能为空', trigger: 'blur' }]">
<el-input v-model="form.cancelNumber"></el-input>
</el-form-item>
</div>
</el-form>
......@@ -52,15 +52,16 @@ export default {
size: 'small',
disabled: false,
form: {
logisticsCompany: '',
logisticsNumber: '',
cancelNumber: '',
}
}
},
methods:{
handleConfirm(){
this.validateForm().then(() => {
this.$emit('submit', this.form);
this.$emit('submit', {
...this.form,id:this.cancelObj.id
});
this.handleClose();
}).catch(error => {
this.$message.error(error.message);
......
......@@ -27,8 +27,8 @@
<el-form-item label="物流公司" prop="logisticsCompany" :rules="[{ required: true, message: '物流公司不能为空', trigger: 'blur' }]">
<el-input v-model="form.logisticsCompany"></el-input>
</el-form-item>
<el-form-item label="物流单号" prop="logisticsNumber" :rules="[{ required: true, message: '物流单号不能为空', trigger: 'blur' }]">
<el-input v-model="form.logisticsNumber"></el-input>
<el-form-item label="物流单号" prop="logisticsOrderNo" :rules="[{ required: true, message: '物流单号不能为空', trigger: 'blur' }]">
<el-input v-model="form.logisticsOrderNo"></el-input>
</el-form-item>
</div>
</el-form>
......@@ -56,13 +56,17 @@ export default {
type: String,
default: '50%'
},
goodsObj:{
type: Object,
default: () => {}
},
infoSections: Array // 传入的数据结构数组
},
data() {
return {
form: {
logisticsCompany: '',
logisticsNumber: '',
logisticsOrderNo: '',
}
};
},
......@@ -83,7 +87,7 @@ export default {
},
submitForm() {
this.validateForm().then(() => {
this.$emit('submit', this.form);
this.$emit('submit', {...this.form,...this.goodsObj});
this.closeDrawer();
}).catch(error => {
this.$message.error(error.message);
......
......@@ -105,7 +105,7 @@ export default {
{
label: '奖品名称',
minWidth: 100,
prop: 'activityName',
prop: 'prizeName',
},
{
label: '核销类型',
......@@ -167,18 +167,45 @@ export default {
return sectionIndex
},
// 列表发货处理
handleDeliverGoods(row) {
async handleDeliverGoods(row) {
await this.getExpressInfo(row)
this.goodsObj ={id:row.awardInfoId}
this.updateInfoSections(row, '基本信息');
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){
let basicInfoIndex = this.updateInfoSections(row, '基本信息');
this.cancelObj = {
show: true,
title: '核销',
id: row.id || '',
id: row.awardInfoId || '',
infoSections:[this.infoSections[basicInfoIndex]]
}
}
......
......@@ -45,9 +45,22 @@
<DeliverGoods :title="'发货'"
:visible.sync="isDrawerVisible"
:infoSections="infoSections"
:goodsObj = "goodsObj"
@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>
</template>
......@@ -66,6 +79,12 @@ export default {
},
data() {
return {
tipsObj:{
show:false,
text:'',
iconType:'el-icon-success'
},
goodsObj:{},
isDrawerVisible:false,
infoSections: [
{
......@@ -80,13 +99,13 @@ export default {
{
title: '收货信息',
items: [
{ label: '收件人', value: '张三' },
{ label: '联系电话', value: '0987654321' },
{ label: '身份证', value: '张三' },
{ label: '收货地址', value: '0987654321' },
{ label: '小区名称', value: '张三' },
{ label: '楼栋', value: '0987654321' },
{ label: '房号', value: '0987654321' }
{ label: '收件人', value: '',key:'activityName' },
{ label: '联系电话', value: '',key:'activityName' },
{ label: '身份证', value: '',key:'activityName' },
{ label: '收货地址', value: '',key:'activityName' },
{ label: '小区名称', value: '',key:'activityName' },
{ label: '楼栋', value: '',key:'activityName' },
{ label: '房号', value: '',key:'activityName' }
]
},
],
......@@ -96,15 +115,49 @@ export default {
mounted() {
},
methods: {
handleShipping(form) {
// 处理发货逻辑
console.log(form)
console.log('发起请求')
async handleOperation(form, operationType) {
const { id, logisticsOrderNo, logisticsCompany, cancelNumber } = form;
const params = operationType === 'shipping' ? {
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)
console.log('核销')
handleShipping(form) {
this.handleOperation(form, 'shipping');
},
handleCancel(form) {
this.handleOperation(form, 'cancel');
},
getParams() {
let params = JSON.parse(JSON.stringify(this.searchForm))
......@@ -117,4 +170,19 @@ export default {
<style scoped lang='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>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!