员工报工代码优化
This commit is contained in:
parent
3a3d8c7bab
commit
735f36a398
@ -8,7 +8,7 @@
|
||||
<el-form-item label="时间范围">
|
||||
<el-date-picker v-model="searchForm.jobDatetime" :clearable="false" type="datetimerange"
|
||||
range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :shortcuts="shortcuts"
|
||||
:default-value="[dayjs().startOf('day').add(8, 'hour'), dayjs().endOf('day').subtract(16, 'hour')]" />
|
||||
:default-value="[proxy.$dayjs().startOf('day').add(8, 'hour'), proxy.$dayjs().endOf('day').subtract(16, 'hour')]" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
@ -72,56 +72,56 @@ const shortcuts = [
|
||||
{
|
||||
text: '今天白班',
|
||||
value: () => {
|
||||
return [dayjs().startOf('day').hour(8).minute(0).second(0), dayjs().startOf('day').hour(20).minute(0).second(0)]
|
||||
return [proxy.$dayjs().startOf('day').hour(8).minute(0).second(0), proxy.$dayjs().startOf('day').hour(20).minute(0).second(0)]
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '今天晚班',
|
||||
value: () => {
|
||||
return [dayjs().startOf('day').hour(20).minute(0).second(0), dayjs().add(1, 'day').startOf('day').hour(8).minute(0).second(0)]
|
||||
return [proxy.$dayjs().startOf('day').hour(20).minute(0).second(0), proxy.$dayjs().add(1, 'day').startOf('day').hour(8).minute(0).second(0)]
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '昨天白班',
|
||||
value: () => {
|
||||
return [dayjs().subtract(1, 'day').startOf('day').hour(8).minute(0).second(0), dayjs().subtract(1, 'day').startOf('day').hour(20).minute(0).second(0)]
|
||||
return [proxy.$dayjs().subtract(1, 'day').startOf('day').hour(8).minute(0).second(0), proxy.$dayjs().subtract(1, 'day').startOf('day').hour(20).minute(0).second(0)]
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '昨天晚班',
|
||||
value: () => {
|
||||
return [dayjs().subtract(1, 'day').startOf('day').hour(20).minute(0).second(0), dayjs().startOf('day').hour(8).minute(0).second(0)]
|
||||
return [proxy.$dayjs().subtract(1, 'day').startOf('day').hour(20).minute(0).second(0), proxy.$dayjs().startOf('day').hour(8).minute(0).second(0)]
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '本周',
|
||||
value: () => {
|
||||
const startOfWeek = dayjs().startOf('week');
|
||||
const endOfWeek = dayjs().endOf('week');
|
||||
const startOfWeek = proxy.$dayjs().startOf('week');
|
||||
const endOfWeek = proxy.$dayjs().endOf('week');
|
||||
return [startOfWeek, endOfWeek];
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '上周',
|
||||
value: () => {
|
||||
const startOfLastWeek = dayjs().subtract(1, 'week').startOf('week');
|
||||
const endOfLastWeek = dayjs().subtract(1, 'week').endOf('week');
|
||||
const startOfLastWeek = proxy.$dayjs().subtract(1, 'week').startOf('week');
|
||||
const endOfLastWeek = proxy.$dayjs().subtract(1, 'week').endOf('week');
|
||||
return [startOfLastWeek, endOfLastWeek];
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '本月',
|
||||
value: () => {
|
||||
const startOfLastMonth = dayjs().startOf('month');
|
||||
const endOfLastMonth = dayjs().endOf('month');
|
||||
const startOfLastMonth = proxy.$dayjs().startOf('month');
|
||||
const endOfLastMonth = proxy.$dayjs().endOf('month');
|
||||
return [startOfLastMonth, endOfLastMonth];
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '上月',
|
||||
value: () => {
|
||||
const startOfLastMonth = dayjs().subtract(1, 'month').startOf('month');
|
||||
const endOfLastMonth = dayjs().subtract(1, 'month').endOf('month');
|
||||
const startOfLastMonth = proxy.$dayjs().subtract(1, 'month').startOf('month');
|
||||
const endOfLastMonth = proxy.$dayjs().subtract(1, 'month').endOf('month');
|
||||
return [startOfLastMonth, endOfLastMonth];
|
||||
},
|
||||
},
|
||||
@ -129,7 +129,7 @@ const shortcuts = [
|
||||
// 搜索条件
|
||||
const searchForm = ref({
|
||||
worker: '',
|
||||
jobDatetime: [dayjs().startOf('day').add(8, 'hour'), dayjs().endOf('day').subtract(16, 'hour')],
|
||||
jobDatetime: [proxy.$dayjs().startOf('day').hour(8).minute(0).second(0), proxy.$dayjs().startOf('day').hour(20).minute(0).second(0)],
|
||||
process: '', // 默认值为空表示全部
|
||||
shift: '白班'
|
||||
})
|
||||
@ -140,8 +140,8 @@ const error = ref(null)
|
||||
|
||||
// 处理班次选择变化
|
||||
function handleShiftChange(newVal) {
|
||||
const currentDateStart = dayjs(searchForm.value.jobDatetime[0]).startOf('day')
|
||||
const currentDateEnd = dayjs(searchForm.value.jobDatetime[1]).startOf('day')
|
||||
const currentDateStart = proxy.$dayjs(searchForm.value.jobDatetime[0]).startOf('day')
|
||||
const currentDateEnd = proxy.$dayjs(searchForm.value.jobDatetime[1]).startOf('day')
|
||||
|
||||
if (newVal === '白班') {
|
||||
searchForm.value.jobDatetime = [
|
||||
@ -168,7 +168,7 @@ async function handleSearch() {
|
||||
error.value = '获取数据失败,请稍后再试'
|
||||
}
|
||||
} catch (err) {
|
||||
error.value = '请求出错,请稍后再试'
|
||||
error.value = '请求出错,请稍后再试' + err
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
@ -178,7 +178,7 @@ async function handleSearch() {
|
||||
function resetForm() {
|
||||
searchForm.value = {
|
||||
worker: '',
|
||||
jobDatetime: [dayjs().startOf('day').add(8, 'hour'), dayjs().endOf('day').subtract(16, 'hour')],
|
||||
jobDatetime: [proxy.$dayjs().startOf('day').hour(8).minute(0).second(0), proxy.$dayjs().startOf('day').hour(20).minute(0).second(0)],
|
||||
process: '', // 默认值为空表示全部
|
||||
shift: '白班'
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@
|
||||
</vxe-table>
|
||||
</template>
|
||||
|
||||
<script setup name="orderpurchase">
|
||||
<script setup name="deliveryschedule">
|
||||
import { listOrderProgress } from '@/api/orderPurchaseManagement/orderProgress.js'
|
||||
import { reactive, ref } from 'vue'
|
||||
import dayjs from 'dayjs'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user