Bladeren bron

下一步选择责任人优化

wyh 1 jaar geleden
bovenliggende
commit
d63f191dce
1 gewijzigde bestanden met toevoegingen van 141 en 0 verwijderingen
  1. 141 0
      itdmWeb/src/views/module-iTDM/flowpath/modules/ItdmNextModal.vue

+ 141 - 0
itdmWeb/src/views/module-iTDM/flowpath/modules/ItdmNextModal.vue

@@ -0,0 +1,141 @@
+<template>
+  <a-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <a-form-model ref="form" :model="model" :rules="validatorRules">
+      <a-row>
+        <a-col :span="24">
+          <a-form-model-item label="责任人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="username">
+            <a-select
+            v-model="model.username"
+            placeholder="请选择责任人"
+            show-search
+            allowClear
+            option-label-prop="label">
+                <a-select-option
+                v-for="item in zrrOptions"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value">
+                <!-- {{item.value+'('+item.label+')'}} -->
+                <span style="float: left">{{ item.label }}</span>
+                <span style="float: right; color: #8492a6; font-size: 13px">{{ item.value }}</span>
+                </a-select-option>
+            </a-select>
+            <!-- <j-dict-select-tag v-model="model.username" placeholder="请选择用户名称" 
+                   dictCode="sys_user,realname,username"/> -->
+          </a-form-model-item>
+        </a-col>
+      </a-row>
+    </a-form-model>
+  </a-modal>
+</template>
+
+<script>
+
+import { getFirNextZrr, getNextZrr, runFlowPathPass1} from '@/api/api'
+
+export default{
+    props: {
+      fatherMethod: {
+        type: Function,
+        default: null
+      }
+    },
+    data() {
+        return {
+            model:{},
+            title:'是否通过',
+            width:800,
+            visible: false,
+            disableSubmit: false,
+            labelCol: {
+            xs: { span: 24 },
+            sm: { span: 5 },
+            },
+            wrapperCol: {
+            xs: { span: 24 },
+            sm: { span: 16 },
+            },
+            validatorRules: {
+                username: [
+                    { required: true, message: '请选择责任人!'},
+                ],
+            },
+            // 责任人
+            zrrOptions: [],
+            // 当前点击业务详情
+            record: {}
+        }
+    },
+    methods: {
+      next (record) {
+        this.visible=true
+        var data = { 'runFlowPath': record.id }
+        getNextZrr(data).then((res) =>{
+            this.zrrOptions = res.map(res => {
+                return {
+                    value: res.userName,  //传的值
+                    label: res.realName,  //展示
+                }
+            })
+        })
+        this.record = record
+      },
+      handleOk () {
+        const that = this;
+        // 触发表单验证
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            console.log(this.record.id)
+            let that = this
+            if (that.record.id != undefined) {
+                // 下一步
+                const data = {
+                    runFlowPath: that.record.id,
+                    nextStepUser: that.model.username
+                }
+                // var data = { 'runFlowPath': that.record.id, 'nextStepUser': that.model.username}
+                runFlowPathPass1(data).then(response => {
+                    if (response.code == '200') {
+                        that.visible=false
+                        that.record = {};
+                        that.model= {}
+                        // 调用父页面方法
+                        // window.parent.loadData(1);
+                        if (this.fatherMethod) {
+                            this.fatherMethod(1);
+                        }
+                    }
+                    if (response.code == '500') {
+                        that.$message.error(response.message)
+                    }
+                })
+            } else {
+                // 新增
+            }
+          }
+        })
+
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+        // this.$emit('close');
+        // this.visible = false;
+        this.record = {};
+        this.model= {}
+      }
+
+    }
+}
+</script>