From 14d29f928b24d203e76f1dcefc1a51182657cd45 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期一, 10 三月 2025 16:29:09 +0800
Subject: [PATCH] Merge branch 'dev' of http://114.132.189.42:9002/r/center-lims-before-ruoyi into dev
---
src/views/CNAS/personnel/personnelInfo/Department/components/Communicate/Add.vue | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 116 insertions(+), 0 deletions(-)
diff --git a/src/views/CNAS/personnel/personnelInfo/Department/components/Communicate/Add.vue b/src/views/CNAS/personnel/personnelInfo/Department/components/Communicate/Add.vue
new file mode 100644
index 0000000..d22914f
--- /dev/null
+++ b/src/views/CNAS/personnel/personnelInfo/Department/components/Communicate/Add.vue
@@ -0,0 +1,116 @@
+<template>
+ <div class="add">
+ <el-dialog :title="isEdit ? '缂栬緫闄勪欢璧勬枡' : '鏂板闄勪欢璧勬枡'" :visible.sync="dialogVisible" width="40%">
+ <el-form :model="form" label-width="80px" size="small">
+ <el-form-item label="娌熼�氫汉">
+ <el-select v-model="form.userId" placeholder="璇烽�夋嫨" style="width: 100%" multiple>
+ <el-option v-for="(item, index) in userList" :key="index" :label="item.name"
+ :value="item.id"></el-option>
+ </el-select>
+ </el-form-item>
+ <el-form-item label="娌熼�氭椂闂�">
+ <el-date-picker v-model="form.communicationTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
+ placeholder="璇烽�夋嫨鏃ユ湡鏃堕棿" style="width: 100%">
+ </el-date-picker>
+ </el-form-item>
+ <el-form-item label="娌熼�氬湴鐐�">
+ <el-input v-model="form.communicationPlace" placeholder="璇烽�夋嫨"></el-input>
+ </el-form-item>
+ <el-form-item label="娌熼�氬唴瀹�">
+ <el-input v-model="form.communicationContent" placeholder="璇烽�夋嫨"></el-input>
+ </el-form-item>
+ </el-form>
+ <div slot="footer" class="foot">
+ <el-button @click="dialogVisible = false">鍙� 娑�</el-button>
+ <el-button type="primary" :loading="loading" @click="submitForm">纭� 瀹�</el-button>
+ </div>
+ </el-dialog>
+ </div>
+</template>
+<script>
+import {
+ selectUserList,
+ addOrUpdatePersonCommunicationAbility
+} from '@/api/cnas/personnel/personnelInfo.js'
+export default {
+ data() {
+ return {
+ isEdit: false,
+ dialogVisible: false,
+ form: {
+ id: undefined,
+ userId: [],
+ communicationTime: undefined,
+ communicationPlace: undefined,
+ communicationContent: undefined
+ },
+ loading: false,
+ userList: []
+ }
+ },
+ methods: {
+ /**
+ * @desc 鏄剧ず妯℃�佹
+ * @param {*} row
+ * @param {*} type
+ */
+ openDialog(row, type) {
+ this.getUserList()
+ this.dialogVisible = true
+ if (type) {
+ this.isEdit = true
+ this.form.id = row.id
+ this.form.userId = row.userId.split(',').map(m => Number(m))
+ this.form.communicationTime = row.communicationTime
+ this.form.communicationPlace = row.communicationPlace
+ this.form.communicationContent = row.communicationContent
+ } else {
+ this.isEdit = false
+ this.form.id = undefined
+ this.form.userId = []
+ this.form.communicationTime = undefined
+ this.form.communicationPlace = undefined
+ this.form.communicationContent = undefined
+ }
+ },
+ /**
+ * @desc 鑾峰彇鐢ㄦ埛淇℃伅
+ */
+ async getUserList() {
+ const { code, data } = await selectUserList()
+ if (code == 200) {
+ this.userList = data
+ }
+ },
+ /**
+ * @desc 鎻愪氦琛ㄥ崟
+ */
+ async submitForm() {
+ this.loading = true
+ const { code, data } = await addOrUpdatePersonCommunicationAbility({
+ id: this.form.id,
+ userId: this.form.userId.join(','),
+ communicationTime: this.form.communicationTime,
+ communicationPlace: this.form.communicationPlace,
+ communicationContent: this.form.communicationContent,
+ })
+ if (code == 200) {
+ this.$emit('submit')
+ this.dialogVisible = false
+ } else {
+ this.$message.error(this.isEdit ? '缂栬緫澶辫触' : '鏂板澶辫触')
+ }
+ this.loading = false
+ }
+ }
+}
+</script>
+<style scoped>
+.foot {
+ width: 100%;
+}
+
+.add>>>.el-dialog__footer {
+ padding-right: 20px;
+}
+</style>
--
Gitblit v1.9.3