Commit 131c1b44 authored by dragondean@qq.com's avatar dragondean@qq.com

完善新建订单后重置数据

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