소스 검색

检测计划关联设备

yuedefeng 6 년 전
부모
커밋
919431a52c
1개의 변경된 파일127개의 추가작업 그리고 32개의 파일을 삭제
  1. 127 32
      src/dashoo.cn/frontend_web/src/pages/lims/taskplan/_opera/operation.vue

+ 127 - 32
src/dashoo.cn/frontend_web/src/pages/lims/taskplan/_opera/operation.vue

@@ -73,7 +73,7 @@
           </el-col>
           <el-col :span="8" v-if="!tjz">
             <el-form-item label="检测地点" required>
-              <el-select ref="refAddress" v-model="mainForm.AddressId" style="width:100%" placeholder="请选择检测地点">
+              <el-select ref="refAddress" v-model="mainForm.AddressId" style="width:100%" placeholder="请选择检测地点" @change="AddressChangeHandler">
                 <el-option v-for="item in addressList" :key="item.Id" :label="item.PositionName" :value="item.Id">
                 </el-option>
               </el-select>
@@ -155,34 +155,13 @@
 
       </el-form>
 
-      <el-table
-        :data="tableData2"
-        stripe
-        style="width: 100%">
-        <el-table-column
-          prop="seqNo"
-          label="序号"
-        >
-        </el-table-column>
-        <el-table-column
-          prop="name"
-          label="设备分类"
-        >
-        </el-table-column>
-        <el-table-column
-          prop="address"
-          label="地点名称"
-          width="180">
-        </el-table-column>
-        <el-table-column
-          prop="address2"
-          label="设备厂家">
-        </el-table-column>
-        <el-table-column
-          prop="address3"
-          label="设备型号">
-        </el-table-column>
+      <el-table :data="entityList" border height="calc(100vh - 243px)" style="width: 100%" @sort-change="orderby">
+        <el-table-column v-for="column in tableColumns" :key="column.Id"
+                         v-if="column.prop != 'CreateOn'" :prop="column.prop" sortable min-width="100" :label="column.label" align="center" show-overflow-tooltip></el-table-column>
       </el-table>
+      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
+                     :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
+      </el-pagination>
     </el-card>
   </div>
 </template>
@@ -191,9 +170,10 @@
   import {
     mapGetters
   } from 'vuex'
-  import axios from "../../../../../.nuxt/axios";
-  import docTemplateApi from '@/api/lims/docTemplate';
-  import entrustApi from "@/api/lims/limsentrust";
+  import axios from "../../../../../.nuxt/axios"
+  import docTemplateApi from '@/api/lims/docTemplate'
+  import entrustApi from "@/api/lims/limsentrust"
+  import checkEquipmentApi from '@/api/lims/limscheckequipmentlist'
   export default {
     computed: {
       ...mapGetters({
@@ -284,6 +264,63 @@
           DataTemplateId: 0,
           DataTemplateName: '',
         },
+        tableColumns: [
+          {
+            prop: 'TemplateTypeName',
+            label: '检测报告',
+            width: 200,
+            sort: true
+          },
+
+          {
+            prop: 'OrderNo',
+            label: '序号',
+            width: 100,
+            sort: true
+          },
+
+          {
+            prop: 'CustNo',
+            label: '编号',
+            width: 100,
+            sort: true
+          },
+
+          {
+            prop: 'Spec',
+            label: '规格型号',
+            width: 100,
+            sort: true
+          },
+
+          {
+            prop: 'Manufacturer',
+            label: '制造厂家',
+            width: 200,
+            sort: true
+          },
+          {
+            prop: 'PositionCheck',
+            label: '检测地点',
+            width: 200,
+            sort: true
+          },
+
+          {
+            prop: 'Position',
+            label: '安装位置',
+            width: 200,
+            sort: true
+          },
+
+          {
+            prop: 'DepartmentName',
+            label: '所属单位',
+            width: 200,
+            sort: true
+          }
+
+        ],
         TestSampleNum: 0,
         rulesmainForm: {
           EntrustNo: [{
@@ -368,6 +405,15 @@
         deliverList: [],
         deliverTitle: '',
         deliver_flag: '',
+        //分页参数
+        size: 10,
+        currentPage: 1,
+        currentItemCount: 0,
+        //列表排序
+        Column: {
+          Order: '',
+          Prop: ''
+        },
         sampleForm: {
           Id: '',
           EId: '',
@@ -407,6 +453,7 @@
             trigger: 'blur'
           }],
         },
+        entityList: [],
         detail_flag: true,
         transportDialog: false,
         detailsDialog: false,
@@ -468,6 +515,8 @@
       this.ServiceId = this.$route.params.opera
       this.departmentId = this.authUser.Profile.DepartmentId
 
+      this.initDeviceList()
+
       this.getCustomerInfo()
       // request
       if (this.ServiceId === 'add') {
@@ -887,6 +936,47 @@
           })
       },
 
+      initDeviceList () {
+        // 分页及列表条件
+        let params = {
+          _currentPage: this.currentPage,
+          _size: this.size,
+          Order: this.Column.Order,
+          Prop: this.Column.Prop,
+          TemplateTypeId: this.mainForm.ProjectTypeId,
+          PositionCheckId: this.mainForm.AddressId
+        }
+
+        //访问接口
+        checkEquipmentApi.getList('', params, this.$axios).then(res => {
+          this.entityList = res.data.items
+          this.currentItemCount = res.data.currentItemCount
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+
+      //列表排序功能
+      orderby(column) {
+        if (column.order == 'ascending') {
+          this.Column.Order = 'asc'
+        } else if (column.order == 'descending') {
+          this.Column.Order = 'desc'
+        }
+        this.Column.Prop = column.prop
+        this.initDeviceList()
+      },
+
+      handleCurrentChange (value) {
+        this.currentPage = value
+        this.initDeviceList()
+      },
+      handleSizeChange (value) {
+        this.size = value
+        this.currentPage = 1
+        this.initDeviceList()
+      },
+
       //ln
       deletetesttype(val) {
         let _this = this;
@@ -1301,11 +1391,16 @@
         })
       },
 
-      SampleTypeChangeHandler() {
+      SampleTypeChangeHandler () {
         this.mainForm.DetectSampleId = ''
         this.selectedorg = []
         this.getCode()
         this.getSampleType()
+        this.initDeviceList()
+      },
+
+      AddressChangeHandler () {
+        this.initDeviceList()
       },
 
       // 获取样品数量单位