doum
4 小时以前 b05fea19990632b2ec6320cbfaab2bddc87006c0
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
<template>
  <GlobalAlertWindow
    v-loading="isUploading"
    :title="title"
    :visible.sync="visible"
    :confirm-working="isWorking"
    @confirm="confirm"
  >
    <el-form :model="form" ref="form" label-width="120px" label-suffix=":"  :rules="rules" inline>
      <el-form-item label="备注" prop="sysInfo">
        <el-input type="textarea" :autosize="{ minRows: 4, maxRows:4 }" v-model="form.sysInfo" placeholder="请输入备注" :maxlength="50" v-trim/>
      </el-form-item>
 
    </el-form>
  </GlobalAlertWindow>
</template>
 
<script>
import BaseOpera from '@/components/base/BaseOpera'
import GlobalAlertWindow from '@/components/common/GlobalAlertWindow'
export default {
  name: 'OperaOrderMarkWindow',
  extends: BaseOpera,
  components: { GlobalAlertWindow },
  data () {
    return {
      isUploading: false,
      // 表单数据
      form: {
        id: null,
        sysInfo: ''
      },
      // 验证规则
      rules: {
        sysInfo: [
          { required: true, message: '请输入订单备注信息', tigger: 'blur' }
        ]
      }
    }
  },
 
  created () {
    this.config({
      api: '/business/goodsorder',
      'field.id': 'id'
    })
  },
  methods: {
    confirm () {
      this.$refs.form.validate((valid) => {
        if (!valid) {
          return
        }
        this.isWorking = true
        this.api.orderRemark(this.form)
          .then(() => {
            this.visible = false
            this.$tip.apiSuccess('添加成功')
            this.$emit('success')
          }).catch(e => {
            this.$tip.apiFailed(e)
          })
          .finally(() => {
            this.isWorking = false
          })
        // 调用新建接口
      })
    }
  }
 
}
</script>
 
<style lang="scss" scoped>
@import "@/assets/style/alertstyle.scss";
 
</style>