123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349 |
- var template = ''
- $.ajax('../../../component/statistics/LascModifyPatient/index.html', {
- data: {},
- dataType: 'html',
- cache: false,
- timeout: 60000,
- async: false,
- error: function (res) {},
- success: function (res) {
- template = res
- }
- })
- Vue.component('lasc-modify-patient', {
- template: template,
- name: 'lasc-modify-patient',
- props: {
- currentInfo: {},
- readonly: {
- type: Boolean,
- default: false
- }
- },
- data: function () {
- return {
- form: {
- baseinfo: {
- sickName: '',
- age: '',
- nation: '',
- nationName: '',
- birthday: '',
- sex: '',
- phone: '',
- address: '',
- womenCategory: '',
- accountFeeType: '',
- unitName: '',
- height: '',
- weight: '',
- edu: '',
- monthlyIncome: '',
- vaccinationHpv: ''
- },
- disease: {
- menophagia: '',
- menophagiaAge: '',
- hysterectomy: '',
- hysterectomyAge: '',
- menopause: '',
- menopauseAge: '',
- copd: '',
- copdAge: ''
- },
- fertility: {
- menophaniaAge: '',
- menopause: '',
- lmp: '',
- miscarriage: '',
- reproductiveHistory: '',
- breastCancerFir: '',
- breastCancerSec: '',
- partusMaturus: '',
- prematureDelivery: '',
- firstDeliveryAge: '',
- breastCancerSecNum: '',
- oophoromaNum: '',
- cervicalCancerFir: '',
- brcaGeneticTesting: '',
- chestRadiotherapy: '',
- chestRadiotherapy: '',
- hormoneUseMonth: '',
- breastBiopsySurgery: '',
- oophoromaSec: '',
- breastSurgeryNum: '',
- breastSurgeryResult: '',
- accessoryExcision: '',
- hysterectomy: '',
- hysterectomyAge: '',
- contraceptiveOtherMethod: '',
- contraceptiveMethod: '',
- accessoryExcision: '',
- contactBleeding: '',
- irregularVaginalBleeding: ''
- }
- },
- menophaniaAgeList: [],
- selAddress: '', // 默认值
- selectedStreet: '',
- areaList: areaDataArr,
- areaOptions: [], // 地区数据
- rules: {},
- streetList: [],
- cascaderProps: {
- value: 'value',
- label: 'label',
- children: 'children',
- expandTrigger: 'hover',
- checkStrictly: true, // 可以只选父级
- emitPath: true // 只返回最后一级的值
- },
- currentStreet: []
- }
- },
- methods: {
- getTableInfo() {
- var vm = this
- vm.selectedStreet = ''
- vm.selAddress = ''
- vm.form = {
- baseinfo: {
- sickName: '',
- age: '',
- nation: '',
- nationName: '',
- birthday: '',
- sex: '',
- phone: '',
- address: '',
- womenCategory: '',
- accountFeeType: '',
- unitName: '',
- height: '',
- weight: '',
- edu: '',
- monthlyIncome: '',
- vaccinationHpv: ''
- },
- disease: {
- menophagia: '',
- menophagiaAge: '',
- hysterectomy: '',
- hysterectomyAge: '',
- menopause: '',
- menopauseAge: '',
- copd: '',
- copdAge: ''
- },
- fertility: {
- menophaniaAge: '',
- menopause: '',
- lmp: '',
- miscarriage: '',
- reproductiveHistory: '',
- breastCancerFir: '',
- breastCancerSec: '',
- partusMaturus: '',
- prematureDelivery: '',
- firstDeliveryAge: '',
- breastCancerSecNum: '',
- oophoromaNum: '',
- cervicalCancerFir: '',
- brcaGeneticTesting: '',
- chestRadiotherapy: '',
- chestRadiotherapy: '',
- hormoneUseMonth: '',
- breastBiopsySurgery: '',
- oophoromaSec: '',
- breastSurgeryNum: '',
- breastSurgeryResult: '',
- accessoryExcision: '',
- hysterectomy: '',
- hysterectomyAge: '',
- contraceptiveOtherMethod: '',
- contraceptiveMethod: '',
- accessoryExcision: '',
- contactBleeding: '',
- irregularVaginalBleeding: ''
- }
- }
- var params = {
- id: '', // 表单id
- screenId: this.currentInfo.id, // 筛查id
- type: '1' //表单类型
- }
- httpRequest.get('doctor/twoCancers/count/tableDetail', { data: params }).then(function (res) {
- if (res.status == 200) {
- if (res.obj.baseinfo) {
- vm.form.baseinfo = res.obj.baseinfo
- _.filter(vm.areaList.city_list, function (v, k) {
- if (v.indexOf(vm.form.baseinfo.sickCity) === 0) {
- vm.selAddress = k
- }
- })
- vm.getStreetData(vm.selAddress, vm.form.baseinfo.sickStreet)
- }
- if (res.obj.disease) {
- vm.form.disease = res.obj.disease
- }
- if (res.obj.fertility) {
- vm.form.fertility = res.obj.fertility
- }
- // vm.form = res.obj;
- }
- })
- },
- // 编辑
- updJkCopdPatient() {
- var vm = this
- var params = {
- baseInfoJson: JSON.stringify(this.form.baseinfo),
- fertilityJson: JSON.stringify(this.form.fertility),
- cervicalDiseaseHistoryJson: JSON.stringify(this.form.disease)
- }
- httpRequest.post('doctor/twoCancers/updBaseInfoSave', { data: params }).then(function (res) {
- console.log('333333333333333', res)
- if (res.status == 200) {
- toastr.success('保存成功')
- vm.getTableInfo()
- } else {
- toastr.error(res.msg)
- }
- })
- },
- getStreetData(cityCode, streetName) {
- console.log('1111111111111111', cityCode, streetName)
- var cityCode = cityCode.substring(0, 4)
- var streetList = []
- _.filter(this.areaList.county_list, function (v, k) {
- if (k.indexOf(cityCode) === 0) {
- streetList.push({
- value: k,
- label: v,
- children: []
- })
- }
- })
- this.streetList = streetList
- console.log(this.streetList, ';;;;;;;;;;;;;;;;;;;;;;;')
- this.streetList.map(item => {
- this.fetchStreetList(item)
- })
- var currentStreet = this.currentStreet
- setTimeout(() => {
- currentStreet.forEach(item1 => {
- if (item1.name == streetName) {
- this.selectedStreet = item1.code
- }
- })
- }, 1000)
- },
- handleItemChange(item) {
- var sickProvince = ''
- var sickCity = ''
- _.filter(this.areaList.province_list, function (v, k) {
- if (k.indexOf(item[0]) === 0) {
- sickProvince = v || ''
- }
- })
- _.filter(this.areaList.city_list, function (v, k) {
- if (k.indexOf(item[1]) === 0) {
- sickCity = v || ''
- }
- })
- this.form.baseinfo.sickProvince = sickProvince
- this.form.baseinfo.sickCity = sickCity
- this.form.baseinfo.sickCounty = ''
- this.form.baseinfo.sickStreet = ''
- this.selSickStreet = ''
- var cityCode = (item[1] || '').substring(0, 4)
- var streetList = []
- _.filter(this.areaList.county_list, function (v, k) {
- if (k.indexOf(cityCode) === 0) {
- streetList.push({
- value: k,
- label: v,
- children: []
- })
- }
- })
- this.streetList = streetList
- console.log(this.streetList, ';;;;;;;;;;;;;;;;;;;;;;;')
- this.streetList.map(item => {
- this.fetchStreetList(item)
- })
- console.log('111111111111111112222222222222222', this.currentStreet)
- },
- loadAreaData() {
- this.areaOptions = Object.keys(this.areaList.province_list).map(provinceCode => ({
- value: provinceCode,
- label: this.areaList.province_list[provinceCode],
- children: this.getCityChildren(provinceCode)
- }))
- },
- // 获取城市子节点
- getCityChildren(provinceCode) {
- const prefix = provinceCode.substring(0, 2)
- return Object.keys(this.areaList.city_list)
- .filter(cityCode => cityCode.startsWith(prefix))
- .map(cityCode => ({
- value: cityCode,
- label: this.areaList.city_list[cityCode]
- }))
- },
- fetchStreetList(item) {
- var vm = this
- var params = {
- town: item.value
- }
- httpRequest.get('doctor/sign/getStreetListByTown', { data: params }).then(function (res) {
- if (res.status == 200) {
- res.data.forEach(element => {
- vm.currentStreet.push(element)
- })
- var children =
- !res.data || !res.data.length
- ? []
- : _.map(res.data, function (v) {
- return {
- label: v.name,
- value: v.code
- }
- })
- }
- item.children = children
- })
- },
- handleStreetChange(item) {
- this.form.baseinfo.sickCounty = this.areaList.county_list[item[0]]
- this.currentStreet.forEach(element => {
- if (element.code == item[1]) {
- this.form.baseinfo.sickStreet = element.name
- }
- })
- }
- },
- watch: {
- currentInfo: {
- handler(newVal, oldVal) {
- if (newVal) {
- this.getTableInfo()
- }
- },
- deep: true
- }
- },
- mounted() {
- console.log('currentInfocurrentInfo: ', this.currentInfo)
- // this.form = this.currentInfo
- for (var i = 8; i < 21; i++) {
- this.menophaniaAgeList.push(i)
- }
- this.loadAreaData()
- this.getTableInfo()
- console.log('3333333333333333333333333', this)
- }
- })
|