Quellcode durchsuchen

3.1.3 增加亮灯拣选 修改打印

liuyanpeng vor 1 Jahr
Ursprung
Commit
d2890dbe7f

+ 1 - 1
package.json

@@ -1,7 +1,7 @@
 {
   "name": "client-wms-v3",
   "description": "Leanwo Prodog Client",
-  "version": "3.1.2",
+  "version": "3.1.3",
   "author": "yangzhijie1488 <yangzhijie1488@163.com>",
   "scripts": {
     "dev": "cross-env webpack serve --config ./webpack.dev.js",

+ 139 - 0
src/api/print/Printer.js

@@ -0,0 +1,139 @@
+import { Uuid } from 'pc-component-v3';
+import Common from '../../common/Common';
+
+export default {
+
+  webSocket: null,
+
+  // 获取mac地址
+  getMacAddress: function () {
+    const _self = this;
+    const command = {
+      id: Uuid.createUUID(),
+      command: 'getMacAddress',
+    };
+    const commandStr = JSON.stringify(command);
+    return new Promise((resolve, reject) => {
+      _self.connectNodeRed(resolve, reject, commandStr);
+    });
+  },
+
+  // 获取打印机
+  getPrinters: function () {
+    const _self = this;
+    const command = {
+      id: Uuid.createUUID(),
+      command: 'getPrinters',
+    };
+    const commandStr = JSON.stringify(command);
+    return new Promise((resolve, reject) => {
+      _self.connectNodeRed(resolve, reject, commandStr);
+    });
+  },
+
+  // 执行打印
+  print: function (prnData) {
+    const _self = this;
+    const command = {
+      id: Uuid.createUUID(),
+      command: 'print',
+      data: prnData,
+    };
+    const commandStr = JSON.stringify(command);
+    return new Promise((resolve, reject) => {
+      _self.connectNodeRed(resolve, reject, commandStr);
+    });
+  },
+
+  // 取消打印
+  cancelAllTask: function (prnData) {
+    const _self = this;
+    const command = {
+      id: Uuid.createUUID(),
+      command: 'cancelAllTask',
+      data: prnData,
+    };
+    const commandStr = JSON.stringify(command);
+    return new Promise((resolve, reject) => {
+      _self.connectNodeRed(resolve, reject, commandStr);
+    });
+  },
+
+  // 连接node red的websocket
+  connectNodeRed: function (resolve, reject, commandStr) {
+    const _self = this;
+    let printers = null;
+    let socketUrl = 'ws://127.0.0.1:10092';
+
+    _self.webSocket = new WebSocket(socketUrl);
+    _self.webSocket.onopen = function (event) {
+      console.log('打印 Websocket 连接成功。');
+      if (commandStr != null && commandStr.length > 0) {
+        _self.sendCommand(commandStr);
+      } else {
+        _self.close();
+      }
+    };
+    _self.webSocket.onclose = function (event) {
+      console.log('打印 Websocket 断开连接。');
+      resolve(printers);
+    };
+    _self.webSocket.onerror = function (event) {
+      console.log('打印 Websocket 出错。');
+      _self.close();
+      reject();
+    };
+    _self.webSocket.onmessage = function (event) {
+      const data = JSON.parse(event.data);
+      printers = data;
+      _self.close();
+    };
+  },
+
+  // WebSocket 发送指令
+  sendCommand: function (command) {
+    if (this.webSocket) {
+      this.webSocket.send(command);
+    }
+  },
+
+  // 关闭Websocket
+  close: function () {
+    if (this.webSocket) {
+      this.webSocket.close();
+      this.webSocket = null;
+    };
+  },
+  getRootPath: function () {
+    var protocol = window.location.protocol;
+    var host = window.location.hostname;
+    var path = protocol + host;
+    return path;
+  },
+  // 查询所有模板信息
+  queryTemplates: function () {
+
+    var requestUrl = 'CustomerCloudPrintTemplateResource/querySimpleAllTemplate';
+
+
+    return new Promise((resolve, reject) => {
+      $.ajax({
+        url: Common.getApiURL(requestUrl),
+        type: 'get',
+        contentType: 'application/json',
+
+        beforeSend: function (request) {
+          Common.addTokenToRequest(request);
+        },
+        success: function (data) {
+          resolve(data);
+        },
+        error: function (XMLHttpRequest, textStatus, errorThrown) {
+          reject(XMLHttpRequest);
+        },
+
+      });
+    });
+  },
+};
+

+ 139 - 0
src/common/printer.js

@@ -0,0 +1,139 @@
+import { Uuid } from 'pc-component-v3';
+import Common from './Common.js';
+
+export default {
+
+  webSocket: null,
+
+  // 获取mac地址
+  getMacAddress: function () {
+    const _self = this;
+    const command = {
+      id: Uuid.createUUID(),
+      command: 'getMacAddress',
+    };
+    const commandStr = JSON.stringify(command);
+    return new Promise((resolve, reject) => {
+      _self.connectNodeRed(resolve, reject, commandStr);
+    });
+  },
+
+  // 获取打印机
+  getPrinters: function () {
+    const _self = this;
+    const command = {
+      id: Uuid.createUUID(),
+      command: 'getPrinters',
+    };
+    const commandStr = JSON.stringify(command);
+    return new Promise((resolve, reject) => {
+      _self.connectNodeRed(resolve, reject, commandStr);
+    });
+  },
+
+  // 执行打印
+  print: function (prnData) {
+    const _self = this;
+    const command = {
+      id: Uuid.createUUID(),
+      command: 'print',
+      data: prnData,
+    };
+    const commandStr = JSON.stringify(command);
+    return new Promise((resolve, reject) => {
+      _self.connectNodeRed(resolve, reject, commandStr);
+    });
+  },
+
+  // 取消打印
+  cancelAllTask: function (prnData) {
+    const _self = this;
+    const command = {
+      id: Uuid.createUUID(),
+      command: 'cancelAllTask',
+      data: prnData,
+    };
+    const commandStr = JSON.stringify(command);
+    return new Promise((resolve, reject) => {
+      _self.connectNodeRed(resolve, reject, commandStr);
+    });
+  },
+
+  // 连接node red的websocket
+  connectNodeRed: function (resolve, reject, commandStr) {
+    const _self = this;
+    let printers = null;
+    let socketUrl = 'ws://127.0.0.1:10092';
+
+    _self.webSocket = new WebSocket(socketUrl);
+    _self.webSocket.onopen = function (event) {
+      console.log('打印 Websocket 连接成功。');
+      if (commandStr != null && commandStr.length > 0) {
+        _self.sendCommand(commandStr);
+      } else {
+        _self.close();
+      }
+    };
+    _self.webSocket.onclose = function (event) {
+      console.log('打印 Websocket 断开连接。');
+      resolve(printers);
+    };
+    _self.webSocket.onerror = function (event) {
+      console.log('打印 Websocket 出错。');
+      _self.close();
+      reject();
+    };
+    _self.webSocket.onmessage = function (event) {
+      const data = JSON.parse(event.data);
+      printers = data;
+      _self.close();
+    };
+  },
+
+  // WebSocket 发送指令
+  sendCommand: function (command) {
+    if (this.webSocket) {
+      this.webSocket.send(command);
+    }
+  },
+
+  // 关闭Websocket
+  close: function () {
+    if (this.webSocket) {
+      this.webSocket.close();
+      this.webSocket = null;
+    };
+  },
+  getRootPath: function () {
+    var protocol = window.location.protocol;
+    var host = window.location.hostname;
+    var path = protocol + host;
+    return path;
+  },
+  // 查询所有模板信息
+  queryTemplates: function () {
+
+    var requestUrl = 'CustomerCloudPrintTemplateResource/querySimpleAllTemplate';
+
+
+    return new Promise((resolve, reject) => {
+      $.ajax({
+        url: Common.getApiURL(requestUrl),
+        type: 'get',
+        contentType: 'application/json',
+
+        beforeSend: function (request) {
+          Common.addTokenToRequest(request);
+        },
+        success: function (data) {
+          resolve(data);
+        },
+        error: function (XMLHttpRequest, textStatus, errorThrown) {
+          reject(XMLHttpRequest);
+        },
+
+      });
+    });
+  },
+};
+

Datei-Diff unterdrückt, da er zu groß ist
+ 392 - 497
src/components/InventoryPrint.vue


+ 676 - 0
src/components/InventoryPrintOld.vue

@@ -0,0 +1,676 @@
+/** * 存货打印 */
+
+<template>
+  <div class="container-fluid">
+    <Navbar title="标签打印" :is-go-back="false" />
+    <div class="flex-container" style="margin-top: 10px">
+      <div class="flex-header">
+        <div>
+          <div class="form-inline" role="form">
+            <PrintWidget
+              ref="printWidget"
+              :printer-localstorage-id="'#InventoryPrinterPrinter'"
+              @selected-printer-name="getPrintName"
+            />
+
+            <div class="form-group">
+              <input
+                v-model="message"
+                autocomplete="off"
+                type="text"
+                class="form-control"
+                placeholder="请输入要打印存货的名称或编码"
+                aria-describedby="basic-addon"
+                style="width: 350px"
+                @keyup.enter="queryInventory"
+              />
+            </div>
+            <div class="form-group">
+              <button class="btn btn-default" @click="queryInventory">查询</button>
+              <button class="btn btn-default" @click="$refs.printEpc.show()">
+                再次打印
+              </button>
+            </div>
+          </div>
+        </div>
+      </div>
+      <div class="flex-content" style="margin-top: 10px">
+        <table class="fixed-table table-striped table-bordered">
+          <thead>
+            <tr>
+              <th style="width: 50px">序号</th>
+              <th style="width: 50px">图片</th>
+              <th style="width: 150px">存货名称</th>
+              <th style="width: 150px">存货编号</th>
+              <th style="width: 150px">规格型号</th>
+              <th style="width: 60px">计量单位</th>
+              <th style="width: 60px">采购订单编号</th>
+              <th style="width: 100px">批号</th>
+              <th style="width: 80px">标签个数</th>
+              <th style="width: 80px">标签代表数量</th>
+              <th style="width: 150px">供应商</th>
+              <th style="width: 150px">放置货位</th>
+              <th style="width: 60px">
+                <button
+                  type="button"
+                  class="btn btn-default"
+                  style="width: 100%"
+                  @click="generateAllPack()"
+                >
+                  打印
+                </button>
+              </th>
+              <th style="width: 100px">
+                <button
+                  type="button"
+                  class="btn btn-default"
+                  style="width: 100%"
+                  @click="generateAllRepeatPack()"
+                >
+                  重复打印全部
+                </button>
+              </th>
+            </tr>
+          </thead>
+          <tbody class="table1">
+            <tr v-for="(inventoryInstance, index) in inventoryInstanceDatas" :key="inventoryInstance.id">
+              <td>
+                {{
+                  index +
+                    1 +
+                    (pagination.current_page - 1) * pagination.per_page
+                }}
+              </td>
+              <td>
+                <img
+                  :src="
+                    Common.getThumbnailImageSrc(className, inventoryInstance.imageNames)
+                  "
+                  class="image"
+                  @click="
+                    $refs.imagePreview.preview(className, inventoryInstance.imageNames)
+                  "
+                />
+              </td>
+              <td>
+                {{ inventoryInstance.inventoryName }}
+              </td>
+              <td>
+                {{ inventoryInstance.inventoryCode }}
+              </td>
+              <td>
+                {{ inventoryInstance.type }}
+              </td>
+              <td>
+                {{ inventoryInstance.computationUnit }}
+              </td>
+              <td>
+                <input
+                  v-model="inventoryInstance.purchaseOrderNo"
+                  autocomplete="off"
+                  type="text"
+                  class="form-control"
+                  style="width: 100%"
+                />
+              </td>
+              <td>
+                <input
+                  v-model="inventoryInstance.batchNo"
+                  autocomplete="off"
+                  type="text"
+                  class="form-control"
+                  style="width: 100%"
+                />
+              </td>
+              <td>
+                <input
+                  v-model="inventoryInstance.packageCount"
+                  autocomplete="off"
+                  type="number"
+                  class="form-control"
+                  style="width: 100%"
+                />
+              </td>
+              <td>
+                <input
+                  v-model="inventoryInstance.quantity"
+                  autocomplete="off"
+                  type="text"
+                  style="width: 100%"
+                  class="form-control"
+                />
+              </td>
+              <td>
+                <SearchWidget
+                  :info-window-no="infoWindowNo1"
+                  :field-value="getFieldValue1(inventoryInstance)"
+                  :display-name="'v.name'"
+                  :where-clause-source="whereClauseSource"
+                  @value-changed="valueChanged1($event, inventoryInstance)"
+                />
+              </td>
+              <td>
+                <SearchWidget
+                  :info-window-no="infoWindowNo2"
+                  :field-value="getFieldValue2(inventoryInstance)"
+                  :display-name="'p.barCode'"
+                  :where-clause-source="whereClauseSource"
+                  @value-changed="valueChanged2($event, inventoryInstance)"
+                />
+              </td>
+              <td>
+                <button
+                  type="button"
+                  class="btn btn-default"
+                  style="width: 100%"
+                  @click="generatePack(inventoryInstance)"
+                >
+                  打印
+                </button>
+              </td>
+              <td>
+                <button
+                  type="button"
+                  class="btn btn-default"
+                  style="width: 100%"
+                  @click="generateRepeatPack(inventoryInstance)"
+                >
+                  重复打印
+                </button>
+              </td>
+            </tr>
+          </tbody>
+        </table>
+      </div>
+      <div class="flex-footer">
+        <div>
+          <div class="form-group">
+            <div class="pull-left">
+              共查询到<b>{{ pagination.total }}</b>条数据
+            </div>
+            <div class="pull-right">
+              <VueBootstrapPagination
+                v-if="pagination.last_page > 0"
+                :pagination="pagination"
+                :callback="queryInventory"
+              />
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+
+    <PrintEpc ref="printEpc" :printer-name="printerName" />
+    <Loading v-if="loading" />
+    <ImagePreview ref="imagePreview" />
+  </div>
+</template>
+
+<script>
+import Common from '../common/Common.js';
+
+
+
+import InventoryResource from '../api/common/InventoryResource.js';
+import InventoryInstancePrintResource from '../api/wms/InventoryInstancePrintResource.js';
+import { PrintUtil, PrintWidget } from 'pc-component-v3';
+
+export default {
+  components: {
+    PrintWidget,
+    
+  },
+  data: function () {
+    this.Common = Common;
+    return {
+      message: '',
+      inventoryInstanceDatas: [],
+      recordIds: [],
+      infoWindowNo1: 283036,
+      infoWindowNo2: 283920,
+      whereClauseSource: {
+        customerDataDimensions:[{
+          fieldName: 'organization.id',
+          dataDimensionTypeNo: '202201191700',
+          defaultDataDimensionTypeValueNo: '1',
+        }],
+      },
+      pagination: {
+        total: 0,
+        per_page: Common.pageSize, // required
+        current_page: 1, // required
+        last_page: 0, // required
+      },
+      isUpdatePage: true,
+      className: 'com.leanwo.prodog.model.common.Inventory',
+      allRepeatPack: [], //重复打印全部的id
+      printType: 0, //类型 0:采购入库打印/1:扫描入库打印
+      printerName: '',
+      loading: false,
+      selectedPrinterTitle:'',
+    };
+  },
+
+  mounted: function () {
+    var _self = this;
+    _self.queryInventory();
+
+    $('.fixed-table').tableFixer({
+      left: 3,
+      head: true,
+    });
+
+    $('.fixed-table').colResizable({
+      resizeMode: 'overflow',
+      partialRefresh: true,
+    });
+  },
+
+  methods: {
+
+    getPrintName:function(value){
+      this.selectedPrinterTitle = value;
+    },
+
+    getFieldValue1: function (item) {
+      var fieldValue1 = {
+        id: item.vendorId,
+        displayValue: [item.vendorName],
+        fieldType: 'Key',
+      };
+      return fieldValue1;
+    },
+
+    getFieldValue2: function (item) {
+      var fieldValue2 = {
+        id: item.positionId,
+        displayValue: [item.savePositionName],
+        fieldType: 'Key',
+      };
+      return fieldValue2;
+    },
+
+    // 用户选择框change事件
+    valueChanged1: function (newFieldValue, item) {
+      item.vendorId = newFieldValue.id;
+      item.vendorName = newFieldValue.displayValue[0];
+    },
+
+    // 用户选择框change事件
+    valueChanged2: function (newFieldValue, item) {
+      item.positionId = newFieldValue.id;
+      item.savePositionName = newFieldValue.displayValue[0];
+    },
+
+    /**
+     * 打印选择的全部存货
+     */
+    generateAllPack: function () {
+      var _self = this;
+      var quantityFilled = true;
+      this.inventoryInstanceDatas.forEach(function (item) {
+        if (!item.quantity) {
+          quantityFilled = false;
+        }
+      });
+
+      if (!quantityFilled) {
+        Notify.error('提示', '请填写数量', false);
+        return;
+      }
+
+      var correctQuantity = true;
+      this.inventoryInstanceDatas.forEach(function (item) {
+        if (parseInt(item.quantity) != item.quantity || item.quantity <= 0) {
+          correctQuantity = false;
+        }
+      });
+
+      if (!correctQuantity) {
+        Notify.error('提示', '请输入正整数', false);
+        return;
+      }
+
+      let selectedPrinter = this.selectedPrinterTitle;
+      if (selectedPrinter == null || selectedPrinter.length == 0) {
+        Notify.error('提示', '请先选择打印机。', false);
+        return;
+      }
+      $.ajax({
+        url: Common.getApiURL(
+          'InventoryInstanceResource/generateInventoryInstances?type=' + _self.printType,
+        ),
+        dataType: 'json',
+        type: 'post',
+        contentType: 'application/json',
+        data: JSON.stringify(_self.inventoryInstanceDatas),
+        beforeSend: function (request) {
+          Common.addTokenToRequest(request);
+        },
+        success: function (successData) {
+          var ids = [];
+          if(successData.errorCode == 0) {
+            if(successData.datas.length > 0) {
+              successData.datas.forEach(function (item) {
+                ids.push(item.id);
+              });
+              _self.print(ids);
+
+              //更新全部重复打印数据
+              _self.allRepeatPack = successData.datas;
+            }
+          } else {
+            Notify.error('提示', successData.errorMessage, false);
+          }
+        },
+        error: function (XMLHttpRequest, textStatus, errorThrown) {
+          Common.processException(XMLHttpRequest, textStatus, errorThrown);
+        },
+      });
+    },
+
+    /**
+     * 重复打印全部
+     */
+    generateAllRepeatPack: function () {
+      var _self = this;
+      if (_self.allRepeatPack == null || _self.allRepeatPack.length == 0) {
+        Notify.error(
+          '提示',
+          '请先点击【打印】按钮,然后再点击【重复打印全部】按钮。',
+          false,
+        );
+        return;
+      } else {
+        var ids = [];
+        _self.allRepeatPack.forEach(function (item) {
+          ids.push(item.id);
+        });
+        _self.print(ids);
+      }
+    },
+
+    /**
+     * 打印单个存货
+     */
+    generatePack: function (inventoryInstance) {
+      var _self = this;
+      if (!inventoryInstance.quantity) {
+        Notify.error('提示', '请填写数量。', false);
+        return;
+      }
+      if (
+        parseInt(inventoryInstance.quantity) != inventoryInstance.quantity ||
+        inventoryInstance.quantity <= 0
+      ) {
+        Notify.error('提示', '请输入正整数。', false);
+        return;
+      }
+
+      let selectedPrinter = this.selectedPrinterTitle;
+      if (selectedPrinter == null || selectedPrinter.length == 0) {
+        Notify.error('提示', '请先选择打印机。', false);
+        return;
+      }
+
+      var datas = [];
+      datas.push(inventoryInstance);
+      $.ajax({
+        url: Common.getApiURL(
+          'InventoryInstanceResource/generateInventoryInstances?type=' + _self.printType,
+        ),
+        dataType: 'json',
+        type: 'post',
+        contentType: 'application/json',
+        data: JSON.stringify(datas),
+        beforeSend: function (request) {
+          Common.addTokenToRequest(request);
+          _self.loading=true;
+        },
+        success: function (successData) {
+          _self.loading=false;
+          var ids = [];
+          if(successData.errorCode == 0) {
+            if(successData.datas.length > 0) {
+              successData.datas.forEach(function (item) {
+                ids.push(item.id);
+              });
+              _self.print(ids);
+
+              //更新全部重复打印数据
+              _self.allRepeatPack = successData.datas;
+            }
+          } else {
+            Notify.error('提示', successData.errorMessage, false);
+          }
+        },
+        error: function (XMLHttpRequest, textStatus, errorThrown) {
+          _self.loading=false;
+          Common.processException(XMLHttpRequest, textStatus, errorThrown);
+        },
+      });
+    },
+
+    /**
+     * 重复打印其中一种
+     * @param {Object} inventoryInstance
+     */
+    generateRepeatPack: function (inventoryInstance) {
+      var _self = this;
+      var printIds = [];
+      _self.allRepeatPack.forEach(function (item) {
+        if (item.inventoryId == inventoryInstance.inventoryId) {
+          printIds.push(item.id);
+        }
+      });
+
+      if (printIds == null || printIds.length == 0) {
+        Notify.error('提示', '请先点击【打印】按钮,然后再点击【重复打印】按钮。', false);
+        return;
+      } else {
+        _self.print(printIds);
+      }
+    },
+
+    /**
+     * 根据物料名称或者编号查询数据
+     */
+    queryInventory: function () {
+      var _self = this;
+      var message = $.trim(this.message);
+      if (_self.message.length > 0 && !_self.isUpdatePage) {
+        _self.pagination.current_page = 1;
+        _self.isUpdatePage = true;
+      } else if (_self.message.length <= 0) {
+        _self.isUpdatePage = false;
+      }
+      _self.inventoryInstanceDatas.splice(0, _self.inventoryInstanceDatas.length);
+
+      let inventoryQueryConditionRequest = {
+        name: message,
+        no: message,
+        type: message,
+        range: {
+          start: (_self.pagination.current_page - 1) * _self.pagination.per_page,
+          length: _self.pagination.per_page,
+        },
+      };
+      _self.loading=true;
+      InventoryResource.findByQueryCodition(inventoryQueryConditionRequest).then(
+        baseRangeResponse => {
+          _self.loading=false;
+          if (baseRangeResponse.errorCode == 0) {
+            if(baseRangeResponse.datas != null){
+              baseRangeResponse.datas.forEach(function (item) {
+                var newInventoryInstance = {
+                  inventoryName: item.name,
+                  inventoryCode: item.no,
+                  quantity: '',
+                  batchNo: '',
+                  savePositionName: item.savePositionName,
+                  computationUnit: item.computationUnit,
+                  type: item.type,
+                  inventoryId: item.id,
+                  vendorId: item.vendorId,
+                  positionId: item.positionId,
+                  vendorName: item.vendorName,
+                  imageNames: item.imageNames,
+                  purchaseOrderNo: item.purchaseOrderNo,
+                };
+                _self.inventoryInstanceDatas.push(newInventoryInstance);
+              });
+              _self.pagination.total = baseRangeResponse.total;
+              _self.pagination.last_page = Math.ceil(
+                _self.pagination.total / _self.pagination.per_page,
+              );
+            }
+          }
+          //查询清空上一次的打印数据
+          _self.allRepeatPack = [];
+          _self.fixedTableHeader();
+        },
+        errorData => {
+          _self.loading=false;
+          Common.processException(errorData);
+        },
+      );
+    },
+
+    /**
+     * 打印文件
+     */
+    print: function (recordIds) {
+      var _self = this;
+      var printData = [];
+
+      _self.loading=true;
+      InventoryInstancePrintResource.print(recordIds).then(
+        baseListResponse => {
+          _self.loading=false;
+          if (baseListResponse.errorCode == 0) {
+            let selectedPrinter = this.selectedPrinterTitle;
+            let selectedPrinterType = _self.$refs.printWidget.getSelectedPrinterTypeTitle();
+            _self.printerName = selectedPrinter;
+            if (selectedPrinterType == '发卡机' || selectedPrinterType == 'Jw发卡机') {
+              _self.$nextTick(function () {
+                _self.$refs.printEpc.printPrintPages(baseListResponse.datas);
+              });
+            } else {
+              var contents = [];
+              baseListResponse.datas.forEach(function (item) {
+                var printItem = {
+                  id: null,
+                  name: null,
+                  content: item,
+                };
+                console.log(printItem);
+                if (
+                  printItem.content == null ||
+                  printItem.content.printItems == null ||
+                  printItem.content.printItems.length == 0
+                ) {
+                  Notify.error('错误', '打印模板无数据,不能打印。');
+                  return;
+                }
+                var content = JSON.stringify(printItem.content);
+                if (content == null || content == '' || content == '{}') {
+                  Notify.error('错误', '请先选择模板,再点击下载。');
+                  return;
+                }
+                contents.push(printItem.content);
+              });
+              PrintUtil.printPrintPages(contents, selectedPrinter);
+            }
+          }
+        },
+        errorData => {
+          _self.loading=false;
+          Common.processException(errorData);
+        },
+      );
+    },
+
+    /**
+     * 冻结表头
+     */
+    fixedTableHeader: function () {
+      let _self = this;
+
+      _self.$nextTick(function () {
+        $('.fixed-table').tableFixer({
+          left: 3,
+          head: true,
+        });
+      });
+    },
+  },
+};
+</script>
+
+<style scoped>
+.flex-container {
+  display: flex;
+  /* 垂直*/
+  flex-direction: column;
+  width: 100%;
+  /*视口被均分为100单位的vh 占据整个窗口,扣掉顶部topNav的距离后,计算得到container的高度*/
+  height: calc(100vh - 140px);
+}
+
+.flex-header {
+  /*放大缩小比例为0 */
+  flex: 0 0 35px;
+}
+
+.flex-footer {
+  height: 45px;
+  /*放大缩小比例为0 */
+  flex: 0 0 45px;
+}
+
+.flex-content {
+  flex: 1;
+  overflow: scroll;
+  width: 100%;
+}
+
+.fixed-table {
+  table-layout: fixed;
+  word-wrap: break-word;
+  word-break: break-all;
+}
+</style>
+
+<style scoped>
+.fixed-table {
+  table-layout: fixed;
+  width: 800px !important;
+  min-width: 800px !important;
+}
+
+table.fixed-table tr {
+  height: 40px;
+}
+
+table.fixed-table th,
+table.fixed-table td {
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+}
+
+.image {
+  width: 40px;
+  height: 40px;
+}
+
+.modal-img-box {
+  width: 100%;
+  text-align: center;
+  overflow: auto;
+}
+
+.m-img {
+  width: 100%;
+}
+</style>

+ 91 - 89
src/customer/BalanceInventory.vue

@@ -62,95 +62,97 @@
             class="fixed-table table table-striped table-bordered"
             border="0"
           >
-            <tr>
-              <td style="width: 220px">
-                <strong>名称:{{ balanceInventory.name }}</strong>
-              </td>
-              <td style="width: 220px">
-                <strong> 单据号:{{ balanceInventory.documentNo }}</strong>
-              </td>
-              <td style="width: 220px">
-                <strong> 仓库:{{ balanceInventory.warehouseName }}</strong>
-              </td>
-              <td style="width: 220px">
-                <strong> 结存人:{{ balanceInventory.balanceUserName }}</strong>
-              </td>
-              <td style="width: 220px">
-                <strong> 操作时间:{{ balanceInventory.balanceTime }}</strong>
-              </td>
-              <td style="width: 220px">
-                <strong>
-                  结存年月:{{ balanceInventory.balanceYear }}-{{
-                    balanceInventory.balanceMouth
-                  }}</strong>
-              </td>
-            </tr>
-
-            <tr>
-              <td style="width: 220px">
-                <strong>
-                  期初结存数量:{{ balanceInventory.beforeQuantity }}</strong>
-              </td>
-              <td style="width: 220px">
-                <strong>
-                  期初结存总金额:{{ balanceInventory.beforeTotalPrice }}</strong>
-              </td>
-              <td style="width: 220px">
-                <strong>
-                  期初结存含税总金额:{{
-                    balanceInventory.beforeTotalPriceIncludingTax
-                  }}</strong>
-              </td>
-              <td style="width: 220px">
-                <strong>
-                  当月入库总数量:{{ balanceInventory.stockInQuantity }}</strong>
-              </td>
-              <td style="width: 220px">
-                <strong>
-                  当月入库总金额:{{
-                    balanceInventory.stockInTotalPrice
-                  }}</strong>
-              </td>
-              <td style="width: 220px">
-                <strong>
-                  当月入库含税总金额:{{
-                    balanceInventory.stockInTotalPriceIncludingTax
-                  }}</strong>
-              </td>
-            </tr>
-
-            <tr>
-              <td style="width: 220px">
-                <strong>
-                  当月出库总数量:{{ balanceInventory.stockOutQuantity }}</strong>
-              </td>
-              <td style="width: 220px">
-                <strong>
-                  当月出库总金额:{{
-                    balanceInventory.stockOutTotalPrice
-                  }}</strong>
-              </td>
-              <td style="width: 220px">
-                <strong>
-                  当月出库含税总金额:{{
-                    balanceInventory.stockOutTotalPriceIncludingTax
-                  }}</strong>
-              </td>
-              <td style="width: 220px">
-                <strong>
-                  期末结存数量:{{ balanceInventory.afterQuantity }}</strong>
-              </td>
-              <td style="width: 220px">
-                <strong>
-                  期末结存总金额:{{ balanceInventory.afterTotalPrice }}</strong>
-              </td>
-              <td style="width: 220px">
-                <strong>
-                  期末结存含税总金额:{{
-                    balanceInventory.afterTotalPriceIncludingTax
-                  }}</strong>
-              </td>
-            </tr>
+            <tbody>
+              <tr>
+                <td style="width: 220px">
+                  <strong>名称:{{ balanceInventory.name }}</strong>
+                </td>
+                <td style="width: 220px">
+                  <strong> 单据号:{{ balanceInventory.documentNo }}</strong>
+                </td>
+                <td style="width: 220px">
+                  <strong> 仓库:{{ balanceInventory.warehouseName }}</strong>
+                </td>
+                <td style="width: 220px">
+                  <strong> 结存人:{{ balanceInventory.balanceUserName }}</strong>
+                </td>
+                <td style="width: 220px">
+                  <strong> 操作时间:{{ balanceInventory.balanceTime }}</strong>
+                </td>
+                <td style="width: 220px">
+                  <strong>
+                    结存年月:{{ balanceInventory.balanceYear }}-{{
+                      balanceInventory.balanceMouth
+                    }}</strong>
+                </td>
+              </tr>
+
+              <tr>
+                <td style="width: 220px">
+                  <strong>
+                    期初结存数量:{{ balanceInventory.beforeQuantity }}</strong>
+                </td>
+                <td style="width: 220px">
+                  <strong>
+                    期初结存总金额:{{ balanceInventory.beforeTotalPrice }}</strong>
+                </td>
+                <td style="width: 220px">
+                  <strong>
+                    期初结存含税总金额:{{
+                      balanceInventory.beforeTotalPriceIncludingTax
+                    }}</strong>
+                </td>
+                <td style="width: 220px">
+                  <strong>
+                    当月入库总数量:{{ balanceInventory.stockInQuantity }}</strong>
+                </td>
+                <td style="width: 220px">
+                  <strong>
+                    当月入库总金额:{{
+                      balanceInventory.stockInTotalPrice
+                    }}</strong>
+                </td>
+                <td style="width: 220px">
+                  <strong>
+                    当月入库含税总金额:{{
+                      balanceInventory.stockInTotalPriceIncludingTax
+                    }}</strong>
+                </td>
+              </tr>
+
+              <tr>
+                <td style="width: 220px">
+                  <strong>
+                    当月出库总数量:{{ balanceInventory.stockOutQuantity }}</strong>
+                </td>
+                <td style="width: 220px">
+                  <strong>
+                    当月出库总金额:{{
+                      balanceInventory.stockOutTotalPrice
+                    }}</strong>
+                </td>
+                <td style="width: 220px">
+                  <strong>
+                    当月出库含税总金额:{{
+                      balanceInventory.stockOutTotalPriceIncludingTax
+                    }}</strong>
+                </td>
+                <td style="width: 220px">
+                  <strong>
+                    期末结存数量:{{ balanceInventory.afterQuantity }}</strong>
+                </td>
+                <td style="width: 220px">
+                  <strong>
+                    期末结存总金额:{{ balanceInventory.afterTotalPrice }}</strong>
+                </td>
+                <td style="width: 220px">
+                  <strong>
+                    期末结存含税总金额:{{
+                      balanceInventory.afterTotalPriceIncludingTax
+                    }}</strong>
+                </td>
+              </tr>
+            </tbody>
           </table>
         </div>
         <div id="accordion">

+ 4 - 1
src/index.js

@@ -47,7 +47,8 @@ import CurrentStockProjectItemManger from './stock/CurrentStockProjectItemManger
 import UploadTrainingVideo from './pad/UploadTrainingVideo.vue';
 import SynchronousMaintenanceForm from './pad/SynchronousMaintenanceForm.vue';
 import QueryMaintenancePlan from './pad/QueryMaintenancePlan.vue';
-
+import LightSetting from './light/LightSetting.vue';
+import LightStockInOrOut from './light/LightStockInOrOut.vue';
 
 export {
   HelloWorld,
@@ -97,4 +98,6 @@ export {
   UploadTrainingVideo,
   SynchronousMaintenanceForm,
   QueryMaintenancePlan,
+  LightSetting,
+  LightStockInOrOut,
 };

+ 191 - 0
src/light/CommonTable.vue

@@ -0,0 +1,191 @@
+<template>
+  <div class="tablePaganations">
+    <!-- <a-config-provider :locale="locale"> -->
+    <a-table
+      class="ant-table-striped"
+      bordered
+      size="small"
+      height="1000px"
+      :loading="isLoading"
+      :data-source="dataSource"
+      :columns="columns"
+      :scroll="{ y: yScroll }"
+      :pagination="havePage ? pagination : false"
+      :row-key="(record) => record.id"
+      :row-selection="
+        isSelect
+          ? {
+            selectedRowKeys: state.selectedRowKeys,
+            onSelect: selectEvent,
+            onSelectAll: selectAllEvent,
+          }
+          : null
+      "
+      :row-class-name="
+        (_record, index) => (index % 2 === 1 ? 'table-striped' : null)
+      "
+    >
+      <template
+        v-for="(item, index) in renderArr"
+        #[item]="scope"
+        :key="index"
+      >
+        <slot :name="item" :scope="scope" v-bind="scope || {}" />
+      </template>
+    </a-table>
+    <!-- </a-config-provider> -->
+  </div>
+</template>
+  
+<script setup>
+import {
+  useSlots,
+  ref,
+  reactive,
+  defineProps,
+  defineEmits,
+  watch,
+  defineExpose,
+} from 'vue';
+// import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN';
+// const locale = ref(zhCN);
+const props = defineProps({
+  dataSource: {
+    type: Object,
+    required: true,
+  },
+  columns: {
+    type: Object,
+    required: true,
+  },
+  isSelect: {
+    type: Boolean,
+    default: false,
+  },
+  isLoading: {
+    type: Boolean,
+  },
+  total: {
+    type: Number,
+    default: 0,
+  },
+  yScroll: {
+    type: Number,
+    default: 370,
+  },
+  havePage:{
+    type:Boolean,
+    default:true,
+  },
+});
+
+//  选择数据
+const state = reactive({
+  selectedRows: [],
+  selectedRowKeys: [],
+});
+
+// 分页配置
+const pagination = reactive({
+  showQuickJumper: true,
+  current: 1,
+  pageSize: 20, // 默认每页显示数量
+  showSizeChanger: true, // 显示可改变每页数量
+  pageSizeOptions: ['20', '50', '100', '200', '300', '500'], // 每页数量选项值
+  showTotal: (total, range) =>
+    range[0] + '-' + range[1] + '条' + ' 共' + total + '条', // 显示总数
+  onShowSizeChange: (current, pageSize) => showSizeChange(current, pageSize),
+  onChange: (current, pageSize) => changePage(current, pageSize), //点击页码事件
+  total: props.total,
+});
+const emit = defineEmits(['pageParams', 'selectColumn']);
+
+// 改变每页数量时更新显示
+const showSizeChange = (current, pageSize) => {
+  setTimeout(() => {
+    pagination.current = 1;
+    emit('pageParams', pagination.current, pageSize);
+  });
+  pagination.pageSize = pageSize;
+};
+
+//点击页码事件
+const changePage = (current, size) => {
+  pagination.current = current;
+  emit('pageParams', pagination.current, size);
+};
+
+// 选择每一项操作
+const selectEvent = (record, selected, selectedRows) => {
+  if (selected) {
+    state.selectedRows.push(record);
+    state.selectedRowKeys.push(record.id);
+  } else {
+    let index = state.selectedRowKeys.indexOf(record.id);
+    if (index >= 0) {
+      state.selectedRows.splice(index, 1);
+      state.selectedRowKeys.splice(index, 1);
+    }
+  }
+  emit('selectColumn', state.selectedRows);
+};
+
+// 全选按钮操作
+const selectAllEvent = (selected, selectedRows, changeRows) => {
+  if (selected) {
+    state.selectedRows = state.selectedRows.concat(changeRows);
+    state.selectedRows.forEach(item => {
+      state.selectedRowKeys.push(item.id);
+    });
+  } else {
+    changeRows.forEach(item => {
+      state.selectedRows.forEach(row => {
+        if (item.id == row.id) {
+          state.selectedRows.splice(0, 1);
+        }
+      });
+      let index = state.selectedRowKeys.indexOf(item.id);
+      if (index >= 0) {
+        state.selectedRows.splice(index, 1);
+        state.selectedRowKeys.splice(index, 1);
+      }
+    });
+  }
+  emit('selectColumn', state.selectedRows);
+};
+
+// 清空选择
+const clear = () => {
+  state.selectedRowKeys = [];
+  state.selectedRows = [];
+  emit('selectColumn', state.selectedRows);
+};
+// 回到第一页
+const backFirstPage = () => {
+  pagination.current = 1;
+  emit('pageParams', pagination.current, pagination.pageSize);
+};
+defineExpose({ clear, backFirstPage });
+
+// 监听total变化
+watch(
+  props,
+  newData => {
+    pagination.total = newData.total;
+  },
+  { immediate: true, deep: true },
+);
+
+// 插槽的实例
+const slots = useSlots();
+const renderArr = Object.keys(slots);
+</script>
+<style scoped>
+.tablePaganations {
+  width: 100%;
+  margin-bottom: 20px;
+}
+.ant-table-striped :deep(.table-striped) td {
+  background-color: #fafafa;
+}
+</style>

+ 176 - 0
src/light/LightSetting.vue

@@ -0,0 +1,176 @@
+<template>
+  <div class="container-fluid">
+    <Navbar title="标签服务器配置" :is-go-back="false" />
+    <div>
+      <div>
+        <div class="form-group">
+          <label>url路径</label>
+          <input v-model.trim="lightSettingDto.url" type="text" :disabled="isdisable" class="form-control" />
+        </div>
+
+        <div class="form-group">
+          <label>标签亮灯显示映射号</label>
+          <input
+            v-model.trim="lightSettingDto.mappingtype" type="number" :disabled="isdisable"
+            class="form-control"
+          />
+        </div>
+
+        <div class="form-group">
+          <label>标签亮灯显示样式id</label>
+          <input
+            v-model.trim="lightSettingDto.styleid" type="number" :disabled="isdisable"
+            class="form-control"
+          />
+        </div>
+
+        <div class="form-group">
+          <label>标签默认显示映射号</label>
+          <input
+            v-model.trim="lightSettingDto.mappingtype1" type="number" :disabled="isdisable"
+            class="form-control"
+          />
+        </div>
+
+        <div class="form-group">
+          <label>标签默认显示样式id</label>
+          <input
+            v-model.trim="lightSettingDto.styleid1" type="number" :disabled="isdisable"
+            class="form-control"
+          />
+        </div>
+      </div>
+    </div>
+
+    <div class="row">
+      <div class="col-md-12">
+        <button class="btn btn-default" @click="changeIsdisabled()">
+          {{ isdisable ? '编辑' : '取消编辑' }}
+        </button>
+        <button v-if="!isdisable" class="btn btn-primary" @click="saveOrUpdateLightSetting()">
+          保存
+        </button>
+        <button v-if="isdisable" class="btn btn-success" @click="openLight()">
+          电子标签管理系统
+        </button>
+      </div>
+    </div>
+
+    <Loading v-if="loading" />
+  </div>
+</template>
+
+<script>
+
+import { Notify, Common } from 'pc-component-v3';
+import LightResource from './api/LightResource.js';
+
+
+export default {
+  data: function () {
+    return {
+      lightSettingDto: {
+        id: undefined,
+        url: undefined,
+        mappingtype: undefined,
+        styleid: undefined,
+        mappingtype1: undefined,
+        styleid1: undefined,
+      },
+      isdisable: true,
+      loading: false,
+    };
+  },
+  mounted: function () {
+    this.refresh();
+  },
+
+  methods: {
+    /**
+             * 跳转电子标签管理系统
+             * @author GuoZhiBo 20210830
+             */
+    openLight: function () {
+      var _self = this;
+      if(!_self.lightSettingDto.url){
+        Notify.notice('提示', '请先配置url路径。', false);
+        return;
+      }
+      window.open(_self.lightSettingDto.url);
+    },
+
+    /**
+                 * 获取标签服务器配置
+                 * @author GuoZhiBo 20210830
+                 */
+    getLightDto: function () {
+      var _self = this;
+      LightResource.getLightDto().then(
+        successData => {
+          if (!successData) {
+            _self.createDefaultLightSettingDto();
+          } else {
+            _self.lightSettingDto = successData;
+          }
+        },
+        errorData => {
+          Common.processException(errorData);
+        },
+      );
+    },
+
+    /**
+                 * 创建默认的标签服务配置
+                 * @author GuoZhiBo 20210830
+                 */
+    createDefaultLightSettingDto: function () {
+      var _self = this;
+      LightResource.createDefaultLightSetting().then(
+        successData => {
+          _self.lightSettingDto = successData;
+        },
+        errorData => {
+          Common.processException(errorData);
+        },
+      );
+    },
+
+    changeIsdisabled: function () {
+      this.isdisable = !this.isdisable;
+      if (this.isdisable) {
+        this.refresh();
+      }
+    },
+
+    /**
+                 * 保存仓库配置
+                 */
+    saveOrUpdateLightSetting: function () {
+      var _self = this;
+      _self.loading = true;;
+      LightResource.saveOrUpdateLightSetting(_self.lightSettingDto).then(
+        successData => {
+          _self.loading = false;;
+          _self.changeIsdisabled();
+          Notify.success('提示', '已保存!', 1500);
+        },
+        errorData => {
+          _self.loading = false;;
+          Common.processException(errorData);
+        },
+      );
+    },
+
+    /**
+                 *刷新
+                 */
+    refresh: function () {
+      this.getLightDto();
+    },
+
+
+  },
+};
+</script>
+
+<style></style>

+ 196 - 0
src/light/LightStockInOrOut.vue

@@ -0,0 +1,196 @@
+<template>
+  <Navbar title="亮灯拣选" :is-go-back="false" />
+  <a-form>
+    <a-form-item :label="'领料单'" style="margin-bottom: 0;">
+      <a-select
+        v-model:value="documentNo" show-search option-filter-prop="label" placeholder="请选择领料单"
+        style="width: 240px;"
+        :options="documentNos.map((item) => ({ value: item.id, label: item.documentNo + '-' + item.userName }))"
+      />
+      <a-button type="primary" class="operationBtn" @click="startPick">
+        开始拣料
+      </a-button>
+      <a-button v-if="isShow" type="dashed" class="operationBtn" @click="completeAll">
+        全部拣货
+      </a-button>
+    </a-form-item>
+  </a-form>
+  <div class="content">
+    <div ref="mod">
+      <div>
+        <CommonTable
+          ref="table" :total="total" :columns="detailColumns" :is-loading="isLoading"
+          :data-source="detailData"
+        >
+          <template #bodyCell="{ column, record }">
+            <template v-if="column.key === 'lightOrderStatusName'">
+              <span>
+                <a-tag
+                  :color="record.lightOrderStatusName === '已完成'
+                    ? 'green'
+                    : 'volcano'
+                  "
+                >
+                  {{ record.lightOrderStatusName }}
+                </a-tag>
+              </span>
+            </template>
+          </template>
+        </CommonTable>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script setup>
+import { ref, reactive, onMounted, onUnmounted } from 'vue';
+import { message } from 'ant-design-vue';
+import CommonTable from './CommonTable.vue';
+import { detailColumns, commonGetApi, commonPostApi } from './utils/config';
+import Common from '../common/Common';
+
+const total = ref(0);
+const table = ref(null);
+const documentNo = ref(undefined); //所选领料单
+const documentNos = ref([]); //领料数据
+const detailData = ref([]); //详表数据
+const isLoading = ref(false); //表格加载
+const isShow = ref(false); //是否可一键拣货
+const mainId = ref(''); //主表id
+let intervalId;
+
+
+onMounted(() => {
+  queryStock();
+});
+onUnmounted(() => {
+  clearInterval(intervalId);
+});
+
+// 根据领料单id开始拣货
+const startPick = () => {
+  if (!documentNo.value) {
+    message.warning('请选择领料单');
+    return;
+  }
+  commonPostApi(`StockOutPrepareLineResource/startPick?stockOutPrepareId=${documentNo.value}`, null, true).then(
+    success => {
+      if (success.errorCode == 0) {
+        if (success.data) {
+          const { id, lightOrderStatusName, stockOutPrepareLineLightDtos } = success.data;
+          mainId.value = id;
+          isShow.value = true;
+          stockOutPrepareLineLightDtos.length > 0 && (detailData.value = stockOutPrepareLineLightDtos) && (total.value = stockOutPrepareLineLightDtos.length);
+          if (lightOrderStatusName == '已完成') {
+            clearData();
+            message.success('此领料单已全部拣货完成', 6);
+          }
+          if (stockOutPrepareLineLightDtos && lightOrderStatusName != '已完成') {
+            updateStatus();
+          }
+        }
+      } else {
+        message.warning(success.errorMessage);
+      }
+    },
+    error => {
+      message.error(error.responseText);
+    },
+  );
+};
+
+// 循环调用查询状态
+const updateStatus = () => {
+  intervalId = setInterval(() => {
+    setTimeout(() => {
+      queryAllStatus();
+    }, 0);
+  }, 3000);
+};
+// 拣货完成后清空所有数据
+const clearData = () => {
+  clearInterval(intervalId);
+  mainId.value = '';
+  isShow.value = false;
+  documentNo.value = '';
+  detailData.value = [];
+  total.value = 0;
+  queryStock();
+};
+
+// 查询领料数据
+const queryStock = () => {
+  commonPostApi('StockOutPrepareResource/queryStockOutPrepareLightDtoByDocumentNo?condition=', null, true).then(
+    success => {
+      if (success.errorCode === 0) {
+        if (success.datas && success.datas.length > 0) {
+          documentNos.value = success.datas;
+        } else {
+          message.warning('暂无领料单数据');
+        }
+      }
+    },
+    error => {
+      Common.processException(error);
+    },
+  );
+};
+// 全部拣货完成
+const completeAll = () => {
+  commonPostApi(`StockOutPrepareLineResource/turnOffLight?stockOutPrepareId=${documentNo.value}`, null, true).then(
+    success => {
+      if (success.errorCode === 0) {
+        clearData();
+        message.success('全部拣货完成', 6);
+      } else {
+        message.warning(success.errorMessage);
+      }
+    },
+    error => {
+      Common.processException(error);
+    },
+  );
+};
+
+// 查询领料单是否拣货完成
+const queryAllStatus = () => {
+  commonPostApi(
+    `StockOutPrepareLineResource/queryStockOutPrepareLineByStockOutPrepareId?stockOutPrepareId=${mainId.value}`,
+    null, true,
+  ).then(
+    success => {
+      if (success.errorCode === 0) {
+        if (success.data) {
+          const { lightOrderStatusName, stockOutPrepareLineLightDtos } = success.data;
+          if (lightOrderStatusName == '已完成') {
+            clearData();
+            message.success('此领料单已全部拣货完成', 6);
+          } else {
+            detailData.value = stockOutPrepareLineLightDtos;
+            total.value = stockOutPrepareLineLightDtos.length;
+          }
+        }
+      }
+    },
+    error => {
+      Common.processException(error);
+    },
+  );
+};
+
+</script>
+
+<style scoped>
+.operationBtn {
+  margin-left: 8px;
+}
+
+.ant-form-item {
+  margin-bottom: 10px !important;
+}
+
+:deep(.ant-form-item .ant-form-item-label >label) {
+  font-size: 14px !important;
+  font-weight: 500 !important;
+}
+</style>

+ 164 - 0
src/light/api/LightResource.js

@@ -0,0 +1,164 @@
+import {  Common } from 'pc-component-v3';
+
+
+/**
+ * 工具类自动生成的API,请勿做任何修改,请勿做任何修改,请勿做任何修改(重要的事情说3遍)
+ * 工具作者: 杨志杰
+ *  
+ */
+export default {
+
+  /**
+	 * 工具类自动生成的方法
+	 * 工具作者: 杨志杰
+	 * 标签灭灯 
+	 */
+  confirm: function(labelParamDto2){
+    var requestUrl = 'LightResource/confirm';
+
+
+    return new Promise((resolve, reject) => {
+      $.ajax({
+        url: Common.getApiURL(requestUrl),
+        type: 'post',
+        contentType: 'application/json',
+				
+				
+        data: JSON.stringify(labelParamDto2),
+				
+        beforeSend: function(request) {
+          Common.addTokenToRequest(request);
+        },
+        success: function(data) {
+          resolve(data);
+        },
+        error: function(XMLHttpRequest, textStatus, errorThrown) {
+          reject(XMLHttpRequest);
+        },
+      });
+    });
+  },
+
+  /**
+	 * 工具类自动生成的方法
+	 * 工具作者: 杨志杰
+	 * 创建默认LightSetting 
+	 */
+  createDefaultLightSetting: function(){
+    var requestUrl = 'LightResource/createDefaultLightSetting';
+
+
+    return new Promise((resolve, reject) => {
+      $.ajax({
+        url: Common.getApiURL(requestUrl),
+        type: 'get',
+        contentType: 'application/json',
+				
+        dataType: 'json',
+				
+				
+        beforeSend: function(request) {
+          Common.addTokenToRequest(request);
+        },
+        success: function(data) {
+          resolve(data);
+        },
+        error: function(XMLHttpRequest, textStatus, errorThrown) {
+          reject(XMLHttpRequest);
+        },
+      });
+    });
+  },
+
+  /**
+	 * 工具类自动生成的方法
+	 * 工具作者: 杨志杰
+	 * 查询标签服务器配置 
+	 */
+  getLightDto: function(){
+    var requestUrl = 'LightResource/getLightDto';
+
+
+    return new Promise((resolve, reject) => {
+      $.ajax({
+        url: Common.getApiURL(requestUrl),
+        type: 'get',
+				
+        dataType: 'json',
+				
+				
+        beforeSend: function(request) {
+          Common.addTokenToRequest(request);
+        },
+        success: function(data) {
+          resolve(data);
+        },
+        error: function(XMLHttpRequest, textStatus, errorThrown) {
+          reject(XMLHttpRequest);
+        },
+      });
+    });
+  },
+
+  /**
+	 * 工具类自动生成的方法
+	 * 工具作者: 杨志杰
+	 * 入库完成按标签确认键反馈接(无屏幕) 
+	 */
+  pickButton: function(labelParamDto2){
+    var requestUrl = 'LightResource/pickButton';
+
+
+    return new Promise((resolve, reject) => {
+      $.ajax({
+        url: Common.getApiURL(requestUrl),
+        type: 'post',
+        contentType: 'application/json',
+				
+				
+        data: JSON.stringify(labelParamDto2),
+				
+        beforeSend: function(request) {
+          Common.addTokenToRequest(request);
+        },
+        success: function(data) {
+          resolve(data);
+        },
+        error: function(XMLHttpRequest, textStatus, errorThrown) {
+          reject(XMLHttpRequest);
+        },
+      });
+    });
+  },
+
+  /**
+	 * 工具类自动生成的方法
+	 * 工具作者: 杨志杰
+	 * 保存lightDto1 
+	 */
+  saveOrUpdateLightSetting: function(lightDto1){
+    var requestUrl = 'LightResource/saveOrUpdateLightSetting';
+
+
+    return new Promise((resolve, reject) => {
+      $.ajax({
+        url: Common.getApiURL(requestUrl),
+        type: 'post',
+        contentType: 'application/json',
+				
+        dataType: 'json',
+        data: JSON.stringify(lightDto1),
+				
+        beforeSend: function(request) {
+          Common.addTokenToRequest(request);
+        },
+        success: function(data) {
+          resolve(data);
+        },
+        error: function(XMLHttpRequest, textStatus, errorThrown) {
+          reject(XMLHttpRequest);
+        },
+      });
+    });
+  },
+};

+ 78 - 0
src/light/utils/config.js

@@ -0,0 +1,78 @@
+import Common from '../../common/Common.js';
+
+export const detailColumns = [
+  {
+    title: '物料编码',
+    dataIndex: 'inventoryNo',
+    key: 'inventoryNo',
+  },
+  {
+    title: '物料名称',
+    dataIndex: 'inventoryName',
+    key: 'inventoryName',
+  },
+  {
+    title: '货位编码',
+    dataIndex: 'positionNo',
+    key: 'positionNo',
+  },
+  {
+    title: '货位名称',
+    dataIndex: 'positionName',
+    key: 'positionName',
+  },
+  {
+    title: '领料数量',
+    dataIndex: 'quantity',
+    key: 'quantity',
+  },
+  {
+    title: '拣货状态',
+    dataIndex: 'lightOrderStatusName',
+    key: 'lightOrderStatusName',
+  },
+].map(item => ({ ...item, align: 'center' }));
+
+export const commonGetApi = (requestUrl,params) => {
+  return new Promise((resolve, reject) => {
+    $.ajax({
+      url: Common.getApiURL(requestUrl),
+      type: 'get',
+      dataType: 'json',
+      data: params,
+      beforeSend: function (request) {
+        Common.addTokenToRequest(request);
+      },
+      success: function (data) {
+        resolve(data);
+      },
+      error: function (XMLHttpRequest) {
+        reject(XMLHttpRequest);
+      },
+    });
+  });
+};
+
+
+export const commonPostApi = (url, datas,isQuery) => {
+  return new Promise((resolve, reject) => {
+    $.ajax({
+      url: Common.getApiURL(url),
+      type: 'post',
+      contentType: 'application/json',
+
+
+      data: !isQuery ? JSON.stringify(datas) : null,
+
+      beforeSend: function (request) {
+        Common.addTokenToRequest(request);
+      },
+      success: function (data) {
+        resolve(data);
+      },
+      error: function (XMLHttpRequest, textStatus, errorThrown) {
+        reject(XMLHttpRequest);
+      },
+    });
+  });
+};

+ 34 - 32
src/print/PackInventoryInstance.vue

@@ -239,38 +239,40 @@
         </div>
         <div class="panel-body">
           <table class="table">
-            <tr class="form-inline">
-              <td>
-                <label>包装数量:</label>
-                <input
-                  v-model="saveMoreQuantity"
-                  autocomplete="off"
-                  type="text"
-                  name="saveMoreQuantity"
-                  class="form-control"
-                />
-              </td>
-              <td>
-                <label>包装内物料数量:</label>
-                <input
-                  v-model="packageQuantity"
-                  autocomplete="off"
-                  type="text"
-                  name="packageQuantity"
-                  class="form-control"
-                />
-              </td>
-              <td>
-                <label>批次号:</label>
-                <input
-                  v-model="batchNo"
-                  autocomplete="off"
-                  type="text"
-                  name="batchNo"
-                  class="form-control"
-                />
-              </td>
-            </tr>
+            <tbody>
+              <tr class="form-inline">
+                <td>
+                  <label>包装数量:</label>
+                  <input
+                    v-model="saveMoreQuantity"
+                    autocomplete="off"
+                    type="text"
+                    name="saveMoreQuantity"
+                    class="form-control"
+                  />
+                </td>
+                <td>
+                  <label>包装内物料数量:</label>
+                  <input
+                    v-model="packageQuantity"
+                    autocomplete="off"
+                    type="text"
+                    name="packageQuantity"
+                    class="form-control"
+                  />
+                </td>
+                <td>
+                  <label>批次号:</label>
+                  <input
+                    v-model="batchNo"
+                    autocomplete="off"
+                    type="text"
+                    name="batchNo"
+                    class="form-control"
+                  />
+                </td>
+              </tr>
+            </tbody>
           </table>
           <div class="text-center">
             <div>

+ 54 - 23
src/router/index.js

@@ -45,13 +45,16 @@ const CurrentStockProjectItemManger = () => import(/* webpackChunkName: "compone
 const UploadTrainingVideo = () => import(/* webpackChunkName: "component-62" */ '../pad/UploadTrainingVideo.vue');
 const SynchronousMaintenanceForm = () => import(/* webpackChunkName: "component-62" */ '../pad/SynchronousMaintenanceForm.vue');
 const QueryMaintenancePlan = () => import(/* webpackChunkName: "component-62" */ '../pad/QueryMaintenancePlan.vue');
+const LightSetting = () => import('../light/LightSetting.vue');
+const LightStockInOrOut = () => import('../light/LightStockInOrOut.vue');
 
 const routes = [
 
   { path: '/wms/hello-world', component: HelloWorld },
 
   // 仓库设置
-  { path: '/wms/wmsSetting', component: WmsSetting,
+  {
+    path: '/wms/wmsSetting', component: WmsSetting,
     meta: {
       'loginRequired': true,
       'functionAccessArray': [
@@ -64,7 +67,8 @@ const routes = [
   },
 
   // 编码定义
-  { path: '/wms/gradeDefinition', component: GradeDefinition,
+  {
+    path: '/wms/gradeDefinition', component: GradeDefinition,
     meta: {
       'loginRequired': true,
       'functionAccessArray': [
@@ -80,7 +84,8 @@ const routes = [
   { path: '/wms/generatePosition/:uuid', component: GeneratePosition },
 
   // 采购入库打印
-  { path: '/wms/inventoryPrint', component: InventoryPrint,
+  {
+    path: '/wms/inventoryPrint', component: InventoryPrint,
     meta: {
       'loginRequired': true,
       'functionAccessArray': [
@@ -93,7 +98,8 @@ const routes = [
   },
 
   // 扫描入库打印
-  { path: '/wms/inventoryPrintScan', component: InventoryPrintScan,
+  {
+    path: '/wms/inventoryPrintScan', component: InventoryPrintScan,
     meta: {
       'loginRequired': true,
       'functionAccessArray': [
@@ -106,7 +112,8 @@ const routes = [
   },
 
   // 领用界面
-  { path: '/wms/stockOutPrepareLine', component: StockOutPrepareLine,
+  {
+    path: '/wms/stockOutPrepareLine', component: StockOutPrepareLine,
     meta: {
       'loginRequired': true,
       'functionAccessArray': [
@@ -119,7 +126,8 @@ const routes = [
   },
 
   // 领料车界面
-  { path: '/wms/pickingCar', component: PickingCar,
+  {
+    path: '/wms/pickingCar', component: PickingCar,
     meta: {
       'loginRequired': true,
       'functionAccessArray': [
@@ -132,7 +140,8 @@ const routes = [
   },
 
   // 领用记录,审批意见完成
-  { path: '/wms/stockOutPrepareApproved', component: StockOutPrepareApproved,
+  {
+    path: '/wms/stockOutPrepareApproved', component: StockOutPrepareApproved,
     meta: {
       'loginRequired': true,
       'functionAccessArray': [
@@ -145,7 +154,8 @@ const routes = [
   },
 
   // 需求模板领料
-  { path: '/wms/stockOutPrepateTemplate', component: StockOutPrepateTemplate,
+  {
+    path: '/wms/stockOutPrepateTemplate', component: StockOutPrepateTemplate,
     meta: {
       'loginRequired': true,
       'functionAccessArray': [
@@ -158,7 +168,8 @@ const routes = [
   },
 
   // 需求模板领料待提交记录
-  { path: '/wms/stockOutPrepateTemplateRecording', component: StockOutPrepateTemplateRecording,
+  {
+    path: '/wms/stockOutPrepateTemplateRecording', component: StockOutPrepateTemplateRecording,
     meta: {
       'loginRequired': true,
       'functionAccessArray': [
@@ -171,7 +182,8 @@ const routes = [
   },
 
   // 需求模板领料已提交记录
-  { path: '/wms/stockOutPrepareTemplateApproved', component: StockOutPrepareTemplateApproved,
+  {
+    path: '/wms/stockOutPrepareTemplateApproved', component: StockOutPrepareTemplateApproved,
     meta: {
       'loginRequired': true,
       'functionAccessArray': [
@@ -184,7 +196,8 @@ const routes = [
   },
 
   // 领料跳转添加项目
-  { path: '/wms/stockOutPrepareLineAddProject', component: StockOutPrepareLineAddProject,
+  {
+    path: '/wms/stockOutPrepareLineAddProject', component: StockOutPrepareLineAddProject,
     meta: {
       'loginRequired': true,
       'functionAccessArray': [
@@ -198,7 +211,8 @@ const routes = [
 
   // 项目事件收货信息
   // eslint-disable-next-line
-  { path: '/wms/stockOutPrepareLineProjectReceivingAddress', component: StockOutPrepareLineProjectReceivingAddress,
+  {
+    path: '/wms/stockOutPrepareLineProjectReceivingAddress', component: StockOutPrepareLineProjectReceivingAddress,
     meta: {
       'loginRequired': true,
       'functionAccessArray': [
@@ -212,7 +226,8 @@ const routes = [
 
   // 项目事件发货信息
   // eslint-disable-next-line
-  { path: '/wms/stockOutPrepareLineProjectShippingAddress', component: StockOutPrepareLineProjectShippingAddress,
+  {
+    path: '/wms/stockOutPrepareLineProjectShippingAddress', component: StockOutPrepareLineProjectShippingAddress,
     meta: {
       'loginRequired': true,
       'functionAccessArray': [
@@ -259,7 +274,8 @@ const routes = [
   },
 
   // 盘点单盘盈数据处理
-  { path: '/wms/checkProfit/:uuid', component: CheckProfit,
+  {
+    path: '/wms/checkProfit/:uuid', component: CheckProfit,
     meta: {
       'loginRequired': true,
       'functionAccessArray': [
@@ -272,7 +288,8 @@ const routes = [
   },
 
   // 盘点单盘亏数据处理
-  { path: '/wms/checkLoss/:uuid', component: CheckLoss,
+  {
+    path: '/wms/checkLoss/:uuid', component: CheckLoss,
     meta: {
       'loginRequired': true,
       'functionAccessArray': [
@@ -293,7 +310,8 @@ const routes = [
   { path: '/wms/purchaseOrderLine-trace-edit', component: PurchaseOrderLineTraceEdit },
 
   // 西门字库存查询
-  { path: '/wms/currentStock', component: CurrentStock,
+  {
+    path: '/wms/currentStock', component: CurrentStock,
     meta: {
       'loginRequired': true,
       'functionAccessArray': [
@@ -306,7 +324,8 @@ const routes = [
   },
 
   // 仓库库存台账
-  { path: '/wms/stockLedger', component: StockLedger,
+  {
+    path: '/wms/stockLedger', component: StockLedger,
     meta: {
       'loginRequired': true,
       'functionAccessArray': [
@@ -334,7 +353,8 @@ const routes = [
   { path: '/wms/projectItemAdjust', component: ProjectItemAdjust },
 
   // 发货单
-  { path: '/wms/invoiceGenerate', component: InvoiceGenerate,
+  {
+    path: '/wms/invoiceGenerate', component: InvoiceGenerate,
     meta: {
       'loginRequired': true,
       'functionAccessArray': [
@@ -347,7 +367,8 @@ const routes = [
   },
 
   // 结存
-  { path: '/wms/balanceInventory', component: BalanceInventory,
+  {
+    path: '/wms/balanceInventory', component: BalanceInventory,
     meta: {
       'loginRequired': true,
       'functionAccessArray': [
@@ -360,7 +381,8 @@ const routes = [
   },
 
   // 生成明细
-  { path: '/wms/vouchCheck/:uuid', component: VouchCheck,
+  {
+    path: '/wms/vouchCheck/:uuid', component: VouchCheck,
     meta: {
       'loginRequired': true,
       'functionAccessArray': [
@@ -376,7 +398,8 @@ const routes = [
   { path: '/wms/expressInquiry/:uuid', component: ExpressInquiry },
 
   // 生成明细
-  { path: '/wms/repertoryCheck/:uuid', component: RepertoryCheck,
+  {
+    path: '/wms/repertoryCheck/:uuid', component: RepertoryCheck,
     meta: {
       'loginRequired': true,
       'functionAccessArray': [
@@ -398,7 +421,8 @@ const routes = [
 
   { path: '/wms/asset-inventory-check-lose/:uuid', component: InventoryCheckLoss },
 
-  { path: '/wms/adjustPositions', component: AdjustPositions,
+  {
+    path: '/wms/adjustPositions', component: AdjustPositions,
     meta: {
       'loginRequired': true,
       'functionAccessArray': [
@@ -412,7 +436,8 @@ const routes = [
 
 
   // 我管理项目的库存查询
-  { path: '/wms/currentStockProjectItemManger', component: CurrentStockProjectItemManger,
+  {
+    path: '/wms/currentStockProjectItemManger', component: CurrentStockProjectItemManger,
     meta: {
       'loginRequired': true,
       'functionAccessArray': [
@@ -427,6 +452,12 @@ const routes = [
   { path: '/wms/uploadTrainingVideo', component: UploadTrainingVideo },
   { path: '/wms/synchronousMaintenanceForm', component: SynchronousMaintenanceForm },
   { path: '/wms/queryMaintenancePlan', component: QueryMaintenancePlan },
+
+  //扫码亮灯出入库
+  { path: '/wms/lightStockInOrOut', component: LightStockInOrOut },
+
+  //标签服务器配置
+  { path: '/wms/lightSetting', component: LightSetting },
 ];
 
 

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.