Browse Source

sample

master
pengjun 2 years ago
parent
commit
3db1eb6f03
  1. 3
      src/components/customerOrg/customerOrgGroupAsbitem.vue
  2. 16
      src/components/patientRegister/PatientRegisterEdit.vue
  3. 1
      src/main.js
  4. 31
      src/utlis/getKeyDown.js
  5. 2
      src/utlis/istoken.js
  6. 10
      src/views/charge/charge.vue
  7. 1112
      src/views/common-settings/SampleGroup.vue
  8. 89
      src/views/login/Login.vue

3
src/components/customerOrg/customerOrgGroupAsbitem.vue

@ -296,8 +296,7 @@ export default {
selecteddata: [], //
unselecteddata: [], //
unselecteddata: [], //
unselecteddata: [], //
rightselctedata: [], //
options: [],
value: "",

16
src/components/patientRegister/PatientRegisterEdit.vue

@ -44,7 +44,7 @@
<el-row>
<el-col :span="5">
<el-form-item label="姓名" prop="patientName">
<el-input class="enterToTab" v-model="form.patientName" @change="Query(form.patientName)" size="small" autocomplete="off"></el-input>
<el-input id="patientName" class="enterToTab" v-model="form.patientName" @change="Query(form.patientName)" size="small" autocomplete="off"></el-input>
</el-form-item>
</el-col>
<el-col :span="5">
@ -54,9 +54,13 @@
</el-col>
<el-col :span="5">
<el-form-item label="出生日期" prop="birthDate">
<el-date-picker class="enterToTab" v-model="form.birthDate" type="date" value-format="yyyy-MM-dd" placeholder="出生日期"
<!--
<input type="date" class="enterToTab" v-model="form.birthDate" size="small"
:style="'border-radius: 4px;border: 1px solid #DCDFE6;height: 32px;line-height: 32px;padding-left: 2px;width:' + Math.floor((window.pageWidth - 510) / 4.8) + 'px;'"/>
-->
<el-date-picker class="enterToTab" v-model="form.birthDate" type="date" format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="出生日期"
:style="'width:' + Math.floor((window.pageWidth - 510) / 4.8) + 'px;'" @change="changeBirthDate"
prefix-icon="" size="small"/>
prefix-icon="" size="small"/>
</el-form-item>
</el-col>
<el-col :span="3">
@ -325,7 +329,7 @@
<PatientRegisterItem :patientRegisterForm="form" :payTypeFlag="payTypeFlag" />
</div>
</div>
<div style="margin-left: 10px;">
<div style="margin-left: 10px;">
<div>
<el-button type="primary" class="btnClass" @click="photoGrah" icon="el-icon-camera">拍照</el-button>
</div>
@ -351,7 +355,7 @@
<el-button type="primary" class="btnClass" @click="guidePrint('0001', false)">指引单打印</el-button>
</div>
<div class="btn">
<el-button type="primary" class="btnClass" @click="guidePrint('0001', false)">指引单预览</el-button>
<el-button type="primary" class="btnClass" @click="guidePrint('0001', true)">指引单预览</el-button>
</div>
<div class="btn">
<el-button type="danger" class="btnClass" @click="reMergeAsbitem">手动合并项目</el-button>
@ -765,7 +769,7 @@ export default {
methods: {
...mapActions(['getPatientRegisterAbs']),
dddw,moment,
//form
initFormData(){
objCopy(this.formInitData, this.form);

1
src/main.js

@ -115,6 +115,7 @@ window.addEventListener('keydown', code => {
if (code.key == "Control" && code.ctrlKey) {
store.commit('setData', { key: 'window.ctrl', value: true });// 标记按住了ctrl键
}
});
// 监听keyup:获取键盘松开事件,code返回按住的键信息

31
src/utlis/getKeyDown.js

@ -8,6 +8,24 @@
}
*/
const enterToTab = new KeyboardEvent('keydown', {
keyCode: 9, // A键的键码
code: 'Tab', // A键的标准编码
key: 'Tab', // A键的字符
which: 13,
bubbles: true,
location: 0, // 键盘位置,0为主键盘
repeat: false, // 是否重复按下
ctrlKey: false, // 是否按下Ctrl键
altKey: false, // 是否按下Alt键
shiftKey: false, // 是否按下Shift键
metaKey: false // 是否按下Meta键
});
//document.dispatchEvent(enterToTab);
export function getKeyDown(className) {
//当前页面监视键盘输入 onkeyup /onkeydown
document.onkeydown = function (e) {
@ -19,12 +37,19 @@ export function getKeyDown(className) {
// }else{
// e.preventDefault(); // 阻止默认行为
// }
console.log('document.onkeydown',e)
// 标记当前组件为true
if(e.target.tagName === 'INPUT'){
e.target.autofocus = true;
e.preventDefault(); // 阻止默认行为
e.preventDefault(); // 阻止默认行为
//document.dispatchEvent(enterToTab);
//$.event.trigger({ type: 'keydown', which: 13 });
}
// else if(e.target.tagName === 'TEXTAREA'){
// e.target.autofocus = true;

2
src/utlis/istoken.js

@ -12,7 +12,7 @@ export const yztoken = async () => {
console.log("dqtime / expires_in",dqtime,expires_in)
if(!expires_in){
router.push({ path: "/Login" });
router.push({ path: "/login" });
return;
}

10
src/views/charge/charge.vue

@ -417,10 +417,14 @@ export default {
// this.query.patientRegisterNo = this.patientList[0].patientRegisterNo;
// this.query.patientName = this.patientList[0].patientName;
// this.query.patientNo = this.patientList[0].patientNo;
this.rowClick(this.patientList[0])
setTimeout(() => {
this.$nextTick(() =>{
this.$refs['patientList'].setCurrentRow(this.patientList[0])
}, 200)
this.rowClick(this.patientList[0])
})
// this.rowClick(this.patientList[0])
// setTimeout(() => {
// this.$refs['patientList'].setCurrentRow(this.patientList[0])
// }, 200)
}
}
loading.close();

1112
src/views/common-settings/SampleGroup.vue
File diff suppressed because it is too large
View File

89
src/views/login/Login.vue

@ -40,8 +40,10 @@
<script>
import { lognis } from "@/request/ruquset";
import { yzstr } from "@/utlis/validate.js";
import { yztoken, writetoken } from "@/utlis/istoken";
import { writetoken } from "@/utlis/istoken";
import mm from "@/utlis/mm";
import axios from "axios";
import { getapi, postapi } from "@/api/api";
export default {
@ -54,52 +56,75 @@ export default {
rules: {
Username: [
{ required: true, message: "请输入用户名", trigger: "blur" },
{ min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" },
//{ min: 3, max: 5, message: " 3 5 ", trigger: "blur" },
],
Password: [
{ required: true, message: "请输入密码", trigger: "blur" },
{ min: 3, max: 8, message: "长度在 3 到 8 个字符", trigger: "blur" },
//{ min: 3, max: 8, message: " 3 8 ", trigger: "blur" },
],
},
};
},
mounted(){
//
if(this.$peisAPI){
this.$peisAPI.lazyLoad();
}
},
methods: {
onSubmit() {
//
if(this.$peisAPI){
this.$peisAPI.lazyLoad();
}
onSubmit() {
this.$refs.form.validate((valid) => {
if (valid) {
var msgs = "";
postapi(`/api/identity/users/login`, {
if (valid) {
axios.post(`${mm.apiurl}/api/identity/users/login`,{
userName: this.form.Username,
passWord: this.form.Password,
})
.then((res) => {
console.log(`/api/identity/users/login`,res)
msgs = res.data.msg;
if (res.code != -1) {
window.sessionStorage.setItem("peisid", res.data.peisid); //
writetoken(res.data.expires_in);
window.sessionStorage.setItem("token", res.data.access_token);
window.sessionStorage.setItem("refresh_token",res.data.refresh_token);
window.sessionStorage.setItem("tokentype", res.data.token_type);
window.sessionStorage.setItem("user", this.form.Username);
}).then(ret =>{
console.log(`/api/identity/users/login`,ret)
let res = ret.data
if (res.code != -1) {
this.$router.push({ path: "/home" });
this.$store.state.changepassword = this.form.Password;
window.sessionStorage.setItem("peisid", res.data.peisid); //
writetoken(res.data.expires_in);
window.sessionStorage.setItem("token", res.data.access_token);
window.sessionStorage.setItem("refresh_token",res.data.refresh_token);
window.sessionStorage.setItem("tokentype", res.data.token_type);
window.sessionStorage.setItem("user", this.form.Username);
this.$router.push({ path: "/home" });
this.$store.state.changepassword = this.form.Password;
} else {
this.$message.warning(res.message);
}
}).catch(err =>{
this.$message.error(err);
})
} else {
this.$message.warning(res.data.msg);
}
// postapi(`/api/identity/users/login`, {
// userName: this.form.Username,
// passWord: this.form.Password,
// })
// .then((res) => {
// console.log(`/api/identity/users/login`,res)
// if (res.code != -1 && res.data.code != -1) {
// window.sessionStorage.setItem("peisid", res.data.peisid); //
// writetoken(res.data.expires_in);
// window.sessionStorage.setItem("token", res.data.access_token);
// window.sessionStorage.setItem("refresh_token",res.data.refresh_token);
// window.sessionStorage.setItem("tokentype", res.data.token_type);
// window.sessionStorage.setItem("user", this.form.Username);
console.log(res, "res");
})
// this.$router.push({ path: "/home" });
// this.$store.state.changepassword = this.form.Password;
.catch((err) => {});
// } else {
// msgs = res.code != -1 ? res.data.msg:res.message;
// this.$message.warning(res.data.msg);
// }
// //console.log(res, "res");
// })
// .catch((err) => {});
}
});
},
@ -130,7 +155,7 @@ export default {
::v-deep .el-input__inner {
background-color: rgb(234, 253, 234);
opacity: 1;
color: rgba(186, 251, 185, 1);
// color: rgba(186, 251, 185, 1);
}
// ::v-deep .el-form-item {
// border: 1px solid rgb(0, 183, 92);

Loading…
Cancel
Save