<template>
|
<view>
|
<view class="form">
|
<view class="form-item">
|
<view class="title"><text>*</text>条形码:</view>
|
<view class="right" style="width: 380rpx;">
|
<input name="HBarCode" v-model="hform.HBarCode" placeholder="请扫描条码"/>
|
</view>
|
<uni-icons type="scan" style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;" size="20" @click="toScanCode(0)"></uni-icons>
|
</view>
|
<view class="form-item">
|
<view class="title"><text>*</text>配件条形码:</view>
|
<view class="right" style="width: 380rpx;">
|
<input name="HBarCode_Mater" v-model="hform.HBarCode_Mater" placeholder="请扫描条码"/>
|
</view>
|
<uni-icons type="scan" style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;" size="20" @click="toScanCode(1)"></uni-icons>
|
</view>
|
|
<view class="tab_area"></view>
|
|
<view class="form-item" v-if="showHProcNo">
|
<view class="title"><text>*</text>流水号:</view>
|
<view class="right" style="width: 380rpx;">
|
<input name="HBarCode" v-model="hform.HProcNo" placeholder="请输入(或扫描)流水号" @confirm="getHProcNoData(hform.HBarCode,hform.HProcNo)"/>
|
</view>
|
<uni-icons type="scan" style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;" size="20" @click="toScanProcNo"></uni-icons>
|
</view>
|
<view class="form-item">
|
<view class="title"><text>*</text>当前工序:</view>
|
<view class="right">
|
<uni-combox :candidates="arrayHProcName" placeholder="请选择当前工序" v-model="hform.HProcName" @input="HProcNameChange"></uni-combox>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title"><text>*</text>接收数量:</view>
|
<view class="right">
|
<input v-model="hform.HQty" placeholder="请输入接收数量" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">生产资源:</view>
|
<view class="right">
|
<uni-combox :candidates="arrayHSourceName" placeholder="请选择生产资源" v-model="hform.HSourceName" @input="HSourceNameChange"></uni-combox>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title"><text>*</text>工作中心:</view>
|
<view class="right">
|
<uni-combox :candidates="arrayHCenterName" placeholder="请选择工作中心" v-model="hform.HCenterName" @input="HCenterNameChange"></uni-combox>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">生产班组:</view>
|
<view class="right">
|
<uni-combox :candidates="arrayHGroupName" placeholder="请选择生产班组" v-model="hform.HGroupName" @input="HGroupNameChange"></uni-combox>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title"><text>*</text>接收人:</view>
|
<view class="right">
|
<uni-combox :candidates="arrayHEmpName" placeholder="请选择接收人" v-model="hform.HEmpName" @input="HEmpNameChange"></uni-combox>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">备注:</view>
|
<view class="right">
|
<textarea name="HRemark" v-model="hform.HRemark" auto-height placeholder="请输入备注"></textarea>
|
</view>
|
</view>
|
|
<view class="tab_area"></view>
|
|
<view class="form-item">
|
<view class="title">单据号:</view>
|
<view class="righton">
|
<input name="HBillNo" disabled v-model="hform.HBillNo" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">单据日期:</view>
|
<view class="righton">
|
<input name="HDate" disabled v-model="hform.HDate" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">生产组织:</view>
|
<view class="righton">
|
<input v-model="hform.HPRDOrg" disabled />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">生产订单:</view>
|
<view class="righton">
|
<input name="HICMOBillNo" disabled v-model="hform.HICMOBillNo" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">订单数量:</view>
|
<view class="righton">
|
<input name="HICMOQty" disabled v-model="hform.HICMOQty" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">订单跟踪号:</view>
|
<view class="righton">
|
<input v-model="hform.HOrderProcNO" disabled />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">产品代码:</view>
|
<view class="righton">
|
<input disabled v-model="hform.HMaterNumber" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">产品名称:</view>
|
<view class="righton">
|
<input v-model="hform.HMaterName" disabled />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">规格型号:</view>
|
<view class="righton">
|
<input v-model="hform.HMaterModel" disabled />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">流转卡号:</view>
|
<view class="righton">
|
<input disabled v-model="hform.HProcExchBillNo" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">流转卡数量:</view>
|
<view class="righton">
|
<input disabled v-model="hform.HPlanQty" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">接收件数:</view>
|
<view class="righton">
|
<input disabled v-model="hform.HPieceQty" />
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">进站时间:</view>
|
<view class="righton">
|
<input disabled v-model="hform.HStationInTime" />
|
</view>
|
</view>
|
|
<view class="tab_area"></view>
|
|
<view v-if="showmore">
|
<view class="form-item">
|
<view class="title">制单人:</view>
|
<view class="righton">
|
<input v-model="hform.HMaker" disabled/>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">制单日期:</view>
|
<view class="righton">
|
<input v-if="hform.HMakeDate" v-model="hform.HMakeDate.substr(0,10)" disabled/>
|
<input v-else v-model="hform.HMakeDate" disabled/>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">修改人:</view>
|
<view class="righton">
|
<input v-model="hform.HUpDater" disabled/>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">修改日期:</view>
|
<view class="righton">
|
<input v-if="hform.HUpDateDate" v-model="hform.HUpDateDate.substr(0,10)" disabled/>
|
<input v-else v-model="hform.HUpDateDate" disabled/>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">审核人:</view>
|
<view class="righton">
|
<input v-model="hform.HChecker" disabled/>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">审核日期:</view>
|
<view class="righton">
|
<input v-if="hform.HCheckDate" v-model="hform.HCheckDate.substr(0,10)" disabled/>
|
<input v-else v-model="hform.HCheckDate" disabled/>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">作废人:</view>
|
<view class="righton">
|
<input v-model="hform.HCloseMan" disabled/>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">作废日期:</view>
|
<view class="righton">
|
<input v-if="hform.HCloseDate" v-model="hform.HCloseDate.substr(0,10)" disabled/>
|
<input v-else v-model="hform.HCloseDate" disabled/>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">作废人:</view>
|
<view class="righton">
|
<input v-model="hform.HDeleteMan" disabled/>
|
</view>
|
</view>
|
<view class="form-item">
|
<view class="title">作废日期:</view>
|
<view class="righton">
|
<input v-if="hform.HDeleteDate" v-model="hform.HDeleteDate.substr(0,10)" disabled/>
|
<input v-else v-model="hform.HDeleteDate" disabled/>
|
</view>
|
</view>
|
</view>
|
|
<view class="other">
|
<view v-if="!showmore" @tap="showmore = true">
|
展开其他信息<uni-icons color="#1890FF" style="margin-left: 8rpx;" type="bottom"></uni-icons>
|
</view>
|
<view v-if="showmore" @tap="showmore = false">
|
折叠其他信息<uni-icons color="#1890FF" style="margin-left: 8rpx;" type="top"></uni-icons>
|
</view>
|
</view>
|
|
<view class="bottom-btn">
|
<button v-if="btnType == 0 && !isEdit" class="btn-a" size="mini" @tap="submit">提交</button>
|
<button v-if="btnType != 0 && !isEdit" class="btn-a" size="mini" @tap="ifEdit">修改</button>
|
<button v-if="btnType != 0 && isEdit" class="btn-a" size="mini" @tap="submit">提交</button>
|
<button v-if="btnType != 0 && btnType == 2" class="btn-b" style="margin-left: 20rpx;" size="mini" @tap="check">审核</button>
|
<button v-if="btnType != 0 && btnType == 3" class="btn-d" style="margin-left: 20rpx;" size="mini" @tap="abandonCheck">反审核</button>
|
<!-- <button class="btn-b" size="mini" @tap="showMask = true">新增</button> -->
|
<button class="btn-c" size="mini" @tap="goBack">退出</button>
|
</view>
|
</view>
|
</view>
|
</template>
|
<script>
|
import getDateTime from '@/utils/getdateTime.js';
|
import { getUserInfo } from "@/utils/auth.js";
|
export default {
|
data() {
|
return {
|
userInfo:getUserInfo(),
|
serverUrl: uni.getStorageSync('serverUrl')||'http://47.96.97.237/API',
|
linterid:'',
|
HBillNo:'',
|
btnType:0,//0新增,1修改,2审核,3反审核
|
showmore: false,
|
OperationType:1,
|
|
showHProcNo:false,
|
arrayHProcNo:[],//工序
|
HProcNoList:[],
|
arrayHProcName:[],//工序
|
HProcNameList:[],
|
arrayHSourceName:[],//生产资源
|
HSourceNameList:[],
|
arrayHGroupName:[],//生产班组
|
HGroupNameList:[],
|
arrayHEmpName:[],//接收人
|
HEmpNameList:[],
|
arrayHCenterName:[],//工作中心
|
HCenterNameList:[],
|
|
isEdit: false,
|
hform:{
|
HInterID:'',
|
HBillNo:'',
|
HBarCode:'',
|
HBarCode_Mater:'',
|
|
HProcName:'',
|
HProcID:0,
|
HProcNo:'',
|
HQty:'',
|
HSourceName:'',
|
HSourceID:0,
|
HGroupName:'',
|
HGroupID:0,
|
HCenterName:'',
|
HCenterID:0,
|
HEmpName:'',
|
HEmpID:0,
|
HRemark:'',
|
HDate:getDateTime.dateTimeStr('y-m-d'),
|
|
HPRDOrg:'',
|
HPRDOrgID:0,
|
HICMOBillNo:'',
|
HICMOInterID:0,
|
HICMOQty:'',
|
HOrderProcNO:'',
|
HMaterNumber:'',
|
HMaterName:'',
|
HMaterID:0,
|
HMaterModel:'',
|
HProcExchBillNo:'',
|
HProcExchHinteID:0,
|
HPlanQty:'',
|
HPieceQty:'',
|
HStationInTime:getDateTime.dateTimeStr('y-m-d h:i:s'),
|
|
HMaker:uni.getStorageSync('HUserName'),
|
HMakeDate:getDateTime.dateTimeStr('y-m-d h:i:s'),
|
HUpDater:'',
|
HUpDateDate:'',
|
HChecker:'',
|
HCheckDate:'',
|
HCloseMan:'',
|
HCloseDate:'',
|
HDeleteMan:'',
|
HDeleteDate:'',
|
|
eventType:'Add',
|
HMainInterID:0,
|
lngICMOEntryID:'',
|
}
|
}
|
},
|
onLoad(e) {
|
console.log(e,this.userInfo)
|
// this.hform.HEmpID = this.userInfo.Czybm
|
// this.hform.HEmp = uni.getStorageSync('HUserName')
|
this.hform.HMaker = uni.getStorageSync('HUserName')
|
if(e.linterid){
|
this.btnType = 1
|
this.OperationType = 4
|
this.linterid = e.linterid
|
this.HBillNo = e.HBillNo
|
this.getEditData(e.linterid,e.HBillNo)
|
}else{
|
this.getNewData()
|
}
|
this.getBaseData()
|
this.getHProcList()
|
this.getHSourceList()
|
this.getHGroupList()
|
this.getHEmpList()
|
this.getHCenterList()
|
},
|
methods: {
|
//扫码
|
toScanCode(e){
|
var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module")
|
mpaasScanModule.mpaasScan({
|
'hideAlbum': true,
|
'timeoutInterval':'10', //超时时间
|
'timeoutText':'未识别到二维码' //超时提醒
|
},(ret) => {
|
console.log(ret.resp_result)
|
if(e==0){
|
this.hform.HBarCode = ret.resp_result
|
this.getHBarCodeData(ret.resp_result)
|
}else{
|
this.hform.HBarCode_Mater = ret.resp_result
|
this.getHBarCodeMater(ret.resp_result)
|
}
|
})
|
},
|
//扫流水号
|
toScanProcNo(){
|
if(this.hform.HProcExchHinteID){
|
var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module")
|
mpaasScanModule.mpaasScan({
|
'hideAlbum': true,
|
'timeoutInterval':'10', //超时时间
|
'timeoutText':'未识别到二维码' //超时提醒
|
},(ret) => {
|
console.log(ret.resp_result)
|
this.hform.HProcNo = resp_result
|
this.getHProcNoData(this.hform.HBarCode,resp_result)
|
})
|
}else{
|
uni.showToast({
|
title:'请扫完流转卡后再扫配件码',
|
icon:'none'
|
})
|
}
|
},
|
//通过登录用户获取默认值
|
getBaseData(){
|
uni.request({
|
url: this.serverUrl + '/Cj_StationInBill/GetDefValByUser',
|
data: { Czybm:this.userInfo.Czybm,Czymc:this.userInfo.Czymc },
|
success: (res) => {
|
console.log('base:', res.data)
|
if(res.data.count == 1){
|
var data = res.data.data[0]
|
this.hform.HSourceID = data.HSourceID
|
this.hform.HSourceName = data.生产资源名称
|
this.hform.HGroupID = data.HGroupID
|
this.hform.HGroupName = data.生产班组名称
|
this.hform.HCenterID = data.HWorkCenterID
|
this.hform.HCenterName = data.工作中心名称
|
this.hform.HEmpID = data.HEmpID
|
this.hform.HEmpNumber = data.操作员代码
|
this.hform.HEmpName = data.操作员名称
|
}else{
|
uni.showToast({
|
title:res.data.Message,
|
icon:'none'
|
})
|
}
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.showToast({
|
title:'接口请求失败',
|
icon:'none'
|
})
|
},
|
});
|
},
|
//日期
|
HDateChange(e){
|
console.log(e.detail.value)
|
this.hform.HDate = e.detail.value
|
},
|
//流水号
|
getHProcNoList(){
|
uni.request({
|
url: this.serverUrl + '/Web/GetProcNoList',
|
data: { sWhere: '',HInterID:this.hform.HProcExchHinteID,UserID:this.userInfo.Czybm },
|
success: (res) => {
|
if(res.data.count == 1){
|
this.HProcNoList = res.data.data
|
for(var i=0;i<res.data.data.length;i++){
|
this.arrayHProcNo[i] = res.data.data[i].流水号
|
}
|
}else{
|
uni.showToast({
|
title:res.data.Message,
|
icon:'none'
|
})
|
}
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.showToast({
|
title:'接口请求失败',
|
icon:'none'
|
})
|
},
|
});
|
},
|
//选择流水号
|
HProcNoChange(e){
|
this.hform.HProcNo = e
|
this.getHProcNoData(this.hform.HBarCode,e)
|
},
|
getHProcList(){
|
//工序
|
uni.request({
|
url: this.serverUrl + '/Web/GetProcList_Json',
|
data: { sWhere: '' },
|
success: (res) => {
|
if(res.data.count == 1){
|
this.HProcNameList = res.data.data
|
for(var i=0;i<res.data.data.length;i++){
|
this.arrayHProcName[i] = res.data.data[i].工序
|
}
|
this.$forceUpdate();
|
}else{
|
uni.showToast({
|
title:res.data.Message,
|
icon:'none'
|
})
|
}
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.showToast({
|
title:'接口请求失败',
|
icon:'none'
|
})
|
},
|
});
|
},
|
//选择工序
|
HProcNameChange(e){
|
for(var i=0;i<this.HProcNameList.length;i++){
|
if(this.HProcNameList[i].工序 == e){
|
this.hform.HProcID = this.HProcNameList[i].HItemID
|
}
|
}
|
},
|
//生产资源
|
getHSourceList(){
|
uni.request({
|
url: this.serverUrl + '/api/newBill/getSourceList',
|
data: { sWhere: '' },
|
success: (res) => {
|
if(res.data.code == 1){
|
this.HSourceNameList = res.data.data.Gy_Source
|
for(var i=0;i<res.data.data.Gy_Source.length;i++){
|
this.arrayHSourceName[i] = res.data.data.Gy_Source[i].生产资源
|
}
|
this.$forceUpdate();
|
}else{
|
uni.showToast({
|
title:res.data.Message,
|
icon:'none'
|
})
|
}
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.showToast({
|
title:'接口请求失败',
|
icon:'none'
|
})
|
},
|
});
|
},
|
//选择生产资源
|
HSourceNameChange(e){
|
for(var i=0;i<this.HSourceNameList.length;i++){
|
if(this.HSourceNameList[i].生产资源 == e){
|
this.hform.HSourceID = this.HSourceNameList[i].HItemID
|
}
|
}
|
},
|
//生产班组
|
getHGroupList(){
|
uni.request({
|
url: this.serverUrl + '/Web/GetProductionTeamList_Json',
|
data: { sWhere: "and HUSEORGID = " + uni.getStorageSync('OrganizationID') + "" },
|
success: (res) => {
|
if(res.data.count == 1){
|
this.HGroupNameList = res.data.data
|
for(var i=0;i<res.data.data.length;i++){
|
this.arrayHGroupName[i] = res.data.data[i].班组
|
}
|
this.$forceUpdate();
|
}else{
|
uni.showToast({
|
title:res.data.Message,
|
icon:'none'
|
})
|
}
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.showToast({
|
title:'接口请求失败',
|
icon:'none'
|
})
|
},
|
});
|
},
|
//选择生产班组
|
HGroupNameChange(e){
|
for(var i=0;i<this.HGroupNameList.length;i++){
|
if(this.HGroupNameList[i].班组 == e){
|
this.hform.HGroupID = this.HGroupNameList[i].HItemID
|
}
|
}
|
},
|
//接收人
|
getHEmpList(){
|
uni.request({
|
url: this.serverUrl + '/Web/GetEmployeeList_Json',
|
data: { Employee: '',HGroupID:0 },
|
success: (res) => {
|
if(res.data.count == 1){
|
this.HEmpNameList = res.data.data
|
for(var i=0;i<res.data.data.length;i++){
|
this.arrayHEmpName[i] = res.data.data[i].HName
|
}
|
this.$forceUpdate();
|
}else{
|
uni.showToast({
|
title:res.data.Message,
|
icon:'none'
|
})
|
}
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.showToast({
|
title:'接口请求失败',
|
icon:'none'
|
})
|
},
|
});
|
},
|
//选择接收人
|
HEmpNameChange(e){
|
for(var i=0;i<this.HEmpNameList.length;i++){
|
if(this.HEmpNameList[i].HName == e){
|
this.hform.HEmpID = this.HEmpNameList[i].HItemID
|
}
|
}
|
},
|
//工作中心
|
getHCenterList(){
|
uni.request({
|
url: this.serverUrl + '/api/newBill/getWorkCenterList',
|
data: { sWhere: '' },
|
success: (res) => {
|
if(res.data.code == 1){
|
this.HCenterNameList = res.data.data.Gy_Source
|
for(var i=0;i<res.data.data.Gy_Source.length;i++){
|
this.arrayHCenterName[i] = res.data.data.Gy_Source[i].工作中心
|
}
|
this.$forceUpdate();
|
}else{
|
uni.showToast({
|
title:res.data.Message,
|
icon:'none'
|
})
|
}
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.showToast({
|
title:'接口请求失败',
|
icon:'none'
|
})
|
},
|
});
|
},
|
//选择工作中心
|
HCenterNameChange(e){
|
for(var i=0;i<this.HCenterNameList.length;i++){
|
if(this.HCenterNameList[i].工作中心 == e){
|
this.hform.HCenterID = this.HCenterNameList[i].HItemID
|
}
|
}
|
},
|
|
//编辑
|
ifEdit(){
|
//是否编辑
|
uni.request({
|
url: this.serverUrl + '/Cj_StationInBill/set_ShowBillJudge',
|
data: {
|
HBillNo: this.HBillNo,
|
CurUserName: uni.getStorageSync('HUserName'),
|
HInterID: this.linterid,
|
},
|
success: (res) => {
|
console.log(res)
|
if(res.data.count == 1){
|
this.isEdit = true
|
this.OperationType = 3
|
this.hform.eventType = 'Modify'
|
}else{
|
uni.showToast({
|
title:res.data.Message,
|
icon:'none'
|
})
|
}
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.showToast({
|
title:'接口请求失败',
|
icon:'none'
|
})
|
},
|
});
|
},
|
getEditData(linterid,HBillNo){
|
//主表
|
uni.request({
|
url: this.serverUrl + '/Cj_StationInBill/GetStationInBill',
|
data: { HInterID: linterid },
|
success: (res) => {
|
console.log(1,res.data.data[0]);
|
if(res.data.code == 1){
|
var data = res.data.data[0]
|
this.getHBarCodeData(data.HBarCode)
|
this.getHProcNoData(data.HBarCode,data.HProcNo)
|
|
this.hform.HInterID= data.HInterID
|
this.hform.HBillNo= data.HBillNo
|
this.hform.HBarCode= data.HBarCode
|
this.hform.HProcNo= data.HProcNo
|
this.hform.HQty= data.HQty
|
this.hform.HSourceID= data.HSourceID
|
this.hform.HSourceName= data.HSourceName
|
this.hform.HGroupID= data.HGroupID
|
this.hform.HGroupName= data.HGroupName
|
this.hform.HEmpID= data.HEmpID
|
this.hform.HEmpName= data.HEmpName
|
this.hform.HRemark= data.HRemark
|
this.hform.HDate = data.HDate.substr(0,10)
|
if (data.是否审核 == "true") {
|
this.btnType = 3
|
} else {
|
this.btnType = 2
|
}
|
|
this.hform.HMaker= data.HMaker
|
this.hform.HMakeDate= data.HMakeDate
|
this.hform.HUpDater= data.HUpDater
|
this.hform.HUpDateDate= data.HUpDateDate
|
this.hform.HChecker= data.HChecker
|
this.hform.HCheckDate= data.HCheckDate
|
// this.hform.HCloseMan= data.HCloseMan
|
// this.hform.HCloseDate= data.HCloseDate
|
this.hform.HDeleteMan= data.HDeleteMan
|
this.hform.HDeleteDate= data.HDeleteDate
|
}else{
|
uni.showToast({
|
title:res.data.Message,
|
icon:'none'
|
})
|
}
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.showToast({
|
title:'接口请求失败',
|
icon:'none'
|
})
|
},
|
});
|
},
|
getHBarCodeData(HBarCode){
|
uni.request({
|
url: this.serverUrl + '/Cj_StationBill/txtHBarCode_KeyDown2',
|
// url: this.serverUrl + '/Cj_StationEntrustInBill/txtHBarCode_KeyDown',
|
data: {HBarCode: HBarCode,HInterID:this.hform.HProcExchHinteID,UserID:this.userInfo.Czybm,HBillType:"In"},
|
success: (res) => {
|
console.log(2,res.data);
|
if(res.data.count == 1){
|
var data = res.data.data[0]
|
this.hform.HICMOInterID= data.hicmointerid
|
this.hform.lngICMOEntryID= data.lngICMOEntryID
|
this.hform.HICMOBillNo= data.任务单号
|
this.hform.HMaterID= data.HMaterID
|
this.hform.HMaterName= data.产品
|
this.hform.HMaterNumber= data.产品代码
|
this.hform.HMaterModel= data.规格型号
|
this.hform.HPieceQty= data.流转卡数量
|
this.hform.HPlanQty= data.流转卡数量
|
this.hform.HProcExchBillNo= data.单据号
|
this.hform.HProcExchHinteID= data.hmainid
|
this.hform.HICMOQty= data.任务单数量
|
this.hform.lngBillKey= data.hmainid
|
this.hform.HOrderProcNO= data.订单跟踪号
|
this.hform.HPRDOrg= data.组织
|
this.hform.HPRDOrgID= data.组织
|
// this.getHProcNoList()
|
this.showHProcNo = true
|
//自动匹配流水号
|
uni.request({
|
url: this.serverUrl + '/Sc_StationInBill/autoGetProcNo',
|
data: {HInterID:data.hmainid,HUserID:this.userInfo.Czybm,BillType:"In" },
|
success: (res1) => {
|
console.log(res1)
|
if(res1.data.count == 1){
|
var data1 = res1.data.data[0]
|
this.hform.lngBillSubKey= data1.hsubid
|
this.hform.HProcName= data1.工序
|
this.hform.HProcID= data1.工序ID
|
this.hform.HProcNo= data1.流水号
|
this.hform.HCenterName= data1.工作中心
|
this.hform.HCenterID= data1.HCenterID
|
}
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.showToast({
|
title:'接口请求失败',
|
icon:'none'
|
})
|
},
|
});
|
}else{
|
uni.showToast({
|
title:res.data.Message,
|
icon:'none'
|
})
|
}
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.showToast({
|
title:'接口请求失败',
|
icon:'none'
|
})
|
},
|
});
|
},
|
getHBarCodeMater(HBarCode){
|
uni.request({
|
url: this.serverUrl + '/Cj_StationBill/txtHBarCode_Mater_KeyDown',
|
data: {HBarCode: HBarCode},
|
success: (res) => {
|
uni.showToast({
|
title:res.data.Message,
|
icon:'none'
|
})
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.showToast({
|
title:'接口请求失败',
|
icon:'none'
|
})
|
},
|
});
|
},
|
getHProcNoData(HBarCode,HProcNo){
|
uni.request({
|
url: this.serverUrl + '/Cj_StationInBill/txtHProcNo_KeyDown',
|
data: {sBillNo: HBarCode,sProcNo: HProcNo},
|
success: (res) => {
|
console.log(3,res);
|
if(res.data.count == 1){
|
var data = res.data.data[0]
|
this.hform.lngBillSubKey= data.hsubid
|
this.hform.HProcName= data.工序
|
this.hform.HProcID= data.HProcID
|
this.hform.HCenterName= data.工作中心
|
this.hform.HCenterID= data.HCenterID
|
|
uni.request({
|
url: this.serverUrl + '/Cj_StationInBill/MES_StationInBillSubBindSource',
|
data: {HInterID:this.hform.HProcExchHinteID,HProcExchInterID:this.hform.lngBillKey,HProcExchEntryID:this.hform.lngBillSubKey },
|
success: (res1) => {
|
console.log(res1)
|
uni.showToast({
|
title:res1.data.Message,
|
icon:'none'
|
})
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.showToast({
|
title:'接口请求失败',
|
icon:'none'
|
})
|
},
|
});
|
}else{
|
uni.showToast({
|
title:res.data.Message,
|
icon:'none'
|
})
|
}
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.showToast({
|
title:'接口请求失败',
|
icon:'none'
|
})
|
},
|
});
|
},
|
//新增
|
getNewData(){
|
uni.request({
|
url: this.serverUrl + '/Web/GetMAXNum',
|
data: { HBillType: '3790' },
|
success: (res) => {
|
console.log(res.data)
|
if(res.data.count == 1){
|
this.hform.HInterID = res.data.data[0].HInterID
|
this.hform.HBillNo = res.data.data[0].HBillNo
|
}else{
|
uni.showToast({
|
title:res.data.Message,
|
icon:'none'
|
})
|
}
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.showToast({
|
title:'接口请求失败',
|
icon:'none'
|
})
|
},
|
});
|
},
|
submit() {
|
if(!this.hform.HBarCode){
|
uni.showToast({
|
title:'请扫描设备条形码',
|
icon:'none'
|
})
|
}else if(!this.hform.HProcNo){
|
uni.showToast({
|
title:'请输入/扫描流水号',
|
icon:'none'
|
})
|
}else if(!this.hform.HEmpName){
|
uni.showToast({
|
title:'请选择接收人',
|
icon:'none'
|
})
|
}else if(!this.hform.HQty){
|
uni.showToast({
|
title:'请输入接收数量',
|
icon:'none'
|
})
|
}else if(!this.hform.HCenterName){
|
uni.showToast({
|
title:'请选择工作中心',
|
icon:'none'
|
})
|
}else{
|
uni.showLoading({
|
title:'请稍候'
|
})
|
var sMainStr = JSON.stringify(this.hform);
|
var sMainSub = sMainStr + ";" + uni.getStorageSync('HUserName') + ";" + this.OperationType;
|
uni.request({
|
url: this.serverUrl + '/Cj_StationInBill/AddBill',
|
method:'POST',
|
dataType:"json",
|
data:{ oMain: sMainSub },
|
success: (res) => {
|
console.log(1,res);
|
uni.hideLoading()
|
if(res.data.count == 1){
|
// let pages = getCurrentPages();
|
// let prePage = pages[pages.length - 2];
|
// prePage.$vm.getList()
|
if(this.isEdit){
|
setTimeout(()=>{
|
uni.redirectTo({
|
url:'/pages/gongxuIn/form?linterid=' + this.linterid + '&HBillNo=' + this.linterid
|
})
|
},1000)
|
}else{
|
uni.showModal({
|
title: '提示',
|
content: res.data.Message + '。是否继续新增?(点击取消返回上级页面)',
|
success: (res) => {
|
if (res.confirm) {
|
console.log('用户点击确定');
|
uni.redirectTo({
|
url:'/pages/gongxuIn/form?OperationType=1'
|
})
|
} else if (res.cancel) {
|
console.log('用户点击取消');
|
setTimeout(()=>{
|
uni.navigateBack();
|
},50)
|
}
|
}
|
});
|
}
|
}else{
|
uni.showToast({
|
title:res.data.Message,
|
icon:'none'
|
})
|
}
|
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.showToast({
|
title:'接口请求失败',
|
icon:'none'
|
})
|
},
|
});
|
}
|
},
|
//审核
|
check(){
|
uni.request({
|
url: this.serverUrl + '/Cj_StationInBill/set_CheckBill',
|
method:'GET',
|
dataType:"json",
|
data:{
|
CurUserName: uni.getStorageSync('HUserName'),
|
HInterID: this.linterid,
|
HBillSubType:'3792',
|
},
|
success: (res) => {
|
console.log(1,res);
|
uni.hideLoading()
|
if(res.data.count == 1){
|
this.btnType = 3
|
let pages = getCurrentPages();
|
let prePage = pages[pages.length - 2];
|
prePage.$vm.getList()
|
uni.showModal({
|
title: '操作成功',
|
content: '是否继续停留在当前页面?‘是’可进行反审核,‘否’则回到上一级列表',
|
confirmText:'是',
|
cancelText:'否',
|
success: (res) => {
|
if (res.confirm) {
|
console.log('用户点击是');
|
this.btnType = 3
|
} else if (res.cancel) {
|
console.log('用户点击否');
|
uni.navigateBack()
|
}
|
}
|
});
|
}
|
uni.showToast({
|
title:res.data.Message,
|
icon:'none'
|
})
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.showToast({
|
title:'接口请求失败',
|
icon:'none'
|
})
|
},
|
});
|
},
|
//反审核
|
abandonCheck(){
|
uni.request({
|
url: this.serverUrl + '/Cj_StationInBill/set_AbandonCheck',
|
method:'GET',
|
dataType:"json",
|
data:{
|
CurUserName: uni.getStorageSync('HUserName'),
|
HInterID: this.linterid,
|
HBillSubType:'3792',
|
},
|
success: (res) => {
|
console.log(1,res);
|
uni.hideLoading()
|
if(res.data.count == 1){
|
let pages = getCurrentPages();
|
let prePage = pages[pages.length - 2];
|
prePage.$vm.getList()
|
this.btnType = 2
|
uni.showModal({
|
title: '操作成功',
|
content: '是否继续停留在当前页面?‘是’可进行审核,‘否’则回到上一级列表',
|
confirmText:'是',
|
cancelText:'否',
|
success: (res) => {
|
if (res.confirm) {
|
console.log('用户点击是');
|
this.btnType = 2
|
} else if (res.cancel) {
|
console.log('用户点击否');
|
uni.navigateBack()
|
}
|
}
|
});
|
}
|
uni.showToast({
|
title:res.data.Message,
|
icon:'none'
|
})
|
},
|
fail: (res) => {
|
console.log(res);
|
uni.showToast({
|
title:'接口请求失败',
|
icon:'none'
|
})
|
},
|
});
|
},
|
goBack(){
|
uni.showModal({
|
title: '提示',
|
content: '确认要退出当前页面吗?',
|
success: (res) => {
|
if (res.confirm) {
|
console.log('用户点击确定');
|
uni.navigateBack()
|
} else if (res.cancel) {
|
console.log('用户点击取消');
|
}
|
}
|
});
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.form{
|
width: 668rpx;
|
margin: 20rpx auto;
|
padding-bottom: 240rpx;
|
}
|
.tab_area{
|
width: 100%;
|
height: 50rpx;
|
}
|
.other{
|
margin-top: 8rpx;
|
text-align: center;
|
font-size: 28rpx;
|
padding: 4rpx 18rpx;
|
color: #1890FF;
|
}
|
.form-item{
|
display: flex;
|
align-items: center;
|
font-size: 30rpx;
|
padding: 6rpx 0;
|
.title{
|
width: 208rpx;
|
text{
|
color: red;
|
font-weight: bold;
|
}
|
}
|
.right{
|
width: 450rpx;
|
border-radius: 22rpx;
|
border: 1px solid #acacac;
|
}
|
.righton{
|
width: 450rpx;
|
border-radius: 22rpx;
|
border: 1px solid #e4e4e4;
|
background-color: #e4e4e4;
|
}
|
input{
|
width: 100%;
|
padding: 8rpx 20rpx;
|
font-size: 30rpx;
|
}
|
textarea{
|
width: 98%;
|
padding: 8rpx 20rpx;
|
font-size: 30rpx;
|
}
|
|
}
|
.bottom-btn{
|
width: 100%;
|
// height: 120rpx;
|
position: fixed;
|
bottom: 0;
|
left: 0;
|
background-color: #fff;
|
box-shadow: 0 2rpx 10rpx 2rpx rgba(0, 0, 0, 0.4);
|
padding: 30rpx 40rpx 40rpx 40rpx;
|
button{
|
border-radius: 50rpx;
|
width: 180rpx;
|
height: 66rpx;
|
line-height: 66rpx;
|
font-size: 28rpx;
|
}
|
.btn-a{
|
background-color: #3A78FF;
|
color: #fff;
|
}
|
.btn-b{
|
background-color: #41a863;
|
color: #fff;
|
// margin-left: 30rpx;
|
}
|
.btn-c{
|
background-color: #acacac;
|
color: #fff;
|
position: absolute;
|
right: 120rpx;
|
}
|
.btn-d{
|
background-color: #ff8901;
|
color: #fff;
|
// margin-left: 30rpx;
|
}
|
}
|
</style>
|