3333
This commit is contained in:
parent
09e2e222dc
commit
ab46cb7381
|
|
@ -15,6 +15,13 @@ export function del(id) {
|
|||
})
|
||||
}
|
||||
|
||||
export function detail(id) {
|
||||
return request({
|
||||
url: 'api/quotation/detail/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/quotation',
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<template>
|
||||
<div >
|
||||
<itemForm ref="itemform" :isAdd="false"/>
|
||||
<itemForm ref="itemform" :is-add="false"/>
|
||||
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog"
|
||||
title="定价详情" width="60%">
|
||||
title="报价单详情" width="60%">
|
||||
<el-descriptions :column="3" border size="small">
|
||||
<el-descriptions-item labelClassName="label-style" :span="2" label="客户名称">{{ form.custName }}</el-descriptions-item>
|
||||
<el-descriptions-item labelClassName="label-style" :span="1" label="客户编号">{{ form.custNo }}</el-descriptions-item>
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
<el-table-column v-for="(col, cIndex) in group.children" :key="cIndex" align="center" :prop="col.field"
|
||||
:label="col.label" >
|
||||
<template slot-scope="scope">
|
||||
<div @click="editQuotationItem(scope.row[col.field])"> {{ scope.row[col.field].price }}</div>
|
||||
<div @click="editQuotationItem(scope.row[col.field])" :class="getClass(scope.row[col.field])" > {{ scope.row[col.field].price }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
|
|
@ -38,10 +38,17 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { add, edit } from '@/api/quotation'
|
||||
import { add, edit, detail } from '@/api/quotation'
|
||||
import itemForm from './itemForm'
|
||||
export default {
|
||||
components: { itemForm },
|
||||
props: {
|
||||
isEdit: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
editor:{},
|
||||
|
|
@ -64,6 +71,7 @@ export default {
|
|||
},
|
||||
rules: {
|
||||
},
|
||||
highlightIds: [],
|
||||
itemform:{},
|
||||
}
|
||||
},
|
||||
|
|
@ -117,6 +125,38 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
getClass(row) {
|
||||
return this.highlightIds.includes(row.id) ? 'highlight-cell' : '';
|
||||
},
|
||||
getDetail(id, highlightId) {
|
||||
detail(id).then(res => {
|
||||
const data = res;
|
||||
const quoteList = JSON.parse(data.quoteList);
|
||||
const quoteType = JSON.parse(data.quoteType);
|
||||
const weightSegment = JSON.parse(data.weightSegment);
|
||||
this.form = {
|
||||
id: data.id,
|
||||
custName: data.custName,
|
||||
custNo: data.custNo,
|
||||
netName: data.netName,
|
||||
netCode: data.netCode,
|
||||
preChargeNo: data.preChargeNo,
|
||||
avgOrderNum: data.avgOrderNum,
|
||||
priceExecuteTime: data.priceExecuteTime,
|
||||
weightSegment: weightSegment,
|
||||
quoteType: quoteType,
|
||||
quoteItemList: data.quoteItemList,
|
||||
quoteList: Array.isArray(quoteList) ? quoteList : [],
|
||||
remark: data.remark
|
||||
}
|
||||
if (highlightId) {
|
||||
this.highlightIds = highlightId.split(',');
|
||||
}
|
||||
this.dialog = true
|
||||
}).catch(err => {
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
getSpanData(data) {
|
||||
const spanData = {};
|
||||
data.forEach((row, index) => {
|
||||
|
|
@ -129,9 +169,10 @@ export default {
|
|||
return spanData;
|
||||
},
|
||||
editQuotationItem(obj) {
|
||||
this.$refs.itemform.form = obj;
|
||||
this.$refs.itemform.dialog = true;
|
||||
console.log(obj);
|
||||
if (this.isEdit) {
|
||||
this.$refs.itemform.form = obj;
|
||||
this.$refs.itemform.dialog = true;
|
||||
}
|
||||
},
|
||||
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
||||
// 只对“分区”列进行合并
|
||||
|
|
@ -159,7 +200,7 @@ export default {
|
|||
};
|
||||
},
|
||||
cancel() {
|
||||
this.resetForm()
|
||||
this.resetForm();
|
||||
},
|
||||
doEdit() {
|
||||
edit(this.form).then(res => {
|
||||
|
|
@ -187,8 +228,11 @@ export default {
|
|||
preChargeNo: '',
|
||||
avgOrderNum: '',
|
||||
priceExecuteTime: '',
|
||||
weightSegment: '',
|
||||
quoteType: '',
|
||||
custNo: '',
|
||||
weightSegment: {},
|
||||
quoteType: {},
|
||||
quiteList: [],
|
||||
quoteItemList:[],
|
||||
remark: ''
|
||||
}
|
||||
}
|
||||
|
|
@ -203,4 +247,7 @@ export default {
|
|||
.content-style {
|
||||
width: 130px;
|
||||
}
|
||||
.highlight-cell {
|
||||
color: red;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@
|
|||
</div>
|
||||
<!--表单组件-->
|
||||
<eForm ref="form" :is-add="isAdd"/>
|
||||
<eDetail ref="detail"/>
|
||||
<eDetail ref="detail" :is-edit="true"/>
|
||||
<!--表格渲染-->
|
||||
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
|
||||
<!-- <el-table-column prop="id" label="唯一标识符"/> -->
|
||||
|
|
@ -166,6 +166,7 @@ export default {
|
|||
const type = query.type
|
||||
const value = query.value
|
||||
if (type && value) { this.params[type] = value }
|
||||
this.params.quotationStatus = 1
|
||||
return true
|
||||
},
|
||||
subDelete(id) {
|
||||
|
|
@ -209,26 +210,8 @@ export default {
|
|||
_this.dialog = true
|
||||
},
|
||||
detail(data) {
|
||||
const quoteList = JSON.parse(data.quoteList);
|
||||
const quoteType = JSON.parse(data.quoteType);
|
||||
const weightSegment = JSON.parse(data.weightSegment);
|
||||
const _this = this.$refs.detail;
|
||||
_this.form = {
|
||||
id: data.id,
|
||||
custName: data.custName,
|
||||
custNo: data.custNo,
|
||||
netName: data.netName,
|
||||
netCode: data.netCode,
|
||||
preChargeNo: data.preChargeNo,
|
||||
avgOrderNum: data.avgOrderNum,
|
||||
priceExecuteTime: data.priceExecuteTime,
|
||||
weightSegment: weightSegment,
|
||||
quoteType: quoteType,
|
||||
quoteItemList: data.quoteItemList,
|
||||
quoteList: Array.isArray(quoteList) ? quoteList : [],
|
||||
remark: data.remark
|
||||
}
|
||||
_this.dialog = true
|
||||
_this.getDetail(data.id)
|
||||
},
|
||||
// 导出
|
||||
download() {
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ export default {
|
|||
this.$parent.init()
|
||||
}).catch(err => {
|
||||
this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
console.log(err)
|
||||
})
|
||||
},
|
||||
doEdit() {
|
||||
|
|
@ -82,10 +82,8 @@ export default {
|
|||
duration: 2500
|
||||
})
|
||||
this.loading = false
|
||||
this.$parent.init()
|
||||
}).catch(err => {
|
||||
this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
resetForm() {
|
||||
|
|
|
|||
|
|
@ -1,160 +1,119 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-dialog
|
||||
:title="upload.title"
|
||||
:visible.sync="upload.open"
|
||||
width="400px"
|
||||
append-to-body
|
||||
>
|
||||
<el-upload
|
||||
ref="upload"
|
||||
:limit="1"
|
||||
:headers="upload.headers"
|
||||
:action="upload.url"
|
||||
:disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress"
|
||||
:on-success="handleFileSuccess"
|
||||
:auto-upload="false"
|
||||
accept=".xlsx, .xls"
|
||||
method="get"
|
||||
drag
|
||||
>
|
||||
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
||||
<el-upload ref="upload" :limit="1" :headers="upload.headers" :action="upload.url" :disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false"
|
||||
accept=".xlsx, .xls" method="get" drag>
|
||||
<i class="el-icon-upload" />
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
</el-upload>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button
|
||||
:loading="upload.isUploading"
|
||||
type="primary"
|
||||
@click="submitFileForm"
|
||||
>确 定</el-button
|
||||
>
|
||||
<el-button :loading="upload.isUploading" type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<el-button @click="upload.open = false; upload.isUploading = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<!-- 搜索 -->
|
||||
<el-date-picker
|
||||
v-model="query.date"
|
||||
type="daterange"
|
||||
range-separator=":"
|
||||
class="el-range-editor--small filter-item"
|
||||
style="height: 30.5px;width: 220px"
|
||||
value-format="yyyy-MM-dd"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"/>
|
||||
<el-date-picker v-model="query.date" type="daterange" range-separator=":"
|
||||
class="el-range-editor--small filter-item" style="height: 30.5px;width: 220px" value-format="yyyy-MM-dd"
|
||||
start-placeholder="开始日期" end-placeholder="结束日期" />
|
||||
<el-select v-model="query.isCalc" clearable placeholder="计算状态" class="filter-item" style="width: 130px">
|
||||
<el-option v-for="item in isCalcOptions" :key="item.key" :label="item.display_name" :value="item.key"/>
|
||||
<el-option v-for="item in isCalcOptions" :key="item.key" :label="item.display_name" :value="item.key" />
|
||||
</el-select>
|
||||
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery"/>
|
||||
<el-input v-model="query.value" clearable placeholder="输入搜索内容" style="width: 200px;" class="filter-item"
|
||||
@keyup.enter.native="toQuery" />
|
||||
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
|
||||
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key"/>
|
||||
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
|
||||
</el-select>
|
||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
|
||||
<!-- 新增 -->
|
||||
<div style="display: inline-block;margin: 0px 2px;">
|
||||
<el-button
|
||||
v-permission="['admin','shipmentDetail:add']"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="add">新增</el-button>
|
||||
<el-button v-permission="['admin', 'shipmentDetail:add']" class="filter-item" size="mini" type="primary"
|
||||
icon="el-icon-plus" @click="add">新增</el-button>
|
||||
</div>
|
||||
<!-- 新增 -->
|
||||
<div style="display: inline-block;margin: 0px 2px;">
|
||||
<el-button
|
||||
v-permission="['admin','shipmentDetail:edit']"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
:loading="calLoading"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
@click="calcShipmentFee">批量算运费</el-button>
|
||||
<el-button v-permission="['admin', 'shipmentDetail:edit']" class="filter-item" size="mini" :loading="calLoading"
|
||||
type="primary" icon="el-icon-edit" @click="calcShipmentFee">批量算运费</el-button>
|
||||
</div>
|
||||
<!-- 导入 -->
|
||||
<div style="display: inline-block;">
|
||||
<el-button
|
||||
v-permission="['admin','shipmentDetail:add']"
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="handleImport">导入寄件明细</el-button>
|
||||
<!-- 导入 -->
|
||||
<div style="display: inline-block;">
|
||||
<el-button v-permission="['admin', 'shipmentDetail:add']" size="mini" class="filter-item" type="primary"
|
||||
icon="el-icon-plus" @click="handleImport">导入寄件明细</el-button>
|
||||
</div>
|
||||
<!-- 导出 -->
|
||||
<div style="display: inline-block;">
|
||||
<el-button
|
||||
:loading="downloadLoading"
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
type="warning"
|
||||
icon="el-icon-download"
|
||||
<el-button :loading="downloadLoading" size="mini" class="filter-item" type="warning" icon="el-icon-download"
|
||||
@click="download">导出</el-button>
|
||||
</div>
|
||||
<div v-if="false">
|
||||
<div>{{ '总运费:' + this.tjData.totalFee + '元' }}</div>
|
||||
<div>{{ '按照客户统计:' }} <span v-for="(item, index) in this.tjData.byCustNo" :key="index">{{ item.item + ':' + item.totalFee + '元 ' }}</span></div>
|
||||
<div>{{ '按照省份统计:' }} <span v-for="(item, index) in this.tjData.byProvince" :key="index">{{ item.item + ':' + item.totalFee + '元 ' }}</span></div>
|
||||
</div>
|
||||
<div>{{ '总运费:' + this.tjData.totalFee + '元' }}</div>
|
||||
<div>{{ '按照客户统计:' }} <span v-for="(item, index) in this.tjData.byCustNo" :key="index">{{ item.item + ':' +
|
||||
item.totalFee + '元 ' }}</span></div>
|
||||
<div>{{ '按照省份统计:' }} <span v-for="(item, index) in this.tjData.byProvince" :key="index">{{ item.item + ':' +
|
||||
item.totalFee + '元 ' }}</span></div>
|
||||
</div>
|
||||
</div>
|
||||
<!--表单组件-->
|
||||
<eForm ref="form" :is-add="isAdd"/>
|
||||
<eForm ref="form" :is-add="isAdd" />
|
||||
<QuotationDetail ref="quotationDetail" />
|
||||
<!--表格渲染-->
|
||||
|
||||
|
||||
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
|
||||
<el-table-column prop="waybillNo" label="运单编号"/>
|
||||
<el-table-column prop="custName" label="客户名称"/>
|
||||
<el-table-column prop="custNo" label="客户编号"/>
|
||||
<el-table-column prop="inboundWeight" label="入仓重量"/>
|
||||
<af-table-column prop="internalCalculationWeight" label="内部计费重量"/>
|
||||
<el-table-column prop="sendTime" label="寄件时间"/>
|
||||
<el-table-column prop="startPlace" label="始发地"/>
|
||||
<el-table-column prop="destination" label="目的地"/>
|
||||
<el-table-column prop="pickUpTime" label="揽件时间"/>
|
||||
<el-table-column prop="pickUpSalesman" label="揽件业务员"/>
|
||||
<el-table-column prop="receiveProvince" label="收件省份"/>
|
||||
<el-table-column prop="settlementMethod" label="结算方式"/>
|
||||
<el-table-column prop="freight" label="运费"/>
|
||||
<el-table-column v-if="checkPermission(['admin','shipmentDetail:edit','shipmentDetail:del'])" label="操作" width="150px" align="center">
|
||||
<el-table-column prop="waybillNo" label="运单编号" />
|
||||
<el-table-column prop="custName" label="客户名称" />
|
||||
<el-table-column prop="custNo" label="客户编号" />
|
||||
<el-table-column prop="inboundWeight" label="入仓重量" />
|
||||
<af-table-column prop="internalCalculationWeight" label="内部计费重量" />
|
||||
<el-table-column prop="sendTime" label="寄件时间" />
|
||||
<el-table-column prop="startPlace" label="始发地" />
|
||||
<el-table-column prop="destination" label="目的地" />
|
||||
<el-table-column prop="pickUpTime" label="揽件时间" />
|
||||
<el-table-column prop="pickUpSalesman" label="揽件业务员" />
|
||||
<el-table-column prop="receiveProvince" label="收件省份" />
|
||||
<el-table-column prop="settlementMethod" label="结算方式" />
|
||||
<el-table-column prop="freight" label="运费">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-permission="['admin','shipmentDetail:edit']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)"/>
|
||||
<el-popover
|
||||
v-permission="['admin','shipmentDetail:del']"
|
||||
:ref="scope.row.id"
|
||||
placement="top"
|
||||
width="180">
|
||||
<span v-if="scope.row.quotationId">
|
||||
<el-button type="text" @click="showQuotationDetail(scope.row)">{{ scope.row.freight }}</el-button>
|
||||
</span>
|
||||
<span v-else>—</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="checkPermission(['admin', 'shipmentDetail:edit', 'shipmentDetail:del'])" label="操作"
|
||||
width="150px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-permission="['admin', 'shipmentDetail:edit']" size="mini" type="primary" icon="el-icon-edit"
|
||||
@click="edit(scope.row)" />
|
||||
<el-popover v-permission="['admin', 'shipmentDetail:del']" :ref="scope.row.id" placement="top" width="180">
|
||||
<p>确定删除本条数据吗?</p>
|
||||
<div style="text-align: right; margin: 0">
|
||||
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
|
||||
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
|
||||
<el-button :loading="delLoading" type="primary" size="mini"
|
||||
@click="subDelete(scope.row.id)">确定</el-button>
|
||||
</div>
|
||||
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini"/>
|
||||
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<el-pagination
|
||||
:total="total"
|
||||
:current-page="page + 1"
|
||||
style="margin-top: 8px;"
|
||||
layout="total, prev, pager, next, sizes"
|
||||
@size-change="sizeChange"
|
||||
@current-change="pageChange"/>
|
||||
<el-pagination :total="total" :current-page="page + 1" style="margin-top: 8px;"
|
||||
layout="total, prev, pager, next, sizes" @size-change="sizeChange" @current-change="pageChange" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import checkPermission from '@/utils/permission'
|
||||
import initData from '@/mixins/initData'
|
||||
import { del,calcShipmentFee, downloadShipmentDetail, getShipmentDetailTj } from '@/api/shipmentDetail'
|
||||
import { del, calcShipmentFee, downloadShipmentDetail, getShipmentDetailTj } from '@/api/shipmentDetail'
|
||||
import eForm from './form'
|
||||
import QuotationDetail from '../quotation/detail'
|
||||
import { getToken } from "@/utils/auth";
|
||||
import { parseTime, downloadFile, parseDate } from '@/utils/index'
|
||||
export default {
|
||||
components: { eForm },
|
||||
components: { eForm, QuotationDetail },
|
||||
mixins: [initData],
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -192,6 +151,10 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
|
||||
showQuotationDetail(row) {
|
||||
this.$refs.quotationDetail.getDetail(row.quotationId, row.quotationItem)
|
||||
},
|
||||
beforeInit() {
|
||||
this.url = 'api/shipmentDetail'
|
||||
const sort = 'id,desc'
|
||||
|
|
@ -283,8 +246,8 @@ export default {
|
|||
this.downloadLoading = false
|
||||
})
|
||||
},
|
||||
/** 导入按钮操作 */
|
||||
handleImport() {
|
||||
/** 导入按钮操作 */
|
||||
handleImport() {
|
||||
this.upload.title = "寄件明细导入";
|
||||
this.upload.open = true;
|
||||
},
|
||||
|
|
@ -308,6 +271,4 @@ export default {
|
|||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
<style scoped></style>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user