Bläddra i källkod

新增主页头部组件等

silent 2 år sedan
förälder
incheckning
76a591c21d

+ 305 - 0
src/views/modules/order/orderInvoice-add-or-update.vue

@@ -0,0 +1,305 @@
+<template>
+  <el-dialog
+    :title=" $t('text.editBtn')"
+    :visible.sync="visible"
+    :close-on-click-modal="false"
+  >
+    <el-form
+      ref="dataForm"
+      :rules="rules"
+      :model="dataForm"
+      label-position="left"
+      size="small"
+      label-width="auto"
+    >
+      <!-- 订单id -->
+      <el-form-item :label="$t('order.number')+':'" prop="orderNumber">
+        <div>{{ dataForm.orderNumber || '' }}</div>
+      </el-form-item>
+      <!-- 发票类型 1.电子普通发票 -->
+      <el-form-item :label="$t('order.invoiceType')+':'" prop="invoiceType">
+        <div v-if="dataForm.invoiceType === 1">{{ $t('order.normalInvoiceType') }}</div>
+      </el-form-item>
+      <!-- 抬头类型 1.单位 2.个人 -->
+      <el-form-item :label="$t('order.headerType')+':'" prop="headerType">
+        <div>{{ ['',$t('order.unit'),$t('order.personal')][dataForm.headerType] }}</div>
+      </el-form-item>
+      <!-- 抬头名称 -->
+      <el-form-item v-if="dataForm.headerName" :label="$t('order.headerName')+':'" prop="headerName">
+        <div>{{ dataForm.headerName || '' }}</div>
+      </el-form-item>
+      <!-- 发票税号 -->
+      <el-form-item v-if="dataForm.invoiceTaxNumber && dataForm.headerType === 1" :label="$t('order.invoiceTaxNumber')+':'" prop="invoiceTaxNumber">
+        <div>{{ dataForm.invoiceTaxNumber || '' }}</div>
+      </el-form-item>
+      <!-- 订单状态 -->
+      <el-form-item :label="$t('group.orderStatus')+':'" prop="orderStatus">
+        <span v-if="dataForm.orderStatus === 1">{{$t('order.pendingPayment')}}</span>
+        <span v-if="dataForm.orderStatus === 2">{{$t('order.toBeShipped')}}</span>
+        <span v-if="dataForm.orderStatus === 3">{{$t('order.pendingReceipt')}}</span>
+        <span v-if="dataForm.orderStatus === 4">{{$t('order.toBeEvaluated')}}</span>
+        <span v-if="dataForm.orderStatus === 5">{{$t('order.success')}}</span>
+        <span v-if="dataForm.orderStatus === 6">{{$t('order.fail')}}</span>
+        <span v-if="dataForm.orderStatus === 7">{{$t('group.waitGroup')}}</span>
+      </el-form-item>
+      <!-- 发票状态 1.申请中 2.已开票 -->
+      <el-form-item :label="$t('order.invoiceStatus')+':'" prop="invoiceState">
+        <div>{{ ['',$t('order.applicationInProgress'),$t('order.invoiceIssued'),$t('order.fail')][dataForm.invoiceState] }}</div>
+      </el-form-item>
+      <!-- 发票上传: -->
+      <el-form-item v-if="isAuth('order:orderInvoice:upload')" :label="$t('order.invoiceUpload')+':'">
+        <div>
+          <el-link v-if="fileInfo.filePath" target="_blank" :href="resourcesUrl+fileInfo.filePath">{{ fileInfo.fileName + '.' + fileInfo.fileType }}</el-link>
+          <el-upload
+            ref="upload"
+            accept=".pdf"
+            :action="$http.adornUrl('/admin/file/save_pdf_file')"
+            :headers="{Authorization: $cookie.get('Authorization_vs'),locale:lang}"
+            :multiple="false"
+            :auto-upload="false"
+            :limit="1"
+            :before-upload="beforeUpload"
+            :on-change="onUploadChange"
+            :on-progress="onUploadProgress"
+            :on-success="onUploadSuccess"
+            :on-error="onUploadError"
+            :on-exceed="onUploadExceedTip"
+          >
+            <el-button slot="trigger" size="small" type="primary">{{ $t('order.SelectFile') }}</el-button>
+            <el-button style="margin-left: 10px;" size="small" type="success" @click="onUploadConfirm">{{ $t('pictureManager.confirmUpload')}}
+              <el-tooltip :content="$t('pictureManager.uploadPDF')" placement="top" effect="light">
+                <i class="el-icon-question el-icon--right" />
+              </el-tooltip>
+            </el-button>
+          </el-upload>
+        </div>
+      </el-form-item>
+      <!-- 申请时间 -->
+      <el-form-item :label="$t('order.applicationTime')+':'" prop="applicationTime">
+        <div>{{ dataForm.applicationTime }}</div>
+      </el-form-item>
+      <!-- 上传时间 -->
+      <el-form-item v-if="dataForm.uploadTime" :label="$t('order.uploadTime')+':'" prop="uploadTime">
+        <div>{{ dataForm.uploadTime }}</div>
+      </el-form-item>
+    </el-form>
+    <div slot="footer" class="dialog-footer">
+      <div class="default-btn" @click="visible = false">{{$t("crud.filter.cancelBtn")}}</div>
+      <div v-if="isAuth('order:orderInvoice:commit')" class="default-btn primary-btn" @click="beforeSubmit()">{{$t("crud.filter.submitBtn")}}</div>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+export default {
+  data () {
+    return {
+      visible: false,
+      lang: localStorage.getItem('lang') || 'zh_CN',
+      dataForm: {
+        orderInvoiceId: 0,
+        orderNumber: null,
+        shopId: null,
+        invoiceType: null,
+        headerType: null,
+        headerName: null,
+        invoiceTaxNumber: null,
+        invoiceState: null,
+        fileId: null,
+        applicationTime: null,
+        uploadTime: null,
+        ossList: null,
+        attachFile: null
+      },
+      attachFile: [],
+      resourcesUrl: process.env.VUE_APP_RESOURCES_URL,
+      upLoadForm: {},
+      rules: {
+      },
+      fileInfo: {}
+    }
+  },
+  methods: {
+    init (orderInvoiceId) {
+      this.visible = true
+      this.$nextTick(() => {
+        // this.$refs.dataForm.resetFields()
+        this.resetDataFrom()
+        if (!orderInvoiceId) {
+          return
+        }
+        this.dataForm.orderInvoiceId = orderInvoiceId || 0
+        this.$http({
+          url: this.$http.adornUrl(`/m/orderInvoice/info/${orderInvoiceId}`),
+          method: 'get',
+          params: this.$http.adornParams()
+        }).then(({ data }) => {
+          this.dataForm = data
+          // 请求文件
+          if (this.dataForm.fileId) {
+            this.$http({
+              url: this.$http.adornUrl(`/admin/file/get_file_by_id`),
+              method: 'get',
+              params: this.$http.adornParams({
+                fileId: this.dataForm.fileId
+              })
+            }).then(({ data }) => {
+              this.fileInfo = data
+            })
+          }
+        })
+      })
+    },
+    // 清空数据
+    resetDataFrom () {
+      this.dataForm = {
+        orderInvoiceId: 0,
+        orderNumber: null,
+        shopId: null,
+        invoiceType: null,
+        headerType: null,
+        headerName: null,
+        invoiceTaxNumber: null,
+        invoiceState: null,
+        fileId: null,
+        applicationTime: null,
+        uploadTime: null,
+        ossList: null,
+        attachFile: null
+      }
+      this.fileInfo = {}
+    },
+    // 查看是否已经更改过申请信息
+    beforeSubmit () {
+      this.$http({
+        url: this.$http.adornUrl(`/m/orderInvoice/is_change`),
+        method: 'get',
+        params: this.$http.adornParams({
+          orderInvoiceId: this.dataForm.orderInvoiceId,
+          applicationTime: this.dataForm.applicationTime
+        })
+      }).then(({ data }) => {
+        if (data === true) {
+          this.$confirm(this.$i18n.t('order.uploadInvoiceTip2'), this.$i18n.t('text.tips'), {
+            confirmButtonText: this.$i18n.t('crud.filter.submitBtn'),
+            cancelButtonText: this.$i18n.t('crud.filter.cancelBtn'),
+            type: 'warning'
+          }).then(() => {
+            this.dataFormSubmit()
+          })
+        } else {
+          this.dataFormSubmit()
+        }
+      })
+    },
+    // 表单提交
+    dataFormSubmit () {
+      this.$refs.dataForm.validate(valid => {
+        if (!valid) {
+          return
+        }
+        if (!this.fileInfo.fileId) {
+          this.$message({
+            message: this.$t('order.uploadInvoiceTip4'),
+            type: 'info',
+            duration: 1000
+          })
+          return
+        }
+        this.$http({
+          url: this.$http.adornUrl(`/m/orderInvoice`),
+          method: 'put',
+          data: this.dataForm
+        }).then(({ data }) => {
+          this.$message({
+            message: this.$t('publics.operation'),
+            type: 'success',
+            duration: 1000,
+            onClose: () => {
+              this.visible = false
+              this.$emit('refreshDataList')
+              // this.$refs['dataForm'].resetFields()
+            }
+          })
+        })
+      })
+    },
+
+    onUploadProgress (event, file, fileList) {
+    },
+    onUploadChange (file, fileList) {
+      console.log(file)
+      if (file.size > 10 * 1024 * 1024) {
+        this.$refs.upload.uploadFiles = []
+        return this.$message.error('文件大小不得超过10M!')
+      }
+    },
+    /**
+     * 上传图片
+     */
+    onUploadConfirm () {
+      if (this.$refs.upload.uploadFiles.length < 1) {
+        return this.$message.error(this.$t('order.uploadInvoiceTip'))
+      }
+      if (this.dataForm.orderStatus < 4) {
+        this.$confirm(this.$t('order.uploadInvoiceTip1'), this.$t('chat.tips'), {
+          confirmButtonText: this.$t('chat.confirm'),
+          cancelButtonText: this.$t('chat.cancel'),
+          type: 'warning'
+        }).then(() => {
+          this.$refs.upload.submit()
+        }).catch(() => {
+        })
+      } else {
+        this.$refs.upload.submit()
+      }
+    },
+
+    // 预上传
+    handleAvatarChange (file, fileList) {
+    },
+    /**
+     * 上传错误处理
+     * @param err
+     * @param file
+     * @param fileList
+     */
+    onUploadError (err, file, fileList) {
+      this.message(this.$t('biz.imgbox.requestError'), true)
+      throw err
+    },
+
+    /**
+     * 上传成功处理,并提交文件数据
+     * @param response
+     * @param file
+     * @param fileList
+     * @returns {boolean}
+     */
+    onUploadSuccess (response, file, fileList) {
+      this.fileInfo = response
+      this.dataForm.fileId = response.fileId
+      this.$refs.upload.uploadFiles = []
+    },
+    onUploadExceedTip () {
+    },
+    /**
+     * 上传前检查合法性
+     * @param file
+     * @returns {boolean}
+     */
+    beforeUpload (file) {
+      console.log(file)
+      // const typeArray = file.type.split('/')
+      const isImage = file.type === 'application/pdf'
+      if (!isImage) {
+        this.$message.error('请上传PDF文件!')
+        return false
+      }
+      return true
+    },
+    handleRemove () {
+    }
+  }
+}
+</script>

+ 286 - 0
src/views/modules/order/orderInvoice.vue

@@ -0,0 +1,286 @@
+<template>
+<!-- 发票管理 -->
+  <div class="order-invoice">
+    <!-- 搜索栏 -->
+    <div class="search-bar">
+      <el-form :inline="true" class="search-form" ref="searchForm" :model="searchForm" label-width="auto" size="small">
+        <div class="input-row">
+          <el-form-item prop="orderNumber" :label="$t('order.number')+':'">
+            <el-input v-model="searchForm.orderNumber" type="text" clearable :placeholder="$t('order.number')"></el-input>
+          </el-form-item>
+          <el-form-item prop="invoiceState" label="发票状态:">
+            <template>
+              <el-select
+                v-model="searchForm.invoiceState"
+                clearable
+                placeholder="发票状态"
+              >
+                <el-option
+                  v-for="item in invoiceStates"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                ></el-option>
+              </el-select>
+            </template>
+          </el-form-item>
+          <el-form-item prop="orderStatus" :label="$t('order.status')+':'">
+            <template>
+              <el-select
+                v-model="searchForm.orderStatus"
+                clearable
+                :placeholder="this.$i18n.t('order.status')"
+              >
+                <el-option
+                  v-for="item in orderStatus"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                ></el-option>
+              </el-select>
+            </template>
+          </el-form-item>
+          <el-form-item>
+            <div class="default-btn primary-btn" @click="searchChange(true)">{{ $t('crud.searchBtn') }}</div>
+            <div class="default-btn" @click="resetForm()">重置</div>
+          </el-form-item>
+        </div>
+      </el-form>
+    </div>
+    <!-- 搜索栏end -->
+
+    <div class="main-container">
+      <!-- 表格 -->
+      <div class="table-con invoice-table">
+        <el-table
+          ref="InvoiceTable"
+          :data="dataList"
+          header-cell-class-name="table-header"
+          style="width: 100%"
+        >
+          <!-- 订单id -->
+          <el-table-column :label="$t('order.number')" prop="orderNumber">
+            <template slot-scope="{row}">
+              <span>{{ row.orderNumber }}</span>
+            </template>
+          </el-table-column>
+          <!-- 抬头类型 1.单位 2.个人 -->
+          <el-table-column label="发票抬头" prop="headerType">
+            <template slot-scope="{row}">
+              <span>{{ ['',$t('order.unit'),$t('order.personal')][row.headerType] }}</span>
+            </template>
+          </el-table-column>
+          <!-- 发票状态 1.申请中 2.已开票 -->
+          <el-table-column label="发票状态" prop="invoiceState">
+            <template slot-scope="{row}">
+              <span>{{ ['',$t('order.applicationInProgress'),$t('order.invoiceIssued'),$t('order.fail')][row.invoiceState] }}</span>
+            </template>
+          </el-table-column>
+          <!-- 订单状态 -->
+          <el-table-column
+            :label="$t('order.status')"
+            prop="orderStatus"
+           >
+            <template slot-scope="scope">
+              <span v-if="scope.row.orderStatus === 1">{{$t('order.pendingPayment')}}</span>
+              <span v-if="scope.row.orderStatus === 2">{{$t('order.toBeShipped')}}</span>
+              <span v-if="scope.row.orderStatus === 3">{{$t('order.pendingReceipt')}}</span>
+              <span v-if="scope.row.orderStatus === 4">{{$t('order.toBeEvaluated')}}</span>
+              <span v-if="scope.row.orderStatus === 5">{{$t('order.success')}}</span>
+              <span v-if="scope.row.orderStatus === 6">{{$t('order.fail')}}</span>
+              <span v-if="scope.row.orderStatus === 7">{{$t('group.waitGroup')}}</span>
+            </template>>
+          </el-table-column>
+          <!-- 申请时间 -->
+          <el-table-column :label="$t('order.applicationTime')" prop="applicationTime">
+            <template slot-scope="{row}">
+              <span>{{ row.applicationTime }}</span>
+            </template>
+          </el-table-column>
+          <!-- 上传时间 -->
+          <el-table-column label="上传时间" prop="uploadTime">
+            <template slot-scope="{row}">
+              <span>{{ row.uploadTime }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            :label="$t('crud.menu')"
+            fixed="right"
+            align="center"
+            width="200"
+          >
+            <template slot-scope="{row}">
+              <el-button type="text" @click="viewOrderHandle(row.orderNumber, row.shopId, row.status, )">
+                {{ $t('order.viewOrder') }}
+              </el-button>
+              <el-button v-if="isAuth('order:orderInvoice:update')" type="text" @click="addOrUpdateHandle(row.orderInvoiceId)">
+                {{ $t('text.editBtn') }}
+              </el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+
+      <!-- 分页 -->
+      <el-pagination
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :current-page="page.currentPage"
+          :page-sizes="[10, 20, 50, 100]"
+          :page-size="page.pageSize"
+          :total="page.total"
+          layout="total, sizes, prev, pager, next, jumper"
+      ></el-pagination>
+    </div>
+
+    <!-- 弹窗, 新增 / 修改 -->
+    <add-or-update v-if="addOrUpdateVisible"
+      ref="addOrUpdate"
+      @refreshDataList="refreshChange"></add-or-update>
+
+    <order-info ref="orderInfo"></order-info>
+
+  </div>
+</template>
+
+<script>
+import AddOrUpdate from './orderInvoice-add-or-update'
+import OrderInfo from "./orderInfo";
+export default {
+  components: {
+    OrderInfo,
+    AddOrUpdate
+  },
+  data () {
+    return {
+      theData: null, // 保存上次点击查询的请求条件
+
+      dataList: [],
+      page: {
+        total: 0, // 总页数
+        currentPage: 1, // 当前页数
+        pageSize: 10 // 每页显示多少条
+      },
+      searchForm: {},
+      invoiceStates: [
+        {
+          label: this.$i18n.t('order.applicationInProgress'),
+          value: 1
+        },
+        {
+          label: this.$i18n.t('order.invoiceIssued'),
+          value: 2
+        },
+        {
+          label: this.$i18n.t('order.fail'),
+          value: 3
+        }
+      ],
+      orderStatus: [
+        {
+          label: "待发货",
+          value: 2
+        },
+        {
+          label: "待收货",
+          value: 3
+        },
+        {
+          label: "成功",
+          value: 5
+        },
+        {
+          label: "失败",
+          value: 6
+        }
+      ],
+      // 编辑弹窗显隐
+      addOrUpdateVisible: false
+    }
+  },
+
+  mounted () {
+    this.getDataList()
+  },
+
+  methods: {
+    // 获取数据列表
+    getDataList (page, newData = false) {
+      this.dataListLoading = true
+      if (newData || !this.theData) {
+        this.theData = JSON.parse(JSON.stringify(this.searchForm))
+      }
+      this.$http({
+        url: this.$http.adornUrl('/m/orderInvoice/page'),
+        method: 'get',
+        params: this.$http.adornParams(
+          Object.assign(
+            {
+              current: page ? page.currentPage : this.page.currentPage,
+              size: page ? page.pageSize : this.page.pageSize
+            },
+            this.theData
+          )
+        )
+      }).then(({ data }) => {
+        this.dataList = data.records
+        this.page.total = data.total
+      })
+    },
+
+    // 条件查询
+    searchChange (newData = false) {
+      this.page.currentPage = 1
+      this.getDataList(this.page, newData)
+    },
+
+    /**
+     * 查看订单
+     */
+    viewOrderHandle (orderNumber, shopId, status) {
+      this.$refs.orderInfo.init({
+        orderNumber: orderNumber,
+        shopId: shopId,
+        status: status
+      })
+      /*this.$router.push({
+        path: '/order-orderInfo',
+        query: {
+          orderNumber: id
+        }
+      })*/
+    },
+
+    // 新增 / 修改
+    addOrUpdateHandle (id) {
+      this.addOrUpdateVisible = true
+      this.$nextTick(() => {
+        this.$refs.addOrUpdate.init(id)
+      })
+    },
+
+    handleSizeChange (val) {
+      this.page.pageSize = val
+      this.getDataList(this.page)
+    },
+    handleCurrentChange (val) {
+      this.page.currentPage = val
+      this.getDataList(this.page)
+    },
+
+    // 重置
+    resetForm () {
+      this.searchForm = {}
+    },
+    // 刷新回调用
+    refreshChange () {
+      this.page.current = 1
+      this.getDataList(this.page)
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 194 - 0
src/views/modules/print/print-scan-delivery.vue

@@ -0,0 +1,194 @@
+<template>
+  <div style="margin: 20px">
+    <h1 align="center">电子面单</h1>
+    <el-row>
+      <el-col :span="3">
+        <el-select v-model="deviceNo" placeholder="请选择打印设备">
+          <el-option
+            v-for="(item,index) in deviceList"
+            :key="index"
+            :label="item.deviceNo"
+            :value="item.deviceNo">
+          </el-option>
+        </el-select>
+      </el-col>
+      <el-col :span="20">
+        <el-input id="scanInput" @change="scanMatchPrintOrder" type="text" v-model="scanOrderNo" placeholder="请扫码二维码"></el-input>
+      </el-col>
+    </el-row>
+    <div v-if="infoVisible">
+      <div style="margin-top: 30px">
+        <span style="font-weight: bold; font-size: 26px">集货单</span>
+        <el-row>
+          <el-col class="col" :span="6">订单编号</el-col>
+          <el-col class="col" :span="3">数量</el-col>
+          <el-col class="col" :span="6">集货状态</el-col>
+          <el-col class="col" :span="6">总共品类</el-col>
+          <el-col class="col" :span="3">货箱</el-col>
+        </el-row>
+        <el-row>
+          <el-col class="col" :span="6">{{printOrder.orderNo}}</el-col>
+          <el-col class="col" :span="3">{{printOrder.prodNums}}</el-col>
+          <el-col class="col" :span="6">已集齐</el-col>
+          <el-col class="col" :span="6">1</el-col>
+          <el-col class="col" :span="3"></el-col>
+        </el-row>
+      </div>
+      <div style="margin-top: 6px">
+        <span style="font-weight: bold; font-size: 26px;">配送信息</span>
+        <el-row>
+          <el-col class="col" :span="6">配送方式</el-col>
+          <el-col class="col" :span="18" style="color: red">{{printOrder.deliveryName}}</el-col>
+        </el-row>
+        <el-row>
+          <el-col class="col" :span="6">收货地址</el-col>
+          <el-col class="col" :span="18">{{printOrder.orderLogistics.receiverAddr}}</el-col>
+        </el-row>
+        <el-row>
+          <el-col class="col" :span="6">收货人</el-col>
+          <el-col class="col" :span="18">{{printOrder.orderLogistics.receiverName}}</el-col>
+        </el-row>
+        <el-row>
+          <el-col class="col" :span="6">联系电话</el-col>
+          <el-col class="col" :span="18">{{printOrder.orderLogistics.receiverMobile}}</el-col>
+        </el-row>
+      </div>
+      <div style="margin-top: 6px">
+        <span style="font-weight: bold; font-size: 26px">打单记录</span>
+        <el-row>
+          <el-col class="col" :span="4">编号</el-col>
+          <el-col class="col" :span="6">运单号</el-col>
+          <el-col class="col" :span="4">打印次数</el-col>
+          <el-col class="col" :span="6">打单时间</el-col>
+          <el-col class="col" :span="4">操作</el-col>
+        </el-row>
+        <el-row>
+          <el-col class="col" :span="4">{{printOrder.orderLogistics.logisticsName}}</el-col>
+          <el-col class="col" :span="6">{{printOrder.orderLogistics.deliveryNo}}</el-col>
+          <el-col class="col" :span="4">{{printOrder.orderLogistics.printTimes}}</el-col>
+          <el-col class="col" :span="6">{{printOrder.orderLogistics.updateTime}}</el-col>
+          <el-col class="col" :span="4">
+            <el-button type="info" @click="handlePrintOrder">打印</el-button>
+          </el-col>
+        </el-row>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+// import AddOrUpdate from './orderLogistics-add-or-update'
+export default {
+  data () {
+    return {
+      dataList: [],
+      page: {
+        total: 0, // 总页数
+        currentPage: 1, // 当前页数
+        pageSize: 10 // 每页显示多少条
+      },
+      printOrder:{
+        orderLogistics:{}
+      },
+      deviceList: [],
+      deviceNo: null,
+      infoVisible:false,
+      lastInputStr: null,
+      scanOrderNo: null,
+      searchForm: {}, // 搜索
+      dataListLoading: false,
+      addOrUpdateVisible: false
+    }
+  },
+  components: {
+    // AddOrUpdate
+  },
+  created () {
+    this.getDeviceList();
+  },
+  mounted () {
+  },
+  methods: {
+    getDeviceList(){
+      this.$http({
+        url: this.$http.adornUrl('/platform/print/printDevice/getDeviceList'),
+        method: 'GET',
+        params: this.$http.adornParams(),
+      }).then(({data}) => {
+        if(data){
+          this.deviceList = data;
+        }
+      }).catch((error) => {
+
+      })
+    },
+    scanMatchPrintOrder(value){
+      let substr;
+      if(this.lastInputStr != null){
+        substr = value.replace(new RegExp(this.lastInputStr), "");
+      }else{
+        substr = value;
+      }
+      if(!this.deviceNo){
+        this.$message.error("请选择打印设备");
+      }
+      if(substr){
+        this.scanOrderNo = substr;
+        let dataBody = {orderNo: substr, deviceNo: this.deviceNo};
+        this.$http({
+          url: this.$http.adornUrl('/platform/logistics/scanDelivery'),
+          method: 'POST',
+          data: this.$http.adornData(dataBody),
+        }).then(({data}) => {
+          if(data){
+            this.getLogisticsInfo(this.scanOrderNo);
+        }
+          this.lastInputStr = substr;
+        }).catch((error) => {
+          this.lastInputStr = substr;
+          this.$message.error(error)
+        })
+      }
+    },
+    getLogisticsInfo(orderNo){
+      this.$http({
+        url: this.$http.adornUrl('/logistics/getLogisticsInfo'),
+        method: 'GET',
+        params: this.$http.adornParams({orderNo:orderNo}),
+      }).then(({data}) => {
+        if(data){
+          this.printOrder = data;
+        }
+        this.infoVisible = true;
+      }).catch((error) => {
+
+      })
+    },
+    handlePrintOrder(){
+      if(!this.deviceNo){
+        this.$message.error("请选择打印设备");
+      }
+      this.$http({
+        url: this.$http.adornUrl('/logistics/printOrder'),
+        method: 'POST',
+        data: this.$http.adornData({orderNo: this.scanOrderNo, logistics: this.printOrder.orderLogistics.logistics, deviceNo: this.deviceNo}),
+      }).then(({data}) => {
+        if(data){
+          this.getLogisticsInfo(this.scanOrderNo);
+        }
+      }).catch((error) => {
+        this.$message.error("打印失败")
+      })
+    }
+  }
+}
+</script>
+<style lang="scss">
+  .col{
+    height: 40px;
+    border: gainsboro 1px solid;
+    font-size: 20px;
+    line-height: 40px;
+    text-align: center;
+  }
+</style>

+ 349 - 0
src/views/modules/print/printList.vue

@@ -0,0 +1,349 @@
+<template>
+    <div class="mod-user">
+        <div class="search-bar">
+            <el-form :inline="true" class="search-form" ref="searchForm" :model="searchForm" size="small">
+                <div class="input-row">
+                    <el-form-item prop="orderNumber" label="订单编号:">
+                        <el-input v-model="searchForm.orderNumber" type="text" clearable placeholder="订单编号"></el-input>
+                    </el-form-item>
+
+                    <el-form-item label="创建时间:">
+                        <el-date-picker size="small" v-model="createDateRange" type="datetimerange"
+                            :range-separator="$t('date.tip')" value-format="yyyy-MM-dd HH:mm:ss"
+                            :start-placeholder="$t('text.startTime')" :end-placeholder="$t('date.end')"
+                            @change="createTimeChange"></el-date-picker>
+                    </el-form-item>
+                    <el-form-item>
+                        <div class="default-btn primary-btn" @click="searchChange(true)">{{ $t('crud.searchBtn') }}</div>
+                        <div class="default-btn" @click="resetForm('searchForm')">{{ $t('product.reset') }}</div>
+                    </el-form-item>
+                </div>
+            </el-form>
+        </div>
+        <div class="main-container">
+            <div class="operation-bar">
+                <div v-if="isAuth('platform:user:import')" class=" default-btn" @click="downLoadZIP()"
+                    :disabled="importDisabled">批量下载ZIP</div>
+            </div>
+            <div class="table-con">
+                <el-table :data="dataList" header-cell-class-name="table-header" row-class-name="table-row-low"
+                    style="width: 100%">
+                    <!-- @selection-change="selectionChange" -->
+                    <!-- <el-table-column
+                fixed
+                type="selection"
+                width="60">
+              </el-table-column> -->
+                    <el-table-column prop="orderNumber" width="300" label="订单号" />
+                    <el-table-column fixed label="文件名" prop="pdfFolderName" align="left" />
+                    <el-table-column fixed prop="pdfUrl" label="文件地址">
+                        <template slot-scope="scope">
+                            <div class="">
+                                <a target="blank" :href="resourcesUrl + scope.row.pdfUrl">
+                                    {{ scope.row.pdfUrl }}</a>
+                            </div>
+                        </template>
+                    </el-table-column>
+                    <el-table-column width="230" prop="createTime" label="创建时间" />
+                    <el-table-column fixed="right" align="center" :label="$t('crud.menu')" width="230">
+                        <template slot-scope="scope">
+                            <div class="text-btn-con">
+                                <div class="default-btn text-btn" @click="downLoadPDF(scope.row)">
+                                    下载PDF文件</div>
+                            </div>
+                        </template>
+                    </el-table-column>
+                </el-table>
+            </div>
+            <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
+                :current-page="page.currentPage" :page-sizes="[10, 20, 50, 100]" :page-size="page.pageSize"
+                :total="page.total" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
+        </div>
+        <!-- 弹窗, 新增 / 修改 -->
+
+        <tags-select v-if="tagsSelectVisible" :limit="5" ref="tagsSelect" @refreshTagsArr="refreshTagsSelect"></tags-select>
+    </div>
+</template>
+  
+<script>
+import JSzip from 'jszip';
+import { saveAs } from 'file-saver';
+
+export default {
+    data() {
+        return {
+            theData: null, // 保存上次点击查询的请求条件
+
+            dataList: [],
+            dataListLoading: false,
+            exportDisabled: false,
+            importDisabled: false,
+            tagsSelectVisible: false,
+            updateBalanceVisible: false,
+            updateCouponVisible: false,
+            dataListSelections: [],
+            addOrUpdateVisible: false,
+            updateGrowthVisible: false,
+            updateScoreVisible: false,
+            updateTagsVisible: false,
+            importUserVisible: false,
+            createDateRange: [], // 时间范围
+            resourcesUrl: process.env.VUE_APP_RESOURCES_URL,
+            dynamicTags: [],
+            page: {
+                total: 0, // 总页数
+                currentPage: 1, // 当前页数
+                pageSize: 10 // 每页显示多少条
+            },
+            searchForm: {
+                orderNumber: undefined,
+                startTime: undefined, // 起始时间
+                endTime: undefined // 结束时间
+            },
+            levelTypes: [
+                {
+                    label: this.$i18n.t('user.ordinaryMember'),
+                    value: 0
+                }, {
+                    label: this.$i18n.t('user.paidMembership'),
+                    value: 1
+                }
+            ],
+            status: [
+                {
+                    label: this.$i18n.t('publics.disable'),
+                    value: 0
+                }, {
+                    label: this.$i18n.t('publics.normal'),
+                    value: 1
+                }
+            ]
+        }
+    },
+    components: {
+    },
+    mounted() {
+        this.getDataList(this.page)
+    },
+    methods: {
+        downLoadPDF(pdf) {
+            let randomStr = Math.floor(Math.random() * 100000).toString();
+            this.getPdfFile(this.resourcesUrl + pdf.pdfUrl + "?a=" + randomStr).then(data => {
+                saveAs(data, pdf.pdfName)
+            })
+        },
+        getPdfFile(url) {
+            return new Promise((resolve, reject) => {
+                let xmlhttp = new XMLHttpRequest();
+                xmlhttp.open("GET", url, true);
+                xmlhttp.responseType = "blob";
+                xmlhttp.onload = function () {
+                    if (this.status == 200) {
+                        resolve(this.response);
+                    } else {
+                        reject(this.status);
+                    }
+                }
+                xmlhttp.send();
+            });
+        },
+        getAllNeed() {
+            if (!this.theData) {
+                this.theData = JSON.parse(JSON.stringify(this.searchForm))
+            }
+            this.$http({
+                url: this.$http.adornUrl('/printOrderPdf/printOrderPdf/page'),
+                method: 'get',
+                params: this.$http.adornParams(
+                    Object.assign(
+                        {
+                            current: 1,
+                            size: 9999
+                        },
+                        this.theData
+                    )
+                )
+            }).then(({ data }) => {
+                console.log(data.records)
+                let pdfList = data.records;
+                // const arr = [{fileDownUrl:'地址', fileDownName:'文件名'}] // 需要下载打包的路径, 可以是本地相对路径, 也可以是跨域的全路径
+                const zip = new JSzip()
+                const cache = {}
+                const promises = []
+                pdfList.forEach((pdf, j) => {
+                    let randomStr = Math.floor(Math.random() * 100000).toString();
+                    const promise = this.getPdfFile(this.resourcesUrl + pdf.pdfUrl + "?a=" + randomStr).then(data => {
+                        // 下载文件, 并存成blob对象
+                        const fileName = pdf.pdfFolderName + "/" + pdf.pdfName; // 获取文件名,一定要包含文件的后缀名(因为重复的文件名只会下载一个,故需要加入下标 不同名)
+                        // zip.folder(pdf.pdfFolderName).file(pdf.pdfName, data);
+                        zip.file(pdf.pdfName, data);
+                        cache[fileName] = data
+                    })
+                    promises.push(promise)
+                });
+                Promise.all(promises).then(() => {
+                    zip.generateAsync({ type: "blob" }).then(content => {
+                        // 生成二进制流   然后保存文件(如果这个下载不了 也可以将下方这一行换成a标签下载逻辑)
+                        saveAs(content, "批量下载PDF压缩包.zip") // 利用file-saver保存文件  自定义文件名
+                        // this.wavePrintOrderPdfDownloadLoading = false;
+                    })
+                })
+            });
+        },
+        downLoadZIP() {
+            if (!!this.searchForm.startTime && !!this.searchForm.endTime) {
+                if ((Date.parse(new Date(this.searchForm.endTime).toString()) - Date.parse(new Date(this.searchForm.startTime).toString())) / 1000 / 60 / 60 <= 24) {
+                    this.getAllNeed()
+                } else {
+                    this.$message({
+                        message: '批量下载ZIP范围最大为24小时',
+                        type: 'warning'
+                    });
+                }
+            } else {
+                this.$message({
+                    message: '请先选择创建时间,范围最大为24小时',
+                    type: 'warning'
+                });
+            }
+        },
+
+        // 获取数据列表  /admin/user/page
+        getDataList(page, newData = false) {
+            console.log("开始查询")
+            if (newData || !this.theData) {
+                this.theData = JSON.parse(JSON.stringify(this.searchForm))
+            }
+            this.dataListLoading = true
+
+            this.$http({
+                url: this.$http.adornUrl('/printOrderPdf/printOrderPdf/page'),
+                method: 'get',
+                params: this.$http.adornParams(
+                    Object.assign(
+                        {
+                            current: page == null ? this.page.currentPage : page.currentPage,
+                            size: page == null ? this.page.pageSize : page.pageSize
+                        },
+                        this.theData
+                    )
+                )
+            }).then(({ data }) => {
+                this.dataList = data.records
+                this.page.total = data.total
+                this.dataListLoading = false
+            })
+        },
+        // 新增 / 修改
+        addOrUpdateHandle(id) {
+            this.addOrUpdateVisible = true
+            this.$nextTick(() => {
+                this.$refs.addOrUpdate.init(id)
+            })
+        },
+        // 条件查询 JSON.stringify(arr)
+        searchChange(newData = false) {
+            this.page.currentPage = 1
+            this.getDataList(this.page, newData)
+        },
+        handleSizeChange(val) {
+            this.page.pageSize = val
+            this.getDataList(this.page)
+        },
+        handleCurrentChange(val) {
+            this.page.currentPage = val
+            this.getDataList(this.page)
+        },
+        resetForm(formName) {
+            this.$refs[formName].resetFields()
+            this.searchForm.startTime = undefined
+            this.searchForm.endTime = undefined
+            this.searchForm.orderNumber = undefined
+            this.createDateRange = []
+            this.theData = null
+            this.getDataList(this.page)
+        },
+        createTimeChange() {
+            if (!this.createDateRange || this.createDateRange.length === 0) {
+                this.searchForm.startTime = undefined
+                this.searchForm.endTime = undefined
+            } else {
+                this.searchForm.startTime = this.createDateRange[0]
+                this.searchForm.endTime = this.createDateRange[1]
+            }
+            this.searchChange(true)
+        },
+        // 多选变化
+        selectionChange(val) {
+            this.dataListSelections = val
+        },
+        updateGrowth(id) {
+            if (this.dataListSelections.length <= 0) {
+                return
+            }
+            var ids = id ? [id] : this.dataListSelections.map(item => {
+                return item.userId
+            })
+            // console.log(ids)
+            this.updateGrowthVisible = true
+            this.$nextTick(() => {
+                this.$refs.updateGrowth.init(ids)
+            })
+        },
+        // 修改成长值
+        updateScore(id) {
+            if (this.dataListSelections.length <= 0) {
+                return
+            }
+            var ids = id ? [id] : this.dataListSelections.map(item => {
+                return item.userId
+            })
+            // console.log(ids)
+            this.updateScoreVisible = true
+            this.$nextTick(() => {
+                this.$refs.updateScore.init(ids)
+            })
+        },
+        /**
+         * 导出单品
+         */
+        exportUser() {
+            this.exportDisabled = true
+            this.$http({
+                url: this.$http.adornUrl('/admin/user/exportUser'),
+                method: 'get',
+                params: this.$http.adornParams(this.searchForm),
+                responseType: 'blob' // 解决文件下载乱码问题
+            }).then(({ data }) => {
+                this.exportDisabled = false
+                var blob = new Blob([data], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8' })
+                const fileName = this.$i18n.t('user.userInformationForm')
+                const elink = document.createElement('a')
+                if ('download' in elink) { // 非IE下载
+                    elink.download = fileName
+                    elink.style.display = 'none'
+                    elink.href = URL.createObjectURL(blob)
+                    document.body.appendChild(elink)
+                    elink.click()
+                    URL.revokeObjectURL(elink.href) // 释放URL 对象
+                    document.body.removeChild(elink)
+                } else { // IE10+下载
+                    navigator.msSaveBlob(blob, fileName)
+                }
+            })
+        }
+    }
+}
+</script>
+<style lang="scss" scoped>
+.mod-user {
+    .tips .text {
+        color: #FF0000;
+    }
+}
+
+.TagS {
+    margin-right: 10px !important;
+}
+</style>
+