Commit aacc977e authored by 黄奎's avatar 黄奎

新增合同复制

parent 8c75a8b8
......@@ -960,6 +960,7 @@
</div>
<table class="singeRowTable" border="0" cellspacing="0" cellpadding="0">
<tr>
<th>选择</th>
<th>序号</th>
<th>姓名</th>
<th>性别</th>
......@@ -969,6 +970,9 @@
<th>身体状况</th>
</tr>
<tr v-for="(item,index) in guestList">
<td>
<el-checkbox v-model="item.isCheck"></el-checkbox>
</td>
<td>{{index+1}}</td>
<td>{{item.surName+''+item.name}}</td>
<td>{{item.sex==1?'男':'女'}}</td>
......@@ -1136,46 +1140,28 @@
style="padding:8px 10px;float:right;margin-bottom:10px;" @click="copyContract()" value="批量复制合同" />
<table border="0" cellspacing="0" cellpadding="0" class="singeRowTable">
<tr>
<th>选择</th>
<th>旅客姓名</th>
<th>电话</th>
</tr>
<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.mobilePhone}}</td>
</tr>
<tr v-if="backGuest.length==0">
<td colspan="2">已经复制完成</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>
<td colspan="3">已经复制完成</td>
</tr>
</table>
</el-dialog>
<div class="fade" v-show="isShowFade"></div>
<div class="qrCodeDiv" v-show="isShowFade">
<div style="margin-top:15px;">请扫码签字</div>
......@@ -1221,7 +1207,7 @@
return {
//国家列表
CountryList: [],
isShowFade: false,
isShowFade: false, //是否显示签证弹窗
QRCodeStr: "",
//客户省份列表
ClientProvinceList: [],
......@@ -1241,7 +1227,8 @@
msg: {
TCID: 0,
orderID: 0,
guestId: 0
guestId: 0,
Id: 0, //出境合同表主键编号
},
addMsg: {
Country: 0,
......@@ -1249,8 +1236,6 @@
City: 0
},
dialogVisible: false,
//发送短信
msgDialog: false,
CurrentUserInfo: {}, //当前用户信息
//参数
CtObj: {
......@@ -1450,12 +1435,7 @@
tripDays: [],
//旅客名单
backGuest: [],
//短信旅客名单
msgGuest: [],
ckedAll: false,
content: '发送短信', //按钮显示内容
totalTime: 10,
canClick: true //添加canClick
};
},
methods: {
......@@ -1491,9 +1471,7 @@
}).then(res => {
if (res.data.resultCode === 1) {
this.QRCodeStr = res.data.data;
} else {
}
} else {}
}).catch(err => {})
},
//跳转锚点
......@@ -1505,8 +1483,9 @@
this.apipost("travelcontract_post_GetContractInfoService", this.msg, res => {
if (res.data.resultCode === 1) {
var tempObj = res.data.data;
console.log("travelcontract_post_GetContractInfoService", tempObj)
this.CtObj = tempObj;
this.guestList = res.data.data.guestList;
this.guestList = tempObj.allGuestList;
this.CtObj.tcid = this.$route.query.TCID;
this.CtObj.orderId = this.$route.query.orderID;
this.CtObj.totalNumber = 2;
......@@ -1701,12 +1680,28 @@
}
}
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 => {
if (res.data.resultCode === 1) {
this.Success(res.data.message);
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 {
this.Error(res.data.message);
}
......@@ -1883,28 +1878,20 @@
}
this.apipost("travelcontract_post_GetContractGuestByOrderId", msg, res => {
if (res.data.resultCode === 1) {
this.backGuest = res.data.data;
} else {
this.Error(res.data.message);
}
}, null);
},
//获取旅客短信列表
getMsgList() {
let msg = {
orderId: this.msg.orderID
}
this.apiJavaPost("/api/contract/sendMsgList", msg, res => {
if (res.data.resultCode === 1) {
this.msgGuest = res.data.data;
this.msgGuest.forEach(x => {
x.checked = false;
if (x.msgSendStatus == 3) {
x.isCanck = true;
} else {
x.isCanck = false;
}
})
var tempData = res.data.data;
if (tempData && tempData.length > 0) {
tempData.forEach(item => {
item.IsShow = true;
if (this.guestList && this.guestList.length > 0) {
this.guestList.forEach(sItem => {
if (sItem.id == item.id && sItem.isCheck && item.IsShow) {
item.IsShow = false;
}
});
}
});
}
this.backGuest = tempData;
} else {
this.Error(res.data.message);
}
......@@ -1913,89 +1900,42 @@
//复制合同
copyContract() {
let newArr = [];
this.guestList.forEach(x => {
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);
this.backGuest.forEach(x => {
if (x.isCheck) {
newArr.push(x.id);
}
})
if (newArr.length == 0) {
this.Error('请勾选要发送信息的旅客!');
var unionGuestIds = newArr.join(',');
if (unionGuestIds == '') {
this.Error("请选择要复制的旅客");
return;
}
if (!this.canClick)
return
this.sendMsg(); //调用发送短信
this.canClick = false
this.content = this.totalTime + 's后重新发送'
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
let copyMsg = {
TCID: this.msg.TCID,
guestId: this.msg.guestId,
orderID: this.msg.orderID,
unionGuestIds: unionGuestIds
}
this.apiJavaPost("/api/contract/sendMassage", msg, res => {
this.apipost("travelcontract_post_CopyContractServices", copyMsg, res => {
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 {
this.Error(res.data.message);
}
}, null);
},
//获取行程信息
GetTrip(id, TCID) {
this.tripList = [];
this.startDate = '';
......@@ -2399,6 +2339,9 @@
this.msg.TCID = this.$route.query.TCID;
this.msg.orderID = this.$route.query.orderID;
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.$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