Przeglądaj źródła

Merge branch 'master' of http://119.23.210.103:3000/wy/lh_firm_former

zjy 3 lat temu
rodzic
commit
e9e2ae9af4

+ 165 - 0
package-lock.json

@@ -43,6 +43,7 @@
         "highlight.js": "^10.1.2",
         "hls.js": "^0.14.11",
         "hotkeys-js": "^3.8.1",
+        "html2canvas": "^1.4.1",
         "jquery": "^3.6.0",
         "js-base64": "^3.7.2",
         "js-cookie": "^2.2.1",
@@ -72,6 +73,7 @@
         "video.js": "^7.8.4",
         "vue": "^2.6.12",
         "vue-aplayer": "^1.6.1",
+        "vue-barcode": "^1.3.0",
         "vue-codemirror": "^4.0.6",
         "vue-count-to": "^1.0.13",
         "vue-echarts": "^5.0.0-beta.0",
@@ -4875,6 +4877,14 @@
         "node": ">=0.10.0"
       }
     },
+    "node_modules/base64-arraybuffer": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmmirror.com/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz",
+      "integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==",
+      "engines": {
+        "node": ">= 0.6.0"
+      }
+    },
     "node_modules/base64-js": {
       "version": "1.5.1",
       "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
@@ -6994,6 +7004,14 @@
         "node": ">4"
       }
     },
+    "node_modules/css-line-break": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmmirror.com/css-line-break/-/css-line-break-2.1.0.tgz",
+      "integrity": "sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==",
+      "dependencies": {
+        "utrie": "^1.0.2"
+      }
+    },
     "node_modules/css-loader": {
       "version": "3.6.0",
       "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-3.6.0.tgz",
@@ -10663,6 +10681,18 @@
         "node": ">=6"
       }
     },
+    "node_modules/html2canvas": {
+      "version": "1.4.1",
+      "resolved": "https://registry.npmmirror.com/html2canvas/-/html2canvas-1.4.1.tgz",
+      "integrity": "sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==",
+      "dependencies": {
+        "css-line-break": "^2.1.0",
+        "text-segmentation": "^1.0.3"
+      },
+      "engines": {
+        "node": ">=8.0.0"
+      }
+    },
     "node_modules/htmlparser2": {
       "version": "6.1.0",
       "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.1.0.tgz",
@@ -12992,6 +13022,66 @@
         "js-yaml": "bin/js-yaml.js"
       }
     },
+    "node_modules/jsbarcode": {
+      "version": "3.11.5",
+      "resolved": "https://registry.npmmirror.com/jsbarcode/-/jsbarcode-3.11.5.tgz",
+      "integrity": "sha512-zv3KsH51zD00I/LrFzFSM6dst7rDn0vIMzaiZFL7qusTjPZiPtxg3zxetp0RR7obmjTw4f6NyGgbdkBCgZUIrA==",
+      "bin": {
+        "auto.js": "bin/barcodes/CODE128/auto.js",
+        "Barcode.js": "bin/barcodes/Barcode.js",
+        "barcodes": "bin/barcodes",
+        "canvas.js": "bin/renderers/canvas.js",
+        "checksums.js": "bin/barcodes/MSI/checksums.js",
+        "codabar": "bin/barcodes/codabar",
+        "CODE128": "bin/barcodes/CODE128",
+        "CODE128_AUTO.js": "bin/barcodes/CODE128/CODE128_AUTO.js",
+        "CODE128.js": "bin/barcodes/CODE128/CODE128.js",
+        "CODE128A.js": "bin/barcodes/CODE128/CODE128A.js",
+        "CODE128B.js": "bin/barcodes/CODE128/CODE128B.js",
+        "CODE128C.js": "bin/barcodes/CODE128/CODE128C.js",
+        "CODE39": "bin/barcodes/CODE39",
+        "constants.js": "bin/barcodes/ITF/constants.js",
+        "defaults.js": "bin/options/defaults.js",
+        "EAN_UPC": "bin/barcodes/EAN_UPC",
+        "EAN.js": "bin/barcodes/EAN_UPC/EAN.js",
+        "EAN13.js": "bin/barcodes/EAN_UPC/EAN13.js",
+        "EAN2.js": "bin/barcodes/EAN_UPC/EAN2.js",
+        "EAN5.js": "bin/barcodes/EAN_UPC/EAN5.js",
+        "EAN8.js": "bin/barcodes/EAN_UPC/EAN8.js",
+        "encoder.js": "bin/barcodes/EAN_UPC/encoder.js",
+        "ErrorHandler.js": "bin/exceptions/ErrorHandler.js",
+        "exceptions": "bin/exceptions",
+        "exceptions.js": "bin/exceptions/exceptions.js",
+        "fixOptions.js": "bin/help/fixOptions.js",
+        "GenericBarcode": "bin/barcodes/GenericBarcode",
+        "getOptionsFromElement.js": "bin/help/getOptionsFromElement.js",
+        "getRenderProperties.js": "bin/help/getRenderProperties.js",
+        "help": "bin/help",
+        "index.js": "bin/renderers/index.js",
+        "index.tmp.js": "bin/barcodes/index.tmp.js",
+        "ITF": "bin/barcodes/ITF",
+        "ITF.js": "bin/barcodes/ITF/ITF.js",
+        "ITF14.js": "bin/barcodes/ITF/ITF14.js",
+        "JsBarcode.js": "bin/JsBarcode.js",
+        "linearizeEncodings.js": "bin/help/linearizeEncodings.js",
+        "merge.js": "bin/help/merge.js",
+        "MSI": "bin/barcodes/MSI",
+        "MSI.js": "bin/barcodes/MSI/MSI.js",
+        "MSI10.js": "bin/barcodes/MSI/MSI10.js",
+        "MSI1010.js": "bin/barcodes/MSI/MSI1010.js",
+        "MSI11.js": "bin/barcodes/MSI/MSI11.js",
+        "MSI1110.js": "bin/barcodes/MSI/MSI1110.js",
+        "object.js": "bin/renderers/object.js",
+        "options": "bin/options",
+        "optionsFromStrings.js": "bin/help/optionsFromStrings.js",
+        "pharmacode": "bin/barcodes/pharmacode",
+        "renderers": "bin/renderers",
+        "shared.js": "bin/renderers/shared.js",
+        "svg.js": "bin/renderers/svg.js",
+        "UPC.js": "bin/barcodes/EAN_UPC/UPC.js",
+        "UPCE.js": "bin/barcodes/EAN_UPC/UPCE.js"
+      }
+    },
     "node_modules/jsbn": {
       "version": "0.1.1",
       "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
@@ -19429,6 +19519,14 @@
       "integrity": "sha1-i/dddJt8BXnJOZIAUcaepXLr3cE=",
       "dev": true
     },
+    "node_modules/text-segmentation": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmmirror.com/text-segmentation/-/text-segmentation-1.0.3.tgz",
+      "integrity": "sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==",
+      "dependencies": {
+        "utrie": "^1.0.2"
+      }
+    },
     "node_modules/text-table": {
       "version": "0.2.0",
       "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
@@ -20246,6 +20344,14 @@
         "node": ">= 0.4.0"
       }
     },
+    "node_modules/utrie": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmmirror.com/utrie/-/utrie-1.0.2.tgz",
+      "integrity": "sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==",
+      "dependencies": {
+        "base64-arraybuffer": "^1.0.2"
+      }
+    },
     "node_modules/uuid": {
       "version": "3.4.0",
       "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
@@ -20552,6 +20658,14 @@
         "vue": "^2.5.16"
       }
     },
+    "node_modules/vue-barcode": {
+      "version": "1.3.0",
+      "resolved": "https://registry.npmmirror.com/vue-barcode/-/vue-barcode-1.3.0.tgz",
+      "integrity": "sha512-DxQ0hxes/dP6GajsJumpW6jV14VwlnTwStZbtE6G0wkewuJVDoDOdxUr5seGuxsMT9fJ0aty4X47Z5TG0M/gxg==",
+      "dependencies": {
+        "jsbarcode": "^3.5.8"
+      }
+    },
     "node_modules/vue-cli-plugin-i18n": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/vue-cli-plugin-i18n/-/vue-cli-plugin-i18n-1.0.1.tgz",
@@ -26209,6 +26323,11 @@
         }
       }
     },
+    "base64-arraybuffer": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmmirror.com/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz",
+      "integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ=="
+    },
     "base64-js": {
       "version": "1.5.1",
       "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
@@ -27925,6 +28044,14 @@
         "timsort": "^0.3.0"
       }
     },
+    "css-line-break": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmmirror.com/css-line-break/-/css-line-break-2.1.0.tgz",
+      "integrity": "sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==",
+      "requires": {
+        "utrie": "^1.0.2"
+      }
+    },
     "css-loader": {
       "version": "3.6.0",
       "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-3.6.0.tgz",
@@ -30822,6 +30949,15 @@
         }
       }
     },
+    "html2canvas": {
+      "version": "1.4.1",
+      "resolved": "https://registry.npmmirror.com/html2canvas/-/html2canvas-1.4.1.tgz",
+      "integrity": "sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==",
+      "requires": {
+        "css-line-break": "^2.1.0",
+        "text-segmentation": "^1.0.3"
+      }
+    },
     "htmlparser2": {
       "version": "6.1.0",
       "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.1.0.tgz",
@@ -32644,6 +32780,11 @@
         "esprima": "^4.0.0"
       }
     },
+    "jsbarcode": {
+      "version": "3.11.5",
+      "resolved": "https://registry.npmmirror.com/jsbarcode/-/jsbarcode-3.11.5.tgz",
+      "integrity": "sha512-zv3KsH51zD00I/LrFzFSM6dst7rDn0vIMzaiZFL7qusTjPZiPtxg3zxetp0RR7obmjTw4f6NyGgbdkBCgZUIrA=="
+    },
     "jsbn": {
       "version": "0.1.1",
       "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
@@ -37960,6 +38101,14 @@
       "integrity": "sha1-i/dddJt8BXnJOZIAUcaepXLr3cE=",
       "dev": true
     },
+    "text-segmentation": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmmirror.com/text-segmentation/-/text-segmentation-1.0.3.tgz",
+      "integrity": "sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==",
+      "requires": {
+        "utrie": "^1.0.2"
+      }
+    },
     "text-table": {
       "version": "0.2.0",
       "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
@@ -38622,6 +38771,14 @@
       "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=",
       "dev": true
     },
+    "utrie": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmmirror.com/utrie/-/utrie-1.0.2.tgz",
+      "integrity": "sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==",
+      "requires": {
+        "base64-arraybuffer": "^1.0.2"
+      }
+    },
     "uuid": {
       "version": "3.4.0",
       "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
@@ -38899,6 +39056,14 @@
       "integrity": "sha512-c+ZAwZ63bVDsKkcHeKLAonIL2gY4nrVRdKypoPRXSkh+8B1cVhFT2tx8HSTNT6eX6WZyDtaYrEJfcgetrfvcdQ==",
       "requires": {}
     },
+    "vue-barcode": {
+      "version": "1.3.0",
+      "resolved": "https://registry.npmmirror.com/vue-barcode/-/vue-barcode-1.3.0.tgz",
+      "integrity": "sha512-DxQ0hxes/dP6GajsJumpW6jV14VwlnTwStZbtE6G0wkewuJVDoDOdxUr5seGuxsMT9fJ0aty4X47Z5TG0M/gxg==",
+      "requires": {
+        "jsbarcode": "^3.5.8"
+      }
+    },
     "vue-cli-plugin-i18n": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/vue-cli-plugin-i18n/-/vue-cli-plugin-i18n-1.0.1.tgz",

+ 3 - 1
package.json

@@ -35,7 +35,6 @@
     "better-scroll": "^2.0.2",
     "big.js": "^5.2.2",
     "bpmn-js": "^7.3.0",
-    "diagram-js": "^6.8.2",
     "bpmn-js-properties-panel": "^0.35.0",
     "camunda-bpmn-moddle": "^4.4.0",
     "clipboard": "^2.0.6",
@@ -44,6 +43,7 @@
     "dayjs": "^1.8.35",
     "default-passive-events": "^2.0.0",
     "detect-indent": "^6.0.0",
+    "diagram-js": "^6.8.2",
     "diagram-js-minimap": "^2.0.3",
     "diagram-js-origin": "^1.3.1",
     "echarts": "^4.9.0",
@@ -56,6 +56,7 @@
     "highlight.js": "^10.1.2",
     "hls.js": "^0.14.11",
     "hotkeys-js": "^3.8.1",
+    "html2canvas": "^1.4.1",
     "jquery": "^3.6.0",
     "js-base64": "^3.7.2",
     "js-cookie": "^2.2.1",
@@ -85,6 +86,7 @@
     "video.js": "^7.8.4",
     "vue": "^2.6.12",
     "vue-aplayer": "^1.6.1",
+    "vue-barcode": "^1.3.0",
     "vue-codemirror": "^4.0.6",
     "vue-count-to": "^1.0.13",
     "vue-echarts": "^5.0.0-beta.0",

+ 243 - 0
src/views/system/jbdScan/SampleTag.vue

@@ -0,0 +1,243 @@
+<template>
+	<div class="bg">
+		<div ref="qrcode" id="box">
+			<div v-for="(item1,index1) in list" :key="index1">
+				<div v-for="(item2,index2) in parseInt(item1.num)" :key="index2">
+					<div class="tagBox">
+						<div class="lh">
+							<div>样品名称:</div>
+							<div>{{item1.name}}</div>
+						</div>
+						<div class="la">
+							<div class="lh">
+								<div>样品编号:</div>
+								<div>{{item1.serial}}</div>
+							</div>
+							<div class="lh" style="margin-left: 15rpx">
+								<div>收样时间:</div>
+								<div></div>
+							</div>
+						</div>
+						<div class="lh">
+							<div>样品类型:</div>
+							<div>{{item1.type}}</div>
+						</div>
+						<div class="lh">
+							<div>存储条件:</div>
+							<div>{{item1.condition}}</div>
+						</div>
+
+						<div class="lh">
+							<div>流转状态:</div>
+							<div>▢待检,▢已检,▢留样</div>
+						</div>
+						<div class="lh">
+							<div>样品数量:</div>
+							<div>{{index2+1}}/{{item1.num}}支</div>
+						</div>
+						<div>
+							<vue-barcode :value="item1.serial" :width="2" :height="40"></vue-barcode>
+						</div>
+					</div>
+				</div>
+			</div>
+		</div>
+
+	</div>
+</template>
+
+<script>
+	import html2canvas from "html2canvas";
+	import VueBarcode from 'vue-barcode';
+
+	export default {
+		components: {
+			VueBarcode
+		},
+		data() {
+			return {
+				value: '',
+				id: '',
+				list: [],
+				imgSrc: '',
+				userid: '',
+				time: ''
+			}
+		},
+		created() {
+			this.getInit()
+		},
+		onLoad(options) {
+			if (options.id) {
+				this.id = options.id
+				this.getLook(options.id)
+			}
+		},
+		methods: {
+			getInit() {
+				let info = uni.getStorageSync(USER_INFO);
+				if (info.employee.id) {
+					this.userid = info.employee.id || ''
+				}
+				var nowDate = new Date((new Date).getTime() + 8 * 60 * 60 * 1000)
+				var time = nowDate.toJSON().split('T').join(' ').substr(0, 19)
+				this.time = time
+			},
+			getLook(id) {
+				let sql =
+					`select * from t_lhypb where parent_id_ = '${id}'`
+				let requestData = this.$sig(sql)
+
+
+				this.$http.post("/ibps/business/v3/sys/universal/inputSqlSelectData", requestData).then(res => {
+					if (res.data.state == 200) {
+						const data = res.data.variables.data
+						let list = []
+						data.forEach(item => {
+							if (item.yang_pin_lei_xing != '' && parseInt(item.shu_liang_) > 0) {
+								let obj = {
+									name: item.yang_pin_ming_che,
+									serial: item.yang_pin_bian_hao,
+									type: item.yang_pin_lei_xing,
+									num: item.shu_liang_,
+									condition: item.yang_ben_yun_shu_
+								}
+								list.push(obj)
+							}
+							if (item.yang_pin_lei_er_ != '' && parseInt(item.shu_liang_er_) > 0) {
+								let obj = {
+									name: item.yang_pin_ming_che,
+									serial: item.yang_pin_bian_hao,
+									type: item.yang_pin_lei_er_,
+									num: item.shu_liang_er_,
+									condition: item.yang_pin_yun_shu_
+								}
+								list.push(obj)
+							}
+							if (item.yang_pin_lei_san_ != '' && parseInt(item.shu_liang_san_) > 0) {
+								let obj = {
+									name: item.yang_pin_ming_che,
+									serial: item.yang_pin_bian_hao,
+									type: item.yang_pin_lei_san_,
+									num: item.shu_liang_san_,
+									condition: item.yang_pin_yun_san
+								}
+								list.push(obj)
+							}
+							if (item.yang_pin_lei_si_ != '' && parseInt(item.shu_liang_si_) > 0) {
+								let obj = {
+									name: item.yang_pin_ming_che,
+									serial: item.yang_pin_bian_hao,
+									type: item.yang_pin_lei_si_,
+									num: item.shu_liang_si_,
+									condition: item.yang_pin_yun_si_
+								}
+								list.push(obj)
+							}
+
+						})
+						this.list = list
+
+						if (list.length > 0) {
+							this.$nextTick(() => {
+								this.getBtn()
+							})
+						}
+
+					}
+				})
+			},
+			getBtn() {
+				// document.getElementById("qrcode").appendChild(canvas);
+				//点击生成canvas转换成base64的图片
+				var width = document.getElementById('box').offsetWidth,
+					height = document.getElementById('box').offsetHeight,
+					scale = window.devicePixelRatio; //放大倍数
+				html2canvas(document.getElementById('box'), {}).then(canvas => {
+					const dataURL = canvas.toDataURL()
+					this.imgSrc = dataURL
+					uni.showToast({
+						title: '标签图片已生成,可以保存或者下载',
+						icon: 'none',
+						duration: 2000
+					})
+
+				});
+			},
+			downloadImage() {
+				// const dataURL = canvas.toDataURL('image/png')
+				const creatDom = document.createElement('a')
+				document.body.appendChild(creatDom)
+				creatDom.href = this.imgSrc
+				creatDom.download = this.time + '样品标签图片'
+				creatDom.click()
+			},
+			getSave() {
+				let pp = {
+					paramWhere: [{
+						id_: this.id
+					}],
+					tableName: "t_lhwtsqb",
+					paramCond: {
+						biao_qian_tu_pian: this.imgSrc,
+						update_time_: this.time,
+						update_by_: this.userid
+					}
+				}
+				let data = this.$sig(pp)
+
+				this.$http.post("ibps/business/v3/sys/universal/updateDatasContextTable", data).then(res => {
+					if (res.data.state == 200) {
+						uni.showToast({
+							title: '提交成功',
+							icon: 'none',
+							duration: 2000
+						})
+						this.$emit('saveSuccees')
+
+					} else {
+						uni.showToast({
+							title: '提交失败',
+							icon: 'none',
+							duration: 2000
+						})
+					}
+				});
+
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.bg {
+
+		// height: auto;
+	}
+
+	.tagBox {
+		width: 700rpx;
+		height: 420rpx;
+		border: 1rpx solid #000000;
+		padding: 20rpx;
+		display: flex;
+		justify-content: space-around;
+		flex-direction: column;
+		margin: 20rpx auto;
+		border-radius: 15rpx;
+		background-color: #fff;
+	}
+
+	.la {
+		display: flex;
+		align-items: center;
+	}
+
+	.lh {
+		// line-height: auto;
+		font-size: 28rpx;
+		display: flex;
+		align-items: center;
+
+	}
+</style>

+ 606 - 0
src/views/system/jbdScan/goods/liuyangData.vue

@@ -0,0 +1,606 @@
+<template>
+  <div class="sample-content">
+    <!-- 表格組件 -->
+    <div class="selectPo" @dblclick="positionBtn">
+      <el-input type="text" v-model="placeValue" clearable></el-input>
+      <!-- <div>{{ placeValue }}</div> -->
+      <input type="text" v-model="value" style="opacity: 0; position: fixed" />
+    </div>
+    <div class="viewArea" v-if="viewShow">
+      <h3 class="title">留样间样品存放位置可视图</h3>
+      <div class="close" @click="positionBtn">
+        <i class="el-icon-circle-close"></i>
+      </div>
+      <div class="select_quyu" v-if="viewShow">
+        <div class="test-quyu" v-if="leixingcare">
+          <div class="test-list">
+            <ul class="list-items">
+              <li
+                class="list-item quyu-item"
+                :style="{
+                  background: quyuShow == item.qu_yu_ ? '#FF9900' : '#0099CC',
+                }"
+                @click="qu_yu_Event"
+                v-for="item in quyu_arr"
+                :key="item.qu_yu_"
+              >
+                {{ item.qu_yu_ }}
+              </li>
+            </ul>
+          </div>
+        </div>
+        <div class="huojia">
+          <div class="test-list">
+            <ul class="list-items">
+              <li
+                class="list-item huojia-item"
+                :style="{
+                  background:
+                    huojiashow ==
+                    item.huo_jia_hao_ + '号' + item.huo_jia_lei_xing_
+                      ? '#ff9900'
+                      : '#0099cc',
+                }"
+                @click="huo_jia_hao_Event"
+                v-for="(item, index) in huo_jia_arr"
+                :key="index"
+              >
+                {{ item.huo_jia_hao_ }}号{{ item.huo_jia_lei_xing_}}
+              </li>
+            </ul>
+          </div>
+        </div>
+        <div class="huojia">
+          <div class="test-list" v-show="!leixingcare">
+            <ul class="list-items">
+              <li
+                class="list-item huojia-item"
+                :style="{
+                  background:
+                    guajiashow == item.gua_jia_hao_ + '号挂件'
+                      ? '#FF9900'
+                      : '#e5baba',
+                }"
+                @click="gua_jia_Event"
+                v-for="(item, index) in gua_jia_arr"
+                :key="index"
+              >
+                {{ item.gua_jia_hao_ }}号挂件
+              </li>
+            </ul>
+          </div>
+        </div>
+      </div>
+      <div class="body-content" v-if="viewShow">
+        <div class="right-view">
+          <div class="goods-items">
+            <div
+              class="show-demo"
+              v-for="(item, index) in listData"
+              :key="item"
+            >
+              <div @click="positionClick(listData[index])">
+                <div class="goods-level">
+                  <div class="level-dsc">第{{ index }}层</div>
+                  <div class="goods-list">
+                    <div
+                      class="goods-dsc"
+                      v-for="(it, ind) in listData[index]"
+                      :key="ind"
+                      :style="{
+                        background:
+                          it.wei_zhi_zhuang_ta == '空余' ? '#67c23a' : '',
+                      }"
+                    >
+                      <div class="top-dsc">
+                        <div class="position">
+                          <!-- <p>位置id:{{ it.shou_yang_wei_zhi }}</p>
+                          <p>货位id:{{ it.id_ }}</p> -->
+                          <p>样品名称:{{ it.yang_pin_ming_che }}</p>
+
+                          <p>样品编号:{{ it.yang_pin_bian_hao }}</p>
+                          <p>位置编号:{{ it.wei_zhi_bian_hao_ }}</p>
+
+                          <p>留样期限:{{ it.liu_yang_qi_xian_ }}</p>
+
+                          <p>位置状态:{{ it.wei_zhi_zhuang_ta }}</p>
+                          <p>存储条件:{{ it.cun_chu_tiao_jian }}</p>
+                        </div>
+                      </div>
+                    </div>
+                  </div>
+                </div>
+              </div>
+            </div>
+          </div>
+          <div
+            class="goodshelf-name"
+            style="height: 500px; font-size: 20px; text-align: center"
+          >
+            {{ desString }}
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import FixHeight from "@/mixins/height";
+import curdPost from "@/business/platform/form/utils/custom/joinCURD.js";
+export default {
+  mixins: [FixHeight],
+  data() {
+    return {
+      sampleOption: [],
+      formInline: {
+        fang_jian_hao_value: "",
+        qu_yu_value: "",
+        huo_jia_value: "",
+        gua_jia_value: "",
+      },
+      listData: [],
+      warehouseOptions: [],
+      quyu_arr: [],
+      huo_jia_arr: [],
+      gua_jia_arr: [],
+      firstLoadActive: true,
+      qu_yu_value: "",
+      quyuShow: "",
+      huojiashow: "",
+      guajiashow: "",
+      leixingcare: true,
+      cenghao: [],
+      warehouse: [],
+      loading: false,
+      // pagination: {},
+      // secondshow: false,
+      desString: "",
+      viewShow: false,
+      placeValue: "选择位置",
+    };
+  },
+  props: {
+    value: {
+      type: [String, Number, Array, Object],
+      default: "",
+    },
+  },
+  filters: {
+    specimenFilters: function (values) {
+      if (values == "空余") {
+        return "未占用";
+      } else {
+        return values;
+      }
+    },
+  },
+  // created() {},
+  methods: {
+    firstLoadViewData() {
+      var this_ = this;
+      var sqlString = `select * from t_mjypcfwz where fang_jian_lei_xin = '留样间' and qu_yu_ = '' and  huo_jia_lei_xing_ = '冰箱' and huo_jia_hao_ = '1'`;
+      this.huojiashow = "1号冰箱";
+      this.quyuShow = "";
+      this.desString = "留样间" + "1号冰箱";
+      this.queryLoad(sqlString);
+      this.formInline.fang_jian_hao_value = "留样间";
+      this.formInline.qu_yu_value = "";
+      this.formInline.huo_jia_value = "1号冰箱";
+      let sql = `select distinct huo_jia_lei_xing_ ,huo_jia_hao_ from t_mjypcfwz where fang_jian_lei_xin = '留样间'  order by huo_jia_hao_ asc`;
+      curdPost("sql", sql).then((response) => {
+        this_.huo_jia_arr = response.variables.data;
+      });
+    },
+    loadQueryData() {
+      //查询选择数据查询
+      var sqlString =
+        "select distinct fang_jian_lei_xin from t_mjypcfwz WHERE fang_jian_lei_xin !=''";
+      var this_ = this;
+      curdPost("sql", sqlString).then((response) => {
+        this_.sampleOption = response.variables.data;
+        this_.sampleOption.pop();
+      });
+    },
+    onSubmits(sql) {
+      var fang_jian_ = this.formInline.fang_jian_hao_value;
+      var qu_yu = this.formInline.qu_yu_value;
+      var huo_jia_hao_ = this.formInline.huo_jia_value.substr(0, 1);
+      let huo_jia_lei_xing_ = this.formInline.huo_jia_value.substr(
+        2,
+        this.formInline.huo_jia_value.length
+      );
+      var gua_jia_hao = this.formInline.gua_jia_value.substr(0, 1);
+      var sql;
+      if (qu_yu != "") {
+        sql = `select * from t_mjypcfwz where fang_jian_lei_xin = '${fang_jian_}' and qu_yu_ = '${qu_yu}' and huo_jia_lei_xing_ = '${huo_jia_lei_xing_}' and huo_jia_hao_ = '${huo_jia_hao_}'`;
+      } else {
+        if (huo_jia_lei_xing_.includes("冰箱")) {
+          sql = `select * from t_mjypcfwz where fang_jian_lei_xin = '${fang_jian_}' and huo_jia_lei_xing_ = '${huo_jia_lei_xing_}' and huo_jia_hao_ = '${huo_jia_hao_}'`;
+        } else if (huo_jia_lei_xing_.includes("液氮罐")) {
+          sql = `select * from t_mjypcfwz where fang_jian_lei_xin = '${fang_jian_}' and huo_jia_lei_xing_ = '${huo_jia_lei_xing_}'  and huo_jia_hao_ = '${huo_jia_hao_}' and gua_jia_hao_= '${gua_jia_hao}'`;
+        }
+      }
+      // this.desString = fang_jian_ + qu_yu + huo_jia_hao_;
+      this.queryLoad(sql);
+    },
+    queryLoad(sql) {
+      //根据样品信息货位查询相对应的样品登记表
+      var datas = [];
+      var labelsMap = {}; // map存储
+      var this_ = this;
+      this_.listData = [];
+      curdPost("sql", sql).then((res) => {
+        datas = res.variables.data;
+        datas.forEach((item) => {
+          let yangpingSql =
+            "select * from t_mjypdjb WHERE yang_pin_bian_hao = '" +
+            item.yang_pin_bian_hao +
+            "'";
+          if (!labelsMap[item.ceng_hao_]) {
+            //没有就创建
+            labelsMap[item.ceng_hao_] = [];
+            curdPost("sql", yangpingSql).then((res) => {
+              if (res.variables.data.length > 0) {
+                let data = res.variables.data;
+                item["yang_pin_ming_che"] = data[0].yang_pin_ming_che;
+                labelsMap[item.ceng_hao_].push(item);
+              } else {
+                labelsMap[item.ceng_hao_].push(item);
+              }
+            });
+          } else {
+            curdPost("sql", yangpingSql).then((res) => {
+              if (res.variables.data.length > 0) {
+                let data = res.variables.data;
+                item["yang_pin_ming_che"] = data[0].yang_pin_ming_che;
+                labelsMap[item.ceng_hao_].push(item);
+              } else {
+                labelsMap[item.ceng_hao_].push(item);
+              }
+            });
+          }
+        });
+        this_.listData = labelsMap;
+      });
+    },
+    qu_yu_Event(e) {
+      //区间 留样 样品间 点击事件 查询相应的货架号->冰箱 赋值 huo_jia_hao_
+      this.huo_jia_arrEvent(e.target.innerText);
+      this.huojiashow = "";
+      this.guajiashow = "";
+      let sqlString = `select distinct huo_jia_hao_,huo_jia_lei_xing_ from t_mjypcfwz where fang_jian_lei_xin = '${this.formInline.fang_jian_hao_value}' and qu_yu_ = '${e.target.innerText}' order by huo_jia_hao_ asc`;
+      var this_ = this;
+      this.qu_yu_value = e.target.innerText;
+      this.quyuShow = e.target.innerText;
+      this.formInline.qu_yu_value = e.target.innerText;
+      curdPost("sql", sqlString).then((response) => {
+        this_.huo_jia_arr = response.variables.data;
+      });
+    },
+    huo_jia_hao_Event(e) {
+      //货架 冰箱 液氮罐点击事件
+      console.log("huo_ji")
+      this.guajiashow = "";
+      let selectText = e.target.innerText;
+      this.guajiaarrEvent(selectText);
+      this.huojiashow = selectText;
+      let huojiaNum = selectText.substr(0, 1);
+      this.formInline.huo_jia_value = selectText;
+      let huojialeixing = this.formInline.huo_jia_value.substr(
+        2,
+        this.formInline.huo_jia_value.length
+      );
+      //区分是冰箱和液氮罐的点击事件
+      if (selectText.includes("冰箱")) {
+        //如果是冰箱 请求样品货位配置信息 ->查询登记表
+        var sql = `select * from t_mjypcfwz where fang_jian_lei_xin = '${this.formInline.fang_jian_hao_value}' and qu_yu_ = '${this.formInline.qu_yu_value}' and  huo_jia_lei_xing_ = '${huojialeixing}' and huo_jia_hao_ = '${huojiaNum}'`;
+        this.desString =
+          this.formInline.fang_jian_hao_value +
+          this.formInline.qu_yu_value +
+          huojiaNum +
+          huojialeixing;
+        this.queryLoad(sql);
+      } else if (selectText.includes("液氮罐")) {
+        //液氮罐 查询该液氮罐下所有的挂件
+        console.log(selectText)
+        let sqlString = `select distinct gua_jia_hao_ from t_mjypcfwz where huo_jia_lei_xing_ = '液氮罐' and huo_jia_hao_ = '${huojiaNum}'  order by gua_jia_hao_ asc`;
+        var this_ = this;
+        curdPost("sql", sqlString).then((response) => {
+          this_.gua_jia_arr = response.variables.data;
+        });
+      }
+      this.formInline.huo_jia_value = selectText;
+    },
+    gua_jia_Event(e) {
+      //液氮罐挂件号点击事件 查询该液氮罐下该挂件的货位位置信息;
+      let selectText = e.target.innerText;
+      this.guajiashow = selectText;
+      let hguajiaNum = selectText.substr(0, 1);
+      var fang_jian_hao_value = this.formInline.fang_jian_hao_value;
+      var huo_jia_value = this.formInline.huo_jia_value;
+      var sql = `select * from t_mjypcfwz where fang_jian_lei_xin = '${fang_jian_hao_value}' and huo_jia_lei_xing_ = '液氮罐' and huo_jia_hao_ = '${huo_jia_value.substring(
+        0,
+        1
+      )}' and gua_jia_hao_= '${hguajiaNum}'`;
+      this.desString = fang_jian_hao_value + huo_jia_value + selectText;
+      this.queryLoad(sql);
+    },
+    huo_jia_arrEvent(quyu) {
+      let sqlString = `select distinct huo_jia_hao_,huo_jia_lei_xing_ from t_mjypcfwz where fang_jian_lei_xin = '${this.formInline.fang_jian_hao_value}' and qu_yu_ = '${quyu}'   order by huo_jia_hao_ asc`;
+      var this_ = this;
+      curdPost("sql", sqlString).then((response) => {
+        this_.huo_jia_arr = response.variables.data;
+        if (!this_.firstLoadActive) {
+          this_.formInline.huo_jia_value = "";
+        }
+        this_.firstLoadActive = false;
+      });
+    },
+    guajiaarrEvent(huojiaweizhi) {
+      let huojiaNum = huojiaweizhi.substr(0, 1);
+      let huojialeixing = huojiaweizhi.substr(2, huojiaweizhi.length);
+      if (huojiaweizhi.includes("冰箱")) {
+        this.gua_jia_arr = [];
+        return;
+      }
+      let sqlString = `select distinct gua_jia_hao_ from t_mjypcfwz where fang_jian_lei_xin = '留样间' and huo_jia_lei_xing_ = '${huojialeixing}' and huo_jia_hao_ = '${huojiaNum}'   order by gua_jia_hao_`;
+      var this_ = this;
+      curdPost("sql", sqlString).then((response) => {
+        this_.gua_jia_arr = response.variables.data;
+        this_.leixingcare = false;
+      });
+    },
+    positionBtn() {
+      this.loadQueryData();
+      this.firstLoadViewData();
+      this.viewShow = !this.viewShow;
+    },
+    positionClick(values) {
+      this.viewShow = !this.viewShow;
+      this.placeValue = values[0].wei_zhi_bian_hao_;
+      let this_ = this;
+      this_.$emit("input", values[0].id_); //传导
+    },
+  },
+  watch: {
+    // "formInline.fang_jian_hao_value": function (newdata, olddata) {
+    //   //监控房间号 input 输入框数据变化 来改变区域和货架信息(input)
+    //   this.huo_jia_arr = [];
+    //   let sqlString = `select distinct qu_yu_ ,huo_jia_hao_ from t_mjypcfwz where fang_jian_lei_xin = '${newdata}' `;
+    //   var this_ = this;
+    //   curdPost("sql", sqlString).then((response) => {
+    //     this_.quyu_arr = response.variables.data.reverse();
+    //     console.log(this_.quyu_arr);
+    //     this_.quyu_arr.forEach((item) => {
+    //       if (item.qu_yu_ == "") {
+    //         this_.leixingcare = false;
+    //         this_.formInline.qu_yu_value = "";
+    //         let sql = `select distinct huo_jia_hao_,huo_jia_lei_xing_ from t_mjypcfwz where fang_jian_lei_xin = '${newdata}'  order by huo_jia_hao_ asc`;
+    //         curdPost("sql", sql).then((res) => {
+    //           this_.huo_jia_arr = res.variables.data;
+    //           console.log(this_.huo_jia_arr);
+    //         });
+    //         return;
+    //       } else {
+    //         this_.leixingcare = true;
+    //       }
+    //     });
+    //     if (!this.firstLoadActive) {
+    //       this_.formInline.qu_yu_value = "";
+    //     }
+    //   });
+    // },
+    placeValue: function (newdata, olddata) {
+      if (newdata == "" || newdata == null) {
+        this.$emit("input", "");
+      }
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+p {
+  padding: 0;
+  margin: 0;
+}
+.sample-content {
+  width: 100%;
+  // position: fixed;
+  top: 50;
+  position: relative;
+  background: white;
+  .close {
+    position: fixed;
+    right: 52px;
+    top: 20px;
+    color: red;
+    z-index: 999;
+    font-size: 45px;
+  }
+  .title {
+    width: 100%;
+    height: 14px;
+    line-height: 24px;
+    font-size: 24px;
+    text-align: center;
+  }
+  .selectPo {
+    cursor: pointer;
+    z-index: 9;
+  }
+  .top-content {
+    width: 100%;
+    .top-title {
+      text-align: center;
+      font-weight: bold;
+      width: 100%;
+      font-size: 18px;
+      line-height: 40px;
+    }
+
+    .query-content {
+      display: flex;
+      margin-left: 25px;
+    }
+  }
+  .viewArea {
+    position: fixed;
+    left: 0;
+    top: 0;
+    width: 100%;
+    background: white;
+    z-index: 99 !important;
+  }
+  .select_quyu {
+    .test-quyu,
+    .huojia {
+      width: 100%;
+      .list-items {
+        display: flex;
+        cursor: pointer;
+        .quyu-item {
+          background: #0099cc;
+        }
+        .huojia-item {
+          background: #99ccff;
+        }
+        .list-item {
+          padding: 0px 10px;
+          background-color: rgb(206, 198, 164);
+          text-align: center;
+          line-height: 35px;
+          margin-left: 20px;
+          border-radius: 10px;
+        }
+      }
+      .cangku-mingchen {
+        width: 100%;
+        text-align: left;
+        margin-left: 50px;
+      }
+    }
+  }
+
+  .body-content {
+    margin-bottom: 20px;
+    display: flex;
+    box-sizing: border-box;
+    height: 100vh;
+    overflow-x: hidden;
+    overflow-y: scroll;
+    // .left-table {
+    //   // width: 40%;
+    //   ::v-deep .el-table {
+    //     width: 40%;
+    //   }
+    // }
+    .right-view {
+      z-index: 99;
+      width: 100%;
+      .goods-items {
+        width: 100%;
+        border: solid 2px rgb(202, 236, 247);
+        display: flex;
+        flex-direction: column-reverse;
+        .show-demo {
+          width: 100%;
+          // border-bottom: 1px solid bisque;
+          //   margin: 0 auto;
+          text-align: center;
+
+          .goods-level {
+            display: flex;
+            position: relative;
+            margin-bottom: 6px;
+          }
+          .level-dsc {
+            margin-top: 12px;
+            position: absolute;
+            bottom: 0;
+            left: 10px;
+          }
+          .goods-list {
+            display: flex;
+            // justify-content: flex-start;
+            flex-wrap: wrap-reverse;
+            align-content: flex-start;
+            margin-left: 50px;
+            margin-right: 15px;
+            .goods-dsc {
+              cursor: pointer;
+              padding: 2px 6px;
+              border-radius: 5px;
+              background: #e6a23c;
+              margin-left: 12px;
+              margin-top: 6px;
+              // box-sizing: border-box;
+              .top-dsc {
+                display: flex;
+                justify-content: space-between;
+                font-size: 12px;
+                // height: 18px;
+                line-height: 18px;
+                .position {
+                  width: 165px;
+                  overflow: hidden;
+                }
+                .position > p {
+                  text-align: left;
+                  color: #fbe8ff;
+                }
+                .right-content {
+                  display: flex;
+                  align-items: center;
+                  p {
+                    height: 18px;
+                    line-height: 18px;
+                    margin-left: 5px;
+                    color: #fbe8ff;
+                    text-align: left;
+                  }
+                }
+              }
+              .bottom-dsc {
+                width: 100%;
+                text-align: center;
+                font-size: 18px;
+                height: 45px;
+                line-height: 45px;
+                margin-top: 9px;
+                color: #fbe8ff;
+              }
+              .goods-demo {
+                display: block;
+                width: 70px;
+                height: 90px;
+                border: 1px solid rgb(10, 9, 8);
+                text-align: center;
+                margin: 0;
+              }
+              .goods-code {
+                text-align: center;
+                width: 100%;
+                height: 20px;
+                line-height: 20px;
+              }
+            }
+          }
+          .goodshelf-name {
+            margin: 15px 0px;
+          }
+          .shelf {
+            width: 100%;
+            height: 40px;
+            line-height: 40px;
+            text-align: center;
+          }
+        }
+      }
+    }
+  }
+}
+</style>
+
+

+ 380 - 19
src/views/system/jbdScan/goods/manualConfirmation.vue

@@ -12,18 +12,17 @@
             測試</el-button> -->
          <!-- 扫码操作组件-->
            <div class="popContainer" v-if="redar" @click="remRedar">
-                <dv-decoration-12 style="width:150px;height:150px;margin:0 auto;top: 35%;">
+                <dv-decoration-12 style="width:150px;height:100px;margin:0 auto;top: 35%;">
                  <span style=" color: #66D9EF;">开启扫描设备连接-样品接收确认</span>
                 </dv-decoration-12>
            </div>
               <el-dialog
                width="90%"
                :modal-append-to-body='false'
-               title="      样品手动接收确认操作 - 确认样品数量、存放位置、接样确认状态 - 【位置根据是否留样二选一进行选择】"
+               title="      样品手动接收确认操作 - 确认样品数量及相关信息 - 【位置根据是否留样二选一进行选择】"
                @close="closeDialog"
                :before-close = "handleClose"
                :visible.sync="visible"
-
                > <!-- 表单是否显示 -->
                    <div style="min-height: 600px;"  @click.self="handleChange">
                      <el-button @click="submitData('确认')" type="primary" style="float: right;margin: 5px;">样品确认</el-button>
@@ -34,7 +33,8 @@
 
                          <el-table-column
                            prop="yang_pin_bian_hao"
-                           label="样品编号">
+                           label="样品编号"
+                           width="150px">
                           </el-table-column>
 
                          <el-table-column
@@ -43,9 +43,9 @@
                          </el-table-column>
 
                          <el-table-column
-                           prop="shou_yang_shu_lia"
-                           label="样数"
-                           width="100px">
+                           prop="yang_pin_zong_shu"
+                           label="样品总数"
+                           width="180px">
                          </el-table-column>
 
                          <el-table-column
@@ -61,39 +61,351 @@
                                 </template>
                          </el-table-column>
 
+
+
+
+                        <el-table-column
+                          prop="yang_pin_lei_xing"
+                          label="样品类型(一)"
+                          width="150px">
+                         </el-table-column>
+
+                        <el-table-column
+                          prop="yang_ben_yun_shu_"
+                          label="样品运输条件(一)"
+                          width="150px">
+                         </el-table-column>
+
+                        <el-table-column
+                          prop="shu_liang_"
+                          label="样品数量(一)"
+                          width="150px">
+                         </el-table-column>
+
+                        <el-table-column
+                          prop="yang_pin_gui_ge_"
+                          label="样品规格(一)"
+                          width="150px">
+                         </el-table-column>
+
+
+                         <el-table-column
+                           prop="yang_pin_lei_er_"
+                           label="样品类型(二)"
+                           width="150px">
+                          </el-table-column>
+
+                         <el-table-column
+                           prop="yang_pin_yun_shu_"
+                           label="样品运输条件(二)"
+                           width="150px">
+                          </el-table-column>
+
+                         <el-table-column
+                           prop="shu_liang_er_"
+                           label="样品数量(二)"
+                           width="150px">
+                          </el-table-column>
+
+                         <el-table-column
+                           prop="yang_pin_gui_ge_e"
+                           label="样品规格(二)"
+                           width="150px">
+                          </el-table-column>
+
+
+                         <el-table-column
+                           prop="yang_pin_lei_san_"
+                           label="样品类型(三)"
+                           width="150px">
+                          </el-table-column>
+
+                         <el-table-column
+                           prop="yang_pin_yun_san"
+                           label="样品运输条件(三)"
+                           width="150px">
+                          </el-table-column>
+
+                         <el-table-column
+                           prop="shu_liang_san_"
+                           label="样品数量(三)"
+                           width="150px">
+                          </el-table-column>
+
+                         <el-table-column
+                           prop="yang_pin_gui_ge_s"
+                           label="样品规格(三)"
+                           width="150px">
+                          </el-table-column>
+
+                        <el-table-column
+                          prop="yang_pin_lei_si_"
+                          label="样品类型(四)"
+                          width="150px">
+                         </el-table-column>
+
+                        <el-table-column
+                          prop="yang_pin_yun_si_"
+                          label="样品运输条件(四)"
+                          width="150px">
+                         </el-table-column>
+
+                        <el-table-column
+                          prop="shu_liang_si_"
+                          label="样品数量(四)"
+                          width="150px">
+                         </el-table-column>
+
+                        <el-table-column
+                          prop="yang_pin_gui_si_"
+                          label="样品规格(四)"
+                          width="150px">
+                         </el-table-column>
+
                          <el-table-column
-                           prop="shi_fou_liu_yang_"
                            label="是否留样"
-                           width="100px">
+                           width="80px">
+                           <template slot-scope="scope">
+                               <el-select v-model="scope.row.shi_fou_liu_yang_" placeholder="请选择">
+                                 <el-option
+                                   v-for="item in ifLY"
+                                   :key="item.value"
+                                   :label="item.label"
+                                   :value="item.value">
+                                 </el-option>
+                               </el-select>
+                            </template>
                          </el-table-column>
 
                          <el-table-column
                            label="样品存放位置"
-                           width="230px"
+                           width="200px"
                            >
                             <template slot-scope="scope">
                               <ibps-link-data
                                 v-model="scope.row.shou_yang_wei_zhi"
-                                template-key = "mjyphjwzjztzly"
+                                template-key = "lhypwzztzly"
                               />
+                              <!-- <weizhiData  v-model="scope.row.shou_yang_wei_zhi"/> -->
                              </template>
                          </el-table-column>
 
                          <el-table-column
                            label="留样存放位置"
-                           width="230px">
+                           width="200px">
                             <template slot-scope="scope">
                               <ibps-link-data
                                 v-model="scope.row.liu_yang_wei_zhi_"
-                                template-key = "mjyphjwzjztzly"
+                                template-key = "lhypwzztzly"
                               />
+                              <!-- <liuyangData v-model="scope.row.liu_yang_wei_zhi_"/> -->
                              </template>
 
                          </el-table-column>
 
+
+                        <el-table-column
+                          label="验收结果"
+                          width="120px">
+                          <template slot-scope="scope">
+                              <el-select v-model="scope.row.yan_shou_jie_guo_" placeholder="请选择">
+                                <el-option
+                                  v-for="item in checkOptions"
+                                  :key="item.value"
+                                  :label="item.label"
+                                  :value="item.value">
+                                </el-option>
+                              </el-select>
+                           </template>
+                        </el-table-column>
+
+                        <el-table-column
+                          label="留样日期"
+                          width="150px">
+                          <template slot-scope="scope">
+                            <el-date-picker
+                              v-model="scope.row.liu_yang_ri_qi_"
+                              type="date"
+                              value-format="yyyy-MM-dd"
+                              format="yyyy-MM-dd"
+                              placeholder="请选择"
+                              :readonly="false"
+                              :clearable="true"
+                            />
+                          </template>
+                        </el-table-column>
+
+                        <el-table-column
+                          label="留样数量"
+                          width="150px">
+                          <template slot-scope="scope">
+                              <el-input-number
+                               v-model="scope.row.liu_yang_shu_lian"
+                                controls-position="right"
+                                @change="handleChange"
+                                :min="1" :max="9999">
+                               </el-input-number>
+                           </template>
+
+                        </el-table-column>
+
+
+                        <el-table-column
+                          label="留样期限至"
+                          width="150px">
+                          <template slot-scope="scope">
+                            <el-date-picker
+                              v-model="scope.row.liu_yang_qi_xian"
+                              type="date"
+                              value-format="yyyy-MM-dd"
+                              format="yyyy-MM-dd"
+                              placeholder="请选择"
+                              :readonly="false"
+                              :clearable="true"
+                            />
+                          </template>
+                        </el-table-column>
+
+
+                        <el-table-column
+                          label="销毁日期"
+                          width="150">
+                          <template slot-scope="scope">
+                            <el-date-picker
+                              v-model="scope.row.xiao_hui_ri_qi_"
+                              type="date"
+                              value-format="yyyy-MM-dd"
+                              format="yyyy-MM-dd"
+                              placeholder="请选择"
+                              :readonly="false"
+                              :clearable="true"
+                            />
+                          </template>
+                        </el-table-column>
+
+                        <el-table-column
+                          label="返样日期"
+                          width="150px">
+                          <template slot-scope="scope">
+                            <el-date-picker
+                              v-model="scope.row.fan_yang_ri_qi_"
+                              type="date"
+                              value-format="yyyy-MM-dd"
+                              format="yyyy-MM-dd"
+                              placeholder="请选择"
+                              :readonly="false"
+                              :clearable="true"
+                            />
+                          </template>
+                        </el-table-column>
+
+
+                        <el-table-column
+                          label="返样接样人"
+                          width="150px">
+                          <template slot-scope="scope">
+                            <el-input
+                                  v-model="scope.row.fan_yang_jyr"
+                                  placeholder="请输入"
+                                  type="text"
+                                  :readonly="false"
+                                  clearable
+                                />
+                          </template>
+                        </el-table-column>
+
+
+                        <el-table-column
+                          label="姓名"
+                          width="150px">
+                          <template slot-scope="scope">
+                            <el-input
+                                  v-model="scope.row.xing_ming_"
+                                  placeholder="请输入"
+                                  type="text"
+                                  :readonly="false"
+                                  clearable
+                                />
+                          </template>
+                        </el-table-column>
+
+                        <el-table-column
+                          label="性别"
+                          width="150px">
+                            <template slot-scope="scope">
+                                <el-select v-model="scope.row.xing_bie_" placeholder="请选择">
+                                  <el-option
+                                    v-for="item in sex"
+                                    :key="item.value"
+                                    :label="item.label"
+                                    :value="item.value">
+                                  </el-option>
+                                </el-select>
+                             </template>
+                        </el-table-column>
+
+                        <el-table-column
+                          label="年龄"
+                          width="130px">
+                          <template slot-scope="scope">
+                            <el-input
+                                  v-model="scope.row.nian_ling_"
+                                  placeholder="请输入"
+                                  type="text"
+                                  :readonly="false"
+                                  clearable
+                                />
+                          </template>
+                        </el-table-column>
+
+
+                       <el-table-column
+                          label="报告编制员"
+                          width="130px">
+                           <template slot-scope="scope">
+                              <ibps-user-selector
+                                v-model="scope.row.bao_gao_bian_zhi_"
+                                placeholder="请选择"
+                                type="user"
+                                :multiple="true"
+                                store="id"
+                              />
+                           </template>
+                        </el-table-column>
+
+                        <el-table-column
+                          label="报告复核员"
+                          width="130px">
+                           <template slot-scope="scope">
+                            <ibps-user-selector
+                              v-model="scope.row.bao_gao_shen_he_y"
+                              placeholder="请选择"
+                              type="user"
+                              :multiple="true"
+                              store="id"
+                            />
+                            </template>
+                        </el-table-column>
+
+
+                        <el-table-column
+                          label="备注"
+                          width="180px">
+                          <template slot-scope="scope">
+                            <el-input
+                                  v-model="scope.row.bei_zhu_"
+                                  placeholder="请输入"
+                                  type="text"
+                                  :readonly="false"
+                                  clearable
+                                />
+                          </template>
+                        </el-table-column>
+                                            
+  
                          <el-table-column
                            label="接样确认状态"
-                           width="230px">
+                           width="130px">
                             <template slot-scope="scope">
                                 <el-select v-model="scope.row.jie_yang_zhuang_t" placeholder="请选择">
                                   <el-option
@@ -108,6 +420,8 @@
 
                          </el-table-column>
 
+
+
                          <el-table-column label="功能">
                                  <template slot-scope="scope">
                                      <el-button
@@ -121,6 +435,15 @@
 
 
                        </el-table>
+                       <el-pagination
+                         layout="prev,pager,next"
+                         background
+                         @current-change="current_change"
+                         :current-page="currentPage"
+                         :pager-count="5"
+                         :page-size="10"
+                         :total="this.pageCount"
+                       ></el-pagination>
                    </div>
              </el-dialog>
 
@@ -131,15 +454,23 @@
 <script>
 import manualConfirmationJS from '../js/manualConfirmationJS.js'
 import IbpsLinkData from '@/business/platform/data/templaterender/link-data'
+import weizhiData from "./weizhiData.vue"
+import liuyangData from "./liuyangData.vue"
+
+import IbpsUserSelector from '@/business/platform/org/selector'
  export default {
    components:{
-     IbpsLinkData
+     IbpsLinkData,
+     weizhiData,
+     liuyangData,
+
+    IbpsUserSelector
+
    },
    mixins:[manualConfirmationJS],
    props:{scanVisible:Boolean},
    watch:{
     listData: {
-
            handler(val, oldName) {
             if(val.length>0){
               this.visible = true
@@ -168,7 +499,7 @@ import IbpsLinkData from '@/business/platform/data/templaterender/link-data'
      }
    },
    created() {
-     this.facilityData()
+     this.facilityData(1)
    },
   data () {
     return {
@@ -177,6 +508,7 @@ import IbpsLinkData from '@/business/platform/data/templaterender/link-data'
      redar:false,
      facilityId:'',
      listData:[],
+     currentPage:1,
      options: [{
                value: '已确认',
                label: '已确认'
@@ -184,11 +516,40 @@ import IbpsLinkData from '@/business/platform/data/templaterender/link-data'
                value: '未确认',
                label: '未确认'
              }],
-      OriginalPosition:[],
-      mjwtsqbAllResult:[]
+      checkOptions:[{
+            value:'完好',
+            label:'完好'
+          },{
+            value:'残缺',
+            label:'残缺'
+          }],
+      ifLY:[{
+          value:'是',
+          label:'是'
+        },{
+          value:'否',
+          label:'否'
+        }],
+        sex:[{
+          value:'男',
+          label:'男'
+        },{
+          value:'女',
+          label:'女'
+        }],
+      // OriginalPosition:[],
+      mjwtsqbAllResult:[],
+      pageCount:'',
+      item:''
 
     }
   },
+  methods:{
+    current_change(currentPage){
+      this.currentPage = currentPage
+      this.facilityData(currentPage)
+    }
+  }
 
   }
 </script>

+ 402 - 70
src/views/system/jbdScan/goods/sampleConfirmation.vue

@@ -32,81 +32,393 @@
                            style="width: 100%">
 
                          <el-table-column
-                           prop="yang_pin_bian_hao"
-                           label="样品编号">
-                          </el-table-column>
-
-                         <el-table-column
-                           prop="yang_pin_ming_che"
-                           label="样品名称">
-                         </el-table-column>
-
-                         <el-table-column
-                           prop="shou_yang_shu_lia"
-                           label="收样数量"
-                           width="100px">
-                         </el-table-column>
-
-                         <el-table-column
-                           label="本次扫码数量"
-                           width="150px">
-                               <template slot-scope="scope">
-                                   <el-input-number
-                                    v-model="scope.row.jie_yang_shu_lian"
-                                    controls-position="right"
-                                    @change="handleChange"
-                                    :min="1" :max="9999">
-                                    </el-input-number>
-                                </template>
-                         </el-table-column>
-
-                         <el-table-column
-                           prop="shi_fou_liu_yang_"
-                           label="是否留样"
-                           width="100px">
-                         </el-table-column>
-
-                         <el-table-column
-                           label="样品存放位置"
-                           width="230px"
-                           >
-                            <template slot-scope="scope">
-                              <ibps-link-data
-                                v-model="scope.row.shou_yang_wei_zhi"
-                                template-key = "mjyphjwzjztzly"
-                              />
-                             </template>
-                         </el-table-column>
-<!--
-                                store="id" -->
-                         <el-table-column
-                           label="留样存放位置"
-                           width="230px">
-                            <template slot-scope="scope">
-                              <ibps-link-data
-                                v-model="scope.row.liu_yang_wei_zhi_"
-                                template-key = "mjyphjwzjztzly"
-                              />
-                             </template>
-
-                         </el-table-column>
-
-                         <el-table-column
-                           label="接样确认状态"
-                           width="230px">
+                             prop="yang_pin_bian_hao"
+                             label="样品编号"
+                             width="150px">
+                            </el-table-column>
+                         
+                           <el-table-column
+                             prop="yang_pin_ming_che"
+                             label="样品名称">
+                           </el-table-column>
+                         
+                           <el-table-column
+                             prop="yang_pin_zong_shu"
+                             label="样品总数"
+                             width="180px">
+                           </el-table-column>
+                         
+                           <el-table-column
+                             label="本次确认数量"
+                             width="150px">
+                                 <template slot-scope="scope">
+                                     <el-input-number
+                                      v-model="scope.row.jie_yang_shu_lian"
+                                      controls-position="right"
+                                      @change="handleChange"
+                                      :min="1" :max="9999">
+                                      </el-input-number>
+                                  </template>
+                           </el-table-column>
+                         
+                         
+                         
+                         
+                          <el-table-column
+                            prop="yang_pin_lei_xing"
+                            label="样品类型(一)"
+                            width="150px">
+                           </el-table-column>
+                         
+                          <el-table-column
+                            prop="yang_ben_yun_shu_"
+                            label="样品运输条件(一)"
+                            width="150px">
+                           </el-table-column>
+                         
+                          <el-table-column
+                            prop="shu_liang_"
+                            label="样品数量(一)"
+                            width="150px">
+                           </el-table-column>
+                         
+                          <el-table-column
+                            prop="yang_pin_gui_ge_"
+                            label="样品规格(一)"
+                            width="150px">
+                           </el-table-column>
+                         
+                         
+                           <el-table-column
+                             prop="yang_pin_lei_er_"
+                             label="样品类型(二)"
+                             width="150px">
+                            </el-table-column>
+                         
+                           <el-table-column
+                             prop="yang_pin_yun_shu_"
+                             label="样品运输条件(二)"
+                             width="150px">
+                            </el-table-column>
+                         
+                           <el-table-column
+                             prop="shu_liang_er_"
+                             label="样品数量(二)"
+                             width="150px">
+                            </el-table-column>
+                         
+                           <el-table-column
+                             prop="yang_pin_gui_ge_e"
+                             label="样品规格(二)"
+                             width="150px">
+                            </el-table-column>
+                         
+                         
+                           <el-table-column
+                             prop="yang_pin_lei_san_"
+                             label="样品类型(三)"
+                             width="150px">
+                            </el-table-column>
+                         
+                           <el-table-column
+                             prop="yang_pin_yun_san"
+                             label="样品运输条件(三)"
+                             width="150px">
+                            </el-table-column>
+                         
+                           <el-table-column
+                             prop="shu_liang_san_"
+                             label="样品数量(三)"
+                             width="150px">
+                            </el-table-column>
+                         
+                           <el-table-column
+                             prop="yang_pin_gui_ge_s"
+                             label="样品规格(三)"
+                             width="150px">
+                            </el-table-column>
+                         
+                          <el-table-column
+                            prop="yang_pin_lei_si_"
+                            label="样品类型(四)"
+                            width="150px">
+                           </el-table-column>
+                         
+                          <el-table-column
+                            prop="yang_pin_yun_si_"
+                            label="样品运输条件(四)"
+                            width="150px">
+                           </el-table-column>
+                         
+                          <el-table-column
+                            prop="shu_liang_si_"
+                            label="样品数量(四)"
+                            width="150px">
+                           </el-table-column>
+                         
+                          <el-table-column
+                            prop="yang_pin_gui_si_"
+                            label="样品规格(四)"
+                            width="150px">
+                           </el-table-column>
+                         
+                           <el-table-column
+                             label="是否留样"
+                             width="80px">
+                             <template slot-scope="scope">
+                                 <el-select v-model="scope.row.shi_fou_liu_yang_" placeholder="请选择">
+                                   <el-option
+                                     v-for="item in ifLY"
+                                     :key="item.value"
+                                     :label="item.label"
+                                     :value="item.value">
+                                   </el-option>
+                                 </el-select>
+                              </template>
+                           </el-table-column>
+                         
+                           <el-table-column
+                             label="样品存放位置"
+                             width="200px"
+                             >
+                              <template slot-scope="scope">
+                                <ibps-link-data
+                                  v-model="scope.row.shou_yang_wei_zhi"
+                                  template-key = "lhypwzztzly"
+                                />
+                                <!-- <weizhiData  v-model="scope.row.shou_yang_wei_zhi"/> -->
+                               </template>
+                           </el-table-column>
+                         
+                           <el-table-column
+                             label="留样存放位置"
+                             width="200px">
+                              <template slot-scope="scope">
+                                <ibps-link-data
+                                  v-model="scope.row.liu_yang_wei_zhi_"
+                                  template-key = "lhypwzztzly"
+                                />
+                                <!-- <liuyangData v-model="scope.row.liu_yang_wei_zhi_"/> -->
+                               </template>
+                         
+                           </el-table-column>
+                         
+                         
+                          <el-table-column
+                            label="验收结果"
+                            width="120px">
                             <template slot-scope="scope">
-                                <el-select v-model="scope.row.jie_yang_zhuang_t" placeholder="请选择">
+                                <el-select v-model="scope.row.yan_shou_jie_guo_" placeholder="请选择">
                                   <el-option
-                                    v-for="item in options"
+                                    v-for="item in checkOptions"
                                     :key="item.value"
                                     :label="item.label"
                                     :value="item.value">
                                   </el-option>
                                 </el-select>
-
                              </template>
-
-                         </el-table-column>
+                          </el-table-column>
+                         
+                          <el-table-column
+                            label="留样日期"
+                            width="150px">
+                            <template slot-scope="scope">
+                              <el-date-picker
+                                v-model="scope.row.liu_yang_ri_qi_"
+                                type="date"
+                                value-format="yyyy-MM-dd"
+                                format="yyyy-MM-dd"
+                                placeholder="请选择"
+                                :readonly="false"
+                                :clearable="true"
+                              />
+                            </template>
+                          </el-table-column>
+                         
+                          <el-table-column
+                            label="留样数量"
+                            width="150px">
+                            <template slot-scope="scope">
+                                <el-input-number
+                                 v-model="scope.row.liu_yang_shu_lian"
+                                  controls-position="right"
+                                  @change="handleChange"
+                                  :min="1" :max="9999">
+                                 </el-input-number>
+                             </template>
+                         
+                          </el-table-column>
+                         
+                         
+                          <el-table-column
+                            label="留样期限至"
+                            width="150px">
+                            <template slot-scope="scope">
+                              <el-date-picker
+                                v-model="scope.row.liu_yang_qi_xian"
+                                type="date"
+                                value-format="yyyy-MM-dd"
+                                format="yyyy-MM-dd"
+                                placeholder="请选择"
+                                :readonly="false"
+                                :clearable="true"
+                              />
+                            </template>
+                          </el-table-column>
+                         
+                         
+                          <el-table-column
+                            label="销毁日期"
+                            width="150">
+                            <template slot-scope="scope">
+                              <el-date-picker
+                                v-model="scope.row.xiao_hui_ri_qi_"
+                                type="date"
+                                value-format="yyyy-MM-dd"
+                                format="yyyy-MM-dd"
+                                placeholder="请选择"
+                                :readonly="false"
+                                :clearable="true"
+                              />
+                            </template>
+                          </el-table-column>
+                         
+                          <el-table-column
+                            label="返样日期"
+                            width="150px">
+                            <template slot-scope="scope">
+                              <el-date-picker
+                                v-model="scope.row.fan_yang_ri_qi_"
+                                type="date"
+                                value-format="yyyy-MM-dd"
+                                format="yyyy-MM-dd"
+                                placeholder="请选择"
+                                :readonly="false"
+                                :clearable="true"
+                              />
+                            </template>
+                          </el-table-column>
+                         
+                         
+                          <el-table-column
+                            label="返样接样人"
+                            width="150px">
+                            <template slot-scope="scope">
+                              <el-input
+                                    v-model="scope.row.fan_yang_jyr"
+                                    placeholder="请输入"
+                                    type="text"
+                                    :readonly="false"
+                                    clearable
+                                  />
+                            </template>
+                          </el-table-column>
+                         
+                         
+                          <el-table-column
+                            label="姓名"
+                            width="150px">
+                            <template slot-scope="scope">
+                              <el-input
+                                    v-model="scope.row.xing_ming_"
+                                    placeholder="请输入"
+                                    type="text"
+                                    :readonly="false"
+                                    clearable
+                                  />
+                            </template>
+                          </el-table-column>
+                         
+                          <el-table-column
+                            label="性别"
+                            width="150px">
+                              <template slot-scope="scope">
+                                  <el-select v-model="scope.row.xing_bie_" placeholder="请选择">
+                                    <el-option
+                                      v-for="item in sex"
+                                      :key="item.value"
+                                      :label="item.label"
+                                      :value="item.value">
+                                    </el-option>
+                                  </el-select>
+                               </template>
+                          </el-table-column>
+                         
+                          <el-table-column
+                            label="年龄"
+                            width="130px">
+                            <template slot-scope="scope">
+                              <el-input
+                                    v-model="scope.row.nian_ling_"
+                                    placeholder="请输入"
+                                    type="text"
+                                    :readonly="false"
+                                    clearable
+                                  />
+                            </template>
+                          </el-table-column>
+                         
+                         
+                         <el-table-column
+                            label="报告编制员"
+                            width="130px">
+                             <template slot-scope="scope">
+                                <ibps-user-selector
+                                  v-model="scope.row.bao_gao_bian_zhi_"
+                                  placeholder="请选择"
+                                  type="user"
+                                  :multiple="true"
+                                  store="id"
+                                />
+                             </template>
+                          </el-table-column>
+                         
+                          <el-table-column
+                            label="报告复核员"
+                            width="130px">
+                             <template slot-scope="scope">
+                              <ibps-user-selector
+                                v-model="scope.row.bao_gao_shen_he_y"
+                                placeholder="请选择"
+                                type="user"
+                                :multiple="true"
+                                store="id"
+                              />
+                              </template>
+                          </el-table-column>
+                         
+                         
+                          <el-table-column
+                            label="备注"
+                            width="180px">
+                            <template slot-scope="scope">
+                              <el-input
+                                    v-model="scope.row.bei_zhu_"
+                                    placeholder="请输入"
+                                    type="text"
+                                    :readonly="false"
+                                    clearable
+                                  />
+                            </template>
+                          </el-table-column>
+                                              
+                           
+                           <el-table-column
+                             label="接样确认状态"
+                             width="130px">
+                              <template slot-scope="scope">
+                                  <el-select v-model="scope.row.jie_yang_zhuang_t" placeholder="请选择">
+                                    <el-option
+                                      v-for="item in options"
+                                      :key="item.value"
+                                      :label="item.label"
+                                      :value="item.value">
+                                    </el-option>
+                                  </el-select>
+                         
+                               </template>
+                         
+                           </el-table-column>
 
                          <el-table-column label="功能">
                                  <template slot-scope="scope">
@@ -121,6 +433,15 @@
 
 
                        </el-table>
+                       <!-- <el-pagination
+                         layout="prev,pager,next"
+                         background
+                         @current-change="current_change"
+                         :current-page="currentPage"
+                         :pager-count="5"
+                         :page-size="10"
+                         :total="this.pageCount"
+                       ></el-pagination> -->
                    </div>
              </el-dialog>
 
@@ -131,9 +452,13 @@
 <script>
 import sampleConfirmationJS from '../js/sampleConfirmationJS.js'
 import IbpsLinkData from '@/business/platform/data/templaterender/link-data'
+import weizhiData from "./weizhiData.vue"
+import liuyangData from "./liuyangData.vue"
  export default {
    components:{
-     IbpsLinkData
+     IbpsLinkData,
+     weizhiData,
+     liuyangData
    },
    mixins:[sampleConfirmationJS],
    props:{scanVisible:Boolean},
@@ -180,11 +505,18 @@ import IbpsLinkData from '@/business/platform/data/templaterender/link-data'
                label: '未确认'
              }],
       OriginalPosition:[],
-      mjwtsqbAllResult:[]
+      mjwtsqbAllResult:[],
+      // currentPage:1,
+      // pageCount:''
 
     }
   },
-
+  // methods:{
+  //   current_change(currentPage){
+  //     this.currentPage = currentPage
+  //     this.facilityData(currentPage)
+  //   }
+  // }
   }
 </script>
 

+ 606 - 0
src/views/system/jbdScan/goods/weizhiData.vue

@@ -0,0 +1,606 @@
+<template>
+  <div class="sample-content">
+    <!-- 表格組件 -->
+    <div class="selectPo" @dblclick="positionBtn">
+      <el-input type="text" v-model="placeValue" clearable></el-input>
+      <input type="text" v-model="value" style="opacity: 0; position: fixed" />
+    </div>
+   <div class="viewArea" v-if="viewShow">
+      <h2 class="title">样品间样品存放位置可视图</h2>
+      <div class="close" @click="positionBtn"><i class="el-icon-circle-close"></i></div>
+      <div class="select_quyu" v-if="viewShow">
+        <div class="test-quyu" v-if="leixingcare">
+          <div class="test-list">
+            <ul class="list-items">
+              <li
+                class="list-item quyu-item"
+                :style="{
+                  background: quyuShow == item.qu_yu_ ? '#FF9900' : '#0099CC',
+                }"
+                @click="qu_yu_Event"
+                v-for="item in quyu_arr"
+                :key="item.qu_yu_"
+              >
+                {{ item.qu_yu_ }}
+              </li>
+            </ul>
+          </div>
+        </div>
+        <div class="huojia">
+          <div class="test-list">
+            <ul class="list-items">
+              <li
+                class="list-item huojia-item"
+                :style="{
+                  background:
+                    huojiashow ==
+                    item.huo_jia_hao_ + '号' + item.huo_jia_lei_xing_
+                      ? '#ff9900'
+                      : '#0099cc',
+                }"
+                @click="huo_jia_hao_Event"
+                v-for="(item, index) in huo_jia_arr"
+                :key="index"
+              >
+                {{ item.huo_jia_hao_ }}号{{ item.huo_jia_lei_xing_ }}
+              </li>
+            </ul>
+          </div>
+        </div>
+        <div class="huojia">
+          <div class="test-list" v-show="!leixingcare">
+            <ul class="list-items">
+              <li
+                class="list-item huojia-item"
+                :style="{
+                  background:
+                    guajiashow == item.gua_jia_hao_ + '号挂件'
+                      ? '#FF9900'
+                      : '#e5baba',
+                }"
+                @click="gua_jia_Event"
+                v-for="(item, index) in gua_jia_arr"
+                :key="index"
+              >
+                {{ item.gua_jia_hao_ }}号挂件
+              </li>
+            </ul>
+          </div>
+        </div>
+      </div>
+      <div class="body-content" v-if="viewShow" v-loading="loading">
+        <div class="right-view">
+          <div class="goods-items">
+            <div
+              class="show-demo"
+              v-for="(item, index) in listData"
+              :key="item"
+            >
+              <div @click="positionClick(listData[index])">
+                <div class="goods-level">
+                  <div class="level-dsc">第{{ index }}层</div>
+                  <div class="goods-list">
+                    <div
+                      class="goods-dsc"
+                      v-for="(it, ind) in listData[index]"
+                      :key="ind"
+                      :style="{
+                        background:
+                          it.wei_zhi_zhuang_ta == '空余' ? '#67c23a' : '',
+                      }"
+                    >
+                      <div class="top-dsc">
+                        <div class="position">
+                          <!-- <p>位置id:{{ it.shou_yang_wei_zhi }}</p>
+                          <p>货位id:{{ it.id_ }}</p>                          -->
+                          <p>样品名称:{{ it.yang_pin_ming_che}}</p>
+                          <p>位置编号:{{ it.wei_zhi_bian_hao_ }}</p>
+                          <p>样品编号:{{ it.yang_pin_bian_hao }}</p>
+                          <p>位置状态:{{ it.wei_zhi_zhuang_ta }}</p>
+                          <p>
+                            存储条件:{{
+                              it.cun_chu_tiao_jian || it.cun_chu_yao_qiu_
+                            }}
+                          </p>
+                        </div>
+                      </div>
+                      <div class="bottom-dsc" v-if="false">
+                        {{ it.yang_pin_ming_che || it.wei_zhi_zhuang_ta }}
+                      </div>
+                    </div>
+                  </div>
+                </div>
+              </div>
+
+            </div>
+
+
+          </div>
+          <div
+            class="goodshelf-name"
+            style="height: 500px;font-size:20px;text-align:center"
+            >
+                {{ desString }}
+            </div>
+        </div>
+        
+      </div>
+
+    </div>
+  </div>
+</template>
+
+<script>
+import FixHeight from "@/mixins/height";
+import curdPost from "@/business/platform/form/utils/custom/joinCURD.js";
+export default {
+  mixins: [FixHeight],
+  data() {
+    return {
+      sampleOption: [],
+      formInline: {
+        fang_jian_hao_value: "",
+        qu_yu_value: "",
+        huo_jia_value: "",
+        gua_jia_value: "",
+      },
+      listData: [],
+      warehouseOptions: [],
+      quyu_arr: [],
+      huo_jia_arr: [],
+      gua_jia_arr: [],
+      firstLoadActive: true,
+      qu_yu_value: "",
+      quyuShow: "",
+      huojiashow: "",
+      guajiashow: "",
+      leixingcare: true,
+      cenghao: [],
+      warehouse: [],
+      loading: false,
+      // pagination: {},
+      // secondshow: false,
+      desString: "",
+      viewShow: false,
+      placeValue: "选择位置",
+      loading: true,
+      samplearr:[],
+    };
+  },
+  props: {
+    value: {
+      type: [String, Number, Array, Object],
+      default: "",
+    },
+  },
+  filters: {
+    specimenFilters: function (values) {
+      if (values == "空余") {
+        return "未占用";
+      } else {
+        return values;
+      }
+    },
+  },
+  methods: {
+    firstLoadViewData() {
+      var this_ = this;
+      var sqlString = `select * from t_mjypcfwz where fang_jian_lei_xin = '样品间' and qu_yu_ ='待检区' and huo_jia_hao_ = '1' and huo_jia_lei_xing_ = '冰箱'`;
+      this.huojiashow = "1号冰箱";
+      this.quyuShow = "待检区";
+      this.desString = "样品间" + "待检区1号冰箱";
+      this.queryLoad(sqlString);
+      this.formInline.fang_jian_hao_value = "样品间";
+      this.formInline.qu_yu_value = "待检区";
+      this.formInline.huo_jia_value = "1号冰箱";
+      let sql = `select distinct huo_jia_hao_,huo_jia_lei_xing_ from t_mjypcfwz where fang_jian_lei_xin = '样品间' and qu_yu_ ='待检区'  order by huo_jia_hao_ asc `;
+      curdPost("sql", sql).then((response) => {
+        this_.huo_jia_arr = response.variables.data;
+      });
+    },
+    loadQueryData() {
+      //查询选择数据查询
+      var sqlString =
+        "select distinct fang_jian_lei_xin from t_mjypcfwz WHERE fang_jian_lei_xin !=''";
+      // var sqlString = "select * from t_mjypcfwz";
+      var this_ = this;
+      curdPost("sql", sqlString).then((response) => {
+        this_.sampleOption = response.variables.data;
+        this_.sampleOption.pop();
+      });
+    },
+    onSubmits(sql) {
+      var fang_jian_ = this.formInline.fang_jian_hao_value;
+      var qu_yu = this.formInline.qu_yu_value;
+      var huo_jia_hao_ = this.formInline.huo_jia_value.substr(0, 1);
+      let huo_jia_lei_xing_ = this.formInline.huo_jia_value.substr(
+        2,
+        this.formInline.huo_jia_value.length
+      );
+      var gua_jia_hao = this.formInline.gua_jia_value.substr(0, 1);
+      var sql;
+      if (qu_yu != "") {
+        sql = `select * from t_mjypcfwz where fang_jian_lei_xin = '${fang_jian_}' and qu_yu_ = '${qu_yu}' and huo_jia_lei_xing_ = '${huo_jia_lei_xing_}' and huo_jia_hao_ = '${huo_jia_hao_}'`;
+      } else {
+        if (huo_jia_lei_xing_.includes("冰箱")) {
+          sql = `select * from t_mjypcfwz where fang_jian_lei_xin = '${fang_jian_}' and huo_jia_lei_xing_ = '${huo_jia_lei_xing_}' and huo_jia_hao_ = '${huo_jia_hao_}'`;
+        } else if (huo_jia_lei_xing_.includes("液氮罐")) {
+          sql = `select * from t_mjypcfwz where fang_jian_lei_xin = '${fang_jian_}' and huo_jia_lei_xing_ = '${huo_jia_lei_xing_}'  and huo_jia_hao_ = '${huo_jia_hao_}' and gua_jia_hao_= '${gua_jia_hao}'`;
+        }
+      }
+      this.queryLoad(sql);
+    },
+    queryLoad(sql) {
+      //根据样品信息货位查询相对应的样品登记表
+      var datas = [];
+      var labelsMap = {}; // map存储
+      var this_ = this;
+      this_.listData = [];
+      curdPost("sql", sql).then((res) => {
+        datas = res.variables.data;
+        datas.forEach((item) => {
+          let yangpingSql ="select * from t_mjypdjb WHERE yang_pin_bian_hao = '" +item.yang_pin_bian_hao +"'";  // 通过样品货位配置的id外键 查询样品登记表
+          if (!labelsMap[item.ceng_hao_]) {           
+            labelsMap[item.ceng_hao_] = [];//没有就创建
+            curdPost("sql", yangpingSql).then((res) => {
+              if (res.variables.data.length > 0) {
+                let data = res.variables.data;
+                item['yang_pin_ming_che'] = data[0].yang_pin_ming_che;
+                labelsMap[item.ceng_hao_].push(item);
+              }else{
+                labelsMap[item.ceng_hao_].push(item);
+              }
+            });
+          } else {
+            curdPost("sql", yangpingSql).then((res) => {
+              if (res.variables.data.length > 0) {
+                let data = res.variables.data;
+                item['yang_pin_ming_che'] = data[0].yang_pin_ming_che;
+                labelsMap[item.ceng_hao_].push(item);
+              }else{
+                labelsMap[item.ceng_hao_].push(item);
+              }
+            });
+          }
+        });
+        this_.listData = labelsMap;
+        this.$nextTick(() => {
+          this.loading = false;
+        });
+
+        // this.loading = true;
+      });
+    },
+    qu_yu_Event(e) {
+      //区间 留样 样品间 点击事件 查询相应的货架号->冰箱 赋值 huo_jia_hao_
+      this.huo_jia_arrEvent(e.target.innerText);
+      this.huojiashow = "";
+      this.guajiashow = "";
+      let sqlString = `select distinct huo_jia_hao_,huo_jia_lei_xing_ from t_mjypcfwz where fang_jian_lei_xin = '${this.formInline.fang_jian_hao_value}' and qu_yu_ = '${e.target.innerText}' order by huo_jia_hao_ asc`;
+      var this_ = this;
+      this.qu_yu_value = e.target.innerText;
+      this.quyuShow = e.target.innerText;
+      this.formInline.qu_yu_value = e.target.innerText;
+      curdPost("sql", sqlString).then((response) => {
+        this_.huo_jia_arr = response.variables.data;
+      });
+    },
+    huo_jia_hao_Event(e) {
+      //货架 冰箱 液氮罐点击事件
+      this.guajiashow = "";
+      let selectText = e.target.innerText;
+      this.guajiaarrEvent(selectText);
+      this.huojiashow = selectText;
+      let huojiaNum = selectText.substr(0, 1);
+      this.formInline.huo_jia_value = selectText;
+      let huojialeixing = this.formInline.huo_jia_value.substr(
+        2,
+        this.formInline.huo_jia_value.length
+      );
+      //区分是冰箱和液氮罐的点击事件
+      if (selectText.includes("冰箱")) {
+        //如果是冰箱 请求样品货位配置信息 ->查询登记表
+        var sql = `select * from t_mjypcfwz where fang_jian_lei_xin = '${this.formInline.fang_jian_hao_value}' and qu_yu_ = '${this.formInline.qu_yu_value}' and  huo_jia_lei_xing_ = '${huojialeixing}' and huo_jia_hao_ = '${huojiaNum}'`;
+        this.desString = this.formInline.fang_jian_hao_value +this.formInline.qu_yu_value + huojiaNum+huojialeixing
+        this.queryLoad(sql);
+      } else if (selectText.includes("液氮罐")) {
+        //液氮罐 查询该液氮罐下所有的挂件
+        let sqlString = `select distinct gua_jia_hao_ from t_mjypcfwz where huo_jia_lei_xing_ = '液氮罐' and huo_jia_hao_ = '${huojiaNum}'  order by gua_jia_hao_ asc`;
+        var this_ = this;
+        curdPost("sql", sqlString).then((response) => {
+          this_.gua_jia_arr = response.variables.data;
+        });
+      }
+      this.formInline.huo_jia_value = selectText;
+    },
+    gua_jia_Event(e) {
+      //液氮罐挂件号点击事件 查询该液氮罐下该挂件的货位位置信息;
+      let selectText = e.target.innerText;
+      this.guajiashow = selectText;
+      let hguajiaNum = selectText.substr(0, 1);
+      var fang_jian_hao_value = this.formInline.fang_jian_hao_value;
+      var huo_jia_value = this.formInline.huo_jia_value;
+      var sql = `select * from t_mjypcfwz where fang_jian_lei_xin = '${fang_jian_hao_value}' and huo_jia_lei_xing_ = '液氮罐' and huo_jia_hao_ = '${huo_jia_value.substring(
+        0,
+        1
+      )}' and gua_jia_hao_= '${hguajiaNum}'`;
+      this.desString = fang_jian_hao_value + huo_jia_value + selectText;
+      this.queryLoad(sql);
+    },
+    huo_jia_arrEvent(quyu) {
+      let sqlString = `select distinct huo_jia_hao_,huo_jia_lei_xing_ from t_mjypcfwz where fang_jian_lei_xin = '${this.formInline.fang_jian_hao_value}' and qu_yu_ = '${quyu}'   order by huo_jia_hao_ asc`;
+      var this_ = this;
+      curdPost("sql", sqlString).then((response) => {
+        this_.huo_jia_arr = response.variables.data;
+        if (!this_.firstLoadActive) {
+          this_.formInline.huo_jia_value = "";
+        }
+        this_.firstLoadActive = false;
+      });
+    },
+    guajiaarrEvent(huojiaweizhi) {
+      let huojiaNum = huojiaweizhi.substr(0, 1);
+      let huojialeixing = huojiaweizhi.substr(2, huojiaweizhi.length);
+      if (huojiaweizhi.includes("冰箱")) {
+        this.gua_jia_arr = [];
+        return;
+      }
+      let sqlString = `select distinct gua_jia_hao_ from t_mjypcfwz where fang_jian_lei_xin = '留样间' and huo_jia_lei_xing_ = '${huojialeixing}' and huo_jia_hao_ = '${huojiaNum}'   order by gua_jia_hao_`;
+      var this_ = this;
+      curdPost("sql", sqlString).then((response) => {
+        this_.gua_jia_arr = response.variables.data;
+      });
+    },
+    positionBtn() {
+      this.loadQueryData();
+      this.firstLoadViewData();
+      this.viewShow = !this.viewShow;
+      console.log(this.viewShow);
+    },
+    positionClick(values) {
+      this.viewShow = !this.viewShow;
+      this.placeValue = values[0].wei_zhi_bian_hao_;
+      let this_ = this;
+      console.log(values[0].id_, "id");
+      this_.$emit("input", values[0].id_); //传导
+    },
+  },
+  watch: {
+    "formInline.fang_jian_hao_value": function (newdata, olddata) {
+      //监控房间号 input 输入框数据变化 来改变区域和货架信息(input)
+      this.huo_jia_arr = [];
+      let sqlString = `select distinct qu_yu_ ,huo_jia_hao_ from t_mjypcfwz where fang_jian_lei_xin = '${newdata}' `;
+      var this_ = this;
+      curdPost("sql", sqlString).then((response) => {
+        this_.quyu_arr = response.variables.data.reverse();
+        this_.quyu_arr.forEach((item) => {
+          //待优化 事实上是一个用来判断
+          if (item.qu_yu_ == "") {
+            this_.leixingcare = false;
+            this_.formInline.qu_yu_value = "";
+            let sql = `select distinct huo_jia_hao_,huo_jia_lei_xing_ from t_mjypcfwz where fang_jian_lei_xin = '${newdata}'  order by huo_jia_hao_ asc`;
+            curdPost("sql", sql).then((res) => {
+              this_.huo_jia_arr = res.variables.data;
+            });
+            return;
+          } else {
+            this_.leixingcare = true;
+          }
+        });
+        if (!this.firstLoadActive) {
+          this_.formInline.qu_yu_value = "";
+        }
+      });
+    },
+    placeValue: function (newdata, olddata) {
+      if (newdata == "" || newdata == null) {
+        this.$emit("input", "");
+      }
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+p {
+  padding: 0;
+  margin: 0;
+}
+.sample-content {
+  width: 100%;
+  // position: fixed;
+  top: 50;
+  position: relative;
+  background: white;
+    .close{
+    position: fixed;
+    right: 52px;
+    top:20px;
+    color: red;
+    z-index: 999;
+    font-size: 45px;
+  }
+  .title{
+      width: 100%;
+     height: 14px;
+     line-height: 24px;
+     font-size: 24px;
+     text-align: center;
+    }
+  .selectPo {
+    cursor: pointer;
+    z-index: 9;
+  }
+  .top-content {
+    width: 100%;
+    .top-title {
+      text-align: center;
+      font-weight: bold;
+      width: 100%;
+      font-size: 18px;
+      line-height: 40px;
+    }
+    .query-content {
+      display: flex;
+      margin-left: 25px;
+    }
+  }
+  .viewArea {
+    position: fixed;
+    left: 0;
+    top: 0;
+    width: 100%;
+    background: white;
+    z-index: 99 !important;
+  }
+  .select_quyu {
+    .test-quyu,
+    .huojia {
+      width: 100%;
+      .list-items {
+        display: flex;
+        cursor: pointer;
+        .quyu-item {
+          background: #0099cc;
+        }
+        .huojia-item {
+          background: #99ccff;
+        }
+        .list-item {
+          padding: 0px 10px;
+          background-color: rgb(206, 198, 164);
+          text-align: center;
+          line-height: 35px;
+          margin-left: 20px;
+          border-radius: 10px;
+        }
+      }
+      .cangku-mingchen {
+        width: 100%;
+        text-align: left;
+        margin-left: 50px;
+      }
+    }
+  }
+
+  .body-content {
+    margin-bottom: 20px;
+    display: flex;
+    box-sizing: border-box;
+    height: 100vh;
+    overflow-x: hidden;
+    overflow-y: scroll;
+    // .left-table {
+    //   // width: 40%;
+    //   ::v-deep .el-table {
+    //     width: 40%;
+    //   }
+    // }
+    .right-view {
+      z-index: 99;
+      width: 100%;
+      .goods-items {
+        width: 100%;
+        border: solid 2px rgb(202, 236, 247);
+        display: flex;
+        flex-direction: column-reverse;
+        .show-demo {
+          width: 100%;
+          // border-bottom: 1px solid bisque;
+          //   margin: 0 auto;
+          text-align: center;
+
+          .goods-level {
+            display: flex;
+            position: relative;
+            margin-bottom: 6px;
+          }
+          .level-dsc {
+            margin-top: 12px;
+            position: absolute;
+            bottom: 0;
+            left: 10px;
+          }
+          .goods-list {
+            display: flex;
+            // justify-content: flex-start;
+            flex-wrap: wrap-reverse;
+            align-content: flex-start;
+            margin-left: 50px;
+            margin-right: 15px;
+            .goods-dsc {
+              cursor: pointer;
+              padding: 2px 6px;
+              border-radius: 5px;
+              background: #E6A23C;
+              margin-left: 12px;
+              margin-top: 6px;
+              // box-sizing: border-box;
+              .top-dsc {
+                display: flex;
+                justify-content: space-between;
+                font-size: 12px;
+                // height: 18px;
+                line-height: 18px;
+                .position {
+                  width: 160px;
+                  overflow: hidden;
+                }
+                .position > p {
+                  text-align: left;
+                  color: #fbe8ff;
+                }
+                .right-content {
+                  display: flex;
+                  align-items: center;
+                  p {
+                    height: 18px;
+                    line-height: 18px;
+                    margin-left: 5px;
+                    color: #fbe8ff;
+                    text-align: left;
+                  }
+                }
+              }
+              .bottom-dsc {
+                width: 100%;
+                text-align: center;
+                font-size: 18px;
+                height: 45px;
+                line-height: 45px;
+                margin-top: 9px;
+                color: #fbe8ff;
+              }
+              .goods-demo {
+                display: block;
+                width: 70px;
+                height: 90px;
+                border: 1px solid rgb(10, 9, 8);
+                text-align: center;
+                margin: 0;
+              }
+              .goods-code {
+                text-align: center;
+                width: 100%;
+                height: 20px;
+                line-height: 20px;
+              }
+            }
+          }
+          .goodshelf-name {
+            margin: 15px 0px;
+          }
+          .shelf {
+            width: 100%;
+            height: 40px;
+            line-height: 40px;
+            text-align: center;
+          }
+        }
+      }
+    }
+  }
+}
+</style>
+
+

+ 609 - 300
src/views/system/jbdScan/js/manualConfirmationJS.js

@@ -2,302 +2,592 @@ import repostCurd from '@/business/platform/form/utils/custom/joinCURD.js'
 
 export default {
   methods: {
-
-    facilityData() {
-      this.loadData()
+    facilityData(page) {
+      // this.loadData()
+      this.loadDataBySQL(page)
     },
     /* 获取数据 ,开始查阅记录 */
     loadData() {
-      // 扫码扫到新数据,查询 回填展示
-         repostCurd('select','{"tableName": "t_mjypdjb","paramWhere":{"jie_yang_zhuang_t":"待确认"}}').then(response => {
-          if (response.variables.data && response.variables.data.length > 0) {
-              for(let i in response.variables.data){
-                response.variables.data[i].jie_yang_shu_lian = 1
-                this.listData.push(response.variables.data[i])
-                this.OriginalPosition.push(response.variables.data[i].shi_fou_liu_yang_ == "是" ? response.variables.data[i].liu_yang_wei_zhi_ : response.variables.data[i].shou_yang_wei_zhi)
-              }
+      repostCurd('select', '{"tableName": "t_lhypb","paramWhere":{"jie_yang_zhuang_t":"待接收"}}').then(response => {
+        if (response.variables.data && response.variables.data.length > 0) {
+          for (let i in response.variables.data) {
+            response.variables.data[i].jie_yang_shu_lian = 1
+            this.listData.push(response.variables.data[i])
+            // this.OriginalPosition.push(response.variables.data[i].shi_fou_liu_yang_ == "是" ? response.variables.data[i].liu_yang_wei_zhi_ : response.variables.data[i].shou_yang_wei_zhi)
           }
-        })
+        }
+      })
+    },
+    loadDataBySQL(page) {
+      // 扫码扫到新数据,查询 并分页 回填展示
+      let countSQL = `select count(*) as count from t_lhypb where jie_yang_zhuang_t = '待接收'`
+      let str = (page-1)*10
+      let fysql = `select * from t_lhypb where jie_yang_zhuang_t = '待接收' limit ${str},10`
+      Promise.all([repostCurd('sql', countSQL), repostCurd('sql', fysql)]).then(([res1, res]) => {
+        this.listData = []
+        this.pageCount = res1.variables.data[0].count
+        if (res.variables.data && res.variables.data.length > 0) {
+          for (let i in res.variables.data) {
+            res.variables.data[i].jie_yang_shu_lian = 1
+            res.variables.data[i].jie_yang_zhuang_t = '未确认'
+            this.listData.push(res.variables.data[i])
+          }
+        }
+      })
     },
     /* 列表失去焦点*/
-    handleChange(){
-        this.$refs.redarInput.focus(); //聚焦input
+    handleChange() {
+      this.$refs.redarInput.focus(); //聚焦input
     },
     /* 关闭弹出列表框*/
     closeDialog() {
       this.remRedar()
       //回传关闭事件。隐藏当前组件。
     },
-    handleClose(){
+    handleClose() {
       this.handleChange()
       this.$confirm('确认关闭样品列表页面?').then(_ => {
-         this.closeDialog();
-      }).catch(_ => {
-      });
-      },
+        this.closeDialog();
+      }).catch(_ => {});
+    },
 
     submitData(type) {
       // this指针
       let this_ = this;
+      let changeWeiZhi;     // 此处俩字段作用在下面 选择货位时出现重复位置 而重新更新样品登记表 收样位置|留样位置
+      let changesyWeiZhi;
       // 回传关闭事件。隐藏当前组件。
       let judge = true;
 
-      if(this_.listData.length == 0){
-          this.$emit('callback',true)
-          this.visable = false
-          this.$message({
-            message:'暂无样品待接收确认!',
-            type:'error'
-          })
-          this.closeDialog();
-      }else{
+      if (this_.listData.length == 0) {
+        this.$emit('callback', true)
+        this.visable = false
+        this.$message({
+          message: '暂无样品待接收确认!',
+          type: 'error'
+        })
+        this.closeDialog();
+      } else {
         this.$confirm('请再次确认 [样品接收信息]').then(_ => {
-                // 获取样品列表
-                let ypInfoList = this_.listData
-
-                  let dWhere = []
-                  let ypbh = []
-                  let cfwzIdList = [] // 放置 存放位置的ID
-                  let uuidList = [] // 列表的UUID
-
-                  let ypIdList = []             // 样品id列表,格式转好的
-                  let ypWeiZhi = []             // 样品收样位置
-                  let ypLiuYangWeiZhi = []      // 样品留样位置
-                  let saoMaNumList = []         // 扫码确认数量列表
-                  let jieYangQueRenZTList = []  // 接样状态列表
-
-                  let ypbhList = []   // 样品编号列表
-                  let mjypbList = [] // 明鉴样品表
-                  let mjypbWJ = [] // 明鉴样品表外键
-
-                  for(let yp in ypInfoList){
-                    let cfwz = ''
-                    if(ypInfoList[yp].jie_yang_shu_lian > ypInfoList[yp].shou_yang_shu_lia){
-                       this_.$message.error('操作失败,['+ypInfoList[yp].yang_pin_ming_che+'] 接收确认数量不得大于收样数量。')
-                       return;
-                    }
-                    if(ypInfoList[yp].jie_yang_zhuang_t == '待确认'){
-                      this_.$message.error('操作失败,['+ypInfoList[yp].yang_pin_ming_che+'] 接收确认状态必须为已确认。')
-                      return;
-                    }
-                    if(ypInfoList[yp].shi_fou_liu_yang_ == "是"){
-                      if(ypInfoList[yp].liu_yang_wei_zhi_ == null || ypInfoList[yp].liu_yang_wei_zhi_ == ''){
-                        this_.$message.error("你要留样的话,存放位置不能为空哦!")
-                        return;
-                      }
-                      if(ypInfoList[yp].shou_yang_wei_zhi != undefined && ypInfoList[yp].shou_yang_wei_zhi != ''){
-                        this_.$message.error("你要留样的话,就不要选收样存放位置!")
-                        return;
-                      }
-                      let isLy = ypInfoList[yp].liu_yang_wei_zhi_
-                      if(isLy.substr(-2,isLy.length -1) == "占用" || isLy.substr(-2,isLy.length -1) == "空余"){
-                        let sql = "select `id` from MJ_yp_position_status where positionAndStatus = '" + isLy + "' limit 1"
-                         repostCurd('sql',sql).then(response=>{
-                           cfwz = response.variables.data[0].id
-                           ypInfoList[yp].liu_yang_wei_zhi_ = cfwz
-                           console.log('?question time')
-                         })
-                      }else{
-                        cfwz = ypInfoList[yp].liu_yang_wei_zhi_
-                      }
 
-                    }else{
-                      if(ypInfoList[yp].shou_yang_wei_zhi == null || ypInfoList[yp].shou_yang_wei_zhi == ''){
-                        this_.$message.error("你正常收样的话,样品存放位置不能为空哦!")
-                        return;
-                      }
-                      if(ypInfoList[yp].liu_yang_wei_zhi_ != undefined && ypInfoList[yp].liu_yang_wei_zhi_ != ''){
-                        this_.$message.error("你正常收样的话,就不要选择留样存放位置!")
-                        return;
-                      }
-                      let isZC = ypInfoList[yp].shou_yang_wei_zhi
-                      if(isZC.substr(-2,isZC.length -1) == "占用" || isZC.substr(-2,isZC.length -1) == "空余"){
-                        let sql = "select `id` from MJ_yp_position_status where positionAndStatus = '" + isZC + "' limit 1"
-                         repostCurd('sql',sql).then(response=>{
-                           cfwz = response.variables.data[0].id
-                           ypInfoList[yp].shou_yang_wei_zhi = cfwz
-                           console.log('?question time')
-                         })
-                      }else{
-                        cfwz = ypInfoList[yp].shou_yang_wei_zhi
-                      }
+          // 获取样品列表
+          let ypInfoList = this_.listData
+          // console.log(ypInfoList, "样品信息")
+
+          let dWhere = []
+          let ypbh = []
+          let cfwzIdList = [] // 放置 存放位置的ID
+          let uuidList = [] // 列表的UUID
+
+          // let ypIdList = [] // 样品id列表,格式转好的
+          // let ypWeiZhi = [] // 样品收样位置
+          // let ypLiuYangWeiZhi = [] // 样品留样位置
+          // let saoMaNumList = [] // 扫码确认数量列表
+          // let jieYangQueRenZTList = [] // 接样状态列表
+
+          let ypbhList = [] // 样品编号列表
+          // let mjypbList = [] // 明鉴样品表
+          // let mjypbWJ = [] // 明鉴样品表外键
+
+
+
+          // 罗湖样品编号列表
+          let lhypbhList = []
+          // 罗湖委托单列表
+          let lhwtsqbList = []
+          // 罗湖样品表列表
+          let lhypbList = []
+          // 罗湖样品表外键
+          let lhypbWJ = []
+          // 罗湖委托表主键
+          let lhwtbID = []
+          // 罗湖委托表展示表ID
+          let lhwtzsbID = []
+          // 罗湖样品id列表
+          let lhypIdList = []
+          // 罗湖样品id格式列表
+          let lhypIdNewList = []
+
+          for (let yp in ypInfoList) { //样品数据
+            let cfwz = ''
+            /*
+              校验:
+                1、样品数量 <=  确认数量
+                2、是否留样 => 填收样位置|留样位置
+                3、验收结果必填
+                4、如果留样 => 必填项:留样日期、留样数量、留样期限至、销毁日期
+            */
+            if (ypInfoList[yp].jie_yang_shu_lian > ypInfoList[yp].yang_pin_zong_shu) {
+              this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 接收确认数量不得大于收样数量。')
+              return;
+            }
+            if (ypInfoList[yp].jie_yang_zhuang_t == '未确认') {
+              this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 接收确认状态必须为已确认。')
+              return;
+            }
+            if (ypInfoList[yp].yan_shou_jie_guo_ == null || ypInfoList[yp].yan_shou_jie_guo_ == '') {
+              this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 验收结果不能为空!')
+              return;
+            }
+            if (ypInfoList[yp].shi_fou_liu_yang_ == null || ypInfoList[yp].shi_fou_liu_yang_ == '') {
+              this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 是否留样不能为空!')
+              return;
+            }
+
+            if (ypInfoList[yp].bao_gao_bian_zhi_ == undefined || ypInfoList[yp].bao_gao_bian_zhi_ == '') {
+              this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 报告编制员不能为空!')
+              return;
+            }
+            if (ypInfoList[yp].bao_gao_shen_he_y == undefined || ypInfoList[yp].bao_gao_shen_he_y == '') {
+              this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 报告审核员不能为空!')
+              return;
+            }
+
+            if (ypInfoList[yp].shi_fou_liu_yang_ == "是") {
+              if (ypInfoList[yp].liu_yang_wei_zhi_ == null || ypInfoList[yp].liu_yang_wei_zhi_ == '') {
+                this_.$message.error("你要留样的话,存放位置不能为空哦!")
+                return;
+              }
+              if (ypInfoList[yp].shou_yang_wei_zhi != undefined && ypInfoList[yp].shou_yang_wei_zhi != '') {
+                this_.$message.error("你要留样的话,就不要选收样存放位置!")
+                return;
+              }
+              if (ypInfoList[yp].liu_yang_ri_qi_ == null || ypInfoList[yp].liu_yang_ri_qi_ == '') {
+                this_.$message.error("留样时必须填写留样日期!")
+                return;
+              }
+              if (ypInfoList[yp].liu_yang_shu_lian == null || ypInfoList[yp].liu_yang_shu_lian == '') {
+                this_.$message.error("留样时必须填写留样数量!")
+                return;
+              }
+              if (ypInfoList[yp].liu_yang_shu_lian > ypInfoList[yp].yang_pin_zong_shu) {
+                this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 留样数量不得大于收样数量。')
+                return;
+              }
+              if (ypInfoList[yp].liu_yang_qi_xian == null || ypInfoList[yp].liu_yang_qi_xian == '') {
+                this_.$message.error("留样时必须填写留样期限!")
+                return;
+              }
+              if (ypInfoList[yp].xiao_hui_ri_qi_ == null || ypInfoList[yp].xiao_hui_ri_qi_ == '') {
+                this_.$message.error("留样时必须填写销毁日期!")
+                return;
+              }
+              // let isLy = ypInfoList[yp].liu_yang_wei_zhi_
+              // // console.log(isLy, "留样");
+              // if (isLy.substr(-2, isLy.length - 1) == "占用" || isLy.substr(-2, isLy.length - 1) == "空余") { //?
+              //   let sql = "select 'id' from MJ_yp_position_status where positionAndStatus = '" + isLy + "' limit 1"
+              //   repostCurd('sql', sql).then(response => {
+              //     cfwz = response.variables.data[0].id
+              //     ypInfoList[yp].liu_yang_wei_zhi_ = cfwz
+              //     // console.log(ypInfoList)
+              //     console.log('?question time留样')
+              //   })
+              // } else {
+                cfwz = ypInfoList[yp].liu_yang_wei_zhi_
+              // }
+
+            } else {
+              if (ypInfoList[yp].shou_yang_wei_zhi == null || ypInfoList[yp].shou_yang_wei_zhi == '') {
+                this_.$message.error("你正常收样的话,样品存放位置不能为空哦!")
+                return;
+              }
+              if (ypInfoList[yp].liu_yang_wei_zhi_ != undefined && ypInfoList[yp].liu_yang_wei_zhi_ != '') {
+                this_.$message.error("你正常收样的话,就不要选择留样存放位置!")
+                return;
+              }
+              // let isZC = ypInfoList[yp].shou_yang_wei_zhi
+              // if (isZC.substr(-2, isZC.length - 1) == "占用" || isZC.substr(-2, isZC.length - 1) == "空余") { //?
+              //   let sql1 = "select `id` from MJ_yp_position_status where positionAndStatus = '" + isZC + "' limit 1"
+              //   // console.log(sql1)
+              //   repostCurd('sql', sql1).then(response => {
+              //     // console.log(response.variables)
+              //     cfwz = response.variables.data[0].id
+              //     ypInfoList[yp].shou_yang_wei_zhi = cfwz //查询位置状态表 取值位置的id
+              //     console.log('?question time')
+              //   })
+              // } else {
+                cfwz = ypInfoList[yp].shou_yang_wei_zhi //取位置信息
+              // }
+            }
+            uuidList.push(ypInfoList[yp].biao_zhi_uuid_)
+            // ypIdList.push('{"id_":"' + ypInfoList[yp].id_ + '"}')
+            // ypWeiZhi.push(ypInfoList[yp].shou_yang_wei_zhi) // 收样存放位置
+            // ypLiuYangWeiZhi.push(ypInfoList[yp].liu_yang_wei_zhi_) // 留样存放位置
+            // saoMaNumList.push(ypInfoList[yp].jie_yang_shu_lian) // 扫码数量
+            // jieYangQueRenZTList.push(ypInfoList[yp].jie_yang_zhuang_t) // 接收确认状态
+            ypbhList.push('{"yang_pin_bian_hao":"' + ypInfoList[yp].yang_pin_bian_hao + '"}') // 样品编号列表
+
+
+            // 罗湖
+            // lhypbhList.push('{"yang_pin_bian_hao":"' + ypInfoList[yp].yang_pin_bian_hao + '"}')
+            // lhypbWJ.push('{"id_":"' + ypInfoList[yp].parent_id_ + '"}')
+            dWhere.push('{"id_":"' + cfwz + '"}')
+            cfwzIdList.push(cfwz)
+            lhypbhList.push( ypInfoList[yp].yang_pin_bian_hao )
+            lhypbWJ.push( ypInfoList[yp].parent_id_ )
+            lhypIdList.push( ypInfoList[yp].id_ )
+            lhypIdNewList.push('{"id_":"' + ypInfoList[yp].id_ + '"}')
+
+            ypbh.push(ypInfoList[yp].yang_pin_bian_hao)
+          }
+
+        /*
+          封装好样品登记表对象,add 样品登记表
+        */
+         let value = ''
+         let lhypIdStr = ''
+         console.log('lhypbWJ :',lhypbWJ)
+         console.log('lhypIdList :',lhypIdList)
+         for(let i =0;i<lhypbWJ.length; i++){
+           value += lhypbWJ[i] + ','
+         }
+         value = value.substring(0,value.length-1)
+         value = value.replace(/,/g,"','")
+         console.log('value :',value)
+         for(let i = 0; i<lhypIdList.length;i++){
+           lhypIdStr += lhypIdList[i] + ','
+         }
+         lhypIdStr = lhypIdStr.substring(0,lhypIdStr.length-1)
+         lhypIdStr = lhypIdStr.replace(/,/g,"','")
+
+         console.log('lhypIdStr :',lhypIdStr)
+         let wtdAndYpb = []
+        // a.bao_gao_bian_zhi_,a.bao_gao_fu_he_yua,
+         let allSQL = `select a.id_ as wtID,a.zhan_shi_biao_id_,a.wei_tuo_lei_xing_,a.he_tong_id_,a.bao_gao_lei_xing_,a.wei_tuo_bian_hao_, a.wei_tuo_dan_wei_, a.wei_tuo_fang_lian, a.wei_tuo_lian,a.bao_gao_bian_zhi_,a.bao_gao_fu_he_yua,b.* from t_lhwtsqb a inner join t_lhypb b on a.id_ = b.parent_id_ where b.parent_id_ in ('${value}')and b.id_ in ('${lhypIdStr}')`
+          // console.log(allSQL)
+          repostCurd('sql', allSQL).then(res1 => {
+              /* 封装样品登记表对象  */
+              let ypdjb = []
+              let res = res1.variables.data
+              console.log('res ! ',res)
+              // wtdAndYpb.push(res)
+              wtdAndYpb = res
+
+              for(let i = 0; i<res.length; i++){
+              lhwtbID.push('{"id_":"' + res[i].wtID + '"}')
+              lhwtzsbID.push('{"shen_qing_id_":"' + res[i].zhan_shi_biao_id_ + '"}')
+                  let count = 0;
+                  if(res[i].yang_pin_lei_xing != ''  && res[i].yang_pin_lei_xing != undefined){
+                    count = 1;
+                    if(res[i].yang_pin_lei_er_ != ''  && res[i].yang_pin_lei_er_ != undefined){
+                       count = 2;
+                       if(res[i].yang_pin_lei_san_ != ''  && res[i].yang_pin_lei_san_ != undefined){
+                         count = 3;
+                         if(res[i].yang_pin_lei_si_ != ''  && res[i].yang_pin_lei_si_ != undefined){
+                           count = 4;
+                         }
+                       }
                     }
-                    dWhere.push('{"id_":"' + cfwz + '"}')
-                    ypbh.push(ypInfoList[yp].yang_pin_bian_hao)
-                    uuidList.push(ypInfoList[yp].biao_zhi_uuid_)
-                    cfwzIdList.push(cfwz)
-
-                    ypIdList.push('{"id_":"' + ypInfoList[yp].id_ + '"}')
-                    ypWeiZhi.push(ypInfoList[yp].shou_yang_wei_zhi)		            // 收样存放位置
-                    ypLiuYangWeiZhi.push(ypInfoList[yp].liu_yang_wei_zhi_)	      // 留样存放位置
-                    saoMaNumList.push(ypInfoList[yp].jie_yang_shu_lian)           // 扫码数量
-                    jieYangQueRenZTList.push(ypInfoList[yp].jie_yang_zhuang_t)    // 接收确认状态
-
-                    ypbhList.push('{"yang_pin_bian_hao":"' + ypInfoList[yp].yang_pin_bian_hao + '"}') // 样品编号列表
-                  }
-                    for(let index in ypIdList){
-                      let WZtem = ypWeiZhi[index]==null?'':ypWeiZhi[index]
-                      let LYWZtem = ypLiuYangWeiZhi[index]==null?'':ypLiuYangWeiZhi[index]
-                      repostCurd('update','{"tableName":"t_mjypdjb","paramWhere":'+ypIdList[index]+',"paramCond":'+'{"shou_yang_wei_zhi":"'+WZtem+'","jie_yang_shu_lian":"'+saoMaNumList[index]+'","jie_yang_zhuang_t":"'+jieYangQueRenZTList[index]+'","liu_yang_wei_zhi_":"'+ LYWZtem + '"}}')
                   }
-                  for(let num in dWhere){
-                    if(this.OriginalPosition[num] != cfwzIdList[num]){
-                      let sql = "select * from t_mjypcfwz where id_ = '" + cfwzIdList[num] + "'"
-                      repostCurd('sql',sql).then(response=>{
-                          let resArr = response.variables.data
-                          if(resArr.length == 1){
-                              if(resArr[0].wei_zhi_zhuang_ta == "空余"){
-                               repostCurd('update','{"tableName":"t_mjypcfwz","paramWhere":'+dWhere[num]+',"paramCond":'+'{"wei_zhi_zhuang_ta":"占用","yang_pin_bian_hao":"'+ ypbh[num] + '","ru_ku_shi_jian_":"'+ this_.dateFormat() + '","shou_yang_ri_qi_":"'+ uuidList[num] + '"}}')
-                              }else if(resArr[0].wei_zhi_zhuang_ta == "占用"){
-                                // 新增一条新的位置记录,使用旧的位置记录 修改它的样品编号,入库时间,标识UUID
-                                      let cfNewList = []
-                                      let cfNew = {}
-                                      cfNew["fang_jian_lei_xin"] = resArr[0].fang_jian_lei_xin
-                                      cfNew["huo_jia_lei_xing_"] = resArr[0].huo_jia_lei_xing_
-                                      cfNew["huo_jia_hao_"] = resArr[0].huo_jia_hao_
-                                      cfNew["qu_yu_"] = resArr[0].qu_yu_
-                                      cfNew["gua_jia_hao_"] = resArr[0].gua_jia_hao_
-                                      cfNew["ceng_hao_"] = resArr[0].ceng_hao_
-                                      cfNew["wei_zhi_bian_hao_"] = resArr[0].wei_zhi_bian_hao_
-                                      cfNew["wei_zhi_zhuang_ta"] = resArr[0].wei_zhi_zhuang_ta
-                                      cfNew["cun_fang_lei_xing"] = resArr[0].cun_fang_lei_xing
-                                      cfNew["cun_chu_tiao_jian"] = resArr[0].cun_chu_tiao_jian
-                                      cfNew["yang_pin_bian_hao"] = ypbh[num]
-                                      cfNew["ru_ku_shi_jian_"] = this_.dateFormat()
-                                      cfNew["shou_yang_ri_qi_"] = uuidList[num]
-                                      cfNewList.push(cfNew)
-                                    repostCurd('add','{"tableName":"t_mjypcfwz","paramWhere":'+JSON.stringify(cfNewList)+'}')
-                              }
-                          }
-                      })
-                    }
+                  for(let x = 0; x<count;x++){
+                    let obj = {}
+                    obj["wei_tuo_dan_hao_"] = res[i].wei_tuo_bian_hao_
+                    obj["wei_tuo_dan_wei_"] = res[i].wei_tuo_dan_wei_
+                    obj["lian_xi_ren_"]     = res[i].wei_tuo_fang_lian
+                    obj["lian_xi_dian_hua_"] = res[i].wei_tuo_lian
+
+                    obj["yang_ben_ming_che"]  = res[i].yang_pin_ming_che
+                    obj["yang_ben_bian_hao"]  = res[i].yang_pin_bian_hao
+                    obj["pi_hao_bian_hao_"]   = res[i].song_jian_pi_hao_
+                    obj["xing_ming_"]         = res[i].xing_ming_
+                    obj["xing_bie_"]          = res[i].xing_bie_
+                    obj["nian_ling_"]         = res[i].nian_ling_
+                    obj["yang_ben_zhuang_t"]  = res[i].yang_pin_zhuang_t
+                    obj["shou_yang_ri_qi_"]   = this_.dateFormat()
+                    obj["bei_zhu_"]           = res[i].bei_zhu_
 
+                    obj["yang_ben_lei_xing"] =    x==0? res[i].yang_pin_lei_xing : x==1? res[i].yang_pin_lei_er_ : x==2? res[i].yang_pin_lei_san_ : x==3? res[i].yang_pin_lei_si_ :''
+                    obj["yun_shu_tiao_jian"] =    x==0? res[i].yang_ben_yun_shu_ : x==1? res[i].yang_pin_yun_shu_ : x==2? res[i].yang_pin_yun_san : x==3? res[i].yang_pin_yun_si_ :''
+                    obj["yang_pin_shu_lian"] =    x==0? res[i].shu_liang_ : x==1? res[i].shu_liang_er_ : x==2? res[i].shu_liang_san_ : x==3? res[i].shu_liang_si_ :''
+                    obj["yang_ben_gui_ge_s"] =    x==0? res[i].yang_pin_gui_ge_ : x==1? res[i].yang_pin_gui_ge_e : x==2? res[i].yang_pin_gui_ge_s : x==3? res[i].yang_pin_gui_si_ :''
+                    // console.log('nnd ',ypInfoList[i])
+                    obj["yan_shou_jie_guo_"] =      ypInfoList[i].yan_shou_jie_guo_
+                    obj["cun_fang_wei_zhi_"] =       ypInfoList[i].shou_yang_wei_zhi
+                    obj["liu_zhuan_zhuang_"] =       '待检'
+                    obj["shi_fou_liu_yang_"] =       ypInfoList[i].shi_fou_liu_yang_
+                    // obj["shou_yang_ren_"] =          ypInfoList[i].
+                    // obj["jiao_yang_ri_qi_"] =        ypInfoList[i].
+                    // obj["jiao_yang_jyr"] =           ypInfoList[i].
+                    // obj["jiao_yang_shu_lia"] =       ypInfoList[i].
+                    obj["liu_yang_ri_qi_"] =         ypInfoList[i].liu_yang_ri_qi_
+                    obj["liu_yang_cun_fang"]  =      ypInfoList[i].liu_yang_cun_fang
+                    obj["liu_yang_shu_lian"]  =      ypInfoList[i].liu_yang_shu_lian
+                    obj["liu_yang_qi_xian"]   =        ypInfoList[i].liu_yang_qi_xian
+                    obj["xiao_hui_ri_qi_"]    =         ypInfoList[i].xiao_hui_ri_qi_
+                    obj["fan_yang_ri_qi_"]    =         ypInfoList[i].fan_yang_ri_qi_
+                    obj["fan_yang_jyr"]       =       ypInfoList[i].fan_yang_jyr
+                    changeWeiZhi = ypInfoList[i].shou_yang_wei_zhi ==''?'':ypInfoList[i].shou_yang_wei_zhi
+                    changesyWeiZhi = ypInfoList[i].liu_yang_cun_fang ==''?'':ypInfoList[i].liu_yang_cun_fang
+                    ypdjb.push(obj)
                   }
-                   repostCurd('selects','{"tableName":"t_mjypb","paramWhere":['+ypbhList+']}').then(response=>{
-                     mjypbList = response.variables.data
-                     let wjList = []
-                     let wjAll  = []
-                     let wjAllList = []
-                     for(let i in mjypbList){
-                        wjList.push(mjypbList[i].wai_jian_)
-                        wjAll.push(mjypbList[i].wai_jian_)
-                     }
-                     wjList = this_.unique(wjList)
-                     for(let i in wjList){
-                        mjypbWJ.push('{"id_":"' + wjList[i]+ '"}')
-                     }
-                     for(let i in wjAll){
-                        wjAllList.push('{"id_":"' + wjAll[i]+ '"}')
-                     }
-                        repostCurd('updates','{"tableName":"t_mjwtsqb","paramWhere":['+mjypbWJ+'],"paramCond":{"zhuang_tai_":"委托结束"}}')
-                       let mjwtsqbAllResult = []
-                       let mjwtsqbIdList = []
-                       let mjfbbList = []
-                       let mjfbbWJList = []
-                       // console.log('wjAllList',wjAllList)
-                      for(let i in wjAllList){
-                        repostCurd('select','{"tableName":"t_mjwtsqb","paramWhere":'+wjAllList[i]+'}').then(response=>{
-                               mjfbbWJList.push('{"wei_tuo_wai_jian_":"' + response.variables.data[0].id_ + '"}')
-                               mjwtsqbAllResult.push(response.variables.data[0])
-                               mjwtsqbIdList.push('{"id_":"' + response.variables.data[0].id_ + '"}')
-                               // console.log('fbb=>',i,mjfbbWJList[i])
-                              // repostCurd('select','{"tableName":"t_mjfbb","paramWhere":'+mjfbbWJList[i]+'}').then(response=>{
-                              //                  console.log(response.variables)
-                              //                       mjfbbList.push(response.variables.data)
-                              //                    })
-                              })
+              }
+              // console.log('进入样品登记表...',ypdjb)
+              repostCurd('add', '{"tableName":"t_lhypdjb","paramWhere":' + JSON.stringify(ypdjb) + '}')
+              repostCurd('updates', '{"tableName":"t_lhypb","paramWhere":[' + lhypIdNewList + '],"paramCond":{"jie_yang_zhuang_t":"已接收"}}')
+
+              console.log('接下来样品列表:',ypInfoList)
+              console.log('委托单:',res)
+              /*
+                更新委托单 如果本来没值,就更新 报告编制人和 报告审核员 否则更新
+                委托单数组 和 样品数组 数量相同,遍历两者 判断委托单是否有编制人,审核员?
+                如果没有,则记录下委托单ID,以及同索引下的样品表的编制人和审核员
+              */
+              // let finalWtdIdList = []
+              for(var index = 0; index < ypInfoList.length; index++){
+                if(res[index].bao_gao_bian_zhi_  == '' || res[index].bao_gao_fu_he_yua  == ''){
+                  // console.log('{"id_":"' + res[index].id_ + '"}')
+                  // console.log(ypInfoList[index].bao_gao_bian_zhi_)
+                  // console.log(ypInfoList[index].bao_gao_shen_he_y)
+                 repostCurd('update','{"tableName":"t_lhwtsqb","paramWhere":' + '{"id_":"' + res[index].wtID + '"}' + ',"paramCond":' + '{"bao_gao_bian_zhi_":"'+ypInfoList[index].bao_gao_bian_zhi_+'","bao_gao_fu_he_yua":"' +  ypInfoList[index].bao_gao_shen_he_y + '"}}')
+              }
+            }
+              /*
+              let wtdSQL = "select id_,bao_gao_bian_zhi_,bao_gao_fu_he_yua from t_lhwtsqb where id_ in('" + value + "')"
+
+               repostCurd('sql', wtdSQL).then(response => {
+                   let result = response.variables.data
+                   console.log(result)
+                   for(var i in result){
+                      if(result[i].bao_gao_bian_zhi_ == '' || result[i].bao_gao_bian_zhi_ == undefined){
+                        finalWtdIdList.push(result[i])
                       }
-                setTimeout(()=>{
-                  let narr = []
-                  for(let a of mjfbbWJList){
-                    narr.push(a)
-                  }
-                  repostCurd('selects','{"tableName":"t_mjfbb","paramWhere":['+narr+']}').then(response=>{
-                                   console.log(response.variables)
-                                        mjfbbList.push(response.variables.data)
-                                     })
-                }, 1000)
-
-                   setTimeout(()=>{
-
-                    // let mjfbbArray = []
-                    // for(let a in mjfbbList){
-                    //   for(let b in mjfbbList[a]){
-                    //     mjfbbArray.push(mjfbbList[a][b])
-                    //   }
-                    // }
-                    // console.log('mjfbbArray',mjfbbArray)
-
-                    // console.log('mjfbbList',mjfbbList)
-                    // console.log('mjypbList',mjypbList)
-                     let rwb = []
-                     let index = 0
-                     if(mjypbList != null && mjypbList.length >= 1){
-                       index = mjypbList[0].jian_ce_xiang_mu2.split(",").length - 1
-                     }
-                     for(var i in mjypbList){
-                      let str =  mjypbList[i].jian_ce_xiang_mu2.split(",")
-                      // index += str.length-1
-                        for(var p in str){
-                          // console.log('坐标',i,p)
-                          let temp = index - p
-                        let rwzb = {}
-                          let wz_ = ypInfoList[i].shi_fou_liu_yang_ == "是" ? ypInfoList[i].liu_yang_wei_zhi_ : ypInfoList[i].shou_yang_wei_zhi   	  //	对应的样品存放位置
-                          rwzb["jian_ce_xiang_mu_"] = str[p] 			  	                //	取当前检测项目
-                          rwzb["yang_pin_bian_hao"] = mjypbList[i].yang_pin_bian_hao 	//	取对应的样品编号
-                          rwzb["yang_pin_ming_che"] = mjypbList[i].yang_pin_ming_che   //	对应的样品名称
-                          rwzb["yang_pin_dai_ci_"] = mjypbList[i].dai_ci_   			      //	对应的样品代次
-                          rwzb["yang_pin_pi_hao_"] = mjypbList[i].pi_hao_   			      //	对应的样品批号
-                          rwzb["yang_pin_shu_lian"] = mjypbList[i].shu_liang_   		    //	对应的样品数量
-                          rwzb["bug_ri_qi_"] = mjypbList[i].song_yang_ri_qi_   	      //  对应的送样日期
-                          rwzb["cun_fang_wei_zhi_"] = wz_
-                          rwzb["wei_tuo_wai_jian_"] = mjypbList[i].wai_jian_ 			    //	检测申请单id
-                          rwzb["he_tong_wai_jian_"] = mjwtsqbAllResult[i].he_tong_bian_hao_    //合同id
-                          rwzb["song_yang_ri_qi_"] = mjypbList[i].biao_zhi_uuid_       // 收样日期
-                          rwzb["wei_tuo_ren_"] =   mjwtsqbAllResult[i].lian_xi_ren_  // 委托人
-                          rwzb["bao_gao_jian_ce_s"] =  this_.dateFormat()   // 检测时间
-                          rwzb["zhan_shi_biao_wai"] = mjwtsqbAllResult[i].ye_mian_zong_zhua
-                          rwzb["zhuang_tai_"] = "任务待分配"			//	状态
-                          rwzb["shi_fou_fen_bao_"] = mjfbbList[0][temp].shi_fou_fen_bao_			// 是否分包
-                          rwzb["qi_wang_wan_cheng"] = mjfbbList[0][temp].wan_cheng_shi_jia 			// 期望完成时间
-                          rwb.push(rwzb)
+                   }
+                   console.log('finalWtdIdList',finalWtdIdList)
+               }) */
+
+
+             /*
+                 3、任务分配     【2022/11/23 取消 直接 批量开检测子流程】
+                 3-1、根据 wtdAndYpb 的 wtID 更改委托表的 委托状态 wei_tuo_zhuang_ta 变成 已完成
+                 3-2、根据每个样品对应的检测项目,开启一个或多个任务 / 遍历样品表开任务分配流程,一个样品可能对应多个检测
+                 3-3、委托表找zhan_shi_biao_id_ 修改  t_lhwtzsb "zhuang_tai_"为"任务分配进行中"
+
+               // console.log('委托单及样品信息',wtdAndYpb)
+               // console.log('委托单id列表 ',lhwtbID)
+               // console.log('展示表id列表 ',lhwtzsbID)
+
+               repostCurd('updates', '{"tableName":"t_lhwtsqb","paramWhere":[' + lhwtbID + '],"paramCond":{"wei_tuo_zhuang_ta":"已完成"}}')
+
+               let rws = []
+              if(wtdAndYpb.length>0){
+                 for(var i in wtdAndYpb){
+                   let strs = wtdAndYpb[i].jian_ce_xiang_mu_.split(',')
+                       for(var l in strs){
+                        let rw = {}
+                         rw["ren_wu_ming_cheng"] = strs[l] //检测项目
+                         rw["yang_pin_ming_che"] = wtdAndYpb[i].yang_pin_ming_che//样品名称
+                         rw["yang_pin_bian_hao"] = wtdAndYpb[i].yang_pin_bian_hao//样品编号
+                         rw["wei_tuo_lei_xing_"] = wtdAndYpb[i].wei_tuo_lei_xing_ //委托类型
+                         let yplxz = ''
+                         if(wtdAndYpb[i].yang_pin_lei_xing != null && wtdAndYpb[i].yang_pin_lei_xing!=''){ //样品类型1
+                            yplxz = wtdAndYpb[i].yang_pin_lei_xing //样品类型
+                         }
+                         if(wtdAndYpb[i].yang_pin_lei_er_ != null && wtdAndYpb[i].yang_pin_lei_er_!=''){ //样品类型2
+                           if(yplxz==null || yplxz == ''){
+                             yplxz = wtdAndYpb[i].yang_pin_lei_er_ //样品类型
+                           }else{
+                             yplxz =yplxz+','+ wtdAndYpb[i].yang_pin_lei_er_ //样品类型
+                           }
+                         }
+                         if(wtdAndYpb[i].yang_pin_lei_san_ != null && wtdAndYpb[i].yang_pin_lei_san_!=''){ //样品类型3
+                           if(yplxz==null || yplxz == ''){
+                             yplxz = wtdAndYpb[i].yang_pin_lei_san_ //样品类型
+                           }else{
+                             yplxz =yplxz+','+ wtdAndYpb[i].yang_pin_lei_san_ //样品类型
+                           }
+                         }
+                         if(wtdAndYpb[i].yang_pin_lei_si_ != null && wtdAndYpb[i].yang_pin_lei_si_!=''){ //样品类型4
+                           if(yplxz==null || yplxz == ''){
+                             yplxz = wtdAndYpb[i].yang_pin_lei_si_ //样品类型
+                           }else{
+                             yplxz = yplxz+','+ wtdAndYpb[i].yang_pin_lei_si_ //样品类型
+                           }
+                         }
+                         rw["yang_pin_lei_xing"] = yplxz //样品类型
+                         rw["wei_tuo_id_"] = wtdAndYpb[i].wtID  //委托id
+                         rw["he_tong_id_"] = wtdAndYpb[i].he_tong_id_ //合同id
+                         rw["zhuang_tai_"] = '待任务分配'//状态
+                         rw["wan_cheng_shi_jia"] = wtdAndYpb[i].song_jian_shi_jia  //送检日期
+                         rw["bao_gao_bian_zhi_"] = ypInfoList[i].bao_gao_bian_zhi_  //报告编制人
+                         rw["bao_gao_shen_he_y"] = ypInfoList[i].bao_gao_shen_he_y  //报告审核人
+                         rw["bao_gao_lei_xing_"] = wtdAndYpb[i].bao_gao_lei_xing_  //报告类型
+                         rw["xin_xiang_mu_ming"] = wtdAndYpb[i].xiang_mu_ming_che   //项目名称
+                         rw["zhan_shi_biao_id_"] = wtdAndYpb[i].zhan_shi_biao_id_  //展示表id
+                         rws.push(rw)
                         }
-                        index += str.length
-                     }
-                     // console.log('任务表:',rwb)
-
-                     repostCurd('updates', '{"tableName":"t_mjwtsqb","paramWhere":['+mjwtsqbIdList+'],"paramCond":{"jian_ce_kai_shi_s":"' + this_.dateFormat() + '"}}')
-                     let uidList = []
-                     for(let item of mjwtsqbAllResult){
-                       uidList.push(item.ye_mian_zong_zhua)
-                     }
-                     uidList = this_.unique(uidList)
-                     repostCurd('add', '{"tableName":"t_rwfpb","paramWhere":'+JSON.stringify(rwb)+',"defKey":"Process_04tgh24","formKey":"mjrwfp"}' )
-                       if(uidList.length > 0 ){
-                         let ups = []
-                         for(let t of uidList){
-                           ups.push('{"shen_qing_id_":"'+t+'"}')
+                  }
+                   // console.log("任务分配",rws)
+                 repostCurd('add', '{"tableName":"t_lhrwfpb","paramWhere":'+JSON.stringify(rws)+',"defKey":"Process_04o0csc","formKey":"lhrwfp"}')
+                }
+                // 更新委托单 检测开始时间   问吴懿是否需要
+                //repostCurd('updates', '{"tableName":"t_lhwtsqb","paramWhere":[' + lhwtbID + '],"paramCond":{"jian_ce_kai_shi_s":"' + this_.dateFormat() + '"}}')
+
+                //更新展示表
+                if(lhwtzsbID.length > 0){
+                  repostCurd('updates', '{"tableName":"t_lhwtzsb","paramWhere":['+lhwtzsbID+'],"paramCond":{"zhuang_tai_":"任务分配进行中"}}')
+                }
+                */
+
+               /*
+                3、【任务分配2022/11/23 取消 直接 批量开检测子流程】
+                 3-1、根据 wtdAndYpb 的 wtID 更改委托表的 委托状态 wei_tuo_zhuang_ta 变成 已完成
+                 3-2、根据每个样品对应的检测项目,开启一个或多个任务 / 遍历样品表开检测子流程,一个样品可能对应多个检测
+                 3-3、委托表找zhan_shi_biao_id_ 修改  t_lhwtzsb "zhuang_tai_"为"待环境监控"
+               */
+              
+               let fbbIndex = 0;
+               repostCurd('updates', '{"tableName":"t_lhwtsqb","paramWhere":[' + lhwtbID + '],"paramCond":{"wei_tuo_zhuang_ta":"已完成"}}')
+               if(wtdAndYpb.length>0){
+                  for(var i in wtdAndYpb){
+                    let strs = wtdAndYpb[i].jian_ce_xiang_mu_.split(',')
+                        for(var l in strs){
+                          // 循坏一次 分包表索引+1
+                          let jcxm = strs[l]
+                          if(jcxm != null && jcxm != ''){
+                                let sqljc = "select * from t_mjjcnlfw where id_ = '"+ jcxm +"'"
+                                 repostCurd('sql',sqljc).then(response => {
+                                   let contjc = response.variables.data
+                                   if(contjc.length>0){
+                                      let zhu  = []
+                                      let zhus = {}
+                                      // 罗湖
+                                      let yplxz = ''
+                                      if(wtdAndYpb[i].yang_pin_lei_xing != null && wtdAndYpb[i].yang_pin_lei_xing!=''){ //样品类型1
+                                         yplxz = wtdAndYpb[i].yang_pin_lei_xing //样品类型
+                                      }
+                                      if(wtdAndYpb[i].yang_pin_lei_er_ != null && wtdAndYpb[i].yang_pin_lei_er_!=''){ //样品类型2
+                                        if(yplxz==null || yplxz == ''){
+                                          yplxz = wtdAndYpb[i].yang_pin_lei_er_ // 样品类型
+                                        }else{
+                                          yplxz =yplxz+','+ wtdAndYpb[i].yang_pin_lei_er_ //样品类型
+                                        }
+                                      }
+                                      if(wtdAndYpb[i].yang_pin_lei_san_ != null && wtdAndYpb[i].yang_pin_lei_san_!=''){ //样品类型3
+                                        if(yplxz==null || yplxz == ''){
+                                          yplxz = wtdAndYpb[i].yang_pin_lei_san_ //样品类型
+                                        }else{
+                                          yplxz =yplxz+','+ wtdAndYpb[i].yang_pin_lei_san_ //样品类型
+                                        }
+                                      }
+                                      if(wtdAndYpb[i].yang_pin_lei_si_ != null && wtdAndYpb[i].yang_pin_lei_si_!=''){ //样品类型4
+                                        if(yplxz==null || yplxz == ''){
+                                          yplxz = wtdAndYpb[i].yang_pin_lei_si_ //样品类型
+                                        }else{
+                                          yplxz = yplxz+','+ wtdAndYpb[i].yang_pin_lei_si_ //样品类型
+                                        }
+                                      }
+
+                                      zhus["jian_ce_yuan_"] =    //检测员
+                                      zhus["fu_he_yuan_"] =   //校验员
+                                      zhus["yang_pin_ming_che"] = wtdAndYpb[i].yang_pin_ming_che   // 样品名称
+                                      zhus["yang_pin_bian_hao"] = wtdAndYpb[i].yang_pin_bian_hao   // 样品编号
+                                      zhus["jian_ce_xiang_mu_"] = jcxm                             // 任务名称
+                                      zhus["wei_tuo_id_"]       = wtdAndYpb[i].wtID                // 委托id
+                                      zhus["he_tong_id_"]       = wtdAndYpb[i].he_tong_id_         // 合同id
+                                      zhus["bao_gao_bian_zhi_"] = ypInfoList[i].bao_gao_bian_zhi_  // 报告编制员
+                                      zhus["bao_gao_fu_he_yua"] = ypInfoList[i].bao_gao_shen_he_y  // 报告审核员
+                                      zhus["wei_tuo_lei_xing_"] = wtdAndYpb[i].wei_tuo_lei_xing_   // 委托类型
+                                      zhus["yang_pin_lei_xing"] = yplxz                            // 样品类型
+                                      zhus["xin_xiang_mu_ming"] = wtdAndYpb[i].xiang_mu_ming_che   // 新项目名称
+                                      zhus["wan_cheng_shi_jia"] = wtdAndYpb[i].song_jian_shi_jia   // 送检日期
+                                      zhus["zhuang_tai_"] = '待环境监控'
+                                      zhus["zhan_shi_biao_id_"] = wtdAndYpb[i].zhan_shi_biao_id_   // 展示表id
+                                      zhu.push(zhus)
+                                      //根据检测项目查出对应检测项目的actitve的key 以及formKey  拼接参数开启流程
+                                      repostCurd('add', '{"tableName":"t_lhjczb","paramWhere":'+JSON.stringify(zhu)+',"defKey":"'+contjc[0].defkey_+'","formKey":"'+contjc[0].formkey_+'"}')
+                                   }
+                               	 })
+                              }
+
+                            fbbIndex ++;
                          }
-                         repostCurd('updates', '{"tableName":"t_mjwtzsb","paramWhere":['+ups+'],"paramCond":{"zhuang_tai_":"任务分配进行中"}}')
-                       }/**/
-                   },5000)
-                   })
-                        this.$emit('callback',true)
-                        this.visable = false
-                        this.$message({
-                          message:'样品接收确认操作成功!',
-                          type:'success'
-                        })
-                        this.closeDialog();
-                        }).catch(_ => {});
+                   }
+                 }
+
+
+
+              //更新展示表
+              if(lhwtzsbID.length > 0){
+                repostCurd('updates', '{"tableName":"t_lhwtzsb","paramWhere":['+lhwtzsbID+'],"paramCond":{"zhuang_tai_":"检测进行中"}}')
+              }
+
+          })
+
+          // console.log('dWhere : ',dWhere)
+
+          /* 2、更新货架位置信息(位置状态、样品编号、入库时间)如果是重复位置,则新增一条位置记录,并增加对应UUID  */
+          for (let num in dWhere) {
+              let sql = "select * from t_ypcfwz where id_ = '" + cfwzIdList[num] + "'"
+              repostCurd('sql', sql).then(response => {
+                let resArr = response.variables.data
+                if (resArr.length == 1) {
+                  if (resArr[0].wei_zhi_zhuang_ta == "空余") {
+                    repostCurd('update', '{"tableName":"t_ypcfwz","paramWhere":' + dWhere[num] + ',"paramCond":' + '{"wei_zhi_zhuang_ta":"占用","yang_pin_bian_hao":"' + ypbh[num] +'","ru_ku_shi_jian_":"' + this_.dateFormat() + '"}}').then(res => {
+                      console.log("原本位置为空余 ,新位置更新成功")
+                    })
+                  } else if (resArr[0].wei_zhi_zhuang_ta == "占用") {
+                    // 新增一条新的位置记录,使用旧的位置记录 修改它的样品编号,入库时间,标识UUID
+                    let cfNewList = []
+                    let cfNew = {}
+                    cfNew["fang_jian_lei_xin"] = resArr[0].fang_jian_lei_xin
+                    cfNew["wei_zhi_"] = resArr[0].wei_zhi_
+                    cfNew["qu_yu_"] = resArr[0].qu_yu_
+                    cfNew["huo_jia_lei_xing_"] = resArr[0].huo_jia_lei_xing_
+                    cfNew["huo_jia_hao_"] = resArr[0].huo_jia_hao_
+                    cfNew["ceng_hao_"] = resArr[0].ceng_hao_
+                    cfNew["shui_ping_fen_qu_"] = resArr[0].shui_ping_fen_qu_
+                    cfNew["wei_zhi_bian_hao_"] = resArr[0].wei_zhi_bian_hao_
+                    cfNew["wei_zhi_zhuang_ta"] = resArr[0].wei_zhi_zhuang_ta
+                    cfNew["cun_chu_tiao_jian"] = resArr[0].cun_chu_tiao_jian
+                    cfNew["yang_pin_bian_hao"] = ypbh[num]
+                    // cfNew["yang_pin_bian_hao"] = lhypIdList[num]
+                    cfNew["ru_ku_shi_jian_"] = this_.dateFormat()
+                    cfNew["biao_zhi_uuid_"] = this_.uuid()
+                    cfNewList.push(cfNew)
+                    let uuid = cfNew["biao_zhi_uuid_"];
+                    console.log('原本位置为占用 ,新位置插入成功')
+
+                    repostCurd('add', '{"tableName":"t_ypcfwz","paramWhere":' + JSON.stringify(cfNewList) + '}').then(res => {
+                      let selectsql = "select id_ from t_ypcfwz where biao_zhi_uuid_='" + uuid + "'";
+                      repostCurd('sql', selectsql).then(res => {
+                        let dataid = res.variables.data[0].id_;
+                        let abc = '{"biao_zhi_uuid_":"' + uuid + '"}'
+                        // console.log('zzj abc ',abc)
+                        if (changeWeiZhi && !changesyWeiZhi) {
+                          // alert(1)
+                          repostCurd('update', '{"tableName":"t_lhypdjb","paramWhere":' + abc + ',"paramCond":' + '{"shou_yang_wei_zhi":"' + dataid + '"}}').then(res => {
+                            console.log('回填样品收样位置')
+                          })
+                        } else {
+                          // alert(2)
+                          repostCurd('update', '{"tableName":"t_lhypdjb","paramWhere":' + abc + ',"paramCond":' + '{"liu_yang_wei_zhi_":"' + dataid + '"}}').then(res => {
+                            console.log('回填样品留样位置')
+                          })
+                        }
+                      })
+
+                    })
+                  }
+                }
+              })
+          }
+          this.$emit('callback', true)
+          this.visable = false
+          this.$message({
+            message: '样品接收确认操作成功!',
+            type: 'success'
+          })
+          this.closeDialog();
+        }).catch(_ => {});
       }
 
     },
+
     /* 去除指定行数据 使用过滤器filter过滤指定行号数据 */
-    deleteData(val){
-      this.listData = this.listData.filter((data) =>{
-            return data.id_!=val
-        })
+    deleteData(val) {
+      this.listData = this.listData.filter((data) => {
+        return data.id_ != val
+      })
     },
 
     unique(arr) {
@@ -305,51 +595,70 @@ export default {
         return arr.indexOf(item, 0) === index;
       });
     },
-   /* 提交数据
-    commitData(val){
-      for(let item of val) {
-             let dataWhere = [] //ajax的修改字段
-             dataWhere.push('{"tableName":"t_gdyrqcyp" + "," + "paramWhere":"id_:'+item.id_ +'" +","+    "shu_liang_":"'+ item.shu_liang_ +'"  +","+  "lingYongRen":"' + item.ling_yong_ren_ + '"  +","+  "cunFangWeiZhi":"' + item.cun_fang_wei_zhi_ + '"  +","+  "sign":"out"}')
-               // dataWhere.push('{"yangPinBianHao":"'+ item.yang_pin_bian_hao +'"  +","+  "lingYongRen":"' + item.ling_yong_ren_ + '"  +","+  "cunFangWeiZhi":"' + item.cun_fang_wei_zhi_ + '"  +","+  "shuLiang":"' + item.shu_liang_ + '"}')
-
-            // repostCurd('updateSample',"{data:'"+JSON.stringify(dataWhere)+"'}").then(response =>{
-            //   console.log(response)
-            // })
-
-            // this.Update('t_gdyrqcyp',{"id_":item.id_},"{data:'"+JSON.stringify(dataWhere)+"'}").then(response => {
-            //            this.$emit('callback', true)
-            //            this.visible = false
-            //            this.$message({
-            //                      message: '样品出库操作成功!',
-            //                      type: 'success'
-            //                    });
-            //          })
-               }
-    },*/
-    Update (name,where,cond) {
-    	  let cont = {}
-    	  cont['tableName'] = name
-    	  cont['paramWhere'] = where
-    	  cont['paramCond'] = cond
-    	  return repostCurd('update',JSON.stringify(cont))
-    	},
+    uuid() {
+      var s = [];
+      var hexDigits = "0123456789abcdef";
+      for (var i = 0; i < 36; i++) {
+          s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
+      }
+      s[14] = "4";  // bits 12-15 of the time_hi_and_version field to 0010
+      s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1);  // bits 6-7 of the clock_seq_hi_and_reserved to 01
+      s[8] = s[13] = s[18] = s[23] = "-";
+      var uuid = s.join("");
+      return uuid;
+  },
+    /* 根据样品编号 查询所有样品表
+    SearchAllypbEvent(lhypbhList){
+      repostCurd('selects','{"tableName":"t_lhypb","paramWhere":[' + lhypbhList + ']}').then(res =>{
+        return res.variables.data
+      })
+    },
+    */
+    /* 提交数据
+     commitData(val){
+       for(let item of val) {
+              let dataWhere = [] //ajax的修改字段
+              dataWhere.push('{"tableName":"t_gdyrqcyp" + "," + "paramWhere":"id_:'+item.id_ +'" +","+    "shu_liang_":"'+ item.shu_liang_ +'"  +","+  "lingYongRen":"' + item.ling_yong_ren_ + '"  +","+  "cunFangWeiZhi":"' + item.cun_fang_wei_zhi_ + '"  +","+  "sign":"out"}')
+                // dataWhere.push('{"yangPinBianHao":"'+ item.yang_pin_bian_hao +'"  +","+  "lingYongRen":"' + item.ling_yong_ren_ + '"  +","+  "cunFangWeiZhi":"' + item.cun_fang_wei_zhi_ + '"  +","+  "shuLiang":"' + item.shu_liang_ + '"}')
+
+             // repostCurd('updateSample',"{data:'"+JSON.stringify(dataWhere)+"'}").then(response =>{
+             //   console.log(response)
+             // })
+
+             // this.Update('t_gdyrqcyp',{"id_":item.id_},"{data:'"+JSON.stringify(dataWhere)+"'}").then(response => {
+             //            this.$emit('callback', true)
+             //            this.visible = false
+             //            this.$message({
+             //                      message: '样品出库操作成功!',
+             //                      type: 'success'
+             //                    });
+             //          })
+                }
+     },*/
+    Update(name, where, cond) {
+      let cont = {}
+      cont['tableName'] = name
+      cont['paramWhere'] = where
+      cont['paramCond'] = cond
+      return repostCurd('update', JSON.stringify(cont))
+    },
 
     /* zzj add */
-     dateFormat() { // 获取当前时间
-        var date=new Date();
-        var year=date.getFullYear();
-        var month= date.getMonth()+1<10 ? "0"+(date.getMonth()+1) : date.getMonth()+1;
-        var day=date.getDate()<10 ? "0"+date.getDate() : date.getDate();
-        return year+"-"+month+"-"+day;
+    dateFormat() { // 获取当前时间
+      var date = new Date();
+      var year = date.getFullYear();
+      var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
+      var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
+      return year + "-" + month + "-" + day;
     },
 
 
     /* 关闭*/
     remRedar() {
-      this.visible = false  // 列表隐藏
-      this.listData = []    // 清空列表数据
-      this.redar = false    // 扫码图标隐藏
-      this.$emit('scanOff',false)
+      this.visible = false // 列表隐藏
+      this.listData = [] // 清空列表数据
+      this.redar = false // 扫码图标隐藏
+      this.$emit('scanOff', false)
     },
 
   }

+ 336 - 195
src/views/system/jbdScan/js/sampleConfirmationJS.js

@@ -28,14 +28,15 @@ export default {
 
       // 扫码扫到新数据,查询 回填展示
       if(flag){
-         // repostCurd('select','{"tableName": "t_mjypdjb","paramWhere":{"yang_pin_bian_hao":"S220909-1053"}}').then(response => {
-         repostCurd('select','{"tableName": "t_mjypdjb","paramWhere":{"yang_pin_bian_hao":"' + id + '"}}').then(response => {
+         repostCurd('select','{"tableName": "t_lhypb","paramWhere":{"yang_pin_bian_hao":"' + id + '"}}').then(response => {
           if (response.variables.data && response.variables.data.length > 0) {
-              // console.log(response.variables.data[0])
-              response.variables.data[0].jie_yang_shu_lian = 1
-              this.listData.push(response.variables.data[0])
-              this.OriginalPosition.push(response.variables.data[0].shi_fou_liu_yang_ == "是" ? response.variables.data[0].liu_yang_wei_zhi_ : response.variables.data[0].shou_yang_wei_zhi)
-          }
+            for (let i in res.variables.data) {
+              res.variables.data[i].jie_yang_shu_lian = 1
+              res.variables.data[i].jie_yang_zhuang_t = '未确认'
+              this.listData.push(res.variables.data[i])
+              //this.OriginalPosition.push(res.variables.data[i].shi_fou_liu_yang_ == "是" ? res.variables.data[i].liu_yang_wei_zhi_ : res.variables.data[i].shou_yang_wei_zhi)
+            }
+            }
         })
       }
 
@@ -61,232 +62,372 @@ export default {
       // this指针
       let this_ = this;
       // 回传关闭事件。隐藏当前组件。
+      let changeWeizhi;
+      let changesyWeizhi;
       let judge = true;
         this.$confirm('请再次确认 [样品接收信息]').then(_ => {
-          // 获取样品列表
-          let ypInfoList = this_.listData
-          // console.log(ypInfoList)
+
+            // 获取样品列表
+            let ypInfoList = this_.listData
+            // console.log(ypInfoList, "样品信息")
 
             let dWhere = []
             let ypbh = []
             let cfwzIdList = [] // 放置 存放位置的ID
             let uuidList = [] // 列表的UUID
+            let ypbhList = [] // 样品编号列表
 
-            let ypIdList = []             // 样品id列表,格式转好的
-            let ypWeiZhi = []             // 样品收样位置
-            let ypLiuYangWeiZhi = []      // 样品留样位置
-            let saoMaNumList = []         // 扫码确认数量列表
-            let jieYangQueRenZTList = []  // 接样状态列表
-
-            let ypbhList = []   // 样品编号列表
-            let mjypbList = [] // 明鉴样品表
-            let mjypbWJ = [] // 明鉴样品表外键
+            // 罗湖样品编号列表
+            let lhypbhList = []
+            // 罗湖委托单列表
+            let lhwtsqbList = []
+            // 罗湖样品表列表
+            let lhypbList = []
+            // 罗湖样品表外键
+            let lhypbWJ = []
+            // 罗湖委托表主键
+            let lhwtbID = []
+            // 罗湖委托表展示表ID
+            let lhwtzsbID = []
+            // 罗湖样品id列表
+            let lhypIdList = []
+            // 罗湖样品id格式列表
+            let lhypIdNewList = []
 
-            for(let yp in ypInfoList){
+            for (let yp in ypInfoList) { //样品数据
               let cfwz = ''
-              if(ypInfoList[yp].jie_yang_shu_lian > ypInfoList[yp].shou_yang_shu_lia){
-                 this_.$message.error('操作失败,['+ypInfoList[yp].yang_pin_ming_che+'] 接收确认数量不得大于收样数量。')
-                 return;
+              /*
+                校验:
+                  1、样品数量 <=  确认数量
+                  2、是否留样 => 填收样位置|留样位置
+                  3、验收结果必填
+                  4、如果留样 => 必填项:留样日期、留样数量、留样期限至、销毁日期
+              */
+              if (ypInfoList[yp].jie_yang_shu_lian > ypInfoList[yp].yang_pin_zong_shu) {
+                this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 接收确认数量不得大于收样数量。')
+                return;
+              }
+              if (ypInfoList[yp].jie_yang_zhuang_t == '未确认') {
+                this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 接收确认状态必须为已确认。')
+                return;
               }
-              if(ypInfoList[yp].jie_yang_zhuang_t == '待确认'){
-                this_.$message.error('操作失败,['+ypInfoList[yp].yang_pin_ming_che+'] 接收确认状态必须为已确认。')
+              if (ypInfoList[yp].yan_shou_jie_guo_ == null || ypInfoList[yp].yan_shou_jie_guo_ == '') {
+                this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 验收结果不能为空!')
                 return;
               }
-              if(ypInfoList[yp].shi_fou_liu_yang_ == "是"){
-                if(ypInfoList[yp].liu_yang_wei_zhi_ == null || ypInfoList[yp].liu_yang_wei_zhi_ == ''){
+              if (ypInfoList[yp].shi_fou_liu_yang_ == null || ypInfoList[yp].shi_fou_liu_yang_ == '') {
+                this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 是否留样不能为空!')
+                return;
+              }
+
+              if (ypInfoList[yp].bao_gao_bian_zhi_ == undefined || ypInfoList[yp].bao_gao_bian_zhi_ == '') {
+                this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 报告编制员不能为空!')
+                return;
+              }
+              if (ypInfoList[yp].bao_gao_shen_he_y == undefined || ypInfoList[yp].bao_gao_shen_he_y == '') {
+                this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 报告审核员不能为空!')
+                return;
+              }
+
+              if (ypInfoList[yp].shi_fou_liu_yang_ == "是") {
+                if (ypInfoList[yp].liu_yang_wei_zhi_ == null || ypInfoList[yp].liu_yang_wei_zhi_ == '') {
                   this_.$message.error("你要留样的话,存放位置不能为空哦!")
                   return;
                 }
-                if(ypInfoList[yp].shou_yang_wei_zhi != undefined && ypInfoList[yp].shou_yang_wei_zhi != ''){
+                if (ypInfoList[yp].shou_yang_wei_zhi != undefined && ypInfoList[yp].shou_yang_wei_zhi != '') {
                   this_.$message.error("你要留样的话,就不要选收样存放位置!")
                   return;
                 }
-                let isLy = ypInfoList[yp].liu_yang_wei_zhi_
-                if(isLy.substr(-2,isLy.length -1) == "占用" || isLy.substr(-2,isLy.length -1) == "空余"){
-                  let sql = "select `id` from MJ_yp_position_status where positionAndStatus = '" + isLy + "' limit 1"
-                   repostCurd('sql',sql).then(response=>{
-                     cfwz = response.variables.data[0].id
-                     ypInfoList[yp].liu_yang_wei_zhi_ = cfwz
-                     console.log('?question time')
-                   })
-                }else{
-                  cfwz = ypInfoList[yp].liu_yang_wei_zhi_
+                if (ypInfoList[yp].liu_yang_ri_qi_ == null || ypInfoList[yp].liu_yang_ri_qi_ == '') {
+                  this_.$message.error("留样时必须填写留样日期!")
+                  return;
+                }
+                if (ypInfoList[yp].liu_yang_shu_lian == null || ypInfoList[yp].liu_yang_shu_lian == '') {
+                  this_.$message.error("留样时必须填写留样数量!")
+                  return;
+                }
+                if (ypInfoList[yp].liu_yang_shu_lian > ypInfoList[yp].yang_pin_zong_shu) {
+                  this_.$message.error('操作失败,[' + ypInfoList[yp].yang_pin_ming_che + '] 留样数量不得大于收样数量。')
+                  return;
+                }
+                if (ypInfoList[yp].liu_yang_qi_xian == null || ypInfoList[yp].liu_yang_qi_xian == '') {
+                  this_.$message.error("留样时必须填写留样期限!")
+                  return;
+                }
+                if (ypInfoList[yp].xiao_hui_ri_qi_ == null || ypInfoList[yp].xiao_hui_ri_qi_ == '') {
+                  this_.$message.error("留样时必须填写销毁日期!")
+                  return;
                 }
+                  cfwz = ypInfoList[yp].liu_yang_wei_zhi_
 
-              }else{
-                if(ypInfoList[yp].shou_yang_wei_zhi == null || ypInfoList[yp].shou_yang_wei_zhi == ''){
+              } else {
+                if (ypInfoList[yp].shou_yang_wei_zhi == null || ypInfoList[yp].shou_yang_wei_zhi == '') {
                   this_.$message.error("你正常收样的话,样品存放位置不能为空哦!")
                   return;
                 }
-                if(ypInfoList[yp].liu_yang_wei_zhi_ != undefined && ypInfoList[yp].liu_yang_wei_zhi_ != ''){
+                if (ypInfoList[yp].liu_yang_wei_zhi_ != undefined && ypInfoList[yp].liu_yang_wei_zhi_ != '') {
                   this_.$message.error("你正常收样的话,就不要选择留样存放位置!")
                   return;
                 }
-                let isZC = ypInfoList[yp].shou_yang_wei_zhi
-                if(isZC.substr(-2,isZC.length -1) == "占用" || isZC.substr(-2,isZC.length -1) == "空余"){
-                  let sql = "select `id` from MJ_yp_position_status where positionAndStatus = '" + isZC + "' limit 1"
-                   repostCurd('sql',sql).then(response=>{
-                     cfwz = response.variables.data[0].id
-                     ypInfoList[yp].shou_yang_wei_zhi = cfwz
-                     console.log('?question time')
-                   })
-                }else{
-                  cfwz = ypInfoList[yp].shou_yang_wei_zhi
-                }
+                  cfwz = ypInfoList[yp].shou_yang_wei_zhi //取位置信息
               }
-              dWhere.push('{"id_":"' + cfwz + '"}')
-              ypbh.push(ypInfoList[yp].yang_pin_bian_hao)
               uuidList.push(ypInfoList[yp].biao_zhi_uuid_)
-              cfwzIdList.push(cfwz)
+              // ypIdList.push('{"id_":"' + ypInfoList[yp].id_ + '"}')
+              // ypWeiZhi.push(ypInfoList[yp].shou_yang_wei_zhi) // 收样存放位置
+              // ypLiuYangWeiZhi.push(ypInfoList[yp].liu_yang_wei_zhi_) // 留样存放位置
+              // saoMaNumList.push(ypInfoList[yp].jie_yang_shu_lian) // 扫码数量
+              // jieYangQueRenZTList.push(ypInfoList[yp].jie_yang_zhuang_t) // 接收确认状态
+              ypbhList.push('{"yang_pin_bian_hao":"' + ypInfoList[yp].yang_pin_bian_hao + '"}') // 样品编号列表
 
-              ypIdList.push('{"id_":"' + ypInfoList[yp].id_ + '"}')
-              ypWeiZhi.push(ypInfoList[yp].shou_yang_wei_zhi)		            // 收样存放位置
-              ypLiuYangWeiZhi.push(ypInfoList[yp].liu_yang_wei_zhi_)	      // 留样存放位置
-              saoMaNumList.push(ypInfoList[yp].jie_yang_shu_lian)           // 扫码数量
-              jieYangQueRenZTList.push(ypInfoList[yp].jie_yang_zhuang_t)    // 接收确认状态
 
-              ypbhList.push('{"yang_pin_bian_hao":"' + ypInfoList[yp].yang_pin_bian_hao + '"}') // 样品编号列表
-            }
-              for(let index in ypIdList){
-                let WZtem = ypWeiZhi[index]==null?'':ypWeiZhi[index]
-                let LYWZtem = ypLiuYangWeiZhi[index]==null?'':ypLiuYangWeiZhi[index]
-                repostCurd('update','{"tableName":"t_mjypdjb","paramWhere":'+ypIdList[index]+',"paramCond":'+'{"shou_yang_wei_zhi":"'+WZtem+'","jie_yang_shu_lian":"'+saoMaNumList[index]+'","jie_yang_zhuang_t":"'+jieYangQueRenZTList[index]+'","liu_yang_wei_zhi_":"'+ LYWZtem + '"}}')
+              // 罗湖
+              // lhypbhList.push('{"yang_pin_bian_hao":"' + ypInfoList[yp].yang_pin_bian_hao + '"}')
+              // lhypbWJ.push('{"id_":"' + ypInfoList[yp].parent_id_ + '"}')
+              dWhere.push('{"id_":"' + cfwz + '"}')
+              cfwzIdList.push(cfwz)
+              lhypbhList.push( ypInfoList[yp].yang_pin_bian_hao )
+              lhypbWJ.push( ypInfoList[yp].parent_id_ )
+              lhypIdList.push( ypInfoList[yp].id_ )
+              lhypIdNewList.push('{"id_":"' + ypInfoList[yp].id_ + '"}')
+
+              ypbh.push(ypInfoList[yp].yang_pin_bian_hao)
             }
-            for(let num in dWhere){
-              if(this.OriginalPosition[num] != cfwzIdList[num]){
-                let sql = "select * from t_mjypcfwz where id_ = '" + cfwzIdList[num] + "'"
-                repostCurd('sql',sql).then(response=>{
-                    let resArr = response.variables.data
-                    if(resArr.length == 1){
-                        if(resArr[0].wei_zhi_zhuang_ta == "空余"){
-                          repostCurd('update','{"tableName":"t_mjypcfwz","paramWhere":'+dWhere[num]+',"paramCond":'+'{"wei_zhi_zhuang_ta":"占用","yang_pin_bian_hao":"'+ ypbh[num] + '","ru_ku_shi_jian_":"'+ this_.dateFormat() + '","shou_yang_ri_qi_":"'+ uuidList[num] + '"}}')
-                        }else if(resArr[0].wei_zhi_zhuang_ta == "占用"){
-                          // 新增一条新的位置记录,使用旧的位置记录 修改它的样品编号,入库时间,标识UUID
-                                let cfNewList = []
-                                let cfNew = {}
-                                cfNew["fang_jian_lei_xin"] = resArr[0].fang_jian_lei_xin
-                                cfNew["huo_jia_lei_xing_"] = resArr[0].huo_jia_lei_xing_
-                                cfNew["huo_jia_hao_"] = resArr[0].huo_jia_hao_
-                                cfNew["qu_yu_"] = resArr[0].qu_yu_
-                                cfNew["gua_jia_hao_"] = resArr[0].gua_jia_hao_
-                                cfNew["ceng_hao_"] = resArr[0].ceng_hao_
-                                cfNew["wei_zhi_bian_hao_"] = resArr[0].wei_zhi_bian_hao_
-                                cfNew["wei_zhi_zhuang_ta"] = resArr[0].wei_zhi_zhuang_ta
-                                cfNew["cun_fang_lei_xing"] = resArr[0].cun_fang_lei_xing
-                                cfNew["cun_chu_tiao_jian"] = resArr[0].cun_chu_tiao_jian
-                                cfNew["yang_pin_bian_hao"] = ypbh[num]
-                                cfNew["ru_ku_shi_jian_"] = this_.dateFormat()
-                                cfNew["shou_yang_ri_qi_"] = uuidList[num]
-                                cfNewList.push(cfNew)
-                              repostCurd('add','{"tableName":"t_mjypcfwz","paramWhere":'+JSON.stringify(cfNewList)+'}')
-                        }
+
+          /*
+            封装好样品登记表对象,add 样品登记表
+          */
+           let value = ''
+           let lhypIdStr = ''
+           console.log('lhypbWJ :',lhypbWJ)
+           console.log('lhypIdList :',lhypIdList)
+           for(let i =0;i<lhypbWJ.length; i++){
+             value += lhypbWJ[i] + ','
+           }
+           value = value.substring(0,value.length-1)
+           value = value.replace(/,/g,"','")
+           for(let i = 0; i<lhypIdList.length;i++){
+             lhypIdStr += lhypIdList[i] + ','
+           }
+           lhypIdStr = lhypIdStr.substring(0,lhypIdStr.length-1)
+           lhypIdStr = lhypIdStr.replace(/,/g,"','")
+
+           let wtdAndYpb = []
+          // a.bao_gao_bian_zhi_,a.bao_gao_fu_he_yua,
+           let allSQL = `select a.id_ as wtID,a.zhan_shi_biao_id_,a.wei_tuo_lei_xing_,a.he_tong_id_,a.bao_gao_lei_xing_,a.wei_tuo_bian_hao_, a.wei_tuo_dan_wei_, a.wei_tuo_fang_lian, a.wei_tuo_lian,a.bao_gao_bian_zhi_,a.bao_gao_fu_he_yua,b.* from t_lhwtsqb a inner join t_lhypb b on a.id_ = b.parent_id_ where b.parent_id_ in ('${value}')and b.id_ in ('${lhypIdStr}')`
+            repostCurd('sql', allSQL).then(res1 => {
+                /* 封装样品登记表对象  */
+                let ypdjb = []
+                let res = res1.variables.data
+                // wtdAndYpb.push(res)
+                wtdAndYpb = res
+
+                for(let i = 0; i<res.length; i++){
+                lhwtbID.push('{"id_":"' + res[i].wtID + '"}')
+                lhwtzsbID.push('{"shen_qing_id_":"' + res[i].zhan_shi_biao_id_ + '"}')
+                    let count = 0;
+                    if(res[i].yang_pin_lei_xing != ''  && res[i].yang_pin_lei_xing != undefined){
+                      count = 1;
+                      if(res[i].yang_pin_lei_er_ != ''  && res[i].yang_pin_lei_er_ != undefined){
+                         count = 2;
+                         if(res[i].yang_pin_lei_san_ != ''  && res[i].yang_pin_lei_san_ != undefined){
+                           count = 3;
+                           if(res[i].yang_pin_lei_si_ != ''  && res[i].yang_pin_lei_si_ != undefined){
+                             count = 4;
+                           }
+                         }
+                      }
                     }
-                })
-              }
+                    for(let x = 0; x<count;x++){
+                      let obj = {}
+                      obj["wei_tuo_dan_hao_"] = res[i].wei_tuo_bian_hao_
+                      obj["wei_tuo_dan_wei_"] = res[i].wei_tuo_dan_wei_
+                      obj["lian_xi_ren_"]     = res[i].wei_tuo_fang_lian
+                      obj["lian_xi_dian_hua_"] = res[i].wei_tuo_lian
 
-            }
-             repostCurd('selects','{"tableName":"t_mjypb","paramWhere":['+ypbhList+']}').then(response=>{
-               mjypbList = response.variables.data
-               let wjList = []
-               let wjAll  = []
-               let wjAllList = []
-               for(let i in mjypbList){
-                  wjList.push(mjypbList[i].wai_jian_)
-                  wjAll.push(mjypbList[i].wai_jian_)
-               }
-               wjList = this_.unique(wjList)
-               for(let i in wjList){
-                  mjypbWJ.push('{"id_":"' + wjList[i]+ '"}')
-               }
-               for(let i in wjAll){
-                  wjAllList.push('{"id_":"' + wjAll[i]+ '"}')
-               }
-                  repostCurd('updates','{"tableName":"t_mjwtsqb","paramWhere":['+mjypbWJ+'],"paramCond":{"zhuang_tai_":"委托结束"}}')
-                 let mjwtsqbAllResult = []
-                 let mjwtsqbIdList = []
-                 let mjfbbList = []
-                 let mjfbbWJList = []
-                for(let i in wjAllList){
-                  repostCurd('select','{"tableName":"t_mjwtsqb","paramWhere":'+wjAllList[i]+'}').then(response=>{
-                         mjfbbWJList.push('{"wei_tuo_wai_jian_":"' + response.variables.data[0].id_ + '"}')
-                         mjwtsqbAllResult.push(response.variables.data[0])
-                         mjwtsqbIdList.push('{"id_":"' + response.variables.data[0].id_ + '"}')
-                        })
+                      obj["yang_ben_ming_che"]  = res[i].yang_pin_ming_che
+                      obj["yang_ben_bian_hao"]  = res[i].yang_pin_bian_hao
+                      obj["pi_hao_bian_hao_"]   = res[i].song_jian_pi_hao_
+                      obj["xing_ming_"]         = res[i].xing_ming_
+                      obj["xing_bie_"]          = res[i].xing_bie_
+                      obj["nian_ling_"]         = res[i].nian_ling_
+                      obj["yang_ben_zhuang_t"]  = res[i].yang_pin_zhuang_t
+                      obj["shou_yang_ri_qi_"]   = this_.dateFormat()
+                      obj["bei_zhu_"]           = res[i].bei_zhu_
+
+                      obj["yang_ben_lei_xing"] =    x==0? res[i].yang_pin_lei_xing : x==1? res[i].yang_pin_lei_er_ : x==2? res[i].yang_pin_lei_san_ : x==3? res[i].yang_pin_lei_si_ :''
+                      obj["yun_shu_tiao_jian"] =    x==0? res[i].yang_ben_yun_shu_ : x==1? res[i].yang_pin_yun_shu_ : x==2? res[i].yang_pin_yun_san : x==3? res[i].yang_pin_yun_si_ :''
+                      obj["yang_pin_shu_lian"] =    x==0? res[i].shu_liang_ : x==1? res[i].shu_liang_er_ : x==2? res[i].shu_liang_san_ : x==3? res[i].shu_liang_si_ :''
+                      obj["yang_ben_gui_ge_s"] =    x==0? res[i].yang_pin_gui_ge_ : x==1? res[i].yang_pin_gui_ge_e : x==2? res[i].yang_pin_gui_ge_s : x==3? res[i].yang_pin_gui_si_ :''
+                      obj["yan_shou_jie_guo_"] =      ypInfoList[i].yan_shou_jie_guo_
+                      obj["cun_fang_wei_zhi_"] =       ypInfoList[i].shou_yang_wei_zhi
+                      obj["liu_zhuan_zhuang_"] =       '待检'
+                      obj["shi_fou_liu_yang_"] =       ypInfoList[i].shi_fou_liu_yang_
+                      // obj["shou_yang_ren_"] =          ypInfoList[i].
+                      // obj["jiao_yang_ri_qi_"] =        ypInfoList[i].
+                      // obj["jiao_yang_jyr"] =           ypInfoList[i].
+                      // obj["jiao_yang_shu_lia"] =       ypInfoList[i].
+                      obj["liu_yang_ri_qi_"] =         ypInfoList[i].liu_yang_ri_qi_
+                      obj["liu_yang_cun_fang"]  =      ypInfoList[i].liu_yang_cun_fang
+                      obj["liu_yang_shu_lian"]  =      ypInfoList[i].liu_yang_shu_lian
+                      obj["liu_yang_qi_xian"]   =        ypInfoList[i].liu_yang_qi_xian
+                      obj["xiao_hui_ri_qi_"]    =         ypInfoList[i].xiao_hui_ri_qi_
+                      obj["fan_yang_ri_qi_"]    =         ypInfoList[i].fan_yang_ri_qi_
+                      obj["fan_yang_jyr"]       =       ypInfoList[i].fan_yang_jyr
+                      changeWeiZhi = ypInfoList[i].shou_yang_wei_zhi ==''?'':ypInfoList[i].shou_yang_wei_zhi
+                      changesyWeiZhi = ypInfoList[i].liu_yang_cun_fang ==''?'':ypInfoList[i].liu_yang_cun_fang
+                      ypdjb.push(obj)
+                    }
                 }
+                // console.log('进入样品登记表...',ypdjb)
+                repostCurd('add', '{"tableName":"t_lhypdjb","paramWhere":' + JSON.stringify(ypdjb) + '}')
+                repostCurd('updates', '{"tableName":"t_lhypb","paramWhere":[' + lhypIdNewList + '],"paramCond":{"jie_yang_zhuang_t":"已接收"}}')
+                /*
+                更新委托单 如果本来没值,就更新 报告编制人和 报告审核员 否则更新
+                  委托单数组 和 样品数组 数量相同,遍历两者 判断委托单是否有编制人,审核员?
+                  如果没有,则记录下委托单ID,以及同索引下的样品表的编制人和审核员
+                */
+                for(var index = 0; index <ypInfoList.length; index++){
+                  if(res[index].bao_gao_bian_zhi_  == '' || res[index].bao_gao_fu_he_yua  == ''){
+                    // console.log('{"id_":"' + res[index].id_ + '"}')
+                    // console.log(ypInfoList[index].bao_gao_bian_zhi_)
+                    // console.log(ypInfoList[index].bao_gao_shen_he_y)
+                   repostCurd('update','{"tableName":"t_lhwtsqb","paramWhere":' + '{"id_":"' + res[index].wtID + '"}' + ',"paramCond":' + '{"bao_gao_bian_zhi_":"'+ypInfoList[index].bao_gao_bian_zhi_+'","bao_gao_fu_he_yua":"' +  ypInfoList[index].bao_gao_shen_he_y + '"}}')
+                }
+              }
+               /*
+                   3、任务分配
+                   3-1、根据 wtdAndYpb 的 wtID 更改委托表的 委托状态 wei_tuo_zhuang_ta 变成 已完成
+                   3-2、根据每个样品对应的检测项目,开启一个或多个任务 / 遍历样品表开任务分配流程,一个样品可能对应多个检测
+                   3-3、委托表找zhan_shi_biao_id_ 修改  t_lhwtzsb "zhuang_tai_"为"任务分配进行中"
+                */
+                 repostCurd('updates', '{"tableName":"t_lhwtsqb","paramWhere":[' + lhwtbID + '],"paramCond":{"wei_tuo_zhuang_ta":"已完成"}}')
 
-                setTimeout(()=>{
-                  let narr = []
-                  for(let a of mjfbbWJList){
-                    narr.push(a)
+                 let rws = []
+                if(wtdAndYpb.length>0){
+                   for(var i in wtdAndYpb){
+                     let strs = wtdAndYpb[i].jian_ce_xiang_mu_.split(',')
+                         for(var l in strs){
+                          let rw = {}
+                           rw["ren_wu_ming_cheng"] = strs[l] //检测项目
+                           rw["yang_pin_ming_che"] = wtdAndYpb[i].yang_pin_ming_che//样品名称
+                           rw["yang_pin_bian_hao"] = wtdAndYpb[i].yang_pin_bian_hao//样品编号
+                           rw["wei_tuo_lei_xing_"] = wtdAndYpb[i].wei_tuo_lei_xing_ //委托类型
+                           let yplxz = ''
+                           if(wtdAndYpb[i].yang_pin_lei_xing != null && wtdAndYpb[i].yang_pin_lei_xing!=''){ //样品类型1
+                              yplxz = wtdAndYpb[i].yang_pin_lei_xing //样品类型
+                           }
+                           if(wtdAndYpb[i].yang_pin_lei_er_ != null && wtdAndYpb[i].yang_pin_lei_er_!=''){ //样品类型2
+                             if(yplxz==null || yplxz == ''){
+                               yplxz = wtdAndYpb[i].yang_pin_lei_er_ //样品类型
+                             }else{
+                               yplxz =yplxz+','+ wtdAndYpb[i].yang_pin_lei_er_ //样品类型
+                             }
+                           }
+                           if(wtdAndYpb[i].yang_pin_lei_san_ != null && wtdAndYpb[i].yang_pin_lei_san_!=''){ //样品类型3
+                             if(yplxz==null || yplxz == ''){
+                               yplxz = wtdAndYpb[i].yang_pin_lei_san_ //样品类型
+                             }else{
+                               yplxz =yplxz+','+ wtdAndYpb[i].yang_pin_lei_san_ //样品类型
+                             }
+                           }
+                           if(wtdAndYpb[i].yang_pin_lei_si_ != null && wtdAndYpb[i].yang_pin_lei_si_!=''){ //样品类型4
+                             if(yplxz==null || yplxz == ''){
+                               yplxz = wtdAndYpb[i].yang_pin_lei_si_ //样品类型
+                             }else{
+                               yplxz = yplxz+','+ wtdAndYpb[i].yang_pin_lei_si_ //样品类型
+                             }
+                           }
+                           rw["yang_pin_lei_xing"] = yplxz //样品类型
+                           rw["wei_tuo_id_"] = wtdAndYpb[i].wtID  //委托id
+                           rw["he_tong_id_"] = wtdAndYpb[i].he_tong_id_ //合同id
+                           rw["zhuang_tai_"] = '待任务分配'//状态
+                           rw["wan_cheng_shi_jia"] = wtdAndYpb[i].song_jian_shi_jia  //送检日期
+                           rw["bao_gao_bian_zhi_"] = ypInfoList[i].bao_gao_bian_zhi_  //报告编制人
+                           rw["bao_gao_shen_he_y"] = ypInfoList[i].bao_gao_shen_he_y  //报告审核人
+                           rw["bao_gao_lei_xing_"] = wtdAndYpb[i].bao_gao_lei_xing_  //报告类型
+                           rw["xin_xiang_mu_ming"] = wtdAndYpb[i].xiang_mu_ming_che   //项目名称
+                           rw["zhan_shi_biao_id_"] = wtdAndYpb[i].zhan_shi_biao_id_  //展示表id
+                           rws.push(rw)
+                          }
+                    }
+                   repostCurd('add', '{"tableName":"t_lhrwfpb","paramWhere":'+JSON.stringify(rws)+',"defKey":"Process_04o0csc","formKey":"lhrwfp"}')
                   }
-                  repostCurd('selects','{"tableName":"t_mjfbb","paramWhere":['+narr+']}').then(response=>{
-                    mjfbbList.push(response.variables.data)
-                 })
-                }, 1000)
-             setTimeout(()=>{
-               /* 分包
-                repostCurd('select','{"tableName":"t_mjfbb","paramWhere":'+mjwtsqbIdList[i]+'}').then(response=>{
-               	 console.log(response.variables.data)
-                	mjfbbList.push(response.variables.data)
-                })*/
-               let rwb = []
-               let index = 0
-               if(mjypbList != null && mjypbList.length >= 1){
-                 index = mjypbList[0].jian_ce_xiang_mu2.split(",").length - 1
-               }
-               for(var i in mjypbList){
-                let str =  mjypbList[i].jian_ce_xiang_mu2.split(",")
-                  for(var p in str){
-                   let temp = index - p
-                   let rwzb = {}
-                    let wz_ = ypInfoList[i].shi_fou_liu_yang_ == "是" ? ypInfoList[i].liu_yang_wei_zhi_ : ypInfoList[i].shou_yang_wei_zhi   	  //	对应的样品存放位置
-                    rwzb["jian_ce_xiang_mu_"] = str[p] 			  	                //	取当前检测项目
-                    rwzb["yang_pin_bian_hao"] = mjypbList[i].yang_pin_bian_hao 	//	取对应的样品编号
-                    rwzb["yang_pin_ming_che"] = mjypbList[i].yang_pin_ming_che   //	对应的样品名称
-                    rwzb["yang_pin_dai_ci_"] = mjypbList[i].dai_ci_   			      //	对应的样品代次
-                    rwzb["yang_pin_pi_hao_"] = mjypbList[i].pi_hao_   			      //	对应的样品批号
-                    rwzb["yang_pin_shu_lian"] = mjypbList[i].shu_liang_   		    //	对应的样品数量
-                    rwzb["bug_ri_qi_"] = mjypbList[i].song_yang_ri_qi_   	      //  对应的送样日期
-                    rwzb["cun_fang_wei_zhi_"] = wz_
-                    rwzb["wei_tuo_wai_jian_"] = mjypbList[i].wai_jian_ 			    //	检测申请单id
-                    rwzb["he_tong_wai_jian_"] = mjwtsqbAllResult[i].he_tong_bian_hao_    //合同id
-                    rwzb["song_yang_ri_qi_"] = mjypbList[i].biao_zhi_uuid_       //收样日期
-                    rwzb["wei_tuo_ren_"] =   mjwtsqbAllResult[i].lian_xi_ren_  //委托人
-                    rwzb["bao_gao_jian_ce_s"] =  this_.dateFormat()   //检测时间
-                    rwzb["zhan_shi_biao_wai"] = mjwtsqbAllResult[i].ye_mian_zong_zhua
-                    rwzb["zhuang_tai_"] = "任务待分配"			//	状态
-                    rwzb["shi_fou_fen_bao_"] = mjfbbList[i].shi_fou_fen_bao_			// 是否分包
-                    rwzb["qi_wang_wan_cheng"] = mjfbbList[i].wan_cheng_shi_jia 			// 期望完成时间
-                    rwzb["shi_fou_fen_bao_"] = mjfbbList[0][temp].shi_fou_fen_bao_			// 是否分包
-                    rwzb["qi_wang_wan_cheng"] = mjfbbList[0][temp].wan_cheng_shi_jia 			// 期望完成时间
-                    rwb.push(rwzb)
+                  /* 更新委托单 检测开始时间   问吴懿是否需要
+                  repostCurd('updates', '{"tableName":"t_lhwtsqb","paramWhere":[' + lhwtbID + '],"paramCond":{"jian_ce_kai_shi_s":"' + this_.dateFormat() + '"}}')
+                  */
+                  //更新展示表
+                  if(lhwtzsbID.length > 0){
+                    repostCurd('updates', '{"tableName":"t_lhwtzsb","paramWhere":['+lhwtzsbID+'],"paramCond":{"zhuang_tai_":"任务分配进行中"}}')
                   }
-                    index += str.length
-               }
-               repostCurd('updates', '{"tableName":"t_mjwtsqb","paramWhere":['+mjwtsqbIdList+'],"paramCond":{"jian_ce_kai_shi_s":"' + this_.dateFormat() + '"}}')
-               let uidList = []
-               for(let item of mjwtsqbAllResult){
-                 uidList.push(item.ye_mian_zong_zhua)
-               }
-               uidList = this_.unique(uidList)
-               repostCurd('add', '{"tableName":"t_rwfpb","paramWhere":'+JSON.stringify(rwb)+',"defKey":"Process_04tgh24","formKey":"mjrwfp"}' )
-                 if(uidList.length > 0 ){
-                   let ups = []
-                   for(let t of uidList){
-                     ups.push('{"shen_qing_id_":"'+t+'"}')
-                   }
-                   repostCurd('updates', '{"tableName":"t_mjwtzsb","paramWhere":['+ups+'],"paramCond":{"zhuang_tai_":"任务分配进行中"}}')
-                 }
-             },2000)
-             })
-                  this.$emit('callback',true)
-                  this.visable = false
-                  this.$message({
-                    message:'样品接收确认操作成功!',
-                    type:'success'
-                  })
-                  this.closeDialog();
-                  }).catch(_ => {});
+
+            })
+
+            // console.log('dWhere : ',dWhere)
+
+            /* 2、更新货架位置信息(位置状态、样品编号、入库时间)如果是重复位置,则新增一条位置记录,并增加对应UUID  */
+            for (let num in dWhere) {
+                let sql = "select * from t_ypcfwz where id_ = '" + cfwzIdList[num] + "'"
+                repostCurd('sql', sql).then(response => {
+                  let resArr = response.variables.data
+                  if (resArr.length == 1) {
+                    if (resArr[0].wei_zhi_zhuang_ta == "空余") {
+                      repostCurd('update', '{"tableName":"t_ypcfwz","paramWhere":' + dWhere[num] + ',"paramCond":' + '{"wei_zhi_zhuang_ta":"占用","yang_pin_bian_hao":"' + ypbh[num] +'","ru_ku_shi_jian_":"' + this_.dateFormat() + '"}}').then(res => {
+                        console.log("原本位置为空余 ,新位置更新成功")
+                      })
+                    } else if (resArr[0].wei_zhi_zhuang_ta == "占用") {
+                      // 新增一条新的位置记录,使用旧的位置记录 修改它的样品编号,入库时间,标识UUID
+                      let cfNewList = []
+                      let cfNew = {}
+                      cfNew["fang_jian_lei_xin"] = resArr[0].fang_jian_lei_xin
+                      cfNew["wei_zhi_"] = resArr[0].wei_zhi_
+                      cfNew["qu_yu_"] = resArr[0].qu_yu_
+                      cfNew["huo_jia_lei_xing_"] = resArr[0].huo_jia_lei_xing_
+                      cfNew["huo_jia_hao_"] = resArr[0].huo_jia_hao_
+                      cfNew["ceng_hao_"] = resArr[0].ceng_hao_
+                      cfNew["shui_ping_fen_qu_"] = resArr[0].shui_ping_fen_qu_
+                      cfNew["wei_zhi_bian_hao_"] = resArr[0].wei_zhi_bian_hao_
+                      cfNew["wei_zhi_zhuang_ta"] = resArr[0].wei_zhi_zhuang_ta
+                      cfNew["cun_chu_tiao_jian"] = resArr[0].cun_chu_tiao_jian
+                      cfNew["yang_pin_bian_hao"] = ypbh[num]
+                      // cfNew["yang_pin_bian_hao"] = lhypIdList[num]
+                      cfNew["ru_ku_shi_jian_"] = this_.dateFormat()
+                      cfNew["biao_zhi_uuid_"] = this_.uuid()
+                      cfNewList.push(cfNew)
+                      let uuid = cfNew["biao_zhi_uuid_"];
+                      console.log('原本位置为占用 ,新位置插入成功')
+
+                      repostCurd('add', '{"tableName":"t_ypcfwz","paramWhere":' + JSON.stringify(cfNewList) + '}').then(res => {
+                        let selectsql = "select id_ from t_ypcfwz where biao_zhi_uuid_='" + uuid + "'";
+                        repostCurd('sql', selectsql).then(res => {
+                          let dataid = res.variables.data[0].id_;
+                          let abc = '{"biao_zhi_uuid_":"' + uuid + '"}'
+                          // console.log('zzj abc ',abc)
+                          if (changeWeiZhi && !changesyWeiZhi) {
+                            // alert(1)
+                            repostCurd('update', '{"tableName":"t_lhypdjb","paramWhere":' + abc + ',"paramCond":' + '{"shou_yang_wei_zhi":"' + dataid + '"}}').then(res => {
+                              console.log('回填样品收样位置')
+                            })
+                          } else {
+                            // alert(2)
+                            repostCurd('update', '{"tableName":"t_lhypdjb","paramWhere":' + abc + ',"paramCond":' + '{"liu_yang_wei_zhi_":"' + dataid + '"}}').then(res => {
+                              console.log('回填样品留样位置')
+                            })
+                          }
+                        })
+
+                      })
+                    }
+                  }
+                })
+            }
+            this.$emit('callback', true)
+            this.visable = false
+            this.$message({
+              message: '样品接收确认操作成功!',
+              type: 'success'
+            })
+            this.closeDialog();
+          }).catch(_ => {});
     },
     /* 去除指定行数据 使用过滤器filter过滤指定行号数据 */
     deleteData(val){