|
@@ -48,19 +48,20 @@
|
|
|
<a-button id="replenishmentManagement-printSticker-modal-back" @click="isShow = false" style="margin-left: 15px;">取消</a-button>
|
|
|
</div>
|
|
|
</a-spin>
|
|
|
+
|
|
|
+ <!-- 打印预览弹框 -->
|
|
|
+ <printView ref="printView" :openModal="showView" @close="showView=false"></printView>
|
|
|
</a-modal>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { commonMixin } from '@/utils/mixin'
|
|
|
-import moment from 'moment'
|
|
|
-import QRCode from 'qrcodejs2'
|
|
|
-import { JGPrintTag } from '@/libs/JGPrint'
|
|
|
+import printView from './printView.vue'
|
|
|
import { STable, VSelect } from '@/components'
|
|
|
import { shelfReplenishDetailList, shelfReplenishDetail, shelfReplenishPrintSign } from '@/api/shelfReplenish'
|
|
|
export default {
|
|
|
name: 'PrintStickerModal',
|
|
|
- components: { STable, VSelect },
|
|
|
+ components: { STable, VSelect, printView },
|
|
|
mixins: [commonMixin],
|
|
|
props: {
|
|
|
openModal: { // 弹框显示状态
|
|
@@ -78,6 +79,7 @@ export default {
|
|
|
return {
|
|
|
spinning: false,
|
|
|
isShow: this.openModal, // 是否打开弹框
|
|
|
+ showView: false,
|
|
|
columns: [
|
|
|
{ title: '产品编码', dataIndex: 'product.code', width: '22%', align: 'center', customRender: function (text) { return text || '--' } },
|
|
|
{ title: '产品名称', dataIndex: 'product.name', width: '30%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
|
|
@@ -90,7 +92,7 @@ export default {
|
|
|
loadData: parameter => {
|
|
|
this.disabled = true
|
|
|
this.spinning = true
|
|
|
- return shelfReplenishDetailList(Object.assign(parameter, this.queryParam)).then(res => {
|
|
|
+ return shelfReplenishDetailList({ replenishBillSn: this.nowData && this.nowData.replenishBillSn }).then(res => {
|
|
|
let data
|
|
|
if (res.status == 200) {
|
|
|
data = res.data
|
|
@@ -126,40 +128,10 @@ export default {
|
|
|
if (!this.rowSelectionInfo || (this.rowSelectionInfo && this.rowSelectionInfo.selectedRows.length < 1)) {
|
|
|
this.$message.warning('请至少选择一个产品')
|
|
|
} else {
|
|
|
- // const qrcode = new QRCode(this.$refs.qrCodeUrl, {
|
|
|
- // text: 'dealerSn=1033242&shelfSn=342326735950757888&productCode=RPF2340&shelfPlaceCode=A01&shelfPlaceSn=123213', // 需要转换为二维码的内容
|
|
|
- // width: 40,
|
|
|
- // height: 40,
|
|
|
- // colorDark: '#000000',
|
|
|
- // colorLight: '#ffffff',
|
|
|
- // correctLevel: QRCode.CorrectLevel.H
|
|
|
- // })
|
|
|
const nowData = this.nowData
|
|
|
const list = this.rowSelectionInfo.selectedRows
|
|
|
- let htmlStr = ''
|
|
|
- for (let i = 0; i < list.length; i++) {
|
|
|
- htmlStr = htmlStr + '<div class="print-pages" style="font-size: 9px;padding:3pt 0 3pt 6pt;">'
|
|
|
- htmlStr = htmlStr + '<div class="storeName" style="text-align: center;font-weight: bold;margin: 2pt 0;">' + nowData.outStockPersonName + '</div>'
|
|
|
- htmlStr = htmlStr + '<div style="overflow: hidden;display: flex;justify-content: space-between;">'
|
|
|
- htmlStr = htmlStr + '<div style="padding-right: 3pt;">'
|
|
|
- htmlStr = htmlStr + '<div class="shelfName" style="margin-bottom: 2pt;">'
|
|
|
- htmlStr = htmlStr + nowData.shelfInfo.shelfName
|
|
|
- htmlStr = htmlStr + '</div>'
|
|
|
- htmlStr = htmlStr + '<div class="productCode" style="font-weight: bold;">' + list[i].productCode + '</div>'
|
|
|
- htmlStr = htmlStr + '<div class="productName">' + list[i].product.name + '</div>'
|
|
|
- htmlStr = htmlStr + '<div class="userName" style="margin-top: 2pt;font-size: 8px;">'
|
|
|
- htmlStr = htmlStr + '<span style="margin: 0 5pt 0 0;">' + moment().format('YYYY-MM-DD HH:mm') + '</span>'
|
|
|
- htmlStr = htmlStr + '<span>王明</span>'
|
|
|
- htmlStr = htmlStr + '</div>'
|
|
|
- htmlStr = htmlStr + '</div>'
|
|
|
- htmlStr = htmlStr + '<div>'
|
|
|
- htmlStr = htmlStr + '<div class="productSno" style="font-size: 16pt;text-align: center;">A08</div>'
|
|
|
- htmlStr = htmlStr + '<div class="qrcode" ref="qrCodeUrl" style="width: 40px;height: 40px;overflow: hidden;"></div>'
|
|
|
- htmlStr = htmlStr + '</div>'
|
|
|
- htmlStr = htmlStr + '</div>'
|
|
|
- htmlStr = htmlStr + '</div>'
|
|
|
- JGPrintTag(htmlStr, '40mm', '30mm', list[i].printQty)
|
|
|
- }
|
|
|
+ this.showView = true
|
|
|
+ this.$refs.printView.setData(nowData, list)
|
|
|
}
|
|
|
},
|
|
|
// 基本信息
|