Selaa lähdekoodia

线上问题校验

Shan9312 9 kuukautta sitten
vanhempi
commit
695e9e036e

BIN
dist-现代牧业-正式线-20240604.zip


BIN
dist-现代牧业-测试线-20240603.zip


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 0 - 0
dist/index.html


+ 9 - 393
src/views/maintenance/repair/index.vue

@@ -255,7 +255,7 @@
           <el-table-column :key="0" label="序号" align="center" type="index" width="50px" />
           <el-table-column :key="1" label="供应商" prop="providerName" align="center" min-width="80px">
             <template slot-scope="scope">
-              <el-select v-model="scope.row.providerName" filterable placeholder="供应商" class="filter-item" style="width: 120px; margin-top:10px">
+              <el-select v-model="scope.row.providerName" filterable clearable placeholder="供应商" class="filter-item" style="width: 120px; margin-top:10px">
                 <el-option v-for="item in providerNameList" :key="item.name" :label="item.name" :value="item.name" />
               </el-select>
 
@@ -2491,11 +2491,17 @@ export default {
             this.$message({ type: 'warning', message: '请检查合同编号是否未填写', duration: 2000 })
             return false
           }
+          if (this.listAddCont[j].providerName == null || this.listAddCont[j].providerName === '') {
+            this.$message({ type: 'warning', message: '请检查供应商是否未填写', duration: 2000 })
+            return false
+          }
         }
-        if (this.listAddCont[j].providerName == null || this.listAddCont[j].providerName === '') {
-          this.$message({ type: 'warning', message: '请检查供应商是否未填写', duration: 2000 })
+        // 如果是无合同则金额比填写
+        if (this.listAddCont[j].amount == 0 && this.createTempCont.contract == 0 ) {
+            this.$message({ type: 'warning', message: '请检查: 金额 是否填写', duration: 2000} )
           return false
         }
+
         if (this.listAddCont[j].eqCode == null || this.listAddCont[j].eqCode === '') {
           this.$message({ type: 'warning', message: '请检查设备名称是否未填写', duration: 2000 })
           return false
@@ -3802,396 +3808,6 @@ export default {
       }
       return list.concat(list2)
     },
-    createPartDelete(row) {
-      console.log(this.listAdd)
-      MessageBox.confirm('设备名称:' + row.partName, '确认删除?', {
-        confirmButtonText: '确认',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        // console.log(this.list2)
-        for (var i = 0; i < this.listCreateCollectionSpareParts.length; i++) {
-          console.log(this.listCreateCollectionSpareParts[i])
-          if (this.listCreateCollectionSpareParts[i].id === row.id) {
-            var listCreateCollectionSparePartsIndex = this.listCreateCollectionSpareParts.indexOf(this.listCreateCollectionSpareParts[i])
-          }
-          if (listCreateCollectionSparePartsIndex > -1) {
-            this.listCreateCollectionSpareParts.splice(listCreateCollectionSparePartsIndex, 1)
-            return
-          }
-        }
-      })
-    },
-    handleViewProgress(row) {
-      console.log('查看进度', row)
-      console.log(this.maintenanceRequisitionTemp)
-      this.viewProgressTemp = Object.assign({}, row)
-      this.dialogStatus = 'ViewProgress'
-      this.dialogFormVisible_ViewProgress = true
-      this.getNumbers()
-      this.getPurchaseapplicationList()
-      this.getProcurementList()
-    },
-    getNumbers() {
-      this.getNumbersParm.parammaps.contractId = this.viewProgressTemp.contractId
-      this.getNumbersParm.parammaps.RUCode = this.maintenanceRequisitionTemp.repairCode
-      GetDataByName(this.getNumbersParm).then(response => {
-        this.numbersList = response.data.list[0]
-      })
-    },
-    // 申购情况
-    getPurchaseapplicationList() {
-      this.getPurchaseapplicationParm.parammaps.createDate = this.viewProgressTemp.date
-      this.getPurchaseapplicationParm.parammaps.partCode = this.viewProgressTemp.partCode
-      this.getPurchaseapplicationParm.parammaps.pastureId = this.viewProgressTemp.pastureId
-      GetDataByName(this.getPurchaseapplicationParm).then(response => {
-        if (response.data.list !== null) {
-          this.purchaseapplicationList = response.data.list
-        } else {
-          this.purchaseapplicationList = []
-        }
-      })
-    },
-    // 采购情况
-    getProcurementList() {
-      this.getProcurementParm.parammaps.createDate = this.viewProgressTemp.date
-      this.getProcurementParm.parammaps.partCode = this.viewProgressTemp.partCode
-      this.getProcurementParm.parammaps.pastureId = this.viewProgressTemp.pastureId
-      GetDataByName(this.getProcurementParm).then(response => {
-        if (response.data.list !== null) {
-          this.procurementList = response.data.list
-        } else {
-          this.procurementList = []
-        }
-      })
-    },
-    // 添加领用保存
-    createCollectionSparePartsData() {
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.$refs['collectionSparePartsSeeTemp'].validate(valid => {
-        if (valid) {
-          if (this.listCreateCollectionSpareParts.length !== 0) {
-            for (var i = 0; i < this.listCreateCollectionSpareParts.length; i++) {
-              console.log(this.listCreateCollectionSpareParts[i].amount)
-              if (this.listCreateCollectionSpareParts[i].amount !== undefined && this.listCreateCollectionSpareParts[i].amount !== '') {
-                var rulesAmount = /(^[1-9](\d+)?(\.\d{1,2})?$)|(^\d\.\d{1,2}$)/
-                if (!rulesAmount.test(this.listCreateCollectionSpareParts[i].amount)) {
-                  this.$message({
-                    type: 'error',
-                    message: '领用数量请输入正数,最多保留两位小数',
-                    duration: 2000
-                  })
-                  return false
-                } else {
-                  var listCreateCollectionSpareParts1 = [] // >库存
-                  var listCreateCollectionSpareParts2 = [] // <=库存
-                  var amountList = []
-                  var amount2List = []
-                  for (let i = 0; i < this.listCreateCollectionSpareParts.length; i++) {
-                    var obj = {}
-                    var obj2 = {}
-                    obj.amount = this.listCreateCollectionSpareParts[i].amount
-                    obj.bigId = this.listCreateCollectionSpareParts[i].bigId
-                    obj.brand = this.listCreateCollectionSpareParts[i].brand
-                    obj.brandId = this.listCreateCollectionSpareParts[i].brandId
-                    obj.contractId = this.listCreateCollectionSpareParts[i].contractId
-                    obj.enable = this.listCreateCollectionSpareParts[i].enable
-                    obj.id = this.listCreateCollectionSpareParts[i].id
-                    obj.inventoryType = this.listCreateCollectionSpareParts[i].inventoryType
-                    obj.isZeroStock = this.listCreateCollectionSpareParts[i].isZeroStock
-                    obj.partCode = this.listCreateCollectionSpareParts[i].partCode
-                    obj.partId = this.listCreateCollectionSpareParts[i].partId
-                    obj.partName = this.listCreateCollectionSpareParts[i].partName
-                    obj.partRepId = this.listCreateCollectionSpareParts[i].partRepId
-                    obj.pastureId = this.listCreateCollectionSpareParts[i].pastureId
-                    obj.pastureName = this.listCreateCollectionSpareParts[i].pastureName
-                    obj.planAmount = this.listCreateCollectionSpareParts[i].planAmount
-                    obj.price = this.listCreateCollectionSpareParts[i].price
-                    obj.providerId = this.listCreateCollectionSpareParts[i].providerId
-                    obj.providerName = this.listCreateCollectionSpareParts[i].providerName
-                    obj.remark = this.listCreateCollectionSpareParts[i].remark
-                    obj.reportery = this.listCreateCollectionSpareParts[i].reportery
-                    obj.specification = this.listCreateCollectionSpareParts[i].specification
-                    obj.unit = this.listCreateCollectionSpareParts[i].unit
-                    obj.prid = this.listCreateCollectionSpareParts[i].prid
-                    obj.mr = this.listCreateCollectionSpareParts[i].mr
-                    obj.locationId = this.listCreateCollectionSpareParts[i].locationId
-                    amountList.push(obj)
-                    obj2.amount = this.listCreateCollectionSpareParts[i].amount
-                    obj2.bigId = this.listCreateCollectionSpareParts[i].bigId
-                    obj2.brand = this.listCreateCollectionSpareParts[i].brand
-                    obj2.brandId = this.listCreateCollectionSpareParts[i].brandId
-                    obj2.contractId = this.listCreateCollectionSpareParts[i].contractId
-                    obj2.enable = this.listCreateCollectionSpareParts[i].enable
-                    obj2.id = this.listCreateCollectionSpareParts[i].id
-                    obj2.inventoryType = this.listCreateCollectionSpareParts[i].inventoryType
-                    obj2.isZeroStock = this.listCreateCollectionSpareParts[i].isZeroStock
-                    obj2.partCode = this.listCreateCollectionSpareParts[i].partCode
-                    obj2.partId = this.listCreateCollectionSpareParts[i].partId
-                    obj2.partName = this.listCreateCollectionSpareParts[i].partName
-                    obj2.partRepId = this.listCreateCollectionSpareParts[i].partRepId
-                    obj2.pastureId = this.listCreateCollectionSpareParts[i].pastureId
-                    obj2.pastureName = this.listCreateCollectionSpareParts[i].pastureName
-                    obj2.planAmount = this.listCreateCollectionSpareParts[i].planAmount
-                    obj2.price = this.listCreateCollectionSpareParts[i].price
-                    obj2.providerId = this.listCreateCollectionSpareParts[i].providerId
-                    obj2.providerName = this.listCreateCollectionSpareParts[i].providerName
-                    obj2.remark = this.listCreateCollectionSpareParts[i].remark
-                    obj2.reportery = this.listCreateCollectionSpareParts[i].reportery
-                    obj2.specification = this.listCreateCollectionSpareParts[i].specification
-                    obj2.unit = this.listCreateCollectionSpareParts[i].unit
-                    obj2.prid = this.listCreateCollectionSpareParts[i].prid
-                    obj.mr = this.listCreateCollectionSpareParts[i].mr
-                    obj2.locationId = this.listCreateCollectionSpareParts[i].locationId
-                    amount2List.push(obj2)
-                  }
-                  for (let i = 0; i < amountList.length; i++) {
-                    if (parseFloat(amountList[i].amount) > parseFloat(amountList[i].reportery)) {
-                      var amount = String(parseFloat(amountList[i].amount) - parseFloat(amountList[i].reportery))
-                      amountList[i].amount = amount
-                      listCreateCollectionSpareParts1.push(amountList[i])
-                      if (parseFloat(amountList[i].reportery) > 0) {
-                        amount2List[i].amount = String(amount2List[i].reportery)
-                        listCreateCollectionSpareParts2.push(amount2List[i])
-                      }
-                    } else {
-                      listCreateCollectionSpareParts2.push(amountList[i])
-                    }
-                  }
-                  console.log(this.listCreateCollectionSpareParts, 'this.listCreateCollectionSpareParts')
-                  console.log(listCreateCollectionSpareParts1, '>库存listCreateCollectionSpareParts1')
-                  console.log(listCreateCollectionSpareParts2, '<=库存listCreateCollectionSpareParts2')
-                  let mySumPrice = 0
-                  for (let i = 0; i < listCreateCollectionSpareParts2.length; i++) {
-                    mySumPrice += parseFloat(listCreateCollectionSpareParts2[i].price) * parseFloat(listCreateCollectionSpareParts2[i].amount)
-                  }
-                  if (mySumPrice > 500) {
-                    this.collectionSparePartsSeeTemp.SHStatus = 2
-                  } else {
-                    this.collectionSparePartsSeeTemp.SHStatus = 9
-                  }
-                  this.postDataPramas.common = { 'returnmap': '0' }
-                  this.postDataPramas.data = []
-                  this.postDataPramas.data[0] = { 'name': 'insertSpotList3', 'resultmaps': { 'list': this.listCreateCollectionSpareParts }}
-                  this.postDataPramas.data[0].children = []
-                  this.postDataPramas.data[0].children[0] = { 'name': 'updatePartapplyuseAmount_m', 'type': 'e', 'parammaps': {
-                    amount: '@insertSpotList3.amount',
-                    paid: '@insertSpotList3.contractId',
-                    RUCode: this.collectionSparePartsSeeTemp.repairCode
-                  }}
-                  this.postDataPramas.data[1] = { 'name': 'insertBigpartapply_m', 'type': 'e', 'parammaps': {
-                    pastureId: this.collectionSparePartsSeeTemp.pastureId,
-                    applyCode: this.collectionSparePartsSeeTemp.applyCode,
-                    applyType: 1,
-                    departmentId: this.collectionSparePartsSeeTemp.departmentId,
-                    // empId: this.collectionSparePartsSeeTemp.pickId,
-                    empId: Cookies.get('employeid'),
-                    applyDate: this.collectionSparePartsSeeTemp.createDate,
-                    RUCode: this.collectionSparePartsSeeTemp.repairCode
-                  }}
-                  this.postDataPramas.data[2] = { 'name': 'insertSpotList2', 'resultmaps': { 'list': listCreateCollectionSpareParts1 }}
-                  this.postDataPramas.data[2].children = []
-                  this.postDataPramas.data[2].children[0] = { 'name': 'insertpartapply_m', 'type': 'e', 'parammaps': {
-                    bigId: this.collectionSparePartsSeeTemp.repairCode,
-                    prid: '@insertSpotList2.prid',
-                    pastureId: '@insertSpotList2.pastureId',
-                    partId: '@insertSpotList2.partId',
-                    partCode: '@insertSpotList2.partCode',
-                    partName: '@insertSpotList2.partName',
-                    specification: '@insertSpotList2.specification',
-                    brandId: '@insertSpotList2.brandId',
-                    price: '@insertSpotList2.price',
-                    amount: '@insertSpotList2.amount',
-                    eqName: this.collectionSparePartsSeeTemp.eqName,
-                    eqCode: this.collectionSparePartsSeeTemp.eqCode,
-                    providerId: '@insertSpotList2.providerId',
-                    note: '@insertSpotList2.note',
-                    reportery: '@insertSpotList2.reportery',
-                    contractId: '@insertSpotList2.contractId'
-                  }}
-                  if (listCreateCollectionSpareParts2.length > 0) {
-                    this.postDataPramas.data[3] = { 'name': 'insertBigpartapply', 'type': 'e', 'parammaps': {
-                      pastureId: this.collectionSparePartsSeeTemp.pastureId,
-                      applyCode: this.collectionSparePartsSeeTemp.applyCode,
-                      applyType: 1,
-                      departmentId: this.collectionSparePartsSeeTemp.departmentId,
-                      // empId: this.collectionSparePartsSeeTemp.pickId,
-                      empId: Cookies.get('employeid'),
-                      applyDate: this.collectionSparePartsSeeTemp.createDate,
-                      RUCode: this.collectionSparePartsSeeTemp.repairCode,
-                      SHStatus: this.collectionSparePartsSeeTemp.SHStatus
-                    }}
-                    this.postDataPramas.data[4] = { 'name': 'insertSpotList', 'resultmaps': { 'list': listCreateCollectionSpareParts2 }}
-                    this.postDataPramas.data[4].children = []
-                    this.postDataPramas.data[4].children[0] = { 'name': 'insertpartapply', 'type': 'e', 'parammaps': {
-                      bigId: '@insertBigpartapply.LastInsertId',
-                      pastureId: '@insertSpotList.pastureId',
-                      partId: '@insertSpotList.partId',
-                      partCode: '@insertSpotList.partCode',
-                      partName: '@insertSpotList.partName',
-                      specification: '@insertSpotList.specification',
-                      brandId: '@insertSpotList.brandId',
-                      price: '@insertSpotList.price',
-                      amount: '@insertSpotList.amount',
-                      eqName: this.collectionSparePartsSeeTemp.eqName,
-                      eqCode: this.collectionSparePartsSeeTemp.eqCode,
-                      providerId: '@insertSpotList.providerId',
-                      note: '@insertSpotList.note',
-                      reportery: '@insertSpotList.reportery',
-                      contractId: '@insertSpotList.contractId',
-                      locationId: '@insertSpotList.locationId'
-                    }}
-                  }
-                  ExecDataByConfig(this.postDataPramas).then(response => {
-                    console.log('添加领用保存发送参数', this.postDataPramas)
-                    if (response.msg === 'fail') {
-                      this.$notify({ title: '保存失败', message: response.data, type: 'warning', duration: 2000 })
-                    } else {
-                      this.dialogFormVisible_CollectionSparePartsSee = false
-                      this.getCollectionSpareParts()
-                      this.getCollectionSpareParts()
-                      this.getCollectionSpareParts2()
-                      this.$notify({ title: '', message: '保存成功', type: 'success', duration: 2000 })
-                    }
-                  })
-                  return true
-                }
-              } else {
-                this.$message({ type: 'error', message: '请检查领用数量是否未填写', duration: 2000 })
-                return false
-              }
-            }
-          } else {
-            this.$notify({ title: '', type: 'warning', message: '请选择备件', duration: 2000 })
-            return false
-          }
-        }
-      })
-    },
-    form_delete(row) {
-      MessageBox.confirm('确认删除?', {
-        confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning'
-      }).then(() => {
-        this.requestParam.name = 'deleteMaintain'
-        this.requestParam.parammaps = {}
-        this.requestParam.parammaps.id = row.id
-        PostDataByName(this.requestParam).then((response) => {
-          if (response.msg !== 'fail') {
-            this.get_table_data()
-            this.getPendingList()
-            this.$notify({ title: '成功', message: '删除成功', type: 'success', duration: 2000 })
-          } else {
-            failproccess(response, this.$notify)
-          }
-        })
-      }).catch(() => {
-        this.$message({ type: 'info', message: '已取消删除' })
-      })
-    },
-    handleRejectRepair(row) {
-      console.log('报修驳回')
-      this.rejectRepair.temp = Object.assign({}, row)
-      this.dialogStatus = 'rejectRepair'
-      this.rejectRepair.dialogFormVisible = true
-    },
-    rejectRepairData() {
-      console.log('报修驳回确认')
-      this.isokDisable = true
-      setTimeout(() => {
-        this.isokDisable = false
-      }, 1000)
-      this.$refs['rejectRepair'].validate(valid => {
-        if (valid) {
-          this.requestParam.name = 'updateMaintain'
-          this.requestParam.parammaps = {}
-          this.requestParam.parammaps.shutdownPerson = Cookies.get('employeid')
-          this.requestParam.parammaps.id = this.rejectRepair.temp.id
-          this.requestParam.parammaps.shutdownReason = this.rejectRepair.temp.shutdownReason
-          PostDataByName(this.requestParam).then((response) => {
-            if (response.msg !== 'fail') {
-              this.get_table_data()
-              this.getPendingList()
-              this.rejectRepair.dialogFormVisible = false
-              this.$notify({ title: '成功', message: '驳回成功', type: 'success', duration: 2000 })
-            } else {
-              failproccess(response, this.$notify)
-            }
-          })
-        }
-      })
-    },
-    handleDownload() {
-      this.$alert('设备维修正在导出中,请勿刷新或离开本页面,若导出时间过长,建议缩小导出数据范围重新导出', {})
-      this.isPercentage = true
-      this.percentage = 1
-      var timer = setInterval(() => {
-        this.percentage += 5
-        if (this.percentage > 95) {
-          this.percentage = 99
-          clearInterval(timer)
-        }
-        this.percentage = this.percentage
-      }, 1000)
-      this.downLoadParm = {}
-      this.downLoadParm.name = 'loadRepirsList'
-      this.downLoadParm.offset = 0
-      this.downLoadParm.page = 1
-      this.downLoadParm.returntype = 'Map'
-      if (this.$refs['inputDatetime'] !== undefined && this.$refs['inputDatetime'].value !== null) {
-        this.getdataListParm.parammaps.startTime = this.$refs['inputDatetime'].value[0]
-        this.getdataListParm.parammaps.stopTime = this.$refs['inputDatetime'].value[1]
-      } else {
-        this.getdataListParm.parammaps.startTime = ''
-        this.getdataListParm.parammaps.stopTime = ''
-      }
-      this.downLoadParm.parammaps = this.getdataListParm.parammaps
-      GetAccount(this.downLoadParm).then(response => {
-        if (response.data.list !== null && response.data.list !== '') {
-          for (let i = 0; i < response.data.list.length; i++) {
-            if (response.data.list[i].orderStatue == 0) {
-              this.$set(response.data.list[i], 'orderStatue', '待接单')
-            } else if (response.data.list[i].orderStatue == 1) {
-              this.$set(response.data.list[i], 'orderStatue', '维修中')
-            } else if (response.data.list[i].orderStatue == 2) {
-              this.$set(response.data.list[i], 'orderStatue', '维修完成')
-            } else if (response.data.list[i].orderStatue == 3) {
-              this.$set(response.data.list[i], 'orderStatue', '已驳回')
-            }
-            if (response.data.list[i].SHStatue == 1) {
-              this.$set(response.data.list[i], 'SHStatue', '')
-            } else if (response.data.list[i].SHStatue == 2 || response.data.list[i].SHStatue == 3) {
-              this.$set(response.data.list[i], 'SHStatue', '审核中')
-            } else if (response.data.list[i].SHStatue == 4 || response.data.list[i].SHStatue == 6) {
-              this.$set(response.data.list[i], 'SHStatue', '未通过')
-            } else if (response.data.list[i].SHStatue == 5) {
-              this.$set(response.data.list[i], 'SHStatue', '已通过')
-            }
-          }
-        } else {
-          response.data.list = []
-        }
-        this.downLoadList = response.data.list
-        console.log(this.downLoadList)
-        if (response.data.list !== '') {
-          this.percentage = 99
-          setTimeout(() => {
-            this.isPercentage = false
-          }, 2000)
-        }
-        const elecExcelDatas = [
-          {
-            tHeader: ['报修单号', '牧场', '设备内部编号', '设备名称', '规格型号', '部门', '故障情况', '报修人', '报修时间', '维修日期', '维修部门', '处理状态', '领用单状态', '旧品录入状态', '审核状态', '故障部位', '故障详情', '故障原因', '处理方式'],
-            filterVal: ['repairCode', 'pastureName', 'eqCode', 'eqName', 'specification', 'departmentName', 'details', 'requesterName', 'requestTime', 'stopTime', 'repairDeptName', 'orderStatue', 'LYStatue', 'LRStatue', 'SHStatue', 'positionName', 'appearanceName', 'failureCause', 'treatmentMethod'],
-            tableDatas: this.downLoadList,
-            sheetName: '设备维修'
-          }
-        ]
-        json2excel(elecExcelDatas, '设备维修', true, 'xlsx')
-      })
-    }
   }
 }
 </script>

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä