<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.gsmc),
                    calssName:this.getClassName(content.temp3,hospital.gsmc)
                  })

                  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.temp4.split(",")[3]),
                    taskStr:this.bulidStr(hospital.address),
                    calssName:this.getClassName(content.temp4.split(",")[2],hospital.address)
                  })


                  this.data1.push({
                    filedStr:"公司规模",
                    nowStr:this.bulidStr(content.temp5),
                    taskStr:this.bulidStr(hospital.gsgm),
                    calssName:this.getClassName(content.temp5,hospital.gsgm)
                  })


                  this.data1.push({
                    filedStr:"统一社会信用代码",
                    nowStr:this.bulidStr(content.shyshxydm),
                    taskStr:this.bulidStr(hospital.yyxz),
                    calssName:this.getClassName(content.temp6,hospital.shyshxydm)
                  })

                  this.data1.push({
                    filedStr:"公司注册地",
                    nowStr:this.bulidStr(content.temp7),
                    taskStr:this.bulidStr(hospital.gszcd),
                    calssName:this.getClassName(content.temp7,hospital.gszcd)
                  })

                  this.data1.push({
                    filedStr:"注册资本",
                    nowStr:this.bulidStr(content.temp8),
                    taskStr:this.bulidStr(hospital.zczb),
                    calssName:this.getClassName(content.temp8,hospital.zczb)
                  })
                  this.data1.push({
                    filedStr:"GSP证书编号",
                    nowStr:this.bulidStr(content.temp9),
                    taskStr:this.bulidStr(hospital.gspzsbh),
                    calssName:this.getClassName(content.temp9,hospital.gspzsbh)
                  })

                  this.data1.push({
                    filedStr:"法定代表人",
                    nowStr:this.bulidStr(content.temp10),
                    taskStr:this.bulidStr(hospital.frdb),
                    calssName:this.getClassName(content.temp10,hospital.frdb)
                  })

                  this.data1.push({
                    filedStr:"总经理",
                    nowStr:this.bulidStr(content.temp11),
                    taskStr:this.bulidStr(hospital.zjl),
                    calssName:this.getClassName(content.temp11,hospital.zjl)
                  })
                  this.data1.push({
                    filedStr:"采购部门负责人姓名",
                    nowStr:this.bulidStr(content.temp12),
                    taskStr:this.bulidStr(hospital.cjbmfzrxm),
                    calssName:this.getClassName(content.temp12,hospital.cjbmfzrxm)
                  })
                  this.data1.push({
                    filedStr:"采购部门负责人联系方式",
                    nowStr:this.bulidStr(content.temp13),
                    taskStr:this.bulidStr(hospital.cjbmfzrlxfs),
                    calssName:this.getClassName(content.temp13,hospital.cjbmfzrlxfs)
                  })
                  this.data1.push({
                    filedStr:"采购部门对接人姓名",
                    nowStr:this.bulidStr(content.temp14),
                    taskStr:this.bulidStr(hospital.cgbmdjrxm),
                    calssName:this.getClassName(content.temp14,hospital.cgbmdjrxm)
                  })
                  this.data1.push({
                    filedStr:"采购部门对接人联系方式",
                    nowStr:this.bulidStr(content.temp15),
                    taskStr:this.bulidStr(hospital.cgbmdjrlxfs),
                    calssName:this.getClassName(content.temp15,hospital.cgbmdjrlxfs)
                  })
                  this.data1.push({
                    filedStr:"销售部门负责人姓名",
                    nowStr:this.bulidStr(content.temp16),
                    taskStr:this.bulidStr(hospital.xsbmfzrxm),
                    calssName:this.getClassName(content.temp16,hospital.xsbmfzrxm)
                  })
                  this.data1.push({
                    filedStr:"销售部门负责人联系方式",
                    nowStr:this.bulidStr(content.temp17),
                    taskStr:this.bulidStr(hospital.xsbmfzrlxfs),
                    calssName:this.getClassName(content.temp17,hospital.xsbmfzrlxfs)
                  })
                  this.data1.push({
                    filedStr:"销售部门对接人姓名",
                    nowStr:this.bulidStr(content.temp18),
                    taskStr:this.bulidStr(hospital.xsbmdjrxm),
                    calssName:this.getClassName(content.temp18,hospital.xsbmdjrxm)
                  })
                  this.data1.push({
                    filedStr:"销售部门对接人联系方式",
                    nowStr:this.bulidStr(content.temp19),
                    taskStr:this.bulidStr(hospital.xsbmdjrlxfs),
                    calssName:this.getClassName(content.temp19,hospital.xsbmdjrlxfs)
                  })
                  this.data1.push({
                    filedStr:"公司简介",
                    nowStr:this.bulidStr(content.temp20),
                    taskStr:this.bulidStr(hospital.gsjj),
                    calssName:this.getClassName(content.temp20,hospital.gsjj)
                  })
                  this.data1.push({
                    filedStr:"经营优势",
                    nowStr:this.bulidStr(content.temp21),
                    taskStr:this.bulidStr(hospital.jyys),
                    calssName:this.getClassName(content.temp21,hospital.jyys)
                  })


                }
              }
            }).catch((error) => {
            });

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