Commit 44c3aa9f authored by zhengke's avatar zhengke

再次增加上传

parent b3f6e99e
......@@ -104,6 +104,18 @@
</el-option>
</el-select>
</div>
<el-upload :http-request="uploadFileBtn" :multiple="true" :show-file-list="false" action="">
<el-button size="small" type="danger" icon="el-icon-upload2">
<!-- <i class="el-icon-plus avatar-uploader-icon" @click="ClickItem=item"></i> -->
<div class="el-upload__text" @click="ClickItem=item">点击上传</div>
</el-button>
</el-upload>
<div class="RoomfileList" v-for="(subItem,subIndex) in item.ContractUrlArray" v-if="item.ContractUrlArray!=null && item.ContractUrlArray.length>0">
<p title="点击下载" @click="downLoadPZ(subItem)" style="cursor: pointer;">{{ '附件' + (subIndex + 1)}}</p>
<span>
<i class="iconfont icon-close" @click="deleteFile(item,subIndex)"></i>
</span>
</div>
</td>
<td>
<div class="w80">
......@@ -213,10 +225,26 @@
CreateByAccount: '',
//创建人姓名
CreateByName: '',
//点击项
ClickItem: {},
}
},
methods: {
//联系op
downLoadPZ: function (src) {
let dom = document.querySelector("#blankLink")
dom.href=src
dom.click()
},
//删除
deleteFile(item,index){
item.ContractUrlArray.splice(index,1);
var str = "";
item.ContractUrlArray.forEach(subItem => {
str += subItem + ",";
})
item.ContractUrl = str != "" ? str.substring(0, str.length - 1) : str;
},
openChart() {
this.MsgBus.$emit('openChat', {
account: this.CreateByAccount,
......@@ -265,11 +293,15 @@
this.CreateByPhoto = res.data.data.CreateByPhoto;
this.CreateByAccount = res.data.data.CreateByAccount;
this.list.forEach(item => {
this.calculationPrice(item)
this.calculationPrice(item);
item.hotelList.push({
Name: item.NewHotelName,
ID: item.NewHotelId
})
item.ContractUrlArray = [];
if (item.ContractUrl && item.ContractUrl != '') {
item.ContractUrlArray = item.ContractUrl.split(',');
}
item.PayStyle = item.PayStyle.toString()
item.OrderDetailsList.forEach((x, index1) => {
if (x.HouseTypeCount <= 0) {
......@@ -281,22 +313,22 @@
x.UnitPrice = x.UnitPrice.toString();
x.HotelDiscount = x.HotelDiscount.toString();
})
if(item.ReserveNo==''||item.ReserveNo==null){
item.ReserveNo = this.$route.query.NewCombinationNum;
}
if (item.ReserveNo == '' || item.ReserveNo == null) {
item.ReserveNo = this.$route.query.NewCombinationNum;
}
})
} else {
this.$message.error(res.data.message)
this.$message.error(res.data.message);
}
}, err => {})
},
calculationPrice(obj) {
let totalPrice = 0
let totalPrice = 0;
obj.OrderDetailsList.forEach(item => {
totalPrice += item.UnitPrice * (item.HouseGuestNum - item.HotelDiscount) * (1 - item.RebateRatio / 100)
totalPrice += item.UnitPrice * (item.HouseGuestNum - item.HotelDiscount) * (1 - item.RebateRatio / 100);
})
obj.TotalPrice = totalPrice.toFixed(2)
this.$forceUpdate()
obj.TotalPrice = totalPrice.toFixed(2);
this.$forceUpdate();
},
getHotelList(obj) {
this.apipost('hotel_post_GetLineHotelList', {
......@@ -305,32 +337,32 @@
QCity: obj.QCity
}, res => {
if (res.data.resultCode == 1) {
obj.hotelList = res.data.data
obj.hotelList = res.data.data;
} else {
this.$message.error(res.data.message)
this.$message.error(res.data.message);
}
}, err => {})
},
sendValue(obj) {
if (obj.hotelList.length > 0) {
let ckedObj = obj.hotelList.find(item => item.ID == obj.NewHotelId)
obj.Address = ckedObj.Address
obj.Tel = ckedObj.Tel
obj.NewHotelName = ckedObj.Name
let ckedObj = obj.hotelList.find(item => item.ID == obj.NewHotelId);
obj.Address = ckedObj.Address;
obj.Tel = ckedObj.Tel;
obj.NewHotelName = ckedObj.Name;
} else {
obj.Address = ''
obj.Tel = ''
obj.Address = '';
obj.Tel = '';
}
},
saveList(type) {
if (type == 0) {
this.list.forEach(item => {
item.HotelOrderState = 0
item.HotelOrderState = 0;
})
}
if (type == 1) {
this.list.forEach(item => {
item.HotelOrderState = 1
item.HotelOrderState = 1;
})
}
this.list.forEach(x => {
......@@ -342,9 +374,10 @@
})
this.apipost('dmcstatistics_get_SetHotelOrder', this.list, res => {
if (res.data.resultCode == 1) {
this.Success(res.data.message)
this.getList();
this.Success(res.data.message);
} else {
this.Error(res.data.message)
this.Error(res.data.message);
}
}, err => {})
},
......@@ -353,13 +386,32 @@
item.HotelOrderState = 1;
this.apipost('dmcstatistics_post_SetNewHotelOrder', item, res => {
if (res.data.resultCode == 1) {
this.Success(res.data.message)
this.Success(res.data.message);
} else {
this.Error(res.data.message)
this.Error(res.data.message);
}
}, err => {})
}
},
//合同上传
uploadFileBtn(file) {
if (file.file.size > 1024 * 1024 * 100) {
this.$message.warning("文件大小不能超过100M!");
return;
}
let newArr = [];
newArr.push(file.file);
let path = "/Upload/DMC/";
this.$message.info("上传中...");
this.UploadSelfFileT(path, newArr, x => {
var fileUrl = this.domainManager().ViittoFileUrl + x.data.FilePath;
this.ClickItem.ContractUrlArray.push(fileUrl);
var str = "";
this.ClickItem.ContractUrlArray.forEach(subItem => {
str += subItem + ",";
})
this.ClickItem.ContractUrl = str != "" ? str.substring(0, str.length - 1) : str;
});
},
},
mounted() {
this.TCNUM = this.$route.query.TCNUM;
......@@ -368,8 +420,32 @@
this.getList();
},
}
</script>
<style>
.RoomfileList{
width:100%;
height:20px;
text-align: center;
position: relative;
cursor: pointer;
}
.RoomfileList p{
display: inline-block;
}
.RoomfileList i:hover{
color:#E95252;
}
.roomReservationsDetailsTalbe .el-button--small {
padding: 0 20px 0 10px;
margin-top: 10px;
height:28px;
line-height: 10px;
}
.roomReservationsDetailsTalbe .el-button--small i{
float: left;
margin-top:9px;
}
.roomReservationsDetailsTalbe .roomBtn {
color: #fff;
padding: 0 10px !important;
......
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