1
This commit is contained in:
@@ -192,3 +192,12 @@ export function batchMarkRebateReceived() {
|
|||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 生成录单格式文本(Excel可粘贴格式)
|
||||||
|
export function generateExcelText(query) {
|
||||||
|
return request({
|
||||||
|
url: '/system/jdorder/generateExcelText',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -74,6 +74,9 @@
|
|||||||
<el-button type="warning" size="small" icon="el-icon-sort" @click="handleReverseSyncThirdPartyOrderNo" :loading="reverseSyncLoading" title="从腾讯文档第850行开始,通过物流链接反向匹配订单,将腾讯文档的单号列值写入到订单的第三方单号字段">
|
<el-button type="warning" size="small" icon="el-icon-sort" @click="handleReverseSyncThirdPartyOrderNo" :loading="reverseSyncLoading" title="从腾讯文档第850行开始,通过物流链接反向匹配订单,将腾讯文档的单号列值写入到订单的第三方单号字段">
|
||||||
反向同步第三方单号
|
反向同步第三方单号
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button type="primary" size="small" icon="el-icon-document-copy" @click="handleCopyExcelText" :loading="copyExcelTextLoading" title="生成录单格式文本(Tab分隔),可直接粘贴到Excel">
|
||||||
|
复制录单格式
|
||||||
|
</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
@@ -436,7 +439,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listJDOrders, updateJDOrder, delJDOrder, fetchLogisticsManually, batchMarkRebateReceived } from '@/api/system/jdorder'
|
import { listJDOrders, updateJDOrder, delJDOrder, fetchLogisticsManually, batchMarkRebateReceived, generateExcelText } from '@/api/system/jdorder'
|
||||||
import { fillLogisticsByOrderNo, getTokenStatus, getTencentDocAuthUrl, testUserInfo, getAutoWriteConfig, reverseSyncThirdPartyOrderNo } from '@/api/jarvis/tendoc'
|
import { fillLogisticsByOrderNo, getTokenStatus, getTencentDocAuthUrl, testUserInfo, getAutoWriteConfig, reverseSyncThirdPartyOrderNo } from '@/api/jarvis/tendoc'
|
||||||
import ListLayout from '@/components/ListLayout'
|
import ListLayout from '@/components/ListLayout'
|
||||||
import TencentDocAutoWriteConfig from './components/TencentDocAutoWriteConfig'
|
import TencentDocAutoWriteConfig from './components/TencentDocAutoWriteConfig'
|
||||||
@@ -500,7 +503,9 @@ export default {
|
|||||||
// 获取物流信息对话框
|
// 获取物流信息对话框
|
||||||
fetchLogisticsDialogVisible: false,
|
fetchLogisticsDialogVisible: false,
|
||||||
fetchLogisticsLoading: false,
|
fetchLogisticsLoading: false,
|
||||||
fetchLogisticsResult: null
|
fetchLogisticsResult: null,
|
||||||
|
// 复制录单格式loading状态
|
||||||
|
copyExcelTextLoading: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -1293,6 +1298,36 @@ export default {
|
|||||||
this.copyToClipboard(text)
|
this.copyToClipboard(text)
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/** 复制录单格式文本到剪贴板 */
|
||||||
|
async handleCopyExcelText() {
|
||||||
|
try {
|
||||||
|
this.prepareQueryParams()
|
||||||
|
this.copyExcelTextLoading = true
|
||||||
|
|
||||||
|
// 调用后端接口生成Excel格式文本
|
||||||
|
const res = await generateExcelText(this.queryParams)
|
||||||
|
|
||||||
|
if (res.code === 200 && res.data) {
|
||||||
|
// 复制到剪贴板
|
||||||
|
const text = res.data
|
||||||
|
if (text === '暂无订单数据') {
|
||||||
|
this.$message.warning('暂无订单数据,请调整查询条件')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
this.copyToClipboard(text)
|
||||||
|
this.$message.success('已复制到剪贴板,可以直接粘贴到Excel')
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.msg || '生成失败')
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
this.$message.error('复制失败:' + (e.message || '未知错误'))
|
||||||
|
console.error('复制录单格式失败', e)
|
||||||
|
} finally {
|
||||||
|
this.copyExcelTextLoading = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
/** 反向同步第三方单号 */
|
/** 反向同步第三方单号 */
|
||||||
async handleReverseSyncThirdPartyOrderNo() {
|
async handleReverseSyncThirdPartyOrderNo() {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user