|
|
@ -37,7 +37,7 @@ |
|
|
|
<autocomplete :params="form" :config="configAutocomplete" /> |
|
|
|
<autocomplete :params="form" :config="configAutocomplete" /> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="产品类型" prop="productType"> |
|
|
|
<el-form-item label="产品类型" prop="productType"> |
|
|
|
<el-select v-model="form.productType" filterable reserve-keyword remote :remote-method="productData" placeholder="请选择产品类型"> |
|
|
|
<el-select v-model="form.productType" @change="productChange" placeholder="请选择产品类型"> |
|
|
|
<el-option |
|
|
|
<el-option |
|
|
|
v-for="(item, index) in productTypeList" |
|
|
|
v-for="(item, index) in productTypeList" |
|
|
|
:key="index" |
|
|
|
:key="index" |
|
|
@ -47,11 +47,19 @@ |
|
|
|
</el-select> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="产品名称"> |
|
|
|
<el-form-item label="产品名称"> |
|
|
|
<el-input |
|
|
|
<el-select v-model="form.productId" placeholder="请选择产品类型"> |
|
|
|
|
|
|
|
<el-option |
|
|
|
|
|
|
|
v-for="(item, index) in productNameList" |
|
|
|
|
|
|
|
:key="index" |
|
|
|
|
|
|
|
:label="item.productName" |
|
|
|
|
|
|
|
:value="item.id" |
|
|
|
|
|
|
|
></el-option> |
|
|
|
|
|
|
|
</el-select> |
|
|
|
|
|
|
|
<!-- <el-input |
|
|
|
maxlength="50" |
|
|
|
maxlength="50" |
|
|
|
v-model="form.productName" |
|
|
|
v-model="form.productName" |
|
|
|
placeholder="请输入产品名称" |
|
|
|
placeholder="请输入产品名称" |
|
|
|
></el-input> |
|
|
|
></el-input> --> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="销售价"> |
|
|
|
<el-form-item label="销售价"> |
|
|
|
<el-input |
|
|
|
<el-input |
|
|
@ -98,6 +106,22 @@ export default { |
|
|
|
controlWindows: Object, |
|
|
|
controlWindows: Object, |
|
|
|
// refineryTypeEnum: Array, |
|
|
|
// refineryTypeEnum: Array, |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
watch:{ |
|
|
|
|
|
|
|
"form.salePrice": { |
|
|
|
|
|
|
|
handler(n, o) { |
|
|
|
|
|
|
|
if(n){ |
|
|
|
|
|
|
|
this.form.actAmount = this.form.salePrice*(this.form.preQuantity?this.form.preQuantity:0) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
"form.preQuantity": { |
|
|
|
|
|
|
|
handler(n, o) { |
|
|
|
|
|
|
|
if(n){ |
|
|
|
|
|
|
|
this.form.actAmount = this.form.preQuantity*(this.form.salePrice?this.form.salePrice:0) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
let validatorRefineryId = (rule, value, callback) => { |
|
|
|
let validatorRefineryId = (rule, value, callback) => { |
|
|
|
if (this.form.refineryId) callback(); |
|
|
|
if (this.form.refineryId) callback(); |
|
|
@ -105,7 +129,10 @@ export default { |
|
|
|
}; |
|
|
|
}; |
|
|
|
return { |
|
|
|
return { |
|
|
|
customList:[], |
|
|
|
customList:[], |
|
|
|
form: {}, |
|
|
|
form: { |
|
|
|
|
|
|
|
actAmount:0 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
productNameList:[], |
|
|
|
refineryList: [], |
|
|
|
refineryList: [], |
|
|
|
configAutocomplete: { |
|
|
|
configAutocomplete: { |
|
|
|
serveTarget: refineryInfoServe.findByEntity, |
|
|
|
serveTarget: refineryInfoServe.findByEntity, |
|
|
@ -149,21 +176,28 @@ export default { |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
|
|
|
|
productChange(){ |
|
|
|
|
|
|
|
this.productData() |
|
|
|
|
|
|
|
}, |
|
|
|
//搜索炼厂 |
|
|
|
//搜索炼厂 |
|
|
|
refineryData(value){ |
|
|
|
refineryData(value){ |
|
|
|
if (value) { |
|
|
|
if (value) { |
|
|
|
serve.findByEntity({refineryName:value}).then((res) => { |
|
|
|
serve.findByEntity({refineryName:value}).then((res) => { |
|
|
|
this.refineryList = res.data; |
|
|
|
this.refineryList = res.data; |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
this.productData() |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
//搜索产品 |
|
|
|
//搜索产品 |
|
|
|
productData(value){ |
|
|
|
productData(){ |
|
|
|
if (value) { |
|
|
|
let data = { |
|
|
|
serve.getRefineryProductList({productType:value}).then((res) => { |
|
|
|
refineryId:this.form.refineryId, |
|
|
|
this.customList = res.data; |
|
|
|
productType:this.form.productType, |
|
|
|
}); |
|
|
|
enableMark:'ENABLE' |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
serve.getRefineryProductList(data).then((res) => { |
|
|
|
|
|
|
|
this.productNameList = res.data; |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
//搜索客户 |
|
|
|
//搜索客户 |
|
|
|
customData(value){ |
|
|
|
customData(value){ |
|
|
@ -187,9 +221,10 @@ export default { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
judgeInterface(form) { |
|
|
|
judgeInterface(form) { |
|
|
|
let { id } = this.controlWindows.addInfo; |
|
|
|
// let { id } = this.controlWindows.addInfo; |
|
|
|
if (id) return serve.update(form); |
|
|
|
// if (id) return serve.update(form); |
|
|
|
else return serve.save(form); |
|
|
|
// else |
|
|
|
|
|
|
|
return serve.orderSave(form); |
|
|
|
}, |
|
|
|
}, |
|
|
|
//炼厂list |
|
|
|
//炼厂list |
|
|
|
// findByEntity() { |
|
|
|
// findByEntity() { |
|
|
|