Commit 1e909d52 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents 244bda39 98c068a8
......@@ -127,7 +127,6 @@ export default {
return;
}
this.tableData.loading = true;
return;
this.$post("/attendance/stat/summary", this.query, {
cancelToken: this.source.token,
})
......
......@@ -13,6 +13,7 @@
label="负责人姓名"
prop="staffId"
filterable
:disabled="editId?true:false"
v-model="form.staffId"
:enumData="userList"
placeholder="请输入负责人姓名"
......@@ -62,7 +63,7 @@
</el-row>
<div style="background-color: rgba(242, 246, 252, 1);padding: 20px;">
<wintable ref="wintable" :hallId="dict.hallId" class="wintabel" @selection-change="selectionChange"/>
<wintable :editId="editId" ref="wintable" :hallId="dict.hallId" class="wintabel" @selection-change="selectionChange"/>
</div>
<div style="padding: 20px;">
......@@ -108,14 +109,39 @@ export default {
]
},
userList:{},
userarr:[],//人员数组
checkArr:[],//选中窗口
editId:''//编辑id
};
},
methods: {
//重写表单
beforeSubmit(data){
data['deptName'] = this.dict.deptId[data.deptId]
data['salaName'] = this.dict.salaId[data.salaId]
data['staffName'] = this.userList[data.staffId]
try {
const userObj = this.userarr.find(v=>v.id == data.staffId) //工号
data['number'] = userObj.workNum
// 窗口列表
const checkArr = []
this.checkArr.forEach(v=>{
checkArr.push({
windowId:v.id,
windowName:v.name,
windowCode:v.fromnum,
building:v.building,
level:v.level
})
})
data['windowOwnerDetailList'] = checkArr
} catch (error) {}
return data
},
// 选中窗口
selectionChange(v){
console.log(v,this.$refs.wintable,"########@@@@")
this.checkArr = v
},
cascaderChange(val) {
if (this.deptList.length > 0) {
......@@ -130,7 +156,7 @@ export default {
this.$post("/staff/list",{page:1,size:-1}).then(res=>{
const {code,data} = res
if(code == 1){
const userList = data.data
this.userarr = data.data
const arr = {}
data.data.forEach(element => {
arr[element.id] = element.name
......@@ -144,6 +170,7 @@ export default {
},
/** 编辑 */
edit(row) {
this.editId = row.staffId
this.reset();
this.query = { id: row.id };
this.urls.currUrl = "window/owner/edit";
......@@ -153,6 +180,7 @@ export default {
},
/** 新增 */
add(row) {
this.editId = ''
this.reset();
this.urls.currUrl = "window/owner/add";
this.getData();
......@@ -161,6 +189,7 @@ export default {
},
/** 查看*/
view(row) {
this.editId = row.staffId
this.reset();
this.query = { id: row.id };
this.urls.currUrl = "window/owner/view";
......
......@@ -37,7 +37,7 @@ export default {
isshowTabPane: true,
search: [
{
name: "name",
name: "staffName",
type: "text",
label: "姓名",
fuzzy: true,
......@@ -49,7 +49,7 @@ export default {
{ label: "部门名称", prop: "deptName" },
{ label: "姓名", prop: "name" },
{ label: "姓名", prop: "staffName" },
{ label: "工号", prop: "number" },
......@@ -73,6 +73,7 @@ export default {
return (
<table-buttons
noAdd
noView
row={row}
onEdit={this.toEdit}
onView={this.toView}
......
......@@ -7,7 +7,7 @@
<script>
import table from "@/assets/mixins/table";
export default {
props:['hallId','checkId'],
props:['hallId','checkId','editId'],
mixins: [table],
methods:{
handleSelectionChange(v){
......@@ -16,12 +16,42 @@ export default {
beforeFecth(){
this.pageInfo.list = '/window/owner/subWindowList'
},
//重写
afterRender(info){
const {data} = info
if(this.editId){
// 编辑的时候回显
const toggleRowSelection = []
data.forEach(element => {
if(element.selected == 1){
toggleRowSelection.push(element)
}
});
setTimeout(()=>{
this.toggleRowSelection = toggleRowSelection
})
}
}
},
created(){
this.config.search[0].enumData = this.hallId
// setTimeout(()=>{
// this.toggleRowSelection = [this.tableData.data[0]]
// },2000)
console.log(this.editId,"editId")
},
watch: {
editId:{
handler:function(v){
if(v){
this.query = {staffId:v}
}else{
this.query = {}
}
this.getData()
},
immediate:true
}
},
data(){
return {
......
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