
<template>
  <el-dialog :close-on-click-modal="false" v-dialogDrag title="开单" :visible.sync="billsDialogVisible" width="80%" :before-close="handleClose">
    <div class="bills">
      <el-form :inline="true" :model="vipFrom" ref="form" style="height:70vh;overflow: auto;">
        <div class="vipheader">
          <el-form-item label="是否会员：" :label-width="formLabelWidth">
            <el-checkbox v-model="vipFrom.cashNumber" @change="openPhone">会员</el-checkbox>
          </el-form-item>
          <el-form-item label="姓名：" :label-width="formLabelWidth">
            <span>{{vipFrom.memberName}}</span>
          </el-form-item>
          <el-form-item v-show="!vipFrom.cashNumber" label="手机号：" :label-width="formLabelWidth">
            <span style="margin-right:23px">{{vipFrom.mobilePhone}}</span>
          </el-form-item>
          <el-form-item v-show="vipFrom.cashNumber" label="手机号：" :label-width="formLabelWidth">
            <span v-show="!phoneInputShow" @click="openPhone">{{vipFrom.mobilePhone}}</span>
            <el-input maxlength="11" oninput="this.value=this.value.replace(/\D/g,'')" pattern="[0-9]*" ref="input" @change="endPhone" @blur="endPhone" @keydown.enter="endPhone" v-show="phoneInputShow" style="width:120px" size="mini" v-model="vipFrom.mobilePhone"></el-input>
          </el-form-item>
          <el-form-item v-show="vipFrom.cashNumber&&vipFrom.sex" label="性别：" :label-width="formLabelWidth">
            <div style="width:55px">
              <span>{{vipFrom.sex}}</span>
            </div>
          </el-form-item>
          <el-form-item v-show="vipFrom.num" label="排队号：" :label-width="formLabelWidth">
            <span>{{vipFrom.num}}</span>
          </el-form-item>
          <br />
          <div v-show="vipFrom.cashNumber">
            <el-form-item :label-width="formLabelWidth">
              <el-collapse style="width:200px;margin-left:25px" value="1">
                <el-collapse-item title="折扣卡：" name="1">
                  <div style="max-height:150px;overflow:auto">
                    <div v-for="(card,index) in cardlist" :key="index" style="display:flex;justify-content: flex-start;">
                      <div :title="card.rechargeTypeName+'--剩余可用金额 ¥ '+card.cardOver" style="max-width:150px;display: inline-block;cursor: pointer; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">
                        {{card.rechargeTypeName}} -- </div>
                      <div style="margin-left:5px;"> ¥{{card.cardOver}}</div>
                    </div>
                  </div>
                </el-collapse-item>
              </el-collapse>
            </el-form-item>
            <el-form-item :label-width="formLabelWidth">
              <el-collapse style="width:200px;padding-left:5px" value="2">
                <el-collapse-item title="项目包：" name="2">
                  <div style="max-height:150px;overflow:auto">
                    <div v-for="(project,index1) in projectlist" :key="index1" style="display:flex;justify-content: flex-start;">
                      <div :title="project.courseProjectName+'--剩余'+project.courseConsumeCount+'次'" style="max-width:150px;display: inline-block;cursor: pointer; overflow: hidden;white-space: nowrap;text-overflow: ellipsis;">{{project.courseProjectName}} </div>
                      <div style="margin-left:5px;"> {{project.courseConsumeCount}} 次</div>
                    </div>
                  </div>
                </el-collapse-item>
              </el-collapse>
            </el-form-item>
            <!-- <el-form-item :label-width="formLabelWidth">
            <el-collapse style="width:160px;padding-left:0px" value="3">
              <el-collapse-item title="优惠卷：" name="3">
                <div style="max-height:150px;overflow:auto">
                  <div v-for="(coupon,index1) in couponlist" :key="index1">{{coupon.couponName}}</div>
                </div>
              </el-collapse-item>
            </el-collapse>
          </el-form-item> -->
            <el-form-item label="积分：" :label-width="formLabelWidth">
              <span>{{vipFrom.integral}}</span>
            </el-form-item>
          </div>
        </div>
        <!-- *************************项目 ***************************** -->
        <el-row>
          <el-col class="prolistdiv" v-for="(item,index) in projectTable" :key="index">
            <el-form-item label="项目：" label-width="60px" :show-overflow-tooltip='true'>
              <div :title="item.projectName" style="cursor: pointer;width:100px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;" @click="editProject(proIndex =index,proDialogVisible=true,projectText='修改')">{{item.projectName==null?'未选项目':item.projectName}}
              </div>
            </el-form-item>
            <el-form-item label="单价：" label-width="60px">
              <div style="min-width:60px;min-height:28px;cursor: pointer;" v-show="!item.priceShow" @click="openPrice(item,index)">{{item.transactionPrice}}</div>
              <el-input type="number" :ref="'priceIndex'+index" v-show="item.priceShow" style="width:80px;height:30px;" size="mini" v-model="item.transactionPrice" @blur="endPriceNo(item,index)" @keydown.enter="endPriceNo(item,index)">
              </el-input>
            </el-form-item>
            <el-form-item label="次数：" label-width="60px">
              <a @click="openNumber(item,index)" style="cursor: pointer;">
                <span style="margin-left:5px;margin-right:5px;" v-show="!item.numberShow">{{item.numberTimes}}</span>
                <el-input oninput="this.value=this.value.replace(/\D/g,'')" pattern="[0-9]*" :ref="'numberInput'+index" autofocus="true" minlength="1" maxlength="2" v-show="item.numberShow" @change="endNumber(item)" @blur="endNumber(item)" @keydown.enter="endNumber(item)" v-model="item.numberTimes" style="width:60px;margin:0px 3px;" size="mini"></el-input>次
              </a>
            </el-form-item>
            <el-form-item label="美容师：" label-width="60px">
              <div style="min-width:60px;min-height:28px;cursor: pointer;" @click="openbea(item,index,beaDialogVisible=true)">{{item.largeOneNumber}}-{{item.serviceLargeOneStaffName}}</div>
            </el-form-item>
            <el-form-item label="美发师：" label-width="60px">
              <div style="min-width:60px;min-height:28px;cursor: pointer;" @click="openhai(item,index,haiDialogVisible=true)">{{item.zhonggongOneNumber}}-{{item.serviceZhonggongOneStaffName}}</div>
            </el-form-item>
            <el-form-item label="技师：" label-width="60px">
              <div style="min-width:60px;min-height:28px;cursor: pointer;" @click="opentec(item,index,tecDialogVisible=true)">{{item.technicianOneNumber}}-{{item.serviceTechnicianOneStaffName}}</div>
            </el-form-item>
            <el-form-item label="助理：" label-width="60px">
              <div style="min-width:60px;min-height:28px;cursor: pointer;" @click="openaid(item,index,aidDialogVisible=true)">{{item.smallOneNumber}}-{{item.serviceSmallOneStaffName}}</div>
            </el-form-item>
            <el-tooltip effect="dark" content="删除" placement="top-end">
              <i @click="delProject(item,index)" class="el-icon-delete text-red prolistdiv-del"></i>
            </el-tooltip>
          </el-col>
          <el-col class="prolistdiv add">
            <i @click="addOpen( addDialogVisible=true)" class="el-icon-plus text-blue"></i>
          </el-col>
        </el-row>

        <div style="position: absolute;bottom:10px;right:30px;padding-bottom:10px">
          <el-button style="margin-right:5px" size="mini" type="primary" @click="handleClose" plain>取 消</el-button>
          <el-button size="mini" type="primary" :loading="loading" @click="childClick(loading=true)">确 定</el-button>
        </div>
      </el-form>
      <!-- ************************************添加项目************************* -->
      <el-dialog :close-on-click-modal="false" :modal-append-to-body="false" :modal="false" title="添加" :visible.sync="addDialogVisible" :before-close="handleCloses">
        <el-form :model="addForm" ref="addForm">
          <el-form-item label="项目：" prop="project" :label-width="formLabelWidths">
            <el-button v-show="addProShow" size="mini" type="primary" plain @click="openStoreProject(addproDialogVisible = true,openProject=0)">门店项目</el-button>
            <span v-show="vipFrom.cashNumber==1">
              <el-button v-show="addProShow" size="mini" type="primary" plain @click="openVipProject(addproDialogVisible = true,openProject=1)">卡包项目</el-button>
            </span>
            <span class="addspan" @click=" addproDialogVisible=true">{{addForm.projectName}}</span>
          </el-form-item>
          <el-form-item label="单价：" prop="project" :label-width="formLabelWidths">
            <el-input type="number" v-model="addForm.transactionPrice" style="width:180px" @blur="endPrice">
            </el-input>
          </el-form-item>
          <el-form-item label="次数：" prop="project" :label-width="formLabelWidths">
            <el-input oninput="this.value=this.value.replace(/\D/g,'')" pattern="[0-9]*" type="number" v-model="addForm.numberTimes" maxlength="3" minlength="1" style="width:180px"></el-input>
          </el-form-item>
          <el-form-item label="美容师：" prop="project" :label-width="formLabelWidths">
            <el-button v-show="addbeaShow" size="mini" type="primary" plain @click="addbeaDialogVisible = true">选择</el-button>
            <span class="addspan" @click="addbeaDialogVisible=true">{{addForm.largeOneNumber}}-{{addForm.serviceLargeOneStaffName}}</span>
          </el-form-item>
          <el-form-item label="美发师：" prop="project" :label-width="formLabelWidths">
            <el-button v-show="addHaiShow" size="mini" type="primary" plain @click="addhaiDialogVisible = true">选择</el-button>
            <span class="addspan" @click="addhaiDialogVisible=true">{{addForm.zhonggongOneNumber}}-{{addForm.serviceZhonggongOneStaffName}}</span>
          </el-form-item>
          <el-form-item label="技师：" prop="project" :label-width="formLabelWidths">
            <el-button v-show="addtecShow" size="mini" type="primary" plain @click="addtecDialogVisible = true">选择</el-button>
            <span class="addspan" @click="addtecDialogVisible=true">{{addForm.technicianOneNumber}}-{{addForm.serviceTechnicianOneStaffName}}</span>
          </el-form-item>
          <el-form-item label="助理：" prop="project" :label-width="formLabelWidths">
            <el-button v-show="addaidShow" size="mini" type="primary" plain @click="addaidDialogVisible = true">选择</el-button>
            <span class="addspan" @click="addaidDialogVisible=true">{{addForm.smallOneNumber}}-{{addForm.serviceSmallOneStaffName}}</span>
          </el-form-item>
        </el-form>
        <span slot="footer" class="dialog-footer">
          <el-button size="mini" type="primary" @click="handleCloses">取 消</el-button>
          <el-button size="mini" type="primary" @click="addconfirm(addDialogVisible = false)">确 定</el-button>
        </span>
      </el-dialog>

      <!-- /////////////////////////////// 添加项目弹窗 开始 ///////////////////////////// -->
      <el-dialog :close-on-click-modal="false" :modal-append-to-body="false" :modal="false" title="项目" :visible.sync="addproDialogVisible" width="40%">
        <input class="input" type="primary" v-model="addproinput" placeholder="搜索项目" />
        <el-table :data="addproTable" @current-change="addproradios" @row-dblclick="addproconfirm(addproDialogVisible = false)" max-height="550">
          <el-table-column label="选择" width="80">
            <template slot-scope="scope">
              <el-radio v-model="addproradio" :label="scope.row.projectId" @change.native="(scope.row)"></el-radio>
            </template>
          </el-table-column>
          <el-table-column v-if="openProject==0" align="center" min-width="100" prop="projectNum" label="编号"></el-table-column>
          <el-table-column align="center" min-width="160" prop="projectName" label="名称"></el-table-column>
          <el-table-column v-if="openProject==1" align="center" min-width="100" sortable="" prop="courseConsumeCount" label="可用次数"></el-table-column>
        </el-table>
        <span slot="footer" class="dialog-footer">
          <el-button size="mini" type="primary" plain @click="addproDialogVisible = false">取 消</el-button>
          <el-button size="mini" type="primary" @click="addproconfirm(addproDialogVisible = false)">确 定</el-button>
        </span>
      </el-dialog>

      <!--  ******************************** 美发师修改 ********************************** -->
      <el-dialog :close-on-click-modal="false" :modal-append-to-body="false" :modal="false" title="美发师" :visible.sync="haiDialogVisible" width="40%">
        <input class="input" type="primary" v-model="haiinput" placeholder="搜索" />
        <el-table :data="haiTable" @row-dblclick="haiconfirm(haiDialogVisible = false)" @current-change="hairadio">
          <el-table-column label="选择" width="80">
            <template slot-scope="scope">
              <el-radio v-model="radiohai" :label="scope.row.zhonggongOneNumber" @change.native="scope.row"></el-radio>
            </template>
          </el-table-column>
          <el-table-column align="center" width="100" prop="zhonggongOneNumber" label="水牌号"></el-table-column>
          <el-table-column align="center" min-width="160" prop="serviceZhonggongOneStaffName" label="名称"></el-table-column>
        </el-table>
        <span slot="footer" class="dialog-footer">
          <el-button size="mini" type="primary" plain @click="haiDialogVisible = false">取 消</el-button>
          <el-button size="mini" type="primary" @click="haiconfirm(haiDialogVisible = false)">确 定</el-button>
        </span>
      </el-dialog>
      <!--  ******************************** 美发师增加 ********************************** -->
      <el-dialog :close-on-click-modal="false" :modal-append-to-body="false" :modal="false" title="美发师" :visible.sync="addhaiDialogVisible" width="40%">
        <input class="input" type="primary" v-model="addhaiinput" placeholder="搜索" />
        <el-table :data="addhaiTable" @row-dblclick="addhaiconfirm(addhaiDialogVisible = false)" @current-change="addhairadio">
          <el-table-column label="选择" width="80">
            <template slot-scope="scope">
              <el-radio v-model="addradiohai" :label="scope.row.zhonggongOneNumber" @change.native="scope.row"></el-radio>
            </template>
          </el-table-column>
          <el-table-column align="center" width="100" prop="zhonggongOneNumber" label="水牌号"></el-table-column>
          <el-table-column align="center" min-width="160" prop="serviceZhonggongOneStaffName" label="名称"></el-table-column>
        </el-table>
        <span slot="footer" class="dialog-footer">
          <el-button size="mini" type="primary" plain @click="addhaiDialogVisible = false">取 消</el-button>
          <el-button size="mini" type="primary" @click="addhaiconfirm(addhaiDialogVisible = false)">确 定</el-button>
        </span>
      </el-dialog>
      <!-- ************************************美容师修改 *************************************** -->
      <el-dialog :close-on-click-modal="false" :modal-append-to-body="false" :modal="false" title="美发师" :visible.sync="beaDialogVisible" width="40%">
        <input class="input" type="primary" v-model="beainput" placeholder="搜索" />
        <el-table :data="beaTable" @row-dblclick="beaconfirm(beaDialogVisible = false)" @current-change="bearadio">
          <el-table-column label="选择" width="80">
            <template slot-scope="scope">
              <el-radio v-model="radiobea" :label="scope.row.largeOneNumber" @change.native="scope.row"></el-radio>
            </template>
          </el-table-column>
          <el-table-column align="center" width="100" prop="largeOneNumber" label="水牌号"></el-table-column>
          <el-table-column align="center" min-width="160" prop="serviceLargeOneStaffName" label="名称"></el-table-column>
        </el-table>
        <span slot="footer" class="dialog-footer">
          <el-button size="mini" type="primary" plain @click="beaDialogVisible = false">取 消</el-button>
          <el-button size="mini" type="primary" @click="beaconfirm(beaDialogVisible = false)">确 定</el-button>
        </span>
      </el-dialog>
      <!--  ******************************** 美容师增加 ********************************** -->
      <el-dialog :close-on-click-modal="false" :modal-append-to-body="false" :modal="false" title="美容师" :visible.sync="addbeaDialogVisible" width="40%">
        <input class="input" type="primary" v-model="addbeainput" placeholder="搜索" />
        <el-table :data="addbeaTable" @row-dblclick="addbeaconfirm(addbeaDialogVisible = false)" @current-change="addbearadio">
          <el-table-column label="选择" width="80">
            <template slot-scope="scope">
              <el-radio v-model="addradiobea" :label="scope.row.largeOneNumber" @change.native="scope.row"></el-radio>
            </template>
          </el-table-column>
          <el-table-column align="center" width="100" prop="largeOneNumber" label="水牌号"></el-table-column>
          <el-table-column align="center" min-width="160" prop="serviceLargeOneStaffName" label="名称"></el-table-column>
        </el-table>
        <span slot="footer" class="dialog-footer">
          <el-button size="mini" type="primary" plain @click="addbeaDialogVisible = false">取 消</el-button>
          <el-button size="mini" type="primary" @click="addbeaconfirm(addbeaDialogVisible = false)">确 定</el-button>
        </span>
      </el-dialog>
      <!-- ************************************助理修改 *************************************** -->
      <el-dialog :close-on-click-modal="false" :modal-append-to-body="false" :modal="false" title="助理" :visible.sync="aidDialogVisible" width="40%">
        <input class="input" type="primary" v-model="aidinput" placeholder="搜索" />
        <el-table :data="aidTable" @row-dblclick="aidconfirm(aidDialogVisible = false)" @current-change="aidradio">
          <el-table-column label="选择" width="80">
            <template slot-scope="scope">
              <el-radio v-model="radioaid" :label="scope.row.smallOneNumber" @change.native="scope.row"></el-radio>
            </template>
          </el-table-column>
          <el-table-column align="center" width="100" prop="smallOneNumber" label="水牌号"></el-table-column>
          <el-table-column align="center" min-width="160" prop="serviceSmallOneStaffName" label="名称"></el-table-column>
        </el-table>
        <span slot="footer" class="dialog-footer">
          <el-button size="mini" type="primary" plain @click="aidDialogVisible = false">取 消</el-button>
          <el-button size="mini" type="primary" @click="aidconfirm(aidDialogVisible = false)">确 定</el-button>
        </span>
      </el-dialog>
      <!--  ******************************** 助理增加 ********************************** -->
      <el-dialog :close-on-click-modal="false" :modal-append-to-body="false" :modal="false" title="助理" :visible.sync="addaidDialogVisible" width="40%">
        <input class="input" type="primary" v-model="addaidinput" placeholder="搜索" />
        <el-table :data="addaidTable" @row-dblclick="addaidconfirm(addaidDialogVisible = false)" @current-change="addaidradio">
          <el-table-column label="选择" width="80">
            <template slot-scope="scope">
              <el-radio v-model="addradioaid" :label="scope.row.smallOneNumber" @change.native="scope.row"></el-radio>
            </template>
          </el-table-column>
          <el-table-column align="center" width="100" prop="smallOneNumber" label="水牌号"></el-table-column>
          <el-table-column align="center" min-width="160" prop="serviceSmallOneStaffName" label="名称"></el-table-column>
        </el-table>
        <span slot="footer" class="dialog-footer">
          <el-button size="mini" type="primary" plain @click="addaidDialogVisible = false">取 消</el-button>
          <el-button size="mini" type="primary" @click="addaidconfirm(addaidDialogVisible = false)">确 定</el-button>
        </span>
      </el-dialog>
      <!-- ************************************技师 修改 *************************************** -->
      <el-dialog :close-on-click-modal="false" :modal-append-to-body="false" :modal="false" title="技师" :visible.sync="tecDialogVisible" width="40%">
        <input class="input" type="primary" v-model="tecinput" placeholder="搜索" />
        <el-table :data="tecTable" @row-dblclick="tecconfirm(tecDialogVisible = false)" @current-change="tecradio">
          <el-table-column label="选择" width="80">
            <template slot-scope="scope">
              <el-radio v-model="radiotec" :label="scope.row.technicianOneNumber" @change.native="scope.row"></el-radio>
            </template>
          </el-table-column>
          <el-table-column align="center" width="100" prop="technicianOneNumber" label="水牌号"></el-table-column>
          <el-table-column align="center" min-width="160" prop="serviceTechnicianOneStaffName" label="名称"></el-table-column>
        </el-table>
        <span slot="footer" class="dialog-footer">
          <el-button size="mini" type="primary" plain @click="tecDialogVisible = false">取 消</el-button>
          <el-button size="mini" type="primary" @click="tecconfirm(tecDialogVisible = false)">确 定</el-button>
        </span>
      </el-dialog>
      <!--  ******************************** 技师 增加 ********************************** -->
      <el-dialog :close-on-click-modal="false" :modal-append-to-body="false" :modal="false" title="技师" :visible.sync="addtecDialogVisible" width="40%">
        <input class="input" type="primary" v-model="addtecinput" placeholder="搜索" />
        <el-table :data="addtecTable" @row-dblclick="addtecconfirm(addtecDialogVisible = false)" @current-change="addtecradio">
          <el-table-column label="选择" width="80">
            <template slot-scope="scope">
              <el-radio v-model="addradiotec" :label="scope.row.technicianOneNumber" @change.native="scope.row"></el-radio>
            </template>
          </el-table-column>
          <el-table-column align="center" width="100" prop="technicianOneNumber" label="水牌号"></el-table-column>
          <el-table-column align="center" min-width="160" prop="serviceTechnicianOneStaffName" label="名称"></el-table-column>
        </el-table>
        <span slot="footer" class="dialog-footer">
          <el-button size="mini" type="primary" plain @click="addtecDialogVisible = false">取 消</el-button>
          <el-button size="mini" type="primary" @click="addtecconfirm(addtecDialogVisible = false)">确 定</el-button>
        </span>
      </el-dialog>
      <project ref="project" @projectData="projectData"></project>
      <staff ref="staff" @staffData="staffData"></staff>
    </div>
  </el-dialog>

</template>

<script>
import {
  selectList,
  storeMemberOne,
  recAccountList,
  recAccountCashList,
  couAccountList,
  addCashList,
  proOne,
} from "../../../api/eashier.js";
import { propage } from "../../../api/storeManage.js";
import { partten } from "../../../../partten/index.js";
import project from "@/components/project/index";
import staff from "@/components/staff/index";
export default {
  name: "bills",
  components: { project, staff },
  data() {
    return {
      billsDialogVisible: false,
      projectTable: [],
      sessionStorageData: {}, //门店参数集合
      projectText: "添加",
      formLabelWidths: "70px",
      phoneInputShow: false,
      /*添加项目弹窗*/
      addDialogVisible: false,
      /**项目弹窗 */
      proDialogVisible: false,
      addproDialogVisible: false,
      //*美发师弹窗 */
      haiDialogVisible: false,
      addhaiDialogVisible: false,
      //*美容师弹窗 */
      beaDialogVisible: false,
      addbeaDialogVisible: false,
      //*助理弹窗 */
      aidDialogVisible: false,
      addaidDialogVisible: false,
      //*技师弹窗 */
      tecDialogVisible: false,
      addtecDialogVisible: false,
      /*修改数字show*/
      addShow: false,
      number: 1,
      /* 项目搜索*/
      currentSelectItem: {},
      proinput: "",
      addproinput: "",
      addProShow: true,
      formLabelWidth: "90px",
      addProRadio: "",
      addproradio: "",
      /* 美发师修改*/
      radiohai: "",
      haiinput: "",
      haiRadio: "",
      /*美发师增加*/
      addHaiShow: true,
      addhaiinput: "",
      addradiohai: "",

      addhairadios: "",
      /* 美容师修改*/
      radiobea: "",
      beainput: "",
      beaRadio: "",
      /*美容师增加*/
      addbeaShow: true,
      addbeainput: "",
      addradiobea: "",
      addbearadios: "",
      /* 助理修改*/
      radioaid: "",
      aidinput: "",
      aidRadio: "",
      /*助理增加*/
      addaidShow: true,
      addaidinput: "",
      addradioaid: "",
      addaidradios: "",
      /* 技师修改*/
      radiotec: "",
      tecinput: "",
      tecRadio: "",
      /*技师增加*/
      addtecShow: true,
      addtecinput: "",
      addradiotec: "",
      addtecradios: "",
      newNumber: "",
      loading: false,
      vipFrom: {
        mobilePhone: "",
        cashNumber: false,
      },
      cardlist: [],
      projectlist: [],
      couponlist: [],
      addForm: {
        numberTimes: 1,
        transactionPrice: 0,
      },
      addList: [],
      // 项目修改table
      proList: [],
      // 项目添加table
      addproList: [],
      //美发师修改table
      haiList: [],
      //美发师添加table
      addhaiList: [],
      //美容师修改table
      beaList: [],
      //美容师添加table
      addbeaList: [],
      //助理师修改table
      aidList: [],
      //助理添加table
      addaidList: [],
      //技师师修改table
      tecList: [],
      //技师添加table
      addtecList: [],
      proIndex: "",
      haiIndex: "",
      beaIndex: "",
      aidIndex: "",
      tecIndex: "",
      addproIndex: "",
      addbeaIndex: "",
      addaidIndex: "",
      addtecIndex: "",
      openProject: 0,
    };
  },
  methods: {
    handleCloses() {
      this.addForm = {};
      this.addDialogVisible = false;
      this.$refs.addForm.clearValidate();
    },
    //关闭弹窗前的回调方法
    handleClose() {
      this.vipFrom = {};
      this.projectTable = [];
      this.billsDialogVisible = false;
      this.$refs.form.clearValidate();
    },
    //组件传值
    show(parameValue) {
      this.sessionStorageData = JSON.parse(
        sessionStorage.getItem("sessionStorageData")
      );
      //开单页面的所有查询接口
      var page = {
        pageNum: 1,
        pageSize: 1000,
        state: 1,
        directConsumption: 1,
        storeIds: JSON.parse(sessionStorage.getItem("storeIdLists")),
      };
      propage(page).then((res) => {
        if (res.code == "000000") {
          var project = [];
          res.pageInfo.list.forEach((item) => {
            if (item.directConsumption == 1) {
              var items = {
                projectId: item.id,
                projectName: item.projectName,
                projectNum: item.projectNum,
                minumumTimes: item.minumumTimes,
                price: item.price,
                minumumPrice: item.minumumPrice,
                priceMember: item.priceMember,
                minumumPriceMember: item.minumumPriceMember,
                topPriceMember: item.topPriceMember,
                topPrice: item.topPrice,
                achievementLarge: item.achievementLarge,
                achievementZhonggong: item.achievementZhonggong,
                achievementTechnician: item.achievementTechnician,
                commissionTechnician: item.commissionTechnician,
                achievementSmall: item.achievementSmall,
                commissionLarge: item.commissionLarge,
                commissionZhonggong: item.commissionZhonggong,
                commissionSmall: item.commissionSmall,
                cardAchievementLarge: item.cardAchievementLarge,
                cardAchievementZhonggong: item.cardAchievementZhonggong,
                cardAchievementTechnician: item.cardAchievementTechnician,
                cardAchievementSmall: item.cardAchievementSmall,
                cardCommissionLarge: item.cardCommissionLarge,
                cardCommissionZhonggong: item.cardCommissionZhonggong,
                cardCommissionTechnician: item.cardCommissionTechnician,
                cardCommissionSmall: item.cardCommissionSmall,
                noDiscount: item.noDiscount,
                numberTimes: 1,
                priceShow: false,
                numberShow: false,
              };
              project.push(items);
            }
          });

          this.addproList = project;
          this.proList = project;
          selectList({ id: "" }).then((res) => {
            if (res.code == "000000") {
              var haiList = [];
              var beaList = [];
              var aidList = [];
              var tecList = [];
              res.rows.forEach((item) => {
                var item1 = {
                  zhonggongOneNumber: item.brandNumber,
                  serviceZhonggongOneStaffId: item.id,
                  serviceZhonggongOneStaffName: item.staffName,
                  serviceZhonggongOneIdentityCard: item.identityCard,
                };
                haiList.push(item1);
                var item2 = {
                  technicianOneNumber: item.brandNumber,
                  serviceTechnicianOneStaffId: item.id,
                  serviceTechnicianOneStaffName: item.staffName,
                  serviceTechnicianOneIdentityCard: item.identityCard,
                };
                tecList.push(item2);
                var item3 = {
                  smallOneNumber: item.brandNumber,
                  serviceSmallOneStaffId: item.id,
                  serviceSmallOneStaffName: item.staffName,
                  serviceSmallOneIdentityCard: item.identityCard,
                };
                aidList.push(item3);
                //console.log("item", item);
                var item5 = {
                  largeOneNumber: item.brandNumber,
                  serviceLargeOneStaffId: item.id,
                  serviceLargeOneStaffName: item.staffName,
                  serviceLargeOneIdentityCard: item.identityCard,
                };
                beaList.push(item5);
              });
              this.haiList = haiList;
              this.beaList = beaList;
              this.aidList = aidList;
              this.tecList = tecList;

              this.addhaiList = haiList;
              this.addbeaList = beaList;
              this.addaidList = aidList;
              this.addtecList = tecList;
            } else {
            }
          });
          this.billsDialogVisible = true;
        } else {
          this.$alert(res.message, "提示", {
            confirmButtonText: "确定",
            confirmButtonClass: "confirmbtnFalses",
            type: "warning",
            center: true,
            callback: (action) => {},
          });
        }
      });

      if (parameValue.staffList.length > 0) {
        parameValue.brandNumber = parameValue.staffList[0].brandNumber;
      }
      //选择单号传来的内容
      if (parameValue.isMake == 0) {
      } else {
        var mobilePhone = null;
        if (parameValue.phone == undefined) {
          mobilePhone = parameValue.mobilePhone;
          this.vipFrom.memberName = parameValue.memberName;
          this.vipFrom.mobilePhone = parameValue.mobilePhone;
          this.vipFrom.orderId = parameValue.orderId;
        } else {
          if (parameValue.name == "") {
            this.vipFrom.memberName = "散客";
          } else {
            this.vipFrom.memberName = parameValue.name;
          }
          this.vipFrom.mobilePhone = parameValue.phone;
          this.vipFrom.num = parameValue.num;
          mobilePhone = parameValue.phone;
        }

        storeMemberOne({
          mobilePhone: mobilePhone,
          storeId: sessionStorage.getItem("parentId"),
        }).then((res) => {
          //console.log(res);
          if (res.code == "000000") {
            this.vipFrom.cashNumber = true;
            if (res.data.sex == 1) {
              res.data.sex = "男";
            } else {
              res.data.sex = "女";
            }
            this.vipFrom.sex = res.data.sex;
            this.vipFrom.integral = res.data.integral;
            this.vipFrom.memberId = res.data.id;

            var ids = { storeId: res.data.storeId, memberId: res.data.id };
            recAccountCashList(ids).then((res) => {
              var cardlist = [];
              res.rows.forEach((item) => {
                item.cardOver =
                  item.cardConsumeMoney * 1 + item.giftConsumeMoney * 1;
                cardlist.push(item);
              });
              this.cardlist = cardlist;
            });
            couAccountList(ids).then((res) => {
              this.projectlist = res.rows;
            });
          } else {
            this.vipFrom.cashNumber = false;
            this.$message.warning({ message: res.message });
          }
          console.log(parameValue);
          parameValue.projectList.forEach((item) => {
            if (item.id) {
              if (this.vipFrom.cashNumber == true) {
                item.transactionPrice = item.priceMember;
              } else {
                item.transactionPrice = item.price;
              }
              var items = {
                projectId: item.id,
                projectName: item.projectName,
                projectNum: item.projectNum,
                minumumTimes: item.minumumTimes,
                price: item.price,
                transactionPrice: item.transactionPrice,
                minumumPrice: item.minumumPrice,
                priceMember: item.priceMember,
                minumumPriceMember: item.minumumPriceMember,
                topPriceMember: item.topPriceMember,
                topPrice: item.topPrice,
                achievementLarge: item.achievementLarge,
                achievementZhonggong: item.achievementZhonggong,
                achievementTechnician: item.achievementTechnician,
                commissionTechnician: item.commissionTechnician,
                achievementSmall: item.achievementSmall,
                commissionLarge: item.commissionLarge,
                commissionZhonggong: item.commissionZhonggong,
                commissionSmall: item.commissionSmall,
                cardAchievementLarge: item.cardAchievementLarge,
                cardAchievementZhonggong: item.cardAchievementZhonggong,
                cardAchievementTechnician: item.cardAchievementTechnician,
                cardAchievementSmall: item.cardAchievementSmall,
                cardCommissionLarge: item.cardCommissionLarge,
                cardCommissionZhonggong: item.cardCommissionZhonggong,
                cardCommissionTechnician: item.cardCommissionTechnician,
                cardCommissionSmall: item.cardCommissionSmall,
                noDiscount: item.noDiscount,
                numberTimes: 1,
                priceShow: false,
                numberShow: false,
              };
              if (parameValue.courseAccountId != undefined) {
                items.courseAccountId = parameValue.courseAccountId;
              } else {
                items.courseAccountId = item.courseAccountId;
              }
              this.projectTable.push(items);
            }
          });
          switch (parameValue.job) {
            case 5:
              this.projectTable[0].largeOneNumber = parameValue.brandNumber;
              this.projectTable[0].serviceLargeOneStaffName =
                parameValue.staffName;
              this.projectTable[0].serviceLargeOneStaffId = parameValue.staffId;
              this.projectTable[0].serviceLargeOneIdentityCard =
                parameValue.staffItyCard;
              break;
            case 2:
              this.projectTable[0].technicianOneNumber =
                parameValue.brandNumber;
              this.projectTable[0].serviceTechnicianOneStaffName =
                parameValue.staffName;
              this.projectTable[0].serviceTechnicianOneStaffId =
                parameValue.staffId;
              this.projectTable[0].serviceTechnicianOneIdentityCard =
                parameValue.staffItyCard;

              break;
            case 3:
              this.projectTable[0].smallOneNumber = parameValue.brandNumber;
              this.projectTable[0].serviceSmallOneStaffName =
                parameValue.staffName;
              this.projectTable[0].serviceSmallOneStaffId = parameValue.staffId;
              this.projectTable[0].serviceSmallOneIdentityCard =
                parameValue.staffItyCard;
              break;
            case 1:
              this.projectTable[0].zhonggongOneNumber = parameValue.brandNumber;
              this.projectTable[0].serviceZhonggongOneStaffName =
                parameValue.staffName;
              this.projectTable[0].serviceZhonggongOneStaffId =
                parameValue.staffId;
              this.projectTable[0].serviceZhonggongOneIdentityCard =
                parameValue.staffItyCard;

              break;

            default:
              this.projectTable[0].largeOneNumber = parameValue.brandNumber;
              this.projectTable[0].serviceLargeOneStaffName =
                parameValue.staffName;
              this.projectTable[0].serviceLargeOneStaffId = parameValue.staffId;
              this.projectTable[0].serviceLargeOneIdentityCard =
                parameValue.staffItyCard;
              break;
          }
        });
      }
    },
    staffData() {},
    addOpen() {
      this.addForm = { numberTimes: 1, transactionPrice: 0 };
      this.addProShow = true;
      this.addbeaShow = true;
      this.addhaiShow = true;
      this.addaidShow = true;
      this.addtecShow = true;
    },

    childClick() {
      this.$emit("childByValue", this.vipFrom);
      var projectTable = [];
      this.projectTable.forEach((item) => {
        //console.log(item);
        item = Object.assign(item, this.vipFrom);
        item.isAddition = 0;
        if (item.cashNumber == true) {
          item.cashNumber = 1;
        } else {
          item.cashNumber = 0;
        }
        delete item.billsDialogVisible;
        delete item.numberShow;
        delete item.priceShow;
        delete item.sex;
        delete item.phone;
        delete item.projectNum;
        delete item.integral;
        projectTable.push(item);
      });
      var list = [];
      var list1 = [];
      for (let i in this.projectTable) {
        if (this.projectTable[i].numberTimes * 1 > 1) {
          for (let j = 0; j < this.projectTable[i].numberTimes * 1; j++) {
            list.push(this.projectTable[i]);
          }
        } else {
          list1.push(this.projectTable[i]);
        }
      }
      list.forEach((item) => {
        item.numberTimes = 1;
      });
      var lists = [...list, ...list1];

      addCashList(lists).then((res) => {
        if (res.code == "000000") {
          this.$message.success({ message: res.message });
        } else {
          this.$alert(res.message, "提示", {
            confirmButtonText: "确定",
            confirmButtonClass: "confirmbtnFalses",
            type: "warning",
            center: true,
            callback: (action) => {},
          });
        }
        this.loading = false;
      });
    },
    //修改手机号
    openPhone() {
      this.phoneInputShow = true;
      this.$nextTick(() => {
        this.$refs.input.focus();
      });
      this.projectTable[0].transactionPrice = this.projectTable[0].price;
    },
    //手机号查询
    endPhone() {
      var phones = partten.phoneNum;
      if (!phones.test(this.vipFrom.mobilePhone)) {
        this.$message.info({ message: "请输入正确的手机号 ! " });
      } else {
        this.phoneInputShow = false;
        storeMemberOne({
          mobilePhone: this.vipFrom.mobilePhone,
          storeId: sessionStorage.getItem("parentId"),
        }).then((res) => {
          //console.log(res);
          if (res.code == "000000") {
            this.vipFrom.memberName = res.data.memberName;
            this.projectTable[0].transactionPrice =
              this.projectTable[0].priceMember;
            if (res.data.sex == 1) {
              res.data.sex = "男";
            } else {
              res.data.sex = "女";
            }
            this.vipFrom.sex = res.data.sex;
            this.vipFrom.memberId = res.data.id;
            this.vipFrom.integral = res.data.integral;
            this.vipFrom.card = res.data.card;
            var ids = { storeId: res.data.storeId, memberId: res.data.id };
            recAccountCashList(ids).then((res) => {
              //console.log("充值卡", res);
              var cardlist = [];
              res.rows.forEach((item) => {
                item.cardOver =
                  item.cardConsumeMoney * 1 + item.giftConsumeMoney * 1;
                cardlist.push(item);
              });
              this.cardlist = cardlist;
            });
            couAccountList(ids).then((res) => {
              //console.log("疗程", res);
              this.projectlist = res.rows;
            });
          } else {
            this.vipFrom.cashNumber = 0;
            this.vipFrom.memberId = null;
            this.$alert(res.message, "提示", {
              confirmButtonText: "确定",
              confirmButtonClass: "confirmbtnFalses",
              type: "warning",
              center: true,
              callback: (action) => {},
            });
          }
        });
      }
    },
    addconfirm() {
      if (this.vipFrom.cashNumber == true) {
        this.addForm.transactionPrice = this.addForm.priceMember;
      } else {
        this.addForm.transactionPrice = this.addForm.price;
      }
      if (this.addForm.numberTimes > 0) {
      } else {
        this.addForm.numberTimes = 1;
      }
      console.log(this.addForm);
      this.projectTable.push(this.addForm);
    },
    // ****************项目单价修改/******************************* */
    openPrice(item, index) {
      let form = { ...item };
      form.priceShow = true;
      let projectTable = [...this.projectTable];
      projectTable[index] = form;
      this.projectTable = [];
      this.projectTable = projectTable;
      let number = "priceIndex" + index;
      this.$nextTick(() => {
        this.$refs["priceIndex" + index][0].focus();
      });
    },
    endPriceNo(item, index) {
      if (this.sessionStorageData.minimum == true) {
        if (this.vipFrom.cashNumber == false) {
          //console.log(this.vipFrom.cashNumber);
          if (item.topPrice >= item.transactionPrice * 1 >= item.minumumPrice) {
            item.priceShow = false;
          } else {
            this.$message.error({
              message:
                "价格不能低于" + item.minumumPrice + "高于" + item.topPrice,
            });
          }
        } else {
          if (
            item.topPriceMember >=
            item.transactionPrice * 1 >=
            item.minumumPriceMember
          ) {
            item.priceShow = false;
          } else {
            this.$message.error({
              message:
                "价格不能低于" +
                item.minumumPriceMember +
                "高于" +
                item.topPriceMember,
            });
          }
        }
      } else {
        item.priceShow = false;
      }
    },
    /************************次数修改********************** */
    openNumber(item, index) {
      let form = { ...item };
      form.numberShow = true;
      let projectTable = [...this.projectTable];
      projectTable[index] = form;
      this.projectTable = [];
      this.projectTable = projectTable;
      this.$nextTick(() => {
        this.$refs["numberInput" + index][0].focus();
      });
    },
    endNumber(item) {
      if (item.numberTimes > 0) {
        item.numberShow = false;
      } else {
        item.numberTimes = 1;
      }
    },

    //*************************项目修改**********************/
    editProject() {
      this.$refs.project.show(1);
    },
    projectData(form) {
      const projectTable = Object.assign(
        this.projectTable[this.proIndex],
        form
      );
      this.projectTable[this.proIndex] = projectTable;
      if (this.vipFrom.cashNumber) {
        this.projectTable[this.proIndex].transactionPrice =
          projectTable.priceMember;
      } else {
        this.projectTable[this.proIndex].transactionPrice = projectTable.price;
      }
    },
    endPrice() {
      if (this.sessionStorageData.minimum == true) {
        if (this.vipFrom.cashNumber == 1) {
          if (
            this.addForm.topPriceMember <
            this.addForm.transactionPrice * 1 <
            this.addForm.minumumPriceMember
          ) {
          } else {
            this.$message.error({
              message:
                "价格不能低于" +
                item.minumumPriceMember +
                "高于" +
                item.topPriceMember,
            });
          }
        } else {
          if (
            this.addForm.topPrice <
            this.addForm.transactionPrice * 1 <
            this.addForm.minumumPrice
          ) {
          } else {
            this.$message.error({
              message:
                "价格不能低于" + item.minumumPrice + "高于" + item.topPrice,
            });
          }
        }
      }
    },
    /***************************添加项目********************* */
    openStoreProject() {
      this.addproList = this.proList;
      this.$refs.project.show(1);
    },
    openVipProject() {
      storeMemberOne({
        mobilePhone: this.vipFrom.mobilePhone,
        storeId: sessionStorage.getItem("parentId"),
      }).then((res) => {
        if (res.code == "000000") {
          this.buttonShow = true;
          let ids = { memberId: res.data.id, storeId: res.data.storeId };
          couAccountList(ids).then((res) => {
            //console.log(res);
            res.rows.forEach((item) => {
              item.projectName = item.courseProjectName;
              item.projectId = item.id;
            });
            console.log("疗程", res);
            this.addproList = res.rows;
          });
        } else {
          this.$alert(res.message, "提示", {
            confirmButtonText: "确定",
            confirmButtonClass: "confirmbtnFalses",
            type: "warning",
            center: true,
            callback: (action) => {},
          });
        }
      });
    },
    addproradios(row) {
      console.log(row);
      this.addproradio = row.projectId;
      //添加单选
      if (row.courseProjectId != undefined) {
        let ids = { id: row.courseProjectId };
        proOne(ids).then((res) => {
          if (res.code == "000000") {
            var items = {
              projectId: res.data.id,
              projectName: res.data.projectName,
              projectNum: res.data.projectNum,
              minumumTimes: res.data.minumumTimes,
              price: res.data.price,
              minumumPrice: res.data.minumumPrice,
              priceMember: res.data.priceMember,
              minumumPriceMember: res.data.minumumPriceMember,
              topPriceMember: res.data.topPriceMember,
              topPrice: res.data.topPrice,
              achievementLarge: res.data.achievementLarge,
              achievementZhonggong: res.data.achievementZhonggong,
              achievementTechnician: res.data.achievementTechnician,
              commissionTechnician: res.data.commissionTechnician,
              achievementSmall: res.data.achievementSmall,
              commissionLarge: res.data.commissionLarge,
              commissionZhonggong: res.data.commissionZhonggong,
              commissionSmall: res.data.commissionSmall,
              cardAchievementLarge: res.data.cardAchievementLarge,
              cardAchievementZhonggong: res.data.cardAchievementZhonggong,
              cardAchievementTechnician: res.data.cardAchievementTechnician,
              cardAchievementSmall: res.data.cardAchievementSmall,
              cardCommissionLarge: res.data.cardCommissionLarge,
              cardCommissionZhonggong: res.data.cardCommissionZhonggong,
              cardCommissionTechnician: res.data.cardCommissionTechnician,
              cardCommissionSmall: res.data.cardCommissionSmall,
              numberTimes: 1,
              priceShow: false,
              numberShow: false,
            };
            this.addProRadio = items;
            this.addProRadio.courseAccountId = row.id;
          } else {
            this.$alert(res.message, "提示", {
              confirmButtonText: "确定",
              confirmButtonClass: "confirmbtnFalses",
              type: "warning",
              center: true,
              callback: (action) => {},
            });
          }
        });
      } else {
        this.addProRadio = row;
      }
    },
    addproconfirm() {
      if (this.vipFrom.cashNumber == 1) {
        this.addProRadio.transactionPrice = this.addProRadio.priceMember;
      } else {
        this.addProRadio.transactionPrice = this.addProRadio.price;
      }
      this.addForm = Object.assign(this.addForm, this.addProRadio);
      this.addProShow = false;
      console.log(this.addForm);
    },
    /***************************美发师修改******************* */
    openhai(item, index) {
      this.haiIndex = index;
    },
    hairadio(row) {
      this.radiohai = row.zhonggongOneNumber;
      this.haiRadio = row;
    },
    haiconfirm() {
      const projectTable = Object.assign(
        this.projectTable[this.haiIndex],
        this.haiRadio
      );
      this.projectTable[this.haiIndex] = projectTable;
    },
    /***************************美发师添加******************* */
    addhairadio(row) {
      this.addradiohai = row.zhonggongOneNumber;
      this.addhairadios = row;
    },
    addhaiconfirm() {
      const addForm = Object.assign(this.addForm, this.addhairadios);
      this.addForm = addForm;
      this.addHaiShow = false;
    },
    /***************************美容师修改******************* */
    openbea(item, index) {
      this.beaIndex = index;
    },
    bearadio(row) {
      this.radiobea = row.largeOneNumber;
      this.beaRadio = row;
    },
    beaconfirm() {
      const projectTable = Object.assign(
        this.projectTable[this.beaIndex],
        this.beaRadio
      );

      this.projectTable[this.beaIndex] = projectTable;
    },
    /***************************美容师添加******************* */
    addbearadio(row) {
      this.addradiobea = row.largeOneNumber;
      this.addbearadios = row;
    },
    addbeaconfirm() {
      const addForm = Object.assign(this.addForm, this.addbearadios);
      this.addForm = addForm;
      this.addbeaShow = false;
    },
    /***************************助理修改******************* */
    openaid(item, index) {
      this.aidIndex = index;
    },
    aidradio(row) {
      this.radioaid = row.smallOneNumber;
      this.aidRadio = row;
    },
    aidconfirm() {
      const projectTable = Object.assign(
        this.projectTable[this.aidIndex],
        this.aidRadio
      );
      this.projectTable[this.aidIndex] = projectTable;
    },
    /***************************助理添加******************* */
    addaidradio(row) {
      this.addradioaid = row.smallOneNumber;
      this.addaidradios = row;
    },
    addaidconfirm() {
      const addForm = Object.assign(this.addForm, this.addaidradios);
      this.addForm = addForm;
      this.addaidShow = false;
    },
    /***************************技师修改******************* */
    opentec(item, index) {
      this.tecIndex = index;
    },
    tecradio(row) {
      this.radiotec = row.technicianOneNumber;
      this.tecRadio = row;
    },
    tecconfirm() {
      //console.log(this.projectTable);
      //console.log(this.tecRadio);
      const projectTable = Object.assign(
        this.projectTable[this.tecIndex],
        this.tecRadio
      );
      this.projectTable[this.tecIndex] = projectTable;
    },
    /***************************技师添加******************* */
    addtecradio(row) {
      this.addradiotec = row.technicianOneNumber;
      this.addtecradios = row;
    },
    addtecconfirm() {
      const addForm = Object.assign(this.addForm, this.addtecradios);
      this.addForm = addForm;
      this.addtecShow = false;
    },
    //**************************** */ 删除项目********************************/
    delProject(item, index) {
      //console.log(item);
      if (index > 0) {
        this.projectTable.splice(index, 1);
      } else {
        this.$message.info({ message: "默认第一个不能删除只能修改!" });
      }
    },
  },
  computed: {
    //****************项目修改中的过滤搜索************************** */
    proTable() {
      var search = this.proinput.toString().toLowerCase(); //将用户输入的值变字符串并小写
      if (search) {
        return this.proList.filter(function (dataNews) {
          return Object.keys(dataNews).some(function (key) {
            return String(dataNews[key]).toLowerCase().indexOf(search) > -1;
          });
        });
      }
      return this.proList;
    },
    //****************项目添加中的过滤搜索************************** */
    addproTable() {
      var search = this.addproinput.toString().toLowerCase(); //将用户输入的值变字符串并小写
      if (search) {
        return this.addproList.filter(function (dataNews) {
          return Object.keys(dataNews).some(function (key) {
            return String(dataNews[key]).toLowerCase().indexOf(search) > -1;
          });
        });
      }
      return this.addproList;
    },
    /***************************美发师修改搜索************************ */
    haiTable() {
      var search = this.haiinput.toString().toLowerCase(); //将用户输入的值变字符串并小写
      if (search) {
        return this.haiList.filter(function (dataNews) {
          return Object.keys(dataNews).some(function (key) {
            return String(dataNews[key]).toLowerCase().indexOf(search) > -1;
          });
        });
      }
      return this.haiList;
    },
    /***************************美发师添加搜索************************ */
    addhaiTable() {
      var search = this.addhaiinput.toString().toLowerCase(); //将用户输入的值变字符串并小写
      if (search) {
        return this.addhaiList.filter(function (dataNews) {
          return Object.keys(dataNews).some(function (key) {
            return String(dataNews[key]).toLowerCase().indexOf(search) > -1;
          });
        });
      }
      return this.addhaiList;
    },
    /***************************美容师修改搜索************************ */
    beaTable() {
      var search = this.beainput.toString().toLowerCase(); //将用户输入的值变字符串并小写
      if (search) {
        return this.beaList.filter(function (dataNews) {
          return Object.keys(dataNews).some(function (key) {
            return String(dataNews[key]).toLowerCase().indexOf(search) > -1;
          });
        });
      }
      return this.beaList;
    },
    /***************************美容师添加搜索************************ */
    addbeaTable() {
      var search = this.addbeainput.toString().toLowerCase(); //将用户输入的值变字符串并小写
      if (search) {
        return this.addbeaList.filter(function (dataNews) {
          return Object.keys(dataNews).some(function (key) {
            return String(dataNews[key]).toLowerCase().indexOf(search) > -1;
          });
        });
      }
      return this.addbeaList;
    },
    /***************************助理 修改搜索************************ */
    aidTable() {
      var search = this.aidinput.toString().toLowerCase(); //将用户输入的值变字符串并小写
      if (search) {
        return this.aidList.filter(function (dataNews) {
          return Object.keys(dataNews).some(function (key) {
            return String(dataNews[key]).toLowerCase().indexOf(search) > -1;
          });
        });
      }
      return this.aidList;
    },
    /***************************助理 添加搜索************************ */
    addaidTable() {
      var search = this.addaidinput.toString().toLowerCase(); //将用户输入的值变字符串并小写
      if (search) {
        return this.addaidList.filter(function (dataNews) {
          return Object.keys(dataNews).some(function (key) {
            return String(dataNews[key]).toLowerCase().indexOf(search) > -1;
          });
        });
      }
      return this.addaidList;
    },
    /***************************技师 修改搜索************************ */
    tecTable() {
      var search = this.tecinput.toString().toLowerCase(); //将用户输入的值变字符串并小写
      if (search) {
        return this.tecList.filter(function (dataNews) {
          return Object.keys(dataNews).some(function (key) {
            return String(dataNews[key]).toLowerCase().indexOf(search) > -1;
          });
        });
      }
      return this.tecList;
    },
    /***************************技师 添加搜索************************ */
    addtecTable() {
      var search = this.addtecinput.toString().toLowerCase(); //将用户输入的值变字符串并小写
      if (search) {
        return this.addtecList.filter(function (dataNews) {
          return Object.keys(dataNews).some(function (key) {
            return String(dataNews[key]).toLowerCase().indexOf(search) > -1;
          });
        });
      }
      return this.addtecList;
    },
  },
  created() {},
};
</script>
<style>
.vipheader {
  border: 1px solid burlywood;
  box-shadow: 3px 3px 3px #999999;
  margin-bottom: 10px;
  padding-left: 10px;
}
.vip {
  width: 160px;
}
.vipheader .el-form-item__label {
  height: 20px;
}
.vipheader .el-form-item {
  margin-bottom: 0;
}
.add {
  border: 1px solid #999999;
  box-shadow: 5px 5px 5px #999999;
  height: 330px;
  margin-left: 20px;
  text-align: center;
  display: inline-block;
  /* position: relative;
  top: -160px; */
}
.add i {
  font-size: 54px;
  line-height: 240px;
}
.add i:hover {
  cursor: pointer;
}
.adds .el-input {
  width: 200px;
}
.el-collapse-item__arrow {
  margin: 0;
}
.bills .el-form-item {
  margin-left: 20px;
}
.list {
  border: 1px solid #999999;
  width: 240px;
  height: 280px;
  min-width: 235px;
  display: inline-block;
  box-shadow: 5px 5px 5px #999999;
}
.list .el-form-item {
  height: 25px;
}
.list span:hover {
  cursor: pointer;
}
.addshow {
  border: 1px solid #999999;
  width: 240px;
  height: 280px;
  min-width: 235px;

  display: inline-block;
  box-shadow: 5px 5px 5px #999999;
  position: relative;
}
.addshow i {
  font-size: 22px;
  position: absolute;
  right: 5px;
  bottom: 10px;
}
.addshow i:hover {
  cursor: pointer;
  background: rgb(247, 137, 137);
  border-radius: 10px;
  box-shadow: 5px 5px 5px #999999;
}
.flex {
  display: flex;
}
.addspan:hover {
  cursor: pointer;
}
.bills .el-radio__label {
  display: none;
}
.prolistdiv {
  display: inline-block;
  border: #999999 1px solid;
  width: 240px;
  height: 300px;
  margin: 10px;
  box-shadow: #999999 3px 3px 3px;
  position: relative;
  border-radius: 8px;
}
.prolistdiv .el-form-item {
  height: 26px;
}
.prolistdiv-del {
  position: absolute;
  bottom: 15px;
  right: 15px;
  font-size: 18px;
}
.bills {
  height: 70vh;
  overflow: auto;
}
.bills /deep/ .el-dialog__body {
  padding: 0 20 10 20 !important;
}
</style>
