Commit d0631fa0 by liangjianmin

fix(tallyReceive): 优化日期转DC输入处理,添加输入事件监听,提升用户体验

parent 8c935ae7
Showing with 11 additions and 9 deletions
......@@ -207,7 +207,7 @@
<text class="input-title-t2">日期转DC:</text>
</view>
<view class="input-box">
<input type="number" maxlength="6" class="uni-input" placeholder-style="color:#919399" placeholder="请输入6位数年月日" v-model="date_code_format" />
<input type="number" maxlength="6" class="uni-input" placeholder-style="color:#919399" placeholder="请输入6位数年月日" v-model="date_code_format" @input="handleDateCodeFormatInput" />
</view>
</view>
</view>
......@@ -469,12 +469,6 @@
} else {
this.formParams.image_ids = '';
}
},
// 监听日期转DC输入
date_code_format: {
handler: function (val) {
this.handleDateCodeFormat(val);
}
}
},
methods: {
......@@ -1004,10 +998,18 @@
}, 200);
},
/**
* 处理日期转DC格式输入事件
* @param {Object} event - 输入事件对象
*/
handleDateCodeFormatInput: debounce(function (event) {
var val = event.target.value;
this.handleDateCodeFormat(val);
}, 500),
/**
* 处理日期转DC格式
* @param {String} val - 输入的6位数字日期
*/
handleDateCodeFormat: debounce(function (val) {
handleDateCodeFormat: function (val) {
if (val && val.length === 6) {
// 获取年份后两位
var year = val.substring(0, 2);
......@@ -1066,7 +1068,7 @@
icon: 'none'
});
}
}, 500)
}
}
};
</script>
......
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 sign in to comment