zhangdan 4 년 전
부모
커밋
2c78034b41

+ 28 - 22
src/views/cleanManage/addDiverModal.vue

@@ -6,26 +6,28 @@
       v-model="isshow"
       @cancle="cancel"
       :centered="true">
-      <a-form-model ref="ruleForm" :model="formData" :rules="rules" :label-col="{ span: 6 }" :wrapper-col="{ span: 15 }">
-        <a-form-model-item label="司机姓名" prop="name" ref="name">
-          <a-input v-model.trim="formData.name" :maxLength="30" placeholder="请输入司机姓名(最多30个字符)" id="addDiverModal-name"/>
-        </a-form-model-item>
-        <a-form-model-item label="手机号码" prop="phone" ref="phone">
-          <a-input v-model.trim="formData.phone" :maxLength="11" placeholder="请输入手机号" id="addDiverModal-phone"/>
-        </a-form-model-item>
-        <a-form-model-item label="状态" prop="loginFlag"ref="loginFlag"><a-radio-group
-          name="radioGroup"
-          v-model="formData.loginFlag"
-          id="addDiverModal-loginFlag"
-        >
-          <a-radio :value="1">是</a-radio>
-          <a-radio :value="0">否</a-radio>
-        </a-radio-group> </a-form-model-item>
-        <a-form-model-item label="" class="btn-cont" :wrapper-col="{ span: 24, offset: 8 }">
-          <a-button type="primary" @click="onSubmit" :style="{ marginRight: '15px' }" id="addDiverModal-onSubmit">保存</a-button>
-          <a-button @click="cancel" :style="{ marginLeft: '15px' }" id="addDiverModal-cancel">取消</a-button>
-        </a-form-model-item>
-      </a-form-model>
+      <a-spin :spinning="loading">
+        <a-form-model ref="ruleForm" :model="formData" :rules="rules" :label-col="{ span: 6 }" :wrapper-col="{ span: 15 }">
+          <a-form-model-item label="司机姓名" prop="name" ref="name">
+            <a-input v-model.trim="formData.name" :maxLength="30" placeholder="请输入司机姓名(最多30个字符)" id="addDiverModal-name"/>
+          </a-form-model-item>
+          <a-form-model-item label="手机号码" prop="phone" ref="phone">
+            <a-input v-model.trim="formData.phone" :maxLength="11" placeholder="请输入手机号" id="addDiverModal-phone"/>
+          </a-form-model-item>
+          <a-form-model-item label="状态" prop="loginFlag"ref="loginFlag"><a-radio-group
+            name="radioGroup"
+            v-model="formData.loginFlag"
+            id="addDiverModal-loginFlag"
+          >
+            <a-radio :value="1">是</a-radio>
+            <a-radio :value="0">否</a-radio>
+          </a-radio-group> </a-form-model-item>
+          <a-form-model-item label="" class="btn-cont" :wrapper-col="{ span: 24, offset: 8 }">
+            <a-button type="primary" @click="onSubmit" :style="{ marginRight: '15px' }" id="addDiverModal-onSubmit">保存</a-button>
+            <a-button @click="cancel" :style="{ marginLeft: '15px' }" id="addDiverModal-cancel">取消</a-button>
+          </a-form-model-item>
+        </a-form-model>
+      </a-spin >
     </a-modal>
   </div>
 </template>
@@ -66,7 +68,9 @@ export default {
       rules: {
         phone: [{ required: true, pattern: /^\d{11}$/, message: '请输入手机号', trigger: 'blur' }],
         name: [{ required: true, message: '请输入司机姓名', trigger: 'blur' }],
-        loginFlag: [{ required: true, message: '请选择状态', trigger: 'blur' }] }
+        loginFlag: [{ required: true, message: '请选择状态', trigger: 'blur' }]
+      },
+      loading: false
     }
   },
   methods: {
@@ -76,10 +80,12 @@ export default {
     },
     // 编辑查详情
     getPageInfo () {
+      this.loading = true
       driverDetails({
         id: this.itemId
       }).then(res => {
         if (res.status == 200) {
+          this.loading = false
           this.formData = Object.assign({}, this.formData, res.data)
           this.formData.loginFlag = Number(this.formData.loginFlag)
         }
@@ -92,7 +98,6 @@ export default {
         if (valid) {
           const params = JSON.parse(JSON.stringify(this.formData))
           saveDriver(params).then(res => {
-            console.log(res, 'rrrrrrrrr')
             if (res.status == 200) {
               _this.$message.success(res.message)
               _this.$emit('refresh')
@@ -135,6 +140,7 @@ export default {
         this.getPageInfo(newValue)
       } else {
         this.titleText = '新增'
+        console.log(this.loading)
       }
     }
   }

+ 12 - 4
src/views/cleanManage/cleanDetailModal.vue

@@ -1,7 +1,9 @@
 <template>
   <a-modal title="清运详情" :footer="null" v-model="isShow" @cancel="cancel" centered>
-    <div class="detail-item" v-for="item in itemData" :key="item.index"><span>{{ item.rubbishType }}:</span>{{ (item.cleanWeight/1000).toFixed(2) }} kg</div>
-    <a-empty v-if="itemData.length == 0" style="text-align: center;" />
+    <a-spin :spinning="loading">
+      <div class="detail-item" v-for="item in itemData" :key="item.index"><span>{{ item.rubbishType }}:</span>{{ (item.cleanWeight/1000).toFixed(2) }} kg</div>
+      <a-empty v-if="itemData.length == 0" style="text-align: center;" />
+    </a-spin>
   </a-modal>
 </template>
 
@@ -26,7 +28,8 @@ export default {
   data () {
     return {
       isShow: this.visible,
-      itemData: []
+      itemData: [],
+      loading: false
     }
   },
   methods: {
@@ -34,8 +37,12 @@ export default {
       this.$emit('close')
     },
     getDetailInfo () {
+      this.loading = true
       getCleanDetails({ deviceNo: this.deviceNo, cleanDate: this.cleanTime }).then(res => {
-        this.itemData = res.data
+        if (res.status == 200) {
+          this.itemData = res.data || []
+        }
+        this.loading = false
       })
     }
   },
@@ -46,6 +53,7 @@ export default {
     isShow (newValue, oldValue) {
       if (!newValue) {
         this.$emit('close')
+        this.itemData = []
       } else {
         this.getDetailInfo()
       }

+ 1 - 0
src/views/cleanManage/cleanModal.vue

@@ -72,6 +72,7 @@ export default {
         option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
       )
     },
+    // 司机数据
     getDriverList () {
       driverQueryList({ loginFlag: 1 }).then(res => {
         if (res.status == 200) {

+ 6 - 0
src/views/cleanManage/driverManage.vue

@@ -118,6 +118,12 @@ export default {
         this.$refs.table.refresh(true)
       }
     },
+    // refreshTable () {
+    //   if (!this.itemId) {
+		  // console.log(!this.itemId)
+    //     this.$refs.table.refresh()
+    //   }
+    // },
     // 新建
     openModal () {
       this.showModal = true

+ 0 - 5
src/views/cleanManage/netWorkCleanModal.vue

@@ -88,11 +88,6 @@ export default {
         this.$refs.table.refresh(true)
       }
     }
-    // stationNo (newValue, oldValue) {
-    //   if (newValue && this.isShow) {
-    //     this.$refs.table.refresh(true)
-    //   }
-    // }
   }
 }
 </script>

+ 0 - 8
src/views/cleanManage/netWorkCleanRecord.vue

@@ -189,14 +189,6 @@ export default {
       this.$refs.table.refresh(true)
       this.getTotal()
     },
-    // 刷新列表
-    // refreshTable () {
-    //   if (this.itemStationNo && this.time) {
-    //     this.$refs.table.refresh()
-    //   } else {
-    //     this.$refs.table.refresh(true)
-    //   }
-    // },
     // 重置
     reset () {
       this.queryParam = {

+ 27 - 25
src/views/cleanManage/notCleanNetwork.vue

@@ -271,13 +271,13 @@ export default {
     },
     // 编辑后刷新列表
     refreshTable () {
-	  // 编辑
-	  if (this.itemStationNo && this.itemDeviceNo) {
-	    this.$refs.table.refresh()
-	  } else {
-	    // 保存
-	    this.$refs.table.refresh(true)
-	  }
+      // 编辑
+      if (this.itemStationNo && this.itemDeviceNo) {
+        this.$refs.table.refresh()
+      } else {
+        // 保存
+        this.$refs.table.refresh(true)
+      }
     },
     // 获取网点数据
     getStationList () {
@@ -352,23 +352,25 @@ export default {
       }
       getCleanStationSum(params).then(res => {
         if (res.status == 200) {
-          this.recyclableWasteTotal = (res.data.totalWeight / 1000).toFixed(2) || 0
-          this.wastePaper = (res.data.paper / 1000).toFixed(2) || 0
-          this.wasteClothes = (res.data.clothes / 1000).toFixed(2) || 0
-          this.wasteMetal = (res.data.metal / 1000).toFixed(2) || 0
-          this.wastePlastics = (res.data.plastic / 1000).toFixed(2) || 0
-          this.wasteMetalPlastic = (res.data.metPla / 1000).toFixed(2) || 0
-          this.wasteGlass = (res.data.glass / 1000).toFixed(2) || 0
-          this.recyclable = (res.data.recycling / 1000).toFixed(2) || 0
-        } else {
-          this.recyclableWasteTotal = 0
-          this.wasteClothes = 0
-          this.wastePaper = 0
-          this.wasteMetal = 0
-          this.wastePlastics = 0
-          this.wasteMetalPlastic = 0
-          this.wasteGlass = 0
-          this.recyclable = 0
+          if (res.data) {
+            this.recyclableWasteTotal = (res.data.totalWeight / 1000).toFixed(2) || 0
+            this.wastePaper = (res.data.paper / 1000).toFixed(2) || 0
+            this.wasteClothes = (res.data.clothes / 1000).toFixed(2) || 0
+            this.wasteMetal = (res.data.metal / 1000).toFixed(2) || 0
+            this.wastePlastics = (res.data.plastic / 1000).toFixed(2) || 0
+            this.wasteMetalPlastic = (res.data.metPla / 1000).toFixed(2) || 0
+            this.wasteGlass = (res.data.glass / 1000).toFixed(2) || 0
+            this.recyclable = (res.data.recycling / 1000).toFixed(2) || 0
+          } else {
+            this.recyclableWasteTotal = 0
+            this.wasteClothes = 0
+            this.wastePaper = 0
+            this.wasteMetal = 0
+            this.wastePlastics = 0
+            this.wasteMetalPlastic = 0
+            this.wasteGlass = 0
+            this.recyclable = 0
+          }
         }
       })
     },
@@ -383,7 +385,7 @@ export default {
       this.queryParam.cityCode = undefined
       this.queryParam.districtCode = undefined
       this.time = []
-	  this.$refs.table.refresh(true)
+      this.$refs.table.refresh(true)
     },
     // 查看清运详情
     handleDetail (record) {

+ 77 - 79
src/views/equipmentManage/electronicScale/addElectronicScale.vue

@@ -1,36 +1,38 @@
 <template>
   <a-modal :footer="null" centered :title="titleText" v-model="isShow" @cancle="cancel">
-    <a-form-model :model="formData" ref="ruleForm" :rules="rules">
-      <a-form-model-item label="设备MAC地址" :label-col="{span:6}" :wrapper-col="{span:16}" prop="macAddress">
-        <a-input
-          placeholder="请输入设备MAC地址"
-          :disabled="id?true:false"
-          v-model="formData.macAddress"
-          allowClea
-          oninput="value=value.toLowerCase()"
-          :maxLength="12" />
-      </a-form-model-item>
-      <a-form-model-item label="设备名称" :label-col="{span:6}" :wrapper-col="{span:16}" prop="deviceName">
-        <a-input placeholder="请输入设备名称" v-model="formData.deviceName" allowClear :maxLength="30"/>
-      </a-form-model-item>
-      <a-form-model-item label="设备编号" :label-col="{span:6}" :wrapper-col="{span:16}" prop="deviceCode">
-        <a-input placeholder="请输入设备编号" v-model="formData.deviceCode" allowClear :maxLength="30"/>
-      </a-form-model-item>
-      <a-form-model-item label="设备型号" :label-col="{span:6}" :wrapper-col="{span:16}" prop="deviceModel">
-        <a-input placeholder="请输入设备型号" v-model="formData.deviceModel" allowClear :maxLength="30"/>
-      </a-form-model-item>
-      <a-form-model-item label="生产厂家" :label-col="{span:6}" :wrapper-col="{span:16}" prop="manufacturer">
-        <a-input placeholder="请输入生产厂家" v-model="formData.manufacturer" allowClear :maxLength="30"/>
-      </a-form-model-item>
-      <a-form-model-item :wrapper-col="{ span: 24, offset: 8 }">
-        <a-button type="primary" @click="handleSubmit()" :style="{ marginRight: '15px' }">
-          保存
-        </a-button>
-        <a-button :style="{ marginLeft: '15px' }" @click="cancel">
-          取消
-        </a-button>
-      </a-form-model-item>
-    </a-form-model>
+    <a-spin :spinning="loading">
+      <a-form-model :model="formData" ref="ruleForm" :rules="rules">
+        <a-form-model-item label="设备MAC地址" :label-col="{span:6}" :wrapper-col="{span:16}" prop="macAddress">
+          <a-input
+            placeholder="请输入设备MAC地址"
+            :disabled="id?true:false"
+            v-model="formData.macAddress"
+            allowClea
+            oninput="value=value.toLowerCase()"
+            :maxLength="12" />
+        </a-form-model-item>
+        <a-form-model-item label="设备名称" :label-col="{span:6}" :wrapper-col="{span:16}" prop="deviceName">
+          <a-input placeholder="请输入设备名称" v-model="formData.deviceName" allowClear :maxLength="30"/>
+        </a-form-model-item>
+        <a-form-model-item label="设备编号" :label-col="{span:6}" :wrapper-col="{span:16}" prop="deviceCode">
+          <a-input placeholder="请输入设备编号" v-model="formData.deviceCode" allowClear :maxLength="30"/>
+        </a-form-model-item>
+        <a-form-model-item label="设备型号" :label-col="{span:6}" :wrapper-col="{span:16}" prop="deviceModel">
+          <a-input placeholder="请输入设备型号" v-model="formData.deviceModel" allowClear :maxLength="30"/>
+        </a-form-model-item>
+        <a-form-model-item label="生产厂家" :label-col="{span:6}" :wrapper-col="{span:16}" prop="manufacturer">
+          <a-input placeholder="请输入生产厂家" v-model="formData.manufacturer" allowClear :maxLength="30"/>
+        </a-form-model-item>
+        <a-form-model-item :wrapper-col="{ span: 24, offset: 8 }">
+          <a-button type="primary" @click="handleSubmit()" :style="{ marginRight: '15px' }">
+            保存
+          </a-button>
+          <a-button :style="{ marginLeft: '15px' }" @click="cancel">
+            取消
+          </a-button>
+        </a-form-model-item>
+      </a-form-model>
+    </a-spin>
   </a-modal>
 </template>
 
@@ -59,50 +61,54 @@ export default {
       titleText: '新增',
       rules: {
         macAddress: [{ required: true, message: '请输入设备MAC地址(数字与英文字母组合)', trigger: 'blur', pattern: /^[A-Za-z0-9]+$/ }]
-      }
+      },
+      loading: false
     }
   },
   methods: {
-	  // 数据详情
-	  getPageInfo () {
-		 const _this = this
-	    deviceDetails({
-	      srcDeviceCode: _this.deviceCode
-	    }).then(res => {
-	      if (res.status == 200) {
-	  	  _this.formData = Object.assign({}, this.formData, res.data)
-	  	  _this.formData.loginFlag = Number(this.formData.loginFlag)
-	      }
-	    })
-	  },
+    // 数据详情
+    getPageInfo () {
+      const _this = this
+      _this.loading = true
+      deviceDetails({
+        srcDeviceCode: _this.deviceCode
+      }).then(res => {
+        if (res.status == 200) {
+          _this.loading = false
+          _this.formData = Object.assign({}, this.formData, res.data)
+          _this.formData.loginFlag = Number(this.formData.loginFlag)
+        }
+      })
+    },
+    // 保存
     handleSubmit () {
       this.$refs.ruleForm.validate(valid => {
         const _this = this
         if (valid) {
-	      const params = JSON.parse(JSON.stringify(this.formData))
-	      saveDevice(params).then(res => {
-	        console.log(res, 'rrrrrrrrr')
-	        if (res.status == 200) {
-	          _this.$message.success(res.message)
-	          _this.$emit('refresh')
-	          setTimeout(function () {
-	            _this.cancel()
-	          }, 300)
-	        }
-	      })
-	    }
-	  })
+          const params = JSON.parse(JSON.stringify(this.formData))
+          saveDevice(params).then(res => {
+            console.log(res, 'rrrrrrrrr')
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$emit('refresh')
+              setTimeout(function () {
+                _this.cancel()
+              }, 300)
+            }
+          })
+        }
+      })
     },
     cancel (e) {
-	  this.clear()
-	  this.$emit('close')
+      this.clear()
+      this.$emit('close')
     },
     clear () {
-	  this.$refs.ruleForm.resetFields()
-	  delete this.formData.id
-	  this.formData.macAddress = ''
-	  this.formData.deviceCode = ''
-	  this.formData.deviceName = ''
+      this.$refs.ruleForm.resetFields()
+      delete this.formData.id
+      this.formData.macAddress = ''
+      this.formData.deviceCode = ''
+      this.formData.deviceName = ''
       this.formData.deviceModel = ''
       this.formData.manufacturer = ''
     }
@@ -115,23 +121,15 @@ export default {
     },
     isShow (newValue, oldValue) {
       if (newValue) {
-		  if (this.id) { // 编辑
-		    this.titleText = '编辑'
-          console.log(this.deviceCode, '---------shebei 编号')
-		    this.getPageInfo()
-		  } else {
-		    this.titleText = '新增'
-		  }
+        if (this.id) { // 编辑
+          this.titleText = '编辑'
+          this.getPageInfo()
+        } else {
+          this.titleText = '新增'
+        }
       } else {
-		  this.cancel()
+        this.cancel()
       }
-      // if (!newValue) {
-      //   this.$emit('close')
-      // } else {
-      //   this.$nextTick(() => {
-      //     this.$refs.ruleForm.resetFields()
-      //   })
-      // }
     }
   }
 }

+ 0 - 2
src/views/equipmentManage/electronicScale/electronicScale.vue

@@ -31,8 +31,6 @@
         <a-icon type="qrcode" title="二维码" class="actionBtn icon-green" @click="getQrCode(record)" />
         <a-icon type="edit" title="编辑" class="actionBtn icon-blues" @click="handleEdit(record)" v-hasPermission="'B_electronicScale_edit'"/>
         <a-icon type="delete" title="删除" class="actionBtn icon-red" @click="delect(record)" v-hasPermission="'B_electronicScale_del'"/>
-        <!-- <a-icon type="edit" title="编辑" class="actionBtn icon-blues" @click="handleEdit(record)"/>
-        <a-icon type="delete" title="删除" class="actionBtn icon-red" @click="delect(record)"/> -->
       </span>
       <span v-if="!($hasPermissions('B_electronicScale_edit') && $hasPermissions('B_electronicScale_del'))">--</span>
     </s-table>