소스 검색

仓库地图

zhongtianhaoyuan 3 년 전
부모
커밋
d673e6cfb5
2개의 변경된 파일38개의 추가작업 그리고 30개의 파일을 삭제
  1. 5 4
      src/components/mapdrag/mapdrag.vue
  2. 33 26
      src/views/warehousenew/warehouseManagementList.vue

+ 5 - 4
src/components/mapdrag/mapdrag.vue

@@ -112,10 +112,8 @@
       <el-button>经纬度:{{center}}</el-button>
       <el-button>经纬度:{{center}}</el-button>
       <el-button @click="positions" type="primary" v-if='!isShowaddress'>确定定位</el-button>
       <el-button @click="positions" type="primary" v-if='!isShowaddress'>确定定位</el-button>
       <el-button @click="anewselect" v-if='!isShowaddress'>重新选择</el-button>
       <el-button @click="anewselect" v-if='!isShowaddress'>重新选择</el-button>
-      <el-button @click="submit" v-if='isShowaddress'>确定</el-button>
+      <el-button @click="submit" v-if='isShowaddress && !warehousePositioning'>确定</el-button>
     </div>
     </div>
-
-
   </div>
   </div>
 </template>
 </template>
 
 
@@ -149,7 +147,7 @@
         center: '',
         center: '',
       }
       }
     },
     },
-    props: ['flagVisible', 'position', 'selectedOptions', 'isShowaddress', 'type'],
+    props: ['flagVisible', 'position', 'selectedOptions', 'isShowaddress', 'type','warehousePositioning'],
     computed: {
     computed: {
       showFlag() {
       showFlag() {
         return this.flagVisible
         return this.flagVisible
@@ -210,6 +208,9 @@
             that.map.add(marker)
             that.map.add(marker)
           }
           }
         })
         })
+        if(this.warehousePositioning.lat && this.warehousePositioning.lng){
+            this.map.setCenter([this.warehousePositioning.lat,this.warehousePositioning.lng])
+        }
         this.marker = new AMap.Marker({
         this.marker = new AMap.Marker({
           icon: new AMap.Icon({
           icon: new AMap.Icon({
             size: new AMap.Size(0, 0),
             size: new AMap.Size(0, 0),

+ 33 - 26
src/views/warehousenew/warehouseManagementList.vue

@@ -18,7 +18,7 @@
           </el-form-item>
           </el-form-item>
           <!--仓库名称-->
           <!--仓库名称-->
           <el-form-item label-width="120px" label="仓库名" span="1" prop="warehouseName">
           <el-form-item label-width="120px" label="仓库名" span="1" prop="warehouseName">
-            <el-select v-model="warehouseInfo.warehouseName" placeholder="请选择仓库名" filterable clearable remote  @change="selectstaff" :filter-method="warehouseQuery">
+            <el-select v-model="warehouseInfo.warehouseName" placeholder="请选择仓库名" filterable clearable @change="selectstaff" :filter-method="warehouseQuery">
               <el-option v-for="item in warehouseXiaLa" :key="item.warehouseName" :label="item.warehouseName" :value="item.warehouseName" />
               <el-option v-for="item in warehouseXiaLa" :key="item.warehouseName" :label="item.warehouseName" :value="item.warehouseName" />
             </el-select>
             </el-select>
           </el-form-item>
           </el-form-item>
@@ -66,20 +66,19 @@
     <div class="position">
     <div class="position">
       <div class="title"><span style="font-size:18px;font-weight: 600;margin-left:20px">当期储量</span></div>
       <div class="title"><span style="font-size:18px;font-weight: 600;margin-left:20px">当期储量</span></div>
       <ws-button type="primary" @click="handleAdd()" v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.add`" style="margin-left:20px">添加</ws-button>
       <ws-button type="primary" @click="handleAdd()" v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.add`" style="margin-left:20px">添加</ws-button>
-      <!-- <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.view` " @click="handleLook()">查看</ws-button> -->
       <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.edit` " @click="handleEdit()">编辑</ws-button>
       <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.edit` " @click="handleEdit()">编辑</ws-button>
       <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.delete`" @click="handleDelete()">删除</ws-button>
       <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.delete`" @click="handleDelete()">删除</ws-button>
       <ws-button  v-hasPermission=" `warehouseManagement.warehouse.warehouseInfo.view`" @click="record()">记录</ws-button>
       <ws-button  v-hasPermission=" `warehouseManagement.warehouse.warehouseInfo.view`" @click="record()">记录</ws-button>
       <ws-button  v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.view`" @click="loss()">盘库</ws-button>
       <ws-button  v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.view`" @click="loss()">盘库</ws-button>
-      <ws-button  v-if="warehouseInfo.clearStatusFlag == 1" @click="clearance()">清库</ws-button>
-      <ws-button  v-if="warehouseInfo.clearStatusFlag == 3" disabled> 已清库</ws-button>
+      <ws-button  v-if="warehouseInfo.clearStatusFlag == 1 && warehouseType == '2'" @click="clearance()">清库</ws-button>
+      <ws-button  v-if="warehouseInfo.clearStatusFlag == 3 && warehouseType == '2'" disabled> 已清库</ws-button>
       <!-- createType 1手动创建 2 自动创建 -->
       <!-- createType 1手动创建 2 自动创建 -->
       <ws-button v-if='warehouseInfo.createType==1' v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.delete`" @click="indialog = true">入库量</ws-button>
       <ws-button v-if='warehouseInfo.createType==1' v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.delete`" @click="indialog = true">入库量</ws-button>
       <ws-button v-if='list.length>0' @click="handlTask()">任务</ws-button>
       <ws-button v-if='list.length>0' @click="handlTask()">任务</ws-button>
       <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.add`" @click="outData(1)">导出</ws-button>
       <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.add`" @click="outData(1)">导出</ws-button>
       <ws-button @click="outData(2)">打印</ws-button>
       <ws-button @click="outData(2)">打印</ws-button>
       <ws-button @click="transformation()">折转</ws-button>
       <ws-button @click="transformation()">折转</ws-button>
-      <ws-button v-hasPermission="`warehouseManagement.warehouse.warehouseInfo.delete`" @click="handleall()">全部仓库</ws-button>
+      <ws-button v-hasPermission=" `warehouseManagement.warehouse.warehouseInfo.view`" @click="handleall()">全部仓库</ws-button>
         <el-table ref='table' show-summary :summary-method="getSummaries" class="wenzi" :data="warehouseList" style="width: 100%; margin-top: 20px" height="calc(100% - 45px)" v-if="warehouseType == '1'">
         <el-table ref='table' show-summary :summary-method="getSummaries" class="wenzi" :data="warehouseList" style="width: 100%; margin-top: 20px" height="calc(100% - 45px)" v-if="warehouseType == '1'">
         <el-table-column prop="warehouseName" label="仓库名">
         <el-table-column prop="warehouseName" label="仓库名">
         </el-table-column>
         </el-table-column>
@@ -171,7 +170,7 @@
           <div :class="btnCss2" @click="mapChange(2)">定位</div>
           <div :class="btnCss2" @click="mapChange(2)">定位</div>
         </div>
         </div>
         <div class="map-item" v-if="mapshow">
         <div class="map-item" v-if="mapshow">
-          <map-drag @marker="marker" ref="childMap" :isShowaddress='false' v-on:addressListen='getAddress' v-on:pickedAddress='searchAddress' ></map-drag>
+          <map-drag @marker="marker" ref="childMap" :isShowaddress='true' v-on:addressListen='getAddress' v-on:pickedAddress='searchAddress' :warehousePositioning="warehousePositioning"></map-drag>
         </div>
         </div>
         <div v-if="!mapshow && warehouseType == '1'" class="monitor">
         <div v-if="!mapshow && warehouseType == '1'" class="monitor">
             <div class="video1">
             <div class="video1">
@@ -218,7 +217,7 @@
             <!--仓库名称-->
             <!--仓库名称-->
             <el-form-item label="仓库名称" span="1" prop="warehouseName">
             <el-form-item label="仓库名称" span="1" prop="warehouseName">
               <el-select v-model="parameter.warehouseName" placeholder="请选择仓库名称" filterable clearable>
               <el-select v-model="parameter.warehouseName" placeholder="请选择仓库名称" filterable clearable>
-                <el-option v-for="item in warehouseXiaLa" :key="item.warehouseName" :label="item.warehouseName" :value="item.warehouseName"/>
+                <el-option v-for="item in warehouseXiaLa" :key="item.warehouseName" :label="item.warehouseName" :value="item.warehouseName" />
               </el-select>
               </el-select>
             </el-form-item>
             </el-form-item>
             <el-form-item label="增量比例(%)" v-if="headerText == '打印记录'">
             <el-form-item label="增量比例(%)" v-if="headerText == '打印记录'">
@@ -315,6 +314,7 @@
           year: dayjs().format('YYYY'),
           year: dayjs().format('YYYY'),
           month: dayjs().format('MM'),
           month: dayjs().format('MM'),
         },
         },
+        warehousePositioning:{},
       }
       }
     },
     },
     activated() {
     activated() {
@@ -646,11 +646,6 @@
           this.btnCss1 = "btn"
           this.btnCss1 = "btn"
            this.btnCss2 = "btn1"
            this.btnCss2 = "btn1"
           this. maptitle = "定位"
           this. maptitle = "定位"
-          
-          let e= {}
-           e.lat = "122.095"
-           e.lng  = "40.185"
-           this.searchAddress(e)
         }
         }
       },
       },
       getAddress(data) {
       getAddress(data) {
@@ -681,28 +676,27 @@
               this.btnCss2 ="btn1"
               this.btnCss2 ="btn1"
               this.mapshow = true
               this.mapshow = true
             }else{
             }else{
-              this.maptitle = "库点监控"
+               this.maptitle = "库点监控"
                this.btnCss1 ="btn1"
                this.btnCss1 ="btn1"
-              this.btnCss2 ="btn"
-                this.mapshow = false
+               this.btnCss2 ="btn"
+               this.mapshow = false
             }
             }
             break
             break
           }
           }
         }
         }
         this.warehouseXiaLa = this.warehouseXiaLaCopy
         this.warehouseXiaLa = this.warehouseXiaLaCopy
+        if(this.warehouseInfo.warehouseName.indexOf('(临)') != -1){
+          this.warehouseInfo.warehouseName = this.warehouseInfo.warehouseName.replace(' (临)','')
+        }
         this.getList1()
         this.getList1()
-       
       },
       },
       warehouseQuery(query){
       warehouseQuery(query){
         if(query){
         if(query){
           this.warehouseXiaLa = this.warehouseAllXiaLa
           this.warehouseXiaLa = this.warehouseAllXiaLa
-          this.warehouseXiaLa=this.warehouseAllXiaLa.filter(item=>item.warehouseName.indexOf(query)>-1)
+          this.warehouseXiaLa = this.warehouseAllXiaLa.filter(item=>item.warehouseName.indexOf(query)>-1)
         }else{
         }else{
           this.warehouseXiaLa = this.warehouseXiaLaCopy
           this.warehouseXiaLa = this.warehouseXiaLaCopy
         }
         }
-      },
-      optionsOther(){
-
       },
       },
       getCurrentDate(format) {
       getCurrentDate(format) {
       var now = new Date();
       var now = new Date();
@@ -855,7 +849,6 @@
             // warehouseBaseInfoList: JSON.stringify(this.list)
             // warehouseBaseInfoList: JSON.stringify(this.list)
           }
           }
         })
         })
-        // this.$router.push({ path: 'tranManagementWarehouseInOutTask',query:{warehouseBaseInfoList:JSON.stringify(this.list)} })
       },
       },
       getSummaries(param) {
       getSummaries(param) {
         const {
         const {
@@ -867,7 +860,6 @@
           if (index === 0) {
           if (index === 0) {
             sums[index] = '合计'
             sums[index] = '合计'
           } else if (
           } else if (
-           
             index === 4 ||
             index === 4 ||
             index === 5 ||
             index === 5 ||
             index === 6
             index === 6
@@ -983,9 +975,12 @@
             })
             })
               .toPromise()
               .toPromise()
               .then((response) => {
               .then((response) => {
+                for(var tmp = 0 ; tmp < response.length ; tmp++){
+                  if(response[tmp].warehouseType == '2'){
+                    response[tmp].warehouseName = response[tmp].warehouseName + " (临)"
+                  }
+                }
                 this.warehouseAllXiaLa = response
                 this.warehouseAllXiaLa = response
-                // this.warehouseInfo.warehouseName = this.warehouseXiaLa[0].warehouseName
-                // this.getList1()
               })
               })
         getsponsible({
         getsponsible({
             compId: localStorage.getItem('ws-pf_compId')
             compId: localStorage.getItem('ws-pf_compId')
@@ -1018,7 +1013,6 @@
                   if (response.warehouseViewList[q].warehouseNumViewList[i].storage) {
                   if (response.warehouseViewList[q].warehouseNumViewList[i].storage) {
                     response.warehouseViewList[q].warehouseNumViewList[i].storage = Number(response.warehouseViewList[q].warehouseNumViewList[i].storage).toFixed(3)
                     response.warehouseViewList[q].warehouseNumViewList[i].storage = Number(response.warehouseViewList[q].warehouseNumViewList[i].storage).toFixed(3)
                   }
                   }
-                  // debugger
                   if (response.warehouseViewList[q].warehouseNumViewList[i].inNetWeight && response.warehouseViewList[q].warehouseNumViewList[i].outNetWeight) {
                   if (response.warehouseViewList[q].warehouseNumViewList[i].inNetWeight && response.warehouseViewList[q].warehouseNumViewList[i].outNetWeight) {
                     response.warehouseViewList[q].warehouseNumViewList[i].surplus = (response.warehouseViewList[q].warehouseNumViewList[i].inNetWeight - response.warehouseViewList[q].warehouseNumViewList[i].outNetWeight).toFixed(3)
                     response.warehouseViewList[q].warehouseNumViewList[i].surplus = (response.warehouseViewList[q].warehouseNumViewList[i].inNetWeight - response.warehouseViewList[q].warehouseNumViewList[i].outNetWeight).toFixed(3)
                   } else if (response.warehouseViewList[q].warehouseNumViewList[i].inNetWeight) {
                   } else if (response.warehouseViewList[q].warehouseNumViewList[i].inNetWeight) {
@@ -1027,7 +1021,6 @@
                 }  
                 }  
               }
               }
             }
             }
-            // }
             
             
             if(this.warehouseType == '1'){
             if(this.warehouseType == '1'){
               this.totalReserves = response.warehouseNumViewList
               this.totalReserves = response.warehouseNumViewList
@@ -1039,6 +1032,20 @@
             this.warehouseInfo = this.warehouseList[0]
             this.warehouseInfo = this.warehouseList[0]
             this.warehouseInfo.warehouseLocation = this.warehouseList[0].warehousePrivate + this.warehouseList[0].warehouseCity + this.warehouseList[0].warehouseArea
             this.warehouseInfo.warehouseLocation = this.warehouseList[0].warehousePrivate + this.warehouseList[0].warehouseCity + this.warehouseList[0].warehouseArea
             this.warehouseInfo.maxReserves = 0
             this.warehouseInfo.maxReserves = 0
+            //经纬度
+             this.warehousePositioning.lat = this.warehouseInfo.warehousePositioning.split(",")[1]
+             this.warehousePositioning.lng = this.warehouseInfo.warehousePositioning.split(",")[0]
+            //   if(this.warehouseType == '2'){
+            //   this.maptitle = "定位"
+            //   this.btnCss2 ="btn1"
+            //   this.mapshow = true
+            //   this.mapChange(2)
+            //   }else{
+            //   this.maptitle = "库点监控"
+            //   this.btnCss1 ="btn1"
+            //   this.btnCss2 ="btn"
+            //   this.mapshow = false
+            // }
              for(let j = 0 ; j < this.warehouseXiaLa.length ; j++){
              for(let j = 0 ; j < this.warehouseXiaLa.length ; j++){
                 if(this.warehouseInfo.warehouseName == this.warehouseXiaLa[j].warehouseName){
                 if(this.warehouseInfo.warehouseName == this.warehouseXiaLa[j].warehouseName){
                 for(let count = 0 ;count < this.warehouseXiaLa[j].goodsNameInfos.length ; count++){
                 for(let count = 0 ;count < this.warehouseXiaLa[j].goodsNameInfos.length ; count++){