huangfuli 3 vuotta sitten
vanhempi
commit
55d2be7968
1 muutettua tiedostoa jossa 38 lisäystä ja 5 poistoa
  1. 38 5
      src/views/tranManagement/tranManagementShippingArrangemen.vue

+ 38 - 5
src/views/tranManagement/tranManagementShippingArrangemen.vue

@@ -313,6 +313,15 @@
                 ></ws-input>
               </ws-form-item>
             </div>
+            <span
+              v-if="item.status == '未装车'&& item.shipType == '散船'" 
+              width="22"
+              height="22"
+              class="del"
+              @click="del(index, item)"
+              src="../../../public/img/del.png"
+              alt=""
+              >×</span>
           </div>
           <el-button
             class="add bg-bottom"
@@ -340,7 +349,7 @@
 </template>
 <script>
 import { regionData, CodeToText, TextToCode } from 'element-china-area-data'
-import { shippingLook, packList, dispatchCat } from '@/model/transport/index'
+import { shippingLook, packList, dispatchCat ,delhaulagestage} from '@/model/transport/index'
 import { getstaff } from '@/model/warehouse/index'
 import Pagination from '@/components/Pagination'
 import WsUpload from '@/components/WsUpload'
@@ -542,10 +551,21 @@ export default {
       this.freightspace = []
       this.$router.go(-1)
     },
-    del(index) {
-      if (this.freightspace.length > 1) {
-        this.freightspace.splice(index, 1)
-      }
+    del(index, row) {
+      this.$confirm('船次信息删除后不可恢复,是否确定删除?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
+        }).then(() => {
+          delhaulagestage({ id: row.id })
+            .toPromise()
+            .then((response) => {
+              this.$message.success('删除成功')
+              if (this.deptBudgetList.tranCarInfoList.length > 1) {
+                  this.deptBudgetList.tranCarInfoList.splice(index, 1)
+               }
+            })
+        })
     },
     add() {
       this.deptBudgetList.tranCarInfoList.push({
@@ -1297,4 +1317,17 @@ export default {
 /deep/.el-form-item__content .el-select {
   width: 42%;
 }
+//减号
+.del {
+  position: absolute;
+  // right: -38px;
+  top: 0px;
+  cursor: pointer;
+  right: -1%;
+  display: inline-block;
+  font-size: 20px;
+  width: 20px;
+  height: 10px;
+  line-height: 0px;
+}
 </style>