<template>
|
<view>
|
<!-- 基本信息 -->
|
<view class="form">
|
<view class="form-item">
|
<view class="title">
|
传票:
|
</view>
|
<view class="right">
|
<input type="text" v-model="hform.HCP">
|
</view>
|
<view class="icon-wrapper">
|
<uni-icons type="scan" size="20" @click="qrCodeDisplay('HCP')"></uni-icons>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">
|
条码:
|
</view>
|
<view class="right">
|
<input type="text" v-model="hform.HBarCode" @confirm="GetMessageByBarCode">
|
</view>
|
<view class="icon-wrapper">
|
<uni-icons type="scan" size="20" @click="qrCodeDisplay('BarCode')"></uni-icons>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">
|
数量:
|
</view>
|
<view class="right">
|
<input type="number" v-model="hform.HQty">
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">调出仓库:</view>
|
<view class="right">
|
<uni-combox :candidates="arrayHWHName" placeholder="请输入(或扫描)仓库" v-model="hform.HSCWHName"
|
@input="HSCWHNameChange" @confirm="HWHNameOutScan"></uni-combox>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">调出仓位:</view>
|
<!-- TODO: 四维尔需要扫仓位码 带出仓库仓位信息,根据公司判断是否需要禁用仓位 -->
|
<view class="right">
|
<uni-combox :candidates="arrayHStockPlaceNameComputed" placeholder="请输入(或扫描)仓位"
|
v-model="hform.HOutStockPlaceName" @input="HOutStockPlaceNameChange"
|
@confirm="HStockPlaceOutNameScan"></uni-combox>
|
</view>
|
|
<!-- <view class="righton" v-show="!HSCIsStockMgr">
|
<input v-model="hform.HOutStockPlaceName" :disabled="!HIsStockMgr" placeholder="不可操作" />
|
</view> -->
|
</view>
|
</view>
|
<view class="tabs horizon_tabs" id="tabs">
|
<view :class="tabs == 0 ? 'on':''" @tap="tabs = 0">选择源单</view>
|
<view :class="tabs == 1 ? 'on':''" @tap="tabs = 1">表头信息</view>
|
<view :class="tabs == 2 ? 'on':''" @tap="tabs = 2">物料信息</view>
|
<view :class="tabs == 3 ? 'on':''" @tap="tabs = 3">器具信息</view>
|
<view :class="tabs == 4 ? 'on':''" @tap="tabs = 4">条码信息</view>
|
<view :class="tabs == 5 ? 'on':''" @tap="tabs = 5">下架信息</view>
|
</view>
|
<!-- 选择源单 -->
|
<template v-if="tabs == 0">
|
<view class="form" :style="{
|
height: containerHeight + 'px',
|
overflow: 'auto'
|
}">
|
<view class="form-item">
|
<view class="title">源单类型</view>
|
<view class="right" v-show="showHMainSourceBillType">
|
<picker :range="arrayHMainSourceBillType" v-model="HMainSourceBillType"
|
@change="HMainSourceBillTypeChange">
|
<input name="HMainSourceBillType" disabled v-model="HMainSourceBillType"
|
placeholder="请选择源单类型" />
|
<view class="picker-overlay"></view>
|
</picker>
|
</view>
|
<view class="righton" v-show="!showHMainSourceBillType">
|
<input name="HMainSourceBillType" disabled v-model="HMainSourceBillType"
|
placeholder="请选择源单类型" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">源单单号: </view>
|
<view class="right">
|
<input type="text" v-model="hform.HSourceBillNo"
|
@confirm="GetMessageByHSourceBillNo(hform.HSourceBillNo)" />
|
</view>
|
<!-- 选源单功能 -->
|
<view class="icon-wrapper">
|
<uni-icons type="search" size="20" @click="openSourceBillSelector"></uni-icons>
|
</view>
|
</view>
|
<!-- <view class="form-item">
|
<view class="title">单据子类型:</view>
|
<zxz-uni-data-select class="right" :localdata="HBillSubType" dataKey="HName" dataValue="HNumber"
|
v-model="hform.HBillSubType">
|
</zxz-uni-data-select>
|
</view> -->
|
<view class="form-item">
|
<view class="title">先进先出仓:</view>
|
<view class="right">
|
<uni-combox :candidates="arrayHWHName" placeholder="请输入仓库" v-model="hform.HFIFOWHName"
|
@input="HFIFOWHNameChange"></uni-combox>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">调拨类型:</view>
|
<zxz-uni-data-select class="right" :localdata="[{value: '组织内调拨'},{value: '跨组织调拨'}]" dataKey="value"
|
dataValue="value" v-model="hform.HStockStyle">
|
</zxz-uni-data-select>
|
</view>
|
<!-- <view class="form-item">
|
<view class="title">调拨方向:</view>
|
<zxz-uni-data-select class="right" :localdata="[]" dataKey="班次名称" dataValue="HItemID"
|
v-model="hform.HTransferDirect">
|
</zxz-uni-data-select>
|
</view>
|
<view class="form-item">
|
<view class="title">出货类型:</view>
|
<zxz-uni-data-select class="right" :localdata="[]" dataKey="班次名称" dataValue="HItemID"
|
v-model="hform.HShipType">
|
</zxz-uni-data-select>
|
</view> -->
|
<view class="form-item">
|
<view class="title">日期: </view>
|
<view class="right">
|
<input type="text" v-model="hform.HDate" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">制单人: </view>
|
<view class="righton">
|
<input type="text" disabled v-model="hform.HMaker" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">单据号: </view>
|
<view class="righton">
|
<input type="text" disabled v-model="hform.HBillNo" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">单据ID: </view>
|
<view class="righton">
|
<input type="text" disabled v-model="hform.HInterID" />
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<!-- 表头信息 -->
|
<template v-if="tabs == 1">
|
<view class="form" :style="{
|
height: containerHeight + 'px',
|
overflow: 'auto'
|
}">
|
<view class="form-item">
|
<view class="title">调入仓库:</view>
|
<view class="right">
|
<uni-combox :candidates="arrayHWHInName" placeholder="请输入(或扫描)仓库" v-model="hform.HWHName"
|
@input="HWHInNameChange" @confirm="HWHNameInScan"></uni-combox>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">调入仓位:</view>
|
<view class="right">
|
<uni-combox :candidates="arrayHStockPlaceInNameComputed" placeholder="请输入(或扫描)仓位"
|
v-model="hform.HStockPlaceName" @input="HStockPlaceInNameChange"
|
@confirm="HStockPlaceNameInScan"></uni-combox>
|
</view>
|
<!-- <view class="righton" v-show="!HIsStockMgr">
|
<input v-model="hform.HStockPlaceName" :disabled="!HIsStockMgr" placeholder="不可操作" />
|
</view> -->
|
</view>
|
<!-- <view class="form-item">
|
<view class="title">保管: </view>
|
<zxz-uni-data-select class="right" :localdata="HEmpList" dataKey="HName" dataValue="HItemID"
|
v-model="hform.HKeeperID">
|
</zxz-uni-data-select>
|
</view>
|
<view class="form-item">
|
<view class="title">发货: </view>
|
<zxz-uni-data-select class="right" :localdata="HEmpList" dataKey="HName" dataValue="HItemID"
|
v-model="hform.HSecManagerID">
|
</zxz-uni-data-select>
|
</view> -->
|
<view class="form-item">
|
<view class="title">部门: </view>
|
<zxz-uni-data-select class="right" :localdata="HDeptList" dataKey="部门名称" dataValue="HItemID"
|
v-model="hform.HDeptID">
|
</zxz-uni-data-select>
|
</view>
|
<view class="form-item">
|
<view class="title">客户: </view>
|
<view class="right">
|
<input type="text" v-model="hform.HSupName" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">调出组织: </view>
|
<view class="righton">
|
<input disabled type="text" v-model="hform.HStockOrgName" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">调入组织: </view>
|
<view class="righton">
|
<input disabled type="text" v-model="hform.HStockOrgName" />
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<!-- 物料信息 -->
|
<template v-if="tabs == 2">
|
<view class="form" :style="{
|
height: containerHeight + 'px',
|
overflow: 'auto'
|
}">
|
<view class="list" v-for="(item,index) in HMaterList" :key="index">
|
<uni-card :title="item.物料名称" :extra="item.物料代码" style="margin: 10px;" @tap="delMater(item)">
|
<view class="card-detail">
|
<view class="detail">
|
<text>源单单号:</text>{{item.源单单号}}
|
</view>
|
<view class="detail">
|
<text>源单数量:</text>{{item.源单数量}}
|
</view>
|
<view class="detail">
|
<text>数量:</text>{{item.数量}}
|
</view>
|
<view class="detail">
|
<text>条码个数:</text>{{item.条码个数}}
|
</view>
|
<view class="detail" v-if="item.规格型号">
|
<text>规格型号:</text>{{item.规格型号}}
|
</view>
|
<view class="detail" v-if="item.辅助属性">
|
<text>辅助属性:</text>{{item.辅助属性}}
|
</view>
|
<!-- 兴达客户 功能 -->
|
<view class="detail" v-if="materMeta[0].HWHName && /兴达/.test(hform.HStockOrgName
|
)">
|
<text>仓库:</text>{{materMeta[0].HWHName}}
|
</view>
|
</view>
|
</uni-card>
|
</view>
|
<view class="over" v-if="HMaterList.length == 0">暂无数据</view>
|
</view>
|
</template>
|
|
<!-- 器具信息 -->
|
<template v-if="tabs == 3">
|
<view class="form" :style="{
|
height: containerHeight + 'px',
|
overflow: 'auto'
|
}">
|
<view class="list" v-for="(item,index) in HMaterList" :key="index">
|
<uni-card v-if="item.器具条码" :title="item.器具名称" :extra="item.器具代号" style="margin: 10px;"
|
@tap="delMould(item)">
|
<view class="card-detail">
|
<view class="detail">
|
<text>器具条码:</text>{{item.器具条码}}
|
</view>
|
<view class="detail">
|
<text>器具条码个数:</text>{{item.器具条码个数}}
|
</view>
|
<view class="detail">
|
<text>数量:</text>{{item.数量}}
|
</view>
|
</view>
|
</uni-card>
|
</view>
|
<view class="over" v-if="HMaterList.length == 0">暂无数据</view>
|
</view>
|
</template>
|
|
<!-- 条码信息 -->
|
<template v-if="tabs == 4">
|
<view class="form" :style="{
|
height: containerHeight + 'px',
|
overflow: 'auto'
|
}">
|
<view class="form-item">
|
<view class="title">条码: </view>
|
<view class="righton">
|
<input type="text" disabled v-model="hform.HBarCode_B" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">物料: </view>
|
<view class="righton">
|
<input type="text" disabled v-model="hform.HMaterName_B" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">规格: </view>
|
<view class="righton">
|
<input type="text" disabled v-model="hform.HMaterModel_B" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">批次: </view>
|
<view class="righton">
|
<input type="text" disabled v-model="hform.HBatchNo_B" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">单位: </view>
|
<view class="righton">
|
<input type="text" disabled v-model="hform.HUnitName_B" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">数量: </view>
|
<view class="righton">
|
<input type="text" disabled v-model="hform.HQty_B" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">容量: </view>
|
<view class="righton">
|
<input type="text" disabled v-model="hform.HTMQty_B" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">调入仓库: </view>
|
<view class="righton">
|
<input type="text" disabled v-model="hform.HWHName_B" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">调入仓位: </view>
|
<view class="righton">
|
<input type="text" disabled v-model="hform.HSPName_B" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">调出仓库: </view>
|
<view class="righton">
|
<input type="text" disabled v-model="hform.HSCWHName_B" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">调出仓位: </view>
|
<view class="righton">
|
<input type="text" disabled v-model="hform.HSCSPName_B" />
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<!-- 下架信息 -->
|
<template v-if="tabs == 5">
|
<view class="form" :style="{
|
height: containerHeight + 'px',
|
overflow: 'auto'
|
}">
|
<FIFOListComponentVue :FIFOList="HFIFOList"></FIFOListComponentVue>
|
</view>
|
</template>
|
<!-- 操作按钮 -->
|
<view class="buttons" id="buttons">
|
<button class="btn-a" size="mini" @tap="submit">提交</button>
|
<view style="flex: 1;"></view>
|
<button class="btn-a" v-if="operationType!=4" size="mini" @tap="addNew">新增</button>
|
<button class="btn-c" size="mini" @tap="goBack">退出</button>
|
</view>
|
<BillListPopupVue ref="billList" :HBillType="hform.HBillType" :HSourceBillType="hform.HMainSourceBillType"
|
:HStockOrgID="hform.HStockOrgID" @BillSelectComplete="handleSourceBill"></BillListPopupVue>
|
</view>
|
</template>
|
|
<script>
|
import dayjs from "dayjs";
|
import {
|
CommonUtils
|
} from "@/utils/common";
|
import {
|
MpaasScan
|
} from "@/utils/mpaasScan.js"
|
import {
|
getUserInfo
|
} from "@/utils/auth";
|
import {
|
getUserStockRelation
|
} from '@/utils/userRelationManager';
|
import FIFOListComponentVue from "@/components/FIFOListModule/FIFOListComponent.vue";
|
import BillListPopupVue from "@/components/BillListPopup/BillListPopup.vue";
|
export default {
|
// 销售出库单(验证)
|
name: 'Kf_MoveStockBill_CusBar_APP',
|
components: {
|
FIFOListComponentVue,
|
BillListPopupVue
|
},
|
data() {
|
return {
|
tabs: 0,
|
|
btnTop: 0,
|
tabsBottom: 0,
|
HModName: "Kf_MoveStockBill_CusBar_APP",
|
operationType: 1,
|
uploadOptions: {},
|
enableEdit: true,
|
enableSourceBillEdit: true,
|
|
// 源单类型相关
|
HMainSourceBillType: "发货通知单", // 用于显示的源单类型
|
arrayHMainSourceBillType: ["发货通知单", "调拨申请单", "手工录入"],
|
arrayHMainSourceBillTypeID: [1402, 1243, -1], // 对应的单据类型ID
|
showHMainSourceBillType: true,
|
|
arrayHWHName: [], //仓库
|
HWHNameList: [],
|
arrayHStockPlaceName: [], //仓位
|
HStockPlaceNameList: [],
|
arraySCHWName: [], // 调出仓库
|
arrayHWHInName: [], // 调入仓库
|
HWHInNameList: [],
|
arrayHStockPlaceInName: [], //调入仓位
|
HStockPlaceInNameList: [],
|
|
HDeptList: [],
|
HRepairCheckList: [],
|
HEmpList: [],
|
HRepairList: [],
|
HFIFOList: [],
|
|
materMeta: [],
|
HMaterList: [],
|
HMouldList: [],
|
HBillSubType: [], // 单据子类型
|
hform: {
|
"HCP": "",
|
"HBarCode": "",
|
"HQty": "",
|
"HBarCode-BT": "",
|
"HWHName": "",
|
"HWHID": 0,
|
"HWHID-BT": "",
|
"HStockPlaceName": "",
|
"HStockPlaceID": 0,
|
"HSpID-BT": "",
|
"HMainSourceBillType": "1402",
|
"HSourceBillNo": "",
|
"cmdHSourceBillNo": "",
|
"HSourceBillNo-BT": "",
|
"HFIFOWHName": "",
|
"HFIFOWHID": 0,
|
"HFIFOWHID-BT": "",
|
"HDate": dayjs(new Date()).format("YYYY-MM-DD"),
|
"HMaker": getUserInfo()["Czymc"],
|
"HBillNo": "",
|
"HInterID": 0,
|
"HKeeperName": getUserInfo()["HKeeperName"],
|
"HKeeperID": getUserInfo()["HKeeperID"],
|
"HKeeperID-BT": "",
|
"HSecManagerName": getUserInfo()["HSecManagerName"],
|
"HSecManagerID": getUserInfo()["HSecManagerID"],
|
"HSecManagerID-BT": "",
|
"HDeptName": getUserInfo()["HDeptName"],
|
"HDeptID": getUserInfo()["HDeptID"],
|
"HDeptID-BT": "",
|
"HSupName": "",
|
"HSupID": 0,
|
"HSupID-BT": "",
|
"HStockOrgName": uni.getStorageSync("Organization"),
|
"HStockOrgID": uni.getStorageSync("OrganizationID"),
|
"wl-table": "",
|
"cmdMouldDel": "",
|
"Mould-table": "",
|
"HBarCode_B": "",
|
"HMaterName_B": "",
|
"HMaterModel_B": "",
|
"HBatchNo_B": "",
|
"HUnitName_B": "",
|
"HQty_B": "",
|
"HTMQty_B": "",
|
"HWHName_B": "",
|
"HSPName_B": "",
|
"FIFOList-table": "",
|
"cmdSaver": "",
|
"cmdModify": "",
|
"cmdDelete": "",
|
"cmdCancel": "",
|
"HBillType": "1250",
|
"HBillerID": uni.getStorageSync("HBillerID"),
|
"HRedBlueFlag": false,
|
"HSourceBillListCtl": 0,
|
"cs": "",
|
"cs2": "",
|
"HSourceFlag": false,
|
"HSCWHName": "",
|
"HSCWHID": 0,
|
"HOutStockPlaceName": "",
|
"HOutStockPlaceID": 0,
|
"HBillSubType": "FBDC01_SYS",
|
"HStockStyle": "组织内调拨",
|
"HTransferDirect": "",
|
"HShipType": "",
|
"HStockOutOrgID": uni.getStorageSync("OrganizationID"),
|
"HStockInOrgID": uni.getStorageSync("OrganizationID"),
|
"HSCWHName_B": "",
|
"HSCSPName_B": ""
|
},
|
HDetailList: [{
|
"HRepairID": 0,
|
"HRepairCode": "",
|
"HRepairName": "",
|
"HManagerID": 0,
|
"HManagerCode": "",
|
"HManagerName": "",
|
"HRepairExplanation": '',
|
"HRemark": "",
|
"HEmpID": '',
|
"HSourceInterID": 0,
|
"HSourceEntryID": 0,
|
"HSourceBillNo": ''
|
}]
|
};
|
},
|
computed: {
|
containerHeight: {
|
get() {
|
return this.btnTop - this.tabsBottom - 5
|
}
|
},
|
arrayHStockPlaceNameComputed: {
|
get() {
|
// 动态计算对应调出仓库的仓位
|
return this.HStockPlaceNameList
|
.filter(e => e['所属仓库'] == this.hform.HSCWHName)
|
.map(e => e['仓位名称'])
|
}
|
},
|
arrayHStockPlaceInNameComputed: {
|
get() {
|
// 动态计算对应调入仓库的仓位
|
return this.HStockPlaceInNameList
|
.filter(e => e['所属仓库'] == this.hform.HWHName)
|
.map(e => e['仓位名称'])
|
}
|
}
|
},
|
methods: {
|
// 获取单据子类型
|
async set_InitBillSubType(){
|
try{
|
let res = await CommonUtils.doRequest2Async({
|
url: "/WEBSController/GetBillSubType_Json",
|
data: {
|
"HBillType": this.hform.HBillType,
|
"HStockOrgID": this.hform.HStockOutOrgID
|
}
|
})
|
|
let {data, count, Message} = res.data
|
if(count == 1) {
|
this.HBillSubType = data
|
}else {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: `获取单据子类型失败: ${Message}`
|
})
|
}
|
}catch(err) {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: `获取单据子类型失败: ${err}`
|
})
|
}
|
},
|
// 调入仓位修改
|
HStockPlaceInNameChange(e) {
|
for (var i = 0; i < this.HStockPlaceInNameList.length; i++) {
|
if (this.HStockPlaceInNameList[i].仓位名称 == e) {
|
this.hform.HStockPlaceName = this.HStockPlaceInNameList[i].仓位名称
|
this.hform.HStockPlaceID = this.HStockPlaceInNameList[i].HMainID
|
}
|
}
|
},
|
// 调入仓库修改
|
HWHInNameChange(e) {
|
console.log('e: ', e);
|
this.hform.HStockPlaceName = ''
|
this.hform.HStockPlaceID = 0
|
for (var i = 0; i < this.HWHInNameList.length; i++) {
|
if (this.HWHInNameList[i].仓库名称 == e) {
|
this.hform.HWHName = this.HWHInNameList[i].仓库名称
|
this.hform.HWHID = this.HWHInNameList[i].HItemID
|
this.HStockPlaceNameChange(null)
|
if (this.HWHInNameList[i]['启用仓位'] == 'Y') {
|
this.HIsStockMgr = true
|
this.getStockPlaceRemote(this.HWHInNameList[i]["HSPGroupID"], 1) // 修改调入仓库
|
} else {
|
// this.hform.HStockPlaceName = ''
|
this.HIsStockMgr = false
|
}
|
}
|
}
|
},
|
// 调出仓库修改
|
HSCWHNameChange(e) {
|
// var name = e.split("(")
|
for (var i = 0; i < this.HWHNameList.length; i++) {
|
if (this.HWHNameList[i].仓库名称 == e) {
|
this.hform.HSCWHName = this.HWHNameList[i].仓库名称
|
this.hform.HSCWHID = this.HWHNameList[i].HItemID
|
this.HOutStockPlaceNameChange(null)
|
if (this.HWHNameList[i]['启用仓位'] == 'Y') {
|
this.HSCIsStockMgr = true
|
this.getStockPlaceRemote(this.HWHNameList[i]["HSPGroupID"], 2) // 修改调出仓库
|
// 查询仓位数据
|
} else {
|
|
this.HSCIsStockMgr = false
|
}
|
}
|
}
|
},
|
// 选择调出仓位
|
HOutStockPlaceNameChange(e) {
|
let index = this.HStockPlaceNameList.findIndex(elem => elem['仓位名称'] == e)
|
this.hform.HOutStockPlaceName = ''
|
this.hform.HOutStockPlaceID = 0
|
if (index != -1) {
|
this.hform.HOutStockPlaceName = this.HStockPlaceNameList[index].仓位名称
|
this.hform.HOutStockPlaceID = this.HStockPlaceNameList[index].HMainID
|
}
|
|
// for (var i = 0; i < this.HStockPlaceInNameList.length; i++) {
|
// if (this.HStockPlaceInNameList[i].仓位名称 == e) {
|
// this.hform.HOutStockPlaceName = this.HStockPlaceInNameList[i].仓位名称
|
// this.hform.HOutStockPlaceID = this.HStockPlaceInNameList[i].HMainID
|
// }
|
// }
|
},
|
async HWHNameOutScan(e) {
|
return
|
// 扫描仓库码
|
console.log('仓库码: ', e);
|
let index = this.HWHNameList.findIndex(elem => elem['条码编号'] == e)
|
if (index == -1) {
|
uni.showToast({
|
icon: 'none',
|
title: '扫描仓库条码对应的仓库不存在...'
|
})
|
} else {
|
this.HWHNameChange(this.HWHNameList[index]['仓库名称'])
|
}
|
},
|
async HStockPlaceOutNameScan(e) {
|
// 扫描仓位码
|
console.log('仓位码: ', e);
|
// 不先置空的话,数据再次扫描相同的仓位码 不会触发组件内的刷新
|
this.hform.HOutStockPlaceID = 0
|
this.hform.HOutStockPlaceName = ''
|
try {
|
let res = await CommonUtils.doRequest2Async({
|
url: '/Gy_StockPlace/list',
|
data: {
|
sWhere: ` and 条码编号 = '${e}'`,
|
user: uni.getStorageSync('HUserName'),
|
Organization: uni.getStorageSync('Organization')
|
},
|
})
|
|
if (res.data.count == 1) {
|
console.log('res.data: ',res.data);
|
|
// this.hform.HSCWHName = res.data.data[0].所属仓库
|
this.HSCWHNameChange(res.data.data[0].所属仓库)
|
this.hform.HOutStockPlaceID = res.data.data[0].HMainID
|
this.hform.HOutStockPlaceName = res.data.data[0].仓位名称
|
this.hform.HSCWHID = res.data.data[0].HWHID
|
|
} else {
|
uni.showToast({
|
title: '仓位数据请求失败',
|
icon: 'none'
|
})
|
}
|
|
} catch (err) {
|
uni.showToast({
|
title: '仓位数据请求失败',
|
icon: 'none'
|
})
|
}
|
},
|
async HWHNameInScan(e) {
|
return;
|
// 扫描仓库码
|
console.log('仓库码: ', e);
|
let index = this.HWHInNameList.findIndex(elem => elem['条码编号'] == e)
|
if (index == -1) {
|
uni.showToast({
|
icon: 'none',
|
title: '扫描仓库条码对应的仓库不存在...'
|
})
|
} else {
|
this.HWHInNameChange(this.HWHInNameList[index]['仓库名称'])
|
}
|
},
|
async HStockPlaceNameInScan(e) {
|
// 扫描仓位码
|
console.log('仓位码: ', e);
|
// 不先置空的话,数据再次扫描相同的仓位码 不会触发组件内的刷新
|
this.hform.HStockPlaceID = 0
|
this.hform.HStockPlaceName = ''
|
try {
|
let res = await CommonUtils.doRequest2Async({
|
url: '/Gy_StockPlace/list',
|
data: {
|
sWhere: ` and 条码编号 = '${e}'`,
|
user: uni.getStorageSync('HUserName'),
|
Organization: uni.getStorageSync('Organization')
|
},
|
})
|
|
if (res.data.count == 1) {
|
this.HWHInNameChange(res.data.data[0].所属仓库)
|
this.hform.HStockPlaceID = res.data.data[0].HMainID
|
this.hform.HStockPlaceName = res.data.data[0].仓位名称
|
this.hform.HWHID = res.data.data[0].HWHID
|
// this.hform.HWHName = res.data.data[0].所属仓库
|
|
} else {
|
uni.showToast({
|
title: '仓位数据请求失败',
|
icon: 'none'
|
})
|
}
|
|
} catch (err) {
|
uni.showToast({
|
title: '仓位数据请求失败',
|
icon: 'none'
|
})
|
}
|
},
|
// 打开选源单页面
|
openSourceBillSelector() {
|
this.$refs.billList.showPopup()
|
},
|
// 接收源单
|
handleSourceBill(e) {
|
console.log('e: ', e);
|
|
this.hform.HSourceBillNo = e.HBillNo
|
this.GetMessageByHSourceBillNo(e.HBillNo)
|
this.$refs.billList.exit()
|
},
|
// 条码删除
|
async delMater(item) {
|
uni.showModal({
|
title: '提示',
|
content: '确认要删除 " ' + item.物料名称 + ' " 所有扫码记录?删除后将不可恢复!',
|
success: async (res) => {
|
if (res.confirm) {
|
try {
|
let res = await CommonUtils.doRequest2Async({
|
url: "/WEBSController/set_DelPonderationBillMain_Temp_InterIDAndSource_Json",
|
data: {
|
"HInterID": this.hform.HInterID,
|
"HMaterID": item.HMaterID,
|
"HAuxPropID": item.HAuxPropID,
|
"HMTONo": item.HMTONo,
|
"HSourceInterID": item.HSourceInterID,
|
"HSourceEntryID": item.HSourceEntryID,
|
"HBillType": this.hform.HBillType
|
},
|
})
|
|
let {
|
count,
|
Message
|
} = res.data
|
|
if (count == 1) {
|
this.DisBillEntryList()
|
} else {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: `删除条码错误: ${Message}`
|
})
|
}
|
} catch (err) {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: `删除条码错误: ${err}`
|
})
|
}
|
}
|
}
|
});
|
},
|
// 器具删除
|
async delMould(item) {
|
uni.showModal({
|
title: '提示',
|
content: '确认要删除 " ' + item.器具名称 + ' " 所有扫码记录?删除后将不可恢复!',
|
success: async (res) => {
|
if (res.confirm) {
|
try {
|
let res = await CommonUtils.doRequest2Async({
|
url: "/MouldController/set_DelMouldStockBillMain_Temp_Json",
|
data: {
|
"HInterID": this.hform.HInterID,
|
"HBillType": this.hform.HBillType,
|
"HBarCode": item.HMouldBarCode
|
},
|
})
|
|
let {
|
count,
|
Message
|
} = res.data
|
|
if (count == 1) {
|
this.DisBillEntryList()
|
} else {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: `删除条码错误: ${Message}`
|
})
|
}
|
} catch (err) {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: `删除条码错误: ${err}`
|
})
|
}
|
}
|
}
|
});
|
},
|
// 扫描条码
|
qrCodeDisplay(type) {
|
MpaasScan.scanCode(res => {
|
if (!res) {
|
return
|
}
|
switch (type) {
|
// 扫描传票
|
case "HCP":
|
this.hform.HCP = res;
|
break;
|
// 扫描二维码
|
case "BarCode":
|
this.hform.HBarCode = res
|
this.GetMessageByBarCode();
|
break;
|
}
|
})
|
|
},
|
// 获取仓库信息
|
async getRelationStore() {
|
let {
|
data,
|
count
|
} = await getUserStockRelation()
|
if (count == 1) {
|
let WHIDList = []
|
|
Array.from(data).forEach(elem => {
|
WHIDList.push(elem.HItemID)
|
})
|
|
let sWhere = ` and HItemID in (${WHIDList.join(",")})`
|
this.getHBaseList({
|
sWhere: sWhere
|
})
|
|
} else {
|
this.getHBaseList()
|
}
|
},
|
// 调入仓库资料
|
getHWarehouseInList(Organizaiton) {
|
Organizaiton = Organizaiton || uni.getStorageSync("Organization")
|
CommonUtils.doRequest2({
|
url: '/Gy_Warehouse/list',
|
data: {
|
sWhere: "",
|
user: uni.getStorageSync('HUserName'),
|
Organization: Organizaiton
|
},
|
resFunction: (res) => {
|
console.log('调入仓库 res: ', res.data.data);
|
if (res.data.count == 1) {
|
this.HWHInNameList = []
|
this.arrayHWHInName = []
|
|
this.HWHInNameList = res.data.data
|
for (var i = 0; i < res.data.data.length; i++) {
|
this.arrayHWHInName[i] = res.data.data[i].仓库名称
|
}
|
|
this.HWHInNameChange(getUserInfo()["HSCWHName"])
|
} else {
|
uni.showToast({
|
title: '仓库数据请求失败',
|
icon: 'none'
|
})
|
}
|
}
|
});
|
},
|
//基础仓库资料
|
async getHBaseList({
|
sWhere = ''
|
} = {}) {
|
try {
|
let res = await CommonUtils.doRequest2Async({
|
url: "/Gy_Warehouse/list",
|
data: {
|
sWhere: sWhere,
|
user: uni.getStorageSync('HUserName'),
|
Organization: uni.getStorageSync('Organization')
|
},
|
})
|
|
let {
|
data,
|
count,
|
Message
|
} = res.data
|
if (count == 1) {
|
console.log('data: ', data);
|
this.HWHNameList = data
|
for (var i = 0; i < data.length; i++) {
|
this.arrayHWHName[i] = data[i].仓库名称
|
}
|
this.HWHNameChange(getUserInfo()["HWhName"])
|
// this.HStockPlaceNameChange(res.data.data[0].仓库名称)
|
} else {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: `获取仓库失败: ${Message}`
|
})
|
}
|
} catch (err) {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: `获取仓库失败: ${err}`
|
})
|
}
|
|
},
|
//选择仓库
|
HWHNameChange(e) {
|
// var name = e.split("(")
|
for (var i = 0; i < this.HWHNameList.length; i++) {
|
if (this.HWHNameList[i].仓库名称 == e) {
|
this.hform.HWHName = this.HWHNameList[i].仓库名称
|
this.hform.HWHID = this.HWHNameList[i].HItemID
|
this.HStockPlaceNameChange(null)
|
this.showHStockPlaceName = false
|
if (this.HWHNameList[i]['启用仓位'] == 'Y') {
|
this.showHStockPlaceName = true
|
this.getStockPlaceRemote(this.HWHNameList[i]["HSPGroupID"])
|
}
|
}
|
}
|
},
|
HFIFOWHNameChange(e) {
|
// var name = e.split("(")
|
for (var i = 0; i < this.HWHNameList.length; i++) {
|
if (this.HWHNameList[i].仓库名称 == e) {
|
this.hform.HFIFOWHName = this.HWHNameList[i].仓库名称
|
this.hform.HFIFOWHID = this.HWHNameList[i].HItemID
|
}
|
}
|
},
|
// 获取仓位
|
async getStockPlaceRemote(HSPGroupID, Mode) {
|
// Mode=1 -> 调入仓位数据获取; Mode=2 -> 调出仓位数据获取
|
console.log('Mode: ',Mode);
|
try {
|
let res = await CommonUtils.doRequest2Async({
|
url: '/Gy_StockPlace/list',
|
data: {
|
sWhere: ` and HSPGroupID = ${HSPGroupID}`,
|
user: uni.getStorageSync('HUserName'),
|
Organization: uni.getStorageSync('Organization')
|
},
|
})
|
|
if (res.data.count == 1) {
|
if (Mode == 1) {
|
this.HStockPlaceInNameList = res.data.data
|
for (var i = 0; i < res.data.data.length; i++) {
|
this.arrayHStockPlaceInName[i] = res.data.data[i].仓位名称
|
}
|
|
console.log('this.HStockPlaceInNameList: ',this.HStockPlaceInNameList);
|
return
|
}
|
if (Mode == 2) {
|
this.HStockPlaceNameList = res.data.data
|
for (var i = 0; i < res.data.data.length; i++) {
|
this.arrayHStockPlaceName[i] = res.data.data[i].仓位名称
|
}
|
return
|
}
|
|
} else {
|
uni.showToast({
|
title: '仓位数据请求失败',
|
icon: 'none'
|
})
|
}
|
|
} catch (err) {
|
uni.showToast({
|
title: '仓位数据请求失败',
|
icon: 'none'
|
})
|
}
|
},
|
//选择仓位
|
HStockPlaceNameChange(e) {
|
let index = this.HStockPlaceNameList.findIndex(elem => elem['仓位名称'] == e)
|
if (index != -1) {
|
this.hform.HStockPlaceName = this.HStockPlaceNameList[index].仓位名称
|
this.hform.HStockPlaceID = this.HStockPlaceNameList[index].HMainID
|
} else {
|
this.hform.HStockPlaceName = ''
|
this.hform.HStockPlaceID = 0
|
}
|
},
|
// 扫描仓位码
|
async HStockPlaceNameScan(e) {
|
// 扫描仓位码
|
// 不先置空的话,数据再次扫描相同的仓位码 不会触发组件内的刷新
|
this.hform.HStockPlaceID = 0
|
this.hform.HStockPlaceName = ''
|
try {
|
let res = await CommonUtils.doRequest2Async({
|
url: '/Gy_StockPlace/list',
|
data: {
|
sWhere: ` and 条码编号 = '${e}'`,
|
user: uni.getStorageSync('HUserName'),
|
Organization: uni.getStorageSync('Organization')
|
},
|
})
|
|
if (res.data.count == 1) {
|
|
this.hform.HStockPlaceID = res.data.data[0].HMainID
|
this.hform.HStockPlaceName = res.data.data[0].仓位名称
|
this.hform.HWHID = res.data.data[0].HWHID
|
this.hform.HWHName = res.data.data[0].所属仓库
|
} else {
|
uni.showToast({
|
title: '仓位数据请求失败',
|
icon: 'none'
|
})
|
}
|
|
} catch (err) {
|
uni.showToast({
|
title: '仓位数据请求失败',
|
icon: 'none'
|
})
|
}
|
},
|
// 显示源单单据列表弹窗
|
showBillList() {
|
this.$refs.billList.showPopup()
|
},
|
|
// 选择源单类型
|
HMainSourceBillTypeChange(e) {
|
if (e.detail.value == -1 || e.detail.value == NaN) {
|
this.HMainSourceBillType = '手工录入'
|
this.hform.HMainSourceBillType = '手工录入'
|
return
|
}
|
|
this.HMainSourceBillType = this.arrayHMainSourceBillType[e.detail.value]
|
this.hform.HMainSourceBillType = this.arrayHMainSourceBillTypeID[e.detail.value]
|
|
// 缓存当前页面选择
|
const pages = getCurrentPages()
|
const currentPage = pages[pages.length - 1]
|
uni.setStorageSync(`${currentPage.route.split("/").pop()}_HSourceBillTypeCache`, {
|
HSourceBillTypeName: this.HMainSourceBillType,
|
HSourceBillType: this.hform.HMainSourceBillType
|
})
|
},
|
|
// 读取缓存
|
loadCache() {
|
const pages = getCurrentPages()
|
const currentPage = pages[pages.length - 1]
|
let HBillTypeCache = uni.getStorageSync(`${currentPage.route.split("/").pop()}_HSourceBillTypeCache`)
|
if (HBillTypeCache) {
|
this.HMainSourceBillType = HBillTypeCache.HSourceBillTypeName
|
this.hform.HMainSourceBillType = HBillTypeCache.HSourceBillType
|
}
|
},
|
|
// 维修项目
|
async getRepairList() {
|
try {
|
let res = await CommonUtils.doRequest2Async({
|
url: '/Gy_Repair/GetRepairList',
|
data: {
|
sWhere: '',
|
user: getUserInfo()["Czymc"]
|
}
|
})
|
|
let {
|
data,
|
count,
|
Message
|
} = res.data
|
if (count == 1) {
|
this.HRepairList = data
|
} else {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: `获取维修项目失败: ${Message}`
|
})
|
}
|
} catch (err) {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: `获取维修项目失败: ${err}`
|
})
|
}
|
},
|
// 删除明细
|
delDetail(item) {
|
|
},
|
// 提交数据有效性校验
|
ValidCheck() {
|
if (this.hform.HEquipID == 0) {
|
return {
|
Message: "未录入设备信息,请先录入设备信息!",
|
state: false
|
}
|
}
|
if (this.hform.HDeptID == 0) {
|
return {
|
Message: "部门不得为空!",
|
state: false
|
}
|
}
|
if (this.hform.HEmpID == 0) {
|
return {
|
Message: "验收人不得为空!",
|
state: false
|
}
|
}
|
if (this.hform.HRepairCheckMainID == 0) {
|
return {
|
Message: "维修项目不得为空!",
|
state: false
|
}
|
}
|
if (this.hform.HManagerID == 0) {
|
return {
|
Message: "负责人不得为空!",
|
state: false
|
}
|
}
|
if (this.hform.HMainSourceBillType !== '手工录入') {
|
if (!this.hform.HSourceBillNo || this.hform.HSourceBillNo.trim() === '') {
|
CommonUtils.showTips({
|
message: '源单类型非手工录入,必须选择源单!'
|
})
|
return
|
}
|
}
|
return {
|
Message: "",
|
state: true
|
}
|
},
|
addNew() {
|
uni.redirectTo({
|
url: './Kf_SellOutBill_CusBar_APP?operationType=1'
|
})
|
},
|
goBack() {
|
uni.navigateBack()
|
},
|
checkBoxChangeHandler(index, e) {
|
let cr = e.detail.value
|
if (cr.length == 0) {
|
this.HCheckFileList[index]["HDotCheckResult"] = false
|
} else {
|
this.HCheckFileList[index]["HDotCheckResult"] = true
|
}
|
},
|
uploadFile(index) {
|
console.log('filePath: ', this.attachmentInfo[index].filePath);
|
// 通过临时路径读取文件
|
uni.uploadFile({
|
url: CommonUtils.getServerUrl() + "/Sb_EquipDotCheckBill/UploadFile",
|
filePath: this.attachmentInfo[index].filePath,
|
name: 'file',
|
formData: {
|
HBillNo: this.hform.HBillNo,
|
HRemark: "",
|
HUserName: getUserInfo()["Czymc"]
|
},
|
success: (uploadRes) => {
|
CommonUtils.showTips({
|
message: "上传成功"
|
})
|
this.attachmentInfo[index].status = "上传成功"
|
},
|
fail: (err) => {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: `上传失败: ${err}`
|
})
|
}
|
})
|
},
|
delFile(index) {
|
console.log('attachmentInfo: ', this.attachmentInfo[index]);
|
uni.showModal({
|
title: '提示',
|
content: '确认要删除 " ' + this.attachmentInfo[index].fileName + ' " 删除后将不可恢复!',
|
success: (res) => {
|
if (res.confirm) {
|
this.attachmentInfo.splice(index, 1)
|
}
|
},
|
})
|
|
},
|
handleUploadCallback(res) { // 文件上传回调
|
console.log('file: ', res);
|
let fileInfo = res.data[0]
|
this.attachmentInfo.push({
|
fileName: fileInfo.name,
|
size: fileInfo.size,
|
status: '等待上传',
|
filePath: fileInfo.tempFilePath
|
})
|
},
|
// 上传文件
|
fileUpload() {
|
this.$refs.XeUpload.upload('file', {});
|
},
|
//获取班次数据
|
async getShiftList() {
|
try {
|
let res = await CommonUtils.doRequest2Async({
|
url: '/Web/GetGy_ShiftsList_Json',
|
data: {
|
Shifts: "",
|
}
|
})
|
|
let {
|
data,
|
count,
|
Message
|
} = res.data
|
if (count == 1) {
|
this.HShiftsList = data
|
} else {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: Message
|
})
|
}
|
} catch (err) {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: err
|
})
|
}
|
},
|
//获取使用部门数据
|
async getHDeptList() {
|
try {
|
let res = await CommonUtils.doRequest2Async({
|
url: '/Gy_Department/list',
|
data: {
|
sWhere: ` and HUSEORGID = ${uni.getStorageSync('OrganizationID')} `,
|
user: uni.getStorageSync('HUserName'),
|
Organization: uni.getStorageSync('Organization')
|
}
|
})
|
|
let {
|
data,
|
count,
|
Message
|
} = res.data
|
if (count == 1) {
|
this.HDeptList = data
|
} else {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: Message
|
})
|
}
|
} catch (err) {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: err
|
})
|
}
|
},
|
// 获取职员数据
|
async getEmpList() {
|
try {
|
let res = await CommonUtils.doRequest2Async({
|
url: '/PublicPageMethod/UserList',
|
data: {
|
sWhere: " where 1=1",
|
}
|
})
|
|
let {
|
data,
|
count,
|
Message
|
} = res.data
|
if (count == 1) {
|
this.HEmpList = data
|
} else {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: Message
|
})
|
}
|
} catch (err) {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: err
|
})
|
}
|
},
|
// 获取验证项目数据
|
async getCheckProjList() {
|
try {
|
let res = await CommonUtils.doRequest2Async({
|
url: '/Gy_RepairCheck/GetRepairCheckList',
|
data: {
|
sWhere: "",
|
user: uni.getStorageSync('HUserName'),
|
}
|
})
|
|
let {
|
data,
|
count,
|
Message
|
} = res.data
|
if (count == 1) {
|
this.HRepairCheckList = data
|
} else {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: Message
|
})
|
}
|
} catch (err) {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: err
|
})
|
}
|
},
|
async getBarCodeJson(sBarCode, sBarCodePrefix) {
|
// if (!this.hform.HQty) {
|
// this.hform.HQty = 0
|
// }
|
console.log('this.hform.HQty: ', this.hform.HQty);
|
try {
|
let res = await CommonUtils.doRequest2Sync({
|
url: '/WEBSController/get_BarCode_MoveStock_New_Json',
|
data: {
|
sBarCode: sBarCode,
|
HInterID: this.hform.HInterID,
|
HBillType: this.hform.HBillType,
|
HBillNo: this.hform.HBillNo,
|
HMaker: this.hform.HMaker,
|
HWhID: this.hform.HWHID,
|
HSPID: this.hform.HStockPlaceID,
|
HQty: this.hform.HQty || 0,
|
HRedBlueFlag: this.hform.HRedBlueFlag,
|
SourceFlag: this.hform.HSourceFlag,
|
HSourceBillNo: this.hform.HSourceBillNo,
|
HSourceBillType: this.hform.HMainSourceBillType,
|
HStockInOrgID: this.hform.HStockInOrgID,
|
HStockOutOrgID: this.hform.HStockOutOrgID,
|
HSCWHID: this.hform.HSCWHID,
|
HSCSPID: this.hform.HOutStockPlaceID,
|
HScanStyle: "",
|
HCustom1: "1",
|
HCustom2: ""
|
},
|
})
|
if (!res) {
|
return
|
}
|
console.log('扫码返回', res.data);
|
this.hform.HBarCode = ''
|
if (res.data.count == 1) {
|
CommonUtils.playSound(1)
|
var data = res.data.data
|
if (data.hBarTypeField == '仓库条码') {
|
this.hform.HWHName = data.hWhNameField
|
this.hform.HWHID = data.hWhIDField
|
this.hform.HStockPlaceName = ''
|
this.hform.HStockPlaceID = 0
|
if (data.hSPFlagField == 0) {
|
this.showHStockPlaceName = false
|
} else {
|
this.showHStockPlaceName = true
|
}
|
} else if (data.hBarTypeField == '仓位条码') {
|
this.hform.HWHName = data.hWhNameField
|
this.hform.HWHID = data.hWhIDField
|
this.hform.HStockPlaceName = data.hSPNameField
|
this.hform.HStockPlaceID = data.hSPIDField
|
} else if (data.hBarTypeField == '部门条码') {
|
this.hform.HDeptName = data.hDeptNameField
|
this.hform.HDeptID = data.hDeptIDField
|
this.tabs = 1
|
} else if (data.hBarTypeField == '源单条码') {
|
this.hform.HSupName = data.hSupNameField
|
this.hform.HSupID = data.hSupIDField
|
if (data.hDeptIDField != 0) {
|
this.hform.HDeptID = data.hDeptIDField
|
this.hform.HDeptName = data.hDeptNameField
|
}
|
this.hform.HSourceBillNo = data.hSourceBillNoField
|
//获取源单类型、源单单号
|
this.hform.HMainSourceBillType = data.hSourceBillTypeField
|
if (data.hSourceBillTypeField == "1402") {
|
this.HMainSourceBillType = '发货通知单'
|
this.hform.HMainSourceBillType = 1402
|
this.showHMainSourceBillType = false
|
} else if (data.hSourceBillTypeField == "1401") {
|
this.HMainSourceBillType = '销售订单'
|
this.hform.HMainSourceBillType = 1401
|
this.showHMainSourceBillType = false
|
} else {
|
this.HMainSourceBillType = '手工录入'
|
this.hform.HMainSourceBillType = -1
|
this.showHMainSourceBillType = false
|
}
|
if (data.hMulSourceFlagField == 0) {
|
this.showHSourceBillNo = false
|
}
|
//客户不可编辑
|
this.showHSupName = false
|
this.tabs = 2
|
} else { //物料条码
|
this.materMeta.push(data)
|
this.tabs = 2
|
if (!this.hform.HSourceBillNo) {
|
this.hform.HSupName = data.hSupNameField
|
this.hform.HSupID = data.hSupIDField
|
this.hform.HSourceBillNo = data.hSourceBillNoField
|
if (data.hDeptIDField != 0) {
|
this.hform.HDeptID = data.hDeptIDField
|
this.hform.HDeptName = data.hDeptNameField
|
}
|
console.log('物料条码', data)
|
//获取源单类型、源单单号 无源单类型视为手工录入
|
this.hform.HMainSourceBillType = data.hSourceBillTypeField || -1
|
|
let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
|
.hSourceBillTypeField)
|
if (index != -1) {
|
this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
|
this.hform.HMainSourceBillType = data.hSourceBillTypeField
|
this.showHMainSourceBillType = false
|
}
|
// if (data.hSourceBillTypeField == "1103") {
|
// this.HMainSourceBillType = '收料通知单'
|
// this.hform.HMainSourceBillType = 1103
|
// this.showHMainSourceBillType = false
|
// } else if (data.hSourceBillTypeField == "1102") {
|
// this.HMainSourceBillType = '采购订单'
|
// this.hform.HMainSourceBillType = 1102
|
// this.showHMainSourceBillType = false
|
// } else {
|
// this.HMainSourceBillType = '手工录入'
|
// this.hform.HMainSourceBillType = -1
|
// this.showHMainSourceBillType = false
|
// }
|
if (data.hMulSourceFlagField == 0) {
|
this.showHSourceBillNo = false
|
}
|
//供应商不可编辑
|
this.showHSupName = false
|
}
|
}
|
//显示表体明细
|
this.DisBillEntryList(sBarCodePrefix)
|
//清空数量
|
this.hform.HQty = ''
|
} else {
|
CommonUtils.playSound(0)
|
// this.refreshBarCodeState()
|
uni.showToast({
|
title: res.data.Message,
|
icon: 'none'
|
})
|
}
|
} catch (err) {
|
CommonUtils.playSound(0)
|
// this.refreshBarCodeState()
|
uni.showToast({
|
title: '接口请求失败: ' + err,
|
icon: 'none'
|
})
|
}
|
|
},
|
toScanHSourceBillNo() {
|
MpaasScan.scanCode(cb => {
|
this.hfrom.HSourceBillNo = cb
|
this.GetMessageByHSourceBillNo(cb)
|
})
|
},
|
async GetMessageByHSourceBillNo(HSouceBillNo) {
|
try {
|
let res = await CommonUtils.doRequest2Async({
|
url: "/WEBSController/get_SourceBarCode_SellOut_Json",
|
data: {
|
"HInterID": this.hform.HInterID,
|
"HBillNo": this.hform.HBillNo,
|
"HBillType": this.hform.HBillType,
|
"HSourceBillNo": this.hform.HSourceBillNo,
|
"HSourceBillType": this.hform.HMainSourceBillType,
|
"HMaker": this.hform.HMaker,
|
"HFIFOWhID": this.hform.HFIFOWHID,
|
"HOWNERID": this.hform.HStockOrgID
|
},
|
|
})
|
|
let {
|
count,
|
Message,
|
data
|
} = res.data
|
if (count == 1) {
|
CommonUtils.playSound(1)
|
this.hform.HSourceFlag = true
|
this.hform.HSupName = data.hSupNameField
|
this.hform.HSupID = data.hSupIDField
|
|
if (data.hDeptIDField != 0) {
|
this.hform.HDeptID = data.hDeptIDField
|
this.hform.HDeptName = data.hDeptNameField
|
}
|
// this.tabs = 2
|
this.hform.HSourceBillNo = data.hSourceBillNoField
|
this.DisBillEntryList()
|
} else {
|
CommonUtils.playSound(0)
|
CommonUtils.showTips({
|
title: "温馨提示",
|
message: `获取源单单号失败: ${Message}`
|
})
|
}
|
} catch (err) {
|
CommonUtils.showTips({
|
title: "温馨提示",
|
message: `获取源单单号失败: ${err}`
|
})
|
}
|
},
|
async GetMessageByBarCode(HBarCode) {
|
if (this.hform.HWHName == '') {
|
this.hform.HWHID = "0"
|
}
|
if (this.hform.HStockPlaceName == '') {
|
this.hform.HStockPlaceID = "0"
|
}
|
if (this.hform.HSupName == '') {
|
this.hform.HSupID = "0"
|
}
|
if(this.hform.HOutStockPlaceName == '') {
|
this.hform.HOutStockPlaceID = "0"
|
}
|
|
console.log('HQty: ', this.hform.HQty);
|
let sOldBarCode = this.hform.HBarCode
|
let HDeleteFlag = sOldBarCode.substring(0, 1);
|
let sBarCode = sOldBarCode.slice(1);
|
let sHWHID = this.hform.HWHID
|
let sHSPID = this.hform.HStockPlaceID
|
let sHQty = this.hform.HQty
|
let sSourceBillNo = this.hform.HSourceBillNo
|
let sSourceBillType = this.hform.HMainSourceBillType
|
let sHCusID = this.hform.HSupID
|
let sHCP = this.hform.HCP
|
if (HDeleteFlag == "*") {
|
if (sBarCode == "") {
|
CommonUtils.playSound(0)
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: "请扫描要删除的条码"
|
})
|
} else {
|
this.hform.HBarCode = ""
|
}
|
|
try {
|
let res = await CommonUtils.doRequest2Async({
|
url: '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json',
|
data: {
|
"HInterID": this.hform.HInterID,
|
"HBillType": this.hform.HBillType,
|
"HBarCode": sBarCode
|
}
|
})
|
|
let {
|
data,
|
count,
|
Message
|
} = res.data
|
if (count == 1) {
|
CommonUtils.playSound(1)
|
this.hform.HQty = ""
|
|
} else {
|
CommonUtils.playSound(0)
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: `错误: ${Message}`
|
})
|
}
|
} catch (err) {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: `错误: ${err}`
|
})
|
}
|
} else {
|
sBarCode = this.hform.HBarCode
|
if (sBarCode == '') {
|
CommonUtils.playSound(0)
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: `条码为空, 请扫描条码!`
|
})
|
return
|
}
|
let sBarCodePrefix = sBarCode.substr(0, 3)
|
if (sBarCodePrefix != 'PAK') {
|
if (sHCusID == 0) {
|
CommonUtils.playSound(0)
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: `缺少客户信息,请先扫描源单条码!`
|
})
|
this.tabs = 0
|
return
|
}
|
if (sHCP == '') {
|
CommonUtils.playSound(0)
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: `传票号不能为空,请先扫描传票号!`
|
})
|
return
|
}
|
|
//根据客户、传票、条码进行验证
|
this.getChechBarCodeAndCPJSON(sHCusID, sHCP, sBarCode, sBarCodePrefix)
|
} else {
|
this.getBarCodeJson(sBarCode, sBarCodePrefix)
|
// this.DisBillEntryList(sBarCodePrefix)
|
}
|
}
|
},
|
// 根据客户 传票 条码进行验证
|
async getChechBarCodeAndCPJSON(sHCusID, sHCP, sBarCode, sBarCodePrefix) {
|
try {
|
let res = await CommonUtils.doRequest2Async({
|
url: '/WEBSController/GetCheakBarCodeAndCP_Json',
|
data: {
|
"HCusID": sHCusID,
|
"HCP": sHCP,
|
"HBarCode": sBarCode
|
}
|
})
|
|
let {
|
count,
|
Message
|
} = res.data
|
if (count == 1) {
|
CommonUtils.playSound(1)
|
|
// this.DisBillEntryList()
|
this.getBarCodeJson(sBarCode, sBarCodePrefix)
|
} else {
|
CommonUtils.playSound(0)
|
CommonUtils.showTips({
|
title: "温馨提示",
|
message: '接口请求失败: ' + Message
|
})
|
}
|
} catch (err) {
|
CommonUtils.playSound(0)
|
console.log(err);
|
CommonUtils.showTips({
|
title: "温馨提示",
|
message: '接口请求失败: ' + err
|
})
|
}
|
},
|
//物料信息
|
async DisBillEntryList(sBarCodePrefix) {
|
try {
|
|
let res = await CommonUtils.doRequest2Async({
|
url: '/WEBSController/GetBillEntryTmpList_Json',
|
data: {
|
HInterID: this.hform.HInterID,
|
HBillNo: this.hform.HBillNo,
|
HBillType: this.hform.HBillType,
|
HStockOrgID: this.hform.HStockOrgID
|
}
|
})
|
|
console.log('物料', res.data)
|
if (res.data.count == 1) {
|
var data = res.data.data
|
this.materMeta = data.BarCodeDetailslist
|
this.HMaterList = data.Materlist
|
this.HMouldList = data.Mouldlist
|
|
if (data.FIFOlist.length != 0) {
|
if (data.FIFOlist[0].HMaterID != 0) {
|
this.FIFOlist = data.FIFOlist
|
}
|
}
|
|
// 根据是否是箱条码配置仓位信息
|
if (sBarCodePrefix == 'PAK') {
|
this.hform.HStockPlaceName = ''
|
this.hform.HStockPlaceID = 0
|
} else {
|
this.hform.HStockPlaceName = data.hSPNameField || ''
|
this.hform.HStockPlaceID = data.hSPIDField || 0
|
}
|
if (!data.BarCodeDetailslist[0].HBarCode) {
|
this.hform.HMaterName_B = ''
|
this.hform.HMaterModel_B = ''
|
this.hform.HBatchNo_B = ''
|
this.hform.HUnitName_B = ''
|
this.hform.HQty_B = ''
|
this.hform.HTMQty_B = ''
|
this.hform.HWHName_B = ''
|
this.hform.HSPName_B = ''
|
this.hform.HSCWHName_B = ''
|
this.hform.HSCSPName_B = ''
|
} else {
|
this.hform.HBarCode_B = data.BarCodeDetailslist[0].HBarCode
|
this.hform.HMaterName_B = data.BarCodeDetailslist[0].HMaterName
|
this.hform.HMaterModel_B = data.BarCodeDetailslist[0].HMaterModel
|
this.hform.HBatchNo_B = data.BarCodeDetailslist[0].HBatchNo
|
this.hform.HUnitName_B = data.BarCodeDetailslist[0].HUnitName
|
this.hform.HQty_B = data.BarCodeDetailslist[0].HQty
|
this.hform.HTMQty_B = data.BarCodeDetailslist[0].HTMQty
|
this.hform.HWHName_B = data.BarCodeDetailslist[0].HWHName
|
this.hform.HSPName_B = data.BarCodeDetailslist[0].HSPName
|
this.hform.HSCWHName_B = data.BarCodeDetailslist[0].HSCWHName
|
this.hform.HSCSPName_B = data.BarCodeDetailslist[0].HSCSPName
|
}
|
|
this.tabs = 2
|
} else {
|
CommonUtils.showTips({
|
title: "温馨提示",
|
message: `扫描条码失败: ${res.data.Message}`
|
})
|
}
|
} catch (err) {
|
CommonUtils.showTips({
|
title: "温馨提示",
|
message: `扫描条码失败: ${err}`
|
})
|
}
|
},
|
radioChange({
|
detail: {
|
value
|
}
|
}) {
|
this.hform.HCheckResult = value
|
},
|
// 获取最大单据号
|
async getMaxNum() {
|
try {
|
let res = await CommonUtils.doRequest2Async({
|
url: "/WEBSController/GetMaxBillNoAndID_Json",
|
data: {
|
"HBillType": this.hform.HBillType
|
}
|
})
|
let {
|
count,
|
data,
|
Message
|
} = res.data
|
this.hform.HInterID = data[0]['HInterID']
|
this.hform.HBillNo = data[0]["HBillNo"]
|
|
} catch (err) {
|
CommonUtils.showTips({
|
title: "温馨提示",
|
message: "获取单据信息异常: " + err
|
})
|
}
|
},
|
async submit() {
|
let valid = this.ValidCheck()
|
if (!valid.state) {
|
CommonUtils.showTips({
|
message: valid.Message
|
})
|
return
|
}
|
|
try {
|
console.log('HStockPlaceID: ', this.hform.HStockPlaceID);
|
let oMain = JSON.stringify(this.hform)
|
console.log('oMain: ', oMain);
|
let res = await CommonUtils.doRequest2Sync({
|
url: "/WEBSController/set_SaveMoveStockBill_Json",
|
data: {
|
"oMain": oMain
|
},
|
method: "POST"
|
})
|
|
if (!res) {
|
return
|
}
|
|
let {
|
count,
|
Message
|
} = res.data
|
if (count == 1) {
|
if (this.operationType == 4) {
|
uni.showModal({
|
title: '提示',
|
content: res.data.Message + '。即将返回上级页面',
|
showCancel: false,
|
success: (res) => {
|
if (res.confirm) {
|
console.log('用户点击确定');
|
setTimeout(() => {
|
uni.navigateBack();
|
}, 50)
|
// uni.redirectTo({
|
// url: './Sb_EquipRepairSendWorkBill?operationType=1'
|
// })
|
} else if (res.cancel) {
|
console.log('用户点击取消');
|
setTimeout(() => {
|
uni.navigateBack();
|
}, 50)
|
}
|
}
|
});
|
return
|
}
|
uni.showModal({
|
title: '提示',
|
content: res.data.Message + '。是否继续新增?(点击取消返回上级页面)',
|
success: (res) => {
|
if (res.confirm) {
|
console.log('用户点击确定');
|
uni.redirectTo({
|
url: './Kf_SellOutBill_CusBar_APP?operationType=1'
|
})
|
} else if (res.cancel) {
|
console.log('用户点击取消');
|
setTimeout(() => {
|
uni.navigateBack();
|
}, 50)
|
}
|
}
|
});
|
} else {
|
CommonUtils.showTips({
|
title: "温馨提示",
|
message: "提交单据失败: " + Message
|
})
|
}
|
|
|
} catch (err) {
|
CommonUtils.showTips({
|
title: "温馨提示",
|
message: "提交单据失败: " + err
|
})
|
}
|
},
|
async getEquipFileMain(HInterID) {
|
try {
|
let res = await CommonUtils.doRequest2Sync({
|
url: "/Sb_PDA_EquipDotCheckBill/txtHBarCode_KeyDown_ListByHEquipID",
|
data: {
|
HEquipID: HInterID,
|
},
|
})
|
|
|
if (!res) {
|
return
|
}
|
|
let {
|
data,
|
count,
|
Message
|
} = res.data
|
|
if (count == 1) {
|
console.log('data: ', data);
|
this.hform.HEquipID = data[0].hmainid
|
this.hform.HBarName = data[0].设备名称
|
this.hform.HBarSpec = data[0].设备规格
|
this.hform.HBarModel = data[0].设备型号
|
this.hform.HQty = 1
|
|
this.enableEdit = false
|
} else {
|
CommonUtils.showTips({
|
title: "温馨提示",
|
message: Message
|
})
|
}
|
|
} catch (err) {
|
CommonUtils.showTips({
|
title: "温馨提示",
|
message: err
|
})
|
}
|
},
|
async getSourceBillInfo(HSourceBillType, HInterID, HBillNo) {
|
// 下推单据类型为设备故障登记单
|
if (HSourceBillType == 3907) {
|
let res = await CommonUtils.doRequest2Async({
|
url: "/Sb_EqpRepairWorkBill/Sb_EqpConkBookBillListCheckDetai",
|
data: {
|
HID: HInterID
|
}
|
})
|
|
let {
|
data,
|
code,
|
count,
|
Message
|
} = res.data
|
|
if (code == 1) {
|
console.log('data: ', data.h_v_Sb_EquipConkBookBillList_Edit);
|
let data1 = data.h_v_Sb_EquipConkBookBillList_Edit[0]
|
this.hform.HMainSourceBillType = HSourceBillType
|
this.HMainSourceBillType = '设备故障登记单'
|
this.hform.HSourceBillNo = data1.单据号
|
this.hform.HMainSourceInterID = data1.hmainid
|
this.hform.HMainSourceEntryID = data1.hsubid
|
this.hform.HEquipID = data1.HEquipID
|
this.hform.HManagerName = data1.负责人
|
this.hform.HManagerID = data1.HManagerID
|
this.hform.HBarName = data1.设备名称
|
this.hform.HBarModel = data1.设备型号
|
this.hform.HBarSpec = data1.设备规格
|
} else {
|
CommonUtils.showTips({
|
title: '温馨提示',
|
message: `获取源单失败: ${Message}`
|
})
|
}
|
}
|
}
|
},
|
onLoad(e) {
|
if (!e.operationType) {
|
this.operationType = 1
|
} else {
|
this.operationType = e.operationType
|
}
|
|
if (this.operationType == 1) {
|
// 新增
|
this.getMaxNum()
|
} else if (this.operationType == 2) {
|
// 复制
|
} else if (this.operationType == 3) {
|
// 编辑
|
|
} else if (this.operationType == 4) {
|
// 由报工平台打开
|
let HEquipID = e.HEquipID
|
this.getMaxNum()
|
this.getEquipFileMain(HEquipID)
|
} else if (this.operationType == 5) {
|
let {
|
HSourceBillType,
|
HInterID,
|
HBillNo
|
} = e
|
// 下推
|
this.getMaxNum()
|
this.getSourceBillInfo(HSourceBillType, HInterID, HBillNo)
|
}
|
|
this.getHWarehouseInList()
|
this.getHDeptList()
|
this.getEmpList()
|
this.getRelationStore()
|
this.set_InitBillSubType()
|
this.loadCache()
|
},
|
onUnload() {
|
// uni.$off('BillSelectComplete')
|
},
|
onReady() {
|
const query = uni.createSelectorQuery().in(this)
|
query.select("#buttons")
|
.boundingClientRect()
|
.select("#tabs")
|
.boundingClientRect()
|
.exec(res => {
|
this.btnTop = Math.floor(res[0].top)
|
this.tabsBottom = Math.ceil(res[1].bottom)
|
})
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
@import "@/pages/MJGL/style/MJBillStyle.scss";
|
|
.left {
|
width: 4em;
|
}
|
|
.picker-overlay {
|
position: absolute;
|
top: 0;
|
left: 0;
|
right: 0;
|
bottom: 0;
|
z-index: 1;
|
}
|
|
.horizon_tabs {
|
width: 100%;
|
overflow-x: auto;
|
}
|
</style>
|