Эх сурвалжийг харах

Merge branch 'master' of http://62.234.61.92:3000/wjm/mec-cloud_IntelligentManufacturing_CRM

lph 1 жил өмнө
parent
commit
9aae1e594d

+ 126 - 0
zkqy-ui/src/views/bussiness/dialogCompments/test-component/CaiGou/CG02.vue

@@ -0,0 +1,126 @@
+<template>
+    <div>
+        <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+            <el-form-item label="原材料" prop="ycl">
+              <el-select
+                v-model="form.ycl"
+                placeholder="请选择原材料"
+                clearable
+                filterable
+                >
+                <el-option
+                  v-for="item in formData.resultMap.goodsList"
+                  :key="item.goodsno"
+                  :label="item.goodsname"
+                  :value="item.goodsno"
+                >
+                </el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item label="重量" prop="zl">
+                <el-input v-model="form.zl" placeholder="请输入重量" />
+            </el-form-item>
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+            <el-button type="primary" @click="submitHanfler">确 定</el-button>
+        </div>
+    </div>
+</template>
+
+<script>
+import { submitNodeForm } from "@/api/bpmprocess/runDialogApi/index"
+export default {
+    name: 'CG02',
+    props: ["formData", "row"],
+    data() {
+        return {
+            // 表单参数
+            form: {
+                zl:'',
+                ycl: '',
+            },
+            // 表单校验
+            rules: {
+                ycl: [{ required: true, message: "请选择原材料", trigger: "change" }],
+                zl:{ required: true, message: "请输入重量", trigger: "blur" },
+            },
+        };
+    },
+    watch: {
+        myFormData: {
+            handler(nval) {
+                this.realFormData = nval;
+            },
+            deep: true,
+            immediate: true,
+        },
+    },
+
+    mounted() {
+        
+    },
+
+    methods: {
+        async submitHanfler() {
+        let res = await this.$refs.form?.validate();
+        if (res) {
+            let payLoad = {};
+            let { ycl, zl } = this.form;
+            if (this.isEdit) {
+            payLoad.updateCommonEntityList = [
+                {
+                    basicMap: {
+                        tableName: "kucun",
+                    },
+                    addListMap: [
+                        {
+                        ycl,
+                        zl,
+                        taskKey: this.row.benTaskProcessKey,
+                        taskNodeKey: this.row.benTaskNodeKey,
+                        },
+                    ],
+                },
+            ];
+            } else {
+            payLoad.insertCommonEntityList = [
+                {
+                basicMap: {
+                    tableName: "kucun",
+                },
+                addListMap: [
+                    {
+                    ycl,
+                    zl,
+                    taskKey: this.row.benTaskProcessKey,
+                    taskNodeKey: this.row.benTaskNodeKey,
+                    },
+                ],
+                },
+            ];
+            }
+            submitNodeForm(payLoad).then((response) => {
+            if (response.code == 200) {
+                this.$modal.msgSuccess("保存成功");
+            } else {
+                this.$modal.error("保存失败,请稍后再试");
+            }
+            });
+        }
+    },
+},
+    
+    computed: {
+        myFormData() {
+            return this.formData;
+            },
+            isEdit() {
+            return this.formData.resultMap?.id ? true : false;
+            }, 
+    }
+};
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 3 - 2
zkqy-ui/src/views/bussiness/processMange.vue

@@ -184,6 +184,7 @@
             :subTableName="subTableName"
             @addList="() => {}"
           ></DialogTemplate> -->
+          ></DialogTemplate> -->
           <component
             :is="myForm"
             :formData="formData"
@@ -222,6 +223,7 @@ import DialogTemplate from "@/views/dialogTemplate/components/index.vue";
 import GY01 from "./dialogCompments/GongYi/GY01.vue";
 import GY03 from "./dialogCompments/GongYi/GY03.vue";
 import CG1 from "./dialogCompments/test-component/CaiGou/CG1.vue";
+import CG02 from "./dialogCompments/test-component/CaiGou/CG02.vue";
 import KC1 from "./dialogCompments/test-component/KuCun/KC1.vue";
 import KC02 from "./dialogCompments/test-component/KuCun/KC02.vue";
 import GY06 from "./dialogCompments/GongYi/GY06.vue";
@@ -229,7 +231,7 @@ import GY06 from "./dialogCompments/GongYi/GY06.vue";
 export default {
   name: "processMange",
   props: [],
-  components: { GY01, DialogTemplate, CG1, KC1, GY06, GY03, KC02, GY02 },
+  components: { GY01, DialogTemplate, CG1,CG02, KC1, GY06, GY03, KC02, GY02 },
   dicts: ["bpm_type", "task_process_state"],
   data() {
     return {
@@ -238,7 +240,6 @@ export default {
       // 节点弹窗title
       nodeTitle: "节点弹窗",
       open: false,
-      // open: true,
       // 节点弹窗对应的formData
       commonData: {},
       taskType: 1,