|
@@ -30,7 +30,7 @@ import ProductInfoModule from './productInfoModule.vue'
|
|
|
import PerformanceBelongsModule from './performanceBelongsModule.vue'
|
|
|
import OtherInfoModule from './otherInfoModule.vue'
|
|
|
import ContractInfoModule from './contractInfoModule.vue'
|
|
|
-import { mapState, mapGetters } from 'vuex'
|
|
|
+import { mapState, mapGetters, mapActions } from 'vuex'
|
|
|
|
|
|
export default {
|
|
|
name: 'CreateOrderContent',
|
|
@@ -61,6 +61,7 @@ export default {
|
|
|
this.$store.dispatch('order/getConfigWithReq')
|
|
|
},
|
|
|
methods: {
|
|
|
+ ...mapActions('order', ['createOrder']),
|
|
|
async validate() {
|
|
|
const refsArr = this.getFormRefs()
|
|
|
const asyncArr = refsArr.map(r => r?.validate())
|
|
@@ -84,18 +85,19 @@ export default {
|
|
|
}
|
|
|
return refsArr
|
|
|
},
|
|
|
- getState() {
|
|
|
- const refsArr = this.getFormRefs()
|
|
|
- const result = {}
|
|
|
- refsArr.forEach(r => {
|
|
|
- const t = r?.getState()
|
|
|
- Object.assign(result, t)
|
|
|
- })
|
|
|
- return result
|
|
|
+ async doSave(save) {
|
|
|
+ const id = await this.createOrder({ save })
|
|
|
+ if (id) {
|
|
|
+ this.$toast('订单创建成功')
|
|
|
+ }
|
|
|
},
|
|
|
- setState() {
|
|
|
- const refsArr = this.getFormRefs()
|
|
|
- console.log('setState', refsArr)
|
|
|
+ async submit() {
|
|
|
+ // 提交
|
|
|
+ await this.doSave(2)
|
|
|
+ },
|
|
|
+ async stash() {
|
|
|
+ // 暂存
|
|
|
+ await this.doSave(1)
|
|
|
},
|
|
|
}
|
|
|
}
|