index.vue 20.4 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 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 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 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 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 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 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 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 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 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 635 636 637 638 639 640 641 642 643 644 645 646 647 648
<template>
  <div class="app-container">
    <el-tabs v-model="activeName" type="card">
      <el-tab-pane label="主表" name="first">
        <el-form
          :model="queryHeaderParams"
          ref="queryHeaderForm"
          :inline="true"
          v-show="showHeaderSearch"
          label-width="100px"
        >
          <el-form-item label="编码" prop="code">
            <el-input
              v-model="queryHeaderParams.code"
              placeholder="请输入编码"
              clearable
              style="width: 240px"
              size="small"
              @keyup.enter.native="headerQuery"
            />
          </el-form-item>
          <el-form-item label="入库单编码" prop="referCode">
            <el-input
              v-model="queryHeaderParams.referCode"
              placeholder="请输入入库单编码"
              clearable
              style="width: 240px"
              size="small"
              @keyup.enter.native="headerQuery"
            />
          </el-form-item>
          <el-form-item label="状态" prop="lastStatus">
            <el-select
              v-model="queryHeaderParams.lastStatus"
              placeholder="状态"
              clearable
              size="small"
              style="width: 240px"
            >
              <el-option
                v-for="dict in statusOptions"
                :key="dict.dictValue"
                :label="dict.dictLabel"
                :value="dict.dictValue"
              />
            </el-select>
          </el-form-item>
          <el-form-item label="创建时间">
            <el-date-picker
              v-model="headerDateRange"
              size="small"
              style="width: 240px"
              value-format="yyyy-MM-dd"
              type="daterange"
              range-separator="-"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
            ></el-date-picker>
          </el-form-item>
          <el-form-item>
            <el-button
              type="cyan"
              icon="el-icon-search"
              size="mini"
              @click="headerQuery"
              >搜索</el-button
            >
            <el-button
              icon="el-icon-refresh"
              size="mini"
              @click="resetHeaderQuery"
              >重置</el-button
            >
          </el-form-item>
        </el-form>

        <el-row :gutter="10" class="mb8">
          <el-col :span="1.5">
            <el-button
              type="warning"
              icon="el-icon-download"
              size="mini"
              @click="handleExport"
              >导出</el-button
            >
          </el-col>
          <right-toolbar
            :showSearch.sync="showHeaderSearch"
            @queryTable="getHeaderList"
          ></right-toolbar>
        </el-row>

        <el-table
          v-loading="headerLoading"
          :data="headerList"
          @selection-change="headerSelectionChange"
        >
          <el-table-column type="selection" width="55" align="center" />
          <el-table-column
            label="入库单id"
            align="center"
            prop="id"
            width="80"
          />
          <el-table-column label="编码" align="center" prop="code" />
          <el-table-column label="质检类型" align="center" prop="type" />
          <el-table-column label="关联单号" align="center" prop="referCode" />
          <el-table-column
            label="关联平台"
            align="center"
            prop="referPlatform"
          />
          <el-table-column label="是否有效" align="center" prop="enable" />
          <el-table-column label="状态" align="center" prop="status" />
          <el-table-column
            label="关闭人"
            align="center"
            prop="closedBy"
            :show-overflow-tooltip="true"
          />
          <el-table-column
            label="关闭日期"
            align="center"
            prop="closedAt"
            width="180"
          >
            <template slot-scope="scope">
              <span>{{ parseTime(scope.row.closedAt) }}</span>
            </template>
          </el-table-column>
          <el-table-column
            label="操作"
            align="center"
            width="180"
            class-name="small-padding fixed-width"
          >
            <!-- <template slot-scope="scope">
              <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:user:edit']">修改</el-button>
              <el-button v-if="scope.row.userId !== 1" size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:user:remove']">删除</el-button>
              <el-button size="mini" type="text" icon="el-icon-key" @click="handleResetPwd(scope.row)" v-hasPermi="['system:user:resetPwd']">重置</el-button>
            </template> -->
          </el-table-column>
        </el-table>

        <pagination
          v-show="headerTotal > 0"
          :total="headerTotal"
          :page.sync="queryHeaderParams.pageNum"
          :limit.sync="queryHeaderParams.pageSize"
          @pagination="getHeaderList"
        />
      </el-tab-pane>
      <el-tab-pane label="明细" name="second">
        <el-table
          v-loading="detailLoading"
          :data="detailList"
          @selection-change="detailSelectionChange"
        >
          <el-table-column type="selection" width="55" align="center" />
          <el-table-column
            label="质检单编码"
            align="center"
            prop="checkCode"
            width="100"
          />
          <el-table-column
            label="库位编码"
            align="center"
            prop="locationCode"
          />
          <el-table-column
            label="容器编码"
            align="center"
            prop="containerCode"
          />
          <el-table-column label="入库单号" align="center" prop="receiptCode" />
          <el-table-column label="关联单号" align="center" prop="referCode" />
          <el-table-column label="关联行号" align="center" prop="referLineId" />
          <el-table-column
            label="关联平台"
            align="center"
            prop="referPlatform"
          />
          <el-table-column
            label="物料编码"
            align="center"
            prop="materialCode"
          />
          <el-table-column
            label="物料名称"
            align="center"
            prop="materialName"
          />
          <el-table-column
            label="物料规格"
            align="center"
            prop="materialSpec"
          />
          <el-table-column
            label="物料单位"
            align="center"
            prop="materialUnit"
          />
          <el-table-column label="货主代码" align="center" prop="companyCode" />
          <el-table-column
            label="库存状态"
            align="center"
            prop="inventorySts"
          />
          <el-table-column label="状态" align="center" prop="status" />
          <el-table-column label="系统数量" align="center" prop="qty" />
          <el-table-column
            label="质检人"
            align="center"
            prop="checkBy"
            :show-overflow-tooltip="true"
          />
          <el-table-column
            label="质检时间"
            align="center"
            prop="checkAt"
            width="180"
          >
            <template slot-scope="scope">
              <span>{{ parseTime(scope.row.checkAt) }}</span>
            </template>
          </el-table-column>
          <el-table-column
            label="创建时间"
            align="center"
            prop="created"
            width="180"
          >
            <template slot-scope="scope">
              <span>{{ parseTime(scope.row.created) }}</span>
            </template>
          </el-table-column>
          <el-table-column
            label="创建用户"
            align="center"
            prop="createdBy"
            :show-overflow-tooltip="true"
          />

          <el-table-column
            label="操作"
            align="center"
            width="180"
            class-name="small-padding fixed-width"
          >
            <!-- <template slot-scope="scope">
              <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:user:edit']">修改</el-button>
              <el-button v-if="scope.row.userId !== 1" size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:user:remove']">删除</el-button>
              <el-button size="mini" type="text" icon="el-icon-key" @click="handleResetPwd(scope.row)" v-hasPermi="['system:user:resetPwd']">重置</el-button>
            </template> -->
          </el-table-column>
        </el-table>

        <pagination
          v-show="detailTotal > 0"
          :total="detailTotal"
          :page.sync="queryDetailParams.pageNum"
          :limit.sync="queryDetailParams.pageSize"
          @pagination="getDetailList"
        />
      </el-tab-pane>
      <el-tab-pane label="质检登记" name="third">
        <el-form
          :model="queryRegisterParams"
          ref="queryRegisterForm"
          :inline="true"
          v-show="showRegisterSearch"
          label-width="68px"
        >
          <el-form-item label="质检单号" prop="checkCode">
            <el-input
              v-model="queryRegisterParams.checkCode"
              placeholder="请输入质检单号"
              clearable
              style="width: 240px"
              size="small"
              @keyup.enter.native="registerQuery"
            />
          </el-form-item>
          <el-form-item label="入库单号" prop="receiptCode">
            <el-input
              v-model="queryRegisterParams.receiptCode"
              placeholder="请输入入库单号"
              clearable
              style="width: 240px"
              size="small"
              @keyup.enter.native="registerQuery"
            />
          </el-form-item>
          <el-form-item label="关联单号" prop="referCode">
            <el-input
              v-model="queryRegisterParams.referCode"
              placeholder="请输入关联单号"
              clearable
              style="width: 240px"
              size="small"
              @keyup.enter.native="registerQuery"
            />
          </el-form-item>
          <el-form-item label="关联行号" prop="referLineId">
            <el-input
              v-model="queryRegisterParams.referLineId"
              placeholder="请输入关联行号"
              clearable
              style="width: 240px"
              size="small"
              @keyup.enter.native="registerQuery"
            />
          </el-form-item>
          <el-form-item label="物料编码" prop="materialCode">
            <el-input
              v-model="queryRegisterParams.materialCode"
              placeholder="请输入物料编码"
              clearable
              style="width: 240px"
              size="small"
              @keyup.enter.native="registerQuery"
            />
          </el-form-item>
          <el-form-item label="物料名称" prop="materialName">
            <el-input
              v-model="queryRegisterParams.materialName"
              placeholder="请输入物料名称"
              clearable
              style="width: 240px"
              size="small"
              @keyup.enter.native="registerQuery"
            />
          </el-form-item>
          <el-form-item label="质检人" prop="checkBy">
            <el-input
              v-model="queryRegisterParams.checkBy"
              placeholder="请输入质检人"
              clearable
              style="width: 240px"
              size="small"
              @keyup.enter.native="registerQuery"
            />
          </el-form-item>
          <el-form-item label="创建时间">
            <el-date-picker
              v-model="registerDateRange"
              size="small"
              style="width: 240px"
              value-format="yyyy-MM-dd"
              type="daterange"
              range-separator="-"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
            ></el-date-picker>
          </el-form-item>
          <el-form-item>
            <el-button
              type="cyan"
              icon="el-icon-search"
              size="mini"
              @click="registerQuery"
              >搜索</el-button
            >
            <el-button
              icon="el-icon-refresh"
              size="mini"
              @click="resetRegisterQuery"
              >重置</el-button
            >
          </el-form-item>
        </el-form>

        <el-row :gutter="10" class="mb8">
          <el-col :span="1.5">
            <el-button
              type="primary"
              icon="el-icon-circle-check"
              size="mini"
              :disabled="multiple"
              @click="handleComplete"
              >质检完成</el-button
            >
          </el-col>
          <el-col :span="1.5">
            <el-button
              type="danger"
              icon="el-icon-delete"
              size="mini"
              :disabled="multiple"
              @click="handleDelete"
              >删除</el-button
            >
          </el-col>
          <el-col :span="1.5">
            <el-button
              type="warning"
              icon="el-icon-download"
              size="mini"
              @click="handleExport"
              v-hasPermi="['system:logininfor:export']"
              >导出</el-button
            >
          </el-col>

          <right-toolbar
            :showSearch.sync="showRegisterSearch"
            @queryTable="getRegisterList"
          ></right-toolbar>
        </el-row>

        <el-table
          v-loading="registerLoading"
          :data="registerList"
          @selection-change="registerSelectionChange"
        >
          <el-table-column type="selection" width="55" align="center" />
          <el-table-column label="id" align="center" prop="id" width="55" />
          <el-table-column
            label="质检单号"
            align="center"
            prop="checkCode"
            sortable
            width="100"
          />
          <el-table-column label="入库单号" align="center" prop="receiptCode" />
          <el-table-column label="关联单号" align="center" prop="referCode" />
          <el-table-column
            label="物料编码"
            align="center"
            prop="materialCode"
          />
          <el-table-column
            label="物料名称"
            align="center"
            prop="materialName"
          />
          <el-table-column
            label="物料规格"
            align="center"
            prop="materialSpec"
          />
          <el-table-column
            label="物料单位"
            align="center"
            prop="materialUnit"
          />
          <el-table-column
            label="库存状态"
            align="center"
            prop="inventorySts"
          />
          <el-table-column label="数量" align="center" prop="qty" />
          <el-table-column
            label="质检人"
            align="center"
            prop="checkBy"
            :show-overflow-tooltip="true"
          />
          <el-table-column
            label="质检时间"
            align="center"
            prop="checkAt"
            width="180"
          >
            <template slot-scope="scope">
              <span>{{ parseTime(scope.row.checkAt) }}</span>
            </template>
          </el-table-column>
          <el-table-column
            label="创建时间"
            align="center"
            prop="created"
            width="180"
          >
            <template slot-scope="scope">
              <span>{{ parseTime(scope.row.created) }}</span>
            </template>
          </el-table-column>
          <el-table-column
            label="创建用户"
            align="center"
            prop="createdBy"
            :show-overflow-tooltip="true"
          />
          <el-table-column
            label="更新时间"
            align="center"
            prop="lastUpdated"
            width="180"
          >
            <template slot-scope="scope">
              <span>{{ parseTime(scope.row.lastUpdated) }}</span>
            </template>
          </el-table-column>
          <el-table-column
            label="更新用户"
            align="center"
            prop="lastUpdatedBy"
            :show-overflow-tooltip="true"
          />
        </el-table>

        <pagination
          v-show="registerTotal > 0"
          :total="registerTotal"
          :page.sync="queryRegisterParams.pageNum"
          :limit.sync="queryRegisterParams.pageSize"
          @pagination="getHeaderList"
        />
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
// import { listHeader,emptyIn } from "@/api/inventory/check/header"
// import { listDetail } from "@/api/inventory/check/detail"

export default {
  name: "Check",

  data() {
    return {
      headerIds: [],
      headerLoading: true,
      detailLoading: true,
      registerLoading: true,
      headerTotal: 0,
      detailTotal: 0,
      registerTotal: 0,
      headerList: null,
      detailList: null,
      registerList: null,
      activeName: "first",
      headerDateRange: [],
      registerDateRange: [],
      showHeaderSearch: true,
      showRegisterSearch: true,
      multiple: true,
      registerIds: [],
      queryHeaderParams: {
        pageNum: 1,
        pageSize: 10,
        code: undefined,
        referCode: undefined,
        lastStatus: undefined,
      },
      queryDetailParams: {
        pageNum: 1,
        pageSize: 10,
      },
      queryRegisterParams: {
        pageNum: 1,
        pageSize: 10,
        checkCode: undefined,
        receiptCode: undefined,
        referCode: undefined,
        referLineId: undefined,
        materialCode: undefined,
        materialName: undefined,
        checkBy: undefined,
      },
    };
  },
  created() {
    getHeaderList();
    getDetailList();
    this.getDicts("sys_common_status").then((response) => {
      this.statusOptions = response.data;
    });
  },
  methods: {
    statusFormat(row, column) {
      return this.selectDictLabel(this.statusOptions, row.status);
    },
    getHeaderList() {
      this.headerLoading = true;
      listHeader(
        this.addDateRange2(this.queryHeaderParams, this.headerDateRange)
      ).then((response) => {
        this.headerList = response.rows;
        this.headerTotal = response.total;
        this.headerLoading = false;
      });
    },
    headerQuery() {
      this.queryHeaderParams.pageNum = 1;
      this.getHeaderList();
    },
    resetHeaderQuery() {
      this.headerDateRange = [];
      this.resetForm("queryHeaderForm");
      this.headerQuery();
    },

    getDetailList() {
      this.detailLoading = true;
      //   listDetail(
      //     this.addDateRange2(this.queryDetailParams, this.dateRange)
      //   ).then((response) => {
      //     this.detailList = response.rows;
      //     this.detailTotal = response.total;
      //     this.detailLoading = false;
      //   });
    },
    getRegisterList() {
      this.registerLoading = true;
      listRegister(
        this.addDateRange(this.queryRegisterParams, this.registerDateRange)
      ).then((response) => {
        this.registerList = response.rows;
        this.registerTotal = response.total;
        this.registerLoading = false;
      });
    },
    registerQuery() {
      this.queryRegisterParams.pageNum = 1;
      this.getRegisterList();
    },
    resetRegisterQuery() {
      this.registerDateRange = [];
      this.resetForm("queryRegisterForm");
      this.registerQuery();
    },
    registerSelectionChange(selection) {
      this.registerIds = selection.map((item) => item.userId);
      this.multiple = !selection.length;
    },
    handleExport() {
      //   const queryParams = this.queryParams;
      //   this.$confirm("是否确认导出所有操作日志数据项?", "警告", {
      //     confirmButtonText: "确定",
      //     cancelButtonText: "取消",
      //     type: "warning",
      //   })
      //     .then(function () {
      //       return exportLogininfor(queryParams);
      //     })
      //     .then((response) => {
      //       this.download(response.msg);
      //     })
      //     .catch(function () {});
    },
  },
};
</script>
<style lang="scss" scoped>
</style>