zouyu
2023-11-15 d9f709d113bb83b59eb5bec19187975a218c0ca7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<template>
  <el-dialog
    top="10vh"
    width="20%"
    title="拉取销售订单"
    :close-on-click-modal="false"
    :visible.sync="visible"
  >
    <el-form :model="dataForm" :rules="dataRule" ref="dataForm" class="l-mes">
      <el-form-item label="日期">
        <el-date-picker
          v-model="dataForm.selectTime"
          type="datetime"
          placeholder="选择日期时间"
          value-format="yyyy-MM-dd HH:mm:ss"
        >
        </el-date-picker>
      </el-form-item>
    </el-form>
 
    <div slot="footer" class="dialog-footer">
      <el-button type="info" @click="visible = false">取消</el-button>
      <el-button
        type="primary"
        :disabled="isSubmit"
        v-thinclick="`dataFormSubmit`"
        >确定</el-button
      >
    </div>
  </el-dialog>
</template>
 
<script>
import { otcCustomerOrderSync } from '@/api/plan/customerorder'
 
export default {
  data() {
    return {
      visible: true,
      dataForm: {
        selectTime: null
      },
      dataRule: {},
      isSubmit: false
    }
  },
  methods: {
    init() {
      this.visible = true
    },
    dataFormSubmit() {
      this.isSubmit = true
      if (this.dataForm.selectTime != null && this.dataForm.selectTime != '') {
        otcCustomerOrderSync({
          selectTime: this.dataForm.selectTime,
          orderNo: ''
        })
          .then((response) => {
            const resData = response.data
            if (resData.code === 0) {
              this.$message.success('拉取销售订单成功;' + resData.msg)
              this.visible = false
              this.isSubmit = false
              this.dataForm.selectTime = null
              this.$emit('refreshDataList')
            } else {
              this.$message.success('拉取销售订单失败')
              this.isSubmit = false
            }
          })
          .catch((error) => {
            this.isSubmit = false
            console.log(error)
          })
      } else {
        this.isSubmit = false
        this.$message.error('请先选择日期')
      }
    }
  }
}
</script>
<style scoped>
.mps-table .el-table__row > td {
  border: none;
}
 
.mps-table::before {
  height: 0px;
}
/*
字符串过长时,隐藏显示省略号
*/
.inline-el-hidden {
  display: block;
  width: 93%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0 auto;
}
</style>