From 1828cfc3c596ee2142a9e76582fa02ee9631a23d Mon Sep 17 00:00:00 2001
From: zhaowei <zhaowei>
Date: 星期三, 15 一月 2025 17:55:52 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/dnc/base/modules/ProductStructure/ProcessStep/ProcessStepModalForm.vue |  158 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 158 insertions(+), 0 deletions(-)

diff --git a/src/views/dnc/base/modules/ProductStructure/ProcessStep/ProcessStepModalForm.vue b/src/views/dnc/base/modules/ProductStructure/ProcessStep/ProcessStepModalForm.vue
new file mode 100644
index 0000000..d6982b6
--- /dev/null
+++ b/src/views/dnc/base/modules/ProductStructure/ProcessStep/ProcessStepModalForm.vue
@@ -0,0 +1,158 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol">
+      <a-row>
+        <a-col :span="12">
+          <a-form-model-item label="宸ユ鍙�" prop="stepCode">
+            <a-input v-model="model.stepCode" placeholder="璇疯緭鍏ュ伐搴忓彿"></a-input>
+          </a-form-model-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-model-item label="宸ユ鍚嶇О" prop="stepName">
+            <a-input v-model="model.stepName" placeholder="璇疯緭鍏ュ伐搴忓悕绉�"></a-input>
+          </a-form-model-item>
+        </a-col>
+      </a-row>
+
+      <a-row>
+        <a-col :span="24">
+          <a-form-model-item label="鍔犲伐璁惧缂栧彿" :labelCol="labelColLong" :wrapperCol="wrapperColLong">
+            <a-select v-model="model.deviceNo" placeholder="璇烽�夋嫨鍔犲伐璁惧缂栧彿"></a-select>
+          </a-form-model-item>
+        </a-col>
+      </a-row>
+
+      <a-row>
+        <a-col :span="12">
+          <a-form-model-item label="宸ヨ壓缂栧彿">
+            <a-input v-model="model.craftNo" placeholder="璇疯緭鍏ュ伐鑹虹紪鍙�"></a-input>
+          </a-form-model-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-model-item label="宸ヨ壓瑙勭▼鐗堟湰">
+            <a-input v-model="model.craftVersion" placeholder="璇疯緭鍏ュ伐鑹鸿绋嬬増鏈�"></a-input>
+          </a-form-model-item>
+        </a-col>
+      </a-row>
+
+      <a-row>
+        <a-col :span="12">
+          <a-form-model-item label="宸ユ绫诲瀷">
+            <a-input v-model="model.stepType" placeholder="璇疯緭鍏ュ伐姝ョ被鍨�"></a-input>
+          </a-form-model-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-model-item label="宸ユ鎻忚堪">
+            <a-input v-model="model.description" placeholder="璇疯緭鍏ュ伐姝ユ弿杩�"></a-input>
+          </a-form-model-item>
+        </a-col>
+      </a-row>
+
+      <a-row>
+        <a-col :span="12">
+          <a-form-model-item label="宸ヨ缂栧彿">
+            <a-input v-model="model.assembleNo" placeholder="璇疯緭鍏ュ伐瑁呯紪鍙�"></a-input>
+          </a-form-model-item>
+        </a-col>
+        <a-col :span="12">
+          <a-form-model-item label="宸ヨ鍚嶇О">
+            <a-input v-model="model.assembleName" placeholder="璇疯緭鍏ュ伐瑁呭悕绉�"></a-input>
+          </a-form-model-item>
+        </a-col>
+      </a-row>
+    </a-form-model>
+  </a-spin>
+</template>
+
+<script>
+  import { httpAction } from '@/api/manage'
+
+  export default {
+    name: 'ProcessStepModalForm',
+    components: {},
+    data() {
+      return {
+        model: {
+          stepType: 0
+        },
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 8 }
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 14 }
+        },
+        labelColLong: {
+          xs: { span: 24 },
+          sm: { span: 4 }
+        },
+        wrapperColLong: {
+          xs: { span: 24 },
+          sm: { span: 19 }
+        },
+        confirmLoading: false,
+        validatorRules: {
+          stepCode: [
+            { required: true, message: '璇疯緭鍏ュ伐姝ュ彿!' }
+          ],
+          stepName: [
+            { required: true, message: '璇疯緭鍏ュ伐姝ュ悕绉�!' }
+          ]
+        },
+        url: {
+          add: '/nc/workStep/add',
+          edit: '/nc/workStep/edit'
+        }
+      }
+    },
+    created() {
+      //澶囦唤model鍘熷鍊�
+      this.modelDefault = JSON.parse(JSON.stringify(this.model))
+    },
+    methods: {
+      add(params) {
+        this.edit({ ...this.modelDefault, ...params })
+      },
+      edit(record) {
+        this.model = Object.assign({}, record)
+        console.log('model', this.model)
+      },
+      submitForm() {
+        const that = this
+        // 瑙﹀彂琛ㄥ崟楠岃瘉
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            that.confirmLoading = true
+            let httpUrl = ''
+            let method = ''
+            if (!this.model.id) {
+              httpUrl += this.url.add
+              method = 'post'
+            } else {
+              httpUrl += this.url.edit + `/${this.model.id}`
+              method = 'put'
+            }
+            httpAction(httpUrl, this.model, method).then((res) => {
+              if (res.success) {
+                that.$notification.success({
+                  message: '娑堟伅',
+                  description: res.message
+                })
+                that.$emit('ok')
+              } else {
+                that.$notification.warning({
+                  message: '娑堟伅',
+                  description: res.message
+                })
+              }
+            }).finally(() => {
+              that.confirmLoading = false
+            })
+          }
+
+        })
+      }
+    }
+  }
+</script>
\ No newline at end of file

--
Gitblit v1.9.3