index.js 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. var template = ''
  2. $.ajax('../../../component/statistics/LascCervicalPreliminaryScreenEntity/index.html', {
  3. data: {},
  4. dataType: 'html',
  5. cache: false,
  6. timeout: 60000,
  7. async: false,
  8. error: function (res) {},
  9. success: function (res) {
  10. template = res
  11. }
  12. })
  13. Vue.component('lasc-cervical-preliminary-screen-entity', {
  14. template: template,
  15. props: ['data'],
  16. data: function () {
  17. return {
  18. readonlyTwo: 1,
  19. readonly: true,
  20. isShowPicker: false,
  21. columns: [],
  22. pickType: '',
  23. curItem: '',
  24. isShowDatePicker: false,
  25. activeDateField: '',
  26. date: '',
  27. minDate: moment().add(-100, 'year').toDate(),
  28. form: {
  29. screenId: '', //两癌筛查id
  30. preliminaryScreenResults: '', //
  31. preliminaryScreenOrg: docInfo.hospitalName, //检查机构
  32. preliminaryScreenUser: docInfo.name, //检查人员
  33. preliminaryScreenTime: '' //检查时间
  34. }
  35. }
  36. },
  37. methods: {},
  38. watch:{
  39. data:{
  40. handler(newVal,oldVal){
  41. var vm = this
  42. if (this.readonly && !this.form.preliminaryScreenOrg) {
  43. this.form = {
  44. screenId: '', //两癌筛查id
  45. preliminaryScreenResults: '', //
  46. preliminaryScreenOrg: '', //检查机构
  47. preliminaryScreenUser: '', //检查人员
  48. preliminaryScreenTime: '' //检查时间
  49. }
  50. } else {
  51. this.form = _.assign(this.form, this.data.value[0])
  52. this.form.screenId = this.data.value[0] && this.data.value[0].screenId
  53. }
  54. httpRequest
  55. .get('doctor/twoCancers/getPreliminaryScreenResults', {
  56. data: {
  57. screenId: this.form.screenId
  58. }
  59. })
  60. .then(function (ress) {
  61. vm.form.preliminaryScreenResults = ress.data || '1'
  62. })
  63. },
  64. deep:true
  65. }
  66. },
  67. mounted() {
  68. var vm = this
  69. if (this.readonly && !this.form.preliminaryScreenOrg) {
  70. this.form = {
  71. screenId: '', //两癌筛查id
  72. preliminaryScreenResults: '', //
  73. preliminaryScreenOrg: '', //检查机构
  74. preliminaryScreenUser: '', //检查人员
  75. preliminaryScreenTime: '' //检查时间
  76. }
  77. } else {
  78. this.form = _.assign(this.form, this.data.value[0])
  79. this.form.screenId = this.data.value[0] && this.data.value[0].screenId
  80. }
  81. httpRequest
  82. .get('doctor/twoCancers/getPreliminaryScreenResults', {
  83. data: {
  84. screenId: this.form.screenId
  85. }
  86. })
  87. .then(function (ress) {
  88. vm.form.preliminaryScreenResults = ress.data || '1'
  89. })
  90. }
  91. })