Merge pull request 'develop' (#223) from develop into master
Reviewed-on: http://git.xdadan.loc/tanex/emis-frontend/pulls/223
This commit is contained in:
commit
d4d77e91f8
BIN
public/static/tpl/import_country.xlsx
Normal file
BIN
public/static/tpl/import_country.xlsx
Normal file
Binary file not shown.
BIN
public/static/tpl/import_special_calc_weight.xlsx
Normal file
BIN
public/static/tpl/import_special_calc_weight.xlsx
Normal file
Binary file not shown.
@ -51,3 +51,12 @@ export function delEmisCountry(id) {
|
|||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//批量导入国家
|
||||||
|
export function draftSubmitCountry(data) {
|
||||||
|
return request({
|
||||||
|
url: '/emis/emisCountry/draftSubmitCountry',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
@ -42,3 +42,12 @@ export function delEmisSpecialCalcWeight(id) {
|
|||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//批量导入特殊取重
|
||||||
|
export function draftSubmitSpecialCalcWeight(data) {
|
||||||
|
return request({
|
||||||
|
url: '/emis/emisSpecialCalcWeight/draftSubmitSpecialCalcWeight',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
400
src/views/emis/emisCountry/batchImportCountry.vue
Normal file
400
src/views/emis/emisCountry/batchImportCountry.vue
Normal file
@ -0,0 +1,400 @@
|
|||||||
|
<template>
|
||||||
|
<XdPageContainer >
|
||||||
|
<div slot="pageHeader"></div>
|
||||||
|
<XdTable
|
||||||
|
slot="pageContent"
|
||||||
|
slot-scope="slotProps"
|
||||||
|
:height="(slotProps.contentHeight)+'px'"
|
||||||
|
storageName="batchSiteBatchRecord_main_9"
|
||||||
|
|
||||||
|
ref="multipleTable"
|
||||||
|
:row-class-name="tableRowClassName"
|
||||||
|
v-loading="loading"
|
||||||
|
border
|
||||||
|
size="mini"
|
||||||
|
:data="orderList"
|
||||||
|
:showSearch.sync="showSearch"
|
||||||
|
:queryParams="queryParams"
|
||||||
|
:total="total"
|
||||||
|
@queryTable="getList"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
@sort-change="handleSortChange"
|
||||||
|
|
||||||
|
>
|
||||||
|
|
||||||
|
<div slot="toolbar">
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-upload
|
||||||
|
action=""
|
||||||
|
name="file"
|
||||||
|
accept="application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||||
|
:show-file-list="true"
|
||||||
|
:limit="1"
|
||||||
|
:file-list="fileList"
|
||||||
|
:tooltip="fileName"
|
||||||
|
:on-change="fileChange"
|
||||||
|
:before-upload="beforeUpload">
|
||||||
|
<el-button slot="trigger" plain class="filter-item" size="mini" type="primary" >选择文件</el-button>
|
||||||
|
<el-link type="primary" style="line-height: 28px;font-size:13px;color:blue" href="/static/tpl/import_country.xlsx">下载导入Excel模板</el-link>
|
||||||
|
</el-upload>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
size="mini"
|
||||||
|
@click="handleRealUploadAll"
|
||||||
|
>批量发送</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
>删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column :label="$t('状态')" align="center" prop="uploadStatus" min-width="80" :show-overflow-tooltip="true" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag v-if="scope.row.uploadStatus==1" type="success">发送成功</el-tag>
|
||||||
|
<el-tag v-if="scope.row.uploadStatus==0" type="info">待发送</el-tag>
|
||||||
|
<el-tag v-if="scope.row.uploadStatus==-1" type="danger">发送异常</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :label="$t('异常信息')" align="center" prop="errorInfo" min-width="300" :show-overflow-tooltip="true" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="scope.row.uploadStatus==-1" style="color:red">{{ scope.row.errorInfo }}</span>
|
||||||
|
<span v-if="scope.row.uploadStatus==1">发送成功</span>
|
||||||
|
<span v-if="scope.row.uploadStatus==0">待发送</span>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column :label="$t('国家名称')" align="center" prop="name" min-width="120" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column :label="$t('英文名称')" align="center" prop="nameEn" min-width="120" :show-overflow-tooltip="true"/>
|
||||||
|
<el-table-column :label="$t('国家编码')" align="center" prop="code" min-width="100" :show-overflow-tooltip="true"/>
|
||||||
|
<el-table-column :label="$t('电话区号')" align="center" prop="telAreaCode" min-width="100" :show-overflow-tooltip="true"/>
|
||||||
|
<el-table-column :label="$t('所属区域')" align="center" prop="continentId" min-width="100" :show-overflow-tooltip="true"/>
|
||||||
|
<el-table-column :label="$t('二字码')" align="center" prop="twoCode" min-width="100" :show-overflow-tooltip="true"/>
|
||||||
|
<el-table-column :label="$t('三字码')" align="center" prop="threeCode" min-width="100" :show-overflow-tooltip="true"/>
|
||||||
|
<el-table-column :label="$t('排序')" align="center" prop="orderNum" min-width="100" :show-overflow-tooltip="true"/>
|
||||||
|
<el-table-column :label="$t('备注')" align="center" prop="remark" min-width="100" :show-overflow-tooltip="true"/>
|
||||||
|
</XdTable>
|
||||||
|
</XdPageContainer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { draftSubmitCountry } from "@/api/emis/emisCountry";
|
||||||
|
import {timeDiffTime} from '@/utils/dateUtils'
|
||||||
|
import XLSX from 'xlsx'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "BatchImportCountry",
|
||||||
|
components: {
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
resetRefreshId:null,
|
||||||
|
// 遮罩层
|
||||||
|
loading: false,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 运单列表表格数据
|
||||||
|
orderList: [],
|
||||||
|
tmpDataList: [],
|
||||||
|
selectionList:[],
|
||||||
|
selectionIndexList: [],
|
||||||
|
|
||||||
|
form:{},
|
||||||
|
rules:{},
|
||||||
|
|
||||||
|
openUploadForm:false,
|
||||||
|
uploadMsg:"",
|
||||||
|
uploadExcelDataInfo:"",
|
||||||
|
fileName:"",
|
||||||
|
fileList:[],
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 20,
|
||||||
|
queryKey:null,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getUUID() {
|
||||||
|
return Math.random().toString(36).substring(3,10);
|
||||||
|
},
|
||||||
|
handleBatchImport(){
|
||||||
|
this.resetRefreshId="importForm-"+this.getUUID();
|
||||||
|
|
||||||
|
this.openUploadForm=true;
|
||||||
|
this.fileList=[];
|
||||||
|
this.uploadExcelDataInfo="";
|
||||||
|
this.fileName="";
|
||||||
|
|
||||||
|
},
|
||||||
|
calcDeliveryTime(startData,endDate){
|
||||||
|
return timeDiffTime(startData,endDate)
|
||||||
|
},
|
||||||
|
//标红table指定行
|
||||||
|
tableRowClassName(row, index) {
|
||||||
|
row.row.index = row.rowIndex;
|
||||||
|
if (row.uploadStatus=='1') {
|
||||||
|
return 'success-row';
|
||||||
|
}
|
||||||
|
else if (row.uploadStatus=='-1') {
|
||||||
|
return 'warning-row';
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
},
|
||||||
|
/** 查询运单列表列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
},
|
||||||
|
fileChange(file, fileList) {
|
||||||
|
this.fileList = fileList;
|
||||||
|
},
|
||||||
|
beforeUpload(file) {
|
||||||
|
this.fileName = file.name;
|
||||||
|
this.form.batchName = file.name;
|
||||||
|
this.readerData(file)
|
||||||
|
return false
|
||||||
|
},
|
||||||
|
readerData(rawFile) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
const reader = new FileReader()
|
||||||
|
reader.onload = e => {
|
||||||
|
const data = e.target.result
|
||||||
|
const workbook = XLSX.read(data, { type: 'array' ,cellDates: true})
|
||||||
|
const firstSheetName = workbook.SheetNames[0] // firstSheetName
|
||||||
|
// if (!excelTypes.includes(firstSheetName)) {
|
||||||
|
// reject('无法识别当前Excel模板')
|
||||||
|
// this.$modal.msgError('无法识别当前Excel模板')
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
const worksheet = workbook.Sheets[firstSheetName]
|
||||||
|
// const header = this.getHeaderRow(worksheet) // 标题
|
||||||
|
const results = XLSX.utils.sheet_to_json(worksheet)
|
||||||
|
|
||||||
|
console.log(results);
|
||||||
|
|
||||||
|
this.batchImportData(results);
|
||||||
|
|
||||||
|
resolve()
|
||||||
|
}
|
||||||
|
reader.readAsArrayBuffer(rawFile)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getHeaderRow(sheet) {
|
||||||
|
const headers = []
|
||||||
|
const range = XLSX.utils.decode_range(sheet['!ref'])
|
||||||
|
let C
|
||||||
|
const R = range.s.r
|
||||||
|
/* start in the first row */
|
||||||
|
for (C = range.s.c; C <= range.e.c; ++C) { /* walk every column in the range */
|
||||||
|
const cell = sheet[XLSX.utils.encode_cell({ c: C, r: R })]
|
||||||
|
/* find the cell in the first row */
|
||||||
|
let hdr = 'UNKNOWN ' + C // <-- replace with your desired default
|
||||||
|
if (cell && cell.t) hdr = XLSX.utils.format_cell(cell)
|
||||||
|
headers.push(hdr)
|
||||||
|
}
|
||||||
|
return headers
|
||||||
|
},
|
||||||
|
async batchImportData(results) {
|
||||||
|
const _index = 1
|
||||||
|
let loadingInstance = this.$loading({
|
||||||
|
text: '正在解析 ' + _index + ' 数据...'
|
||||||
|
})
|
||||||
|
|
||||||
|
this.orderList = [];
|
||||||
|
|
||||||
|
// 组装提交的数据
|
||||||
|
for (let index = 0; index < results.length; index++) {
|
||||||
|
const element = results[index]
|
||||||
|
let orderData={
|
||||||
|
name: element['国家名称'],
|
||||||
|
nameEn: element['英文名称'],
|
||||||
|
code: element['国家编码'],
|
||||||
|
telAreaCode: element['电话区号'],
|
||||||
|
continentId: element['所属区域'],
|
||||||
|
twoCode: element['二字码'],
|
||||||
|
threeCode: element['三位码'],
|
||||||
|
orderNum: element['排序'],
|
||||||
|
remark: element['备注'],
|
||||||
|
uploadStatus: 0,
|
||||||
|
errorInfo:'',
|
||||||
|
}
|
||||||
|
//数据转换
|
||||||
|
this.tmpDataList.push(orderData);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 判断是否有数据
|
||||||
|
this.orderList=[];
|
||||||
|
if(this.tmpDataList.length==0){
|
||||||
|
this.$modal.msgError('表格中没有数据');
|
||||||
|
loadingInstance.close()
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.tmpDataList=this.tmpDataList.map(item=>this.transformData(item));
|
||||||
|
this.orderList = this.orderList.concat(this.tmpDataList);
|
||||||
|
this.tmpDataList=[];
|
||||||
|
loadingInstance.close()
|
||||||
|
|
||||||
|
},
|
||||||
|
// 数据转换
|
||||||
|
transformData(orderData){
|
||||||
|
return orderData;
|
||||||
|
},
|
||||||
|
handleRealUploadAll(){
|
||||||
|
if (this.ids && this.ids.length>0) {
|
||||||
|
this.$confirm("确认发送吗?", "提示", {
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
confirmButtonText: "确认",
|
||||||
|
type: "warning",
|
||||||
|
distinguishCancelAndClose: true,
|
||||||
|
closeOnClickModal: false
|
||||||
|
}).then(async () => {
|
||||||
|
|
||||||
|
if(this.selectionList&&this.selectionList.length>0){
|
||||||
|
for(let i=0;i<this.selectionList.length;i++){
|
||||||
|
let orderItem=this.selectionList[i];
|
||||||
|
|
||||||
|
// 检查数据后发送
|
||||||
|
let res=await draftSubmitCountry(orderItem)
|
||||||
|
let rstData=res.data;
|
||||||
|
if(rstData.result=='success'){
|
||||||
|
orderItem.uploadStatus=1;
|
||||||
|
orderItem.errorInfo="发送成功";
|
||||||
|
orderItem.batchNo=rstData.batchNo;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
orderItem.uploadStatus=-1;
|
||||||
|
orderItem.errorInfo=rstData.msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
this.$modal.msgSuccess("上传成功");
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
// this.queryParams.pageNum = 1;
|
||||||
|
// this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
// this.resetForm("queryForm");
|
||||||
|
// this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
|
||||||
|
this.selectionList=selection;
|
||||||
|
this.ids = selection.map(item => item.id)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
// 排序 查询字段是表格中字段名字 动态取值排序顺序
|
||||||
|
handleSortChange(column) {
|
||||||
|
this.queryParams.orderByColumn = column.prop;
|
||||||
|
this.queryParams.isAsc = column.order;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
|
||||||
|
cancel(){
|
||||||
|
this.openUploadForm = false;
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const ids = row.id || this.ids;
|
||||||
|
let that=this;
|
||||||
|
this.$modal.confirm('是否确认删除').then(function() {
|
||||||
|
that.selectionList.forEach((item,index) =>{
|
||||||
|
that.orderList.forEach((v,i)=>{
|
||||||
|
if(item.index === v.index){
|
||||||
|
that.orderList.splice(i,1)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
that.$refs.multipleTable.clearSelection();
|
||||||
|
}).then(() => {
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 列索引函数 */
|
||||||
|
getIndex($index) {
|
||||||
|
return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + $index + 1
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
:deep .el-form-item__label-wrap {
|
||||||
|
margin-left: 0 !important;
|
||||||
|
}
|
||||||
|
.el-divider{
|
||||||
|
margin-top: 0px;
|
||||||
|
background: 0 0;
|
||||||
|
border-top: 1px solid #E6EBF5;
|
||||||
|
}
|
||||||
|
.el-divider__text {
|
||||||
|
color: #0955ee;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.query-label {
|
||||||
|
.el-radio{
|
||||||
|
display: block;
|
||||||
|
line-height: 23px;
|
||||||
|
white-space: normal;
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.queryForm .el-form-item {
|
||||||
|
margin-bottom: 0px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep .el-table .success-row {
|
||||||
|
color: rgb(21, 174, 31) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep .el-table .warning-row {
|
||||||
|
color: #f51f1f !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep .el-form-item__label {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -155,6 +155,16 @@
|
|||||||
v-hasPermi="['emis:emisCountry:export']"
|
v-hasPermi="['emis:emisCountry:export']"
|
||||||
>导出</el-button>
|
>导出</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-upload"
|
||||||
|
size="mini"
|
||||||
|
@click="handleBatchAdd"
|
||||||
|
v-hasPermi="['emis:emisCountry:draftSubmitCountry']"
|
||||||
|
>批量导入</el-button>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -276,17 +286,22 @@
|
|||||||
<el-dialog :title="titleForm" :visible.sync="openForm" :destroy-on-close="true" width="500px" :close-on-click-modal="false" v-dialogDrag append-to-body>
|
<el-dialog :title="titleForm" :visible.sync="openForm" :destroy-on-close="true" width="500px" :close-on-click-modal="false" v-dialogDrag append-to-body>
|
||||||
<emisContinentForm :id="currentContinentId" @on-changed="handleFormChanged" @on-cancel="cancelForm"></EmisContinentForm>
|
<emisContinentForm :id="currentContinentId" @on-changed="handleFormChanged" @on-cancel="cancelForm"></EmisContinentForm>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<!-- 批量导入国家对话框 -->
|
||||||
|
<el-dialog :title="batchAddTitleForm" :visible.sync="openBatchAdd" width="45%" :close-on-click-modal="false" v-dialogDrag append-to-body>
|
||||||
|
<batchImportCountry></batchImportCountry>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import batchImportCountry from '@/views/emis/emisCountry/batchImportCountry';
|
||||||
import { listEmisCountry, getEmisCountry, delEmisCountry, addEmisCountry, updateEmisCountry } from "@/api/emis/emisCountry";
|
import { listEmisCountry, getEmisCountry, delEmisCountry, addEmisCountry, updateEmisCountry } from "@/api/emis/emisCountry";
|
||||||
import { listEmisContinent, getEmisContinent, delEmisContinent, addEmisContinent, updateEmisContinent } from "@/api/emis/emisContinent";
|
import { listEmisContinent, getEmisContinent, delEmisContinent, addEmisContinent, updateEmisContinent } from "@/api/emis/emisContinent";
|
||||||
import elDateSimplePicker from '@/components/DatePickerAdv/elDateSimplePicker';
|
import elDateSimplePicker from '@/components/DatePickerAdv/elDateSimplePicker';
|
||||||
import emisContinentForm from '@/views/emis/emisContinent/emisContinentForm';
|
import emisContinentForm from '@/views/emis/emisContinent/emisContinentForm';
|
||||||
export default {
|
export default {
|
||||||
name: "EmisCountry",
|
name: "EmisCountry",
|
||||||
components: { elDateSimplePicker,emisContinentForm},
|
components: { elDateSimplePicker,emisContinentForm,batchImportCountry},
|
||||||
dicts: [
|
dicts: [
|
||||||
],
|
],
|
||||||
data() {
|
data() {
|
||||||
@ -343,6 +358,9 @@ export default {
|
|||||||
daterangeCreateTime: [],
|
daterangeCreateTime: [],
|
||||||
// 删除标志(0代表存在时间范围
|
// 删除标志(0代表存在时间范围
|
||||||
daterangeUpdateTime: [],
|
daterangeUpdateTime: [],
|
||||||
|
//批量导入国家
|
||||||
|
openBatchAdd: false,
|
||||||
|
batchAddTitleForm: "",
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
@ -725,6 +743,10 @@ export default {
|
|||||||
dateTimeChange(value){
|
dateTimeChange(value){
|
||||||
this.dateTimeRange=value;
|
this.dateTimeRange=value;
|
||||||
},
|
},
|
||||||
|
handleBatchAdd(){
|
||||||
|
this.openBatchAdd= true;
|
||||||
|
this.batchAddTitleForm = "批量导入";
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -0,0 +1,414 @@
|
|||||||
|
<template>
|
||||||
|
<XdPageContainer >
|
||||||
|
<div slot="pageHeader"></div>
|
||||||
|
<XdTable
|
||||||
|
slot="pageContent"
|
||||||
|
slot-scope="slotProps"
|
||||||
|
:height="(slotProps.contentHeight)+'px'"
|
||||||
|
storageName="batchSiteBatchRecord_main_9"
|
||||||
|
|
||||||
|
ref="multipleTable"
|
||||||
|
:row-class-name="tableRowClassName"
|
||||||
|
v-loading="loading"
|
||||||
|
border
|
||||||
|
size="mini"
|
||||||
|
:data="orderList"
|
||||||
|
:showSearch.sync="showSearch"
|
||||||
|
:queryParams="queryParams"
|
||||||
|
:total="total"
|
||||||
|
@queryTable="getList"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
@sort-change="handleSortChange"
|
||||||
|
|
||||||
|
>
|
||||||
|
|
||||||
|
<div slot="toolbar">
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-upload
|
||||||
|
action=""
|
||||||
|
name="file"
|
||||||
|
accept="application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
||||||
|
:show-file-list="true"
|
||||||
|
:limit="1"
|
||||||
|
:file-list="fileList"
|
||||||
|
:tooltip="fileName"
|
||||||
|
:on-change="fileChange"
|
||||||
|
:before-upload="beforeUpload">
|
||||||
|
<el-button slot="trigger" plain class="filter-item" size="mini" type="primary" >选择文件</el-button>
|
||||||
|
<el-link type="primary" style="line-height: 28px;font-size:13px;color:blue" href="/static/tpl/import_special_calc_weight.xlsx">下载导入Excel模板</el-link>
|
||||||
|
</el-upload>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
size="mini"
|
||||||
|
@click="handleRealUploadAll"
|
||||||
|
>批量发送</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
>删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column :label="$t('状态')" align="center" prop="uploadStatus" min-width="80" :show-overflow-tooltip="true" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag v-if="scope.row.uploadStatus==1" type="success">发送成功</el-tag>
|
||||||
|
<el-tag v-if="scope.row.uploadStatus==0" type="info">待发送</el-tag>
|
||||||
|
<el-tag v-if="scope.row.uploadStatus==-1" type="danger">发送异常</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :label="$t('异常信息')" align="center" prop="errorInfo" min-width="300" :show-overflow-tooltip="true" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span v-if="scope.row.uploadStatus==-1" style="color:red">{{ scope.row.errorInfo }}</span>
|
||||||
|
<span v-if="scope.row.uploadStatus==1">发送成功</span>
|
||||||
|
<span v-if="scope.row.uploadStatus==0">待发送</span>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column :label="$t('所属国家')" align="center" prop="country" min-width="100" :show-overflow-tooltip="true"/>
|
||||||
|
<el-table-column :label="$t('所属线路')" align="center" prop="lineCode" min-width="120" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column :label="$t('产品类型')" align="center" prop="prodCode" min-width="120" :show-overflow-tooltip="true"/>
|
||||||
|
<el-table-column :label="$t('取重方式')" align="center" prop="carryType" min-width="100" :show-overflow-tooltip="true"/>
|
||||||
|
<el-table-column :label="$t('起始重量')" align="center" prop="beginWeight" min-width="100" :show-overflow-tooltip="true"/>
|
||||||
|
<el-table-column :label="$t('结束重量')" align="center" prop="endWeight" min-width="100" :show-overflow-tooltip="true"/>
|
||||||
|
<el-table-column :label="$t('生效时间')" align="center" prop="beginDate" min-width="150" :show-overflow-tooltip="true">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :label="$t('失效时间')" align="center" prop="endDate" min-width="150" :show-overflow-tooltip="true">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column :label="$t('备注')" align="center" prop="remark" min-width="100" :show-overflow-tooltip="true"/>
|
||||||
|
</XdTable>
|
||||||
|
</XdPageContainer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { draftSubmitSpecialCalcWeight } from "@/api/emis/emisSpecialCalcWeight";
|
||||||
|
import {timeDiffTime,excelDateToJSDate, timeFormat} from '@/utils/dateUtils'
|
||||||
|
import XLSX from 'xlsx'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "BatchImportDestination",
|
||||||
|
components: {
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
resetRefreshId:null,
|
||||||
|
// 遮罩层
|
||||||
|
loading: false,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 运单列表表格数据
|
||||||
|
orderList: [],
|
||||||
|
tmpDataList: [],
|
||||||
|
selectionList:[],
|
||||||
|
selectionIndexList: [],
|
||||||
|
|
||||||
|
form:{},
|
||||||
|
rules:{},
|
||||||
|
|
||||||
|
openUploadForm:false,
|
||||||
|
uploadMsg:"",
|
||||||
|
uploadExcelDataInfo:"",
|
||||||
|
fileName:"",
|
||||||
|
fileList:[],
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 20,
|
||||||
|
queryKey:null,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getUUID() {
|
||||||
|
return Math.random().toString(36).substring(3,10);
|
||||||
|
},
|
||||||
|
handleBatchImport(){
|
||||||
|
this.resetRefreshId="importForm-"+this.getUUID();
|
||||||
|
|
||||||
|
this.openUploadForm=true;
|
||||||
|
this.fileList=[];
|
||||||
|
this.uploadExcelDataInfo="";
|
||||||
|
this.fileName="";
|
||||||
|
|
||||||
|
},
|
||||||
|
calcDeliveryTime(startData,endDate){
|
||||||
|
return timeDiffTime(startData,endDate)
|
||||||
|
},
|
||||||
|
//标红table指定行
|
||||||
|
tableRowClassName(row, index) {
|
||||||
|
row.row.index = row.rowIndex;
|
||||||
|
if (row.uploadStatus=='1') {
|
||||||
|
return 'success-row';
|
||||||
|
}
|
||||||
|
else if (row.uploadStatus=='-1') {
|
||||||
|
return 'warning-row';
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
},
|
||||||
|
/** 查询运单列表列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
},
|
||||||
|
fileChange(file, fileList) {
|
||||||
|
this.fileList = fileList;
|
||||||
|
},
|
||||||
|
beforeUpload(file) {
|
||||||
|
this.fileName = file.name;
|
||||||
|
this.form.batchName = file.name;
|
||||||
|
this.readerData(file)
|
||||||
|
return false
|
||||||
|
},
|
||||||
|
readerData(rawFile) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
const reader = new FileReader()
|
||||||
|
reader.onload = e => {
|
||||||
|
const data = e.target.result
|
||||||
|
const workbook = XLSX.read(data, { type: 'array'})
|
||||||
|
const firstSheetName = workbook.SheetNames[0] // firstSheetName
|
||||||
|
// if (!excelTypes.includes(firstSheetName)) {
|
||||||
|
// reject('无法识别当前Excel模板')
|
||||||
|
// this.$modal.msgError('无法识别当前Excel模板')
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
const worksheet = workbook.Sheets[firstSheetName]
|
||||||
|
// const header = this.getHeaderRow(worksheet) // 标题
|
||||||
|
const results = XLSX.utils.sheet_to_json(worksheet)
|
||||||
|
|
||||||
|
console.log(results);
|
||||||
|
|
||||||
|
this.batchImportData(results);
|
||||||
|
|
||||||
|
resolve()
|
||||||
|
}
|
||||||
|
reader.readAsArrayBuffer(rawFile)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getHeaderRow(sheet) {
|
||||||
|
const headers = []
|
||||||
|
const range = XLSX.utils.decode_range(sheet['!ref'])
|
||||||
|
let C
|
||||||
|
const R = range.s.r
|
||||||
|
/* start in the first row */
|
||||||
|
for (C = range.s.c; C <= range.e.c; ++C) { /* walk every column in the range */
|
||||||
|
const cell = sheet[XLSX.utils.encode_cell({ c: C, r: R })]
|
||||||
|
/* find the cell in the first row */
|
||||||
|
let hdr = 'UNKNOWN ' + C // <-- replace with your desired default
|
||||||
|
if (cell && cell.t) hdr = XLSX.utils.format_cell(cell)
|
||||||
|
headers.push(hdr)
|
||||||
|
}
|
||||||
|
return headers
|
||||||
|
},
|
||||||
|
async batchImportData(results) {
|
||||||
|
const _index = 1
|
||||||
|
let loadingInstance = this.$loading({
|
||||||
|
text: '正在解析 ' + _index + ' 数据...'
|
||||||
|
})
|
||||||
|
|
||||||
|
this.orderList = [];
|
||||||
|
|
||||||
|
// 组装提交的数据
|
||||||
|
for (let index = 0; index < results.length; index++) {
|
||||||
|
const element = results[index]
|
||||||
|
let orderData={
|
||||||
|
country: element['所属国家'],
|
||||||
|
transLineCode: element['所属线路'],
|
||||||
|
prodCode: element['产品类型'],
|
||||||
|
carryType: element['取重方式'],
|
||||||
|
beginWeight: element['起始重量'],
|
||||||
|
endWeight: element['结束重量'],
|
||||||
|
beginDate: element['生效时间'],
|
||||||
|
endDate: element['失效时间'],
|
||||||
|
remark: element['备注'],
|
||||||
|
uploadStatus: 0,
|
||||||
|
errorInfo: '',
|
||||||
|
}
|
||||||
|
//转时间格式
|
||||||
|
if(orderData.beginDate){
|
||||||
|
// orderData.beginDate=timeFormat(orderData.beginDate,'YYYY-MM-DD HH:mm:ss')
|
||||||
|
orderData.beginDate=excelDateToJSDate(orderData.beginDate);
|
||||||
|
}
|
||||||
|
if(orderData.endDate){
|
||||||
|
// orderData.endDate=timeFormat(orderData.endDate,'YYYY-MM-DD HH:mm:ss')
|
||||||
|
orderData.endDate=excelDateToJSDate(orderData.endDate);
|
||||||
|
}
|
||||||
|
//数据转换
|
||||||
|
this.tmpDataList.push(orderData);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 判断是否有数据
|
||||||
|
this.orderList=[];
|
||||||
|
if(this.tmpDataList.length==0){
|
||||||
|
this.$modal.msgError('表格中没有数据');
|
||||||
|
loadingInstance.close()
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.tmpDataList=this.tmpDataList.map(item=>this.transformData(item));
|
||||||
|
this.orderList = this.orderList.concat(this.tmpDataList);
|
||||||
|
this.tmpDataList=[];
|
||||||
|
loadingInstance.close()
|
||||||
|
|
||||||
|
},
|
||||||
|
// 数据转换
|
||||||
|
transformData(orderData){
|
||||||
|
orderData.status=orderData.status=='启用'?'1':'0';
|
||||||
|
orderData.isHinterland=orderData.isHinterland=='是'?'1':'0';
|
||||||
|
return orderData;
|
||||||
|
},
|
||||||
|
handleRealUploadAll(){
|
||||||
|
if (this.ids && this.ids.length>0) {
|
||||||
|
this.$confirm("确认发送吗?", "提示", {
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
confirmButtonText: "确认",
|
||||||
|
type: "warning",
|
||||||
|
distinguishCancelAndClose: true,
|
||||||
|
closeOnClickModal: false
|
||||||
|
}).then(async () => {
|
||||||
|
|
||||||
|
if(this.selectionList&&this.selectionList.length>0){
|
||||||
|
for(let i=0;i<this.selectionList.length;i++){
|
||||||
|
let orderItem=this.selectionList[i];
|
||||||
|
|
||||||
|
// 检查数据后发送
|
||||||
|
let res=await draftSubmitSpecialCalcWeight(orderItem)
|
||||||
|
let rstData=res.data;
|
||||||
|
if(rstData.result=='success'){
|
||||||
|
orderItem.uploadStatus=1;
|
||||||
|
orderItem.errorInfo="发送成功";
|
||||||
|
orderItem.batchNo=rstData.batchNo;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
orderItem.uploadStatus=-1;
|
||||||
|
orderItem.errorInfo=rstData.msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
this.$modal.msgSuccess("上传成功");
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
// this.queryParams.pageNum = 1;
|
||||||
|
// this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
// this.resetForm("queryForm");
|
||||||
|
// this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
|
||||||
|
this.selectionList=selection;
|
||||||
|
this.ids = selection.map(item => item.id)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
// 排序 查询字段是表格中字段名字 动态取值排序顺序
|
||||||
|
handleSortChange(column) {
|
||||||
|
this.queryParams.orderByColumn = column.prop;
|
||||||
|
this.queryParams.isAsc = column.order;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
|
||||||
|
cancel(){
|
||||||
|
this.openUploadForm = false;
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const ids = row.id || this.ids;
|
||||||
|
let that=this;
|
||||||
|
this.$modal.confirm('是否确认删除').then(function() {
|
||||||
|
that.selectionList.forEach((item,index) =>{
|
||||||
|
that.orderList.forEach((v,i)=>{
|
||||||
|
if(item.index === v.index){
|
||||||
|
that.orderList.splice(i,1)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
that.$refs.multipleTable.clearSelection();
|
||||||
|
}).then(() => {
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
|
||||||
|
/** 列索引函数 */
|
||||||
|
getIndex($index) {
|
||||||
|
return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + $index + 1
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
:deep .el-form-item__label-wrap {
|
||||||
|
margin-left: 0 !important;
|
||||||
|
}
|
||||||
|
.el-divider{
|
||||||
|
margin-top: 0px;
|
||||||
|
background: 0 0;
|
||||||
|
border-top: 1px solid #E6EBF5;
|
||||||
|
}
|
||||||
|
.el-divider__text {
|
||||||
|
color: #0955ee;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.query-label {
|
||||||
|
.el-radio{
|
||||||
|
display: block;
|
||||||
|
line-height: 23px;
|
||||||
|
white-space: normal;
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.queryForm .el-form-item {
|
||||||
|
margin-bottom: 0px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep .el-table .success-row {
|
||||||
|
color: rgb(21, 174, 31) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep .el-table .warning-row {
|
||||||
|
color: #f51f1f !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep .el-form-item__label {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -109,6 +109,16 @@
|
|||||||
v-hasPermi="['emis:emisSpecialCalcWeight:export']"
|
v-hasPermi="['emis:emisSpecialCalcWeight:export']"
|
||||||
>导出</el-button>
|
>导出</el-button>
|
||||||
</el-col> -->
|
</el-col> -->
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-upload"
|
||||||
|
size="mini"
|
||||||
|
@click="handleBatchAdd"
|
||||||
|
v-hasPermi="['emis:emisSpecialCalcWeight:draftSubmitSpecialCalcWeight']"
|
||||||
|
>批量导入</el-button>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -177,7 +187,10 @@
|
|||||||
<emisSpecialCalcWeightView :id="id" ></EmisSpecialCalcWeightView>
|
<emisSpecialCalcWeightView :id="id" ></EmisSpecialCalcWeightView>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
-->
|
-->
|
||||||
|
<!-- 批量新增特殊取重弹窗 -->
|
||||||
|
<el-dialog :title="titleBatchAdd" :visible.sync="openBatchAdd" width="50%" :destroy-on-close="true" v-dialogDrag append-to-body>
|
||||||
|
<batchImportSpecialCalcWeight></batchImportSpecialCalcWeight>
|
||||||
|
</el-dialog>
|
||||||
</XdPageContainer>
|
</XdPageContainer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -189,10 +202,11 @@ import CountryPicker from '@/views/emis/EmisBaseTools/CountryPicker.vue';
|
|||||||
import TransLinePicker from '@/views/emis/EmisBaseTools/TransLinePicker.vue';
|
import TransLinePicker from '@/views/emis/EmisBaseTools/TransLinePicker.vue';
|
||||||
import TransProductPicker from '@/views/emis/EmisBaseTools/TransProductPicker.vue';
|
import TransProductPicker from '@/views/emis/EmisBaseTools/TransProductPicker.vue';
|
||||||
import TransProductCasPicker from '@/views/emis/EmisBaseTools/TransProductCasPicker.vue';
|
import TransProductCasPicker from '@/views/emis/EmisBaseTools/TransProductCasPicker.vue';
|
||||||
|
import batchImportSpecialCalcWeight from '@/views/emis/emisSpecialCalcWeight/batchImportSpecialCalcWeight.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "EmisSpecialCalcWeight",
|
name: "EmisSpecialCalcWeight",
|
||||||
components: { CountryPicker,TransLinePicker,elDateSimplePicker,TransProductPicker,emisSpecialCalcWeightForm ,TransProductCasPicker},
|
components: { CountryPicker,TransLinePicker,elDateSimplePicker,TransProductPicker,emisSpecialCalcWeightForm ,TransProductCasPicker,batchImportSpecialCalcWeight},
|
||||||
dicts: [
|
dicts: [
|
||||||
'sys_normal_disable',
|
'sys_normal_disable',
|
||||||
'emis_take_weight_method',
|
'emis_take_weight_method',
|
||||||
@ -236,6 +250,8 @@ export default {
|
|||||||
daterangeCreateTime: [],
|
daterangeCreateTime: [],
|
||||||
// 更新时间时间范围
|
// 更新时间时间范围
|
||||||
daterangeUpdateTime: [],
|
daterangeUpdateTime: [],
|
||||||
|
openBatchAdd: false,
|
||||||
|
titleBatchAdd: "批量新增特殊取重",
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
@ -391,6 +407,10 @@ export default {
|
|||||||
dateTimeChange(value){
|
dateTimeChange(value){
|
||||||
this.dateTimeRange=value;
|
this.dateTimeRange=value;
|
||||||
},
|
},
|
||||||
|
handleBatchAdd(){
|
||||||
|
this.openBatchAdd= true;
|
||||||
|
this.batchAddTitleForm = "批量导入";
|
||||||
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,14 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<XdPageContainer class="app-container">
|
<XdPageContainer class="app-container">
|
||||||
<SearchForm slot="pageHeader" :model="queryParams" ref="queryForm" size="mini" :maxShow="8" label-width="100px" v-show="showSearch" @search="getList" @reset="resetQuery">
|
<SearchForm slot="pageHeader" :model="queryParams" ref="queryForm" size="mini" :maxShow="8" label-width="100px" v-show="showSearch" @search="getList" @reset="resetQuery">
|
||||||
<el-form-item label="" prop="billCode">
|
<el-form-item label="" prop="billCode">
|
||||||
<div slot="label">
|
<div slot="label">
|
||||||
<el-radio-group class="query-label" v-model="queryParams.params.queryOrderType">
|
<el-radio-group class="query-label" v-model="queryParams.params.queryOrderType">
|
||||||
<el-radio label="1">运单号</el-radio>
|
<el-radio label="1">运单号</el-radio>
|
||||||
<el-radio label="0">订单号</el-radio>
|
<el-radio label="0">订单号</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</div>
|
</div>
|
||||||
<!-- <el-input
|
<!-- <el-input
|
||||||
v-model="queryParams.billCode"
|
v-model="queryParams.billCode"
|
||||||
:placeholder="$t('多个流水号逗号或换行隔开')"
|
:placeholder="$t('多个流水号逗号或换行隔开')"
|
||||||
clearable
|
clearable
|
||||||
@ -21,40 +21,40 @@
|
|||||||
clearable
|
clearable
|
||||||
:rows="2"
|
:rows="2"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- </el-col> -->
|
<!-- </el-col> -->
|
||||||
<!-- <el-col :span="16"> -->
|
<!-- <el-col :span="16"> -->
|
||||||
<el-form-item label="签收时间" prop="dateTimeRange">
|
<el-form-item label="签收时间" prop="dateTimeRange">
|
||||||
<elDateAdvPicker clearable v-model="dateTimeRange" @dateTimeChange="onDateSelect" ></elDateAdvPicker>
|
<elDateAdvPicker clearable v-model="dateTimeRange" @dateTimeChange="onDateSelect" ></elDateAdvPicker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- </el-col> -->
|
<!-- </el-col> -->
|
||||||
<!-- <el-col :span="8"> -->
|
<!-- <el-col :span="8"> -->
|
||||||
<el-form-item :label="$t('签收网点')" prop="signSiteCode" label-width="70px">
|
<el-form-item :label="$t('签收网点')" prop="signSiteCode" label-width="70px">
|
||||||
<EmisSiteSimplePicker v-model="queryParams.signSiteCode" @onChange="onScanSiteSelect" ></EmisSiteSimplePicker>
|
<EmisSiteSimplePicker v-model="queryParams.signSiteCode" @onChange="onScanSiteSelect" ></EmisSiteSimplePicker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- </el-col> -->
|
<!-- </el-col> -->
|
||||||
<!-- <el-col :span="8"> -->
|
<!-- <el-col :span="8"> -->
|
||||||
<el-form-item :label="$t('签收图片')" prop="isUploadPic">
|
<el-form-item :label="$t('签收图片')" prop="isUploadPic">
|
||||||
<el-select v-model="queryParams.params.isUploadPic" clearable :placeholder="$t('全部')" value="0">
|
<el-select v-model="queryParams.params.isUploadPic" clearable :placeholder="$t('全部')" value="0">
|
||||||
<el-option :label="$t('未上传')" value="0"></el-option>
|
<el-option :label="$t('未上传')" value="0"></el-option>
|
||||||
<el-option :label="$t('已上传')" value="1"></el-option>
|
<el-option :label="$t('已上传')" value="1"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- </el-col> -->
|
<!-- </el-col> -->
|
||||||
<!-- <el-col :span="8"> -->
|
<!-- <el-col :span="8"> -->
|
||||||
<el-form-item :label="$t('派件员')" prop="dispatchOrSendManCode">
|
<el-form-item :label="$t('派件员')" prop="dispatchOrSendManCode">
|
||||||
<EmisUserSimplePicker v-model="queryParams.dispatchOrSendManCode" postCode="RSD" @onChange="onStaffSelect" ></EmisUserSimplePicker>
|
<EmisUserSimplePicker v-model="queryParams.dispatchOrSendManCode" postCode="RSD" @onChange="onStaffSelect" ></EmisUserSimplePicker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- </el-col> -->
|
<!-- </el-col> -->
|
||||||
|
|
||||||
<!-- <el-col :span="8"> -->
|
<!-- <el-col :span="8"> -->
|
||||||
<el-form-item :label="$t('收件国家')" prop="country" label-width="70px">
|
<el-form-item :label="$t('收件国家')" prop="country" label-width="70px">
|
||||||
<CountryPicker v-model="queryParams.country" @onChange="onCountrySelect" ></CountryPicker>
|
<CountryPicker v-model="queryParams.country" @onChange="onCountrySelect" ></CountryPicker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- </el-col> -->
|
<!-- </el-col> -->
|
||||||
|
|
||||||
|
|
||||||
</SearchForm>
|
</SearchForm>
|
||||||
|
|
||||||
|
|
||||||
<xd-table
|
<xd-table
|
||||||
@ -62,7 +62,7 @@
|
|||||||
slot="pageContent"
|
slot="pageContent"
|
||||||
slot-scope="slotProps"
|
slot-scope="slotProps"
|
||||||
:height="(slotProps.contentHeight)+'px'"
|
:height="(slotProps.contentHeight)+'px'"
|
||||||
|
ref="refTable"
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
border
|
border
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -78,15 +78,15 @@
|
|||||||
>
|
>
|
||||||
<div slot="toolbar">
|
<div slot="toolbar">
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
plain
|
plain
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleExport"
|
@click="handleExport"
|
||||||
>导出</el-button>
|
>导出</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
@ -109,26 +109,26 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column :label="$t('寄件日期')" align="center" prop="sendDate" min-width="170" >
|
<el-table-column :label="$t('寄件日期')" align="center" prop="sendDate" min-width="170" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.waybillDetail.sendDate) }}</span>
|
<span>{{ parseTime(scope.row.waybillDetail.sendDate) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :label="$t('预计到达时间')" align="center" prop="estimateDate" min-width="150" >
|
<el-table-column :label="$t('预计到达时间')" align="center" prop="estimateDate" min-width="150" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.waybillDetail.estimateDate) }}</span>
|
<span>{{ parseTime(scope.row.waybillDetail.estimateDate) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :label="$t('线路')" align="center" prop="" min-width="100">
|
<el-table-column :label="$t('线路')" align="center" prop="transLineTypeName" min-width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ scope.row.waybillDetail.transLineTypeName }}</span>
|
<span>{{ scope.row.waybillDetail.transLineTypeName }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :label="$t('支付方式')" align="center" prop="paymentType" min-width="80" :show-overflow-tooltip="true" >
|
<el-table-column :label="$t('支付方式')" align="center" prop="paymentType" min-width="80" :show-overflow-tooltip="true" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.emis_payment_type" :value="scope.row.waybillDetail.paymentType"/>
|
<dict-tag :options="dict.type.emis_payment_type" :value="scope.row.waybillDetail.paymentType"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :label="$t('产品类型')" align="center" prop="" min-width="100">
|
<el-table-column :label="$t('产品类型')" align="center" prop="productTypeName" min-width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ scope.row.waybillDetail.productTypeName }}</span>
|
<span>{{ scope.row.waybillDetail.productTypeName }}</span>
|
||||||
</template>
|
</template>
|
||||||
@ -162,8 +162,8 @@
|
|||||||
<el-table-column :label="$t('签收网点')" align="center" prop="signSite" min-width="100" />
|
<el-table-column :label="$t('签收网点')" align="center" prop="signSite" min-width="100" />
|
||||||
<el-table-column :label="$t('客户名称')" align="center" prop="customerName" min-width="150">
|
<el-table-column :label="$t('客户名称')" align="center" prop="customerName" min-width="150">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span class="ellipsis">{{ scope.row.waybillDetail.customerName }}</span>
|
<span class="ellipsis">{{ scope.row.waybillDetail.customerName }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :label="$t('数据产生来源')" align="center" prop="dataFrom" min-width="150">
|
<el-table-column :label="$t('数据产生来源')" align="center" prop="dataFrom" min-width="150">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@ -320,22 +320,7 @@ export default {
|
|||||||
/** 查询扫描记录列表 */
|
/** 查询扫描记录列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
console.log("---->this.queryParams,", this.queryParams);
|
let queryParams = this.initQueryParams();
|
||||||
let queryParams = Object.assign({},this.queryParams);
|
|
||||||
if (null != this.dateTimeRange && '' != this.dateTimeRange) {
|
|
||||||
queryParams.params.beginScanDate = dateToStr(new Date(this.dateTimeRange[0]));
|
|
||||||
queryParams.params.endScanDate = dateToStr(new Date(this.dateTimeRange[1]));
|
|
||||||
}else{
|
|
||||||
queryParams.params.beginScanDate = null;
|
|
||||||
queryParams.params.endScanDate = null;
|
|
||||||
}
|
|
||||||
if(this.queryParams.params.queryOrderType == "1"){
|
|
||||||
queryParams.orderSN=null;
|
|
||||||
}else if(this.queryParams.params.queryOrderType == "0"){
|
|
||||||
queryParams.orderSN=this.queryParams.billCode;
|
|
||||||
queryParams.billCode=null;
|
|
||||||
}
|
|
||||||
queryParams.scanType="50";
|
|
||||||
listEmisTmsScanRecord(queryParams).then(response => {
|
listEmisTmsScanRecord(queryParams).then(response => {
|
||||||
this.tmsScanList = [];
|
this.tmsScanList = [];
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
@ -356,6 +341,24 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
initQueryParams() {
|
||||||
|
let qParam = Object.assign({}, this.queryParams);
|
||||||
|
if (null != this.dateTimeRange && '' != this.dateTimeRange) {
|
||||||
|
qParam.params.beginScanDate = dateToStr(new Date(this.dateTimeRange[0]));
|
||||||
|
qParam.params.endScanDate = dateToStr(new Date(this.dateTimeRange[1]));
|
||||||
|
} else {
|
||||||
|
qParam.params.beginScanDate = null;
|
||||||
|
qParam.params.endScanDate = null;
|
||||||
|
}
|
||||||
|
if (this.queryParams.params.queryOrderType == "1") {
|
||||||
|
qParam.orderSN = null;
|
||||||
|
} else if (this.queryParams.params.queryOrderType == "0") {
|
||||||
|
qParam.orderSN = this.queryParams.billCode;
|
||||||
|
qParam.billCode = null;
|
||||||
|
}
|
||||||
|
qParam.scanType = "50";
|
||||||
|
return qParam;
|
||||||
|
},
|
||||||
onStaffSelect(item){
|
onStaffSelect(item){
|
||||||
this.form.dispatchOrSendMan=item.empName || this.$store.getters.empName;
|
this.form.dispatchOrSendMan=item.empName || this.$store.getters.empName;
|
||||||
this.form.dispatchOrSendManCode=item.empCode || this.$store.getters.empCode;
|
this.form.dispatchOrSendManCode=item.empCode || this.$store.getters.empCode;
|
||||||
@ -440,25 +443,12 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
const loadingInstance = this.$loading({
|
const loadingInstance = this.$loading({
|
||||||
text: '正在导出...'
|
text: '正在导出...'
|
||||||
})
|
})
|
||||||
let queryParams = Object.assign({},this.queryParams);
|
let queryParams = this.initQueryParams();
|
||||||
queryParams.pageNum=1;
|
queryParams.pageNum = 1;
|
||||||
queryParams.pageSize=5000;
|
queryParams.pageSize = 5000;
|
||||||
if (null != this.dateTimeRange && '' != this.dateTimeRange) {
|
|
||||||
queryParams.params.beginSignDate = this.dateTimeRange[0];
|
|
||||||
queryParams.params.endSignDate = this.dateTimeRange[1];
|
|
||||||
}else{
|
|
||||||
queryParams.params.beginSignDate = null;
|
|
||||||
queryParams.params.endSignDate = null;
|
|
||||||
}
|
|
||||||
if(this.queryParams.params.queryOrderType == "1"){
|
|
||||||
queryParams.orderSN=null;
|
|
||||||
}else if(this.queryParams.params.queryOrderType == "0"){
|
|
||||||
queryParams.orderSN=this.queryParams.billCode;
|
|
||||||
queryParams.billCode=null;
|
|
||||||
}
|
|
||||||
listEmisTmsScanRecord(queryParams).then(response => {
|
listEmisTmsScanRecord(queryParams).then(response => {
|
||||||
this.downloadLoading = false
|
this.downloadLoading = false
|
||||||
let rows = response.rows;
|
let rows = response.rows;
|
||||||
@ -467,40 +457,27 @@ export default {
|
|||||||
this.$modal.msgError("未查到单号");
|
this.$modal.msgError("未查到单号");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// for (let index = 0; index < rows.length; index++) {
|
|
||||||
// let scanRstItem = rows[index];
|
|
||||||
// console.log(scanRstItem);
|
|
||||||
// let record =Object.assign({}, scanRstItem)
|
|
||||||
// record.queryType = this.queryParams.queryType;
|
|
||||||
// record.scanSiteName = this.queryParams.scanSiteName || record.scanSiteName;
|
|
||||||
// record.preOrNextStation = this.queryParams.preOrNextStation || scanRstItem.preOrNextStation;
|
|
||||||
// this.tmsScanList.push(record);
|
|
||||||
// }
|
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
const curList = []
|
this.exportData(rows,loadingInstance);
|
||||||
for (let index = 0; index < response.rows.length; index++) {
|
|
||||||
let scanRstItem = response.rows[index];
|
|
||||||
let record =Object.assign({}, scanRstItem)
|
|
||||||
record.orderType = this.queryParams.orderType;
|
|
||||||
record.scanSiteName = this.queryParams.scanSiteName || record.scanSiteName;
|
|
||||||
record.preOrNextStation = this.queryParams.preOrNextStation || scanRstItem.preOrNextStation;
|
|
||||||
curList.push(record);
|
|
||||||
}
|
|
||||||
import('@/vendor/Export2Excel').then(excel => {
|
|
||||||
const tHeader = ['id','单号','单号类型','车牌号','扫描时间','扫描类型','扫描网点','上/下一网点','扫描员','录入时间','扫描重量'];
|
|
||||||
const filterVal = ['id','billCode','orderType','carNo','scanDate','scanType','scanSite','preOrNextStation','scanMan','createTime','scanWeight'];
|
|
||||||
const data = this.formatJson(filterVal, curList, curList)
|
|
||||||
excel.export_json_to_excel({
|
|
||||||
header: tHeader,
|
|
||||||
data,
|
|
||||||
filename: '签收记录',
|
|
||||||
autoWidth: true
|
|
||||||
})
|
|
||||||
loadingInstance.close()
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
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) {
|
formatJson(filterVal, jsonData, resData) {
|
||||||
let index = 0
|
let index = 0
|
||||||
return jsonData.map(v => filterVal.map(j => {
|
return jsonData.map(v => filterVal.map(j => {
|
||||||
@ -508,18 +485,50 @@ export default {
|
|||||||
return ++index
|
return ++index
|
||||||
}
|
}
|
||||||
if (j === 'status') {
|
if (j === 'status') {
|
||||||
var statusStr='xxx'
|
return '已签收';
|
||||||
if(v[j] == 10){
|
}
|
||||||
statusStr='xxx'
|
if (j === 'sendDate') {
|
||||||
}
|
//formatJson
|
||||||
return statusStr;
|
return v['waybillDetail']?.[j]||'';
|
||||||
|
}
|
||||||
|
//waybillDetail.estimateDate
|
||||||
|
if (j === 'estimateDate') {
|
||||||
|
return v['waybillDetail']?.[j]||'';
|
||||||
|
}
|
||||||
|
//waybillDetail.transLineTypeName
|
||||||
|
if (j === 'transLineTypeName') {
|
||||||
|
return v['waybillDetail']?.[j]||'';
|
||||||
|
}
|
||||||
|
//paymentType
|
||||||
|
if (j === 'paymentType') {
|
||||||
|
return this.selectDictLabel(this.dict.type.emis_payment_type,v['waybillDetail'][j]);
|
||||||
|
}
|
||||||
|
//waybillDetail.timeType
|
||||||
|
if (j === 'timeType') {
|
||||||
|
return v['waybillDetail']?.[j]||'';
|
||||||
|
}
|
||||||
|
//waybillDetail.customerName
|
||||||
|
if (j === 'customerName') {
|
||||||
|
return v['waybillDetail']?.[j]||'';
|
||||||
|
}
|
||||||
|
//waybillDetail.receiveCountryName
|
||||||
|
if (j === 'waybillDetail.receiveCountryName') {
|
||||||
|
return v['waybillDetail']?.['receiveCountryName']||'';
|
||||||
|
}
|
||||||
|
// waybillDetail.receiveProvinceName
|
||||||
|
if (j === 'waybillDetail.receiveProvinceName') {
|
||||||
|
return v['waybillDetail']?.['receiveProvinceName']||'';
|
||||||
|
}
|
||||||
|
//waybillDetail.productTypeName
|
||||||
|
if (j === 'productTypeName') {
|
||||||
|
return v['waybillDetail']?.[j]||'';
|
||||||
}
|
}
|
||||||
return v[j]
|
return v[j]
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
/** 列索引函数 */
|
/** 列索引函数 */
|
||||||
getIndex($index) {
|
getIndex($index) {
|
||||||
return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + $index + 1
|
return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + $index + 1
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -527,26 +536,26 @@ export default {
|
|||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.el-divider{
|
.el-divider{
|
||||||
margin-top: 0px;
|
margin-top: 0px;
|
||||||
background: 0 0;
|
background: 0 0;
|
||||||
border-top: 1px solid #E6EBF5;
|
border-top: 1px solid #E6EBF5;
|
||||||
}
|
}
|
||||||
.el-divider__text {
|
.el-divider__text {
|
||||||
color: #0955ee;
|
color: #0955ee;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
.query-label {
|
.query-label {
|
||||||
.el-radio{
|
.el-radio{
|
||||||
display: block;
|
display: block;
|
||||||
line-height: 23px;
|
line-height: 23px;
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
}
|
|
||||||
}
|
|
||||||
.ellipsis {
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
vertical-align: top;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
.ellipsis {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
vertical-align: top;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user