马远东 1 year ago
parent
commit
f34a0de45e
  1. 19
      src/api/distribution/distributionStockArticle.js
  2. 64
      src/components/MyPrint/MyPrint.vue
  3. 3
      src/main.js
  4. 2
      src/option/distribution/distributionStockArticleSelf.js
  5. 8
      src/styles/element-ui.scss
  6. 4
      src/utils/print.js
  7. 28
      src/utils/util.js
  8. 4
      src/views/basicdata/warehouse/goodsAllocation/BasicdataGoodsAllocation.vue
  9. 2
      src/views/basicdata/warehouse/goodsShelf/basicdataGoodsShelf.vue
  10. 60
      src/views/distribution/inventory/delivery/distributionStockArticle.vue
  11. 55
      src/views/distribution/inventory/delivery/distributionStockArticleDiscuss.vue
  12. 49
      src/views/distribution/inventory/delivery/distributionStockArticleMarket.vue
  13. 54
      src/views/distribution/inventory/delivery/distributionStockArticleSelf.vue
  14. 25
      src/views/distribution/inventory/distributionStockArticleDetails.vue
  15. 3
      src/views/distribution/inventory/distributionStockListDetails.vue
  16. 2
      src/views/distribution/turndelivery/deliveryMarket.vue
  17. 5
      src/views/warehouse/parcelList/distributionParcelList.vue

19
src/api/distribution/distributionStockArticle.js

@ -308,7 +308,7 @@ export const selectUpdateAvailableStockArticle = (current, size, params) => {
});
};
export const getPackageListByStockArticleId = (current, size,params) => {
export const getPackageListByStockArticleId = (current, size, params) => {
return request({
url: '/api/logpm-distribution/distributionStockArticle/getPackageListByStockArticleId',
method: 'get',
@ -328,10 +328,19 @@ export const $_getPackageListByStockArticleId = params => {
};
// 修改运单收货人
export const $_Modifywaybillrecipient = (data) => {
export const $_Modifywaybillrecipient = data => {
return request({
url: '/api/logpm-distribution/distributionStockArticle/updateBatchClient',
method: 'post',
data
})
}
data,
});
};
// 修改运单收货人
export const postShowOrderCode = params => {
return request({
url: '/api/logpm-distribution/distributionStockArticle/showOrderCode',
method: 'get',
params,
});
};

64
src/components/MyPrint/MyPrint.vue

@ -0,0 +1,64 @@
<template>
<div>
<el-dialog v-model="visible" :title="props.title" :width="props.width">
<div class="printCode">
<div v-html="props.html"></div>
</div>
<div class="flex-c-c mt10">
<el-button type="primary" @click="handleClose"> </el-button>
<el-button type="primary" @click="printTemplate" icon="Printer"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import { defineProps, computed } from 'vue';
import print from '@/utils/print';
const props = defineProps({
html: {
type: String,
default: '',
},
modelValue: {
type: Boolean,
default: false,
},
width: {
type: String,
default: '780px',
},
title: {
type: String,
default: '二维码',
},
});
const $emit = defineEmits(['update:modelValue']);
const visible = computed({
get: () => props.modelValue,
set: val => {
$emit('update:modelValue', val);
},
});
const handleClose = () => {
visible.value = false;
};
const printTemplate = () => {
const printNode = document.querySelectorAll('.printCode > div > div');
console.log('printNode :>> ', printNode);
print(printNode);
};
</script>
<style scoped lang="scss">
.printCode {
max-height: 80vh;
overflow-y: scroll;
}
</style>

3
src/main.js

@ -29,6 +29,7 @@ import WaybillPrintTemplate from './components/WaybillPrintTemplate/WaybillPrint
import ArteryPrintTemplate from './components/ArteryPrintTemplate/ArteryPrintTemplate.vue';
import TripartiteTransferPrintTemplate from './components/TripartiteTransferPrintTemplate/TripartiteTransferPrintTemplate.vue';
import ImgList from './components/ImgList/ImgList.vue';
import MyPrint from './components/MyPrint/MyPrint.vue';
import { message } from './utils/resetMessage';
import App from './App.vue';
import 'animate.css';
@ -54,6 +55,8 @@ app.component('tenantPackage', tenantPackage);
app.component('tablecmt', tablecmt);
app.component('edittablehead', edittablehead);
app.component('SelectBox', SelectBox);
/** 打印 */
app.component('MyPrint', MyPrint);
/** 运单打印模版 */
app.component('WaybillPrintTemplate', WaybillPrintTemplate);
/** 干线运输打印模版 */

2
src/option/distribution/distributionStockArticleSelf.js

@ -475,7 +475,7 @@ export const columnList = [
label: '操作',
type: 6,
values: '',
width: '200',
width: '250',
checkarr: [],
fixed: 'right',
hide: true,

8
src/styles/element-ui.scss

@ -69,6 +69,12 @@
background-color: #fafafa;
}
// 页码组件激活样式字体不加粗
li.is-active{
li.is-active {
font-weight: normal !important;
}
.el-tag {
--el-tag-bg-color: #d3832a !important;
--el-tag-text-color: #fff !important;
--el-tag-border-color: #d3832a !important;
}

4
src/utils/print.js

@ -14,6 +14,8 @@ const print = nodeList => {
// 当列表内没有元素时, 退出函数
if (nodeList.length === 0) return;
// 循环列表内元素并打印
nodeList.forEach(orderNode => {
LODOP.PRINT_INITA(1, 1, 900, 660, '测试预览功能');
LODOP.SET_PRINT_MODE('WINDOW_DEFPRINTER', 'Godex G500');
LODOP.SET_PRINT_STYLEA(0, 'TextNeatRow', true); //允许标点溢出,且英文单词拆开
@ -22,8 +24,6 @@ const print = nodeList => {
LODOP.SET_PRINT_MODE('PRINT_PAGE_PERCENT', 'Auto-Width');
// // 设置打印后自动关闭
LODOP.SET_PRINT_MODE('AUTO_CLOSE_PREWINDOW', 1);
// 循环列表内元素并打印
nodeList.forEach(orderNode => {
console.log(orderNode, 'orderNode');
let templateData = orderNode.innerHTML;

28
src/utils/util.js

@ -689,3 +689,31 @@ export function handleClearTableQuery(tableColumnList) {
value.values = '';
}
}
/**
* 文本换行
* @param {string} className 类名
* @param {number} num 多少字进行换行
* @returns
*/
export function hanleTextLineFeed(className, num) {
const node = document.querySelectorAll(`.${className}`);
if (node.length === 0) return;
for (let i = 0; i < node.length; i++) {
const value = node[i];
// 获取文本
const text = value.innerText;
// 循环次数, 换多少次行
const cycleNumber = Math.ceil(text.length / num);
let addText = '';
for (let index = 0; index < cycleNumber; index++) {
const sliceText = text.slice(index * num, (index + 1) * num);
addText += index < cycleNumber - 1 ? sliceText + '</br>' : sliceText;
}
value.innerHTML = addText;
}
}

4
src/views/basicdata/warehouse/goodsAllocation/BasicdataGoodsAllocation.vue

@ -399,7 +399,7 @@ export default {
//
printTemplate() {
const printNode = document.querySelectorAll('.print_QRCode>div>div');
console.log('printNode :>> ', printNode);
print(printNode);
},
async handleqr() {
@ -420,7 +420,7 @@ export default {
this.html = '';
this.loadingObj.pageLoading = true;
const res = await getPrintTemplate({
ids:qr
ids: qr,
});
const { code, data } = res.data;

2
src/views/basicdata/warehouse/goodsShelf/basicdataGoodsShelf.vue

@ -1362,6 +1362,8 @@ export default {
const nodeList = document.querySelectorAll('.printNode > div');
console.log('nodeList :>> ', nodeList);
print(nodeList);
},
rowDel(row) {

60
src/views/distribution/inventory/delivery/distributionStockArticle.vue

@ -1,6 +1,6 @@
<template>
<!--全部订单-->
<basic-container>
<basic-container v-loading="loadingObj.pageLoading">
<div class="avue-crud">
<div v-h5uShow="!search">
<!-- 查询模块 -->
@ -126,16 +126,26 @@
>
<template #default="slotProps">
<template v-if="slotProps.scope.column.label === '货位信息'">
<div style="width: 100%">
<el-tag
v-for="item in slotProps.scope.row.allocation
? slotProps.scope.row.allocation.split(',')
: []"
:key="item"
>{{ item }}</el-tag
style="margin-right: 5px"
>
{{ item }}
</el-tag>
</div>
</template>
<template v-if="slotProps.scope.column.label === '操作'">
<el-text
v-if="Number(slotProps.scope.row.isZero) !== 0"
@click="handleShowOrderCode(slotProps.scope)"
>
查看二维码
</el-text>
<el-text @click="handleView(slotProps.scope)"> 查看 </el-text>
<el-text @click="handleCallDeliveryOwn(slotProps.scope)"> 修改客户信息 </el-text>
</template>
@ -363,6 +373,8 @@
</span>
</template>
</el-dialog>
<MyPrint v-model="popUpShow.printVisited" :html="html" :title="'配送单'"> </MyPrint>
</div>
</basic-container>
<edittablehead
@ -382,6 +394,7 @@ import {
remove,
addStock,
stockArticExport,
postShowOrderCode,
} from '@/api/distribution/distributionStockArticle';
import { getListOwn } from '@/api/distribution/distributionParcelList';
import { addCallDelivery } from '@/api/distribution/distrilbutionCallDelivery';
@ -396,7 +409,7 @@ import { exportBlob } from '@/api/common';
import { getToken } from '@/utils/auth';
import { downloadXls } from '@/utils/util';
import { columnList } from '@/option/distribution/distributionStockArticleSelf';
import { deepClone, setNodeHeight } from '@/utils/util.js';
import { deepClone, setNodeHeight, hanleTextLineFeed } from '@/utils/util.js';
const _newCol = deepClone(columnList);
export default {
@ -505,6 +518,16 @@ export default {
},
},
],
/** loading */
loadingObj: {
/** 页面loading */
pageLoading: false,
},
/** 渲染的html */
html: '',
popUpShow: {
printVisited: false,
},
};
},
mounted() {
@ -1307,6 +1330,27 @@ export default {
this.loading = false;
}
},
/** 显示订单二维码 */
async handleShowOrderCode({ row }) {
try {
this.loadingObj.pageLoading = true;
const res = await postShowOrderCode({ ids: row.id });
const { code, data } = res.data;
if (code !== 200) return;
this.html = this.getHtmls(data.dataList, data.templateHtml);
this.popUpShow.printVisited = true;
await this.$nextTick();
hanleTextLineFeed('product', 40);
hanleTextLineFeed('customerAddress', 40);
} catch (error) {
console.log('error :>> ', error);
} finally {
this.loadingObj.pageLoading = false;
}
},
},
};
</script>
@ -1367,9 +1411,9 @@ export default {
}
//
:deep(.el-tag) {
margin: 0 3px;
--el-tag-bg-color: var(--el-color-info-light-9);
color: var(--el-color-primary);
}
// :deep(.el-tag) {
// margin: 0 3px;
// --el-tag-bg-color: var(--el-color-info-light-9);
// color: var(--el-color-primary);
// }
</style>

55
src/views/distribution/inventory/delivery/distributionStockArticleDiscuss.vue

@ -1,6 +1,6 @@
<template>
<!--全部订单-->
<basic-container>
<basic-container v-loading="loadingObj.pageLoading">
<div class="avue-crud">
<div v-h5uShow="!search">
<!-- 查询模块 -->
@ -60,7 +60,6 @@
</div>
</div>
</el-row>
<el-row>
<!-- 列表模块 -->
<tablecmt
ref="tableNode"
@ -75,16 +74,27 @@
>
<template #default="slotProps">
<template v-if="slotProps.scope.column.label === '货位信息'">
<div style="width: 100%">
<el-tag
v-for="item in slotProps.scope.row.allocation
? slotProps.scope.row.allocation.split(',')
: []"
:key="item"
>{{ item }}</el-tag
style="margin-right: 5px"
>
{{ item }}
</el-tag>
</div>
</template>
<template v-if="slotProps.scope.column.label === '操作'">
<el-text
v-if="Number(slotProps.scope.row.isZero) !== 0"
@click="handleShowOrderCode(slotProps.scope)"
>
查看二维码
</el-text>
<el-text type="primary" text icon="el-icon-view" @click="handleView(slotProps.scope)"
>查看</el-text
>
@ -98,7 +108,6 @@
</template>
</template>
</tablecmt>
</el-row>
<el-row class="el-fy">
<div class="avue-crud__pagination flex-c-sb" style="width: 100%">
<div style="font-size: 14px">勾选数量: {{ selectionList.length }}</div>
@ -360,6 +369,8 @@
</template>
</el-dialog>
</div>
<MyPrint v-model="popUpShow.printVisited" :html="html" :title="'配送单'"> </MyPrint>
</basic-container>
<edittablehead
@setcolum="setnewcolum"
@ -380,6 +391,7 @@ import {
addStock,
stockArticExport,
$_Modifywaybillrecipient,
postShowOrderCode,
} from '@/api/distribution/distributionStockArticle';
import { getListOwn } from '@/api/distribution/distributionParcelList';
import { addCallDelivery } from '@/api/distribution/distrilbutionCallDelivery';
@ -391,9 +403,9 @@ import { getDictionaryBiz } from '@/api/system/dict';
import dayjs from 'dayjs';
import { downloadXls, setNodeHeight } from '@/utils/util';
import { columnList } from '@/option/distribution/distributionStockArticleSelf';
import { deepClone } from '@/utils/util.js';
const _newCol = deepClone(columnList);
import { deepClone, hanleTextLineFeed } from '@/utils/util.js';
import { ElMessage } from 'element-plus';
const _newCol = deepClone(columnList);
export default {
data() {
return {
@ -483,6 +495,16 @@ export default {
},
},
],
/** loading */
loadingObj: {
/** 页面loading */
pageLoading: false,
},
/** 渲染的html */
html: '',
popUpShow: {
printVisited: false,
},
};
},
mounted() {
@ -1242,6 +1264,27 @@ export default {
this.loading = false;
}
},
/** 显示订单二维码 */
async handleShowOrderCode({ row }) {
try {
this.loadingObj.pageLoading = true;
const res = await postShowOrderCode({ ids: row.id });
const { code, data } = res.data;
if (code !== 200) return;
this.html = this.getHtmls(data.dataList, data.templateHtml);
this.popUpShow.printVisited = true;
await this.$nextTick();
hanleTextLineFeed('product', 40);
hanleTextLineFeed('customerAddress', 40);
} catch (error) {
console.log('error :>> ', error);
} finally {
this.loadingObj.pageLoading = false;
}
},
},
};
</script>

49
src/views/distribution/inventory/delivery/distributionStockArticleMarket.vue

@ -1,6 +1,6 @@
<template>
<!--全部订单-->
<basic-container>
<basic-container v-loading="loadingObj.pageLoading">
<div class="avue-crud">
<div v-h5uShow="!search">
<!-- 查询模块 -->
@ -104,16 +104,27 @@
>
<template #default="slotProps">
<template v-if="slotProps.scope.column.label === '货位信息'">
<div style="width: 100%">
<el-tag
v-for="item in slotProps.scope.row.allocation
? slotProps.scope.row.allocation.split(',')
: []"
:key="item"
>{{ item }}</el-tag
style="margin-right: 5px"
>
{{ item }}
</el-tag>
</div>
</template>
<template v-if="slotProps.scope.column.label === '操作'">
<el-text
v-if="Number(slotProps.scope.row.isZero) !== 0"
@click="handleShowOrderCode(slotProps.scope)"
>
查看二维码
</el-text>
<el-text type="primary" text icon="el-icon-view" @click="handleView(slotProps.scope)"
>查看</el-text
>
@ -351,6 +362,8 @@
</template>
</el-dialog>
</div>
<MyPrint v-model="popUpShow.printVisited" :html="html" :title="'配送单'"> </MyPrint>
</basic-container>
<edittablehead
@setcolum="setnewcolum"
@ -369,6 +382,7 @@ import {
remove,
addStock,
stockArticExport,
postShowOrderCode,
} from '@/api/distribution/distributionStockArticle';
import { getListOwn } from '@/api/distribution/distributionParcelList';
import { addCallDelivery } from '@/api/distribution/distrilbutionCallDelivery';
@ -458,6 +472,16 @@ export default {
},
},
],
/** loading */
loadingObj: {
/** 页面loading */
pageLoading: false,
},
/** 渲染的html */
html: '',
popUpShow: {
printVisited: false,
},
};
},
mounted() {
@ -1196,6 +1220,27 @@ export default {
this.loading = false;
}
},
/** 显示订单二维码 */
async handleShowOrderCode({ row }) {
try {
this.loadingObj.pageLoading = true;
const res = await postShowOrderCode({ ids: row.id });
const { code, data } = res.data;
if (code !== 200) return;
this.html = this.getHtmls(data.dataList, data.templateHtml);
this.popUpShow.printVisited = true;
await this.$nextTick();
hanleTextLineFeed('product', 40);
hanleTextLineFeed('customerAddress', 40);
} catch (error) {
console.log('error :>> ', error);
} finally {
this.loadingObj.pageLoading = false;
}
},
},
};
</script>

54
src/views/distribution/inventory/delivery/distributionStockArticleSelf.vue

@ -1,6 +1,6 @@
<template>
<!--全部订单-->
<basic-container>
<basic-container v-loading="loadingObj.pageLoading">
<div class="avue-crud">
<div v-h5uShow="!search">
<!-- 查询模块 -->
@ -72,7 +72,7 @@
</div>
</div>
</el-row>
<el-row>
<!-- 列表模块 -->
<tablecmt
ref="tableNode"
@ -87,16 +87,26 @@
>
<template #default="slotProps">
<template v-if="slotProps.scope.column.label === '货位信息'">
<div style="width: 100%">
<el-tag
v-for="item in slotProps.scope.row.allocation
? slotProps.scope.row.allocation.split(',')
: []"
:key="item"
>{{ item }}</el-tag
style="margin-right: 5px"
>
{{ item }}
</el-tag>
</div>
</template>
<template v-if="slotProps.scope.column.label === '操作'">
<el-text
v-if="Number(slotProps.scope.row.isZero) !== 0"
@click="handleShowOrderCode(slotProps.scope)"
>
查看二维码
</el-text>
<el-text type="primary" text icon="el-icon-view" @click="handleView(slotProps.scope)"
>查看</el-text
>
@ -110,7 +120,7 @@
</template>
</template>
</tablecmt>
</el-row>
<el-row class="el-fy">
<div class="avue-crud__pagination flex-c-sb" style="width: 100%">
<div style="font-size: 14px">勾选数量: {{ selectionList.length }}</div>
@ -514,6 +524,7 @@
</span>
</template>
</el-dialog>-->
<MyPrint v-model="popUpShow.printVisited" :html="html" :title="'配送单'"> </MyPrint>
</div>
</basic-container>
<edittablehead
@ -534,6 +545,7 @@ import {
addStock,
stockArticExport,
$_Modifywaybillrecipient,
postShowOrderCode,
} from '@/api/distribution/distributionStockArticle';
import { getListOwn } from '@/api/distribution/distributionParcelList';
import { addCallDelivery } from '@/api/distribution/distrilbutionCallDelivery';
@ -548,8 +560,8 @@ import { getListMaterial } from '@/api/basic/basicMaterial';
import { downloadXls, setNodeHeight } from '@/utils/util';
import { columnList } from '@/option/distribution/distributionStockArticleSelf';
import { deepClone } from '@/utils/util.js';
const _newCol = deepClone(columnList);
import { ElMessage } from 'element-plus';
const _newCol = deepClone(columnList);
export default {
data() {
return {
@ -656,6 +668,16 @@ export default {
},
},
],
/** loading */
loadingObj: {
/** 页面loading */
pageLoading: false,
},
/** 渲染的html */
html: '',
popUpShow: {
printVisited: false,
},
};
},
created() {
@ -1578,9 +1600,31 @@ export default {
this.loading = false;
}
},
/** 显示订单二维码 */
async handleShowOrderCode({ row }) {
try {
this.loadingObj.pageLoading = true;
const res = await postShowOrderCode({ ids: row.id });
const { code, data } = res.data;
if (code !== 200) return;
this.html = this.getHtmls(data.dataList, data.templateHtml);
this.popUpShow.printVisited = true;
await this.$nextTick();
hanleTextLineFeed('product', 40);
hanleTextLineFeed('customerAddress', 40);
} catch (error) {
console.log('error :>> ', error);
} finally {
this.loadingObj.pageLoading = false;
}
},
},
};
</script>
<style scoped lang="scss">
.el-button--text {
margin-right: 15px;

25
src/views/distribution/inventory/distributionStockArticleDetails.vue

@ -373,6 +373,7 @@ import { getStockTemplate } from '@/api/distribution/distributionStockArticle';
import dayjs from 'dayjs';
import print from '@/utils/print';
import { ElMessage } from 'element-plus';
import { hanleTextLineFeed } from '@/utils/util';
export default {
data() {
return {
@ -1053,23 +1054,6 @@ export default {
break;
}
},
//
handlebill(row) {
console.log('>>>>', this.ids);
if (this.selectionList.length === 0) {
this.$message.warning('请选择至少一条数据');
return;
}
this.$store.commit('DEL_ONCE_TAG', '^/distribution/inventory/distrilbutionBillLading\\?');
this.$router.push({
path: '/distribution/inventory/distrilbutionBillLading',
query: {
id: this.ids,
},
});
},
//
handleCallDelivery(ind, row) {
switch (ind) {
@ -1368,12 +1352,17 @@ export default {
ids: row.id,
};
this.html = '';
showOrderPackgeCode(qr).then(res => {
showOrderPackgeCode(qr).then(async res => {
// this.orderPackageCode = res.data
// console.log(res.data);
console.log('res :>> ', res);
this.html = this.getHtmls(res.data.data.dataList, res.data.data.templateHtml);
this.dialogVisible = true;
await this.$nextTick();
hanleTextLineFeed('category', 15);
hanleTextLineFeed('customer', 45);
});
},
handleTrajectory(row) {

3
src/views/distribution/inventory/distributionStockListDetails.vue

@ -626,6 +626,9 @@ export default {
'$route.query.id': {
handler(newVal, oldVal) {
// console.log(newVal, oldVal);
if (this.$route.path !== '/distribution/inventory/distributionStockListDetails') return;
this.activeName = 'library';
this.query = {}
this.init();
},
deep: true,

2
src/views/distribution/turndelivery/deliveryMarket.vue

@ -1553,7 +1553,7 @@ export default {
a.push(item);
//
if (i === 0) this.driverForm.masterDriverName = item.name;
if (!this.driverForm.masterVehicleNub)
if (!this.driverForm.masterVehicleNub && item.vehicleVOList)
this.driverForm.masterVehicleNub = item.vehicleVOList[0].vehicleNub;
// , ,

5
src/views/warehouse/parcelList/distributionParcelList.vue

@ -892,11 +892,8 @@ export default {
},
inputsc(index, row) {
if (!row.values) {
return;
}
this.query[row.prop] = index;
console.log(this.query);
if (!index) delete this.query[row.prop];
this.page.currentPage = 1;
this.onLoad(this.page);
},

Loading…
Cancel
Save