diff --git a/scripts/authinfo.js b/scripts/authinfo.js index 7cf09e2..53b9189 100644 --- a/scripts/authinfo.js +++ b/scripts/authinfo.js @@ -875,7 +875,7 @@ handleSizeChange(val) { this.$data.pagesize = val; - + this.$data.currentPage = 1; var _this = this; var objs; diff --git a/scripts/authinfoll.js b/scripts/authinfoll.js index a2d775a..a509472 100644 --- a/scripts/authinfoll.js +++ b/scripts/authinfoll.js @@ -209,7 +209,7 @@ this.$data.pagesize = val; var _this = this; - + this.$data.currentPage = 1; var objs; axios.post('/deescloud/getAuthHisPos', { opuser:localStorage.getItem("online_user"), diff --git a/scripts/cmp-en.js b/scripts/cmp-en.js index 4b3c63f..86dc944 100644 --- a/scripts/cmp-en.js +++ b/scripts/cmp-en.js @@ -455,7 +455,7 @@ handleSizeChange(val) { //console.log(`每页 ${val} 条`); this.$data.pagesize = val; - + this.$data.currentPage = 1; var _this = this; var objs; diff --git a/scripts/cmp.js b/scripts/cmp.js index 36f47f1..19bd96e 100644 --- a/scripts/cmp.js +++ b/scripts/cmp.js @@ -455,7 +455,7 @@ handleSizeChange(val) { //console.log(`每页 ${val} 条`); this.$data.pagesize = val; - + this.$data.currentPage = 1; var _this = this; var objs; diff --git a/scripts/dev-en.js b/scripts/dev-en.js index 17d366d..732fc81 100644 --- a/scripts/dev-en.js +++ b/scripts/dev-en.js @@ -1,881 +1,1203 @@ -//组件 - var devcomponent_en = { - template:` -
-
- - Search - Add - -
-
- - - - - - - - - - - - - - -
-
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Cancel - Ok - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Cancel - Ok - - -
- `, - data(){ - // 获取当前屏幕的分辨率 - let screenW = window.screen.width; - let screenH = window.innerHeight; - console.log("screen width:",screenW); - console.log("screen height:",screenH); - return { - tHeight:screenH-192, - tHeight1:screenH*0.5, - tableData: Array(0), - input:'', - currentPage: 1, - pagesize:50, - recordTotal:0, - - pdf_visible:false, - dev_tableData:[], - - wellnames:[], - - add_visible:false, - update_visible:false, - - form: { - id:0, - wellname:'', - sid:'', - iid:'', - ver: '', - p_date:'', - cal_date:'', - total_wt:'', - cur_wt:'', - repair_cnt:'', - region:'', - location:'', - responsible:'' - }, - - rules: { - wellname: [ - { required: true, message: 'Well name cannot be empty', trigger: 'blur' } - ], - sid: [ - { required: true, message: 'The series number cannot be empty', trigger: 'blur' } - ], - iid: [ - { required: true, message: 'The serial number cannot be empty', trigger: 'blur' } - ], - }, - - if_show_bt:true, - if_show_et:false, - ps_info:'', - } - }, - mounted() { - 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.ps_info = response.data; - _this.$data.if_show_bt=true; - _this.$data.if_show_et=false; - }else{ - _this.$data.if_show_et=true; - _this.$data.if_show_bt=false; - } - }) - .catch(function (error) { - console.log(error); - }); - - var objs; - axios.post('/deescloud/get_well_dev', { - 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: { - remove_dev_m(row){ - var _this = this; - - var r; - axios.post('/deescloud/remove_dev_manage', { - opuser:localStorage.getItem("online_user"), - opuser_uuid:localStorage.getItem("uuid"), - data:{ - id: row.id - } - }) - .then(function (response) { - console.log(response.data); - r = response.data.r; - if (r==0){ - axios.post('/deescloud/get_dev_manage', { - opuser:localStorage.getItem("online_user"), - opuser_uuid:localStorage.getItem("uuid"), - wellname: row.wellname, - }) - .then(function (response) { - console.log(response.data); - _this.$data.dev_tableData = response.data.data; - }) - .catch(function (error) { - console.log(error); - }); - - _this.$message({ - message: "delete successful", - type: "success", - duration: 1500 - }); - }else{ - _this.$message({ - message: "delete failed", - type: "error", - duration: 1500 - }); - } - - }) - .catch(function (error) { - console.log(error); - }); - }, - update_dev_manage(){ - this.$refs['bform'].validate((valid) => { - if (valid) { - var _this = this; - - var r; - axios.post('/deescloud/update_dev_manage', { - opuser:localStorage.getItem("online_user"), - opuser_uuid:localStorage.getItem("uuid"), - data:{ - id:_this.$data.form.id, - wellname:_this.$data.form.wellname, - sid:_this.$data.form.sid, - iid:_this.$data.form.iid, - ver: _this.$data.form.ver, - p_date:_this.$data.form.p_date, - cal_date:_this.$data.form.cal_date, - total_wt:_this.$data.form.total_wt, - cur_wt:_this.$data.form.cur_wt, - repair_cnt:_this.$data.form.repair_cnt, - region:_this.$data.form.region, - location:_this.$data.form.location, - responsible:_this.$data.form.responsible - } - }) - .then(function (response) { - console.log(response.data); - r = response.data.r; - if (r==0){ - axios.post('/deescloud/get_dev_manage', { - opuser:localStorage.getItem("online_user"), - opuser_uuid:localStorage.getItem("uuid"), - wellname: _this.$data.form.wellname, - }) - .then(function (response) { - console.log(response.data); - _this.$data.dev_tableData = response.data.data; - }) - .catch(function (error) { - console.log(error); - }); - - _this.$message({ - message: "update successful", - type: "success", - duration: 1500 - }); - }else{ - _this.$message({ - message: "update failed", - type: "error", - duration: 1500 - }); - } - - _this.$data.update_visible=false; - }) - .catch(function (error) { - console.log(error); - }); - }}) - }, - update_dev_m_dialog(row){ - this.$data.form.id=row.id; - console.log("wellname",row.wellname); - this.$data.form.wellname=row.wellname; - this.$data.form.sid=row.sid; - this.$data.form.iid=row.iid; - this.$data.form.ver= row.ver; - if(this.$data.ps_info.r3=="1"){ - this.$data.form.p_date=row.p_date; - this.$data.form.cal_date=row.cal_date; - }else{ - if (row.p_date.length>=10){ - var arr = row.p_date.split("-") - var t = arr[2]+"-"+arr[0]+"-"+arr[1]; - console.log(t); - this.$data.form.p_date=t; - } - - if (row.cal_date.length>=10){ - var arr = row.p_date.split("-") - var t = arr[2]+"-"+arr[0]+"-"+arr[1]; - console.log(t); - this.$data.form.cal_date=t; - } - } - - //this.$data.form.p_date=row.p_date; - //this.$data.form.cal_date=row.cal_date; - this.$data.form.total_wt=row.total_wt; - this.$data.form.cur_wt=row.cur_wt; - this.$data.form.repair_cnt=row.repair_cnt; - this.$data.form.region=row.region; - this.$data.form.location=row.location; - this.$data.form.responsible=row.responsible; - - this.$nextTick(() => { - this.$refs['bform'].clearValidate() - }); - this.$data.update_visible=true; - }, - add_dev_manage(){ - this.$refs['bform'].validate((valid) => { - if (valid) { - var _this = this; - - var r; - axios.post('/deescloud/add_dev_manage', { - opuser:localStorage.getItem("online_user"), - opuser_uuid:localStorage.getItem("uuid"), - data:{ - wellname:_this.$data.form.wellname, - sid:_this.$data.form.sid, - iid:_this.$data.form.iid, - ver: _this.$data.form.ver, - p_date:_this.$data.form.p_date, - cal_date:_this.$data.form.cal_date, - total_wt:_this.$data.form.total_wt, - cur_wt:_this.$data.form.cur_wt, - repair_cnt:_this.$data.form.repair_cnt, - region:_this.$data.form.region, - location:_this.$data.form.location, - responsible:_this.$data.form.responsible - } - }) - .then(function (response) { - console.log(response.data); - r = response.data.r; - if (r==0){ - _this.$message({ - message: "add successful", - type: "success", - duration: 1500 - }); - }else{ - _this.$message({ - message: "add failed", - type: "error", - duration: 1500 - }); - } - - _this.$data.add_visible=false; - }) - .catch(function (error) { - console.log(error); - }); - }}) - }, - add_dev_manage_dialog(){ - document.getElementById("bt_add").blur(); - - this.$data.form.wellname=''; - this.$data.form.sid=''; - this.$data.form.iid=''; - this.$data.form.ver= ''; - this.$data.form.p_date=''; - this.$data.form.cal_date=''; - this.$data.form.total_wt=''; - this.$data.form.cur_wt=''; - this.$data.form.repair_cnt=''; - this.$data.form.region=''; - this.$data.form.location=''; - this.$data.form.responsible=''; - - var _this = this; - axios.post('/deescloud/getWellNames',{ - opuser:localStorage.getItem("online_user"), - opuser_uuid:localStorage.getItem("uuid"), - }) - .then(function (response) { - console.log(response.data); - _this.$data.wellnames = response.data; - }) - .catch(function (error) { - console.log(error); - }); - - this.$nextTick(() => { - this.$refs['bform'].clearValidate() - }); - this.$data.add_visible=true; - }, - export_pdf(row){ - var _this = this; - - axios.post('deescloud/get_dev_manage_pdf_en',{ - opuser:localStorage.getItem("online_user"), - opuser_uuid:localStorage.getItem("uuid"), - wellname: row.wellNameSource - }, - ).then(function (response) { - console.log(response.data); - var fileid = response.data.fileId; - - var downUrl = 'file/'+fileid; - downloadUrl(row.wellNameSource+"-Equipment Asset Management Report.pdf",downUrl); - }) - .catch(function (error) { - console.log(error); - }); - }, - show_pdf(row){ - let _this= this; - axios.post('/deescloud/get_dev_manage', { - opuser:localStorage.getItem("online_user"), - opuser_uuid:localStorage.getItem("uuid"), - wellname: row.wellNameSource, - }) - .then(function (response) { - console.log(response.data); - _this.$data.dev_tableData = response.data.data; - _this.$data.pdf_visible = true; - }) - .catch(function (error) { - console.log(error); - }); - }, - getWell(_search_name){ - - document.getElementById("bt_serach").blur(); +var devcomponent_en = { + template: ` +
+ +
+ + Well + Instrument + - this.$data.currentPage=1; + +
+ + Search + Add +
- var _this = this; + +
+ + + + +
- var objs; - axios.post('/deescloud/get_well_dev', { - 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_dev', { - 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_dev', { - 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); - }); - - }, - - } - } - \ No newline at end of file + +
+ + + + + + + + + + + + +
+ + +
+ Search + Download Instrument List + Download Well +
+
+ + +
+ + + + + + + + + + + + + + + +
+ + +
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Cancel + OK + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Cancel + OK + + +
+ `, + data() { + let screenW = window.screen.width; + let screenH = window.innerHeight; + console.log("screen width:", screenW); + console.log("screen height:", screenH); + return { + tHeight1: screenH * 0.5, + tableData: [], + input: '', + currentPage: 1, + pagesize: 50, + recordTotal: 0, + radio1: '1', + + devListTableData: [], + devSearchForm: { + sid: [], + iid: [], + wellname: '', + wellnameList: [], + engineerList: [], + in_time_start: '', + in_time_end: '' + }, + devSidOptions: [], + devIidOptions: [], + devWellnameOptions: [], + devEngineerOptions: [], + + devCurrentPage: 1, + devPagesize: 50, + devRecordTotal: 0, + + pdf_visible: false, + dev_tableData: [], + + wellnames: [], + + add_visible: false, + update_visible: false, + + form: { + id: 0, + wellname: '', + sid: '', + iid: '', + ver: '', + p_date: '', + cal_date: '', + total_wt: '', + cur_wt: '', + repair_cnt: '', + region: '', + location: '', + responsible: '' + }, + + rules: { + wellname: [ + { required: true, message: 'Well name cannot be empty', trigger: 'blur' } + ], + sid: [ + { required: true, message: 'Series number cannot be empty', trigger: 'blur' } + ], + iid: [ + { required: true, message: 'Serial number cannot be empty', trigger: 'blur' } + ], + }, + + if_show_bt: true, + if_show_et: false, + ps_info: '', + + startTimeOptions: { + disabledDate: (time) => { + if (this.devSearchForm.in_time_end) { + return time.getTime() > new Date(this.devSearchForm.in_time_end).getTime(); + } + return false; + } + }, + endTimeOptions: { + disabledDate: (time) => { + if (this.devSearchForm.in_time_start) { + return time.getTime() < new Date(this.devSearchForm.in_time_start).getTime(); + } + return false; + } + }, + } + }, + mounted() { + var _this = this; + + this.getQueryWellData(); + this.getWell(); + + 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.ps_info = response.data; + _this.$data.if_show_bt = true; + _this.$data.if_show_et = false; + } else { + _this.$data.if_show_et = true; + _this.$data.if_show_bt = false; + } + }) + .catch(function (error) { + console.log(error); + }); + + this.getDevFilterOptions(); + this.getWell(''); + }, + methods: { + getQueryWellData() { + var _this = this; + axios.post('/deescloud/getQueryWell', { + opuser: localStorage.getItem("online_user"), + opuser_uuid: localStorage.getItem("uuid") + }) + .then(function (response) { + console.log("getQueryWell response:", response.data); + if (response.data && response.data.code === 0 && response.data.data) { + const data = response.data.data; + if (data.wellNames && Array.isArray(data.wellNames)) { + _this.devWellnameOptions = data.wellNames.map(name => ({ + value: name, + label: name + })); + } + if (data.series && Array.isArray(data.series)) { + _this.devSidOptions = data.series.map(sid => ({ + value: sid, + label: sid + })); + } + if (data.instruments && Array.isArray(data.instruments)) { + _this.devIidOptions = data.instruments.map(inst => ({ + value: inst, + label: inst + })); + } + if (data.engineers && Array.isArray(data.engineers)) { + _this.devEngineerOptions = data.engineers.map(engineer => ({ + value: engineer, + label: engineer + })); + } + } + }) + .catch(function (error) { + console.error("getQueryWell request failed:", error); + }); + }, + + radio_change() { + console.log(this.$data.radio1); + if (this.$data.radio1 == '2') { + this.getDevList(); + } + }, + + getDevList() { + if (this.devSearchForm.in_time_start && this.devSearchForm.in_time_end) { + if (new Date(this.devSearchForm.in_time_end) < new Date(this.devSearchForm.in_time_start)) { + this.$message({ + message: "End time cannot be earlier than start time", + type: "warning", + duration: 2000 + }); + return; + } + } + + var _this = this; + + axios.post('/deescloud/get_dev_list', { + opuser: localStorage.getItem("online_user"), + opuser_uuid: localStorage.getItem("uuid"), + serial: this.$data.devSearchForm.sid, + number: this.$data.devSearchForm.iid, + wellname: this.$data.devSearchForm.wellnameList, + engineer: this.$data.devSearchForm.engineerList, + in_time_start: this.$data.devSearchForm.in_time_start, + in_time_end: this.$data.devSearchForm.in_time_end, + index: this.$data.devCurrentPage, + count: this.$data.devPagesize + }) + .then(function (response) { + console.log(response.data); + if (response.data && response.data.data) { + _this.$data.devListTableData = (response.data.data || []).map(function(item) { + var sid = item.sid != null ? item.sid : (item.serial != null ? item.serial : ''); + var iid = item.iid != null ? item.iid : (item.number != null ? item.number : ''); + var durationCurrent = item.duration_current != null ? item.duration_current : (item.current_work_time != null ? item.current_work_time : ''); + var durationTotal = item.duration_total != null ? item.duration_total : (item.total_work_time != null ? item.total_work_time : ''); + var instrumentName = item.instrument_name != null ? item.instrument_name : (item.product_name != null ? item.product_name : ''); + return Object.assign({}, item, { + sid: sid, + iid: iid, + duration_current: durationCurrent, + duration_total: durationTotal, + instrument_name: instrumentName + }); + }); + _this.$data.devRecordTotal = response.data.total || 0; + } + }) + .catch(function (error) { + console.log(error); + }); + }, + + handleDevSizeChange(val) { + this.$data.devPagesize = val; + this.$data.devCurrentPage = 1; + this.getDevList(); + }, + + handleDevCurrentChange(val) { + this.$data.devCurrentPage = val; + this.getDevList(); + }, + + exportSeirDetail() { + if (this.devSearchForm.in_time_start && this.devSearchForm.in_time_end) { + if (new Date(this.devSearchForm.in_time_end) < new Date(this.devSearchForm.in_time_start)) { + this.$message({ + message: "End time cannot be earlier than start time", + type: "warning", + duration: 2000 + }); + return; + } + } + + axios.post('/deescloud/export_Seir_detail_en', { + opuser: localStorage.getItem("online_user"), + opuser_uuid: localStorage.getItem("uuid"), + serial: this.devSearchForm.sid, + number: this.devSearchForm.iid, + wellname: this.devSearchForm.wellnameList, + engineer: this.devSearchForm.engineerList, + in_time_start: this.devSearchForm.in_time_start, + in_time_end: this.devSearchForm.in_time_end, + index: this.devCurrentPage, + count: this.devPagesize + }) + .then(response => { + console.log("Export instrument detail response:", response.data); + if (response.data && response.data.code === 1) { + this.$message({ + message: response.data.msg || "Export failed", + type: "error", + duration: 2000 + }); + return; + } + if (response.data && response.data.fileId) { + const fileid = response.data.fileId; + const downUrl = 'file/' + fileid; + downloadUrl("Instrument Detail Data.xlsx", downUrl); + } else { + this.$message({ + message: "Export failed: File not obtained", + type: "error", + duration: 2000 + }); + } + }) + .catch(error => { + console.error("Export instrument detail error:", error); + this.$message({ + message: "Export request failed", + type: "error", + duration: 2000 + }); + }); + }, + + exportWellDetail() { + var _this = this; + if (this.devSearchForm.in_time_start && this.devSearchForm.in_time_end) { + if (new Date(this.devSearchForm.in_time_end) < new Date(this.devSearchForm.in_time_start)) { + this.$message({ + message: "End time cannot be earlier than start time", + type: "warning", + duration: 2000 + }); + return; + } + } + + axios.post('/deescloud/export_Well_detail_en', { + opuser: localStorage.getItem("online_user"), + opuser_uuid: localStorage.getItem("uuid"), + serial: this.devSearchForm.sid, + number: this.devSearchForm.iid, + wellname: this.devSearchForm.wellnameList, + engineer: this.devSearchForm.engineerList, + in_time_start: this.devSearchForm.in_time_start, + in_time_end: this.devSearchForm.in_time_end, + index: this.devCurrentPage, + count: this.devPagesize + }) + .then(response => { + console.log("Export well detail response:", response.data); + if (response.data && response.data.code === 1) { + _this.$message({ + message: response.data.msg || "Export failed", + type: "error", + duration: 2000 + }); + return; + } + if (response.data && response.data.fileId) { + const fileid = response.data.fileId; + const downUrl = 'file/' + fileid; + downloadUrl("Well Detail Data.xlsx", downUrl); + } else { + _this.$message({ + message: "Export failed: File not obtained", + type: "error", + duration: 2000 + }); + } + }) + .catch(error => { + console.error("Export well detail error:", error); + _this.$message({ + message: "Export request failed", + type: "error", + duration: 2000 + }); + }); + }, + + remove_dev_m(row) { + var _this = this; + var r; + axios.post('/deescloud/remove_dev_manage', { + opuser: localStorage.getItem("online_user"), + opuser_uuid: localStorage.getItem("uuid"), + data: { id: row.id } + }) + .then(function (response) { + console.log(response.data); + r = response.data.r; + if (r == 0) { + axios.post('/deescloud/get_dev_manage', { + opuser: localStorage.getItem("online_user"), + opuser_uuid: localStorage.getItem("uuid"), + wellname: row.wellname, + }) + .then(function (response) { + console.log(response.data); + _this.$data.dev_tableData = response.data.data; + }) + .catch(function (error) { + console.log(error); + }); + _this.$message({ + message: "Delete successful", + type: "success", + duration: 1500 + }); + } else { + _this.$message({ + message: "Delete failed", + type: "error", + duration: 1500 + }); + } + }) + .catch(function (error) { + console.log(error); + }); + }, + + update_dev_manage() { + this.$refs['bform'].validate((valid) => { + if (valid) { + var _this = this; + var r; + axios.post('/deescloud/update_dev_manage', { + opuser: localStorage.getItem("online_user"), + opuser_uuid: localStorage.getItem("uuid"), + data: { + id: _this.$data.form.id, + wellname: _this.$data.form.wellname, + sid: _this.$data.form.sid, + iid: _this.$data.form.iid, + ver: _this.$data.form.ver, + p_date: _this.$data.form.p_date, + cal_date: _this.$data.form.cal_date, + total_wt: _this.$data.form.total_wt, + cur_wt: _this.$data.form.cur_wt, + repair_cnt: _this.$data.form.repair_cnt, + region: _this.$data.form.region, + location: _this.$data.form.location, + responsible: _this.$data.form.responsible + } + }) + .then(function (response) { + console.log(response.data); + r = response.data.r; + if (r == 0) { + axios.post('/deescloud/get_dev_manage', { + opuser: localStorage.getItem("online_user"), + opuser_uuid: localStorage.getItem("uuid"), + wellname: _this.$data.form.wellname, + }) + .then(function (response) { + console.log(response.data); + _this.$data.dev_tableData = response.data.data; + }) + .catch(function (error) { + console.log(error); + }); + _this.$message({ + message: "Update successful", + type: "success", + duration: 1500 + }); + } else { + _this.$message({ + message: "Update failed", + type: "error", + duration: 1500 + }); + } + _this.$data.update_visible = false; + }) + .catch(function (error) { + console.log(error); + }); + } + }); + }, + + update_dev_m_dialog(row) { + this.$data.form.id = row.id; + console.log("wellname", row.wellname); + this.$data.form.wellname = row.wellname; + this.$data.form.sid = row.sid; + this.$data.form.iid = row.iid; + this.$data.form.ver = row.ver; + + if (this.$data.ps_info.r3 == "1") { + this.$data.form.p_date = row.p_date; + this.$data.form.cal_date = row.cal_date; + } else { + if (row.p_date && row.p_date.length >= 10) { + var arr = row.p_date.split("-"); + var t = arr[2] + "-" + arr[0] + "-" + arr[1]; + console.log(t); + this.$data.form.p_date = t; + } + if (row.cal_date && row.cal_date.length >= 10) { + var arr = row.cal_date.split("-"); + var t = arr[2] + "-" + arr[0] + "-" + arr[1]; + console.log(t); + this.$data.form.cal_date = t; + } + } + + this.$data.form.total_wt = row.total_wt; + this.$data.form.cur_wt = row.cur_wt; + this.$data.form.repair_cnt = row.repair_cnt; + this.$data.form.region = row.region; + this.$data.form.location = row.location; + this.$data.form.responsible = row.responsible; + + this.$nextTick(() => { + this.$refs['bform'].clearValidate() + }); + this.$data.update_visible = true; + }, + + add_dev_manage() { + this.$refs['bform'].validate((valid) => { + if (valid) { + var _this = this; + var r; + axios.post('/deescloud/add_dev_manage', { + opuser: localStorage.getItem("online_user"), + opuser_uuid: localStorage.getItem("uuid"), + data: { + wellname: _this.$data.form.wellname, + sid: _this.$data.form.sid, + iid: _this.$data.form.iid, + ver: _this.$data.form.ver, + p_date: _this.$data.form.p_date, + cal_date: _this.$data.form.cal_date, + total_wt: _this.$data.form.total_wt, + cur_wt: _this.$data.form.cur_wt, + repair_cnt: _this.$data.form.repair_cnt, + region: _this.$data.form.region, + location: _this.$data.form.location, + responsible: _this.$data.form.responsible + } + }) + .then(function (response) { + console.log(response.data); + r = response.data.r; + if (r == 0) { + _this.$message({ + message: "Add successful", + type: "success", + duration: 1500 + }); + } else { + _this.$message({ + message: "Add failed", + type: "error", + duration: 1500 + }); + } + _this.$data.add_visible = false; + }) + .catch(function (error) { + console.log(error); + }); + } + }); + }, + + add_dev_manage_dialog() { + document.getElementById("bt_add").blur(); + + this.$data.form.wellname = ''; + this.$data.form.sid = ''; + this.$data.form.iid = ''; + this.$data.form.ver = ''; + this.$data.form.p_date = ''; + this.$data.form.cal_date = ''; + this.$data.form.total_wt = ''; + this.$data.form.cur_wt = ''; + this.$data.form.repair_cnt = ''; + this.$data.form.region = ''; + this.$data.form.location = ''; + this.$data.form.responsible = ''; + + var _this = this; + axios.post('/deescloud/getWellNames', { + opuser: localStorage.getItem("online_user"), + opuser_uuid: localStorage.getItem("uuid"), + }) + .then(function (response) { + console.log(response.data); + _this.$data.wellnames = response.data; + }) + .catch(function (error) { + console.log(error); + }); + + this.$nextTick(() => { + this.$refs['bform'].clearValidate() + }); + this.$data.add_visible = true; + }, + + export_pdf(row) { + var _this = this; + axios.post('deescloud/get_dev_manage_pdf_en', { + opuser: localStorage.getItem("online_user"), + opuser_uuid: localStorage.getItem("uuid"), + wellname: row.wellNameSource + }) + .then(function (response) { + console.log(response.data); + var fileid = response.data.fileId; + var downUrl = 'file/' + fileid; + downloadUrl(row.wellNameSource + "-Equipment Asset Management Report.pdf", downUrl); + }) + .catch(function (error) { + console.log(error); + }); + }, + + show_pdf(row) { + let _this = this; + axios.post('/deescloud/get_dev_manage', { + opuser: localStorage.getItem("online_user"), + opuser_uuid: localStorage.getItem("uuid"), + wellname: row.wellNameSource, + }) + .then(function (response) { + console.log(response.data); + _this.$data.dev_tableData = 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_dev', { + 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) { + this.$data.pagesize = val; + this.$data.currentPage = 1; + var _this = this; + var objs; + axios.post('/deescloud/get_well_dev', { + 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) { + this.$data.currentPage = val; + var _this = this; + var objs; + axios.post('/deescloud/get_well_dev', { + 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); + }); + }, + } +} \ No newline at end of file diff --git a/scripts/dev.js b/scripts/dev.js index 0e8f8b0..3f574e6 100644 --- a/scripts/dev.js +++ b/scripts/dev.js @@ -2,13 +2,58 @@ var devcomponent = { template:`
-
- - 搜索 - 新增 - +
+ + 井位 + 设备 + + +
+ + 搜索 + 新增 +
+ +
+ + + + + +
+ + +
+ + + + + + + + + + + + + 搜索 + 导出仪器明细 + 导出井位明细 +
-
+
-
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
- - + @@ -384,8 +505,7 @@ value-format="yyyy-MM-dd"> - - + @@ -448,6 +568,28 @@ currentPage: 1, pagesize:50, recordTotal:0, + radio1:'1', + + // 设备列表相关数据 + devListTableData: [], + devSearchForm: { + sid: [], + iid: [], + wellname: '', + wellnameList: [], + engineerList: [], + in_time_start: '', + in_time_end: '' + }, + // 设备筛选下拉选项 + devSidOptions: [], + devIidOptions: [], + devWellnameOptions: [], + devEngineerOptions: [], + + devCurrentPage: 1, + devPagesize: 50, + devRecordTotal: 0, pdf_visible:false, dev_tableData:[], @@ -488,11 +630,32 @@ if_show_bt:true, if_show_et:false, ps_info:'', + + // 日期选择器配置 + startTimeOptions: { + disabledDate: (time) => { + if (this.devSearchForm.in_time_end) { + return time.getTime() > new Date(this.devSearchForm.in_time_end).getTime(); + } + return false; + } + }, + endTimeOptions: { + disabledDate: (time) => { + if (this.devSearchForm.in_time_start) { + return time.getTime() < new Date(this.devSearchForm.in_time_start).getTime(); + } + return false; + } + }, } }, mounted() { var _this = this; + this.getQueryWellData(); + this.getWell(); + axios.post('/deescloud/get_page_setting', { opuser:localStorage.getItem("online_user"), opuser_uuid:localStorage.getItem("uuid"), @@ -511,83 +674,402 @@ console.log(error); }); - var objs; - axios.post('/deescloud/get_well_dev', { + // 获取设备筛选选项 + this.getDevFilterOptions(); + + // 初始加载时自动执行查询,传入空字符串以获取所有数据或默认数据 + // 直接调用,不依赖 nextTick,因为 axios 请求不依赖 DOM 渲染 + this.getWell(''); + }, + methods: { + getQueryWellData() { + var _this = this; + axios.post('/deescloud/getQueryWell', { + opuser: localStorage.getItem("online_user"), + opuser_uuid: localStorage.getItem("uuid") + }) + .then(function (response) { + console.log("getQueryWell 响应参数:", response.data); + if (response.data && response.data.code === 0 && response.data.data) { + const data = response.data.data; + // 映射井名称选项 + if (data.wellNames && Array.isArray(data.wellNames)) { + _this.devWellnameOptions = data.wellNames.map(name => ({ + value: name, + label: name + })); + } + // 映射系列号选项 + if (data.series && Array.isArray(data.series)) { + _this.devSidOptions = data.series.map(sid => ({ + value: sid, + label: sid + })); + } + // 映射编号/仪器选项 + if (data.instruments && Array.isArray(data.instruments)) { + _this.devIidOptions = data.instruments.map(inst => ({ + value: inst, + label: inst + })); + } + // 映射工程师选项 + if (data.engineers && Array.isArray(data.engineers)) { + _this.devEngineerOptions = data.engineers.map(engineer => ({ + value: engineer, + label: engineer + })); + } + // 注意:locations 目前前端模板中没有对应的 select 绑定变量, + // 如果后续需要添加所在地和工程师的下拉筛选,需先在 data 中定义对应 options 变量并在模板中添加 el-select + } + }) + .catch(function (error) { + console.error("getQueryWell 请求失败:", error); + }); + }, + + radio_change(){ + console.log(this.$data.radio1); + // 切换到设备页签时,可以自动加载一次数据,或者依赖用户点击搜索 + if(this.$data.radio1 == '2') { + this.getDevList(); + } + }, + // 获取设备列表 + getDevList() { + // 校验时间范围 + if (this.devSearchForm.in_time_start && this.devSearchForm.in_time_end) { + if (new Date(this.devSearchForm.in_time_end) < new Date(this.devSearchForm.in_time_start)) { + this.$message({ + message: "结束时间不能早于开始时间", + type: "warning", + duration: 2000 + }); + return; + } + } + + var _this = this; + + axios.post('/deescloud/get_dev_list', { + opuser: localStorage.getItem("online_user"), // 操作用户 + opuser_uuid: localStorage.getItem("uuid"), // 用户UUID + serial: this.$data.devSearchForm.sid, // 系列号筛选条件 + number: this.$data.devSearchForm.iid, // 编号筛选条件 + wellname: this.$data.devSearchForm.wellnameList, // 井名称筛选条件,使用用户选择的列表 + engineer: this.$data.devSearchForm.engineerList, // 仪器工程师筛选条件 + in_time_start: this.$data.devSearchForm.in_time_start, // 入井开始时间筛选条件 + in_time_end: this.$data.devSearchForm.in_time_end, // 入井结束时间筛选条件 + index: this.$data.devCurrentPage, // 当前页码 + count: this.$data.devPagesize // 每页数量 + }) + .then(function (response) { + console.log(response.data); + if(response.data && response.data.data) { + // 兼容后端字段命名差异,统一映射到前端表格使用的字段 + _this.$data.devListTableData = (response.data.data || []).map(function(item) { + var sid = item.sid != null ? item.sid : (item.serial != null ? item.serial : ''); + var iid = item.iid != null ? item.iid : (item.number != null ? item.number : ''); + var durationCurrent = item.duration_current != null ? item.duration_current : (item.current_work_time != null ? item.current_work_time : ''); + var durationTotal = item.duration_total != null ? item.duration_total : (item.total_work_time != null ? item.total_work_time : ''); + // 兼容 product_name 到 instrument_name + var instrumentName = item.instrument_name != null ? item.instrument_name : (item.product_name != null ? item.product_name : ''); + return Object.assign({}, item, { + sid: sid, + iid: iid, + duration_current: durationCurrent, + duration_total: durationTotal, + instrument_name: instrumentName + }); + }); + _this.$data.devRecordTotal = response.data.total || 0; + } + }) + .catch(function (error) { + console.log(error); + }); + }, + handleDevSizeChange(val) { + this.$data.devPagesize = val; + this.$data.devCurrentPage = 1; + this.getDevList(); + }, + handleDevCurrentChange(val) { + this.$data.devCurrentPage = val; + this.getDevList(); + }, + + exportSeirDetail() { + // 校验时间范围 + if (this.devSearchForm.in_time_start && this.devSearchForm.in_time_end) { + if (new Date(this.devSearchForm.in_time_end) < new Date(this.devSearchForm.in_time_start)) { + this.$message({ + message: "结束时间不能早于开始时间", + type: "warning", + duration: 2000 + }); + return; + } + } + + // 调用导出接口,参数与 getDevList 一致 + axios.post('/deescloud/export_Seir_detail', { + opuser: localStorage.getItem("online_user"), + opuser_uuid: localStorage.getItem("uuid"), + serial: this.devSearchForm.sid, + number: this.devSearchForm.iid, + wellname: this.devSearchForm.wellnameList, + engineer: this.devSearchForm.engineerList, + in_time_start: this.devSearchForm.in_time_start, + in_time_end: this.devSearchForm.in_time_end, + index: this.devCurrentPage, + count: this.devPagesize + }) + .then(response => { + console.log("导出井位明细响应:", response.data); + + // 判断返回码 + if (response.data && response.data.code === 1) { + // 当 code=1 时,显示错误信息 + this.$message({ + message: response.data.msg || "导出失败", + type: "error", + duration: 2000 + }); + return; + } + + // code 不为 1 时,正常处理文件下载 + if (response.data && response.data.fileId) { + const fileid = response.data.fileId; + const downUrl = 'file/' + fileid; + downloadUrl("井上仪器明细清单(按仪器查询).xlsx", downUrl); + } else { + this.$message({ + message: "导出失败:未获取到文件", + type: "error", + duration: 2000 + }); + } + }) + .catch(error => { + console.error("导出井位明细错误:", error); + this.$message({ + message: "导出请求失败", + type: "error", + duration: 2000 + }); + }); + }, + + exportWellDetail() { + var _this = this; + // 调用导出接口,参数与 getDevList 一致,支持多选井名 + axios.post('/deescloud/export_Well_detail', { + opuser: localStorage.getItem("online_user"), + opuser_uuid: localStorage.getItem("uuid"), + serial: this.devSearchForm.sid, + number: this.devSearchForm.iid, + wellname: this.devSearchForm.wellnameList, + engineer: this.devSearchForm.engineerList, + in_time_start: this.devSearchForm.in_time_start, + in_time_end: this.devSearchForm.in_time_end, + index: this.devCurrentPage, + count: this.devPagesize + }) + .then(response => { + console.log("导出井位明细响应:", response.data); + // 增加 code=1 的错误处理 + if (response.data && response.data.code === 1) { + _this.$message({ + message: response.data.msg || "导出失败", + type: "error", + duration: 2000 + }); + return; + } + if (response.data && response.data.fileId) { + const fileid = response.data.fileId; + const downUrl = 'file/' + fileid; + downloadUrl("井上仪器明细清单(按井位查询).xlsx", downUrl); + } else { + _this.$message({ + message: "导出失败:未获取到文件", + type: "error", + duration: 2000 + }); + } + }) + .catch(error => { + console.error("导出井位明细错误:", error); + _this.$message({ + message: "导出请求失败", + type: "error", + duration: 2000 + }); + }); + }, + + remove_dev_m(row){ + var _this = this; + + var r; + axios.post('/deescloud/remove_dev_manage', { 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; + data:{ + id: row.id + } + }) + .then(function (response) { + console.log(response.data); + r = response.data.r; + if (r==0){ + axios.post('/deescloud/get_dev_manage', { + opuser:localStorage.getItem("online_user"), + opuser_uuid:localStorage.getItem("uuid"), + wellname: row.wellname, + }) + .then(function (response) { + console.log(response.data); + _this.$data.dev_tableData = response.data.data; + }) + .catch(function (error) { + console.log(error); + }); + + _this.$message({ + message: "删除成功", + type: "success", + duration: 1500 + }); + }else{ + _this.$message({ + message: "删除失败", + type: "error", + duration: 1500 + }); + } - }) - .catch(function (error) { - console.log(error); - }); + }) + .catch(function (error) { + console.log(error); + }); }, - methods: { - remove_dev_m(row){ + update_dev_manage(){ + this.$refs['bform'].validate((valid) => { + if (valid) { var _this = this; var r; - axios.post('/deescloud/remove_dev_manage', { + axios.post('/deescloud/update_dev_manage', { opuser:localStorage.getItem("online_user"), opuser_uuid:localStorage.getItem("uuid"), data:{ - id: row.id + id:_this.$data.form.id, + wellname:_this.$data.form.wellname, + sid:_this.$data.form.sid, + iid:_this.$data.form.iid, + ver: _this.$data.form.ver, + p_date:_this.$data.form.p_date, + cal_date:_this.$data.form.cal_date, + total_wt:_this.$data.form.total_wt, + cur_wt:_this.$data.form.cur_wt, + repair_cnt:_this.$data.form.repair_cnt, + region:_this.$data.form.region, + location:_this.$data.form.location, + responsible:_this.$data.form.responsible } - }) - .then(function (response) { - console.log(response.data); + }) + .then(function (response) { + console.log(response.data); r = response.data.r; if (r==0){ axios.post('/deescloud/get_dev_manage', { opuser:localStorage.getItem("online_user"), opuser_uuid:localStorage.getItem("uuid"), - wellname: row.wellname, - }) - .then(function (response) { + wellname: _this.$data.form.wellname, + }) + .then(function (response) { console.log(response.data); _this.$data.dev_tableData = response.data.data; - }) - .catch(function (error) { + }) + .catch(function (error) { console.log(error); - }); - + }); + _this.$message({ - message: "删除成功", + message: "修改成功", type: "success", duration: 1500 }); }else{ _this.$message({ - message: "删除失败", + message: "修改失败", type: "error", duration: 1500 }); } - }) - .catch(function (error) { - console.log(error); - }); - }, - update_dev_manage(){ - this.$refs['bform'].validate((valid) => { + _this.$data.update_visible=false; + }) + .catch(function (error) { + console.log(error); + }); + }}) + }, + update_dev_m_dialog(row){ + this.$data.form.id=row.id; + console.log("wellname",row.wellname); + this.$data.form.wellname=row.wellname; + this.$data.form.sid=row.sid; + this.$data.form.iid=row.iid; + this.$data.form.ver= row.ver; + + if(this.$data.ps_info.r3=="1"){ + this.$data.form.p_date=row.p_date; + this.$data.form.cal_date=row.cal_date; + }else{ + if (row.p_date.length>=10){ + var arr = row.p_date.split("-") + var t = arr[2]+"-"+arr[0]+"-"+arr[1]; + console.log(t); + this.$data.form.p_date=t; + } + + if (row.cal_date.length>=10){ + var arr = row.cal_date.split("-") + var t = arr[2]+"-"+arr[0]+"-"+arr[1]; + console.log(t); + this.$data.form.cal_date=t; + } + } + + //this.$data.form.p_date=row.p_date; + //this.$data.form.cal_date=row.cal_date; + this.$data.form.total_wt=row.total_wt; + this.$data.form.cur_wt=row.cur_wt; + this.$data.form.repair_cnt=row.repair_cnt; + this.$data.form.region=row.region; + this.$data.form.location=row.location; + this.$data.form.responsible=row.responsible; + + this.$nextTick(() => { + this.$refs['bform'].clearValidate() + }); + this.$data.update_visible=true; + }, + add_dev_manage(){ + this.$refs['bform'].validate((valid) => { if (valid) { var _this = this; var r; - axios.post('/deescloud/update_dev_manage', { + axios.post('/deescloud/add_dev_manage', { opuser:localStorage.getItem("online_user"), opuser_uuid:localStorage.getItem("uuid"), data:{ - id:_this.$data.form.id, wellname:_this.$data.form.wellname, sid:_this.$data.form.sid, iid:_this.$data.form.iid, @@ -601,282 +1083,178 @@ location:_this.$data.form.location, responsible:_this.$data.form.responsible } - }) - .then(function (response) { + }) + .then(function (response) { console.log(response.data); r = response.data.r; if (r==0){ - axios.post('/deescloud/get_dev_manage', { - opuser:localStorage.getItem("online_user"), - opuser_uuid:localStorage.getItem("uuid"), - wellname: _this.$data.form.wellname, - }) - .then(function (response) { - console.log(response.data); - _this.$data.dev_tableData = response.data.data; - }) - .catch(function (error) { - console.log(error); - }); - _this.$message({ - message: "修改成功", + message: "添加成功", type: "success", duration: 1500 }); }else{ _this.$message({ - message: "修改失败", + message: "添加失败", type: "error", duration: 1500 }); } - _this.$data.update_visible=false; - }) - .catch(function (error) { + _this.$data.add_visible=false; + }) + .catch(function (error) { console.log(error); - }); + }); }}) - }, - update_dev_m_dialog(row){ - this.$data.form.id=row.id; - console.log("wellname",row.wellname); - this.$data.form.wellname=row.wellname; - this.$data.form.sid=row.sid; - this.$data.form.iid=row.iid; - this.$data.form.ver= row.ver; - - if(this.$data.ps_info.r3=="1"){ - this.$data.form.p_date=row.p_date; - this.$data.form.cal_date=row.cal_date; - }else{ - if (row.p_date.length>=10){ - var arr = row.p_date.split("-") - var t = arr[2]+"-"+arr[0]+"-"+arr[1]; - console.log(t); - this.$data.form.p_date=t; - } - - if (row.cal_date.length>=10){ - var arr = row.p_date.split("-") - var t = arr[2]+"-"+arr[0]+"-"+arr[1]; - console.log(t); - this.$data.form.cal_date=t; - } - } - - //this.$data.form.p_date=row.p_date; - //this.$data.form.cal_date=row.cal_date; - this.$data.form.total_wt=row.total_wt; - this.$data.form.cur_wt=row.cur_wt; - this.$data.form.repair_cnt=row.repair_cnt; - this.$data.form.region=row.region; - this.$data.form.location=row.location; - this.$data.form.responsible=row.responsible; - - this.$nextTick(() => { - this.$refs['bform'].clearValidate() - }); - this.$data.update_visible=true; - }, - add_dev_manage(){ - this.$refs['bform'].validate((valid) => { - if (valid) { - var _this = this; - - var r; - axios.post('/deescloud/add_dev_manage', { - opuser:localStorage.getItem("online_user"), - opuser_uuid:localStorage.getItem("uuid"), - data:{ - wellname:_this.$data.form.wellname, - sid:_this.$data.form.sid, - iid:_this.$data.form.iid, - ver: _this.$data.form.ver, - p_date:_this.$data.form.p_date, - cal_date:_this.$data.form.cal_date, - total_wt:_this.$data.form.total_wt, - cur_wt:_this.$data.form.cur_wt, - repair_cnt:_this.$data.form.repair_cnt, - region:_this.$data.form.region, - location:_this.$data.form.location, - responsible:_this.$data.form.responsible - } - }) - .then(function (response) { - console.log(response.data); - r = response.data.r; - if (r==0){ - _this.$message({ - message: "添加成功", - type: "success", - duration: 1500 - }); - }else{ - _this.$message({ - message: "添加失败", - type: "error", - duration: 1500 - }); - } - - _this.$data.add_visible=false; - }) - .catch(function (error) { - console.log(error); - }); - }}) - }, - add_dev_manage_dialog(){ - document.getElementById("bt_add").blur(); - - this.$data.form.wellname=''; - this.$data.form.sid=''; - this.$data.form.iid=''; - this.$data.form.ver= ''; - this.$data.form.p_date=''; - this.$data.form.cal_date=''; - this.$data.form.total_wt=''; - this.$data.form.cur_wt=''; - this.$data.form.repair_cnt=''; - this.$data.form.region=''; - this.$data.form.location=''; - this.$data.form.responsible=''; - - var _this = this; - axios.post('/deescloud/getWellNames',{ - opuser:localStorage.getItem("online_user"), - opuser_uuid:localStorage.getItem("uuid"), - }) - .then(function (response) { - console.log(response.data); - _this.$data.wellnames = response.data; - }) - .catch(function (error) { - console.log(error); - }); - - this.$nextTick(() => { - this.$refs['bform'].clearValidate() - }); - this.$data.add_visible=true; - }, - export_pdf(row){ - var _this = this; - - axios.post('deescloud/get_dev_manage_pdf',{ - opuser:localStorage.getItem("online_user"), - opuser_uuid:localStorage.getItem("uuid"), - wellname: row.wellNameSource - }, - ).then(function (response) { - console.log(response.data); - var fileid = response.data.fileId; - - var downUrl = 'file/'+fileid; - downloadUrl(row.wellNameSource+"-设备资产管理报告.pdf",downUrl); + }, + add_dev_manage_dialog(){ + document.getElementById("bt_add").blur(); + + this.$data.form.wellname=''; + this.$data.form.sid=''; + this.$data.form.iid=''; + this.$data.form.ver= ''; + this.$data.form.p_date=''; + this.$data.form.cal_date=''; + this.$data.form.total_wt=''; + this.$data.form.cur_wt=''; + this.$data.form.repair_cnt=''; + this.$data.form.region=''; + this.$data.form.location=''; + this.$data.form.responsible=''; + + var _this = this; + axios.post('/deescloud/getWellNames',{ + opuser:localStorage.getItem("online_user"), + opuser_uuid:localStorage.getItem("uuid"), + }) + .then(function (response) { + console.log(response.data); + _this.$data.wellnames = response.data; }) .catch(function (error) { - console.log(error); + console.log(error); }); + + this.$nextTick(() => { + this.$refs['bform'].clearValidate() + }); + this.$data.add_visible=true; + }, + export_pdf(row){ + var _this = this; + + axios.post('deescloud/get_dev_manage_pdf',{ + opuser:localStorage.getItem("online_user"), + opuser_uuid:localStorage.getItem("uuid"), + wellname: row.wellNameSource }, - show_pdf(row){ - let _this= this; - axios.post('/deescloud/get_dev_manage', { - opuser:localStorage.getItem("online_user"), - opuser_uuid:localStorage.getItem("uuid"), - wellname: row.wellNameSource, - }) - .then(function (response) { - console.log(response.data); - _this.$data.dev_tableData = response.data.data; - _this.$data.pdf_visible = true; - }) - .catch(function (error) { - console.log(error); - }); - }, - getWell(_search_name){ - - document.getElementById("bt_serach").blur(); + ).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_dev_manage', { + opuser:localStorage.getItem("online_user"), + opuser_uuid:localStorage.getItem("uuid"), + wellname: row.wellNameSource, + }) + .then(function (response) { + console.log(response.data); + _this.$data.dev_tableData = response.data.data; + _this.$data.pdf_visible = true; + }) + .catch(function (error) { + console.log(error); + }); + }, + getWell(_search_name){ + + this.$data.currentPage=1; - this.$data.currentPage=1; + var _this = this; + var objs; + axios.post('/deescloud/get_well_dev', { + 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; + this.$data.currentPage = 1; var _this = this; - + var objs; axios.post('/deescloud/get_well_dev', { opuser:localStorage.getItem("online_user"), opuser_uuid:localStorage.getItem("uuid"), - Wellname: _search_name, + Wellname: this.$data.input, index: this.$data.currentPage, count: this.$data.pagesize - }) - .then(function (response) { + }) + .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) { + 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_dev', { - 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_dev', { - 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_dev', { + 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); + }); + + }, + + } } \ No newline at end of file diff --git a/scripts/eservice-en.js b/scripts/eservice-en.js index 2fb232d..a546f27 100644 --- a/scripts/eservice-en.js +++ b/scripts/eservice-en.js @@ -412,7 +412,7 @@ handleSizeChange(val) { //console.log(`每页 ${val} 条`); this.$data.pagesize = val; - + this.$data.currentPage = 1; var beginTime= ''; var endTime = ''; diff --git a/scripts/eservice.js b/scripts/eservice.js index 77afb38..8651619 100644 --- a/scripts/eservice.js +++ b/scripts/eservice.js @@ -414,7 +414,7 @@ handleSizeChange(val) { //console.log(`每页 ${val} 条`); this.$data.pagesize = val; - + this.$data.currentPage = 1; var beginTime= ''; var endTime = ''; diff --git a/scripts/faultrate-en.js b/scripts/faultrate-en.js index 825b47d..442ecf2 100644 --- a/scripts/faultrate-en.js +++ b/scripts/faultrate-en.js @@ -537,7 +537,7 @@ handleSizeChange(val) { this.$data.pagesize = val; - + this.$data.currentPage = 1; var _this = this; var objs; diff --git a/scripts/faultrate.js b/scripts/faultrate.js index e9ecde4..0c2ba02 100644 --- a/scripts/faultrate.js +++ b/scripts/faultrate.js @@ -520,7 +520,7 @@ handleSizeChange(val) { this.$data.pagesize = val; - + this.$data.currentPage = 1; var _this = this; var objs; diff --git a/scripts/hisd-en.js b/scripts/hisd-en.js index 74962b0..a37d4e4 100644 --- a/scripts/hisd-en.js +++ b/scripts/hisd-en.js @@ -305,7 +305,7 @@ history.pushState(null, null, document.URL); handleSizeChange(val) { this.$data.pagesize = val; - + this.$data.currentPage = 1; if (this.$data.begin_t != '' && this.$data.end_t != '' && this.$data.begin_t>this.$data.end_t) { this.$message({ message: 'The end time must be after the start time!', diff --git a/scripts/hisd.js b/scripts/hisd.js index 2ed785d..77c3e0e 100644 --- a/scripts/hisd.js +++ b/scripts/hisd.js @@ -339,7 +339,7 @@ history.pushState(null, null, document.URL); handleSizeChange(val) { this.$data.pagesize = val; - + this.$data.currentPage = 1; if (this.$data.begin_t != '' && this.$data.end_t != '' && this.$data.begin_t>this.$data.end_t) { this.$message({ message: '结束时间必须在开始时间之后!', diff --git a/scripts/lcm-en.js b/scripts/lcm-en.js index cdd4262..83b271a 100644 --- a/scripts/lcm-en.js +++ b/scripts/lcm-en.js @@ -481,7 +481,7 @@ handleSizeChange(val) { this.$data.pagesize = val; - + this.$data.currentPage = 1; if (this.$data.begin_t != '' && this.$data.end_t != '' && this.$data.begin_t>this.$data.end_t) { this.$message({ message: 'The end time must be after the start time!', diff --git a/scripts/lcm.js b/scripts/lcm.js index 73e0cd4..1c315c1 100644 --- a/scripts/lcm.js +++ b/scripts/lcm.js @@ -481,7 +481,7 @@ handleSizeChange(val) { this.$data.pagesize = val; - + this.$data.currentPage = 1; if (this.$data.begin_t != '' && this.$data.end_t != '' && this.$data.begin_t>this.$data.end_t) { this.$message({ message: '结束时间必须在开始时间之后!', diff --git a/scripts/lcmpage-en.js b/scripts/lcmpage-en.js index 2c480df..0b92863 100644 --- a/scripts/lcmpage-en.js +++ b/scripts/lcmpage-en.js @@ -342,7 +342,7 @@ history.pushState(null, null, document.URL); handleSizeChange(val) { this.$data.pagesize = val; - + this.$data.currentPage = 1; if (this.$data.begin_t != '' && this.$data.end_t != '' && this.$data.begin_t>this.$data.end_t) { this.$message({ message: 'The end time must be after the start time!', diff --git a/scripts/lcmpage.js b/scripts/lcmpage.js index 4b8f7d3..18a645d 100644 --- a/scripts/lcmpage.js +++ b/scripts/lcmpage.js @@ -564,7 +564,7 @@ history.pushState(null, null, document.URL); handleSizeChange(val) { this.$data.pagesize = val; - + this.$data.currentPage = 1; if (this.$data.begin_t != '' && this.$data.end_t != '' && this.$data.begin_t>this.$data.end_t) { this.$message({ message: '结束时间必须在开始时间之后!', diff --git a/scripts/mh-en.js b/scripts/mh-en.js index 503e209..5d216d3 100644 --- a/scripts/mh-en.js +++ b/scripts/mh-en.js @@ -283,7 +283,7 @@ handleSizeChange(val) { var beginTime= ''; var endTime = ''; - + this.$data.currentPage = 1; 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); diff --git a/scripts/mh.js b/scripts/mh.js index 376da2b..1a3712d 100644 --- a/scripts/mh.js +++ b/scripts/mh.js @@ -283,7 +283,7 @@ handleSizeChange(val) { var beginTime= ''; var endTime = ''; - + this.$data.currentPage = 1; 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); diff --git a/scripts/mhs-en.js b/scripts/mhs-en.js index 8cdd645..add1649 100644 --- a/scripts/mhs-en.js +++ b/scripts/mhs-en.js @@ -244,7 +244,7 @@ handleSizeChange(val) { //console.log(`每页 ${val} 条`); this.$data.pagesize = val; - + this.$data.currentPage = 1; if (this.$data.begin_t != '' && this.$data.end_t != '' && this.$data.begin_t>this.$data.end_t) { this.$message({ message: 'The end time must be after the start time!', diff --git a/scripts/mhs.js b/scripts/mhs.js index c6116cb..a7dd91a 100644 --- a/scripts/mhs.js +++ b/scripts/mhs.js @@ -245,7 +245,7 @@ handleSizeChange(val) { //console.log(`每页 ${val} 条`); this.$data.pagesize = val; - + this.$data.currentPage = 1; if (this.$data.begin_t != '' && this.$data.end_t != '' && this.$data.begin_t>this.$data.end_t) { this.$message({ message: '结束时间必须在开始时间之后!', diff --git a/scripts/mhspage-en.js b/scripts/mhspage-en.js index fe14984..174e318 100644 --- a/scripts/mhspage-en.js +++ b/scripts/mhspage-en.js @@ -129,7 +129,7 @@ handleSizeChange(val) { this.$data.pagesize = val; - + this.$data.currentPage = 1; var _this = this; var objs; diff --git a/scripts/mhspage.js b/scripts/mhspage.js index 160aa7b..326391e 100644 --- a/scripts/mhspage.js +++ b/scripts/mhspage.js @@ -78,8 +78,8 @@ axios.post('/deescloud/get_well_cur_data', { opuser:localStorage.getItem("online_user"), opuser_uuid:localStorage.getItem("uuid"), - Wellname: this.$data.curWellName, - }) + Wellname: this.$data.curWellName, + }) .then(function (response) { console.log(response.data); let data = response.data; @@ -128,7 +128,7 @@ handleSizeChange(val) { this.$data.pagesize = val; - + this.$data.currentPage = 1; var _this = this; var objs; diff --git a/scripts/ms-en.js b/scripts/ms-en.js index cc2a683..5d76c5a 100644 --- a/scripts/ms-en.js +++ b/scripts/ms-en.js @@ -577,7 +577,7 @@ handleSizeChange(val) { this.$data.pagesize = val; - + this.$data.currentPage = 1; var _this = this; var objs; diff --git a/scripts/ms.js b/scripts/ms.js index 85f1637..9ac2719 100644 --- a/scripts/ms.js +++ b/scripts/ms.js @@ -575,7 +575,7 @@ handleSizeChange(val) { this.$data.pagesize = val; - + this.$data.currentPage = 1; var _this = this; var objs; diff --git a/scripts/mss-en.js b/scripts/mss-en.js index 66aa886..65f3c56 100644 --- a/scripts/mss-en.js +++ b/scripts/mss-en.js @@ -358,7 +358,7 @@ this.$data.pagesize = val; var _this = this; - + this.$data.currentPage = 1; var objs; axios.post('/deescloud/getMss_en', { opuser:localStorage.getItem("online_user"), diff --git a/scripts/mss.js b/scripts/mss.js index 6abecaa..a183a66 100644 --- a/scripts/mss.js +++ b/scripts/mss.js @@ -376,13 +376,14 @@ handleSizeChange(val) { this.$data.pagesize = val; - + // 添加:重置到第一页 + this.$data.currentPage = 1; var _this = this; var objs; axios.post('/deescloud/getMss', { - opuser:localStorage.getItem("online_user"), - opuser_uuid:localStorage.getItem("uuid"), + opuser:localStorage.getItem("online_user"), + opuser_uuid:localStorage.getItem("uuid"), series:this.$data.series_v, instrument_id:this.$data.instrument_id_v, wellname: this.$data.value, diff --git a/scripts/nb-en.js b/scripts/nb-en.js index b07feab..402a02b 100644 --- a/scripts/nb-en.js +++ b/scripts/nb-en.js @@ -1010,7 +1010,7 @@ handleSizeChange(val) { //console.log(`每页 ${val} 条`); this.$data.pagesize = val; - + this.$data.currentPage = 1; var _this = this; var objs; diff --git a/scripts/nb.js b/scripts/nb.js index 636158d..4ac2a12 100644 --- a/scripts/nb.js +++ b/scripts/nb.js @@ -1030,7 +1030,7 @@ handleSizeChange(val) { //console.log(`每页 ${val} 条`); this.$data.pagesize = val; - + this.$data.currentPage = 1; var _this = this; var objs; diff --git a/scripts/srr.js b/scripts/srr.js index 7ccfd30..542d656 100644 --- a/scripts/srr.js +++ b/scripts/srr.js @@ -48,7 +48,7 @@ style="margin-left: 10px" v-model="scope.row.pumpExport" @change="(value) => handlePumpExportChange(value, scope.row)"> - 泵信息 + 泵信息 @@ -261,7 +261,7 @@ handleSizeChange(val) { //console.log(`每页 ${val} 条`); this.$data.pagesize = val; - + this.$data.currentPage = 1; var _this = this; var objs; diff --git a/scripts/srr_en.js b/scripts/srr_en.js index 4c718c1..d551e78 100644 --- a/scripts/srr_en.js +++ b/scripts/srr_en.js @@ -253,7 +253,7 @@ handleSizeChange(val) { //console.log(`每页 ${val} 条`); this.$data.pagesize = val; - + this.$data.currentPage = 1; var _this = this; var objs; diff --git a/scripts/stspage-en.js b/scripts/stspage-en.js index 7c1276a..b0947cb 100644 --- a/scripts/stspage-en.js +++ b/scripts/stspage-en.js @@ -193,7 +193,7 @@ history.pushState(null, null, document.URL); }, handleSizeChange(val) { this.$data.pagesize = val; - + this.$data.currentPage = 1; var _this = this; var objs; diff --git a/scripts/stspage.js b/scripts/stspage.js index e08cb60..921f508 100644 --- a/scripts/stspage.js +++ b/scripts/stspage.js @@ -191,7 +191,7 @@ history.pushState(null, null, document.URL); handleSizeChange(val) { this.$data.pagesize = val; - + this.$data.currentPage = 1; var _this = this; var objs; diff --git a/scripts/tools-en.js b/scripts/tools-en.js index b8f8bf3..db2886f 100644 --- a/scripts/tools-en.js +++ b/scripts/tools-en.js @@ -41,7 +41,7 @@ + width="160">