修改问题

master
sunzehua 2 years ago
parent b64698e58c
commit 6b2069a992

@ -21,23 +21,34 @@
class="iconfont icon-zhoubao bg-icon"
v-else-if="index == 1"
></span>
<span
class="iconfont icon-daibanshixiang bg-icon"
v-else-if="index == 2"
></span>
</div>
<div class="right">
<el-row :gutter="10">
<el-col :xs="24" :sm="8" :md="24" :lg="8">
<div class="date" v-if="item.isBook">
订阅结束日期{{ timeTrans(item.endTime, 1) }}
<div class="date">
<template v-if="item.isBook"
>订阅结束日期{{
timeTrans(item.endTime, 1)
}}</template
>
</div>
</el-col>
<el-col :xs="24" :sm="16" :md="24" :lg="16" class="btn-box">
<button class="noselect" @click="showModelEmail(index,item)">
<button
class="noselect"
@click="showModelEmail(index, item)"
>
邮件样例
</button>
<button class="noselect" @click="subscribe(item)">
<template v-if="!item.isBook"></template>
<template v-else></template>
</button>
<button class="noselect" @click="showModelSet(index,item)">
<button class="noselect" @click="showModelSet(index, item)">
设置
</button>
</el-col>
@ -52,7 +63,7 @@
<!-- ====== 弹窗 ======= -->
<el-dialog
:title="`${dialogType == 'weekly' ? `销售欠费周报` : `票结未开票`} - 设置`"
:title="`${dialogData.title} - 设置`"
:visible.sync="dialogVisible"
:before-close="handleClose"
>
@ -81,7 +92,18 @@
<span>最多输入三个邮箱地址邮箱地址用逗号或者分号隔开即可</span>
</div>
<div class="time-box">
<div class="time" v-if="dialogType == 'weekly'">
<div
class="time"
v-if="
[
'weekly',
'overtimeWeekly',
'uninvoiced',
'checked',
'arrears'
].includes(dialogType)
"
>
<div class="tip sec-tip">{{ dialogData.remindTip }}</div>
<!-- <el-dropdown @command="handleCommand">
@ -102,23 +124,47 @@
v-model="dialogData.remindTDayArr"
multiple
collapse-tags
style="margin-left: 20px;"
style="margin-left: 20px; width: 150px"
size="small"
placeholder="请选择">
placeholder="请选择星期"
>
<el-option
v-for="day in dialogData.remindTDayList"
:key="day.value"
:label="day.label"
:value="day.value">
:value="day.value"
>
</el-option>
</el-select>
<el-select
v-model="dialogData.monthArr"
multiple
collapse-tags
style="margin-left: 20px; width: 150px"
size="small"
placeholder="请选择日期"
>
<el-option v-for="day in 31" :key="day" :label="day" :value="day">
</el-option>
</el-select>
<el-time-picker
v-model="dialogData.sendTime"
class="picker-time"
size="small"
value-format="HH:mm:ss"
style="margin-left: 20px; width: 150px"
placeholder="请选择发送时间"
>
</el-time-picker>
<el-date-picker
class="picker-time"
size="small"
v-model="dialogData.startTime"
type="date"
style="20px;width:150px"
value-format="yyyy-MM-dd"
placeholder="请选择业务开始时间" />
placeholder="请选择业务开始时间"
/>
<!-- <el-time-picker
class="time-picker"
v-model="dialogData.remindTime"
@ -128,39 +174,74 @@
>
</el-time-picker> -->
</div>
<div class="time" v-else-if="dialogType == 'invoice'">
<div class="time" v-else-if="dialogType == 'invoice'">
<div class="tip sec-tip">{{ dialogData.remindTip }}</div>
<el-input class="input-time" size="small" type="number" min="0" max="365" v-model="dialogData.remindTDay" placeholder="请输入" style="margin-left: 20px;"></el-input>
<el-input
class="input-time"
size="small"
type="number"
min="0"
max="365"
v-model="dialogData.remindTDay"
style="margin-left: 20px; width: 150px"
placeholder="请输入"
></el-input>
<el-select
v-model="dialogData.remindTDayArr"
multiple
collapse-tags
style="margin-left: 20px;"
style="margin-left: 20px; width: 150px"
size="small"
placeholder="请选择发送时间">
placeholder="请选择星期"
>
<el-option
v-for="day in dialogData.remindTDayList"
:key="day.value"
:label="day.label"
:value="day.value">
:value="day.value"
>
</el-option>
</el-select>
<el-select
v-model="dialogData.monthArr"
multiple
collapse-tags
style="margin-left: 20px; width: 150px"
size="small"
placeholder="请选择日期"
>
<el-option v-for="day in 31" :key="day" :label="day" :value="day">
</el-option>
</el-select>
<el-time-picker
v-model="dialogData.reminderTime"
class="picker-time"
size="small"
value-format="HH:mm:ss"
style="margin-left: 20px; width: 150px"
placeholder="请选择发送时间"
>
</el-time-picker>
<el-date-picker
class="picker-time"
size="small"
style="width: 150px; margin-left: 20px; margin-top: 10px"
v-model="dialogData.startTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择业务开始时间" />
placeholder="请选择业务开始时间"
/>
<!-- == 添加未开票选项 == -->
<el-radio-group class="set-label" v-model="dialogData.select_setting">
<el-radio-group
class="set-label"
v-model="dialogData.select_setting"
>
<el-radio label="1">未开票</el-radio>
<el-radio label="0">未开票未完全结算</el-radio>
</el-radio-group>
</div>
</div>
</div>
@ -168,7 +249,7 @@
class="err-tip"
v-if="dialogData.errorTip"
:title="dialogData.errorTip"
style="margin-top: 20px;margin-bottom: 20px;"
style="margin-top: 20px; margin-bottom: 20px"
type="error"
>
</el-alert>
@ -179,7 +260,7 @@
</el-dialog>
<el-dialog
:title="`${dialogType == 'weekly' ? `销售欠费周报` : `票结未开票`} - 邮箱样例`"
:title="`${dialogEmailTit} - 邮箱样例`"
:visible.sync="dialogVisibleEmail"
:before-close="handleClose"
>
@ -193,10 +274,33 @@
<div class="content" v-if="dialogType == 'invoice'">
截止2022年7月21日0点您的票结客户超过7天未开票业务清单详见附件
</div>
<div class="content" v-else-if="dialogType == 'weekly'">
<div>截止到2022年7月21日0点您的业务欠费总金额为</div>
<div
class="content"
v-else-if="
[
'weekly',
'overtimeWeekly',
'uninvoiced',
'checked',
'arrears'
].includes(this.dialogType)
"
>
<div
v-if="
dialogType == 'weekly' ||
dialogType == 'uninvoiced' ||
dialogType == 'checked' ||
dialogType == 'arrears'
"
>
截止到2022年7月21日0点您的业务欠费总金额为
</div>
<div v-else-if="dialogType == 'overtimeWeekly'">
截止到2022年7月21日0点您的业务超期欠费总金额为
</div>
<div class="usd">
USD:30040.00 &nbsp;&nbsp;&nbsp; <br/>RMB:30040.00
USD:30040.00 &nbsp;&nbsp;&nbsp; <br />RMB:30040.00
</div>
<div class="last">清单详见附件</div>
</div>
@ -255,31 +359,33 @@
</template>
<script>
import { ReportLoad, AddOrUpdate, IsBook, Login } from "@/utils/request.js";
import axios from "axios";
import { ReportLoad, AddOrUpdate, IsBook, Login } from '@/utils/request.js'
import axios from 'axios'
export default {
name: "index",
name: 'index',
data() {
return {
letterList: [],
code: this.$route.query.code,
dialogVisible: false,
dialogVisibleEmail: false,
dialogType: "",
dialogType: '',
dialogData: {
checkList: [],
otherVal: "",
remindTip: "",
remindTDay: "",
otherVal: '',
remindTip: '',
remindTDay: '',
monthArr: [],
remindTDayArr: [],
remindTime: "",
remindTime: '',
errorTip: null,
startTime: '',
startTime: ''
},
dayVal: '',
dialogEmailTit: ''
// pickerOptions:{
// disabledDate(time) {
@ -287,349 +393,411 @@ export default {
// return time.getTime() < Date.now() - 8.64e7;
// }
// }
};
}
},
watch: {
checkList(val, nval) {
if (nval.length > 1) {
this.showOther = true;
this.showOther = true
}
},
}
},
created() {
this.Login();
this.Login()
},
mounted() {},
methods: {
Login() {
// let url = process.env.NODE_ENV === 'development' ? "http://60.209.125.238:35101/user/login": "http://60.209.125.238:35101/user/login"
let url =
process.env.NODE_ENV === "development"
? "http://60.209.125.238:35101/user/login"
: "http://djy-identity.myshipping.net/user/login";
process.env.NODE_ENV === 'development'
? 'http://60.209.125.238:35101/user/login'
: 'http://djy-identity.myshipping.net/user/login'
axios
.post(url, {
code: this.code,
code: this.code
})
.then((res) => {
const { status, data } = res;
const { status, data } = res
if (status == 200) {
localStorage.setItem("userToken", data.data.token);
localStorage.setItem('userToken', data.data.token)
}
this.ReportLoad();
this.ReportLoad()
})
.catch((err) => {
this.$message({
message: "未获取到token",
type: "warning",
});
message: '未获取到token',
type: 'warning'
})
// this.ReportLoad();
});
})
},
ReportLoad() {
ReportLoad().then((res) => {
if (res.code == 200) {
res.data.map((item,index)=>{
res.data.map((item, index) => {
item.type = this.selectType(Number(item.templateType))
if(!item.dJson){
if(item.type == 'invoice'){
let _data = { receiver: '', ccList:'', reminderDay: 1, reminderTime: '00:00:00', sailingDate: 1, startTime: '', sailingDateArr: [], select_setting: '1' }
if (!item.dJson) {
if (item.type == 'invoice') {
let _data = {
receiver: '',
ccList: '',
reminderDay: 1,
reminderTime: '00:00:00',
sailingDate: 1,
startTime: '',
monthArr: [],
sailingDateArr: [],
select_setting: '1'
}
item.dJson = JSON.stringify(_data)
}else{
let _data = { receiver: '' ,ccList: '', sendDate: 1, sendTime: "00:00:00", startTime: '', sendDateArr: [] }
} else if (
[
'weekly',
'overtimeWeekly',
'uninvoiced',
'checked',
'arrears'
].includes(item.type)
) {
let _data = {
receiver: '',
ccList: '',
sendDate: 1,
sendTime: '00:00:00',
monthArr: [],
startTime: '',
sendDateArr: []
}
item.dJson = JSON.stringify(_data)
}
}
})
this.letterList = res.data;
this.letterList = res.data
}
});
})
},
selectType(val) {
switch (val){
case 0 : return 'weekly'; //
case 1 : return 'invoice'; //
switch (val) {
case 0:
return 'weekly' //
case 1:
return 'invoice' //
case 2:
return 'overtimeWeekly' //
case 3:
return 'arrears' //
case 4:
return 'checked' //
case 5:
return 'uninvoiced' //
}
},
showModelSet(index,item) {
this.dialogVisible = true;
this.dialogType = item.type;
let dJson = JSON.parse(this.letterList[index].dJson);
if (this.dialogType == 'weekly') {
showModelSet(index, item) {
this.dialogVisible = true
this.dialogType = item.type
let dJson = JSON.parse(this.letterList[index].dJson)
if (
[
'weekly',
'overtimeWeekly',
'uninvoiced',
'checked',
'arrears'
].includes(this.dialogType)
) {
this.dialogData = {
checkList: ["揽货人", "其他"],
checkRes: ["揽货人", "其他"],
otherVal: dJson && dJson.ccList ? dJson.ccList : "",
title: item.templateName,
checkList: ['揽货人', '其他'],
checkRes: ['揽货人', '其他'],
otherVal: dJson && dJson.ccList ? dJson.ccList : '',
// remindTDay: dJson && dJson.sendDate ? dJson.sendDate : "",
remindTime: dJson && dJson.sendTime ? dJson.sendTime : "00:00:00",
// remindTime: dJson && dJson.sendTime ? dJson.sendTime : '00:00:00',
sendTime: dJson && dJson.sendTime ? dJson.sendTime : '00:00:00',
monthArr: dJson && dJson.monthArr ? dJson.monthArr : [],
remindTDayArr: dJson && dJson.sendDateArr ? dJson.sendDateArr : [],
remindTip: "发送时间",
remindTip: '发送时间',
remindTDayList: [
{
label: "周一",
value: "1",
label: '周一',
value: '1'
},
{
label: "周二",
value: "2",
label: '周二',
value: '2'
},
{
label: "周三",
value: "3",
label: '周三',
value: '3'
},
{
label: "周四",
value: "4",
label: '周四',
value: '4'
},
{
label: "周五",
value: "5",
label: '周五',
value: '5'
},
{
label: "周六",
value: "6",
label: '周六',
value: '6'
},
{
label: "周日",
value: "0",
},
label: '周日',
value: '0'
}
],
errorTip: null,
startTime: dJson && dJson.startTime ? dJson.startTime : "",
};
} else if(this.dialogType == 'invoice') {
startTime: dJson && dJson.startTime ? dJson.startTime : ''
}
} else if (this.dialogType == 'invoice') {
this.dialogData = {
checkList: ["操作", "其他"],
checkRes: ["操作", "其他"],
otherVal: dJson && dJson.ccList ? dJson.ccList : "",
remindTip: "开船后几天提醒",
title: item.templateName,
checkList: ['操作', '其他'],
checkRes: ['操作', '其他'],
reminderTime: dJson && dJson.reminderTime ? dJson.reminderTime : '00:00:00',
monthArr: dJson && dJson.monthArr ? dJson.monthArr : [],
otherVal: dJson && dJson.ccList ? dJson.ccList : '',
remindTip: '开船后几天提醒',
remindTDayList: [
{
label: "周一",
value: "1",
label: '周一',
value: '1'
},
{
label: "周二",
value: "2",
label: '周二',
value: '2'
},
{
label: "周三",
value: "3",
label: '周三',
value: '3'
},
{
label: "周四",
value: "4",
label: '周四',
value: '4'
},
{
label: "周五",
value: "5",
label: '周五',
value: '5'
},
{
label: "周六",
value: "6",
label: '周六',
value: '6'
},
{
label: "周日",
value: "0",
},
label: '周日',
value: '0'
}
],
remindTDay: dJson && dJson.sailingDate ? dJson.sailingDate : "",
remindTime:
dJson && dJson.reminderTime ? dJson.reminderTime : "00:00:00",
remindTDayArr: dJson && dJson.sailingDateArr ? dJson.sailingDateArr : [],
remindTDay: dJson && dJson.sailingDate ? dJson.sailingDate : '',
remindTDayArr:
dJson && dJson.sailingDateArr ? dJson.sailingDateArr : [],
errorTip: null,
startTime: dJson && dJson.startTime ? dJson.startTime : "",
select_setting: dJson && dJson.select_setting ? dJson.select_setting : "1",
};
startTime: dJson && dJson.startTime ? dJson.startTime : '',
select_setting:
dJson && dJson.select_setting ? dJson.select_setting : '1'
}
}
},
showModelEmail(index,item) {
this.dialogVisibleEmail = true;
this.dialogType = item.type;
showModelEmail(index, item) {
this.dialogVisibleEmail = true
this.dialogType = item.type
this.dialogEmailTit = item.templateName
},
handleClose() {
this.dialogVisible = false;
this.dialogVisibleEmail = false;
this.dialogVisible = false
this.dialogVisibleEmail = false
},
handleCommand(command) {
this.dialogData.remindTDay = command;
this.dialogData.remindTDay = command
},
enumDays(type) {
if (type) {
let _type = type == '0' ? '7' : type;
let str = this.dialogData.remindTDayList[Number(_type) - 1].val;
return str;
let _type = type == '0' ? '7' : type
let str = this.dialogData.remindTDayList[Number(_type) - 1].val
return str
}
},
timeTrans(time, type) {
let date = new Date(new Date(time).getTime() + 8 * 3600 * 1000);
date = date.toJSON();
let date = new Date(new Date(time).getTime() + 8 * 3600 * 1000)
date = date.toJSON()
if (type === 1) {
date = date.substring(0, 10);
date = date.substring(0, 10)
} else {
date = date.substring(0, 19).replace("T", " ");
date = date.substring(0, 19).replace('T', ' ')
}
return date;
return date
},
submitSet() {
if (this.dialogData.checkRes.length == 2 && !this.dialogData.otherVal) {
this.dialogData.errorTip = "请输入其他接收人邮箱";
this.dialogData.errorTip = '请输入其他接收人邮箱'
setTimeout(() => {
this.dialogData.errorTip = "";
}, 2000);
return false;
this.dialogData.errorTip = ''
}, 2000)
return false
} else if (this.dialogType == 'invoice' && !this.dialogData.remindTDay) {
this.dialogData.errorTip = "请选择" + this.dialogData.remindTip;
this.dialogData.errorTip = '请选择' + this.dialogData.remindTip
setTimeout(() => {
this.dialogData.errorTip = "";
}, 2000);
return false;
} else if(this.dialogData.remindTDayArr.length == 0 ){
this.dialogData.errorTip = "请选择" + this.dialogData.remindTip;
this.dialogData.errorTip = ''
}, 2000)
return false
} else if (
this.dialogData.remindTDayArr.length == 0 &&
this.dialogData.monthArr.length == 0
) {
this.dialogData.errorTip = '请选择' + this.dialogData.remindTip
setTimeout(() => {
this.dialogData.errorTip = "";
}, 2000);
return false;
}else if (!this.dialogData.startTime) {
this.dialogData.errorTip = "请选择业务开始时间";
this.dialogData.errorTip = ''
}, 2000)
return false
} else if (!this.dialogData.startTime) {
this.dialogData.errorTip = '请选择业务开始时间'
setTimeout(() => {
this.dialogData.errorTip = "";
}, 2000);
return false;
}else if (this.dialogData.otherVal) {
let emailArr = this.dialogData.otherVal.split(/[,__;__]/);
let isRight = true;
this.dialogData.errorTip = ''
}, 2000)
return false
} else if (this.dialogData.otherVal) {
let emailArr = this.dialogData.otherVal.split(/[,__;__]/)
let isRight = true
emailArr.map((url, index) => {
if (!this.emailCheck(url)) {
isRight = false;
isRight = false
}
});
})
if (!isRight) {
this.dialogData.errorTip = "请填写正确的邮箱";
this.dialogData.errorTip = '请填写正确的邮箱'
setTimeout(() => {
this.dialogData.errorTip = "";
}, 2000);
return false;
this.dialogData.errorTip = ''
}, 2000)
return false
}
}
let res, index;
this.letterList.map((item,oindex)=>{
if(item.type == this.dialogType){
}
let res, index
this.letterList.map((item, oindex) => {
if (item.type == this.dialogType) {
index = oindex
}
})
console.log(index)
if (this.dialogType == 'weekly') {
if (
[
'weekly',
'overtimeWeekly',
'uninvoiced',
'checked',
'arrears'
].includes(this.dialogType)
) {
res = {
receiver: this.letterList[index].compID,
ccList: this.dialogData.otherVal,
// sendDate: this.dialogData.remindTDay,
monthArr: this.dialogData.monthArr,
sendDateArr: this.dialogData.remindTDayArr,
sendTime: this.dialogData.remindTime,
startTime: this.dialogData.startTime,
};
sendTime: this.dialogData.sendTime,
startTime: this.dialogData.startTime
}
} else if (this.dialogType == 'invoice') {
res = {
receiver: this.letterList[index].compID,
ccList: this.dialogData.otherVal,
reminderDay: 1,
sailingDate: this.dialogData.remindTDay,
monthArr: this.dialogData.monthArr,
sailingDateArr: this.dialogData.remindTDayArr,
reminderTime: this.dialogData.remindTime,
startTime: this.dialogData.startTime,
reminderTime: this.dialogData.reminderTime,
select_setting: this.dialogData.select_setting
};
}
}
console.log(res, index, {
gid: this.letterList[index].gid || '',
templateID: this.letterList[index].templateID,
isBook: this.letterList[index].isBook ? true : false,
dJson: JSON.stringify(res), // JSON
});
dJson: JSON.stringify(res) // JSON
})
AddOrUpdate({
gid: this.letterList[index].gid || '',
templateID: this.letterList[index].templateID,
isBook: this.letterList[index].isBook ? true : false,
dJson: JSON.stringify(res), // JSON
dJson: JSON.stringify(res) // JSON
})
.then((res) => {
if (res.code == 200) {
this.$message({
message: "设置成功",
type: "success",
});
this.ReportLoad();
message: '设置成功',
type: 'success'
})
this.ReportLoad()
} else {
this.$message({
message: res.message,
type: "warning",
});
type: 'warning'
})
}
})
.catch((err) => {
this.$message({
message: res.message,
type: "warning",
});
});
message: res.message,
type: 'warning'
})
})
setTimeout(() => {
this.dialogInit();
}, 1500);
this.dialogInit()
}, 1500)
},
emailCheck(emailStr) {
const emailReg = /^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
const isemail = emailReg.test(emailStr);
return isemail;
const emailReg = /^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/
const isemail = emailReg.test(emailStr)
return isemail
},
cancelSet() {
this.dialogInit();
this.dialogInit()
},
dialogInit() {
this.dialogVisible = false;
this.dialogVisibleEmail = false;
this.dialogType = "";
this.dialogVisible = false
this.dialogVisibleEmail = false
this.dialogType = ''
this.dialogData = {
checkList: [],
otherVal: "",
remindTip: "",
remindTDay: "",
remindTime: "",
otherVal: '',
remindTip: '',
remindTDay: '',
sendTime: '',
errorTip: null,
startTime: '',
};
startTime: ''
}
},
subscribe(data) {
IsBook({
Gid: data.gid || '',
TemplateId: data.templateID,
isBook: data.isBook ? false : true,
DJson: data.dJson,
DJson: data.dJson
})
.then((res) => {
if (res.code == 200) {
this.$message({
message: "设置成功",
type: "success",
});
this.ReportLoad();
message: '设置成功',
type: 'success'
})
this.ReportLoad()
} else {
this.$message({
message: res.message,
type: "warning",
});
type: 'warning'
})
}
})
.catch((err) => {
this.$message({
message: res.message,
type: "warning",
});
});
},
},
};
type: 'warning'
})
})
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
@ -680,7 +848,7 @@ export default {
z-index: -1;
}
&::before {
content: "";
content: '';
position: absolute;
width: 3px;
height: 100%;
@ -739,7 +907,7 @@ export default {
ul {
list-style: none;
}
.set-label{
.set-label {
width: 100%;
display: block;
height: 50px;
@ -771,7 +939,7 @@ export default {
float: left;
margin-top: 10px;
margin-left: 14px;
.input-time{
.input-time {
display: inline-block;
width: 90px;
margin-right: 10px;
@ -909,7 +1077,7 @@ export default {
color: #b13d3e;
letter-spacing: 18px;
font-weight: 600;
opacity: .8;
opacity: 0.8;
}
}
.letter-bottom {
@ -927,8 +1095,8 @@ export default {
}
}
}
.picker-time{
margin-left: 30px;
}
.picker-time {
margin-left: 30px;
}
}
</style>

Loading…
Cancel
Save