审查视图

src/views/deploy/houseRecord.vue 65.9 KB
1 2 3
<template>
    <el-row>
        <el-card  style="background-color: #F5F7FA">
4
            <el-row class="toolbar" style="height:auto">
5
                <el-form  :model="addForm"  :rules="rules" ref="addForm" :inline="true">
朱兆平 authored
6
                    <el-divider content-position="left"><i class="el-icon-document"></i> 货物信息 <el-tag type="info">流水号: {{addForm.serialnumber}}</el-tag></el-divider>
7
                    <el-row>
朱兆平 authored
8
                        <el-col :span="6" v-if="false">
9
                            <el-form-item label=" " :label-width="formLabelWidth"  prop="serialnumber">
10
                                <el-input v-model="addForm.serialnumber" autocomplete="off" suffix-icon="el-icon-files"  disabled>
11 12 13 14 15
                                    <template slot="prepend">流&emsp;&emsp;水</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
朱兆平 authored
16 17
                            <el-form-item label=" " :label-width="formLabelWidth"  prop="waybill">
                                <el-input v-model="addForm.waybill" autocomplete="off"  suffix-icon="el-icon-document" clearable>
18 19 20 21 22
                                    <template slot="prepend">主&emsp;&emsp;单</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
朱兆平 authored
23 24
                            <el-form-item label=" " :label-width="formLabelWidth"  prop="billfhl">
                                <el-input v-model="addForm.billfhl" autocomplete="off"  suffix-icon="el-icon-document" clearable>
25 26 27 28 29
                                    <template slot="prepend">分&emsp;&emsp;单</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
朱兆平 authored
30 31
                            <el-form-item label=" " :label-width="formLabelWidth"  prop="totalpcs">
                                <el-input v-model.number="addForm.totalpcs" autocomplete="off"  suffix-icon="el-icon-files" clearable >
朱兆平 authored
32
                                    <template slot="prepend">总&nbsp;件&nbsp;数</template>
33 34 35 36
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
朱兆平 authored
37 38
                            <el-form-item label=" " :label-width="formLabelWidth"  prop="totalweight">
                                <el-input v-model="addForm.totalweight" autocomplete="off" suffix-icon="el-icon-files" clearable>
朱兆平 authored
39 40 41 42 43 44 45 46 47 48 49 50 51 52
                                    <template slot="prepend">总&nbsp;重&nbsp;量</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="6">
                            <el-form-item label=" " :label-width="formLabelWidth"  prop="pcs">
                                <el-input v-model.number="addForm.pcs" autocomplete="off"  suffix-icon="el-icon-files" clearable >
                                    <template slot="prepend">入库件数</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
朱兆平 authored
53 54
                            <el-form-item label=" " :label-width="formLabelWidth"  prop="billweight">
                                <el-input v-model="addForm.billweight" autocomplete="off" suffix-icon="el-icon-files" clearable>
朱兆平 authored
55
                                    <template slot="prepend">入库重量</template>
56 57 58 59
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
朱兆平 authored
60 61
                            <el-form-item label=" " :label-width="formLabelWidth"  prop="feeweight">
                                <el-input v-model="addForm.feeweight" autocomplete="off"  suffix-icon="el-icon-files" clearable>
62 63 64 65 66
                                    <template slot="prepend">计费重量</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
朱兆平 authored
67
                            <el-form-item label=" " :label-width="formLabelWidth"  prop="packingid">
68 69 70 71
                                <el-input v-model="addForm.packingid" autocomplete="off"  suffix-icon="el-icon-files" clearable>
                                    <template slot="prepend">包裝类型</template>
                                </el-input>
                                <!--<div class="my-text-area">
朱兆平 authored
72
                                    <div class="el-input-group__prepend prepand">包装类型</div>
朱兆平 authored
73
                                    <el-select v-model="addForm.packingid"
朱兆平 authored
74
                                               placeholder="包装类型"
75 76 77 78 79 80 81 82 83 84 85 86
                                               filterable
                                               default-first-option
                                               :filter-method="packgeOptionsFilter">
                                        <el-option
                                                v-for="item in packgeOptions"
                                                :key="item.code"
                                                :label="item.name"
                                                :value="item.code">
                                            <span style="float: left">{{ item.code }}</span>
                                            <span style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</span>
                                        </el-option>
                                    </el-select>
87
                                </div>-->
88 89
                            </el-form-item>
                        </el-col>
朱兆平 authored
90 91
                    </el-row>
                    <el-row>
92
                        <el-col :span="6">
93
                            <el-form-item label=" " :label-width="formLabelWidth" prop="goodssize">
朱兆平 authored
94
                                <el-tooltip class="item" effect="dark" content="单位:厘米,每行录入一个尺寸信息格式如:1x2x3x4(长x宽x高x件数),回车换行" placement="right">
朱兆平 authored
95
                                    <div class="my-text-area">
朱兆平 authored
96
                                        <div class="el-input-group__prepend prepand">尺&emsp;&emsp;寸</div>
97
                                        <el-input v-model="goodsSize"
朱兆平 authored
98 99
                                                  type="textarea"
                                                  autosize
朱兆平 authored
100
                                                  placeholder="请输入尺寸"
朱兆平 authored
101 102 103 104 105
                                                  style="float: left;width:calc(100% - 89px)"
                                        >
                                        </el-input>
                                    </div>
                                </el-tooltip>
106 107
                            </el-form-item>
                        </el-col>
108
                        <el-col :span="6">
朱兆平 authored
109 110
                            <el-form-item label=" " :label-width="formLabelWidth"  prop="goodsvol">
                                <el-input v-model="addForm.goodsvol" autocomplete="off" suffix-icon="el-icon-files"  disabled>
朱兆平 authored
111 112
                                    <template slot="prepend">入库体积</template>
                                </el-input>
113 114
                            </el-form-item>
                        </el-col>
朱兆平 authored
115 116 117 118 119 120 121 122 123 124 125 126 127 128
                        <el-col :span="6">
                            <el-form-item label=" " :label-width="formLabelWidth"  prop="remark1">
                                    <div class="my-text-area">
                                        <div class="el-input-group__prepend prepand">备&emsp;&emsp;注</div>
                                        <el-input v-model="addForm.remark1"
                                                  type="textarea"
                                                  autosize
                                                  placeholder="备注信息"
                                                  style="float: left;width:calc(100% - 89px)"
                                        >
                                        </el-input>
                                    </div>
                            </el-form-item>
                        </el-col>
朱兆平 authored
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
                    </el-row>
                    <el-divider content-position="left"><i class="el-icon-house"></i> 入库相关</el-divider>
                    <el-row>
<!--                        <el-col :span="6">-->
<!--                            <el-form-item label=" " :label-width="formLabelWidth"  prop="area">-->
<!--                                <el-autocomplete-->
<!--                                        v-model="addForm.area"-->
<!--                                        :fetch-suggestions="areaQuerySearch"-->
<!--                                        placeholder="请输入库区编号"-->
<!--                                        :trigger-on-focus="false"-->
<!--                                        value-key = "areano"-->
<!--                                        clearable-->
<!--                                        highlight-first-item-->
<!--                                        style="width: 100%"-->
<!--                                >-->
<!--                                    <template slot="prepend">库&emsp;&emsp;区</template>-->
<!--                                    <template slot-scope="{ item }">-->
<!--                                        <div class="name" style="float: left">{{ item.areano }}</div>-->
<!--                                        <div class="addr" style="float: right">{{ item.areaname }}</div>-->
<!--                                    </template>-->
<!--                                </el-autocomplete>-->
<!--                            </el-form-item>-->
<!--                        </el-col>-->
152
                        <el-col :span="6">
153
                            <el-form-item label=" " :label-width="formLabelWidth"  prop="location">
154 155 156 157 158 159 160 161 162 163
                                <el-autocomplete
                                        v-model="addForm.location"
                                        :fetch-suggestions="locationQuerySearch"
                                        placeholder="请输入库位编号"
                                        :trigger-on-focus="false"
                                        value-key = "locationno"
                                        clearable
                                        highlight-first-item
                                        style="width: 100%"
                                >
164
                                    <template slot="prepend">库&emsp;&emsp;位</template>
165 166 167 168 169
                                    <template slot-scope="{ item }">
                                        <div class="name" style="float: left">{{ item.locationno }}</div>
                                        <div class="addr" style="float: right">{{ item.locationname }}</div>
                                    </template>
                                </el-autocomplete>
170 171
                            </el-form-item>
                        </el-col>
172
                        <el-col :span="6">
朱兆平 authored
173 174
                            <el-form-item label=" " :label-width="formLabelWidth"  prop="licenseplate">
                                <el-input v-model="addForm.licenseplate" autocomplete="off" suffix-icon="el-icon-files" >
175 176 177 178
                                    <template slot="prepend">运输车辆</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
179
                        <el-col :span="6">
朱兆平 authored
180
                            <el-form-item label=" " :label-width="formLabelWidth"  prop="custcode">
181
                                <el-autocomplete
朱兆平 authored
182
                                        v-model="addForm.custcode"
183
                                        :fetch-suggestions="crmQuerySearch"
朱兆平 authored
184
                                        placeholder="请输入客户代码"
185
                                        :trigger-on-focus="false"
朱兆平 authored
186
                                        value-key = "departmentid"
187 188 189 190
                                        clearable
                                        highlight-first-item
                                        style="width: 100%"
                                >
191
                                    <template slot="prepend">货主名称</template>
192 193 194 195 196 197 198 199
                                    <template slot-scope="{ item }">
                                        <div class="name" style="float: left">{{ item.departmentid }}</div>
                                        <div class="addr" style="float: right">{{ item.roleName }}</div>
                                    </template>
                                </el-autocomplete>
                            </el-form-item>
                        </el-col>
                        <el-col :span="6">
200
                            <el-form-item label=" " :label-width="formLabelWidth"  prop="opter">
201
                                <el-input v-model="addForm.opter" autocomplete="off"  disabled suffix-icon="el-icon-files">
202
                                    <template slot="prepend">经&nbsp;办&nbsp;人</template>
203 204 205
                                </el-input>
                            </el-form-item>
                        </el-col>
206
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240
                    </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"  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">
                                <el-input v-model="addForm.opttime" autocomplete="off"  style="width: 300px">
                                    <template slot="prepend">出入库时间</template>
                                </el-input>
                                <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:300px"
                                        placeholder="选择出入库时间">
                                </el-date-picker>
                            </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"  style="width: 300px">
                                    <template slot="prepend">出入库场站</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                   </el-row>
-->
朱兆平 authored
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 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284
<!--                    <el-divider content-position="left"><i class="el-icon-mobile-phone"></i> 业务属性</el-divider>-->
<!--                    <el-row>-->
<!--                        <el-col :span="6">-->
<!--                            <el-form-item label=" " :label-width="formLabelWidth"  prop="transtype">-->
<!--                                <div class="my-text-area">-->
<!--                                    <div class="el-input-group__prepend prepand">交易类型</div>-->
<!--                                    <el-select v-model="addForm.transtype" placeholder="请选择交易类型"  autocomplete="off">-->
<!--                                        <el-option-->
<!--                                                v-for="item in options1"-->
<!--                                                :key="item.value"-->
<!--                                                :label="item.label"-->
<!--                                                :value="item.value">-->
<!--                                        </el-option>-->
<!--                                    </el-select>-->
<!--                                </div>-->
<!--                            </el-form-item>-->
<!--                        </el-col>-->
<!--                        <el-col :span="6">-->
<!--                            <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">-->
<!--                                        <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">-->
<!--                                        <el-option label="出入库类型-进" value="I"></el-option>-->
<!--                                        <el-option label="出入库类型-出" value="E"></el-option>-->
<!--                                    </el-select>-->
<!--                                </div>-->
<!--                            </el-form-item>-->
<!--                        </el-col>-->
<!--                    </el-row>-->
285
                    <el-divider content-position="left"><i class="el-icon-picture-outline"></i>图像操作</el-divider>
286
                    <el-row>
朱兆平 authored
287
                        <el-col :span="12">
朱兆平 authored
288 289
                            <el-form-item label=" " :label-width="formLabelWidth"  prop="annex">
                                <el-input v-model="addForm.annex" autocomplete="off"  suffix-icon="el-icon-document" clearable>
290 291
                                    <template slot="prepend">图片地址</template>
                                </el-input>
朱兆平 authored
292
293 294
                            </el-form-item>
                        </el-col>
朱兆平 authored
295 296 297 298 299
                        <el-col :span="12">
                            <el-button-group style="float:right">
                                <el-button type="success" icon="el-icon-camera"  @click="imgdrawerVisible = true">入库图像采集</el-button>
                                <el-button type="warning" icon="el-icon-edit"  @click="otherDrawerVisible = true">其他入库信息</el-button>
                            </el-button-group>
300 301 302
                        </el-col>

<!--                        <el-col :span="8">-->
303 304 305 306 307 308 309 310 311 312 313
                            <!--                                <el-form-item label="" :label-width="formLabelWidth"  prop="status">-->
                            <!--                                    <el-input v-model="addForm.status" autocomplete="off"  style="width: 300px">-->
                            <!--                                        <template slot="prepend">状&emsp;&emsp;态</template>-->
                            <!--                                    </el-input>-->
                            <!--                                </el-form-item>-->
<!--                            <el-form-item label="" :label-width="formLabelWidth"  prop="status">-->
<!--                                <el-select v-model="addForm.status" placeholder="请选择状态" size="mini" style="width: 300px">-->
<!--                                    <el-option label="状态-失败" value="0"></el-option>-->
<!--                                    <el-option label="状态-成功" value="1"></el-option>-->
<!--                                </el-select>-->
<!--                            </el-form-item>-->
314
<!--                        </el-col>-->
315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333
                    </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"  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"  style="width: 300px">
                                    <template slot="prepend">出入库客户联系人姓名</template>
                                </el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>-->
                </el-form>
            </el-row>
334
            <!--            搜索区域-->
朱兆平 authored
335 336 337 338
            <el-row class="toolbar">
                <el-col :span="24">
                    <el-button type="success" icon="el-icon-download"  @click="batchAdd()">批量入库</el-button>
                    <el-button type="primary" icon="el-icon-right"  @click="nextBill()" style="float:right">下一票</el-button>
339 340 341 342
                </el-col>
            </el-row>
            <!--            列表区域-->
            <el-row>
343
                <el-table
344 345
                            :data="tableData"
                            border
346
                            @selection-change="trnSelectionChange"
347 348
                            :cell-style="{textAlign:'center'}"
                            style="border-radius: 10px 10px 0px 0px;line-height: 25px"
朱兆平 authored
349 350
                            show-summary
                            :summary-method="getSummaries"
351
                            :header-cell-style="{background:'#6F8294',color:'#FFFFFF'}"
352
                    >
353 354 355 356 357 358
                    <el-table-column
                            type="selection"
                            :selectable="checkSelectable"
                            fixed="left"
                            width="55"
                    />
朱兆平 authored
359 360
                    <el-table-column
                            fixed
朱兆平 authored
361 362 363 364 365 366
                            prop="serialnumber"
                            label="流水号"
                    >
                    </el-table-column>
                    <el-table-column
                            fixed
朱兆平 authored
367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382
                            prop="waybill"
                            label="主单号"
                            width="120">
                        <template slot-scope="scope">
                            {{scope.row.waybill}}
                        </template>
                    </el-table-column>
                    <el-table-column
                            fixed
                            prop="waybill"
                            label="分单号"
                            width="120">
                        <template slot-scope="scope">
                            {{scope.row.billfhl}}
                        </template>
                    </el-table-column>
383 384
                    <el-table-column
                            prop="pcs"
朱兆平 authored
385
                            label="入库件数"
朱兆平 authored
386
                            width="70">
387 388
                    </el-table-column>
                    <el-table-column
朱兆平 authored
389 390
                            prop="billweight"
                            label="入库重量"
朱兆平 authored
391
                            width="70">
392
                    </el-table-column>
朱兆平 authored
393 394 395 396 397 398 399 400
                    <el-table-column
                            prop="feeweight"
                            label="计费重量"
                            width="70">
                    </el-table-column>
                    <el-table-column
                            prop="goodssize"
                            label="尺寸"
朱兆平 authored
401
                    >
朱兆平 authored
402
                    </el-table-column>
朱兆平 authored
403 404 405
                    <el-table-column
                            prop="goodsvol"
                            label="入库体积"
朱兆平 authored
406
                            width="100">
朱兆平 authored
407
                    </el-table-column>
朱兆平 authored
408 409 410 411 412
<!--                        <el-table-column-->
<!--                                prop="area"-->
<!--                                label="库区"-->
<!--                                width="60">-->
<!--                        </el-table-column>-->
413 414 415 416 417
                        <el-table-column
                                prop="location"
                                label="库位"
                                width="60">
                        </el-table-column>
朱兆平 authored
418 419 420 421 422
<!--                        <el-table-column-->
<!--                                prop="station"-->
<!--                                label="出入库场站"-->
<!--                                width="100">-->
<!--                        </el-table-column>-->
朱兆平 authored
423 424 425 426 427 428 429 430 431
<!--                        <el-table-column-->
<!--                                prop="status"-->
<!--                                label="状态"-->
<!--                                width="80">-->
<!--                            <template slot-scope="scope">-->
<!--                                <span v-if="scope.row.status ==='0'">失败</span>-->
<!--                                <span v-if="scope.row.status ==='1'">成功</span>-->
<!--                            </template>-->
<!--                        </el-table-column>-->
432
                        <el-table-column
朱兆平 authored
433
                                prop="licenseplate"
朱兆平 authored
434
                                label="运输车辆"
435 436
                                width="100">
                        </el-table-column>
437
<!--                        <el-table-column-->
朱兆平 authored
438 439 440 441 442
<!--                                prop="transtype"-->
<!--                                label="交易类型"-->
<!--                                width="100">-->
<!--                        </el-table-column>-->
<!--                        <el-table-column-->
443 444 445 446 447 448 449 450 451
<!--                                prop="custel"-->
<!--                                label="客户联系电话"-->
<!--                                width="140">-->
<!--                        </el-table-column>-->
<!--                        <el-table-column-->
<!--                                prop="customer"-->
<!--                                label="联系人姓名"-->
<!--                                width="100">-->
<!--                        </el-table-column>-->
452
                        <el-table-column
朱兆平 authored
453 454
                                prop="custcode"
                                label="客户代码"
455 456
                                width="80">
                        </el-table-column>
朱兆平 authored
457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475
<!--                        <el-table-column-->
<!--                                prop="goodstype"-->
<!--                                label="货物类型"-->
<!--                                width="80">-->
<!--                        </el-table-column>-->
<!--                        <el-table-column-->
<!--                                prop="house"-->
<!--                                label="出入库仓库"-->
<!--                                width="100">-->
<!--                        </el-table-column>-->
<!--                        <el-table-column-->
<!--                                prop="ietype"-->
<!--                                label="类型"-->
<!--                                width="60">-->
<!--                            <template slot-scope="scope">-->
<!--                                <span v-if="scope.row.ietype ==='I'">进</span>-->
<!--                                <span v-if="scope.row.ietype ==='E'">出</span>-->
<!--                            </template>-->
<!--                        </el-table-column>-->
476 477 478 479 480 481 482 483 484 485 486 487 488 489
                        <el-table-column
                                prop="opter"
                                label="出入库经办人"
                                width="100">
                        </el-table-column>
                        <el-table-column
                                prop="opttime"
                                label="出入库时间"
                                width="140">
                        </el-table-column>
                        <el-table-column
                                fixed="right"
                                label="操作"
                                width="160">
朱兆平 authored
490 491 492
                            <template slot="header" slot-scope="scope">
                                <el-button type="success" icon="el-icon-check"  @click="applyAdd()">入&emsp;&emsp;库</el-button>
                            </template>
493
                            <template slot-scope="scope">
朱兆平 authored
494
                                <el-row type="flex" justify="center">
朱兆平 authored
495 496
                                    <Print :wmsInfo = "scope.row"></Print>
                                </el-row>
朱兆平 authored
497
                                <el-row type="flex" justify="space-between">
朱兆平 authored
498 499 500
                                    <el-button type="success" size="mini" @click="applyEdit(scope.row)">编辑</el-button>
                                    <el-button type="danger" size="mini" @click="applyDel(scope.$index,scope.row)">移除</el-button>
                                </el-row>
501 502 503 504
                            </template>
                        </el-table-column>
                    </el-table>
            </el-row>
朱兆平 authored
505 506 507 508 509 510 511 512 513 514 515
<!--            <el-row style="margin-top: 10px" class="toolbar">-->
<!--                <el-pagination-->
<!--                        @size-change="handleSizeChange"-->
<!--                        @current-change="handleCurrentChange"-->
<!--                        :current-page="queryInfo.pageNum"-->
<!--                        :page-size="queryInfo.pageSize"-->
<!--                        :page-sizes="[10, 50, 100, 500]"-->
<!--                        layout="total, sizes, prev, pager, next, jumper"-->
<!--                        :total="total">-->
<!--                </el-pagination>-->
<!--            </el-row>-->
516
        </el-card>
517 518
        <el-drawer
                title="我是标题"
519
                :visible.sync="imgdrawerVisible"
520 521 522 523
                :with-header="false">
            <video width="100%" height="200" autoplay loop controls id="videos">
                <source src="/static/login/New-jumbo.mp4" type="video/mp4">
            </video>
朱兆平 authored
524 525
            <el-row>
                <el-image
526 527 528 529 530 531 532
                        :src="imgBase64"
                        style="width: 200px; height: 200px"
                        fit="fill">
                    <div slot="error" class="image-slot">
                        未截图<i class="el-icon-picture-outline"></i>
                    </div>
                </el-image>
朱兆平 authored
533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550
            </el-row>
            <el-button type="success" class="btns" @click="screenshot">一键截屏上传</el-button>
<!--            <el-upload-->
<!--                    class="upload-demo"-->
<!--                    drag-->
<!--                    action=""-->
<!--                    :headers="uploadHeaderObj"-->
<!--                    :on-success="handleUploadSuccess"-->
<!--                    :auto-upload="false"-->
<!--                    :on-change="submitUpload"-->
<!--                    ref="upload"-->
<!--            >-->
<!--                <i class="el-icon-upload avatar-uploader-icon"></i>-->
<!--                <div class="el-upload__text">将文件拖到此处,或<em>点击上传文件</em></div>-->
<!--                <div class="el-upload__tip" slot="tip">只能上传xml文件,且不超过2MB</div>-->
<!--            </el-upload>-->
<!--            <el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传到服务器</el-button>-->
551
        </el-drawer>
552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634
        <el-drawer
                title="其他入库信息"
                :visible.sync="otherDrawerVisible"
                :with-header="false">
            <el-row style="margin-top:0;padding-top:0">
                <el-card shadow="always" >
                    <div slot="header" class="clearfix">
                        <span>随货文件</span>
                        <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>
                    </div>
                    <el-switch
                            v-model="addForm.hasFiles"
                            active-text="有随货文件"
                            inactive-text="无随货文件"
                            active-color="#13ce66"
                            inactive-color="#ff4949"
                    >
                    </el-switch>
                    <el-card shadow="always" style="margin-top:10px;" v-if="addForm.hasFiles">
                        <el-checkbox-group v-model="addForm.files" @change="handleCheckedfilessChange">
                            <el-checkbox v-for="filename in flieOptions" :label="filename" :key="filename">{{filename}}</el-checkbox>
                        </el-checkbox-group>
                    </el-card>
                </el-card>

            </el-row>
            <el-row>
                <el-card shadow="always" >
                    <div slot="header" class="clearfix">
                        <span>异常状况</span>
                        <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>
                    </div>
                    <el-switch
                            v-model="addForm.hasUnusual"
                            active-text="有异常"
                            inactive-text="无异常"
                            active-color="#13ce66"
                            inactive-color="#ff4949"
                    >
                    </el-switch>
                    <el-card shadow="always" style="margin-top:10px;" v-if="addForm.hasUnusual">
                        <el-checkbox-group v-model="addForm.unusuals" @change="handleCheckedfilessChange">
                            <el-checkbox v-for="op in unusualOptions" :label="op" :key="op">
                                {{op}}
                            </el-checkbox>
                        </el-checkbox-group>
                    </el-card>
                </el-card>
            </el-row>
            <el-row>
                <el-card shadow="always" >
                    <div slot="header" class="clearfix">
                        <span>破损状况</span>
                        <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>
                    </div>
                    <el-card shadow="always" style="margin-top:10px;">
                        <el-checkbox-group v-model="addForm.damages" @change="handleCheckedfilessChange">
                            <el-checkbox v-for="op in damageOptions" :label="op" :key="op">
                                {{op}}
                            </el-checkbox>
                        </el-checkbox-group>
                    </el-card>
                </el-card>
            </el-row>
            <el-row>
                <el-card shadow="always" >
                    <div slot="header" class="clearfix">
                        <span>特殊操作情况</span>
                        <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>
                    </div>
                    <el-card shadow="always" style="margin-top:10px;">
                        <el-checkbox-group v-model="addForm.sphCodes" @change="handleCheckedfilessChange">
                            <el-checkbox v-for="op in SPHOptions" :label="op.code" :key="op.code" border>
                                <template>
                                 ({{op.code}}){{op.desCn}}
                                </template>
                            </el-checkbox>
                        </el-checkbox-group>
                    </el-card>
                </el-card>
            </el-row>

        </el-drawer>
635 636 637 638
    </el-row>
</template>

<script>
639 640
    import {
        selectInventroyrecords,
朱兆平 authored
641
        batchImpNewinventroyrecord,
642
        ediInventroyrecord,
643 644 645
        selectAreas,
        selectLocations,
        getSPHCode
646
    } from '../../api/consigner/station';
647 648
    import dateUtil from "@/utils/index"
    import jsutil from "@/common/js/util";
649
    import { getList as getCRMList } from '@/api/crm_api';
650
    import { loginedUserInfo } from '@/api/user';
朱兆平 authored
651 652
    import html2canvas from 'html2canvas'
    import {uploadPath,upfileWithPost} from "../../api/technological";
653 654 655
    import packge from '@/api/nmms/packge'
    import unusualOP from '@/api/wms/unusualOptions'
    import damageOP from '@/api/wms/damageOptions'
朱兆平 authored
656
    import Print from '@/components/Print'
657
658 659 660

    export default {
        name: "inventroyrecord",
朱兆平 authored
661
        components:{Print},
662
        data() {
朱兆平 authored
663
            var checkInputArea = (rule, value, callback) => {
朱兆平 authored
664 665 666 667
                let err = {
                    name:'',
                    message:''
                }
朱兆平 authored
668
                let _this = this
朱兆平 authored
669 670
                let tempVol = 0
                if (!value) {
朱兆平 authored
671 672
                    err  = new Error('体积信息必填')
                    return callback(err);
朱兆平 authored
673 674
                }
                setTimeout(() => {
675
                    value = value.replaceAll('*','x')
朱兆平 authored
676 677
                    var lineStr = value.replace('\r').split('\n')
                    lineStr.forEach(((v,index) => {
朱兆平 authored
678
                        // eslint-disable-next-line no-useless-escape
朱兆平 authored
679
                        var pattern = /^[0-9\.]+[xX][0-9\.]+[xX][0-9\.]+[xX][0-9\.]+$/;
朱兆平 authored
680
                        if(!pattern.test(v)){
朱兆平 authored
681
                            err  = new Error('行'+(index+1)+'的值:'+v+'的体积格式输入错误,格式为1x1x1x1支持小数点')
朱兆平 authored
682
                            return callback(err);
朱兆平 authored
683 684 685 686 687 688
                        }else {
                            const volV = this.multiply(v)
                            tempVol += volV
                        }
                    }))
朱兆平 authored
689
                    console.log(err.name + '  '+ err.message)
朱兆平 authored
690
                    callback();
朱兆平 authored
691
                    if (err && err.message===''){
朱兆平 authored
692
                        _this.addForm.goodsvol = (tempVol/1000000).toFixed(2)
朱兆平 authored
693 694 695
                        _this.volAreatextMerge(lineStr)
                    }
朱兆平 authored
696 697
                }, 200);
            };
698 699 700
            return {
                queryInfo: {
                    waybill:'',
701
                    serialnumber:'',
702 703 704 705 706 707 708
                    // 当前页数
                    pageNum: 1,
                    // 每页大小
                    pageSize: 10,
                },
                total: 0,
                tableData:[],
709 710 711
                areaData:[],
                locationData:[],
                roles:[],
朱兆平 authored
712 713 714 715 716 717
                imgBase64:'',
                imgUploadPath:uploadPath,
                uploadFileList:[],
                uploadHeaderObj: {
                    Authorization: window.sessionStorage.getItem("token"),
                },
718 719 720 721 722 723 724 725 726 727 728
                dialogMap: {
                    update: '编辑',
                    create: '新增'
                },
                dialogApply: 'create',
                apply_dialog: {
                    // 添加对话框
                    addDialog: false,
                    // 编辑对话框
                    editDialog: false
                },
729 730
                imgdrawerVisible: false,
                otherDrawerVisible: false,
731 732
                addForm: {
                    area: '',
朱兆平 authored
733
                    feeweight: 0,
734 735
                    custel: '',
                    customer: '',
朱兆平 authored
736
                    custcode: '',
737
                    goodstype: '运单',
738
                    house:'',
739
                    ietype:'I',
740 741 742
                    location:'',
                    opter:'',
                    opttime: '',
朱兆平 authored
743
                    pcs: 0,
朱兆平 authored
744
                    totalpcs:0,
745 746 747
                    serialnumber: '',
                    station: '',
                    status: '',
朱兆平 authored
748
                    licenseplate: '',
749
                    transtype:'销售入库',
朱兆平 authored
750 751
                    goodssize:'',
                    goodsvol:0,
朱兆平 authored
752 753
                    waybill:'',
                    billfhl:'',
754 755 756 757 758 759 760
                    //随货文件
                    hasFiles:false,
                    hasUnusual:false,
                    unusuals:[],
                    files:[],
                    damages:[],
                    sphCodes:[],
朱兆平 authored
761 762 763
                    billweight:0,
                    totalweight:0,
                    packingid:'',
764 765 766 767 768 769
                    remark:'',
                    remark1:'',
                    remark2:'',
                    remark3:'',
                    remark4:'',
                    remark5:'',
朱兆平 authored
770
                    annex:''
771
                },
772
                packgeOptions:packge,
773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792
                options: [{
                    value: '板箱',
                    label: '货物类型-板箱'
                }, {
                    value: '运单',
                    label: '货物类型-运单'
                }, {
                    value: '托盘',
                    label: '货物类型-托盘'
                }],
                options1: [{
                    value: '采购入库',
                    label: '交易类型-采购入库'
                }, {
                    value: '生产入库',
                    label: '交易类型-生产入库'
                }, {
                    value: '销售入库',
                    label: '交易类型-销售入库'
                }],
793
                formLabelWidth: '5px',
794 795 796 797
                flieOptions:['报关单证','关封','运单','信封','保函','安检申报清单','随机文件','备案清单','放行通知书','货物运输条件鉴定书(磁化/化工品)','其他'],
                unusualOptions:unusualOP,
                damageOptions:damageOP,
                SPHOptions:[],
798
                rules: {
朱兆平 authored
799
                    waybill:[
800 801
                        { pattern: /^[0-9\-]+$/, message: '主单号格式只支持数字与-符号' }
                    ],
朱兆平 authored
802
                    billfhl:[
803 804
                        { pattern: /^[0-9A-Z]+$/, message: '分单号格式只支持数字与大写字母' }
                    ],
805
                    pcs: [
朱兆平 authored
806
                            { required: true, message: '入库件数必填', trigger: 'blur' },
807 808
                            { type:"number", message: '件数必须为整数'}
                    ],
朱兆平 authored
809 810
                    billweight: [
                        {  required: true, message: '入库重量为必填项', trigger: 'blur' },
811 812 813
                        // eslint-disable-next-line no-useless-escape
                        { pattern: /^([0-9]+)(\.\d{2})?$/, message: '只允许输入数字与小数,支持到小数点后两位' }
                    ],
朱兆平 authored
814
                    feeweight: [
815 816
                        { pattern: /^([0-9]+)(\.\d{2})?$/, message: '只允许输入数字与小数,支持到小数点后两位' }
                    ],
817 818
                    area: [
                        { required: true, message: '库区为必填项', trigger: 'blur' }
819
                    ],
820 821 822
                    location: [
                        { required: true, message: '库位为必填项', trigger: 'blur' }
                    ],
朱兆平 authored
823
                    custcode: [
824 825 826 827
                        { required: true, message: '货主名称为必填项', trigger: 'blur' }
                    ],
                    opter: [
                        { required: true, message: '必须包含经办人信息', trigger: 'blur' }
朱兆平 authored
828
                    ],
朱兆平 authored
829 830
                    goodssize:[
                        {  required: true, message: '尺寸信息必填', trigger: 'blur' },
朱兆平 authored
831
                        {  validator: checkInputArea,  trigger: 'blur' }
朱兆平 authored
832
                        // { pattern: /^[0-9\.x]+$/gm, message: '体积信息只能输入数字和(.)点符号与x小写字母' }
朱兆平 authored
833
                    ],
834 835 836
                    // packingid:[
                    //     {  required: true, message: '包装信息必选', trigger: 'blur' }
                    // ]
837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867
                },
            }
        },
        methods: {
            handleSizeChange(val) {
                this.queryInfo.pageSize = val
                this.getList()
            },
            handleCurrentChange(val) {
                this.queryInfo.pageNum = val
                this.getList()
            },
            getList() {
                const _this = this
                selectInventroyrecords(this.queryInfo).then((response) => {
                    const res = response.data
                    if (res.code !== '200') {
                        return _this.$message.error('获取消息收发记录,失败!')
                    }
                    // 获取列表数据
                    _this.tableData = res.data.list
                    // 获取列表的总记录数
                    _this.total = res.data.total
                    _this.$message.success('获取消息收发记录,成功!')
                }).catch(error => {
                    // 关闭加载
                    _this.$message.error(error.toString())
                })
            },
            // 添加对话框,打开事件
            applyAdd() {
朱兆平 authored
868 869 870 871 872 873 874 875 876 877 878
                let ld = this.$loading({
                    text:"入库中..."
                })
                batchImpNewinventroyrecord(this.tableData).then((response) => {
                    let res = response.data;
                    // 添加失败
                    if (res.code !== '200') {
                        return this.$message.error(res.msg);
                    }
                    // 添加,成功
                    this.$message.success(res.msg);
朱兆平 authored
879
                    this.tableData = [];
朱兆平 authored
880 881 882 883 884
                }).catch(error => {
                    this.$message.error(error.toString());
                }).finally(()=>{
                    ld.close()
                });
885
            },
886 887 888 889
            batchAdd(){
                this.$refs.addForm.validate(valid => {
                    // 未通过,表单预校验
                    if (!valid) return;
890
                    const  wmslog = Object.assign({},this.addForm)
朱兆平 authored
891
                    wmslog.opttime = new Date().format('yyyy-MM-dd hh:mm:ss')
892 893
                    this.tableData.push(wmslog)
                    this.addForm.serialnumber = this.serialNumber()
894
                    this.addForm.damages=[]
895
                    this.addForm.files=[]
896 897
                })
            },
898 899 900 901 902
            // 添加功能
            add() {
                this.$refs.addForm.validate(valid => {
                    // 未通过,表单预校验
                    if (!valid) return;
朱兆平 authored
903
                    batchImpNewinventroyrecord(this.addForm).then((response) => {
904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950
                        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());
                    });
                })
            },
// 打开编辑
            applyEdit(row) {
                this.apply_dialog.addDialog = true;
                this.dialogApply = 'update';
                this.addForm=row;
            },
            // 编辑功能
            edit() {
                // 进行表单的预验证
                this.$refs.addForm.validate(valid => {
                    // 未通过,表单预校验
                    if (!valid) return
                    ediInventroyrecord(this.addForm).then((response) => {
                        // console.log(row)
                        const 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())
                    })
                })
            },
            // 删除
            applyDel(index, row) {
                // 弹框询问是否删除?
朱兆平 authored
951
                this.$confirm('此操作永久删除该记录, 是否继续?', '警告', {
952 953 954 955 956
                        confirmButtonText: '确定删除',
                        cancelButtonText: '取消',
                        type: 'warning'
                    }
                ).then(() => {
朱兆平 authored
957 958
                    console.log('del'+index);
                    this.tableData.splice(index, 1)
959 960 961
                }).catch(() => {
                })
            },
962 963 964 965
            serialNumber:()=>{
                let serialDate= new Date();
                let serialCode = serialDate.format("yyyyMMddhhmmssS")
                return serialCode
966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029
            },
            getAreaList() {
                const _this = this
                let para = {
                        // 当前页数
                        pageNum: 1,
                        // 每页大小
                        pageSize: 1000,
                }
                let ld = this.$loading({
                    text:"库区数加载中..."
                })
                selectAreas(para).then((response) => {
                    const res = response.data
                    if (res.code !== '200') {
                        return _this.$message.error('获取库区记录,失败!')
                    }
                    // 获取列表数据
                    _this.areaData = res.data.list
                    _this.$message.success('获取库区记录,成功!')
                }).catch(error => {
                    // 关闭加载
                    _this.$message.error(error.toString())
                }).finally(()=>{
                    ld.close()
                })
            },
            areaQuerySearch(queryString, cb) {
                var restaurants = this.areaData;
                var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
                // 调用 callback 返回建议列表的数据
                cb(results);
            },
            createFilter(queryString) {
                return (restaurant) => {
                    return (restaurant.areano.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
                };
            },
            getLocationList() {
                const _this = this
                let para = {
                    // 当前页数
                    pageNum: 1,
                    // 每页大小
                    pageSize: 1000,
                }
                let ld = this.$loading({
                    text:"库位数加载中..."
                })
                selectLocations(para).then((response) => {
                    const res = response.data
                    if (res.code !== '200') {
                        return _this.$message.error('获取库位记录,失败!')
                    }
                    // 获取列表数据
                    _this.locationData = res.data.list
                    _this.$message.success('获取库位记录,成功!')
                }).catch(error => {
                    // 关闭加载
                    _this.$message.error(error.toString())
                }).finally(()=>{
                    ld.close()
                })
            },
1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044
            getSPHCode() {
                const _this = this
                let ld = this.$loading({
                    text:"特货代码数加载中..."
                })
                getSPHCode({}).then((response) => {
                    const res = response.data
                    if (res.code !== '200') {
                        return _this.$message.error('获取特货代码记录,失败!')
                    }
                    // 获取列表数据
                    _this.SPHOptions = res.data
                    _this.$message.success('获取特货代码记录,成功!')
                }).catch(error => {
                    // 关闭加载
朱兆平 authored
1045
                    _this.$message.error('获取特货代码记录,失败!'+error.toString())
1046 1047 1048 1049
                }).finally(()=>{
                    ld.close()
                })
            },
1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099
            locationQuerySearch(queryString, cb){
                var restaurants = this.locationData;
                var results = queryString ? restaurants.filter(this.locationFilter(queryString)) : restaurants;
                // 调用 callback 返回建议列表的数据
                cb(results);
            },
            locationFilter(queryString) {
                return (restaurant) => {
                    return (restaurant.locationno.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
                };
            },
            getRoles() {
                let _this= this;
                let ld = this.$loading({
                    text:"客户数据加载中..."
                })
                getCRMList({},1,2000).then((response) => {
                    const res = response.data
                    if (res.code !== '200') {
                        return _this.$message.error('获取库位记录,失败!')
                    }
                    // 获取列表数据
                    _this.roles = res.data.list
                    _this.$message.success('获取客户数据,成功!')
                }).catch((error) => {
                    if(null!= error.response && error.response!==undefined){
                        let status= error.response.status;
                        let msg = error.response.statusText;
                        return _this.$message.error(status+msg)
                    }else {
                        return _this.$message.error(error.toString())
                    }
                }).finally(()=>{
                    ld.close()
                });

            },
            crmQuerySearch(queryString, cb){
                var restaurants = this.roles;
                var results = queryString ? restaurants.filter(this.crmFilter(queryString)) : restaurants;
                // 调用 callback 返回建议列表的数据
                cb(results);
            },
            crmFilter(queryString) {
                return (restaurant) => {
                    if (restaurant.departmentid){
                        return (restaurant.departmentid.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
                    }
                };
            },
1100
            screenshot(){
朱兆平 authored
1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137
                let video = document.getElementById('videos')
                html2canvas(video, {
                    allowTaint: true,
                    useCORS: true
                }).then((canvas) => {
                    // base64
                    this.imgBase64 = canvas.toDataURL('image/png')
                    // 下载方法1,浏览器弹出下载文件提示
                    const saveInfo = {
                        // 导出文件格式自己定义
                        'download': '文件名' + '.png',
                        'href': this.imgBase64
                    }
                    const element = document.createElement('a')
                    element.style.display = 'none'
                    for (const key in saveInfo) {
                        element.setAttribute(key, saveInfo[key])
                    }
                    document.body.appendChild(element)
                    // element.click()
                    setTimeout(() => {
                        document.body.removeChild(element)
                    }, 300)
                    this.uploadFile(this.imgBase64)
                })
            },
            // 接口上传
            uploadFile(imgBase64){
                const base64List = imgBase64.split(',')[1]
                const raw = window.atob(base64List)
                const rawLength = raw.length
                const uInt8Array = new Uint8Array(rawLength)
                for (let i = 0; i < rawLength; ++i) {
                    uInt8Array[i] = raw.charCodeAt(i)
                }
                // 若需上传,将base64转为file文件
                const blob = new Blob([uInt8Array], { type: 'image/png' })
朱兆平 authored
1138 1139
                const filename = this.serialNumber()+'';
                let fileOfBlob = new File([blob], filename + '.png')
朱兆平 authored
1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152
                // this.submitUpload(fileOfBlob);
                var formData = new FormData()
                formData.append('file', fileOfBlob)
                this.submitUpload(formData);
            },
            //上传文件
            handleUploadSuccess: function(response, file, fileList){
                let res = response.data;
                if (response.code !== '200') {
                    // 关闭加载
                    return this.$message.error(response.msg);
                }
                this.$message.success(res.msg);
朱兆平 authored
1153
                this.addForm.annex = res.data.relativePath
朱兆平 authored
1154 1155 1156

            },
            submitUpload(formData){
朱兆平 authored
1157
                const fileServiceName = '/api/wlpt-custom-service-workflow/'
朱兆平 authored
1158 1159 1160 1161 1162 1163 1164 1165 1166 1167
                let ld = this.$loading({
                    text:"图片数据上传中..."
                })
                upfileWithPost(formData).then((response)=>{
                    let res = response.data;
                    if (res.code !== '200') {
                        // 关闭加载
                        return this.$message.error(res.msg);
                    }
                    this.$message.success(res.msg);
朱兆平 authored
1168
                    this.addForm.annex = fileServiceName + res.data.relativePath
朱兆平 authored
1169 1170 1171 1172 1173 1174 1175 1176 1177
                }).finally(()=>{
                    ld.close()
                })
                // this.$refs.upload.submit();
            },
            trnSelectionChange(){

            },
            checkSelectable(){
1178
1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201
            },
            handleCheckedfilessChange(value){
                console.log(JSON.stringify(value))
            },
            packgeOptionsFilter(searchStr){
                let tempIndex = -1
                if (searchStr){
                    this.packgeOptions = packge.filter((item,index,arr) =>{
                         if (item.code.toLocaleUpperCase().indexOf(searchStr.toLocaleUpperCase()) > -1){
                             tempIndex = index
                             return true
                         }else{
                             return false
                         }
                    })
                    if (tempIndex === -1){
                        this.packgeOptions = packge
                    }
                }else {
                    this.packgeOptions = packge
                }

朱兆平 authored
1202 1203
            },
            multiply(str){
朱兆平 authored
1204
                var everyNum = str.replaceAll('X','x').split('x');
朱兆平 authored
1205 1206 1207 1208 1209
                let tempNum = 1;
                everyNum.forEach(item =>{
                    tempNum = tempNum*item
                })
                return tempNum;
朱兆平 authored
1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239
            },
            /**
             * 每行相同的体积数据进行合并
             */
            volAreatextMerge(strArr){
                if (strArr){
                    let newArray = strArr.reduce((total, cur, index) => {
                        let hasValue = total.findIndex(current => {
                            //这里查找长x宽x高 一样的元素
                            return current === cur
                        })
                        //没找到重复元素 入到临时数组
                        hasValue === -1 && total.push(cur)

                        let piece = 0
                        //找到重复元素
                        if(hasValue !== -1 ) {
                            // total[hasValue] = total[hasValue].sl + cur.sl
                            //累加重复元素的件数
                            //1.获取需要累加的重复元素的件数
                            piece += total[hasValue].split('x')[3]
                            console.log("重复元素"+hasValue)
                            console.log("重复元素总件数"+piece)
                        }
                        return total
                    }, [])
                    console.log(newArray)
                }else{
                    this.$message.error("合并体积录入数据出错")
                }
朱兆平 authored
1240
            },
朱兆平 authored
1241 1242 1243 1244 1245 1246
            nextBill(){
                this.$refs.addForm.resetFields()
                this.initUserInfo()
                this.tableData = []

            },
朱兆平 authored
1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265
            getSummaries(param) {
                const { columns, data } = param;
                const sums = [];
                columns.forEach((column, index) => {
                    if (index === 0) {
                        sums[index] = '合计';
                        return;
                    }
                    const values = data.map(item => {
                        if (column.property==='billweight' || column.property==='feeweight' || column.property==='pcs' || column.property==='goodsvol'){
                            return  Number(item[column.property])
                        }else {
                            return undefined
                        }
                    });
                    if (!values.every(value => isNaN(value))) {
                        sums[index] = values.reduce((prev, curr) => {
                            const value = Number(curr);
                            if (!isNaN(value)) {
朱兆平 authored
1266 1267
                                const r = Number(prev) + Number(curr)
                                return new Number(r).toFixed(2);
朱兆平 authored
1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278
                            } else {
                                return prev;
                            }
                        }, 0);
                        sums[index] += '';
                    } else {
                        sums[index] = '';
                    }
                });

                return sums;
朱兆平 authored
1279 1280 1281 1282 1283 1284 1285 1286
            },
            initUserInfo(){
                let userinfo = loginedUserInfo();
                if (!jsutil.checkNull(userinfo) && !jsutil.checkNull(userinfo.username)){
                    this.$message.error("获取用户信息出错")
                }else{
                    this.addForm.opter = userinfo.username
                }
1287
            }
1288 1289
        },
        mounted() {
朱兆平 authored
1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331
            this.addForm = {
                        area: '',
                        feeweight: 22.68,
                        custel: '',
                        customer: '',
                        custcode: 'APX',
                        goodstype: '运单',
                        house:'',
                        ietype:'I',
                        location:'hx001',
                        opter:'wuliu',
                        opttime: '',
                        pcs: 17,
                        totalpcs:113,
                        serialnumber: '',
                        station: '',
                        status: '',
                        licenseplate: '豫A61CR7',
                        transtype:'销售入库',
                        goodssize:'120x230x78x17',
                        goodsvol:36.60,
                        waybill:'172-12345678',
                        billfhl:'FILE788',
                        //随货文件
                        hasFiles:false,
                        hasUnusual:false,
                        unusuals:[],
                        files:[],
                        damages:[],
                        sphCodes:[],
                        billweight:12.34,
                        totalweight:2573,
                        packingid:'PK',
                        remark:'',
                        remark1:'备注',
                        remark2:'',
                        remark3:'',
                        remark4:'',
                        remark5:'',
                        annex:''
            }
1332 1333 1334
            this.getAreaList();
            this.getLocationList();
            this.getRoles();
1335
            this.getSPHCode()
1336
            this.addForm.serialnumber = this.serialNumber()
朱兆平 authored
1337
            this.initUserInfo()
1338 1339
        },
        computed: {
1340 1341 1342 1343 1344
            goodsSize:{
                get: function () {
                    return this.addForm.goodssize;
                },
                set:function (value) {
1345 1346 1347
                    value = value.replaceAll('*','x')
                    value = value.replaceAll('X','x')
                    this.addForm.goodssize = value
1348 1349 1350
                    // console.log("opebTab监视:value = "+ value);
                }
            }
1351
        },
1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363


    }
</script>

<style scoped>
    .toolbar{
        height: 60px;
        background-color: white;
        /*line-height: 60px;*/
        vertical-align: middle;
        border-radius: 5px 5px 5px 5px;
1364
        padding: 10px 10px 0 10px;
1365 1366
        box-shadow: 0px 5px 5px #e5e8eb;
    }
1367 1368 1369 1370 1371 1372 1373 1374

    .my-text-area .prepand{
        float: left;
        width:89px;
        height: 28px;
        font-size: 12px;
        line-height: 28px;
    }
1375
</style>
1376 1377 1378 1379 1380 1381 1382 1383 1384
<style>
    .my-text-area .el-textarea__inner{
        min-height: 28px;
        height: 28px;
        border-bottom-left-radius: 0;
        border-top-left-radius: 0;
    }
</style>
1385