update:按单查询无法选中修复

master
zhoulei 3 years ago
parent 563d25d2ea
commit d5158c489b

@ -86,15 +86,8 @@ export class AggregatingModule extends VuexModule {
*/ */
@Mutation @Mutation
checkAllAggregateList(checked: boolean) { checkAllAggregateList(checked: boolean) {
console.log('this.nodel.aggregateList222', this.aggregateList); this.aggregateList.map((item: any) => {
this.aggregateList = this.aggregateList.map((item: any) => { Object.assign(item, { checked, hvAmount: (checked && item.totalMoAmount - item.totalHvAmount) || 0 });
item.checked = checked;
if (item.checked) {
item.hvAmount = item.totalMoAmount - item.totalHvAmount;
} else {
item.hvAmount = 0;
}
return item;
}); });
} }
/** /**
@ -103,15 +96,8 @@ export class AggregatingModule extends VuexModule {
*/ */
@Mutation @Mutation
checkAllOrderList(checked: boolean) { checkAllOrderList(checked: boolean) {
console.log('this.nodel.orderList222', this.orderList); this.orderList.map((item: any) => {
this.orderList = this.orderList.map((item: any) => { Object.assign(item, { checked, hvAmount: (checked && item.totalMoAmount - item.totalHvAmount) || 0 });
item.checked = checked;
if (item.checked) {
item.hvAmount = item.totalMoAmount - item.totalHvAmount;
} else {
item.hvAmount = 0;
}
return item;
}); });
} }
/** /**
@ -129,8 +115,6 @@ export class AggregatingModule extends VuexModule {
*/ */
@Mutation @Mutation
setAggregateListItemHvAmount({ index, hvAmount }: { index: number; hvAmount: number }) { setAggregateListItemHvAmount({ index, hvAmount }: { index: number; hvAmount: number }) {
const original = this.aggregateList[index];
const newItem = { ...original, hvAmount };
this.aggregateList[index].hvAmount = hvAmount; this.aggregateList[index].hvAmount = hvAmount;
// this.aggregateList.splice(index, 1, newItem); // this.aggregateList.splice(index, 1, newItem);
// if (this.aggregateList[index].checked) { // if (this.aggregateList[index].checked) {
@ -146,8 +130,6 @@ export class AggregatingModule extends VuexModule {
*/ */
@Mutation @Mutation
setOrderListItemHvAmount({ index, hvAmount }: { index: number; hvAmount: number }) { setOrderListItemHvAmount({ index, hvAmount }: { index: number; hvAmount: number }) {
const original = this.orderList[index];
const newItem = { ...original, hvAmount };
// this.orderList.splice(index, 1, newItem); // this.orderList.splice(index, 1, newItem);
this.orderList[index].hvAmount = hvAmount; this.orderList[index].hvAmount = hvAmount;
} }
@ -256,12 +238,8 @@ export class AggregatingModule extends VuexModule {
await http.post(url.sumscan.lock.list, queryParams); await http.post(url.sumscan.lock.list, queryParams);
const orderList = cloneDeep<any>(proOrderResultList); const orderList = cloneDeep<any>(proOrderResultList);
orderList.map((item: any) => { orderList.map((item: any) => {
item.checked = false; Object.assign(item, { checked: false });
}); });
if (orderList.length == 0) {
return { orderList };
}
console.log('orderList', orderList);
return { orderList }; return { orderList };
} }
/** /**
@ -305,7 +283,7 @@ export class AggregatingModule extends VuexModule {
@Action({ commit: 'updateCheckedOrderInInfoListKw' }) @Action({ commit: 'updateCheckedOrderInInfoListKw' })
async queryByFactoryCodeAndWorkAreaCode(content: any) { async queryByFactoryCodeAndWorkAreaCode(content: any) {
let res = await http.post('/wmspda/fg/queryByFactoryCodeAndWorkAreaCode', content); const res = await http.post('/wmspda/fg/queryByFactoryCodeAndWorkAreaCode', content);
return res; return res;
} }
} }

@ -2,7 +2,7 @@
<view class="page-aggregating-order"> <view class="page-aggregating-order">
<view class="header"> <view class="header">
<view class="left"> <view class="left">
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack()" /> <u-icon class="icon" name="arrow-left" @click="uni.navigateBack({})" />
</view> </view>
<view class="title">{{ $t('message.Summary_HandoverByOrder') }}</view> <view class="title">{{ $t('message.Summary_HandoverByOrder') }}</view>
<view class="right"></view> <view class="right"></view>
@ -152,8 +152,9 @@ export default class AggregatingOrder extends BasePage {
* 全选 * 全选
*/ */
onSelectAll() { onSelectAll() {
console.log('this.nodel.orderList111',this.model.orderList) // console.log('this.nodel.orderList111', this.model.orderList, this.$refs.table);
model.checkAllOrderList(!model.isOrderCheckedAll); const isOrderCheckedAll = !model.isOrderCheckedAll;
this.model.checkAllOrderList(isOrderCheckedAll);
} }
clickIndex(e: any) { clickIndex(e: any) {
console.log('ccccc', e.data); console.log('ccccc', e.data);
@ -165,7 +166,7 @@ export default class AggregatingOrder extends BasePage {
//debugger; //debugger;
console.log('xuanzedeindex', e.data); console.log('xuanzedeindex', e.data);
console.log('hvmount', item.lineData.totalMoAmount - item.lineData.totalHvAmount); console.log('hvmount', item.lineData.totalMoAmount - item.lineData.totalHvAmount);
model.setOrderListItemHvAmount({ this.model.setOrderListItemHvAmount({
index: e.data[index].index, index: e.data[index].index,
hvAmount: item.lineData.totalMoAmount - item.lineData.totalHvAmount, hvAmount: item.lineData.totalMoAmount - item.lineData.totalHvAmount,
}); });
@ -189,33 +190,6 @@ export default class AggregatingOrder extends BasePage {
this.submitForm.receiverName = userInfo.userName; this.submitForm.receiverName = userInfo.userName;
} }
/**
* 确认
*/
/**onOk() {
this.$amountForm.validate((valid) => {
if (!valid) return;
const firstSelection = this.model.orderList.find((_) => _.checked);
if (firstSelection === undefined) {
this.customToast(this.$t('message.Pi_tip7') as string);
} else {
//
const currentPickNum = parseFloat(this.amountForm.amount);
//
const totalHvAmount = parseFloat(firstSelection.totalHvAmount);
//
const totalMoAmount = parseFloat(firstSelection.totalMoAmount);
if (currentPickNum != totalMoAmount - totalHvAmount) {
this.customToast(this.$t('message.Pi_tip12') as string);
return;
}
model.setOrderListItemHvAmount({
index: this.model.orderList.findIndex((_) => _.checked),
hvAmount: currentPickNum,
});
}
});
}**/
onSubmit() { onSubmit() {
this.$submitForm.validate(async (valid) => { this.$submitForm.validate(async (valid) => {
if (valid) { if (valid) {
@ -230,9 +204,9 @@ export default class AggregatingOrder extends BasePage {
}); });
let submit = false; let submit = false;
let selectsta = true; let selectsta = true;
model.orderList.forEach((item, index) => { this.model.orderList.forEach((item, index) => {
if (!item.checked) { if (!item.checked) {
model.setOrderListItemHvAmount({ index, hvAmount: 0 }); this.model.setOrderListItemHvAmount({ index, hvAmount: 0 });
} else if (item.hvAmount == null || item.hvAmount == 0) { } else if (item.hvAmount == null || item.hvAmount == 0) {
submit = true; submit = true;
} }
@ -269,7 +243,7 @@ export default class AggregatingOrder extends BasePage {
this.customToast(this.$t('message.Pi_tip15') as string); this.customToast(this.$t('message.Pi_tip15') as string);
return; return;
} }
await model.uploadOrderList({ await this.model.uploadOrderList({
operatorPass: this.submitForm.receiver, operatorPass: this.submitForm.receiver,
factoryCode: session.factoryCode, factoryCode: session.factoryCode,
loginName: session.loginName, loginName: session.loginName,
@ -297,24 +271,14 @@ export default class AggregatingOrder extends BasePage {
queryParams: this.model.orderOutIdListParams, queryParams: this.model.orderOutIdListParams,
proOrderResultList: this.model.proOrderResultList, proOrderResultList: this.model.proOrderResultList,
}); });
// model.orderList.forEach((item: any, index: any) => {
// if (item.orderOutId == this.spliceItem) {
// model.orderList.splice(index, 1);
// }
// });
// model.proOrderResultList.forEach((item: any, index: any) => {
// if (item.orderOutId == this.spliceItem) {
// model.proOrderResultList.splice(index, 1);
// }
// });
//this.$amountForm.setRules(this.amountFormRules);
this.$submitForm.setRules(this.submitFormRules); this.$submitForm.setRules(this.submitFormRules);
} }
/** /**
* 解锁 * 解锁
*/ */
async unlock() { async unlock() {
const orderOutIdList = model.proOrderResultList.map((_: any) => _.orderOutId); const orderOutIdList = this.model.proOrderResultList.map((_: any) => _.orderOutId);
try { try {
await http.post(url.sumscan.unlock.list, { await http.post(url.sumscan.unlock.list, {
factoryCode: session.factoryCode, factoryCode: session.factoryCode,
@ -323,10 +287,6 @@ export default class AggregatingOrder extends BasePage {
}); });
} catch (e) { } catch (e) {
this.customToast((this.$t('message.Summary_Tip') as string) + e.message); this.customToast((this.$t('message.Summary_Tip') as string) + e.message);
// uni.showToast({
// icon: 'none',
// title: (this.$t('message.Summary_Tip') as string) + e.message,
// });
} }
} }
} }

@ -2,7 +2,7 @@
<view class="page-receipt-detail"> <view class="page-receipt-detail">
<view class="header"> <view class="header">
<view class="left"> <view class="left">
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack()" /> <u-icon class="icon" name="arrow-left" @click="uni.navigateBack({})" />
</view> </view>
<view class="title">{{ $t('message.Summary_Result') }}</view> <view class="title">{{ $t('message.Summary_Result') }}</view>
<view class="right"></view> <view class="right"></view>
@ -27,7 +27,7 @@
<!-- <u-button type="warning"> 辅料 </u-button>--> <!-- <u-button type="warning"> 辅料 </u-button>-->
<!-- </u-col>--> <!-- </u-col>-->
<u-col :span="4"> <u-col :span="4">
<u-button type="error" @click="uni.navigateBack()">{{ $t('message.po_Return') }}</u-button> <u-button type="error" @click="uni.navigateBack({})">{{ $t('message.po_Return') }}</u-button>
</u-col> </u-col>
</u-row> </u-row>
</div> </div>
@ -73,7 +73,7 @@ export default class AggregatingResult extends BasePage {
* 按单 * 按单
*/ */
async onOrder() { async onOrder() {
const orderOutIdList = this.model.proOrderResultList.map((_: any) => _.orderOutId); const orderOutIdList = await this.model.proOrderResultList.map((_: any) => _.orderOutId);
const params = { const params = {
factoryCode: session.factoryCode, factoryCode: session.factoryCode,
loginName: session.loginName, loginName: session.loginName,

@ -2,7 +2,7 @@
<view class="page-aggregating-order"> <view class="page-aggregating-order">
<view class="header"> <view class="header">
<view class="left"> <view class="left">
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack()" /> <u-icon class="icon" name="arrow-left" @click="uni.navigateBack({})" />
</view> </view>
<view class="title">{{ $t('message.Summary_SummaryAndHandover') }}</view> <view class="title">{{ $t('message.Summary_SummaryAndHandover') }}</view>
<view class="right"></view> <view class="right"></view>
@ -136,7 +136,8 @@ export default class AggregatingSummary extends BasePage {
}; };
// onReadyonLoad // onReadyonLoad
onReady() { onShow() {
this.model = model;
/**this.$amountForm.setRules(this.amountFormRules);**/ /**this.$amountForm.setRules(this.amountFormRules);**/
this.$submitForm.setRules(this.submitFormRules); this.$submitForm.setRules(this.submitFormRules);
this.isBusinessFinished = false; this.isBusinessFinished = false;
@ -153,7 +154,7 @@ export default class AggregatingSummary extends BasePage {
//debugger; //debugger;
console.log('xuanzedeindex', e.data); console.log('xuanzedeindex', e.data);
console.log('hvmount', item.lineData.totalMoAmount - item.lineData.totalHvAmount); console.log('hvmount', item.lineData.totalMoAmount - item.lineData.totalHvAmount);
model.setAggregateListItemHvAmount({ this.model.setAggregateListItemHvAmount({
index: e.data[index].index, index: e.data[index].index,
hvAmount: item.lineData.totalMoAmount - item.lineData.totalHvAmount, hvAmount: item.lineData.totalMoAmount - item.lineData.totalHvAmount,
}); });
@ -175,8 +176,8 @@ export default class AggregatingSummary extends BasePage {
* 全选 * 全选
*/ */
onSelectAll() { onSelectAll() {
console.log('this.nodel.aggregateList111',this.model.aggregateList) console.log('this.nodel.aggregateList111', this.model.aggregateList);
model.checkAllAggregateList(!model.isAggregateCheckedAll); this.model.checkAllAggregateList(!this.model.isAggregateCheckedAll);
} }
/** /**
@ -227,7 +228,7 @@ export default class AggregatingSummary extends BasePage {
onSubmit() { onSubmit() {
this.$submitForm.validate(async (valid) => { this.$submitForm.validate(async (valid) => {
if (valid) { if (valid) {
if (model.aggregateList.length === 0) { if (this.model.aggregateList.length === 0) {
this.customToast(this.$t('message.Pi_tip4') as string); this.customToast(this.$t('message.Pi_tip4') as string);
} else { } else {
await auth.checkPassword({ await auth.checkPassword({
@ -237,7 +238,7 @@ export default class AggregatingSummary extends BasePage {
}); });
let submit = false; let submit = false;
let selectsta = true; let selectsta = true;
model.aggregateList.forEach((item) => { this.model.aggregateList.forEach((item) => {
if (!item.checked) { if (!item.checked) {
return; return;
} else if (item.hvAmount == null || item.hvAmount == 0) { } else if (item.hvAmount == null || item.hvAmount == 0) {
@ -278,7 +279,7 @@ export default class AggregatingSummary extends BasePage {
this.customToast(this.$t('message.Pi_tip15') as string); this.customToast(this.$t('message.Pi_tip15') as string);
return; return;
} }
await model.uploadAggregateList({ await this.model.uploadAggregateList({
operatorPass: this.submitForm.receiver, operatorPass: this.submitForm.receiver,
factoryCode: session.factoryCode as string, factoryCode: session.factoryCode as string,
loginName: session.loginName as string, loginName: session.loginName as string,
@ -291,7 +292,7 @@ export default class AggregatingSummary extends BasePage {
totalHvAmount: String(item.totalHvAmount), totalHvAmount: String(item.totalHvAmount),
prdMaterialDesc: String(item.prdMaterialCode), prdMaterialDesc: String(item.prdMaterialCode),
})), })),
includeOrderOutIdList: model.proOrderResultList.map((item: any) => item.orderOutId), includeOrderOutIdList: this.model.proOrderResultList.map((item: any) => item.orderOutId),
}); });
setTimeout(() => { setTimeout(() => {
this.onAggregate(); this.onAggregate();

@ -45,8 +45,7 @@
maxWidth: checkColWidth + 'rpx', maxWidth: checkColWidth + 'rpx',
minHeight: minHeight[0] + 'rpx', minHeight: minHeight[0] + 'rpx',
textAlign: textAlign, textAlign: textAlign,
justifyContent: justifyContent: textAlign === 'center' ? textAlign : textAlign === 'left' ? 'flex-start' : 'flex-end',
textAlign === 'center' ? textAlign : textAlign === 'left' ? 'flex-start' : 'flex-end',
fontSize: fontSize[0] + 'rpx', fontSize: fontSize[0] + 'rpx',
color: headerFtColor, color: headerFtColor,
padding: padding[0] + 'rpx ' + (padding[1] || padding[0]) + 'rpx', padding: padding[0] + 'rpx ' + (padding[1] || padding[0]) + 'rpx',
@ -93,27 +92,21 @@
maxWidth: (item.width || defaultColWidth) + 'rpx', maxWidth: (item.width || defaultColWidth) + 'rpx',
minHeight: minHeight[0] + 'rpx', minHeight: minHeight[0] + 'rpx',
textAlign: textAlign, textAlign: textAlign,
justifyContent: justifyContent: textAlign === 'center' ? textAlign : textAlign === 'left' ? 'flex-start' : 'flex-end',
textAlign === 'center' ? textAlign : textAlign === 'left' ? 'flex-start' : 'flex-end',
fontSize: fontSize[0] + 'rpx', fontSize: fontSize[0] + 'rpx',
fontWeight: headerWeight ? 'bold' : 'normal', fontWeight: headerWeight ? 'bold' : 'normal',
color: headerFtColor, color: headerFtColor,
padding: padding[0] + 'rpx ' + (padding[1] || padding[0]) + 'rpx', padding: padding[0] + 'rpx ' + (padding[1] || padding[0]) + 'rpx',
backgroundColor: headerBgColor, backgroundColor: headerBgColor,
borderRight: borderRight: index === headers.length - 1 || (!showVertBorder && index !== 0) ? 'none' : '1px solid' + borderColor,
index === headers.length - 1 || (!showVertBorder && index !== 0)
? 'none'
: '1px solid' + borderColor,
zIndex: index === 0 ? 20 : 0, zIndex: index === 0 ? 20 : 0,
left: left: index === 0 && firstLineFixed ? (enableCheck ? checkColWidth + 'rpx' : 0) : 'auto',
index === 0 && firstLineFixed ? (enableCheck ? checkColWidth + 'rpx' : 0) : 'auto',
position: index === 0 ? 'sticky' : 'static', position: index === 0 ? 'sticky' : 'static',
}" }"
> >
<text <text
:style="{ :style="{
marginLeft: marginLeft: autoSortShow(index) && textAlign !== 'left' ? fontSize[0] * 0.65 + 'rpx' : 0,
autoSortShow(index) && textAlign !== 'left' ? fontSize[0] * 0.65 + 'rpx' : 0,
}" }"
> >
{{ item.label || emptyString }} {{ item.label || emptyString }}
@ -122,10 +115,7 @@
<text <text
class="iconfont icon-arrow-up" class="iconfont icon-arrow-up"
:style="{ :style="{
color: color: sortWays[sortWay] === 'asc' && sortActiveKey === item.key ? headerFtColor : RGBChange(headerFtColor, 0.7, 'light'),
sortWays[sortWay] === 'asc' && sortActiveKey === item.key
? headerFtColor
: RGBChange(headerFtColor, 0.7, 'light'),
fontWeight: 'normal', fontWeight: 'normal',
marginBottom: '-12px', marginBottom: '-12px',
transform: 'scale(0.4)', transform: 'scale(0.4)',
@ -134,10 +124,7 @@
<text <text
class="iconfont icon-arrow-down" class="iconfont icon-arrow-down"
:style="{ :style="{
color: color: sortWays[sortWay] === 'inv' && sortActiveKey === item.key ? headerFtColor : RGBChange(headerFtColor, 0.7, 'light'),
sortWays[sortWay] === 'inv' && sortActiveKey === item.key
? headerFtColor
: RGBChange(headerFtColor, 0.7, 'light'),
fontWeight: 'normal', fontWeight: 'normal',
transform: 'scale(0.4)', transform: 'scale(0.4)',
}" }"
@ -146,12 +133,7 @@
</view> </view>
</view> </view>
<view class="wyb-table-content"> <view class="wyb-table-content">
<view <view class="wyb-table-content-line" v-for="(content, cIndex) in contentsSort" :key="contentLineKey(content, cIndex)" :style="{ borderTop: cIndex === 0 ? 'none' : '1px solid' + borderColor }">
class="wyb-table-content-line"
v-for="(content, cIndex) in contentsSort"
:key="contentLineKey(content, cIndex)"
:style="{ borderTop: cIndex === 0 ? 'none' : '1px solid' + borderColor }"
>
<view <view
class="wyb-table-content-item" class="wyb-table-content-item"
v-if="enableCheck" v-if="enableCheck"
@ -159,12 +141,7 @@
minWidth: checkColWidth + 'rpx', minWidth: checkColWidth + 'rpx',
maxWidth: checkColWidth + 'rpx', maxWidth: checkColWidth + 'rpx',
textAlign: textAlign, textAlign: textAlign,
justifyContent: justifyContent: textAlign === 'center' ? textAlign : textAlign === 'left' ? 'flex-start' : 'flex-end',
textAlign === 'center'
? textAlign
: textAlign === 'left'
? 'flex-start'
: 'flex-end',
fontSize: (fontSize[1] || fontSize[0]) + 'rpx', fontSize: (fontSize[1] || fontSize[0]) + 'rpx',
minHeight: (minHeight[1] || minHeight[0]) + 'rpx', minHeight: (minHeight[1] || minHeight[0]) + 'rpx',
padding: padding[0] + 'rpx ' + (padding[1] || padding[0]) + 'rpx', padding: padding[0] + 'rpx ' + (padding[1] || padding[0]) + 'rpx',
@ -207,12 +184,7 @@
minWidth: (header.width || defaultColWidth) + 'rpx', minWidth: (header.width || defaultColWidth) + 'rpx',
maxWidth: (header.width || defaultColWidth) + 'rpx', maxWidth: (header.width || defaultColWidth) + 'rpx',
textAlign: textAlign, textAlign: textAlign,
justifyContent: justifyContent: textAlign === 'center' ? textAlign : textAlign === 'left' ? 'flex-start' : 'flex-end',
textAlign === 'center'
? textAlign
: textAlign === 'left'
? 'flex-start'
: 'flex-end',
fontSize: (fontSize[1] || fontSize[0]) + 'rpx', fontSize: (fontSize[1] || fontSize[0]) + 'rpx',
textDecoration: autoTextDecoration(cIndex, hIndex), textDecoration: autoTextDecoration(cIndex, hIndex),
color: autoContentColor(cIndex, hIndex), color: autoContentColor(cIndex, hIndex),
@ -220,10 +192,7 @@
minHeight: (minHeight[1] || minHeight[0]) + 'rpx', minHeight: (minHeight[1] || minHeight[0]) + 'rpx',
padding: padding[0] + 'rpx ' + (padding[1] || padding[0]) + 'rpx', padding: padding[0] + 'rpx ' + (padding[1] || padding[0]) + 'rpx',
borderBottom: cIndex === contents.length - 1 ? '1px solid' + borderColor : 'none', borderBottom: cIndex === contents.length - 1 ? '1px solid' + borderColor : 'none',
borderRight: borderRight: hIndex === headers.length - 1 || (!showVertBorder && hIndex !== 0) ? 'none' : '1px solid' + borderColor,
hIndex === headers.length - 1 || (!showVertBorder && hIndex !== 0)
? 'none'
: '1px solid' + borderColor,
zIndex: hIndex === 0 ? 20 : 0, zIndex: hIndex === 0 ? 20 : 0,
left: enableCheck ? checkColWidth + 'rpx' : 0, left: enableCheck ? checkColWidth + 'rpx' : 0,
position: hIndex === 0 && firstLineFixed ? 'sticky' : 'static', position: hIndex === 0 && firstLineFixed ? 'sticky' : 'static',
@ -248,12 +217,7 @@
minWidth: checkColWidth + 'rpx', minWidth: checkColWidth + 'rpx',
maxWidth: checkColWidth + 'rpx', maxWidth: checkColWidth + 'rpx',
textAlign: textAlign, textAlign: textAlign,
justifyContent: justifyContent: textAlign === 'center' ? textAlign : textAlign === 'left' ? 'flex-start' : 'flex-end',
textAlign === 'center'
? textAlign
: textAlign === 'left'
? 'flex-start'
: 'flex-end',
fontSize: (fontSize[1] || fontSize[0]) + 'rpx', fontSize: (fontSize[1] || fontSize[0]) + 'rpx',
minHeight: (minHeight[1] || minHeight[0]) + 'rpx', minHeight: (minHeight[1] || minHeight[0]) + 'rpx',
padding: padding[0] + 'rpx ' + (padding[1] || padding[0]) + 'rpx', padding: padding[0] + 'rpx ' + (padding[1] || padding[0]) + 'rpx',
@ -274,22 +238,14 @@
minWidth: (header.width || defaultColWidth) + 'rpx', minWidth: (header.width || defaultColWidth) + 'rpx',
maxWidth: (header.width || defaultColWidth) + 'rpx', maxWidth: (header.width || defaultColWidth) + 'rpx',
textAlign: textAlign, textAlign: textAlign,
justifyContent: justifyContent: textAlign === 'center' ? textAlign : textAlign === 'left' ? 'flex-start' : 'flex-end',
textAlign === 'center'
? textAlign
: textAlign === 'left'
? 'flex-start'
: 'flex-end',
fontSize: (fontSize[1] || fontSize[0]) + 'rpx', fontSize: (fontSize[1] || fontSize[0]) + 'rpx',
color: contentFtColor, color: contentFtColor,
minHeight: (minHeight[1] || minHeight[0]) + 'rpx', minHeight: (minHeight[1] || minHeight[0]) + 'rpx',
padding: padding[0] + 'rpx ' + (padding[1] || padding[0]) + 'rpx', padding: padding[0] + 'rpx ' + (padding[1] || padding[0]) + 'rpx',
backgroundColor: index === 0 ? firstColBgColor : contentBgColor, backgroundColor: index === 0 ? firstColBgColor : contentBgColor,
borderBottom: '1px solid' + borderColor, borderBottom: '1px solid' + borderColor,
borderRight: borderRight: index === headers.length - 1 || (!showVertBorder && index !== 0) ? 'none' : '1px solid' + borderColor,
index === headers.length - 1 || (!showVertBorder && index !== 0)
? 'none'
: '1px solid' + borderColor,
zIndex: index === 0 ? 20 : 0, zIndex: index === 0 ? 20 : 0,
left: enableCheck ? checkColWidth + 'rpx' : 0, left: enableCheck ? checkColWidth + 'rpx' : 0,
position: index === 0 && firstLineFixed ? 'sticky' : 'static', position: index === 0 && firstLineFixed ? 'sticky' : 'static',
@ -402,11 +358,7 @@ export default {
bottomComputed[this.computedCol[index]] = total; bottomComputed[this.computedCol[index]] = total;
}); });
let header = this.headers[index]; let header = this.headers[index];
let result = this.computedCol.includes(header.key) let result = this.computedCol.includes(header.key) ? bottomComputed[header.key] : index === 0 ? '总计' : this.emptyString;
? bottomComputed[header.key]
: index === 0
? '总计'
: this.emptyString;
if (this.formatCol.length !== 0) { if (this.formatCol.length !== 0) {
this.formatCol.forEach((item) => { this.formatCol.forEach((item) => {
if (item.bottomComputedFormat) { if (item.bottomComputedFormat) {
@ -837,10 +789,7 @@ export default {
// //
if (isNumber) { if (isNumber) {
arr.sort((a, b) => { arr.sort((a, b) => {
return ( return (parseFloat(a[key].toString().replace(/[^0-9]/gi, '')) || 0) - (parseFloat(b[key].toString().replace(/[^0-9]/gi, '')) || 0);
(parseFloat(a[key].toString().replace(/[^0-9]/gi, '')) || 0) -
(parseFloat(b[key].toString().replace(/[^0-9]/gi, '')) || 0)
);
}); });
} else { } else {
arr.sort((a, b) => { arr.sort((a, b) => {
@ -861,10 +810,7 @@ export default {
// //
if (isNumber) { if (isNumber) {
arr.sort((a, b) => { arr.sort((a, b) => {
return ( return (parseFloat(b[key].toString().replace(/[^0-9]/gi, '')) || 0) - (parseFloat(a[key].toString().replace(/[^0-9]/gi, '')) || 0);
(parseFloat(b[key].toString().replace(/[^0-9]/gi, '')) || 0) -
(parseFloat(a[key].toString().replace(/[^0-9]/gi, '')) || 0)
);
}); });
} else { } else {
arr.sort((a, b) => { arr.sort((a, b) => {
@ -992,8 +938,8 @@ export default {
this.$emit('onCellClick', event); this.$emit('onCellClick', event);
} }
}, },
onEmpty(){ onEmpty() {
this.event.data=[] this.event.data = [];
}, },
onCheckAllTap() { onCheckAllTap() {
if (this.enableCheck === 'multiple') { if (this.enableCheck === 'multiple') {
@ -1128,10 +1074,7 @@ export default {
let rgbc = [r, g, b]; let rgbc = [r, g, b];
// //
for (var i = 0; i < 3; i++) for (var i = 0; i < 3; i++) type === 'light' ? (rgbc[i] = Math.floor((255 - rgbc[i]) * level + rgbc[i])) : (rgbc[i] = Math.floor(rgbc[i] * (1 - level)));
type === 'light'
? (rgbc[i] = Math.floor((255 - rgbc[i]) * level + rgbc[i]))
: (rgbc[i] = Math.floor(rgbc[i] * (1 - level)));
if (hasAlpha) { if (hasAlpha) {
return `rgba(${rgbc[0]}, ${rgbc[1]}, ${rgbc[2]}, ${alpha})`; return `rgba(${rgbc[0]}, ${rgbc[1]}, ${rgbc[2]}, ${alpha})`;

Loading…
Cancel
Save