|
@@ -1,348 +1,459 @@
|
|
-// 新增采购内转需求
|
|
|
|
<template>
|
|
<template>
|
|
- <div class="addInwardRequirement">
|
|
|
|
- <page-title>新增需求</page-title>
|
|
|
|
- <div class="form-box f2">
|
|
|
|
- <el-form
|
|
|
|
- :inline="true"
|
|
|
|
- class="demo-form-inline"
|
|
|
|
- :label-position="left"
|
|
|
|
- label-width="80px"
|
|
|
|
- >
|
|
|
|
- <el-form-item label="采购订单号">
|
|
|
|
- <el-input v-model="purchaseOrder" placeholder="必填" disabled>
|
|
|
|
- </el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item>
|
|
|
|
- <el-button type="primary" @click="ondrawer(1)">浏览</el-button>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
- <el-form
|
|
|
|
- :inline="true"
|
|
|
|
- class="demo-form-inline"
|
|
|
|
- :label-position="left"
|
|
|
|
- label-width="80px"
|
|
|
|
- >
|
|
|
|
- <el-form-item label="外轮船名" class="tx">
|
|
|
|
- <el-input v-model="foreignShipName" disabled></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
- <el-form
|
|
|
|
- :inline="true"
|
|
|
|
- class="demo-form-inline"
|
|
|
|
- :label-position="left"
|
|
|
|
- label-width="80px"
|
|
|
|
- >
|
|
|
|
- <el-form-item label="发货单位" class="tx">
|
|
|
|
- <el-input v-model="supplierName" disabled></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
- <el-form
|
|
|
|
- :inline="true"
|
|
|
|
- class="demo-form-inline"
|
|
|
|
- :label-position="left"
|
|
|
|
- label-width="80px"
|
|
|
|
- >
|
|
|
|
- <el-form-item label="收货单位" class="tx">
|
|
|
|
- <el-input v-model="shipperName" disabled></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
- <el-form
|
|
|
|
- :inline="true"
|
|
|
|
- class="demo-form-inline"
|
|
|
|
- :label-position="left"
|
|
|
|
- label-width="80px"
|
|
|
|
- >
|
|
|
|
- <el-form-item label="物资名称" class="tx">
|
|
|
|
- <el-input v-model="materialName" disabled></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
- <el-form
|
|
|
|
- :inline="true"
|
|
|
|
- class="demo-form-inline"
|
|
|
|
- :label-position="left"
|
|
|
|
- label-width="80px"
|
|
|
|
- >
|
|
|
|
- <el-form-item label="装车点">
|
|
|
|
- <el-input v-model="truckPoint" placeholder="必填" disabled>
|
|
|
|
- </el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item>
|
|
|
|
- <el-button type="primary" @click="ondrawer(2)">浏览</el-button>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
- <el-form
|
|
|
|
|
|
+ <!-- 新增运输作业页面 -->
|
|
|
|
+ <div class="addPurRequirement">
|
|
|
|
+ <page-title>运输预约</page-title>
|
|
|
|
+ <div class="material from">
|
|
|
|
+ <span class="text">物资:</span>
|
|
|
|
+ <el-input class="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 class="input" v-model="supplierName" disabled> </el-input>
|
|
|
|
+ <el-button type="primary" @click="ondrawer(2)">浏览</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="forwardingUnit from">
|
|
|
|
+ <span class="text">卸货点:</span>
|
|
|
|
+ <el-input class="input" v-model="unloadPointName" disabled> </el-input>
|
|
|
|
+ <el-button type="primary" @click="ondrawer(4)">浏览</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="forwardingUnit from">
|
|
|
|
+ <el-form
|
|
:inline="true"
|
|
:inline="true"
|
|
class="demo-form-inline"
|
|
class="demo-form-inline"
|
|
- :label-position="left"
|
|
|
|
label-width="80px"
|
|
label-width="80px"
|
|
>
|
|
>
|
|
- <el-form-item label="卸车点">
|
|
|
|
- <el-input v-model="truckPoint1" placeholder="必填" disabled>
|
|
|
|
- </el-input>
|
|
|
|
|
|
+ <el-form-item label="选择承运商">
|
|
|
|
+ <el-autocomplete
|
|
|
|
+ class="inline-input"
|
|
|
|
+ v-model="stateCarrier"
|
|
|
|
+ :fetch-suggestions="querySearchCarrier"
|
|
|
|
+ placeholder="请输入承运商名称"
|
|
|
|
+ :trigger-on-focus="false"
|
|
|
|
+ @select="handleSelectCarrier"
|
|
|
|
+ >
|
|
|
|
+ <template slot-scope="{ item }">
|
|
|
|
+ <div class="name">{{ item.carrierName }}</div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-autocomplete>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item>
|
|
|
|
- <el-button type="primary" @click="ondrawer(3)">浏览</el-button>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
|
|
+ </el-form>
|
|
</div>
|
|
</div>
|
|
- <el-drawer
|
|
|
|
- :visible.sync="drawer"
|
|
|
|
- :direction="direction"
|
|
|
|
- :before-close="handleClose"
|
|
|
|
- size="30%"
|
|
|
|
- >
|
|
|
|
- <el-input
|
|
|
|
- placeholder="请输入内容"
|
|
|
|
- v-model="input"
|
|
|
|
- style="margin-top: 10px ;width:50%"
|
|
|
|
- clearable
|
|
|
|
- >
|
|
|
|
- </el-input>
|
|
|
|
- <el-button
|
|
|
|
- type="primary"
|
|
|
|
- class="btn"
|
|
|
|
- @click="onclick(a)"
|
|
|
|
- style="margin-bottom: 15px"
|
|
|
|
- >
|
|
|
|
- <i class="el-icon-search"></i>查询
|
|
|
|
- </el-button>
|
|
|
|
|
|
+ <div class="contractTitle from">
|
|
|
|
+ <dil-form :formId="219" v-model="form1"></dil-form>
|
|
|
|
+ </div>
|
|
|
|
+ <!-- 模态窗口 -->
|
|
|
|
+ <el-drawer :visible.sync="drawer" :direction="direction" size="40%">
|
|
|
|
+ <div style="margin-bottom: 10px">
|
|
|
|
+ <el-input
|
|
|
|
+ placeholder="请输入内容"
|
|
|
|
+ v-model="input"
|
|
|
|
+ style="margin-top: 10px; margin-right: 10px; width: 250px"
|
|
|
|
+ clearable
|
|
|
|
+ ></el-input>
|
|
|
|
+ <el-button type="primary" class="btn" @click="onclick(a)">
|
|
|
|
+ <i class="el-icon-search"></i>查询
|
|
|
|
+ </el-button>
|
|
|
|
+ </div>
|
|
<div v-show="a == 1">
|
|
<div v-show="a == 1">
|
|
<dilTable
|
|
<dilTable
|
|
- v-bind.sync="second"
|
|
|
|
|
|
+ v-bind.sync="frist"
|
|
@radio-change="currentRadioChange1"
|
|
@radio-change="currentRadioChange1"
|
|
></dilTable>
|
|
></dilTable>
|
|
</div>
|
|
</div>
|
|
<div v-show="a == 2">
|
|
<div v-show="a == 2">
|
|
<dilTable
|
|
<dilTable
|
|
- v-bind.sync="second1"
|
|
|
|
|
|
+ v-bind.sync="secend"
|
|
@radio-change="currentRadioChange2"
|
|
@radio-change="currentRadioChange2"
|
|
></dilTable>
|
|
></dilTable>
|
|
</div>
|
|
</div>
|
|
<div v-show="a == 3">
|
|
<div v-show="a == 3">
|
|
<dilTable
|
|
<dilTable
|
|
- v-bind.sync="second2"
|
|
|
|
- @radio-change="currentRadioChange3"
|
|
|
|
|
|
+ v-bind.sync="third"
|
|
|
|
+ @selection-change="currentRadioChange3"
|
|
></dilTable>
|
|
></dilTable>
|
|
</div>
|
|
</div>
|
|
<div v-show="a == 4">
|
|
<div v-show="a == 4">
|
|
<dilTable
|
|
<dilTable
|
|
- v-bind.sync="second3"
|
|
|
|
|
|
+ v-bind.sync="unloadPoint"
|
|
@radio-change="currentRadioChange4"
|
|
@radio-change="currentRadioChange4"
|
|
></dilTable>
|
|
></dilTable>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div v-show="a == 5">
|
|
|
|
+ <dilTable
|
|
|
|
+ v-bind.sync="line"
|
|
|
|
+ @radio-change="currentRadioChange5"
|
|
|
|
+ ></dilTable>
|
|
|
|
+ </div>
|
|
</el-drawer>
|
|
</el-drawer>
|
|
- <div class="box-form">
|
|
|
|
- <dil-form :formId="300" v-model="form"></dil-form>
|
|
|
|
- </div>
|
|
|
|
- <div class="button-box">
|
|
|
|
- <el-button type="primary" @click="makeSure">确认新增</el-button>
|
|
|
|
- <el-button type="primary" @click="cancel">返回</el-button>
|
|
|
|
|
|
+ <div class="button_box">
|
|
|
|
+ <el-button @click="onClickCancel">返回</el-button>
|
|
|
|
+ <el-button type="primary" @click="onClickConfirm" :disabled = "disabled">确认</el-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
-
|
|
|
|
<script>
|
|
<script>
|
|
import PageTitle from "@/components/Page/Title";
|
|
import PageTitle from "@/components/Page/Title";
|
|
-import { sjTime } from "@/utils/sharedJsFile";
|
|
|
|
|
|
+import { sjTime, isNumber, isIntegerNumber } from "@/utils/sharedJsFile";
|
|
|
|
+import { getCookie } from "@/utils/util.js";
|
|
export default {
|
|
export default {
|
|
components: { PageTitle },
|
|
components: { PageTitle },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- purchaseOrder: null,
|
|
|
|
- foreignShipName: null,
|
|
|
|
- materialName: null,
|
|
|
|
- shipperName: null,
|
|
|
|
- supplierName: null,
|
|
|
|
|
|
+ disabled:false,
|
|
|
|
+ //船名
|
|
|
|
+ remark: null,
|
|
|
|
+ //车辆表格数据
|
|
|
|
+ selectionList: [],
|
|
|
|
+ stateCarrier:null,
|
|
|
|
+
|
|
|
|
+ // 表单
|
|
|
|
+ form1: {},
|
|
|
|
+ //采购订单id
|
|
|
|
+ purchaseOrderId: "",
|
|
|
|
+ //物资名称
|
|
|
|
+ materialName: "",
|
|
|
|
+ //发货单位名称
|
|
|
|
+ supplierName: "",
|
|
|
|
+ //发货单位id
|
|
|
|
+ supplierId: null,
|
|
|
|
+ carrierId:null,
|
|
|
|
+ //物资id
|
|
|
|
+ materialId: null,
|
|
|
|
+ //是否需要打开模态窗口
|
|
|
|
+ drawer: false,
|
|
|
|
+ //卸货点id
|
|
|
|
+ unloadPointId: "",
|
|
|
|
+ //卸货点名称
|
|
|
|
+ unloadPointName: "",
|
|
a: 1,
|
|
a: 1,
|
|
direction: "rtl",
|
|
direction: "rtl",
|
|
input: "",
|
|
input: "",
|
|
- truckPoint: null,
|
|
|
|
- truckPoint1: null,
|
|
|
|
- drawer: false,
|
|
|
|
- form: {},
|
|
|
|
- second: {
|
|
|
|
- requestUrl: "/api/v1/ams/getPurchaseIdByBatch?apiId=252",
|
|
|
|
|
|
+ frist: {
|
|
|
|
+ requestUrl: "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050",
|
|
selectionType: "radio",
|
|
selectionType: "radio",
|
|
- mapList1: []
|
|
|
|
|
|
+ mapList1: [],
|
|
},
|
|
},
|
|
- second1: {
|
|
|
|
- requestUrl: "/api/v1/ams/getWareHouse?apiId=251",
|
|
|
|
|
|
+ secend: {
|
|
|
|
+ requestUrl:
|
|
|
|
+ "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=",
|
|
selectionType: "radio",
|
|
selectionType: "radio",
|
|
- mapList2: []
|
|
|
|
|
|
+ mapList2: [],
|
|
},
|
|
},
|
|
- second2: {
|
|
|
|
- requestUrl: "/api/v1/ams/getWareHouse?apiId=251",
|
|
|
|
- selectionType: "radio",
|
|
|
|
- mapList3: []
|
|
|
|
|
|
+ third: {
|
|
|
|
+ requestUrl: "",
|
|
|
|
+ selectionType: "select",
|
|
|
|
+ mapList3: [],
|
|
},
|
|
},
|
|
- second3: {
|
|
|
|
- requestUrl: "/api/v1/ams/getWareHouse?apiId=251",
|
|
|
|
|
|
+ unloadPoint: {
|
|
|
|
+ requestUrl: "/api/v1/uc/getUnloadingMesByLike?apiId=374",
|
|
selectionType: "radio",
|
|
selectionType: "radio",
|
|
- mapList4: []
|
|
|
|
- }
|
|
|
|
|
|
+ },
|
|
};
|
|
};
|
|
|
|
+ },
|
|
|
|
+ watch: {
|
|
|
|
+ drawer(val) {
|
|
|
|
+ if (!val) {
|
|
|
|
+ this.input = null;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ created() {
|
|
|
|
+
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ onClick(index) {
|
|
|
|
+ this.selectionList.splice(index, 1);
|
|
|
|
+ },
|
|
|
|
+ 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 {
|
|
|
|
+ console.log();
|
|
|
|
+ this.remark = res.data.data.remark;
|
|
|
|
+ this.purchaseOrderId = res.data.data.purchaseOrderId;
|
|
|
|
+ this.form1 = { purchaseOrderNo: res.data.data.purchaseOrderNo };
|
|
|
|
+ if (res.data.data.receiveUnitId == 1) {
|
|
|
|
+ this.orderType = 6;
|
|
|
|
+ } else {
|
|
|
|
+ this.orderType = 7;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error("请求失败");
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ onclick(a) {
|
|
|
|
+ if (a == 1) {
|
|
|
|
+ this.frist.requestUrl =
|
|
|
|
+ "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050&index=" +
|
|
|
|
+ this.input;
|
|
|
|
+ } else if (a == 2) {
|
|
|
|
+ this.secend.requestUrl =
|
|
|
|
+ "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=" +
|
|
|
|
+ this.materialId +
|
|
|
|
+ "&index=" +
|
|
|
|
+ this.input;
|
|
|
|
+ } else if (a == 4) {
|
|
|
|
+ this.unloadPoint.requestUrl =
|
|
|
|
+ "/api/v1/uc/getUnloadingMesByLike?apiId=347&index=" + this.input;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
ondrawer(num) {
|
|
ondrawer(num) {
|
|
this.drawer = true;
|
|
this.drawer = true;
|
|
this.a = num;
|
|
this.a = num;
|
|
|
|
+ if (num == 2) {
|
|
|
|
+ this.secend.requestUrl =
|
|
|
|
+ "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=" +
|
|
|
|
+ this.materialId;
|
|
|
|
+ }
|
|
},
|
|
},
|
|
- handleClose(done) {
|
|
|
|
- done();
|
|
|
|
|
|
+ //承运商弹出层
|
|
|
|
+ handleSelectCarrier(item){
|
|
|
|
+ this.carrierId = item.carrierId
|
|
|
|
+ item.carrierName = this.stateCarrier
|
|
},
|
|
},
|
|
- onclick(a) {
|
|
|
|
- if (a == 1) {
|
|
|
|
- console.log(a);
|
|
|
|
- this.second.requestUrl =
|
|
|
|
- "/api/v1/ams/getPurchaseIdByBatch?apiId=252&con=" + this.input;
|
|
|
|
- } else {
|
|
|
|
- if (this.input == "") {
|
|
|
|
- this.second1.requestUrl = "/api/v1/ams/getWareHouse?apiId=251";
|
|
|
|
- } else {
|
|
|
|
- this.second1.requestUrl =
|
|
|
|
- "/api/v1/ams/getWareHouse?apiId=251&con=" + this.input;
|
|
|
|
|
|
+ //以下是承运商边输边查搜索
|
|
|
|
+ querySearchCarrier(queryString, cb) {
|
|
|
|
+ this.axios.post('/api/v1/uc/getCarrierMesByLike?index='+queryString).then((res)=>{
|
|
|
|
+ if(res.data.code == "200"){
|
|
|
|
+ var restaurantsCarrier = res.data.data
|
|
|
|
+ console.log(restaurantsCarrier,"restaurantsCarrier");
|
|
|
|
+ var results = queryString ? restaurantsCarrier.filter(this.createFilterCarrier(queryString)) :restaurantsCarrier;
|
|
|
|
+ // 调用 callback 返回建议列表的数据
|
|
|
|
+ cb(results);
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ createFilterCarrier(queryString) {
|
|
|
|
+ return (restaurantsCarrier) => {
|
|
|
|
+ return (restaurantsCarrier.value.toLowerCase().indexOf(queryString.toLowerCase()) > -1);
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ //以上是承运商边输边查搜索
|
|
|
|
+ // 返回
|
|
|
|
+ onClickCancel() {
|
|
|
|
+ this.$router.push("/purInwardRequirement");
|
|
},
|
|
},
|
|
currentRadioChange1(selection) {
|
|
currentRadioChange1(selection) {
|
|
- this.mapList1 = selection;
|
|
|
|
- this.purchaseOrder = this.mapList1.purchaseOrderNo;
|
|
|
|
- this.foreignShipName = this.mapList1.resultForeignShipName;
|
|
|
|
- this.supplierName = this.mapList1.supplierName;
|
|
|
|
- this.shipperName = this.mapList1.shipperName;
|
|
|
|
- this.materialName = this.mapList1.materialName;
|
|
|
|
|
|
+ this.materialName = selection.materialName;
|
|
|
|
+ this.materialId = selection.materialId;
|
|
|
|
+ this.getPurchaseOrderNo();
|
|
},
|
|
},
|
|
currentRadioChange2(selection) {
|
|
currentRadioChange2(selection) {
|
|
- this.mapList2 = selection;
|
|
|
|
- console.log(this.mapList2);
|
|
|
|
- if (this.mapList2.companyBranchName == null) {
|
|
|
|
- this.mapList2.companyBranchName = "";
|
|
|
|
- }
|
|
|
|
- if (this.mapList2.branchFactory == null) {
|
|
|
|
- this.mapList2.branchFactory = "";
|
|
|
|
- }
|
|
|
|
- if (this.mapList2.wareHouseName == null) {
|
|
|
|
- this.mapList2.wareHouseName = "";
|
|
|
|
- }
|
|
|
|
- this.truckPoint =
|
|
|
|
- this.mapList2.companyBranchName +
|
|
|
|
- this.mapList2.branchFactory +
|
|
|
|
- this.mapList2.wareHouseName;
|
|
|
|
|
|
+ this.supplierName = selection.supplierName;
|
|
|
|
+ this.supplierId = selection.supplierId;
|
|
|
|
+ this.getPurchaseOrderNo();
|
|
|
|
+ },
|
|
|
|
+ currentRadioChange4(selection) {
|
|
|
|
+ this.unloadPointId = selection.warehouseId;
|
|
|
|
+ this.unloadPointName = selection.warehouseName;
|
|
},
|
|
},
|
|
currentRadioChange3(selection) {
|
|
currentRadioChange3(selection) {
|
|
- this.mapList3 = selection;
|
|
|
|
- console.log(selection);
|
|
|
|
- if (this.mapList3.companyBranchName == null) {
|
|
|
|
- this.mapList3.companyBranchName = "";
|
|
|
|
- }
|
|
|
|
- if (this.mapList3.branchFactory == null) {
|
|
|
|
- this.mapList3.branchFactory = "";
|
|
|
|
- }
|
|
|
|
- if (this.mapList3.wareHouseName == null) {
|
|
|
|
- this.mapList3.wareHouseName = "";
|
|
|
|
- }
|
|
|
|
- this.truckPoint1 =
|
|
|
|
- this.mapList3.companyBranchName +
|
|
|
|
- this.mapList3.branchFactory +
|
|
|
|
- this.mapList3.wareHouseName;
|
|
|
|
|
|
+ this.selectionList = [];
|
|
|
|
+ this.selectionList = selection;
|
|
},
|
|
},
|
|
- // 新增
|
|
|
|
- makeSure() {
|
|
|
|
- if (this.purchaseOrder == null) {
|
|
|
|
- this.$alert("没有选择采购订单,请点击浏览选择采购订单!");
|
|
|
|
- return;
|
|
|
|
- } else if (this.truckPoint == null) {
|
|
|
|
- this.$alert("没有选择装车点,请点击浏览选择装车点!");
|
|
|
|
- return;
|
|
|
|
- } else if (this.truckPoint1 == null) {
|
|
|
|
- this.$alert("没有选择卸货点,请点击浏览选择卸货点!");
|
|
|
|
- return;
|
|
|
|
- } else if (typeof this.form.materialWeight == "undefined") {
|
|
|
|
- this.$alert("没有输入物资重量,请输入!");
|
|
|
|
- return;
|
|
|
|
- } else if (typeof this.form.requirementType == "undefined") {
|
|
|
|
- this.$alert("没有选择需求类型,请选择!");
|
|
|
|
- return;
|
|
|
|
- } else if (typeof this.form.requirementTruckTime == "undefined") {
|
|
|
|
- this.$alert("没有选择用车时间,请选择!");
|
|
|
|
- return;
|
|
|
|
- } else if (typeof this.form.requirementShipperId == "undefined") {
|
|
|
|
- this.$alert("没有选择用车单位,请选择!");
|
|
|
|
- return;
|
|
|
|
- } else if (typeof this.form.requirementWorkType == "undefined") {
|
|
|
|
- this.$alert("没有选择费用类别,请选择!");
|
|
|
|
- return;
|
|
|
|
- } else if (typeof this.form.requirementEstimatedDuration == "undefined") {
|
|
|
|
- this.$alert("没有输入预计作业时长,请输入!");
|
|
|
|
- return;
|
|
|
|
|
|
+ // 确认
|
|
|
|
+ onClickConfirm() {
|
|
|
|
+ this.disabled = true
|
|
|
|
+ var state = 0;
|
|
|
|
+ if (
|
|
|
|
+ this.materialId &&
|
|
|
|
+ this.supplierId &&
|
|
|
|
+ this.purchaseOrderId &&
|
|
|
|
+ this.unloadPointId
|
|
|
|
+ ) {
|
|
|
|
+ state = 1;
|
|
|
|
+ } else {
|
|
|
|
+ if (!this.materialId) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "请选择物资!",
|
|
|
|
+ type: "warning",
|
|
|
|
+ });
|
|
|
|
+ this.disabled = false
|
|
|
|
+ } else if (!this.supplierId) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "请选择发货单位!",
|
|
|
|
+ type: "warning",
|
|
|
|
+ });
|
|
|
|
+ this.disabled = false
|
|
|
|
+ } else if (!this.purchaseOrderId) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "没有匹配的采购订单号!",
|
|
|
|
+ type: "warning",
|
|
|
|
+ });
|
|
|
|
+ this.disabled = false
|
|
|
|
+ } else if (!this.unloadPointId) {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: "请选择卸货地点!",
|
|
|
|
+ type: "warning",
|
|
|
|
+ });
|
|
|
|
+ this.disabled = false
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- let requiremnet = {
|
|
|
|
- purchaseOrderId: this.mapList1.purchaseOrderId,
|
|
|
|
- requiremntUnitId: this.mapList2.wareHouseId,
|
|
|
|
- materialWeight: this.form.materialWeight,
|
|
|
|
- requirementEstimatedDuration: this.form.requirementEstimatedDuration,
|
|
|
|
- requirementOverlimit: this.form.requirementOverlimit,
|
|
|
|
- requirementShipperId: this.form.requirementShipperId,
|
|
|
|
- requirementTruckTime: sjTime(this.form.requirementTruckTime),
|
|
|
|
- requirementType: this.form.requirementType,
|
|
|
|
- requirementWorkContent: this.form.requirementWorkContent,
|
|
|
|
- requirementWorkEnvironment: this.form.requirementWorkEnvironment,
|
|
|
|
- requirementWorkType: this.form.requirementWorkType,
|
|
|
|
- requirementUnloadUnitId: this.mapList3.wareHouseId
|
|
|
|
- };
|
|
|
|
- this.axios
|
|
|
|
- .post("/api/v1/ams/addTruckRequirement", requiremnet)
|
|
|
|
- .then(res => {
|
|
|
|
- if (res.data.code == 200) {
|
|
|
|
|
|
+ if (state == 1) {
|
|
|
|
+ let map = {
|
|
|
|
+ materialId: this.materialId,
|
|
|
|
+ purchaseOrderId: this.purchaseOrderId,
|
|
|
|
+ unloadPointId: this.unloadPointId,
|
|
|
|
+ carrierId:this.carrierId,
|
|
|
|
+ userId:getCookie("orgCode")
|
|
|
|
+ };
|
|
|
|
+ console.log(map, map);
|
|
|
|
+ this.axios.post("/api/v1/ams/addPurInwardRequirement", map).then((res) => {
|
|
|
|
+ if (res.data.code == "200") {
|
|
this.$message({
|
|
this.$message({
|
|
|
|
+ message: "添加成功!",
|
|
type: "success",
|
|
type: "success",
|
|
- message: "新增成功!"
|
|
|
|
});
|
|
});
|
|
- this.$router.go(-1);
|
|
|
|
- } else {
|
|
|
|
- this.$message.error("新增失败!");
|
|
|
|
|
|
+ this.disabled = false
|
|
|
|
+ this.onClickCancel()
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+ }
|
|
},
|
|
},
|
|
- // 返回
|
|
|
|
- cancel() {
|
|
|
|
- this.$router.go(-1);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ },
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
-<style lang="scss" scoped>
|
|
|
|
-.addInwardRequirement{
|
|
|
|
-.form-box {
|
|
|
|
- display: inline-block !important;
|
|
|
|
- margin-left: 38% !important;
|
|
|
|
- .el-input {
|
|
|
|
- width: 288px;
|
|
|
|
|
|
+<style lang="scss" scope>
|
|
|
|
+.addPurRequirement{
|
|
|
|
+.contractDetails {
|
|
|
|
+ width: 100%;
|
|
|
|
+}
|
|
|
|
+.from {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ margin-top: 5px;
|
|
|
|
+ margin-bottom: 20px;
|
|
|
|
+}
|
|
|
|
+.remark {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ .text {
|
|
|
|
+ display: inline-block;
|
|
|
|
+ width: 100px;
|
|
|
|
+ text-align: right;
|
|
}
|
|
}
|
|
- .el-form {
|
|
|
|
- padding: 10px;
|
|
|
|
|
|
+ .input {
|
|
|
|
+ width: 250px;
|
|
|
|
+ margin-right: 20px;
|
|
}
|
|
}
|
|
- .tx{
|
|
|
|
- margin-left: -75px;
|
|
|
|
|
|
+}
|
|
|
|
+.lineId {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ .text {
|
|
|
|
+ display: inline-block;
|
|
|
|
+ width: 170px;
|
|
|
|
+ text-align: right;
|
|
|
|
+ }
|
|
|
|
+ .input {
|
|
|
|
+ width: 250px;
|
|
|
|
+ margin-right: 20px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-.box-form {
|
|
|
|
- display: flex ;
|
|
|
|
- padding-left: 38%;
|
|
|
|
|
|
+.material {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ margin-top: 20px;
|
|
|
|
+ .text {
|
|
|
|
+ display: inline-block;
|
|
|
|
+ width: 170px;
|
|
|
|
+ text-align: right;
|
|
|
|
+ }
|
|
|
|
+ .input {
|
|
|
|
+ width: 250px;
|
|
|
|
+ margin-right: 20px;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+.orderType {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ .text {
|
|
|
|
+ display: inline-block;
|
|
|
|
+ width: 110px;
|
|
|
|
+ text-align: right;
|
|
|
|
+ }
|
|
|
|
+ .select {
|
|
|
|
+ width: 250px;
|
|
|
|
+ }
|
|
|
|
+ .span {
|
|
|
|
+ display: inline-block;
|
|
|
|
+ width: 30px;
|
|
|
|
+ height: 10px;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+.contractTitle {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
.el-form-item {
|
|
.el-form-item {
|
|
- display: flex !important;
|
|
|
|
- padding: 10px;
|
|
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
.el-form-item__label {
|
|
.el-form-item__label {
|
|
- width: 80px !important;
|
|
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
}
|
|
}
|
|
.el-input {
|
|
.el-input {
|
|
- width: 288px;
|
|
|
|
|
|
+ width: 250px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-.button-box {
|
|
|
|
- margin-left: 25px !important;
|
|
|
|
|
|
+.forwardingUnit {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ .text {
|
|
|
|
+ display: inline-block;
|
|
|
|
+ width: 170px;
|
|
|
|
+ text-align: right;
|
|
|
|
+ }
|
|
|
|
+ .input {
|
|
|
|
+ width: 250px;
|
|
|
|
+ margin-right: 20px;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+.truckList1 {
|
|
|
|
+ width: 100%;
|
|
|
|
+ .truckList {
|
|
|
|
+ width: 96%;
|
|
|
|
+ .text {
|
|
|
|
+ display: inline-block;
|
|
|
|
+ width: 120px;
|
|
|
|
+ text-align: right;
|
|
|
|
+ }
|
|
|
|
+ .truckBtn {
|
|
|
|
+ width: 250px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
-</style>
|
|
|
|
|
|
+.button_box {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ align-items: center;
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100px;
|
|
|
|
+}
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+</style>
|