| <template> | 
|   <div class="scan-container"> | 
|     <el-card class="scan-card"> | 
|        <!--  <div slot="header" class="clearfix"> | 
|         <span>码盘上架</span> | 
|       </div>--> | 
|       <canvas id="live2dcanvas" width="300" height="600" style="position: fixed; opacity: 0.7; right: 0px; bottom: -20px; z-index: 99999; pointer-events: none; border: 1px dashed rgb(204, 204, 204);"></canvas> | 
|       <div slot="header" class="tuopan"> | 
|         <el-button type="success" @click="callBigContainer">呼叫大托盘</el-button> | 
|         <el-button type="success" @click="callSmallContainer">呼叫小托盘</el-button> | 
|       </div> | 
|       <el-form ref="form" :model="formData" label-width="120px" class="scan-form"> | 
|         <!-- <el-form-item label="仓库名称"> | 
|           <el-select v-model="formData.storage_Id" placeholder="请选择仓库" class="input-300" @change="getPositionName()"> | 
|             <el-option v-for="item in storageNames" :key="item.storage_Id" :label="item.storageName" :value="item.storage_Id"></el-option> | 
|           </el-select> | 
|         </el-form-item> --> | 
|         <el-form-item label="标签条码"> | 
|           <el-input ref="extendField06" :readonly="disabled_extendField06" v-model="formData.extendField06" autofocus class="input-300" @keyup.native.enter="checkPackingBarcode"></el-input> | 
|           <span class="sub-item"> | 
|             <span class="sub-label">扫描数量:</span> | 
|             <el-input-number v-model="formData.scanQty" :min="1" class="input-100" controls-position="right" @click="setScanQty"></el-input-number> | 
|           </span> | 
|         </el-form-item> | 
|         <el-form-item label="托盘号"> | 
|           <el-input ref="plateCode" v-model="formData.plateCode" autofocus class="input-300" @click="isPalteJudge"></el-input> | 
|         </el-form-item> | 
|         <el-form-item label="占用空间"> | 
|           <el-input-number v-model.number="formData.percentAge" :min="0" :max="100" type="number" size="mini" class="input-100" /> % | 
|           <!-- <el-input ref="percentAge" v-model="formData.percentAge" placeholder="请输入剩余空间百分比" autofocus class="input-300" max="100"></el-input>% --> | 
|         </el-form-item> | 
|         <el-form-item> | 
|           <el-button type="primary" @click="saveCheck">确认码盘上架</el-button> | 
|           <el-button @click="onReset">重置</el-button> | 
|         </el-form-item> | 
|       </el-form> | 
|     </el-card> | 
|     <el-card class="scan-card body-no-padding"> | 
|       <div slot="header" class="clearfix"> | 
|         <span class="padding-top-10">码盘上架明细</span> | 
|         <el-button type="text" class="floatRight" @click="setting.visible=true">字段设置</el-button> | 
|       </div> | 
|       <el-table ref="scan-table" :data="tableData" :row-class-name="rowClass" stripe style="width: 100%" class="scan-table" @row-dblclick="setCurrent"> | 
|          | 
|          <el-table-column | 
|         label="序号" | 
|       type="index" | 
|       width="50"> | 
|     </el-table-column> | 
|         <template v-for="(item, index) in setting.fields"> | 
|           <template v-if="'positionName,scanWeight,purchasePrice,batchNumber,quantity'.indexOf(item.prop)>=0"> | 
|           | 
|             <el-table-column v-if="item.visible" :key="index" :prop="item.prop" :label="item.label" :width="item.width"> | 
|               <template slot-scope="scope"> | 
|                 <template> | 
|                   <el-input v-model="scope.row[item.prop]" size="mini" class="w-100pc"></el-input> | 
|                 </template> | 
|               </template> | 
|             </el-table-column> | 
|           </template> | 
|           <template v-else-if="'finishedQuantity'.indexOf(item.prop)>=0"> | 
|              | 
|             <el-table-column v-if="item.visible" :key="index" :prop="item.prop" :label="item.label" :width="item.width"> | 
|               <template slot-scope="{row}"> | 
|                 <template> | 
|                   <el-input-number v-model.number="row[item.prop]" :min="0" :max="row.quantity" type="number" size="mini" class="w-100pc" /> | 
|                 </template> | 
|               </template> | 
|             </el-table-column> | 
|           </template> | 
|           <template v-else-if="'produceDate'.indexOf(item.prop)>=0"> | 
|             <el-table-column v-if="item.visible" :key="index" :prop="item.prop" :label="item.label" :width="item.width"> | 
|               <template slot-scope="scope"> | 
|                 <template> | 
|                   <el-date-picker v-model="scope.row[item.prop]" size="mini" type="date" placeholder="选择日期" class="w-110" value-format="yyyy-MM-dd"> | 
|                   </el-date-picker> | 
|                 </template> | 
|               </template> | 
|             </el-table-column> | 
|           </template> | 
|           <template v-else-if="'isBoosterArm'.indexOf(item.prop)>=0"> | 
|             <el-table-column v-if="item.visible" :key="index" :prop="item.prop" :label="item.label" :width="item.width"> | 
|               <template slot-scope="scope"> | 
|                 <template> | 
|                   <el-switch v-model="scope.row[item.prop]" :active-value="1" :inactive-value="0"> | 
|                   </el-switch> | 
|                 </template> | 
|               </template> | 
|             </el-table-column> | 
|           </template> | 
|           <template v-else> | 
|             <el-table-column v-if="item.visible" :key="index" :prop="item.prop" :label="item.label" :width="item.width"> | 
|             </el-table-column> | 
|           </template> | 
|         </template> | 
|         <el-table-column fixed="right" label="操作" width="100"> | 
|           <template slot-scope="scope"> | 
|             <el-button type="text" size="small" @click="deleteRow(scope.row, scope.$index)">删除</el-button> | 
|           </template> | 
|         </el-table-column> | 
|       </el-table> | 
|     </el-card> | 
|   | 
|     <el-dialog :visible.sync="dialogVisible" title="选择SKU" width="700px"> | 
|       <template> | 
|         <el-table :data="findProductList" class="scan-table" style="width: 100%" @row-click="rowClick" @row-dblclick="(row, column, event)=>{changeProduct(row)}"> | 
|           <el-table-column prop="productCode" label="物料编号" width="150"> | 
|           </el-table-column> | 
|           <!-- <el-table-column prop="productModel" label="条码" width="180"> | 
|           </el-table-column> --> | 
|           <el-table-column prop="productName" label="物料名称" width="160"> | 
|           </el-table-column> | 
|           <el-table-column prop="productSpec" label="物料规格"> | 
|           </el-table-column> | 
|           <el-table-column prop="smallUnit" label="库存单位"> | 
|           </el-table-column> | 
|           <el-table-column prop="validQty" label="有效库存"> | 
|           </el-table-column> | 
|           <el-table-column prop="inStorageDate" label="入库日期" width="130"> | 
|           </el-table-column> | 
|         </el-table> | 
|       </template> | 
|       <span slot="footer" class="dialog-footer"> | 
|         <el-button @click="dialogVisible = false">取 消</el-button> | 
|         <el-button type="primary" @click="changeProduct(multiProductSelected)">确 定</el-button> | 
|       </span> | 
|     </el-dialog> | 
|   | 
|      | 
|     <scan-setting-dialog ref="setting-dialog" :visible.sync="setting.visible" :fields="setting.fields" :name="setting.name"> | 
|     </scan-setting-dialog> | 
|   | 
|     <!--声音文件--> | 
|     <audio ref="sound_error" controls="controls" style="display:none;"> | 
|       <source src="@/assets/sounds/error2.mp3" type="audio/mpeg" /> | 
|     </audio> | 
|     <audio ref="sound_correct" controls="controls" style="display:none;"> | 
|       <source src="@/assets/sounds/feixin.mp3" type="audio/mpeg" /> | 
|     </audio> | 
|     <audio controls="controls" style="display:none;"> | 
|       <source ref="sound_scan" src="@/assets/sounds/saomiao.wav" type="audio/mpeg" /> | 
|     </audio> | 
|   | 
|   </div> | 
| </template> | 
|   | 
| <script> | 
| import YrtScanMixins from '@/components/common/yrtScanMixins.vue' | 
| import ScanSettingDialog from '@/components/common/components/scanSettingDialog.vue' | 
| var moment = require('moment') | 
|   | 
| // import { jsonp } from "restify"; | 
|   | 
| export default { | 
|   name: 'scan-purchase-noBillscan', | 
|   components: { | 
|     ScanSettingDialog | 
|   }, | 
|   mixins: [YrtScanMixins], | 
|   data() { | 
|     return { | 
|       disabled_extendField06:false,//初始化disabled_extendField06为启用状态 【EditBy shaocx,2022-08-29】 | 
|       containerType: [ | 
|         { | 
|           value: '1', | 
|           label: '小托盘' | 
|         }, | 
|         { | 
|           value: '3', | 
|           label: '大托盘' | 
|         } | 
|       ], | 
|       containerTypeTwo: [ | 
|         { | 
|           value: '1', | 
|           label: '小托盘' | 
|         }, | 
|         { | 
|           value: '3', | 
|           label: '大托盘' | 
|         } | 
|       ], | 
|       containerTypeOne: [ | 
|         { | 
|           value: '1', | 
|           label: '小托盘' | 
|         } | 
|       ], | 
|       srmOneContainerHeight: [ | 
|         { | 
|           value: '1', | 
|           label: '600' | 
|         }, | 
|         { | 
|           value: '2', | 
|           label: '600-750' | 
|         }, | 
|         { | 
|           value: '3', | 
|           label: '750-975' | 
|         }, | 
|         { | 
|           value: '4', | 
|           label: '975-1150' | 
|         }, | 
|         { | 
|           value: '5', | 
|           label: '1150-1350' | 
|         }, | 
|         { | 
|           value: '6', | 
|           label: '1350-1850' | 
|         } | 
|       ], | 
|       srmOneContainerHeights: [ | 
|         { | 
|           value: '1', | 
|           label: '600' | 
|         }, | 
|         { | 
|           value: '2', | 
|           label: '600-750' | 
|         }, | 
|         { | 
|           value: '3', | 
|           label: '750-975' | 
|         }, | 
|         { | 
|           value: '4', | 
|           label: '975-1150' | 
|         }, | 
|         { | 
|           value: '5', | 
|           label: '1150-1350' | 
|         }, | 
|         { | 
|           value: '6', | 
|           label: '1350-1850' | 
|         } | 
|       ], | 
|       srmTwoContainerHeight: [ | 
|         { | 
|           value: '1', | 
|           label: '600以下' | 
|         }, | 
|         { | 
|           value: '2', | 
|           label: '600-750' | 
|         }, | 
|         { | 
|           value: '3', | 
|           label: '750-1150' | 
|         }, | 
|         { | 
|           value: '4', | 
|           label: '1150-1350' | 
|         } | 
|       ], | 
|       plateType: '', | 
|       plateHeight: '', | 
|       formData: { | 
|         // 仓库ID | 
|         storage_Id: 87, | 
|         storageName: '立体库', | 
|         positionName: null, // 货位id | 
|         consignor_Id: null, | 
|         onsignorCode: null, | 
|         consignorName: null, | 
|         productModel: null, | 
|         productCode: null, | 
|         scanQty: null, | 
|         provider_Id: '', | 
|         providerCode: '', | 
|         providerShortName: '', | 
|         plateCode: null, | 
|         isBoosterArm: 0, // 是否需要助力臂,0=否,1=是 | 
|         quantity: null, | 
|         extendField06: null, | 
|         percentAge: 100 | 
|       }, | 
|       masterData: { | 
|         productCode: null | 
|       }, | 
|       searchData: { | 
|         plateCode: null, | 
|         positionName: null | 
|       }, | 
|   | 
|       tableDataSKU: [{}], | 
|       positionName: null, | 
|       // 供应商 | 
|       providerShortNames: null, | 
|       // 货主 | 
|       consignorNames: null, | 
|       // 仓库 | 
|       storageNames: null, | 
|       // 收货位候选项 | 
|       positionList: [], | 
|       // 是否展示SKU | 
|       showProduct: false, | 
|       dialogVisible: false, | 
|       // SKU列表 | 
|       findProductList: [], | 
|       // 明细数据 | 
|       tableData: [], | 
|       productData: [], | 
|       // 仓库信息 | 
|       storageInfo: {}, | 
|   | 
|       // 当前正在扫描的数据  {} | 
|       currentRow: null, | 
|       // 已经找到的数据 | 
|       existRows: [], | 
|       // 装箱方式:0:常规扫描,1:一品一箱,2:多品一箱 | 
|       caseMode: 0, | 
|       // 是否弹出一码多拍 | 
|       isCount: false, | 
|       // 一次扫描的数量 | 
|       scanCount: 1, | 
|       // 装箱新增行 | 
|       caseNewRows: [], | 
|       // 配置参数 | 
|       config: { | 
|         // 自动生成上架单 | 
|         in_generateShelve: true, | 
|         // 是否启用装箱操作 | 
|         in_caseNumber: false, | 
|         // 支持一品多码 | 
|         sku_productToMultiBarcode: true, | 
|         caseMode: 0 | 
|       }, | 
|       // 多个物料时需要选择一个物料 | 
|       multiProductSelected: {}, | 
|       productPosition_Id: null, | 
|   | 
|       // 扫描列设置对话框参数 | 
|       setting: { | 
|         visible: false, | 
|         name: 'scan-purchase-noBillscan', | 
|         fields: [ | 
|           { | 
|             prop: 'extendField06', | 
|             label: '标签条码', | 
|             visible: true, | 
|             width: 160, | 
|             order: 1 | 
|           }, | 
|           { | 
|             prop: 'productCode', | 
|             label: '物料编号', | 
|             visible: true, | 
|             width: 160, | 
|             order: 1 | 
|           }, | 
|           { | 
|             prop: 'productName', | 
|             label: '物料名称', | 
|             visible: true, | 
|             width: 180, | 
|             order: 4 | 
|           }, | 
|           { | 
|             prop: 'finishedQuantity', | 
|             label: '已扫描数量', | 
|             visible: true, | 
|             width: 130, | 
|             order: 9 | 
|           }, | 
|           { | 
|             prop: 'smallUnit', | 
|             label: '库存单位', | 
|             visible: true, | 
|             width: 90, | 
|             order: 10 | 
|           }, | 
|           { | 
|             prop: 'isBoosterArm', | 
|             label: '是否需要助力臂', | 
|             visible: true, | 
|             width: 145, | 
|             order: 6 | 
|           }, | 
|           { | 
|             prop: 'poCode', | 
|             label: '采购单号', | 
|             visible: true, | 
|             width: 110, | 
|             order: 6 | 
|           }, | 
|           { | 
|             prop: 'itemNumber', | 
|             label: '采购项号', | 
|             visible: true, | 
|             width: 100, | 
|             order: 6 | 
|           }, | 
|           { | 
|             prop: 'extendField04', | 
|             label: '跟踪号', | 
|             visible: true, | 
|             width: 110, | 
|             order: 7 | 
|           }, | 
|           { | 
|             prop: 'saleCode', | 
|             label: '销售单号', | 
|             visible: true, | 
|             width: 110, | 
|             order: 7 | 
|           }, | 
|           { | 
|             prop: 'extendField08', | 
|             label: '销售项号', | 
|             visible: true, | 
|             width: 100, | 
|             order: 7 | 
|           }, | 
|           { | 
|             prop: 'limitDate', | 
|             label: '到期日期', | 
|             visible: true, | 
|             width: 150, | 
|             order: 7 | 
|           }, | 
|           { | 
|             prop: 'totalWeight', | 
|             label: '重量', | 
|             visible: false, | 
|             width: 150, | 
|             order: 7 | 
|           } | 
|         ] | 
|       }, | 
|       multipleSelection: [], | 
|       currentPage: 1, // 初始页 | 
|       pagesize: 5, // 每页的数据 | 
|       isPlate: 0, // 判断是否为拼盘数据 | 
|       countPrint: 0 // 最大值 | 
|     } | 
|   }, | 
|   // 监听数据 | 
|   watch: { | 
|     // 当前行扫描数据改变后,将扫描数量也改变 | 
|     currentRow: { | 
|       handler: function(rowData) { | 
|         debugger | 
|         this.formData.scanQty = rowData.finishedQuantity | 
|       }, | 
|       deep: true | 
|     } | 
|   }, | 
|   mounted() { | 
|     this.$refs.plateCode.focus() | 
|     this.getStorageList() | 
|     // 字段设置 | 
|     const setting = localStorage[this.setting.name + '-setting'] | 
|     if (setting) { | 
|       this.setting.fields = JSON.parse(setting) | 
|     } | 
|     // 加载默认仓库的收货位 | 
|     this.getPositionName() | 
|     // this.selectContainerHeight(); | 
|   }, | 
|   methods: { | 
|     // 初始页currentPage、初始每页数据数pagesize和数据data | 
|     handleSizeChange: function(size) { | 
|       debugger | 
|       this.pagesize = size | 
|       console.log(this.pagesize) // 每页下拉显示数据 | 
|     }, | 
|     handleCurrentChange: function(currentPage) { | 
|       debugger | 
|       this.currentPage = currentPage | 
|       console.log(this.currentPage) // 点击第几页 | 
|     }, | 
|     callBigContainer() { | 
|       const url = '/api/task/callContainer' | 
|       const params = { | 
|         containerTypeId: 2 | 
|       } | 
|       var callback = res => { | 
|         if (res.result) { | 
|           this.storageNames = res.data | 
|         } | 
|       } | 
|       this.common.ajax(url, params, callback, true) | 
|     }, | 
|     callSmallContainer() { | 
|       const url = '/api/task/callContainer' | 
|       const params = { | 
|         containerTypeId: 1 | 
|       } | 
|       var callback = res => { | 
|         if (res.result) { | 
|           this.storageNames = res.data | 
|         } | 
|       } | 
|       this.common.ajax(url, params, callback, true) | 
|     }, | 
|     selectContainerHeight() { | 
|       const url = '/api/inbound/shelveStackingScan/isEquipment' | 
|       const params = {} | 
|       var callback = res => { | 
|         if (res.result) { | 
|           debugger | 
|           this.containerType = this.containerTypeTwo | 
|           if (this.plateType === '1') { | 
|             this.plateHeight = null | 
|             this.containerType = this.containerTypeTwo | 
|             this.srmOneContainerHeight = this.srmOneContainerHeights | 
|           } else { | 
|             this.plateHeight = null | 
|             this.containerType = this.containerTypeTwo | 
|             this.srmOneContainerHeight = this.srmTwoContainerHeight | 
|           } | 
|         } else { | 
|           this.containerType = this.containerTypeOne | 
|           this.srmOneContainerHeight = this.srmOneContainerHeights | 
|           this.$message.error(res.msg) | 
|         } | 
|       } | 
|       this.common.ajax(url, params, callback, true) | 
|     }, | 
|     // 获取仓库 | 
|     getStorageList() { | 
|       const url = '/api/basicInfo/base/storage/getList' | 
|       const params = {} | 
|       var callback = res => { | 
|         if (res.result) { | 
|           this.storageNames = res.data | 
|         } | 
|       } | 
|       this.common.ajax(url, params, callback, true) | 
|     }, | 
|     // 根据仓库获取货位 | 
|     getPositionName() { | 
|       var url = '/api/inbound/inScan/getPosition' | 
|       // 仓库 | 
|       for (var index3 in this.storageNames) { | 
|         if (this.storageNames[index3].storage_Id === this.formData.storage_Id) { | 
|           this.formData.storage_Id = this.storageNames[index3].storage_Id | 
|           this.formData.storageName = this.storageNames[index3].storageName | 
|         } | 
|       } | 
|       var params = { | 
|         openNodeApi: true, | 
|         storage_Id: this.formData.storage_Id | 
|       } | 
|       this.common.ajax( | 
|         url, | 
|         params, | 
|         res => { | 
|           if (res.result) { | 
|             this.storageInfo = res.data | 
|             this.positionList = res.dynamic | 
|             if (this.positionList.length) { | 
|               this.formData.positionName = this.positionList[0].positionName | 
|             } | 
|           } else { | 
|             this.storageInfo = {} | 
|             this.positionList = [] | 
|           } | 
|           // 收货位框获得焦点 | 
|           this.focus('plateCode') | 
|         }, | 
|         true | 
|       ) | 
|     }, | 
|     // 拍号回车 | 
|     plateCodeKeyup() { | 
|       // 条码框获得焦点 | 
|       this.$refs.productCode.focus() | 
|       this.$refs.productCode.select() | 
|     }, | 
|          getAttrValue(targetStr) { | 
|     let endStr = ''; | 
|     // let targetStr = str.replace(/\s/g,'')  | 
|     //字符串拆分数组 | 
|     const targetArr = targetStr.split(',') | 
|   return targetArr; | 
| }, | 
|     // 判断扫描包装条码 | 
|     checkPackingBarcode(evt) { | 
|       // let plateNumber = this.formData.extendField06; | 
|   | 
|       //此处支持二维码 【Editby shaocx,2023-11-15】 | 
|        var _qrCode=this.formData.extendField06; | 
|        if(_qrCode.length>12){ | 
|           var aa=this.getAttrValue(_qrCode); | 
|           if(aa.length!=7){ | 
|             this.$message.error('二维码格式不正确') | 
|             return | 
|           } | 
|           //赋值 | 
|           this.formData.extendField06=aa[6].replace(/^["']|["']$/g, '');//二维码GUID | 
|        } | 
|         | 
|   | 
|   | 
|       this.checkPackingProductModel(this.tableData, null, this.getProductInfo) | 
|       // if (plateNumber.length === 5) { | 
|       //   this.formData.plateCode = plateNumber; | 
|       // } | 
|       // this.formData.extendField06 = null; | 
|     }, | 
|     checkPackingCode() { | 
|       var extendField06 = this.formData.extendField06 | 
|       // if (!extendField06) { | 
|       //   this.$message.error("母托盘号不能为空!"); | 
|       //   return; | 
|       // } | 
|       this.tableData = [] | 
|   | 
|       const url = '/api/inbound/shelveStackingScan/getScanData' | 
|       const params = { | 
|         extendField06: extendField06 | 
|       } | 
|       var callback = res => { | 
|         if (res.result) { | 
|           this.tableData = res.data.map(row => { | 
|             debugger | 
|             const unFinishedQuantity = row.validQty | 
|             this.formData.storage_Id = row.storage_Id | 
|             this.formData.storageName = row.storageName | 
|             row.unFinishedQuantity = unFinishedQuantity | 
|             row.sortIndex = 0 | 
|             row.finishedQuantity = row.extendField02 | 
|             return row | 
|           }) | 
|         } else { | 
|           this.$message.error(res.msg) | 
|         } | 
|       } | 
|       this.common.ajax(url, params, callback, this.$refs['form']) | 
|     }, | 
|     isPalteJudge() { | 
|       var plateCode = this.formData.plateCode // 条码值 | 
|       plateCode = plateCode.trim() | 
|       this.formData.plateCode = plateCode | 
|       debugger | 
|       this.isPlate = 0 | 
|       var url = 'api/inbound/shelveStackingScan/isPlate' | 
|       var params = { | 
|         plateCode: this.formData.plateCode | 
|       } | 
|       this.common.ajax( | 
|         url, | 
|         params, | 
|         res => { | 
|           debugger | 
|           this.common.showMsg(res) | 
|           if (res.result) { | 
|             if (res.data != null) { | 
|               this.$message({ | 
|                 message: '该托盘已存在!', | 
|                 type: 'warning' | 
|               }) | 
|               return false | 
|             } | 
|           } | 
|         }, | 
|         true | 
|       ) | 
|     }, | 
|     // 获取物料信息 | 
|     getProductInfo() { | 
|       var _this=this; | 
|       this.disabled_extendField06=true //禁用控件 【EditBy shaocx,2022-08-29】 | 
|       //debugger | 
|       // 标签条码 | 
|       var extendField06 = this.formData.extendField06 | 
|       var extendField06Arr = Object.values(extendField06) | 
|       var extendField06Length = extendField06Arr.length | 
|       // 字符长度如果为5就获取器具的焦点 | 
|       if (extendField06Length === 5) { | 
|         // 器具框获得焦点 | 
|         // this.$refs.plateCode.focus(); | 
|         this.formData.plateCode = extendField06 | 
|         // this.$refs.this.formData.plateCode.select(); | 
|         this.disabled_extendField06=false //启用控件 【EditBy shaocx,2022-08-29】 | 
|         return | 
|       } | 
|       // var extendField06 = this.formData.extendField06; // 条码值 | 
|       extendField06 = extendField06.trim() | 
|       this.formData.extendField06 = extendField06 | 
|       if (!extendField06) { | 
|         this.$message({ | 
|           message: '条码值不能为空!', | 
|           type: 'warning' | 
|         }) | 
|         this.disabled_extendField06=false //启用控件 【EditBy shaocx,2022-08-29】 | 
|         return | 
|       } | 
|       this.findProductList = [] | 
|       var url = 'api/inbound/shelveStackingScan/getBufferProductInfo' | 
|       var params = { | 
|         extendField06: extendField06 | 
|       } | 
|   | 
|       this.common.ajax( | 
|         url, | 
|         params, | 
|         res => { | 
|           this.common.showMsg(res) | 
|           if (res.result) { | 
|             this.findProductList = res.data.map(row => { | 
|               debugger | 
|               // let unFinishedQuantity = row.validQty; | 
|               // let finishedQuantity = 0; | 
|               // // 不验证条码 | 
|               // if (!this.formData.isValidateProductCode) { | 
|               //   unFinishedQuantity = 0; | 
|               //   finishedQuantity = row.validQty; | 
|               //   row.scanWeight = row.totalWeight; | 
|               // } | 
|               // this.formData.storage_Id = row.storage_Id; | 
|               // this.formData.storageName = row.storageName; | 
|               // row.unFinishedQuantity = unFinishedQuantity; | 
|               row.finishedQuantity = row.quantity | 
|               if (row.limitDate) { | 
|                 row.limitDate = moment(row.limitDate).format('YYYY-MM-DD') | 
|               } | 
|               row.extendField06 = this.formData.extendField06 | 
|   | 
|               // this.countPrint = res.countPrint; | 
|               this.formData.scanQty = row.finishedQuantity | 
|               return row | 
|             }) | 
|             for (var index in this.findProductList) { | 
|               this.currentRow = this.findProductList[index] | 
|             } | 
|             debugger | 
|             this.$set(this.tableData, this.tableData.length, this.currentRow) | 
|             this.existRows.push(this.currentRow) | 
|             this.sortRow() | 
|           } else { | 
|             this.$refs.sound_error.play() // 播放声音 | 
|           } | 
|           this.disabled_extendField06=false //启用控件 【EditBy shaocx,2022-08-29】 | 
|         }, | 
|         true | 
|       ) | 
|     }, | 
|     // 选中行 | 
|     rowClick(row, column, event) { | 
|       this.multiProductSelected = row | 
|     }, | 
|     // 选择物料 | 
|     // changeProducts(row, column, event) { | 
|     //   // this.$message.error("选择物料"); | 
|     //   this.dialogVisible = false; | 
|     //   var positionName = this.formData.positionName; | 
|     //   // var productCode = this.formData.productCode; | 
|     //   // this.productPosition_Id = row.productPosition_Id; | 
|     //   var count = 1; | 
|     //   debugger; | 
|     //   if (this.isCount) { | 
|     //     for (var index in this.findProductList) { | 
|     //       if (this.findProductList[index].product_Id === row.product_Id) { | 
|     //         this.currentRow = this.findProductList[index]; | 
|     //         break; | 
|     //       } | 
|     //     } | 
|     //   } else { | 
|     //     for (var index1 in this.findProductList) { | 
|     //       if (this.findProductList[index1].product_Id === row) { | 
|     //         this.currentRow = this.findProductList[index1]; | 
|     //       } | 
|     //     } | 
|     //   } | 
|   | 
|     //   debugger; | 
|     //   this.$set(this.currentRow, "plateCode", this.formData.plateCode); | 
|     //   this.$set(this.currentRow, "positionName", positionName); | 
|     //   this.$set(this.currentRow, "finishedQuantity", this.currentRow.quantity); | 
|     //   this.$set(this.currentRow, "quantity", count); | 
|     //   this.$set(this.currentRow, "scanWeight", count * this.currentRow.weight); | 
|     //   this.$set(this.tableData, this.tableData.length, this.currentRow); | 
|     //   this.existRows.push(this.currentRow); | 
|     //   this.sortRow(); | 
|     //   this.showProduct = false; | 
|     // }, | 
|     // 选择物料 | 
|     // changeProduct(row, column, event) { | 
|     //   // this.$message.error("选择物料"); | 
|     //   this.dialogVisible = false; | 
|     //   var positionName = this.formData.positionName; | 
|     //   // var productCode = this.formData.productCode; | 
|     //   this.productPosition_Id = row.productPosition_Id; | 
|     //   var count = 1; | 
|     //   debugger; | 
|     //   if (this.isCount) { | 
|     //     for (var index in this.findProductList) { | 
|     //       if (this.findProductList[index].product_Id === row.product_Id) { | 
|     //         this.currentRow = this.findProductList[index]; | 
|     //         break; | 
|     //       } | 
|     //     } | 
|     //   } else { | 
|     //     for (var index1 in this.findProductList) { | 
|     //       if (this.findProductList[index1].product_Id === row) { | 
|     //         this.currentRow = this.findProductList[index1]; | 
|     //       } | 
|     //     } | 
|     //   } | 
|   | 
|     //   debugger; | 
|     //   this.$set(this.currentRow, "plateCode", this.formData.plateCode); | 
|     //   this.$set(this.currentRow, "positionName", positionName); | 
|     //   this.$set(this.currentRow, "finishedQuantity", row.validQty); | 
|     //   this.$set(this.currentRow, "quantity", count); | 
|     //   this.$set(this.currentRow, "scanWeight", count * this.currentRow.weight); | 
|     //   this.$set(this.tableData, this.tableData.length, this.currentRow); | 
|     //   this.existRows.push(this.currentRow); | 
|     //   this.sortRow(); | 
|     //   this.showProduct = false; | 
|     // }, | 
|     // 排序高亮行靠前 | 
|     sortRow() { | 
|       this.tableData.forEach(element => { | 
|         element.sortIndex = 0 | 
|       }) | 
|       this.currentRow.sortIndex = 1 | 
|       this.tableData = this.tableData.sort(function(a, b) { | 
|         return b.sortIndex - a.sortIndex | 
|       }) | 
|       this.tableData.forEach(element => { | 
|         element.sortIndex = 0 | 
|       }) | 
|     }, | 
|     // 确认入库 | 
|     saveCheck() { | 
|       if (!window.confirm('当前扫描要确认码盘吗?')) return | 
|       if (!this.formData.plateCode) { | 
|         this.$message.error('请输入码盘的母托盘号!') | 
|         return | 
|       } | 
|       var emptyPositionName = this.tableData.filter(item => item.product_Id && item.finishedQuantity > 0 && !item.positionName) | 
|       if (emptyPositionName.length) { | 
|         this.$message.error('条形码[' + emptyPositionName.join(',') + ']货位不能为空!') | 
|         this.$refs.sound_error.play() // 播放声音 | 
|         return | 
|       } | 
|       debugger | 
|       var dataList = this.tableData.filter(item => item.position_Id && item.finishedQuantity > 0).map(item => { | 
|         return { | 
|           storage_Id: 87, | 
|           storageName: '立体库', | 
|           product_Id: item.product_Id, | 
|           productCode: item.productCode, | 
|           productName: item.productName, | 
|           finishedQuantity: item.finishedQuantity, | 
|           positionName: item.positionName, | 
|           produceDate: item.produceDate, | 
|           purchasePrice: item.purchasePrice, | 
|           batchNumber: null, | 
|           productSpec: item.productSpec, | 
|           plateCode: item.plateCode, | 
|           enterMode: '', | 
|           isBoosterArm: item.isBoosterArm || 0, | 
|           quantity: item.quantity, | 
|           poCode: item.poCode, | 
|           extendField04: item.extendField04, | 
|           saleCode: item.saleCode, | 
|           itemNumber: item.itemNumber, | 
|           extendField08: item.extendField08, | 
|           limitDate: item.limitDate, | 
|           totalWeight: item.totalWeight, | 
|           extendField06: item.extendField06 | 
|         } | 
|       }) | 
|       debugger | 
|       var dataListss = this.tableData.filter(item => item.finishedQuantity > item.quantity) | 
|       const detailList = JSON.stringify( | 
|         dataListss.map(m => { | 
|           return { | 
|             poCode: m.poCode, | 
|             productCode: m.productCode, | 
|             number: m.finishedQuantity - m.quantity, | 
|             saleCode: m.saleCode, | 
|             trackting: m.extendField04 | 
|           } | 
|         }) | 
|       ) | 
|   | 
|       if (dataList.length === 0) { | 
|         this.$message.error('至少录入一条数据') | 
|         return | 
|       } | 
|        //console.log(datalist) | 
|       //增加对重复条形码的验证 【Editby shaocx,2022-08-27】 | 
|       for (var i=0; i<dataList.length; i++) { | 
|         for (var j=i+1; j<dataList.length; j++) { | 
|             if (dataList[i].extendField06 == dataList[j].extendField06) { | 
|                 this.$message.error('检测到列表中有重复的标签条码'+dataList[j].extendField06+',请重新刷新界面重新扫码!') | 
|                 return | 
|             } | 
|         } | 
|       } | 
|       //增加提示内容 【Editby shaocx,2022-08-27】 | 
|         var msg = '<strong>当前码盘上架共<span style="color:red;font-size:28px;">' + dataList.length + '</span>条物料明细,请确认数量是否跟现场实物一致</i>?,如果不一致请点取消按钮!</strong>'; | 
|         this.$confirm(msg, '询问', { dangerouslyUseHTMLString: true }).then(() => { | 
|           // this.srmOneContainerHeight; | 
|       // var obj = this.containerType.find(item => { | 
|       //   return item.value === this.plateType; | 
|       // }); | 
|       var url = 'api/inbound/shelveStackingScan/inStackingSave' | 
|       var params = { | 
|         datalist: dataList, | 
|         plateCode: this.formData.plateCode, | 
|         // plateHeight: this.plateHeight, | 
|         // plateType: obj, | 
|         percentAge: this.formData.percentAge, | 
|         productPosition_Id: this.productPosition_Id, | 
|         detailList: detailList, | 
|         shelveType: '码盘上架' | 
|       } | 
|       this.common.ajax( | 
|         url, | 
|         params, | 
|         res => { | 
|           this.common.showMsg(res) | 
|           if (res.result) { | 
|             this.onReset() | 
|             this.$refs.sound_correct.play() // 播放声音 | 
|           } else { | 
|             this.$refs.sound_error.play() // 播放声音 | 
|           } | 
|         }, | 
|         true | 
|       ) | 
|         }); | 
|     }, | 
|     onReset() { | 
|       this.formData = { | 
|         productCode: null, | 
|         plateCode: '', | 
|         scanQty: null, | 
|         provider_Id: '', | 
|         providerCode: '', | 
|         providerShortName: '', | 
|         storage_Id: 87, | 
|         storageName: '立体库', | 
|         percentAge: 100 | 
|       } | 
|       // 加载默认仓库的收货位 | 
|       this.getPositionName() | 
|       this.tableData = [] | 
|       // this.plateType = null; | 
|       // this.plateHeight = null; | 
|   | 
|       // this.selectContainerHeight(); | 
|     }, | 
|     // 删除明细 | 
|     deleteRow(row, index) { | 
|       debugger | 
|       // const arriveQuantity = row.arriveQuantity; | 
|       // const mainRow = this.tableData.find(item => item.isMain && item.orderList_Id === row.orderList_Id); | 
|       // mainRow.arriveQuantity += arriveQuantity; | 
|       // mainRow.unFinishedQuantity += arriveQuantity; | 
|       this.tableData.splice(index, 1) | 
|     } | 
|   } | 
| } | 
| </script> | 
|   | 
| <style lang="scss" scoped> | 
| @import '../../../styles/scan.scss'; | 
| </style> | 
| <style lang="css"> | 
| .row-active { | 
|   background-color: skyblue !important; | 
| } | 
| </style> | 
|   | 
| <style> | 
| .el-row { | 
|   margin-bottom: 20px; | 
|   &:last-child { | 
|     margin-bottom: 0; | 
|   } | 
| } | 
| .el-col { | 
|   border-radius: 4px; | 
| } | 
| .bg-purple-dark { | 
|   background: #99a9bf; | 
| } | 
| .bg-purple { | 
|   background: #d3dce6; | 
| } | 
| .bg-purple-light { | 
|   background: #e5e9f2; | 
| } | 
| .grid-content { | 
|   border-radius: 4px; | 
|   min-height: 36px; | 
| } | 
| .row-bg { | 
|   padding: 10px 0; | 
|   background-color: #f9fafc; | 
| } | 
| </style> |