-
-
-
-
-
+
diff --git a/src/utils/print.ts b/src/utils/print.ts
index 18eed04..5d61d20 100644
--- a/src/utils/print.ts
+++ b/src/utils/print.ts
@@ -1,4 +1,5 @@
import { hiprint, defaultElementTypeProvider } from "vue-plugin-hiprint";
+import { cashierclassSetPrintAdd } from "@/api/opurchaseclass";
// 引入后使用示例
hiprint.init();
@@ -8,8 +9,10 @@ hiprint.hiwebSocket.setHost("http://localhost:17521");
// 配置
const WIDTH = 58; //纸张宽度 mm
+const HEIGHT = 155; //纸张高度 mm 使用时需另外计算商品高度
const T_WIDTH = 150; //文本宽度 pt
const T_LEFT = 4; //文本左边距 pt
+const textHeight = 10; //文本高度
export const print = (data: any) => {
// hiprint对象获取
@@ -17,18 +20,17 @@ export const print = (data: any) => {
console.log(list);
let nowHeight = 0;
- let textHeight = 10;
// 下列方法都是没有拖拽设计页面的, 相当于代码模式, 使用代码设计页面
// 想要实现拖拽设计页面,请往下看 '自定义设计'
var hiprintTemplate = new hiprint.PrintTemplate();
// 纸张高度 固定为 130 pt + 商品数量高度
- let oneHeight = 120 + Math.ceil((data.info.length * 2 * 10) / 2.84);
+ let oneHeight = HEIGHT + Math.ceil((data.info.length * 2 * 10) / 2.84);
// 模板宽度单位是mm ( 1mm ~= 2.84pt ) 其他的宽高单位是pt
var panel = hiprintTemplate.addPrintPanel({
- width: 58, // 58mm = 164pt
+ width: WIDTH, // 58mm = 164pt
height: oneHeight,
paperNumberDisabled: true,
});
@@ -119,7 +121,9 @@ export const print = (data: any) => {
});
};
- //文本 *1
+ //文本 *3
+ panel.addPrintText(options("======================"));
+ panel.addPrintText(options(""));
panel.addPrintText(
options({
title: "泸优采-采购单",
@@ -139,7 +143,8 @@ export const print = (data: any) => {
lineTitle();
data.info.forEach((item: any) => {
panel.addPrintText(options(item.goods_name));
- if(item.nums==Math.floor(+item.nums)) item.nums = Number(item.nums).toFixed(0);
+ if (item.nums == Math.floor(+item.nums))
+ item.nums = Number(item.nums).toFixed(0);
lineOptions(
`${item.price}元`,
`${item.nums}${item.unit_name}`,
@@ -170,6 +175,7 @@ export const print = (data: any) => {
},
});
nowHeight += 60;
+
// 文本 *4
panel.addPrintText(options("收货人: " + data.real_name));
panel.addPrintText(options("收货地址: " + data.user_address));
@@ -190,6 +196,15 @@ export const print = (data: any) => {
});
nowHeight += 60;
+ // 文本 *3
+ panel.addPrintText(options("出库码: "));
+ panel.addPrintText(options(""));
+ panel.addPrintText(options(""));
+
+ // 文本 *4
+ panel.addPrintText({ options: { width: T_WIDTH, height: 35, top: nowHeight, left: T_LEFT, title: data.number, textType: 'barcode',textAlign: "center" } });
+ nowHeight += 40
+
// 文本 *4
panel.addPrintText(options(""));
panel.addPrintText(options(""));
@@ -199,19 +214,22 @@ export const print = (data: any) => {
// 合计高度 23 + length * 2
//打印
- // hiprintTemplate.print({});
+ hiprintTemplate.print({});
//直接打印,需要安装客户端
- hiprintTemplate.print2({});
+ // hiprintTemplate.print2({});
// 直接打印回调
// 发送任务到打印机成功
hiprintTemplate.on("printSuccess", (e: any) => {
console.log("printSuccess", e);
- ElMessage.success('订单已加入打印队列');
+ ElMessage.success("订单已加入打印队列");
+ cashierclassSetPrintAdd({
+ id: data.id,
+ });
});
// 发送任务到打印机失败
hiprintTemplate.on("printError", (e: any) => {
console.log("printError", e);
- ElMessage.error('打印失败,请检查是否正确连接打印机!');
+ ElMessage.error("打印失败,请检查是否正确连接打印机!");
});
};
@@ -221,16 +239,18 @@ export const testPrint = () => {
console.log(list);
let nowHeight = 0;
- let textHeight = 10;
// 下列方法都是没有拖拽设计页面的, 相当于代码模式, 使用代码设计页面
// 想要实现拖拽设计页面,请往下看 '自定义设计'
var hiprintTemplate = new hiprint.PrintTemplate();
+ // 纸张高度 固定为 130 pt + 商品数量高度
+ let oneHeight = HEIGHT + Math.ceil((9 * 2 * 10) / 2.84);
+
// 模板宽度单位是mm ( 1mm ~= 2.84pt ) 其他的宽高单位是pt
var panel = hiprintTemplate.addPrintPanel({
- width: 58, // 58mm = 164pt
- height: 145,
+ width: WIDTH, // 58mm = 164pt
+ height: oneHeight,
paperNumberDisabled: true,
});
@@ -320,14 +340,19 @@ export const testPrint = () => {
});
};
- //文本 *1
+
+ //文本 *3
+ panel.addPrintText(options("======================"));
+ panel.addPrintText(options(""));
panel.addPrintText(
options({
- title: "泸优采-小票0",
+ title: "泸优采-小票测试",
textAlign: "center",
})
);
+
+
//文本 *6
panel.addPrintText(options("单号: PF171617436315965155"));
panel.addPrintText(options("配送时间: 2024-05-20 11:06:03"));
@@ -344,8 +369,20 @@ export const testPrint = () => {
lineOptions("0.01元", "25个", "0.25元");
panel.addPrintText(options("朝天椒, 辣椒"));
lineOptions("0.01元", "25个", "0.25元");
+ panel.addPrintText(options("朝天椒, 辣椒"));
+ lineOptions("0.01元", "25个", "0.25元");
+ panel.addPrintText(options("朝天椒, 辣椒"));
+ lineOptions("0.01元", "25个", "0.25元");
+ panel.addPrintText(options("朝天椒, 辣椒"));
+ lineOptions("0.01元", "25个", "0.25元");
+ panel.addPrintText(options("朝天椒, 辣椒"));
+ lineOptions("0.01元", "25个", "0.25元");
+ panel.addPrintText(options("朝天椒, 辣椒"));
+ lineOptions("0.01元", "25个", "0.25元");
+ panel.addPrintText(options("朝天椒, 辣椒"));
+ lineOptions("0.01元", "25个", "0.25元");
- //文本 *13
+ //文本 *5
panel.addPrintText(options("======================"));
panel.addPrintText(options("合计: 0.75元"));
@@ -356,22 +393,8 @@ export const testPrint = () => {
// https://lihai001.oss-cn-chengdu.aliyuncs.com/def/54705202405221504133485.png //有字
// panel.addPrintRect({ options: { width: T_WIDTH, height:30,top: nowHeight + 15, left: T_LEFT,borderColor:'',borderWidth:0.75 } });
// nowHeight+=40;
- panel.addPrintImage({
- options: {
- width: T_WIDTH,
- height: 50,
- top: nowHeight + 15,
- left: T_LEFT,
- title: "",
- src: "https://lihai001.oss-cn-chengdu.aliyuncs.com/def/db264202405221455038529.png",
- },
- });
- nowHeight += 60;
- panel.addPrintText(options("收货人: 阿哈"));
- panel.addPrintText(options("收货地址: 里海科技"));
- panel.addPrintText(options("联系电话: 17685151643"));
- panel.addPrintText(options("收货人签字:"));
- // panel.addPrintRect({ options: { width: T_WIDTH, height:30,top: nowHeight+15, left: T_LEFT,borderColor:'',borderWidth:0.75 } });
+
+ // 文本 *6
panel.addPrintImage({
options: {
width: T_WIDTH,
@@ -384,7 +407,37 @@ export const testPrint = () => {
});
nowHeight += 60;
+ // 文本 *4
+ panel.addPrintText(options("收货人: 阿哈"));
+ panel.addPrintText(options("收货地址: 里海科技"));
+ panel.addPrintText(options("联系电话: 17685151643"));
+ panel.addPrintText(options("收货人签字:"));
+ // panel.addPrintRect({ options: { width: T_WIDTH, height:30,top: nowHeight+15, left: T_LEFT,borderColor:'',borderWidth:0.75 } });
+
+ // 文本 *6
+ panel.addPrintImage({
+ options: {
+ width: T_WIDTH,
+ height: 50,
+ top: nowHeight + 15,
+ left: T_LEFT,
+ title: "",
+ src: "https://lihai001.oss-cn-chengdu.aliyuncs.com/def/db264202405221455038529.png",
+ },
+ });
+ nowHeight += 60;
+
+ panel.addPrintText(options("出库码: "));
+
+ // 文本 *4
+ panel.addPrintText({ options: { width: T_WIDTH, height: 35, top: nowHeight, left: T_LEFT, title: '65155', textType: 'barcode',textAlign: "center" } });
+ nowHeight += 40
+
+ // 文本 *1
panel.addPrintText(options(""));
+
+
+ // 文本 *3
panel.addPrintText(options(""));
panel.addPrintText(options(""));
panel.addPrintText(options("======================"));
@@ -392,19 +445,19 @@ export const testPrint = () => {
// 合计高度 23 + length * 2
//打印
- // hiprintTemplate.print({});
+ hiprintTemplate.print({});
//直接打印,需要安装客户端
- hiprintTemplate.print2({});
+ // hiprintTemplate.print2({});
// 直接打印回调
// 发送任务到打印机成功
hiprintTemplate.on("printSuccess", (e: any) => {
console.log("printSuccess", e);
- ElMessage.success('订单已加入打印队列');
+ ElMessage.success("订单已加入打印队列");
});
// 发送任务到打印机失败
hiprintTemplate.on("printError", (e: any) => {
console.log("printError", e);
- ElMessage.error('打印失败,请检查是否正确连接打印机!');
+ ElMessage.error("打印失败,请检查是否正确连接打印机!");
});
};
diff --git a/src/views/opurchase/opurchaseclass/detail.vue b/src/views/opurchase/opurchaseclass/detail.vue
index 1f9bf4e..ad9a309 100644
--- a/src/views/opurchase/opurchaseclass/detail.vue
+++ b/src/views/opurchase/opurchaseclass/detail.vue
@@ -33,13 +33,13 @@
-
+
diff --git a/src/views/opurchase/opurchaseclass/index.vue b/src/views/opurchase/opurchaseclass/index.vue
index f2f0d3c..e96f8aa 100644
--- a/src/views/opurchase/opurchaseclass/index.vue
+++ b/src/views/opurchase/opurchaseclass/index.vue
@@ -50,11 +50,12 @@
v-perms="['operation.opurchaseclass/add']"
type="success"
@click="onPrintOrder()"
+ v-if="isShowPrint"
>
- 打印
+ 打印测试
@@ -101,7 +102,11 @@
prop="money"
show-overflow-tooltip
/>
-
+
已采购
未采购
@@ -165,17 +170,65 @@ import {
import { timeFormat } from "@/utils/util";
import feedback from "@/utils/feedback";
import EditPopup from "./edit.vue";
-import { useRouter } from "vue-router";
+import { useRouter, useRoute } from "vue-router";
import { print, testPrint } from "@/utils/print";
// 下列方法都是没有拖拽设计页面的, 相当于代码模式, 使用代码设计页面
const onPrintOrder = (row: any) => {
- if(!row) testPrint({
- name: 'test'
- })
+ if (!row) {
+ // return testPrint();
+ print({
+ id: 405,
+ merchant: 501,
+ real_name: "阿哈",
+ user_phone: "19330904744",
+ user_address: "里海三楼",
+ uid: "9",
+ number: "PF171617436315965155",
+ total: "0.02",
+ actual: "0.02",
+ create_time: "2024-05-20 11:06:03",
+ mer_name: "莲花农贸市场",
+ mer_phone: "15566669999",
+ mer_nickname: "小明",
+ mer_user_mobile: "",
+ nickname: "用户1532345",
+ user_moblie: "19330904747",
+ info: [
+ {
+ goods: 317,
+ nums: "1.00",
+ price: "0.02",
+ total: "0.02",
+ unit_name: "斤",
+ goods_name: "西瓜",
+ },
+ {
+ goods: 317,
+ nums: "1.56",
+ price: "1.98",
+ total: "3.09",
+ unit_name: "斤",
+ goods_name: "苹果",
+ },
+ {
+ goods: 317,
+ nums: "2.58",
+ price: "3.68",
+ total: "9.49",
+ unit_name: "斤",
+ goods_name: "香蕉",
+ },
+ ],
+ });
+ }
};
const router = useRouter();
+const route = useRoute();
+
+const isShowPrint = ref(route.query?.print || false);
+console.log(isShowPrint.value);
const editRef = shallowRef>();
// 是否显示编辑框
diff --git a/src/views/opurchase/outStorage/index.vue b/src/views/opurchase/outStorage/index.vue
new file mode 100644
index 0000000..3bb7904
--- /dev/null
+++ b/src/views/opurchase/outStorage/index.vue
@@ -0,0 +1,16 @@
+
+
+
+
+
diff --git a/src/views/retail/cashierclass/detail.vue b/src/views/retail/cashierclass/detail.vue
index b6c007c..c462bfc 100644
--- a/src/views/retail/cashierclass/detail.vue
+++ b/src/views/retail/cashierclass/detail.vue
@@ -45,14 +45,15 @@
-
-
+
+
-
+
-
+
+
diff --git a/src/views/translationOrder/component/goodsOffer.vue b/src/views/translationOrder/component/goodsOffer.vue
index b046bbb..625b4d2 100644
--- a/src/views/translationOrder/component/goodsOffer.vue
+++ b/src/views/translationOrder/component/goodsOffer.vue
@@ -2,13 +2,15 @@
-
-
+
+
+
+
@@ -102,7 +104,7 @@
{{ updateInfo.q_nums }}
-
+
@@ -130,6 +132,7 @@ import { useRoute } from "vue-router";
const route = useRoute();
+const isAdopt = ref("全部");
const queryParams = reactive({
id: route.query.id,
is_adopt: "",
@@ -146,7 +149,12 @@ defineExpose({
});
const changeType = (e: any) => {
- queryParams.is_adopt = e;
+ queryParams.is_adopt = isAdopt.value;
+ if(isAdopt.value == '全部') queryParams.is_adopt = '';
+ if(isAdopt.value == '待报价') queryParams.is_adopt = '0';
+ if(isAdopt.value == '已报价') queryParams.is_adopt = '1';
+ if(isAdopt.value == '已采纳') queryParams.is_adopt = '2';
+ if(isAdopt.value == '未采纳') queryParams.is_adopt = '3';
getLists();
};
@@ -170,7 +178,7 @@ const offerGood = (row: any, type: number) => {
row
);
if(type==0) return goodsOfferUpdate(); // 采纳时直接成功, 入库弹窗显示数量
- updateInfo.value.q_nums = row.nums;
+ updateInfo.value.q_nums = row.need_num;
dialogVisible.value = true;
};
diff --git a/src/views/translationOrder/component/outStorage.vue b/src/views/translationOrder/component/outStorage.vue
new file mode 100644
index 0000000..2db494b
--- /dev/null
+++ b/src/views/translationOrder/component/outStorage.vue
@@ -0,0 +1,87 @@
+
+
+
+
+
+
+
+
+
+
+ {{ row.is_stream == 1 ? "已出库" : "待出库" }}
+
+
+
+
+
+
+
+ 详情
+
+
+
+
+
+
+
+
+
diff --git a/src/views/translationOrder/component/putStorage.vue b/src/views/translationOrder/component/putStorage.vue
new file mode 100644
index 0000000..67b8238
--- /dev/null
+++ b/src/views/translationOrder/component/putStorage.vue
@@ -0,0 +1,171 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ 已入库
+ 未入库
+
+
+
+
+
+
+ 采纳
+ 已入库
+ 入库
+ 等待供应商报价
+
+
+
+
+
+
+
+ {{ updateInfo.supplier_name }}
+
+
+ {{ updateInfo.goods_name }}
+
+
+ ¥ {{ updateInfo.price }} / {{ updateInfo.unit_name }}
+
+
+ {{ updateInfo.q_nums }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/translationOrder/detail.vue b/src/views/translationOrder/detail.vue
index cc64b40..26a6837 100644
--- a/src/views/translationOrder/detail.vue
+++ b/src/views/translationOrder/detail.vue
@@ -1,7 +1,7 @@
-
+
@@ -37,7 +37,15 @@
- 未推送
+ 未推送
已推送
@@ -52,6 +60,12 @@
+
+
+
+
+
+
@@ -64,25 +78,20 @@ import {
apiOpurchaseclassLists,
apiOpurchaseclassDelete,
apiOpurchaseclassDetail,
- apiOpurchaseinfoListList
+ apiOpurchaseinfoListList,
} from "@/api/opurchaseclass";
import { useRoute } from "vue-router";
import subOrder from "./component/subOrder.vue";
import goodsOffer from "./component/goodsOffer.vue";
import noPush from "./component/noPush.vue";
+import putStorage from "./component/putStorage.vue";
+import outStorage from "./component/outStorage.vue";
const route = useRoute();
const form = ref({});
const activeName = ref("detail");
-const activeMap = ref(
- new Map([
- ["detail", true],
- ["order", false],
- ["offer", false],
- ["notPushedGoods", false],
- ])
-);
+
const getDetail = async () => {
const data = await apiOpurchaseclassDetail({
id: route.query.id,
@@ -94,24 +103,25 @@ getDetail();
const subOrderRef = ref(null);
const goodsOfferRef = ref(null);
const noPushRef = ref(null);
+const putStorageRef = ref(null);
+const outStorageRef = ref(null);
const tabChange = (type: any) => {
- if (!activeMap.value.get(type)) {
- activeMap.value.set(type, true);
- if (type == "order") subOrderRef.value?.getLists();
- if (type == "offer") goodsOfferRef.value?.getLists();
- if (type == "notPushedGoods") noPushRef.value?.getLists();
- }
+ if (type == "order") subOrderRef.value?.getLists();
+ if (type == "offer") goodsOfferRef.value?.getLists();
+ if (type == "notPushedGoods") noPushRef.value?.getLists();
+ if (type == "putStorage") putStorageRef.value?.getLists();
+ if (type == "outStorage") outStorageRef.value?.getLists();
};
// 查询条件
const queryParams = reactive({
- id: route.query.id,
-})
+ id: route.query.id,
+});
// 分页相关
const { pager, getLists, resetParams, resetPage } = usePaging({
- fetchFun: apiOpurchaseinfoListList,
- params: queryParams
-})
-getLists()
+ fetchFun: apiOpurchaseinfoListList,
+ params: queryParams,
+});
+getLists();