Commit aacc977e authored by 黄奎's avatar 黄奎

新增合同复制

parent 8c75a8b8
...@@ -960,6 +960,7 @@ ...@@ -960,6 +960,7 @@
</div> </div>
<table class="singeRowTable" border="0" cellspacing="0" cellpadding="0"> <table class="singeRowTable" border="0" cellspacing="0" cellpadding="0">
<tr> <tr>
<th>选择</th>
<th>序号</th> <th>序号</th>
<th>姓名</th> <th>姓名</th>
<th>性别</th> <th>性别</th>
...@@ -969,6 +970,9 @@ ...@@ -969,6 +970,9 @@
<th>身体状况</th> <th>身体状况</th>
</tr> </tr>
<tr v-for="(item,index) in guestList"> <tr v-for="(item,index) in guestList">
<td>
<el-checkbox v-model="item.isCheck"></el-checkbox>
</td>
<td>{{index+1}}</td> <td>{{index+1}}</td>
<td>{{item.surName+''+item.name}}</td> <td>{{item.surName+''+item.name}}</td>
<td>{{item.sex==1?'男':'女'}}</td> <td>{{item.sex==1?'男':'女'}}</td>
...@@ -1136,46 +1140,28 @@ ...@@ -1136,46 +1140,28 @@
style="padding:8px 10px;float:right;margin-bottom:10px;" @click="copyContract()" value="批量复制合同" /> style="padding:8px 10px;float:right;margin-bottom:10px;" @click="copyContract()" value="批量复制合同" />
<table border="0" cellspacing="0" cellpadding="0" class="singeRowTable"> <table border="0" cellspacing="0" cellpadding="0" class="singeRowTable">
<tr> <tr>
<th>选择</th>
<th>旅客姓名</th> <th>旅客姓名</th>
<th>电话</th> <th>电话</th>
</tr> </tr>
<tr v-for="(item,index) in backGuest"> <tr v-for="(item,index) in backGuest">
<td>
<template v-if="item.IsShow">
<el-checkbox v-model="item.isCheck"></el-checkbox>
</template>
<template v-else>
<span style="color:red;">已存在合同</span>
</template>
</td>
<td>{{item.surName+''+item.name}}</td> <td>{{item.surName+''+item.name}}</td>
<td>{{item.mobilePhone}}</td> <td>{{item.mobilePhone}}</td>
</tr> </tr>
<tr v-if="backGuest.length==0"> <tr v-if="backGuest.length==0">
<td colspan="2">已经复制完成</td> <td colspan="3">已经复制完成</td>
</tr>
</table>
</el-dialog>
<el-dialog custom-class='w600' title='发送信息' :visible.sync="msgDialog" center>
<input type="button" class="TCbtn-info" :class='{"TC_disabled":!this.canClick}'
style="padding:8px 10px;float:right;margin-bottom:10px;" @click="sendMsg11()" :value="content" />
<table border="0" cellspacing="0" cellpadding="0" class="singeRowTable">
<tr>
<th>
<label for="label" @change="getCkAll">
<input type="checkbox" id="label" v-model="ckedAll">全选
</label>
</th>
<th>旅客姓名</th>
<th>电话</th>
<th>发送状态</th>
</tr>
<tr v-for="(item,index) in msgGuest">
<td>
<input v-model="item.checked" :disabled="item.isCanck" type="checkbox" />
</td>
<td>{{item.clientName}}</td>
<td>{{item.clientCall}}</td>
<td>
<span v-if="item.msgSendStatus==0">未发送</span>
<span v-else-if="item.msgSendStatus==3">发送成功</span>
<span v-else>发送失败</span>
</td>
</tr> </tr>
</table> </table>
</el-dialog> </el-dialog>
<div class="fade" v-show="isShowFade"></div> <div class="fade" v-show="isShowFade"></div>
<div class="qrCodeDiv" v-show="isShowFade"> <div class="qrCodeDiv" v-show="isShowFade">
<div style="margin-top:15px;">请扫码签字</div> <div style="margin-top:15px;">请扫码签字</div>
...@@ -1221,7 +1207,7 @@ ...@@ -1221,7 +1207,7 @@
return { return {
//国家列表 //国家列表
CountryList: [], CountryList: [],
isShowFade: false, isShowFade: false, //是否显示签证弹窗
QRCodeStr: "", QRCodeStr: "",
//客户省份列表 //客户省份列表
ClientProvinceList: [], ClientProvinceList: [],
...@@ -1241,7 +1227,8 @@ ...@@ -1241,7 +1227,8 @@
msg: { msg: {
TCID: 0, TCID: 0,
orderID: 0, orderID: 0,
guestId: 0 guestId: 0,
Id: 0, //出境合同表主键编号
}, },
addMsg: { addMsg: {
Country: 0, Country: 0,
...@@ -1249,8 +1236,6 @@ ...@@ -1249,8 +1236,6 @@
City: 0 City: 0
}, },
dialogVisible: false, dialogVisible: false,
//发送短信
msgDialog: false,
CurrentUserInfo: {}, //当前用户信息 CurrentUserInfo: {}, //当前用户信息
//参数 //参数
CtObj: { CtObj: {
...@@ -1450,12 +1435,7 @@ ...@@ -1450,12 +1435,7 @@
tripDays: [], tripDays: [],
//旅客名单 //旅客名单
backGuest: [], backGuest: [],
//短信旅客名单
msgGuest: [],
ckedAll: false,
content: '发送短信', //按钮显示内容 content: '发送短信', //按钮显示内容
totalTime: 10,
canClick: true //添加canClick
}; };
}, },
methods: { methods: {
...@@ -1491,9 +1471,7 @@ ...@@ -1491,9 +1471,7 @@
}).then(res => { }).then(res => {
if (res.data.resultCode === 1) { if (res.data.resultCode === 1) {
this.QRCodeStr = res.data.data; this.QRCodeStr = res.data.data;
} else { } else {}
}
}).catch(err => {}) }).catch(err => {})
}, },
//跳转锚点 //跳转锚点
...@@ -1505,8 +1483,9 @@ ...@@ -1505,8 +1483,9 @@
this.apipost("travelcontract_post_GetContractInfoService", this.msg, res => { this.apipost("travelcontract_post_GetContractInfoService", this.msg, res => {
if (res.data.resultCode === 1) { if (res.data.resultCode === 1) {
var tempObj = res.data.data; var tempObj = res.data.data;
console.log("travelcontract_post_GetContractInfoService", tempObj)
this.CtObj = tempObj; this.CtObj = tempObj;
this.guestList = res.data.data.guestList; this.guestList = tempObj.allGuestList;
this.CtObj.tcid = this.$route.query.TCID; this.CtObj.tcid = this.$route.query.TCID;
this.CtObj.orderId = this.$route.query.orderID; this.CtObj.orderId = this.$route.query.orderID;
this.CtObj.totalNumber = 2; this.CtObj.totalNumber = 2;
...@@ -1701,12 +1680,28 @@ ...@@ -1701,12 +1680,28 @@
} }
} }
this.CtObj.travelContent = this.$refs.TcTravel_Table.innerHTML; this.CtObj.travelContent = this.$refs.TcTravel_Table.innerHTML;
this.CtObj.rbGroupId = this.CurrentUserInfo.RB_Group_id this.CtObj.rbGroupId = this.CurrentUserInfo.RB_Group_id;
let newArr = [];
this.guestList.forEach(x => {
if (x.isCheck) {
newArr.push(x.id);
}
})
this.CtObj.unionGuestIds = newArr.join(',');
this.apipost("travelcontract_post_SetContractService", this.CtObj, res => { this.apipost("travelcontract_post_SetContractService", this.CtObj, res => {
if (res.data.resultCode === 1) { if (res.data.resultCode === 1) {
this.Success(res.data.message); this.Success(res.data.message);
this.dialogVisible = false; this.dialogVisible = false;
this.getList(); var tempData = res.data.data;
this.$router.push({
name: 'TravelContractNew',
query: {
TCID: tempData.TCID,
guestId: tempData.GuestId,
orderID: tempData.OrderId,
Id: tempData.Id,
}
});
} else { } else {
this.Error(res.data.message); this.Error(res.data.message);
} }
...@@ -1883,28 +1878,20 @@ ...@@ -1883,28 +1878,20 @@
} }
this.apipost("travelcontract_post_GetContractGuestByOrderId", msg, res => { this.apipost("travelcontract_post_GetContractGuestByOrderId", msg, res => {
if (res.data.resultCode === 1) { if (res.data.resultCode === 1) {
this.backGuest = res.data.data; var tempData = res.data.data;
} else { if (tempData && tempData.length > 0) {
this.Error(res.data.message); tempData.forEach(item => {
} item.IsShow = true;
}, null); if (this.guestList && this.guestList.length > 0) {
}, this.guestList.forEach(sItem => {
//获取旅客短信列表 if (sItem.id == item.id && sItem.isCheck && item.IsShow) {
getMsgList() { item.IsShow = false;
let msg = { }
orderId: this.msg.orderID });
} }
this.apiJavaPost("/api/contract/sendMsgList", msg, res => { });
if (res.data.resultCode === 1) { }
this.msgGuest = res.data.data; this.backGuest = tempData;
this.msgGuest.forEach(x => {
x.checked = false;
if (x.msgSendStatus == 3) {
x.isCanck = true;
} else {
x.isCanck = false;
}
})
} else { } else {
this.Error(res.data.message); this.Error(res.data.message);
} }
...@@ -1913,89 +1900,42 @@ ...@@ -1913,89 +1900,42 @@
//复制合同 //复制合同
copyContract() { copyContract() {
let newArr = []; let newArr = [];
this.guestList.forEach(x => { this.backGuest.forEach(x => {
newArr.push(x.id); if (x.isCheck) {
}) newArr.push(x.id);
this.CtObj.guestIds = newArr.join(',');
this.submitForm('CtObj');
},
//点击全选
getCkAll() {
var that = this;
if (that.ckedAll) {
this.msgGuest.forEach(x => {
if (x.msgSendStatus == 3) {
x.checked = false;
} else {
x.checked = true;
}
})
} else {
this.msgGuest.forEach(x => {
x.checked = false;
})
}
},
sendMsg11() {
let newArr = [];
this.msgGuest.forEach(x => {
let obj = {};
if (x.checked) {
newArr.push(x);
} }
}) })
if (newArr.length == 0) { var unionGuestIds = newArr.join(',');
this.Error('请勾选要发送信息的旅客!'); if (unionGuestIds == '') {
this.Error("请选择要复制的旅客");
return; return;
} }
if (!this.canClick) let copyMsg = {
return TCID: this.msg.TCID,
this.sendMsg(); //调用发送短信 guestId: this.msg.guestId,
this.canClick = false orderID: this.msg.orderID,
this.content = this.totalTime + 's后重新发送' unionGuestIds: unionGuestIds
let clock = window.setInterval(() => {
this.totalTime--
this.content = this.totalTime + 's后重新发送'
if (this.totalTime < 0) {
window.clearInterval(clock)
this.content = '重新发送验证码'
this.totalTime = 10
this.canClick = true //这里重新开启
}
}, 1000)
},
//发送短信
sendMsg() {
let msgObj = [];
let dateTime = moment(this.CtObj.startDate).format("YYYY-MM-DD");
let lineTeam = this.CtObj.productName;
let days = this.CtObj.dayNum;
let nights = this.CtObj.nightNum;
this.msgGuest.forEach(x => {
let obj = {};
if (x.checked) {
obj.mobiles = x.clientCall;
obj.Url =
`http://yx.oytour.com/#/clientConfirm?TCID=${this.msg.TCID}&orderID=${this.msg.orderID}&guestId=${x.guestId}`;
msgObj.push(obj);
}
})
let msg = {
msgObj: msgObj,
dateTime: dateTime,
lineTeam: lineTeam,
days: days,
nights: nights,
orderID: this.msg.orderID
} }
this.apiJavaPost("/api/contract/sendMassage", msg, res => { this.apipost("travelcontract_post_CopyContractServices", copyMsg, res => {
if (res.data.resultCode === 1) { if (res.data.resultCode === 1) {
this.getMsgList(); this.Success("复制成功!");
this.dialogVisible = false;
var tempData = res.data.data;
this.$router.push({
name: 'TravelContractNew',
query: {
TCID: tempData.TCID,
guestId: tempData.GuestId,
orderID: tempData.OrderId,
Id: tempData.Id,
}
});
} else { } else {
this.Error(res.data.message); this.Error(res.data.message);
} }
}, null); }, null);
}, },
//获取行程信息
GetTrip(id, TCID) { GetTrip(id, TCID) {
this.tripList = []; this.tripList = [];
this.startDate = ''; this.startDate = '';
...@@ -2399,6 +2339,9 @@ ...@@ -2399,6 +2339,9 @@
this.msg.TCID = this.$route.query.TCID; this.msg.TCID = this.$route.query.TCID;
this.msg.orderID = this.$route.query.orderID; this.msg.orderID = this.$route.query.orderID;
this.msg.guestId = this.$route.query.guestId; this.msg.guestId = this.$route.query.guestId;
if (this.$route.query.Id && this.$route.query.Id > 0) {
this.msg.Id = this.$route.query.Id;
}
this.getList(); this.getList();
this.$nextTick(function () { this.$nextTick(function () {
//滚动监听事件 //滚动监听事件
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment