Commit e19cef5e by 李伟康

feat(inStoreManage): 优化工资申诉查询功能

- 添加月份选择器,限制只能选择上月和当月
- 修改提交时间的处理逻辑,支持按月份查询
- 更新表格列的显示内容和格式
- 优化搜索和重置功能
1 parent 9fb5b53d
...@@ -9,13 +9,24 @@ ...@@ -9,13 +9,24 @@
:selectPopperAppendToBody="false" :selectPopperAppendToBody="false"
class="d2-search" class="d2-search"
> >
<template slot="dateMonth">
<el-date-picker
v-model="searchForm.commitTime"
type="month"
placeholder="选择月份"
:picker-options="monthPickerOptions"
size="small"
:clearable="false"
value-format="yyyy-MM"
>
</el-date-picker>
</template>
</d2-search> </d2-search>
<div class="up-btns"> <div class="up-btns">
<el-button <el-button
:id="tableParams.btnId" :id="tableParams.btnId"
size="small" size="small"
type="primary" type="primary"
@click="search"
> >
查询 查询
</el-button> </el-button>
...@@ -40,7 +51,7 @@ ...@@ -40,7 +51,7 @@
</el-button> </el-button>
</div> </div>
<d2-table <d2-table
ref="detailListTable" ref="tableRef"
:search-form="searchFormSearch" :search-form="searchFormSearch"
:table-params="tableParams" :table-params="tableParams"
:get-list-api="getListApi" :get-list-api="getListApi"
...@@ -61,9 +72,16 @@ export default { ...@@ -61,9 +72,16 @@ export default {
}, },
data () { data () {
return { return {
monthPickerOptions: {
disabledDate: date => {
let prev = dayjs().subtract(1, 'month').valueOf(),
now = dayjs().valueOf()
return date != now && (date > now || date < prev)
}
},
searchForm: { searchForm: {
appealType: '', appealType: '',
commitTime: [dayjs().startOf('month').toDate(), dayjs().toDate()] commitTime: dayjs().toDate()
}, },
searchFormSearch: {}, searchFormSearch: {},
showFormData: [ showFormData: [
...@@ -82,9 +100,7 @@ export default { ...@@ -82,9 +100,7 @@ export default {
{ {
label: "提交时间", label: "提交时间",
name: "commitTime", name: "commitTime",
type: "datePicker", addHtml: 'dateMonth'
isClear: true,
pickerOptions: "rangePickerOptions"
} }
], ],
getListApi: getClockSalaryList, getListApi: getClockSalaryList,
...@@ -104,37 +120,41 @@ export default { ...@@ -104,37 +120,41 @@ export default {
minWidth: '100' minWidth: '100'
}, { }, {
label: '适配业务', label: '适配业务',
prop: 'ruleType', prop: 'business',
minWidth: '100' minWidth: '100'
}, { }, {
label: '服务门店', label: '服务门店',
prop: 'updatedDate',
minWidth: '180', minWidth: '180',
formatter: (cellValue) => { formatter: (cellValue) => {
var dataHtml = '' var dataHtml = `${cellValue.serviceMerchantName}`
return dataHtml return dataHtml
} }
}, { }, {
label: '申诉类型', label: '申诉类型',
prop: 'supervisor', minWidth: '150',
minWidth: '150' formatter: (cellValue) => {
return {
1: '考勤',
2: '工资'
}[cellValue.appealType] || '--'
}
}, { }, {
label: '申诉时间', label: '申诉时间',
prop: 'createdTime', prop: 'createdTime',
minWidth: '150', minWidth: '150',
formatter: (cellValue) => { formatter: (cellValue) => {
return Util.dateFormate(cellValue.createdTime, 'YYYY-MM-DD HH:mm:ss') return dayjs(cellValue.appealDate).format("YYYY-MM-DD")
} }
}, { }, {
label: '申诉说明', label: '申诉说明',
prop: 'supervisor', prop: 'appealDesc',
minWidth: '150' minWidth: '150'
}, { }, {
label: '下次跟进时间', label: '提交时间',
prop: 'nextFollowTime', prop: 'nextFollowTime',
minWidth: '150', minWidth: '150',
formatter: (cellValue) => { formatter: (cellValue) => {
return Util.dateFormate(cellValue.nextFollowTime, 'YYYY-MM-DD HH:mm') return dayjs(cellValue.commitTime).format("YYYY-MM-DD HH:mm:ss")
} }
} }
] ]
...@@ -149,8 +169,17 @@ export default { ...@@ -149,8 +169,17 @@ export default {
beforeSearchFn () { beforeSearchFn () {
return new Promise(resolve => { return new Promise(resolve => {
this.searchFormSearch = deepClone(this.searchForm) this.searchFormSearch = deepClone(this.searchForm)
if (this.searchFormSearch.commitTime.length) { if (this.searchFormSearch.commitTime) {
let [commitTimeStart, commitTimeEnd] = this.searchFormSearch.commitTime let nowMonth = dayjs().month(),
searchMonth = dayjs(this.searchFormSearch.commitTime).month(),
commitTimeStart = dayjs().startOf('month'),
commitTimeEnd = dayjs().toDate()
if(nowMonth != searchMonth) {
commitTimeStart = dayjs(this.searchFormSearch.commitTime).startOf('month')
commitTimeEnd = dayjs(this.searchFormSearch.commitTime).endOf('month')
}
console.log(commitTimeStart, commitTimeEnd)
// let [commitTimeStart, commitTimeEnd] = this.searchFormSearch.commitTime
this.searchFormSearch.commitTimeStart = `${this.formatDate(commitTimeStart)} 00:00:00` this.searchFormSearch.commitTimeStart = `${this.formatDate(commitTimeStart)} 00:00:00`
this.searchFormSearch.commitTimeEnd = `${this.formatDate(commitTimeEnd)} 23:59:59` this.searchFormSearch.commitTimeEnd = `${this.formatDate(commitTimeEnd)} 23:59:59`
delete this.searchFormSearch.commitTime delete this.searchFormSearch.commitTime
...@@ -163,15 +192,17 @@ export default { ...@@ -163,15 +192,17 @@ export default {
}, },
handleReset () { handleReset () {
this.searchForm = this.$options.data.call(this).searchForm this.searchForm = this.$options.data.call(this).searchForm
this.$refs.timeRef.handleReset() this.search()
this.$nextTick(() => this.search())
}, },
handleExport () { handleExport () {
var params = this.searchForm var params = this.searchFormSearch
exportClockSalaryList(params).then((res) => { exportClockSalaryList(params).then((res) => {
res && downLoadFile(res) res && downLoadFile(res)
}) })
}, },
search () {
this.$refs.tableRef.refreshTable(false, true)
}
} }
} }
</script> </script>
...@@ -197,7 +228,7 @@ export default { ...@@ -197,7 +228,7 @@ export default {
} }
} }
.content { .content {
padding: 0 20px; padding: 0 20px 58px;
background: #fff; background: #fff;
margin-top: 14px; margin-top: 14px;
.top { .top {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!