Browse Source

feat: 生产bug修复和优化开发

master
ljlong_2630 2 weeks ago
parent
commit
751289b9e4
  1. 4
      .env.development
  2. 4
      src/api/spareParts.ts
  3. 12
      src/api/upload.ts
  4. 9
      src/pages/overhaulOrder/addForm.vue
  5. 46
      src/pages/sparePartsApplication/addForm.vue
  6. 139
      src/pages/upkeepOrder/detail.vue

4
.env.development

@ -1,5 +1,5 @@
VITE_BASE_URL=http://localhost:12080/admin-api VITE_BASE_URL=http://192.168.0.229:12081/admin-api
#VITE_BASE_URL=http://dev.ccwin-in.com:25202/api/admin-api #VITE_BASE_URL=http://dev.ccwin-in.com:25202/api/admin-api
VITE_BASE_URL_IMAGE=http://192.168.0.106:12080/admin-api VITE_BASE_URL_IMAGE=http://192.168.0.229:12081/admin-api

4
src/api/spareParts.ts

@ -14,4 +14,8 @@ export function getApplySparePartsList() {
// 新增备件维修获取备件列表 // 新增备件维修获取备件列表
export function getServiceSparePartsList() { export function getServiceSparePartsList() {
return http.get('/eam/item/getItemMaintainList') return http.get('/eam/item/getItemMaintainList')
}
// 备件当前库存情况
export function getApplyItemByNumber(number) {
return http.get(`/eam/item/getApplyItemByNumber?number=`+number)
} }

12
src/api/upload.ts

@ -1,4 +1,5 @@
import upload from '@/api/uploadHttp' import upload from '@/api/uploadHttp'
import http from './http'
// import request from '@/utils/request' // import request from '@/utils/request'
// 上传 // 上传
export function uploadFile(data) { export function uploadFile(data) {
@ -8,4 +9,13 @@ export function uploadFile(data) {
filePath:data.filePath, filePath:data.filePath,
name: data.name name: data.name
}) })
} }
export function uploadCommit(fileInfo) {
return http.post('/eam/attachment-file/upload',fileInfo)
}

9
src/pages/overhaulOrder/addForm.vue

@ -27,7 +27,7 @@
<u-icon name="arrow-right" color="#aaaaaa" size="28" v-if="!form.id"></u-icon> <u-icon name="arrow-right" color="#aaaaaa" size="28" v-if="!form.id"></u-icon>
</view> </view>
</u-form-item> --> </u-form-item> -->
<u-form-item label="类型" prop="deviceNumber" required class="disabled"> <u-form-item label="类型" prop="type" required class="disabled">
{{type =='DEVICE'||type == 'TECH'?'设备' : '模具'}} {{type =='DEVICE'||type == 'TECH'?'设备' : '模具'}}
</u-form-item> </u-form-item>
<u-form-item :label="`${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码`" prop="deviceNumber" required <u-form-item :label="`${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码`" prop="deviceNumber" required
@ -218,7 +218,8 @@
maintenance:'', maintenance:'',
subList: [], subList: [],
sourceType: '', sourceType: '',
sourceTypeName: '' sourceTypeName: '',
type: type
}) })
@ -360,7 +361,8 @@
maintenance:'', maintenance:'',
subList: [], subList: [],
sourceType: '', sourceType: '',
sourceTypeName: '' sourceTypeName: '',
type: type
} }
isDisabled.value = false isDisabled.value = false
@ -395,6 +397,7 @@
// //
function chickRightButton(field) { function chickRightButton(field) {
form.value.type = type
if (!form.value.type) { if (!form.value.type) {
proxy.$modal.showToast('请先选择类型') proxy.$modal.showToast('请先选择类型')
return; return;

46
src/pages/sparePartsApplication/addForm.vue

@ -115,7 +115,13 @@
<u-radio :name="'FALSE'"></u-radio> <u-radio :name="'FALSE'"></u-radio>
</u-radio-group> </u-radio-group>
</u-form-item> </u-form-item>
<u-form-item label="库存" prop="currentQty" required class="disabled"> <u-form-item label="未出库库存" prop="totalQty" required class="disabled">
<u-input v-model="form1.totalQty" type="number" disabled placeholder="请输入库存" />
</u-form-item>
<u-form-item label="已申领库存" prop="requestQty" required class="disabled">
<u-input v-model="form1.requestQty" type="number" disabled placeholder="请输入库存" />
</u-form-item>
<u-form-item label="可申领库存" prop="currentQty" required class="disabled">
<u-input v-model="form1.currentQty" type="number" disabled placeholder="请输入库存" /> <u-input v-model="form1.currentQty" type="number" disabled placeholder="请输入库存" />
</u-form-item> </u-form-item>
<u-form-item label="数量" prop="qty" required> <u-form-item label="数量" prop="qty" required>
@ -181,6 +187,8 @@
type: '', type: '',
deviceNumber: undefined, deviceNumber: undefined,
isRadeIn: '', isRadeIn: '',
totalQty: '',
requestQty: '',
currentQty: '', currentQty: '',
qty: '', qty: '',
temporarilySpecifications: '' temporarilySpecifications: ''
@ -280,7 +288,7 @@
// //
function openSingleNewColumn(fieldName, val, list) { function openSingleNewColumn(fieldName, val, list) {
singleColumnList.value = list singleColumnList.value = []
field.value = fieldName field.value = fieldName
if (val) { if (val) {
singleColumnDefaultValue.value = [list.findIndex(item => item.value == val)] singleColumnDefaultValue.value = [list.findIndex(item => item.value == val)]
@ -288,10 +296,10 @@
singleColumnDefaultValue.value = [] singleColumnDefaultValue.value = []
} }
isShowSelectItem.value = true; isShowSelectItem.value = true;
singleColumnList.value = list
} }
async function searchItem(name){ async function searchItem(name){
proxy.$modal.loading('加载中')
await getSparePartsList(name); await getSparePartsList(name);
} }
@ -301,20 +309,18 @@
return; return;
} }
if (type == 1) { if (type == 1) {
proxy.$modal.loading("加载中")
form1.value.itemNumber = forms.value.temporarilyNumber; form1.value.itemNumber = forms.value.temporarilyNumber;
form1.value.name = forms.value.temporarilyName; form1.value.name = forms.value.temporarilyName;
form1.value.specifications = forms.value.temporarilySpecifications; form1.value.specifications = forms.value.temporarilySpecifications;
let param = { await sparePartsApi.getApplyItemByNumber(form1.value.itemNumber).then(res => {
number:form1.value.itemNumber form1.value.totalQty = res.data.totalStockQty
} form1.value.currentQty = res.data.availableQty;
await sparePartsApi.getApplySparePartsList(param).then(res => { form1.value.requestQty = res.data.totalRequestQty;
const itemInfo = res.data.find(item=>item.number == form1.value.itemNumber); form1.value.isRadeIn = res.data.isRadeIn;
if(itemInfo){ updataKey.value++
form1.value.currentQty = itemInfo.qty; }).catch(() => {
form1.value.isRadeIn = itemInfo.isRadeIn; })
updataKey.value++
}
}).catch(() => { })
} }
await getSparePartsList(null); await getSparePartsList(null);
isShowSelectItem.value = false; isShowSelectItem.value = false;
@ -332,7 +338,11 @@
}) })
sparePartsList.value = res.data sparePartsList.value = res.data
singleColumnList.value = sparePartsList.value singleColumnList.value = sparePartsList.value
}).catch(() => { }) proxy.$modal.closeLoading()
}).catch(() => {
proxy.$modal.closeLoading()
})
} }
// //
@ -434,6 +444,8 @@
type: '', type: '',
deviceNumber: undefined, deviceNumber: undefined,
isRadeIn: '', isRadeIn: '',
totalQty: '',
requestQty: '',
currentQty: "", currentQty: "",
qty: '', qty: '',
} }
@ -449,11 +461,11 @@
// this.$modal.showToast('') // this.$modal.showToast('')
// return; // return;
// } // }
if (!form1.value.qty || form1.value.qty == 0) { if (!form1.value.qty || Number(form1.value.qty) == 0) {
proxy.$modal.showToast('请输入数量') proxy.$modal.showToast('请输入数量')
return; return;
} }
if (form1.value.qty > form1.value.currentQty) { if (Number(form1.value.qty) > Number(form1.value.currentQty)) {
proxy.$modal.showToast('数量不可以大于库存') proxy.$modal.showToast('数量不可以大于库存')
return; return;
} }

139
src/pages/upkeepOrder/detail.vue

@ -137,6 +137,19 @@
<!-- <u-icon name="minus-circle" color="#aaaaaa" size="60" ></u-icon> --> <!-- <u-icon name="minus-circle" color="#aaaaaa" size="60" ></u-icon> -->
</view> </view>
</view> </view>
<view class="list" v-if="current == 2">
<view class="image" style="margin-top: 20rpx;">
<view class="image-list" v-if='imgList.length>0'>
<view class="image-item" v-for="(item,index) in imgList" :key="index">
<image :src="item" mode=""></image>
<u-icon name="close-circle-fill" color="red" class="close" size="36" @click="delImage(index)" v-if='data.status != "COMPLETED" && data.status != "VERIFIED"'/>
</view>
</view>
<view class="image-item image-item1" @click="chooseImage" v-if='imgList?.length<5 && data.status != "COMPLETED" && data.status != "VERIFIED"'>
<image src="../../static/images/photo.png" mode=""></image>
</view>
</view>
</view>
</view> </view>
</view> </view>
<view class="footer"> <view class="footer">
@ -179,11 +192,14 @@
} from 'vue' } from 'vue'
import * as moldApi from "@/api/mold" import * as moldApi from "@/api/mold"
import * as upkeepOrderApi from "@/api/upkeepOrder" import * as upkeepOrderApi from "@/api/upkeepOrder"
import * as uploadApi from "@/api/upload"
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const list = ref([{ const list = ref([{
name: '设备信息' name: '设备信息'
}, { }, {
name: '保养内容' name: '保养内容'
}, {
name: '图片'
}]) }])
const current = ref(0) const current = ref(0)
const changeItem = ref({ const changeItem = ref({
@ -196,6 +212,8 @@
const serviceList = ref([]) const serviceList = ref([])
const isTrue = ref(false) const isTrue = ref(false)
const isVerifyShowSuccess = ref(false) const isVerifyShowSuccess = ref(false)
const imgList = ref([])
const fileInfoList = ref([])
function change(index) { function change(index) {
current.value = index current.value = index
changeItem.value = list.value[current.value] changeItem.value = list.value[current.value]
@ -256,19 +274,25 @@
} }
const paramsData = { const paramsData = {
id: data.value.id, id: data.value.id,
verifyContent: data.value.applyContent verifyContent: data.value.applyContent,
} }
proxy.$modal.confirm('是否验证完结?').then(() => { proxy.$modal.confirm('是否关闭?').then(() => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
loading.value = true loading.value = true
upkeepOrderApi.orderClickFinish(paramsData,type.value).then((res) => { upkeepOrderApi.orderClickFinish(paramsData,type.value).then((res) => {
if (res.data) { if (res.data) {
proxy.$modal.showToast('操作成功') let params = {
setTimeout(() => { fileInfoList: fileInfoList.value,
proxy.$tab.navigateBack() funcCode: "maintenance",
loading.value = false number: data.value.number
}, 1500) }
uploadApi.uploadCommit(params).then(response=>{
proxy.$modal.showToast('操作成功')
setTimeout(() => {
proxy.$tab.navigateBack()
loading.value = false
}, 1500)
})
} else { } else {
proxy.$modal.showToast(res.msg) proxy.$modal.showToast(res.msg)
loading.value = false loading.value = false
@ -279,7 +303,7 @@
}) })
}) })
} }
// //
function orderClickVerify() { function orderClickVerify() {
if (!serviceList.value || serviceList.value && serviceList.value.length == 0) { if (!serviceList.value || serviceList.value && serviceList.value.length == 0) {
proxy.$modal.showToast('没有保养内容') proxy.$modal.showToast('没有保养内容')
@ -287,18 +311,16 @@
} }
const paramsData = { const paramsData = {
id: data.value.id, id: data.value.id,
verifyContent: data.value.applyContent verifyContent: data.value.applyContent,
} }
isVerifyShowSuccess.value = false isVerifyShowSuccess.value = false
proxy.$modal.confirm('是否完成?').then(() => { proxy.$modal.confirm('是否验证完结?').then(() => {
proxy.$modal.loading('加载中') proxy.$modal.loading('加载中')
loading.value = true loading.value = true
upkeepOrderApi.orderClickVerify(paramsData,type.value).then((res) => { upkeepOrderApi.orderClickVerify(paramsData,type.value).then((res) => {
if (res.data) { if (res.data) {
proxy.$modal.showToast('操作成功') proxy.$modal.showToast('操作成功')
setTimeout(() => { setTimeout(() => {
// proxy.$tab.navigateTo(`/pages/upkeepOrder/index?type=${type.value}`)
proxy.$tab.navigateBack() proxy.$tab.navigateBack()
loading.value = false loading.value = false
}, 1500) }, 1500)
@ -332,15 +354,53 @@
}).catch(() => { }) }).catch(() => { })
}) })
} }
function chooseImage() {
uni.chooseImage({
count: 1, // 9
sizeType: ['compressed'], //
sourceType: ['album', 'camera'], //
success: (res) => {
let filePath = res.tempFilePaths[0]
let tempFile = res.tempFiles[0]
proxy.$modal.loading()
uploadApi.uploadFile({
filePath: filePath,
}).then((ret) => {
proxy.$modal.closeLoading()
imgList.value.push(ret.data)
let fileInfo = {
url : ret.data,
name: tempFile.name
}
fileInfoList.value.push(fileInfo)
}).catch((err) => {
proxy.$modal.closeLoading()
});
},
});
}
//
function delImage(index) {
imgList.value.splice(index, 1)
fileInfoList.value.splice(index, 1)
}
onLoad(async (option) => { onLoad(async (option) => {
if (option.type) type.value = option.type; if (option.type) type.value = option.type;
if (option.data) { if (option.data) {
data.value = JSON.parse(decodeURIComponent(option.data)) data.value = JSON.parse(decodeURIComponent(option.data))
if(data.value.status != 'PECEIVED' && data.value.status != 'COMPLETED' && data.value.status != 'VERIFIED'){
list.value = [{
name: '设备信息'
}, {
name: '保养内容'
}]
}
imgList.value = data.value.filePathList?data.value.filePathList:[]
} }
changeItem.value = list.value[current.value] changeItem.value = list.value[current.value]
}) })
onShow(() => { onShow(() => {
getUpkeepOrderDetailList() getUpkeepOrderDetailList()
@ -556,5 +616,54 @@
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
align-items: center; align-items: center;
}
.image {
padding: 0px 30rpx;
padding-bottom: 30rpx;
display: flex;
align-items: center;
flex-wrap: wrap;
.image-list {
display: flex;
align-items: center;
flex-wrap: wrap;
}
}
.image-item {
width: 210rpx;
height: 210rpx;
margin-right: 20rpx;
position: relative;
border: 1px solid rgba(230, 230, 230, 0.5);
margin-bottom: 20rpx;
border-radius: 20rpx;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
.close {
position: absolute;
right: 0px;
top: 0px;
}
}
.image-item1 {
border: none;
margin-right: 0px;
image {
width: 100%;
height: 100%;
}
} }
</style> </style>
Loading…
Cancel
Save