hd 1 周之前
父节点
当前提交
19b1c6dfcf

+ 2 - 1
mini-pro-web/src/components/ProductItem/index.vue

@ -67,7 +67,8 @@ export default{
            if(this.data.shelfStatus != 1){
                this.gotoUrl('/drugList', {
                    trackId: this.data.id,
                    deviceId: this.data.idDevice
                    deviceId: this.data.idDevice,
                    cargoCapacity: this.data.cargoCapacity
                })
            } else {
                this.gotoUrl('./productDetail', {

+ 2 - 1
mini-pro-web/src/views/drug/list.vue

@ -48,7 +48,7 @@
          <div class="tc fs-14 c-333">
            <span>设置库存</span>
          </div>
          <div class="tc pt30 pb20"><van-stepper v-model="stock" min="1" max="99" button-size="36px" input-width="60px" /></div>
          <div class="tc pt30 pb20"><van-stepper v-model="stock" min="1" :max="cargoCapacity" button-size="36px" input-width="60px" /></div>
          <div class="ptb10">
            <van-button type="info" @click="onConfirm" size="small" block>确认</van-button>
@ -78,6 +78,7 @@ export default {
    return {
      deviceId: this.$route.query.deviceId, //轨道id
      trackId: this.$route.query.trackId, //轨道id
      cargoCapacity: this.$route.query.cargoCapacity, // 商品容量数量
      value: '',
      list: [],
      setStockShow: false,

+ 4 - 4
mini-pro-web/src/views/replenishment/start/components/SetStockDialog.vue

@ -93,12 +93,12 @@ export default {
  watch: {
    value: {
      handler(val) {
        if (this.init) {
        if (this.init&&val) {
          // 如果是初始化 则赋值。解决扫码回来这个地方重复调用的问题
          this.stock = this.bussiness == 1 ? this.data.cargoCapacity : this.data.qty
          if (val) {
            this.stock = this.bussiness == 1 ? this.data.cargoCapacity : this.data.qty
          console.log(this.codeList,"this.codeList");
            this.newCodeList = JSON.parse(JSON.stringify(this.codeList))
          }
          
          this.init = false
        }
      },

+ 3 - 3
mini-pro-web/src/views/replenishment/start/components/codeList.vue

@ -2,9 +2,9 @@
  <draggable v-model="items" :group="{ name: groupName }" :animation="200" handle=".drag" @sort="onSort">
    <div class="flex justify-between align-center mb10" style="position: relative;" v-for="(item, index) in codeList" :key="index">
      <van-field v-model="item.code" :label="getLabel(index)" placeholder="请扫描或输入追溯码" class="mr8" />
      <img src="@/assets/images/traceability/scan.png" class="scan" alt="" v-if="qty <= stock && bussiness != 1" @click="scan(index)" />
      <img src="@/assets/images/traceability/drag.png" class="drag" alt="" v-if="qty <= stock && bussiness != 1" />
      <img src="@/assets/images/traceability/del.png" alt="" v-if="qty > stock" @click="delDrug(index)" />
      <img src="@/assets/images/traceability/scan.png" class="scan" alt="" v-if="codeList.length <= stock && bussiness != 1" @click="scan(index)" />
      <img src="@/assets/images/traceability/drag.png" class="drag" alt="" v-if="codeList.length <= stock && bussiness != 1" />
      <img src="@/assets/images/traceability/del.png" alt="" v-if="codeList.length > stock" @click="delDrug(index)" />
    </div>
  </draggable>
</template>

+ 1 - 0
mini-pro-web/src/views/replenishment/start/productDetail.vue

@ -147,6 +147,7 @@ export default {
          const obj = res.obj
          this.$toast.clear()
          this.info = obj
          this.drugId = obj.drugId
          this.drugTraceabilityCodeDetail(obj.idDevice, obj.drugId, obj.id)
        })
        .catch(err => {

+ 7 - 6
mini-pro-web/src/views/replenishment/start/scan.vue

@ -4,7 +4,7 @@
      <div class="left-back">
        <van-icon name="arrow-left" @click="clickBack" size="14px"></van-icon>
      </div>
      <div class="currentIndex" v-if="currentCode">{{ currentLabel }} {{ currentCode }}</div>
      <div class="currentIndex">{{ currentLabel }} {{ currentCode }}</div>
    </div>
    <div class="container">
      <div class="qrcode">
@ -12,8 +12,8 @@
      </div>
    </div>
    <div class="footerBtn">
      <div class="current" v-if="currentCode">当前号码:{{ info.layerNo }}层{{ info.wayerNo }}号位({{ currentIndex }}/{{ info.len }})</div>
      <div class="nextBtn" @click="saveCode" v-if="currentCode">{{ currentIndex == info.len ? '完成' : '录入下一个追溯码' }}</div>
      <div class="current">当前号码:{{ info.layerNo }}层{{ info.wayerNo }}号位({{ currentIndex + 1 > info.len ? info.len : currentIndex + 1 }}/{{ info.len }})</div>
      <div class="nextBtn" @click="saveCode">{{ currentIndex + 1 == info.len ? '完成' : '录入下一个追溯码' }}</div>
    </div>
  </div>
</template>
@ -53,7 +53,6 @@ export default {
    handleScanSuccess(code) {
      this.currentCode = code
      this.info.codeList[this.currentIndex].code = code
      this.currentIndex++
      this.$EventBus.$emit('getScanData', this.info)
      this.stop() // 扫描成功停止扫描
      this.$toast('扫描成功,请点击录入下一个')
@ -63,8 +62,10 @@ export default {
      this.$toast(err?.message || '扫码失败')
    },
    async saveCode() {
      // this.currentCode = null
      // console.log(this.currentIndex, this.info.len)
      this.currentIndex++
      this.currentCode = null
      console.log(this.currentIndex, this.info.len)
      if (this.currentIndex == this.info.len) {
        this.$toast('已完成所有扫描')
@ -127,7 +128,7 @@ export default {
  computed: {
    currentLabel() {
      const len = this.info.len
      const index = this.currentIndex
      const index = this.currentIndex 
      if (index == 0) {
        return `${len - index}位最里:`

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

@ -26,7 +26,7 @@
        <div v-for="item in inventoryList" :key="item.id">
          <div class="title">{{ item.layerNo }}层{{ item.wayerNo }}号位</div>
          <div class="code-box">
            <code-list :codeList="item.codeList" @scan="scan($event, item)"></code-list>
            <code-list :codeList="item.codeList" :stock="item.codeList.length" @scan="scan($event, item)"></code-list>
          </div>
        </div>
      </div>
@ -127,14 +127,14 @@ export default {
            // 如果是更改药品
            obj.codeList = []
            for (let i = 0; i < maxNum; i++) {
              obj.codeList.unshift({ code: '' })
              obj.codeList.push({ code: '' })
            }
          } else {
            var len = obj.codeList.length
            if (obj.codeList.length < maxNum) {
              for (let i = 0; i < maxNum - len; i++) {
                obj.codeList.unshift({ code: '' })
                obj.codeList.push({ code: '' })
              }
            }
          }