<template>
  <div class="auto" style="overflow:auto;">
    <validator name='v'>
    <form novalidate class="form-horizontal">
      <div class="row auto" >
        <div class="col-sm-4 form-group">
          <label for="f_type" class=" font_normal_body">换表类型</label>
          <v-select id="f_type"
                    v-model="model.f_type"
                    title="参数:换表类型"
                    placeholder='请选择'
                    :value-single="true"
                    :value.sync="model.f_type"
                    :options='replacewatchtype'
                    @change="typeChange"
                    :disabled="!row.f_meter_type.includes('卡表')"
                    close-on-select clear-button>
          </v-select>
        </div>
        <div class="col-sm-4 form-group" :class="[$v.f_change_operator.required || $v.f_change_operator.dctest ? 'has-error' : 'has-success']">
          <label for="f_change_operator" class=" font_normal_body">换&ensp;表&ensp;人</label>
          <input class="input_search" style="width:60%" type="text" v-model="model.f_change_operator"
                 v-validate:f_change_operator='{required: true, minlength: 1}'
                 placeholder="换表人">
        </div>

        <div class="col-sm-4 form-group" :class="[$v.f_using_base_old.required || $v.f_using_base_old.dctest ? 'has-error' : 'has-success']">
          <label for="f_remanent_gas" class=" font_normal_body">旧表底数</label>
          <input class="input_search" style="width:60%" type="number"
                 v-model="model.f_using_base_old"
                 placeholder="请输入旧表底数"
                 v-validate:f_using_base_old='{required: true, dctest: [-1, ">" ] }'
                 @blur="pregasChange()">
        </div>
      </div>
      <!--<p class="bg-info text-center" v-if="!model.f_type.includes('清零')" style="padding: 8px;">新表信息</p>-->
      <meter-message v-if="!model.f_type.includes('清零')" :f_userfiles_id="row.f_userfiles_id" :metermessage.sync="model.metermessage" @valid="meterinfo = true"
                     @invalid="meterinfo = false" @gasmodel="gasModelChange" v-ref:metermsg></meter-message>

      <div v-if="row.f_meter_type != '机表'">
        <div class="row auto" style="margin-top: 10px" v-if="changeType == 'gasToAmount' || changeType == 'amountToGas'">
          <!-- 气量转金额 || 金额转签气量 -->
          <div class="col-sm-4 form-group" :class="[$v.f_remanent_gas.required || $v.f_remanent_gas.dctest ? 'has-error' : 'has-success']">
            <label for="f_remanent_gas" class=" font_normal_body">补&ensp;气&ensp;量</label>
            <input class="input_search" style="width:60%" type="number"
                   v-model="model.f_remanent_gas"
                   placeholder="补气量"
                   :disabled="changeType == 'gasToAmount'"
                   v-validate:f_remanent_gas='{required: true, dctest: [-1, ">" ] }'>
          </div>
          <div class="col-sm-4 form-group">
            <label class=" font_normal_body">补气单价</label>
            <input class="input_search" style="width:60%" type="number"
                   v-model="model.f_remanent_price"
                   placeholder="补气单价" readonly>
          </div>
          <div class="col-sm-4 form-group"
               :class="[$v.f_remanent_money.required || $v.f_remanent_money.dctest ? 'has-error' : 'has-success']">
            <label for="f_remanent_money" class=" font_normal_body">补气金额</label>
            <input class="input_search" style="width:60%" type="number"
                   v-model="model.f_remanent_money"
                   placeholder="补气金额"
                   @blur="remanentChange"
                   :disabled="changeType == 'amountToGas'"
                   v-validate:f_remanent_money='{required: true, dctest: [-1, ">" ] }'>
          </div>
        </div>
        <div class="row auto" v-if="changeType == 'gasToGas'">
          <!-- 气量转气量 -->
          <div class="col-sm-4 form-group" :class="[$v.f_remanent_gas.required || $v.f_remanent_gas.dctest ? 'has-error' : 'has-success']">
            <label for="f_remanent_gas" class=" font_normal_body">补&ensp;气&ensp;量</label>
            <input class="input_search" style="width:60%" type="number"
                   v-model="model.f_remanent_gas"
                   placeholder="补气量"
                   v-validate:f_remanent_gas='{required: true, dctest: [-1, ">" ] }'>
          </div>
        </div>

        <div class="row auto" v-if="changeType == 'amountToAmount'">
          <!-- 金额转金额 -->
          <div class="col-sm-4 form-group"
               :class="[$v.f_remanent_money.required || $v.f_remanent_money.dctest ? 'has-error' : 'has-success']">
            <label for="f_remanent_money" class=" font_normal_body">补气金额</label>
            <input class="input_search" style="width:60%" type="number"
                   v-model="model.f_remanent_money"
                   placeholder="补气金额"
                   v-validate:f_remanent_money='{required: true, dctest: [-1, ">" ] }'>
          </div>
        </div>
      </div>
      <div class="row auto" >

        <div class="col-sm-4 form-group">
          <label for="f_changemeter_fee" class=" font_normal_body">换表金额</label>
          <input class="input_search" style="width:60%" type="number" v-model="model.f_changemeter_fee" placeholder="换表金额">
        </div>
        <div class="col-sm-4 form-group">
          <label for="f_paytype" class=" font_normal_body" title="参数名称：付款方式">收款方式</label>
          <v-select id="f_payment"
                    title="参数:付款方式"
                    v-model="f_payment"
                    placeholder='请选择'
                    :value-single="true"
                    :value.sync="model.f_payment"
                    :options='paytype'
                    close-on-select clear-button></v-select>
        </div>
        <div class="col-sm-4 form-group">
          <label for="f_print" class="font_normal_body">打印格式</label>
          <v-select id="print"
                    title="参数:打印格式"
                    v-model="f_print"
                    placeholder='请选择'
                    :multiple="mulPrint"
                    :value.sync="model.f_print"
                    :options='printstyle'
                    close-on-select clear-button></v-select>
        </div>
      </div>
      <div class="row">
       <!-- <div class="col-sm-4 flex-row" >
          <label class="control-label">用户类型</label>
          <v-select :value.sync="newinfo.f_user_type"
                    :options='usertypes' placeholder='用户类型'
                    @change="userTypeChange()"
                    close-on-select></v-select>
        </div>
        <div class="col-sm-4 flex-row"
             :class="[$m.gas.required ? 'has-error' : '']">
          <label class="control-label">用气性质</label>
          <v-select :value.sync="newinfo.f_gasproperties" v-model="newinfo.f_gasproperties"
                    :options='gasproperties' placeholder='用气性质'
                    close-on-select v-ref:gas></v-select>
        </div>-->
        <div class="col-sm-4 form-group" :class="[$m.type.required ? 'has-error' : '']">
          <label class="font_normal_body">气价类型</label>
          <v-select :value.sync="newinfo.pricetype" v-model="newinfo.pricetype"
                    placeholder='气价类型' :options="pricetypes"
                    close-on-select v-ref:type>
          </v-select>
        </div>
        <div class="col-sm-4 form-group" :class="[$m.name.required ? 'has-error' : '']">
          <label class="font_normal_body">气价名称</label>
          <v-select :value.sync="newinfo.pricename" v-model="newinfo.pricename"
                    placeholder='气价名称' :options="getPricenames()"
                    close-on-select :disabled='newinfo.pricetype.length === 0 ' v-ref:name></v-select>
        </div>
        <div class="col-sm-4 ">
          <label for="f_comments" class=" font_normal_body">业务单号</label>
          <input class="input_search" style="width:60%"  type="text"
                 v-model="model.f_serial_number" placeholder="业务单号">
        </div>

      </div>
      <div class="row auto">
        <div class="col-sm-4 ">
          <label class=" font_normal_body">是否累计</label>
          <v-select id="f_ladder_sync"
                    v-model="f_payment"
                    placeholder='请选择'
                    :value-single="true"
                    :value.sync="model.f_ladder_sync"
                    :options='ladder'
                    close-on-select clear-button></v-select>
        </div>
      </div>
      <div class="row auto" >
        <div class="col-sm-12">
          <label  class="font_normal_body ">备&emsp;&emsp;注</label>
          <textarea class="input_textarea" rows="3" style="width:87%;" v-model="model.f_comments"></textarea>
        </div>
      </div>
      <div style="text-align:right;height:auto;">
        <button class="button_search" type="button" @click="confirmbefore()" :disabled="(!meterinfo&& !model.f_type.includes('清零'))||!$v.valid"
        >确认
        </button>
        <button class="button_clear" type="button" @click="clean()" >取消
        </button>
      </div>
      <!--<div style="height: auto;width: 100%">-->
        <!--<div style="height: 10%">-->
          <!--<img style="margin-top: -5px" src="../../../../../../static/images/lefticon/矩形1183.png">-->
          <!--<a style="font-size: 16px;font-weight: 500;color: #333;text-decoration: none;">附件信息</a>&nbsp;<a style="color: #999999"></a>-->
        <!--</div>-->
        <!--<upload :blodid="row.f_userinfo_id" isremark="true" fusetype="换表"></upload>-->
      <!--</div>-->
    </form>
    </validator>
  </div>
  <upload  v-if="config.showupload" :blodid="row.f_userinfo_id" isremark="true" fusetype="换表&清零"></upload>
</template>
<script>
/**
 *换表管理
 *组合界面，加载机表，物联网表，气量卡表，金额卡表旧表信息，以及控制显示换新表信息
 */
import { HttpResetClass } from 'vue-client'
let getPrice = async function (self) {
  await self.$LoadParams.loadParam(self.$login.f.orgid)
  await self.$getConfig(self, 'ChargeMeter')
  self.isGas = (self.row.f_collection_type == '按气量')

  let http = new HttpResetClass()
  let param = {
    tablename: 't_detailprice',
    condition: `f_price_name = '1' and f_stairprice_id = '${self.row.f_stairprice_id}'`
  }
  let res = await http.load('POST', 'rs/sql/saleSingleTable', {
    data: param
  }, {
    resolveMsg: null,
    rejectMsg: '获取一阶单价!!'
  })
  if (res.data.length > 0) {
    self.model.f_remanent_price = res.data[0].f_price
  }
  self.initData()
}
export default {
  title: '换表登记',
  data () {
    return {
      resid: [],  // 存放新增的f_files表中id
      model: {
        metermessage: {
          f_meter_type: '',
          gasbrand: '',
          gasmodel: '',
          f_meternumber: '',
          f_meter_base: 0,
          f_metertitles: '',
          f_oldmeter_use_reference: 0 // 旧表使用量参考值
        },
        // 旧表底数
        f_using_base_old: '',
        // 换表补气量
        f_remanent_gas: 0,
        // 换表补气单价
        f_remanent_price: 0,
        f_remanent_money: 0,
        f_type: '换新表',
        f_comments: '',
        f_othereason: '',
        f_payment: '现金缴费',
        f_print: '普通收据',
        f_state: '有效',
        f_changemeter_date: this.$login.toStandardTimeString(),
        f_changemeter_fee: this.$appdata.getSingleValue('换表金额') ? this.$appdata.getSingleValue('换表金额') : 0
      },
      meterinfo: false,

      // 控制气量和金额的转换显示
      changeType: '',
      config: {
        showupload: true, //
        dispatch: false // 是否派工
      },
      // 控制气量金额的编辑
      isGas: false,
      replacewatchtype: this.$appdata.getParam('换表类型'),
      reason: this.$appdata.getParam('换表原因') ? this.$appdata.getParam('换表原因') : [],
      paytype: this.$appdata.getParam('付款方式'),
      printstyle: this.$appdata.getParam('打印格式'),
      gasproperties: [],
      books: {
        data: []
      },
      newinfo: {
        f_user_type: '',
        f_gasproperties: '',
        pricetype: '',
        pricename: '',
        f_perform_date: this.$login.toStandardDateString() + ' 00:00:00' // 操作时间
      },
      ladder: [{label: '累计', value: '同步'}, {label: '不累计', value: '不同步'}],
      usertypes: this.$appdata.getParam('用户类型') ? [{label: '全部', value: ''}, ...this.$appdata.getParam('用户类型')] : [],
      pricetypes: this.$appdata.getParam('气价类型') ? [{label: '全部', value: ''}, ...this.$appdata.getParam('气价类型')] : []
    }
  },
  props: ['row'],
  ready () {
    getPrice(this)
  },
  events: {
    // 删除Resid数组元素
    'delResid' (val) {
      this.resid.$remove({id: val, f_biobid: ''})
      // this.resid.splice(this.resid.indexOf({id:val,f_biobid:''}),1);
    },
    // 增加Resid数组元素
    'resid' (val) {
      this.resid.push({id: val, f_biobid: ''})
    }
  },
  methods: {
    getPricenames () {
      console.log('气价。，。。', this.newinfo.pricetype)
      let rs = []
      if (this.row.f_user_type && this.row.f_gasproperties && this.newinfo.pricetype.length === 1) {
        let params = {
          f_user_type: this.row.f_user_type,
          f_gasproperties: this.row.f_gasproperties,
          f_price_type: this.newinfo.pricetype[0],
          filter: this.$login.f.orgid
        }
        rs = this.$GetSaleParam.getPrice(params)
      }
      if (rs.length === 0) {
        this.newinfo.f_price_name = ''
      }
      return rs
    },
    userTypeChange () {
      this.gasproperties = []
      if (this.newinfo.f_user_type.length === 1) {
        this.gasproperties = this.$appdata.getParam(this.newinfo.f_user_type[0])
      }
    },
    // 返回
    clean () {
      this.$dispatch('success', '换表', this.row)
    },
    async confirmbefore () {
      if (this.model.metermessage.f_meter_type[0] != '机表') {
        console.log('进来了')
        if (this.books.data.length > 0) {
          console.log('进来了2')
          if (this.books.data[0].f_whether_pay === '否') {
            this.$showAlert('该表有欠费，请到机表缴费界面进行缴费', 'warning', 3000)
            this.$dispatch('button-specifies', {name: '机表收费', value: 'machine-charge'}, this.row)
          } else {
            this.confirm()
          }
        } else {
          this.confirm()
        }
      } else {
        this.confirm()
      }
    },
    async confirm () {
      if (this.row.f_meter_type.includes('机表') && (parseInt(this.model.f_using_base_old) > parseInt(this.row.f_meter_base))) {
        this.$showMessage(`该用户表底数大于上次抄表底数，请确定是否继续生成欠费记录`, ['confirm', 'cancel']).then((res) => {
          if (res === 'confirm') {
            let data = {
              downDate: this.$login.toStandardTimeString(),
              startDate: this.$login.toStandardDateString(),
              endDate: this.$login.toStandardDateString(),
              condition: `f_userfiles_id = '${this.row.f_userfiles_id}'`,
              f_operator: this.$login.f.name,
              f_operatorid: this.$login.f.id,
              f_meternumber: this.row.f_meternumber,
              f_userinfo_id: this.row.f_userinfo_id,
              f_userfiles_id: this.row.f_userfiles_id,
              f_serial_number: this.model.f_serial_number,
              f_meterbase: this.model.f_using_base_old,
              f_meter_brand: this.row.f_meter_brand,
              f_price_id: this.row.f_price_id
            }
            this.$resetpost('rs/logic/changeMeterHand', {data: data}, {resolveMsg: '生成欠费成功', rejectMsg: '生成欠费失败'}).then((res) => {
              console.log('成功')
              if (this.model.metermessage.f_meter_type[0] != '机表') {
                this.$dispatch('refresh')
              } else {
                this.saveobj()
              }
            })
          } else {

          }
        })
      } else {
        if (this.row.f_meter_type.includes('气量卡表') && (this.model.f_using_base_old > (this.row.f_total_gas + this.row.f_initial_base + this.row.f_remanent_gas))) {
          await this.$showMessage(`该表可能存在超用，请确定是否继续进行换表操作！！！,或者取消进入超用收费！`, ['confirm', 'cancel']).then((res) => {
            if (res === 'confirm') {
              this.saveobj()
            } else {
            }
          })
        } else {
          this.saveobj()
        }
      }
    },
    async saveobj () {
      try {
        this.model.f_operator = this.$login.f.name
        this.model.f_operatorid = this.$login.f.id
        this.model.f_orgid = this.$login.f.orgid
        this.model.f_orgname = this.$login.f.orgs
        this.model.f_depid = this.$login.f.depids
        this.model.f_depname = this.$login.f.deps
        this.model.f_zoneid = this.$login.f.zoneid
        this.model.f_zones = this.$login.f.zones
        let data = {
          model: this.model,
          old: this.row
        }
        let meterinfo = await this.$resetpost('rs/logic/changeMeter', data, {
          resolveMsg: null,
          rejectMsg: '换表失败！！！'
        })
        let param = []
        for (let row of this.resid) {
          param.push({id: row.id})
        }
        let data1 = {
          param: param,
          f_blobid: meterinfo.data.id
        }
        console.log('-------------------------->', data1)
        await this.$resetpost('rs/logic/updatefiles', data1)
        // 赋值【新表id】
        this.row.f_userfiles_id = meterinfo.data.new_userfiles_id

        if (this.newinfo.pricename.length > 0) {
          let param = {
            f_userinfo_id: this.row.f_userinfo_id,
            f_userfiles_id: this.row.f_userfiles_id,
            f_user_id: this.row.f_user_id,
            f_user_name: this.row.f_user_name,
            f_user_type: this.newinfo.f_user_type[0],
            f_gasproperties: this.newinfo.f_gasproperties[0],
            f_price_type: this.newinfo.pricetype[0],
            f_price_id: this.newinfo.pricename[0].f_price_id,
            f_filialeid: this.$login.f.orgid,
            f_operator: this.$login.f.name,
            f_operatorid: this.$login.f.id,
            f_orgid: this.$login.f.orgid,
            f_orgname: this.$login.f.orgs,
            f_depid: this.$login.f.depids,
            f_depname: this.$login.f.deps,
            f_perform_date: this.newinfo.f_perform_date,
            f_change_reason: '换表调价'
          }

          await this.$resetpost('rs/logic/user_pricechange', {data: param}, {resolveMsg: '更新气价成功', rejectMsg: '更新气价失败'})
        }
        let msg = await this.$showMessage('已成功换表，是否进入补气或购气界面', ['confirm', 'cancel'])
        if (msg == 'confirm') {
          this.row.f_remanent_gas = this.model.f_remanent_gas
          this.row.f_remanent_money = this.model.f_remanent_money
          this.$dispatch('get-new-row', this.row)
        } else {
          this.$dispatch('success')
        }
        if (this.config.dispatch) {
          await this.$showMessage(`是否添加派工单`, ['confirm', 'cancel']).then((res) => {
            if (res === 'confirm') {
              let batch = {
                sf_id: meterinfo.data.id,
                f_userinfo_code: this.row.f_userinfo_code,
                f_dispathch_name: this.row.f_user_name,
                f_phone: this.row.f_user_phone,
                f_dispathch_address: this.row.f_address,
                f_dispathch_type: '安装',
                f_source: '换表',
                f_remarks: this.model.f_comments,
                f_operator_date: this.$login.toStandardTimeString(),
                f_orgid: this.$login.f.orgid,
                f_dispathch_state: '待分配'
              }
              console.log('111:', batch)
              this.$resetpost('rs/logic/savePatch', batch).then((res1) => {
                // this.params.rows.splice(index, 1)
                console.log('更新成功！--------------------->', res1.data.id)
              })
            }
          })
        }
      } catch (error) {
        console.log('抛出的错误。。', error)
        this.$showAlert(error, 'danger', 200)
        this.$dispatch('refresh')
      }
    },
    pregasChange () {
      // 每种表对应的计算方式都不一样
      if (this.row.f_meter_type == '气量卡表') {
        this.calGasCardRemanent()
      } else if (this.row.f_meter_type == '金额卡表') {
        // this.$showAlert('金额卡表换表尚在开发中，敬请期待！！', 'warning', 5000)
        // this.$dispatch('refresh')
        this.calMoneyCardRemanent()
      } else if (this.row.f_meter_type == '物联网表') {
        this.Iotjisuan()
      }
    },
    async Iotjisuan () {
      let gas = (this.model.f_using_base_old - 0) - (this.row.f_meter_base - 0)
      let getAmount = await this.$CommonService.gasCalculate(this.row, gas)
      let money = getAmount.data.chargenum
    },
    typeChange () {
      if (this.model.f_type.includes('清零')) {
        let oldMeter = {
          f_meter_type: this.row.f_meter_type,
          f_collection_type: this.row.f_collection_type
        }
        let newMeter = {
          f_meter_type: this.row.f_meter_type,
          f_collection_type: this.row.f_collection_type
        }
        let res = this.$ChangeMeter.changeMeter(oldMeter, newMeter, this.row)
        console.log('看看新旧表的转换结果', res)
        this.changeType = res.name
      } else {
        this.changeType = ''
      }
    },

    initData () {
      if (this.row.f_meter_type == '物联网表') {
        // 判断是否需要结算
        if (this.row.f_collection_type == '按气量') {
          this.calGasIOTRemanent()
        } else {
          this.calMoneyIOTRemanent()
        }
      } else if (this.row.f_meter_type == '机表') {
        this.validateOwe()
      } else {
        this.pregasChange()
      }
    },

    calGasCardRemanent () {
      // 拿到旧表底数 和【累计购气量+初始底数】比较  这里剩余气量如果是清零补气的就不加，如果是换表补气的就加
      let param = this.row.f_total_gas + this.row.f_initial_base

      if (this.row.f_remanent_type == 1) {
        param += this.row.f_remanent_gas
      }

      if (this.model.f_using_base_old > param) {
        this.$showAlert('该表可能存在超用，请核实输入后进行换表操作！！', 'warning', 5000)
        this.$dispatch('refresh')
      }
      if (this.model.f_remanent_price > 0) {
        this.model.f_remanent_gas = (param - (this.model.f_using_base_old - 0)).toFixed(4)
      }
    },

    calMoneyCardRemanent () {
      if (!this.model.f_remanent_money) {
        this.model.f_remanent_money = ''
      }
    },

    calGasIOTRemanent () {
      this.model.f_remanent_gas = (this.row.f_balance_gas - 0)
      if (this.row.f_remanent_type == 1) {
        this.model.f_remanent_gas += (this.row.f_remanent_gas - 0)
      }
    },
    calMoneyIOTRemanent () {
      this.model.f_remanent_money = (this.row.f_balance_amount - 0).toFixed(4)
      if (this.row.f_remanent_type == 1) {
        if (this.row.f_remanent_gas > 0) {
          this.model.f_remanent_money = (this.model.f_remanent_money - 0) + ((this.row.f_remanent_gas - 0) * (this.row.f_remanent_price - 0)).toFixed(4)
        } else if (this.row.f_remanent_money > 0) {
          this.model.f_remanent_money = (this.model.f_remanent_money - 0) + (this.row.f_remanent_money - 0)
        }
      }
    },

    gasModelChange (val) {
      console.log('新表信息', val)
      if (val.length > 0) {
        // 新气表信息已选
        let oldMeter = {
          f_meter_type: this.row.f_meter_type,
          f_collection_type: this.row.f_collection_type
        }
        let newMeter = {
          f_meter_type: val[0].f_meter_type,
          f_collection_type: val[0].f_collection_type
        }
        let res = this.$ChangeMeter.changeMeter(oldMeter, newMeter, this.row)
        console.log('看看新旧表的转换结果', res)
        this.changeType = res.name
      }
    },

    remanentChange () {
      // 气量转金额 或者 金额转气量的时候对气量和金额不做限制， 可以修改， 但是只变单价
      this.model.f_remanent_price = ((this.model.f_remanent_money) / (this.model.f_remanent_gas)).toFixed(4)
    },

    async validateOwe () {
      let http = new HttpResetClass()
      let books = await http.load('POST', 'rs/sql/singleTable_OrderBy', {
        data: {
          items: 'f_whether_pay',
          tablename: 't_handplan',
          condition: ` f_user_id  = '${this.row.f_user_id}' and  f_hand_state = '有效' and f_meter_state='已抄表' `,
          orderitem: ' id desc'
        }
      }, {resolveMsg: null, rejectMsg: null}
      )
      console.log('获取到的欠费记录', books)
      this.books = books
      // 如果是机表验证是否有欠费
      if ((this.row.f_balance - 0) < 0) {
        this.$showAlert('该表有欠费，请到机表缴费界面进行缴费', 'warning', 3000)
        this.$dispatch('button-specifies', {name: '机表收费', value: 'machine-charge'}, this.row)
      }
    }
  },

  watch: {
    'row' () {
      console.log('-------------------------------')
      console.log(this.row)
    },
    'model.f_remanent_money' (val) {
      console.log('观察补气金额', val)
      if (!this.isGas) {
        return this.model.f_remanent_gas = (val / this.model.f_remanent_price).toFixed(4)
      }
    },
    'model.f_remanent_gas' (val) {
      if (this.isGas) {
        return this.model.f_remanent_money = (val * this.model.f_remanent_price).toFixed(4)
      }
    }
  }
}
</script>
