This commit is contained in:
linfso 2025-01-10 19:02:08 +08:00
parent 9e177f8d26
commit ded0eb623f

View File

@ -29,18 +29,26 @@
<el-form-item label="发送人" prop="sendManCode">
<EmisUserSimplePicker0 :placeholder="$t('发送人')" v-model="queryParams.sendManCode"></EmisUserSimplePicker0>
</el-form-item>
<el-form-item label="发送时间" prop="sendDate">
<el-form-item label="发送时间" prop="createTime">
<elDateSimplePicker v-model="dateTimeRange" ></elDateSimplePicker>
</el-form-item>
<el-form-item :label="$t('渠道发送状态')" prop="sendStatus">
<el-select clearable v-model="queryParams.sendStatus" placeholder="">
<el-option key="1" label="已发送" value="1"></el-option>
<el-option key="0" label="未发送" value="0"></el-option>
<el-option key="-1" label="发送异常" value="-1"></el-option>
</el-select>
</el-form-item>
</SearchForm>
<XdTable
slot="pageContent"
slot-scope="slotProps"
:height="(slotProps.contentHeight)+'px'"
ref="refTable"
v-loading="loading"
border
size="mini"
@ -219,6 +227,7 @@ export default {
total: 0,
// 短信发送记录表表格数据
emisSmsSendRecordList: [],
selectionList:null,
currentId:null,
openForm: false,
@ -254,11 +263,6 @@ export default {
/** 查询短信发送记录表列表 */
getList() {
this.loading = true;
this.queryParams.params = {};
if(this.queryOrderType==0){
this.queryParams.phone=this.queryParams.billCode;
this.queryParams.billCode=null;
}
listEmisSmsSendRecord(this.addDateRange(this.queryParams, this.dateTimeRange,"createTime")).then(response => {
this.emisSmsSendRecordList = response.rows;
this.total = response.total;
@ -278,6 +282,7 @@ export default {
},
// 多选框选中数据
handleSelectionChange(selection) {
this.selectionList=selection;
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
@ -327,35 +332,41 @@ export default {
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
// this.download('emis/emisSmsSendRecord/export', {
// ...this.queryParams
// }, `emisSmsSendRecord_${new Date().getTime()}.xlsx`)
const loadingInstance = this.$loading({
handleExport() {
const loadingInstance = this.$loading({
text: '正在导出...'
})
var qParam = {...this.queryParams};
qParam.pageNum=1;
qParam.pageSize=5000;
})
listEmisSmsSendRecord(this.addDateRange(qParam, this.dateTimeRange)).then(response => {
this.downloadLoading = false
if (response.code === 200) {
const curList = response.rows
import('@/vendor/Export2Excel').then(excel => {
const tHeader = ['id','运单号','发送站点编码','站点名称','发件人名称','发送人编码','短信类型','目标号码','短信内容','单条发送费用','发送渠道','发送时间','渠道发送状态','渠道错误代码','渠道错误信息','任务处理时间','备注','租户ID','删除标志(0代表存在','创建者','创建时间','更新者','更新时间','创建网点','更新网点',];
const filterVal = ['id','billCode','sendSiteCode','sendSiteName','sendManName','sendManCode','smsType','phone','content','fee','smsChannel','sendDate','sendStatus','errCode','errMsg','taskDate','remark','tenantId','delFlag','createBy','createTime','updateBy','updateTime','createSite','updateSite',];
const data = this.formatJson(filterVal, curList, response.rows)
excel.export_json_to_excel({
header: tHeader,
data,
filename: '短信发送记录表',
autoWidth: true
})
loadingInstance.close()
})
}
});
if(this.selectionList&&this.selectionList.length>0){
this.exportData(this.selectionList,loadingInstance);
}
else{
let qExportParam=this.addDateRange(this.queryParams, this.dateTimeRange,"createTime");
qExportParam.pageNum=1;
qExportParam.pageSize=50000;
listEmisSmsSendRecord(qExportParam).then(response => {
if (response.code === 200) {
this.exportData(response.rows,loadingInstance);
}
});
}
},
exportData(selData,loadingInstance){
const curList =selData
import('@/vendor/Export2Excel').then(excel => {
const exportParam=this.$refs.refTable.getExportParam();
const tHeader = exportParam.header;
const filterVal = exportParam.filter;
const data = this.formatJson(filterVal, curList, selData)
excel.export_json_to_excel({
header: tHeader,
data,
filename: '短信发送记录表',
autoWidth: true
})
loadingInstance.close()
})
},
formatJson(filterVal, jsonData, resData) {
let index = 0
@ -363,16 +374,33 @@ export default {
if (j === 'index') {
return ++index
}
if (j === 'status') {
var statusStr='xxx'
if(v[j] == 10){
statusStr='xxx'
if (j === 'smsType') {
if(v['smsType'] == 1){
return '寄件';
}
else if(v['smsType'] == 2){
return '签收';
}
else if(v['smsType'] == 3){
return '问题件';
}
}
if (j === 'sendStatus') {
if(v['sendStatus'] == 1){
return '已发送';
}
else if(v['sendStatus'] == 0){
return '未发送';
}
else if(v['sendStatus'] == -1){
return '发送异常';
}
return statusStr;
}
return v[j]
}))
},
/** 列索引函数 */
getIndex($index) {
return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + $index + 1