Explorar el Código

3.0.34资产出入记录内增加资产子清单功能项

liuyanpeng hace 2 años
padre
commit
9f33929a58
Se han modificado 2 ficheros con 150 adiciones y 51 borrados
  1. 1 1
      package.json
  2. 149 50
      src/components/customer/AssetInstanceSearchDetail.vue

+ 1 - 1
package.json

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

+ 149 - 50
src/components/customer/AssetInstanceSearchDetail.vue

@@ -141,9 +141,9 @@
           </div>
           <div class="col-md-3">
             <div>
-              <strong>{{ $t("lang.AssetInstanceSearchDetail.placementLocation") }}:{{
-                showAssetInstance.locationName
-              }}</strong>
+              <strong>{{
+                $t("lang.AssetInstanceSearchDetail.placementLocation")
+              }}:{{ showAssetInstance.locationName }}</strong>
             </div>
           </div>
           <div class="col-md-3">
@@ -503,6 +503,7 @@
           </div>
         </div>
       </div>
+
       <div class="row">
         <div class="col-md-12 div-asset-info">
           <ul id="myTab" class="nav nav-tabs">
@@ -531,11 +532,18 @@
                 $t("lang.AssetInstanceSearchDetail.inAndOutRecords")
               }}</a>
             </li>
+            <li @click="queryAssetChildren">
+              <a href="#asset-content-6" data-toggle="tab">子资产清单</a>
+            </li>
           </ul>
           <div class="tab-content div-asset-info">
             <div id="asset-content-1" class="tab-pane fade in active">
               <div v-if="historyEvents != null" class="row div-history-event">
-                <div v-for="item in historyEvents" :key="item.id" class="media col-md-12">
+                <div
+                  v-for="item in historyEvents"
+                  :key="item.id"
+                  class="media col-md-12"
+                >
                   <div class="media-left">
                     <a href="javascript:void(0);">
                       <img
@@ -564,19 +572,13 @@
                   <label>{{
                     $t("lang.AssetInstanceSearchDetail.startTime")
                   }}</label>
-                  <DateTime
-                    v-model="startDate"
-                    name="datetime"
-                  />
+                  <DateTime v-model="startDate" name="datetime" />
                 </div>
                 <div class="form-group">
                   <label>{{
                     $t("lang.AssetInstanceSearchDetail.endTime")
                   }}</label>
-                  <DateTime
-                    v-model="endDate"
-                    name="datetime"
-                  />
+                  <DateTime v-model="endDate" name="datetime" />
                 </div>
                 <button
                   type="button"
@@ -715,19 +717,13 @@
                   <label>{{
                     $t("lang.AssetInstanceSearchDetail.startTime")
                   }}</label>
-                  <DateTime
-                    v-model="searchStartDate"
-                    name="datetime"
-                  />
+                  <DateTime v-model="searchStartDate" name="datetime" />
                 </div>
                 <div class="form-group">
                   <label>{{
                     $t("lang.AssetInstanceSearchDetail.endTime")
                   }}</label>
-                  <DateTime
-                    v-model="searchEndDate"
-                    name="datetime"
-                  />
+                  <DateTime v-model="searchEndDate" name="datetime" />
                 </div>
                 <button
                   type="button"
@@ -760,13 +756,15 @@
                     </tr>
                   </thead>
                   <tbody>
-                    <tr v-for="(item, index) in assetInstanceRfidRecords" :key="item.id">
+                    <tr
+                      v-for="(item, index) in assetInstanceRfidRecords"
+                      :key="item.id"
+                    >
                       <td>
                         {{
                           index +
                             1 +
-                            (pagination.current_page - 1) *
-                            pagination.per_page
+                            (pagination.current_page - 1) * pagination.per_page
                         }}
                       </td>
                       <td>{{ item.scanDate }}</td>
@@ -782,7 +780,7 @@
                             )
                           "
                           style="width: 80px; height: 50px"
-                          @click="getImage(item.className,item.image)"
+                          @click="getImage(item.className, item.image)"
                         />
                       </td>
                     </tr>
@@ -806,6 +804,68 @@
                 </div>
               </div>
             </div>
+            <div id="asset-content-6" class="tab-pane fade in">
+              <div style="margin-bottom: 8px">
+                <label>资产名称:</label><a-input
+                  v-model:value="childrenName"
+                  style="width: 20%"
+                  @press-enter="queryAssetChildren"
+                />
+                <label>资产编号:</label><a-input
+                  v-model:value="childrenNo"
+                  style="width: 20%"
+                  @press-enter="queryAssetChildren"
+                />
+                <label>唯一识别号:</label><a-input
+                  v-model:value="childrenNumber"
+                  style="width: 20%"
+                  @press-enter="queryAssetChildren"
+                />
+                <button
+                  type="button"
+                  class="btn btn-default"
+                  style="margin-top: -6px"
+                  @click="queryAssetChildren"
+                >
+                  查询
+                </button>
+              </div>
+              <div class="table-responsive" style="height: 400px">
+                <table
+                  style="overflow: scroll; overflow-y: auto"
+                  class="table table-striped table-bordered"
+                >
+                  <thead>
+                    <tr height="40px">
+                      <th>序号</th>
+                      <th>资产名称</th>
+                      <th>资产编号</th>
+                      <th>规格型号</th>
+                      <th>唯一识别号</th>
+                    </tr>
+                  </thead>
+                  <tbody>
+                    <tr
+                      v-for="(item, index) in allAssetChildren"
+                      :key="item.id"
+                      @dblclick="openCurdWindow(item)"
+                    >
+                      <td>
+                        {{
+                          index +
+                            1 +
+                            (pagination.current_page - 1) * pagination.per_page
+                        }}
+                      </td>
+                      <td>{{ item.assetInstanceName }}</td>
+                      <td>{{ item.assetNo }}</td>
+                      <td>{{ item.type }}</td>
+                      <td>{{ item.uniqueNumber }}</td>
+                    </tr>
+                  </tbody>
+                </table>
+              </div>
+            </div>
           </div>
         </div>
       </div>
@@ -835,18 +895,12 @@
 
 <script>
 import Common from '../../common/Common.js';
-import { Notify } from 'pc-component-v3';
+import { Notify, Uuid } from 'pc-component-v3';
 import AuthImage from '../../widget/AuthImage.vue';
 
-
-
-
-
-
 import AssetInstanceRfidRecordResource from '../../api/asset/AssetInstanceRfidRecordResource.js';
 
 export default {
-
   components: {
     AuthImage,
   },
@@ -894,7 +948,11 @@ export default {
       loading: false,
       modal: false,
       queryPageSingleEpcFilterByTimeErrorMessage: 0,
-      
+      childrenNo: '',
+      childrenName: '',
+      childrenNumber: '',
+      assetInstanceId: '',
+      allAssetChildren: [],
     };
   },
 
@@ -904,8 +962,8 @@ export default {
 
   mounted: function () {
     var _self = this;
-    var assetInstanceId = _self.$route.query.assetInstanceId;
-    _self.findAssetInstance(assetInstanceId);
+    _self.assetInstanceId = _self.$route.query.assetInstanceId;
+    _self.findAssetInstance(_self.assetInstanceId);
     _self.getEventOriginalEndDate();
     this.getCameraNo();
     $('#right-container').css('background-color', '#ffffff');
@@ -916,8 +974,51 @@ export default {
   },
 
   methods: {
-    getImage: function (className,imageName) {
-      const url = this.showBigImage(className,imageName);
+    // 查询子资产清单
+    queryAssetChildren: function () {
+      const _self = this;
+      const params = {
+        assetNo: _self.childrenNo,
+        uniqueNumber: _self.childrenNumber,
+        assetInstanceName: _self.childrenName,
+        assetInstanceId: _self.assetInstanceId,
+      };
+      $.ajax({
+        url: Common.getApiURL(
+          'AssetInstanceResource/queryChildAssetInstanceByParent',
+        ),
+        type: 'post',
+        data: JSON.stringify(params),
+        contentType: 'application/json',
+        beforeSend: function (request) {
+          Common.addTokenToRequest(request);
+        },
+        success: function (data) {
+          if (data.errorCode === 0) {
+            _self.allAssetChildren = data.datas;
+          } else {
+            Notify.error('查询错误', data.errorMessage, true);
+          }
+        },
+        error: function (XMLHttpRequest, textStatus, errorThrown) {
+          Common.processException(XMLHttpRequest, textStatus, errorThrown);
+        },
+      });
+    },
+    /**
+     * 打开资产卡片的CURD窗口
+     */
+    openCurdWindow: function (assetInstance) {
+      let url = Common.getRedirectUrl(
+        '#/desktop/window/window-read/view/040701/0/' +
+          assetInstance.assetInstanceId +
+          '?currPage=1&currIndex=1&totalCount=1&uuid=' +
+          Uuid.createUUID(),
+      );
+      window.open(url, '资产卡片');
+    },
+    getImage: function (className, imageName) {
+      const url = this.showBigImage(className, imageName);
       this.$refs.imagePreview.preview(url);
     },
     getEventOriginalEndDate: function () {
@@ -952,7 +1053,7 @@ export default {
       var imageSrc = Common.getFileServerUrl() + 'Files\\UsbCamera\\' + item;
       // eslint-disable-next-line
       var bgstr =
-      // eslint-disable-next-line
+        // eslint-disable-next-line
         '<div id="ImgZoomInBG" style=" background:#000000; filter:Alpha(Opacity=70); opacity:0.7; position:fixed; left:0; top:0; z-index:10000; width:100%; height:100%; display:none;"><iframe src="about:blank" frameborder="5px" scrolling="yes" style="width:100%; height:100%;"></iframe></div>';
       //				alert($(event.target).attr('src'));
 
@@ -990,16 +1091,16 @@ export default {
         url: Common.getApiURL('AssetInstanceResource/findAssetInstanceById1'),
         type: 'post',
         data: JSON.stringify({
-          'assetInstanceId': assetInstanceId,
+          assetInstanceId: assetInstanceId,
         }),
         contentType: 'application/json',
         beforeSend: function (request) {
           Common.addTokenToRequest(request);
         },
         success: function (data) {
-          if(data.errorCode === 0){
+          if (data.errorCode === 0) {
             _self.showItem(data.data);
-          }else{
+          } else {
             Notify.error('查询错误', data.errorMessage, true);
           }
         },
@@ -1032,7 +1133,8 @@ export default {
       var _self = this;
       var sendData = {
         epc: _self.showAssetInstance.epc,
-        start: (_self.pagination2.current_page - 1) * _self.pagination2.per_page,
+        start:
+          (_self.pagination2.current_page - 1) * _self.pagination2.per_page,
         length: _self.pagination2.per_page,
       };
       if (_self.startDate != null && _self.startDate.length > 0) {
@@ -1050,13 +1152,13 @@ export default {
           Common.addTokenToRequest(request);
         },
         success: function (data) {
-          if(data.errorCode === 0){
+          if (data.errorCode === 0) {
             _self.imageInfos = data.datas;
             _self.pagination2.total = data.total;
             _self.pagination2.last_page = Math.ceil(
               _self.pagination2.total / _self.pagination2.per_page,
             );
-          }else{
+          } else {
             Notify.error('查询错误', data.errorMessage, true);
           }
         },
@@ -1149,7 +1251,6 @@ export default {
       return arr;
     },
 
-
     callbackFun: function () {
       if (this.showAssetInstance == undefined || this.showAssetInstance == '') {
         return;
@@ -1250,10 +1351,9 @@ export default {
           Common.addTokenToRequest(request);
         },
         success: function (data) {
-          
-          if(data.errorCode === 0){
+          if (data.errorCode === 0) {
             _self.imageUrlTest = data.datas;
-          }else{
+          } else {
             Notify.error('查询错误', data.errorMessage, true);
           }
 
@@ -1280,12 +1380,11 @@ export default {
           Common.addTokenToRequest(request);
         },
         success: function (data) {
-          if(data.errorCode === 0){
+          if (data.errorCode === 0) {
             _self.historyEvents = data.datas;
-          }else{
+          } else {
             Notify.error('查询错误', data.errorMessage, true);
           }
-          
         },
         error: function (XMLHttpRequest, textStatus, errorThrown) {
           Common.processException(XMLHttpRequest, textStatus, errorThrown);