Commit e14c1794 authored by Facius's avatar Facius

feat: 批量处理

parent abae9fe6
......@@ -159,3 +159,35 @@ export async function createOrUpdateService(data) {
noLoading: true
})
}
<<<<<<< HEAD
// 获取批量结算数据
export async function batchSettleInfo(data) {
return request({
url: `/rest/repair/batchSettleInfo`,
method: 'PUT',
data,
noLoading: true
})
}
// 批量结清
export async function batchSettle(data) {
return request({
url: `/rest/repair/batchSettle`,
method: 'POST',
data,
noLoading: true
})
}
=======
export async function getProjectMembersKnow(data) {
return request({
url: `/rest/repair/customer`,
method: 'GET',
data,
noLoading: true
})
}
>>>>>>> 99e09f9d86cff0a0236b74c285848ed7af1a7f1a
<template>
<view class="cell-maintain-bill">
<view
class="content-view"
hover-class="u-hover-class"
@click.stop="$u.throttle(handleSelect, 500)"
>
<view :class="['cell-maintain-bill', {select: isSelect}]">
<view v-if="isSelect" class="left-select-view" @click="$u.throttle(handleAction, 500)" hover-class="u-hover-class">
<u-icon v-if="info.selected" name="checkmark-circle-fill" color="#02A074" size="42"></u-icon>
<view v-else class="select-icon"></view>
</view>
<view class="content-view" hover-class="u-hover-class" @click.stop="$u.throttle(handleSelect, 500)">
<view class="title-view">
<view class="left-view">
<view class="type-view" :style="currentType.style"><text>{{currentType.name}}</text></view>
<view :class="['type-view', {select: isSelect}]" :style="currentMaintainType.style">
<text>{{currentMaintainType.name}}</text></view>
<view>{{ info.id }}</view>
</view>
<view class="status-view">
......@@ -16,7 +17,7 @@
<image :src="statusSetting[info.settleState.code].image"></image>
</view>
<view class="status-text">{{
statusSetting[info.settleState.code].text
statusSetting[info.settleState.code].text
}}</view>
</view>
<view class="item-view">
......@@ -24,7 +25,7 @@
<image :src="statusSetting[info.sendStatus.code].image"></image>
</view>
<view class="status-text">{{
statusSetting[info.sendStatus.code].text
statusSetting[info.sendStatus.code].text
}}</view>
</view>
</view>
......@@ -52,16 +53,13 @@
</view>
<!-- <view class="line-view"></view> -->
<view
class="bottom-view"
:style="statusSetting[info.settleState.code].style"
>
<view class="bottom-view" :style="statusSetting[info.settleState.code].style">
<view v-for="(item, index) in bottoms" :key="index" class="item-view">
<view v-if="index % 2" class="line-view"> </view>
<template v-else>
<view>{{ item.title }}</view>
<view :style="'color:' + item.color" class="count-view">{{
item.value
item.value
}}</view>
</template>
</view>
......@@ -77,7 +75,7 @@ export default {
props: {
info: {
type: Object,
default() {
default () {
return {}
},
},
......@@ -85,38 +83,45 @@ export default {
type: Boolean,
default: false,
},
type: {
type: String,
default: 'normal'
}
},
data() {
data () {
return {}
},
computed: {
baseUrl() {
baseUrl () {
return process.uniEnv.qn_base_url
},
middleImage() {
isSelect () {
return this.type == 'select'
},
middleImage () {
return this.baseUrl + 'fengexuxian-s@3x.png'
},
locationImage() {
locationImage () {
return this.baseUrl + 'weixiudizhi-l@3x.png'
},
timeImage() {
timeImage () {
return this.baseUrl + 'weixiushijian-l@3x.png'
},
yijieqingImage() {
yijieqingImage () {
return this.baseUrl + 'yijieqing-n@3x.png'
},
weiquerenImage() {
weiquerenImage () {
return this.baseUrl + 'weiqueren@3x.png'
},
weijieqingImage() {
weijieqingImage () {
return this.baseUrl + 'weijieqing@3x.png'
},
weifasongImage() {
weifasongImage () {
return this.baseUrl + 'weifasong@3x.png'
},
// sendStatus WAIT:未发送;WAIT_SURE:未确定;SURE:已确定
// settleState NO:未结清;YES:已结清
statusSetting() {
statusSetting () {
return {
WAIT_SURE: { text: '未确认', image: this.weiquerenImage },
NO: {
......@@ -135,7 +140,7 @@ export default {
SURE: { text: '已确认', image: this.yijieqingImage },
}
},
bottoms() {
bottoms () {
var result =
Number(this.info['receivableAmount'] || 0) -
Number(this.info['actualAmount'] || 0)
......@@ -162,15 +167,15 @@ export default {
},
]
},
isRefund() {
isRefund () {
return this.info.type == 'refund'
},
types() {
maintainTypes () {
return {
'receipt': {
name: '小票',
style: 'background-color: #A4E9D5'
},
},
'voucher': {
name: '凭证',
style: 'background-color: #FFDCAF'
......@@ -185,16 +190,20 @@ export default {
},
}
},
currentType() {
return this.info.type ? this.types[this.info.type] : {}
currentMaintainType () {
return this.info.type ? this.maintainTypes[this.info.type] : {}
}
},
methods: {
handleSelect() {
handleSelect () {
this.$emit('select', this.info.id)
},
formatCount(count) {
handleAction () {
this.info.selected = !this.info.selected
this.$emit('action', this.info.selected, this.info.id)
},
formatCount (count) {
return formatCount(count)
},
},
......@@ -202,11 +211,33 @@ export default {
</script>
<style scoped lang="scss">
.cell-maintain-bill {
&.select {
display: flex;
align-items: center;
}
.left-select-view {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
width: 80rpx;
flex-shrink: 0;
.select-icon {
width: 32rpx;
height: 32rpx;
border-radius: 50%;
border: 2rpx solid #cccccc;
}
}
.content-view {
padding: 32rpx 0 0 0;
background-color: #ffffff;
border-radius: 16rpx;
overflow: hidden;
flex: 1;
.title-view {
padding: 0 24rpx 0 0;
......@@ -215,10 +246,12 @@ export default {
align-items: center;
color: #333333;
font-size: 28rpx;
.left-view {
display: flex;
align-items: center;
color: #8D8D8F;
.type-view {
height: 32rpx;
width: 56rpx;
......@@ -230,8 +263,13 @@ export default {
align-items: center;
color: #333333;
font-size: 16rpx;
&.select {
margin-right: 8rpx;
}
}
}
.status-view {
font-weight: bold;
font-size: 24rpx;
......@@ -239,15 +277,18 @@ export default {
display: flex;
align-items: center;
justify-content: flex-end;
.item-view {
width: 116rpx;
height: 40rpx;
position: relative;
.image-view {
position: absolute;
width: 116rpx;
height: 40rpx;
}
.status-text {
position: relative;
text-align: center;
......@@ -258,6 +299,7 @@ export default {
}
}
}
// .middle-view {
// background-color: transparent;
// width: 100%;
......@@ -268,6 +310,7 @@ export default {
// margin: 32rpx 24rpx;
// background-color: #f6f7fa;
padding: 32rpx 24rpx;
.name-view {
font-weight: bold;
color: #333333;
......@@ -275,16 +318,19 @@ export default {
display: flex;
align-items: center;
margin-bottom: 24rpx;
.phone-view {
margin-left: 44rpx;
}
}
.location-view {
color: #8D8D8F;
font-size: 28rpx;
display: flex;
align-items: flex-start;
margin-bottom: 16rpx;
.image-view {
width: 28rpx;
height: 28rpx;
......@@ -293,11 +339,13 @@ export default {
margin-top: 4rpx;
}
}
.time-view {
color: #8D8D8F;
font-size: 28rpx;
display: flex;
align-items: center;
.image-view {
width: 28rpx;
height: 28rpx;
......@@ -307,10 +355,11 @@ export default {
align-items: center;
justify-content: center;
}
.time-text {
}
.time-text {}
}
}
// .line-view {
// height: 2rpx;
// background-color: #f6f7fa;
......@@ -324,11 +373,13 @@ export default {
color: #333333;
font-size: 24rpx;
height: 92rpx;
.item-view {
display: flex;
align-items: center;
text-align: center;
color: #8D8D8F;
.count-view {
color: #333333;
font-weight: bold;
......@@ -336,6 +387,7 @@ export default {
margin-left: 16rpx;
font-size: 28rpx;
}
.line-view {
background-color: #eeeeee;
width: 2rpx;
......
......@@ -10,6 +10,8 @@
opacity: opacity,
left: left + 'px',
top: top + 'px',
'background-color': backgroundColor,
'box-shadow': boxShadow
}"
@click.stop="handleClick"
>
......@@ -45,6 +47,14 @@ export default {
canMove: {
type: Boolean,
default: true,
},
backgroundColor: {
type: String,
default: '#02A074'
},
boxShadow: {
type: String,
default: '0px 6px 12px 0px rgba(2, 160, 116, 0.3500)'
}
},
data() {
......@@ -183,7 +193,7 @@ export default {
height: 96rpx;
width: 96rpx;
border-radius: 50%;
background-color: #02A074;
// background-color: #02A074;
// background: linear-gradient(to right, #fff100, #ffde00);
z-index: 999;
display: flex;
......@@ -192,7 +202,7 @@ export default {
color: #ffffff;
font-size: 24rpx;
font-weight: bold;
box-shadow: 0px 6px 12px 0px rgba(2, 160, 116, 0.3500);
// box-shadow: 0px 6px 12px 0px rgba(2, 160, 116, 0.3500);
// padding-right: 4rpx;
.image-icon {
width: 96rpx;
......
<template>
<view :style="{background:background}" class="submit-button-box" v-loading="loading">
<view :style="{background:background,position:position}" class="submit-button-box" v-loading="loading">
<view class="submit-button" :class="{ disabled: disabled }" :style="buttonStyleString" hover-class="u-hover-class" @click.stop="$u.throttle(submit, 500)">
<u-icon name="plus" v-if="plusIcon" class="plus-icon"></u-icon>
<view class="submit-button-text">{{ text }}</view>
......@@ -35,6 +35,10 @@ export default {
type: Boolean,
default: false
},
position:{
type: String,
default: 'fixed'
}
},
data() {
return {};
......
......@@ -110,6 +110,15 @@
}
}, {
"path": "batch-settle/index",
"style": {
"navigationBarTitleText": "批量结清",
"navigationStyle": "custom",
"enablePullDownRefresh": false,
"disableScroll": true
}
}, {
"path": "quoted-price/quoted-price",
"style": {
"navigationBarTitleText": "查报价",
......
This diff is collapsed.
......@@ -94,6 +94,12 @@ export default {
},
onLoad(options) {
this.init();
uni.$on('debit-bill-list', res => {
this.init();
});
},
onUnload() {
uni.$off('debit-bill-list');
},
methods: {
changeSearch() {
......
<template>
<view class="cell-employee">
<view class="content-view" :hover-class="isNormal ? 'u-hover-class' : ''" @click.stop="$u.throttle(handleCickCell, 500)">
<view class="left-view">
<view class="image-view">{{ imagekName }}</view>
<view class="name-view">{{ member.name }}</view>
<view :class="['info-view', {edit: isEdit}]">{{ textInfo }}</view>
</view>
<view class="right-view" v-if="isSelect || isEdit">
<view v-if="isSelect" class="select-view" @click="$u.throttle(handleSelect, 500)" hover-class="u-hover-class">
<u-icon v-if="member.selected" name="checkmark-circle-fill" color="#02A074" size="42"></u-icon>
<view v-else class="select-icon"></view>
</view>
<view v-if="isEdit" class="edit-view" @click="$u.throttle(handleClickButton, 500)" hover-class="u-hover-class">
<image :src="editImage" class="edit-image"></image>
</view>
</view>
</view>
</view>
</template>
<script>
import { formatCount } from '@/utils/common.js';
export default {
props: {
member: {
type: Object,
default () {
return {
id: '',
name: '',
notSettleAmount: '',
mobile: '',
}
},
},
// edit 编辑;select: 选择; normal
type: {
type: String,
default: 'edit',
},
},
data () {
return {}
},
computed: {
baseUrl () {
return process.uniEnv.qn_base_url
},
imagekName () {
var length = (this.member.name || '').length
return (this.member.name || '').substring(length - 2)
},
isSelect () {
return this.type == 'select'
},
isEdit () {
return this.type == 'edit'
},
isNormal() {
return this.type == 'normal'
},
editImage () {
return this.baseUrl + 'bianjifuwufenlei@3x.png'
},
textInfo () {
var count = (Number(this.member.notSettleAmount || 0) == 0 ? '' : '¥' + formatCount(this.member.notSettleAmount || 0))
var mobile = this.member.mobile ? (this.member.mobile.substring(0, 3) + ' ' + this.member.mobile.substring(3, 7) + ' ' + this.member.mobile.substring(7, 11)) : ''
return this.isEdit ? count : mobile
}
},
created () { },
methods: {
handleClickButton () {
this.$emit('action', this.member.id)
},
handleSelect () {
this.member.selected = !this.member.selected
this.$emit('select', this.member.id, this.member.selected)
},
handleCickCell() {
if (this.isNormal) {
this.$emit('selectCell', {...this.member})
}
}
},
}
</script>
<style scoped lang="scss">
.cell-employee {
padding:28rpx 0 28rpx 24rpx;
min-height: 120rpx;
border-radius: 8rpx;
background-color: #ffffff;
.content-view {
display: flex;
justify-content: space-between;
align-items: center;
.left-view {
display: flex;
align-items: center;
font-size: 28rpx;
font-weight: bold;
color: #333333;
.image-view {
width: 72rpx;
height: 72rpx;
background-color: #02a074;
border-radius: 16rpx;
display: flex;
justify-content: center;
align-items: center;
color: #ffffff;
font-size: 26rpx;
}
.info-view {
color: #333333;
&.edit {
color: #fc524d;
}
}
.name-view {
margin-right: 32rpx;
margin-left: 24rpx;
max-width: 120rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
}
.right-view {
display: flex;
align-items: center;
justify-content: flex-end;
flex: 1;
.select-view {
width: 80rpx;
height: 80rpx;
display: flex;
justify-content: center;
align-items: center;
.select-icon {
width: 32rpx;
height: 32rpx;
border-radius: 50%;
border: 2rpx solid #cccccc;
}
}
}
.edit-view {
width: 80rpx;
height: 72rpx;
display: flex;
justify-content: center;
align-items: center;
.edit-image {
width: 32rpx;
height: 32rpx;
}
}
}
}
</style>
<template>
<view class="voucher" :style="{'--color':defaultColor,'--border':`2rpx solid ${borderColor}`}">
<view class="voucher" :style="{'--color':defaultColor}">
<view class="voucher-title">
<view class="voucher-title-text">
<text>{{ detail.repairShopName }}</text>
......@@ -634,9 +634,7 @@ export default {
<style lang="scss" scoped>
// 橙色字体
// $orange-color: #eb872f;
$orange-color: var(--color);
$border: var(--border);
.voucher {
padding: 24rpx 16rpx;
background-color: #ffffff;
......@@ -660,8 +658,6 @@ $border: var(--border);
left: 0;
width: 100%;
height: 6rpx;
// border-top: 2rpx solid $orange-color;
// border-bottom: 2rpx solid $orange-color;
&::after {
content: '';
box-sizing: border-box; // 为了与原元素等大
......@@ -670,7 +666,6 @@ $border: var(--border);
top: 0;
width: 200%;
height: 200%;
// border: 1px solid gray;
border-top: 2rpx solid $orange-color;
border-bottom: 2rpx solid $orange-color;
transform: scale(0.5);
......@@ -728,7 +723,7 @@ $border: var(--border);
line-height: 22rpx;
text-align: center;
margin-top: 6rpx;
border: $border;
border: 2rpx solid $orange-color;
position: relative;
.seal-view {
position: absolute;
......@@ -742,7 +737,7 @@ $border: var(--border);
display: flex;
align-items: center;
height: 34rpx;
border-top: $border;
border-top: 2rpx solid $orange-color;
line-height: 34rpx;
position: relative;
}
......@@ -754,7 +749,7 @@ $border: var(--border);
/* #ifdef APP-PLUS */
line-height: 34rpx;
/* #endif */
border-right: $border;
border-right: 2rpx solid $orange-color;
white-space: nowrap;
overflow: hidden;
word-break: break-all;
......@@ -767,9 +762,9 @@ $border: var(--border);
padding: 4rpx 4rpx;
line-height: 26rpx;
/* #ifdef APP-PLUS */
line-height: 34rpx;
line-height: 26rpx;
/* #endif */
border-right: $border;
border-right: 2rpx solid $orange-color;
box-sizing: border-box;
white-space: nowrap;
overflow: hidden;
......@@ -787,7 +782,7 @@ $border: var(--border);
.voucher-table-tr {
.voucher-table-td {
&:last-child {
border-right: $border;
border-right: 2rpx solid $orange-color;
}
}
}
......@@ -796,7 +791,7 @@ $border: var(--border);
flex: 1;
height: 100%;
padding: 4rpx 4rpx;
border-top: $border;
border-top: 2rpx solid $orange-color;
text-align: left;
word-break: break-all;
-webkit-line-clamp: 7;
......@@ -809,7 +804,7 @@ $border: var(--border);
height: 34rpx;
display: flex;
align-items: center;
border-top: $border;
border-top: 2rpx solid $orange-color;
.voucher-table-td {
border-bottom: none;
}
......@@ -819,6 +814,10 @@ $border: var(--border);
text-align: left;
height: 100%;
padding-left: 16rpx;
line-height: 26rpx;
/* #ifdef APP-PLUS */
line-height: 28rpx;
/* #endif */
&-left {
width: 70%;
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -427,7 +427,7 @@ export default {
duration: 1500,
callback: () => {}
});
uni.$emit('reloadList-maintain-bill-list');
uni.$emit('maintain-bill-list');
}
this.loading = false;
})
......
......@@ -73,7 +73,7 @@
</scroll-view>
</view>
<view class="loading-view" v-if="loading && !freshing"><u-loading mode="flower"></u-loading></view>
<FabView @click="handleClickFab" v-if="!customerId" />
<FabView :backgroundColor="fabStyle.backgroundColor" :boxShadow="fabStyle.boxShadow" :text="fabStyle.text" @click="handleClickFab" />
<u-toast ref="uToast" />
<DateRangePicker ref="date-range-picker" v-model="daterange" :canReset="true" type="daterange" @change="handleClickChange">
<view style="left:200%"></view>
......@@ -156,6 +156,17 @@ export default {
},
end() {
return this.daterange.length > 0 && this.daterange[1] ? this.daterange[1] + ' 23:59:59' : '';
},
fabStyle() {
return this.customerId ? {
backgroundColor: '#3383FE',
boxShadow: '0px 6px 12px 0px rgba(51, 131, 254, 0.3500)',
text: '批量结清'
} : {
backgroundColor: '#02A074',
boxShadow: '0px 6px 12px 0px rgba(2, 160, 116, 0.3500)',
text: '记账收据'
}
}
},
onLoad(query) {
......@@ -177,9 +188,6 @@ export default {
uni.$off('maintain-bill-list');
},
onShow() {
uni.$on('reloadList-maintain-bill-list', res => {
this.reloadList();
});
},
methods: {
toDetail(item) {
......@@ -292,10 +300,20 @@ export default {
});
},
handleClickFab() {
this.$u.route({
url: 'pages/maintain-bill/bill-style',
params: {}
});
if (this.customerId) {
this.$u.route({
url: 'pages/bill/batch-settle/index',
params: {
customerId: this.customerId
}
});
} else {
this.$u.route({
url: 'pages/maintain-bill/bill-style',
params: {}
});
}
},
handlClickRight() {
this.$u.route({
......
This diff is collapsed.
This diff is collapsed.
......@@ -22,7 +22,7 @@
<view class="scroll-view" v-else-if="info.type === 'collection'">
<show-collection ref="show-collection" :detail="info" @save="savePoster" @preview="previewPoster"></show-collection>
</view>
<view class="scroll-view>" v-else>
<view class="scroll-view" v-else>
<view class="info-view part-view">
<view class="title-view">账单信息</view>
<view class="list-view" v-for="(item, key) in infoKeys" :key="key">
......
......@@ -637,7 +637,14 @@ export function formatCount(count) {
var index = string.indexOf('.')
if (index != -1) {
string += '00'
var num = 0
if (Number(string.substring(index + 3, index + 4) || 0) >= 5) {
num = 0.01
}
string = string.substring(0, index + 3)
if (num > 0) {
return formatCount(Number(string) + num)
}
} else {
string += '.00'
}
......
......@@ -41,12 +41,12 @@ export const refundTableCellOptions = [{
{
value: "unit",
label: "单位",
width: "60rpx",
width: "50rpx",
},
{
value: "number",
label: "退货数量",
width: "64rpx",
width: "74rpx",
},
{
value: "unitPrice",
......
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