Browse Source

修改bug

xiangyiyong 1 year ago
parent
commit
572c433fb7

+ 13 - 0
package-lock.json

@@ -5010,6 +5010,11 @@
       "resolved": "https://registry.npmmirror.com/compute-scroll-into-view/-/compute-scroll-into-view-1.0.20.tgz",
       "integrity": "sha512-UCB0ioiyj8CRjtrvaceBLqqhZCVP+1B8+NWQhmdsm0VXOJtobBCf1dBQmebCCo34qZmUwZfIH2MZLqNHazrfjg=="
     },
+    "comutils": {
+      "version": "1.1.19",
+      "resolved": "https://registry.npmmirror.com/comutils/-/comutils-1.1.19.tgz",
+      "integrity": "sha512-JxXB67juILiwhdLwOsYyjUqwWEhHdObI0EClOPk+JDtEuTbac59s0pxGpfCBnNNQ5JommifmcMGneW/4Cg7YWw=="
+    },
     "concat-map": {
       "version": "0.0.1",
       "resolved": "https://registry.npm.taobao.org/concat-map/download/concat-map-0.0.1.tgz",
@@ -20228,6 +20233,14 @@
       "resolved": "https://registry.npm.taobao.org/vue-router/download/vue-router-3.0.6.tgz?cache=0&sync_timestamp=1595736280573&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-router%2Fdownload%2Fvue-router-3.0.6.tgz",
       "integrity": "sha1-Lk8PnLsLltAgWrJpDP5YiTUTasM="
     },
+    "vue-seamless-scroll": {
+      "version": "1.1.23",
+      "resolved": "https://registry.npmmirror.com/vue-seamless-scroll/-/vue-seamless-scroll-1.1.23.tgz",
+      "integrity": "sha512-HBjUub8WwsKJzbFCrwKPDrZn4e+SSbkKgwWtjKtfLwesiFGwSsVxP44/Z6d3kpXy94qIFOiflJH6l0/9pj7SGA==",
+      "requires": {
+        "comutils": "^1.1.9"
+      }
+    },
     "vue-style-loader": {
       "version": "4.1.2",
       "resolved": "https://registry.npm.taobao.org/vue-style-loader/download/vue-style-loader-4.1.2.tgz",

+ 1 - 0
package.json

@@ -55,6 +55,7 @@
     "vue-print-nb": "^1.7.5",
     "vue-property-decorator": "^9.1.2",
     "vue-router": "3.0.6",
+    "vue-seamless-scroll": "^1.1.23",
     "vuedraggable": "^2.24.3",
     "vuex": "3.1.0",
     "vuex-persistedstate": "^3.2.1",

+ 47 - 0
public/esriLoaderAPI.js

@@ -0,0 +1,47 @@
+/*
+ * @Author: tengmingxue 1473375109@qq.com
+ * @Date: 2022-11-10 13:28:12
+ * @LastEditors: tengmingxue 1473375109@qq.com
+ * @LastEditTime: 2022-11-10 14:55:07
+ * @FilePath: \mbBigScreen\src\views\dashboard\components\mapdata\esriLoaderAPI.js
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+ */
+
+import esriLoader from 'esri-loader'
+import { loadModules } from 'esri-loader'
+import { esriConfig } from 'staticPub/config' // 查找静态文件下的config 地图配置
+// window.apiRoot = 'https://js.arcgis.com/4.17/'; //可以写在项目的配置文件里
+window.apiRoot=esriConfig.baseUrl
+//可以写在项目的配置文件里
+window.dojoConfig = {
+  async: true,
+ 
+  // for jsapi ver. >= 4.9 兼容浏览器
+  deps: ['@dojo/framework/shim/main'],
+ 
+  // for jsapi ver. <= 4.8
+  // deps: ['@dojo/shim/main'],
+  packages: [
+    // {
+    //   name: 'sample',
+    //   location: 'sample/demo'
+        // },
+  ],
+  has: {
+    'esri-promise-compatibility': 1, // Use native Promises by default
+    'esri-featurelayer-webgl': 1, // Enable FeatureLayer WebGL capabilities
+  }
+};
+ 
+function configEsriLoader() {
+  esriLoader.utils.Promise = Promise;
+    
+}
+ 
+export function load(modules) {
+  //configEsriLoader();   esri-loader 2.16.0 之前版本用这个
+  return loadModules(modules, {
+    dojoConfig: window.dojoConfig,
+    url: window.apiRoot,
+  });
+}

+ 28 - 0
src/api/wxfltj.js

@@ -0,0 +1,28 @@
+import request from '@/utils/request'
+
+// 获取查询列表
+export const getRepairQueryCondition = (params) => {
+  return request({
+    url: '/gps/repairQueryCondition/list',
+    method: 'post',
+    data: params
+  })
+}
+
+// 获取查询列表
+export const postRepairQueryCondition = (params) => {
+  return request({
+    url: '/gps/repairQueryCondition/save',
+    method: 'post',
+    data: params
+  })
+}
+
+// 获取查询列表
+export const deleteRepairQueryCondition = (params) => {
+  return request({
+    url: '/gps/repairQueryCondition/deleteById',
+    method: 'delete',
+    params: params
+  })
+}

+ 133 - 42
src/views/zhpt/wxreportforms/wxWeiHuFenLeiTongJi/widget.vue

@@ -1,45 +1,57 @@
 <template>
   <div style="width: 100%; height: 100%; padding:8px;">
     <div v-show="showPage==&quot;one&quot;" style="width:100%;height:100%">
-      <el-row>
-        <el-radio-group v-model="timeType" size="small">
-          <el-radio label="1">按日</el-radio>
-          <el-radio label="2">按月</el-radio>
-          <el-radio label="3">按年</el-radio>
-        </el-radio-group>
-        <div style="width:1px;height:100%;display:inline-block;margin: 0 20px; height: 28px; vertical-align: middle;" />
-        <span class="title2">时间:</span>
-        <!-- <div style="display: inline-block; margin-left: 5px; width:300px;">
-        <el-date-picker v-if="timeType == '1'" v-model="statisticTime" type="daterange" size="small"
-          style="width: 100%;" range-separator="至" start-placeholder="开始日期"
-          end-placeholder="结束日期" align="right" value-format="yyyy-MM-dd"/>
-        <el-date-picker v-if="timeType == '2'" v-model="statisticMonth" type="monthrange" size="small"
-          style="width: 100%;" range-separator="至" start-placeholder="开始月份"
-          end-placeholder="结束月份" placeholder="选择月份" align="right" value-format="yyyy-MM"/>
-        <el-date-picker v-if="timeType == '3'" v-model="statisticYear" type="year" size="small"
-          style="width: 100%;" placeholder="选择年份" align="right" value-format="yyyy"/>
-      </div> -->
-        <el-date-picker v-model="startTime" size="small" :type="dateType" placeholder="请选择开始时间" :picker-options="startOptions" :value-format="dateFormData" />
-        <span v-if="this.endShow"> ~</span>
-        <el-date-picker v-if="this.endShow" v-model="endTime" size="small" :type="dateType" placeholder="请选择结束时间" :picker-options="endOptions" :value-format="dateFormData" />
-        <el-button size="small" type="primary" @click="query()">查询</el-button>
-        <export-btn table-id="classficationStatistic" :file="title" />
-      </el-row>
-      <div style="width:100%;height:calc(100% - 46px);margin-top:8px;">
-        <div style="width:350px;height:100%;float:left;">
+      <div style="width:100%;height:calc(100% - 6px);margin-top:8px;">
+        <div style="width:500px;height:100%;float:left;">
           <div style="width:100%;height:100%;padding:12px;border:1px solid rgb(232,232,232);background:rgb(248,248,248);border-radius:4px;">
             <div style=" display: flex; align-items: center;">
-              <span class="title2" style="flex: 1;">查询条件:{{ list.length }} 条</span>
+              <el-date-picker
+                v-model="searchTime"
+                size="small"
+                type="datetimerange"
+                range-separator="至"
+                start-placeholder="开始日期"
+                end-placeholder="结束日期"
+                style="margin-right: 5px;"
+              />
+              <el-button size="mini" type="primary" @click="queryTJ()">查询</el-button>
               <el-button size="mini" type="primary" plain @click="addMission">添加条件</el-button>
             </div>
-            <div style="width:100%;height:calc(100% - 36px);overflow-y:auto;margin-top:8px;border:1px solid #bfbfbf;border-radius:4px;padding:0 8px;">
-              <el-tag v-for="(tag, index) in list" :key="index" closable type="" style="width:100%;margin-top:8px;" @close="list.splice(index, 1)">
-                {{ fixIndex[tag.typeId] + ' ( ' + tag.startBore + ' mm ~ ' + tag.endBore + ' mm )' }}
+            <div style=" display: flex; align-items: center;height: 26px;margin-top: 10px">
+              <span class="title2" style="flex: 1;">查询条件:{{ list.length }} 条</span>
+            </div>
+            <div style="width:100%;height:calc(100% - 70px);overflow-y:auto;margin-top:8px;border:1px solid #bfbfbf;border-radius:4px;padding:0 8px;">
+              <el-tag v-for="(tag, index) in list" :key="index" closable type="" style="width:100%;margin-top:8px;" @close="deleteTj(index)">
+                {{ fixIndex[tag.typeId] + ' ( '+ tag.createTime + ' )' }}
               </el-tag>
             </div>
           </div>
         </div>
-        <div v-loading="loading" style="width:calc(100% - 350px);height:100%;float:left;">
+        <div v-loading="loading" style="width:calc(100% - 500px);height:100%;float:left;">
+          <el-row style="padding-left: 10px;">
+            <el-radio-group v-model="timeType" size="small">
+              <el-radio label="1">按日</el-radio>
+              <el-radio label="2">按月</el-radio>
+              <el-radio label="3">按年</el-radio>
+            </el-radio-group>
+            <div style="width:1px;height:100%;display:inline-block;margin: 0 20px; height: 28px; vertical-align: middle;" />
+            <span class="title2">时间:</span>
+            <!-- <div style="display: inline-block; margin-left: 5px; width:300px;">
+              <el-date-picker v-if="timeType == '1'" v-model="statisticTime" type="daterange" size="small"
+                style="width: 100%;" range-separator="至" start-placeholder="开始日期"
+                end-placeholder="结束日期" align="right" value-format="yyyy-MM-dd"/>
+              <el-date-picker v-if="timeType == '2'" v-model="statisticMonth" type="monthrange" size="small"
+                style="width: 100%;" range-separator="至" start-placeholder="开始月份"
+                end-placeholder="结束月份" placeholder="选择月份" align="right" value-format="yyyy-MM"/>
+              <el-date-picker v-if="timeType == '3'" v-model="statisticYear" type="year" size="small"
+                style="width: 100%;" placeholder="选择年份" align="right" value-format="yyyy"/>
+            </div> -->
+            <el-date-picker v-model="startTime" size="small" :type="dateType" placeholder="请选择开始时间" :picker-options="startOptions" :value-format="dateFormData" />
+            <span v-if="this.endShow"> ~</span>
+            <el-date-picker v-if="this.endShow" v-model="endTime" size="small" :type="dateType" placeholder="请选择结束时间" :picker-options="endOptions" :value-format="dateFormData" />
+            <el-button size="small" type="primary" @click="query()">查询</el-button>
+            <export-btn table-id="classficationStatistic" :file="title" />
+          </el-row>
           <h3 style=" height: 16px; line-height: 16px; font-size: 16px; text-align: center; margin-bottom: 15px;">{{ title }}</h3>
           <el-table
             id="classficationStatistic"
@@ -78,7 +90,7 @@
             <el-option v-for="item in fixs" :key="item.id" :label="item.name" :value="item.id" />
           </el-select>
         </el-row>
-        <el-row style="margin-top: 8px;">
+        <!-- <el-row style="margin-top: 8px;">
           <span class="title2">口径范围:</span>
           <el-input-number
             v-model="radioFrom"
@@ -96,6 +108,16 @@
             :step="radioTo < 1 ? (Math.pow(10, -(radioTo + '').replace(/\d+\.(\d*)/,'$1').length)) : (Math.pow(10,(Math.floor(radioTo) + '').length - ((radioTo + '')[0] == '1' ? 2 : 1)))"
           />
           <span class="title2">(mm)</span>
+        </el-row> -->
+        <el-row style="margin-top: 8px;">
+          <span class="title2">录入时间:</span>
+          <el-date-picker
+            v-model="formInfo.createTime"
+            size="small"
+            style="margin-left: 5px;"
+            type="datetime"
+            placeholder="选择日期时间"
+          />
         </el-row>
         <el-row style="margin-top: 8px;">
           <span class="title2">维护数量:</span>
@@ -144,9 +166,11 @@
 </template>
 <script>
 import request from '@/utils/request'
+import { getRepairQueryCondition, postRepairQueryCondition, deleteRepairQueryCondition } from '@/api/wxfltj'
 import ExportBtn from '../components/ExportBtn'
 import baoyang from '../wxWeiXiuBaoYangTaiZhang/widget.vue'
 import weixiu from '../wxWeiXiuJiLuTaiZhang/widget.vue'
+import moment from 'moment'
 export default {
   name: 'WxWeiHuFenLeiTongJi',
   components: { ExportBtn, baoyang, weixiu },
@@ -174,6 +198,7 @@ export default {
       startTime: '',
       endTime: '',
       endShow: true,
+      searchTime: [],
       startOptions: {
         disabledDate: time => {
           if (this.endTime) {
@@ -322,18 +347,20 @@ export default {
     },
     addMissionTrue() {
       if (!this.fixType) return this.$message.error('请选择维修类型')
-      if (this.radioFrom + '' == 'undefined') return this.$message.error('请填写最小口径')
-      if (this.radioTo + '' == 'undefined') return this.$message.error('请填写最大口径')
+      // if (this.radioFrom + '' == 'undefined') return this.$message.error('请填写最小口径')
+      // if (this.radioTo + '' == 'undefined') return this.$message.error('请填写最大口径')
       var data = {
         typeId: this.fixType,
         startBore: this.radioFrom,
         endBore: this.radioTo,
         ...this.formInfo
       }
-      var { typeId, startBore, endBore } = data
-      for (var i = 0, il = this.list, ii = il.length; i < ii; i++) {
-        var di = il[i]
-        if (typeId == di.typeId && startBore == di.startBore && endBore == di.endBore) return this.$message.error('已包含重复条件')
+      // var { typeId, startBore, endBore } = data
+      // startBore == di.startBore && endBore == di.endBore
+      const find = this.list.find(item => item.typeId === data.typeId)
+      if (find) {
+        this.$message.error('已包含重复条件')
+        return
       }
       switch (this.timeType) {
         case '1':
@@ -355,13 +382,23 @@ export default {
           data.endDate = ~~this.startTime + 1 + '-01-01 00:00:00'
           break
       }
-      this.list.push(data)
-      this.diaVisiable = false
+      postRepairQueryCondition({
+        'createDate': moment(this.formInfo.createTime).format('YYYY-MM-DD HH:mm:ss'),
+        'description': this.formInfo.maintainContent,
+        'maintainNumber': this.formInfo.mfNum || 0,
+        'maintainedNumber': this.formInfo.orderNum || 0,
+        'type': this.fixType
+      }).then((res) => {
+        // this.list.push(data)
+        this.diaVisiable = false
+        this.$message.success('添加成功')
+        this.queryTJ()
+      })
     },
     query() {
       if (!this.list.length) return this.$message.error('请添加查询条件')
-      if (!this.list[0].startDate) return this.$message.error('请选择开始时间')
-      if (!this.list[0].endDate) return this.$message.error('请选择结束时间')
+      // if (!this.list[0].startDate) return this.$message.error('请选择开始时间')
+      // if (!this.list[0].endDate) return this.$message.error('请选择结束时间')
       switch (this.timeType) {
         case '1':
           if (!this.startTime || !this.endTime) return this.$message.error('请选择统计时间')
@@ -369,7 +406,9 @@ export default {
           break
         case '2':
           if (!this.startTime || !this.endTime) return this.$message.error('请选择统计月份')
+          // eslint-disable-next-line no-case-declarations
           let endMonth = parseInt(this.endTime.split('-')[1]) + 1
+          // eslint-disable-next-line no-case-declarations
           const endYear = this.endTime.split('-')[0]
           endMonth = endMonth < 10 ? ('0' + endMonth) : endMonth
           this.list.map(e => { e.startDate = this.startTime + '-01 00:00:00', e.endDate = endYear + '-' + endMonth + '-01 00:00:00' })
@@ -391,6 +430,7 @@ export default {
             item.mfNum = this.list[index].mfNum
             item.orderNum = this.list[index].orderNum
             item.maintainContent = this.list[index].maintainContent
+            item.conditions = item.conditions.split('(')[0]
             return item
           })
           if (this.list.length < 1) return this.title = '维护分类信息统计表'
@@ -410,6 +450,57 @@ export default {
       row.timeType = this.timeType
       this.searchData = row
       this.showPage = type
+    },
+    // 查询条件
+    queryTJ() {
+      let parmas = {}
+      if (this.searchTime.length) {
+        parmas = {
+          'startTime': moment(this.searchTime[0]).format('YYYY-MM-DD HH:mm:ss'),
+          'endTime': moment(this.searchTime[1]).format('YYYY-MM-DD HH:mm:ss')
+        }
+      } else {
+        parmas = {
+          'startTime': moment().subtract(3, 'day').format('YYYY-MM-DD HH:mm:ss'),
+          'endTime': moment().add(1, 'day').format('YYYY-MM-DD HH:mm:ss')
+        }
+      }
+      getRepairQueryCondition(parmas).then((res) => {
+        if (res && res.code == 1) {
+          this.list = res.result.map(item => {
+            return {
+              id: item.id,
+              mfNum: item.maintainNumber,
+              orderNum: item.maintainedNumber,
+              createTime: item.createDate,
+              typeId: item.type,
+              maintainContent: item.description
+            }
+          })
+        }
+      })
+    },
+    // 删除条件
+    deleteTj(index) {
+      this.$confirm('是否要删除选中的数据?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        deleteRepairQueryCondition({
+          id: this.list[index].id
+        }).then((res) => {
+          if (res && res.code == 1) {
+            this.list.splice(index, 1)
+            this.$message.success('删除成功')
+          }
+        })
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消删除'
+        })
+      })
     }
   }
 }