Commit bfb2e374 authored by dragondean@qq.com's avatar dragondean@qq.com

完善新建订单后重置数据

parent 17a9efc6
...@@ -21,7 +21,7 @@ export default { ...@@ -21,7 +21,7 @@ export default {
this.$emit('input', this.valueSync.replace('+', '')) this.$emit('input', this.valueSync.replace('+', ''))
}, },
value(){ value(){
if(this.value)this.valueSync = this.value this.valueSync = this.value
} }
}, },
created(){ created(){
......
...@@ -552,7 +552,19 @@ import WorkFlow from '@/components/WorkFlow' ...@@ -552,7 +552,19 @@ import WorkFlow from '@/components/WorkFlow'
import { getCustomer } from "@/api/ecw/customer"; import { getCustomer } from "@/api/ecw/customer";
// 缓存默认的表单数据 // 缓存默认的表单数据
let defaultFormData = null let makeDefaultFormData = () => {
return {
status:0,
sendstatus:0,
isCargoControl: false,
isCollection: false,
type:[],
isExternalWarehouse: false,
externalWarehouseDtoList:[],
orderItemVOList:[],
drawee: 2
}
}
window.Decimal = Decimal window.Decimal = Decimal
export default { export default {
...@@ -592,17 +604,7 @@ export default { ...@@ -592,17 +604,7 @@ export default {
couponTypeList: [], couponTypeList: [],
fee: {}, // 费用 fee: {}, // 费用
// 表单参数 // 表单参数
form: { form: makeDefaultFormData(),
status:0,
sendstatus:0,
isCargoControl: false,
isCollection: false,
type:[],
isExternalWarehouse: false,
externalWarehouseDtoList:[],
orderItemVOList:[],
drawee: 2
},
ccIdArr: [], ccIdArr: [],
// 表单校验 // 表单校验
labelStyle: 'width:120px', labelStyle: 'width:120px',
...@@ -888,7 +890,6 @@ export default { ...@@ -888,7 +890,6 @@ export default {
} }
}, },
async created() { async created() {
defaultFormData = Object.assign({}, this.form)
this.productAttrList = (await getProductAttrList()).data this.productAttrList = (await getProductAttrList()).data
this.channelList = (await getChannelList()).data this.channelList = (await getChannelList()).data
...@@ -1056,7 +1057,7 @@ export default { ...@@ -1056,7 +1057,7 @@ export default {
// 检查正整数 // 检查正整数
checkPositiveInterge(row, field){ checkPositiveInterge(row, field){
console.log('checkPositiveInterge', field, row[field]) console.log('checkPositiveInterge', field, row[field])
row[field] = row[field].replace(/[^\d]/g, '') row[field] = row[field].toString().replace(/[^\d]/g, '')
}, },
onProductChange(row, product){ onProductChange(row, product){
console.log(product) console.log(product)
...@@ -1194,7 +1195,9 @@ export default { ...@@ -1194,7 +1195,9 @@ export default {
this.$modal.msgSuccess(this.$t("新增成功")); this.$modal.msgSuccess(this.$t("新增成功"));
// 重置数据 // 重置数据
this.form = {...defaultFormData} this.form = {...makeDefaultFormData()}
this.routerList = []
this.addProduct()
this.$nextTick(() =>{ this.$nextTick(() =>{
this.$refs.form.clearValidate() this.$refs.form.clearValidate()
this.$redirect('success?orderId=' + response.data) this.$redirect('success?orderId=' + response.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