Jelajahi Sumber

设备台账bug修改

zhangyu 4 tahun lalu
induk
melakukan
6c8af016a4
1 mengubah file dengan 82 tambahan dan 36 penghapusan
  1. 82 36
      src/components/ledger/handsontables/device.vue

+ 82 - 36
src/components/ledger/handsontables/device.vue

@@ -1104,59 +1104,105 @@ export default {
         //品牌型号弹窗
         case 'DPManufacturerID':
           if (!this.onlyRead) {
-            this.myDialog.firm = true
+						const linkId = this.tableData[row.row].LinkId;
+						if (linkId) { //关联资产
+								this.myDialog.firm = true;
+						} else { //未关联资产
+								this.$message('请先关联资产再维护该信息!');
+						}
           }
           return false
         //供应商信息弹窗
         case 'DPSupplierID':
           if (!this.onlyRead) {
-            this.myDialog.supplier = true
+            const linkId = this.tableData[row.row].LinkId;
+						if (linkId) { //关联资产
+								this.myDialog.supplier = true;
+						} else { //未关联资产
+								this.$message('请先关联资产再维护该信息!');
+						}
           }
           return false
         //维修商信息弹窗
         case 'DPMaintainerID':
           if (!this.onlyRead) {
-            this.myDialog.maintainer = true
+            const linkId = this.tableData[row.row].LinkId;
+						if (linkId) { //关联资产
+								this.myDialog.maintainer = true;
+						} else { //未关联资产
+								this.$message('请先关联资产再维护该信息!');
+						}
           }
           return false
         //保险公司信息
         case 'DPInsurerID':
           if (!this.onlyRead) {
-            this.myDialog.insurer = true
-          }
-          return false
-        //供应合同编号
-        case 'LedgerParam.SupplyPurchase.SupplierContractID':
-          if (!this.onlyRead) {
-            let ContractIDflag = null
-            let DPSdata = this.tableData[row.row].DPSupplierID
-            if (DPSdata) {
-              ContractIDflag = DPSdata.split('-')[0]
-            }
-            if (!!ContractIDflag) {
-              this.id = ContractIDflag
-              this.myDialog.supply = true
-            } else {
-              this.$message('请先选择供应商')
-            }
-          }
-          return false
-        //保险单号
-        case 'LedgerParam.InsuranceDoc.InsuranceNum':
-          if (!this.onlyRead) {
-            let DPInsurerIDflag = null
-            let DPIdata = this.tableData[row.row].DPInsurerID
-            if (DPIdata) {
-              DPInsurerIDflag = DPIdata.split('-')[0]
-            }
-            if (!!DPInsurerIDflag) {
-              this.id = DPInsurerIDflag
-              this.myDialog.guarantee = true
-            } else {
-              this.$message('请先选择保险商')
-            }
+            const linkId = this.tableData[row.row].LinkId;
+						if (linkId) { //关联资产
+								this.myDialog.insurer = true;
+						} else { //未关联资产
+								this.$message('请先关联资产再维护该信息!');
+						}
           }
           return false
+        /**
+				 * 供应合同编号
+				 * TODO:厂商库服务无人维护,故注释供应合同编号选择改为直接输入
+				 */
+        // case 'LedgerParam.SupplyPurchase.SupplierContractID':
+        //   if (!this.onlyRead) {
+        //     let ContractIDflag = null
+        //     let DPSdata = this.tableData[row.row].DPSupplierID
+        //     if (DPSdata) {
+        //       ContractIDflag = DPSdata.split('-')[0]
+        //     }
+        //     if (!!ContractIDflag) {
+        //       this.id = ContractIDflag
+        //       this.myDialog.supply = true
+        //     } else {
+        //       this.$message('请先选择供应商')
+        //     }
+        //   }
+        //   return false
+        /** 
+				 * 保险单号
+				 * TODO:厂商库服务无人维护,故注释保险单号选择改为直接输入
+				 */
+        // case 'LedgerParam.InsuranceDoc.InsuranceNum':
+        //   if (!this.onlyRead) {
+        //     let DPInsurerIDflag = null
+        //     let DPIdata = this.tableData[row.row].DPInsurerID
+        //     if (DPIdata) {
+        //       DPInsurerIDflag = DPIdata.split('-')[0]
+        //     }
+        //     if (!!DPInsurerIDflag) {
+        //       this.id = DPInsurerIDflag
+        //       this.myDialog.guarantee = true
+        //     } else {
+        //       this.$message('请先选择保险商')
+        //     }
+        //   }
+        //   return false
+				case 'flowBuild': //所属建筑楼层
+				case 'LedgerParam.EquipManufactor.ProductDate': //生产日期
+				case 'LedgerParam.EquipManufactor.SerialNum': //出厂编号
+				case 'LedgerParam.SupplyPurchase.AssetID': //资产编号
+				case 'LedgerParam.SupplyPurchase.PurchasePrice': //采购价格
+				case 'LedgerParam.InsuranceDoc.InsuranceNum': //保险单号
+				case 'LedgerParam.InsuranceDoc.InsuranceFile': //保险文件
+						if (!this.onlyRead) {
+								const linkId = this.tableData[row.row].LinkId;
+								if (!linkId) { //未关联资产
+										this.$confirm('请先关联资产再维护该信息!', '提示', {
+												confirmButtonText: '确定',
+												showCancelButton: false,
+												type: 'warning'
+										}).then(() => {
+												return false;
+										});
+								}
+						}
+						return false
         //保险文件--设备文档--安装质检报告
         case 'LedgerParam.InsuranceDoc.InsuranceFile': //保险文件
         case 'LedgerParam.PhotoDoc.Archive': //设备文档