This commit is contained in:
parent
3994c9acb9
commit
abf68c1570
|
|
@ -23,7 +23,7 @@
|
|||
></eselect>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="采购申请编号" name="applyCode" required>
|
||||
<uni-easyinput v-model="formData.applyCode" maxlength="10" placeholder="请输入领料人" />
|
||||
<uni-easyinput v-model="formData.applyCode" maxlength="10" placeholder="请输入采购申请编号" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="领料人" name="leasePerson" required>
|
||||
<uni-easyinput v-model="formData.leasePerson" maxlength="10" placeholder="请输入领料人" />
|
||||
|
|
@ -137,7 +137,7 @@
|
|||
import { ref, reactive } from 'vue'
|
||||
import eselect from '@/components/tree-select/eselect.vue'
|
||||
import { onLoad,onReady } from '@dcloudio/uni-app'
|
||||
import { getUnitList,getProjectList,getConfigList,getLevelThreeType,insertApp,getAgreementInfoById,getListsByConfigId,getTypeDataList,leaseTask } from '../../services/back.js';
|
||||
import { getUnitList,getProjectList,getConfigList,getLevelThreeType,insertApp,getAgreementInfoById,getListsByConfigId,getTypeDataList,leaseTask,getLeaseCode } from '../../services/back.js';
|
||||
const taskInfo = ref({})
|
||||
const treeSelect = ref(null)
|
||||
const treeSelect2 = ref(null)
|
||||
|
|
@ -149,7 +149,7 @@ const formData = ref({
|
|||
phone: '',
|
||||
configId: '',
|
||||
applyCode: '',
|
||||
|
||||
code:''
|
||||
}
|
||||
})
|
||||
|
||||
|
|
@ -388,6 +388,23 @@ const getMaCode = () => {
|
|||
console.log(error)
|
||||
})
|
||||
}
|
||||
const getCode = () => {
|
||||
let obj = {
|
||||
"typeId":''
|
||||
}
|
||||
getLeaseCode(obj).then(res => {
|
||||
console.log('xxxxxxxxxxxx',res)
|
||||
if(res.code == 200){
|
||||
formData.value.code = res.data.taskCode
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//选择规格型号
|
||||
const selectMaCode = (e) => {
|
||||
console.log(e)
|
||||
|
|
@ -466,6 +483,7 @@ const submitNum = async() => {
|
|||
"agreementId":agreementId.value,
|
||||
"leasePerson":formData.value.leasePerson,
|
||||
"phone":formData.value.phone,
|
||||
"code": formData.value.code,
|
||||
"standardConfigId":configId.value,
|
||||
"applyCode":formData.value.applyCode,
|
||||
"bmFileInfos": bmFileInfos.value,
|
||||
|
|
@ -512,6 +530,7 @@ onLoad((options) => {
|
|||
getProject()
|
||||
getConfig()
|
||||
getMaType()
|
||||
getCode()
|
||||
// formData.value = JSON.parse(options.item)
|
||||
})
|
||||
//上传
|
||||
|
|
|
|||
|
|
@ -384,15 +384,17 @@ const calculateCostAll = () => {
|
|||
//维修完成校验
|
||||
const saveCode = () => {
|
||||
if (repairType.value == 1) {
|
||||
let index1 = partItems.value.findIndex((v) => v.partId == '')
|
||||
let index2 = partItems.value.findIndex((v) => v.partNum == 0)
|
||||
// let index1 = partItems.value.findIndex((v) => v.partId == '')
|
||||
// let index2 = partItems.value.findIndex((v) => v.partNum == 0)
|
||||
if (repairPerson.value == '') {
|
||||
uni.showToast({ title: '请先选择维修人员!', icon: 'none' })
|
||||
} else if (index1 > -1) {
|
||||
uni.showToast({ title: '请先选择配件类型!', icon: 'none' })
|
||||
} else if (index2 > -1) {
|
||||
uni.showToast({ title: '请填写配件数量!', icon: 'none' })
|
||||
} else {
|
||||
}
|
||||
// else if (index1 > -1) {
|
||||
// uni.showToast({ title: '请先选择配件类型!', icon: 'none' })
|
||||
// } else if (index2 > -1) {
|
||||
// uni.showToast({ title: '请填写配件数量!', icon: 'none' })
|
||||
// }
|
||||
else {
|
||||
saveCodeApi()
|
||||
}
|
||||
}
|
||||
|
|
@ -400,7 +402,8 @@ const saveCode = () => {
|
|||
//维修完成请求
|
||||
const saveCodeApi = async () => {
|
||||
//请求接口
|
||||
rowData.value = queryParams.value
|
||||
rowData.value.repairDeviceList = queryParams.value.selectedDevices
|
||||
console.log("llllllllllllllll",queryParams.value)
|
||||
// 遍历所有设备列表项,为每一项设置相同的值
|
||||
for (let i = 0; i < rowData.value.repairDeviceList.length; i++) {
|
||||
// 设置维修人员信息
|
||||
|
|
@ -432,7 +435,7 @@ const saveCodeApi = async () => {
|
|||
saveLossAssessmentRow(rowData.value.repairDeviceList).then(async (response) => {
|
||||
console.log("uuuuuuuuuuu",response)
|
||||
if (response.code == 200) {
|
||||
uni.showToast({ title: '保存成功', icon: 'none' })
|
||||
uni.showToast({ title: '定损成功', icon: 'none' })
|
||||
uni.navigateBack({
|
||||
delta: 2, // 返回到已存在的页面
|
||||
})
|
||||
|
|
|
|||
|
|
@ -31,10 +31,18 @@
|
|||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">待修数量:</uni-col>
|
||||
<uni-col :span="6">退料数量:</uni-col>
|
||||
<uni-col :span="18">
|
||||
<view class="cont">{{
|
||||
queryParams.typeRepairNum - queryParams.typeRepairedNum
|
||||
queryParams.typeRepairNum
|
||||
}}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">定损数量:</uni-col>
|
||||
<uni-col :span="18">
|
||||
<view class="cont">{{
|
||||
queryParams.typeRepairedNum
|
||||
}}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@
|
|||
</label>
|
||||
</checkbox-group>
|
||||
</uni-col> -->
|
||||
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
|
||||
<uni-col :span="6">物资名称:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<view class="cont">{{ item.typeName }}</view>
|
||||
|
|
@ -73,24 +74,10 @@
|
|||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
|
||||
<uni-col :span="6">已修数量:</uni-col>
|
||||
<uni-col :span="6">定损数量:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<view class="cont">{{ item.typeRepairedNum }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24" v-if="item.typeScrapNum">
|
||||
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
|
||||
<uni-col :span="6">报废数量:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<view class="cont">{{ item.typeScrapNum }}</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>
|
||||
<uni-col :span="16">
|
||||
<view class="cont">{{ Number(item.typeRepairNum)-Number(item.typeRepairedNum)-Number(item.typeScrapNum) }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col>
|
||||
|
|
@ -117,6 +104,24 @@
|
|||
/>
|
||||
</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>
|
||||
<uni-col :span="16">
|
||||
<uni-tag
|
||||
text="已定损"
|
||||
type="success"
|
||||
v-if="item.status == 1"
|
||||
size="small"
|
||||
/>
|
||||
<uni-tag
|
||||
text="未定损"
|
||||
type="error"
|
||||
v-if="item.status == 0"
|
||||
size="small"
|
||||
/>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
|
@ -206,18 +211,25 @@ const onRepairItem = (item) => {
|
|||
console.log(item)
|
||||
let codingUrl = ''
|
||||
if (item.manageType === 0) {// 编码维修
|
||||
// if(item.status==0){
|
||||
codingUrl = '/pages/repair/equipAssessment/code-view'
|
||||
uni.navigateTo({ url: `${codingUrl}?queryParams=${JSON.stringify(item)}` })
|
||||
// }else{
|
||||
// uni.showToast({
|
||||
// title: '该规格已完成定损',
|
||||
// icon: 'none',
|
||||
// })
|
||||
// }
|
||||
}
|
||||
if (item.manageType == 1) {// 数量维修
|
||||
if(Number(item.typeRepairNum)-Number(item.typeRepairedNum)-Number(item.typeScrapNum)==0){
|
||||
uni.showToast({
|
||||
title: '已完成维修',
|
||||
icon: 'none',
|
||||
})
|
||||
}else{
|
||||
if(item.status==0){
|
||||
codingUrl = '/pages/repair/equipAssessment/num-operate'
|
||||
uni.navigateTo({ url: `${codingUrl}?queryParams=${JSON.stringify(item)}` })
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: '该规格已完成定损',
|
||||
icon: 'none',
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@
|
|||
<script setup>
|
||||
import { ref, computed } from 'vue'
|
||||
// import { getRepairListAPI, repairSubmitAPI, repairRejectAPI } from '@/services/repair/repair.js'
|
||||
import { getLossAssessmentListAPI,repairSubmitAPI,repairRejectAPI } from '@/services/repair/equipAssessment.js'
|
||||
import { getLossAssessmentListAPI,repairSubmitAPI,repairRejectAPI,updateRepairStatusAPI } from '@/services/repair/equipAssessment.js'
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
import { debounce } from 'lodash-es'
|
||||
|
||||
|
|
@ -240,12 +240,25 @@ const handleItem = (item) => {
|
|||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '是否确认进行定损?',
|
||||
success: (res) => {
|
||||
confirmText: '是',
|
||||
cancelText: '否',
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
// 用户点击确认,进行页面跳转
|
||||
uni.navigateTo({ url: `/pages/repair/equipAssessment/details?taskId=${item.taskId}` })
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消')
|
||||
//直接进行维修
|
||||
const res = await updateRepairStatusAPI({taskId: item.taskId})
|
||||
if(res.code==200){
|
||||
uni.showToast({
|
||||
title: '成功转至维修',
|
||||
icon: 'none',
|
||||
})
|
||||
setTimeout(() => {
|
||||
getTableList(true)
|
||||
}, 1000)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -22,10 +22,10 @@
|
|||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">数量:</uni-col>
|
||||
<uni-col :span="6">退料数量:</uni-col>
|
||||
<uni-col :span="18"
|
||||
><view class="cont">{{
|
||||
queryParams.typeRepairNum - queryParams.typeRepairedNum - queryParams.typeScrapNum
|
||||
queryParams.typeRepairNum
|
||||
}}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
|
|
@ -408,11 +408,12 @@ const saveNumAll = async () => {
|
|||
// else if(partItems.value.some(item => Number(item.repairNum) === 0)){
|
||||
// uni.showToast({ title: '存在定损数量为 0 的项,请检查!', icon: 'none' })
|
||||
// }
|
||||
else if(partItems.value.findIndex(v => v.partId == '')>-1){
|
||||
uni.showToast({ title: '请选择配件!', icon: 'none' })
|
||||
}else if(partItems.value.some(item => Number(item.partNum) === 0)){
|
||||
uni.showToast({ title: '存在配件数量为 0 的项,请检查!', icon: 'none' })
|
||||
}else {
|
||||
// else if(partItems.value.findIndex(v => v.partId == '')>-1){
|
||||
// uni.showToast({ title: '请选择配件!', icon: 'none' })
|
||||
// }else if(partItems.value.some(item => Number(item.partNum) === 0)){
|
||||
// uni.showToast({ title: '存在配件数量为 0 的项,请检查!', icon: 'none' })
|
||||
// }
|
||||
else {
|
||||
//维修人员
|
||||
rowData.value.repairDeviceList[0].repairList=[
|
||||
{
|
||||
|
|
@ -433,11 +434,14 @@ const saveNumAll = async () => {
|
|||
}
|
||||
console.log("yyyyyyyyyy",rowData.value)
|
||||
saveLossAssessmentRow(rowData.value.repairDeviceList).then(async (response) => {
|
||||
if (response.code == 200) {
|
||||
uni.showToast({ title: '保存成功', icon: 'none' })
|
||||
console.log("yxxxxxyyyy",response)
|
||||
if (response.code === 200) {
|
||||
uni.showToast({ title: '定损成功', icon: 'none' })
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({
|
||||
delta: 1, // 返回到已存在的页面
|
||||
})
|
||||
}, 1000)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<view class="page-container">
|
||||
<uni-row :gutter="24" class="search-form">
|
||||
<!-- <uni-row :gutter="24" class="search-form">
|
||||
<uni-col :span="12">
|
||||
<view>
|
||||
<uni-easyinput placeholder="请输入内容" />
|
||||
|
|
@ -8,11 +8,11 @@
|
|||
</uni-col>
|
||||
<uni-col :span="4">
|
||||
<view class="search">查询</view>
|
||||
</uni-col>
|
||||
</uni-col> -->
|
||||
<!-- <uni-col :span="4">
|
||||
<view class="search" style="background: #19be6b" @click="onQualified">合格</view>
|
||||
</uni-col> -->
|
||||
</uni-row>
|
||||
<!-- </uni-row> -->
|
||||
<view class="table-list-item">
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">物资名称:</uni-col>
|
||||
|
|
@ -26,27 +26,17 @@
|
|||
><view class="cont">{{ queryParams.type }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24">
|
||||
<!-- <uni-row :gutter="24">
|
||||
<uni-col :span="6">待修数量:</uni-col>
|
||||
<uni-col :span="18"
|
||||
><view class="cont">{{ Number(queryParams.typeRepairNum)-Number(queryParams.typeRepairedNum)-Number(queryParams.typeScrapNum)}}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</uni-row> -->
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">已修数量:</uni-col>
|
||||
<uni-col :span="6">定损数量:</uni-col>
|
||||
<uni-col :span="18"><view class="cont">{{queryParams.typeRepairedNum}}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<!-- <uni-row :gutter="24" v-if="queryParams.manageType==1">
|
||||
<uni-col :span="6">维修人:</uni-col>
|
||||
<uni-col :span="18"><view class="cont">111</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24" v-if="queryParams.manageType==1">
|
||||
<uni-col :span="6">维修时间:</uni-col>
|
||||
<uni-col :span="18"><view class="cont">222</view>
|
||||
</uni-col>
|
||||
</uni-row> -->
|
||||
</view>
|
||||
<scroll-view scroll-y @scrolltolower="onScrollTolower" style="padding-bottom: 90rpx">
|
||||
<view class="table-list-item" v-for="item in repairDeviceList" :key="item.maId">
|
||||
|
|
|
|||
|
|
@ -65,26 +65,11 @@
|
|||
</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>
|
||||
<uni-col :span="6">定损数量:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<view class="cont">{{ item.typeRepairedNum }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<uni-row :gutter="24" v-if="item.typeScrapNum">
|
||||
<!-- <uni-col :span="2" style="color: transparent">{{ index + 1 }}</uni-col> -->
|
||||
<uni-col :span="6">报废数量:</uni-col>
|
||||
<uni-col :span="16">
|
||||
<view class="cont">{{ item.typeScrapNum }}</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>
|
||||
<uni-col :span="16">
|
||||
<view class="cont">{{ Number(item.typeRepairNum)-Number(item.typeRepairedNum)-Number(item.typeScrapNum) }}</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>
|
||||
|
|
|
|||
|
|
@ -272,3 +272,12 @@ export const getSelectMachineByIdApi = (data) => {
|
|||
data:data,
|
||||
})
|
||||
}
|
||||
|
||||
// 退料编码-下拉
|
||||
export const getLeaseCode = (data) => {
|
||||
return http({
|
||||
method: 'GET',
|
||||
url: '/material/leaseTask/getCode',
|
||||
data:data,
|
||||
})
|
||||
}
|
||||
|
|
@ -63,3 +63,14 @@ export const getDetailsListApi = (data) => {
|
|||
data,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 定损 ---- 直接维修
|
||||
*/
|
||||
export const updateRepairStatusAPI = (data) => {
|
||||
return http({
|
||||
method: 'POST',
|
||||
url: '/material/lossAssessment/gotoRepair',
|
||||
data,
|
||||
})
|
||||
}
|
||||
Loading…
Reference in New Issue