123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348 |
- // 新增采购内转需求
- <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
- :inline="true"
- class="demo-form-inline"
- :label-position="left"
- label-width="80px"
- >
- <el-form-item label="卸车点">
- <el-input v-model="truckPoint1" placeholder="必填" disabled>
- </el-input>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="ondrawer(3)">浏览</el-button>
- </el-form-item>
- </el-form>
- </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 v-show="a == 1">
- <dilTable
- v-bind.sync="second"
- @radio-change="currentRadioChange1"
- ></dilTable>
- </div>
- <div v-show="a == 2">
- <dilTable
- v-bind.sync="second1"
- @radio-change="currentRadioChange2"
- ></dilTable>
- </div>
- <div v-show="a == 3">
- <dilTable
- v-bind.sync="second2"
- @radio-change="currentRadioChange3"
- ></dilTable>
- </div>
- <div v-show="a == 4">
- <dilTable
- v-bind.sync="second3"
- @radio-change="currentRadioChange4"
- ></dilTable>
- </div>
- </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>
- </div>
- </template>
- <script>
- import PageTitle from "@/components/Page/Title";
- import { sjTime } from "@/utils/sharedJsFile";
- export default {
- components: { PageTitle },
- data() {
- return {
- purchaseOrder: null,
- foreignShipName: null,
- materialName: null,
- shipperName: null,
- supplierName: null,
- a: 1,
- direction: "rtl",
- input: "",
- truckPoint: null,
- truckPoint1: null,
- drawer: false,
- form: {},
- second: {
- requestUrl: "/api/v1/ams/getPurchaseIdByBatch?apiId=252",
- selectionType: "radio",
- mapList1: []
- },
- second1: {
- requestUrl: "/api/v1/ams/getWareHouse?apiId=251",
- selectionType: "radio",
- mapList2: []
- },
- second2: {
- requestUrl: "/api/v1/ams/getWareHouse?apiId=251",
- selectionType: "radio",
- mapList3: []
- },
- second3: {
- requestUrl: "/api/v1/ams/getWareHouse?apiId=251",
- selectionType: "radio",
- mapList4: []
- }
- };
- },
- methods: {
- ondrawer(num) {
- this.drawer = true;
- this.a = num;
- },
- handleClose(done) {
- done();
- },
- 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;
- }
- }
- },
- 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;
- },
- 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;
- },
- 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;
- },
- // 新增
- 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;
- }
- 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) {
- this.$message({
- type: "success",
- message: "新增成功!"
- });
- this.$router.go(-1);
- } else {
- this.$message.error("新增失败!");
- }
- });
- },
- // 返回
- cancel() {
- this.$router.go(-1);
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .addInwardRequirement{
- .form-box {
- display: inline-block !important;
- margin-left: 38% !important;
- .el-input {
- width: 288px;
- }
- .el-form {
- padding: 10px;
- }
- .tx{
- margin-left: -75px;
- }
- }
- .box-form {
- display: flex ;
- padding-left: 38%;
- .el-form-item {
- display: flex !important;
- padding: 10px;
- .el-form-item__label {
- width: 80px !important;
- }
- .el-input {
- width: 288px;
- }
- }
- }
- .button-box {
- margin-left: 25px !important;
- }
- }
- </style>
|