初始化仓库

This commit is contained in:
tao
2025-12-18 14:11:48 +08:00
parent e96f277a68
commit 54ec472bd4
1107 changed files with 158756 additions and 0 deletions

View File

@@ -0,0 +1,178 @@
<template>
<view>
<uni-collapse>
<uni-forms :modelValue="jobInForm" ref="jobInForm" :rules="rules">
<uni-collapse-item title="领料出库单" :open="true">
<uni-forms-item label="工单" :labelWidth='90' name="pwoCode">
<uni-easyinput type="text" disabled v-model="jobInForm.pwoCode"></uni-easyinput>
</uni-forms-item>
<uni-forms-item label="生产领料任务单" :labelWidth='90' name="pwoJobCode">
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" type="text" @confirm="scanJobCode"
v-model="jobInForm.pwoJobCode"></uni-easyinput>
</uni-forms-item>
<uni-forms-item label="领料员" :labelWidth='90' name="equipmentCode">
<uni-easyinput suffixIcon="scan" @iconClick="scanBar1" type="text" v-model="equipmentCode">
</uni-easyinput>
</uni-forms-item>
<uni-forms-item label="出库员" :labelWidth='90' name="equipmentCode">
<uni-easyinput suffixIcon="scan" @iconClick="scanBar1" type="text" v-model="equipmentCode">
</uni-easyinput>
</uni-forms-item>
</uni-collapse-item>
<uni-collapse-item title="领料出库单单明细" :open="true">
<!-- <u-button type="primary" @click="addDetail">新增</u-button>
<u-button type="primary" @click="submit">确认</u-button> -->
<uni-swipe-action>
<uni-swipe-action-item :rightOptions="rightOptions" :key="index"
v-for="(item, index) in jobInForm.mesPwoJobCvDetailList"
@click="(data) => clickDetail(index,data)" @change="swipChange">
<uni-badge :text="index+1" type="primary"></uni-badge>
<uni-forms-item label="物料编码" :labelWidth='90'
:name="'mesPwoJobCvDetailList.'+ index +'.materialCode'">
<uni-easyinput type="text" disabled v-model="item.materialCode"></uni-easyinput>
</uni-forms-item>
<uni-forms-item label="物料名称" :labelWidth='90'
:name="'mesPwoJobCvDetailList.'+ index +'.materialName'">
<uni-easyinput type="text" disabled v-model="item.materialName"></uni-easyinput>
</uni-forms-item>
<uni-forms-item label="物料批号" :labelWidth='90'
:name="'mesPwoJobCvDetailList.'+ index +'.materialBatch'">
<uni-easyinput type="text" disabled v-model="item.materialBatch"></uni-easyinput>
</uni-forms-item>
<uni-forms-item label="物料箱号" :labelWidth='90'
:name="'mesPwoJobCvDetailList.'+ index +'.whCodeDest'">
<uni-easyinput type="text" disabled v-model="item.whCodeDest"></uni-easyinput>
</uni-forms-item>
<uni-forms-item label="库区编码" :labelWidth='90'
:name="'mesPwoJobCvDetailList.'+ index +'.locCodeDest'">
<uni-easyinput type="text" disabled v-model="item.locCodeDest"></uni-easyinput>
</uni-forms-item>
<uni-forms-item label="出库数量" :labelWidth='90'
:name="'mesPwoJobCvDetailList.'+ index +'.locCodeDest'">
<uni-easyinput type="text" disabled v-model="item.locCodeDest"></uni-easyinput>
</uni-forms-item>
</uni-swipe-action-item>
</uni-swipe-action>
</uni-collapse-item>
</uni-forms>
</uni-collapse>
<u-button type="primary" @click="jobInSubmit">提交</u-button>
</view>
</template>
<script>
import {
handleConvert,
getEquipment,
addConversion,
listEmpEqpHistory,
listEmployee,
listConversion
} from "@/api/mes/jobIn.js";
import {
updatePwoJob,
listEquipment,
getPwoJob,
listPwoJob
} from "@/api/mes/jobReport.js"
export default {
data() {
return {
jobInForm: {
mesPwoJobCvDetailList: [],
},
equipmentCode: null,
flag: true,
show: false,
operateBy: null,
operateByCode: null,
rightOptions: [{
text: '删除',
style: {
backgroundColor: '#ff2a17'
}
}, ],
rules: {
materialCode: [{
required: true,
errorMessage: '请输入物料编码!'
}],
materialName: [{
required: false,
errorMessage: '请输入物料名称!'
}],
number: [{
required: true,
errorMessage: '请输入转移数量!'
}],
equipmentCode: [{
required: true,
errorMessage: '请输入设备编码!'
}]
}
}
},
mounted() {},
methods: {
scanJobCode(code) {
},
jobInSubmit() {
this.jobInForm.operateBy = this.operateBy
console.log(this.jobInForm);
this.$refs["jobInForm"].validate().then(valid => {
//作业转入
this.jobInForm.operateBy = this.operateBy
console.log(this.jobInForm);
addConversion(this.jobInForm).then(response => {
this.$modal.msgSuccess("转入成功!");
setTimeout(() => {
this.$tab.switchTab("/pages/work/index");
}, 500);
});
});
},
//作业编码
scanBar() {
const _this = this;
uni.scanCode({
scanType: ['barCode', 'qrCode'],
success: function(res) {
_this.jobInForm.pwoJobCode = res.result;
_this.scanJobCode(_this.jobInForm.pwoJobCode);
}
});
},
//设备编码
scanBar1() {
const _this = this;
uni.scanCode({
scanType: ['barCode', 'qrCode'],
success: function(res) {
_this.equipmentCode = res.result;
}
});
},
//操作人编码
scanBar2() {
const _this = this;
uni.scanCode({
scanType: ['barCode', 'qrCode'],
success: function(res) {
_this.operateByCode = res.result;
_this.scanBarOperateBy();
}
});
},
}
}
</script>
<style>
</style>

View File

@@ -0,0 +1,249 @@
<template>
<view>
<uni-forms ref="form" :modelValue="formData" :rules="rules">
<uni-row>
<uni-col :span="24">
<uni-forms-item label="领料任务单" :labelWidth='90' name="llrwdCode">
<uni-easyinput suffixIcon="scan" @iconClick="scanBar" v-model="formData.llrwdCode" @confirm="scanBarCode" type="text" />
</uni-forms-item>
</uni-col>
<uni-col :span="24">
<uni-forms-item label="拣货单" :labelWidth='90' name="pickCode">
<uni-easyinput suffixIcon="scan" @confirm="scanBarCode" @iconClick="scanBar4" v-model="formData.pickCode" type="text" />
</uni-forms-item>
</uni-col>
<uni-col :span="24">
<uni-forms-item label="物料编码" :labelWidth='90' name="wlCode">
<uni-easyinput disabled v-model="formData.wlCode" type="text" />
</uni-forms-item>
</uni-col>
<uni-col :span="24">
<uni-forms-item label="物料名称" :labelWidth='90' name="wlName">
<uni-easyinput type="text" v-model="formData.wlName" disabled/>
</uni-forms-item>
</uni-col>
<uni-col :span="24">
<uni-forms-item label="物料批号" :labelWidth='90' name="wlBatchNum">
<uni-easyinput disabled type="text" v-model="formData.wlBatchNum"/>
</uni-forms-item>
</uni-col>
<uni-col :span="24">
<uni-forms-item label="仓库编码" :labelWidth='90' name="ckCode">
<uni-easyinput disabled type="text" v-model="formData.ckCode"/>
</uni-forms-item>
</uni-col>
<uni-col :span="12">
<uni-forms-item label="原有数量" :labelWidth='90' name="yyNum">
<uni-easyinput disabled type="number" v-model="formData.yyNum"/>
</uni-forms-item>
</uni-col>
<uni-col :span="12">
<uni-forms-item label="拣货数量" :labelWidth='90' name="jhNum">
<uni-easyinput disabled type="number" v-model="formData.jhNum"/>
</uni-forms-item>
</uni-col>
<uni-col :span="12">
<uni-forms-item label="现有数量" :labelWidth='90' name="xyNum">
<uni-easyinput disabled type="number" v-model="formData.xyNum"/>
</uni-forms-item>
</uni-col>
<uni-col :span="12">
<uni-forms-item label="拣货区" :labelWidth='90' name="pickArea">
<uni-easyinput type="text" v-model="formData.pickArea"/>
</uni-forms-item>
</uni-col>
<uni-col :span="12">
<uni-forms-item label="拣货时间" :labelWidth='90' name="jhDate">
<view class="uni-list-cell-db">
<picker style="padding-top: 10px;" mode="date" :value="formData.jhDate" :start="startDate" :end="endDate" @change="bindDateChange">
<view class="uni-input" v-model="formData.jhDate">{{formData.jhDate}}</view>
</picker>
</view>
</uni-forms-item>
</uni-col>
</uni-row>
</uni-forms>
<u-button type="primary" @click="submit">提交</u-button>
</view>
</template>
<script>
var arry;
import {addPick,getTask,updatePick,listPick} from "@/api/wms/pdcMaterial.js";
import {listMaterial} from "@/api/wms/request.js";
export default{
mounted() {
this.test();
},
data(){
const currentDate = this.getDate({
format: true
})
return{
formData: {
llrwdCode : null,
wlCode : null,
wlName : null,
wlBatchNum : null,
ckCode : null,
yyNum : null,
jhNum : null,
xyNum : null,
jhDate : currentDate,
pickCode : null,
pickArea : null
},
rules:{
llrwdCode:{
rules:[
{required:true,errorMessage:'请输入领料任务单!'}
]
},
pickCode:{
rules:[
{required:true,errorMessage:'请输入拣货单!'}
]
},
pickArea:{
rules:[
{required:true,errorMessage:'请输入拣货区!'}
]
},
jhNum:{
rules:[
{required:true,errorMessage:'请输入拣货数量!'}
]
},
}
}
},
computed: {
startDate() {
return this.getDate('start');
},
endDate() {
return this.getDate('end');
}
},
methods:{
test(){
// 查询生产领料单详细
getTask('00000550').then(async res => {
console.log(res);
});
let q = {
drawTaskDetailCode : 'DRA200009495'
}
listPick(q).then(async res => {
console.log(res);
});
},
bindDateChange(e){
this.formData.jhDate = e.detail.value
},
getDate(type){
const date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
if (type === 'start') {
year = year - 60;
} else if (type === 'end') {
year = year + 2;
}
month = month > 9 ? month : '0' + month;
day = day > 9 ? day : '0' + day;
return `${year}-${month}-${day}`;
},
scanBarCode(){
if (this.formData.pickCode && this.formData.llrwdCode) {
let obj = {
drawTaskCode : this.formData.llrwdCode,
pickCode : this.formData.pickCode
}
console.log(obj);
listPick(obj).then(async res => {
console.log(res);
if(res.rows.length!=0){
arry = res.rows[0];
console.log(arry);
this.formData.wlBatchNum = res.rows[0].materialBatchNo,
this.formData.wlName = res.rows[0].materialName,
this.formData.wlCode = res.rows[0].materialCode,
this.formData.ckCode = res.rows[0].storageLocationCode,
this.formData.yyNum = res.rows[0].originNumber,
this.formData.jhNum = res.rows[0].pickNumber,
this.formData.xyNum = res.rows[0].originNumber-res.rows[0].pickNumber
}else{
this.$modal.msgError("未检索到该拣货信息!");
}
});
}else if(!this.formData.llrwdCode || this.formData.llrwdCode == "" || this.formData.llrwdCode == null){
this.$modal.msg("请输入领料任务单!");
}else if(!this.formData.pickCode || this.formData.pickCode == "" || this.formData.pickCode == null){
this.$modal.msg("请输入拣货单!");
}
},
// scanBarCode1(){
// if(!this.formData.pickCode || this.formData.pickCode == "" || this.formData.pickCode == null){
// this.$modal.msgError("请输入拣货单!");
// }
// },
//领料任务单
scanBar() {
const _this = this;
uni.scanCode({
scanType: ['barCode','qrCode'],
success: function (res) {
_this.formData.llrwdCode = res.result;
_this.scanBarCode();
}
});
},
//拣货单
scanBar4() {
const _this = this;
uni.scanCode({
scanType: ['barCode','qrCode'],
success: function (res) {
_this.formData.pickCode = res.result;
_this.scanBarCode(_this.formData.pickCode);
}
});
},
submit() {
const _this = this;
this.$refs.form.validate().then(res => {
uni.showModal({
title: '提示',
content: '您确定拣货该物料吗?',
success: function (res) {
if (res.confirm) {
arry.status = '2';
arry.inStatus = '2';
arry.pickArea = _this.formData.pickArea;
console.log(arry);
updatePick(arry).then(async res => {
_this.$modal.msgSuccess("拣货成功!");
setTimeout(()=>{
_this.$tab.switchTab("/pages/work/index");
}, 500);
});
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
});
},
}
}
</script>
<style>
</style>