123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639 |
- <template>
- <!-- 添加车皮装车实绩 -->
- <div class="addWagonLoad">
- <page-title>新增</page-title>
-
- <div class="cp">
- <span style="width:80px">车皮号:</span>
- <el-input
- placeholder="请输入内容"
- v-model="input"
- @change="onchang"
- clearable
- >
- </el-input>
- </div>
- <div class="cpList">
- <div class="list">
- <span class="cpList1" v-for="(item, i) in list" :key="i">
- {{ item }}
- <i class="el-icon-close itu" @click="onclick(i)"></i>
- </span>
- </div>
- </div>
- <div class="material from">
- <span class="text">物资:</span>
- <el-input v-model="materialName" disabled> </el-input>
- <el-button type="primary" @click="ondrawer(1)">浏览</el-button>
- </div>
- <div class="forwardingUnit from">
- <span class="text">发货单位:</span>
- <el-input v-model="supplierName" disabled> </el-input>
- <el-button type="primary" @click="ondrawer(2)">浏览</el-button>
- </div>
- <div class="remark from">
- <span class="text">船名:</span>
- <el-input class="el-input" v-model="remark" @blur="onBlur"> </el-input>
- <span class="span"></span>
- </div>
- <div class="forwardingUnit from">
- <span class="text">卸货点:</span>
- <el-input v-model="unloadPointName" disabled> </el-input>
- <el-button type="primary" @click="ondrawer(4)">浏览</el-button>
- </div>
- <div class="fromOther">
- <el-form :inline="true" class="demo-form-inline" label-width="80px" style="margin-left:550px;">
- <el-form-item label="发站:">
- <el-autocomplete
- class="inline-input"
- v-model="sendStation"
- :fetch-suggestions="querySearchSendStation"
- placeholder="请输入发站名称"
- :trigger-on-focus="false"
- @select="handleSelectSendStation"
- >
- <template slot-scope="{ item }">
- <div class="name">{{ item.arrivalName }}</div>
- </template>
- </el-autocomplete>
- </el-form-item>
- </el-form>
- <el-form :inline="true" class="demo-form-inline" label-width="80px" style="margin-left:550px;">
- <el-form-item label="到站:">
- <el-autocomplete
- class="inline-input"
- v-model="toTheStation"
- :fetch-suggestions="querySearchToTheStation"
- placeholder="请输入到站名称"
- :trigger-on-focus="false"
- @select="handleSelectToTheStation"
- >
- <template slot-scope="{ item }">
- <div class="name">{{ item.arrivalName }}</div>
- </template>
- </el-autocomplete>
- </el-form-item>
- </el-form>
- </div>
- <div class="form">
- <div class="form_box" style="margin-right: 10rem">
- <dil-form :formId="254" v-model="form1" ref="from1"></dil-form>
- </div>
- </div>
- <div class="button-box">
- <el-button @click="cancel">取消</el-button>
- <el-button type="primary" @click="makeSure">确定</el-button>
- </div>
- <!-- 模态窗口 -->
- <el-drawer :visible.sync="drawer" :direction="direction" size="30%">
- <el-input
- placeholder="请输入内容"
- v-model="inputText"
- style="margin-top: 0.625rem; margin-left: 1.25rem;width:250px"
- clearable
- ></el-input>
- <el-button
- type="primary"
- class="btn"
- @click="onClick(a)"
- style="margin-bottom: 0.9375rem"
- >
- <i class="el-icon-search"></i>查询
- </el-button>
- <div v-show="a == 1">
- <dilTable
- v-bind.sync="frist"
- @radio-change="currentRadioChange1"
- ></dilTable>
- </div>
- <div v-show="a == 2">
- <dilTable
- v-bind.sync="secend"
- @radio-change="currentRadioChange2"
- ></dilTable>
- </div>
- <div v-show="a == 4">
- <dilTable
- v-bind.sync="unloadPoint"
- @radio-change="currentRadioChange4"
- ></dilTable>
- </div>
- </el-drawer>
- </div>
- </template>
- <script>
- import PageTitle from "@/components/Page/Title";
- import { sjTime,isNumber } from "@/utils/sharedJsFile";
- export default {
- components: { PageTitle },
- data() {
- return {
- list: [],
- form1: {},
- input: "",
- value: undefined,
- //船名
- remark: null,
- //采购订单id
- purchaseOrderId: null,
- //物资名称
- materialName: null,
- //发货单位名称
- supplierName: null,
- //发货单位id
- supplierId: null,
- //物资id
- materialId: null,
- //是否需要打开模态窗口
- drawer: false,
- //卸货点id
- unloadPointId: null,
- //卸货点名称
- unloadPointName: null,
- a: 1,
- direction: "rtl",
- inputText: "",
- frist: {
- requestUrl: "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050",
- selectionType: "radio",
- mapList1: [],
- },
- secend: {
- requestUrl:
- "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=",
- selectionType: "radio",
- mapList2: [],
- },
- unloadPoint: {
- requestUrl: "/api/v1/uc/getUnloadingMesByLike?apiId=374",
- selectionType: "radio",
- },
- sendStationId:null,
- toTheStationId:1,
- sendStation:null,
- toTheStation:"老区轨道衡"
- };
- },
- created(){
- this.form1 = {
- arrivalStationId:1,
- }
- },
- methods: {
- currentRadioChange1(selection) {
- this.input = null;
- this.materialName = selection.materialName;
- this.materialId = selection.materialId;
- this.getPurchaseOrderNo();
- },
- currentRadioChange2(selection) {
- this.supplierName = selection.supplierName;
- this.supplierId = selection.supplierId;
- this.getPurchaseOrderNo();
- },
- currentRadioChange4(selection) {
- this.unloadPointId = selection.warehouseId;
- this.unloadPointName = selection.warehouseName;
- },
- ondrawer(num) {
- this.drawer = true;
- this.a = num;
- if (num == 2) {
- this.secend.requestUrl =
- "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=" +
- this.materialId;
- }
- },
- onBlur() {
- this.getPurchaseOrderNo();
- },
- getPurchaseOrderNo() {
- let map = {
- materialId: this.materialId,
- supplierId: this.supplierId,
- };
- if (this.remark) {
- map.remark = this.remark;
- }
- console.log(this.map);
- if (this.materialId && this.supplierId) {
- this.axios.post("/api/v1/oms/selectNewOrderId", map).then((res) => {
- console.log(res);
- if (res.data.code == "200") {
- if (res.data.data == null) {
- this.$message({
- message: "没有匹配的采购订单号!",
- type: "warning",
- });
- this.form1 = [];
- } else {
- this.remark = res.data.data.remark;
- this.purchaseOrderId = res.data.data.purchaseOrderId;
- this.form1 = { purchaseOrderNo: res.data.data.purchaseOrderNo };
- }
- } else {
- this.$message.error("请求失败");
- }
- });
- }
- },
- onClick(a) {
- if (a == 1) {
- this.frist.requestUrl =
- "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050&index=" +
- this.inputText;
- } else if (a == 2) {
- this.secend.requestUrl =
- "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=" +
- this.materialId +
- "&index=" +
- this.inputText;
- } else if (a == 4) {
- this.unloadPoint.requestUrl =
- "/api/v1/uc/getUnloadingMesByLike?apiId=374&index=" + this.inputText;
- }
- },
- onchang() {
- var state = false;
- var cptop = this.input.substring(0, 2);
- var cptop1 = this.input.substring(0, 3);
- if (
- cptop == "45" ||
- cptop == "46" ||
- cptop == "42" ||
- cptop == "47" ||
- cptop == "15" ||
- cptop == "16" ||
- cptop == "17" ||
- cptop == "18"
- ) {
- state = true;
- } else if (
- cptop1 == "140" ||
- cptop1 == "141" ||
- cptop1 == "142" ||
- cptop1 == "143" ||
- cptop1 == "145"
- ) {
- state = true;
- } else {
- this.$message({
- type: "warning",
- message: "车皮号格式不对,请重新输入!",
- });
- }
- if (state) {
- if (this.input.length == 7) {
- this.list.push(this.input);
- this.input = "";
- } else {
- this.$message({
- type: "warning",
- message: "车皮号长度不足7位数,请重新输入!",
- });
- }
- }
- },
- onclick(index) {
- this.list.splice(index, 1);
- },
- //发站弹出层
- handleSelectSendStation(item) {
- this.sendStationId = item.arrivalId;
- this.sendStation = item.arrivalName;
- },
- //以下是发站边输边查搜索
- querySearchSendStation(queryString, cb) {
- this.axios
- .get("/api/v1/uc/getArrivalByLike?index=" + this.sendStation)
- .then((res) => {
- if (res.data.code == "200") {
- var restaurantsSupplier = res.data.data;
- console.log(restaurantsSupplier)
- var results = queryString
- ? restaurantsSupplier.filter(
- this.createFilterSendStation(queryString)
- )
- : restaurantsSupplier;
- // 调用 callback 返回建议列表的数据
- cb(results);
- }
- });
- },
- //发站
- createFilterSendStation(queryString) {
- return (restaurantsSupplier) => {
- return (
- restaurantsSupplier.arrivalName
- .toLowerCase()
- .indexOf(queryString.toLowerCase()) > -1
- );
- };
- },
- //到站弹出层
- handleSelectToTheStation(item) {
- this.toTheStationId = item.arrivalId;
- this.toTheStation = item.arrivalName;
- },
- //以下是到站边输边查搜索
- querySearchToTheStation(queryString, cb) {
- this.axios
- .get("/api/v1/uc/getArrivalByLike?index=" + this.toTheStation)
- .then((res) => {
- if (res.data.code == "200") {
- var restaurantsSupplier = res.data.data;
- console.log(restaurantsSupplier)
- var results = queryString
- ? restaurantsSupplier.filter(
- this.createFilterToTheStation(queryString)
- )
- : restaurantsSupplier;
- // 调用 callback 返回建议列表的数据
- cb(results);
- }
- });
- },
- //到站
- createFilterToTheStation(queryString) {
- return (restaurantsSupplier) => {
- return (
- restaurantsSupplier.arrivalName
- .toLowerCase()
- .indexOf(queryString.toLowerCase()) > -1
- );
- };
- },
- // 确定
- makeSure() {
- let state = 0;
- if (
- this.list.length > 0 &&
- this.materialId &&
- this.supplierId &&
- this.unloadPointId &&
- this.purchaseOrderId &&
- this.sendStationId &&
- this.toTheStationId &&
- this.form1.resultLoadingDate
- ) {
- state = 1;
- } else {
- console.log(this.list.length);
- if (this.list.length == 0) {
- this.$message({
- type: "warning",
- message: "请输入车皮号!",
- });
- } else {
- if (this.materialId) {
- if (this.supplierId) {
- if (this.unloadPointId) {
- if (this.purchaseOrderId) {
- if (this.sendStationId) {
- if (this.toTheStationId) {
- if (this.form1.resultLoadingDate) {
- } else {
- this.$message({
- type: "warning",
- message: "请选择装车时间!",
- });
- }
- } else {
- this.$message({
- type: "warning",
- message: "请选择到站!",
- });
- }
- } else {
- this.$message({
- type: "warning",
- message: "请选择发站!",
- });
- }
- } else {
- this.$message({
- type: "warning",
- message: "该物资没有采购订单号!",
- });
- }
- } else {
- this.$message({
- type: "warning",
- message: "请选择卸货地点!",
- });
- }
- } else {
- this.$message({
- type: "warning",
- message: "请选择发货单位!",
- });
- }
- } else {
- this.$message({
- type: "warning",
- message: "请选择物资!",
- });
- }
- }
- }
- if(state == 1){
- let map = {
- wagonNoList:this.list,
- unloadingPointId:this.unloadPointId,
- purchaseOrderRailPlanId:this.purchaseOrderId,
- materialId:this.materialId,
- sendUnitId:this.supplierId,
- resultIsclear:this.form1.resultIsclear,
- resultClass: this.form1.resultClass,
- sendStationId: this.sendStationId,
- arrivalStationId: this.toTheStationId,
- resultLoadingDate: sjTime(this.form1.resultLoadingDate),
- resultRemarks: this.form1.resultRemarks,
- resultType:2,
- }
- this.axios.post('/api/v1/tms/insertTmstrainLoadingResult',map).then((res)=>{
- console.log(res);
- if(res.data.code == "200"){
- this.$message({
- type: "success",
- message: "新增成功",
- });
- this.$router.go(-1);
- }
- })
- }
- },
- // 取消
- cancel() {
- this.$router.go(-1);
- },
- },
- };
- </script>
- <style lang='scss'>
- .addWagonLoad {
- color: #606266;
- font-size: 0.675rem;
- font-weight: 500;
- .cp {
- width: 49%;
- display: flex;
- justify-content: center;
- align-items: center;
- padding-top: 0.625rem;
- padding-bottom: 0.625rem;
- margin-left: 364px;
- .cp_title {
- .cp_top {
- width: 3.125rem;
- padding-right: 1.55rem;
- }
- }
- }
- .cpList {
- display: flex;
- justify-content: center;
- width: 100%;
- height: 10rem;
- .list {
- width: 45%;
- border: #000 0.0625rem solid;
- padding: 0.625rem;
- display: flex;
- flex-wrap: wrap;
- .cpList1 {
- background-color: #c9c7c7;
- height: 1.875rem;
- margin-right: 0.5rem;
- padding: 0.625rem;
- display: flex;
- align-items: center;
- justify-content: center;
- position: relative;
- .itu {
- position: absolute;
- top: -0.125rem;
- right: 0.0625rem;
- width: 0.625rem;
- height: 0.625rem;
- }
- }
- }
- }
- .matching {
- width: 100%;
- height: 3.125rem;
- display: flex;
- justify-content: center;
- align-items: center;
- .text {
- width: 8.75rem;
- }
- .span {
- display: inline-block;
- width: 310px;
- height: 0.0625rem;
- }
- }
- .material {
- display: flex;
- justify-content: center;
- align-items: center;
- height: 3.75rem;
- margin-left: 27rem;
- width: 20rem;
- .text {
- text-align: right;
- width: 8.125rem;
- }
- }
- .forwardingUnit {
- display: flex;
- justify-content: center;
- align-items: center;
- height: 3.75rem;
- margin-left: 27rem;
- width: 20rem;
- .text {
- text-align: right;
- width: 8.125rem;
- }
- }
- .remark {
- display: flex;
- justify-content: center;
- align-items: center;
- height: 3.75rem;
- .text {
- text-align: right;
- width: 5.625rem;
- }
- .span {
- display: inline-block;
- width: 1.875rem;
- height: 1.25rem;
- }
- .el-input{
- width: 13.5rem;
- margin-right: 2.375rem;
- }
- }
- .purchaseOrder {
- display: flex;
- justify-content: center;
- align-items: center;
- .span {
- display: inline-block;
- width: 1.875rem;
- height: 0.0625rem;
- }
- }
- .form {
- display: flex;
- .form_box {
- width: 340px;
- margin-left: 37%;
-
- margin-right: 20px;
- .el-form {
- .preview-group {
- .el-form-item {
- .el-form-item__label {
- display: inline-block;
- width: 70px !important;
- }
- .el-form-item__content {
- .el-select {
- width: 250px;
- }
- .el-input {
- width: 250px;
- }
- .el-textarea{
- .el-textarea__inner{
- width: 220px;
-
- margin-top: 0.03rem;
- }
- }
- }
- }
- }
- }
- }
- }
- .button-box {
- display: flex;
- justify-content: center;
- padding-top: 30px;
- }
- .fromOther .el-input__inner{
- width: 250px;
- }
- }
- </style>
|