Commit e7f430aa authored by menglingjun's avatar menglingjun

feat: 添加统计字段操作

parent 7086b316
......@@ -24,4 +24,11 @@ export function saveUserWages(parameter) {
useFullLoading: true
})
}
export function updateStatus(id) {
return axios({
url: api.ztUserUrl+"statistics/status/"+id,
method: 'get',
useFullLoading: true
})
}
......@@ -59,7 +59,10 @@
<a-button size="small" style="margin-right: 20px" @click="changeStatus(record,index)" v-if="!record.disabled"><span style="font-size: 8px">编辑</span></a-button>
<a-button size="small" style="margin-right: 20px" @click="changeStatus(record,index)" v-if="record.disabled"><span style="font-size: 8px">取消</span></a-button>
<a-button type="primary" v-if="record.disabled" @click="saveOne(index)" size="small"><span style="font-size: 8px">保存</span></a-button>
</span>
<span slot="statisticsStatus" slot-scope="text,record,index">
<!-- <a-button size="small" style="margin-right: 20px" @click="changeStatisticsStatus(record)"><span style="font-size: 8px">{{text==0?"否":"是"}}</span></a-button>-->
<a-switch checked-children="是" un-checked-children="否" :checked="text ===1" @click="changeStatisticsStatus(record,index)" default-checked />
</span>
<span slot="wages" slot-scope="text, record,index" :key="record.id">
<a-input-number
......@@ -80,7 +83,7 @@
</template>
<script>
import {getWagesPage,saveUserWages} from "@/api/personnel/wages";
import {getWagesPage,saveUserWages,updateStatus} from "@/api/personnel/wages";
import {humpToLine, setOrder} from "@/util/util";
const dataSource = []
......@@ -88,6 +91,7 @@ const columns = [
{title: '账号', width: 160, dataIndex: 'account', align: 'center'},
{title: '邮箱', width: 200, dataIndex: 'email', align: 'center'},
{title: '真实姓名', width: 120, dataIndex: 'realname', align: 'center'},
{title: '是否统计', width: 120, dataIndex: 'statisticsStatus', align: 'center',scopedSlots: {customRender: 'statisticsStatus'}},
{title: '工资', dataIndex: 'wages', align: 'right', scopedSlots: {customRender: 'wages'}},
{title: '操作', key: 'operation', width: 150, scopedSlots: {customRender: 'action'}, align: 'center'}
]
......@@ -143,13 +147,11 @@ export default {
if (pageSize && !isNaN(pageSize)) {
this.query.size = pageSize
}
this.loading = true;
getWagesPage(this.query).then(res => {
if (res && res.code == SYS_CONST.REQUEST.SUCCEED) {
let respData = res.data
this.dataSource = respData.list;
this.total = respData.total;
console.log(this.total)
this.total = respData.total
}
this.loading = false;
......@@ -175,6 +177,16 @@ export default {
this.dataSource = a;
}
},
changeStatisticsStatus(record,index){
updateStatus(record.id).then(response =>{
if (response&&response.code == SYS_CONST.REQUEST.SUCCEED){
let a = [...this.dataSource]
a[index].statisticsStatus = response.data
this.dataSource = a;
}
})
},
saveOne(index) {
let a = [...this.dataSource]
let saveData = {
......
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