From b6c21a6f18bb5b0da6de8dd67a924be14dfe506b Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期一, 14 七月 2025 16:51:04 +0800
Subject: [PATCH] 完成 来料条码打印模块 添加 采购订单模块 完成 采购订单模块 修改

---
 static/svgs/folder_bg.svg                            |    2 
 pages/caigoudingdan/generate.vue                     |  483 ++++++++++++++++++++++++++++
 pages.json                                           |   14 
 pages/tiaomadaying/tiaomadaying.vue                  |  223 ++++++++++--
 components/blueToothConnector/blueToothConnector.vue |   15 
 pages/index/index.vue                                |    8 
 pages/caigoudingdan/caigoudingdan.vue                |  246 ++++++++++++++
 7 files changed, 945 insertions(+), 46 deletions(-)

diff --git a/components/blueToothConnector/blueToothConnector.vue b/components/blueToothConnector/blueToothConnector.vue
index 893395c..20fdaff 100644
--- a/components/blueToothConnector/blueToothConnector.vue
+++ b/components/blueToothConnector/blueToothConnector.vue
@@ -23,6 +23,7 @@
 				<uni-card :title="device.name" :extra="connectedDeviceId === device.address?'宸茶繛鎺�':'鏈繛鎺�'"
 					style="margin: 10px;">
 					<view class="operation-zone">
+						<view></view>
 						<button class="op1" size="mini" plain @click="connectBT(device)">杩炴帴璁惧</button>
 					</view>
 				</uni-card>
@@ -314,9 +315,17 @@
 
 	.operation-zone {
 		display: flex;
-		justify-content: space-around;
-		margin-top: 10rpx;
-
+		justify-content: flex-end;
+		padding: 10rpx;
+		
+			
+		>view {
+			flex: 1;
+		}
+		>button{
+			display: inline-block;
+			width: 6rem;
+		}
 		.op1 {
 			border: 1px solid #41a863;
 			color: #41a863;
diff --git a/pages.json b/pages.json
index 7b3defa..de533a1 100644
--- a/pages.json
+++ b/pages.json
@@ -462,6 +462,20 @@
 					"style": {
 						"navigationBarTitleText": "鏉ユ枡鏉$爜鎵撳嵃"
 					}
+				},
+				{
+					"path" : "pages/caigoudingdan/caigoudingdan",
+					"style" : 
+					{
+						"navigationBarTitleText" : "閲囪喘璁㈠崟"
+					}
+				},
+				{
+					"path" : "pages/caigoudingdan/generate",
+					"style" : 
+					{
+						"navigationBarTitleText" : "鏉$爜鐢熸垚"
+					}
 				}
 	],
 	"tabBar": {
diff --git a/pages/caigoudingdan/caigoudingdan.vue b/pages/caigoudingdan/caigoudingdan.vue
new file mode 100644
index 0000000..4d8c0f0
--- /dev/null
+++ b/pages/caigoudingdan/caigoudingdan.vue
@@ -0,0 +1,246 @@
+<template>
+	<view class="content">
+		<view class="form">
+			<view class="form-item">
+				<view class="title"><text>*</text>鏉$爜:</view>
+				<view class="right" style="width: 380rpx;">
+					<input v-model="HBarCode" placeholder="璇锋壂鎻�(鎴栬緭鍏�)鏉$爜" @confirm="getCode(HBarCode)" />
+				</view>
+				<uni-icons type="scan"
+					style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;"
+					size="20" @click="toScanCode"></uni-icons>
+			</view>
+			<view class="form-item">
+				<view class="title">鍗曟嵁鍙�:</view>
+				<view class="righton">
+					<input v-model="baseInfo.HBillNo" disabled />
+				</view>
+			</view>
+			<view class="form-item">
+				<view class="title">渚涘簲鍟�:</view>
+				<view class="righton">
+					<input v-model="baseInfo.HSupName" disabled />
+				</view>
+			</view>
+			<view class="form-item">
+				<view class="title">閮ㄩ棬:</view>
+				<view class="righton">
+					<input v-model="baseInfo.HDeptName" disabled />
+				</view>
+			</view>
+		</view>
+
+		<view style="width: 100%;height: 16rpx;background-color: #e5e5e5;"></view>
+
+		<view class="list" v-for="(item,index) in listData" :key="index" @tap="toSon(item)">
+			<uni-card :title="item.鐗╂枡浠g爜" :extra="'No. ' + Number(index+1)" style="margin: 10px;">
+				<view class="card-detail">
+					<view class="detail">
+						<text>鐗╂枡鍚嶇О锛�</text>{{item.鐗╂枡鍚嶇О}}
+					</view>
+					<view class="detail">
+						<text>瑙勬牸鍨嬪彿锛�</text>{{item.瑙勬牸鍨嬪彿}}
+					</view>
+					<view class="detail">
+						<text>璁㈠崟鏁伴噺锛�</text>{{item.鏁伴噺}}
+					</view>
+				</view>
+
+			</uni-card>
+		</view>
+
+		<view class="over" v-if="listData.length == 0">鏆傛棤鏁版嵁</view>
+		<view class="over" v-if="listData.length != 0">宸插埌搴�</view>
+	</view>
+</template>
+
+<script>
+	import {
+		getUserInfo
+	} from "@/utils/auth.js";
+	import {
+		CommonUtils
+	} from "../../utils/common";
+	export default {
+		data() {
+			return {
+				userInfo: getUserInfo(),
+				serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API',
+				HBarCode: '',
+				baseInfo: {
+					HBillNo: '',
+					HSupName: '',
+					HDeptName: '',
+					HInterID: '',
+				},
+				sWhere: '',
+				listData: [],
+			}
+		},
+		onLoad() {},
+		methods: {
+			//鎵爜
+			toScanCode() {
+				uni.scanCode({
+					onlyFromCamera: true,
+					success: (res) => {
+						console.log('鏉$爜鍐呭锛�' + res.result);
+						this.HBarCode = res.result
+
+						this.getCode(this.HBarCode)
+					}
+				});
+			},
+			//鎵潯鐮佸鐞�
+			getCode(HBarCode) {
+				if (!HBarCode) {
+					uni.showToast({
+						title: '鏉$爜涓嶈兘涓虹┖',
+						icon: 'none'
+					})
+				} else {
+					CommonUtils.doRequest(
+						"/Cg_POOrderBill/list", {
+							sWhere: ` and 鍗曟嵁鍙� = '${HBarCode}'`,
+							user: this.userInfo.Czymc
+						},
+						(res) => {
+							console.log('閲囪喘璁㈠崟: ', res)
+							let {data, count} = res.data
+							if(count > 0){
+								this.baseInfo = {
+									HBillNo: data[0].鍗曟嵁鍙�,
+									HSupName: data[0].渚涘簲鍟�,
+									HDeptName: data[0].閮ㄩ棬,
+									HInterID: data[0].hmainid,
+								}
+								this.listData = data
+							} else {
+								uni.showToast({
+									title: res.data.Message,
+									icon: 'none'
+								})
+							}
+						}
+					)
+
+				}
+			},
+			toSon(item) {
+				uni.navigateTo({
+					url: `./generate?OperationType=1&closeType=1&linterid=${this.baseInfo.HInterID}&hmaterid=${item["HMaterID"]}`
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.form {
+		width: 640rpx;
+		margin: 20rpx auto;
+	}
+
+	.form-item {
+		display: flex;
+		align-items: center;
+		font-size: 28rpx;
+		padding: 6rpx 0;
+
+		.title {
+			width: 180rpx;
+
+			text {
+				color: red;
+				font-weight: bold;
+			}
+		}
+
+		.right {
+			width: 450rpx;
+			border-radius: 22rpx;
+			border: 1px solid #acacac;
+		}
+
+		.righton {
+			width: 450rpx;
+			border-radius: 22rpx;
+			border: 1px solid #e4e4e4;
+			background-color: #e4e4e4;
+		}
+
+		input {
+			width: 100%;
+			padding: 8rpx 20rpx;
+			font-size: 30rpx;
+		}
+	}
+
+	.buttons {
+		width: 100%;
+		display: flex;
+		justify-content: center;
+		margin-top: 20rpx;
+
+		button {
+			border-radius: 50rpx;
+			width: 180rpx;
+			height: 66rpx;
+			line-height: 66rpx;
+			font-size: 28rpx;
+		}
+
+		.btn-a {
+			background-color: #acacac;
+			color: #fff;
+		}
+
+		.btn-b {
+			background-color: #41a863;
+			color: #fff;
+		}
+
+		.btn-c {
+			background-color: #3a78ff;
+			color: #fff;
+		}
+	}
+
+	.list {
+		width: 100%;
+
+		.card-detail {
+			width: 100%;
+			display: flex;
+			flex-wrap: wrap;
+			justify-content: space-between;
+			line-height: 120%;
+
+			.detail {
+				// width: 50%;
+				font-size: 26rpx;
+				margin-bottom: 12rpx;
+				color: #555;
+				margin-right: 20rpx;
+
+				text {
+					color: #999;
+					font-size: 26rpx;
+				}
+			}
+		}
+
+		.more {
+			color: #888;
+			font-size: 24rpx;
+			display: flex;
+			border-top: 1px solid #eee;
+			padding-top: 20rpx;
+
+			.part {
+				width: 50%;
+				text-align: center;
+			}
+		}
+	}
+</style>
\ No newline at end of file
diff --git a/pages/caigoudingdan/generate.vue b/pages/caigoudingdan/generate.vue
new file mode 100644
index 0000000..ce4870c
--- /dev/null
+++ b/pages/caigoudingdan/generate.vue
@@ -0,0 +1,483 @@
+<template>
+	<view class="content">
+		<view class="form">
+			<view class="form-item">
+				<view class="title">鐗╂枡缂栫爜:</view>
+				<view class="righton">
+					<input v-model="baseInfo.HMaterNumber" disabled />
+				</view>
+			</view>
+			<view class="form-item">
+				<view class="title">鐗╂枡鍚嶇О:</view>
+				<view class="righton">
+					<input v-model="baseInfo.HMaterName" disabled />
+				</view>
+			</view>
+			<view class="form-item">
+				<view class="title">瑙勬牸鍨嬪彿:</view>
+				<view class="righton">
+					<input v-model="baseInfo.HMaterModel" disabled />
+				</view>
+			</view>
+			<view class="form-item">
+				<view class="title">鎵规:</view>
+				<view class="righton">
+					<input v-model="baseInfo.HBatchNo" disabled />
+				</view>
+			</view>
+			<view class="form-item">
+				<view class="title">鏀舵枡鏁伴噺:</view>
+				<view class="righton">
+					<input v-model="baseInfo.HQty" disabled />
+				</view>
+			</view>
+			<view class="form-item">
+				<view class="title">MTO鍙�:</view>
+				<view class="righton">
+					<input v-model="baseInfo.HMTONo" disabled />
+				</view>
+			</view>
+			<view class="form-item">
+				<view class="title">姣忕鏁伴噺:</view>
+				<view class="right">
+					<input v-model="baseInfo.HMinQty" type="number" placeholder="璇疯緭鍏ユ暟閲�" @confirm="getNum()"
+						@blur="getNum()" />
+				</view>
+			</view>
+			<view class="buttons">
+				<button class="btn-b" size="mini" type="default" @tap="getList()">鏉$爜鐢熸垚</button>
+				<button class="btn-c" size="mini" type="default" @tap="search">鎵撳嵃</button>
+			</view>
+		</view>
+
+		<view style="width: 100%;height: 16rpx;background-color: #e5e5e5;"></view>
+
+		<view class="list" v-for="(item,index) in listData" :key="index" @tap="toSon(item)">
+			<uni-card :title="item.鐗╂枡浠g爜" :extra="'No. ' + Number(index+1)" style="margin: 10px;">
+				<view class="card-detail">
+					<view class="detail">
+						<text>鐗╂枡鍚嶇О锛�</text>{{item.鐗╂枡鍚嶇О}}
+					</view>
+					<view class="detail">
+						<text>瑙勬牸鍨嬪彿锛�</text>{{item.瑙勬牸鍨嬪彿}}
+					</view>
+					<view class="detail">
+						<text>鏁伴噺锛�</text>{{item.鏁伴噺}}
+					</view>
+					<view class="detail" style="width: 100%;">
+						<text>鏉$爜缂栧彿锛�</text>{{item.鏉$爜缂栧彿}}
+					</view>
+				</view>
+
+			</uni-card>
+		</view>
+		<labelPrinterComponentVue ref="labelPrinter" :printInfo="printInfo" :printMode="'cpcl'">
+		</labelPrinterComponentVue>
+		<view class="over" v-if="listData.length == 0">鏆傛棤鏁版嵁</view>
+		<view class="over" v-if="listData.length != 0">宸插埌搴�</view>
+	</view>
+</template>
+
+<script>
+	import {
+		getUserInfo
+	} from "@/utils/auth.js";
+	import {
+		CommonUtils
+	} from "../../utils/common";
+	export default {
+		data() {
+			return {
+				printInfo: "",
+				userInfo: getUserInfo(),
+				serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API',
+				OperationType: 1, //鏁版嵁绫诲瀷  1娣诲姞 淇濆瓨  2澶嶅埗  3 缂栬緫
+				linterid: '',
+				HEntryID: '',
+				hmaterid: '',
+				baseInfo: {
+					HBillNo: '',
+					HMainID: '',
+					HSubID: '',
+					HOrderBillNo: '',
+					HMaterID: '',
+					HMaterNumber: '',
+					HMaterName: '',
+					HMaterModel: '',
+					HQty: '',
+					HMTONo: '',
+					HQty: '',
+					HMinQty: '',
+					HBQty: '',
+				},
+				sWhere: '',
+				listData: [],
+			}
+		},
+		onLoad(e) {
+			console.log(e)
+			this.OperationType = e.OperationType
+			this.linterid = e.linterid
+			this.hmaterid = e.hmaterid
+			this.getData()
+		},
+		methods: {
+			getData() {
+				CommonUtils.doRequest(
+					"/Cg_POOrderBill/list", {
+						sWhere: ` and hmainid = ${this.linterid} and HMaterID  = ${this.hmaterid}`
+						,user: this.userInfo.Czymc
+					},
+					(res) => {
+						console.log('閲囪喘璁㈠崟: ', res)
+						let {
+							data,
+							count
+						} = res.data
+						if (count > 0) {
+							this.baseInfo = {
+								HMainID: data[0]['hmainid'],
+								HSubID: data[0]['HEntryID'],
+								HBillNo: data[0]['鍗曟嵁鍙�'],
+								HMaterID: data[0]['HMaterID'],
+								HMaterNumber: data[0]['鐗╂枡浠g爜'],
+								HMaterName: data[0]['鐗╂枡鍚嶇О'],
+								HMaterModel: data[0]['瑙勬牸鍨嬪彿'],
+								HQty: data[0]['鏁伴噺'],
+								HMTONo: data[0]['璁″垝璺熻釜鍙�']
+							}
+							this.listData = data
+						} else {
+							uni.showToast({
+								title: res.data.Message,
+								icon: 'none'
+							})
+						}
+					}
+				)
+			},
+			getNum(e) {
+				if (this.baseInfo.HMinQty && this.baseInfo.HMinQty > 0) {
+					var a = Number(this.baseInfo.HQty) / Number(this.baseInfo.HMinQty)
+					this.baseInfo.HBQty = Math.ceil(Number(this.baseInfo.HQty) / Number(this.baseInfo.HMinQty))
+					this.$forceUpdate()
+				} else {
+					uni.showToast({
+						title: '璇疯緭鍏ュぇ浜�0鐨勫悎鐞嗘暟閲�',
+						icon: "none"
+					})
+				}
+			},
+			async search() {
+				if (this.$printer.isConnected() === false) {
+					this.$refs.labelPrinter.openPopup()
+				} else {
+					// this.printInfo = async () => {
+					// 	let cpcl = await this.$printer.cpcl().clear()
+					// 		.page(new CPage({
+					// 			width: 608,
+					// 			height: 400
+					// 		}))
+					// 		.qrcode(new CQRCode({
+					// 			x: 500,
+					// 			y: 30,
+					// 			width: 3,
+					// 			content: this.generatedBarCode,
+					// 			codeRotation: CCodeRotation.ROTATION_0,
+					// 			level: CCorrectLevel.L
+					// 		}))
+					// 		.text(new CText({
+					// 			x: 30,
+					// 			y: 30,
+					// 			content: "渚涘簲鍟�: ",
+					// 			font: CFont.TSS24
+					// 		}))
+					// 		.text(new CText({
+					// 			x: 30,
+					// 			y: 80,
+					// 			content: "渚涘簲鍟嗘枡鍙�: ",
+					// 			font: CFont.TSS24
+					// 		}))
+					// 		.text(new CText({
+					// 			x: 30,
+					// 			y: 130,
+					// 			content: "鐗╂枡缂栫爜: ",
+					// 			font: CFont.TSS24
+					// 		}))
+					// 		.text(new CText({
+					// 			x: 30,
+					// 			y: 180,
+					// 			content: "鐗╂枡鍒嗙粍: ",
+					// 			font: CFont.TSS24
+					// 		}))
+					// 		.text(new CText({
+					// 			x: 300,
+					// 			y: 180,
+					// 			content: "瑙勬牸鍨嬪彿: ",
+					// 			font: CFont.TSS24
+					// 		}))
+					// 		.text(new CText({
+					// 			x: 30,
+					// 			y: 230,
+					// 			content: "鏁伴噺: ",
+					// 			font: CFont.TSS24
+					// 		}))
+					// 		.text(new CText({
+					// 			x: 300,
+					// 			y: 230,
+					// 			content: "鏃ユ湡: ",
+					// 			font: CFont.TSS24
+					// 		}))
+					// 		.text(new CText({
+					// 			x: 30,
+					// 			y: 280,
+					// 			content: "妫�楠屽憳: ",
+					// 			font: CFont.TSS24
+					// 		}))
+					// 		.text(new CText({
+					// 			x: 300,
+					// 			y: 280,
+					// 			content: "璁″垝璺熻釜鍙�: ",
+					// 			font: CFont.TSS24
+					// 		}))
+					// 		.text(new CText({
+					// 			x: 30,
+					// 			y: 330,
+					// 			content: "妫�楠岀粨鏋�: ",
+					// 			font: CFont.TSS24
+					// 		}))
+					// 		.box(new CBox({
+					// 			topLeftX: 260,
+					// 			topLeftY: 320,
+					// 			bottomRightX: 280,
+					// 			bottomRightY: 340,
+					// 			lineWidth: 4,
+					// 		}))
+					// 		.text(new CText({
+					// 			x: 290,
+					// 			y: 320,
+					// 			content: "鍚堟牸",
+					// 			font: CFont.TSS24
+					// 		}))
+					// 		.box(new CBox({
+					// 			topLeftX: 360,
+					// 			topLeftY: 320,
+					// 			bottomRightX: 380,
+					// 			bottomRightY: 340,
+					// 			lineWidth: 4,
+					// 		}))
+					// 		.text(new CText({
+					// 			x: 390,
+					// 			y: 320,
+					// 			content: "涓嶅悎鏍�",
+					// 			font: CFont.TSS24
+					// 		}))
+					// 		.box(new CBox({
+					// 			topLeftX: 480,
+					// 			topLeftY: 320,
+					// 			bottomRightX: 500,
+					// 			bottomRightY: 340,
+					// 			lineWidth: 4,
+					// 		}))
+					// 		.text(new CText({
+					// 			x: 510,
+					// 			y: 320,
+					// 			content: "鐗归噰",
+					// 			font: CFont.TSS24
+					// 		}))
+					// 		.form(new CForm())
+					// 		.print();
+					// 	console.log(cpcl.command().string())
+					// 	return cpcl.command().binary()
+					// }
+					// await this.$nextTick(() => {
+					// 	this.$refs.labelPrinter.execPrint()
+					// })
+
+					this.printInfo = `! 0 200 200 400 1
+PAGE-WIDTH 608
+SETQRVER 3
+B QR 500 30 M 2 U 3
+LA,${this.generatedBarCode}
+ENDQR
+T 24 0 30 30 渚涘簲鍟�: 
+T 24 0 30 80 渚涘簲鍟嗘枡鍙�:  
+T 24 0 30 130 鐗╂枡缂栫爜: 
+T 24 0 30 180 鐗╂枡鍒嗙粍: 
+T 24 0 300 180 瑙勬牸鍨嬪彿: 
+T 24 0 30 230 鏁伴噺:  
+T 24 0 300 230 鏃ユ湡: 
+T 24 0 30 280 妫�楠屽憳: 
+T 24 0 300 280 璁″垝璺熻釜鍙�:
+T 24 0 30 330 妫�楠岀粨鏋�: 
+BOX 260 330 280 350 4
+T 24 0 290 330 鍚堟牸
+BOX 360 330 380 350 4
+T 24 0 390 330 涓嶅悎鏍�
+BOX 480 330 500 350 4
+T 24 0 510 330 鐗归噰
+FORM
+PRINT`
+
+
+
+					await this.$nextTick(() => {
+						this.$refs.labelPrinter.execPrint()
+					})
+				}
+			},
+			getList() {
+				var sMain = []
+				sMain[0] = this.baseInfo
+				var sMainStr = JSON.stringify(sMain);
+				//鑾峰彇閫夋嫨鐨勭粍缁�
+				var HOrgType = uni.getStorageSync('Organization');
+				//鑾峰彇閫夋嫨鐨勫伐鍘備唬鐮�
+				var CampanyName = "xxx";
+				//鑾峰彇閫夋嫨鐨勬簮鍗曠被鍨�
+				var HSourceBillType = "鏀舵枡閫氱煡鍗�";
+				//鑾峰彇閫夋嫨鐨勬潯鐮佺被鍨�
+				var HSelectBarCodeType = "鍞竴鏉$爜";
+				//鑾峰彇褰撳墠鐧诲綍浜哄憳
+				var UserName = uni.getStorageSync('HUserName');
+				var sMainSub = sMainStr + ';' + HOrgType + ';' + HSourceBillType + ';' + HSelectBarCodeType + ';' +
+					CampanyName + ';' + UserName;
+				uni.request({
+					url: this.serverUrl + '/Sc_BarCode/Sub_SaveBill',
+					method: 'POST',
+					data: {
+						msg: sMainSub,
+						CampanyName: CampanyName
+					},
+					success: (res) => {
+						if (res.data.count == 1) {
+							this.listData = res.data.data
+						} else {
+							uni.showToast({
+								title: res.data.Message,
+								icon: 'none'
+							})
+						}
+					},
+					fail: (res) => {
+						console.log(res);
+						uni.showToast({
+							title: '鎺ュ彛璇锋眰澶辫触',
+							icon: 'none'
+						})
+					},
+				});
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.form {
+		width: 640rpx;
+		margin: 20rpx auto;
+	}
+
+	.form-item {
+		display: flex;
+		align-items: center;
+		font-size: 28rpx;
+		padding: 6rpx 0;
+
+		.title {
+			width: 180rpx;
+
+			text {
+				color: red;
+				font-weight: bold;
+			}
+		}
+
+		.right {
+			width: 450rpx;
+			border-radius: 22rpx;
+			border: 1px solid #acacac;
+		}
+
+		.righton {
+			width: 450rpx;
+			border-radius: 22rpx;
+			border: 1px solid #e4e4e4;
+			background-color: #e4e4e4;
+		}
+
+		input {
+			width: 100%;
+			padding: 8rpx 20rpx;
+			font-size: 30rpx;
+		}
+	}
+
+	.buttons {
+		width: 100%;
+		display: flex;
+		justify-content: center;
+		margin-top: 20rpx;
+
+		button {
+			border-radius: 50rpx;
+			width: 220rpx;
+			height: 66rpx;
+			line-height: 66rpx;
+			font-size: 28rpx;
+		}
+
+		.btn-a {
+			background-color: #acacac;
+			color: #fff;
+		}
+
+		.btn-b {
+			background-color: #41a863;
+			color: #fff;
+		}
+
+		.btn-c {
+			background-color: #3a78ff;
+			color: #fff;
+		}
+	}
+
+	.list {
+		width: 100%;
+
+		.card-detail {
+			width: 100%;
+			display: flex;
+			flex-wrap: wrap;
+			justify-content: space-between;
+			line-height: 120%;
+
+			.detail {
+				// width: 50%;
+				font-size: 26rpx;
+				margin-bottom: 12rpx;
+				color: #555;
+				margin-right: 20rpx;
+
+				text {
+					color: #999;
+					font-size: 26rpx;
+				}
+			}
+		}
+
+		.more {
+			color: #888;
+			font-size: 24rpx;
+			display: flex;
+			border-top: 1px solid #eee;
+			padding-top: 20rpx;
+
+			.part {
+				width: 50%;
+				text-align: center;
+			}
+		}
+	}
+</style>
\ No newline at end of file
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 5fec7b6..fe55027 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -166,9 +166,15 @@
 					},
 					{
 						img: '../../static/icon/icon16.png',
-						text: '鏉$爜鎵撳嵃',
+						text: '鏉ユ枡鏉$爜鎵撳嵃',
 						url: '/pages/tiaomadaying/tiaomadaying',
 						id: 28,
+					},
+					{
+						img: '../../static/icon/icon16.png',
+						text: '閲囪喘璁㈠崟',
+						url: '/pages/caigoudingdan/caigoudingdan',
+						id: 29,
 					}
 				]
 			}
diff --git a/pages/tiaomadaying/tiaomadaying.vue b/pages/tiaomadaying/tiaomadaying.vue
index e7a6b89..426cc50 100644
--- a/pages/tiaomadaying/tiaomadaying.vue
+++ b/pages/tiaomadaying/tiaomadaying.vue
@@ -1,7 +1,7 @@
 <template>
 	<view class="container">
 		<view class="content">
-			<view class="header"></view>
+			<view class="header">鍩烘湰淇℃伅</view>
 			<view class="items">
 				<view class="item">
 					<view class="left">鏉$爜缂栧彿锛�</view>
@@ -17,19 +17,19 @@
 				<view class="item">
 					<view class="left">婧愬崟鍙凤細</view>
 					<view class="right">
-						<input name="HSourceBillNo" v-model="lailiaoInfo.HSourceBillNo" />
+						<input name="HBillNo" v-model="lailiaoInfo.HBillNo" />
 					</view>
 				</view>
 				<view class="item">
 					<view class="left">婧愬崟琛屽彿锛�</view>
 					<view class="right">
-						<input name="HSourceBillLineNo" v-model="lailiaoInfo.HSourceBillLineNo" />
+						<input name="HBillLineNo" v-model="lailiaoInfo.HBillLineNo" />
 					</view>
 				</view>
 				<view class="item">
 					<view class="left">鐗╂枡缂栫爜锛�</view>
 					<view class="right">
-						<input name="HMaterNo" v-model="lailiaoInfo.HMaterNo" />
+						<input name="HMaterNo" v-model="lailiaoInfo.HMaterNumber" />
 					</view>
 				</view>
 				<view class="item">
@@ -41,7 +41,7 @@
 				<view class="item">
 					<view class="left">瑙勬牸鍨嬪彿锛�</view>
 					<view class="right">
-						<input name="HMaterType" v-model="lailiaoInfo.HMaterType" />
+						<input name="HMaterType" v-model="lailiaoInfo.HMaterModel" />
 					</view>
 				</view>
 				<view class="item">
@@ -77,10 +77,14 @@
 			</view>
 		</view>
 		<view class="operation-zone">
-			<button @click="print">鎵撳嵃</button>
-			<labelPrinterComponentVue ref="labelPrinter" :printInfo="printInfo" :printMode="'cpcl'">
-			</labelPrinterComponentVue>
+			<button class="btn-c" :disabled="buttonStatus.btn1 == false" @click="GenereateBarCode">鐢熸垚</button>
+			<button class="btn-c" :disabled="buttonStatus.btn2 == false" @click="print">鎵撳嵃</button>
+			<view></view>
+			<button class="btn-c" @click="setClearLailiaoInfo">鏂板</button>
+			<button class="btn-c" @click="exit">閫�鍑�</button>
 		</view>
+		<labelPrinterComponentVue ref="labelPrinter" :printInfo="printInfo" :printMode="'cpcl'">
+		</labelPrinterComponentVue>
 	</view>
 </template>
 
@@ -118,18 +122,30 @@
 			return {
 				printInfo: "",
 				userInfo: getUserInfo(),
+				buttonStatus: {
+					btn1: true,
+					btn2: false
+				},
+				generatedBarCode: '',
 				lailiaoInfo: {
+					HMainID:'',
+					HSubID:'',
+					HOrderBillNo:'',
+					HMaterID:'',
 					barCodeNo: '',
-					HSourceBillNo: '',
-					HSourceBillLineNo: '',
-					HMaterNo: '',
+					HBillNo: '',
+					HBillLineNo: '',
+					HMaterNumber: '',
 					HMaterName: '',
-					HMaterType: '',
+					HMaterModel: '',
 					HBatchNo: '',
 					HQty: '',
 					HMTONo: '',
 					HSupName: '',
-					HSupNameShort: ''
+					HSupNameShort: '',
+					HMinQty:'',
+					HBQty:'',
+					HSupID: ''
 				}
 			};
 		},
@@ -151,7 +167,7 @@
 					// 			x: 500,
 					// 			y: 30,
 					// 			width: 3,
-					// 			content: "PDDZDA00017106",
+					// 			content: this.generatedBarCode,
 					// 			codeRotation: CCodeRotation.ROTATION_0,
 					// 			level: CCorrectLevel.L
 					// 		}))
@@ -267,24 +283,24 @@
 PAGE-WIDTH 608
 SETQRVER 3
 B QR 500 30 M 2 U 3
-LA,PDDZDA00017106
+LA,${this.generatedBarCode}
 ENDQR
-T 24 0 30 30 渚涘簲鍟�: 
-T 24 0 30 80 渚涘簲鍟嗘枡鍙�: 
-T 24 0 30 130 鐗╂枡缂栫爜: 
+T 24 0 30 30 渚涘簲鍟�: ${this.lailiaoInfo.HSupName}
+T 24 0 30 80 渚涘簲鍟嗘枡鍙�:  
+T 24 0 30 130 鐗╂枡缂栫爜: ${this.lailiaoInfo.HMaterName}
 T 24 0 30 180 鐗╂枡鍒嗙粍: 
-T 24 0 300 180 瑙勬牸鍨嬪彿: 
-T 24 0 30 230 鏁伴噺: 
+T 24 0 300 180 瑙勬牸鍨嬪彿: ${this.lailiaoInfo.HMaterModel}
+T 24 0 30 230 鏁伴噺:  ${this.lailiaoInfo.HQty}
 T 24 0 300 230 鏃ユ湡: 
 T 24 0 30 280 妫�楠屽憳: 
-T 24 0 300 280 璁″垝璺熻釜鍙�: 
+T 24 0 300 280 璁″垝璺熻釜鍙�: ${this.lailiaoInfo.HMTONo || ''}
 T 24 0 30 330 妫�楠岀粨鏋�: 
-BOX 260 320 280 340 4
-T 24 0 290 320 鍚堟牸
-BOX 360 320 380 340 4
-T 24 0 390 320 涓嶅悎鏍�
-BOX 480 320 500 340 4W
-T 24 0 510 320 鐗归噰
+BOX 260 330 280 350 4
+T 24 0 290 330 鍚堟牸
+BOX 360 330 380 350 4
+T 24 0 390 330 涓嶅悎鏍�
+BOX 480 330 500 350 4
+T 24 0 510 330 鐗归噰
 FORM
 PRINT`
 
@@ -304,14 +320,47 @@
 				}
 				let d = data[row - 1]
 				this.lailiaoInfo = Object.assign(this.lailiaoInfo, {
-					HMaterNo: d['鐗╂枡缂栫爜'],
+					HMaterNumber: d['鐗╂枡缂栫爜'],
 					HMaterName: d['鐗╂枡鍚嶇О'],
-					HMaterType: d['瑙勬牸鍨嬪彿'],
+					HMaterModel: d['瑙勬牸鍨嬪彿'],
 					HBatchNo: d['鎵瑰彿'],
 					HQty: d['鏁伴噺'],
+					HMinQty: d['鏁伴噺'],
+					HBQty: d['鏁伴噺'],
+					HSupID: d['HSupID'],
 					HSupName: d['渚涘簲鍟�'],
-					HSupNameShort: d['渚涘簲鍟�']
+					HSupNameShort: d['渚涘簲鍟�'],
+					HMTONo: d['璁㈠崟璺熻釜鍙�'],
+					HMainID:d['linterid'],
+					HSubID:d['HEntryID'],
+					HMaterID:d['HMaterID'],
 				}) 
+			},
+			setClearLailiaoInfo() {
+				this.lailiaoInfo = {
+					HMainID:'',
+					HSubID:'',
+					HOrderBillNo:'',
+					HMaterID:'',
+					barCodeNo: '',
+					HBillNo: '',
+					HBillLineNo: '',
+					HMaterNumber: '',
+					HMaterName: '',
+					HMaterModel: '',
+					HBatchNo: '',
+					HQty: '',
+					HMTONo: '',
+					HSupName: '',
+					HSupNameShort: '',
+					HMinQty:'',
+					HBQty:'',
+				}
+				
+				this.buttonStatus = {
+					btn1: true,
+					btn2: false
+				}
 			},
 			toScanCode() {
 				uni.scanCode({
@@ -328,8 +377,8 @@
 							}
 							let barCodeInfo = res.result.split("@")
 							let [PurchaseBillNo, Row] = barCodeInfo
-							this.lailiaoInfo.HSourceBillNo = PurchaseBillNo,
-							this.lailiaoInfo.HSourceBillLineNo = Row
+							this.lailiaoInfo.HBillNo = PurchaseBillNo,
+							this.lailiaoInfo.HBillLineNo = Row
 							console.log( {
 									sWhere: ` and 鍗曟嵁鍙� = '${PurchaseBillNo}'`,
 									user: this.userInfo.Czymc,
@@ -354,49 +403,109 @@
 						}
 					}
 				});
+			},
+			GenereateBarCode(){
+				let sMain = []
+				sMain[0] = this.lailiaoInfo
+				let sMainStr = JSON.stringify(sMain);
+				//鑾峰彇閫夋嫨鐨勭粍缁�
+				let HOrgType = uni.getStorageSync('Organization');
+				//鑾峰彇閫夋嫨鐨勫伐鍘備唬鐮�
+				let CampanyName = "xxx";
+				//鑾峰彇閫夋嫨鐨勬簮鍗曠被鍨�
+				let HSourceBillType = "鏉ユ枡閫氱煡鍗�";
+				//鑾峰彇閫夋嫨鐨勬潯鐮佺被鍨�
+				let HSelectBarCodeType = "鍞竴鏉$爜";
+				//鑾峰彇褰撳墠鐧诲綍浜哄憳
+				let UserName = uni.getStorageSync('HUserName');                
+				let sMainSub = sMainStr + ';' + HOrgType + ';' + HSourceBillType + ';' + HSelectBarCodeType + ';' + CampanyName + ';' + UserName;
+			
+				CommonUtils.doRequest(
+				"/Sc_BarCode/Sub_SaveBill",
+				{
+					msg: sMainSub, 
+					CampanyName: CampanyName
+				},
+				(res) => {
+					console.log(res)
+					let {data, count, Message} = res.data
+					if(count > 0){
+						this.buttonStatus = {
+							btn1: false,
+							btn2: true
+						}
+						this.generatedBarCode = data[0]['鏉$爜缂栧彿']
+						console.log(this.generatedBarCode)
+						uni.showToast({
+							icon: 'none',
+							title: Message
+						})
+					}else {
+						uni.showToast({
+							icon: 'none',
+							title: Message
+						})
+					}
+				},
+				(err) => {
+					
+				},
+				"POST"
+				)
+			},
+			exit() {
+				uni.navigateBack()
 			}
 		}
 	}
 </script>
 
-<style lang="scss">
+<style lang="scss" scoped>
 	* {
 		box-sizing: border-box;
 	}
 
 	input {
 		padding: 8rpx 20rpx;
-		font-size: 24rpx;
-		line-height: 24rpx;
+		font-size: 30rpx;
+		line-height: 30rpx;
 	}
 
 	.container {
 		display: flex;
 		flex-direction: column;
-		height: 100%;
+		height: 100vh;
+		padding: 20rpx 0 ;
 
 		.content {
 			flex: 1;
-
+			background-image: url('/static/svgs/folder_bg.svg');
+			background-size: cover;
+			padding: 20rpx;
+			
+			.header {
+				font-size: 30rpx;
+			}
+			
 			.items {
 				display: flex;
 				flex-direction: column;
 				gap: 10rpx;
-				padding: 20rpx;
+				padding: 40rpx 0rpx;
 
 				.item {
 					display: flex;
 					flex-direction: row;
 					padding: 0 10rpx;
 					gap: 20rpx;
-					font-size: 24rpx;
+					font-size: 30rpx;
 					// height: 1.5rem;
 					// justify-content: center;
 					align-items: center;
 
 					.left {
 						text-align: left;
-						width: 5rem;
+						width: 6rem;
 					}
 
 					.right {
@@ -416,10 +525,42 @@
 		}
 
 		.operation-zone {
-			height: 6rem;
+			height: 3rem;
 			display: flex;
 			align-items: center;
 			justify-content: space-between;
+			gap: 30rpx;
+			padding: 20rpx;
+			
+			>view {
+				flex: 1;
+			}
+			>button {
+				width: 4rem;
+				padding: 0;
+				font-size: 25rpx;
+				border-radius: 50rpx;
+				line-height: 66rpx;
+				font-size: 28rpx;	
+			}
+			
+			>button[disabled] {
+				background-color: #acacac;
+				color: #fff;
+			}
+			
+			.btn-a{
+				background-color: #acacac;
+				color: #fff;
+			}
+			.btn-b{
+				background-color: #41a863;
+				color: #fff;
+			}
+			.btn-c{
+				background-color: #3a78ff;
+				color: #fff;
+			}
 		}
 	}
 </style>
\ No newline at end of file
diff --git a/static/svgs/folder_bg.svg b/static/svgs/folder_bg.svg
index 0c09b52..90b138b 100644
--- a/static/svgs/folder_bg.svg
+++ b/static/svgs/folder_bg.svg
@@ -1 +1 @@
-<svg width="100%" height="100%" viewBox="0 0 750 590" preserveAspectRatio="none"  xmlns="http://www.w3.org/2000/svg"><!-- 鏍囬鍖哄煙 (鍥哄畾楂樺害 64px) --><g id="title" transform="translate(0)"><polyline fill="none" stroke="#000" points="0 64 0 0 300 0 375 64" stroke-width="3"/></g><!-- 鍐呭鍖哄煙 (鑷姩濉厖鍓╀綑楂樺害) --><g id="content" transform="translate(0 64)"><!-- 浣跨敤鐩稿鍧愭爣閲嶇粯鍐呭鍖哄煙 --><polyline fill="none" stroke="#000" points="375 0 750 0 750 526 0 526 0 0" stroke-width="3"/></g></svg>
\ No newline at end of file
+<svg width="100%" height="100%" viewBox="0 0 750 590" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><!-- 鏍囬鍖哄煙 (鍥哄畾楂樺害 64px) --><g id="title" transform="translate(0)"><polyline fill="none" stroke="#000" points="0 32 0 0 150 0 170 32" stroke-width="2"/></g><!-- 鍐呭鍖哄煙 (鑷姩濉厖鍓╀綑楂樺害) --><g id="content" transform="translate(0 32)"><!-- 浣跨敤鐩稿鍧愭爣閲嶇粯鍐呭鍖哄煙 --><polyline fill="none" stroke="#000" points="170 0 750 0 750 526 0 526 0 0" stroke-width="2"/></g></svg>
\ No newline at end of file

--
Gitblit v1.9.1