yangys
2025-08-26 7d93a844cb9d2757d7087c716b8f78e3b34baa81
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<!--
 * @Author: 李喆(开发组) lzhe@yxqiche.com
 * @Date: 2025-05-28 12:03:55
 * @LastEditors: gaoshp
 * @LastEditTime: 2025-08-10 13:05:56
 * @FilePath: /mdmweb/src/views/flowmgr/taskassign.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <basic-container>
    <avue-form ref="form" :option="attachOption" v-model="attachForm" @submit="formSubmit"></avue-form>
  </basic-container>
</template>
 
<script>
import {
  getQueryString,
} from '@/utils/util';
 
export default {
  watch: {
    'attachForm.drawingNo': function (val) {
      if(val && this.attachForm.processNo && this.attachForm.processEdition) {
        this.attachForm.title = `${val}-${this.attachForm.processNo}-${this.attachForm.processEdition}-数控程序编制`;
      }
    },
    'attachForm.processNo': function (val) {
      if(val && this.attachForm.drawingNo && this.attachForm.processEdition) {
        //this.attachForm.title = `${val}-${this.attachForm.processNo}-数控程序编制`;
            this.attachForm.title = `${this.attachForm.drawingNo}-${val}-${this.attachForm.processEdition}-数控程序编制`;
      }
    },
    'attachForm.processEdition': function (val) {
      if(val && this.attachForm.drawingNo && this.attachForm.processNo ) {
        //this.attachForm.title = `${val}-${this.attachForm.processNo}-数控程序编制`;
            this.attachForm.title = `${this.attachForm.drawingNo}-${this.attachForm.processNo}-${val}-数控程序编制`;
      }
    },
  },
  data() {
    
    var isTempFlow = getQueryString("isTempFlow");
    isTempFlow = isTempFlow === 'Y'?'Y':'N';
    console.log('isTempFlow='+isTempFlow);
    var that = this;
    return {
      isTempFlow:isTempFlow,//是否临时流程
      form: {},
      machineCodeList: [],
      attachOption: {
        labelWidth: 160,
        submitBtn: true,
        emptyBtn: false,
        tip: false,
        column: [
          {
            label: '流程标题',
            prop: 'title',
            type: 'input',
            span: 24,
            dataType: 'string',
            rules: [{ required: true, message: '必填', trigger: 'blur' }],
          },
          {
            label: '零组件号',
            prop: 'drawingNo',
            type: 'input',
            span: 12,
            dataType: 'string',
            rules: [{ required: true, message: '必填', trigger: 'blur' }],
          },
          {
            label: '图号版次',
            prop: 'drawingNoEdition',
            type: 'input',
            span: 12,
            dataType: 'string',
            rules: [{ required: true, message: '必填', trigger: 'blur' }],
          },
          {
            label: '产品型号',
            prop: 'productModel',
            type: 'input',
            span: 12,
            dataType: 'string',
            rules: [{ required: true, message: '必填', trigger: 'blur' }],
          },
          {
            label: '工序号',
            prop: 'processNo',
            type: 'input',
            span: 12,
            step: 1,
            precision: 0,
            dataType: 'string',
            max: 999,
            rules: [{ required: true, message: '必填', trigger: 'blur' }],
          },
          {
            label: '工序名称',
            prop: 'processName',
            type: 'input',
            span: 12,
            dataType: 'string',
            rules: [{ required: true, message: '必填', trigger: 'blur' }],
          },
          {
            label: '工序版次',
            prop: 'processEdition',
            type: 'input',
            span: 12,
            dataType: 'string',
            rules: [{ required: true, message: '必填', trigger: 'blur' }],
          },
          {
            label: '工艺版次',
            prop: 'craftEdition',
            placeholder:'如"A"',
            type: 'input',
            span: 12,
            dataType: 'string',
            maxlength: 10,
            rules: [{ required: true, message: '必填', trigger: 'blur' }],
          },
          {
            label: '加工机床',
            prop: 'machineCode',
            type: 'select',
                  filterable: true,
            dicUrl: `/blade-mdm/machine/page?size=10000`,
            dicFormatter: function (res) {
              that.machineCodeList = res.data.records;
              return res.data.records;
            },
            rules: [{ required: true, message: '必填', trigger: 'blur' }],
            props: {
              label: 'code',
              value: 'code',
            },
            span: 12
          },
          {
            label: '计划锁定时间(天)',
            prop: 'planLockDays',
            type: 'number',
            min:0,
            max:30,
            span: 12,
            controls:true,
            dataType: 'number',
            controlsPosition:'right',
            rules: [{ required: true, message: '必填', trigger: 'blur' }],
          },
          {
            label: '计划开工时间',
            prop: 'planStartTime',
            type: 'date',
            format: "YYYY-MM-DD",
            valueFormat: "YYYY-MM-DD",
            span: 12,
            dataType: 'string',
            rules: [{ required: true, message: '必填', trigger: 'blur' }],
          },
          {
            label: '偏离单号',
            prop: 'deviation',
            type: 'input',
            span: 12,
            dataType: 'string',
            // rules: [{ required: true, message: '必填', trigger: 'blur' }],
          }
        ],
      },
      attachForm: {planLockDays:7},//默认7天
    };
  },
  methods: {
    formSubmit(form, done) {
      var form = { ...form };
      this.machineCodeList.forEach(item => {
        if (form.machineCode == item.code) {
          form.machineMode = item.name;
        }
      })
 
      axios({
        url: '/blade-mdm/flow/dispatch/start',
        method: 'post',
        data: form,
      }).then(
        res => {
          this.$message({
            type: 'success',
            message: '操作成功!',
          });
          this.$refs.form.resetForm();
          done();
        },
        error => {
          window.console.log(error);
          done();
        }
      );
    }
  },
};
</script>
 
<style lang="scss"></style>