|
|
|
@ -19,7 +19,7 @@
|
|
|
|
|
<el-table-column prop="name" label="员工" width="360"></el-table-column>
|
|
|
|
|
<el-table-column prop="main_departmentName" label="部门"></el-table-column>
|
|
|
|
|
<el-table-column prop="sub_departmentName" label="上级部门"></el-table-column>
|
|
|
|
|
<el-table-column prop="point" label="积分"></el-table-column>
|
|
|
|
|
<el-table-column prop="points" label="积分"></el-table-column>
|
|
|
|
|
<el-table-column prop="action" label="操作" fixed="right" width="240">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-link type="primary" @click="changePoint(scope.row.id)">修改积分</el-link>
|
|
|
|
@ -35,11 +35,31 @@
|
|
|
|
|
:total="pagination.total"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<el-dialog v-model="editVisible" width="30%" title="修改积分">
|
|
|
|
|
<el-form label-width="100px">
|
|
|
|
|
<el-form-item style="width:65%" size="default" label="修改类型">
|
|
|
|
|
<el-radio-group v-model="setForm.settlementMethod">
|
|
|
|
|
<el-radio :label="1">增加积分</el-radio>
|
|
|
|
|
<el-radio :label="2">扣除积分</el-radio>
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item style="width:65%" size="default" label="积分">
|
|
|
|
|
<el-input-number controls-position="right" v-model="setForm.points"></el-input-number>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item style="width:80%" size="default" label="备注">
|
|
|
|
|
<el-input type="textarea" :rows="4" v-model="setForm.remarks" placeholder="请输入备注"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<template #footer>
|
|
|
|
|
<el-button @click="editClose">取消</el-button>
|
|
|
|
|
<el-button @click="editComfirm" type="primary">确定</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {defineComponent, reactive, watch, getCurrentInstance} from 'vue'
|
|
|
|
|
import {defineComponent, reactive, ref, watch, getCurrentInstance} from 'vue'
|
|
|
|
|
import {statusFormatter} from './config.js'
|
|
|
|
|
export default defineComponent({
|
|
|
|
|
name: 'v-questList',
|
|
|
|
@ -48,6 +68,12 @@ export default defineComponent({
|
|
|
|
|
name: undefined,
|
|
|
|
|
department: undefined,
|
|
|
|
|
});
|
|
|
|
|
const setForm = reactive({
|
|
|
|
|
userId: undefined,
|
|
|
|
|
settlementMethod: 1,
|
|
|
|
|
points: 0,
|
|
|
|
|
remarks: undefined,
|
|
|
|
|
})
|
|
|
|
|
const tableData = reactive({
|
|
|
|
|
data: [],
|
|
|
|
|
});
|
|
|
|
@ -56,16 +82,16 @@ export default defineComponent({
|
|
|
|
|
current: 1,
|
|
|
|
|
pageSize: 10
|
|
|
|
|
})
|
|
|
|
|
const editVisible = ref(false);
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
|
|
return {
|
|
|
|
|
form,proxy,
|
|
|
|
|
tableData,pagination,
|
|
|
|
|
form,proxy,setForm,
|
|
|
|
|
tableData,pagination,editVisible,
|
|
|
|
|
statusFormatter
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
// this.getApi()
|
|
|
|
|
// this.getData()
|
|
|
|
|
this.getData()
|
|
|
|
|
watch(() => (this.pagination.pageSize), () => {
|
|
|
|
|
this.getData()
|
|
|
|
|
});
|
|
|
|
@ -74,12 +100,6 @@ export default defineComponent({
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
getApi() {
|
|
|
|
|
let obj = Object.assign(this.form,{pageNum: this.pagination.current,pageSize: this.pagination.pageSize})
|
|
|
|
|
this.proxy.$post("/user/department", obj).then(res => {
|
|
|
|
|
const data = res.data
|
|
|
|
|
}).catch(() => {});
|
|
|
|
|
},
|
|
|
|
|
getData() {
|
|
|
|
|
let obj = Object.assign(this.form,{pageNum: this.pagination.current,pageSize: this.pagination.pageSize})
|
|
|
|
|
this.proxy.$post("/user/list", obj).then(res => {
|
|
|
|
@ -101,17 +121,25 @@ export default defineComponent({
|
|
|
|
|
this.getData();
|
|
|
|
|
},
|
|
|
|
|
changePoint(value) {
|
|
|
|
|
|
|
|
|
|
this.setForm.userId = value;
|
|
|
|
|
this.editVisible = true;
|
|
|
|
|
},
|
|
|
|
|
editClose() {
|
|
|
|
|
this.setForm.settlementMethod = 1;
|
|
|
|
|
this.setForm.points = 0;
|
|
|
|
|
this.setForm.remarks = undefined;
|
|
|
|
|
this.editVisible = false;
|
|
|
|
|
},
|
|
|
|
|
//删除
|
|
|
|
|
singleDel(id) {
|
|
|
|
|
this.$alert(
|
|
|
|
|
'是否删除'+id+'?', //文字
|
|
|
|
|
'删除', //标题
|
|
|
|
|
{type: 'warning'}
|
|
|
|
|
).then(() => {
|
|
|
|
|
this.$message.success('删除成功')
|
|
|
|
|
}).catch(() => {})
|
|
|
|
|
editComfirm() {
|
|
|
|
|
this.proxy.$post("/user/pointsTran", this.setForm).then(res => {
|
|
|
|
|
if(res.code == 200) {
|
|
|
|
|
this.$message.success('修改成功');
|
|
|
|
|
this.editClose();
|
|
|
|
|
this.getData();
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.msg)
|
|
|
|
|
}
|
|
|
|
|
}).catch(() => {});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|