index.js 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. var template = ''
  2. $.ajax('../../../component/statistics/LascModifyPatient/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-modify-patient', {
  14. template: template,
  15. name: 'lasc-modify-patient',
  16. props: {
  17. currentInfo: {}
  18. },
  19. data: function () {
  20. return {
  21. form: {
  22. baseinfo:{
  23. sickName: '',
  24. age: '',
  25. nation: '',
  26. nationName: '',
  27. birthday: '',
  28. sex: '',
  29. phone: '',
  30. address: '',
  31. womenCategory: '',
  32. accountFeeType: '',
  33. unitName:'',
  34. height:'',
  35. weight:'',
  36. edu:'',
  37. monthlyIncome:'',
  38. vaccinationHpv:''
  39. },
  40. disease: {
  41. menophagia: '',
  42. menophagiaAge: '',
  43. hysterectomy: '',
  44. hysterectomyAge: '',
  45. menopause: '',
  46. menopauseAge: '',
  47. copd: '',
  48. copdAge: '',
  49. },
  50. fertility: {
  51. menophaniaAge: '',
  52. menopause: '',
  53. lmp:'',
  54. miscarriage:'',
  55. reproductiveHistory:'',
  56. breastCancerFir:'',
  57. breastCancerSec:'',
  58. partusMaturus:'',
  59. prematureDelivery:'',
  60. firstDeliveryAge:'',
  61. breastCancerSecNum:'',
  62. oophoromaNum:'',
  63. cervicalCancerFir:'',
  64. brcaGeneticTesting:'',
  65. chestRadiotherapy:'',
  66. chestRadiotherapy:'',
  67. hormoneUseMonth:'',
  68. breastBiopsySurgery:'',
  69. oophoromaSec:'',
  70. breastSurgeryNum:'',
  71. breastSurgeryResult:'',
  72. accessoryExcision:'',
  73. hysterectomy:'',
  74. hysterectomyAge:'',
  75. contraceptiveOtherMethod:'',
  76. contraceptiveMethod:'',
  77. accessoryExcision:'',
  78. contactBleeding:'',
  79. irregularVaginalBleeding:''
  80. }
  81. },
  82. menophaniaAgeList: [],
  83. selAddress: '', // 默认值
  84. selectedStreet: '',
  85. areaList: areaDataArr,
  86. areaOptions: [], // 地区数据
  87. rules: {},
  88. streetList: [],
  89. cascaderProps: {
  90. value: 'value',
  91. label: 'label',
  92. children: 'children',
  93. expandTrigger: 'hover',
  94. checkStrictly: true, // 可以只选父级
  95. emitPath: true // 只返回最后一级的值
  96. },
  97. currentStreet:[]
  98. }
  99. },
  100. methods: {
  101. getTableInfo(){
  102. var vm = this;
  103. vm.selectedStreet='';
  104. vm.selAddress=''
  105. vm.form={
  106. baseinfo:{
  107. sickName: '',
  108. age: '',
  109. nation: '',
  110. nationName: '',
  111. birthday: '',
  112. sex: '',
  113. phone: '',
  114. address: '',
  115. womenCategory: '',
  116. accountFeeType: '',
  117. unitName:'',
  118. height:'',
  119. weight:'',
  120. edu:'',
  121. monthlyIncome:'',
  122. vaccinationHpv:''
  123. },
  124. disease: {
  125. menophagia: '',
  126. menophagiaAge: '',
  127. hysterectomy: '',
  128. hysterectomyAge: '',
  129. menopause: '',
  130. menopauseAge: '',
  131. copd: '',
  132. copdAge: '',
  133. },
  134. fertility: {
  135. menophaniaAge: '',
  136. menopause: '',
  137. lmp:'',
  138. miscarriage:'',
  139. reproductiveHistory:'',
  140. breastCancerFir:'',
  141. breastCancerSec:'',
  142. partusMaturus:'',
  143. prematureDelivery:'',
  144. firstDeliveryAge:'',
  145. breastCancerSecNum:'',
  146. oophoromaNum:'',
  147. cervicalCancerFir:'',
  148. brcaGeneticTesting:'',
  149. chestRadiotherapy:'',
  150. chestRadiotherapy:'',
  151. hormoneUseMonth:'',
  152. breastBiopsySurgery:'',
  153. oophoromaSec:'',
  154. breastSurgeryNum:'',
  155. breastSurgeryResult:'',
  156. accessoryExcision:'',
  157. hysterectomy:'',
  158. hysterectomyAge:'',
  159. contraceptiveOtherMethod:'',
  160. contraceptiveMethod:'',
  161. accessoryExcision:'',
  162. contactBleeding:'',
  163. irregularVaginalBleeding:''
  164. }
  165. }
  166. var params={
  167. id:'', // 表单id
  168. screenId:this.currentInfo.id,// 筛查id
  169. type:'1' //表单类型
  170. }
  171. httpRequest.get('doctor/twoCancers/count/tableDetail', { data: params }).then(function (res) {
  172. if (res.status == 200) {
  173. if(res.obj.baseinfo){
  174. vm.form.baseinfo=res.obj.baseinfo
  175. _.filter(vm.areaList.city_list, function (v, k) {
  176. if (v.indexOf(vm.form.baseinfo.sickCity) === 0) {
  177. vm.selAddress=k;
  178. }
  179. })
  180. vm.getStreetData(vm.selAddress,vm.form.baseinfo.sickStreet)
  181. }
  182. if(res.obj.disease){
  183. vm.form.disease=res.obj.disease
  184. }
  185. if(res.obj.fertility){
  186. vm.form.fertility=res.obj.fertility
  187. }
  188. // vm.form = res.obj;
  189. }
  190. })
  191. },
  192. // 编辑
  193. updJkCopdPatient() {
  194. var vm =this
  195. var params = {
  196. baseInfoJson:JSON.stringify(this.form.baseinfo),
  197. fertilityJson:JSON.stringify(this.form.fertility),
  198. cervicalDiseaseHistoryJson:JSON.stringify(this.form.disease)
  199. }
  200. httpRequest.post('doctor/twoCancers/updBaseInfoSave', { data: params }).then(function (res) {
  201. console.log('333333333333333',res)
  202. if(res.status==200){
  203. toastr.error("保存成功")
  204. vm.getTableInfo()
  205. }else{
  206. toastr.error(res.msg)
  207. }
  208. })
  209. },
  210. getStreetData(cityCode,streetName) {
  211. console.log('1111111111111111',cityCode,streetName)
  212. var cityCode = cityCode.substring(0, 4)
  213. var streetList = []
  214. _.filter(this.areaList.county_list, function (v, k) {
  215. if (k.indexOf(cityCode) === 0) {
  216. streetList.push({
  217. value: k,
  218. label: v,
  219. children: []
  220. })
  221. }
  222. })
  223. this.streetList = streetList
  224. console.log(this.streetList, ';;;;;;;;;;;;;;;;;;;;;;;')
  225. this.streetList.map(item => {
  226. this.fetchStreetList(item)
  227. })
  228. var currentStreet = this.currentStreet
  229. setTimeout(() => {
  230. currentStreet.forEach(item1 => {
  231. if (item1.name == streetName) {
  232. this.selectedStreet = item1.code
  233. }
  234. })
  235. }, 1000)
  236. },
  237. handleItemChange(item) {
  238. var sickProvince = '';
  239. var sickCity = ''
  240. _.filter(this.areaList.province_list, function (v, k) {
  241. if (k.indexOf(item[0]) === 0) {
  242. sickProvince=v||''
  243. }
  244. })
  245. _.filter(this.areaList.city_list, function (v, k) {
  246. if (k.indexOf(item[1]) === 0) {
  247. sickCity=v||''
  248. }
  249. })
  250. this.form.baseinfo.sickProvince = sickProvince
  251. this.form.baseinfo.sickCity = sickCity
  252. this.form.baseinfo.sickCounty = ''
  253. this.form.baseinfo.sickStreet = ''
  254. this.selSickStreet = ''
  255. var cityCode = (item[1] || '').substring(0, 4)
  256. var streetList = []
  257. _.filter(this.areaList.county_list, function (v, k) {
  258. if (k.indexOf(cityCode) === 0) {
  259. streetList.push({
  260. value: k,
  261. label: v,
  262. children: []
  263. })
  264. }
  265. })
  266. this.streetList = streetList
  267. console.log(this.streetList, ';;;;;;;;;;;;;;;;;;;;;;;')
  268. this.streetList.map(item => {
  269. this.fetchStreetList(item)
  270. })
  271. console.log('111111111111111112222222222222222',this.currentStreet)
  272. },
  273. loadAreaData() {
  274. this.areaOptions = Object.keys(this.areaList.province_list).map(provinceCode => ({
  275. value: provinceCode,
  276. label: this.areaList.province_list[provinceCode],
  277. children: this.getCityChildren(provinceCode)
  278. }))
  279. },
  280. // 获取城市子节点
  281. getCityChildren(provinceCode) {
  282. const prefix = provinceCode.substring(0, 2)
  283. return Object.keys(this.areaList.city_list)
  284. .filter(cityCode => cityCode.startsWith(prefix))
  285. .map(cityCode => ({
  286. value: cityCode,
  287. label: this.areaList.city_list[cityCode]
  288. }))
  289. },
  290. fetchStreetList(item) {
  291. var vm = this
  292. var params = {
  293. town: item.value
  294. }
  295. httpRequest.get('doctor/sign/getStreetListByTown', { data: params }).then(function (res) {
  296. if (res.status == 200) {
  297. res.data.forEach(element => {
  298. vm.currentStreet.push(element)
  299. });
  300. var children =
  301. !res.data || !res.data.length
  302. ? []
  303. : _.map(res.data, function (v) {
  304. return {
  305. label: v.name,
  306. value: v.code
  307. }
  308. });
  309. }
  310. item.children = children
  311. })
  312. },
  313. handleStreetChange(item){
  314. this.form.baseinfo.sickCounty= this.areaList.county_list[item[0]]
  315. this.currentStreet.forEach(element => {
  316. if(element.code==item[1]){
  317. this.form.baseinfo.sickStreet= element.name
  318. }
  319. });
  320. }
  321. },
  322. watch: {
  323. currentInfo: {
  324. handler(newVal, oldVal) {
  325. if (newVal) {
  326. this.getTableInfo();
  327. }
  328. },
  329. deep: true
  330. }
  331. },
  332. mounted() {
  333. console.log('currentInfocurrentInfo: ', this.currentInfo)
  334. // this.form = this.currentInfo
  335. for (var i = 8; i < 21; i++) {
  336. this.menophaniaAgeList.push(i)
  337. }
  338. this.loadAreaData()
  339. this.getTableInfo();
  340. console.log('3333333333333333333333333',this)
  341. }
  342. })