Files

5993 lines
205 KiB
Vue
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<view class="z-application-content">
<view class="header-top">
<view class="header-top-organzie" style="">
<text class="header-row-title-class">当前组织</text>
<view class="header-top-organzie-select">
<picker @change="orgChange" :value="index" :range="orgArry" range-key="FNAME" style="width: 100%;">
<view class="header-top-organzie-content">{{orgArry[index].FNAME}}</view>
</picker>
</view>
<image class="header-top-organzie-img" src="@/static/login/icon-pull.png"/>
</view>
<view class="header-top-date">
<view class="header-top-data-select" @click="creatDatePicker()">{{creatlist[0].detail}}</view>
<!-- <image class="" src="@/static/login/icon-pull.png" style="height: 32rpx;width: 32rpx;padding-left: 10rpx;position: absolute;right: 0;"></image> -->
<date-time-picker ref='creatTime' :indicatorStyle='indicatorStyle' :type='type' :datestring='dateString'
@change='creatTimeChange'>
</date-time-picker>
</view>
</view>
<view >
<view class="header-row-class">
<p class="header-row-title-class">源单类型</p>
<xfl-select :list="billTypeDefaultList" :listOrigin="billTypeDefaultList" :clearable="false" :showItemNum="5" :isCanInput="false" ref="billTypeList"
@change="billTypeChange" v-model="currentBarCodeInfo.FSourceBillTypeName" @clear="billTypeClear"
class="header-row-select-class" :focus="billTypeFocus" :defaultSelectText="billTypeSelectText" />
</view>
<view class="header-row-class">
<p class="header-row-title-class">源单编号</p>
<view style="flex: 1 1;">
<input type="text" style="font-size: 32rpx;" :class="[sourceBillNoDisable?'header-row-input-gray-class':'header-row-input-white-class']"
v-model="currentBarCodeInfo.FSourceBillNo" :disabled="sourceBillNoDisable" :focus="sourceBillNoFocus"
@confirm="sourceBillNoInfoConfirm" :key="key" />
</view>
<image src="../../../static/img/scan-blue.png" v-show="showScan && !sourceBillNoDisable" @click="scan('sourceBillScan')" />
</view>
<view class="header-row-class" v-if="currentTranType == 'STK_MisDelivery' || currentTranType == 'STK_MisCellaneous'">
<p class="header-row-title-class">单据类型</p>
<xfl-select :list="orderTypeList" :listOrigin="orderTypeList" :clearable="false" :showItemNum="5"
@change="orderTypeChange" :isCanInput="false" ref="orderTypeList"
class="header-row-select-class" :defaultSelectText="orderTypeSelectText" />
</view>
<view class="detail-row-class" v-if="(currentTranType == 'STK_MisDelivery' || currentTranType == 'STK_MisCellaneous') && ownerTypeShow">
<p class="detail-row-title-class">货主类型</p>
<xfl-select :list="ownerTypeList" :listOrigin="ownerTypeList" :clearable="false" :showItemNum="5"
@change="ownerTypeChange" :isCanInput="false" ref="ownerTypeList" :disabled='yesTableData.length > 0'
class="header-row-select-class" :defaultSelectText="ownerTypeSelectText" />
</view>
<view class="detail-row-class" v-if="(currentTranType == 'STK_MisDelivery' || currentTranType == 'STK_MisCellaneous') && ownerTypeShow">
<p class="detail-row-title-class">货主</p>
<xfl-select :list="ownerOrgList" :listOrigin="ownerOrgList" :clearable="false" :showItemNum="5" @change="ownerOrgChange"
:isCanInput="false" ref="ownerOrgArryList" class="header-row-select-class" :defaultSelectText="ownerOrgSelectText"
v-show="FOWNERTYPEID == 'ORG_Organizations'" :disabled='yesTableData.length > 0' />
<zxz-uni-data-select v-model="FOWNERID" class="header-row-select-class" filterable :localdata="supplierInfoList" dataKey="FNAME"
dataValue="FID" placeholder="" @change="ownerSupplierChange" v-show="FOWNERTYPEID == 'BD_SUPPLIER'" :disabled='yesTableData.length > 0' />
<zxz-uni-data-select v-model="FOWNERID" class="header-row-select-class" filterable :localdata="customerInfoList" dataKey="FNAME"
dataValue="FID" placeholder="" @change="ownerCustomerChange" v-show="FOWNERTYPEID == 'BD_CUSTOMER'" :disabled='yesTableData.length > 0' />
</view>
<!-- <view class="header-row-class" v-if="currentTranType == 'STK_MisDelivery'">
<p class="header-row-title-class">研发项目</p>
<xfl-select :list="developList" :listOrigin="developList" :clearable="false" :showItemNum="5"
@change="developChange" :isCanInput="false" ref="developList"
class="header-row-select-class" :defaultSelectText="developSelectText" />
</view> -->
<view class="header-row-class" v-if="isShowBillRowNo">
<p class="header-row-title-class">源单行号</p>
<view style="flex: 1 1; position: relative;" @click="confirmDialog()" v-if="currentBarCodeInfo.FSourceBillTypeName === '生产任务单'">
<input type="text" class="header-row-input-white-class" :disabled="true" v-model="RowNo" />
<image class="image-barcode" src="../../../static/img/fangdajing.svg" />
</view>
<view style="flex: 1 1; position: relative;" v-else>
<input type="text" class="header-row-input-gray-class" :disabled="true" v-model="RowNo" />
<image class="image-barcode" src="../../../static/img/fangdajing.svg" />
</view>
</view>
<view class="header-row-class">
<text decode="true" class="header-row-title-class">{{fNameTitle0}}</text>
<xfl-select :list="headerFNameList0" :listOrigin="headerFNameList0" :clearable="false"
:showItemNum="5" :isCanInput="true"
@change="deptChange0" class="header-row-select-class" ref="FNameList0"
:disabled="deptDisabled" :focus="deptFocus" />
</view>
<view class="header-row-class" v-if="(currentTranType == 'SP_PickMtrl') || (currentTranType == 'SP_ReturnMtrl')">
<text class="header-row-title-class">生产编号</text>
<view style="flex: 1 1;">
<input type="text" style="font-size: 32rpx;" class="header-row-input-white-class"
v-model="productBarCode" @confirm="productBarCodeConfirm" :focus="productBarCodeFocus"/>
</view>
<image src="../../../static/img/scan-blue.png" @click="scan('productBarCode')" />
</view>
<view class="header-row-class" v-if="(currentTranType == 'SP_PickMtrl') || (currentTranType == 'SP_ReturnMtrl')">
<text class="header-row-title-class">生产对象</text>
<view style="flex: 1 1;">
<input type="text" style="font-size: 32rpx;" class="header-row-input-white-class"
v-model="productInfo" @confirm="productInfoConfirm" :focus="productInfoFocus"/>
</view>
</view>
<view class="header-row-class" v-if="fNameSelectShow1">
<text decode="true" class="header-row-title-class">{{fNameTitle1}}</text>
<xfl-select :list="headerFNameList1" :listOrigin="headerFNameList1" :clearable="false"
:showItemNum="5" :isCanInput="true"
@change="deptChange1" class="header-row-select-class" ref="FNameList1" :disabled="deptDisabled" />
</view>
<view class="header-row-class" v-if="currentTranType == 'STK_MisDelivery' || currentTranType == 'STK_MisCellaneous'
|| currentTranType == 'SP_InStock'">
<p class="header-row-title-class">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注</p>
<view style="flex: 1 1;">
<input type="text" style="font-size: 32rpx;" class="header-row-input-white-class"
v-model="note" @confirm="noteConfirm" :focus="noteFocus"/>
</view>
</view>
</view>
<view style="height: 32rpx;" />
<view class="separate" />
<!-- <view style="height: 20rpx;"></view> -->
<view class="detail-tabs-class">
<!-- 正操作 -->
<view @tap="tabChange(4)" :class="[detailTabIndex==4?'detail-tabs-btn-gray-class':'detail-tabs-btn-handle-class']">正操作</view>
<view style="border-left-width:1.5px; border-left-color: #E5E5E5; border-left-style: solid; height:40rpx; flex-grow: 0; flex-shrink: 0;"></view>
<!-- 源单 -->
<view @tap="tabChange(1)" :class="[detailTabIndex==1?'detail-tabs-btn-gray-class':'detail-tabs-btn-base-class']">源单</view>
<view style="border-left-width:1.5px; border-left-color: #E5E5E5; border-left-style: solid; height:40rpx; flex-grow: 0; flex-shrink: 0;" />
<!-- 已扫描 -->
<view @tap="tabChange(3)" :class="[detailTabIndex==3?'detail-tabs-btn-gray-class':'detail-tabs-btn-yes-class']">已扫描</view>
<view style="border-left-width:1.5px; border-left-color: #E5E5E5; border-left-style: solid; height:40rpx; flex-grow: 0; flex-shrink: 0;" />
<!-- 汇总 -->
<view @tap="tabChange(2)" :class="[detailTabIndex==2?'detail-tabs-btn-gray-class':'detail-tabs-btn-total-class']">汇总</view>
<view style="border-left-width:1.5px; border-left-color: #E5E5E5; border-left-style: solid; height:40rpx; flex-grow: 0; flex-shrink: 0;" v-if="bluetoothSwitch || printSwitch"/>
<view @tap="tabChange(5)" :class="[detailTabIndex==5?'detail-tabs-btn-gray-class':'detail-tabs-btn-total-class']" v-if="bluetoothSwitch || printSwitch">已拆分</view>
<view style="border-left-width:1.5px; border-left-color: #E5E5E5; border-left-style: solid; height:40rpx; flex-grow: 0; flex-shrink: 0;" v-if="bluetoothSwitch || printSwitch" />
<view @tap="tabChange(6)" :class="[detailTabIndex==6?'detail-tabs-btn-gray-class':'detail-tabs-btn-total-class']" v-if="printSwitch">打印</view>
<view style="border-left-width:1.5px; border-left-color: #E5E5E5; border-left-style: solid; height:40rpx; flex-grow: 0; flex-shrink: 0;" v-if="bluetoothSwitch && printSwitch" />
<view @tap="tabChange(7)" :class="[detailTabIndex==7?'detail-tabs-btn-gray-class':'detail-tabs-btn-total-class']" v-if="bluetoothSwitch">蓝牙</view>
</view>
<!-- <view style="height: 32rpx;"></view> -->
<view class="detail-row-class" v-if="detailTabIndex==4">
<p class="detail-row-title-class">条&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 码</p>
<view style="flex: 1 1;">
<input class="detail-row-white-class" type="text" @confirm="barcodeConfirm()"
v-model="FBarcodeNumber" :focus="barcodeNumberFcous" @tap="showBarcodeNumberFcous" :key="key"/>
</view>
<image src="../../../static/img/scan-blue.png" v-show="showScan" @click="scan('barCodeScan')" />
</view>
<view class="detail-row-class" v-if="detailTabIndex==4">
<p class="detail-row-title-class">数&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 量</p>
<view style="flex: 1 1; display: flex; flex-direction: row;">
<input type="text" v-model="currentBarCodeInfo.FQty" @confirm="QtyConfirm()" :focus="QtyFocus"
:disabled="barcodeQtyDisabled" :class="[!barcodeQtyDisabled?'detail-row-white-class':'detail-row-gray-class']"
style="width:300rpx; margin-right:20rpx;"/>
<view style="height:60rpx; line-height:60rpx;">{{currentBarCodeInfo.FUNITNAME}}</view>
</view>
</view>
<view class="header-row-class" v-show="detailTabIndex==4 && stockStatus">
<p class="header-row-title-class">库存状态</p>
<xfl-select :list="stockStatusList" :listOrigin="stockStatusList" :clearable="false" :showItemNum="5"
@change="stockStatusChange" :isCanInput="false" ref="stockStatusList"
class="header-row-select-class" :defaultSelectText="stockStatusSelectText" />
</view>
<!-- 入库类型 外购入库专用 -->
<view class="header-row-class" v-show="detailTabIndex==4&&currentTranType=='STK_InStock'">
<p class="header-row-title-class">入库类型</p>
<xfl-select :list="storeType" :listOrigin="storeType" :clearable="false" :showItemNum="5"
@change="storeTypeChange" :isCanInput="false" ref="storeType"
class="header-row-select-class" :defaultSelectText="storeTypeSelectText" />
</view>
<view class="detail-row-class" v-if="isShowStock & detailTabIndex==4">
<p class="detail-row-title-class">存放位置</p>
<view style="flex: 1 1;">
<input :key="key" class="detail-row-white-class" v-model="currentBarCodeInfo.FLocation"
@confirm="locationConfirm()" :focus="locationFocus" />
</view>
<image src="../../../static/img/scan-blue.png" v-show="showScan && isShowStock" @click="scan('StockScan')" />
</view>
<view class="detail-row-class-b" v-show="detailTabIndex==4 && isShowRBMaterial">
<p class="detail-row-title-class-b">退料类型</p>
<view style="width: 24rpx;" />
<xfl-select :list="backResonList" :listOrigin="backResonList" :clearable="false" :showItemNum="5" :isCanInput="false" ref="backResonList"
@change="backResonChange" style="font-size: 32rpx;"
class="detail-row-white-class-b" :defaultSelectText="backResonSelectText"/>
</view>
<view class="detail-row-class"
v-if="detailTabIndex == 4 && (currentTranType == 'SP_PickMtrl' || currentTranType == 'STK_MisDelivery'||
currentTranType == 'PRD_PickMtrl' || currentTranType == 'PRD_FeedMtrl')">
<p class="detail-row-title-class">领用数量</p>
<view style="flex: 1 1;">
<input type="number" v-model="currentBarCodeInfo.FSplitQty" @confirm="SplitQtyConfirm()"
:focus="splitQtyFocus" :class="[splitQtyDisabled?'detail-row-gray-class':'detail-row-white-class']"
:disabled="splitQtyDisabled"/>
</view>
</view>
<view class="detail-row-class" v-if="detailTabIndex==4">
<p class="detail-row-title-class">物料代码</p>
<view style="flex: 1 1;">
<input class="detail-row-gray-class" disabled="true" type="text" v-model="currentBarCodeInfo.FItemNumber" />
</view>
<view style="flex: 1 1;">
<view class="detail-row-white-class-stock" @click="timeStock">
即时库存
</view>
</view>
</view>
<!-- 辅助单位数量 外购入库&生产领料显示-->
<view class="detail-row-class" v-if="detailTabIndex==4">
<p class="detail-row-title-class">辅助数量</p>
<view v-if="currentTranType == 'STK_MisCellaneous'" style="flex: 1 1; display: flex; flex-direction: row;">
<input type="number" v-model="FSECUNITQTY" @confirm="FSECUNITQTYConfirm()"
:disabled="!FISSECUNIT" :focus="FSECUNITQTYFocus"
:class="[FISSECUNIT?'detail-row-white-class':'detail-row-gray-class']"
style="width:300rpx; margin-right:20rpx;"/>
<!-- 其他入库增加辅助数量单位 -->
<view style="height:60rpx; line-height:60rpx;">{{currentBarCodeInfo.FSECUNITNAME}}</view>
</view>
<view v-else style="flex: 1 1">
<input type="number" v-model="FSECUNITQTY" @confirm="FSECUNITQTYConfirm()"
:disabled="!FISSECUNIT" :focus="FSECUNITQTYFocus"
:class="[FISSECUNIT?'detail-row-white-class':'detail-row-gray-class']"/>
</view>
</view>
<view class="detail-row-class" v-if="detailTabIndex==4">
<p class="detail-row-title-class">箱&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 数</p>
<view style="flex: 1 1;">
<input type="number" v-model="currentBarCodeInfo.FBoxQty" @confirm="BoxConfirm()"
:disabled="barcodeQtyDisabled" :focus="BoxFocus"
:class="[!barcodeQtyDisabled?'detail-row-white-class':'detail-row-gray-class']"/>
</view>
</view>
<view v-if="!isShowStock & detailTabIndex==4">
<view class="detail-row-class">
<p class="detail-row-title-class">仓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 库</p>
<view style="flex: 1 1;">
<input :key="key" class="detail-row-white-class" v-model="currentBarCodeInfo.FSCStockNumber"
@confirm="FSCStockNumberConfirm()" :focus="FSCStockNumberFocus" />
</view>
<image src="../../../static/img/scan-blue.png" v-show="showScan && !isShowStock" @click="scan('stockStorScan')" />
</view>
<view class="detail-row-class">
<p class="detail-row-title-class">仓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 位</p>
<view style="flex: 1 1;">
<input :key="key" :class="[!stockDisabled?'detail-row-white-class':'detail-row-gray-class']"
v-model="currentBarCodeInfo.FSCSPNumber" :disabled="stockDisabled"
@confirm="FSCSPNumberConfirm()" :focus="FSCSPNumberFocus" />
</view>
<image src="../../../static/img/scan-blue.png" v-show="showScan && !isShowStock && !stockDisabled" @click="scan('stockPlaceScan')" />
</view>
</view>
<view v-if="currentTranType != 'STK_MisDelivery'">
<view class="detail-row-class" v-if="detailTabIndex==4">
<p class="detail-row-title-class">物料名称</p>
<view style="flex: 1 1;">
<input class="detail-row-gray-class" disabled="true" v-model="currentBarCodeInfo.FItemName" />
</view>
</view>
<view class="detail-row-class" v-if="detailTabIndex==4">
<p class="detail-row-title-class">规格型号</p>
<view style="flex: 1 1;">
<input class="detail-row-gray-class" disabled="true" v-model="currentBarCodeInfo.FModel" />
</view>
</view>
<view class="detail-row-class" v-if="detailTabIndex==4">
<p class="detail-row-title-class">辅助属性</p>
<view style="flex: 1 1;">
<input class="detail-row-gray-class" disabled="true" v-model="currentBarCodeInfo.FAuxPropName" />
</view>
</view>
<view class="detail-row-class" v-if="detailTabIndex == 4">
<p class="detail-row-title-class">批&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 号</p>
<view style="flex: 1 1;">
<input class="detail-row-gray-class" disabled="true" v-model="currentBarCodeInfo.FLOT" />
</view>
</view>
</view>
<!--其他出库,生产领料,沛嘉-->
<!-- <view v-if="detailTabIndex == 4 && currentTranType == 'STK_MisDelivery'">
<view style="height: 15rpx;" />
<view class="separate" />
<view class="detail-row-class">
<p class="detail-row-title-class" style="width:220rpx;font-weight: 700;">源单拣货</p>
<view style="flex-grow: 2;" />
<view style="flex: 1 1; display: flex; flex-direction: row; align-items: center;
justify-content: center;">
<view :class="[billPreviousDisable?'bill-next-button-disable':'bill-next-button']" @tap="billPreviousClick()">上一条</view>
<view style="flex-grow: 1; width: 60rpx;" />
<view :class="[billNextDisable?'bill-next-button-disable':'bill-next-button']" @tap="billNextClick()">下一条</view>
</view>
</view>
<view class="detail-row-class" v-if="detailTabIndex == 4">
<p class="detail-row-title-class">物料代码</p>
<view style="flex: 1 1;">
<input class="detail-row-gray-class" disabled="true" type="text" v-model="billFITEMNUMBER" />
</view>
</view>
<view class="detail-row-class" v-if="detailTabIndex == 4">
<p class="detail-row-title-class">物料名称</p>
<view style="flex: 1 1;">
<input class="detail-row-gray-class" disabled="true" v-model="billFITEMNAME" />
</view>
</view>
<view class="detail-row-class" v-if="detailTabIndex == 4">
<p class="detail-row-title-class">领用数量</p>
<view style="flex: 1 1; display: flex; flex-direction: row;">
<input type="text" v-model="billFREMINANQTY" disabled="true" class="detail-row-gray-class"
style="width:300rpx; margin-right:20rpx;"/>
<view style="height:60rpx; line-height:60rpx;">{{billFUNITNAME}}</view>
</view>
</view>
<view class="detail-row-class" v-if="detailTabIndex == 4">
<p class="detail-row-title-class">规格型号</p>
<view style="flex: 1 1;">
<input class="detail-row-gray-class" disabled="true" v-model="billFSPECIFICATION" />
</view>
</view>
<view class="detail-row-class" v-if="detailTabIndex == 4">
<p class="detail-row-title-class">辅助属性</p>
<view style="flex: 1 1;">
<input class="detail-row-gray-class" disabled="true" v-model="billFAUXPROPNAME" />
</view>
</view>
<view class="detail-row-class" v-if="detailTabIndex == 4">
<p class="detail-row-title-class">批&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 号</p>
<view style="flex: 1 1;">
<input class="detail-row-gray-class" disabled="true" v-model="billFLOT" />
</view>
</view>
<view class="detail-row-class" v-if="detailTabIndex == 4">
<p class="detail-row-title-class">仓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 库</p>
<view style="flex: 1 1;">
<input class="detail-row-gray-class" disabled="true" type="text" v-model="billFSTOCKNAME" />
</view>
</view>
<view class="detail-row-class" v-if="detailTabIndex == 4">
<p class="detail-row-title-class">仓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 位</p>
<view style="flex: 1 1;">
<input class="detail-row-gray-class" disabled="true" type="text" v-model="billFSTOCKLOCNAME" />
</view>
</view>
</view> -->
<!--源单信息-->
<view class="table" v-if="detailTabIndex==1" style="padding-bottom: 100rpx;">
<z-table :tableData='baseTableData' :columns='baseColumns' />
</view>
<!--汇总-->
<view class="table" v-if="detailTabIndex==2" style="padding-bottom: 100rpx;">
<z-table :tableData='totalTableData' :columns='totalColumns' />
</view>
<view class="table" v-show="detailTabIndex==3" style="padding-bottom: 100rpx;">
<z-table :tableData='yesTableData' :columns='yesColumns' showSelect @onSelect='tableSelect' />
</view>
<view @click="closedPopup" v-if="isClosedPopup">
<uni-popup ref="dialogInput" type="dialog" @change="change">
<uni-popup-dialog mode="input" title="输入内容" value="对话框预置提示内容!" placeholder="请输入内容" @confirm="dialogInputConfirm"
:baseTableData='RowNoTableData' />
</uni-popup>
</view>
<view class="table" v-show="detailTabIndex==5" style="padding-bottom: 100rpx;">
<z-table :tableData='barcodeTableData' :columns='barcodeColumns'
emptyText='设置了showLoading=false才会看到我' showSelect @onSelect='barcodeSelect' />
</view>
<view class="table" v-show="detailTabIndex==5 || detailTabIndex==3">
<button class="button-class" @tap="printBarcode()" :disabled="printList.length == 0"
:style="{'background-color': (printList.length == 0 ? '#808080' : '')}" v-if="printSwitch">普通打印</button>
<button class="button-class" @tap="bluePrintBarcode()" :disabled="printList.length == 0"
:style="{'background-color': (printList.length == 0 ? '#808080' : '')}" v-if="bluetoothSwitch">蓝牙打印</button>
</view>
<view class="header-row-btn-class" v-show="(showResult || detailTabIndex != 3) && (detailTabIndex != 5)
&& (detailTabIndex != 6) && (detailTabIndex != 7)">
<view :class="[detailTabIndex==4 ? 'header-row-btn-class-commit' : 'commitBtnOther']"
@click="commitBtnClick()" :disabled="isCommitBtnDisable">提交</view>
<view class="header-row-btn-class-clear" @click="clearBtnClick" v-show="detailTabIndex==4">清空</view>
</view>
<view class="header-row-btn-class-del" @click="delBtnClick" v-show="!showResult & detailTabIndex==3">删除</view>
<!-- <view class="pic-upload" v-if="isShowPUpload" @click="uploadPic">
<view class="pic-upload-text">图片</view>
<view class="pic-upload-text">上传</view>
</view> -->
<view class="alter" v-if="showErrTips" @click="hideErrTips" />
<view class="err" v-if="showErrTips">
<view class="errTitle">温馨提示</view>
<scroll-view scroll-y="true" style="height: 400rpx;">
<view class="errList" v-for="(item,index) in errDetailsList">
<view class="errDetails">{{errDetailsList[index]}}</view>
</view>
</scroll-view>
<view style="height: 20rpx;" />
<view class="errConfirm" @click="hideErrTips">确定</view>
</view>
<view v-show="detailTabIndex==6">
<NetworkPrintTab :prgkey="currentTranType" ref="networkPrintTab"
:orgId="orgFItemID" :baseUrl="baseUrl"/>
</view>
<view v-show="detailTabIndex==7">
<BluetoothPrintTab ref="bluetoothPrintTab" :currentTranType = 'currentTranType'/>
</view>
<!-- <view class="alter" v-show="showCashTips"></view>
<view class="err" v-show="showCashTips">
<view class="errTitle">温馨提示</view>
<view class="errList">
<view class="errDetails">当前页面存在未提交数据,是否需要加载</view>
</view>
<view style="height: 20rpx;"></view>
<view class="cash-btn">
<view class="cashConfirm" @click="comfirmHideCashTips">确定</view>
<view class="cashCancel" @click="cancelHideCashTips">取消</view>
</view>
</view> -->
<opsoft-dialog-notice
:dialogNoticeShow="showDialog"
:dialogNoticeType="dialogNoticeType"
:dialogNoticeTitle="dialogNoticeTitle"
:dialogNoticeContent="dialogNoticeContent"
@dialogNoticeConfirmClick="dialogNoticeConfirmClick"
>
</opsoft-dialog-notice>
<opsoft-dialog
@dialogCancelClick="dialogCancelClick"
@dialogConfirmClick="dialogConfirmClick"
:dialogContent="dialogContent"
:dialogTitle="dialogTitle"
:dialogShow="dialogShow"
></opsoft-dialog>
</view>
</template>
<script>
import Vue from 'vue';
import zTable from "@/components/z-table/z-table.vue";
import uniTag from "@/components/uni-badge/uni-badge.vue";
import xflSelect from '@/components/xfl-select/xfl-select.vue';
import uniPopupDialog from '@/components/uni-popup/uni-popup-dialog.vue';
import BluetoothPrintTab from '@/components/bluetooth-print-tab/bluetooth-print-tab.vue';
import NetworkPrintTab from '@/components/network-print-tab/network-print-tab.vue';
import DateTimePicker from '@/components/bory-dateTimePickerWithOutTime/bory-dateTimePickerWithOutTime.vue';
const commonUtil = require('@/common/util.js');
const qtyControlUtil = require('@/common/qtyControl.js');
import opsoftDialogNotice from '@/components/opsoft-dialog-notice/opsoft-dialog-notice.vue';
import opsoftDialog from '@/components/opsoft-dialog/opsoft-dialog.vue'
import errorStrUntil from '@/common/errorStrUntil.js';
import {
mapState,
mapMutations
} from 'vuex';
var _self;
export default {
data() {
return {
currentTranType: 'STK_MisCellaneous',
fNameArray: [{headerFID:"FDeptID", headerFName:"部&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;门"},
{headerFID:"FSupplyID", headerFName:"供&nbsp;&nbsp;应&nbsp;&nbsp;商"}],
storeType: [],
ownerTypeList: [{id:'ORG_Organizations', value:'业务组织'},
{id:'BD_SUPPLIER', value:'供应商'},
{id:'BD_CUSTOMER', value:'客户'}],
ownerOrgList: [],
ownerTypeSelectText: '',
ownerOrgSelectText: '',
ownerOrgIndex: -1,
ownerSupplierIndex: -1,
ownerCustomerIndex: -1,
ownerTypeShow: false,
dialogNoticeContent:'',
dialogNoticeTitle:'',
dialogNoticeType:'',
showDialog:false,
dialogShow:false,
dialogTitle:'',
dialogContent:'',
dialogType:'',
dialogParams:new Object,
storeTypeSelectText:'合格入库',
FWWINTYPE:'QLI',
FUSEFULDATE:'',
stockStatusList:[],
stockStatusSelectText:'',
FSTOCKSTATUSNAME:'',
FSTOCKSTATUSID:'',
FKEEPERID:'',
FKEEPERTYPEID:'',
FOWNERID:'',
FOWNERTYPEID:'',
FISSECUNIT:false, //是否启用辅助单位数量
FSECUNITQTY:'',
FSECUNITID:'',
FSECUNITQTYFocus:false,
dbAlise:'',
userName:'',
showScan:true,
developList:[],
developSelectText:'',
developID:'',
orderTypeList:[],
orderTypeSelectText:'',
orderTypeID:'',
FDEPTID:'',
FSUPPLYID:'',
FCUSTID:'',
isShowPUpload:false,
// showCashTips:false,
loadCash:false,
pageCashInfo: new Object(),
isShowRBMaterial:false,
FBackReson:"",
backRID:"",
orgBRList:[],
backResonList:[],
BRListIndex:"",
backResonSelectText:"请选择",
FDate:"",
stockNav:false,
showErrTips:false,
errDetailsList:[],
errDetails:[],
FDetailID:"",
FUnitID:"",
isShowOrg:true,
orgArry:[{name:"请选择组织", key:"", FName:""}],
orgFItemID:'',
index:0,
isChangedOrg:false,
supplierInfosChanged:[],
customerInfosChanged:[],
deptInfosChanged:[],
FSourceTranType:"",
storageLocation:"",
storageFSCSPNumber:"",
storageFSCStockNumber:"",
stockDisabled:false,
FIsStockMgr:false,
showResult:true,
FBarcodeNumber:"",
//仓库位置存放
stockStore:"",
//仓位位置存放
stockPlaceStore:"",
//位置回车是否检查数量
FIsControlQty: false,
//位置回车辅助属性检查
// FOtherControl: "",
FISCHECKLOT:false,
FISCHECKAUX:false,
FISCHECKKFDATE:false,
FSCSPNumberFocus:false,
FSCStockNumberFocus:false,
QtyFocus:false,
BoxFocus:false,
isShowStock:true,
isCommitBtnDisable:false,
isShowBillRowNo:false,
isClosedPopup:false,
isExitRowNo:0,
isShowRowNoSel:false,
RowNoTableData:[],
RowNoColumns:[
{ title: "源单行号", key: "FMOENTRYID", width: 350, formatNum: false },
{ title: "源单编号", key: "FMOBILLNO", width: 350, formatNum: false },
{ title: "用料清单", key: "FSRCBILLNO", width: 350, formatNum: false },
],
RowNo:"",
sourceBillTempList:[],
billTypeSelectText:"请选择",
billTypeList:[],
fNameSelectText0:"",
fNameSelectText1:"",
billTypeFocus:true,
sourceBillNoDisable:false,
sourceBillNoFocus:false,
deptDisabled:true,
deptFocus:false,
barcodeNumberFcous:false,
barcodeQtyDisabled:true,
locationFocus:false,
detailTabIndex:4,
key:1,
currentBarCodeInfo: new Object(),
barcodeList:[],
sourceBillNoList:[],
boxTempList:[],
commitList:[],
selectedList: [],
totalTableData: [],
baseTableData: [],
TempBaseTableData:[],
FSourceBillNoList:[],
yesTableData: [],
//表格选择框显示
showSelect: true,
tableSelectList: [],
//汇总
totalColumns: [],
//已扫描
yesColumns: [{ title: "源单类型", key: "FSourceBillTypeName", width: 350, formatNum: false },
{ title: "源单编号", key: "FSourceBillNo", width: 350, formatNum: false },
{ title: "箱码", key: "FBoxNumber", width: 350, formatNum: false },
{ title: "条码", key: "FBarcodeNumber", width: 350, formatNum: false },
{ title: "物料代码", key: "FItemNumber", width: 350, formatNum: false },
{ title: "物料名称", key: "FItemName", width: 350, formatNum: false },
{ title: "规格型号", key: "FSize", width: 350, formatNum: false },
// { title: "型号", key: "FModel", width: 350, formatNum: false },
{ title: "批号", key: "FBatchNO", width: 350, formatNum: false },
{ title: "辅助属性", key: "FAuxPropName", width: 350, formatNum: false },
{ title: "保质期", key: "FKFPeriod", width: 350, formatNum: false },
{ title: "生产日期", key: "FKFDate", width: 350, formatNum: false },
{ title: "数量", key: "FQty", width: 350 },
{ title: "单位", key: "FUnitName", width: 120, formatNum: false },
{ title: "仓库", key: "FStockNumber", width: 200, formatNum: false },
{ title: "仓位", key: "FStockPlaceNumber", width: 200, formatNum: false }],
//源单信息
baseColumns: [],
billTypeDefaultList: new Array(),
productBarCode: '',
productInfo: '',
productID: '',
productInfoFocus: false,
splitQtyFocus: false,
splitQtyDisabled: true,
printSwitch: false,
bluetoothSwitch: false,
baseUrl: '',
systemParameter: '',
barcodeTableData: [],
barcodeColumns: [ { title: "条码", key: "barcode", width: 400, formatNum: false },
{ title: "状态", key: "status", width: 300, formatNum: false }, ],
printList: [],
productBarCodeFocus: false,
note: '',
noteFocus: '',
//源单拣货
billFITEMNUMBER: '',
billFITEMNAME: '',
billFUNITNAME: '',
billFREMINANQTY: '',
billFSPECIFICATION: '',
billFAUXPROPNAME: '',
billFLOT: '',
billFSTOCKNAME: '',
billFSTOCKLOCNAME: '',
billNextDisable: true,
billPreviousDisable: true,
billNextIndex: 0,
billNextList: [],
// 日期选择
dateString: '',
type: 'date',
creatlist: [{
type: 'date',
detail: '选择开始时间'
}],
curDate: '',
stockStatus: true,
}
},
onLoad() {
let _self = this;
this.dbAlise = uni.getStorageSync("dbAlise");
this.userName = uni.getStorageSync("userName");
this.confirmCurrentTranType();
this.isShowBillRow();
this.getOrgList();
this.basecolumChoose();
//获取库存状态
if (this.stockStatus) {
this.getStockStatusList();
}
if(this.currentTranType == 'STK_MisDelivery'){
this.getDevelop();
}
//当前时间
let date = new Date();
this.curDate = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
this.creatlist[0].detail = this.curDate;
this.baseUrl = uni.getStorageSync('RequestUrl');
this.systemParameter = uni.getStorageSync('systemParameter');
this.printSwitch = this.systemParameter.printSwitch;
this.bluetoothSwitch = this.systemParameter.bluetoothSwitch;
if (this.currentTranType != 'SP_PickMtrl' && this.currentTranType != 'STK_MisDelivery') {
this.printSwitch = false;
this.bluetoothSwitch = false;
}
if (!this.printSwitch && !this.bluetoothSwitch) {
this.isPrinted = false;
}
if (this.$refs.bluetoothPrintTab) {
this.$refs.bluetoothPrintTab.orgId = this.orgFItemID;
}
this.judgeCash();
this.$forceUpdate();
},
updated() {
this.$refs.backResonList.selectText = this.FBackReson;
this.$refs.stockStatusList.selectText = this.FSTOCKSTATUSNAME;
let pageCashKey = 'pageCash'+this.dbAlise+this.userName+this.currentTranType+this.orgFItemID;
uni.setStorageSync('pageCashKey',pageCashKey)
},
watch:{
detailTabIndex(newVal,oldVal) {
let ref = this.$refs
if (this.detailTabIndex == 4 && this.isShowRBMaterial) {
if (this.FBackReson && this.FBackReson.length>0) {
this.$refs.backResonList.selectText = this.FBackReson;
}
}
}
},
components: {
zTable,
uniTag,
xflSelect,
uniPopupDialog,
BluetoothPrintTab,
NetworkPrintTab,
DateTimePicker,
opsoftDialogNotice,
opsoftDialog
},
computed: {
indicatorStyle() {
return {
background: 'rgba(255,0,0,.2)',
height: '40px',
};
},
deptInfoList() {
if(this.deptInfosChanged) {
let deptList = this.deptInfosChanged;
deptList.map(function(el){ el.value = el.FNAME })
return deptList;
}
else{
return [];
}
},
productInfoList() {
if(this.productInfoChanged) {
let productList = this.productInfoChanged;
productList.map(function(el){ el.value = el.FNAME })
return productList;
}
else {
return [];
}
},
customerInfoList() {
if(this.customerInfosChanged) {
let customerList = this.customerInfosChanged;
customerList.map(function(el){ el.value = el.FNAME })
return customerList;
}
else {
return [];
}
},
supplierInfoList() {
if(this.supplierInfosChanged) {
let supplierList = this.supplierInfosChanged;
supplierList.map(function(el){ el.value = el.FNAME })
return supplierList;
}
else {
return [];
}
},
barcodeRule() {
if(this.sysParameters) {
if(this.sysParameters.hasOwnProperty("BarcodeRuleForVerification")) {
let rule = this.sysParameters["BarcodeRuleForVerification"];
if (rule) {
return rule;
}
}
}
return "";
},
headerFNameList0() {
if(this.fNameArray[0].headerFID == "FDeptID") {
return this.deptInfoList;
}
if(this.fNameArray[0].headerFID == "FSupplyID") {
return this.supplierInfoList;
}
if(this.fNameArray[0].headerFID == "FCustID") {
return this.customerInfoList;
}
if(this.fNameArray[0].headerFID == "FPRODUCTID") {
return this.productInfoList;
}
return new Array();
},
headerFNameList1() {
if(this.fNameArray[1].headerFID == "FDeptID") {
return this.deptInfoList;
}
if(this.fNameArray[1].headerFID == "FSupplyID") {
return this.supplierInfoList;
}
if(this.fNameArray[1].headerFID == "FCustID") {
return this.customerInfoList;
}
if(this.fNameArray[1].headerFID == "FPRODUCTID") {
return this.productInfoList;
}
return new Array();
},
fNameTitle0() {
if(this.fNameArray.length >= 1) {
return this.fNameArray[0].headerFName;
}
return "";
},
fNameSelectShow1() {
if(this.fNameArray.length >= 2) {
return true;
}
return false;
},
fNameTitle1() {
if(this.fNameArray.length >= 2) {
return this.fNameArray[1].headerFName;
}
return "";
},
...mapState(['userInfo', "deptInfos", "customerInfos", "supplierInfos", "sysParameters"])
},
methods: {
dialogNoticeConfirmClick(){
this.showDialog = false;
},
dialogNoticeProps(err,type){
err = errorStrUntil.handle(err);
this.showDialog = true;
this.dialogNoticeType = 'error';
this.dialogNoticeTitle = '异常提示';
if(type=='success'){
this.dialogNoticeType = 'success';
this.dialogNoticeTitle = '执行成功';
}
this.dialogNoticeContent = err;
},
dialogProps(dialogContent,type,params){
this.dialogShow = true;
this.dialogTitle = '提示';
this.dialogContent = dialogContent;
this.dialogType = type
this.dialogParams.params = params
},
dialogConfirmClick:function() {
let _self = this;
console.log("dialogConfirmClick");
this.dialogShow=false;
if(this.dialogType=='bluePrintBarcode'){
this.bluePrintBarcode(this.dialogParams.params)
}
if(this.dialogType=='judgeCash'){
this.loadByCash();
}
if(this.dialogType=='del'){
let delList = _self.yesTableData.filter(
function(el, index){
return _self.selectedList.includes(index);
}
);
_self.yesTableData = _self.yesTableData.filter(
function(el, index){
return !_self.selectedList.includes(index);
}
);
console.log(_self.barcodeList);
_self.barcodeList = _self.barcodeList.filter(
function(el,index){
return !_self.selectedList.includes(index);
}
);
console.log(_self.barcodeList);
_self.commitList = _self.commitList.filter(
function(el,index){
return !_self.selectedList.includes(index)
}
);
let billInfoScan = [];
let billInfoBase = [];
_self.yesTableData.forEach(
function(el){
let billInfoS = el.FSourceBillNo + el.FItemNumber;
billInfoScan.push(billInfoS);
}
);
_self.baseTableData.forEach(
function(el){
let billInfoB = el.FSourceBillNo + el.FItemNumber;
billInfoBase.push(billInfoB);
}
);
if (!_self.currentBarCodeInfo.FIsOpenSource) {
if (billInfoBase.length > 0) {
billInfoBase.forEach(
function(el){
let billNOResult = billInfoScan.includes(el);
if (!billNOResult) {
_self.baseTableData = _self.baseTableData.filter(
function(BSel){
return BSel.comb != el;
}
);
}
}
);
}
}
delList.forEach(
function(el, index){
if (el.FIsBox) {
let FBoxNumber = el.FBoxNumber;
_self.commitList = _self.commitList.filter(
function(commitEl){
return commitEl.FNumber != FBoxNumber;
}
);
_self.barcodeList = _self.barcodeList.filter(
function(barcodeEl){
return barcodeEl != FBoxNumber;
}
);
let tempBoxData = _self.yesTableData.filter(
function(temp){
return temp.FBoxNumber == FBoxNumber;
}
);
_self.yesTableData = _self.yesTableData.filter(
function(scan){
return scan.FBoxNumber != FBoxNumber;
}
);
_self.commitList = _self.commitList.filter(
function(commitEl){
return commitEl.FNumber != el.FBarcodeNumber;
}
);
_self.barcodeList = _self.barcodeList.filter(
function(barcodeEl){
return barcodeEl != el.FBarcodeNumber;
}
);
tempBoxData.forEach(
function(boxBarcodeEl){
_self.barcodeList = _self.barcodeList.filter(
function(barcodeEl){
return barcodeEl != boxBarcodeEl.FBarcodeNumber;
}
);
}
);
}
else {
_self.barcodeList = _self.barcodeList.filter(
function(barcodeEl){
return barcodeEl != el.FBarcodeNumber;
}
);
}
if (!_self.currentBarCodeInfo.FIsOpenSource) {
_self.baseTableData = _self.baseTableData.filter(
function(FSourceBillNo){
let resultClear = false;
if(FSourceBillNo.FSourceBillNo == el.FSourceBillNo &&
FSourceBillNo.FItemName == el.FItemName &&
FSourceBillNo.FItemNumber == el.FItemNumber){
return resultClear = false;
}else{
return resultClear = true;
}
return resultClear;
}
);
}
}
);
_self.selectedList = new Array();
_self.Calculate();
uni.showToast({
icon: 'none',
title: '删除成功'
});
_self.showResult = true;
if(_self.yesTableData.length==0){
uni.setStorageSync(this.dbAlise+this.userName+this.currentTranType+'lastSaveOrgid','');
}
this.saveCash();
}
},
dialogCancelClick:function() {
console.log("dialogCancelClick");
this.dialogShow=false
if(this.dialogType=='judgeCash'){
this.getSourceBillTypeInfo();
}
},
//日期切换
creatDatePicker() {
this.type = 'date';
this.$refs['creatTime'].show();
},
creatTimeChange(value) {
let item = this.creatlist[0];
item['detail'] = value;
},
scan:function(e) {
let _self = this;
let currentScanType = e;
uni.scanCode({
success:function(res) {
if(currentScanType == 'sourceBillScan') {
_self.currentBarCodeInfo.FSourceBillNo = res.result;
_self.sourceBillNoInfoConfirm();
}
else if(currentScanType == 'barCodeScan') {
_self.FBarcodeNumber = res.result;
_self.barcodeConfirm();
}
else if(currentScanType == "StockScan") {
_self.currentBarCodeInfo.FLocation = res.result;
_self.locationConfirm();
}
else if(currentScanType == "stockStorScan") {
_self.currentBarCodeInfo.FSCStockNumber = res.result;
_self.FSCStockNumberConfirm();
}
else if(currentScanType == 'stockPlaceScan') {
_self.currentBarCodeInfo.FSCSPNumber = res.result;
_self.FSCSPNumberConfirm();
}
else if(currentScanType == 'productBarCode') {
_self.productBarCode = res.result;
_self.barcodeConfirm();
}
}
});
},
loadByCash:function() {
let _self = this;
let lastSaveOrgid = uni.getStorageSync(this.dbAlise+this.userName+this.currentTranType+'lastSaveOrgid');
let cashValue;
if (!this.isChangedOrg) {
cashValue = uni.getStorageSync('pageCash'+this.dbAlise+this.userName+this.currentTranType+lastSaveOrgid);
} else {
cashValue = uni.getStorageSync('pageCash'+this.dbAlise+this.userName+this.currentTranType+this.orgFItemID);
}
this.orgFItemID = cashValue.otherInfo.orgFItemID;
this.yesTableData = cashValue.yesTableData;
this.barcodeList = cashValue.barcodeList;
this.commitList = cashValue.commitList;
this.baseTableData = cashValue.baseTableData;
this.currentBarCodeInfo.FSourceBillNo = cashValue.otherInfo.FSourceBillNo;
this.currentBarCodeInfo.FSourceBillTypeName = cashValue.otherInfo.FSourceBillTypeName;
this.fNameSelectText0 = cashValue.otherInfo.FNameList0;
this.fNameSelectText1 = cashValue.otherInfo.FNameList1;
this.storageFSCStockNumber = cashValue.otherInfo.FSCStockNumber;
this.storageFSCSPNumber = cashValue.otherInfo.FSCSPNumber;
this.storageLocation = cashValue.otherInfo.FLocation;
this.sourceBillNoDisable = cashValue.otherInfo.sourceBillNoDisable;
this.FDEPTID = cashValue.otherInfo.FDEPTID;
this.FCUSTID = cashValue.otherInfo.FCUSTID;
this.FSUPPLYID = cashValue.otherInfo.FSUPPLYID;
if (this.$refs.FNameList0) {
this.$refs.FNameList0.selectText = cashValue.otherInfo.FNameList0;
}
if (this.$refs.FNameList1) {
this.$refs.FNameList1.selectText = cashValue.otherInfo.FNameList1;
}
this.orgArry.forEach(
function(el,index){
let currentOrgid = el.FINTERID;
let result = (currentOrgid == _self.orgFItemID);
if (result) {
_self.index = index;
el.FNAME = el.FNAME?el.FNAME:'无';
}
}
);
this.getDeptInfo();
this.getSupplierInfo();
this.getCustomerInfo();
this.RowNo = cashValue.otherInfo.RowNo;
this.Calculate();
this.ownerTypeShow = cashValue.otherInfo.ownerTypeShow;
this.FOWNERTYPEID = cashValue.otherInfo.FOWNERTYPEID;
this.ownerTypeSelectText = cashValue.otherInfo.ownerTypeSelectText;
if (this.$refs.ownerTypeList) {
this.$refs.ownerTypeList.selectText = this.ownerTypeSelectText;
}
this.FOWNERID = cashValue.otherInfo.FOWNERID;
this.ownerOrgSelectText = cashValue.otherInfo.ownerOrgSelectText;
if (this.FOWNERTYPEID === 'ORG_Organizations' && this.$refs.ownerOrgArryList) {
this.$refs.ownerOrgArryList.selectText = this.ownerOrgSelectText;
}
let requestParams = {
"orgID": this.orgFItemID,
"fNO": this.currentTranType
};
uni.showLoading({
icon:'loading',
title:'加载中……',
mask:true
});
this.$request.get('/SelBill/QuerySelBill',{
params:requestParams
}).then(res => {
uni.hideLoading();
let data = res;
let billTypes = data;
let defaulBillTypeFlag = true;
if (billTypes) {
billTypes.forEach(
function(el){
el.value = el.FSRCNAME? el.FSRCNAME:'null'
if (cashValue.otherInfo.FSourceBillTypeName == el.value) {
_self.orderTypeList = el.FSELBILLENTRY;
if(_self.orderTypeList){
_self.orderTypeList.forEach(e => {
e.value = e.FDESTNAME;
})
}
if(_self.$refs.orderTypeList){
_self.$refs.orderTypeList.selectText = _self.orderTypeList[0].FDESTNAME;
}
_self.billTypeSelectText = cashValue.otherInfo.FSourceBillTypeName;
if (_self.$refs.billTypeList) {
_self.$refs.billTypeList.selectText = _self.billTypeSelectText;
}
_self.currentBarCodeInfo = new Object();
_self.currentBarCodeInfo.FSourceTranType = el.FSRCFORMID;
_self.FSourceTranType = el.FSRCFORMID;
_self.currentBarCodeInfo.FIsOpenSource = el.FISOPENSOURCE;
_self.sourceBillNoDisable = true;
_self.deptDisabled = true;
if (!el.FSRCFORMID) {
_self.sourceBillNoDisable = true;
if (_self.currentTranType == 'STK_MisDelivery' || _self.currentTranType == 'STK_MisCellaneous') {
_self.ownerTypeShow = true;
_self.FOWNERTYPEID = 'ORG_Organizations';
_self.ownerTypeSelectText = '业务组织';
if (_self.$refs.ownerTypeList) {
_self.$refs.ownerTypeList.selectText = "业务组织";
}
_self.FOWNERID = '';
_self.ownerOrgSelectText = '';
if (_self.$refs.ownerOrgArryList) {
_self.$refs.ownerOrgArryList.selectText = '';
}
_self.ownerOrgIndex = -1;
_self.ownerSupplierIndex = -1;
_self.ownerCustomerIndex = -1;
}
}
else {
if (_self.currentBarCodeInfo.FIsOpenSource) {
_self.sourceBillNoDisable = false;
}
}
if (_self.FSourceTranType == 0) {
_self.deptDisabled = false;
_self.isShowOrg = true;
}
else {
_self.showOrg();
}
_self.currentBarCodeInfo.FDestTranType = el.FTRANTYPE;
_self.currentBarCodeInfo.FSourceBillTypeName = el.FSRCNAME;
_self.FIsControlQty = el.FISCONTROLQTY;
// _self.FOtherControl = el.FOtherControl;
_self.FISCHECKLOT = el.FISCHECKLOT;
_self.FISCHECKAUX = el.FISCHECKAUX;
_self.FISCHECKKFDATE = el.FISCHECKKFDATE;
_self.currentBarCodeInfo.FID0 = "";
_self.currentBarCodeInfo.FName0 = "";
_self.currentBarCodeInfo.FNO0 = "";
_self.currentBarCodeInfo.FID1 = "";
_self.currentBarCodeInfo.FName1 = "";
_self.currentBarCodeInfo.FNO1 = "";
_self.currentBarCodeInfo.FSourceBillNo = "";
_self.currentBarCodeInfo.FItemNumber = "";
_self.currentBarCodeInfo.FItemName = "";
_self.currentBarCodeInfo.FModel = "";
_self.currentBarCodeInfo.FAuxPropName = "";
_self.currentBarCodeInfo.FQty = "";
_self.currentBarCodeInfo.FBoxQty = "";
_self.currentBarCodeInfo.FLOT = "";
_self.currentBarCodeInfo.FUNITNAME = "";
if (defaulBillTypeFlag) {
if(_self.currentBarCodeInfo.FIsOpenSource && _self.currentBarCodeInfo.FSourceTranType != "0") {
_self.sourceBillNoFocus = false;
_self.$nextTick(function(){
_self.sourceBillNoFocus = true;
});
defaulBillTypeFlag = false;
}
else {
_self.sourceBillNoFocus = false;
_self.$nextTick(function(){
_self.sourceBillNoFocus = true;
});
defaulBillTypeFlag = false;
}
}
_self.currentBarCodeInfo.FSourceBillNo = cashValue.otherInfo.FSourceBillNo;
_self.currentBarCodeInfo.FSourceBillTypeName = cashValue.otherInfo.FSourceBillTypeName;
_self.billTypeSelectText = cashValue.otherInfo.FSourceBillTypeName;
if (_self.$refs.billTypeDefaultList) {
_self.$refs.billTypeDefaultList.selectText = cashValue.otherInfo.FSourceBillTypeName;
}
_self.fNameSelectText0 = cashValue.otherInfo.FNameList0;
_self.fNameSelectText1 = cashValue.otherInfo.FNameList1;
if (_self.$refs.FNameList0) {
_self.$refs.FNameList0.selectText = cashValue.otherInfo.FNameList0;
}
if (_self.$refs.FNameList1) {
_self.$refs.FNameList1.selectText = cashValue.otherInfo.FNameList1;
}
_self.RowNo = cashValue.otherInfo.RowNo;
}
});
_self.billTypeDefaultList = billTypes;
_self.$forceUpdate();
}
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
getSourceBillTypeInfo:function(){
let _self = this;
let requestParams = {
"orgID": this.orgFItemID,
"fNO": this.currentTranType
};
uni.showLoading({
icon:'loading',
title:'加载中……',
mask:true
});
this.$request.get('/SelBill/QuerySelBill',{
params:requestParams
}).then(res => {
uni.hideLoading();
let data = res;
let billTypes = data;
if (billTypes) {
billTypes.forEach(
function(el) {
el.value = el.FSRCNAME? el.FSRCNAME:'null';
}
);
for (var i = 0; i < billTypes.length; i++) {
let billTemp = billTypes[i];
if (billTemp.FDEFAULT) {
_self.orderTypeList = billTemp.FSELBILLENTRY;
if (_self.orderTypeList && _self.$refs.orderTypeList) {
_self.orderTypeList.forEach(el => {
el.value = el.FDESTNAME;
});
//防呆
for (let typeIndex = 0; typeIndex < _self.orderTypeList.length; typeIndex++) {
if (_self.orderTypeList[typeIndex].FDEFAULT) {
_self.$refs.orderTypeList.selectText = _self.orderTypeList[typeIndex].FDESTNAME;
_self.orderTypeID = _self.orderTypeList[typeIndex].FDESTID;
break;
}
}
}
_self.billTypeSelectText = billTemp.value;
if (_self.$refs.billTypeList) {
_self.$refs.billTypeList.selectText = _self.billTypeSelectText;
}
_self.currentBarCodeInfo = new Object();
_self.currentBarCodeInfo.FSourceTranType = billTemp.FSRCFORMID;
_self.FSourceTranType = billTemp.FSRCFORMID;
_self.currentBarCodeInfo.FIsOpenSource = billTemp.FISOPENSOURCE;
_self.sourceBillNoDisable = true;
_self.deptDisabled = true;
if (!billTemp.FSRCFORMID) {
_self.sourceBillNoDisable = true;
if (_self.currentTranType == 'STK_MisDelivery' || _self.currentTranType == 'STK_MisCellaneous') {
_self.ownerTypeShow = true;
_self.FOWNERTYPEID = 'ORG_Organizations';
_self.ownerTypeSelectText = '业务组织';
if (_self.$refs.ownerTypeList) {
_self.$refs.ownerTypeList.selectText = "业务组织";
}
_self.FOWNERID = '';
_self.ownerOrgSelectText = '';
if (_self.$refs.ownerOrgArryList) {
_self.$refs.ownerOrgArryList.selectText = '';
}
_self.ownerOrgIndex = -1;
_self.ownerSupplierIndex = -1;
_self.ownerCustomerIndex = -1;
}
}
else {
if (_self.currentBarCodeInfo.FIsOpenSource) {
_self.sourceBillNoDisable = false;
}
}
if (_self.FSourceTranType == 0) {
_self.deptDisabled = false;
_self.isShowOrg = true;
}
else {
_self.showOrg();
}
_self.currentBarCodeInfo.FDestTranType = billTemp.FTRANTYPE;
_self.currentBarCodeInfo.FSourceBillTypeName = billTemp.FSRCNAME;
_self.FIsControlQty = billTemp.FISCONTROLQTY;
// _self.FOtherControl = el.FOtherControl;
_self.FISCHECKLOT = billTemp.FISCHECKLOT;
_self.FISCHECKAUX = billTemp.FISCHECKAUX;
_self.FISCHECKKFDATE = billTemp.FISCHECKKFDATE;
_self.currentBarCodeInfo.FID0 = "";
_self.currentBarCodeInfo.FName0 = "";
_self.currentBarCodeInfo.FNO0 = "";
_self.currentBarCodeInfo.FID1 = "";
_self.currentBarCodeInfo.FName1 = "";
_self.currentBarCodeInfo.FNO1 = "";
_self.currentBarCodeInfo.FSourceBillNo = "";
_self.currentBarCodeInfo.FItemNumber = "";
_self.currentBarCodeInfo.FItemName = "";
_self.currentBarCodeInfo.FModel = "";
_self.currentBarCodeInfo.FAuxPropName = "";
_self.currentBarCodeInfo.FQty = "";
_self.currentBarCodeInfo.FLOT = "";
_self.currentBarCodeInfo.FUNITNAME = "";
_self.currentBarCodeInfo.FBoxQty = "";
_self.currentBarCodeInfo.FLocation = "";
_self.currentBarCodeInfo.FSCStockNumber = "";
_self.currentBarCodeInfo.FSCSPNumber = "";
if (!_self.currentBarCodeInfo.FIsOpenSource) {
_self.barcodeNumberFcous = false;
_self.$nextTick(function(){
_self.barcodeNumberFcous = true;
});
}
else {
_self.sourceBillNoFocus = false;
_self.$nextTick(function(){
_self.sourceBillNoFocus = true;
});
}
break;
}
}
_self.billTypeDefaultList = billTypes;
_self.$forceUpdate();
}
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
hideErrTips:function(){
this.showErrTips = false;
this.errDetailsList = [];
this.errDetails = [];
},
QtyConfirm:function(){
let nextFlag = commonUtil.judgeFloat(this.currentBarCodeInfo.FQty);
if (!this.currentBarCodeInfo.FQty){
uni.showToast({
title:"请输入正确的数量值",
duration: 3500,
icon:"none"
});
return false;
}
if (this.currentTranType == 'SP_PickMtrl' || this.currentTranType == 'STK_MisDelivery'||
this.currentTranType == 'PRD_PickMtrl' || this.currentTranType == 'PRD_FeedMtrl') {
this.currentBarCodeInfo.FSplitQty = this.currentBarCodeInfo.FQty;
}
if (nextFlag) {
if ((this.currentTranType == 'SP_PickMtrl' || this.currentTranType == 'STK_MisDelivery'||
this.currentTranType == 'PRD_PickMtrl' || this.currentTranType == 'PRD_FeedMtrl') && !this.splitQtyDisabled) {
this.showSplitQtyFocus();
}
else {
if (this.FISSECUNIT){
this.showFSECUNITQTYFocus();
}
else {
this.showBoxFocus();
}
}
}
},
SplitQtyConfirm:function(){
let nextFlag = commonUtil.judgeFloat(this.currentBarCodeInfo.FSplitQty);
if (!this.currentBarCodeInfo.FSplitQty) {
uni.showToast({
title:"请输入正确的拆分入库数量值",
duration: 3500,
icon:"none"
});
return false;
}
let splitQty = parseFloat(this.currentBarCodeInfo.FSplitQty);
let qty = parseFloat(this.currentBarCodeInfo.FQty);
if ((splitQty - qty) > 0) {
uni.showToast({
title:"拆分入库数量不能大于条码数量",
duration: 3500,
icon:"none"
});
return false;
}
if (nextFlag) {
if (this.FISSECUNIT) {
this.showFSECUNITQTYFocus();
}
else if (!this.barcodeQtyDisabled){
this.showBoxFocus();
}
else {
if (this.isShowStock) {
this.showLocationFcous();
}
else {
this.showFSCStockNumberFocus();
}
}
}
},
FSECUNITQTYConfirm(){
if (!this.FSECUNITQTY) {
uni.showToast({
title:"辅助数量不能为空",
duration: 3500,
icon:"none"
});
return false;
}
if (this.FSECUNITQTY<=0) {
uni.showToast({
title:"辅助数量需大于0",
duration: 3500,
icon:"none"
});
return false;
}
if(!this.barcodeQtyDisabled) {
this.showBoxFocus();
}
else {
if (this.isShowStock) {
this.showLocationFcous();
}
else {
this.showFSCStockNumberFocus();
}
}
},
BoxConfirm:function(){
if (this.isShowStock) {
this.showLocationFcous();
}
else {
this.showFSCStockNumberFocus();
}
},
//组织变更后获取部门、供应商、客户信息
getDeptInfo:function(){
let _self = this;
uni.showLoading({
icon:'loading',
title:'加载中……',
mask:true
});
let params;
this.$request.get('/SysConfigData/QueryResource',{
params:{
basicType:1,
basicNO:'',
orgId:this.orgFItemID,
currentTranTypeq:this.currentTranType
}
}).then(res => {
uni.hideLoading();
let datalist = res;
_self.deptInfosChanged = datalist;
console.log(_self.deptInfosChanged);
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
getCustomerInfo:function(){
let _self = this;
uni.showLoading({
icon:'loading',
title:'加载中……',
mask:true
});
let params;
this.$request.get('/SysConfigData/QueryResource',{
params:{
basicType:3,
basicNO:'',
orgId:this.orgFItemID
}
}).then(res => {
uni.hideLoading();
let datalist = res;
_self.customerInfosChanged = datalist;
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
getSupplierInfo:function(){
let _self = this;
uni.showLoading({
icon:'loading',
title:'加载中……',
mask:true
});
let params;
this.$request.get('/SysConfigData/QueryResource',{
params:{
basicType:2,
basicNO:'',
orgId:this.orgFItemID
}
}).then(res => {
uni.hideLoading();
let datalist = res;
_self.supplierInfosChanged = datalist;
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
productInfoConfirm:function(){
uni.showLoading({
icon:'loading',
title:'加载中……',
mask:true
});
// if (!this.productBarCode &&
// ((this.currentTranType == 'SP_PickMtrl') || (this.currentTranType == 'SP_ReturnMtrl'))) {
// uni.showToast({
// icon: "none",
// title: "请输入生产编号",
// duration: 3500,
// });
// return false;
// }
// if (!this.productInfo &&
// ((this.currentTranType == 'SP_PickMtrl') || (this.currentTranType == 'SP_ReturnMtrl'))) {
// uni.showToast({
// icon: "none",
// title: "请输入生产对象",
// duration: 3500,
// });
// return false;
// }
let params;
this.$request.get('/SysConfigData/QueryResource',{
params:{
basicType:15,
basicNO:this.productInfo,
orgId:this.orgFItemID
}
}).then(res => {
uni.hideLoading();
if (res && res[0] && res[0].FID) {
this.productID = res[0].FID;
this.showBarcodeNumberFcous();
}
else {
uni.showToast({
icon: "none",
title: "请输入正确的生产对象",
duration: 3500,
});
return false;
}
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
//组织
getOrgList:function() {
let _self = this;
let orgInfo = uni.getStorageSync('orgInfo');
if (orgInfo && orgInfo.length > 0) {
let defaultOrgInfo = uni.getStorageSync('defaultOrgInfo');
let isOpenDefaultOrg = uni.getStorageSync('isOpenDefaultOrg');
if (!isOpenDefaultOrg) {
this.orgFItemID = orgInfo[0].FINTERID;
} else {
if (defaultOrgInfo) {
this.orgFItemID = defaultOrgInfo.FINTERID;
} else {
this.orgFItemID = orgInfo[0].FINTERID;
}
}
this.orgArry = orgInfo;
this.ownerOrgList = JSON.parse(JSON.stringify(orgInfo));
this.orgArry.forEach(
function(el,index){
let currentOrgid = el.FINTERID;
let result = (currentOrgid == _self.orgFItemID);
if (result) {
_self.index = index;
el.FNAME = el.FNAME?el.FNAME:'无';
}
}
);
this.ownerOrgList.forEach(
function(el,index){
el.value = el.FNAME;
}
);
this.getDeptInfo();
this.getSupplierInfo();
this.getCustomerInfo();
} else {
this.orgArry = [{name:"请选择组织", key:"", FNAME:"当前无组织"}];
this.index = 0;
}
},
orgChange:function(e) {
this.isChangedOrg = true;
this.index = e.target.value;
let isOpenDefaultOrg = uni.getStorageSync('isOpenDefaultOrg');
if(!this.orgArry[this.index].FINTERID) {
this.orgFItemID = "";
}
else {
this.orgFItemID = this.orgArry[this.index].FINTERID;
if(isOpenDefaultOrg) {
uni.setStorageSync('defaultOrgInfo',this.orgArry[this.index]);
}
}
let cashValue = uni.getStorageSync('pageCash'+this.dbAlise+this.userName+this.currentTranType+this.orgFItemID)
if(cashValue) {
this.loadByCash()
} else {
this.getDeptInfo();
this.getSupplierInfo();
this.getCustomerInfo();
this.orgChangedClear();
}
this.$refs.bluetoothPrintTab.orgId = this.orgFItemID;
},
showOrg:function(){},
orgChangedClear:function(){
let _self = this;
this.currentBarCodeInfo = new Object();
this.currentBarCodeInfo.FSourceBillNo = "";
this.RowNo = "";
this.FBackReson = "";
if(this.$refs.billTypeList){
this.$refs.billTypeList.selectText = "";
}
if(this.$refs.orderTypeList){
this.$refs.orderTypeList.selectText = "";
}
this.fNameArray.forEach(
function(item, index){
if(item.headerFID == "FDeptID") {
if(_self.$refs["FNameList"+index]) {
_self.$refs["FNameList"+index].selectText = "";
}
}
if(item.headerFID == "FSupplyID") {
if(_self.$refs["FNameList"+index]) {
_self.$refs["FNameList"+index].selectText = "";
}
}
if(item.headerFID == "FCustID") {
if(_self.$refs["FNameList"+index]) {
_self.$refs["FNameList"+index].selectText = "";
}
}
}
);
this.FBarcodeNumber = "";
this.currentBarCodeInfo.FItemNumber = "";
this.currentBarCodeInfo.FItemName = "";
this.currentBarCodeInfo.FModel = "";
this.currentBarCodeInfo.FAuxPropName = "";
this.currentBarCodeInfo.FQty = "";
this.currentBarCodeInfo.FLOT = "";
this.currentBarCodeInfo.FUNITNAME = "";
this.currentBarCodeInfo.FBoxQty = "";
this.currentBarCodeInfo.FLocation = "";
this.currentBarCodeInfo.FSCStockNumber = "";
this.currentBarCodeInfo.FSCSPNumber = "";
this.currentBarCodeInfo.FSplitQty = "";
this.storageLocation = "";
this.storageFSCStockNumber = "";
this.storageFSCSPNumber = "";
this.stockStore = "";
this.stockPlaceStore = "";
this.barcodeQtyDisabled = true;
this.showResult = true;
this.tableSelectList = [];
this.yesTableData = [];
this.totalTableData = [];
this.baseTableData = [];
this.barcodeList = [];
this.commitList = [];
this.key = this.key + 1;
this.$forceUpdate();
//this.judgeCash();
},
//即时库存
timeStock:function(){
this.stockNav = true;
let item = {
"barCode": this.FBarcodeNumber?this.FBarcodeNumber:"",
"FItemNumber": this.currentBarCodeInfo.FItemNumber?this.currentBarCodeInfo.FItemNumber:"",
"FItemName": this.currentBarCodeInfo.FItemName?this.currentBarCodeInfo.FItemName:"",
"FLocation":this.currentBarCodeInfo.FLocation?this.currentBarCodeInfo.FLocation:"",
"orgid":this.orgFItemID
};
uni.navigateTo({
url: '../../views/STK_Inventory/STK_Inventory?item='+ encodeURIComponent(JSON.stringify(item))
});
},
change(e) {
console.log('popup ' + e.type + ' 状态', e.show)
},
//关闭弹窗
closedPopup(){
this.isClosedPopup = false;
},
//打开弹窗
confirmDialog() {
let _self = this;
if (!this.currentBarCodeInfo.FSourceBillNo) {
uni.showToast({
icon: 'none',
title: "源单编号信息为空"
});
return;
}
this.isClosedPopup = true;
let isExit = 0;
let requestParams = {
"sourceBillNO": this.currentBarCodeInfo.FSourceBillNo.split('-')[0],
"sourceTranType": this.FSourceTranType,
"tranType": this.currentTranType,
"orgID":this.orgFItemID
};
uni.showLoading({
icon:'loading',
title:'加载中……',
mask:true
});
this.$request.post('/SelBill/QuerySourceBillInfo',requestParams).then(res => {
uni.hideLoading();
let data = res;
_self.RowNoTableData = [];
if (this.currentTranType == 'PRD_PickMtrl'||this.currentTranType == 'SUB_PICKMTRL'||
this.currentTranType == 'PRD_FeedMtrl'){
//生产领料,委外领料用料清单取FPPBOMBILLNO
data[1].forEach(
function(sel){
_self.RowNoTableData.push({
"FMOENTRYID": sel.FMOENTRYID?sel.FMOENTRYID:'',
"FMOBILLNO": sel.FMOBILLNO?sel.FMOBILLNO:'',
"FSRCBILLNO": sel.FPPBOMBILLNO?sel.FPPBOMBILLNO:'',
"FSUPPLYID": sel.FSUPPLYID?sel.FSUPPLYID:'',
"FPRODUCTNUMBER": sel.FPRODUCTNUMBER?sel.FPRODUCTNUMBER:'',
"FPRODUCTNAME": sel.FPRODUCTNAME?sel.FPRODUCTNAME:'',
"FPRODUCTSPEC": sel.FPRODUCTSPEC?sel.FPRODUCTSPEC:'',
});
}
);
}
else {
data[1].forEach(
function(sel){
_self.RowNoTableData.push({
"FMOENTRYID": (sel.FMOENTRYID==0)?sel.FMOENTRYID:(sel.FMOENTRYID?sel.FMOENTRYID:''),
"FMOBILLNO": sel.FSRCBILLNO?sel.FSRCBILLNO:'',
"FSRCBILLNO": sel.FPPBOMBILLNO?sel.FPPBOMBILLNO:'',
"FSUPPLYID": sel.FSUPPLYID?sel.FSUPPLYID:'',
"FPRODUCTNUMBER": sel.FPRODUCTNUMBER?sel.FPRODUCTNUMBER:'',
"FPRODUCTNAME": sel.FPRODUCTNAME?sel.FPRODUCTNAME:'',
"FPRODUCTSPEC": sel.FPRODUCTSPEC?sel.FPRODUCTSPEC:'',
});
}
);
}
if (_self.$refs.dialogInput) {
_self.$refs.dialogInput.open();
}
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
dialogInputConfirm(done, val) {
let _self = this;
this.RowNo = _self.RowNoTableData[val[0]].FMOENTRYID;
this.FSUPPLYID = _self.RowNoTableData[val[0]].FSUPPLYID;
this.baseTableData = [];
this.TempBaseTableData.forEach(
function(el){
if (el.FMOENTRYID == _self.RowNo && el.FSourceBillNo == _self.currentBarCodeInfo.FSourceBillNo.split('-')[0]) {
_self.baseTableData.push(el);
}
}
);
this.baseTableData.forEach(
function(basEl){
_self.fNameArray.forEach(
function(item, index){
if (item.headerFID == "FDeptID") {
_self.currentBarCodeInfo["FID"+index] = basEl.FDeptID;
_self.currentBarCodeInfo["FNO"+index] = basEl.FDeptNumber;
_self.currentBarCodeInfo["FName"+index] = basEl.FDeptName;
_self["fNameSelectText"+index] = basEl.FDeptName;
if (_self.$refs["FNameList"+index]) {
_self.$refs["FNameList"+index].selectText = basEl.FDeptName;
}
}
if (item.headerFID == "FSupplyID") {
_self.currentBarCodeInfo["FID"+index] = basEl.FSupplyID;
_self.currentBarCodeInfo["FNO"+index] = basEl.FSupplyName;
_self.currentBarCodeInfo["FName"+index] = basEl.FSupplyNumber;
_self["fNameSelectText"+index] = basEl.FSupplyName;
if(_self.$refs["FNameList"+index]) {
_self.$refs["FNameList"+index].selectText = basEl.FSupplyName;
}
}
if (item.headerFID == "FCustID") {
_self.currentBarCodeInfo["FID"+index] = basEl.FCustID;
_self.currentBarCodeInfo["FNO"+index] = basEl.FCustName;
_self.currentBarCodeInfo["FName"+index] = basEl.FCustName;
_self["fNameSelectText"+index] = basEl.FCustName;
if (_self.$refs["FNameList"+index]) {
_self.$refs["FNameList"+index].selectText = basEl.FCustName;
}
}
}
);
}
);
this.CalculateBase();
done();
},
//源单信息表头字段
basecolumChoose:function(){
//debugger
if (this.currentTranType == 'STK_InStock' || this.currentTranType == 'PRD_InStock' || this.currentTranType == 'STK_OEMInStock' ||
this.currentTranType == 'SUB_InStkPickmtl' || this.currentTranType == 'STK_MisCellaneous') {
this.baseColumns.push({ title: "源单类型", key: "FSourceBillTypeName", width: 350, formatNum: false },
{ title: "源单编号", key: "FSourceBillNo", width: 350, formatNum: false },
{ title: "源单行号", key: "FEntryID", width: 150, formatNum: false },
{ title: "物料代码", key: "FItemNumber", width: 350, formatNum: false },
{ title: "物料名称", key: "FItemName", width: 350, formatNum: false },
{ title: "规格型号", key: "FSize", width: 350, formatNum: false },
// { title: "型号", key: "FModel", width: 350, formatNum: false },
{ title: "批号", key: "FBatchNO", width: 350, formatNum: false },
{ title: "辅助属性", key: "FAuxPropName", width: 350, formatNum: false },
{ title: "数量", key: "FQty", width: 200 },
{ title: "已入数量", key: "Fcommitqty", width: 200 },
{ title: "单位", key: "FUnitName", width: 120, formatNum: false }) ;
}
if (this.currentTranType == 'PRD_ReStock' || this.currentTranType == 'PUR_MRB' || this.currentTranType == 'PRD_ReturnMtrl' ||
this.currentTranType == -137 || this.currentTranType == 'SUB_OutStkPickmtl' || this.currentTranType == 'SUB_RETURNMTRL' ||
this.currentTranType == 'SAL_ReturnStock' || this.currentTranType == 'SP_ReturnMtrl') {
this.baseColumns.push({ title: "源单类型", key: "FSourceBillTypeName", width: 350, formatNum: false },
{ title: "源单编号", key: "FSourceBillNo", width: 350, formatNum: false },
{ title: "源单行号", key: "FEntryID", width: 150, formatNum: false },
{ title: "物料代码", key: "FItemNumber", width: 350, formatNum: false },
{ title: "物料名称", key: "FItemName", width: 350, formatNum: false },
{ title: "规格型号", key: "FSize", width: 350, formatNum: false },
// { title: "型号", key: "FModel", width: 350, formatNum: false },
{ title: "批号", key: "FBatchNO", width: 350, formatNum: false },
{ title: "辅助属性", key: "FAuxPropName", width: 350, formatNum: false },
{ title: "数量", key: "FQty", width: 200 },
{ title: "已退数量", key: "Fcommitqty", width: 200 },
{ title: "单位", key: "FUnitName", width: 120, formatNum: false }) ;
}
if (this.currentTranType == 'PRD_PickMtrl' || this.currentTranType == 137 || this.currentTranType == 'SUB_PICKMTRL'
|| this.currentTranType == 'SP_PickMtrl'||this.currentTranType == 'PRD_FeedMtrl') {
this.baseColumns.push({ title: "源单类型", key: "FSourceBillTypeName", width: 350, formatNum: false },
{ title: "源单编号", key: "FSourceBillNo", width: 350, formatNum: false },
{ title: "源单行号", key: "FEntryID", width: 150, formatNum: false },
{ title: "物料代码", key: "FItemNumber", width: 350, formatNum: false },
{ title: "物料名称", key: "FItemName", width: 350, formatNum: false },
{ title: "规格型号", key: "FSize", width: 350, formatNum: false },
// { title: "型号", key: "FModel", width: 350, formatNum: false },
{ title: "批号", key: "FBatchNO", width: 350, formatNum: false },
{ title: "辅助属性", key: "FAuxPropName", width: 350, formatNum: false },
{ title: "数量", key: "FQty", width: 200 },
{ title: "已领数量", key: "Fcommitqty", width: 200 },
{ title: "单位", key: "FUnitName", width: 120, formatNum: false }) ;
}
if (this.currentTranType == 'SAL_OutStock' || this.currentTranType == 'STK_OEMOutStock' || this.currentTranType == 'STK_MisDelivery'){
this.baseColumns.push({ title: "源单类型", key: "FSourceBillTypeName", width: 350, formatNum: false },
{ title: "源单编号", key: "FSourceBillNo", width: 350, formatNum: false },
{ title: "源单行号", key: "FEntryID", width: 150, formatNum: false },
{ title: "物料代码", key: "FItemNumber", width: 350, formatNum: false },
{ title: "物料名称", key: "FItemName", width: 350, formatNum: false },
{ title: "规格型号", key: "FSize", width: 350, formatNum: false },
// { title: "型号", key: "FModel", width: 350, formatNum: false },
{ title: "批号", key: "FBatchNO", width: 350, formatNum: false },
{ title: "辅助属性", key: "FAuxPropName", width: 350, formatNum: false },
{ title: "数量", key: "FQty", width: 200 },
{ title: "已出数量", key: "Fcommitqty", width: 200 },
{ title: "单位", key: "FUnitName", width: 120, formatNum: false }) ;
}
},
//判断是否显示源单行号
isShowBillRow: function(){
if (this.currentTranType == 'PRD_PickMtrl' || this.currentTranType == 'PRD_ReturnMtrl'
||this.currentTranType == 'SUB_PICKMTRL' || this.currentTranType == 'SUB_RETURNMTRL'
|| this.currentTranType == 137 || this.currentTranType == -137
||this.currentTranType == 'PRD_FeedMtrl') {
this.isShowBillRowNo = true;
this.isExitRowNo = 1;
};
},
//判断currentTranTypeq类型
confirmCurrentTranType: function(){
if (this.currentTranType == 'STK_MisCellaneous' || this.currentTranType == 'STK_MisDelivery') {
this.totalColumns.push({ title: "物料代码", key: "FItemNumber", width: 350, formatNum: false },
{ title: "物料名称", key: "FItemName", width: 350, formatNum: false },
{ title: "规格型号", key: "FSize", width: 350, formatNum: false },
// { title: "型号", key: "FModel", width: 350, formatNum: false },
{ title: "辅助属性", key: "FAuxPropName", width: 350, formatNum: false },
{ title: "数量", key: "FQty", width: 350 },
{ title: "单位", key: "FUnitName", width: 120, formatNum: false })
}
else {
this.totalColumns.push({ title: "源单类型", key: "FSourceBillTypeName", width: 350, formatNum: false },
{ title: "源单编号", key: "FSourceBillNo", width: 350, formatNum: false },
{ title: "物料代码", key: "FItemNumber", width: 350, formatNum: false },
{ title: "物料名称", key: "FItemName", width: 350, formatNum: false },
{ title: "规格型号", key: "FSize", width: 350, formatNum: false },
// { title: "型号", key: "FModel", width: 350, formatNum: false },
{ title: "辅助属性", key: "FAuxPropName", width: 350, formatNum: false },
{ title: "数量", key: "FQty", width: 350 },
{ title: "单位", key: "FUnitName", width: 120, formatNum: false })
}
},
//源单亮起光标
showBillTypeFcous:function(){
let _self = this;
_self.BoxFocus = false;
_self.FSECUNITQTYFocus = false;
_self.QtyFocus = false;
_self.FSCSPNumberFocus = false;
_self.billTypeFocus = false;
_self.sourceBillNoFocus = false;
_self.deptFocus = false;
_self.productInfoFocus = false;
_self.barcodeNumberFcous = false;
_self.FSCStockNumberFocus = false;
_self.locationFocus = false;
_self.splitQtyFocus = false;
_self.productBarCodeFocus = false;
_self.noteFocus = false;
setTimeout(
function() {
_self.$nextTick(
function(){
_self.billTypeFocus = true;
}
);
},
400
);
},
//源单亮起光标
showSourceBillNoFcous:function(){
let _self = this;
_self.BoxFocus = false;
_self.FSECUNITQTYFocus = false;
_self.QtyFocus = false;
_self.FSCSPNumberFocus = false;
_self.billTypeFocus = false;
_self.sourceBillNoFocus = false;
_self.deptFocus = false;
_self.productInfoFocus = false;
_self.barcodeNumberFcous = false;
_self.FSCStockNumberFocus = false;
_self.locationFocus = false;
_self.splitQtyFocus = false;
_self.productBarCodeFocus = false;
_self.noteFocus = false;
setTimeout(
function() {
_self.$nextTick(
function(){
_self.sourceBillNoFocus = true;
}
);
},
400
);
},
//部门光标亮起
showDeptFcous: function() {
let _self = this;
_self.BoxFocus = false;
_self.FSECUNITQTYFocus = false;
_self.QtyFocus = false;
_self.FSCSPNumberFocus = false;
_self.billTypeFocus = false;
_self.sourceBillNoFocus = false;
_self.deptFocus = false;
_self.barcodeNumberFcous = false;
_self.FSCStockNumberFocus = false;
_self.locationFocus = false;
_self.splitQtyFocus = false;
_self.productInfoFocus = false;
_self.productBarCodeFocus = false;
_self.noteFocus = false;
setTimeout(
function() {
_self.$nextTick(
function(){
_self.deptFocus = true;
}
);
},
400
);
},
showProductInfoFcous: function() {
let _self = this;
_self.BoxFocus = false;
_self.FSECUNITQTYFocus = false;
_self.QtyFocus = false;
_self.FSCSPNumberFocus = false;
_self.billTypeFocus = false;
_self.sourceBillNoFocus = false;
_self.deptFocus = false;
_self.barcodeNumberFcous = false;
_self.FSCStockNumberFocus = false;
_self.locationFocus = false;
_self.splitQtyFocus = false;
_self.productInfoFocus = false;
_self.productBarCodeFocus = false;
_self.noteFocus = false;
setTimeout(
function() {
_self.$nextTick(
function(){
_self.productInfoFocus = true;
}
);
},
400
);
},
showProductBarCodeFocus: function() {
let _self = this;
_self.BoxFocus = false;
_self.FSECUNITQTYFocus = false;
_self.QtyFocus = false;
_self.FSCSPNumberFocus = false;
_self.billTypeFocus = false;
_self.sourceBillNoFocus = false;
_self.deptFocus = false;
_self.barcodeNumberFcous = false;
_self.FSCStockNumberFocus = false;
_self.locationFocus = false;
_self.splitQtyFocus = false;
_self.productInfoFocus = false;
_self.productBarCodeFocus = false;
_self.noteFocus = false;
setTimeout(
function() {
_self.$nextTick(
function(){
_self.productBarCodeFocus = true;
}
);
},
400
);
},
//条码光标亮起
showBarcodeNumberFcous: function() {
let _self = this;
_self.BoxFocus = false;
_self.FSECUNITQTYFocus = false;
_self.QtyFocus = false;
_self.FSCSPNumberFocus = false;
_self.billTypeFocus = false;
_self.sourceBillNoFocus = false;
_self.deptFocus = false;
_self.barcodeNumberFcous = false;
_self.FSCStockNumberFocus = false;
_self.locationFocus = false;
_self.splitQtyFocus = false;
_self.productInfoFocus = false;
_self.productBarCodeFocus = false;
_self.noteFocus = false;
setTimeout(
function() {
_self.$nextTick(
function(){
_self.barcodeNumberFcous = true;
}
);
},
400
);
},
showNoteFcous: function() {
let _self = this;
_self.BoxFocus = false;
_self.FSECUNITQTYFocus = false;
_self.QtyFocus = false;
_self.FSCSPNumberFocus = false;
_self.billTypeFocus = false;
_self.sourceBillNoFocus = false;
_self.deptFocus = false;
_self.barcodeNumberFcous = false;
_self.FSCStockNumberFocus = false;
_self.locationFocus = false;
_self.splitQtyFocus = false;
_self.productInfoFocus = false;
_self.productBarCodeFocus = false;
_self.noteFocus = false;
setTimeout(
function() {
_self.$nextTick(
function(){
_self.noteFocus = true;
}
);
},
400
);
},
//存放位置光标亮起
showLocationFcous: function() {
let _self = this;
_self.BoxFocus = false;
_self.FSECUNITQTYFocus = false;
_self.QtyFocus = false;
_self.FSCSPNumberFocus = false;
_self.billTypeFocus = false;
_self.sourceBillNoFocus = false;
_self.deptFocus = false;
_self.barcodeNumberFcous = false;
_self.FSCStockNumberFocus = false;
_self.locationFocus = false;
_self.splitQtyFocus = false;
_self.productInfoFocus = false;
_self.productBarCodeFocus = false;
_self.noteFocus = false;
setTimeout(
function() {
_self.$nextTick(
function(){
_self.locationFocus = true;
if (_self.isScanenter && _self.currentBarCodeInfo.FLocation) {
_self.locationConfirm();
}
if (_self.currentBarCodeInfo.FSourceTranType=='PUR_ReceiveBill' && _self.currentTranType=='PUR_MRB') {
_self.locationConfirm();
}
}
);
},
400
);
},
showFSCStockNumberFocus: function() {
let _self = this;
_self.BoxFocus = false;
_self.FSECUNITQTYFocus = false;
_self.QtyFocus = false;
_self.FSCSPNumberFocus = false;
_self.billTypeFocus = false;
_self.sourceBillNoFocus = false;
_self.deptFocus = false;
_self.barcodeNumberFcous = false;
_self.FSCStockNumberFocus = false;
_self.locationFocus = false;
_self.splitQtyFocus = false;
_self.productInfoFocus = false;
_self.productBarCodeFocus = false;
_self.noteFocus = false;
setTimeout(
function() {
_self.$nextTick(
function(){
_self.FSCStockNumberFocus = true;
if (_self.isScanenter && _self.currentBarCodeInfo.FSCStockNumber) {
_self.FSCStockNumberConfirm();
}
if (_self.currentBarCodeInfo.FSourceTranType=='PUR_ReceiveBill' && _self.currentTranType=='PUR_MRB') {
_self.locationConfirm();
}
}
);
},
400
);
},
showFSCSPNumberFocus: function() {
let _self = this;
_self.BoxFocus = false;
_self.FSECUNITQTYFocus = false;
_self.QtyFocus = false;
_self.FSCSPNumberFocus = false;
_self.billTypeFocus = false;
_self.sourceBillNoFocus = false;
_self.deptFocus = false;
_self.barcodeNumberFcous = false;
_self.FSCStockNumberFocus = false;
_self.locationFocus = false;
_self.splitQtyFocus = false;
_self.productInfoFocus = false;
_self.productBarCodeFocus = false;
_self.noteFocus = false;
setTimeout(
function() {
_self.$nextTick(
function(){
_self.FSCSPNumberFocus = true;
if (_self.isScanenter && _self.currentBarCodeInfo.FSCSPNumber) {
_self.FSCSPNumberConfirm();
}
}
);
},
400
);
},
showQtyFocus: function() {
let _self = this;
_self.BoxFocus = false;
_self.FSECUNITQTYFocus = false;
_self.QtyFocus = false;
_self.FSCSPNumberFocus = false;
_self.billTypeFocus = false;
_self.sourceBillNoFocus = false;
_self.deptFocus = false;
_self.barcodeNumberFcous = false;
_self.FSCStockNumberFocus = false;
_self.locationFocus = false;
_self.splitQtyFocus = false;
_self.productInfoFocus = false;
_self.productBarCodeFocus = false;
_self.noteFocus = false;
setTimeout(
function() {
_self.$nextTick(
function(){
_self.QtyFocus = true;
if (_self.isScanenter && _self.currentBarCodeInfo.FQty) {
_self.QtyConfirm();
}
}
);
},
400
);
},
showFSECUNITQTYFocus: function(){
let _self = this;
_self.BoxFocus = false;
_self.FSECUNITQTYFocus = false;
_self.QtyFocus = false;
_self.FSCSPNumberFocus = false;
_self.billTypeFocus = false;
_self.sourceBillNoFocus = false;
_self.deptFocus = false;
_self.barcodeNumberFcous = false;
_self.FSCStockNumberFocus = false;
_self.locationFocus = false;
_self.splitQtyFocus = false;
_self.productInfoFocus = false;
_self.productBarCodeFocus = false;
_self.noteFocus = false;
setTimeout(
function() {
_self.$nextTick(
function(){
_self.FSECUNITQTYFocus = true;
if (_self.isScanenter && _self.currentBarCodeInfo.FBoxQty) {
_self.FSECUNITQTYConfirm();
}
}
);
},
400
);
},
showBoxFocus: function() {
let _self = this;
_self.BoxFocus = false;
_self.FSECUNITQTYFocus = false;
_self.QtyFocus = false;
_self.FSCSPNumberFocus = false;
_self.billTypeFocus = false;
_self.sourceBillNoFocus = false;
_self.deptFocus = false;
_self.barcodeNumberFcous = false;
_self.FSCStockNumberFocus = false;
_self.locationFocus = false;
_self.splitQtyFocus = false;
_self.productInfoFocus = false;
_self.productBarCodeFocus = false;
_self.noteFocus = false;
setTimeout(
function() {
_self.$nextTick(
function(){
_self.BoxFocus = true;
if (_self.isScanenter && _self.currentBarCodeInfo.FBoxQty) {
_self.BoxConfirm();
}
}
);
},
400
);
},
showSplitQtyFocus: function() {
let _self = this;
_self.BoxFocus = false;
_self.FSECUNITQTYFocus = false;
_self.QtyFocus = false;
_self.FSCSPNumberFocus = false;
_self.billTypeFocus = false;
_self.sourceBillNoFocus = false;
_self.deptFocus = false;
_self.barcodeNumberFcous = false;
_self.FSCStockNumberFocus = false;
_self.locationFocus = false;
_self.splitQtyFocus = false;
_self.productInfoFocus = false;
_self.productBarCodeFocus = false;
_self.noteFocus = false;
setTimeout(
function() {
_self.$nextTick(
function(){
_self.splitQtyFocus = true;
}
);
},
400
);
},
//检测存放位置
locationConfirm: async function() {
let _self = this;
this.key = this.key+1;
console.log("存放位置"+this.currentBarCodeInfo.FLocation);
let userId = this.$store.state.userInfo.UserID;
if ((!this.orderTypeID)
&& (this.currentTranType == 'STK_MisDelivery' || this.currentTranType == 'STK_MisCellaneous')) {
uni.showToast({
icon: "none",
title: "请选择单据类型",
duration: 3500,
});
return false;
}
if (!this.productInfo &&
(this.currentTranType == 'SP_PickMtrl' || this.currentTranType == 'SP_ReturnMtrl')) {
uni.showToast({
icon: "none",
title: "请输入生产对象",
duration: 3500,
});
return false;
}
if (!this.productID &&
(this.currentTranType == 'SP_PickMtrl' || this.currentTranType == 'SP_ReturnMtrl')) {
uni.showToast({
icon: "none",
title: "请输入正确的生产对象",
duration: 3500,
});
return false;
}
// if ((!this.developID) && (this.currentTranType == 'STK_MisDelivery')) {
// uni.showToast({
// icon: "none",
// title: "请选择研发项目",
// duration: 3500,
// });
// return false;
// }
if (!this.productBarCode &&
(this.currentTranType == 'SP_PickMtrl' || this.currentTranType == 'SP_ReturnMtrl')) {
uni.showToast({
icon: "none",
title: "请输入生产编号",
duration: 3500,
});
return false;
}
if ((!this.FOWNERID) && this.ownerTypeShow) {
uni.showToast({
icon: "none",
title: "请选择货主",
duration: 3500,
});
return false;
}
if ((!this.FOWNERTYPEID) && this.ownerTypeShow) {
uni.showToast({
icon: "none",
title: "请选择货主类型",
duration: 3500,
});
return false;
}
if (!this.currentBarCodeInfo.FBarcodeNumber) {
uni.showToast({
title: "请先扫描条码",
icon: "none",
duration: 3000,
});
return;
}
if (!this.currentBarCodeInfo.FItemNumber || this.currentBarCodeInfo.FItemNumber.length == 0) {
uni.showToast({
title: "请先查询条码",
icon: "none",
duration: 3000,
});
return;
}
let nextFlag = commonUtil.judgeFloat(this.currentBarCodeInfo.FQty);
if (!nextFlag || !this.currentBarCodeInfo.FQty) {
uni.showToast({
title:"请输入正确的数量值",
duration: 3500,
icon:"none"
})
return false;
}
let nextFlagBox = commonUtil.judgeFloat(this.currentBarCodeInfo.FBoxQty);
if (!nextFlagBox) {
uni.showToast({
title:"请输入正确的箱数值",
duration: 3500,
icon:"none"
});
return false;
}
if (this.currentBarCodeInfo.FCType != 3) {
let currentBarcode = this.currentBarCodeInfo.FBarcodeNumber;
if (this.barcodeList.length > 0) {
let barcodeExistList = this.barcodeList.filter(
function(barcode){
return barcode == currentBarcode;
}
);
if (barcodeExistList) {
if (barcodeExistList.length > 0) {
uni.showToast({
icon: "none",
title: "条码已存在",
duration: 3500,
});
return false;
}
}
}
}
let qtyCheckFlag = commonUtil.judgeFloat(this.currentBarCodeInfo.FQty);
if (!qtyCheckFlag) {
return false;
}
//库存状态非空
if(!_self.FSTOCKSTATUSID && _self.stockStatus
&& (_self.currentBarCodeInfo.FSourceTranType!='PUR_ReceiveBill' || _self.currentTranType!='PUR_MRB')){
uni.showToast({
title:'请选择库存状态',
icon:'none'
})
return false;
}
//外购入库时 入库类型非空
if(this.currentTranType=='STK_InStock'){
if(!this.FWWINTYPE){
uni.showToast({
title:'请选择入库类型',
icon:'none'
})
return false;
}
}
let requestParams = {
"tranType": this.currentTranType,
"stockData": this.currentBarCodeInfo.FLocation,
"sourceTranType": this.FSourceTranType,
"sourceBillNO": this.currentBarCodeInfo.FSourceBillNo.split('-')[0],
"orgID":this.orgFItemID
};
uni.showLoading({
icon:'loading',
title:'加载中……',
mask:true
});
if ((this.currentTranType == 'STK_MisDelivery' || this.currentTranType == 'SP_PickMtrl'||
this.currentTranType == 'PRD_PickMtrl' || this.currentTranType == 'PRD_FeedMtrl')
&& (this.currentBarCodeInfo.FQty != this.currentBarCodeInfo.FSplitQty)) {
let remainQty = commonUtil.round(parseFloat(this.currentBarCodeInfo.FQty)
- parseFloat(this.currentBarCodeInfo.FSplitQty), 6);
let parmater = {
"RemainQty": remainQty,
"Barcode": this.currentBarCodeInfo.FBarcodeNumber,
"SplitInfo": [],
"CurrentUnitId": this.FUnitID,
};
let listItem = {
"Barcode": this.currentBarCodeInfo.FBarcodeNumber,
"Qty": this.currentBarCodeInfo.FQty
};
let listItem2 = {
"Barcode": "",
"Qty": this.currentBarCodeInfo.FSplitQty
}
parmater.SplitInfo.push(listItem);
parmater.SplitInfo.push(listItem2);
this.$request.post('/Barcode/SplitBarcode',parmater).then(res => {
uni.hideLoading();
let data = res;
if (data && data.length > 0) {
uni.showToast({
icon: "none",
title: "条码拆分成功",
duration: 3500,
});
}
this.currentBarCodeInfo.FBarcodeNumber = data[0];
this.FBarcodeNumber = this.currentBarCodeInfo.FBarcodeNumber;
this.currentBarCodeInfo.FQty = this.currentBarCodeInfo.FSplitQty;
this.currentBarCodeInfo.barCodeInfo.FBARCODE = this.currentBarCodeInfo.FBarcodeNumber;
if (_self.currentBarCodeInfo.FSourceTranType=='PUR_ReceiveBill' && _self.currentTranType=='PUR_MRB') {
this.noStockDataRequest();
}
else {
this.queryStockDataRequest(requestParams);
}
let barPrintList = [];
barPrintList.push(this.currentBarCodeInfo.FBarcodeNumber);
let msg = '请选择是否打印新条码:' + this.currentBarCodeInfo.FBarcodeNumber + '?';
// uni.showModal({
// title: '提示',
// content: msg,
// confirmText: '确定',
// cancelText: '取消',
// success: function (res) {
// if (res.confirm) {
// _self.bluePrintBarcode(barPrintList);
// }
// }
// });
this.dialogProps(msg,"bluePrintBarcode",'');
this.$forceUpdate();
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
}
else {
if (_self.currentBarCodeInfo.FSourceTranType=='PUR_ReceiveBill' && _self.currentTranType=='PUR_MRB') {
this.noStockDataRequest();
}
else {
this.queryStockDataRequest(requestParams);
}
}
},
queryStockDataRequest(requestParams){
let _self = this;
this.$request.post('/SelBill/QueryStockData',requestParams).then(res => {
uni.hideLoading();
console.log("----locationCheck---- requestsuccess");
let data = res;
let sourceBillInfos = [];
//校验库存状态是否在存放位置的库存状态中
if (_self.stockStatus) {
if(!res.FSTOCKSTATUSALL){
uni.showToast({
title: '当前扫描仓库库存状态不存在',
icon:'none'
})
return false
}
let isFDEFSTOCKSTATUSID = true;
let statusList = '';
if(_self.FSTOCKSTATUSID){
if(res.FSTOCKSTATUSALL){
isFDEFSTOCKSTATUSID = res.FSTOCKSTATUSALL.some(e => {
return e.FNO == _self.FSTOCKSTATUSID
})
res.FSTOCKSTATUSALL.forEach(e => {
statusList = statusList + e.FNAME + ' '
})
}
}
let tips = "库存状态["+_self.FSTOCKSTATUSNAME+"]与仓库["+statusList+"]不符";
if(!isFDEFSTOCKSTATUSID){
this.dialogNoticeProps(tips,'error')
return false;
}
}
_self.currentBarCodeInfo.FLocation = data.FLOCATION;
_self.currentBarCodeInfo.FStockID = data.FSTOCKID;
_self.currentBarCodeInfo.FStockNumber = data.FSTOCKNUMBER;
_self.currentBarCodeInfo.FStockPlaceID = data.FSTOCKLOCID;
_self.currentBarCodeInfo.FStockPlaceNumber = data.FSTOCKLOCNUMBER;
_self.currentBarCodeInfo.FBoxQty = _self.currentBarCodeInfo.FBoxQty?_self.currentBarCodeInfo.FBoxQty:1;
// this.currentBarCodeInfo.FIsStockMgr = location.FIsStockMgr;
if (!_self.currentBarCodeInfo.FBoxQty) {
_self.currentBarCodeInfo.FBoxQty = 1;
}
let FID = _self.currentBarCodeInfo.barCodeInfo.FID ? _self.currentBarCodeInfo.barCodeInfo.FID:'';
let FISSECUNIT = _self.FISSECUNIT;
//简单领,退料
let FPRODUCTID, FPRODUCTNO;
let qty = commonUtil.round(parseFloat(_self.currentBarCodeInfo.FQty), 6);
let baseQty = _self.currentBarCodeInfo.FBASEQTY;
let FADJUSTQTY, FADJUSTBASEQTY;
if (_self.currentTranType == 'STK_MisDelivery') {
FID = _self.developID? _self.developID: '';
}
if (_self.currentTranType == 'SP_PickMtrl' || _self.currentTranType == 'SP_ReturnMtrl') {
FID = '';
//入库产品名称ID
FPRODUCTID = _self.productID ? _self.productID : '';
FPRODUCTNO = _self.productBarCode ? _self.productBarCode : '';
FISSECUNIT = undefined;
}
let qtyConversionRate = commonUtil.round(parseFloat(_self.currentBarCodeInfo.FBarcodeQty)/parseFloat(_self.currentBarCodeInfo.FBASEQTY), 10);
qty = commonUtil.round(qty*parseFloat(_self.currentBarCodeInfo.FBoxQty), 6);
baseQty = commonUtil.round(qty/qtyConversionRate, 6);
_self.currentBarCodeInfo.FBASEQTY = baseQty;
if (_self.currentBarCodeInfo.FSourceTranType) {
data.FSRCINFO.forEach(e => {
e.FSourceBillTypeName = _self.currentBarCodeInfo.FSourceBillTypeName;
e.FSourceBillNo = _self.currentBarCodeInfo.FSourceBillNo.split('-')[0];
// "FEntryID": _self.isShowBillRowNo ? el.FICMOEntryID : el.FEntryID,
e.FEntryID = e.FMOENTRYID?e.FMOENTRYID:'';
e.FItemID = e.FMATERIALID?e.FMATERIALID:'';
e.FItemNumber = e.FITEMNUMBER?e.FITEMNUMBER:'';
e.FItemName = e.FITEMNAME?e.FITEMNAME:'';
e.FSize = e.FSPECIFICATION?e.FSPECIFICATION:'';
// e.FModel = e.FSPECIFICATION?e.FSPECIFICATION:'';
e.FBatchNO = e.FLOT?e.FLOT:'';
e.FAuxPropName = e.FAUXPROPNAME ? e.FAUXPROPNAME :"" ;
e.FQty = e.FAUXQTY?e.FAUXQTY:'';
e.Fcommitqty = (e.FRELATIONQTY==0)? 0:(e.FRELATIONQTY?e.FRELATIONQTY:'-');
e.FUnitName = e.FUNITNAME?e.FUNITNAME:'';
e.PPBOMFBillNo = e.FMOBILLNO?e.FMOBILLNO:'';
e.FICMOEntryID = e.FMOID?e.FMOID:'';
e.FSupplyName = e.FSUPPLYNAME?e.FSUPPLYNAME:'';
e.FDeptName = e.FDEPTNAME?e.FDEPTNAME:'';
e.FCustName = e.FCUSTNAME?e.FCUSTNAME:'';
e.comb = _self.currentBarCodeInfo.FSourceBillNo + (e.FITEMNUMBER?e.FITEMNUMBER:'');
});
sourceBillInfos = data.FSRCINFO;
//箱码时不校验数量是否超出源单数量
console.log('_self.currentBarCodeInfo',_self.currentBarCodeInfo)
if(_self.currentBarCodeInfo.FIsBox != '1') {
if (_self.FIsControlQty) {
if(_self.currentBarCodeInfo.FSourceTranType!='PRD_MO'&&_self.currentTranType!='PRD_FeedMtrl'){//补料领用单功能页源单为生产任务单时不校验条码数量
if (!_self.currentBarCodeInfo.FIsOpenSource) {
_self.sourceBillTempList = [];
sourceBillInfos.forEach(el => {
//记录源单数量信息
let newQtyData = {};
qtyControlUtil.groupFieldArray.forEach(function(item){ newQtyData[item] = el[item]? el[item]: ""; } );
newQtyData[qtyControlUtil.billQtyField] = el[qtyControlUtil.billQtyField]? el[qtyControlUtil.billQtyField]: 0;
_self.sourceBillTempList.push(newQtyData);
console.log("-----qtyControlUtil -- sourceBillTempList-----", _self.sourceBillTempList);
});
}
if (_self.sourceBillTempList && _self.sourceBillTempList.length > 0) {
// checkQty: function(sourceBillArray, scannedArray, FBASEQTY, FSourceBillNo, FSRCENTRYID, FMATERIALID, FLOT, callback) {
// sumBillQty, sumScannedQty, FBASEQTY
let scannedArrayJson = JSON.stringify(_self.yesTableData);
let scannedArray = JSON.parse(scannedArrayJson);
let splitFlag = false;
if ((this.currentTranType == 'SP_PickMtrl' || this.currentTranType == 'STK_MisDelivery'||
this.currentTranType == 'PRD_PickMtrl' || this.currentTranType == 'PRD_FeedMtrl') && !this.splitQtyDisabled) {
splitFlag = true;
}
if (!qtyControlUtil.checkQty(
_self.sourceBillTempList, scannedArray, _self.currentBarCodeInfo,
function(sumBillQty, sumScannedQty, qty){
_self.errDetails = "物料("+_self.currentBarCodeInfo.FITEMNAME+")本次扫描数量"+qty+"大于源单("+
_self.currentBarCodeInfo.FSRCBILLNO+")剩余数量"+sumBillQty+"-已扫描数量"+sumScannedQty;
},
_self.FISCHECKLOT, splitFlag)
) {
_self.errDetailsList.push(_self.errDetails);
// _self.showErrTips = true;
let err = _self.errDetailsList.toString();
_self.dialogNoticeProps(err,'error')
return false;
}
}
}
}
}
}
let rowDataBarcode = {
"FSourceBillTypeName": this.currentBarCodeInfo.FSourceBillTypeName?this.currentBarCodeInfo.FSourceBillTypeName:"",
"FSourceBillNo": this.currentBarCodeInfo.FSourceBillNo.split('-')[0]?this.currentBarCodeInfo.FSourceBillNo.split('-')[0]:"",
"FBoxNumber": this.currentBarCodeInfo.FBoxNumber?this.currentBarCodeInfo.FBoxNumber:"",
"FBarcodeNumber": this.currentBarCodeInfo.FBarcodeNumber?this.currentBarCodeInfo.FBarcodeNumber:"",
"FItemNumber": this.currentBarCodeInfo.FItemNumber?this.currentBarCodeInfo.FItemNumber:"",
"FItemName": this.currentBarCodeInfo.FItemName?this.currentBarCodeInfo.FItemName:"",
"FItemID": this.currentBarCodeInfo.FItemID,
"FSize": this.currentBarCodeInfo.FSize?this.currentBarCodeInfo.FSize:"",
// "FModel": this.currentBarCodeInfo.FModel?this.currentBarCodeInfo.FModel:"",
"FBatchNO": this.currentBarCodeInfo.FBatchNO ? this.currentBarCodeInfo.FBatchNO : "",
"FAuxPropName": this.currentBarCodeInfo.FAuxPropName ? this.currentBarCodeInfo.FAuxPropName : "",
"FKFPeriod": this.currentBarCodeInfo.FKFPeriod ? this.currentBarCodeInfo.FKFPeriod : "",
"FKFDate": this.currentBarCodeInfo.FKFDate?this.currentBarCodeInfo.FKFDate:"",
"FQty": qty,
"FUnitName": this.currentBarCodeInfo.FUnitName?this.currentBarCodeInfo.FUnitName:"",
"FStockNumber": this.currentBarCodeInfo.FStockNumber?this.currentBarCodeInfo.FStockNumber:"",
"FStockPlaceNumber": this.currentBarCodeInfo.FStockPlaceNumber?this.currentBarCodeInfo.FStockPlaceNumber:"",
"FStockID": this.currentBarCodeInfo.FStockID,
"FStockPlaceID": this.currentBarCodeInfo.FStockPlaceID,
"FICMOEntryID": this.RowNo,
"FIsBox": false
};
qtyControlUtil.groupFieldArray.forEach(
function(item){
rowDataBarcode[item] = _self.currentBarCodeInfo[item]? _self.currentBarCodeInfo[item]: "";
}
);
rowDataBarcode[qtyControlUtil.barcodeQtyField] = _self.currentBarCodeInfo[qtyControlUtil.barcodeQtyField]? _self.currentBarCodeInfo[qtyControlUtil.barcodeQtyField]: 0;
if (this.currentBarCodeInfo.FIsBox == 0) {
_self.yesTableData.push(rowDataBarcode);
}
let commitDataBarcode = {
"FPRODUCTID": FPRODUCTID,
"FPRODUCTNO": FPRODUCTNO,
"FSRCFORMID":this.currentBarCodeInfo.FSourceTranType?this.currentBarCodeInfo.FSourceTranType:'',
"FID": FID,
"FNO": this.currentBarCodeInfo.barCodeInfo.NO?this.currentBarCodeInfo.barCodeInfo.NO:'',
"FNAME": this.currentBarCodeInfo.barCodeInfo.FNAME?this.currentBarCodeInfo.barCodeInfo.FNAME:'',
"FBARCODE": this.currentBarCodeInfo.barCodeInfo.FBARCODE?this.currentBarCodeInfo.barCodeInfo.FBARCODE:'',
"FBARTYPE": this.currentBarCodeInfo.barCodeInfo.FBARTYPE?this.currentBarCodeInfo.barCodeInfo.FBARTYPE:'',
"FBOXBARCODE": this.currentBarCodeInfo.barCodeInfo.FBOXBARCODE?this.currentBarCodeInfo.barCodeInfo.FBOXBARCODE:'',
"FISBOX": this.currentBarCodeInfo.barCodeInfo.FISBOX?this.currentBarCodeInfo.barCodeInfo.FISBOX:0,
"FMATERIALID": this.currentBarCodeInfo.barCodeInfo.FMATERIALID?this.currentBarCodeInfo.barCodeInfo.FMATERIALID:'',
"FITEMNUMBER": this.currentBarCodeInfo.barCodeInfo.FITEMNUMBER?this.currentBarCodeInfo.barCodeInfo.FITEMNUMBER:'',
"FITEMNAME": this.currentBarCodeInfo.barCodeInfo.FITEMNAME?this.currentBarCodeInfo.barCodeInfo.FITEMNAME:'',
"FSPECIFICATION": this.currentBarCodeInfo.barCodeInfo.FSPECIFICATION?this.currentBarCodeInfo.barCodeInfo.FSPECIFICATION:'',
"FUNITID": this.currentBarCodeInfo.barCodeInfo.FUNITID?this.currentBarCodeInfo.barCodeInfo.FUNITID:'',
"FUNITNAME": this.currentBarCodeInfo.barCodeInfo.FUNITNAME?this.currentBarCodeInfo.barCodeInfo.FUNITNAME:'',
"FSTOCKID": this.currentBarCodeInfo.FStockID?this.currentBarCodeInfo.FStockID:'',
"FSTOCKLOCID": this.currentBarCodeInfo.FStockPlaceID?this.currentBarCodeInfo.FStockPlaceID:'',
"FLOCATION": this.currentBarCodeInfo.FLocation?this.currentBarCodeInfo.FLocation:'',
"FSRCINFO": this.currentBarCodeInfo.barCodeInfo.FSRCINFO?this.currentBarCodeInfo.barCodeInfo.FSRCINFO:null,
"FSRCID": this.currentBarCodeInfo.barCodeInfo.FSRCID?this.currentBarCodeInfo.barCodeInfo.FSRCID:'',
"FSRCBILLNO": this.currentBarCodeInfo.barCodeInfo.FSRCBILLNO?this.currentBarCodeInfo.barCodeInfo.FSRCBILLNO:'',
"FSRCENTRYID": this.currentBarCodeInfo.barCodeInfo.FSRCENTRYID?this.currentBarCodeInfo.barCodeInfo.FSRCENTRYID:0,
"FSRCDETAILID": this.currentBarCodeInfo.barCodeInfo.FSRCDETAILID?this.currentBarCodeInfo.barCodeInfo.FSRCDETAILID:'',
"FQTY": qty,
"FLOT": this.currentBarCodeInfo.barCodeInfo.FLOT?this.currentBarCodeInfo.barCodeInfo.FLOT:'',
"FAUXPROPID": this.currentBarCodeInfo.barCodeInfo.FAUXPROPID?this.currentBarCodeInfo.barCodeInfo.FAUXPROPID:'',
// "FISKFPERIOD":this.currentBarCodeInfo.barCodeInfo.FISKFPERIOD?this.currentBarCodeInfo.barCodeInfo.FISKFPERIOD:'',
"FKFPERIOD": this.currentBarCodeInfo.barCodeInfo.FKFPERIOD?this.currentBarCodeInfo.barCodeInfo.FKFPERIOD:0,
"FKFDATE": this.currentBarCodeInfo.barCodeInfo.FKFDATE?this.currentBarCodeInfo.barCodeInfo.FKFDATE:'',
"FBOXINFO": this.currentBarCodeInfo.barCodeInfo.FBOXINFO?this.currentBarCodeInfo.barCodeInfo.FBOXINFO:[],
"FCOMPANYID": this.orgFItemID,
"FBASEUNITID": this.currentBarCodeInfo.barCodeInfo.FBASEUNITID?this.currentBarCodeInfo.barCodeInfo.FBASEUNITID:'',
"FBASEQTY": baseQty,
"FDEPTID": this.FDEPTID ? this.FDEPTID : '',
"FSUPPLYID": this.FSUPPLYID ? this.FSUPPLYID : '',
"FCUSTID": this.FCUSTID ? this.FCUSTID : '',
"FSECUNITQTY": this.FSECUNITQTY ? this.FSECUNITQTY : 0,
"FSECUNITID": this.FSECUNITID,
"FISSECUNIT": FISSECUNIT,
"FKEEPERID": this.FKEEPERID,
"FKEEPERTYPEID": this.FKEEPERTYPEID,
"FOWNERID": this.FOWNERID,
"FOWNERTYPEID": this.FOWNERTYPEID,
"FSTOCKSTATUSID": this.FSTOCKSTATUSID ? this.FSTOCKSTATUSID : '',
"FUSEFULDATE": this.FUSEFULDATE,
"FWWINTYPE": this.FWWINTYPE
};
// _self.fNameArray.forEach(
// function(item, index){
// if(index == 0) {
// commitDataBarcode[item.headerFID] = _self.currentBarCodeInfo.FID0;
// }
// if(index == 1) {
// commitDataBarcode[item.headerFID] = _self.currentBarCodeInfo.FID1;
// }
// }
// );
_self.commitList.push(commitDataBarcode);
_self.boxTempList.forEach(
function(el){
let elData = {
"FSourceBillTypeName": el.FSourceBillTypeName?el.FSourceBillTypeName:"",
"FSourceBillNo": el.FSourceBillNo?el.FSourceBillNo:"",
"FBoxNumber": el.FBoxNumber?el.FBoxNumber:"",
"FBarcodeNumber": el.FBarcodeNumber?el.FBarcodeNumber:"",
"FItemNumber": el.FItemNumber?el.FItemNumber:"",
"FItemName": el.FItemName?el.FItemName:"",
"FItemID": el.FItemID?el.FItemID:"",
"FSize": el.FSize?el.FSize:"",
// "FModel": el.FModel?el.FModel:"",
"FBatchNO": el.FBatchNO ? el.FBatchNO : "",
"FAuxPropName": el.FAuxPropName ? el.FAuxPropName : "",
"FKFPeriod": el.FKFPeriod ? el.FKFPeriod : "",
"FKFDate": el.FKFDate ? el.FKFDate : "",
"FQty": el.FQty?el.FQty:"",
"FUnitName": el.FUnitName?el.FUnitName:"",
"FStockNumber": _self.currentBarCodeInfo.FStockNumber?_self.currentBarCodeInfo.FStockNumber:"",
"FStockPlaceNumber": _self.currentBarCodeInfo.FStockPlaceNumber?_self.currentBarCodeInfo.FStockPlaceNumber:"",
"FStockID": _self.currentBarCodeInfo.FStockID?_self.currentBarCodeInfo.FStockID:"",
"FStockPlaceID": _self.currentBarCodeInfo.FStockPlaceID?_self.currentBarCodeInfo.FStockPlaceID:"",
"FIsBox": true,
"FICMOEntryID": _self.RowNo?_self.RowNo:"",
"FBASEQTY": parseFloat(el["FBASEQTY"]?el["FBASEQTY"]:0)*parseFloat(_self.currentBarCodeInfo.FBoxQty),
};
qtyControlUtil.groupFieldArray.forEach(
function(item){
elData[item] = _self.currentBarCodeInfo[item]? _self.currentBarCodeInfo[item]: "";
}
);
// elData[qtyControlUtil.barcodeQtyField] = _self.currentBarCodeInfo[qtyControlUtil.barcodeQtyField]? _self.currentBarCodeInfo[qtyControlUtil.barcodeQtyField]: 0;
_self.yesTableData.push(elData);
console.log("----qtyControlUtil--yesTableData--1", elData);
//已扫箱码的条码
_self.barcodeList.push(el.FBarcodeNumber);
}
)
_self.boxTempList.splice(0, _self.boxTempList.length);
this.barcodeList.push(this.currentBarCodeInfo.FBarcodeNumber);
//debugger
if(this.currentBarCodeInfo.FSourceTranType){
if(!this.currentBarCodeInfo.FIsOpenSource){
if(sourceBillInfos.length>0){
sourceBillInfos.forEach(e => {
_self.baseTableData.push(e);
_self.TempBaseTableData.push(e)
})
this.baseTableData.forEach(e => {
e.sourceBillCompare = (e.FSRCBILLNO).toString()+(e.FSRCID).toString()+(e.FSRCDETAILID).toString()+(e.FCOMPANYID).toString()
})
let obj = {};
this.baseTableData= this.baseTableData.reduce((cur,next) => {
obj[next.sourceBillCompare] ? "" : obj[next.sourceBillCompare] = true && cur.push(next);
return cur;
},[]);
this.TempBaseTableData.forEach(e => {
e.sourceBillCompare = (e.FSRCBILLNO).toString()+(e.FSRCID).toString()+(e.FSRCDETAILID).toString()+(e.FCOMPANYID).toString()
})
this.TempBaseTableData= this.TempBaseTableData.reduce((cur,next) => {
obj[next.sourceBillCompare] ? "" : obj[next.sourceBillCompare] = true && cur.push(next);
return cur;
},[]);
}
}
}
_self.Calculate();
_self.splitQtyDisabled = true;
_self.barcodeQtyDisabled = true;
uni.showToast({
icon: 'success',
title: "数据输入成功"
});
console.log("this.commitList",this.commitList);
this.storageLocation = this.currentBarCodeInfo.FLocation;
let lastSaveOrgid = this.orgFItemID; //最后一次条码录入成功后(条码进入已扫描列表)的组织ID
uni.setStorageSync(this.dbAlise+this.userName+this.currentTranType+'lastSaveOrgid',lastSaveOrgid);
this.saveCash();
this.FBarcodeNumber = "";
this.currentBarCodeInfo.FBarcodeNumber = "";
this.currentBarCodeInfo.FItemNumber = "";
this.currentBarCodeInfo.FItemName = "";
this.currentBarCodeInfo.FModel = "";
this.currentBarCodeInfo.FAuxPropName = "";
this.currentBarCodeInfo.FQty = "";
this.currentBarCodeInfo.FBoxQty = "";
this.currentBarCodeInfo.FSplitQty = "";
this.currentBarCodeInfo.FLOT = "";
this.currentBarCodeInfo.FUNITNAME = "";
this.FBackReson = "";
this.showBarcodeNumberFcous();
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
noStockDataRequest(){
uni.hideLoading();
let _self = this;
_self.FSTOCKSTATUSNAME = "";
_self.FSTOCKSTATUSID = "";
_self.currentBarCodeInfo.FLocation = "";
_self.currentBarCodeInfo.FStockID = "";
_self.currentBarCodeInfo.FStockNumber = "";
_self.currentBarCodeInfo.FStockPlaceID = "";
_self.currentBarCodeInfo.FStockPlaceNumber = "";
_self.currentBarCodeInfo.FBoxQty = _self.currentBarCodeInfo.FBoxQty?_self.currentBarCodeInfo.FBoxQty:1;
// this.currentBarCodeInfo.FIsStockMgr = location.FIsStockMgr;
if (!_self.currentBarCodeInfo.FBoxQty) {
_self.currentBarCodeInfo.FBoxQty = 1;
}
let FID = _self.currentBarCodeInfo.barCodeInfo.FID ? _self.currentBarCodeInfo.barCodeInfo.FID:'';
let FISSECUNIT = _self.FISSECUNIT;
//简单领,退料
let FPRODUCTID, FPRODUCTNO;
let qty = commonUtil.round(parseFloat(_self.currentBarCodeInfo.FQty), 6);
let baseQty = _self.currentBarCodeInfo.FBASEQTY;
let FADJUSTQTY, FADJUSTBASEQTY;
if (_self.currentTranType == 'STK_MisDelivery') {
FID = _self.developID? _self.developID: '';
}
if (_self.currentTranType == 'SP_PickMtrl' || _self.currentTranType == 'SP_ReturnMtrl') {
FID = '';
//入库产品名称ID
FPRODUCTID = _self.productID ? _self.productID : '';
FPRODUCTNO = _self.productBarCode ? _self.productBarCode : '';
FISSECUNIT = undefined;
}
let qtyConversionRate = commonUtil.round(parseFloat(_self.currentBarCodeInfo.FBarcodeQty)/parseFloat(_self.currentBarCodeInfo.FBASEQTY), 10);
qty = commonUtil.round(qty*parseFloat(_self.currentBarCodeInfo.FBoxQty), 6);
baseQty = commonUtil.round(qty/qtyConversionRate, 6);
_self.currentBarCodeInfo.FBASEQTY = baseQty;
let sourceBillInfos = [];
if (_self.currentBarCodeInfo.FSourceTranType) {
sourceBillInfos = _self.baseTableData.filter(item=>{
if (item.FSRCBILLNO == _self.currentBarCodeInfo.FSourceBillNo.split('-')[0]
&& item.FItemNumber == _self.currentBarCodeInfo.FItemNumber) {
return true;
}
return false;
});
//箱码时不校验数量是否超出源单数量
console.log('_self.currentBarCodeInfo',_self.currentBarCodeInfo)
if(_self.currentBarCodeInfo.FIsBox != '1'){
if (_self.FIsControlQty) {
if(_self.currentBarCodeInfo.FSourceTranType!='PRD_MO'&&_self.currentTranType!='PRD_FeedMtrl'){//补料领用单功能页源单为生产任务单时不校验条码数量
if (!_self.currentBarCodeInfo.FIsOpenSource) {
_self.sourceBillTempList = [];
sourceBillInfos.forEach(el => {
//记录源单数量信息
let newQtyData = {};
qtyControlUtil.groupFieldArray.forEach(function(item){ newQtyData[item] = el[item]? el[item]: ""; } );
newQtyData[qtyControlUtil.billQtyField] = el[qtyControlUtil.billQtyField]? el[qtyControlUtil.billQtyField]: 0;
_self.sourceBillTempList.push(newQtyData);
console.log("-----qtyControlUtil -- sourceBillTempList-----", _self.sourceBillTempList);
});
}
if (_self.sourceBillTempList && _self.sourceBillTempList.length > 0) {
// checkQty: function(sourceBillArray, scannedArray, FBASEQTY, FSourceBillNo, FSRCENTRYID, FMATERIALID, FLOT, callback) {
// sumBillQty, sumScannedQty, FBASEQTY
let scannedArrayJson = JSON.stringify(_self.yesTableData);
let scannedArray = JSON.parse(scannedArrayJson);
let splitFlag = false;
if ((this.currentTranType == 'SP_PickMtrl' || this.currentTranType == 'STK_MisDelivery'||
this.currentTranType == 'PRD_PickMtrl' || this.currentTranType == 'PRD_FeedMtrl') && !this.splitQtyDisabled) {
splitFlag = true;
}
if (!qtyControlUtil.checkQty(
_self.sourceBillTempList, scannedArray, _self.currentBarCodeInfo,
function(sumBillQty, sumScannedQty, qty){
_self.errDetails = "物料("+_self.currentBarCodeInfo.FITEMNAME+")本次扫描数量"+qty+"大于源单("+
_self.currentBarCodeInfo.FSRCBILLNO+")剩余数量"+sumBillQty+"-已扫描数量"+sumScannedQty;
},
_self.FISCHECKLOT, splitFlag)
) {
_self.errDetailsList.push(_self.errDetails);
// _self.showErrTips = true;
let err = _self.errDetailsList.toString();
_self.dialogNoticeProps(err,'error')
return false;
}
}
}
}
}
}
let rowDataBarcode = {
"FSourceBillTypeName": this.currentBarCodeInfo.FSourceBillTypeName?this.currentBarCodeInfo.FSourceBillTypeName:"",
"FSourceBillNo": this.currentBarCodeInfo.FSourceBillNo.split('-')[0]?this.currentBarCodeInfo.FSourceBillNo.split('-')[0]:"",
"FBoxNumber": this.currentBarCodeInfo.FBoxNumber?this.currentBarCodeInfo.FBoxNumber:"",
"FBarcodeNumber": this.currentBarCodeInfo.FBarcodeNumber?this.currentBarCodeInfo.FBarcodeNumber:"",
"FItemNumber": this.currentBarCodeInfo.FItemNumber?this.currentBarCodeInfo.FItemNumber:"",
"FItemName": this.currentBarCodeInfo.FItemName?this.currentBarCodeInfo.FItemName:"",
"FItemID": this.currentBarCodeInfo.FItemID,
"FSize": this.currentBarCodeInfo.FSize?this.currentBarCodeInfo.FSize:"",
// "FModel": this.currentBarCodeInfo.FModel?this.currentBarCodeInfo.FModel:"",
"FBatchNO": this.currentBarCodeInfo.FBatchNO ? this.currentBarCodeInfo.FBatchNO : "",
"FAuxPropName": this.currentBarCodeInfo.FAuxPropName ? this.currentBarCodeInfo.FAuxPropName : "",
"FKFPeriod": this.currentBarCodeInfo.FKFPeriod ? this.currentBarCodeInfo.FKFPeriod : "",
"FKFDate": this.currentBarCodeInfo.FKFDate?this.currentBarCodeInfo.FKFDate:"",
"FQty": qty,
"FUnitName": this.currentBarCodeInfo.FUnitName?this.currentBarCodeInfo.FUnitName:"",
"FStockNumber": this.currentBarCodeInfo.FStockNumber?this.currentBarCodeInfo.FStockNumber:"",
"FStockPlaceNumber": this.currentBarCodeInfo.FStockPlaceNumber?this.currentBarCodeInfo.FStockPlaceNumber:"",
"FStockID": this.currentBarCodeInfo.FStockID?this.currentBarCodeInfo.FStockID:"",
"FStockPlaceID": this.currentBarCodeInfo.FStockPlaceID?this.currentBarCodeInfo.FStockPlaceID:"",
"FICMOEntryID": this.RowNo,
"FIsBox": false
};
qtyControlUtil.groupFieldArray.forEach(
function(item){
rowDataBarcode[item] = _self.currentBarCodeInfo[item]? _self.currentBarCodeInfo[item]: "";
}
);
rowDataBarcode[qtyControlUtil.barcodeQtyField] = _self.currentBarCodeInfo[qtyControlUtil.barcodeQtyField]? _self.currentBarCodeInfo[qtyControlUtil.barcodeQtyField]: 0;
if (this.currentBarCodeInfo.FIsBox == 0) {
_self.yesTableData.push(rowDataBarcode);
}
let commitDataBarcode = {
"FPRODUCTID": FPRODUCTID,
"FPRODUCTNO": FPRODUCTNO,
"FSRCFORMID":this.currentBarCodeInfo.FSourceTranType?this.currentBarCodeInfo.FSourceTranType:'',
"FID": FID,
"FNO": this.currentBarCodeInfo.barCodeInfo.NO?this.currentBarCodeInfo.barCodeInfo.NO:'',
"FNAME": this.currentBarCodeInfo.barCodeInfo.FNAME?this.currentBarCodeInfo.barCodeInfo.FNAME:'',
"FBARCODE": this.currentBarCodeInfo.barCodeInfo.FBARCODE?this.currentBarCodeInfo.barCodeInfo.FBARCODE:'',
"FBARTYPE": this.currentBarCodeInfo.barCodeInfo.FBARTYPE?this.currentBarCodeInfo.barCodeInfo.FBARTYPE:'',
"FBOXBARCODE": this.currentBarCodeInfo.barCodeInfo.FBOXBARCODE?this.currentBarCodeInfo.barCodeInfo.FBOXBARCODE:'',
"FISBOX": this.currentBarCodeInfo.barCodeInfo.FISBOX?this.currentBarCodeInfo.barCodeInfo.FISBOX:0,
"FMATERIALID": this.currentBarCodeInfo.barCodeInfo.FMATERIALID?this.currentBarCodeInfo.barCodeInfo.FMATERIALID:'',
"FITEMNUMBER": this.currentBarCodeInfo.barCodeInfo.FITEMNUMBER?this.currentBarCodeInfo.barCodeInfo.FITEMNUMBER:'',
"FITEMNAME": this.currentBarCodeInfo.barCodeInfo.FITEMNAME?this.currentBarCodeInfo.barCodeInfo.FITEMNAME:'',
"FSPECIFICATION": this.currentBarCodeInfo.barCodeInfo.FSPECIFICATION?this.currentBarCodeInfo.barCodeInfo.FSPECIFICATION:'',
"FUNITID": this.currentBarCodeInfo.barCodeInfo.FUNITID?this.currentBarCodeInfo.barCodeInfo.FUNITID:'',
"FUNITNAME": this.currentBarCodeInfo.barCodeInfo.FUNITNAME?this.currentBarCodeInfo.barCodeInfo.FUNITNAME:'',
"FSTOCKID": this.currentBarCodeInfo.FStockID?this.currentBarCodeInfo.FStockID:'',
"FSTOCKLOCID": this.currentBarCodeInfo.FStockPlaceID?this.currentBarCodeInfo.FStockPlaceID:'',
"FLOCATION": this.currentBarCodeInfo.FLocation?this.currentBarCodeInfo.FLocation:'',
"FSRCINFO": this.currentBarCodeInfo.barCodeInfo.FSRCINFO?this.currentBarCodeInfo.barCodeInfo.FSRCINFO:null,
"FSRCID": this.currentBarCodeInfo.barCodeInfo.FSRCID?this.currentBarCodeInfo.barCodeInfo.FSRCID:'',
"FSRCBILLNO": this.currentBarCodeInfo.barCodeInfo.FSRCBILLNO?this.currentBarCodeInfo.barCodeInfo.FSRCBILLNO:'',
"FSRCENTRYID": this.currentBarCodeInfo.barCodeInfo.FSRCENTRYID?this.currentBarCodeInfo.barCodeInfo.FSRCENTRYID:0,
"FSRCDETAILID": this.currentBarCodeInfo.barCodeInfo.FSRCDETAILID?this.currentBarCodeInfo.barCodeInfo.FSRCDETAILID:'',
"FQTY": qty,
"FLOT": this.currentBarCodeInfo.barCodeInfo.FLOT?this.currentBarCodeInfo.barCodeInfo.FLOT:'',
"FAUXPROPID": this.currentBarCodeInfo.barCodeInfo.FAUXPROPID?this.currentBarCodeInfo.barCodeInfo.FAUXPROPID:'',
// "FISKFPERIOD":this.currentBarCodeInfo.barCodeInfo.FISKFPERIOD?this.currentBarCodeInfo.barCodeInfo.FISKFPERIOD:'',
"FKFPERIOD": this.currentBarCodeInfo.barCodeInfo.FKFPERIOD?this.currentBarCodeInfo.barCodeInfo.FKFPERIOD:0,
"FKFDATE": this.currentBarCodeInfo.barCodeInfo.FKFDATE?this.currentBarCodeInfo.barCodeInfo.FKFDATE:'',
"FBOXINFO": this.currentBarCodeInfo.barCodeInfo.FBOXINFO?this.currentBarCodeInfo.barCodeInfo.FBOXINFO:[],
"FCOMPANYID": this.orgFItemID,
"FBASEUNITID": this.currentBarCodeInfo.barCodeInfo.FBASEUNITID?this.currentBarCodeInfo.barCodeInfo.FBASEUNITID:'',
"FBASEQTY": baseQty,
"FDEPTID": this.FDEPTID ? this.FDEPTID : '',
"FSUPPLYID": this.FSUPPLYID ? this.FSUPPLYID : '',
"FCUSTID": this.FCUSTID ? this.FCUSTID : '',
"FSECUNITQTY": this.FSECUNITQTY ? this.FSECUNITQTY : 0,
"FSECUNITID": this.FSECUNITID,
"FISSECUNIT": FISSECUNIT,
"FKEEPERID": this.FKEEPERID,
"FKEEPERTYPEID": this.FKEEPERTYPEID,
"FOWNERID": this.FOWNERID,
"FOWNERTYPEID": this.FOWNERTYPEID,
"FSTOCKSTATUSID": this.FSTOCKSTATUSID ? this.FSTOCKSTATUSID : '',
"FUSEFULDATE": this.FUSEFULDATE,
"FWWINTYPE": this.FWWINTYPE
};
// _self.fNameArray.forEach(
// function(item, index){
// if(index == 0) {
// commitDataBarcode[item.headerFID] = _self.currentBarCodeInfo.FID0;
// }
// if(index == 1) {
// commitDataBarcode[item.headerFID] = _self.currentBarCodeInfo.FID1;
// }
// }
// );
_self.commitList.push(commitDataBarcode);
_self.boxTempList.forEach(
function(el){
let elData = {
"FSourceBillTypeName": el.FSourceBillTypeName?el.FSourceBillTypeName:"",
"FSourceBillNo": el.FSourceBillNo?el.FSourceBillNo:"",
"FBoxNumber": el.FBoxNumber?el.FBoxNumber:"",
"FBarcodeNumber": el.FBarcodeNumber?el.FBarcodeNumber:"",
"FItemNumber": el.FItemNumber?el.FItemNumber:"",
"FItemName": el.FItemName?el.FItemName:"",
"FItemID": el.FItemID?el.FItemID:"",
"FSize": el.FSize?el.FSize:"",
// "FModel": el.FModel?el.FModel:"",
"FBatchNO": el.FBatchNO ? el.FBatchNO : "",
"FAuxPropName": el.FAuxPropName ? el.FAuxPropName : "",
"FKFPeriod": el.FKFPeriod ? el.FKFPeriod : "",
"FKFDate": el.FKFDate ? el.FKFDate : "",
"FQty": el.FQty?el.FQty:"",
"FUnitName": el.FUnitName?el.FUnitName:"",
"FStockNumber": _self.currentBarCodeInfo.FStockNumber?_self.currentBarCodeInfo.FStockNumber:"",
"FStockPlaceNumber": _self.currentBarCodeInfo.FStockPlaceNumber?_self.currentBarCodeInfo.FStockPlaceNumber:"",
"FStockID": _self.currentBarCodeInfo.FStockID?_self.currentBarCodeInfo.FStockID:"",
"FStockPlaceID": _self.currentBarCodeInfo.FStockPlaceID?_self.currentBarCodeInfo.FStockPlaceID:"",
"FIsBox": true,
"FICMOEntryID": _self.RowNo?_self.RowNo:"",
"FBASEQTY": parseFloat(el["FBASEQTY"]?el["FBASEQTY"]:0)*parseFloat(_self.currentBarCodeInfo.FBoxQty),
};
qtyControlUtil.groupFieldArray.forEach(
function(item){
elData[item] = _self.currentBarCodeInfo[item]? _self.currentBarCodeInfo[item]: "";
}
);
// elData[qtyControlUtil.barcodeQtyField] = _self.currentBarCodeInfo[qtyControlUtil.barcodeQtyField]? _self.currentBarCodeInfo[qtyControlUtil.barcodeQtyField]: 0;
_self.yesTableData.push(elData);
console.log("----qtyControlUtil--yesTableData--1", elData);
//已扫箱码的条码
_self.barcodeList.push(el.FBarcodeNumber);
}
)
_self.boxTempList.splice(0, _self.boxTempList.length);
this.barcodeList.push(this.currentBarCodeInfo.FBarcodeNumber);
//debugger
if(this.currentBarCodeInfo.FSourceTranType){
if(!this.currentBarCodeInfo.FIsOpenSource){
if(sourceBillInfos.length>0){
sourceBillInfos.forEach(e => {
_self.baseTableData.push(e);
_self.TempBaseTableData.push(e)
})
this.baseTableData.forEach(e => {
e.sourceBillCompare = (e.FSRCBILLNO).toString()+(e.FSRCID).toString()+(e.FSRCDETAILID).toString()+(e.FCOMPANYID).toString()
})
let obj = {};
this.baseTableData= this.baseTableData.reduce((cur,next) => {
obj[next.sourceBillCompare] ? "" : obj[next.sourceBillCompare] = true && cur.push(next);
return cur;
},[]);
this.TempBaseTableData.forEach(e => {
e.sourceBillCompare = (e.FSRCBILLNO).toString()+(e.FSRCID).toString()+(e.FSRCDETAILID).toString()+(e.FCOMPANYID).toString()
})
this.TempBaseTableData= this.TempBaseTableData.reduce((cur,next) => {
obj[next.sourceBillCompare] ? "" : obj[next.sourceBillCompare] = true && cur.push(next);
return cur;
},[]);
}
}
}
_self.Calculate();
_self.splitQtyDisabled = true;
_self.barcodeQtyDisabled = true;
uni.showToast({
icon: 'success',
title: "数据输入成功"
});
console.log("this.commitList",this.commitList);
this.storageLocation = this.currentBarCodeInfo.FLocation;
let lastSaveOrgid = this.orgFItemID; //最后一次条码录入成功后(条码进入已扫描列表)的组织ID
uni.setStorageSync(this.dbAlise+this.userName+this.currentTranType+'lastSaveOrgid',lastSaveOrgid);
this.saveCash();
this.FBarcodeNumber = "";
this.currentBarCodeInfo.FBarcodeNumber = "";
this.currentBarCodeInfo.FItemNumber = "";
this.currentBarCodeInfo.FItemName = "";
this.currentBarCodeInfo.FModel = "";
this.currentBarCodeInfo.FAuxPropName = "";
this.currentBarCodeInfo.FQty = "";
this.currentBarCodeInfo.FBoxQty = "";
this.currentBarCodeInfo.FSplitQty = "";
this.currentBarCodeInfo.FLOT = "";
this.currentBarCodeInfo.FUNITNAME = "";
this.FBackReson = "";
this.showBarcodeNumberFcous();
},
FSCStockNumberConfirm:function(){
let _self = this;
this.key = this.key+1;
let userId = this.$store.state.userInfo.UserID;
if (!this.currentBarCodeInfo.FBarcodeNumber) {
uni.showToast({
title: "请先扫描条码",
icon: "none",
duration: 3000,
});
return;
}
if (!this.currentBarCodeInfo.FItemNumber || this.currentBarCodeInfo.FItemNumber.length == 0) {
uni.showToast({
title: "请先查询条码",
icon: "none",
duration: 3000,
});
return;
}
let qtyCheckFlag = commonUtil.judgeFloat(this.currentBarCodeInfo.FQty);
if (!qtyCheckFlag) {
return false;
}
let SNO = this.currentBarCodeInfo.FSCStockNumber;
let requestParams = {
"stockNumber":this.currentBarCodeInfo.FSCStockNumber,
"orgid":this.orgFItemID
};
uni.showLoading({
icon:'loading',
title:'加载中……',
mask:true
});
this.$request.get('/SysConfigData/SearchStock',{
params:requestParams
}).then(res => {
uni.hideLoading();
let data = res;
_self.currentBarCodeInfo.typeFStockID = data.FStockID;
_self.FIsStockMgr = data.FIsStockMgr;
uni.showToast({
icon: 'success',
title: "仓库录入成功"
});
_self.storageFSCStockNumber = _self.currentBarCodeInfo.FSCStockNumber;
if (_self.FIsStockMgr) {
_self.stockDisabled = false;
_self.showFSCSPNumberFocus();
}
else {
_self.stockDisabled = true;
_self.currentBarCodeInfo.FSCSPNumber = "";
_self.currentBarCodeInfo.FLocation = _self.currentBarCodeInfo.FSCStockNumber;
_self.locationConfirm();
}
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
FSCSPNumberConfirm:function(){
let _self = this;
this.key = this.key+1;
console.log("存放仓位"+this.currentBarCodeInfo);
let userId = this.$store.state.userInfo.UserID;
if (this.FIsStockMgr) {
if (!this.currentBarCodeInfo.FSCSPNumber) {
uni.showToast({
title: "请录入仓位编号",
icon: "none",
duration: 3000,
});
return;
}
}
if (!this.currentBarCodeInfo.FBarcodeNumber) {
uni.showToast({
title: "请先扫描条码",
icon: "none",
duration: 3000,
});
return;
}
let qtyCheckFlag = commonUtil.judgeFloat(this.currentBarCodeInfo.FQty);
if (!qtyCheckFlag) {
return false;
}
let requestParams = {
"stockNumber":this.currentBarCodeInfo.FSCStockNumber,
"orgid":this.orgFItemID
};
uni.showLoading({
icon:'loading',
title:'加载中……',
mask:true
});
this.$request.get('/SysConfigData/SearchStockPlace',{
params:requestParams
}).then(res => {
uni.hideLoading();
let data = res;
this.currentBarCodeInfo.FLocation = data.FLocation;
uni.showToast({
icon: 'success',
title: "仓位录入成功"
});
this.storageFSCSPNumber = this.currentBarCodeInfo.FSCSPNumber;
this.locationConfirm();
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
//2020-4-24 ADD BY LYY 分组求和方法
GroupBy: function(datas, keys, callBack) {
// //debugger;
const list = datas || [];
const groups = [];
list.forEach(v => {
const key = {};
const data = {};
keys.forEach(k => {
key[k] = v[k];
});
let group = groups.find(v => {
return v._key === JSON.stringify(key);
});
if (!group) {
group = {
_key: JSON.stringify(key),
key: key,
};
groups.push(group);
}
if (callBack) {
group.data = callBack(group.data, v);
group.total = group.total || 0;
group.total++;
} else {
group.data = group.data || [];
group.data.push(v);
}
});
return groups;
},
//2020-04-24 ADD BY LYY对扫描记录的记录汇总
//删除重调
//源单案例
Calculate: function() {
let _self = this;
let a;
if (this.currentTranType == 10 || this.currentTranType == 29){
a = ['FItemNumber', 'FItemName','FSize', 'FAuxPropName', 'FUnitName'];
}
else {
a = ['FSourceBillNo', 'FSourceBillTypeName', 'FItemNumber', 'FItemName', 'FSize', 'FAuxPropName', 'FUnitName'];
};
var groupdata = _self.GroupBy(_self.yesTableData,a,
(d, v) => {
d = d || 0
let qtyNumber = parseFloat(v.FQty)
return d += qtyNumber;
});
console.log(groupdata);
_self.totalTableData = [],
groupdata.forEach(v => {
_self.totalTableData.push({
"FSourceBillNo": v.key.FSourceBillNo,
"FSourceBillTypeName": v.key.FSourceBillTypeName,
"FNumber": v.key.FNumber,
"FItemNumber": v.key.FItemNumber,
"FItemName": v.key.FItemName,
"FSize":v.key.FSize,
// "FModel": v.key.FModel,
"FAuxPropName": v.key.FAuxPropName ? v.key.FAuxPropName : "",
"FQty": v.data,
"FUnitName": v.key.FUnitName
})
});
console.log("-----------------聚合" + _self.totalTableData);
},
CalculateBase: function() {
let _self = this;
let b;
// if(this.currentTranType == 10 || this.currentTranType == 29){
// b = ['FItemNumber', 'FItemName', 'FModel', 'FAuxPropName', 'FUnitName'];
// }
// else{
b = ['FSourceBillNo', 'FSourceBillTypeName','FEntryID', 'FItemNumber', 'FItemName','FSize', 'FBatchNO', 'FAuxPropName','Fcommitqty', 'FUnitName'];
// };
var groupdata = _self.GroupBy(_self.baseTableData,b,
(d, v) => {
d = d || 0
let qtyNumber = parseFloat(v.FQty)
return d += qtyNumber;
});
console.log(groupdata);
_self.baseTableData = [],
groupdata.forEach(v => {
_self.baseTableData.push({
"FSourceBillNo": v.key.FSourceBillNo?v.key.FSourceBillNo:'',
"FSourceBillTypeName": v.key.FSourceBillTypeName?v.key.FSourceBillTypeName:'',
"FEntryID":v.key.FEntryID?v.key.FEntryID:'',
"FItemNumber": v.key.FItemNumber?v.key.FItemNumber:'',
"FItemName": v.key.FItemName?v.key.FItemName:'',
"FSize":v.key.FSize?v.key.FSize:'',
// "FModel": v.key.FModel?v.key.FModel:'',
"FBatchNO":v.key.FBatchNO?v.key.FBatchNO:'',
"FAuxPropName": v.key.FAuxPropName ? v.key.FAuxPropName : "",
"FQty": v.data?v.data:0,
"Fcommitqty":v.key.Fcommitqty?v.key.Fcommitqty:'0',
"FUnitName": v.key.FUnitName?v.key.FUnitName:''
});
});
},
//源单信息调用获取
sourceBillNoInfoConfirm: function() {
let _self = this;
_self.barcodeNumberFcous = false;
_self.$nextTick(function(){
_self.barcodeNumberFcous = true;
});
if (!this.currentBarCodeInfo.FSourceBillTypeName) {
uni.showToast({
icon: "none",
title: "请选择源单类型",
duration: 3500,
});
return false;
}
if (!this.currentBarCodeInfo.FSourceBillNo) {
this.currentBarCodeInfo.FSourceBillNo = "";
}
if (this.currentBarCodeInfo.FSourceBillNo.length==0) {
uni.showToast({
icon: "none",
title: "请输入源单编号",
duration: 3500,
});
return false;
}
this.currentBarCodeInfo.FSourceBillNo = this.currentBarCodeInfo.FSourceBillNo.toUpperCase();
// if(this.currentTranType == 'PRD_PickMtrl' && this.currentBarCodeInfo.FSourceBillNo.split('-').length <= 1) {
// uni.showToast({
// title:'编号不符合规则(xxx-xxx)',
// icon:'none'
// })
// }
let isHaveSource = true;
if (this.currentBarCodeInfo.FSourceTranType == 0) {
isHaveSource = false;
}
//待添加逻辑
let isExit = 0;
// this.clearBtnClick();
let requestParams = {
"sourceBillNO": this.currentBarCodeInfo.FSourceBillNo.split('-')[0],
"sourceTranType": this.FSourceTranType,
"tranType": this.currentTranType,
"orgID":this.orgFItemID
};
console.log('requestParams>>>',requestParams)
uni.showLoading({
icon:'loading',
title:'加载中……',
mask:true
});
this.$request.post('/SelBill/QuerySourceBillInfo',requestParams).then(res => {
uni.hideLoading();
let data = res;
_self.currentBarCodeInfo.FSourceBillNo = _self.currentBarCodeInfo.FSourceBillNo.toUpperCase();
_self.currentBarCodeInfo.sourceInfo = data;
_self.RowNoTableData = new Array();
//生产领料校验行号
if(_self.currentTranType == 'PRD_PickMtrl' && _self.currentBarCodeInfo.FSourceBillNo.split('-').length > 1) {
let flagContinue = false;
_self.RowNo = _self.currentBarCodeInfo.FSourceBillNo.split('-')[1];
data[1].forEach(e => {
if(e.FMOENTRYID == _self.RowNo) {
flagContinue = true;
}
});
if(!flagContinue) {
uni.showToast({
title:'未查询到对应行号' + _self.currentBarCodeInfo.FSourceBillNo.split('-')[1],
icon:"none"
})
_self.currentBarCodeInfo.FSourceBillNo = '';
_self.RowNo = '';
_self.sourceBillNoFocus = false;
_self.$nextTick(function(){
_self.sourceBillNoFocus = true;
});
return;
} else {
data[1].forEach(e => {
_self.RowNoTableData.push({
"FMOENTRYID": e.FMOENTRYID?e.FMOENTRYID:'',
"FMOBILLNO": e.FMOBILLNO?e.FMOBILLNO:'',
"FSRCBILLNO": e.FPPBOMBILLNO?e.FPPBOMBILLNO:'',
"FSUPPLYID": e.FSUPPLYID?e.FSUPPLYID:'',
"FPRODUCTNUMBER": e.FPRODUCTNUMBER?e.FPRODUCTNUMBER:'',
"FPRODUCTNAME": e.FPRODUCTNAME?e.FPRODUCTNAME:'',
"FPRODUCTSPEC": e.FPRODUCTSPEC?e.FPRODUCTSPEC:'',
});
})
}
}
//清楚源单数量比较信息
_self.sourceBillTempList.splice(0, _self.sourceBillTempList.length);
//第一行是源单信息,第二行是工单
_self.billNextList = [];
let currentBarCodeInfoFSourceBillNo = _self.currentBarCodeInfo.FSourceBillNo.split('-')[0];
data[0].forEach(
function(el){
let isPush = true;
let basePushItem = {
"FSourceBillTypeName": _self.currentBarCodeInfo.FSourceBillTypeName?_self.currentBarCodeInfo.FSourceBillTypeName:'',
"FSourceBillNo": currentBarCodeInfoFSourceBillNo?currentBarCodeInfoFSourceBillNo:'',
// "FEntryID": _self.isShowBillRowNo ? el.FICMOEntryID : el.FEntryID,
"FEntryID": el.FSRCENTRYID?el.FSRCENTRYID:'',
"FMOENTRYID":el.FMOENTRYID?el.FMOENTRYID:0,
"FItemNumber": el.FITEMNUMBER?el.FITEMNUMBER:'',
"FItemName": el.FITEMNAME?el.FITEMNAME:'',
"FSize": el.FSPECIFICATION?el.FSPECIFICATION:'',
// "FModel": el.FSPECIFICATION?el.FSPECIFICATION:'',
"FBatchNO": el.FLOT?el.FLOT:'',
"FAuxPropName": el.FAUXPROPNAME ? el.FAUXPROPNAME :"" ,
"FQty": el.FAUXQTY?el.FAUXQTY:'',
"Fcommitqty": (el.FRELATIONQTY==0)? 0:(el.FRELATIONQTY?el.FRELATIONQTY:'-'),
"FUnitName": el.FUNITNAME?el.FUNITNAME:'',
"PPBOMFBillNo": el.FMOBILLNO?el.FMOBILLNO:'',
"FICMOEntryID": el.FMOID?el.FMOID:'',
"FSupplyName":el.FSUPPLYNAME?el.FSUPPLYNAME:'',
"FDeptName":el.FDEPTNAME?el.FDEPTNAME:'',
"FCustName":el.FCUSTNAME?el.FCUSTNAME:'',
"comb":(_self.currentBarCodeInfo.FSourceBillNo + (el.FITEMNUMBER?el.FITEMNUMBER:''))?(_self.currentBarCodeInfo.FSourceBillNo + (el.FITEMNUMBER?el.FITEMNUMBER:'')):'',
"FSRCBILLNO": el.FSRCBILLNO?el.FSRCBILLNO:'',
"FSRCDETAILID": el.FSRCDETAILID?el.FSRCDETAILID:0,
"FMATERIALID": el.FMATERIALID?el.FMATERIALID:0,
"FITEMNAME": el.FITEMNAME?el.FITEMNAME:'',
"FLOT": el.FLOT?el.FLOT:'',
"FBASEREMINANQTY": el.FBASEREMINANQTY?el.FBASEREMINANQTY:0,
};
_self.baseTableData.forEach(
function(item){
if (item.FSourceBillNo == basePushItem.FSourceBillNo && item.FEntryID == basePushItem.FEntryID &&
item.FItemNumber == basePushItem.FItemNumber) {
item.FSourceBillTypeName = basePushItem.FSourceBillTypeName;
item.FSourceBillNo = basePushItem.FSourceBillNo;
item.FEntryID = basePushItem.FEntryID;
item.FMOENTRYID = basePushItem.FMOENTRYID;
item.FItemNumber = basePushItem.FItemNumber;
item.FItemName = basePushItem.FItemName;
item.FSize = basePushItem.FSize;
item.FBatchNO = basePushItem.FBatchNO;
item.FAuxPropName = basePushItem.FAuxPropName;
item.FQty = basePushItem.FQty;
item.Fcommitqty = basePushItem.Fcommitqty;
item.FUnitName = basePushItem.FUnitName;
item.PPBOMFBillNo = basePushItem.PPBOMFBillNo;
item.FICMOEntryID = basePushItem.FICMOEntryID;
item.FSupplyName = basePushItem.FSupplyName;
item.FDeptName = basePushItem.FDeptName;
item.FCustName = basePushItem.FCustName;
item.comb = basePushItem.comb;
// 外购退料不能录入location
item.FSRCBILLNO = basePushItem.FSRCBILLNO;
item.FSRCDETAILID = basePushItem.FSRCDETAILID;
item.FMATERIALID = el.FMATERIALID;
item.FITEMNAME = el.FITEMNAME;
item.FLOT = el.FLOT;
item.FBASEREMINANQTY = el.FBASEREMINANQTY;
isPush = false;
}
}
);
if (isPush) {
_self.baseTableData.push(basePushItem);
}
if (el.FPAZEYFXM) {
_self.developList.forEach(
function(developItem){
if (developItem.FID == el.FPAZEYFXM) {
if(_self.$refs.developList){
_self.developID = developItem.FID;
_self.$refs.developList.selectText = developItem.FNAME;
}
}
}
);
}
if (el.FBILLTYPEID) {
_self.orderTypeList.forEach(
function(orderTypeItem){
if (orderTypeItem.FSOURCEID == el.FBILLTYPEID) {
if(_self.$refs.orderTypeList){
_self.$refs.orderTypeList.selectText = orderTypeItem.FDESTNAME;
_self.orderTypeID = orderTypeItem.FDESTID;
}
}
}
);
}
let tempPushItem = {
"FSourceBillTypeName": _self.currentBarCodeInfo.FSourceBillTypeName?_self.currentBarCodeInfo.FSourceBillTypeName:'',
"FSourceBillNo": currentBarCodeInfoFSourceBillNo?currentBarCodeInfoFSourceBillNo:'',
// "FEntryID": _self.isShowBillRowNo ? el.FICMOEntryID : el.FEntryID,
"FEntryID": el.FSRCENTRYID?el.FSRCENTRYID:'',
"FMOENTRYID":el.FMOENTRYID?el.FMOENTRYID:0,
"FItemNumber": el.FITEMNUMBER?el.FITEMNUMBER:'',
"FItemName": el.FITEMNAME?el.FITEMNAME:'',
"FSize": el.FSPECIFICATION?el.FSPECIFICATION:'',
// "FModel": el.FSPECIFICATION?el.FSPECIFICATION:'',
"FBatchNO": el.FLOT?el.FLOT:'',
"FAuxPropName": el.FAUXPROPNAME ? el.FAUXPROPNAME :"" ,
"FQty": el.FAUXQTY?el.FAUXQTY:'',
"Fcommitqty": (el.FRELATIONQTY==0)? 0:(el.FRELATIONQTY?el.FRELATIONQTY:'-'),
"FUnitName": el.FUNITNAME?el.FUNITNAME:'',
"PPBOMFBillNo": el.FMOBILLNO?el.FMOBILLNO:'',
"FICMOEntryID": el.FMOID?el.FMOID:'',
"FSupplyName": el.FSUPPLYNAME?el.FSUPPLYNAME:'',
"FDeptName": el.FDEPTNAME?el.FDEPTNAME:'',
"FCustName": el.FCUSTNAME?el.FCUSTNAME:'',
"comb": (_self.currentBarCodeInfo.FSourceBillNo + (el.FITEMNUMBER?el.FITEMNUMBER:''))?(_self.currentBarCodeInfo.FSourceBillNo + (el.FITEMNUMBER?el.FITEMNUMBER:'')):'',
}
if (isPush) {
_self.TempBaseTableData.push(tempPushItem);
}
else {
_self.TempBaseTableData.forEach(
function(item){
if (item.FSourceBillNo == tempPushItem.FSourceBillNo && item.FEntryID == tempPushItem.FEntryID &&
item.FItemNumber == tempPushItem.FItemNumber) {
item.FSourceBillTypeName = tempPushItem.FSourceBillTypeName;
item.FSourceBillNo = tempPushItem.FSourceBillNo;
item.FEntryID = tempPushItem.FEntryID;
item.FMOENTRYID = tempPushItem.FMOENTRYID;
item.FItemNumber = tempPushItem.FItemNumber;
item.FItemName = tempPushItem.FItemName;
item.FSize = tempPushItem.FSize;
item.FBatchNO = tempPushItem.FBatchNO;
item.FAuxPropName = tempPushItem.FAuxPropName;
item.FQty = tempPushItem.FQty;
item.Fcommitqty = tempPushItem.Fcommitqty;
item.FUnitName = tempPushItem.FUnitName;
item.PPBOMFBillNo = tempPushItem.PPBOMFBillNo;
item.FICMOEntryID = tempPushItem.FICMOEntryID;
item.FSupplyName = tempPushItem.FSupplyName;
item.FDeptName = tempPushItem.FDeptName;
item.FCustName = tempPushItem.FCustName;
item.comb = tempPushItem.comb;
}
}
);
}
if (_self.currentTranType != 'PRD_PickMtrl' && _self.currentTranType != 'PRD_ReturnMtrl'
&& _self.currentTranType != 'SUB_PICKMTRL' && _self.currentTranType != 'SUB_RETURNMTRL'
&& _self.currentTranType != 137 && _self.currentTranType != -137
&&_self.currentTranType != 'PRD_FeedMtrl') {
_self.fNameArray.forEach(
function(item, index){
if (item.headerFID == "FDeptID") {
_self.currentBarCodeInfo["FID"+index] = el.FDEPTID;
_self.currentBarCodeInfo["FNO"+index] = el.FDEPTNUMBER;
_self.currentBarCodeInfo["FName"+index] = el.FDEPTNAME;
_self["fNameSelectText"+index] = el.FDEPTNAME;
if (_self.$refs["FNameList"+index]) {
_self.$refs["FNameList"+index].selectText = el.FDEPTNAME;
}
_self.FDEPTID = data[0][0].FDEPTID;
}
if (item.headerFID == "FSupplyID") {
_self.currentBarCodeInfo["FID"+index] = el.FSUPPLYID;
_self.currentBarCodeInfo["FNO"+index] = el.FSUPPLYNUMBER;
_self.currentBarCodeInfo["FName"+index] = el.FSUPPLYNAME;
_self["fNameSelectText"+index] = el.FSUPPLYNAME;
if (_self.$refs["FNameList"+index]) {
_self.$refs["FNameList"+index].selectText = el.FSUPPLYNAME;
}
_self.FSUPPLYID = data[0][0].FSUPPLYID;
}
if (item.headerFID == "FCustID") {
_self.currentBarCodeInfo["FID"+index] = el.FCUSTID;
_self.currentBarCodeInfo["FNO"+index] = el.FCUSTNUMBER;
_self.currentBarCodeInfo["FName"+index] = el.FCUSTNAME;
_self["fNameSelectText"+index] = el.FCUSTNAME;
if (_self.$refs["FNameList"+index]) {
_self.$refs["FNameList"+index].selectText = el.FCUSTNAME;
}
_self.FCUSTID = data[0][0].FCUSTID;
}
}
);
}
else {
_self.fNameArray.forEach(
function(item, index){
if (item.headerFID == "FDeptID") {
if (_self.$refs["FNameList"+index]) {
_self.$refs["FNameList"+index].selectText = data[0][0].FDEPTNAME;
}
_self.FDEPTID = data[0][0].FDEPTID;
}
if (item.headerFID == "FSupplyID") {
console.log(data[1][0]);
if (_self.$refs["FNameList"+index]) {
_self.$refs["FNameList"+index].selectText = data[0][0].FSUPPLYNAME;
}
_self.FSUPPLYID = data[0][0].FSUPPLYID;
}
if (item.headerFID == "FCustID") {
if (_self.$refs["FNameList"+index]) {
_self.$refs["FNameList"+index].selectText = data[0][0].FCUSTNAME;
}
_self.FCUSTID = data[0][0].FCUSTID;
}
}
);
}
// _self.RowNo = el.FICMOEntryID;
//记录源单数量信息
let newQtyData = {};
qtyControlUtil.groupFieldArray.forEach(function(item){ newQtyData[item] = el[item]? el[item]: ""; } );
newQtyData[qtyControlUtil.billQtyField] = el[qtyControlUtil.billQtyField]? el[qtyControlUtil.billQtyField]: 0;
_self.sourceBillTempList.push(newQtyData);
let billNextListItem = {
"billFITEMNUMBER": el.FITEMNUMBER ? el.FITEMNUMBER:'',
"billFITEMNAME": el.FITEMNAME ? el.FITEMNAME:'',
"billFREMINANQTY": el.FREMINANQTY ? el.FREMINANQTY:'0',
"billFUNITNAME": el.FUNITNAME ? el.FUNITNAME:'',
"billFSPECIFICATION": el.FSPECIFICATION ? el.FSPECIFICATION:'',
"billFAUXPROPNAME": el.FAUXPROPNAME ? el.FAUXPROPNAME :"" ,
"billFLOT": el.FLOT ? el.FLOT:'',
"billFSTOCKNAME": el.FSTOCKNAME ? el.FSTOCKNAME:'',
"billFSTOCKLOCNAME": el.FSTOCKLOCNAME ? el.FSTOCKLOCNAME:'',
};
_self.billNextList.push(billNextListItem);
}
);
if (this.currentTranType == 'STK_MisDelivery') {
this.billNextIndex = 0;
this.billNextDisable = true;
this.billPreviousDisable = true;
if (this.billNextList.length > 0) {
this.billNextDisable = false;
this.showBillNext();
}
}
if(_self.currentTranType == 'PRD_PickMtrl' && _self.currentBarCodeInfo.FSourceBillNo.split('-')[1]) {
this.baseTableData = this.baseTableData.filter(e => {
return e.FMOENTRYID == _self.RowNo && e.FSourceBillNo == _self.currentBarCodeInfo.FSourceBillNo.split('-')[0]
})
}
})
.catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error');
_self.sourceBillNoFocus = false;
_self.$nextTick(function(){
_self.sourceBillNoFocus = true;
});
});
},
//部门变化
deptChange0({ newVal, oldVal, index, orignItem }) {
if (this.fNameArray.length == 1) {
this.showBarcodeNumberFcous();
}
this.currentBarCodeInfo.FID0 = orignItem.FID;
this.currentBarCodeInfo.FName0 = orignItem.FNAME;
this.currentBarCodeInfo.FNO0 = orignItem.FNO;
this.fNameSelectText0 = orignItem.FNAME;
if (this.$refs.FNameList0) {
this.$refs.FNameList0.selectText = orignItem.FNAME;
}
this.barcodeNumberFcous = false;
this.$nextTick(function(){
this.barcodeNumberFcous = true;
});
if (this.currentTranType == 'PRD_PickMtrl') {
this.FDEPTID = orignItem.FID;
}
if (this.currentTranType == 'STK_MisDelivery') {
this.FDEPTID = orignItem.FID;
}
if (this.currentTranType == 'STK_MisCellaneous') {
this.FDEPTID = orignItem.FID;
}
if (this.currentTranType == 'SAL_OutStock') {
this.FCUSTID = orignItem.FID;
}
if (this.currentTranType == 'SAL_ReturnStock') {
this.FCUSTID = orignItem.FID;
}
if (this.currentTranType == 'SUB_PICKMTRL' || this.currentTranType == 'STK_InStock'
|| this.currentTranType == 'PUR_MRB') {
this.FSUPPLYID = orignItem.FID;
}
if (this.currentTranType == 'SP_PickMtrl' || this.currentTranType == 'SP_ReturnMtrl') {
this.FDEPTID = orignItem.FID;
this.showProductBarCodeFocus();
}
if (this.currentTranType=='PRD_InStock') {
this.FDEPTID = orignItem.FID;
}
if (this.currentTranType=='STK_OEMInStock') {
this.FCUSTID = orignItem.FID;
}
if (this.currentTranType=='STK_OEMOutStock') {
this.FCUSTID = orignItem.FID;
}
},
deptChange1({ newVal, oldVal, index, orignItem }) {
if (this.fNameArray.length == 2) {
this.showBarcodeNumberFcous();
}
this.currentBarCodeInfo.FID1 = orignItem.FID;
this.currentBarCodeInfo.FName1 = orignItem.FNAME;
this.currentBarCodeInfo.FNO1 = orignItem.FNO;
this.fNameSelectText1 = orignItem.FNAME;
if (this.$refs.FNameList1) {
this.$refs.FNameList1.selectText = orignItem.FNAME;
}
this.barcodeNumberFcous = false;
this.$nextTick(function(){
this.barcodeNumberFcous = true;
});
if (this.currentTranType == 'STK_MisDelivery') {
this.FCUSTID = orignItem.FID;
}
if (this.currentTranType == 'STK_MisCellaneous') {
this.FSUPPLYID = orignItem.FID;
}
if (this.currentTranType == 'SP_PickMtrl' || this.currentTranType == 'SP_ReturnMtrl') {
this.productID = orignItem.FID;
}
},
backResonChange({newVal, oldVal, index, orignItem}){
this.BRListIndex = index;
this.backRID = this.orgBRList[index].FItemID;
this.FBackReson = newVal;
if (this.isShowStock) {
this.showLocationFcous();
}
else {
this.showFSCStockNumberFocus();
}
},
orderTypeChange({ newVal, oldVal, index, orignItem }){
let _self = this;
this.orderTypeID = orignItem.FDESTID;
},
billTypeChange({ newVal, oldVal, index, orignItem }) {
let _self = this;
orignItem.FSELBILLENTRY.forEach(e => {
e.value = e.FDESTNAME;
});
this.orderTypeList = orignItem.FSELBILLENTRY;
this.RowNo = "";
this.productInfo = "";
this.productBarCode = "";
this.currentBarCodeInfo = new Object();
this.currentBarCodeInfo.FSourceBillNo = "";
this.FSourceTranType = orignItem.FSRCFORMID;
this.currentBarCodeInfo.FSourceTranType = orignItem.FSRCFORMID;
this.currentBarCodeInfo.FIsOpenSource = orignItem.FISOPENSOURCE;
this.currentBarCodeInfo.FDestTranType = orignItem.FTRANTYPE;
this.currentBarCodeInfo.FSourceBillTypeName = orignItem.FSRCNAME;
this.billTypeSelectText = orignItem.FSRCNAME;
this.FIsControlQty = orignItem.FISCONTROLQTY;
// this.FOtherControl = orignItem.FOtherControl;
_self.FISCHECKLOT = orignItem.FISCHECKLOT;
_self.FISCHECKAUX = orignItem.FISCHECKAUX;
_self.FISCHECKKFDATE = orignItem.FISCHECKKFDATE;
let FID0 = this.currentBarCodeInfo.FID0;
let FName0 = this.currentBarCodeInfo.FName0;
let FNO0 = this.currentBarCodeInfo.FNO0;
let FID1 = this.currentBarCodeInfo.FID1;
let FName1 = this.currentBarCodeInfo.FName1;
let FNO1 = this.currentBarCodeInfo.FNO1;
let FSourceTranType = this.currentBarCodeInfo.FSourceTranType;
let FIsOpenSource = this.currentBarCodeInfo.FIsOpenSource;
let FDestTranType = this.currentBarCodeInfo.FDestTranType;
let FSourceBillTypeName = this.currentBarCodeInfo.FSourceBillTypeName;
let FSourceBillNo = this.currentBarCodeInfo.FSourceBillNo;
let FBarcodeNumber = this.currentBarCodeInfo.FBarcodeNumber;
this.currentBarCodeInfo = new Object();
this.currentBarCodeInfo.FSourceTranType = FSourceTranType;
this.currentBarCodeInfo.FIsOpenSource = FIsOpenSource;
this.currentBarCodeInfo.FDestTranType = FDestTranType;
this.currentBarCodeInfo.FSourceBillTypeName = FSourceBillTypeName;
this.currentBarCodeInfo.FBarcodeNumber = FBarcodeNumber;
this.fNameSelectText0 = "";
// this.$refs.FNameList0.selectText = "";
this.fNameSelectText1 = "";
// this.$refs.FNameList1.selectText = "";
this.currentBarCodeInfo.FID0 = "";
this.currentBarCodeInfo.FName0 = "";
this.currentBarCodeInfo.FNO0 = "";
this.currentBarCodeInfo.FID1 = "";
this.currentBarCodeInfo.FName1 = "";
this.currentBarCodeInfo.FNO1 = "";
this.currentBarCodeInfo.FSourceBillNo = "";
this.currentBarCodeInfo.FItemNumber = "";
this.currentBarCodeInfo.FItemName = "";
this.currentBarCodeInfo.FModel = "";
this.currentBarCodeInfo.FAuxPropName = "";
this.currentBarCodeInfo.FQty = "";
this.currentBarCodeInfo.FBoxQty = "";
this.currentBarCodeInfo.FLocation = "";
this.currentBarCodeInfo.FLOT = "";
this.currentBarCodeInfo.FUNITNAME = "";
this.barcodeQtyDisabled = true;
if (this.$refs.FNameList0) {
this.$refs.FNameList0.selectText = "";
}
if (_self.fNameSelectShow1) {
if (_self.$refs.FNameList1) {
_self.$refs.FNameList1.selectText = "";
}
}
if (_self.currentBarCodeInfo.FSourceTranType == "0" && FSourceTranType=="0") {
_self.currentBarCodeInfo.FID0 = FID0;
_self.currentBarCodeInfo.FName0 = FName0;
_self.currentBarCodeInfo.FNO0 = FNO0;
_self.currentBarCodeInfo.FID1 = FID1;
_self.currentBarCodeInfo.FName1 = FName1;
_self.currentBarCodeInfo.FNO1 = FNO1;
if (FName0) {
_self.fNameSelectText0 = FName0;
}
if (FName1) {
_self.fNameSelectText1 = FName1;
}
if (_self.$refs.FNameList0) {
_self.$refs.FNameList0.selectText = "请选择";
}
if (_self.fNameSelectShow1) {
if (_self.$refs.FNameList1) {
_self.$refs.FNameList1.selectText = "请选择";
}
}
_self.currentBarCodeInfo.FSourceBillNo = "";
_self.isShowOrg = true;
}
else {
_self.showOrg();
}
this.sourceBillNoDisable = true;
this.deptDisabled = true;
this.ownerTypeShow = false;
this.FOWNERTYPEID = '';
this.ownerTypeSelectText = '';
if (this.$refs.ownerTypeList) {
this.$refs.ownerTypeList.selectText = "";
}
if (!orignItem.FSRCFORMID) {
_self.sourceBillNoDisable = true;
if (_self.currentBarCodeInfo.FIsOpenSource) {
_self.sourceBillNoFocus = false;
_self.$nextTick(function(){
_self.sourceBillNoFocus = true;
});
if (_self.currentBarCodeInfo.FSourceTranType == 0) {
_self.deptDisabled = false;
}
}
else {
if (_self.currentBarCodeInfo.FSourceTranType == 0) {
_self.deptDisabled = false;
}
else {
// _self.showBarcodeNumberFcous();
_self.barcodeNumberFcous = false;
_self.$nextTick(function(){
_self.barcodeNumberFcous = true;
})
}
}
if (this.currentTranType == 'STK_MisDelivery' || this.currentTranType == 'STK_MisCellaneous') {
this.ownerTypeShow = true;
this.FOWNERTYPEID = 'ORG_Organizations';
this.ownerTypeSelectText = '业务组织';
if (this.$refs.ownerTypeList) {
this.$refs.ownerTypeList.selectText = "业务组织";
}
}
}
else {
if (_self.currentBarCodeInfo.FIsOpenSource) {
_self.sourceBillNoDisable = false;
_self.sourceBillNoFocus = false;
_self.$nextTick(function(){
_self.sourceBillNoFocus = true;
});
if (_self.currentBarCodeInfo.FSourceTranType == 0) {
_self.deptDisabled = false;
}
}
else {
if (_self.currentBarCodeInfo.FSourceTranType == 0) {
_self.deptDisabled = false;
}
else {
// _self.showBarcodeNumberFcous();
_self.barcodeNumberFcous = false;
_self.$nextTick(function(){
_self.barcodeNumberFcous = true;
});
}
}
}
this.FOWNERID = '';
this.ownerOrgSelectText = '';
if (this.$refs.ownerOrgArryList) {
this.$refs.ownerOrgArryList.selectText = '';
}
this.ownerOrgIndex = -1;
this.ownerSupplierIndex = -1;
this.ownerCustomerIndex = -1;
this.key++;
this.$forceUpdate();
},
billTypeClear:function() {
this.currentBarCodeInfo = new Object();
},
developChange({ newVal, oldVal, index, orignItem }){
this.developID = orignItem.FID;
},
ownerTypeChange({ newVal, oldVal, index, orignItem }){
this.ownerTypeSelectText = orignItem.value;
this.FOWNERTYPEID = orignItem.id;
this.FOWNERID = '';
if (this.FOWNERTYPEID === 'ORG_Organizations' && this.ownerOrgIndex >= 0) {
this.ownerOrgSelectText = this.ownerOrgList[this.ownerOrgIndex].value;
if (this.$refs.ownerOrgArryList) {
this.$refs.ownerOrgArryList.selectText = this.ownerOrgList[this.ownerOrgIndex].value;
}
this.FOWNERID = this.ownerOrgList[this.ownerOrgIndex].FINTERID;
}
if (this.FOWNERTYPEID === 'BD_SUPPLIER' && this.ownerSupplierIndex >= 0) {
this.FOWNERID = this.supplierInfoList[this.ownerSupplierIndex].FID;
}
if (this.FOWNERTYPEID === 'BD_CUSTOMER' && this.ownerCustomerIndex >= 0) {
this.FOWNERID = this.customerInfoList[this.ownerCustomerIndex].FID;
}
this.$forceUpdate();
},
ownerOrgChange({ newVal, oldVal, index, orignItem }){
this.ownerOrgSelectText = orignItem.value;
this.ownerOrgIndex = index;
this.FOWNERID = orignItem.FINTERID;
},
ownerSupplierChange(e){
this.supplierInfoList.forEach((el, index) => {
if (el.FID == this.FOWNERID) {
this.ownerSupplierIndex = index;
}
});
},
ownerCustomerChange(e){
this.customerInfoList.forEach((el, index) => {
if (el.FID == this.FOWNERID) {
this.ownerCustomerIndex = index;
}
});
},
stockStatusChange({ newVal, oldVal, index, orignItem }){
this.FSTOCKSTATUSNAME = orignItem.FNAME;
this.FSTOCKSTATUSID = orignItem.FNO;
},
storeTypeChange({ newVal, oldVal, index, orignItem }){
this.FWWINTYPE = orignItem.FWWINTYPE;
},
getDevelop:function(){
let _self = this;
uni.showLoading({
icon:'loading',
title:'加载中……',
mask:true
});
this.$request.get('/SysConfigData/QueryResource',{
params:{
basicType:16,
basicNO:'YFXM',
orgId:''
}
}).then(res => {
uni.hideLoading();
let datalist = res;
if(!datalist || datalist.length==0){
return false;
}
datalist.forEach(e => {
e.value = e.FNAME;
})
_self.developList = datalist;
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
productBarCodeConfirm: function() {
if (!this.productBarCode &&
((this.currentTranType == 'SP_PickMtrl') || (this.currentTranType == 'SP_ReturnMtrl'))) {
uni.showToast({
icon: "none",
title: "请输入生产编号",
duration: 3500,
});
return false;
}
this.showProductInfoFcous();
},
//获取库存状态列表
getStockStatusList(){
let _self = this;
let requestParams = {"orgID":this.orgFItemID}
this.$request.post('/SelBill/QueryStockStatus',requestParams).then(res => {
this.stockStatusList = res;
this.stockStatusList.forEach(e => {
e.value = e.FNAME;
if(e.FNO=="KCZT01_SYS"){
_self.FSTOCKSTATUSNAME = e.FNAME;
_self.FSTOCKSTATUSID = e.FNO;
if(_self.$refs.stockStatusList){
_self.$refs.stockStatusList.selectText = e.FNAME;
}
}
})
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
})
},
//正操作条码扫码回车执行
barcodeConfirm: function() {
let _self = this;
if (!this.currentBarCodeInfo.FSourceBillTypeName) {
uni.showToast({
icon: "none",
title: "请选择源单类型",
duration: 3500,
});
return false;
}
if ((!this.FOWNERID) && this.ownerTypeShow) {
uni.showToast({
icon: "none",
title: "请选择货主",
duration: 3500,
});
return false;
}
if ((!this.FOWNERTYPEID) && this.ownerTypeShow) {
uni.showToast({
icon: "none",
title: "请选择货主类型",
duration: 3500,
});
return false;
}
if (this.currentBarCodeInfo.FSourceTranType == 0|| !this.currentBarCodeInfo.FSourceTranType) {
let isBlank = '';
for (let arrayIndex=0; arrayIndex<this.fNameArray.length; arrayIndex++) {
isBlank = isBlank + this["fNameSelectText"+arrayIndex];
}
if (isBlank.length==0) {
for (let index=0; index<this.fNameArray.length; index++) {
if (!this["fNameSelectText"+index]) {
if (this.fNameArray[index].headerFID == "FDeptID") {
let msg = this.fNameArray[index].hint;
if (!msg) {
msg = '请选择部门';
}
uni.showToast({
icon: "none",
title: msg,
duration: 3500,
});
return false;
}
if(this.fNameArray[index].headerFID == "FSupplyID") {
uni.showToast({
icon: "none",
title: "请选择供应商",
duration: 3500,
});
return false;
}
if(this.fNameArray[index].headerFID == "FCustID") {
uni.showToast({
icon: "none",
title: "请选择客户",
duration: 3500,
});
return false;
}
}
}
}
}
if ((this.currentTranType == 'PRD_PickMtrl' && this.currentBarCodeInfo.FSourceBillTypeName=='生产任务单')
|| this.currentTranType == 'PRD_ReturnMtrl'
|| this.currentTranType == 'SUB_PICKMTRL' || this.currentTranType == 'SUB_RETURNMTRL'
|| this.currentTranType == 137 || this.currentTranType == -137
||this.currentTranType == 'PRD_FeedMtrl') {
if (this.currentBarCodeInfo.FIsOpenSource){
if (this.RowNo < 0 || (!this.RowNo && this.RowNo != 0)) {
uni.showToast({
icon: "none",
title: "请选择行号",
duration: 3500,
});
return false;
}
}
}
if ((!this.orderTypeID)
&& (this.currentTranType == 'STK_MisDelivery' || this.currentTranType == 'STK_MisCellaneous')) {
uni.showToast({
icon: "none",
title: "请选择单据类型",
duration: 3500,
});
return false;
}
// if ((!this.developID) && (this.currentTranType == 'STK_MisDelivery')) {
// uni.showToast({
// icon: "none",
// title: "请选择研发项目",
// duration: 3500,
// });
// return false;
// }
if (!this.productBarCode &&
(this.currentTranType == 'SP_PickMtrl' || this.currentTranType == 'SP_ReturnMtrl')) {
uni.showToast({
icon: "none",
title: "请输入生产编号",
duration: 3500,
});
return false;
}
if (!this.productInfo &&
(this.currentTranType == 'SP_PickMtrl' || this.currentTranType == 'SP_ReturnMtrl')) {
uni.showToast({
icon: "none",
title: "请输入生产对象",
duration: 3500,
});
return false;
}
if (!this.productID &&
(this.currentTranType == 'SP_PickMtrl' || this.currentTranType == 'SP_ReturnMtrl')) {
uni.showToast({
icon: "none",
title: "请输入正确的生产对象",
duration: 3500,
});
return false;
}
this.currentBarCodeInfo.FBarcodeNumber = this.FBarcodeNumber;
if (!this.currentBarCodeInfo.FBarcodeNumber) {
uni.showToast({
icon: "none",
title: "请输入条码",
duration: 3500,
});
return false;
}
this.currentBarCodeInfo.FBarcodeNumber = this.currentBarCodeInfo.FBarcodeNumber.toUpperCase();
this.FBarcodeNumber = this.FBarcodeNumber.toUpperCase();
let isFail = this.checkBarcodeNumber(this.currentBarCodeInfo.FBarcodeNumber);
if (isFail) {
uni.showToast({
icon: "none",
title: "请输入正确的条码",
duration: 3500,
});
return false;
}
this.clearInfoByBar();
if(!this.currentBarCodeInfo.FSourceBillNo) {
this.currentBarCodeInfo.FSourceBillNo = "";
}
let isHaveSource = true;
if(this.currentBarCodeInfo.FSourceTranType == 0){
isHaveSource = false;
}
//待添加逻辑
let isExit = 0;
let requestParams = {
"barCodeNum": this.currentBarCodeInfo.FBarcodeNumber,
"sourceBillNO": this.currentBarCodeInfo.FSourceBillNo.split('-')[0],
"sourceTranType": this.FSourceTranType,
"isHaveSource": isHaveSource,
"tranType": this.currentTranType,
"isExit": isExit,
"sourceEntryID": (this.currentTranType=='SUB_RETURNMTRL'&&this.FSourceTranType=='SUB_PICKMTRL')||
(this.currentTranType=='PRD_ReturnMtrl'&&this.FSourceTranType=='PRD_PickMtrl')?0:(this.RowNo ? this.RowNo : 0),
"orgID": this.orgFItemID,
"OwnerID": this.FOWNERID,
"OwnerTypeID": this.FOWNERTYPEID,
};
uni.showLoading({
icon:'loading',
title:'加载中……',
mask:true
});
this.$request.post('/SelBill/QueryBarCode',requestParams).then(res => {
uni.hideLoading();
let data = res;
//库存状态
if (res.FSTOCKSTATUSID && _self.stockStatus) {
_self.FSTOCKSTATUSID = res.FSTOCKSTATUSID;
}
if (res.FSTOCKSTATUSNAME && _self.stockStatus) {
_self.FSTOCKSTATUSNAME = res.FSTOCKSTATUSNAME;
if(_self.$refs.stockStatusList){
_self.$refs.stockStatusList.selectText = res.FSTOCKSTATUSNAME;
}
}
_self.FUSEFULDATE = res.FUSEFULDATE;
_self.currentBarCodeInfo.barCodeInfo = data;
_self.currentBarCodeInfo.FCType = data["FBARTYPE"];
_self.currentBarCodeInfo.FIsBox = data["FISBOX"];
_self.currentBarCodeInfo.FBarcodeNumber = data["FBARCODE"];
_self.FBarcodeNumber = _self.currentBarCodeInfo.FBarcodeNumber.toUpperCase();
if (_self.currentBarCodeInfo.FIsBox == 1 ||
(_self.currentBarCodeInfo.FCType != 3 && _self.currentBarCodeInfo.FIsBox == 0)) {
let currentBarcode = _self.currentBarCodeInfo.FBarcodeNumber;
if (_self.barcodeList.length > 0) {
let barcodeExistList = _self.barcodeList.filter(
function(barcode){
return barcode == currentBarcode;
}
);
if (barcodeExistList) {
if (barcodeExistList.length > 0) {
uni.showToast({
icon: "none",
title: "条码已存在",
duration: 3500,
});
return false;
}
}
}
}
_self.FKEEPERID = data["FKEEPERID"];
_self.FKEEPERTYPEID = data["FKEEPERTYPEID"];
if (!_self.ownerTypeShow) {
_self.FOWNERTYPEID = data["FOWNERTYPEID"];
_self.FOWNERID = data["FOWNERID"];
}
_self.FSECUNITQTY = data["FSECUNITQTY"];
_self.FSECUNITID = data["FSECUNITID"];
_self.FISSECUNIT = data["FISSECUNIT"];
_self.FDetailID = data["FSRCDETAILID"];
_self.FUnitID = data["FUNITID"];
_self.currentBarCodeInfo.FSourceEntryID = data["FSRCENTRYID"];
_self.currentBarCodeInfo.FSCStockNumber = data["FLOCATION"];
_self.currentBarCodeInfo.FSCStockNumber =
_self.currentBarCodeInfo.FSCStockNumber.replace(/\s*/g,"");
_self.currentBarCodeInfo.FSCStockID = data["FSTOCKID"];
_self.currentBarCodeInfo.FSCSPNumber = data["FLOCATION"];
_self.currentBarCodeInfo.FSCSPNumber =
_self.currentBarCodeInfo.FSCSPNumber.replace(/\s*/g,"");
_self.currentBarCodeInfo.FSCStockPlaceID = data["FSTOCKLOCID"];
_self.currentBarCodeInfo.FItemNumber = data["FITEMNUMBER"];
_self.currentBarCodeInfo.FItemName = data["FITEMNAME"];
_self.currentBarCodeInfo.FSize = data["FSPECIFICATION"];
_self.currentBarCodeInfo.FModel = data["FSPECIFICATION"];
_self.currentBarCodeInfo.FKFPeriod = data["FKFPERIOD"];
_self.currentBarCodeInfo.FQty = data["FQTY"];
_self.currentBarCodeInfo.FUNITNAME = data["FUNITNAME"];
_self.currentBarCodeInfo.FSECUNITNAME = data["FSECUNITNAME"];
_self.currentBarCodeInfo.FBarcodeQty = data["FQTY"];
_self.currentBarCodeInfo.FSplitQty = data["FQTY"];
if (_self.currentBarCodeInfo.FSourceTranType != 0) {
_self.currentBarCodeInfo.FID0 = data["FID"];
_self.currentBarCodeInfo.FName0 = data["FNAME"];
_self.currentBarCodeInfo.FNO0 = data["FNO"];
if (data["FNAME"]) {
_self.fNameSelectText0 = data["FNAME"];
if (_self.$refs.FNameList0) {
_self.$refs.FNameList0.selectText = data["FNAME"];
}
}
}
_self.currentBarCodeInfo.FSourceBillNo = data["FSRCBILLNO"];
_self.currentBarCodeInfo.FBoxNumber = data["FBOXBARCODE"]?data["FBOXBARCODE"]:"";
_self.currentBarCodeInfo.FItemID = data["FMATERIALID"];
_self.currentBarCodeInfo.FBatchNO = data["FLOT"];
_self.currentBarCodeInfo.FAuxPropName = data["FAUXPROPNAME"] ? data["FAUXPROPNAME"] : "";
_self.currentBarCodeInfo.FKFDate = data["FKFDATE"];
_self.FDate = data["FKFDATE"];
_self.currentBarCodeInfo.FUnitName = data["FUNITNAME"];
_self.currentBarCodeInfo.FLocation = data["FLOCATION"];
_self.currentBarCodeInfo.FLocation =
_self.currentBarCodeInfo.FLocation.replace(/\s*/g,"");
if ((!_self.currentBarCodeInfo.FLocation) || (_self.currentBarCodeInfo.FLocation.length == 0)) {
_self.currentBarCodeInfo.FLocation = _self.storageLocation;
}
if ((!_self.currentBarCodeInfo.FSCStockNumber) || (_self.currentBarCodeInfo.FSCStockNumber.length == 0)) {
_self.currentBarCodeInfo.FSCStockNumber = _self.storageFSCStockNumber;
}
if ((!_self.currentBarCodeInfo.FSCSPNumber) || (_self.currentBarCodeInfo.FSCSPNumber.length == 0)) {
_self.currentBarCodeInfo.FSCSPNumber = _self.storageFSCSPNumber;
}
_self.currentBarCodeInfo.FBASEQTY = data["FBASEQTY"];
_self.currentBarCodeInfo.FBoxQty = 1;
_self.barcodeQtyDisabled = true;
if (_self.currentBarCodeInfo.FCType==3 && _self.currentBarCodeInfo.FIsBox==0) {
_self.barcodeQtyDisabled = false;
}
if (_self.boxTempList.length > 0) {
_self.boxTempList.splice(0, _self.boxTempList.length);
}
let extendBox = data.FBOXINFO;
extendBox.forEach(
function(el){
let elData = {
FSourceBillTypeName: _self.currentBarCodeInfo.FSourceBillTypeName?_self.currentBarCodeInfo.FSourceBillTypeName:"",
FSourceBillNo: el["FSRCBILLNO"]?el["FSRCBILLNO"]:"",
FBoxNumber: el["FBOXBARCODE"]?el["FBOXBARCODE"]:"",
FBarcodeNumber: el["FBARCODE"]?el["FBARCODE"]:"",
FItemNumber: el["FITEMNUMBER"]?el["FITEMNUMBER"]:"",
FItemName: el["FITEMNAME"]?el["FITEMNAME"]:"",
FItemID: el["FMATERIALID"]?el["FMATERIALID"]:"",
FSize: el["FSPECIFICATION"]?el["FSPECIFICATION"]:'',
// FModel: el["FSPECIFICATION"]?el["FSPECIFICATION"]:"",
FBatchNO: el["FLOT"]?el["FLOT"]:"",
FAuxPropName: el["FAUXPROPNAME"] ? el["FAUXPROPNAME"] : "",
FKFPeriod: el["FKFPERIOD"]?el["FKFPERIOD"]:"",
FKFDate: el["FKFDATE"]?el["FKFDATE"]:"",
FQty: el["FQTY"]?el["FQTY"]:"",
FUnitName: el["FUNITNAME"]?el["FUNITNAME"]:"",
FStockNumber: el["FLOCATION"]?el["FLOCATION"]:"",
FStockPlaceNumber: el["FLOCATION"]?el["FLOCATION"]:"",
FStockID:el["FSTOCKID"]?el["FSTOCKID"]:"",
FStockPlaceID:el["FSTOCKLOCID"]?el["FSTOCKLOCID"]:"",
FIsBox:true,
FCType: el["FBARTYPE"]?el["FBARTYPE"]:"",
FID: el["FID"]?el["FID"]:"",
FNO: el["FNO"]?el["FNO"]:"",
FName: el["FNAME"]?el["FNAME"]:"",
FLocation: el["FLOCATION"]?el["FLOCATION"]:"",
FBASEQTY: el["FBASEQTY"]?el["FBASEQTY"]:0
}
_self.boxTempList.push(elData);
}
)
if (_self.currentBarCodeInfo.FCType == 2) {
this.splitQtyDisabled = false;
}
else {
this.splitQtyDisabled = true;
}
if (_self.barcodeQtyDisabled) {
if (_self.FISSECUNIT) {
_self.showFSECUNITQTYFocus();
}
else if ((_self.currentTranType == 'SP_PickMtrl' || _self.currentTranType == 'STK_MisDelivery'||
_self.currentTranType == 'PRD_PickMtrl' || _self.currentTranType == 'PRD_FeedMtrl') && !this.splitQtyDisabled) {
_self.showSplitQtyFocus();
}
else {
_self.showLocationFcous();
}
}
else {
if (_self.FISSECUNIT) {
_self.showFSECUNITQTYFocus();
}
else {
_self.showQtyFocus();
}
}
//记录条码数量比较信息
qtyControlUtil.groupFieldArray.forEach(
function(item){
_self.currentBarCodeInfo[item] = data[item]? data[item]: "";
}
);
_self.currentBarCodeInfo[qtyControlUtil.barcodeQtyField] = data[qtyControlUtil.barcodeQtyField]? data[qtyControlUtil.barcodeQtyField]: 0;
console.log("-----qtyControlUtil-----currentBarCodeInfo---", _self.currentBarCodeInfo);
//强制刷新数据
_self.showResult = true;
_self.$forceUpdate();
_self.key = _self.key + 1;
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
//选择下标元素
tableSelect: function(selected) {
let _self = this;
if(selected.length > 0){
this.showResult = false;
}
else {
this.showResult = true;
}
this.selectedList = selected;
this.printList.splice(0, this.printList.length);
selected.forEach(
function(item){
_self.printList.push(_self.yesTableData[item].FBarcodeNumber);
}
);
// let index = selected[selected.length-1];
// let barcode = this.yesTableData[index].FNumber;
// if (barcode) {
// uni.showToast({
// title: "您选择了条码:" + barcode,
// icon: 'none'
// })
// }
},
//删除样式
delBtnClick: function(e) {
let _self = this;
console.log(this.baseTableData)
if (this.selectedList.length == 0) {
uni.showToast({
icon: "none",
title: "无删除数据"
})
return false;
}
this.dialogProps('确定删除数据吗?','del')
// uni.showModal();
},
//提交事件
commitBtnClick: function() {
let _self = this;
if (this.isCommitBtnDisable) {
return;
}
this.isCommitBtnDisable = true;
if (_self.yesTableData.length <= 0) {
uni.showToast({
icon: 'none',
title: "无提交数据",
duration: 1600,
});
this.showSourceBillNoFcous();
this.isCommitBtnDisable = false;
return false;
}
// 其他入库,备注必录
if (this.currentTranType == 'STK_MisCellaneous' && !this.note) {
uni.showToast({
icon: "none",
title: "备注不可以空白!",
duration: 3500,
});
this.isCommitBtnDisable = false;
return false;
}
let requestUrl;
if (this.currentTranType == 'STK_InStock') {
requestUrl = '/STKInStock/STKInStockSubmit';
}
if (this.currentTranType == 'PRD_InStock') {
requestUrl = '/InStock/InStockSubmit';
}
if (this.currentTranType == 'PRD_ReStock') {
requestUrl = '/InStock/RetStockSubmit';
}
if (this.currentTranType == 'PUR_MRB') {
requestUrl = '/STKInStock/PURRetStockSubmit';
}
if (this.currentTranType == 'SAL_OutStock') {
requestUrl = '/OutStock/SaleOutStockSubmit';
}
if (this.currentTranType == 'SUB_InStkPickmtl') {
requestUrl = '/SUBInStkPickmtl/SUBInStkPickmtl';
}
if (this.currentTranType == 'STK_MisCellaneous') {
requestUrl = '/MisInStock/MisInStockSubmit';
}
if (this.currentTranType == 'PRD_PickMtrl') {
requestUrl = '/PickMtrl/PickMtrlSubmit';
}
if (this.currentTranType == 'SUB_PICKMTRL') {
requestUrl = '/SUBPICKMTRL/SUBPICKMTRL';
}
if (this.currentTranType == 'STK_MisDelivery') {
requestUrl = '/MisInStock/MisRetStockSubmit';
}
if (this.currentTranType == 'SAL_ReturnStock') {
requestUrl = '/OutStock/SaleInStockSubmit';
}
if (this.currentTranType == 'SUB_OutStkPickmtl') {
requestUrl = '/SUBInStkPickmtl/SUBOutStkPickmtl';
}
if (this.currentTranType == 'PRD_ReturnMtrl') {
requestUrl = '/PickMtrl/ReturnMtrlSubmit';
}
if (this.currentTranType == 'SUB_RETURNMTRL') {
requestUrl = '/SUBPICKMTRL/SUBRETURNMTRL';
}
if (this.currentTranType == 'STK_OEMInStock') {
requestUrl = '/OEMInStock/InStockSubmit';
}
if (this.currentTranType == 'STK_OEMOutStock') {
requestUrl = '/OEMInStock/RetStockSubmit';
}
if (this.currentTranType == 'SP_PickMtrl') {
requestUrl = '/SimpleProduction/SimplePickMtrl';
}
if (this.currentTranType == 'SP_ReturnMtrl') {
requestUrl = '/SimpleProduction/SimpleReturnMtrl';
}
//补料领用单
if (this.currentTranType == 'PRD_FeedMtrl') {
requestUrl = '/PickMtrl/FeedMtrlSubmit';
}
//单据类型
if (this.currentTranType != 'STK_MisCellaneous' && this.currentTranType != 'STK_MisDelivery') {
this.orderTypeID = null;
}
if (this.currentTranType != 'STK_MisCellaneous' && this.currentTranType != 'STK_MisDelivery'
&& this.currentTranType != 'SP_InStock') {
this.note = undefined;
}
let requestParams = {
"barcodeList": this.commitList,
"orgID": this.orgFItemID,
"billTypeID": this.orderTypeID,
"Note": this.note,
"TranType": this.currentTranType.toUpperCase(),
"FDate": this.creatlist[0].detail
};
uni.showLoading({
icon:'loading',
title:'加载中……',
mask:true
});
this.$request.post(requestUrl,requestParams).then(res => {
this.isCommitBtnDisable = false;
uni.hideLoading();
this.showResult = true;
let data = res;
let addFlag = true;
this.commitList.forEach(
function(item) {
addFlag = true;
_self.barcodeTableData.forEach(
function(el) {
if (item.FBARCODE == el.barcode) {
addFlag = false;
}
}
);
if (addFlag) {
let obj = {barcode:item.FBARCODE, status:'拆分前'};
_self.barcodeTableData.push(obj);
}
}
);
if (data.barcodeList) {
data.barcodeList.forEach(
function(item){
addFlag = true;
_self.barcodeTableData.forEach(
function(el) {
if (item == el.barcode) {
addFlag = false;
}
}
);
if (addFlag) {
let obj = {barcode:item, status:'拆分后'};
_self.barcodeTableData.push(obj);
}
}
);
}
this.commitList.splice(0, this.commitList.length);
this.yesTableData.splice(0, this.yesTableData.length);
this.barcodeList.splice(0, this.barcodeList.length);
this.totalTableData.splice(0, this.totalTableData.length);
this.baseTableData = [];
this.TempBaseTableData = [];
this.RowNoTableData = [];
this.billTypeSelectText = "";
this.fNameArray.forEach(
function(item, index){
if (item.headerFID == "FDeptID") {
if (_self.$refs["FNameList"+index]) {
_self.$refs["FNameList"+index].selectText = "";
}
}
if (item.headerFID == "FSupplyID") {
if (_self.$refs["FNameList"+index]){
_self.$refs["FNameList"+index].selectText = "";
}
}
if (item.headerFID == "FCustID") {
if (_self.$refs["FNameList"+index]){
_self.$refs["FNameList"+index].selectText = "";
}
}
}
);
this.RowNo = "";
this.storageLocation = "";
this.storageFSCSPNumber = "";
this.storageFSCStockNumber = "";
this.clearBtnClick();
let msg = data.data;
if (!msg) {
msg = data;
}
this.dialogNoticeProps(msg,"success")
uni.removeStorageSync(this.dbAlise+this.userName+this.currentTranType+'lastSaveOrgid');
uni.removeStorageSync('pageCash'+this.dbAlise+this.userName+this.currentTranType+this.orgFItemID);
if (this.currentBarCodeInfo.FSourceTranType == 0 || !this.currentBarCodeInfo.FIsOpenSource){
this.barcodeNumberFcous = false;
this.$nextTick(function(){
this.barcodeNumberFcous = true;
});
}
if (this.currentBarCodeInfo.FIsOpenSource && this.currentBarCodeInfo.FSourceTranType !=0){
this.sourceBillNoFocus = false;
this.$nextTick(function(){
this.sourceBillNoFocus = true;
});
}
this.FBackReson = "";
this.splitQtyDisabled = true;
this.$forceUpdate();
}).catch(err => {
this.isCommitBtnDisable = false;
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
clearBtnClick:function(){
this.FBarcodeNumber = "";
this.currentBarCodeInfo.FQty = "";
this.currentBarCodeInfo.FSplitQty = "";
this.FSECUNITQTY = "";
this.currentBarCodeInfo.FBoxQty = "";
if(this.$refs.backResonList){
this.$refs.backResonList.selectText = "";
this.key++
}
if(this.$refs.stockStatusList){
this.$refs.stockStatusList.selectText = "";
this.key++
}
this.currentBarCodeInfo.FLocation = "";
this.currentBarCodeInfo.FItemNumber = "";
this.currentBarCodeInfo.FItemName = "";
this.currentBarCodeInfo.FModel = "";
this.currentBarCodeInfo.FAuxPropName = "";
this.currentBarCodeInfo.FLOT = "";
this.clearInfoByBar();
},
choseStockType:function(){},
billPreviousClick:function() {
if (this.billPreviousDisable) {
return;
}
if (this.billNextIndex > 0) {
this.billNextIndex--;
this.billNextDisable = false;
this.billPreviousDisable = false;
}
if (this.billNextIndex == 0) {
this.billPreviousDisable = true;
}
else {
this.billNextDisable = false;
this.billPreviousDisable = false;
}
this.showBillNext();
},
billNextClick:function() {
if (this.billNextDisable) {
return;
}
let indexMax = this.billNextList.length-1;
if (this.billNextIndex < indexMax) {
this.billNextIndex++;
this.billNextDisable = false;
this.billPreviousDisable = false;
}
if (this.billNextIndex == indexMax) {
this.billNextDisable = true;
}
else {
this.billNextDisable = false;
this.billPreviousDisable = false;
}
this.showBillNext();
},
showBillNext:function() {
let _self = this;
for (let index = 0; index < this.billNextList.length; index++) {
let item = this.billNextList[index];
if (index == _self.billNextIndex) {
_self.billFITEMNUMBER = item.billFITEMNUMBER;
_self.billFITEMNAME = item.billFITEMNAME;
_self.billFUNITNAME = item.billFUNITNAME;
_self.billFREMINANQTY = item.billFREMINANQTY;
_self.billFSPECIFICATION = item.billFSPECIFICATION;
_self.billFAUXPROPNAME = item.billFAUXPROPNAME;
_self.billFLOT = item.billFLOT;
_self.billFSTOCKNAME = item.billFSTOCKNAME;
_self.billFSTOCKLOCNAME = item.billFSTOCKLOCNAME;
_self.$forceUpdate();
break;
}
}
},
checkBarcodeNumber:function(barcodeNumber) {
if (!barcodeNumber) {
return true;
}
let ruleNoSpace = this.barcodeRule.replace(/\s*/g,"");
if (!ruleNoSpace) {
return false;
}
if (ruleNoSpace.length === 0) {
return false;
}
let rules = ruleNoSpace.split("|");
//最小长度|最大长度|起始字符|结束字符|包含字符(字符之间可以已逗号隔开)
if (rules[0]) {
if (barcodeNumber.length < Number.parseInt(rules[0])) {
return true;
}
}
if (rules[1]) {
if (barcodeNumber.length > Number.parseInt(rules[1])) {
return true;
}
}
if (rules[2]) {
let header = barcodeNumber.substr(0,1);
let ruleChart2 = rules[2].split(",")
if(ruleChart2) {
if(ruleChart2.length > 0) {
let filterChart2 = ruleChart2.filter(
function(myChar){
return myChar == header;
}
)
if (!filterChart2) {
return true;
}
if (filterChart2.length === 0) {
return true;
}
}
}
}
if (rules[3]) {
let end = barcodeNumber.substr(-1,1);
let ruleChart3 = rules[3].split(",");
if (ruleChart3) {
if (ruleChart3.length > 0) {
let filterChart3 = ruleChart3.filter(
function(myChar){
return myChar == end;
}
)
if (!filterChart3) {
return true;
}
if (filterChart3.length === 0) {
return true;
}
}
}
}
if (rules[4]) {
let myBarcodeNumber = barcodeNumber;
if (rules[2]) {
myBarcodeNumber = myBarcodeNumber.substr(1,myBarcodeNumber.length-1);
}
if (rules[3]) {
myBarcodeNumber = myBarcodeNumber.substr(0, myBarcodeNumber.length-1);
}
let ruleChart4 = rules[4].split(",");
if (ruleChart4) {
if (ruleChart4.length > 0) {
ruleChart4.forEach(
function(myChar){
myBarcodeNumber = myBarcodeNumber.replace(new RegExp(myChar,"gm"),"");
}
);
if (myBarcodeNumber) {
if (myBarcodeNumber.length > 0) {
return true;
}
}
}
}
}
return false;
},
clearInfoByBar:function(){
if(this.currentBarCodeInfo.FSourceTranType == "0") {
this.currentBarCodeInfo.FSourceBillNo = "";
}
else {
if (!this.currentBarCodeInfo.FIsOpenSource) {
this.currentBarCodeInfo.FSourceBillNo = "";
}
this.currentBarCodeInfo.FID0 = "";
this.currentBarCodeInfo.FName0 = "";
this.currentBarCodeInfo.FNO0 = "";
this.currentBarCodeInfo.FID1 = "";
this.currentBarCodeInfo.FName1 = "";
this.currentBarCodeInfo.FNO1 = "";
}
this.barcodeQtyDisabled = true;
this.currentBarCodeInfo.FItemNumber = "";
this.currentBarCodeInfo.FItemName = "";
this.currentBarCodeInfo.FModel = "";
this.currentBarCodeInfo.FAuxPropName = "";
this.currentBarCodeInfo.FQty = "";
this.currentBarCodeInfo.FBoxQty = "";
this.currentBarCodeInfo.FLocation = "";
this.currentBarCodeInfo.FSCStockNumber = "";
this.currentBarCodeInfo.FSCSPNumber = "";
this.currentBarCodeInfo.FLOT = "";
this.currentBarCodeInfo.FUNITNAME = "";
this.key = this.key + 1;
this.$forceUpdate();
},
barcodeSelect: function(selected) {
let _self = this;
this.printList.splice(0, this.printList.length);
selected.forEach(
function(item){
_self.printList.push(_self.barcodeTableData[item].barcode);
}
);
},
printBarcode: function(printListPa) {
let localList = this.printList;
if (printListPa) {
localList = printListPa;
}
this.$refs.networkPrintTab.printBarcode(localList);
},
bluePrintBarcode: function(bluePrintListPa) {
if (this.$store.state.blueConnectedFlag) {
let localList = this.printList;
if (bluePrintListPa) {
localList = bluePrintListPa;
}
this.$refs.bluetoothPrintTab.bluePrintBarcode(localList);
localList = null;
}
else {
uni.showToast({
icon: "none",
title: "请先连接蓝牙!",
duration: 3500,
});
}
},
tabChange:function(index){
let printClear = true;
if (this.detailTabIndex == index) {
printClear = false;
}
this.detailTabIndex = index;
if (printClear) {
if (this.detailTabIndex==5 || this.detailTabIndex==3) {
this.printList.splice(0, this.printList.length);
}
}
},
noteConfirm:function(){
this.showBarcodeNumberFcous();
},
saveCash:function(){
let _self = this;
let otherInfo = {"currentTranType":_self.currentTranType,
"FSourceBillTypeName":_self.currentBarCodeInfo.FSourceBillTypeName,
"FSourceBillType":_self.currentBarCodeInfo.FSourceBillType,
"orgFItemID":_self.orgFItemID,
"dbAlise":_self.dbAlise,
"UserID":_self.userName,
"RowNo":_self.RowNo,
"FNameList0":_self.$refs.FNameList0 ? _self.$refs.FNameList0.selectText : "",
"FNameList1":_self.$refs.FNameList1 ? _self.$refs.FNameList1.selectText : "",
"FDEPTID":_self.FDEPTID?_self.FDEPTID:'',
"FSUPPLYID":_self.FSUPPLYID?_self.FSUPPLYID:'',
"FCUSTID":_self.FCUSTID?_self.FCUSTID:'',
"FSourceBillNo":_self.currentBarCodeInfo.FSourceBillNo.split('-')[0],
"FLocation":_self.currentBarCodeInfo.FLocation ? _self.currentBarCodeInfo.FLocation : "",
"FSCStockNumber":_self.currentBarCodeInfo.FSCStockNumber ? _self.currentBarCodeInfo.FSCStockNumber : "",
"FSCSPNumber":_self.currentBarCodeInfo.FSCSPNumber ? _self.currentBarCodeInfo.FSCSPNumber : "",
"barcodeQtyDisabled":_self.barcodeQtyDisabled,
"sourceBillNoDisable":_self.sourceBillNoDisable,
"ownerTypeShow":_self.ownerTypeShow,
"FOWNERTYPEID":_self.FOWNERTYPEID,
"ownerTypeSelectText":_self.ownerTypeSelectText,
"FOWNERID":_self.FOWNERID,
"ownerOrgSelectText":_self.ownerOrgSelectText,
};
_self.pageCashInfo.yesTableData = _self.yesTableData;
_self.pageCashInfo.commitList = _self.commitList;
_self.pageCashInfo.otherInfo = otherInfo;
_self.pageCashInfo.barcodeList = _self.barcodeList;
_self.pageCashInfo.baseTableData = _self.baseTableData;
uni.setStorageSync('pageCash'+_self.dbAlise+_self.userName+_self.currentTranType+_self.orgFItemID,_self.pageCashInfo);
},
judgeCash:function(){
let _self = this;
let lastSaveOrgid = uni.getStorageSync(this.dbAlise+this.userName+this.currentTranType+'lastSaveOrgid');
let cashValue;
if(!this.isChangedOrg){
cashValue = uni.getStorageSync('pageCash'+this.dbAlise+this.userName+this.currentTranType+lastSaveOrgid);
}else{
cashValue = uni.getStorageSync('pageCash'+this.dbAlise+this.userName+this.currentTranType+this.orgFItemID);
}
if(cashValue.commitList){
// uni.showModal({
// content:'存在未提交数据是否加载',
// success: function (res) {
// if (res.confirm) {
// _self.loadByCash();
// }
// else if (res.cancel) {
// _self.getSourceBillTypeInfo();
// }
// }
// })
this.dialogProps('存在未提交数据是否加载','judgeCash')
}
else{
this.getSourceBillTypeInfo();
}
},
//test 测试添加
...mapMutations(['updateCacheByStorage'])
}
};
</script>
<style lang="scss">
.z-application-content {
font-size: 44rpx;
}
.header-row-class-organzie{
display: flex;
justify-content: flex-end;
align-items: center;
padding-right: 50rpx;
}
.header-row-title-class-organzie{
font-size: 32rpx;
font-family: MicrosoftYaHei;
color: #666666;
}
.head-row-content-class-organzie{
font-size: 32rpx;
font-family: MicrosoftYaHei;
color: #666666;
}
.img-organzie{
height: 32rpx;
width: 32rpx;
margin-left: 24rpx;
}
.header-row-class {
display: flex;
flex-wrap: nowrap;
height: 60rpx;
line-height: 60rpx;
margin-top: 8rpx;
// background-color: #f7f9ff;
justify-content: flex-start;
align-items: center;
margin-left: 32rpx;
margin-right: 32rpx;
}
.header-row-class image{
height: 40rpx;
width: 40rpx;
position: absolute;
right: 40rpx;
}
.header-row-title-class {
width: 130rpx;
height: 60rpx;
line-height: 60rpx;
font-size: 32rpx;
font-family: MicrosoftYaHei;
color: #666666;
}
.header-row-select-class{
width: 100%;
height: 66rpx;
line-height: 66rpx;
border-radius: 10rpx;
border: 2rpx solid #D8D8D8;
flex: 1 1;
font-size: 32rpx;
font-family: MicrosoftYaHei;
color: #5F7EF8;
margin-left: 24rpx;
::v-deep.uni-select {
border: none;
}
::v-deep.uni-select__input-text {
font-size: 32rpx;
font-family: MicrosoftYaHei;
color: #5F7EF8;
}
::v-deep.uni-select__selector-item {
font-size: 32rpx;
}
}
.header-row-input-gray-class{
height: 60rpx;
border-radius: 10rpx;
border: 2rpx solid #D8D8D8;
flex: 0 0;
font-size: 28rpx;
font-family: MicrosoftYaHei;
color: #5F7EF8;
background-color: #F4F4F4;
margin-left: 24rpx;
padding-left: 24rpx;
}
.header-row-input-white-class{
height: 60rpx;
border-radius: 10rpx;
border: 2rpx solid #D8D8D8;
flex: 0 0;
font-size: 28rpx;
font-family: MicrosoftYaHei;
background-color: #FFFFFF;
color: #5F7EF8;
margin-left: 24rpx;
padding-left: 24rpx;
}
.separate{
width: 100%;
height: 16rpx;
background-color:#F5F5F5;
}
.detail-tabs-class {
display: flex;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: center;
height: 80rpx;
}
.detail-tabs-btn-gray-class {
position: relative;
width: 100%;
height: 80rpx;
line-height: 80rpx;
text-align: center;
font-size:28rpx;
font-family:MicrosoftYaHei;
color:#4662FF;
flex-grow: 1;
flex-shrink: 1;
}
.detail-tabs-btn-gray-class::after{
position: absolute;
content: " ";
width: 2rem;
height: 0.12rem;
background: #4662FF;
bottom: -0.1rem;
left: 50%;
transform: translateX(-50%);
}
.detail-tabs-btn-handle-class {
// position: relative;
width: 100%;
height: 80rpx;
line-height: 80rpx;
text-align: center;
font-size:28rpx;
font-family:MicrosoftYaHei;
color:#666666;
}
.detail-tabs-btn-yes-class {
position: relative;
width: 100%;
height: 80rpx;
line-height: 80rpx;
text-align: center;
font-size:28rpx;
font-family:MicrosoftYaHei;
color:#666666;
}
.detail-tabs-btn-total-class {
width: 100%;
height: 80rpx;
line-height: 80rpx;
text-align: center;
font-size:28rpx;
font-family:MicrosoftYaHei;
color:#666666;
}
.detail-tabs-btn-base-class {
width: 100%;
height: 80rpx;
line-height: 80rpx;
text-align: center;
font-size:28rpx;
font-family:MicrosoftYaHei;
color:#666666;
}
.detail-row-class {
display: flex;
flex-wrap: nowrap;
height: 60rpx;
margin-top: 8rpx;
// background-color: #f7f9ff;
justify-content: flex-start;
align-items: center;
margin-left: 32rpx;
margin-right: 32rpx;
// margin-top: 16rpx;
}
.detail-row-class image{
height: 40rpx;
width: 40rpx;
position: absolute;
right: 40rpx;
}
.detail-row-title-class{
width: 135rpx;
height: 60rpx;
line-height: 72rpx;
font-size: 32rpx;
font-family: MicrosoftYaHei;
color: #666666;
}
.detail-row-white-class{
height: 60rpx;
line-height: 60rpx;
border-radius: 10rpx;
border: 2rpx solid #D8D8D8;
// flex: 0 0;
font-size: 32rpx;
font-family: MicrosoftYaHei;
color: #666666;
margin-left: 24rpx;
padding-left: 24rpx;
}
.detail-row-white-class-stock{
height: 60rpx;
line-height: 60rpx;
border-radius: 10rpx;
border: 2rpx solid #D8D8D8;
// flex: 0 0;
font-size: 32rpx;
font-family: MicrosoftYaHei;
color: #FFFFFF;
text-align: center;
margin-left: 24rpx;
background-color: #007AFF;
// padding-left: 24rpx;
}
.detail-row-gray-class{
height: 60rpx;
border-radius: 10rpx;
border: 2rpx solid #D8D8D8;
// flex: 0 0;
font-size: 32rpx;
font-family: MicrosoftYaHei;
color: #666666;
background-color: #F4F4F4;
margin-left: 24rpx;
padding-left: 24rpx;
}
.table {
margin-top: 16rpx;
margin-right: 32rpx;
margin-left: 32rpx;
}
.header-row-btn-class{
display: flex;
width: 100%;
height: 80rpx;
margin-top: 16rpx;
}
.commitBtnOther{
width: 100%;
height: 80rpx;
line-height: 80rpx;
color: #FFFFFF;
background: #5778FF;
font-size: 32rpx;
font-family: MicrosoftYaHei;
text-align: center;
border-radius: unset;
position: fixed;
left: 0;
bottom: 0;
}
.header-row-btn-class-commit{
width: 50%;
position: fixed;
height: 80rpx;
line-height: 80rpx;
font-size: 32rpx;
font-family: MicrosoftYaHei;
background: #5778FF;
color: #FFFFFF;
text-align: center;
border-radius: unset;
right: 0;
bottom: 0;
}
.header-row-btn-class-clear{
width: 50%;
position: fixed;
height: 80rpx;
line-height: 80rpx;
font-size: 32rpx;
text-align: center;
font-family: MicrosoftYaHei;
background: #F5F5F4;
color: #666666;
border-radius: unset;
left: 0;
bottom: 0;
}
.header-row-btn-class-del{
width: 100%;
height: 80rpx;
line-height: 80rpx;
font-size: 32rpx;
font-family: MicrosoftYaHei;
color: #FFFFFF;
text-align: center;
background-color: #F76260;
border-radius: unset;
position: fixed;
left: 0;
bottom: 0;
}
.chooseRowNo{
position: fixed;
width: 100%;
height: 50%;
top: 200rpx;
left: 0;
z-index: 15;
}
.image-barcode{
position: absolute;
width: 40rpx;
height: 40rpx;
// position: fixed;
right: 16rpx;
bottom: 12rpx;
}
.alter{
position: fixed;
left: 0;
right: 0;
top:0;
bottom: 0;
background-color: #333333;
opacity: 0.5;
}
.err{
position: fixed;
left: 100rpx;
right: 100rpx;
top: 400rpx;
background-color: #FFFFFF;
border-radius: 20rpx;
opacity: 1;
z-index: 5;
}
.errTitle{
height: 80rpx;
line-height: 80rpx;
width: 100%;
font-size: 32rpx;
text-align: center;
// border-bottom: 2rpx solid #3D3D3D;
}
.errList{
width: 100%;
margin-left: 16rpx;
margin-right: 16rpx;
}
.errDetails{
width: 90%;
font-size: 26rpx;
color: #3D3D3D;
text-align: center;
}
.errConfirm{
height: 80rpx;
line-height: 80rpx;
width: 100%;
font-size: 32rpx;
text-align: center;
color: #007AFF;
border-top: 2rpx solid #3D3D3D;
}
.cash-btn{
display: flex;
}
.cashConfirm{
height: 80rpx;
line-height: 80rpx;
width: 50%;
font-size: 32rpx;
text-align: center;
color: #007AFF;
border-top: 2rpx solid #3D3D3D;
border-right: 2rpx solid #3B4144;
}
.cashCancel{
height: 80rpx;
line-height: 80rpx;
width: 50%;
font-size: 32rpx;
text-align: center;
color: #007AFF;
border-top: 2rpx solid #3D3D3D;
}
.detail-row-class-b{
display: flex;
flex-wrap: nowrap;
height: 60rpx;
margin-top: 8rpx;
justify-content: flex-start;
align-items: center;
margin-left: 32rpx;
margin-right: 32rpx;
}
.detail-row-title-class-b{
width: 135rpx;
height: 60rpx;
line-height: 72rpx;
font-size: 32rpx;
font-family: MicrosoftYaHei;
color: #666666;
}
.detail-row-white-class-b{
flex: 1 1;
height: 64rpx;
line-height: 64rpx;
border-radius: 10rpx;
border: 2rpx solid #D8D8D8;
font-size: 32rpx;
font-family: MicrosoftYaHei;
color: #666666;
}
.pic-upload{
position: fixed;
height: 80rpx;
width: 80rpx;
border: 2rpx solid #5F7EF8;
border-radius: 50%;
color: #FFFFFF;
background: #5F7EF8;
bottom: 100rpx;
right: 32rpx;
}
.pic-upload-text{
height: 40rpx;
line-height: 40rpx;
font-size: 26rpx;
text-align: center;
}
.button-class{
height:80rpx;
line-height:80rpx;
border-radius:4rpx;
font-size:32rpx;
margin-top: 32rpx;
background-color: #4662FF;
color: #FFFFFF!important;
}
.bill-next-button{
width: 120rpx;
height: 60rpx;
line-height: 60rpx;
border-radius: 10rpx;
border: 2rpx;
// flex: 0 0;
font-size: 32rpx;
font-family: MicrosoftYaHei;
color: #FFFFFF;
text-align: center;
margin-left: 24rpx;
background-color: #007AFF;
}
.bill-next-button-disable{
width: 120rpx;
height: 60rpx;
line-height: 60rpx;
border-radius: 10rpx;
border: 2rpx solid;
// flex: 0 0;
font-size: 32rpx;
font-family: MicrosoftYaHei;
color: #FFFFFF;
text-align: center;
margin-left: 24rpx;
background-color: #808080 ;
}
</style>