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_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() {
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 http from './http'
// import request from '@/utils/request'
// 上传
export function uploadFile(data) {
@ -8,4 +9,13 @@ export function uploadFile(data) {
filePath:data.filePath,
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>
</view>
</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'?'设备' : '模具'}}
</u-form-item>
<u-form-item :label="`${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码`" prop="deviceNumber" required
@ -218,7 +218,8 @@
maintenance:'',
subList: [],
sourceType: '',
sourceTypeName: ''
sourceTypeName: '',
type: type
})
@ -360,7 +361,8 @@
maintenance:'',
subList: [],
sourceType: '',
sourceTypeName: ''
sourceTypeName: '',
type: type
}
isDisabled.value = false
@ -395,6 +397,7 @@
//
function chickRightButton(field) {
form.value.type = type
if (!form.value.type) {
proxy.$modal.showToast('请先选择类型')
return;

46
src/pages/sparePartsApplication/addForm.vue

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

139
src/pages/upkeepOrder/detail.vue

@ -137,6 +137,19 @@
<!-- <u-icon name="minus-circle" color="#aaaaaa" size="60" ></u-icon> -->
</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 class="footer">
@ -179,11 +192,14 @@
} from 'vue'
import * as moldApi from "@/api/mold"
import * as upkeepOrderApi from "@/api/upkeepOrder"
import * as uploadApi from "@/api/upload"
const { proxy } = getCurrentInstance()
const list = ref([{
name: '设备信息'
}, {
name: '保养内容'
}, {
name: '图片'
}])
const current = ref(0)
const changeItem = ref({
@ -196,6 +212,8 @@
const serviceList = ref([])
const isTrue = ref(false)
const isVerifyShowSuccess = ref(false)
const imgList = ref([])
const fileInfoList = ref([])
function change(index) {
current.value = index
changeItem.value = list.value[current.value]
@ -256,19 +274,25 @@
}
const paramsData = {
id: data.value.id,
verifyContent: data.value.applyContent
verifyContent: data.value.applyContent,
}
proxy.$modal.confirm('是否验证完结?').then(() => {
proxy.$modal.confirm('是否关闭?').then(() => {
proxy.$modal.loading('加载中')
loading.value = true
upkeepOrderApi.orderClickFinish(paramsData,type.value).then((res) => {
if (res.data) {
proxy.$modal.showToast('操作成功')
setTimeout(() => {
proxy.$tab.navigateBack()
loading.value = false
}, 1500)
let params = {
fileInfoList: fileInfoList.value,
funcCode: "maintenance",
number: data.value.number
}
uploadApi.uploadCommit(params).then(response=>{
proxy.$modal.showToast('操作成功')
setTimeout(() => {
proxy.$tab.navigateBack()
loading.value = false
}, 1500)
})
} else {
proxy.$modal.showToast(res.msg)
loading.value = false
@ -279,7 +303,7 @@
})
})
}
//
//
function orderClickVerify() {
if (!serviceList.value || serviceList.value && serviceList.value.length == 0) {
proxy.$modal.showToast('没有保养内容')
@ -287,18 +311,16 @@
}
const paramsData = {
id: data.value.id,
verifyContent: data.value.applyContent
verifyContent: data.value.applyContent,
}
isVerifyShowSuccess.value = false
proxy.$modal.confirm('是否完成?').then(() => {
proxy.$modal.confirm('是否验证完结?').then(() => {
proxy.$modal.loading('加载中')
loading.value = true
upkeepOrderApi.orderClickVerify(paramsData,type.value).then((res) => {
if (res.data) {
proxy.$modal.showToast('操作成功')
setTimeout(() => {
// proxy.$tab.navigateTo(`/pages/upkeepOrder/index?type=${type.value}`)
proxy.$tab.navigateBack()
loading.value = false
}, 1500)
@ -332,15 +354,53 @@
}).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) => {
if (option.type) type.value = option.type;
if (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]
})
onShow(() => {
getUpkeepOrderDetailList()
@ -556,5 +616,54 @@
display: flex;
justify-content: flex-start;
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>
Loading…
Cancel
Save