Fixiaobai
2023-11-16 4bf457a5c8433c9ec6f0ec86b2c1c20c5e667391
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
<template>
  <el-dialog
    :title="'备注'"
    :close-on-click-modal="false"
    :visible.sync="visible"
  >
    <el-form :model="dataForm" ref="dataForm" label-width="100px" class="l-mes">
      <el-form-item label="备注">
        <el-input
          type="textarea"
          :autosize="{ minRows: 1, maxRows: 4 }"
          v-model="dataForm.remark"
          placeholder="备注"
        ></el-input>
      </el-form-item>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="visible = false">取消</el-button>
      <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
    </span>
  </el-dialog>
</template>
 
<script>
import { putRoutingTemplateForOrder } from '@/api/plan/manufacturingorder'
export default {
  data() {
    return {
      visible: false,
      dataForm: {
        id: 0,
        remark: ''
      }
    }
  },
  created() {},
  methods: {
    init(id, remark) {
      this.dataForm.id = id || 0
      this.dataForm.remark = remark
      this.visible = true
    },
    // 表单提交
    dataFormSubmit() {
      putRoutingTemplateForOrder(this.dataForm).then((response) => {
        const data = response.data
        if (data.code === 0) {
          this.visible = false
          this.$message.success('添加成功')
        } else {
          this.visible = false
          this.$message.error('添加失败')
        }
        this.$emit('comfirmParamsRemark', data)
      })
    }
  }
}
</script>