Commit 12541cc5 authored by 黄奎's avatar 黄奎

页面修改

parent 906a8cc5
...@@ -801,444 +801,475 @@ ...@@ -801,444 +801,475 @@
</template> </template>
<script> <script>
import commonHotelInfo from "../commonPage/commonHotelInfo.vue"; import commonHotelInfo from "../commonPage/commonHotelInfo.vue";
import { import { constants } from "os";
constants export default {
} from 'os'; data() {
export default { return {
data() { isUpdate: "false",
return { LineId: 0,
isUpdate: 'false', loading: false,
LineId: 0, defaultSelectValue: 0,
loading: false, initialIndex: 0,
defaultSelectValue: 0, picIsShow: false,
initialIndex: 0, picObj: [],
picIsShow: false, TemporaryItem: {},
picObj: [], msg: {
TemporaryItem: {}, TCIDs: "",
msg: { NewCombinationNum: ""
TCIDs: '', },
NewCombinationNum: '' zhuijiaList: [],
}, list: [],
zhuijiaList: [], nav: [],
list: [], TravelDayNum: 0,
nav: [], RealityNum: 0,
TravelDayNum: 0, UseCount: "",
RealityNum: 0, //定团号
UseCount: '', NewCombinationNum: "",
//定团号 TotalNav: [],
NewCombinationNum: '', LeaderGetPrice: 0,
TotalNav: [], HangingList: [],
LeaderGetPrice: 0, showHotelObj: {
HangingList: [], showPrice: true, //是否显示价格
showHotelObj: { showPay: true, //是否显示支付方式
showPrice: true, //是否显示价格 showZhan: true, //占房时间
showPay: true, //是否显示支付方式 showBtnList: false, //是否下载、确认按钮
showZhan: true, //占房时间 ShowTaxType: true, //显示税入税别
showBtnList: false, //是否下载、确认按钮 ShowRebateRatio: true, //显示返佣比列
ShowTaxType: true, //显示税入税别 ShowSupplier: true, //是否显示供应商
ShowRebateRatio: true, //显示返佣比列 showCaozuoTime: true, //操作时间
ShowSupplier: true, //是否显示供应商 colspanLength: 6 //跨行
showCaozuoTime: true, //操作时间 },
colspanLength: 6 //跨行 CurrencyListMoney: [],
}, currencyTypeObj: [],
CurrencyListMoney: [], //判断是否显示人民币
currencyTypeObj: [], IsShowRMB: false,
//判断是否显示人民币 ContractUrlCount: 1
IsShowRMB: false, };
ContractUrlCount: 1 },
components: {
commonHotelInfo
},
methods: {
// 20190815 新增领款单据重新生成自动带上计算后的金额
goFncEditUrl(url, crId, frId) {
let obj = {};
this.CurrencyListMoney.map(x => {
if (x.CurrencyId == crId) {
obj = x;
}
});
let price = obj.money * 0.95;
let calcPrice = 0;
if (crId == 1) {
//人民币
calcPrice =
parseInt(price / 1000) > 0
? parseInt(price / 1000) * 1000
: parseInt(price);
} else {
// 其他
calcPrice =
parseInt(price / 10000) > 0
? parseInt(price / 10000) * 10000
: parseInt(price);
} }
this.$router.push({
name: url,
query: {
FrID: frId,
blank: "y",
edit: true,
dijieEditMoney: calcPrice,
tab: "修改财务单据"
}
});
}, },
components: { GetCurrency(Id) {
commonHotelInfo var str = "";
switch (Id) {
case 0:
str = "日元";
break;
case 1:
str = "人民币";
break;
case 2:
str = "美元";
break;
case 3:
str = "日元";
break;
case 4:
str = "韩元";
break;
case 5:
str = "欧元";
break;
case 6:
str = "英镑";
break;
case 7:
str = "港币";
break;
case 8:
str = "加拿大元";
break;
case 9:
str = "澳大利亚元";
break;
case 10:
str = "新西兰元";
break;
case 11:
str = "新台币";
break;
case 12:
str = "泰国铢";
break;
case 13:
str = "新加坡元";
break;
case 14:
str = "瑞士法郎";
break;
}
return str;
}, },
methods: { financeinfo_post_GetList() {
// 20190815 新增领款单据重新生成自动带上计算后的金额 // 币种类型
goFncEditUrl(url, crId, frId) { this.apipost(
let obj = {} "financeinfo_post_GetList",
this.CurrencyListMoney.map(x => { {
if (x.CurrencyId == crId) { Name: ""
obj = x },
} res => {
})
let price = obj.money * 0.95
let calcPrice = 0
if (crId == 1) { //人民币
calcPrice = parseInt(price / 1000) > 0 ? parseInt(price / 1000) * 1000 : parseInt(price)
} else { // 其他
calcPrice = parseInt(price / 10000) > 0 ? parseInt(price / 10000) * 10000 : parseInt(price)
}
this.$router.push({
name: url,
query: {
"FrID": frId,
"blank": 'y',
"edit": true,
"dijieEditMoney": calcPrice,
"tab": '修改财务单据'
}
})
},
GetCurrency(Id) {
var str = "";
switch (Id) {
case 0:
str = "日元";
break;
case 1:
str = "人民币";
break;
case 2:
str = "美元";
break;
case 3:
str = "日元";
break;
case 4:
str = "韩元";
break;
case 5:
str = "欧元";
break;
case 6:
str = "英镑";
break;
case 7:
str = "港币";
break;
case 8:
str = "加拿大元";
break;
case 9:
str = "澳大利亚元";
break;
case 10:
str = "新西兰元";
break;
case 11:
str = "新台币";
break;
case 12:
str = "泰国铢";
break;
case 13:
str = "新加坡元";
break;
case 14:
str = "瑞士法郎";
break;
}
return str;
},
financeinfo_post_GetList() { // 币种类型
this.apipost('financeinfo_post_GetList', {
Name: ''
}, res => {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
let data = res.data.data; let data = res.data.data;
data.forEach(item => { data.forEach(item => {
this.currencyTypeObj[item.ID] = item.Name; this.currencyTypeObj[item.ID] = item.Name;
}) });
} else { } else {
} }
}, err => {}) },
}, err => {}
ZhuiJiaTuanKuan(item) { );
let TCIDARR = [item.TCIDS] // [this.$route.query.id] },
let orderObj = { ZhuiJiaTuanKuan(item) {
OrderID: 0, let TCIDARR = [item.TCIDS]; // [this.$route.query.id]
OrderSource: 8, let orderObj = {
Obj: {}, OrderID: 0,
SourceID: 0, OrderSource: 8,
TCIDList: TCIDARR, Obj: {},
TravelReplenish: this.$route.query.id, SourceID: 0,
OtherType: 1 TCIDList: TCIDARR,
TravelReplenish: this.$route.query.id,
OtherType: 1
};
this.$router.push({
name: "ChoiceAddFinancialDocuments",
query: {
Type: 2,
companyID: item.companyID,
path: "",
blank: "y",
orderObj: JSON.stringify(orderObj)
} }
this.$router.push({ });
name: 'ChoiceAddFinancialDocuments', },
query: { getzhuijiaList() {
"Type": 2, this.apipost(
"companyID": item.companyID, "Financial_post_GetTravelFinanceReplenishList",
"path": "", {
'blank': 'y', TravelReplenish: this.$route.query.id
'orderObj': JSON.stringify(orderObj), },
} res => {
}); if (res.data.resultCode == 1) {
}, this.zhuijiaList = res.data.data.list;
getzhuijiaList() {
this.apipost(
'Financial_post_GetTravelFinanceReplenishList', {
TravelReplenish: this.$route.query.id
},
res => {
if (res.data.resultCode == 1) {
this.zhuijiaList = res.data.data.list
}
},
err => {}
)
},
getHangingAccountByTCIDList: function () {
this.apipost(
'Financial_post_GetHangingAccountByTCIDList', {
TCIDs: this.$route.query.id
},
res => {
if (res.data.resultCode == 1) {
this.HangingList = res.data.data
}
},
err => {}
)
},
goFncUrl: function (path, id) {
this.$router.push({
name: path,
query: {
"id": id,
blank: 'y'
} }
}) },
}, err => {}
goHotelDetail: function (id, num, TCNUM, path) { );
this.$router.push({ },
name: path, getHangingAccountByTCIDList: function() {
query: { this.apipost(
"id": id, "Financial_post_GetHangingAccountByTCIDList",
"NewCombinationNum": num, {
"TCNUM": TCNUM, TCIDs: this.$route.query.id
'blank': 'y', },
res => {
if (res.data.resultCode == 1) {
this.HangingList = res.data.data;
} }
}); },
}, err => {}
goZhiDan2: function (obj, type, leadr, cur) { );
let TCIDARR = [obj.TCIDS] },
let orderObj = { goFncUrl: function(path, id) {
OrderID: 0, this.$router.push({
OrderSource: 8, name: path,
Obj: {}, query: {
SourceID: 0, id: id,
TCIDList: TCIDARR, blank: "y"
CostType: 56,
Money: leadr.LeaderGetPriceT,
TCNUMS: obj.TCNUMS,
CurrencyId: leadr.CurrencyId,
} }
let id = []; });
console.log("nowLineId:"+obj.LineId+"old:"+ this.LineId); },
if (obj.LineId == this.LineId) { goHotelDetail: function(id, num, TCNUM, path) {
id = [98, 99] this.$router.push({
name: path,
query: {
id: id,
NewCombinationNum: num,
TCNUM: TCNUM,
blank: "y"
}
});
},
goZhiDan2: function(obj, type, leadr, cur) {
let TCIDARR = [obj.TCIDS];
let orderObj = {
OrderID: 0,
OrderSource: 8,
Obj: {},
SourceID: 0,
TCIDList: TCIDARR,
CostType: 56,
Money: leadr.LeaderGetPriceT,
TCNUMS: obj.TCNUMS,
CurrencyId: leadr.CurrencyId
};
let id = [];
if (obj.LineId == this.LineId) {
id = [98, 99];
} else {
if (obj.OutBranchId === 0) {
id = [43, 48];
} else { } else {
if (obj.OutBranchId === 0) { id = [56, 53];
id = [43, 48]
} else {
id = [56, 53]
}
} }
this.$router.push({ }
name: 'ChoiceAddFinancialDocuments', this.$router.push({
query: { name: "ChoiceAddFinancialDocuments",
"Type": 2, query: {
"templateID": JSON.stringify(id), Type: 2,
"companyID": obj.OutBranchId, templateID: JSON.stringify(id),
"path": "", companyID: obj.OutBranchId,
'blank': 'y', path: "",
'orderObj': JSON.stringify(orderObj), blank: "y",
} orderObj: JSON.stringify(orderObj)
});
},
goZhiDan: function (obj, num, leadr, cur) {
if (!num) {
let totailMoney = Number(leadr.LeaderGetPriceT) + Number(cur.yiLing);
if (totailMoney > leadr.PlanPrice) return this.$message.error('最大领款为预付合计金额的95%!')
if (!leadr.LeaderGetPriceT || leadr.LeaderGetPriceT <= 0) return this.$message.error('请输入金额!')
} }
if (this.list.hotelNoSureInfo !== '') { });
this.$confirm(`${this.list.hotelNoSureInfo},是否去制单?`, this.$t('tips.tips'), { },
confirmButtonText: this.$t('pub.sureBtn'), goZhiDan: function(obj, num, leadr, cur) {
cancelButtonText: this.$t('pub.cancelBtn'), if (!num) {
type: 'warning' let totailMoney = Number(leadr.LeaderGetPriceT) + Number(cur.yiLing);
}).then(() => { if (totailMoney > leadr.PlanPrice)
this.goZhiDan2(obj, num, leadr, cur) return this.$message.error("最大领款为预付合计金额的95%!");
}).catch(() => { if (!leadr.LeaderGetPriceT || leadr.LeaderGetPriceT <= 0)
return false return this.$message.error("请输入金额!");
}
if (this.list.hotelNoSureInfo !== "") {
this.$confirm(
`${this.list.hotelNoSureInfo},是否去制单?`,
this.$t("tips.tips"),
{
confirmButtonText: this.$t("pub.sureBtn"),
cancelButtonText: this.$t("pub.cancelBtn"),
type: "warning"
}
)
.then(() => {
this.goZhiDan2(obj, num, leadr, cur);
})
.catch(() => {
return false;
}); });
} else { } else {
this.goZhiDan2(obj, num, leadr, cur) this.goZhiDan2(obj, num, leadr, cur);
}
},
addOtherList(index, id) {
this.list.OtherOrderReportList.OtherList.push({
OrderType: "1",
ID: 0,
UseDate: "",
CostProject: "0",
TotalNum: "0",
UnitPrice: "0",
Rebate: "0",
TotalPrice: "0",
Remark: "",
TCIDs: this.$route.query.id,
TCID: id,
UseCount: this.UseCount,
VoucherPicList: []
});
},
deleteOtherListItem(outIndex, index) {
this.list.OtherOrderReportList.OtherList.splice(index, 1);
},
addSelfPlayingIncomeList(index, id) {
this.list.OtherOrderReportList.SelfPlayingIncomeList.push({
OrderType: "4",
ID: 0,
UseDate: "",
CostProject: 0,
TotalNum: "0",
UnitPrice: "0",
Rebate: "0",
TotalPrice: "0",
Remark: "",
TCID: id,
UseCount: this.UseCount,
TCIDs: this.$route.query.id,
VoucherPicList: []
});
},
deleteSelfPlayingIncomeListItem(outIndex, index) {
this.list.OtherOrderReportList.SelfPlayingIncomeList.splice(index, 1);
},
addSelfPlayingExpendList(index, id) {
this.list.OtherOrderReportList.SelfPlayingExpendList.push({
OrderType: "5",
ID: 0,
UseDate: "",
CostProject: "",
TotalNum: "0",
UnitPrice: "0",
Rebate: "0",
TotalPrice: "0",
Remark: "",
TCID: id,
UseCount: this.UseCount,
TCIDs: this.$route.query.id,
VoucherPicList: []
});
},
deleteSelfPlayingExpendList(outIndex, index) {
this.list.OtherOrderReportList.SelfPlayingExpendList.splice(index, 1);
},
busTotalPrice(obj) {
let totalPrice = 0;
obj.forEach(item => {
totalPrice +=
Number(item.CostPrice) +
Number(item.HighSpeedPrice) +
Number(item.StopPrice);
});
return this.moneyFormat(totalPrice);
},
hotelTotalPrice(obj) {
let totalPrice = 0;
obj.OrderDetailsList.forEach((item, index) => {
var coefficient = 1;
//税别
if (obj.TaxType == 2) {
coefficient = 1 + 0.1;
} }
}, if (obj.PayStyle === 1 || obj.PayStyle === 11) {
addOtherList(index, id) { if (index == 4 && obj.DMCPayType !== 1 && obj.DMCPayType !== 11) {
this.list.OtherOrderReportList.OtherList.push({
OrderType: '1',
ID: 0,
UseDate: '',
CostProject: '0',
TotalNum: '0',
UnitPrice: '0',
Rebate: '0',
TotalPrice: '0',
Remark: '',
TCIDs: this.$route.query.id,
TCID: id,
UseCount: this.UseCount,
VoucherPicList: []
})
},
deleteOtherListItem(outIndex, index) {
this.list.OtherOrderReportList.OtherList.splice(index, 1)
},
addSelfPlayingIncomeList(index, id) {
this.list.OtherOrderReportList.SelfPlayingIncomeList.push({
OrderType: '4',
ID: 0,
UseDate: '',
CostProject: 0,
TotalNum: '0',
UnitPrice: '0',
Rebate: '0',
TotalPrice: '0',
Remark: '',
TCID: id,
UseCount: this.UseCount,
TCIDs: this.$route.query.id,
VoucherPicList: []
})
},
deleteSelfPlayingIncomeListItem(outIndex, index) {
this.list.OtherOrderReportList.SelfPlayingIncomeList.splice(index, 1)
},
addSelfPlayingExpendList(index, id) {
this.list.OtherOrderReportList.SelfPlayingExpendList.push({
OrderType: '5',
ID: 0,
UseDate: '',
CostProject: '',
TotalNum: '0',
UnitPrice: '0',
Rebate: '0',
TotalPrice: '0',
Remark: '',
TCID: id,
UseCount: this.UseCount,
TCIDs: this.$route.query.id,
VoucherPicList: []
})
},
deleteSelfPlayingExpendList(outIndex, index) {
this.list.OtherOrderReportList.SelfPlayingExpendList.splice(index, 1)
},
busTotalPrice(obj) {
let totalPrice = 0
obj.forEach(item => {
totalPrice += Number(item.CostPrice) + Number(item.HighSpeedPrice) + Number(item.StopPrice)
})
return this.moneyFormat(totalPrice)
},
hotelTotalPrice(obj) {
let totalPrice = 0;
obj.OrderDetailsList.forEach((item, index) => {
var coefficient = 1;
//税别
if (obj.TaxType == 2) {
coefficient = 1 + 0.1;
}
if (obj.PayStyle === 1 || obj.PayStyle === 11) {
if (index == 4 && obj.DMCPayType !== 1 && obj.DMCPayType !== 11) {
totalPrice += 0;
} else {
totalPrice += item.UnitPrice * (item.BookNum - item.HotelDiscount) * (coefficient - item.RebateRatio /
100);
}
if ((obj.OPState == 1 || obj.DMCState == 1) && item.HouseType != 6) {
totalPrice += item.BookNum * obj.InTangTax;
}
} else {
totalPrice += 0; totalPrice += 0;
} else {
totalPrice +=
item.UnitPrice *
(item.BookNum - item.HotelDiscount) *
(coefficient - item.RebateRatio / 100);
} }
}) if ((obj.OPState == 1 || obj.DMCState == 1) && item.HouseType != 6) {
totalPrice += obj.ParkFee + obj.CityTax; totalPrice += item.BookNum * obj.InTangTax;
return this.moneyFormat(totalPrice) }
}, } else {
diningTotalPrice(sObj, obj) { totalPrice += 0;
let totalPrice = 0
obj.forEach(x => {
totalPrice += x.PeoplePrice * (x.PeopleNum - x.Discount) * (1 - x.DiscountPrice / 100)
})
if (!(sObj.PayStyle == 1 || sObj.PayStyle == 11)) {
totalPrice = 0
}
return this.moneyFormat(totalPrice)
},
scenicTotalPrice(sObj, obj) {
let totalPrice = 0
obj.forEach(x => {
totalPrice += x.PeoplePrice * (x.UsePeopleNum - x.Discount) * (1 - x.DiscountPrice / 100)
})
if (sObj.PayStyle !== 1) {
totalPrice = 0
} }
return this.moneyFormat(totalPrice) });
}, totalPrice += obj.ParkFee + obj.CityTax;
otherTotalPrice(obj) { return this.moneyFormat(totalPrice);
let totalPrice = 0 },
obj.forEach(item => { diningTotalPrice(sObj, obj) {
totalPrice += item.TotalNum * item.UnitPrice * (1 - item.Rebate / 100) let totalPrice = 0;
}) obj.forEach(x => {
return this.moneyFormat(totalPrice) totalPrice +=
}, x.PeoplePrice *
saveData() { (x.PeopleNum - x.Discount) *
this.apipost('dmcstatistics_post_SetOtherOrderList', this.list.OtherOrderReportList, res => { (1 - x.DiscountPrice / 100);
});
if (!(sObj.PayStyle == 1 || sObj.PayStyle == 11)) {
totalPrice = 0;
}
return this.moneyFormat(totalPrice);
},
scenicTotalPrice(sObj, obj) {
let totalPrice = 0;
obj.forEach(x => {
totalPrice +=
x.PeoplePrice *
(x.UsePeopleNum - x.Discount) *
(1 - x.DiscountPrice / 100);
});
if (sObj.PayStyle !== 1) {
totalPrice = 0;
}
return this.moneyFormat(totalPrice);
},
otherTotalPrice(obj) {
let totalPrice = 0;
obj.forEach(item => {
totalPrice += item.TotalNum * item.UnitPrice * (1 - item.Rebate / 100);
});
return this.moneyFormat(totalPrice);
},
saveData() {
this.apipost(
"dmcstatistics_post_SetOtherOrderList",
this.list.OtherOrderReportList,
res => {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.$message.success(res.data.message) this.$message.success(res.data.message);
this.getNav() this.getNav();
this.getList() this.getList();
} else { } else {
this.$message.error(res.data.message) this.$message.error(res.data.message);
} }
}, err => {}) },
}, err => {}
saveitem(obj) { );
this.TemporaryItem = obj },
}, saveitem(obj) {
analyzeItem(obj, index) { //预览 this.TemporaryItem = obj;
this.picObj = [] },
obj.forEach(item => { analyzeItem(obj, index) {
this.picObj.push(item.url) //预览
}) this.picObj = [];
this.initialIndex = index obj.forEach(item => {
this.picIsShow = true this.picObj.push(item.url);
}, });
peopleStrToWord(str) { this.initialIndex = index;
if (str == 1) this.picIsShow = true;
return '大人' },
if (str == 2) peopleStrToWord(str) {
return '中人' if (str == 1) return "大人";
if (str == 3) if (str == 2) return "中人";
return '小人' if (str == 3) return "小人";
}, },
UseDinnerTypeToWord(str) { UseDinnerTypeToWord(str) {
if (str == 1) if (str == 1) return "早餐";
return '早餐' if (str == 2) return "午餐";
if (str == 2) if (str == 3) return "晚餐";
return '午餐' },
if (str == 3) CompareDate(d1, d2) {
return '晚餐' return new Date(d1.replace(/-/g, "/")) <= new Date(d2.replace(/-/g, "/"));
}, },
CompareDate(d1, d2) { getNav() {
return ((new Date(d1.replace(/-/g, "\/"))) <= (new Date(d2.replace(/-/g, "\/")))); let _this = this;
}, this.apipost(
getNav() { "dmcstatistics_post_GetHotelStaticsByTCIDs",
let _this = this {
this.apipost('dmcstatistics_post_GetHotelStaticsByTCIDs', {
TCIDs: this.$route.query.id TCIDs: this.$route.query.id
}, res => { },
res => {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
let nav = res.data.data.list; let nav = res.data.data.list;
this.LineId = res.data.data.EntryId this.LineId = res.data.data.EntryId;
if (nav[0].OutBranchId == 1216) { if (nav[0].OutBranchId == 1216) {
this.IsShowRMB = true; this.IsShowRMB = true;
} }
...@@ -1246,27 +1277,26 @@ ...@@ -1246,27 +1277,26 @@
nav.forEach(x => { nav.forEach(x => {
x.CurrencyIdArr = []; x.CurrencyIdArr = [];
nav.LeaderGetPriceT = 0; nav.LeaderGetPriceT = 0;
num += x.LeaderGetPrice num += x.LeaderGetPrice;
x.hideZDBtn = false; x.hideZDBtn = false;
if (Number(x.DMCRemark) >= 0) { if (Number(x.DMCRemark) >= 0) {
x.hideZDBtn = true; x.hideZDBtn = true;
} }
x.LeaderGetPriceList.forEach(lead => { x.LeaderGetPriceList.forEach(lead => {
if (x.CurrencyIdArr.indexOf(lead.CurrencyId) < 0) { if (x.CurrencyIdArr.indexOf(lead.CurrencyId) < 0) {
x.CurrencyIdArr.push(lead.CurrencyId) x.CurrencyIdArr.push(lead.CurrencyId);
} }
}) });
});
})
// 预付合计总金额 // 预付合计总金额
let CurrencyIdArr = []; let CurrencyIdArr = [];
this.CurrencyListMoney = []; this.CurrencyListMoney = [];
if (this.TotalNav.planPriceList) { if (this.TotalNav.planPriceList) {
this.TotalNav.planPriceList.forEach(item => { this.TotalNav.planPriceList.forEach(item => {
if (CurrencyIdArr.indexOf(item.CurrencyId) < 0) { if (CurrencyIdArr.indexOf(item.CurrencyId) < 0) {
CurrencyIdArr.push(item.CurrencyId) CurrencyIdArr.push(item.CurrencyId);
} }
}) });
CurrencyIdArr.forEach(id => { CurrencyIdArr.forEach(id => {
let obj = { let obj = {
money: 0, money: 0,
...@@ -1277,12 +1307,12 @@ ...@@ -1277,12 +1307,12 @@
obj.money += item.PlanTotalPrice; obj.money += item.PlanTotalPrice;
obj.CurrencyId = item.CurrencyId; obj.CurrencyId = item.CurrencyId;
} }
}) });
this.CurrencyListMoney.push(obj); this.CurrencyListMoney.push(obj);
}) });
} }
this.CurrencyListMoney.forEach((cur, i) => { this.CurrencyListMoney.forEach((cur, i) => {
cur.yiLing = 0 cur.yiLing = 0;
cur.LeaderGetPriceArr = []; cur.LeaderGetPriceArr = [];
nav.forEach(x => { nav.forEach(x => {
let obj = { let obj = {
...@@ -1298,43 +1328,57 @@ ...@@ -1298,43 +1328,57 @@
obj.LeaderGetPrice += price.OrderMakingPrice; obj.LeaderGetPrice += price.OrderMakingPrice;
cur.yiLing += price.OrderMakingPrice; cur.yiLing += price.OrderMakingPrice;
} }
}) });
cur.LeaderGetPriceArr.push(obj); cur.LeaderGetPriceArr.push(obj);
}) });
}) });
this.CurrencyListMoney.forEach((cur, i) => { this.CurrencyListMoney.forEach((cur, i) => {
cur.LeaderGetPriceArr.forEach(lead => { cur.LeaderGetPriceArr.forEach(lead => {
lead.LeaderGetPriceT = Math.floor(((cur.money * 0.95) - cur.yiLing) * 100) / 100; lead.LeaderGetPriceT =
Math.floor((cur.money * 0.95 - cur.yiLing) * 100) / 100;
lead.PlanPrice = cur.money * 0.95; lead.PlanPrice = cur.money * 0.95;
}) });
}) });
this.nav = nav; this.nav = nav;
} else { } else {
this.Error(res.data.message) this.Error(res.data.message);
} }
}, err => {}) },
}, err => {}
getTotalNav() { );
this.apipost('dmcstatistics_post_GetNewPlanTotalPrice_V2', { },
getTotalNav() {
this.apipost(
"dmcstatistics_post_GetNewPlanTotalPrice_V2",
{
TCIDs: this.$route.query.id TCIDs: this.$route.query.id
}, res => { },
res => {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.TotalNav = res.data.data; this.TotalNav = res.data.data;
this.getNav(); this.getNav();
} else { } else {
this.Error(res.data.message); this.Error(res.data.message);
} }
}, err => {}) },
}, err => {}
getList() { );
this.loading = true; },
this.apipost('dmcstatistics_post_GetGroupLeaderUserMoneyPlan', this.msg, res => { getList() {
this.loading = true;
this.apipost(
"dmcstatistics_post_GetGroupLeaderUserMoneyPlan",
this.msg,
res => {
this.loading = false; this.loading = false;
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.list = res.data.data; this.list = res.data.data;
this.ContractUrlCount = res.data.data.ContractUrlCount; this.ContractUrlCount = res.data.data.ContractUrlCount;
this.UseCount = this.list.UseCount; this.UseCount = this.list.UseCount;
if (this.list.OtherOrderReportList.OtherList && this.list.OtherOrderReportList.OtherList.length > 0) { if (
this.list.OtherOrderReportList.OtherList &&
this.list.OtherOrderReportList.OtherList.length > 0
) {
this.list.OtherOrderReportList.OtherList.forEach(x => { this.list.OtherOrderReportList.OtherList.forEach(x => {
x.CostProject = x.CostProject.toString(); x.CostProject = x.CostProject.toString();
}); });
...@@ -1342,278 +1386,278 @@ ...@@ -1342,278 +1386,278 @@
} else { } else {
this.Error(res.data.message); this.Error(res.data.message);
} }
}, err => {}) },
}, err => {}
}, );
mounted() {
this.isUpdate = this.$route.query.isUpdate;
this.msg.TCIDs = this.$route.query.id;
this.NewCombinationNum = this.$route.query.NewCombinationNum;
if (this.$route.query.OutBranchId == 1216) {
this.IsShowRMB = true;
}
this.getList();
this.getTotalNav();
this.getHangingAccountByTCIDList()
this.getzhuijiaList()
this.financeinfo_post_GetList();
} }
} },
mounted() {
this.isUpdate = this.$route.query.isUpdate;
this.msg.TCIDs = this.$route.query.id;
this.NewCombinationNum = this.$route.query.NewCombinationNum;
if (this.$route.query.OutBranchId == 1216) {
this.IsShowRMB = true;
}
this.getList();
this.getTotalNav();
this.getHangingAccountByTCIDList();
this.getzhuijiaList();
this.financeinfo_post_GetList();
}
};
</script> </script>
<style> <style>
.leaderReimbursementTableNav { .leaderReimbursementTableNav {
background: #d6cece; background: #d6cece;
width: 100%; width: 100%;
margin: 20px 0; margin: 20px 0;
} }
.leaderReimbursementTableNav tr th { .leaderReimbursementTableNav tr th {
background: #E6E6E6; background: #e6e6e6;
height: 40px; height: 40px;
font-size: 12px; font-size: 12px;
color: #333; color: #333;
} }
.leaderReimbursementTableNav tr { .leaderReimbursementTableNav tr {
background: #fff; background: #fff;
text-align: center; text-align: center;
height: 40px; height: 40px;
font-size: 12px; font-size: 12px;
} }
.leaderReimbursementTableNav tr td {
background: #fff;
text-align: center;
height: 20px;
font-size: 12px;
}
.leaderReimbursementTableNav ._go_detail p { .leaderReimbursementTableNav tr td {
cursor: pointer; background: #fff;
line-height: 25px; text-align: center;
} height: 20px;
font-size: 12px;
}
.leaderReimbursementTable { .leaderReimbursementTableNav ._go_detail p {
width: 100%; cursor: pointer;
margin: 20px 0; line-height: 25px;
border-collapse: collapse; }
}
.leaderReimbursementTable tr th { .leaderReimbursementTable {
background: #E6E6E6; width: 100%;
height: 40px; margin: 20px 0;
font-size: 13px; border-collapse: collapse;
color: #333; }
border: 1px solid #ccc;
text-align: center;
}
.leaderReimbursementTable tr td { .leaderReimbursementTable tr th {
border: 1px solid #ccc; background: #e6e6e6;
line-height: 25px; height: 40px;
height: 25px; font-size: 13px;
font-size: 12px; color: #333;
background: #fff; border: 1px solid #ccc;
text-align: center; text-align: center;
} }
.leader2Btn { .leaderReimbursementTable tr td {
color: #fff; border: 1px solid #ccc;
padding: 0 15px; line-height: 25px;
height: 30px; height: 25px;
background: #e95252; font-size: 12px;
border: 1px solid #e95252; background: #fff;
cursor: pointer; text-align: center;
border-radius: 15px; }
}
.Receipt_box { .leader2Btn {
padding: 15px; color: #fff;
color: #c94052; padding: 0 15px;
width: 614px; height: 30px;
background-color: rgba(242, 242, 242, 1); background: #e95252;
border: 1px solid rgba(228, 228, 228, 1) border: 1px solid #e95252;
} cursor: pointer;
border-radius: 15px;
}
.Receipt_box.color_blur { .Receipt_box {
color: #106BAF; padding: 15px;
} color: #c94052;
width: 614px;
background-color: rgba(242, 242, 242, 1);
border: 1px solid rgba(228, 228, 228, 1);
}
.Receipt_box.color_blur .rb_stit span { .Receipt_box.color_blur {
display: inline-block; color: #106baf;
border-bottom: 2px solid #106BAF; }
padding: 0 20px
}
.rb_tit { .Receipt_box.color_blur .rb_stit span {
font-size: 18px; display: inline-block;
text-align: center border-bottom: 2px solid #106baf;
} padding: 0 20px;
}
.rb_stit { .rb_tit {
font-size: 14px; font-size: 18px;
text-align: center text-align: center;
} }
.rb_stit span { .rb_stit {
display: inline-block; font-size: 14px;
border-bottom: 2px solid #C94052; text-align: center;
padding: 0 20px }
}
.rb_top_row { .rb_stit span {
display: flex; display: inline-block;
justify-content: space-between; border-bottom: 2px solid #c94052;
font-size: 12px; padding: 0 20px;
} }
.rb_top_row span._r_name { .rb_top_row {
color: #333333 display: flex;
} justify-content: space-between;
font-size: 12px;
}
.rb_top_row span._r_bold { .rb_top_row span._r_name {
font-weight: bold color: #333333;
} }
.rb_top_row ._r_time span { .rb_top_row span._r_bold {
color: #333333 font-weight: bold;
} }
._r_mb5 { .rb_top_row ._r_time span {
margin-bottom: 5px; color: #333333;
} }
.Receipt_table { ._r_mb5 {
width: 100%; margin-bottom: 5px;
font-size: 14px; }
text-align: center
}
.Receipt_table .th { .Receipt_table {
font-weight: 200 !important width: 100%;
} font-size: 14px;
text-align: center;
}
._r_mt10 { .Receipt_table .th {
margin-top: 10px; font-weight: 200 !important;
} }
._bg__ { ._r_mt10 {
display: inline-block; margin-top: 10px;
padding: 2px 8px; }
color: white;
border-radius: 4px
}
._bg_red { ._bg__ {
background-color: #E95252; display: inline-block;
} padding: 2px 8px;
color: white;
border-radius: 4px;
}
._bg_green { ._bg_red {
background-color: #2BB87C background-color: #e95252;
} }
.text_d { ._bg_green {
text-decoration: underline; background-color: #2bb87c;
cursor: pointer; }
}
.PingFangSC { .text_d {
font-weight: bold text-decoration: underline;
} cursor: pointer;
}
.Bill_par { .PingFangSC {
position: relative; font-weight: bold;
} }
tr._item_list { .Bill_par {
border-bottom: 1px solid #E5E5E5; position: relative;
height: 78px; }
}
tr._item_list td { tr._item_list {
border-bottom: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5;
padding: 10px; height: 78px;
} }
/* tr._t_head th{border-top: 1px solid #e5e5e5;} */ tr._item_list td {
tr._item_list td:first-child { border-bottom: 1px solid #e5e5e5;
border-left: 1px solid #e5e5e5; padding: 10px;
} }
tr._item_list td:last-child { /* tr._t_head th{border-top: 1px solid #e5e5e5;} */
border-right: 1px solid #e5e5e5; tr._item_list td:first-child {
} border-left: 1px solid #e5e5e5;
}
._head_img { tr._item_list td:last-child {
width: 28px; border-right: 1px solid #e5e5e5;
height: 28px; }
border-radius: 50%;
vertical-align: middle;
}
._btn_group { ._head_img {
font-size: 14px; width: 28px;
} height: 28px;
border-radius: 50%;
vertical-align: middle;
}
.icon-daiqueren { ._btn_group {
color: #4BCA81 font-size: 14px;
} }
.icon-yiqueren { .icon-daiqueren {
color: #4BCA81 color: #4bca81;
} }
.icon-yiquxiao { .icon-yiqueren {
color: #959595 color: #4bca81;
} }
.icon-shenhebohui { .icon-yiquxiao {
color: #E95252 color: #959595;
} }
.icon-icon-zancun { .icon-shenhebohui {
color: #FF9C01 color: #e95252;
} }
.singeRowTable tr:hover { .icon-icon-zancun {
background-color: white color: #ff9c01;
} }
._TradeWayList { .singeRowTable tr:hover {
padding: 5px 10px; background-color: white;
background-color: #EEEEEE; }
border-radius: 4px;
margin: 10px 0;
width: 230px
}
._bold { ._TradeWayList {
font-weight: bold padding: 5px 10px;
} background-color: #eeeeee;
border-radius: 4px;
margin: 10px 0;
width: 230px;
}
._bank_name, ._bold {
._bank_type { font-weight: bold;
display: inline-block; }
background-color: #333333;
color: white;
padding: 2px 4px;
border-radius: 4px;
margin-left: 10px;
}
._bank_name { ._bank_name,
margin-left: 10px; ._bank_type {
} display: inline-block;
background-color: #333333;
color: white;
padding: 2px 4px;
border-radius: 4px;
margin-left: 10px;
}
._bank_type { ._bank_name {
background-color: #2AAEF2 margin-left: 10px;
} }
._bank_type2 { ._bank_type {
background-color: #FF9C01 background-color: #2aaef2;
} }
._bank_type2 {
background-color: #ff9c01;
}
</style> </style>
...@@ -5007,7 +5007,6 @@ ...@@ -5007,7 +5007,6 @@
res => { res => {
this.loading = false; this.loading = false;
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
console.log(res,'resssssssss');
this.OrderDataList = res.data.data; this.OrderDataList = res.data.data;
this.IsUpdateOrderMoney = res.data.data.IsUpdateOrderMoney this.IsUpdateOrderMoney = res.data.data.IsUpdateOrderMoney
} }
......
...@@ -655,13 +655,11 @@ export default { ...@@ -655,13 +655,11 @@ export default {
}else if(this.index1 + 1==3){ }else if(this.index1 + 1==3){
period=this.yearVal period=this.yearVal
} }
console.log(this.yearVal,this.weekVal,this.monthVal)
let msg = { let msg = {
timeRange: this.index1 + 1, timeRange: this.index1 + 1,
userRange: this.index2 + 1, userRange: this.index2 + 1,
period period
}; };
console.log(msg)
this.apipost("user_get_usedsixSatistics", msg, r => { this.apipost("user_get_usedsixSatistics", msg, r => {
if(r.data.data && r.data.data.length>0){ if(r.data.data && r.data.data.length>0){
this.tableData = this.orderBy( this.tableData = this.orderBy(
......
<template> <template>
<div :class="isHorizontal === true?'vToolBar vToolBar_horizontal':'vToolBar vToolBar_vertical'"> <div
<div v-if="preShow()"> :class="
<i :class="isHorizontal === true?'iconfont ' + icon.leftZ:'iconfont ' + icon.topZ" @click="toPreZ"></i> isHorizontal === true
</div> ? 'vToolBar vToolBar_horizontal'
<div v-if="preShow()"> : 'vToolBar vToolBar_vertical'
<i :class="isHorizontal === true?'iconfont ' + icon.leftY:'iconfont ' + icon.topY" @click="toPreY"></i> "
</div> >
<div v-if="isHuan === true"> <div v-if="preShow()">
<i :class="'iconfont ' + icon.huan" @click="toHuan"></i> <i
</div> :class="
<div v-if="isXuan === true"> isHorizontal === true
<i :class="'iconfont ' + icon.xuan" @click="toXuan"></i> ? 'iconfont ' + icon.leftZ
</div> : 'iconfont ' + icon.topZ
<div v-if="isAdd === true" style="display:none;"> "
<i :class="'' + icon.add" @click="toAdd"></i> @click="toPreZ"
</div> ></i>
<div v-if="isDelete === true">
<i :class="'iconfont ' + icon.delete" @click="toDelete"></i>
</div>
<div v-if="nextShow()">
<i :class="isHorizontal === true?'iconfont ' + icon.rightY:'iconfont ' + icon.bottomY" @click="toNextY"></i>
</div>
<div v-if="nextShow()">
<i :class="isHorizontal === true?'iconfont ' + icon.rightZ:'iconfont ' + icon.bottomZ" @click="toNextZ"></i>
</div>
<div v-if="isReset === true">
<i title="重置图片位置" :class="'iconfont ' + icon.reset" @click="toReset"></i>
</div>
</div> </div>
<div v-if="preShow()">
<i
:class="
isHorizontal === true
? 'iconfont ' + icon.leftY
: 'iconfont ' + icon.topY
"
@click="toPreY"
></i>
</div>
<div v-if="isHuan === true">
<i :class="'iconfont ' + icon.huan" @click="toHuan"></i>
</div>
<div v-if="isXuan === true">
<i :class="'iconfont ' + icon.xuan" @click="toXuan"></i>
</div>
<div v-if="isAdd === true">
<i :class="'' + icon.add" @click="toAdd"></i>
</div>
<div v-if="isDelete === true">
<i :class="'iconfont ' + icon.delete" @click="toDelete"></i>
</div>
<div v-if="nextShow()">
<i
:class="
isHorizontal === true
? 'iconfont ' + icon.rightY
: 'iconfont ' + icon.bottomY
"
@click="toNextY"
></i>
</div>
<div v-if="nextShow()">
<i
:class="
isHorizontal === true
? 'iconfont ' + icon.rightZ
: 'iconfont ' + icon.bottomZ
"
@click="toNextZ"
></i>
</div>
<div v-if="isReset === true">
<i
title="重置图片位置"
:class="'iconfont ' + icon.reset"
@click="toReset"
></i>
</div>
</div>
</template> </template>
<script> <script>
export default { export default {
props: { props: {
// 是否横向 // 是否横向
isHorizontal: { isHorizontal: {
type: Boolean, type: Boolean,
default: true default: true
}, },
// 判断类型 // 判断类型
type: { type: {
type: Number, type: Number,
default: 1 default: 1
}, },
// 标识 // 标识
name: { name: {
type: String, type: String,
default: '' default: ""
}, },
// 当前版块下标 // 当前版块下标
index1: { index1: {
type: Number, type: Number,
default: 0 default: 0
}, },
// 当前项下标 // 当前项下标
index2: { index2: {
type: Number, type: Number,
default: 0 default: 0
}, },
// 版块数组长度 // 版块数组长度
length1: { length1: {
type: Number, type: Number,
default: 0 default: 0
}, },
// 图片数组长度 // 图片数组长度
length2: { length2: {
type: Number, type: Number,
default: 0 default: 0
}, },
// 是否显示"换" // 是否显示"换"
isHuan: { isHuan: {
type: Boolean, type: Boolean,
default: true default: true
}, },
// 是否显示"选" // 是否显示"选"
isXuan: { isXuan: {
type: Boolean, type: Boolean,
default: true default: true
}, },
//是否显示添加 //是否显示添加
isAdd: { isAdd: {
type: Boolean, type: Boolean,
default: true default: true
}, },
// 是否显示删除 // 是否显示删除
isDelete: { isDelete: {
type: Boolean, type: Boolean,
default: true default: true
}, },
// 是否重置 // 是否重置
isReset: { isReset: {
type: Boolean, type: Boolean,
default: false default: false
} }
}, },
data () { data() {
return { return {
icon: { icon: {
topZ: 'icon-zhiding', topZ: "icon-zhiding",
topY: 'icon-arrow-up', topY: "icon-arrow-up",
leftZ: 'icon-left1', leftZ: "icon-left1",
leftY: 'icon-left', leftY: "icon-left",
huan: 'icon-img_bdsc', huan: "icon-img_bdsc",
xuan: 'icon-img_cz', xuan: "icon-img_cz",
delete: 'icon-remove', delete: "icon-remove",
rightY: 'icon-right1', rightY: "icon-right1",
rightZ: 'icon-right', rightZ: "icon-right",
bottomY: 'icon-arrowdown', bottomY: "icon-arrowdown",
bottomZ: 'icon-zhidi', bottomZ: "icon-zhidi",
reset: 'icon-zhongzhi', reset: "icon-zhongzhi",
add: 'el-icon-plus' add: "el-icon-plus"
} }
} };
}, },
methods: { methods: {
preShow: function () { preShow: function() {
if (this.type === 1) { if (this.type === 1) {
if (this.length1!==0&&this.index1>0&&this.index1<this.length1) { if (
return true this.length1 !== 0 &&
} else { this.index1 > 0 &&
return false this.index1 < this.length1
} ) {
} else { return true;
if (this.length2!==0&&this.index2>0&&this.index2<this.length2) { } else {
return true return false;
} else { }
return false } else {
} if (
} this.length2 !== 0 &&
}, this.index2 > 0 &&
nextShow: function () { this.index2 < this.length2
if (this.type === 1) { ) {
if (this.length1!==0&&this.index1<this.length1-1) { return true;
return true } else {
} else { return false;
return false }
} }
} else { },
if (this.length2!==0&&this.index2<this.length2-1) { nextShow: function() {
return true if (this.type === 1) {
} else { if (this.length1 !== 0 && this.index1 < this.length1 - 1) {
return false return true;
} } else {
} return false;
}, }
toPreZ: function () { } else {
this.$emit('toPreZ', this.name, this.index1, this.index2) if (this.length2 !== 0 && this.index2 < this.length2 - 1) {
}, return true;
toPreY: function () { } else {
this.$emit('toPreY', this.name, this.index1, this.index2) return false;
},
toNextY: function () {
this.$emit('toNextY', this.name, this.index1, this.index2)
},
toNextZ: function () {
this.$emit('toNextZ', this.name, this.index1, this.index2)
},
toHuan: function () {
this.$emit('toHuan', this.name, this.index1, this.index2)
},
toXuan: function () {
this.$emit('toXuan', this.name, this.index1, this.index2)
},
toDelete: function () {
this.$emit('toDelete', this.name, this.index1, this.index2)
},
toReset: function () {
this.$emit('toReset', this.name, this.index1, this.index2)
},
//添加
toAdd:function()
{
this.$emit('toAdd', this.name, this.index1, this.index2)
}
} }
}
},
toPreZ: function() {
this.$emit("toPreZ", this.name, this.index1, this.index2);
},
toPreY: function() {
this.$emit("toPreY", this.name, this.index1, this.index2);
},
toNextY: function() {
this.$emit("toNextY", this.name, this.index1, this.index2);
},
toNextZ: function() {
this.$emit("toNextZ", this.name, this.index1, this.index2);
},
toHuan: function() {
this.$emit("toHuan", this.name, this.index1, this.index2);
},
toXuan: function() {
this.$emit("toXuan", this.name, this.index1, this.index2);
},
toDelete: function() {
this.$emit("toDelete", this.name, this.index1, this.index2);
},
toReset: function() {
this.$emit("toReset", this.name, this.index1, this.index2);
},
//添加
toAdd: function() {
this.$emit("toAdd", this.name, this.index1, this.index2);
} }
}
};
</script> </script>
<style scoped> <style scoped>
.vToolBar{ .vToolBar {
display: inline-block; display: inline-block;
font-size: 0px; font-size: 0px;
background-color: rgba(0, 0, 0, .7); background-color: rgba(0, 0, 0, 0.7);
border-radius: 2px; border-radius: 2px;
} }
.vToolBar_horizontal{
height: 30px; .vToolBar_horizontal {
white-space: nowrap; height: 30px;
} white-space: nowrap;
.vToolBar_vertical{ }
width: 30px;
} .vToolBar_vertical {
.vToolBar>div{ width: 30px;
display: inline-block; }
width: 30px;
height: 30px; .vToolBar > div {
vertical-align: top; display: inline-block;
cursor: pointer; width: 30px;
} height: 30px;
.vToolBar>div>i{ vertical-align: top;
display: inline-block; cursor: pointer;
width: 30px; }
height: 30px;
line-height: 30px; .vToolBar > div > i {
text-align: center; display: inline-block;
font-size: 20px; width: 30px;
color: #FFFFFF; height: 30px;
} line-height: 30px;
.vToolBar>div>i:hover{ text-align: center;
background-color: #666666; font-size: 20px;
} color: #ffffff;
</style> }
\ No newline at end of file
.vToolBar > div > i:hover {
background-color: #666666;
}
</style>
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -303,9 +303,6 @@ ...@@ -303,9 +303,6 @@
methods: { methods: {
//非直采切换 //非直采切换
NoDirectScenicCheck(number) { NoDirectScenicCheck(number) {
// this.dayObj.ScenicArray.forEach(x=>{
// x.ScenicJson = x.ScenicJsonStr ? JSON.parse(x.ScenicJsonStr) : { x:0, y:0 };
// })
if (this.dayObj.ScenicArray == null) { if (this.dayObj.ScenicArray == null) {
this.dayObj.ScenicArray = []; this.dayObj.ScenicArray = [];
} }
......
...@@ -2,7 +2,7 @@ import store from '../' ...@@ -2,7 +2,7 @@ import store from '../'
import config from '../../configs' import config from '../../configs'
import util from '../../utils' import util from '../../utils'
export function formatMsg (msg) { export function formatMsg(msg) {
const nim = store.state.nim const nim = store.state.nim
if (msg.type === 'robot') { if (msg.type === 'robot') {
if (msg.content && msg.content.flag === 'bot') { if (msg.content && msg.content.flag === 'bot') {
...@@ -25,21 +25,21 @@ export function formatMsg (msg) { ...@@ -25,21 +25,21 @@ export function formatMsg (msg) {
return msg return msg
} }
export function onRoamingMsgs (obj) { export function onRoamingMsgs(obj) {
let msgs = obj.msgs.map(msg => { let msgs = obj.msgs.map(msg => {
return formatMsg(msg) return formatMsg(msg)
}) })
store.commit('updateMsgs', msgs) store.commit('updateMsgs', msgs)
} }
export function onOfflineMsgs (obj) { export function onOfflineMsgs(obj) {
let msgs = obj.msgs.map(msg => { let msgs = obj.msgs.map(msg => {
return formatMsg(msg) return formatMsg(msg)
}) })
store.commit('updateMsgs', msgs) store.commit('updateMsgs', msgs)
} }
export function onMsg (msg) { export function onMsg(msg) {
msg = formatMsg(msg) msg = formatMsg(msg)
store.commit('putMsg', msg) store.commit('putMsg', msg)
if (msg.sessionId === store.state.currSessionId) { if (msg.sessionId === store.state.currSessionId) {
...@@ -52,7 +52,7 @@ export function onMsg (msg) { ...@@ -52,7 +52,7 @@ export function onMsg (msg) {
} }
} }
function onSendMsgDone (error, msg) { function onSendMsgDone(error, msg) {
store.dispatch('hideLoading') store.dispatch('hideLoading')
if (error) { if (error) {
// 被拉黑 // 被拉黑
...@@ -67,7 +67,7 @@ function onSendMsgDone (error, msg) { ...@@ -67,7 +67,7 @@ function onSendMsgDone (error, msg) {
} }
// 消息撤回 // 消息撤回
export function onRevocateMsg (error, msg) { export function onRevocateMsg(error, msg) {
const nim = store.state.nim const nim = store.state.nim
if (error) { if (error) {
if (error.code === 508) { if (error.code === 508) {
...@@ -94,7 +94,7 @@ export function onRevocateMsg (error, msg) { ...@@ -94,7 +94,7 @@ export function onRevocateMsg (error, msg) {
to: msg.to, to: msg.to,
tip, tip,
time: msg.time, time: msg.time,
done: function sendTipMsgDone (error, tipMsg) { done: function sendTipMsgDone(error, tipMsg) {
let idClient = msg.deletedIdClient || msg.idClient let idClient = msg.deletedIdClient || msg.idClient
store.commit('replaceMsg', { store.commit('replaceMsg', {
sessionId: msg.sessionId, sessionId: msg.sessionId,
...@@ -112,20 +112,28 @@ export function onRevocateMsg (error, msg) { ...@@ -112,20 +112,28 @@ export function onRevocateMsg (error, msg) {
}) })
} }
export function revocateMsg ({state, commit}, msg) { export function revocateMsg({
state,
commit
}, msg) {
const nim = state.nim const nim = state.nim
let {idClient} = msg let {
idClient
} = msg
msg = Object.assign(msg, state.msgsMap[idClient]) msg = Object.assign(msg, state.msgsMap[idClient])
nim.deleteMsg({ nim.deleteMsg({
msg, msg,
done: function deleteMsgDone (error) { done: function deleteMsgDone(error) {
onRevocateMsg(error, msg) onRevocateMsg(error, msg)
} }
}) })
} }
// 发送普通消息 // 发送普通消息
export function sendMsg ({state, commit}, obj) { export function sendMsg({
state,
commit
}, obj) {
const nim = state.nim const nim = state.nim
obj = obj || {} obj = obj || {}
let type = obj.type || '' let type = obj.type || ''
...@@ -152,13 +160,16 @@ export function sendMsg ({state, commit}, obj) { ...@@ -152,13 +160,16 @@ export function sendMsg ({state, commit}, obj) {
} }
} }
export function sendTip ({state, commit}, obj) { export function sendTip({
state,
commit
}, obj) {
const nim = store.state.nim const nim = store.state.nim
nim.sendTipMsg({ nim.sendTipMsg({
scene: obj.scene, scene: obj.scene,
to: obj.to, to: obj.to,
tip: obj.tip, tip: obj.tip,
done: function sendTipMsgDone (error, msg) { done: function sendTipMsgDone(error, msg) {
// 超哥 do something // 超哥 do something
onSendMsgDone(error, msg) onSendMsgDone(error, msg)
} }
...@@ -166,9 +177,16 @@ export function sendTip ({state, commit}, obj) { ...@@ -166,9 +177,16 @@ export function sendTip ({state, commit}, obj) {
} }
// 发送文件消息 // 发送文件消息
export function sendFileMsg ({state, commit}, obj) { export function sendFileMsg({
state,
commit
}, obj) {
const nim = state.nim const nim = state.nim
let {scene, to, fileInput} = obj let {
scene,
to,
fileInput
} = obj
let type = 'file' let type = 'file'
if (/\.(png|jpg|bmp|jpeg|gif)$/i.test(fileInput.value)) { if (/\.(png|jpg|bmp|jpeg|gif)$/i.test(fileInput.value)) {
type = 'image' type = 'image'
...@@ -191,7 +209,7 @@ export function sendFileMsg ({state, commit}, obj) { ...@@ -191,7 +209,7 @@ export function sendFileMsg ({state, commit}, obj) {
}, },
beforesend: function (msg) { beforesend: function (msg) {
}, },
done: function (error, msg) { done: function (error, msg) {
onSendMsgDone(error, msg) onSendMsgDone(error, msg)
...@@ -199,16 +217,26 @@ export function sendFileMsg ({state, commit}, obj) { ...@@ -199,16 +217,26 @@ export function sendFileMsg ({state, commit}, obj) {
}) })
} }
export function sendDataUrlMsg ({state, commit}, obj) { export function sendDataUrlMsg({
state,
commit
}, obj) {
const nim = state.nim const nim = state.nim
let {scene, to, dataURL, name} = obj let {
scene,
to,
dataURL,
name
} = obj
let type = 'file' let type = 'file'
if (/(png|jpg|bmp|jpeg|gif)$/i.test(name)) { if (/(png|jpg|bmp|jpeg|gif)$/i.test(name)) {
type = 'image' type = 'image'
} else if (/(mov|mp4|ogg|webm)$/i.test(name)) { } else if (/(mov|mp4|ogg|webm)$/i.test(name)) {
type = 'video' type = 'video'
} }
let otherMsg = {'fileName': name} let otherMsg = {
'fileName': name
}
store.dispatch('showLoading') store.dispatch('showLoading')
nim.sendFile({ nim.sendFile({
scene: scene, scene: scene,
...@@ -217,7 +245,7 @@ export function sendDataUrlMsg ({state, commit}, obj) { ...@@ -217,7 +245,7 @@ export function sendDataUrlMsg ({state, commit}, obj) {
dataURL: dataURL, dataURL: dataURL,
custom: JSON.stringify(otherMsg), custom: JSON.stringify(otherMsg),
uploadprogress: function (data) { uploadprogress: function (data) {
}, },
uploaderror: function () { uploaderror: function () {
console && console.log('上传失败') console && console.log('上传失败')
...@@ -235,9 +263,21 @@ export function sendDataUrlMsg ({state, commit}, obj) { ...@@ -235,9 +263,21 @@ export function sendDataUrlMsg ({state, commit}, obj) {
} }
// 发送机器人消息 // 发送机器人消息
export function sendRobotMsg ({state, commit}, obj) { export function sendRobotMsg({
state,
commit
}, obj) {
const nim = state.nim const nim = state.nim
let {type, scene, to, robotAccid, content, params, target, body} = obj let {
type,
scene,
to,
robotAccid,
content,
params,
target,
body
} = obj
scene = scene || 'p2p' scene = scene || 'p2p'
if (type === 'text') { if (type === 'text') {
nim.sendRobotMsg({ nim.sendRobotMsg({
...@@ -279,7 +319,10 @@ export function sendRobotMsg ({state, commit}, obj) { ...@@ -279,7 +319,10 @@ export function sendRobotMsg ({state, commit}, obj) {
} }
// 发送消息已读回执 // 发送消息已读回执
export function sendMsgReceipt ({state, commit}) { export function sendMsgReceipt({
state,
commit
}) {
// 如果有当前会话 // 如果有当前会话
let currSessionId = store.state.currSessionId let currSessionId = store.state.currSessionId
if (currSessionId) { if (currSessionId) {
...@@ -290,7 +333,7 @@ export function sendMsgReceipt ({state, commit}) { ...@@ -290,7 +333,7 @@ export function sendMsgReceipt ({state, commit}) {
if (state.sessionMap[currSessionId]) { if (state.sessionMap[currSessionId]) {
nim.sendMsgReceipt({ nim.sendMsgReceipt({
msg: state.sessionMap[currSessionId].lastMsg, msg: state.sessionMap[currSessionId].lastMsg,
done: function sendMsgReceiptDone (error, obj) { done: function sendMsgReceiptDone(error, obj) {
// do something // do something
} }
}) })
...@@ -299,21 +342,27 @@ export function sendMsgReceipt ({state, commit}) { ...@@ -299,21 +342,27 @@ export function sendMsgReceipt ({state, commit}) {
} }
} }
function sendMsgReceiptDone (error, obj) { function sendMsgReceiptDone(error, obj) {
console.log('发送消息已读回执' + (!error ? '成功' : '失败'), error, obj) console.log('发送消息已读回执' + (!error ? '成功' : '失败'), error, obj)
} }
export function getHistoryMsgs ({state, commit}, obj) { export function getHistoryMsgs({
state,
commit
}, obj) {
const nim = state.nim const nim = state.nim
if (nim) { if (nim) {
let {scene, to} = obj let {
scene,
to
} = obj
let options = { let options = {
scene, scene,
to, to,
reverse: false, reverse: false,
asc: true, asc: true,
limit: config.localMsglimit || 20, limit: config.localMsglimit || 20,
done: function getHistoryMsgsDone (error, obj) { done: function getHistoryMsgsDone(error, obj) {
if (obj.msgs) { if (obj.msgs) {
if (obj.msgs.length === 0) { if (obj.msgs.length === 0) {
commit('setNoMoreHistoryMsgs') commit('setNoMoreHistoryMsgs')
...@@ -341,11 +390,15 @@ export function getHistoryMsgs ({state, commit}, obj) { ...@@ -341,11 +390,15 @@ export function getHistoryMsgs ({state, commit}, obj) {
} }
} }
export function resetNoMoreHistoryMsgs ({commit}) { export function resetNoMoreHistoryMsgs({
commit
}) {
commit('resetNoMoreHistoryMsgs') commit('resetNoMoreHistoryMsgs')
} }
// 继续与机器人会话交互 // 继续与机器人会话交互
export function continueRobotMsg ({commit}, robotAccid) { export function continueRobotMsg({
commit
}, robotAccid) {
commit('continueRobotMsg', robotAccid) commit('continueRobotMsg', robotAccid)
} }
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