123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223 |
- <template>
- <!-- 添加提货委托 -->
- <div class="shipTransport">
- <page-title>返回</page-title>
- <div class="form">
- <div class="form_box">
- <dil-form :formId="113" v-model="form1" ref="from1"></dil-form>
- </div>
- <div class="liulan">
- <el-button type="primary" class="btn" @click="onDrawer">浏览</el-button>
- </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"
- :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()"
- style="margin-bottom: 15px"
- >
- <i class="el-icon-search"></i>查询
- </el-button>
- <dilTable
- v-bind.sync="options"
- @radio-change="currentRadioChange1"
- ></dilTable>
- </el-drawer>
- </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 {
- input: "",
- drawer: false,
- direction: "rtl",
- options: {
- requestUrl: "/api/v1/tms/getBatchListForAttorney?apiId=375",
- selectionType: "radio",
- maplist: []
- },
- batchIds: "",
- form1: {},
- value: undefined,
- value2: undefined
- };
- },
- created() {
- this.form1 = {
- downSwimPortId: 11
- };
- },
- mounted() {},
- methods: {
- onDrawer() {
- this.drawer = true;
- },
- onclick() {
- this.options.requestUrl =
- "/api/v1/tms/getBatchListForAttorney?apiId=375&con=" + this.input;
- },
- handleClose(done) {
- done();
- },
- currentRadioChange1(selection) {
- this.maplist = selection;
- if (JSON.stringify(this.maplist).length > 2) {
- this.$set(
- this.form1,
- "batchId",
- selection.resultForeignShipName + selection.materialName
- );
- this.batchIds = selection.batchId;
- }
- },
- // 确定
- makeSure() {
- // 判断用户是否输入了批次号
- if (this.batchIds == "" || this.batchIds == undefined) {
- this.$message.warning("请选择批次号");
- return;
- }
- let AmsshipDeliveryAttorney = {
- downSwimPortId: this.form1.downSwimPortId,
- attorenyPickupIdcard: this.form1.attorenyPickupIdcard,
- attorneyContactTelephone: this.form1.attorneyContactTelephone,
- batchId: this.batchIds,
- attorneyTime: sjTime(this.form1.attorneyTime),
- attorneyPdffile: this.form1.attorneyPdffile,
- noticeId: this.form1.noticeId,
- portId: this.form1.portId,
- attorneyPickupContactPerson: this.form1.attorneyPickupContactPerson,
- userId: getCookie("userId")
- // resultMemo: this.form1.resultMemo,
- };
- //身份证校验
- function checkCardNo() {
- var value3 = AmsshipDeliveryAttorney.attorenyPickupIdcard;
- //验证是否为数字
- var patrn = /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/;
- // var patrn2 = /^(\d{3,4}-)?\d{7,8}$/;
- if (patrn.exec(value3) == null || value3 == "") {
- return false;
- } else {
- return true;
- }
- }
- //判断是否为电话号码
- function isTelePhone() {
- var value2 = AmsshipDeliveryAttorney.attorneyContactTelephone;
- //验证是否为数字
- 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 val2 = this.value2;
- var val3 = this.value3;
- if (
- // AmsshipDeliveryAttorney.attorneyId==null||
- // AmsshipDeliveryAttorney.downSwimPortId == null ||
- AmsshipDeliveryAttorney.attorenyPickupIdcard == null ||
- AmsshipDeliveryAttorney.attorneyContactTelephone == null ||
- AmsshipDeliveryAttorney.attorneyPickupContactPerson == null
- )
- this.$message.error("存在空值,请核实以后再提交");
- else if (!isTelePhone(val2)) this.$message.warning("联系电话格式不正确");
- else if (!checkCardNo(val3))
- this.$message.warning("请输入正确的身份证格式");
- else
- this.axios
- .post(
- "/api/v1/tms/insertshipDeliveryAttorney",
- AmsshipDeliveryAttorney
- )
- .then(res => {
- this.$router.go(-1);
- });
- },
- // 取消
- cancel() {
- 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;
- }
- }
- }
- }
- }
- }
- }
- .liulan {
- width: 120px;
- margin-top: 30px;
- .el-button {
- width: 100px !important;
- margin: auto;
- }
- .btn {
- margin-top: 0px;
- }
- .btn1 {
- margin-top: 13px;
- }
- .btn2 {
- margin-top: 67px;
- }
- }
- .button_box {
- margin-left: 45%;
- }
- }
- </style>
|