|
@@ -30,6 +30,13 @@
|
|
|
</a-select>
|
|
|
</a-form-model-item>
|
|
|
</a-col>
|
|
|
+ <a-col :md="8" :sm="24" >
|
|
|
+ <a-form-model-item label="计量单位组" prop='uomName' >
|
|
|
+ <a-select style="width:100%;" v-model="form.uomName" @change="changeUnitArr">
|
|
|
+ <a-select-option v-for="(val,index) in unitArrOptions" allowClear :key="index" :value="val.name">{{ val.name }}</a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-col>
|
|
|
<a-col :md="8" :sm="24" >
|
|
|
<a-form-model-item label="料品主单位" prop='unit' >
|
|
|
<a-input-search placeholder="请输入" readonly v-model="form.unit" @search="searchUnit('unit')"></a-input-search>
|
|
@@ -101,7 +108,8 @@
|
|
|
form:{},
|
|
|
loading:false,
|
|
|
defaultMethod:'add',
|
|
|
- unitOptions:[],
|
|
|
+ // unitOptions:[],
|
|
|
+ unitArrOptions:[],
|
|
|
rules:{
|
|
|
inventoryName: [
|
|
|
{ required: true, trigger: 'blur' },
|
|
@@ -138,11 +146,21 @@
|
|
|
this.form = {}
|
|
|
this.visible=false
|
|
|
this.defaultMethod='add'
|
|
|
+ this.unitArrOptions = []
|
|
|
},
|
|
|
- getOptionUnit(){
|
|
|
- getAction('/production/safetyStock/selectUnit').then((res) => {
|
|
|
+ // getOptionUnit(){
|
|
|
+ // getAction('/production/safetyStock/selectUnit').then((res) => {
|
|
|
+ // if (res.success) {
|
|
|
+ // this.unitOptions = res.result
|
|
|
+ // } else {
|
|
|
+ // this.$message.error(res.message);
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+ getOptionUnitArr(){
|
|
|
+ getAction('/production/safetyStock/selectEnumValue').then((res) => {
|
|
|
if (res.success) {
|
|
|
- this.unitOptions = res.result
|
|
|
+ this.unitArrOptions = res.result
|
|
|
} else {
|
|
|
this.$message.error(res.message);
|
|
|
}
|
|
@@ -213,14 +231,29 @@
|
|
|
this.$refs.ClassNamePopup.getData()
|
|
|
},
|
|
|
searchUnit(data){
|
|
|
+ if(this.form.uomCode==''||!this.form.uomCode){
|
|
|
+ this.$message.warning("请先选择计量单位组")
|
|
|
+ }else{
|
|
|
this.$refs.unitPopup.visible = true
|
|
|
- this.$refs.unitPopup.getData()
|
|
|
+ this.$refs.unitPopup.getData('',this.form.uomCode)
|
|
|
this.$refs.unitPopup.whatUnit = data
|
|
|
+ }
|
|
|
},
|
|
|
- changeUnit(data){
|
|
|
- this.unitOptions.map(item=>{
|
|
|
- if(item.Name==data){
|
|
|
- this.form.unitId = item.ID
|
|
|
+ // changeUnit(data){
|
|
|
+ // this.unitOptions.map(item=>{
|
|
|
+ // if(item.Name==data){
|
|
|
+ // this.form.unitId = item.ID
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+ changeUnitArr(data){
|
|
|
+ this.unitArrOptions.map(item=>{
|
|
|
+ if(item.name==data){
|
|
|
+ this.form.uomCode = item.code
|
|
|
+ this.form.unit=''
|
|
|
+ this.form.unitId=''
|
|
|
+ this.form.auxiliaryUnit=''
|
|
|
+ this.form.auxiliaryUnitId=''
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -233,13 +266,13 @@
|
|
|
this.rules.rate[0].required = false
|
|
|
}
|
|
|
},
|
|
|
- changeAuxiliaryUnit(data){
|
|
|
- this.unitOptions.map(item=>{
|
|
|
- if(item.Name==data){
|
|
|
- this.form.auxiliaryUnitId = item.ID
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
+ // changeAuxiliaryUnit(data){
|
|
|
+ // this.unitOptions.map(item=>{
|
|
|
+ // if(item.Name==data){
|
|
|
+ // this.form.auxiliaryUnitId = item.ID
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }
|
|
|
|
|
|
}
|
|
|
}
|