|
|
@ -5,21 +5,21 @@ |
|
|
|
<u-form-item label="故障描述" prop="describes" required> |
|
|
|
<u-input v-model="form.describes" placeholder="请输入故障描述" :disabled="form&&form.id?true:false" /> |
|
|
|
</u-form-item> |
|
|
|
<u-form-item label="类型" prop="receiverType" required> |
|
|
|
<view class="select" @click="openSingleColumn('receiverType',form.receiverType,appDeviceMoldType)"> |
|
|
|
<view class="input" v-if='form.receiverType'> |
|
|
|
{{selectFormat(form.receiverType,appDeviceMoldType)}} |
|
|
|
<u-form-item label="类型" prop="type" required> |
|
|
|
<view class="select" @click="openSingleColumn('type',form.type,appDeviceMoldType)"> |
|
|
|
<view class="input" v-if='form.type'> |
|
|
|
{{selectFormat(form.type,appDeviceMoldType)}} |
|
|
|
</view> |
|
|
|
<view class="placeholder" v-else> |
|
|
|
{{`请选择类型`}} |
|
|
|
</view> |
|
|
|
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon> |
|
|
|
<u-icon name="arrow-right" color="#aaaaaa" size="28" v-if="!form.id"></u-icon> |
|
|
|
</view> |
|
|
|
</u-form-item> |
|
|
|
<u-form-item :label="`${type=='DEVICE'?'设备' : '模具'}名称`" prop="deviceNumber" required> |
|
|
|
<view class="select" @click="openSingleColumn('deviceNumber',form.deviceNumber,deviceList)"> |
|
|
|
<view class="input" v-if='form.deviceNumber'> |
|
|
|
{{selectFormat(form.deviceNumber,deviceList)}} |
|
|
|
<view class="input" v-if='form.deviceName'> |
|
|
|
{{form.deviceName}} |
|
|
|
</view> |
|
|
|
<view class="placeholder" v-else> |
|
|
|
{{`请输入${type=='DEVICE'?'设备' : '模具'}名称`}} |
|
|
@ -32,7 +32,7 @@ |
|
|
|
</u-form-item> |
|
|
|
<u-form-item label="班次" prop="classes" required> |
|
|
|
<view class="select" @click="openSingleColumn('classes',form.classes,maintenanceShift)"> |
|
|
|
<view class="input" v-if='form.classes'> |
|
|
|
<view class="input" v-if='form.classes||form.classes==0'> |
|
|
|
{{selectFormat(form.classes,maintenanceShift)}} |
|
|
|
</view> |
|
|
|
<view class="placeholder" v-else> |
|
|
@ -86,6 +86,7 @@ |
|
|
|
factoryAreaName: '', |
|
|
|
factoryAreaNumber: '', |
|
|
|
classes: '', |
|
|
|
type:'', |
|
|
|
faultType: '' |
|
|
|
}, |
|
|
|
deviceList: [], //设备列表 |
|
|
@ -120,7 +121,7 @@ |
|
|
|
const data = { |
|
|
|
id: this.form && this.form.id ? this.form.id : '', |
|
|
|
describes: this.form.describes, |
|
|
|
receiverType: this.form.receiverType, |
|
|
|
type: this.form.type, |
|
|
|
deviceNumber: this.form.deviceNumber, |
|
|
|
factoryAreaNumber: this.form.factoryAreaNumber, |
|
|
|
classes: this.form.classes, |
|
|
@ -193,7 +194,7 @@ |
|
|
|
}, |
|
|
|
// 单列模式 |
|
|
|
openSingleColumn(field, val, list) { |
|
|
|
if (field == 'deviceNumber' && this.form.id) return; |
|
|
|
if ((field == 'deviceNumber' || field == 'type') && this.form.id) return; |
|
|
|
this.singleColumnList = list |
|
|
|
this.field = field |
|
|
|
if (val) { |
|
|
@ -208,9 +209,10 @@ |
|
|
|
this.form[this.field] = e[0].value |
|
|
|
if (this.field == 'deviceNumber') { |
|
|
|
this.choosesingleColumnItem = this.singleColumnList.filter(item => item.number == e[0].value) |
|
|
|
console.log(this.choosesingleColumnItem) |
|
|
|
this.form.factoryAreaName = this.choosesingleColumnItem[0].factoryAreaName |
|
|
|
this.form.factoryAreaNumber = this.choosesingleColumnItem[0].factoryAreaNumber |
|
|
|
// this.form.deviceNumber = e[0].value |
|
|
|
this.form.deviceName = this.choosesingleColumnItem[0].name |
|
|
|
} |
|
|
|
this.singleColumnShow = false |
|
|
|
this.$emit('singleColumn', this.field, this.form[this.field]) |
|
|
@ -225,6 +227,7 @@ |
|
|
|
item.label = item.name |
|
|
|
}) |
|
|
|
this.deviceList = res.data |
|
|
|
// console.log(22,this.deviceList) |
|
|
|
}) |
|
|
|
}else if(this.type == 'MOLD'){ |
|
|
|
await moldApi.moldList().then(res => { |
|
|
@ -249,10 +252,11 @@ |
|
|
|
deviceName: data.name, |
|
|
|
factoryAreaName: data.factoryAreaName, |
|
|
|
factoryAreaNumber: data.factoryAreaNumber, |
|
|
|
classes: data.classes ? data.classes : '', |
|
|
|
classes: data.classes|| data.classes == 0? data.classes : undefined, |
|
|
|
faultType: data.faultType, |
|
|
|
// faultTypeName:data.faultTypeName, |
|
|
|
type: data.type |
|
|
|
} |
|
|
|
console.log(this.form) |
|
|
|
}; |
|
|
|
await this.getDeviceList() |
|
|
|
this.maintenanceShift = await dictApi.getDict('maintenance_shift') |
|
|
|