//组件 var srrcomponent = { template:`
搜索
井号: {{base_data.wellname}}
登录上传账号: {{base_data.upload_name}}
施工人员填报信息
开始时间: {{item.bt}}   结束时间: {{item.et}}   姓名: {{item.servicer}}   状态: {{item.state}}   钻次{{item.drilling_time}}
参考信息
IP+端口: {{base_data.ip}}
地区: {{base_data.location}}
开始时间: {{item.bt}}   结束时间: {{item.et}}   事件: {{item.ename}}
`, data(){ // 获取当前屏幕的分辨率 let screenW = window.screen.width; let screenH = window.innerHeight; console.log("screen width:",screenW); console.log("screen height:",screenH); return { tHeight:screenH-192, tableData: Array(0), input:'', currentPage: 1, pagesize:50, recordTotal:0, pdf_visible:false, base_data:{}, srr_state_data:{}, srr_event_data:{}, } }, mounted() { var _this = this; var objs; axios.post('/deescloud/get_well_cmp', { opuser:localStorage.getItem("online_user"), opuser_uuid:localStorage.getItem("uuid"), index: this.$data.currentPage, count: this.$data.pagesize }) .then(function (response) { console.log(response.data); objs = response.data.data; rcnt = response.data.total; _this.$data.tableData = objs; _this.$data.recordTotal = rcnt; }) .catch(function (error) { console.log(error); }); }, methods: { export_pdf(row){ var _this = this; // 构建请求参数对象 const requestParams = { opuser: localStorage.getItem("online_user"), opuser_uuid: localStorage.getItem("uuid"), wellname: row.wellNameSource }; // 如果开泵信息被启用,则添加flag参数 if (row.pumpExport) { requestParams.flag = true; } axios.post('deescloud/get_srr_pdf', requestParams) .then(function (response) { console.log(response.data); var fileid = response.data.fileId; var downUrl = 'file/'+fileid; downloadUrl(row.wellNameSource+"-现场人员记录报告.pdf",downUrl); }) .catch(function (error) { console.log(error); }); }, show_pdf(row){ let _this= this; axios.post('/deescloud/get_srr_base', { opuser:localStorage.getItem("online_user"), opuser_uuid:localStorage.getItem("uuid"), wellname: row.wellNameSource, }) .then(function (response) { console.log(response.data); _this.$data.base_data = response.data; }) .catch(function (error) { console.log(error); }); axios.post('/deescloud/get_srr_event', { opuser:localStorage.getItem("online_user"), opuser_uuid:localStorage.getItem("uuid"), wellname: row.wellNameSource, }) .then(function (response) { console.log(response.data); _this.$data.srr_event_data = response.data.data; }) .catch(function (error) { console.log(error); }); axios.post('/deescloud/get_srr_state', { opuser:localStorage.getItem("online_user"), opuser_uuid:localStorage.getItem("uuid"), wellname: row.wellNameSource, }) .then(function (response) { console.log(response.data); _this.$data.srr_state_data = response.data.data; _this.$data.pdf_visible =true; }) .catch(function (error) { console.log(error); }); }, getWell(_search_name){ document.getElementById("bt_serach").blur(); this.$data.currentPage=1; var _this = this; var objs; axios.post('/deescloud/get_well_cmp', { opuser:localStorage.getItem("online_user"), opuser_uuid:localStorage.getItem("uuid"), Wellname: _search_name, index: this.$data.currentPage, count: this.$data.pagesize }) .then(function (response) { console.log(response.data); objs = response.data.data; rcnt = response.data.total; _this.$data.tableData = objs; _this.$data.recordTotal = rcnt; }) .catch(function (error) { console.log(error); }); }, handleSizeChange(val) { //console.log(`每页 ${val} 条`); this.$data.pagesize = val; var _this = this; var objs; axios.post('/deescloud/get_well_cmp', { opuser:localStorage.getItem("online_user"), opuser_uuid:localStorage.getItem("uuid"), Wellname: this.$data.input, index: this.$data.currentPage, count: this.$data.pagesize }) .then(function (response) { console.log(response.data); objs = response.data.data; rcnt = response.data.total; _this.$data.tableData = objs; _this.$data.recordTotal = rcnt; }) .catch(function (error) { console.log(error); }); }, handleCurrentChange(val) { //console.log(`当前页: ${val}`); this.$data.currentPage = val; var _this = this; var objs; axios.post('/deescloud/get_well_cmp', { opuser:localStorage.getItem("online_user"), opuser_uuid:localStorage.getItem("uuid"), Wellname: this.$data.input, index: this.$data.currentPage, count: this.$data.pagesize }) .then(function (response) { console.log(response.data); objs = response.data.data; rcnt = response.data.total; _this.$data.tableData = objs; _this.$data.recordTotal = rcnt; }) .catch(function (error) { console.log(error); }); }, } }