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