From f169a06cea16bc6215743a7be07febdb1d4fdc38 Mon Sep 17 00:00:00 2001 From: qinxianzhangyao <11053546+qinxianzhangyao@user.noreply.gitee.com> Date: 星期五, 12 七月 2024 17:16:55 +0800 Subject: [PATCH] qxtj --- src/views/reservation/reservations/index.vue | 7 src/views/system/tijian/index.vue | 82 ++++ src/api/hosp/project.js | 8 src/views/system/comp/index.vue | 245 +++++++------ src/views/reservation/resercopy/index.vue | 42 +- src/views/system/tijianall/index.vue | 557 +++++++++++++++++++++++++++----- src/views/hosp/project/index.vue | 65 +++ 7 files changed, 775 insertions(+), 231 deletions(-) diff --git a/src/api/hosp/project.js b/src/api/hosp/project.js index c232e51..bc733b6 100644 --- a/src/api/hosp/project.js +++ b/src/api/hosp/project.js @@ -129,4 +129,12 @@ method: 'get', params: data }) +} + + +export function tbhisproprice() { + return request({ + url: '/system/config/tbhisproprice', + method: 'get', + }) } \ No newline at end of file diff --git a/src/views/hosp/project/index.vue b/src/views/hosp/project/index.vue index 2615b50..7e73761 100644 --- a/src/views/hosp/project/index.vue +++ b/src/views/hosp/project/index.vue @@ -108,6 +108,15 @@ <el-col :span="1.5"> <el-button type="primary" + icon="el-icon-download" + size="mini" + @click="Synchronizationfees" + >鎵归噺鍚屾璐圭敤</el-button + > + </el-col> + <el-col :span="1.5"> + <el-button + type="primary" icon="el-icon-sort" size="mini" @click="toggleExpandAll" @@ -506,6 +515,49 @@ <el-input v-model="form.lisXmmc" placeholder="璇疯緭鍏IS椤圭洰"> </el-input> </el-form-item> + <el-form-item label="his缂栫爜" prop="hisXmbm"> + <el-input + v-model="form.hisXmbm" + placeholder="璇疯緭鍏is缂栫爜" + style="width: 200px" + /> + </el-form-item> + <el-form-item label="his椤圭洰鍚嶇О" prop="hisXmmc"> + <el-input + v-model="form.hisXmmc" + placeholder="璇疯緭鍏is椤圭洰鍚嶇О" + style="width: 260px" + /> + </el-form-item> + <el-form-item label="缁勫悎鏍囧織" prop="sfzhfy"> + + <el-select + v-model="form.sfzhfy" + placeholder="璇烽�夋嫨鏄惁缁勫悎鏍囧織" + style="width: 200px" + > + <el-option + v-for="dict in dict.type.sys_yes_no" + :key="dict.value" + :label="dict.label" + :value="dict.value" + ></el-option> + </el-select> + </el-form-item> + <el-form-item label="his鍗曚环" prop="hisdj"> + <el-input + v-model="form.hisdj" + placeholder="璇疯緭鍏is鍗曚环" + style="width: 200px" + /> + </el-form-item> <el-form-item label="鏁伴噺" prop="sl"> + <el-input + v-model="form.sl" + placeholder="璇疯緭鍏ユ暟閲�" + style="width: 260px" + /> + </el-form-item> + <el-form-item label="澶囨敞" prop="proRemark"> <el-input v-model="form.proRemark" @@ -822,7 +874,7 @@ deptTree, deptTree111, getAllChildListById, - getInfoByProId, + getInfoByProId,tbhisproprice } from "@/api/hosp/project"; import { listDept } from "@/api/system/dept"; import Treeselect from "@riophae/vue-treeselect"; @@ -953,6 +1005,11 @@ proParentId: "", deptId: "", needReport: "Y", + hisXmbm:"", + hisXmmc:"", + sfzhfy: "Y", + hisdj:"", + sl:"", proStatus: "0", proName: "", proPrice: "", @@ -1197,6 +1254,12 @@ this.loading = false; }); }, + + Synchronizationfees(){ + tbhisproprice().then((response) => { + this.$modal.msgSuccess("鎵归噺鍚屾璐圭敤鎴愬姛"); + }); + }, // input寮规鎼滅储 handlecharge() { this.querycharge.pageNum = 1; diff --git a/src/views/reservation/resercopy/index.vue b/src/views/reservation/resercopy/index.vue index 18d9250..e79c40c 100644 --- a/src/views/reservation/resercopy/index.vue +++ b/src/views/reservation/resercopy/index.vue @@ -124,7 +124,7 @@ prop="company" width="200" /> - <el-table-column label="宸ュ彿" align="center" prop="jobNo" width="80" /> + <!-- <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"> @@ -147,14 +147,14 @@ 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="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="120" + width="140" /> <el-table-column label="鍦板潃" align="center" prop="address" /> <el-table-column @@ -178,7 +178,7 @@ /> </template> </el-table-column> - <el-table-column label="鑱旂郴閭" align="center" prop="email" /> + <!-- <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" /> @@ -704,55 +704,55 @@ 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] = "鎬昏浜烘暟"; return; } - if (index === 2) { + if (index === 1) { sums[index] = this.ListObj.count; return; } - if (index === 6) { + if (index === 2) { sums[index] = "鐢风粍浜烘暟"; return; } - if (index === 7) { + if (index === 3) { sums[index] = this.ListObj.manCount; return; } - if (index === 8) { + if (index === 4) { sums[index] = "鐢风粍閲戦"; return; } - if (index === 9) { + if (index === 5) { sums[index] = this.ListObj.manMoney; return; } - if (index === 11) { + if (index === 6) { sums[index] = "濂崇粍浜烘暟"; return; } - if (index === 12) { + if (index === 7) { sums[index] = this.ListObj.woManCount; return; } - if (index === 13) { + if (index === 8) { sums[index] = "濂崇粍閲戦"; return; } - if (index === 14) { + if (index === 9) { sums[index] = this.ListObj.woManMoney; return; } - if (index === 15) { + if (index === 10) { sums[index] = "鍚堣閲戦"; return; } - if (index === 16) { + if (index === 11) { sums[index] = this.ListObj.hjMoney; return; } diff --git a/src/views/reservation/reservations/index.vue b/src/views/reservation/reservations/index.vue index 61d3bf0..280ab4b 100644 --- a/src/views/reservation/reservations/index.vue +++ b/src/views/reservation/reservations/index.vue @@ -60,8 +60,7 @@ </template> </el-table-column> <el-table-column label="鑱旂郴鐢佃瘽" align="center" prop="phoe" width="110px" :show-overflow-tooltip="true" /> - <el-table-column label="閭" align="center" prop="email" :show-overflow-tooltip="true" width="160px" /> - <el-table-column label="鍦板潃" align="center" prop="address" :show-overflow-tooltip="true" width="160px" /> + <el-table-column label="棰勭害鏃堕棿" align="center" prop="reservationTime" width="100px" :show-overflow-tooltip="true" sortable> <template slot-scope="scope"> @@ -92,6 +91,8 @@ </template> </el-table-column> <el-table-column label="鍗曚綅鍚嶇О" align="center" prop="company" :show-overflow-tooltip="true" /> + <el-table-column label="閭" align="center" prop="email" :show-overflow-tooltip="true" width="160px" /> + <el-table-column label="鍦板潃" align="center" prop="address" :show-overflow-tooltip="true" width="160px" /> <el-table-column label="鎿嶄綔" align="center" width="90px" fixed="right"> <template slot-scope="scope"> <el-button size="mini" type="text" icon="el-icon-s-order" @click="handleUpdate1(scope.row)" @@ -1091,6 +1092,7 @@ /** 淇敼鎸夐挳鎿嶄綔 */ handleUpdate(row) { + console.log(row) this.title = "淇敼浣撴棰勭害"; this.formIn = row; this.form.tjType = this.formIn.tjType @@ -1158,6 +1160,7 @@ this.TotalPrice1 = 0; this.tableData1.forEach((item) => { this.TotalPrice1 += item.nowPrice; + console.log(this.discount) this.TotalPrice = ( this.TotalPrice1 * (this.discount / 10) diff --git a/src/views/system/comp/index.vue b/src/views/system/comp/index.vue index f1f039a..819277a 100644 --- a/src/views/system/comp/index.vue +++ b/src/views/system/comp/index.vue @@ -453,7 +453,6 @@ icon="el-icon-plus" size="mini" @click="handleGroup" - v-hasPermi="['system:comp:add']" >淇濆瓨</el-button > </el-col> @@ -464,7 +463,6 @@ size="mini" :disabled="singlegg" @click="GroupUpdate" - v-hasPermi="['system:comp:edit']" >閲嶇疆</el-button > <el-button @@ -473,7 +471,6 @@ size="mini" :disabled="singlegg" @click="deleteGroup" - v-hasPermi="['system:comp:edit']" >鍒犻櫎</el-button > </el-col> @@ -606,16 +603,19 @@ style="width: 140px" /> </el-form-item> + <el-form-item> + <el-button icon="el-icon-refresh" size="mini" @click="resetQuerys">閲嶇疆</el-button> + </el-form-item> </el-form> - <div style="color: red; font-size: 8px"> + <!-- <div style="color: red; font-size: 8px"> 娉ㄩ噴锛氶紶鏍囧乏閿弻鍑婚�変腑琛屽彲鍒犻櫎 - </div> + </div> --> + <!-- @row-dblclick="dbclick" --> <el-table border v-loading="loading" :data="OnenewpacName" :row-class-name="tableRowClassName" - @row-dblclick="dbclick" height="478" > <el-table-column @@ -625,6 +625,17 @@ > <template slot-scope="scope"> {{ scope.row.proName + "/" + scope.row.proPrice }} + </template> + </el-table-column> + <el-table-column label="鎿嶄綔" align="center" width="68"> + <template slot-scope="scope"> + <el-button + size="mini" + type="text" + icon="el-icon-delete" + @click="handledbelete(scope.row)" + >鍒犻櫎</el-button + > </template> </el-table-column> </el-table> @@ -1011,31 +1022,31 @@ 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" }], + // 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" }], }, }; }, @@ -1126,6 +1137,11 @@ this.resetForm("queryForm"); this.handleQuery(); }, + resetQuerys(){ + this.OnenewpacName = [], + this.queryParams.price = 0, + this.$refs.tbone.toggleRowSelection(this.pacList[0], false); + }, // 澶氶�夋閫変腑鏁版嵁 handleSelectionChange(selection) { selection.forEach((item) => { @@ -1212,36 +1228,36 @@ index + 1; }); - if (this.groupList.length >= 1) { - if (this.groupList[0].id) { - getfzgrouping(this.groupList[0].id).then((response) => { - this.OnenewpacName = response.data.groupingProList; - this.queryParams.price = 0; - this.OnenewpacName.forEach((item) => { - this.queryParams.price += item.proPrice; - }); - }); - } - } + // if (this.groupList.length >= 1) { + // if (this.groupList[0].id) { + // getfzgrouping(this.groupList[0].id).then((response) => { + // this.OnenewpacName = response.data.groupingProList; + // this.queryParams.price = 0; + // this.OnenewpacName.forEach((item) => { + // this.queryParams.price += item.proPrice; + // }); + // }); + // } + // } - if (this.newpacName.length != 0) { - this.$nextTick(() => { - if (this.forms.pacName) { - this.newpacName.forEach((item, index) => { - if (this.forms.pacName == item.pacName) { - this.$refs.tbone.toggleRowSelection( - this.newpacName[index], - true - ); - } - }); - } else { - this.$refs.tbone.toggleRowSelection(this.newpacName[0], true); - } - }); - } else { - this.$refs.tbone.clearSelection(); - } + // if (this.newpacName.length != 0) { + // this.$nextTick(() => { + // if (this.forms.pacName) { + // this.newpacName.forEach((item, index) => { + // if (this.forms.pacName == item.pacName) { + // this.$refs.tbone.toggleRowSelection( + // this.newpacName[index], + // true + // ); + // } + // }); + // } else { + // this.$refs.tbone.toggleRowSelection(this.newpacName[0], true); + // } + // }); + // } else { + // this.$refs.tbone.clearSelection(); + // } }); } else { deptTreeSelect().then((response) => { @@ -1253,35 +1269,35 @@ index + 1; }); - if (this.groupList.length >= 1) { - if (this.groupList[0].id) { - getfzgrouping(this.groupList[0].id).then((response) => { - this.OnenewpacName = response.data.groupingProList; - this.queryParams.price = 0; - this.OnenewpacName.forEach((item) => { - this.queryParams.price += item.proPrice; - }); - }); - } - } - if (this.newpacName.length != 0) { - this.$nextTick(() => { - if (this.forms.pacName) { - this.newpacName.forEach((item, index) => { - if (this.forms.pacName == item.pacName) { - this.$refs.tbone.toggleRowSelection( - this.newpacName[index], - true - ); - } - }); - } else { - this.$refs.tbone.toggleRowSelection(this.newpacName[0], true); - } - }); - } else { - this.$refs.tbone.clearSelection(); - } + // if (this.groupList.length >= 1) { + // if (this.groupList[0].id) { + // getfzgrouping(this.groupList[0].id).then((response) => { + // this.OnenewpacName = response.data.groupingProList; + // this.queryParams.price = 0; + // this.OnenewpacName.forEach((item) => { + // this.queryParams.price += item.proPrice; + // }); + // }); + // } + // } + // if (this.newpacName.length != 0) { + // this.$nextTick(() => { + // if (this.forms.pacName) { + // this.newpacName.forEach((item, index) => { + // if (this.forms.pacName == item.pacName) { + // this.$refs.tbone.toggleRowSelection( + // this.newpacName[index], + // true + // ); + // } + // }); + // } else { + // this.$refs.tbone.toggleRowSelection(this.newpacName[0], true); + // } + // }); + // } else { + // this.$refs.tbone.clearSelection(); + // } }); } getProjectList().then((response) => { @@ -1357,6 +1373,17 @@ this.queryParams.price += item.proPrice; }); }, + handledbelete(row){ + this.queryParams.price = 0; + this.OnenewpacName.forEach((item,index) => { + if(item.proId == row.proId){ + this.OnenewpacName.splice(index, 1); + } + }); + return this.OnenewpacName.forEach((item) => { + this.queryParams.price += item.proPrice; + }); + }, submitrighr() { if (this.pacList.length >= 1) { this.openss = false; @@ -1372,30 +1399,22 @@ }, // 濂楅鍗曢」鑾峰彇 handleChangeOne(selection) { - this.pacList = selection; - this.OnenewpacName.forEach((item,index) => { - this.dataLists.forEach(item1 => { - if(item.proId == item1.proId){ - this.OnenewpacName.splice(index,1) - } - }) - }) - this.dataLists = []; - this.queryParams.price = 0; - this.pacList.forEach((item) => { - this.dataLists = item.tjProjectList; - }); - this.dataLists.forEach((item2) => { - this.OnenewpacName.push(item2); - }); - this.OnenewpacName.forEach((item) => { - this.queryParams.price += item.proPrice; - }); - if (selection.length > 1) { let del_row = selection.shift(); this.$refs.tbone.toggleRowSelection(del_row, false); //璁剧疆杩欎竴琛屽彇娑堥�変腑 } + this.pacList = selection; + this.dataLists = []; + this.queryParams.price = 0; + this.pacList.forEach((item) => { + this.OnenewpacName = item.tjProjectList; + }); + // this.dataLists.forEach((item2) => { + // this.OnenewpacName.push(item2); + // }); + this.OnenewpacName.forEach((item) => { + this.queryParams.price += item.proPrice; + }); }, beCurrentDept() { Deptlist(this.form.drugManufacturerId).then((response) => { @@ -1582,6 +1601,7 @@ /** 鎻愪氦鎸夐挳 */ submitForm() { + this.$refs["form"].validate((valid) => { if (valid) { if (this.form.drugManufacturerId != null) { @@ -1591,11 +1611,16 @@ this.getList(); }); } else { - addComp(this.form).then((response) => { + if(this.form.cnName && this.form.contactPerson && this.form.contactPhone){ + addComp(this.form).then((response) => { this.$modal.msgSuccess("鏂板鎴愬姛"); this.open = false; this.getList(); }); + }else{ + this.$modal.msgError("璇峰~鍐欏繀浼犻」"); + } + } } }); diff --git a/src/views/system/tijian/index.vue b/src/views/system/tijian/index.vue index da8a012..f84b262 100644 --- a/src/views/system/tijian/index.vue +++ b/src/views/system/tijian/index.vue @@ -2478,8 +2478,34 @@ "$1-$2-$3" ); } - _this.form.cusAddr = resultObj.data.addres; _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; }; @@ -2489,7 +2515,7 @@ }; } else { // if (_this.inputSSS.indexOf(":1") != -1) { - + // var str1 = _this.inputSSS.indexOf(":1"); // var result1 = _this.inputSSS.substring(0, str1); @@ -2501,7 +2527,7 @@ // _this.inputSSS = result1 + result2; // } - _this.inputSSS = _this.inputSSS.replace(":1",""); + _this.inputSSS = _this.inputSSS.replace(":1", ""); var websocket = null; var url = this.valueUrls; // var url = 'ws://'+ getIp() +':6789/websocket' @@ -2552,17 +2578,49 @@ websocket.onmessage = function (event) { var resultObj = JSON.parse(event.data); _this.form.cusName = resultObj.data.name; - _this.form.cusSex = resultObj.data.gender; - _this.form.cusNational = resultObj.data.nation; - // _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" - // ); - // } + + 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; }; diff --git a/src/views/system/tijianall/index.vue b/src/views/system/tijianall/index.vue index 00a73b2..0e68b0a 100644 --- a/src/views/system/tijianall/index.vue +++ b/src/views/system/tijianall/index.vue @@ -920,6 +920,32 @@ </el-row> <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> + + <el-dialog title="瀵兼鍗曢瑙�" :visible.sync="dialogVisibles" :close-on-click-modal="false" @@ -946,12 +972,14 @@ </span> </el-dialog> <historyTj :cusIdCard="form.cusIdcard" ref="historyTj"></historyTj> + <Packages ref="aaa" @add="handleChanges" /> </div> </template> <script> import printJS from "print-js"; import { getInfo } from "@/api/login"; +import Packages from "@/components/Packages"; import { getZhList, getlistByZhId } from "@/api/system/package"; import { deptTreeSelect, @@ -962,7 +990,7 @@ getTransitionList, getProParentIdDxList, getProSonDxList, - getaddTj, + getaddTj,getconfigKey, getHistryTjOrderProByCusIdCard, delTbBycusCardIdAndProId, } from "@/api/system/tijian"; @@ -971,7 +999,7 @@ export default { components: { VTreeTransfer, - historyTj, + historyTj,Packages }, dicts: [ "dict_user_national", @@ -1031,7 +1059,12 @@ tableDatas: [], packageList: [], checkedkeys: [], + valueUrl: "ws://127.0.0.1:18890", + valueUrls: "ws://127.0.0.1:6789/websocket", dialogVisiblese: false, + cardreader: false, + cardreaderradio:3, + inputSSS: "", lishi: false, table: false, HistoryList: {}, @@ -1590,30 +1623,377 @@ this.$message.error("姝ょ敤鎴蜂笉瀛樺湪"); }); } else { - var host = "ws://127.0.0.1:5001/YckjCard"; - if (this.socket == null) { - this.socket = new WebSocket(host); - if (this.socket != null) { - alert("杩炴帴鎴愬姛."); + let configKey = "getInfoFromSqlData"; + getconfigKey(configKey).then((res) => { + if (res.code == 200) { + if (res.msg == "N") { + var websocket = null; + var url = this.valueUrl; + if ("WebSocket" in window) { + websocket = new WebSocket(url); + } else if ("MozWebSocket" in window) { + websocket = new MozWebSocket(url); + } else { + // console.log("SockJS"); + } + + if (websocket == null) { + alert("鍒涘缓WebSocket瀵硅薄澶辫触"); + } + + //杩炴帴鍙戠敓閿欒鐨勫洖璋冩柟娉� + websocket.onerror = function () { + alert("璇锋鏌ヨ鍗″櫒杩炴帴鏄惁姝e父"); + }; + + //杩炴帴鎴愬姛寤虹珛鐨勫洖璋冩柟娉� + websocket.onopen = function () { + this.websocket = websocket; + // 杩炴帴璁惧 + var jsonObj = { + name: "connect", + }; + var jStr = JSON.stringify(jsonObj); + this.websocket.send(jStr); + alert("璇锋斁韬唤璇佸啀鐐圭‘璁�"); + var jsonObj = { + name: "readCert", + }; + var jStr = JSON.stringify(jsonObj); + this.websocket.send(jStr); + this.dialogVisible = false; + }; + + //鎺ユ敹鍒版秷鎭殑鍥炶皟鏂规硶 + websocket.onmessage = function (event) { + var resultObj = eval("(" + event.data + ")"); + //resultFlag涓�0浠h〃璇诲崱鎴愬姛 + 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("璁惧杩炴帴宸叉柇寮�锛岃妫�鏌ヨ鍗″櫒杩炴帴"); + } + } + } + }; + + //杩炴帴鍏抽棴鐨勫洖璋冩柟娉� + websocket.onclose = function () { + alert("璇诲崱鍣ㄨ繛鎺ュ叧闂�"); + }; + } else if (res.msg == "Y") { + 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; + // console.log(url); + // axios + // .get("http://localhost:81/dev-api/readCertCardInfos") + // .then((res) => { + // console.log(res); + // }) + // .catch((err) => { + // console.log(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; + // }); + } } - } else { - alert("璁惧宸叉墦寮�."); - } - try { - this.socket.onmessage = function (msg) { - // if (typeof msg.data == "string") { - // var msgM = msg.data + ""; - // resultMsg("璇诲崱杩斿洖淇℃伅锛�" + msg.data); - // } - // else { - // alert("杩炴帴寮傚父,璇锋鏌ラ┍鍔�."); - // } - }; - } catch (ex) { - alert("杩炴帴寮傚父,璇锋鏌ラ┍鍔�."); - } + }); } }, + + handleChanges(param1) { + if (this.form.pacCode == "涓嶈") { + this.form.cusIdcard = param1[0].xh; + } else { + this.form.cusIdcard = param1[0].pacCode; + } + + // this.form.cusName = param1[0].pacName; + // this.form.cusPhone = param1[0].pacRemark; + }, + + + 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 { + // console.log("SockJS"); + } + 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("璇锋鏌ヨ鍗″櫒杩炴帴鏄惁姝e父"); + }; + } 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 { + // console.log("SockJS"); + } + 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("璇锋鏌ヨ鍗″櫒杩炴帴鏄惁姝e父"); + }; + } + }, + // checkSelectable(row, index) { // if (!row) { @@ -1669,33 +2049,34 @@ } }); }, - Package() { this.taocan = true; - let cusSex = this.form.cusSex; this.activeNames = "first"; + let cusSex = this.form.cusSex; this.datekey = Date.now(); //鍏ㄩ儴濂楅 this.loading = true; deptTreeSelect(cusSex).then((response) => { this.newpacName = response.rows; try { - this.newpacName.forEach((item3) => { - this.tableData1.forEach((item4) => { - item4.list.forEach((item6) => { - if (item6.pacName === item3.pacName) { - this.$nextTick(() => { - this.$refs.tb.toggleRowSelection(item3, true); - }); - throw Error(); - } + if (this.tableData1.length >= 1) { + this.newpacName.forEach((item3) => { + this.tableData1.forEach((item4) => { + item4.list.forEach((item6) => { + if (item6.pacName === item3.pacName) { + this.$nextTick(() => { + this.$refs.tb.toggleRowSelection(item3, true); + }); + throw Error(); + } + }); }); }); - }); + } } catch (error) {} this.loading = false; }); - // this.getDataList(); + // this.getData(); }, // 鎶樻墸 @@ -1793,39 +2174,41 @@ 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.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; }); @@ -1869,27 +2252,27 @@ // }); // }); // } - 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.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; }); }, @@ -1932,7 +2315,6 @@ // this.DataLists.forEach((item1, index) => { // if (item.proId == item1.proId) { // this.DataLists.splice(index, 1); - // } // }); // }); @@ -2170,6 +2552,9 @@ this.tableData1.forEach((item) => { this.TotalPrice1 += item.nowPrice; this.TotalPrice = this.TotalPrice1 + ".00"; + if (item.tjCategory != null) { + this.form.category = item.tjCategory; + } if (item.pacName === null) { item.pacName = "鍗曢」"; } @@ -2185,6 +2570,8 @@ } }); this.taocan = false; + this.defaultKeys = []; + this.DataLists = []; }, // 鏈�鍚庢彁浜ゆ寜閽� -- Gitblit v1.8.0