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