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

设备档案卡及列表的优化和调整

luoaoxuan 1 год назад
Родитель
Сommit
b90e8980f3

+ 1 - 1
src/components/ibps-crud/index.vue

@@ -127,7 +127,7 @@
                     v-if="(selectionRow || selectionRow === '') && selectionType === 'checkbox'"
                     v-bind="typeof selectionRow === 'Object'?selectionRow:null"
                     :label="handleAttribute(selectionRow.label, '')"
-                    :reserve-selection="selectionRow.reserveSelectione||false"
+                    :reserve-selection="selectionRow.reserveSelectione||true"
                     type="selection"
                     show-overflow-tooltip
                 />

+ 12 - 1
src/views/component/device/deviceDialog.vue

@@ -152,6 +152,9 @@
                                     </el-col>
                                     <el-col :span="8">
                                         <el-form-item label="接收时状态:" prop="jieShouZhuangTai">
+                                            <template slot="label">
+                                                <span class="required">接收时状态:</span>
+                                            </template>
                                             <el-select v-model="form.jieShouZhuangTai" placeholder="请选择" size="mini" style="width:100%">
                                                 <el-option
                                                     v-for="item in ['新设备','二手或翻新设备']"
@@ -534,6 +537,13 @@
                                                         </el-form-item>
                                                     </el-col>
                                                 </el-row>
+                                                <el-row v-if="form.shiFouXiaoZhun==='是'">
+                                                    <el-col>
+                                                        <el-form-item label="检定/校准单位">
+                                                            <el-input v-model="form.shiYongKeShi" size="mini" />
+                                                        </el-form-item>
+                                                    </el-col>
+                                                </el-row>
                                                 <el-row v-if="form.shiFouXiaoZhun==='是'">
                                                     <el-col>
                                                         <el-form-item label="最近校准时间:">
@@ -806,6 +816,7 @@ export default {
                 zhengShuBianHa: '', // 校准证书编号
                 xiaoZhunWuCha: '', // 是否限用
                 xiaoZhunZQ: '', // 检定/校准周期
+                shiYongKeShi: '', // 检定/校准单位
                 yuanSheBeiBian: '', // 原设备编号
                 jianKongYiJu: '', // 是否24H开机
                 biXuDeHuanJin: '', // 核查人
@@ -829,7 +840,7 @@ export default {
                 quanXianLeiXing: '',
                 diDian: '',
                 buMen: '', // 图片id
-                ceLiangGongZuo: '', // 测量/工作范围
+                ceLiangGongZuo: '', // 测量范围
                 jianDingXiao: '', // 检定/校准参数
                 xiuZhengZhiXiu: '', // 修正值
                 zuiDaYunCha: '', // U/精确度/最大允差

+ 37 - 16
src/views/component/device/index.vue

@@ -479,24 +479,24 @@ export default {
                 // 表格字段配置
                 columns: [
                     { type: 'expand', slotName: 'expandSlot' },
-                    { prop: 'bianZhiBuMen', label: '部门', slotName: 'posSlot' },
-                    { prop: 'shiFouGuoShen', label: '状态' },
-                    { prop: 'sheBeiShiBieH', label: '设备编号' },
-                    { prop: 'yuanSheBeiBian', label: '原设备编号' },
-                    { prop: 'sheBeiMingCheng', label: '设备名称' },
-                    { prop: 'sheBeiLeiXing', label: '设备类型' },
-                    { prop: 'guiGeXingHao', label: '规格型号' },
-                    { prop: 'sheBeiZhuangTa', label: '设备状态' },
-                    { prop: 'guanLiRen', label: '保管人', slotName: 'userSlot' },
-                    { prop: 'weiHuFangShi', label: '设备分组', slotName: 'deviceSlot' },
-                    { prop: 'cunFangWeiZhi', label: '放置地点', slotName: 'placeSlot' },
+                    { prop: 'bianZhiBuMen', label: '部门', slotName: 'posSlot', sortable: true },
+                    { prop: 'bianZhiShiJian', label: '建档时间', sortable: true },
+                    { prop: 'sheBeiShiBieH', label: '设备编号', sortable: true },
+                    { prop: 'yuanSheBeiBian', label: '原设备编号', sortable: true },
+                    { prop: 'sheBeiMingCheng', label: '设备名称', sortable: true },
+                    { prop: 'sheBeiLeiXing', label: '设备类型', sortable: true },
+                    { prop: 'guiGeXingHao', label: '规格型号', sortable: true },
+                    { prop: 'sheBeiZhuangTa', label: '设备状态', sortable: true },
+                    { prop: 'guanLiRen', label: '保管人', slotName: 'userSlot', sortable: true },
+                    { prop: 'weiHuFangShi', label: '设备分组', slotName: 'deviceSlot', sortable: true },
+                    { prop: 'cunFangWeiZhi', label: '放置地点', slotName: 'placeSlot', sortable: true },
                     { prop: '', label: '操作', width: 130, slotName: 'customButton' }
                 ]
             },
             pagination: {
                 limit: 20, page: 1
             },
-            sorts: {},
+            sorts: [{ field: 'BIAN_ZHI_SHI_JIAN', order: 'desc' }],
             sqlWhere: {},
             searchWhere: {},
             deviceColumns: {
@@ -516,7 +516,7 @@ export default {
                 chuChangRiQi: '出厂日期',
                 jiShenXuHao: '机身序号',
                 zhuCeZhengHao: '注册证号',
-                ceLiangGongZuo: '测量/工作范围',
+                ceLiangGongZuo: '测量范围',
                 huanJingYaoQiu: '环境要求',
                 dianYuanYaoQiu: '电源要求',
                 yanShouRiQi: '验收日期',
@@ -716,9 +716,8 @@ export default {
                     pageNo: this.pagination.page,
                     limit: this.pagination.limit
                 },
-                sorts: [
-                    { field: 'bian_zhi_shi_jian', order: 'desc' }
-                ] }
+                sorts: this.sorts
+            }
             if (parameters.parameters.length > 0) {
                 params.parameters = [parameters]
             }
@@ -790,6 +789,28 @@ export default {
         },
         // 处理排序
         handleSortChange (sort) {
+            function removeUnderscores (str) {
+                return str.replace(/^_+|_+$/g, '')
+            }
+            const { order, sortBy } = sort
+            let s = ''
+            switch (sortBy) {
+                case 'BIAN_ZHI_SHI_JIAN_':
+                case 'SHE_BEI_SHI_BIE_H_':
+                case 'YUAN_SHE_BEI_BIAN_':
+                case 'SHE_BEI_ZHUANG_TA_':
+                    s = removeUnderscores(sortBy)
+                    break
+                default:
+                    s = sortBy
+            }
+            let o = null
+            if (order === 'descending') {
+                o = 'desc'
+            } else if (order === 'ascending') {
+                o = 'asc'
+            }
+            this.sorts = [{ field: s, order: o }]
             this.getDatas()
         },
         handleCustomAdd () {