Browse Source

Merge branch 'bf_dev' of git.echepei.com:zhujiawei/Warehouse_management_ui into bf_dev

caojunjie 4 years ago
parent
commit
4e651eab8f

+ 2 - 1
src/views/Warehousing/inStock/AddOrUpdate.vue

@@ -2142,7 +2142,8 @@
             </tr>
             <tr>
               <td>备注</td>
-              <td colspan="4">不贴标签不卸货</td>
+<!--              <td colspan="4">不贴标签不卸货</td>-->
+              <td colspan="4">{{ form.remark }}</td>
               <td>总件数</td>
               <td colspan="2">{{ allfQty }}</td>
             </tr>

+ 36 - 0
src/views/Warehousing/inStock/index.vue

@@ -417,11 +417,13 @@
       </el-dialog>
 
       <el-table
+        ref="table"
         v-loading="loading"
         :data="warehousebillsList"
         @selection-change="handleSelectionChange"
         show-summary
         :summary-method="getSum"
+        :height="tableHeight"
       >
         <el-table-column type="selection" width="60" fixed align="center" />
         <el-table-column
@@ -543,6 +545,7 @@ export default {
   name: "plans",
   data() {
     return {
+      tableHeight: '600',
       timer: "",
       pageShow: true,
       pageShow2: false,
@@ -772,13 +775,46 @@ export default {
     });
     this.getRow();
     this.getList();
+    this.getMonth();
   },
   activated() {
     if (this.$route.query.id) {
       this.handleUpdate(this.$route.query.id);
     }
   },
+  mounted() {
+    // this.setHeight();
+  },
   methods: {
+    // 获取当前月的第一天和最后一天
+    getMonth() {
+      let date = new Date();
+      let year = parseInt(date.getFullYear())
+      let month = parseInt(date.getMonth() + 1)
+      let currentMonth = date.getMonth()
+      let nextMonth = ++currentMonth
+      let nextMonthFirstDay = new Date(date.getFullYear(), nextMonth, 1)  // 下个月的第一天
+      let oneDay = 1000*60*60*24
+      let lastTime = new Date(nextMonthFirstDay - oneDay) // 下个月的第一天减去一天,就是上个月的最后一天
+      let day = lastTime.getDate()
+      if (day < 10) {
+        day = '0' + day
+      }
+      this.queryParams.timeInterval = [year + '-' + month + '-' + '01 00:00:00', year + '-' + month + '-' + day + ' 23:59:59']
+    },
+    setHeight() {
+      console.log(this.$refs.table.$el);
+      const offsetTop = window.innerHeight - this.$refs.table.$el.offsetTop - 210
+      const offsetBodyHeight = document.querySelector('.el-table__body').offsetHeight
+      console.log(offsetTop, offsetBodyHeight)
+      if (this.warehousebillsList.length && offsetBodyHeight < offsetTop) {
+        this.tableHeight = offsetBodyHeight + 75
+      } else if (!this.warehousebillsList.length) {
+        this.tableHeight = null
+      } else {
+        this.tableHeight = offsetTop
+      }
+    },
     //列设置全选
     allChecked() {
       if (this.allCheck == true) {

+ 10 - 0
src/views/agreement/agreementTask/index.vue

@@ -628,6 +628,16 @@
             size="small"
           />
         </el-table-column>
+        <el-table-column label="备注" align="center">
+          <el-input
+            slot-scope="scope"
+            v-model="scope.row.remark"
+            placeholder="请输入备注"
+            :disabled="browseStatus"
+            clearable
+            size="small"
+          />
+        </el-table-column>
         <el-table-column
           label="操作"
           align="center"

+ 2 - 2
src/views/kaihe/singleVoyageShip/BLNo.vue

@@ -39,7 +39,7 @@
       </el-row>
     </el-form>
     <span slot="footer" class="dialog-footer">
-      <el-button type="Primary" @click="open = false">关闭</el-button>
+      <el-button type="primary" @click="open = false">关闭</el-button>
     </span>
   </el-dialog>
 </template>
@@ -75,7 +75,7 @@ export default {
     },
     // 打开前的操作
     openDialog(data) {
-      console.log(data)
+      // console.log(data)
       this.reset();
       this.title = '提单号:'+ data.fMblno;
       this.BLNoList = {

+ 62 - 62
src/views/kaihe/singleVoyageShip/index.vue

@@ -167,7 +167,6 @@
               </el-tooltip>
 
             </el-form-item>
-<!--            <el-form-item label="提单号"><span class="blNo" v-text="props.row.tidan" @click="$refs.blNo.openDialog(props.row.tidan)"></span></el-form-item>-->
           </el-form>
         </slot>
       </el-table-column>
@@ -344,30 +343,21 @@ export default {
     }
   },
   created() {
-    this.getList();
+    // this.getList();
     this.setRowList = this.tableDate;
     this.getRowList = this.tableDate;
     this.vessleRemthod();
     this.voyageRemthods();
-
-    // const data = {
-    //   fVsl: '凯和志诚1',
-    //   fVoy: '02W1',
-    //   fVslid: 3,
-    //   fVoyid: 6,
-    //   fUpdatetime: '2021-08-11 14:08:00',
-    //   updateStatus: '1',
-    // }
-    // cargoStatus(data).then(response => {
-    //   console.log(response)
-    // })
+  },
+  activated() {
+    this.getList();
   },
   methods: {
     async getList() {
       this.loading = false;
       await listSingleVoyageByShip(this.queryParams).then(response => {
+        console.log(response.rows)
         this.singleShipList = response.rows;
-        console.log(this.singleShipList)
         this.singleShipList.forEach((item, index) => {
           let blNo = {
             fCargoPlanning: 0,
@@ -402,80 +392,90 @@ export default {
     //获取船名
     vessleRemthod() {
       getVesselName().then(response => {
-        this.vesselOptions = response.rows
+        this.vesselOptions = response.rows;
       })
     },
     // 获取航次
     voyageRemthods(){
       getVoyageName().then(response=>{
-        this.voyageOptions = response.rows
+        this.voyageOptions = response.rows;
       })
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ship = selection
+      this.ship = selection;
       // this.ids = selection.map(item => item.fId)
-      this.single = selection.length!==1
+      this.single = selection.length!==1;
       // this.multiple = !selection.length
     },
     // 离港出运
     departureShipment() {
-      if (this.departure === null) {
-        this.$message({
-          showClose: true,
-          message: '离港时间未选择',
-          type: 'warning'
-        });
-      } else {
-        const data = {
-          fVsl: this.ship[0].vslName,
-          fVoy: this.ship[0].voyNo,
-          fVslid: this.ship[0].fVslid,
-          fVoyid: this.ship[0].fVoyid,
-          fUpdatetime: this.departure,
-          updateStatus: '1',
-        }
-        cargoStatus(data).then(response => {
-          if (response.code === 200) {
+      if (this.ship[0].fArrivalStatus === 0) {
+        if (this.departure === null) {
+          this.$message({
+            showClose: true,
+            message: '离港时间未选择',
+            type: 'warning'
+          });
+        } else {
+          const data = {
+            fVsl: this.ship[0].vslName,
+            fVoy: this.ship[0].voyNo,
+            fVslid: this.ship[0].fVslid,
+            fVoyid: this.ship[0].fVoyid,
+            fUpdatetime: this.departure,
+            updateStatus: '1',
+          }
+          cargoStatus(data).then(response => {
+            this.getList();
             this.$message({
               showClose: true,
               message: '出港操作成功',
               type: 'success'
             });
-          } else {
-            this.$message({
-              showClose: true,
-              message: response.msg,
-              type: 'warning'
-            });
-          }
-        })
+          })
+        }
+      }else {
+        this.$message({
+          showClose: true,
+          message: '该航次已离港或已到港',
+          type: 'warning'
+        });
       }
     },
     // 到港卸船
     unloading() {
-      if (this.arrival === null) {
+      if (this.ship[0].fArrivalStatus === 1) {
+        if (this.arrival === null) {
+          this.$message({
+            showClose: true,
+            message: '到港时间未选择',
+            type: 'warning'
+          });
+        } else {
+          const data = {
+            fVsl: this.ship[0].vslName,
+            fVoy: this.ship[0].voyNo,
+            fVslid: this.ship[0].fVslid,
+            fVoyid: this.ship[0].fVoyid,
+            fUpdatetime: this.arrival,
+            updateStatus: '2',
+          }
+          cargoStatus(data).then(response => {
+            this.getList();
+            this.$message({
+              showClose: true,
+              message: '到港操作成功',
+              type: 'success'
+            });
+          })
+        }
+      } else {
         this.$message({
           showClose: true,
-          message: '到港时间未选择',
+          message: '该航次未离港或已到港',
           type: 'warning'
         });
-      } else {
-        const data = {
-          fVsl: this.ship[0].vslName,
-          fVoy: this.ship[0].voyNo,
-          fVslid: this.ship[0].fVslid,
-          fVoyid: this.ship[0].fVoyid,
-          fUpdatetime: this.arrival,
-          updateStatus: '2',
-        }
-        cargoStatus(data).then(response => {
-          this.$message({
-            showClose: true,
-            message: '到港操作成功',
-            type: 'success'
-          });
-        })
       }
     },
     // 导出清单