Просмотр исходного кода

修改销售政策上传多张图片、销售明细汇总

zhouhao 2 лет назад
Родитель
Сommit
c87373a9e5

+ 4 - 1
src/components/Common/image-upload.vue

@@ -5,6 +5,7 @@
       :action="oss_url"
       :data="dataObj"
       :multiple="multiple"
+      :limit="limit"
       name="file"
       :accept="accept"
       :show-file-list="false"
@@ -38,7 +39,7 @@
           </div>
         </div>
       </div>
-      <div v-if="multiple || (!multiple && fileList.length < 1)" class="add" @click="uploadImage()">
+      <div v-if="multiple|| (!multiple && fileList.length < 1) " class="add" @click="uploadImage()">
         <i class="el-icon-plus" />
       </div>
     </div>
@@ -51,6 +52,8 @@ import { findElem } from '@/utils/util'
 export default {
   name: 'FileUpload',
   props: {
+    // 最大上传数量
+    limit:Number,
     // 接受上传的文件列表
     fileList: Array,
 

+ 6 - 2
src/views/sales_policy/components/AddPolicy.vue

@@ -84,7 +84,7 @@
               </el-col>
               <el-col :xs="24" :ms="24" :lg="24">
                 <el-form-item label="政策封面图">
-                  <ImageUpload :file-list="fileList" :multiple="false" />
+                  <ImageUpload :file-list="fileList" multiple :limit="3"/>
                 </el-form-item>
               </el-col>
             </el-row>
@@ -857,6 +857,10 @@ export default {
         //     this.searchForm.mainName = k.dictValue;
         //   }
         // });
+        let imgUrl = []
+        this.fileList.forEach(k=>{
+              imgUrl.push(k.url)
+        })
         const params = {
           adminCompanyId: '',
           code: '',
@@ -873,7 +877,7 @@ export default {
           ...this.searchForm,
           flag: region,
           endTime: this.searchForm.endTime || '2100-01-01 00:00:00',
-          imgSrc: this.fileList.length ? this.fileList[0].url : ''
+          imgSrc: imgUrl.join(',')
         }
         console.log(this.fileList)
         addPoliy(params).then(res => {

+ 7 - 3
src/views/sales_policy/components/Examine.vue

@@ -91,8 +91,9 @@
               <div class="label" style="height: 150px">政策封面图</div>
               <div class="value" style="height: 150px">
                 <el-image
-                  style="height: 120px; widht: 120px"
-                  :src="$imageUrl + detail.imgSrc"
+                  v-for="item in detail.imgSrc"
+                  style="height: 120px; widht: 120px;margin-left: 10px"
+                  :src="$imageUrl + item"
                   fit="fill"
                   :preview-src-list="srcList"
                 />
@@ -751,7 +752,10 @@ export default {
       this.listLoading = true
       getPolicyDetail({ policyId: this.$parent.id }).then(res => {
         this.detail = res.data
-        this.srcList = [this.$imageUrl + this.detail.imgSrc]
+          this.detail.imgSrc = this.detail.imgSrc.split(',')
+        this.detail.imgSrc.forEach(k=>{
+          this.srcList.push(this.$imageUrl+k)
+        })
         if (this.$parent.isShow == 5 && this.detail.imgSrc) {
           this.fileList = [
             {

+ 9 - 3
src/views/sales_policy/components/details.vue

@@ -84,8 +84,10 @@
               <div class="label" style="height: 150px">政策封面图</div>
               <div class="value" style="height: 150px">
                 <el-image
-                  style="height: 120px; widht: 120px"
-                  :src="$imageUrl + detail.imgSrc"
+
+                  v-for="item in detail.imgSrc"
+                  style="height: 120px; widht: 120px;margin-left: 20px"
+                  :src="$imageUrl + item"
                   fit="fill"
                   :preview-src-list="srcList"
                 />
@@ -791,7 +793,11 @@ export default {
       getPolicyDetail({ policyId: this.$parent.id }).then(res => {
         this.detail = res.data
         this.detail.flag = this.detail.flag + ''
-        this.srcList = [this.$imageUrl + this.detail.imgSrc]
+        this.detail.imgSrc = this.detail.imgSrc.split(',')
+        this.detail.imgSrc.forEach(k=>{
+          this.srcList.push(this.$imageUrl+k)
+        })
+        // this.srcList = [this.$imageUrl + this.detail.imgSrc]
         if (this.$parent.isShow == 5 && this.detail.imgSrc) {
           this.fileList = [
             {

+ 17 - 10
src/views/sales_policy/components/editPolicy.vue

@@ -87,7 +87,7 @@
               </el-col>
               <el-col :xs="24" :ms="24" :lg="24">
                 <el-form-item label="政策封面图">
-                  <ImageUpload :file-list="fileList" :multiple="false" />
+                  <ImageUpload :file-list="fileList" multiple :limit="3"/>
                 </el-form-item>
               </el-col>
             </el-row>
@@ -571,8 +571,8 @@ export default {
       cid: '',
       cpolicyId: '',
       region: 0,
-      fullscreenLoading:false
-
+      fullscreenLoading:false,
+      srcList:[]
     }
   },
   computed: {
@@ -790,14 +790,17 @@ export default {
           commercialType: this.detail.commercialType
         }),
           (this.region = res.data.flag)
-        this.srcList = [this.$imageUrl + this.detail.imgSrc]
+
+        // this.srcList = [this.$imageUrl + this.detail.imgSrc]
         if (this.$parent.isShow === 5 && this.detail.imgSrc) {
-          this.fileList = [
-            {
+          this.detail.imgSrc.split(',').forEach(k=>{
+            this.fileList.push({
               hover: '',
-              url: this.detail.imgSrc
-            }
-          ]
+              url:k
+            })
+            this.srcList.push(this.$imageUrl+k)
+          })
+
         }
         await this.handletwoList()
         // 获取条件政策
@@ -907,13 +910,17 @@ export default {
         //     this.searchForm.mainName = k.dictValue;
         //   }
         // });
+        let imgUrl = []
+        this.fileList.forEach(k=>{
+          imgUrl.push(k.url)
+        })
         const params = {
           ...this.detail,
           ...this.searchForm,
           flag: region,
           endTime: this.searchForm.endTime || '2100-01-01 00:00:00',
           policyCustomers: arr,
-          imgSrc: this.fileList.length ? this.fileList[0].url : ''
+          imgSrc: imgUrl.join(',')
         }
         console.log(this.fileList)
         updatePolicy(params).then(res => {

+ 8 - 0
src/views/supply/implement/implement_total_list.vue

@@ -375,6 +375,14 @@
               show-overflow-tooltip
             ></el-table-column>
             <el-table-column
+              align="right"
+              label="返利钱包"
+              prop="rebateWalletName"
+              min-width="100"
+              show-overflow-tooltip
+            ></el-table-column>
+
+            <el-table-column
               align="left"
               label="表头业务员"
               prop="serviceName"