Browse Source

生成派车编号

zhangyuewww 3 năm trước cách đây
mục cha
commit
cd0ae32f80

+ 15 - 2
pageA/freightTransport/contract_detail.vue

@@ -195,6 +195,7 @@
 			this.goods.dispatchingDate = this.time;
 			this.goods.batch = option.batch;
 			this.goods.id = option.id;
+			this.goods.tranCarNo = option.tranCarNo
 
 		},
 		methods: {
@@ -242,7 +243,19 @@
 													confirmText: "继续添加",
 													success: function(res) {
 														if (res.confirm) {
-															// console.log(that.goods,24)
+															var result = that.goods.tranCarNo
+																.substr(that.goods.tranCarNo
+																	.indexOf("C") + 1, that
+																	.goods.tranCarNo.length);
+															var num = Number(result) + 1
+															if (num <= 9) {
+																num = 'C00' + num
+															} else if (num < 100 && num > 9) {
+																num = 'C0' + num
+															} else if (num < 1000 && num >
+																99) {
+																num = 'C' + num
+															}
 															that.goods = {
 																carNo: '',
 																collectionScreenshot: '',
@@ -251,7 +264,7 @@
 																driverPhone: '',
 																reciveNetWeight: '',
 																tare: '',
-																tranCarNo: '',
+																tranCarNo: num,
 																batch:that.goods.batch,
 																id:that.goods.id
 															}

+ 9 - 1
pageA/freightTransport/record/sendrecord.vue

@@ -276,8 +276,16 @@
 		},
 		methods: {
 			commit() {
+				var tranCarNo = ''
+				if (this.purchaseOrder.freightReceivingDispatchingCars.length <= 9) {
+					tranCarNo = 'C00' + (this.purchaseOrder.freightReceivingDispatchingCars.length + 1)
+				} else if (this.purchaseOrder.freightReceivingDispatchingCars.length < 100 && this.purchaseOrder.freightReceivingDispatchingCars.length > 9) {
+					tranCarNo = 'C0' + (this.purchaseOrder.freightReceivingDispatchingCars.length + 1)
+				} else if (this.purchaseOrder.freightReceivingDispatchingCars.length < 1000 && this.purchaseOrder.freightReceivingDispatchingCars.length > 99) {
+					tranCarNo = 'C' + (this.purchaseOrder.freightReceivingDispatchingCars.length + 1)
+				}
 				uni.navigateTo({
-					url: '/pageA/freightTransport/contract_detail?id=' + this.id+'&batch='+this.purchaseOrder.batch
+					url: '/pageA/freightTransport/contract_detail?id=' + this.id+'&batch='+this.purchaseOrder.batch+'&tranCarNo='+tranCarNo
 				})
 			},
 			// 查看磅单