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

记工时接口调试

parent 4187c176
......@@ -3,7 +3,7 @@
<u-popup v-model="show" border-radius="24" safe-area-inset-bottom mode="bottom" :duration="100">
<view class="mid-popup">
<u-row gutter="16">
<u-col span="4" v-for="(item, index) in list" :key="index">
<u-col span="3" v-for="(item, index) in list" :key="index">
<view class="button-view" @click="clickItem(item)">
<view class="button-view-icon"><image :src="indexBaseUrl+item.icon" mode="" v-if="item.icon"></image></view>
<view class="button-view-content">{{ item.label }}</view>
......@@ -91,18 +91,18 @@ export default {
justify-content: center;
align-items: center;
position: relative;
margin-right: 96upx;
margin-right: 64upx;
&:last-child {
margin-right: 0;
}
&-icon {
width: 144upx;
height: 144upx;
width: 120upx;
height: 120upx;
// display: flex;
}
&-content {
margin-top: 32upx;
font-size: 32upx;
font-size: 28upx;
line-height: 32upx;
}
}
......
......@@ -16,7 +16,7 @@
@input="handleInput"
/>
<view v-if="!disabled" class="tip-view">{{ tipText }}</view>
<bottom-buttons cancelText='删除' :showCancel="id?true:false" @cancel="handleDelete" @confirm="handleClick"></bottom-buttons>
<bottom-buttons cancelText="删除" :showCancel="id ? true : false" @cancel="handleDelete" @confirm="handleClick"></bottom-buttons>
<!-- <view class="bottom-view">
<u-button :customStyle="buttonStyle" @click="handleClick"><view class="button-text">确定</view></u-button>
<u-button :customStyle="deleteStyle" @click="handleDelete" v-if="id"><view class="button-text delete-button">删除</view></u-button>
......@@ -157,7 +157,17 @@ export default {
placeholder: '添加备注信息(200个字以内)',
maxlength: 200,
height: 240,
empty:true
empty: true
};
case 'workpoint-create-remark':
return {
title: '备注信息',
type: 'textarea',
placeholder: '添加备注信息(200个字以内)',
maxlength: 200,
height: 240,
empty: true
};
}
}
......@@ -198,15 +208,15 @@ export default {
},
handleClick() {
if (!this.disabled) {
if(!this.info.empty){
if (!this.info.empty) {
if (!this.value.trim()) {
this.$u.toast('内容不能为空');
return false;
}
}
let notification = `input-sure-${this.type}`;
let str = this.value
if(this.info.type!=='textarea'){
let str = this.value;
if (this.info.type !== 'textarea') {
str = str.replace(/[\r\n]/g, '');
}
uni.$emit(notification, {
......
<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" :class="{ 'bill-tabs-active': item.value === current }" v-for="(item, index) in list" :key="index" @click="change(item)">
<view class="bill-tabs-item-label">{{ item.label }}</view>
<view class="bill-tabs-item-line" v-if="item.value === current"></view>
</view>
......@@ -24,8 +24,8 @@ export default {
};
},
methods: {
change(index) {
this.$emit('change', index);
change(item) {
this.$emit('change', item);
}
}
};
......
......@@ -276,7 +276,8 @@ export default {
},
tabChange(index) {
this.tabCurrent = index;
this.tabCurrent = item.value;
this.form.type=item.type
},
checkAllUser() {
let flag = this.checkedAll ? false : true;
......@@ -287,7 +288,7 @@ export default {
},
toSetting() {
uni.navigateTo({
url: '/pages/mine/payments-setting/payments-setting'
url: '/pages/mine/employees/index'
});
uni.$on(this.notification, res => {
this.getBillTypeOptions();
......
<template>
<view class="debit-detail" @click="toBill">
<view class="content">
<view class="content-item">
<text class="content-item-label">客户名称:</text>
<text class="content-item-value">{{detail.customerName}}</text>
<view class="content-icon">
<text>{{resetName(detail.name)}}</text>
</view>
<view class="content-item">
<text class="content-item-label">联系电话:</text>
<text class="content-item-value">{{detail.customerPhone}}</text>
</view>
<view class="line">
<view class="content-item-label">{{detail.name}}</view>
<view class="content-item-value">{{detail.createTime}}</view>
</view>
</view>
<view class="debit-detail-right">
<view class="debt" v-if="current===0||showDebtAmount">
<view class="content-item debt-status">{{showDebtAmount?'欠款':'未结清'}}</view>
<view class="content-item debt-money">
<text>¥</text>
<text>{{ detail.debtAmount }}</text>
</view>
</view>
<view class="finish" v-else>账单已结清</view>
<view class="debit-detail-right-label">{{detail.name}}</view>
<view class="debit-detail-right-value" :class="{red:detail.createTime}">{{detail.createTime}}</view>
</view>
</view>
</template>
......@@ -51,22 +41,19 @@ export default {
return {};
},
methods:{
resetName(name) {
return name.slice(-2);
},
toBill(){
this.$u.route({
url: '/pages/maintain-bill/index',
type: 'navigateTo',
params: {
customerId:this.detail.customerId,
onlyDebt:1,
}
});
// this.$Router.push({
// path:"/pages/maintain-bill/index",
// query:{
// this.$u.route({
// url: '/pages/maintain-bill/index',
// type: 'navigateTo',
// params: {
// customerId:this.detail.customerId,
// onlyDebt:1,
// }
// })
// });
}
}
};
......@@ -80,11 +67,24 @@ export default {
padding: 24upx;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 24upx;
.content {
width: 420upx;
position: relative;
overflow: hidden;
display: flex;
align-items: center;
&-icon{
width: 72rpx;
height: 72rpx;
background-color: #02a074;
border-radius: 16rpx;
display: flex;
justify-content: center;
align-items: center;
color: #ffffff;
font-size: 26rpx;
margin-right: 24rpx;
}
&-item {
font-size: 28upx;
line-height: 28upx;
......@@ -92,24 +92,14 @@ export default {
margin-bottom: 32upx;
}
&-label {
color: #8D8D8D;
font-weight: bold;
}
&-value {
font-weight: bold;
color: #8D8D8D;
}
}
.line{
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
width: 2upx;
height: 80upx;
background: #F6F7FA;
}
}
&-right {
flex: 1;
.finish {
display: flex;
align-items: center;
......
<template>
<div>
</div>
</template>
<script>
export default {
}
</script>
<style scoped>
</style>
\ No newline at end of file
......@@ -6,16 +6,16 @@
<u-form-item label="项目名称" prop="templateName" required>
<view class="right-view">
<view class="placeholder" @click="openSelect">
<text class="value-text" v-if="form.templateName">{{ form.templateName }}</text>
<text class="value-text" v-if="form.projectName">{{ form.projectName }}</text>
<text v-else>选择项目</text>
<u-icon name="arrow-right" class="arrow"></u-icon>
</view>
</view>
</u-form-item>
<u-form-item label="日期" prop="dayTime" required>
<u-form-item label="日期" prop="happenTime" required>
<view class="right-view">
<view class="date-view" hover-class="u-hover-class" @click="handleClickShowDateRange">
<view class="date-text" v-if="form.dayTime">{{ resetHappenTime(form.dayTime) }}</view>
<view class="date-text" v-if="form.happenTime">{{ resetHappenTime(form.happenTime) }}</view>
<view class="placeholder" v-else>选择服务日期</view>
<view class="image-view"><image :src="dateImage"></image></view>
</view>
......@@ -38,13 +38,13 @@
<u-form-item label="上班" prop="work" label-position="top" required>
<view class="">
<checkbox-groups
:checked="form.work"
:checked="form.normal"
:customStyle="checkboxCustomStyle"
:options="workTypeOptions"
@handleClick="workTypeChange"
></checkbox-groups>
<view class="custom" v-if="form.work==='custom'">
<view class="custom-label">
<view class="custom" v-if="form.normal==='custom'">
<view class="custom-label" @click="changeUnit('normalType')">
<text>按工量</text>
<view class="custom-label-icon">
<image :src="customSwitchIcon" mode=""></image>
......@@ -53,7 +53,7 @@
<view class="custom-value">
<u-input
type="digit"
v-model="form.workNumber"
v-model="form.normalNumber"
placeholder="填写数量"
:clearable="false"
input-align="right"
......@@ -61,7 +61,7 @@
cursor-spacing="50"
:custom-style="customStyle"
/>
<text class="custom-value-unit">个工</text>
<text class="custom-value-unit">{{form.normalType==='HOURS'?'小时':'个工'}}</text>
</view>
</view>
</view>
......@@ -69,13 +69,13 @@
<u-form-item label="加班" prop="overtime" label-position="top" required>
<view class="">
<checkbox-groups
:checked="form.overtime"
:checked="form.over"
:customStyle="checkboxCustomStyle"
:options="overtimeTypeOptions"
@handleClick="overtimeTypeChange"
></checkbox-groups>
<view class="custom" v-if="form.overtime==='custom'">
<view class="custom-label">
<view class="custom" v-if="form.over==='custom'">
<view class="custom-label" @click="changeUnit('overType')">
<text>按小时</text>
<view class="custom-label-icon">
<image :src="customSwitchIcon" mode=""></image>
......@@ -84,7 +84,7 @@
<view class="custom-value">
<u-input
type="digit"
v-model="form.overtimeNumber"
v-model="form.overNumber"
placeholder="填写数量"
:clearable="false"
input-align="right"
......@@ -92,7 +92,7 @@
cursor-spacing="50"
:custom-style="customStyle"
/>
<text class="custom-value-unit">小时</text>
<text class="custom-value-unit">{{form.overType==='HOURS'?'小时':'个工'}}</text>
</view>
</view>
</view>
......@@ -256,21 +256,26 @@ export default {
uploading: false,
classificationList: [],
form: {
work: '100',
overtime: 'null',
unit: '',
templateName: '',
customerPhone: '',
receivableAmount: '',
actualAmount: '0',
userIds: ['self'],
address: '',
latitude: '',
longitude: '',
remark: '',
attach: [],
type: '', // 收据样式
expenseDetails: [] // 服务明细
projectId:'',
projectName:'',
happenTime:'',
memberIds:[],
remark:'',
type:'TIME', // 类型 TIME:记工-点工;CONTRACTOR:记工-包工;BORROWING:借支;SETTLE:结算
// 点工
normal:'',
normalNumber:'',
normalType:'UNIT',
over:'',
overNumber:'',
overType:'UNIT',
// 包工
number:'',
unit:'',
unitPrice:'',
// 借支/结算
amount:''
},
showDatePicker: false,
buttonLoading: false,
......@@ -346,7 +351,9 @@ export default {
checked: false
}
],
tabCurrent: 1
tabCurrent: 1,
notification:'workpoint-create-remark',
};
},
computed: {
......@@ -363,7 +370,7 @@ export default {
};
},
checkedAll() {
return this.form.userIds.length === this.billingCategoryLength;
return this.form.memberIds.length === this.billingCategoryLength;
}
},
onLoad(options) {
......@@ -385,7 +392,7 @@ export default {
},
onUnload() {
uni.$off('maintain-bill-detail');
uni.$off('maintain-bill-choose-remark');
uni.$off(this.notification);
},
onShow() {
this.getBillTypeOptions();
......@@ -409,25 +416,29 @@ export default {
chooseUnit() {
this.$refs['unit-popup'].open();
},
changeUnit(type){
this.form[type]=this.form[type]&&this.form[type]==='UNIT'?'HOURS':'UNIT'
},
workTypeChange(item) {
this.form.work = item.value;
this.form.normal = item.value;
},
overtimeTypeChange(item) {
this.form.overtime = item.value;
this.form.over = item.value;
},
tabChange(index) {
this.tabCurrent = index;
tabChange(item) {
this.tabCurrent = item.value;
this.form.type=item.type
},
checkAllUser() {
let flag = this.checkedAll ? false : true;
this.$refs['billing-category'].checkAll(flag);
},
billingCategoryChange(ids) {
this.form.userIds = ids;
this.form.memberIds = ids;
},
toSetting() {
uni.navigateTo({
url: '/pages/workpoint/member/member'
url: '/pages/workpoint/employees/index'
});
uni.$on(this.notification, res => {
this.getBillTypeOptions();
......@@ -454,10 +465,10 @@ export default {
}
},
setCheckedList() {
if (this.form.userIds && this.form.userIds.length) {
if (this.form.memberIds && this.form.memberIds.length) {
this.billingCategoryList.map(item => {
item.map(li => {
this.form.userIds.map(el => {
this.form.memberIds.map(el => {
if (li.id === el) {
li.checked = true;
}
......@@ -473,6 +484,19 @@ export default {
}
return newArray;
},
editRemark(){
uni.$on(`input-sure-${this.notification}`, res => {
console.log(res)
this.form.remark = res.content;
});
this.$u.route({
url: '/pages/mine/input/input',
params: {
type: this.notification,
value: encodeURIComponent(this.form.remark)
}
});
},
repairDetail() {
this.loading = true;
repairDetail({
......@@ -603,7 +627,7 @@ export default {
// 日历
calendarChange(e) {
console.log('calendarChange', e);
this.form.dayTime = e;
this.form.happenTime = e;
},
resetHappenTime(time) {
return this.parseTime(time, '{y}-{m}-{d}');
......@@ -635,6 +659,7 @@ export default {
padding: 0 24rpx;
padding-bottom: 144rpx;
.placeholder {
font-weight: bold;
color: #cccccc;
}
.value-text {
......
import {
indexBaseUrl
} from "@/utils/config.js"
export const minPopupOptions = [{
export const minPopupOptions = [
{
label: '记工时',
path: '/pages/workpoint/project/index',
icon: 'jigongshitanchu@3x.png',
type: '0',
},
{
label: '记行程',
path: '/pages/schedule/create-schedule/create-schedule',
icon: 'jixingcheng@3x.png',
......
export const tabOptions = [{
value: 1,
type: 'TIME',
label: "点工"
},
{
value: 2,
type: 'CONTRACTOR',
label: "包工/计量"
},
]
export const loanTabOptions = [{
value: 1,
type: 'BORROWING',
label: "借支"
},
{
value: 2,
type: 'SETTLE',
label: "结算"
},
]
export const workTypeOptions = [{
value: "100",
value: 1,
label: "一个工"
},
{
value: "50",
value: 0.5,
label: "半个工"
},
{
......@@ -49,7 +53,7 @@ export const projectBillPages = [{
loadStatus: 'loadmore',
freshing: false,
triggered: false,
},{
}, {
pageNumber: 0,
size: 10,
loaded: false,
......@@ -78,7 +82,7 @@ export const projectBillPages = [{
export const projectBillTabs = [{
title: '全部',
name: ''
},{
}, {
title: '记工',
name: true
},
......@@ -90,4 +94,4 @@ export const projectBillTabs = [{
title: '结算',
name: false
},
]
\ 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