<template>
  <div class="page_consumables">
    <div style="display:flex;justify-content: space-between;width:100%;margin-bottom:20px;">
      <div class="cell clearfix" style="margin-bottom:0;">
        <el-input style="width: 180px;margin-right:10px;" @keyup.enter.native='searchAction' v-model="keywords"
                  class="filter-item"/>
        <el-button style="margin-right:10px;" class="filter-item" type="primary" icon="el-icon-search"
                   @click="searchAction">搜索
        </el-button>
        <label class="title"><span class="name">是否启用</span> : </label>
        <el-select v-model="is_use" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeUser">
          <el-option
            v-for="item in options"
            :key="item.value"
            :label="item.label"
            :value="item.value">
          </el-option>
        </el-select>
        <label class="title"><span class="name">是否收费</span> : </label>
        <el-select v-model="is_charge" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeCharge">
          <el-option
            v-for="item in options"
            :key="item.value"
            :label="item.label"
            :value="item.value">
          </el-option>
        </el-select>
        <span style="color: #909399;font-size:14px;">耗材种类 : &nbsp;</span>
        <el-select v-model="good_kind" style="width:140px;margin-right:10px;" placeholder="请选择" @change="changeKind">
          <el-option
            label="全部"
            value="0">
          </el-option>
          <el-option
            v-for="item,index in  getDictionaryDataConfig('system','good_kind')"
            :key="index"
            :label="item.name"
            :value="item.id">
          </el-option>
        </el-select>
      </div>
      <el-button type="primary" @click="openForm()">新增</el-button>
    </div>
    <el-table
      border style="width: 100%" :row-style="{ color: '#303133' }"
      :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)', color: '#606266'}"
      :data="goodInfo.goodInfoData"
      v-loading="goodInfo.loading"
    >
      <el-table-column type="index" label="序号" width="60px" align="center"></el-table-column>
      <el-table-column label="耗材名称" align="center">
        <template slot-scope="scope">
          {{ scope.row.good_name }}
        </template>
      </el-table-column>
      <el-table-column prop="date" label="规格型号" align="center">
        <template slot-scope="scope">
        {{ scope.row.specification_name }}
        </template>

      </el-table-column>
      <el-table-column prop="date" label="耗材种类" width="140" align="center">
        <template slot-scope="scope">
          {{ getGoodKind(scope.row.good_kind) }}
        </template>
      </el-table-column>
      <el-table-column label="耗材编码" width="140" align="center">
        <template slot-scope="scope">
          {{ scope.row.good_code }}
        </template>
      </el-table-column>

      <el-table-column label="最小单位" width="60" align="center">
        <template slot-scope="scope">
          {{ getGoodUnit(scope.row.good_unit) }}
        </template>
      </el-table-column>
      <el-table-column label="零售价" width="60" align="center">
        <template slot-scope="scope">
          {{ scope.row.retail_price }}
        </template>
      </el-table-column>
      <el-table-column label="状态" width="60" align="center">
        <template slot-scope="scope">
        <!--{{ scope.row.good_status}}-->
          <div>{{scope.row.good_status.indexOf('停用') == -1 ? '启用':'停用' }}</div>

        </template>

      </el-table-column>

      <el-table-column prop="date" label="操作" width="300" align="center">
        <template slot-scope="scope">
          <el-button @click="handleGoodInfoEdit(scope.$index, scope.row)" type="primary" size="small">编辑</el-button>
          <!--<el-button type="primary" size="small" @click="clickSelfPayment(scope.row.id)">自付比例</el-button>-->
          <el-button type="danger" size="small" @click="handleGoodInfoDelete(scope.$index, scope.row)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :page-sizes="[10, 50, 100]"
      :page-size="10"
      background
      align="right"
      style="margin-top:20px;"
      layout="total, sizes, prev, pager, next, jumper"
      :total="total"
    >
    </el-pagination>
    <good-info-dailog ref="addConsumable"
                      :titles="goodInfo.goodInfoDialog.goodInfoTitle"
                      :formValue="goodInfo.goodInfoDialog.formValue"
                      :visibility="goodInfo.goodInfoDialog.isVisibility"
                      :isCreated="goodInfo.goodInfoDialog.isCreated"
                      v-on:dialog-comfirm="goodInfoDialogComfirm"
                      v-on:dialog-cancle="goodInfoDialogCancle"
    ></good-info-dailog>
    <self-payment ref='selfPayment'></self-payment>

  </div>
</template>

<script>
  import GoodInfoDailog from '../../stock/Dialog/goodInfoDailog'
  import { getDictionaryDataConfig } from "@/utils/data";
  import selfPayment from './selfPayment'

  import {
    createGoodInfo,
    deleteGoodInfo,
    GetAllDeals,
    GetAllGoodType,
    GetAllManufacturer,
    GetGoodInfo,
    GetGoodInfoByGoodId,
    getGoodInfoList,
    modifyGoodInfo
  } from '@/api/stock'
  export default {
    components: {
      GoodInfoDailog,
      selfPayment
    },
    data() {
      return {
        good_kind:'',
        is_use:'',
        is_charge:'',
        search_input: '',
        options: [{
          value: '0',
          label: '全部'
        },{
          value: '1',
          label: '是'
        }, {
          value: '2',
          label: '否'
        }],
        value: '',

        total: 0,
        pageTotal: 0,
        pageSelect: 0,
        page: 1,
        limit: 10,
        keywords: '',
        goodInfo: {
          loading: false,
          goodInfoData: [],
          good_code: '',
          editGoodId: '',
          editGoodIndex: '',
          goodInfoDialog: {
            goodInfoTitle: '新增商品信息',
            isCreated: 1, //1.创建 2.编辑 3.查看详情
            formValue: {
              good_id: '',
              specification_name: '',
              buy_price: '',
              sell_price: '',
              remark: '',
              manufacturer: '',
              good_type_id: '',
              dealer: '',
              expiry_date_warn_day_count: '',
              stock_warn_count: '',
              is_reuse: '2',
              dealers: [],
              manufacturers: [],
              goodType: [],
              goodUnit: [],
              good_name:'',
              pinyin:"",
              wubi:"",
              good_kind:'',
              medical_insurance_level:'',
              good_unit:'',
              retail_price:'',
              medical_insurance_number:'',
              is_special_diseases:'',
              is_record:'',
              statistics_category:'',
              agent:'',
              good_status:'',
              default_count:'',
              sign:'',
              is_default:'',
              is_charge_use:'',
              is_charge_predict:'',
              is_statistics_work:'',
              sort:'',
              is_doctor_use:'',
              good_number:'',

            },

            isVisibility: false
          }
        }
      }
    },
    methods: {
      changeKind(val){
        this.getList()

      },
      changeCharge(val){
        this.getList()

      },
      changeUser(val){
        this.getList()


      },
      getGoodUnit(id){
        for (let i = 0; i <this.$store.getters.good_unit.length; i++ ){
          if(id == this.$store.getters.good_unit[i].id){

            return this.$store.getters.good_unit[i].name
          }
        }
        return ""
      },
      getGoodKind(id){
        var data = this.getDictionaryDataConfig('system','good_kind')
        var name = ""
        for(let i = 0; i < data.length; i++){
          if(id == data[i].id){
            name = data[i].name
          }

        }
        return name
      },
      getDictionaryDataConfig(module,filed_name){
        return getDictionaryDataConfig(module,filed_name)

      },
      search: function() {
        this.getList()
      },
      handleGoodInfoEdit: function(index, row) {
        this.getAllDealer()
        this.getAllManufacturer()
        this.getAllGoodType()
        this.goodInfo.editGoodId = row.id
        this.goodInfo.editGoodIndex = index

        let params = {
          id: row.id
        }
        GetGoodInfo(params).then(response => {
          if (response.data.state == 0) {
            this.$message.error(response.data.msg)
            return false
          } else {

            if (response.data.data.goodInfo.good_unit <= 0) {
              this.goodInfo.goodInfoDialog.formValue.good_unit = ''
            } else {
              this.goodInfo.goodInfoDialog.formValue.good_unit =
                response.data.data.goodInfo.good_unit
            }

            if (response.data.data.goodInfo.manufacturer <= 0) {
              this.goodInfo.goodInfoDialog.formValue.manufacturer = ''
            } else {
              this.goodInfo.goodInfoDialog.formValue.manufacturer =
                response.data.data.goodInfo.manufacturer
            }

            if (response.data.data.goodInfo.dealer <= 0) {
              this.goodInfo.goodInfoDialog.formValue.dealer = ''
            } else {
              this.goodInfo.goodInfoDialog.formValue.dealer =
                response.data.data.goodInfo.dealer
            }

            this.goodInfo.goodInfoDialog.formValue.specification_name =
              response.data.data.goodInfo.specification_name
            this.goodInfo.goodInfoDialog.formValue.buy_price =
              response.data.data.goodInfo.buy_price
            this.goodInfo.goodInfoDialog.formValue.sell_price =
              response.data.data.goodInfo.sell_price
            this.goodInfo.goodInfoDialog.formValue.expiry_date_warn_day_count =
              response.data.data.goodInfo.expiry_date_warn_day_count
            this.goodInfo.goodInfoDialog.formValue.stock_warn_count =
              response.data.data.goodInfo.stock_warn_count
            this.goodInfo.goodInfoDialog.formValue.is_reuse = response.data.data.goodInfo.is_reuse.toString()
            this.goodInfo.goodInfoDialog.formValue.remark =
              response.data.data.goodInfo.remark
            this.goodInfo.goodInfoDialog.isCreated = 2
            this.goodInfo.good_code = response.data.data.goodInfo.good_code
            this.goodInfo.goodInfoDialog.formValue.good_type_id =
              response.data.data.goodInfo.good_type_id




            this.goodInfo.goodInfoDialog.formValue.good_name =
              response.data.data.goodInfo.good_name


            this.goodInfo.goodInfoDialog.formValue.pinyin =
              response.data.data.goodInfo.pinyin

            this.goodInfo.goodInfoDialog.formValue.wubi =
              response.data.data.goodInfo.wubi



            if (response.data.data.goodInfo.good_kind <= 0) {
              this.goodInfo.goodInfoDialog.formValue.good_kind = ''
            } else {
              this.goodInfo.goodInfoDialog.formValue.good_kind =
                response.data.data.goodInfo.good_kind
            }



            if (response.data.data.goodInfo.medical_insurance_level <= 0) {
              this.goodInfo.goodInfoDialog.formValue.medical_insurance_level = ''
            } else {
              this.goodInfo.goodInfoDialog.formValue.medical_insurance_level =
                response.data.data.goodInfo.medical_insurance_level
            }


            this.goodInfo.goodInfoDialog.formValue.retail_price =
              response.data.data.goodInfo.retail_price


            this.goodInfo.goodInfoDialog.formValue.medical_insurance_number =
              response.data.data.goodInfo.medical_insurance_number


            if (response.data.data.goodInfo.is_special_diseases <= 0) {
              this.goodInfo.goodInfoDialog.formValue.is_special_diseases = ''
            } else {
              this.goodInfo.goodInfoDialog.formValue.is_special_diseases =
                response.data.data.goodInfo.is_special_diseases.toString()
            }

            if (response.data.data.goodInfo.is_record <= 0) {
              this.goodInfo.goodInfoDialog.formValue.is_record = ''
            } else {
              this.goodInfo.goodInfoDialog.formValue.is_record =
                response.data.data.goodInfo.is_record.toString()
            }

            if (response.data.data.goodInfo.statistics_category <= 0) {
              this.goodInfo.goodInfoDialog.formValue.statistics_category = ''
            } else {
              this.goodInfo.goodInfoDialog.formValue.statistics_category =
                response.data.data.goodInfo.statistics_category
            }


            if (response.data.data.goodInfo.good_status <= 0) {
              this.goodInfo.goodInfoDialog.formValue.good_status = ''
            } else {
              this.goodInfo.goodInfoDialog.formValue.good_status =
                response.data.data.goodInfo.good_status
            }


            if (response.data.data.goodInfo.default_count <= 0) {
              this.goodInfo.goodInfoDialog.formValue.default_count = ''
            } else {
              this.goodInfo.goodInfoDialog.formValue.default_count =
                response.data.data.goodInfo.default_count
            }




            if (response.data.data.goodInfo.sign <= 0) {
              this.goodInfo.goodInfoDialog.formValue.sign = ''
            } else {
              this.goodInfo.goodInfoDialog.formValue.sign =
                response.data.data.goodInfo.sign
            }



            if (response.data.data.goodInfo.is_default <= 0) {
              this.goodInfo.goodInfoDialog.formValue.is_default = ''
            } else {
              this.goodInfo.goodInfoDialog.formValue.is_default =
                response.data.data.goodInfo.is_default.toString()
            }

            if (response.data.data.goodInfo.is_charge_use <= 0) {
              this.goodInfo.goodInfoDialog.formValue.is_charge_use = ''
            } else {
              this.goodInfo.goodInfoDialog.formValue.is_charge_use =
                response.data.data.goodInfo.is_charge_use.toString()
            }


            if (response.data.data.goodInfo.is_charge_predict <= 0) {
              this.goodInfo.goodInfoDialog.formValue.is_charge_predict = ''
            } else {
              this.goodInfo.goodInfoDialog.formValue.is_charge_predict =
                response.data.data.goodInfo.is_charge_predict.toString()
            }


            if (response.data.data.goodInfo.is_statistics_work <= 0) {
              this.goodInfo.goodInfoDialog.formValue.is_statistics_work = ''
            } else {
              this.goodInfo.goodInfoDialog.formValue.is_statistics_work =
                response.data.data.goodInfo.is_statistics_work.toString()
            }


            if (response.data.data.goodInfo.sort <= 0) {
              this.goodInfo.goodInfoDialog.formValue.sort = ''
            } else {
              this.goodInfo.goodInfoDialog.formValue.sort =
                response.data.data.goodInfo.sort.toString()
            }


            if (response.data.data.goodInfo.is_doctor_use <= 0) {
              this.goodInfo.goodInfoDialog.formValue.is_doctor_use = ''
            } else {
              this.goodInfo.goodInfoDialog.formValue.is_doctor_use =
                response.data.data.goodInfo.is_doctor_use.toString()
            }

            this.goodInfo.goodInfoDialog.formValue.agent =
              response.data.data.goodInfo.agent

            this.goodInfo.goodInfoDialog.formValue.good_number =
              response.data.data.goodInfo.good_number



            this.$refs.addConsumable.show(row.id, this.goodInfo.goodInfoDialog.formValue)
          }
        })
      },
      handleGoodInfoDelete: function(index, row) {
        this.$confirm('确认删除这条商品信息?', '删除商品信息', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        })
          .then(() => {
            let params = {
              id: row.id
            }

            deleteGoodInfo(params).then(response => {
              if (response.data.state == 0) {
                this.$message.error(response.data.msg)
                return false
              } else {
                this.goodInfo.goodInfoData.splice(index, 1)
                this.$message.success('删除成功')
              }
            })
          })
          .catch(() => {
          })
      },
      getList() {
        this.goodInfo.loading = true
        let params = {
          page: this.page,
          limit: this.limit,
          keyword: this.keywords,
          is_use:this.is_use,
          good_kind:this.good_kind,
          is_charge: this.is_charge,
        }
        getGoodInfoList(params).then(response => {
          if (response.data.state == 0) {
            this.goodInfo.loading = false
            this.$message.error(response.data.msg)
            return false
          } else {
            this.goodInfo.loading = false
            this.total = response.data.data.total
            this.goodInfo.goodInfoData = []
            for (let i = 0; i < response.data.data.list.length; i++) {
              this.goodInfo.goodInfoData.push(response.data.data.list[i])
            }
          }
        })
      },
      tableRowClassName({ row, rowIndex }) {
        //把每一行的索引放进row
        row.index = rowIndex
      },
      onRowClick(row, event, column) {
        this.goodInfo.goodInfoData = []
        this.goodType.tableCurrentIndex = row.index
        this.goodInfo.goodInfoDialog.formValue.good_id = row.id
        let params = {
          id: row.id
        }
        this.goodInfo.loading = true
        GetGoodInfoByGoodId(params).then(response => {
          if (response.data.state == 0) {
            this.goodInfo.loading = false
            this.$message.error(response.data.msg)
            return false
          } else {
            this.goodInfo.loading = false
            this.getList()

            // for (let i = 0; i < response.data.data.list.length; i++) {
            //   this.goodInfo.goodInfoData.push(response.data.data.list[i])
            // }
          }
        })
      },
      goodInfoDialogComfirm: function(val) {
        if (val.isCreated == 2) {
          //修改
          val['id'] = this.goodInfo.editGoodId
          val['good_code'] = this.goodInfo.good_code

          modifyGoodInfo(val).then(response => {
            if (response.data.state == 0) {
              this.$message.error(response.data.msg)
              return false
            } else {
              this.$refs.addConsumable.hide()
              this.getList()
              // this.goodInfo.goodInfoData[
              //   this.goodInfo.editGoodIndex
              //   ].specification_name =
              //   response.data.data.goodInfo.specification_name
              // this.goodInfo.goodInfoData[this.goodInfo.editGoodIndex].good_unit =
              //   response.data.data.goodInfo.good_unit
              // this.goodInfo.goodInfoData[
              //   this.goodInfo.editGoodIndex
              //   ].buy_price = response.data.data.goodInfo.buy_price.toString()
              // this.goodInfo.goodInfoData[
              //   this.goodInfo.editGoodIndex
              //   ].sell_price = response.data.data.goodInfo.sell_price.toString()
              // this.goodInfo.goodInfoData[
              //   this.goodInfo.editGoodIndex
              //   ].expiry_date_warn_day_count = response.data.data.goodInfo.expiry_date_warn_day_count.toString()
              // this.goodInfo.goodInfoData[
              //   this.goodInfo.editGoodIndex
              //   ].stock_warn_count = response.data.data.goodInfo.stock_warn_count.toString()

              this.$message.success('修改成功')
            }
          })
        } else if (val.isCreated == 1) {
          //新增
          createGoodInfo(val).then(response => {
            if (response.data.state == 0) {
              this.$message.error(response.data.msg)
              return false
            } else {
              this.$refs.addConsumable.hide()
              this.getList()
              // this.goodInfo.goodInfoData.unshift(response.data.data.goodInfo)
              this.$message.success('新增成功')
            }
          })
        }
      },
      goodInfoDialogCancle: function() {
        this.$refs.addConsumable.hide()
      },
      showInfoDialog: function() {
        this.getAllDealer()
        this.getAllManufacturer()
        this.goodInfo.goodInfoDialog.formValue.goodType = []
        GetAllGoodType().then(response => {
          if (response.data.state == 0) {
            this.$message.error(response.data.msg)
            return false
          } else {
            for (let i = 0; i < response.data.data.goodType.length; i++) {
              if (response.data.data.goodType[i].type == 1) {
                response.data.data.goodType[i].type_name = response.data.data.goodType[i].type_name + '(系统设定)'
              }
              this.goodInfo.goodInfoDialog.formValue.goodType.push(
                response.data.data.goodType[i]
              )
            }
            if (this.goodInfo.goodInfoDialog.formValue.goodType.length <= 0) {
              this.$message.error('请先新增商品类型')
              return
            } else {
              this.goodInfo.goodInfoDialog.isVisibility = true
              this.goodInfo.goodInfoDialog.isCreated = 1
            }
          }
        })
        this.$refs.addConsumable.show()

      },
      getAllDealer: function() {
        this.goodInfo.goodInfoDialog.formValue.dealers = []
        GetAllDeals().then(response => {
          if (response.data.state == 0) {
            this.$message.error(response.data.msg)
            return false
          } else {
            for (let i = 0; i < response.data.data.dealer.length; i++) {
              this.goodInfo.goodInfoDialog.formValue.dealers.push(
                response.data.data.dealer[i]
              )
            }
          }
        })
      },
      getAllManufacturer: function() {
        this.goodInfo.goodInfoDialog.formValue.manufacturers = []
        GetAllManufacturer().then(response => {
          if (response.data.state == 0) {
            this.$message.error(response.data.msg)
            return false
          } else {
            for (let i = 0; i < response.data.data.manufacturer.length; i++) {
              this.goodInfo.goodInfoDialog.formValue.manufacturers.push(
                response.data.data.manufacturer[i]
              )
            }
          }
        })
      },
      getAllGoodType: function() {
        this.goodInfo.goodInfoDialog.formValue.goodType = []
        GetAllGoodType().then(response => {
          if (response.data.state == 0) {
            this.$message.error(response.data.msg)
            return false
          } else {
            for (let i = 0; i < response.data.data.goodType.length; i++) {
              if (response.data.data.goodType[i].type == 1) {
                response.data.data.goodType[i].type_name = response.data.data.goodType[i].type_name + '(系统设定)'
              }
              this.goodInfo.goodInfoDialog.formValue.goodType.push(
                response.data.data.goodType[i]
              )
            }
          }
        })
      },
      handleSizeChange(val) {
        this.limit = val
        this.getList()
      },
      handleCurrentChange(val) {
        this.page = val
        this.getList()
      },
      searchAction() {
        this.is_use = ""
        this.is_charge = ""
        this.good_kind = ""
        this.getList()
      },clickSelfPayment(id){
      this.$refs.selfPayment.show(id,2)
      },
      openForm() {

        this.getAllDealer()
        this.getAllManufacturer()
        this.goodInfo.goodInfoDialog.formValue.goodType = []
        GetAllGoodType().then(response => {
          if (response.data.state == 0) {
            this.$message.error(response.data.msg)
            return false
          } else {
            for (let i = 0; i < response.data.data.goodType.length; i++) {
              if (response.data.data.goodType[i].type == 1) {
                response.data.data.goodType[i].type_name = response.data.data.goodType[i].type_name + '(系统设定)'
              }
              this.goodInfo.goodInfoDialog.formValue.goodType.push(
                response.data.data.goodType[i]
              )
            }
            if (this.goodInfo.goodInfoDialog.formValue.goodType.length <= 0) {
              this.$message.error('请先新增商品类型')
              return
            } else {
              this.goodInfo.goodInfoDialog.isVisibility = true
              this.goodInfo.goodInfoDialog.isCreated = 1
            }
          }
        })
        this.goodInfo.goodInfoDialog.formValue.good_id = ''
        this.goodInfo.goodInfoDialog.formValue.specification_name = ''
        this.goodInfo.goodInfoDialog.formValue.buy_price = ''
        this.goodInfo.goodInfoDialog.formValue.sell_price = ''
        this.goodInfo.goodInfoDialog.formValue.remark = ''
        this.goodInfo.goodInfoDialog.formValue.manufacturer = ''
        this.goodInfo.goodInfoDialog.formValue.good_type_id = ''
        this.goodInfo.goodInfoDialog.formValue.dealer = ''
        this.goodInfo.goodInfoDialog.formValue.expiry_date_warn_day_count = ''
        this.goodInfo.goodInfoDialog.formValue.stock_warn_count = ''
        this.goodInfo.goodInfoDialog.formValue.is_reuse = '2'
        this.goodInfo.goodInfoDialog.formValue.good_name = ''
        this.goodInfo.goodInfoDialog.formValue.pinyin = ''
        this.goodInfo.goodInfoDialog.formValue.wubi = ''
        this.goodInfo.goodInfoDialog.formValue.good_kind = ''
        this.goodInfo.goodInfoDialog.formValue.medical_insurance_level = ''
        this.goodInfo.goodInfoDialog.formValue.retail_price = ''
        this.goodInfo.goodInfoDialog.formValue.medical_insurance_number = ''
        this.goodInfo.goodInfoDialog.formValue.is_special_diseases = ''
        this.goodInfo.goodInfoDialog.formValue.is_record = ''
        this.goodInfo.goodInfoDialog.formValue.statistics_category = ''
        this.goodInfo.goodInfoDialog.formValue.good_status = ''
        this.goodInfo.goodInfoDialog.formValue.default_count = ''
        this.goodInfo.goodInfoDialog.formValue.sign = ''
        this.goodInfo.goodInfoDialog.formValue.is_default = ''
        this.goodInfo.goodInfoDialog.formValue.is_charge_use = ''
        this.goodInfo.goodInfoDialog.formValue.is_charge_predict = ''
        this.goodInfo.goodInfoDialog.formValue.is_statistics_work = ''
        this.goodInfo.goodInfoDialog.formValue.sort = ''
        this.goodInfo.goodInfoDialog.formValue.is_doctor_use = ''
        this.goodInfo.goodInfoDialog.formValue.agent = ''
        this.goodInfo.goodInfoDialog.formValue.good_number = ''

        this.$refs.addConsumable.show(0)
      }
    }, created() {
      this.getList()
      this.getAllDealer()
      this.getAllManufacturer()
      this.getAllGoodType()
      this.goodInfo.goodInfoDialog.formValue.goodUnit = this.$store.getters.good_unit
    }
  }
</script>
