Browse Source

Merge branch 'master' of http://git.zthymaoyi.com/gdc/yiliangyiyun-pc

mxx 3 years ago
parent
commit
2bcaf34413
1 changed files with 161 additions and 84 deletions
  1. 161 84
      src/views/tranManagement/tranManagementShippingArrangemen.vue

+ 161 - 84
src/views/tranManagement/tranManagementShippingArrangemen.vue

@@ -6,7 +6,12 @@
         <h2 class="bg-left title">船次管理</h2>
       </el-col>
       <el-col :span="4" class="bg-right">
-        <el-button class="bg-bottom" type="primary" size="small" @click="revert()">
+        <el-button
+          class="bg-bottom"
+          type="primary"
+          size="small"
+          @click="revert()"
+        >
           <img
             width="6"
             height="10"
@@ -18,42 +23,60 @@
       </el-col>
     </el-row>
     <div class="center">
-      <ws-form ref="deptBudgetList" :model="deptBudgetList" :rules="rules" class="position">
+      <ws-form
+        ref="deptBudgetList"
+        :model="deptBudgetList"
+        :rules="rules"
+        class="position"
+      >
         <div class="basicInformation">
           <div class="small-title" style="font-size: 16px">任务详情</div>
           <ws-info-table>
-            <ws-form-item label="任务编号" span="1" prop="processNo">{{deptBudgetList.processNo}}</ws-form-item>
-            <ws-form-item label="货名" span="1" prop="goodsName">{{deptBudgetList.goodsName}}</ws-form-item>
-            <ws-form-item label="重量(吨)" span="1" prop="weight">{{deptBudgetList.weight}}</ws-form-item>
+            <ws-form-item label="任务编号" span="1" prop="processNo">{{
+              deptBudgetList.processNo
+            }}</ws-form-item>
+            <ws-form-item label="货名" span="1" prop="goodsName">{{
+              deptBudgetList.goodsName
+            }}</ws-form-item>
+            <ws-form-item label="重量(吨)" span="1" prop="weight">{{
+              deptBudgetList.weight
+            }}</ws-form-item>
             <ws-form-item
               label="发货地址"
               span="1"
               prop="sendDetailedAddress"
-            >{{deptBudgetList.sendDetailedAddress}}</ws-form-item>
-            <ws-form-item label="发货人" span="1" prop="sender">{{deptBudgetList.sender}}</ws-form-item>
-            <ws-form-item label="发货人电话" span="1" prop="senderPhone">{{deptBudgetList.senderPhone}}</ws-form-item>
+              >{{ deptBudgetList.sendDetailedAddress }}</ws-form-item
+            >
+            <ws-form-item label="发货人" span="1" prop="sender">{{
+              deptBudgetList.sender
+            }}</ws-form-item>
+            <ws-form-item label="发货人电话" span="1" prop="senderPhone">{{
+              deptBudgetList.senderPhone
+            }}</ws-form-item>
             <ws-form-item
               label="收货地址"
               span="1"
               prop="receiveDetailedAddress"
-            >{{deptBudgetList.receiveDetailedAddress}}</ws-form-item>
-            <ws-form-item label="收货人" span="1" prop="receiver">{{deptBudgetList.receiver}}</ws-form-item>
-            <ws-form-item
-              label="收货人电话"
-              span="1"
-              prop="receiverPhone"
-            >{{deptBudgetList.receiverPhone}}</ws-form-item>
-            <ws-form-item
-              label="发货日期"
-              span="1"
-              prop="deliveryDateStart"
-            >{{deptBudgetList.deliveryDateStart}}</ws-form-item>
+              >{{ deptBudgetList.receiveDetailedAddress }}</ws-form-item
+            >
+            <ws-form-item label="收货人" span="1" prop="receiver">{{
+              deptBudgetList.receiver
+            }}</ws-form-item>
+            <ws-form-item label="收货人电话" span="1" prop="receiverPhone">{{
+              deptBudgetList.receiverPhone
+            }}</ws-form-item>
+            <ws-form-item label="发货日期" span="1" prop="deliveryDateStart">{{
+              deptBudgetList.deliveryDateStart
+            }}</ws-form-item>
             <ws-form-item
               label="最晚到货日期"
               span="1"
               prop="deliveryDateEnd"
-            >{{deptBudgetList.deliveryDateEnd}}</ws-form-item>
-            <ws-form-item label="合同编号" span="1" prop="contractNo">{{deptBudgetList.contractNo}}</ws-form-item>
+              >{{ deptBudgetList.deliveryDateEnd }}</ws-form-item
+            >
+            <ws-form-item label="合同编号" span="1" prop="contractNo">{{
+              deptBudgetList.contractNo
+            }}</ws-form-item>
           </ws-info-table>
           <div class="small-title" style="font-size: 16px">联络员及航次</div>
           <div
@@ -64,6 +87,8 @@
             <div class="zhong">
               <ws-form-item label="姓名" span="1" prop="driver">
                 <el-select
+                  v-if="item.id != null"
+                  :disabled="readonly"
                   v-model="item.driver"
                   placeholder="请选择姓名"
                   filterable
@@ -79,8 +104,15 @@
                   />
                 </el-select>
               </ws-form-item>
-              <ws-form-item label="电话" span="1" prop="driverPhone" class="biao">
+              <ws-form-item
+                label="电话"
+                span="1"
+                prop="driverPhone"
+                class="biao"
+              >
                 <ws-input
+                  v-if="item.id != null"
+                  :disabled="readonly"
                   :readonly="true"
                   v-model="item.driverPhone"
                   placeholder="请输入电话"
@@ -89,8 +121,15 @@
                   class="ys"
                 />
               </ws-form-item>
-              <ws-form-item label="发船日期" span="1" prop="sendDateStart" class="biao2">
+              <ws-form-item
+                label="发船日期"
+                span="1"
+                prop="sendDateStart"
+                class="biao2"
+              >
                 <ws-date-picker
+                v-if="item.id != null"
+                  :disabled="readonly"
                   v-model="item.sendDateStart"
                   type="date"
                   placeholder="请选择发货日期"
@@ -98,8 +137,15 @@
                   class="small"
                 />
               </ws-form-item>
-              <ws-form-item label="预计到港日期" span="1" prop="receiveDateEnd" class="biao3">
+              <ws-form-item
+                label="预计到港日期"
+                span="1"
+                prop="receiveDateEnd"
+                class="biao3"
+              >
                 <ws-date-picker
+                v-if="item.id != null"
+                  :disabled="readonly"
                   v-model="item.receiveDateEnd"
                   type="date"
                   placeholder="请选择发货日期"
@@ -126,7 +172,13 @@
                 ></ws-input>
               </ws-form-item>
               <ws-form-item label="类型" span="1" prop="shipType" class="biao5">
-                <ws-select v-model="item.shipType" placeholder="请输入" class="ys">
+                <ws-select
+                  v-model="item.shipType"
+                  placeholder="请输入"
+                  class="ys"
+                  v-if="item.id != null"
+                  :disabled="readonly"
+                >
                   <ws-option
                     v-for="items in shipType"
                     :key="items.constKey"
@@ -140,21 +192,43 @@
                 span="1"
                 prop="boxNumber"
                 class="biao6"
-                v-show="item.shipType=='集装箱'"
+                v-show="item.shipType == '集装箱'"
               >
-                <ws-input v-model="item.boxNumber" placeholder="请输入数量" class="ys"></ws-input>
+                <ws-input
+                  v-if="item.id != null"
+                  :disabled="readonly"
+                  v-model="item.boxNumber"
+                  placeholder="请输入数量"
+                  class="ys"
+                ></ws-input>
               </ws-form-item>
-               <ws-form-item label="仓位号" span="1" prop="binNumber"  v-show="item.shipType=='散船'" class="biao6">
+              <ws-form-item
+                label="仓位号"
+                span="1"
+                prop="binNumber"
+                v-show="item.shipType == '散船'"
+                class="biao6"
+              >
                 <ws-input
+                  v-if="item.id != null"
+                  :disabled="readonly"
                   v-model="item.binNumber"
                   placeholder="请输入仓位号"
                   maxlength="100"
                   size="small"
-                  style="width: 110px;"
+                  style="width: 110px"
                 ></ws-input>
               </ws-form-item>
-              <ws-form-item label="重量(吨)" span="1" prop="positionWeight"  v-show="item.shipType=='散船'" class="biao7">
+              <ws-form-item
+                label="重量(吨)"
+                span="1"
+                prop="positionWeight"
+                v-show="item.shipType == '散船'"
+                class="biao7"
+              >
                 <ws-input
+                  v-if="item.id != null"
+                  :disabled="readonly"
                   v-model="item.positionWeight"
                   placeholder="请输入重量"
                   maxlength="100"
@@ -164,20 +238,26 @@
               </ws-form-item>
             </div>
           </div>
-              <el-button
-                class="add bg-bottom"
-                type="primary"
-                size="small"
-                @click="add"
-                v-show="deptBudgetList.tranCarInfoList[0].shipType=='散船'"
-              >
-                <img width="22" height="22" src="../../../public/img/add.png" alt />
-                <div class="spans">添加仓位</div>
-              </el-button>
+          <el-button
+            class="add bg-bottom"
+            type="primary"
+            size="small"
+            @click="add"
+            v-show="deptBudgetList.tranCarInfoList[0].shipType == '散船'"
+          >
+            <img width="22" height="22" src="../../../public/img/add.png" alt />
+            <div class="spans">添加仓位</div>
+          </el-button>
         </div>
       </ws-form>
       <div style="text-align: right; padding: 10px">
-        <el-button class="bg-bottom-up" type="primary" size="small" @click="submit()">提交</el-button>
+        <el-button
+          class="bg-bottom-up"
+          type="primary"
+          size="small"
+          @click="submit()"
+          >提交</el-button
+        >
       </div>
     </div>
   </div>
@@ -194,7 +274,7 @@ export default {
   name: 'viewSpareMoney',
   components: {
     WsUpload,
-    Pagination
+    Pagination,
   },
   watch: {
     vesselId(val) {
@@ -202,7 +282,7 @@ export default {
     },
     isShow(val) {
       this.showType = val
-    }
+    },
   },
   data() {
     return {
@@ -247,9 +327,9 @@ export default {
             required: true,
             type: 'number',
             message: '请输入活动名称',
-            trigger: 'blur'
-          }
-        ]
+            trigger: 'blur',
+          },
+        ],
       },
       arr: [],
       freightspace: [
@@ -263,20 +343,20 @@ export default {
       packtypeList: {},
       date: {
         year: dayjs().format('YYYY'),
-        month: dayjs().format('MM')
+        month: dayjs().format('MM'),
       },
       contractList: [],
       deptBudgetList: {
-        warehouseInOutDetail: {}
+        warehouseInOutDetail: {},
       },
       historyList: [],
 
       pickerBeginDateBefore: {
-        disabledDate: time => {
+        disabledDate: (time) => {
           return time.getTime() > Date.now()
-        }
+        },
       },
-      accessoryTFs: false
+      accessoryTFs: false,
     }
   },
   mounted() {
@@ -287,26 +367,26 @@ export default {
     this.getList()
   },
   computed: {
-    totalStorage: function() {
+    totalStorage: function () {
       var maxStorage = 0
       for (var i = 0; i < this.freightspace.length; i++) {
         maxStorage += Number(this.freightspace[i].maxStorage)
       }
       return maxStorage
-    }
+    },
   },
   methods: {
     getList() {
       getstaff({ compId: sessionStorage.getItem('ws-pf_compId') })
         .toPromise()
-        .then(response => {
+        .then((response) => {
           this.options = response
           this.staffList = response
         })
       //类型
       packList({ constId: 'TRAN4' })
         .toPromise()
-        .then(response => {
+        .then((response) => {
           this.shipType = response
         })
     },
@@ -314,7 +394,7 @@ export default {
       this.deptBudgetList.personCharge = val
       if (val) {
         console.log(val)
-        this.options = this.staffList.filter(item => {
+        this.options = this.staffList.filter((item) => {
           if (
             !!~item.staffName.indexOf(val) ||
             !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
@@ -330,9 +410,8 @@ export default {
       for (var i = 0; i < this.staffList.length; i++) {
         if (this.staffList[i].staffName == e) {
           this.deptBudgetList.driverPhone = this.staffList[i].staffMobilePhone
-          this.deptBudgetList.tranCarInfoList[0].driverPhone = this.staffList[
-            i
-          ].staffMobilePhone
+          this.deptBudgetList.tranCarInfoList[0].driverPhone =
+            this.staffList[i].staffMobilePhone
           this.deptBudgetList.personChargeKey = this.staffList[i].staffId
         }
       }
@@ -340,7 +419,7 @@ export default {
     loaddata() {
       shippingLook({ id: this.$route.query.id })
         .toPromise()
-        .then(response => {
+        .then((response) => {
           this.deptBudgetList = response
           if (response.tranCarInfoList.length > 0) {
             // for (
@@ -372,8 +451,8 @@ export default {
                 boxNumber: '',
                 positionWeight: '',
                 binNumber: '',
-                tranType: '3'
-              }
+                tranType: '3',
+              },
             ]
           }
         })
@@ -397,9 +476,9 @@ export default {
         shipNo: this.deptBudgetList.tranCarInfoList[0].shipNo,
         shipName: this.deptBudgetList.tranCarInfoList[0].shipName,
         shipType: this.deptBudgetList.tranCarInfoList[0].shipType,
-        binNumber:'',
+        binNumber: '',
         positionWeight: '',
-        tranType: '3'
+        tranType: '3',
       })
     },
     selectdriver() {},
@@ -418,42 +497,42 @@ export default {
         if (!this.deptBudgetList.tranCarInfoList[i].driver) {
           this.$message({
             message: '名字不为空',
-            type: 'warning'
+            type: 'warning',
           })
           return
         }
         if (!this.deptBudgetList.tranCarInfoList[i].driverPhone) {
           this.$message({
             message: '电话号不为空',
-            type: 'warning'
+            type: 'warning',
           })
           return
         }
         if (!this.deptBudgetList.tranCarInfoList[i].sendDateStart) {
           this.$message({
             message: '发船时间不能为空',
-            type: 'warning'
+            type: 'warning',
           })
           return
         }
         if (!this.deptBudgetList.tranCarInfoList[i].receiveDateEnd) {
           this.$message({
             message: '预计到港时间不能为空',
-            type: 'warning'
+            type: 'warning',
           })
           return
         }
         if (!this.deptBudgetList.tranCarInfoList[i].shipName) {
           this.$message({
             message: '船名不能为空',
-            type: 'warning'
+            type: 'warning',
           })
           return
         }
         if (!this.deptBudgetList.tranCarInfoList[i].shipNo) {
           this.$message({
             message: '航次不能为空',
-            type: 'warning'
+            type: 'warning',
           })
           return
         }
@@ -461,7 +540,7 @@ export default {
           if (!this.deptBudgetList.tranCarInfoList[i].boxNumber) {
             this.$message({
               message: '数量不能为空',
-              type: 'warning'
+              type: 'warning',
             })
             return
           }
@@ -469,7 +548,7 @@ export default {
         if (!this.deptBudgetList.tranCarInfoList[i].shipType) {
           this.$message({
             message: '类型不能为空',
-            type: 'warning'
+            type: 'warning',
           })
           return
         }
@@ -478,14 +557,14 @@ export default {
           if (!this.deptBudgetList.tranCarInfoList[i].binNumber) {
             this.$message({
               message: '仓位号不能为空',
-              type: 'warning'
+              type: 'warning',
             })
             return
           }
           if (!this.deptBudgetList.tranCarInfoList[i].positionWeight) {
             this.$message({
               message: '重量不能为空',
-              type: 'warning'
+              type: 'warning',
             })
             return
           }
@@ -501,7 +580,7 @@ export default {
         ) {
           this.$message({
             message: '发船时间不能大于最晚到到港时间!',
-            type: 'warning'
+            type: 'warning',
           })
           return
         }
@@ -509,19 +588,19 @@ export default {
       this.$confirm(`提交成功后,任务将下发给相关人员,是否确定提交?`, {
         cancelButtonText: '取消',
         confirmButtonText: '确定',
-        type: 'warning'
+        type: 'warning',
       })
         .then(() => {
-          this.$refs.deptBudgetList.validate(valid => {
+          this.$refs.deptBudgetList.validate((valid) => {
             if (valid) {
               this.deptBudgetList.totalStorage = this.totalStorage
               var tranCarInfo = {}
               tranCarInfo.id = this.deptBudgetList.id
               tranCarInfo.infoId = this.deptBudgetList.infoId
-               tranCarInfo.tranCarInfoList = this.deptBudgetList.tranCarInfoList
+              tranCarInfo.tranCarInfoList = this.deptBudgetList.tranCarInfoList
               dispatchCat(tranCarInfo)
                 .toPromise()
-                .then(response => {
+                .then((response) => {
                   this.$message.success('提交成功')
                   this.deptBudgetList = {}
                   this.freightspace = {}
@@ -557,10 +636,10 @@ export default {
           this.searchType = this.taskTypeList[i].type
         }
       }
-    }
+    },
     // approve() {},
     // listQuery() {}
-  }
+  },
 }
 </script>
 <style lang="scss" scoped>
@@ -1137,7 +1216,5 @@ export default {
 }
 /deep/.el-form-item__content .el-select {
   width: 42%;
-  
 }
-
 </style>