|
|
@ -36,17 +36,17 @@ |
|
|
|
<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="`${form.receiverType=='DEVICE'||form.receiverType == 'TECH'?'设备' : '模具'}编码`" prop="deviceNumber" required |
|
|
|
v-if="form.status==0"> |
|
|
|
<u-input v-model="form.deviceNumber" :placeholder="`请输入${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码`" |
|
|
|
<u-input v-model="form.deviceNumber" :placeholder="`请输入${form.receiverType=='DEVICE'||form.receiverType == 'TECH'?'设备' : '模具'}编码`" |
|
|
|
@blur="blur()" /> |
|
|
|
<view class="right-button" @click="chickRightButton"> |
|
|
|
扫描 |
|
|
|
</view> |
|
|
|
</u-form-item> |
|
|
|
<u-form-item :label="`${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}名称`" prop="deviceNumber" required |
|
|
|
<u-form-item :label="`${form.receiverType=='DEVICE'||form.receiverType == 'TECH'?'设备' : '模具'}名称`" prop="deviceNumber" required |
|
|
|
class="disabled" v-if="form.status==0"> |
|
|
|
<u-input v-model="form.deviceName" :placeholder="`根据${type=='DEVICE'||type == 'TECH'?'设备' : '模具'}编码获得`" |
|
|
|
<u-input v-model="form.deviceName" :placeholder="`根据${form.receiverType=='DEVICE'||form.receiverType == 'TECH'?'设备' : '模具'}编码获得`" |
|
|
|
disabled /> |
|
|
|
</u-form-item> |
|
|
|
<u-form-item label="维修人员" prop="describes" required> |
|
|
@ -150,7 +150,7 @@ |
|
|
|
} |
|
|
|
if (form.value.status == 0) { |
|
|
|
if (!form.value.deviceNumber) { |
|
|
|
proxy.$modal.showToast(`请选择${type.value == 'DEVICE' || type.value == 'TECH' ? '设备' : '模具'}编码`) |
|
|
|
proxy.$modal.showToast(`请选择${form.value.receiverType == 'DEVICE' || form.value.receiverType == 'TECH' ? '设备' : '模具'}编码`) |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -258,16 +258,18 @@ |
|
|
|
form.value.factoryAreaName = '' |
|
|
|
form.value.factoryAreaNumber = '' |
|
|
|
selecUserList.value = [] |
|
|
|
form.value.receiverUserId = '' |
|
|
|
}) |
|
|
|
} else if (form.value.receiverType == 'MOLD') { |
|
|
|
moldApi.getMoldDetailsByNumber({ |
|
|
|
number: form.deviceNumber |
|
|
|
number: form.value.deviceNumber, |
|
|
|
}).then(async (res) => { |
|
|
|
if (!res.data) { |
|
|
|
form.value.deviceName = '' |
|
|
|
form.value.factoryAreaName = '' |
|
|
|
form.value.factoryAreaNumber = '' |
|
|
|
selecUserList.value = [] |
|
|
|
form.value.receiverUserId = '' |
|
|
|
return; |
|
|
|
} |
|
|
|
form.value.deviceName = res.data.name |
|
|
@ -279,6 +281,7 @@ |
|
|
|
form.value.factoryAreaName = '' |
|
|
|
form.value.factoryAreaNumber = '' |
|
|
|
selecUserList.value = [] |
|
|
|
form.value.receiverUserId = '' |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
@ -298,14 +301,16 @@ |
|
|
|
function chooseSingleColumn(e) { |
|
|
|
form.value[field.value] = e[0].value |
|
|
|
if (field.value == 'receiverType') { |
|
|
|
type.value = form.value[field.value] |
|
|
|
form.value.deviceName = '' |
|
|
|
form.value.deviceNumber = '' |
|
|
|
form.value.receiverUserId = undefined |
|
|
|
form.value.receiverTypeTxt = e[0].label |
|
|
|
selecUserList.value = [] |
|
|
|
form.value.receiverUserId = '' |
|
|
|
getDeviceList() |
|
|
|
} else if (field.value == 'factoryAreaNumber') { |
|
|
|
form.value.factoryAreaName = e[0].label |
|
|
|
form.value.receiverUserId = '' |
|
|
|
|
|
|
|
getSelecUser() |
|
|
|
} else if (field.value == 'status') { |
|
|
@ -318,13 +323,15 @@ |
|
|
|
console.log(deviceMoldType.value) |
|
|
|
form.value.receiverType = deviceMoldType.value[0].value |
|
|
|
form.value.receiverTypeTxt = deviceMoldType.value[0].label |
|
|
|
selecUserList.value = [] |
|
|
|
form.value.receiverUserId = '' |
|
|
|
} |
|
|
|
singleColumnShow.value = false |
|
|
|
} |
|
|
|
|
|
|
|
// 获取设备/模具列表 |
|
|
|
async function getDeviceList() { |
|
|
|
if (type.value == 'DEVICE' || type.value == 'TECH') { |
|
|
|
if (form.value.receiverType == 'DEVICE' || form.value.receiverType == 'TECH') { |
|
|
|
await deviceApi.deviceList().then(res => { |
|
|
|
res.data.map(item => { |
|
|
|
item.value = item.number |
|
|
@ -332,7 +339,7 @@ |
|
|
|
}) |
|
|
|
deviceList.value = res.data |
|
|
|
}) |
|
|
|
} else if (type.value == 'MOLD') { |
|
|
|
} else if (form.value.receiverType == 'MOLD') { |
|
|
|
await moldApi.moldList().then(res => { |
|
|
|
res.data.map(item => { |
|
|
|
item.value = item.number |
|
|
@ -346,7 +353,7 @@ |
|
|
|
// 获取人员列表 |
|
|
|
async function getSelecUser() { |
|
|
|
let data = { |
|
|
|
classType: type.value, |
|
|
|
classType: form.value.receiverType, |
|
|
|
factoryAreaNumber: form.value.factoryAreaNumber, |
|
|
|
} |
|
|
|
let arr = [] |
|
|
|