Commit d2df992c authored by 刘文虎's avatar 刘文虎

Merge branch 'master' into lwh-dev

parents 9335e21d 7aac5f0a
Pipeline #3969 canceled with stages
import request from "@/utils/request.js" import request from "@/utils/request.js"
import store from "@/store"
export function getList(data) { export function getList(data) {
return request({ return request({
url: `/rest/bookRecord/page`, url: `/rest/bookRecord/page`,
...@@ -76,4 +78,17 @@ export async function getBookRecordPage(data) { ...@@ -76,4 +78,17 @@ export async function getBookRecordPage(data) {
data, data,
noLoading: true noLoading: true
}) })
}
export function reportEvent(event) {
let userInfo = store.getters.userInfo
// 微信上报事件
var param = {
user_name: userInfo.nickname,
user_id: userInfo.id,
user_phone: userInfo.mobile,
remain_day: userInfo.remainDay,
vip: userInfo.vip && userInfo.vip.desc
};
wx.reportEvent(event, param);
} }
\ No newline at end of file
import request from "@/utils/request.js" import request from "@/utils/request.js"
export function getShopInfo() { export async function getShopInfo() {
return request({ return request({
url: `/rest/user/shop`, url: `/rest/user/shop`,
method: 'GET', method: 'GET',
}) })
} }
export function updateShopInfo(data) { export async function updateShopInfo(data) {
return request({ return request({
url: `/rest/user/shop`, url: `/rest/user/shop`,
method: 'POST', method: 'POST',
......
...@@ -35,4 +35,24 @@ export function deleteBill(data) { ...@@ -35,4 +35,24 @@ export function deleteBill(data) {
data, data,
noLoading:true noLoading:true
}) })
}
// 项目账单统计汇总
export async function getStatistics(data) {
return request({
url: `/rest/project/record/statistics`,
method: 'GET',
data,
noLoading: true
})
}
// 获取自己的名片
export async function getStatisticsItem(data) {
return request({
url: `/rest/project/record/statistics/item`,
method: 'GET',
data,
noLoading: true
})
} }
\ No newline at end of file
...@@ -35,14 +35,14 @@ ...@@ -35,14 +35,14 @@
</view> --> </view> -->
<view class="info-view"> <view class="info-view">
<view class="name-view"> <view class="name-view">
<view>{{ info.customerName }} </view> <view>{{ info.customerName || info.customer.name }} </view>
<view class="phone-view">{{ info.customerPhone }}</view> <view class="phone-view">{{ info.customerPhone || info.customer.phone }}</view>
</view> </view>
<view class="location-view" v-if="info.address"> <view class="location-view" v-if="info.address || (isDetail && !isCollection)">
<view class="image-view"> <view class="image-view">
<image :src="locationImage"></image> <image :src="locationImage"></image>
</view> </view>
<view>{{ info.address }}</view> <view class="address-view">{{ info.address || '计划' }}</view>
</view> </view>
<view class="time-view"> <view class="time-view">
<view class="image-view"> <view class="image-view">
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
</view> </view>
<!-- <view class="line-view"></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" v-if="isNormal || isSelect">
<view v-for="(item, index) in bottoms" :key="index" class="item-view"> <view v-for="(item, index) in bottoms" :key="index" class="item-view">
<view v-if="index % 2" class="line-view"> </view> <view v-if="index % 2" class="line-view"> </view>
<template v-else> <template v-else>
...@@ -95,9 +95,15 @@ export default { ...@@ -95,9 +95,15 @@ export default {
baseUrl () { baseUrl () {
return process.uniEnv.qn_base_url return process.uniEnv.qn_base_url
}, },
isDetail() {
return this.type == 'detail'
},
isSelect () { isSelect () {
return this.type == 'select' return this.type == 'select'
}, },
isNormal() {
return !this.type || this.type == 'normal'
},
middleImage () { middleImage () {
return this.baseUrl + 'fengexuxian-s@3x.png' return this.baseUrl + 'fengexuxian-s@3x.png'
}, },
...@@ -170,6 +176,9 @@ export default { ...@@ -170,6 +176,9 @@ export default {
isRefund () { isRefund () {
return this.info.type == 'refund' return this.info.type == 'refund'
}, },
isCollection() {
return this.info.type == 'collection'
},
maintainTypes () { maintainTypes () {
return { return {
'receipt': { 'receipt': {
...@@ -338,6 +347,9 @@ export default { ...@@ -338,6 +347,9 @@ export default {
flex-shrink: 0; flex-shrink: 0;
margin-top: 4rpx; margin-top: 4rpx;
} }
.address-view {
min-height: 40rpx;
}
} }
.time-view { .time-view {
......
<template> <template>
<u-navbar <u-navbar :title="title" :title-color="titleColor" :back-icon-color="backIconColor" :title-bold="true"
:title="title" :back-text="backText" :back-text-style="backStyle" :background="background" :border-bottom="false"
:title-color="titleColor" :custom-back="goBack">
:back-icon-color="backIconColor" <view class="slot-wrap" slot="right">
:title-bold="true" <view class="content-view" v-if="text || image" hover-class="u-hover-class"
:back-text="backText" @click="$u.throttle(handleClickRight, 500)">
:back-text-style="backStyle" <view v-if="image" class="image-view" :style="'width:' + imageWidth + 'rpx'">
:background="background" <image mode="widthFix" :src="image"></image>
:border-bottom="false" </view>
:custom-back="goBack" <view>{{ text }}</view>
> </view>
<view <view class="content-view" v-if="secondText || secondImage" hover-class="u-hover-class"
v-if="text || image" @click="$u.throttle(handleClickRightSecond, 500)">
class="slot-wrap" <view v-if="image" class="image-view" :style="'width:' + imageWidth + 'rpx'">
slot="right" <image mode="widthFix" :src="secondImage"></image>
hover-class="u-hover-class" </view>
@click="$u.throttle(handleClickRight, 500)" <view>{{ secondText }}</view>
> </view>
<view
v-if="image"
class="image-view"
:style="'width:' + imageWidth + 'rpx'"
><image mode="widthFix" :src="image"></image
></view>
<view>{{ text }}</view>
</view> </view>
</u-navbar> </u-navbar>
</template> </template>
...@@ -47,13 +41,21 @@ export default { ...@@ -47,13 +41,21 @@ export default {
type: String, type: String,
default: '', default: '',
}, },
secondText: {
type: String,
default: '',
},
secondImage: {
type: String,
default: '',
},
imageWidth: { imageWidth: {
type: [String, Number], type: [String, Number],
default: '24', default: '24',
}, },
background: { background: {
type: Object, type: Object,
default() { default () {
return { 'background-color': 'transparent' } return { 'background-color': 'transparent' }
}, },
}, },
...@@ -71,7 +73,7 @@ export default { ...@@ -71,7 +73,7 @@ export default {
}, },
backTextStyle: { backTextStyle: {
type: Object, type: Object,
default() { default () {
return { return {
color: '#191C27', color: '#191C27',
'font-size': 'weight', 'font-size': 'weight',
...@@ -80,43 +82,43 @@ export default { ...@@ -80,43 +82,43 @@ export default {
} }
}, },
}, },
// 自定义返回逻辑 // 自定义返回逻辑
customBack: { customBack: {
type: Function, type: Function,
// #ifdef APP-PLUS // #ifdef APP-PLUS
default: () => { default: () => {
if (getCurrentPages().length == 1) { if (getCurrentPages().length == 1) {
uni.switchTab({ uni.switchTab({
url: '/pages/index/index' url: '/pages/index/index'
}); });
} else { } else {
uni.navigateBack(); uni.navigateBack();
} }
} }
// #endif // #endif
// #ifdef MP // #ifdef MP
default() { default () {
return () => { return () => {
if (getCurrentPages().length == 1) { if (getCurrentPages().length == 1) {
uni.switchTab({ uni.switchTab({
url: '/pages/index/index' url: '/pages/index/index'
}); });
} else { } else {
uni.navigateBack(); uni.navigateBack();
} }
} }
} }
// #endif // #endif
}, },
}, },
data() { data () {
return {} return {}
}, },
computed: { computed: {
backStyle() { backStyle () {
if (this.backTextBold) { if (this.backTextBold) {
return {...this.backTextStyle, 'font-weight': 'bold'} return { ...this.backTextStyle, 'font-weight': 'bold' }
} else { } else {
return this.backTextStyle return this.backTextStyle
} }
...@@ -124,19 +126,22 @@ export default { ...@@ -124,19 +126,22 @@ export default {
}, },
methods: { methods: {
handleClickRight() { handleClickRight () {
this.$emit('click') this.$emit('click', 0)
},
handleClickRightSecond () {
this.$emit('click', 1)
}, },
goBack() { goBack () {
// 如果自定义了点击返回按钮的函数,则执行,否则执行返回逻辑 // 如果自定义了点击返回按钮的函数,则执行,否则执行返回逻辑
if (typeof this.customBack === 'function') { if (typeof this.customBack === 'function') {
// 在微信,支付宝等环境(H5正常),会导致父组件定义的customBack()函数体中的this变成子组件的this // 在微信,支付宝等环境(H5正常),会导致父组件定义的customBack()函数体中的this变成子组件的this
// 通过bind()方法,绑定父组件的this,让this.customBack()的this为父组件的上下文 // 通过bind()方法,绑定父组件的this,让this.customBack()的this为父组件的上下文
this.customBack.bind(this.$u.$parent.call(this))(); this.customBack.bind(this.$u.$parent.call(this))();
} else { } else {
uni.navigateBack(); uni.navigateBack();
} }
} }
}, },
} }
</script> </script>
...@@ -144,25 +149,32 @@ export default { ...@@ -144,25 +149,32 @@ export default {
.slot-wrap { .slot-wrap {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: flex-end;
// width: 160rpx; // #ifdef APP-PLUS
padding: 0 18rpx; margin-right: 24rpx;
height: 48rpx;
border-radius: 24rpx;
background-color: #ffffff;
color: #333333;
font-size: 24rpx;
// #ifdef APP-PLUS
margin-right: 24rpx;
// #endif // #endif
// #ifdef MP // #ifdef MP
margin-right: 8rpx; margin-right: 8rpx;
// #endif // #endif
.content-view {
margin-left: 24rpx;
display: flex;
align-items: center;
justify-content: center;
// width: 160rpx;
padding: 0 18rpx;
height: 48rpx;
border-radius: 24rpx;
background-color: #ffffff;
color: #333333;
font-size: 24rpx;
.image-view { .image-view {
width: 20rpx; width: 20rpx;
height: 24rpx; height: 24rpx;
margin-right: 8rpx; margin-right: 8rpx;
}
} }
} }
</style> </style>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<slot v-else /> <slot v-else />
</view> </view>
<view class="buttons-view"> <view class="buttons-view">
<view class="left-view"> <view v-if="showCancel" class="left-view">
<u-button <u-button
open-type="share" open-type="share"
v-if="isShare" v-if="isShare"
...@@ -123,7 +123,11 @@ export default { ...@@ -123,7 +123,11 @@ export default {
tipSelected: { tipSelected: {
type: Boolean, type: Boolean,
default: false default: false
} },
showCancel: {
type: Boolean,
default: true
},
}, },
data() { data() {
return { return {
...@@ -237,10 +241,11 @@ export default { ...@@ -237,10 +241,11 @@ export default {
} }
.buttons-view { .buttons-view {
display: flex; display: flex;
justify-content: space-between; justify-content: center;
align-items: center; align-items: center;
margin-bottom: 32rpx; margin-bottom: 32rpx;
.left-view { .left-view {
margin-right: 30rpx;
.cancel-view { .cancel-view {
color: #02a074; color: #02a074;
height: 96rpx; height: 96rpx;
...@@ -261,8 +266,6 @@ export default { ...@@ -261,8 +266,6 @@ export default {
} }
} }
.right-view { .right-view {
margin-left: 30rpx;
.confirm-view { .confirm-view {
color: #ffffff; color: #ffffff;
height: 96rpx; height: 96rpx;
......
...@@ -29,27 +29,32 @@ ...@@ -29,27 +29,32 @@
</scroll-view> </scroll-view>
<!-- #endif --> <!-- #endif -->
</view> </view>
<!-- <submit-button @handleClick="submit" text="下一步"></submit-button> -->
<view class="bottom-view"> <view class="bottom-view">
<u-button type="success" :custom-style="customCreate" @click="submit"> <u-button type="success" :loading="loading" :custom-style="customCreate" @click="handleClickSubmit">
<view class="create-view">下一步</view> <view class="create-view">下一步</view>
</u-button> </u-button>
</view> </view>
<PopShop :visible.sync="showPop" :info="info" @cancel="handleClickCancel" @confirm="handleClickConfirm"/>
</view> </view>
</template> </template>
<script> <script>
import NavbarRight from '@/components/navbar-right'; import NavbarRight from '@/components/navbar-right';
// import SubmitButton from '@/components/submit-button/index.vue'; import PopShop from './components/pop-shop.vue';
import { billBaseUrl,mineBaseUrl } from '@/utils/config.js'; import { billBaseUrl,mineBaseUrl } from '@/utils/config.js';
import { setMaintainBillType, getMaintainBillType } from '@/utils/common.js'; import { setMaintainBillType, getMaintainBillType } from '@/utils/common.js';
import {reportEvent} from '@/api/bill/index.js'
import {getShopInfo,updateShopInfo} from "@/api/mine/shop.js"
export default { export default {
components: { components: {
NavbarRight, NavbarRight,
// SubmitButton PopShop
}, },
data() { data() {
return { return {
showPop: false,
loading: false,
list:"", list:"",
backText:'收据记账', backText:'收据记账',
rightImage:mineBaseUrl+'dianpushezhi@3x.png', rightImage:mineBaseUrl+'dianpushezhi@3x.png',
...@@ -93,7 +98,9 @@ export default { ...@@ -93,7 +98,9 @@ export default {
'border-radius': '16rpx', 'border-radius': '16rpx',
width: '686rpx' width: '686rpx'
}, },
}; info: {},
infoKeys: ['name','address','phone','lister']
}
}, },
onLoad(options) { onLoad(options) {
if (options && options.list) { if (options && options.list) {
...@@ -103,6 +110,7 @@ export default { ...@@ -103,6 +110,7 @@ export default {
}, },
onReady() { onReady() {
this.type = getMaintainBillType() || 'receipt'; this.type = getMaintainBillType() || 'receipt';
this.getShopInfo()
}, },
methods: { methods: {
handleClick(item) { handleClick(item) {
...@@ -121,6 +129,14 @@ export default { ...@@ -121,6 +129,14 @@ export default {
} }
}); });
}, },
handleClickSubmit() {
this.loading = true
if (!this.checkValue()) {
this.showPop = true
} else {
this.submit()
}
},
submit() { submit() {
setMaintainBillType(this.type) setMaintainBillType(this.type)
if (this.type == 'collection') { if (this.type == 'collection') {
...@@ -138,14 +154,52 @@ export default { ...@@ -138,14 +154,52 @@ export default {
url: path url: path
}); });
} }
this.loading = false
// #ifdef MP-WEIXIN
// 上报选择类型
reportEvent(`selected_bill_${this.type}_type`);
// #endif
}, },
handlClickRight() { handlClickRight() {
this.$u.route({ this.$u.route({
url: '/pages/mine/shop-setting/shop-setting', url: '/pages/mine/shop-setting/shop-setting',
params: {} params: {}
}); });
} },
getShopInfo() {
getShopInfo({})
.then(res => {
this.info = res.data || {}
})
.catch(err => {
console.log(err);
});
},
updateShopInfo(info) {
updateShopInfo(info)
.then(res => {
this.info = res.data || {}
this.submit()
})
.catch(err => {
this.loading = false
console.log(err);
});
},
handleClickConfirm(info) {
this.info = info
this.updateShopInfo(info)
},
handleClickCancel() {
this.submit()
},
checkValue () {
for (var item of this.infoKeys) {
if (!this.info[item]) return false
}
return true
},
} }
}; };
</script> </script>
......
...@@ -96,7 +96,7 @@ export default { ...@@ -96,7 +96,7 @@ export default {
} }
&-label { &-label {
font-size: 24upx; font-size: 24upx;
color: #8d8d8d; color: #8D8D8D;
} }
&-line { &-line {
position: absolute; position: absolute;
......
...@@ -94,7 +94,14 @@ export default { ...@@ -94,7 +94,14 @@ export default {
} }
}; };
}, },
created() {
console.log('-------created-----', this.showRecord)
},
watch: { watch: {
showRecord(val) {
console.log('-------showRecord-----', val)
this.show = val
},
faultRecord: { faultRecord: {
handler(val) { handler(val) {
this.setForm(val) this.setForm(val)
......
<template>
<u-popup v-model="show" safe-area-inset-bottom border-radius="24" mode="center" width="86%" :closeable="false"
@close="handleClose" :mask-close-able="false">
<view class="pop-shop">
<view class="title-view">完善店铺信息</view>
<view class="tip-view">为了更好的体验,请先完善以下信息:</view>
<view class="content-view">
<view class="part-view" v-for="(item, key) in infoKeys" :key="key" hover-class="u-hover-class"
@click="handleClick(key)">
<view class="label-view">{{ item.name }}</view>
<view class="value-view">
<view v-if="shopInfo[key]">{{ key == 'phone' ? showText(shopInfo[key]) : shopInfo[key] }}</view>
<view class="no-value" v-else>{{ shopInfo[key] || item.placeholder }}</view>
<u-icon class="icon-view" name="arrow-right" color="#CCCCCC" size="24"></u-icon>
</view>
</view>
</view>
<view class="bottom-view">
<view class="left-view">
<u-button :custom-style="customCancel" @click="handleClickCancel">
<view class="cancel-view">下次完善</view>
</u-button>
</view>
<view class="right-view">
<u-button :loading="loading" :type="customConFirm.type" :custom-style="customConFirm"
@click="handleClickConfirm">
<view class="confirm-view">保存</view>
</u-button>
</view>
</view>
</view>
<u-toast ref="uToast" />
</u-popup>
</template>
<script>
export default {
props: {
visible: {
type: Boolean,
default: false,
},
info: {
type: Object,
default () {
return {}
}
}
},
data () {
return {
show: false,
shopInfo: {}
}
},
computed: {
infoKeys () {
return {
name: {
name: "店铺名称",
placeholder: '填写店铺名称20字以内',
},
address: {
name: '店铺地址',
placeholder: '填写店铺地址信息',
},
phone: {
name: '联系电话',
placeholder: '填写联系电话',
},
lister: {
name: '收款人',
placeholder: '填写收款人',
},
}
},
customCancel () {
return {
color: 'transparent',
height: '96rpx',
width: '264rpx',
border: '2rpx solid #8D8D8D',
'border-radius': '16rpx',
}
},
customConFirm () {
return {
type: 'success',
color: 'transparent',
'background-color': '#02A074',
height: '96rpx',
width: '264rpx',
}
},
},
watch: {
visible (val) {
this.show = val
this.loading = false
if (val) {
this.shopInfo = {...this.info}
}
},
},
methods: {
handleClick (key) {
let type = `pop-shop-${key}`
this.$u.route({
url: '/pages/mine/input/input',
params: {
type: type,
value: this.shopInfo[key],
}
});
uni.$once(`input-sure-${type}`, res => {
this.shopInfo[key] = res.content
});
},
handleClickConfirm () {
if (!this.checkValue()) {
return
}
this.loading = true
this.changeVisibleValue(false)
this.$emit('confirm', { ...this.shopInfo })
},
checkValue () {
for (var item in this.infoKeys) {
this.$refs.uToast.show({
title: `请输入${this.infoKeys[item].name}`,
type: 'warning',
duration: 1500,
callback: () => {
this.focus = true;
}
});
if (!this.shopInfo[item]) return false
}
return true
},
handleClickCancel () {
this.changeVisibleValue(false)
this.$emit('cancel')
},
changeVisibleValue (val) {
this.show = val
this.$emit('update:visible', val)
},
handleClose () {
this.changeVisibleValue(false)
},
showText(string) {
var mobile = string? (string.substring(0, 3) + ' ' + string.substring(3, 7) + ' ' + string.substring(7, 11)) : ''
return mobile
}
},
}
</script>
<style lang="scss" scoped>
.pop-shop {
text-align: center;
padding: 24rpx 32rpx;
background-image: linear-gradient(to bottom, #f4fffc 0%, #ffffff 50%);
.title-view {
color: #333333;
font-weight: bold;
font-size: 40rpx;
margin: 32rpx 0 24rpx 0;
}
.tip-view {
color: #8D8D8D;
font-size: 28rpx;
text-align: left;
margin-bottom: 24rpx;
}
.content-view {
margin-bottom: 32rpx;
.part-view {
display: flex;
align-items: center;
justify-content: space-between;
font-size: 28rpx;
color: #333333;
padding: 20rpx 0;
.label-view {
height: 70rpx;
line-height: 70rpx;
}
.value-view {
display: flex;
align-items: center;
justify-content: flex-end;
height: 70rpx;
line-height: 70rpx;
font-weight: bold;
.no-value {
color: #CCCCCC,
}
.icon-view {
margin-left: 16rpx;
}
}
}
}
.bottom-view {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 16rpx;
.left-view {
.cancel-view {
color: #8D8D8D;
height: 96rpx;
line-height: 96rpx;
font-weight: bold;
font-size: 32rpx;
display: flex;
justify-content: center;
align-items: center;
}
}
.right-view {
margin-left: 30rpx;
.confirm-view {
color: #ffffff;
height: 96rpx;
line-height: 96rpx;
font-weight: bold;
font-size: 32rpx;
}
}
}
}
</style>
...@@ -233,6 +233,7 @@ ...@@ -233,6 +233,7 @@
showTimePicker: false, showTimePicker: false,
buttonLoading: false, buttonLoading: false,
billId: '', billId: '',
copyId: '',
firstDelete: true, firstDelete: true,
deleteForm: {}, deleteForm: {},
faultRecord: { faultRecord: {
...@@ -281,6 +282,9 @@ ...@@ -281,6 +282,9 @@
baseUrl() { baseUrl() {
return process.uniEnv.qn_base_url; return process.uniEnv.qn_base_url;
}, },
isCopy() {
return this.operateType == 'copy'
},
dateImage() { dateImage() {
return this.baseUrl + 'riqi@3x.png'; return this.baseUrl + 'riqi@3x.png';
}, },
...@@ -400,16 +404,19 @@ ...@@ -400,16 +404,19 @@
if (options && options.billId) { if (options && options.billId) {
this.billId = options.billId; this.billId = options.billId;
} }
if (options && options.copyId) {
this.copyId = options.copyId;
}
if (options && options.type) { if (options && options.type) {
this.form.type = options.type; this.form.type = options.type;
} }
this.freshing = false; this.freshing = false;
if (this.billId) { if (this.billId || this.copyId) {
this.repairDetail(); this.repairDetail(this.billId || this.copyId);
} }
uni.$on('maintain-bill-detail', res => { uni.$on('maintain-bill-detail', res => {
this.repairDetail(); this.repairDetail(this.billId);
}); });
if (options && options.list) { if (options && options.list) {
let list = JSON.parse(decodeURIComponent(decodeURIComponent(decodeURIComponent(options.list)))); let list = JSON.parse(decodeURIComponent(decodeURIComponent(decodeURIComponent(options.list))));
...@@ -567,10 +574,11 @@ ...@@ -567,10 +574,11 @@
} }
}); });
}, },
repairDetail() { repairDetail(id) {
if (!id) return
this.loading = true; this.loading = true;
repairDetail({ repairDetail({
id: this.billId id: id
}) })
.then(res => { .then(res => {
if (res.data) { if (res.data) {
...@@ -587,7 +595,6 @@ ...@@ -587,7 +595,6 @@
item.uid = random_string(); item.uid = random_string();
}); });
this.form = { this.form = {
id: data.id,
customerName: data.customer.name, customerName: data.customer.name,
customerPhone: data.customer.phone, customerPhone: data.customer.phone,
receivableAmount: data.receivableAmount, receivableAmount: data.receivableAmount,
...@@ -617,14 +624,16 @@ ...@@ -617,14 +624,16 @@
repairRecordId: data.id repairRecordId: data.id
}; };
} }
// this.faultRecord = data.faultRecord || { if (this.billId) {
// category: '', this.form.id = data.id
// machineModel: '', this.form.copyId = ''
// repairResult: '', this.showRecord = data.faultRecord.id ? true : false;
// symptom: '', } else if (this.copyId) {
// repairRecordId: data.id this.showRecord = data.faultRecord.id ? true : false;
// }; this.form.id = ''
this.showRecord = this.info.faultRecord.id ? true : false; this.form.copyId = data.id
this.faultRecord.id = ''
}
}, },
handleListChange(lists) { handleListChange(lists) {
this.form.attach = lists; this.form.attach = lists;
......
<template> <template>
<view class="maintain-detail"> <view class="maintain-detail">
<NavbarRight backTextBold backText="详情" text="删除" :image="deleteImage" @click="handlClickDelete" /> <NavbarRight backTextBold backText="详情" text="删除" secondText="复制账单" :image="deleteImage" :secondImage="fuzhiImage" @click="handlClickNav" />
<view class="content-view"> <view class="content-view">
<scroll-view <scroll-view
scroll-y scroll-y
...@@ -15,7 +15,10 @@ ...@@ -15,7 +15,10 @@
enable-back-to-top enable-back-to-top
> >
<view class="scroll-view"> <view class="scroll-view">
<view class="status-view"> <view class="head-view">
<CellMaintainBill :info="info" type="detail"/>
</view>
<!-- <view class="status-view">
<text :style="'color:' + statusSetting[info.settleState.code].color">{{ statusSetting[info.settleState.code].text }}</text> <text :style="'color:' + statusSetting[info.settleState.code].color">{{ statusSetting[info.settleState.code].text }}</text>
· ·
<text :style="'color:' + statusSetting[info.sendStatus.code].color">{{ statusSetting[info.sendStatus.code].text }}</text> <text :style="'color:' + statusSetting[info.sendStatus.code].color">{{ statusSetting[info.sendStatus.code].text }}</text>
...@@ -29,14 +32,32 @@ ...@@ -29,14 +32,32 @@
</view> </view>
<view v-else class="line-view"></view> <view v-else class="line-view"></view>
</view> </view>
</view> </view> -->
<view class="money-view part-view"> <view class="info-view">
<template v-if="info.expenseDetails && info.expenseDetails.length > 0">
<view class="expense-details">
<view class="expense-title-view">收据明细</view>
<view class="extend-view" v-if="isCollection">
<view class="extend-label">交来</view>
<view class="extend-value">{{info.extend.collectionReason || ''}}</view>
</view>
<template v-else>
<view :class="['expense-item-view', {last: index + 1 == info.expenseDetails.length}]" v-for="(item, index) in info.expenseDetails" :key="index">
<view class="expense-left-view">{{item.name}}</view>
<view class="expense-middle-view">{{formatCount(item.unitPrice) + '/' + item.unit + '*' + item.number}}</view>
<view class="expense-right-view">{{formatCount(item.total)}}</view>
</view>
</template>
</view>
<view class="middle-image-view"><image :src="middleImage"></image></view>
</template>
<view class="money-view">
<view class="list-view" v-for="(item, index) in moneyKeys" :key="index"> <view class="list-view" v-for="(item, index) in moneyKeys" :key="index">
<view class="item-view"> <view class="item-view">
<view class="label-view">{{ item.title }}</view> <view class="label-view">{{ item.title }}</view>
<view v-if="index != 2" class="value-view">¥{{ item.value }}</view> <view v-if="index != 2" class="value-view">¥{{ item.value }}</view>
<view v-else class="right-view"> <view v-else class="right-view">
<view class="money-view" :style="'color:' + item.color">¥{{ item.value }}</view> <view class="money-text-view" :style="'color:' + item.color">¥{{ item.value }}</view>
| |
<view <view
class="button-view" class="button-view"
...@@ -50,7 +71,9 @@ ...@@ -50,7 +71,9 @@
</view> </view>
</view> </view>
</view> </view>
<view class="remark-view part-view" v-if="info.remark || (info.attach && info.attach.length > 0)"> </view>
<view class="remark-view" v-if="info.remark || (info.attach && info.attach.length > 0)">
<view class="title-view">备注信息:</view> <view class="title-view">备注信息:</view>
<view class="remark-content-view"> <view class="remark-content-view">
<text class="remark-text">{{ info.remark }}</text> <text class="remark-text">{{ info.remark }}</text>
...@@ -67,7 +90,7 @@ ...@@ -67,7 +90,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="record-list-view part-view" v-if="info.histories && info.histories.length > 0"> <view class="record-list-view" v-if="info.histories && info.histories.length > 0">
<view class="title-view">账单履历</view> <view class="title-view">账单履历</view>
<u-time-line> <u-time-line>
<u-time-line-item v-for="(item, index) in info.histories" :key="index" nodeTop="10"> <u-time-line-item v-for="(item, index) in info.histories" :key="index" nodeTop="10">
...@@ -121,13 +144,16 @@ ...@@ -121,13 +144,16 @@
<script> <script>
import NavbarRight from '@/components/navbar-right'; import NavbarRight from '@/components/navbar-right';
import PopNormal from '@/components/pop-normal'; import PopNormal from '@/components/pop-normal';
import CellMaintainBill from '@/components/cell-maintain-bill';
import { repairDetail, repairSettle, repairSync, repairDelete, repairSend } from '@/api/maintain/index.js'; import { repairDetail, repairSettle, repairSync, repairDelete, repairSend } from '@/api/maintain/index.js';
import { formatCount } from '@/utils/common.js'; import { formatCount } from '@/utils/common.js';
export default { export default {
components: { components: {
NavbarRight, NavbarRight,
PopNormal PopNormal,
CellMaintainBill
}, },
data() { data() {
return { return {
...@@ -151,12 +177,18 @@ export default { ...@@ -151,12 +177,18 @@ export default {
deleteImage() { deleteImage() {
return this.baseUrl + 'shanchuzhangdanxiangqing@3x.png'; return this.baseUrl + 'shanchuzhangdanxiangqing@3x.png';
}, },
fuzhiImage() {
return this.baseUrl + 'fuzhizhangdan@3x.png'
},
homeImage() { homeImage() {
return this.baseUrl + 'huishouye@3x.png'; return this.baseUrl + 'huishouye@3x.png';
}, },
isSure() { isSure() {
return this.info.sendStatus.code == 'SURE' || this.info.settleState.code == 'YES'; return this.info.sendStatus.code == 'SURE' || this.info.settleState.code == 'YES';
}, },
middleImage() {
return this.baseUrl + 'fengexuxian@3x-3.png';
},
// sendStatus WAIT:未发送;WAIT_SURE:未确定;SURE:已确定 // sendStatus WAIT:未发送;WAIT_SURE:未确定;SURE:已确定
// settleState NO:未结清;YES:已结清 // settleState NO:未结清;YES:已结清
statusSetting() { statusSetting() {
...@@ -207,6 +239,9 @@ export default { ...@@ -207,6 +239,9 @@ export default {
isRefund() { isRefund() {
return this.info.type == 'refund' return this.info.type == 'refund'
}, },
isCollection() {
return this.info.type == 'collection'
},
moneyKeys() { moneyKeys() {
return [ return [
{ {
...@@ -277,6 +312,13 @@ export default { ...@@ -277,6 +312,13 @@ export default {
confirmText: '确定', confirmText: '确定',
content: '是否将该账单转入账单明细统计?', content: '是否将该账单转入账单明细统计?',
bottomTip: '' bottomTip: ''
},
{
title: '操作提醒',
type: 'normal',
confirmText: '确定',
content: '是否复制该账单?',
bottomTip: ''
} }
]; ];
}, },
...@@ -404,8 +446,12 @@ export default { ...@@ -404,8 +446,12 @@ export default {
} }
} }
}, },
handlClickDelete() { handlClickNav(index) {
this.current = 0; if (index == 0) {
this.current = 0;
} else {
this.current = 3
}
this.visible = true; this.visible = true;
}, },
handleClickOperate() { handleClickOperate() {
...@@ -540,30 +586,42 @@ export default { ...@@ -540,30 +586,42 @@ export default {
} }
index++; index++;
} }
// 回首页 this.toCreatePage({
this.toCreatePage(); billId: this.billId
});
}, },
toCreatePage() { toCreatePage(params, type = 'navigateTo') {
this.$u.route({ this.$u.route({
url: 'pages/maintain-bill/create', url: 'pages/maintain-bill/create',
type: 'navigateTo', type: type,
params: { params: params
billId: this.billId
}
}); });
}, },
handleClickConfirm(select) { handleClickConfirm(select) {
if (this.current == 0) { switch (this.current) {
// 删除账单 case 0:
this.repairDelete(select); // 删除账单
} else if (this.current == 1) { this.repairDelete(select);
// 标记为已结清 break
this.repairSettle(); case 1:
} else if (this.current == 2) { // 标记为已结清
// 同步账单 this.repairSettle();
this.repairSync(); break
case 2:
// 同步账单
this.repairSync();
break
case 3:
// 复制账单
this.copyBill();
break
} }
}, },
copyBill() {
this.toCreatePage({
copyId: this.billId
}, 'redirectTo');
},
handleClickPreview(index) { handleClickPreview(index) {
uni.previewImage({ uni.previewImage({
urls: this.info.attach, urls: this.info.attach,
...@@ -601,15 +659,91 @@ export default { ...@@ -601,15 +659,91 @@ export default {
.scroll-view { .scroll-view {
padding-bottom: 44rpx; padding-bottom: 44rpx;
} }
.status-view { // .status-view {
font-weight: bold; // font-weight: bold;
font-size: 40rpx; // font-size: 40rpx;
// }
.head-view {
margin-bottom: 24rpx;
} }
.part-view { .info-view {
border-radius: 16rpx;
overflow: hidden;
.expense-details {
background-color: #ffffff;
.expense-title-view {
font-size: 32rpx;
color: #333333;
font-weight: bold;
padding: 24rpx 24rpx 8rpx 24rpx;
}
.extend-view {
display: flex;
justify-content: space-between;
align-items: flex-start;
padding: 24rpx;
.extend-label {
width: 200rpx;
flex-shrink: 0;
text-align: left;
color: #8D8D8D;
flex-shrink: 0;
}
.extend-value {
text-align: right;
flex: 1;
font-weight: bold;
color: #333333;
}
}
.expense-item-view {
margin: 0 24rpx;
height: 108rpx;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 28rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
text-align: right;
border-bottom: 2rpx solid #F6F7FA;
&.last {
border-bottom: 0;
}
.expense-left-view {
width: 200rpx;
flex-shrink: 0;
text-align: left;
color: #8D8D8D
}
.expense-middle-view {
width: 240rpx;
flex-shrink: 0;
font-weight: bold;
margin-left: 6rpx;
}
.expense-right-view {
width: 200rpx;
flex-shrink: 0;
font-weight: bold;
margin-left: 6rpx;
}
}
}
}
.middle-image-view {
height: 24rpx;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
position: relative;
}
.money-view {
padding: 16rpx 24rpx 24rpx 24rpx; padding: 16rpx 24rpx 24rpx 24rpx;
background-color: #ffffff; background-color: #ffffff;
border-radius: 16rpx;
margin-top: 24rpx;
.list-view { .list-view {
.item-view { .item-view {
padding: 24rpx 0 8rpx 0; padding: 24rpx 0 8rpx 0;
...@@ -619,7 +753,7 @@ export default { ...@@ -619,7 +753,7 @@ export default {
font-size: 28rpx; font-size: 28rpx;
.label-view { .label-view {
color: #8d8d8d; color: #8D8D8D;
flex-shrink: 0; flex-shrink: 0;
} }
.value-view { .value-view {
...@@ -635,23 +769,13 @@ export default { ...@@ -635,23 +769,13 @@ export default {
margin: 16rpx 0; margin: 16rpx 0;
} }
} }
}
.info-view {
.title-view {
font-size: 32rpx;
font-weight: bold;
color: #333333;
margin: 16rpx 0 8rpx 0;
}
}
.money-view {
.right-view { .right-view {
color: #8d8d8d; color: #8D8D8D;
font-size: 28rpx; font-size: 28rpx;
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
align-items: center; align-items: center;
.money-view { .money-text-view {
font-weight: bold; font-weight: bold;
margin-right: 16rpx; margin-right: 16rpx;
} }
...@@ -666,9 +790,13 @@ export default { ...@@ -666,9 +790,13 @@ export default {
} }
} }
.remark-view { .remark-view {
padding: 16rpx 24rpx 24rpx 24rpx;
background-color: #ffffff;
border-radius: 16rpx;
margin-top: 24rpx;
font-size: 28rpx; font-size: 28rpx;
.title-view { .title-view {
color: #8d8d8d; color: #8D8D8D;
margin: 16rpx 0 8rpx 0; margin: 16rpx 0 8rpx 0;
} }
.remark-content-view { .remark-content-view {
...@@ -698,6 +826,10 @@ export default { ...@@ -698,6 +826,10 @@ export default {
} }
} }
.record-list-view { .record-list-view {
padding: 16rpx 24rpx 24rpx 24rpx;
background-color: #ffffff;
border-radius: 16rpx;
margin-top: 24rpx;
.title-view { .title-view {
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
...@@ -721,6 +853,7 @@ export default { ...@@ -721,6 +853,7 @@ export default {
} }
.record-time { .record-time {
text-align: right; text-align: right;
color: #8D8D8D;
} }
} }
} }
......
...@@ -187,6 +187,42 @@ export default { ...@@ -187,6 +187,42 @@ export default {
height: 240, height: 240,
empty: true empty: true
}; };
case 'pop-shop-name':
return {
title: '店铺名称',
type: 'textarea',
placeholder: '填写店铺名称20字以内',
maxlength: 20,
height: 240,
empty: true
};
case 'pop-shop-address':
return {
title: '店铺地址',
type: 'textarea',
placeholder: '填写店铺地址信息',
maxlength: 30,
height: 240,
empty: true
};
case 'pop-shop-phone':
return {
title: '联系电话',
type: 'number',
placeholder: '填写联系电话',
maxlength: 11,
height: 240,
empty: true
};
case 'pop-shop-lister':
return {
title: '收款人',
type: 'textarea',
placeholder: '填写收款人',
maxlength: 10,
height: 240,
empty: true
};
} }
} }
}, },
......
...@@ -11,23 +11,19 @@ ...@@ -11,23 +11,19 @@
</view> </view>
<view class="detail-right"> <view class="detail-right">
<view class="detail-right-label">{{ detail.type.desc }}</view> <view class="detail-right-label">{{ detail.type.desc }}</view>
<view class="detail-right-value" :class="{ 'detail-right-status': redAmount }">{{ detail.amount }}</view> <view class="detail-right-value" :class="{ 'detail-right-status': redAmount }">{{ amount }}</view>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import { workTypeOptions } from '@/utils/options/workpoint'; import { formatCount } from '@/utils/common.js';
export default { export default {
props: { props: {
detail: { detail: {
type: Object, type: Object,
default: () => {} default: () => {}
}, },
current: {
type: Number,
default: 0
}
}, },
computed: { computed: {
redAmount() { redAmount() {
...@@ -36,6 +32,9 @@ export default { ...@@ -36,6 +32,9 @@ export default {
return false; return false;
} }
return parseFloat(amount) < 0; return parseFloat(amount) < 0;
},
amount() {
return formatCount(Number(this.detail.amount || 0))
} }
}, },
data() { data() {
...@@ -56,11 +55,12 @@ export default { ...@@ -56,11 +55,12 @@ export default {
.detail { .detail {
background: #ffffff; background: #ffffff;
border-radius: 16upx; border-radius: 16upx;
padding: 24upx; padding: 0 24upx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
margin-bottom: 24upx; margin-bottom: 24upx;
min-height: 136rpx;
.content { .content {
width: 420upx; width: 420upx;
display: flex; display: flex;
...@@ -87,8 +87,9 @@ export default { ...@@ -87,8 +87,9 @@ export default {
font-weight: bold; font-weight: bold;
} }
&-value { &-value {
margin-top: 12rpx; margin-top: 18rpx;
color: #8d8d8d; color: #8D8D8D;
font-size: 24rpx;
} }
} }
} }
...@@ -97,10 +98,11 @@ export default { ...@@ -97,10 +98,11 @@ export default {
font-size: 28upx; font-size: 28upx;
line-height: 28upx; line-height: 28upx;
&-label { &-label {
color: #8d8d8d; color: #8D8D8D;
font-size: 24rpx;
} }
&-value { &-value {
margin-top: 12rpx; margin-top: 18rpx;
color: #333333; color: #333333;
font-weight: bold; font-weight: bold;
} }
......
<template>
<view class="cell-project-bill">
<view class="content-view" hover-class="u-hover-class" @click="$u.throttle(handleCickCell, 500)">
<view class="left-view">
<view class="image-view">{{ values.imagekName }}</view>
<view class="name-view">{{ values.memberName }}</view>
</view>
<view class="right-view">
<view class="item-view" v-for="item in amountKeys" :key="item.key">
<view class="value-view">{{ values[item.key] }}</view>
<view class="label-view">{{ item.name }}</view>
</view>
<view class="item-view, second" v-for="item in numberKeys" :key="item.key">
<view class="value-view">{{ values[item.key] }}</view>
<view class="label-view">{{ item.name }}</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { formatCount } from '@/utils/common.js';
export default {
props: {
member: {
type: Object,
default () {
return {
borrowingAmount: '', // 借支金额
contractorAmount: '', // 包工金额
contractorNum: 0, // 包工笔数
normalWorkTime: 0, // 上班工时
overWorkTIme: 0, // 加班工时
settleAmount: '', // 结算金额
timeAmount: '', // 记工金额
memberId: '',
memberName: '',
}
},
},
},
data () {
return {}
},
computed: {
// 项目工资:工时 + 包工 = 总
// 未结: 总 - 已结
values () {
let all = Number(this.member.contractorAmount || 0) + Number(this.member.timeAmount || 0)
return {
imagekName: (this.member.memberName || '').substring((this.member.memberName || '').length - 2),
memberId: this.member.memberId,
memberName: this.member.memberName,
settleAmount: formatCount(Number(this.member.settleAmount || 0)), // 已结工资
borrowingAmount: formatCount(Number(this.member.contractorAmount || 0)), // 借支金额
unsettleAmount: formatCount(all - Number(this.member.settleAmount || 0)), // 未结工资
normalWorkTime: this.member.normalWorkTime, // 上班工时
overWorkTIme: this.member.overWorkTIme, // 加班工量
contractorNum: this.member.contractorNum, // 包工笔数
contractorAmount: formatCount(Number(this.member.contractorAmount || 0)), // 包工工钱
}
},
amountKeys () {
return [
{
key: 'unsettleAmount',
name: '未结'
},
{
key: 'settleAmount',
name: '已结'
},
{
key: 'borrowingAmount',
name: '借支'
},
]
},
numberKeys () {
return [
{
key: 'normalWorkTime',
name: '上班(工)'
},
{
key: 'overWorkTIme',
name: '加班(工)'
},
{
key: 'contractorNum',
name: '包工(笔)'
},
]
}
},
created () { },
methods: {
handleCickCell () {
this.$emit('select', this.member.memberId)
}
},
}
</script>
<style scoped lang="scss">
.cell-project-bill {
min-height: 272rpx;
border-radius: 16rpx;
background-color: #ffffff;
overflow: hidden;
.content-view {
display: flex;
justify-content: space-between;
align-items: center;
.left-view {
min-height: 272rpx;
flex-shrink: 0;
width: 186rpx;
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
font-size: 28rpx;
font-weight: bold;
color: #333333;
background-image: linear-gradient(to right, #F4FFFC 0%, #FFFFFF 50%);
padding: 40rpx 24rpx;
.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;
margin-bottom: 24rpx;
}
.name-view {
max-width: 136rpx;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
}
.right-view {
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
margin: 40rpx 0;
padding: 0 24rpx;
border-left: 2rpx solid #F6F7FA;
.item-view {
min-width: 140rpx;
text-align: center;
margin-bottom: 24rpx;
&.second {
margin-bottom: 0;
}
.value-view {
font-size: 28rpx;
font-weight: bold;
color: #333333;
margin-bottom: 10rpx;
}
.label-view {
display: flex;
justify-content: center;
align-items: center;
color: #8D8D8D;
font-size: 24rpx
}
}
}
}
}
</style>
<template>
<view class="summary-content">
<view class="content-view">
<scroll-view scroll-y style="height: 100%; width: 100%" scroll-anchoring refresher-enabled="true"
:refresher-triggered="triggered" :refresher-threshold="100" refresher-background="#F6F7FA"
@refresherrefresh="onRefresh" @refresherrestore="onRestore" enable-back-to-top>
<view class="head">
<view class="head-view">
<view class="title-view">
<view class="left-view">
<view class="select-view" hover-class="u-hover-class" @click="handleClickShowDateRange">
<view class="date-view">{{ dateString || '全部时段' }}</view>
<u-icon name="arrow-down-fill" color="#8D8D8D" size="24"></u-icon>
</view>
</view>
</view>
<view :class="['bill-count-view', { more: showMore }]">
<SummaryCount :detail="statistics" @infoShow="handleShowInfo"/>
</view>
<view class="show-more-view" @click="$u.throttle(handleClickShowMore, 500)" hover-class="u-hover-class">
<u-icon :name="showMore ? 'arrow-up' : 'arrow-down'" color="#02A074" size="32"></u-icon>
<view class="more-text">{{ showMore ? '点击收起' : '更多数据' }}</view>
</view>
</view>
</view>
<view class="list-view" v-if="records && records.length > 0">
<view v-for="(item, index) in records" :key="index" class="item-view">
<CellProjectBill :member="item" @select="handleSelectCell" />
</view>
<view class="load-more-view" v-show="!loading">
<u-loadmore :status="loadStatus" bgColor="#F6F7FA"></u-loadmore>
</view>
</view>
<NoData v-else-if="!loading" customStyle="margin-top:100rpx" :image="currentNoData.image"
:text="currentNoData.text" />
</scroll-view>
</view>
<view class="loading-view" v-if="loading && !freshing">
<u-loading mode="flower"></u-loading>
</view>
<DateRangePicker ref="date-range-picker" v-model="daterange" :canReset="true" type="daterange"
@change="handleClickChange">
<view style="left:200%"></view>
</DateRangePicker>
<PopNormal :visible.sync="visible" title="加班工量" confirmText="我知道了" :showCancel="false">
<view class="pop-content">
如您在记工时填写为<text class="green-text">[加班小时]</text>,将根据加班设置换算工量;如果设置为<text
class="green-text">[按小时算]</text>则根据上班设置进行工量换算。
</view>
</PopNormal>
</view>
</template>
<script>
import DateRangePicker from '@/components/date-range-picker/uni-datetime-picker.vue';
import CellProjectBill from './cell-project-bill';
import PopNormal from '@/components/pop-normal';
import NoData from '@/components/no-data';
import SummaryCount from './summary-count.vue';
import { getStatistics, getStatisticsItem } from '@/api/workpoint/project-bill.js';
export default {
components: {
DateRangePicker,
CellProjectBill,
NoData,
SummaryCount,
PopNormal
},
props: {
projectId: {
type: String,
default: ''
},
},
data () {
return {
visible: false,
daterange: [],
records: [],
loading: true,
loadStatus: 'loading',
triggered: true,
freshing: false,
statistics: {
number: 0,
actualAmount: 0,
receivableAmount: 0
},
showMore: false
};
},
computed: {
baseUrl () {
return process.uniEnv.qn_base_url;
},
currentNoData () {
return {
image: this.baseUrl + 'wuweixiuzhangdan@3x.png',
text: '当前暂无账单信息'
};
},
dateString () {
return this.daterange.length > 0 && this.daterange[0] && this.daterange[1] ? `${this.daterange[0]} - ${this.daterange[1]}` : '';
},
start () {
return this.daterange.length > 0 && this.daterange[0] ? this.daterange[0] + ' 00:00:00' : '';
},
end () {
return this.daterange.length > 0 && this.daterange[1] ? this.daterange[1] + ' 23:59:59' : '';
},
},
created () {
console.log('-----created-----')
uni.$on('project-bill-summary', res => {
this.reloadList();
});
this.freshing = false;
// this.reloadList();
},
destroyed () {
uni.$off('project-bill-summary');
},
onShow () {
},
methods: {
reloadList () {
this.loadStatus = 'loading';
this.getStatisticsItem();
this.getStatistics()
},
getStatisticsItem () {
if (this.current == 1) {
this.loading = true;
}
getStatisticsItem({
projectId: this.projectId,
happenStart: this.start,
happenEnd: this.end,
})
.then(res => {
this.records = res.data || []
this.loadStatus = 'nomore'
setTimeout(() => {
this.$nextTick(() => {
if (this.freshing) {
this.triggered = false;
this.freshing = false;
}
});
}, 500)
this.loading = false;
})
.catch(err => {
this.loading = false;
console.log(err);
});
},
getStatistics () {
getStatistics({
projectId: this.projectId,
happenStart: this.start,
happenEnd: this.end,
})
.then(res => {
let data = res.data;
this.statistics = data
})
.catch(err => {
console.log(err);
});
},
onRefresh () {
if (this.freshing) return;
this.freshing = true;
this.reloadList();
},
onRestore () {
this.triggered = 'restore'; // 需要重置
},
changeSearch () {
this.reloadList();
},
handleClickChange (range) {
this.daterange = range;
this.reloadList();
},
handleSelectCell (id) {
this.$u.route({
url: 'pages/workpoint/project-bill/project-bill',
type: 'navigateTo',
params: {
memberId: id,
projectId: this.projectId
}
});
},
handleClickShowMore () {
this.showMore = !this.showMore
},
handleClickShowDateRange () {
this.$refs['date-range-picker'].show();
},
handleShowInfo(show) {
this.visible = show
}
}
};
</script>
<style scoped lang="scss">
.summary-content {
height: 100%;
background-color: #f6f7fa;
overflow: auto;
.head {
margin: 24rpx 0;
}
.head-view {
padding: 0 24rpx;
background: #FFFFFF;
border-radius: 16rpx;
}
.title-view {
height: 96rpx;
color: #333333;
display: flex;
align-items: center;
justify-content: space-between;
border-bottom: 2rpx solid #F6F7FA;
.left-view {
display: flex;
align-items: center;
height: 100%;
.select-view {
display: flex;
align-items: center;
font-size: 24rpx;
font-weight: bold;
.date-view {
margin-right: 16rpx;
}
}
.reset-view {
width: 120rpx;
height: 48rpx;
border-radius: 8rpx;
border: 2rpx solid #666666;
color: #666666;
font-size: 24rpx;
margin-left: 32rpx;
text-align: center;
line-height: 48rpx;
}
}
.right-view {
height: 100%;
display: flex;
align-items: center;
justify-content: flex-end;
font-size: 24rpx;
.icon-view {
width: 28rpx;
height: 28rpx;
border-radius: 8rpx;
border: 2rpx solid #333333;
margin-right: 12rpx;
display: flex;
align-items: center;
justify-content: center;
&.filter {
border: 2rpx solid #02a074;
}
}
}
}
.bill-count-view {
overflow: hidden;
height: 148rpx;
&.more {
height: 280rpx;
}
}
.show-more-view {
background-color: #ffffff;
display: flex;
justify-content: center;
align-items: center;
height: 88rpx;
margin-top: -32rpx;
.more-text {
margin-left: 8rpx;
color: #02A074;
font-size: 26rpx;
}
}
.content-view {
height: 100%;
overflow: auto;
padding: 0rpx 24rpx;
.list-view {
.item-view {
margin-bottom: 24rpx;
}
}
.load-more-view {
padding-bottom: 44rpx;
}
}
.loading-view {
width: 100%;
background-color: transparent;
display: flex;
align-items: center;
justify-content: center;
top: 50%;
left: 0;
position: fixed;
}
.pop-content {
margin-bottom: 24rpx;
font-size: 32rpx;
color: #333333;
.green-text {
color: #02A074;
}
}
}
</style>
<template>
<view class="summary-count">
<view class="content-view">
<view class="item-view" v-for="(item, index) in infoKeys" :key="index">
<view class="value-view">{{values[item.key]}}</view>
<view class="label-view" @click="handleClickInfo(item.showTip)" :hover-class="item.showTip ? 'u-hover-class' : ''">
<view>{{item.name}}</view>
<u-icon class="icon-view" v-if="item.showTip" name="info-circle-fill" color="#02A074" size="24"></u-icon>
</view>
</view>
</view>
</view>
</template>
<script>
import { keepWFull } from '@/utils/common.js';
export default {
props: {
detail: {
type: Object,
default () {
return {
borrowingAmount: '', // 借支金额
contractorAmount: '', // 包工金额
contractorNum: 0, // 包工笔数
normalWorkTime: 0, // 上班工时
overWorkTIme: 0, // 加班工时
settleAmount: '', // 结算金额
timeAmount: '', // 记工金额
}
}
}
},
computed: {
// 项目工资:工时 + 包工 = 总
// 未结: 总 - 已结
values () {
let all = parseFloat(this.detail.contractorAmount || 0) + parseFloat(this.detail.timeAmount || 0)
return {
all: keepWFull(all), // 项目工资
settleAmount: keepWFull(parseFloat(this.detail.settleAmount || 0)), // 已结工资
borrowingAmount: keepWFull(parseFloat(this.detail.contractorAmount || 0)), // 借支金额
unsettleAmount: keepWFull(all - parseFloat(this.detail.settleAmount || 0)), // 未结工资
normalWorkTime: this.detail.normalWorkTime, // 上班工时
overWorkTIme: this.detail.overWorkTIme, // 加班工量
contractorNum: this.detail.contractorNum, // 包工笔数
contractorAmount: keepWFull(parseFloat(this.detail.contractorAmount || 0)), // 包工工钱
}
},
infoKeys () {
return [
{
key: 'all',
name: '项目工资'
},
{
key: 'settleAmount',
name: '已结工资'
},
{
key: 'borrowingAmount',
name: '借支金额'
},
{
key: 'unsettleAmount',
name: '未结工资'
},
{
key: 'normalWorkTime',
name: '上班工时'
},
{
key: 'overWorkTIme',
name: '加班工量',
showTip: true,
},
{
key: 'contractorNum',
name: '包工笔数'
},
{
key: 'contractorAmount',
name: '包工工钱'
}
]
}
},
data () {
return {
};
},
methods: {
handleClickInfo(show) {
if (!show) return
this.$emit('infoShow', show)
}
}
};
</script>
<style lang="scss" scoped>
.summary-count {
.content-view {
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
.item-view {
min-width: 140rpx;
text-align: center;
margin: 24rpx 0;
.value-view {
font-size: 28rpx;
font-weight: bold;
color: #333333;
margin-bottom: 10rpx;
}
.label-view {
display: flex;
justify-content: center;
align-items: center;
color: #8D8D8D;
font-size: 24rpx;
.icon-view {
margin-left: 4rpx;
}
}
}
}
}
</style>
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