zhangyu 4 yıl önce
ebeveyn
işleme
a209025dae

+ 42 - 42
src/components/ledger/handsontables/device.vue

@@ -1108,46 +1108,46 @@ export default {
         //品牌型号弹窗
         case 'DPManufacturerID':
           if (!this.onlyRead) {
-						const linkId = this.tableData[row.row].LinkId;
-						if (linkId) { //关联资产
-								this.myDialog.firm = true;
-						} else { //未关联资产
-								this.$message('请先关联资产再维护该信息!');
-						}
+            const linkId = this.tableData[row.row].LinkId;
+            if (linkId) { //关联资产
+                this.myDialog.firm = true;
+            } else { //未关联资产
+                this.$message('请先关联资产再维护该信息!');
+            }
           }
           return false
         //供应商信息弹窗
         case 'DPSupplierID':
           if (!this.onlyRead) {
             const linkId = this.tableData[row.row].LinkId;
-						if (linkId) { //关联资产
-								this.myDialog.supplier = true;
-						} else { //未关联资产
-								this.$message('请先关联资产再维护该信息!');
-						}
+            if (linkId) { //关联资产
+                this.myDialog.supplier = true;
+            } else { //未关联资产
+                this.$message('请先关联资产再维护该信息!');
+            }
           }
           return false
         //维修商信息弹窗
         case 'DPMaintainerID':
           if (!this.onlyRead) {
             const linkId = this.tableData[row.row].LinkId;
-						if (linkId) { //关联资产
-								this.myDialog.maintainer = true;
-						} else { //未关联资产
-								this.$message('请先关联资产再维护该信息!');
-						}
+            if (linkId) { //关联资产
+                this.myDialog.maintainer = true;
+            } else { //未关联资产
+                this.$message('请先关联资产再维护该信息!');
+            }
           }
           return false
         //保险公司信息
         case 'DPInsurerID':
           if (!this.onlyRead) {
             const linkId = this.tableData[row.row].LinkId;
-						if (linkId) { //关联资产
-								this.myDialog.insurer = true;
-						} else { //未关联资产
-								this.$message('请先关联资产再维护该信息!');
-						}
-          }
+            if (linkId) { //关联资产
+                this.myDialog.insurer = true;
+            } else { //未关联资产
+                this.$message('请先关联资产再维护该信息!');
+            }
+        }
           return false
         /**
 				 * 供应合同编号
@@ -1187,26 +1187,26 @@ export default {
         //     }
         //   }
         //   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 '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': //设备文档

+ 110 - 62
src/views/ledger/facility/partsmanage/addparts/index.vue

@@ -33,11 +33,8 @@
     <qrcode :dialog="myDialog" :qrcodeUrl="qrcodeUrl" :addBody="true" ref="qrcode"></qrcode>
     <!-- 型号弹窗 -->
     <firm :mess="{deviceId: firmId}" ref="firm" @changeFirm="firmChange" :dialog="myDialog"></firm>
-    <!-- 供应商合同弹窗 -->
-    <supply-dialog ref="supply" @change="supplyChange" :id="id" :dialog="myDialog"></supply-dialog>
     <!-- 供应商弹窗 -->
     <supplier-dialog ref="supplier" @changeSupplier="supplierChange" :dialog="myDialog"></supplier-dialog>
-    <guarantee-dialog :id="id" ref="guarantee" @change="guaranteeChange" :dialog="myDialog"></guarantee-dialog>
     <upload-files-dialog :read="onlyRead ? true : false" ref="upload" @changeFile="fileChange" :keysArr="filesArr" :dialog="myDialog">
     </upload-files-dialog>
     <upload-img-dialog :read="onlyRead ? true : false" @changeFile="imgChange" :keysArr="imgsArr" :dialog="myDialog"></upload-img-dialog>
@@ -45,6 +42,22 @@
     <insurer-dialog @changeInsurer="changeInsurer" ref="insurer" :dialog="myDialog"></insurer-dialog>
     <pic-dialog :read="onlyRead ? true : false" :dialog="myDialog" :keysArr="picsArr" @change="changePics"></pic-dialog>
     <details-dialog :iframeSrc="iframeSrc" v-if="myDialog.details" :dialog="myDialog"></details-dialog>
+    <!-- 不支持的输入方式 -->
+    <el-dialog title="临时维护信息点" :visible.sync="myDialog.update" @close="handleCloseUpdate" width="670px">
+      <el-row>
+        该信息点未定义对应组件,现在维护数据不确定后续是否可用。如确实需要维护,请点击
+        <el-link @click="updateInputShow = true" type="primary" :underline="false">继续维护</el-link>
+        。
+      </el-row>
+      <el-row style="margin-top:20px;" v-show="updateInputShow">
+        <el-input type="textarea" :autosize="{ minRows: 4, maxRows: 8}" placeholder="请输入内容"
+                  v-model="updateInput"></el-input>
+      </el-row>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="myDialog.update = false">取 消</el-button>
+        <el-button type="primary" @click="handleClickUpdate">确 认</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 <script>
@@ -65,11 +78,9 @@ import { mapGetters, mapActions } from "vuex";
 
 import qrcode from "@/components/ledger/lib/qrcode";
 import firm from "@/components/dialogs/list/firm";
-import supplyDialog from "@/components/dialogs/list/supplyDialog";
 import supplierDialog from "@/components/dialogs/list/supplierDialog";
 import maintainerDialog from "@/components/dialogs/list/maintainerDialog";
 import insurerDialog from "@/components/dialogs/list/insurerDialog";
-import guaranteeDialog from "@/components/dialogs/list/guaranteeDialog";
 import uploadFilesDialog from "@/components/dialogs/list/filesDialog";
 import uploadImgDialog from "@/components/dialogs/list/uploadImgDialog";
 import picDialog from "@/components/dialogs/list/picDialog";
@@ -77,11 +88,9 @@ export default {
   components: {
     qrcode, //二维码页面
     firm, //品牌型号弹窗
-    supplyDialog,
     supplierDialog,
     maintainerDialog,
     insurerDialog,
-    guaranteeDialog,
     uploadFilesDialog,
     uploadImgDialog,
     picDialog,
@@ -108,9 +117,7 @@ export default {
       myDialog: {
         qrcode: false, //二维码弹窗
         firm: false, //厂商弹窗
-        supply: false, //选择供应合同
         supplier: false, //供应商选择
-        guarantee: false, //选择保单
         maintainer: false, //选择维修商
         insurer: false, //选择保险公司
         uploadFiles: false, //上传文件
@@ -120,8 +127,21 @@ export default {
         systemType: false,
         details: false, //详情页
         changeRea: false,
-        lookPic: false //图片查看
+        lookPic: false, //图片查看
+        update: false,//临时维护信息点
       },
+      updateInputShow: false, //是否显示临时维护输入框
+      updateInfoPoint: '',//临时维护信息点
+      updateInput: '', //临时维护信息点值
+      inputMap: {
+        flowBuild: {
+          InputMode: 'D1',
+          Editable:true,
+          InfoPointCode:"flowBuild",
+          InfoPointName:"建筑楼层",
+          Path:"flowBuild"
+        }
+      }, //信息点和输入方式映射表
       qrcodeUrl: "", //二维码图片地址
       filesArr: [], //保存临时的文件key
       imgsArr: [], //临时保存的图片key数组
@@ -169,6 +189,11 @@ export default {
       };
       await getDataDictionary(params, res => {
         this.tableHeader = res.Content;
+        this.tableHeader.forEach(item => {
+          if (item.Path) {
+            this.inputMap[item.Path] = item;
+          }
+        })
         this.initTable();
       });
     },
@@ -388,21 +413,6 @@ export default {
       tools.setDataForKey(this.tableData[this.row], 'LedgerParam.OperationMainte.MaintainerEmail', data.contacts[0]?data.contacts[0].email:null)
       tools.setDataForKey(this.tableData[this.row], 'LedgerParam.OperationMainte.MaintainerFax', data.contacts[0]?data.contacts[0].fax:null)
     },
-    supplyChange(data) {
-      tools.setDataForKey(this.tableData[this.row], "LedgerParam.SupplyPurchase.SupplierContractID", { id: data });
-    },
-    //保险合同
-    guaranteeChange(data) {
-      for (let key in data) {
-        this.utilToKey(key, "insuranceNo", data, "InsuranceNum");
-        if (key == "contractFile") {
-          if (!!data[key]) {
-            data[key] = [data[key]];
-          }
-        }
-        this.utilToKey(key, "contractFile", data, "InsuranceFile");
-      }
-    },
     //上传文件弹窗触发事件
     fileChange(keys) {
       this.setDataToMain(keys, this.messKey, this.row);
@@ -462,60 +472,75 @@ export default {
     getInfors(infos, row) {
       //其他的开始判断
       let val = this.tableExample.colToProp(row.col);
+      let inputData = this.inputMap[val];
+      this.row = row.row;
+      this.messKey = val;
       //设备二维码图片
       if (val == "EquipQRCode") {
         this.myDialog.qrcode = true;
         this.$refs.qrcode.getCanvas(1111);
       }
-      //关联系统
-      if (val == "linkSystem") {
-        // this.systemList = this.tableData[row.row].linkSystem || [];
-        this.myDialog.systemType = true;
-      }
+
       //品牌型号弹窗
       if (val == "DPManufacturerID") {
-        this.myDialog.firm = true;
+        const PropertyId = this.tableData[row.row].PropertyId;
+        if (PropertyId) { //关联资产
+            this.myDialog.firm = true;
+        } else { //未关联资产
+            this.$message('请先关联资产后再维护该信息!');
+        }
+        return false;
       }
       //供应商信息弹窗
       if (val == "DPSupplierID") {
-        this.myDialog.supplier = true;
+          const PropertyId = this.tableData[row.row].PropertyId;
+        if (PropertyId) { //关联资产
+            this.myDialog.supplier = true;
+        } else { //未关联资产
+            this.$message('请先关联资产后再维护该信息!');
+        }
+        return false;
       }
       //维修商信息弹窗
       if (val == "DPMaintainerID") {
-        this.myDialog.maintainer = true;
+          const PropertyId = this.tableData[row.row].PropertyId;
+        if (PropertyId) { //关联资产
+            this.myDialog.maintainer = true;
+        } else { //未关联资产
+            this.$message('请先关联资产后再维护该信息!');
+        }
+        return false;
       }
       //保险公司信息
       if (val == "DPInsurerID") {
-        this.myDialog.insurer = true;
-      }
-      //供应合同编号
-      if (val == "LedgerParam.SupplyPurchase.SupplierContractID") {
-        let falg = null;
-        let data = this.tableData[row.row].DPSupplierID;
-        if (data) {
-          falg = data.split("-")[0];
-        }
-        if (!!falg) {
-          this.id = falg;
-          this.myDialog.supply = true;
-        } else {
-          this.$message("请先选择供应商");
+          const PropertyId = this.tableData[row.row].PropertyId;
+        if (PropertyId) { //关联资产
+            this.myDialog.insurer = true;
+        } else { //未关联资产
+            this.$message('请先关联资产后再维护该信息!');
         }
+        return false;
       }
-      //保险单号
-      if (val == "LedgerParam.InsuranceDoc.InsuranceNum") {
-        //选择保单
-        let falg = null;
-        let data = this.tableData[row.row].DPInsurerID
-        if (data) {
-          falg = data.split("-")[0];
-        }
-        if (!!falg) {
-          this.id = falg;
-          this.myDialog.guarantee = true;
-        } else {
-          this.$message("请先选择保险商");
+      if (
+        val == "flowBuild" || //所属建筑楼层
+        val == "LedgerParam.EquipManufactor.ProductDate" || //生产日期
+        val == "LedgerParam.EquipManufactor.SerialNum" || //出厂编号
+        val == "LedgerParam.SupplyPurchase.AssetID" || //资产编号
+        val == "LedgerParam.SupplyPurchase.PurchasePrice" || //采购价格
+        val == "LedgerParam.InsuranceDoc.InsuranceNum" || //保险单号
+        val == "LedgerParam.InsuranceDoc.InsuranceFile" //保险文件
+      ) {
+        const PropertyId = this.tableData[row.row].PropertyId;
+        if (!PropertyId) { //未关联资产
+            this.$confirm('请先关联资产再维护该信息!', '提示', {
+                confirmButtonText: '确定',
+                showCancelButton: false,
+                type: 'warning'
+            }).then(() => {
+                return false;
+            });
         }
+        return false
       }
       //保险文件--设备文档--安装质检报告
       if (
@@ -553,8 +578,31 @@ export default {
         this.picsArr = data ? data : []
         this.myDialog.pic = true;
       }
-      this.row = row.row;
-      this.messKey = val;
+      if (!this.onlyRead && !inputData.Editable) {
+        this.$message("该信息点的值为自动生成,不可人工维护!");
+        return false;
+      }
+      if (!this.onlyRead && showTools.InputModeArr.indexOf(inputData.InputMode) == '-1') {
+        this.updateInfoPoint = val;
+        this.updateInput = tools.dataForKey(this.tableData[row.row], val);
+        this.myDialog.update = true;
+        return false;
+      }
+    },
+    //关闭临时维护弹窗回调
+    handleCloseUpdate() {
+      this.updateInputShow = false
+      this.updateInfoPoint = ''
+      this.updateInput = ''
+    },
+    //更新临时维护信息点
+    handleClickUpdate() {
+      // this.$message("更新成功");
+      tools.setDataForKey(this.tableData[this.row], this.updateInfoPoint, this.updateInput)
+      this.handleUpdataTable([[this.row, this.updateInfoPoint, null, this.updateInput]], "edit")
+      this.updateInputShow = false
+      this.myDialog.update = false
+      this.updateInput = ''
     },
     utilToKey(key, name, data, messName) {
       if (key == name) {

+ 43 - 59
src/views/ledger/facility/partsmanage/index.vue

@@ -43,11 +43,8 @@
     <qrcode :dialog="myDialog" :qrcodeUrl="qrcodeUrl" :addBody="true" ref="qrcode"></qrcode>
     <!-- 型号弹窗 -->
     <firm :mess="{deviceId: firmId}" ref="firm" @changeFirm="firmChange" :dialog="myDialog"></firm>
-    <!-- 供应商合同弹窗 -->
-    <supply-dialog ref="supply" @change="supplyChange" :id="id" :dialog="myDialog"></supply-dialog>
     <!-- 供应商弹窗 -->
     <supplier-dialog ref="supplier" @changeSupplier="supplierChange" :dialog="myDialog"></supplier-dialog>
-    <guarantee-dialog :id="id" ref="guarantee" @change="guaranteeChange" :dialog="myDialog"></guarantee-dialog>
     <upload-files-dialog :read="onlyRead ? true : false" ref="upload" @changeFile="fileChange" :keysArr="filesArr" :dialog="myDialog">
     </upload-files-dialog>
     <upload-img-dialog :read="onlyRead ? true : false" @changeFile="imgChange" :keysArr="imgsArr" :dialog="myDialog"></upload-img-dialog>
@@ -94,11 +91,9 @@ import { mapGetters, mapActions } from "vuex";
 
 import qrcode from "@/components/ledger/lib/qrcode";
 import firm from "@/components/dialogs/list/firm";
-import supplyDialog from "@/components/dialogs/list/supplyDialog";
 import supplierDialog from "@/components/dialogs/list/supplierDialog";
 import maintainerDialog from "@/components/dialogs/list/maintainerDialog";
 import insurerDialog from "@/components/dialogs/list/insurerDialog";
-import guaranteeDialog from "@/components/dialogs/list/guaranteeDialog";
 import uploadFilesDialog from "@/components/dialogs/list/filesDialog";
 import uploadImgDialog from "@/components/dialogs/list/uploadImgDialog";
 import picDialog from "@/components/dialogs/list/picDialog";
@@ -107,11 +102,9 @@ export default {
   components: {
     qrcode, //二维码页面
     firm, //品牌型号弹窗
-    supplyDialog,
     supplierDialog,
     maintainerDialog,
     insurerDialog,
-    guaranteeDialog,
     uploadFilesDialog,
     uploadImgDialog,
     picDialog,
@@ -158,9 +151,7 @@ export default {
       myDialog: {
         qrcode: false, //二维码弹窗
         firm: false, //厂商弹窗
-        supply: false, //选择供应合同
         supplier: false, //供应商选择
-        guarantee: false, //选择保单
         maintainer: false, //选择维修商
         insurer: false, //选择保险公司
         uploadFiles: false, //上传文件
@@ -568,21 +559,6 @@ export default {
       )
       // this.handleUpdataTable([[this.row, "LedgerParam.OperationMainte.Maintainer", null, data.name]], "edit")
     },
-    supplyChange(data) {
-      tools.setDataForKey(this.tableData[this.row], "LedgerParam.SupplyPurchase.SupplierContractID", { id: data });
-    },
-    //保险合同
-    guaranteeChange(data) {
-      for (let key in data) {
-        this.utilToKey(key, "insuranceNo", data, "InsuranceNum");
-        if (key == "contractFile") {
-          if (!!data[key]) {
-            data[key] = [data[key]];
-          }
-        }
-        this.utilToKey(key, "contractFile", data, "InsuranceFile");
-      }
-    },
     //修改关联的资产
     changeProperty(val) {
       this.setDataToMain(val.PropertyId, 'PropertyId', this.row);
@@ -681,59 +657,67 @@ export default {
         //品牌型号弹窗
         case 'DPManufacturerID':
           if (!this.onlyRead) {
-            this.myDialog.firm = true;
+            const PropertyId = this.tableData[row.row].PropertyId;
+            if (PropertyId) { //关联资产
+                this.myDialog.firm = true;
+            } else { //未关联资产
+                this.$message('请先关联资产再维护该信息!');
+            }
           }
           break;
         //供应商信息弹窗
         case 'DPSupplierID':
           if (!this.onlyRead) {
-            this.myDialog.supplier = true;
+              const PropertyId = this.tableData[row.row].PropertyId;
+            if (PropertyId) { //关联资产
+                this.myDialog.supplier = true;
+            } else { //未关联资产
+                this.$message('请先关联资产再维护该信息!');
+            }
           }
           break;
         //维修商信息弹窗
         case 'DPMaintainerID':
           if (!this.onlyRead) {
-            this.myDialog.maintainer = true;
+              const PropertyId = this.tableData[row.row].PropertyId;
+            if (PropertyId) { //关联资产
+                this.myDialog.maintainer = true;
+            } else { //未关联资产
+                this.$message('请先关联资产再维护该信息!');
+            }
           }
           break;
         //保险公司信息
         case 'DPInsurerID':
           if (!this.onlyRead) {
-            this.myDialog.insurer = true;
-          }
-          break;
-        //供应合同编号
-        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("请先选择供应商");
+              const PropertyId = this.tableData[row.row].PropertyId;
+            if (PropertyId) { //关联资产
+                this.myDialog.insurer = true;
+            } else { //未关联资产
+                this.$message('请先关联资产再维护该信息!');
             }
           }
           break;
-        //保险单号
-        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("请先选择保险商");
+        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 PropertyId = this.tableData[row.row].PropertyId;
+                if (!PropertyId) { //未关联资产
+                    this.$confirm('请先关联资产再维护该信息!', '提示', {
+                        confirmButtonText: '确定',
+                        showCancelButton: false,
+                        type: 'warning'
+                    }).then(() => {
+                        return false;
+                    });
+                }
             }
-          }
-          break;
+            return false
         //保险文件--设备文档--安装质检报告
         case 'LedgerParam.InsuranceDoc.InsuranceFile': //保险文件
         case 'LedgerParam.PhotoDoc.Archive': //设备文档
@@ -781,7 +765,7 @@ export default {
         this.$message("该信息点的值为自动生成,不可人工维护!");
         return false;
       }
-      if (!this.onlyRead && showTools.InputModeArr.indexOf(inputData.inputMode) == '-1') {
+      if (!this.onlyRead && showTools.InputModeArr.indexOf(inputData.InputMode) == '-1') {
         this.updateInfoPoint = val;
         this.updateInput = tools.dataForKey(this.tableData[row.row], val);
         this.myDialog.update = true;