617 lines
19 KiB
Vue
Executable File
617 lines
19 KiB
Vue
Executable File
<template>
|
|
<view class="page">
|
|
<opsoft-dialog-notice
|
|
:dialogNoticeShow="showDialog"
|
|
:dialogNoticeType="dialogNoticeType"
|
|
:dialogNoticeTitle="dialogNoticeTitle"
|
|
:dialogNoticeContent="dialogNoticeContent"
|
|
@dialogNoticeConfirmClick="dialogNoticeConfirmClick"
|
|
>
|
|
</opsoft-dialog-notice>
|
|
<view class="head-organzie-class">
|
|
<view>当前组织:</view>
|
|
<picker @change="orgChange" :value="index" :range="orgArry" range-key="FNAME">
|
|
<view class="head-row-content-class-organzie">{{orgArry[index].FNAME}}</view>
|
|
</picker>
|
|
<image class="head-organzie-img-class" src="../../../static/img/changearrow.svg"></image>
|
|
</view>
|
|
<view class="head">
|
|
<view class="search">
|
|
<text class="search-title">请检原因</text>
|
|
<view class="active-input">
|
|
<xfl-select class="header-row-select-class"
|
|
:list="checkBillTypeList" :listOrigin="checkBillTypeList" :clearable="false" :showItemNum="5" :isCanInput="false" ref="checkBillTypeList"
|
|
@change="checkBillTypeChange" v-model="checkBillTypeName" :defaultSelectText="checkBillTypeSelectText"/>
|
|
</view>
|
|
</view>
|
|
<view class="search">
|
|
<text class="search-title">请检部门</text>
|
|
<view class="active-input">
|
|
<xfl-select class="header-row-select-class"
|
|
:list="depList" :listOrigin="depList" :clearable="false" :showItemNum="5" :isCanInput="false" ref="depList"
|
|
@change="depChange" v-model="depName" :defaultSelectText="depSelectText"/>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="search">
|
|
<text class="search-title">请检单条码</text>
|
|
<view class="active-input">
|
|
<input class="search-input" placeholder="录入请检单条码" placeholder-class="placeholder-class-input"
|
|
v-model="checkBillBarcode" @confirm="checkBillBarcodeConfirm" :focus="barcodeFocuse"></input>
|
|
</view>
|
|
<image class="search-img" src="../../../static/img/scan-blue.png" @click="checkBillBarcodeScan"></image>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="head">
|
|
<view class="search">
|
|
<text class="search-title">ID</text>
|
|
<view class="active-input">
|
|
<input class="search-input" placeholder-class="placeholder-class-input"
|
|
v-model="IDCode" disabled="true"></input>
|
|
</view>
|
|
</view>
|
|
<view class="search">
|
|
<text class="search-title">物料编码</text>
|
|
<view class="active-input">
|
|
<input class="search-input" placeholder-class="placeholder-class-input"
|
|
v-model="materialCode" disabled="true"></input>
|
|
</view>
|
|
</view>
|
|
<view class="search">
|
|
<text class="search-title">物料名称</text>
|
|
<view class="active-input">
|
|
<input class="search-input" placeholder-class="placeholder-class-input"
|
|
v-model="materialName" disabled="true"></input>
|
|
</view>
|
|
</view>
|
|
<!-- <view class="search">
|
|
<text class="search-title">D/C</text>
|
|
<view class="active-input">
|
|
<input class="search-input" placeholder-class="placeholder-class-input"
|
|
v-model="dateCode" disabled="true"></input>
|
|
</view>
|
|
</view> -->
|
|
<view class="search">
|
|
<text class="search-title">LOT</text>
|
|
<view class="active-input">
|
|
<input class="search-input" placeholder-class="placeholder-class-input"
|
|
v-model="LotCode" disabled="true"></input>
|
|
</view>
|
|
</view>
|
|
<view class="search">
|
|
<text class="search-title">生产日期</text>
|
|
<view class="active-input">
|
|
<input class="search-input" placeholder-class="placeholder-class-input"
|
|
v-model="manufacturingDate" disabled="true"></input>
|
|
</view>
|
|
</view>
|
|
<view class="search">
|
|
<text class="search-title">过期日期</text>
|
|
<view class="active-input">
|
|
<input class="search-input" placeholder-class="placeholder-class-input"
|
|
v-model="expirationDate" disabled="true"></input>
|
|
</view>
|
|
</view>
|
|
<view class="search">
|
|
<text class="search-title">有效期至</text>
|
|
<view class="active-input">
|
|
<input class="search-input" placeholder-class="placeholder-class-input"
|
|
v-model="usefulDate" disabled="true"></input>
|
|
</view>
|
|
</view>
|
|
<view class="search">
|
|
<text class="search-title">供应商</text>
|
|
<view class="active-input">
|
|
<input class="search-input" placeholder-class="placeholder-class-input"
|
|
v-model="supply" disabled="true"></input>
|
|
</view>
|
|
</view>
|
|
<!-- <view class="search">
|
|
<text class="search-title">客户</text>
|
|
<view class="active-input">
|
|
<input class="search-input" placeholder-class="placeholder-class-input"
|
|
v-model="custom" disabled="true"></input>
|
|
</view>
|
|
</view> -->
|
|
<!-- <view class="search">
|
|
<text class="search-title">备注</text>
|
|
<view class="active-input">
|
|
<input class="search-input" placeholder-class="placeholder-class-input"
|
|
v-model="remarks" disabled="true"></input>
|
|
</view>
|
|
</view> -->
|
|
<view class="search">
|
|
<text class="search-title">版本</text>
|
|
<view class="active-input">
|
|
<input class="search-input" placeholder-class="placeholder-class-input"
|
|
v-model="version" disabled="true"></input>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="table">
|
|
<z-table :tableData='detailTableData' :columns='detailColumns'/>
|
|
</view>
|
|
<view class="submitBtn" @click="submit" :disable="disableCommitButton">提交</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import Vue from 'vue';
|
|
import zTable from "../../../components/z-table/z-table.vue";
|
|
import xflSelect from '../../../components/xfl-select/xfl-select.vue';
|
|
import opsoftDialogNotice from '@/components/opsoft-dialog-notice/opsoft-dialog-notice.vue';
|
|
import errorStrUntil from '@/common/errorStrUntil.js';
|
|
import {
|
|
mapState,
|
|
mapMutations
|
|
} from 'vuex';
|
|
|
|
export default {
|
|
components: {
|
|
zTable,
|
|
xflSelect,
|
|
opsoftDialogNotice
|
|
},
|
|
|
|
data() {
|
|
return {
|
|
dialogNoticeContent:'',
|
|
dialogNoticeTitle:'',
|
|
dialogNoticeType:'',
|
|
showDialog:false,
|
|
|
|
currentTranType:'QM_STKAPPInspect',
|
|
dbAlise:'',
|
|
userName:'',
|
|
isChangedOrg:false,
|
|
|
|
orgArry:[{name:"请选择组织", key:"", FName:""}],
|
|
orgFItemID:'',
|
|
index:0,
|
|
|
|
depList:[],
|
|
depName:'',
|
|
depSelectText:'请选择',
|
|
DepId:'',
|
|
|
|
checkBillTypeList:[
|
|
{value:'库存状态转换',ReasonID:1},{value:'形态转换',ReasonID:2},
|
|
{value:'发货检验',ReasonID:3},{value:'在库检验',ReasonID:4},
|
|
{value:'批号调整',ReasonID:5},{value:'料号变更',ReasonID:6},
|
|
{value:'其它出库',ReasonID:7}
|
|
],
|
|
ReasonID:'',
|
|
checkBillTypeName:'',
|
|
billTypeFocus:false,
|
|
checkBillTypeSelectText:'请选择',
|
|
|
|
|
|
checkBillBarcode:'',
|
|
barcodeFocuse:true,
|
|
IDCode:'',
|
|
materialCode:'',
|
|
materialName:'',
|
|
dateCode:'',
|
|
LotCode:'',
|
|
manufacturingDate:'',
|
|
expirationDate:'',
|
|
supply:'',
|
|
custom:'',
|
|
remarks:'',
|
|
version:'',
|
|
detailTableData:[],
|
|
detailColumns: [
|
|
{ title: "ID", key: "FBARCODE", width: 350, formatNum: false },
|
|
{ title: "物料编码", key: "FITEMNUMBER", width: 350, formatNum: false },
|
|
{ title: "物料名称", key: "FITEMNAME", width: 350, formatNum: false },
|
|
{ title: "规格", key: "FSPECIFICATION", width: 350, formatNum: false },
|
|
{ title: "仓库", key: "FSTOCKNAME", width: 350, formatNum: false },
|
|
{ title: "仓位", key: "FSTOCKLOCNAME", width: 350, formatNum: false },
|
|
{ title: "数量", key: "FQTY", width: 350, formatNum: false },
|
|
{ title: "批次", key: "FLOT", width: 350, formatNum: false },
|
|
{ title: "版本", key: "FAUXPROPNAME", width: 350, formatNum: false },
|
|
// { title: "是否提交", key: "isSubmit", width: 200, formatNum: false },
|
|
],
|
|
usefulDate:'',
|
|
disableCommitButton:false,
|
|
}
|
|
},
|
|
|
|
onLoad() {
|
|
let _self = this;
|
|
this.dbAlise = uni.getStorageSync("dbAlise");
|
|
this.userName = uni.getStorageSync("userName");
|
|
this.getOrgList();
|
|
this.judgeCash();
|
|
},
|
|
computed: {},
|
|
|
|
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;
|
|
},
|
|
//组织
|
|
getOrgList:function(){
|
|
let _self = this;
|
|
let orgInfo = uni.getStorageSync('orgInfo');
|
|
|
|
if(orgInfo && orgInfo.length > 0) {
|
|
let defaultOrgInfo = uni.getStorageSync('defaultOrgInfo');
|
|
let isOpenDefaultOrg = uni.getStorageSync('isOpenDefaultOrg');
|
|
if(!isOpenDefaultOrg){
|
|
this.orgFItemID = orgInfo[0].FINTERID;
|
|
}else{
|
|
if(defaultOrgInfo){
|
|
this.orgFItemID = defaultOrgInfo.FINTERID;
|
|
}else{
|
|
this.orgFItemID = orgInfo[0].FINTERID;
|
|
}
|
|
}
|
|
this.orgArry = orgInfo;
|
|
this.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:'无';
|
|
}
|
|
}
|
|
);
|
|
|
|
} else {
|
|
this.orgArry = [{name:"请选择组织", key:"", FNAME:"当前无组织"}];
|
|
this.index = 0;
|
|
}
|
|
this.getDeptInfo();
|
|
},
|
|
|
|
orgChange:function(e){
|
|
this.isChangedOrg = true;
|
|
this.index = e.target.value;
|
|
let isOpenDefaultOrg = uni.getStorageSync('isOpenDefaultOrg');
|
|
if(!this.orgArry[this.index].FINTERID) {
|
|
this.orgFItemID = "";
|
|
}
|
|
else {
|
|
this.orgFItemID = this.orgArry[this.index].FINTERID;
|
|
if(isOpenDefaultOrg){
|
|
uni.setStorageSync('defaultOrgInfo',this.orgArry[this.index]);
|
|
}
|
|
}
|
|
|
|
let cashValue = uni.getStorageSync('pageCash'+this.dbAlise+this.userName+this.currentTranType+this.orgFItemID)
|
|
if(cashValue.detailTableData){
|
|
this.loadByCash()
|
|
}else{
|
|
this.getDeptInfo();
|
|
this.orgChangedClear();
|
|
}
|
|
|
|
this.$forceUpdate();
|
|
},
|
|
getDeptInfo:function() {
|
|
let _self = this;
|
|
uni.showLoading({
|
|
icon:'loading',
|
|
title:'加载中……',
|
|
mask:true
|
|
});
|
|
|
|
let params;
|
|
this.$request.get('/SysConfigData/QueryResource',{
|
|
params:{
|
|
basicType:1,
|
|
basicNO:'',
|
|
orgId:this.orgFItemID,
|
|
currentTranTypeq:'QM_STKAPPInspect'
|
|
}
|
|
}).then(res => {
|
|
uni.hideLoading();
|
|
let datalist = res;
|
|
datalist.forEach(function(el,index){
|
|
el.value = el.FNAME
|
|
})
|
|
_self.depList = datalist;
|
|
}).catch(err => {
|
|
uni.hideLoading();
|
|
this.dialogNoticeProps(err,'error')
|
|
});
|
|
},
|
|
checkBillTypeChange({ newVal, oldVal, index, orignItem }) {
|
|
let _self = this;
|
|
this.ReasonID = orignItem.ReasonID;
|
|
|
|
this.checkBillBarcode = '';
|
|
this.IDCode = '';
|
|
this.materialCode = '';
|
|
this.materialName = '';
|
|
this.dateCode = '';
|
|
this.LotCode = '';
|
|
this.manufacturingDate = '';
|
|
this.expirationDate = '';
|
|
this.supply = '';
|
|
this.custom = '';
|
|
this.remarks = '';
|
|
this.version = '';
|
|
this.usefulDate = '';
|
|
|
|
this.barcodeFocuse = false;
|
|
this.$nextTick(function(){
|
|
_self.barcodeFocuse = true
|
|
});
|
|
},
|
|
depChange({ newVal, oldVal, index, orignItem }) {
|
|
let _self = this;
|
|
this.DepId = orignItem.FID;
|
|
this.checkBillBarcode = '';
|
|
this.IDCode = '';
|
|
this.materialCode = '';
|
|
this.materialName = '';
|
|
this.dateCode = '';
|
|
this.LotCode = '';
|
|
this.manufacturingDate = '';
|
|
this.expirationDate = '';
|
|
this.supply = '';
|
|
this.custom = '';
|
|
this.remarks = '';
|
|
this.version = '';
|
|
this.usefulDate = '';
|
|
|
|
this.barcodeFocuse = false;
|
|
this.$nextTick(function(){
|
|
_self.barcodeFocuse = true
|
|
});
|
|
},
|
|
checkBillBarcodeConfirm(){
|
|
let _self = this;
|
|
if(!this.$refs.checkBillTypeList.selectText ||
|
|
this.$refs.checkBillTypeList.selectText=='请选择'){
|
|
uni.showToast({
|
|
title:'选择请检原因',
|
|
icon:'none'
|
|
})
|
|
return false;
|
|
}
|
|
if(!this.$refs.depList.selectText ||
|
|
this.$refs.depList.selectText=='请选择'){
|
|
uni.showToast({
|
|
title:'选择部门',
|
|
icon:'none'
|
|
});
|
|
return false;
|
|
}
|
|
|
|
let requestParams = {
|
|
barcode:this.checkBillBarcode,
|
|
orgID:this.orgFItemID
|
|
}
|
|
this.$request.get('/Barcode/GetBarcodeMsg',{params:requestParams}).then(res => {
|
|
let isExit = _self.detailTableData.some(e => {
|
|
return e.FBARCODE == res.FBARCODE;
|
|
});
|
|
if(isExit){
|
|
uni.showToast({
|
|
title:'当前条码'+ res.FBARCODE +'已经存在',
|
|
icon:'none'
|
|
});
|
|
return false;
|
|
}
|
|
|
|
_self.detailTableData.push(res);
|
|
|
|
_self.IDCode = res.FBARCODE;
|
|
_self.materialCode = res.FITEMNUMBER;
|
|
_self.materialName = res.FITEMNAME;
|
|
// this.dateCode = res.FBARCODE;
|
|
_self.LotCode = res.FLOT;
|
|
_self.manufacturingDate = res.FKFDATE;
|
|
_self.expirationDate = res.FEXPIRYDATE;
|
|
_self.usefulDate = res.FUSEFULDATE;
|
|
_self.supply = res.FSUPPLYNAME;
|
|
// this.custom = res.FCUSTID;
|
|
// this.remarks = res.FBARCODE;
|
|
_self.version = res.FAUXPROPNAME;
|
|
|
|
let lastSaveOrgid = _self.orgFItemID; //最后一次条码录入成功后(条码进入已扫描列表)的组织ID
|
|
uni.setStorageSync(_self.dbAlise+_self.userName+_self.currentTranType+'lastSaveOrgid',lastSaveOrgid);
|
|
// _self.saveCash();
|
|
|
|
}).catch(err => {
|
|
uni.hideLoading();
|
|
_self.dialogNoticeProps(err,'error')
|
|
});
|
|
|
|
this.checkBillBarcode = '';
|
|
},
|
|
checkBillBarcodeScan(){
|
|
let _self = this;
|
|
uni.scanCode({
|
|
success:function(result){
|
|
_self.checkBillBarcode = result.result;
|
|
_self.checkBillBarcodeConfirm();
|
|
}
|
|
});
|
|
},
|
|
submit(){
|
|
if (this.disableCommitButton) {
|
|
return;
|
|
}
|
|
this.disableCommitButton = true;
|
|
|
|
if (!this.detailTableData || this.detailTableData.length == 0) {
|
|
uni.showToast({
|
|
icon: 'none',
|
|
title: "无提交数据",
|
|
duration: 1600,
|
|
});
|
|
|
|
this.disableCommitButton = false;
|
|
return;
|
|
}
|
|
|
|
let requestParams = {
|
|
"DepId":this.DepId,
|
|
"Reason":this.ReasonID,
|
|
"BarcodeList":this.detailTableData,
|
|
"OrgId":this.orgFItemID
|
|
}
|
|
|
|
this.$request.post('/STKAPPINSPECT/SubmitSTKAPPInspect',requestParams).then(res => {
|
|
this.disableCommitButton = false;
|
|
this.checkBillBarcode = '';
|
|
this.IDCode = '';
|
|
this.materialCode = '';
|
|
this.materialName = '';
|
|
this.dateCode = '';
|
|
this.LotCode = '';
|
|
this.manufacturingDate = '';
|
|
this.expirationDate = '';
|
|
this.supply = '';
|
|
this.custom = '';
|
|
this.remarks = '';
|
|
this.version = '';
|
|
this.usefulDate = '';
|
|
this.detailTableData = [];
|
|
|
|
uni.showToast({
|
|
title:'提交成功',
|
|
});
|
|
|
|
uni.removeStorageSync(this.dbAlise+this.userName+this.currentTranType+'lastSaveOrgid');
|
|
uni.removeStorageSync('pageCash'+this.dbAlise+this.userName+this.currentTranType+this.orgFItemID);
|
|
|
|
}).catch(err => {
|
|
this.disableCommitButton = false;
|
|
this.dialogNoticeProps(err,'error')
|
|
});
|
|
},
|
|
loadByCash:function() {
|
|
let _self = this;
|
|
let lastSaveOrgid = uni.getStorageSync(this.dbAlise+this.userName+this.currentTranType+'lastSaveOrgid');
|
|
let cashValue;
|
|
cashValue = uni.getStorageSync('pageCash'+this.dbAlise+this.userName+this.currentTranType+lastSaveOrgid);
|
|
|
|
this.orgFItemID = cashValue.otherInfo.orgFItemID;
|
|
this.DepId = cashValue.otherInfo.DepId;
|
|
this.ReasonID = cashValue.otherInfo.ReasonID;
|
|
this.detailTableData = cashValue.otherInfo.detailTableData;
|
|
|
|
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.checkBillTypeList.forEach(e => {
|
|
if(e.ReasonID = _self.ReasonID){
|
|
_self.$refs.checkBillTypeList.selectText = e.value;
|
|
}
|
|
})
|
|
|
|
let params;
|
|
this.$request.get('/SysConfigData/QueryResource',{
|
|
params:{
|
|
basicType:1,
|
|
basicNO:'',
|
|
orgId:this.orgFItemID,
|
|
currentTranTypeq:'QM_STKAPPInspect'
|
|
}
|
|
}).then(res => {
|
|
uni.hideLoading();
|
|
let datalist = res;
|
|
datalist.forEach(function(el,index){
|
|
el.value = el.FNAME
|
|
})
|
|
_self.depList = datalist;
|
|
_self.depList.forEach(e => {
|
|
if(e.FID = _self.DepId){
|
|
_self.$refs.depList.selectText = e.value;
|
|
}
|
|
})
|
|
}).catch(err => {
|
|
uni.hideLoading();
|
|
this.dialogNoticeProps(err,'error')
|
|
});
|
|
|
|
},
|
|
judgeCash:function(){
|
|
let _self = this;
|
|
let lastSaveOrgid = uni.getStorageSync(this.dbAlise+this.userName+this.currentTranType+'lastSaveOrgid');
|
|
let cashValue = uni.getStorageSync('pageCash'+this.dbAlise+this.userName+this.currentTranType+lastSaveOrgid);
|
|
if(cashValue.detailTableData){
|
|
uni.showModal({
|
|
content:'存在未提交数据是否加载',
|
|
success: function (res) {
|
|
if (res.confirm) {
|
|
_self.loadByCash();
|
|
}
|
|
else if (res.cancel) {
|
|
console.log('点击取消')
|
|
}
|
|
}
|
|
})
|
|
}
|
|
},
|
|
saveCash:function(){
|
|
let _self = this;
|
|
let otherInfo = {
|
|
"currentTranType":_self.currentTranType,
|
|
"orgFItemID":_self.orgFItemID,
|
|
"dbAlise":_self.dbAlise,
|
|
"UserID":_self.userName,
|
|
"DepId":_self.DepId?_self.DepId:'',
|
|
"ReasonID":_self.ReasonID?_self.ReasonID:''
|
|
};
|
|
_self.pageCashInfo.detailTableData = _self.detailTableData;
|
|
_self.pageCashInfo.otherInfo = otherInfo;
|
|
uni.setStorageSync('pageCash'+_self.dbAlise+_self.userName+_self.currentTranType+_self.orgFItemID,_self.pageCashInfo);
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
.head{margin: 0rpx 32rpx;background-color: #FFFFFF;padding: 0rpx 0rpx;border-radius: 10rpx;}
|
|
.search{padding: 10rpx 0;margin: 0 0;border-bottom: 1px solid #f9f9f9;}
|
|
.search-title{text-align: start;}
|
|
.search-img{height: 28rpx;width: 28rpx;margin-top: 20rpx;margin-right: 20rpx;}
|
|
.active-input{position: relative;width: 100%;padding-right: 32rpx;padding-left: 40rpx;}
|
|
.placeholder-class-input{font-size: 30rpx;font-family: PingFangSC, PingFangSC-Regular;font-weight: 400;color: #cacaca;}
|
|
.table{margin-top: 16rpx;margin-right: 32rpx;margin-left: 32rpx;margin-bottom: 100rpx;}
|
|
.submitBtn{width: 100%;height: 80rpx;line-height: 80rpx;font-size: 32rpx;font-family: MicrosoftYaHei;color: #FFFFFF;
|
|
text-align: center;background-color: #007BFF;border-radius: unset;position: fixed;left: 0;bottom: 0;
|
|
}
|
|
.head-organzie-class {
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
align-items: center;
|
|
}
|
|
.head-row-content-class-organzie{
|
|
font-size: 32rpx;
|
|
font-family: MicrosoftYaHei;
|
|
color: #666666;
|
|
}
|
|
.head-organzie-img-class {
|
|
height: 32rpx;
|
|
width: 32rpx;
|
|
margin-left: 24rpx;
|
|
}
|
|
</style> |