审查视图

src/views/nmms_import/Importallocation.vue 16.3 KB
1 2 3
<template>
            <el-container>
                <el-main>
4
5
                    <el-row class="row-bg">
6 7 8 9 10 11 12 13 14 15
                            <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="30px" class="demo-ruleForm":label-position="labelPosition">
                                <el-row class="row-bg">
                                    <el-col :span="24"><div class="grid-content content co">分拨运抵管理</div></el-col>
                                </el-row>
                                <el-row>
                                    <el-col :span="18">
                                        <el-form-item label="" prop="awba">
                                            <el-input v-model="ruleForm.awba"  style="width: 200px">
                                                <template slot="prepend">运&nbsp;单&nbsp;号</template>
                                            </el-input>
16 17
                                        </el-form-item>
                                    </el-col>
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
                                </el-row>


<!--                                <el-form-item label="航班号" prop="flightno">-->
<!--                                    <el-input v-model="ruleForm.flightno"></el-input>-->
<!--                                </el-form-item>-->
<!--                                <el-form-item label="拖车号" prop="pno">-->
<!--                                    <el-input v-model="ruleForm.pno"></el-input>-->
<!--                                </el-form-item>-->
<!--                                <el-form-item label="航班日期" required>-->
<!--                                    <el-col :span="24">-->
<!--                                        <el-form-item prop="flightdate">-->
<!--                                            <el-date-picker type="date" placeholder="选择日期" v-model="ruleForm.flightdate" style="width: 100%;"></el-date-picker>-->
<!--                                        </el-form-item>-->
<!--                                    </el-col>-->
<!--                                </el-form-item>-->
<!--                                <el-form-item label="分拨件数" prop="turnpiece">-->
<!--                                    <el-input v-model="ruleForm.turnpiece"></el-input>-->
<!--                                </el-form-item>-->
<!--                                <el-form-item label="分拨重量" prop="turnweight">-->
<!--                                    <el-input v-model="ruleForm.turnweight"></el-input>-->
<!--                                </el-form-item>-->
<!--                                <el-form-item label="海关关区" prop="customcode">-->
<!--                                    <el-col :span="24">-->
<!--                                    <el-select v-model="ruleForm.customcode" placeholder="请选择海关关区" style="width:100%">-->
<!--                                        <el-option v-for="item in options2" :key="item.value" :label="item.label"-->
<!--                                                   :value="item.value" ></el-option>-->
<!--                                    </el-select>-->
<!--                                    </el-col>-->
<!--                                </el-form-item>-->
<!--                                <el-form-item label="分拨到达" prop="turnunloading">-->
<!--                                    <el-col :span="24">-->
<!--                                        <el-select v-model="ruleForm.turnunloading" placeholder="请选择分拨到达地" style="width:100%">-->
<!--                                            <el-option v-for="item in options" :key="item.value" :label="item.label"-->
<!--                                                       :value="item.value" ></el-option>-->
<!--                                        </el-select>-->
<!--                                    </el-col>-->
<!--                                </el-form-item>-->
<!--                                <el-form-item label="卸货地" prop="ext2">-->
<!--                                    <el-input v-model="ruleForm.ext2"></el-input>-->
<!--                                </el-form-item>-->
<!--                                <el-form-item label="车辆所发属" prop="ext1">-->
<!--                                    <el-input v-model="ruleForm.ext1"></el-input>-->
<!--                                </el-form-item>-->
                                <el-row class="row-bg">
                                    <el-col :span="24"><div class="grid-content content co">货物信息</div></el-col>
                                </el-row>
                                <el-row class="row-bg">
                                    <el-row>
                                        <el-col :span="5">
                                            <el-form-item label="" prop="carrier">
                                                <el-input v-model="ruleForm.carrier"  style="width: 160px"  onkeyup="this.value=this.value.toUpperCase()">
                                                    <template slot="prepend">承&nbsp;运&nbsp;人</template>
                                                </el-input>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="5">
                                            <el-form-item label="" prop="flightno">
                                                <el-input v-model="ruleForm.flightno"  style="width: 160px">
                                                    <template slot="prepend">航&nbsp;班&nbsp;号</template>
                                                </el-input>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="7">
                                            <el-form-item label="" prop="flightdate">
                                                <div class="ip">
                                                    &nbsp;航班日期&nbsp;
                                                </div>
                                                <el-date-picker
                                                        v-model="ruleForm.flightdate"
                                                        value-format="yyyy-MM-dd"
                                                        type="date"  style="width: 125px"
                                                        placeholder="航班日期">
                                                </el-date-picker>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="7">
                                            <el-form-item label="" prop="customcode">
                                                <div class="ip">
                                                    海关关区
                                                </div>
                                                <el-select v-model="ruleForm.customcode" placeholder="请选择海关关区" style="width:115px">
                                                    <el-option v-for="item in options2" :key="item.value" :label="item.label"
                                                               :value="item.value" ></el-option>
                                                </el-select>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                    <el-row>
                                        <el-col :span="5">
                                            <el-form-item label="" prop="turnpiece">
                                                <el-input v-model="ruleForm.turnpiece"  style="width: 160px">
                                                    <template slot="prepend">分拨件数</template>
                                                </el-input>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="5">
                                            <el-form-item label="" prop="turnweight">
                                                <el-input v-model="ruleForm.turnweight"  style="width: 160px">
                                                    <template slot="prepend">分拨重量</template>
                                                </el-input>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="7">
                                            <el-form-item label="" prop="turnunloading">
                                                <div class="ip">
                                                    分拨到达地
                                                </div>
                                                <el-select v-model="ruleForm.turnunloading" placeholder="请选择分拨到达地" style="width:125px">
                                                    <el-option v-for="item in options" :key="item.value" :label="item.label"
                                                               :value="item.value" ></el-option>
                                                </el-select>
                                            </el-form-item>
                                        </el-col>
                                        <el-col :span="7">
                                            <el-form-item label="" prop="pno">
                                                <el-input v-model="ruleForm.pno"  style="width: 200px">
                                                    <template slot="prepend">拖&nbsp;车&nbsp;号</template>
                                                </el-input>
                                            </el-form-item>
                                        </el-col>
                                    </el-row>
                                </el-row>
141
                            </el-form>
142
                        <el-col :span="8" :offset="10" style="margin-bottom: 20px;margin-top: 10px">
143
                            <el-button type="primary" @click="submitForm('ruleForm')">保存</el-button>
144 145
<!--                            <el-button type="primary" @click="submitForm('ruleForm')">保存并发送</el-button>-->
                            <el-button  @click="back">返回</el-button>
146 147
                        </el-col>
                    </el-row>
148
                        <!--对话提示框-->
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
                    <el-row>
                        <el-dialog
                                title="系统提示"
                                :visible.sync="centerDialogVisible"
                                width="30%"
                                center>
                            <span>{{msg}}</span>
                      <span slot="footer" class="dialog-footer">
                          <el-button @click="DialogVisible">取 消</el-button>
                        <el-button type="primary" @click="DialogVisible">确 定</el-button>
                      </span>
                        </el-dialog>
                    </el-row>
                </el-main>
            </el-container>
</template>
<style scoped>
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181
    .ip{
        max-width: 100px;
        margin-right: -5px;
        display: inline-block;
        background-color: #6F8294;
        color: #ffffff;
        border: 1px solid #DCDFE6;
        vertical-align: middle;
        padding: 0 18px;
        white-space: nowrap;
        border-top-right-radius: 0px;
        border-top-left-radius: 4px;
        border-bottom-left-radius: 4px;
        border-bottom-right-radius: 0px;
        font-size: 10px;
    }
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199
    .co{height: 36px;line-height: 36px;}
    .co{border-left: 4px #409EFF solid;padding-left: 10px;background-color: #f9fafc;margin-bottom: 2px}
    .row-bg{background-color: white;padding:0px;}
 </style>
<script>
    import { addAllocatImport } from '../../api/Allocat'
    export default {
        data(){
            return{
                ruleForm: {
                    awba: '',
                    carrier: '',
                    flightno: '',
                    flightdate:'',
                    turnpiece:'',
                    turnweight:'',
                    customcode:'',
                    turnunloading:'',
200 201
                    pno:'',
                    ext2:'',
xudada authored
202 203
                    ext1:'',
                    status:'22'
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226
                },
                rules: {
                    awba: [
                        { required: true, message: '请输入运单号', trigger: 'blur' },
                    ],
                    carrier: [
                        { required: true, message: '请输入承运人', trigger: 'blur' }
                    ],
                    flightno: [
                        { required: true, message: '请输入航班号', trigger: 'blur' }
                    ],
                    turnpiece: [
                        { required: true, message: '请输入分拨件数', trigger: 'blur' }
                    ],
                    turnweight: [
                        { required: true, message: '请输入分拨重量', trigger: 'blur' }
                    ],
                    flightdate: [
                        {required: true, message: '航班日期必须选择', trigger: 'change'}
                    ],
                    customcode: [
                        { required: true, message: '请选择海关关区', trigger: 'change' }
                    ],
227
                    turnunloading: [
228
                        { required: true, message: '请选择分拨到达地', trigger: 'change' }
229 230 231 232 233 234
                    ],
                    ext2: [
                        { required: true, message: '请输入卸货地', trigger: 'change' }
                    ],
                    ext1: [
                        { required: true, message: '请输入运输车辆所属承运人代码', trigger: 'change' }
235
                    ]
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265
                },
                options2: [
                    {
                    value: '4604',
                    label: '4604'
                }, {
                    value: '4620',
                    label: '4620'
                }, {
                    value: '4613',
                    label: '4613'
                }],
                options: [
                    {
                    value: 'CNZGZ460044/4620',
                    label: 'CNZGZ460044/4620'
                }, {
                    value: 'CNCGO460011/4604',
                    label: 'CNCGO460011/4604'
                }, {
                    value: 'CNCGO460011/4613',
                    label: 'CNCGO460011/4613'
                }],
                labelPosition:'left',
                centerDialogVisible:false,
                msg:'',
                code:''
            }
        },
        methods:{
266
            //保存
267 268 269 270 271
            submitForm(formName) {
                this.$refs[formName].validate((valid) => {
                    if (valid) {
                        addAllocatImport(this.ruleForm).then(res=>{
                            let response=res.data;
272
                        console.log(res);
273 274 275 276 277 278 279 280 281 282 283 284 285 286 287
                        this.code=response.code;
                        if(this.code=='200'){
                            this.centerDialogVisible=true;
                            this.msg=response.msg;
                        }else{
                            this.centerDialogVisible=true;
                            this.msg=response.msg;
                        }
                    });
                    } else {
                        console.log('error submit!!');
                return false;
            }
            });
            },
288 289 290 291
// 过滤中英文
            inputMe(e){
                return e.replace(/[^a-zA-Z0-9.-]/g,'').toUpperCase();
            },
292 293 294 295 296 297
            getDefaultData(){
                this.ruleForm=this.$route.params;
            },
            DialogVisible(){
                this.centerDialogVisible=false;
                this.$router.push({name:'运单分拨申报',params:{awba:this.ruleForm.awba}});
xudada authored
298 299 300 301
            },
            back(){
                this.$router.go(-1);//返回上一层
            },
302
        },
303
        activated(){
304 305 306
            this.getDefaultData();
        }
    }
307
</script>