gjy 3 年之前
父節點
當前提交
2a5c0147b3

+ 23 - 3
src/components/mapdrag/mapdrag.vue

@@ -4,7 +4,7 @@
   margin-top: 64px;
 }
 #mapContainer {
-  width: 300px;
+  width: 750px;
   height: 300px;
 }
 #tip {
@@ -83,6 +83,7 @@
 </template>
 
 <script>
+import { regionData, CodeToText, TextToCode } from 'element-china-area-data'
 import image from '../../../public/img/ic_locationmarker.jpg'
 export default {
   data() {
@@ -95,6 +96,7 @@ export default {
       citys: [],
       city: '',
       polygons: [],
+      selectedOptions1:[],
       areacode: '',
       address: '',
       objPoint: [],
@@ -104,12 +106,26 @@ export default {
       status: true,
     }
   },
-  props: ['flagVisible', 'position'],
+  props: ['flagVisible', 'position','selectedOptions'],
   computed: {
     showFlag() {
       return this.flagVisible
     },
   },
+  watch: {
+    selectedOptions:{
+      handler(newValue, oldValue) {
+        console.log(CodeToText[newValue[1]])
+        this.province=newValue[0]
+        this.selectP(this.province)
+        this.city = CodeToText[newValue[1]]
+        this.selectC(CodeToText[newValue[1]])
+        this.district= newValue[2]
+        this.selectD(this.district)
+      },
+      deep: true
+    }
+  },
   async created() {
     // 已载入高德地图API,则直接初始化地图
     if (window.AMap && window.AMapUI) {
@@ -122,6 +138,7 @@ export default {
     }
   },
   mounted() {
+      // console.log(this)
     setTimeout(() => {
       var that = this
       this.map = new AMap.Map('mapContainer', {
@@ -270,6 +287,7 @@ export default {
         }
         var district = new AMap.DistrictSearch(opts) // 注意:需要使用插件同步下发功能才能这样直接使用
         function getData(data) {
+          console.log(data)
           that.$emit('selectedAddress', data)
           // 清除地图上的所有覆盖物
           that.areacode = data.citycode
@@ -306,19 +324,21 @@ export default {
         let sear = val ? params : '中国'
         district.search(sear, function (status, result) {
           if (status === 'complete') {
-            getData(result.districtList[0])
+              getData(result.districtList[0])
           }
         })
       })
     },
     selectP(val) {
       if (this.status) {
+        this.$emit('provinceChange', val)
         this.loadmap(val)
         this.city = ''
         this.district = ''
       }
     },
     selectC(val) {
+      console.log(val)
       if (this.status) {
         this.loadmap(val)
         this.district = ''

+ 1 - 0
src/views/contractManagement/futuresPurchaseContractAdd.vue

@@ -1483,6 +1483,7 @@ export default {
             .toPromise()
             .then((response) => {
               this.$message.success('添加成功')
+              this.selectedOptions=[]
               this.deptBudgetList = {
                 deliverType: '1',
                 finalTradingVolume: 0,

+ 8 - 8
src/views/tranManagement/tranManagementFireFeedback.vue

@@ -212,7 +212,7 @@
                   class="bg-bottom"
                   type="primary"
                   size="small"
-                  @click="submit(deptBudgetList)"
+                  @click="submit(index)"
                 >提交</el-button>
               </div>
             </span>
@@ -590,8 +590,8 @@ export default {
         }
       })
     },
-    submit() {
-      for (var i = 0; i < this.freightspace.length; i++) {
+    submit(index) {
+      // for (var i = 0; i < this.freightspace.length; i++) {
           // if (!this.freightspace[i].driver) {
           //   this.$message({
           //     message: '司机姓名不能为空!',
@@ -613,7 +613,7 @@ export default {
           //   })
           //   return
           // }
-          if (!this.freightspace[i].loadNetWeight) {
+          if (!this.freightspace[index].loadNetWeight) {
             this.$message({
               message: '装车净重不能为空!',
               type: 'warning'
@@ -621,8 +621,8 @@ export default {
             return
           }
           if (
-            this.freightspace[i].loadNetWeight < 0 ||
-            this.freightspace[i].loadNetWeight > 10000
+            this.freightspace[index].loadNetWeight < 0 ||
+            this.freightspace[index].loadNetWeight > 10000
           ) {
             this.$message({
               message: '装车净重输入错误!',
@@ -630,7 +630,7 @@ export default {
             })
             return
           }
-          if (!this.freightspace[i].loadingDate) {
+          if (!this.freightspace[index].loadingDate) {
             this.$message({
               message: '装车日期不能为空!',
               type: 'warning'
@@ -638,7 +638,7 @@ export default {
             return
           }
         
-      }
+      // }
       if (sessionStorage.getItem('sh-msg')) {
         this.validateFunc()
       } else {

+ 3 - 3
src/views/tranManagement/tranManagementTransporFeedback.vue

@@ -234,10 +234,10 @@
                     alt
                   />
                 </el-upload>
-                <span v-if="deptBudgetList.tranCarInfoList[index].loadPoundImg != null ">1</span>
+                <span v-if="item.loadPoundImg != null ">1</span>
                 <span
                   v-if="
-                    deptBudgetList.tranCarInfoList[index].loadPoundImg == null
+                    item.loadPoundImg == null
                   "
                 >未上传</span>
               </template>
@@ -376,7 +376,7 @@ export default {
           driverPhone: '',
           carNo: '',
           loadNetWeight: '',
-          loadPoundImg: ''
+          loadPoundImg: null
         }
         // {loadPoundImg:{}},
       ],

+ 9 - 3
src/views/warehouse/warehouseManagementAdd.vue

@@ -190,6 +190,7 @@
     <ws-form ref="deptBudgetList" :model="deptBudgetList">
       <div class="small-title" v-show="radio == 1">上传仓库照片</div>
       <el-upload
+      ref='upload'
         action="https://www.zthymaoyi.com/upload/admin"
         :show-file-list="false"
         :on-success="
@@ -221,7 +222,7 @@
         </div>
       </div>
       <div style="margin-bottom: 5px" class="small-title">仓库定位</div>
-      <map-drag @marker="marker" @selectedAddress="selectedAddress"></map-drag>
+      <map-drag  @marker="marker" @selectedAddress="selectedAddress" @provinceChange='provinceChange'></map-drag>
     </ws-form>
     <!-- 提交 -->
     <div style="text-align: right; padding: 10px" class="center">
@@ -387,6 +388,9 @@ export default {
       this.deptBudgetList.warehousePositioning =
         e.center.lat + ',' + e.center.lng
     },
+    provinceChange(e){
+      console.log(CodeToText[e])
+    },
     confirmPositioncity() {
       this.listDate.level = 'city'
       this.listDate.country = this.name
@@ -545,8 +549,9 @@ export default {
                   .then((response) => {
                     this.$message.success('添加成功')
                     this.deptBudgetList = {}
-                    this.freightspace = {}
+                    this.freightspace = [{ binNumber: '', maxStorage: '', remark: '' }]
                     this.selectedOptions = ''
+                    this.addressUrls=[]
                     this.$router.push({ path: 'warehouseManagementList' })
                   })
               } else {
@@ -643,7 +648,8 @@ export default {
                   .then((response) => {
                     this.$message.success('添加成功')
                     this.deptBudgetList = {}
-                    this.freightspace = {}
+                    this.freightspace = [{ binNumber: '', maxStorage: '', remark: '' }]
+                     this.addressUrls=[]
                     this.selectedOptions = ''
                     this.$router.push({ path: 'warehouseManagementList' })
                   })

+ 1 - 0
src/views/warehouse/warehouseManagementEdit.vue

@@ -217,6 +217,7 @@
           </div>
         <div class="small-title">仓库定位</div>
         <map-drag
+        :selectedOptions='selectedOptions'
           @marker="marker"
           @selectedAddress="selectedAddress"
         ></map-drag>

+ 1 - 1
src/views/warehouse/warehouseManagementPut.vue

@@ -918,7 +918,7 @@ export default {
         })
         return
       }
-      if (!this.deptBudgetList.deductionAmount) {
+      if (!String(this.deptBudgetList.deductionAmount)) {
         this.$message({
           message: '扣款不能为空',
           type: 'warning',