审查视图

src/views/deploy/inventroyrecord.vue 26.2 KB
1 2 3 4
<template>
    <el-row>
        <el-card  style="background-color: #F5F7FA">
            <!--            搜索区域-->
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
            <el-row class="toolbar" style="height: 100px">
                <el-row style="margin-top: -3px">
                    <el-col :span="5">
                        <el-input v-model="queryInfo.waybill" prefix-icon="el-icon-search" size="small" style="width: 240px"
                                  placeholder="主单号" clearable>
                            <template slot="prepend">主单号</template>
                        </el-input>
                    </el-col>
                    <el-col :span="5">
                        <el-input v-model="queryInfo.billfhl" prefix-icon="el-icon-search" size="small" style="width: 240px"
                                  placeholder="分单号" clearable>
                            <template slot="prepend">分单号</template>
                        </el-input>
                    </el-col>
                    <el-col :span="5">
                        <div class="my-text-area">
                            <div class="el-input-group__prepend prepand">出入库类型</div>
                            <el-select v-model="queryInfo.ietype" placeholder="出入库类型" size="mini" style="width: 140px">
小范 authored
23
                                <el-option label="出入库类型-全部" value=""></el-option>
24 25
                                <el-option label="出入库类型-进" value="I"></el-option>
                                <el-option label="出入库类型-出" value="E"></el-option>
小范 authored
26
                                <el-option label="出入库类型-退" value="C"></el-option>
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
                            </el-select>
                        </div>
                        <!--                    <el-input v-model="queryInfo.ietype" prefix-icon="el-icon-search" size="small" style="width: 240px"-->
                        <!--                              placeholder="类型" clearable>-->
                        <!--                        <template slot="prepend">类型</template>-->
                        <!--                    </el-input>-->
                    </el-col>
                    <el-col :span="5">
                        <el-input v-model="queryInfo.custcode" prefix-icon="el-icon-search" size="small" style="width: 240px"
                                  placeholder="货物单号" clearable>
                            <template slot="prepend">客户代码</template>
                        </el-input>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="10">
                        <div class="my-text-area">
                            <div class="el-input-group__prepend prepand">时间段</div>
                            <el-date-picker
                                    v-model="searchTime"
                                    type="daterange"
48
                                    unlink-panels @change="handleCycleTime"
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
                                    range-separator="至"
                                    start-placeholder="开始日期"
                                    end-placeholder="结束日期"
                                    value-format="yyyy-MM-dd HH:mm:ss"
                                    format="yyyy-MM-dd HH:mm:ss"
                                    :picker-options="pickerOptions">
                            </el-date-picker>
                        </div>
                    </el-col>
                    <el-col :span="4">
                        <el-button type="primary" icon="el-icon-search" size="small" @click="getList()">
                            查询
                        </el-button>
                        <!--                    <el-button type="success" icon="el-icon-edit" size="small" @click="applyAdd()">新增</el-button>-->
                    </el-col>
                </el-row>
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
            </el-row>
            <el-row>
                <el-dialog :title="dialogMap[dialogApply]" :visible.sync="apply_dialog.addDialog" width="80%" >
                    <el-form  :model="addForm"  :rules="rules" ref="addForm" style="margin-top: 40px">
                        <el-row>
                            <el-col :span="7">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="waybill">
                                    <el-input v-model="addForm.waybill" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">货物单号</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="weight">
                                    <el-input v-model="addForm.weight" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">重&emsp;&emsp;量</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="vol">
                                    <el-input v-model="addForm.vol" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">体&emsp;&emsp;积</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="7">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="pcs">
                                    <el-input v-model="addForm.pcs" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">件&emsp;&emsp;数</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="billweight">
                                    <el-input v-model="addForm.billweight" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">计费重量</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="area">
                                    <el-input v-model="addForm.area" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">库&emsp;&emsp;区</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="7">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="location">
                                    <el-input v-model="addForm.location" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">库&emsp;&emsp;位</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="serialnumber">
                                    <el-input v-model="addForm.serialnumber" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">流水&emsp;号</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="transtype">
132 133 134 135 136 137 138 139 140 141 142
                                    <div class="my-text-area">
                                        <div class="el-input-group__prepend prepand">交易类型</div>
                                        <el-select v-model="addForm.transtype" placeholder="请选择交易类型"  autocomplete="off" size="small" style="width: 210px">
                                            <el-option
                                                    v-for="item in options1"
                                                    :key="item.value"
                                                    :label="item.label"
                                                    :value="item.value">
                                            </el-option>
                                        </el-select>
                                    </div>
143 144 145 146 147 148 149 150 151 152 153 154 155
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="7">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="house">
                                    <el-input v-model="addForm.house" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">出入库仓库</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="opttime">
156 157 158 159 160 161 162 163 164 165 166
                                    <div class="my-text-area">
                                        <div class="el-input-group__prepend prepand">交易类型</div>
                                        <el-date-picker
                                                v-model="addForm.opttime"
                                                type="datetime" size="mini"
                                                value-format="yyyy-MM-dd HH:mm:ss"
                                                format="yyyy-MM-dd HH:mm:ss"
                                                style="width:210px"
                                                placeholder="选择出入库时间">
                                        </el-date-picker>
                                    </div>
167 168 169 170 171 172 173 174 175 176 177 178 179
                                </el-form-item>
                            </el-col>

                            <el-col :span="8">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="station">
                                    <el-input v-model="addForm.station" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">出入库场站</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="7">
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200
                                <el-form-item label="" :label-width="formLabelWidth"  prop="goodstype">
                                    <div class="my-text-area">
                                        <div class="el-input-group__prepend prepand">交易类型</div>
                                        <el-select v-model="addForm.goodstype" placeholder="请选择出入库货物类型"  autocomplete="off" size="small" style="width: 170px">
                                            <el-option
                                                    v-for="item in options"
                                                    :key="item.value"
                                                    :label="item.label"
                                                    :value="item.value">
                                            </el-option>
                                        </el-select>
                                    </div>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="ietype">
                                    <div class="my-text-area">
                                        <div class="el-input-group__prepend prepand">出入库类型</div>
                                        <el-select v-model="addForm.ietype" placeholder="出入库类型" size="mini" style="width: 210px">
                                            <el-option label="出入库类型-进" value="I"></el-option>
                                            <el-option label="出入库类型-出" value="E"></el-option>
小范 authored
201
                                            <el-option label="出入库类型-退" value="C"></el-option>
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219
                                        </el-select>
                                    </div>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="status">
                                    <div class="my-text-area">
                                        <div class="el-input-group__prepend prepand">状&emsp;&emsp;态</div>
                                        <el-select v-model="addForm.status" placeholder="请选择状态" size="mini" style="width: 210px">
                                            <el-option label="状态-失败" value="0"></el-option>
                                            <el-option label="状态-成功" value="1"></el-option>
                                        </el-select>
                                    </div>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="7">
小范 authored
220 221 222
                                <el-form-item label="" :label-width="formLabelWidth"  prop="transcar">
                                    <el-input v-model="addForm.transcar" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">运输车辆信息</template>
223 224 225 226 227 228 229 230 231 232 233 234 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
                                    </el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="opter">
                                    <el-input v-model="addForm.opter" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">出入库经办人</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="8">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="customername">
                                    <el-input v-model="addForm.customername" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">出入库客户名称</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="7">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="custel">
                                    <el-input v-model="addForm.custel" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">出入库客户联系电话</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                            <el-col :span="10">
                                <el-form-item label="" :label-width="formLabelWidth"  prop="customer">
                                    <el-input v-model="addForm.customer" autocomplete="off" size="small" style="width: 300px">
                                        <template slot="prepend">出入库客户联系人姓名</template>
                                    </el-input>
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </el-form>
                    <div slot="footer" class="dialog-footer">
                        <el-button @click="apply_dialog.addDialog = false" size="small">取 消</el-button>
                        <el-button type="primary" @click="dialogApply==='create'?add():edit()" size="small">提 交</el-button>
261
                        <el-button type="primary" @click="zancun()" size="small">暂存</el-button>
262 263 264
                    </div>
                </el-dialog>
            </el-row>
265 266 267 268 269
            <!--            列表区域-->
            <Tabulation
                    ref="tabulation"
                    :tabulationInfo="queryInfo"
            ></Tabulation>
270 271 272 273 274
        </el-card>
    </el-row>
</template>

<script>
275 276
    import {selectNewInventroyrecords,delInventoryrecord,addInventoryrecord,ediInventroyrecord} from '../../api/consigner/station';
    import Tabulation from "./tabulation"
277 278

    export default {
279 280 281
        components: {
            Tabulation
        },
282 283
        data() {
            return {
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310
                pickerOptions: {
                    shortcuts: [{
                        text: '最近一周',
                        onClick(picker) {
                            const end = new Date();
                            const start = new Date();
                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
                            picker.$emit('pick', [start, end]);
                        }
                    }, {
                        text: '最近一个月',
                        onClick(picker) {
                            const end = new Date();
                            const start = new Date();
                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
                            picker.$emit('pick', [start, end]);
                        }
                    }, {
                        text: '最近三个月',
                        onClick(picker) {
                            const end = new Date();
                            const start = new Date();
                            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
                            picker.$emit('pick', [start, end]);
                        }
                    }]
                },
311 312
                queryInfo: {
                    waybill:'',
313 314 315
                    billfhl:'',
                    ietype:'',
                    custcode:'',
316 317 318 319
                    // 当前页数
                    pageNum: 1,
                    // 每页大小
                    pageSize: 10,
320 321
                    starttime:'',
                    endtime:'',
322
                },
323
                creattime:'',
324
                total: 0,
325
                // tableData:[],
326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364
                dialogMap: {
                    update: '编辑',
                    create: '新增'
                },
                dialogApply: 'create',
                apply_dialog: {
                    // 添加对话框
                    addDialog: false,
                    // 编辑对话框
                    editDialog: false
                },
                addForm: {
                    area: '',
                    billweight: '',
                    custel: '',
                    customer: '',
                    customername: '',
                    goodstype: '',
                    house:'',
                    ietype:'',
                    location:'',
                    opter:'',
                    opttime: '',
                    pcs: '',
                    serialnumber: '',
                    station: '',
                    status: '',
                    transcar: '',
                    transtype:'',
                    vol:'',
                    waybill:'',
                    weight:'',
                    remark:'',
                    remark1:'',
                    remark2:'',
                    remark3:'',
                    remark4:'',
                    remark5:'',
                },
小范 authored
365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384
                options: [{
                    value: '板箱',
                    label: '货物类型-板箱'
                }, {
                    value: '运单',
                    label: '货物类型-运单'
                }, {
                    value: '托盘',
                    label: '货物类型-托盘'
                }],
                options1: [{
                    value: '采购入库',
                    label: '交易类型-采购入库'
                }, {
                    value: '生产入库',
                    label: '交易类型-生产入库'
                }, {
                    value: '销售入库',
                    label: '交易类型-销售入库'
                }],
385
                zancundata:[],
386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407
                formLabelWidth: '80px',
                rules: {
                    userName: [
                        //     { required: true, message: '请输入申请人', trigger: 'blur' },
                        //     // { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
                        // ],
                        // applyTime: [
                        //     {  required: true, message: '请选择时间', trigger: 'change' }
                        // ],
                        // needCount: [
                        //     { required: true, message: '请输入需要车辆数量', trigger: 'blur' },
                        // ],
                        // orginStation: [
                        //     { required: true, message: '请输入起始场站', trigger: 'blur' },
                        // ],
                        // endStation: [
                        //     { required: true, message: '请输入目的场站', trigger: 'blur' },
                        // ],
                    ],
                },
            }
        },
408 409 410 411 412 413 414 415 416 417 418 419 420 421 422
        computed:{
            //选中的时间段
            searchTime: {
                get:function () {
                    return this.creattime
                },
                set:function (val) {
                    this.creattime = val
                    if (val && val.length===2){
                        this.queryInfo.starttime = val[0]
                        this.queryInfo.endtime = val[1]
                    }
                }
            },
        },
423
        methods: {
424 425 426 427
            handleCycleTime(date) {
                this.queryInfo.starttime = date ? date[0] : undefined;
                this.queryInfo.endtime = date ? date[1] : undefined;
            },
428 429 430 431
            zancun(){
                this.zancundata.push(this.addForm);
                console.log(this.zancundata)
            },
432
            getList() {
433
                console.log("queryinfo---->"+this.queryInfo)
434 435
                this.$refs.tabulation.getList(this.queryInfo)
436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492
            },
            // 添加对话框,打开事件
            applyAdd() {
                this.addForm = {
                    area: '',
                    billweight: '',
                    custel: '',
                    customer: '',
                    customername: '',
                    goodstype: '',
                    house:'',
                    ietype:'',
                    location:'',
                    opter:'',
                    opttime: '',
                    pcs: '',
                    serialnumber: '',
                    station: '',
                    status: '',
                    transcar: '',
                    transtype:'',
                    vol:'',
                    waybill:'',
                    weight:'',
                    remark:'',
                    remark1:'',
                    remark2:'',
                    remark3:'',
                    remark4:'',
                    remark5:'',
                    uuid:''
                };
                this.dialogApply= 'create';
                this.apply_dialog.addDialog = true;
            },
            // 添加功能
            add() {
                this.$refs.addForm.validate(valid => {
                    // 未通过,表单预校验
                    if (!valid) return;
                    addInventoryrecord(this.addForm).then((response) => {
                        let res = response.data;
                        // 添加失败
                        if (res.code !== '200') {
                            return this.$message.error(res.msg);
                        }
                        // 添加,成功
                        this.$message.success(res.msg);
                        // 隐藏对话框
                        this.apply_dialog.addDialog = false;
                        // 刷新列表
                        this.getList();
                    }).catch(error => {
                        this.$message.error(error.toString());
                    });
                })
            },
小范 authored
493 494

495 496
        },
        mounted() {
497
            // this.getList();
498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514
            // this.getYardList();

        }

    }
</script>

<style scoped>
    .toolbar{
        height: 60px;
        background-color: white;
        /*line-height: 60px;*/
        vertical-align: middle;
        border-radius: 5px 5px 5px 5px;
        padding: 15px 0 0 20px;
        box-shadow: 0px 5px 5px #e5e8eb;
    }
515 516 517 518 519 520 521 522 523 524 525 526 527 528 529
    .my-text-area .prepand{
        float: left;
        width:89px;
        height: 28px;
        font-size: 12px;
        line-height: 28px;
    }
</style>
<style>
    .my-text-area .el-textarea__inner{
        min-height: 28px;
        height: 28px;
        border-bottom-left-radius: 0;
        border-top-left-radius: 0;
    }
530 531
</style>