报关、清关级别维护
This commit is contained in:
parent
c019283670
commit
452798ebbe
BIN
public/static/tpl/import_customs_level.xlsx
Normal file
BIN
public/static/tpl/import_customs_level.xlsx
Normal file
Binary file not shown.
49
src/api/emis/emisCustomsLevel.js
Normal file
49
src/api/emis/emisCustomsLevel.js
Normal file
@ -0,0 +1,49 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询报关等级列表
|
||||
export function listCustomsLevel(query) {
|
||||
return request({
|
||||
url: '/emis/emisCustomsLevel/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询报关等级详细
|
||||
export function getCustomsLevel(id) {
|
||||
return request({
|
||||
url: '/emis/emisCustomsLevel/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 新增报关等级
|
||||
export function addCustomsLevel(data) {
|
||||
return request({
|
||||
url: '/emis/emisCustomsLevel',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 修改报关等级
|
||||
export function updateCustomsLevel(data) {
|
||||
return request({
|
||||
url: '/emis/emisCustomsLevel',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 批量删除报关等级
|
||||
export function delCustomsLevel(ids) {
|
||||
return request({
|
||||
url: '/emis/emisCustomsLevel/' + ids,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
// 导入报关等级
|
||||
export function draftSubmitLevel(data) {
|
||||
return request({
|
||||
url: '/emis/emisCustomsLevel/draftSubmitLevel',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
403
src/views/emis/emisCustomsLevel/draftSubmitLevel.vue
Normal file
403
src/views/emis/emisCustomsLevel/draftSubmitLevel.vue
Normal file
@ -0,0 +1,403 @@
|
||||
<template>
|
||||
<XdPageContainer class="app-container">
|
||||
<div slot="pageHeader"></div>
|
||||
<XdTable
|
||||
slot="pageContent"
|
||||
slot-scope="slotProps"
|
||||
:height="(slotProps.contentHeight)+'px'"
|
||||
storageName="batchWaybillRecord_main"
|
||||
|
||||
ref="multipleTable"
|
||||
:row-class-name="tableRowClassName"
|
||||
v-loading="loading"
|
||||
border
|
||||
size="mini"
|
||||
:data="tableData"
|
||||
: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-button plain class="filter-item" size="mini" type="primary" icon="el-icon-upload2" @click="handleBatchImport">选择文件</el-button>
|
||||
<el-link type="primary" style="line-height: 28px;font-size:13px;color:blue" href="/static/tpl/imp_trans_quote.xlsx">下载导入Excel模板</el-link>
|
||||
</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="left" prop="customerName" width="120" :show-overflow-tooltip="true" >
|
||||
<template slot-scope="scope">
|
||||
<div class="link-type" @click="handleUpdate(scope.row)">{{scope.row.customerName}}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('类别')" align="center" prop="category" min-width="100" >
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('报关/清关')" align="left" prop="bizType" width="120" :show-overflow-tooltip="true">
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('开始时间')" align="center" prop="startDate" width="100" />
|
||||
<el-table-column :label="$t('结束时间')" align="center" prop="endDate" min-width="100" />
|
||||
<el-table-column :label="$t('创建人')" align="left" prop="createByName" min-width="100" />
|
||||
<el-table-column :label="$t('创建时间')" align="left" prop="createTime" min-width="100" :show-overflow-tooltip="true"/>
|
||||
<el-table-column :label="$t('修改人')" align="left" prop="updateByName" min-width="130" :show-overflow-tooltip="true" >
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('修改时间')" align="center" prop="updateTime" min-width="150" />
|
||||
</XdTable>
|
||||
|
||||
<el-dialog title="上传文件" :visible.sync="openUploadForm" width="50%" v-dialogDrag :destroy-on-close="true" :close-on-click-modal="false" append-to-body>
|
||||
<el-row :gutter="0">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="选择文件" prop="uploadFile" >
|
||||
<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_customs_level.xlsx">下载导入Excel模板</el-link>
|
||||
<div v-if="uploadExcelDataInfo !=''" style="color: black;font-size: 12px;font-weight: 800;">{{ fileName }} {{ uploadExcelDataInfo }}</div>
|
||||
</el-upload>
|
||||
<el-alert
|
||||
title="注意"
|
||||
type="info"
|
||||
description="仅允许导入“xls”或“xlsx”格式文件!"
|
||||
close-text="知道了">
|
||||
</el-alert>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="batchImpDataForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</XdPageContainer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { draftSubmitLevel } from "@/api/emis/emisCustomsLevel";
|
||||
import {timeDiffTime,excelDateToJSDate } from '@/utils/dateUtils'
|
||||
import XLSX from 'xlsx'
|
||||
|
||||
export default {
|
||||
name: "BatchWaybillRecord",
|
||||
data() {
|
||||
return {
|
||||
resetRefreshId:null,
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 报价列表表格数据
|
||||
tableData: [],
|
||||
tmpDataList: [],
|
||||
selectionList:[],
|
||||
selectionIndexList: [],
|
||||
form:{},
|
||||
rules:{},
|
||||
|
||||
openUploadForm:false,
|
||||
uploadMsg:"",
|
||||
uploadExcelDataInfo:"",
|
||||
fileName:"",
|
||||
fileList:[],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 20
|
||||
},
|
||||
};
|
||||
},
|
||||
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)
|
||||
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.tableData = [];
|
||||
this.tmpDataList = [];
|
||||
// 组装提交的数据
|
||||
for (let index = 0; index < results.length; index++) {
|
||||
const element = results[index]
|
||||
let dataItem = {
|
||||
customerName: element['客户名称'],
|
||||
category: element['类别'],
|
||||
bizType: element['报关/清关'],
|
||||
startDate: element['开始时间'],
|
||||
endDate: element['结束时间'],
|
||||
uploadStatus:0,
|
||||
errorInfo:"",
|
||||
}
|
||||
//转时间格式
|
||||
if(dataItem.startDate){
|
||||
dataItem.startDate=excelDateToJSDate(dataItem.startDate)
|
||||
}
|
||||
if(dataItem.endDate){
|
||||
dataItem.endDate=excelDateToJSDate(dataItem.endDate)
|
||||
}
|
||||
this.tmpDataList.push(dataItem);
|
||||
}
|
||||
this.uploadExcelDataInfo="总共 " + this.tmpDataList.length +" 条数据。";
|
||||
loadingInstance.close()
|
||||
|
||||
},
|
||||
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 dataItem=this.selectionList[i];
|
||||
let res=await draftSubmitLevel({...dataItem,quoteType:1})
|
||||
|
||||
let rstData=res.data;
|
||||
if(rstData.result=='success'){
|
||||
dataItem.uploadStatus=1;
|
||||
dataItem.errorInfo="上传成功";
|
||||
}
|
||||
else{
|
||||
dataItem.uploadStatus=-1;
|
||||
dataItem.errorInfo=rstData.msg;
|
||||
}
|
||||
|
||||
}
|
||||
this.$modal.msgSuccess("上传成功");
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
batchImpDataForm() {
|
||||
// 判断是否有数据
|
||||
if(this.tmpDataList.length==0){
|
||||
this.$modal.msgError('表格中没有数据');
|
||||
return;
|
||||
}
|
||||
|
||||
this.tableData = this.tableData.concat(this.tmpDataList);
|
||||
|
||||
this.tmpDataList=[];
|
||||
|
||||
this.openUploadForm = false;
|
||||
|
||||
|
||||
|
||||
},
|
||||
// 多选框选中数据
|
||||
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.tableData.forEach((v,i)=>{
|
||||
if(item.index === v.index){
|
||||
that.tableData.splice(i,1)
|
||||
}
|
||||
})
|
||||
})
|
||||
that.$refs.multipleTable.clearSelection();
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
}
|
||||
};
|
||||
</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>
|
||||
186
src/views/emis/emisCustomsLevel/levelForm.vue
Normal file
186
src/views/emis/emisCustomsLevel/levelForm.vue
Normal file
@ -0,0 +1,186 @@
|
||||
<template>
|
||||
<div >
|
||||
<el-form ref="form" size="mini" :model="form" :rules="rules" label-width="120px">
|
||||
<el-row :gutter="0" style="display: flex;flex-wrap: wrap;">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="客户名称" prop="customerName">
|
||||
<el-input v-model="form.customerName" placeholder="" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报关/清关等级" prop="bizType">
|
||||
<el-select v-model="form.bizType" placeholder="请选择" style="width: 100%;">
|
||||
<el-option label="报关" value="1"></el-option>
|
||||
<el-option label="清关" value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="级别" prop="category">
|
||||
<el-select v-model="form.category" style="width: 100%;" clearable :placeholder="$t('类别')">
|
||||
<el-option
|
||||
v-for="dict in dict.type.emis_customs_level"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12"></el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="开始时间" prop="startDate">
|
||||
<el-date-picker
|
||||
style="width: 100%;"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="yyyy-MM-dd"
|
||||
v-model="form.startDate"
|
||||
type="date"
|
||||
placeholder="开始时间"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="结束时间" prop="endDate">
|
||||
<el-date-picker
|
||||
style="width: 100%;"
|
||||
format="yyyy-MM-dd"
|
||||
value-format="yyyy-MM-dd"
|
||||
v-model="form.endDate"
|
||||
type="date"
|
||||
placeholder="结束时间"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<div style="text-align: center;margin-bottom: 10px;">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getCustomsLevel, addCustomsLevel, updateCustomsLevel } from "@/api/emis/emisCustomsLevel";
|
||||
|
||||
export default {
|
||||
name: "LevelForm",
|
||||
props:{
|
||||
id:{
|
||||
type:[Number,Array]
|
||||
},
|
||||
customerType:{
|
||||
type:[Number,String],
|
||||
required: true
|
||||
}
|
||||
},
|
||||
components: {},
|
||||
dicts: ['emis_customs_level'],
|
||||
data() {
|
||||
return {
|
||||
openSiteSelectTreeForm:false,
|
||||
emisCustomerUserOptions: [],
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
customerName: [
|
||||
{ required: true, message: "客户名称不能为空", trigger: "blur" },
|
||||
{ pattern: /^[a-zA-Z0-9\u4e00-\u9fa5]+$/, message: "客户名称不能有空格和特殊字符", trigger: "blur" }
|
||||
],
|
||||
startDate: [
|
||||
{ required: true, message: "开始时间不能为空", trigger: "blur" }
|
||||
],
|
||||
endDate: [
|
||||
{ required: true, message: "结束时间不能为空", trigger: "blur" }
|
||||
],
|
||||
bizType: [
|
||||
{ required: true, message: "报关/清关等级不能为空", trigger: "blur" }
|
||||
],
|
||||
category: [
|
||||
{ required: true, message: "级别不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
"id": {
|
||||
handler (newValue, oldValue) {
|
||||
this.id = newValue;
|
||||
this.initData();
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData();
|
||||
},
|
||||
|
||||
methods: {
|
||||
initData() {
|
||||
if(this.id !=null) {
|
||||
this.loading = true;
|
||||
getCustomsLevel(this.id).then(response => {
|
||||
this.form = response.data;
|
||||
this.loading = false;
|
||||
});
|
||||
}else{
|
||||
this.reset();
|
||||
}
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.reset();
|
||||
this.$emit("on-cancel");
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
customerName: null,
|
||||
startDate: null,
|
||||
endDate: null,
|
||||
remark: null,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
this.form.company=this.form.customerName;
|
||||
updateCustomsLevel(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.$emit("on-changed");
|
||||
});
|
||||
} else {
|
||||
addCustomsLevel(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.$emit("on-changed");
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
// .el-row{
|
||||
// display:flex;
|
||||
// flex-wrap: wrap;
|
||||
// }
|
||||
|
||||
// .el-col{
|
||||
// min-height: 1px;
|
||||
// }
|
||||
|
||||
</style>
|
||||
353
src/views/emis/emisCustomsLevel/list.vue
Normal file
353
src/views/emis/emisCustomsLevel/list.vue
Normal file
@ -0,0 +1,353 @@
|
||||
<template>
|
||||
<XdPageContainer class="app-container">
|
||||
<SearchForm slot="pageHeader" :model="queryParams" ref="queryForm" size="mini" :maxShow="10" label-width="80px" v-show="showSearch" @search="handleQuery" @reset="resetQuery">
|
||||
<el-form-item label="客户名称" prop="customerName">
|
||||
<el-input
|
||||
v-model="queryParams.customerName"
|
||||
:placeholder="$t('客户名称')"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('类别')" prop="category">
|
||||
<el-select v-model="queryParams.category" clearable :placeholder="$t('类别')" @change="handleQuery">
|
||||
<el-option
|
||||
v-for="dict in dict.type.emis_customs_level"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('报关/清关')" prop="bizType">
|
||||
<el-select v-model="queryParams.bizType" clearable :placeholder="$t('报关/清关')" @change="handleQuery">
|
||||
<el-option label="报关" value="1"></el-option>
|
||||
<el-option label="清关" value="2"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('创建人')" prop="createByName">
|
||||
<el-input
|
||||
v-model="queryParams.createByName"
|
||||
:placeholder="$t('创建人')"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
</SearchForm>
|
||||
|
||||
<XdTable
|
||||
slot="pageContent"
|
||||
slot-scope="slotProps"
|
||||
:height="(slotProps.contentHeight)+'px'"
|
||||
|
||||
v-loading="loading"
|
||||
border
|
||||
size="small"
|
||||
storageName="emisCustomerLevelList_money"
|
||||
:data="emisCustomerlevelList"
|
||||
:tbData="emisCustomerlevelList"
|
||||
: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-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['emis:emisCustomsLevel:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-upload"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
v-hasPermi="['emis:emisCustomsLevel:draftSubmitLevel']"
|
||||
>批量导入</el-button>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
@click="handleUpdate"
|
||||
:disabled="single"
|
||||
v-hasPermi="['emis:emisCustomsLevel:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['emis:emisCustomsLevel:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column :label="$t('客户名称')" align="left" prop="customerName" width="120" :show-overflow-tooltip="true" >
|
||||
<template slot-scope="scope">
|
||||
<div class="link-type" @click="handleUpdate(scope.row)">{{scope.row.customerName}}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('类别')" align="center" prop="category" min-width="100" >
|
||||
<template slot-scope="scope">
|
||||
<el-tag type="success" v-if="scope.row.category == '1'">绿色</el-tag>
|
||||
<el-tag type="warning" v-else-if="scope.row.category == '2'">黄色</el-tag>
|
||||
<el-tag type="danger" v-else-if="scope.row.category == '3'">红色</el-tag>
|
||||
<el-tag type="info" v-else-if="scope.row.category == '4'">黑色</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('报关/清关')" align="left" prop="bizType" width="120" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.bizType == '1'">报关</span>
|
||||
<span v-else-if="scope.row.bizType == '2'">清关</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('开始时间')" align="center" prop="startDate" width="100" />
|
||||
<el-table-column :label="$t('结束时间')" align="center" prop="endDate" min-width="100" />
|
||||
<el-table-column :label="$t('创建人')" align="left" prop="createByName" min-width="100" />
|
||||
<el-table-column :label="$t('创建时间')" align="left" prop="createTime" min-width="100" :show-overflow-tooltip="true"/>
|
||||
<el-table-column :label="$t('修改人')" align="left" prop="updateByName" min-width="130" :show-overflow-tooltip="true" >
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('修改时间')" align="center" prop="updateTime" min-width="150" />
|
||||
</XdTable>
|
||||
|
||||
<el-dialog :title="titleForm" :visible.sync="openForm" width="60%" :destroy-on-close="true" :close-on-click-modal="false" v-dialogDrag append-to-body>
|
||||
<levelForm :id="currentId" customerType="1" @on-changed="handleFormChanged" @on-cancel="cancelForm"></levelForm>
|
||||
</el-dialog>
|
||||
|
||||
</XdPageContainer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import { listCustomsLevel, delCustomsLevel, deleteCustomsLevel } from "@/api/emis/emisCustomsLevel";
|
||||
import levelForm from '@/views/emis/emisCustomsLevel/levelForm.vue';
|
||||
|
||||
export default {
|
||||
name: "List",
|
||||
components: { levelForm
|
||||
},
|
||||
dicts: [ 'emis_customs_level'
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 创建时间搜索
|
||||
dateTimeRange:[],
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 快递客户用户表格数据
|
||||
emisCustomerlevelList: [],
|
||||
|
||||
currentId:null,
|
||||
openForm: false,
|
||||
titleForm: "",
|
||||
|
||||
// 弹出展示层
|
||||
id:null,
|
||||
titleView:"",
|
||||
openView: false,
|
||||
// 修改站点代码时间范围
|
||||
daterangeCreateTime: [],
|
||||
// 修改站点代码时间范围
|
||||
daterangeUpdateTime: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
customerName: null,
|
||||
phone: null,
|
||||
company: null,
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询快递客户用户列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.queryParams.params = {};
|
||||
listCustomsLevel(this.queryParams).then(response => {
|
||||
this.emisCustomerlevelList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(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();
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd(row) {
|
||||
this.currentId=null;
|
||||
this.openForm= true;
|
||||
this.titleForm = "报关/清关等级";
|
||||
},
|
||||
handleShowMoreInput(){
|
||||
this.moreInputVisible = !this.moreInputVisible;
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.currentId= row.id || this.ids[0];
|
||||
this.openForm = true;
|
||||
this.titleForm = "报关/清关等级";
|
||||
},
|
||||
/** 重置密码按钮操作 */
|
||||
handleResetPwd(row) {
|
||||
const id= row.id || this.ids[0];
|
||||
|
||||
this.$confirm('密码将重置为初始密码:888888 吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
resetCustomerUserPwd(id,'888888').then(response => {
|
||||
this.$modal.msgSuccess("重置成功");
|
||||
});
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
handleView(row) {
|
||||
this.id=row.id;
|
||||
this.titleView="查看";
|
||||
this.openView=true;
|
||||
// this.router.push({ path: '/emis/emisCustomerUser/viewDetail', query: { id: row.id }})
|
||||
},
|
||||
handleFormChanged(){
|
||||
this.openForm = false;
|
||||
this.getList();
|
||||
},
|
||||
cancelForm(){
|
||||
this.openForm = false;
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除').then(function() {
|
||||
return delCustomsLevel(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// this.download('emis/emisCustomerUser/export', {
|
||||
// ...this.queryParams
|
||||
// }, `emisCustomerUser_${new Date().getTime()}.xlsx`)
|
||||
const loadingInstance = this.$loading({
|
||||
text: '正在导出...'
|
||||
})
|
||||
var qParam = {...this.queryParams};
|
||||
qParam.pageNum=1;
|
||||
qParam.pageSize=5000;
|
||||
|
||||
listEmisCustomerUser(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','头像','性别','邀请人','最后登录ip','最后登录日期','称呼','union_id','wxopenid','主月结卡号','登录账号','登录密码','归属站点','国家','省份','城市','区县','镇','地址','email','发件国','发件省','发件区','发件区','发件镇','邮编','启用状态','真实姓名','身份证号','回款联系人','销售联系人','是否开通oms','是否短信','专属业务员','排序','备注','删除标志(0代表存在','创建者','创建时间','更新者','更新时间','创建网点','修改站点代码',];
|
||||
const filterVal = ['id','customerCode','customerName','customerNameEn','phone','mobile','customerType','settledType','userType','company','deptId','avatar','sex','invitationInfo','loginIp','loginDate','nickName','unionId','openid','monthlyPayCode','userName','password','ownerSite','country','province','city','county','town','address','email','sendCountry','sendProvince','sendCity','sendCounty','sendTown','postCode','status','realName','idNo','payee','salesmen','blOpenOms','blSms','opEmpCode','orderNum','remark','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()
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
formatJson(filterVal, jsonData, resData) {
|
||||
let index = 0
|
||||
return jsonData.map(v => filterVal.map(j => {
|
||||
if (j === 'index') {
|
||||
return ++index
|
||||
}
|
||||
if (j === 'status') {
|
||||
var statusStr='xxx'
|
||||
if(v[j] == 10){
|
||||
statusStr='xxx'
|
||||
}
|
||||
return statusStr;
|
||||
}
|
||||
return v[j]
|
||||
}))
|
||||
},
|
||||
/** 列索引函数 */
|
||||
getIndex($index) {
|
||||
return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + $index + 1
|
||||
},
|
||||
/** 时间搜索响应函数 */
|
||||
dateTimeChange(value){
|
||||
this.dateTimeRange=value;
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-divider{
|
||||
margin-top: 0px;
|
||||
background: 0 0;
|
||||
border-top: 1px solid #E6EBF5;
|
||||
}
|
||||
.el-divider__text {
|
||||
color: #0955ee;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue
Block a user