数量退料

This commit is contained in:
bb_pan 2025-03-14 17:06:33 +08:00
parent 2f8e602865
commit 5cc7a9f280
1 changed files with 71 additions and 9 deletions

View File

@ -1,39 +1,68 @@
<template>
<view>
<view class="form-area">
<view>
<view class="view-item">
<h4>类型名称</h4>
<span>{{ upperInfo.typeName }}</span>
</view>
<view>
<view class="view-item">
<h4>规格型号</h4>
<span>{{ upperInfo.typeCode }}</span>
</view>
<view>
<view class="view-item">
<h4>待入库数量</h4>
<span>{{ upperInfo.num }}</span>
</view>
<view>
<view class="view-item">
<h4>合格数量</h4>
<uni-easyinput
type="number"
v-model="lowerIpt.passedNum"
placeholder="请输入数量"></uni-easyinput>
</view>
<view>
<view class="view-item">
<h4>待修数量</h4>
<uni-easyinput
type="number"
v-model="lowerIpt.waitRepairNum"
placeholder="请输入数量"></uni-easyinput>
</view>
<view>
<view class="view-item">
<h4>待修备注</h4>
<uni-easyinput
v-model="lowerIpt.repairRemark"
placeholder="请输入待修备注"></uni-easyinput>
</view>
<view class="view-item">
<h4>待报废数量</h4>
<uni-easyinput
type="number"
v-model="lowerIpt.waitCrashNum"
placeholder="请输入数量"></uni-easyinput>
</view>
<view class="view-item">
<h4>报废原因</h4>
<uni-data-select
v-model="lowerIpt.scrapReason"
:localdata="range"
></uni-data-select>
</view>
<view class="view-item">
<h4>待报废备注</h4>
<uni-easyinput
v-model="lowerIpt.scrapRemark"
placeholder="请输入待报废备注"></uni-easyinput>
</view>
<div class="view-item">
<h4>附件</h4>
<uni-file-picker
v-model="lowerIpt.fileList"
@select="uploadPhoto"
@delete="deletePhoto"
limit="9"
:del-icon="false"
></uni-file-picker>
</div>
</view>
<view class="sub-btn" @click="subForm"> 确认 </view>
</view>
@ -53,8 +82,16 @@
passedNum: "",
waitRepairNum: "",
waitCrashNum: "",
repairRemark: '', //
scrapReason: '', //
scrapRemark: '', //
fileList: [], //
},
totalNum: 0,
range: [
{value: 1, text: '人为'},
{value: 2, text: '自然损坏'},
]
};
},
methods: {
@ -102,6 +139,7 @@
.backMaterialSetNumBack({
taskId: this.upperInfo.taskId,
arr: this.handleSubmitData(),
fileList: this.lowerIpt.fileList,
})
.then((res) => {
console.log("res===", res);
@ -130,10 +168,13 @@
let repairInfo = {
backStatus: 2,
backNum: this.lowerIpt.waitRepairNum,
repairRemark: this.lowerIpt.repairRemark, //
};
let crashInfo = {
backStatus: 3,
backNum: this.lowerIpt.waitCrashNum,
scrapReason: this.lowerIpt.scrapReason, //
scrapRemark: this.lowerIpt.scrapRemark, //
};
if (this.lowerIpt.passedNum) {
@ -159,6 +200,27 @@
}
return list;
},
uploadPhoto (e) {
this.lowerIpt.fileList = []
console.log('🚀 ~ uploadPhoto ~ e:', e)
let that = this
//
for (let i = 0; i < e.tempFilePaths.length; i++) {
that.$api.fix.uploadPic(e.tempFilePaths[i]).then(res => {
let dealedData = JSON.parse(res.data)
if (dealedData.code == 200) {
this.lowerIpt.fileList.push({
fileName: dealedData.data.fileName,
fileUrl: dealedData.data.fileUrl,
typeId: this.upperInfo.modelId,
})
}
console.log('🚀 ~ this.lowerIpt.fileList ~ e:', this.lowerIpt.fileList)
}).catch(err => {
console.log(err);
})
}
},
},
onLoad(params) {
console.log("ev", params);
@ -167,14 +229,14 @@
};
</script>
<style lang="scss">
<style lang="scss" scoped>
.form-area {
width: 90%;
margin: 40rpx auto;
display: flex;
flex-direction: column;
view {
.view-item {
width: 100%;
display: flex;
align-items: center;
@ -191,7 +253,7 @@
}
}
view:last-child {
.view-item:last-child {
margin-bottom: 0;
}
}