246 lines
6.5 KiB
JavaScript
246 lines
6.5 KiB
JavaScript
|
|
//组件
|
||
|
|
var upoffwellcomponent = {
|
||
|
|
template:`
|
||
|
|
<div>
|
||
|
|
<div style="display: inline-block;width: 100%;margin-top: 10px;">
|
||
|
|
<div style="float: left;width: 15%;background-color: #ECF5FF;">
|
||
|
|
<el-input v-model="wellname" placeholder="输入井名" clearable ></el-input>
|
||
|
|
</div>
|
||
|
|
<div style="float: left;width: 15%;background-color: #ECF5FF;">
|
||
|
|
<el-input v-model="user" placeholder="输入上井人员" clearable ></el-input>
|
||
|
|
</div>
|
||
|
|
<div style="float: left;margin-left: 5px;">
|
||
|
|
<el-checkbox style="background-color: #ECF5FF;" v-model="checked" label="工程服务" border></el-checkbox>
|
||
|
|
</div>
|
||
|
|
<div style="float: left;margin-left: 5px;">
|
||
|
|
<el-button id ="bt_serach" plain type="primary" icon="el-icon-search" @click="get_info()">搜索</el-button>
|
||
|
|
</div>
|
||
|
|
<div style="float: left; margin-left: 5px;">
|
||
|
|
<el-button id ="bt_export" plain type="primary" icon="el-icon-document" @click="export_csv()">导出</el-button>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="span">
|
||
|
|
<el-table
|
||
|
|
:data="tableData"
|
||
|
|
style="width: 100%;font-size:14px"
|
||
|
|
:height="tHeight"
|
||
|
|
:cell-style="{background:'#304156'}"
|
||
|
|
border
|
||
|
|
>
|
||
|
|
<el-table-column
|
||
|
|
prop="wellname"
|
||
|
|
label="井号"
|
||
|
|
:width="150"
|
||
|
|
:show-overflow-tooltip="true">
|
||
|
|
</el-table-column>
|
||
|
|
<el-table-column
|
||
|
|
prop="service_type"
|
||
|
|
label="服务类别"
|
||
|
|
:width="120">
|
||
|
|
</el-table-column>
|
||
|
|
<el-table-column
|
||
|
|
prop="op_type"
|
||
|
|
label="操作类别"
|
||
|
|
:width="120">
|
||
|
|
</el-table-column>
|
||
|
|
<el-table-column
|
||
|
|
prop="user"
|
||
|
|
label="上井人员"
|
||
|
|
:width="150"
|
||
|
|
:show-overflow-tooltip="true">
|
||
|
|
</el-table-column>
|
||
|
|
<el-table-column
|
||
|
|
prop="up_well_time"
|
||
|
|
label="人员上井时间"
|
||
|
|
:width="170">
|
||
|
|
</el-table-column>
|
||
|
|
<el-table-column
|
||
|
|
prop="entry_time"
|
||
|
|
label="仪器入井时间"
|
||
|
|
:width="170">
|
||
|
|
</el-table-column>
|
||
|
|
<el-table-column
|
||
|
|
prop="out_time"
|
||
|
|
label="仪器出井时间"
|
||
|
|
:width="170">
|
||
|
|
</el-table-column>
|
||
|
|
<el-table-column
|
||
|
|
prop="off_well_time"
|
||
|
|
label="人员离井时间"
|
||
|
|
:width="170">
|
||
|
|
</el-table-column>
|
||
|
|
</el-table>
|
||
|
|
</div>
|
||
|
|
<div class="block">
|
||
|
|
<span class="demonstration" style="background-color: #ECF5FF;"></span>
|
||
|
|
<el-pagination
|
||
|
|
@size-change="handleSizeChange"
|
||
|
|
@current-change="handleCurrentChange"
|
||
|
|
:current-page="currentPage"
|
||
|
|
:page-sizes="[50,100, 200, 300]"
|
||
|
|
:page-size="pagesize"
|
||
|
|
layout="total, sizes, prev, pager, next, jumper"
|
||
|
|
:total="recordTotal" style="background-color: #ECF5FF;">
|
||
|
|
</el-pagination>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
</div>
|
||
|
|
`,
|
||
|
|
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),
|
||
|
|
|
||
|
|
wellname:'',
|
||
|
|
user:'',
|
||
|
|
|
||
|
|
currentPage: 1,
|
||
|
|
pagesize:50,
|
||
|
|
recordTotal:0,
|
||
|
|
|
||
|
|
checked:false,
|
||
|
|
}
|
||
|
|
},
|
||
|
|
mounted() {
|
||
|
|
var _this = this;
|
||
|
|
|
||
|
|
var objs;
|
||
|
|
axios.post('/deescloud/get_up_off_well_info', {
|
||
|
|
opuser:localStorage.getItem("online_user"),
|
||
|
|
opuser_uuid:localStorage.getItem("uuid"),
|
||
|
|
index: this.$data.currentPage,
|
||
|
|
count: this.$data.pagesize,
|
||
|
|
wellname:this.$data.wellname,
|
||
|
|
user:this.$data.user,
|
||
|
|
if_es:this.$data.checked
|
||
|
|
})
|
||
|
|
.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_csv(){
|
||
|
|
document.getElementById("bt_export").blur();
|
||
|
|
|
||
|
|
axios.post('/deescloud/get_up_off_well_csv', {
|
||
|
|
opuser:localStorage.getItem("online_user"),
|
||
|
|
opuser_uuid:localStorage.getItem("uuid"),
|
||
|
|
index: this.$data.currentPage,
|
||
|
|
count: this.$data.pagesize,
|
||
|
|
wellname:this.$data.wellname,
|
||
|
|
user:this.$data.user,
|
||
|
|
if_es:this.$data.checked
|
||
|
|
}).then(function (response) {
|
||
|
|
console.log(response.data);
|
||
|
|
var fileid = response.data.fileId;
|
||
|
|
|
||
|
|
var downUrl = 'file/'+fileid;
|
||
|
|
downloadUrl("人员上离井信息.csv",downUrl);
|
||
|
|
})
|
||
|
|
.catch(function (error) {
|
||
|
|
console.log(error);
|
||
|
|
});
|
||
|
|
},
|
||
|
|
get_info(){
|
||
|
|
|
||
|
|
document.getElementById("bt_serach").blur();
|
||
|
|
|
||
|
|
this.$data.currentPage=1;
|
||
|
|
|
||
|
|
var _this = this;
|
||
|
|
|
||
|
|
var objs;
|
||
|
|
axios.post('/deescloud/get_up_off_well_info', {
|
||
|
|
opuser:localStorage.getItem("online_user"),
|
||
|
|
opuser_uuid:localStorage.getItem("uuid"),
|
||
|
|
index: this.$data.currentPage,
|
||
|
|
count: this.$data.pagesize,
|
||
|
|
wellname:this.$data.wellname,
|
||
|
|
user:this.$data.user,
|
||
|
|
if_es:this.$data.checked
|
||
|
|
})
|
||
|
|
.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_up_off_well_info', {
|
||
|
|
opuser:localStorage.getItem("online_user"),
|
||
|
|
opuser_uuid:localStorage.getItem("uuid"),
|
||
|
|
index: this.$data.currentPage,
|
||
|
|
count: this.$data.pagesize,
|
||
|
|
wellname:this.$data.wellname,
|
||
|
|
user:this.$data.user,
|
||
|
|
if_es:this.$data.checked
|
||
|
|
})
|
||
|
|
.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_up_off_well_info', {
|
||
|
|
opuser:localStorage.getItem("online_user"),
|
||
|
|
opuser_uuid:localStorage.getItem("uuid"),
|
||
|
|
index: this.$data.currentPage,
|
||
|
|
count: this.$data.pagesize,
|
||
|
|
wellname:this.$data.wellname,
|
||
|
|
user:this.$data.user,
|
||
|
|
if_es:this.$data.checked
|
||
|
|
})
|
||
|
|
.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);
|
||
|
|
});
|
||
|
|
|
||
|
|
},
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|