出入库

This commit is contained in:
王帅 2025-05-23 17:49:42 +08:00
parent 44c5943387
commit 137a6e7d18
9 changed files with 1506 additions and 17 deletions

View File

@ -319,6 +319,22 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},{
"path" : "pages/material/features/MaterialReturnStockIn/index",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},{
"path" : "pages/material/features/InventoryProfitStockIn/index",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
},{ },{
"path" : "pages/material/features/SaleStockOut/index", "path" : "pages/material/features/SaleStockOut/index",
"style" : "style" :
@ -510,6 +526,14 @@
"navigationBarTitleText": "", "navigationBarTitleText": "",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},
{
"path" : "pages/StockOut/features/InventoryLossStockOut/index",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}, },
{ {
"path" : "pages/StockOut/features/ErpLocationMove/ErpLocationMove", "path" : "pages/StockOut/features/ErpLocationMove/ErpLocationMove",

View File

@ -0,0 +1,326 @@
<template>
<view style="margin: 10rpx;">
<u-navbar back-text="返回" title="盘亏出库" :background="background"></u-navbar>
<u-form ref="testForm">
<u-form-item :border-bottom="false">
<label>成本中心:</label>&nbsp;&nbsp;&nbsp;&nbsp;
<zxzUniDataSelect filterable v-model="costName" :localdata="itemsCostName">
</zxzUniDataSelect>
</u-form-item>
<u-form-item :border-bottom="false">
<p>扫描条码:</p>
<u-input :border="true" v-model="MATERIALPACKINGNAME" placeholder="请扫描条码" :focus="focusBarCode"
@confirm="ScanBarCode" />
</u-form-item>
<br />
</u-form>
<u-row>
<u-col span="3"><label style="text-align: right;">扫描行数</label> </u-col>
<u-col span="9"><label>{{bqts}}</label> </u-col>
</u-row>
<br />
<u-row>
<u-col span="3"><label style="text-align: right;">扫描总数</label> </u-col>
<u-col span="9"><label>{{bqkcs}}</label> </u-col>
</u-row>
<br />
<uni-table ref="BoxList" border stripe type="false" style="height: 400upx;">
<uni-tr>
<uni-th align="center">标签</uni-th>
<uni-th align="center">批次</uni-th>
<uni-th align="center">品名</uni-th>
<uni-th align="center">料号</uni-th>
<uni-th align="center">规格</uni-th>
<uni-th align="center">阶段</uni-th>
<uni-th align="center">数量</uni-th>
<uni-th align="center">组织</uni-th>
<uni-th align="center">仓库</uni-th>
<uni-th align="center">货位</uni-th>
</uni-tr>
<uni-tr v-for="(item, index) in BoxListInfo" :key="index">
<uni-td align="center">{{ item.MATERIALPACKINGNAME}}</uni-td>
<uni-td align="center">{{ item.CHARGE}}</uni-td>
<uni-td align="center">{{ item.DESC_CN}}</uni-td>
<uni-td align="center">{{ item.MATERIALSPECNAME }}</uni-td>
<uni-td align="center">{{ item.SPECNAME }}</uni-td>
<uni-td align="center">{{ item.PHASE }}</uni-td>
<uni-td align="center">{{ item.MATERIALQUANTITY }}</uni-td>
<uni-td align="center">{{ item.ERPFACTORY }}</uni-td>
<uni-td align="center">{{ item.ERPLOCATION }}</uni-td>
<uni-td align="center">{{ item.LOCATIONNAME }}</uni-td>
</uni-tr>
</uni-table>
<view class="tabbar_bottom bottom-margin">
<u-input v-if="false" v-model="opCode" />
<uni-datetime-picker style="align-items: center;" type="date" :clear-icon="false" v-model="commitDate"
@maskClick="maskClick" />
<u-button class="btn-bottom" @click="OtherStockOut" type="primary" :loading="loading">确定</u-button>
</view>
</view>
</template>
<script>
import {
getOpCode
} from '@/common/api.js';
import { cals } from '@/utils/cal'
import zxzUniDataSelect from "@/components/zxz-uni-data-select/zxz-uni-data-select.vue"
export default {
components: {
zxzUniDataSelect,
},
data() {
return {
LocationName: '', //
LOCATIONNAME: '',
ERPFACTORY: '', //
ERPLOCATION: '', //
tabH: 800, //
MATERIALSPECNAME: '',
MATERIALPACKINGNAME: '', //
CHARGE: '', //
DESC_CN: '', //
SPECNAME: '', //
RECEIVEACTNO: '', //
bqts: 0,
bqkcs: 0,
UNIT: '', //
PHASE: '', //
QTY: '', //
background: {
backgroundImage: 'linear-gradient(45deg, rgb(28, 187, 180), rgb(141, 198, 63))'
}, //
colors: ['#007aff', '#4cd964', '#dd524d'],
styleType: 'button',
current: 0,
BoxListInfo: [], //
colorIndex: 0,
activeColor: '#007aff',
loading: false,
scanData: [], //
barCode: "", //
DURABLENAMECode: "", //
focusBarCode: false, //
focusShipRequest: true, //
siteName: "SDK",
userId: "",
commitDate: '',
opCode: '',
costName: '',
itemsCostName: [{text: '财务部',value: '财务部'}]
}
},
mounted() {
// let add = cals.add(1.222,3.337)
// console.log(add.toNumber())
this.tabH = this.$GetRemainingHeight(4, 0); //
let that = this
uni.getStorage({
key: "sitename",
success(res) {
that.siteName = res.data
}
})
uni.getStorage({
key: "userid",
success(res) {
that.userId = res.data
}
})
this.getTimeData();
},
methods: {
getTimeData() {
var year = new Date().getFullYear(); //
if (year < 1900) year = year + 1900;
var month = new Date().getMonth() + 1; //
if (month < 10) month = '0' + month;
var day = new Date().getDate(); //
if (day < 10) day = '0' + day;
const calendar1 = year + '-' + month + '-' + day
this.commitDate = calendar1
},
maskClick(e) {
console.log('maskClick事件:', e);
},
//
getfocus(nextfocus) {
this.initfocus()
this[nextfocus]
this.$nextTick(() => { //vuenextTick
this[nextfocus] = true
})
},
ScanBarCode() {
this.focusBarCode = false
console.log(this.BoxListInfo.length)
for (let i = 0; i < this.BoxListInfo.length; ++i) {
if (this.MATERIALPACKINGNAME == this.BoxListInfo[i].MATERIALPACKINGNAME) {
this.$nextTick(() => {
this.MATERIALPACKINGNAME = ""
this.focusBarCode = true
this.focusShipRequest = false
})
this.$showMessage("标签已被扫描");
return false
}
}
this.$MyRequest('/api/NoInvoice/getQTCOutList', {
MATERIALPACKINGNAME: this.MATERIALPACKINGNAME
}).then(res => {
if (res.data.success) {
this.BoxListInfo.push(res.data.resultObj[0]);
this.bqts = 0
this.bqkcs = 0
console.log(this.BoxListInfo.length, this.BoxListInfo)
for (let i = 0; i < this.BoxListInfo.length; i++) {
console.log("12344" + this.bqts)
// let add = cals.add(1,7)
// console.log(add.toNumber())
this.bqts++
this.bqkcs = (cals.add(this.bqkcs,this.BoxListInfo[i]['MATERIALQUANTITY'])).toNumber()
}
this.$showMessage(res.data.message)
try {
Vue.prototype.$playSuccess()
} catch (e) {}
} else {
this.$showMessage(res.data.message)
try {
Vue.prototype.$playFail()
} catch (e) {}
}
this.$nextTick(() => {
this.MATERIALPACKINGNAME = ""
this.focusBarCode = true
this.focusShipRequest = false
})
}).catch(err => {
this.$showMessage(err)
this.$nextTick(() => {
this.MATERIALPACKINGNAME = ""
this.focusBarCode = true
this.focusShipRequest = false
})
try {
Vue.prototype.$playFail()
} catch (e) {}
});
},
/**
* 入库审核
*/
OtherStockOut() {
console.log(this.commitDate)
if (this.BoxListInfo.length == 0) {
this.$showMessage('列表数据为空')
return
}
this.loading = true;
this.focusBarCode = false
getOpCode({
opcode: this.opCode,
user: this.userId
}).then((res) => {
this.opCode = res.resultObj
this.$MyRequest('/api/NoInvoice/QTCCommit', {
boxList: this.BoxListInfo,
user: this.userId,
siteName: this.siteName,
commitDate: this.commitDate,
opcode: this.opCode,
qtc: 'Z05',
costName: this.costName
}).then(res => {
if (res.data.success) {
this.loading = false;
this.bqts = 0
this.bqkcs = 0
this.resetValue();
this.opCode = "";
} else {
this.loading = false;
}
this.$showMessage(res.data.message || '操作成功')
this.$nextTick(() => {
this.MATERIALPACKINGNAME = ''
this.focusBarCode = true
this.focusShipRequest = false
})
}).catch(err => {
this.loading = false;
this.$showMessage(err)
this.$nextTick(() => {
this.MATERIALPACKINGNAME = ''
this.focusBarCode = true
this.focusShipRequest = false
})
});
})
},
resetValue() {
this.opCode = "";
this.BoxListInfo = [];
this.scanData = [];
}
}
}
</script>
<style>
.btn-bottom {
position: fixed;
bottom: 0;
width: 100%;
left: 0;
}
</style>
<style lang="scss">
.bottom-margin {
margin-bottom: 80rpx;
}
switch {
color: #FFCC33;
}
/* 基础样式 */
.picker {
display: flex;
flex-direction: column;
align-items: flex-start;
width: 100%;
/* 根据需要调整宽度 */
}
.row {
display: flex;
justify-content: space-between;
margin-bottom: 10px;
/* 行与行之间的间距 */
}
.col {
flex: 1;
/* 使得每列占据相等的空间 */
display: flex;
flex-direction: column;
align-items: flex-start;
}
label {
// font-weight: bold;
/* 标签加粗 */
margin-bottom: 5px;
/* 标签和值之间的间距 */
}
.value {
/* 值的样式,可以根据需要调整 */
}
</style>

View File

@ -222,6 +222,7 @@
siteName: this.siteName, siteName: this.siteName,
commitDate: this.commitDate, commitDate: this.commitDate,
opcode: this.opCode, opcode: this.opCode,
qtc: 'Z07'
}).then(res => { }).then(res => {
if (res.data.success) { if (res.data.success) {
this.loading = false; this.loading = false;

View File

@ -93,6 +93,15 @@
cuIcon: '', cuIcon: '',
label: '报废出库', label: '报废出库',
id:'200001' id:'200001'
},
{
title: '盘亏出库',
name: 'InventoryLossStockOut/index',
en_name:'InventoryLossStockOut',
color: 'cyan',
cuIcon: '',
label: '盘亏出库',
id:'200008'
} }
// { // {
// title: '', // title: '',

View File

@ -0,0 +1,555 @@
<template>
<view>
<view>
<navVar :mysNavConfig="navConfig" @onLeftClick="onLeftClick"></navVar>
</view>
<view style="margin: 10rpx;">
<u-form ref="testForm">
<u-form-item :border-bottom="false">
<label>成本中心:</label>&nbsp;&nbsp;&nbsp;&nbsp;
<zxzUniDataSelect filterable v-model="costName" :localdata="itemsCostName">
</zxzUniDataSelect>
</u-form-item>
<u-form-item :border-bottom="false">
<label>选择仓库:</label>&nbsp;&nbsp;&nbsp;&nbsp;
<zxzUniDataSelect filterable v-model="ERPLOCATION" :localdata="items" @change="change">
</zxzUniDataSelect>
</u-form-item>
<u-form-item :border-bottom="false">
<label>选择库位:</label>&nbsp;&nbsp;&nbsp;&nbsp;
<zxzUniDataSelect filterable v-model="LOCATIONNAME" :localdata="items_Location"
:disabled="Locatiaon_state"></zxzUniDataSelect>
</u-form-item>
<u-form-item :border-bottom="false">
<p>扫描条码:</p>
<u-input :border="true" v-model="MATERIALPACKINGNAME" placeholder="请扫描条码" :focus="focusBarCode"
@confirm="ScanFGBarCode" />
</u-form-item>
<br />
<u-row>
<u-col span="3"><label>扫描标签</label> </u-col>
<u-col span="9"><label>{{MATERIALPACKINGQTY}}</label> </u-col>
<u-col span="3"><label style="text-align: right;">扫描数量</label> </u-col>
<u-col span="9"><label>{{MATERIALPACKINGNUMBER}}</label> </u-col>
</u-row>
</u-form>
<br />
<zb-table style="height: 450upx;" ref="zbTable" :show-header="true" :columns="column" :stripe="true"
:fit="true" :highlight="true" :border="true" :data="BoxListInfo" @dele="del"></zb-table>
<br />
<view class="tabbar_bottom">
<u-input v-if="false" v-model="opCode" />
<uni-datetime-picker style="align-items: center;" type="date" :clear-icon="false" v-model="commitDate"
@maskClick="maskClick" />
<u-button @click="NoInvoiceStockIn" type="primary" :loading="loading">确定</u-button>
</view>
<u-modal :show="showModal" :title="titleModal" :content='contentModal'></u-modal>
</view>
</view>
</template>
<script>
import zxzUniDataSelect from "@/components/zxz-uni-data-select/zxz-uni-data-select.vue"
import navVar from "@/components/navBar/navBar.vue"
import {
getOpCode
} from '@/common/api.js';
import { cals } from '@/utils/cal'
export default {
components: {
zxzUniDataSelect,
navVar
},
data() {
return {
showModal: false,
titleModal: "提示",
contentModal: '是否确定返回?',
navConfig: {
navPadding: false,
isHome: false,
navPadding: true,
navFixed: true,
bgImage: 'linear-gradient(45deg, rgb(28, 187, 180), rgb(141, 198, 63))',
isCustomFn: true,
navTitle: {
text: "盘盈入库",
color: "rgb(96, 98, 102)",
fontSize: "14px", // px upx rpx
fontWeight: "normal", // blod
},
leftText: {
text: "返回",
color: "rgb(96, 98, 102)",
fontSize: "14px", // px upx rpx
fontWeight: "", // blod
},
leftIconPath: '../../../../static/img/back.png'
},
column: [ //
{
name: 'MATERIALPACKINGNAME',
label: '标签',
align: 'center',
// fixed: true,
// width: 210
},
{
name: 'CHARGE',
label: '批次'
},
{
name: 'DESC_CN',
label: '品名'
},
{
name: 'MATERIALSPECNAME',
label: '料号'
},
{
name: 'SPECNAME',
label: '规格'
},
{
name: 'PHASE',
label: '阶段'
},
{
name: 'MATERIALQUANTITY',
label: '数量'
},
{
name: 'ERPFACTORY',
label: '组织'
},
{
name: 'ERPLOCATION',
label: '仓库'
},
{
name: 'LOCATIONNAME',
label: '货位'
},
{
name: 'operation',
type: 'operation',
label: '操作',
renders: [{
name: '删除',
size: 'mini',
type: 'warn',
func: "dele"
}, ]
},
],
orgObject: {
ERPFACTORY: '',
DESCRIPTION: ''
}, //
LocationName: '', //
LOCATIONNAME: '',
MATERIALPACKINGQTY: 0,
MATERIALPACKINGNUMBER: 0,
ERPFACTORY: JSON.parse(uni.getStorageSync('orgObject')).ERPFACTORY, //
ERPFACTORYNAME: JSON.parse(uni.getStorageSync('orgObject')).DESCRIPTION, //
ERPLOCATION: '', //
tabH: 800, //
MATERIALSPECNAME: '',
MATERIALPACKINGNAME: '', //
Locatiaon_state: false,
CHARGE: '', //
DESC_CN: '', //
SPECNAME: '', //
RECEIVEACTNO: '', //
UNIT: '', //
PHASE: '', //
QTY: '', //
background: {
backgroundImage: 'linear-gradient(45deg, rgb(28, 187, 180), rgb(141, 198, 63))'
}, //
colors: ['#007aff', '#4cd964', '#dd524d'],
styleType: 'button',
current: 0,
BoxListInfo: [], //
colorIndex: 0,
activeColor: '#007aff',
loading: false,
scanData: [], //
barCode: "", //
DURABLENAMECode: "", //
focusBarCode: false, //
focusShipRequest: true, //
siteName: "",
userId: "",
items: [],
items_Location: [],
commitDate: '',
opCode: '',
costName: '',
itemsCostName: [{text: '财务部',value: '财务部'}]
}
},
mounted() {
this.tabH = this.$GetRemainingHeight(4, 0); //
let that = this
uni.getStorage({
key: "sitename",
success(res) {
that.siteName = res.data
}
})
uni.getStorage({
key: "userid",
success(res) {
that.userId = res.data
}
})
this.orgObject = JSON.parse(uni.getStorageSync('orgObject'))
this.getTimeData();
this.getERPLocation();
// let Things = 20
// for (var i = 0; i < Things; i++) {
// this.BoxListInfo.push({aa:"1"})
// }
},
methods: {
getTimeData() {
var year = new Date().getFullYear(); //
if (year < 1900) year = year + 1900;
var month = new Date().getMonth() + 1; //
if (month < 10) month = '0' + month;
var day = new Date().getDate(); //
if (day < 10) day = '0' + day;
const calendar1 = year + '-' + month + '-' + day
this.commitDate = calendar1
},
maskClick(e) {
console.log('maskClick事件:', e);
},
onLeftClick() {
uni.showModal({
title: this.titleModal, //
content: this.contentModal, //
showCancel: true, // true
cancelText: '取消', //
confirmText: '确定', //
success(res) {
if (res.confirm) {
uni.navigateBack({
delta: 1 // delta
});
console.log('用户点击了确定');
//
} else if (res.cancel) {
console.log('用户点击了取消');
//
}
}
})
},
del(row, index) {
this.BoxListInfo.splice(index, 1)
this.MATERIALPACKINGNUMBER = this.MATERIALPACKINGNUMBER - row.MATERIALQUANTITY
this.MATERIALPACKINGQTY = this.MATERIALPACKINGQTY - 1
this.$showMessage("删除成功")
},
change(e) {
this.ERPLOCATION = e.value;
this.LOCATIONNAME = ""
this.Huowei = e.Huowei
if (e.Huowei == 'Y') {
this.Locatiaon_state = false
this.getLocationName();
} else {
this.$showMessage(e.text + "仓库没有启用货位管理")
this.Locatiaon_state = true
this.focusBarCode = true
}
},
//
getfocus(nextfocus) {
this.initfocus()
this[nextfocus]
this.$nextTick(() => { //vuenextTick
this[nextfocus] = true
})
},
getERPLocation() {
this.items = [];
this.$MyRequest('/api/storage/getERPLocation', {
ERPFACTORYNAME: this.ERPFACTORY
}).then(res => {
if (res.data.success) {
for (let i = 0; i < res.data.resultObj.length; i++) {
var _Arr = res.data.resultObj[i];
this.items.push({
text: _Arr.DESCRIPTION,
value: _Arr.ERPLOCATIONNAME,
Huowei: _Arr.USE_LOCATION,
});
}
} else {
this.$showMessage(res.data.message)
}
});
},
getLocationName() {
this.items_Location = []
if (this.ERPLOCATION != '') {
this.$MyRequest('/api/storage/getLocationNameForERPLocation', {
ERPLocation: this.ERPLOCATION
}).then(res => {
if (res.data.success) {
for (let i = 0; i < res.data.resultObj.length; i++) {
var _Arr = res.data.resultObj[i];
this.items_Location.push({
text: _Arr.DESCRIPTION,
value: _Arr.STORAGENAME
});
}
} else {
this.$showMessage(res.data.message)
}
this.focusBarCode = true
this.focusShipRequest = false
}).catch(err => {
this.$showMessage(err)
});
} else {
this.$showMessage("请先选择仓库")
}
},
async ScanFGBarCode() {
this.focusBarCode = false;
if (this.BoxListInfo.some(box => box.MATERIALPACKINGNAME === this.MATERIALPACKINGNAME)) {
this.$showMessage("改标签已扫描,请不要重复扫描!");
this.$nextTick(() => {
this.MATERIALPACKINGNAME = ""
this.focusBarCode = true
this.focusShipRequest = false
})
this.$playFail()
return;
}
// if ((this.LOCATIONNAME == null || this.LOCATIONNAME == "") && (this.Huowei == 'Y')) {
// this.$showMessage("");
// this.$nextTick(() => {
// this.MATERIALPACKINGNAME = ""
// this.focusBarCode = true
// this.focusShipRequest = false
// })
// this.$playFail()
// return;
// }
if (this.ERPFACTORY == null || this.ERPFACTORY == "") {
this.$showMessage("请选择组织!");
this.$nextTick(() => {
this.MATERIALPACKINGNAME = ""
this.focusBarCode = true
this.focusShipRequest = false
})
this.$playFail()
return;
}
if (this.ERPLOCATION == null || this.ERPLOCATION == "") {
this.$showMessage("请选择仓库!");
this.$nextTick(() => {
this.MATERIALPACKINGNAME = ""
this.focusBarCode = true
this.focusShipRequest = false
})
this.$playFail()
return;
}
var barCodeArr = this.MATERIALPACKINGNAME.split("|");
// 470110856|1|C|75mm*1000m|SHBP01JT1202305240009|20230524|11|75
if (barCodeArr.length < 7) {
this.$showMessage("条码规则不符合需求!")
this.$nextTick(() => {
this.MATERIALPACKINGNAME = ""
this.focusBarCode = true
this.focusShipRequest = false
})
this.$playFail()
return;
}
// this.loading = true;
this.MATERIALPACKINGQTY = 0
this.MATERIALPACKINGNUMBER = 0
await this.$MyRequest('/api/NoInvoice/getBarCode', {
MATERIALPACKINGNAME: this.MATERIALPACKINGNAME,
LOCATIONNAME: this.LOCATIONNAME,
ERPFACTORY: this.ERPFACTORY,
ERPLOCATION: this.ERPLOCATION,
CREATEUSER: this.userId
}).then(res => {
if (res.data.success) {
var _Arr = res.data.resultObj;
// this.MATERIALPACKINGNAME = _Arr[0].MATERIALPACKINGNAME;
// this.CHARGE = _Arr[0].CHARGE;
// this.MATERIALSPECNAME = _Arr[0].MATERIALSPECNAME;
// this.SPECNAME = _Arr[0].SPECNAME;
// this.DESC_CN = _Arr[0].DESC_CN;
// this.PHASE = _Arr[0].PHASE;
// console.log(new Set(this.BoxListInfo))
this.BoxListInfo.push(...res.data.resultObj);
this.MATERIALPACKINGQTY = this.BoxListInfo.length
for (let i = 0; i < this.BoxListInfo.length; i++) {
this.MATERIALPACKINGNUMBER = (cals.add(this.MATERIALPACKINGNUMBER,this.BoxListInfo[i].MATERIALQUANTITY)).toNumber()
}
// this.loading = false;
this.$nextTick(() => {
this.MATERIALPACKINGNAME = ""
this.focusBarCode = true
this.focusShipRequest = false
})
try {
Vue.prototype.$playSuccess()
} catch (e) {}
} else {
// this.loading = false;
this.$showMessage(res.data.message)
this.$nextTick(() => {
this.MATERIALPACKINGNAME = ""
this.focusBarCode = true
this.focusShipRequest = false
})
this.$playFail()
}
}).catch(err => {
this.loading = false;
this.$showMessage(err)
this.$nextTick(() => {
this.MATERIALPACKINGNAME = ""
this.focusBarCode = true
this.focusShipRequest = false
})
this.$playFail()
});
},
/**
* 入库审核
*/
NoInvoiceStockIn() {
console.log(this.commitDate)
if (this.BoxListInfo.length <= 0) {
this.$showMessage("入库列表为空")
return
}
this.loading = true;
this.focusBarCode = false
this.BoxListInfo.map(item => {
if (item.hasOwnProperty("key")) {
delete item.key
}
})
getOpCode({
opcode: this.opCode,
user: this.userId
}).then((res) => {
this.$MyRequest('/api/NoInvoice/QTRCommit', {
boxList: this.BoxListInfo,
user: this.userId,
commitDate: this.commitDate,
opcode: this.opCode,
qtc: 'Z06',
costName: this.costName
}).then(res => {
if (res.data.success) {
this.$showMessage(res.data.message)
this.loading = false;
this.MATERIALPACKINGQTY = 0
this.MATERIALPACKINGNUMBER = 0
this.resetValue();
} else {
this.loading = false;
this.$showMessage(res.data.message)
}
this.$nextTick(() => {
this.focusBarCode = true
this.focusShipRequest = false
})
}).catch(err => {
this.loading = false;
this.$showMessage(err)
this.$nextTick(() => {
this.focusBarCode = true
this.focusShipRequest = false
})
});
})
},
resetValue() {
this.opCode = "";
this.MATERIALPACKINGNAME = "";
this.LocationName = "";
// this.ERPFACTORY = "";
this.ERPLOCATION = "";
this.BoxListInfo = [];
this.RECEIVEACTNO = "";
this.MATERIALSPECNAME = "";
this.PHASE = "";
this.SPECNAME = "";
this.DESC_CN = "";
this.CHARGE = "";
this.LOCATIONNAME = "";
this.costName = "";
}
}
}
</script>
<style>
.btn-bottom {
position: fixed;
bottom: 0;
width: 100%;
left: 0;
}
</style>
<style lang="scss">
switch {
color: #FFCC33;
}
/* 基础样式 */
.picker {
display: flex;
flex-direction: column;
align-items: flex-start;
width: 100%;
/* 根据需要调整宽度 */
}
.row {
display: flex;
justify-content: space-between;
margin-bottom: 10px;
/* 行与行之间的间距 */
}
.col {
flex: 1;
/* 使得每列占据相等的空间 */
display: flex;
flex-direction: column;
align-items: flex-start;
}
label {
// font-weight: bold;
/* 标签加粗 */
margin-bottom: 5px;
/* 标签和值之间的间距 */
}
.value {
/* 值的样式,可以根据需要调整 */
}
</style>

View File

@ -0,0 +1,554 @@
<template>
<view>
<view>
<navVar :mysNavConfig="navConfig" @onLeftClick="onLeftClick"></navVar>
</view>
<view style="margin: 10rpx;">
<u-form ref="testForm">
<u-form-item :border-bottom="false">
<p>供应商:</p>
<u-input :border="true" v-model="lifnr" placeholder="请输入供应商" :focus="focusBarCode"/>
</u-form-item>
<u-form-item :border-bottom="false">
<label>选择仓库:</label>&nbsp;&nbsp;&nbsp;&nbsp;
<zxzUniDataSelect filterable v-model="ERPLOCATION" :localdata="items" @change="change">
</zxzUniDataSelect>
</u-form-item>
<u-form-item :border-bottom="false">
<label>选择库位:</label>&nbsp;&nbsp;&nbsp;&nbsp;
<!-- <uni-data-select v-model="LOCATIONNAME" :localdata="items_Location" @change="change2"></uni-data-select> -->
<zxzUniDataSelect filterable v-model="LOCATIONNAME" :localdata="items_Location"
:disabled="Locatiaon_state"></zxzUniDataSelect>
</u-form-item>
<u-form-item :border-bottom="false">
<p>扫描条码:</p>
<u-input :border="true" v-model="MATERIALPACKINGNAME" placeholder="请扫描条码" :focus="focusBarCode"
@confirm="ScanFGBarCode" />
</u-form-item>
<br />
<u-row>
<u-col span="3"><label>扫描标签</label> </u-col>
<u-col span="9"><label>{{MATERIALPACKINGQTY}}</label> </u-col>
<u-col span="3"><label style="text-align: right;">扫描数量</label> </u-col>
<u-col span="9"><label>{{MATERIALPACKINGNUMBER}}</label> </u-col>
</u-row>
</u-form>
<br />
<zb-table style="height: 450upx;" ref="zbTable" :show-header="true" :columns="column" :stripe="true"
:fit="true" :highlight="true" :border="true" :data="BoxListInfo" @dele="del"></zb-table>
<br />
<view class="tabbar_bottom">
<u-input v-if="false" v-model="opCode" />
<uni-datetime-picker style="align-items: center;" type="date" :clear-icon="false" v-model="commitDate"
@maskClick="maskClick" />
<u-button @click="NoInvoiceStockIn" type="primary" :loading="loading">确定</u-button>
</view>
<u-modal :show="showModal" :title="titleModal" :content='contentModal'></u-modal>
</view>
</view>
</template>
<script>
import zxzUniDataSelect from "@/components/zxz-uni-data-select/zxz-uni-data-select.vue"
import navVar from "@/components/navBar/navBar.vue"
import {
getOpCode
} from '@/common/api.js';
import { cals } from '@/utils/cal'
export default {
components: {
zxzUniDataSelect,
navVar
},
data() {
return {
showModal: false,
titleModal: "提示",
contentModal: '是否确定返回?',
navConfig: {
navPadding: false,
isHome: false,
navPadding: true,
navFixed: true,
bgImage: 'linear-gradient(45deg, rgb(28, 187, 180), rgb(141, 198, 63))',
isCustomFn: true,
navTitle: {
text: "委外退料入库",
color: "rgb(96, 98, 102)",
fontSize: "14px", // px upx rpx
fontWeight: "normal", // blod
},
leftText: {
text: "返回",
color: "rgb(96, 98, 102)",
fontSize: "14px", // px upx rpx
fontWeight: "", // blod
},
leftIconPath: '../../../../static/img/back.png'
},
column: [ //
{
name: 'MATERIALPACKINGNAME',
label: '标签',
align: 'center',
// fixed: true,
// width: 210
},
{
name: 'CHARGE',
label: '批次'
},
{
name: 'DESC_CN',
label: '品名'
},
{
name: 'MATERIALSPECNAME',
label: '料号'
},
{
name: 'SPECNAME',
label: '规格'
},
{
name: 'PHASE',
label: '阶段'
},
{
name: 'MATERIALQUANTITY',
label: '数量'
},
{
name: 'ERPFACTORY',
label: '组织'
},
{
name: 'ERPLOCATION',
label: '仓库'
},
{
name: 'LOCATIONNAME',
label: '货位'
},
{
name: 'operation',
type: 'operation',
label: '操作',
renders: [{
name: '删除',
size: 'mini',
type: 'warn',
func: "dele"
}, ]
},
],
orgObject: {
ERPFACTORY: '',
DESCRIPTION: ''
}, //
LocationName: '', //
LOCATIONNAME: '',
MATERIALPACKINGQTY: 0,
MATERIALPACKINGNUMBER: 0,
ERPFACTORY: JSON.parse(uni.getStorageSync('orgObject')).ERPFACTORY, //
ERPFACTORYNAME: JSON.parse(uni.getStorageSync('orgObject')).DESCRIPTION, //
ERPLOCATION: '', //
tabH: 800, //
MATERIALSPECNAME: '',
MATERIALPACKINGNAME: '', //
lifnr: '',
Locatiaon_state: false,
CHARGE: '', //
DESC_CN: '', //
SPECNAME: '', //
RECEIVEACTNO: '', //
UNIT: '', //
PHASE: '', //
QTY: '', //
background: {
backgroundImage: 'linear-gradient(45deg, rgb(28, 187, 180), rgb(141, 198, 63))'
}, //
colors: ['#007aff', '#4cd964', '#dd524d'],
styleType: 'button',
current: 0,
BoxListInfo: [], //
colorIndex: 0,
activeColor: '#007aff',
loading: false,
scanData: [], //
barCode: "", //
DURABLENAMECode: "", //
focusBarCode: false, //
focusShipRequest: true, //
siteName: "",
userId: "",
items: [],
items_Location: [],
commitDate: '',
opCode: '',
}
},
mounted() {
this.tabH = this.$GetRemainingHeight(4, 0); //
let that = this
uni.getStorage({
key: "sitename",
success(res) {
that.siteName = res.data
}
})
uni.getStorage({
key: "userid",
success(res) {
that.userId = res.data
}
})
this.orgObject = JSON.parse(uni.getStorageSync('orgObject'))
this.getTimeData();
this.getERPLocation();
// let Things = 20
// for (var i = 0; i < Things; i++) {
// this.BoxListInfo.push({aa:"1"})
// }
},
methods: {
getTimeData() {
var year = new Date().getFullYear(); //
if (year < 1900) year = year + 1900;
var month = new Date().getMonth() + 1; //
if (month < 10) month = '0' + month;
var day = new Date().getDate(); //
if (day < 10) day = '0' + day;
const calendar1 = year + '-' + month + '-' + day
this.commitDate = calendar1
},
maskClick(e) {
console.log('maskClick事件:', e);
},
onLeftClick() {
uni.showModal({
title: this.titleModal, //
content: this.contentModal, //
showCancel: true, // true
cancelText: '取消', //
confirmText: '确定', //
success(res) {
if (res.confirm) {
uni.navigateBack({
delta: 1 // delta
});
console.log('用户点击了确定');
//
} else if (res.cancel) {
console.log('用户点击了取消');
//
}
}
})
},
del(row, index) {
this.BoxListInfo.splice(index, 1)
this.MATERIALPACKINGNUMBER = this.MATERIALPACKINGNUMBER - row.MATERIALQUANTITY
this.MATERIALPACKINGQTY = this.MATERIALPACKINGQTY - 1
this.$showMessage("删除成功")
},
change(e) {
this.ERPLOCATION = e.value;
this.LOCATIONNAME = ""
this.Huowei = e.Huowei
if (e.Huowei == 'Y') {
this.Locatiaon_state = false
this.getLocationName();
} else {
this.$showMessage(e.text + "仓库没有启用货位管理")
this.Locatiaon_state = true
this.focusBarCode = true
}
},
//
getfocus(nextfocus) {
this.initfocus()
this[nextfocus]
this.$nextTick(() => { //vuenextTick
this[nextfocus] = true
})
},
getERPLocation() {
this.items = [];
this.$MyRequest('/api/storage/getERPLocation', {
ERPFACTORYNAME: this.ERPFACTORY
}).then(res => {
if (res.data.success) {
for (let i = 0; i < res.data.resultObj.length; i++) {
var _Arr = res.data.resultObj[i];
this.items.push({
text: _Arr.DESCRIPTION,
value: _Arr.ERPLOCATIONNAME,
Huowei: _Arr.USE_LOCATION,
});
}
} else {
this.$showMessage(res.data.message)
}
});
},
getLocationName() {
this.items_Location = []
if (this.ERPLOCATION != '') {
this.$MyRequest('/api/storage/getLocationNameForERPLocation', {
ERPLocation: this.ERPLOCATION
}).then(res => {
if (res.data.success) {
for (let i = 0; i < res.data.resultObj.length; i++) {
var _Arr = res.data.resultObj[i];
this.items_Location.push({
text: _Arr.DESCRIPTION,
value: _Arr.STORAGENAME
});
}
} else {
this.$showMessage(res.data.message)
}
this.focusBarCode = true
this.focusShipRequest = false
}).catch(err => {
this.$showMessage(err)
});
} else {
this.$showMessage("请先选择仓库")
}
},
async ScanFGBarCode() {
this.focusBarCode = false;
if (this.BoxListInfo.some(box => box.MATERIALPACKINGNAME === this.MATERIALPACKINGNAME)) {
this.$showMessage("改标签已扫描,请不要重复扫描!");
this.$nextTick(() => {
this.MATERIALPACKINGNAME = ""
this.focusBarCode = true
this.focusShipRequest = false
})
this.$playFail()
return;
}
// if ((this.LOCATIONNAME == null || this.LOCATIONNAME == "") && (this.Huowei == 'Y')) {
// this.$showMessage("");
// this.$nextTick(() => {
// this.MATERIALPACKINGNAME = ""
// this.focusBarCode = true
// this.focusShipRequest = false
// })
// this.$playFail()
// return;
// }
if (this.ERPFACTORY == null || this.ERPFACTORY == "") {
this.$showMessage("请选择组织!");
this.$nextTick(() => {
this.MATERIALPACKINGNAME = ""
this.focusBarCode = true
this.focusShipRequest = false
})
this.$playFail()
return;
}
if (this.ERPLOCATION == null || this.ERPLOCATION == "") {
this.$showMessage("请选择仓库!");
this.$nextTick(() => {
this.MATERIALPACKINGNAME = ""
this.focusBarCode = true
this.focusShipRequest = false
})
this.$playFail()
return;
}
var barCodeArr = this.MATERIALPACKINGNAME.split("|");
// 470110856|1|C|75mm*1000m|SHBP01JT1202305240009|20230524|11|75
if (barCodeArr.length < 7) {
this.$showMessage("条码规则不符合需求!")
this.$nextTick(() => {
this.MATERIALPACKINGNAME = ""
this.focusBarCode = true
this.focusShipRequest = false
})
this.$playFail()
return;
}
// this.loading = true;
this.MATERIALPACKINGQTY = 0
this.MATERIALPACKINGNUMBER = 0
await this.$MyRequest('/api/NoInvoice/getBarCode', {
MATERIALPACKINGNAME: this.MATERIALPACKINGNAME,
LOCATIONNAME: this.LOCATIONNAME,
ERPFACTORY: this.ERPFACTORY,
ERPLOCATION: this.ERPLOCATION,
CREATEUSER: this.userId
}).then(res => {
if (res.data.success) {
var _Arr = res.data.resultObj;
// this.MATERIALPACKINGNAME = _Arr[0].MATERIALPACKINGNAME;
// this.CHARGE = _Arr[0].CHARGE;
// this.MATERIALSPECNAME = _Arr[0].MATERIALSPECNAME;
// this.SPECNAME = _Arr[0].SPECNAME;
// this.DESC_CN = _Arr[0].DESC_CN;
// this.PHASE = _Arr[0].PHASE;
// console.log(new Set(this.BoxListInfo))
this.BoxListInfo.push(...res.data.resultObj);
this.MATERIALPACKINGQTY = this.BoxListInfo.length
for (let i = 0; i < this.BoxListInfo.length; i++) {
this.MATERIALPACKINGNUMBER = (cals.add(this.MATERIALPACKINGNUMBER,this.BoxListInfo[i].MATERIALQUANTITY)).toNumber()
}
// this.loading = false;
this.$nextTick(() => {
this.MATERIALPACKINGNAME = ""
this.focusBarCode = true
this.focusShipRequest = false
})
try {
Vue.prototype.$playSuccess()
} catch (e) {}
} else {
// this.loading = false;
this.$showMessage(res.data.message)
this.$nextTick(() => {
this.MATERIALPACKINGNAME = ""
this.focusBarCode = true
this.focusShipRequest = false
})
this.$playFail()
}
}).catch(err => {
this.loading = false;
this.$showMessage(err)
this.$nextTick(() => {
this.MATERIALPACKINGNAME = ""
this.focusBarCode = true
this.focusShipRequest = false
})
this.$playFail()
});
},
/**
* 入库审核
*/
NoInvoiceStockIn() {
console.log(this.commitDate)
if (this.BoxListInfo.length <= 0) {
this.$showMessage("入库列表为空")
return
}
this.loading = true;
this.focusBarCode = false
this.BoxListInfo.map(item => {
if (item.hasOwnProperty("key")) {
delete item.key
}
})
getOpCode({
opcode: this.opCode,
user: this.userId
}).then((res) => {
this.$MyRequest('/api/NoInvoice/QTRCommit', {
boxList: this.BoxListInfo,
user: this.userId,
commitDate: this.commitDate,
opcode: this.opCode,
qtc: '542O',
lifnr: this.lifnr
}).then(res => {
if (res.data.success) {
this.$showMessage(res.data.message)
this.loading = false;
this.MATERIALPACKINGQTY = 0
this.MATERIALPACKINGNUMBER = 0
this.resetValue();
} else {
this.loading = false;
this.$showMessage(res.data.message)
}
this.$nextTick(() => {
this.focusBarCode = true
this.focusShipRequest = false
})
}).catch(err => {
this.loading = false;
this.$showMessage(err)
this.$nextTick(() => {
this.focusBarCode = true
this.focusShipRequest = false
})
});
})
},
resetValue() {
this.opCode = "";
this.MATERIALPACKINGNAME = "";
this.LocationName = "";
// this.ERPFACTORY = "";
this.ERPLOCATION = "";
this.BoxListInfo = [];
this.RECEIVEACTNO = "";
this.MATERIALSPECNAME = "";
this.PHASE = "";
this.SPECNAME = "";
this.DESC_CN = "";
this.CHARGE = "";
this.LOCATIONNAME = "";
this.lifnr = "";
}
}
}
</script>
<style>
.btn-bottom {
position: fixed;
bottom: 0;
width: 100%;
left: 0;
}
</style>
<style lang="scss">
switch {
color: #FFCC33;
}
/* 基础样式 */
.picker {
display: flex;
flex-direction: column;
align-items: flex-start;
width: 100%;
/* 根据需要调整宽度 */
}
.row {
display: flex;
justify-content: space-between;
margin-bottom: 10px;
/* 行与行之间的间距 */
}
.col {
flex: 1;
/* 使得每列占据相等的空间 */
display: flex;
flex-direction: column;
align-items: flex-start;
}
label {
// font-weight: bold;
/* 标签加粗 */
margin-bottom: 5px;
/* 标签和值之间的间距 */
}
.value {
/* 值的样式,可以根据需要调整 */
}
</style>

View File

@ -122,7 +122,7 @@
bgImage: 'linear-gradient(45deg, rgb(28, 187, 180), rgb(141, 198, 63))', bgImage: 'linear-gradient(45deg, rgb(28, 187, 180), rgb(141, 198, 63))',
isCustomFn: true, isCustomFn: true,
navTitle: { navTitle: {
text: "无来源入库", text: "客供品入库",
color: "rgb(96, 98, 102)", color: "rgb(96, 98, 102)",
fontSize: "14px", // px upx rpx fontSize: "14px", // px upx rpx
fontWeight: "normal", // blod fontWeight: "normal", // blod
@ -425,7 +425,7 @@
// this.loading = true; // this.loading = true;
this.MATERIALPACKINGQTY = 0 this.MATERIALPACKINGQTY = 0
this.MATERIALPACKINGNUMBER = 0 this.MATERIALPACKINGNUMBER = 0
await this.$MyRequest('/NoInvoice/getBarCode', { await this.$MyRequest('/api/NoInvoice/getBarCode', {
MATERIALPACKINGNAME: this.MATERIALPACKINGNAME, MATERIALPACKINGNAME: this.MATERIALPACKINGNAME,
LOCATIONNAME: this.LOCATIONNAME, LOCATIONNAME: this.LOCATIONNAME,
ERPFACTORY: this.ERPFACTORY, ERPFACTORY: this.ERPFACTORY,
@ -498,18 +498,20 @@
opcode: this.opCode, opcode: this.opCode,
user: this.userId user: this.userId
}).then((res) => { }).then((res) => {
this.$MyRequest('/NoInvoice/QTRCommit', { this.$MyRequest('/api/NoInvoice/QTRCommit', {
boxList: this.BoxListInfo, boxList: this.BoxListInfo,
user: this.userId, user: this.userId,
commitDate: this.commitDate, commitDate: this.commitDate,
opcode: this.opCode, opcode: this.opCode,
qtc: '501'
}).then(res => { }).then(res => {
if (res.data.success) { if (res.data.success) {
this.$showMessage(res.data.message)
this.loading = false; this.loading = false;
this.MATERIALPACKINGQTY = 0 this.MATERIALPACKINGQTY = 0
this.MATERIALPACKINGNUMBER = 0 this.MATERIALPACKINGNUMBER = 0
this.resetValue(); this.resetValue();
this.$showMessage(res.data.message)
} else { } else {
this.loading = false; this.loading = false;
this.$showMessage(res.data.message) this.$showMessage(res.data.message)

View File

@ -579,14 +579,14 @@
this.isLoading = true; this.isLoading = true;
console.log(this.disableButton) console.log(this.disableButton)
let list = this.BoxListInfo; let list = this.BoxListInfo;
if (list <= 0) { // if (list <= 0) {
try {Vue.prototype.$playFail() } catch (e) {} // try {Vue.prototype.$playFail() } catch (e) {}
this.disableButton = false; // this.disableButton = false;
console.log(this.disableButton) // console.log(this.disableButton)
this.isLoading = false; // this.isLoading = false;
this.$showMessage("不存在需要提交的信息") // this.$showMessage("")
return; // return;
} // }
console.log(this.userId) console.log(this.userId)
getOpCode({opcode : this.opCode,user: this.userId}).then((res) => { getOpCode({opcode : this.opCode,user: this.userId}).then((res) => {
console.log(res.resultObj) console.log(res.resultObj)

View File

@ -115,12 +115,12 @@
label: '销售退货入库', label: '销售退货入库',
id: '100003' id: '100003'
}, { }, {
title: '其入库', title: '其入库',
name: 'OtherStockIn/index', name: 'OtherStockIn/index',
en_name: 'OtherStockIn', en_name: 'OfferingsStockIn',
color: 'yellow', color: 'yellow',
cuIcon: 'OtherStockIn/index', cuIcon: 'OtherStockIn/index',
label: '其入库', label: '其入库',
id: '100004' id: '100004'
}, { }, {
title: '退料入库', title: '退料入库',
@ -132,12 +132,12 @@
id: '100005' id: '100005'
}, },
{ {
title: '无单据入库', title: '客供品入库',
name: 'OtherStockInNoInvoic/OtherStockInNoInvoic', name: 'OtherStockInNoInvoic/OtherStockInNoInvoic',
en_name: 'OtherStockInNoInvoic', en_name: 'OtherStockInNoInvoic',
color: 'mauve', color: 'mauve',
cuIcon: '', cuIcon: '',
label: '无单据入库', label: '客供品入库',
id: '100006' id: '100006'
}, },
{ {
@ -149,6 +149,24 @@
label: '无单据入库2', label: '无单据入库2',
id: '100007' id: '100007'
}, },
{
title: '委外退料入库',
name: 'MaterialReturnStockIn/index',
en_name: 'MaterialReturnStockIn',
color: 'yellow',
cuIcon: 'OtherStockIn/index',
label: '委外退料入库',
id: '100008'
},
{
title: '盘盈入库',
name: 'InventoryProfitStockIn/index',
en_name: 'InventoryProfitStockIn',
color: 'yellow',
cuIcon: 'OtherStockIn/index',
label: '盘盈入库',
id: '100009'
}
], ],
} }
}, },