Commit 91bfbc5f authored by Facius's avatar Facius

feat: 薪资设置

parent b34a62cb
Pipeline #3554 canceled with stages
...@@ -72,7 +72,6 @@ export default { ...@@ -72,7 +72,6 @@ export default {
this.$emit('update:visible', false) this.$emit('update:visible', false)
}, },
handleChange (key, value) { handleChange (key, value) {
this.form[key] = value
this.$emit('change', key, value) this.$emit('change', key, value)
}, },
handleClickSure () { handleClickSure () {
......
...@@ -136,7 +136,6 @@ export default { ...@@ -136,7 +136,6 @@ export default {
}, },
methods: { methods: {
handleChange (key, value) { handleChange (key, value) {
this.form[key] = value
this.$emit('change', key, value) this.$emit('change', key, value)
}, },
handleSelectType (type) { handleSelectType (type) {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<view class="part-view" hover-class="u-hover-class" @click="$u.throttle(handleClicSalary, 500)"> <view class="part-view" hover-class="u-hover-class" @click="$u.throttle(handleClicSalary, 500)">
<view class="label-view">点工工资</view> <view class="label-view">点工工资</view>
<view class="value-view"> <view class="value-view">
<view v-if="salary">已设置</view> <view v-if="salary.id">已设置</view>
<view v-else class="no-info">未设置</view> <view v-else class="no-info">未设置</view>
<u-icon class="icon-view" name="arrow-right" color="#CCCCCC" size="24"></u-icon> <u-icon class="icon-view" name="arrow-right" color="#CCCCCC" size="24"></u-icon>
</view> </view>
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<view class="loading-view" v-if="loading"> <view class="loading-view" v-if="loading">
<u-loading mode="flower"></u-loading> <u-loading mode="flower"></u-loading>
</view> </view>
<PopWageSetting :form="salary" :visible.sync="visible" @change="handleChange" @sure="handleClickSure" /> <PopWageSetting :form="salary" :visible.sync="visible" @change="handleChange" @sure="handleClickSure" />
<PopNormal :visible.sync="visiblePop" :loadingShow="true" :title="currentPopInfo.title" <PopNormal :visible.sync="visiblePop" :loadingShow="true" :title="currentPopInfo.title"
:content="currentPopInfo.content" @confirm="handleClickConfirm" /> :content="currentPopInfo.content" @confirm="handleClickConfirm" />
<u-toast ref="uToast" /> <u-toast ref="uToast" />
...@@ -60,15 +60,17 @@ ...@@ -60,15 +60,17 @@
<script> <script>
import NavbarRight from '@/components/navbar-right' import NavbarRight from '@/components/navbar-right'
import PopNormal from '@/components/pop-normal'
import PopWageSetting from '@/pages/workpoint/employees/components/pop-wage-setting' import PopWageSetting from '@/pages/workpoint/employees/components/pop-wage-setting'
import { formatCount } from '@/utils/common.js'; import { formatCount } from '@/utils/common.js';
import { getProjectDetail, getProjectSalary, setProjectSalary, updateProject } from '@/api/project/index.js'; import { getProjectDetail, getProjectSalary, setProjectSalary, updateProject, deleteProject } from '@/api/project/index.js';
export default { export default {
components: { components: {
NavbarRight, NavbarRight,
PopWageSetting PopWageSetting,
PopNormal
}, },
data () { data () {
return { return {
...@@ -79,7 +81,16 @@ export default { ...@@ -79,7 +81,16 @@ export default {
memberCount: '', memberCount: '',
notSettleAmount: '', notSettleAmount: '',
}, },
salary: null, salary: {
id: '',
normalUnitHours: '',
normalUnitMoney: '',
overHoursMoney: '',
overType: 'UNIT',
overUnitHours: '',
overUnitMoney: '',
projectId: '',
},
loading: false, loading: false,
buttonLoading: false, buttonLoading: false,
visible: false, visible: false,
...@@ -216,14 +227,7 @@ export default { ...@@ -216,14 +227,7 @@ export default {
setProjectSalary(params) setProjectSalary(params)
.then(res => { .then(res => {
if (res.data) { if (res.data) {
uni.$emit('projects-changed') this.setSuccess()
this.$refs.uToast.show({
title: '设置成功',
type: 'success',
duration: 1500,
callback: () => {
}
});
} }
}) })
.catch(res => { .catch(res => {
...@@ -286,7 +290,7 @@ export default { ...@@ -286,7 +290,7 @@ export default {
}); });
uni.$once('input-sure-project-create', res => { uni.$once('input-sure-project-create', res => {
this.form.name = res.content this.form.name = res.content
this.updateProject({...this.form}) this.updateProject({ ...this.form })
}); });
}, },
updateProject (params) { updateProject (params) {
...@@ -304,16 +308,17 @@ export default { ...@@ -304,16 +308,17 @@ export default {
}); });
}, },
setSuccess() { setSuccess () {
this.reloadList()
uni.$emit('projects-changed')
this.$refs.uToast.show({ this.$refs.uToast.show({
title: '设置成功', title: '设置成功',
type: 'success', type: 'success',
duration: 1500, duration: 1500,
callback: () => { callback: () => {
this.reloadList()
uni.$emit('projects-changed') }
} });
});
}, },
handleClicSalary () { handleClicSalary () {
this.visible = true this.visible = true
...@@ -339,16 +344,16 @@ export default { ...@@ -339,16 +344,16 @@ export default {
handleClickSure (form) { handleClickSure (form) {
this.setProjectSalary(form) this.setProjectSalary(form)
}, },
handleChange(key, value) { handleChange (key, value) {
this.salary[key] = value this.salary[key] = value
}, },
handleClickDelete () { handleClickDelete () {
this.currentPopInfo = this.popInfos[0] this.currentPopInfo = this.popInfos[0]
this.visible = true this.visiblePop = true
}, },
handleClickSetting () { handleClickSetting () {
this.currentPopInfo = this.popInfos[1] this.currentPopInfo = this.popInfos[1]
this.visible = true this.visiblePop = true
}, },
handleClickConfirm () { handleClickConfirm () {
switch (this.currentPopInfo.action) { switch (this.currentPopInfo.action) {
......
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