|
@@ -120,19 +120,22 @@
|
|
|
highlight-current-row stripe @select="handleSelect" @select-all="handleSelectAll" show-summary
|
|
|
:summary-method="$getSummaries">
|
|
|
<el-table-column align="center" type="selection" width="55"></el-table-column>
|
|
|
- <el-table-column align="right" label="打印次数" prop="printNum" min-width="80" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="right" label="打印次数" prop="printNum" min-width="80" show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
|
|
|
<el-table-column align="left" label="订单类型" prop="orderType" min-width="100" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
- {{ scope.row.orderType | orderTypeFilter }}
|
|
|
+ {{ scope.row.orderType | orderTypeFilter }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="left" label="制单日期" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
- <el-table-column align="left" label="发货日期" prop="orderTime" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="left" label="制单日期" prop="createTime" min-width="160" show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="left" label="发货日期" prop="orderTime" min-width="160" show-overflow-tooltip>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column align="left" label="发货单号" prop="id" min-width="130" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
<CopyButton :copyText="scope.row.id" />
|
|
|
- <span>{{ scope.row.id }}</span>
|
|
|
+ <span>{{ scope.row.id }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="left" label="订单号" prop="orderId" min-width="130" show-overflow-tooltip>
|
|
@@ -140,23 +143,24 @@
|
|
|
|
|
|
<CopyButton
|
|
|
:copyText="scope.row.enginOrderType == 'HOME' || scope.row.enginOrderType == 'TRADE' ? scope.row.enginOrderNo : scope.row.mainOrderId" />
|
|
|
- <span>{{ scope.row.enginOrderType == 'HOME' || scope.row.enginOrderType == 'TRADE' ?
|
|
|
- scope.row.enginOrderNo
|
|
|
- : scope.row.mainOrderId
|
|
|
- }}</span>
|
|
|
+ <span>{{ scope.row.enginOrderType == 'HOME' || scope.row.enginOrderType == 'TRADE' ?
|
|
|
+ scope.row.enginOrderNo
|
|
|
+ : scope.row.mainOrderId
|
|
|
+
|
|
|
+ }}</span>
|
|
|
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="left" label="经销商编码" prop="customerNumber" min-width="100" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
<CopyButton :copyText="scope.row.customerNumber" />
|
|
|
- <span>{{ scope.row.customerNumber }}</span>
|
|
|
+ <span>{{ scope.row.customerNumber }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="left" label="经销商名称" prop="customerName" min-width="250" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
<CopyButton :copyText="scope.row.customerName" />
|
|
|
- <span>{{ scope.row.customerName }}</span>
|
|
|
+ <span>{{ scope.row.customerName }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="left" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip>
|
|
@@ -164,25 +168,25 @@
|
|
|
<el-table-column align="left" label="物料编码" prop="materialCode" min-width="120" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
<CopyButton :copyText="scope.row.materialCode" />
|
|
|
- <span>{{ scope.row.materialCode }}</span>
|
|
|
+ <span>{{ scope.row.materialCode }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="left" label="产品编码" prop="materialOldNumber" min-width="140" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
<CopyButton :copyText="scope.row.materialOldNumber" />
|
|
|
- <span>{{ scope.row.materialOldNumber }}</span>
|
|
|
+ <span>{{ scope.row.materialOldNumber }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="left" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
<CopyButton :copyText="scope.row.materialName" />
|
|
|
- <span>{{ scope.row.materialName }}</span>
|
|
|
+ <span>{{ scope.row.materialName }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="left" label="规格型号" prop="specification" min-width="350" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
<CopyButton :copyText="scope.row.specification" />
|
|
|
- <span>{{ scope.row.specification }}</span>
|
|
|
+ <span>{{ scope.row.specification }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="left" label="仓库" prop="correspondName" min-width="100" show-overflow-tooltip>
|
|
@@ -190,22 +194,22 @@
|
|
|
|
|
|
<el-table-column align="right" label="发货金额" prop="payAmount" min-width="100" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
- {{ scope.row.payAmount | numToFixed }}
|
|
|
+ {{ scope.row.payAmount | numToFixed }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="right" label="发货返利金额" prop="payRebateAmount" min-width="110" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
- {{ scope.row.payRebateAmount | numToFixed }}
|
|
|
+ {{ scope.row.payRebateAmount | numToFixed }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="right" label="发货折扣金额" prop="discAmount" min-width="110" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
- {{ scope.row.totalDiscAmount | numToFixed }}
|
|
|
+ {{ scope.row.totalDiscAmount | numToFixed }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="right" label="折扣额合计" prop="totalDiscAmount" min-width="100" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
- {{ (scope.row.totalDiscAmount + scope.row.payRebateAmount) | numToFixed }}
|
|
|
+ {{ (scope.row.totalDiscAmount + scope.row.payRebateAmount) | numToFixed }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="right" label="发货数量" prop="refundableQty" min-width="100" show-overflow-tooltip>
|
|
@@ -213,17 +217,17 @@
|
|
|
|
|
|
<el-table-column align="right" label="含税单价" prop="singlePayPrice" min-width="100" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
- {{ scope.row.singlePayPrice | numToFixed }}
|
|
|
+ {{ scope.row.singlePayPrice | numToFixed }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="right" label="含税总额" prop="singlePayPrice" min-width="100" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
- {{ scope.row.payAmount | numToFixed }}
|
|
|
+ {{ scope.row.payAmount | numToFixed }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="right" label="未出库数量" prop="singlePayPrice" min-width="100" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
- {{ comRefundableQty(scope.row.type, scope.row.salesExamineStatus, scope.row) }}
|
|
|
+ {{ comRefundableQty(scope.row.type, scope.row.salesExamineStatus, scope.row) }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align="left" label="表头业务员" prop="k3ServiceName" min-width="100" show-overflow-tooltip>
|
|
@@ -276,6 +280,9 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
+
|
|
|
+ <print-preview ref="preView" />
|
|
|
+
|
|
|
<el-dialog title="密码确认" :visible.sync="isShowDialog" :show-close="false" width="40%" :close-on-click-modal="false">
|
|
|
<el-form ref="dialogForm" :model="dialogForm" :rules="dialogFormRules" label-position="right" label-width="70px">
|
|
|
<el-row :gutter="20">
|
|
@@ -291,7 +298,8 @@
|
|
|
</el-col>
|
|
|
<el-col :xs="24" :sm="12" :lg="12" style="height: 51px;">
|
|
|
<el-form-item label="操作日期" prop="createDate">
|
|
|
- <el-date-picker v-model="dialogForm.createDate" readonly type="date" value-format="yyyy-MM-dd" style="width: 100%;" placeholder="选择日期">
|
|
|
+ <el-date-picker v-model="dialogForm.createDate" readonly type="date" value-format="yyyy-MM-dd"
|
|
|
+ style="width: 100%;" placeholder="选择日期">
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -303,9 +311,7 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <!-- <PrintTest v-if="isShowPrint" /> -->
|
|
|
- <SumPrint :listItem="queryItem" v-if="isShowPrint" @backListFormDetail="backList" />
|
|
|
-
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -314,12 +320,19 @@ import { getSumList } from '@/api/supply/deliver'
|
|
|
import { checkPassword } from "@/api/supply/pickup";
|
|
|
import { getCategoryList, getSalesmanList } from '@/api/common'
|
|
|
import SumPrint from '@/views/supply/deliver/components/sum_print'
|
|
|
-import PrintTest from '@/components/Common/print-test'
|
|
|
|
|
|
+import { disAutoConnect, hiprint, defaultElementTypeProvider } from 'vue-plugin-hiprint'
|
|
|
+disAutoConnect();
|
|
|
+
|
|
|
+import panel from './components/design/panel'
|
|
|
+import { getDetail, detailArr } from './components/design/print-data'
|
|
|
+
|
|
|
+import printPreview from './components/design/preview.vue'
|
|
|
export default {
|
|
|
components: {
|
|
|
SumPrint,
|
|
|
- PrintTest
|
|
|
+ printPreview
|
|
|
+
|
|
|
},
|
|
|
filters: {
|
|
|
orderTypeFilter(val) {
|
|
@@ -368,7 +381,41 @@ export default {
|
|
|
tableSelection: [],
|
|
|
queryItem: {},
|
|
|
isShowPrint: false,
|
|
|
+ curPaper: {
|
|
|
+ type: 'A5',
|
|
|
+ width: 500,
|
|
|
+ height: 147.6
|
|
|
|
|
|
+ },
|
|
|
+ paperTypes: {
|
|
|
+ 'A3': {
|
|
|
+ width: 420,
|
|
|
+ height: 296.6
|
|
|
+ },
|
|
|
+ 'A4': {
|
|
|
+ width: 210,
|
|
|
+ height: 296.6
|
|
|
+ },
|
|
|
+ 'A5': {
|
|
|
+ width: 210,
|
|
|
+ height: 147.6
|
|
|
+ },
|
|
|
+ 'B3': {
|
|
|
+ width: 500,
|
|
|
+ height: 352.6
|
|
|
+ },
|
|
|
+ 'B4': {
|
|
|
+ width: 250,
|
|
|
+ height: 352.6
|
|
|
+ },
|
|
|
+ 'B5': {
|
|
|
+ width: 250,
|
|
|
+ height: 175.6
|
|
|
+ }
|
|
|
+ },
|
|
|
+ scaleValue: 1,
|
|
|
+ scaleMax: 5,
|
|
|
+ scaleMin: 0.5,
|
|
|
isShowDialog: false,
|
|
|
dialogForm: {
|
|
|
password: "",
|
|
@@ -378,6 +425,7 @@ export default {
|
|
|
dialogFormRules: {
|
|
|
password: [{ required: true, message: "请输入密码", trigger: "blur" }],
|
|
|
},
|
|
|
+ hiprintTemplate:''
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -413,6 +461,18 @@ export default {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+ },
|
|
|
+ curPaperType() {
|
|
|
+ let type = 'other'
|
|
|
+ let types = this.paperTypes
|
|
|
+ for (const key in types) {
|
|
|
+ let item = types[key]
|
|
|
+ let { width, height } = this.curPaper
|
|
|
+ if (item.width === width && item.height === height) {
|
|
|
+ type = key
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return type
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -421,8 +481,44 @@ export default {
|
|
|
this.getCategoryList();
|
|
|
this.getList();
|
|
|
},
|
|
|
-
|
|
|
+ activated(){
|
|
|
+ this.initPrint()
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ initPrint(){
|
|
|
+ hiprint.init({
|
|
|
+ providers: [new defaultElementTypeProvider()]
|
|
|
+ });
|
|
|
+ // 还原配置
|
|
|
+ hiprint.setConfig()
|
|
|
+ // 替换配置
|
|
|
+ hiprint.setConfig({
|
|
|
+ movingDistance: 2.5,
|
|
|
+ text: {
|
|
|
+ supportOptions: [
|
|
|
+ {
|
|
|
+ name: 'styler',
|
|
|
+ hidden: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'formatter',
|
|
|
+ hidden: true
|
|
|
+ },
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // eslint-disable-next-line no-undef
|
|
|
+ hiprint.PrintElementTypeManager.buildByHtml($('.ep-draggable-item'));
|
|
|
+ this.hiprintTemplate = new hiprint.PrintTemplate({
|
|
|
+ template: panel,
|
|
|
+ settingContainer: '#PrintElementOptionSetting',
|
|
|
+ paginationContainer: '.hiprint-printPagination'
|
|
|
+ });
|
|
|
+ this.hiprintTemplate.design('#hiprint-printTemplate');
|
|
|
+ // 获取当前放大比例, 当zoom时传true 才会有
|
|
|
+ // this.scaleValue = hiprintTemplate.editingPanel.scale || 1;
|
|
|
+ }
|
|
|
+,
|
|
|
// 获取业务员列表
|
|
|
getSalesmanList() {
|
|
|
getSalesmanList({
|
|
@@ -447,8 +543,8 @@ export default {
|
|
|
|
|
|
// 查询列表
|
|
|
getList() {
|
|
|
+ console.log(888);
|
|
|
this.listLoading = true;
|
|
|
-
|
|
|
let params = {
|
|
|
pageNum: this.currentPage,
|
|
|
pageSize: this.pageSize,
|
|
@@ -522,9 +618,19 @@ export default {
|
|
|
|
|
|
// 点击打印
|
|
|
toPrint() {
|
|
|
+ // this.$refs
|
|
|
+ this.queryItem = this.tableSelection;
|
|
|
+ // console.log(this.tableSelection);
|
|
|
+ // this.isShowPrint = true;
|
|
|
+ // this.$refs.myPdfComponent.print()
|
|
|
+ // console.log(this.hiprintTemplate, detailArr);
|
|
|
+ // getDetail(this.tableSelection)
|
|
|
+ // this.$refs.preView.show(this.hiprintTemplate, detailArr)
|
|
|
if (!this.tableSelection[0].printNum) {
|
|
|
this.queryItem = this.tableSelection;
|
|
|
- this.isShowPrint = true;
|
|
|
+ // this.isShowPrint = true;
|
|
|
+ getDetail(this.tableSelection)
|
|
|
+ this.$refs.preView.show(this.hiprintTemplate, detailArr)
|
|
|
} else {
|
|
|
this.queryItem = this.tableSelection;
|
|
|
this.dialogForm.createMan = JSON.parse(
|
|
@@ -551,7 +657,8 @@ export default {
|
|
|
};
|
|
|
checkPassword(params).then((res) => {
|
|
|
this.cancelDialogForm();
|
|
|
- this.isShowPrint = true;
|
|
|
+ getDetail(this.tableSelection)
|
|
|
+ this.$refs.preView.show(this.hiprintTemplate, detailArr)
|
|
|
});
|
|
|
}
|
|
|
});
|
|
@@ -571,6 +678,9 @@ export default {
|
|
|
}
|
|
|
var currentdate = year + seperator1 + month + seperator1 + strDate;
|
|
|
return currentdate;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
|
|
|
backList() {
|
|
@@ -578,6 +688,25 @@ export default {
|
|
|
this.isShowPrint = false;
|
|
|
},
|
|
|
|
|
|
+ /**
|
|
|
+ * 设置纸张大小
|
|
|
+ * @param type [A3, A4, A5, B3, B4, B5, other]
|
|
|
+ * @param value {width,height} mm
|
|
|
+ */
|
|
|
+ setPaper(type, value) {
|
|
|
+ try {
|
|
|
+ if (Object.keys(this.paperTypes).includes(type)) {
|
|
|
+ this.curPaper = { type: type, width: value.width, height: value.height }
|
|
|
+ this.hiprintTemplate.setPaper(value.width, value.height)
|
|
|
+ } else {
|
|
|
+ this.curPaper = { type: 'other', width: value.width, height: value.height }
|
|
|
+ this.hiprintTemplate.setPaper(value.width, value.height)
|
|
|
+
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ this.$message.error(`操作失败: ${error}`)
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
}
|
|
|
}
|