Explorar o código

处理弹窗加载问题

Epans %!s(int64=2) %!d(string=hai) anos
pai
achega
ec962acb84

+ 1 - 1
.env.development

@@ -8,7 +8,7 @@ ENV = 'development'
 # 后台本地
 # VUE_APP_BASE_API = 'http://192.168.1.56:8082/'
 # 线上测试
- VUE_APP_BASE_API = 'https://tmrwatch.cn:8082/'
+VUE_APP_BASE_API = 'https://tmrwatch.cn:8082/'
 
 # VUE_APP_BASE_API = 'http://127.0.0.1:8082/'
 

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/index.html


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/css/app.0fe1a511.css


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/js/app.198d6a86.js


BIN=BIN
dist20221107测试地址2t.zip


BIN=BIN
dist20221108正式地址1t.zip


BIN=BIN
dist20221108测试地址1.zip


BIN=BIN
dist20221108测试地址2.zip


BIN=BIN
dist20221109正式地址2.zip


BIN=BIN
dist20221109测试地址1.zip


BIN=BIN
dist20221110正式地址2.zip


BIN=BIN
dist20221110测试地址1.zip


BIN=BIN
dist20221110测试地址2.zip


+ 4 - 2
src/utils/request.js

@@ -108,17 +108,19 @@ service.interceptors.response.use(
     console.log('config.__retryCount==>111111', config.__retryCount) // for debug
     // 设置请求超时次数
     config.__retryCount = config.__retryCount || 0
-   if (config.__retryCount >= 6) {
+   if (config.__retryCount >= 3) {
       // Message({ message:error.message, type: 'error', duration: 5 * 1000 })
       Message({ message:'请求超时', type: 'error', duration: 5 * 1000 })
       // Message.error((error && error.data && error.data.msg) || '请求超时')
       return Promise.reject(error)
     }
     config.__retryCount += 1
+
+ 
     let backoff = new Promise((resolve) => {
       setTimeout(() => {
         resolve()
-      }, config.retryDelay || 2000)
+      }, config.retryDelay || 14000)
     })
     return backoff.then(() => {
       return service(config)

+ 43 - 7
src/views/asset/template/components/buwei.vue

@@ -596,13 +596,49 @@ export default {
               }
             }
           } else {
-            this.$notify({
-              title: '',
-              message: '请选择备件',
-              type: 'warning',
-              duration: 2000
-            })
-            return false
+            // this.$notify({
+            //   title: '',
+            //   message: '请选择备件',
+            //   type: 'warning',
+            //   duration: 2000
+            // })
+            // return false
+
+            if(!this.createTemp.positionName)
+            {
+              this.$notify({
+                title: '',
+                message: '部位名称不能为空',
+                type: 'warning',
+                duration: 2000
+              })
+              return false
+            }else{
+              this.postDataPramas.common = { 'returnmap': '0' }
+              this.postDataPramas.data = []
+              this.postDataPramas.data[0] = { 'name': 'insertPart', 'type': 'e', 'parammaps': {
+                positionName: this.createTemp.positionName,
+                note: this.createTemp.note,
+                id: this.assetTypeid
+              }}
+              ExecDataByConfig(this.postDataPramas).then(response => {
+                console.log('新增保存发送参数', this.postDataPramas)
+                if (response.msg !== 'fail') {
+                  this.dialogFormVisible = false
+                  this.getList()
+                  this.$notify({
+                    title: '成功',
+                    message: '新增成功',
+                    type: 'success',
+                    duration: 2000
+                  })
+                } else {
+                  failproccess(response, this.$notify)
+                }
+              })
+              return true
+            }
+
           }
         }
       })

+ 945 - 0
src/views/asset/template/components/buwei1.vue

@@ -0,0 +1,945 @@
+<template>
+  <div class="app-container">
+    <div>
+      <el-button class="font-small" style="margin:0 10px 10px 0" type="primary" icon="el-icon-edit" @click="handleCreate">
+        新增
+      </el-button>
+      <el-button class="font-small" type="warning" icon="el-icon-copy-document" @click="handleCopy">
+        复制
+      </el-button>
+    </div>
+    <el-table
+      v-loading="listLoading"
+      element-loading-text="给我一点时间"
+      :data="list"
+      border
+      fit
+      highlight-current-row
+      style="width: 100%;"
+      :row-style="rowStyle"
+      :cell-style="cellStyle"
+      class="elTable table-fixed"
+      row-key="id"
+      default-expand-all
+    >
+      <el-table-column label="序号" align="center" type="index" width="50px" />
+      <el-table-column label="部位" header-align="center" width="100px" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.positionName }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="备注" min-width="100px" header-align="center" align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.note }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" width="300" fixed="right">
+        <template slot-scope="{row}">
+          <el-button type="primary" size="mini" @click="handleSee(row)">查看</el-button>
+          <el-button type="success" size="mini" @click="handleUpdate(row)">编辑</el-button>
+          <el-button type="success" size="mini" @click="handleSparePart(row)">备件</el-button>
+          <el-button size="mini" type="danger" @click="handleDelete(row)">删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <!-- 弹出层新增or修改 -->
+    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" :close-on-click-modal="false">
+      <div class="content-add">
+        <el-form ref="createTemp" :rules="rules" :model="createTemp" label-position="right" label-width="100px" style="width: 90%; margin:0 auto;">
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="部位名称:" prop="positionName">
+                <el-input ref="positionName" v-model="createTemp.positionName" :disabled="dialogStatus==='sparePart'" type="text" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="备注:" prop="note">
+                <el-input ref="note" v-model="createTemp.note" class="note" :disabled="dialogStatus==='sparePart'" type="textarea" placeholder="备注" autosize maxlength="100" show-word-limit style="width:100%;" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row v-if="isUpdate">
+            <el-col :span="20">
+              <el-form-item label="备件:" prop="partCode">
+                <el-autocomplete
+                  v-model="createTemp.partCode"
+                  value-key="name"
+                  class="inline-input"
+                  :fetch-suggestions="sparePartSearch"
+                  placeholder="请输入备件编号或备件名称或备件规格"
+                  style="width:100%"
+                  @select="handleSelectSparePart"
+                >
+                  <template slot-scope="{ item }">
+                    <b>备件编号:</b><div class="name" style="display: inline;">{{ item.partCode }}</div>&nbsp;
+                    |  &nbsp;<b>备件名称:</b><span class="addr">{{ item.partName }}</span>&nbsp;
+                    |  &nbsp;<b>备件规格:</b><span class="addr">{{ item.specification }}</span>
+                  </template>
+                </el-autocomplete>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <el-table
+          v-if="isUpdate"
+          :key="tableKey"
+          v-loading="listLoading"
+          element-loading-text="给我一点时间"
+          :data="listAdd"
+          border
+          fit
+          highlight-current-row
+          style="width: 100%;margin-bottom:30px"
+          :row-style="rowStyle"
+          :cell-style="cellStyle"
+          class="elTable table-fixed"
+        >
+          <!-- table表格 -->
+          <el-table-column label="序号" align="center" type="index" width="50px" />
+          <el-table-column label="备件编号" min-width="90px" prop="partCode" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.partCode }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="备件名称" min-width="80px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.partName }}</span><br>
+            </template>
+          </el-table-column>
+          <el-table-column label="备件规格" prop="specification" align="center" min-width="100">
+            <template slot-scope="scope">
+              <span>{{ scope.row.specification }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column valign="middle" label="配备数量" min-width="90px" align="center">
+            <template slot-scope="scope">
+              <el-form :model="scope.row" :rules="rules">
+                <el-form-item prop="amount">
+                  <el-input
+                    ref="amount"
+                    v-model="scope.row.amount"
+                    style="margin-top:15px"
+                  />
+                </el-form-item>
+              </el-form>
+            </template>
+          </el-table-column>
+          <el-table-column valign="middle" label="备注" min-width="90px" align="center">
+            <template slot-scope="scope">
+              <el-form :model="scope.row" :rules="rules">
+                <el-form-item prop="note">
+                  <el-input
+                    ref="note"
+                    v-model="scope.row.note"
+                    style="margin-top:15px;"
+                  />
+                </el-form-item>
+              </el-form>
+            </template>
+          </el-table-column>
+          <el-table-column label="操作" align="center" width="100" class-name="small-padding fixed-width" fixed="right">
+            <template slot-scope="{row}">
+              <!-- <a v-if="dialogStatus==='sparePart'" class="primary" @click="partSave(row)">保存</a> -->
+              <!-- <a v-if="dialogStatus==='create'" class="del" @click="partDelete(row)">删除</a> -->
+              <a class="del" @click="partUpdateDelete(row)">删除</a>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button v-if="dialogStatus==='create'" ref="createb" type="success" :disabled="isokDisable" @click="createData_again()">保存并新增</el-button>
+        <el-button v-if="dialogStatus==='create'" type="primary" :disabled="isokDisable" @click="createData()">保存并关闭</el-button>
+        <el-button v-if="dialogStatus==='create'" @click="dialogFormVisible = false;getList()">取消并关闭</el-button>
+        <el-button v-if="dialogStatus==='sparePart'" type="primary" :disabled="isokDisable" @click="sparePartData()">保存并关闭</el-button>
+        <el-button v-if="dialogStatus==='sparePart'" @click="dialogFormVisible = false;getList()">关闭</el-button>
+        <el-button v-if="dialogStatus==='update'" type="primary" :disabled="isokDisable" @click="updateData()">保存并关闭</el-button>
+        <el-button v-if="dialogStatus==='update'" @click="dialogFormVisible = false;getList()">关闭</el-button>
+      </div>
+    </el-dialog>
+    <el-dialog
+      :title="textMap[dialogStatusSee]"
+      :visible.sync="dialogFormVisibleSee"
+      :close-on-click-modal="false"
+    >
+      <div class="content-see">
+        <el-form
+          ref=" seeTemp"
+          :rules="rules"
+          :model=" seeTemp"
+          label-position="right"
+          label-width="120px"
+          style="width: 90%;margin:0 auto;"
+        >
+          <el-row>
+            <el-col :span="8">
+              <el-form-item label="部位名称:" prop="positionName">
+                <el-input ref="positionName" v-model="seeTemp.positionName" placeholder="请输入部位名称" disabled />
+              </el-form-item>
+            </el-col>
+            <el-col :span="8">
+              <el-form-item label="备注:" prop="note">
+                <el-input ref="note" v-model="seeTemp.note" placeholder="请输入备注" disabled />
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <el-table
+          v-loading="listLoadingSee"
+          element-loading-text="给我一点时间"
+          :data="listSee"
+          border
+          fit
+          highlight-current-row
+          style="width: 100%;"
+          :row-style="rowStyle"
+          :cell-style="cellStyle"
+          class="elTable table-fixed"
+          row-key="id"
+        >
+          <el-table-column label="序号" align="center" type="index" width="50px" />
+          <el-table-column label="备件编号" header-align="center" width="100px" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.partCode }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="备件名称" min-width="100px" header-align="center" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.partName }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="备件规格" min-width="100px" header-align="center" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.specification }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="配备数量" min-width="100px" header-align="center" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.amount }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="备注" min-width="100px" header-align="center" align="center">
+            <template slot-scope="scope">
+              <span>{{ scope.row.note }}</span>
+            </template>
+          </el-table-column>
+        </el-table>
+
+      </div>
+      <div slot="footer" class="dialog-footer" style="bottom:10px">
+        <el-button @click="dialogFormVisibleSee = false">关闭</el-button>
+      </div>
+    </el-dialog>
+    <!-- 弹出层复制信息 -->
+    <el-dialog
+      :title="textMap[dialogStatusCopy]"
+      :visible.sync="dialogFormVisibleCopy"
+      :close-on-click-modal="false"
+    >
+      <div class="content-copy">
+        <el-form
+          label-position="right"
+          label-width="110px"
+          style="width: 90%px; margin: 0 auto;"
+        >
+          <el-row>
+            <el-col :span="24">
+              <el-form-item label="设备类别:" prop="NewName">
+                <tree-select
+                  :disabled="disabled"
+                  :width="300"
+                  size="small"
+                  multiple
+                  :data="parentType"
+                  :default-props="defaultProps"
+                  collapse-tags
+                  :node-key="nodeKey"
+                  :checked-keys="defaultCheckedKeys"
+                  @popoverHide="popoverHide"
+                />
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div slot="footer" class="dialog-footer" style="right:30px;position:absolute;bottom:30px">
+          <el-button type="primary" @click="dialogStatus==='create'?createCopyData():createCopyData()">确认</el-button>
+          <el-button @click="dialogFormVisibleCopy = false">关闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import waves from '@/directive/waves' // waves directive
+import enterToNext from '@/directive/enterToNext' // enterToNext directive
+import { PostDataByName, GetDataByName, transData, ExecDataByConfig, failproccess } from '@/api/common'
+import { MessageBox } from 'element-ui'
+import TreeSelect from '@/components/TreeSelect'
+import Cookies from 'js-cookie'
+import { parseTime } from '@/utils/index.js'
+export default {
+  name: 'Buwei',
+  components: { TreeSelect },
+  directives: { waves, enterToNext },
+  props: {
+    assetTypeid: {
+      type: Number,
+      default: 0
+    }
+  },
+  data() {
+    return {
+      textMap: {
+        create: '新增',
+        update: '编辑',
+        copy: '复制',
+        see: '查看详情',
+        sparePart: '备件'
+      },
+      dialogFormVisibleCopy: false,
+      dialogStatusCopy: '',
+      disabled: false,
+      parentType: [],
+      getParmType: {
+        name: 'geteqclasslist'
+        // idname: 'id',
+        // params: [-1]
+      },
+      defaultProps: {
+        children: 'children',
+        label: 'typeName'
+      },
+      nodeKey: 'id',
+      defaultCheckedKeys: [],
+      dataform: {
+        id: '',
+        name: '',
+        selectType: [],
+        sort: '',
+        enable: ''
+      },
+      UpdateDataRelationParam: {
+        name: '',
+        dataname: '',
+        datavalue: '',
+        valuename: '',
+        values: ''
+      },
+      getdataListParm: {
+        name: 'getPartList',
+        parammaps: {
+          id: ''
+        }
+      },
+      list: [],
+      total: 0,
+      listLoading: true,
+      dialogStatus: '',
+      dialogFormVisible: false,
+      createTemp: {
+        part: '',
+        note: ''
+      },
+      listAdd: [],
+      tableKey: 0,
+      isokDisable: false,
+      requestSparePart: {
+        name: 'getPartsListBW',
+        page: 1,
+        offset: 1,
+        pagecount: 10,
+        returntype: 'Map',
+        parammaps: {
+          pastureId: Cookies.get('pastureid')
+        }
+      },
+      postDataPramas: {},
+      seeTemp: {},
+      dialogStatusSee: '',
+      dialogFormVisibleSee: false,
+      listLoadingSee: true,
+      totalSee: 0,
+      listSee: [],
+      getdataListParmSee: {
+        name: 'getPositionPartBypid',
+        page: 1,
+        offset: 1,
+        pagecount: 10,
+        returntype: 'Map',
+        parammaps: {}
+      },
+      partTemp: {},
+      postUpdatePramas: {},
+      requestParam: {},
+      rules: {
+        positionName: [{ type: 'string', required: true, message: '必填', trigger: 'blur' }]
+      },
+      rowStyle: { maxHeight: 50 + 'px', height: 45 + 'px' },
+      cellStyle: { padding: 0 + 'px' },
+      isUpdate: false
+    }
+  },
+
+  watch: {
+    assetTypeid(val) {
+      console.log(val)
+      if (this.assetTypeid != null) {
+        this.getdataListParm.parammaps.id = this.assetTypeid
+        this.getList()
+        this.getTypeList()
+      }
+    }
+  },
+  created() {
+    this.getList()
+  },
+
+  // 设置变量
+
+  methods: {
+    // ------------------------------------------------------------------
+    getList() {
+      this.listLoading = true
+      GetDataByName(this.getdataListParm).then(response => {
+        console.log('部位table数据', response.data.list)
+        this.list = response.data.list
+        if (response.data.total) {
+          this.total = response.data.total
+        }
+        // Just to simulate the time of the request
+        setTimeout(() => {
+          this.listLoading = false
+        }, 100)
+      })
+    },
+    resetCreateTemp() {
+      this.listAdd = []
+      this.createTemp = {}
+    },
+    handleCreate() {
+      if (this.assetTypeid != '') {
+        this.resetCreateTemp()
+        this.dialogStatus = 'create'
+        this.dialogFormVisible = true
+        this.isUpdate = true
+        console.log(this.assetTypeid)
+      }
+    },
+    sparePartSearch(queryString, cb) {
+      console.log('备件模糊查询输入值', queryString)
+      this.requestSparePart.parammaps['partCode'] = queryString
+      GetDataByName(this.requestSparePart).then(response => {
+        console.log('备件模糊查询搜索data', response.data.list)
+        cb(response.data.list)
+      })
+    },
+    handleSelectSparePart(item) {
+      console.log('备件模糊查询选中值', item)
+      if (this.listAdd != null) {
+        // eslint-disable-next-line no-redeclare
+        if (this.listAdd.find(obj => obj.partId === item.partId)) {
+          this.$message({
+            type: 'warning',
+            message: '此备件已存在,请重新选择备件'
+          })
+        } else {
+          this.$set(item, 'myid', new Date().getTime())
+          this.listAdd.unshift(item)
+        }
+      } else {
+        this.listAdd = []
+        this.$set(item, 'myid', new Date().getTime())
+        this.listAdd.unshift(item)
+      }
+      console.log(this.listAdd, 'this.listAdd')
+    },
+    partDelete(row) {
+      console.log(this.listAdd)
+      MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
+        confirmButtonText: '确认',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        // console.log(this.list2)
+        for (var i = 0; i < this.listAdd.length; i++) {
+          console.log(this.listAdd[i])
+          if (this.listAdd[i].id === row.id) {
+            var listAddIndex = this.listAdd.indexOf(this.listAdd[i])
+          }
+          if (listAddIndex > -1) {
+            this.listAdd.splice(listAddIndex, 1)
+            return
+          }
+        }
+      })
+    },
+    createData() {
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['createTemp'].validate(valid => {
+        if (valid) {
+          console.log(this.listAdd)
+          if (this.listAdd.length !== 0) {
+            for (var i = 0; i < this.listAdd.length; i++) {
+              if (this.listAdd[i].amount == '' || this.listAdd[i].amount == null) {
+                this.$message({
+                  type: 'warning',
+                  message: '请检查配备数量是否未填写',
+                  duration: 2000
+                })
+                return false
+              } else {
+                var rulesValue = /^\d+(\.\d{1,3})?$/
+                if (!rulesValue.test(parseFloat(this.listAdd[i].amount))) {
+                  this.$message({ type: 'error', message: '配备数量请输入自然数,最多保留两位小数点', duration: 2000 })
+                  return false
+                } else {
+                  this.postDataPramas.common = { 'returnmap': '0' }
+                  this.postDataPramas.data = []
+                  this.postDataPramas.data[0] = { 'name': 'insertPart', 'type': 'e', 'parammaps': {
+                    positionName: this.createTemp.positionName,
+                    note: this.createTemp.note,
+                    id: this.assetTypeid
+                  }}
+                  // eslint-disable-next-line no-irregular-whitespace
+                  this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
+                  this.postDataPramas.data[1].children = []
+                  this.postDataPramas.data[1].children[0] = { 'name': 'insertPositionPart', 'type': 'e', 'parammaps': {
+                    positionId: '@insertPart.LastInsertId',
+                    note: '@insertSpotList.note',
+                    partId: '@insertSpotList.partId',
+                    amount: '@insertSpotList.amount'
+                  }}
+                  ExecDataByConfig(this.postDataPramas).then(response => {
+                    console.log('新增保存发送参数', this.postDataPramas)
+                    if (response.msg !== 'fail') {
+                      this.dialogFormVisible = false
+                      this.getList()
+                      this.$notify({
+                        title: '成功',
+                        message: '新增成功',
+                        type: 'success',
+                        duration: 2000
+                      })
+                    } else {
+                      failproccess(response, this.$notify)
+                    }
+                  })
+                }
+                return true
+              }
+            }
+          } else {
+            this.$notify({
+              title: '',
+              message: '请选择备件',
+              type: 'warning',
+              duration: 2000
+            })
+            return false
+          }
+        }
+      })
+    },
+    createData_again() {
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      this.$refs['createTemp'].validate(valid => {
+        if (valid) {
+          console.log(this.listAdd)
+          if (this.listAdd.length !== 0) {
+            for (var i = 0; i < this.listAdd.length; i++) {
+              if (this.listAdd[i].amount == '' || this.listAdd[i].amount == null) {
+                this.$message({
+                  type: 'warning',
+                  message: '请检查配备数量是否未填写',
+                  duration: 2000
+                })
+                return false
+              } else {
+                this.postDataPramas.common = { 'returnmap': '0' }
+                this.postDataPramas.data = []
+                this.postDataPramas.data[0] = { 'name': 'insertPart', 'type': 'e', 'parammaps': {
+                  positionName: this.createTemp.positionName,
+                  note: this.createTemp.note,
+                  id: this.assetTypeid
+                }}
+                // eslint-disable-next-line no-irregular-whitespace
+                this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
+                this.postDataPramas.data[1].children = []
+                this.postDataPramas.data[1].children[0] = { 'name': 'insertPositionPart', 'type': 'e', 'parammaps': {
+                  positionId: '@insertPart.LastInsertId',
+                  note: '@insertSpotList.note',
+                  partId: '@insertSpotList.partId',
+                  amount: '@insertSpotList.amount'
+                }}
+                ExecDataByConfig(this.postDataPramas).then(response => {
+                  console.log('新增保存发送参数', this.postDataPramas)
+                  if (response.msg !== 'fail') {
+                    this.resetCreateTemp()
+                    this.$notify({
+                      title: '成功',
+                      message: '新增成功',
+                      type: 'success',
+                      duration: 2000
+                    })
+                  } else {
+                    failproccess(response, this.$notify)
+                  }
+                })
+                return true
+              }
+            }
+          } else {
+            this.$notify({
+              title: '',
+              message: '请选择备件',
+              type: 'warning',
+              duration: 2000
+            })
+            return false
+          }
+        }
+      })
+    },
+    handleCopy() {
+      if (this.assetTypeid != '') {
+        this.dialogFormVisibleCopy = true
+        this.dialogStatusCopy = 'copy'
+        this.defaultCheckedKeys = []
+      }
+    },
+    createCopyData() {
+      console.log(this.dataform.selectType)
+      if (this.dataform.selectType.length === 0) {
+        this.$message({
+          message: '请选择设备',
+          type: 'warning',
+          duration: 2000
+        })
+      } else {
+        var selectedType = []
+        for (var i = 0; i < this.dataform.selectType.length; i++) {
+          var checkedIdsObj = {}
+          checkedIdsObj['newEqclassId'] = this.dataform.selectType[i]
+          selectedType.push(checkedIdsObj)
+        }
+        console.log('处理选中值', selectedType)
+        this.dialogStatusCopy = 'copy'
+        this.dialogFormVisibleCopy = true
+        this.postDataPramas.common = { 'returnmap': '0' }
+        this.postDataPramas.data = []
+        this.postDataPramas.data[0] = { 'name': 'insertSpotList', 'resultmaps': { 'list': selectedType }}
+        this.postDataPramas.data[0].children = []
+        this.postDataPramas.data[0].children[0] = { 'name': 'CopyPosition', 'type': 'e', 'parammaps': {
+          newEqclassId: '@insertSpotList.newEqclassId',
+          eqclassid: this.assetTypeid
+        }}
+        ExecDataByConfig(this.postDataPramas).then(response => {
+          console.log('复制保存发送参数', this.postDataPramas)
+          if (response.msg !== 'fail') {
+            this.dialogFormVisibleCopy = false
+            this.$notify({
+              title: '成功',
+              message: '复制成功',
+              type: 'success',
+              duration: 2000
+            })
+          } else {
+            failproccess(response, this.$notify)
+          }
+        })
+      }
+    },
+    popoverHide(checkedIds, checkedData) {
+      console.log('选中值', checkedIds, checkedData)
+      this.dataform.selectType = checkedIds
+      this.UpdateDataRelationParam.values = checkedIds
+      // eslint-disable-next-line no-unreachable
+    },
+    getTypeList() {
+      GetDataByName(this.getParmType).then(response => {
+        if (response.data.list !== null) {
+          this.parentType = transData(response.data.list, 'id', 'pid', 'children')
+        }
+      })
+    },
+    handleSee(row) {
+      console.log(row)
+      this.seeTemp = Object.assign({}, row)
+      this.dialogStatusSee = 'see'
+      this.dialogFormVisibleSee = true
+      this.getdataListParmSee.parammaps.positionId = row.id
+      this.getListSee()
+    },
+    getListSee() {
+      GetDataByName(this.getdataListParmSee).then(response => {
+        console.log('部位table数据', response.data.list)
+        this.listSee = response.data.list
+        if (response.data.total) {
+          this.totalSee = response.data.total
+        }
+        // Just to simulate the time of the request
+        setTimeout(() => {
+          this.listLoadingSee = false
+        }, 100)
+      })
+    },
+    handleUpdate(row) {
+      this.dialogStatus = 'update'
+      this.dialogFormVisible = true
+      this.createTemp = Object.assign({}, row)
+      this.isUpdate = false
+      this.$nextTick(() => {
+        this.$refs['createTemp'].clearValidate()
+      })
+      // this.getdataListParmSee.parammaps.positionId = row.id
+      // this.getListPart()
+    },
+    updateData() {
+      this.postUpdatePramas.name = 'updatePosition'
+      this.postUpdatePramas.parammaps = {}
+      this.postUpdatePramas.parammaps.positionName = this.createTemp.positionName
+      this.postUpdatePramas.parammaps.note = this.createTemp.note
+      this.postUpdatePramas.parammaps.id = this.createTemp.id
+      PostDataByName(this.postUpdatePramas).then(response => {
+        console.log('编辑保存发送参数', this.postDataPramas)
+        if (response.msg === 'fail') {
+          this.$notify({
+            title: '保存失败',
+            message: response.data,
+            type: 'warning',
+            duration: 2000
+          })
+        } else {
+          this.$notify({
+            title: '',
+            message: '保存成功',
+            type: 'success',
+            duration: 2000
+          })
+          this.dialogFormVisible = false
+          this.getList()
+        }
+      })
+    },
+    handleSparePart(row) {
+      this.dialogStatus = 'sparePart'
+      this.dialogFormVisible = true
+      this.createTemp = Object.assign({}, row)
+      this.isUpdate = true
+      this.$nextTick(() => {
+        this.$refs['createTemp'].clearValidate()
+      })
+      this.getdataListParmSee.parammaps.positionId = row.id
+      this.getListPart()
+    },
+    getListPart() {
+      GetDataByName(this.getdataListParmSee).then(response => {
+        console.log('部位table数据', response.data.list)
+        this.listAdd = response.data.list
+        // Just to simulate the time of the request
+        setTimeout(() => {
+          this.listLoading = false
+        }, 100)
+      })
+    },
+    // partSave(row) {
+    //   this.partTemp = Object.assign({}, row)
+    //   if (row.amount !== '' && row.amount !== null && row.amount !== undefined) {
+    //     this.postUpdatePramas.name = 'insertPositionPart'
+    //     // this.postUpdatePramas.parammaps = row
+    //     this.postUpdatePramas.parammaps = {}
+    //     this.postUpdatePramas.parammaps.positionId = this.createTemp.id
+    //     this.postUpdatePramas.parammaps.partId = this.partTemp.partId
+    //     this.postUpdatePramas.parammaps.note = this.partTemp.note
+    //     this.postUpdatePramas.parammaps.amount = this.partTemp.amount
+    //     PostDataByName(this.postUpdatePramas).then(response => {
+    //       console.log('新增保存发送参数', this.postDataPramas)
+    //       if (response.msg === 'fail') {
+    //         this.$notify({
+    //           title: '保存失败',
+    //           message: response.data,
+    //           type: 'warning',
+    //           duration: 2000
+    //         })
+    //       } else {
+    //         this.getListPart()
+    //         this.$notify({
+    //           title: '',
+    //           message: '保存成功',
+    //           type: 'success',
+    //           duration: 2000
+    //         })
+    //       }
+    //     })
+    //   } else {
+    //     this.$message({
+    //       message: '请完善保养内容',
+    //       type: 'warning',
+    //       duration: 2000
+    //     })
+    //   }
+    // },
+
+    // partUpdateDelete(row) {
+    //   console.log(row)
+    //   MessageBox.confirm('确认是否删除当前信息?', {
+    //     confirmButtonText: '确认',
+    //     cancelButtonText: '取消',
+    //     type: 'warning'
+    //   }).then(() => {
+    //     this.postUpdatePramas.name = 'deletePositionPart'
+    //     this.postUpdatePramas.parammaps = {}
+    //     this.postUpdatePramas.parammaps.id = row.id
+    //     PostDataByName(this.postUpdatePramas).then(response => {
+    //       console.log('新增保存发送参数', this.postDataPramas)
+    //       if (response.msg === 'fail') {
+    //         this.$notify({
+    //           title: '保存失败',
+    //           message: response.data,
+    //           type: 'warning',
+    //           duration: 2000
+    //         })
+    //       } else {
+    //         this.getListPart()
+    //         this.$notify({
+    //           title: '',
+    //           message: '保存成功',
+    //           type: 'success',
+    //           duration: 2000
+    //         })
+    //       }
+    //     })
+    //   })
+    // },
+    partUpdateDelete(row) {
+      console.log(row)
+      MessageBox.confirm('名称:' + row.partName, '确认删除?', {
+        confirmButtonText: '确认',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          for (var i = 0; i < this.listAdd.length; i++) {
+            console.log(this.listAdd[i])
+            if (this.listAdd[i].myid == row.myid) {
+              var listAddIndex = this.listAdd.indexOf(this.listAdd[i])
+            }
+            if (listAddIndex > -1) {
+              this.listAdd.splice(listAddIndex, 1)
+              return
+            }
+          }
+        })
+    },
+    sparePartData() {
+      this.isokDisable = true
+      setTimeout(() => {
+        this.isokDisable = false
+      }, 1000)
+      console.log(this.listAdd)
+      if (this.listAdd.length !== 0) {
+        for (var i = 0; i < this.listAdd.length; i++) {
+          if (this.listAdd[i].amount == '' || this.listAdd[i].amount == null) {
+            this.$message({
+              type: 'warning',
+              message: '请检查配备数量是否未填写',
+              duration: 2000
+            })
+            return false
+          } else {
+            var rulesValue = /^\d+(\.\d{1,3})?$/
+            if (!rulesValue.test(parseFloat(this.listAdd[i].amount))) {
+              this.$message({ type: 'error', message: '配备数量请输入自然数,最多保留两位小数点', duration: 2000 })
+              return false
+            } else {
+              this.postDataPramas.common = { 'returnmap': '0' }
+              this.postDataPramas.data = []
+              this.postDataPramas.data[0] = { 'name': 'deletePositionpartByPid', 'type': 'e', 'parammaps': {
+                positionId: this.createTemp.id
+              }}
+              // eslint-disable-next-line no-irregular-whitespace
+              this.postDataPramas.data[1] = { 'name': 'insertSpotList', 'resultmaps': { 'list': this.listAdd }}
+              this.postDataPramas.data[1].children = []
+              this.postDataPramas.data[1].children[0] = { 'name': 'insertPositionPart', 'type': 'e', 'parammaps': {
+                positionId: this.createTemp.id,
+                note: '@insertSpotList.note',
+                partId: '@insertSpotList.partId',
+                amount: '@insertSpotList.amount'
+              }}
+              ExecDataByConfig(this.postDataPramas).then(response => {
+                console.log('备件保存发送参数', this.postDataPramas)
+                if (response.msg !== 'fail') {
+                  this.dialogFormVisible = false
+                  this.getList()
+                  this.$notify({
+                    title: '成功',
+                    message: '新增成功',
+                    type: 'success',
+                    duration: 2000
+                  })
+                } else {
+                  failproccess(response, this.$notify)
+                }
+              })
+            }
+            return true
+          }
+        }
+      } else {
+        this.$notify({
+          title: '',
+          message: '请选择备件',
+          type: 'warning',
+          duration: 2000
+        })
+        return false
+      }
+    },
+    handleDelete(row) {
+      MessageBox.confirm('名称:' + row.positionName, '确认删除?', {
+        confirmButtonText: '确认',
+        cancelButtonText: '取消',
+        type: 'warning'
+      })
+        .then(() => {
+          this.requestParam.name = 'deletePart'
+          this.requestParam.parammaps = {}
+          this.requestParam.parammaps.id = row.id
+          PostDataByName(this.requestParam).then(() => {
+            this.getList()
+            this.$notify({
+              title: '成功',
+              message: '删除成功',
+              type: 'success',
+              duration: 2000
+            })
+          })
+        })
+        .catch(() => {
+          this.$message({
+            type: 'info',
+            message: '已取消删除'
+          })
+        })
+    },
+    // ------------------------------------------------------------------
+    jump() {
+      this.$router.push('/console/menu')
+    }
+  }
+}
+</script>
+<style lang="scss">
+.note textarea{
+  height: 40px !important;
+  line-height: 27px;
+}
+</style>
+

+ 2 - 0
src/views/custom/saplog/index.vue

@@ -68,6 +68,8 @@
 
 
     </el-table>
+    <pagination v-show="total>0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="getList" />
+
   </div>
 
 </template>

+ 31 - 2
src/views/custom/storage/index.vue

@@ -711,7 +711,8 @@ export default {
   },
   data() {
     return {
-
+      isSap:1,
+      isSrm:1,
       selectList: [],
       currentRow:{},
       orderAAA: {},
@@ -1981,25 +1982,53 @@ export default {
     sapUpload(){
 
 
+      
+
       const that = this 
       console.log("currentRow ProofCode",this.currentRow.ProofCode)
 
       var send_data = this.selectList
 
-             SapLaid(send_data).then(response => {
+      // if(send_data.length == 0){
+      //   that.$notify({ title: '失败', message: '请勾选数据!'  , type: 'error', duration: 2000 })
+      //   return false
+      // }
+
+      console.log(that.isSap)
+
+      if(that.isSap == 1){
+
+         that.isSap = 0
+         SapLaid(send_data).then(response => {
               console.log('response', response)
                 
               if (response.msg !== 'fail') {
                 that.$notify({ title: '成功', message: '上传成功', type: 'success', duration: 2000 })
                 that.selectList = []
                 that.getList()
+
                 
                 } else {
                   that.$notify({ title: '失败', message: '上传失败'  , type: 'error', duration: 2000 })
                 }
+
+               
               
             })
 
+            setTimeout(() => {
+              that.isSap = 1
+            }, 3000)
+
+            console.log(that.isSap)
+            
+      } else {
+
+        that.$notify({ title: '失败', message: '正在请求中,请稍等几秒钟'  , type: 'error', duration: 2000 })
+      }
+
+            
+
       // //  if(true){
       // if(this.currentRow.ProofCode){
       //   //如果有这个值说明已经上传了,不用上传

+ 9 - 4
src/views/maintenance/maintain/index.vue

@@ -130,7 +130,7 @@
     </el-table>
     <pagination v-show="total>0" :total="total" :page.sync="getdataListParm.offset" :limit.sync="getdataListParm.pagecount" @pagination="getList" />
     <!-- 查看 -->
-    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_See" :close-on-click-modal="false" width="90%">
+    <el-dialog :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible_See" :close-on-click-modal="false"  v-if ="dialogFormVisible_See" width="90%">
       <div class="app-see">
         <div v-if="statue1" class="see">
           <el-form
@@ -202,7 +202,7 @@
           </el-form>
           <el-table
             :key="tableKey"
-            v-loading="listLoading"
+            v-loading="listLoadingMaintenanceContent"
             element-loading-text="给我一点时间"
             :data="listMaintenanceContent"
             border
@@ -573,7 +573,7 @@
         </div>
       </div>
       <div slot="footer" class="dialog-footer" style="bottom:5px;">
-        <el-button @click="dialogFormVisible_See = false;getList();">关闭</el-button>
+        <el-button @click="close_diago()">关闭</el-button>
       </div>
     </el-dialog>
     <!-- 保养及领用 -->
@@ -1210,6 +1210,11 @@ export default {
       this.getdataListParm.parammaps.departmentId = ''
       this.getDepartDownList()
     },
+
+    close_diago(){
+      console.log(11111111111111)
+      this.dialogFormVisible_See = false
+    },
     getPendingList() {
       this.pending.getdataListParm.parammaps = {
         inputDatetime: this.getdataListParm.parammaps.inputDatetime,
@@ -1434,7 +1439,7 @@ export default {
     },
     getMaintenanceContentList() {
       this.getMaintenanceContentParm.parammaps.id = this.seeTemp.id
-      this.listLoadingMaintenanceContent = true
+      this.listLoadingMaintenanceContent = false
       GetDataByName(this.getMaintenanceContentParm).then(response => {
         console.log('保养内容table数据', response.data.list)
         this.listMaintenanceContent = response.data.list

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio