diff --git a/src/views/lb-business/rush-order-account/index.vue b/src/views/lb-business/rush-order-account/index.vue index a7a75f8..9a9a54c 100644 --- a/src/views/lb-business/rush-order-account/index.vue +++ b/src/views/lb-business/rush-order-account/index.vue @@ -157,6 +157,24 @@ /> + + + + + + + + + @@ -349,6 +367,8 @@ export default { syncLoading: false, rushBuyLoading: false, tenantLoading: false, + rushBuyTimeDialogVisible: false, + rushBuyTime: '', list: [], selectedRowKeys: [], total: 0, @@ -475,6 +495,15 @@ export default { this.syncLoading = false }) }, + getYesterdayStart() { + const date = new Date() + date.setDate(date.getDate() - 1) + date.setHours(0, 0, 0, 0) + const year = date.getFullYear() + const month = String(date.getMonth() + 1).padStart(2, '0') + const day = String(date.getDate()).padStart(2, '0') + return `${year}-${month}-${day} 00:00:00` + }, handleRushBuy() { if (!this.multipleSelection.length) { this.$message.warning('请先勾选要抢单的账号') @@ -485,11 +514,20 @@ export default { this.$message.warning('所选账号缺少有效 ID') return } + this.rushBuyTime = this.getYesterdayStart() + this.rushBuyTimeDialogVisible = true + }, + handleConfirmRushBuyTime() { + if (!this.rushBuyTime) { + this.$message.warning('请选择货物包时间') + return + } + const ids = this.multipleSelection.map((row) => row.id).filter(Boolean) const accountLabels = this.multipleSelection .map((row) => row.loginAccount || row.nickname || row.id) .join('、') this.$confirm( - `确定对以下 ${ids.length} 个账号发起抢单吗?\n${accountLabels}`, + `确定对以下 ${ids.length} 个账号发起抢单吗?\n${accountLabels}\n货物包开始时间:${this.rushBuyTime}`, '开始抢单', { confirmButtonText: '确定', @@ -498,7 +536,7 @@ export default { } ).then(() => { this.rushBuyLoading = true - return rushBuyLbBuyAccount({ ids }) + return rushBuyLbBuyAccount({ ids, goodsBeginTime: this.rushBuyTime }) }).then((res) => { const isSuccess = res && (res.success === true || res.code === 200 || res.code === 20000) if (!isSuccess) { @@ -506,6 +544,7 @@ export default { return } this.$message.success((res && res.message) || '抢单完成') + this.rushBuyTimeDialogVisible = false this.fetchList() }).catch(() => {}).finally(() => { this.rushBuyLoading = false