Procházet zdrojové kódy

提交巡检上传图片问题

caojunjie před 4 roky
rodič
revize
6aaaf414c9

+ 7 - 0
src/api/warehouseCheck/index.js

@@ -55,3 +55,10 @@ export function addOrModifyPictureList(data) {
         data:data
     })
 }
+//查询当前登录人
+export function currentLogin() {
+    return request({
+        url: 'system/user/profile',
+        method: 'get'
+    })
+}

+ 16 - 5
src/views/warehouseBusiness/warehouseCheck/index.vue

@@ -375,10 +375,10 @@
             ></el-option>
           </el-select>
         </el-form-item>
-        <el-form-item label="巡检日期" prop="fUpdateTime">
+        <el-form-item label="巡检日期" prop="fCreateTime">
           <el-date-picker
               style="width: 200px;"
-              v-model="twarehousecheckdetailList.fUpdateTime"
+              v-model="twarehousecheckdetailList.fCreateTime"
               type="date"
               value-format="yyyy-MM-dd"
               placeholder="选择日期">
@@ -429,7 +429,7 @@
 </template>
 
 <script>
-import {listCorps,delLog,information,newlyAdded,savePicture,selectUserByRole,addOrModifyPictureList} from '@/api/warehouseCheck/index'
+import {listCorps,delLog,information,newlyAdded,savePicture,selectUserByRole,addOrModifyPictureList,currentLogin} from '@/api/warehouseCheck/index'
 import {listWarehousesss} from "@/api/basicdata/warehouse";
 import {getToken} from "@/utils/auth";
 
@@ -485,6 +485,9 @@ export default {
     };
   },
   created() {
+    currentLogin().then(res=>{
+      console.log(res)
+    })
     selectUserByRole().then(res => {
       this.patrolInspection = res.rows
       console.log(res)
@@ -525,15 +528,23 @@ export default {
       })
     },
     preservationtwo(){
+      for (let item in this.pictureEist){
+        this.twarehousecheckdetailList.fPhotoUrl[item] = this.pictureEist[item].response.url
+      }
+      this.twarehousecheckdetailList.fPhotoUrl = JSON.stringify(this.twarehousecheckdetailList.fPhotoUrl)
       addOrModifyPictureList(this.twarehousecheckdetailList).then(res=>{
-
+        console.log(res)
       })
     },
     pictureList(scope){
       savePicture(scope.row.fId).then(res=>{
         console.log(res)
+        if (!res.data){
+          this.twarehousecheckdetailList.fCheckFid = scope.row.fCheckFid
+          this.twarehousecheckdetailList.fItemFid = scope.row.fId
+          this.twarehousecheckdetailList.fPhotoUrl = []
+        }
       })
-      this.picturefId = scope.row.fId
       this.opentwo = true
     },
     //查看明细