소스 검색

Merge branch 'master' of https://git.steerinfo.com/DAL-DAZHOU/icore-pass

liyg 2 년 전
부모
커밋
b485cd1dfc

+ 15 - 7
src/views/appoint/components/saleContract/addSaleOrder.vue

@@ -17,6 +17,7 @@
           :trigger-on-focus="false"
           @select="handleSelectCarrier"
           style="width:245px"
+          disabled
         >
           <template slot-scope="{ item }">
             <div class="name">{{ item.shipperName }}</div>
@@ -87,7 +88,7 @@
         <el-input
           v-model="remarks"
           placeholder="(非必填)"
-          style="width: 100px"
+          style="width: 180px"
         ></el-input>
       </el-form-item>
     </el-form>
@@ -1745,14 +1746,21 @@ export default {
       console.log(mapValue);
       //所有列件数都填写
       if (orderPlanWeightAllFill == 0) {
-        this.axios.post("/api/v1/ams/addSteelSaleOrder", mapValue).then(res => {
-          if (res.data.code == "200") {
-            this.$router.go(-1);
-          }
-          this.$message.success("新增订单成功!");
-        });
+        this.axios
+          .post("/api/v1/ams/addSteelSaleOrder", mapValue)
+          .then(res => {
+            if (res.data.code == "200") {
+              this.$router.go(-1);
+              this.notDebounce = false;
+            }
+            this.$message.success("新增订单成功!");
+          })
+          .catch(() => {
+            this.$message.error();
+          });
       } else {
         this.$message.error("还有物资件数未填写!");
+        this.notDebounce = false;
       }
     },
     // 取消

+ 4 - 3
src/views/appoint/components/saleContract/editSaleOrder.vue

@@ -17,6 +17,7 @@
           :trigger-on-focus="false"
           @select="handleSelectCarrier"
           style="width:245px"
+          disabled
         >
           <template slot-scope="{ item }">
             <div class="name">{{ item.shipperName }}</div>
@@ -32,6 +33,7 @@
           placeholder="请输入下单客户名称"
           :trigger-on-focus="false"
           @select="handleSelectConsignee"
+          style="width:300px"
         >
           <template slot-scope="{ item }">
             <div class="name">{{ item.consigneeCompanyName }}</div>
@@ -85,7 +87,7 @@
         <el-input
           v-model="remarks"
           placeholder="(非必填)"
-          style="width: 100px"
+          style="width: 180px"
         ></el-input>
       </el-form-item>
     </el-form>
@@ -454,7 +456,6 @@
         <el-button type="primary" @click="addAddressClick">确定</el-button>
       </div>
     </el-dialog>
-
     <!-- 物资选择模态框 -->
     <el-drawer
       title="选择物资信息"
@@ -508,7 +509,6 @@
         </dilTable>
       </div>
     </el-drawer>
-
     <!-- 更改行物资 -->
     <el-dialog title="更改物资" :visible.sync="drawer" width="80%">
       <el-form :inline="true" style="margin-top: 0.5rem;">
@@ -912,6 +912,7 @@ export default {
           this.shipperId = res.data.data.shipperId;
           this.consigneeName = res.data.data.receiveName;
           this.consigneeId = res.data.data.receiveId;
+          this.remarks = res.data.data.saleRemark;
           if (res.data.data.isSelfMention == "否") {
             this.values = "no";
           } else {

+ 98 - 4
src/views/appoint/components/saleContract/saleOrderSteel.vue

@@ -85,7 +85,12 @@
         </el-tab-pane>
         <!-- 已审批 -->
         <el-tab-pane label="已审批" name="four">
-          <mergeRowTable v-bind.sync="option4" ref="table" :pageSize="200">
+          <mergeRowTable
+            v-bind.sync="option4"
+            ref="table"
+            :pageSize="200"
+            @func="func1"
+          >
             <el-table-column
               fixed="right"
               label="操作"
@@ -116,7 +121,12 @@
           </mergeRowTable>
         </el-tab-pane>
         <el-tab-pane label="反审批" name="five">
-          <mergeRowTable v-bind.sync="option5" ref="table2" :pageSize="200">
+          <mergeRowTable
+            v-bind.sync="option5"
+            ref="table2"
+            :pageSize="200"
+            @func="func3"
+          >
             <el-table-column
               fixed="right"
               label="操作"
@@ -136,7 +146,27 @@
         </el-tab-pane>
         <!-- 已上报 -->
         <el-tab-pane label="已上报" name="second">
-          <mergeRowTable v-bind.sync="option2" ref="table2" :pageSize="200">
+          <mergeRowTable
+            v-bind.sync="option2"
+            ref="table2"
+            :pageSize="200"
+            @func="func2"
+          >
+            <el-table-column
+              fixed="right"
+              label="操作"
+              align="center"
+              width="200"
+            >
+              <template slot-scope="scope">
+                <el-button
+                  @click="updateSaleOrderStatusById(scope)"
+                  type="text"
+                  size="small"
+                  >撤销上报</el-button
+                >
+              </template>
+            </el-table-column>
           </mergeRowTable>
         </el-tab-pane>
       </el-tabs>
@@ -165,7 +195,7 @@ export default {
         requestUrl: "/api/v1/ams/getSaleOrderInfoes?apiId=408",
         selectionType: "select",
         comparison: "saleNumber",
-        columnIndexs: [0, 1, 2, 3, 4, 8, 9, 10, 11, 12, 13, 14, 15, 16]
+        columnIndexs: [0, 1, 2, 3, 4, 9, 10, 11, 12, 13, 14, 15, 16, 17]
       },
       option2: {
         // 表格请求数据的地址
@@ -242,6 +272,19 @@ export default {
       this.option5.requestUrl =
         "/api/v1/ams/getSteelOrderDeletedList?apiId=409&consigneeSsoId=" +
         getCookie("userId");
+    } else if (getCookie("orgCode") == "xiaoshouyewuyuan") {
+      this.option.requestUrl =
+        "/api/v1/ams/getSaleOrderInfoes?apiId=408&saler=" +
+        getCookie("loginName");
+      this.option2.requestUrl =
+        "/api/v1/ams/getSaleOrderReportedes?apiId=408&saler=" +
+        getCookie("loginName");
+      this.option4.requestUrl =
+        "/api/v1/ams/getSaleOrderListBySaleCompanyes?apiId=409&shipperId=1&saleType=1&saler=" +
+        getCookie("loginName");
+      this.option5.requestUrl =
+        "/api/v1/ams/getSteelOrderDeletedList?apiId=409&saler=" +
+        getCookie("loginName");
     } else {
       this.option.requestUrl =
         "/api/v1/ams/getSaleOrderInfoes?apiId=408&consigneeSsoId=" + null;
@@ -255,6 +298,57 @@ export default {
     }
   },
   methods: {
+    updateSaleOrderStatusById(scope) {
+      console.log(scope.row.saleOrderId);
+      this.$confirm("是否撤销", "警告", {
+        confirmButtonText: "确定撤销",
+        cancelButtonText: "取消撤销",
+        type: "warning",
+        center: true
+      })
+        .then(() => {
+          this.axios
+            .post(
+              "/api/v1/uc/updateSaleOrderStatusById?saleOrderId=" +
+                scope.row.saleOrderId
+            )
+            .then(res => {
+              if (res.data.code == "200") {
+                this.$message.success("撤销成功");
+                this.activeName = "first";
+                this.getRequestUrl();
+              } else {
+                this.$message.error("撤销失败");
+              }
+            })
+            .catch(() => {
+              this.$message.error("撤销失败");
+            });
+        })
+        .catch(() => {
+          console.log("取消撤销");
+        });
+    },
+    func(res) {
+      this.matSum = res.list.reduce(function(prev, item) {
+        return prev + item.materialNumber;
+      }, 0);
+    },
+    func1(res) {
+      this.matSum = res.list.reduce(function(prev, item) {
+        return prev + item.materialNumber;
+      }, 0);
+    },
+    func2(res) {
+      this.matSum = res.list.reduce(function(prev, item) {
+        return prev + item.materialNumber;
+      }, 0);
+    },
+    func3(res) {
+      this.matSum = res.list.reduce(function(prev, item) {
+        return prev + item.materialNumber;
+      }, 0);
+    },
     deleteSaleOrder(row) {
       this.$prompt("此操作将关闭订单且下面的待运输订单,是否继续?", "提示", {
         confirmButtonText: "确定",

+ 27 - 10
src/views/appoint/components/saleContract/updateSaleOrderSteel.vue

@@ -173,6 +173,14 @@
             >
               车辆变更
             </el-button>
+            <el-button
+              type="text"
+              size="mini"
+              @click="closeFlu(scope)"
+              v-if="deleted == 0"
+            >
+              关闭分录
+            </el-button>
             <el-button
               type="text"
               size="mini"
@@ -560,6 +568,10 @@ export default {
     this.getAllProvince();
   },
   methods: {
+    closeFlu(scope) {
+      this.capacityNumber = scope.row.capacityNumber;
+      this.deleteEasEntryId(scope.row);
+    },
     //车辆变更
     updateCapacity(scope) {
       this.oldCapacityNum = scope.row.capacityNumber;
@@ -624,8 +636,8 @@ export default {
       this.orderSaleMap = scope.row;
       console.log(this.orderSaleMap);
       let title = `请选择对-${scope.row.capacityNumber}-进行的操作?`;
-      let confirmText = `删除-${scope.row.capacityNumber}-金蝶分录`;
-      let cancelText = `不删除-${scope.row.capacityNumber}-金蝶分录`;
+      let confirmText = `关闭-${scope.row.capacityNumber}-金蝶分录`;
+      let cancelText = `不关闭-${scope.row.capacityNumber}-金蝶分录`;
       this.$confirm(title, "提示", {
         confirmButtonText: confirmText,
         cancelButtonText: cancelText,
@@ -645,7 +657,7 @@ export default {
     },
     //删除金蝶分录
     deleteEasEntryId(row) {
-      let title = `确定删除-${this.capacityNumber}-金蝶分录?`;
+      let title = `确定关闭-${this.capacityNumber}-金蝶分录?`;
       this.$confirm(title, {
         confirmButtonText: "是",
         cancelButtonText: "否",
@@ -656,13 +668,18 @@ export default {
           let map = row;
           map.isCloseEas = Number(0);
           map.saleOrderId = this.$route.params.saleOrderId;
-          this.axios.post("/api/v1/ams/updateCarAddress", map).then(res => {
-            if (res.data.code == "200") {
-              this.$message.success("删除成功");
-            } else {
-              this.$message.error("删除失败");
-            }
-          });
+          this.axios
+            .post("/api/v1/ams/updateCarAddress", map)
+            .then(res => {
+              if (res.data.code == "200") {
+                this.$message.success("关闭成功");
+              } else {
+                this.$message.error("关闭失败");
+              }
+            })
+            .catch(() => {
+              this.$message.error("关闭失败");
+            });
         })
         .catch(() => {
           this.$message.info("取消删除");