| | |
| | | </el-select> |
| | | <i class="el-icon-circle-plus-outline" @click="handleAdd"></i> |
| | | </el-form-item> |
| | | <el-form-item label="部门" prop="dwDeptName"> |
| | | <!-- <el-form-item label="部门" prop="dwDeptName"> |
| | | <el-select |
| | | v-model="objs.dwDeptName" |
| | | placeholder="请选择部门" |
| | |
| | | /> |
| | | </el-select> |
| | | <i class="el-icon-circle-plus-outline" @click="handleAddbumen"></i> |
| | | </el-form-item> |
| | | </el-form-item> --> |
| | | <!-- <el-form-item label="分组" prop="payType"> |
| | | <el-select v-model="objs.payType" placeholder="请选择结算方式" style="width: 200px" clearable> |
| | | <el-option v-for="dict in groupingList" :key="dict.id" :label="dict.groupingName" :value="dict.id" /> |
| | |
| | | </el-form-item> |
| | | <el-form-item label="有效天数" prop="yxts"> |
| | | <el-input |
| | | style="width:100px" |
| | | style="width: 100px" |
| | | v-model="objs.yxts" |
| | | placeholder="有效天数" |
| | | />天(可自定义) |
| | |
| | | icon="el-icon-upload2" |
| | | size="mini" |
| | | @click="handleImport" |
| | | v-hasPermi="['system:user:import']" |
| | | >导入</el-button |
| | | > |
| | | </el-col> |
| | |
| | | icon="el-icon-upload2" |
| | | size="mini" |
| | | @click="importTemplate" |
| | | v-hasPermi="['system:user:import']" |
| | | >下载模板</el-button |
| | | > |
| | | </el-col> |
| | |
| | | label="单位名称" |
| | | align="center" |
| | | prop="company" |
| | | width="200" |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="单位部门" |
| | | align="center" |
| | | prop="department" |
| | | width="200" |
| | | > |
| | | </el-table-column> |
| | |
| | | <el-upload |
| | | ref="upload" |
| | | :limit="1" |
| | | accept=".xlsx, .xls" |
| | | :key="uploadKey" |
| | | accept=".xls" |
| | | :headers="upload.headers" |
| | | :data="data" |
| | | :action="upload.url" |
| | |
| | | <el-checkbox v-model="upload.updateSupport" /> |
| | | 是否更新已经存在的用户数据 |
| | | </div> |
| | | <span>仅允许导入xls、xlsx格式文件。</span> |
| | | <span>仅允许导入xls格式文件。</span> |
| | | <el-link |
| | | type="primary" |
| | | :underline="false" |
| | |
| | | </div> |
| | | </el-upload> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="submitFileForm">确 定</el-button> |
| | | <el-button type="primary" @click="submitFileForm">保存信息</el-button> |
| | | <el-button @click="upload.open = false">取 消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import Cookies from "js-cookie" |
| | | import { |
| | | addDept, |
| | | addComp, |
| | |
| | | getDwAndDwDept, |
| | | newExcelImport, |
| | | } from "@/api/system/comp"; |
| | | import { newConfirm, getCompany, queryCompany } from "@/api/team/tuanti"; |
| | | import { |
| | | newConfirm, |
| | | getCompany, |
| | | queryCompany, |
| | | getconfigKey, |
| | | } from "@/api/team/tuanti"; |
| | | import { getToken } from "@/utils/auth"; |
| | | import { read, utils } from "xlsx"; |
| | | |
| | | export default { |
| | | dicts: [ |
| | |
| | | } |
| | | }; |
| | | return { |
| | | uploadKey: 0, |
| | | leftList: "", |
| | | isdisabled: true, |
| | | setDisabled: { |
| | |
| | | |
| | | objs: { |
| | | drugManufacturerId: "", |
| | | dwDeptName: "", |
| | | reservationTime: "", |
| | | yxts:"30", |
| | | yxts: "", |
| | | }, |
| | | DataList: [], |
| | | tjOrderList: [], //单个项目集合 |
| | |
| | | // 是否更新已经存在的用户数据 |
| | | updateSupport: 0, |
| | | // 设置上传的请求头部 |
| | | headers: { Authorization: "Bearer " + getToken() }, |
| | | headers: { Authorization: "Bearer " + getToken(),hospId: Cookies.get("hospId") }, |
| | | // 上传的地址 |
| | | url: |
| | | process.env.VUE_APP_BASE_API + |
| | | "/reservation/reservation/newExcelImport", |
| | | "/reservation/reservation/newExcelImportNotDwDeptId", |
| | | }, |
| | | // 查询参数 |
| | | queryParam: { |
| | |
| | | }, |
| | | // 搜索 |
| | | getRemoteData(query) { |
| | | |
| | | if (query) { |
| | | let compName = query; |
| | | queryCompany(compName).then((response) => { |
| | |
| | | // 获取单位信息集合 |
| | | getCompanyList() { |
| | | this.loading = true; |
| | | getconfigKey('team_reservation_default_day').then((res) => { |
| | | console.log(res, 1111); |
| | | this.objs.yxts = res.msg; |
| | | }); |
| | | getCompany(this.queryParam).then((response) => { |
| | | this.CompanyList = response.data; |
| | | this.total = response.total; |
| | |
| | | this.objs.drugManufacturerId = ""; |
| | | this.objs.dwDeptName = ""; |
| | | this.objs.reservationTime = ""; |
| | | this.objs.yxts = ""; |
| | | this.TotalPrice = ""; |
| | | this.tableData[0] = []; |
| | | this.TotalPrice1 = ""; |
| | | this.userList = [] |
| | | // this.resetForm("form"); |
| | | this.form = {}; |
| | | }, |
| | |
| | | selectTime(val) { |
| | | this.objs.reservationTime = val; |
| | | }, |
| | | |
| | | /** 导入按钮操作 */ |
| | | handleImport() { |
| | | if (this.objs.drugManufacturerId && this.objs.reservationTime) { |
| | | // 清空组件内部状态(含已上传文件) |
| | | this.$refs.upload?.clearFiles(); |
| | | this.uploadKey = Date.now(); // 改变 key 强制重新渲染组件 |
| | | // 同步数据源(Vue2 需用 $set 确保响应式) |
| | | this.upload.title = "用户导入"; |
| | | this.upload.open = true; |
| | | } else { |
| | |
| | | this.upload.isUploading = true; |
| | | }, |
| | | // 文件上传成功处理 |
| | | // 文件上传成功处理 |
| | | handleFileSuccess(response, file, fileList) { |
| | | this.ListObj = response.data; |
| | | console.log(response, file, fileList) |
| | | if (response.code == 500) { |
| | | this.isdisabled = true; |
| | | // Message.warning(response.msg); |
| | | // this.$modal.msgError(response.msg); |
| | | // this.$modal.msgError("人员"+ response.data.list + "信息错误"); |
| | | |
| | | // const errorList = response.data.list.join(", "); |
| | | |
| | | this.$confirm( `${response.msg}`, { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "error", |
| | | center: true, |
| | | dangerouslyUseHTMLString: true, |
| | | }); |
| | | }else{ |
| | | this.isdisabled = false; |
| | | this.ListObj = response.data; |
| | | this.userList = response.data.list; |
| | | |
| | | this.userList.forEach((item) => { |
| | | this.CompanyList.forEach((item1) => { |
| | | if (item1.drugManufacturerId == this.objs.drugManufacturerId) { |
| | |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | this.upload.open = false; |
| | | this.upload.isUploading = false; |
| | | this.$refs.upload.clearFiles(); |
| | | this.leftList = response.msg; |
| | | |
| | | if (this.leftList == "操作失败") { |
| | | this.isdisabled = true; |
| | | this.$alert( |
| | |
| | | "导入结果", |
| | | { dangerouslyUseHTMLString: true } |
| | | ); |
| | | } else { |
| | | this.isdisabled = false; |
| | | this.$alert( |
| | | "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + |
| | | response.msg, |
| | | { dangerouslyUseHTMLString: true } |
| | | ); |
| | | this.rightList = response; |
| | | } |
| | | } |
| | | // else { |
| | | // console.log(11111) |
| | | // this.isdisabled = false; |
| | | // this.$alert( |
| | | // "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + |
| | | // response.msg, |
| | | // { dangerouslyUseHTMLString: true } |
| | | // ); |
| | | // this.rightList = response; |
| | | // } |
| | | for (let i = 0; i < fileList.length; i++) { |
| | | if (file.name != fileList[i].name) { |
| | | this.fileList.push({ |
| | |
| | | }, |
| | | // 提交上传文件 |
| | | submitFileForm() { |
| | | console.log(9999) |
| | | this.$refs.upload.submit(); |
| | | this.isShow = false; |
| | | }, |
| | |
| | | |
| | | /** 确认按钮 */ |
| | | submitForm() { |
| | | if (this.objs.reservationTime && this.data.dwDeptId) { |
| | | // if (this.objs.reservationTime && this.data.dwDeptId) { |
| | | if (this.objs.reservationTime) { |
| | | let data = { |
| | | copeWith: this.ListObj.hjMoney, |
| | | reservations: this.userList, |
| | | reservationTime: this.objs.reservationTime, |
| | | dwDeptId: this.data.dwDeptId, |
| | | yxts:this.objs.yxts, |
| | | yxts: this.objs.yxts, |
| | | dwId: this.data.dwId, |
| | | }; |
| | | newConfirm(data).then((res) => { |
| | | this.$modal.msgSuccess("提交成功"); |