Commit ed37fe3e authored by 廖旭伟's avatar 廖旭伟

Merge remote-tracking branch 'origin/master'

parents 684542ca 62961ab7
......@@ -37,6 +37,8 @@ export default {
)
},
async loadNode(node, resolve) {
console.log(node)
if (node.level === 0) {
......
......@@ -81,10 +81,15 @@ instance.interceptors.response.use(response=>{
* @returns
*/
export function post(url, option, config = {}) {
const data = Object.assign({}, option, {
// __mortals_token__: cookie.getItem('__mortals_token__'),
})
return instance.post(url, data, config)
//判断object是数组还是对象
if(Object.getPrototypeOf(option) === Object.prototype){
const data = Object.assign({}, option, {
// __mortals_token__: cookie.getItem('__mortals_token__'),
})
return instance.post(url, data, config)
}else{
return instance.post(url, option, config)
}
}
/**
......
......@@ -68,4 +68,4 @@
};
}
};
</script>
\ No newline at end of file
</script>
......@@ -7,34 +7,7 @@
@handleClick="handleClick"
></tab-pane>
</div>
<!-- <div class="totalNum flex" v-if="tableData.staff">
<div class="item">
在职员工 <span class="num">{{ tableData.staff.inWorkStaff }}</span>
</div>
<div class="item flex">
<div>
全职 <span class="num">{{ tableData.staff.fullStaff }}</span>
</div>
<div>
实习 <span class="num">{{ tableData.staff.pricateStaff }}</span>
</div>
<div>
兼职 <span class="num">{{ tableData.staff.concurrentlyStaff }}</span>
</div>
</div>
<div class="item flex">
<div>
试用 <span class="num">{{ tableData.staff.onTrialStaff }}</span>
</div>
<div>
正式 <span class="num">{{ tableData.staff.formalStaff }}</span>
</div>
<div>
待离职 <span class="num">{{ tableData.staff.resignationStaff }}</span>
</div>
</div>
</div> -->
<el-row :gutter="20" style="padding-top: 10px;">
<el-col :span="6" :xs="12" class="mytree">
<div class="titles">选择部门</div>
......@@ -74,6 +47,16 @@
slot="table-head-left2"
>导出</el-button
>
<el-button
type="primary"
@click="assignStaffToDept"
:disabled="ishowBumen"
size="mini"
slot="table-head-left2"
>部门分配</el-button>
<el-dropdown
class="moreControll"
slot="table-head-left2"
......@@ -201,6 +184,52 @@
:bumentree="areaData"
:currentNode="currentNode"
/>
<!-- 部门选择 -->
<el-dialog :visible.sync="ishowBumen" title="员工分配部门" width="70%">
<el-form ref="form" label-width="80px">
<el-row type="flex" >
<el-form-item label="员工">
<el-tag style="margin-left: 10px" v-for="tag in staffTags">
{{tag}}
</el-tag>
</el-form-item>
</el-row>
<el-form-item label="分配部门">
<el-tag style="margin-left: 10px" v-if="disdept!=''" >
{{disdept}}
</el-tag>
</el-form-item>
<el-divider></el-divider>
<el-row type="flex" :gutter="20" style="height:60vh">
<el-col :span="24" :xs="12" class="mytree">
<el-scrollbar style="height: 100%;width: 100%">
<el-tree
size="mini"
ref="deptTree"
:data="bumentree"
id="el-tree"
node-key="id"
indent="4"
:props="treeProps"
:load="loadNode"
highlight-current
default-expand-all
:expand-on-click-node="false"
:render-content="renderContent1"
@node-click="handleDeptSelectClick"
>
</el-tree>
</el-scrollbar>
</el-col>
</el-row>
<div class="mt20">
<el-button type="primary" size="mini" @click="comfirmDept">确定</el-button>
<el-button size="mini" @click="ishowBumen = false">取消</el-button>
</div>
</el-form>
</el-dialog>
</div>
</template>
......@@ -221,9 +250,18 @@ export default {
created() {
this.$post("/dept/treeselect", {}).then(({ data }) => {
this.areaData = data.result;
this.bumentree = data.result;
});
},
methods: {
renderContent1: function (h, { node, data, store }) {
return (
<span>
<i style="font-size:16px;color:#409EFF" class={data.icon}></i>
<span style="padding-left: 2px;font-size:14px">{node.label}</span>
</span>
)
},
handleOk() {
this.config.columns.forEach((v) => {
v.prop ? (v.show = false) : (v.show = true);
......@@ -233,7 +271,6 @@ export default {
}
});
});
console.log(this.config.columns);
this.$forceUpdate(this.config.columns);
this.isdialog = false;
},
......@@ -258,6 +295,25 @@ export default {
}
});
},
async assignStaffToDept(){
if(this.selection.length==0){
this.$message.info("请选择需要分配部门的员工!");
return
}
await this.$post(`/staff/list`, {
page: 1,
size: -1,
idList:this.selection
}).then((res) => {
this.staffTags= res.data.data.map(i=>i.name)
this.disdept=''
this.disdeptId=null
this.ishowBumen=true;
});
},
/** 导入 */
handleImport() {
this.upload.title = "员工导入";
......@@ -270,6 +326,45 @@ export default {
path: key,
});
},
handleDeptSelectClick(obj){
this.disdept=obj.label
this.disdeptId=obj.id
},
comfirmDept(){
if(this.disdept==''){
this.$message.warning("请选择对应的部门!")
return;
}
let updateStaffList=this.selection.map(id=>{
let obj={}
obj.id=id
obj.deptId=this.disdeptId
obj.deptName=this.disdept
return obj
})
if(updateStaffList.length==0){
this.$message.warning("请选择员工与对应的部门!")
return;
}
console.log(updateStaffList)
this.$post('staff/batchSave',updateStaffList).then(res => {
if(res.code == 1){
this.ishowBumen=false;
this.$message.success("员工分配部门成功!")
this.getData();
}else{
this.$message.error(res.msg)
}
})
},
/** 重写新增方法 */
toAdd(row) {
this.$refs.drawerform.add(row);
......@@ -356,6 +451,13 @@ export default {
},
data() {
return {
bumentree: [],
disdept: "",
disdeptId: "",
staffTags: [],
ishowBumen:false,
staffList:[],
deptnode:{},
// 用户导入参数
upload: {
headers: {
......@@ -456,6 +558,7 @@ export default {
isshowHome: false,
personData: [],
isExport: false,
isDept: false,
staffInfo: {},
drawerhistory: false,
checkList: [],
......
......@@ -8,6 +8,8 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.json.Jackson2ObjectMapperFactoryBean;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import java.util.TimeZone;
@Configuration
public class ConverterConfig {
@Bean
......@@ -25,6 +27,7 @@ public class ConverterConfig {
@Bean
public MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter(ObjectMapper objectMapper) {
MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter = new MappingJackson2HttpMessageConverter();
objectMapper.setTimeZone(TimeZone.getTimeZone("GMT+8"));
mappingJackson2HttpMessageConverter.setObjectMapper(objectMapper);
return mappingJackson2HttpMessageConverter;
}
......
......@@ -297,7 +297,6 @@ public class AttendanceRecordErrorController extends BaseCRUDJsonBodyMappingCont
@Override
protected int editAfter(Long id, Map<String, Object> model, AttendanceRecordErrorEntity entity, Context context) throws AppException {
this.addDict(model, "errorStatus", paramService.getParamBySecondOrganize("AttendanceRecordDetail", "goWorkResult"));
entity.setGoOffDateTime(null);
return super.editAfter(id, model, entity, context);
}
......
......@@ -165,4 +165,18 @@ Content-Type: application/json
###controoler 测试
POST {{baseUrl}}/resource/refreshUrl?packageName=com.mortals.xhx.module
Accept: application/json
\ No newline at end of file
Accept: application/json
###测试api
POST {{baseUrl}}/api/v1/perform/error/message/summary
Content-Type: application/json
{"staffId":193,"errorTimeStart":"2024-05-01","errorTimeEnd":"2024-05-31"}
###测试api
POST {{baseUrl}}/api/v1/inspect/save
Authorization: {{authToken}}
Content-Type: application/json
{"alarmTime":1714285745000,"attendanceGroupName":"","duration":3000,"fileNames":"image.jpg","filePaths":"file/fileupload/1715236144379.jpg","happenTime":1715149753000,"irregularType":3,"performType":"effect","ruleId":25,"staffId":774,"windowNum":""}
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