Commit cf4cac0e authored by 高宇's avatar 高宇

调用剩余接口;

parent e23242cd
......@@ -62,6 +62,9 @@ export default {
getSalesSerie: {
url: '/vue/sales-order/get-product-serie'
},
getSalesProduct: {
url: '/vue/sales-order/get-product'
},
// 搜索供应商名称
searchSupplierByName: {
url: '/vue/search/supplier-by-name'
......
......@@ -30,8 +30,9 @@
},
methods: {
saveSalesItem () {
console.log(1)
let form = this.$refs.operationViewSales.getForm()
let subData = setModule(form.SalesOrderItems, 'SalesOrderItems')
let subData = Object.assign({}, setModule(form.SalesOrderItems, 'SalesOrderItems'), {'SalesOrderItems[sales_order_id]': this.$route.params.id})
requestAPI(api.saveSalesAddItem, {
data: {...subData}
}).then(res => {
......
......@@ -33,7 +33,7 @@
methods: {
saveSalesItem () {
let form = this.$refs.operationViewSales.getForm()
let subData = setModule(form.SalesOrderItems, 'SalesOrderItems')
let subData = Object.assign({}, setModule(form.SalesOrderItems, 'SalesOrderItems'), {'SalesOrderItems[sales_order_id]': this.$route.params.id})
requestAPI(api.saveSalesEditItem, {
data: {...subData}
}).then(res => {
......
......@@ -47,6 +47,7 @@
label="系列"
:disabled="copyDisabled"
:options-list="getOptions('product_serie')"
:set-option="setProduct"
@update:item="val => {SalesOrderItems.product_serie = val}">
<span slot="formError" class="el-form-item__error">
{{errorData['product_serie']}}
......@@ -59,6 +60,7 @@
label="自定义"
:disabled="copyDisabled"
:options-list="getOptions('product_misc')"
:set-option="setProduct"
@update:item="val => {SalesOrderItems.product_misc = val}">
<span slot="formError" class="el-form-item__error">
{{errorData['product_misc']}}
......@@ -156,6 +158,9 @@
options: {
'SalesOrderItems[product_component]': {
value: []
},
'SalesOrderItems[product_id]': {
value: []
}
}
}
......@@ -168,6 +173,22 @@
return true
}
},
setProduct () {
requestAPI(api.getSalesProduct, {
data: {
product_type: this.SalesOrderItems.product_type,
product_component: this.SalesOrderItems.product_component,
product_brand: this.SalesOrderItems.product_brand,
product_serie: this.SalesOrderItems.product_serie,
product_misc: this.SalesOrderItems.product_misc
}
}).then(res => {
this.options['SalesOrderItems[product_id]'].value = []
res.forEach(item => {
this.options['SalesOrderItems[product_id]'].value.push(item)
})
})
},
setComponentOptions (key) {
requestAPI(api.getSalesComponent, {
data: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment