<template>
|
<div class="app-container">
|
<el-form
|
:model="objs"
|
:rules="rules"
|
ref="form"
|
size="small"
|
:inline="true"
|
label-width="100px"
|
>
|
<el-form-item label="单位名称" prop="drugManufacturerId">
|
<el-select
|
:remote-method="getRemoteData"
|
v-model="objs.drugManufacturerId"
|
remote
|
filterable
|
style="width: 200px"
|
placeholder="请选择单位名称"
|
clearable
|
@clear="getCompanyList"
|
@change="idFn"
|
>
|
<el-option
|
v-for="dict in CompanyList"
|
:key="dict.cnName"
|
:label="dict.cnName"
|
:value="dict.drugManufacturerId"
|
/>
|
</el-select>
|
<i class="el-icon-circle-plus-outline" @click="handleAdd"></i>
|
</el-form-item>
|
<!-- <el-form-item label="部门" prop="dwDeptName">
|
<el-select
|
v-model="objs.dwDeptName"
|
placeholder="请选择部门"
|
style="width: 200px"
|
clearable
|
@change="idBm"
|
>
|
<el-option
|
v-for="dict in deptList"
|
:key="dict.id"
|
:label="dict.dwDeptName"
|
:value="dict.id"
|
/>
|
</el-select>
|
<i class="el-icon-circle-plus-outline" @click="handleAddbumen"></i>
|
</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-select>
|
</el-form-item> -->
|
<el-form-item label="预约时间" prop="reservationTime">
|
<el-date-picker
|
clearable
|
v-model="objs.reservationTime"
|
type="date"
|
format="yyyy-MM-dd"
|
value-format="yyyy-MM-dd"
|
style="width: 130px"
|
placeholder="请选择预约日期"
|
@change="selectTime"
|
:picker-options="setDisabled"
|
>
|
</el-date-picker>
|
</el-form-item>
|
<el-form-item label="有效天数" prop="yxts">
|
<el-input
|
style="width: 100px"
|
v-model="objs.yxts"
|
placeholder="有效天数"
|
/>天(可自定义)
|
</el-form-item>
|
</el-form>
|
|
<el-row :gutter="10" class="mb8" style="margin: 5px 20px">
|
<el-col :span="1.5">
|
<el-button
|
type="primary"
|
icon="el-icon-refresh"
|
size="mini"
|
@click="resetQuery"
|
>重置</el-button
|
>
|
</el-col>
|
<el-col :span="1.5">
|
<el-button
|
type="primary"
|
icon="el-icon-upload2"
|
size="mini"
|
@click="handleImport"
|
>导入</el-button
|
>
|
</el-col>
|
<el-col :span="1.5">
|
<el-button
|
type="primary"
|
icon="el-icon-upload2"
|
size="mini"
|
@click="importTemplate"
|
>下载模板</el-button
|
>
|
</el-col>
|
<el-col :span="1.5">
|
<el-button
|
type="primary"
|
class="btn"
|
icon="el-icon-thumb"
|
:disabled="isdisabled"
|
size="mini"
|
@click="submitForm"
|
>
|
确认</el-button
|
>
|
</el-col>
|
</el-row>
|
<div style="margin: 5px 20px; width: 94%">
|
<el-table
|
v-loading="loading"
|
:data="userList"
|
:summary-method="getSummaries"
|
show-summary
|
border
|
>
|
<el-table-column
|
label="单位名称"
|
align="center"
|
prop="company"
|
width="200"
|
>
|
</el-table-column>
|
<!-- <el-table-column label="工号" align="center" prop="jobNo" width="80" /> -->
|
<el-table-column label="姓名" align="center" prop="name" width="75" />
|
<el-table-column label="性别" align="center" prop="sex" width="75">
|
<template slot-scope="scope">
|
<dict-tag
|
:options="dict.type.sys_user_sex"
|
:value="scope.row.sex"
|
/>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="身份证号"
|
align="center"
|
prop="idCard"
|
width="200"
|
/>
|
<el-table-column label="年龄" align="center" prop="age" width="75" />
|
<el-table-column
|
label="出生日期"
|
align="center"
|
prop="birthday"
|
width="100"
|
/>
|
<!-- <el-table-column label="职位" align="center" prop="position" /> -->
|
<!-- <el-table-column label="部门" align="center" prop="department" /> -->
|
<!-- <el-table-column label="部门编号" align="center" prop="departmentId" /> -->
|
<el-table-column
|
label="联系电话"
|
align="center"
|
prop="phoe"
|
width="140"
|
/>
|
<el-table-column label="地址" align="center" prop="address" />
|
<el-table-column
|
label="婚姻状况"
|
align="center"
|
prop="marriage"
|
key="marriage"
|
>
|
<template slot-scope="scope">
|
<dict-tag
|
:options="dict.type.dict_user_marry"
|
:value="scope.row.marriage"
|
/>
|
</template>
|
</el-table-column>
|
<el-table-column label="民族" align="center" prop="nation" key="nation">
|
<template slot-scope="scope">
|
<dict-tag
|
:options="dict.type.dict_user_national"
|
:value="scope.row.nation"
|
/>
|
</template>
|
</el-table-column>
|
<!-- <el-table-column label="联系邮箱" align="center" prop="email" /> -->
|
<!-- <el-table-column label="体检类别" align="center" prop="tjCategory" /> -->
|
<el-table-column label="分组" align="center" prop="groupingName" />
|
<el-table-column label="项目收费" align="center" prop="ysPrice" />
|
</el-table>
|
</div>
|
|
<!-- 用户导入对话框 -->
|
<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"
|
:data="data"
|
:action="upload.url"
|
: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 text-center" slot="tip">
|
<div class="el-upload__tip" slot="tip">
|
<el-checkbox v-model="upload.updateSupport" />
|
是否更新已经存在的用户数据
|
</div>
|
<span>仅允许导入xls、xlsx格式文件。</span>
|
<el-link
|
type="primary"
|
:underline="false"
|
style="font-size: 12px; vertical-align: baseline"
|
@click="importTemplate"
|
>下载模板</el-link
|
>
|
</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>
|
|
<!-- 添加或修改体检单位信息维护对话框 -->
|
<div class="dia">
|
<el-dialog
|
:title="title"
|
:visible.sync="open"
|
width="1000px"
|
append-to-body
|
>
|
<el-form
|
ref="form"
|
:model="form"
|
:rules="rules"
|
label-width="100px"
|
:inline="true"
|
>
|
<el-form-item label="单位名称" prop="cnName">
|
<el-input v-model="form.cnName" placeholder="请输入中文名称" />
|
</el-form-item>
|
<el-form-item label="联系人" prop="contactPerson">
|
<el-input v-model="form.contactPerson" placeholder="请输入联系人" />
|
</el-form-item>
|
<el-form-item label="联系电话" prop="contactPhone">
|
<el-input
|
v-model="form.contactPhone"
|
placeholder="请输入联系电话"
|
/>
|
</el-form-item>
|
<el-form-item label="税号" prop="taxNumber">
|
<el-input v-model="form.taxNumber" placeholder="请输入税号" />
|
</el-form-item>
|
<el-form-item label="法人" prop="legalPerson">
|
<el-input v-model="form.legalPerson" placeholder="请输入法人" />
|
</el-form-item>
|
<el-form-item label="注册地址" prop="registerAddress">
|
<el-input
|
v-model="form.registerAddress"
|
placeholder="请输入注册地址"
|
/>
|
</el-form-item>
|
<el-form-item label="通讯地址" prop="mailingAddress">
|
<el-input
|
v-model="form.mailingAddress"
|
placeholder="请输入通讯地址"
|
/>
|
</el-form-item>
|
<el-form-item label="开户银行" prop="bankAccount">
|
<el-input v-model="form.bankAccount" placeholder="请输入开户银行" />
|
</el-form-item>
|
<el-form-item label="银行账户" prop="countNum">
|
<el-input v-model="form.countNum" placeholder="请输入银行账户" />
|
</el-form-item>
|
<el-form-item label="邮箱" prop="email">
|
<el-input v-model="form.email" placeholder="请输入邮箱" />
|
</el-form-item>
|
<el-form-item label="负责人" prop="principal">
|
<el-input v-model="form.principal" placeholder="请输入负责人" />
|
</el-form-item>
|
<el-form-item label="网址" prop="url">
|
<el-input v-model="form.url" placeholder="请输入网址" />
|
</el-form-item>
|
<el-form-item label="传真" prop="faxNumber">
|
<el-input v-model="form.faxNumber" placeholder="请输入传真" />
|
</el-form-item>
|
<el-form-item label="行政区划名称" prop="areaName">
|
<el-input
|
v-model="form.areaName"
|
placeholder="请输入行政区划名称"
|
/>
|
</el-form-item>
|
<el-form-item label="排序" prop="orderNum">
|
<el-input v-model="form.orderNum" placeholder="请输入排序" />
|
</el-form-item>
|
<el-form-item label="有效时间" prop="validTime">
|
<el-date-picker
|
clearable
|
v-model="form.validTime"
|
type="date"
|
value-format="yyyy-MM-dd"
|
placeholder="请选择有效时间"
|
>
|
</el-date-picker> </el-form-item
|
><br />
|
<el-form-item label="备注" prop="remark">
|
<el-input
|
v-model="form.remark"
|
type="textarea"
|
placeholder="请输入内容"
|
:rows="2"
|
label-width="400px"
|
style="width: 830px"
|
resize="none"
|
></el-input>
|
</el-form-item>
|
</el-form>
|
<div slot="footer" class="dialog-footer2">
|
<el-button type="primary" @click="submitFormS">确 定</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
</div>
|
</el-dialog>
|
</div>
|
|
<!-- 添加或修改部门信息维护对话框 -->
|
<div class="dia">
|
<el-dialog
|
:title="title"
|
:visible.sync="open1"
|
width="1000px"
|
append-to-body
|
>
|
<el-form
|
ref="form"
|
:model="form"
|
:rules="rules"
|
label-width="100px"
|
:inline="true"
|
>
|
<el-form-item label="单位名称" prop="drugManufacturerId">
|
<el-select
|
:remote-method="getRemoteData"
|
v-model="objs.drugManufacturerId"
|
remote
|
filterable
|
style="width: 200px"
|
placeholder="请选择单位名称"
|
clearable
|
@clear="getCompanyList"
|
@change="idFn1"
|
>
|
<el-option
|
v-for="dict in CompanyList"
|
:key="dict.cnName"
|
:label="dict.cnName"
|
:value="dict.drugManufacturerId"
|
/>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="部门名称" prop="dwDeptName">
|
<el-input v-model="form.dwDeptName" placeholder="请输入部门名称" />
|
</el-form-item>
|
<el-form-item label="签约金额" prop="signingPrice">
|
<el-input
|
v-model="form.signingPrice"
|
placeholder="请输入签约金额"
|
/>
|
</el-form-item>
|
</el-form>
|
<div slot="footer" class="dialog-footer2">
|
<el-button type="primary" @click="handleAddDept">确 定</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
</div>
|
</el-dialog>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import {
|
addDept,
|
addComp,
|
Deptlist,
|
getDwAndDwDept,
|
newExcelImport,
|
} from "@/api/system/comp";
|
import {
|
newConfirm,
|
getCompany,
|
queryCompany,
|
getconfigKey,
|
} from "@/api/team/tuanti";
|
import { getToken } from "@/utils/auth";
|
|
export default {
|
dicts: [
|
"dict_user_national",
|
"dict_user_marry",
|
"sys_yes_no",
|
"sys_user_sex",
|
"reservation_pay_type",
|
"sys_normal_disable",
|
],
|
|
name: "Tijian",
|
data() {
|
let checkPhoneNum = (rule, value, callback) => {
|
console.log(value);
|
let patter = new RegExp(/^1\s*[3456789]\s*(\d\s*){9}$/);
|
if (value == "" && value == undefined && !value) {
|
return callback("");
|
} else if (value != undefined && value != "") {
|
return callback();
|
} else if (!patter.test(value)) {
|
return callback("");
|
}
|
};
|
return {
|
|
leftList: "",
|
isdisabled: true,
|
setDisabled: {
|
// 返回禁用时间
|
disabledDate(time) {
|
// return time.getTime() < Date.now()// 不可选历史天、不可选当前天、可选未来天
|
return time.getTime() < Date.now() - 8.64e7; // 不可选历史天、可选当前天、可选未来天
|
},
|
},
|
CompanyList: [],
|
reservationList: [],
|
rightList: [],
|
isShow: true,
|
isShows: true,
|
message: "显示",
|
fileList: [], //上传文件列表
|
tableHead: [], //表头
|
tableData: [], // 表数据
|
form: {
|
company: "",
|
payType: "",
|
name: "",
|
phoe: "",
|
signingPic: "",
|
discount: "",
|
},
|
formLabelWidth: "120px",
|
imageUrl: "",
|
size: "",
|
tcShow: false,
|
creaseopen: false,
|
// 套餐提交按钮
|
confirm: false,
|
TotalPrice: 0,
|
TotalPrice1: 0,
|
discount: 100,
|
deptList: [],
|
groupingList: [],
|
tableList: [],
|
data: {
|
dwId: "",
|
dwDeptId: "",
|
dwName: "",
|
},
|
|
objs: {
|
drugManufacturerId: "",
|
reservationTime: "",
|
yxts: "",
|
},
|
DataList: [],
|
tjOrderList: [], //单个项目集合
|
// 选中数组
|
ids: [],
|
// 非单个禁用
|
single: true,
|
// 非多个禁用
|
multiple: true,
|
// 是否显示弹出层
|
Seachopen: false,
|
dialogVisible: false,
|
notification: false,
|
// 用户表格数据
|
userList: null,
|
// 用户导入参数
|
upload: {
|
// 是否显示弹出层(用户导入)
|
open: false,
|
// 弹出层标题(用户导入)
|
title: "",
|
// 是否禁用上传
|
isUploading: false,
|
// 是否更新已经存在的用户数据
|
updateSupport: 0,
|
// 设置上传的请求头部
|
headers: { Authorization: "Bearer " + getToken() },
|
// 上传的地址
|
url:
|
process.env.VUE_APP_BASE_API +
|
"/reservation/reservation/newExcelImportNotDwDeptId",
|
},
|
// 查询参数
|
queryParam: {
|
pageNum: 1,
|
pageSize: 10,
|
company: undefined,
|
companyId: undefined,
|
pacName: undefined,
|
jobNo: undefined,
|
name: undefined,
|
sex: undefined,
|
idCard: undefined,
|
age: undefined,
|
birthday: undefined,
|
position: undefined,
|
department: undefined,
|
departmentId: undefined,
|
phoe: undefined,
|
address: undefined,
|
marriage: undefined,
|
nation: undefined,
|
email: undefined,
|
tjCategory: undefined,
|
payType: undefined,
|
},
|
// 表单参数
|
form: {},
|
// 表单校验
|
|
rules: {
|
drugManufacturerId: [
|
{ required: true, validator: checkPhoneNum, trigger: "change" },
|
],
|
reservationTime: [
|
{ required: true, validator: checkPhoneNum, trigger: "blur" },
|
],
|
// dwDeptName: [
|
// { required: true, validator: checkPhoneNum, trigger: "change" },
|
// ],
|
signingPic: [
|
{ required: true, validator: checkPhoneNum, trigger: "blur" },
|
],
|
contactPerson: [
|
{ required: true, validator: checkPhoneNum, trigger: "blur" },
|
],
|
contactPhone: [
|
{ required: true, validator: checkPhoneNum, trigger: "blur" },
|
],
|
taxNumber: [
|
{ required: true, validator: checkPhoneNum, trigger: "blur" },
|
],
|
legalPerson: [
|
{ required: true, validator: checkPhoneNum, trigger: "blur" },
|
],
|
registerAddress: [
|
{ required: true, validator: checkPhoneNum, trigger: "blur" },
|
],
|
bankAccount: [
|
{ required: true, validator: checkPhoneNum, trigger: "blur" },
|
],
|
countNum: [
|
{ required: true, validator: checkPhoneNum, trigger: "blur" },
|
],
|
principal: [
|
{ required: true, validator: checkPhoneNum, trigger: "blur" },
|
],
|
faxNumber: [
|
{ required: true, validator: checkPhoneNum, trigger: "blur" },
|
],
|
mailingAddress: [
|
{ required: true, validator: checkPhoneNum, trigger: "blur" },
|
],
|
email: [{ required: true, validator: checkPhoneNum, trigger: "blur" }],
|
pacName: [
|
{ required: true, validator: checkPhoneNum, trigger: "change" },
|
],
|
payType: [
|
{ required: true, validator: checkPhoneNum, trigger: "change" },
|
],
|
phoe: [
|
{
|
required: true,
|
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
validator: checkPhoneNum,
|
trigger: "blur",
|
},
|
],
|
|
proPrice: [
|
{ required: true, validator: checkPhoneNum, trigger: "blur" },
|
],
|
createTime: [
|
{ required: true, validator: checkPhoneNum, trigger: "blur" },
|
],
|
cnName: [{ required: true, validator: checkPhoneNum, trigger: "blur" }],
|
businessLicenseNumber: [
|
{ required: true, validator: checkPhoneNum, trigger: "blur" },
|
],
|
createTime: [
|
{ required: true, validator: checkPhoneNum, trigger: "blur" },
|
],
|
updateTime: [
|
{ required: true, validator: checkPhoneNum, trigger: "blur" },
|
],
|
effective: [
|
{
|
required: true,
|
validator: checkPhoneNum,
|
trigger: "change",
|
},
|
],
|
name: [{ required: true, validator: checkPhoneNum, trigger: "change" }],
|
contactPhone: [
|
{ required: true, validator: checkPhoneNum, trigger: "change" },
|
],
|
},
|
ListObj: {},
|
// 遮罩层
|
loading: true,
|
pacStatus: "启用",
|
// 选中数组
|
ids: [],
|
// 非单个禁用
|
single: true,
|
// 非多个禁用
|
multiple: true,
|
// 显示搜索条件
|
showSearch: true,
|
// 总条数
|
total: 0,
|
// 体检单位信息维护表格数据
|
compList: [],
|
// 弹出层标题
|
title: "",
|
// 是否显示弹出层
|
open: false,
|
open1: false,
|
// 查询参数
|
queryParams: {
|
pageNum: 1,
|
pageSize: 10,
|
cnName: null,
|
enName: null,
|
code: null,
|
},
|
};
|
},
|
created() {
|
this.getCompanyList();
|
},
|
|
watch: {
|
inputVal(newValue) {
|
if (newValue) {
|
this.searchData(true);
|
} else {
|
this.searchData(false);
|
}
|
},
|
},
|
methods: {
|
// 保存部门
|
handleAddDept() {
|
let data = {
|
dwName: this.data.dwName,
|
dwId: this.data.dwId,
|
dwDeptName: this.form.dwDeptName,
|
signingPrice: this.form.signingPrice,
|
};
|
addDept(data).then((response) => {
|
if (response.code == 200) {
|
this.$modal.msgSuccess("新增成功");
|
this.open1 = false;
|
}
|
});
|
},
|
idFn(value) {
|
console.log(value);
|
if (value) {
|
this.data.dwId = value;
|
Deptlist(value).then((response) => {
|
this.deptList = response.data;
|
});
|
}
|
},
|
idFn1(value) {
|
console.log(value);
|
if (value) {
|
this.data.dwId = value;
|
this.CompanyList.forEach((item) => {
|
console.log(item);
|
if (item.drugManufacturerId == this.data.dwId) {
|
this.data.dwName = item.cnName;
|
}
|
});
|
}
|
},
|
idBm(value) {
|
this.data.dwDeptId = value;
|
},
|
|
getSummaries(param) {
|
const { columns, data } = param;
|
const sums = [];
|
columns.forEach((column, index) => {
|
// if (index === 0) {
|
// sums[index] = "合计";
|
// return;
|
// }
|
if (index === 0) {
|
sums[index] = "总计人数";
|
return;
|
}
|
if (index === 1) {
|
sums[index] = this.ListObj.count;
|
return;
|
}
|
if (index === 2) {
|
sums[index] = "男组人数";
|
return;
|
}
|
if (index === 3) {
|
sums[index] = this.ListObj.manCount;
|
return;
|
}
|
if (index === 4) {
|
sums[index] = "男组金额";
|
return;
|
}
|
if (index === 5) {
|
sums[index] = this.ListObj.manMoney;
|
return;
|
}
|
if (index === 6) {
|
sums[index] = "女组人数";
|
return;
|
}
|
if (index === 7) {
|
sums[index] = this.ListObj.woManCount;
|
return;
|
}
|
if (index === 8) {
|
sums[index] = "女组金额";
|
return;
|
}
|
if (index === 9) {
|
sums[index] = this.ListObj.woManMoney;
|
return;
|
}
|
if (index === 10) {
|
sums[index] = "合计金额";
|
return;
|
}
|
if (index === 11) {
|
sums[index] = this.ListObj.hjMoney;
|
return;
|
}
|
});
|
return sums;
|
},
|
// 搜索
|
getRemoteData(query) {
|
|
if (query) {
|
let compName = query;
|
queryCompany(compName).then((response) => {
|
this.CompanyList = response.data;
|
this.CompanyList.forEach((item) => {
|
this.objs = item;
|
});
|
});
|
}
|
},
|
|
// 获取单位信息集合
|
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.loading = false;
|
});
|
},
|
// 取消按钮
|
cancel() {
|
this.open = false;
|
this.open1 = false;
|
this.creaseopen = false;
|
this.reset();
|
},
|
/** 新增按钮操作 */
|
handleAdd() {
|
this.reset();
|
this.open = true;
|
this.title = "添加体检单位信息维护";
|
},
|
/** 部门新增按钮操作 */
|
handleAddbumen() {
|
this.reset();
|
this.open1 = true;
|
this.title = "添加部门信息维护";
|
},
|
|
/** 提交按钮 */
|
submitFormS() {
|
this.$refs["form"].validate((valid) => {
|
if (valid) {
|
addComp(this.form).then((response) => {
|
this.$modal.msgSuccess("新增成功");
|
this.open = false;
|
this.getCompanyList();
|
});
|
}
|
});
|
},
|
|
// 表单重置
|
reset() {
|
this.form = {
|
company: null,
|
payType: null,
|
name: null,
|
phoe: null,
|
signingPic: null,
|
pacStatus: "启用",
|
};
|
this.resetForm("form");
|
},
|
/** 重置按钮操作 */
|
resetQuery() {
|
this.date = [];
|
this.objs.drugManufacturerId = "";
|
this.objs.dwDeptName = "";
|
this.objs.reservationTime = "";
|
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.upload.title = "用户导入";
|
this.upload.open = true;
|
} else {
|
this.$modal.msgError("请选择单位或预约时间");
|
}
|
},
|
/** 下载模板操作 */
|
importTemplate() {
|
this.download(
|
"/reservation/reservation/importTemplate",
|
{},
|
`团体预约Excel模版.xls`
|
);
|
},
|
// 文件上传中处理
|
handleFileUploadProgress(event, file, fileList) {
|
this.upload.isUploading = true;
|
},
|
// 文件上传成功处理
|
handleFileSuccess(response, file, fileList) {
|
console.log(response, 666666);
|
if (response.code == 500) {
|
console.log(22222222222);
|
// Message.warning(response.msg);
|
// this.$modal.msgError(response.msg);
|
// this.$modal.msgError("人员"+ response.data.list + "信息错误");
|
const errorList = response.data.list.join(", ");
|
this.$confirm(`${errorList}`, "以下人员信息有误,请核对后导入:", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "error",
|
center: true,
|
dangerouslyUseHTMLString: true,
|
});
|
}
|
this.ListObj = response.data;
|
this.userList = response.data.list;
|
|
this.userList.forEach((item) => {
|
this.CompanyList.forEach((item1) => {
|
if (item1.drugManufacturerId == this.objs.drugManufacturerId) {
|
item.company = item1.cnName;
|
}
|
});
|
});
|
this.upload.open = false;
|
this.upload.isUploading = false;
|
this.$refs.upload.clearFiles();
|
this.leftList = response.msg;
|
console.log(response.code);
|
|
if (this.leftList == "操作失败") {
|
this.isdisabled = true;
|
this.$alert(
|
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
|
response.msg +
|
"<div style='br;margin:10px'>" +
|
response.data[0] +
|
"身份证或手机号码有误" +
|
"</div>",
|
"导入结果",
|
{ 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;
|
}
|
for (let i = 0; i < fileList.length; i++) {
|
if (file.name != fileList[i].name) {
|
this.fileList.push({
|
name: file.name,
|
url: "",
|
uid: file.uid,
|
});
|
}
|
}
|
// let data = {
|
// dwDeptId: this.deptId,
|
// dwId: this.dwId,
|
// file:file
|
// }
|
// newExcelImport(data).then(response => {
|
// console.log(11111)
|
// })
|
const files = { 0: file };
|
// this.readExcel(files);
|
},
|
// 提交上传文件
|
submitFileForm() {
|
this.$refs.upload.submit();
|
this.isShow = false;
|
},
|
|
// readExcel(file) {
|
// const fileReader = new FileReader();
|
// fileReader.onload = (ev) => {
|
// try {
|
// const data = ev.target.result;
|
// const workbook = read(data, { type: "binary" });
|
// const params = [];
|
// // 取对应表生成json表格内容
|
// workbook.SheetNames.forEach((item) => {
|
// params.push({
|
// name: item,
|
// dataList: utils.sheet_to_json(workbook.Sheets[item]),
|
// });
|
// this.tableData.push(utils.sheet_to_json(workbook.Sheets[item]));
|
// });
|
// // 该算法仅针对表头无合并的情况
|
// if (this.tableData.length > 0) {
|
// // 获取excel中第一个表格数据tableData[0][0],并且将表头提取出来
|
// for (const key in this.tableData[0][0]) {
|
// this.tableHead.push(key);
|
// }
|
// }
|
// return params;
|
// // 重写数据
|
// } catch (e) {
|
// console.log("error:" + e);
|
// return false;
|
// }
|
// };
|
// fileReader.readAsBinaryString(file[0].raw);
|
// },
|
|
/** 确认按钮 */
|
submitForm() {
|
// 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,
|
dwId: this.data.dwId,
|
};
|
newConfirm(data).then((res) => {
|
this.$modal.msgSuccess("提交成功");
|
this.confirm = true;
|
this.userList = [];
|
});
|
} else {
|
this.$modal.msgError("请填写带星号内容");
|
}
|
},
|
},
|
};
|
</script>
|
|
|
<style>
|
.el-dialog:not(.is-fullscreen) {
|
margin-top: 6vh !important;
|
width: 600px;
|
}
|
|
/* .el-table td.el-table__cell div {
|
-webkit-box-sizing: border-box;
|
box-sizing: border-box;
|
display: flex;
|
flex-wrap: wrap;
|
font-size: 14px;
|
} */
|
|
.upload-demo {
|
width: 100%;
|
}
|
|
.el-icon-circle-plus-outline {
|
line-height: 20px;
|
font-size: 20px;
|
}
|
|
.dia {
|
display: flex;
|
}
|
|
.dialog-footer2 {
|
width: 960px;
|
height: 36px;
|
display: flex;
|
justify-content: center;
|
}
|
|
.dialog-footer1 {
|
width: 860px;
|
height: 36px;
|
display: flex;
|
justify-content: center;
|
}
|
</style>
|
|
|