Просмотр исходного кода

3.0.60 执行盘点增加盘亏数据生成盘点单 资产设置增加【初始化资产监控PostgreSQL时序数据库】

liuyanpeng 2 лет назад
Родитель
Сommit
42a9a11cd6

+ 1 - 1
package.json

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

+ 70 - 34
src/components/AssetBasicSetting.vue

@@ -195,7 +195,10 @@
             class="form-control"
             :disabled="isdisable"
           >
-            <option v-for="depreciationMethodDto in depreciationMethodDtos" :key="depreciationMethodDto.id">
+            <option
+              v-for="depreciationMethodDto in depreciationMethodDtos"
+              :key="depreciationMethodDto.id"
+            >
               {{ depreciationMethodDto.text }}
             </option>
           </select>
@@ -489,6 +492,15 @@
             :disabled="isdisable"
           />
         </div>
+        <div>
+          <a-button
+            style="margin-bottom: 15px"
+            :disabled="isdisable"
+            @click="initPostgreSQL"
+          >
+            【初始化资产监控PostgreSQL时序数据库】
+          </a-button>
+        </div>
       </div>
     </div>
 
@@ -623,10 +635,6 @@
 <script>
 import Common from '../common/Common.js';
 
-
-
-
-
 import ImageEditor from '../widget/ImageEditor.vue';
 
 import LoginContextResource from '../api/base/LoginContextResource.js';
@@ -635,16 +643,8 @@ import AssetInstanceResource from '../api/asset/AssetInstanceResource.js';
 import DepreciationMethodResource from '../api/asset/DepreciationMethodResource.js';
 import { Notify } from 'pc-component-v3';
 
-
-
-
 export default {
-
   components: {
-    
-    
-    
-    
     ImageEditor,
   },
   data: function () {
@@ -690,10 +690,10 @@ export default {
       var _self = this;
       LoginContextResource.queryLoginContext().then(
         successData => {
-          if(successData.errorCode == 0) {
+          if (successData.errorCode == 0) {
             _self.loginContextDto = successData.data;
           } else {
-            Notify.error('提示',successData.errorMessage, false);
+            Notify.error('提示', successData.errorMessage, false);
           }
         },
         errorData => {
@@ -726,10 +726,12 @@ export default {
       var _self = this;
       AssetConfigResource.queryAssetConfig().then(
         successData => {
-          if(successData.errorCode == 0) {
-            successData.data == null ? _self.assetConfigDto = {} : _self.assetConfigDto = successData.data;
+          if (successData.errorCode == 0) {
+            successData.data == null
+              ? (_self.assetConfigDto = {})
+              : (_self.assetConfigDto = successData.data);
           } else {
-            Notify.error('提示',successData.errorMessage, false);
+            Notify.error('提示', successData.errorMessage, false);
           }
         },
         errorData => {
@@ -794,8 +796,8 @@ export default {
       var _self = this;
       AssetConfigResource.saveAssetConfig(_self.assetConfigDto).then(
         successData => {
-          if(successData.errorCode != 0) {
-            Notify.error('提示','更新资产配置失败。', false);
+          if (successData.errorCode != 0) {
+            Notify.error('提示', '更新资产配置失败。', false);
             return;
           }
           Notify.success('提示', '更新资产配置成功!', 1500);
@@ -828,20 +830,20 @@ export default {
      */
     regenerateThumbnails: function () {
       var _self = this;
-      _self.loading=true;
+      _self.loading = true;
       AssetConfigResource.regenerateThumbnails(_self.assetConfigDto).then(
         successData => {
-          if(successData.errorCode != 0) {
-            Notify.error('提示','重新更新缩略图失败。', false);
-            _self.loading=false;
+          if (successData.errorCode != 0) {
+            Notify.error('提示', '重新更新缩略图失败。', false);
+            _self.loading = false;
           } else {
             Notify.success('提示', '重新生成缩略图成功。', false);
-            _self.loading=false;
+            _self.loading = false;
           }
         },
         errorData => {
           Common.processException(errorData);
-          _self.loading=false;
+          _self.loading = false;
         },
       );
     },
@@ -851,28 +853,62 @@ export default {
      */
     generateAsset: function () {
       var _self = this;
-      _self.loading=true;
+      _self.loading = true;
       AssetInstanceResource.generateAssetByAssetInstance().then(
         successData => {
-          if(successData.errorCode == 0) {
-            Notify.success('提示', '共计生成' + successData.data + '个资产', false);
-            _self.loading=false;
+          if (successData.errorCode == 0) {
+            Notify.success(
+              '提示',
+              '共计生成' + successData.data + '个资产',
+              false,
+            );
+            _self.loading = false;
           } else {
-            Notify.error('提示',successData.errorMessage, false);
-            _self.loading=false;
+            Notify.error('提示', successData.errorMessage, false);
+            _self.loading = false;
           }
         },
         errorData => {
           Common.processException(errorData);
-          _self.loading=false;
+          _self.loading = false;
         },
       );
     },
 
+    // 初始化资产监控PostgreSQL时序数据库
+    initPostgreSQL: function () {
+      const params = {
+        params: null,
+        processNo: '20240307_185738',
+        resetEngine: false,
+        printJavaCode: false,
+      };
+      $.ajax({
+        url: Common.getApiURL('ProcessResource/execute'),
+        type: 'post',
+        contentType: 'application/json',
+        dataType: 'json',
+        data: JSON.stringify(params),
+        beforeSend: function (request) {
+          Common.addTokenToRequest(request);
+        },
+
+        success: function (data) {
+          if (data.errorCode === 0) {
+            Notify.success('提示', '初始化资产监控PostgreSQL时序数据库成功!', 1500);
+          } else {
+            Notify.error(data.errorMessage);
+          }
+        },
+        error: function (XMLHttpRequest, textStatus, errorThrown) {
+          Common.processException(XMLHttpRequest, textStatus, errorThrown);
+        },
+      });
+    },
     changeIsdisabled: function () {
       this.isdisable = !this.isdisable;
     },
-    
+
     getTotalNum: function (str) {
       if (str == undefined || str == '') {
         return;

+ 61 - 26
src/components/customer/ManuallyConfirmCountingDataStep1.vue

@@ -2,9 +2,17 @@
   <div>
     <div>
       <label>单据号</label>
-      <a-input v-model:value="searchParams.documentNo" class="common" @press-enter="searchChange" />
+      <a-input
+        v-model:value="searchParams.documentNo"
+        class="common"
+        @press-enter="searchChange"
+      />
       <label class="common">盘点名称</label>
-      <a-input v-model:value="searchParams.documentName" class="common" @press-enter="searchChange" />
+      <a-input
+        v-model:value="searchParams.documentName"
+        class="common"
+        @press-enter="searchChange"
+      />
       <a-button class="common" type="primary" @click="searchChange">
         查询
       </a-button>
@@ -25,22 +33,25 @@
             }}</span>
         </template>
         <template v-if="column.key === 'operation'">
-          <a-button
-            type="primary"
-            @click="confirmInventory(record.id)"
+          <a @click="confirmInventory(record.id)"> 确认盘点数据 </a><br />
+          <a
+            v-if="record.uncountedQuantity > 0 && record.isComplete == '否'"
+            @click="generateInventory(record.id)"
           >
-            确认盘点数据
-          </a-button>
+            盘亏数据生成新盘点单
+          </a>
         </template>
       </template>
     </CommonTable>
-    <a-button type="primary" style="margin-top:20px" @click="previousStep">上一步</a-button>
+    <a-button type="primary" style="margin-top: 20px" @click="previousStep">
+      上一步
+    </a-button>
   </div>
 </template>
 <script setup>
 import Common from '../../common/Common';
 import { SqlApi, Notify } from 'pc-component-v3';
-import {ref,reactive,defineEmits,onMounted} from 'vue';
+import { ref, reactive, defineEmits, onMounted } from 'vue';
 import { useRouter } from 'vue-router';
 import CommonTable from './CommonTable.vue';
 
@@ -53,75 +64,74 @@ const columns = reactive(
       title: '组织名称',
       key: 'cname',
       dataIndex: 'cname',
-      width:100,
+      width: 100,
     },
     {
       title: '盘点名称',
       key: 'name',
       dataIndex: 'name',
-      width:100,
+      width: 100,
     },
     {
       title: '已完成',
       key: 'isComplete',
       dataIndex: 'isComplete',
-      width:100,
+      width: 100,
     },
     {
       title: '单据号',
       key: 'documentNo',
       dataIndex: 'documentNo',
-      width:100,
+      width: 100,
     },
     {
       title: '盘点状态',
       key: 'inventoryStatus',
       dataIndex: 'inventoryStatus',
-      width:100,
+      width: 100,
     },
     {
       title: '开始日期',
       key: 'inventoryStartDate',
       dataIndex: 'inventoryStartDate',
-      width:100,
+      width: 100,
     },
     {
       title: '截止日期',
       key: 'inventoryEndDate',
       dataIndex: 'inventoryEndDate',
-      width:100,
+      width: 100,
     },
     {
       title: '盘点总数',
       key: 'totalCount',
       dataIndex: 'totalCount',
-      width:100,
+      width: 80,
     },
     {
       title: '已盘点数量',
       key: 'countedQuantity',
       dataIndex: 'countedQuantity',
-      width:100,
+      width: 80,
     },
     {
       title: '未盘点数量',
       key: 'uncountedQuantity',
       dataIndex: 'uncountedQuantity',
-      width:100,
+      width: 80,
     },
     {
       title: '盘盈数量',
       key: 'inventoryGainQuantity',
       dataIndex: 'inventoryGainQuantity',
-      width:100,
-
+      width: 80,
     },
     {
       title: '操作',
       key: 'operation',
       dataIndex: 'operation',
-      fixed:'right',
-      width:108,
+      fixed: 'right',
+      width: 180,
     },
   ].map(item => ({ ...item, align: 'center' })),
 );
@@ -151,9 +161,35 @@ const searchChange = () => {
 
 // 人工确认盘点数据
 const confirmInventory = id => {
-  emits('changeStep',{step:1,id});
+  emits('changeStep', { step: 1, id });
 };
 
+//盘亏数据生成盘点单
+const generateInventory = id => {
+  const params = new FormData();
+  params.append('id', String(id));
+  $.ajax({
+    url: Common.getApiURL('AssetInstanceResource/generateNewFromOld'),
+    type: 'post',
+    contentType: false,
+    processData: false,
+    data: params,
+    beforeSend: function (request) {
+      Common.addTokenToRequest(request);
+    },
+
+    success: function (data) {
+      if (data.errorCode === 0) {
+        Notify.success('提示', '盘亏数据生成盘点单成功!', 1500);
+      } else {
+        Notify.error(data.errorMessage);
+      }
+    },
+    error: function (XMLHttpRequest, textStatus, errorThrown) {
+      Common.processException(XMLHttpRequest, textStatus, errorThrown);
+    },
+  });
+};
 onMounted(() => {
   queryAssetDiscovery();
 });
@@ -178,10 +214,9 @@ const queryAssetDiscovery = () => {
 const previousStep = () => {
   router.push('/eam/assetInventory');
 };
-
 </script>
 <style scoped>
-  input {
+input {
   width: 200px;
 }
 .common {

+ 8 - 6
src/components/customer/PerformInventoryTasks.vue

@@ -3,11 +3,6 @@
     <div class="grid-item-row1">
       <div class="btn-group m-panel" role="group">
         <div class="form-inline">
-          <div>
-            <a-button v-if="currentStep == 1" type="primary" @click="previous">
-              上一步
-            </a-button>
-          </div>
           <div class="form-group">
             <label for="assetName">盘点单名称:</label>
             <label for="assetName"> {{ assetInventoryName }}</label>
@@ -116,7 +111,11 @@
         </template>
       </template>
     </CommonTable>
-
+    <div>
+      <a-button v-if="currentStep == 1" type="primary" @click="previous">
+        上一步
+      </a-button>
+    </div>
     <!-- <div class="grid-item-row3">
         <div>
           <div class="pull-left">
@@ -653,4 +652,7 @@ table.fixed-table td {
   white-space: nowrap;
   text-overflow: ellipsis;
 }
+:deep(.ant-table-pagination.ant-pagination) {
+  margin: 4px 0;
+}
 </style>