浏览代码

药柜添加全选功能

hd 2 月之前
父节点
当前提交
1b5edb83db

+ 12 - 12
mini-pro-web/.env.production

@ -1,17 +1,17 @@
#VUE_APP_BASE_API = 'https://zb.xmtyw.cn/medicine'
#VUE_APP_IMAGE_SERVER = 'https://zb.xmtyw.cn/'
#VUE_APP_SOCKET_URL = 'https://zb.xmtyw.cn'
#VUE_APP_IM_API = 'https://zb.xmtyw.cn/api/v2'
#VUE_APP_PRE_PATH = '/medicine/intelligent-medicine-abinet'
#VUE_APP_MACHINE_SOCKET_URL = 'wss://zb.xmtyw.cn/cabinet/websocket/'
VUE_APP_BASE_API = 'https://zb.xmtyw.cn/medicine'
VUE_APP_IMAGE_SERVER = 'https://zb.xmtyw.cn/'
VUE_APP_SOCKET_URL = 'https://zb.xmtyw.cn'
VUE_APP_IM_API = 'https://zb.xmtyw.cn/api/v2'
VUE_APP_PRE_PATH = '/medicine/intelligent-medicine-abinet'
VUE_APP_MACHINE_SOCKET_URL = 'wss://zb.xmtyw.cn/cabinet/websocket/'
VUE_APP_BASE_API = 'http://10.95.22.10:9660'
VUE_APP_IMAGE_SERVER = 'http://10.95.22.10:9660/fastdfs/'
VUE_APP_SOCKET_URL = 'http://10.95.22.10:9660'
VUE_APP_IM_API = 'http://10.95.22.10:9660/api/v2'
VUE_APP_PRE_PATH = '/intelligent-medicine-abinet'
# VUE_APP_BASE_API = 'http://10.95.22.10:9660'
# VUE_APP_IMAGE_SERVER = 'http://10.95.22.10:9660/fastdfs/'
# VUE_APP_SOCKET_URL = 'http://10.95.22.10:9660'
# VUE_APP_IM_API = 'http://10.95.22.10:9660/api/v2'
# VUE_APP_PRE_PATH = '/intelligent-medicine-abinet'
#VUE_APP_MACHINE_SOCKET_URL = 'ws://10.95.22.10:9660/cabinet/websocket/'
VUE_APP_MACHINE_SOCKET_URL = 'ws://127.0.0.1:9898/cabinet/websocket/'
# VUE_APP_MACHINE_SOCKET_URL = 'ws://127.0.0.1:9898/cabinet/websocket/'
#VUE_APP_BASE_API = 'https://ehr.yihu.com/hlwyy'

+ 1 - 0
mini-pro-web/package.json

@ -4,6 +4,7 @@
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "serve:pro": "vue-cli-service serve --mode production",
    "build": "vue-cli-service build",
    "build:test": "vue-cli-service build --mode test",
    "build:dev": "vue-cli-service build --mode development"

+ 322 - 283
mini-pro-web/src/views/device/cargoLane/index.vue

@ -1,311 +1,350 @@
<template>
    <div class='cargoLaneIndex'>
        <van-sticky :offset-top="offsetTop">
            <div class='grid-4 c-f14 c-border-b c-333 ptb15 bgc-fff'>
                <div class="c-t-center">
                    <div class='c-ff5e6c c-f16 mb5'>{{deviceInfo.layer || 0}}</div>
                    <span>层数</span>
                </div>
                <div class="c-t-center">
                    <div class='c-ff5e6c c-f16 mb5'>{{deviceInfo.aisles || 0}}</div>
                    <span>货道数</span>
                </div>
                <div class="c-t-center">
                    <div class='c-ff5e6c c-f16 mb5'>{{openCount}}</div>
                    <span>启用</span>
                </div>
                <div class="c-t-center">
                    <div class='c-ff5e6c c-f16 mb5'>{{closeCount}}</div>
                    <span>禁用</span>
                </div>
                <div class="c-t-center">
                    <div class='c-ff5e6c c-f16 mb5'>{{faultCount}}</div>
                    <span>故障</span>
                </div>
            </div>
            <div class='bgc-fff p10'>
                <div class='flex f_y_c f_x_s'>
                    <div style="width: 50%" class="pr10">
                        <van-button @click="openAndCloseCargo(1)" block type="info" class='c-border-r-5'>货道开启</van-button>
                    </div>
                    <div style="width: 50%" class="pl10">
                        <van-button @click="openAndCloseCargo(0)" block type="info" class='c-border-r-5'>货道关闭</van-button>
                    </div>
                </div>
                <div class='flex f_y_c f_x_s mt10'>
                    <div style="width: 50%" class="pr10">
                        <van-button @click="findMediicinecabinetInventoryByDeviceId" type="info" style='width:100%;' class='c-border-r-5'>获取货道状态</van-button>
                        <!-- <van-button @click="openAndCloseCargo(1)" block type="info" class='c-border-r-5'>货道开启</van-button> -->
                    </div>
                    <div style="width: 50%" class="pl10">
                        <van-popover v-model="showPopover" :actions="actions" @select="updateDeviceCargoStateApp">
                        <template #reference>
                            <van-button @click="checkSelect" type="info" style='width:100%;' class='c-border-r-5'>设置货道状态</van-button>
                        </template>
                        </van-popover>
                    </div>
                </div>
  <div class="cargoLaneIndex">
    <van-sticky :offset-top="offsetTop">
      <div class="grid-4 c-f14 c-border-b c-333 ptb15 bgc-fff">
        <div class="c-t-center">
          <div class="c-ff5e6c c-f16 mb5">{{ deviceInfo.layer || 0 }}</div>
          <span>层数</span>
        </div>
        <div class="c-t-center">
          <div class="c-ff5e6c c-f16 mb5">{{ deviceInfo.aisles || 0 }}</div>
          <span>货道数</span>
        </div>
        <div class="c-t-center">
          <div class="c-ff5e6c c-f16 mb5">{{ openCount }}</div>
          <span>启用</span>
        </div>
        <div class="c-t-center">
          <div class="c-ff5e6c c-f16 mb5">{{ closeCount }}</div>
          <span>禁用</span>
        </div>
        <div class="c-t-center">
          <div class="c-ff5e6c c-f16 mb5">{{ faultCount }}</div>
          <span>故障</span>
        </div>
      </div>
      <div class="bgc-fff p10">
        <div class="flex f_y_c f_x_s">
          <div style="width: 50%" class="pr10">
            <van-button @click="openAndCloseCargo(1)" block type="info" class="c-border-r-5">货道开启</van-button>
          </div>
          <div style="width: 50%" class="pl10">
            <van-button @click="openAndCloseCargo(0)" block type="info" class="c-border-r-5">货道关闭</van-button>
          </div>
        </div>
        <div class="flex f_y_c f_x_s mt10">
          <div style="width: 50%" class="pr10">
            <van-button @click="findMediicinecabinetInventoryByDeviceId" type="info" style="width:100%;" class="c-border-r-5">获取货道状态</van-button>
            <!-- <van-button @click="openAndCloseCargo(1)" block type="info" class='c-border-r-5'>货道开启</van-button> -->
          </div>
          <div style="width: 50%" class="pl10">
            <van-popover v-model="showPopover" :actions="actions" @select="updateDeviceCargoStateApp">
              <template #reference>
                <van-button @click="checkSelect" type="info" style="width:100%;" class="c-border-r-5">设置货道状态</van-button>
              </template>
            </van-popover>
          </div>
        </div>
                <!-- <div class='mt10'><van-button @click="findMediicinecabinetInventoryByDeviceId" type="info" style='width:100%;' class='c-border-r-5'>获取货道状态</van-button></div> -->
            </div>
        </van-sticky>
        <!-- <div class='mt10'><van-button @click="findMediicinecabinetInventoryByDeviceId" type="info" style='width:100%;' class='c-border-r-5'>获取货道状态</van-button></div> -->
      </div>
    </van-sticky>
        <div class='bgc-fff plr10 pt10' v-if="list&&list.length">
            <div class=' c-f14 list'>
                <div class="row row-header">
                    <div v-for='(item, i) in list[0].list' :key="i" class='c-t-center w50 ptb10 bgc-ccc' >{{i+1}}</div>
                </div>
                <div v-for='(citem, index) in list' :key="index" class="row ">
                    <div v-for='(item, j) in citem.list' :key="j">
                        <div @click="onSelect(item)" class='c-t-center w50 ptb10 mt10 bgc-fff c-border c-position-r' 
                            :class="{'mr10': (Math.ceil(number/6))!=index+1, 'active': selectList.indexOf(item)!=-1}">
                            <div>
                                <div v-if='item.faultState==1' class='c-ff5e6c'>故障</div>
                                <div v-else class='c-20d7ad'>正常</div>
                            </div>
                            <div>
                                <div v-if='item.cargoState==1' class='c-20d7ad'>已开启</div>
                                <div v-else class='c-ff9526'>已关闭</div>
                            </div>
                            <!-- <div>
    <div class="bgc-fff plr10 pt10" v-if="list && list.length">
      <div class=" c-f14 list">
        <div class="row row-header">
          <div class="c-t-center w50 ptb10 bgc-ccc">层数</div>
          <div v-for="(item, i) in list[0].list" :key="i" class="c-t-center w50 ptb10 bgc-ccc">{{ i + 1 }}</div>
        </div>
        <div v-for="(citem, index) in list" :key="index" class="row ">
          <div class="flex flex_co f_xy_c">
            <div style="margin: 6px 0;">{{ index + 1 }}层</div>
            <van-checkbox v-model="checkList[index]" shape="square" @click="rowSelect(index)"></van-checkbox>
          </div>
          <div v-for="(item, j) in citem.list" :key="j">
            <div
              @click="onSelect(item, index)"
              class="c-t-center w50 ptb10 mt10 bgc-fff c-border c-position-r"
              :class="{ 'mr10': Math.ceil(number / 6) != index + 1, 'active': selectList.indexOf(item) != -1 }"
            >
              <div>
                <div v-if="item.faultState == 1" class="c-ff5e6c">故障</div>
                <div v-else class="c-20d7ad">正常</div>
              </div>
              <div>
                <div v-if="item.cargoState == 1" class="c-20d7ad">已开启</div>
                <div v-else class="c-ff9526">已关闭</div>
              </div>
              <!-- <div>
                                <div v-if='true' class='c-20d7ad'>售卖</div>
                                <div v-else class='c-ff5e6c'>停售</div>
                            </div> -->
                        </div>
                    </div>
                    
                    <!-- <div v-for='(item, i) in list[0].list' :key="i" class='c-t-center w50 ptb10 bgc-ccc' >{{i+1}}</div> -->
                </div>
            </div>
          </div>
          <!-- <div v-for='(item, i) in list[0].list' :key="i" class='c-t-center w50 ptb10 bgc-ccc' >{{i+1}}</div> -->
        </div>
        
      </div>
    </div>
  </div>
</template>
<script>
import medicineAbinetApi from '@/api/api-medicineAbinet'
export default{
    name: 'cargoLaneIndex',
    data(){
        return {
            deviceInfo: '',
            deviceId: this.$route.query.deviceId,
            list: [],
            activeKey: 0,
            curItem: [],
            selectList: [],
            openCount: 0,
            closeCount: 0,
            faultCount: 0,
            showPopover: false,
            actions: [
                { text: '故障', code: 1 },
                { text: '正常', code: 0 }
            ]
        }
export default {
  name: 'cargoLaneIndex',
  data() {
    return {
      deviceInfo: '',
      deviceId: this.$route.query.deviceId,
      list: [],
      activeKey: 0,
      curItem: [],
      selectList: [],
      openCount: 0,
      closeCount: 0,
      faultCount: 0,
      showPopover: false,
      actions: [
        { text: '故障', code: 1 },
        { text: '正常', code: 0 }
      ],
      checkList: []
    }
  },
  created() {
    this.findMediicinecabinetInventoryByDeviceId()
    this.findDeviceById()
  },
  methods: {
    $refreshData(noLoading) {
      this.findMediicinecabinetInventoryByDeviceId(noLoading)
    },
    findMediicinecabinetInventoryByDeviceId(noLoading) {
      if (!noLoading) {
        this.$loading('加载中..')
      }
      let p = {
        deviceId: this.deviceId
      }
      medicineAbinetApi
        .findMediicinecabinetInventoryByDeviceId(p)
        .then(res => {
          this.$toast.clear()
          if (res.detailModelList && res.detailModelList.length) {
            var openCount = 0,
              closeCount = 0,
              faultCount = 0
            var list = _.map(res.detailModelList, v => {
              var key = _.keys(v)[0]
              v[key].forEach(m => {
                m.cargoState == 1 ? openCount++ : closeCount++
                if (m.faultState == 1) {
                  faultCount++
                }
              })
              return {
                index: key,
                list: v[key]
              }
            })
            this.openCount = openCount
            this.closeCount = closeCount
            this.faultCount = faultCount
            list = _.sortBy(list, 'index')
            this.list = list
            this.curItem = this.list[0]
          }
        })
        .catch(err => {
          console.error(err)
        })
    },
    created() {
        this.findMediicinecabinetInventoryByDeviceId()
        this.findDeviceById()
    findDeviceById() {
      let p = {
        deviceId: this.deviceId
      }
      medicineAbinetApi
        .findDeviceById(p)
        .then(res => {
          this.$toast.clear()
          this.deviceInfo = res.obj.device
        })
        .catch(err => {
          console.error(err)
        })
    },
    methods:{
        $refreshData(noLoading){
            this.findMediicinecabinetInventoryByDeviceId(noLoading)
        },
        findMediicinecabinetInventoryByDeviceId(noLoading){
            if(!noLoading){
                this.$loading('加载中..')
            }
    onSelect(item, row) {
      item.row = row
      var i = this.selectList.indexOf(item)
      let flag = true
      if (i == -1) {
        this.selectList.push(item)
        this.list[row].list.forEach(el=>{
          if(this.selectList.findIndex(el1=>{return el1.id == el.id}) < 0&&el.faultState != 1){
            flag = false
          }
        })
        this.checkList[row] = flag
      } else {
        this.selectList.splice(i, 1)
        this.list[row].list.forEach(el=>{
          if(this.selectList.findIndex(el1=>{return el1.id == el.id}) < 0&&el.faultState != 1){
            flag = false
          }
        })
        this.checkList[row] = flag
      }
    },
    openAndCloseCargo(cargoState) {
      if (!this.selectList || !this.selectList.length) {
        this.$toast('请选择要操作的通道')
        return
      }
      this.$dialog
        .confirm({
          title: '',
          message: `确定${cargoState == 1 ? '开启' : '关闭'}通道`
        })
        .then(() => {
          this.$nextTick(() => {
            var ids = _.map(this.selectList, v => {
              return v.id
            })
            this.$loading('保存中..')
            let p = {
                deviceId: this.deviceId
              cargoIds: ids.join(','), //必穿		货道id,多个id,英文逗号隔开,例如   1,2 		4,5,6
              cargoState //必传		1开启,0关闭
            }
            console.log('params', p)
            medicineAbinetApi
                .findMediicinecabinetInventoryByDeviceId(p)
                .then(res=>{
                    console.log('findMediicinecabinetInventoryByDeviceId', res)
                    this.$toast.clear()
                    if(res.detailModelList && res.detailModelList.length){
                        var openCount = 0, closeCount = 0, faultCount = 0
                        var list = _.map(res.detailModelList, v=>{
                            var key = _.keys(v)[0]
                            v[key].forEach(m => {
                                m.cargoState==1? openCount++ : closeCount++
                                if(m.faultState==1){
                                    faultCount++
                                }
                            });
                            return {
                                index: key,
                                list: v[key],
                            }
                        })
                        this.openCount = openCount
                        this.closeCount = closeCount
                        this.faultCount = faultCount
                        list = _.sortBy(list, 'index')
                        this.list = list
                        this.curItem = this.list[0]
                        console.log(list, this.curItem)
                    }
                })
                .catch(err=>{
                    console.error(err)
              .openAndCloseCargo(p)
              .then(res => {
                this.selectList = []
                this.$toast({
                  message: '操作成功',
                  forbidClick: true,
                  onClose: () => {}
                })
        },
        findDeviceById(){
                this.$refreshData(true)
              })
              .catch(err => {
                console.error(err)
              })
          })
        })
    },
    checkSelect() {
      if (!this.selectList || !this.selectList.length) {
        this.$toast('请选择要操作的通道')
        return
      }
      this.showPopover = true
    },
    updateDeviceCargoStateApp(action) {
      if (!this.selectList || !this.selectList.length) {
        this.$toast('请选择要操作的通道')
        return
      }
      this.$dialog
        .confirm({
          title: '',
          message: `确定将所选通道状态改为${action.text}`
        })
        .then(() => {
          this.$nextTick(() => {
            var ids = _.map(this.selectList, v => {
              return v.id
            })
            this.$loading('保存中..')
            let p = {
                deviceId: this.deviceId
              cargoIds: ids.join(','), //必穿		货道id,多个id,英文逗号隔开,例如   1,2 		4,5,6
              faultState: action.code //必传		1故障,0正常
            }
            console.log('params', p)
            medicineAbinetApi
                .findDeviceById(p)
                .then(res=>{
                    console.log('findDeviceById', res)
                    this.$toast.clear()
                    this.deviceInfo = res.obj.device
                })
                .catch(err=>{
                    console.error(err)
                })
        },
        onSelect(item){
            var i = this.selectList.indexOf(item)
            if(i == -1){
                this.selectList.push(item)
            } else {
                this.selectList.splice(i, 1)
            }
        },
        openAndCloseCargo(cargoState){
            if(!this.selectList || !this.selectList.length){
                this.$toast('请选择要操作的通道')
                return
            }
            this.$dialog.confirm({
                title: '',
                message: `确定${cargoState==1? '开启' : '关闭'}通道`,
            })
            .then(() => {
                this.$nextTick(()=>{
                    var ids = _.map(this.selectList, v=>{
                        return v.id
                    })
                    this.$loading('保存中..')
                    let p = {
                        cargoIds: ids.join(','),//必穿		货道id,多个id,英文逗号隔开,例如   1,2 		4,5,6
                        cargoState 		//必传		1开启,0关闭
                    }
                    console.log('params', p)
                    medicineAbinetApi
                        .openAndCloseCargo(p)
                        .then(res=>{
                            console.log('openAndCloseCargo', res)
                            this.selectList = []
                            this.$toast({
                                message: '操作成功',
                                forbidClick: true,
                                onClose: ()=>{
                                }
                            })
                            this.$refreshData(true)
                        })
                        .catch(err=>{
                            console.error(err)
                        })
                })
            })
        },
        checkSelect(){
            if(!this.selectList || !this.selectList.length){
                this.$toast('请选择要操作的通道')
                return
            }
            this.showPopover = true
        },
        updateDeviceCargoStateApp(action){
            if(!this.selectList || !this.selectList.length){
                this.$toast('请选择要操作的通道')
                return
            }
            this.$dialog.confirm({
                title: '',
                message: `确定将所选通道状态改为${action.text}`,
            })
            .then(() => {
                this.$nextTick(()=>{
                    var ids = _.map(this.selectList, v=>{
                        return v.id
                    })
                    this.$loading('保存中..')
                    let p = {
                        cargoIds: ids.join(','),//必穿		货道id,多个id,英文逗号隔开,例如   1,2 		4,5,6
                        faultState:  action.code		//必传		1故障,0正常
                    }
                    console.log('updateDeviceCargoStateApp', p)
                    medicineAbinetApi
                        .updateDeviceCargoStateApp(p)
                        .then(res=>{
                            console.log('updateDeviceCargoStateApp', res)
                            this.selectList = []
                            this.$toast({
                                message: '操作成功',
                                forbidClick: true,
                                onClose: ()=>{
                                }
                            })
                            this.$refreshData(true)
                        })
                        .catch(err=>{
                            console.error(err)
                        })
              .updateDeviceCargoStateApp(p)
              .then(res => {
                this.selectList = []
                this.$toast({
                  message: '操作成功',
                  forbidClick: true,
                  onClose: () => {}
                })
            })
            .catch(()=>{
                resolve(1)
            })
        },
       
                this.$refreshData(true)
              })
              .catch(err => {
                console.error(err)
              })
          })
        })
        .catch(() => {
          resolve(1)
        })
    },
    rowSelect(row) {
      // selectList
      if (this.checkList[row]) {
        this.list[row].list.forEach(item => {
          if (
            this.selectList.findIndex(el => {
              return el.id == item.id
            }) < 0 &&
            item.faultState != 1
          ) {
            this.selectList.push(item)
          }
        })
      } else {
        this.list[row].list.forEach(item => {
          const index =
            this.selectList.findIndex(el => {
              return el.id == item.id
            }) > -1
          if (index > -1) {
            this.selectList.splice(index, 1)
          }
        })
      }
    }
  }
}
</script>
<style scoped lang='scss'>
.cargoLaneIndex{
    .van-popover__wrapper{
        width: 100%;
    }
    .list{
        overflow-y: auto;
        padding-bottom: 10px;
        .row{
            display: -webkit-box;
            >div{
                width: 50px;
                margin-right: 5px;
                &:last-child{
                    margin-right: 10px;
                }
            }
<style scoped lang="scss">
.cargoLaneIndex {
  .van-popover__wrapper {
    width: 100%;
  }
  .list {
    overflow-y: auto;
    padding-bottom: 10px;
    .row {
      display: -webkit-box;
      > div {
        width: 50px;
        margin-right: 5px;
        &:last-child {
          margin-right: 10px;
        }
      }
    }
    
    .grid-4{
        display: grid;
        grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
        // position: fixed;
        // top: 0;
        // left: 0;
        // width: 100%;
    }
    .x-overflow{
        overflow-x: auto;
        -ms-overflow-style: none;
        overflow: -moz-scrollbars-none
    }
    .x-overflow::-webkit-scrollbar{
        display:none;
    }
    .active{
        border-color: red;
    }
  }
  .grid-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    // position: fixed;
    // top: 0;
    // left: 0;
    // width: 100%;
  }
  .x-overflow {
    overflow-x: auto;
    -ms-overflow-style: none;
    overflow: -moz-scrollbars-none;
  }
  .x-overflow::-webkit-scrollbar {
    display: none;
  }
  .active {
    border-color: red;
  }
}
</style>
</style>

+ 4 - 2
mini-pro-web/src/views/order/list.vue

@ -6,7 +6,7 @@
                    <form action="/">
                        <van-search
                            v-model="searchText"
                            placeholder="订单号、手机号、社区名称"
                            placeholder="姓名、处方号、医保卡号、开方医生"
                            @search="onSearch"
                            shape="round"
                        >
@ -73,12 +73,14 @@
			<div class="list plr15">
                <div @click="gotoUrl('/order/detail', {id: item.id})" v-for="(item, i) in list" :key="i" class="item plr15 c-333 fs-14">
                    <div class="kitbox ptb10 bb-e1e1e1">
                        <div class="box-flex-1 fs-14">订单编号:{{item.prescribeNum}}</div>
                        <div class="box-flex-1 fs-14">{{item.name}} {{ item.socialSecurityCardNum }}</div>
                        <div v-if="item.sellState==1" class="c-17b3ec">{{item.sellStateName}}</div>
                        <div v-else class="" >{{item.sellStateName}}</div>
                        <!-- <div>-<span class="c-17b3ec" v-if="item.reviewerState==1">审核通过</span><span class="c-ff5e6c" v-else-if="item.reviewerState==-1">审核不通过</span><span class="c-ff5e6c" v-else-if="item.reviewerState==-2">取消审方</span><span v-else>未审方</span></div> -->
                    </div>
                    <div class="lh20 ptb10">
                        <div>处方号:{{item.prescribeNum}}</div>
                        <div>开方医生:{{item.doctorName}}</div>
                        <div>来源机构:{{item.community}}</div>
                        <div>订单类型:{{item.orderSource=='厦门i健康'? '线上订单' : "线下订单"}}</div>
                        <div>开方时间:{{item.orderSource=='厦门i健康'? formatDatetime(item.prescribeTime) : formatDate(item.prescribeTime)}}</div>

+ 39 - 3
mini-pro-web/src/views/replenishment/start/quick.vue

@ -22,7 +22,7 @@
            </div>
        </div>
        <div class="fs-14 pl15 ptb10 bgc-fff kitbox">
        <div class="fs-14 pl15 ptb10 bgc-fff kitbox pr15">
            <div class="box-flex-1 lh24">
                <span>从上往下数</span>
                <div class="color-block"></div>
@ -30,6 +30,8 @@
                <div class="color-block ml10 red"></div>
                <span class="ml5 fs-12">故障</span>
            </div>
            <div class="c-17B3EC" @click="selectAll" v-if="!isSelectAll">全选</div>
            <div class="c-17B3EC" @click="cancelAll" v-else>取消</div>
        </div>
        <div class="list-panel">
@ -85,7 +87,8 @@ export default{
            activeKey: 0,
            curItem: [],
            repAll: true,
            outDetailId: this.$route.query.outDetailId || ''
            outDetailId: this.$route.query.outDetailId || '',
            isSelectAll: false
        }
    },
    watch:{
@ -93,6 +96,7 @@ export default{
            this.curItem = ''
            this.$nextTick(()=>{
                this.curItem = this.list[n]
                this.calIsSelectAll()
            })
        },
        num(n, o){
@ -200,7 +204,16 @@ export default{
                this.selItemList.splice(this.selItemList.indexOf(item), 1)
                this.allNum -= num
            }
            console.log(this.curItem.list.indexOf(item))
            this.calIsSelectAll()
        },
        calIsSelectAll() {
            let flag = true
            this.list[this.activeKey].list.forEach(el=>{
                if(el.cargoState==1&&!el.isActive){
                    flag = false
                }
            })
            this.isSelectAll = flag
        },
        accessItemNum(item){
            var num = 0
@ -495,6 +508,29 @@ export default{
                    from: 'quick'
                })
            }
        },
        selectAll(){
            this.isSelectAll = true
            this.list[this.activeKey].list.forEach(el=>{
                if(this.selItemList.findIndex(item=>{return item.id == el.id})<0&&el.cargoState==1){
                    el.isActive = true
                    this.selItemList.push(el)
                    const num = this.accessItemNum(el)
                    this.allNum += num
                }
            })
        },
        cancelAll(){
            this.isSelectAll = false
            this.list[this.activeKey].list.forEach(el=>{
                const index = this.selItemList.findIndex(item=>{return item.id == el.id})
                if(index > -1){
                    el.isActive = false
                    this.selItemList.splice(index, 1)
                    const num = this.accessItemNum(el)
                    this.allNum -= num
                }
            })
        }
    },
}

+ 1 - 1
mini-pro-web/vue.config.js

@ -15,7 +15,7 @@ module.exports = {
    progress: false, // vue-cli-service serve 启动进度的显示和隐藏
    headers: {
      'Access-Control-Allow-Origin': '*'
    },
    }
  },
  chainWebpack: config => {
    config.plugin('html')