|
@@ -66,7 +66,6 @@
|
|
v-model="form.time"
|
|
v-model="form.time"
|
|
:format="dateFormat"
|
|
:format="dateFormat"
|
|
@change="dateChange"
|
|
@change="dateChange"
|
|
- @calendarChange="dateCalendarChange"
|
|
|
|
:placeholder="['开始时间', '结束时间']" />
|
|
:placeholder="['开始时间', '结束时间']" />
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</a-col>
|
|
</a-col>
|
|
@@ -144,7 +143,6 @@ export default {
|
|
targetTypeList: [], // 调往对象类型
|
|
targetTypeList: [], // 调往对象类型
|
|
allocateTypeVal: [],
|
|
allocateTypeVal: [],
|
|
dateFormat: 'YYYY-MM-DD',
|
|
dateFormat: 'YYYY-MM-DD',
|
|
- selectPriceDate: '',
|
|
|
|
isEdit: false
|
|
isEdit: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -157,41 +155,38 @@ export default {
|
|
methods: {
|
|
methods: {
|
|
// 日期 change
|
|
// 日期 change
|
|
dateChange (date, dateStrings) {
|
|
dateChange (date, dateStrings) {
|
|
- this.selectPriceDate = ''
|
|
|
|
|
|
+ console.log(date, dateStrings)
|
|
this.form.time = dateStrings
|
|
this.form.time = dateStrings
|
|
- this.form.promoStartDate = dateStrings[0] || ''
|
|
|
|
- this.form.promoEndDate = dateStrings[1] || ''
|
|
|
|
- },
|
|
|
|
- dateCalendarChange (date, dateStrings) {
|
|
|
|
- this.selectPriceDate = date[0]
|
|
|
|
|
|
+ this.form.promoStartDate = date.length ? dateStrings[0] : ''
|
|
|
|
+ this.form.promoEndDate = date.length ? dateStrings[1] : ''
|
|
},
|
|
},
|
|
// 调拨类别 change
|
|
// 调拨类别 change
|
|
allocateTypeChange (val, opt) {
|
|
allocateTypeChange (val, opt) {
|
|
console.log(val, opt, '------------')
|
|
console.log(val, opt, '------------')
|
|
- this.allocateTypeVal = val
|
|
|
|
- this.form.costTypeSn = val[0] ? val[0] : ''
|
|
|
|
- this.form.allocateSortSn = val[1] ? val[1] : ''
|
|
|
|
- this.form.allocateTypeSn = val[2] ? val[2] : ''
|
|
|
|
|
|
+ this.allocateTypeVal = val || ''
|
|
|
|
+ this.form.costTypeSn = val && val[0] ? val[0] : ''
|
|
|
|
+ this.form.allocateSortSn = val && val[1] ? val[1] : ''
|
|
|
|
+ this.form.allocateTypeSn = val && val[2] ? val[2] : ''
|
|
// 名称
|
|
// 名称
|
|
- this.form.costTypeName = opt[0] ? opt[0].name : ''
|
|
|
|
- this.form.allocateSortName = opt[1] ? opt[1].name : ''
|
|
|
|
- this.form.allocateTypeName = opt[2] ? opt[2].name : ''
|
|
|
|
|
|
+ this.form.costTypeName = opt && opt[0] ? opt[0].name : ''
|
|
|
|
+ this.form.allocateSortName = opt && opt[1] ? opt[1].name : ''
|
|
|
|
+ this.form.allocateTypeName = opt && opt[2] ? opt[2].name : ''
|
|
},
|
|
},
|
|
// 产品分类 change
|
|
// 产品分类 change
|
|
changeProductType (val, id, opt) {
|
|
changeProductType (val, id, opt) {
|
|
console.log(val, opt, '------------')
|
|
console.log(val, opt, '------------')
|
|
- this.form.productTypeSn1 = val[0] ? val[0] : ''
|
|
|
|
- this.form.productTypeSn2 = val[1] ? val[1] : ''
|
|
|
|
- this.form.productTypeSn3 = val[2] ? val[2] : ''
|
|
|
|
|
|
+ this.form.productTypeSn1 = val && val[0] ? val[0] : ''
|
|
|
|
+ this.form.productTypeSn2 = val && val[1] ? val[1] : ''
|
|
|
|
+ this.form.productTypeSn3 = val && val[2] ? val[2] : ''
|
|
// 名称
|
|
// 名称
|
|
- this.form.productTypeName1 = opt[0] ? opt[0].productTypeName : ''
|
|
|
|
- this.form.productTypeName2 = opt[1] ? opt[1].productTypeName : ''
|
|
|
|
- this.form.productTypeName3 = opt[2] ? opt[2].productTypeName : ''
|
|
|
|
|
|
+ this.form.productTypeName1 = opt && opt[0] ? opt[0].productTypeName : ''
|
|
|
|
+ this.form.productTypeName2 = opt && opt[1] ? opt[1].productTypeName : ''
|
|
|
|
+ this.form.productTypeName3 = opt && opt[2] ? opt[2].productTypeName : ''
|
|
},
|
|
},
|
|
// 品牌
|
|
// 品牌
|
|
changeBrand (val, id, opt) {
|
|
changeBrand (val, id, opt) {
|
|
console.log(val, opt, '------------')
|
|
console.log(val, opt, '------------')
|
|
- this.form.productBrandName = opt.brandName
|
|
|
|
|
|
+ this.form.productBrandName = opt ? opt.brandName : ''
|
|
},
|
|
},
|
|
// 搜索经销商
|
|
// 搜索经销商
|
|
fetchUser (value) {
|
|
fetchUser (value) {
|
|
@@ -218,6 +213,9 @@ export default {
|
|
this.$refs.ruleForm.validate(valid => {
|
|
this.$refs.ruleForm.validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
const form = JSON.parse(JSON.stringify(_this.form))
|
|
const form = JSON.parse(JSON.stringify(_this.form))
|
|
|
|
+ if (!form.productBrandName) {
|
|
|
|
+ form.productBrandSn = ''
|
|
|
|
+ }
|
|
_this.spinning = true
|
|
_this.spinning = true
|
|
allocateBillSave(form).then(res => {
|
|
allocateBillSave(form).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
@@ -298,6 +296,9 @@ export default {
|
|
if (this.form.promoStartDate && this.form.promoEndDate) {
|
|
if (this.form.promoStartDate && this.form.promoEndDate) {
|
|
this.form.time = [this.form.promoStartDate, this.form.promoEndDate]
|
|
this.form.time = [this.form.promoStartDate, this.form.promoEndDate]
|
|
}
|
|
}
|
|
|
|
+ if (!this.form.productBrandSn) {
|
|
|
|
+ this.form.productBrandSn = undefined
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|