cuilei
3 天以前 1c2db1635c5656dd13d94c7ea7640a8dfced27cf
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<template>
  <j-modal
    :title="title"
    :width="width"
    :visible="visible"
    switchFullscreen
    @ok="handleOk"
    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
    @cancel="handleCancel"
    cancelText="关闭">
 
    <a-divider class="divider-title">齐套性检查</a-divider>
    <a-list>
      <a-list-item v-for="(item, index) in unCompletenessCheckList" :key="index">
        <span>物料 <strong>{{ item }}</strong> 齐套性检查不通过</span>
      </a-list-item>
    </a-list>
    <a-divider class="divider-title">设备点检</a-divider>
    <a-list>
      <a-list-item v-for="(item, index) in unInspectEquipmentList" :key="index">
        <span>设备 <strong>{{ item }}</strong> 未进行设备点检</span>
      </a-list-item>
    </a-list>
    <a-divider class="divider-title">工艺点检</a-divider>
    <a-list>
      <a-list-item v-for="(item, index) in unCheckEquipmentList" :key="index">
        <span>设备 <strong>{{ item }}</strong> 未进行工艺点检</span>
      </a-list-item>
    </a-list>
  </j-modal>
</template>
 
<script>
import { postAction, getAction } from '@api/manage'
 
export default {
  name: 'MesProductionWorkOrderCheckBeforeExecuteModal',
  data () {
    return {
      title: '工单执行前检查',
      width: 800,
      visible: false,
      loading: false,
      disableSubmit: false,
      model: {},
      validatorRules: {
      },
      labelCol: {
        xs: { span: 24 },
        sm: { span: 6 },
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 18 },
      },
      url: {
        execute: '/mes/mesProductionWorkOrder/execute'
      },
      orderId: null,
      unCompletenessCheckList: [],
      unInspectEquipmentList: [],
      unCheckEquipmentList: []
    }
  },
  computed: {
    formDisabled(){
      return this.disabled
    },
  },
  methods: {
    open (id, record) {
      this.orderId = id
      this.unCompletenessCheckList = record.unCompletenessCheckList
      this.unInspectEquipmentList = record.unInspectEquipmentList
      this.unCheckEquipmentList = record.unCheckEquipmentList
      this.visible = true
    },
    close () {
      this.$emit('close');
      this.visible = false;
    },
    handleOk () {
      this.$confirm({
        title: '确认操作',
        content: '以上检查、点检项未完成,确认继续执行工单?',
        onOk: () => {
          getAction(this.url.execute, {id: this.orderId}).then(res => {
            if (res.success) {
              this.$message.success(res.message)
              this.submitCallback()
            } else {
              this.$message.warning(res.message)
            }
          })
        },
        onCancel: () => {
        }
      })
    },
    submitCallback(){
      this.$emit('ok');
      this.unCompletenessCheckList = []
      this.unInspectEquipmentList = []
      this.unCheckEquipmentList = []
      this.visible = false;
    },
    handleCancel () {
      this.close()
    }
  }
}
</script>
 
<style scoped>
 
.divider-title {
  font-style: italic;
  color: blue;
}
 
</style>