liuyanpeng 3 лет назад
Родитель
Сommit
1cf7b9eb3f

+ 6 - 4
src/components/customer/ManuallyConfirmCountingData.vue

@@ -13,10 +13,10 @@
       <a-divider />
       <section>
         <manually-confirm-counting-data-step1
-          v-if="currentStep == 0" :current-step="currentStep"
+          v-if="currentStep == 0" :current-step="currentStep" @change-step="nextStep"
           @previous="previousStep"
         />
-        <PerformInventoryTasks v-if="currentStep == 1" @next="nextStep" />
+        <PerformInventoryTasks v-if="currentStep == 1" :id="id" :current-step="currentStep" @change-step="nextStep" @next="nextStep" />
       </section>
     </div>
   </div>
@@ -37,15 +37,17 @@ export default {
   },
   data: function() {
     return {
+      id:'',
       currentStep: 0,
       infoWindowNo: '20220427_143952',
     };
   },
 
   methods: {
-    nextStep: function() {
+    nextStep: function(data) {
       var _self = this;
-      _self.currentStep = 1;
+      _self.currentStep = data.step;
+      _self.id = data.id;
     },
     previousStep: function(data) {
       var _self = this;

+ 175 - 33
src/components/customer/ManuallyConfirmCountingDataStep1.vue

@@ -1,48 +1,190 @@
 <template>
   <div>
-    <InfoWindow
-      :info-window-no="infoWindowNo" 
-      :where-clause-source="whereClauseSource"
-    />
-    <a-button type="primary" @click="previousStep">上一步</a-button>
+    <div>
+      <label>单据号</label>
+      <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-button class="common" type="primary" @click="searchChange">
+        查询
+      </a-button>
+    </div>
+    <CommonTable
+      :columns="columns"
+      :data-source="dataSource"
+      :total="total"
+      @get-page="getPageParams"
+    >
+      <template #bodyCell="{ column, record }">
+        <template v-if="column.key === 'processed'">
+          <span>
+            {{
+              record.processed === null || record.processed === false
+                ? "关闭"
+                : "打开"
+            }}</span>
+        </template>
+        <template v-if="column.key === 'operation'">
+          <a-button
+            type="primary"
+            @click="confirmInventory(record.id)"
+          >
+            确认盘点数据
+          </a-button>
+        </template>
+      </template>
+    </CommonTable>
+    <a-button type="primary" style="margin-top:20px" @click="previousStep">上一步</a-button>
   </div>
 </template>
-<script>
+<script setup>
+import Common from '../../common/Common';
+import { SqlApi, Notify } from 'pc-component-v3';
+import {ref,reactive,defineEmits,onMounted} from 'vue';
+import { useRouter } from 'vue-router';
+import CommonTable from './CommonTable.vue';
 
+const emits = defineEmits(['changeStep']);
+const router = useRouter();
+// 表格数据
+const columns = reactive(
+  [
+    {
+      title: '组织名称',
+      key: 'cname',
+      dataIndex: 'cname',
+      width:100,
+    },
+    {
+      title: '盘点名称',
+      key: 'name',
+      dataIndex: 'name',
+      width:100,
+    },
+    {
+      title: '已完成',
+      key: 'isComplete',
+      dataIndex: 'isComplete',
+      width:100,
+    },
+    {
+      title: '单据号',
+      key: 'documentNo',
+      dataIndex: 'documentNo',
+      width:100,
+    },
+    {
+      title: '盘点状态',
+      key: 'inventoryStatus',
+      dataIndex: 'inventoryStatus',
+      width:100,
+    },
+    {
+      title: '开始日期',
+      key: 'inventoryStartDate',
+      dataIndex: 'inventoryStartDate',
+      width:100,
+    },
+    {
+      title: '截止日期',
+      key: 'inventoryEndDate',
+      dataIndex: 'inventoryEndDate',
+      width:100,
+    },
+    {
+      title: '盘点总数',
+      key: 'totalCount',
+      dataIndex: 'totalCount',
+      width:100,
+    },
+    {
+      title: '已盘点数量',
+      key: 'countedQuantity',
+      dataIndex: 'countedQuantity',
+      width:100,
+    },
+    {
+      title: '未盘点数量',
+      key: 'uncountedQuantity',
+      dataIndex: 'uncountedQuantity',
+      width:100,
+    },
+    {
+      title: '盘盈数量',
+      key: 'inventoryGainQuantity',
+      dataIndex: 'inventoryGainQuantity',
+      width:100,
 
-export default {
-  components: {
-    
-  },
-
-  props: {
-
-  },
+    },
+    {
+      title: '操作',
+      key: 'operation',
+      dataIndex: 'operation',
+      fixed:'right',
+      width:108,
+    },
+  ].map(item => ({ ...item, align: 'center' })),
+);
+const dataSource = ref([]);
+const total = ref(0); // 数据总数
 
-  data: function() {
-    return {
-      'infoWindowNo': '20220427_143952',
-      whereClauseSource: {
-        customerDataDimensions:[{
-          fieldName: 'c.id',
-          dataDimensionTypeNo: '202201191757',
-          defaultDataDimensionTypeValueNo: '1',
-        }],
-      },
-    };
-  },
+// 查询参数
+const searchParams = reactive({
+  documentNo: '',
+  documentName: '',
+  offset: 0,
+  limit: 20,
+});
 
+// 从子组件获取的分页参数
+const getPageParams = (start, length) => {
+  searchParams.offset = (start - 1) * length;
+  searchParams.limit = length;
+  queryAssetDiscovery();
+};
 
+// 查询按钮功能
+const searchChange = () => {
+  searchParams.offset = 0;
+  queryAssetDiscovery();
+};
 
-  mounted: function() {
+// 人工确认盘点数据
+const confirmInventory = id => {
+  emits('changeStep',{step:1,id});
+};
 
-  },
+onMounted(() => {
+  queryAssetDiscovery();
+});
 
-  methods: {
-    previousStep: function() {
-      var _self = this;
-      _self.$router.push('/eam/assetInventory');
+// 资产盘点单查询,用于界面设置盘点单状态
+const queryAssetDiscovery = () => {
+  SqlApi.execute('20230517_175800', searchParams).then(
+    successData => {
+      // console.log(successData);
+      if (successData.errorCode === 0) {
+        dataSource.value = successData.items;
+        total.value = successData.total;
+      }
+    },
+    errorData => {
+      Common.processException(errorData);
     },
-  },
+  );
 };
+
+// 上一步跳转
+const previousStep = () => {
+  router.push('/eam/assetInventory');
+};
+
 </script>
+<style scoped>
+  input {
+  width: 200px;
+}
+.common {
+  margin-left: 8px;
+}
+</style>

+ 506 - 319
src/components/customer/PerformInventoryTasks.vue

@@ -1,137 +1,146 @@
 <template>
   <div>
-    <Navbar title="盘点数据确认" :is-go-back="false" />
-
-    <div class="grid-container">
-      <div class="grid-item-row1">
-        <div class="btn-group m-panel" role="group">
-          <div class="form-inline">
-            <div class="form-group">
-              <label for="assetName">盘点单名称:</label>
-              <label for="assetName"> {{ assetInventoryName }}</label>
-            </div>
-            <div class="form-group">
-              <label for="assetName">盘点单编号:</label>
-              <label for="assetName"> {{ assetInventoryNo }}</label>
-            </div>
+    <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-inline">
-            <div class="form-group">
-              <label for="assetName">资产名称</label>
-              <input
-                id="assetName"
-                v-model="assetName" autocomplete="off" type="text" class="form-control" placeholder="资产名称"
-                @keyup.enter="getAssetInventoryLine(false)"
-              />
-            </div>
-            <div class="form-group">
-              <label for="assetNo">资产编号</label>
-              <input id="assetNo" v-model="assetNo" autocomplete="off" type="text" class="form-control" placeholder="资产编号" @keyup.enter="getAssetInventoryLine(false)" />
-            </div>
-            <div class="form-group">
-              <label for="cardNo">卡片编号</label>
-              <input id="cardNo" v-model="cardNo" autocomplete="off" type="text" class="form-control" placeholder="卡片编号" @keyup.enter="getAssetInventoryLine(false)" />
-            </div>
-            <button class="btn btn-default" @click="getAssetInventoryLine(false)">
-              查询
-            </button>
-            <button class="btn btn-default" @click="clearFilter">
-              清空
-            </button>
+          <div class="form-group">
+            <label for="assetName">盘点单名称:</label>
+            <label for="assetName"> {{ assetInventoryName }}</label>
+          </div>
+          <div class="form-group">
+            <label class="common" for="assetName">盘点单编号:</label>
+            <label for="assetName"> {{ assetInventoryNo }}</label>
           </div>
         </div>
+        <div class="form-inline">
+          <div class="form-group">
+            <label for="assetName">资产名称</label>
+            <input
+              id="assetName"
+              v-model="assetName"
+              autocomplete="off"
+              type="text"
+              class="common form-control"
+              placeholder="资产名称"
+              @keyup.enter="getAssetInventoryLine(false)"
+            />
+          </div>
+          <div class="form-group">
+            <label class="common" for="assetNo">资产编号</label>
+            <input
+              id="assetNo"
+              v-model="assetNo"
+              autocomplete="off"
+              type="text"
+              class="common form-control"
+              placeholder="资产编号"
+              @keyup.enter="getAssetInventoryLine(false)"
+            />
+          </div>
+          <div class="form-group">
+            <label class="common" for="cardNo">卡片编号</label>
+            <input
+              id="cardNo"
+              v-model="cardNo"
+              autocomplete="off"
+              type="text"
+              class="common form-control"
+              placeholder="卡片编号"
+              @keyup.enter="getAssetInventoryLine()"
+            />
+          </div>
+          <a-button
+            type="primary"
+            class="common"
+            @click="getAssetInventoryLine()"
+          >
+            查询
+          </a-button>
+          <a-button type="danger" class="common" @click="clearFilter">
+            清空
+          </a-button>
+        </div>
       </div>
-      <div class="grid-item-row2">
-        <table class="fixed-table table-striped table-bordered">
-          <thead>
-            <tr>
-              <th style="width: 130px;">资产名称</th>
-              <th style="width: 130px;">资产编号</th>
-              <th style="width: 130px;">卡片编号</th>
-              <td style="width: 150px;">盘点使用状态</td>
-              <td style="width: 200px;">备注</td>
-              <th style="width: 90px;">确认</th>
-              <th style="width: 100px;">账面位置</th>
-              <th style="width: 100px;">账面使用状态</th>
-              <th style="width: 130px;">规格型号</th>
-              <th style="width: 130px;">类别名称</th>
-              <th style="width: 130px;">责任人</th>
-              <th style="width: 130px;">使用人</th>
-              <th style="width: 130px;">保管人</th>
-              <th style="width: 130px;">所属单位</th>
-              <th style="width: 130px;">所属部门</th>
-              <th style="width: 130px;">使用单位</th>
-              <th style="width: 130px;">使用部门</th>
-              <th style="width: 130px;">详细信息</th>
-            </tr>
-          </thead>
-          <tbody>
-            <tr v-for="(assetInventoryLine, index) in assetInventoryLines" :key="assetInventoryLine.assetInventoryLineId">
-              <td>{{ assetInventoryLine['assetName'] }}</td>
-              <td>{{ assetInventoryLine['assetNo'] }}</td>
-              <td>{{ assetInventoryLine['cardNo'] }}</td>
-              <td>
-                <select v-model="assetInventoryLine.useStatusId" class="form-control" placeholder="盘点使用状态">
-                  <option />
-                  <option v-for="useStatus in useStatusList" :key="useStatus.id" :value="useStatus.id">
-                    {{ useStatus.text }}
-                  </option>
-                </select>
-              </td>
-              <td>
-                <input
-                  id="cardNo"
-                  v-model="assetInventoryLine.description" autocomplete="off" type="text" class="form-control"
-                  placeholder="备注"
-                />
-              </td>
-              <td>
-                <button class="btn btn-default" @click="updateAssetInventoryLine(assetInventoryLine, index)">
-                  人工确认
-                </button>
-              </td>
-              <td>{{ assetInventoryLine['locationName'] }}</td>
-              <td>{{ assetInventoryLine['useStatusName'] }}</td>
-              <td>{{ assetInventoryLine['assetType'] }}</td>
-              <td>{{ assetInventoryLine['assetCategoryName'] }}</td>
-              <td>{{ assetInventoryLine['custodianUserName'] }}</td>
-              <td>{{ assetInventoryLine['useUserName'] }}</td>
-              <td>{{ assetInventoryLine['depositoryUserName'] }}</td>
-              <td>{{ assetInventoryLine['clientName'] }}</td>
-              <td>{{ assetInventoryLine['organizationName'] }}</td>
-              <td>{{ assetInventoryLine['userClientName'] }}</td>
-              <td>{{ assetInventoryLine['useOrganizationName'] }}</td>
-              <td>
-                <button class="btn btn-link" @click="openCurdWindow(assetInventoryLine)">
-                  查看
-                </button>
-              </td>
-            </tr>
-          </tbody>
-        </table>
-      </div>
-      <div class="grid-item-row3">
+    </div>
+
+    <CommonTable
+      :columns="columns"
+      :data-source="dataSource"
+      :total="pagination.total"
+      @get-page="getPageParams"
+    >
+      <template #bodyCell="{ column, record, index }">
+        <template v-if="column.key == 'useStatusId'">
+          <select
+            v-model="record.useStatusId"
+            class="form-control"
+            placeholder="盘点使用状态"
+          >
+            <option />
+            <option
+              v-for="useStatus in useStatusList"
+              :key="useStatus.id"
+              :value="useStatus.id"
+            >
+              {{ useStatus.text }}
+            </option>
+          </select>
+        </template>
+        <template v-if="column.key == 'description'">
+          <input
+            id="cardNo"
+            v-model="record.description"
+            autocomplete="off"
+            type="text"
+            class="form-control"
+            placeholder="备注"
+          />
+        </template>
+        <template v-if="column.key == 'affirm'">
+          <a-button
+            class="btn btn-default"
+            @click="updateAssetInventoryLine(record, index)"
+          >
+            人工确认
+          </a-button>
+        </template>
+        <template v-if="column.key == 'info'">
+          <button class="btn btn-link" @click="openCurdWindow(record)">
+            查看
+          </button>
+        </template>
+      </template>
+    </CommonTable>
+
+    <!-- <div class="grid-item-row3">
         <div>
           <div class="pull-left">
             <span>
-              {{ $t('lang.AssetInventorySearch.the') }}
-              {{ (pagination.current_page-1)*pagination.per_page+1 }}
+              {{ $t("lang.AssetInventorySearch.the") }}
+              {{ (pagination.current_page - 1) * pagination.per_page + 1 }}
               -
-              {{ pagination.current_page*pagination.per_page }}
-              {{ $t('lang.AssetInventorySearch.strip') }},
-              {{ $t('lang.AssetInventorySearch.inTotal') }}
-              {{ pagination.total }}{{ $t('lang.AssetInventorySearch.strip') }},
-              {{ $t('lang.AssetInventorySearch.eachPage') }}
+              {{ pagination.current_page * pagination.per_page }}
+              {{ $t("lang.AssetInventorySearch.strip") }},
+              {{ $t("lang.AssetInventorySearch.inTotal") }}
+              {{ pagination.total }}{{ $t("lang.AssetInventorySearch.strip") }},
+              {{ $t("lang.AssetInventorySearch.eachPage") }}
             </span>
             <PageSizeSelect @page-size-changed="pageSizeChanged" />
-            <span>{{ $t('lang.AssetInventorySearch.strip') }}</span>
+            <span>{{ $t("lang.AssetInventorySearch.strip") }}</span>
           </div>
           <div class="pull-right">
-            <VueBootstrapPagination :pagination="pagination" :callback="pageStartChanged" />
+            <VueBootstrapPagination
+              :pagination="pagination"
+              :callback="pageStartChanged"
+            />
           </div>
         </div>
-      </div>
-    </div>
+      </div> -->
 
     <Loading v-if="loading" />
   </div>
@@ -139,32 +148,145 @@
 
 <script>
 import Common from '../../common/Common.js';
-
 import AssetInventoryResource from '../../api/asset/AssetInventoryResource.js';
 import AssetInventoryLineResource from '../../api/asset/AssetInventoryLineResource.js';
-
 import { Notify, Uuid } from 'pc-component-v3';
-
-
-
-
-
 import { SqlApi } from 'pc-component-v3';
 import UseStatusResource from '../../api/asset/UseStatusResource.js';
+import CommonTable from './CommonTable.vue';
 
 export default {
-
   components: {
-    
-    
-    
-    
-    
-    
+    CommonTable,
   },
-  emits: ['next'],
-  data: function() {
+  props: {
+    currentStep: {
+      type: Number,
+      required: true,
+      default: 1,
+    },
+    id: {
+      type: Number,
+      required: true,
+      default: 0,
+    },
+  },
+  emits: ['next', 'changeStep'],
+  data: function () {
     return {
+      // 表格数据
+      columns: [
+        {
+          title: '资产名称',
+          key: 'assetName',
+          dataIndex: 'assetName',
+          width: 100,
+        },
+        {
+          title: '资产编号',
+          key: 'assetNo',
+          dataIndex: 'assetNo',
+          width: 100,
+        },
+        {
+          title: '卡片编号',
+          key: 'cardNo',
+          dataIndex: 'cardNo',
+          width: 100,
+        },
+        {
+          title: '盘点使用状态',
+          key: 'useStatusId',
+          dataIndex: 'useStatusId',
+          width: 180,
+        },
+        {
+          title: '备注',
+          key: 'description',
+          dataIndex: 'description',
+          width: 180,
+        },
+        {
+          title: '确认',
+          key: 'affirm',
+          dataIndex: 'affirm',
+          width: 100,
+        },
+        {
+          title: '账面位置',
+          key: 'locationName',
+          dataIndex: 'locationName',
+          width: 100,
+        },
+        {
+          title: '账面使用状态',
+          key: 'useStatusName',
+          dataIndex: 'useStatusName',
+          width: 110,
+        },
+        {
+          title: '规格型号',
+          key: 'assetType',
+          dataIndex: 'assetType',
+          width: 100,
+        },
+        {
+          title: '类别名称',
+          key: 'assetCategoryName',
+          dataIndex: 'assetCategoryName',
+          width: 100,
+        },
+        {
+          title: '责任人',
+          key: 'custodianUserName',
+          dataIndex: 'custodianUserName',
+          width: 100,
+        },
+        {
+          title: '使用人',
+          key: 'useUserName',
+          dataIndex: 'useUserName',
+          width: 100,
+        },
+        {
+          title: '保管人',
+          key: 'depositoryUserName',
+          dataIndex: 'depositoryUserName',
+          width: 100,
+        },
+        {
+          title: '所属单位',
+          key: 'clientName',
+          dataIndex: 'clientName',
+          width: 100,
+        },
+        {
+          title: '所属部门',
+          key: 'organizationName',
+          dataIndex: 'organizationName',
+          width: 100,
+        },
+        {
+          title: '使用单位',
+          key: 'userClientName',
+          dataIndex: 'userClientName',
+          width: 100,
+        },
+        {
+          title: '使用部门',
+          key: 'useOrganizationName',
+          dataIndex: 'useOrganizationName',
+          width: 100,
+        },
+        {
+          title: '详细信息',
+          key: 'info',
+          dataIndex: 'info',
+          width: 100,
+          fixed: 'right',
+        },
+      ].map(item => ({ ...item, align: 'center' })),
+      dataSource: [],
       assetInventoryId: null, // 资产盘点单Id
       assetInventory: {}, // 资产盘点
       assetInventoryNo: null,
@@ -188,97 +310,121 @@ export default {
     };
   },
 
-
-
-  mounted: function() {
+  mounted: function () {
     var _self = this;
 
     // 根据UUID获取盘点单的id
-    var uuid = _self.$route.params;
-    _self.assetInventoryId = uuid.id;
+    // var uuid = _self.$route.params;
+    _self.assetInventoryId = this.$props.id;
     _self.getAssetInventory();
-    console.log(uuid);
 
     // 固定行
-    _self.fixedTableHeader();
+    // _self.fixedTableHeader();
 
     // 可调整表格列宽
-    _self.$nextTick(function() {
-      $('.fixed-table').resizableColumns();
-    });
+    // _self.$nextTick(function () {
+    //   $('.fixed-table').resizableColumns();
+    // });
 
     _self.getUseStatusList();
   },
   methods: {
-    selectChanged: function() {
+    selectChanged: function () {
       var _self = this;
       _self.getAssetInventoryLine();
     },
 
+    // 从子组件获取的分页参数
+    getPageParams: function (start, length) {
+      this.pagination.current_page = start;
+      this.pagination.per_page = length;
+      this.getAssetInventoryLine();
+    },
+
     /**
-       * 查询盘点单DTO,
-       * 主要是获取资产盘点中的所属部门集合、使用部门集合、资产类别结合。
-       * @author yangzhijie 20200806
-       */
-    getAssetInventory: function() {
+     * 查询盘点单DTO,
+     * 主要是获取资产盘点中的所属部门集合、使用部门集合、资产类别结合。
+     * @author yangzhijie 20200806
+     */
+    getAssetInventory: function () {
       var _self = this;
-      AssetInventoryResource.getResponseOrganizationsAndOrganizationsAndCategory(_self.assetInventoryId).then(
+      AssetInventoryResource.getResponseOrganizationsAndOrganizationsAndCategory(
+        _self.assetInventoryId,
+      ).then(
         data => {
+          // console.log(data, '11111');
           _self.assetInventory = data;
           _self.assetInventoryNo = data.data.documentNo;
           _self.assetInventoryName = data.data.name;
           // 查询资产卡片的数据
           _self.getAssetInventoryLine();
-        }, xmlHttpRequest => {
+        },
+        xmlHttpRequest => {
           Common.processException(xmlHttpRequest);
-        });
+        },
+      );
     },
 
     /**
-       * 根据界面选中的所属部门、使用部门、资产类别、项目查询资产清单
-       * @author yangzhijie 20200806
-       */
-    getAssetInventoryLine: function(isPageChange) {
+     * 根据界面选中的所属部门、使用部门、资产类别、项目查询资产清单
+     * @author yangzhijie 20200806
+     */
+    getAssetInventoryLine: function () {
       var _self = this;
+      _self.pagination.current_page = 1;
 
-      if (!isPageChange) {
-        _self.pagination.current_page = 1;
-      }
+      // if (!isPageChange) {
+      //   _self.pagination.current_page = 1;
+      // }
 
-      _self.clearPageData();
+      // _self.clearPageData();
 
       _self.loading = true;
 
       var parameter = {
         assetInventoryId: _self.assetInventoryId,
-        assetNo: (_self.assetNo != null && _self.assetNo.length > 0) ? ('%' + _self.assetNo + '%') : null,
-        assetName: (_self.assetName != null && _self.assetName.length > 0) ? ('%' + _self.assetName + '%') : null,
-        no: (_self.cardNo != null && _self.cardNo.length > 0) ? ('%' + _self.cardNo + '%') : null,
-        pageStart: (_self.pagination.current_page - 1) * _self.pagination.per_page,
+        assetNo:
+          _self.assetNo != null && _self.assetNo.length > 0
+            ? '%' + _self.assetNo + '%'
+            : null,
+        assetName:
+          _self.assetName != null && _self.assetName.length > 0
+            ? '%' + _self.assetName + '%'
+            : null,
+        no:
+          _self.cardNo != null && _self.cardNo.length > 0
+            ? '%' + _self.cardNo + '%'
+            : null,
+        pageStart:
+          (_self.pagination.current_page - 1) * _self.pagination.per_page,
         pageLength: _self.pagination.per_page,
       };
 
-      SqlApi.execute('20220428_145050', parameter).then(successData => {
-        if (successData.errorCode == 0) {
-          _self.redrawAssetInstance(successData);
-        } else {
-          Notify.error('盘亏数据查询异常', successData.errorMessage, true);
-        }
-
-        _self.loading = false;
-      }, errorData => {
-        Common.processException(errorData);
-        _self.loading = false;
-      });
-    },
-
+      SqlApi.execute('20220428_145050', parameter).then(
+        successData => {
+          // console.log(successData, '222222');
+          if (successData.errorCode == 0) {
+            _self.redrawAssetInstance(successData);
+            _self.dataSource = successData.dataList;
+            _self.pagination.total = successData.totalSize;
+          } else {
+            Notify.error('盘亏数据查询异常', successData.errorMessage, true);
+          }
 
+          _self.loading = false;
+        },
+        errorData => {
+          Common.processException(errorData);
+          _self.loading = false;
+        },
+      );
+    },
 
     /**
-       * 重新绘制资产卡片
-       * @author YangZhiJie 20200806
-       */
-    redrawAssetInstance: function(data) {
+     * 重新绘制资产卡片
+     * @author YangZhiJie 20200806
+     */
+    redrawAssetInstance: function (data) {
       var _self = this;
       if (data.dataList != null) {
         data.dataList.forEach(element => {
@@ -288,182 +434,223 @@ export default {
       }
       _self.assetInventoryLines = data.dataList;
       _self.pagination.total = data.totalSize;
-      _self.pagination.last_page = Math.ceil(data.totalSize / _self.pagination.per_page);
+      _self.pagination.last_page = Math.ceil(
+        data.totalSize / _self.pagination.per_page,
+      );
       _self.totalCount = data.totalSize;
-      _self.fixedTableHeader();
+      // _self.fixedTableHeader();
     },
 
     /**
-       * 清空分页数据
-       * @author YangZhiJie 20200806
-       */
-    clearPageData: function() {
-      var data = {
-        dataList: [],
-        totalSize: 0,
-        range: {
-          start: 0,
-          length: this.pagination.per_page,
-        },
-      };
-      this.redrawAssetInstance(data);
-    },
+     * 清空分页数据
+     * @author YangZhiJie 20200806
+     */
+    // clearPageData: function () {
+    //   var data = {
+    //     dataList: [],
+    //     totalSize: 0,
+    //     range: {
+    //       start: 0,
+    //       length: this.pagination.per_page,
+    //     },
+    //   };
+    //   this.redrawAssetInstance(data);
+    // },
 
     /**
-       * 清空界面的搜索条件
-       * @author YangZhiJie 20200806
-       */
-    clearFilter: function() {
+     * 清空界面的搜索条件
+     * @author YangZhiJie 20200806
+     */
+    clearFilter: function () {
       this.assetName = null;
       this.assetNo = null;
       this.cardNo = null;
       this.getAssetInventoryLine();
     },
 
-
     /**
-       * 表格显示行数发生改变
-       * @author YangZhiJie 20200806
-       */
-    pageSizeChanged: function(newPageSize) {
-      this.pagination.per_page = newPageSize;
-      this.pagination.current_page = 1;
-      this.getAssetInventoryLine();
-    },
+     * 表格显示行数发生改变
+     * @author YangZhiJie 20200806
+     */
+    // pageSizeChanged: function (newPageSize) {
+    //   this.pagination.per_page = newPageSize;
+    //   this.pagination.current_page = 1;
+    //   this.getAssetInventoryLine();
+    // },
 
     /**
-       * 页数发生变化
-       * @author YangZhiJie 20200806
-       */
-    pageStartChanged: function() {
-      this.getAssetInventoryLine(true);
-    },
+     * 页数发生变化
+     * @author YangZhiJie 20200806
+     */
+    // pageStartChanged: function () {
+    //   this.getAssetInventoryLine(true);
+    // },
 
     /**
-       * 冻结表头
-       */
-    fixedTableHeader: function() {
-      var _self = this;
-      _self.$nextTick(function() {
-        $('.fixed-table').tableFixer({
-          'head': true,
-        });
-      });
-    },
+     * 冻结表头
+     */
+    // fixedTableHeader: function () {
+    //   var _self = this;
+    //   _self.$nextTick(function () {
+    //     $('.fixed-table').tableFixer({
+    //       head: true,
+    //     });
+    //   });
+    // },
 
     /**
-       * 打开资产卡片的CURD窗口
-       */
-    openCurdWindow: function(assetInventoryLine) {
-      let url = Common.getRedirectUrl('#/desktop/window/window-read/view/040701/0/' + assetInventoryLine.assetInstanceId +
-          '?currPage=1&currIndex=1&totalCount=1&uuid=' + Uuid.createUUID());
-      window.open(url);
+     * 打开资产卡片的CURD窗口
+     */
+    openCurdWindow: function (assetInventoryLine) {
+      let index = window.location.href.indexOf('#');
+      let url = window.location.href.slice(0, index);
+      let path =
+        url +
+        '#/desktop/window/window-read/view/040701/0/' +
+        assetInventoryLine.assetInstanceId +
+        '?currPage=1&currIndex=1&totalCount=1&uuid=' +
+        Uuid.createUUID();
+      // let url = Common.getRedirectUrl(
+      //   '#/desktop/window/window-read/view/040701/0/' +
+      //     assetInventoryLine.assetInstanceId +
+      //     '?currPage=1&currIndex=1&totalCount=1&uuid=' +
+      //     Uuid.createUUID(),
+      // );
+
+      window.open(path);
     },
 
     /**
-       * 获取使用状况
-       */
-    getUseStatusList: function() {
+     * 获取使用状况
+     */
+    getUseStatusList: function () {
       var _self = this;
-      UseStatusResource.getUseStatus().then(data => {
-        _self.useStatusList = data.datas;
-      }, xmlHttpRequest => {
-        Common.processException(xmlHttpRequest);
-      });
+      UseStatusResource.getUseStatus().then(
+        data => {
+          _self.useStatusList = data.datas;
+        },
+        xmlHttpRequest => {
+          Common.processException(xmlHttpRequest);
+        },
+      );
     },
-    next: function() {
+    next: function () {
       var _self = this;
       _self.$emit('next');
     },
-
+    // 回到上一步
+    previous: function () {
+      var _self = this;
+      _self.$emit('changeStep', {step:0});
+    },
     /**
-       * 更新资产盘点明细中的备注和使用状态。
-       */
-    updateAssetInventoryLine: function(assetInventoryLine, index) {
+     * 更新资产盘点明细中的备注和使用状态。
+     */
+    updateAssetInventoryLine: function (assetInventoryLine, index) {
       let _self = this;
-      if ((assetInventoryLine.description == null || assetInventoryLine.description === '') ||
-          ((assetInventoryLine.useStatusId == null || assetInventoryLine.useStatusId === ''))) {
+      if (
+        assetInventoryLine.description == null ||
+        assetInventoryLine.description === '' ||
+        assetInventoryLine.useStatusId == null ||
+        assetInventoryLine.useStatusId === ''
+      ) {
         Notify.error('错误', '请填写"盘点使用状态"和"备注"信息\'。');
         return;
       }
-      AssetInventoryLineResource.checkLossConfirm(assetInventoryLine.assetInventoryLineId, assetInventoryLine.description,
-        true, assetInventoryLine.useStatusId).then(data => {
-        if (data.errorCode == 0) {
-          if(assetInventoryLine.useStatusId != null && assetInventoryLine.useStatusId != ''){
-            _self.assetInventoryLines.splice(index, 1);
-            _self.pagination.total = _self.pagination.total - 1;
-            _self.pagination.last_page = Math.ceil(_self.pagination.total / _self.pagination.per_page);
+      AssetInventoryLineResource.checkLossConfirm(
+        assetInventoryLine.assetInventoryLineId,
+        assetInventoryLine.description,
+        true,
+        assetInventoryLine.useStatusId,
+      ).then(
+        data => {
+          if (data.errorCode == 0) {
+            if (
+              assetInventoryLine.useStatusId != null &&
+              assetInventoryLine.useStatusId != ''
+            ) {
+              _self.assetInventoryLines.splice(index, 1);
+              _self.pagination.total = _self.pagination.total - 1;
+              _self.pagination.last_page = Math.ceil(
+                _self.pagination.total / _self.pagination.per_page,
+              );
+            }
+          } else {
+            Notify.error('错误', '该盘点明细已经被删除,请确认');
           }
-        } else {
-          Notify.error('错误', '该盘点明细已经被删除,请确认');
-        }
-      }, errorData => {
-        Common.processException(errorData);
-      });
+        },
+        errorData => {
+          Common.processException(errorData);
+        },
+      );
     },
   },
 };
 </script>
 
 <style scoped>
-  .grid-container {
-    margin-top: 10px;
-    display: grid;
-    grid-template-columns: auto;
-    grid-template-rows: auto 1fr 40px;
-    gap: 10px;
-    justify-items: stretch;
-    align-items: stretch;
-    height: calc(100vh - 170px);
-    overflow: auto;
-  }
-
-  .grid-item-row1 {
-    grid-row-start: 1;
-    grid-row-end: 2;
-    grid-column-start: 1;
-    grid-column-end: 2;
-  }
-
-  .grid-item-row2 {
-    grid-row-start: 2;
-    grid-row-end: 3;
-    grid-column-start: 1;
-    grid-column-end: 2;
-    overflow: auto;
-  }
-
-  .grid-item-row3 {
-    grid-row-start: 3;
-    grid-row-end: 4;
-    grid-column-start: 1;
-    grid-column-end: 2;
-  }
+.grid-container {
+  margin-top: 10px;
+  display: grid;
+  grid-template-columns: auto;
+  grid-template-rows: auto 1fr 40px;
+  gap: 10px;
+  justify-items: stretch;
+  align-items: stretch;
+  height: calc(100vh - 170px);
+  overflow: auto;
+}
+
+.grid-item-row1 {
+  grid-row-start: 1;
+  grid-row-end: 2;
+  grid-column-start: 1;
+  grid-column-end: 2;
+}
+
+/* .grid-item-row2 {
+  grid-row-start: 2;
+  grid-row-end: 3;
+  grid-column-start: 1;
+  grid-column-end: 2;
+  overflow: auto;
+} */
+
+.grid-item-row3 {
+  grid-row-start: 3;
+  grid-row-end: 4;
+  grid-column-start: 1;
+  grid-column-end: 2;
+}
 </style>
 
 <style scoped>
-  .m-grid-footer {
-    padding: 10px;
-  }
-
-  .m-panel {
-    margin-bottom: 0px;
-  }
-
-  .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;
-  }
+.common {
+  margin-left: 8px;
+}
+
+.m-grid-footer {
+  padding: 10px;
+}
+
+.m-panel {
+  margin-bottom: 0px;
+}
+
+.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;
+}
 </style>