408249787 před 2 roky
rodič
revize
3aca65dc2a

+ 76 - 57
src/views/sb/change-record/modules/SbChangeRecordSelectModal.vue

@@ -1,60 +1,58 @@
 <template>
   <a-modal
-    :title='modalTitle'
-    :width='1000'
-    :visible='visible'
-    :confirmLoading='confirmLoading'
-    class='ant-modal2'
-    @cancel='handleCancel'
+    :title="modalTitle"
+    :width="1300"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    class="ant-modal2"
+    @cancel="handleCancel"
   >
-    <a-card :bordered='false'>
-      <div class='table-page-search-wrapper'>
-        <a-form layout='inline'>
-          <a-row :gutter='48'>
-            <a-col :md='6' :sm='24'>
-              <a-form-item label='关键字'>
-                <a-input v-model='queryParam.keyword' placeholder='请输入名称/类型名称' />
+    <a-card :bordered="false">
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline">
+          <a-row :gutter="48">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="关键字">
+                <a-input v-model="queryParam.keyword" placeholder="请输入名称/类型名称" />
               </a-form-item>
             </a-col>
-            <a-col :md='6 || 24' :sm='24'>
-                            <span class='table-page-search-submitButtons'>
-                                <a-button type='primary' @click='$refs.table.refresh(true)'>查询</a-button>
-                                <a-button style='margin-left: 8px' @click='resetSearchForm'>重置</a-button>
-                                <a @click='()=>{ this.advanced = !this.advanced}' style='margin-left: 8px'>
-                                  {{ advanced ? '收起' : '展开' }}
-                                  <a-icon :type="advanced ? 'up' : 'down'" />
-                                </a>
-                            </span>
+            <a-col :md="6 || 24" :sm="24">
+              <span class="table-page-search-submitButtons">
+                <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
+                <a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
+                <a @click="()=>{ this.advanced = !this.advanced}" style="margin-left: 8px">
+                  {{ advanced ? '收起' : '展开' }}
+                  <a-icon :type="advanced ? 'up' : 'down'" />
+                </a>
+              </span>
             </a-col>
           </a-row>
         </a-form>
       </div>
 
-      <div class='table-operator'>
-      </div>
-
       <s-table
-        ref='table'
-        size='default'
-        rowKey='id'
-        :columns='columns'
-        :data='loadData'
-        :alert='options.alert'
-        :customRow='options.customRow'
-        :rowSelection='options.rowSelection'
-        showPagination='auto'
+        ref="table"
+        size="default"
+        rowKey="id"
+        :columns="columns"
+        :data="loadData"
+        :alert="options.alert"
+        :customRow="options.customRow"
+        :rowSelection="options.rowSelection"
+        :scroll="{x: 1200, y: BaseTool.Constant.scrollY}"
+        showPagination="auto"
       >
-                <span slot='action' slot-scope='record1'>
-                  <template>
-                    <a @click='handleView(record1)'>查看</a>
-                  </template>
-                </span>
+        <span slot="action" slot-scope="record1">
+          <template>
+            <a @click="handleView(record1)">查看</a>
+          </template>
+        </span>
       </s-table>
-      <detail ref='detailModal' />
+      <detail ref="detailModal" />
     </a-card>
-    <template slot='footer'>
-      <a-button :loading='confirmLoading' type='primary' @click='handleCancel()'>取消</a-button>
-      <a-button :loading='confirmLoading' type='primary' @click='handleSelect()'>确定</a-button>
+    <template slot="footer">
+      <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">取消</a-button>
+      <a-button :loading="confirmLoading" type="primary" @click="handleSelect()">确定</a-button>
     </template>
   </a-modal>
 </template>
@@ -89,7 +87,7 @@ export default {
       }
     }
   },
-  data() {
+  data () {
     return {
       advanced: false,
       confirmLoading: false,
@@ -105,55 +103,75 @@ export default {
         {
           title: '序号',
           dataIndex: 'index',
+          width: 50,
           customRender: (text, record, index) => {
             return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
           }
         },
         {
+          width: 150,
           title: '记录人',
           dataIndex: 'createdUserName'
         },
         {
+          width: 150,
+
           title: '设备ID',
           dataIndex: 'sbId'
         },
         {
+          width: 150,
+          title: '设备名称',
+          dataIndex: 'sbName'
+        },
+        {
+          width: 150,
+
           title: '更改内容',
           dataIndex: 'content'
         },
         {
+          width: 150,
           title: '原设备位置',
           dataIndex: 'oldPositionId'
         },
         {
+          width: 150,
           title: '修改后设备位置',
           dataIndex: 'positionId'
         },
         {
+          width: 150,
           title: '位号',
           dataIndex: 'sbNoId'
         },
         {
+          width: 150,
           title: '原父设备ID',
           dataIndex: 'oldParentId'
         },
         {
+          width: 150,
           title: '修改后父设备ID',
           dataIndex: 'parentId'
         },
         {
+          width: 150,
           title: '记录时间',
           dataIndex: 'createdTime'
         },
         {
+          width: 150,
           title: '开始时间',
           dataIndex: 'startTime'
         },
         {
+          width: 150,
           title: '结束时间',
           dataIndex: 'endTime'
         },
         {
+          width: 150,
           title: '更改类型 1 位置 2 位号 3 父设备',
           dataIndex: 'changeType',
           customRender: (text, record, index) => {
@@ -190,7 +208,8 @@ export default {
 
       options: {
         alert: {
-          show: true, clear: () => {
+          show: true,
+          clear: () => {
             this.selectedRowKeys = []
           }
         },
@@ -203,15 +222,16 @@ export default {
       isCreated: false
     }
   },
-  created() {
+  created () {
     // 下拉框map
   },
   methods: {
-    tableOption() {
+    tableOption () {
       if (!this.optionAlertShow) {
         this.options = {
           alert: {
-            show: true, clear: () => {
+            show: true,
+            clear: () => {
               this.selectedRowKeys = []
             }
           },
@@ -250,24 +270,24 @@ export default {
         this.optionAlertShow = false
       }
     },
-    handleView(record) {
+    handleView (record) {
       fetchSbChangeRecord({ id: record.id }).then(res => {
         const modal = this.$refs.detailModal
         modal.base(res.data)
       })
     },
-    handleOk() {
+    handleOk () {
       this.$refs.table.refresh()
     },
-    onSelectChange(selectedRowKeys, selectedRows) {
+    onSelectChange (selectedRowKeys, selectedRows) {
       this.selectedRowKeys = selectedRowKeys
       this.selectedRows = selectedRows
     },
-    resetSearchForm() {
+    resetSearchForm () {
       this.queryParam = {}
       this.$refs.table.refresh(true)
     },
-    base(record, queryParam = {}) {
+    base (record, queryParam = {}) {
       this.visible = true
       this.modalTitle = '选择信息'
       this.extraQueryParam = queryParam
@@ -281,11 +301,11 @@ export default {
         this.isCreated = true
       }
     },
-    handleCancel() {
+    handleCancel () {
       this.visible = false
       this.confirmLoading = false
     },
-    handleSelect() {
+    handleSelect () {
       if (this.selectedRowKeys.length === 0) {
         this.$message.warn('请至少选择一项信息')
       } else {
@@ -295,7 +315,7 @@ export default {
         this.visible = false
       }
     },
-    mySelect(selectedRowKeys, selectedRows) {
+    mySelect (selectedRowKeys, selectedRows) {
       if (this.type === 'radio') {
         this.$refs.table.updateSelect(selectedRowKeys, selectedRows)
         this.$refs.table.rowSelection.onChange(selectedRowKeys, selectedRows)
@@ -311,7 +331,6 @@ export default {
         this.$refs.table.updateSelect(mySelectedRowKeys, mySelectedRows)
         this.$refs.table.rowSelection.onChange(mySelectedRowKeys, mySelectedRows)
       }
-
     }
   }
 }

+ 13 - 3
src/views/sb/info/SbInfo.vue

@@ -195,6 +195,9 @@
               :scroll="{x: 1500, y: BaseTool.Constant.scrollY}"
               showPagination="auto"
             >
+              <template #positionNo="text,record">
+                <a @click="showChangeLog(record)">{{ text }}</a>
+              </template>
               <span slot="action" slot-scope="record">
                 <template>
                   <div>
@@ -260,6 +263,7 @@
     <detail-sb-measure ref="detailSbMeasureModal" @ok="handleOk"/>
     <base-form-measure ref="baseModalMeasure" @ok="handleOk"/>
     <base-form-location ref="baseFormLocation" @ok="handleOk" />
+    <SbChangeRecordSelectModal ref="sbChangeRecordSelectModal" @ok="handleOk" />
   </div>
 </template>
 
@@ -283,7 +287,7 @@ import ImportFormUpdate from './modules/ImportFormUpdate'
 import PrintSbCode from '@/views/sb/info/modules/PrintSbCode'
 import PrintInSbInfoBatch from '@/views/sb/info/modules/PrintInSbInfoBatch'
 import { querySbPosition } from '@/api/sb/position'
-
+import SbChangeRecordSelectModal from '@/views/sb/change-record/modules/SbChangeRecordSelectModal'
 export default {
   name: 'SbInfoList',
   components: {
@@ -301,7 +305,8 @@ export default {
     PrintInSbInfoBatch,
     BaseFormMeasure,
     BaseFormLocation,
-    BaseFormStatusLog
+    BaseFormStatusLog,
+    SbChangeRecordSelectModal
   },
   props: {
     filter: {
@@ -394,6 +399,7 @@ export default {
           title: '设备位号',
           dataIndex: 'positionNo',
           width: 150,
+          scopedSlots: { customRender: 'positionNo' },
           checked: true
         },
         {
@@ -767,7 +773,11 @@ export default {
         modal.base(res.data)
       })
     },
-
+    showChangeLog (record) {
+      console.log(record)
+      console.log(this.$refs)
+      this.$refs.sbChangeRecordSelectModal.base({}, { sbId: record.id })
+    },
     handleCopy (record) {
       this.visible = false
       fetchSbInfo({ id: record.id }).then(res => {