Parcourir la source

1.0.0-yd.1 增加调度任务,优化仓库页面

liuyanpeng il y a 11 mois
Parent
commit
9ba1c205c4

+ 2 - 2
package.json

@@ -1,7 +1,7 @@
 {
   "name": "client-wms-v5",
   "description": "Leanwo Prodog Client",
-  "version": "1.0.0",
+  "version": "1.0.0-yd.1",
   "author": "yangzhijie1488 <yangzhijie1488@163.com>",
   "scripts": {
     "dev": "cross-env webpack serve --config ./webpack.dev.js",
@@ -14,7 +14,7 @@
   ],
   "peerDependencies": {
     "ant-design-vue": "^4.2.1",
-    "pc-component-v3": "2.0.0",
+    "pc-component-v3": "2.0.1",
     "v-tooltip": "^4.0.0-beta.17",
     "vue-select": "^4.0.0-beta.6"
   },

+ 38 - 0
src/common/transferTask.js

@@ -0,0 +1,38 @@
+// 列名
+export const taskColumns = [
+  { title: '序号', dataIndex: 'index', width: 80 },
+  { title: '任务类型', dataIndex: 'workCategory', width: 150 },
+  { title: '创建时间', dataIndex: 'created', width: 150 },
+  { title: '执行时间', dataIndex: 'excuteDate', width: 150 },
+  { title: '起始货位编号', dataIndex: 'positionBeginNo', width: 150 },
+  { title: '终点货位编号', dataIndex: 'positionEndNo', width: 150 },
+  { title: 'AGV编号', dataIndex: 'agvNo', width: 150 },
+  // { title: '执行状态', dataIndex: 'executeStatus', width: 150 },
+  { title: '执行成功', dataIndex: 'success', width: 150 },
+  { title: '成功时间', dataIndex: 'successDate', width: 150 },
+  { title: '失败时间', dataIndex: 'errorDate', width: 150 },
+  { title: '失败原因', dataIndex: 'errorMessage', width: 150 },
+  { title: '上次执行时间', dataIndex: 'lastExcuteDate', width: 150 },
+  { title: '执行次数', dataIndex: 'countExcute', width: 150 },
+  { title: '操作', dataIndex: 'operation', width: 80, fixed: 'right' },
+].map(item => ({ ...item, align: 'center', ellipsis: true, resizable: true }));
+// 任务类型
+export const workOptions = [
+  { label: '入库', value: 'STOCKIN' },
+  { label: '出库', value: 'STOCKOUT' },
+  { label: '调拨', value: 'ADJUST' },
+  { label: '出库返回', value: 'STOCKOUTRETURN' },
+  { label: '全部', value: '' },
+];
+// 执行状态
+export const executeOptions = [
+  { label: '执行中', value: 'Executing' },
+  { label: '已完成', value: 'Completed' },
+  { label: '未开始', value: 'NotStarted' },
+  { label: '全部', value: '' },
+];
+// 成功状态
+export const successOptions = [
+  { label: '是', value: true },
+  { label: '否', value: false },
+];

+ 42 - 71
src/components/GeneratePosition.vue

@@ -1,75 +1,46 @@
 <template>
-  <a-layout>
-    <Navbar title="批量创建货位" :is-go-back="false" />
-    
-    <a-layout-content class="content">
-      <a-space direction="vertical" style="width: 100%">
-        <!-- 搜索区域 -->
-        <a-space>
-          <a-select
-            v-model:value="warehouse"
-            label-in-value
-            style="width: 200px"
-            :options="warehouses"
-            allow-clear
-            :field-names="{ label: 'name', value: 'id' }"
-          />
-          <a-button type="primary" @click="add">添加货位</a-button>
-          <a-button type="primary" @click="save">保存</a-button>
-        </a-space>
-
-        <!-- 数据表格 -->
-        <a-table
-          :columns="columns"
-          :data-source="positionDtos"
-          bordered
-        >
-          <!-- 序号列 -->
-          <template #bodyCell="{ column, record, index }">
-            <template v-if="column.dataIndex === 'index'">
-              {{ index + 1 }}
-            </template>
-            <template v-if="column.dataIndex === 'positionName'">
-              <a-input v-model:value="record.positionName" />
-            </template>
-            <template v-if="column.dataIndex === 'positionNo'">
-              <a-input v-model:value="record.positionNo" />
-            </template>
-            <template v-if="column.dataIndex === 'description'">
-              <a-input v-model:value="record.description" />
-            </template>
-            <template v-if="column.dataIndex === 'action'">
-              <a-button type="danger" @click="deleteOne(index)">删除</a-button>
-            </template>
-          </template>
-        </a-table>
-
-        <!-- 清空按钮 -->
-        <a-button type="danger" @click="clear">清空</a-button>
-      </a-space>
-    </a-layout-content>
-
-    <Loading v-if="loading" />
-  </a-layout>
+  <Navbar title="批量创建货位" :is-go-back="false" />
+  <!-- 搜索区域 -->
+  <a-space style="margin-top: 8px;">
+    <a-select
+      v-model:value="warehouse" label-in-value style="width: 200px" :options="warehouses" allow-clear
+      :field-names="{ label: 'name', value: 'id' }"
+    />
+    <a-button type="primary" @click="add">添加货位</a-button>
+    <a-button type="primary" @click="save">保存</a-button>
+    <a-button danger @click="clear">清空</a-button>
+  </a-space>
+
+  <!-- 数据表格 -->
+  <a-table :columns="columns" :data-source="positionDtos" bordered :scroll="{ y: '60vh' }">
+    <!-- 序号列 -->
+    <template #bodyCell="{ column, record, index }">
+      <template v-if="column.dataIndex === 'index'">
+        {{ index + 1 }}
+      </template>
+      <template v-if="column.dataIndex === 'positionName'">
+        <a-input v-model:value="record.positionName" />
+      </template>
+      <template v-if="column.dataIndex === 'positionNo'">
+        <a-input v-model:value="record.positionNo" />
+      </template>
+      <template v-if="column.dataIndex === 'description'">
+        <a-input v-model:value="record.description" />
+      </template>
+      <template v-if="column.dataIndex === 'action'">
+        <a-button danger @click="deleteOne(index)">删除</a-button>
+      </template>
+    </template>
+  </a-table>
+
+  <Loading v-if="loading" />
 </template>
 
 <script>
 
 import Common from '../common/Common.js';
 
-import { Layout, PageHeader, Select, Button, Table, Input } from 'ant-design-vue';
-
-
 export default {
-  components: {
-    'a-layout': Layout,
-    'a-layout-content': Layout.Content,
-    'a-page-header': PageHeader,
-    'a-select': Select,
-    'a-button': Button,
-    'a-table': Table,
-    'a-input': Input,
-  },
   data: function () {
     return {
       warehouses: [],
@@ -97,7 +68,7 @@ export default {
           title: '操作',
           dataIndex: 'action',
         },
-      ],
+      ].map(item => ({ ...item, align: 'center', ellipsis: true })),
 
     };
   },
@@ -125,7 +96,7 @@ export default {
           return;
         }
       }
-      _self.loading=true;
+      _self.loading = true;
       $.ajax({
         type: 'post',
         dataType: 'json',
@@ -136,12 +107,12 @@ export default {
           Common.addTokenToRequest(request);
         },
         success: function (data) {
-          _self.loading=false;
+          _self.loading = false;
           _self.clear();
           Notify.success('提示', '保存成功!', 1500);
         },
         error: function (XMLHttpRequest, textStatus, errorThrown) {
-          _self.loading=false;
+          _self.loading = false;
           Common.processException(XMLHttpRequest, textStatus, errorThrown);
         },
       });
@@ -169,7 +140,7 @@ export default {
 
     queryAllWarehouses: function () {
       var _self = this;
-      _self.loading=true;
+      _self.loading = true;
       $.ajax({
         type: 'get',
         url: Common.getApiURL('WarehouseResource/queryPositionManagerWarehouse'),
@@ -178,10 +149,10 @@ export default {
         },
         success: function (data) {
           _self.warehouses = data;
-          _self.loading=false;
+          _self.loading = false;
         },
         error: function (XMLHttpRequest, textStatus, errorThrown) {
-          _self.loading=false;
+          _self.loading = false;
           Common.processException(XMLHttpRequest, textStatus, errorThrown);
         },
       });

+ 8 - 8
src/customer/RepertoryCheck.vue

@@ -48,7 +48,7 @@
               </div>
 
               <div v-show="!panelVisible">
-                <a-input v-model:value="positionCondition" placeholder="输入货位条形码(回车查询)" @keyup.enter="searchPosition" />
+                <a-input v-model:value="positionCondition" placeholder="输入名称或编码(回车查询)" @keyup.enter="searchPosition" />
                 <CommonTable
                   ref="tableRef2" :columns="positionColumns" :data-source="showPositions" :is-select="true"
                   :extra-height="440" @get-pager="getPositionPagerParams" @get-selected="getPositionSelected"
@@ -121,8 +121,8 @@ export default {
     positionColumns() {
       return [
         {
-          title: '货位条形码',
-          dataIndex: 'positionBarCode',
+          title: '货位名称',
+          dataIndex: 'positionName',
           width: 80,
         },
       ];
@@ -130,15 +130,15 @@ export default {
     currentStockColumns() {
       return [
         { title: '序号', dataIndex: 'index', width: 50 },
-        { title: '存货编码', dataIndex: 'inventoryNo', width: 100 },
-        { title: '存货名称', dataIndex: 'inventoryName', width: 140 },
+        { title: '物料编码', dataIndex: 'inventoryNo', width: 100 },
+        { title: '物料名称', dataIndex: 'inventoryName', width: 140 },
         { title: '规格型号', dataIndex: 'inventoryType', width: 140 },
         { title: '数量', dataIndex: 'quantity', width: 140 },
-        { title: '存货分类', dataIndex: 'inventoryCategoryName', width: 140 },
+        { title: '物料分类', dataIndex: 'inventoryCategoryName', width: 140 },
         { title: '货位名称', dataIndex: 'positionName', width: 100 },
         { title: '货位编号', dataIndex: 'positionNo', width: 100 },
         { title: '货位条形码', dataIndex: 'positionBarCode', width: 100 },
-      ];
+      ].map(item => ({ ...item, align: 'center', ellipsis: true, resizable: true }));
     },
   },
   watch: {
@@ -391,7 +391,7 @@ export default {
           };
           $.ajax({
             url: Common.getApiURL(
-              'checkVouchsResource/generateCheckVouchsForSiemensProject',
+              'checkVouchsResource/generateCheckVouchsForYiDong',
             ),
             type: 'post',
             dataType: 'json',

+ 227 - 0
src/customer/TransferTask.vue

@@ -0,0 +1,227 @@
+<template>
+  <Navbar title="调度任务" :is-go-back="false" />
+  <div>
+    <a-form :colon="false" :label-col="labelStyle">
+      <a-row :gutter="[8, 14]" justify="space-start">
+        <a-form-item label="任务类型" class="horizontal-form-item">
+          <a-select
+            v-model:value="formData.workCategory" class="w-full" :options="workTypes" allow-clear
+            placeholder="请选择任务类型" @change="searchDatas"
+          />
+        </a-form-item>
+        <a-form-item label="起始货位编号" class="horizontal-form-item">
+          <a-input
+            v-model:value="formData.positionBeginNo" class="w-full" placeholder="请输入起始货位编号"
+            @press-enter="searchDatas"
+          />
+        </a-form-item>
+        <a-form-item label="终点货位编号" class="horizontal-form-item">
+          <a-input
+            v-model:value="formData.positionEndNo" class="w-full" placeholder="请输入起始货位编号"
+            @press-enter="searchDatas"
+          />
+        </a-form-item>
+        <a-form-item label="执行状态" class="horizontal-form-item">
+          <a-select
+            v-model:value="formData.executeStatus" class="w-full" :options="executeStatus" allow-clear
+            placeholder="请选择执行状态" @change="searchDatas"
+          />
+        </a-form-item>
+        <a-form-item label="AGV编号" class="horizontal-form-item">
+          <a-input
+            v-model:value="formData.agvNo" class="w-full" placeholder="请输入AGV编号"
+            @press-enter="searchDatas"
+          />
+        </a-form-item>
+        <a-form-item label="是否成功" class="horizontal-form-item">
+          <a-select
+            v-model:value="formData.success" class="w-full" :options="successTypes" allow-clear
+            placeholder="请选择是否成功" @change="searchDatas"
+          />
+        </a-form-item>
+        <a-form-item label="" class="horizontal-form-item">
+          <a-space>
+            <a-button danger @click="clearFilter">清空</a-button>
+            <a-button type="primary" @click="searchDatas">查询</a-button>
+          </a-space>
+        </a-form-item>
+      </a-row>
+    </a-form>
+
+    <CommonTable
+      ref="commonTableRef" :columns="columns" :data-source="taskList" :total="totalSize"
+      :is-select="false" @get-pager="getPageParams"
+    >
+      <template #bodyCell="{ column, record, index }">
+        <template v-if="column.dataIndex === 'index'">
+          {{ index + 1 }}
+        </template>
+        <template v-if="column.dataIndex === 'operation'">
+          <a-tag v-if="record.executeStatus === '已完成'" color="green">已完成</a-tag>
+          <a-tag v-if="record.executeStatus === '执行中'" color="error">执行中</a-tag>
+          <a-button v-else type="link" @click="executeTask(record)">执行</a-button>
+        </template>
+      </template>
+    </CommonTable>
+  </div>
+  <Loading v-if="loading" />
+</template>
+
+<script setup>
+import { ref, onMounted } from 'vue';
+import Common from '../common/Common';
+import { message } from 'ant-design-vue';
+import CommonTable from '../common/CommonTable.vue';
+import { taskColumns, workOptions, executeOptions, successOptions } from '../common/transferTask';
+
+const loading = ref(false);
+const commonTableRef = ref(null);
+
+const labelStyle = { style: { width: '90px' } };
+
+const columns = ref(taskColumns);
+const taskList = ref([]);
+
+const formData = ref({
+  workCategory: null,
+  positionBeginNo: null,
+  positionEndNo: null,
+  executeStatus: null,
+  agvNo: null,
+  success: null,
+});
+
+const totalSize = ref(0);
+const pagination = ref({
+  start: 1,
+  length: 20,
+});
+
+const workTypes = ref(workOptions);
+const successTypes = ref(successOptions);
+const executeStatus = ref(executeOptions);
+
+// 获取分页参数后查询
+const getPageParams = (page, pageSize) => {
+  pagination.value.start = page;
+  pagination.value.length = pageSize;
+  getTableDatas();
+};
+
+// 执行任务
+const executeTask = record => {
+  executeTaskById(record.schedulingTasksId);
+};
+
+// 条件变化查询
+const searchDatas = () => {
+  commonTableRef.value.backFirstPage();
+};
+
+// 清空条件
+const clearFilter = () => {
+  formData.value = {
+    workCategory: null,
+    positionBeginNo: null,
+    positionEndNo: null,
+    executeStatus: null,
+    agvNo: null,
+    success: null,
+  };
+  searchDatas();
+};
+
+onMounted(() => {
+  getTableDatas();
+});
+
+// 查询调度任务
+const getTableDatas = () => {
+  const start = (pagination.value.start - 1) * pagination.value.length;
+  const params = {
+    ...formData.value,
+    ...pagination.value,
+    start,
+  };
+  loading.value = true;
+  $.ajax({
+    url: Common.getApiURL('SchedulingTasksResource/querySchedulingTasks'),
+    type: 'post',
+    contentType: 'application/json',
+
+    dataType: 'json',
+    data: JSON.stringify(params),
+    beforeSend: function (request) {
+      Common.addTokenToRequest(request);
+    },
+    success: function ({ errorCode, errorMessage, datas, total }) {
+      if (errorCode === 0) {
+        if (datas && datas.length > 0) {
+          taskList.value = datas;
+          totalSize.value = total;
+        } else {
+          taskList.value = [];
+          totalSize.value = 0;
+        }
+      } else {
+        taskList.value = [];
+        totalSize.value = 0;
+        message.warning(errorMessage);
+      }
+      loading.value = false;
+    },
+    error: function (XMLHttpRequest, textStatus, errorThrown) {
+      Common.processException(XMLHttpRequest, textStatus, errorThrown);
+      loading.value = false;
+    },
+  });
+};
+
+// 执行任务Api
+const executeTaskById = id => {
+  loading.value = true;
+  $.ajax({
+    type: 'get',
+    url: Common.getApiURL(`SchedulingTasksResource/executeTaskById?schedulingTasksId=${id}`),
+    beforeSend(request) {
+      Common.addTokenToRequest(request);
+    },
+    success: function ({ errorCode, errorMessage }) {
+      if (errorCode === 0) {
+        searchDatas();
+        message.success('执行成功!');
+      } else {
+        message.warning(errorMessage);
+      }
+      loading.value = false;
+    },
+    error: function (XMLHttpRequest, textStatus, errorThrown) {
+      loading.value = false;
+      Common.processException(XMLHttpRequest, textStatus, errorThrown);
+    },
+  });
+
+};
+</script>
+
+<style scoped>
+.horizontal-form-item {
+    display: flex;
+    align-items: center;
+    gap: 8px;
+}
+
+.w-full {
+    width: 230px;
+}
+
+:deep(.ant-form-item-label > label) {
+    font-size: 14px !important;
+    font-weight: 600 !important;
+}
+
+:deep(.ant-form-item) {
+    margin-bottom: 0px !important;
+    margin-right: 16px !important;
+}
+</style>

+ 2 - 0
src/index.js

@@ -50,6 +50,7 @@ import QueryMaintenancePlan from './pad/QueryMaintenancePlan.vue';
 import LightSetting from './light/LightSetting.vue';
 import LightStockInOrOut from './light/LightStockInOrOut.vue';
 import ShelfBoard from './shelf/ShelfBoard.vue';
+import TransferTask from './customer/TransferTask.vue';
 
 export {
   HelloWorld,
@@ -102,4 +103,5 @@ export {
   LightSetting,
   LightStockInOrOut,
   ShelfBoard,
+  TransferTask,
 };

+ 6 - 7
src/inout/CheckLoss.vue

@@ -42,14 +42,14 @@ export default {
         { title: '序号', dataIndex: 'index' },
         { title: '入库单号', dataIndex: 'stockInDocumentNo' },
         { title: '批号', dataIndex: 'batchNo' },
-        { title: '存货名称', dataIndex: 'invName' },
+        { title: '物料名称', dataIndex: 'invName' },
+        { title: '物料编号', dataIndex: 'invCode' },
         { title: '规格型号', dataIndex: 'invType' },
-        { title: '存货编号', dataIndex: 'invCode' },
         { title: '货位名称', dataIndex: 'positionName' },
         { title: '货位条码', dataIndex: 'positionBarCode' },
-        { title: '账面数量', dataIndex: 'accountQuantity' },
-        { title: '盘点数量', dataIndex: 'checkQuantity' },
-      ],
+        { title: '账面数量', dataIndex: 'accountQuantity', width: 80 },
+        { title: '盘点数量', dataIndex: 'checkQuantity', width: 80 },
+      ].map(item => ({ ...item, align: 'center', ellipsis: true, resizable: true })),
     };
   },
   mounted() {
@@ -77,14 +77,13 @@ export default {
       $.ajax({
         type: 'get',
         dataType: 'json',
-        url: Common.getApiURL('checkVouchsResource/getCheckLossDatas?checkVouchId=' + _self.checkVouchId),
+        url: Common.getApiURL('checkVouchsResource/getCheckLossDatasYiDong?checkVouchId=' + _self.checkVouchId),
         contentType: 'application/json',
         beforeSend: function (request) {
           Common.addTokenToRequest(request);
         },
         success: function (success) {
           if (success.errorCode == 0) {
-            console.log(success);
             if (success.datas && success.datas.length > 0) {
               _self.checkVouchsDatas = success.datas;
             }

+ 7 - 7
src/inout/CheckProfit.vue

@@ -42,14 +42,14 @@ export default {
         { title: '序号', dataIndex: 'index' },
         { title: '入库单号', dataIndex: 'stockInDocumentNo' },
         { title: '批号', dataIndex: 'batchNo' },
-        { title: '存货名称', dataIndex: 'invName' },
+        { title: '物料名称', dataIndex: 'invName' },
+        { title: '物料编号', dataIndex: 'invCode' },
         { title: '规格型号', dataIndex: 'invType' },
-        { title: '存货编号', dataIndex: 'invCode' },
         { title: '货位名称', dataIndex: 'positionName' },
         { title: '货位条码', dataIndex: 'positionBarCode' },
-        { title: '账面数量', dataIndex: 'accountQuantity' },
-        { title: '盘点数量', dataIndex: 'checkQuantity' },
-      ],
+        { title: '账面数量', dataIndex: 'accountQuantity',width:80 },
+        { title: '盘点数量', dataIndex: 'checkQuantity',width:80 },
+      ].map(item => ({ ...item, align: 'center', ellipsis: true,resizable: true  })),
     };
   },
   mounted() {
@@ -77,7 +77,7 @@ export default {
       $.ajax({
         type: 'get',
         dataType: 'json',
-        url: Common.getApiURL('checkVouchsResource/getCheckProfitDatas?checkVouchId=' + _self.checkVouchId),
+        url: Common.getApiURL('checkVouchsResource/getCheckProfitDatasYiDong?checkVouchId=' + _self.checkVouchId),
         contentType: 'application/json',
         beforeSend: function (request) {
           Common.addTokenToRequest(request);
@@ -122,7 +122,7 @@ export default {
       $.ajax({
         type: 'get',
         dataType: 'json',
-        url: Common.getApiURL('checkVouchsResource/processCheckProfitDatas?checkVouchId=' + _self.checkVouchId),
+        url: Common.getApiURL('stockInResource/generateProfitStockIn?checkVouchId=' + _self.checkVouchId),
         contentType: 'application/json',
         beforeSend: function (request) {
           Common.addTokenToRequest(request);

+ 4 - 0
src/router/index.js

@@ -50,6 +50,8 @@ const LightSetting = () => import('../light/LightSetting.vue');
 const LightStockInOrOut = () => import('../light/LightStockInOrOut.vue');
 const ShelfBoard = () => import('../shelf/ShelfBoard.vue');
 
+const TransferTask = () => import('../customer/TransferTask.vue');
+
 const routes = [
 
   { path: '/wms/hello-world', component: HelloWorld },
@@ -475,6 +477,8 @@ const routes = [
   { path: '/wms/lightSetting', component: LightSetting },
   //货架信息看板
   { path: '/wms/shelfBoard', component: ShelfBoard },
+  // 调拨任务
+  { path: '/wms/transferTask', component: TransferTask },
 ];