From 3f637962a3c8c0f239bf4141e9d0f451fd871395 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=AC=E9=8B=86=E5=B1=BE?= <804461479@qq.com> Date: Wed, 21 May 2025 20:24:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E9=BB=91=E5=90=8D=E5=8D=95=EF=BC=8C?= =?UTF-8?q?=E5=91=98=E5=B7=A5=E5=85=B3=E6=80=80=E5=8F=8A=E7=A6=BB=E8=81=8C?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/staff/care/dialogshow.vue | 127 +++++++++++ src/views/staff/care/drawershow.vue | 172 +++++++++++++++ src/views/staff/care/list.vue | 324 ++++++++++++++++++++++++++++ src/views/staff/care/view.vue | 88 ++++++++ 4 files changed, 711 insertions(+) create mode 100644 src/views/staff/care/dialogshow.vue create mode 100644 src/views/staff/care/drawershow.vue create mode 100644 src/views/staff/care/list.vue create mode 100644 src/views/staff/care/view.vue diff --git a/src/views/staff/care/dialogshow.vue b/src/views/staff/care/dialogshow.vue new file mode 100644 index 0000000..9a5b9d1 --- /dev/null +++ b/src/views/staff/care/dialogshow.vue @@ -0,0 +1,127 @@ +<template> + <!-- 寮瑰嚭妗嗚〃鍗� --> + <el-dialog :title="title" :visible.sync="open" width="90%" append-to-body> + <el-form ref="form" :model="form" :rules="rules" label-width="120px"> + <el-row> + <Field label="鍛樺伐濮撳悕" prop="staffName" v-model="form.staffName" placeholder="璇疯緭鍏ュ憳宸ュ鍚�"/> + <Field label="鍑虹敓鏃ユ湡" prop="birthday" v-model="form.birthday" type="date" /> + <Field label="鎵€灞為儴闂�" prop="deptId" v-model="form.deptId" placeholder="璇疯緭鍏ユ墍灞為儴闂�"/> + <Field label="鎵€灞為儴闂ㄥ悕绉�" prop="deptName" v-model="form.deptName" placeholder="璇疯緭鍏ユ墍灞為儴闂ㄥ悕绉�"/> + <Field label="鑱屼綅ID" prop="jobId" v-model="form.jobId" placeholder="璇疯緭鍏ヨ亴浣岻D"/> + <Field label="鑱屼綅鍚嶇О" prop="jobName" v-model="form.jobName" placeholder="璇疯緭鍏ヨ亴浣嶅悕绉�"/> + <Field label="鍏ヨ亴鏃堕棿" prop="entryDate" v-model="form.entryDate" type="date" /> + <Field label="鍏虫€€绫诲瀷" prop="careType" v-model="form.careType" type="select" :enumData="dict.careType" placeholder="璇烽€夋嫨鍏虫€€绫诲瀷"/> + <Field label="鍙戦€佺姸鎬�" prop="sendStatus" v-model="form.sendStatus" type="select" :enumData="dict.sendStatus" placeholder="璇烽€夋嫨鍙戦€佺姸鎬�"/> + <Field label="鍏虫€€鍐呭"><editor v-model="form.content" :min-height="256"/></Field> + + </el-row> + + </el-form> + <div slot="footer" class="dialog-footer"> + <el-button type="primary" v-if="pageInfo.type !== 'view'" @click="submitForm">纭� 瀹�</el-button> + <el-button @click="cancel">鍙� 娑�</el-button> + </div> + </el-dialog> +</template> + +<script> + import form from "@/assets/mixins/formdialog"; + import dialogShow from "./dialogshow"; + import Editor from '@/components/Editor'; + export default { + mixins: [form], + components: { + dialogShow , + Editor, + }, + data() { + return { + // 閬僵灞� + loading: true, + // 寮瑰嚭灞傛爣棰� + title: "鍛樺伐鍏虫€€淇℃伅", + // 鏄惁鏄剧ず寮瑰嚭灞� + open: false, + toString:[ + "careType", + "sendStatus", + ], + // 琛ㄥ崟鏍¢獙 + rules: { + staffName: [ + {required: true,message: "璇疯緭鍏ュ憳宸ュ鍚�", trigger: "blur" }, + {max: 64,message: "鏈€澶氬彧鑳藉綍鍏�64涓瓧绗�",trigger: "blur",}, + ], + createTime: [ + {required: true,message: "璇烽€夋嫨鍒涘缓鏃堕棿" }, + ], + } + }; + }, + + methods: { + /** 缂栬緫 */ + edit(row) { + this.reset() + this.query = { id: row.id }; + this.urls.currUrl ="staff/care/edit"; + this.getData(); + this.pageInfo.type="edit" + this.title = "淇敼鍛樺伐鍏虫€€淇℃伅"; + }, + /** 鏂板 */ + add(row) { + this.reset() + this.urls.currUrl = "staff/care/add"; + this.getData(); + this.pageInfo.type="add" + this.title = "鏂板鍛樺伐鍏虫€€淇℃伅"; + }, + /** 鏌ョ湅*/ + view(row) { + this.reset() + this.query = { id: row.id }; + this.urls.currUrl ="staff/care/view"; + this.getData(); + this.pageInfo.type="view" + this.title = "鍛樺伐鍏虫€€淇℃伅璇︾粏"; + }, + /**鍙栨秷鎸夐挳 */ + cancel() { + this.open = false; + }, + /**鑾峰彇鏁版嵁鍚庡脊妗� */ + afterRender(data) { + this.open = true; + }, + + afterSubmit(data) { + this.open = false; + this.$emit("ok"); + }, + + // 琛ㄥ崟閲嶇疆 + reset() { + this.form = { + staffId : null, + staffName : "", + birthday : null, + deptId : null, + deptName : "", + jobId : null, + jobName : "", + entryDate : null, + careType : 1, + sendStatus : 0, + content : "", + }; + this.resetForm("form"); + }, + resetForm(refName) { + if (this.$refs[refName]) { + this.$refs[refName].resetFields(); + } + }, + }, + }; +</script> diff --git a/src/views/staff/care/drawershow.vue b/src/views/staff/care/drawershow.vue new file mode 100644 index 0000000..058e8a6 --- /dev/null +++ b/src/views/staff/care/drawershow.vue @@ -0,0 +1,172 @@ +<template> + <!-- 寮瑰嚭妗嗚〃鍗� --> + <el-drawer + :title="title" + :visible.sync="open" + :direction="direction" + size="50%" + > + <el-form ref="form" :model="form" :rules="rules" label-width="120px"> + <el-row> + <Field + label="鍛樺伐濮撳悕" + prop="staffId" + v-model="form.staffId" + type="select" + :enumData="dict.staffId" + placeholder="璇疯緭鍏ュ憳宸ュ鍚�" + /> + <Field + label="鍑虹敓鏃ユ湡" + prop="birthday" + v-model="form.birthday" + type="date" + /> + <Field + label="鎵€灞為儴闂�" + prop="deptId" + v-model="form.deptId" + type="select" + :enumData="dict.deptId" + placeholder="璇疯緭鍏ユ墍灞為儴闂�" + /> + <!-- <Field + label="鑱屼綅ID" + prop="jobId" + v-model="form.jobId" + type="select" + :enumData="dict.jobId" + placeholder="璇疯緭鍏ヨ亴浣岻D" + /> --> + <Field + label="鍏ヨ亴鏃堕棿" + prop="entryDate" + v-model="form.entryDate" + type="date" + /> + <Field + label="鍏虫€€绫诲瀷" + prop="careType" + v-model="form.careType" + type="select" + :enumData="dict.careType" + placeholder="璇烽€夋嫨鍏虫€€绫诲瀷" + /> + <!-- <Field label="鏄惁鍙戦€佺煭淇�" prop="isSend"> + <el-switch + v-model="form.isSend" + active-color="#13ce66" + inactive-color="#ff4949" + active-value="1" + inactive-value="0" + > + </el-switch> + </Field> --> + <!-- <Field + label="鍏虫€€鍐呭" + prop="content" + v-model="form.content" + type="textarea" + ></Field> --> + </el-row> + + <form-buttons @submit="submitForm" noCancelBtn /> + </el-form> + </el-drawer> +</template> + +<script> +import form from "@/assets/mixins/formdialog"; +export default { + name: "StaffCareDetail", + mixins: [form], + components: {}, + created() { + this.changePath("staff/care"); + }, + data() { + return { + // 閬僵灞� + loading: true, + // 寮瑰嚭灞傛爣棰� + title: "鍛樺伐鍏虫€€淇℃伅", + // 鏄惁鏄剧ず寮瑰嚭灞� + open: false, + direction: "rtl", + toDate: ["birthday", "entryDate"], + // 琛ㄥ崟鏍¢獙 + rules: { + staffId: [ + { required: true, message: "璇疯緭鍏ュ憳宸ュ鍚�", trigger: "blur" }, + ], + createTime: [{ required: true, message: "璇烽€夋嫨鍒涘缓鏃堕棿" }], + }, + }; + }, + + methods: { + /** 缂栬緫 */ + edit(row) { + this.reset(); + this.query = { id: row.id }; + this.urls.currUrl = "staff/care/edit"; + this.getData(); + this.pageInfo.type = "edit"; + this.title = "淇敼鍛樺伐鍏虫€€淇℃伅"; + }, + /** 鏂板 */ + add(row) { + this.reset(); + this.urls.currUrl = "staff/care/add"; + this.getData(); + this.pageInfo.type = "add"; + this.title = "鏂板鍛樺伐鍏虫€€淇℃伅"; + }, + /** 鏌ョ湅*/ + view(row) { + this.reset(); + this.query = { id: row.id }; + this.urls.currUrl = "staff/care/view"; + this.getData(); + this.pageInfo.type = "view"; + this.title = "鍛樺伐鍏虫€€淇℃伅璇︾粏"; + }, + /**鍙栨秷鎸夐挳 */ + cancel() { + this.open = false; + }, + /**鑾峰彇鏁版嵁鍚庡脊妗� */ + afterRender(data) { + this.open = true; + }, + + afterSubmit(data) { + this.open = false; + this.$emit("ok"); + }, + + // 琛ㄥ崟閲嶇疆 + reset() { + this.form = { + staffId: null, + staffName: "", + birthday: null, + deptId: null, + deptName: "", + jobId: null, + jobName: "", + entryDate: null, + careType: 1, + sendStatus: 0, + content: "", + }; + this.resetForm("form"); + }, + resetForm(refName) { + if (this.$refs[refName]) { + this.$refs[refName].resetFields(); + } + }, + }, +}; +</script> diff --git a/src/views/staff/care/list.vue b/src/views/staff/care/list.vue new file mode 100644 index 0000000..45cd2cf --- /dev/null +++ b/src/views/staff/care/list.vue @@ -0,0 +1,324 @@ +<template> + <div class="page"> + <LayoutTable :data="tableData" notDel :config="tableConfig"> + <!-- <el-button + slot="table-head-left2" + style="margin-left: 10px" + icon="el-icon-tickets" + size="mini" + @click="handleImport" + >瀵煎叆</el-button + > --> + + <el-button + slot="table-head-left2" + style="margin-left: 10px" + icon="el-icon-tickets" + size="mini" + @click="doExport" + :disabled="isExport" + >瀵煎嚭</el-button + > + <span slot="table-head-left2" v-if="$route.query.careType"> + <span style="color: #999; font-size: 14px">鏄惁鍙戦€佺煭淇★細</span> + <el-switch + v-if="$route.query.careType == 1" + v-model="tableData.StaffCareBirthdaySend" + active-color="#13ce66" + inactive-color="#ff4949" + active-value="1" + inactive-value="0" + @change="handleChange" + > + </el-switch> + <el-switch + v-if="$route.query.careType == 2" + v-model="tableData.StaffCareEntryDateSend" + active-color="#13ce66" + inactive-color="#ff4949" + active-value="1" + inactive-value="0" + @change="handleChange" + > + </el-switch> + </span> + <span + slot="table-head-right2" + v-if="$route.query.careType" + style=" + color: #999; + font-size: 14px; + display: flex; + align-items: center; + margin-right: 10px; + " + > + <span v-if="$route.query.year && $route.query.month" + >{{ $route.query.year + "骞�" + $route.query.month + "鏈�" + }}{{ + $route.query.careType == 1 ? "杩囩敓鏃ョ殑鍛樺伐" : "杩囧叆鑱屽懆骞寸殑鍛樺伐" + }} + </span> + <span v-else + >褰撴湀{{ + $route.query.careType == 1 ? "杩囩敓鏃ョ殑鍛樺伐" : "杩囧叆鑱屽懆骞寸殑鍛樺伐" + }} + </span> + + <span style="color: #1a7af8; font-size: 14px"> + {{ + `锛堝叡${ + $route.query.careType == 1 ? tableData.shengri : tableData.ruzhi + }浜猴級` + }} + </span> + </span> + </LayoutTable> + + <!-- 鍛樺伐鍏虫€€淇℃伅瀵煎叆瀵硅瘽妗� --> + <el-dialog + :title="upload.title" + :visible.sync="upload.open" + width="400px" + append-to-body + > + <el-upload + ref="upload" + :limit="1" + accept=".xlsx, .xls" + :headers="upload.headers" + :action="upload.url + '?updateSupport=' + upload.updateSupport" + :disabled="upload.isUploading" + :on-progress="handleFileUploadProgress" + :on-success="handleFileSuccess" + :auto-upload="false" + drag + > + <i class="el-icon-upload"></i> + <div class="el-upload__text"> + 灏嗘枃浠舵嫋鍒版澶勶紝鎴� + <em>鐐瑰嚮涓婁紶</em> + </div> + <div class="el-upload__tip" slot="tip"> + <el-checkbox v-model="upload.updateSupport" />鏄惁鏇存柊宸茬粡瀛樺湪鐨勬暟鎹� + <el-link + type="primary" + style="font-size: 14px" + @click="downloadTemplate" + >涓嬭浇妯℃澘</el-link + > + </div> + <div class="el-upload__tip" style="color: red" slot="tip"> + 鎻愮ず锛氫粎鍏佽瀵煎叆鈥渪ls鈥濇垨鈥渪lsx鈥濇牸寮忔枃浠讹紒 + </div> + </el-upload> + <div slot="footer" class="dialog-footer"> + <el-button type="primary" @click="submitFileForm">纭� 瀹�</el-button> + <el-button @click="upload.open = false">鍙� 娑�</el-button> + </div> + </el-dialog> + + <drawer-show ref="drawerform" @ok="getData" /> + </div> +</template> + +<script> +/** 琛ㄥ崟寮瑰嚭妗嗘ā寮忛渶寮曞叆 */ +import drawerShow from "./drawershow"; +import table from "@/assets/mixins/table"; +export default { + name: "StaffCareList", + components: { + drawerShow, + }, + mixins: [table], + created() {}, + data() { + return { + isSend: 0, + // 鐢ㄦ埛瀵煎叆鍙傛暟 + upload: { + // 鏄惁鏄剧ず寮瑰嚭灞傦紙鍛樺伐鍏虫€€淇℃伅瀵煎叆锛� + open: false, + // 寮瑰嚭灞傛爣棰橈紙鍛樺伐鍏虫€€淇℃伅瀵煎叆锛� + title: "瀵煎叆鍛樺伐鍏虫€€淇℃伅鏁版嵁", + // 鏄惁绂佺敤涓婁紶 + isUploading: false, + // 鏄惁鏇存柊宸茬粡瀛樺湪鐨勬暟鎹� + updateSupport: 0, + // 涓婁紶鐨勫湴鍧€ + url: "/attendance/staff/care/importData", + }, + isExport: false, + config: { + isshowTabPane: true, + search: [ + { + name: "careType", + type: "radio", + label: "鍏虫€€绫诲瀷", + }, + { + name: "staffName", + type: "text", + label: "鍛樺伐濮撳悕", + fuzzy: true, + }, + + { + name: "yearmonth", + type: "month", + label: "璇烽€夋嫨鏈堜唤", + fuzzy: false, + }, + ], + columns: [ + { type: "selection", width: 60 }, + { type: "index", label: "搴忓彿", width: 50 }, + { label: "鍛樺伐濮撳悕", prop: "staffName" }, + + { + label: "鍏ヨ亴鏃堕棿", + prop: "entryDate", + formatter: this.formatterDateOnly, + }, + + { + label: "鐢熸棩鏃堕棿", + prop: "birthday", + formatter: this.formatterDateOnly, + }, + { label: "鍏虫€€绫诲瀷", prop: "careType", formatter: this.formatter }, + { label: "鍙戦€佺姸鎬�", prop: "sendStatus", formatter: this.formatter }, + + // { + // label: "鍒涘缓鐢ㄦ埛", + // prop: "createUserId", + // formatter: this.formatter, + // }, + { + label: "鎿嶄綔", + width: 240, + formatter: (row) => { + return ( + <table-buttons + noAdd + noView + noDel + row={row} + onEdit={this.toEdit} + onView={this.toView} + onDel={this.toDel} + /> + ); + }, + }, + ], + }, + }; + }, + methods: { + // 鏄惁鍙戦€佺煭淇� + handleChange(val) { + this.$post("/staff/care/sendSwitch", { + paramValue: val, + paramType: + this.$route.query.careType == 1 + ? "StaffCareBirthdaySend" + : this.$route.query.careType == 2 + ? "StaffCareEntryDateSend" + : "", + }) + .then((res) => { + console.log(res); + if (res.code == 1) { + this.$message.success(res.msg); + } + }) + .catch((error) => { + this.$message.error(error.message); + }); + }, + /** 瀵煎叆 */ + handleImport() { + this.upload.title = "鍛樺伐鍏虫€€淇℃伅瀵煎叆"; + this.upload.open = true; + }, + /** 涓嬭浇妯℃澘鎿嶄綔 */ + downloadTemplate() { + this.isExport = true; + this.$download("/staff/care/downloadTemplate", {}, { type: "excel" }) + .then(() => (this.isExport = false)) + .catch((error) => { + this.isExport = false; + this.$message.error(error.message); + }); + }, + /** 鏂囦欢涓婁紶涓鐞� */ + handleFileUploadProgress(event, file, fileList) { + this.upload.isUploading = true; + }, + /** 鏂囦欢涓婁紶鎴愬姛澶勭悊 */ + handleFileSuccess(response, file, fileList) { + this.upload.open = false; + this.upload.isUploading = false; + this.$refs.upload.clearFiles(); + this.$alert(response.msg, "瀵煎叆缁撴灉", { dangerouslyUseHTMLString: true }); + this.getData(); + }, + /** 鎻愪氦涓婁紶鏂囦欢 */ + submitFileForm() { + this.$refs.upload.submit(); + }, + /** 瀵煎嚭Excel */ + doExport() { + this.isExport = true; + let params = {}; + for (let value of this.config.search) { + if (this.query[value.name]) { + params[value.name] = this.query[value.name]; + } + } + if (this.selection.length > 0) { + params["idList"] = this.selection; + } + this.$download( + "/staff/care/exportExcel", + { + ...params, + }, + { type: "excel" } + ) + .then(() => (this.isExport = false)) + .catch((error) => { + this.isExport = false; + this.$message.error(error.message); + }); + }, + /** 閲嶅啓鏂板鏂规硶 */ + toAdd(row) { + this.$refs.drawerform.add(row); + }, + /** 閲嶅啓缂栬緫鏂规硶 */ + toEdit(row) { + this.$refs.drawerform.edit(row); + }, + /** 閲嶅啓鏌ョ湅鏂规硶 */ + toView(row) { + this.$refs.drawerform.view(row); + }, + }, +}; +</script> +<style lang="less" scoped> +/deep/.el-radio-button__inner { + border: 1px solid #dcdfe6 !important; +} +/deep/.el-radio-button__orig-radio:checked + .el-radio-button__inner { + color: #fff !important; + background-color: #409eff !important; + border-color: #409eff !important; + -webkit-box-shadow: -1px 0 0 0 #409eff !important; + box-shadow: -1px 0 0 0 #409eff !important; +} +</style> \ No newline at end of file diff --git a/src/views/staff/care/view.vue b/src/views/staff/care/view.vue new file mode 100644 index 0000000..bb26d5b --- /dev/null +++ b/src/views/staff/care/view.vue @@ -0,0 +1,88 @@ +<template> + <layout-view> + <el-descriptions :title="title" :column="column" :size="size" :colon="false" border> + <template slot="title"> + <i class="el-icon-tickets"></i> + 鍩烘湰璇︾粏淇℃伅 + </template> + <template slot="extra"> + <el-button type="primary" @click="$router.go(-1)" size="small">杩斿洖</el-button> + </template> + <el-descriptions-item label="鍛樺伐濮撳悕" label-class-name="labelClass" content-class-name="contentClass"> + {{form.staffName}} + </el-descriptions-item> + <el-descriptions-item label="鍑虹敓鏃ユ湡" label-class-name="labelClass" content-class-name="contentClass"> + {{ util_formatterDate(form.birthday)}} + </el-descriptions-item> + <el-descriptions-item label="鎵€灞為儴闂�" label-class-name="labelClass" content-class-name="contentClass"> + {{form.deptId}} + </el-descriptions-item> + <el-descriptions-item label="鎵€灞為儴闂ㄥ悕绉�" label-class-name="labelClass" content-class-name="contentClass"> + {{form.deptName}} + </el-descriptions-item> + <el-descriptions-item label="鑱屼綅ID" label-class-name="labelClass" content-class-name="contentClass"> + {{form.jobId}} + </el-descriptions-item> + <el-descriptions-item label="鑱屼綅鍚嶇О" label-class-name="labelClass" content-class-name="contentClass"> + {{form.jobName}} + </el-descriptions-item> + <el-descriptions-item label="鍏ヨ亴鏃堕棿" label-class-name="labelClass" content-class-name="contentClass"> + {{ util_formatterDate(form.entryDate)}} + </el-descriptions-item> + <el-descriptions-item label="鍏虫€€绫诲瀷" label-class-name="labelClass" content-class-name="contentClass"> + {{ util_formatters("careType", form.careType) }} + </el-descriptions-item> + <el-descriptions-item label="鍙戦€佺姸鎬�" label-class-name="labelClass" content-class-name="contentClass"> + {{ util_formatters("sendStatus", form.sendStatus) }} + </el-descriptions-item> + <el-descriptions-item label="鍏虫€€鍐呭" label-class-name="labelClass" content-class-name="contentClass"> + <editor v-model="form.content" :min-height="256"/> + </el-descriptions-item> + </el-descriptions> + + </layout-view> +</template> + +<script> + import view from "@/assets/mixins/view"; + import Editor from '@/components/Editor'; + export default { + mixins: [view], + components: { + Editor, + }, + methods: { + + }, + data() { + return { + size:"small", + column:2, + toString:[ + "careType", + "sendStatus", + ], + toArrays: [ + + ], + toDate: [ + + ] + } + } + } +</script> +<style lang="less"> + .labelClass{ + width: 200px; + } + .el-descriptions__body{ + margin-left: 5px; + margin-right: 5px; + color: #606266; + background-color: #FFF; + } + .contentClass{ + width: 600px; + } +</style> \ No newline at end of file -- 2.24.3