Browse Source

新增删除出库

liyg 2 years ago
parent
commit
9eadf25d8f

+ 33 - 6
src/views/TMS/components/importedMine/outBoundWagon.vue

@@ -14,7 +14,7 @@
     <el-tabs v-model="activeName" @tab-click="handleClick">
       <el-tab-pane label="全部" name="first">
         <mergeRowTable v-bind.sync="option1" ref="excelDom" @func="calculate">
-        <el-table-column fixed="right" label="操作" width="50">
+        <el-table-column fixed="right" label="操作" width="80">
           <template slot-scope="scope">
             <el-button
               @click="click(scope.row.resultId)"
@@ -23,18 +23,19 @@
               :disabled="scope.row.isEdit!=1"
               >修改</el-button
             >
-            <!-- <el-button
+            <el-button
             type="text"
             size="small"
+            :disabled="scope.row.isEdit!=1"
             @click="deleteclick(scope.row.resultId)"
-            >删除</el-button > -->
+            >删除</el-button >
           </template>
         </el-table-column>
       </mergeRowTable>
       </el-tab-pane>
       <el-tab-pane label="待计量" name="second">
         <mergeRowTable v-bind.sync="option1" ref="excelDom" @func="calculate">
-        <el-table-column fixed="right" label="操作" width="50">
+        <el-table-column fixed="right" label="操作" width="80">
           <template slot-scope="scope">
             <el-button
               @click="click(scope.row.resultId)"
@@ -43,11 +44,12 @@
               :disabled="scope.row.isEdit!=1"
               >修改</el-button
             >
-            <!-- <el-button
+            <el-button
             type="text"
             size="small"
+            :disabled="scope.row.isEdit!=1"
             @click="deleteclick(scope.row.resultId)"
-            >删除</el-button > -->
+            >删除</el-button >
           </template>
         </el-table-column>
       </mergeRowTable>
@@ -124,6 +126,31 @@ export default {
     click(resultId) {
       this.$router.push("/editOutBoundWagon/" + resultId);
     },
+    deleteclick(resultId){
+      this.$confirm("是否删除", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+        center: true
+      })
+        .then(() => {
+          this.$message({
+            type: "success",
+            message: "删除成功!"
+          });
+          this.axios
+            .post( "/api/v1/tms/deleteOutBoundWagonById?resultId=" + resultId)
+            .then(() => {
+              this.onclick();
+            });
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "取消删除!"
+          });
+        });
+    },
     //起止时间校验
     checkSEDate(){
       if(this.startTime && this.endTime && this.startTime<=this.endTime){

+ 4 - 1
src/views/TMS/router/index.js

@@ -1476,7 +1476,10 @@ const constantRouterMap = [
       },{
         path: "threeSectionFeeDetails",
         name: "threeSectionFeeDetails",
-        meta: { code: "xtpzgl-jggl" },
+        meta: { 
+          code: "xtpzgl-jggl",
+          keepAlive: true // 需要被缓存
+        },
         component: threeSectionFeeDetails
       },
       {