瀏覽代碼

Merge branch 'master' of https://git.steerinfo.com/DAL-DAZHOU/icore-pass

luobang 2 年之前
父節點
當前提交
63e60fd2e6
共有 1 個文件被更改,包括 94 次插入2 次删除
  1. 94 2
      src/views/statisticalReport/components/salesLogisticsStatistics/saleSteelReports.vue

+ 94 - 2
src/views/statisticalReport/components/salesLogisticsStatistics/saleSteelReports.vue

@@ -969,8 +969,10 @@
                 <template slot="prefix">
                   {{ steelMap.remark }}
                 </template> -->
-                  </el-input></el-form-item
-                >
+                  </el-input></el-form-item>
+                <el-form-item>
+                  <el-button @click="openRemarkPic" type="primary">备注图片</el-button>
+                </el-form-item>
               </el-form>
             </div>
           </div>
@@ -1261,6 +1263,38 @@
         >确定</el-button
       >
     </el-dialog>
+    <el-dialog
+      title="备注图片(图片暂存后需要点击全局确定才会保存)"
+      :visible.sync="remarkPic"
+      :before-close="closeUpload2"
+    >
+      <el-form style="margin-left:20%">
+        <el-form-item >
+          <el-upload
+            ref="remarkPic"
+            list-type="picture-card"
+            :file-list="remarkPicList"
+            action="null"
+            :limit="11"
+            :on-change="fileChange3"
+            :on-remove="fileChange3"
+            :on-preview="handlePictureCardPreview"
+            :on-exceed="exceed"
+            accept=".jpg,.jpeg,.png,.gif,.bmp,.JPG,.JPEG,.PBG,.GIF,.BMP,.PDF"
+            :auto-upload="false"
+          >
+            <i class="el-icon-plus"></i>
+          </el-upload>
+        </el-form-item>
+      </el-form>
+      <el-button
+        type="primary"
+        @click="uploadRemarkPic"
+        :loading="isLoading"
+        style="margin-left:40%"
+        >暂存</el-button
+      >
+    </el-dialog>
     <el-dialog :visible.sync="dialogVisible" width="80%">
       <img width="100%" :src="dialogImageUrl" alt="" />
     </el-dialog>
@@ -1966,6 +2000,8 @@ export default {
       filterMap: {},
       //权限控制
       notRoutList: [],
+      remarkPic:false,
+      remarkPicList:[],
       location: null,
       orderNumber: null,
       capacityNumber: null,
@@ -2896,6 +2932,54 @@ export default {
       downloadFile(src, `${this.downloadCapacityNo}${title}照片`, '.jpg')
       // this.dialogVisible = true
     },
+    openRemarkPic(){
+      //获取图片到本地
+      this.axios.post("/api/v1/uc/getPicture",this.steelMap).then((res)=>{
+        console.log(res);
+        if (res.data) {
+            let remarkPicList=[]
+            res.data.forEach((e, index) => {
+              creatImageFile(e, 'file2-' + index).then(res => {
+                remarkPicList.push({
+                  name: 'file' + index,
+                  raw: res,
+                  url: e
+                })
+              })
+            })
+            this.remarkPicList=remarkPicList;
+        }else{
+          this.remarkPicList = []
+        }
+        this.remarkPic=true;
+      });
+    },
+    uploadRemarkPic(){
+      if(this.remarkPicList.length<=0){
+        this.$message.error('请上传图片!')
+        return;
+      }
+      //上传备注图片
+      let formData = new window.FormData()
+      this.remarkPicList.forEach((item, index) => {
+        formData.append('file' + index, item.raw)
+      })
+      let options = {
+        url: '/api/v1/uc/uploadPic',
+        data: formData,
+        method: 'post',
+        headers: {
+          'Content-Type': 'multipart/form-data'
+        }
+      }
+      this.axios(options).then(res => {
+        console.log(res)
+        this.$message.success('暂存成功!')
+        this.remarkPic=false;
+        this.steelMap.urls = res.data;
+        this.closeUpload2();
+      })
+    },
     openReceive() {
       if (Object.values(this.steelMap).length == 0) {
         this.$message.warning('请选择需要补录的实绩')
@@ -3044,6 +3128,9 @@ export default {
     fileChange2(file, fileList) {
       this.fileListReceive = fileList
     },
+    fileChange3(file, fileList) {
+      this.remarkPicList = fileList
+    },
     exceed() {
       this.$message.warning('超出上传数量!')
     },
@@ -3060,6 +3147,11 @@ export default {
       this.$refs.arrival.clearFiles()
       this.$refs.receive.clearFiles()
     },
+    closeUpload2() {
+      this.remarkPic = false
+      this.isLoading = false
+      this.$refs.remarkPic.clearFiles()
+    },
     //防抖函数--防止用户重复点击
     debounce(func, delay) {
       let timer = null