退料任务
This commit is contained in:
parent
fd1d5ee503
commit
f1bddb161f
|
|
@ -127,6 +127,12 @@
|
|||
"navigationBarTitleText": "新增退料任务"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/back/backCodeAdd",
|
||||
"style": {
|
||||
"navigationBarTitleText": "新增退料任务"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/back/backCode",
|
||||
"style": {
|
||||
|
|
|
|||
|
|
@ -2,21 +2,21 @@
|
|||
<view class="accept page-common">
|
||||
<div class="card">
|
||||
<div>任务信息</div>
|
||||
<uni-forms :model="formData" label-width="160rpx" :border="true">
|
||||
<uni-forms :model="taskInfo" label-width="160rpx" :border="true">
|
||||
<uni-forms-item label="退料单位" name="unitName">
|
||||
<span style="height: 100%;display: flex;align-items: center;">{{ formData.unitName }}</span>
|
||||
<span style="height: 100%;display: flex;align-items: center;">{{ taskInfo.unitName }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="退料工程:" name="proName">
|
||||
<span style="height: 100%;display: flex;align-items: center;">{{ formData.proName }}</span>
|
||||
<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;">{{ formData.code }}</span>
|
||||
<span style="height: 100%;display: flex;align-items: center;">{{ taskInfo.code }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="退料人员:" name="backPerson">
|
||||
<span style="height: 100%;display: flex;align-items: center;">{{ formData.backPerson }}</span>
|
||||
<span style="height: 100%;display: flex;align-items: center;">{{ taskInfo.backPerson }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="联系电话:" name="phone">
|
||||
<span style="height: 100%;display: flex;align-items: center;">{{ formData.phone }}</span>
|
||||
<span style="height: 100%;display: flex;align-items: center;">{{ taskInfo.phone }}</span>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
</div>
|
||||
|
|
@ -41,37 +41,42 @@
|
|||
<div style="width: 94%;height: 120px;margin: 10px;border: 1px solid #ccc;">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<uni-row :gutter="24" style="display: flex; align-items: center;margin-bottom: 10px;">
|
||||
<uni-col :span="6">设备编码:</uni-col>
|
||||
<uni-col :span="12">
|
||||
<uni-easyinput placeholder="请输入内容" />
|
||||
<uni-easyinput placeholder="请输入内容" v-model="maCode"/>
|
||||
</uni-col>
|
||||
<uni-col :span="6">
|
||||
<view
|
||||
class="coding-btn"
|
||||
style="padding: 10rpx 0;
|
||||
color: #fe9a09;
|
||||
background-color: #fff7eb;
|
||||
border: 1px solid #fe9a09;"
|
||||
<view class="coding-btn" style="padding: 10rpx 0;color: #fe9a09;background-color: #fff7eb;border: 1px solid #fe9a09;"
|
||||
@click="getMaInfo"
|
||||
>编码检索</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24" style="display: flex; align-items: center;margin-bottom: 10px;">
|
||||
<uni-col :span="6">物资类型:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<uni-easyinput placeholder="请输入内容" />
|
||||
{{ typeName }}
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24" style="display: flex; align-items: center;margin-bottom: 10px;">
|
||||
<uni-col :span="6">规格型号:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<uni-easyinput placeholder="请输入内容" />
|
||||
{{ materialName }}
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24" style="display: flex; align-items: center;margin-bottom: 10px;">
|
||||
<uni-col :span="6">设备状态:</uni-col>
|
||||
<uni-col :span="16">
|
||||
{{ maStatusName }}
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
|
||||
<uni-row :gutter="24" style="display: flex; align-items: center;margin-bottom: 10px;">
|
||||
<uni-col :span="6">外观判定:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<uni-easyinput placeholder="请输入内容" />
|
||||
<uni-easyinput placeholder="请输入内容" v-model="apDetection"/>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24" style="display: flex; align-items: center;margin-bottom: 10px;">
|
||||
|
|
@ -87,7 +92,7 @@
|
|||
|
||||
<div class="btn">
|
||||
<!-- <button class="btn-cont" @click="reject">取消</button> -->
|
||||
<button class="btn-cont">确认</button>
|
||||
<button class="btn-cont" @click="submitCode">确认</button>
|
||||
</div>
|
||||
</view>
|
||||
</template>
|
||||
|
|
@ -95,10 +100,74 @@
|
|||
<script setup>
|
||||
import { ref, reactive } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { getMachine,insertApp } from '../../services/back.js';
|
||||
import { baseURL } from '@/utils/http'
|
||||
const formData = ref({})
|
||||
const imgBeseUrl = ref("")
|
||||
const bmFileInfos = ref([])//请求图片参数
|
||||
const taskInfo = ref({})
|
||||
const maId = ref("") //编码
|
||||
const maCode = ref("") //编码
|
||||
const typeName = ref("")//物资类型
|
||||
const materialName = ref("") //规格型号
|
||||
const typeId = ref("") //类型id
|
||||
const maStatusName = ref("") //状态
|
||||
const apDetection = ref("") //外观判定
|
||||
const imgBeseUrl = ref("") //图片展示
|
||||
const bmFileInfos = ref([])//图片数组
|
||||
|
||||
//根据编码获取设备类型
|
||||
const getMaInfo = () => {
|
||||
console.log(maCode.value)
|
||||
let param={
|
||||
"maCode":maCode.value,
|
||||
"unitId":taskInfo.value.unitId,
|
||||
"proId":taskInfo.value.proId
|
||||
}
|
||||
getMachine(param).then(res => {
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
if(res.data&&res.data.length>0){
|
||||
typeName.value = res.data[0].typeName;
|
||||
materialName.value = res.data[0].materialName;
|
||||
maStatusName.value = res.data[0].maStatusName;
|
||||
maId.value = res.data[0].maId;
|
||||
typeId.value = res.data[0].typeId;
|
||||
}else{
|
||||
uni.showToast({ title: '该编码非该单位工程领用,不可退料!', icon: 'none' })
|
||||
}
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
})
|
||||
}
|
||||
|
||||
//提交
|
||||
const submitCode = () => {
|
||||
console.log(taskInfo.value)
|
||||
// console.log(typeList.value)
|
||||
let obj = {
|
||||
"maId":maId.value,
|
||||
"maCode":maCode.value,
|
||||
"typeId":typeId.value,
|
||||
"apDetection":apDetection.value,
|
||||
"bmFileInfos":bmFileInfos.value
|
||||
}
|
||||
let param = {
|
||||
"backApplyInfo":taskInfo.value,
|
||||
"backApplyDetails":obj
|
||||
}
|
||||
insertApp(param).then(res => {
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
uni.showToast({ title: '编辑成功', icon: 'none' })
|
||||
uni.navigateBack({
|
||||
delta: 1 // 返回到已存在的页面
|
||||
});
|
||||
}else{
|
||||
uni.showToast({ title: res.msg, icon: 'none' })
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
})
|
||||
}
|
||||
|
||||
//上传
|
||||
const uploadImg = () => {
|
||||
|
|
@ -143,10 +212,11 @@ const uploadImg = () => {
|
|||
}
|
||||
})
|
||||
}
|
||||
|
||||
onLoad((options)=>{
|
||||
console.log(options)
|
||||
formData.value = JSON.parse(options.taskInfo)
|
||||
console.log(formData.value)
|
||||
taskInfo.value = JSON.parse(options.taskInfo)
|
||||
console.log(taskInfo.value)
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,274 @@
|
|||
<template>
|
||||
<view class="accept page-common">
|
||||
<div class="card">
|
||||
<div>任务信息</div>
|
||||
<uni-forms :model="taskInfo" label-width="160rpx" :border="true">
|
||||
<uni-forms-item label="退料单位" name="unitName">
|
||||
<span style="height: 100%;display: flex;align-items: center;">{{ taskInfo.unitName }}</span>
|
||||
</uni-forms-item>
|
||||
<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">
|
||||
<span style="height: 100%;display: flex;align-items: center;">{{ taskInfo.backPerson }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="联系电话:" name="phone">
|
||||
<span style="height: 100%;display: flex;align-items: center;">{{ taskInfo.phone }}</span>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
</div>
|
||||
<div class="card" style="margin-top: 20px;">
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">接收方式:</uni-col>
|
||||
<uni-col :span="6">
|
||||
<view class="coding-btn">编码识别</view>
|
||||
</uni-col>
|
||||
<uni-col :span="6">
|
||||
<view class="coding-btn">编码识别</view>
|
||||
</uni-col>
|
||||
<uni-col :span="6">
|
||||
<view class="coding-btn">二维码识别</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="card" style="margin-top: 20px;">
|
||||
<div>扫码识别</div>
|
||||
<div style="width: 94%;height: 120px;margin: 10px;border: 1px solid #ccc;">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<uni-row :gutter="24" style="display: flex; align-items: center;margin-bottom: 10px;">
|
||||
<uni-col :span="6">设备编码:</uni-col>
|
||||
<uni-col :span="12">
|
||||
<uni-easyinput placeholder="请输入内容" v-model="maCode"/>
|
||||
</uni-col>
|
||||
<uni-col :span="6">
|
||||
<view class="coding-btn" style="padding: 10rpx 0;color: #fe9a09;background-color: #fff7eb;border: 1px solid #fe9a09;"
|
||||
@click="getMaInfo"
|
||||
>编码检索</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24" style="display: flex; align-items: center;margin-bottom: 10px;">
|
||||
<uni-col :span="6">物资类型:</uni-col>
|
||||
<uni-col :span="16">
|
||||
{{ typeName }}
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24" style="display: flex; align-items: center;margin-bottom: 10px;">
|
||||
<uni-col :span="6">规格型号:</uni-col>
|
||||
<uni-col :span="16">
|
||||
{{ materialName }}
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24" style="display: flex; align-items: center;margin-bottom: 10px;">
|
||||
<uni-col :span="6">设备状态:</uni-col>
|
||||
<uni-col :span="16">
|
||||
{{ maStatusName }}
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
|
||||
<uni-row :gutter="24" style="display: flex; align-items: center;margin-bottom: 10px;">
|
||||
<uni-col :span="6">外观判定:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<uni-easyinput placeholder="请输入内容" v-model="apDetection"/>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24" style="display: flex; align-items: center;margin-bottom: 10px;">
|
||||
<uni-col :span="6">附件:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<div class="upload" @click="uploadImg" v-if="imgBeseUrl==''">+</div>
|
||||
<div class="upload" @click="uploadImg" v-else>
|
||||
<image :src="imgBeseUrl" style="width: 160rpx;height: 160rpx;" mode=""></image>
|
||||
</div>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</div>
|
||||
|
||||
<div class="btn">
|
||||
<!-- <button class="btn-cont" @click="reject">取消</button> -->
|
||||
<button class="btn-cont" @click="submitCode">确认</button>
|
||||
</div>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { getMachine,insertApp } from '../../services/back.js';
|
||||
import { baseURL } from '@/utils/http'
|
||||
const taskInfo = ref({})
|
||||
const maId = ref("") //编码
|
||||
const maCode = ref("") //编码
|
||||
const typeName = ref("")//物资类型
|
||||
const materialName = ref("") //规格型号
|
||||
const typeId = ref("") //类型id
|
||||
const maStatusName = ref("") //状态
|
||||
const apDetection = ref("") //外观判定
|
||||
const imgBeseUrl = ref("") //图片展示
|
||||
const bmFileInfos = ref([])//图片数组
|
||||
|
||||
//根据编码获取设备类型
|
||||
const getMaInfo = () => {
|
||||
console.log(maCode.value)
|
||||
let param={
|
||||
"maCode":maCode.value,
|
||||
"unitId":taskInfo.value.unitId,
|
||||
"proId":taskInfo.value.proId
|
||||
}
|
||||
getMachine(param).then(res => {
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
if(res.data&&res.data.length>0){
|
||||
typeName.value = res.data[0].typeName;
|
||||
materialName.value = res.data[0].materialName;
|
||||
maStatusName.value = res.data[0].maStatusName;
|
||||
maId.value = res.data[0].maId;
|
||||
typeId.value = res.data[0].typeId;
|
||||
}else{
|
||||
uni.showToast({ title: '该编码非该单位工程领用,不可退料!', icon: 'none' })
|
||||
}
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
})
|
||||
}
|
||||
|
||||
//提交
|
||||
const submitCode = () => {
|
||||
console.log(taskInfo.value)
|
||||
// console.log(typeList.value)
|
||||
let obj = {
|
||||
"maId":maId.value,
|
||||
"maCode":maCode.value,
|
||||
"typeId":typeId.value,
|
||||
"apDetection":apDetection.value,
|
||||
"bmFileInfos":bmFileInfos.value
|
||||
}
|
||||
let param = {
|
||||
"backApplyInfo":taskInfo.value,
|
||||
"backApplyDetails":obj
|
||||
}
|
||||
insertApp(param).then(res => {
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
uni.showToast({ title: '编辑成功', icon: 'none' })
|
||||
uni.navigateBack({
|
||||
delta: 1 // 返回到已存在的页面
|
||||
});
|
||||
}else{
|
||||
uni.showToast({ title: res.msg, icon: 'none' })
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
})
|
||||
}
|
||||
|
||||
//上传
|
||||
const uploadImg = () => {
|
||||
uni.chooseImage({
|
||||
count: 1, //图片可选择数量
|
||||
sizeType: ['original', 'compressed'], //original 原图,compressed 压缩图,默认二者都有
|
||||
sourceType: ['album', 'camera',], //album 从相册选图,camera 使用相机,默认二者都有。
|
||||
success: res => {
|
||||
console.log(res)
|
||||
let imgFiles = res.tempFilePaths //图片的本地文件路径列表
|
||||
imgBeseUrl.value = imgFiles[0]
|
||||
// console.log('本地地址', imgFiles)
|
||||
// console.log('请求地址', baseURL+"/file/upload")
|
||||
uni.uploadFile({
|
||||
// url: baseURL+"/file/upload",//app
|
||||
url: "/file/upload",//h5
|
||||
filePath: imgFiles[0],
|
||||
name: 'file',
|
||||
success: (res) => {
|
||||
res = JSON.parse(res.data)
|
||||
console.log('上传成功', res.code);
|
||||
console.log('上传成功', res.data);
|
||||
if(res.code&&res.code==200){
|
||||
let obj = {
|
||||
"name":res.data.name,
|
||||
"url":res.data.url,
|
||||
"taskType":"10"
|
||||
}
|
||||
// console.log(obj)
|
||||
bmFileInfos.value = [obj]
|
||||
uni.showToast({ title: '上传成功', icon: 'none' })
|
||||
}else{
|
||||
bmFileInfos.value = []
|
||||
uni.showToast({ title: '上传失败', icon: 'none' })
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('上传失败', err);
|
||||
}
|
||||
});
|
||||
// this.$refs.vForm.clearValidate()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
onLoad((options)=>{
|
||||
console.log(options)
|
||||
taskInfo.value = JSON.parse(options.taskInfo)
|
||||
console.log(taskInfo.value)
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.accept {
|
||||
padding: 10px;
|
||||
height: 100%;
|
||||
word-break: break-all;
|
||||
}
|
||||
.card {
|
||||
padding: 10px;
|
||||
background-color: #fff;
|
||||
border-radius: 6px;
|
||||
box-shadow: 0 2upx 4upx 0 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.coding-btn {
|
||||
padding: 5rpx 0;
|
||||
background-color: #409eff;
|
||||
border-radius: 6rpx;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
font-size: 14px;
|
||||
}
|
||||
.upload {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
background-color: #f5f5f5;
|
||||
border-radius: 6px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 20px;
|
||||
color: #ccc;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.btn {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
margin-top: 30px;
|
||||
|
||||
.btn-cont {
|
||||
width: 40%;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
background-color: #3784fb;
|
||||
color: #fff;
|
||||
border-radius: 20px;
|
||||
// 取消按钮淡蓝色
|
||||
// &:first-child {
|
||||
// background-color: #aacefb;
|
||||
// }
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
<span style="height: 100%;display: flex;align-items: center;">{{ rowData.typeModel }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="已退数量:" name="code">
|
||||
<span style="height: 100%;display: flex;align-items: center;">{{ rowData.preNum }}</span>
|
||||
<span style="height: 100%;display: flex;align-items: center;">{{ codeList.length }}</span>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
|
||||
|
|
@ -30,19 +30,20 @@
|
|||
<!-- 表头行 -->
|
||||
<uni-tr>
|
||||
<uni-th width="100px" align="center">设备编码</uni-th>
|
||||
<uni-th width="100px" align="center">外观</uni-th>
|
||||
<uni-th width="100px" align="center">操作</uni-th>
|
||||
<uni-th width="120px" align="center">外观</uni-th>
|
||||
<uni-th width="70px" align="center">操作</uni-th>
|
||||
</uni-tr>
|
||||
<!-- 表格数据行 -->
|
||||
<uni-tr v-for="(item,index) in codeList" :key="item.id">
|
||||
<uni-td>{{item.maCode}}</uni-td>
|
||||
<uni-td>
|
||||
<span>{{item.apDetection}}</span>
|
||||
<!-- <span>{{item.apDetection}}</span> -->
|
||||
<uni-easyinput placeholder="外观" v-model="item.apDetection"/>
|
||||
</uni-td>
|
||||
<uni-td>
|
||||
<view class="uni-group">
|
||||
<button class="uni-button" size="mini" type="primary">上传</button>
|
||||
<button class="uni-button" size="mini" type="warn">删除</button>
|
||||
<uni-icons type="camera" size="20" style="color: #3784fb;" @click="uploadImg(item)"></uni-icons>
|
||||
<uni-icons type="trash-filled" size="20" style="color: red;margin-left:10px;" @click="delRow(item)"></uni-icons>
|
||||
</view>
|
||||
</uni-td>
|
||||
</uni-tr>
|
||||
|
|
@ -56,14 +57,15 @@
|
|||
|
||||
<div class="btn">
|
||||
<!-- <button class="btn-cont" @click="reject">取消</button> -->
|
||||
<button class="btn-cont">确认</button>
|
||||
<button class="btn-cont" @click="saveCodeList">确认</button>
|
||||
</div>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { onLoad,onShow } from '@dcloudio/uni-app'
|
||||
import { getMaCodeList,deleteMaCode,saveCode } from '../../services/back.js';
|
||||
import { baseURL } from '@/utils/http'
|
||||
const searchValue = ref('')
|
||||
const taskInfo = ref({})
|
||||
|
|
@ -74,8 +76,49 @@ const bmFileInfos = ref([])//请求图片参数
|
|||
const goCode = () => {
|
||||
uni.navigateTo({ url: `/pages/back/backCode?taskInfo=${JSON.stringify(taskInfo.value)}` })
|
||||
}
|
||||
const getCodeList = () => {
|
||||
console.log(rowData.value)
|
||||
let param = {
|
||||
"typeId":rowData.value.typeId,
|
||||
"parentId":rowData.value.parentId
|
||||
}
|
||||
getMaCodeList(param).then(res => {
|
||||
console.log(res)
|
||||
if(res.code=200){
|
||||
codeList.value = res.data;
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
})
|
||||
}
|
||||
|
||||
const saveCodeList = () => {
|
||||
// console.log(codeList.value)
|
||||
// console.log(rowData.value)
|
||||
codeList.value.forEach(item=>{
|
||||
item.id=rowData.value.id;
|
||||
item.parentId=rowData.value.parentId;
|
||||
})
|
||||
let param = {
|
||||
"maCodeDtoList":codeList.value
|
||||
}
|
||||
console.log(param)
|
||||
saveCode(param).then(res => {
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
uni.showToast({ title: '保存成功', icon: 'none' })
|
||||
uni.navigateBack({
|
||||
delta: 1 // 返回到已存在的页面
|
||||
});
|
||||
}else{
|
||||
uni.showToast({ title: '保存失败', icon: 'none' })
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
})
|
||||
}
|
||||
//上传
|
||||
const uploadImg = () => {
|
||||
const uploadImg = (item) => {
|
||||
uni.chooseImage({
|
||||
count: 1, //图片可选择数量
|
||||
sizeType: ['original', 'compressed'], //original 原图,compressed 压缩图,默认二者都有
|
||||
|
|
@ -83,7 +126,7 @@ const uploadImg = () => {
|
|||
success: res => {
|
||||
console.log(res)
|
||||
let imgFiles = res.tempFilePaths //图片的本地文件路径列表
|
||||
imgBeseUrl.value = imgFiles[0]
|
||||
// imgBeseUrl.value = imgFiles[0]
|
||||
// console.log('本地地址', imgFiles)
|
||||
// console.log('请求地址', baseURL+"/file/upload")
|
||||
uni.uploadFile({
|
||||
|
|
@ -98,14 +141,12 @@ const uploadImg = () => {
|
|||
if(res.code&&res.code==200){
|
||||
let obj = {
|
||||
"name":res.data.name,
|
||||
"url":res.data.url,
|
||||
"taskType":"10"
|
||||
"url":res.data.url
|
||||
}
|
||||
// console.log(obj)
|
||||
bmFileInfos.value = [obj]
|
||||
item.bmFileInfos.value = [obj]
|
||||
uni.showToast({ title: '上传成功', icon: 'none' })
|
||||
}else{
|
||||
bmFileInfos.value = []
|
||||
item.bmFileInfos.value = []
|
||||
uni.showToast({ title: '上传失败', icon: 'none' })
|
||||
}
|
||||
},
|
||||
|
|
@ -117,15 +158,39 @@ const uploadImg = () => {
|
|||
}
|
||||
})
|
||||
}
|
||||
//删除
|
||||
const delRow = (item) => {
|
||||
console.log(item)
|
||||
let param = {
|
||||
"typeId":item.typeId,
|
||||
"parentId":rowData.value.parentId,
|
||||
"maId":item.maId,
|
||||
}
|
||||
console.log(param)
|
||||
deleteMaCode(param).then(res => {
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
uni.showToast({ title: '删除成功', icon: 'none' })
|
||||
getCodeList()
|
||||
}else{
|
||||
uni.showToast({ title: '删除失败', icon: 'none' })
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
onLoad((options)=>{
|
||||
console.log(options)
|
||||
taskInfo.value = JSON.parse(options.taskInfo)
|
||||
console.log(taskInfo.value)
|
||||
rowData.value = JSON.parse(options.rowData)
|
||||
console.log(rowData.value)
|
||||
codeList.value = rowData.value.maCodeList
|
||||
console.log(codeList.value)
|
||||
|
||||
// getCodeList()
|
||||
})
|
||||
onShow(()=>{
|
||||
getCodeList()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -22,36 +22,40 @@
|
|||
</div>
|
||||
<div class="card" style="margin-top: 20px;">
|
||||
<div>退料物资</div>
|
||||
<div style="width: 92%;height: auto;margin: 10px;" >
|
||||
<div style="width: 92%;height: auto;margin: 10px;margin-bottom: 30px;" >
|
||||
<uni-row :gutter="24" style="display: flex; align-items: center">
|
||||
<uni-col :span="10">
|
||||
<view>
|
||||
<uni-easyinput placeholder="请输入内容" />
|
||||
<uni-data-select v-model="typeId"
|
||||
:localdata="maTypeSelectList" @change="getMaCode">
|
||||
</uni-data-select>
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="10">
|
||||
<view>
|
||||
<uni-easyinput placeholder="请输入内容" />
|
||||
<uni-data-select v-model="typeCode"
|
||||
:localdata="maCodeSelectList" @change="selectMaCode">
|
||||
</uni-data-select>
|
||||
</view>
|
||||
</uni-col>
|
||||
|
||||
</uni-row>
|
||||
</div>
|
||||
<div style="width: 92%;height: auto;margin: 10px;">
|
||||
<div style="width: 92%;height: 100%;margin: 10px;font-size: 20rpx;">
|
||||
<uni-table border stripe emptyText="暂无更多数据" >
|
||||
<!-- 表头行 -->
|
||||
<uni-tr>
|
||||
<uni-th width="100px" align="center">类型名称</uni-th>
|
||||
<uni-th width="100px" align="center">规格型号</uni-th>
|
||||
<uni-th width="100px" align="center">在用数</uni-th>
|
||||
<uni-th width="90px" align="center">类型名称</uni-th>
|
||||
<uni-th width="90px" align="center">规格型号</uni-th>
|
||||
<uni-th width="70px" align="center">在用数</uni-th>
|
||||
<uni-th width="100px" align="center">退料数</uni-th>
|
||||
<uni-th width="100px" align="center">外观</uni-th>
|
||||
<uni-th width="100px" align="center">操作</uni-th>
|
||||
<uni-th width="60px" align="center">操作</uni-th>
|
||||
</uni-tr>
|
||||
<!-- 表格数据行 -->
|
||||
<uni-tr v-for="(item,index) in typeList" :key="item.id">
|
||||
<uni-td>{{item.materialName}}</uni-td>
|
||||
<uni-td>{{item.typeName}}</uni-td>
|
||||
<uni-td>{{item.typeModel}}</uni-td>
|
||||
<uni-td>{{item.num}}</uni-td>
|
||||
<uni-td>
|
||||
<uni-easyinput placeholder="退料数" v-model="item.preNum"/>
|
||||
|
|
@ -61,8 +65,10 @@
|
|||
</uni-td>
|
||||
<uni-td>
|
||||
<view class="uni-group">
|
||||
<button class="uni-button" size="mini" type="primary">上传</button>
|
||||
<button class="uni-button" size="mini" type="warn">删除</button>
|
||||
<!-- <button class="uni-button" size="mini" type="primary" @click="uploadImg(item)">上传</button> -->
|
||||
<!-- <button class="uni-button" size="mini" type="warn" >删除</button> -->
|
||||
<uni-icons type="camera" size="20" style="color: #3784fb;" @click="uploadImg(item)"></uni-icons>
|
||||
<uni-icons type="trash-filled" size="20" style="color: red;margin-left:10px;" @click="delRow(index)"></uni-icons>
|
||||
</view>
|
||||
</uni-td>
|
||||
</uni-tr>
|
||||
|
|
@ -72,7 +78,7 @@
|
|||
|
||||
<div class="btn">
|
||||
<!-- <button class="btn-cont" @click="reject">取消</button> -->
|
||||
<button class="btn-cont">确认</button>
|
||||
<button class="btn-cont" @click="submitNum">确认</button>
|
||||
</div>
|
||||
</view>
|
||||
</template>
|
||||
|
|
@ -80,14 +86,138 @@
|
|||
<script setup>
|
||||
import { ref, reactive } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { getUseType,insertApp } from '../../services/back.js';
|
||||
const taskInfo = ref({})
|
||||
|
||||
const maTypeSelectList = ref([])
|
||||
const typeId = ref("")//类型
|
||||
const maCodeSelectList = ref([])
|
||||
const typeCode = ref("")//规格型号
|
||||
const typeList = ref([])
|
||||
|
||||
//类型下拉选
|
||||
const getMaType = () => {
|
||||
let obj = {
|
||||
"agreementId":taskInfo.value.agreementId,
|
||||
}
|
||||
getUseType(obj).then(res => {
|
||||
console.log(res)
|
||||
maTypeSelectList.value = res.data.map(option => {
|
||||
return {
|
||||
value:option.typeId,
|
||||
text:option.typeName,
|
||||
}
|
||||
});
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
})
|
||||
}
|
||||
//规格
|
||||
const getMaCode = () => {
|
||||
let obj = {
|
||||
"agreementId":taskInfo.value.agreementId,
|
||||
"typeId":typeId.value
|
||||
}
|
||||
getUseType(obj).then(res => {
|
||||
console.log(res)
|
||||
maCodeSelectList.value = res.data.map(option => {
|
||||
let obj = {
|
||||
...option,
|
||||
bmFileInfos:[],
|
||||
value:option.typeId,
|
||||
text:option.typeName,
|
||||
}
|
||||
return obj
|
||||
});
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
})
|
||||
}
|
||||
//选择规格型号
|
||||
const selectMaCode = (e) => {
|
||||
console.log(e)
|
||||
maCodeSelectList.value.forEach(item=>{
|
||||
console.log(item)
|
||||
if(item.typeId==e){
|
||||
typeList.value.push(item)
|
||||
}
|
||||
})
|
||||
console.log(typeList.value)
|
||||
}
|
||||
//提交
|
||||
const submitNum = () => {
|
||||
console.log(taskInfo.value)
|
||||
console.log(typeList.value)
|
||||
let obj = {
|
||||
"backApplyInfo":taskInfo.value,
|
||||
"backApplyDetailsList":typeList.value
|
||||
}
|
||||
insertApp(obj).then(res => {
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
uni.showToast({ title: '编辑成功', icon: 'none' })
|
||||
uni.navigateBack({
|
||||
delta: 1 // 返回到已存在的页面
|
||||
});
|
||||
}else{
|
||||
uni.showToast({ title: res.msg, icon: 'none' })
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
})
|
||||
}
|
||||
//上传
|
||||
const uploadImg = (item) => {
|
||||
uni.chooseImage({
|
||||
count: 1, //图片可选择数量
|
||||
sizeType: ['original', 'compressed'], //original 原图,compressed 压缩图,默认二者都有
|
||||
sourceType: ['album', 'camera',], //album 从相册选图,camera 使用相机,默认二者都有。
|
||||
success: res => {
|
||||
console.log(res)
|
||||
let imgFiles = res.tempFilePaths //图片的本地文件路径列表
|
||||
// imgBeseUrl.value = imgFiles[0]
|
||||
// console.log('本地地址', imgFiles)
|
||||
// console.log('请求地址', baseURL+"/file/upload")
|
||||
uni.uploadFile({
|
||||
// url: baseURL+"/file/upload",//app
|
||||
url: "/file/upload",//h5
|
||||
filePath: imgFiles[0],
|
||||
name: 'file',
|
||||
success: (res) => {
|
||||
res = JSON.parse(res.data)
|
||||
console.log('上传成功', res.code);
|
||||
console.log('上传成功', res.data);
|
||||
if(res.code&&res.code==200){
|
||||
let obj = {
|
||||
"name":res.data.name,
|
||||
"url":res.data.url
|
||||
}
|
||||
item.bmFileInfos.value = [obj]
|
||||
uni.showToast({ title: '上传成功', icon: 'none' })
|
||||
}else{
|
||||
item.bmFileInfos.value = []
|
||||
uni.showToast({ title: '上传失败', icon: 'none' })
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('上传失败', err);
|
||||
}
|
||||
});
|
||||
// this.$refs.vForm.clearValidate()
|
||||
}
|
||||
})
|
||||
}
|
||||
//删除
|
||||
const delRow = (index) => {
|
||||
console.log(index)
|
||||
console.log(typeList.value)
|
||||
typeList.value.splice(index,1)
|
||||
}
|
||||
|
||||
onLoad((options)=>{
|
||||
console.log(options)
|
||||
taskInfo.value = JSON.parse(options.taskInfo)
|
||||
console.log(taskInfo.value)
|
||||
getMaType()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -18,53 +18,89 @@
|
|||
<div class="table-list-item"
|
||||
v-for="(item, index) in tableList"
|
||||
:key="index" @click="handleItem(item)">
|
||||
<div class="title">
|
||||
<span style="font-size: 15px; font-weight: 800">退料任务</span>
|
||||
<!-- <span v-if="item.status == 2" style="color: #ff4d4f">未验收</span> -->
|
||||
<!-- <span v-else-if="item.status != 2" style="color: #3784fb">已验收</span> -->
|
||||
<!-- <span v-else-if="item.status == 12" style="color: #ff4d4f">不合格</span> -->
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="8">物资名称:</uni-col>
|
||||
<uni-col :span="16"><div class="cont">{{ item.typeName }}</div></uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="8">规格型号:</uni-col>
|
||||
<uni-col :span="16"><div class="cont">{{ item.typeModel }}</div></uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="8">退料数量:</uni-col>
|
||||
<uni-col :span="16"><div class="cont">{{ item.preNum }}</div></uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="8">单位:</uni-col>
|
||||
<uni-col :span="16"><div class="cont">{{ item.unitName }}</div></uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24" v-if="item.status != 2">
|
||||
<uni-col :span="8">管理模式:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<div class="cont" v-if="item.manageType==0">编码管理</div>
|
||||
<div class="cont" v-if="item.manageType==1">数量管理</div>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-swipe-action>
|
||||
<uni-swipe-action-item @click="onClick($event, item)" :right-options="item.manageType==1 ? options:options2">
|
||||
<div class="title">
|
||||
<span style="font-size: 15px; font-weight: 800">退料任务</span>
|
||||
<!-- <span v-if="item.status == 2" style="color: #ff4d4f">未验收</span> -->
|
||||
<!-- <span v-else-if="item.status != 2" style="color: #3784fb">已验收</span> -->
|
||||
<!-- <span v-else-if="item.status == 12" style="color: #ff4d4f">不合格</span> -->
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="8">物资名称:</uni-col>
|
||||
<uni-col :span="16"><div class="cont">{{ item.typeName }}</div></uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="8">规格型号:</uni-col>
|
||||
<uni-col :span="16"><div class="cont">{{ item.typeModel }}</div></uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="8">退料数量:</uni-col>
|
||||
<uni-col :span="16"><div class="cont">{{ item.preNum }}</div></uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="8">单位:</uni-col>
|
||||
<uni-col :span="16"><div class="cont">{{ item.unitName }}</div></uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24" v-if="item.status != 2">
|
||||
<uni-col :span="8">管理模式:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<div class="cont" v-if="item.manageType==0">编码管理</div>
|
||||
<div class="cont" v-if="item.manageType==1">数量管理</div>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</uni-swipe-action-item>
|
||||
</uni-swipe-action>
|
||||
|
||||
</div>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue'
|
||||
import { getBackInfo } from '../../services/back.js';
|
||||
import { getBackInfo,deleteNumType } from '../../services/back.js';
|
||||
import { onLoad,onShow } from '@dcloudio/uni-app'
|
||||
|
||||
|
||||
|
||||
const searchValue = ref('')
|
||||
const id = ref('')
|
||||
const taskId = ref('')
|
||||
const statusList = ref(["2","12"])
|
||||
const tableList = ref([])
|
||||
const taskInfo = ref({})
|
||||
|
||||
// 右滑按钮组
|
||||
const options = ref([
|
||||
{
|
||||
text: '查看',
|
||||
style: {
|
||||
backgroundColor: '#65a1ff',
|
||||
color: '#fff',
|
||||
fontSize: '30rpx',
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#ed6042',
|
||||
color: '#fff',
|
||||
fontSize: '30rpx',
|
||||
},
|
||||
},
|
||||
])
|
||||
|
||||
// 右滑按钮组
|
||||
const options2 = ref([
|
||||
{
|
||||
text: '查看',
|
||||
style: {
|
||||
backgroundColor: '#65a1ff',
|
||||
color: '#fff',
|
||||
fontSize: '30rpx',
|
||||
},
|
||||
},
|
||||
|
||||
])
|
||||
//详情数据
|
||||
const getTableList = () => {
|
||||
// let obj = {
|
||||
// "id":id.value,
|
||||
|
|
@ -84,6 +120,7 @@ const getTableList = () => {
|
|||
const search = () => {
|
||||
console.log('🚀 ~ search ~ searchValue:', searchValue.value)
|
||||
}
|
||||
//查看
|
||||
const handleItem = (item) => {
|
||||
console.log('🚀 ~ handleItem ~ item:', item)
|
||||
if (item.manageType == 0) {//编码管理
|
||||
|
|
@ -92,12 +129,43 @@ const handleItem = (item) => {
|
|||
uni.navigateTo({ url: `/pages/back/backNumDetail?taskInfo=${JSON.stringify(taskInfo.value)}&rowData=${JSON.stringify(item)}` })
|
||||
}
|
||||
}
|
||||
//编码新增
|
||||
const goCode = () => {
|
||||
uni.navigateTo({ url: `/pages/back/backCode?taskInfo=${JSON.stringify(taskInfo.value)}` })
|
||||
}
|
||||
//数量新增
|
||||
const goNum = () => {
|
||||
uni.navigateTo({ url: `/pages/back/backNum?taskInfo=${JSON.stringify(taskInfo.value)}` })
|
||||
}
|
||||
const onClick = (e, item) => {
|
||||
const { index } = e
|
||||
// 1. 查看
|
||||
if (index === 0) {
|
||||
if (item.manageType == 0) {//编码管理
|
||||
uni.navigateTo({ url: `/pages/back/backCodeDetail?taskInfo=${JSON.stringify(taskInfo.value)}&rowData=${JSON.stringify(item)}` })
|
||||
} else if(item.manageType == 1) {//数量管理
|
||||
uni.navigateTo({ url: `/pages/back/backNumDetail?taskInfo=${JSON.stringify(taskInfo.value)}&rowData=${JSON.stringify(item)}` })
|
||||
}
|
||||
}
|
||||
// 2. 删除
|
||||
if (index === 1) {
|
||||
let param = {
|
||||
id:item.id,
|
||||
parentId:item.parentId
|
||||
}
|
||||
deleteNumType(param).then(res => {
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
uni.showToast({ title: '删除成功', icon: 'none' })
|
||||
getTableList()
|
||||
}else{
|
||||
uni.showToast({ title: '删除失败', icon: 'none' })
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
})
|
||||
}
|
||||
}
|
||||
onLoad((options)=>{
|
||||
console.log(options)
|
||||
id.value = options.id
|
||||
|
|
|
|||
|
|
@ -15,132 +15,242 @@
|
|||
<uni-col :span="8">
|
||||
<view>
|
||||
<uni-datetime-picker
|
||||
type="date"
|
||||
placeholder="请选择日期"
|
||||
:clear-icon="false"
|
||||
v-model="dateArray"
|
||||
type="daterange"
|
||||
@maskClick="maskClick"
|
||||
@change="onChangeDate"
|
||||
placeholder="选择日期范围"
|
||||
/>
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="8">
|
||||
<view>
|
||||
<uni-easyinput placeholder="请输入项目名称" />
|
||||
<uni-easyinput placeholder="请输入内容" v-model="queryParams.keyWord"/>
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="4">
|
||||
<view class="search" @click="getTableList()">搜索</view>
|
||||
<view class="search" @click="getTableList(true)">搜索</view>
|
||||
</uni-col>
|
||||
<uni-col :span="4">
|
||||
<view class="addBtn" @click="goAdd()">新增</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
|
||||
<div
|
||||
class="table-list-item"
|
||||
v-for="(item, index) in tableList"
|
||||
:key="index"
|
||||
@click="handleItem(item)"
|
||||
>
|
||||
<div class="title">
|
||||
<span style="font-size: 15px; font-weight: 800">退料任务</span>
|
||||
<span :style="{ color: active == 1 ? '#3784fb' : '#ff4d4f' }">{{active == 1 ? '已完成' : '未完成'}}</span>
|
||||
<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-item :right-options="item.taskStatus==0 ? options:options2" @click="onClick($event,item)" @change="onSwipeChange">
|
||||
<div class="title">
|
||||
<span style="font-size: 15px; font-weight: 800">退料任务</span>
|
||||
<span :style="{ color: active == 1 ? '#3784fb' : '#ff4d4f' }">{{active == 1 ? '已完成' : '未完成'}}</span>
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="8">申请时间:</uni-col>
|
||||
<uni-col :span="16"
|
||||
><div class="cont">{{ item.createTime }}</div></uni-col
|
||||
>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="8">退料单号:</uni-col>
|
||||
<uni-col :span="16"
|
||||
><div class="cont">{{ item.code }}</div></uni-col
|
||||
>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="8">退料物资:</uni-col>
|
||||
<uni-col :span="16"
|
||||
><div class="cont">{{ item.typeName }}</div></uni-col
|
||||
>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="8">退料单位:</uni-col>
|
||||
<uni-col :span="16"
|
||||
><div class="cont">{{ item.unitName }}</div></uni-col
|
||||
>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="8">工程名称:</uni-col>
|
||||
<uni-col :span="16"
|
||||
><div class="cont">{{ item.proName }}</div></uni-col
|
||||
>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="8">退料人:</uni-col>
|
||||
<uni-col :span="16"
|
||||
><div class="cont">{{ item.backPerson }}</div></uni-col
|
||||
>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="8">联系电话:</uni-col>
|
||||
<uni-col :span="16"
|
||||
><div class="cont">{{ item.phone }}</div></uni-col
|
||||
>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="8">已退数量:</uni-col>
|
||||
<uni-col :span="16"
|
||||
><div class="cont">{{ }}</div></uni-col
|
||||
>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="8">备注:</uni-col>
|
||||
<uni-col :span="16"
|
||||
><div class="cont">{{ item.remark }}</div></uni-col
|
||||
>
|
||||
</uni-row>
|
||||
</uni-swipe-action-item>
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="8">申请时间:</uni-col>
|
||||
<uni-col :span="16"
|
||||
><div class="cont">{{ item.createTime }}</div></uni-col
|
||||
>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="8">退料单号:</uni-col>
|
||||
<uni-col :span="16"
|
||||
><div class="cont">{{ item.code }}</div></uni-col
|
||||
>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="8">退料物资:</uni-col>
|
||||
<uni-col :span="16"
|
||||
><div class="cont">{{ item.typeName }}</div></uni-col
|
||||
>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="8">退料单位:</uni-col>
|
||||
<uni-col :span="16"
|
||||
><div class="cont">{{ item.unitName }}</div></uni-col
|
||||
>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="8">工程名称:</uni-col>
|
||||
<uni-col :span="16"
|
||||
><div class="cont">{{ item.proName }}</div></uni-col
|
||||
>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="8">退料人:</uni-col>
|
||||
<uni-col :span="16"
|
||||
><div class="cont">{{ item.backPerson }}</div></uni-col
|
||||
>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="8">联系电话:</uni-col>
|
||||
<uni-col :span="16"
|
||||
><div class="cont">{{ item.phone }}</div></uni-col
|
||||
>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="8">已退数量:</uni-col>
|
||||
<uni-col :span="16"
|
||||
><div class="cont">{{ }}</div></uni-col
|
||||
>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="8">备注:</uni-col>
|
||||
<uni-col :span="16"
|
||||
><div class="cont">{{ item.remark }}</div></uni-col
|
||||
>
|
||||
</uni-row>
|
||||
|
||||
<!-- <uni-row :gutter="24">
|
||||
<uni-col :span="6">验收数量:</uni-col>
|
||||
<uni-col :span="18"><div class="cont"></div></uni-col>
|
||||
</uni-row> -->
|
||||
</div>
|
||||
<view class="loading-text">
|
||||
{{ finish ? '没有更多数据了~' : '正在加载...' }}
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue'
|
||||
import { getBackList } from '../../services/back.js'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
const active = ref(1)
|
||||
const tableList = ref([])
|
||||
const taskStatus = ref("2")
|
||||
//获取列表
|
||||
const getTableList = () => {
|
||||
let obj = {
|
||||
"pageNum":"1",
|
||||
"pageSize":"10",
|
||||
"taskStatus":taskStatus.value
|
||||
}
|
||||
console.log(obj)
|
||||
getBackList(obj).then(res => {
|
||||
tableList.value = res.rows;
|
||||
console.log(tableList.value)
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
})
|
||||
import { ref, computed } from 'vue'
|
||||
import { getBackList,submitBackApply,backApplyRemove } from '../../services/back.js'
|
||||
import { onLoad,onShow} from '@dcloudio/uni-app'
|
||||
import { debounce } from 'lodash-es'
|
||||
const total = ref(0) // 数据总量
|
||||
const active = ref(1) // tap索引
|
||||
const tableList = ref([]) // 列表数据源
|
||||
const dateArray = ref([]) // 日期范围
|
||||
// 查询参数
|
||||
const queryParams = ref({
|
||||
startTime: '', // 开始时间
|
||||
endTime: '', // 结束时间
|
||||
keyWord: '', // 关键字
|
||||
status: 2,
|
||||
pageNum: 1,
|
||||
pageSize: 5,
|
||||
})
|
||||
|
||||
// 右滑按钮组-未完成
|
||||
const options = ref([
|
||||
{
|
||||
text: '提交',
|
||||
style: {
|
||||
backgroundColor: '#65a1ff',
|
||||
color: '#fff',
|
||||
fontSize: '30rpx',
|
||||
},
|
||||
},
|
||||
{
|
||||
text: '删除',
|
||||
style: {
|
||||
backgroundColor: '#ed6042',
|
||||
color: '#fff',
|
||||
fontSize: '30rpx',
|
||||
},
|
||||
},
|
||||
])
|
||||
// 右滑按钮组-已完成
|
||||
const options2 = ref([
|
||||
{
|
||||
text: '查看',
|
||||
style: {
|
||||
backgroundColor: '#65a1ff',
|
||||
color: '#fff',
|
||||
fontSize: '30rpx',
|
||||
},
|
||||
},
|
||||
// {
|
||||
// text: '删除',
|
||||
// style: {
|
||||
// backgroundColor: '#ed6042',
|
||||
// color: '#fff',
|
||||
// fontSize: '30rpx',
|
||||
// },
|
||||
// },
|
||||
])
|
||||
//点击事件
|
||||
const onClick=(e,item)=> {
|
||||
const { index } = e
|
||||
console.log(index)
|
||||
if (index === 0) {
|
||||
if (item.taskStatus == 0) {//未完成-提交
|
||||
console.log(item)
|
||||
let param = {
|
||||
id:item.id,
|
||||
taskId:item.taskId
|
||||
}
|
||||
console.log(param)
|
||||
submitBackApply(param).then(res => {
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
uni.showToast({ title: '提交成功', icon: 'none' })
|
||||
getTableList(true)
|
||||
}else{
|
||||
uni.showToast({ title: '提交失败', icon: 'none' })
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
})
|
||||
} else if(item.taskStatus == 2) {//已完成-查看
|
||||
handleItem(item)
|
||||
}
|
||||
}
|
||||
// 2. 删除
|
||||
if (index === 1) {
|
||||
console.log(item)
|
||||
let param = {
|
||||
id:item.id
|
||||
}
|
||||
console.log(param)
|
||||
backApplyRemove(param).then(res => {
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
uni.showToast({ title: '删除成功', icon: 'none' })
|
||||
getTableList(true)
|
||||
}else{
|
||||
uni.showToast({ title: '删除失败', icon: 'none' })
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
})
|
||||
}
|
||||
}
|
||||
//切换tab
|
||||
const changeTab = (index) => {
|
||||
active.value = index
|
||||
if (index == 1) {
|
||||
taskStatus.value = '2'
|
||||
getTableList()
|
||||
} else if (index == 2) {
|
||||
taskStatus.value = '0'
|
||||
|
||||
//获取列表
|
||||
const getTableList = async (isTap = false) => {
|
||||
// console.log('queryParams.value查询参数', queryParams.value)
|
||||
const res = await getBackList(queryParams.value)
|
||||
console.log('res列表数据', res)
|
||||
total.value = res.total
|
||||
if (isTap) {
|
||||
tableList.value = res.rows
|
||||
} else {
|
||||
if (res.rows.length == 0) {
|
||||
tableList.value = []
|
||||
} else {
|
||||
tableList.value.push(...res.rows)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 滚动触底事件
|
||||
const onScrollTolower = debounce(() => {
|
||||
if (total.value > tableList.value.length) {
|
||||
queryParams.value.pageNum++
|
||||
getTableList()
|
||||
}
|
||||
})
|
||||
//切换tab
|
||||
const changeTab = (index) => {
|
||||
active.value = index
|
||||
if (index == 1) {
|
||||
queryParams.value.status = 2
|
||||
} else if (index == 2) {
|
||||
queryParams.value.status = 0
|
||||
}
|
||||
queryParams.value.pageNum = 1
|
||||
getTableList(true)
|
||||
}
|
||||
// 日期 change 事件
|
||||
const onChangeDate = (val) => {
|
||||
const [val_1, val_2] = val
|
||||
queryParams.value.startTime = val_1
|
||||
queryParams.value.endTime = val_2
|
||||
}
|
||||
//日期选择
|
||||
const maskClick = () => {}
|
||||
|
|
@ -154,9 +264,14 @@ const handleItem = (item) => {
|
|||
console.log('🚀 ~ handleItem ~ item:', item)
|
||||
uni.navigateTo({ url: `/pages/back/detail?id=${item.id}&taskId=${item.taskId}` })
|
||||
}
|
||||
|
||||
onLoad((options) => {
|
||||
getTableList()
|
||||
// 判断数据是否加载完毕
|
||||
const finish = computed(() => {
|
||||
if (total.value === tableList.value.length) return true
|
||||
})
|
||||
onShow(() => {
|
||||
tableList.value = []
|
||||
total.value = 0
|
||||
getTableList(true)
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
@ -202,26 +317,35 @@ onLoad((options) => {
|
|||
color: #fff;
|
||||
}
|
||||
}
|
||||
.table-list-item {
|
||||
margin: 20rpx 0;
|
||||
padding: 20rpx;
|
||||
background-color: #fff;
|
||||
min-height: 300rpx;
|
||||
border-radius: 10rpx;
|
||||
.title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.cont {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
line-height: 1.9;
|
||||
}
|
||||
.line {
|
||||
.scroll-container {
|
||||
.table-list-item {
|
||||
margin: 20rpx 0;
|
||||
height: 1px;
|
||||
background-color: #e8e8e8;
|
||||
padding: 20rpx;
|
||||
background-color: #fff;
|
||||
min-height: 300rpx;
|
||||
border-radius: 10rpx;
|
||||
.title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.cont {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
line-height: 1.9;
|
||||
}
|
||||
.line {
|
||||
margin: 20rpx 0;
|
||||
height: 1px;
|
||||
background-color: #e8e8e8;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 加载提示文字
|
||||
.loading-text {
|
||||
text-align: center;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -51,3 +51,71 @@ export const insertApp = (data) => {
|
|||
})
|
||||
}
|
||||
|
||||
// 数量退料设备下拉选
|
||||
export const getUseType = (data) => {
|
||||
return http({
|
||||
method: 'POST',
|
||||
url: '/material/select/getUseType',
|
||||
data:data,
|
||||
})
|
||||
}
|
||||
// 数量删除
|
||||
export const deleteNumType = (data) => {
|
||||
return http({
|
||||
method: 'POST',
|
||||
url: '/material/back_apply_info/delete',
|
||||
data:data,
|
||||
})
|
||||
}
|
||||
// 编码检索获取设备详情
|
||||
export const getMachine = (data) => {
|
||||
return http({
|
||||
method: 'GET',
|
||||
url: '/material/back_apply_info/getMachine',
|
||||
data:data,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 获取已退料编码列表-查看
|
||||
export const getMaCodeList = (data) => {
|
||||
return http({
|
||||
method: 'GET',
|
||||
url: '/material/back_apply_info/getMaCodeList',
|
||||
data:data,
|
||||
})
|
||||
}
|
||||
|
||||
// 编码删除
|
||||
export const deleteMaCode = (data) => {
|
||||
return http({
|
||||
method: 'POST',
|
||||
url: '/material/back_apply_info/delete',
|
||||
data:data,
|
||||
})
|
||||
}
|
||||
|
||||
// 编码类型查看页面保存
|
||||
export const saveCode = (data) => {
|
||||
return http({
|
||||
method: 'POST',
|
||||
url: '/material/back_apply_info/updateMaCode',
|
||||
data:data,
|
||||
})
|
||||
}
|
||||
// 提交
|
||||
export const submitBackApply = (data) => {
|
||||
return http({
|
||||
method: 'POST',
|
||||
url: '/material/back_apply_info/submitBackApply',
|
||||
data:data,
|
||||
})
|
||||
}
|
||||
//删除
|
||||
export const backApplyRemove = (data) => {
|
||||
return http({
|
||||
method: 'POST',
|
||||
url: '/material/back_apply_info/deleteById',
|
||||
data:data,
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue