|
|
@ -19,12 +19,12 @@ |
|
|
|
</view> |
|
|
|
<u-row gutter="16"> |
|
|
|
<u-col :span="24"> |
|
|
|
<view class="dec"> |
|
|
|
类型:{{`${item.type=='DEVICE'?'设备' : '模具'}`}} |
|
|
|
<view class="dec" v-if="item.type"> |
|
|
|
类型:{{`${item.type=='DEVICE'?'设备' :item.type=='MOLD'?'模具' : ''}`}} |
|
|
|
</view> |
|
|
|
</u-col> |
|
|
|
<u-col :span="24"> |
|
|
|
<view class="dec"> |
|
|
|
<view class="dec" v-if="item.deviceName"> |
|
|
|
{{`${item.type=='DEVICE'?'设备' : '模具'}`}}:{{item.deviceName}} |
|
|
|
</view> |
|
|
|
</u-col> |
|
|
@ -75,7 +75,7 @@ |
|
|
|
<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" > |
|
|
|
<view class="select" @click="openSingleColumn('type',form1.type,deviceMoldType)"> |
|
|
|
<view class="input" v-if='form1.type'> |
|
|
|
{{selectFormat(form1.type,deviceMoldType)}} |
|
|
@ -86,7 +86,7 @@ |
|
|
|
<u-icon name="arrow-right" color="#aaaaaa" size="28"></u-icon> |
|
|
|
</view> |
|
|
|
</u-form-item> |
|
|
|
<u-form-item :label="`${form1.type=='DEVICE'?'设备' : '模具'}`" prop="deviceNumber" required> |
|
|
|
<u-form-item :label="`${form1.type=='DEVICE'?'设备' : '模具'}`" prop="deviceNumber" > |
|
|
|
<view class="select" @click="openSingleColumn('deviceNumber',form1.deviceNumber,deviceList)"> |
|
|
|
<view class="input" v-if='form1.deviceNumber'> |
|
|
|
{{selectFormat(form1.deviceNumber,deviceList)}} |
|
|
@ -149,9 +149,9 @@ |
|
|
|
subList:[] |
|
|
|
}, |
|
|
|
form1: { |
|
|
|
itemNumber: "", |
|
|
|
itemNumber: undefined, |
|
|
|
type:'', |
|
|
|
deviceNumber: '', |
|
|
|
deviceNumber: undefined, |
|
|
|
isRadeIn: '', |
|
|
|
currentQty: '', |
|
|
|
qty: '' |
|
|
@ -225,7 +225,7 @@ |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.selecUserList = res.data |
|
|
|
}) |
|
|
|
}).catch(()=>{}) |
|
|
|
}, |
|
|
|
selectFormat(val, array) { |
|
|
|
let str = array.filter(item => item.value == val)[0].label |
|
|
@ -266,11 +266,10 @@ |
|
|
|
item.label = item.name |
|
|
|
}) |
|
|
|
this.sparePartsList = res.data |
|
|
|
}) |
|
|
|
}).catch(()=>{}) |
|
|
|
}, |
|
|
|
// 获取设备列表 |
|
|
|
async getApplyDeviceList() { |
|
|
|
console.log(this.form1.type) |
|
|
|
if (this.form1.type == 'DEVICE') { |
|
|
|
await deviceApi.getApplyDeviceList().then(res => { |
|
|
|
res.data.map(item => { |
|
|
@ -278,7 +277,7 @@ |
|
|
|
item.label = item.name |
|
|
|
}) |
|
|
|
this.deviceList = res.data |
|
|
|
}) |
|
|
|
}).catch(()=>{}) |
|
|
|
} else if (this.form1.type == 'MOLD') { |
|
|
|
moldApi.getApplyMoldList().then((res) => { |
|
|
|
res.data.map(item => { |
|
|
@ -286,15 +285,15 @@ |
|
|
|
item.label = item.name |
|
|
|
}) |
|
|
|
this.deviceList = res.data |
|
|
|
}) |
|
|
|
}).catch(()=>{}) |
|
|
|
} |
|
|
|
}, |
|
|
|
// 打开弹窗 |
|
|
|
open() { |
|
|
|
this.form1 = { |
|
|
|
itemNumber: "", |
|
|
|
itemNumber:undefined, |
|
|
|
type:'', |
|
|
|
deviceNumber: '', |
|
|
|
deviceNumber: undefined, |
|
|
|
isRadeIn: '', |
|
|
|
currentQty: "", |
|
|
|
qty: '', |
|
|
@ -307,10 +306,10 @@ |
|
|
|
this.$modal.showToast('请选择备件') |
|
|
|
return; |
|
|
|
} |
|
|
|
if (!this.form1.deviceNumber) { |
|
|
|
this.$modal.showToast('请选择设备') |
|
|
|
return; |
|
|
|
} |
|
|
|
// if (!this.form1.deviceNumber) { |
|
|
|
// this.$modal.showToast('请选择设备') |
|
|
|
// return; |
|
|
|
// } |
|
|
|
if (!this.form1.qty || this.form1.qty==0) { |
|
|
|
this.$modal.showToast('请输入数量') |
|
|
|
return; |
|
|
@ -319,8 +318,12 @@ |
|
|
|
this.$modal.showToast('数量不可以大于库存') |
|
|
|
return; |
|
|
|
} |
|
|
|
if(this.form1.itemNumber){ |
|
|
|
this.form1.name = this.selectFormat(this.form1.itemNumber, this.sparePartsList) |
|
|
|
this.form1.deviceName = this.selectFormat(this.form1.deviceNumber, this.deviceList) |
|
|
|
} |
|
|
|
if(this.form1.deviceNumber){ |
|
|
|
this.form1.deviceName = this.selectFormat(this.form1.deviceNumber, this.deviceList) |
|
|
|
} |
|
|
|
if (this.form.subList && this.form.subList.length > 0) { |
|
|
|
let arr = this.form.subList.filter(item => item.itemNumber == this.form1.itemNumber) |
|
|
|
if (arr && arr.length > 0) { |
|
|
@ -348,7 +351,6 @@ |
|
|
|
this.$set(this.form, 'subList', this.form.subList) |
|
|
|
}; |
|
|
|
this.deviceMoldType = await dictApi.getDict('device_mold_type') |
|
|
|
console.log(this.deviceMoldType) |
|
|
|
await this.getApplySparePartsList() |
|
|
|
} |
|
|
|
} |
|
|
|