123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- <template>
- <view class="modal-box">
- <u-popup v-model="isShow" @close="isShow=false" mode="right" length="85%" >
- <u-form :model="form" ref="uForm" label-width="150" class="form-content">
- <u-form-item label="扫描时间" prop="date" class="form-item">
- <u-input clearable v-model="form.date" disabled placeholder="请选择扫描时间区间" class="form-item-inp" @click="showDate=true" />
- <u-icon v-show="form.date.length != 0" name="close-circle-fill" color="#c8c0cc" size="32" class="close-circle" @click="clearTime"></u-icon>
- </u-form-item>
- <u-form-item label="VIN"><u-input v-model.trim="form.code" placeholder="请输入VIN"/></u-form-item>
- <u-form-item label="车辆品牌"><u-input v-model.trim="form.origCode" placeholder="请输入车辆品牌"/></u-form-item>
- <u-form-item label="车型"><u-input v-model.trim="form.name" placeholder="请输入车型"/></u-form-item>
- <u-form-item label="空调滤清器" label-position="top">
- <u-radio-group v-model="value" :size="28">
- <u-radio
- v-for="(item, index) in list" :key="index"
- :name="item.val"
- >
- {{item.name}}
- </u-radio>
- </u-radio-group>
- </u-form-item>
- <u-form-item label="空气滤清器" label-position="top">
- <u-radio-group v-model="value" :size="28">
- <u-radio
- v-for="(item, index) in list" :key="index"
- :name="item.val"
- >
- {{item.name}}
- </u-radio>
- </u-radio-group>
- </u-form-item>
- <u-form-item label="机油滤清器" label-position="top">
- <u-radio-group v-model="value" :size="28">
- <u-radio
- v-for="(item, index) in list" :key="index"
- :name="item.val"
- >
- {{item.name}}
- </u-radio>
- </u-radio-group>
- </u-form-item>
- </u-form>
- <view class="form-footer-btn">
- <u-button class="handle-btn" shape="circle" size="medium" hover-class="none" @click="handleClean">重置</u-button>
- <u-button class="handle-btn" shape="circle" size="medium" hover-class="none" :custom-style="customBtnStyle" @click="handleSearch">查询</u-button>
- </view>
- </u-popup>
- <!-- 选择日期范围 -->
- <u-calendar v-model="showDate" @change="dateChange" mode="range"></u-calendar>
- </view>
- </template>
- <script>
- export default{
- components: { },
- props:{
- showModal:{
- type: Boolean,
- default: false
- }
- },
- data(){
- return{
- form: {
- date: '',
- beginDate: '',
- endDate: '',
- code: '', // 产品编码
- name: '', // 产品名称
- origCode: '', // 原厂编码
- productBrandSn: undefined, // 产品品牌
- productTypeSn1: undefined, // 产品分类1
- productTypeSn2: undefined, // 产品分类2
- productTypeSn3: undefined, // 产品分类3
- },
- customBtnStyle: { // 自定义按钮样式
- borderColor: this.$config('primaryColor'),
- backgroundColor: this.$config('primaryColor'),
- color: '#fff'
- },
- list: [
- {
- name: '有适配',
- val:'1',
- disabled: false
- },
- {
- name: '无适配',
- val:'0',
- disabled: false
- },
- {
- name: '空(--)',
- val:'',
- disabled: false
- }
- ],
- showDate: false, // 是否显示时间弹窗
- isShow:this.showModal,
- showTypeModal: false,
- brandModal:false
- }
- },
- methods:{
- // 时间 change
- dateChange(date){
- this.form.date = date.startDate + ' ~ ' + date.endDate
- this.form.beginDate = date.startDate
- this.form.endDate = date.endDate
- },
- // 清空创建时间
- clearTime(){
- this.form.date = ''
- this.form.beginDate = ''
- this.form.endDate = ''
- },
- // 表单清空
- handleClean(){
- this.form.code = ''
- this.form.name = ''
- this.form.origCode = ''
- setTimeout(()=>{
- this.handleSearch()
- },300)
- },
- handleSearch(){
- let data = JSON.parse(JSON.stringify(this.form))
- console.log(data)
- this.$emit('refresh', data)
- this.isShow=false
- },
- },
- watch:{
- // 父页面传过来的弹框状态
- showModal (newValue, oldValue) {
- this.isShow = newValue
- },
- // 重定义的弹框状态
- isShow (newValue, oldValue) {
- if (!newValue) {
- this.$emit('close')
- }
- }
- }
- }
- </script>
- <style lang="scss">
- .modal-box{
- width: 100%;
- .form-content{
- display: block;
- padding: 0 20upx;
- box-sizing: content-box;
- }
- .u-form-item{
- padding: 10upx;
- }
- .form-footer-btn{
- margin: 30upx;
- display: flex;
- justify-content: space-between;
- }
- .form-footer-btn {
- display: flex;
- padding: 20upx;
- .handle-btn {
- font-size: 28upx;
- margin: 0 30upx;
- width: 100%;
- flex: 1;
- }
- }
- }
- </style>
|