<template>
|
<div class="scan-container">
|
<el-card class="scan-card">
|
<!-- <div slot="header" class="clearfix">
|
<span>拼盘上架</span>
|
</div>-->
|
<div slot="header" class="tuopan" >
|
<el-button type="primary" @click="callPlate">物料拼盘出库</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" @change="setScanQty"></el-input-number>
|
</span>
|
</el-form-item>
|
<el-form-item label="托盘号">
|
<el-input ref="plateCode" v-model="formData.plateCode" autofocus class="input-300" @change="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 label="托盘类型">
|
<el-select v-model="plateType" placeholder="请选择托盘类型" @change="selectContainerHeight">
|
<el-option v-for="item in containerType" :key="item.value" :label="item.label" :value="item.value">
|
</el-option>
|
</el-select>
|
</el-form-item> -->
|
<!-- <el-form-item label="测量高度">
|
<el-select v-model="plateHeight" placeholder="请选择测量高度">
|
<el-option v-for="item in srmOneContainerHeight" :key="item.value" :label="item.label" :value="item.label">
|
</el-option>
|
</el-select>
|
</el-form-item> -->
|
<!-- <el-form-item label="收货区">
|
<el-select ref="positionName" v-model="formData.positionName" placeholder="请选择收货位" class="input-300">
|
<el-option v-for="(item, index) in positionList" :key="index" :label="item.positionName" :value="item.positionName"></el-option>
|
</el-select>
|
</el-form-item> -->
|
<!-- <el-form-item label="单号">
|
<el-input ref="extendField06" v-model="formData.extendField06" autofocus class="input-300" @keyup.native.enter.stop="checkPackingCode"></el-input>
|
<span class="sub-item">
|
</span>
|
</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">
|
<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>
|
|
<el-dialog :visible.sync="dialogFormVisible" title="物料库存" width="1000px">
|
<el-row :gutter="20">
|
<el-col :span="6">
|
<el-input v-model="searchData.positionName" placeholder="请输入货位名称"></el-input>
|
</el-col>
|
<el-col :span="6">
|
<el-button @click="searchAll">搜索</el-button>
|
</el-col>
|
</el-row>
|
<template>
|
<el-table ref="multipleTable" :data="productData.slice(0,productData.length)" tooltip-effect="dark" border style="width: 100%" @selection-change="handleSelectionChange">
|
<el-table-column type="selection" width="55">
|
</el-table-column>
|
<el-table-column prop="productCode" label="零件编号" width="155">
|
</el-table-column>
|
<el-table-column prop="productName" label="零件姓名" width="155">
|
</el-table-column>
|
<el-table-column prop="plateCode" label="器具编号" width="90">
|
</el-table-column>
|
<el-table-column prop="productStorage" label="库存数量" width="90">
|
</el-table-column>
|
<el-table-column prop="smallUnit" label="库存单位" width="90">
|
</el-table-column>
|
<el-table-column prop="positionName" label="货位名称" width="105">
|
</el-table-column>
|
<el-table-column prop="poCode" label="采购单号" width="110">
|
</el-table-column>
|
<el-table-column prop="itemNumber" label="采购项号" width="90">
|
</el-table-column>
|
<el-table-column prop="saleCode" label="销售单号" width="110">
|
</el-table-column>
|
<el-table-column prop="extendField08" label="销售项号" width="90">
|
</el-table-column>
|
<el-table-column prop="extendField04" label="跟踪号" width="110">
|
</el-table-column>
|
<!-- <el-table-column prop="isBoosterArm" label="是否需要助力臂" width="130">
|
</el-table-column> -->
|
<el-table-column prop="limitDate" label="限用日期" width="160">
|
</el-table-column>
|
</el-table>
|
</template>
|
<el-pagination :total="productData.length" :page-size="pagesize" :current-page="currentPage" :page-sizes="[100, 10, 20, 40]" layout="total, sizes, prev, pager, next, jumper" @current-change="handleCurrentChange" @size-change="handleSizeChange">
|
</el-pagination>
|
<div slot="footer" class="dialog-footer">
|
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
<el-button type="primary" @click="addNewOrder">确 定</el-button>
|
</div>
|
</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
|
},
|
dialogFormVisible: false,
|
// 多个物料时需要选择一个物料
|
multiProductSelected: {},
|
productPosition_Id: null,
|
|
// 扫描列设置对话框参数
|
setting: {
|
visible: false,
|
name: 'scan-purchase-noBillscan',
|
fields: [
|
{
|
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: 'inStorageDate',
|
label: '入库日期',
|
visible: true,
|
width: 150,
|
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, // 每页的数据
|
countPrint: 0 // 最大值
|
}
|
},
|
// 监听数据
|
watch: {
|
// 当前行扫描数据改变后,将扫描数量也改变
|
currentRow: {
|
handler: function(rowData) {
|
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) {
|
|
//此处支持二维码 【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
|
}
|
//防呆 -ly
|
if(this.tableData.length>0){
|
let arrRes = this.tableData.filter((v)=>v.extendField06 == this.formData.extendField06);
|
if(arrRes.length>0){
|
this.focus("extendField06");
|
this.$message.warning(`此二维码已扫过!`)
|
return
|
}
|
}
|
this.checkPackingProductModel(this.tableData, null, this.getProductInfo)
|
},
|
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
|
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.commonLoadPlateDataToTable(res.data);
|
/*
|
this.$message({
|
message: '该托盘已存在!',
|
type: 'warning'
|
})
|
//*/
|
return false
|
}else{
|
}
|
}
|
},
|
true
|
)
|
},
|
// 获取物料信息
|
getProductInfo() {
|
this.disabled_extendField06=true //禁用控件 【EditBy shaocx,2022-08-29】
|
// 标签条码
|
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 //增加返回 【EditBy shaocx,2022-08-29】
|
}
|
// 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
|
}
|
//这个验证去掉 【Editby shaocx,2024-03-23】
|
/*
|
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
|
}
|
})
|
)
|
dataList = this.tableData
|
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++) {
|
//拼盘上架 单独过滤掉为NULL的,因为从db中获取的竟然不带extendField06 【Editby shaocx,2022-08-30】
|
if (dataList[i].extendField06!=null && dataList[j].extendField06!=null &&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 creator = localStorage.getItem("creator") || ''; //创建人
|
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: '拼盘上架',
|
creator:creator
|
}
|
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,
|
scanQty: null,
|
provider_Id: '',
|
providerCode: '',
|
providerShortName: '',
|
storage_Id: 87,
|
storageName: '立体库',
|
percentAge: 100
|
}
|
// 加载默认仓库的收货位
|
this.getPositionName()
|
this.tableData = []
|
// this.plateType = null;
|
// this.plateHeight = null;
|
|
// this.selectContainerHeight();
|
},
|
callPlate() {
|
this.dialogFormVisible = true
|
},
|
// 获取物料库存
|
productChange() {
|
// 通过物料编号查找库存物料
|
var productCode = this.masterData.productCode
|
|
var url = '/api/inbound/shelveStackingScan/getProduct'
|
var params = {
|
productCode: productCode
|
}
|
this.common.ajax(url, params, res => {
|
this.common.showMsg(res)
|
if (res.result) {
|
//debugger
|
this.productData = res.data
|
}
|
})
|
},
|
// 新建确认事件
|
addNewOrder() {
|
//debugger
|
// 获得已选中的ID
|
const ids = this.multipleSelection.map((item, index, Array) => {
|
return this.productData // item.productPosition_Id;
|
})
|
// if (ids.length !== 1) {
|
// this.$message({
|
// message: "请选中一行!",
|
// type: "warning"
|
// });
|
// return; //productData
|
// }
|
var dataList = this.multipleSelection.filter(item => item.productStorage > 0)
|
const detailList = dataList[0].positionName
|
var url = '/api/task/productSend';
|
var creator = localStorage.getItem("creator") || ''; //创建人
|
var params = {
|
creator:creator,
|
detailList: detailList
|
}
|
this.common.ajax(
|
url,
|
params,
|
res => {
|
//this.common.showMsg(res)
|
if (res.result) {
|
//this.dataList.reload()
|
this.$message.success('请求成功!')
|
}else{
|
this.$message.error(res.msg)
|
}
|
},
|
true
|
)
|
this.dialogFormVisible = false
|
////debugger
|
this.commonLoadPlateDataToTable(this.multipleSelection);
|
},
|
// 公共 将托盘上的库存装载到列表中
|
commonLoadPlateDataToTable(listData){
|
this.tableData = listData
|
this.formData.plateCode = listData[0].plateCode
|
let i = 0
|
this.tableData = this.tableData.map(row => {
|
//debugger
|
row.finishedQuantity = listData[i].productStorage
|
i++
|
return row
|
})
|
},
|
handleSelectionChange(val) {
|
//debugger
|
this.multipleSelection = val
|
},
|
// 搜索
|
searchAll() {
|
var positionName = this.searchData.positionName
|
////debugger
|
//console.log(positionName)
|
//console.log(positionName === '')
|
//return
|
if (positionName === null) {
|
this.$message.warning('货位名称不能为空')
|
this.productData =[]
|
return
|
}
|
if (positionName.trim() === '') {
|
this.$message.warning('货位名称不能为空')
|
this.productData =[]
|
return
|
}
|
var url = '/api/inbound/shelveStackingScan/searchApi'
|
var params = {
|
positionName: positionName
|
}
|
this.common.ajax(url, params, res => {
|
this.common.showMsg(res)
|
if (res.result) {
|
this.productData = res.data
|
this.$nextTick(() => {
|
this.productData.forEach(row => {
|
//debugger
|
this.$refs.multipleTable.toggleRowSelection(row, true) //productPosition_Id
|
})
|
})
|
} else {
|
this.$message.error('当前条件找不到数据,该库位可能无货、被锁定、库位不可用')
|
this.productData =[]
|
}
|
})
|
},
|
// 删除明细
|
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>
|