From 5017033ae6120a4fbf9d60f5c0e4c963799c0e54 Mon Sep 17 00:00:00 2001 From: wwl <xchao828@163.com> Date: 星期二, 15 七月 2025 13:40:33 +0800 Subject: [PATCH] 1 --- src/views/system/tijian/index.vue | 288 +++++++++++------------ public/yuanqu.ini | 29 ++ src/views/login copy.vue | 392 ++++++++++++++++++++++++++++++++ 3 files changed, 564 insertions(+), 145 deletions(-) diff --git a/public/yuanqu.ini b/public/yuanqu.ini new file mode 100644 index 0000000..63f25b6 --- /dev/null +++ b/public/yuanqu.ini @@ -0,0 +1,29 @@ +[development] +8094=pbkwyy +81=jdczgzyy +8095=jdczgzyy +8096=sqyy +8097=wbzxyy +8098=bjxjyy +8099=bjfhyy +8100=ssyjyy +8101=bjsqyy + +[staging] +9013=pbkwyy +9014=jdczgzyy +9015=sqyy +9016=wbzxyy +9017=bjxjyy +9018=ssyjyy +9019=bjsqyy + +[production] +8094=pbkwyy +8095=jdczgzyy +8096=sqyy +8097=wbzxyy +8098=bjxjyy +8099=bjfhyy +8100=ssyjyy +8101=bjsqyy \ No newline at end of file diff --git a/src/views/login copy.vue b/src/views/login copy.vue new file mode 100644 index 0000000..bf40696 --- /dev/null +++ b/src/views/login copy.vue @@ -0,0 +1,392 @@ +<template> + <div class="login"> + <!-- <div style="padding-top: 130px;"> --> + <div style="font-weight: 700;font-size: 50px;">鏅鸿兘鍋ュ悍浣撴绠$悊绯荤粺</div> + <!-- </div> --> + + + <el-form :inline="true" ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form"> + <div class="img"> + <img class="image" src="../assets/images/ewm.png" alt="" /> + </div> + <div class="card"> + <!-- <h3 class="title">璺嘲绉戞妧鍚庡彴绠$悊绯荤粺</h3> --> + <el-form-item> + <el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="璐﹀彿/鎵嬫満鍙风爜/浣撴鍙�" + @keyup.enter.native="jumpInput"> + <svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" @click="hide" + @keyup.enter.native="jumpInput" /> + </el-input> + </el-form-item> + <el-form-item> + <el-input v-model="loginForm.password" :type="type" auto-complete="off" placeholder="瀵嗙爜" ref="barcodeMsg" + @keyup.enter.native="handleLogin"> + <svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" /> + <i slot="suffix" class="icon-style" :class="elIcon" autocomplete="auto" @click="flag = !flag" /></el-input> + <!-- <img :src="openeye" class="show_hid" @click="changetype" > --> + </el-form-item> + <el-form-item prop="code" v-if="captchaEnabled"> + <el-input v-model="loginForm.code" auto-complete="off" placeholder="楠岃瘉鐮�" style="width: 63%" + @keyup.enter.native="handleLogin"> + <svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" /> + </el-input> + <div class="login-code"> + <img :src="codeUrl" @click="getCode" class="login-code-img" /> + </div> + </el-form-item> + <el-checkbox v-model="loginForm.rememberMe" style="margin:10px 0px 40px 0px;">璁颁綇瀵嗙爜</el-checkbox> + <!-- <el-form-item style="margin-left:10px" prop="mobile"> + <el-radio-group v-model="loginForm.mobile"> + <el-radio :label="true">鍛樺伐鐧诲綍</el-radio> + <el-radio :label="false">鐢ㄦ埛鐧诲綍</el-radio> + </el-radio-group> + </el-form-item> --> + <el-form-item style="width:100%;"> + <el-button :loading="loading" size="medium" type="primary" style="width:310px;" @keyup.enter="keyDown(e)" + @click.native.prevent="handleLogin"> + <span v-if="!loading">鐧� 褰�</span> + <span v-else>鐧� 褰� 涓�...</span> + </el-button> + <div style="float: right;" v-if="register"> + <router-link class="link-type" :to="'/register'">绔嬪嵆娉ㄥ唽</router-link> + </div> + </el-form-item> + </div> + + </el-form> + + + <!-- 搴曢儴 --> + <div class="el-login-footer"> + <span>Copyright 漏 2024-2025 All Rights Reserved.</span> + <!-- <span>Copyright 漏 2022-2023榫欑編缃戠粶 All Rights Reserved.</span> --> + </div> + </div> +</template> + +<script> + +import { getCodeImg, getconfigKey } from "@/api/login"; +import Cookies from "js-cookie"; +import { encrypt, decrypt } from '@/utils/jsencrypt' +import ini from 'ini'; +import fs from 'fs'; // Node.js 鏂囦欢绯荤粺妯″潡 +export default { + name: "Login", + data() { + return { + codeUrl: "", + loginForm: { + username: "", + password: "", + mobile: false, + hospId: "", + // username:"13800138008", + // password:"888888", + rememberMe: false, + code: "", + uuid: "", + // type: false, + }, + loginRules: { + username: [ + { required: true, trigger: "blur", message: "" } + ], + password: [ + { required: true, trigger: "blur", message: "" } + ], + code: [{ required: true, trigger: "change", message: "" }], + mobile: [ + { required: true, trigger: "change", message: "" } + ] + }, + pwdtype: 'password', + openeye: require('../assets/images/by.png'), + flag: false, + loading: false, + configKey: "captcha_switch", + // // 楠岃瘉鐮佸紑鍏� + captchaEnabled: true, + // 娉ㄥ唽寮�鍏� + register: false, + redirect: undefined + }; + }, + computed: { + type() { + return this.flag ? "text" : "password"; + }, + elIcon() { + return this.flag ? "el-icon-minus" : "el-icon-view"; + } + }, + mounted() { + // 缁戝畾鐩戝惉浜嬩欢 + window.addEventListener("keydown", this.keyDown); + }, + destroyed() { + // 閿�姣佷簨浠� + window.removeEventListener("keydown", this.keyDown, false); + }, + watch: { + $route: { + handler: function (route) { + this.redirect = route.query && route.query.redirect; + }, + immediate: true + } + }, + created() { + this.getstate(); + this.getCookie(); + this.loadAll(); + }, + methods: { + getstate() { + getconfigKey().then(res => { + if (res.msg == "Y") { + this.captchaEnabled = true + this.getCode(); + } else if (res.msg == "N") { + this.captchaEnabled = false + } + }) + + }, + loadAll() { + const env = process.env.VUE_APP_ENV; + const port = window.location.port; + + // yuanqu.ini鍔犺浇hospId + fetch('/yuanqu.ini') + .then(response => { + if (!response.ok) { + throw new Error('Failed to fetch config.ini'); + } + return response.text(); + }) + .then(text => { + const config = ini.parse(text); + + if (config[env] && config[env][port]) { + this.loginForm.hospId = config[env][port]; + Cookies.set("hospId", this.loginForm.hospId); + } else { + console.error(`No hospId found for environment ${env} and port ${port}`); + this.$message.error(`閰嶇疆閿欒锛氭湭鎵惧埌鐜 ${env} 鍜岀鍙� ${port} 瀵瑰簲鐨勫尰闄D`); + } + }) + .catch(error => { + console.error('Error fetching or parsing config.ini:', error); + this.$message.error('鏃犳硶鍔犺浇閰嶇疆鏂囦欢锛岃鑱旂郴绠$悊鍛�'); + }); + }, + hide() { + // this.loginForm.username = "10001"; + // this.loginForm.password = "admin123"; + }, + changetype() { + this.pwdtype = this.pwdtype === 'password' ? 'text' : 'password' + this.openeye = this.openeye === require('../assets/images/by.png') ? require('../assets/images/zy.png') : require('../assets/images/by.png') + }, + getCode() { + getCodeImg().then(res => { + this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled; + if (this.captchaEnabled) { + this.codeUrl = "data:image/gif;base64," + res.img; + this.loginForm.uuid = res.uuid; + } + }); + }, + getCookie() { + const username = Cookies.get("username"); + const password = Cookies.get("password"); + const rememberMe = Cookies.get('rememberMe') + this.loginForm = { + username: username === undefined ? this.loginForm.username : username, + password: password === undefined ? this.loginForm.password : decrypt(password), + rememberMe: rememberMe === undefined ? false : Boolean(rememberMe), + }; + }, + jumpInput() { + if (this.loginForm.password) { + this.handleLogin(); // 瀹氫箟鐨勭櫥褰曟柟娉� + } else { + this.$refs.barcodeMsg.focus(); // 鑷姩鑾峰彇鐒︾偣 + } + }, + handleLogin() { + if (this.loginForm.username.length < 12) { + this.loginForm.mobile = true; + this.$router.push({ path: this.redirect || "/" }).catch(() => { }); + } else { + this.$router.push({ path: this.redirect || "/404" }).catch(() => { }); + this.loginForm.mobile = false; + } + + this.$refs.loginForm.validate(valid => { + if (valid) { + this.loading = true; + if (this.loginForm.rememberMe) { + Cookies.set("username", this.loginForm.username, { expires: 30 }); + Cookies.set("password", encrypt(this.loginForm.password), { expires: 30 }); + Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 }); + } else { + Cookies.remove("username"); + Cookies.remove("password"); + Cookies.remove('rememberMe'); + } + + this.$store.dispatch("Login", this.loginForm).then((res) => { + if (res.msg == "璇ヨ处鍙锋鍦ㄤ娇鐢ㄤ腑") { + this.$confirm('璇ヨ处鍙锋鍦ㄤ娇鐢ㄤ腑,鏄惁寮哄埗鐧婚檰?', '娓╅Θ鎻愮ず', { + confirmButtonText: '纭畾', + cancelButtonText: '鍙栨秷', + type: 'warning' + }).then(() => { + this.loginForm.type = true + this.$store.dispatch("Login", this.loginForm).then((res) => { + this.$router.push({ path: this.redirect || "/" }).catch(() => { }); + }) + }).catch(() => { + this.loading = false; + + }); + } else { + const securitMessage = JSON.parse(localStorage.getItem("securitMessage")); + if (securitMessage) { + if (securitMessage != null) { + this.$message({ + message: securitMessage, + type: 'success' + }); + localStorage.removeItem("securitMessage"); + } + } + this.$router.push({ path: this.redirect || "/" }).catch(() => { }); + location.reload(); + } + + }).catch(() => { + this.loading = false; + if (this.captchaEnabled) { + this.getCode(); + } + }); + + } + }); + } + } +}; +</script> + +<style rel="stylesheet/scss" lang="scss"> +.login { + display: flex; + justify-content: flex-start; + align-items: center; + width: 100%; + height: 100%; + // background-image: url("../assets/images/login-background.jpg"); + background-size: cover; + flex-direction: column; + margin-top: 170px; +} + +.card { + width: 519px; + padding-left: 100px; + border-left: 1px solid #ededed; + display: flex; + flex-direction: column; + // margin-left: 100px; +} + +.show_hid { + width: 25px; + height: 25px; +} + +.img { + width: 506px; + height: 200px; + display: flex; + align-items: center; + justify-content: flex-end; + +} + +.image { + width: 200px; + height: 200px; +} + +.title { + margin: 0px auto 30px auto; + text-align: center; + color: #707070; +} + +.login-form { + border-radius: 6px; + background: #ffffff; + width: 90%; + padding: 25px 25px 5px 25px; + // margin-left: 800px; + margin-top: 100px; + display: flex; + justify-content: space-around; + // justify-content: space-evenly; + + .el-input { + height: 38px; + + input { + width: 300px; + height: 38px; + } + } + + .input-icon { + height: 39px; + width: 14px; + margin-left: 2px; + } +} + +.login-tip { + font-size: 13px; + text-align: center; + color: #bfbfbf; +} + +.login-code { + width: 33%; + height: 38px; + margin-top: 5px; + // float: right; + + img { + cursor: pointer; + vertical-align: middle; + } +} + +.el-login-footer { + height: 40px; + line-height: 40px; + position: fixed; + bottom: 0; + width: 100%; + text-align: center; + color: black; + font-family: Arial; + font-size: 12px; + letter-spacing: 1px; +} + +.login-code-img { + height: 38px; +} +</style> diff --git a/src/views/system/tijian/index.vue b/src/views/system/tijian/index.vue index 51025ed..a0d7bad 100644 --- a/src/views/system/tijian/index.vue +++ b/src/views/system/tijian/index.vue @@ -427,7 +427,7 @@ <el-form-item label="濮撳悕" prop="pacName"> <el-input v-model="queryParam.pacName" placeholder="璇疯緭鍏ュ鍚�" clearable @keyup.enter.native="handle" /> </el-form-item> - <el-form-item label="韬唤璇�" prop="pacName"> + <el-form-item label="韬唤璇�" prop="pacName"> <el-input v-model="queryParam.pacName" placeholder="璇疯緭鍏ヨ韩浠借瘉" clearable @keyup.enter.native="handle" /> </el-form-item> <el-form-item> @@ -952,7 +952,7 @@ // 鏄剧ず鎼滅储鏉′欢 showSearch: true, tjtype: false, - sftj:null, + sftj: null, activeNames: "first", // 鏍戠姸褰㈢姸 Treedata: [], @@ -984,12 +984,10 @@ pacName: null, pacRemark: 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", + // valueUrl: "ws://127.0.0.1:6789/websocket", + // valueUrls: "ws://127.0.0.1:6789/websocket", + valueUrl: "ws://192.168.1.244:6789/websocket", + valueUrls: "ws://192.168.1.244:6789/websocket", webSocket: null, // 韬唤璇侀渶瑕� // socket: null, @@ -1742,57 +1740,57 @@ }, /** 鐧昏鎻愪氦鎸夐挳 */ /** 鐧昏鎻愪氦鎸夐挳 */ - submitForm() { - let _this = this; - if (!this.form.cusPhone || !this.form.cusName) { - this.$message.warning("璇峰~閫夊繀濉」"); - return; - } - - this.$refs["form"].validate((valid) => { - if (valid) { - // 鍒涘缓琛ㄥ崟鏁版嵁鐨勫壇鏈苟鍘婚櫎绌烘牸 - const formData = { ...this.form }; - formData.cusName = formData.cusName ? formData.cusName.replace(/\s/g, '') : ''; - formData.cusPhone = formData.cusPhone ? formData.cusPhone.replace(/\s/g, '') : ''; - formData.cusIdcard = formData.cusIdcard ? formData.cusIdcard.replace(/\s/g, '') : ''; - // 娣诲姞 sfzImg 瀛楁 - formData.sfzImg = this.imageUrl || ''; // 浣跨敤 base64 鏍煎紡鐨勫ご鍍忔暟鎹紝鑻ヤ负绌哄垯浼犵┖瀛楃涓� - - // 澶勭悊鎬у埆鍊� - if (formData.cusSex === "濂�") { - formData.cusSex = 1; - } - if (formData.cusSex === "鐢�") { - formData.cusSex = 0; - } - if (formData.cusSex === "鏈煡") { - formData.cusSex = 2; - } - if (formData.tjType === "") { - formData.tjType = this.dict.type.dict_team[0].value; + submitForm() { + let _this = this; + if (!this.form.cusPhone || !this.form.cusName) { + this.$message.warning("璇峰~閫夊繀濉」"); + return; } - // 鍙�夛細妫�鏌� sfzImg 鏄惁瀛樺湪 - // if (!formData.sfzImg) { - // this.$message.warning("璇峰厛鑾峰彇韬唤璇佸ご鍍�"); - // return; - // } + this.$refs["form"].validate((valid) => { + if (valid) { + // 鍒涘缓琛ㄥ崟鏁版嵁鐨勫壇鏈苟鍘婚櫎绌烘牸 + const formData = { ...this.form }; + formData.cusName = formData.cusName ? formData.cusName.replace(/\s/g, '') : ''; + formData.cusPhone = formData.cusPhone ? formData.cusPhone.replace(/\s/g, '') : ''; + formData.cusIdcard = formData.cusIdcard ? formData.cusIdcard.replace(/\s/g, '') : ''; + // 娣诲姞 sfzImg 瀛楁 + formData.sfzImg = this.imageUrl || ''; // 浣跨敤 base64 鏍煎紡鐨勫ご鍍忔暟鎹紝鑻ヤ负绌哄垯浼犵┖瀛楃涓� - addCustomer(formData).then((response) => { - this.responseList = response.data; - this.form.tjType = this.dict.type.dict_team[0].value; - this.$modal.msgSuccess("鏂板鎴愬姛"); - _this.tcShow = true; - _this.isDisabled = true; - _this.top = false; - }).catch((error) => { - this.$modal.msgError("鐧昏澶辫触锛岃妫�鏌ユ暟鎹�"); - console.error("Error in addCustomer:", error); + // 澶勭悊鎬у埆鍊� + if (formData.cusSex === "濂�") { + formData.cusSex = 1; + } + if (formData.cusSex === "鐢�") { + formData.cusSex = 0; + } + if (formData.cusSex === "鏈煡") { + formData.cusSex = 2; + } + if (formData.tjType === "") { + formData.tjType = this.dict.type.dict_team[0].value; + } + + // 鍙�夛細妫�鏌� sfzImg 鏄惁瀛樺湪 + // if (!formData.sfzImg) { + // this.$message.warning("璇峰厛鑾峰彇韬唤璇佸ご鍍�"); + // return; + // } + + addCustomer(formData).then((response) => { + this.responseList = response.data; + this.form.tjType = this.dict.type.dict_team[0].value; + this.$modal.msgSuccess("鏂板鎴愬姛"); + _this.tcShow = true; + _this.isDisabled = true; + _this.top = false; + }).catch((error) => { + this.$modal.msgError("鐧昏澶辫触锛岃妫�鏌ユ暟鎹�"); + console.error("Error in addCustomer:", error); + }); + } }); - } - }); -}, + }, getmailType() { if (this.getType == "2") { @@ -2978,7 +2976,7 @@ // 澶勭悊璁㈠崟椤圭洰 processOrderItems(cusId) { getTransitionList1(cusId).then((response) => { - this.tableData1 = response.data; + this.tableData1 = response.data; // if (response.data.tjCategory != null) { // this.tjCategory = response.data.tjCategory; // } @@ -3288,100 +3286,100 @@ }, // 鏈�鍚庢彁浜ゆ寜閽� - submitPrice() { - let _this = this; - this.loadingSubmit = true; - if (_this.tjCategory !== "") { - let List = _this.tableData1; // 鍗曚釜椤圭洰淇℃伅 - if (this.responseList.cusId) { - var userId = this.responseList.cusId; - } else { - var userId = _this.form.cusId; - } - let tjType = _this.form.tjType; - if (this.tableData[0]) { - var pacId = this.tableData[0].pacId; - } - - // tjOrderList 澶勭悊 - List.forEach((item) => { - if (item.list) { - item.list.forEach((item1) => { - this.tjOrderList.push({ - proName: item1.proName, - proPrice: item1.nowPrice, - proId: item1.proId, - }); - }); - } else if (item.tjProjectList) { - item.tjProjectList.forEach((item1) => { - this.tjOrderList.push({ - proName: item1.proName, - proPrice: item1.priceNow, - proId: item1.proId, - }); - }); - } else { - this.tjOrderList.push({ - proName: item.proName, - proPrice: item.ysPrice, - proId: item.proId, - }); - } - }); - - let copeWith = this.TotalPrice1; - let paidIn = this.TotalPrice.toString(); - let discount = this.discount; - this.tjFlowingWater = { copeWith, paidIn, discount }; - - const newArray = this.tableData1 - .filter((item) => item.discount < 10) - .map((item) => ({ - discount: item.discount, - parentProId: item.parentProId, - cusIdCard: item.cusId, - yhj: item.nowPrice, - })); - - gaibianzhekou(newArray).then((res) => { - this.loadingSubmit = false; - if (res.code === 200) { - let data; - - if (pacId || this.tjOrderList.length > 0) { - data = { - photo: this.srcUrl, // 淇濈暀鍘熸湁 photo 瀛楁锛堝鏋滃悗绔粛闇�瑕侊級 - sfzImg: this.imageUrl, // 娣诲姞 sfzImg 瀛楁锛屼紭鍏堜娇鐢ㄦ湇鍔″櫒URL锛岃嫢鏃犲垯浣跨敤base64 - pacId, - tjOrderList: this.tjOrderList, - tjFlowingWater: this.tjFlowingWater, - userId, - tjType, - tjCategory: this.tjCategory, - firmId: this.form.firmId, - firmName: this.form.firmName, - firmDeptName: this.form.firmDeptName, - }; - - this.listgetOrder(data); + submitPrice() { + let _this = this; + this.loadingSubmit = true; + if (_this.tjCategory !== "") { + let List = _this.tableData1; // 鍗曚釜椤圭洰淇℃伅 + if (this.responseList.cusId) { + var userId = this.responseList.cusId; } else { - this.loadingSubmit = false; - this.$message({ - type: "warning", - message: "璇烽�夋嫨濂楅!", - }); + var userId = _this.form.cusId; } + let tjType = _this.form.tjType; + if (this.tableData[0]) { + var pacId = this.tableData[0].pacId; + } + + // tjOrderList 澶勭悊 + List.forEach((item) => { + if (item.list) { + item.list.forEach((item1) => { + this.tjOrderList.push({ + proName: item1.proName, + proPrice: item1.nowPrice, + proId: item1.proId, + }); + }); + } else if (item.tjProjectList) { + item.tjProjectList.forEach((item1) => { + this.tjOrderList.push({ + proName: item1.proName, + proPrice: item1.priceNow, + proId: item1.proId, + }); + }); + } else { + this.tjOrderList.push({ + proName: item.proName, + proPrice: item.ysPrice, + proId: item.proId, + }); + } + }); + + let copeWith = this.TotalPrice1; + let paidIn = this.TotalPrice.toString(); + let discount = this.discount; + this.tjFlowingWater = { copeWith, paidIn, discount }; + + const newArray = this.tableData1 + .filter((item) => item.discount < 10) + .map((item) => ({ + discount: item.discount, + parentProId: item.parentProId, + cusIdCard: item.cusId, + yhj: item.nowPrice, + })); + + gaibianzhekou(newArray).then((res) => { + this.loadingSubmit = false; + if (res.code === 200) { + let data; + + if (pacId || this.tjOrderList.length > 0) { + data = { + photo: this.srcUrl, // 淇濈暀鍘熸湁 photo 瀛楁锛堝鏋滃悗绔粛闇�瑕侊級 + sfzImg: this.imageUrl, // 娣诲姞 sfzImg 瀛楁锛屼紭鍏堜娇鐢ㄦ湇鍔″櫒URL锛岃嫢鏃犲垯浣跨敤base64 + pacId, + tjOrderList: this.tjOrderList, + tjFlowingWater: this.tjFlowingWater, + userId, + tjType, + tjCategory: this.tjCategory, + firmId: this.form.firmId, + firmName: this.form.firmName, + firmDeptName: this.form.firmDeptName, + }; + + this.listgetOrder(data); + } else { + this.loadingSubmit = false; + this.$message({ + type: "warning", + message: "璇烽�夋嫨濂楅!", + }); + } + } else { + this.loadingSubmit = false; + this.$modal.msgError("鏀瑰彉鎶樻墸閿欒"); + } + }); } else { this.loadingSubmit = false; - this.$modal.msgError("鏀瑰彉鎶樻墸閿欒"); + this.$modal.msgError("璇烽�夋嫨浣撴绫诲埆"); } - }); - } else { - this.loadingSubmit = false; - this.$modal.msgError("璇烽�夋嫨浣撴绫诲埆"); - } -}, + }, }, }; </script> -- Gitblit v1.8.0