Commit c60c5e0b authored by dragondean@qq.com's avatar dragondean@qq.com

完善订单列表详情打印

parent cd5759cf
......@@ -22,7 +22,7 @@ export function updateOrder(data) {
// 删除订单
export function deleteOrder(id) {
return request({
url: '/ecw/order/delete?id=' + id,
url: '/ecw/order/delete?orderId=' + id,
method: 'delete'
})
}
......@@ -139,7 +139,6 @@ export function orderWarehouseIn(data){
}
// 入仓完成
export function orderWarehouseInFinish(data){
return request({
url: '/order/order-warehouse-in/finish',
......@@ -148,3 +147,19 @@ export function orderWarehouseInFinish(data){
})
}
//取消订单
export function cancelOrder(orderId){
return request({
url: `/ecw/order/cancel/${orderId}`,
method: 'put',
})
}
// 恢复订单
export function recoveryOrder(orderId){
return request({
url: `/ecw/order/recovery/${orderId}`,
method: 'put',
})
}
<template>
<el-dialog :title="title" visible :before-close="closeDialog" width="1000px">
<el-result sub-title="加载中" v-if="loading">
<i class="el-icon-loading" slot="icon" style="font-size: 40px" />
</el-result>
<pdf-viewer id="pdfViewer" ref="viewer" v-if="pdfData" :url="pdfData" style="display:block; margin: 0 auto; max-height: 80vh; overflow:auto;" />
<p class="subs" style="text-align:center">
<el-button type="primary" @click="download" :disabled="!pdfData">下载</el-button>
......@@ -13,43 +16,37 @@ import {getLadingBill} from '@/api/ecw/order'
import lodop from '@/utils/lodop'
import PdfViewer from '@/components/PdfViewer'
import FileSaver from 'file-saver'
const GetBASE64 = (dataArray) => {
var digits = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
var strData = "";
for (var i = 0, ii = dataArray.length; i < ii; i += 3) {
if (isNaN(dataArray[i])) break;
var b1 = dataArray[i] & 0xFF, b2 = dataArray[i + 1] & 0xFF, b3 = dataArray[i + 2] & 0xFF;
var d1 = b1 >> 2, d2 = ((b1 & 3) << 4) | (b2 >> 4);
var d3 = i + 1 < ii ? ((b2 & 0xF) << 2) | (b3 >> 6) : 64;
var d4 = i + 2 < ii ? (b3 & 0x3F) : 64;
strData += digits.substring(d1, d1 + 1) + digits.substring(d2, d2 + 1) + digits.substring(d3, d3 + 1) + digits.substring(d4, d4 + 1);
}
return strData;
}
window.GetBASE64 = GetBASE64
export default {
components: {PdfViewer},
filters: {parseTime},
props:{
orderId: [String, Number]
transportType: Number,
tidanNO: [String, Number]
},
data(){
return {
show: false,
detail: null,
/* detail: null,
preview: false,
billLadingNo: 'TD20220717',
type: 1,
pdfData: null
type: 1, */
pdfData: null,
loading: false
}
},
computed:{
title(){
let t = '提货单'
if(this.detail){
t += '-' + this.detail.orderNo
if(this.tidanNO){
t += '-' + this.tidanNO
}
return t
},
type(){
if(this.transportType <= 2) return 1
if(this.transportType == 3) return 3
if(this.transportType == 4) return 2
}
},
created(){
......@@ -58,13 +55,17 @@ export default {
},
methods:{
loadData(){
this.loading = true
getLadingBill({
billLadingNo: this.billLadingNo,
billLadingNo: this.tidanNo,
type: this.type
})
.then(arrayBuffer => {
this.pdfData = arrayBuffer
})
.finally(() => {
this.loading = false
})
},
closeDialog(){
this.show = false
......@@ -92,12 +93,9 @@ export default {
LODOP.PREVIEW();
// LODOP.ADD_PRINT_PDF(0,0,"100%","100%",data);
this.$alert('已发起打印任务');
// LODOP.PREVIEW(); // 预览
/* LODOP.PRINTA(); // 选择打印机
// 直接打印 */
console.log('打印哦')
}).catch(err => {
console.error('lodop异常', err)
alert('请检查LODOP打印控件是否安装并启动');
......
......@@ -122,13 +122,16 @@ export default {
LODOP.SET_PRINT_STYLE("FontSize",18);
LODOP.SET_PRINT_STYLE("Bold",1);
// LODOP.ADD_PRINT_TEXT(50,231,260,39,"打印页面部分内容");
LODOP.SET_PRINT_PAGESIZE(0, 800, 600, "TAG");
for(let i = this.form.start; i <= this.form.end; i ++){
LODOP.ADD_PRINT_HTM(88,200,350,600, document.getElementById("order-print-tag").innerHTML);
LODOP.PRINT();
LODOP.ADD_PRINT_HTM(0,0,800,600, document.getElementById("order-print-tag").innerHTML);
if(i < this.form.end){
LODOP.NewPage()
}
this.$alert('已发起打印任务');
}
LODOP.PREVIEW();
// LODOP.PREVIEW(); // 预览
// // 预览
/* LODOP.PRINTA(); // 选择打印机
// 直接打印 */
console.log('打印哦')
......
This diff is collapsed.
......@@ -136,28 +136,54 @@
<el-table-column label="订单状态" align="center" prop="status">
<template slot-scope="scope">
<span>{{ scope.row.status | orderStatusFilter(orderStatusList) }}</span>
<dict-tag :type="DICT_TYPE.ORDER_STATUS" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150px">
<template slot-scope="scope">
<!--操作相关的-->
<el-popover
style="margin-left: 10px;"
placement="bottom"
width="100"
trigger="hover">
<el-button type="text" slot="reference">操作</el-button>
<div style=" display:flex; flex-direction:column">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['ecw:order:update']">编辑</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="$router.push('/order/warehousing?id=' + scope.row.orderId)"
v-hasPermi="['ecw:order:update']">入仓</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['ecw:order:update']">退仓</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="$router.push('/order/special?id=' + scope.row.orderId)"
v-hasPermi="['ecw:order:update']">特价</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
<el-button v-if="[0, 88].indexOf(scope.row.status) > -1" size="mini" type="text" icon="el-icon-delete" @click="oprateOrder(scope.row.orderId, 'deleteOrder')"
v-hasPermi="['ecw:order:delete']">删除</el-button>
<el-button v-if="scope.row.status < 5" size="mini" type="text" icon="el-icon-delete" @click="oprateOrder(scope.row.orderId, 'cancelOrder')">取消订单</el-button>
<el-button v-if="scope.row.status == 88" size="mini" type="text" icon="el-icon-delete" @click="oprateOrder(scope.row.orderId, 'recoveryOrder')">恢复订单</el-button>
<el-button type="text" size="mini" @click="$router.push(`/order/fee-application/${scope.row.orderId}`)">费用申请</el-button>
<el-button type="text" size="mini" @click="orderId = scope.row.orderId;isShow = true" >特需</el-button>
<el-button type="text" size="mini" @click="$router.push(`/order/associated-order/${scope.row.orderId}`)" >关联</el-button>
<el-button type="text" size="mini" @click="$router.push(`/order/mutex-order/${scope.row.orderId}`)" >互斥</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="$router.push('/order/special?id=' + scope.row.orderId)"
v-hasPermi="['ecw:order:update']">特价</el-button>
</div>
</el-popover>
<!--仓库相关的-->
<el-popover
style="margin-left: 10px;"
placement="bottom"
width="100"
trigger="hover">
<el-button type="text" slot="reference">仓库</el-button>
<div style=" display:flex; flex-direction:column">
<el-button size="mini" type="text" icon="el-icon-edit" @click="$router.push('/order/warehousing?id=' + scope.row.orderId)"
v-hasPermi="['ecw:order:update']">入仓</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['ecw:order:update']">退仓</el-button>
</div>
</el-popover>
<!--打印相关的-->
<el-popover
style="margin-left: 10px;"
placement="bottom"
......@@ -166,7 +192,7 @@
<div style=" display:flex; flex-direction:column">
<el-button size="mini" type="text" @click="printTagOrderId=scope.row.orderId">打印标签</el-button>
<el-button size="mini" type="text" @click="printWarehouseReceiptOrderId=scope.row.orderId">打印入仓单</el-button>
<el-button size="mini" type="text" @click="printLadingBillOrderId=scope.row.orderId">打印提单</el-button>
<el-button size="mini" type="text" @click="printLadingBillInfo={tidanNO: scope.row.tidanNo, transportType: scope.row.transportId}" :disabled="!scope.row.tidanNo">打印提单</el-button>
</div>
<el-button type="text" slot="reference">打印</el-button>
</el-popover>
......@@ -178,37 +204,6 @@
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
<el-form-item label="唛头" prop="marks">
<el-input v-model="form.marks" placeholder="请输入唛头" />
</el-form-item>
<el-form-item label="产品备案属性" prop="productRecord">
<dict-selector :type="DICT_TYPE.PRODUCT_RECORD_ATTRIBUTE" v-model="form.productRecord" clearable />
</el-form-item>
<el-form-item label="控货状态" prop="cargoControlStatus">
<dict-selector :type="DICT_TYPE.CONTROL_GOODS_STATUS" v-model="form.cargoControlStatus" clearable />
</el-form-item>
<el-form-item label="报关类别" prop="customsType">
<dict-selector :type="DICT_TYPE.ECW_CUSTOMS_TYPE" v-model="form.customsType" clearable />
</el-form-item>
<el-form-item label="入仓箱数" prop="sumNum">
<el-input v-model="form.sumNum" placeholder="请输入入仓箱数" />
</el-form-item>
<el-form-item label="入仓方数" prop="sumVolume">
<el-input v-model="form.sumVolume" placeholder="请输入入仓方数" />
</el-form-item>
<el-form-item label="入仓重量" prop="sumWeight">
<el-input v-model="form.sumWeight" placeholder="请输入入仓重量" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
<special-needs :show.sync="isShow":order-id="orderId" @determine="getList" ></special-needs>
<!-- <el-dialog :title="'打印标签'" visible.sync="showPrintTag">
......@@ -216,7 +211,7 @@
</el-dialog> -->
<print-tag v-if="printTagOrderId !== null" :order-id="printTagOrderId" @close="printTagOrderId=null" />
<print-warehouse-receipt v-if="printWarehouseReceiptOrderId !== null" :order-id="printWarehouseReceiptOrderId" @close="printWarehouseReceiptOrderId=null" />
<print-lading-bill v-if="printLadingBillOrderId !== null" :order-id="printLadingBillOrderId" @close="printLadingBillOrderId=null" />
<print-lading-bill v-if="printLadingBillInfo !== null" v-bind="printLadingBillInfo" @close="printLadingBillInfo=null" />
</div>
</template>
......@@ -234,7 +229,9 @@ import {
getOrder,
getOrderPage,
exportOrderExcel,
orderSpecialNeed
orderSpecialNeed,
cancelOrder,
recoveryOrder
} from "@/api/ecw/order";
import { getDictDatas, DICT_TYPE } from '@/utils/dict';
import PrintTag from './components/PrintTag'
......@@ -322,7 +319,7 @@ export default {
printTagOrderId: null, // 显示打印标签的订单ID
printWarehouseReceiptOrderId: null, // 打印入仓单的订单ID
printLadingBillOrderId: null, // 打印提单订单ID
printLadingBillInfo: null, // 打印提单
isShow:false,//特殊显示
orderId:undefined,
DICT_TYPE,
......@@ -351,7 +348,33 @@ export default {
getTradeCityList().then(res => this.tradeCityList = res.data)
},
methods: {
oprateOrder(orderId, type){
let actions = {
cancelOrder: {
callable: cancelOrder,
confirm: '确定要取消此订单么?'
},
recoveryOrder: {
callable: recoveryOrder,
confirm: '确定要恢复此订单么?'
},
deleteOrder: {
callable: deleteOrder,
confirm: '确定要删除此订单么?'
}
}
let action = actions[type]
if(!action){
return this.$alert('不支持此操作')
}
this.$confirm(action.confirm)
.then(res => {
return action.callable(orderId)
})
.then(res => {
this.getList()
})
},
/** 查询列表 */
getList() {
this.loading = true;
......
......@@ -307,7 +307,8 @@ export default {
}
let data = Object.assign({}, this.form, {
// lineChannelList: this.selectedRoutes,
specialList: this.specialProducts
specialList: this.specialProducts,
isAllProduct: 0
})
// 修改的提交
......@@ -333,6 +334,7 @@ export default {
if(data.lineChannelList.length < 1){
return this.$message.error('请选择需要修改的路线')
}
data.productIdList = [this.form.productId]
batchUpdateProductPrice(data).then(response => {
this.$modal.msgSuccess("修改成功");
this.$router.replace('/product/product-price')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment