376 lines
12 KiB
Vue
376 lines
12 KiB
Vue
<template>
|
|
<XdPageContainer class="app-container">
|
|
<SearchForm slot="pageHeader" :model="queryParams" ref="queryForm" size="small" :maxShow="3" label-width="68px" v-show="showSearch" @search="handleQuery" @reset="resetQuery">
|
|
|
|
<el-form-item :label="$t('起始网点')" prop="startSiteCode">
|
|
<EmisSiteSimplePicker1 v-model="queryParams.startSiteCode" ></EmisSiteSimplePicker1>
|
|
</el-form-item>
|
|
<el-form-item label="下一网点" prop="nextSiteCode">
|
|
<EmisSiteSimplePicker1 v-model="queryParams.nextSiteCode" ></EmisSiteSimplePicker1>
|
|
</el-form-item>
|
|
<!-- <el-form-item label="" prop="feeType">
|
|
<el-input
|
|
v-model="queryParams.feeType"
|
|
:placeholder="$t('费用类型')"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item> -->
|
|
<!-- <el-form-item label="" prop="price">
|
|
<el-input
|
|
v-model="queryParams.price"
|
|
:placeholder="$t('计费单价')"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item> -->
|
|
<!-- <el-form-item label="" prop="currency">
|
|
<el-input
|
|
v-model="queryParams.currency"
|
|
:placeholder="$t('费用币种')"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item> -->
|
|
<!-- <el-form-item label="" prop="billType">
|
|
<el-input
|
|
v-model="queryParams.billType"
|
|
:placeholder="$t('计费类型')"
|
|
clearable
|
|
@keyup.enter.native="handleQuery"
|
|
/>
|
|
</el-form-item> -->
|
|
<el-form-item label="供应商" prop="supplierCode">
|
|
<EmisSupplierPicker :placeholder="$t('请选择')" v-model="queryParams.supplierCode" ></EmisSupplierPicker>
|
|
</el-form-item>
|
|
<!-- <el-form-item label="" prop="startDate">
|
|
<el-date-picker clearable
|
|
v-model="queryParams.startDate"
|
|
type="date"
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
:placeholder="$t('开始日期')">
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
<el-form-item label="" prop="endDate">
|
|
<el-date-picker clearable
|
|
v-model="queryParams.endDate"
|
|
type="date"
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
:placeholder="$t('结束日期')">
|
|
</el-date-picker>
|
|
</el-form-item> -->
|
|
</SearchForm>
|
|
|
|
|
|
<XdTable
|
|
slot="pageContent"
|
|
slot-scope="slotProps"
|
|
:height="(slotProps.contentHeight)+'px'"
|
|
|
|
|
|
v-loading="loading"
|
|
|
|
ref="refTable"
|
|
storageName="BigBatchPanel_main_241116"
|
|
|
|
border stripe
|
|
size="small"
|
|
:data="emisTmsCostQuotePriceList"
|
|
: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-plus"
|
|
size="mini"
|
|
@click="handleAdd"
|
|
v-hasPermi="['emis:emisTmsCostQuotePrice:add']"
|
|
>新增短驳费</el-button>
|
|
</el-col>
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
type="success"
|
|
plain
|
|
icon="el-icon-edit"
|
|
size="mini"
|
|
:disabled="single"
|
|
@click="handleUpdate"
|
|
v-hasPermi="['emis:emisTmsCostQuotePrice: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:emisTmsCostQuotePrice:remove']"
|
|
>删除</el-button>
|
|
</el-col>
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
type="warning"
|
|
plain
|
|
icon="el-icon-download"
|
|
size="mini"
|
|
@click="handleExport"
|
|
v-hasPermi="['emis:emisTmsCostQuotePrice:export']"
|
|
>导出</el-button>
|
|
</el-col>
|
|
</el-row>
|
|
</div>
|
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
|
<el-table-column :label="$t('起始网点')" align="center" prop="startSiteName" min-width="100" />
|
|
<el-table-column :label="$t('下一网点')" align="center" prop="nextSiteName" min-width="100" />
|
|
<el-table-column :label="$t('网点距离(公里)')" align="center" prop="distance" min-width="100" />
|
|
<el-table-column :label="$t('费用类型')" align="center" prop="feeType" min-width="100" >
|
|
<template>
|
|
<span>短驳费</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column :label="$t('单价(元/公里)')" align="center" prop="price" min-width="100" />
|
|
<!-- <el-table-column :label="$t('费用币种')" align="center" prop="currency" min-width="100" /> -->
|
|
<el-table-column :label="$t('计费类型')" align="center" prop="billType" min-width="100" >
|
|
<template>
|
|
<span>按公斤</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column :label="$t('供应商代码')" align="center" prop="supplierName" min-width="100" />
|
|
<el-table-column :label="$t('开始日期')" align="center" prop="startDate" min-width="100" />
|
|
<el-table-column :label="$t('结束日期')" align="center" prop="endDate" min-width="100" />
|
|
<el-table-column :label="$t('备注')" align="center" prop="remark" min-width="100" />
|
|
|
|
</XdTable>
|
|
|
|
<el-dialog :title="titleForm" :visible.sync="openForm" width="50%" :destroy-on-close="true" v-dialogDrag append-to-body>
|
|
<emisTmsCostQuotePriceForm :id="currentId" @on-changed="handleFormChanged" @on-cancel="cancelForm"></EmisTmsCostQuotePriceForm>
|
|
</el-dialog>
|
|
|
|
|
|
</XdPageContainer>
|
|
</template>
|
|
|
|
<script>
|
|
import { listEmisTmsCostQuotePrice, getEmisTmsCostQuotePrice, delEmisTmsCostQuotePrice, addEmisTmsCostQuotePrice, updateEmisTmsCostQuotePrice } from "@/api/emis/emisTmsCostQuotePrice";
|
|
import elDateSimplePicker from '@/components/DatePickerAdv/elDateSimplePicker';
|
|
// import emisTmsCostQuotePriceView from '@/views/emis/emisTmsCostQuotePrice/emisTmsCostQuotePriceView';
|
|
import emisTmsCostQuotePriceForm from '@/views/emis/emisTmsCostQuotePrice/emisTmsCostQuotePriceForm';
|
|
|
|
import EmisSupplierPicker from '@/views/emis/EmisBaseTools/EmisSupplierPicker';
|
|
|
|
import EmisSiteSimplePicker1 from '@/views/emis/EmisBaseTools/EmisSiteSimplePicker.vue';
|
|
import EmisSiteSimplePicker2 from '@/views/emis/EmisBaseTools/EmisSiteSimplePicker.vue';
|
|
|
|
|
|
export default {
|
|
name: "emisTmsCostQuotePrice",
|
|
components: { elDateSimplePicker,emisTmsCostQuotePriceForm,EmisSupplierPicker,EmisSiteSimplePicker1,EmisSiteSimplePicker2 },
|
|
dicts: [
|
|
],
|
|
data() {
|
|
return {
|
|
// 遮罩层
|
|
loading: true,
|
|
// 选中数组
|
|
ids: [],
|
|
// 非单个禁用
|
|
single: true,
|
|
// 非多个禁用
|
|
multiple: true,
|
|
// 显示搜索条件
|
|
showSearch: true,
|
|
// 创建时间搜索
|
|
dateTimeRange:[],
|
|
// 总条数
|
|
total: 0,
|
|
// TMS网点间供应商成本报价表格数据
|
|
emisTmsCostQuotePriceList: [],
|
|
selectList:[],
|
|
|
|
currentId:null,
|
|
openForm: false,
|
|
titleForm: "",
|
|
|
|
// 弹出展示层
|
|
id:null,
|
|
titleView:"",
|
|
openView: false,
|
|
|
|
// 查询参数
|
|
queryParams: {
|
|
pageNum: 1,
|
|
pageSize: 20,
|
|
startSiteCode: null,
|
|
nextSiteCode: null,
|
|
distance: null,
|
|
feeType: null,
|
|
price: null,
|
|
currency: null,
|
|
billType: null,
|
|
supplierCode: null,
|
|
startDate: null,
|
|
endDate: null,
|
|
},
|
|
};
|
|
},
|
|
created() {
|
|
this.getList();
|
|
},
|
|
methods: {
|
|
/** 查询TMS网点间供应商成本报价列表 */
|
|
getList() {
|
|
this.loading = true;
|
|
listEmisTmsCostQuotePrice(this.addDateRange(this.queryParams, this.dateTimeRange)).then(response => {
|
|
this.emisTmsCostQuotePriceList = 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
|
|
this.selectList=selection
|
|
},
|
|
// 排序 查询字段是表格中字段名字 动态取值排序顺序
|
|
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 = "修改短驳费";
|
|
},
|
|
handleView(row) {
|
|
this.id=row.id;
|
|
this.titleView="查看";
|
|
this.openView=true;
|
|
// this.router.push({ path: '/emis/emisTmsCostQuotePrice/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 delEmisTmsCostQuotePrice(ids);
|
|
}).then(() => {
|
|
this.getList();
|
|
this.$modal.msgSuccess("删除成功");
|
|
}).catch(() => {});
|
|
},
|
|
/** 导出按钮操作 */
|
|
handleExport() {
|
|
const loadingInstance = this.$loading({
|
|
text: '正在导出...'
|
|
})
|
|
|
|
if(this.selectList&&this.selectList.length>0){
|
|
this.exportData(this.selectList,loadingInstance);
|
|
}
|
|
else{
|
|
let qExportParam={...this.queryParams};
|
|
qExportParam=this.addDateRange(qExportParam, this.dateTimeRange,'createTime')
|
|
qExportParam.pageNum=1;
|
|
qExportParam.pageSize=20000;
|
|
|
|
listEmisTmsCostQuotePrice(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
|
|
return jsonData.map(v => filterVal.map(j => {
|
|
|
|
if (j === 'index') {
|
|
return ++index
|
|
}
|
|
|
|
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>
|