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

记工时接口调试

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