Files
GX.O3.WMS/APK/APP_O3/components/z-application-allotedcontent/z-application-allotedcontent.vue
T

4728 lines
164 KiB
Vue
Executable File

<template>
<view class="z-application-allotedcontent">
<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 class="header-row-class">
<p class="header-row-title-class">源单类型</p>
<view style="flex: 1 1;margin-left: 24rpx;">
<xfl-select :fours='isFocus' :list="billTypeList" :listOrigin="billTypeList"
:clearable="false" :showItemNum="5" ref="billTypeList"
:isCanInput="false" :style_Container="listBoxStyle" @change="billTypeChange"
v-model="currentBarCodeInfo.FSourceBillTypeName" :defaultSelectText="billTypeSelectText"
class="header-row-select-class" style="height: 66rpx;">
</xfl-select>
</view>
</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="[isshowcolor?'header-row-input-gray-class':'header-row-input-white-class']"
v-model="currentBarCodeInfo.FSourceBillNo" @confirm="SelQuery()" :disabled="billNoDisabled" :focus="Fsours" :key='key'>
</view>
<image src="../../static/img/scan-blue.png" v-show="showScan && !billNoDisabled" @click="scan('sourceBillScan')" />
</view>
<view class="header-row-class" v-if="isShowRowNO">
<p class="header-row-title-class">源单行号</p>
<view style="flex: 1 1; position: relative;" @click="confirmDialog()">
<input type="text" class="header-row-input-white-class" :disabled="true" v-model="RowNo">
<image class="image-barcode" src="../../static/img/fangdajing.svg"></image>
</view>
</view>
<view class="detail-row-class" v-if="currentTranType=='STK_TransferManage'">
<p class="detail-row-title-class">调拨类型</p>
<view style="flex: 1 1;margin-left: 24rpx;">
<xfl-select :list="transferTypeArray" :listOrigin="transferTypeArray" :clearable="false" :showItemNum="5" ref="transferTypeArray"
:isCanInput="false" :style_Container="listBoxStyle" @change="transferTypeArrayChange"
:defaultSelectText="transferTypeArrayName" class="header-row-select-class" style="height: 66rpx;">
</xfl-select>
</view>
</view>
<view class="detail-row-class" v-if="currentTranType=='STK_TransferManage'">
<p class="detail-row-title-class">调出组织</p>
<view style="flex: 1 1;margin-left: 24rpx;">
<xfl-select :list="orgArry" :listOrigin="orgArry" :clearable="false" :showItemNum="5" ref="callOutOrgArray"
:isCanInput="false" :style_Container="listBoxStyle" @change="callOutOrgArrayChange"
:defaultSelectText="callOutOrgArrayName" class="header-row-select-class" style="height: 66rpx;">
</xfl-select>
</view>
</view>
<view class="detail-row-class" v-if="currentTranType=='STK_TransferManage'">
<p class="detail-row-title-class">调出货主</p>
<view style="flex: 1 1;margin-left: 24rpx;">
<xfl-select :list="orgArry" :listOrigin="orgArry" :clearable="false" :showItemNum="5" ref="callOutOwnerArray"
:isCanInput="false" :style_Container="listBoxStyle" @change="callOutOwnerArrayChange" :disabled="callOutOwnerArrayDisabled"
:defaultSelectText="callOutOwnerArrayName" class="header-row-select-class" style="height: 66rpx;">
</xfl-select>
</view>
</view>
<view class="detail-row-class">
<p class="detail-row-title-class">调入组织</p>
<view style="flex: 1 1;margin-left: 24rpx;">
<xfl-select :list="orgArry" :listOrigin="orgArry" :clearable="false" :showItemNum="5" ref="orgArry"
:isCanInput="false" :style_Container="listBoxStyle" @change="inOrgArryChange" :disabled="callInOrgArrayDisabled"
:defaultSelectText="inOrgArryName" class="header-row-select-class" style="height: 66rpx;">
</xfl-select>
</view>
</view>
<view class="detail-row-class" v-if="currentTranType=='STK_TransferManage'">
<p class="detail-row-title-class">调入货主</p>
<view style="flex: 1 1;margin-left: 24rpx;">
<xfl-select :list="orgArry" :listOrigin="orgArry" :clearable="false" :showItemNum="5" ref="callInOwnerArray"
:isCanInput="false" :style_Container="listBoxStyle" @change="callInOwnerArrayChange" :disabled="callInOwnerArrayDisabled"
:defaultSelectText="callInOwnerArrayName" class="header-row-select-class" style="height: 66rpx;">
</xfl-select>
</view>
</view>
<view style="height: 32rpx;" />
<view class="separate" />
<!-- <view style="height: 20rpx;"></view> -->
<view class="detail-tabs-class">
<view @tap="OpetaShow()" :class="[showinp?'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="moreshow() " :class="[showMoreShow?'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>
<view @tap="YesShow()" :class="[showYesShow?'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>
<view @tap="totalshow()" :class="[showTotalShow?'detail-tabs-btn-gray-class':'detail-tabs-btn-total-class']">汇总</view>
</view>
<!-- <view style="height: 32rpx;"></view> -->
<view v-if="showinp">
<view class="detail-row-class">
<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="barcodeInfoConfirm()"
v-model="currentBarCodeInfo.FBarcodeNumber" :focus="barcodecous" :key='key'/>
</view>
<image src="../../static/img/scan-blue.png" v-show="showScan" @click="scan('barCodeScan')" />
</view>
<view class="detail-row-class">
<p class="detail-row-title-class">数&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 量</p>
<view style="flex: 1 1; display: flex; flex-direction: row;">
<input :class="[issum?'detail-row-gray-class':'detail-row-white-class']"
v-model="currentBarCodeInfo.FQty" @confirm="qtyConfirm" :disabled="issum" :focus="QtyFocus" :key='key'
style="width:300rpx; margin-right:20rpx;"/>
<view style="height:60rpx; line-height:60rpx;">{{currentBarCodeInfo.FUNITNAME}}</view>
</view>
</view>
<!-- 辅助单位数量 外购入库&生产领料显示-->
<view class="detail-row-class">
<p class="detail-row-title-class">辅助数量</p>
<view 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="stockStatus">
<p class="detail-row-title-class">调出状态</p>
<view style="flex: 1 1;margin-left: 24rpx;">
<xfl-select :list="outStockStatusList" :listOrigin="outStockStatusList"
:clearable="false" :showItemNum="5" ref="outStockStatusList" :disabled="true"
:isCanInput="false" :style_Container="listBoxStyle" @change="outStockStatusListChange"
:defaultSelectText="currentBarCodeInfo.OUTSTOCKSTATUSNAME" class="header-row-select-class" style="height: 66rpx;">
</xfl-select>
</view>
</view>
<view class="detail-row-class" v-if="isShowStock">
<p class="detail-row-title-class"> 调出位置</p>
<view style="flex: 1 1;">
<input class="detail-row-gray-class" v-model="currentBarCodeInfo.transferOutLocation"
disabled="true"
@confirm="transferOutLocationConfirm()" :focus="transferOutLocationFocus" :key='key'/>
</view>
<image src="../../static/img/scan-blue.png" v-show="showScan && isShowStock" @click="scan('outStockScan')" />
</view>
<view v-if="!isShowStock">
<view class="detail-row-class">
<p class="detail-row-title-class"> 调出仓库</p>
<view style="flex: 1 1;">
<input class="detail-row-white-class" v-model="currentBarCodeInfo.outFSCStockNumber"
@confirm="outFSCStockNumberConfirm()" :focus="outFSCStockNumberFocus" :key='key'/>
</view>
<image src="../../static/img/scan-blue.png" v-show="showScan && !isShowStock" @click="scan('outStockStorScan')" />
</view>
<view class="detail-row-class">
<p class="detail-row-title-class"> 调出仓位</p>
<view style="flex: 1 1;">
<input :class="[!outStockDisable?'detail-row-white-class':'detail-row-gray-class']"
v-model="currentBarCodeInfo.outFSCSPNumber" :disabled="outStockDisable"
@confirm="outFSCSPNumberConfirm()" :focus="outFSCSPNumberFocus" :key='key'/>
</view>
<image src="../../static/img/scan-blue.png" v-show="showScan && !isShowStock && outStockDisable" @click="scan('outStockPlaceScan')" />
</view>
</view>
<view class="detail-row-class" v-if="stockStatus">
<p class="detail-row-title-class">调入状态</p>
<view style="flex: 1 1;margin-left: 24rpx;">
<xfl-select :list="inStockStatusList" :listOrigin="inStockStatusList" :clearable="false"
:showItemNum="5" ref="inStockStatusList" :disabled="true"
:isCanInput="false" :style_Container="listBoxStyle" @change="inStockStatusListChange"
:defaultSelectText="currentBarCodeInfo.INSTOCKSTATUSNAME" class="header-row-select-class" style="height: 66rpx;">
</xfl-select>
</view>
</view>
<view class="detail-row-class" v-if="isShowStock">
<p class="detail-row-title-class"> 调入位置</p>
<view style="flex: 1 1;">
<input class="detail-row-white-class" v-model="currentBarCodeInfo.transferInLocation"
@confirm="transferInLocationConfirm()" :focus="transferInLocationFocus" :key='key'/>
</view>
<image src="../../static/img/scan-blue.png" v-show="showScan && isShowStock" @click="scan('inStockScan')" />
</view>
<view v-if="!isShowStock">
<view class="detail-row-class">
<p class="detail-row-title-class">调入仓库</p>
<view style="flex: 1 1;">
<input class="detail-row-white-class" v-model="currentBarCodeInfo.inFSCStockNumber"
@confirm="inFSCStockNumberConfirm()" :focus="inFSCStockNumberFocus" :key='key'/>
</view>
<image src="../../static/img/scan-blue.png" v-show="showScan && !isShowStock" @click="scan('inStockStorScan')" />
</view>
<view class="detail-row-class">
<p class="detail-row-title-class">调入仓位</p>
<view style="flex: 1 1;">
<input :class="[!inStockDisable?'detail-row-white-class':'detail-row-gray-class']"
v-model="currentBarCodeInfo.inFSCSPNumber" :disabled="inStockDisable"
@confirm="inFSCSPNumberConfirm()" :focus="inFSCSPNumberFocus" :key='key'/>
</view>
<image src="../../static/img/scan-blue.png" v-show="showScan && !isShowStock && inStockDisable"
@click="scan('inStockPlaceScan')"></image>
</view>
</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 class="detail-row-gray-class" v-model="currentBarCodeInfo.FQty" :disabled="issum" :key='key'/>
</view>
</view> -->
<view class="detail-row-class">
<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" :key='key'/>
</view>
<view style="flex: 1 1;">
<view class="detail-row-white-class-stock" @click="timeStock">
即时库存
</view>
</view>
</view>
<view class="detail-row-class">
<p class="detail-row-title-class">物料名称</p>
<view style="flex: 1 1;">
<input class="detail-row-gray-class" disabled="true" v-model="currentBarCodeInfo.FItemName" :key='key'/>
</view>
</view>
<view class="detail-row-class">
<p class="detail-row-title-class">规格型号</p>
<view style="flex: 1 1;">
<input class="detail-row-gray-class" disabled="true" v-model="currentBarCodeInfo.FModel" :key='key'/>
</view>
</view>
<view class="detail-row-class">
<p class="detail-row-title-class">辅助属性</p>
<view style="flex: 1 1;">
<input class="detail-row-gray-class" disabled="true" v-model="currentBarCodeInfo.FAuxPropName" :key='key'/>
</view>
</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 class="detail-row-gray-class" disabled="true" v-model="currentBarCodeInfo.FLOT" />
</view>
</view>
<!-- background-color: #F0F0F0; -->
<!-- <button class="kc" @tap="ShowTimeScok()">即时库存</button> -->
</view>
<!-- <view class="example-block"> -->
<view class="table" v-show="showMoreShow" style="padding-bottom: 100rpx;">
<z-table :tableData='baseTableData' :columns='baseColumns' emptyText='设置了showLoading=false才会看到我'
@onClick='rowClick' @onSort='doSort' />
</view>
<!-- 已扫描 -->
<view class="table" v-show="showYesShow" style="padding-bottom: 100rpx;">
<z-table :tableData='scannedTableData' :columns='scannedColumns' emptyText='设置了showLoading=false才会看到我' showSelect @onClick='rowClick'
@onSelect='tableSelect' @onSort='doSort' />
</view>
<!-- 汇总 -->
<view class="table" v-show="showTotalShow" style="padding-bottom: 100rpx;">
<z-table :tableData='totalTableData' :columns='totalColumns' emptyText='false' @onClick='rowClick'
@onSort='doSort' />
</view>
<!-- </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="header-row-btn-class" v-show="showResult || !showYesShow">
<view :class="[showinp ? 'header-row-btn-class-commit' : 'commitBtnOther']"
@click="commitBtnClick()" :disabled="isCommitBtnDisable">提交</view>
<view class="header-row-btn-class-clear" @click="clearBtnClick" v-if="showinp">清空</view>
</view>
<view class="header-row-btn-class-del" @click="del" v-show="!showResult && showYesShow">删除</view>
<view class="alter" v-if="showErrTips" @click="hideErrTips"></view>
<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 class="errConfirm" @click="hideErrTips">确定</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 "../z-table/z-table.vue";
import uniTag from "../../components/uni-badge/uni-badge.vue";
import xflSelect from '../xfl-select/xfl-select.vue';
import uniPopupDialog from '@/components/uni-popup/uni-popup-dialog.vue';
import DateTimePicker from '@/components/bory-dateTimePickerWithOutTime/bory-dateTimePickerWithOutTime.vue';
const commonUtil = require('../../common/util.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';
const qtyControlUtil = require('@/common/qtyControl.js');
import {
mapState,
mapMutations
} from 'vuex';
var _self;
export default {
data() {
return {
InOrgID:'' , //调入位置组织ID
inOrgArryName:'', //调入位置组织名称
sourceBillTempList:[],
// 日期选择
dateString: '',
type: 'date',
creatlist: [{
type: 'date',
detail: '选择开始时间'
}],
curDate: '',
FISSECUNIT:false, //是否启用辅助单位数量
FSECUNITQTY:'',
FSECUNITID:'',
FSECUNITQTYFocus:false,
FKEEPERID:'',
FKEEPERTYPEID:'',
FOWNERID:'',
FOWNERTYPEID:'',
dbAlise:'',
userName:'',
showScan:true,
// showCashTips:false,
// loadCash:false,
pageCashInfo: new Object(),
isShowRowNO:false,
RowNo:"",
RowNoTableData:[],
isClosedPopup:false,
FDate:"",
showErrTips:false,
errDetailsList:[],
errDetails:[],
key:1,
FDetailID:"",
FUnitID:"",
isShowOrg:true,
orgArry:[{name:"请选择组织", key:"", FName:""}],
orgFItemID:'',
index:0,
FSourceTranType:"",
storageLocation:"",
storageoutFSCStockNumber:"",
storageoutFSCSPNumber:"",
storagetransferInLocation:"",
storageinFSCStockNumber:"",
storageinFSCSPNumber:"",
outFSCSPNumber:"",
outFSCStockNumber:"",
outStockDisable:false,
inStockDisable:false,
FIsStockMgr:false,
outFSCStockFIsStockMgr:false,
inFSCStockFIsStockMgr:false,
showResult:true,
//位置回车是否检查数量
FIsControlQty: "",
//位置回车辅助属性检查
FOtherControl:"",
billTypeSelectText:"请选择",
billTypeList:[],
isShowStock:true,
isOutStockDisable:true,
isOutStockPostionDisable:true,
isInStockDisable:true,
isInStockPostionDisable:true,
//提交按钮控制
isCommitBtnDisable:false,
isshowcolor: false,
DCStockID: '',
DCStockNumber: '',
DCStockName: '',
DCStockPlaceID: '',
DCStockPlaceNumber: '',
DCStockPlaceName: '',
DcInput: '',
datalistM: '',
SuItemID: '',
SuFNumber: "",
Suvalue: "",
Fsours: false,
barcodecous: false,
QtyFocus:false,
transferOutLocationFocus: false,
outFSCStockNumberFocus:false,
outFSCSPNumberFocus:false,
transferInLocationFocus: false,
inFSCStockNumberFocus:false,
inFSCSPNumberFocus:false,
de: false,
set: true,
mess: '',
TypeforC: '',
issum: true,
isbox: true,
showYesShow: false,
showTotalShow: false,
showMoreShow: false,
//源单类选择项文本(用于对已扫描展示拼接)
oplist: [],
showsupper: true,
//供应商只读文本框展示 true
supper: false,
//供应商制度 true
showsup: false,
viewName: '',
suppred: false,
selcour: false,
ol: false,
FTranName: "",
FMatNumber: "",
FAuxPropName: "",
FMatName: "",
FSourceBillNo: "",
//带过来的源单信息编号
FSourceBillNoD: "",
InputNumber: "",
FQty: "",
ICmo: "",
FModel: "",
FBoxNumber: 1,
listBoxStyle: `height: 58upx; font-size: 16px;`,
listBoxStyleS: `height: 90px; font-size: 15px; width: 90% ; display:flex`,
showinp: true,
//showZtable: true,
//IsTitleName: '',
isFocusK: false,
isFocusw: false,
isFocus: false,
BarcodeText: "",
title: "zTable使用示例",
showUpData: false,
nowType: 0,
nowData: true,
nowColumn: false,
nowHtml: '',
myDebounce: this.debounce(this.setTable),
showLoading: true,
showSelect: true,
selectedList: [],
baseTableData: [],
TempBaseTableData:[],
scannedTableData: [],
totalTableData: [],
//汇总
totalColumns: [{ 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: 100, formatNum: false },
],
//已扫描
scannedColumns: [{ 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: 350, formatNum: false },
{ title: "调出仓库", key: "transferOutStockNumber", width: 350, formatNum: false },
{ title: "调出仓位", key: "transferOutStockPlaceNumber", width: 350, formatNum: false },
{ title: "调入仓库", key: "transferInStockNumber", width: 350, formatNum: false },
{ title: "调入仓位", key: "transferInStockPlaceNumber", width: 350, formatNum: false}],
//源单信息
baseColumns: [{ title: "源单类型", key: "FSourceBillTypeName", width: 350 },
{ title: "源单编号", key: "FSourceBillNo", width: 350 },
{ title: "源单行号", key: "FEntryID", width: 150 },
{ title: "物料代码", key: "FItemNumber", width: 350 },
{ title: "物料名称", key: "FItemName", width: 350 },
{ 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: 100 },
],
barcodeList:[],
boxTempList:[],
commitList:[],
currentBarCodeInfo:new Object(),
billNoDisabled:false,
transferOutFlag:true,
key:1,
billTypeDefaultList: new Array(),
isScanenter:false,
outLocationCheckFlag:false,
inStockStatusList:[],
outStockStatusList:[],
dialogNoticeContent:'',
dialogNoticeTitle:'',
dialogNoticeType:'',
showDialog:false,
dialogShow:false,
dialogTitle:'',
dialogContent:'',
dialogType:'',
dialogParams:new Object,
stockStatus:true,
callOutOrgArrayId:'',
callOutOrgArrayName:'',
callOutOwnerArrayId:'',
callOutOwnerArrayName:'',
callOutOwnerArrayDisabled:true,
callInOrgArrayDisabled:true,
callInOwnerArrayId:'',
callInOwnerArrayName:'',
callInOwnerArrayDisabled:true,
transferTypeArray:[{id:0, value:'组织内调拨'}, {id:1, value:'跨组织调拨'},],
transferTypeArrayName:'组织内调拨',
transferTypeArrayId:0,
}
},
beforeMount() {
_self = this;
_self.dbAlise = uni.getStorageSync("dbAlise");
_self.userName = uni.getStorageSync("userName");
_self.getOrgList();
//当前时间
let date = new Date();
this.curDate = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
this.creatlist[0].detail = this.curDate;
_self.$forceUpdate();
if (this.stockStatus) {
_self.getStockStatus();
}
},
mounted() {
this.judgeCash();
},
props: {
currentTranType: {
type: [String, Number],
}
},
components: {
zTable,
uniTag,
xflSelect,
uniPopupDialog,
DateTimePicker,
opsoftDialogNotice,
opsoftDialog
},
watch: {
nowType: {
handler() {
this.nowData = false
this.nowColumn = false
this.myDebounce()
this.billTypeList
},
immediate: true
},
},
computed: {
indicatorStyle() {
return {
background: 'rgba(255,0,0,.2)',
height: '40px',
};
},
barcodeRule(){
console.log(this.sysParameters);
if(this.sysParameters) {
if(this.sysParameters.hasOwnProperty("BarcodeRuleForVerification")) {
let rule = this.sysParameters["BarcodeRuleForVerification"];
if (rule) {
return rule;
}
}
}
return "";
},
...mapState(['userInfo', "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=='judgeCash'){
this.loadByCash();
}
if(this.dialogType=='del'){
let delList = _self.scannedTableData.filter(
function(el, index){
return _self.selectedList.includes(index);
}
);
_self.scannedTableData = _self.scannedTableData.filter(
function(el,index){
return !_self.selectedList.includes(index)
}
);
_self.barcodeList = _self.barcodeList.filter(
function(el,index){
return !_self.selectedList.includes(index)
}
);
_self.commitList = _self.commitList.filter(
function(el,index){
return !_self.selectedList.includes(index)
}
);
let billInfoScan = [];
let billInfoBase = [];
_self.scannedTableData.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 == 1){
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.scannedTableData.filter(
function(el,index){
return el.FBoxNumber == FBoxNumber;
}
);
_self.scannedTableData = _self.scannedTableData.filter(
function(el,index){
return el.FBoxNumber != FBoxNumber;
}
);
tempBoxData.forEach(
function(boxBarcodeEl){
_self.barcodeList = _self.barcodeList.filter(
function(barcodeEl){
return barcodeEl != boxBarcodeEl.FBarcodeNumber;
}
);
}
);
_self.commitList = _self.commitList.filter(
function(commitEl){
return commitEl.FNumber != el.FBarcodeNumber;
}
);
_self.barcodeList = _self.barcodeList.filter(
function(barcodeEl){
return barcodeEl != el.FBarcodeNumber;
}
);
}
}
);
_self.selectedList = new Array();
_self.Calculate();
uni.showToast({
icon: 'none',
title: '删除成功'
});
this.showResult = true;
if(_self.scannedTableData.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 currentScanType = e;
uni.scanCode({
success:function(res) {
if (currentScanType == 'sourceBillScan') {
_self.currentBarCodeInfo.FSourceBillNo = res.result;
_self.key = _self.key+1;
_self.SelQuery();
}
else if (currentScanType == 'barCodeScan') {
_self.currentBarCodeInfo.FBarcodeNumber = res.result;
_self.key = _self.key+1;
_self.barcodeInfoConfirm();
}
else if (currentScanType == "outStockScan") {
_self.currentBarCodeInfo.transferOutLocation = res.result;
_self.key = _self.key+1;
_self.transferOutLocationConfirm();
}
else if (currentScanType == "outStockStorScan") {
_self.currentBarCodeInfo.outFSCStockNumber = res.result;
_self.key = _self.key+1;
_self.outFSCStockNumberConfirm();
}
else if (currentScanType == "outStockPlaceScan") {
_self.currentBarCodeInfo.outFSCSPNumber = res.result;
_self.key = _self.key+1;
_self.outFSCSPNumberConfirm();
}
else if (currentScanType == "inStockScan") {
_self.currentBarCodeInfo.transferInLocation = res.result;
_self.key = _self.key+1;
_self.transferInLocationConfirm();
}
else if (currentScanType == "inStockStorScan") {
_self.currentBarCodeInfo.inFSCStockNumber = res.result;
_self.key = _self.key+1;
_self.inFSCStockNumberConfirm();
}
else if (currentScanType == "inStockPlaceScan") {
_self.currentBarCodeInfo.inFSCSPNumber = res.result;
_self.key = _self.key+1;
_self.inFSCSPNumberConfirm();
}
}
});
},
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.scannedTableData = cashValue.scannedTableData;
this.barcodeList = cashValue.barcodeList;
this.commitList = cashValue.commitList;
this.baseTableData = cashValue.baseTableData;
this.currentBarCodeInfo.FSourceBillTypeName = cashValue.otherInfo.FSourceBillTypeName;
this.currentBarCodeInfo.FSourceBillNo = cashValue.otherInfo.FSourceBillNo;
this.currentBarCodeInfo.transferOutLocation = cashValue.otherInfo.transferOutLocation;
this.currentBarCodeInfo.outFSCStockNumber = cashValue.otherInfo.outFSCStockNumber;
this.currentBarCodeInfo.outFSCSPNumber = cashValue.otherInfo.outFSCSPNumber;
this.currentBarCodeInfo.transferInLocation = cashValue.otherInfo.transferInLocation;
this.currentBarCodeInfo.inFSCStockNumber = cashValue.otherInfo.inFSCStockNumber;
this.currentBarCodeInfo.inFSCSPNumber = cashValue.otherInfo.inFSCSPNumber;
this.storageoutFSCStockNumber = cashValue.otherInfo.outFSCStockNumber;
this.storageoutFSCSPNumber = cashValue.otherInfo.outFSCSPNumber;
this.storageinFSCStockNumber = cashValue.otherInfo.inFSCStockNumber;
this.storageinFSCSPNumber = cashValue.otherInfo.inFSCSPNumber;
this.storageLocation = cashValue.otherInfo.transferOutLocation;
this.storagetransferInLocation = cashValue.otherInfo.transferInLocation;
this.RowNo = cashValue.otherInfo.RowNo;
this.issum = cashValue.otherInfo.issum;
this.FDEPTID = cashValue.otherInfo.FDEPTID;
this.FCUSTID = cashValue.otherInfo.FCUSTID;
this.FSUPPLYID = cashValue.otherInfo.FSUPPLYID;
this.transferTypeArrayId = cashValue.otherInfo.transferTypeArrayId;
this.transferTypeArrayName = cashValue.otherInfo.transferTypeArrayName;
this.callInOrgArrayDisabled = this.transferTypeArrayId=== 0;
this.callInOwnerArrayDisabled = this.transferTypeArrayId=== 0;
this.callOutOwnerArrayDisabled = this.transferTypeArrayId=== 0;
if (this.$refs.transferTypeArray) {
this.$refs.transferTypeArray.selectText = this.transferTypeArrayName;
}
this.callOutOrgArrayId = cashValue.otherInfo.callOutOrgArrayId;
this.callOutOrgArrayName = cashValue.otherInfo.callOutOrgArrayName;
if (this.$refs.callOutOrgArray) {
this.$refs.callOutOrgArray.selectText = this.callOutOrgArrayName;
}
this.callOutOwnerArrayName = cashValue.otherInfo.callOutOwnerArrayName;
this.callOutOwnerArrayId = cashValue.otherInfo.callOutOwnerArrayId;
if (this.$refs.callOutOwnerArray) {
this.$refs.callOutOwnerArray.selectText = this.callOutOwnerArrayName;
}
this.InOrgID = cashValue.otherInfo.InOrgID;
this.inOrgArryName = cashValue.otherInfo.inOrgArryName;
if (this.$refs.orgArry) {
this.$refs.orgArry.selectText = this.inOrgArryName;
}
this.callInOwnerArrayName = cashValue.otherInfo.callInOwnerArrayName;
this.callInOwnerArrayId = cashValue.otherInfo.callInOwnerArrayId;
if (this.$refs.callInOwnerArray) {
this.$refs.callInOwnerArray.selectText = this.callInOwnerArrayName;
}
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.Calculate();
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.map(function(el){ el.value = el.FSRCNAME? el.FSRCNAME:'null' })
billTypes.forEach(
function(el){
el.value = el.FSRCNAME? el.FSRCNAME:'null';
if(cashValue.otherInfo.FSourceBillTypeName == el.value) {
_self.billTypeSelectText = el.value;
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.isshowcolor = true;
_self.billNoDisabled = true;
if(_self.currentBarCodeInfo.fIsOpenSource) {
_self.billNoDisabled = false;
_self.isshowcolor = false;
}
_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.FBarcodeNumber = "";
_self.currentBarCodeInfo.FSourceBillNo = "";
_self.barcodeQtyDisabled = true;
_self.currentBarCodeInfo.FItemNumber = "";
_self.currentBarCodeInfo.FItemName = "";
_self.currentBarCodeInfo.FModel = "";
_self.currentBarCodeInfo.FAuxPropName = "";
_self.currentBarCodeInfo.FQty = "";
_self.currentBarCodeInfo.fBoxQty = "";
_self.currentBarCodeInfo.transferOutLocation = "";
_self.currentBarCodeInfo.transferInLocation = "";
_self.currentBarCodeInfo.outFSCStockNumber = "";
_self.currentBarCodeInfo.outFSCSPNumber = "";
_self.currentBarCodeInfo.inFSCStockNumber = "";
_self.currentBarCodeInfo.inFSCSPNumber = "";
if (defaulBillTypeFlag) {
if(_self.currentBarCodeInfo.fIsOpenSource && _self.currentBarCodeInfo.FSourceTranType != "0") {
_self.showFsoursS();
defaulBillTypeFlag = false;
}else{
_self.showStarCous();
defaulBillTypeFlag = false;
}
}
}
});
_self.billTypeDefaultList = billTypes;
_self.billTypeList = billTypes;
_self.$forceUpdate();
}
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
getSourceBillTypeInfo:function(){
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.map(function(el){ el.value = el.FSRCNAME? el.FSRCNAME:'null' });
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.billTypeSelectText = billTemp.value;
if (_self.$refs.billTypeList) {
_self.$refs.billTypeList.selectText = _self.billTypeSelectText;
}
// console.log("---"+_self.billTypeListState);
_self.currentBarCodeInfo = new Object();
_self.currentBarCodeInfo.FSourceTranType = billTemp.FSRCFORMID;
_self.FSourceTranType = billTemp.FSRCFORMID;
_self.currentBarCodeInfo.fIsOpenSource = billTemp.FISOPENSOURCE;
_self.isshowcolor = true;
_self.billNoDisabled = true;
if (_self.currentBarCodeInfo.fIsOpenSource) {
_self.billNoDisabled = false;
_self.isshowcolor = false;
}
_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.FBarcodeNumber = "";
_self.currentBarCodeInfo.FSourceBillNo = "";
_self.barcodeQtyDisabled = true;
_self.currentBarCodeInfo.FItemNumber = "";
_self.currentBarCodeInfo.FItemName = "";
_self.currentBarCodeInfo.FModel = "";
_self.currentBarCodeInfo.FAuxPropName = "";
_self.currentBarCodeInfo.FQty = "";
_self.currentBarCodeInfo.fBoxQty = "";
_self.currentBarCodeInfo.transferOutLocation = "";
_self.currentBarCodeInfo.transferInLocation = "";
_self.currentBarCodeInfo.outFSCStockNumber = "";
_self.currentBarCodeInfo.outFSCSPNumber = "";
_self.currentBarCodeInfo.inFSCStockNumber = "";
_self.currentBarCodeInfo.inFSCSPNumber = "";
if (defaulBillTypeFlag) {
if (_self.currentBarCodeInfo.fIsOpenSource && _self.currentBarCodeInfo.FSourceTranType != "0") {
_self.showFsoursS();
defaulBillTypeFlag = false;
}
else {
_self.showStarCous();
defaulBillTypeFlag = false;
}
}
}
}
_self.billTypeDefaultList = billTypes;
_self.billTypeList = billTypes;
_self.$forceUpdate();
// _self.billTypeSelectText = '请选择';
}
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
getStockStatus:function() {
let requestParams = {"orgID":this.orgFItemID}
this.$request.post('/SelBill/QueryStockStatus',requestParams).then(res => {
res.forEach(e => { e.value = e.FNAME; });
this.outStockStatusList = res.filter(function(item){ return true; });
if (!this.outStockStatusList) {
this.outStockStatusList = [];
}
this.inStockStatusList = res.filter(function(item){ return true; });
if (!this.inStockStatusList) {
this.inStockStatusList = [];
}
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps('获取库存状态失败','error')
});
},
ShowRowNO:function(){
if(this.FSourceTranType == 85 || this.FSourceTranType == 1007105){
this.isShowRowNO = true;
}
},
//即时库存
timeStock:function(){
this.stockNav = true;
let item = {
"barCode": this.currentBarCodeInfo.FBarcodeNumber?this.currentBarCodeInfo.FBarcodeNumber:"",
"FItemNumber": this.currentBarCodeInfo.FItemNumber?this.currentBarCodeInfo.FItemNumber:"",
"FItemName": this.currentBarCodeInfo.FItemName?this.currentBarCodeInfo.FItemName:"",
"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,
"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.FMOBILLNO?sel.FMOBILLNO:'',
"FSRCBILLNO": sel.FSRCBILLNO?sel.FSRCBILLNO:'',
"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) {
_self.baseTableData.push(el);
}
}
);
this.CalculateBase();
done();
},
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:''
});
});
},
hideErrTips:function(){
this.showErrTips = false;
this.errDetailsList = [];
this.errDetails = [];
},
qtyConfirm:function(){
let _self = this;
let nextFlag = commonUtil.judgeFloat(this.currentBarCodeInfo.FQty);
if (!this.currentBarCodeInfo.FQty) {
uni.showToast({
title:"请输入正确的数量值",
duration: 3500,
icon:"none"
});
return false;
}
if (nextFlag) {
if (_self.isShowStock) {
_self.showTransferOutLocation();
}
else {
_self.showOutFSCStock();
}
}
},
//组织变更后获取部门、供应商、客户信息
getDeptInfo:function(){
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(){
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;
console.log(_self.customerInfosChanged)
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
getSupplierInfo:function(){
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;
console.log(_self.supplierInfosChanged)
}).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;
this.InOrgID = orgInfo[0].FINTERID;
this.inOrgArryName = orgInfo[0].FNAME;
this.callOutOrgArrayName = this.inOrgArryName;
this.callOutOrgArrayId = this.InOrgID;
this.callOutOwnerArrayName = this.inOrgArryName;
this.callOutOwnerArrayId = this.InOrgID;
this.callInOwnerArrayName = this.inOrgArryName;
this.callInOwnerArrayId = this.InOrgID;
} else {
if (defaultOrgInfo) {
this.orgFItemID = defaultOrgInfo.FINTERID;
this.InOrgID = defaultOrgInfo.FINTERID;
this.inOrgArryName = defaultOrgInfo.FNAME;
this.callOutOrgArrayName = this.inOrgArryName;
this.callOutOrgArrayId = this.InOrgID;
this.callOutOwnerArrayName = this.inOrgArryName;
this.callOutOwnerArrayId = this.InOrgID;
this.callInOwnerArrayName = this.inOrgArryName;
this.callInOwnerArrayId = this.InOrgID;
} else {
this.orgFItemID = orgInfo[0].FINTERID;
this.InOrgID = orgInfo[0].FINTERID;
this.inOrgArryName = orgInfo[0].FNAME;
this.callOutOrgArrayName = this.inOrgArryName;
this.callOutOrgArrayId = this.InOrgID;
this.callOutOwnerArrayName = this.inOrgArryName;
this.callOutOwnerArrayId = this.InOrgID;
this.callInOwnerArrayName = this.inOrgArryName;
this.callInOwnerArrayId = this.InOrgID;
}
}
this.orgArry = orgInfo;
this.orgArry.forEach(
function(el,index){
el.value = el.FNAME;
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();
} 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;
this.callOutOrgArrayId = this.orgArry[this.index].FINTERID;
this.callOutOrgArrayName = this.orgArry[this.index].FNAME;
console.log('this.callOutOrgArrayName', this.callOutOrgArrayName, this.orgArry[this.index])
if (isOpenDefaultOrg) {
uni.setStorageSync('defaultOrgInfo',this.orgArry[this.index]);
}
}
if (!this.transferTypeArrayId) {
this.inOrgArryName = this.callOutOrgArrayName;
this.InOrgID = this.callOutOrgArrayId;
if (this.$refs.orgArry) {
this.$refs.orgArry.selectText = this.callOutOrgArrayName;
}
this.callOutOwnerArrayName = this.callOutOrgArrayName;
this.callOutOwnerArrayId = this.callOutOrgArrayId;
if (this.$refs.callOutOwnerArray) {
this.$refs.callOutOwnerArray.selectText = this.callOutOrgArrayName;
}
this.callInOwnerArrayName = this.callOutOrgArrayName;
this.callInOwnerArrayId = this.callOutOrgArrayId;
if (this.$refs.callInOwnerArray) {
this.$refs.callInOwnerArray.selectText = this.callOutOrgArrayName;
}
}
if (this.$refs.callOutOrgArray) {
this.$refs.callOutOrgArray.selectText = this.callOutOrgArrayName;
}
this.$forceUpdate();
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();
}
},
showOrg:function(){},
orgChangedClear:function(){
if(this.$refs.billTypeList){
this.$refs.billTypeList.selectText = "";
}
this.currentBarCodeInfo = new Object();
this.currentBarCodeInfo.FSourceBillNo = "";
this.currentBarCodeInfo.FBarcodeNumber = "";
this.currentBarCodeInfo.transferOutLocation = "";
this.currentBarCodeInfo.outFSCStockNumber = "";
this.currentBarCodeInfo.outFSCSPNumber = "";
this.currentBarCodeInfo.transferInLocation = "";
this.currentBarCodeInfo.inFSCStockNumber = "";
this.currentBarCodeInfo.inFSCSPNumber = "";
this.currentBarCodeInfo.FQty = "";
this.currentBarCodeInfo.FItemNumber = "";
this.currentBarCodeInfo.FItemName = "";
this.currentBarCodeInfo.FModel = "";
this.currentBarCodeInfo.FAuxPropName = "";
this.showResult = true;
this.issum = true;
this.baseTableData = [];
this.scannedTableData = [];
this.totalTableData = [];
this.barcodeList = [];
this.commitList = [];
this.key = this.key + 1;
this.$forceUpdate();
},
//源单信息调用获取
SelQuery: function() {
//debuggerger
this.barcodecous = false;
this.$nextTick(function(){
this.barcodecous = true;
this.Fsours = false;
this.QtyFocus = false;
this.transferOutLocationFocus = false;
this.outFSCStockNumberFocus = false;
this.outFSCSPNumberFocus = false;
this.transferInLocationFocus = false;
this.inFSCStockNumberFocus = false;
this.inFSCSPNumberFocus = false;
})
console.log("YDLX"+this.currentBarCodeInfo.FSourceBillTypeName);
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();
let result = false;
if(this.baseTableData.length>0){
this.baseTableData.forEach(
function(el){
if(el.FSourceBillNo == _self.currentBarCodeInfo.FSourceBillNo){
return result = true;
}
}
);
}
if(result){
return false;
}
let isHaveSource = true;
if(!this.currentBarCodeInfo.FSourceTranType){
isHaveSource = false;
}
//待添加逻辑
let isExit = 0;
let requestParams = {
"sourceBillNO": this.currentBarCodeInfo.FSourceBillNo,
"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 _self = this;
let data = res;
_self.currentBarCodeInfo.sourceInfo = data;
_self.sourceBillTempList.splice(0, _self.sourceBillTempList.length);
data[0].forEach(
function(el){
let isPush = true;
let basePushItem = {
"FSourceBillTypeName": _self.currentBarCodeInfo.FSourceBillTypeName,
"FSourceBillNo": _self.currentBarCodeInfo.FSourceBillNo,
// "FEntryID": _self.isShowBillRowNo ? el.FICMOEntryID : el.FEntryID,
"FEntryID": el.FSRCENTRYID,
"FItemNumber": el.FITEMNUMBER,
"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,
"PPBOMFBillNo": el.FMOBILLNO,
"FICMOEntryID": el.FMOID,
"FSupplyName":el.FSUPPLYNAME,
"FDeptName":el.FDEPTNAME,
"FCustName":el.FCUSTNAME,
"FMOENTRYID":el.FMOENTRYID?el.FMOENTRYID:0,
"comb":_self.currentBarCodeInfo.FSourceBillNo + el.FITEMNUMBER,
}
_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.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;
item.FMOENTRYID = basePushItem.FMOENTRYID;
isPush = false;
}
}
);
if(isPush){
_self.baseTableData.push(basePushItem);
}
let tempPushItem = {
"FSourceBillTypeName": _self.currentBarCodeInfo.FSourceBillTypeName,
"FSourceBillNo": _self.currentBarCodeInfo.FSourceBillNo,
// "FEntryID": _self.isShowBillRowNo ? el.FICMOEntryID : el.FEntryID,
"FEntryID": el.FSRCENTRYID,
"FItemNumber": el.FITEMNUMBER,
"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,
"PPBOMFBillNo": el.FMOBILLNO,
"FICMOEntryID": el.FMOID,
"FSupplyName":el.FSUPPLYNAME,
"FDeptName":el.FDEPTNAME,
"FCustName":el.FCUSTNAME,
"comb":_self.currentBarCodeInfo.FSourceBillNo + el.FITEMNUMBER,
"FMOENTRYID":el.FMOENTRYID?el.FMOENTRYID:0,
}
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;
}
}
);
}
//记录源单数量信息
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);
}
);
_self.RowNo = "";
console.log(_self.baseTableData);
this.saveCash();
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
sets: function() {
let _self = this;
_self.FMatNumber = ''
_self.FMatName = ''
_self.FModel = ''
//_self.ICmo = ''
_self.InputNumber = ''
_self.BarcodeText = ''
_self.FQty = ''
_self.FTranName = ''
_self.FAuxPropName = ''
//_self.FSourceBillNo = ''
this.showStarCousM();
},
//源单类选择进入源单框
showFsoursS: function() {
let _self = this;
_self.Fsours = false;
_self.barcodecous = false;
_self.QtyFocus = false;
_self.outFSCStockNumberFocus = false;
_self.outFSCSPNumberFocus = false;
_self.transferInLocationFocus = false;
_self.inFSCStockNumberFocus = false;
_self.inFSCSPNumberFocus = false;
_self.transferOutLocationFocus = false;
setTimeout(
function() {
_self.$nextTick(
function(){
_self.Fsours = true;
}
);
},
400
);
},
//加载第一光标条码
showStarCous: function() {
let _self = this;
_self.Fsours = false;
_self.barcodecous = false;
_self.QtyFocus = false;
_self.outFSCStockNumberFocus = false;
_self.outFSCSPNumberFocus = false;
_self.transferInLocationFocus = false;
_self.inFSCStockNumberFocus = false;
_self.inFSCSPNumberFocus = false;
_self.transferOutLocationFocus = false;
setTimeout(
function() {
_self.$nextTick(
function(){
_self.barcodecous = true;
}
);
},
400
);
},
//光标恢复
showStarCousM: function() {
let _self = this;
setTimeout(function() {
_self.Fsours = false;
_self.barcodecous = false;
_self.QtyFocus = false;
_self.outFSCStockNumberFocus = false;
_self.outFSCSPNumberFocus = false;
_self.transferInLocationFocus = false;
_self.inFSCStockNumberFocus = false;
_self.inFSCSPNumberFocus = false;
_self.transferOutLocationFocus = false;
}, 500);
},
showTransferOutLocation:function(){
let _self = this;
_self.Fsours = false;
_self.barcodecous = false;
_self.QtyFocus = false;
_self.outFSCStockNumberFocus = false;
_self.outFSCSPNumberFocus = false;
_self.transferInLocationFocus = false;
_self.inFSCStockNumberFocus = false;
_self.inFSCSPNumberFocus = false;
_self.transferOutLocationFocus = false;
if (_self.currentBarCodeInfo.transferOutLocation) {
_self.transferOutLocationConfirm();
}
setTimeout(
function() {
_self.$nextTick(
function(){
_self.transferOutLocationFocus = true;
if(_self.isScanenter && _self.currentBarCodeInfo.transferOutLocation) {
_self.transferOutLocationConfirm();
}
}
);
},
400
);
},
showTransferInLocation:function(){
let _self = this;
_self.Fsours = false;
_self.barcodecous = false;
_self.QtyFocus = false;
_self.outFSCStockNumberFocus = false;
_self.outFSCSPNumberFocus = false;
_self.transferInLocationFocus = false;
_self.inFSCStockNumberFocus = false;
_self.inFSCSPNumberFocus = false;
_self.transferOutLocationFocus = false;
setTimeout(
function() {
_self.$nextTick(
function(){
_self.transferInLocationFocus = true;
if(_self.isScanenter && _self.currentBarCodeInfo.transferInLocation) {
_self.transferInLocationConfirm();
}
}
);
},
400
);
},
showQty:function(){
let _self = this;
_self.Fsours = false;
_self.barcodecous = false;
_self.QtyFocus = false;
_self.outFSCStockNumberFocus = false;
_self.outFSCSPNumberFocus = false;
_self.transferInLocationFocus = false;
_self.inFSCStockNumberFocus = false;
_self.inFSCSPNumberFocus = false;
_self.transferOutLocationFocus = false;
setTimeout(
function() {
_self.$nextTick(
function(){
_self.QtyFocus = true;
if(_self.isScanenter && _self.currentBarCodeInfo.FQty) {
_self.qtyConfirm();
}
}
);
},
400
);
},
showOutFSCStock:function(){
let _self = this;
_self.Fsours = false;
_self.barcodecous = false;
_self.QtyFocus = false;
_self.outFSCStockNumberFocus = false;
_self.outFSCSPNumberFocus = false;
_self.transferInLocationFocus = false;
_self.inFSCStockNumberFocus = false;
_self.inFSCSPNumberFocus = false;
_self.transferOutLocationFocus = false;
setTimeout(
function() {
_self.$nextTick(
function(){
_self.outFSCStockNumberFocus = true;
if(_self.isScanenter && _self.currentBarCodeInfo.outFSCStockNumber) {
_self.outFSCStockNumberConfirm();
}
}
);
},
400
);
},
showOutFSCSP:function(){
let _self = this;
_self.Fsours = false;
_self.barcodecous = false;
_self.QtyFocus = false;
_self.outFSCStockNumberFocus = false;
_self.outFSCSPNumberFocus = false;
_self.transferInLocationFocus = false;
_self.inFSCStockNumberFocus = false;
_self.inFSCSPNumberFocus = false;
_self.transferOutLocationFocus = false;
setTimeout(
function() {
_self.$nextTick(
function(){
_self.outFSCSPNumberFocus = true;
if(_self.isScanenter && _self.currentBarCodeInfo.outFSCSPNumber) {
_self.outFSCSPNumberConfirm();
}
}
);
},
400
);
},
showInFSCStock:function(){
let _self = this;
_self.Fsours = false;
_self.barcodecous = false;
_self.QtyFocus = false;
_self.outFSCStockNumberFocus = false;
_self.outFSCSPNumberFocus = false;
_self.transferInLocationFocus = false;
_self.inFSCStockNumberFocus = false;
_self.inFSCSPNumberFocus = false;
_self.transferOutLocationFocus = false;
setTimeout(
function() {
_self.$nextTick(
function(){
_self.inFSCStockNumberFocus = true;
if(_self.isScanenter && _self.currentBarCodeInfo.inFSCStockNumber) {
_self.inFSCStockNumberConfirm();
}
}
);
},
400
);
},
showInFSCSP:function(){
let _self = this;
_self.Fsours = false;
_self.barcodecous = false;
_self.QtyFocus = false;
_self.outFSCStockNumberFocus = false;
_self.outFSCSPNumberFocus = false;
_self.transferInLocationFocus = false;
_self.inFSCStockNumberFocus = false;
_self.inFSCSPNumberFocus = false;
_self.transferOutLocationFocus = false;
setTimeout(
function() {
_self.$nextTick(
function(){
_self.inFSCSPNumberFocus = true;
if(_self.isScanenter && _self.currentBarCodeInfo.inFSCSPNumber) {
_self.inFSCSPNumberConfirm();
}
}
);
},
400
);
},
//调出获取仓库信息
transferOutLocationConfirm: function() {
if(!this.currentBarCodeInfo.FBarcodeNumber) {
uni.showToast({
title: "请先扫描条码",
icon: "none",
duration: 3000,
});
return;
}
if(!this.currentBarCodeInfo.transferOutLocation){
uni.showToast({
icon: "none",
title: "请输入调出位置",
duration: 3500,
})
return false;
}
let requestParams = {
// "id": userID,
"tranType": this.currentTranType,
"stockData": this.currentBarCodeInfo.transferOutLocation,
"sourceTranType": this.FSourceTranType,
"sourceBillNO": this.currentBarCodeInfo.FSourceBillNo,
// "icmoEntryID": 0,
"orgID":this.orgFItemID
};
uni.showLoading({
icon:'loading',
title:'加载中……',
mask:true
});
this.$request.post('/SelBill/QueryStockData',requestParams).then(res => {
uni.hideLoading();
this.outLocationCheckFlag = false;
this.transferOutFlag = true;
let data = res;
let location = data;
this.currentBarCodeInfo.transferOutStockID = location.FSTOCKID;
this.currentBarCodeInfo.transferOutStockNumber = location.FSTOCKNUMBER;
this.currentBarCodeInfo.transferOutStockPlaceID = location.FSTOCKLOCID;
this.currentBarCodeInfo.transferOutStockPlaceNumber = location.FSTOCKLOCNUMBER;
this.currentBarCodeInfo.outTypeFStockID = location.FSTOCKID;
this.currentBarCodeInfo.outTypeFStockPlaceID = location.FSTOCKLOCID;
this.storageLocation = this.currentBarCodeInfo.transferOutLocation;
if (this.stockStatus) {
let outStockStatusSelect = false;
data.FSTOCKSTATUSALL.forEach(
function(item){
if (item.FNO == _self.currentBarCodeInfo.OUTSTOCKSTATUSID) {
outStockStatusSelect = true;
}
}
);
if (!outStockStatusSelect) {
let statusList = "";
data.FSTOCKSTATUSALL.forEach(e => {
statusList = statusList + e.FNAME + ' ';
});
let tips = "调出状态未选择!";
if (_self.currentBarCodeInfo.OUTSTOCKSTATUSNAME) {
let tips = "调出状态["+ _self.currentBarCodeInfo.OUTSTOCKSTATUSNAME
+ "]与调出仓库[" + statusList + "]不符";
}
this.dialogNoticeProps(tips,'error')
return false;
}
}
if(this.isShowStock) {
this.showTransferInLocation();
}
else {
this.showOutFSCStock();
}
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
outFSCStockNumberConfirm:function(){
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 requestParams = {
"stockNumber":this.currentBarCodeInfo.outFSCStockNumber,
"orgid":this.orgFItemID,
};
uni.showLoading({
icon:'loading',
title:'加载中……',
mask:true
});
this.$request.get('/SysConfigData/SearchStock',{
params:requestParams
}).then(res => {
uni.hideLoading();
this.transferOutFlagA = true;
let data = res;
this.currentBarCodeInfo.outTypeFStockID = data.FINTERID;
this.FIsStockMgr = data.FIsStockMgr?data.FIsStockMgr:'';
this.outFSCStockFIsStockMgr = data.FIsStockMgr?data.FIsStockMgr:'';
uni.showToast({
icon: 'none',
title: "调出仓库录入成功"
});
this.storageoutFSCStockNumber = this.currentBarCodeInfo.outFSCStockNumber;
this.currentBarCodeInfo.transferOutLocation = this.currentBarCodeInfo.outFSCStockNumber;
if (this.FIsStockMgr) {
this.outStockDisable = false;
this.showOutFSCSP();
}
else {
this.outStockDisable = true;
this.currentBarCodeInfo.outFSCSPNumber = "";
this.currentBarCodeInfo.transferOutLocation = this.currentBarCodeInfo.outFSCStockNumber;
this.showInFSCStock();
}
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
outFSCSPNumberConfirm:function(){
if(this.FIsStockMgr){
if(!this.currentBarCodeInfo.outFSCSPNumber) {
uni.showToast({
title: "请录入调出仓位编号",
icon: "none",
duration: 3000,
});
return;
}
}
if(!this.currentBarCodeInfo.FBarcodeNumber) {
uni.showToast({
title: "请先扫描条码",
icon: "none",
duration: 3000,
});
return;
}
let requestParams = {
"stockNumber":this.currentBarCodeInfo.outFSCStockNumber,
"orgid":this.orgFItemID
};
uni.showLoading({
icon:'loading',
title:'加载中……',
mask:true
});
this.$request.get('/SysConfigData/SearchStockPlace',{
params:requestParams
}).then(res => {
uni.hideLoading();
this.transferOutFlagB = true;
let data = res;
this.currentBarCodeInfo.outTypeFStockPlaceID = data.FSTOCKINTERID
uni.showToast({
icon: 'none',
title: "调出仓位录入成功"
});
this.storageoutFSCSPNumber = this.currentBarCodeInfo.outFSCSPNumber;
this.currentBarCodeInfo.transferOutLocation = this.currentBarCodeInfo.outFSCStockNumber +"-"+ this.currentBarCodeInfo.outFSCSPNumber;
this.showInFSCStock();
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
//调入存放位置
transferInLocationConfirm:function() {
if (this.outLocationCheckFlag) {
uni.showToast({
title: '请先在调出位置输入框中回车!',
icon:'none'
});
return;
}
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 currentBarcode = this.currentBarCodeInfo.FBarcodeNumber;
if(this.currentBarCodeInfo.fCType != 3){
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 nextFlag = commonUtil.judgeFloat(this.currentBarCodeInfo.FQty);
if(!this.currentBarCodeInfo.FQty || !nextFlag){
uni.showToast({
title:"请输入正确的数量值",
duration: 3500,
icon:"none"
})
return false;
}
if(!this.transferOutFlag){
uni.showToast({
icon: "none",
title: "请输入正确的调入位置",
duration: 3500,
})
return false;
}
let inOrgJudge = this.InOrgID + this.currentBarCodeInfo.transferInLocation;
let outOrgJudge = this.callOutOrgArrayId + this.currentBarCodeInfo.transferOutLocation;
if(outOrgJudge == inOrgJudge){
uni.showToast({
icon: "none",
title: "调入/调出位置不能相同",
duration: 3500,
});
return false;
}
let requestParams = {
"tranType": this.currentTranType,
"stockData": this.currentBarCodeInfo.transferInLocation,
"sourceTranType": this.FSourceTranType,
"sourceBillNO": this.currentBarCodeInfo.FSourceBillNo,
// "icmoEntryID": 0,
"orgID":this.InOrgID
// "OutstockData":this.currentBarCodeInfo.transferOutLocation
};
uni.showLoading({
icon:'loading',
title:'加载中……',
mask:true
});
this.$request.post('/SelBill/QueryStockData',requestParams).then(res => {
uni.hideLoading();
let _self = this;
let data = res;
_self.currentBarCodeInfo.transferInLocation = data.FLOCATION;
_self.currentBarCodeInfo.transferInStockID = data.FSTOCKID;
_self.currentBarCodeInfo.transferInStockNumber = data.FSTOCKNUMBER;
_self.currentBarCodeInfo.transferInStockPlaceID = data.FSTOCKLOCID;
_self.currentBarCodeInfo.transferInStockPlaceNumber = data.FSTOCKLOCNUMBER;
if (_self.stockStatus) {
if(!data.FSTOCKSTATUSALL){
uni.showToast({
title: '当前扫描仓库库存状态不存在',
icon:'none'
})
return false
}
let inStockStatusSelect = false;
data.FSTOCKSTATUSALL.forEach(
function(item){
if (item.FNO == _self.currentBarCodeInfo.INSTOCKSTATUSID) {
inStockStatusSelect = true;
}
}
);
if (!inStockStatusSelect) {
let statusList = "";
data.FSTOCKSTATUSALL.forEach(e => {
statusList = statusList + e.FNAME + ' ';
});
let tips = "调入状态未选择!";
if (_self.currentBarCodeInfo.INSTOCKSTATUSNAME) {
let tips = "调入状态["+ _self.currentBarCodeInfo.INSTOCKSTATUSNAME
+ "]与调入仓库[" + statusList + "]不符";
}
this.dialogNoticeProps(tips,'error')
return false;
}
}
let sourceBillInfos = [];
if (this.currentBarCodeInfo.FSourceTranType) {
data.FSRCINFO.forEach(e => {
e.FSourceBillTypeName = _self.currentBarCodeInfo.FSourceBillTypeName;
e.FSourceBillNo = _self.currentBarCodeInfo.FSourceBillNo;
// "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.FAUXPROPID ? e.FAUXPROPID :"" ;
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;
if(_self.FIsControlQty){
let batchControl = _self.FISCHECKLOT;
let fKFDateControl = _self.FISCHECKKFDATE;
let propControl = _self.FISCHECKAUX;
if(sourceBillInfos) {
if (sourceBillInfos.length > 0) {
_self.sourceBillTempList = new Array();
sourceBillInfos.forEach(
function (el) {
if(!el.FLOT) {
el.FLOT = "";
}
if(!el.FKFDATE) {
el.FKFDATE = "";
}
if(!el.FAUXPROPID) {
el.FAUXPROPID = "";
}
_self.sourceBillTempList.push(el);
}
);
let checkArry = [
"FSourceBillNo",
"FItemID","FItemName",
batchControl?"FBatchNO":"",
fKFDateControl?"FKFDate":"",
propControl?"FAuxPropName":""];
//已入库数量
let FRelationQtyData = _self.GroupBy(_self.sourceBillTempList,checkArry,(d, v) => {
d = d || 0
let FRelationQty = parseFloat(v.FRELATIONQTY)
return d += FRelationQty;
});
//总数量
let FAuxQtyData = _self.GroupBy(_self.sourceBillTempList,checkArry,(d, v) => {
d = d || 0
let FAuxQty = parseFloat(v.FAUXQTY)
return d += FAuxQty;
});
let checkArry2 = ['FSourceBillNo',"FItemID","FItemName",
batchControl?"FBatchNO":"",
fKFDateControl?"FKFDate":"",
propControl?"FAuxPropName":""];
//已扫描
let FQtyData = _self.GroupBy(_self.scannedTableData,checkArry2,(d, v) => {
d = d || 0
let FQty = parseFloat(v.FQty)
return d += FQty;
});
if(_self.currentBarCodeInfo.fIsBox == 1){
// let errDetailsList = [];
// let errDetails = [];
let checkArry2 = ['FSourceBillNo', "FItemID", "FItemName",
batchControl?"FBatchNO":"",
fKFDateControl?"FKFDate":"",
propControl?"FAuxPropName":""];
//已扫描
let FQtyDataBox = _self.GroupBy(_self.boxTempList,checkArry2,(d, v) => {
d = d || 0
let FQty = parseFloat(v.FQty)
return d += FQty;
});
let boxResult = true;
if(FQtyData.length>0){
FQtyData.forEach(
function(FDel){
FQtyDataBox.forEach(
function(boxel){
let FDQty = 0;
if(FDel.key.FSourceBillNo == boxel.key.FSourceBillNo && FDel.key.FItemID == boxel.key.FItemID){
FDQty = FDel.data;
let myFRelationQtyData = FRelationQtyData.filter(
function(el){
let resultFilter = true;
boxel.key.FKFDate = (new Date(boxel.key.FKFDate)).getTime();
el.key.FKFDate = (new Date(el.key.FKFDate)).getTime();
if(!boxel.key.FKFDate){
boxel.key.FKFDate = "";
}
if(!el.key.FKFDate){
el.key.FKFDate = "";
}
if(_self.currentBarCodeInfo.FSourceTranType == 85 || _self.currentBarCodeInfo.FSourceTranType == 1007105){
if(boxel.key.FSourceBillNo != el.key.FICMOBillno){
resultFilter = false;
}
}else{
if(boxel.key.FSourceBillNo != el.key.FSourceBillNo){
resultFilter = false;
}
}
if(boxel.key.FItemID != el.key.FItemID) {
resultFilter = false;
}
if( boxel.key.FAuxPropName != (el.key.FAuxPropName ? el.key.FAuxPropName : "")
&& propControl) {
resultFilter = false;
}
if( (boxel.key.FBatchNO != el.key.FBatchNO) && batchControl) {
resultFilter = false;
}
if( (boxel.key.FKFDate != el.key.FKFDate) && fKFDateControl) {
resultFilter = false;
}
return resultFilter;
}
);
let myFAuxQtyData = FAuxQtyData.filter(
function(el){
let resultFilter = true;
boxel.key.FKFDate = (new Date(boxel.key.FKFDate)).getTime();
el.key.FKFDate = (new Date(el.key.FKFDate)).getTime();
if(!boxel.key.FKFDate){
boxel.key.FKFDate = "";
}
if(!el.key.FKFDate){
el.key.FKFDate = "";
}
if(_self.currentBarCodeInfo.FSourceTranType == 85 || _self.currentBarCodeInfo.FSourceTranType == 1007105){
if(boxel.key.FSourceBillNo != el.key.FICMOBillno){
resultFilter = false;
}
}else{
if(boxel.key.FSourceBillNo != el.key.FSourceBillNo){
resultFilter = false;
}
}
if(boxel.key.FItemID != el.key.FItemID) {
resultFilter = false;
}
if( boxel.key.FAuxPropName != (el.key.FAuxPropName ? el.key.FAuxPropName : "")
&& propControl) {
resultFilter = false;
}
if( (boxel.key.FBatchNO != el.key.FBatchNO) && batchControl) {
resultFilter = false;
}
if( (boxel.key.FKFDate != el.key.FKFDate) && fKFDateControl) {
resultFilter = false;
}
return resultFilter;
}
);
let myFQtyData = FQtyData.filter(
function(el){
let resultFilter = true;
boxel.key.FKFDate = (new Date(boxel.key.FKFDate)).getTime();
el.key.FKFDate = (new Date(el.key.FKFDate)).getTime();
if(!boxel.key.FKFDate){
boxel.key.FKFDate = "";
}
if(!el.key.FKFDate){
el.key.FKFDate = "";
}
if(boxel.key.FSourceBillNo != el.key.FSourceBillNo){
resultFilter = false;
}
if(boxel.key.FItemID != el.key.FItemID) {
resultFilter = false;
}
if( boxel.key.FAuxPropName != (el.key.FAuxPropName ? el.key.FAuxPropName : "")
&& propControl) {
resultFilter = false;
}
if( (boxel.key.FBatchNO != el.key.FBatchNO) && batchControl) {
resultFilter = false;
}
if( (boxel.key.FKFDate != el.key.FKFDate) && fKFDateControl) {
resultFilter = false;
}
return resultFilter;
}
);
let sumFAuxQty = myFAuxQtyData.length > 0 ? myFAuxQtyData[0].data : 0;
let sumFQtyData = myFQtyData.length > 0 ? myFQtyData[0].data : 0;
let sumFRelationQtyData = myFRelationQtyData.length > 0 ? myFRelationQtyData[0].data : 0;
if(sumFAuxQty - FDQty - sumFQtyData - sumFRelationQtyData - boxel.data < 0){
_self.errDetails = "物料("+boxel.key.FItemName+")本次扫描数量"+boxel.data+"大于源单("+
boxel.key.FSourceBillNo+")应调数量"+FDQty+"-已调数量"+
sumFRelationQtyData+"-已扫描数量"+sumFQtyData;
boxResult = false;
_self.errDetailsList.push(_self.errDetails);
return false;
}
}else{
let myFRelationQtyData = FRelationQtyData.filter(
function(el){
let resultFilter = true;
boxel.key.FKFDate = (new Date(boxel.key.FKFDate)).getTime();
el.key.FKFDate = (new Date(el.key.FKFDate)).getTime();
if(!boxel.key.FKFDate){
boxel.key.FKFDate = "";
}
if(!el.key.FKFDate){
el.key.FKFDate = "";
}
if(_self.currentBarCodeInfo.FSourceTranType == 85 || _self.currentBarCodeInfo.FSourceTranType == 1007105){
if(boxel.key.FSourceBillNo != el.key.FICMOBillno){
resultFilter = false;
}
}else{
if(boxel.key.FSourceBillNo != el.key.FSourceBillNo){
resultFilter = false;
}
}
if(boxel.key.FItemID != el.key.FItemID) {
resultFilter = false;
}
if( boxel.key.FAuxPropName != (el.key.FAuxPropName ? el.key.FAuxPropName : "")
&& propControl) {
resultFilter = false;
}
if( (boxel.key.FBatchNO != el.key.FBatchNO) && batchControl) {
resultFilter = false;
}
if( (boxel.key.FKFDate != el.key.FKFDate) && fKFDateControl) {
resultFilter = false;
}
return resultFilter;
}
);
let myFAuxQtyData = FAuxQtyData.filter(
function(el){
let resultFilter = true;
boxel.key.FKFDate = (new Date(boxel.key.FKFDate)).getTime();
el.key.FKFDate = (new Date(el.key.FKFDate)).getTime();
if(!boxel.key.FKFDate){
boxel.key.FKFDate = "";
}
if(!el.key.FKFDate){
el.key.FKFDate = "";
}
if(_self.currentBarCodeInfo.FSourceTranType == 85 || _self.currentBarCodeInfo.FSourceTranType == 1007105){
if(boxel.key.FSourceBillNo != el.key.FICMOBillno){
resultFilter = false;
}
}else{
if(boxel.key.FSourceBillNo != el.key.FSourceBillNo){
resultFilter = false;
}
}
if(boxel.key.FItemID != el.key.FItemID) {
resultFilter = false;
}
if( boxel.key.FAuxPropName != (el.key.FAuxPropName ? el.key.FAuxPropName : "")
&& propControl) {
resultFilter = false;
}
if( (boxel.key.FBatchNO != el.key.FBatchNO) && batchControl) {
resultFilter = false;
}
if( (boxel.key.FKFDate != el.key.FKFDate) && fKFDateControl) {
resultFilter = false;
}
return resultFilter;
}
);
let myFQtyData = FQtyData.filter(
function(el){
let resultFilter = true;
boxel.key.FKFDate = (new Date(boxel.key.FKFDate)).getTime();
el.key.FKFDate = (new Date(el.key.FKFDate)).getTime();
if(!boxel.key.FKFDate){
boxel.key.FKFDate = "";
}
if(!el.key.FKFDate){
el.key.FKFDate = "";
}
if(boxel.key.FSourceBillNo != el.key.FSourceBillNo){
resultFilter = false;
}
if(boxel.key.FItemID != el.key.FItemID) {
resultFilter = false;
}
if( boxel.key.FAuxPropName != (el.key.FAuxPropName ? el.key.FAuxPropName : "")
&& propControl) {
resultFilter = false;
}
if( (boxel.key.FBatchNO != el.key.FBatchNO) && batchControl) {
resultFilter = false;
}
if( (boxel.key.FKFDate != el.key.FKFDate) && fKFDateControl) {
resultFilter = false;
}
return resultFilter;
}
);
let sumFAuxQty = myFAuxQtyData.length > 0 ? myFAuxQtyData[0].data : 0;
let sumFQtyData = myFQtyData.length > 0 ? myFQtyData[0].data : 0;
let sumFRelationQtyData = myFRelationQtyData.length > 0 ? myFRelationQtyData[0].data : 0;
if(sumFAuxQty - FDQty - sumFQtyData - sumFRelationQtyData - boxel.data < 0){
_self.errDetails = "物料("+boxel.key.FItemName+")本次扫描数量"+boxel.data+"大于源单("+
boxel.key.FSourceBillNo+")应调数量"+FDQty+"-已调数量"+
sumFRelationQtyData+"-已扫描数量"+sumFQtyData;
boxResult = false;
_self.errDetailsList.push(_self.errDetails);
return false;
}
}
}
);
}
);
}else{
// FQtyData.forEach(
// function(FDel){
FQtyDataBox.forEach(
function(boxel){
let FDQty = 0;
// if(FDel.key.FSourceBillNo == boxel.key.FSourceBillNo && FDel.key.FItemID == boxel.key.FItemID){
// FDQty = FDel.data;
let myFRelationQtyData = FRelationQtyData.filter(
function(el){
let resultFilter = true;
boxel.key.FKFDate = (new Date(boxel.key.FKFDate)).getTime();
el.key.FKFDate = (new Date(el.key.FKFDate)).getTime();
if(!boxel.key.FKFDate){
boxel.key.FKFDate = "";
}
if(!el.key.FKFDate){
el.key.FKFDate = "";
}
if(_self.currentBarCodeInfo.FSourceTranType == 85 || _self.currentBarCodeInfo.FSourceTranType == 1007105){
if(boxel.key.FSourceBillNo != el.key.FICMOBillno){
resultFilter = false;
}
}else{
if(boxel.key.FSourceBillNo != el.key.FSourceBillNo){
resultFilter = false;
}
}
if(boxel.key.FItemID != el.key.FItemID) {
resultFilter = false;
}
if( boxel.key.FAuxPropName != (el.key.FAuxPropName ? el.key.FAuxPropName : "")
&& propControl) {
resultFilter = false;
}
if( (boxel.key.FBatchNO != el.key.FBatchNO) && batchControl) {
resultFilter = false;
}
if( (boxel.key.FKFDate != el.key.FKFDate) && fKFDateControl) {
resultFilter = false;
}
return resultFilter;
}
);
let myFAuxQtyData = FAuxQtyData.filter(
function(el){
let resultFilter = true;
boxel.key.FKFDate = (new Date(boxel.key.FKFDate)).getTime();
el.key.FKFDate = (new Date(el.key.FKFDate)).getTime();
if(!boxel.key.FKFDate){
boxel.key.FKFDate = "";
}
if(!el.key.FKFDate){
el.key.FKFDate = "";
}
if(_self.currentBarCodeInfo.FSourceTranType == 85 || _self.currentBarCodeInfo.FSourceTranType == 1007105){
if(boxel.key.FSourceBillNo != el.key.FICMOBillno){
resultFilter = false;
}
}else{
if(boxel.key.FSourceBillNo != el.key.FSourceBillNo){
resultFilter = false;
}
}
if(boxel.key.FItemID != el.key.FItemID) {
resultFilter = false;
}
if( boxel.key.FAuxPropName != (el.key.FAuxPropName ? el.key.FAuxPropName : "")
&& propControl) {
resultFilter = false;
}
if( (boxel.key.FBatchNO != el.key.FBatchNO) && batchControl) {
resultFilter = false;
}
if( (boxel.key.FKFDate != el.key.FKFDate) && fKFDateControl) {
resultFilter = false;
}
return resultFilter;
}
);
let myFQtyData = FQtyData.filter(
function(el){
let resultFilter = true;
boxel.key.FKFDate = (new Date(boxel.key.FKFDate)).getTime();
el.key.FKFDate = (new Date(el.key.FKFDate)).getTime();
if(!boxel.key.FKFDate){
boxel.key.FKFDate = "";
}
if(!el.key.FKFDate){
el.key.FKFDate = "";
}
if(boxel.key.FSourceBillNo != el.key.FSourceBillNo){
resultFilter = false;
}
if(boxel.key.FItemID != el.key.FItemID) {
resultFilter = false;
}
if( boxel.key.FAuxPropName != (el.key.FAuxPropName ? el.key.FAuxPropName : "")
&& propControl) {
resultFilter = false;
}
if( (boxel.key.FBatchNO != el.key.FBatchNO) && batchControl) {
resultFilter = false;
}
if( (boxel.key.FKFDate != el.key.FKFDate) && fKFDateControl) {
resultFilter = false;
}
return resultFilter;
}
);
let sumFAuxQty = myFAuxQtyData.length > 0 ? myFAuxQtyData[0].data : 0;
let sumFQtyData = myFQtyData.length > 0 ? myFQtyData[0].data : 0;
let sumFRelationQtyData = myFRelationQtyData.length > 0 ? myFRelationQtyData[0].data : 0;
if(sumFAuxQty - FDQty - sumFQtyData - sumFRelationQtyData - boxel.data < 0){
_self.errDetails = "物料("+boxel.key.FItemName+")本次扫描数量"+boxel.data+"大于源单("+
boxel.key.FSourceBillNo+")应调数量"+FDQty+"-已调数量"+
sumFRelationQtyData+"-已扫描数量"+sumFQtyData;
boxResult = false;
_self.errDetailsList.push(_self.errDetails);
return false;
}
}
);
}
if(!boxResult){
_self.showErrTips = true;
return boxResult;
}
}else{
let currentFQty = _self.currentBarCodeInfo.FQty;
let myFRelationQtyData = FRelationQtyData.filter(
function(el){
let resultFilter = true;
_self.currentBarCodeInfo.FKFDate = (new Date(_self.currentBarCodeInfo.FKFDate)).getTime();
el.key.FKFDate = (new Date(el.key.FKFDate)).getTime();
if(!_self.currentBarCodeInfo.FKFDate){
_self.currentBarCodeInfo.FKFDate = "";
}
if(!el.key.FKFDate){
el.key.FKFDate = "";
}
if(_self.currentBarCodeInfo.FSourceTranType == 85 || _self.currentBarCodeInfo.FSourceTranType == 1007105){
if(_self.currentBarCodeInfo.FSourceBillNo != el.key.FICMOBillno){
resultFilter = false;
}
}else{
if(_self.currentBarCodeInfo.FSourceBillNo != el.key.FSourceBillNo){
resultFilter = false;
}
}
if(_self.currentBarCodeInfo.FItemID != el.key.FItemID) {
resultFilter = false;
}
if( _self.currentBarCodeInfo.FAuxPropName != (el.key.FAuxPropName ? el.key.FAuxPropName : "")
&& propControl) {
resultFilter = false;
}
if( (_self.currentBarCodeInfo.FBatchNO != el.key.FBatchNO) && batchControl) {
resultFilter = false;
}
if( (_self.currentBarCodeInfo.FKFDate != el.key.FKFDate) && fKFDateControl) {
resultFilter = false;
}
return resultFilter;
}
);
let myFAuxQtyData = FAuxQtyData.filter(
function(el){
let resultFilter = true;
_self.currentBarCodeInfo.FKFDate = (new Date(_self.currentBarCodeInfo.FKFDate)).getTime();
el.key.FKFDate = (new Date(el.key.FKFDate)).getTime();
if(!_self.currentBarCodeInfo.FKFDate){
_self.currentBarCodeInfo.FKFDate = "";
}
if(!el.key.FKFDate){
el.key.FKFDate = "";
}
if(_self.currentBarCodeInfo.FSourceTranType == 85 || _self.currentBarCodeInfo.FSourceTranType == 1007105){
if(_self.currentBarCodeInfo.FSourceBillNo != el.key.FICMOBillno){
resultFilter = false;
}
}else{
if(_self.currentBarCodeInfo.FSourceBillNo != el.key.FSourceBillNo){
resultFilter = false;
}
}
if(_self.currentBarCodeInfo.FItemID != el.key.FItemID) {
resultFilter = false;
}
if( _self.currentBarCodeInfo.FAuxPropName != (el.key.FAuxPropName ? el.key.FAuxPropName : "")
&& propControl) {
resultFilter = false;
}
if( (_self.currentBarCodeInfo.FBatchNO != el.key.FBatchNO) && batchControl) {
resultFilter = false;
}
if( (_self.currentBarCodeInfo.FKFDate != el.key.FKFDate) && fKFDateControl) {
resultFilter = false;
}
return resultFilter;
}
);
let myFQtyData = FQtyData.filter(
function(el){
let resultFilter = true;
_self.currentBarCodeInfo.FKFDate = (new Date(_self.currentBarCodeInfo.FKFDate)).getTime();
el.key.FKFDate = (new Date(el.key.FKFDate)).getTime();
if(!_self.currentBarCodeInfo.FKFDate){
_self.currentBarCodeInfo.FKFDate = "";
}
if(!el.key.FKFDate){
el.key.FKFDate = "";
}
if(_self.currentBarCodeInfo.FSourceBillNo != el.key.FSourceBillNo){
resultFilter = false;
}
if(_self.currentBarCodeInfo.FItemID != el.key.FItemID) {
resultFilter = false;
}
if( (_self.currentBarCodeInfo.FAuxPropName != (el.key.FAuxPropName) ? el.key.FAuxPropName : "")
&& propControl) {
resultFilter = false;
}
if( (_self.currentBarCodeInfo.FBatchNO != el.key.FBatchNO) && batchControl) {
resultFilter = false;
}
if( (_self.currentBarCodeInfo.FKFDate != el.key.FKFDate) && fKFDateControl) {
resultFilter = false;
}
return resultFilter;
}
);
_self.currentBarCodeInfo.FKFDate = _self.FDate;
let sumFAuxQty = myFAuxQtyData.length > 0 ? myFAuxQtyData[0].data : 0;
let sumFQtyData = myFQtyData.length > 0 ? myFQtyData[0].data : 0;
let sumFRelationQtyData = myFRelationQtyData.length > 0 ? myFRelationQtyData[0].data : 0;
if(sumFAuxQty - sumFQtyData - sumFRelationQtyData - _self.currentBarCodeInfo.FQty < 0){
_self.errDetails = "物料("+_self.currentBarCodeInfo.FItemName+")本次扫描数量"+_self.currentBarCodeInfo.FQty+"大于源单("+
_self.currentBarCodeInfo.FSourceBillNo+")应调数量"+sumFAuxQty+"-已调数量"+
sumFRelationQtyData+"-已扫描数量"+sumFQtyData;
_self.errDetailsList.push(_self.errDetails);
_self.showErrTips = true;
return false;
}
}
}
}
}
}
//test 数据显示
let rowDataBarcode = {
"FSourceBillTypeName": this.currentBarCodeInfo.FSourceBillTypeName,
"FSourceBillNo": this.currentBarCodeInfo.FSourceBillNo,
"FBoxNumber": this.currentBarCodeInfo.FBoxNumber,
"FBarcodeNumber": this.currentBarCodeInfo.FBarcodeNumber,
"FItemNumber": this.currentBarCodeInfo.FItemNumber,
"FItemName": this.currentBarCodeInfo.FItemName,
"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,
"FKFDate": this.currentBarCodeInfo.FKFDate?this.currentBarCodeInfo.FKFDate:"",
"FQty": this.currentBarCodeInfo.FQty,
"FUnitName": this.currentBarCodeInfo.FUnitName?this.currentBarCodeInfo.FUnitName:"",
"transferOutStockNumber": this.currentBarCodeInfo.transferOutStockNumber?this.currentBarCodeInfo.transferOutStockNumber:"",
"transferOutStockPlaceNumber": this.currentBarCodeInfo.transferOutStockPlaceNumber?this.currentBarCodeInfo.transferOutStockPlaceNumber:"",
"transferOutStockID":this.currentBarCodeInfo.transferOutStockID,
"transferOutStockPlaceID":this.currentBarCodeInfo.transferOutStockPlaceID,
"transferInStockNumber": this.currentBarCodeInfo.transferInStockNumber?this.currentBarCodeInfo.transferInStockNumber:"",
"transferInStockPlaceNumber": this.currentBarCodeInfo.transferInStockPlaceNumber?this.currentBarCodeInfo.transferInStockPlaceNumber:"",
"transferInStockID":this.currentBarCodeInfo.transferInStockID,
"transferInStockPlaceID":this.currentBarCodeInfo.transferInStockPlaceID,
"fICMOEntryID":0,
"FItemID":this.currentBarCodeInfo.FItemID,
"fIsBox":this.currentBarCodeInfo.fIsBox
};
if(_self.currentBarCodeInfo.fIsBox == 0) {
_self.scannedTableData.push(rowDataBarcode);
}
let qtyConversionRate = commonUtil.round(parseFloat(this.currentBarCodeInfo.barCodeInfo.FBASEQTY)/parseFloat(this.currentBarCodeInfo.barCodeInfo.FQTY), 6);
let commitDataBarcode = {
"FSRCFORMID":this.currentBarCodeInfo.FSourceTranType?this.currentBarCodeInfo.FSourceTranType:'',
"FID": this.currentBarCodeInfo.barCodeInfo.FID?this.currentBarCodeInfo.barCodeInfo.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:'',
"FSRCSTOCKID":this.currentBarCodeInfo.barCodeInfo.FSTOCKID?this.currentBarCodeInfo.barCodeInfo.FSTOCKID:'',
"FSRCSTOCKLOCID":this.currentBarCodeInfo.barCodeInfo.FSTOCKLOCID?this.currentBarCodeInfo.barCodeInfo.FSTOCKLOCID:'',
"FSTOCKID":this.currentBarCodeInfo.transferInStockID?this.currentBarCodeInfo.transferInStockID:'',
"FSTOCKLOCID":this.currentBarCodeInfo.transferInStockPlaceID?this.currentBarCodeInfo.transferInStockPlaceID:'',
"FLOCATION":this.currentBarCodeInfo.transferInLocation?this.currentBarCodeInfo.transferInLocation:'',
"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":parseFloat(this.currentBarCodeInfo.FQty),
"FLOT": this.currentBarCodeInfo.barCodeInfo.FLOT?this.currentBarCodeInfo.barCodeInfo.FLOT:'',
"FAUXPROPID": this.currentBarCodeInfo.barCodeInfo.FAUXPROPID?this.currentBarCodeInfo.barCodeInfo.FAUXPROPID:'',
"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":parseFloat(this.currentBarCodeInfo.FQty)*qtyConversionRate,
"FSECUNITQTY":this.FSECUNITQTY?this.FSECUNITQTY:0,
"FSECUNITID":this.FSECUNITID,
"FISSECUNIT":this.FISSECUNIT,
"FKEEPERID":this.FKEEPERID,
"FKEEPERTYPEID":this.FKEEPERTYPEID,
"FOWNERID":this.FOWNERID,
"FOWNERTYPEID":this.FOWNERTYPEID,
"FSRCSTOCKSTATUSID":this.currentBarCodeInfo.OUTSTOCKSTATUSID?this.currentBarCodeInfo.OUTSTOCKSTATUSID:"",
"FSTOCKSTATUSID":this.currentBarCodeInfo.INSTOCKSTATUSID?this.currentBarCodeInfo.INSTOCKSTATUSID:"",
"FUSEFULDATE":this.currentBarCodeInfo.FUSEFULDATE,
};
if (this.currentTranType == 'STK_TransferManage') {
commitDataBarcode.OutOrgID = this.callOutOrgArrayId;
commitDataBarcode.OutOwnerID = this.callOutOwnerArrayId;
commitDataBarcode.InOrgID = this.InOrgID;
commitDataBarcode.InOwnerID = this.callInOwnerArrayId;
}
_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:"",
"FSize": el.FSize?el.FSize:"",
"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:"",
"transferOutStockNumber": _self.currentBarCodeInfo.transferOutStockNumber?_self.currentBarCodeInfo.transferOutStockNumber:"",
"transferOutStockPlaceNumber": _self.currentBarCodeInfo.transferOutStockPlaceNumber?_self.currentBarCodeInfo.transferOutStockPlaceNumber:"",
"transferOutStockID":_self.currentBarCodeInfo.transferOutStockID?_self.currentBarCodeInfo.transferOutStockID:"",
"transferOutStockPlaceID":_self.currentBarCodeInfo.transferOutStockPlaceID?_self.currentBarCodeInfo.transferOutStockPlaceID:"",
"transferInStockNumber": _self.currentBarCodeInfo.transferInStockNumber?_self.currentBarCodeInfo.transferInStockNumber:"",
"transferInStockPlaceNumber": _self.currentBarCodeInfo.transferInStockPlaceNumber?_self.currentBarCodeInfo.transferInStockPlaceNumber:"",
"transferInStockID":_self.currentBarCodeInfo.transferInStockID?_self.currentBarCodeInfo.transferInStockID:"",
"transferInStockPlaceID":_self.currentBarCodeInfo.transferInStockPlaceID?_self.currentBarCodeInfo.transferInStockPlaceID:"",
"fIsBox":true
};
_self.scannedTableData.push(elData);
_self.barcodeList.push(el.FBoxNumber);
_self.barcodeList.push(el.FBarcodeNumber);
}
);
_self.boxTempList.splice(0, _self.boxTempList.length);
_self.barcodeList.push(_self.currentBarCodeInfo.FBarcodeNumber);
if(this.currentBarCodeInfo.FSourceTranType){
if(!_self.currentBarCodeInfo.fIsOpenSource){
if(sourceBillInfos) {
if (sourceBillInfos.length > 0) {
sourceBillInfos.forEach(
function sourceMap(el) {
_self.baseTableData.push(el);
_self.TempBaseTableData.push(el)
});
}
}
}
}
_self.Calculate();
uni.showToast({
icon: 'success',
title: "数据输入成功"
});
let lastSaveOrgid = this.orgFItemID; //最后一次条码录入成功后(条码进入已扫描列表)的组织ID
uni.setStorageSync(this.dbAlise+this.userName+this.currentTranType+'lastSaveOrgid',lastSaveOrgid);
this.saveCash();
this.storagetransferInLocation = this.currentBarCodeInfo.transferInLocation;
this.storageINSTOCKSTATUSNAME = this.currentBarCodeInfo.INSTOCKSTATUSNAME;
this.storageINSTOCKSTATUSID = this.currentBarCodeInfo.INSTOCKSTATUSID;
this.storageOUTSTOCKSTATUSNAME = this.currentBarCodeInfo.OUTSTOCKSTATUSNAME;
this.storageOUTSTOCKSTATUSID = this.currentBarCodeInfo.OUTSTOCKSTATUSID;
this.clearBtnClick();
this.currentBarCodeInfo.transferOutLocation = this.storageLocation;
this.currentBarCodeInfo.transferInLocation = this.storagetransferInLocation;
this.currentBarCodeInfo.outFSCStockNumber = this.storageoutFSCStockNumber;
this.currentBarCodeInfo.INSTOCKSTATUSNAME = this.storageINSTOCKSTATUSNAME;
this.currentBarCodeInfo.INSTOCKSTATUSID = this.storageINSTOCKSTATUSID;
if(this.$refs.inStockStatusList){
this.$refs.inStockStatusList.selectText = this.storageINSTOCKSTATUSNAME;
}
this.currentBarCodeInfo.OUTSTOCKSTATUSNAME = this.storageOUTSTOCKSTATUSNAME;
this.currentBarCodeInfo.OUTSTOCKSTATUSID = this.storageOUTSTOCKSTATUSID;
if(this.$refs.outStockStatusList){
this.$refs.outStockStatusList.selectText = this.storageINSTOCKSTATUSNAME;
}
this.currentBarCodeInfo.FLOT = "";
if (!_self.outFSCStockFIsStockMgr) {
_self.currentBarCodeInfo.outFSCSPNumber = "";
}
else {
this.currentBarCodeInfo.outFSCSPNumber = this.storageoutFSCSPNumber;
}
this.currentBarCodeInfo.inFSCStockNumber = this.storageinFSCStockNumber;
if (!_self.inFSCStockFIsStockMgr) {
this.currentBarCodeInfo.inFSCSPNumber = "";
}
else {
this.currentBarCodeInfo.inFSCSPNumber = this.storageinFSCSPNumber;
}
this.barcodecous = false;
this.$nextTick(function(){
this.barcodecous = true;
this.Fsours = false;
this.QtyFocus = false;
this.transferOutLocationFocus = false;
this.outFSCStockNumberFocus = false;
this.outFSCSPNumberFocus = false;
this.transferInLocationFocus = false;
this.inFSCStockNumberFocus = false;
this.inFSCSPNumberFocus = false;
});
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
inFSCStockNumberConfirm:function(){
console.log("调入仓库"+this.currentBarCodeInfo);
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 userID = this.userInfo.token;
let requestParams = {
"id": userID,
"stockNumber":this.currentBarCodeInfo.inFSCStockNumber,
"orgid":this.orgFItemID
};
uni.showLoading({
icon:'loading',
title:'加载中……',
mask:true
});
this.$request.post(
{
data: {
action: 'SearchStock',
params: requestParams
}
}
).then(res => {
uni.hideLoading();
this.transferOutFlagC = true;
let data = JSON.parse(res);
this.currentBarCodeInfo.inTypeFStockID = data.FStockID;
this.FIsStockMgr = data.FIsStockMgr;
this.inFSCStockFIsStockMgr = data.FIsStockMgr;
uni.showToast({
icon: 'none',
title: "调入仓库录入成功"
});
this.storageinFSCStockNumber = this.currentBarCodeInfo.inFSCStockNumber;
if (this.FIsStockMgr) {
this.inStockDisable = false;
this.showInFSCSP();
}
else {
this.inStockDisable = true;
this.currentBarCodeInfo.inFSCSPNumber = "";
this.currentBarCodeInfo.transferInLocation = this.currentBarCodeInfo.inFSCStockNumber;
this.transferInLocationConfirm();
}
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
inFSCSPNumberConfirm:function(){
console.log("调入仓位"+this.currentBarCodeInfo);
let userId = this.$store.state.userInfo.UserID;
if(this.FIsStockMgr){
if(!this.currentBarCodeInfo.inFSCStockNumber) {
uni.showToast({
title: "请录入调入仓位编号",
icon: "none",
duration: 3000,
});
return;
}
}
if(!this.currentBarCodeInfo.FBarcodeNumber) {
uni.showToast({
title: "请先扫描条码",
icon: "none",
duration: 3000,
});
return;
}
let outL = this.currentBarCodeInfo.outFSCStockNumber + this.currentBarCodeInfo.outFSCSPNumber;
let inL = this.currentBarCodeInfo.inFSCStockNumber + this.currentBarCodeInfo.inFSCSPNumber;
let inOrgJudge = this.InOrgID + this.currentBarCodeInfo.inFSCStockNumber + this.currentBarCodeInfo.inFSCSPNumber;
let outOrgJudge = this.callOutOrgArrayId + this.currentBarCodeInfo.outFSCStockNumber + this.currentBarCodeInfo.outFSCSPNumber;
if(inOrgJudge == outOrgJudge){
uni.showToast({
title: "调入/调出位置不能相同",
icon: "none",
duration: 3000,
});
return;
}
let userID = this.userInfo.token;
let requestParams = {
"id": userID,
"stockNumber":this.currentBarCodeInfo.inFSCStockNumber,
"stockPlaceNumber":this.currentBarCodeInfo.inFSCSPNumber ? this.currentBarCodeInfo.inFSCSPNumber : "",
"stockID":this.currentBarCodeInfo.inTypeFStockID ? this.currentBarCodeInfo.inTypeFStockID : "",
"orgid":this.orgFItemID
};
uni.showLoading({
icon:'loading',
title:'加载中……',
mask:true
});
this.$request.post(
{
data: {
action: 'SearchStockPlace',
params: requestParams
}
}
).then(res => {
uni.hideLoading();
let data = JSON.parse(res);
this.currentBarCodeInfo.transferInLocation = data.FLocation;
uni.showToast({
icon: 'none',
title: "调入仓位录入成功"
});
this.storageinFSCSPNumber = this.currentBarCodeInfo.inFSCSPNumber;
this.transferInLocationConfirm();
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
//抓取源单类信息的东西
billTypeChange({newVal, oldVal, index, orignItem}) {
if(orignItem.FSRCFORMID=='PRD_MO' || orignItem.FSRCFORMID=='SUB_SUBREQORDER'){ //生产任务单|委外订单时显示行号
this.isShowRowNO = true;
}else{
this.isShowRowNO = false;
}
this.currentBarCodeInfo = new Object();
this.currentBarCodeInfo.FSourceBillTypeName = orignItem.FSRCNAME
// this.currentBarCodeInfo.viewName = orignItem.ViewName;
this.currentBarCodeInfo.fDestTranType = orignItem.FTRANTYPE;
this.currentBarCodeInfo.FSourceTranType = orignItem.FSRCFORMID;
this.FSourceTranType = orignItem.FSRCFORMID;
this.currentBarCodeInfo.fIsOpenSource = orignItem.FISOPENSOURCE;
this.FIsControlQty = orignItem.FISCONTROLQTY;
// this.FOtherControl = orignItem.FOtherControl;
_self.FISCHECKLOT = orignItem.FISCHECKLOT;
_self.FISCHECKAUX = orignItem.FISCHECKAUX;
_self.FISCHECKKFDATE = orignItem.FISCHECKKFDATE;
if(this.currentBarCodeInfo.FSourceTranType == 0 || !this.currentBarCodeInfo.fIsOpenSource){
this.barcodecous = false;
this.$nextTick(function(){
this.barcodecous = true;
this.Fsours = false;
this.QtyFocus = false;
this.transferOutLocationFocus = false;
this.outFSCStockNumberFocus = false;
this.outFSCSPNumberFocus = false;
this.transferInLocationFocus = false;
this.inFSCStockNumberFocus = false;
this.inFSCSPNumberFocus = false;
})
}
if(this.currentBarCodeInfo.FSourceTranType != 0 || this.currentBarCodeInfo.fIsOpenSource){
this.Fsours = false;
this.$nextTick(function(){
this.Fsours = true;
this.barcodecous = false;
this.QtyFocus = false;
this.transferOutLocationFocus = false;
this.outFSCStockNumberFocus = false;
this.outFSCSPNumberFocus = false;
this.transferInLocationFocus = false;
this.inFSCStockNumberFocus = false;
this.inFSCSPNumberFocus = false;
})
}
if (orignItem.FSRCFORMID == 0) {
this.billNoDisabled = true;
//供应商只读文本框展示 true
// _self.supper=false;
this.showsupper = true;
this.showsup = false;
this.isshowcolor = true;
this.billNoDisabled = true;
this.isShowOrg = true;
} else {
this.showsupper = false;
//供应商只读文本框展示 truess
//_self.supper = true;
//供应商制度 true
//_self.showsup = true;
//源单只读
if(this.currentBarCodeInfo.fIsOpenSource) {
this.billNoDisabled = false;
this.isshowcolor = false;
} else {
this.billNoDisabled = true;
//供应商只读文本框展示 true
// _self.supper=false;
this.showsupper = true;
this.showsup = false;
this.isshowcolor=true;
this.billNoDisabled = true;
}
}
this.currentBarCodeInfo.FBarcodeNumber = "";
this.currentBarCodeInfo.FSourceBillNo = "";
this.barcodeQtyDisabled = true;
this.currentBarCodeInfo.FItemNumber = "";
this.currentBarCodeInfo.FItemName = "";
this.currentBarCodeInfo.FModel = "";
this.currentBarCodeInfo.FAuxPropName = "";
this.currentBarCodeInfo.FQty = "";
this.currentBarCodeInfo.fBoxQty = "";
this.currentBarCodeInfo.transferOutLocation = "";
this.currentBarCodeInfo.transferInLocation = "";
this.currentBarCodeInfo.outFSCStockNumber = "";
this.currentBarCodeInfo.outFSCSPNumber = "";
this.currentBarCodeInfo.inFSCStockNumber = "";
this.currentBarCodeInfo.inFSCSPNumber = "";
this.$forceUpdate();
this.saveCash();
},
//正操作条码扫码回车执行
barcodeInfoConfirm: function() {
if (!this.currentBarCodeInfo.FSourceBillTypeName) {
uni.showToast({
icon: "none",
title: "请选择源单类型",
duration: 3500,
})
return false;
}
if(!this.currentBarCodeInfo.FBarcodeNumber) {
uni.showToast({
icon: "none",
title: "请输入条码",
duration: 3500,
})
return false;
}
let isFail = this.checkBarcodeNumber(this.currentBarCodeInfo.FBarcodeNumber);
if (isFail) {
uni.showToast({
icon: "none",
title: "请输入正确的条码",
duration: 3500,
})
return false;
}
this.currentBarCodeInfo.FBarcodeNumber = this.currentBarCodeInfo.FBarcodeNumber.toUpperCase();
if(!this.currentBarCodeInfo.FSourceBillNo) {
this.currentBarCodeInfo.FSourceBillNo = "";
}
let userID = this.userInfo.token;
let isHaveSource = true;
if(!this.currentBarCodeInfo.FSourceTranType){
isHaveSource = false;
}
//待添加逻辑
let isExit = 0;
let requestParams = {
"barCodeNum": this.currentBarCodeInfo.FBarcodeNumber,
"sourceBillNO": this.currentBarCodeInfo.FSourceBillNo,
"sourceTranType": this.FSourceTranType,
"isHaveSource": isHaveSource,
"tranType": this.currentTranType,
"isExit": isExit,
"sourceEntryID": this.RowNo ? this.RowNo : 0,
"orgID":this.orgFItemID,
"OutOrgID":this.callOutOrgArrayId,
"OutOwnerID":this.callOutOwnerArrayId,
"InOrgID":this.InOrgID,
"InOwnerID":this.callInOwnerArrayId,
};
uni.showLoading({
icon:'loading',
title:'加载中……',
mask:true
});
this.$request.post('/SelBill/QueryBarCode',requestParams).then(res => {
uni.hideLoading();
let data = res;
_self.FKEEPERID = data["FKEEPERID"];
_self.FKEEPERTYPEID = data["FKEEPERTYPEID"];
_self.FOWNERID = data["FOWNERID"];
_self.FOWNERTYPEID = data["FOWNERTYPEID"];
_self.FSECUNITQTY = data["FSECUNITQTY"];
_self.FSECUNITID = data["FSECUNITID"];
_self.FISSECUNIT = data["FISSECUNIT"];
_self.currentBarCodeInfo.barCodeInfo = data;
//debuggerger
let isBox = data["FISBOX"];
_self.currentBarCodeInfo.fIsBox = isBox;
_self.currentBarCodeInfo.fCType = data["FBARTYPE"];
_self.currentBarCodeInfo.FBarcodeNumber = data["FBARCODE"];
if(_self.currentBarCodeInfo.fCType != 3 && _self.currentBarCodeInfo.fIsBox ==0 ||
_self.currentBarCodeInfo.fIsBox == 1){
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;
}
}
}
}
this.currentBarCodeInfo.transferOutStockID = data["FSTOCKID"];
this.currentBarCodeInfo.transferOutStockPlaceID = data["FSTOCKLOCID"];
_self.FDetailID = data["FSRCDETAILID"];
_self.FUnitID = data["FUNITID"];
_self.currentBarCodeInfo.transferOutLocation = data.FLOCATION;
_self.currentBarCodeInfo.outFSCStockNumber = data["FLOCATION"];
_self.currentBarCodeInfo.outFSCStockNumber =
_self.currentBarCodeInfo.outFSCStockNumber.replace(/\s*/g,"");
_self.currentBarCodeInfo.FSCStockID = data["FSTOCKID"];
_self.currentBarCodeInfo.outFSCSPNumber = data["FLOCATION"];
_self.currentBarCodeInfo.outFSCSPNumber =
_self.currentBarCodeInfo.outFSCSPNumber.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.fID = data["FID"];//部门、供应商、客户 内码
_self.currentBarCodeInfo.fNO = data["FNO"];//部门、供应商、客户 代码
_self.currentBarCodeInfo.fName = data["FNAME"];//部门、供应商、客户 名称
if(isHaveSource) {
_self.currentBarCodeInfo.fDeptID = data["FID"];
_self.currentBarCodeInfo.fDeptName = data["FNAME"];
_self.currentBarCodeInfo.fDeptNO = data["FNO"];
}
// _self.currentBarCodeInfo.fSourceBillType = data[0]["FSourceBillType"];
// _self.currentBarCodeInfo.FSourceBillTypeName = data[0]["FSourceBillTypeName"];
_self.currentBarCodeInfo.FSourceBillNo = data["FSRCBILLNO"];
_self.currentBarCodeInfo.FBoxNumber = data["FBOXBARCODE"];
_self.currentBarCodeInfo.FItemID = data["FMATERIALID"];
_self.currentBarCodeInfo.FBatchNO = data["FLOT"] ? 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.FLOT = data["FLOT"];
if (_self.stockStatus) {
_self.currentBarCodeInfo.FDEFSTOCKSTATUSID = data["FDEFSTOCKSTATUSID"];
_self.currentBarCodeInfo.FDEFSTOCKSTATUSNAME = data["FDEFSTOCKSTATUSNAME"];
if (data["FSTOCKSTATUSNAME"]) {
if(_self.$refs.outStockStatusList){
_self.$refs.outStockStatusList.selectText = data["FSTOCKSTATUSNAME"];
}
_self.currentBarCodeInfo.OUTSTOCKSTATUSNAME = data["FSTOCKSTATUSNAME"];
if(_self.$refs.inStockStatusList){
_self.$refs.inStockStatusList.selectText = data["FSTOCKSTATUSNAME"];
}
_self.currentBarCodeInfo.INSTOCKSTATUSNAME = data["FSTOCKSTATUSNAME"];
}
else {
if(_self.$refs.outStockStatusList){
self.$refs.outStockStatusList.selectText = "";
}
_self.currentBarCodeInfo.OUTSTOCKSTATUSNAME = "";
if(_self.$refs.inStockStatusList){
self.$refs.inStockStatusList.selectText = "";
}
_self.currentBarCodeInfo.INSTOCKSTATUSNAME = "";
}
_self.currentBarCodeInfo.OUTSTOCKSTATUSID = data["FSTOCKSTATUSID"];
_self.currentBarCodeInfo.INSTOCKSTATUSID = data["FSTOCKSTATUSID"];
_self.outLocationCheckFlag = true;
}
_self.currentBarCodeInfo.FUSEFULDATE = data["FUSEFULDATE"];
_self.currentBarCodeInfo.fLocation = data["FLOCATION"];
_self.currentBarCodeInfo.fLocation = _self.currentBarCodeInfo.fLocation.replace(/\s*/g,"");
_self.currentBarCodeInfo.transferOutLocation = data["FLOCATION"];
_self.currentBarCodeInfo.transferOutLocation =
_self.currentBarCodeInfo.transferOutLocation.replace(/\s*/g,"");
if((!_self.currentBarCodeInfo.transferOutLocation) || (_self.currentBarCodeInfo.transferOutLocation.length == 0)){
_self.currentBarCodeInfo.transferOutLocation = _self.storageLocation;
}
if((!_self.currentBarCodeInfo.outFSCStockNumber) || (_self.currentBarCodeInfo.outFSCStockNumber.length == 0)){
_self.currentBarCodeInfo.outFSCStockNumber = _self.storageoutFSCStockNumber;
}
if((!_self.currentBarCodeInfo.outFSCSPNumber) || (_self.currentBarCodeInfo.outFSCSPNumber.length == 0)){
_self.currentBarCodeInfo.outFSCSPNumber = _self.storageoutFSCSPNumber;
}
if((!_self.currentBarCodeInfo.transferInLocation) || (_self.currentBarCodeInfo.transferInLocation.length == 0)){
_self.currentBarCodeInfo.transferInLocation = _self.storagetransferInLocation;
}
if((!_self.currentBarCodeInfo.inFSCSPNumber) || (_self.currentBarCodeInfo.inFSCSPNumber.length == 0)){
_self.currentBarCodeInfo.inFSCSPNumber = _self.storageinFSCSPNumber;
}
if((!_self.currentBarCodeInfo.inFSCStockNumber) || (_self.currentBarCodeInfo.inFSCStockNumber.length == 0)){
_self.currentBarCodeInfo.inFSCStockNumber = _self.storageinFSCStockNumber;
}
if(_self.currentBarCodeInfo.fCType == 3 && _self.currentBarCodeInfo.fIsBox ==0){
_self.issum = false
}
_self.currentBarCodeInfo.fBoxQty = 1;
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"]:""
}
_self.boxTempList.push(elData);
}
);
console.log(_self.boxTempList);
//强制刷新数据
_self.$forceUpdate();
_self.key = _self.key + 1;
if(_self.issum){
if(_self.isShowStock){
_self.showTransferOutLocation();
}else{
_self.showOutFSCStock();
}
}else{
_self.showQty();
}
_self.showResult = true;
// console.log("barcodinfo success----" + JSON.stringify(this.currentBarCodeInfo));
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
//执行按钮头切换隐藏与映射表格
//源单信息
moreshow: function() {
this.de = true;
this.set = false;
this.showMoreShow = true;
this.showinp = false
this.showTotalShow = false;
this.showYesShow = false;
},
// 汇总
totalshow: function() {
this.de = true;
this.set = false;
this.showinp = false
this.showMoreShow = false;
this.showTotalShow = true;
this.showYesShow = false;
},
//已扫描
YesShow: function() {
this.de = true;
this.set = false;
this.showinp = false
this.showMoreShow = false;
this.showTotalShow = false;
this.showYesShow = true;
},
//正操作
OpetaShow: function() {
this.de = false;
this.set = true;
this.showinp = true;
this.showMoreShow = false;
this.showTotalShow = false;
this.showYesShow = false;
},
tableSelect: function(selected) {
if(selected.length > 0){
this.showResult = false;
}
else {
this.showResult = true;
}
if (selected.length > 0 && selected.length > this.selectedList.length)
this.selectedList = selected;
let index = selected[selected.length-1];
// let barcode = this.scannedTableData[index].FNumber;
// if (barcode) {
// uni.showToast({
// title: "您选择了条码:" + barcode,
// icon: 'none'
// })
// }
},
// //删除样式
del: function(e) {
let _self = this;
//console.log(thas.baseTableData)
//启用短暂手机振动
uni.vibrateShort({
success: function() {
console.log('success');
}
});
if (this.selectedList.length == 0) {
uni.showToast({
icon: "none",
title: "无删除数据"
})
return false;
}
this.dialogProps('确定删除数据吗?','del')
},
//提交事件
commitBtnClick: function() {
let _self = this;
if (this.isCommitBtnDisable) {
return;
}
this.isCommitBtnDisable = true;
if (_self.scannedTableData.length <= 0) {
uni.showToast({
icon: 'none',
title: "无提交数据",
duration: 1600,
});
this.showStarCousM();
this.isCommitBtnDisable = false;
return false;
}
let requestUrl;
if(this.currentTranType == 'STK_TransferManage'){
requestUrl = '/STKTransfer/STKTransferSubmit'
}
if(this.currentTranType == 'STK_TransferVirtual'){
requestUrl = '/STKTransfer/STKTransferSubmit'
}
let requestParams = {
"barcodeList": this.commitList,
"orgID":this.orgFItemID,
"InOrgID":this.InOrgID,
"billTypeID": "",
"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();
let data = res;
this.commitList.splice(0, this.commitList.length);
this.scannedTableData.splice(0, this.scannedTableData.length);
this.barcodeList.splice(0, this.barcodeList.length);
// this.this.TempBaseTableData = [];
this.totalTableData = [];
this.baseTableData = [];
this.RowNoTableData = [];
this.dialogNoticeProps(data,"success")
uni.removeStorageSync(this.dbAlise+this.userName+this.currentTranType+'lastSaveOrgid');
uni.removeStorageSync('pageCash'+this.dbAlise+this.userName+this.currentTranType+this.orgFItemID);
this.storageLocation = "";
this.storageoutFSCStockNumber = "";
this.storageoutFSCSPNumber = "";
this.storagetransferInLocation = "";
this.storageinFSCStockNumber = "";
this.storageinFSCSPNumber = "";
}).catch(err => {
this.isCommitBtnDisable = false;
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
debounce(fn, time = 1000) {
let timer = null
return function() {
if (timer) clearTimeout(timer)
timer = setTimeout(fn, time)
}
},
doSort(res) {
uni.showToast({
title: `点击了${res.key}的排序, 排序方式为${res.type}`,
icon: "none"
})
},
rowClick(item) {
uni.showToast({
title: `${JSON.stringify(item)}数据被点击`,
icon: 'none'
})
},
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;
var groupdata = _self.GroupBy(_self.scannedTableData,
['FSourceBillNo', 'FSourceBillTypeName', 'FItemNumber', 'FItemName','FSize', 'FAuxPropName', 'FUnitName'], (d, v) => {
d = d || 0
let qtyNumber = parseFloat(v.FQty)
return d += qtyNumber;
}
);
_self.totalTableData = [];
groupdata.forEach(v => {
_self.totalTableData.push({
"FSourceBillNo": v.key.FSourceBillNo,
"FSourceBillTypeName": v.key.FSourceBillTypeName,
"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
});
});
},
choseStockType:function(){
let requestParams = {
"id": this.userInfo.token,
"sysKey": "STOCKPLACECHAR"
};
let showStockType = '';
uni.showLoading({
icon:'loading',
title:'加载中……',
mask:true
});
this.$request.post(
{
data: {
action: 'GetSysParams',
params: requestParams
}
}
).then(res => {
//返回的是字符串
uni.hideLoading();
let data = res;
showStockType = data;
if(showStockType == "1"){
this.isShowStock = true;
}
if(showStockType == "2"){
this.isShowStock = false;
}
}).catch(err => {
uni.hideLoading();
this.dialogNoticeProps(err,'error')
});
},
outStockStatusListChange:function({ newVal, oldVal, index, orignItem }) {
this.currentBarCodeInfo.OUTSTOCKSTATUSNAME = orignItem.FNAME;
this.currentBarCodeInfo.OUTSTOCKSTATUSID = orignItem.FNO;
this.outLocationCheckFlag = true;
},
inStockStatusListChange:function({ newVal, oldVal, index, orignItem }) {
this.currentBarCodeInfo.INSTOCKSTATUSNAME = orignItem.FNAME;
this.currentBarCodeInfo.INSTOCKSTATUSID = orignItem.FNO;
},
transferTypeArrayChange:function({ newVal, oldVal, index, orignItem }) {
this.transferTypeArrayId = orignItem.id;
this.transferTypeArrayName = orignItem.value;
if (this.transferTypeArrayId) {
this.callOutOwnerArrayDisabled = false;
this.callInOrgArrayDisabled = false;
this.callInOwnerArrayDisabled = false;
} else {
this.callOutOwnerArrayDisabled = true;
this.callInOrgArrayDisabled = true;
this.callInOwnerArrayDisabled = true;
if (this.callOutOrgArrayId && this.callOutOrgArrayName) {
this.InOrgID = this.callOutOrgArrayId;
this.inOrgArryName = this.callOutOrgArrayName;
if (this.$refs.orgArry) {
this.$refs.orgArry.selectText = this.callOutOrgArrayName;
}
this.callOutOwnerArrayName = this.callOutOrgArrayName;
this.callOutOwnerArrayId = this.callOutOrgArrayId;
if (this.$refs.callOutOwnerArray) {
this.$refs.callOutOwnerArray.selectText = this.callOutOrgArrayName;
}
this.callInOwnerArrayName = this.callOutOrgArrayName;
this.callInOwnerArrayId = this.callOutOrgArrayId;
if (this.$refs.callInOwnerArray) {
this.$refs.callInOwnerArray.selectText = this.callOutOrgArrayName;
}
this.$forceUpdate();
}
}
},
callOutOrgArrayChange:function({ newVal, oldVal, index, orignItem }) {
let _self = this;
if (this.callOutOrgArrayId !== orignItem.FINTERID) {
this.orgChangedClear();
}
this.callOutOrgArrayId = orignItem.FINTERID;
this.callOutOrgArrayName = orignItem.FNAME;
this.orgArry.forEach((item, itemIndex)=>{
if (item.FINTERID === _self.callOutOrgArrayId) {
_self.index = itemIndex;
}
})
this.orgFItemID = this.callOutOrgArrayId;
if (!this.transferTypeArrayId) {
this.InOrgID = this.callOutOrgArrayId;
this.inOrgArryName = this.callOutOrgArrayName;
if (this.$refs.orgArry) {
this.$refs.orgArry.selectText = this.callOutOrgArrayName;
}
this.callOutOwnerArrayName = this.callOutOrgArrayName;
this.callOutOwnerArrayId = this.callOutOrgArrayId;
if (this.$refs.callOutOwnerArray) {
this.$refs.callOutOwnerArray.selectText = this.callOutOrgArrayName;
}
this.callInOwnerArrayName = this.callOutOrgArrayName;
this.callInOwnerArrayId = this.callOutOrgArrayId;
if (this.$refs.callInOwnerArray) {
this.$refs.callInOwnerArray.selectText = this.callOutOrgArrayName;
}
}
},
callOutOwnerArrayChange:function({ newVal, oldVal, index, orignItem }) {
this.callOutOwnerArrayId = orignItem.FINTERID;
this.callOutOwnerArrayName = orignItem.FNAME;
},
inOrgArryChange:function({ newVal, oldVal, index, orignItem }) {
this.InOrgID = orignItem.FINTERID;
this.inOrgArryName = orignItem.FNAME;
},
callInOwnerArrayChange:function({ newVal, oldVal, index, orignItem }) {
this.callInOwnerArrayId = orignItem.FINTERID;
this.callInOwnerArrayName = orignItem.FNAME;
},
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(){
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;
if(this.currentBarCodeInfo.FSourceTranType != "0") {
this.currentBarCodeInfo.FSourceBillNo = "";
if(this.currentBarCodeInfo.fIsOpenSource) {
this.currentBarCodeInfo.FSourceBillNo = FSourceBillNo;
}
}
if(this.currentBarCodeInfo.FSourceTranType == "0") {
this.currentBarCodeInfo.FSourceBillNo = "";
}
this.barcodeQtyDisabled = true;
this.currentBarCodeInfo.FItemNumber = "";
this.currentBarCodeInfo.FItemName = "";
this.currentBarCodeInfo.FModel = "";
this.currentBarCodeInfo.FAuxPropName = "";
this.currentBarCodeInfo.FQty = "";
this.currentBarCodeInfo.fBoxQty = "";
this.currentBarCodeInfo.transferOutLocation = "";
this.currentBarCodeInfo.transferInLocation = "";
this.currentBarCodeInfo.outFSCStockNumber = "";
this.currentBarCodeInfo.outFSCSPNumber = "";
this.currentBarCodeInfo.inFSCStockNumber = "";
this.currentBarCodeInfo.inFSCSPNumber = "";
this.currentBarCodeInfo.FUNITNAME = "";
this.key = this.key + 1;
this.$forceUpdate();
},
clearBtnClick:function(){
this.currentBarCodeInfo.FBarcodeNumber = "";
this.clearInfoByBar();
},
saveCash:function(){
let _self = this;
let otherInfo = {"currentTranType":_self.currentTranType,
"FSourceBillTypeName":_self.currentBarCodeInfo.FSourceBillTypeName,
"FSourceBillType":_self.currentBarCodeInfo.FSourceBillType,
"FSourceBillNo":_self.currentBarCodeInfo.FSourceBillNo,
"orgFItemID":_self.orgFItemID,
"dbAlise":_self.dbAlise,
"UserID":_self.userName,
"RowNo":_self.RowNo,
"transferOutLocation":_self.currentBarCodeInfo.transferOutLocation ? _self.currentBarCodeInfo.transferOutLocation : "",
"outFSCStockNumber":_self.currentBarCodeInfo.outFSCStockNumber ? _self.currentBarCodeInfo.outFSCStockNumber : "",
"outFSCSPNumber":_self.currentBarCodeInfo.outFSCSPNumber ? _self.currentBarCodeInfo.outFSCSPNumber : "",
"transferInLocation":_self.currentBarCodeInfo.transferInLocation ? _self.currentBarCodeInfo.transferInLocation : "",
"inFSCStockNumber":_self.currentBarCodeInfo.inFSCStockNumber ? _self.currentBarCodeInfo.inFSCStockNumber : "",
"inFSCSPNumber":_self.currentBarCodeInfo.inFSCSPNumber ? _self.currentBarCodeInfo.inFSCSPNumber : "",
"issum":_self.issum,
"transferTypeArrayId":_self.transferTypeArrayId,
"transferTypeArrayName":_self.transferTypeArrayName,
"callOutOrgArrayId":_self.callOutOrgArrayId,
"callOutOrgArrayName":_self.callOutOrgArrayName,
"callOutOwnerArrayName":_self.callOutOwnerArrayName,
"callOutOwnerArrayId":_self.callOutOwnerArrayId,
"InOrgID":_self.InOrgID,
"inOrgArryName":_self.inOrgArryName,
"callInOwnerArrayName":_self.callInOwnerArrayName,
"callInOwnerArrayId":_self.callInOwnerArrayId,
};
_self.pageCashInfo.scannedTableData = _self.scannedTableData;
_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) {
this.dialogProps('存在未提交数据是否加载','judgeCash')
}
else {
this.getSourceBillTypeInfo();
}
},
...mapMutations(['updateCacheByStorage'])
}
};
</script>
<style lang="scss">
.z-application-allotedcontent {
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: fixed;
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{
height: 66rpx;
line-height: 66rpx;
width: 100%;
border-radius: 10rpx;
border: 2rpx solid #D8D8D8;
flex: 0 0;
font-size: 28rpx;
font-family: MicrosoftYaHei;
color: #5F7EF8;
// padding-left: 24rpx;
// margin-left: 24rpx;
}
.header-row-input-gray-class{
height: 60rpx;
border-radius: 10rpx;
border: 2rpx solid #D8D8D8;
flex: 0 0;
font-size: 32rpx;
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-family: MicrosoftYaHei;
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;
}
.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: 60rpx;
font-size: 32rpx;
font-family: MicrosoftYaHei;
color: #666666;
}
.detail-row-white-class{
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;
text-align: center;
}
.commitBtnOther{
width: 100%;
height: 80rpx;
line-height: 80rpx;
font-size: 32rpx;
color: #FFFFFF;
background: #5778FF;
font-family: MicrosoftYaHei;
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;
border-radius: unset;
right: 0;
bottom: 0;
}
.header-row-btn-class-clear{
width: 50%;
position: fixed;
height: 80rpx;
line-height: 80rpx;
text-align: center;
font-size: 32rpx;
font-family: MicrosoftYaHei;
background: #F5F5F4;
color: #666666;
left: 0;
bottom: 0;
}
.header-row-btn-class-del{
width: 100%;
height: 80rpx;
line-height: 80rpx;
color: #FFFFFF;
font-size: 32rpx;
text-align: center;
background-color: #F76260;
border-radius: unset;
position: fixed;
left: 0;
bottom: 0;
}
.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;
}
.header-row-title-class {
width: 130rpx;
height: 60rpx;
line-height: 60rpx;
font-size: 32rpx;
font-family: MicrosoftYaHei;
color: #666666;
}
.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;
}
.image-barcode{
position: absolute;
width: 40rpx;
height: 40rpx;
// position: fixed;
right: 16rpx;
bottom: 12rpx;
}
</style>