工器具退料
This commit is contained in:
parent
217a917a49
commit
293da5a635
|
|
@ -16,19 +16,16 @@
|
|||
<span class="title">任务信息</span>
|
||||
</div>
|
||||
<uni-forms :model="taskInfo" label-width="170rpx" :border="true">
|
||||
<uni-forms-item label="班组:" name="teamName">
|
||||
<uni-forms-item label="退料班组:" name="teamName">
|
||||
<span style="height: 100%;display: flex;align-items: center;">{{ taskInfo.teamName }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="工程:" name="proName">
|
||||
<uni-forms-item label="工程名称:" name="proName">
|
||||
<span style="height: 100%;display: flex;align-items: center;">{{ taskInfo.proName }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="单号:" name="code">
|
||||
<span style="height: 100%;display: flex;align-items: center;">{{ taskInfo.code }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="人员:" name="backPerson">
|
||||
<uni-forms-item label="退料人员:" name="backPerson">
|
||||
<span style="height: 100%;display: flex;align-items: center;">{{ taskInfo.backPerson }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="电话:" name="phone">
|
||||
<uni-forms-item label="联系电话:" name="phone">
|
||||
<span style="height: 100%;display: flex;align-items: center;">{{ taskInfo.phone }}</span>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
|
|
@ -68,9 +65,9 @@
|
|||
<uni-th width="100px" style="font-size: 24rpx;" align="center">规格型号</uni-th>
|
||||
<uni-th width="60px" style="font-size: 24rpx;" align="center">在用数</uni-th>
|
||||
<uni-th width="90px" style="font-size: 24rpx;" align="center">退料数</uni-th>
|
||||
<!-- <uni-th width="90px" style="font-size: 24rpx;" align="center">外观</uni-th> -->
|
||||
<uni-th width="90px" style="font-size: 24rpx;" align="center">完好数量</uni-th>
|
||||
<uni-th width="90px" style="font-size: 24rpx;" align="center">损坏数量</uni-th>
|
||||
<uni-th width="90px" style="font-size: 24rpx;" align="center">损坏价值判定</uni-th>
|
||||
<!-- <uni-th width="90px" style="font-size: 24rpx;" align="center">完好数量</uni-th>-->
|
||||
<!-- <uni-th width="90px" style="font-size: 24rpx;" align="center">损坏数量</uni-th>-->
|
||||
<uni-th width="70px" style="font-size: 24rpx;" align="center">操作</uni-th>
|
||||
</uni-tr>
|
||||
<!-- 表格数据行 -->
|
||||
|
|
@ -88,40 +85,40 @@
|
|||
:styles="{width: '100rpx'}"
|
||||
/>
|
||||
</uni-td>
|
||||
<uni-td style="font-size: 24rpx;text-align: center;">
|
||||
<uni-easyinput
|
||||
placeholder="完好数量"
|
||||
v-model="item.goodNum"
|
||||
type="number"
|
||||
:clearable="false"
|
||||
@change="changeNum(item)"
|
||||
:styles="{width: '100rpx'}"
|
||||
:disabled="!item.preNum"
|
||||
/>
|
||||
</uni-td>
|
||||
<uni-td style="font-size: 24rpx;text-align: center;">
|
||||
<uni-easyinput
|
||||
placeholder="损坏数量"
|
||||
v-model="item.badNum"
|
||||
type="number"
|
||||
:clearable="false"
|
||||
@change="changeNum(item)"
|
||||
:styles="{width: '100rpx'}"
|
||||
:disabled="!item.preNum"
|
||||
/>
|
||||
</uni-td>
|
||||
<!-- <uni-td style="font-size: 24rpx;text-align: center;">
|
||||
<uni-easyinput
|
||||
placeholder="外观"
|
||||
<!-- <uni-td style="font-size: 24rpx;text-align: center;"> -->
|
||||
<!-- <uni-easyinput -->
|
||||
<!-- placeholder="完好数量" -->
|
||||
<!-- v-model="item.goodNum" -->
|
||||
<!-- type="number" -->
|
||||
<!-- :clearable="false" -->
|
||||
<!-- @change="changeNum(item)"-->
|
||||
<!-- :styles="{width: '100rpx'}"-->
|
||||
<!-- :disabled="!item.preNum"-->
|
||||
<!-- />-->
|
||||
<!-- </uni-td>-->
|
||||
<!-- <uni-td style="font-size: 24rpx;text-align: center;"> -->
|
||||
<!-- <uni-easyinput -->
|
||||
<!-- placeholder="损坏数量" -->
|
||||
<!-- v-model="item.badNum" -->
|
||||
<!-- type="number" -->
|
||||
<!-- :clearable="false" -->
|
||||
<!-- @change="changeNum(item)"-->
|
||||
<!-- :styles="{width: '100rpx'}"-->
|
||||
<!-- :disabled="!item.preNum"-->
|
||||
<!-- />-->
|
||||
<!-- </uni-td>-->
|
||||
<uni-td style="font-size: 24rpx;text-align: center;">
|
||||
<uni-easyinput
|
||||
placeholder="损坏价值判定"
|
||||
v-model="item.apDetection"
|
||||
:styles="{width: '100rpx'}"
|
||||
/>
|
||||
</uni-td> -->
|
||||
</uni-td>
|
||||
<uni-td style="font-size: 24rpx;text-align: center;">
|
||||
<view class="uni-group">
|
||||
<view class="action-btn" @click="uploadImg(item)">
|
||||
<uni-icons type="camera" size="20" style="color: #3784fb;"/>
|
||||
</view>
|
||||
<!-- <view class="action-btn" @click="uploadImg(item)">-->
|
||||
<!-- <uni-icons type="camera" size="20" style="color: #3784fb;"/>-->
|
||||
<!-- </view>-->
|
||||
<view class="action-btn delete" @click="delRow(index)">
|
||||
<uni-icons type="trash-filled" size="20" style="color: red;margin-left:10px;"/>
|
||||
</view>
|
||||
|
|
@ -140,10 +137,11 @@
|
|||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { getUseType,insertApp } from '../../services/back.js';
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { editBack, getUseType, insertApp } from '../../services/back.js'
|
||||
const title = ref('退料任务')
|
||||
const taskInfo = ref({})
|
||||
const tableList = ref({})
|
||||
const maTypeSelectList = ref([])
|
||||
const typeId = ref("")//类型
|
||||
const maCodeSelectList = ref([])
|
||||
|
|
@ -218,16 +216,24 @@ const submitNum = () => {
|
|||
icon: 'none',
|
||||
})
|
||||
return
|
||||
} else if (typeList.value[i].preNum< typeList.value[i].num) {
|
||||
uni.showToast({
|
||||
title: `第${i + 1}行退料数量不能大于在用数量`,
|
||||
icon: 'none',
|
||||
duration: 1000,
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
let obj = {
|
||||
"backApplyInfo":taskInfo.value,
|
||||
"backApplyDetailsList":typeList.value
|
||||
"backApplyInfo": taskInfo.value,
|
||||
"backApplyDetailsList": [...typeList.value, ...tableList.value]
|
||||
}
|
||||
insertApp(obj).then(res => {
|
||||
console.log("obj:",obj)
|
||||
editBack(obj).then(res => {
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
uni.showToast({ title: '编辑成功', icon: 'none' })
|
||||
uni.showToast({ title: '保存成功', icon: 'none' })
|
||||
uni.navigateBack({
|
||||
delta: 1 // 返回到已存在的页面
|
||||
});
|
||||
|
|
@ -235,8 +241,8 @@ const submitNum = () => {
|
|||
uni.showToast({ title: res.msg, icon: 'none' })
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
})
|
||||
console.log(error)
|
||||
})
|
||||
}
|
||||
//上传
|
||||
const uploadImg = (item) => {
|
||||
|
|
@ -342,9 +348,8 @@ const back = () => {
|
|||
}
|
||||
|
||||
onLoad((options)=>{
|
||||
console.log(options)
|
||||
taskInfo.value = JSON.parse(options.taskInfo)
|
||||
console.log(taskInfo.value)
|
||||
tableList.value = JSON.parse(options.tableList)
|
||||
getMaType()
|
||||
})
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
<view class="addBtn" @click="goNum">数量退料</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<scroll-view scroll-y @scrolltolower="onScrollTolower" class="scroll-container">
|
||||
<div class="table-list-item" v-for="(item, index) in tableList" :key="index" @click="handleItem(item)">
|
||||
<uni-swipe-action class="swipe-action">
|
||||
<uni-swipe-action-item @click="onClick($event, item)" :right-options="item.manageType==1 ? options:options2">
|
||||
|
|
@ -63,12 +64,13 @@
|
|||
</uni-swipe-action>
|
||||
|
||||
</div>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue'
|
||||
import { getBackInfo,deleteNumType } from '../../services/back.js';
|
||||
import { getBackInfo, deleteNumType, deleteDetailsById } from '../../services/back.js'
|
||||
import { onLoad,onShow } from '@dcloudio/uni-app'
|
||||
const title = ref('退料任务')
|
||||
const keyWord = ref('')
|
||||
|
|
@ -138,7 +140,7 @@ const goCode = () => {
|
|||
}
|
||||
//数量新增
|
||||
const goNum = () => {
|
||||
uni.navigateTo({ url: `/pages/toolsBack/toolsBackNum?taskInfo=${JSON.stringify(taskInfo.value)}` })
|
||||
uni.navigateTo({ url: `/pages/toolsBack/toolsBackNum?taskInfo=${JSON.stringify(taskInfo.value)}&tableList=${JSON.stringify(tableList.value)}` })
|
||||
}
|
||||
const onClick = (e, item) => {
|
||||
const { index } = e
|
||||
|
|
@ -154,9 +156,8 @@ const onClick = (e, item) => {
|
|||
if (index === 1) {
|
||||
let param = {
|
||||
id:item.id,
|
||||
parentId:item.parentId
|
||||
}
|
||||
deleteNumType(param).then(res => {
|
||||
deleteDetailsById(param).then(res => {
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
uni.showToast({ title: '删除成功', icon: 'none' })
|
||||
|
|
|
|||
|
|
@ -17,7 +17,25 @@ export const getBackInfo = (id,keyWord) => {
|
|||
})
|
||||
}
|
||||
|
||||
// 单位下拉选
|
||||
// 退料修改
|
||||
export const editBack = (data) => {
|
||||
return http({
|
||||
method: 'POST',
|
||||
url: '/material/back_apply_info//edit',
|
||||
data:data,
|
||||
})
|
||||
}
|
||||
|
||||
// 详情删除
|
||||
export const deleteDetailsById = (data) => {
|
||||
return http({
|
||||
method: 'POST',
|
||||
url: '/material/back_apply_info/deleteDetailsById',
|
||||
data:data,
|
||||
})
|
||||
}
|
||||
|
||||
// 单位下拉选
|
||||
export const getUnitList = (data) => {
|
||||
return http({
|
||||
method: 'POST',
|
||||
|
|
|
|||
Loading…
Reference in New Issue