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