|
|
@@ -0,0 +1,272 @@
|
|
|
+<style lang="scss">
|
|
|
+.avatar-uploader .el-upload {
|
|
|
+ border: 1px dashed #d9d9d9;
|
|
|
+ border-radius: 6px;
|
|
|
+ cursor: pointer;
|
|
|
+ position: relative;
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+
|
|
|
+.avatar-uploader .el-upload:hover {
|
|
|
+ border-color: #409eff;
|
|
|
+}
|
|
|
+
|
|
|
+.avatar-uploader-icon {
|
|
|
+ font-size: 28px;
|
|
|
+ color: #8c939d;
|
|
|
+ width: 178px;
|
|
|
+ height: 178px;
|
|
|
+ line-height: 178px;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+
|
|
|
+.avatar {
|
|
|
+ width: 178px;
|
|
|
+ height: 178px;
|
|
|
+ display: block;
|
|
|
+}
|
|
|
+</style>
|
|
|
+<template>
|
|
|
+ <section class="content">
|
|
|
+ <h4>注射打卡</h4>
|
|
|
+ <el-divider></el-divider>
|
|
|
+ <el-form label-width="80px" class="filter-form">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-form-item label="名称">
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ @clear="getData()"
|
|
|
+ v-model="queryParams.name"
|
|
|
+ placeholder="请输入名称"
|
|
|
+ size="mini"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-form-item label-width="10" style="margin-left: 10px">
|
|
|
+ <el-button type="primary" @click="getData" size="mini">筛选</el-button>
|
|
|
+ <el-button type="warning" size="mini" @click="downloadRecords">导出</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <el-table v-loading="loading" :data="list" height="50vh">
|
|
|
+ <el-table-column align="center" prop="name" label="名称" />
|
|
|
+ <el-table-column align="center" prop="code" label="编码" />
|
|
|
+ <el-table-column align="center" prop="mpro" label="注射产品" />
|
|
|
+ <el-table-column align="center" prop="zssjt0" label="注射时间" />
|
|
|
+ <el-table-column align="center" prop="ctime" label="打卡时间" />
|
|
|
+ <!-- <el-table-column align="center" prop="date" label="操作" width="160" fixed="right">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button @click="edit(scope.row.id)" size="mini" type="warning">编辑</el-button>
|
|
|
+ <el-button @click="del(scope.row.id)" size="mini" type="danger">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column> -->
|
|
|
+ </el-table>
|
|
|
+ <Page
|
|
|
+ ref="pageButton"
|
|
|
+ :current="form.page"
|
|
|
+ :page_size="form.page_size"
|
|
|
+ :total="total"
|
|
|
+ @pageChange="gopage"
|
|
|
+ />
|
|
|
+ <!-- 新增医生 -->
|
|
|
+ <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
+ <el-form-item label="名称" prop="name">
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model="form.name"
|
|
|
+ placeholder="请输入名称"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="手机号" prop="phone">
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model="form.phone"
|
|
|
+ placeholder="请输入手机号"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="医生类型" prop="role">
|
|
|
+ <el-select
|
|
|
+ v-model="form.role"
|
|
|
+ placeholder="请选择医生类型"
|
|
|
+ filterable
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in $const.doctorRoleList"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="医院" prop="hospital_name">
|
|
|
+ <el-input
|
|
|
+ clearable
|
|
|
+ v-model="form.hospital_name"
|
|
|
+ placeholder="请输入医院"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <!-- <el-form-item label="图片" prop>
|
|
|
+ <el-upload
|
|
|
+ class="avatar-uploader"
|
|
|
+ action="/api/admin/uploadfile"
|
|
|
+ :data="{watermark:0}"
|
|
|
+ :show-file-list="false"
|
|
|
+ :on-success="handleAvatarSuccess"
|
|
|
+ :before-upload="beforeAvatarUpload"
|
|
|
+ >
|
|
|
+ <img v-if="form.img" :src="form.img" class="avatar" />
|
|
|
+ <i v-else class="el-icon-plus avatar-uploader-icon"></i>
|
|
|
+ </el-upload>
|
|
|
+ </el-form-item> -->
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
+ <el-button @click="open = false">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </section>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import Page from "../../components/Page";
|
|
|
+export default {
|
|
|
+ components: {
|
|
|
+ Page
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ loading: false,
|
|
|
+ queryParams: {
|
|
|
+ page: 1
|
|
|
+ },
|
|
|
+ form: {},
|
|
|
+ form1: {},
|
|
|
+ form2: {},
|
|
|
+ list: [{}, {}],
|
|
|
+ total: 0,
|
|
|
+ title: "新增用户",
|
|
|
+ open: false,
|
|
|
+ doctorList: [],
|
|
|
+ rules: {}
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ del(id) {
|
|
|
+ this.$confirm("确认删除?", "提示", {
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ this.$api
|
|
|
+ .delPatientCaseInfo({
|
|
|
+ id: id
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ if(!res.data.code){
|
|
|
+ this.$msgSuccess("删除成功")
|
|
|
+ this.getData();
|
|
|
+ }else{
|
|
|
+ this.$msgError(res.data.message)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ gopage(size) {
|
|
|
+ if (size) {
|
|
|
+ this.queryParams.page_size = size;
|
|
|
+ }
|
|
|
+ this.queryParams.page = this.$refs.pageButton.page;
|
|
|
+ this.getData();
|
|
|
+ },
|
|
|
+ getData() {
|
|
|
+ this.loading = true;
|
|
|
+ this.$api.getPatientRecordsList(this.queryParams).then(res => {
|
|
|
+ this.list = res.data.data.list;
|
|
|
+ this.total = res.data.data.total;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleAdd() {
|
|
|
+ this.open = true;
|
|
|
+ this.title = "新增医生";
|
|
|
+ this.form = {};
|
|
|
+ },
|
|
|
+ edit(id) {
|
|
|
+ this.title = "编辑医生";
|
|
|
+ this.$api
|
|
|
+ .getPatientCaseInfo({
|
|
|
+ id: id
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ this.form = res.data.data;
|
|
|
+ this.open = true;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 提交按钮 */
|
|
|
+ submitForm() {
|
|
|
+ this.$refs["form"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ if (this.form.id != null) {
|
|
|
+ this.$api.editPatientCaseInfo(this.form).then(res => {
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ this.msgSuccess("成功!");
|
|
|
+ this.open = false;
|
|
|
+ this.getData();
|
|
|
+ } else {
|
|
|
+ this.msgError(res.data.message);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$api.addPatientCaseInfo(this.form).then(res => {
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ this.msgSuccess("成功!");
|
|
|
+ this.open = false;
|
|
|
+ this.getData();
|
|
|
+ } else {
|
|
|
+ this.msgError(res.data.message);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ remoteMethod(query) {
|
|
|
+ if (query !== "") {
|
|
|
+ // this.loading = true;
|
|
|
+ this.$api
|
|
|
+ .getDoctorsSearchList({
|
|
|
+ name: query
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ this.doctorList = res.data.data;
|
|
|
+ this.$set(this.doctorList, res.data.data);
|
|
|
+ // this.loading = false;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.doctorList = [];
|
|
|
+ }
|
|
|
+ },
|
|
|
+ downloadRecords(){
|
|
|
+ this.loading = true;
|
|
|
+ this.$api.downloadRecords(this.queryParams).then((res)=>{
|
|
|
+ var elink = document.createElement('a');
|
|
|
+ let blob=new Blob([res.data], {type: 'application/vnd.ms-excel,charset=UTF-8'});
|
|
|
+ let objUrl=URL.createObjectURL(blob);
|
|
|
+ let file_name=decodeURIComponent(res.headers['content-disposition'].split('=')[1]);
|
|
|
+ console.log(file_name)
|
|
|
+ elink.download = this.queryParams.stock_date + this.queryParams.groupName;
|
|
|
+ elink.style.display = 'none';
|
|
|
+ elink.href = objUrl;
|
|
|
+ document.body.appendChild(elink);
|
|
|
+ elink.click();
|
|
|
+ document.body.removeChild(elink);
|
|
|
+ this.loading = false;
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getData();
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|