Просмотр исходного кода

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend into dev

lucw 6 месяцев назад
Родитель
Сommit
6e6a93307d

+ 3 - 2
src/components/addDoc/doc_template.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="ele-body" style="height:60vh;overflow: auto;">
-    <el-card shadow="never" v-loading="loading">
+    <el-card shadow="never" >
       <ele-split-layout
         width="210px"
         allow-collapse
@@ -23,6 +23,7 @@
               :expand-on-click-node="false"
               :default-expand-all="true"
               @node-click="onNodeClick"
+              
             >
               <span class="custom-tree-node" slot-scope="{ node, data }">
                 <ElementTreeLine
@@ -66,7 +67,7 @@ export default {
 
   data() {
     return {
-      loading: true,
+      // loading: true,
       // 列表数据
       data: [],
       // fileType:0,

+ 11 - 7
src/components/addDoc/main.vue

@@ -20,9 +20,12 @@
     >
       <template v-slot:toolbar v-if="type != 'view'">
         <el-button type="primary" @click="fileEditOpen">本地上传</el-button>
-        <el-button type="primary" @click="fileShow = true">
+        <el-button type="primary" @click="openFileList(0)">
           关联文档库
         </el-button>
+        <el-button type="primary" @click="openFileList(1)">
+          关联个人文档库
+        </el-button>
       </template>
       <!-- 操作列 -->
       <template v-slot:action="{ row }">
@@ -168,6 +171,12 @@
     created() {},
 
     methods: {
+      openFileList(type) {
+        this.fileShow = true;
+        this.$nextTick(() => {
+          this.$refs.doc_templateRef.query(type);
+        });
+      },
       open(fileId, type) {
         //查看详情:view 新增:add
         this.showEditFlag = true;
@@ -177,12 +186,7 @@
         }
         this.init();
       },
-      openFileList(type) {
-        this.fileShow = true;
-        this.$nextTick(() => {
-          this.$refs.doc_templateRef.query(type);
-        });
-      },
+
       fileEditOpen() {
         this.$refs.fileEditRef.open();
       },

+ 6 - 6
src/views/documentManagement/certificateManagement/components/add-dialog.vue

@@ -203,16 +203,16 @@
           }
         ],
         rules: {
-          code: [
-            { required: true, trigger: 'blur', message: '请输入证照编号' }
-          ],
+          // code: [
+          //   { required: true, trigger: 'blur', message: '请输入证照编号' }
+          // ],
           // level: [{ required: true, trigger: 'change', message: '选择等级' }],
           type: [
             { required: true, trigger: 'change', message: '请选择证件类型' }
           ],
-          date: [
-            { required: true, trigger: 'change', message: '请选择有效期' }
-          ],
+          // date: [
+          //   { required: true, trigger: 'change', message: '请选择有效期' }
+          // ],
           holder: [
             { required: true, trigger: 'change', message: '请选择持证对象' }
           ],

+ 134 - 41
src/views/notifyManage/templateManage/components/addOrEditDialog.vue

@@ -33,6 +33,32 @@
           placeholder="请输入排序"
         />
       </el-form-item>
+      <el-form-item label="接收人类型:" prop="recipientType">
+        <el-select
+          :disabled="dialogType=='view'"
+          v-model="formData.recipientType"
+          placeholder="请选择接收人类型"
+          @change="handleRecipientTypeChange"
+        >
+          <el-option
+            v-for="item in recipientTypeOptions"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item v-if="formData.recipientType != 0" label="接收人:" prop="recipient">
+        <role-select v-if="formData.recipientType == 2" v-model="formData.recipient" />
+        <el-input
+          v-if="formData.recipientType == 1"
+          clearable
+          :disabled="dialogType=='view'"
+          v-model="formData.recipientName"
+          placeholder="请选择"
+          @click.native="handleRecipientClick"
+        />
+      </el-form-item>
       <el-form-item label="模板内容:" prop="content">
         <el-input
           clearable
@@ -63,22 +89,46 @@
       <el-button type="primary" :loading="loading" @click="save">确认</el-button>
       <el-button @click="closeDialog">返回</el-button>
     </template>
+    <staffSelection
+      ref="staffSelection"
+      @confirm="confirmStaffSelection"
+    ></staffSelection>
   </ele-modal>
 </template>
 
 <script>
 import dictMixins from '@/mixins/dictMixins';
 import {notifyTemplateGetByIdAPI, notifyTemplateSaveAPI, notifyTemplateUpdateAPI} from "@/api/notifyManage";
-
+import RoleSelect from '@/views/system/user/components/role-select.vue';
+import staffSelection from '@/views/enterpriseModel/dept/components/staffSelection.vue';
 export default {
   name: 'addOrEditDialog',
   props: {
     addOrEditDialogFlag: [Boolean],
   },
+  components: {
+    RoleSelect,
+    staffSelection
+  },
   mixins: [dictMixins],
   data() {
 
     return {
+      recipientTypeOptions: [
+        {
+          value: 0,
+          label: '业务自定义'
+        },
+        {
+          value: 1,
+          label: '指定人'
+        },
+        {
+          value: 2,
+          label: '指定角色'
+        },
+      ],
+      users: [],
       // 表单数据
       formData: {
         code: '',
@@ -87,57 +137,100 @@ export default {
         content: '',
         status: 1,
         remark: '',
+        recipientType: 0,
+        recipient: [],
+        recipientName: ''
       },
       title: null,
 
 
-      // 表单验证规则
-      rules: {
-        name: [
-          {
-            required: true,
-            message: '请输入模板名称',
-            trigger: 'blur'
-          }
-        ],
-        code: [
-          {
-            required: true,
-            message: '请输入模板型编码',
-            trigger: 'blur'
-          }
-        ],
-        nickname: [
-          {
-            required: true,
-            message: '请输入默认发送人',
-            trigger: 'blur'
-          }
-        ],
-        content: [
-          {
-            required: true,
-            message: '请输入模板内容',
-            trigger: 'blur'
-          }
-        ],
-        status: [
-          {
-            required: true,
-            message: '请选择状态',
-            trigger: 'change'
-          }
-        ],
-
-      },
+      
       dialogType: '',
       // 提交状态
       loading: false,
     };
   },
+  computed: {
+    // 表单验证规则
+      rules() {
+        return {
+          name: [
+            {
+              required: true,
+              message: '请输入模板名称',
+              trigger: 'blur'
+            }
+          ],
+          code: [
+            {
+              required: true,
+              message: '请输入模板型编码',
+              trigger: 'blur'
+            }
+          ],
+          nickname: [
+            {
+              required: true,
+              message: '请输入默认发送人',
+              trigger: 'blur'
+            }
+          ],
+          content: [
+            {
+              required: true,
+              message: '请输入模板内容',
+              trigger: 'blur'
+            }
+          ],
+          status: [
+            {
+              required: true,
+              message: '请选择状态',
+              trigger: 'change'
+            }
+          ],
+          recipientType: [
+            {
+              required: true,
+              message: '请选择接收人类型',
+              trigger: 'change'
+            }
+          ],
+          recipient: [
+            {
+              required: this.formData.recipientType == 0 ? false : true,
+              message: '请选择接收人',
+              trigger: 'change'
+            }
+          ],
+        }
+      }
+  },
   created() {
   },
   methods: {
+    handleRecipientTypeChange() {
+      this.formData.recipient = [];
+      this.formData.recipientName = '';
+    },
+    handleRecipientClick() {
+      this.$refs.staffSelection.open(
+          JSON.parse(JSON.stringify(this.formData.recipient))
+        );
+    },
+    
+    confirmStaffSelection(data) {
+      console.log(data);
+        this.formData.recipient = data.map(item => {
+          return {
+            ...item,
+            recipientId: item.id,
+            recipientName: item.name,
+            type: this.formData.recipientType
+          }
+        });
+        this.formData.recipientName = data.map(item => item.name).join(',');
+      },
     init(type, row = {}) {
       this.title = type == 'add' ? '新增' : '修改'
       this.dialogType = type
@@ -153,8 +246,8 @@ export default {
       this.$refs.formRef.validate(async (valid) => {
         if (!valid) return this.$message.warning('有必填项未填写,请检查');
         this.loading = true;
-        const params = {...this.formData};
 
+        const params = {...this.formData};
         const API = this.dialogType == 'add' ? notifyTemplateSaveAPI : notifyTemplateUpdateAPI
         try {
           await API(params)