123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- // 排队申请
- <template>
- <div class="sale">
- <div class="top">
- <span>车牌号:</span>
- <el-input
- placeholder="请输入内容"
- v-model="inputText"
- clearable
- class="input"
- >
- </el-input>
- <el-button type="primary" class="btn" @click="onclick">
- <i class="el-icon-search"></i>查询
- </el-button>
- </div>
- <div class="tab">
- <el-table
- :data="tableData"
- :span-method="objectSpanMethod"
- fit
- border
- style="width: 100%; margin-top: 20px"
- max-height="250px"
- >
- <el-table-column
- type="index"
- width="50"
- label="序号"
- fixed
- ></el-table-column>
- <el-table-column
- prop="orderNumber"
- label="运输订单号"
- show-overflow-tooltip="true"
- >
- </el-table-column>
- <el-table-column prop="capacityNumber" label="车牌号">
- </el-table-column>
- <el-table-column prop="resultApplyforTime" label="申请时间">
- </el-table-column>
- <el-table-column prop="resultDownTime" label="下发时间">
- </el-table-column>
- <el-table-column prop="materialName" label="物资名称">
- </el-table-column>
- <el-table-column prop="materialSpecification" label="物资规格">
- </el-table-column>
- <el-table-column prop="materialModel" label="物资型号">
- </el-table-column>
- <el-table-column prop="orderMaterialNumber" label="物资件数">
- </el-table-column>
- </el-table>
- </div>
- </div>
- </template>
- <script>
- export default {
- data() {
- return {
- inputText: "",
- tableData: []
- };
- },
- mounted() {
- this.information();
- },
- methods: {
- information() {
- this.axios.post("/api/v1/qms/getQueueApply").then(res => {
- console.log(res);
- this.tableData = res.data.data;
- this.getSpanArr(this.tableData);
- });
- },
- onclick() {
- this.option.requestUrl =
- "/api/v1/qms/getQueueApply?apiId=125&con=" +
- this.inputText +
- "&i=" +
- new Date();
- },
- //记录每一行的合并数
- getSpanArr(data) {
- //每次调用方法初始化
- this.spanArr = [];
- for (var i = 0; i < data.length; i++) {
- if (i === 0) {
- this.spanArr.push(1);
- this.pos = 0;
- } else {
- // 判断当前元素与上一个元素是否相同
- if (data[i].orderNumber === data[i - 1].orderNumber) {
- this.spanArr[this.pos] += 1;
- this.spanArr.push(0);
- } else {
- this.spanArr.push(1);
- this.pos = i;
- }
- }
- }
- },
- objectSpanMethod({ row, column, rowIndex, columnIndex }) {
- if (
- columnIndex === 0 ||
- columnIndex === 1 ||
- columnIndex === 2 ||
- columnIndex === 3 ||
- columnIndex === 4 ||
- columnIndex === 5
- ) {
- const _row = this.spanArr[rowIndex];
- const _col = _row > 0 ? 1 : 0;
- return {
- rowspan: _row,
- colspan: _col
- };
- }
- }
- }
- };
- </script>
- <style lang="scss">
- .sale {
- .top {
- width: 100%;
- height: 80px;
- display: flex;
- align-items: center;
- padding-left: 40px;
- }
- .input {
- width: 250px;
- margin-right: 20px;
- }
- }
- </style>
|