Commit 91bfbc5f authored by Facius's avatar Facius

feat: 薪资设置

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