Commit 5a2a12f2 authored by 刘文虎's avatar 刘文虎

记工时-创建工时

parent 225af844
<template>
<view class="bottom-buttons">
<view class="left-view" v-if="showCancel">
<u-button :custom-style="customCancel" @click="handleClickCancel"><view class="skip-view">{{cancelText}}</view></u-button>
<u-button :custom-style="customCancel" @click="handleClickCancel">
{{cancelText}}
</u-button>
</view>
<view class="right-view">
<u-button :custom-style="customConFirm" @click="handleClickSure" :disabled="disabled" :loading="loading"><view class="confirm-view">{{confirmText}}</view></u-button>
<u-button :custom-style="customConFirm" @click="handleClickSure" :disabled="disabled" :loading="loading">
<view class="confirm-view">{{ confirmText }}</view>
</u-button>
</view>
</view>
</template>
<script>
export default {
props:{
disabled:{
type:Boolean,
default:false
props: {
disabled: {
type: Boolean,
default: false
},
loading:{
type:Boolean,
default:false
loading: {
type: Boolean,
default: false
},
showCancel:{
type:Boolean,
default:true
showCancel: {
type: Boolean,
default: true
},
cancelText:{
type:String,
default:'取消'
cancelText: {
type: String,
default: '取消'
},
confirmText:{
type:String,
default:'保存'
confirmText: {
type: String,
default: '保存'
},
customCancel: {
type: Object,
default: () => {
return {
color: '#fc524d',
height: '104rpx',
'border-radius': '16rpx',
width: '200rpx'
};
}
}
},
data() {
return {
customCancel: {
color: '#02A074',
height: '104rpx',
'border-radius': '16rpx',
width: '200rpx',
},
};
},
computed:{
computed: {
customConFirm() {
return {
color: 'transparent',
'background-color': this.disabled ? '#7DCFB8':'#02a074' ,
'background-color': this.disabled ? '#7DCFB8' : '#02a074',
height: '104rpx',
'border-radius': '16rpx'
}
},
};
}
},
methods:{
handleClickCancel(){
this.$emit('cancel')
methods: {
handleClickCancel() {
this.$emit('cancel');
},
handleClickSure(){
this.$emit('confirm')
handleClickSure() {
this.$emit('confirm');
}
}
};
......@@ -73,7 +82,7 @@ export default {
.left-view {
margin-right: 32rpx;
.skip-view {
color: #fc524d;
// color: #fc524d;
height: 104rpx;
line-height: 104rpx;
font-weight: bold;
......
<template>
<view class="bill-tabs left" :class="{ right: current === 2 }">
<view class="bill-tabs-item" :class="{ 'bill-tabs-active': item.value === current }" v-for="(item, index) in list" :key="index" @click="change(item.value)">
<view class="bill-tabs-item-label">{{ item.label }}</view>
<view class="bill-tabs-item-line" v-if="item.value === current"></view>
</view>
</view>
</template>
<script>
export default {
props: {
current: {
type: Number,
default: 2
},
list: {
type: Array,
default: () => []
}
},
data() {
return {
};
},
methods: {
change(index) {
this.$emit('change', index);
}
}
};
</script>
<style lang="scss" scoped>
.bill-tabs {
border-radius: 16rpx 16rpx 0 0;
height: 72upx;
display: flex;
align-items: center;
background: #cbede4;
color: #ffffff;
font-size: 28rpx;
font-weight: bold;
overflow: hidden;
&-item {
width: 50%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
position: relative;
&-line {
position: absolute;
bottom: 10rpx;
left: 50%;
transform: translateX(-50%);
width: 40upx;
height: 4upx;
background: $default-color;
}
}
&-active {
color: $default-color;
padding-bottom: 10rpx;
}
}
.left {
background: linear-gradient(70deg, #ffffff 50%, #cbede4 0);
}
.right {
background: linear-gradient(110deg, #cbede4 50%, #ffffff 0);
}
</style>
<template>
<view class="billing-category">
<uni-swiper-dot :info="list" :current="current" field="content" :mode="mode" :dotsStyles="dotsStyles">
<swiper class="swiper" :indicator-dots="false" indicator-color="#8d8d8d" indicator-active-color="#02A074" :autoplay="false" :duration="duration" @change="change">
<swiper-item v-for="(swiper, swiperIndex) in list" :key="swiperIndex">
<view class="swiper-item">
<view class="billing-category-item" :class="{ active: item.checked }" v-for="(item, index) in swiper" :key="index" @click="handleCheck(item)">
<view class="billing-category-item-icon" :class="{ 'billing-category-item-border': item.id === 'setting' }">
<u-icon name="plus" v-if="item.id === 'setting'"></u-icon>
<text v-else>{{ resetName(item.name) }}</text>
</view>
<view class="billing-category-item-text ellipsis" :class="{ 'billing-category-item-setting': item.id === 'setting' }">
<text>{{ item.name }}</text>
</view>
</view>
</view>
</swiper-item>
</swiper>
</uni-swiper-dot>
</view>
</template>
<script>
import UniSwiperDot from '@/uni_modules/uni-swiper-dot/components/uni-swiper-dot/uni-swiper-dot.vue';
import { billStaticBaseUrl, billBaseUrl } from '@/utils/config.js';
export default {
name: 'billing-category',
components: {
UniSwiperDot
},
props: {
list: {
type: Array,
default: () => []
}
},
// watch: {
// options: {
// handler(val) {
// console.log(val);
// this.list = this.options;
// },
// deep: true,
// immediate: true
// }
// },
data() {
return {
billStaticBaseUrl,
billBaseUrl,
duration: 500,
current: 0,
mode: 'round',
dotsStyles: {
width: 6,
bottom: 5,
backgroundColor: '#8d8d8d',
selectedBackgroundColor: '#02A074',
border: 'none',
selectedBorder: 'none'
},
};
},
methods: {
checkAll(flag) {
this.list.map((li, index1) => {
li.map((el, index2) => {
if (el.id !== 'setting') {
el.checked = flag;
}
});
});
this.change()
},
resetName(name) {
return name.slice(-2);
},
handleCheck(item) {
if (item.id === 'setting') {
this.$emit('setting');
return false;
}
item.checked = !item.checked;
this.change()
},
change() {
let ids = [];
this.list.map(li => {
li.map(el => {
if (el.checked) {
ids.push(el.id);
}
});
});
this.$emit('handleClick', ids);
}
}
};
</script>
<style lang="scss" scoped>
.billing-category {
// margin-bottom: 24upx;
width: 100%;
// height: 160rpx;
.swiper {
width: 100%;
height: 150rpx;
.swiper-item {
width: 100%;
height: 100%;
display: flex;
flex-wrap: wrap;
}
}
&-item {
height: 110rpx;
padding: 0 12upx;
width: 16.66%;
// padding-bottom: 32upx;
font-size: 28upx;
color: #8d8d8d;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
&-icon {
width: 72upx;
height: 72upx;
background: #f6f7fa;
border-radius: 16rpx;
text-align: center;
line-height: 72rpx;
color: $default-color;
font-size: 26rpx;
}
&-text {
width: 100%;
text-align: center;
margin-top: 12upx;
font-size: 20upx;
line-height: 24upx;
color: #8d8d8d;
}
&-setting {
color: $default-color;
&-icon {
// margin-left: 2rpx;
}
}
&-border {
border: 2rpx solid $default-color;
}
}
.active {
.billing-category-item-icon {
background-color: $default-color;
color: #ffffff;
}
.billing-category-item-text {
// color: #333333;
}
}
}
</style>
......@@ -29,7 +29,7 @@ export const card_share_url = 'https://system.banshouhui.com/shareqrcode' // pag
export const whiteList = ['/pages/index/index', '/pages/index/schedule/schedule', '/pages/index/bill/bill',
'/pages/index/mine/mine', '/pages/login/login', '/pages/login/quick-login/quick-login',
'/pages/login/binding-phone/binding-phone', '/pages/login/agreement/agreement',
'/pages/mine/update-log/update-log', '/pages/mine/about/about', '/pages/maintain-bill/show'
'/pages/mine/update-log/update-log', '/pages/mine/about/about', '/pages/maintain-bill/show','/pages/mine/service/service'
]; // 路由白名单
export const responseWhiteList = ['/rest/bookRecord/export', '/rest/repair/export', '/rest/exchangeCode/check',
......
export const tabOptions = [{
value: 1,
label: "点工"
},
{
value: 2,
label: "包工/计量"
},
]
export const workTypeOptions = [{
value: "100",
label: "一个工"
},
{
value: "50",
label: "半个工"
},
{
value: "custom",
label: "自定义"
},
]
export const overtimeTypeOptions = [{
value: "null",
label: "无"
},
{
value: "custom",
label: "自定义"
},
]
\ No newline at end of file
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