123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578 |
- <template>
- <!-- 修改货权转移页面 -->
- <div class="shipTransport">
- <page-title>返回</page-title>
- <!-- 货权转移送达单位
- <div class="mofrom">
- <span class="motext">货权转移送达单位</span>
- <el-input class="moinput" v-model="cargo" disabled> </el-input>
- <el-button class="mobutton" type="primary" @click="ondrawer(2)"
- >浏览</el-button
- >
- </div>-->
- <!--大品类 -->
- <div class="mofrom">
- <span class="motext">大品类</span>
- <el-input class="moinput" v-model="materialType" disabled> </el-input>
- <el-button class="mobutton" type="primary" @click="ondrawer(4)"
- >浏览</el-button
- >
- </div>
- <!-- 货权转移送达单位 -->
- <div class="mofrom">
- <span class="motext">收货人</span>
- <el-input class="moinput" v-model="receiver" disabled> </el-input>
- <el-button class="mobutton" type="primary" @click="ondrawer(3)"
- >浏览</el-button
- >
- </div>
- <!-- 批次 -->
- <div class="mofrom">
- <span class="motext">批次</span>
- <el-input class="moinput" v-model="batchId" disabled> </el-input>
- <el-button class="mobutton" type="primary" @click="ondrawer(5)" disabled
- >浏览</el-button
- >
- </div>
- <div class="form">
- <div class="form_box">
- <el-form>
- <div class="preview-group">
- <el-form-item label="发货港口:">
- <el-select v-model="portId" filterable>
- <el-option
- v-for="port in ports"
- :key="port.portId"
- :label="port.portName"
- :value="port.portId"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </div>
- </el-form>
- <dil-form :formId="112" v-model="form1"></dil-form>
- </div>
- </div>
- <!-- 模态框 -->
- <el-drawer
- :visible.sync="drawer"
- :direction="direction"
- :before-close="handleClose"
- size="50%"
- >
- <el-input
- placeholder="请输入内容"
- v-model="input"
- style="margin-top: 10px; margin-left: 20px; width: 250px"
- 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 == 4">
- <dilTable v-bind.sync="options" @radio-change="currentRadioChange6"></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>
- <div v-show="a == 5">
- <dilTable
- v-bind.sync="second5"
- @radio-change="currentRadioChange5"
- ></dilTable>
- </div>
- </el-drawer>
- <el-form
- :inline="true"
- class="demo-form-inline"
- label-width="80px"
- style="margin-left: 450px; display: flex"
- >
- <el-form-item label="上传货权转移图片">
- <el-upload
- class="upload-demo"
- style="width: 270px"
- ref="upload1"
- action="/api/v1/tms/uploadCargoPic"
- :before-upload="beforeUpload"
- :multiple="false"
- list-type="picture"
- :show-file-list="false"
- :on-success="handleAvatarSuccess"
- :on-error="onError(1)"
- >
- <span class="span"></span>
- <el-input
- class="shippingCertificate"
- style="width: 270px; display: flex"
- placeholder="请选择货权转移图片(必填项,可支持重新上传)"
- v-model="shippingCertificate"
- disabled
- >
- </el-input>
- <el-button
- size="small"
- type="primary"
- style="
- width: 115px;
- height: 35px;
- margin-left: 275px;
- margin-top: -35px;
- display: flex;
- "
- @click="upCLick(1)"
- >
- 点击上传图片</el-button
- >
- </el-upload>
- </el-form-item>
- </el-form>
- <!-- 确定和取消 -->
- <div class="button_box">
- <el-button @click="onClickCancel">返回</el-button>
- <el-button type="primary" @click="onClickConfirm">确认</el-button>
- </div>
- </div>
- </template>
- <script>
- import PageTitle from "@/components/Page/Title";
- import { sjTime, isNumber } from "@/utils/sharedJsFile";
- import { getCookie } from "@/utils/util.js";
- export default {
- components: { PageTitle },
- data() {
- return {
- form1: {},
- a: 1,
- portId: "",
- ports: [],
- cargoPictureUrl: "",
- shippingCertificate: "",
- materialName: "",
- materialType: "",
- foreignShipName: "",
- materialId: "",
- batchIds: "",
- cargo: "",
- disabled: null,
- receiver: "",
- input: "",
- drawer: false,
- direction: "rtl",
- second: {
- requestUrl: "/api/v1/uc/queryMaterialByLike?apiId=244",
- selectionType: "radio",
- mapList1: [],
- },
- second1: {
- requestUrl: "/api/v1/tms/selectShippeByName?apiId=215",
- selectionType: "radio",
- mapList2: [],
- },
- second2: {
- requestUrl: "/api/v1/tms/getGroupList?apiId=217",
- selectionType: "radio",
- mapList3: [],
- },
- second3: {
- requestUrl: "/api/v1/rms/getMaterialTypeList?apiId=376",
- selectionType: "radio",
- mapList4: [],
- },
- second5: {
- requestUrl: "/api/v1/tms/getBatchIdByForeign?apiId=489",
- selectionType: "radio",
- mapList5: [],
- },
- };
- },
- mounted() {
- this.getPorts();
- this.information();
- },
- methods: {
- //查询所有港口
- getPorts() {
- this.axios.post("/api/v1/rms/getPortName?index=").then((res) => {
- if (res.data.code == 200) {
- //赋值
- this.ports = res.data.data;
- } else {
- this.$message({
- type: "warning",
- message: res.data.data,
- });
- }
- });
- },
- information() {
- this.axios
- .post("/api/v1/tms/selectByNoticeId/" + this.$route.params.noticeId)
- .then((res) => {
- res.data.data.forEach((e) => {
- console.log("aaa", e);
- this.form1 = e;
- this.portId = e.portId;
- this.batchId = e.foreignShipName + e.materialName;
- this.batchIds = e.batchId;
- this.foreignShipName = e.foreignShipName;
- this.materialId = e.materialId;
- // this.materialId = e.materialId;
- this.cargo = e.cargoName;
- this.cargoId = e.cargoId;
- this.shippingCertificate = e.cargoPictureUrl;
- this.cargoPictureUrl = e.cargoPictureUrl;
- this.receiver = e.reciveName;
- this.materialType = e.materialType;
- });
- });
- },
- handleClose(done) {
- done();
- },
- upCLick(val) {
- this.num = val;
- },
- beforeUpload(file) {
- this.upBool = true;
- const isLt2M = file.size < 1024 * 1024 * 0.5;
- if (!isLt2M) {
- this.$message.error("上传文件大小不能超过500kb!");
- } else {
- let size = file.size / 1024;
- let _URL = window.URL || window.webkitURL;
- let img = new Image();
- img.src = _URL.createObjectURL(file);
- }
- return isLt2M;
- },
- onError(err) {
- if (this.upBool) {
- if (this.num == 1) {
- this.shippingCertificate = null;
- this.cargoPictureUrl = null;
- // this.$message.error("上传失败");
- }
- }
- },
- handleAvatarSuccess(res, file) {
- // console.log("res",res.data)
- if (res.code) {
- this.upBool = false;
- if (this.num == 1) {
- this.cargoPictureUrl = res.data;
- this.shippingCertificate = file.name;
- }
- this.$message.success("上传成功");
- }
- },
- currentRadioChange() {
- console.log(1);
- },
- ondrawer(num) {
- this.drawer = true;
- this.a = num;
- // 清空当前输入框中的数据
- this.input = "";
- },
- // currentRadioChange1(selection) {
- // (this.second.mapList1 = selection),
- // (this.materialName = selection.materialName);
- // (this.materialId=selection.materialId);
- // },
- currentRadioChange2(selection) {
- (this.second1.mapList2 = selection), (this.cargo = selection.cargoName);
- },
- currentRadioChange3(selection) {
- (this.second2.mapList3 = selection), (this.receiver = selection.pierName);
- },
- currentRadioChange4(selection) {
- (this.second3.mapList4 = selection),
- (this.materialType = selection.materialTypeName);
- },
- currentRadioChange5(selection) {
- (this.second5.mapList5 = selection),
- (this.batchIds =
- selection.foreignShipName + "" + selection.materialName);
- this.batchIds = selection.batchId;
- this.foreignShipName = selection.foreignShipName;
- },
- onchange(val) {},
- onclick(a) {
- if (a == 2) {
- this.second1.requestUrl =
- "/api/v1/tms/selectShippeByName?apiId=215&con=" + this.input;
- } else if (a == 3) {
- this.second2.requestUrl =
- "/api/v1/tms/getGroupList?apiId=217&con=" + this.input;
- } else if (a == 4) {
- // console.log("aaaa");
- this.second3.requestUrl =
- "/api/v1/rms/getMaterialTypeList?apiId=376&con=" + this.input;
- } else if (a == 5) {
- this.second5.requestUrl =
- "/api/v1/tms/getBatchIdByForeign?apiId=489&con=" + this.input;
- }
- },
- // 确认
- onClickConfirm() {
- let map = {
- noticeId: this.$route.params.noticeId,
- // carrierId: this.form1.carrierId,
- // requesterGroupId: this.form1.requesterGroupId,
- noticeCommerceMethod: this.form1.noticeCommerceMethod,
- noticeHandoverMethod: this.form1.noticeHandoverMethod,
- portId: this.portId,
- noticePortConstructionFee: this.form1.noticePortConstructionFee,
- noticeDeliveryTime: sjTime(this.form1.noticeDeliveryTime),
- noticePileFreeDays: this.form1.noticePileFreeDays,
- // batchId: this.batchId,
- purchaseContractUnitPrice: this.form1.purchaseContractUnitPrice,
- purchaseContractMoisture: this.form1.purchaseContractMoisture,
- //微元素含量
- tfeContent: this.form1.tfeContent,
- silicaContent: this.form1.silicaContent,
- aluminaContent: this.form1.aluminaContent,
- phosphorusContent: this.form1.phosphorusContent,
- manganeseContent: this.form1.manganeseContent,
- resultContactPerson: this.form1.resultContactPerson,
- resultTelephoneFax: this.form1.resultTelephoneFax,
- resultFreightForwardingInfo: this.form1.resultFreightForwardingInfo,
- resultMemo: this.form1.resultMemo,
- resultNumberOfLoans: this.form1.resultNumberOfLoans,
- cargoId: this.second1.mapList2.cargoId,
- groupId: this.second2.mapList3.id,
- inFactoryShipName: this.form1.inFactoryShipName,
- foreignShipName: this.foreignShipName,
- batchIds: this.batchIds,
- materialId: this.materialId,
- materialTypeId: this.second3.mapList4.materialTypeId,
- isNeedPortDisCharge: this.form1.isNeedPortDisCharge,
- isNeedPortFee: this.form1.isNeedPortFee,
- isNeedBonded: this.form1.isNeedBonded,
- cargoPictureUrl: this.cargoPictureUrl,
- userId: getCookie("userId"),
- };
- //判断是否为电话号码
- function isTelePhone() {
- var value2 = map.resultTelephoneFax;
- //验证是否为数字
- var patrn = /^1[3-9]\d{9}$/;
- // var patrn2 = /^(\d{3,4}-)?\d{7,8}$/;
- if (patrn.exec(value2) == null || value2 == "") {
- return false;
- } else {
- return true;
- }
- }
- var val = this.value;
- if (
- map.noticeCommerceMethod == null ||
- map.noticeHandoverMethod == null ||
- map.noticePortConstructionFee == null ||
- map.noticeDeliveryTime == null ||
- map.noticePileFreeDays == null ||
- map.purchaseContractUnitPrice == null ||
- map.purchaseContractMoisture == null ||
- map.tfeContent == null ||
- map.silicaContent == null ||
- map.aluminaContent == null ||
- map.phosphorusContent == null ||
- map.manganeseContent == null ||
- map.resultContactPerson == null ||
- map.resultTelephoneFax == null ||
- map.resultNumberOfLoans == null ||
- //map.carrierId == null ||
- //map.groupId == null ||
- map.inFactoryShipName == null ||
- map.isNeedPortDisCharge == null ||
- map.isNeedPortFee == null
- // map.foreignShipName==null||
- // map.materialId==null
- ) {
- this.$message.error("存在空值!");
- return;
- }
- if (!isTelePhone(val)) {
- this.$message.warning("电话号码或传真格式不正确");
- return;
- }
- if (
- typeof map.noticePortConstructionFee != "undefined" &&
- !isNumber(map.noticePortConstructionFee)
- ) {
- this.$message.error("港建费金额得为数字");
- return;
- }
- if (
- typeof map.purchaseContractMoisture != "undefined" &&
- !isNumber(map.purchaseContractMoisture)
- ) {
- this.$message.error("合同水分得为数字");
- return;
- }
- if (
- typeof map.noticePortConstructionFee != "undefined" &&
- !isNumber(map.noticePortConstructionFee)
- ) {
- this.$message.error("港建费金额得为数字");
- return;
- }
- if (
- typeof map.noticePileFreeDays != "undefined" &&
- !isNumber(map.noticePileFreeDays)
- ) {
- this.$message.error("免堆天数得为数字");
- return;
- }
- if (
- typeof map.purchaseContractUnitPrice != "undefined" &&
- !isNumber(map.purchaseContractUnitPrice)
- ) {
- this.$message.error("单价得为数字");
- return;
- }
- if (typeof map.tfeContent != "undefined" && !isNumber(map.tfeContent)) {
- this.$message.error("tfe含量得为数字");
- return;
- }
- if (
- typeof map.silicaContent != "undefined" &&
- !isNumber(map.silicaContent)
- ) {
- this.$message.error("二氧化硅含量得为数字");
- return;
- }
- if (
- typeof map.aluminaContent != "undefined" &&
- !isNumber(map.aluminaContent)
- ) {
- this.$message.error("氧化铝含量得为数字");
- return;
- }
- if (
- typeof map.phosphorusContent != "undefined" &&
- !isNumber(map.phosphorusContent)
- ) {
- this.$message.error("含磷量得为数字");
- return;
- }
- if (
- typeof map.resultNumberOfLoans != "undefined" &&
- !isNumber(map.resultNumberOfLoans)
- ) {
- this.$message.error("放货数量得为数字");
- return;
- } else {
- }
- this.axios.post("/api/v1/tms/editDeliveryNotice", map).then((res) => {
- if (res.data.code == "200") {
- this.$message({
- type: "success",
- message: "修改成功!",
- });
- this.$router.go(-1);
- } else {
- this.$message.error("修改失败!!");
- }
- });
- },
- // 返回
- onClickCancel() {
- this.$router.go(-1);
- },
- },
- };
- </script>
- <style lang="scss">
- .shipTransport {
- .form {
- display: flex;
- .form_box {
- width: 320px;
- margin-left: 35%;
- margin-top: 30px;
- 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;
- }
- }
- }
- }
- }
- }
- }
- .mofrom {
- display: flex;
- align-items: center;
- justify-content: center;
- margin-top: 5px;
- margin-right: 10px;
- .motext {
- width: 70px;
- }
- .moinput {
- width: 250px;
- }
- .mobutton {
- margin-left: 6px;
- }
- }
- .button_box {
- margin-left: 45%;
- }
- }
- </style>
|