Commit 84e0dee76d43f66237ef8572025075da5679ce6e

Authored by guzijian
1 parent 9b310b89

feat: 优化修改排班设置操作

src/router/index.js
@@ -7,9 +7,9 @@ import Layout from '@/layout'; @@ -7,9 +7,9 @@ import Layout from '@/layout';
7 * 7 *
8 * hidden: true // 当设置 true 的时候该路由不会再侧边栏出现 如401,login等页面,或者如一些编辑页面/edit/1 8 * hidden: true // 当设置 true 的时候该路由不会再侧边栏出现 如401,login等页面,或者如一些编辑页面/edit/1
9 * alwaysShow: true // 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面 9 * alwaysShow: true // 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面
10 - * // 只有一个时,会将那个子路由当做根路由显示在侧边栏--如引导页面  
11 - * // 若你想不管路由下面的 children 声明的个数都显示你的根路由  
12 - * // 你可以设置 alwaysShow: true,这样它就会忽略之前定义的规则,一直显示根路由 10 + * 只有一个时,会将那个子路由当做根路由显示在侧边栏--如引导页面
  11 + * 若你想不管路由下面的 children 声明的个数都显示你的根路由
  12 + * 你可以设置 alwaysShow: true,这样它就会忽略之前定义的规则,一直显示根路由
13 * redirect: noRedirect // 当设置 noRedirect 的时候该路由在面包屑导航中不可被点击 13 * redirect: noRedirect // 当设置 noRedirect 的时候该路由在面包屑导航中不可被点击
14 * name:'router-name' // 设定路由的名字,一定要填写不然使用<keep-alive>时会出现各种问题 14 * name:'router-name' // 设定路由的名字,一定要填写不然使用<keep-alive>时会出现各种问题
15 * query: '{"id": 1, "name": "ry"}' // 访问路由的默认传递参数 15 * query: '{"id": 1, "name": "ry"}' // 访问路由的默认传递参数
src/views/main/components/people/index.vue
1 <template> 1 <template>
2 <div class="people-container"> 2 <div class="people-container">
3 <el-transfer @left-check-change="handleLeftChange" @right-check-change="handleRightChange" v-loading="loading" 3 <el-transfer @left-check-change="handleLeftChange" @right-check-change="handleRightChange" v-loading="loading"
4 - :filterable="true" :titles="['所有人员', '需重新生成人员']" v-model="childrenItemValue" :data="data" /> 4 + :filterable="true" :titles="[leftTitle, rightTitle]" v-model="childrenItemValue" :data="data" />
5 </div> 5 </div>
6 </template> 6 </template>
7 7
@@ -12,6 +12,16 @@ const loading = ref(false) @@ -12,6 +12,16 @@ const loading = ref(false)
12 const props = defineProps({ 12 const props = defineProps({
13 peopleNowValue: { 13 peopleNowValue: {
14 require: false 14 require: false
  15 + },
  16 + leftTitle: {
  17 + require: false,
  18 + default: "所有人员",
  19 + type: String
  20 + },
  21 + rightTitle: {
  22 + require: false,
  23 + default: "需重新生成人员",
  24 + type: String
15 } 25 }
16 }) 26 })
17 27
src/views/main/manager/index.vue
@@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
23 </el-form> 23 </el-form>
24 <el-row :gutter="10" class="mb8"> 24 <el-row :gutter="10" class="mb8">
25 <el-col :span="1.5"> 25 <el-col :span="1.5">
26 - <el-button type="success" plain icon="Edit" :disabled="multiple" @click="handleEdit">编 辑</el-button> 26 + <el-button type="success" plain icon="Edit" @click="handleEdit">编 辑</el-button>
27 </el-col> 27 </el-col>
28 <el-col :span="1.5"> 28 <el-col :span="1.5">
29 <el-button type="primary" plain icon="User" :disabled="single" @click="handleUser">顶 班</el-button> 29 <el-button type="primary" plain icon="User" :disabled="single" @click="handleUser">顶 班</el-button>
@@ -41,7 +41,8 @@ @@ -41,7 +41,8 @@
41 <el-table-column type="selection" width="40" align="center" fixed="left" /> 41 <el-table-column type="selection" width="40" align="center" fixed="left" />
42 <el-table-column label="工号" show-overflow-tooltip="true" align="center" width="100" prop="jobCode" fixed="left" /> 42 <el-table-column label="工号" show-overflow-tooltip="true" align="center" width="100" prop="jobCode" fixed="left" />
43 <el-table-column label="姓名" show-overflow-tooltip="true" align="center" width="100" prop="name" fixed="left" /> 43 <el-table-column label="姓名" show-overflow-tooltip="true" align="center" width="100" prop="name" fixed="left" />
44 - <el-table-column label="部门" show-overflow-tooltip="true" align="center" width="100" prop="fleetName" fixed="left" /> 44 + <el-table-column label="部门" show-overflow-tooltip="true" align="center" width="100" prop="fleetName"
  45 + fixed="left" />
45 <el-table-column label="工种" show-overflow-tooltip="true" align="center" width="100" prop="posts" fixed="left" /> 46 <el-table-column label="工种" show-overflow-tooltip="true" align="center" width="100" prop="posts" fixed="left" />
46 <el-table-column label="班次" show-overflow-tooltip="true" align="center" width="100" prop="ruleDictName" 47 <el-table-column label="班次" show-overflow-tooltip="true" align="center" width="100" prop="ruleDictName"
47 fixed="left" /> 48 fixed="left" />
@@ -50,8 +51,8 @@ @@ -50,8 +51,8 @@
50 </el-table-column> 51 </el-table-column>
51 </el-table> 52 </el-table>
52 53
53 - <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"  
54 - @pagination="getList" /> 54 + <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
  55 + v-model:limit="queryParams.pageSize" @pagination="getList" />
55 56
56 <!-- 删除和修改对话框 --> 57 <!-- 删除和修改对话框 -->
57 <el-dialog :title="title" v-model="open" width="800px" append-to-body> 58 <el-dialog :title="title" v-model="open" width="800px" append-to-body>
@@ -66,15 +67,20 @@ @@ -66,15 +67,20 @@
66 <schedulingAdd v-if="open" :schedulingNowValue="schedulingNowValue" ref="schedulingChildren" 67 <schedulingAdd v-if="open" :schedulingNowValue="schedulingNowValue" ref="schedulingChildren"
67 :schedulingOptions="schedulingOptions" /> 68 :schedulingOptions="schedulingOptions" />
68 </div> 69 </div>
  70 +
69 <!-- 修改|删除 --> 71 <!-- 修改|删除 -->
70 <el-form :inline="true" label-width="100px"> 72 <el-form :inline="true" label-width="100px">
  73 + <!-- 选择人员 -->
  74 + <el-form-item>
  75 + <people ref="updateChildren" leftTitle="所有人员" rightTitle="已选择人员" />
  76 + </el-form-item>
71 <el-form-item label="开始日期"> 77 <el-form-item label="开始日期">
72 <el-date-picker v-model="startDate" format="YYYY-MM-DD" value-format="YYYY-MM-DD" type="date" 78 <el-date-picker v-model="startDate" format="YYYY-MM-DD" value-format="YYYY-MM-DD" type="date"
73 placeholder="选择开始日期" :disabled-date="disabledDate" /> 79 placeholder="选择开始日期" :disabled-date="disabledDate" />
74 </el-form-item> 80 </el-form-item>
75 <el-form-item label="结束日期"> 81 <el-form-item label="结束日期">
76 - <el-date-picker v-model="endDate" format="YYYY-MM-DD" value-format="YYYY-MM-DD" type="date" placeholder="选择开始日期"  
77 - :disabled-date="disabledDate" /> 82 + <el-date-picker v-model="endDate" format="YYYY-MM-DD" value-format="YYYY-MM-DD" type="date"
  83 + placeholder="选择开始日期" :disabled-date="disabledDate" />
78 </el-form-item> 84 </el-form-item>
79 </el-form> 85 </el-form>
80 <template #footer> 86 <template #footer>
@@ -90,8 +96,8 @@ @@ -90,8 +96,8 @@
90 <el-text class="mx-1" size="small">规则不选择默认顶替当天排班规则,被顶班人员会自动设置为休息。</el-text> 96 <el-text class="mx-1" size="small">规则不选择默认顶替当天排班规则,被顶班人员会自动设置为休息。</el-text>
91 <schedulingAdd v-if="updateDataFlag" ref="schedulingChildrenSecond" :schedulingNowValue="schedulingNowValue" 97 <schedulingAdd v-if="updateDataFlag" ref="schedulingChildrenSecond" :schedulingNowValue="schedulingNowValue"
92 :schedulingOptions="schedulingOptions" /> 98 :schedulingOptions="schedulingOptions" />
93 - <el-form :inline="true" style="margin-top: 15px;" v-if="updateDataFlag" ref="updateDataRef" :model="updateDataUser"  
94 - label-width="100px"> 99 + <el-form :inline="true" style="margin-top: 15px;" v-if="updateDataFlag" ref="updateDataRef"
  100 + :model="updateDataUser" label-width="100px">
95 <el-form-item label="顶班日期" :required="true"> 101 <el-form-item label="顶班日期" :required="true">
96 <el-date-picker v-model="updateDataUser.date" format="YYYY-MM-DD" value-format="YYYY-MM-DD" type="date" 102 <el-date-picker v-model="updateDataUser.date" format="YYYY-MM-DD" value-format="YYYY-MM-DD" type="date"
97 placeholder="选择顶班日期" @change="handleDateChange" :disabled-date="disabledDate" /> 103 placeholder="选择顶班日期" @change="handleDateChange" :disabled-date="disabledDate" />
@@ -153,8 +159,8 @@ const againCreateRequestVo = ref({ @@ -153,8 +159,8 @@ const againCreateRequestVo = ref({
153 month: null, 159 month: null,
154 jobCode: null 160 jobCode: null
155 }) 161 })
  162 +const updateChildren = ref(null)
156 const newAddChildren = ref(null) 163 const newAddChildren = ref(null)
157 -const attendancePeopleList = ref([])  
158 const peopleList = ref([]) 164 const peopleList = ref([])
159 const otherJobCode = ref(null) 165 const otherJobCode = ref(null)
160 const schedulingChildren = ref(null); 166 const schedulingChildren = ref(null);
@@ -167,7 +173,6 @@ const loading = ref(true); @@ -167,7 +173,6 @@ const loading = ref(true);
167 const showSearch = ref(true); 173 const showSearch = ref(true);
168 const jobCodes = ref([]); 174 const jobCodes = ref([]);
169 const single = ref(true); 175 const single = ref(true);
170 -const multiple = ref(true);  
171 const total = ref(0); 176 const total = ref(0);
172 const title = ref(""); 177 const title = ref("");
173 const schedulingOptions = ref(null) 178 const schedulingOptions = ref(null)
@@ -342,7 +347,6 @@ function handleSelectionChange(selection) { @@ -342,7 +347,6 @@ function handleSelectionChange(selection) {
342 if (!single.value) { 347 if (!single.value) {
343 name.value = selection[0].name 348 name.value = selection[0].name
344 } 349 }
345 - multiple.value = !selection.length;  
346 } 350 }
347 351
348 352
@@ -451,9 +455,11 @@ function handleAgainCreateAttendance() { @@ -451,9 +455,11 @@ function handleAgainCreateAttendance() {
451 455
452 function handleUpdate() { 456 function handleUpdate() {
453 // 判断当前规则是否为空 457 // 判断当前规则是否为空
454 - if (schedulingChildren.value.childrenItemValue) { 458 + if (updateChildren.value.childrenItemValue && schedulingChildren.value.childrenItemValue) {
  459 + console.log(updateChildren.value.childrenItemValue);
  460 + console.log(schedulingChildren.value.childrenItemValue);
455 let updateData = { 461 let updateData = {
456 - jobCode: jobCodes.value, 462 + jobCode: updateChildren.value.childrenItemValue,
457 ruleId: schedulingChildren.value.childrenItemValue.id, 463 ruleId: schedulingChildren.value.childrenItemValue.id,
458 startDate: startDate.value, 464 startDate: startDate.value,
459 endDate: endDate.value 465 endDate: endDate.value
@@ -495,7 +501,7 @@ const cancelAgainCreate = () =&gt; { @@ -495,7 +501,7 @@ const cancelAgainCreate = () =&gt; {
495 /** 删除操作 */ 501 /** 删除操作 */
496 function handleDelete() { 502 function handleDelete() {
497 let deleteData = { 503 let deleteData = {
498 - jobCode: jobCodes.value, 504 + jobCode: updateChildren.value.childrenItemValue,
499 startDate: startDate.value, 505 startDate: startDate.value,
500 endDate: endDate.value 506 endDate: endDate.value
501 } 507 }