|
|
|
|
@ -20,22 +20,18 @@ |
|
|
|
|
@on-load="onLoad" |
|
|
|
|
> |
|
|
|
|
<template #menu-left> |
|
|
|
|
<el-button type="danger" icon="el-icon-delete" @click="handleDelete" |
|
|
|
|
>删 除 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button type="danger" @click="handleDelete">删 除 </el-button> |
|
|
|
|
<!-- <el-button type="success" icon="el-icon-upload" @click="handleImport" |
|
|
|
|
>导入 |
|
|
|
|
</el-button> --> |
|
|
|
|
</template> |
|
|
|
|
<template #menu-right> |
|
|
|
|
<el-button type="primary" @click="handleImport">导入</el-button> |
|
|
|
|
<el-button type="primary" @click="handleImport">导入</el-button> |
|
|
|
|
</template> |
|
|
|
|
<template #menu="scope"> |
|
|
|
|
<el-button type="text" @click="setCrew(scope.row)">设置班组人员</el-button> |
|
|
|
|
<el-button type="text" @click="changeTime(scope.row, 0)">日分派时间</el-button> |
|
|
|
|
<el-button type="text" @click="changeTime(scope.row, 1)" |
|
|
|
|
>特殊日分派时间</el-button |
|
|
|
|
> |
|
|
|
|
<el-button type="text" @click="changeTime(scope.row, 1)">特殊日分派时间</el-button> |
|
|
|
|
<el-button type="text" @click="changeTime(scope.row, 2)">轮换时间</el-button> |
|
|
|
|
</template> |
|
|
|
|
<template #teamLeader="{ row }"> |
|
|
|
|
@ -64,40 +60,52 @@ |
|
|
|
|
</template> --> |
|
|
|
|
<template #teamLeader-form="{ type }"> |
|
|
|
|
<span v-show="type == 'edit' || type == 'add'"> |
|
|
|
|
<el-select v-model="form.teamLeader" placeholder="请选择班组长" |
|
|
|
|
filterable clearable> |
|
|
|
|
<el-select |
|
|
|
|
v-model="form.teamLeader" |
|
|
|
|
placeholder="请选择班组长" |
|
|
|
|
filterable |
|
|
|
|
clearable |
|
|
|
|
> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in userData" |
|
|
|
|
:key="item.id" |
|
|
|
|
:value="item.id" |
|
|
|
|
:label="item.realName" |
|
|
|
|
></el-option> |
|
|
|
|
/> |
|
|
|
|
</el-select> |
|
|
|
|
</span> |
|
|
|
|
</template> |
|
|
|
|
<template #planner-form="{ type }"> |
|
|
|
|
<span v-show="type == 'edit' || type == 'add'"> |
|
|
|
|
<el-select v-model="form.planner" placeholder="请选择计划员" |
|
|
|
|
filterable clearable> |
|
|
|
|
<el-select |
|
|
|
|
v-model="form.planner" |
|
|
|
|
placeholder="请选择计划员" |
|
|
|
|
filterable |
|
|
|
|
clearable |
|
|
|
|
> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in plannerData" |
|
|
|
|
:key="item.id" |
|
|
|
|
:value="item.id" |
|
|
|
|
:label="item.realName" |
|
|
|
|
></el-option> |
|
|
|
|
/> |
|
|
|
|
</el-select> |
|
|
|
|
</span> |
|
|
|
|
</template> |
|
|
|
|
<template #dispatcher-form="{ type }"> |
|
|
|
|
<span v-show="type == 'edit' || type == 'add'"> |
|
|
|
|
<el-select v-model="form.dispatcher" placeholder="请选择调度员" |
|
|
|
|
filterable clearable> |
|
|
|
|
<el-select |
|
|
|
|
v-model="form.dispatcher" |
|
|
|
|
placeholder="请选择调度员" |
|
|
|
|
filterable |
|
|
|
|
clearable |
|
|
|
|
> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in dispatcherData" |
|
|
|
|
:key="item.id" |
|
|
|
|
:value="item.id" |
|
|
|
|
:label="item.realName" |
|
|
|
|
></el-option> |
|
|
|
|
/> |
|
|
|
|
</el-select> |
|
|
|
|
</span> |
|
|
|
|
</template> |
|
|
|
|
@ -105,7 +113,7 @@ |
|
|
|
|
<el-dialog class="setCrewBox" title="设置人员" append-to-body v-model="crewDialog" width="60%"> |
|
|
|
|
<tree-transfer |
|
|
|
|
class="trans_ware" |
|
|
|
|
style="margin-top: 10px;" |
|
|
|
|
style="margin-top: 10px" |
|
|
|
|
ref="transferRef" |
|
|
|
|
:titleList="['未选择', '已选择']" |
|
|
|
|
v-model:fromData="noChooseUser" |
|
|
|
|
@ -120,25 +128,20 @@ |
|
|
|
|
rootPid="0" |
|
|
|
|
/> |
|
|
|
|
<template #footer> |
|
|
|
|
<span class="dialog-footer"> |
|
|
|
|
<el-button @click="crewDialog = false">取 消</el-button> |
|
|
|
|
<el-button type="primary" @click="submitPeople">确 定</el-button> |
|
|
|
|
</span> |
|
|
|
|
<span class="dialog-footer"> |
|
|
|
|
<el-button @click="crewDialog = false">取 消</el-button> |
|
|
|
|
<el-button type="primary" @click="submitPeople">确 定</el-button> |
|
|
|
|
</span> |
|
|
|
|
</template> |
|
|
|
|
</el-dialog> |
|
|
|
|
<el-dialog title="时间" append-to-body v-model="timeDialog" width="60%"> |
|
|
|
|
<div> |
|
|
|
|
<el-button type="primary" icon="el-icon-plus" @click="insertEvent()" |
|
|
|
|
>插入一行</el-button |
|
|
|
|
> |
|
|
|
|
<el-button type="primary" icon="el-icon-plus" @click="insertEvent()">插入一行</el-button> |
|
|
|
|
<el-button plain type="danger" @click="remove">删除选择行</el-button> |
|
|
|
|
<!-- <el-button type="primary" @click="handleSave">保存</el-button> --> |
|
|
|
|
</div> |
|
|
|
|
<div style="margin-top: 20px"> |
|
|
|
|
<el-table |
|
|
|
|
:data="timeList" |
|
|
|
|
@select="selectChange" |
|
|
|
|
> |
|
|
|
|
<el-table :data="timeList" @select="selectChange"> |
|
|
|
|
<el-table-column type="selection" width="55px"></el-table-column> |
|
|
|
|
<el-table-column align="center" label="开始时间"> |
|
|
|
|
<template #default="scope"> |
|
|
|
|
@ -167,72 +170,87 @@ |
|
|
|
|
</el-table> |
|
|
|
|
</div> |
|
|
|
|
<template #footer> |
|
|
|
|
<span class="dialog-footer"> |
|
|
|
|
<el-button @click="timeDialog = false">取 消</el-button> |
|
|
|
|
<el-button type="primary" @click="submitTime">确 定</el-button> |
|
|
|
|
</span> |
|
|
|
|
<span class="dialog-footer"> |
|
|
|
|
<el-button @click="timeDialog = false">取 消</el-button> |
|
|
|
|
<el-button type="primary" @click="submitTime">确 定</el-button> |
|
|
|
|
</span> |
|
|
|
|
</template> |
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
<!-- 导入 --> |
|
|
|
|
<basic-import v-if="isShowImport" title="导入" :isShow="isShowImport" |
|
|
|
|
<basic-import |
|
|
|
|
v-if="isShowImport" |
|
|
|
|
title="导入" |
|
|
|
|
:isShow="isShowImport" |
|
|
|
|
templateUrl="/blade-desk/BA/TeamSet/downloadExcelTemplate" |
|
|
|
|
templateName="班组模板.xls" |
|
|
|
|
importUrl="/blade-desk/BA/TeamSet/importExcel" |
|
|
|
|
@closeDialog="closeDialog"></basic-import> |
|
|
|
|
|
|
|
|
|
@closeDialog="closeDialog" |
|
|
|
|
></basic-import> |
|
|
|
|
</basic-container> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import {getList,addTeam,updateTeam,getAllUser,deleteTeam,getNotSelectUser,getSelectUser,getDeptUser,saveUser,getDispatchTime,saveDispatchTime} from "@/api/basicData/teamManagement.js" |
|
|
|
|
import basicImport from '@/components/basic-import/main.vue' |
|
|
|
|
import treeTransfer from 'tree-transfer-vue3' // 引入 |
|
|
|
|
import { |
|
|
|
|
getList, |
|
|
|
|
addTeam, |
|
|
|
|
updateTeam, |
|
|
|
|
getAllUser, |
|
|
|
|
deleteTeam, |
|
|
|
|
getNotSelectUser, |
|
|
|
|
getSelectUser, |
|
|
|
|
getDeptUser, |
|
|
|
|
saveUser, |
|
|
|
|
getDispatchTime, |
|
|
|
|
saveDispatchTime, |
|
|
|
|
} from '@/api/basicData/teamManagement.js'; |
|
|
|
|
import basicImport from '@/components/basic-import/main.vue'; |
|
|
|
|
import treeTransfer from 'tree-transfer-vue3'; // 引入 |
|
|
|
|
export default { |
|
|
|
|
components: { |
|
|
|
|
basicImport, |
|
|
|
|
treeTransfer |
|
|
|
|
treeTransfer, |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
isShowImport:false, |
|
|
|
|
isShowImport: false, |
|
|
|
|
data: [], |
|
|
|
|
page: { |
|
|
|
|
pageSize: 10, |
|
|
|
|
currentPage: 1, |
|
|
|
|
total: 0, |
|
|
|
|
}, |
|
|
|
|
peopleValue:[], |
|
|
|
|
peopleData:[], |
|
|
|
|
peopleValue: [], |
|
|
|
|
peopleData: [], |
|
|
|
|
timeList: [], |
|
|
|
|
deleteTidArr: [], //删除数据 |
|
|
|
|
form: {}, |
|
|
|
|
crewDialog: false, |
|
|
|
|
timeDialog: false, |
|
|
|
|
noChooseUser:[], //未选人员 |
|
|
|
|
chooseUser:[], //已选人员 |
|
|
|
|
noChooseUser: [], //未选人员 |
|
|
|
|
chooseUser: [], //已选人员 |
|
|
|
|
csData: [ |
|
|
|
|
{ |
|
|
|
|
csId: 18, |
|
|
|
|
csName: "白班", |
|
|
|
|
csName: '白班', |
|
|
|
|
keyValue: 18, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
csId: 19, |
|
|
|
|
csName: "晚班", |
|
|
|
|
csName: '晚班', |
|
|
|
|
keyValue: 19, |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
crewData: [], //班组人员数据 |
|
|
|
|
userData: [], |
|
|
|
|
plannerData:[], |
|
|
|
|
dispatcherData:[], |
|
|
|
|
plannerData: [], |
|
|
|
|
dispatcherData: [], |
|
|
|
|
query: {}, |
|
|
|
|
loading: true, |
|
|
|
|
excelBox: false, |
|
|
|
|
option: { |
|
|
|
|
tip: false, |
|
|
|
|
height: "auto", |
|
|
|
|
height: 'auto', |
|
|
|
|
calcHeight: 32, |
|
|
|
|
simplePage: false, |
|
|
|
|
searchShow: true, |
|
|
|
|
@ -245,8 +263,8 @@ export default { |
|
|
|
|
selection: true, |
|
|
|
|
viewBtn: false, |
|
|
|
|
delBtn: false, |
|
|
|
|
editBtnText: "修改", |
|
|
|
|
viewBtnText: "详情", |
|
|
|
|
editBtnText: '修改', |
|
|
|
|
viewBtnText: '详情', |
|
|
|
|
labelWidth: 120, |
|
|
|
|
menuWidth: 440, |
|
|
|
|
dialogWidth: 600, |
|
|
|
|
@ -256,21 +274,21 @@ export default { |
|
|
|
|
searchShowBtn: false, |
|
|
|
|
excelBtn: true, |
|
|
|
|
showOverflowTooltip: true, |
|
|
|
|
searchLabelPosition: "left", |
|
|
|
|
searchLabelPosition: 'left', |
|
|
|
|
searchGutter: 24, |
|
|
|
|
searchSpan: 6, |
|
|
|
|
menuAlign: "center", |
|
|
|
|
menuAlign: 'center', |
|
|
|
|
gridBtn: false, |
|
|
|
|
searchMenuPosition: "right", |
|
|
|
|
addBtnIcon: " ", |
|
|
|
|
viewBtnIcon: " ", |
|
|
|
|
delBtnIcon: " ", |
|
|
|
|
editBtnIcon: " ", |
|
|
|
|
align: "center", |
|
|
|
|
searchMenuPosition: 'right', |
|
|
|
|
addBtnIcon: ' ', |
|
|
|
|
viewBtnIcon: ' ', |
|
|
|
|
delBtnIcon: ' ', |
|
|
|
|
editBtnIcon: ' ', |
|
|
|
|
align: 'center', |
|
|
|
|
column: [ |
|
|
|
|
{ |
|
|
|
|
label: "编码", |
|
|
|
|
prop: "tsCode", |
|
|
|
|
label: '编码', |
|
|
|
|
prop: 'tsCode', |
|
|
|
|
search: true, |
|
|
|
|
sortable: true, |
|
|
|
|
filter: true, |
|
|
|
|
@ -279,14 +297,14 @@ export default { |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入编码", |
|
|
|
|
trigger: "blur", |
|
|
|
|
message: '请输入编码', |
|
|
|
|
trigger: 'blur', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "名称", |
|
|
|
|
prop: "tsName", |
|
|
|
|
label: '名称', |
|
|
|
|
prop: 'tsName', |
|
|
|
|
sortable: true, |
|
|
|
|
filter: true, |
|
|
|
|
span: 24, |
|
|
|
|
@ -295,16 +313,16 @@ export default { |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入名称", |
|
|
|
|
trigger: "blur", |
|
|
|
|
message: '请输入名称', |
|
|
|
|
trigger: 'blur', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "班组长", |
|
|
|
|
prop: "teamLeader", |
|
|
|
|
label: '班组长', |
|
|
|
|
prop: 'teamLeader', |
|
|
|
|
search: false, |
|
|
|
|
type: "select", |
|
|
|
|
type: 'select', |
|
|
|
|
sortable: true, |
|
|
|
|
filter: true, |
|
|
|
|
span: 24, |
|
|
|
|
@ -312,67 +330,67 @@ export default { |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请选择班组长", |
|
|
|
|
trigger: "blur", |
|
|
|
|
message: '请选择班组长', |
|
|
|
|
trigger: 'blur', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
dicUrl:"/api/blade-system/user/page?current=1&size=9999", |
|
|
|
|
dicUrl: '/api/blade-system/user/page?current=1&size=9999', |
|
|
|
|
props: { |
|
|
|
|
label: "realName", |
|
|
|
|
value: "id", |
|
|
|
|
res:"data.records" |
|
|
|
|
label: 'realName', |
|
|
|
|
value: 'id', |
|
|
|
|
res: 'data.records', |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "计划员", |
|
|
|
|
prop: "planner", |
|
|
|
|
label: '计划员', |
|
|
|
|
prop: 'planner', |
|
|
|
|
search: false, |
|
|
|
|
sortable: true, |
|
|
|
|
filter: true, |
|
|
|
|
type: "select", |
|
|
|
|
type: 'select', |
|
|
|
|
span: 24, |
|
|
|
|
width: 150, |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请选择计划员", |
|
|
|
|
trigger: "blur", |
|
|
|
|
message: '请选择计划员', |
|
|
|
|
trigger: 'blur', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
dicUrl:"/api/blade-system/user/page?current=1&size=9999", |
|
|
|
|
dicUrl: '/api/blade-system/user/page?current=1&size=9999', |
|
|
|
|
props: { |
|
|
|
|
label: "realName", |
|
|
|
|
value: "id", |
|
|
|
|
res:"data.records" |
|
|
|
|
label: 'realName', |
|
|
|
|
value: 'id', |
|
|
|
|
res: 'data.records', |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "调度员", |
|
|
|
|
prop: "dispatcher", |
|
|
|
|
label: '调度员', |
|
|
|
|
prop: 'dispatcher', |
|
|
|
|
search: true, |
|
|
|
|
sortable: true, |
|
|
|
|
filter: true, |
|
|
|
|
remote: true, |
|
|
|
|
type: "select", |
|
|
|
|
type: 'select', |
|
|
|
|
span: 24, |
|
|
|
|
width: 150, |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请选择调度员", |
|
|
|
|
trigger: "blur", |
|
|
|
|
message: '请选择调度员', |
|
|
|
|
trigger: 'blur', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
dicUrl:"/api/blade-system/user/page?current=1&size=9999&realName={{key}}", |
|
|
|
|
dicUrl: '/api/blade-system/user/page?current=1&size=9999&realName={{key}}', |
|
|
|
|
props: { |
|
|
|
|
label: "realName", |
|
|
|
|
value: "id", |
|
|
|
|
res:"data.records" |
|
|
|
|
label: 'realName', |
|
|
|
|
value: 'id', |
|
|
|
|
res: 'data.records', |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "班组人员", |
|
|
|
|
prop: "teamMember", |
|
|
|
|
label: '班组人员', |
|
|
|
|
prop: 'teamMember', |
|
|
|
|
search: false, |
|
|
|
|
sortable: true, |
|
|
|
|
filter: true, |
|
|
|
|
@ -383,46 +401,46 @@ export default { |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请选择班组人员", |
|
|
|
|
trigger: "blur", |
|
|
|
|
message: '请选择班组人员', |
|
|
|
|
trigger: 'blur', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "班次", |
|
|
|
|
prop: "csId", |
|
|
|
|
label: '班次', |
|
|
|
|
prop: 'csId', |
|
|
|
|
search: false, |
|
|
|
|
type: "select", |
|
|
|
|
type: 'select', |
|
|
|
|
sortable: true, |
|
|
|
|
filter: true, |
|
|
|
|
span: 24, |
|
|
|
|
width: 150, |
|
|
|
|
props: { |
|
|
|
|
label: "name", |
|
|
|
|
value: "id", |
|
|
|
|
label: 'name', |
|
|
|
|
value: 'id', |
|
|
|
|
}, |
|
|
|
|
dicUrl:"/api/blade-desk/BA/Shifts/listForSelect" |
|
|
|
|
dicUrl: '/api/blade-desk/BA/Shifts/listForSelect', |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "类型分类", |
|
|
|
|
prop: "tsType", |
|
|
|
|
label: '类型分类', |
|
|
|
|
prop: 'tsType', |
|
|
|
|
search: false, |
|
|
|
|
type: "select", |
|
|
|
|
type: 'select', |
|
|
|
|
sortable: true, |
|
|
|
|
filter: true, |
|
|
|
|
span: 24, |
|
|
|
|
width: 150, |
|
|
|
|
dicData: [ |
|
|
|
|
{ value: '1',label: "针孔",}, |
|
|
|
|
{ value: '2',label: "壳体",}, |
|
|
|
|
{ value: '3',label: "烧结",}, |
|
|
|
|
{ value: '4',label: "园区",}, |
|
|
|
|
{ value: '1', label: '针孔' }, |
|
|
|
|
{ value: '2', label: '壳体' }, |
|
|
|
|
{ value: '3', label: '烧结' }, |
|
|
|
|
{ value: '4', label: '园区' }, |
|
|
|
|
// { value: 5,label: "外协",}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "日分派时间", |
|
|
|
|
prop: "dayPutDueTime", |
|
|
|
|
label: '日分派时间', |
|
|
|
|
prop: 'dayPutDueTime', |
|
|
|
|
search: false, |
|
|
|
|
sortable: true, |
|
|
|
|
editDisplay: false, |
|
|
|
|
@ -433,14 +451,14 @@ export default { |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入日分派时间", |
|
|
|
|
trigger: "blur", |
|
|
|
|
message: '请输入日分派时间', |
|
|
|
|
trigger: 'blur', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "特殊日分派时间", |
|
|
|
|
prop: "specDayPutDueTime", |
|
|
|
|
label: '特殊日分派时间', |
|
|
|
|
prop: 'specDayPutDueTime', |
|
|
|
|
search: false, |
|
|
|
|
sortable: true, |
|
|
|
|
editDisplay: false, |
|
|
|
|
@ -451,14 +469,14 @@ export default { |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入特殊日分派时间", |
|
|
|
|
trigger: "blur", |
|
|
|
|
message: '请输入特殊日分派时间', |
|
|
|
|
trigger: 'blur', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "轮换时间", |
|
|
|
|
prop: "exChangeTime", |
|
|
|
|
label: '轮换时间', |
|
|
|
|
prop: 'exChangeTime', |
|
|
|
|
search: false, |
|
|
|
|
sortable: true, |
|
|
|
|
editDisplay: false, |
|
|
|
|
@ -469,16 +487,16 @@ export default { |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请输入轮换时间", |
|
|
|
|
trigger: "blur", |
|
|
|
|
message: '请输入轮换时间', |
|
|
|
|
trigger: 'blur', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "特殊", |
|
|
|
|
prop: "special", |
|
|
|
|
label: '特殊', |
|
|
|
|
prop: 'special', |
|
|
|
|
search: false, |
|
|
|
|
type: "select", |
|
|
|
|
type: 'select', |
|
|
|
|
sortable: true, |
|
|
|
|
filter: true, |
|
|
|
|
span: 24, |
|
|
|
|
@ -486,38 +504,38 @@ export default { |
|
|
|
|
dicData: [ |
|
|
|
|
{ |
|
|
|
|
value: '1', |
|
|
|
|
label: "是", |
|
|
|
|
label: '是', |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
value: '0', |
|
|
|
|
label: "否", |
|
|
|
|
label: '否', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请选择特殊", |
|
|
|
|
trigger: "blur", |
|
|
|
|
message: '请选择特殊', |
|
|
|
|
trigger: 'blur', |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
selectionList: [], |
|
|
|
|
checkId:'', |
|
|
|
|
checkTimeType:0 |
|
|
|
|
checkId: '', |
|
|
|
|
checkTimeType: 0, |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
mounted() {}, |
|
|
|
|
methods: { |
|
|
|
|
// 点击导入按钮 |
|
|
|
|
handleImport() { |
|
|
|
|
this.isShowImport = true |
|
|
|
|
this.isShowImport = true; |
|
|
|
|
}, |
|
|
|
|
handleDelete(){ |
|
|
|
|
if(this.selectionList.length == 0){ |
|
|
|
|
this.$message.error('请至少选择一条数据') |
|
|
|
|
return |
|
|
|
|
handleDelete() { |
|
|
|
|
if (this.selectionList.length == 0) { |
|
|
|
|
this.$message.error('请至少选择一条数据'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
const count = this.selectionList.length; |
|
|
|
|
this.$confirm(`确定要删除选中的 ${count} 条班组数据吗?此操作不可恢复!`, '删除确认', { |
|
|
|
|
@ -525,19 +543,21 @@ export default { |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
confirmButtonClass: 'el-button--danger', |
|
|
|
|
}).then(() => { |
|
|
|
|
deleteTeam({ |
|
|
|
|
ids: this.selectionList.map(item => item.id).join(',') |
|
|
|
|
}).then(res =>{ |
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
this.$message.success('删除成功') |
|
|
|
|
this.selectionList = []; |
|
|
|
|
this.onLoad() |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
deleteTeam({ |
|
|
|
|
ids: this.selectionList.map(item => item.id).join(','), |
|
|
|
|
}).then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.$message.success('删除成功'); |
|
|
|
|
this.selectionList = []; |
|
|
|
|
this.onLoad(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
}).catch(() => { |
|
|
|
|
// 用户点击取消 |
|
|
|
|
}); |
|
|
|
|
.catch(() => { |
|
|
|
|
// 用户点击取消 |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 多选 |
|
|
|
|
selectionChange(list) { |
|
|
|
|
@ -548,26 +568,26 @@ export default { |
|
|
|
|
this.$refs.crud.toggleSelection(); |
|
|
|
|
}, |
|
|
|
|
rowUpdate(row, index, done, loading) { |
|
|
|
|
row.csId = row.csId ? row.csId : null |
|
|
|
|
row.tsType = row.tsType ? row.tsType : null |
|
|
|
|
row.special = row.special ? row.special : '' |
|
|
|
|
updateTeam(row).then(res =>{ |
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
this.$message.success('修改成功') |
|
|
|
|
this.onLoad() |
|
|
|
|
done() |
|
|
|
|
row.csId = row.csId ? row.csId : null; |
|
|
|
|
row.tsType = row.tsType ? row.tsType : null; |
|
|
|
|
row.special = row.special ? row.special : ''; |
|
|
|
|
updateTeam(row).then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.$message.success('修改成功'); |
|
|
|
|
this.onLoad(); |
|
|
|
|
done(); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
rowSave(row, done, loading) { |
|
|
|
|
console.log('row-----------',row) |
|
|
|
|
addTeam(row).then(res =>{ |
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
this.$message.success('添加成功') |
|
|
|
|
this.onLoad() |
|
|
|
|
done() |
|
|
|
|
console.log('row-----------', row); |
|
|
|
|
addTeam(row).then(res => { |
|
|
|
|
if (res.data.code == 200) { |
|
|
|
|
this.$message.success('添加成功'); |
|
|
|
|
this.onLoad(); |
|
|
|
|
done(); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
searchReset() { |
|
|
|
|
this.query = {}; |
|
|
|
|
@ -580,10 +600,10 @@ export default { |
|
|
|
|
done(); |
|
|
|
|
}, |
|
|
|
|
rowDel(row, index, done) { |
|
|
|
|
this.$confirm("确定将选择数据删除?", { |
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
type: "warning", |
|
|
|
|
this.$confirm('确定将选择数据删除?', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}).then(() => {}); |
|
|
|
|
}, |
|
|
|
|
// 设置时间 |
|
|
|
|
@ -591,16 +611,16 @@ export default { |
|
|
|
|
this.checkId = row.id; |
|
|
|
|
this.checkTimeType = val; |
|
|
|
|
getDispatchTime({ |
|
|
|
|
id:row.id, |
|
|
|
|
special:val |
|
|
|
|
}).then(res =>{ |
|
|
|
|
console.log('res-----------',res) |
|
|
|
|
res.data.data.map(item =>{ |
|
|
|
|
item._select = false |
|
|
|
|
}) |
|
|
|
|
id: row.id, |
|
|
|
|
special: val, |
|
|
|
|
}).then(res => { |
|
|
|
|
console.log('res-----------', res); |
|
|
|
|
res.data.data.map(item => { |
|
|
|
|
item._select = false; |
|
|
|
|
}); |
|
|
|
|
this.timeList = res.data.data; |
|
|
|
|
this.timeDialog = true; |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
// this.timeList = []; |
|
|
|
|
// // if(val == 1){ |
|
|
|
|
// this.timeList = [ |
|
|
|
|
@ -611,33 +631,33 @@ export default { |
|
|
|
|
// this.timeDialog = true; |
|
|
|
|
// // } |
|
|
|
|
}, |
|
|
|
|
submitTime(){ |
|
|
|
|
if(this.timeList.length == 0){ |
|
|
|
|
this.$message.error("请添加一条数据!"); |
|
|
|
|
submitTime() { |
|
|
|
|
if (this.timeList.length == 0) { |
|
|
|
|
this.$message.error('请添加一条数据!'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
const timeData = [] |
|
|
|
|
this.timeList.map(item =>{ |
|
|
|
|
const timeData = []; |
|
|
|
|
this.timeList.map(item => { |
|
|
|
|
timeData.push({ |
|
|
|
|
startTime:item.startTime, |
|
|
|
|
endTime:item.endTime, |
|
|
|
|
special:this.checkTimeType |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
startTime: item.startTime, |
|
|
|
|
endTime: item.endTime, |
|
|
|
|
special: this.checkTimeType, |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
let params = { |
|
|
|
|
id:this.checkId, |
|
|
|
|
special:this.checkTimeType, |
|
|
|
|
teamTimes:timeData |
|
|
|
|
} |
|
|
|
|
saveDispatchTime(params).then(res =>{ |
|
|
|
|
if(res.data.code === 200){ |
|
|
|
|
id: this.checkId, |
|
|
|
|
special: this.checkTimeType, |
|
|
|
|
teamTimes: timeData, |
|
|
|
|
}; |
|
|
|
|
saveDispatchTime(params).then(res => { |
|
|
|
|
if (res.data.code === 200) { |
|
|
|
|
this.$message.success('设置成功'); |
|
|
|
|
this.timeDialog = false |
|
|
|
|
this.onLoad() |
|
|
|
|
this.timeDialog = false; |
|
|
|
|
this.onLoad(); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
selectChange(list, row){ |
|
|
|
|
selectChange(list, row) { |
|
|
|
|
row._select = !row._select; |
|
|
|
|
}, |
|
|
|
|
// 插入一行 |
|
|
|
|
@ -647,32 +667,32 @@ export default { |
|
|
|
|
}, |
|
|
|
|
//删除所选行 |
|
|
|
|
remove() { |
|
|
|
|
let arr = this.timeList.filter((item) => item._select); |
|
|
|
|
let arr = this.timeList.filter(item => item._select); |
|
|
|
|
if (arr.length != 0) { |
|
|
|
|
this.$confirm("确定将选择数据删除?", { |
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
type: "warning", |
|
|
|
|
this.$confirm('确定将选择数据删除?', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}).then(() => { |
|
|
|
|
if (this.rowId) { |
|
|
|
|
let deleteData = this.timeList.filter((item) => item._select); |
|
|
|
|
this.deleteTidArr = deleteData.filter((item) => item.tidId); |
|
|
|
|
let deleteData = this.timeList.filter(item => item._select); |
|
|
|
|
this.deleteTidArr = deleteData.filter(item => item.tidId); |
|
|
|
|
} |
|
|
|
|
let deleteArr = this.timeList.filter((item) => !item._select); |
|
|
|
|
let deleteArr = this.timeList.filter(item => !item._select); |
|
|
|
|
this.timeList = deleteArr; |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
this.$message.error("请至少选择一条数据进行操作!"); |
|
|
|
|
this.$message.error('请至少选择一条数据进行操作!'); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 点击保存按钮 |
|
|
|
|
handleSave() { |
|
|
|
|
if (this.timeList.length == 0) { |
|
|
|
|
this.$message.error("请至少填写一条数据"); |
|
|
|
|
this.$message.error('请至少填写一条数据'); |
|
|
|
|
} else { |
|
|
|
|
let tmp = this.timeList.find((item) => item.startTime && item.endTime); |
|
|
|
|
let tmp = this.timeList.find(item => item.startTime && item.endTime); |
|
|
|
|
if (!tmp) { |
|
|
|
|
this.$message.error("数据请填写完整!"); |
|
|
|
|
this.$message.error('数据请填写完整!'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
@ -683,7 +703,7 @@ export default { |
|
|
|
|
|
|
|
|
|
const newItem = { |
|
|
|
|
...item, |
|
|
|
|
parentId // 添加 parentId 字段 |
|
|
|
|
parentId, // 添加 parentId 字段 |
|
|
|
|
// 注意:保留原有的 pid 字段,除非你不需要 |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
@ -698,9 +718,9 @@ export default { |
|
|
|
|
// 设置班组人员 |
|
|
|
|
async setCrew(row) { |
|
|
|
|
this.checkId = row.id; |
|
|
|
|
const users = await getDeptUser({teamSetId: row.id}); |
|
|
|
|
this.chooseUser = this.processTree(users.data.data.teamSelects) |
|
|
|
|
this.noChooseUser = this.processTree(users.data.data.teamUnSelects) |
|
|
|
|
const users = await getDeptUser({ teamSetId: row.id }); |
|
|
|
|
this.chooseUser = this.processTree(users.data.data.teamSelects); |
|
|
|
|
this.noChooseUser = this.processTree(users.data.data.teamUnSelects); |
|
|
|
|
this.crewDialog = true; |
|
|
|
|
|
|
|
|
|
// const notUser = await getNotSelectUser({id: row.id}); |
|
|
|
|
@ -721,7 +741,7 @@ export default { |
|
|
|
|
items.forEach(item => { |
|
|
|
|
// 判断是否为叶子节点 |
|
|
|
|
const hasChildren = Array.isArray(item.children) && item.children.length > 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!hasChildren) { |
|
|
|
|
// 是叶子节点,收集 id |
|
|
|
|
leafIds.push(item.id); |
|
|
|
|
@ -736,37 +756,57 @@ export default { |
|
|
|
|
return leafIds; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
submitPeople(){ |
|
|
|
|
let userArr = this.getLeafIds(this.chooseUser).map(item => item.replace('user-',"")) |
|
|
|
|
submitPeople() { |
|
|
|
|
let userArr = this.getLeafIds(this.chooseUser).map(item => item.replace('user-', '')); |
|
|
|
|
let params = { |
|
|
|
|
id:this.checkId, |
|
|
|
|
userIds:userArr |
|
|
|
|
} |
|
|
|
|
id: this.checkId, |
|
|
|
|
userIds: userArr, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
saveUser(params).then(res =>{ |
|
|
|
|
if(res.data.code === 200){ |
|
|
|
|
this.$message.success('人员设置成功') |
|
|
|
|
this.crewDialog = false |
|
|
|
|
this.onLoad() |
|
|
|
|
saveUser(params).then(res => { |
|
|
|
|
if (res.data.code === 200) { |
|
|
|
|
this.$message.success('人员设置成功'); |
|
|
|
|
this.crewDialog = false; |
|
|
|
|
this.onLoad(); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 打开前回调 |
|
|
|
|
async beforeOpen(done, type, loading) { |
|
|
|
|
// 加载用户下拉数据 |
|
|
|
|
const res = await getAllUser({current:1, size:9999}) |
|
|
|
|
const allUsers = res.data.data.records || [] |
|
|
|
|
this.userData = allUsers |
|
|
|
|
this.plannerData = allUsers |
|
|
|
|
this.dispatcherData = allUsers |
|
|
|
|
|
|
|
|
|
if(type == 'edit'){ |
|
|
|
|
this.form.csId = this.form.csId + '' |
|
|
|
|
this.form.teamLeader = this.form.teamLeader + '' |
|
|
|
|
this.form.planner = this.form.planner + '' |
|
|
|
|
this.form.dispatcher = this.form.dispatcher + '' |
|
|
|
|
try { |
|
|
|
|
const res = await getAllUser({ current: 1, size: 9999 }); |
|
|
|
|
const allUsers = res.data.data.records || []; |
|
|
|
|
// 三个数组独立,互不污染 |
|
|
|
|
this.userData = [...allUsers]; |
|
|
|
|
this.plannerData = [...allUsers]; |
|
|
|
|
this.dispatcherData = [...allUsers]; |
|
|
|
|
|
|
|
|
|
if (type === 'edit') { |
|
|
|
|
// 自动补全回显(不管用户是否在列表里,都能显示) |
|
|
|
|
const userFields = [ |
|
|
|
|
{ id: this.form.teamLeader, name: this.form.teamLeaderRealName, arr: this.userData }, |
|
|
|
|
{ id: this.form.planner, name: this.form.plannerRealName, arr: this.plannerData }, |
|
|
|
|
{ |
|
|
|
|
id: this.form.dispatcher, |
|
|
|
|
name: this.form.dispatcherRealName, |
|
|
|
|
arr: this.dispatcherData, |
|
|
|
|
}, |
|
|
|
|
]; |
|
|
|
|
userFields.forEach(({ id, name, arr }) => { |
|
|
|
|
const uid = (id || '') + ''; |
|
|
|
|
if (!uid || !name) return; |
|
|
|
|
const exist = arr.some(u => u.id == uid); |
|
|
|
|
if (!exist) arr.unshift({ id: uid, realName: name }); |
|
|
|
|
}); |
|
|
|
|
// 统一转字符串 |
|
|
|
|
this.form.csId = (this.form.csId || '') + ''; |
|
|
|
|
this.form.teamLeader = (this.form.teamLeader || '') + ''; |
|
|
|
|
this.form.planner = (this.form.planner || '') + ''; |
|
|
|
|
this.form.dispatcher = (this.form.dispatcher || '') + ''; |
|
|
|
|
} |
|
|
|
|
} catch (err) { |
|
|
|
|
console.error('加载用户失败', err); |
|
|
|
|
} |
|
|
|
|
done() |
|
|
|
|
done(); |
|
|
|
|
}, |
|
|
|
|
currentChange(currentPage) { |
|
|
|
|
this.page.currentPage = currentPage; |
|
|
|
|
@ -780,15 +820,15 @@ export default { |
|
|
|
|
onLoad() { |
|
|
|
|
this.loading = true; |
|
|
|
|
getList({ |
|
|
|
|
descs:'TS_CODE', |
|
|
|
|
current:this.page.currentPage, |
|
|
|
|
size:this.page.pageSize, |
|
|
|
|
...this.query |
|
|
|
|
}).then(res =>{ |
|
|
|
|
this.data = res.data.data.records |
|
|
|
|
this.page.total = res.data.data.total |
|
|
|
|
this.loading = false |
|
|
|
|
}) |
|
|
|
|
descs: 'TS_CODE', |
|
|
|
|
current: this.page.currentPage, |
|
|
|
|
size: this.page.pageSize, |
|
|
|
|
...this.query, |
|
|
|
|
}).then(res => { |
|
|
|
|
this.data = res.data.data.records; |
|
|
|
|
this.page.total = res.data.data.total; |
|
|
|
|
this.loading = false; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
@ -797,11 +837,11 @@ export default { |
|
|
|
|
<style></style> |
|
|
|
|
|
|
|
|
|
<style lang="scss"> |
|
|
|
|
.setCrewBox{ |
|
|
|
|
.tree-transfer-vue3{ |
|
|
|
|
.setCrewBox { |
|
|
|
|
.tree-transfer-vue3 { |
|
|
|
|
height: 450px !important; |
|
|
|
|
|
|
|
|
|
.el-tree{ |
|
|
|
|
.el-tree { |
|
|
|
|
height: 335px !important; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|