<template>
  <view class="page-product-receipt">
    <view class="header" :style="{ backgroundColor: `rgba(250, 53, 52, ${scrollTop / 100})` }">
      <view class="left">
        <u-icon class="icon" name="arrow-left" @click="uni.navigateBack({})" />
      </view>
      <view class="title">采购收货(PO)</view>
      <view class="right"></view>
    </view>
    <u-form class="form" ref="form" label-width="180rpx">
      <!-- 单号 -->
      <view class="single">
        <view class="single-left">
          <view>采购单号:</view>
          <u-search placeholder="请扫描" :focus="oncefouces" v-model="procureCode" @search="query" :show-action="false"></u-search>
        </view>
        <view class="single-right">
          <u-button type="primary" @click="tidan">提单</u-button>
        </view>
      </view>
      <u-form-item label="物料编码">
        <jPicker sureColor="#ff0000" @bindpicker="selectProductCodeType" showKey="value" valKey="value" :val="bimWl.value" :options="reducelist" />
      </u-form-item>
      <u-form-item label="物料描述">
        <u-input border height="50" placeholder="" disabled v-model="bimWl.label" />
      </u-form-item>
      <!-- 订单 -->
      <!-- <u-form-item label="物料描述">
        <jPicker sureColor="#ff0000" :showCode="true" @bindpicker="bookTypeChange" duoyukey="procureCode" showKey="label" valKey="value" :val="aimWl.value" :options="materilist" />
      </u-form-item> -->
      <u-form-item label="库区">
        <u-search placeholder="请扫描" v-model="areaCode" @search="queryloc" :show-action="false"></u-search>
        <!-- <jPicker sureColor="#ff0000" :moren="moren" @bindpicker="selectProductlocCode" showKey="label" valKey="value" :val="productCodeTypeList.value" :options="whList" /> -->
      </u-form-item>
      <u-form-item label="仓库">
        {{ waCodeList && waCodeList.warehouseName }}
        <!-- <jPicker sureColor="#ff0000" :moren="moren1" @bindpicker="selectProductwaCode" showKey="label" valKey="value" :val="waCodeTypeList.value" :options="waCodeList" /> -->
      </u-form-item>
      <u-form-item label="供应商">
        <view v-if="bimWl.supplierName"> {{ bimWl.supplierName }}({{ bimWl.supplierCode }}) </view>
      </u-form-item>
      <u-form-item label="标志卡">
        <u-search placeholder="请扫描" :focus="twofouces" v-model="Idcard" @search="querybyidcard" :show-action="false"></u-search>
      </u-form-item>
      <view class="creatshow">
        <u-button class="buttonshow" type="primary" @click="generate">生成收货单号</u-button>
        <u-input border placeholder="" class="inputshow" disabled v-model="receiptNoCode" />
      </view>
    </u-form>
    <view class="matshow">
      <view v-for="item in list" :key="item.id" @dblclick="onFormDoubleClick(item)">
        <u-form :style="{ marginTop: '10rpx', backgroundColor: item.planNumber <= item.realityNumber ? '#4eea9b59' : '#ffffff' }" class="form2">
          <view class="list">
            <view class="righttitle">
              <!-- ０是未收货，１是正在收货，２是收货完成 -->
              <view class="boder-icon-top zhuangtai" data-state="0">{{ item.orderStatus == 0 ? '未收货' : item.orderStatus == 1 ? '正在收货' : '收货完成' }}</view>
            </view>
            <view class="row-list">
              <view class="list-item"> 采购单号: </view>
              <view> {{ item.procureCode }} </view>
            </view>
            <!-- <view class="row-list">
              <view class="list-item"> 行项目: </view>
              <view> {{ item.userDefined3 }} </view>
            </view> -->
            <view class="row-list">
              <view class="list-item"> 物料编码: </view>
              <view> {{ item.handlematerialCode }}</view>
            </view>
            <!-- <view class="row-list">
              <view class="list-item"> 物料描述: </view>
              <view>{{ item.materialDesc }}</view>
            </view> -->
            <!-- <view class="row-list">
              <view class="list-item"> 工厂号: </view>
              <view>{{ item.siteCode }}</view>
            </view> -->
            <view class="row-list">
              <view class="list-item"> 应收/已收: </view>
              <view>{{ item.planNumber }}/{{ item.realityNumber }}</view>
            </view>
            <!-- <view a:if="true" class="righttitle">
              <view @click.stop="onPass(item)" class="boder-icon-rigth"> 收货 </view>
            </view> -->
          </view>
        </u-form>
      </view>
    </view>

    <view class="scroll">
      <view v-for="(item, index) in receivedlist" :key="item.id">
        <u-form style="margin-top: 10rpx" class="form2">
          <view class="list">
            <view class="righttitle">
              <!-- ０是未收货，１是正在收货，２是收货完成 -->
              <view class="boder-icon-top zhuangtai" data-state="0">{{ item.userDefined10 == '0' ? '未收货' : '已收货' }}</view>
            </view>
            <view class="row-list">
              <view class="list-item"> 采购单号: </view>
              <view> {{ item.procureCode }} </view>
            </view>
            <view class="row-list">
              <view class="list-item"> 行项目: </view>
              <view> {{ item.userDefined3 }} </view>
            </view>
            <view class="row-list">
              <view class="list-item"> 物料编码: </view>
              <view> {{ item.handlematerialCode }}</view>
            </view>
            <view class="row-list">
              <view class="list-item"> 物料描述: </view>
              <view>{{ item.materialDesc }}</view>
            </view>
            <view class="row-list">
              <view class="list-item"> 工厂号: </view>
              <view>{{ item.siteCode }}</view>
            </view>
            <view class="row-list">
              <view class="list-item"> 托盘: </view>
              <view>{{ item.sn }}</view>
            </view>
            <view class="row-list">
              <view class="list-item"> 打印顺序: </view>
              <view>{{ item.userDefined9 }}</view>
            </view>
            <view class="row-list">
              <view class="list-item"> 实际收货: </view>
              <u-input border placeholder="" @blur="confirmNumber(item)" v-model="item.planNumber" />
            </view>
            <view a:if="true" class="righttitle">
              <view @click.stop="delet(item, index)" class="boder-icon-rigth"> 删除 </view>
            </view>
          </view>
        </u-form>
      </view>
    </view>
    <view class="bottom-bar">
      <u-row class="button-bar">
        <!-- 确定 -->
        <u-col :span="4">
          <u-button @click="onSubmit" type="primary">103暂收</u-button>
        </u-col>
        <u-col :span="4">
          <u-button :disabled="isDisabled105" @click="handelSubmit105" type="success">105过账</u-button>
        </u-col>
        <!-- 返回 -->
        <u-col :span="4">
          <u-button type="error" @click="uni.navigateBack()">返回</u-button>
        </u-col>
      </u-row>
    </view>

    <u-toast ref="uToast" />
  </view>
</template>
<script lang="ts">
import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import jPicker from '@/components/J-Picker/jPicker.vue';
import model from './model';
import { session } from '@/store/modules/session';
import dayjs from 'dayjs';
import { removeLeadingZeros } from '@/utils/tool';
interface OptionType {
  label: string;
  value: string;
}
@Component({
  components: {
    jPicker,
  },
})
export default class receivePO extends BasePage {
  model = model;
  list: any = [];
  receivedlist: any = [];
  realityaddNumber = 0;
  operationNumber = 0;
  nooperationNumber = 0;
  czNumber = '';
  areaCode = '';
  Idcard = '';
  waCodeList: any = {};
  whList: any = [];
  //waCodeList: any = [];
  show = false;
  singshow = false;
  form3: any = {};
  aimWl = {} as OptionType;
  materilist = [];
  productCodeTypeList: any = {};
  waCodeTypeList: any = {};
  moren = '选择仓库';
  moren1 = '选择库区';
  waylist = [
    // {
    //   value: '0',
    //   lable: '根据物料',
    // },
    {
      value: '1',
      lable: '根据托盘',
    },
  ];
  bimWl: any = {};
  selectway = true;
  showshow = true;
  // remove: any = {};
  // async onReady() {
  //   await this.model.queryLocation();
  //   this.remove = this.model.WlList[0];
  // }
  // selectItem(e: any) {
  //   this.remove = e.pickerName;
  // }
  procureCode: any = '';
  materialCode: any = '';
  border = true;
  height = 100;
  autoHeight = true;
  imgList: any = [];
  imgUrlList: any = [];
  isqualified = [
    {
      label: '合格',
      value: '1',
    },
    {
      label: '不合格',
      value: '0',
    },
  ];
  clickitem: any = '';
  productCodeList: any = {};
  receiptNoCode = '';
  reducelist: any = [];
  oldprodlist: any = [];
  oncefouces = true;
  twofouces = false;
  isDisabled105 = false;
  showStatus105 = false;
  contentStatus150 = '';
  qualityStatusCo = {
    Y: '检验合格',
    N: '检验不合格',
  };
  async onReady() {
    //await this.model.Stashlist();
    //this.whList = model.DictTypeList;
    //this.remove = this.model.WlList[0];
  }
  //生成收货单号
  generate() {
    const today = dayjs().format('YYYYMMDDHHmmss');
    this.receiptNoCode = `sn${today}`;
  }
  async queryloc() {
    let params = {
      factoryCode: session.FactoryCode,
      areaCode: this.areaCode,
    };
    await this.model.getworkloc(params);
    this.waCodeList = model.workloclist;
  }
  //标志卡查询
  async querybyidcard() {
    if (this.receivedlist.length) {
      let ischongfu = this.receivedlist.some((item) => item.userDefined1 == this.Idcard);
      if (ischongfu) {
        (this.$refs.uToast as any).show({
          title: '请勿重复扫描标志卡',
        });
        this.Idcard = '';
        return;
      }
    }
    let item = {
      factoryCode: session.FactoryCode,
      userDefined1: this.Idcard,
    };
    await this.model.getByidcard(item);
    if (model.getidcardcode == '200') {
      let alreadyList = model.byidcardobj;
      alreadyList.handlematerialCode = alreadyList.materialCode.slice(alreadyList.materialCode.search(/[1-9]/));
      let id = alreadyList.userDefined4;
      let flage = this.list.some((item) => item.id === id);
      if (flage) {
        this.list.forEach((item) => {
          if (item.id == id) {
            item.realityNumber += alreadyList.planNumber;
          }
        });
        this.receivedlist.push(alreadyList);
      } else {
        (this.$refs.uToast as any).show({
          title: '该标志卡与上面的采购单不匹配',
          type: 'default',
        });
        return;
      }

      //this.confirmNumber();
      this.Idcard = '';
      this.twofouces = true;
    }
  }
  confirmNumber(changeobj) {
    let addNumber = 0;
    let id = changeobj.userDefined4;
    this.receivedlist.forEach((item) => {
      if (item.userDefined4 === id) {
        addNumber += parseFloat(item.planNumber ? item.planNumber : '0');
      }
    });
    this.list.forEach((item) => {
      if (item.id === id) {
        item.realityNumber = item.realityaddNumber + addNumber;
      }
    });
  }
  nopoup() {
    this.show = false;
    this.form3 = {};
    this.productCodeTypeList = {};
  }
  nopoupsing() {
    this.singshow = false;
    this.operationNumber = 0;
    this.nooperationNumber = 0;
    this.czNumber = '';
  }

  async onFormDoubleClick(item) {
    console.log('双击', item);
    //await this.model.OnSubmit(item.id);
    // uni.navigateTo({
    //     url: `/pages/equipment/Upkeep/repairing?listitem=` + encodeURIComponent(JSON.stringify(item)),
    //   });
    this.uni.navigateTo({
      url: this.page.wms.ReceivePODetail + '?listitem=' + encodeURIComponent(JSON.stringify(item)),
    });
  }
  uniqueArray(arr) {
    return arr.reduce((accumulator, current) => {
      if (!accumulator.some((item) => item.materialCode === current.materialCode)) {
        accumulator.push(current);
      }
      return accumulator;
    }, []);
  }
  //查询货单关联采购单信息
  async query() {
    console.log(session);
    this.aimWl = {} as OptionType;
    let query = {
      procureCode: this.procureCode,
      materialCode: this.aimWl.value ? this.aimWl.value : '',
      userDefined8: '1',
      //this.materialCode,
      factoryCode: session.FactoryCode,
    };
    await this.model.PurchaseOrderPda(query);
    let materilist = model.orderNoItemList;
    this.reducelist = this.uniqueArray(materilist);
    this.reducelist.forEach((item) => {
      item.value = item.materialCode;
      item.label = item.materialDesc;
    });
    console.log('this.reducelist', this.reducelist);
    this.bimWl = this.reducelist[0];
    if (this.reducelist[0].waCode) {
      this.areaCode = this.reducelist[0].waCode;
      await this.queryloc();
    }
    this.oldprodlist = materilist.map((item) => {
      let newmaterialCode = item.materialCode.slice(item.materialCode.search(/[1-9]/));
      return {
        ...item,
        handlematerialCode: newmaterialCode,
        realityaddNumber: item.realityNumber,
      };
    });
    this.list = this.oldprodlist.filter((item) => {
      return item.materialCode == this.bimWl.value;
    });
    this.receivedlist = [];
  }
  selectProductCodeType(e) {
    console.log(e);
    this.bimWl = e.pickerName;
    this.receivedlist = [];
    this.list = this.oldprodlist.filter((item) => {
      return item.materialCode == this.bimWl.value;
    });
  }

  //提单按钮
  async tidan() {
    if (this.procureCode == '' || this.procureCode.length == 0) {
      (this.$refs.uToast as any).show({
        title: '请输入rfid',
        type: 'default',
      });
      return;
    }
    let item = {
      procureCode: this.procureCode,
      factoryCode: session.FactoryCode,
      createBy: session.loginName,
    };
    await this.model.sapPurchaseOrderSync(item);
    if (model.sapPurchasecode == '200') {
      this.query();
    }
  }
  histroyItem: any = {};
  barcode: any = '';
  async selectProductlocCode(e: any) {
    console.log(e.pickerName.warehouseName);
    this.productCodeTypeList = e.pickerName;
    let params = {
      factoryCode: session.FactoryCode,
      whCode: this.productCodeTypeList.value,
    };
    await this.model.WarehouseList(params);
    let whlist = model.wacodelist;
    if (whlist.length) {
      this.waCodeList = whlist;
      this.waCodeTypeList = this.waCodeList[0];
    } else {
      this.waCodeList = [];
      this.waCodeTypeList = {} as OptionType;
    }
  }
  selectProductwaCode(e: any) {
    this.waCodeTypeList = e.pickerName;
  }
  //完成送货单
  async onSubmit() {
    if (this.areaCode == '') {
      (this.$refs.uToast as any).show({
        title: '请先扫描或输入库区',
        type: 'default',
      });
      return;
    }
    if (Object.keys(this.waCodeList).length == 0) {
      (this.$refs.uToast as any).show({
        title: '没有仓库信息',
        type: 'default',
      });
      return;
    }
    if (this.receiptNoCode == '' || this.receiptNoCode.length == 0) {
      (this.$refs.uToast as any).show({
        title: '请先生成收货单号',
        type: 'default',
      });
      return;
    }
    let filteredList = [];
    let paramsList = [];
    if (this.receivedlist.length == 0) {
      (this.$refs.uToast as any).show({
        title: '没有扫描标志卡收货',
        type: 'default',
      });
      return;
    } else {
      filteredList = this.receivedlist.filter((item) => item.userDefined10 !== '1');
      paramsList = filteredList.map((item) => {
        return {
          userDefined5: item.userDefined5,
          factoryCode: session.FactoryCode,
          whCode: this.waCodeList.warehouseCode,
          waCode: this.areaCode,
          receiptNoCode: this.receiptNoCode,
          planNumber: parseFloat(item.planNumber),
          procureCode: item.procureCode, //包材采购单号,
          userDefined6: item.userDefined1, //标识卡
          materialCode: item.materialCode,
          materialDesc: item.materialDesc, //物料描述
          userDefined1: '0',
          sn: item.sn, //托盘
          userDefined4: item.userDefined4, //标志卡
          createBy: session.loginName,
        };
      });
      // console.log('paramsList', paramsList);
      await this.model.OnSubmit(paramsList);
      if (this.model.submitcode == '200') {
        (this.$refs.uToast as any).show({
          title: '成功',
          type: 'success',
          duration: 6000,
        });
        this.receiptNoCode = '';
        this.receivedlist = [];
        this.list = [];
        this.Idcard = '';
        this.areaCode = '';
        this.waCodeList = {};
        this.query();
      }
    }
  }
  bookTypeChange(e: any) {
    this.aimWl = e.pickerName;
    this.list = [];
    this.list.push(e.pickerName);
    this.procureCode = this.list[0].procureCode;
    this.realityaddNumber = this.list[0].realityNumber;
    //
    //this.queryinformation();
    //this.getlist();
  }
  delet(deletobj: any, index: number) {
    this.receivedlist.splice(index, 1);
    let id = deletobj.userDefined4;
    this.list.forEach((item) => {
      if (item.id == id) {
        item.realityNumber -= deletobj.planNumber;
      }
    });
    (this.$refs.uToast as any).show({
      title: '删除成功',
      type: 'success',
    });
  }

  /**
   * 105过账按钮
   * **/
  async handelSubmit105() {
    this.isDisabled105 = true;
    const list = this.list;
    let params: any = [];
    if (list.length > 0) {
      for (const item of list) {
        if (!item.orderStatus || item.orderStatus === '0') {
          (this.$refs.uToast as any).show({
            title: '请先完成收货！',
            type: 'default',
            duration: 3000,
          });
          this.isDisabled105 = false;
          return;
        }

        //待检、不合格不在手持机上过账
        if (!item.qualityStatus || item.qualityStatus === 'N') {
          this.contentStatus150 = '采购单号：' + item.procureCode + '，物料编码：' + removeLeadingZeros(item.materialCode) + '，' + (this.qualityStatusCo[item.qualityStatus] || '未检验');
          this.showStatus105 = true;
          this.isDisabled105 = false;
          return;
        }

        //rawOrderInId不为空
        if (item.rawOrderInId) {
          params.push({ id: item.rawOrderInId });
        }
      }

      if (params.length > 0) {
        //去重
        params = params.filter((item: any, index: any, self: any) => self.findIndex((t: { [x: string]: any }) => t['id'] === item['id']) === index);

        await this.model.sap105temporarilyCollected(params);
        this.isDisabled105 = false;
        if (this.model.sap105code + '' === '200') {
          (this.$refs.uToast as any).show({
            title: this.model.sap105msg,
            type: 'primary',
            duration: 6000,
          });
        }
        await this.query();
      } else {
        this.isDisabled105 = false;
        (this.$refs.uToast as any).show({
          title: '无可过账数据',
          type: 'default',
          duration: 3000,
        });
      }
    } else {
      this.isDisabled105 = false;
      (this.$refs.uToast as any).show({
        title: '未选择数据',
        type: 'default',
        duration: 3000,
      });
    }
  }
}
</script>
<style lang="scss" scoped>
.page-product-receipt {
  background: #f2f2f2 linear-gradient(0deg, #f2f2f2 0%, #f8262c 51%, #d9001b 100%) no-repeat;
  background-size: 100% 600rpx;
  padding: 118rpx 30rpx 162rpx;
  min-height: 100%;

  .header {
    position: fixed;
    top: 0rpx;
    left: 0;
    right: 0;
    z-index: 99;
    display: flex;
    height: 120rpx;
    line-height: 88rpx;
    color: #fff;
    font-size: 34rpx;
    font-weight: 500;
    text-align: center;
    padding: 45rpx 0rpx 0rpx;

    .title {
      flex: 3;
    }

    .left,
    .right {
      flex: 1;
    }

    .icon {
      display: flex;
      justify-content: center;
      align-items: center;
      width: 88rpx;
      height: 88rpx;
    }
  }

  .form {
    background-color: #fff;
    padding: 20rpx;
    border-radius: 10rpx;
    box-shadow: 0 0 20rpx 0 rgba(128, 128, 128, 0.2);

    .u-form-item {
      padding: 10rpx 0;
      line-height: 35rpx;

      .Transfer {
        width: 280rpx;
        height: 64rpx;
        background: rgb(242, 242, 242);
        border-radius: 110rpx;
      }
    }

    .single {
      width: 100%;
      height: 100rpx;
      display: flex;

      .single-left {
        width: 80%;
        height: 100%;
        display: flex;

        view {
          width: 142rpx;
          height: 100%;
          line-height: 100rpx;
        }
      }

      .single-right {
        button {
          margin-top: 15rpx;
          width: 140rpx;
          height: 70rpx;
          background-color: #fa3534;
        }
      }
    }

    .row {
      display: flex;
      flex-direction: row;
      justify-content: space-around;
      flex: 1;
    }
    .creatshow {
      display: flex;
      margin-top: 5px;
      .buttonshow {
        flex: 1;
      }
      .inputshow {
        flex: 4;
        //border: 1px solid #9f9a9a8f;
        border-radius: 5px;
        margin-left: 4px;
      }
    }
  }

  .matshow {
    // margin-top: 120rpx;
    // padding-left: 30rpx;
    // padding-right: 16rpx;
    // margin-bottom: 20rpx;
    // overflow: scroll;
    // padding-top: 20rpx;
    .form2 {
      background-color: #fff;
      padding: 0rpx 25rpx 25rpx;
      border-radius: 10rpx;
      box-shadow: 0 0 20rpx 0 rgba(128, 128, 128, 0.2);
      color: #292c32;

      .row-list {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
      }

      .righttitle {
        display: flex;
        justify-content: flex-end;

        .boder-icon-rigth {
          border: 1rpx solid #fa3534;
          width: 130rpx;
          text-align: center;
          background: #fa3534;
          color: #ffffff;
          margin-top: 10px;
        }

        .zhuangtai {
          background: #a7a0a04a;
          width: 224rpx;
          margin-right: -25rpx;
          border: 2rpx solid #a7a0a04a;
          border-radius: 12rpx;
          text-align: center;
          margin-bottom: 10rpx;
        }

        .zhuangtai[data-state='1'] {
          color: green;
        }

        .zhuangtai[data-state='0'] {
          color: blue;
        }
      }
    }
  }
  .scroll {
    height: 590rpx;
    overflow: scroll;
    // padding-top: 20rpx;
    .form2 {
      background-color: #fff;
      padding: 0rpx 25rpx 25rpx;
      border-radius: 10rpx;
      box-shadow: 0 0 20rpx 0 rgba(128, 128, 128, 0.2);
      color: #8d8989;

      .row-list {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
      }

      .righttitle {
        display: flex;
        justify-content: flex-end;

        .boder-icon-rigth {
          border: 1rpx solid #fa3534;
          width: 130rpx;
          text-align: center;
          background: #fa3534;
          color: #ffffff;
          margin-top: 10px;
        }

        .zhuangtai {
          background: #a7a0a04a;
          width: 224rpx;
          margin-right: -25rpx;
          border: 2rpx solid #a7a0a04a;
          border-radius: 12rpx;
          text-align: center;
          margin-bottom: 10rpx;
        }

        .zhuangtai[data-state='1'] {
          color: green;
        }

        .zhuangtai[data-state='0'] {
          color: blue;
        }
      }
    }
  }

  .bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99;
    background: #ffffff;
    box-shadow: 0 1rpx 20rpx 0 rgba(128, 128, 128, 0.2);
    padding: 20rpx;
  }

  .button-bar {
  }

  .photoList {
    display: flex;
    padding-top: 12rpx;

    .chooseBtn {
      width: 202rpx;
      height: 202rpx;
      background: #fafafa;
      border-radius: 12rpx;
      border: 2rpx dashed #e2e2e2;
      display: flex;
      justify-content: center;
      align-items: center;

      .inner {
        text-align: center;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
      }

      .desc {
        font-size: 28rpx;
        font-weight: 400;
        color: #24252a;
        line-height: 40rpx;
      }

      .img {
        width: 50rpx;
        height: 50rpx;
        margin-bottom: 6rpx;
      }
    }

    .photoBox {
      width: 202rpx;
      height: 202rpx;
      background: #fafafa;
      border-radius: 12rpx;
      position: relative;

      .closeBtn {
        position: absolute;
        top: -12rpx;
        right: -12rpx;
        z-index: 2;
        width: 36rpx;
        height: 36rpx;

        .img {
          width: 36rpx;
          height: 36rpx;
        }
      }

      .img {
        width: 202rpx;
        height: 202rpx;
        border-radius: 12rpx;
      }
    }

    .itemBox {
      flex: 0 0 202rpx;
      margin-right: 20rpx;

      &:last-child {
        margin-right: 0;
      }
    }

    // /deep/ .remarksBox textarea {
    //   font-size: 24rpx;
    // }
  }
  .form3 {
    padding: 20rpx;
    //border-radius: 10rpx;
    //box-shadow: 0 0 20rpx 0 rgba(128, 128, 128, 0.2);
    .poupitem {
      display: flex;
      flex-direction: row;
      justify-content: space-around;
      margin: 20rpx;
      .pouptitle {
        min-width: 30%;
        white-space: nowrap;
      }
      .poupcontent {
        border: 1px solid rgba(128, 128, 128, 0.2);
      }
    }
  }
  .form4 {
    padding: 20rpx;
    //border-radius: 10rpx;
    //box-shadow: 0 0 20rpx 0 rgba(128, 128, 128, 0.2);
    .poupitem {
      display: flex;
      flex-direction: row;
      justify-content: space-around;
      margin: 20rpx;
      .pouptitle {
        width: 40%;
        white-space: nowrap;
      }
      .poupcontent {
        border: 1px solid rgba(128, 128, 128, 0.2);
      }
    }
  }

  .poupbutton {
    display: flex;
    justify-content: space-around;
  }
  .mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* 半透明的黑色背景 */
    z-index: 9999; /* 确保遮罩层在最上层 */
  }
}
</style>
