维修模块相关接口对接
This commit is contained in:
parent
f521356c3c
commit
5c68d5e4db
|
|
@ -1,11 +1,7 @@
|
|||
<template>
|
||||
<!-- 数量出库 -->
|
||||
<view class="page-container">
|
||||
<uni-row :gutter="24" class="search-form">
|
||||
<uni-col :span="6">
|
||||
<view class="search" style="background-color: #19be6b"> 维修完成 </view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
|
||||
<view class="table-list-item">
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">物资名称:</uni-col>
|
||||
|
|
@ -20,20 +16,291 @@
|
|||
</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.repairNum }}</view>
|
||||
><view class="cont">{{ queryParams.repairDeviceList[rowIndex].code }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
<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>
|
||||
</uni-col>
|
||||
<uni-col :span="5">
|
||||
<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>
|
||||
</uni-col>
|
||||
<uni-col :span="5">
|
||||
<view class="btnBox" style="background-color: #18bc37" @click="saveCode"> 维修完成 </view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<scroll-view scroll-y style="padding-bottom: 20rpx">
|
||||
<!-- -->
|
||||
<view class="table-list-item">
|
||||
<!-- 维修人员 -->
|
||||
<h2 style="padding: 4rpx 0; font-weight: bold">维修信息</h2>
|
||||
<uni-forms ref="baseForm" label-align="right">
|
||||
<uni-forms-item label="维修人员">
|
||||
<uni-data-select :localdata="repairPerson" placeholder="请选择维修人员" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="备注">
|
||||
<uni-easyinput placeholder="请填写备注" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="附件">
|
||||
<uni-file-picker fileMediatype="image" mode="grid" />
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
</view>
|
||||
|
||||
<!-- 内部维修 -->
|
||||
<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-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"/>
|
||||
<!-- <ssha-dropdownSelect
|
||||
:search="true"
|
||||
label="label"
|
||||
v-model="partIds"
|
||||
:localdata="partTreeData"
|
||||
@change="changePart"
|
||||
@changeItem="changeItem"
|
||||
placeholder="请选择">
|
||||
</ssha-dropdownSelect> -->
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="配件数量">
|
||||
<uni-easyinput placeholder="配件数量" v-model="item.partNum"/>
|
||||
</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>
|
||||
</div>
|
||||
</uni-forms-item>
|
||||
|
||||
</div>
|
||||
</uni-forms>
|
||||
</view>
|
||||
|
||||
<!-- 返厂维修 -->
|
||||
<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-forms-item label="物资厂家">
|
||||
<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-forms-item>
|
||||
<uni-forms-item label="配件数量">
|
||||
<uni-easyinput v-model="item.partNum" placeholder="请输入配件数量" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="金额">
|
||||
<div style="width: 100%;display: flex;">
|
||||
<uni-easyinput v-model="item.partPrice" placeholder="请输入金额" />
|
||||
<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>
|
||||
</div>
|
||||
</uni-forms>
|
||||
</view>
|
||||
|
||||
<!-- 维修报废 -->
|
||||
<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-forms-item>
|
||||
<uni-forms-item label="损坏原因">
|
||||
<uni-data-select :localdata="damageReasonList" v-model="formRight.scrapType" placeholder="请选择损坏原因" />
|
||||
</uni-forms-item>
|
||||
<!-- <uni-forms-item label="其他原因">
|
||||
<uni-easyinput placeholder="请填写其他原因" />
|
||||
</uni-forms-item> -->
|
||||
<uni-forms-item label="附件">
|
||||
<uni-file-picker fileMediatype="image" mode="grid" />
|
||||
</uni-forms-item>
|
||||
</uni-forms>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, ref } from 'vue'
|
||||
import { setOutboundNumAPI } from '@/services/picking/outbound.js'
|
||||
import { partTypeTreeList,getSupplierList,saveRepairRow } from '@/services/repair/repair.js'
|
||||
const query = defineProps() // 获取上级页面传递的路由参数
|
||||
const queryParams = JSON.parse(query.queryParams)
|
||||
const rowIndex = query.rowIndex;
|
||||
|
||||
const repairType = ref(1)
|
||||
const changeTab = async (e) => {
|
||||
repairType.value = e
|
||||
}
|
||||
|
||||
const repairPerson = ref([
|
||||
{ value: '1', text: '张麻子' },
|
||||
{ value: '2', text: '张牧之' },
|
||||
{ value: '3', text: '黄四郎' },
|
||||
{ value: '4', text: '马邦德' },
|
||||
])
|
||||
|
||||
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 addPart = () => {
|
||||
partItems.value.push({ partType: "", partNum: "", isCharge: "", partId: "16" });
|
||||
}
|
||||
const delPart = (index) => {
|
||||
if (partItems.value.length > 1) {
|
||||
partItems.value.splice(index, 1);
|
||||
}
|
||||
}
|
||||
const partIds = ref([])
|
||||
const formLeft = ref({
|
||||
// repairNum:0
|
||||
})
|
||||
const partTreeData = ref([])
|
||||
const getPartTreeData = async() => {
|
||||
const res = await partTypeTreeList({})
|
||||
partTreeData.value = res.data;
|
||||
|
||||
console.log(res)
|
||||
}
|
||||
getPartTreeData()
|
||||
|
||||
|
||||
//返厂维修
|
||||
const partsMillList = ref([])
|
||||
const getSupplierListData = async() => {
|
||||
const res = await getSupplierList({})
|
||||
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 addMidPart = () => {
|
||||
partItemsMiddle.value.push({ partName: "", supplierId: "", partNum: "", partPrice: "0", isCharge: "" });
|
||||
}
|
||||
const delMidPart = (index) => {
|
||||
if (partItemsMiddle.value.length > 1) {
|
||||
partItemsMiddle.value.splice(index, 1);
|
||||
}
|
||||
}
|
||||
const formMiddle = ref({
|
||||
// supplierId:undefined,
|
||||
// repairNum:0
|
||||
})
|
||||
|
||||
//待报废
|
||||
const formRight = ref({
|
||||
// scrapNum:0,
|
||||
scrapType:undefined,
|
||||
scrapReason:undefined,
|
||||
})
|
||||
const rowData = ref(queryParams)
|
||||
//数量管理保存
|
||||
const saveCode = async() => {
|
||||
console.log(rowData)
|
||||
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){
|
||||
for (let i = 0; i < partItemsMiddle.value.length; i++) {
|
||||
rowData.value.repairDeviceList[rowIndex].codeOutRepairPartList.push({
|
||||
isCharge: partItemsMiddle.value[i].isCharge,
|
||||
partPrice: partItemsMiddle.value[i].partPrice,
|
||||
partNum: partItemsMiddle.value[i].partNum,
|
||||
partName: partItemsMiddle.value[i].partName,
|
||||
supplierId: partItemsMiddle.value[i].supplierId,
|
||||
// repairNum: formMiddle.value.repairNum,
|
||||
});
|
||||
}
|
||||
}else if(repairType.value==3){
|
||||
// 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[rowIndex].codeScrapRepairPartList.push(formRight.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 // 返回到已存在的页面
|
||||
});
|
||||
// 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);
|
||||
// });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
@ -66,36 +333,35 @@ const queryParams = JSON.parse(query.queryParams)
|
|||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.search {
|
||||
.btnBox {
|
||||
height: 65rpx;
|
||||
background-color: #3784fb;
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
line-height: 65rpx;
|
||||
color: #fff;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.scroll-container {
|
||||
.table-list-item {
|
||||
.table-list-item {
|
||||
margin: 20rpx 0;
|
||||
padding: 20rpx;
|
||||
background-color: #fff;
|
||||
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;
|
||||
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;
|
||||
}
|
||||
height: 1px;
|
||||
background-color: #e8e8e8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@
|
|||
<uni-col :span="4">
|
||||
<view class="search">查询</view>
|
||||
</uni-col>
|
||||
<uni-col :span="4">
|
||||
<view class="search" style="background-color: #19be6b">合格</view>
|
||||
</uni-col>
|
||||
<!-- <uni-col :span="4">
|
||||
<view class="search" style="background-color: #19be6b" @click="onQualified">合格</view>
|
||||
</uni-col> -->
|
||||
</uni-row>
|
||||
<view class="table-list-item">
|
||||
<uni-row :gutter="24">
|
||||
|
|
@ -30,11 +30,11 @@
|
|||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">待修数量:</uni-col>
|
||||
<uni-col :span="18"
|
||||
><view class="cont">{{ queryParams.repairNum }}</view>
|
||||
><view class="cont">{{ queryParams.typeRepairNum - queryParams.typeRepairedNum }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
<view class="table-list-item" style="margin: 0">
|
||||
<!-- <view class="table-list-item" style="margin: 0">
|
||||
<checkbox-group>
|
||||
<label>
|
||||
全选
|
||||
|
|
@ -48,38 +48,69 @@
|
|||
/>
|
||||
</label>
|
||||
</checkbox-group>
|
||||
</view>
|
||||
</view> -->
|
||||
<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">
|
||||
<checkbox-group>
|
||||
<label>
|
||||
<checkbox
|
||||
color="#409eff"
|
||||
borderColor="#409eff"
|
||||
activeBorderColor="#409eff"
|
||||
:disabled="item.status == '1'"
|
||||
style="transform: scale(0.7)"
|
||||
/>
|
||||
</label>
|
||||
</checkbox-group>
|
||||
</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>
|
||||
</uni-row>
|
||||
</view>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<view class="table-list-item">
|
||||
<uni-row :gutter="24">
|
||||
<uni-col :span="2">
|
||||
<checkbox-group>
|
||||
<label>
|
||||
<checkbox
|
||||
color="#409eff"
|
||||
borderColor="#409eff"
|
||||
activeBorderColor="#409eff"
|
||||
style="transform: scale(0.7)"
|
||||
/>
|
||||
</label>
|
||||
</checkbox-group>
|
||||
</uni-col>
|
||||
<uni-col :span="2">1</uni-col>
|
||||
<uni-col :span="14">物资名称:</uni-col>
|
||||
<uni-col :span="6">
|
||||
<view class="cont">66</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, ref } from 'vue'
|
||||
import { setOutboundNumAPI } from '@/services/picking/outbound.js'
|
||||
import { computed, ref } from 'vue'
|
||||
import { auditRepairPass } from '@/services/repair/repair.js'
|
||||
const query = defineProps() // 获取上级页面传递的路由参数
|
||||
const queryParams = JSON.parse(query.queryParams)
|
||||
console.log(queryParams)
|
||||
const allChecked = ref(false)
|
||||
const repairDeviceList = ref(queryParams.repairDeviceList)
|
||||
|
||||
// 点击跳转维修页面
|
||||
const goOperate = (index) => {
|
||||
const codingUrl = '/pages/repair/code-operate' // 编码维修
|
||||
uni.navigateTo({ url: `${codingUrl}?queryParams=${JSON.stringify(queryParams)}&rowIndex=${index}` })
|
||||
}
|
||||
|
||||
const onQualified = async () => {
|
||||
console.log(queryParams)
|
||||
const res = await auditRepairPass(queryParams.ids)
|
||||
if (res.code === 200) {
|
||||
uni.showToast({
|
||||
title: '操作成功!',
|
||||
icon: 'none',
|
||||
})
|
||||
uni.navigateBack({
|
||||
delta: 1 // 返回到已存在的页面
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
@ -110,6 +141,7 @@ const allChecked = ref(false)
|
|||
display: flex;
|
||||
align-items: center;
|
||||
box-sizing: content-box;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.search {
|
||||
|
|
@ -118,10 +150,12 @@ const allChecked = ref(false)
|
|||
text-align: center;
|
||||
line-height: 65rpx;
|
||||
color: #fff;
|
||||
border-radius: 10rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.table-list-item {
|
||||
margin: 20rpx 0;
|
||||
margin: 10rpx 0;
|
||||
padding: 20rpx;
|
||||
background-color: #fff;
|
||||
// min-height: 300rpx;
|
||||
|
|
|
|||
|
|
@ -106,8 +106,8 @@
|
|||
|
||||
<script setup>
|
||||
import { ref, onUnmounted, computed } from 'vue'
|
||||
import { getRepairDetailsAPI, setQualifiedAPI } from '@/services/repair/repair.js'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { getRepairDetailsAPI, auditRepairPass } from '@/services/repair/repair.js'
|
||||
import { onLoad,onShow } from '@dcloudio/uni-app'
|
||||
const detailsList = ref([])
|
||||
const query = defineProps() // 获取上级页面传递的路由参数
|
||||
|
||||
|
|
@ -156,10 +156,15 @@ const onQualified = async () => {
|
|||
const ids = []
|
||||
detailsList.value.forEach((e) => {
|
||||
if (e.isChecked) {
|
||||
ids.push(e.id)
|
||||
if(e.ids.length>0){
|
||||
e.ids.forEach((f =>{
|
||||
ids.push(f)
|
||||
}))
|
||||
}
|
||||
}
|
||||
})
|
||||
const res = await setQualifiedAPI(ids)
|
||||
console.log(ids)
|
||||
const res = await auditRepairPass(ids)
|
||||
if (res.code === 200) {
|
||||
uni.showToast({
|
||||
title: '操作成功!',
|
||||
|
|
@ -171,36 +176,31 @@ const onQualified = async () => {
|
|||
|
||||
// 点击跳转维修页面
|
||||
const onRepairItem = (item) => {
|
||||
// 解构所需要的数据
|
||||
const { manageType, repairNum, typeName, type } = item
|
||||
console.log(item)
|
||||
let queryParams = null
|
||||
let codingUrl = ''
|
||||
if (manageType === 0) {
|
||||
if (item.manageType === 0) {
|
||||
codingUrl = '/pages/repair/code-view' // 编码维修
|
||||
}
|
||||
if (manageType == 1) {
|
||||
if (item.manageType == 1) {
|
||||
codingUrl = '/pages/repair/num-operate' // 数量维修
|
||||
}
|
||||
queryParams = {
|
||||
repairNum,
|
||||
typeName,
|
||||
type,
|
||||
}
|
||||
queryParams = item
|
||||
uni.navigateTo({ url: `${codingUrl}?queryParams=${JSON.stringify(queryParams)}` })
|
||||
}
|
||||
|
||||
onShow(() => {
|
||||
getOutboundDetailsData()
|
||||
})
|
||||
// 页面加载完毕
|
||||
onLoad(() => {
|
||||
getOutboundDetailsData()
|
||||
|
||||
getOutboundDetailsData()
|
||||
// 监听出库完成事件 刷新列表
|
||||
uni.$on('onUpdate', () => {
|
||||
// console.log('监听事件')
|
||||
// 刷新列表
|
||||
getOutboundDetailsData()
|
||||
})
|
||||
})
|
||||
|
||||
})
|
||||
// 页面销毁时移除事件监听
|
||||
onUnmounted(() => {
|
||||
uni.$off('onUpdate') // 移除事件监听
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<view class="page-container">
|
||||
<uni-row :gutter="24" class="search-form">
|
||||
<uni-col :span="6">
|
||||
<view class="search" style="background-color: #19be6b"> 维修完成 </view>
|
||||
<view class="search" style="background-color: #19be6b" @click="saveNumAll"> 维修完成 </view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
<view class="table-list-item">
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
<uni-row :gutter="24">
|
||||
<uni-col :span="6">待修数量:</uni-col>
|
||||
<uni-col :span="18"
|
||||
><view class="cont">{{ queryParams.repairNum }}</view>
|
||||
><view class="cont">{{ queryParams.typeRepairNum - queryParams.typeRepairedNum }}</view>
|
||||
</uni-col>
|
||||
</uni-row>
|
||||
</view>
|
||||
|
|
@ -48,19 +48,37 @@
|
|||
<!-- 内部维修 -->
|
||||
<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="请填写维修数量" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="配件类型">
|
||||
<uni-easyinput placeholder="配件类型" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="规格型号">
|
||||
<uni-easyinput placeholder="规格型号" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="是否收费">
|
||||
<uni-data-select :localdata="isChargeList" placeholder="请选择是否收费" />
|
||||
<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"/>
|
||||
<!-- <ssha-dropdownSelect
|
||||
:search="true"
|
||||
label="label"
|
||||
v-model="partIds"
|
||||
:localdata="partTreeData"
|
||||
@change="changePart"
|
||||
@changeItem="changeItem"
|
||||
placeholder="请选择">
|
||||
</ssha-dropdownSelect> -->
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="配件数量">
|
||||
<uni-easyinput placeholder="配件数量" v-model="item.partNum"/>
|
||||
</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>
|
||||
</div>
|
||||
</uni-forms-item>
|
||||
|
||||
</div>
|
||||
</uni-forms>
|
||||
</view>
|
||||
|
||||
|
|
@ -69,20 +87,31 @@
|
|||
<h2 style="padding: 4rpx 0; font-weight: bold">返厂维修</h2>
|
||||
<uni-forms ref="baseForm" label-align="right">
|
||||
<uni-forms-item label="维修数量">
|
||||
<uni-easyinput placeholder="请输入维修数量" />
|
||||
<uni-easyinput placeholder="请输入维修数量" v-model="formMiddle.repairNum"/>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="配件信息">
|
||||
<uni-easyinput placeholder="配件类型" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="配件厂家">
|
||||
<uni-data-select :localdata="partsMillList" placeholder="请选择配件厂家" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="是否收费">
|
||||
<uni-data-select :localdata="isChargeList" placeholder="请选择是否收费" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="配件数量">
|
||||
<uni-easyinput placeholder="请输入配件数量" />
|
||||
<uni-forms-item label="物资厂家">
|
||||
<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-forms-item label="是否收费">
|
||||
<uni-data-select :localdata="isChargeList" v-model="item.isCharge" placeholder="请选择是否收费" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="配件数量">
|
||||
<uni-easyinput v-model="item.partNum" placeholder="请输入配件数量" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="金额">
|
||||
<div style="width: 100%;display: flex;">
|
||||
<uni-easyinput v-model="item.partPrice" placeholder="请输入金额" />
|
||||
<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>
|
||||
</div>
|
||||
</uni-forms>
|
||||
</view>
|
||||
|
||||
|
|
@ -90,15 +119,18 @@
|
|||
<view class="table-list-item">
|
||||
<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-data-select :localdata="repairPerson" placeholder="请选择报废原因" />
|
||||
<uni-easyinput placeholder="请填写报废原因" v-model="formRight.scrapReason"/>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="损坏原因">
|
||||
<uni-data-select :localdata="repairPerson" placeholder="请选择损坏原因" />
|
||||
<uni-data-select :localdata="damageReasonList" placeholder="请选择损坏原因" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="其他原因">
|
||||
<!-- <uni-forms-item label="其他原因">
|
||||
<uni-easyinput placeholder="请填写其他原因" />
|
||||
</uni-forms-item>
|
||||
</uni-forms-item> -->
|
||||
<uni-forms-item label="附件">
|
||||
<uni-file-picker fileMediatype="image" mode="grid" />
|
||||
</uni-forms-item>
|
||||
|
|
@ -110,7 +142,7 @@
|
|||
|
||||
<script setup>
|
||||
import { computed, ref } from 'vue'
|
||||
import { setOutboundNumAPI } from '@/services/picking/outbound.js'
|
||||
import { partTypeTreeList,getSupplierList,saveRepairRow } from '@/services/repair/repair.js'
|
||||
const query = defineProps() // 获取上级页面传递的路由参数
|
||||
const queryParams = JSON.parse(query.queryParams)
|
||||
const repairPerson = ref([
|
||||
|
|
@ -119,14 +151,196 @@ const repairPerson = ref([
|
|||
{ value: '3', text: '黄四郎' },
|
||||
{ value: '4', text: '马邦德' },
|
||||
])
|
||||
|
||||
const damageReasonList = ref([
|
||||
{ value: 0, text: '自然损坏' },
|
||||
{ value: 1, text: '人为损坏' },
|
||||
])
|
||||
|
||||
const isChargeList = ref([
|
||||
{ value: 1, text: '是' },
|
||||
{ value: 2, text: '否' },
|
||||
])
|
||||
const partsMillList = ref([
|
||||
{ value: 1, text: '上海机械公司' },
|
||||
{ value: 2, text: '北京机械公司' },
|
||||
])
|
||||
//内部维修
|
||||
const partItems = ref([{ partType: "", partNum: "", isCharge: "",partId: "7" }])
|
||||
const addPart = () => {
|
||||
partItems.value.push({ partType: "", partNum: "", isCharge: "", partId: "7" });
|
||||
}
|
||||
const delPart = (index) => {
|
||||
if (partItems.value.length > 1) {
|
||||
partItems.value.splice(index, 1);
|
||||
}
|
||||
}
|
||||
const partIds = ref([])
|
||||
const formLeft = ref({
|
||||
repairNum:0
|
||||
})
|
||||
const partTreeData = ref([])
|
||||
const getPartTreeData = async() => {
|
||||
const res = await partTypeTreeList({})
|
||||
partTreeData.value = res.data;
|
||||
|
||||
console.log(res)
|
||||
}
|
||||
getPartTreeData()
|
||||
|
||||
|
||||
//返厂维修
|
||||
const partsMillList = ref([])
|
||||
const getSupplierListData = async() => {
|
||||
const res = await getSupplierList({})
|
||||
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 addMidPart = () => {
|
||||
partItemsMiddle.value.push({ partName: "", partNum: "", partPrice: "0", isCharge: "" });
|
||||
}
|
||||
const delMidPart = (index) => {
|
||||
if (partItemsMiddle.value.length > 1) {
|
||||
partItemsMiddle.value.splice(index, 1);
|
||||
}
|
||||
}
|
||||
const formMiddle = ref({
|
||||
supplierId:undefined,
|
||||
repairNum:0
|
||||
})
|
||||
|
||||
//待报废
|
||||
const formRight = ref({
|
||||
scrapNum:0,
|
||||
scrapType:undefined,
|
||||
scrapReason:undefined,
|
||||
})
|
||||
const rowData = ref(queryParams)
|
||||
//数量管理保存
|
||||
const saveNumAll = async() => {
|
||||
console.log(rowData)
|
||||
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);
|
||||
// });
|
||||
}
|
||||
});
|
||||
// }
|
||||
// })
|
||||
}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;
|
||||
}
|
||||
});
|
||||
// }
|
||||
// })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ export const getRepairDetailsAPI = (data) => {
|
|||
})
|
||||
}
|
||||
/**
|
||||
* 维修 ---- 合格操作
|
||||
* 维修 ---- 合格操作(废弃)
|
||||
*/
|
||||
export const setQualifiedAPI = (data) => {
|
||||
return http({
|
||||
|
|
@ -50,3 +50,39 @@ export const repairRejectAPI = (id) => {
|
|||
data: [id],
|
||||
})
|
||||
}
|
||||
|
||||
//获取配件类型树
|
||||
export const partTypeTreeList = (data) => {
|
||||
return http({
|
||||
method: 'GET',
|
||||
url: '/material/ma_part_type/list',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
//获取厂家
|
||||
export const getSupplierList = (data) => {
|
||||
return http({
|
||||
method: 'GET',
|
||||
url: '/material/ma_supplier_info/list',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
// 维修保存(编码数量一个接口)
|
||||
export const saveRepairRow = (data) => {
|
||||
return http({
|
||||
url: '/material/repair/batchRepairApply',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
//维修合格
|
||||
export const auditRepairPass = (data) => {
|
||||
return http({
|
||||
url: '/material/repair/batchQualified',
|
||||
method: 'POST',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
|
@ -21,8 +21,8 @@ export default defineConfig({
|
|||
// 在此处编写代理规则
|
||||
'/api': {
|
||||
// target: 'http://192.168.2.76:18080',
|
||||
// target: 'http://192.168.2.246:18080',
|
||||
target: 'http://localhost:18080',
|
||||
target: 'http://192.168.0.244:18580',
|
||||
// target: 'http://localhost:18080',
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => {
|
||||
return path.replace(/\/api/, '')
|
||||
|
|
|
|||
Loading…
Reference in New Issue