<template>
  <gui-page :custom-header="true" :header-class="['gui-theme-background-color']">
    <template #gHeader>
      <view style="height:44px;" class="gui-flex gui-nowrap gui-rows gui-align-items-center">
        <!-- 使用组件实现返回按钮及返回首页按钮 -->
        <text
          style="font-size:44rpx;"
          class="gui-header-leader-btns gui-color-white font-icons"
          @tap="goBack"
        >&#xe6c5;</text>
        <!-- 导航文本此处也可以是其他自定义内容 -->
        <text
          class="gui-h4 gui-blod gui-flex1 gui-text-center gui-ellipsis gui-color-white gui-primary-text"
        >退料申请</text>
        <!-- 此处加一个右侧展位元素与左侧同宽，实现标题居中 -->
        <!-- 实际宽度请根据自己情况设置 -->
        <view style="width:40px;" />
        <!-- 如果右侧有其他内容可以利用条件编译和定位来实现-->
      </view>
    </template>
    <template #gBody>
      <view class="list-content">
        <view class="scan">
          <view class="scan-card">
            <uni-easyinput
              ref="easyinput"
              v-model="scanNumber"
              :input-border="false"
              :clearable="false"
              type="text"
              focus
			  @focus="handleInputFocus"
              placeholder="扫描完成品标签"
              @confirm="handleKeydown"
            />
            <text class="font-icons" @click="handleMapass">&#xe6b7;</text>
          </view>
        </view>
        <view class="table-title">
          <span>退料需求清单</span>
        </view>
        <view class="custom-table">
          <uni-table border stripe empty-text="暂无更多数据">
            <!-- 表头行 -->
            <uni-tr class="custom-table-head">
              <uni-th
                align="center"
                width="80px"
                @click="handleCheckedAllRow"
              >{{ isCheckedAllRow?"取消全选": "全选" }}</uni-th>
              <uni-th v-if="returnMaterialList[0]?.returnStatus === 0" align="center" width="20px" />
              <uni-th align="center" width="100px">工单</uni-th>
              <uni-th align="center" width="180px">产品</uni-th>
              <uni-th align="center" width="140px">本次退料数量</uni-th>
              <uni-th align="center" width="90px">可退数量</uni-th>
              <uni-th align="center" width="180px">批次</uni-th>
            </uni-tr>

            <!-- 表格数据行 -->
            <uni-tr
              v-for="(item, key) in returnMaterialList"
              :key="key"
              @click="handleShowResetNumDialog(item)"
            >
              <uni-td align="center">
                <checkbox :checked="item.checked" @click="handleCkeckedRow(item)" />
              </uni-td>
              <uni-td
                v-if="returnMaterialList[0]?.returnStatus === 0"
                align="center"
                style="padding: 8px 4px !important;"
              >
                <text
                  class="font-icons"
                  style="font-size: 20px;text-align: right;color: red;"
                  @click="handleRemoveRow(item)"
                >&#xe68c;</text>
              </uni-td>
              <uni-td align="center">{{ item.receiveOrderNo }}</uni-td>
              <uni-td align="center">{{ item.materialNo }}({{ item.materialName }})</uni-td>
              <uni-td
                align="center"
                style="color: orange;font-weight: bold;font-size: 16px;"
              >{{ item.returnQty }}</uni-td>
              <uni-td align="center">{{ item.canReturnQty }}</uni-td>
              <uni-td align="center">{{ item.materialLots }}</uni-td>
            </uni-tr>
          </uni-table>
        </view>
        <view style="display: flex;">
          <view
            class="card-list-item"
            style="width: 50%;margin: 12px 0;display: grid;grid-template-columns: 1fr;grid-template-rows: 1fr;"
          >
            <button
              type="primary"
              :disabled="computedPrintLabelDisabledState"
              style="width: calc(100% - 8px);margin: 0 4px;"
              @click="handlePrintReturnMaterialLabel(0)"
            >打印退料标签</button>
          </view>
          <view
            class="card-list-item"
            style="width: 50%;margin: 12px 0;display: grid;grid-template-columns: 1fr;grid-template-rows: 1fr;"
          >
            <button
              type="primary"
              style="width: calc(100% - 8px);margin: 0 4px;"
              @click="handleGeneratereturnMaterial"
            >生成退料申请单</button>
          </view>
        </view>
      </view>
      <uni-popup ref="errorTip" type="dialog">
        <uni-popup-dialog
          type="error"
          cancel-text="关闭"
          confirm-text="确认"
          title="提示"
          :content="errorTipMessage"
          @confirm="handleCloseErrorTipsModal"
          @close="handleCloseErrorTipsModal"
        />
      </uni-popup>
      <uni-popup ref="inputDialog" type="dialog">
        <uni-popup-dialog
          ref="inputClose"
          mode="input"
          title="设置退料数"
          :value="newMaterialNum"
          placeholder="请输入内容"
          @confirm="handleResetReturnMaterialNum"
        />
      </uni-popup>
    </template>
  </gui-page>
</template>

<script>
import {
  computed
} from 'vue'
import {
  defineComponent,
  onMounted,
  onBeforeMount,
  ref
} from 'vue'
import tsc from '@/unit/CHITEN_SDK_APP/tsc.js'
export default defineComponent({
  setup(options) {
    const modalForm = ref('')
    const errorState = ref(0)
    const inputDialog = ref()
    const easyinput = ref()
    const errorTip = ref('')
    const errorTipMessage = ref('')
    const returnMaterialList = ref([])
    const scanNumber = ref('')
    const returnType = ref()
    // 退料数
    const newMaterialNum = ref(0)
    // 选中行
    const rowObject = ref()
    // 是否全选
    const isCheckedAllRow = ref(false)
    const bluetooth = ref()
    const blueConfig = ref({
      loopBuffer: 0,
      currentTime: 1,
      lastData: 0,
      onBufferSize: 20,
      printerNum: 1,
      currentPrint: 1,
      isLabelSend: false
    })

    const computedPrintLabelDisabledState = computed(() => {
      return !returnMaterialList.value.filter(ret => ret.checked).length
    })

    onMounted(() => {
      returnType.value = options?.returnType
    })

    onBeforeMount(() => {
      // #ifdef APP-PLUS
      const bluetoothConfig = uni.getStorageSync('bluetoothConfig')
      if ([null, '', undefined].includes(bluetoothConfig)) {
        bluetooth.value = {
          'isOpenBle': false,
          'deviceId': '',
          'serviceId': '',
          'writeId': '',
          'notifyId': ''
        }
        setTimeout(() => {
          // #ifdef APP-PLUS
          plus.device.beep(2)
          // #endif
          errorTipMessage.value = '蓝牙打印机未连接'
          errorState.value = -1
          errorTip.value.open()
        }, 800)
      } else {
        bluetooth.value = JSON.parse(bluetoothConfig)
      }
      // #endif
      // setTimeout(() => {
      // 	handleKeydown("1697548277745889282");
      // }, 1000)
    })

    const handleMapass = function() {
      // #ifdef APP-PLUS
      const mpaasScanModule = uni.requireNativePlugin('Mpaas-Scan-Module')
      mpaasScanModule.mpaasScan({
        // 扫码识别类型，参数可多选，qrCode、barCode，不设置，默认识别所有
        'scanType': ['qrCode', 'barCode'],
        // 是否隐藏相册，默认false不隐藏
        'hideAlbum': false
      },
      (ret) => {
        if (ret.resp_code === 1000) {
          uni.$reqGet('scanReturnMaterial', {
            id: ret.resp_result
          })
            .then(({
              code,
              data,
              msg
            }) => {
              if (code === 0) {
                data.map(ret => {
                  ret.checked = false
                })
                if (data[0]?.returnStatus !== 0) {
                  returnMaterialList.value = []
                  // 已生成退料单 || 已签收
                  Array.prototype.push.apply(returnMaterialList.value, data)
                } else {
                  const isStatus0 = returnMaterialList.value[0]
                    ?.returnStatus
                  // 如果列表数据状态与接口数据状态不一致，清空列表
                  if (isStatus0 !== data[0]?.returnStatus) {
                    returnMaterialList.value = []
                  }
                  // 未退料
                  const fdIndex = returnMaterialList.value.findIndex(
                    item => {
                      item?.id === data[0]?.id
                    })
                  if (fdIndex === -1) {
                    Array.prototype.push.apply(returnMaterialList.value,
                      data)
                  } else {
                    // #ifdef APP-PLUS
                    plus.device.beep(2)
                    // #endif
                    errorTipMessage.value = '请勿扫描同一条物料'
                    errorTip.value.open()
                    errorState.value = 0
                  }
                }
                setInputFocus()
              } else {
                // #ifdef APP-PLUS
                plus.device.beep(2)
                // #endif
                errorTipMessage.value = msg
                errorTip.value.open()
                errorState.value = 0
              }
            })
        }
      })
      // #endif
    }

    // 扫描完成品标签输入框回车事件
    const handleKeydown = function(e) {
      uni.$reqGet('scanReturnMaterial', {
        id: e
      })
        .then(({
          code,
          data,
          msg
        }) => {
          if (code === 0) {
            data.map(ret => {
              ret.checked = false
            })
            if (data[0]?.returnStatus !== 0) {
              returnMaterialList.value = []
              // 已生成退料单 || 已签收
              Array.prototype.push.apply(returnMaterialList.value, data)
            } else {
              const isStatus0 = returnMaterialList.value[0]?.returnStatus
              // 如果列表数据状态与接口数据状态不一致，清空列表
              if (isStatus0 !== data[0]?.returnStatus) {
                returnMaterialList.value = []
              }
              // 未退料
              const fdIndex = returnMaterialList.value.findIndex(item => {
                item?.id === data[0]?.id
              })
              if (fdIndex === -1) {
                Array.prototype.push.apply(returnMaterialList.value, data)
              } else {
                // #ifdef APP-PLUS
                plus.device.beep(2)
                // #endif
                errorTipMessage.value = '请勿扫描同一条物料'
                errorTip.value.open()
                errorState.value = 0
              }
            }
            setInputFocus()
          } else {
            // #ifdef APP-PLUS
            plus.device.beep(2)
            // #endif
            errorTipMessage.value = msg
            errorTip.value.open()
            errorState.value = 0
          }
        })
    }

    // 登记
    const handleGeneratereturnMaterial = function() {
      if (returnMaterialList.value.length > 0) {
        const id0 = returnMaterialList.value[0].id
        uni.$reqPost('saveReturnMaterial', {
          detail: returnMaterialList.value,
          returnType: returnType.value
        })
          .then(({
            code,
            data,
            msg
          }) => {
            if (code === 0) {
              setInputFocus()
              returnMaterialList.value.length = 0
              // 重新获取列表数据
              handleKeydown(id0)
              handlePrintReturnMaterialLabel(1, data)
            } else {
              // #ifdef APP-PLUS
              plus.device.beep(2)
              // #endif
              errorTipMessage.value = msg
              errorTip.value.open()
              errorState.value = -1
            }
          })
      } else {
        // #ifdef APP-PLUS
        plus.device.beep(2)
        // #endif
        errorTipMessage.value = '请先扫描退料标签'
        errorTip.value.open()
        errorState.value = 0
      }
    }

    // 删除行
    const handleRemoveRow = function(ret) {
      const fdIndex = returnMaterialList.value.findIndex(item => item?.id === ret?.id)
      returnMaterialList.value.splice(fdIndex, 1)
    }

    // 展开弹窗
    const handleShowResetNumDialog = function(ret) {
      if (ret.returnStatus === 0) {
        newMaterialNum.value = ret?.canReturnQty
        rowObject.value = ret
        inputDialog.value.open()
      }
    }

    // 弹窗确认
    const handleResetReturnMaterialNum = function(e) {
      const resultNum = Number(e)
      const fdIndex = returnMaterialList.value.findIndex(item => item?.id === rowObject.value?.id)
      returnMaterialList.value[fdIndex].returnQty = resultNum
      newMaterialNum.value = 0
      // 已生成退料申请单，修改退料数需要调用接口
      if (rowObject.value?.returnStatus === 1) {
        uni.$reqPut('updateReturnMaterialNum', {
          id: rowObject.value?.id,
          returnQty: returnMaterialList.value[fdIndex].returnQty
        })
          .then(({
            code,
            msg
          }) => {
            if (code !== 0) {
              // #ifdef APP-PLUS
              plus.device.beep(2)
              // #endif
              errorTipMessage.value = msg
              errorTip.value.open()
              errorState.value = 0
            }
          })
      }
    }

    // 多选框点击事件
    const handleCkeckedRow = function(ret) {
      const fdIndex = returnMaterialList.value.findIndex(item => item?.id === ret?.id)
      returnMaterialList.value[fdIndex].checked = !returnMaterialList.value[fdIndex].checked
    }

    // 全选
    const handleCheckedAllRow = function() {
      returnMaterialList.value.map(ret => {
        ret.checked = !isCheckedAllRow.value
      })
      isCheckedAllRow.value = !isCheckedAllRow.value
    }

    const Send = function(buff) {
      var currentTime = blueConfig.value.currentTime
      var loopBuffer = blueConfig.value.loopBuffer
      var lastData = blueConfig.value.lastData
      var onBufferSize = blueConfig.value.onBufferSize
      var printNum = blueConfig.value.printerNum
      var currentPrint = blueConfig.value.currentPrint
      var buf
      var dataView
      if (currentTime < loopBuffer) {
        buf = new ArrayBuffer(onBufferSize)
        dataView = new DataView(buf)
        for (let i = 0; i < onBufferSize; ++i) {
          dataView.setUint8(i, buff[(currentTime - 1) * onBufferSize + i])
        }
      } else {
        buf = new ArrayBuffer(lastData)
        dataView = new DataView(buf)
        for (let i = 0; i < lastData; ++i) {
          dataView.setUint8(i, buff[(currentTime - 1) * onBufferSize + i])
        }
      }
      plus.bluetooth.writeBLECharacteristicValue({
        deviceId: bluetooth.value.deviceId,
        serviceId: bluetooth.value.serviceId,
        characteristicId: bluetooth.value.writeId,
        value: buf,
        success: function(res) {
          if (currentPrint <= printNum) {
            wx.showToast({
              title: '数据打印中',
              icon: 'loading'
            })
          }
          // 将complete中处理数据的代码挪过来，增加30ms延迟, 解决蓝牙打印数据传输10007问题
          setTimeout(() => {
            currentTime += 1
            if (currentTime <= loopBuffer) {
              blueConfig.value.isLabelSend = true
              blueConfig.value.currentTime = currentTime
              Send(buff)
            }
            // end
            if (currentTime === loopBuffer) {
              blueConfig.value.currentPrint += 1
              blueConfig.value.isLabelSend = false
            }
          }, 10)
        },
        fail: function(e) {
          wx.showToast({
            title: '打印第' + currentPrint + '张失败' + 'error: code ' + e
              ?.code + ', message ' + e?.message,
            icon: 'none',
            duration: 4000
          })
        },
        complete: function() {}
      })
    }

    const prepareSend = function(buff) {
      var time = blueConfig.value.onBufferSize
      var loopBuffer = parseInt(buff.length / time)
      var lastData = parseInt(buff.length % time)
      blueConfig.value.loopBuffer = loopBuffer + 1
      blueConfig.value.lastData = lastData
      blueConfig.value.currentTime = 1
      Send(buff)
    }

    // 打印测试
    const labelTest = async function(ret) {
      var command = tsc.dlabelPrinter.createNew()
      command.setBackFeed(6)
      // (640 * 320)dots
      command.setSize(80, 40)
      command.setCls()
      command.setGap(8)
      command.setBox(0, 0, 635, 315, 1)
      command.setBar(0, 40, 640, 2)
      command.setBar(0, 80, 640, 2)
      command.setBar(0, 120, 640, 2)
      command.setBar(0, 160, 640, 2)
      command.setBar(0, 200, 366, 2)
      command.setBar(0, 240, 366, 2)
      command.setBar(0, 280, 640, 2)
      // 1
      command.setBar(115, 0, 2, 40)
      command.setBar(115, 40, 2, 40)
      command.setBar(115, 80, 2, 40)
      command.setBar(115, 120, 2, 40)
      command.setBar(115, 160, 2, 40)
      command.setBar(115, 200, 2, 40)
      command.setBar(115, 240, 2, 40)
      command.setBar(115, 280, 2, 40)
      // 2
      command.setBar(360, 40, 2, 40)
      command.setBar(360, 80, 2, 40)
      command.setBar(360, 120, 2, 40)
      command.setBar(360, 160, 2, 40)
      command.setBar(360, 200, 2, 40)
      command.setBar(360, 240, 2, 40)
      command.setBar(360, 280, 2, 40)
      // 3
      command.setBar(475, 40, 2, 40)
      command.setBar(475, 80, 2, 40)
      command.setBar(475, 120, 2, 40)
      command.setBar(475, 280, 2, 40)

      command.setText(10, 6, 'TSS24.BF2', 0, 1, 1, '物料名称')
      command.setText(126, 6, 'TSS24.BF2', 0, 1, 1, ret.materialName)
      // row2
      command.setText(10, 46, 'TSS24.BF2', 0, 1, 1, '物料编码')
      command.setText(126, 46, 'TSS24.BF2', 0, 1, 1, ret.materialNo)
      command.setText(366, 46, 'TSS24.BF2', 0, 1, 1, '供应商')
      command.setText(481, 46, 'TSS24.BF2', 0, 1, 1, ret.supplierName)
      // row3
      command.setText(10, 86, 'TSS24.BF2', 0, 1, 1, '物料规格')
      command.setText(126, 86, 'TSS24.BF2', 0, 1, 1, ret.size)
      command.setText(366, 86, 'TSS24.BF2', 0, 1, 1, '分切日期')
      command.setText(481, 86, 'TSS24.BF2', 0, 1, 1, ret.createTime)
      // row4
      command.setText(10, 126, 'TSS24.BF2', 0, 1, 1, 'Lot no.')
      command.setText(126, 126, '1', 0, 1, 1, ret.materialLots)
      command.setText(366, 126, 'TSS24.BF2', 0, 1, 1, '储位')
      command.setText(481, 126, 'TSS24.BF2', 0, 1, 1, ret.wmsStockLocationName)
      // row5
      command.setText(10, 166, 'TSS24.BF2', 0, 1, 1, '有效期')
      command.setText(126, 166, 'TSS24.BF2', 0, 1, 1, ret.validityDate)
      // row6
      command.setText(10, 206, 'TSS24.BF2', 0, 1, 1, '检测日期')
      command.setText(126, 206, 'TSS24.BF2', 0, 1, 1, ret.inspectTime)
      // row7
      command.setText(10, 246, 'TSS24.BF2', 0, 1, 1, '存储条件')
      const strList = ret.storageEnvironment?.split(' ')
      const strText = strList[0] + ' ' + strList[1]
      command.setText(126, 246, 'TSS24.BF2', 0, 1, 1, strText)
      // row8
      command.setText(10, 286, 'TSS24.BF2', 0, 1, 1, '分切单号')
      command.setText(126, 286, 'TSS24.BF2', 0, 1, 1, ret.slittingOrderNo)
      command.setText(366, 286, 'TSS24.BF2', 0, 1, 1, '生产日期')
      command.setText(481, 286, 'TSS24.BF2', 0, 1, 1, ret.produceDate)

      command.setText(480, 216, '2', 0, 1, 1, ret.qty)
      command.setQrcode(366, 166, 'L', 4, 'A', ret.batchNumber)
      command.setPagePrint()
      await prepareSend(command.getData())
    }

    // 获取打印数据并打印
    const handlePrintReturnMaterialLabel = function(state, rejectNo) {
      const ids = []
      let list = []
      returnMaterialList.value.map(ret => {
        if (ret.checked && state === 0) {
          ids.push(ret?.qrCode)
        }
      })
      uni.request({
        url: uni.$baseUrl + '/report/wms-print/returnPrintData',
        data: {
          id: state === 0 ? ids.toString() : rejectNo
        }
      }).then(async({
        data
      }) => {
        if (data.data?.length === 0) {
          // #ifdef APP-PLUS
          plus.device.beep(2)
          // #endif
          errorTipMessage.value = '打印数据为空'
          errorTip.value.open()
          errorState.value = -1
          return
        }
        if (data.data?.length > 0) {
          uni.showToast({
            title: '标签打印中，请勿进行操作',
            duration: 10000,
            icon: 'none'
          })
          list = data.data
          if (list.length > 0) {
            blueConfig.value.currentPrint = 1
            blueConfig.value.printNum = list.length

            const timer = setInterval(async() => {
              const currentPrint = blueConfig.value.currentPrint - 1
              if (blueConfig.value.isLabelSend === false &&
									currentPrint < blueConfig.value.printNum) {
                const paramsObj = {
                  materialName: list[currentPrint]
                    .materialName ?? '',
                  materialNo: list[currentPrint]
                    .materialNo ??
											'',
                  supplierName: list[currentPrint]
                    .supplierName ??
											'',
                  size: list[currentPrint]
                    .size ??
											'',
                  createTime: list[currentPrint]
                    .createTime ??
											'',
                  materialLots: list[currentPrint]
                    .materialLots ??
											'',
                  wmsStockLocationName: list[currentPrint]
                    .wmsStockLocationName ??
											'',
                  validityDate: list[currentPrint]
                    .validityDate ??
											'',
                  inspectTime: list[currentPrint]
                    .inspectTime ??
											'',
                  storageEnvironment: list[currentPrint]
                    .storageEnvironment ??
											'',
                  slittingOrderNo: list[currentPrint]
                    .slittingOrderNo ??
											'',
                  produceDate: list[currentPrint]
                    .produceDate ??
											'',
                  batchNumber: list[currentPrint]
                    .batchNumber ??
											'',
                  qty: list[currentPrint]
                    .qty ??
											''
                }
                await labelTest(paramsObj)
              }
              if (currentPrint === blueConfig.value.printNum) {
                await clearInterval(timer)
              }
            }, 3000)
          }
        }
      })
    }

    const goBack = function() {
      uni.$goBack('/pages/workbranch/warehouse/returnMaterial/returnMaterialType')
    }

    const setInputFocus = function() {
      scanNumber.value = ''
      easyinput.value.onBlur()
      easyinput.value.onFocus()
    }
	
	// 禁用软键盘
	const handleInputFocus = function() {
		setTimeout(() => {
			uni.hideKeyboard()
		}, 500)
	}

    // 关闭错误信息弹窗
    const handleCloseErrorTipsModal = async function() {
      errorTip.value.close()
      if (errorState.value === 0) {
        await setInputFocus()
      }
    }

    return {
      options: [{
        text: '删除',
        style: {
          backgroundColor: '#dd524d'
        }
      }],
      computedPrintLabelDisabledState,
      goBack,
      newMaterialNum,
      inputDialog,
      easyinput,
      errorTip,
      errorTipMessage,
	  handleInputFocus,
      modalForm,
      isCheckedAllRow,
      scanNumber,
      handleMapass,
      handleKeydown,
      returnMaterialList,
      handleShowResetNumDialog,
      handleRemoveRow,
      handleCkeckedRow,
      handleCheckedAllRow,
      handleCloseErrorTipsModal,
      handleResetReturnMaterialNum,
      handleGeneratereturnMaterial,
      handlePrintReturnMaterialLabel
    }
  }
})
</script>

<style lang="scss" scoped>
	.gui-header-leader-btns {
		color: black;
		font-size: 24px !important;
	}

	.list-content {
		margin-top: 80px;
		background-color: #edeeee;
	}

	.input-200 {
		width: 200px;
		padding-left: 10px;
	}

	.font-icons {
		width: 40px;
		font-size: 20px;
		text-align: right;
	}

	.scan {
		height: 45px;
		width: calc(100% - 48px);
		margin: 12px;
		padding: 0 12px;
		display: flex;
		justify-content: space-between;
		align-items: center;
		border-radius: 6px;
		background-color: white;

		.scan-card {
			width: 100%;
			display: grid;
			grid-template-rows: 1fr;
			grid-template-columns: 7fr 2fr;
			align-items: center;

			input {
				height: 35px;
				line-height: 35px;
			}

			text {
				width: 100%;
				text-align: right;
			}
		}
	}

	.card-list-flexbox {
		width: calc(100vw - 24px);
		height: 195px;
		margin: 0 12px;
		display: flex;
		justify-content: center;
		flex-direction: column;
		align-items: center;
		overflow-y: scroll;

		.card-list-title {
			width: 100%;
			height: 35px;
			line-height: 35px;
			margin: 0 4px 0 4px;
			border-radius: 4px 4px 0 0;
			text-align: center;
			color: white;
			background-color: rgba(0, 160, 233, 1.0);
		}

		.card-list-item,
		.card-list-item-operation {
			width: 100%;
			height: 35px;
			margin: 0 4px 3rpx 4px;
			border-radius: 4px;
			display: flex;
			flex-direction: row;
			align-items: center;
			justify-content: space-between;
			background-color: #fff;

			uni-text {
				font-size: 14px;
				height: 50rpx;
				text-align: left;
				padding: 0 8px;
				display: flex;
				flex-direction: row;
				align-items: center;
			}

			.text-1 {
				flex: 1;
				height: 35px;
				justify-content: flex-start;
			}

			.text-2 {
				flex: 3;
				height: 35px;
				justify-content: flex-end;
				margin-right: 4px;
				padding: 2px 6px;
			}

		}

	}

	.table-title {
		height: 40px;
		line-height: 40px;
		margin: 4px 0 -3px 0;
		padding: 0 12px;
		font-size: 16px;
		font-weight: bold;
		background-color: white;
	}

	.custom-table {
		height: calc(100vh - 265px);
		min-height: 230px;
		margin: 5px 0;
		overflow-y: scroll;
	}
</style>
