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

页面修改

parent 906a8cc5
...@@ -801,14 +801,12 @@ ...@@ -801,14 +801,12 @@
</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';
export default {
data() { data() {
return { return {
isUpdate: 'false', isUpdate: "false",
LineId: 0, LineId: 0,
loading: false, loading: false,
defaultSelectValue: 0, defaultSelectValue: 0,
...@@ -817,17 +815,17 @@ ...@@ -817,17 +815,17 @@
picObj: [], picObj: [],
TemporaryItem: {}, TemporaryItem: {},
msg: { msg: {
TCIDs: '', TCIDs: "",
NewCombinationNum: '' NewCombinationNum: ""
}, },
zhuijiaList: [], zhuijiaList: [],
list: [], list: [],
nav: [], nav: [],
TravelDayNum: 0, TravelDayNum: 0,
RealityNum: 0, RealityNum: 0,
UseCount: '', UseCount: "",
//定团号 //定团号
NewCombinationNum: '', NewCombinationNum: "",
TotalNav: [], TotalNav: [],
LeaderGetPrice: 0, LeaderGetPrice: 0,
HangingList: [], HangingList: [],
...@@ -847,7 +845,7 @@ ...@@ -847,7 +845,7 @@
//判断是否显示人民币 //判断是否显示人民币
IsShowRMB: false, IsShowRMB: false,
ContractUrlCount: 1 ContractUrlCount: 1
} };
}, },
components: { components: {
commonHotelInfo commonHotelInfo
...@@ -855,29 +853,37 @@ ...@@ -855,29 +853,37 @@
methods: { methods: {
// 20190815 新增领款单据重新生成自动带上计算后的金额 // 20190815 新增领款单据重新生成自动带上计算后的金额
goFncEditUrl(url, crId, frId) { goFncEditUrl(url, crId, frId) {
let obj = {} let obj = {};
this.CurrencyListMoney.map(x => { this.CurrencyListMoney.map(x => {
if (x.CurrencyId == crId) { if (x.CurrencyId == crId) {
obj = x obj = x;
} }
}) });
let price = obj.money * 0.95 let price = obj.money * 0.95;
let calcPrice = 0 let calcPrice = 0;
if (crId == 1) { //人民币 if (crId == 1) {
calcPrice = parseInt(price / 1000) > 0 ? parseInt(price / 1000) * 1000 : parseInt(price) //人民币
} else { // 其他 calcPrice =
calcPrice = parseInt(price / 10000) > 0 ? parseInt(price / 10000) * 10000 : parseInt(price) 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({ this.$router.push({
name: url, name: url,
query: { query: {
"FrID": frId, FrID: frId,
"blank": 'y', blank: "y",
"edit": true, edit: true,
"dijieEditMoney": calcPrice, dijieEditMoney: calcPrice,
"tab": '修改财务单据' tab: "修改财务单据"
} }
}) });
}, },
GetCurrency(Id) { GetCurrency(Id) {
var str = ""; var str = "";
...@@ -930,22 +936,27 @@ ...@@ -930,22 +936,27 @@
} }
return str; return str;
}, },
financeinfo_post_GetList() { // 币种类型 financeinfo_post_GetList() {
this.apipost('financeinfo_post_GetList', { // 币种类型
Name: '' this.apipost(
}, res => { "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) { ZhuiJiaTuanKuan(item) {
let TCIDARR = [item.TCIDS] // [this.$route.query.id] let TCIDARR = [item.TCIDS]; // [this.$route.query.id]
let orderObj = { let orderObj = {
OrderID: 0, OrderID: 0,
OrderSource: 8, OrderSource: 8,
...@@ -954,66 +965,68 @@ ...@@ -954,66 +965,68 @@
TCIDList: TCIDARR, TCIDList: TCIDARR,
TravelReplenish: this.$route.query.id, TravelReplenish: this.$route.query.id,
OtherType: 1 OtherType: 1
} };
this.$router.push({ this.$router.push({
name: 'ChoiceAddFinancialDocuments', name: "ChoiceAddFinancialDocuments",
query: { query: {
"Type": 2, Type: 2,
"companyID": item.companyID, companyID: item.companyID,
"path": "", path: "",
'blank': 'y', blank: "y",
'orderObj': JSON.stringify(orderObj), orderObj: JSON.stringify(orderObj)
} }
}); });
}, },
getzhuijiaList() { getzhuijiaList() {
this.apipost( this.apipost(
'Financial_post_GetTravelFinanceReplenishList', { "Financial_post_GetTravelFinanceReplenishList",
{
TravelReplenish: this.$route.query.id TravelReplenish: this.$route.query.id
}, },
res => { res => {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.zhuijiaList = res.data.data.list this.zhuijiaList = res.data.data.list;
} }
}, },
err => {} err => {}
) );
}, },
getHangingAccountByTCIDList: function () { getHangingAccountByTCIDList: function() {
this.apipost( this.apipost(
'Financial_post_GetHangingAccountByTCIDList', { "Financial_post_GetHangingAccountByTCIDList",
{
TCIDs: this.$route.query.id TCIDs: this.$route.query.id
}, },
res => { res => {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.HangingList = res.data.data this.HangingList = res.data.data;
} }
}, },
err => {} err => {}
) );
}, },
goFncUrl: function (path, id) { goFncUrl: function(path, id) {
this.$router.push({ this.$router.push({
name: path, name: path,
query: { query: {
"id": id, id: id,
blank: 'y' blank: "y"
} }
}) });
}, },
goHotelDetail: function (id, num, TCNUM, path) { goHotelDetail: function(id, num, TCNUM, path) {
this.$router.push({ this.$router.push({
name: path, name: path,
query: { query: {
"id": id, id: id,
"NewCombinationNum": num, NewCombinationNum: num,
"TCNUM": TCNUM, TCNUM: TCNUM,
'blank': 'y', blank: "y"
} }
}); });
}, },
goZhiDan2: function (obj, type, leadr, cur) { goZhiDan2: function(obj, type, leadr, cur) {
let TCIDARR = [obj.TCIDS] let TCIDARR = [obj.TCIDS];
let orderObj = { let orderObj = {
OrderID: 0, OrderID: 0,
OrderSource: 8, OrderSource: 8,
...@@ -1023,117 +1036,127 @@ ...@@ -1023,117 +1036,127 @@
CostType: 56, CostType: 56,
Money: leadr.LeaderGetPriceT, Money: leadr.LeaderGetPriceT,
TCNUMS: obj.TCNUMS, TCNUMS: obj.TCNUMS,
CurrencyId: leadr.CurrencyId, CurrencyId: leadr.CurrencyId
} };
let id = []; let id = [];
console.log("nowLineId:"+obj.LineId+"old:"+ this.LineId);
if (obj.LineId == this.LineId) { if (obj.LineId == this.LineId) {
id = [98, 99] id = [98, 99];
} else { } else {
if (obj.OutBranchId === 0) { if (obj.OutBranchId === 0) {
id = [43, 48] id = [43, 48];
} else { } else {
id = [56, 53] id = [56, 53];
} }
} }
this.$router.push({ this.$router.push({
name: 'ChoiceAddFinancialDocuments', name: "ChoiceAddFinancialDocuments",
query: { query: {
"Type": 2, Type: 2,
"templateID": JSON.stringify(id), templateID: JSON.stringify(id),
"companyID": obj.OutBranchId, companyID: obj.OutBranchId,
"path": "", path: "",
'blank': 'y', blank: "y",
'orderObj': JSON.stringify(orderObj), orderObj: JSON.stringify(orderObj)
} }
}); });
}, },
goZhiDan: function (obj, num, leadr, cur) { goZhiDan: function(obj, num, leadr, cur) {
if (!num) { if (!num) {
let totailMoney = Number(leadr.LeaderGetPriceT) + Number(cur.yiLing); let totailMoney = Number(leadr.LeaderGetPriceT) + Number(cur.yiLing);
if (totailMoney > leadr.PlanPrice) return this.$message.error('最大领款为预付合计金额的95%!') if (totailMoney > leadr.PlanPrice)
if (!leadr.LeaderGetPriceT || leadr.LeaderGetPriceT <= 0) return this.$message.error('请输入金额!') 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"),
cancelButtonText: this.$t("pub.cancelBtn"),
type: "warning"
} }
if (this.list.hotelNoSureInfo !== '') { )
this.$confirm(`${this.list.hotelNoSureInfo},是否去制单?`, this.$t('tips.tips'), { .then(() => {
confirmButtonText: this.$t('pub.sureBtn'), this.goZhiDan2(obj, num, leadr, cur);
cancelButtonText: this.$t('pub.cancelBtn'), })
type: 'warning' .catch(() => {
}).then(() => { return false;
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) { addOtherList(index, id) {
this.list.OtherOrderReportList.OtherList.push({ this.list.OtherOrderReportList.OtherList.push({
OrderType: '1', OrderType: "1",
ID: 0, ID: 0,
UseDate: '', UseDate: "",
CostProject: '0', CostProject: "0",
TotalNum: '0', TotalNum: "0",
UnitPrice: '0', UnitPrice: "0",
Rebate: '0', Rebate: "0",
TotalPrice: '0', TotalPrice: "0",
Remark: '', Remark: "",
TCIDs: this.$route.query.id, TCIDs: this.$route.query.id,
TCID: id, TCID: id,
UseCount: this.UseCount, UseCount: this.UseCount,
VoucherPicList: [] VoucherPicList: []
}) });
}, },
deleteOtherListItem(outIndex, index) { deleteOtherListItem(outIndex, index) {
this.list.OtherOrderReportList.OtherList.splice(index, 1) this.list.OtherOrderReportList.OtherList.splice(index, 1);
}, },
addSelfPlayingIncomeList(index, id) { addSelfPlayingIncomeList(index, id) {
this.list.OtherOrderReportList.SelfPlayingIncomeList.push({ this.list.OtherOrderReportList.SelfPlayingIncomeList.push({
OrderType: '4', OrderType: "4",
ID: 0, ID: 0,
UseDate: '', UseDate: "",
CostProject: 0, CostProject: 0,
TotalNum: '0', TotalNum: "0",
UnitPrice: '0', UnitPrice: "0",
Rebate: '0', Rebate: "0",
TotalPrice: '0', TotalPrice: "0",
Remark: '', Remark: "",
TCID: id, TCID: id,
UseCount: this.UseCount, UseCount: this.UseCount,
TCIDs: this.$route.query.id, TCIDs: this.$route.query.id,
VoucherPicList: [] VoucherPicList: []
}) });
}, },
deleteSelfPlayingIncomeListItem(outIndex, index) { deleteSelfPlayingIncomeListItem(outIndex, index) {
this.list.OtherOrderReportList.SelfPlayingIncomeList.splice(index, 1) this.list.OtherOrderReportList.SelfPlayingIncomeList.splice(index, 1);
}, },
addSelfPlayingExpendList(index, id) { addSelfPlayingExpendList(index, id) {
this.list.OtherOrderReportList.SelfPlayingExpendList.push({ this.list.OtherOrderReportList.SelfPlayingExpendList.push({
OrderType: '5', OrderType: "5",
ID: 0, ID: 0,
UseDate: '', UseDate: "",
CostProject: '', CostProject: "",
TotalNum: '0', TotalNum: "0",
UnitPrice: '0', UnitPrice: "0",
Rebate: '0', Rebate: "0",
TotalPrice: '0', TotalPrice: "0",
Remark: '', Remark: "",
TCID: id, TCID: id,
UseCount: this.UseCount, UseCount: this.UseCount,
TCIDs: this.$route.query.id, TCIDs: this.$route.query.id,
VoucherPicList: [] VoucherPicList: []
}) });
}, },
deleteSelfPlayingExpendList(outIndex, index) { deleteSelfPlayingExpendList(outIndex, index) {
this.list.OtherOrderReportList.SelfPlayingExpendList.splice(index, 1) this.list.OtherOrderReportList.SelfPlayingExpendList.splice(index, 1);
}, },
busTotalPrice(obj) { busTotalPrice(obj) {
let totalPrice = 0 let totalPrice = 0;
obj.forEach(item => { obj.forEach(item => {
totalPrice += Number(item.CostPrice) + Number(item.HighSpeedPrice) + Number(item.StopPrice) totalPrice +=
}) Number(item.CostPrice) +
return this.moneyFormat(totalPrice) Number(item.HighSpeedPrice) +
Number(item.StopPrice);
});
return this.moneyFormat(totalPrice);
}, },
hotelTotalPrice(obj) { hotelTotalPrice(obj) {
let totalPrice = 0; let totalPrice = 0;
...@@ -1147,98 +1170,106 @@ ...@@ -1147,98 +1170,106 @@
if (index == 4 && obj.DMCPayType !== 1 && obj.DMCPayType !== 11) { if (index == 4 && obj.DMCPayType !== 1 && obj.DMCPayType !== 11) {
totalPrice += 0; totalPrice += 0;
} else { } else {
totalPrice += item.UnitPrice * (item.BookNum - item.HotelDiscount) * (coefficient - item.RebateRatio / totalPrice +=
100); item.UnitPrice *
(item.BookNum - item.HotelDiscount) *
(coefficient - item.RebateRatio / 100);
} }
if ((obj.OPState == 1 || obj.DMCState == 1) && item.HouseType != 6) { if ((obj.OPState == 1 || obj.DMCState == 1) && item.HouseType != 6) {
totalPrice += item.BookNum * obj.InTangTax; totalPrice += item.BookNum * obj.InTangTax;
} }
} else { } else {
totalPrice += 0; totalPrice += 0;
} }
}) });
totalPrice += obj.ParkFee + obj.CityTax; totalPrice += obj.ParkFee + obj.CityTax;
return this.moneyFormat(totalPrice) return this.moneyFormat(totalPrice);
}, },
diningTotalPrice(sObj, obj) { diningTotalPrice(sObj, obj) {
let totalPrice = 0 let totalPrice = 0;
obj.forEach(x => { obj.forEach(x => {
totalPrice += x.PeoplePrice * (x.PeopleNum - x.Discount) * (1 - x.DiscountPrice / 100) totalPrice +=
}) x.PeoplePrice *
(x.PeopleNum - x.Discount) *
(1 - x.DiscountPrice / 100);
});
if (!(sObj.PayStyle == 1 || sObj.PayStyle == 11)) { if (!(sObj.PayStyle == 1 || sObj.PayStyle == 11)) {
totalPrice = 0 totalPrice = 0;
} }
return this.moneyFormat(totalPrice) return this.moneyFormat(totalPrice);
}, },
scenicTotalPrice(sObj, obj) { scenicTotalPrice(sObj, obj) {
let totalPrice = 0 let totalPrice = 0;
obj.forEach(x => { obj.forEach(x => {
totalPrice += x.PeoplePrice * (x.UsePeopleNum - x.Discount) * (1 - x.DiscountPrice / 100) totalPrice +=
}) x.PeoplePrice *
(x.UsePeopleNum - x.Discount) *
(1 - x.DiscountPrice / 100);
});
if (sObj.PayStyle !== 1) { if (sObj.PayStyle !== 1) {
totalPrice = 0 totalPrice = 0;
} }
return this.moneyFormat(totalPrice) return this.moneyFormat(totalPrice);
}, },
otherTotalPrice(obj) { otherTotalPrice(obj) {
let totalPrice = 0 let totalPrice = 0;
obj.forEach(item => { obj.forEach(item => {
totalPrice += item.TotalNum * item.UnitPrice * (1 - item.Rebate / 100) totalPrice += item.TotalNum * item.UnitPrice * (1 - item.Rebate / 100);
}) });
return this.moneyFormat(totalPrice) return this.moneyFormat(totalPrice);
}, },
saveData() { saveData() {
this.apipost('dmcstatistics_post_SetOtherOrderList', this.list.OtherOrderReportList, res => { 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) { saveitem(obj) {
this.TemporaryItem = obj this.TemporaryItem = obj;
}, },
analyzeItem(obj, index) { //预览 analyzeItem(obj, index) {
this.picObj = [] //预览
this.picObj = [];
obj.forEach(item => { obj.forEach(item => {
this.picObj.push(item.url) this.picObj.push(item.url);
}) });
this.initialIndex = index this.initialIndex = index;
this.picIsShow = true this.picIsShow = true;
}, },
peopleStrToWord(str) { peopleStrToWord(str) {
if (str == 1) if (str == 1) return "大人";
return '大人' if (str == 2) return "中人";
if (str == 2) if (str == 3) 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)
return '晚餐'
}, },
CompareDate(d1, d2) { CompareDate(d1, d2) {
return ((new Date(d1.replace(/-/g, "\/"))) <= (new Date(d2.replace(/-/g, "\/")))); return new Date(d1.replace(/-/g, "/")) <= new Date(d2.replace(/-/g, "/"));
}, },
getNav() { getNav() {
let _this = this let _this = this;
this.apipost('dmcstatistics_post_GetHotelStaticsByTCIDs', { 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() { getTotalNav() {
this.apipost('dmcstatistics_post_GetNewPlanTotalPrice_V2', { 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() { getList() {
this.loading = true; this.loading = true;
this.apipost('dmcstatistics_post_GetGroupLeaderUserMoneyPlan', this.msg, res => { 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,8 +1386,10 @@ ...@@ -1342,8 +1386,10 @@
} else { } else {
this.Error(res.data.message); this.Error(res.data.message);
} }
}, err => {})
}, },
err => {}
);
}
}, },
mounted() { mounted() {
this.isUpdate = this.$route.query.isUpdate; this.isUpdate = this.$route.query.isUpdate;
...@@ -1355,72 +1401,71 @@ ...@@ -1355,72 +1401,71 @@
} }
this.getList(); this.getList();
this.getTotalNav(); this.getTotalNav();
this.getHangingAccountByTCIDList() this.getHangingAccountByTCIDList();
this.getzhuijiaList() this.getzhuijiaList();
this.financeinfo_post_GetList(); 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 { .leaderReimbursementTableNav tr td {
background: #fff; background: #fff;
text-align: center; text-align: center;
height: 20px; height: 20px;
font-size: 12px; font-size: 12px;
} }
.leaderReimbursementTableNav ._go_detail p { .leaderReimbursementTableNav ._go_detail p {
cursor: pointer; cursor: pointer;
line-height: 25px; line-height: 25px;
} }
.leaderReimbursementTable { .leaderReimbursementTable {
width: 100%; width: 100%;
margin: 20px 0; margin: 20px 0;
border-collapse: collapse; border-collapse: collapse;
} }
.leaderReimbursementTable tr th { .leaderReimbursementTable tr th {
background: #E6E6E6; background: #e6e6e6;
height: 40px; height: 40px;
font-size: 13px; font-size: 13px;
color: #333; color: #333;
border: 1px solid #ccc; border: 1px solid #ccc;
text-align: center; text-align: center;
} }
.leaderReimbursementTable tr td { .leaderReimbursementTable tr td {
border: 1px solid #ccc; border: 1px solid #ccc;
line-height: 25px; line-height: 25px;
height: 25px; height: 25px;
font-size: 12px; font-size: 12px;
background: #fff; background: #fff;
text-align: center; text-align: center;
} }
.leader2Btn { .leader2Btn {
color: #fff; color: #fff;
padding: 0 15px; padding: 0 15px;
height: 30px; height: 30px;
...@@ -1428,192 +1473,191 @@ ...@@ -1428,192 +1473,191 @@
border: 1px solid #e95252; border: 1px solid #e95252;
cursor: pointer; cursor: pointer;
border-radius: 15px; border-radius: 15px;
} }
.Receipt_box { .Receipt_box {
padding: 15px; padding: 15px;
color: #c94052; color: #c94052;
width: 614px; width: 614px;
background-color: rgba(242, 242, 242, 1); background-color: rgba(242, 242, 242, 1);
border: 1px solid rgba(228, 228, 228, 1) border: 1px solid rgba(228, 228, 228, 1);
} }
.Receipt_box.color_blur { .Receipt_box.color_blur {
color: #106BAF; color: #106baf;
} }
.Receipt_box.color_blur .rb_stit span { .Receipt_box.color_blur .rb_stit span {
display: inline-block; display: inline-block;
border-bottom: 2px solid #106BAF; border-bottom: 2px solid #106baf;
padding: 0 20px padding: 0 20px;
} }
.rb_tit { .rb_tit {
font-size: 18px; font-size: 18px;
text-align: center text-align: center;
} }
.rb_stit { .rb_stit {
font-size: 14px; font-size: 14px;
text-align: center text-align: center;
} }
.rb_stit span { .rb_stit span {
display: inline-block; display: inline-block;
border-bottom: 2px solid #C94052; border-bottom: 2px solid #c94052;
padding: 0 20px padding: 0 20px;
} }
.rb_top_row { .rb_top_row {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
font-size: 12px; font-size: 12px;
} }
.rb_top_row span._r_name { .rb_top_row span._r_name {
color: #333333 color: #333333;
} }
.rb_top_row span._r_bold { .rb_top_row span._r_bold {
font-weight: bold font-weight: bold;
} }
.rb_top_row ._r_time span { .rb_top_row ._r_time span {
color: #333333 color: #333333;
} }
._r_mb5 { ._r_mb5 {
margin-bottom: 5px; margin-bottom: 5px;
} }
.Receipt_table { .Receipt_table {
width: 100%; width: 100%;
font-size: 14px; font-size: 14px;
text-align: center text-align: center;
} }
.Receipt_table .th { .Receipt_table .th {
font-weight: 200 !important font-weight: 200 !important;
} }
._r_mt10 { ._r_mt10 {
margin-top: 10px; margin-top: 10px;
} }
._bg__ { ._bg__ {
display: inline-block; display: inline-block;
padding: 2px 8px; padding: 2px 8px;
color: white; color: white;
border-radius: 4px border-radius: 4px;
} }
._bg_red { ._bg_red {
background-color: #E95252; background-color: #e95252;
} }
._bg_green { ._bg_green {
background-color: #2BB87C background-color: #2bb87c;
} }
.text_d { .text_d {
text-decoration: underline; text-decoration: underline;
cursor: pointer; cursor: pointer;
} }
.PingFangSC { .PingFangSC {
font-weight: bold font-weight: bold;
} }
.Bill_par { .Bill_par {
position: relative; position: relative;
} }
tr._item_list { tr._item_list {
border-bottom: 1px solid #E5E5E5; border-bottom: 1px solid #e5e5e5;
height: 78px; height: 78px;
} }
tr._item_list td { tr._item_list td {
border-bottom: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5;
padding: 10px; padding: 10px;
} }
/* tr._t_head th{border-top: 1px solid #e5e5e5;} */ /* tr._t_head th{border-top: 1px solid #e5e5e5;} */
tr._item_list td:first-child { tr._item_list td:first-child {
border-left: 1px solid #e5e5e5; border-left: 1px solid #e5e5e5;
} }
tr._item_list td:last-child { tr._item_list td:last-child {
border-right: 1px solid #e5e5e5; border-right: 1px solid #e5e5e5;
} }
._head_img { ._head_img {
width: 28px; width: 28px;
height: 28px; height: 28px;
border-radius: 50%; border-radius: 50%;
vertical-align: middle; vertical-align: middle;
} }
._btn_group { ._btn_group {
font-size: 14px; font-size: 14px;
} }
.icon-daiqueren { .icon-daiqueren {
color: #4BCA81 color: #4bca81;
} }
.icon-yiqueren { .icon-yiqueren {
color: #4BCA81 color: #4bca81;
} }
.icon-yiquxiao { .icon-yiquxiao {
color: #959595 color: #959595;
} }
.icon-shenhebohui { .icon-shenhebohui {
color: #E95252 color: #e95252;
} }
.icon-icon-zancun { .icon-icon-zancun {
color: #FF9C01 color: #ff9c01;
} }
.singeRowTable tr:hover { .singeRowTable tr:hover {
background-color: white background-color: white;
} }
._TradeWayList { ._TradeWayList {
padding: 5px 10px; padding: 5px 10px;
background-color: #EEEEEE; background-color: #eeeeee;
border-radius: 4px; border-radius: 4px;
margin: 10px 0; margin: 10px 0;
width: 230px width: 230px;
} }
._bold { ._bold {
font-weight: bold font-weight: bold;
} }
._bank_name, ._bank_name,
._bank_type { ._bank_type {
display: inline-block; display: inline-block;
background-color: #333333; background-color: #333333;
color: white; color: white;
padding: 2px 4px; padding: 2px 4px;
border-radius: 4px; border-radius: 4px;
margin-left: 10px; margin-left: 10px;
} }
._bank_name { ._bank_name {
margin-left: 10px; margin-left: 10px;
} }
._bank_type {
background-color: #2AAEF2
}
._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
:class="
isHorizontal === true
? 'vToolBar vToolBar_horizontal'
: 'vToolBar vToolBar_vertical'
"
>
<div v-if="preShow()"> <div v-if="preShow()">
<i :class="isHorizontal === true?'iconfont ' + icon.leftZ:'iconfont ' + icon.topZ" @click="toPreZ"></i> <i
:class="
isHorizontal === true
? 'iconfont ' + icon.leftZ
: 'iconfont ' + icon.topZ
"
@click="toPreZ"
></i>
</div> </div>
<div v-if="preShow()"> <div v-if="preShow()">
<i :class="isHorizontal === true?'iconfont ' + icon.leftY:'iconfont ' + icon.topY" @click="toPreY"></i> <i
:class="
isHorizontal === true
? 'iconfont ' + icon.leftY
: 'iconfont ' + icon.topY
"
@click="toPreY"
></i>
</div> </div>
<div v-if="isHuan === true"> <div v-if="isHuan === true">
<i :class="'iconfont ' + icon.huan" @click="toHuan"></i> <i :class="'iconfont ' + icon.huan" @click="toHuan"></i>
...@@ -12,26 +32,44 @@ ...@@ -12,26 +32,44 @@
<div v-if="isXuan === true"> <div v-if="isXuan === true">
<i :class="'iconfont ' + icon.xuan" @click="toXuan"></i> <i :class="'iconfont ' + icon.xuan" @click="toXuan"></i>
</div> </div>
<div v-if="isAdd === true" style="display:none;"> <div v-if="isAdd === true">
<i :class="'' + icon.add" @click="toAdd"></i> <i :class="'' + icon.add" @click="toAdd"></i>
</div> </div>
<div v-if="isDelete === true"> <div v-if="isDelete === true">
<i :class="'iconfont ' + icon.delete" @click="toDelete"></i> <i :class="'iconfont ' + icon.delete" @click="toDelete"></i>
</div> </div>
<div v-if="nextShow()"> <div v-if="nextShow()">
<i :class="isHorizontal === true?'iconfont ' + icon.rightY:'iconfont ' + icon.bottomY" @click="toNextY"></i> <i
:class="
isHorizontal === true
? 'iconfont ' + icon.rightY
: 'iconfont ' + icon.bottomY
"
@click="toNextY"
></i>
</div> </div>
<div v-if="nextShow()"> <div v-if="nextShow()">
<i :class="isHorizontal === true?'iconfont ' + icon.rightZ:'iconfont ' + icon.bottomZ" @click="toNextZ"></i> <i
:class="
isHorizontal === true
? 'iconfont ' + icon.rightZ
: 'iconfont ' + icon.bottomZ
"
@click="toNextZ"
></i>
</div> </div>
<div v-if="isReset === true"> <div v-if="isReset === true">
<i title="重置图片位置" :class="'iconfont ' + icon.reset" @click="toReset"></i> <i
title="重置图片位置"
:class="'iconfont ' + icon.reset"
@click="toReset"
></i>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
props: { props: {
// 是否横向 // 是否横向
isHorizontal: { isHorizontal: {
...@@ -46,7 +84,7 @@ ...@@ -46,7 +84,7 @@
// 标识 // 标识
name: { name: {
type: String, type: String,
default: '' default: ""
}, },
// 当前版块下标 // 当前版块下标
index1: { index1: {
...@@ -94,120 +132,132 @@ ...@@ -94,120 +132,132 @@
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 &&
this.index1 > 0 &&
this.index1 < this.length1
) {
return true;
} else { } else {
return false return false;
} }
} else { } else {
if (this.length2!==0&&this.index2>0&&this.index2<this.length2) { if (
return true this.length2 !== 0 &&
this.index2 > 0 &&
this.index2 < this.length2
) {
return true;
} else { } else {
return false return false;
} }
} }
}, },
nextShow: function () { nextShow: function() {
if (this.type === 1) { if (this.type === 1) {
if (this.length1!==0&&this.index1<this.length1-1) { if (this.length1 !== 0 && this.index1 < this.length1 - 1) {
return true return true;
} else { } else {
return false return false;
} }
} else { } else {
if (this.length2!==0&&this.index2<this.length2-1) { if (this.length2 !== 0 && this.index2 < this.length2 - 1) {
return true return true;
} else { } else {
return false return false;
} }
} }
}, },
toPreZ: function () { toPreZ: function() {
this.$emit('toPreZ', this.name, this.index1, this.index2) this.$emit("toPreZ", this.name, this.index1, this.index2);
}, },
toPreY: function () { toPreY: function() {
this.$emit('toPreY', this.name, this.index1, this.index2) this.$emit("toPreY", this.name, this.index1, this.index2);
}, },
toNextY: function () { toNextY: function() {
this.$emit('toNextY', this.name, this.index1, this.index2) this.$emit("toNextY", this.name, this.index1, this.index2);
}, },
toNextZ: function () { toNextZ: function() {
this.$emit('toNextZ', this.name, this.index1, this.index2) this.$emit("toNextZ", this.name, this.index1, this.index2);
}, },
toHuan: function () { toHuan: function() {
this.$emit('toHuan', this.name, this.index1, this.index2) this.$emit("toHuan", this.name, this.index1, this.index2);
}, },
toXuan: function () { toXuan: function() {
this.$emit('toXuan', this.name, this.index1, this.index2) this.$emit("toXuan", this.name, this.index1, this.index2);
}, },
toDelete: function () { toDelete: function() {
this.$emit('toDelete', this.name, this.index1, this.index2) this.$emit("toDelete", this.name, this.index1, this.index2);
}, },
toReset: function () { toReset: function() {
this.$emit('toReset', this.name, this.index1, this.index2) this.$emit("toReset", this.name, this.index1, this.index2);
}, },
//添加 //添加
toAdd:function() toAdd: function() {
{ this.$emit("toAdd", this.name, this.index1, this.index2);
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{
.vToolBar_horizontal {
height: 30px; height: 30px;
white-space: nowrap; white-space: nowrap;
} }
.vToolBar_vertical{
.vToolBar_vertical {
width: 30px; width: 30px;
} }
.vToolBar>div{
.vToolBar > div {
display: inline-block; display: inline-block;
width: 30px; width: 30px;
height: 30px; height: 30px;
vertical-align: top; vertical-align: top;
cursor: pointer; cursor: pointer;
} }
.vToolBar>div>i{
.vToolBar > div > i {
display: inline-block; display: inline-block;
width: 30px; width: 30px;
height: 30px; height: 30px;
line-height: 30px; line-height: 30px;
text-align: center; text-align: center;
font-size: 20px; font-size: 20px;
color: #FFFFFF; color: #ffffff;
} }
.vToolBar>div>i:hover{
.vToolBar > div > i:hover {
background-color: #666666; background-color: #666666;
} }
</style> </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'
...@@ -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,
...@@ -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