|
@@ -44,6 +44,17 @@
|
|
<a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
|
|
<a-select-option v-for="item in allocateTypeList" :key="item.allocateTypeSn" :value="item.allocateTypeSn">{{ item.name }}</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
|
|
+ <a-form-model-item label="起止时间" prop="time">
|
|
|
|
+ <a-range-picker
|
|
|
|
+ style="width:100%"
|
|
|
|
+ v-model="form.time"
|
|
|
|
+ show-time
|
|
|
|
+ :disabledDate="disabledDate"
|
|
|
|
+ :format="dateFormat"
|
|
|
|
+ @change="dateChange"
|
|
|
|
+ @calendarChange="dateCalendarChange"
|
|
|
|
+ :placeholder="['开始时间', '结束时间']" />
|
|
|
|
+ </a-form-model-item>
|
|
<a-form-model-item label="备注" prop="remark">
|
|
<a-form-model-item label="备注" prop="remark">
|
|
<a-textarea id="allocateBill-basicInfo-remark" :maxLength="120" v-model="form.remark" placeholder="请输入备注(最多120个字符)" allowClear />
|
|
<a-textarea id="allocateBill-basicInfo-remark" :maxLength="120" v-model="form.remark" placeholder="请输入备注(最多120个字符)" allowClear />
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
@@ -57,6 +68,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import moment from 'moment'
|
|
import debounce from 'lodash/debounce'
|
|
import debounce from 'lodash/debounce'
|
|
import { VSelect } from '@/components'
|
|
import { VSelect } from '@/components'
|
|
import { allocateBillSave } from '@/api/allocateBill'
|
|
import { allocateBillSave } from '@/api/allocateBill'
|
|
@@ -87,6 +99,9 @@ export default {
|
|
targetSn: undefined,
|
|
targetSn: undefined,
|
|
targetName: '',
|
|
targetName: '',
|
|
allocateTypeSn: undefined,
|
|
allocateTypeSn: undefined,
|
|
|
|
+ time: [],
|
|
|
|
+ promoStartDate: '',
|
|
|
|
+ promoEndDate: '',
|
|
remark: ''
|
|
remark: ''
|
|
},
|
|
},
|
|
rules: {
|
|
rules: {
|
|
@@ -98,7 +113,9 @@ export default {
|
|
fetching: false,
|
|
fetching: false,
|
|
dealerData: [], // 经销商 下拉数据
|
|
dealerData: [], // 经销商 下拉数据
|
|
targetTypeList: [], // 调往对象类型
|
|
targetTypeList: [], // 调往对象类型
|
|
- allocateTypeList: [] // 调拨类型
|
|
|
|
|
|
+ allocateTypeList: [], // 调拨类型
|
|
|
|
+ dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
|
|
+ selectPriceDate: ''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -108,6 +125,28 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ // 不可选日期
|
|
|
|
+ disabledDate (current) {
|
|
|
|
+ // 可选今天以后的时间(包含今天),所选时间跨度最多可为一年
|
|
|
|
+ const minYearVs = moment().subtract(1, 'day') // 今天以后,包含今天
|
|
|
|
+ // // 限制最多只能查一年区间的数据
|
|
|
|
+ if (this.selectPriceDate) {
|
|
|
|
+ const maxYearVs = moment(this.selectPriceDate, 'YYYY-MM-DD HH:mm:ss').add(1, 'years') // 当前选中开始日期后推一年
|
|
|
|
+ return current && current < minYearVs || current && current > maxYearVs
|
|
|
|
+ } else {
|
|
|
|
+ return current && current < minYearVs
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ // 日期 change
|
|
|
|
+ dateChange (date, dateStrings) {
|
|
|
|
+ this.selectPriceDate = ''
|
|
|
|
+ this.form.time = dateStrings
|
|
|
|
+ this.form.promoStartDate = dateStrings[0] || ''
|
|
|
|
+ this.form.promoEndDate = dateStrings[1] || ''
|
|
|
|
+ },
|
|
|
|
+ dateCalendarChange (date, dateStrings) {
|
|
|
|
+ this.selectPriceDate = date[0]
|
|
|
|
+ },
|
|
// 搜索经销商
|
|
// 搜索经销商
|
|
fetchUser (value) {
|
|
fetchUser (value) {
|
|
console.log('fetching user', value)
|
|
console.log('fetching user', value)
|