浏览代码

task-5497 设备相关记录的关联条件调整,原设备编号只读权限控制

cyy 4 月之前
父节点
当前提交
c25423ece8

+ 1 - 0
src/views/component/device/ConfirmationRecord.vue

@@ -174,6 +174,7 @@ export default {
       } = await calibrateResultRecord({
         requestPage: this.requestPage,
         parameters: [
+          { key: 'Q^yuan_she_bei_bian^S', value: this.params.yuanSheBeiBian },
           { key: 'Q^ming_cheng_^S', value: this.params.id },
           { key: 'Q^shi_fou_guo_shen_^S', value: '已完成' }
         ],

+ 1 - 0
src/views/component/device/calibrationCheckRecord.vue

@@ -96,6 +96,7 @@ export default {
         requestPage: this.requestPage,
         parameters: [
           { key: 'Q^she_bei_bian_hao_^S', value: this.params.id },
+          { key: 'Q^yuan_she_bei_bian^S', value: this.params.yuanSheBeiBian },
           { key: 'Q^marks_^S', value: 'record' },
           { key: 'Q^shi_shi_ri_qi_^SNE', value: 'value' } // 过滤空值 value需有值
         ],

+ 34 - 24
src/views/component/device/deviceDialog.vue

@@ -137,7 +137,11 @@
                         >
                       </template>
                       <el-input
-                        v-if="!readonly"
+                        v-if="
+                          !readonly &&
+                          (!originalEditReadOnly ||
+                            actionDialog === 'customAdd')
+                        "
                         v-model="form.yuanSheBeiBian"
                         size="mini"
                       />
@@ -1162,6 +1166,10 @@ export default {
       type: Boolean,
       default: false
     },
+    actionDialog: {
+      type: String,
+      default: ''
+    },
     params: {
       type: Object,
       default: function () {
@@ -1308,6 +1316,7 @@ export default {
       Ids: [],
       showzhuCeYouXiaoQi: false,
       dynamicRequiredFields: false,
+      originalEditReadOnly: false,
       form: {
         gouJinRiQi: '', // 购进日期
         changShang: '', // 厂家/品牌
@@ -1677,32 +1686,32 @@ export default {
     goSave(flag) {
       this.$refs.form.validate(async (valid) => {
         this.$refs.formBase.validate(async (validBase) => {
-        if (valid&&validBase) {
-          try {
-            // 维护项目
-            this.form.maintenanceItemPoList =
-              this.$refs.MaintenanceRef?.[0]?.listDataCopy ||
-              this.form.maintenanceItemPoList ||
-              []
-            // 附属设备及配件
-            this.form.accessoriesDevicePoList =
-              this.$refs.MoreDevicesRef?.[0]?.listDataCopy ||
-              this.form.accessoriesDevicePoList ||
-              []
-            await this.checkRequired()
-            if (this.isEdit) {
-              this.goEdit(flag)
-            } else {
-              this.goAdd()
+          if (valid && validBase) {
+            try {
+              // 维护项目
+              this.form.maintenanceItemPoList =
+                this.$refs.MaintenanceRef?.[0]?.listDataCopy ||
+                this.form.maintenanceItemPoList ||
+                []
+              // 附属设备及配件
+              this.form.accessoriesDevicePoList =
+                this.$refs.MoreDevicesRef?.[0]?.listDataCopy ||
+                this.form.accessoriesDevicePoList ||
+                []
+              await this.checkRequired()
+              if (this.isEdit) {
+                this.goEdit(flag)
+              } else {
+                this.goAdd()
+              }
+            } catch (error) {
+              this.$message.warning(error.message)
             }
-          } catch (error) {
-            this.$message.warning(error.message)
+          } else {
+            return this.$message.warning('请填写必填项!')
           }
-        } else {
-          return this.$message.warning('请填写必填项!')
-        }
+        })
       })
-    })
     },
     // 刷新
     async goRefresh() {},
@@ -1735,6 +1744,7 @@ export default {
       const deviceres = await getSetting('device')
       this.showzhuCeYouXiaoQi = deviceres?.showzhuCeYouXiaoQi || false
       this.dynamicRequiredFields = deviceres?.requiredField || false
+      this.originalEditReadOnly = deviceres?.originalEditReadOnly || false
       if (this.hideSysDeviceNo) {
         this.rules.yuanSheBeiBian[0].message = '设备编号不能为空'
       }

+ 6 - 2
src/views/component/device/index.vue

@@ -390,6 +390,7 @@
       :has-fu-ze-ren-dian-hua="hasFuZeRenDianHua"
       :has-chang-jia-lian-xi-ren="hasChangJiaLianXiRen"
       :readonly="!hasRole || readOnly"
+      :actionDialog="actionDialog"
       :hidefu-jian-shang="hidefuJianShang"
       @close="close"
     />
@@ -589,6 +590,7 @@ export default {
       },
       params: {},
       deviceDialogShow: false,
+      actionDialog: '',
       position: position,
       level: level.second || level.first,
       userId: userId,
@@ -1237,7 +1239,7 @@ export default {
           this.getDatas()
           break
         case 'customAdd':
-          this.handleCustomAdd()
+          this.handleCustomAdd('customAdd')
           break
         case 'customSetting':
           this.handleCustomSetting()
@@ -1308,12 +1310,14 @@ export default {
       this.sorts = [{ field: s, order: o }]
       this.getDatas()
     },
-    handleCustomAdd() {
+    handleCustomAdd(action) {
       this.params = {}
       this.deviceDialogShow = true
+      this.actionDialog = action
     },
     close() {
       this.deviceDialogShow = false
+      this.actionDialog = ''
       this.getDatas()
     },
     goEdit(row) {

+ 3 - 1
src/views/component/device/maintenanceRecord.vue

@@ -125,13 +125,15 @@ export default {
       this.DialogVisible = true
     },
     async getData() {
+      console.log(this.params, 'this.paramsthis.params')
       this.loading = true
       const {
         data: { dataResult, pageResult }
       } = await queryMaintenanceRecord({
         requestPage: this.requestPage,
         parameters: [
-          { key: 'Q^ri_qi_^S', value: this.params.sheBeiShiBieH },
+          { key: 'Q^she_bei_bian_hao_^SL', value: this.params.id },
+          { key: 'Q^original_device_n^S', value: this.params.yuanSheBeiBian },
           { key: 'Q^shi_fou_guo_shen_^S', value: '已完成' }
         ],
         sorts: [{ field: 'bian_zhi_shi_jian', order: 'desc' }]

+ 2 - 1
src/views/component/device/repairRecord.vue

@@ -121,7 +121,8 @@ export default {
       } = await queryRepairRecord({
         requestPage: this.requestPage,
         parameters: [
-          { key: 'Q^she_bei_bian_hao_^S', value: this.params.sheBeiShiBieH },
+          { key: 'Q^she_bei_id_^SL', value: this.params.id },
+          { key: 'Q^yuan_she_bei_bian^S', value: this.params.yuanSheBeiBian },
           { key: 'Q^shi_fou_guo_shen_^S', value: '已完成' }
         ],
         sorts: [{ field: 'bian_zhi_shi_jian', order: 'desc' }]

+ 1 - 0
src/views/component/device/scrappedRecord.vue

@@ -170,6 +170,7 @@ export default {
       } = await queryScrappedRecord({
         requestPage: this.requestPage,
         parameters: [
+          { key: 'Q^yuan_she_bei_bian^S', value: this.params.yuanSheBeiBian },
           { key: 'Q^she_bei_id_^S', value: this.params.id },
           { key: 'Q^shi_fou_guo_shen_^S', value: '已完成' }
         ],