fix:排版任务 修改窗口增加日期选择控件

This commit is contained in:
xiaoguangbin 2024-11-13 09:53:20 +08:00
parent 76c525be63
commit d0792e9357

View File

@ -115,7 +115,19 @@
<!-- 增加/编辑排班弹窗 --> <!-- 增加/编辑排班弹窗 -->
<custom-modal :title="isAdd ? 'Add' : 'Edit'" :width="845" v-model="visible" :okHandler="submit" destroy-on-close> <custom-modal :title="isAdd ? 'Add' : 'Edit'" :width="845" v-model="visible" :okHandler="submit" destroy-on-close>
<a-spin :spinning="isGettingDetail"> <a-spin :spinning="isGettingDetail">
<div style=" margin: 0 auto;display: flex; width: 672px;">
</div>
<div class="account-assign"> <div class="account-assign">
<div class="scheduling-date">
<label>Task Date</label>
<a-range-picker
dropdownClassName="asd"
:default-value="[moment(startTime), moment(endTime)]"
@change="onRangeDateChange"
:allowClear="false"
:style="{width:'200px'}"
/>
</div>
<div class="search"> <div class="search">
<!-- 穿梭框左上方搜索 --> <!-- 穿梭框左上方搜索 -->
<div class="station-search"> <div class="station-search">
@ -253,6 +265,9 @@ export default {
rightAccountChildSelectedKeys: [], // 穿 rightAccountChildSelectedKeys: [], // 穿
rightAccountChildExpandedKeys: [], // 穿 rightAccountChildExpandedKeys: [], // 穿
startTime: moment().format('YYYY-MM-DD'),
endTime: moment().format('YYYY-MM-DD'),
isChanging: false, isChanging: false,
dragItem: null, dragItem: null,
fromUserId: '', fromUserId: '',
@ -299,6 +314,7 @@ export default {
this.getStationList() this.getStationList()
}, },
methods: { methods: {
moment,
// //
async getList() { async getList() {
this.spinningMain = true this.spinningMain = true
@ -538,11 +554,17 @@ export default {
successMsg = 'Add Success' successMsg = 'Add Success'
failMsg = 'Add Fail' failMsg = 'Add Fail'
} }
const params = [] if(!this.startTime || !this.endTime) {
this.$message.warn('Please select a date!')
return;
}
const tasks = []
this.accountTreeData.forEach((accountTreeItem) => { this.accountTreeData.forEach((accountTreeItem) => {
if (accountTreeItem.children.length) { if (accountTreeItem.children.length) {
params.push({ tasks.push({
schedulingDate: this.currentDate.format('YYYY-MM-DD HH:mm:ss'), // fix: 20241112
// schedulingDate: this.currentDate.format('YYYY-MM-DD HH:mm:ss'),
stationList: accountTreeItem.children.map((child) => { stationList: accountTreeItem.children.map((child) => {
return { return {
stationId: child.key, stationId: child.key,
@ -552,6 +574,11 @@ export default {
}) })
} }
}) })
const params = {
startTime: this.startTime,
endTime: this.endTime,
sysTasks: tasks
}
const { success } = await method(url, params) const { success } = await method(url, params)
if (success) { if (success) {
this.$message.success(successMsg) this.$message.success(successMsg)
@ -668,6 +695,11 @@ export default {
} }
this.targetKeys = targetKeys this.targetKeys = targetKeys
}, },
onRangeDateChange(date, dateString) {
// this.timer = 0
this.startTime = dateString[0]
this.endTime = dateString[1]
},
}, },
computed: { computed: {
treeData() { treeData() {
@ -935,10 +967,14 @@ export default {
width: 672px; width: 672px;
margin: 0 auto; margin: 0 auto;
.search { .scheduling-date{
display: flex; margin-bottom: 15px;
justify-content: space-between; label {
width: 81px;
}
}
.scheduling-date,
.station-search, .station-search,
.account-search { .account-search {
width: 282px; width: 282px;
@ -952,6 +988,10 @@ export default {
user-select: none; user-select: none;
} }
} }
.search {
display: flex;
justify-content: space-between;
} }
.ant-transfer { .ant-transfer {