Ver código fonte

发运明细-编辑-增加运输方式字段

jbb 2 anos atrás
pai
commit
2824fcd4ef
1 arquivos alterados com 39 adições e 1 exclusões
  1. 39 1
      src/views/shipment-details/editShipDetDrawer.vue

+ 39 - 1
src/views/shipment-details/editShipDetDrawer.vue

@@ -87,6 +87,20 @@
                   <a-input style="width:100%" type="text" v-model="record.smallPo" @change="changeSmallPo(record)"/>
                 </a-form-model-item>
               </template>
+              <!-- 运输方式 -->
+              <template slot="typeOfShipping" slot-scope="text, record, index">
+                <a-form-model-item prop="typeOfShipping">
+                  <a-select v-model="record.typeOfShipping"  @change="changeTypeOfShipping(record)">
+                  <a-select-option
+                     v-for="(item,index) in shippingTypeOption"
+                     :key="index"
+                     :value="item.value">
+                     {{item.label}}
+                  </a-select-option>
+                  </a-select>
+                  <!-- <a-input style="width:100%" type="text" v-model="record.typeOfShipping" @change="changeSmallPo(record)"/> -->
+                </a-form-model-item>
+              </template>
               <!-- 成衣工厂 :rules="rules.garmentFactory"-->
               <template slot="garmentFactory" slot-scope="text, record, index">
                 <a-form-model-item prop="garmentFactory">
@@ -237,6 +251,7 @@ import moment from 'moment'
 import ReferOrderDataModal from '@views/shipment-details/referOrderDataModal.vue'
 
 import { editById,deleteEdit } from '@api/document/shipmentList'
+import {Dictionaries} from '@api/document/book.js' //获取数据字典接口
 
 export default {
   name: 'EditShipDetDrawer', // 编辑 发运明细 抽屉
@@ -339,6 +354,14 @@ export default {
           scopedSlots: { customRender: 'smallPo' },
            ellipsis: true,
         },
+        {
+          title: '运输方式',
+          dataIndex: 'typeOfShipping',
+          width: 110,
+          className: 'replacecolor',
+          scopedSlots: { customRender: 'typeOfShipping' },
+           ellipsis: true,
+        },
         {
           title: 'Pack Id',
           dataIndex: 'packId',
@@ -644,7 +667,8 @@ export default {
       editShipDet: {}, // 编辑发运明细
       visible: false,
       confirmLoading: false,
-      dateFormat: 'YYYY-MM-DD'
+      dateFormat: 'YYYY-MM-DD',
+      shippingTypeOption:[]  //运输方式下拉框数据
     }
   },
   // 接收父组件查询方法
@@ -654,6 +678,9 @@ export default {
       default: null
     }
   },
+  created() {  
+    this.getOption()
+  },
 
   methods: {
     // getSon(val) {
@@ -668,6 +695,12 @@ export default {
     //   this.syShippingDetailsItemList = this.syShippingDetailsItemList.concat(copyValList);
     //   this.msgFormSon = this.syShippingDetailsItemList;
     // },
+    //获取下拉框数据
+    getOption(){
+      Dictionaries({code:'test0902001'}).then(res => {
+         this.shippingTypeOption = res
+      })
+    },
     // 编辑 保存
     editSave() {
       const that = this;
@@ -809,6 +842,11 @@ export default {
         item.smallPo = record.smallPo
       })
     },
+    changeTypeOfShipping(record){
+      this.syShippingDetailsItemList.map(item=>{
+        item.typeOfShipping = record.typeOfShipping
+      })
+    },
     // 修改预发货日期
     changePreDeliveryDate(record){
       this.syShippingDetailsItemList.map(item=>{