Bläddra i källkod

汽保产品主图保存判断

caojunjie 1 år sedan
förälder
incheckning
51614ba10f

+ 1 - 1
src/api/landTransportation/index.js

@@ -168,7 +168,7 @@ export function borrow(data) {
         params:data
     })
 }
-//获取车队司机信息
+//获取车信息
 export function fleetList(data) {
     return request({
         url: '/api/blade-client/land-vehicle/vehicle-list',

+ 26 - 2
src/components/upload/index.vue

@@ -378,7 +378,20 @@ export default {
             index: 3,
             width: 140,
             overHidden: true,
-            cell: true
+            cell: true,
+                // change:(res)=>{
+                //     let i = 0
+                //     for(let item of this.data) {
+                //         if(item.version === '0') {
+                //             if (i == 1) {
+                //                 this.$message.warning("主图不能重复选择");
+                //                 this.$set(this.data[res.index],'version','')
+                //                 return
+                //             }
+                //             i++
+                //         }
+                //     }
+                // }
           },
           {
             label: "备注",
@@ -560,12 +573,23 @@ export default {
     },
     //修改触发
     rowCell(row, index) {
+        let i = 0
+        for(let item of this.data) {
+            if(item.version === '0') {
+                if (i == 1) {
+                    console.log('提示')
+                    return
+                }
+                i++
+            }
+        }
       if (row.$cellEdit == true) {
         this.$set(row, "$cellEdit", false);
       } else {
         this.$set(row, "$cellEdit", true);
       }
-      // this.$refs.crud.rowCell(row, index)
+
+      this.$refs.crud.rowCell(row, index)
     },
     rowDel(row, index) {
       this.$confirm("确定将选择数据删除?", {

+ 3 - 3
src/views/EquipmentArchives/detailsPage.vue

@@ -695,12 +695,12 @@ export default {
     },
       // 客户下拉框
     getCorpData(row) {
-        console.log(row)
       if (row) {
         this.form.corpName = row.cname
         this.form.contactsTel = row.tel
-
-          // 地址
+          // 地址和联系人
+        this.form.address = row.details
+        this.form.contacts = row.attn
       } else {
         this.form.corpName = null
         this.form.contactsTel = null