瀏覽代碼

提交计划下单提交

caojunjie 4 年之前
父節點
當前提交
9a6c736f66

+ 8 - 1
src/api/fleet/ftmsorderbills.js

@@ -78,4 +78,11 @@ export function planChangeFtmsorderbills(data) {
     method: 'post',
     data: data
   })
-}
+}
+//提交结束后改动状态
+export function changeStatus(fId) {
+  return request({
+    url: '/fleet/ftmsorderbills/submit?id='+fId,
+    method: 'get'
+  })
+}

+ 5 - 5
src/views/basicdata/dept/index.vue

@@ -33,7 +33,7 @@
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['system:dept:add']"
+          v-hasPermi="['basicdata:warehouse:add']"
         >新增</el-button>
       </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@@ -78,14 +78,14 @@
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['system:dept:edit']"
+            v-hasPermi="['basicdata:warehouse:edit']"
           >修改</el-button>
           <el-button
             size="mini"
             type="text"
             icon="el-icon-plus"
             @click="handleAdd(scope.row)"
-            v-hasPermi="['system:dept:add']"
+            v-hasPermi="['basicdata:warehouse:add']"
           >新增</el-button>
           <el-button
             v-if="scope.row.parentId != 0"
@@ -93,7 +93,7 @@
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['system:dept:remove']"
+            v-hasPermi="['basicdata:warehouse:remove']"
           >删除</el-button>
         </template>
       </el-table-column>
@@ -522,4 +522,4 @@ export default {
   background-color: rgba(0, 0, 0, 0.05);
   height: 100%;
 }
-</style>
+</style>

+ 38 - 12
src/views/fleet/plans/AddOrUpdate.vue

@@ -659,6 +659,7 @@ import {
   RetreatFtmsorderbills,
   allowChangesFtmsorderbills,
   planChangeFtmsorderbills,
+  changeStatus
 } from "@/api/fleet/ftmsorderbills";
 import { getBasicInformation } from "@/api/kaihe/basicdata/container";
 import { company } from "@/api/fleet/carManage";
@@ -919,25 +920,50 @@ export default {
           }
           this.form["cntrDesc"] = this.cntrDesc;
           let formData = new window.FormData();
-          console.log(this.form);
           formData.append("tmsorder", JSON.stringify(this.form));
           formData.append("attachs", JSON.stringify(this.relevantAttachments));
           formData.append("scntrs", JSON.stringify(this.planList));
           formData.append("fees", JSON.stringify([]));
           formData.append("plans", JSON.stringify(this.schedulingList));
-          if (this.form.billStatus != 5) {
-            addFtmsorderbills(formData).then((response) => {
-              this.msgSuccess("提交成功");
-              this.$parent.getList();
-              this.showDialog = false;
-            });
-          } else {
-            planChangeFtmsorderbills(formData).then((response) => {
-              this.msgSuccess("修改成功");
-              this.$parent.getList();
-              this.showDialog = false;
+          for (let item in this.planList){
+            console.log(JSON.stringify(this.planList[item].cntrQty))
+            if (JSON.stringify(this.planList[item].cntrQty) !== undefined ?JSON.stringify(this.planList[item].cntrQty).length === 0:JSON.stringify(this.planList[item].cntrQty) === undefined) return this.$message({
+              showClose: true,
+              message: (Number(item)+1) +'行计划货量不能为空',
+              type: 'error'
             });
           }
+          this.$confirm('请确认已保存, 是否继续?', '提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(() => {
+            if (this.form.billStatus != 5) {
+              addFtmsorderbills(formData).then((response) => {
+                this.msgSuccess("提交成功");
+                this.$parent.getList();
+                this.showDialog = false;
+                if (response.code === 200){
+                  changeStatus(this.form.id)
+                }
+              });
+            } else {
+              planChangeFtmsorderbills(formData).then((response) => {
+                this.msgSuccess("修改成功");
+                this.$parent.getList();
+                this.showDialog = false;
+                if (response.code === 200){
+                  console.log(this.form)
+                  changeStatus(this.form.id)
+                }
+              });
+            }
+          }).catch(() => {
+            this.$message({
+              type: 'info',
+              message: '已取消提交'
+            });
+          });
         }
       });
     },

+ 7 - 21
src/views/fleet/plans/index.vue

@@ -696,33 +696,19 @@ export default {
       this.loading = true;
       listFtmsorderbills(this.queryParams).then((response) => {
         response.rows.map((e) => {
+          this.getDicts("bill_status").then((response) => {
+            if ( response.code === 200 ){
+              for (let item in response.data){
+                if (e.billStatus == response.data[item].dictValue) e.billStatus = response.data[item].dictLabel
+              }
+            }
+          });
           if (e.createTime) {
             e.createTime = e.createTime.substring(0, 10);
           }
           if (e.loadDate) {
             e.loadDate = e.loadDate.substring(0, 10);
           }
-          if (e.billStatus == 1) {
-            e.billStatus = "新建";
-          }
-          if (e.billStatus == 2) {
-            e.billStatus = "计划暂存";
-          }
-          if (e.billStatus == 3) {
-            e.billStatus = "计划撤回";
-          }
-          if (e.billStatus == 6) {
-            e.billStatus = "计划提交";
-          }
-          if (e.billStatus == 20) {
-            e.billStatus = "调度暂存";
-          }
-          if (e.billStatus == 30) {
-            e.billStatus = "调度撤回";
-          }
-          if (e.billStatus == 60) {
-            e.billStatus = "调度提交";
-          }
         });
         this.ftmsorderbillsList = response.rows;
         this.total = response.total;

+ 7 - 21
src/views/fleet/scheduling/index.vue

@@ -661,33 +661,19 @@ export default {
       console.log(JSON.stringify(this.queryParams))
       listFtmsorderbillscntrs(this.queryParams).then((response) => {
         response.rows.map((e) => {
+          this.getDicts("bill_status").then((response) => {
+            if ( response.code === 200 ){
+              for (let item in response.data){
+                if (e.billStatus == response.data[item].dictValue) e.billStatus = response.data[item].dictLabel
+              }
+            }
+          });
           if (e.createTime) {
             e.createTime = e.createTime.substring(0, 10);
           }
           if (e.loadDate) {
             e.loadDate = e.loadDate.substring(0, 10);
           }
-          if (e.billStatus == 1) {
-            e.billStatus = "新建";
-          }
-          if (e.billStatus == 2) {
-            e.billStatus = "计划暂存";
-          }
-          if (e.billStatus == 3) {
-            e.billStatus = "计划撤销";
-          }
-          if (e.billStatus == 6) {
-            e.billStatus = "计划提交";
-          }
-          if (e.billStatus == 20) {
-            e.billStatus = "调度暂存";
-          }
-          if (e.billStatus == 30) {
-            e.billStatus = "调度撤回";
-          }
-          if (e.billStatus == 60) {
-            e.billStatus = "调度提交";
-          }
         });
         this.ftmsorderbillsList = response.rows;
         this.total = response.total;

+ 7 - 21
src/views/fleet/sendcar/index.vue

@@ -691,33 +691,19 @@ export default {
       this.loading = true;
       listFtmsorderbillsplans(this.queryParams).then((response) => {
         response.rows.map((e) => {
+          this.getDicts("bill_status").then((response) => {
+            if ( response.code === 200 ){
+              for (let item in response.data){
+                if (e.billStatus == response.data[item].dictValue) e.billStatus = response.data[item].dictLabel
+              }
+            }
+          });
           if (e.createTime) {
             e.createTime = e.createTime.substring(0, 10);
           }
           if (e.loadDate) {
             e.loadDate = e.loadDate.substring(0, 10);
           }
-          if (e.billStatus == 1) {
-            e.billStatus = "新建";
-          }
-          if (e.billStatus == 2) {
-            e.billStatus = "暂存";
-          }
-          if (e.billStatus == 3) {
-            e.billStatus = "撤销";
-          }
-          if (e.billStatus == 6) {
-            e.billStatus = "待派车";
-          }
-          if (e.billStatus == 20) {
-            e.billStatus = "派车中";
-          }
-          if (e.billStatus == 30) {
-            e.billStatus = "派车撤回";
-          }
-          if (e.billStatus == 60) {
-            e.billStatus = "派车完成";
-          }
         });
         this.ftmsorderbillsList = response.rows;
         this.total = response.total;