Browse Source

fix: bug

master
zhang_li 8 months ago
parent
commit
9cf245d024
  1. 8
      package.json
  2. 35
      src/pages/deviceReport/addForm.vue
  3. 2
      src/pages/overhaulOrder/addServiceRecord.vue
  4. 23
      src/pages/repairOrder/addForm.vue
  5. 4
      src/pages/repairOrder/addServiceRecord.vue
  6. 6
      src/pages/sparePartsApplication/addForm.vue
  7. 5
      src/pages/spotCheckOrder/addForm.vue
  8. 9
      src/pages/upkeepOrder/addServiceRecord.vue

8
package.json

@ -11,10 +11,10 @@
"test:mp-weixin": "uni build -p mp-weixin", "test:mp-weixin": "uni build -p mp-weixin",
"test:app": "uni build -p app", "test:app": "uni build -p app",
"test:custom": "uni build -p", "test:custom": "uni build -p",
"build": "uni build --mode production", "prod": "uni build --mode production",
"build:mp-weixin": "uni build -p mp-weixin --mode production", "prod:mp-weixin": "uni build -p mp-weixin --mode production",
"build:app": "uni build -p app --mode production", "prod:app": "uni build -p app --mode production",
"build:custom": "uni build -p --mode production" "prod:custom": "uni build -p --mode production"
}, },
"dependencies": { "dependencies": {
"@dcloudio/uni-app": "3.0.0-alpha-3060920221114001", "@dcloudio/uni-app": "3.0.0-alpha-3060920221114001",

35
src/pages/deviceReport/addForm.vue

@ -5,22 +5,10 @@
<u-form-item label="故障描述" prop="describes" required> <u-form-item label="故障描述" prop="describes" required>
<u-input v-model="form.describes" placeholder="请输入故障描述" /> <u-input v-model="form.describes" placeholder="请输入故障描述" />
</u-form-item> </u-form-item>
<!-- <u-form-item label="所属厂区" prop="factoryAreaNumber" required>
<view class="select"
@click="openSingleColumn('factoryAreaNumber',form.factoryAreaNumber,factoryAreaList)">
<view class="input" v-if='form.factoryAreaNumber'>
{{selectFormat(form.factoryAreaNumber,factoryAreaList)}}
</view>
<view class="placeholder" v-else>
{{`请选择所属厂区`}}
</view>
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon>
</view>
</u-form-item> -->
<u-form-item label="类型" prop="type" required> <u-form-item label="类型" prop="type" required>
<view class="select" @click="openSingleColumn('type',form.type,appDeviceMoldType)"> <view class="select" @click="openSingleColumn('type',form.type,appDeviceMoldType)">
<view class="input" v-if='form.type'> <view class="input" v-if='form.type'>
{{selectFormat(form.type,appDeviceMoldType)}} {{form.typeName}}
</view> </view>
<view class="placeholder" v-else> <view class="placeholder" v-else>
{{`请选择类型`}} {{`请选择类型`}}
@ -28,17 +16,6 @@
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon> <u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon>
</view> </view>
</u-form-item> </u-form-item>
<!-- <u-form-item :label="`${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}`" prop="deviceNumber" required>
<view class="select" @click="openSingleColumn('deviceNumber',form.deviceNumber,deviceList)">
<view class="input" v-if='form.deviceNumber'>
{{selectFormat(form.deviceNumber,deviceList)}}
</view>
<view class="placeholder" v-else>
{{`请选择${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}`}}
</view>
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon>
</view>
</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>
<u-input v-model="form.deviceNumber" :placeholder="`请输入${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码`" <u-input v-model="form.deviceNumber" :placeholder="`请输入${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码`"
@blur="blur()" /> @blur="blur()" />
@ -109,12 +86,14 @@
deviceName: '', deviceName: '',
factoryAreaName: '', factoryAreaName: '',
factoryAreaNumber: '', factoryAreaNumber: '',
type: '' type: '',
typeName:''
}) })
const singleColumnShow = ref(false) const singleColumnShow = ref(false)
const singleColumnDefaultValue = ref([]) const singleColumnDefaultValue = ref([])
const singleColumnList = ref([]) const singleColumnList = ref([])
const imgList = ref([]) const imgList = ref([])
const field = ref('')
function chickRightButton(field) { function chickRightButton(field) {
if (!form.value.type) { if (!form.value.type) {
proxy.$modal.showToast('请先选择类型') proxy.$modal.showToast('请先选择类型')
@ -249,10 +228,6 @@ console.log(res)
form.value = {} form.value = {}
imgList.value = [] imgList.value = []
} }
function selectFormat(val, array) {
let str = array.filter(item => item.value == val)[0].label
return str
}
// //
function openSingleColumn(fieldName, val, list) { function openSingleColumn(fieldName, val, list) {
singleColumnList.value = list singleColumnList.value = list
@ -274,6 +249,7 @@ console.log(res)
} }
if (field.value == 'type') { if (field.value == 'type') {
type.value = form.value[field.value] type.value = form.value[field.value]
form.value.typeName = e[0].label
getDetailsByNumber() getDetailsByNumber()
} }
singleColumnShow.value = false singleColumnShow.value = false
@ -320,6 +296,7 @@ console.log(res)
appDeviceMoldTyp.value =appDeviceMoldType.value.filter((item => item.value == "MOLD")) appDeviceMoldTyp.value =appDeviceMoldType.value.filter((item => item.value == "MOLD"))
} }
form.value.type = appDeviceMoldType.value[0].value form.value.type = appDeviceMoldType.value[0].value
form.value.typeName = appDeviceMoldType.value[0].label
getFactoryAreaList() getFactoryAreaList()
}) })
</script> </script>

2
src/pages/overhaulOrder/addServiceRecord.vue

@ -99,7 +99,7 @@
<u-form-item :label="`备件`" prop="number" required> <u-form-item :label="`备件`" prop="number" required>
<view class="select" @click="openSingleColumn('number',form1.number,sparePartsList,'form1')"> <view class="select" @click="openSingleColumn('number',form1.number,sparePartsList,'form1')">
<view class="input" v-if='form1.number'> <view class="input" v-if='form1.number'>
{{selectFormat(form1.number,sparePartsList)}} {{form1.name}}
</view> </view>
<view class="placeholder" v-else> <view class="placeholder" v-else>
请选择备件 请选择备件

23
src/pages/repairOrder/addForm.vue

@ -8,7 +8,7 @@
<u-form-item label="类型" prop="type" required> <u-form-item label="类型" prop="type" required>
<view class="select" @click="openSingleColumn('type',form.type,appDeviceMoldType)"> <view class="select" @click="openSingleColumn('type',form.type,appDeviceMoldType)">
<view class="input" v-if='form.type'> <view class="input" v-if='form.type'>
{{selectFormat(form.type,appDeviceMoldType)}} {{form.typeName}}
</view> </view>
<view class="placeholder" v-else> <view class="placeholder" v-else>
{{`请选择类型`}} {{`请选择类型`}}
@ -50,7 +50,7 @@
<u-form-item label="班次" prop="classes" required> <u-form-item label="班次" prop="classes" required>
<view class="select" @click="openSingleColumn('classes',form.classes,maintenanceShift)"> <view class="select" @click="openSingleColumn('classes',form.classes,maintenanceShift)">
<view class="input" v-if='(form.classes||form.classes==0)&&maintenanceShift.length>0'> <view class="input" v-if='(form.classes||form.classes==0)&&maintenanceShift.length>0'>
{{selectFormat(form.classes,maintenanceShift)}} {{form.classesName}}
</view> </view>
<view class="placeholder" v-else> <view class="placeholder" v-else>
{{`请选择班次`}} {{`请选择班次`}}
@ -61,7 +61,7 @@
<u-form-item label="故障类型" prop="classes" required> <u-form-item label="故障类型" prop="classes" required>
<view class="select" @click="openSingleColumn('faultType',form.faultType,faultType)"> <view class="select" @click="openSingleColumn('faultType',form.faultType,faultType)">
<view class="input" v-if='form.faultType'> <view class="input" v-if='form.faultType'>
{{selectFormat(form.faultType,faultType)}} {{form.faultTypeName}}
</view> </view>
<view class="placeholder" v-else> <view class="placeholder" v-else>
{{`请选择故障类型`}} {{`请选择故障类型`}}
@ -265,15 +265,7 @@
form.value = {} form.value = {}
} }
} }
//
function selectFormat(val, array) {
if (array.length > 0) {
let str = array.filter(item => item.value == val)[0].label
return str
} else {
return ''
}
}
// //
function openSingleColumn(fieldName, val, list) { function openSingleColumn(fieldName, val, list) {
if ((fieldName == 'deviceNumber' || fieldName == 'type') && form.value.id) return; if ((fieldName == 'deviceNumber' || fieldName == 'type') && form.value.id) return;
@ -294,6 +286,12 @@
form.value.factoryAreaName = choosesingleColumnItem.value[0].factoryAreaName form.value.factoryAreaName = choosesingleColumnItem.value[0].factoryAreaName
form.value.factoryAreaNumber = choosesingleColumnItem.value[0].factoryAreaNumber form.value.factoryAreaNumber = choosesingleColumnItem.value[0].factoryAreaNumber
form.value.deviceName = choosesingleColumnItem.value[0].name form.value.deviceName = choosesingleColumnItem.value[0].name
}else if(field.value == 'classes'){
form.value.classesName =e[0].label
}else if(field.value == 'faultType'){
form.value.faultTypeName =e[0].label
}else if(field.value == 'type'){
form.value.typeName =e[0].label
} }
singleColumnShow.value = false singleColumnShow.value = false
} }
@ -345,6 +343,7 @@
} }
form.value.type = appDeviceMoldType.value[0].value form.value.type = appDeviceMoldType.value[0].value
form.value.typeName = appDeviceMoldType.value[0].label
faultType.value = await dictApi.getDict('fault_type') faultType.value = await dictApi.getDict('fault_type')
}) })
</script> </script>

4
src/pages/repairOrder/addServiceRecord.vue

@ -262,10 +262,6 @@
form.value.maintenances = chooseUserList.value.join(',') form.value.maintenances = chooseUserList.value.join(',')
isShowSelecUser.value = false isShowSelecUser.value = false
} }
// function selectFormat(val, array) {
// let str = array.filter(item => item.value == val)[0].label
// return str
// }
// //
function openSingleColumn(fieldName, val, list) { function openSingleColumn(fieldName, val, list) {
if (fieldName == 'deviceNumber' && form.value.id) return; if (fieldName == 'deviceNumber' && form.value.id) return;

6
src/pages/sparePartsApplication/addForm.vue

@ -296,12 +296,6 @@
proxy.$modal.showToast('数量不可以大于库存') proxy.$modal.showToast('数量不可以大于库存')
return; return;
} }
// if (form1.value.itemNumber) {
// form1.value.name = this.selectFormat(this.form1.itemNumber, this.sparePartsList)
// }
// if (this.form1.deviceNumber) {
// this.form1.deviceName = this.selectFormat(this.form1.deviceNumber, this.deviceList)
// }
if (form.valuesubList && form.value.subList.length > 0) { if (form.valuesubList && form.value.subList.length > 0) {
let arr = form.value.subList.filter(item => item.itemNumber == form1.value.itemNumber) let arr = form.value.subList.filter(item => item.itemNumber == form1.value.itemNumber)
if (arr && arr.length > 0) { if (arr && arr.length > 0) {

5
src/pages/spotCheckOrder/addForm.vue

@ -206,10 +206,7 @@
classes: '' classes: ''
} }
} }
function selectFormat(val, array) {
let str = array.filter(item => item.value == val)[0].label
return str
}
// //
function openSingleColumn(fieldName, val, list) { function openSingleColumn(fieldName, val, list) {
singleColumnList.value = list singleColumnList.value = list

9
src/pages/upkeepOrder/addServiceRecord.vue

@ -1,7 +1,7 @@
<template> <template>
<!-- 添加维修工单 --> <!-- 添加维修工单 -->
<view class="add-form-container"> <view class="add-form-container">
<u-form :model="form" ref="form1" label-width="160rpx"> <u-form :model="form" ref="formRef" label-width="160rpx">
<u-form-item label="保养内容" prop="contents" required class="disabled"> <u-form-item label="保养内容" prop="contents" required class="disabled">
<u-input v-model="form.contents" placeholder="请输入保养内容" maxlength="50" disabled/> <u-input v-model="form.contents" placeholder="请输入保养内容" maxlength="50" disabled/>
</u-form-item> </u-form-item>
@ -31,7 +31,7 @@
<u-form-item label="完成情况" prop="status" required> <u-form-item label="完成情况" prop="status" required>
<view class="select" @click="openSingleColumn('status',form.status,jxDetailsStatus,'form')"> <view class="select" @click="openSingleColumn('status',form.status,jxDetailsStatus,'form')">
<view class="input" v-if='form.status'> <view class="input" v-if='form.status'>
{{selectFormat(form.status,jxDetailsStatus)}} {{form.statusTxt}}
</view> </view>
<view class="placeholder" v-else> <view class="placeholder" v-else>
{{`请选择完成情况`}} {{`请选择完成情况`}}
@ -98,11 +98,11 @@
<u-popup v-model="isPopupShow" mode="center" border-radius="14"> <u-popup v-model="isPopupShow" mode="center" border-radius="14">
<view class="popup-title">添加备件</view> <view class="popup-title">添加备件</view>
<view class="popup"> <view class="popup">
<u-form :model="form1" ref="form1" label-width="160rpx"> <u-form :model="form1" ref="form1Ref" label-width="160rpx">
<u-form-item :label="`备件`" prop="number" required> <u-form-item :label="`备件`" prop="number" required>
<view class="select" @click="openSingleColumn('number',form1.number,sparePartsList,'form1')"> <view class="select" @click="openSingleColumn('number',form1.number,sparePartsList,'form1')">
<view class="input" v-if='form1.number'> <view class="input" v-if='form1.number'>
{{selectFormat(form1.number,sparePartsList)}} {{form1.name}}
</view> </view>
<view class="placeholder" v-else> <view class="placeholder" v-else>
请选择备件 请选择备件
@ -354,7 +354,6 @@ const form = ref({
function chooseSingleColumn(e) { function chooseSingleColumn(e) {
if(whichForm.value == 'form'){ if(whichForm.value == 'form'){
form.value[field.value] = e[0].value form.value[field.value] = e[0].value
if(field.value=='status'){ if(field.value=='status'){
form.value.statusTxt = e[0].label form.value.statusTxt = e[0].label
} }

Loading…
Cancel
Save