<template>
  <el-config-provider :locale="zhCn">
    <el-container class="content">
      <div class="work-area">
        <fieldset class="search-area">
          <el-form ref="searchQueryFormRef" :model="searchQueryFormEntity" :label-position="labelPosition"
                   label-width="158px" style="max-width: 100%" status-icon>
            <div style="display: flex;justify-content: space-between;">
              <el-row>
                <el-form-item label="数据类型">
                  <el-select-v2 style="width: 196px" v-model="searchQueryFormEntity.summaryType" placeholder="数据类型"
                                :options="summaryTypeOptions" @change="search()"></el-select-v2>
                </el-form-item>
                <el-form-item label="工单号">
                  <el-input v-model="searchQueryFormEntity.workOrder" @keyup.enter="search()" clearable/>
                </el-form-item>
                <el-form-item label="料盒号">
                  <el-input v-model="searchQueryFormEntity.boxNo" @keyup.enter="search()" clearable/>
                </el-form-item>
                <el-form-item label="成品号">
                  <el-input v-model="searchQueryFormEntity.productId" @keyup.enter="search()" clearable/>
                </el-form-item>
                <el-form-item label="单片号">
                  <el-input v-model="searchQueryFormEntity.singleProductId" @keyup.enter="search()" clearable/>
                </el-form-item>
                <el-form-item label="工作状态">
                  <el-select-v2 v-model="searchQueryFormEntity.workStatus" placeholder="工作状态"
                                :options="addAllOptionOfOptions(workStatusOptions)"
                                @change="search()"></el-select-v2>
                </el-form-item>
                <el-form-item label="缺料状态">
                  <el-select-v2 v-model="searchQueryFormEntity.lackStatus" placeholder="缺料状态"
                                :options="addAllOptionOfOptions(lackStatusOptions)"
                                @change="search()"></el-select-v2>
                </el-form-item>
              </el-row>
              <div style="align-content: center;">
                <el-row>
                  <el-button type="primary" class="btn-search" @click="search()">查询</el-button>
                  <el-button type="warning" class="btn-search" @click="clearQuery()">清除输入</el-button>
                </el-row>
                <el-row>
                  <el-button style="background-color: #00CED1;" class="btn-search"
                             @click="() => { showPrintDialog = true }">打印标签
                  </el-button>
                  <el-button type="success" class="btn-search"
                             @click="exportExcel()">导出excel
                  </el-button>
                </el-row>
              </div>
            </div>
          </el-form>
        </fieldset>
        <div class="table-area">
          <el-table :data="tableData" stripe border v-loading="tableLoading" class="table-class"
                    :max-height="maxHeight" highlight-current-row @row-click="getCurrentRow"
                    :header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
                    @sort-change="handleSortChange">
            <el-table-column width="65px" fixed="left">
              <template v-slot="scope">
                <el-radio :label="scope.row.workIndex" v-model="workIndex">&nbsp;</el-radio>
              </template>
            </el-table-column>
            <el-table-column prop="workIndex" label="数据编号" fixed="left" min-width="120px" sortable="custom"
                             show-overflow-tooltip/>
            <el-table-column prop="workOrder" label="工单" fixed="left" min-width="120px" sortable="custom"
                             show-overflow-tooltip/>
            <el-table-column prop="boxNo" label="料盒号" fixed="left" min-width="120px" sortable="custom"
                             show-overflow-tooltip/>
            <el-table-column prop="productId" label="成品号" min-width="120px" sortable="custom"
                             show-overflow-tooltip/>
            <el-table-column prop="singleProductId" label="单片号" min-width="120px" sortable="custom"
                             show-overflow-tooltip/>
            <el-table-column prop="goodsId" label="料号" min-width="120px" sortable="custom"
                             show-overflow-tooltip/>
            <el-table-column prop="planStartDate" label="计划开工日期" min-width="120px" :formatter="dateFormat"
                             sortable="custom" show-overflow-tooltip/>
            <el-table-column prop="needNum" label="需求数量" min-width="120px" sortable="custom"
                             show-overflow-tooltip/>
            <el-table-column prop="distributeNum" label="已分配数量" min-width="120px" sortable="custom"
                             show-overflow-tooltip/>
            <el-table-column prop="finishNum" label="已完成数量" min-width="120px" sortable="custom"
                             show-overflow-tooltip/>
            <el-table-column prop="workStand" label="工作站台" min-width="120px" sortable="custom"
                             show-overflow-tooltip/>
            <el-table-column prop="workUser" label="操作用户" min-width="120px" sortable="custom"
                             show-overflow-tooltip/>
            <el-table-column prop="createTime" label="创建时间" :formatter="timeFormat" min-width="120px"
                             sortable="custom" show-overflow-tooltip/>
            <el-table-column prop="finishTime" label="完成时间" :formatter="timeFormat" min-width="120px"
                             sortable="custom" show-overflow-tooltip/>
            <el-table-column prop="isOut" label="库外料" :formatter="outGoodsFormat" min-width="120px"
                             sortable="custom" show-overflow-tooltip/>
            <el-table-column prop="productType" label="成品类型" :formatter="productTypeFormat"
                             min-width="120px" sortable="custom" show-overflow-tooltip/>
            <el-table-column prop="lackStatus" label="缺料状态" :formatter="lackStatusFormat" fixed="right"
                             min-width="120px" sortable="custom" show-overflow-tooltip/>
            <el-table-column prop="workStatus" label="工作状态" :formatter="workStatusFormat" fixed="right"
                             min-width="120px" sortable="custom" show-overflow-tooltip/>
            <el-table-column fixed="right" label="操作" width="170px" v-if="searchQueryFormEntity.summaryType == 1">
              <template v-slot="scope">
                <div style="display: inline-block; align-content: center;">
                  <el-button type="primary" @click="editCurrentRowFormEntity(scope.row)">编辑</el-button>
                  <el-button type="danger" @click="closeLackWork(scope.row)">关闭</el-button>
                </div>
              </template>
            </el-table-column>
          </el-table>
          <br/>
          <el-pagination v-model:current-page="baseTableQuery.currentPage"
                         v-model:page-size="baseTableQuery.pageSize" :page-sizes="[10, 25, 50]" :small="false"
                         :disabled="false" :background="false" :default-page-size="10" @size-change="search"
                         @current-change="search" layout="total, sizes, prev, pager, next, jumper"
                         :total="baseTableQuery.total"/>
        </div>
        <el-dialog v-model="rowEditFlag" title="工作信息" width="40%" draggable :show-close="false"
                   :close-on-click-modal="false">
          <el-form ref="rowEditFormRef" :model="rowFormEntity" :label-position="labelPosition"
                   label-width="100px" style="max-width: 100%" status-icon>
            <el-row :gutter="16">
              <el-col :span="12" :offset="0">
                <el-form-item label="工作编号">
                  <el-input v-model="rowFormEntity.workIndex" disabled/>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="工单号">
                  <el-input v-model="rowFormEntity.workOrder" disabled/>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row :gutter="16">
              <el-col :span="12" :offset="0">
                <el-form-item label="总成号">
                  <el-input v-model="rowFormEntity.productId" disabled/>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="成品号">
                  <el-input v-model="rowFormEntity.singleProductId" disabled/>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row :gutter="16">
              <el-col :span="12" :offset="0">
                <el-form-item label="料盒号">
                  <el-input v-model="rowFormEntity.boxNo" disabled/>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="料号">
                  <el-input v-model="rowFormEntity.goodsId" disabled/>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row :gutter="16">
              <el-col :span="12" :offset="0">
                <el-form-item label="需求数量">
                  <el-input-number v-model.number="rowFormEntity.needNum" controls-position="right"
                                   :min="0" disabled/>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="已完成数量">
                  <el-input-number v-model.number="rowFormEntity.finishNum"
                                   controls-position="right" :min="0" :max="rowFormEntity.needNum" clearable/>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row :gutter="16">
              <el-col :span="12" :offset="0">
                <el-form-item label="已分配数量">
                  <el-input-number v-model.number="rowFormEntity.distributeNum"
                                   controls-position="right" :min="0" :max="rowFormEntity.needNum" clearable/>
                </el-form-item>
              </el-col>
            </el-row>
            <el-row :gutter="16">
              <el-col :span="12" :offset="0">
                <el-form-item label="工作状态">
                  <el-select-v2 v-model="rowFormEntity.workStatus" placeholder="请选择工作状态"
                                :options="workStatusOptions"></el-select-v2>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="缺料状态">
                  <el-select-v2 v-model="rowFormEntity.lackStatus" placeholder="请选择缺料状态"
                                :options="lackStatusOptions"></el-select-v2>
                </el-form-item>
              </el-col>
            </el-row>
          </el-form>
          <template #footer>
                        <span class="dialog-footer">
                            <el-button type="primary" @click="rowEditFlag = false">取消</el-button>
                            <el-button type="success" @click="submitUpdateRow(rowFormEntity)">
                                确定
                            </el-button>
                        </span>
          </template>
        </el-dialog>
        <el-dialog v-model="showPrintDialog" title="打印标签" width="40%" draggable :close-on-click-modal="false">
          <fieldset class="search-area">
            <el-form ref="printRequestFormRef" :model="printRequestFormEntity" :label-position="labelPosition"
                     label-width="158px" style="max-width: 100%" status-icon>
              <div style="display: flex;justify-content: space-between;">
                <el-row>
                  <el-form-item label="工单号（必须）">
                    <el-input v-model="printRequestFormEntity.workOrder" clearable/>
                  </el-form-item>
                  <el-form-item label="料盒号（必须）">
                    <el-input v-model="printRequestFormEntity.boxNo" clearable/>
                  </el-form-item>
                  <el-form-item label="单片号（非必须）">
                    <el-input v-model="printRequestFormEntity.singleProductId" clearable/>
                  </el-form-item>
                </el-row>
                <div style="align-content: center;">
                  <el-row>
                    <el-button type="primary" class="btn-search" @click="printBoxTags()">打印料盒标签</el-button>
                    <el-button type="warning" class="btn-search" @click="printLackTags()">打印缺料标签</el-button>
                  </el-row>
                </div>
              </div>
            </el-form>
          </fieldset>
        </el-dialog>
        <div style="width: 0;height: 0;overflow: hidden">
          <button ref="printBtn" style="display: none;" v-print="printObj"></button>
          <div id="printArea" class="objectDialogFlowPrint">
            <div class="pageWarp" v-for="item in printTabs">
              <div class="print-tab-text">
                <div class="print-row-normal">工单：{{ item.workOrder }}</div>
                <div class="print-row-normal">总成：{{ item.productId }}</div>
                <div class="print-row-normal">单片：{{ item.singleProductId }}</div>
                <div class="print-row-normal">配料：{{ item.kittingDate }}</div>
              </div>
              <div class="print-tab-text">
                <div class="print-row-normal">测试台：{{ item.testNo }}</div>
                <div class="print-row-normal">产量：{{ item.productionQty }}</div>
                <div class="print-row-normal">料盒号：{{ item.boxNo }}</div>
                <div class="print-row-normal">生产：{{ item.produceDate }}</div>
              </div>
              <div class="print-tab-image">
                <qrcode-vue
                    :value="item.imageId"
                    :size="size" :foreground="color" level="H"/>
              </div>
            </div>
          </div>
        </div>
        <div style="width: 0;height: 0;overflow: hidden">
          <button ref="printLackGoodsBtn" style="display: none;"
                  v-print="getPrintObj('printLackGoodsArea')"></button>
          <div id="printLackGoodsArea" class="objectDialogFlowPrint">
            <div class="pageWarp" v-for="item in lackGoodsForPrint">
              <div class="print-tab-full" style="margin-left: 30px">
                <div class="print-row-big">料盒：{{ item.boxNo }}</div>
                <div class="print-row-big">料号：{{ item.goodsId }}</div>
                <div class="print-row-big">需求：{{ item.needNum }}</div>
                <div class="print-row-big">缺料：{{ item.needNum - item.finishNum }}</div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </el-container>
  </el-config-provider>
</template>

<script setup>
import store from '@/store'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import {
  queryWorkSummaryByPage,
  updateKateWorks,
  closeCurrentWorks,
  requestPrintBoxTags,
  getLackGoods
} from '@/api/kateWork.js'
import {dateFormatter, timeFormatter, yesOrNoFormatter} from '@/utils/formatter.js'
import {ref, reactive, onMounted, nextTick, onBeforeUnmount} from 'vue'
import {ElMessage} from 'element-plus'
import {genTableRequest} from '@/utils/generator.js'
import {getPrintObj, labelPosition, printObj} from '@/constant/form.js'
import {summaryTypeOptions, workStatusOptions, lackStatusOptions} from '@/constant/options.js'
import {exportWorkSummaryExcel} from '@/api/excel.js'
import {addAllOptionOfOptions} from '@/utils/generator.js'
import {loading} from '@/utils/loading'
import QrcodeVue from "qrcode.vue";

/**
 * 常量定义
 */
const STAND_ID = store.getters.getStandId
const USER_NAME = store.getters.getUserName
/**
 * 变量定义
 */
let maxHeight = ref(window.innerHeight * 0.55)
let tableLoading = ref(false)
let tableData = ref([])
let baseTableQuery = reactive({
  currentPage: 1,
  pageSize: 10,
  total: 0,
  sortBy: new Map([['productId', true]]),// 按照成品号顺序排序
  standId: STAND_ID,
  userName: USER_NAME
})
let searchQueryFormEntity = reactive({
  summaryType: 1,
  workOrder: '',
  productId: '',
  singleProductId: '',
  boxNo: '',
  lackStatus: -99,
  workStatus: -99
})
let searchQueryFormRef = ref()
let rowEditFlag = ref(false)
let workIndex = ''
let rowEditFormRef = ref()
let rowFormEntity = reactive({})

let showPrintDialog = ref(false)
let printRequestFormRef = ref()
let printRequestFormEntity = reactive({
  workOrder: '',
  productId: '',
  singleProductId: '',
  boxNo: '',
})
let printTabs = ref([])
let lackGoodsForPrint = ref([])
const printBtn = ref()
const printLackGoodsBtn = ref()
const size = ref(35)
const color = ref('#000000')
/**
 * 系统方法
 */
onMounted(() => {
  nextTick(() => {
    window.addEventListener('resize', resizeHeight)
    search()
  })
})
onBeforeUnmount(() => {
  nextTick(() => {
    window.removeEventListener('resize', resizeHeight)
  })
})
const resizeHeight = () => {
  maxHeight.value = window.innerHeight * 0.55
}
/**
 * 自定义方法
 */
// 查询
const search = () => {
  tableLoading.value = true
  let request = genTableRequest(baseTableQuery)
  // 设定查询参数
  request.summaryType = searchQueryFormEntity.summaryType
  request.workOrder = searchQueryFormEntity.workOrder.trim()
  request.boxNo = searchQueryFormEntity.boxNo.trim()
  request.productId = searchQueryFormEntity.productId.trim()
  request.singleProductId = searchQueryFormEntity.singleProductId.trim()
  request.workStatus = searchQueryFormEntity.workStatus == -99 ? null : searchQueryFormEntity.workStatus
  request.lackStatus = searchQueryFormEntity.lackStatus == -99 ? null : searchQueryFormEntity.lackStatus
  queryWorkSummaryByPage(request).then((res) => {
    const response = res.data
    if (response.code == 0) {
      const data = response.data
      if (data != null) {
        tableData.value = data.lists
        baseTableQuery.total = data.total
      } else {
        tableData.value = []
        baseTableQuery.total = 0
      }
    } else {
      ElMessage.error(response.message)
    }
  }).catch(err => {
    console.log(err)
    ElMessage.error('查询数据异常。')
  }).finally(() => {
    tableLoading.value = false
  })
}
const clearQuery = () => {
  searchQueryFormEntity.workOrder = ''
  searchQueryFormEntity.productId = ''
  searchQueryFormEntity.singleProductId = ''
  searchQueryFormEntity.boxNo = ''
}
const handleSortChange = (data) => {
  if (baseTableQuery.sortBy.has(data.prop)) {
    baseTableQuery.sortBy.delete(data.prop)
  }
  baseTableQuery.sortBy.set(data.prop, data.order == 'ascending')
  search()
}
const getCurrentRow = (row) => {
  workIndex = row.workIndex
}
const dateFormat = (row, column, cellValue, index) => {
  return dateFormatter(cellValue)
}
const timeFormat = (row, column, cellValue, index) => {
  return timeFormatter(cellValue)
}
const workStatusFormat = (row, column, cellValue, index) => {
  switch (cellValue) {
    case -1:
      return '已暂停'
    case 0:
      return '未开始'
    case 1:
      return '已开始'
    case 2:
      return '已完成'
    default:
      return '异常'
  }
}
const lackStatusFormat = (row, column, cellValue, index) => {
  switch (cellValue) {
    case 0:
      return '不缺料'
    case 1:
      return '缺料'
    default:
      return '异常'
  }
}
const productTypeFormat = (row, column, cellValue, index) => {
  switch (cellValue) {
    case 1:
      return '非服务件'
    case 2:
      return '服务件'
    default:
      return '异常'
  }
}
const outGoodsFormat = (row, column, cellValue, index) => {
  return yesOrNoFormatter(cellValue)
}
const exportExcel = () => {
  const params = {
    summaryType: searchQueryFormEntity.summaryType,
    workOrder: searchQueryFormEntity.workOrder.trim(),
    boxNo: searchQueryFormEntity.boxNo.trim(),
    productId: searchQueryFormEntity.productId.trim(),
    singleProductId: searchQueryFormEntity.singleProductId.trim(),
    workStatus: searchQueryFormEntity.workStatus == -99 ? null : searchQueryFormEntity.workStatus,
    lackStatus: searchQueryFormEntity.lackStatus == -99 ? null : searchQueryFormEntity.lackStatus,
    standId: STAND_ID,
    userName: USER_NAME
  }
  exportWorkSummaryExcel(params).then(res => {
    const link = document.createElement('a');//创建a标签
    try {
      // let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'});    //如果后台返回的不是blob对象类型，先定义成blob对象格式，该type导出为xls格式，
      let blob = res.data    //如果后台返回的直接是blob对象类型，直接获取数据
      // let _fileName = res.headers['content-disposition'].split(';')[1].split('=')[1]; //拆解获取文件名，如果后端有给返回文件名的话
      let _fileName = '工作详情' + dateFormatter(new Date) + '.xlsx'
      link.style.display = 'none'//隐藏

      // 兼容不同浏览器的URL对象
      const url = window.URL || window.webkitURL || window.moxURL
      link.href = url.createObjectURL(blob)
      link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_') + 1))
      document.body.appendChild(link)
      link.click()
      document.body.removeChild(link)
      url.revokeObjectURL(link.href)//移除url对象
    } catch (e) {
      console.log(e)
      ElMessage.error('下载文件失败')
    }
  }).catch(err => {
    console.log(err)
    ElMessage.error('导出失败')
  })
}
// 编辑弹框
const editCurrentRowFormEntity = (row) => {
  // 设置form值
  rowFormEntity.workIndex = row.workIndex
  rowFormEntity.workOrder = row.workOrder
  rowFormEntity.productId = row.productId
  rowFormEntity.singleProductId = row.singleProductId
  rowFormEntity.boxNo = row.boxNo
  rowFormEntity.goodsId = row.goodsId
  rowFormEntity.needNum = row.needNum
  rowFormEntity.distributeNum = row.distributeNum
  rowFormEntity.finishNum = row.finishNum
  rowFormEntity.workStatus = row.workStatus
  rowFormEntity.lackStatus = row.lackStatus
  // 弹出框
  rowEditFlag.value = true
}
// 关闭当前缺料工作
const closeLackWork = (row) => {
  const request = {
    workIndex: row.workIndex,
    standId: STAND_ID,
    userName: USER_NAME
  }
  loading.open('关闭中...')
  closeCurrentWorks(request).then(res => {
    const response = res.data
    if (response.code == 0) {
      ElMessage.success(response.message)
      search()
    } else {
      ElMessage.error(response.message)
    }
  }).catch(err => {
    console.log(err)
    ElMessage.error('请求异常。')
  }).finally(() => {
    loading.close()
  })
}
// 更新当前行数据
const submitUpdateRow = (rowFormEntity) => {
  const request = {
    workIndex: rowFormEntity.workIndex,
    distributeNum: rowFormEntity.distributeNum,
    finishNum: rowFormEntity.finishNum,
    workStatus: rowFormEntity.workStatus,
    lackStatus: rowFormEntity.lackStatus,
    standId: STAND_ID,
    userName: USER_NAME
  }
  loading.open('更新中...')
  updateKateWorks(request).then(res => {
    if (res.data.code == 0) {
      ElMessage.success('更新数据成功。')
      rowEditFlag.value = false
      search()
    } else {
      ElMessage.error('更新数据失败。')
    }
  }).catch(err => {
    console.log(err)
    ElMessage.error('更新数据异常。')
  }).finally(() => {
    loading.close()
  })
}
// 打印料盒标签
const printBoxTags = () => {
  if (printRequestFormEntity.workOrder.trim() == '' || printRequestFormEntity.boxNo.trim() == '') {
    ElMessage.error("工单号、料盒号必须。")
    return
  }
  const requestParam = {
    workOrder: printRequestFormEntity.workOrder.trim(),
    boxNo: printRequestFormEntity.boxNo.trim(),
    productId: printRequestFormEntity.productId.trim(),
    singleProductId: printRequestFormEntity.singleProductId.trim(),
    standId: STAND_ID,
    userName: USER_NAME
  }
  loading.open('请求标签数据中...')
  requestPrintBoxTags(requestParam).then(res => {
    const response = res.data
    if (response.code == 0) {
      getPrintTabs(response.data)
      nextTick(() => {
        printBtn.value.click()
      });
    } else {
      ElMessage.error(response.message)
    }
  }).catch(err => {
    console.log(err)
    ElMessage.error("请求发生异常")
  }).finally(() => {
    loading.close()
  })
}
// 打印缺料标签
const printLackTags = () => {
  if (printRequestFormEntity.workOrder.trim() == '' || printRequestFormEntity.boxNo.trim() == '') {
    ElMessage.error("工单号、料盒号必须。")
    return
  }
  const requestParam = {
    workOrder: printRequestFormEntity.workOrder.trim(),
    boxNo: printRequestFormEntity.boxNo.trim(),
    productId: printRequestFormEntity.productId.trim(),
    singleProductId: printRequestFormEntity.singleProductId.trim(),
    standId: STAND_ID,
    userName: USER_NAME
  }
  loading.open('请求缺料数据中...')
  getLackGoods(requestParam).then(res => {
    const response = res.data
    if (response.code == 0) {
      lackGoodsForPrint.value = response.data
      nextTick(() => {
        printLackGoodsBtn.value.click()
      });
    } else {
      ElMessage.error(response.message)
    }
  }).catch(err => {
    console.log(err)
    ElMessage.error("请求发生异常")
  }).finally(() => {
    loading.close()
  })
}
// 获得打印数据
const getPrintTabs = (boxSummary) => {
  printTabs.value = []
  if (boxSummary != undefined) {
    for (let i = 1; i <= boxSummary.boxQty; i++) {
      printTabs.value.push(
          {
            workOrder: boxSummary.workOrder,
            productId: boxSummary.productIdOrigin,
            singleProductId: boxSummary.singleProductId,
            boxNo: boxSummary.boxNo,
            kittingDate: boxSummary.kittingDate,
            produceDate: boxSummary.produceDate,
            testNo: boxSummary.testNo,
            productionQty: boxSummary.productionQty,
            imageId: boxSummary.imageId,
          }
      )
    }
  }
}
</script>
<style scoped>
.content {
  display: flex;
  width: 100%;
}

.work-area {
  width: 100%;
  /* padding: 5px; */
}

.search-area {
  margin: auto;
  min-height: fit-content;
  max-height: 40%;
  margin-bottom: 10px;
  min-width: inherit;
  border: solid 1px;
  border-radius: 10px;
  box-shadow: 0px 15px 10px -15px #000;
  overflow: auto;
  padding: 10px;
}

.table-area {
  margin: auto;
  min-height: fit-content;
  max-height: 60%;
  margin-bottom: 10px;
  min-width: inherit;
  border: solid 1px;
  border-radius: 10px;
  box-shadow: 0px 15px 10px -15px #000;
  overflow: auto;
  padding: 10px;
}

.el-form-item {
  margin: 5px 5px 5px 5px;
}

.el-form-item .el-input {
  width: 196px;
}

.el-form-item .el-input-number {
  width: 196px;
}

.table-class {
  margin: 5px 5px 5px 5px;
  width: inherit;
}

.el-pagination {
  padding-left: 5px;
}

.my-autocomplete li {
  width: 196px;
  line-height: normal;
  padding: 7px;
}

.my-autocomplete li .name {
  text-overflow: ellipsis;
  overflow: hidden;
}

.my-autocomplete li .addr {
  font-size: 12px;
  color: #b4b4b4;
}

.my-autocomplete li .highlighted .addr {
  color: #ddd;
}

.my-autocomplete li .goods_id {
  color: brown;
}

.my-autocomplete li .goods_name {
  color: cornflowerblue;
}

.btn-search {
  height: 30px;
  width: 100px;
  margin: auto 5px 5px auto;
  color: black;
}

@media print {
  @page {
    size: auto;
    margin: 0;
  }

  body,
  html {
    height: auto !important;
  }
}

.objectDialogFlowPrint {
  width: 100% !important;
  height: 100% !important;
}

.objectDialogFlowPrint .pageWarp {
  /*这句话很重要，控制时候强制分页 https://www.w3school.com.cn/cssref/pr_page-break-after.asp*/
  page-break-after: always;
  width: 100%;
  height: 100%;
  text-align: center;
  padding: 0;
  display: flex;
  print-color-adjust: exact;
}

.print-tab-text {
  width: 40%;
  align-content: center;
}

.print-tab-image {
  width: 20%;
  align-content: center;
}

.print-row-normal {
  margin: 8px 3px 8px 3px;
  font-size: 13px;
  font-weight: bold;
  text-align: left;
}

.print-tab-full {
  width: 90%;
  align-content: center;
}

.print-row-big {
  margin: 8px 3px 8px 3px;
  font-size: 20px;
  font-weight: bold;
  text-align: left;
}

.dialog-footer {
  display: flex;
  justify-content: center;
}
</style>