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

设备放开新增删除权限——设置有些不能删除未改完

LLL 1 год назад
Родитель
Сommit
4589599e63

+ 43 - 28
itdmWeb/src/views/module-iTDM/itdmDevice/ItdmDeviceList.vue

@@ -43,7 +43,7 @@
 
     <!-- 操作按钮区域 -->
     <div class="table-operator">
-<!--      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>-->
+      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
       <a-button type="primary" icon="download" @click="handleExportXls('设备表')">导出</a-button>
 <!--      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">-->
 <!--        <a-button type="primary" icon="import">导入</a-button>-->
@@ -99,29 +99,34 @@
           </a-button>
         </template>
 
+
         <span slot="action" slot-scope="text, record">
           <a @click="handleEdit(record)">编辑</a>
 
-<!--          <a-divider type="vertical" />-->
-<!--          <a-dropdown>-->
-<!--            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>-->
-<!--            <a-menu slot="overlay">-->
-<!--              <a-menu-item>-->
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
 <!--                <a @click="handleDetail(record)">详情</a>-->
-<!--              </a-menu-item>-->
-<!--              <a-menu-item>-->
-<!--                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">-->
-<!--                  <a>删除</a>-->
-<!--                </a-popconfirm>-->
-<!--              </a-menu-item>-->
-<!--            </a-menu>-->
-<!--          </a-dropdown>-->
-        </span>
-        <span slot="action2" slot-scope="text, item">
-          <a-popconfirm :title="item.deviceStatus == 3 ? '确定取消设备故障吗': '确定设备出现故障吗'" @confirm="() => handleGuzhang(item)">
-            <a>{{item.deviceStatus == 3 ? '非故障': '故障'}}</a>
-          </a-popconfirm>
+                <a-popconfirm :title="record.deviceStatus == 3 ? '确定取消设备故障吗': '确定设备出现故障吗'" @confirm="() => handleGuzhang(record)">
+                  <a>{{record.deviceStatus == 3 ? '取消故障状态': '设为故障状态'}}</a>
+                </a-popconfirm>
+              </a-menu-item>
+
+              <a-menu-item>
+                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id) ">
+                  <a>{{record.izDelete == 0 ? '不可删除': '删除'}}</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
         </span>
+<!--        <span slot="action2" slot-scope="text, item">-->
+<!--          <a-popconfirm :title="item.deviceStatus == 3 ? '确定取消设备故障吗': '确定设备出现故障吗'" @confirm="() => handleGuzhang(item)">-->
+<!--            <a>{{item.deviceStatus == 3 ? '非故障': '故障'}}</a>-->
+<!--          </a-popconfirm>-->
+<!--        </span>-->
 
       </a-table>
     </div>
@@ -171,9 +176,14 @@
             dataIndex: 'deviceName'
           },
           {
-            title:'设备类型',
+            title:'重要性标准',
             align:"center",
-            dataIndex: 'deviceType'
+            dataIndex: 'zyxbz_dictText'
+          },
+          {
+            title:'试验单价',
+            align:"center",
+            dataIndex: 'danjia'
           },
           {
             title:'设备编号',
@@ -196,6 +206,11 @@
             dataIndex: 'deviceStatus_dictText'
           },
           {
+            title:'设备类型',
+            align:"center",
+            dataIndex: 'deviceType'
+          },
+          {
             title:'维护时间',
             align:"center",
             dataIndex: 'repairTime'
@@ -235,13 +250,13 @@
             align:"center",
             dataIndex: 'updateTime'
           },
-          {
-            title: '故障判断',
-            dataIndex: 'action2',
-            align:"center",
-            fixed:"right",
-            scopedSlots: { customRender: 'action2' }
-          },
+          // {
+          //   title: '故障判断',
+          //   dataIndex: 'action2',
+          //   align:"center",
+          //   fixed:"right",
+          //   scopedSlots: { customRender: 'action2' }
+          // },
           {
             title: '操作',
             dataIndex: 'action',

+ 21 - 13
itdmWeb/src/views/module-iTDM/itdmDevice/modules/ItdmDeviceForm.vue

@@ -9,18 +9,23 @@
             </a-form-model-item>
           </a-col>
           <a-col :span="24">
-            <a-form-model-item label="设备类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deviceType">
-              <a-input v-model="model.deviceType" placeholder="请输入设备类型" :disabled="editdisabled" ></a-input>
+            <a-form-model-item label="设备状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deviceStatus">
+              <j-dict-select-tag type="list" v-model="model.deviceStatus" dictCode="device_status" placeholder="请选择设备状态" :disabled="editdisabled"/>
             </a-form-model-item>
           </a-col>
           <a-col :span="24">
-            <a-form-model-item label="设备编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deviceNo">
-              <a-input v-model="model.deviceNo" placeholder="请输入设备编号"  ></a-input>
+            <a-form-model-item label="重要性标准" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="zyxbz">
+              <j-dict-select-tag type="list" v-model="model.zyxbz" dictCode="shiyan_shebe_type" placeholder="请选择重要性标准"/>
             </a-form-model-item>
           </a-col>
           <a-col :span="24">
-            <a-form-model-item label="设备状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deviceStatus">
-              <j-dict-select-tag type="list" v-model="model.deviceStatus" dictCode="device_status" placeholder="请选择设备状态" :disabled="editdisabled"/>
+            <a-form-model-item label="试验单价" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="danjia">
+              <a-input v-model="model.danjia" placeholder="请输入试验单价"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="设备编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deviceNo">
+              <a-input v-model="model.deviceNo" placeholder="请输入设备编号"  ></a-input>
             </a-form-model-item>
           </a-col>
           <a-col :span="24">
@@ -49,6 +54,11 @@
             </a-form-model-item>
           </a-col>
           <a-col :span="24">
+            <a-form-model-item label="设备类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deviceType">
+              <a-input v-model="model.deviceType" placeholder="请输入设备类型" :disabled="editdisabled"></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
             <a-form-model-item label="计量有效期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="deviceLife">
               <a-input v-model="model.deviceLife" placeholder="请输入计量有效期"  ></a-input>
             </a-form-model-item>
@@ -85,15 +95,11 @@
         default: false,
         required: false
       },
-      //禁止编辑
-      editdisabled: {
-        type: Boolean,
-        default: false,
-        required: false
-      }
     },
     data () {
       return {
+        //禁止编辑
+        editdisabled: true,
         model:{
          },
         labelCol: {
@@ -134,9 +140,11 @@
     },
     methods: {
       add () {
-  this.edit(this.modelDefault);
+        this.editdisabled= false
+        this.edit(this.modelDefault);
       },
       edit (record) {
+        console.log("编辑record",record)
         this.model = Object.assign({}, record);
         this.visible = true;
       },