362 lines
9.7 KiB
JavaScript
362 lines
9.7 KiB
JavaScript
|
|
var mhComponent_en = {
|
|
template:`
|
|
<div>
|
|
<div v-show="if_show0">
|
|
<div id="" style="display: inline-block;width: 100%;margin-top: 10px;">
|
|
|
|
<div style="float: left; width: 15%;background-color: #ECF5FF;">
|
|
<el-input v-model="input" placeholder="Input Well Name" clearable></el-input>
|
|
</div>
|
|
<div style="float: left;background-color: #ECF5FF;">
|
|
<el-date-picker
|
|
v-if="if_show_bt==1"
|
|
v-model="date_value"
|
|
type="datetimerange"
|
|
range-separator="to"
|
|
start-placeholder="Upload Start Time"
|
|
end-placeholder="Upload End Time"
|
|
value-format="yyyy-MM-dd HH:mm:ss">
|
|
</el-date-picker>
|
|
<el-date-picker
|
|
v-if="if_show_bt==2"
|
|
v-model="date_value"
|
|
type="datetimerange"
|
|
range-separator="to"
|
|
start-placeholder="Upload Start Time"
|
|
end-placeholder="Upload End Time"
|
|
format="MM-dd-yyyy HH:mm:ss"
|
|
value-format="yyyy-MM-dd HH:mm:ss">
|
|
</el-date-picker>
|
|
<el-date-picker
|
|
v-if="if_show_bt==3"
|
|
v-model="date_value"
|
|
type="datetimerange"
|
|
range-separator="to"
|
|
start-placeholder="Upload Start Time"
|
|
end-placeholder="Upload End Time"
|
|
format="dd-MM-yyyy HH:mm:ss"
|
|
value-format="yyyy-MM-dd HH:mm:ss">
|
|
</el-date-picker>
|
|
</div>
|
|
<div style="float: left;margin-left: 5px;">
|
|
<el-checkbox style="background-color: #ECF5FF;" v-model="checked" label="All" border></el-checkbox>
|
|
</div>
|
|
|
|
<div style="float:left;margin-left: 5px;">
|
|
<el-checkbox style="background-color: #ECF5FF;" v-model="checked1" label="Project Service" border></el-checkbox>
|
|
</div>
|
|
|
|
<div style="float: left;margin-left: 5px;">
|
|
<el-button id ="bt_serach" plain type="primary" icon="el-icon-search" @click="getMh(input)">Search</el-button>
|
|
</div>
|
|
|
|
<div style="float: left; margin-left: 5px;">
|
|
<el-button id ="bt_export" plain type="primary" icon="el-icon-document" @click="exportMh()">Export</el-button>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="span">
|
|
<el-table
|
|
:data="tableData"
|
|
style="width: 100%"
|
|
:height="tHeight"
|
|
:cell-style="{background:'#304156'}"
|
|
border
|
|
>
|
|
<el-table-column
|
|
prop="wellname"
|
|
label="Well Name"
|
|
:width="150"
|
|
:show-overflow-tooltip="true">
|
|
</el-table-column>
|
|
<el-table-column
|
|
prop="welloper"
|
|
label="Users"
|
|
:width="150"
|
|
:show-overflow-tooltip="true">
|
|
</el-table-column>
|
|
<el-table-column
|
|
prop="state"
|
|
label="Service Status"
|
|
:width="120">
|
|
</el-table-column>
|
|
<el-table-column
|
|
prop="wellCreateTime"
|
|
label="Upload Time"
|
|
:width="170">
|
|
</el-table-column>
|
|
<el-table-column
|
|
prop="wellBeginTime"
|
|
label="Start Time"
|
|
:width="170">
|
|
</el-table-column>
|
|
|
|
<el-table-column
|
|
prop="wellEndTime"
|
|
label="End Time"
|
|
:width="170">
|
|
</el-table-column>
|
|
|
|
<el-table-column
|
|
prop="wellWorkTime"
|
|
label="Man-Hour Calculation"
|
|
:width="160">
|
|
</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>
|
|
<div v-show="if_show" style="text-align: center; width: 100%;;font-size: 14px;">
|
|
<el-tag type="warning" style="width: 100%;height: 50px;font-size: 14px;">The user does not have permission for this menu!</el-tag>
|
|
</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: [],
|
|
input:'',
|
|
currentPage: 1,
|
|
pagesize:50,
|
|
recordTotal:0,
|
|
date_value:[],
|
|
checked:false,
|
|
|
|
if_show0:false,
|
|
if_show:false,
|
|
|
|
checked1:false,
|
|
|
|
if_show_bt:1,
|
|
if_show_et:false,
|
|
}
|
|
},
|
|
mounted() {
|
|
|
|
if (localStorage.getItem("level")==4) {
|
|
this.$data.if_show = true;
|
|
return;
|
|
}
|
|
this.$data.if_show0= true;
|
|
|
|
var _this = this;
|
|
|
|
axios.post('/deescloud/get_page_setting', {
|
|
opuser:localStorage.getItem("online_user"),
|
|
opuser_uuid:localStorage.getItem("uuid"),
|
|
})
|
|
.then(function (response) {
|
|
if(response.data.r3=="1"){
|
|
_this.$data.if_show_bt=1;
|
|
//_this.$data.if_show_et=false;
|
|
}else if(response.data.r3=="2"){
|
|
//_this.$data.if_show_et=true;
|
|
_this.$data.if_show_bt=2;
|
|
}else if(response.data.r3=="3"){
|
|
//_this.$data.if_show_et=true;
|
|
_this.$data.if_show_bt=3;
|
|
}else{
|
|
_this.$data.if_show_bt=1;
|
|
}
|
|
})
|
|
.catch(function (error) {
|
|
console.log(error);
|
|
});
|
|
|
|
var objs;
|
|
axios.post('/deescloud/getMh_en', {
|
|
opuser:localStorage.getItem("online_user"),
|
|
opuser_uuid:localStorage.getItem("uuid"),
|
|
index: this.$data.currentPage,
|
|
count: this.$data.pagesize,
|
|
if_all:this.$data.checked,
|
|
checked:this.$data.checked1
|
|
})
|
|
.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: {
|
|
|
|
exportMh(){
|
|
document.getElementById("bt_export").blur();
|
|
|
|
var beginTime= '';
|
|
var endTime = '';
|
|
|
|
if (this.$data.date_value != null && this.$data.date_value.length > 1) {
|
|
console.log("len:",this.$data.date_value.length)
|
|
console.log("date_value:",this.$data.date_value);
|
|
beginTime = this.$data.date_value[0];
|
|
endTime = this.$data.date_value[1];
|
|
}
|
|
|
|
axios.post('deescloud/getMhCsv_en',{
|
|
opuser:localStorage.getItem("online_user"),
|
|
opuser_uuid:localStorage.getItem("uuid"),
|
|
wellname: this.$data.input,
|
|
beginTime:beginTime,
|
|
endTime:endTime,
|
|
if_all:this.$data.checked,
|
|
checked:this.$data.checked1
|
|
}
|
|
).then(function (response) {
|
|
console.log(response.data);
|
|
var fileid = response.data.fileId;
|
|
|
|
var downUrl = 'file/'+fileid;
|
|
downloadUrl("Working-time-Statics.csv",downUrl);
|
|
})
|
|
.catch(function (error) {
|
|
console.log(error);
|
|
});
|
|
},
|
|
|
|
getMh(_search_name){
|
|
document.getElementById("bt_serach").blur();
|
|
|
|
var beginTime= '';
|
|
var endTime = '';
|
|
|
|
if (this.$data.date_value != null && this.$data.date_value.length > 1) {
|
|
console.log("len:",this.$data.date_value.length)
|
|
console.log("date_value:",this.$data.date_value);
|
|
beginTime = this.$data.date_value[0];
|
|
endTime = this.$data.date_value[1];
|
|
}
|
|
|
|
this.$data.currentPage=1;
|
|
|
|
var _this = this;
|
|
|
|
var objs;
|
|
axios.post('/deescloud/getMh_en', {
|
|
opuser:localStorage.getItem("online_user"),
|
|
opuser_uuid:localStorage.getItem("uuid"),
|
|
id: _search_name,
|
|
beginTime:beginTime,
|
|
endTime:endTime,
|
|
index: this.$data.currentPage,
|
|
count: this.$data.pagesize,
|
|
if_all:this.$data.checked,
|
|
checked:this.$data.checked1
|
|
})
|
|
.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) {
|
|
var beginTime= '';
|
|
var endTime = '';
|
|
|
|
if (this.$data.date_value != null && this.$data.date_value.length > 1) {
|
|
console.log("len:",this.$data.date_value.length)
|
|
console.log("date_value:",this.$data.date_value);
|
|
beginTime = this.$data.date_value[0];
|
|
endTime = this.$data.date_value[1];
|
|
}
|
|
|
|
this.$data.pagesize = val;
|
|
|
|
var _this = this;
|
|
|
|
var objs;
|
|
axios.post('/deescloud/getMh_en', {
|
|
opuser:localStorage.getItem("online_user"),
|
|
opuser_uuid:localStorage.getItem("uuid"),
|
|
id: this.$data.input,
|
|
beginTime:beginTime,
|
|
endTime:endTime,
|
|
index: this.$data.currentPage,
|
|
count: this.$data.pagesize,
|
|
if_all:this.$data.checked,
|
|
checked:this.$data.checked1
|
|
})
|
|
.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) {
|
|
var beginTime= '';
|
|
var endTime = '';
|
|
|
|
if (this.$data.date_value != null && this.$data.date_value.length > 1) {
|
|
console.log("len:",this.$data.date_value.length)
|
|
console.log("date_value:",this.$data.date_value);
|
|
beginTime = this.$data.date_value[0];
|
|
endTime = this.$data.date_value[1];
|
|
}
|
|
|
|
this.$data.currentPage = val;
|
|
|
|
var _this = this;
|
|
|
|
var objs;
|
|
axios.post('/deescloud/getMh_en', {
|
|
opuser:localStorage.getItem("online_user"),
|
|
opuser_uuid:localStorage.getItem("uuid"),
|
|
id: this.$data.input,
|
|
beginTime:beginTime,
|
|
endTime:endTime,
|
|
index: this.$data.currentPage,
|
|
count: this.$data.pagesize,
|
|
if_all:this.$data.checked,
|
|
checked:this.$data.checked1
|
|
})
|
|
.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);
|
|
});
|
|
},
|
|
|
|
}
|
|
}
|
|
|