|
@ -5,18 +5,27 @@ |
|
|
<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="`${type=='DEVICE'?'设备' : '模具'}编码`" prop="deviceNumber" required> |
|
|
<u-form-item label="所属厂区" prop="factoryAreaNumber" required> |
|
|
<u-input v-model="form.deviceNumber" |
|
|
<view class="select" @click="openSingleColumn('factoryAreaNumber',form.factoryAreaNumber,factoryAreaList)"> |
|
|
:placeholder="`请输入${type=='DEVICE'?'设备' : '模具'}编码`" disabled/> |
|
|
<view class="input" v-if='form.factoryAreaNumber'> |
|
|
<view class="right-button" @click="chickRightButton"> |
|
|
{{selectFormat(form.factoryAreaNumber,factoryAreaList)}} |
|
|
扫描 |
|
|
</view> |
|
|
|
|
|
<view class="placeholder" v-else> |
|
|
|
|
|
{{`请选择所属厂区`}} |
|
|
|
|
|
</view> |
|
|
|
|
|
<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'?'设备' : '模具'}名称`" prop="deviceName" required class="disabled"> |
|
|
<u-form-item :label="`${type=='DEVICE'?'设备' : '模具'}`" prop="deviceNumber" required> |
|
|
<u-input v-model="form.deviceName" :placeholder="`请输入${type=='DEVICE'?'设备' : '模具'}名称`" disabled /> |
|
|
<view class="select" @click="openSingleColumn('deviceNumber',form.deviceNumber,deviceList)"> |
|
|
</u-form-item> |
|
|
<view class="input" v-if='form.deviceNumber'> |
|
|
<u-form-item label="所属厂区" prop="factoryAreaName" required class="disabled"> |
|
|
{{selectFormat(form.deviceNumber,deviceList)}} |
|
|
<u-input v-model="form.factoryAreaName" placeholder="请输入所属厂区" disabled /> |
|
|
</view> |
|
|
|
|
|
<view class="placeholder" v-else> |
|
|
|
|
|
{{`请选择${type=='DEVICE'?'设备' : '模具'}`}} |
|
|
|
|
|
</view> |
|
|
|
|
|
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon> |
|
|
|
|
|
</view> |
|
|
</u-form-item> |
|
|
</u-form-item> |
|
|
<u-form-item label="类型" prop="receiverType" required> |
|
|
<u-form-item label="类型" prop="receiverType" required> |
|
|
<view class="select" @click="openSingleColumn('receiverType',form.receiverType,appDeviceMoldType)"> |
|
|
<view class="select" @click="openSingleColumn('receiverType',form.receiverType,appDeviceMoldType)"> |
|
@ -59,6 +68,7 @@ |
|
|
import * as moldApi from "@/api/mold.js" |
|
|
import * as moldApi from "@/api/mold.js" |
|
|
import * as dictApi from "@/api/dict.js" |
|
|
import * as dictApi from "@/api/dict.js" |
|
|
import * as uploadApi from "@/api/upload.js" |
|
|
import * as uploadApi from "@/api/upload.js" |
|
|
|
|
|
import * as deptApi from "@/api/dept.js" |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
data() { |
|
|
data() { |
|
@ -66,6 +76,8 @@ |
|
|
loading: false, |
|
|
loading: false, |
|
|
type: "", |
|
|
type: "", |
|
|
appDeviceMoldType: [], |
|
|
appDeviceMoldType: [], |
|
|
|
|
|
factoryAreaList:[],//工厂列表 |
|
|
|
|
|
deviceList:[],//设备列表 |
|
|
form: { |
|
|
form: { |
|
|
describes: "", |
|
|
describes: "", |
|
|
deviceNumber: '', |
|
|
deviceNumber: '', |
|
@ -95,30 +107,44 @@ |
|
|
this.getDetailsByNumber() |
|
|
this.getDetailsByNumber() |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
// 获取厂区列表 |
|
|
|
|
|
getFactoryAreaList() { |
|
|
|
|
|
deptApi.getFactoryAreaList().then((res) => { |
|
|
|
|
|
if (res.data&&res.data.length>0) { |
|
|
|
|
|
res.data.map(item => { |
|
|
|
|
|
item.value = item.id |
|
|
|
|
|
item.label = item.name |
|
|
|
|
|
}) |
|
|
|
|
|
this.factoryAreaList = res.data |
|
|
|
|
|
} else{ |
|
|
|
|
|
this.factoryAreaList =[] |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
// 根据设备/模具号查询信息 |
|
|
// 根据设备/模具号查询信息 |
|
|
getDetailsByNumber() { |
|
|
getDetailsByNumber() { |
|
|
const data = { |
|
|
|
|
|
number: this.form.deviceNumber, |
|
|
|
|
|
id: '' |
|
|
|
|
|
} |
|
|
|
|
|
if (this.type == 'DEVICE') { |
|
|
if (this.type == 'DEVICE') { |
|
|
deviceApi.getDeviceDetailsByNumber(data).then((res) => { |
|
|
deviceApi.getDeviceByFactoryAreaNumber(this.form.factoryAreaNumber).then((res) => { |
|
|
if (res.data) { |
|
|
if (res.data&&res.data.length>0) { |
|
|
this.form.deviceName = res.data.name |
|
|
res.data.map(item => { |
|
|
this.form.factoryAreaName = res.data.factoryAreaName |
|
|
item.value = item.number |
|
|
this.form.factoryAreaNumber = res.data.factoryAreaNumber |
|
|
item.label = item.name |
|
|
|
|
|
}) |
|
|
|
|
|
this.deviceList = res.data |
|
|
}else{ |
|
|
}else{ |
|
|
this.$modal.showToast(`找不到该${this.type=='DEVICE'?'设备' : '模具'}`) |
|
|
this.deviceList = [] |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} else if (this.type == 'MOLD') { |
|
|
} else if (this.type == 'MOLD') { |
|
|
moldApi.getMoldDetailsByNumber(data).then((res) => { |
|
|
moldApi.getMoldByFactoryAreaNumber(this.form.factoryAreaNumber).then((res) => { |
|
|
if (res.data) { |
|
|
if (res.data&&res.data.length>0) { |
|
|
this.form.deviceName = res.data.name |
|
|
res.data.map(item => { |
|
|
this.form.factoryAreaName = res.data.factoryAreaName |
|
|
item.value = item.number |
|
|
this.form.factoryAreaNumber = res.data.factoryAreaNumber |
|
|
item.label = item.name |
|
|
|
|
|
}) |
|
|
|
|
|
this.deviceList = res.data |
|
|
}else{ |
|
|
}else{ |
|
|
this.$modal.showToast(`找不到该${this.type=='DEVICE'?'设备' : '模具'}`) |
|
|
this.deviceList = [] |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
@ -130,16 +156,16 @@ |
|
|
this.$modal.showToast('请输入故障描述') |
|
|
this.$modal.showToast('请输入故障描述') |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
if (!this.form.deviceNumber) { |
|
|
if (!this.form.factoryAreaNumber) { |
|
|
this.$modal.showToast(`请输入${this.type=='DEVICE'?'设备' : '模具'}编码`) |
|
|
this.$modal.showToast(`请选择选择所属厂区`) |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
if (!this.form.deviceName) { |
|
|
if (!this.form.deviceNumber) { |
|
|
this.$modal.showToast(`请输入${this.type=='DEVICE'?'设备' : '模具'}名称`) |
|
|
this.$modal.showToast(`请选择${this.type=='DEVICE'?'设备' : '模具'}`) |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
if (!this.form.factoryAreaName) { |
|
|
if (!this.form.receiverType) { |
|
|
this.$modal.showToast('请输入所属厂区') |
|
|
this.$modal.showToast(`请选择类型'}`) |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
if (this.imgList.length == 0) { |
|
|
if (this.imgList.length == 0) { |
|
@ -150,6 +176,7 @@ |
|
|
describes: this.form.describes, |
|
|
describes: this.form.describes, |
|
|
deviceNumber: this.form.deviceNumber, |
|
|
deviceNumber: this.form.deviceNumber, |
|
|
factoryAreaNumber: this.form.factoryAreaNumber, |
|
|
factoryAreaNumber: this.form.factoryAreaNumber, |
|
|
|
|
|
receiverType: this.form.receiverType, |
|
|
type: this.type, |
|
|
type: this.type, |
|
|
filePathList: this.imgList, |
|
|
filePathList: this.imgList, |
|
|
} |
|
|
} |
|
@ -197,6 +224,11 @@ |
|
|
// 单列模式点击确定之后 |
|
|
// 单列模式点击确定之后 |
|
|
chooseSingleColumn(e) { |
|
|
chooseSingleColumn(e) { |
|
|
this.form[this.field] = e[0].value |
|
|
this.form[this.field] = e[0].value |
|
|
|
|
|
if(this.field == 'factoryAreaNumber'){ |
|
|
|
|
|
this.form.deviceNumber = '' |
|
|
|
|
|
this.form.deviceName = '' |
|
|
|
|
|
this.getDetailsByNumber() |
|
|
|
|
|
} |
|
|
this.singleColumnShow = false |
|
|
this.singleColumnShow = false |
|
|
this.$emit('singleColumn', this.field, this.form[this.field]) |
|
|
this.$emit('singleColumn', this.field, this.form[this.field]) |
|
|
this.$forceUpdate() |
|
|
this.$forceUpdate() |
|
@ -233,6 +265,8 @@ |
|
|
async onLoad(option) { |
|
|
async onLoad(option) { |
|
|
if (option.type) this.type = option.type; |
|
|
if (option.type) this.type = option.type; |
|
|
this.appDeviceMoldType = await dictApi.getDict('app_device_mold_type') |
|
|
this.appDeviceMoldType = await dictApi.getDict('app_device_mold_type') |
|
|
|
|
|
this.appDeviceMoldType = this.appDeviceMoldType.filter((item=>item.value!="MOLD")) |
|
|
|
|
|
this.getFactoryAreaList() |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|