瀏覽代碼

修改地区

mxx 3 年之前
父節點
當前提交
aa98b0650e

+ 76 - 3
src/views/contractManagement/futuresPurchaseContractAdd.vue

@@ -270,7 +270,7 @@
         </ws-form-item>
         <!--交货所在地区-->
         <ws-form-item label="交货所在地区" span="1" prop="sourceGoods">
-          <el-cascader
+          <!-- <el-cascader
             :options="options_"
             v-model="selectedOptions"
             clearable
@@ -278,7 +278,13 @@
             placeholder="请选择交货所在地区"
             style="width: 200%"
             @change="handleChange"
-          />
+          /> -->
+               <el-button
+              @click="mapInputClick('deliveryProv')"
+              class="address-btn"
+            >
+              {{ newSelectedOptions1 }}
+            </el-button>
         </ws-form-item>
         <!--点价(元/吨)-->
         <ws-form-item label="点价(元/吨)" span="1" prop="pointPrice">
@@ -581,6 +587,15 @@
         accept=".jpg, .jpeg, .png, .pdf, .doc, .zip, .rar"
       />
     </ws-form>
+     <div v-if="dialogVisible" class="map">
+        <map-drag
+          @marker="marker"
+          :isShowaddress="true"
+          v-on:addressListen="getAddress"
+          :type="type"
+        >
+        </map-drag>
+      </div>
     <div style="text-align: right; padding: 10px" class="center">
       <el-button
         class="bg-bottom"
@@ -606,11 +621,12 @@ import {
 import { regionData,provinceAndCityDataPlus, CodeToText, TextToCode } from 'element-china-area-data'
 import { dayjs, fmoney, EventBus } from 'base-core-lib'
 import WsUpload from '@/components/WsUpload'
+import mapDrag from '@/components/mapdrag/mapdrag'
 
 export default {
   name: 'viewSpareMoney',
   components: {
-    WsUpload,
+    WsUpload,mapDrag
   },
   watch: {
     vesselId(val) {
@@ -622,6 +638,9 @@ export default {
   },
   data() {
     return {
+       type: '',
+      dialogVisible: false,
+       newSelectedOptions1: '请选择交货所在地区',
       //弹出框
       dialogViewSpareMoney: false,
       dialogApproveFormVisible: false,
@@ -715,6 +734,36 @@ export default {
     this.showType = this.isShow
   },
   methods: {
+    	marker: function (item) {
+      this.deptBudgetList.warehousePositioning =
+        item.lnglat.lat + ',' + item.lnglat.lng
+    },
+    getAddress(data) {
+      console.log('getAddress', data)
+      if (data[4] == 'source') {
+        this.newSelectedOptions = data[0] + '/' + data[1] + '/' + data[2]
+        this.deptBudgetList.sourceProvince = data[0]
+        this.deptBudgetList.sourceCity = data[1]
+        this.deptBudgetList.sourceArea = data[2]
+        this.deptBudgetList.sourceGoods = data[3]
+      } else {
+        this.newSelectedOptions1 = data[0] + '/' + data[1] + '/' + data[2]
+        this.deptBudgetList.deliveryProvince = data[0]
+        this.deptBudgetList.deliveryCity = data[1]
+        this.deptBudgetList.deliveryArea = data[2]
+        this.deptBudgetList.placeDelivery = data[3]
+      }
+    },
+    mapInputClick(type) {
+      this.dialogVisible = true
+      this.type = type
+	},
+	blurMap(){
+        this.dialogVisible = false
+    },
+    focusMap(){
+      this.dialogVisible = true
+    },
     dataFilter(val) {
       this.deptBudgetList.personCharge = val
       if (val) {
@@ -1866,4 +1915,28 @@ export default {
     line-height: inherit;
     display: none;
 }
+.map {
+  position: fixed;
+  top: 0;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  margin: auto;
+  width: 800px;
+  height: 400px;
+  background: gainsboro;
+  border-radius: 20px;
+  padding: 10px;
+  box-sizing: border-box;
+  z-index: 99;
+}
+
+.amap-container {
+  width: 100% !important;
+}
+
+.address-btn {
+  width: 100%;
+  text-align: left;
+}
 </style>

+ 1 - 1
src/views/contractManagement/purchaseContractAdd.vue

@@ -771,7 +771,7 @@ export default {
        this.dialogVisible = true
        this.type=type
     },
-        marker: function (item) {
+      marker: function (item) {
       this.deptBudgetList.warehousePositioning =
         item.lnglat.lat + ',' + item.lnglat.lng
     },

+ 6 - 16
src/views/contractManagement/purchaseContractEdit.vue

@@ -613,6 +613,12 @@ export default {
        this.dialogVisible = true
        this.type=type
     },
+    blurMap(){
+        this.dialogVisible = false
+    },
+    focusMap(){
+      this.dialogVisible = true
+    },
     dataFilter(val) {
       this.deptBudgetList.personCharge = val
       if (val) {
@@ -1403,24 +1409,8 @@ export default {
       .then(() => {
       this.$refs.deptBudgetList.validate((valid) => {
         if (valid) {
-          this.deptBudgetList.sourceProvince = CodeToText[this.selectedOptions[0]]
-          this.deptBudgetList.sourceCity = CodeToText[this.selectedOptions[1]]
-         
-          this.deptBudgetList.deliveryProvince = CodeToText[this.selectedOptions1[0]]
-          this.deptBudgetList.deliveryCity = CodeToText[this.selectedOptions1[1]]
-        
           this.deptBudgetList.compId = this.compId
           this.deptBudgetList.contractType = 2
-           if(this.deptBudgetList.deliveryProvince =='澳门特别行政区' || this.deptBudgetList.deliveryProvince == '澳门特别行政区'){
-            this.deptBudgetList.deliveryArea = '特别行政区'
-          }else{ 
-                 this.deptBudgetList.deliveryArea =  CodeToText[this.selectedOptions1[2]]
-          }
-             if(this.deptBudgetList.sourceProvince =='澳门特别行政区' || this.deptBudgetList.sourceProvince == '澳门特别行政区'){
-            this.deptBudgetList.sourceArea = '特别行政区'
-          }else{
-               this.deptBudgetList.sourceArea = CodeToText[this.selectedOptions[2]]
-          }
           editInfo(this.deptBudgetList)
             .toPromise()
             .then((response) => {

+ 13 - 28
src/views/contractManagement/salesContractAdd.vue

@@ -750,7 +750,9 @@ export default {
   activated() {
     //cg.viewBudget
     //cg.viewSpareMoney
-    // this.getVesselData();
+	// this.getVesselData();
+	this.newSelectedOptions='请选择货源所在地'
+    this.newSelectedOptions1='请选择交货所在地'
     this.deptBudgetList.packingMethod = '散装'
     this.deptBudgetList.packingMethodKey = 1
     this.deptBudgetList.contractGoodsInfo.goodsName = '玉米'
@@ -763,6 +765,10 @@ export default {
     this.showType = this.isShow
   },
   methods: {
+	marker: function (item) {
+      this.deptBudgetList.warehousePositioning =
+        item.lnglat.lat + ',' + item.lnglat.lng
+    },
     getAddress(data) {
       console.log('getAddress', data)
       if (data[4] == 'source') {
@@ -782,6 +788,12 @@ export default {
     mapInputClick(type) {
       this.dialogVisible = true
       this.type = type
+	},
+	blurMap(){
+        this.dialogVisible = false
+    },
+    focusMap(){
+      this.dialogVisible = true
     },
     // 关闭 dialog时 处理文件url 初始化upload组件
     handleClose() {
@@ -1465,36 +1477,9 @@ export default {
       }
       this.$refs.deptBudgetList.validate((valid) => {
         if (valid) {
-          this.deptBudgetList.sourceProvince =
-            CodeToText[this.selectedOptions[0]]
-          this.deptBudgetList.sourceCity = CodeToText[this.selectedOptions[1]]
-
-          this.deptBudgetList.deliveryProvince =
-            CodeToText[this.selectedOptions1[0]]
-          this.deptBudgetList.deliveryCity =
-            CodeToText[this.selectedOptions1[1]]
-
           this.deptBudgetList.compId = this.compId
           this.deptBudgetList.contractType = 1
           this.deptBudgetList.goodsType = 1
-
-          if (
-            this.deptBudgetList.deliveryProvince == '澳门特别行政区' ||
-            this.deptBudgetList.deliveryProvince == '澳门特别行政区'
-          ) {
-            this.deptBudgetList.deliveryArea = '特别行政区'
-          } else {
-            this.deptBudgetList.deliveryArea =
-              CodeToText[this.selectedOptions1[2]]
-          }
-          if (
-            this.deptBudgetList.sourceProvince == '澳门特别行政区' ||
-            this.deptBudgetList.sourceProvince == '澳门特别行政区'
-          ) {
-            this.deptBudgetList.sourceArea = '特别行政区'
-          } else {
-            this.deptBudgetList.sourceArea = CodeToText[this.selectedOptions[2]]
-          }
           addList(this.deptBudgetList)
             .toPromise()
             .then((response) => {