解决app页面跳转传参问题
This commit is contained in:
parent
fb1b098f60
commit
b68e9764fe
|
|
@ -2,7 +2,7 @@
|
|||
"version" : "1.0",
|
||||
"configurations" : [
|
||||
{
|
||||
"playground" : "custom",
|
||||
"playground" : "standard",
|
||||
"type" : "uni-app:app-android"
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
<template>
|
||||
<!-- 编码绑定-->
|
||||
<view class="page-container">
|
||||
<div class="card" style="margin-bottom: 10px;">
|
||||
<div class="card" style="margin-bottom: 10px">
|
||||
<uni-forms :model="formData" label-width="100" :border="true">
|
||||
<uni-forms-item label="物资名称:" name="maTypeName">
|
||||
<span class="form-view">{{ queryParams.maTypeName }}</span>
|
||||
</uni-forms-item>
|
||||
|
||||
<uni-forms-item label="物资规格:" name="typeName">
|
||||
<uni-forms-item label="物资规格:" name="typeName">
|
||||
<span class="form-view">{{ queryParams.typeName }}</span>
|
||||
</uni-forms-item>
|
||||
|
||||
|
|
@ -17,9 +17,9 @@
|
|||
|
||||
<uni-forms-item label="待绑定数量:" name="waitBindNum">
|
||||
<span style="color: #ee0a24" class="form-view">{{ waitBindNum }}</span>
|
||||
</uni-forms-item>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
</div>
|
||||
</div>
|
||||
<scroll-view scroll-y>
|
||||
<view class="table-list-item">
|
||||
<uni-row :gutter="24" style="display: flex; align-items: center">
|
||||
|
|
@ -112,7 +112,7 @@
|
|||
</uni-col>
|
||||
<uni-col :span="7">
|
||||
<view>
|
||||
<uni-easyinput v-model="item.outFacCode" placeholder="请输入"/>
|
||||
<uni-easyinput v-model="item.outFacCode" placeholder="请输入" />
|
||||
</view>
|
||||
</uni-col>
|
||||
<!-- <uni-col :span="3">
|
||||
|
|
@ -139,27 +139,28 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed,onUnmounted } from 'vue'
|
||||
import { ref, computed, onUnmounted, reactive } from 'vue'
|
||||
import { setBindCodingAPI } from '@/services/new-purchase/bind.js'
|
||||
import { debounce } from 'lodash-es'
|
||||
import { onLoad,onShow } from '@dcloudio/uni-app'
|
||||
const query = defineProps() // 获取上级页面传递的路由参数
|
||||
const queryParams = JSON.parse(query.queryParams)
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
// const query = defineProps() // 获取上级页面传递的路由参数
|
||||
// const queryParams = JSON.parse(query.queryParams)
|
||||
const queryParams = ref({})
|
||||
const codeBindingList = ref([])
|
||||
const codeNum = ref(0)
|
||||
|
||||
const queryBindForm = ref({
|
||||
typeId: '', // 物资typeId
|
||||
typeName: queryParams.typeName, // 规格型号
|
||||
typeName: '', // 规格型号
|
||||
codePrefix: '', // 编码前缀
|
||||
maTypeName: queryParams.maTypeName, // 物资名称
|
||||
maTypeName: '', // 物资名称
|
||||
codeSuffixEnd: '', // 后缀结束
|
||||
codeSuffixStart: '', // 后缀开始
|
||||
})
|
||||
|
||||
// 计算待绑定数量
|
||||
const waitBindNum = computed(() => {
|
||||
return queryParams.checkNum - queryParams.bindNum - codeNum.value
|
||||
return queryParams.value.checkNum - queryParams.value.bindNum - codeNum.value
|
||||
})
|
||||
|
||||
// 绑定按钮
|
||||
|
|
@ -174,8 +175,8 @@ const onHandleBinding = debounce(async () => {
|
|||
|
||||
// 组装参数
|
||||
const bindParams = {
|
||||
typeId: queryParams.typeId,
|
||||
taskId: queryParams.taskId,
|
||||
typeId: queryParams.value.typeId,
|
||||
taskId: queryParams.value.taskId,
|
||||
dtoList: codeBindingList.value,
|
||||
}
|
||||
|
||||
|
|
@ -276,22 +277,29 @@ const onHandelDelete = (index) => {
|
|||
}
|
||||
|
||||
// 编码识别按钮
|
||||
const onCodeIdentify = () => {
|
||||
uni.navigateTo({ url: `/pages/new-purchase/bind/coding-scan?queryParams=${JSON.stringify(queryParams)}` })
|
||||
const onCodeIdentify = () => {
|
||||
uni.navigateTo({
|
||||
url: `/pages/new-purchase/bind/coding-scan?queryParams=${JSON.stringify(
|
||||
queryParams.value,
|
||||
)}`,
|
||||
})
|
||||
}
|
||||
|
||||
const maskClick = () => {}
|
||||
|
||||
// 页面加载完毕
|
||||
onLoad(() => {
|
||||
onLoad((options) => {
|
||||
// 监听出库完成事件 刷新列表
|
||||
uni.$on('onUpdate', (num) => {
|
||||
console.log('监听事件',num)
|
||||
if(num>0){
|
||||
codeNum.value = num
|
||||
}
|
||||
console.log('监听事件', num)
|
||||
if (num > 0) {
|
||||
codeNum.value = num
|
||||
}
|
||||
})
|
||||
})
|
||||
queryParams.value = JSON.parse(options.queryParams)
|
||||
queryBindForm.value.typeName = queryParams.value.typeName
|
||||
queryBindForm.value.maTypeName = queryParams.value.maTypeName
|
||||
})
|
||||
// 页面销毁时移除事件监听
|
||||
onUnmounted(() => {
|
||||
uni.$off('onUpdate') // 移除事件监听
|
||||
|
|
@ -331,12 +339,12 @@ onUnmounted(() => {
|
|||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
.form-view{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.form-view {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
// 加载提示文字
|
||||
.loading-text {
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
<template>
|
||||
<!-- 编码绑定-->
|
||||
<view class="page-container">
|
||||
<div class="card" style="margin-bottom: 10px;">
|
||||
<div class="card" style="margin-bottom: 10px">
|
||||
<uni-forms :model="formData" label-width="100" :border="true">
|
||||
<uni-forms-item label="物资名称:" name="maTypeName">
|
||||
<span class="form-view">{{ queryParams.maTypeName }}</span>
|
||||
</uni-forms-item>
|
||||
|
||||
<uni-forms-item label="物资规格:" name="typeName">
|
||||
<uni-forms-item label="物资规格:" name="typeName">
|
||||
<span class="form-view">{{ queryParams.typeName }}</span>
|
||||
</uni-forms-item>
|
||||
|
||||
|
|
@ -18,12 +18,12 @@
|
|||
<uni-forms-item label="待绑定数量:" name="waitBindNum">
|
||||
<span style="color: #ee0a24" class="form-view">{{ waitBindNum }}</span>
|
||||
</uni-forms-item>
|
||||
|
||||
<uni-forms-item>
|
||||
<button class="scan-btn" @click="scanStart">开始扫码</button>
|
||||
</uni-forms-item>
|
||||
|
||||
<uni-forms-item label="识别编码:" name="maCode">
|
||||
<uni-forms-item>
|
||||
<button class="scan-btn" @click="scanStart">开始扫码</button>
|
||||
</uni-forms-item>
|
||||
|
||||
<uni-forms-item label="识别编码:" name="maCode">
|
||||
<uni-easyinput v-model="formData.maCode" readonly />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="出场编码:" name="outFacCode">
|
||||
|
|
@ -31,13 +31,12 @@
|
|||
</uni-forms-item>
|
||||
<!-- <uni-forms-item label="出场日期:" name="warnDocuments">
|
||||
</uni-forms-item> -->
|
||||
|
||||
</uni-forms>
|
||||
</div>
|
||||
<div class="btn">
|
||||
<button class="btn-cont" @click="backPage">取消</button>
|
||||
<button class="btn-cont" @click="onHandleBinding">确认</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn">
|
||||
<button class="btn-cont" @click="backPage">取消</button>
|
||||
<button class="btn-cont" @click="onHandleBinding">确认</button>
|
||||
</div>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -45,53 +44,60 @@
|
|||
import { ref, computed } from 'vue'
|
||||
import { setBindCodingAPI } from '@/services/new-purchase/bind.js'
|
||||
import { debounce } from 'lodash-es'
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
const query = defineProps() // 获取上级页面传递的路由参数
|
||||
const queryParams = JSON.parse(query.queryParams)
|
||||
console.log(queryParams)
|
||||
import { onShow, onLoad } from '@dcloudio/uni-app'
|
||||
// const query = defineProps() // 获取上级页面传递的路由参数
|
||||
// const queryParams = JSON.parse(query.queryParams)
|
||||
const queryParams = ref({})
|
||||
// console.log(queryParams)
|
||||
const formData = ref({
|
||||
maCode: '',
|
||||
outFacCode: '',
|
||||
maCode: '',
|
||||
outFacCode: '',
|
||||
})
|
||||
const codeNun = ref(0)
|
||||
// 计算待绑定数量
|
||||
const waitBindNum = computed(() => {
|
||||
return queryParams.checkNum - queryParams.bindNum - codeNun.value
|
||||
return queryParams.value.checkNum - queryParams.value.bindNum - codeNun.value
|
||||
})
|
||||
|
||||
|
||||
onLoad((options) => {
|
||||
queryParams.value = JSON.parse(options.queryParams)
|
||||
})
|
||||
|
||||
// 编码识别按钮
|
||||
const scanStart = () => {
|
||||
console.log('编码识别--')
|
||||
// 只允许通过相机扫码
|
||||
uni.scanCode({
|
||||
onlyFromCamera: true,
|
||||
scanType: ['qrCode', 'pdf417'],
|
||||
success: (res) => {
|
||||
console.log('扫码结果:' + res.result);
|
||||
formData.value.maCode = res.result
|
||||
},
|
||||
fail: (err) => {
|
||||
// uni.showToast({
|
||||
// title: '取消',
|
||||
// icon: 'none'
|
||||
// });
|
||||
}
|
||||
});
|
||||
onlyFromCamera: true,
|
||||
scanType: ['qrCode', 'pdf417'],
|
||||
success: (res) => {
|
||||
console.log('扫码结果:' + res.result)
|
||||
formData.value.maCode = res.result
|
||||
},
|
||||
fail: (err) => {
|
||||
// uni.showToast({
|
||||
// title: '取消',
|
||||
// icon: 'none'
|
||||
// });
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
// 绑定按钮
|
||||
const onHandleBinding = debounce(async () => {
|
||||
let codeList = [{
|
||||
"typeName": queryParams.typeName,
|
||||
"maTypeName": queryParams.maTypeName,
|
||||
"outFacCode": formData.value.outFacCode,
|
||||
"maCode": formData.value.maCode
|
||||
}]
|
||||
|
||||
let codeList = [
|
||||
{
|
||||
typeName: queryParams.value.typeName,
|
||||
maTypeName: queryParams.value.maTypeName,
|
||||
outFacCode: formData.value.outFacCode,
|
||||
maCode: formData.value.maCode,
|
||||
},
|
||||
]
|
||||
|
||||
// 组装参数
|
||||
const bindParams = {
|
||||
typeId: queryParams.typeId,
|
||||
taskId: queryParams.taskId,
|
||||
typeId: queryParams.value.typeId,
|
||||
taskId: queryParams.value.taskId,
|
||||
dtoList: codeList,
|
||||
}
|
||||
|
||||
|
|
@ -104,23 +110,23 @@ const onHandleBinding = debounce(async () => {
|
|||
title: '编码绑定成功!',
|
||||
icon: 'none',
|
||||
})
|
||||
formData.value.outFacCode = ""
|
||||
formData.value.maCode = ""
|
||||
codeNun.value = codeNun.value+1;
|
||||
uni.$emit('onUpdate',codeNun.value)
|
||||
formData.value.outFacCode = ''
|
||||
formData.value.maCode = ''
|
||||
codeNun.value = codeNun.value + 1
|
||||
uni.$emit('onUpdate', codeNun.value)
|
||||
}
|
||||
}, 500)
|
||||
// 返回
|
||||
// 返回
|
||||
const backPage = () => {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
uni.navigateBack({
|
||||
delta: 1,
|
||||
})
|
||||
}
|
||||
// 页面加载完毕
|
||||
onShow(() => {
|
||||
setTimeout(()=>{
|
||||
scanStart()
|
||||
},500)
|
||||
setTimeout(() => {
|
||||
scanStart()
|
||||
}, 500)
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
@ -137,11 +143,11 @@ onShow(() => {
|
|||
border-radius: 6px;
|
||||
box-shadow: 0 2upx 4upx 0 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.scan-btn{
|
||||
width: 94%;
|
||||
margin: 5px auto;
|
||||
}
|
||||
}
|
||||
.scan-btn {
|
||||
width: 94%;
|
||||
margin: 5px auto;
|
||||
}
|
||||
}
|
||||
.btn {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
|
|
@ -161,10 +167,10 @@ onShow(() => {
|
|||
}
|
||||
}
|
||||
}
|
||||
.form-view{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.form-view {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -103,10 +103,14 @@
|
|||
<script setup>
|
||||
import { ref, onUnmounted } from 'vue'
|
||||
import { getPurchaseBindDetailsAPI } from '@/services/new-purchase/bind.js'
|
||||
import { onLoad,onShow } from '@dcloudio/uni-app'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
const detailsList = ref([])
|
||||
const query = defineProps() // 获取上级页面传递的路由参数
|
||||
|
||||
// const query = defineProps() // 获取上级页面传递的路由参数
|
||||
onLoad((options) => {
|
||||
queryParams.value.taskId = options.taskId
|
||||
queryParams.value.id = options.id
|
||||
leaseApplyInfo.value.taskId = options.taskId
|
||||
})
|
||||
// 右滑按钮组
|
||||
const options = ref([
|
||||
{
|
||||
|
|
@ -139,8 +143,8 @@ const options = ref([
|
|||
const queryParams = ref({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
taskId: query.taskId,
|
||||
id: query.id,
|
||||
taskId: '',
|
||||
id: '',
|
||||
statusList: [3, 13],
|
||||
})
|
||||
|
||||
|
|
@ -152,7 +156,7 @@ const leaseApplyInfo = ref({
|
|||
bindNum: '', // 已绑数量
|
||||
checkNum: '', // 应绑数量
|
||||
typeId: '', // 出库时所需参数 取详情接口 typeId
|
||||
taskId: query.taskId, // 出库时所需参数 取详情接口 taskId
|
||||
taskId: '', // 出库时所需参数 取详情接口 taskId
|
||||
})
|
||||
|
||||
// 获取列表详情
|
||||
|
|
@ -186,18 +190,21 @@ const onClick = (e, item) => {
|
|||
}
|
||||
// 2. 二维码绑定
|
||||
if (index === 1) {
|
||||
uni.navigateTo({ url: `/pages/new-purchase/bind/coding-scan?queryParams=${JSON.stringify(leaseApplyInfo.value)}` })
|
||||
uni.navigateTo({
|
||||
url: `/pages/new-purchase/bind/coding-scan?queryParams=${JSON.stringify(
|
||||
leaseApplyInfo.value,
|
||||
)}`,
|
||||
})
|
||||
}
|
||||
// 3. 驳回
|
||||
if (index === 2) {
|
||||
}
|
||||
}
|
||||
|
||||
// 页面加载完毕
|
||||
// 页面加载完毕
|
||||
onShow(() => {
|
||||
getOutboundDetailsData()
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@
|
|||
placeholder="选择日期范围"
|
||||
/>
|
||||
</view>
|
||||
</uni-col>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24" class="search-form" style="margin-top: 10rpx">
|
||||
<uni-row :gutter="24" class="search-form" style="margin-top: 10rpx">
|
||||
<uni-col :span="18">
|
||||
<view>
|
||||
<uni-easyinput placeholder="请输入内容" v-model="queryParams.keyWord" />
|
||||
|
|
@ -36,7 +36,12 @@
|
|||
</uni-row>
|
||||
|
||||
<scroll-view scroll-y @scrolltolower="onScrollTolower" class="scroll-container">
|
||||
<view class="table-list-item" :key="index" @click="handleItem(item)" v-for="(item, index) in tableList">
|
||||
<view
|
||||
class="table-list-item"
|
||||
:key="index"
|
||||
@click="handleItem(item)"
|
||||
v-for="(item, index) in tableList"
|
||||
>
|
||||
<div class="line"></div>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">到货时间:</uni-col>
|
||||
|
|
|
|||
|
|
@ -16,11 +16,10 @@
|
|||
</uni-row>
|
||||
</view> -->
|
||||
|
||||
|
||||
<scroll-view scroll-y @scrolltolower="onScrollTolower" style="padding-bottom: 85rpx">
|
||||
<view class="table-list-item" v-for="item in codeDeviceList" :key="item.id">
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="7" >类型名称:</uni-col>
|
||||
<uni-col :span="7">类型名称:</uni-col>
|
||||
<uni-col :span="13">
|
||||
<view class="cont">{{ queryParams.maTypeName }}</view>
|
||||
</uni-col>
|
||||
|
|
@ -51,7 +50,6 @@
|
|||
</uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
|
||||
</scroll-view>
|
||||
|
||||
<view class="outbound-btn" @tap="onHandleOutbound"> 入库 </view>
|
||||
|
|
@ -60,23 +58,25 @@
|
|||
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue'
|
||||
import { getMachineById,setInboundCodeAPI } from '@/services/purchase.js'
|
||||
import { onBackPress,onLoad } from '@dcloudio/uni-app'
|
||||
import { getMachineById, setInboundCodeAPI } from '@/services/purchase.js'
|
||||
import { onBackPress, onLoad } from '@dcloudio/uni-app'
|
||||
|
||||
const codeDeviceList = ref([])
|
||||
const total = ref(0)
|
||||
const query = defineProps() // 获取上级页面传递的路由参数
|
||||
const queryParams = JSON.parse(query.queryParams)
|
||||
// const query = defineProps() // 获取上级页面传递的路由参数
|
||||
// const queryParams = JSON.parse(query.queryParams)
|
||||
const queryParams = ref({})
|
||||
|
||||
// const typeId = ref('')
|
||||
// const typeId = ref('')
|
||||
// const taskId = ref('')
|
||||
// const maTypeName = ref('')
|
||||
// const typeName = ref('')
|
||||
|
||||
// 页面加载完毕
|
||||
onLoad(() => {
|
||||
onLoad((options) => {
|
||||
queryParams.value = JSON.parse(options.queryParams)
|
||||
// typeId.value = options.typeId
|
||||
// taskId.value = options.taskId
|
||||
// taskId.value = options.taskId
|
||||
// maTypeName.value = options.maTypeName
|
||||
// typeName.value = options.typeName
|
||||
getCodeDeviceListData()
|
||||
|
|
@ -91,11 +91,11 @@ onLoad(() => {
|
|||
|
||||
// 获取编码列表
|
||||
const getCodeDeviceListData = async () => {
|
||||
console.log('queryParams',queryParams)
|
||||
let obj = {
|
||||
"typeId":queryParams.typeId,
|
||||
"taskId":queryParams.taskId,
|
||||
}
|
||||
console.log('queryParams', queryParams.value)
|
||||
let obj = {
|
||||
typeId: queryParams.value.typeId,
|
||||
taskId: queryParams.value.taskId,
|
||||
}
|
||||
const res = await getMachineById(obj)
|
||||
codeDeviceList.value.push(...res.data)
|
||||
|
||||
|
|
@ -106,13 +106,11 @@ const getCodeDeviceListData = async () => {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// 滚动触底事件
|
||||
const onScrollTolower = () => {
|
||||
console.log('滚动触底--')
|
||||
}
|
||||
|
||||
|
||||
// 复选框事件
|
||||
const onChangeChecked = (item) => {
|
||||
item.checked = !item.checked
|
||||
|
|
@ -140,7 +138,12 @@ const onHandleOutbound = async () => {
|
|||
}
|
||||
})
|
||||
|
||||
const res = await setInboundCodeAPI({taskId:queryParams.taskId, typeId:queryParams.typeId, purchaseId:queryParams.id, inPutList: paramsList })
|
||||
const res = await setInboundCodeAPI({
|
||||
taskId: queryParams.value.taskId,
|
||||
typeId: queryParams.value.typeId,
|
||||
purchaseId: queryParams.value.id,
|
||||
inPutList: paramsList,
|
||||
})
|
||||
|
||||
if (res.code === 200) {
|
||||
uni.showToast({
|
||||
|
|
|
|||
|
|
@ -2,28 +2,28 @@
|
|||
<!-- 编码出库-->
|
||||
<view class="page-container">
|
||||
<view class="table-list-item">
|
||||
<uni-forms :model="formData" label-width="100" :border="true">
|
||||
<uni-forms-item label="领料单位:" name="leaseUnit">
|
||||
<span class="form-view">{{ queryParams.leaseUnit }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="领料工程:" name="leaseProject">
|
||||
<span class="form-view">{{ queryParams.leaseProject }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物资类型:" name="maTypeName">
|
||||
<span class="form-view">{{ queryParams.maTypeName }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="规格型号:" name="typeName">
|
||||
<span class="form-view">{{ queryParams.typeName }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="待出库数量:" name="maxNum">
|
||||
<span class="form-view">{{ maxNum }}</span>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
</view>
|
||||
|
||||
<view class="table-list-item">
|
||||
<button class="scan-btn" @click="scanStart">开始扫码</button>
|
||||
</view>
|
||||
<uni-forms :model="formData" label-width="100" :border="true">
|
||||
<uni-forms-item label="领料单位:" name="leaseUnit">
|
||||
<span class="form-view">{{ queryParams.leaseUnit }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="领料工程:" name="leaseProject">
|
||||
<span class="form-view">{{ queryParams.leaseProject }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物资类型:" name="maTypeName">
|
||||
<span class="form-view">{{ queryParams.maTypeName }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="规格型号:" name="typeName">
|
||||
<span class="form-view">{{ queryParams.typeName }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="待出库数量:" name="maxNum">
|
||||
<span class="form-view">{{ maxNum }}</span>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
</view>
|
||||
|
||||
<view class="table-list-item">
|
||||
<button class="scan-btn" @click="scanStart">开始扫码</button>
|
||||
</view>
|
||||
<view class="table-list-item">
|
||||
<uni-row :gutter="24" style="display: flex; align-items: center">
|
||||
<uni-col :span="6">
|
||||
|
|
@ -35,28 +35,37 @@
|
|||
</view>
|
||||
</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>
|
||||
<view
|
||||
class="coding-btn"
|
||||
style="
|
||||
padding: 10rpx 0;
|
||||
color: #fe9a09;
|
||||
background-color: #fff7eb;
|
||||
border: 1px solid #fe9a09;
|
||||
"
|
||||
@click="getMaInfo"
|
||||
>编码检索</view
|
||||
>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
<view class="table-list-item">
|
||||
<uni-forms :model="codeData" label-width="100" :border="true">
|
||||
<uni-forms-item label="物资类型:" name="materialName">
|
||||
<span class="form-view">{{ codeData.materialName }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="规格型号:" name="materialModel">
|
||||
<span class="form-view">{{ codeData.materialModel }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="设备状态:" name="statusName">
|
||||
<span class="form-view">{{ codeData.statusName }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="设备数量:">
|
||||
<span class="form-view">1</span>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="table-list-item">
|
||||
<uni-forms :model="codeData" label-width="100" :border="true">
|
||||
<uni-forms-item label="物资类型:" name="materialName">
|
||||
<span class="form-view">{{ codeData.materialName }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="规格型号:" name="materialModel">
|
||||
<span class="form-view">{{ codeData.materialModel }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="设备状态:" name="statusName">
|
||||
<span class="form-view">{{ codeData.statusName }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="设备数量:">
|
||||
<span class="form-view">1</span>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
</view>
|
||||
|
||||
<view class="outbound-btn" @tap="onHandleOutbound"> 出库 </view>
|
||||
</view>
|
||||
</template>
|
||||
|
|
@ -67,23 +76,30 @@ import { getCodeDeviceListAPI, setOutboundNumAPI } from '@/services/picking/outb
|
|||
import { onBackPress } from '@dcloudio/uni-app'
|
||||
import { debounce } from 'lodash-es'
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
const query = defineProps() // 获取上级页面传递的路由参数
|
||||
const queryParams = JSON.parse(query.queryParams)
|
||||
const formData = ref({})
|
||||
const codeData = ref({})
|
||||
const codeNum = ref(0)
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
// const query = defineProps() // 获取上级页面传递的路由参数
|
||||
// const queryParams = JSON.parse(query.queryParams)
|
||||
const queryParams = ref({})
|
||||
const formData = ref({})
|
||||
const codeData = ref({})
|
||||
const codeNum = ref(0)
|
||||
// 编码设备列表查询参数
|
||||
const queryCodeParams = ref({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
typeId: queryParams.typeId,
|
||||
typeId: '',
|
||||
maStatus: 1,
|
||||
maCode: '',
|
||||
})
|
||||
})
|
||||
|
||||
onLoad((options) => {
|
||||
queryParams.value = JSON.parse(options.queryParams)
|
||||
queryCodeParams.value.typeId = queryParams.value.typeId
|
||||
})
|
||||
// 计算出库最大数量
|
||||
const maxNum = computed(() => {
|
||||
// 通过预领数量和已领数量计算剩余待出库数量
|
||||
const waitNum = queryParams.preNum - queryParams.alNum - codeNum.value
|
||||
const waitNum = queryParams.value.preNum - queryParams.value.alNum - codeNum.value
|
||||
return waitNum
|
||||
})
|
||||
// 扫码识别按钮
|
||||
|
|
@ -91,56 +107,56 @@ const scanStart = () => {
|
|||
console.log('编码识别--')
|
||||
// 只允许通过相机扫码
|
||||
uni.scanCode({
|
||||
onlyFromCamera: true,
|
||||
scanType: ['qrCode', 'pdf417'],
|
||||
success: (res) => {
|
||||
console.log('扫码结果:' + res.result);
|
||||
queryCodeParams.value.maCode = res.result
|
||||
},
|
||||
fail: (err) => {
|
||||
// uni.showToast({
|
||||
// title: '取消',
|
||||
// icon: 'none'
|
||||
// });
|
||||
}
|
||||
});
|
||||
onlyFromCamera: true,
|
||||
scanType: ['qrCode', 'pdf417'],
|
||||
success: (res) => {
|
||||
console.log('扫码结果:' + res.result)
|
||||
queryCodeParams.value.maCode = res.result
|
||||
},
|
||||
fail: (err) => {
|
||||
// uni.showToast({
|
||||
// title: '取消',
|
||||
// icon: 'none'
|
||||
// });
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//根据编码获取设备类型
|
||||
const getMaInfo = async() => {
|
||||
console.log('queryCodeParams', queryCodeParams.value)
|
||||
const res = await getCodeDeviceListAPI(queryCodeParams.value)
|
||||
console.log(res)
|
||||
if(res.code==200){
|
||||
if(res.rows&&res.rows.length>0){
|
||||
codeData.value = res.rows[0]
|
||||
}else{
|
||||
uni.showToast({ title: '未查询到该编码', icon: 'none' })
|
||||
}
|
||||
}
|
||||
const getMaInfo = async () => {
|
||||
console.log('queryCodeParams', queryCodeParams.value)
|
||||
const res = await getCodeDeviceListAPI(queryCodeParams.value)
|
||||
console.log(res)
|
||||
if (res.code == 200) {
|
||||
if (res.rows && res.rows.length > 0) {
|
||||
codeData.value = res.rows[0]
|
||||
} else {
|
||||
uni.showToast({ title: '未查询到该编码', icon: 'none' })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 出库按钮
|
||||
const onHandleOutbound = async () => {
|
||||
const onHandleOutbound = async () => {
|
||||
// 组装出库参数
|
||||
const paramsList = [codeData.value]
|
||||
const res = await setOutboundNumAPI({ leaseOutDetailsList: paramsList })
|
||||
const paramsList = [codeData.value]
|
||||
const res = await setOutboundNumAPI({ leaseOutDetailsList: paramsList })
|
||||
if (res.code === 200) {
|
||||
uni.showToast({
|
||||
title: '出库成功!',
|
||||
icon: 'none',
|
||||
})
|
||||
queryCodeParams.value.maCode="";
|
||||
codeData.value = {};
|
||||
codeNum.value = codeNum.value+1;
|
||||
uni.$emit('onUpdate',codeNun.value)
|
||||
queryCodeParams.value.maCode = ''
|
||||
codeData.value = {}
|
||||
codeNum.value = codeNum.value + 1
|
||||
uni.$emit('onUpdate', codeNun.value)
|
||||
}
|
||||
}
|
||||
// 页面加载完毕
|
||||
onShow(() => {
|
||||
setTimeout(()=>{
|
||||
scanStart()
|
||||
},500)
|
||||
setTimeout(() => {
|
||||
scanStart()
|
||||
}, 500)
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
@ -173,16 +189,16 @@ onShow(() => {
|
|||
}
|
||||
}
|
||||
}
|
||||
.scan-btn{
|
||||
width: 94%;
|
||||
margin: 5px auto;
|
||||
.scan-btn {
|
||||
width: 94%;
|
||||
margin: 5px auto;
|
||||
}
|
||||
.form-view {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.form-view{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
// 加载提示文字
|
||||
.loading-text {
|
||||
text-align: center;
|
||||
|
|
|
|||
|
|
@ -2,24 +2,24 @@
|
|||
<!-- 编码出库-->
|
||||
<view class="page-container">
|
||||
<view class="table-list-item">
|
||||
<uni-forms :model="formData" label-width="100" :border="true">
|
||||
<uni-forms-item label="领料单位:" name="leaseUnit">
|
||||
<span class="form-view">{{ queryParams.leaseUnit }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="领料工程:" name="leaseProject">
|
||||
<span class="form-view">{{ queryParams.leaseProject }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物资类型:" name="maTypeName">
|
||||
<span class="form-view">{{ queryParams.maTypeName }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="规格型号:" name="typeName">
|
||||
<span class="form-view">{{ queryParams.typeName }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="待出库数量:" name="maxNum">
|
||||
<span class="form-view">{{ maxNum }}</span>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
</view>
|
||||
<uni-forms :model="formData" label-width="100" :border="true">
|
||||
<uni-forms-item label="领料单位:" name="leaseUnit">
|
||||
<span class="form-view">{{ queryParams.leaseUnit }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="领料工程:" name="leaseProject">
|
||||
<span class="form-view">{{ queryParams.leaseProject }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物资类型:" name="maTypeName">
|
||||
<span class="form-view">{{ queryParams.maTypeName }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="规格型号:" name="typeName">
|
||||
<span class="form-view">{{ queryParams.typeName }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="待出库数量:" name="maxNum">
|
||||
<span class="form-view">{{ maxNum }}</span>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
</view>
|
||||
|
||||
<view class="table-list-item">
|
||||
<uni-row :gutter="24">
|
||||
|
|
@ -120,23 +120,24 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed,onUnmounted } from 'vue'
|
||||
import { onLoad,onShow } from '@dcloudio/uni-app'
|
||||
import { ref, computed, onUnmounted } from 'vue'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import { getCodeDeviceListAPI, setOutboundNumAPI } from '@/services/picking/outbound.js'
|
||||
import { onBackPress } from '@dcloudio/uni-app'
|
||||
import { debounce } from 'lodash-es'
|
||||
const query = defineProps() // 获取上级页面传递的路由参数
|
||||
const queryParams = JSON.parse(query.queryParams)
|
||||
// const query = defineProps() // 获取上级页面传递的路由参数
|
||||
// const queryParams = JSON.parse(query.queryParams)
|
||||
const queryParams = ref({})
|
||||
const formData = ref({})
|
||||
const codeDeviceList = ref([])
|
||||
const total = ref(0)
|
||||
const codeNum = ref(0)
|
||||
const codeNum = ref(0)
|
||||
|
||||
// 编码设备列表查询参数
|
||||
const queryCodeParams = ref({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
typeId: queryParams.typeId,
|
||||
typeId: '',
|
||||
maStatus: 1,
|
||||
maCode: '',
|
||||
})
|
||||
|
|
@ -144,7 +145,7 @@ const queryCodeParams = ref({
|
|||
// 计算出库最大数量
|
||||
const maxNum = computed(() => {
|
||||
// 1. 先通过预领数量和已领数量计算剩余待出库数量
|
||||
const waitNum = queryParams.preNum - queryParams.alNum - codeNum.value
|
||||
const waitNum = queryParams.value.preNum - queryParams.value.alNum - codeNum.value
|
||||
|
||||
// 2. 判断库存数量是否大于待出库数量 如大于则取待出库数量 如小于则取库存书看了
|
||||
return total.value > waitNum ? waitNum : total.value
|
||||
|
|
@ -163,12 +164,15 @@ const getCodeDeviceListData = async () => {
|
|||
}
|
||||
total.value = res.total
|
||||
}
|
||||
getCodeDeviceListData()
|
||||
|
||||
// 编码识别按钮
|
||||
const onCodeIdentify = () => {
|
||||
console.log('编码识别--')
|
||||
uni.navigateTo({ url: `/pages/picking/outbound/code-outScan?queryParams=${JSON.stringify(queryParams)}` })
|
||||
uni.navigateTo({
|
||||
url: `/pages/picking/outbound/code-outScan?queryParams=${JSON.stringify(
|
||||
queryParams.value,
|
||||
)}`,
|
||||
})
|
||||
// // 只允许通过相机扫码
|
||||
// uni.scanCode({
|
||||
// onlyFromCamera: true,
|
||||
|
|
@ -231,7 +235,7 @@ const onHandleOutbound = async () => {
|
|||
}
|
||||
|
||||
// 解构所需要的数据
|
||||
const { typeId, parentId } = queryParams
|
||||
const { typeId, parentId } = queryParams.value
|
||||
// 组装出库参数
|
||||
const paramsList = []
|
||||
codeDeviceList.value.map((e) => {
|
||||
|
|
@ -268,19 +272,20 @@ const onHandleOutbound = async () => {
|
|||
}
|
||||
|
||||
// 页面加载完毕
|
||||
onLoad(() => {
|
||||
onLoad((options) => {
|
||||
// 监听出库完成事件 刷新列表
|
||||
uni.$on('onUpdate', (num) => {
|
||||
console.log('监听事件', num)
|
||||
codeNum.value = num
|
||||
console.log('监听事件', num)
|
||||
codeNum.value = num
|
||||
})
|
||||
})
|
||||
queryParams.value = JSON.parse(options.queryParams)
|
||||
queryCodeParams.typeId = queryParams.value.typeId
|
||||
getCodeDeviceListData()
|
||||
})
|
||||
// 页面销毁时移除事件监听
|
||||
onUnmounted(() => {
|
||||
uni.$off('onUpdate') // 移除事件监听
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
@ -312,12 +317,12 @@ onUnmounted(() => {
|
|||
}
|
||||
}
|
||||
}
|
||||
.form-view{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.form-view {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
// 加载提示文字
|
||||
.loading-text {
|
||||
text-align: center;
|
||||
|
|
|
|||
|
|
@ -13,53 +13,55 @@
|
|||
</uni-row>
|
||||
|
||||
<scroll-view scroll-y class="scroll-container">
|
||||
<view v-for="(item, index) in detailsList"
|
||||
<view
|
||||
v-for="(item, index) in detailsList"
|
||||
:key="index"
|
||||
class="table-list-item"
|
||||
@tap="onCodingItem(item)">
|
||||
<div class="title">
|
||||
<span style="font-size: 15px; font-weight: 800">领料出库</span>
|
||||
<span v-if="item.status == 2" style="color: #3784fb">已完成</span>
|
||||
<span v-if="item.status != 2" style="color: #ff4d4f">未完成</span>
|
||||
</div>
|
||||
@tap="onCodingItem(item)"
|
||||
>
|
||||
<div class="title">
|
||||
<span style="font-size: 15px; font-weight: 800">领料出库</span>
|
||||
<span v-if="item.status == 2" style="color: #3784fb">已完成</span>
|
||||
<span v-if="item.status != 2" style="color: #ff4d4f">未完成</span>
|
||||
</div>
|
||||
<view class="line"></view>
|
||||
<uni-row :gutter="24">
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">物资名称:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<view class="cont">{{ item.maTypeName }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">规格型号:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<view class="cont">{{ item.typeName }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">预领数量:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<view class="cont">{{ item.preNum }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">已领数量:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<view class="cont">{{ item.alNum }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">待领数量:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<view class="cont">{{ item.preNum - item.alNum }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">单位:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<view class="cont">{{ item.unitName }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">管理模式:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<uni-tag
|
||||
|
|
@ -76,7 +78,7 @@
|
|||
/>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">状态:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<uni-tag
|
||||
|
|
@ -101,10 +103,10 @@
|
|||
<script setup>
|
||||
import { ref, onUnmounted } from 'vue'
|
||||
import { getOutboundDetailsAPI } from '@/services/picking/outbound.js'
|
||||
import { onLoad,onShow } from '@dcloudio/uni-app'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
|
||||
const detailsList = ref([])
|
||||
const query = defineProps() // 获取上级页面传递的路由参数
|
||||
// const query = defineProps() // 获取上级页面传递的路由参数
|
||||
|
||||
// 领料单位,参数等信息
|
||||
const leaseApplyInfo = ref({
|
||||
|
|
@ -117,17 +119,22 @@ const leaseApplyInfo = ref({
|
|||
unitName: '', // 单位
|
||||
storageNum: '', // 库存数量
|
||||
preNum: '', // 预领数量
|
||||
parentId: query.id, // 出库时所需参数 取列表 id
|
||||
parentId: '', // 出库时所需参数 取列表 id
|
||||
id: '', // 出库时所需参数 取详情接口 id
|
||||
typeId: '', // 出库时所需参数 取详情接口 typeId
|
||||
manageType: '', // 出库时所需参数 取详情接口 manageType
|
||||
})
|
||||
|
||||
onLoad((options) => {
|
||||
leaseApplyInfo.value.parentId = options.id
|
||||
getOutboundDetailsData()
|
||||
})
|
||||
|
||||
// 获取列表详情
|
||||
const getOutboundDetailsData = async () => {
|
||||
const { data: res } = await getOutboundDetailsAPI(query.id)
|
||||
const { data: res } = await getOutboundDetailsAPI(leaseApplyInfo.value.parentId)
|
||||
detailsList.value = res.leaseApplyDetailsList
|
||||
console.log(res.leaseApplyInfo)
|
||||
console.log(res.leaseApplyInfo)
|
||||
leaseApplyInfo.value.leaseUnitId = res.leaseApplyInfo.leaseUnitId
|
||||
leaseApplyInfo.value.leaseUnit = res.leaseApplyInfo.leaseUnit
|
||||
leaseApplyInfo.value.leaseProjectId = res.leaseApplyInfo.leaseProjectId
|
||||
|
|
@ -137,7 +144,7 @@ const getOutboundDetailsData = async () => {
|
|||
|
||||
// 点击跳转出库页面
|
||||
const onCodingItem = (item) => {
|
||||
console.log(item)
|
||||
console.log(item)
|
||||
// 解构所需要的数据
|
||||
const {
|
||||
status,
|
||||
|
|
@ -150,11 +157,11 @@ const onCodingItem = (item) => {
|
|||
unitName,
|
||||
id,
|
||||
typeId,
|
||||
unitValue
|
||||
} = item
|
||||
unitValue,
|
||||
} = item
|
||||
leaseApplyInfo.value.maTypeName = maTypeName
|
||||
leaseApplyInfo.value.typeName = typeName
|
||||
leaseApplyInfo.value.unitName = unitName
|
||||
leaseApplyInfo.value.unitName = unitName
|
||||
leaseApplyInfo.value.storageNum = storageNum
|
||||
leaseApplyInfo.value.preNum = preNum
|
||||
leaseApplyInfo.value.alNum = alNum
|
||||
|
|
@ -179,7 +186,7 @@ const onCodingItem = (item) => {
|
|||
uni.navigateTo({ url: `${codingUrl}?queryParams=${JSON.stringify(leaseApplyInfo.value)}` })
|
||||
}
|
||||
onShow(() => {
|
||||
getOutboundDetailsData()
|
||||
getOutboundDetailsData()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,39 +1,44 @@
|
|||
<template>
|
||||
<!-- 数量出库 -->
|
||||
<view class="page-container">
|
||||
<view class="page-container">
|
||||
<view class="table-list-item">
|
||||
<uni-forms :model="formData" label-width="100" :border="true">
|
||||
<uni-forms-item label="领料单位:" name="leaseUnit">
|
||||
<span class="form-view">{{ queryParams.leaseUnit }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="领料工程:" name="leaseProject">
|
||||
<span class="form-view">{{ queryParams.leaseProject }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物资类型:" name="maTypeName">
|
||||
<span class="form-view">{{ queryParams.maTypeName }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="规格型号:" name="typeName">
|
||||
<span class="form-view">{{ queryParams.typeName }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="单位:" name="unitName">
|
||||
<span class="form-view">{{ queryParams.unitName }}</span>
|
||||
</uni-forms-item>
|
||||
|
||||
<uni-forms-item label="库存数量:" name="storageNum">
|
||||
<span class="form-view">{{ queryParams.storageNum }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="预领数量:" name="preNum">
|
||||
<span class="form-view">{{ queryParams.preNum }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="已领数量:" name="alNum">
|
||||
<span class="form-view">{{ queryParams.alNum }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="出库数量:">
|
||||
<uni-easyinput v-model="outboundNum" type="number" :clearable="false" placeholder="出库数量" @input="onChangeNumber"/>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
|
||||
|
||||
<uni-forms :model="formData" label-width="100" :border="true">
|
||||
<uni-forms-item label="领料单位:" name="leaseUnit">
|
||||
<span class="form-view">{{ queryParams.leaseUnit }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="领料工程:" name="leaseProject">
|
||||
<span class="form-view">{{ queryParams.leaseProject }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物资类型:" name="maTypeName">
|
||||
<span class="form-view">{{ queryParams.maTypeName }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="规格型号:" name="typeName">
|
||||
<span class="form-view">{{ queryParams.typeName }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="单位:" name="unitName">
|
||||
<span class="form-view">{{ queryParams.unitName }}</span>
|
||||
</uni-forms-item>
|
||||
|
||||
<uni-forms-item label="库存数量:" name="storageNum">
|
||||
<span class="form-view">{{ queryParams.storageNum }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="预领数量:" name="preNum">
|
||||
<span class="form-view">{{ queryParams.preNum }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="已领数量:" name="alNum">
|
||||
<span class="form-view">{{ queryParams.alNum }}</span>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="出库数量:">
|
||||
<uni-easyinput
|
||||
v-model="outboundNum"
|
||||
type="number"
|
||||
:clearable="false"
|
||||
placeholder="出库数量"
|
||||
@input="onChangeNumber"
|
||||
/>
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
|
||||
<view class="outbound-btn" @tap="onHandleOutbound"> 出库 </view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -42,40 +47,46 @@
|
|||
<script setup>
|
||||
import { computed, ref } from 'vue'
|
||||
import { setOutboundNumAPI } from '@/services/picking/outbound.js'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
const formData = ref({})
|
||||
const outboundNum = ref(0)
|
||||
const query = defineProps() // 获取上级页面传递的路由参数
|
||||
const queryParams = JSON.parse(query.queryParams)
|
||||
// const query = defineProps() // 获取上级页面传递的路由参数
|
||||
// const queryParams = JSON.parse(query.queryParams)
|
||||
const queryParams = ref({})
|
||||
|
||||
// 计算出库最大数量
|
||||
const maxNum = computed(() => {
|
||||
// 1. 先通过预领数量和已领数量计算剩余待出库数量
|
||||
const waitNum = queryParams.preNum - queryParams.alNum
|
||||
const waitNum = queryParams.value.preNum - queryParams.value.alNum
|
||||
|
||||
// 2. 判断库存数量是否大于待出库数量 如大于则取待出库数量 如小于则取库存书看了
|
||||
return queryParams.storageNum > waitNum ? waitNum : queryParams.storageNum
|
||||
return queryParams.value.storageNum > waitNum ? waitNum : queryParams.value.storageNum
|
||||
})
|
||||
|
||||
onLoad((options) => {
|
||||
queryParams.value = JSON.parse(options.queryParams)
|
||||
})
|
||||
|
||||
// 数量选择框change事件
|
||||
const onChangeNumber = (e) => {
|
||||
// outboundNum.value
|
||||
setTimeout(()=>{
|
||||
if(queryParams.unitValue==1){
|
||||
outboundNum.value = Number(e.replace(/[^\d.]/g,''))
|
||||
}else{
|
||||
outboundNum.value = Number(e.replace(/[^\d]/g,''))
|
||||
}
|
||||
if (Number(e)<= 0) {
|
||||
outboundNum.value = 0;
|
||||
setTimeout(() => {
|
||||
if (queryParams.value.unitValue == 1) {
|
||||
outboundNum.value = Number(e.replace(/[^\d.]/g, ''))
|
||||
} else {
|
||||
outboundNum.value = Number(e.replace(/[^\d]/g, ''))
|
||||
}
|
||||
if (Number(e) <= 0) {
|
||||
outboundNum.value = 0
|
||||
}
|
||||
if (Number(e) > maxNum.value) {
|
||||
uni.showToast({
|
||||
title: '已达到当前物资最大出库数量!',
|
||||
icon: 'none',
|
||||
})
|
||||
outboundNum.value = maxNum.value;
|
||||
})
|
||||
outboundNum.value = maxNum.value
|
||||
}
|
||||
},500)
|
||||
}, 500)
|
||||
}
|
||||
|
||||
// 出库按钮
|
||||
|
|
@ -89,7 +100,8 @@ const onHandleOutbound = async () => {
|
|||
}
|
||||
|
||||
// 解构所需要的数据
|
||||
const { maTypeName, typeName, preNum, alNum, id, typeId, parentId, manageType } = queryParams
|
||||
const { maTypeName, typeName, preNum, alNum, id, typeId, parentId, manageType } =
|
||||
queryParams.value
|
||||
// 组装接口参数
|
||||
const params = {
|
||||
alNum,
|
||||
|
|
@ -163,35 +175,35 @@ const onHandleOutbound = async () => {
|
|||
line-height: 65rpx;
|
||||
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 {
|
||||
margin: 20rpx 0;
|
||||
height: 1px;
|
||||
background-color: #e8e8e8;
|
||||
}
|
||||
}
|
||||
.form-view{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.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 {
|
||||
margin: 20rpx 0;
|
||||
height: 1px;
|
||||
background-color: #e8e8e8;
|
||||
}
|
||||
}
|
||||
.form-view {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
// 加载提示文字
|
||||
.loading-text {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
<template>
|
||||
<!-- 数量出库 -->
|
||||
<view class="page-container">
|
||||
|
||||
<view class="table-list-item">
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">物资名称:</uni-col>
|
||||
|
|
@ -22,18 +21,30 @@
|
|||
</uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
<uni-row :gutter="24" class="search-form" style="background: #fff;padding: 10px;margin: 5px;border-radius: 5px;">
|
||||
<uni-row
|
||||
:gutter="24"
|
||||
class="search-form"
|
||||
style="background: #fff; padding: 10px; margin: 5px; border-radius: 5px"
|
||||
>
|
||||
<uni-col :span="5">
|
||||
<view class="btnBox" style="background-color: #18bc37" @click="changeTab(1)"> 内部维修 </view>
|
||||
<view class="btnBox" style="background-color: #18bc37" @click="changeTab(1)">
|
||||
内部维修
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="5">
|
||||
<view class="btnBox" style="background-color: #f3a73f" @click="changeTab(2)"> 返场维修 </view>
|
||||
<view class="btnBox" style="background-color: #f3a73f" @click="changeTab(2)">
|
||||
返场维修
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="5">
|
||||
<view class="btnBox" style="background-color: #EE6969" @click="changeTab(3)"> 待报废 </view>
|
||||
<view class="btnBox" style="background-color: #ee6969" @click="changeTab(3)">
|
||||
待报废
|
||||
</view>
|
||||
</uni-col>
|
||||
<uni-col :span="5">
|
||||
<view class="btnBox" style="background-color: #18bc37" @click="saveCode"> 维修完成 </view>
|
||||
<view class="btnBox" style="background-color: #18bc37" @click="saveCode">
|
||||
维修完成
|
||||
</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<scroll-view scroll-y style="padding-bottom: 20rpx">
|
||||
|
|
@ -55,15 +66,15 @@
|
|||
</view>
|
||||
|
||||
<!-- 内部维修 -->
|
||||
<view class="table-list-item" v-if="repairType==1">
|
||||
<view class="table-list-item" v-if="repairType == 1">
|
||||
<h2 style="padding: 4rpx 0; font-weight: bold">内部维修</h2>
|
||||
<uni-forms ref="baseForm" label-align="right" >
|
||||
<uni-forms ref="baseForm" label-align="right">
|
||||
<!-- <uni-forms-item label="维修数量">
|
||||
<uni-easyinput placeholder="请填写维修数量" v-model="formLeft.repairNum"/>
|
||||
</uni-forms-item> -->
|
||||
<div v-for="(item, index) in partItems" :key="index">
|
||||
<uni-forms-item label="配件类型">
|
||||
<uni-easyinput placeholder="配件类型" v-model="item.partId"/>
|
||||
<uni-easyinput placeholder="配件类型" v-model="item.partId" />
|
||||
<!-- <ssha-dropdownSelect
|
||||
:search="true"
|
||||
label="label"
|
||||
|
|
@ -75,49 +86,94 @@
|
|||
</ssha-dropdownSelect> -->
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="配件数量">
|
||||
<uni-easyinput placeholder="配件数量" v-model="item.partNum" type="number" :clearable="false" @input="partCheckNum(item)"/>
|
||||
<uni-easyinput
|
||||
placeholder="配件数量"
|
||||
v-model="item.partNum"
|
||||
type="number"
|
||||
:clearable="false"
|
||||
@input="partCheckNum(item)"
|
||||
/>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="是否收费">
|
||||
<div style="width: 100%;display: flex;">
|
||||
<uni-data-select :localdata="isChargeList" v-model="item.isCharge" placeholder="请选择是否收费" />
|
||||
<div style="width:50px;margin-left: 10px;">
|
||||
<span style="margin-right: 10px;font-size: 24px;color: #19be6b;" @click="addPart">+</span>
|
||||
<span style="font-size: 24px;color: red;" @click="delPart(index)">-</span>
|
||||
<div style="width: 100%; display: flex">
|
||||
<uni-data-select
|
||||
:localdata="isChargeList"
|
||||
v-model="item.isCharge"
|
||||
placeholder="请选择是否收费"
|
||||
/>
|
||||
<div style="width: 50px; margin-left: 10px">
|
||||
<span
|
||||
style="margin-right: 10px; font-size: 24px; color: #19be6b"
|
||||
@click="addPart"
|
||||
>+</span
|
||||
>
|
||||
<span
|
||||
style="font-size: 24px; color: red"
|
||||
@click="delPart(index)"
|
||||
>-</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</uni-forms-item>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</uni-forms>
|
||||
</view>
|
||||
|
||||
<!-- 返厂维修 -->
|
||||
<view class="table-list-item" v-if="repairType==2">
|
||||
<view class="table-list-item" v-if="repairType == 2">
|
||||
<h2 style="padding: 4rpx 0; font-weight: bold">返厂维修</h2>
|
||||
<uni-forms ref="baseForm" label-align="right">
|
||||
<!-- <uni-forms-item label="维修数量">
|
||||
<uni-easyinput placeholder="请输入维修数量" v-model="formMiddle.repairNum"/>
|
||||
</uni-forms-item> -->
|
||||
|
||||
|
||||
<div v-for="(item, index) in partItemsMiddle" :key="index">
|
||||
<uni-forms-item label="配件名称">
|
||||
<uni-easyinput placeholder="配件类型" v-model="item.partName"/>
|
||||
</uni-forms-item>
|
||||
<uni-easyinput placeholder="配件类型" v-model="item.partName" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物资厂家">
|
||||
<uni-data-select :localdata="partsMillList" v-model="item.supplierId" placeholder="请选择物资厂家" />
|
||||
<uni-data-select
|
||||
:localdata="partsMillList"
|
||||
v-model="item.supplierId"
|
||||
placeholder="请选择物资厂家"
|
||||
/>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="是否收费">
|
||||
<uni-data-select :localdata="isChargeList" v-model="item.isCharge" placeholder="请选择是否收费" />
|
||||
<uni-data-select
|
||||
:localdata="isChargeList"
|
||||
v-model="item.isCharge"
|
||||
placeholder="请选择是否收费"
|
||||
/>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="配件数量">
|
||||
<uni-easyinput v-model="item.partNum" placeholder="请输入配件数量" type="number" :clearable="false" @input="partCheckNum(item)"/>
|
||||
<uni-easyinput
|
||||
v-model="item.partNum"
|
||||
placeholder="请输入配件数量"
|
||||
type="number"
|
||||
:clearable="false"
|
||||
@input="partCheckNum(item)"
|
||||
/>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="金额">
|
||||
<div style="width: 100%;display: flex;">
|
||||
<uni-easyinput v-model="item.partPrice" placeholder="请输入金额" type="number" :clearable="false" @input="costCheckNum(item)"/>
|
||||
<div style="width:50px;margin-left: 10px;">
|
||||
<span style="margin-right: 10px;font-size: 24px;color: #19be6b;" @click="addMidPart">+</span>
|
||||
<span style="font-size: 24px;color: red;" @click="delMidPart(index)">-</span>
|
||||
<uni-forms-item label="金额">
|
||||
<div style="width: 100%; display: flex">
|
||||
<uni-easyinput
|
||||
v-model="item.partPrice"
|
||||
placeholder="请输入金额"
|
||||
type="number"
|
||||
:clearable="false"
|
||||
@input="costCheckNum(item)"
|
||||
/>
|
||||
<div style="width: 50px; margin-left: 10px">
|
||||
<span
|
||||
style="margin-right: 10px; font-size: 24px; color: #19be6b"
|
||||
@click="addMidPart"
|
||||
>+</span
|
||||
>
|
||||
<span
|
||||
style="font-size: 24px; color: red"
|
||||
@click="delMidPart(index)"
|
||||
>-</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</uni-forms-item>
|
||||
|
|
@ -126,17 +182,24 @@
|
|||
</view>
|
||||
|
||||
<!-- 维修报废 -->
|
||||
<view class="table-list-item" v-if="repairType==3">
|
||||
<view class="table-list-item" v-if="repairType == 3">
|
||||
<h2 style="padding: 4rpx 0; font-weight: bold">维修报废</h2>
|
||||
<uni-forms ref="baseForm" label-align="right">
|
||||
<!-- <uni-forms-item label="报废数量">
|
||||
<uni-easyinput placeholder="请填写报废数量" v-model="formRight.scrapNum"/>
|
||||
</uni-forms-item> -->
|
||||
<uni-forms-item label="报废原因">
|
||||
<uni-easyinput placeholder="请填写报废原因" v-model="formRight.scrapReason"/>
|
||||
<uni-easyinput
|
||||
placeholder="请填写报废原因"
|
||||
v-model="formRight.scrapReason"
|
||||
/>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="损坏原因">
|
||||
<uni-data-select :localdata="damageReasonList" v-model="formRight.scrapType" placeholder="请选择损坏原因" />
|
||||
<uni-data-select
|
||||
:localdata="damageReasonList"
|
||||
v-model="formRight.scrapType"
|
||||
placeholder="请选择损坏原因"
|
||||
/>
|
||||
</uni-forms-item>
|
||||
<!-- <uni-forms-item label="其他原因">
|
||||
<uni-easyinput placeholder="请填写其他原因" />
|
||||
|
|
@ -152,14 +215,20 @@
|
|||
|
||||
<script setup>
|
||||
import { computed, ref } from 'vue'
|
||||
import { partTypeTreeList,getSupplierList,saveRepairRow } from '@/services/repair/repair.js'
|
||||
const query = defineProps() // 获取上级页面传递的路由参数
|
||||
const queryParams = JSON.parse(query.queryParams)
|
||||
const rowIndex = query.rowIndex;
|
||||
import { partTypeTreeList, getSupplierList, saveRepairRow } from '@/services/repair/repair.js'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
// const query = defineProps() // 获取上级页面传递的路由参数
|
||||
// const queryParams = JSON.parse(query.queryParams)
|
||||
const queryParams = ref({})
|
||||
|
||||
onLoad((options) => {
|
||||
queryParams.value = JSON.parse(options.queryParams)
|
||||
})
|
||||
const rowIndex = query.rowIndex
|
||||
|
||||
const repairType = ref(1)
|
||||
const changeTab = async (e) => {
|
||||
repairType.value = e
|
||||
repairType.value = e
|
||||
}
|
||||
|
||||
const repairPerson = ref([
|
||||
|
|
@ -173,82 +242,90 @@ const damageReasonList = ref([
|
|||
{ value: 0, text: '自然损坏' },
|
||||
{ value: 1, text: '人为损坏' },
|
||||
])
|
||||
|
||||
|
||||
const isChargeList = ref([
|
||||
{ value: 1, text: '是' },
|
||||
{ value: 2, text: '否' },
|
||||
])
|
||||
//内部维修
|
||||
const partItems = ref([{ partType: "", partNum: "", isCharge: "",partId: "16" }])
|
||||
const partItems = ref([{ partType: '', partNum: '', isCharge: '', partId: '16' }])
|
||||
const addPart = () => {
|
||||
partItems.value.push({ partType: "", partNum: "", isCharge: "", partId: "16" });
|
||||
partItems.value.push({ partType: '', partNum: '', isCharge: '', partId: '16' })
|
||||
}
|
||||
const delPart = (index) => {
|
||||
if (partItems.value.length > 1) {
|
||||
partItems.value.splice(index, 1);
|
||||
partItems.value.splice(index, 1)
|
||||
}
|
||||
}
|
||||
const partIds = ref([])
|
||||
const partIds = ref([])
|
||||
const formLeft = ref({
|
||||
// repairNum:0
|
||||
})
|
||||
const partTreeData = ref([])
|
||||
const getPartTreeData = async() => {
|
||||
const getPartTreeData = async () => {
|
||||
const res = await partTypeTreeList({})
|
||||
partTreeData.value = res.data;
|
||||
|
||||
partTreeData.value = res.data
|
||||
|
||||
console.log(res)
|
||||
}
|
||||
getPartTreeData()
|
||||
|
||||
|
||||
//返厂维修
|
||||
//返厂维修
|
||||
const partsMillList = ref([])
|
||||
const getSupplierListData = async() => {
|
||||
const getSupplierListData = async () => {
|
||||
const res = await getSupplierList({})
|
||||
partsMillList.value = res.rows.map(item=>{
|
||||
let obj = {
|
||||
value:item.supplierId,
|
||||
text:item.supplier
|
||||
partsMillList.value = res.rows.map((item) => {
|
||||
let obj = {
|
||||
value: item.supplierId,
|
||||
text: item.supplier,
|
||||
}
|
||||
return obj
|
||||
});
|
||||
})
|
||||
}
|
||||
getSupplierListData()
|
||||
const partItemsMiddle = ref([{ partName: "", supplierId: "", partNum: "", partPrice: "0", isCharge: "" },])
|
||||
const partItemsMiddle = ref([
|
||||
{ partName: '', supplierId: '', partNum: '', partPrice: '0', isCharge: '' },
|
||||
])
|
||||
const addMidPart = () => {
|
||||
partItemsMiddle.value.push({ partName: "", supplierId: "", partNum: "", partPrice: "0", isCharge: "" });
|
||||
partItemsMiddle.value.push({
|
||||
partName: '',
|
||||
supplierId: '',
|
||||
partNum: '',
|
||||
partPrice: '0',
|
||||
isCharge: '',
|
||||
})
|
||||
}
|
||||
const delMidPart = (index) => {
|
||||
if (partItemsMiddle.value.length > 1) {
|
||||
partItemsMiddle.value.splice(index, 1);
|
||||
partItemsMiddle.value.splice(index, 1)
|
||||
}
|
||||
}
|
||||
const formMiddle = ref({
|
||||
// supplierId:undefined,
|
||||
// repairNum:0
|
||||
})
|
||||
|
||||
|
||||
//待报废
|
||||
const formRight = ref({
|
||||
// scrapNum:0,
|
||||
scrapType:undefined,
|
||||
scrapReason:undefined,
|
||||
scrapType: undefined,
|
||||
scrapReason: undefined,
|
||||
})
|
||||
const rowData = ref(queryParams)
|
||||
const rowData = ref({})
|
||||
//数量管理保存
|
||||
const saveCode = async() => {
|
||||
console.log(rowData)
|
||||
if(repairType.value==1){
|
||||
const saveCode = async () => {
|
||||
// console.log(rowData)
|
||||
rowData.value = queryParams.value
|
||||
if (repairType.value == 1) {
|
||||
for (let i = 0; i < partItems.value.length; i++) {
|
||||
rowData.value.repairDeviceList[rowIndex].codeInRepairPartList.push({
|
||||
isCharge: partItems.value[i].isCharge,
|
||||
partId: partItems.value[i].partId,
|
||||
partNum: partItems.value[i].partNum,
|
||||
// repairNum: formLeft.value.repairNum,
|
||||
});
|
||||
})
|
||||
}
|
||||
}else if(repairType.value==2){
|
||||
} else if (repairType.value == 2) {
|
||||
for (let i = 0; i < partItemsMiddle.value.length; i++) {
|
||||
rowData.value.repairDeviceList[rowIndex].codeOutRepairPartList.push({
|
||||
isCharge: partItemsMiddle.value[i].isCharge,
|
||||
|
|
@ -257,26 +334,26 @@ const saveCode = async() => {
|
|||
partName: partItemsMiddle.value[i].partName,
|
||||
supplierId: partItemsMiddle.value[i].supplierId,
|
||||
// repairNum: formMiddle.value.repairNum,
|
||||
});
|
||||
})
|
||||
}
|
||||
}else if(repairType.value==3){
|
||||
} else if (repairType.value == 3) {
|
||||
// this.uploadKey = Date.now();
|
||||
// if(this.fileList.length!=0){
|
||||
// await this.getImaUpload(),
|
||||
formRight.value.fileList = [];
|
||||
formRight.value.fileList = []
|
||||
// }else{
|
||||
// formRight.value.fileList = this.fileListTemp;
|
||||
// }
|
||||
// console.log('formRight.value',formRight.value)
|
||||
rowData.value.repairDeviceList[rowIndex].codeScrapRepairPartList.push(formRight.value)
|
||||
}
|
||||
rowData.value.repairDeviceList[rowIndex].repairType = repairType.value;
|
||||
rowData.value.repairDeviceList[rowIndex].repairType = repairType.value
|
||||
saveRepairRow(rowData.value.repairDeviceList).then(async (response) => {
|
||||
if (response.code == 200) {
|
||||
uni.showToast({ title: '保存成功', icon: 'none' })
|
||||
uni.navigateBack({
|
||||
delta: 2 // 返回到已存在的页面
|
||||
});
|
||||
delta: 2, // 返回到已存在的页面
|
||||
})
|
||||
// this.$modal.msgSuccess("保存成功");
|
||||
// this.fileList=[];
|
||||
// this.fileListTemp=[];
|
||||
|
|
@ -284,38 +361,32 @@ const saveCode = async() => {
|
|||
// let param = {
|
||||
// taskId: rowData.value.taskId,
|
||||
// keyword: "",
|
||||
// };
|
||||
// };
|
||||
// const res = await getAppRepairMaTypeList(param);
|
||||
// this.equipmentList = res.data;
|
||||
// this.equipmentList.forEach((e) => {
|
||||
// e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum);
|
||||
// });
|
||||
// });
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 配件框change事件
|
||||
const partCheckNum = (item) => {
|
||||
// 配件框change事件
|
||||
const partCheckNum = (item) => {
|
||||
// console.log(item)
|
||||
// console.log(item.partNum)
|
||||
setTimeout(()=>{
|
||||
item.partNum = Number(String(item.partNum).replace(/[^\d.]/g,''))
|
||||
},500)
|
||||
setTimeout(() => {
|
||||
item.partNum = Number(String(item.partNum).replace(/[^\d.]/g, ''))
|
||||
}, 500)
|
||||
}
|
||||
// 金额框change事件
|
||||
const costCheckNum = (item) => {
|
||||
// 金额框change事件
|
||||
const costCheckNum = (item) => {
|
||||
// console.log(item)
|
||||
// console.log(item.partPrice)
|
||||
setTimeout(()=>{
|
||||
item.partPrice = Number(String(item.partPrice).replace(/[^\d.]/g,''))
|
||||
},500)
|
||||
setTimeout(() => {
|
||||
item.partPrice = Number(String(item.partPrice).replace(/[^\d.]/g, ''))
|
||||
}, 500)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
|||
|
|
@ -30,7 +30,9 @@
|
|||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">待修数量:</uni-col>
|
||||
<uni-col :span="18"
|
||||
><view class="cont">{{ queryParams.typeRepairNum - queryParams.typeRepairedNum }}</view>
|
||||
><view class="cont">{{
|
||||
queryParams.typeRepairNum - queryParams.typeRepairedNum
|
||||
}}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
|
|
@ -49,7 +51,7 @@
|
|||
</label>
|
||||
</checkbox-group>
|
||||
</view> -->
|
||||
<div v-for="(item,index) in repairDeviceList" :key="index" >
|
||||
<div v-for="(item, index) in repairDeviceList" :key="index">
|
||||
<view class="table-list-item" @click="goOperate(index)">
|
||||
<uni-row :gutter="24">
|
||||
<!-- <uni-col :span="2">
|
||||
|
|
@ -65,52 +67,59 @@
|
|||
</label>
|
||||
</checkbox-group>
|
||||
</uni-col> -->
|
||||
<uni-col :span="2">{{ index+1 }}.</uni-col>
|
||||
<uni-col :span="2">{{ index + 1 }}.</uni-col>
|
||||
<!-- <uni-col :span="6">{{ queryParams.type }}</uni-col> -->
|
||||
<uni-col :span="16">{{item.code}}</uni-col>
|
||||
<uni-col :span="6">
|
||||
<view class="cont" v-if="item.status == '1'" style="color: green">已完成</view>
|
||||
<view class="cont" v-if="item.status == '0'" style="color: red">未完成</view>
|
||||
<uni-col :span="16">{{ item.code }}</uni-col>
|
||||
<uni-col :span="6">
|
||||
<view class="cont" v-if="item.status == '1'" style="color: green"
|
||||
>已完成</view
|
||||
>
|
||||
<view class="cont" v-if="item.status == '0'" style="color: red"
|
||||
>未完成</view
|
||||
>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, ref } from 'vue'
|
||||
import { computed, ref } from 'vue'
|
||||
import { auditRepairPass } from '@/services/repair/repair.js'
|
||||
const query = defineProps() // 获取上级页面传递的路由参数
|
||||
const queryParams = JSON.parse(query.queryParams)
|
||||
console.log(queryParams)
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
// const query = defineProps() // 获取上级页面传递的路由参数
|
||||
// const queryParams = JSON.parse(query.queryParams)
|
||||
const queryParams = ref({})
|
||||
// console.log(queryParams)
|
||||
|
||||
onLoad((options) => {
|
||||
queryParams.value = JSON.parse(options.queryParams)
|
||||
})
|
||||
const allChecked = ref(false)
|
||||
const repairDeviceList = ref(queryParams.repairDeviceList)
|
||||
const repairDeviceList = ref(queryParams.repairDeviceList)
|
||||
|
||||
// 点击跳转维修页面
|
||||
const goOperate = (index) => {
|
||||
const goOperate = (index) => {
|
||||
const codingUrl = '/pages/repair/repairManage/code-operate' // 编码维修
|
||||
uni.navigateTo({ url: `${codingUrl}?queryParams=${JSON.stringify(queryParams)}&rowIndex=${index}` })
|
||||
uni.navigateTo({
|
||||
url: `${codingUrl}?queryParams=${JSON.stringify(queryParams.value)}&rowIndex=${index}`,
|
||||
})
|
||||
}
|
||||
|
||||
const onQualified = async () => {
|
||||
console.log(queryParams)
|
||||
const res = await auditRepairPass(queryParams.ids)
|
||||
const res = await auditRepairPass(queryParams.value.ids)
|
||||
if (res.code === 200) {
|
||||
uni.showToast({
|
||||
title: '操作成功!',
|
||||
icon: 'none',
|
||||
})
|
||||
uni.navigateBack({
|
||||
delta: 1 // 返回到已存在的页面
|
||||
});
|
||||
delta: 1, // 返回到已存在的页面
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
:key="index"
|
||||
class="table-list-item"
|
||||
@tap="onRepairItem(item)"
|
||||
>
|
||||
>
|
||||
<div class="title">
|
||||
<span style="font-size: 15px; font-weight: 800">维修任务</span>
|
||||
<!-- <span :style="{ color: active == 1 ? '#3784fb' : '#ff4d4f' }">{{active == 1 ? '已完成' : '未完成'}}</span> -->
|
||||
|
|
@ -111,13 +111,14 @@
|
|||
<script setup>
|
||||
import { ref, onUnmounted, computed } from 'vue'
|
||||
import { getRepairDetailsAPI, auditRepairPass } from '@/services/repair/repair.js'
|
||||
import { onLoad,onShow } from '@dcloudio/uni-app'
|
||||
const detailsList = ref([])
|
||||
const query = defineProps() // 获取上级页面传递的路由参数
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
// const detailsList = ref([])
|
||||
// const query = defineProps() // 获取上级页面传递的路由参数
|
||||
const taskId = ref('')
|
||||
|
||||
// 获取列表详情
|
||||
const getOutboundDetailsData = async () => {
|
||||
const res = await getRepairDetailsAPI({ taskId: query.taskId })
|
||||
const res = await getRepairDetailsAPI({ taskId: taskId.value })
|
||||
detailsList.value = res.data
|
||||
detailsList.value = detailsList.value.map((e) => {
|
||||
return { ...e, isChecked: false }
|
||||
|
|
@ -160,10 +161,10 @@ const onQualified = async () => {
|
|||
const ids = []
|
||||
detailsList.value.forEach((e) => {
|
||||
if (e.isChecked) {
|
||||
if(e.ids.length>0){
|
||||
e.ids.forEach((f =>{
|
||||
if (e.ids.length > 0) {
|
||||
e.ids.forEach((f) => {
|
||||
ids.push(f)
|
||||
}))
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
@ -180,7 +181,7 @@ const onQualified = async () => {
|
|||
|
||||
// 点击跳转维修页面
|
||||
const onRepairItem = (item) => {
|
||||
console.log(item)
|
||||
console.log(item)
|
||||
let queryParams = null
|
||||
let codingUrl = ''
|
||||
if (item.manageType === 0) {
|
||||
|
|
@ -193,18 +194,20 @@ const onRepairItem = (item) => {
|
|||
uni.navigateTo({ url: `${codingUrl}?queryParams=${JSON.stringify(queryParams)}` })
|
||||
}
|
||||
onShow(() => {
|
||||
getOutboundDetailsData()
|
||||
getOutboundDetailsData()
|
||||
})
|
||||
|
||||
// 页面加载完毕
|
||||
onLoad(() => {
|
||||
getOutboundDetailsData()
|
||||
onLoad((options) => {
|
||||
taskId.value = options.taskId
|
||||
getOutboundDetailsData()
|
||||
// 监听出库完成事件 刷新列表
|
||||
uni.$on('onUpdate', () => {
|
||||
// console.log('监听事件')
|
||||
// 刷新列表
|
||||
getOutboundDetailsData()
|
||||
})
|
||||
})
|
||||
})
|
||||
// 页面销毁时移除事件监听
|
||||
onUnmounted(() => {
|
||||
uni.$off('onUpdate') // 移除事件监听
|
||||
|
|
|
|||
|
|
@ -3,7 +3,9 @@
|
|||
<view class="page-container">
|
||||
<uni-row :gutter="24" class="search-form">
|
||||
<uni-col :span="6">
|
||||
<view class="search" style="background-color: #19be6b" @click="saveNumAll"> 维修完成 </view>
|
||||
<view class="search" style="background-color: #19be6b" @click="saveNumAll">
|
||||
维修完成
|
||||
</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<view class="table-list-item">
|
||||
|
|
@ -22,7 +24,9 @@
|
|||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">待修数量:</uni-col>
|
||||
<uni-col :span="18"
|
||||
><view class="cont">{{ queryParams.typeRepairNum - queryParams.typeRepairedNum }}</view>
|
||||
><view class="cont">{{
|
||||
queryParams.typeRepairNum - queryParams.typeRepairedNum
|
||||
}}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
|
|
@ -48,13 +52,19 @@
|
|||
<!-- 内部维修 -->
|
||||
<view class="table-list-item">
|
||||
<h2 style="padding: 4rpx 0; font-weight: bold">内部维修</h2>
|
||||
<uni-forms ref="baseForm" label-align="right" >
|
||||
<uni-forms ref="baseForm" label-align="right">
|
||||
<uni-forms-item label="维修数量">
|
||||
<uni-easyinput placeholder="请填写维修数量" v-model="formLeft.repairNum" type="number" :clearable="false" @input="repairCheckNum1"/>
|
||||
<uni-easyinput
|
||||
placeholder="请填写维修数量"
|
||||
v-model="formLeft.repairNum"
|
||||
type="number"
|
||||
:clearable="false"
|
||||
@input="repairCheckNum1"
|
||||
/>
|
||||
</uni-forms-item>
|
||||
<div v-for="(item, index) in partItems" :key="index">
|
||||
<uni-forms-item label="配件类型">
|
||||
<uni-easyinput placeholder="配件类型" v-model="item.partId"/>
|
||||
<uni-easyinput placeholder="配件类型" v-model="item.partId" />
|
||||
<!-- <ssha-dropdownSelect
|
||||
:search="true"
|
||||
label="label"
|
||||
|
|
@ -66,19 +76,36 @@
|
|||
</ssha-dropdownSelect> -->
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="配件数量">
|
||||
<uni-easyinput placeholder="配件数量" v-model="item.partNum" type="number" :clearable="false" @input="partCheckNum(item)"/>
|
||||
<uni-easyinput
|
||||
placeholder="配件数量"
|
||||
v-model="item.partNum"
|
||||
type="number"
|
||||
:clearable="false"
|
||||
@input="partCheckNum(item)"
|
||||
/>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="是否收费">
|
||||
<div style="width: 100%;display: flex;">
|
||||
<uni-data-select :localdata="isChargeList" v-model="item.isCharge" placeholder="请选择是否收费" />
|
||||
<div style="width:50px;margin-left: 10px;">
|
||||
<span style="margin-right: 10px;font-size: 24px;color: #19be6b;" @click="addPart">+</span>
|
||||
<span style="font-size: 24px;color: red;" @click="delPart(index)">-</span>
|
||||
<div style="width: 100%; display: flex">
|
||||
<uni-data-select
|
||||
:localdata="isChargeList"
|
||||
v-model="item.isCharge"
|
||||
placeholder="请选择是否收费"
|
||||
/>
|
||||
<div style="width: 50px; margin-left: 10px">
|
||||
<span
|
||||
style="margin-right: 10px; font-size: 24px; color: #19be6b"
|
||||
@click="addPart"
|
||||
>+</span
|
||||
>
|
||||
<span
|
||||
style="font-size: 24px; color: red"
|
||||
@click="delPart(index)"
|
||||
>-</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</uni-forms-item>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</uni-forms>
|
||||
</view>
|
||||
|
||||
|
|
@ -87,27 +114,61 @@
|
|||
<h2 style="padding: 4rpx 0; font-weight: bold">返厂维修</h2>
|
||||
<uni-forms ref="baseForm" label-align="right">
|
||||
<uni-forms-item label="维修数量">
|
||||
<uni-easyinput placeholder="请输入维修数量" v-model="formMiddle.repairNum" type="number" :clearable="false" @input="repairCheckNum2"/>
|
||||
<uni-easyinput
|
||||
placeholder="请输入维修数量"
|
||||
v-model="formMiddle.repairNum"
|
||||
type="number"
|
||||
:clearable="false"
|
||||
@input="repairCheckNum2"
|
||||
/>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="物资厂家">
|
||||
<uni-data-select :localdata="partsMillList" v-model="formMiddle.supplierId" placeholder="请选择物资厂家" />
|
||||
<uni-data-select
|
||||
:localdata="partsMillList"
|
||||
v-model="formMiddle.supplierId"
|
||||
placeholder="请选择物资厂家"
|
||||
/>
|
||||
</uni-forms-item>
|
||||
<div v-for="(item, index) in partItemsMiddle" :key="index">
|
||||
<uni-forms-item label="配件名称">
|
||||
<uni-easyinput placeholder="配件类型" v-model="item.partName"/>
|
||||
</uni-forms-item>
|
||||
<uni-easyinput placeholder="配件类型" v-model="item.partName" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="是否收费">
|
||||
<uni-data-select :localdata="isChargeList" v-model="item.isCharge" placeholder="请选择是否收费" />
|
||||
<uni-data-select
|
||||
:localdata="isChargeList"
|
||||
v-model="item.isCharge"
|
||||
placeholder="请选择是否收费"
|
||||
/>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="配件数量">
|
||||
<uni-easyinput v-model="item.partNum" placeholder="请输入配件数量" type="number" :clearable="false" @input="partCheckNum(item)"/>
|
||||
<uni-easyinput
|
||||
v-model="item.partNum"
|
||||
placeholder="请输入配件数量"
|
||||
type="number"
|
||||
:clearable="false"
|
||||
@input="partCheckNum(item)"
|
||||
/>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="金额">
|
||||
<div style="width: 100%;display: flex;">
|
||||
<uni-easyinput v-model="item.partPrice" placeholder="请输入金额" type="number" :clearable="false" @input="costCheckNum(item)"/>
|
||||
<div style="width:50px;margin-left: 10px;">
|
||||
<span style="margin-right: 10px;font-size: 24px;color: #19be6b;" @click="addMidPart">+</span>
|
||||
<span style="font-size: 24px;color: red;" @click="delMidPart(index)">-</span>
|
||||
<uni-forms-item label="金额">
|
||||
<div style="width: 100%; display: flex">
|
||||
<uni-easyinput
|
||||
v-model="item.partPrice"
|
||||
placeholder="请输入金额"
|
||||
type="number"
|
||||
:clearable="false"
|
||||
@input="costCheckNum(item)"
|
||||
/>
|
||||
<div style="width: 50px; margin-left: 10px">
|
||||
<span
|
||||
style="margin-right: 10px; font-size: 24px; color: #19be6b"
|
||||
@click="addMidPart"
|
||||
>+</span
|
||||
>
|
||||
<span
|
||||
style="font-size: 24px; color: red"
|
||||
@click="delMidPart(index)"
|
||||
>-</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</uni-forms-item>
|
||||
|
|
@ -120,13 +181,25 @@
|
|||
<h2 style="padding: 4rpx 0; font-weight: bold">维修报废</h2>
|
||||
<uni-forms ref="baseForm" label-align="right">
|
||||
<uni-forms-item label="报废数量">
|
||||
<uni-easyinput placeholder="请填写报废数量" v-model="formRight.scrapNum" type="number" :clearable="false" @input="repairCheckNum3"/>
|
||||
<uni-easyinput
|
||||
placeholder="请填写报废数量"
|
||||
v-model="formRight.scrapNum"
|
||||
type="number"
|
||||
:clearable="false"
|
||||
@input="repairCheckNum3"
|
||||
/>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="报废原因">
|
||||
<uni-easyinput placeholder="请填写报废原因" v-model="formRight.scrapReason"/>
|
||||
<uni-easyinput
|
||||
placeholder="请填写报废原因"
|
||||
v-model="formRight.scrapReason"
|
||||
/>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="损坏原因">
|
||||
<uni-data-select :localdata="damageReasonList" placeholder="请选择损坏原因" />
|
||||
<uni-data-select
|
||||
:localdata="damageReasonList"
|
||||
placeholder="请选择损坏原因"
|
||||
/>
|
||||
</uni-forms-item>
|
||||
<!-- <uni-forms-item label="其他原因">
|
||||
<uni-easyinput placeholder="请填写其他原因" />
|
||||
|
|
@ -142,9 +215,15 @@
|
|||
|
||||
<script setup>
|
||||
import { computed, ref } from 'vue'
|
||||
import { partTypeTreeList,getSupplierList,saveRepairRow } from '@/services/repair/repair.js'
|
||||
const query = defineProps() // 获取上级页面传递的路由参数
|
||||
const queryParams = JSON.parse(query.queryParams)
|
||||
import { partTypeTreeList, getSupplierList, saveRepairRow } from '@/services/repair/repair.js'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
// const query = defineProps() // 获取上级页面传递的路由参数
|
||||
// const queryParams = JSON.parse(query.queryParams)
|
||||
const queryParams = ref({})
|
||||
|
||||
onLoad((options) => {
|
||||
queryParams.value = JSON.parse(options.queryParams)
|
||||
})
|
||||
const repairPerson = ref([
|
||||
{ value: '1', text: '张麻子' },
|
||||
{ value: '2', text: '张牧之' },
|
||||
|
|
@ -156,268 +235,274 @@ const damageReasonList = ref([
|
|||
{ value: 0, text: '自然损坏' },
|
||||
{ value: 1, text: '人为损坏' },
|
||||
])
|
||||
|
||||
|
||||
const isChargeList = ref([
|
||||
{ value: 1, text: '是' },
|
||||
{ value: 2, text: '否' },
|
||||
])
|
||||
//内部维修
|
||||
const partItems = ref([{ partType: "", partNum: "", isCharge: "",partId: "7" }])
|
||||
const partItems = ref([{ partType: '', partNum: '', isCharge: '', partId: '7' }])
|
||||
const addPart = () => {
|
||||
partItems.value.push({ partType: "", partNum: "", isCharge: "", partId: "7" });
|
||||
partItems.value.push({ partType: '', partNum: '', isCharge: '', partId: '7' })
|
||||
}
|
||||
const delPart = (index) => {
|
||||
if (partItems.value.length > 1) {
|
||||
partItems.value.splice(index, 1);
|
||||
partItems.value.splice(index, 1)
|
||||
}
|
||||
}
|
||||
const partIds = ref([])
|
||||
const partIds = ref([])
|
||||
const formLeft = ref({
|
||||
repairNum:0
|
||||
repairNum: 0,
|
||||
})
|
||||
const partTreeData = ref([])
|
||||
const getPartTreeData = async() => {
|
||||
const getPartTreeData = async () => {
|
||||
const res = await partTypeTreeList({})
|
||||
partTreeData.value = res.data;
|
||||
|
||||
partTreeData.value = res.data
|
||||
|
||||
console.log(res)
|
||||
}
|
||||
getPartTreeData()
|
||||
|
||||
|
||||
//返厂维修
|
||||
//返厂维修
|
||||
const partsMillList = ref([])
|
||||
const getSupplierListData = async() => {
|
||||
const getSupplierListData = async () => {
|
||||
const res = await getSupplierList({})
|
||||
partsMillList.value = res.rows.map(item=>{
|
||||
let obj = {
|
||||
value:item.supplierId,
|
||||
text:item.supplier
|
||||
partsMillList.value = res.rows.map((item) => {
|
||||
let obj = {
|
||||
value: item.supplierId,
|
||||
text: item.supplier,
|
||||
}
|
||||
return obj
|
||||
});
|
||||
})
|
||||
}
|
||||
getSupplierListData()
|
||||
const partItemsMiddle = ref([{ partName: "", partNum: "", partPrice: "0", isCharge: "" },])
|
||||
const partItemsMiddle = ref([{ partName: '', partNum: '', partPrice: '0', isCharge: '' }])
|
||||
const addMidPart = () => {
|
||||
partItemsMiddle.value.push({ partName: "", partNum: "", partPrice: "0", isCharge: "" });
|
||||
partItemsMiddle.value.push({ partName: '', partNum: '', partPrice: '0', isCharge: '' })
|
||||
}
|
||||
const delMidPart = (index) => {
|
||||
if (partItemsMiddle.value.length > 1) {
|
||||
partItemsMiddle.value.splice(index, 1);
|
||||
partItemsMiddle.value.splice(index, 1)
|
||||
}
|
||||
}
|
||||
const formMiddle = ref({
|
||||
supplierId:undefined,
|
||||
repairNum:0
|
||||
supplierId: undefined,
|
||||
repairNum: 0,
|
||||
})
|
||||
|
||||
|
||||
//待报废
|
||||
const formRight = ref({
|
||||
scrapNum:0,
|
||||
scrapType:undefined,
|
||||
scrapReason:undefined,
|
||||
scrapNum: 0,
|
||||
scrapType: undefined,
|
||||
scrapReason: undefined,
|
||||
})
|
||||
const rowData = ref(queryParams)
|
||||
//数量管理保存
|
||||
const saveNumAll = async() => {
|
||||
const saveNumAll = async () => {
|
||||
console.log(rowData)
|
||||
if(formRight.value.scrapNum!=0){
|
||||
if (formRight.value.scrapNum != 0) {
|
||||
// this.$refs["formLeft","formMiddle","formRight"].validate(async(valid)=>{
|
||||
// if(valid){
|
||||
for (let i = 0; i < partItems.value.length; i++) {
|
||||
rowData.value.repairDeviceList[0].numberInRepairPartList.push({
|
||||
isCharge: partItems.value[i].isCharge,
|
||||
partId: partItems.value[i].partId,
|
||||
partNum: partItems.value[i].partNum,
|
||||
repairNum: formLeft.value.repairNum,
|
||||
});
|
||||
}
|
||||
for (let i = 0; i < partItemsMiddle.value.length; i++) {
|
||||
rowData.value.repairDeviceList[0].numberOutRepairPartList.push({
|
||||
isCharge: partItemsMiddle.value[i].isCharge,
|
||||
partPrice: partItemsMiddle.value[i].partPrice,
|
||||
partNum: partItemsMiddle.value[i].partNum,
|
||||
partName: partItemsMiddle.value[i].partName,
|
||||
supplierId: formMiddle.value.supplierId,
|
||||
repairNum: formMiddle.value.repairNum,
|
||||
});
|
||||
}
|
||||
// this.uploadKey = Date.now();
|
||||
// if(this.fileList.length!=0){
|
||||
// await this.getImaUpload(),
|
||||
formRight.value.fileList = [];
|
||||
// }else{
|
||||
// formRight.value.fileList = this.fileListTemp;
|
||||
// }
|
||||
// console.log('formRight.value',formRight.value)
|
||||
rowData.value.repairDeviceList[0].numberScrapRepairPartList.push(formRight.value)
|
||||
rowData.value.repairDeviceList[0].repairType = 1;
|
||||
saveRepairRow(rowData.value.repairDeviceList).then(async (response) => {
|
||||
if (response.code == 200) {
|
||||
uni.showToast({ title: '保存成功', icon: 'none' })
|
||||
uni.navigateBack({
|
||||
delta: 1 // 返回到已存在的页面
|
||||
});
|
||||
// this.$modal.msgSuccess("保存成功");
|
||||
// this.fileList=[];
|
||||
// this.fileListTemp=[];
|
||||
// this.taskIdTemp = rowData.value.taskId;
|
||||
// let param = {
|
||||
// taskId: rowData.value.taskId,
|
||||
// keyword: "",
|
||||
// };
|
||||
// const res = await getAppRepairMaTypeList(param);
|
||||
// this.equipmentList = res.data;
|
||||
// this.equipmentList.forEach((e) => {
|
||||
// e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum);
|
||||
// });
|
||||
}
|
||||
});
|
||||
for (let i = 0; i < partItems.value.length; i++) {
|
||||
rowData.value.repairDeviceList[0].numberInRepairPartList.push({
|
||||
isCharge: partItems.value[i].isCharge,
|
||||
partId: partItems.value[i].partId,
|
||||
partNum: partItems.value[i].partNum,
|
||||
repairNum: formLeft.value.repairNum,
|
||||
})
|
||||
}
|
||||
for (let i = 0; i < partItemsMiddle.value.length; i++) {
|
||||
rowData.value.repairDeviceList[0].numberOutRepairPartList.push({
|
||||
isCharge: partItemsMiddle.value[i].isCharge,
|
||||
partPrice: partItemsMiddle.value[i].partPrice,
|
||||
partNum: partItemsMiddle.value[i].partNum,
|
||||
partName: partItemsMiddle.value[i].partName,
|
||||
supplierId: formMiddle.value.supplierId,
|
||||
repairNum: formMiddle.value.repairNum,
|
||||
})
|
||||
}
|
||||
// this.uploadKey = Date.now();
|
||||
// if(this.fileList.length!=0){
|
||||
// await this.getImaUpload(),
|
||||
formRight.value.fileList = []
|
||||
// }else{
|
||||
// formRight.value.fileList = this.fileListTemp;
|
||||
// }
|
||||
// console.log('formRight.value',formRight.value)
|
||||
rowData.value.repairDeviceList[0].numberScrapRepairPartList.push(formRight.value)
|
||||
rowData.value.repairDeviceList[0].repairType = 1
|
||||
saveRepairRow(rowData.value.repairDeviceList).then(async (response) => {
|
||||
if (response.code == 200) {
|
||||
uni.showToast({ title: '保存成功', icon: 'none' })
|
||||
uni.navigateBack({
|
||||
delta: 1, // 返回到已存在的页面
|
||||
})
|
||||
// this.$modal.msgSuccess("保存成功");
|
||||
// this.fileList=[];
|
||||
// this.fileListTemp=[];
|
||||
// this.taskIdTemp = rowData.value.taskId;
|
||||
// let param = {
|
||||
// taskId: rowData.value.taskId,
|
||||
// keyword: "",
|
||||
// };
|
||||
// const res = await getAppRepairMaTypeList(param);
|
||||
// this.equipmentList = res.data;
|
||||
// this.equipmentList.forEach((e) => {
|
||||
// e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum);
|
||||
// });
|
||||
}
|
||||
})
|
||||
// }
|
||||
// })
|
||||
}else{
|
||||
} else {
|
||||
// this.$refs["formLeft","formMiddle"].validate(async(valid)=>{
|
||||
// if(valid){
|
||||
for (let i = 0; i < partItems.value.length; i++) {
|
||||
rowData.value.repairDeviceList[0].numberInRepairPartList.push({
|
||||
isCharge: partItems.value[i].isCharge,
|
||||
partId: partItems.value[i].partId,
|
||||
partNum: partItems.value[i].partNum,
|
||||
repairNum: formLeft.value.repairNum,
|
||||
});
|
||||
}
|
||||
for (let i = 0; i < partItemsMiddle.value.length; i++) {
|
||||
rowData.value.repairDeviceList[0].numberOutRepairPartList.push({
|
||||
isCharge: partItemsMiddle.value[i].isCharge,
|
||||
partPrice: partItemsMiddle.value[i].partPrice,
|
||||
partNum: partItemsMiddle.value[i].partNum,
|
||||
partName: partItemsMiddle.value[i].partName,
|
||||
supplierId: formMiddle.value.supplierId,
|
||||
repairNum: formMiddle.value.repairNum,
|
||||
});
|
||||
}
|
||||
// this.uploadKey = Date.now();
|
||||
// if(this.fileList.length!=0){
|
||||
// await this.getImaUpload(),
|
||||
formRight.value.fileList = [];
|
||||
// }else{
|
||||
// formRight.value.fileList = this.fileListTemp;
|
||||
// }
|
||||
console.log('formRight.value',formRight.value)
|
||||
rowData.value.repairDeviceList[0].numberScrapRepairPartList.push(formRight.value)
|
||||
rowData.value.repairDeviceList[0].repairType = 1;
|
||||
saveRepairRow(rowData.value.repairDeviceList).then(async (response) => {
|
||||
if (response.code == 200) {
|
||||
uni.showToast({ title: '保存成功', icon: 'none' })
|
||||
uni.navigateBack({
|
||||
delta: 1 // 返回到已存在的页面
|
||||
});
|
||||
// this.$modal.msgSuccess("保存成功");
|
||||
// this.fileList=[];
|
||||
// this.fileListTemp=[];
|
||||
// let param = {
|
||||
// taskId: rowData.value.taskId,
|
||||
// keyword: "",
|
||||
// };
|
||||
// this.taskIdTemp = rowData.value.taskId;
|
||||
// const res = await getAppRepairMaTypeList(param);
|
||||
// this.equipmentList = res.data;
|
||||
// this.equipmentList.forEach((e) => {
|
||||
// e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum);
|
||||
// });
|
||||
// this.openNum=false;
|
||||
}
|
||||
});
|
||||
for (let i = 0; i < partItems.value.length; i++) {
|
||||
rowData.value.repairDeviceList[0].numberInRepairPartList.push({
|
||||
isCharge: partItems.value[i].isCharge,
|
||||
partId: partItems.value[i].partId,
|
||||
partNum: partItems.value[i].partNum,
|
||||
repairNum: formLeft.value.repairNum,
|
||||
})
|
||||
}
|
||||
for (let i = 0; i < partItemsMiddle.value.length; i++) {
|
||||
rowData.value.repairDeviceList[0].numberOutRepairPartList.push({
|
||||
isCharge: partItemsMiddle.value[i].isCharge,
|
||||
partPrice: partItemsMiddle.value[i].partPrice,
|
||||
partNum: partItemsMiddle.value[i].partNum,
|
||||
partName: partItemsMiddle.value[i].partName,
|
||||
supplierId: formMiddle.value.supplierId,
|
||||
repairNum: formMiddle.value.repairNum,
|
||||
})
|
||||
}
|
||||
// this.uploadKey = Date.now();
|
||||
// if(this.fileList.length!=0){
|
||||
// await this.getImaUpload(),
|
||||
formRight.value.fileList = []
|
||||
// }else{
|
||||
// formRight.value.fileList = this.fileListTemp;
|
||||
// }
|
||||
console.log('formRight.value', formRight.value)
|
||||
rowData.value.repairDeviceList[0].numberScrapRepairPartList.push(formRight.value)
|
||||
rowData.value.repairDeviceList[0].repairType = 1
|
||||
saveRepairRow(rowData.value.repairDeviceList).then(async (response) => {
|
||||
if (response.code == 200) {
|
||||
uni.showToast({ title: '保存成功', icon: 'none' })
|
||||
uni.navigateBack({
|
||||
delta: 1, // 返回到已存在的页面
|
||||
})
|
||||
// this.$modal.msgSuccess("保存成功");
|
||||
// this.fileList=[];
|
||||
// this.fileListTemp=[];
|
||||
// let param = {
|
||||
// taskId: rowData.value.taskId,
|
||||
// keyword: "",
|
||||
// };
|
||||
// this.taskIdTemp = rowData.value.taskId;
|
||||
// const res = await getAppRepairMaTypeList(param);
|
||||
// this.equipmentList = res.data;
|
||||
// this.equipmentList.forEach((e) => {
|
||||
// e.disrepairNum = Number(e.typeRepairNum) - Number(e.typeRepairedNum);
|
||||
// });
|
||||
// this.openNum=false;
|
||||
}
|
||||
})
|
||||
// }
|
||||
// })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 数量框change事件
|
||||
const repairCheckNum1 = (e) => {
|
||||
setTimeout(()=>{
|
||||
let maxNum = queryParams.typeRepairNum - queryParams.typeRepairedNum;
|
||||
setTimeout(() => {
|
||||
let maxNum = queryParams.value.typeRepairNum - queryParams.value.typeRepairedNum
|
||||
console.log(maxNum)
|
||||
if(queryParams.unitValue==1){
|
||||
formLeft.value.repairNum = Number(e.replace(/[^\d.]/g,''))
|
||||
}else{
|
||||
formLeft.value.repairNum = Number(e.replace(/[^\d]/g,''))
|
||||
}
|
||||
if (Number(e)<= 0) {
|
||||
formLeft.value.repairNum = 0;
|
||||
if (queryParams.value.unitValue == 1) {
|
||||
formLeft.value.repairNum = Number(e.replace(/[^\d.]/g, ''))
|
||||
} else {
|
||||
formLeft.value.repairNum = Number(e.replace(/[^\d]/g, ''))
|
||||
}
|
||||
if ((formLeft.value.repairNum+formMiddle.value.repairNum+formRight.value.scrapNum) > maxNum) {
|
||||
if (Number(e) <= 0) {
|
||||
formLeft.value.repairNum = 0
|
||||
}
|
||||
if (
|
||||
formLeft.value.repairNum + formMiddle.value.repairNum + formRight.value.scrapNum >
|
||||
maxNum
|
||||
) {
|
||||
uni.showToast({
|
||||
title: '已达到当前物资最大维修数量!',
|
||||
icon: 'none',
|
||||
})
|
||||
formLeft.value.repairNum = 0;
|
||||
formLeft.value.repairNum = 0
|
||||
}
|
||||
},500)
|
||||
}, 500)
|
||||
}
|
||||
// 数量框change事件
|
||||
const repairCheckNum2 = (e) => {
|
||||
setTimeout(()=>{
|
||||
let maxNum = queryParams.typeRepairNum - queryParams.typeRepairedNum;
|
||||
const repairCheckNum2 = (e) => {
|
||||
setTimeout(() => {
|
||||
let maxNum = queryParams.value.typeRepairNum - queryParams.value.typeRepairedNum
|
||||
console.log(maxNum)
|
||||
if(queryParams.unitValue==1){
|
||||
formMiddle.value.repairNum = Number(e.replace(/[^\d.]/g,''))
|
||||
}else{
|
||||
formMiddle.value.repairNum = Number(e.replace(/[^\d]/g,''))
|
||||
}
|
||||
if (Number(e)<= 0) {
|
||||
formMiddle.value.repairNum = 0;
|
||||
if (queryParams.value.value.unitValue == 1) {
|
||||
formMiddle.value.repairNum = Number(e.replace(/[^\d.]/g, ''))
|
||||
} else {
|
||||
formMiddle.value.repairNum = Number(e.replace(/[^\d]/g, ''))
|
||||
}
|
||||
if ((formLeft.value.repairNum+formMiddle.value.scrapNum+formRight.value.scrapNum) > maxNum) {
|
||||
if (Number(e) <= 0) {
|
||||
formMiddle.value.repairNum = 0
|
||||
}
|
||||
if (
|
||||
formLeft.value.repairNum + formMiddle.value.scrapNum + formRight.value.scrapNum >
|
||||
maxNum
|
||||
) {
|
||||
uni.showToast({
|
||||
title: '已达到当前物资最大维修数量!',
|
||||
icon: 'none',
|
||||
})
|
||||
formMiddle.value.repairNum = 0;
|
||||
formMiddle.value.repairNum = 0
|
||||
}
|
||||
},500)
|
||||
}, 500)
|
||||
}
|
||||
// 数量框change事件
|
||||
const repairCheckNum3 = (e) => {
|
||||
setTimeout(()=>{
|
||||
let maxNum = queryParams.typeRepairNum - queryParams.typeRepairedNum;
|
||||
const repairCheckNum3 = (e) => {
|
||||
setTimeout(() => {
|
||||
let maxNum = queryParams.value.typeRepairNum - queryParams.value.typeRepairedNum
|
||||
console.log(maxNum)
|
||||
if(queryParams.unitValue==1){
|
||||
formRight.value.scrapNum = Number(e.replace(/[^\d.]/g,''))
|
||||
}else{
|
||||
formRight.value.scrapNum = Number(e.replace(/[^\d]/g,''))
|
||||
}
|
||||
if (Number(e)<= 0) {
|
||||
formRight.value.scrapNum = 0;
|
||||
if (queryParams.value.unitValue == 1) {
|
||||
formRight.value.scrapNum = Number(e.replace(/[^\d.]/g, ''))
|
||||
} else {
|
||||
formRight.value.scrapNum = Number(e.replace(/[^\d]/g, ''))
|
||||
}
|
||||
if ((formLeft.value.repairNum+formMiddle.value.scrapNum+formRight.value.scrapNum) > maxNum) {
|
||||
if (Number(e) <= 0) {
|
||||
formRight.value.scrapNum = 0
|
||||
}
|
||||
if (
|
||||
formLeft.value.repairNum + formMiddle.value.scrapNum + formRight.value.scrapNum >
|
||||
maxNum
|
||||
) {
|
||||
uni.showToast({
|
||||
title: '已达到当前物资最大维修数量!',
|
||||
icon: 'none',
|
||||
})
|
||||
formRight.value.scrapNum = 0;
|
||||
formRight.value.scrapNum = 0
|
||||
}
|
||||
},500)
|
||||
}, 500)
|
||||
}
|
||||
// 配件框change事件
|
||||
const partCheckNum = (item) => {
|
||||
// 配件框change事件
|
||||
const partCheckNum = (item) => {
|
||||
// console.log(item)
|
||||
// console.log(item.partNum)
|
||||
setTimeout(()=>{
|
||||
item.partNum = Number(String(item.partNum).replace(/[^\d.]/g,''))
|
||||
},500)
|
||||
setTimeout(() => {
|
||||
item.partNum = Number(String(item.partNum).replace(/[^\d.]/g, ''))
|
||||
}, 500)
|
||||
}
|
||||
// 金额框change事件
|
||||
const costCheckNum = (item) => {
|
||||
// 金额框change事件
|
||||
const costCheckNum = (item) => {
|
||||
// console.log(item)
|
||||
// console.log(item.partPrice)
|
||||
setTimeout(()=>{
|
||||
item.partPrice = Number(String(item.partPrice).replace(/[^\d.]/g,''))
|
||||
},500)
|
||||
setTimeout(() => {
|
||||
item.partPrice = Number(String(item.partPrice).replace(/[^\d.]/g, ''))
|
||||
}, 500)
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
|||
|
|
@ -11,10 +11,14 @@
|
|||
<view class="search">查询</view>
|
||||
</uni-col>
|
||||
<uni-col :span="4">
|
||||
<view class="search" style="background-color: #19be6b" @tap="handleAllPass">通过</view>
|
||||
<view class="search" style="background-color: #19be6b" @tap="handleAllPass"
|
||||
>通过</view
|
||||
>
|
||||
</uni-col>
|
||||
<uni-col :span="4">
|
||||
<view class="search" style="background-color: #ff4949" @tap="handleAllFail">驳回</view>
|
||||
<view class="search" style="background-color: #ff4949" @tap="handleAllFail"
|
||||
>驳回</view
|
||||
>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
|
||||
|
|
@ -40,7 +44,7 @@
|
|||
:key="index"
|
||||
class="table-list-item"
|
||||
@tap="onRepairItem(item)"
|
||||
>
|
||||
>
|
||||
<div class="title">
|
||||
<span style="font-size: 15px; font-weight: 800">修试审核</span>
|
||||
<!-- <span :style="{ color: active == 1 ? '#3784fb' : '#ff4d4f' }">{{active == 1 ? '已完成' : '未完成'}}</span> -->
|
||||
|
|
@ -86,7 +90,7 @@
|
|||
<view class="cont">{{ item.repairedNum }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
|
||||
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
|
||||
<uni-col :span="6">管理模式:</uni-col>
|
||||
|
|
@ -111,15 +115,16 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onUnmounted, computed } from 'vue'
|
||||
import { getAuditInfo,innerAudit } from '@/services/repair/testExamine.js'
|
||||
import { onLoad,onShow } from '@dcloudio/uni-app'
|
||||
import { ref, onUnmounted, computed } from 'vue'
|
||||
import { getAuditInfo, innerAudit } from '@/services/repair/testExamine.js'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
const detailsList = ref([])
|
||||
const query = defineProps() // 获取上级页面传递的路由参数
|
||||
// const query = defineProps() // 获取上级页面传递的路由参数
|
||||
const taskId = ref('')
|
||||
|
||||
// 获取列表详情
|
||||
const getDetailsData = async () => {
|
||||
const res = await getAuditInfo({ taskId: query.taskId })
|
||||
const res = await getAuditInfo({ taskId: taskId.value })
|
||||
detailsList.value = res.rows
|
||||
detailsList.value = detailsList.value.map((e) => {
|
||||
return { ...e, isChecked: false }
|
||||
|
|
@ -155,18 +160,28 @@ const handleAllPass = async () => {
|
|||
icon: 'none',
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
// 组装参数
|
||||
const ids = []
|
||||
detailsList.value.forEach((item) => {
|
||||
if (item.isChecked) {
|
||||
console.log(item)
|
||||
let obj = { id: item.id, status: "1",specificationType: item.specificationType,machineTypeName:item.machineTypeName,
|
||||
repairNum:item.repairNum,repairedNum:item.repairedNum,typeId:item.typeId,taskId:item.taskId,
|
||||
auditId:item.id,repairId:item.repairId,maId:item.maId}
|
||||
ids.push(obj)
|
||||
let obj = {
|
||||
id: item.id,
|
||||
status: '1',
|
||||
specificationType: item.specificationType,
|
||||
machineTypeName: item.machineTypeName,
|
||||
repairNum: item.repairNum,
|
||||
repairedNum: item.repairedNum,
|
||||
typeId: item.typeId,
|
||||
taskId: item.taskId,
|
||||
auditId: item.id,
|
||||
repairId: item.repairId,
|
||||
maId: item.maId,
|
||||
}
|
||||
ids.push(obj)
|
||||
}
|
||||
})
|
||||
})
|
||||
console.log(ids)
|
||||
const res = await innerAudit(ids)
|
||||
if (res.code === 200) {
|
||||
|
|
@ -187,16 +202,26 @@ const handleAllFail = async () => {
|
|||
icon: 'none',
|
||||
})
|
||||
return
|
||||
}
|
||||
// 组装参数
|
||||
}
|
||||
// 组装参数
|
||||
const ids = []
|
||||
detailsList.value.forEach((item) => {
|
||||
if (item.isChecked) {
|
||||
console.log(item)
|
||||
let obj = { id: item.id, status: "2",specificationType: item.specificationType,machineTypeName:item.machineTypeName,
|
||||
repairNum:item.repairNum,repairedNum:item.repairedNum,typeId:item.typeId,taskId:item.taskId,
|
||||
auditId:item.id,repairId:item.repairId,maId:item.maId}
|
||||
ids.push(obj)
|
||||
let obj = {
|
||||
id: item.id,
|
||||
status: '2',
|
||||
specificationType: item.specificationType,
|
||||
machineTypeName: item.machineTypeName,
|
||||
repairNum: item.repairNum,
|
||||
repairedNum: item.repairedNum,
|
||||
typeId: item.typeId,
|
||||
taskId: item.taskId,
|
||||
auditId: item.id,
|
||||
repairId: item.repairId,
|
||||
maId: item.maId,
|
||||
}
|
||||
ids.push(obj)
|
||||
}
|
||||
})
|
||||
console.log(ids)
|
||||
|
|
@ -212,7 +237,7 @@ const handleAllFail = async () => {
|
|||
|
||||
// 点击跳转维修页面
|
||||
const onRepairItem = (item) => {
|
||||
console.log(item)
|
||||
console.log(item)
|
||||
// let queryParams = null
|
||||
// let codingUrl = ''
|
||||
// if (item.manageType === 0) {
|
||||
|
|
@ -225,18 +250,19 @@ const onRepairItem = (item) => {
|
|||
// uni.navigateTo({ url: `${codingUrl}?queryParams=${JSON.stringify(queryParams)}` })
|
||||
}
|
||||
onShow(() => {
|
||||
getDetailsData()
|
||||
getDetailsData()
|
||||
})
|
||||
// 页面加载完毕
|
||||
onLoad(() => {
|
||||
getDetailsData()
|
||||
onLoad((options) => {
|
||||
taskId.value = options.taskId
|
||||
getDetailsData()
|
||||
// 监听出库完成事件 刷新列表
|
||||
uni.$on('onUpdate', () => {
|
||||
// console.log('监听事件')
|
||||
// 刷新列表
|
||||
getDetailsData()
|
||||
})
|
||||
})
|
||||
})
|
||||
// 页面销毁时移除事件监听
|
||||
onUnmounted(() => {
|
||||
uni.$off('onUpdate') // 移除事件监听
|
||||
|
|
|
|||
|
|
@ -11,10 +11,12 @@
|
|||
<view class="search">查询</view>
|
||||
</uni-col>
|
||||
<uni-col :span="4">
|
||||
<view class="search" style="background-color: #19be6b" @tap="onQualified">通过</view>
|
||||
<view class="search" style="background-color: #19be6b" @tap="onQualified"
|
||||
>通过</view
|
||||
>
|
||||
</uni-col>
|
||||
<uni-col :span="4">
|
||||
<view class="search" style="background-color: #ff4949" >驳回</view>
|
||||
<view class="search" style="background-color: #ff4949">驳回</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
|
||||
|
|
@ -40,7 +42,7 @@
|
|||
:key="index"
|
||||
class="table-list-item"
|
||||
@tap="onRepairItem(item)"
|
||||
>
|
||||
>
|
||||
<div class="title">
|
||||
<span style="font-size: 15px; font-weight: 800">修试入库</span>
|
||||
<!-- <span :style="{ color: active == 1 ? '#3784fb' : '#ff4d4f' }">{{active == 1 ? '已完成' : '未完成'}}</span> -->
|
||||
|
|
@ -117,15 +119,16 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onUnmounted, computed } from 'vue'
|
||||
import { ref, onUnmounted, computed } from 'vue'
|
||||
import { getRepairedDetailList } from '@/services/repair/testedInBound.js'
|
||||
import { onLoad,onShow } from '@dcloudio/uni-app'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
const detailsList = ref([])
|
||||
const query = defineProps() // 获取上级页面传递的路由参数
|
||||
// const query = defineProps() // 获取上级页面传递的路由参数
|
||||
const taskId = ref('')
|
||||
|
||||
// 获取列表详情
|
||||
const getDetailsData = async () => {
|
||||
const res = await getRepairedDetailList(query.taskId)
|
||||
const res = await getRepairedDetailList(taskId.value)
|
||||
detailsList.value = res.rows
|
||||
detailsList.value = detailsList.value.map((e) => {
|
||||
return { ...e, isChecked: false }
|
||||
|
|
@ -185,7 +188,7 @@ const onQualified = async () => {
|
|||
|
||||
// 点击跳转维修页面
|
||||
const onRepairItem = (item) => {
|
||||
console.log(item)
|
||||
console.log(item)
|
||||
// let queryParams = null
|
||||
// let codingUrl = ''
|
||||
// if (item.manageType === 0) {
|
||||
|
|
@ -198,18 +201,19 @@ const onRepairItem = (item) => {
|
|||
// uni.navigateTo({ url: `${codingUrl}?queryParams=${JSON.stringify(queryParams)}` })
|
||||
}
|
||||
onShow(() => {
|
||||
getDetailsData()
|
||||
getDetailsData()
|
||||
})
|
||||
// 页面加载完毕
|
||||
onLoad(() => {
|
||||
getDetailsData()
|
||||
onLoad((options) => {
|
||||
taskId.value = options.taskId
|
||||
getDetailsData()
|
||||
// 监听出库完成事件 刷新列表
|
||||
uni.$on('onUpdate', () => {
|
||||
// console.log('监听事件')
|
||||
// 刷新列表
|
||||
getDetailsData()
|
||||
})
|
||||
})
|
||||
})
|
||||
// 页面销毁时移除事件监听
|
||||
onUnmounted(() => {
|
||||
uni.$off('onUpdate') // 移除事件监听
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { useMemberStore } from '@/stores'
|
|||
* baseURL 设置请求ip地址和端口
|
||||
*/
|
||||
const ENV = process.env.NODE_ENV
|
||||
export const baseURL = ENV === 'development' ? 'http://192.168.2.246:18080' : '***'
|
||||
export const baseURL = ENV === 'development' ? 'http://192.168.0.244:18580' : '***'
|
||||
// export const baseURL = ENV === 'development' ? '/api' : '***'
|
||||
/**
|
||||
* httpInterceptor 分别拦截 request 和 uploadFile 请求
|
||||
|
|
|
|||
Loading…
Reference in New Issue