luobang преди 2 години
родител
ревизия
4944e1ce23

+ 2 - 1
build/utils.js

@@ -25,7 +25,8 @@ const devPathSrc = path.resolve(__dirname, "../../../src"); // node_modules应
 // let devModules = ["index", "inward", "appoint", "queue"];
 
 // let devModules = ["index", "appoint", "statisticalReport", "WMS"];
-let devModules = ["index", "appoint", "inward", "statisticalReport", "RMS"];
+// let devModules = ["index", "appoint", "inward", "statisticalReport", "RMS"];
+let devModules = ["all"];
 
 // let devModules = ['index','appoint','sale','statisticalReport','RMS','TMS','WMS']
 // let devModules = ["index", "ADMINISTRATORS", "RMS"];

+ 2 - 2
config/index.js

@@ -65,9 +65,9 @@ let proxyTable = {
   },
   // 所有数据的请求域名地址
   "/api/v1": {
-    // target: "http://172.16.33.166:80",
+    target: "http://172.16.33.166:80",
     // target: "http://localhost:8080",
-    target: "http://192.168.1.104:8080",
+    // target: "http://192.168.1.107:8080",
     ws: true,
     pathRewrite: {
       "^/api/v1": "/api/v1"

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

@@ -667,7 +667,33 @@
         <el-button type="primary" @click="sendRequest">提交订单</el-button>
       </div>
     </el-dialog>
-
+    <el-dialog
+      title="绑定销售片区(将该单位绑定片区才可以上传金蝶)"
+      :visible.sync="isHaveArea"
+      width="94%"
+    >
+      <div class="isHaveArea">
+        <el-form>
+          <el-form-item>
+            <el-label>
+              请选择销售片区
+            </el-label>
+            <el-autocomplete
+              class="inline-input"
+              v-model="saleArea"
+              :fetch-suggestions="querySearchSaleArea"
+              placeholder="请选择销售片区"
+              :trigger-on-focus="false"
+              @select="handleSelectSaleArea"
+            >
+            </el-autocomplete>
+          </el-form-item>
+        </el-form>
+      </div>
+      <div class="button-box">
+        <el-button type="primary" @click="onclikSaleArea">确定</el-button>
+      </div>
+    </el-dialog>
     <div class="button-box">
       <el-button @click="cancel">取消</el-button>
       <el-button type="primary" @click="makeSure">确定</el-button>
@@ -682,6 +708,8 @@ export default {
   components: { PageTitle },
   data() {
     return {
+      saleArea: "",
+      isHaveArea: false,
       consigneeDisable: false,
       isCellClick: 0,
       truckRemark: "",
@@ -906,7 +934,8 @@ export default {
       saleOrderReceiveCustomer: null,
       //是否忽视收货客户电话字段
       ignoreSaleOrderConsigneeTel: 0,
-      restaurants: []
+      restaurants: [],
+      saleAreaId: null
     };
   },
   created() {
@@ -968,13 +997,59 @@ export default {
     }
   },
   methods: {
+    handleSelectSaleArea(item) {
+      this.saleAreaId = item.areaId;
+      this.remarks = item.value;
+    },
+    onclikSaleArea() {
+      this.axios
+        .post("/api/v1/uc/bandSaleArea", {
+          areaId: this.saleAreaId,
+          receiveId: this.consigneeId
+        })
+        .then(res => {
+          if (res.data.code == "200") {
+            this.$message.success("绑定片区成功");
+            this.isHaveArea = false;
+          } else {
+            this.$message.error("绑定片区失败");
+            this.isHaveArea = false;
+          }
+        })
+        .catch(() => {
+          this.$message.error("绑定片区失败");
+          this.isHaveArea = false;
+        });
+    },
     isReceiveHaveArea(receiveId) {
       this.axios
         .post("/api/v1/uc/isReceiveHaveArea?receiveId=" + receiveId)
         .then(res => {
-          console.log(res);
+          if (res.data.code == "201") {
+            this.isHaveArea = true;
+          }
         });
     },
+    querySearchSaleArea(queryString, cb) {
+      this.axios
+        .post("/api/v1/uc/getSaleAreaByLike?index=" + queryString)
+        .then(res => {
+          var restaurants = res.data.data;
+          console.log(restaurants);
+          var results = queryString
+            ? restaurants.filter(this.createStateFilterSaleArea(queryString))
+            : restaurants;
+          cb(results);
+        });
+    },
+    createStateFilterSaleArea(queryString) {
+      return restaurants => {
+        return (
+          restaurants.label.toLowerCase().indexOf(queryString.toLowerCase()) >
+          -1
+        );
+      };
+    },
     handleSelectAddress(item) {
       this.saleShipperAddressName = item.addressPlace;
       this.province = item.addressProvince;
@@ -1114,7 +1189,7 @@ export default {
     handleSelectConsignee(item) {
       this.consigneeName = item.consigneeCompanyName;
       this.consigneeId = item.consigneeId;
-      // this.isReceiveHaveArea(this.consigneeId);
+      this.isReceiveHaveArea(this.consigneeId);
       //带出摘要
       this.axios
         .post("/api/v1/uc/getSaleArea?receiveId=" + this.consigneeId)
@@ -1953,9 +2028,7 @@ export default {
           done();
         })
         .catch(_ => {});
-    },
-
-    CloseClick() {}
+    }
   }
 };
 </script>

+ 32 - 1
src/views/appoint/components/saleContract/saleOrderSteel.vue

@@ -111,7 +111,7 @@
               fixed="right"
               label="操作"
               align="center"
-              width="200"
+              width="280"
             >
               <template slot-scope="scope">
                 <el-button
@@ -126,6 +126,12 @@
                   size="small"
                   >关闭订单</el-button
                 >
+                <el-button
+                  @click="adverseCloseSaleOrder(scope.row)"
+                  type="text"
+                  size="small"
+                  >反关闭订单</el-button
+                >
                 <el-button
                   @click="updateSaleOrder(scope.row)"
                   type="text"
@@ -349,6 +355,31 @@ export default {
     }
   },
   methods: {
+    adverseCloseSaleOrder(row) {
+      console.log(row);
+      this.$confirm("确定反关闭整条订单吗?", "继续?", {
+        cancelButtonText: "取消",
+        confirmButtonText: "确定",
+        center: true
+      }).then(() => {
+        this.axios
+          .post(
+            "/api/v1/ams/adverseCloseSaleOrder?saleOrderId=" + row.saleOrderId
+          )
+          .then(res => {
+            if (res.data.code == "200") {
+              this.$message.success("反关闭成功");
+              this.getRequestUrl();
+            } else {
+              this.$message.error("反关闭失败");
+              this.getRequestUrl();
+            }
+          })
+          .catch(() => {
+            this.$message.error("反关闭失败");
+          });
+      });
+    },
     updateReportedSaleOrder(scope) {
       this.$router.push("/editSaleOrder/" + scope.row.saleOrderId);
     },

+ 209 - 129
src/views/inward/components/inwardSettlement/detailOrder.vue

@@ -2,34 +2,86 @@
 <template>
   <div class="steel_inbound">
     <div class="sache">
-      <span>详单时间:</span>
-      <el-date-picker
-        v-model="startTime"
-        type="datetime"
-        placeholder="选择日期"
-      >
-      </el-date-picker>
-      <span>至</span>
-      <el-date-picker v-model="endTime" type="datetime" placeholder="选择日期">
-      </el-date-picker>
-      <el-button type="primary" class="btn" @click="onclick">
-        <i class="el-icon-search"></i>查询
-      </el-button>
-      <el-button type="primary" @click="exportData()"
-        ><i class="el-icon-download"></i>导出(Excel)</el-button
-      >
-      <span style="margin-left: 1rem;">合计净重:</span>
-      <el-input
-        v-model="totalNetWeight"
-        :disabled="true"
-        style="width: 140px;"
-      ></el-input>
-      <span style="margin-left: 1rem;">合计金额:</span>
-      <el-input
-        v-model="totalMoney"
-        :disabled="true"
-        style="width: 100px;"
-      ></el-input>
+      <el-form :inline="true" style="margin-top :5px">
+        <el-form-item>
+          <el-select
+            v-model="screen"
+            placeholder="请选择需筛选的内容"
+            clearable
+            style="width:120px"
+          >
+            <el-option
+              v-for="item in options"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            >
+            </el-option>
+          </el-select>
+          <el-input
+            style="width:200px"
+            v-model="input"
+            placeholder="请输入查询条件"
+            clearable
+          ></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-select
+            v-model="screen1"
+            placeholder="请选择需筛选的内容"
+            clearable
+            style="width:120px"
+          >
+            <el-option
+              v-for="item in optionsF"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            >
+            </el-option>
+          </el-select>
+          <el-input
+            style="width:200px"
+            v-model="input1"
+            placeholder="请输入查询条件"
+            clearable
+          ></el-input>
+        </el-form-item>
+        <span>详单时间:</span>
+        <el-date-picker
+          v-model="startTime"
+          type="datetime"
+          placeholder="选择日期"
+          style="width:200px"
+        >
+        </el-date-picker>
+        <span>至</span>
+        <el-date-picker
+          v-model="endTime"
+          type="datetime"
+          placeholder="选择日期"
+          style="width:200px"
+        >
+        </el-date-picker>
+        <el-button type="primary" class="btn" @click="onclick">
+          <i class="el-icon-search"></i>
+        </el-button>
+        <el-button type="primary" @click="exportData()"
+          ><i class="el-icon-download"></i>Excel</el-button
+        >
+        <!-- <span style="margin-left: 1rem;">合计净重:</span>
+        <el-input
+          v-model="totalNetWeight"
+          :disabled="true"
+          style="width: 120px;"
+        ></el-input>
+        <span style="margin-left: 1rem;">合计金额:</span>
+        <el-input
+          v-model="totalMoney"
+          :disabled="true"
+          style="width: 100px;"
+        ></el-input> -->
+      </el-form>
     </div>
     <div class="table">
       <el-tabs v-model="activeName" tab-click="handClick">
@@ -61,6 +113,44 @@ import { sjTime } from "@/utils/sharedJsFile";
 export default {
   data() {
     return {
+      options: [
+        {
+          value: "用车单位",
+          label: "用车单位"
+        },
+        {
+          value: "货物名称",
+          label: "货物名称"
+        },
+        {
+          value: "车牌号",
+          label: "车牌号"
+        },
+        {
+          value: "承运起止范围",
+          label: "承运起止范围"
+        }
+      ],
+      optionsF: [
+        {
+          value: "用车单位",
+          label: "用车单位"
+        },
+        {
+          value: "货物名称",
+          label: "货物名称"
+        },
+        {
+          value: "车牌号",
+          label: "车牌号"
+        },
+        {
+          value: "承运起止范围",
+          label: "承运起止范围"
+        }
+      ],
+      screen: null,
+      screen1: null,
       startTime: null,
       endTime: null,
       //合计净重
@@ -71,7 +161,8 @@ export default {
       Fee: null,
       //加载
       selectLineLoading: false,
-      input: "",
+      input: null,
+      input1: null,
       activeName: "first",
       ssoId: null,
       //详单Id
@@ -192,107 +283,100 @@ export default {
     onclick() {
       let startTime = null;
       let endTime = null;
-      if (this.startTime) {
+      let orgCode = null;
+      let materialTypeNames = null;
+      let transRangeValues = null;
+      let shipperNames = null;
+      let capacityNo = null;
+      let carrierSsoId = null;
+      if (this.startTime && this.endTime) {
         startTime = sjTime(this.startTime);
-      }
-      if (this.endTime) {
         endTime = sjTime(this.endTime);
       }
-      if (startTime && endTime) {
-        if (startTime < endTime) {
-          if (
-            getCookie("orgCode") == "dagangadmin" ||
-            getCookie("orgCode") == "zidonghuabu" ||
-            getCookie("orgCode") == "wuliuchuyunzhongxin"
-          ) {
-            this.options1.requestUrl =
-              "/api/v1/bms/getInwardWeightDetailsOrder?apiId=461&orderType=11&detailStatus=0" +
-              "&startTime=" +
-              startTime +
-              "&endTime=" +
-              endTime +
-              "&i" +
-              new Date();
-            this.options2.requestUrl =
-              "/api/v1/bms/getInwardWeightDetailsOrder?apiId=461&orderType=11&detailStatus=1" +
-              "&startTime=" +
-              startTime +
-              "&endTime=" +
-              endTime +
-              "&i" +
-              new Date();
-            this.options3.requestUrl =
-              "/api/v1/bms/getNoInwardDetails?apiId=490" +
-              "&startTime=" +
-              startTime +
-              "&endTime=" +
-              endTime +
-              "&i" +
-              new Date();
-          } else if (getCookie("orgCode") == "chengyunshang") {
-            this.options1.requestUrl =
-              "/api/v1/bms/getInwardWeightDetailsOrder?apiId=461&orderType=11&detailStatus=0&carrierSsoId=" +
-              getCookie("userId") +
-              "&startTime=" +
-              startTime +
-              "&endTime=" +
-              endTime +
-              "&i" +
-              new Date();
-            this.options2.requestUrl =
-              "/api/v1/bms/getInwardWeightDetailsOrder?apiId=461&orderType=11&detailStatus=1&carrierSsoId=" +
-              getCookie("userId") +
-              "&startTime=" +
-              startTime +
-              "&endTime=" +
-              endTime +
-              "&i" +
-              new Date();
-            this.options3.requestUrl =
-              "/api/v1/bms/getNoInwardDetails?apiId=490&carrierSsoId=" +
-              getCookie("userId") +
-              "&startTime=" +
-              startTime +
-              "&endTime=" +
-              endTime +
-              "&i" +
-              new Date();
-          } else {
-            this.options1.requestUrl =
-              "/api/v1/bms/getInwardWeightDetailsOrder?apiId=461&orderType=11&detailStatus=0&userId=" +
-              getCookie("orgCode") +
-              "&startTime=" +
-              startTime +
-              "&endTime=" +
-              endTime +
-              "&i" +
-              new Date();
-            this.options2.requestUrl =
-              "/api/v1/bms/getInwardWeightDetailsOrder?apiId=461&orderType=11&detailStatus=1&userId=" +
-              getCookie("orgCode") +
-              "&startTime=" +
-              startTime +
-              "&endTime=" +
-              endTime +
-              "&i" +
-              new Date();
-            this.options3.requestUrl =
-              "/api/v1/bms/getNoInwardDetails?apiId=490&userId=" +
-              getCookie("orgCode") +
-              "&startTime=" +
-              startTime +
-              "&endTime=" +
-              endTime +
-              "&i" +
-              new Date();
-          }
-        } else {
-          this.startTime = null;
-          this.endTime = null;
-          this.$message.warning("开始时间要比结束时间早");
-        }
+      if (getCookie("orgCode") == "chengyunshang") {
+        carrierSsoId = getCookie("userId");
+      }
+      if (
+        getCookie("orgCode") == "dagangadmin" ||
+        getCookie("orgCode") == "zidonghuabu" ||
+        getCookie("orgCode") == "wuliuchuyunzhongxin"
+      ) {
+        orgCode = null;
       } else {
+        orgCode = getCookie("orgCode");
       }
+      if (this.screen == "车牌号") {
+        capacityNo = this.input;
+      }
+      if (this.screen == "承运起止范围") {
+        transRangeValues = this.input;
+      }
+      if (this.screen == "货物名称") {
+        materialTypeNames = this.input;
+      }
+      if (this.screen == "用车单位") {
+        shipperNames = this.input;
+      }
+      if (this.screen1 == "车牌号") {
+        capacityNo = this.input1;
+      }
+      if (this.screen1 == "承运起止范围") {
+        transRangeValues = this.input1;
+      }
+      if (this.screen1 == "货物名称") {
+        materialTypeNames = this.input1;
+      }
+      if (this.screen1 == "用车单位") {
+        shipperNames = this.input1;
+      }
+      this.options1.requestUrl =
+        "/api/v1/bms/getInwardWeightDetailsOrder?apiId=461&orderType=11&detailStatus=0" +
+        "&startTime=" +
+        startTime +
+        "&endTime=" +
+        endTime +
+        "&shipperNames=" +
+        shipperNames +
+        "&materialTypeNames=" +
+        materialTypeNames +
+        "&transRangeValues=" +
+        transRangeValues +
+        "&capacityNo=" +
+        capacityNo +
+        "&i" +
+        new Date();
+      this.options2.requestUrl =
+        "/api/v1/bms/getInwardWeightDetailsOrder?apiId=461&orderType=11&detailStatus=1" +
+        "&startTime=" +
+        startTime +
+        "&endTime=" +
+        endTime +
+        "&shipperNames=" +
+        shipperNames +
+        "&materialTypeNames=" +
+        materialTypeNames +
+        "&transRangeValues=" +
+        transRangeValues +
+        "&capacityNo=" +
+        capacityNo +
+        "&i" +
+        new Date();
+      this.options3.requestUrl =
+        "/api/v1/bms/getNoInwardDetails?apiId=490" +
+        "&startTime=" +
+        startTime +
+        "&endTime=" +
+        endTime +
+        "&shipperNames=" +
+        shipperNames +
+        "&materialTypeNames=" +
+        materialTypeNames +
+        "&transRangeValues=" +
+        transRangeValues +
+        "&capacityNo=" +
+        capacityNo +
+        "&i" +
+        new Date();
     },
     //运输订单点击浏览的事件
     select() {
@@ -313,10 +397,6 @@ export default {
   .sache {
     margin-left: 20px;
     margin-top: 20px;
-    .el-input {
-      width: 20%;
-      margin-right: 1.25rem;
-    }
   }
   .table {
     margin-left: 20px;

+ 167 - 105
src/views/inward/components/truckOrder/plan.vue

@@ -11,7 +11,6 @@
     <template>
       <div>
         <el-tabs v-model="activeName" @tab-click="handleClick">
-          
           <el-tab-pane label="待分解" name="second">
             <dilTable v-bind.sync="second" ref="table1">
               <el-table-column fixed="right" label="操作" width="100">
@@ -25,64 +24,63 @@
                   </el-button>
                 </template>
               </el-table-column>
-          <!-- 物资详情抽屉 -->
-          <el-table-column type="expand" width="1">
-          <template slot-scope="props">
-            <el-form label-position="center" inline class="demo-table-expand">
-              <div v-if="false">{{ props }}</div>
-              <div>
-                <el-table :data="tableData" border >
-                  <el-table-column
-                    v-for="(item, i) in tableHead"
-                    :key="i"
-                    :prop="item.prop"
-                    :label="item.label"
-                    :width="item.width"
-                  ></el-table-column>
-                </el-table>
-              </div>
-            </el-form>
-          </template>
-          </el-table-column> 
             </dilTable>
           </el-tab-pane>
           <el-tab-pane label="已分解" name="third">
             <dilTable v-bind.sync="third" ref="table2">
-             <el-table-column fixed="right" label="操作" width="150">
+              <el-table-column fixed="right" label="操作" width="180">
                 <template slot-scope="scope">
-                  <el-button type="text" size="mini" @click="desponsePlan(scope)">
+                  <el-button
+                    type="text"
+                    size="mini"
+                    @click="desponsePlan(scope)"
+                  >
                     继续分解
                   </el-button>
-                  <el-button type="text" size="mini" @click="getPlanOrder(scope)">
+                  <el-button
+                    type="text"
+                    size="mini"
+                    @click="getPlanOrder(scope)"
+                  >
                     运单
                   </el-button>
+                  <el-button
+                    type="text"
+                    size="mini"
+                    @click="closePlanOrder(scope)"
+                  >
+                    关闭计划
+                  </el-button>
+                </template>
+              </el-table-column>
+              <!-- 物资详情抽屉 -->
+              <el-table-column type="expand" width="1">
+                <template slot-scope="props">
+                  <el-form
+                    label-position="center"
+                    inline
+                    class="demo-table-expand"
+                  >
+                    <div v-if="false">{{ props }}</div>
+                    <div>
+                      <el-table :data="tableData" border>
+                        <el-table-column
+                          v-for="(item, i) in tableHead"
+                          :key="i"
+                          :prop="item.prop"
+                          :label="item.label"
+                          :width="item.width"
+                        ></el-table-column>
+                      </el-table>
+                    </div>
+                  </el-form>
                 </template>
               </el-table-column>
-          <!-- 物资详情抽屉 -->
-          <el-table-column type="expand" width="1">
-          <template slot-scope="props">
-            <el-form label-position="center" inline class="demo-table-expand">
-              <div v-if="false">{{ props }}</div>
-              <div>
-                <el-table :data="tableData" border >
-                  <el-table-column
-                    v-for="(item, i) in tableHead"
-                    :key="i"
-                    :prop="item.prop"
-                    :label="item.label"
-                    :width="item.width"
-                  ></el-table-column>
-                </el-table>
-              </div>
-            </el-form>
-          </template>
-          </el-table-column> 
             </dilTable>
           </el-tab-pane>
-          
+
           <el-tab-pane label="已完成" name="four">
-            <dilTable v-bind.sync="four" ref="table3">
-            </dilTable>
+            <dilTable v-bind.sync="four" ref="table3"> </dilTable>
           </el-tab-pane>
         </el-tabs>
       </div>
@@ -95,81 +93,145 @@ export default {
   data() {
     return {
       inputText: "",
-      carrierId:40,
+      carrierId: 40,
       first: {
         // first请求数据的地址
-        requestUrl:"",
+        requestUrl: ""
       },
       second: {
         // second请求数据的地址
-        requestUrl:
-          "" 
+        requestUrl: ""
       },
       third: {
         // second请求数据的地址
-        requestUrl:
-          "" 
+        requestUrl: ""
       },
-      four:{
-        requestUrl:""
+      four: {
+        requestUrl: ""
       },
       activeName: "second",
-      tableData: [],
+      tableData: []
     };
   },
-  created(){
-      if(getCookie("orgCode") == "chengyunshang"){
-        this.first.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=1&carrierId=" + getCookie("userId")
-        this.second.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2&carrierId=" + getCookie("userId")
-        this.third.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=3&carrierId=" + getCookie("userId")
-        this.four.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=4&carrierId=" + getCookie("userId")
-      }else{
-        this.first.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=1"
-        this.second.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2"
-        this.third.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=3"
-        this.four.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=4"
-      } 
+  created() {
+    if (getCookie("orgCode") == "chengyunshang") {
+      this.first.requestUrl =
+        "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=1&carrierId=" +
+        getCookie("userId");
+      this.second.requestUrl =
+        "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2&carrierId=" +
+        getCookie("userId");
+      this.third.requestUrl =
+        "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=3&carrierId=" +
+        getCookie("userId");
+      this.four.requestUrl =
+        "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=4&carrierId=" +
+        getCookie("userId");
+    } else {
+      this.first.requestUrl =
+        "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=1";
+      this.second.requestUrl =
+        "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2";
+      this.third.requestUrl =
+        "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=3";
+      this.four.requestUrl =
+        "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=4";
+    }
   },
   methods: {
-     handleClick(tab, event) {
-      console.log("zhix")
-      this.getRequestUrl()
-      this.getRequirementMaterial()
+    handleClick(tab, event) {
+      console.log("zhix");
+      this.getRequestUrl();
+      this.getRequirementMaterial();
     },
-    getRequestUrl(){
-      if(getCookie("orgCode") == "chengyunshang"){
-        this.first.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=1&carrierId=" + getCookie("userId") + "&i=" + new Date()
-        this.second.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2&carrierId=" + getCookie("userId") + "&i=" + new Date()
-        this.third.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=3&carrierId=" + getCookie("userId") + "&i=" + new Date()
-        this.four.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=4&carrierId=" + getCookie("userId") + "&i=" + new Date()
-      }else{
-        this.first.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=1" + "&i=" + new Date()
-        this.second.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2" + "&i=" + new Date()
-        this.third.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=3" + "&i=" + new Date()
-        this.four.requestUrl = "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=4" + "&i=" + new Date()
-      } 
+    getRequestUrl() {
+      if (getCookie("orgCode") == "chengyunshang") {
+        this.first.requestUrl =
+          "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=1&carrierId=" +
+          getCookie("userId") +
+          "&i=" +
+          new Date();
+        this.second.requestUrl =
+          "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2&carrierId=" +
+          getCookie("userId") +
+          "&i=" +
+          new Date();
+        this.third.requestUrl =
+          "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=3&carrierId=" +
+          getCookie("userId") +
+          "&i=" +
+          new Date();
+        this.four.requestUrl =
+          "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=4&carrierId=" +
+          getCookie("userId") +
+          "&i=" +
+          new Date();
+      } else {
+        this.first.requestUrl =
+          "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=1" +
+          "&i=" +
+          new Date();
+        this.second.requestUrl =
+          "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=2" +
+          "&i=" +
+          new Date();
+        this.third.requestUrl =
+          "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=3" +
+          "&i=" +
+          new Date();
+        this.four.requestUrl =
+          "/api/v1/ams/getTruckPlanList?apiId=258&planStatus=4" +
+          "&i=" +
+          new Date();
+      }
+    },
+    closePlanOrder(scope) {
+      console.log(scope.row.planId);
+      this.$confirm(
+        "确定关闭该计划吗?该操作会将计划下未接收订单全部关闭",
+        "是否继续?",
+        {
+          center: true,
+          confirmButtonText: "确定",
+          cancelButtonText: "取消"
+        }
+      ).then(() => {
+        this.axios
+          .post("/api/v1/oms/closeInwardOrderByPlan?planId=" + scope.row.planId)
+          .then(res => {
+            if (res.data.code == "200") {
+              this.$message.success("关闭成功");
+              this.getRequestUrl();
+            } else {
+              this.$message.error("关闭失败");
+            }
+          })
+          .catch(() => {
+            this.$message.error("关闭失败");
+          });
+      });
     },
     receiver(scope) {
       this.$confirm("是否接收", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",
-        center: true,
+        center: true
       })
         .then(() => {
           this.axios
             .post("/api/v1/ams/receiveInwardPlan/" + scope.row.planId)
-            .then((res) => {
+            .then(res => {
               if (res.data.code == 200) {
                 this.$message({
                   type: "success",
-                  message: "接收成功!",
+                  message: "接收成功!"
                 });
-                this.getRequestUrl()
+                this.getRequestUrl();
               } else {
                 this.$message({
                   message: "接收失败",
-                  type: "warning",
+                  type: "warning"
                 });
               }
             });
@@ -177,7 +239,7 @@ export default {
         .catch(() => {
           this.$message({
             type: "info",
-            message: "接收操作已取消!",
+            message: "接收操作已取消!"
           });
         });
     },
@@ -195,24 +257,24 @@ export default {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",
-        center: true,
+        center: true
       })
         .then(() => {
           this.axios
             .post(
               "/api/v1/bms/deleteTrainSettlement/" + scope.row.requirementId
             )
-            .then((res) => {
+            .then(res => {
               if (res.data.code == 200) {
                 this.$message({
                   type: "success",
-                  message: "删除成功!",
+                  message: "删除成功!"
                 });
-                this.getRequestUrl()
+                this.getRequestUrl();
               } else {
                 this.$message({
                   message: "删除失败",
-                  type: "warning",
+                  type: "warning"
                 });
               }
             });
@@ -220,7 +282,7 @@ export default {
         .catch(() => {
           this.$message({
             type: "info",
-            message: "删除操作已取消!",
+            message: "删除操作已取消!"
           });
         });
     },
@@ -230,7 +292,7 @@ export default {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",
-        center: true,
+        center: true
       })
         .then(() => {
           this.axios
@@ -238,17 +300,17 @@ export default {
               "/api/v1/ams/addFixedAmsDispatchSaleOrder",
               this.first.mapList
             )
-            .then((res) => {
+            .then(res => {
               if (res.data.code == 200) {
                 this.$message({
                   type: "success",
-                  message: "下发成功!",
+                  message: "下发成功!"
                 });
-                this.getRequestUrl()
+                this.getRequestUrl();
               } else {
                 this.$message({
                   message: "下发失败",
-                  type: "warning",
+                  type: "warning"
                 });
               }
             });
@@ -256,23 +318,23 @@ export default {
         .catch(() => {
           this.$message({
             type: "info",
-            message: "取消下发!",
+            message: "取消下发!"
           });
         });
-    },
-  },
+    }
+  }
 };
 </script>
 <style lang="scss">
-.inwardDisPlan{
+.inwardDisPlan {
   margin-top: 20px;
   margin-left: 20px;
-  .sache{
+  .sache {
     padding: 1.25rem 0.375rem;
     .el-input {
       width: 20%;
       margin-right: 1.25rem;
     }
   }
-  }
+}
 </style>

+ 50 - 33
src/views/statisticalReport/components/salesLogisticsStatistics/saleSteelAllReport.vue

@@ -307,6 +307,7 @@
               type="text"
               size="small"
               @click="closeEasEntryId(scope.row)"
+              v-if="scope.row.deletedStatus == null"
               >关闭分录</el-button
             >
           </template>
@@ -322,10 +323,31 @@
               type="text"
               size="small"
               @click="deleteEasEntryId(scope.row)"
+              v-if="
+                scope.row.carStatus == 4 ||
+                  scope.row.carStatus == 5 ||
+                  scope.row.carStatus == null
+              "
               >关闭车辆</el-button
             >
           </template>
         </el-table-column>
+        <el-table-column
+          label="操作"
+          fixed="right"
+          width="120px"
+          align="center"
+        >
+          <template slot-scope="scope">
+            <el-button
+              type="text"
+              size="small"
+              @click="adverseCloseSaleMaterial(scope.row)"
+              v-if="scope.row.deletedStatus != null"
+              >反关闭分录</el-button
+            >
+          </template>
+        </el-table-column>
       </el-table>
     </div>
     <div class="address">
@@ -507,32 +529,39 @@ export default {
       addressRow: {}
     };
   },
-  computed: {
-    filterData() {
-      return function() {
-        let obj = [];
-        //找到对应的数据,并添加到obj
-        this.tableData.filter(item => {
-          let map = {};
-          if (
-            item.capacityNo != null &&
-            item.capacityNo != "" &&
-            item.capacityNo != "null"
-          ) {
-            map.text = item.capacityNo;
-            map.value = item.capacityNo;
-            obj.push(map);
-          }
-        });
-        return this.deWeight(obj);
-      };
-    }
-  },
   created() {},
   mounted() {
     this.getSteelReport();
   },
   methods: {
+    //反关闭整条分录
+    adverseCloseSaleMaterial(row) {
+      console.log(row.saleMaterialId);
+      this.$confirm("确定反关闭该条分录?", "提示", {
+        cancelButtonText: "确定",
+        confirmButtonText: "取消",
+        center: true
+      }).then(() => {
+        this.axios
+          .post(
+            "/api/v1/ams/adverseCloseSaleMaterial?saleMaterialId=" +
+              row.saleMaterialId
+          )
+          .then(res => {
+            if (res.data.code == "200") {
+              this.$message.success("反关闭成功");
+              this.getSteelReport();
+            } else {
+              this.$message.error("反关闭失败");
+              this.getSteelReport();
+            }
+          })
+          .catch(() => {
+            this.$message.error("反关闭失败");
+            this.getSteelReport();
+          });
+      });
+    },
     //销售钢材报表导出excel
     exportAllReportToExcel() {
       const loading = this.$loading({
@@ -568,18 +597,6 @@ export default {
     changeScreen() {
       console.log(this.screen);
     },
-    // 数组对象去重
-    deWeight(arr) {
-      for (var i = 0; i < arr.length - 1; i++) {
-        for (var j = i + 1; j < arr.length; j++) {
-          if (arr[i].text == arr[j].text) {
-            arr.splice(j, 1);
-            j--;
-          }
-        }
-      }
-      return arr;
-    },
     cellClik(row, column, cell, event) {
       if (row.group != this.clickIndex) {
         // this.getSteelReport();