| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-dialog |
| | | :title="title" |
| | | :visible.sync="open1" |
| | | width="1000px" |
| | | append-to-body |
| | | > |
| | | <el-form |
| | | ref="form1" |
| | | :model="form1" |
| | | :rules="rules1" |
| | | label-width="100px" |
| | | :inline="true" |
| | | > |
| | | <el-form-item label="单位名称" prop="cnName"> |
| | | <el-input v-model="form1.cnName" placeholder="请输入中文名称" /> |
| | | </el-form-item> |
| | | <el-form-item label="联系人" prop="contactPerson"> |
| | | <el-input v-model="form1.contactPerson" placeholder="请输入联系人" /> |
| | | </el-form-item> |
| | | <el-form-item label="联系电话" prop="contactPhone"> |
| | | <el-input v-model="form1.contactPhone" placeholder="请输入联系电话" /> |
| | | </el-form-item> |
| | | <el-form-item label="税号" prop="taxNumber"> |
| | | <el-input v-model="form1.taxNumber" placeholder="请输入税号" /> |
| | | </el-form-item> |
| | | <el-form-item label="法人" prop="legalPerson"> |
| | | <el-input v-model="form1.legalPerson" placeholder="请输入法人" /> |
| | | </el-form-item> |
| | | <el-form-item label="注册地址" prop="registerAddress"> |
| | | <el-input |
| | | v-model="form1.registerAddress" |
| | | placeholder="请输入注册地址" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="通讯地址" prop="mailingAddress"> |
| | | <el-input |
| | | v-model="form1.mailingAddress" |
| | | placeholder="请输入通讯地址" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="开户银行" prop="bankAccount"> |
| | | <el-input v-model="form1.bankAccount" placeholder="请输入开户银行" /> |
| | | </el-form-item> |
| | | <el-form-item label="银行账户" prop="countNum"> |
| | | <el-input v-model="form1.countNum" placeholder="请输入银行账户" /> |
| | | </el-form-item> |
| | | <el-form-item label="邮箱" prop="email"> |
| | | <el-input v-model="form1.email" placeholder="请输入邮箱" /> |
| | | </el-form-item> |
| | | <el-form-item label="负责人" prop="principal"> |
| | | <el-input v-model="form1.principal" placeholder="请输入负责人" /> |
| | | </el-form-item> |
| | | <el-form-item label="网址" prop="url"> |
| | | <el-input v-model="form1.url" placeholder="请输入网址" /> |
| | | </el-form-item> |
| | | <el-form-item label="传真" prop="faxNumber"> |
| | | <el-input v-model="form1.faxNumber" placeholder="请输入传真" /> |
| | | </el-form-item> |
| | | <el-form-item label="行政区划名称" prop="areaName"> |
| | | <el-input v-model="form1.areaName" placeholder="请输入行政区划名称" /> |
| | | </el-form-item> |
| | | <el-form-item label="排序" prop="orderNum"> |
| | | <el-input v-model="form1.orderNum" placeholder="请输入排序" /> |
| | | </el-form-item> |
| | | <el-form-item label="有效时间" prop="validTime"> |
| | | <el-date-picker |
| | | clearable |
| | | v-model="form1.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="form1.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="cancel1">取 消</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="17"> |
| | | <div class="grid-content bg-purple"> |
| | |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="年龄 " prop="age"> |
| | | <el-form-item label="年龄" prop="age"> |
| | | <el-input |
| | | v-model="form.age" |
| | | :disabled="isDisabled" |
| | |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="工作单位" prop="company"> |
| | | <el-input |
| | | <el-form-item label="单位名称" prop="compName"> |
| | | <el-select |
| | | :disabled="isDisabled" |
| | | v-model="form.company" |
| | | placeholder="请输入工作单位" |
| | | /> |
| | | v-model="form.compName" |
| | | remote |
| | | default-first-option |
| | | allow-create |
| | | filterable |
| | | style="width: 200px" |
| | | placeholder="请选择单位名称" |
| | | clearable |
| | | @change="idFn1" |
| | | > |
| | | <el-option |
| | | v-for="dict in CompanyList" |
| | | :key="dict.cnName" |
| | | :label="dict.cnName" |
| | | :value="dict.cnName" |
| | | /> |
| | | </el-select> |
| | | <!-- <i class="el-icon-circle-plus-outline" @click="handleAdd1"></i> --> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="文化程度" prop="wenHua"> |
| | | <el-form-item label="文化程度" prop="wenHua" label-width="93px"> |
| | | <el-input |
| | | :disabled="isDisabled" |
| | | v-model="form.wenHua" |
| | |
| | | :data="packagedataList" |
| | | node-key="proId" |
| | | :props="defaultpackProps" |
| | | :filter-node-method="filterpackage" |
| | | @check-change="handlePackageChecked" |
| | | :default-checked-keys="checkedListkey1" |
| | | :render-content="renderContent" |
| | | > |
| | | </el-tree> |
| | |
| | | style="width: 100%" |
| | | height="270" |
| | | > |
| | | <el-table-column prop="proName" label="项目" width="180"> |
| | | <el-table-column prop="s" label="项目" width="180"> |
| | | </el-table-column> |
| | | <el-table-column prop="proType" label="性别" width="180"> |
| | | <template |
| | |
| | | </el-table> |
| | | </div> |
| | | </el-dialog> |
| | | <el-dialog |
| | | title="提示" |
| | | :visible.sync="cardreader" |
| | | width="30%" |
| | | :close-on-press-escape="false" |
| | | :close-on-click-modal="false" |
| | | > |
| | | <template> |
| | | <el-radio-group v-model="cardreaderradio" @input="changeradio"> |
| | | <el-radio :label="3">身份证</el-radio> |
| | | <el-radio :label="6">健康码</el-radio> |
| | | </el-radio-group> |
| | | <div style="margin-top: 10px" v-show="cardreaderradio == 6"> |
| | | <el-input |
| | | v-model="inputSSS" |
| | | ref="tableHeadFilterInp" |
| | | placeholder="请输入内容" |
| | | ></el-input> |
| | | </div> |
| | | </template> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="cardreader = false">取 消</el-button> |
| | | <el-button type="primary" @click="cardreadercopes">确 定</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | <div style="position: absolute; bottom: 100px; width: 360px; display: none"> |
| | | <div |
| | | id="printBill" |
| | |
| | | </span> --> |
| | | <!-- </el-dialog> --> |
| | | <historyTj :cusIdCard="form.cusIdcard" ref="historyTj"></historyTj> |
| | | <el-dialog |
| | | title="提示" |
| | | :visible.sync="dialogVisiblese" |
| | | width="30%" |
| | | :before-close="handleClose" |
| | | > |
| | | <el-dialog title="提示" :visible.sync="dialogVisiblese" width="30%"> |
| | | <span>是否复制最近一次的体检项目?</span> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="dialogVisiblese = false">取 消</el-button> |
| | |
| | | getByTjNum, |
| | | } from "@/api/hosp/customer"; |
| | | import { getPrintSetUp } from "@/api/system/examcharge"; |
| | | |
| | | import axios from "axios"; |
| | | import { getIp } from "@/utils/auth"; |
| | | import { |
| | | deptTreeSelect, |
| | | projectGetList, |
| | |
| | | getIsRequired, |
| | | getconfigKey, |
| | | getHistryTjOrderProByCusIdCard, |
| | | readCertCardInfos, |
| | | } from "@/api/system/tijian"; |
| | | import { addComp } from "@/api/system/comp"; |
| | | import { getCompany, queryCompany } from "@/api/team/tuanti"; |
| | | import Packages from "@/components/Packages"; |
| | | import { MessageBox } from "element-ui"; |
| | | import VTreeTransfer from "./TreeTransfer.vue"; |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | open1: false, |
| | | filterage: "", |
| | | checkedkeys: [], |
| | | DataLists: [], |
| | |
| | | proIdList: [], |
| | | tableDatas: [], |
| | | dialogVisiblese: false, |
| | | cardreaderradio: 3, |
| | | lishi: false, |
| | | table: false, |
| | | HistoryList: {}, |
| | | index: 0, |
| | | names: "", |
| | | inputSSS: "", |
| | | dictType: [ |
| | | { |
| | | value: 0, |
| | |
| | | ids: [], |
| | | // 非单个禁用 |
| | | single: true, |
| | | cardreader: false, |
| | | // 非多个禁用 |
| | | multiple: true, |
| | | nodeobj: {}, |
| | |
| | | treedataList: [], |
| | | checkedkey: [], |
| | | checkedListkey: [], |
| | | checkedListkey1: [], |
| | | defaultProps: { |
| | | children: [], |
| | | label: "proName", |
| | |
| | | pacName: null, |
| | | pacRemark: null, |
| | | }, |
| | | valueUrl: "ws://127.0.0.1:18890", |
| | | WebSocket: null, |
| | | // valueUrl: "ws://127.0.0.1:18890", |
| | | // valueUrl: "ws://192.168.1.3:6789/websocket", |
| | | valueUrl: "ws://127.0.0.1:6789/websocket", |
| | | valueUrls: "ws://127.0.0.1:6789/websocket", |
| | | // valueUrls: "ws://"+getIp() +":6789/websocket", |
| | | webSocket: null, |
| | | // 身份证需要 |
| | | // socket: null, |
| | | // value: 1, |
| | |
| | | |
| | | // 表单参数 |
| | | // 表单参数 |
| | | obj: {}, |
| | | CompanyList: [], |
| | | form: { |
| | | cusIdcard: "", |
| | | tjType: "2", |
| | | tjType: "3", |
| | | cusSex: 1, |
| | | cusNational: "1", |
| | | cusMarryStatus: "1", |
| | | cusMarryStatus: "5", |
| | | idType: "1", |
| | | ageUnit: "0", |
| | | }, |
| | | form1: {}, |
| | | title: "", |
| | | // 表单校验 |
| | | rules: { |
| | | cusName: [{ required: true, message: "", trigger: "blur" }], |
| | |
| | | // ], |
| | | cusIdcard: [{ required: true, message: "", trigger: "change" }], |
| | | }, |
| | | rules1: { |
| | | cnName: [{ required: true, trigger: "blur" }], |
| | | contactPerson: [{ required: true, trigger: "blur" }], |
| | | contactPhone: [ |
| | | { |
| | | required: true, |
| | | trigger: "blur", |
| | | }, |
| | | { |
| | | pattern: /^1[3-9]\d{9}$/, |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | }; |
| | | }, |
| | | watch: { |
| | |
| | | }, |
| | | }, |
| | | created() { |
| | | this.getCurrentDateTime(); |
| | | this.getCompanyList(); |
| | | |
| | | this.getCurrentDateTime(); |
| | | this.startTimer(); |
| | | this.getList1(); |
| | | // this.getData(); |
| | | }, |
| | | mounted() {}, |
| | | |
| | | methods: { |
| | | getCompanyList() { |
| | | this.loading = true; |
| | | getconfigKey("team_reservation_default_day").then((res) => { |
| | | this.queryParams.yxts = res.msg; |
| | | }); |
| | | getCompany(this.queryParam).then((response) => { |
| | | this.CompanyList = response.data; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | cancel1() { |
| | | this.open1 = false; |
| | | this.reset1(); |
| | | }, |
| | | submitFormS() { |
| | | this.$refs["form1"].validate((valid) => { |
| | | if (valid) { |
| | | addComp(this.form1).then((response) => { |
| | | this.$modal.msgSuccess("新增成功"); |
| | | this.open1 = false; |
| | | this.getCompanyList(); |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | reset1() { |
| | | this.form1 = { |
| | | company: "", |
| | | payType: "", |
| | | name: "", |
| | | phoe: "", |
| | | signingPic: "", |
| | | discount: "", |
| | | }; |
| | | }, |
| | | handleAdd1() { |
| | | this.reset1(); |
| | | this.open1 = true; |
| | | this.title = "添加体检单位信息维护"; |
| | | }, |
| | | idFn1(value) { |
| | | if (value) { |
| | | |
| | | const originalCompId = this.form.dictCompId; |
| | | this.form.compName = value; |
| | | this.CompanyList.forEach((item) => { |
| | | if (item.cnName == this.form.compName) { |
| | | this.form.dictCompId = item.drugManufacturerId; |
| | | } |
| | | }); |
| | | |
| | | if (this.form.dictCompId === originalCompId) { |
| | | this.form.dictCompId = ''; |
| | | } |
| | | } |
| | | }, |
| | | getCurrentDateTime() { |
| | | const currentDate = new Date(); |
| | | |
| | |
| | | this.discount = this.form.discount; |
| | | } |
| | | if (this.form.tjType === null) { |
| | | this.form.tjType = "2"; |
| | | this.form.tjType = "3"; |
| | | } |
| | | if (this.form.cusMarryStatus === "null") { |
| | | this.form.cusMarryStatus = "5"; |
| | | } |
| | | if (this.form.cusNational === "null") { |
| | | this.form.cusNational = "1"; |
| | | } |
| | | if (this.form.reservationId != null) { |
| | | if (this.form.groupingId) { |
| | |
| | | } else if ("MozWebSocket" in window) { |
| | | websocket = new MozWebSocket(url); |
| | | } else { |
| | | // console.log("SockJS"); |
| | | } |
| | | |
| | | if (websocket == null) { |
| | |
| | | this.websocket = websocket; |
| | | // 连接设备 |
| | | var jsonObj = { |
| | | name: "connect", |
| | | // name: "connect", |
| | | type: "1", |
| | | }; |
| | | var jStr = JSON.stringify(jsonObj); |
| | | this.websocket.send(jStr); |
| | | alert("请放身份证再点确认"); |
| | | // alert("请放身份证再点确认"); |
| | | var jsonObj = { |
| | | name: "readCert", |
| | | // name: "readCert", |
| | | }; |
| | | var jStr = JSON.stringify(jsonObj); |
| | | this.websocket.send(jStr); |
| | | // var jStr = JSON.stringify(jsonObj); |
| | | // this.websocket.send(jStr); |
| | | this.dialogVisible = false; |
| | | }; |
| | | |
| | | //接收到消息的回调方法 |
| | | websocket.onmessage = function (event) { |
| | | websocket.onmessage = (event) => { |
| | | var resultObj = eval("(" + event.data + ")"); |
| | | //resultFlag为0代表读卡成功 |
| | | if ( |
| | | resultObj.name == "readCard" || |
| | | resultObj.name == "readCert" || |
| | | resultObj.name == "PushWithImg" || |
| | | resultObj.name == "PushWithOutImg" |
| | | ) { |
| | | if (resultObj.resultFlag == "0") { |
| | | //回显相关数据 |
| | | _this.form.cusName = resultObj.resultContent.partyName; |
| | | _this.form.cusSex = |
| | | resultObj.resultContent.gender == "0" ? "女" : "男"; |
| | | _this.form.cusNational = resultObj.resultContent.nation; |
| | | _this.form.cusBrithday = resultObj.resultContent.bornDay; |
| | | if (_this.form.cusBrithday) { |
| | | _this.form.cusBrithday = _this.form.cusBrithday.replace( |
| | | /^(\d{4})(\d{2})(\d{2})$/, |
| | | "$1-$2-$3" |
| | | ); |
| | | } |
| | | _this.form.cusAddr = resultObj.resultContent.certAddress; |
| | | _this.form.cusIdcard = resultObj.resultContent.certNumber; |
| | | _this.imageUrl = |
| | | "data:image/jpeg;base64," + |
| | | resultObj.resultContent.identityPic; |
| | | if ( |
| | | resultObj.name == "readCert" || |
| | | resultObj.name == "PushWithImg" |
| | | ) { |
| | | this.imageUrl = |
| | | "data:image/jpeg;base64," + |
| | | resultObj.resultContent.identityPrintPic; |
| | | } |
| | | } else if (resultObj.resultFlag == "-1") { |
| | | if (resultObj.errorMsg == "端口打开失败") { |
| | | //alert("读卡器未连接"); |
| | | } else { |
| | | //alert(resultObj.errorMsg); |
| | | } |
| | | } else if (resultObj.resultFlag == "-2") { |
| | | //alert(resultObj.errorMsg); |
| | | } |
| | | } else if (resultObj.name == "getStatus") { |
| | | if (resultObj.resultFlag == "0") { |
| | | if (resultObj.status == "0") { |
| | | } else { |
| | | alert("设备连接已断开,请检查读卡器连接"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // TODO 以下代码可能是泾川使用的 |
| | | // this.jingChuanHandlerWebSocketResult(resultObj) |
| | | this.readCardWebSocket(resultObj); |
| | | }; |
| | | |
| | | //连接关闭的回调方法 |
| | |
| | | this.$refs.aaa.open = true; |
| | | this.$refs.aaa.getAllList(); |
| | | this.$refs.aaa.title = "证件字典"; |
| | | } else if (res.msg == "S") { |
| | | this.cardreader = true; |
| | | _this.cardreaderradio = 3; |
| | | _this.inputSSS = ""; |
| | | // let url = window.location.protocol + "//" + window.location.host; |
| | | |
| | | // axios |
| | | // .get("http://localhost:81/dev-api/readCertCardInfos") |
| | | // .then((res) => { |
| | | |
| | | // }) |
| | | // .catch((err) => { |
| | | |
| | | // }); |
| | | |
| | | // readCertCardInfos().then((res) => { |
| | | // _this.form.cusName = res.data.name; |
| | | // _this.form.cusSex = |
| | | // res.data.sex; |
| | | // _this.form.cusNational = res.data.mz; |
| | | // _this.form.cusBrithday = res.data.csrq; |
| | | // if (_this.form.cusBrithday) { |
| | | // _this.form.cusBrithday = _this.form.cusBrithday.replace( |
| | | // /^(\d{4})(\d{2})(\d{2})$/, |
| | | // "$1-$2-$3" |
| | | // ); |
| | | // } |
| | | // _this.form.cusAddr = res.data.addres; |
| | | // _this.form.cusIdcard = res.data.card; |
| | | // }); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | // 最新使用webSocket通信 |
| | | readCardWebSocket(resultObj) { |
| | | let _this = this; |
| | | if (resultObj.code === 200 && resultObj.data.name != null) { |
| | | //回显相关数据 |
| | | _this.form.cusName = resultObj.data.name; |
| | | _this.form.cusSex = resultObj.data.sex == "0" ? "女" : "男"; |
| | | _this.form.cusNational = resultObj.data.mz; |
| | | _this.form.cusBrithday = resultObj.data.csrq; |
| | | if (_this.form.cusBrithday) { |
| | | _this.form.cusBrithday = _this.form.cusBrithday.replace( |
| | | /^(\d{4})(\d{2})(\d{2})$/, |
| | | "$1-$2-$3" |
| | | ); |
| | | } |
| | | _this.form.cusAddr = resultObj.data.addres; |
| | | _this.form.cusIdcard = resultObj.data.card; |
| | | _this.imageUrl = "data:image/jpeg;base64," + resultObj.data.img; |
| | | if (resultObj.name == "readCert" || resultObj.name == "PushWithImg") { |
| | | this.imageUrl = "data:image/jpeg;base64," + resultObj.data.img; |
| | | } |
| | | } else { |
| | | this.$message.warning("请放置身份证后再点击读取"); |
| | | } /* if (resultObj.resultFlag == "-1") { |
| | | if (resultObj.errorMsg == "端口打开失败") { |
| | | //alert("读卡器未连接"); |
| | | } else { |
| | | //alert(resultObj.errorMsg); |
| | | } |
| | | } else if (resultObj.resultFlag == "-2") { |
| | | //alert(resultObj.errorMsg); |
| | | } */ |
| | | }, |
| | | // TODO 以下代码可能是泾川使用的 |
| | | jingChuanHandlerWebSocketResult(resultObj) { |
| | | let _this = this; |
| | | if ( |
| | | resultObj.name == "readCard" || |
| | | resultObj.name == "readCert" || |
| | | resultObj.name == "PushWithImg" || |
| | | resultObj.name == "PushWithOutImg" |
| | | ) { |
| | | if (resultObj.resultFlag == "0") { |
| | | //回显相关数据 |
| | | _this.form.cusName = resultObj.resultContent.partyName; |
| | | _this.form.cusSex = |
| | | resultObj.resultContent.gender == "0" ? "女" : "男"; |
| | | _this.form.cusNational = resultObj.resultContent.nation; |
| | | _this.form.cusBrithday = resultObj.resultContent.bornDay; |
| | | if (_this.form.cusBrithday) { |
| | | _this.form.cusBrithday = _this.form.cusBrithday.replace( |
| | | /^(\d{4})(\d{2})(\d{2})$/, |
| | | "$1-$2-$3" |
| | | ); |
| | | } |
| | | _this.form.cusAddr = resultObj.resultContent.certAddress; |
| | | _this.form.cusIdcard = resultObj.resultContent.certNumber; |
| | | _this.imageUrl = |
| | | "data:image/jpeg;base64," + resultObj.resultContent.identityPic; |
| | | if (resultObj.name == "readCert" || resultObj.name == "PushWithImg") { |
| | | this.imageUrl = |
| | | "data:image/jpeg;base64," + |
| | | resultObj.resultContent.identityPrintPic; |
| | | } |
| | | } else if (resultObj.resultFlag == "-1") { |
| | | if (resultObj.errorMsg == "端口打开失败") { |
| | | //alert("读卡器未连接"); |
| | | } else { |
| | | //alert(resultObj.errorMsg); |
| | | } |
| | | } else if (resultObj.resultFlag == "-2") { |
| | | //alert(resultObj.errorMsg); |
| | | } |
| | | } else if (resultObj.name == "getStatus") { |
| | | if (resultObj.resultFlag == "0") { |
| | | if (resultObj.status == "0") { |
| | | } else { |
| | | alert("设备连接已断开,请检查读卡器连接"); |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | changeradio() { |
| | | if (this.cardreaderradio != 3) { |
| | | this.$nextTick(() => { |
| | | this.$refs.tableHeadFilterInp.focus(); |
| | | }); |
| | | } |
| | | }, |
| | | cardreadercopes() { |
| | | let _this = this; |
| | | |
| | | if (this.cardreaderradio == 3) { |
| | | var websocket = null; |
| | | var url = this.valueUrls; |
| | | // var url = 'ws://'+ getIp() +':6789/websocket' |
| | | if ("WebSocket" in window) { |
| | | websocket = new WebSocket(url); |
| | | } else if ("MozWebSocket" in window) { |
| | | websocket = new MozWebSocket(url); |
| | | } else { |
| | | } |
| | | if (websocket == null) { |
| | | alert("11111"); |
| | | } |
| | | websocket.onopen = function () { |
| | | try { |
| | | // 连接设备 |
| | | var jsonObjs = { |
| | | type: 1, |
| | | data: {}, |
| | | }; |
| | | var jStrs = JSON.stringify(jsonObjs); |
| | | websocket.send(jStrs); |
| | | } catch (err) { |
| | | var tryTime = 0; |
| | | // 重试10次,每次之间间隔3秒 |
| | | if (tryTime < 1) { |
| | | var t1 = setTimeout(function () { |
| | | tryTime++; |
| | | var jsonObjs = { |
| | | type: 1, |
| | | data: {}, |
| | | }; |
| | | var jStrs = JSON.stringify(jsonObjs); |
| | | websocket.send(jStrs); |
| | | }, 1 * 1000); |
| | | } else { |
| | | console.error("重连失败."); |
| | | } |
| | | } |
| | | }; |
| | | websocket.onclose = function () { |
| | | alert("读卡器连接关闭"); |
| | | }; |
| | | websocket.onmessage = function (event) { |
| | | var resultObj = JSON.parse(event.data); |
| | | _this.form.cusName = resultObj.data.name; |
| | | _this.form.cusSex = resultObj.data.sex; |
| | | _this.form.cusNational = resultObj.data.mz; |
| | | _this.form.cusBrithday = resultObj.data.csrq; |
| | | if (_this.form.cusBrithday) { |
| | | _this.form.cusBrithday = _this.form.cusBrithday.replace( |
| | | /^(\d{4})(\d{2})(\d{2})$/, |
| | | "$1-$2-$3" |
| | | ); |
| | | } |
| | | _this.form.cusIdcard = resultObj.data.card; |
| | | if (_this.form.cusIdcard) { |
| | | const reg = |
| | | /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/; |
| | | if (reg.test(_this.form.cusIdcard)) { |
| | | var org_birthday = _this.form.cusIdcard.substring(6, 14); |
| | | var birthday = |
| | | org_birthday.substring(0, 4) + |
| | | "-" + |
| | | org_birthday.substring(4, 6) + |
| | | "-" + |
| | | org_birthday.substring(6, 8); |
| | | var birthdays = new Date(birthday.replace(/-/g, "-")); |
| | | let d = new Date(); |
| | | let age = |
| | | d.getFullYear() - |
| | | birthdays.getFullYear() - |
| | | (d.getMonth() < birthdays.getMonth() || |
| | | (d.getMonth() == birthdays.getMonth() && |
| | | d.getDate() < birthdays.getDate()) |
| | | ? 1 |
| | | : 0); |
| | | |
| | | _this.form.age = age; |
| | | } |
| | | } |
| | | _this.form.cusAddr = resultObj.data.addres; |
| | | |
| | | _this.cardreader = false; |
| | | }; |
| | | |
| | | //连接发生错误的回调方法 |
| | | websocket.onerror = function () { |
| | | alert("请检查读卡器连接是否正常"); |
| | | }; |
| | | } else { |
| | | // if (_this.inputSSS.indexOf(":1") != -1) { |
| | | |
| | | // var str1 = _this.inputSSS.indexOf(":1"); |
| | | // var result1 = _this.inputSSS.substring(0, str1); |
| | | |
| | | // var str2 = _this.inputSSS.indexOf(":1"); |
| | | // var result2 = _this.inputSSS.substring( |
| | | // str2 + 2, |
| | | // _this.inputSSS.length |
| | | // ); |
| | | |
| | | // _this.inputSSS = result1 + result2; |
| | | // } |
| | | _this.inputSSS = _this.inputSSS.replace(":1", ""); |
| | | var websocket = null; |
| | | var url = this.valueUrls; |
| | | // var url = 'ws://'+ getIp() +':6789/websocket' |
| | | if ("WebSocket" in window) { |
| | | websocket = new WebSocket(url); |
| | | } else if ("MozWebSocket" in window) { |
| | | websocket = new MozWebSocket(url); |
| | | } else { |
| | | } |
| | | if (websocket == null) { |
| | | alert("11111"); |
| | | } |
| | | websocket.onopen = function () { |
| | | try { |
| | | // 连接设备 |
| | | var jsonObjs = { |
| | | type: 2, |
| | | data: { |
| | | qrcode: _this.inputSSS, |
| | | }, |
| | | }; |
| | | var jStrs = JSON.stringify(jsonObjs); |
| | | websocket.send(jStrs); |
| | | } catch (err) { |
| | | var tryTime = 0; |
| | | // 重试10次,每次之间间隔3秒 |
| | | if (tryTime < 1) { |
| | | var t1 = setTimeout(function () { |
| | | tryTime++; |
| | | var jsonObjs = { |
| | | type: 2, |
| | | data: { |
| | | qrcode: _this.inputSSS, |
| | | }, |
| | | }; |
| | | var jStrs = JSON.stringify(jsonObjs); |
| | | websocket.send(jStrs); |
| | | }, 1 * 1000); |
| | | } else { |
| | | console.error("重连失败."); |
| | | } |
| | | } |
| | | }; |
| | | websocket.onclose = function () { |
| | | alert("读卡器连接关闭"); |
| | | }; |
| | | websocket.onmessage = function (event) { |
| | | var resultObj = JSON.parse(event.data); |
| | | _this.form.cusName = resultObj.data.name; |
| | | |
| | | if (resultObj.data.nation == "汉族") { |
| | | _this.form.cusNational = "1"; |
| | | } |
| | | if (resultObj.data.gender == "男") { |
| | | _this.form.cusSex = 0; |
| | | } else { |
| | | _this.form.cusSex = 1; |
| | | } |
| | | _this.form.cusBrithday = resultObj.data.birthday; |
| | | if (_this.form.cusBrithday) { |
| | | _this.form.cusBrithday = _this.form.cusBrithday.replace( |
| | | /^(\d{4})(\d{2})(\d{2})$/, |
| | | "$1-$2-$3" |
| | | ); |
| | | } |
| | | _this.form.cusPhone = resultObj.data.phone; |
| | | _this.form.cusIdcard = resultObj.data.idenno; |
| | | if (_this.form.cusIdcard) { |
| | | const reg = |
| | | /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/; |
| | | if (reg.test(_this.form.cusIdcard)) { |
| | | var org_birthday = _this.form.cusIdcard.substring(6, 14); |
| | | var birthday = |
| | | org_birthday.substring(0, 4) + |
| | | "-" + |
| | | org_birthday.substring(4, 6) + |
| | | "-" + |
| | | org_birthday.substring(6, 8); |
| | | var birthdays = new Date(birthday.replace(/-/g, "-")); |
| | | let d = new Date(); |
| | | let age = |
| | | d.getFullYear() - |
| | | birthdays.getFullYear() - |
| | | (d.getMonth() < birthdays.getMonth() || |
| | | (d.getMonth() == birthdays.getMonth() && |
| | | d.getDate() < birthdays.getDate()) |
| | | ? 1 |
| | | : 0); |
| | | |
| | | _this.form.age = age; |
| | | } |
| | | } |
| | | _this.cardreader = false; |
| | | }; |
| | | |
| | | //连接发生错误的回调方法 |
| | | websocket.onerror = function () { |
| | | alert("请检查读卡器连接是否正常"); |
| | | }; |
| | | } |
| | | }, |
| | | |
| | |
| | | // 点击多选框获取选中数据 |
| | | handleSelectionChange(selection, row) { |
| | | this.tableData = selection; |
| | | console.log(this.tableData); |
| | | console.log(this.tableData1); |
| | | if (selection.length > 1) { |
| | | let del_row = selection.shift(); |
| | | this.$refs.tb.toggleRowSelection(del_row, false); //设置这一行取消选中 |
| | |
| | | this.tableData.forEach((item) => { |
| | | this.tableData1.forEach((item1) => { |
| | | item.tjProjectList.forEach((item2) => { |
| | | if (item2.proId == item1.proPrantId) { |
| | | if (item2.proId == item1.proPrantId && item1.pacName == "单项") { |
| | | this.$confirm( |
| | | "该套餐包含了已选单项,是否确认选择该套餐?", |
| | | "确认信息", |
| | |
| | | ) |
| | | .then(() => { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "请注意查看价格", |
| | | }); |
| | | type: "success", |
| | | message: "请注意查看价格", |
| | | }); |
| | | }) |
| | | .catch((action) => { |
| | | if (action === "cancel") { |
| | | let del_row = selection.shift(); |
| | | this.$refs.tb.toggleRowSelection(del_row, false); |
| | | this.$refs.tb.toggleRowSelection(del_row, false); |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "已取消", |
| | |
| | | handleClick(tab, event) { |
| | | if (this.activeNames == "second") { |
| | | this.DataList = []; |
| | | this.checkedkey = []; |
| | | this.getDataList(); |
| | | } else if (this.activeNames == "third") { |
| | | this.DataLists = []; |
| | | this.checkedkeys = []; |
| | | getZhList().then((response) => { |
| | | if (response.data) { |
| | | this.packageList = response.data; |
| | | this.checkedkeys.push(this.packageList[0].id); |
| | | let datas = { |
| | | zhId: this.packageList[0].id, |
| | | }; |
| | | getlistByZhId(datas).then((res) => { |
| | | this.packagedataList = res.data.tjProjectList; |
| | | for (var i = 0; i < this.packagedataList.length; i++) { |
| | | let proId = this.packagedataList[i].proId; |
| | | getProSonDxList(proId).then((res) => { |
| | | this.TreedataList = res.data.list; |
| | | this.TreedataList.forEach((item) => { |
| | | this.DataLists.push(item); |
| | | if (this.DataLists.length >= 1) { |
| | | this.marryalls = 0; |
| | | this.DataLists.forEach((item1) => { |
| | | this.marryalls += item1.proPrice; |
| | | this.packagedataList.forEach((item3) => { |
| | | if (item1.proParentId == item3.proId) { |
| | | item1.propinName = item3.proName; |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | this.loading = false; |
| | | }); |
| | | } |
| | | }, |
| | | // gaibian(val){ |
| | | // console.log(val); |
| | | // let pname = val; |
| | | // console.log(pname); |
| | | // getProParentIdDxList(pname).then(response=>{ |
| | | // this.Treedata = response.data.list; |
| | | // }) |
| | |
| | | this.loading = true; |
| | | getProParentIdDxList().then((response) => { |
| | | this.Treedata = response.data.list; |
| | | |
| | | if (this.tableData[0]) { |
| | | this.tableData[0].tjProjectList.forEach((selectionitem) => { |
| | | this.Treedata.forEach((item) => { |
| | |
| | | }); |
| | | }); |
| | | } |
| | | // if (this.DataLists.length != 0) { |
| | | // this.DataLists.forEach((selectionitem) => { |
| | | // this.Treedata.forEach((item) => { |
| | | // if (selectionitem.propinName == item.proName) { |
| | | // item.disabled = true; |
| | | // } |
| | | // }); |
| | | // }); |
| | | // } |
| | | this.checkedkey.push(this.Treedata[0].proId); |
| | | let proId = this.Treedata[0].proId; |
| | | getProSonDxList(proId).then((res) => { |
| | | this.TreedataList = res.data.list; |
| | | this.TreedataList.forEach((item) => { |
| | | this.checkedListkey.push(item.proId); |
| | | this.DataList.push(item); |
| | | this.DataList.forEach((item) => { |
| | | item.propinName = this.Treedata[0].proName; |
| | | }); |
| | | }); |
| | | this.TotalPrice1 = 0; |
| | | this.marryall = 0; |
| | | if (this.DataList.length != 0) { |
| | | this.list1 = false; |
| | | this.DataList.forEach((item) => { |
| | | this.TotalPrice1 = item.proPrice + this.TotalPrice1; |
| | | this.marryall += item.proPrice; |
| | | }); |
| | | } |
| | | }); |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | |
| | | handlepackage(data, checked, checkedNodes) { |
| | | this.dataObj = data; |
| | | if (checked.checkedNodes.length != 0) { |
| | | this.$refs.treas.setCheckedKeys([data.id]); |
| | | let datas = { |
| | |
| | | }; |
| | | getlistByZhId(datas).then((res) => { |
| | | this.packagedataList = res.data.tjProjectList; |
| | | |
| | | this.DataLists = []; |
| | | this.checkedListkey1 = []; |
| | | for (var i = 0; i < this.packagedataList.length; i++) { |
| | | let proId = this.packagedataList[i].proId; |
| | | this.checkedListkey1.push(proId); |
| | | // this.DataLists.push(this.packagedataList[i]); |
| | | getProSonDxList(proId).then((res) => { |
| | | this.TreedataList = res.data.list; |
| | | |
| | | this.TreedataList.forEach((item) => { |
| | | // this.checkedListkey1.push(item.proId); |
| | | |
| | | this.DataLists.push(item); |
| | | |
| | | if (this.DataLists.length >= 1) { |
| | | this.marryalls = 0; |
| | | this.DataLists.forEach((item1) => { |
| | | this.marryalls += item1.proPrice; |
| | | |
| | | this.packagedataList.forEach((item3) => { |
| | | if (item1.proParentId == item3.proId) { |
| | | item1.propinName = item3.proName; |
| | |
| | | } |
| | | }); |
| | | } else if (checked.checkedNodes.length == 0) { |
| | | // for (var i = 0; i < data.tjProjectList.length; i++) { |
| | | // let proId = data.tjProjectList[i].proId; |
| | | // getProSonDxList(proId).then((res) => { |
| | | // this.TreedataList = res.data.list; |
| | | // this.TreedataList.forEach((item) => { |
| | | // this.DataLists.forEach((item1, index) => { |
| | | // if (item.proId == item1.proId) { |
| | | // this.DataLists.splice(index, 1); |
| | | // } |
| | | // }); |
| | | // }); |
| | | // this.marryalls = 0 |
| | | // if(this.DataLists.length != 0){ |
| | | // this.DataLists.forEach((item1, index) => { |
| | | // this.marryalls += item1.proPrice; |
| | | // }) |
| | | // } |
| | | // }); |
| | | // } |
| | | this.DataLists = []; |
| | | this.marryalls = 0; // 清零总价 |
| | | this.checkedListkey1 = []; |
| | | } |
| | | }, |
| | | objectspanmethod({ row, column, rowIndex, columnIndex }) { |
| | |
| | | // return [rowspan, 1]; |
| | | // } |
| | | }, |
| | | |
| | | handlePackageChecked(data, checked, checkedNodes) { |
| | | if (checked == false) { |
| | | this.DataLists.forEach((item, index) => { |
| | | if (item.proId == data.proId) { |
| | | this.DataLists.splice(index, 1); |
| | | this.marryalls = 0; // 重置合计金额 |
| | | this.DataLists.forEach((item1) => { |
| | | this.marryalls += item1.proPrice; // 重新计算合计金额 |
| | | }); |
| | | } |
| | | }); |
| | | } else if (checked == true) { |
| | | this.DataLists.push(data); // 添加数据到已选列表 |
| | | this.DataLists.forEach((item1) => { |
| | | if (item1.proParentId == this.dataObj.proId) { |
| | | item1.propinName = this.dataObj.proName; // 设置父级名称 |
| | | } |
| | | }); |
| | | // this.spliceData(); |
| | | this.marryalls = 0; // 重置合计金额 |
| | | this.DataLists.forEach((item1) => { |
| | | this.marryalls += item1.proPrice; // 重新计算合计金额 |
| | | }); |
| | | } |
| | | }, |
| | | // 点击获取每个树节点 |
| | | handleCurrentChecked(data, checked, checkedNodes) { |
| | | this.dataObj = data; |
| | | if (checked.checkedNodes.length != 0) { |
| | | this.$refs.tree.setCheckedKeys([data.proId]); |
| | | |
| | | let proId = data.proId; |
| | | getProSonDxList(proId).then((res) => { |
| | | this.TreedataList = res.data.list; |
| | | this.TreedataList.forEach((item) => { |
| | | this.checkedListkey.push(item.proId); |
| | | |
| | | this.DataList.push(item); |
| | | this.spliceData(); |
| | | this.DataList.forEach((item1) => { |
| | |
| | | } |
| | | this.list1 = false; |
| | | this.list3 = true; |
| | | this.list2 = false; |
| | | } else { |
| | | this.list1 = true; |
| | | this.TotalPrice = "0.00"; |
| | | } |
| | | }); |
| | | } else { |
| | | console.log(失败了); |
| | | } |
| | | }); |
| | | this.taocan = false; |
| | |
| | | width: 100%; |
| | | display: flex; |
| | | } |
| | | |
| | | .tab3 { |
| | | max-height: 400px; |
| | | border: 1px solid #dcdfe6; |
| | | } |
| | | |
| | | .filter-tree { |
| | | /* max-height: 360px; |
| | | overflow-y: auto; |
| | | border: 1px solid #d9d9d9; |
| | | border: 1px solid #d9d9d9; */ |
| | | overflow: auto; |
| | | flex: 1; |
| | | height: 350px; |
| | | } |
| | | |
| | | .tab2 { |
| | |
| | | width: 300px; |
| | | height: 300px; |
| | | } |
| | | |
| | | .dialog-footer2 { |
| | | width: 960px; |
| | | height: 36px; |
| | | display: flex; |
| | | justify-content: center; |
| | | } |
| | | .el-input--suffix .el-input__inner { |
| | | padding-right: 15px; |
| | | } |