|
@@ -0,0 +1,78 @@
|
|
|
+<template>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="10" :offset="6">
|
|
|
+ <el-form :rules="rules" :model="formData" ref="dataForm">
|
|
|
+ <el-form-item prop="productId">
|
|
|
+ <el-input placeholder="输入商品ID" clearable v-model="formData.productId"></el-input>
|
|
|
+ <el-button type="primary" @click="onSubmit">立即查询</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+export default {
|
|
|
+ name: 'tools-pricetrend',
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ formData: {
|
|
|
+ productId: '' // 测试ID:562665685690
|
|
|
+ },
|
|
|
+ isDisabled: false,
|
|
|
+ rules: {
|
|
|
+ productId: [{ required: true, message: '输入商品ID', trigger: 'blur' }]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ onSubmit () {
|
|
|
+ this.$refs['dataForm'].validate((valid) => {
|
|
|
+ if (!valid) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.isDisabled) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.isDisabled = true
|
|
|
+ this.$http({
|
|
|
+ url: this.$http.adornUrl('/tb/getHistorical'),
|
|
|
+ method: 'post',
|
|
|
+ data: this.$http.adornData({
|
|
|
+ productId: this.formData.productId
|
|
|
+ })
|
|
|
+ }).then(({ data }) => {
|
|
|
+ this.isDisabled = false
|
|
|
+ if (data.status) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.$message.error(data.msg)
|
|
|
+ }).catch(() => {
|
|
|
+ this.isDisabled = false
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+$--color-primary: #3E8EF7;
|
|
|
+/deep/ .el-form-item {
|
|
|
+ .el-form-item__content {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ input {
|
|
|
+ border-top-right-radius: 0;
|
|
|
+ border-bottom-right-radius: 0;
|
|
|
+ border: 1px solid $--color-primary;
|
|
|
+ }
|
|
|
+
|
|
|
+ button {
|
|
|
+ border-top-left-radius: 0;
|
|
|
+ border-bottom-left-radius: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|