|
@@ -30,17 +30,6 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :xs="24" :sm="12" :lg="6">
|
|
|
- <el-form-item label="状态" prop="evaluateStatus">
|
|
|
- <el-select v-model="screenForm.evaluateStatus" placeholder="全部">
|
|
|
- <el-option label="全部" value=""></el-option>
|
|
|
- <el-option label="未评价订单" :value="0"></el-option>
|
|
|
- <el-option label="已评价订单" :value="3"></el-option>
|
|
|
- <el-option label="差评订单" :value="1"></el-option>
|
|
|
- <el-option label="好评订单" :value="2"></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :xs="24" :sm="12" :lg="6">
|
|
|
<el-form-item label="创建时间" prop="createDate" style="height: 33px;">
|
|
|
<el-date-picker v-model="screenForm.createDate" type="datetimerange"
|
|
|
value-format="yyyy-MM-dd HH:mm:ss" range-separator="至" start-placeholder="开始日期"
|
|
@@ -56,9 +45,11 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :xs="24" :sm="12" :lg="6" class="tr">
|
|
|
- <el-form-item label="">
|
|
|
- <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
|
|
|
- <el-button size="small" @click="resetScreenForm">清空</el-button>
|
|
|
+ <el-form-item label="" label-width="0px">
|
|
|
+ <div style="text-align: left;">
|
|
|
+ <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
|
|
|
+ <el-button size="small" @click="resetScreenForm">清空</el-button>
|
|
|
+ </div>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -68,23 +59,22 @@
|
|
|
<div class="fl">
|
|
|
<el-tabs v-model="tabCurrent" type="card" @tab-click="changeTabs" class="fl" size="small" style="margin-right: 10px">
|
|
|
<el-tab-pane label="全部" name="ALL"></el-tab-pane>
|
|
|
- <el-tab-pane label="待付款" name="NOPAY"></el-tab-pane>
|
|
|
- <el-tab-pane label="待确认" name="DQR"></el-tab-pane>
|
|
|
- <el-tab-pane label="待发货" name="DFH"></el-tab-pane>
|
|
|
- <el-tab-pane label="已发货" name="YFH"></el-tab-pane>
|
|
|
+ <el-tab-pane label="待付款" name="SAVE"></el-tab-pane>
|
|
|
+ <el-tab-pane label="待确认" name="WAIT"></el-tab-pane>
|
|
|
+ <el-tab-pane label="待发货" name="PAID"></el-tab-pane>
|
|
|
+ <el-tab-pane label="已发货" name="SEND"></el-tab-pane>
|
|
|
<el-tab-pane label="已完成" name="OVER"></el-tab-pane>
|
|
|
- <el-tab-pane label="退款/取消" name="CLOSE"></el-tab-pane>
|
|
|
- <el-tab-pane label="已超时" name="TIMEOUT"></el-tab-pane>
|
|
|
+ <el-tab-pane label="已售后/取消" name="CANCEL"></el-tab-pane>
|
|
|
+ <el-tab-pane label="已超时" name="TIME_OUT"></el-tab-pane>
|
|
|
</el-tabs>
|
|
|
- <el-button class="fl" type="primary" size="small" @click="add">新增</el-button>
|
|
|
+ <el-button class="fl" type="primary" size="small" @click="add(1)">新增</el-button>
|
|
|
</div>
|
|
|
<div class="fr">
|
|
|
- <el-button size="small" type="primary">导出</el-button>
|
|
|
+ <el-button size="small" type="primary" @click="handleExport">导出</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<zj-page-fill>
|
|
|
<div class="order-main-container">
|
|
|
- <!-- -->
|
|
|
<div class="table-top">
|
|
|
<el-row style="width:100%">
|
|
|
<el-col :span="3">
|
|
@@ -98,35 +88,33 @@
|
|
|
<el-col :span="3" style="text-align: center"><span class="item">操作</span></el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
- <!-- -->
|
|
|
<div class="order-item" v-for="order in dataList" :key="order.orderId">
|
|
|
<div class="order-top">
|
|
|
- <span><b>订单号</b>:{{ order.orderId }}</span>
|
|
|
+ <span><b>订单号</b>:{{ order.esOrderId }}</span>
|
|
|
<span><b>下单时间</b>:{{ order.createTime }}</span>
|
|
|
- <el-tag>商城销售</el-tag>
|
|
|
+ <el-tag v-if="~[2,'2'].indexOf(order.saleType)">线下销售</el-tag>
|
|
|
+ <el-tag v-if="~[1,'1'].indexOf(order.saleType)">线上销售</el-tag>
|
|
|
+ <el-tag v-if="order.saleType==1 && order.payType == 'WECHAT'">在线支付</el-tag>
|
|
|
+ <el-tag v-if="(order.saleType==1 && order.payType != 'WECHAT') || order.saleType==2">到店支付</el-tag>
|
|
|
+ <el-tag v-if="~[0].indexOf(order.totalAmount)">面议</el-tag>
|
|
|
<div class="fr"></div>
|
|
|
</div>
|
|
|
<div class="order-content">
|
|
|
<el-row style="width:100%;">
|
|
|
<el-col :span="6" style="height: 100%;">
|
|
|
<div class="col-item-pro">
|
|
|
- <div class="pro-item" v-for="orderItem in order.orderDetails" :key="orderItem.orderDetailId">
|
|
|
+ <div class="pro-item">
|
|
|
<div class="left">
|
|
|
<div class="image">
|
|
|
- <img :src="orderItem.imgUrl" style="height:80px;width: 80px;">
|
|
|
+ <img :src="order.goodsUrl" style="height:80px;width: 80px;">
|
|
|
</div>
|
|
|
<div class="main">
|
|
|
- <span><el-tag type="danger" effect="plain" size="mini" style="margin-right: 4px"
|
|
|
- v-if="orderItem.promotionFullPieceId">满件打折</el-tag>{{ orderItem.esGoodsName }}</span>
|
|
|
- <span class="spec"
|
|
|
- v-if="orderItem.goodsSpecName === '默认' && orderItem.goodsSpecValue === '默认'">默认</span>
|
|
|
- <span class="spec" v-else>{{ orderItem.goodsSpecName }}-{{ orderItem.goodsSpecValue
|
|
|
- }}</span>
|
|
|
+ <span>{{ order.esGoodsName }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="right">
|
|
|
- <span>¥{{ orderItem.price }}</span>
|
|
|
- <span>x{{ orderItem.num }}</span>
|
|
|
+ <span>¥{{ order.goodsPrice }}</span>
|
|
|
+ <span>x{{ order.num }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -139,44 +127,37 @@
|
|
|
</el-col>
|
|
|
<el-col :span="4" style="height: 100%;">
|
|
|
<div class="col-item">
|
|
|
- <div>{{ order.receUserName }}/{{ order.recePhone }}</div>
|
|
|
- <div class="ellipsis-2">{{ order.province + order.city + order.area + order.street + order.receAddress + order.houseNo }}</div>
|
|
|
+ <div>{{ order.userName }}/{{ order.userMobile }}</div>
|
|
|
+ <div class="ellipsis-2">{{ order.province + order.city + order.area + order.street + order.receAddress }}</div>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="4" style="height: 100%;">
|
|
|
<div class="col-item">
|
|
|
- <div class="totalprice">¥{{ order.payAmount }}</div>
|
|
|
- <div style="font-size: 12px" v-if="order.discountAmount">(<span>-{{ order.discountAmount
|
|
|
- }}</span><span v-if="order.promotionDiscountRate">/{{ order.promotionDiscountRate * 10
|
|
|
- }}折</span>)</div>
|
|
|
+ <div class="totalprice">¥{{ order.totalAmount }}</div>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="3" style="height: 100%;">
|
|
|
<div class="col-item">
|
|
|
<div style="display: flex; align-items: center;">
|
|
|
- <img src="@/assets/order/CLOSE.png" style="width: 16px; flex-shrink: 0;"
|
|
|
- v-if="order.status == 'CLOSE'">
|
|
|
- <img src="@/assets/order/DFH.png" style="width: 16px; flex-shrink: 0;"
|
|
|
- v-if="order.status == 'DFH'">
|
|
|
- <img src="@/assets/order/NOPAY.png" style="width: 16px; flex-shrink: 0;"
|
|
|
- v-if="order.status == 'NOPAY'">
|
|
|
- <img src="@/assets/order/OVER.png" style="width: 16px; flex-shrink: 0;"
|
|
|
- v-if="order.status == 'OVER'">
|
|
|
- <img src="@/assets/order/TIMEOUT.png" style="width: 16px; flex-shrink: 0;"
|
|
|
- v-if="order.status == 'TIMEOUT'">
|
|
|
- <img src="@/assets/order/YFH.png" style="width: 16px; flex-shrink: 0;"
|
|
|
- v-if="order.status == 'YFH'">
|
|
|
- <span style="margin-left: 4px">{{ order.status | ORDER_CURRENT_STATUS_FILTER }}</span>
|
|
|
+ <span style="margin-left: 4px">{{ ({SAVE: "待支付", WAIT: "待确认", PAID: "待发货", SEND: "卖家发货", OVER: "已完成", TIME_OUT: "超时", CANCEL: "已售后/取消", WAIT_REFUND: "售后中", REFUND: "已退"})[order.status] }}</span>
|
|
|
</div>
|
|
|
- <div>({{ order.toWorkOrder ? '已派单' : '未派单' }})</div>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<el-col :span="3" style="height: 100%;">
|
|
|
- <div class="col-item">
|
|
|
+ <div class="col-item">
|
|
|
<div class="operate">
|
|
|
- <el-popconfirm title="确定确认订单吗?" @confirm="">
|
|
|
+ <el-popconfirm v-if="~['WAIT'].indexOf(order.status)" title="确认订单吗?" @confirm="quedingesOrderPayOk(order)">
|
|
|
<el-button slot="reference" type="text" size="small">确认订单</el-button>
|
|
|
</el-popconfirm>
|
|
|
+ <el-popconfirm v-if="~['SAVE','WAIT'].indexOf(order.status)" title="确认取消订单吗?" @confirm="quedingesOrderCancel(order)">
|
|
|
+ <el-button slot="reference" type="text" size="small">取消订单</el-button>
|
|
|
+ </el-popconfirm>
|
|
|
+ <el-button v-if="~['SEND','OVER'].indexOf(order.status)" @click="viewMaterialFlow(order)" type="text" size="small">查看物流</el-button>
|
|
|
+ <el-button v-if="~['SAVE', 'WAIT', 'PAID', 'SEND', 'OVER', 'CANCEL', 'TIME_OUT'].indexOf(order.status)" @click="viewDetails(order, 0)" type="text" size="small">查看详情</el-button>
|
|
|
+ <el-button v-if="~['CASH'].indexOf(order.payType) && ~['SAVE'].indexOf(order.status)" @click="viewDetails(order, 1)" type="text" size="small">确认收款</el-button>
|
|
|
+ <el-button v-if="~['SEND','OVER'].indexOf(order.status)" @click="viewDetails(order, 2)" type="text" size="small">发起退货</el-button>
|
|
|
+ <el-button v-if="~['PAID'].indexOf(order.status)" type="text" @click="gofahuo(order)" size="small">发货</el-button>
|
|
|
+ <el-button v-if="~['PAID','SEND'].indexOf(order.status)" type="text" size="small" @click="toPrint(order)">打印</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-col>
|
|
@@ -199,90 +180,53 @@
|
|
|
</div>
|
|
|
<!-- 新增 -->
|
|
|
<div v-if="activeKey == 'add'" style="width:100%;height:100%;">
|
|
|
- <zj-page-container>
|
|
|
- <zj-page-fill>
|
|
|
- <div style="box-sizing: border-box; padding:10px;">
|
|
|
- <add/>
|
|
|
- </div>
|
|
|
- </zj-page-fill>
|
|
|
- </zj-page-container>
|
|
|
+ <add :detailsId="detailsId" :detailsType="detailsType" @removeTab="()=>{
|
|
|
+ getList()
|
|
|
+ data.removeTab()
|
|
|
+ }"/>
|
|
|
</div>
|
|
|
- <!-- 确认订单 -->
|
|
|
- <div v-if="activeKey == 'remark'" style="width:100%;height:100%;">
|
|
|
- <zj-page-container>
|
|
|
- <zj-page-fill>
|
|
|
- <div style="box-sizing: border-box; padding:10px;">
|
|
|
-
|
|
|
- </div>
|
|
|
- </zj-page-fill>
|
|
|
- </zj-page-container>
|
|
|
- </div>
|
|
|
- <!-- 确认收款 -->
|
|
|
- <div v-if="activeKey == 'materialDetail'" style="width:100%;height:100%;">
|
|
|
- <zj-page-container>
|
|
|
- <zj-page-fill>
|
|
|
- <div style="box-sizing: border-box; padding:10px;">
|
|
|
-
|
|
|
- </div>
|
|
|
- </zj-page-fill>
|
|
|
- </zj-page-container>
|
|
|
- </div>
|
|
|
- <!-- 取消订单 -->
|
|
|
- <div v-if="activeKey == 'deliverGoods'" style="width:100%;height:100%;">
|
|
|
- <zj-page-container>
|
|
|
- <zj-page-fill>
|
|
|
- <div style="box-sizing: border-box; padding:10px;">
|
|
|
-
|
|
|
- </div>
|
|
|
- </zj-page-fill>
|
|
|
- </zj-page-container>
|
|
|
+ <!-- 查看详情 / 确认收款 / 退货-->
|
|
|
+ <div v-if="~activeKey.indexOf('details_')" style="width:100%;height:100%;">
|
|
|
+ <detailsV :detailsId="detailsId" :detailsType="detailsType" @viewMaterialFlow="viewMaterialFlow" @removeTab="()=>{
|
|
|
+ getList()
|
|
|
+ data.removeTab()
|
|
|
+ }"/>
|
|
|
</div>
|
|
|
<!-- 查看物流 -->
|
|
|
- <div v-if="activeKey == 'editAddress1'" style="width:100%;height:100%;">
|
|
|
- <zj-page-container>
|
|
|
- <zj-page-fill>
|
|
|
- <div style="box-sizing: border-box; padding:10px;">
|
|
|
-
|
|
|
- </div>
|
|
|
- </zj-page-fill>
|
|
|
- </zj-page-container>
|
|
|
- </div>
|
|
|
- <!-- 查看详情 -->
|
|
|
- <div v-if="activeKey == 'editAddress2'" style="width:100%;height:100%;">
|
|
|
- <zj-page-container>
|
|
|
- <zj-page-fill>
|
|
|
- <div style="box-sizing: border-box; padding:10px;">
|
|
|
-
|
|
|
- </div>
|
|
|
- </zj-page-fill>
|
|
|
- </zj-page-container>
|
|
|
+ <div v-if="activeKey == 'materialFlow'" style="width:100%;height:100%;">
|
|
|
+ <materialFlow :detailsId="detailsId"/>
|
|
|
</div>
|
|
|
- <!-- 退货 -->
|
|
|
- <div v-if="activeKey == 'editAddress3'" style="width:100%;height:100%;">
|
|
|
- <zj-page-container>
|
|
|
- <zj-page-fill>
|
|
|
- <div style="box-sizing: border-box; padding:10px;">
|
|
|
-
|
|
|
- </div>
|
|
|
- </zj-page-fill>
|
|
|
- </zj-page-container>
|
|
|
+ <!-- 发货 -->
|
|
|
+ <div v-if="activeKey == 'fahuo'" style="width:100%;height:100%;">
|
|
|
+ <deliverGoods :detailsId="detailsId" @removeTab="()=>{
|
|
|
+ getList()
|
|
|
+ data.removeTab()
|
|
|
+ }"/>
|
|
|
</div>
|
|
|
</template>
|
|
|
</zj-tab-page>
|
|
|
</zj-page-fill>
|
|
|
+ <print-preview ref="preView" @initPrint="handleInitPrint" @refreshList="handleRefreshList" />
|
|
|
</zj-page-container>
|
|
|
-
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { esOrderList } from "@/api/orderManagement";
|
|
|
+import { esOrderList, esOrderListExcel, esOrderPayOk, esOrderCancel, esOrderDetail } from "@/api/orderManagement";
|
|
|
import add from "./add.vue"
|
|
|
+import detailsV from "./details.vue"
|
|
|
+import materialFlow from "./materialFlow.vue"
|
|
|
+import deliverGoods from "./deliverGoods.vue"
|
|
|
import '@/styles/order-list.scss'
|
|
|
+import { downloadFiles } from '@/utils/util'
|
|
|
+import { disAutoConnect, hiprint } from 'vue-plugin-hiprint'
|
|
|
+import printPreview from '../components/preview.vue'
|
|
|
export default {
|
|
|
- components: {add},
|
|
|
-
|
|
|
+ components: {add, detailsV, materialFlow, deliverGoods, printPreview},
|
|
|
data() {
|
|
|
return {
|
|
|
+ pageType:this?.$route?.params?.pageType,
|
|
|
+ pageCode:this?.$route?.params?.pageCode,
|
|
|
+ pagePam:this?.$route?.params?.pagePam,
|
|
|
screenForm: { // 筛选表单数据
|
|
|
orderId: '', // 订单号
|
|
|
esGoodsName: '', // 商品名称
|
|
@@ -297,28 +241,51 @@ export default {
|
|
|
sendStatus: '', // 派单异常
|
|
|
workerOrderNo: '', // 信息编号
|
|
|
},
|
|
|
- screen_status: [ // 筛选字段 - 状态
|
|
|
- { label: '待付款', value: 'NOPAY' },
|
|
|
- { label: '待发货', value: 'DFH' },
|
|
|
- { label: '已发货', value: 'YFH' },
|
|
|
- { label: '已完成', value: 'OVER' },
|
|
|
- { label: '已退款', value: 'CLOSE' }
|
|
|
- ],
|
|
|
tabCurrent: 'ALL',
|
|
|
currentPage: 1, // 当前页码
|
|
|
pageSize: 10, // 每页数量
|
|
|
listTotal: 0, // 列表总数
|
|
|
dataList: [],
|
|
|
+ detailsId: "",
|
|
|
+ detailsType: "",
|
|
|
}
|
|
|
},
|
|
|
- computed: {
|
|
|
-
|
|
|
- },
|
|
|
created() {
|
|
|
this.getList();
|
|
|
+ if(this.pageType==="detail" && this.pageCode){
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ this.viewDetails({esOrderId:this.pageCode},0)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(this.pageType==="materialFlow" && this.pageCode){
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ this.viewMaterialFlow({esOrderId:this.pageCode})
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if(this.pageType==="add" && this.pageCode){
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ this.add(0)
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
- add(){
|
|
|
+ quedingesOrderPayOk(row){
|
|
|
+ esOrderPayOk({
|
|
|
+ esOrderId:row.esOrderId
|
|
|
+ }).then(res=>{
|
|
|
+ this.$message({ type: 'success', message: `确定成功!` })
|
|
|
+ this.getList();
|
|
|
+ })
|
|
|
+ },
|
|
|
+ quedingesOrderCancel(row){
|
|
|
+ esOrderCancel({
|
|
|
+ esOrderId:row.esOrderId
|
|
|
+ }).then(res=>{
|
|
|
+ this.$message({ type: 'success', message: `取消成功!` })
|
|
|
+ this.getList();
|
|
|
+ })
|
|
|
+ },
|
|
|
+ add(type){
|
|
|
this.$refs.tabPage.addTab({
|
|
|
// 对应显示的模块
|
|
|
activeKey: "add",
|
|
@@ -328,7 +295,62 @@ export default {
|
|
|
label: "新增订单",
|
|
|
// 打开时事件
|
|
|
triggerEvent: () => {
|
|
|
-
|
|
|
+ this.detailsType = type
|
|
|
+ },
|
|
|
+ // 关闭时事件
|
|
|
+ closeEvent: () => {
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ viewDetails(row, type){
|
|
|
+ this.$refs.tabPage.addTab({
|
|
|
+ // 对应显示的模块
|
|
|
+ activeKey: "details_"+type,
|
|
|
+ // 唯一标识
|
|
|
+ key: "details_"+type,
|
|
|
+ // 页签名称
|
|
|
+ label: ["订单详情", "确认收款", "退货退款"][type],
|
|
|
+ // 打开时事件
|
|
|
+ triggerEvent: () => {
|
|
|
+ this.detailsId = row.esOrderId
|
|
|
+ this.detailsType = type
|
|
|
+ },
|
|
|
+ // 关闭时事件
|
|
|
+ closeEvent: () => {
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ viewMaterialFlow(row){
|
|
|
+ this.$refs.tabPage.addTab({
|
|
|
+ // 对应显示的模块
|
|
|
+ activeKey: "materialFlow",
|
|
|
+ // 唯一标识
|
|
|
+ key: "materialFlow",
|
|
|
+ // 页签名称
|
|
|
+ label: "查看物流",
|
|
|
+ // 打开时事件
|
|
|
+ triggerEvent: () => {
|
|
|
+ this.detailsId = row.esOrderId
|
|
|
+ },
|
|
|
+ // 关闭时事件
|
|
|
+ closeEvent: () => {
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ gofahuo (row) {
|
|
|
+ this.$refs.tabPage.addTab({
|
|
|
+ // 对应显示的模块
|
|
|
+ activeKey: "fahuo",
|
|
|
+ // 唯一标识
|
|
|
+ key: "fahuo",
|
|
|
+ // 页签名称
|
|
|
+ label: "发货",
|
|
|
+ // 打开时事件
|
|
|
+ triggerEvent: () => {
|
|
|
+ this.detailsId = row.esOrderId
|
|
|
},
|
|
|
// 关闭时事件
|
|
|
closeEvent: () => {
|
|
@@ -364,16 +386,12 @@ export default {
|
|
|
this.listTotal = res.data.total;
|
|
|
})
|
|
|
},
|
|
|
- openForm(type, order) {
|
|
|
-
|
|
|
- },
|
|
|
// 更改每页数量
|
|
|
handleSizeChange(val) {
|
|
|
this.pageSize = val;
|
|
|
this.currentPage = 1;
|
|
|
this.getList();
|
|
|
},
|
|
|
-
|
|
|
// 更改当前页
|
|
|
handleCurrentChange(val) {
|
|
|
this.currentPage = val;
|
|
@@ -390,6 +408,148 @@ export default {
|
|
|
this.currentPage = 1;
|
|
|
this.getList();
|
|
|
},
|
|
|
+ // 导出
|
|
|
+ handleExport() {
|
|
|
+ let params = {
|
|
|
+ orderId: this.screenForm.orderId, // 订单号
|
|
|
+ esGoodsName: this.screenForm.esGoodsName, // 商品名称
|
|
|
+ userName: this.screenForm.userName, // 会员昵称
|
|
|
+ userMobile: this.screenForm.userMobile, // 手机号
|
|
|
+ status: this.screenForm.status, // 状态
|
|
|
+ startCreateTime: this.screenForm.createDate[0] ? this.screenForm.createDate[0] : null, // 创建时间
|
|
|
+ endCreateTime: this.screenForm.createDate[1] ? this.screenForm.createDate[1] : null, // 创建时间
|
|
|
+ startPayTime: this.screenForm.payDate[0] ? this.screenForm.payDate[0] : null, // 支付时间
|
|
|
+ endPayTime: this.screenForm.payDate[1] ? this.screenForm.payDate[1] : null, // 支付时间
|
|
|
+ pageNum: this.currentPage,
|
|
|
+ pageSize: this.pageSize
|
|
|
+ };
|
|
|
+ downloadFiles('esOrder/listExcel', params);
|
|
|
+ },
|
|
|
+ // 点击打印
|
|
|
+ async toPrint(row) {
|
|
|
+ const { data } = await esOrderDetail({
|
|
|
+ esOrderId: row.esOrderId
|
|
|
+ })
|
|
|
+ // 初始化模板,否则生成的模板叠加
|
|
|
+ hiprint.init()
|
|
|
+ this.hiprintTemplate = new hiprint.PrintTemplate()
|
|
|
+ // 使用 i-- 提升for效率
|
|
|
+ this.$startLoading()
|
|
|
+ try {
|
|
|
+ let num = data.num
|
|
|
+ let totalAmount = Number(data.num) * Number(data.goodsPrice)
|
|
|
+ let html = `
|
|
|
+ <tr align="center">
|
|
|
+ <td>${data.esGoodsName || ''}</td>
|
|
|
+ <td>${data.unit||''}</td>
|
|
|
+ <td>${data.num}</td>
|
|
|
+ <td>${data.goodsPrice}</td>
|
|
|
+ <td>${totalAmount}</td>
|
|
|
+ <td>${data.remark || ''}</td>
|
|
|
+ </tr>
|
|
|
+ `
|
|
|
+ // 模板基础配置
|
|
|
+ this.panel = this.hiprintTemplate.addPrintPanel({
|
|
|
+ height: 140,
|
|
|
+ width: 241,
|
|
|
+ fontFamily: '黑体',
|
|
|
+ fontSize: 13,
|
|
|
+ paperFooter: 340,
|
|
|
+ paperHeader: 10,
|
|
|
+ paperNumberDisabled: true
|
|
|
+ })
|
|
|
+ // 获取收款单模板和基础配置
|
|
|
+ this.panel.addPrintHtml({
|
|
|
+ options: {
|
|
|
+ width: 633,
|
|
|
+ top: 30,
|
|
|
+ left: 20,
|
|
|
+ fontFamily: '黑体',
|
|
|
+ fontSize: 13,
|
|
|
+ content: this.setTableDom(data, html, totalAmount, num, 1, 0)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } catch (error) {
|
|
|
+ this.$endLoading()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$endLoading()
|
|
|
+ // 预览打印内容
|
|
|
+ this.$refs.preView.show(this.hiprintTemplate, this.panel)
|
|
|
+ },
|
|
|
+ // 打印模板
|
|
|
+ setTableDom(data, html, totalAmount, num, length, page) {
|
|
|
+ let now = new Date();
|
|
|
+ let year = now.getFullYear();
|
|
|
+ let month = now.getMonth() + 1; // 月份是从 0 开始计数的,所以要加 1
|
|
|
+ let day = now.getDate();
|
|
|
+ let hours = now.getHours();
|
|
|
+ let minutes = now.getMinutes();
|
|
|
+ let seconds = now.getSeconds();
|
|
|
+ let nowTime = `${year}-${month < 10 ? '0'+month : month}-${day < 10 ? '0'+day : day} ${hours < 10 ? '0'+hours : hours}:${minutes < 10 ? '0'+minutes : minutes}:${seconds < 10 ? '0'+seconds : seconds}`
|
|
|
+ let showpPrintCount = `打印日期: ${nowTime}`;
|
|
|
+ return `
|
|
|
+ <div style="font-family:'黑体';font-size: 16px;">
|
|
|
+ <div style="display: flex;justify-content: center;align-items: center;position: relative;">
|
|
|
+ <h1 style="text-align:center;margin: 10px 0;">${JSON.parse(localStorage.getItem('greemall_user'))?.billTitle || data.companyWechatName}销售单</h1>
|
|
|
+ <div style="position: absolute;right:0;">共 ${length}页 第 ${page + 1} 页</div>
|
|
|
+ </div>
|
|
|
+ <div style="display: flex;justify-content: space-between;">
|
|
|
+ <div>${showpPrintCount}</div>
|
|
|
+ <div>单据日期: ${data.createTime}</div>
|
|
|
+ <div>单据编号: ${data.esOrderId}</div>
|
|
|
+ </div>
|
|
|
+ <div style="display: flex;justify-content: space-between;font-size: 16px;margin: 10px 0;">
|
|
|
+ <div>客户: ${data.userName}</div>
|
|
|
+ <div>摘要: ${({TRANSFER:"在线支付",WECHAT:"在线支付",CASH:"到店支付"})[data.payType]}</div>
|
|
|
+ </div>
|
|
|
+ <div style="display: flex;font-size: 16px;margin-bottom: 10px;">
|
|
|
+ <div style="flex-shrink: 0;">联系电话: ${data.userMobile}</div>
|
|
|
+ <div style="margin-left: 50px;">收货地址: ${data.province}${data.city}${data.area}${data.street}${data.receAddress}</div>
|
|
|
+ </div>
|
|
|
+ <div >
|
|
|
+ <table border=".5" cellspacing="0" width="856" style="border-color: rgb(0,0,0);border-collapse: collapse;border-style: none;border: 1px solid rgb(0,0,0);font-weight: normal;text-decoration: none;vertical-align: middle;box-sizing: border-box;word-wrap: break-word;word-break: break-all;">
|
|
|
+ <tr align="center">
|
|
|
+ <td>商品名称</td>
|
|
|
+ <td>单位</td>
|
|
|
+ <td>数量</td>
|
|
|
+ <td>单价</td>
|
|
|
+ <td>金额</td>
|
|
|
+ <td>备注</td>
|
|
|
+ </tr>
|
|
|
+ ${html}
|
|
|
+ <tr align="center" align="center">
|
|
|
+ <td>小计: </td>
|
|
|
+ <td></td>
|
|
|
+ <td>${num}</td>
|
|
|
+ <td>${totalAmount}</td>
|
|
|
+ <td>金额总计: ${totalAmount}</td>
|
|
|
+ <td></td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ <div style="display: flex;justify-content: space-between;font-size: 16px;margin: 10px 0;">
|
|
|
+ <div>制单人: ${data.createBy || ''}</div>
|
|
|
+ <div>审核人: ${JSON.parse(localStorage.getItem('greemall_user'))?.nickName || ''}</div>
|
|
|
+ <div>业务员: ${data.saleName || ''}</div>
|
|
|
+ <div>签收人: </div>
|
|
|
+ </div>
|
|
|
+ <div style="display: flex;justify-content: flex-end;">
|
|
|
+ </div>
|
|
|
+ <div style="margin:100px 0 0 0">
|
|
|
+ <div></div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ `
|
|
|
+ },
|
|
|
+ handleRefreshList() {
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ handleInitPrint() {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this?.initPrint()
|
|
|
+ })
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
|