<template>
    <div class="execution">
      <Table :columns="columns1" :data="data1" style="width: 90%;margin: auto"></Table>
    </div>
</template>

<script>
    import {getHTaskInfo} from '@/api/wmtask'
    import {tableOption} from '@/const/crud/wmtask'
    import {mapGetters} from 'vuex'
    import VDistpicker from 'v-distpicker'
    import maps from "qqmap"

    export default {
        name: 'wmtask',
        data() {
            return {
              columns1: [
                {
                  title: '表单字段名称',
                  key: 'filedStr'
                },
                {
                  title: '现表单值',
                  key: 'taskStr'
                },
                {
                  title: '任务表单值',
                  key: 'nowStr'
                }
              ],
              data1: []
            }
        },
      components: {
      },
      mounted(){
          this.init();
      },
        methods: {
          init(){
            var obj={
              taskId:this.$route.query.taskId
            }
            getHTaskInfo(obj).then(data => {
              var obj=data.data.data;
              if(undefined!=obj)
              {
                let content=obj.content;
                let hospital=obj.hospital;
                if(undefined==hospital)
                {
                  hospital={};
                }
                if(undefined!=content)
                {
                  this.data1.push({
                    filedStr:"医院名称",
                    nowStr:this.bulidStr(content.temp3),
                    taskStr:this.bulidStr(hospital.yymc),
                    calssName:this.getClassName(content.temp3,hospital.yymc)
                  })

                  this.data1.push({
                    filedStr:"省",
                    nowStr:this.bulidStr(content.temp4.split(",")[0]),
                    taskStr:this.bulidStr(hospital.province),
                    calssName:this.getClassName(content.temp4.split(",")[0],hospital.province)
                  })

                  this.data1.push({
                    filedStr:"市",
                    nowStr:this.bulidStr(content.temp4.split(",")[1]),
                    taskStr:this.bulidStr(hospital.city),
                    calssName:this.getClassName(content.temp4.split(",")[1],hospital.city)
                  })

                  this.data1.push({
                    filedStr:"区",
                    nowStr:this.bulidStr(content.temp4.split(",")[2]),
                    taskStr:this.bulidStr(hospital.area),
                    calssName:this.getClassName(content.temp4.split(",")[2],hospital.area)
                  })


                  this.data1.push({
                    filedStr:"医院规模",
                    nowStr:this.bulidStr(content.temp5),
                    taskStr:this.bulidStr(hospital.yygm),
                    calssName:this.getClassName(content.temp5,hospital.yygm)
                  })


                  this.data1.push({
                    filedStr:"医院性质",
                    nowStr:this.bulidStr(content.temp6),
                    taskStr:this.bulidStr(hospital.yyxz),
                    calssName:this.getClassName(content.temp6,hospital.yyxz)
                  })

                  this.data1.push({
                    filedStr:"联系总机",
                    nowStr:this.bulidStr(content.temp7),
                    taskStr:this.bulidStr(hospital.lxzj),
                    calssName:this.getClassName(content.temp7,hospital.lxzj)
                  })

                  this.data1.push({
                    filedStr:"公共邮箱",
                    nowStr:this.bulidStr(content.temp8),
                    taskStr:this.bulidStr(hospital.ggyx),
                    calssName:this.getClassName(content.temp8,hospital.ggyx)
                  })
                  this.data1.push({
                    filedStr:"院长姓名",
                    nowStr:this.bulidStr(content.temp10),
                    taskStr:this.bulidStr(hospital.yzxm),
                    calssName:this.getClassName(content.temp10,hospital.yzxm)
                  })

                  this.data1.push({
                    filedStr:"院长联系方式",
                    nowStr:this.bulidStr(content.temp11),
                    taskStr:this.bulidStr(hospital.yzlxfs),
                    calssName:this.getClassName(content.temp11,hospital.yzlxfs)
                  })

                  this.data1.push({
                    filedStr:"副院长姓名",
                    nowStr:this.bulidStr(content.temp12),
                    taskStr:this.bulidStr(hospital.fyzxm),
                    calssName:this.getClassName(content.temp12,hospital.fyzxm)
                  })
                  this.data1.push({
                    filedStr:"副院长联系方式",
                    nowStr:this.bulidStr(content.temp13),
                    taskStr:this.bulidStr(hospital.fyzlxfs),
                    calssName:this.getClassName(content.temp13,hospital.fyzlxfs)
                  })
                  this.data1.push({
                    filedStr:"医务处处长姓名",
                    nowStr:this.bulidStr(content.temp14),
                    taskStr:this.bulidStr(hospital.ywcczxm),
                    calssName:this.getClassName(content.temp14,hospital.ywcczxm)
                  })
                  this.data1.push({
                    filedStr:"医务处处长联系方式",
                    nowStr:this.bulidStr(content.temp15),
                    taskStr:this.bulidStr(hospital.ywcczlxfs),
                    calssName:this.getClassName(content.temp15,hospital.ywcczlxfs)
                  })
                  // this.data1.push({
                  //   filedStr:"教务处处长姓名",
                  //   nowStr:this.bulidStr(content.temp18),
                  //   taskStr:this.bulidStr(hospital.jwcczxm),
                  //   calssName:this.getClassName(content.temp18,hospital.jwcczxm)
                  // })
                  // this.data1.push({
                  //   filedStr:"教务处处长联系方式",
                  //   nowStr:this.bulidStr(content.temp19),
                  //   taskStr:this.bulidStr(hospital.jwcczlxfs),
                  //   calssName:this.getClassName(content.temp19,hospital.jwcczlxfs)
                  // })
                  this.data1.push({
                    filedStr:"药剂科主任姓名",
                    nowStr:this.bulidStr(content.temp20),
                    taskStr:this.bulidStr(hospital.yjkzrxm),
                    calssName:this.getClassName(content.temp20,hospital.yjkzrxm)
                  })
                  this.data1.push({
                    filedStr:"药剂科主任联系方式",
                    nowStr:this.bulidStr(content.temp21),
                    taskStr:this.bulidStr(hospital.yjkzrlsfs),
                    calssName:this.getClassName(content.temp21,hospital.yjkzrlsfs)
                  })
                  this.data1.push({
                    filedStr:"院病床总数（张）",
                    nowStr:this.bulidStr(content.temp22),
                    taskStr:this.bulidStr(hospital.ybczs),
                    calssName:this.getClassName(content.temp22,hospital.ybczs)
                  })
                  // this.data1.push({
                  //   filedStr:"主流供货商业",
                  //   nowStr:this.bulidStr(content.temp23),
                  //   taskStr:this.bulidStr(hospital.zlghsy),
                  //   calssName:this.getClassName(content.temp23,hospital.zlghsy)
                  // })
                  // this.data1.push({
                  //   filedStr:"普什品种是否入院",
                  //   nowStr:this.bulidStr(content.temp24),
                  //   taskStr:this.bulidStr(hospital.pspzsfry),
                  //   calssName:this.getClassName(content.temp24,hospital.pspzsfry)
                  // })

                  // this.data1.push({
                  //   filedStr:"普什品种配送商业",
                  //   nowStr:this.bulidStr(content.temp25),
                  //   taskStr:this.bulidStr(hospital.pspzpssy),
                  //   calssName:this.getClassName(content.temp25,hospital.pspzpssy)
                  // })
                  this.data1.push({
                    filedStr:"医院官网：",
                    nowStr:this.bulidStr(content.temp26),
                    taskStr:this.bulidStr(hospital.website),
                    calssName:this.getClassName(content.temp26,hospital.website)
                  })
                }
              }
            }).catch((error) => {
            });

          },
          bulidStr(obj)
          {
            if(undefined==obj)
            {
              return "";
            }
            return obj;
          },
          getClassName(obj1,obj2)
          {
            return "";
          }
        }
    }
</script>
