530 lines
20 KiB
Vue
530 lines
20 KiB
Vue
<template>
|
||
<XdPageContainer class="app-container">
|
||
<!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> -->
|
||
<SearchForm slot="pageHeader" :model="queryParams" ref="queryForm" size="small" :maxShow="20" label-width="68px" v-show="showSearch" @search="handleQuery" @reset="resetQuery">
|
||
|
||
<el-form-item label="报价名称" prop="quoteName" span="8">
|
||
<el-input
|
||
v-model="queryParams.quoteName"
|
||
placeholder="报价名称"
|
||
clearable
|
||
@keyup.enter.native="handleQuery"
|
||
@input="handleQuery"
|
||
/>
|
||
</el-form-item>
|
||
<el-form-item label="月结客户" prop="custNo">
|
||
<EmisMonthpayAccountPicker v-model="queryParams.custNo"></EmisMonthpayAccountPicker>
|
||
</el-form-item>
|
||
<el-form-item label="线路" prop="transLineCode">
|
||
<TransLinePicker v-model="queryParams.transLineCode" isInitiated="true" @onChange="handleQuery"></TransLinePicker>
|
||
</el-form-item>
|
||
<el-form-item label="产品类型" prop="prodCode">
|
||
<TransProductPicker placeholder="产品类型" v-model="queryParams.prodCode" :transLineCode="queryParams.transLineCode" @onChange="handleQuery"></TransProductPicker>
|
||
</el-form-item>
|
||
<el-form-item label="使用网点" prop="useSiteCode">
|
||
<EmisSiteSimplePicker0 v-if="ownerSiteCode == 88888" v-model="queryParams.useSiteCode" :placeholder="$t('使用网点')" siteType="1" isInitiated="true" :disabled="false" ></EmisSiteSimplePicker0>
|
||
</el-form-item>
|
||
<el-form-item :label="$t('寄件网点')" prop="sendAreaSiteCode">
|
||
<EmisSiteSimplePicker1 v-model="queryParams.sendAreaSiteCode" :placeholder="$t('寄件网点')" isInitiated="true" :disabled="false" @onChange="handleQuery"></EmisSiteSimplePicker1>
|
||
</el-form-item>
|
||
<el-form-item :label="$t('派件区域')" prop="dispAreaName">
|
||
<el-input
|
||
v-model="queryParams.dispAreaName"
|
||
:placeholder="$t('派件区域')"
|
||
clearable
|
||
@keyup.enter.native="handleQuery"
|
||
@input="handleQuery"
|
||
/>
|
||
<!-- <EmisSiteSimplePicker v-model="queryParams.dispAreaSite" :placeholder="$t('派件区域')" isInitiated="true" :disabled="false" ></EmisSiteSimplePicker> -->
|
||
</el-form-item>
|
||
<!-- <el-form-item label="费用类型" prop="feeType">
|
||
<el-select v-model="queryParams.feeType" placeholder="费用类型" clearable @keyup.enter.native="handleQuery">
|
||
<el-option
|
||
v-for="dict in dict.type.emis_fee_type"
|
||
:key="dict.value"
|
||
:label="dict.label"
|
||
:value="dict.value"
|
||
/>
|
||
</el-select>
|
||
</el-form-item> -->
|
||
|
||
<el-form-item label="报价状态" prop="quoteStatus">
|
||
<el-select v-model="queryParams.params.quoteStatus" placeholder="报价状态" clearable @change="handleQuery">
|
||
<el-option key="1" label="启用" :value="1"/>
|
||
<el-option key="2" label="停用" :value="2"/>
|
||
<el-option key="3" label="过期" :value="3"/>
|
||
<el-option key="4" label="启用且未过期的报价" :value="4"/>
|
||
</el-select>
|
||
</el-form-item>
|
||
<el-form-item :label="$t('开始日期')" prop="startDate" >
|
||
<!-- default-time = "00:00:00"
|
||
value-format="yyyy-MM-dd HH:mm:ss"
|
||
datetime
|
||
-->
|
||
<el-date-picker
|
||
style="width:100%"
|
||
clearable
|
||
v-model="queryParams.startDate"
|
||
type="date"
|
||
value-format="yyyy-MM-dd"
|
||
placeholder="选择开始日期">
|
||
</el-date-picker>
|
||
</el-form-item>
|
||
|
||
</SearchForm>
|
||
|
||
|
||
<XdTable
|
||
|
||
slot="pageContent"
|
||
slot-scope="slotProps"
|
||
:height="(slotProps.contentHeight)+'px'"
|
||
|
||
v-loading="loading"
|
||
border
|
||
stripe
|
||
size="mini"
|
||
:data="emisQuotePriceList"
|
||
:showSearch.sync="showSearch"
|
||
:total="total"
|
||
@queryTable="getList"
|
||
:queryParams="queryParams"
|
||
@selection-change="handleSelectionChange"
|
||
@sort-change="handleSortChange"
|
||
>
|
||
<!-- <el-table v-loading="loading" :data="emisQuotePriceList" @selection-change="handleSelectionChange"> -->
|
||
|
||
<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:emisQuotePrice:add']"
|
||
>新增报价</el-button>
|
||
</el-col>
|
||
<el-col :span="1.5">
|
||
<el-button
|
||
type="warning"
|
||
plain
|
||
size="mini"
|
||
:disabled="single"
|
||
@click="handleCopy"
|
||
v-hasPermi="['emis:emisQuotePrice: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:emisQuotePrice: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:emisQuotePrice: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:emisQuotePrice:export']"
|
||
>导出</el-button>
|
||
</el-col> -->
|
||
</el-row>
|
||
</div>
|
||
|
||
|
||
<el-table-column type="selection" width="55" align="center" />
|
||
<!-- <el-table-column label="序号" align="center" min-width="60">
|
||
<template slot-scope="scope">
|
||
<span v-text="getIndex(scope.$index)"> </span>
|
||
</template>
|
||
</el-table-column> -->
|
||
<!-- <el-table-column label="报价ID" align="center" prop="quoteId" width="80" >
|
||
<template slot-scope="scope">
|
||
<div class="link-type" @click="handleUpdate(scope.row)">{{scope.row.quoteId}}</div>
|
||
</template>
|
||
</el-table-column> -->
|
||
<el-table-column label="报价名称" align="left" prop="quoteName" :show-overflow-tooltip="true" width="350" >
|
||
<template slot-scope="scope">
|
||
<div class="link-type" @click="handleUpdate(scope.row)">
|
||
<span v-if="scope.row.status==1">{{scope.row.quoteName}}</span>
|
||
<span v-else ><span style="text-decoration:line-through;color:gray">{{scope.row.quoteName}}</span>-已停用</span>
|
||
</div>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="费用名称" align="center" prop="feeType" width="100" >
|
||
<template slot-scope="scope">
|
||
<dict-tag :options="dict.type.emis_fee_type" :value="scope.row.feeType"/>
|
||
</template>
|
||
</el-table-column>
|
||
|
||
<el-table-column label="使用网点" align="center" prop="useSiteName" width="100" />
|
||
<el-table-column label="客户名称" align="center" prop="custName" width="160" :show-overflow-tooltip="true" />
|
||
|
||
<el-table-column label="所属线路" align="center" prop="transLine" width="100" />
|
||
<el-table-column label="产品类型" align="center" prop="prodName" width="100" />
|
||
<el-table-column label="最低价格" align="center" prop="leastPrice" width="100" />
|
||
<el-table-column label="取价模式" align="center" prop="priceType" width="100" >
|
||
<template slot-scope="scope">
|
||
<dict-tag :options="dict.type.emis_price_type" :value="scope.row.priceType"/>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="计费模式" align="center" prop="billType" width="100" >
|
||
<template slot-scope="scope">
|
||
<span v-if="scope.row.billType=='1'">重量计费</span>
|
||
<span v-if="scope.row.billType=='2'">体积计费</span>
|
||
<span v-if="scope.row.billType=='3'">一口价</span>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="启用标识" align="center" prop="status" width="100" >
|
||
<template slot-scope="scope">
|
||
<span v-if="scope.row.status==1">启用</span>
|
||
<span v-else>停用</span>
|
||
</template>
|
||
</el-table-column>
|
||
|
||
|
||
<el-table-column label="报价开始" align="center" prop="startDate" width="170" />
|
||
<el-table-column label="报价结束" align="center" prop="endDate" width="170" />
|
||
<el-table-column label="寄件区域" align="center" prop="sendAreaName" min-width="100" />
|
||
<el-table-column label="寄件网点" align="center" prop="sendAreaSite" :show-overflow-tooltip="true" min-width="100" />
|
||
<el-table-column label="派件区域" align="center" prop="dispAreaName" min-width="100" />
|
||
<el-table-column label="派件网点" align="center" prop="dispAreaSite" :show-overflow-tooltip="true" min-width="100" />
|
||
|
||
|
||
<el-table-column label="创建人" align="center" prop="createByName" width="80" :show-overflow-tooltip="true"/>
|
||
<el-table-column label="创建网点" align="center" prop="createSiteName" width="80" :show-overflow-tooltip="true"/>
|
||
<el-table-column label="创建时间" align="center" prop="createTime" width="170"/>
|
||
<el-table-column label="修改人" align="center" prop="updateByName" width="80" :show-overflow-tooltip="true"/>
|
||
<el-table-column label="修改网点" align="center" prop="updateSiteName" width="80" :show-overflow-tooltip="true"/>
|
||
<el-table-column label="修改时间" align="center" prop="updateTime" width="170"/>
|
||
|
||
|
||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||
<template slot-scope="scope">
|
||
<el-button
|
||
size="mini"
|
||
type="text"
|
||
icon="el-icon-edit"
|
||
@click="handleUpdate(scope.row)"
|
||
v-hasPermi="['emis:emisQuotePrice:edit']"
|
||
>修改</el-button>
|
||
<!--
|
||
<el-button
|
||
size="mini"
|
||
type="text"
|
||
icon="el-icon-delete"
|
||
@click="handleDelete(scope.row)"
|
||
v-hasPermi="['emis:emisQuotePrice:remove']"
|
||
>删除</el-button> -->
|
||
</template>
|
||
</el-table-column>
|
||
</XdTable>
|
||
|
||
<el-dialog :title="titleForm" :visible.sync="openForm" width="90%" :destroy-on-close="true" v-dialogDrag append-to-body>
|
||
<vipTransQuotePriceForm :quoteId="currentId" :isCopy="isCopy" :chargeType="chargeType" @on-changed="handleFormChanged" @on-cancel="cancelForm"></vipTransQuotePriceForm>
|
||
</el-dialog>
|
||
|
||
</XdPageContainer>
|
||
</template>
|
||
|
||
<script>
|
||
import { mapGetters } from 'vuex'
|
||
|
||
import { listEmisQuotePrice, getEmisQuotePrice, delEmisQuotePrice, addEmisQuotePrice, updateEmisQuotePrice } from "@/api/emis/emisQuotePrice";
|
||
import elDateSimplePicker from '@/components/DatePickerAdv/elDateSimplePicker';
|
||
import vipTransQuotePriceForm from '@/views/emis/emisQuotePrice/vipTransQuotePriceForm';
|
||
|
||
import CountryPicker from '@/views/emis/EmisBaseTools/CountryPicker.vue';
|
||
import EmisSiteSimplePicker0 from '@/views/emis/EmisBaseTools/EmisSiteSimplePicker.vue';
|
||
import EmisSiteSimplePicker1 from '@/views/emis/EmisBaseTools/EmisSiteSimplePicker.vue';
|
||
|
||
import TransLinePicker from '@/views/emis/EmisBaseTools/TransLinePicker.vue';
|
||
import TransProductPicker from '@/views/emis/EmisBaseTools/TransProductPicker.vue';
|
||
|
||
import EmisMonthpayAccountPicker from '@/views/emis/EmisBaseTools/EmisMonthpayAccountPicker.vue';
|
||
|
||
|
||
export default {
|
||
name: "VipTransQuotePriceList",
|
||
components: { elDateSimplePicker,EmisMonthpayAccountPicker,vipTransQuotePriceForm,CountryPicker,EmisSiteSimplePicker0,EmisSiteSimplePicker1,TransLinePicker,TransProductPicker },
|
||
dicts: [
|
||
'sys_normal_disable','emis_create_area_type','emis_fee_type','emis_price_type'
|
||
],
|
||
data() {
|
||
return {
|
||
// 遮罩层
|
||
loading: true,
|
||
// 选中数组
|
||
ids: [],
|
||
// 非单个禁用
|
||
single: true,
|
||
// 非多个禁用
|
||
multiple: true,
|
||
// 显示搜索条件
|
||
showSearch: true,
|
||
// 创建时间搜索
|
||
dateTimeRange:[],
|
||
// 总条数
|
||
total: 0,
|
||
currentId:null,
|
||
currentQuote:null,
|
||
// 费用报价表格数据
|
||
emisQuotePriceList: [],
|
||
// 弹出层标题
|
||
title: "",
|
||
// 是否显示弹出层
|
||
open: false,
|
||
formulaType:1,
|
||
|
||
chargeType:null,
|
||
|
||
openForm: false,
|
||
titleForm: "",
|
||
isCopy: false,
|
||
|
||
// 显示编辑框更多
|
||
moreInputVisible: false,
|
||
// 弹出展示层
|
||
titleView:"",
|
||
openView: false,
|
||
// 查询参数
|
||
queryParams: {
|
||
pageNum: 1,
|
||
pageSize: 20,
|
||
quoteCode: null,
|
||
quoteName: null,
|
||
quoteType: null,
|
||
customerCode: null,
|
||
custNo: null,
|
||
useSiteCode: null,
|
||
transLineCode: null,
|
||
feeType: null,
|
||
prodCode: null,
|
||
recPayType: null,
|
||
billType: null,
|
||
otherType1: null,
|
||
otherType2: null,
|
||
carryType: null,
|
||
status: null,
|
||
dispAreaName: null,
|
||
dispAreaSite: null,
|
||
dispAreaSiteCode: null,
|
||
sendAreaName: null,
|
||
sendAreaSite: null,
|
||
sendAreaSiteCode: null,
|
||
carriesNumber: null,
|
||
discardsNumber: null,
|
||
leastPrice: null,
|
||
priceType: null,
|
||
startDate: null,
|
||
endDate: null,
|
||
priorityLevel: null,
|
||
remark: null,
|
||
delFlag: null,
|
||
params:{
|
||
quoteStatus:null,
|
||
chargeType:null,
|
||
}
|
||
},
|
||
};
|
||
},
|
||
watch: {
|
||
// 根据名称筛选部门树
|
||
siteName(val) {
|
||
this.$refs.tree.filter(val);
|
||
}
|
||
},
|
||
computed: {
|
||
...mapGetters([
|
||
'ownerSiteCode',
|
||
'ownerSiteName',
|
||
]),
|
||
},
|
||
created() {
|
||
this.chargeType=this.$route.query.chargeType;
|
||
this.queryParams.params.chargeType=this.chargeType;
|
||
this.queryParams.quoteType=this.chargeType;
|
||
|
||
|
||
this.getList();
|
||
},
|
||
methods: {
|
||
|
||
/** 查询费用报价列表 */
|
||
getList() {
|
||
this.loading = true;
|
||
// this.queryParams.params = {};
|
||
// this.queryParams.useSiteCode=this.ownerSiteCode;
|
||
listEmisQuotePrice(this.queryParams).then(response => {
|
||
this.emisQuotePriceList = 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.quoteId)
|
||
let [lastObj]=selection.slice(-1);
|
||
this.currentQuote=lastObj;
|
||
this.single = selection.length!==1
|
||
this.multiple = !selection.length
|
||
},
|
||
handleSelectionSiteChange(selection) {
|
||
this.ids = selection.map(item => item.baseSiteId)
|
||
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.isCopy = false;
|
||
this.titleForm = "新增干线运输费";
|
||
},
|
||
|
||
/** 修改按钮操作 */
|
||
handleUpdate(row) {
|
||
this.currentId = row.quoteId || this.ids;
|
||
this.openForm = true;
|
||
this.isCopy = false;
|
||
this.titleForm = "修改干线运输费";
|
||
},
|
||
handleCopy() {
|
||
// console.log(this.currentQuote);
|
||
this.currentId = this.currentQuote.quoteId ;
|
||
this.openForm = true;
|
||
this.isCopy = true;
|
||
this.titleForm = "复制干线运输费【"+this.currentQuote.quoteName+"】";
|
||
},
|
||
handleFormChanged(){
|
||
this.openForm = false;
|
||
this.getList();
|
||
},
|
||
cancelForm(){
|
||
this.openForm = false;
|
||
},
|
||
/** 删除按钮操作 */
|
||
handleDelete(row) {
|
||
const quoteIds = row.quoteId || this.ids;
|
||
this.$modal.confirm('是否确认删除').then(function() {
|
||
return delEmisQuotePrice(quoteIds);
|
||
}).then(() => {
|
||
this.getList();
|
||
this.$modal.msgSuccess("删除成功");
|
||
}).catch(() => {});
|
||
},
|
||
/** 导出按钮操作 */
|
||
handleExport() {
|
||
// this.download('emis/emisQuotePrice/export', {
|
||
// ...this.queryParams
|
||
// }, `emisQuotePrice_${new Date().getTime()}.xlsx`)
|
||
const loadingInstance = this.$loading({
|
||
text: '正在导出...'
|
||
})
|
||
var qParam = {...this.queryParams};
|
||
qParam.pageNum=1;
|
||
qParam.pageSize=5000;
|
||
|
||
listEmisQuotePrice(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 = ['序号','报价名称','报价编码','使用站点代码','使用站点名称','所属线路代码','所属线路名称','费用类型','产品类型代码','产品类型名称','soon_piece_type','录入付款类型','计费类型','其他类型1','其他类型2','取重方式','启用状态','派件区域','派件区域站点','派件区域名称','派件区域站点id','寄件区域','寄件区域名称','寄件区域站点列表','寄件区域站点列表','carries_number','discards_number','最低价格','价格取值','开始日期','结束日期','优先级','备注','租户ID','删除标志(0代表存在','创建者','创建时间','更新者','更新时间','创建网点','更新网点',];
|
||
const filterVal = ['quoteId','quoteName','quoteCode','useSiteCode','useSite','transLineCode','transLine','feeType','prodCode','prodName','soonPieceType','recPayType','billType','otherType1','otherType2','carryType','status','dispAreaId','dispAreaSite','dispAreaName','dispAreaSiteId','sendAreaId','sendAreaName','sendAreaSite','sendAreaSiteId','carriesNumber','discardsNumber','leastPrice','priceType','startDate','endDate','priorityLevel','remark','tenantId','delFlag','createBy','createTime','updateBy','updateTime','createSite','updateSite',];
|
||
const data = this.formatJson(filterVal, curList, response.rows)
|
||
excel.export_json_to_excel({
|
||
header: tHeader,
|
||
data,
|
||
filename: '费用报价',
|
||
autoWidth: true
|
||
})
|
||
loadingInstance.close()
|
||
})
|
||
}
|
||
});
|
||
},
|
||
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;
|
||
}
|
||
|
||
.el-dialog .el-dialog__body {
|
||
margin: 5px!important;
|
||
padding: 0;
|
||
overflow: auto;
|
||
}
|
||
</style>
|