securityCheck.vue 21.9 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761
<template>
	<view class="container">
		<!-- 打开安检项选择组件 -->
		<view class="" v-show="openAjItemPage">
			<checkOption :itemData="itemData" @close="handleClose" :ifhx="ifhx"></checkOption>
		</view>
		<view class="" v-show="!openAjItemPage && !isScan">
			<Navbar :title="title" canBack></Navbar>
			<view class="bg-white padding-tb">
				<u-steps :current="current" activeColor="#EE2F24">
					<u-steps-item :class="current>=-1?'activeStepItemCss':''" title="客户信息验证"></u-steps-item>
					<u-steps-item :class="current>=0?'activeStepItemCss':''" title="入户安检"></u-steps-item>
					<u-steps-item :class="current>=1?'activeStepItemCss':''" title="气瓶收发"
						v-if="type !== 1"></u-steps-item>
				</u-steps>
			</view>
			<!-- 客户信息验证 -->
			<view class="" v-show="current < 0">
				<Step1 ref="stepRef1" :ddid="ddid" :openType="type"></Step1>
			</view>
			<view class="" v-show="current === 0">
				<Step2 ref="stepRef2" @changeAJjg="getAjjg" :rhaj="ajdata" :ajjg="ajjg" :czgqm="czgqm" :yhqm="yhqm">
				</Step2>
			</view>

			<view class="" v-show="current >= 1">
				<Step3 ref="stepRef3" @del="handleDel" :qpsf="qpsf" :qpParams="ddxqList" :qptipsObj="qptipsObj"
					@openScan="handleOpenScan">
				</Step3>
			</view>

			<view class="ajTipsCss flex align-center padding-lr justify-between"
				v-if="current === 0 && ajjg === '存在隐患' && (type === 0 || type === 2)">
				<view class="flex">
					<u-icon name="bell-fill" color="#fff"></u-icon>
					<view class="text-white margin-left-xs text-sm">
						安检结果存在隐患,是否终止气瓶安装?
					</view>
				</view>
				<view class="flex" @click="finishOrder">
					<view class="text-sm text-white">
						结束安装
					</view>
					<u-icon name="arrow-right" color="#fff"></u-icon>
				</view>
			</view>

			<view class="fixBtnAreaCss">
				<view class="" @click="changeStep(0)" v-show="current === -1">
					<u-button color="#EA5504">下一步(入户安检)</u-button>
				</view>
				<view class="flex justify-between" v-show="current === 0">
					<u-button @click="changeStep(-1)" color=""
						:customStyle="{color:'#EA5504',margin:'0 5px'}">上一步(信息验证)</u-button>
					<u-button @click="changeStep(1)" :customStyle="{margin:'0 5px'}"
						color="#EA5504">{{type === 1 ? '安检完成':'下一步(气瓶收发)'}}</u-button>
				</view>
				<view class="flex justify-between" v-show="current >= 1">
					<u-button @click="changeStep(0)" color=""
						:customStyle="{color:'#EA5504',margin:'0 5px'}">上一步(入户安检)</u-button>
					<u-button @click="changeStep(2)" :customStyle="{margin:'0 5px'}" color="#EA5504">配送完成</u-button>
				</view>
				<!-- <view class="flex justify-between" v-show="current === 2">
					<u-button @click="changeStep(0)" color=""
						:customStyle="{color:'#EA5504',margin:'0 5px'}">上一步(入户安检)</u-button>
					<u-button @click="changeStep(2)" :customStyle="{margin:'0 5px'}" color="#EA5504">配送完成</u-button>
				</view> -->
			</view>
		</view>
		<ScanCode ref="scanCode" @scanCode="getCode" @close="closeScanWindow"></ScanCode>
	</view>
</template>

<script>
	import ajJson from '@/static/aj.json'
	import ajJsonCopy from '@/static/ajcopy.json'
	import checkOption from './step/components/checkOption.vue'
	import Step1 from './step/step1.vue'
	import Step2 from './step/step2.vue'
	import Step3 from './step/step3.vue'
	export default {
		components: {
			Step1,
			Step2,
			Step3,
			checkOption
		},
		data() {
			return {
				type: null,
				title: "客户信息验证",
				current: -1,
				isScan: false, //是否展示扫码
				scanType: null,
				openAjItemPage: false,
				itemData: {},
				orderParams: null,
				ddxqList: [],
				ddid: "",
				khxx: {},
				rhaj: {
					lq: {},
					syhj: {},
					syxw: {},
					rsqsnaz: {},
					pgzf: {},
					rqpxlbjzz: {}
				},
				// 校验安检
				ajdata: {
					lq: {},
					// syhj: {},
					// syxw: {},
					// rsqsnaz: {},
					pgzf: {},
					// rqpxlbjzz: {}
				},
				qpsf: {
					mpfc: [],
					kphs: [],
					mphs: []
				},
				rhajEcho: {},
				ifhx: false,
				xcpz: [], //现场拍照
				ajjg: "", //是否隐患
				czgqm: "", //操作签名
				yhqm: "", //用户签名
				qptipsObj: { //气瓶超出提示
					type: "",
					num: ""
				},
			};
		},
		watch: {
			ajjg: {
				handler() {

				},
				immediate: true,
				deep: true
			}
		},
		mounted() {},
		onLoad(data) {
			if (data.orderParams) {
				this.orderParams = JSON.parse(data.orderParams);
				const {
					ddid,
					ddxqList,
					...khxx
				} = this.orderParams;
				this.ddxqList = ddxqList;
				this.ddid = ddid;
				this.khxx = khxx;
				console.log("客户信息(订单传递", this.khxx);
				console.log('订单传递参数', JSON.parse(JSON.stringify(this.orderParams)));
			}


			// 打开类型 配送或安检
			// 0、正常配送 1、入户安检 2、无单配送
			if (data.type) {
				this.type = parseInt(data.type);
				console.log("打开类型", this.type);
			}

			//获取app自定义扫码结果
			uni.$on('scanCode', (code, name, fQptmObj, fQpgg) => {
				console.log("securityCheck获取气瓶规格", fQpgg);
				if (name === 'securityCheck') {
					console.log("securityCheck监听code", code);
					this.setCode(code, fQpgg);
				}
			});

			// 接受不同安检类型的值 由checkitme传递
			uni.$on('chekItemData', (item) => {
				this.openAjItemPage = true;
				this.itemData = item;
				console.log('checkItem传递的值:' + JSON.stringify(this.itemData));
			});

			// 接受选择的值 由checkOption传递
			uni.$on('optionData', (item) => {
				// console.log("接收选择的值", JSON.stringify(item));
				Object.assign(this.rhaj, item.data);
				// console.log("接收选择的值", JSON.stringify(this.rhaj));
			});

			uni.$on('openhx', (open) => {
				this.ifhx = open;
				console.log("打开或关闭回显", JSON.stringify(this.ifhx));
			});

			// 接受回显的值 由checkOption传递
			uni.$on('optionEcho', (echo) => {
				this.ifhx = true;
				this.itemData.ifhx = true;
				Object.assign(this.ajdata, echo.data);
				this.checkJcjg(echo);
				// console.log("安检回显", JSON.stringify(echo));
			});
			// 接受操作工签名文件id 由sign传递
			uni.$on('czgqm', (czgqm) => {
				console.log("接收操作工签名文件id", czgqm);
				this.czgqm = czgqm
			});
			// 接受操作工签名文件id 由sign传递
			uni.$on('yhqm', (yhqm) => {
				console.log("接收用户签名文件id", yhqm);
				this.yhqm = yhqm
			});
		},
		onUnload() {
			this.reset();
			uni.$off('scanCode');
			uni.$off('chekItemData');
			uni.$off('optionData');
			uni.$off('optionEcho');
			uni.$off('czgqm');
			uni.$off('yhqm');
		},
		methods: {
			handleClose() {
				this.openAjItemPage = false;
			},
			reset() {
				this.ifhx = false;
				this.$refs.stepRef2.$refs.checkItemRef.checkList.map(item => item.ifhx = false);
				// console.log("关闭回显", JSON.stringify(this.$refs.stepRef2.$refs.checkItemRef.checkList));
			},
			checkJcjg(item) {
				let that = this;
				if (this.ajdata) {
					for (let key in this.ajdata) {
						if (this.ajdata[key].jcjg) {
							if ((key === 'lq' && this.ajdata[key].jcjg === '是') || (key !== 'lq' && this.ajdata[key]
									.jcjg === '否')) {
								// console.log("存在");
								that.ajjg = "存在隐患";
								return
							} else {
								// console.log("不存在");
								that.ajjg = "无隐患";
							}
						}
					}
				}
				console.log("是否隐患", that.ajjg);
			},
			// 组件直接修改结果
			getAjjg(ajjg) {
        console.log('打印ajjg===>',ajjg);
				this.ajjg = ajjg;
			},
			// 检验安检项是否选完
			checkJcjgNotEmpty(obj) {
				let hasFalse = null
				for (let key in obj) {
					// console.log(obj[key]);
					if (obj[key] && obj[key].hasOwnProperty('jcjg') && obj[key]['jcjg'] !== "") {
						hasFalse = true
					} else {
						hasFalse = false
					}
				}
				return hasFalse;
			},
			// 打开扫码
			handleOpenScan(e) {
				console.log("扫码类型", typeof e);
				let tempNum = parseInt(e)
				if (tempNum === 1) {
					this.scanType = 'mpfc';
				} else if (tempNum === 2) {
					this.scanType = 'kphs';
				} else if (tempNum === 3) {
					this.scanType = 'mphs';
				}
				// 组件模式打开
				// this.isScan = true;
				// this.$refs.scanCode.open();
				uni.navigateTo({
					url: `/pages/scan/scanCode?mode=2&lx=${this.scanType}&ddid=${this.ddid}`
				})
			},
			// 删除气瓶码
			handleDel(e, index) {
				console.log("类型", e);
				console.log("位置", index);
				if (e === 1) {
					this.qpsf.mpfc.splice(index, 1)
				}
				if (e === 2) {
					this.qpsf.kphs.splice(index, 1)
				}
				if (e === 3) {
					this.qpsf.mphs.splice(index, 1)
				}
				this.isGoBeyond();
			},
			// 自定义获取气瓶码
			setCode(code, fQpgg) {
				switch (this.scanType) {
					case 'mpfc':
						this.handleScanType(this.qpsf.mpfc, code, fQpgg);
						break;
					case 'kphs':
						this.handleScanType(this.qpsf.kphs, code, fQpgg);
						break;
					case 'mphs':
						this.handleScanType(this.qpsf.mphs, code, fQpgg);
						break;
					default:
				}
				this.isGoBeyond();
				console.log('气瓶详情', JSON.parse(JSON.stringify(this.qpsf)));
				// console.log("满瓶发出", this.qpsf.mpfc);
				// console.log("空瓶回收", this.qpsf.kphs);
				// console.log("满瓶回收", this.qpsf.mphs);
			},
			handleScanType(array, code, fQpgg) {
				console.log("array", array);
				let codeExists = Object.values(this.qpsf).flat().some(item => item.code === code);
				console.log("code是否已存在", codeExists);
				// if (!this.qpsf.mpfc.includes(code) && !this.qpsf.kphs.includes(code) && !this.qpsf.mphs.includes(code)) {
				if (!codeExists) {
					array.push({
						'code': code,
						'qpgg': fQpgg
					});
				} else {
					setTimeout(() => {
						uni.$u.toast('已录入');
					}, 100)
				}
			},
			// 组件获取气瓶码(停用)
			// async getCode(code) {
			// 	this.$modal.showLoading("查询气瓶中");
			// 	// 对code进行查询后再添加到列表
			// 	let query = {
			// 		qptm: code
			// 	}
			// 	const result = await this.$api.gasApi.getDetailByQuery(query);
			// 	let {
			// 		state,
			// 		message
			// 	} = result;
			// 	this.$modal.closeLoading();
			// 	if (!state) {
			// 		uni.$u.toast(message)
			// 		return;
			// 	}
			// 	console.log("查询条码", result);
			// 	if (this.scanType === 1) {
			// 		this.qpsf.mpfc.push(code);
			// 	}
			// 	if (this.scanType === 2) {
			// 		this.qpsf.kphs.push(code);
			// 	}
			// 	if (this.scanType === 3) {
			// 		this.qpsf.mphs.push(code);
			// 	}
			// 	console.log("满瓶发出", this.qpsf.mpfc);
			// 	console.log("空瓶回收", this.qpsf.kphs);
			// 	console.log("满瓶回收", this.qpsf.mphs);
			// 	// this.$refs.stepRef3.changeCollapse();
			// 	this.close()
			// },
			close() {
				this.isScan = false;
				this.$refs.scanCode.close();
			},
			closeScanWindow() {
				this.isScan = false;
			},
			// 结束安装
			finishOrder() {
				let that = this;
				let qpsf = {
					mpfc: this.qpsf.mpfc.map(item => item.code),
					kphs: this.qpsf.kphs.map(item => item.code),
					mphs: this.qpsf.mphs.map(item => item.code)
				}
        let fileList = this.$refs.stepRef2.fileList;
        console.log('打印fileList', fileList);
        let fileIdArray = fileList
            .filter(item => item.file.length > 0) // 过滤出file长度大于0的项
            .map(item => JSON.parse(item.file[0].fileObj));
				// let xczpArray = that.xcpz.length > 0 ? that.xcpz : null;
				this.rhajMethod();
        console.log('打印sczp',fileIdArray)
				let requestDataPs = {
					khxx: this.khxx,
					rhaj: {
						xcpz: fileIdArray.length > 0 ? JSON.stringify(fileIdArray) : null,
						ajjg: that.ajjg,
						czgqm: that.czgqm,
						yhqm: that.yhqm,
						sfjsbcps: "是",
						...this.rhaj,
					},
					qpsf: qpsf,
					ddid: that.orderParams?.ddid
				}
        console.log('打印sczp',requestDataPs)
        requestDataPs.rhaj.lq = Object.keys(requestDataPs.rhaj.lq).length === 0 ? null : requestDataPs.rhaj
					.lq;
				requestDataPs.rhaj.pgzf = Object.keys(requestDataPs.rhaj.pgzf).length === 0 ? null : requestDataPs
					.rhaj
					.pgzf;
				requestDataPs.rhaj.rqpxlbjzz = Object.keys(requestDataPs.rhaj.rqpxlbjzz).length === 0 ? null :
					requestDataPs.rhaj.rqpxlbjzz;
				requestDataPs.rhaj.rsqsnaz = Object.keys(requestDataPs.rhaj.rsqsnaz).length === 0 ? null :
					requestDataPs
					.rhaj.rsqsnaz;
				requestDataPs.rhaj.syhj = Object.keys(requestDataPs.rhaj.syhj).length === 0 ? null : requestDataPs
					.rhaj
					.syhj;
				requestDataPs.rhaj.syxw = Object.keys(requestDataPs.rhaj.syxw).length === 0 ? null : requestDataPs
					.rhaj
					.syxw;

				console.log('无单配送数据', JSON.parse(JSON.stringify(requestDataPs)));
				// 结束配送
				this.$modal.confirm('确认结束本次配送?', '提示').then(() => {
					this.$api.orderApi.submitStaffOrderDelivery(requestDataPs).then(res => {
						console.log("提交配送", res);
						if (res.code === 200) {
							uni.$u.toast('取消配送');
							setTimeout(() => {
								that.$goBack();
								// uni.reLaunch({
								// 	url: '/pages/home/appList/orderDelivery/orderDelivery'
								// })
							}, 500)
						}
					})
				}).catch(() => {
					console.log("取消");
				});
			},
			// 安检标题,异常条数计算
			rhajMethod() {
				// 安检标题
				console.log(this.rhaj);
				let ajbt = "";
				let ycts = 0;
				for (let key in this.rhaj) {
					if (this.rhaj.hasOwnProperty(key)) {
						if (Array.isArray(this.rhaj[key])) {
							let isHg = this.calcSfhg(key);
							if (isHg === 'bhg') {
								ajbt = ajbt === '' ? this.rhaj[key][0].sslx : `${ajbt}_${this.rhaj[key][0].sslx}`;
								if (key === 'rsqsnaz' || key === 'rqpxlbjzz') {
									ycts += this.rhaj[key].length - 2;
								} else {
									ycts += this.rhaj[key].length - 1;
								}
							}
							// console.log(key, '是否合格', isHg);
						}
					}
				}
				console.log("异常标题", ajbt);
				console.log("异常条数", ycts);
				this.rhaj.ajbt = ajbt;
				this.rhaj.ycts = ycts;
			},
			// 判断是否合格
			calcSfhg(key) {
				let sflq = key === 'lq'; //是否漏气
				let sfbjOrRsq = key === 'rsqsnaz' || key === 'rqpxlbjzz' //是否报警或热水器
				// 如果为漏气选择是为不合格
				if (sflq && this.rhaj[key][0].jcjg === '是') {
					return 'bhg'
				}
				// 如果非漏气第一个选择为否为不合格
				if (!sflq && this.rhaj[key][0].jcjg === '否') {
					// console.log("不合格2");
					return 'bhg';
				}
				// 如果是漏气选择是为合格,如果非漏气且(非报警和热水器)第一个选择为是为合格
				if ((sflq && this.rhaj[key][0].jcjg === '否') || (!sflq && !sfbjOrRsq && this.rhaj[key][0].jcjg === '是')) {
					// console.log("合格3");
					return 'hg';
				}
				// 如果是(非报警和热水器),第一个选择和第二个选择都为是为合格
				if (sfbjOrRsq && this.rhaj[key][0].jcjg === '是' && this.rhaj[key][1]?.jcjg === '是') {
					return 'hg';
				}
				// 否则返回不合格
				return 'bhg';
			},
			isGoBeyond() {
				// 待发瓶数匹配
				if (this.qpsf.mpfc.length !== this.ddxqList[0].fSl) {
					let dfNum = this.ddxqList[0].fSl; //待发
					let yfNum = this.qpsf.mpfc.length //已发

					if (dfNum > yfNum) {
						let num = dfNum - yfNum;
						this.qptipsObj.type = '小于';
						this.qptipsObj.num = num;
						// uni.$u.toast(`缺少${num}瓶`);
					} else if (yfNum > dfNum) {
						let num = yfNum - dfNum;
						this.qptipsObj.type = '大于';
						this.qptipsObj.num = num;
						// uni.$u.toast(`超出${num}瓶`);
					} else {
						this.qptipsObj.type = '';
						this.qptipsObj.num = "";
					}
				} else {
					this.qptipsObj.type = "";
					this.qptipsObj.num = "";
				}
			},
			// 步骤改变
			async changeStep(step) {
				let that = this;
				/* 分步校验 */
				if (step === 0) {
					// 校验第一步
					this.khxx = Object.assign(this.khxx, this.$refs.stepRef1.khxx);
					// 非配送需要触发校验
					let pass = true;
					if (that.type) {
						pass = await this.$refs.stepRef1.validate();
					}
					if (!pass) return;
					this.khxx.yqdz =
						`${this.khxx.khlxdzsf}${this.khxx.khlxdzs}${this.khxx.khlxdzq}${this.khxx.khlxdzjd}${this.khxx.khlxdzxxdz}`
					console.log("步骤1结果", this.khxx);
					this.title = '入户安检'
				}

				if (step === 1) {
					// 校验第二步
					let result = this.checkJcjgNotEmpty(this.ajdata);
					console.log("安检是否选完", result);
					if (!result) {
						uni.$u.toast('请检查全部安检项');
						return
					}
					this.rhajMethod();
					console.log("全部安检项", this.rhaj);
					// 检验图片
					let fileList = this.$refs.stepRef2.fileList;
					console.log('打印fileList', fileList);
					let fileIdArray = fileList
						.filter(item => item.file.length > 0) // 过滤出file长度大于0的项
						.map(item => JSON.parse(item.file[0].fileObj));

					if (fileIdArray.length < 3) {
						uni.$u.toast('至少上传三张图片');
						return
					}
					console.log('打印fileIdArray', fileIdArray);
					// that.xcpz = fileIdArray.join(',');
					that.xcpz = fileIdArray.length > 0 ? JSON.stringify(fileIdArray) : null;
					console.log('打印fileIdArray', fileIdArray)
					// 检验安检结果
					if (!this.ajjg) {
						uni.$u.toast('请填写安检结果');
						return
					}

					// 操作工校验签名
					if (!this.czgqm) {
						uni.$u.toast('操作工未签名');
						return
					}

					// 用户校验签名
					if (!this.czgqm) {
						uni.$u.toast('用户未签名');
						return
					}

					let requestDataAj = {
						khxx: this.khxx,
						rhaj: {
							xcpz: that.xcpz,
							ajjg: that.ajjg,
							czgqm: that.czgqm,
							yhqm: that.yhqm,
							...this.rhaj,
						},
					}

					console.log("步骤2结果", requestDataAj);

					this.title = '气瓶收发'

					// return;
					// 安检部分从此处结束
					if (this.type === 1) {
						console.log("安检提交数据", requestDataAj);
						this.$modal.confirm('确认完成本次安检?', '提示').then(() => {
							console.log("确认");
							that.$modal.showLoading('提交中...')
							this.$api.orderApi.submitStaffRhaj(requestDataAj).then(res => {
								console.log("提交安检", res);
								if (res.code === 200) {
									console.log('打印res.value', res.value);
									let successData = JSON.stringify(res.value);
									that.$modal.closeLoading();
									setTimeout(() => {
										uni.navigateTo({
											url: '/pages/home/appList/securityCheck/step/success?type=1&successData=' +
												successData
										})
									}, 1000)
								}
							})
						}).catch(() => {
							console.log("取消");
						});
					}
				}

				if (step === 2) {
					if (!this.qpsf.mpfc.length) {
						uni.$u.toast('满瓶发出为空');
						return
					}
					//合并数据
					// 1、khxx 2、rhaj 3、qpsf 4、ddid
					let qpsf = {
						mpfc: this.qpsf.mpfc.map(item => item.code),
						kphs: this.qpsf.kphs.map(item => item.code),
						// mphs: this.qpsf.mphs.map(item => item.code) //满瓶回收暂时
					}

					// 无单配送
					let requestDataWd = {
						khxx: this.khxx,
						rhaj: {
							xcpz: that.xcpz,
							ajjg: that.ajjg,
							czgqm: that.czgqm,
							yhqm: that.yhqm,
							sfjsbcps: "否",
							...this.rhaj,
						},
						qpsf: qpsf,
					}
					if (that.type === 2) { //无单配送
						console.log("步骤3数据结果===>无单", requestDataWd);
						this.$modal.confirm('确认完成本次配送?', '提示').then(() => {
							console.log("确认");
							that.$modal.showLoading('提交中...')
							this.$api.orderApi.submitNoOrderDelivery(requestDataWd).then(res => {
								console.log("提交配送", res);
								if (res.code === 200 && res.state) {
									let successData = JSON.stringify(res.value);
									that.$modal.closeLoading();
									setTimeout(() => {
										uni.navigateTo({
											url: '/pages/home/appList/securityCheck/step/success?type=0&successData=' +
												successData
										})
									}, 1000)
								} else {
									uni.$u.toast(res.message);
								}
							})
						}).catch(() => {
							console.log("取消");
						});
						return;
					}
					// this.isGoBeyond();
					// 正常配送
					let requestDataPs = {
						khxx: this.khxx,
						rhaj: {
							xcpz: that.xcpz,
							ajjg: that.ajjg,
							czgqm: that.czgqm,
							yhqm: that.yhqm,
							sfjsbcps: "否",
							...this.rhaj,
						},
						qpsf: qpsf,
						ddid: that.orderParams.ddid
					}
					console.log("步骤3数据结果===>正常配送", requestDataPs);
					// 校验第三步
					this.$modal.confirm('确认完成本次配送?', '提示').then(() => {
						console.log("确认");
						that.$modal.showLoading('提交中...')
						this.$api.orderApi.submitStaffOrderDelivery(requestDataPs).then(res => {
							console.log("提交配送", res);
							if (res.code === 200 && res.state) {
								let successData = JSON.stringify(res.value);
								that.$modal.closeLoading();
								setTimeout(() => {
									uni.navigateTo({
										url: '/pages/home/appList/securityCheck/step/success?type=0&successData=' +
											successData
									})
								}, 1000)
							} else {
								uni.$u.toast(res.message);
							}
						})
					}).catch(() => {
						console.log("取消");
					});
				}
				if (this.type === 1 && step === 1) {
					// 类型为入户安检则不进行下一步
					console.log("安检跳过第三步");
					return;
				}
				this.current = step;
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		padding-bottom: 50px;
	}

	.fixBtnAreaCss {
		position: fixed;
		background: #fff;
		font-size: 16px;
		width: 100%;
		padding: 5px 10px;
		height: 50px;
		bottom: 0;
	}

	.ajTipsCss {
		position: fixed;
		width: 100%;
		height: 38px;
		background: #E8857F;
		bottom: 50px;
	}

	.u-button--normal {
		// font-size: 16px !important;
	}

	/deep/.activeStepItemCss .u-text__value {
		color: #EE2F24 !important;
	}

	/deep/ .u-input {
		padding: 6px 0px !important;
	}
</style>