Browse Source

新增内转钢坯界面

liyg 2 years ago
parent
commit
5b3e7c7f1b

+ 415 - 0
src/views/inward/components/inwardBillet/addInwardBillet.vue

@@ -0,0 +1,415 @@
+// 新增内转钢坯需求
+<template>
+  <div class="inwardRequirement">
+    <page-title>新增需求</page-title>
+    <div>
+      <!-- 用车单位 -->
+      <div class="requireUnit form">
+        <el-form  class="demo-form-inline" label-width="80px">
+          <el-form-item label="用车单位">
+            <el-input
+              class="inline-input"
+              v-model="requireUnitName"
+              disabled
+            >
+            </el-input>
+          </el-form-item>
+          <el-form-item label="炉号">
+            <el-input
+              class="inline-input"
+              v-model="heatNo"
+            >
+            </el-input>
+          </el-form-item>
+          <el-form-item label="需求类型">
+            <el-input
+              class="inline-input"
+              v-model="requirementType"
+              disabled
+            >
+            </el-input>
+          </el-form-item>
+        <el-form-item label="选择班别">
+            <el-select
+              class="inline-select"
+              v-model="clazz"
+            >
+            <el-option
+            v-for="item in options"
+            :key="item.value"
+            :label="item.value"
+            :value="item.value">
+            </el-option>
+            </el-select>
+        </el-form-item>
+         <el-form-item label="选择钢种">
+            <el-select
+              class="inline-select"
+              v-model="type"
+            >
+            <el-option
+            v-for="item in options1"
+            :key="item.value"
+            :label="item.value"
+            :value="item.value">
+            </el-option>
+            </el-select>
+        </el-form-item>
+        <el-form-item label="选择规格">
+            <el-select
+              class="inline-select"
+              v-model="model"
+            >
+            <el-option
+            v-for="item in options2"
+            :key="item.value"
+            :label="item.value"
+            :value="item.value">
+            </el-option>
+            </el-select>
+        </el-form-item>
+        <!-- 车辆我设为多选了,我觉得会省事,他们应该不希望每台车都做一次 -->
+        <el-form-item label="选择车辆">
+            <el-select
+              class="inline-select"
+              v-model="capacityId"
+              multiple
+            >
+            <el-option
+            v-for="item in optionsCapacity"
+            :key="item.capacityId"
+            :label="item.capacityNumber"
+            :value="item.capacityId">
+            </el-option>
+            </el-select>
+        </el-form-item>
+        <el-form-item label="选择装货点">
+            <el-select
+              class="inline-select"
+              v-model="loadPoint"
+            >
+            <el-option
+            v-for="item in optionsLoad"
+            :key="item.warehouseId"
+            :label="item.warehouseName"
+            :value="item.warehouseId">
+            </el-option>
+            </el-select>
+        </el-form-item>
+        <el-form-item label="选择卸货点">
+            <el-select
+              class="inline-select"
+              v-model="unloadPoint"
+            >
+            <el-option
+            v-for="item in optionsUnload"
+            :key="item.warehouseId"
+            :label="item.warehouseName"
+            :value="item.warehouseId">
+            </el-option>
+            </el-select>
+        </el-form-item>
+        </el-form>
+      </div>
+    
+    </div>
+    <div class="button-box">
+      <el-button type="primary" @click="makeSure">确认新增</el-button>
+      <el-button type="primary" @click="cancel">返回</el-button>
+    </div>
+  </div>
+</template>
+
+<script>
+import PageTitle from '@/components/Page/Title'
+import { sjTime } from '@/utils/sharedJsFile'
+import { getCookie } from '@/utils/util.js'
+import { checkTel } from '@/utils/validator.js'
+import returnResultVue from '../offsetSteel/truckTransport/returnResult.vue'
+export default {
+  components: { PageTitle },
+  data() {
+    return {
+        requireUnitId:null,
+        requireUnitName:null,
+        heatNo:null,
+        requirementType:"计重",
+        clazz:null,
+        type:null,
+        model:null,
+        capacityId:null,
+        loadPoint:null,
+        unloadPoint:null,
+        options: [{
+            value:"甲"
+        },{
+            value:"乙"
+        },{
+            value:"丙"
+        }
+        ],
+        options1: [{
+            value:"Q215"
+        },{
+            value:"HPB300"
+        },{
+            value:"HRB400E"
+        },{
+            value:"HRB400"
+        },{
+            value:"HRB500"
+        },{
+            value:"HRB500E"
+        },{
+            value:"HRB600"
+        }
+        ],
+        options2: [{
+            value:"Φ16"
+        },{
+            value:"Φ6.5"
+        },{
+            value:"Φ6"
+        },{
+            value:"Φ8"
+        },{
+            value:"Φ10"
+        },{
+            value:"Φ12"
+        },{
+            value:"Φ14"
+        },{
+            value:"Φ16"
+        },{
+            value:"Φ36"
+        },{
+            value:"Φ40"
+        }
+        ],
+        capacityArr:['场S74348','场S74976','场S73321','场S16586','场S00859'],
+        optionsCapacity:[],
+        optionsLoad:[],
+        optionsUnload:[],
+    }
+  },
+  mounted(){
+    this.getRequireUnit();
+    this.getLoadPoint();
+    this.getUnloadPoint();
+    this.getCapacity();
+  },
+  methods: {
+    //获取炼钢厂连铸车间
+    getRequireUnit(){
+        this.axios
+        .post('/api/v1/uc/getRequireUnitName?index=炼钢厂连铸车间')
+        .then(res => {
+          if (res.data.code == '200') {
+            this.requireUnitId = res.data.data[0].shipperId
+            this.requireUnitName = res.data.data[0].shipperName
+          }
+        })
+    },
+    //查询装货点
+    getLoadPoint(){
+        this.axios
+        .post('/api/v1/uc/getUnloadingMesByLike?apiId=374&index=连铸车间')
+        .then(res => {
+          if (res.data.code == '200') {
+            this.optionsLoad=res.data.data.list;
+            this.loadPoint=parseInt(this.optionsLoad[0].warehouseId);
+          }
+        })
+    },
+    //查询卸货点
+    getUnloadPoint(){
+        this.axios
+        .post('/api/v1/uc/getUnloadingMesByLike?apiId=374',{
+            warehouseName:['一棒车间','高线车间']
+        })
+        .then(res => {
+          if (res.data.code == '200') {
+            this.optionsUnload=res.data.data.list;
+          }
+        })
+    },
+    //查询车牌号
+    getCapacity(){
+        this.axios
+        .post('/api/v1/uc/getCapacityByLike?index=S')
+        .then(res => {
+          if (res.data.code == '200') {
+            //过滤
+            this.optionsCapacity = res.data.data.filter(function (x) {
+                return x in this.capacityArr;
+            });
+          }
+        })
+    },
+    // 新增
+    makeSure() {
+      let map={
+        requireUnitId:this.requireUnitId,
+        heatNo:this.heatNo,
+        requirementType:"计重",
+        clazz:this.clazz,
+        type:this.type,
+        model:this.model,
+        capacityId:this.capacityId,
+        loadPoint:this.loadPoint,
+        unloadPoint:this.unloadPoint,
+      }
+      console.log("map:",map);
+      if(!map.requireUnitId || !map.heatNo || !map.requirementType || !map.clazz || !map.type || !map.model || !map.loadPoint || !map.unloadPoint || !map.capacityId || map.capacityId.length<=0){
+        this.$message.warning("每项都为必填!");
+        return;
+      }
+      //提交
+      this.axios
+        .post('',map)
+        .then(res => {
+          if (res.data.code == '200') {
+            
+          }
+        })
+    },
+    // 返回
+    cancel() {
+      this.$router.go(-1)
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+.inwardRequirement {
+  .from {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    margin-top: 5px;
+    margin-bottom: 20px;
+  }
+  .drawSty {
+    .el-input {
+      width: 240px;
+    }
+  }
+  .DueTime {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    margin-top: 5px;
+    margin-bottom: 20px;
+    .chooseDueTime {
+      margin-right: 70px;
+    }
+  }
+  .capacity {
+    display: flex;
+    text-align: center;
+    align-items: center;
+    justify-content: center;
+    margin-top: 2rem;
+    margin-bottom: 1.25rem;
+    margin-right: 10px;
+  }
+  .materialDrawer {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    .el-input {
+      width: 320px;
+    }
+    .el-select {
+      width: 320px;
+    }
+    .el-autocomplete {
+      width: 320px;
+    }
+    .el-form {
+      padding: 10px;
+    }
+    .truckBtn {
+      width: 320px;
+    }
+  }
+  .swtichTop {
+    display: flex;
+    height: 40px;
+    align-content: center;
+    justify-content: center;
+    padding-right: 20px;
+    .titile {
+      color: red;
+      font-size: 14px;
+    }
+    .switch {
+      margin-right: -30px;
+    }
+  }
+  .requireUnit {
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    margin-top: 20px;
+    .text {
+      display: inline-block;
+      width: 170px;
+      text-align: right;
+      .input {
+        width: 250px;
+        margin-right: 90px;
+      }
+    }
+  }
+  .form-box {
+    display: flex;
+    text-align: center;
+    align-items: center;
+    justify-content: center;
+    margin-top: 20px;
+    margin-bottom: 20px;
+    margin-left: 10px;
+    ::v-deep .el-form {
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      margin-right: 600px;
+      // margin-left: -20px;
+      background-color: yellow;
+      .preview-group {
+        background-color: blue;
+        ::v-deep .el-form-item {
+          background-color: blue;
+          .el-form-item__label {
+            width: 170px !important;
+            background-color: blue;
+          }
+          ::v-deep .el-form-item__content {
+            background-color: red;
+            width: 300px;
+          }
+          .el-input {
+            width: 210px !important;
+          }
+        }
+      }
+    }
+  }
+  .button-box {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    margin-top: 20px;
+    margin-right: 90px;
+  }
+}
+</style>
+<style>
+.el-drawer__body {
+  overflow: auto;
+}
+.el-drawer__container ::-webkit-scrollbar {
+  display: none;
+}
+</style>

+ 302 - 0
src/views/inward/components/inwardBillet/inwardBillet.vue

@@ -0,0 +1,302 @@
+// 内转钢坯界面,留作备用
+<template>
+  <div class="inwardRequirement">
+    <div class="sache">
+      <el-input placeholder="请输入内容" v-model="inputText" clearable>
+      </el-input>
+      <span>需求时间:</span>
+      <el-date-picker
+        v-model="startTime"
+        type="datetime"
+        placeholder="选择日期"
+        style="width:220px"
+      >
+      </el-date-picker>
+      <span>至</span>
+      <el-date-picker
+        v-model="endTime"
+        type="datetime"
+        placeholder="选择日期"
+        style="width:220px"
+      >
+      </el-date-picker>
+      <el-button type="primary" class="btn" @click="onclick">
+        <i class="el-icon-search"></i>查询
+      </el-button>
+      <el-button
+        type="primary"
+        class="btn"
+        @click="toInsert2"
+        v-if="activeName == 'first'"
+      >
+        <i class="el-icon-plus"></i>新增
+      </el-button>
+    </div>
+    <template>
+      <div>
+        <el-tabs v-model="activeName" @tab-click="handleClick">
+          <el-tab-pane label="未下发" name="first">
+            <mergeRowTable
+              v-bind.sync="first"
+              @selection-change="selectionChange"
+              ref="table"
+            >
+              <el-table-column fixed="right" label="操作" width="80">
+                <template slot-scope="scope">
+                  <el-button
+                    type="text"
+                    size="mini"
+                    @click="deleteRequirement(scope)"
+                  >
+                    删除
+                  </el-button>
+                </template>
+              </el-table-column>
+            </mergeRowTable>
+          </el-tab-pane>
+          <el-tab-pane label="已下发" name="second">
+            <mergeRowTable
+              v-bind.sync="second"
+              ref="table1"
+              :isPagination="false"
+              :pageSize="2000"
+            >
+              <el-table-column fixed="right" label="操作" width="80">
+                <template slot-scope="scope">
+                  <el-button
+                    type="text"
+                    size="mini"
+                    @click="getRequirementOrder(scope)"
+                    >运单</el-button
+                  >
+                </template>
+              </el-table-column>
+            </mergeRowTable>
+          </el-tab-pane>
+        </el-tabs>
+      </div>
+    </template>
+  </div>
+</template>
+<script>
+import { getCookie } from "@/utils/util.js";
+import { sjTime } from "@/utils/sharedJsFile";
+export default {
+  data() {
+    return {
+      inputText: null,
+      orgCode: "",
+      startTime: null,
+      endTime: null,
+      first: {
+        // first请求数据的地址
+        requestUrl: "",
+        selectionType: "select",
+        columnIndexs:[0,1,2,6,7,8,9,22],
+        comparison: "requirementNumber",
+        mapList: []
+      },
+      second: {
+        columnIndexs:[0,1,5,6,7,8,9,21],
+        comparison: "requirementNumber",
+        // second请求数据的地址
+        requestUrl: ""
+      },
+      tableData: [],
+      tableData1: [
+        {
+          materialCount: 100
+        }
+      ],
+      activeName: "first"
+    };
+  },
+  created() {
+    if (
+      getCookie("orgCode") == "dagangadmin" ||
+      getCookie("orgCode") == "zidonghuabu"
+    ) {
+      this.first.requestUrl =
+        "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=0";
+      this.second.requestUrl =
+        "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=1";
+    } else {
+      this.first.requestUrl =
+        "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=0&orgCode=" +
+        getCookie("orgCode");
+      this.second.requestUrl =
+        "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=1&orgCode=" +
+        getCookie("orgCode");
+    }
+  },
+  mounted() {},
+  methods: {
+    onclick() {
+      let orgCode = null;
+      let startTime = null;
+      let endTime = null;
+      if (this.startTime && this.endTime) {
+        startTime = sjTime(this.startTime);
+        endTime = sjTime(this.endTime);
+      }
+      if (
+        getCookie("orgCode") != "dagangadmin" &&
+        getCookie("orgCode") != "zidonghuabu"
+      ) {
+        orgCode = getCookie("orgCode");
+      }
+      if (this.activeName == "first") {
+        this.first.requestUrl =
+          "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=0&orgCode=" +
+          orgCode +
+          "&index=" +
+          this.inputText +
+          "&startTime=" +
+          startTime +
+          "&endTime=" +
+          endTime +
+          "&i=" +
+          new Date();
+      } else {
+        this.second.requestUrl =
+          "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=1&orgCode=" +
+          orgCode +
+          "&index=" +
+          this.inputText +
+          "&startTime=" +
+          startTime +
+          "&endTime=" +
+          endTime +
+          "&i=" +
+          new Date();
+      }
+    },
+    //查看需求下面的运单
+    getRequirementOrder(scope) {
+      this.$router.push("/getRequirementOrder/" + scope.row.requirementId);
+    },
+    handleClick(tab, event) {
+      this.getRequestUrl();
+    },
+    getRequestUrl() {
+      if (
+        getCookie("orgCode") == "dagangadmin" ||
+        getCookie("orgCode") == "zidonghuabu"
+      ) {
+        this.first.requestUrl =
+          "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=0&i=" +
+          new Date();
+        this.second.requestUrl =
+          "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=1&i=" +
+          new Date();
+      } else {
+        this.first.requestUrl =
+          "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=0&orgCode=" +
+          getCookie("orgCode") +
+          "&i=" +
+          new Date();
+        this.second.requestUrl =
+          "/api/v1/ams/getTruckRequirementList?apiId=207&requirementStatus=1&orgCode=" +
+          getCookie("orgCode") +
+          "&i=" +
+          new Date();
+      }
+    },
+    selectionChange(selection) {
+      this.first.mapList = selection;
+    },
+    toInsert2() {
+      this.$router.push("/addInwardBillet");
+    },
+    updateRequirement(scope) {
+      this.$router.push("/updateRequirement/" + scope.row.requirementId);
+    },
+    deleteRequirement(scope) {
+      this.$confirm("是否删除", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+        center: true
+      })
+        .then(() => {
+          this.axios
+            .post(
+              "/api/v1/ams/deleteTruckRequirement/" + scope.row.requirementId
+            )
+            .then(res => {
+              if (res.data.code == 200) {
+                this.$message({
+                  type: "success",
+                  message: "删除成功!"
+                });
+                this.getRequestUrl();
+              } else {
+                this.$message({
+                  message: "删除失败",
+                  type: "warning"
+                });
+              }
+            });
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "删除操作已取消!"
+          });
+        });
+    },
+    Issue() {
+      console.log(this.first.mapList);
+      if (this.first.mapList.length == 0) {
+        this.$message.warning("请选择需求");
+        return;
+      }
+      // 权限控制,判断用户是否属于轧钢厂下面的车间
+      this.$confirm("是否下发", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+        center: true
+      })
+        .then(() => {
+          this.axios
+            .post("/api/v1/ams/downRequirement", this.first.mapList)
+            .then(res => {
+              if (res.data.code == 200) {
+                this.$message({
+                  type: "success",
+                  message: "下发成功!"
+                });
+                this.getRequestUrl();
+                this.activeName = "second";
+              } else {
+                this.$message({
+                  message: "下发失败",
+                  type: "warning"
+                });
+              }
+            });
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "取消下发!"
+          });
+        });
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+.inwardRequirement {
+  margin-top: 20px;
+  margin-left: 20px;
+  .sache {
+    margin-top: 30px;
+    padding-bottom: 10px;
+    .el-input {
+      width: 20%;
+    }
+  }
+}
+</style>