Commit db95db03 authored by 刘文虎's avatar 刘文虎
parents c29a3458 617203a2
Pipeline #3550 canceled with stages
...@@ -10,7 +10,7 @@ export async function deleteProject(data) { ...@@ -10,7 +10,7 @@ export async function deleteProject(data) {
}) })
} }
// 新增、更新项目 // 恢复项目
export async function recoveryProject(data) { export async function recoveryProject(data) {
return request({ return request({
url: `/rest/project/recovery`, url: `/rest/project/recovery`,
...@@ -21,7 +21,7 @@ export async function recoveryProject(data) { ...@@ -21,7 +21,7 @@ export async function recoveryProject(data) {
} }
// 新增、更新项目 // 新增、更新项目
export async function editProject(data) { export async function updateProject(data) {
return request({ return request({
url: `/rest/project/save`, url: `/rest/project/save`,
method: 'POST', method: 'POST',
...@@ -41,4 +41,43 @@ export async function getProjectList(data) { ...@@ -41,4 +41,43 @@ export async function getProjectList(data) {
}) })
} }
// 项目详情
export async function getProjectDetail(data) {
return request({
url: `/rest/project/detail`,
method: 'GET',
data,
noLoading: true
})
}
// 项目详情
export async function getProjectSalary(data) {
return request({
url: `/rest/project/salary`,
method: 'GET',
data,
noLoading: true
})
}
// 项目薪水设置
export async function setProjectSalary(data) {
return request({
url: `/rest/project/salarySet`,
method: 'POST',
data,
noLoading: true
})
}
// 结清项目
export async function settleProject(data) {
return request({
url: `/rest/project/settle`,
method: 'POST',
data,
noLoading: true
})
}
\ No newline at end of file
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
</u-button> </u-button>
</view> </view>
<view class="right-view"> <view class="right-view">
<u-button :custom-style="customConFirm" @click="handleClickConfirm"> <u-button :loading="loading" :custom-style="customConFirm" @click="handleClickConfirm">
<view class="confirm-view">{{ confirmText }}</view> <view class="confirm-view">{{ confirmText }}</view>
</u-button> </u-button>
</view> </view>
...@@ -116,6 +116,10 @@ export default { ...@@ -116,6 +116,10 @@ export default {
type: String, type: String,
default: 'normal', default: 'normal',
}, },
loadingShow: {
type: Boolean,
default: false
}
}, },
data() { data() {
return { return {
...@@ -126,6 +130,7 @@ export default { ...@@ -126,6 +130,7 @@ export default {
watch: { watch: {
visible(val) { visible(val) {
this.show = val this.show = val
this.loading = false
if (val) { if (val) {
this.select = false this.select = false
} }
...@@ -171,6 +176,7 @@ export default { ...@@ -171,6 +176,7 @@ export default {
this.$emit('update:visible', val) this.$emit('update:visible', val)
}, },
handleClickConfirm() { handleClickConfirm() {
this.loading = this.loadingShow
this.changeVisibleValue(false) this.changeVisibleValue(false)
this.$emit('confirm', this.select) this.$emit('confirm', this.select)
if (this.isShare || this.isRenew) { if (this.isShare || this.isRenew) {
......
...@@ -200,6 +200,10 @@ export default { ...@@ -200,6 +200,10 @@ export default {
this.whiteSpace = options.whiteSpace; this.whiteSpace = options.whiteSpace;
this.inputStyle.whiteSpace = 'pre-wrap'; this.inputStyle.whiteSpace = 'pre-wrap';
} }
setTimeout(() => {
console.log('----disabled----------', this.disabled)
}, 3000);
}, },
onUnload() { onUnload() {
let notification = `input-sure-${this.type}`; let notification = `input-sure-${this.type}`;
......
<template> <template>
<u-popup v-model="show" safe-area-inset-bottom mode="bottom" width="100%" border-radius="16" :closeable="false" @close="handleClose"> <u-popup v-model="show" safe-area-inset-bottom mode="bottom" width="100%" border-radius="16" :closeable="false" @close="handleClose">
<view class="ppop-cwage-setting"> <view class="ppop-cwage-setting">
<WageSetting type="pop" :form="form" @close="handleClose" @change="handleChange" /> <WageSetting type="pop" :form="form" @close="handleClose" :fill.sync="canConfirm" @change="handleChange" />
<view class="bottom-view"> <view class="bottom-view">
<u-button :custom-style="customConFirm" @click="handleClickSure" :loading="buttonLoading"> <u-button :custom-style="customConFirm" @click="handleClickSure" :loading="buttonLoading">
<view class="confirm-view">确定</view> <view class="confirm-view">确定</view>
...@@ -24,18 +24,27 @@ export default { ...@@ -24,18 +24,27 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
form: {
type: Object,
default() {
return {
id : '',
normalUnitHours : '',
normalUnitMoney : '',
overHoursMoney : '',
overType : 'UNIT', // UNIT:按工时;HOURS:按小时
overUnitHours : '',
overUnitMoney : '',
projectId : '',
}
}
}
}, },
data () { data () {
return { return {
form: {
hour: '',
unit: '',
type: 'day', // day;hour
overHour: '',
overUnit: '',
},
buttonLoading: false, buttonLoading: false,
show: false, show: false,
canConfirm: false
} }
}, },
computed: { computed: {
...@@ -48,21 +57,16 @@ export default { ...@@ -48,21 +57,16 @@ export default {
width: '686rpx', width: '686rpx',
} }
}, },
canConfirm () {
for (var item in this.form) {
if (this.form[item] == '' || this.form[item] == null) {
return false
}
}
return true
},
}, },
watch: { watch: {
visible(val) { visible(val) {
this.show = val this.show = val
this.buttonLoading = false
console.log('-----created---0--', this.form)
},
}, },
created () {
}, },
created () { },
methods: { methods: {
handleClose () { handleClose () {
this.show = false this.show = false
...@@ -70,10 +74,13 @@ export default { ...@@ -70,10 +74,13 @@ export default {
}, },
handleChange (key, value) { handleChange (key, value) {
this.form[key] = value this.form[key] = value
console.log('---handleChange----0---', key, value)
this.$emit('change', key, value)
}, },
handleClickSure () { handleClickSure () {
this.buttonLoading = true this.buttonLoading = true
this.$emit('sure', this.form) this.$emit('sure', {...this.form})
this.handleClose()
} }
}, },
} }
......
...@@ -10,12 +10,12 @@ ...@@ -10,12 +10,12 @@
<view class="value-view"> <view class="value-view">
<view class="input-view"> <view class="input-view">
<u-input type="digit" :clearable="false" :custom-style="customStyle" :placeholder-style="placeholderStyle" <u-input type="digit" :clearable="false" :custom-style="customStyle" :placeholder-style="placeholderStyle"
v-model="form.hour" placeholder="输入数值" @input="handleInput($event, 'hour')" /> v-model="form.normalUnitHours" placeholder="输入数值" @input="handleInput($event, 'normalUnitHours')" />
</view> </view>
<view>小时 =</view> <view>小时 =</view>
<view class="input-view"> <view class="input-view">
<u-input type="digit" :clearable="false" :custom-style="customStyle" :placeholder-style="placeholderStyle" <u-input type="digit" :clearable="false" :custom-style="customStyle" :placeholder-style="placeholderStyle"
v-model="form.unit" placeholder="输入金额" @input="handleInput($event, 'unit')" /> v-model="form.normalUnitMoney" placeholder="输入金额" @input="handleInput($event, 'normalUnitMoney')" />
</view> </view>
<view>元 = 1个工</view> <view>元 = 1个工</view>
</view> </view>
...@@ -24,29 +24,30 @@ ...@@ -24,29 +24,30 @@
<view :class="['part-view', 'type']"> <view :class="['part-view', 'type']">
<view class="label-view">加班类型</view> <view class="label-view">加班类型</view>
<view class="value-view"> <view class="value-view">
<view v-for="(item, index) in labels" :key="index" :class="['type-view', {selected: item.type == form.type}]" <view v-for="(item, index) in labels" :key="index"
class="select-view" hover-class="u-hover-class" @click="handleSelectType(item.type)">{{item.name}}</view> :class="['type-view', {selected: item.type == form.overType}]" class="select-view"
hover-class="u-hover-class" @click="handleSelectType(item.type)">{{item.name}}</view>
</view> </view>
</view> </view>
<view class="line-view"></view> <view class="line-view"></view>
<view class="part-view"> <view class="part-view">
<view class="label-view">加班</view> <view class="label-view">加班</view>
<view class="value-view" v-if="form.type == 'day'"> <view class="value-view" v-if="form.overType == 'UNIT'">
<view class="input-view"> <view class="input-view">
<u-input type="digit" :clearable="false" :custom-style="customStyle" :placeholder-style="placeholderStyle" <u-input type="digit" :clearable="false" :custom-style="customStyle" :placeholder-style="placeholderStyle"
v-model="form.overHour" placeholder="输入数值" @input="handleInput($event, 'overHour')" /> v-model="form.overUnitHours" placeholder="输入数值" @input="handleInput($event, 'overUnitHours')" />
</view> </view>
<view>小时 =</view> <view>小时 =</view>
<view class="input-view"> <view class="input-view">
<u-input type="digit" :clearable="false" :custom-style="customStyle" :placeholder-style="placeholderStyle" <u-input type="digit" :clearable="false" :custom-style="customStyle" :placeholder-style="placeholderStyle"
v-model="form.overUnit" placeholder="输入金额" @input="handleInput($event, 'overUnit')" /> v-model="form.overUnitMoney" placeholder="输入金额" @input="handleInput($event, 'overUnitMoney')" />
</view> </view>
<view>元 = 1个工</view> <view>元 = 1个工</view>
</view> </view>
<view class="value-view" v-else> <view class="value-view" v-else>
<view class="input-view"> <view class="input-view">
<u-input type="digit" :clearable="false" :custom-style="customStyle" :placeholder-style="placeholderStyle" <u-input type="digit" :clearable="false" :custom-style="customStyle" :placeholder-style="placeholderStyle"
v-model="form.overUnit" placeholder="输入金额" @input="handleInput($event, 'overUnit')" /> v-model="form.overHoursMoney" placeholder="输入金额" @input="handleInput($event, 'overHoursMoney')" />
</view> </view>
<view>元/小时</view> <view>元/小时</view>
</view> </view>
...@@ -64,11 +65,14 @@ export default { ...@@ -64,11 +65,14 @@ export default {
type: Object, type: Object,
default () { default () {
return { return {
hour: '', id: '',
unit: '', normalUnitHours: '',
type: 'day', // day;hour normalUnitMoney: '',
overHour: '', overHoursMoney: '',
overUnit: '', overType: 'UNIT', // UNIT:按工时;HOURS:按小时
overUnitHours: '',
overUnitMoney: '',
projectId: '',
} }
}, },
}, },
...@@ -101,27 +105,50 @@ export default { ...@@ -101,27 +105,50 @@ export default {
labels () { labels () {
return [{ return [{
name: '按工天算', name: '按工天算',
type: 'day' type: 'UNIT'
}, { }, {
name: '按小时算', name: '按小时算',
type: 'hour' type: 'HOURS'
}] }]
}, },
checkKeys () {
return this.form && this.form.overType == 'HOURS' ? [
'normalUnitHours',
'normalUnitMoney',
'overHoursMoney',
'overType'] : [
'normalUnitHours',
'normalUnitMoney',
'overType',
'overUnitHours',
'overUnitMoney']
}
},
created () {
}, },
created () { },
methods: { methods: {
handleChange (key, value) { handleChange (key, value) {
this.form[key] = value
this.$emit('update:fill', this.checkForm())
this.$emit('change', key, value) this.$emit('change', key, value)
}, },
handleSelectType (type) { handleSelectType (type) {
this.handleChange('type', type) console.log('-------', type)
this.handleChange('overType', type)
}, },
handleInput (value, key) { handleInput (value, key) {
this.handleChange(key, value) this.handleChange(key, value)
}, },
handleClose () { handleClose () {
console.log('---handleClose-----')
this.$emit('close') this.$emit('close')
},
checkForm () {
for (var item of this.checkKeys) {
if (this.form[item] == '' || this.form[item] == null) {
return false
}
}
return true
} }
}, },
} }
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<view class="label-view">姓名</view> <view class="label-view">姓名</view>
<view class="value-view"> <view class="value-view">
<u-input type="text" :clearable="false" :custom-style="customStyle" :placeholder-style="placeholderStyle" <u-input type="text" :clearable="false" :custom-style="customStyle" :placeholder-style="placeholderStyle"
v-model="form.name" placeholder="填写成员姓名" /> v-model="form.memberName" placeholder="填写成员姓名" />
</view> </view>
</view> </view>
<view class="line-view"></view> <view class="line-view"></view>
...@@ -15,15 +15,15 @@ ...@@ -15,15 +15,15 @@
<view class="label-view">手机号码</view> <view class="label-view">手机号码</view>
<view class="value-view"> <view class="value-view">
<u-input maxlength="11" type="number" :clearable="false" :custom-style="customStyle" <u-input maxlength="11" type="number" :clearable="false" :custom-style="customStyle"
:placeholder-style="placeholderStyle" v-model="form.phone" placeholder="填写手机号码" /> :placeholder-style="placeholderStyle" v-model="form.memberMobile" placeholder="填写手机号码" />
</view> </view>
</view> </view>
</view> </view>
<WageSetting :form="form" @change="handleChange"/> <WageSetting :form="form" :fill.sync="canConfirm" @change="handleChange"/>
</view> </view>
<view :class="['bottom-view', {edit: memberId}]"> <view :class="['bottom-view', {edit: memberId}]">
<u-button v-if="memberId" :custom-style="customDelete" @click="handleClickDelete" class="delete-button"> <u-button v-if="memberId" :custom-style="customDelete" @click="handleClickDelete" class="delete-button">
<view class="delete-view">修改</view> <view class="delete-view">删除</view>
</u-button> </u-button>
<u-button :custom-style="customConFirm" @click="handleClickConFirm" :loading="buttonLoading"> <u-button :custom-style="customConFirm" @click="handleClickConFirm" :loading="buttonLoading">
<view class="confirm-view">保存</view> <view class="confirm-view">保存</view>
...@@ -50,17 +50,20 @@ export default { ...@@ -50,17 +50,20 @@ export default {
data () { data () {
return { return {
memberId: '', memberId: '',
projectId: '',
form: { form: {
name: '', memberName: '',
phone: '', memberMobile: '',
hour: '', normalUnitHours : '',
unit: '', normalUnitMoney : '',
type: '', // day;hour overHoursMoney : '',
overHour: '', overType : 'UNIT', // UNIT:按工时;HOURS:按小时
overUnit: '', overUnitHours : '',
overUnitMoney : '',
}, },
loading: false, loading: false,
buttonLoading: false, buttonLoading: false,
canConfirm: false,
} }
}, },
computed: { computed: {
...@@ -97,21 +100,12 @@ export default { ...@@ -97,21 +100,12 @@ export default {
'border-radius': '16rpx', 'border-radius': '16rpx',
width: this.memberId ? '470rpx' : '686rpx', width: this.memberId ? '470rpx' : '686rpx',
} }
},
canConfirm () {
for (var item in this.form) {
if (this.form.type == 'hour' && item == 'overHour') {
continue
}
if (this.form[item] == '' || this.form[item] == null) {
return false
}
} }
return true
},
}, },
onLoad (options) { onLoad (options) {
if (options && options.projectId) {
this.projectId = options.projectId
}
if (options && options.memberId) { if (options && options.memberId) {
this.memberId = options.memberId this.memberId = options.memberId
this.loading = true this.loading = true
...@@ -142,18 +136,23 @@ export default { ...@@ -142,18 +136,23 @@ export default {
}, },
setForm(data) { setForm(data) {
this.form = { this.form = {
memberId: this.memberId, memberId: data.memberId,
name: '张三', projectId: data.projectId,
phone: '18766666666', memberName: data.memberName,
hour: '2', memberMobile: data.memberMobile,
unit: '3', normalUnitHours : data.normalUnitHours,
type: 'day', // day;hour normalUnitMoney : data.normalUnitMoney,
overHour: '4', overHoursMoney : data.overHoursMoney,
overUnit: '4', overType : data.overType,
overUnitHours : data.overUnitHours,
overUnitMoney : data.overUnitMoney,
}; };
}, },
handleChange(key, value) { handleChange(key, value) {
this.form[key] = value this.form[key] = value
},
handleClickDelete() {
} }
}, },
} }
......
...@@ -331,6 +331,7 @@ export default { ...@@ -331,6 +331,7 @@ export default {
duration: 1500, duration: 1500,
callback: () => { callback: () => {
uni.$emit('employees-changed', this.stringSelectedEmployees) uni.$emit('employees-changed', this.stringSelectedEmployees)
uni.$emit('project-detail')
this.$u.route({ this.$u.route({
type: 'navigateBack', type: 'navigateBack',
params: { params: {
......
...@@ -60,7 +60,7 @@ export default { ...@@ -60,7 +60,7 @@ export default {
return this.baseUrl + 'xiangmuguanliicon@3x.png' return this.baseUrl + 'xiangmuguanliicon@3x.png'
}, },
textInfo () { textInfo () {
return '¥' + formatCount(this.project.notSettleAmount || 0) return Number(this.project.notSettleAmount || 0) != 0 ? '¥ ' + formatCount(this.project.notSettleAmount || 0) : '¥ --'
}, },
paths () { paths () {
return { return {
......
<template> <template>
<view class="projects-view"> <view class="projects-view">
<NavbarRight v-if="isClosed" title="已结清" /> <NavbarRight v-if="isClosed" title="已结清" />
<NavbarRight v-else backTextBold backText="项目列表" text="已结清" :image="rightImage" @click="handlClickRight" /> <NavbarRight v-else backTextBold text="已结清" :image="rightImage"
:backText="platform == '4' ? '' : '项目列表'"
:title="platform == '4' ? '项目列表' : ''"
@click="handlClickRight" />
<view class="content-view"> <view class="content-view">
<scroll-view scroll-y style="height: 100%; width: 100%" @scrolltolower="reachBottom" scroll-anchoring <scroll-view scroll-y style="height: 100%; width: 100%" @scrolltolower="reachBottom" scroll-anchoring
refresher-enabled="true" :refresher-triggered="triggered" :refresher-threshold="100" refresher-enabled="true" :refresher-triggered="triggered" :refresher-threshold="100"
...@@ -27,7 +30,7 @@ ...@@ -27,7 +30,7 @@
<view class="loading-view" v-if="loading && !freshing"> <view class="loading-view" v-if="loading && !freshing">
<u-loading mode="flower"></u-loading> <u-loading mode="flower"></u-loading>
</view> </view>
<PopNormal :visible.sync="visible" :type="currentPopInfo.type" :title="currentPopInfo.title" <PopNormal :visible.sync="visible" :title="currentPopInfo.title"
:content="currentPopInfo.content" @confirm="handleClickConfirm" /> :content="currentPopInfo.content" @confirm="handleClickConfirm" />
<u-toast ref="uToast" /> <u-toast ref="uToast" />
</view> </view>
...@@ -38,10 +41,11 @@ import NavbarRight from '@/components/navbar-right'; ...@@ -38,10 +41,11 @@ import NavbarRight from '@/components/navbar-right';
import CellProject from './components/cell-project'; import CellProject from './components/cell-project';
import CellProjectClosed from './components/cell-project-closed'; import CellProjectClosed from './components/cell-project-closed';
import PopNormal from '@/components/pop-normal'; import PopNormal from '@/components/pop-normal';
import { mapGetters } from 'vuex';
import NoData from '@/components/no-data'; import NoData from '@/components/no-data';
import { getProjectList, deleteProject, editProject, recoveryProject } from '@/api/project/index.js'; import { getProjectList, deleteProject, updateProject, recoveryProject } from '@/api/project/index.js';
export default { export default {
components: { components: {
...@@ -66,6 +70,8 @@ export default { ...@@ -66,6 +70,8 @@ export default {
}; };
}, },
computed: { computed: {
...mapGetters(['platform']),
baseUrl () { baseUrl () {
return process.uniEnv.qn_base_url; return process.uniEnv.qn_base_url;
}, },
...@@ -75,6 +81,9 @@ export default { ...@@ -75,6 +81,9 @@ export default {
isClosed () { isClosed () {
return this.type == 'closed' return this.type == 'closed'
}, },
isNormal () {
return this.type == 'normal'
},
noData () { noData () {
return { return {
image: this.baseUrl + 'wuweixiuzhangdan@3x.png', image: this.baseUrl + 'wuweixiuzhangdan@3x.png',
...@@ -112,7 +121,7 @@ export default { ...@@ -112,7 +121,7 @@ export default {
this.type = options.type this.type = options.type
} }
if (this.isEdit) { if (this.isNormal) {
uni.$on('projects-changed', res => { uni.$on('projects-changed', res => {
this.reloadList(); this.reloadList();
}); });
...@@ -122,7 +131,7 @@ export default { ...@@ -122,7 +131,7 @@ export default {
this.reloadList(); this.reloadList();
}, },
onUnload () { onUnload () {
if (this.isEdit) { if (this.isNormal) {
uni.$off('projects-changed'); uni.$off('projects-changed');
} }
}, },
...@@ -142,48 +151,6 @@ export default { ...@@ -142,48 +151,6 @@ export default {
size: this.size, size: this.size,
}) })
.then(res => { .then(res => {
// var res = {
// data: {
// projects: [
// {
// id: '1',
// name: '张三子',
// money: '1000',
// time: '2022-02-03 11:11:11',
// },
// {
// id: '2',
// name: '李四',
// money: '2000',
// time: '2022-02-03 11:11:11',
// },
// {
// id: '3',
// name: '王五',
// money: '32000',
// time: '2022-02-03 11:11:11',
// },
// {
// id: '4',
// name: 'fdasfasf',
// money: '4000',
// time: '2022-02-03 11:11:11',
// },
// {
// id: '5',
// name: '成吉思汗',
// money: '5000',
// time: '2022-02-03 11:11:11',
// },
// {
// id: '6',
// name: '弗朗西斯科',
// money: '6000',
// time: '2022-02-03 11:11:11',
// }
// ]
// }
// }
let data = res.data; let data = res.data;
if (this.current == 1) { if (this.current == 1) {
this.projects = []; this.projects = [];
...@@ -242,7 +209,7 @@ export default { ...@@ -242,7 +209,7 @@ export default {
type: 'success', type: 'success',
duration: 1500, duration: 1500,
callback: () => { callback: () => {
uni.$emit('projects-changed', this.stringSelectedEmployees) uni.$emit('projects-changed')
this.reloadList() this.reloadList()
} }
}); });
...@@ -254,11 +221,11 @@ export default { ...@@ -254,11 +221,11 @@ export default {
}); });
}, },
editProject (params) { updateProject (params) {
editProject(params) updateProject(params)
.then(res => { .then(res => {
let data = res.data; let data = res.data;
console.log('------reditProject-------', data) console.log('------updateProject-------', data)
if (data) { if (data) {
this.$refs.uToast.show({ this.$refs.uToast.show({
title: '创建成功', title: '创建成功',
...@@ -293,19 +260,21 @@ export default { ...@@ -293,19 +260,21 @@ export default {
this.getProjectList(); this.getProjectList();
}, },
handleEditCell (employeeId) { handleClickAction (id, action) {
if (action == 'edit') {
this.$u.route({ this.$u.route({
url: '/pages/workpoint/projects/project-create', url: '/pages/workpoint/projects/project-edit',
type: 'navigateTo', type: 'navigateTo',
params: { params: {
memberId: employeeId projectId: id
} }
}); });
}, } else {
handleClickAction (id, action) {
this.currentPopInfo = this.popInfos[action] this.currentPopInfo = this.popInfos[action]
this.currentPopInfo.projectId = id this.currentPopInfo.projectId = id
this.visible = true this.visible = true
}
}, },
handleClickConfirm () { handleClickConfirm () {
switch (this.currentPopInfo.action) { switch (this.currentPopInfo.action) {
...@@ -336,7 +305,7 @@ export default { ...@@ -336,7 +305,7 @@ export default {
}); });
uni.$once('input-sure-project-create', res => { uni.$once('input-sure-project-create', res => {
console.log(res) console.log(res)
this.editProject({ this.updateProject({
name: res.content name: res.content
}) })
}); });
......
This diff is collapsed.
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