Bläddra i källkod

前端 地区显示问题 sdy

zhongtianhaoyuan 3 år sedan
förälder
incheckning
27591c26c3
1 ändrade filer med 118 tillägg och 99 borttagningar
  1. 118 99
      src/views/contractManagement/futuresPurchaseContractEdit.vue

+ 118 - 99
src/views/contractManagement/futuresPurchaseContractEdit.vue

@@ -21,7 +21,6 @@
           返回</el-button
         >
       </el-col>
-      
     </el-row>
     <ws-form
       ref="deptBudgetList"
@@ -34,13 +33,15 @@
           &nbsp;&nbsp;注:基本信息和货物信息均为必填项,“*”
           标记的条目提交后不可修改。
         </p>
-        <div class="queren"><el-button
-          class="bg-bottom"
-          type="primary"
-          size="small"
-          @click="confirmationsheet()"
-          >确认单</el-button
-        ></div>
+        <div class="queren">
+          <el-button
+            class="bg-bottom"
+            type="primary"
+            size="small"
+            @click="confirmationsheet()"
+            >确认单</el-button
+          >
+        </div>
       </div>
       <ws-info-table>
         <!-- 合同编号 -->
@@ -63,7 +64,7 @@
           />
         </ws-form-item>
         <!--买方-->
-        <ws-form-item label="买方" span="1" prop="buyer" >
+        <ws-form-item label="买方" span="1" prop="buyer">
           <ws-input
             v-model="deptBudgetList.buyer"
             placeholder="请输入买方名称"
@@ -100,7 +101,7 @@
           {{ deptBudgetList.deliverType1 }}
         </ws-form-item>
         <!--卖方-->
-        <ws-form-item label="卖方" span="1" prop="seller" >
+        <ws-form-item label="卖方" span="1" prop="seller">
           <ws-input
             v-model="deptBudgetList.seller"
             placeholder="请输入卖方名称"
@@ -108,7 +109,7 @@
             size="small"
           />
         </ws-form-item>
-        
+
         <!--包装方式-->
         <ws-form-item label="包装方式" span="1" prop="packingMethod">
           <ws-select
@@ -252,21 +253,21 @@
           />
         </ws-form-item>
         <!--收货库-->
-          <el-form-item label="收货库" span="1" prop="receiveWarehouse">
-            <el-select
-              v-model="deptBudgetList.receiveWarehouse"
-              placeholder="请选择收货库"
-              class="typeselect"
-              @change="selectwarehouseName"
-            >
-              <el-option
-                v-for="item in warehouseNameList"
-                :key="item.constKey"
-                :label="item.warehouseName"
-                :value="item.warehouseName"
-              />
-            </el-select>
-          </el-form-item>
+        <el-form-item label="收货库" span="1" prop="receiveWarehouse">
+          <el-select
+            v-model="deptBudgetList.receiveWarehouse"
+            placeholder="请选择收货库"
+            class="typeselect"
+            @change="selectwarehouseName"
+          >
+            <el-option
+              v-for="item in warehouseNameList"
+              :key="item.constKey"
+              :label="item.warehouseName"
+              :value="item.warehouseName"
+            />
+          </el-select>
+        </el-form-item>
         <!--合约号-->
         <ws-form-item label="合约号" span="1" prop="contractNumber">
           <ws-input
@@ -324,7 +325,7 @@
             value-format="yyyy-MM-dd"
           />
         </ws-form-item>
-        
+
         <!--交货日期(起)-->
         <ws-form-item label="交货日期(起)" span="1" prop="deliveryDateStart">
           <ws-date-picker
@@ -365,8 +366,7 @@
             value-format="yyyy-MM-dd"
           />
         </ws-form-item>
-        
-    </ws-info-table>
+      </ws-info-table>
 
       <div class="wenzi">
         <h3>货物信息</h3>
@@ -376,13 +376,13 @@
       <ws-info-table>
         <!--货名-->
         <ws-form-item
-            class="readonly"
-            label="货名"
-            span="1"
-            prop="waterContent"
-          >
-            {{ deptBudgetList.contractGoodsInfo.goodsName }}
-          </ws-form-item>
+          class="readonly"
+          label="货名"
+          span="1"
+          prop="waterContent"
+        >
+          {{ deptBudgetList.contractGoodsInfo.goodsName }}
+        </ws-form-item>
         <!--水分(%)<=-->
         <ws-form-item label="水分(%)" span="1" prop="waterContent">
           <ws-input
@@ -486,16 +486,15 @@
         <!--产地-->
         <ws-form-item label="产地" span="1" prop="protein">
           <el-cascader
-              :options="options1_"
-              v-model="selectedOptions1"
-              clearable
-              size="large"
-              placeholder="请选择产地"
-              @change="handleChange1"
-              style="width:200%"
-            />
+            :options="options1_"
+            v-model="selectedOptions1"
+            clearable
+            size="large"
+            placeholder="请选择产地"
+            @change="handleChange1"
+            style="width: 200%"
+          />
         </ws-form-item>
-
       </ws-info-table>
 
       <div class="wenzi">
@@ -572,22 +571,23 @@
         placeholder="请输入备注信息,不超过200字"
         maxlength="200"
       />
-      
+
       <el-upload
         class="upload-demo"
         action="https://www.zthymaoyi.com/upload/admin"
-         :on-success="
-            (res, file) => {
-              uploadSuccessHandle(res)
-            }
-          "
+        :on-success="
+          (res, file) => {
+            uploadSuccessHandle(res)
+          }
+        "
         multiple
         :limit="3"
         :file-list="fileList"
       >
         <el-button size="small" type="primary">点击上传</el-button>
         <div slot="tip" class="el-upload__tip">
-          推荐格式.jpg, .jpeg, .png, .gif, .pdf, .doc, .zip, .rar,单个文件大小不超过10M
+          推荐格式.jpg, .jpeg, .png, .gif, .pdf, .doc, .zip,
+          .rar,单个文件大小不超过10M
         </div>
       </el-upload>
     </ws-form>
@@ -603,7 +603,12 @@
   </div>
 </template>
 <script>
-import { regionData,provinceAndCityDataPlus, CodeToText, TextToCode } from 'element-china-area-data'
+import {
+  regionData,
+  provinceAndCityDataPlus,
+  CodeToText,
+  TextToCode,
+} from 'element-china-area-data'
 import {
   packList,
   getwarehousename,
@@ -660,7 +665,7 @@ export default {
       transgeneList: [],
       unitList: [],
       options_: regionData,
-      options1_:provinceAndCityDataPlus,
+      options1_: provinceAndCityDataPlus,
       staffList: [],
       packtypeList: [],
       goodnameList: [],
@@ -676,9 +681,9 @@ export default {
       },
       acceptanceCheck: {},
       compId: sessionStorage.getItem('ws-pf_compId'),
-      addressUrls:[],
-      addressUrl:'',
-      fileList:[],
+      addressUrls: [],
+      addressUrl: '',
+      fileList: [],
     }
   },
 
@@ -734,7 +739,7 @@ export default {
     },
     loaddata() {
       // 数据
-       examineList({ id: this.$route.query.id })
+      examineList({ id: this.$route.query.id })
         .toPromise()
         .then((response) => {
           this.deptBudgetList = response
@@ -743,6 +748,10 @@ export default {
           tmp[0] = TextToCode[response.deliveryProvince].code
           tmp[1] =
             TextToCode[response.deliveryProvince][response.deliveryCity].code
+          tmp[2] =
+            TextToCode[response.deliveryProvince][response.deliveryCity][
+              response.deliveryArea
+            ].code
 
           if (tmp[0] == 810000 || tmp[0] == 820000) {
             tmp[2] = null
@@ -752,19 +761,20 @@ export default {
                 response.deliveryArea
               ].code
           }
-          this.selectedOptions1 = tmp1
+          this.selectedOptions = tmp
           var tmp1 = []
           tmp1[0] = TextToCode[response.contractGoodsInfo.outputPrivate].code
           tmp1[1] =
             TextToCode[response.contractGoodsInfo.outputPrivate][response.contractGoodsInfo.outputCity].code
+          this.selectedOptions1 = tmp1
           if (this.deptBudgetList.deliverType == 1) {
             this.deptBudgetList.deliverType1 = '我方自提'
           } else if (this.deptBudgetList.deliverType == 2) {
             this.deptBudgetList.deliverType1 = '对方送货'
           }
-          if(this.deptBudgetList.addressUrl != null){
-            this.addressUrls = this.deptBudgetList.addressUrl.split(",")
-            this.fileList = this.deptBudgetList.addressUrl.split(",")
+          if (this.deptBudgetList.addressUrl != null) {
+            this.addressUrls = this.deptBudgetList.addressUrl.split(',')
+            this.fileList = this.deptBudgetList.addressUrl.split(',')
           }
         })
 
@@ -788,14 +798,14 @@ export default {
         .then((response) => {
           this.gradeList = response
         })
-        //转基因
+      //转基因
       packList({ constId: 'CON7' })
         .toPromise()
         .then((response) => {
           this.transgeneList = response
         })
-        //收货库
-        getwarehousename({
+      //收货库
+      getwarehousename({
         compId: this.compId,
         warehouseType: 1,
       })
@@ -827,8 +837,8 @@ export default {
     },
     // 上传附件
     uploadSuccessHandle(e) {
-      this.addressUrl += e.url+""
-       this.addressUrls.push(this.addressUrl.split(","))
+      this.addressUrl += e.url + ''
+      this.addressUrls.push(this.addressUrl.split(','))
     },
     getUnitList() {
       xiala({
@@ -1247,7 +1257,7 @@ export default {
         })
         return
       }
-      
+
       if (!this.deptBudgetList.deliveryDateStart) {
         this.$message({
           message: '请选择交货日期(起)',
@@ -1391,13 +1401,12 @@ export default {
       }
       if (
         !this.deptBudgetList.contractGoodsInfo.protein ||
-        (String(this.deptBudgetList.contractGoodsInfo.protein).indexOf(
-          '.'
-        ) != -1 &&
+        (String(this.deptBudgetList.contractGoodsInfo.protein).indexOf('.') !=
+          -1 &&
           String(this.deptBudgetList.contractGoodsInfo.protein).length -
-            (String(
-              this.deptBudgetList.contractGoodsInfo.protein
-            ).indexOf('.') +
+            (String(this.deptBudgetList.contractGoodsInfo.protein).indexOf(
+              '.'
+            ) +
               1) >
             2)
       ) {
@@ -1485,18 +1494,26 @@ export default {
       }
       this.$refs.deptBudgetList.validate((valid) => {
         if (valid) {
-          this.deptBudgetList.contractGoodsInfo.outputPrivate = CodeToText[this.selectedOptions1[0]]
-          this.deptBudgetList.contractGoodsInfo.outputCity = CodeToText[this.selectedOptions1[1]]
-         
-          this.deptBudgetList.deliveryProvince = CodeToText[this.selectedOptions[0]]
+          this.deptBudgetList.contractGoodsInfo.outputPrivate =
+            CodeToText[this.selectedOptions1[0]]
+          this.deptBudgetList.contractGoodsInfo.outputCity =
+            CodeToText[this.selectedOptions1[1]]
+
+          this.deptBudgetList.deliveryProvince =
+            CodeToText[this.selectedOptions[0]]
           this.deptBudgetList.deliveryCity = CodeToText[this.selectedOptions[1]]
-        
+            this.deptBudgetList.deliveryArea = CodeToText[this.selectedOptions[2]]
+
           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.selectedOptions[2]]
+          if (
+            this.deptBudgetList.deliveryProvince == '澳门特别行政区' ||
+            this.deptBudgetList.deliveryProvince == '澳门特别行政区'
+          ) {
+            this.deptBudgetList.deliveryArea = '特别行政区'
+          } else {
+            this.deptBudgetList.deliveryArea =
+              CodeToText[this.selectedOptions[2]]
           }
           this.deptBudgetList.addressUrl = this.addressUrls.toString()
           editInfo(this.deptBudgetList)
@@ -1557,10 +1574,12 @@ export default {
   padding: 0 25px;
   border-left: 1px solid #cdd2dc;
   background: #fafbfc;
-  color: #8890B1;
+  color: #8890b1;
 }
-/deep/.el-form-item.is-success .el-input__inner , /deep/.el-cascader .el-input .el-input__inner, /deep/.el-textarea__inner{
-  color: #8890B1;
+/deep/.el-form-item.is-success .el-input__inner,
+/deep/.el-cascader .el-input .el-input__inner,
+/deep/.el-textarea__inner {
+  color: #8890b1;
 }
 /deep/.ws-info-table .el-form-item .el-form-item__label {
   width: 140px;
@@ -1729,18 +1748,18 @@ export default {
 /deep/.ws-info-table .el-form-item .el-form-item__label {
   width: 130px;
 }
-.el-textarea{
+.el-textarea {
   width: 101%;
 }
 /deep/.iconclose:before {
-    display: none;
+  display: none;
 }
 /deep/.winsea-card .card__header {
-    font-size: 14px;
-    color: #409eff;
-    padding: 0 0 20px 10px;
-    position: relative;
-    display: none;
+  font-size: 14px;
+  color: #409eff;
+  padding: 0 0 20px 10px;
+  position: relative;
+  display: none;
 }
 .addressUrls {
   width: 100%;
@@ -1759,16 +1778,16 @@ export default {
   margin: 0px 10px;
   border-radius: 3px;
 }
-.queren{
+.queren {
   margin-left: 100%;
   margin-top: -60px;
 }
 //上传文件成功标识
 /deep/.el-upload-list__item-status-label {
-    position: absolute;
-    right: 22px;
-    top: -1px;
-    line-height: inherit;
-    display: none;
+  position: absolute;
+  right: 22px;
+  top: -1px;
+  line-height: inherit;
+  display: none;
 }
 </style>