Jelajahi Sumber

押金上传限制,引用政策订单说明。。。

howie 3 tahun lalu
induk
melakukan
9202dbab55

+ 18 - 27
src/components/Common/image-upload.vue

@@ -74,7 +74,8 @@ export default {
       oss_url: '',
       dataObj: {},
       uploadImageUrl: '',
-      waitUploadList: []
+      waitUploadList: [],
+      fileName: ''
     }
   },
   computed: {
@@ -163,7 +164,7 @@ export default {
       const result = await new Promise((resolve, reject) => {
         getOssConfig().then(res => {
           const fileKey = this.createName(fileName)
-          res.data.name = fileName
+          res.data.name = this.fileName ? this.fileName : fileName
           res.data.key = res.data.dir + fileKey
           resolve(res.data)
         }).catch(res => {
@@ -199,17 +200,21 @@ export default {
         spinner: 'el-icon-loading',
         background: 'rgba(0, 0, 0, 0.7)'
       })
-      console.log(file)
+
+      const fileName = file.name.substring(0, file.name.lastIndexOf('.'))
+      const suffix = file.name.match(/.[^.]+$/)[0]
+      // 押金申请上传限制
+      if (this.startRestricting) {
+        console.log(this.restrictFilename.join(''))
+        if (fileName.includes(this.restrictFilename.join('')) === -1 || !suffix.includes('zip', 'rar', 'gz', 'apk')) {
+          this.fileName = `其他文件${suffix}`
+          console.log(this.fileName, '4454')
+        }
+      }
+
       this.$emit('handleIsFileName', file.name)
       this.dataObj = await this.getOssConfig(file.name)
       this.waitUploadList.push(this.dataObj)
-      if (this.startRestricting && !['zip', 'rar', 'gz', 'apk'].includes(file.name.split('.')[1])) {
-        if (!this.restrictFilename.includes(file.name.split('.')[0])) {
-          this.$errorMsg('请根据固定文件名称上传:' + this.restrictFilename.join())
-          loading.close()
-          return Promise.reject()
-        }
-      }
     },
 
     // 文件上传成功
@@ -220,6 +225,7 @@ export default {
         spinner: 'el-icon-loading',
         background: 'rgba(0, 0, 0, 0.7)'
       })
+
       if (this.uploadImageUrl) {
         const index = findElem(this.fileList, 'url', this.uploadImageUrl)
         this.$set(this.fileList, index, {
@@ -229,28 +235,13 @@ export default {
         })
         this.waitUploadList = []
       } else {
-        const index = findElem(this.waitUploadList, 'name', file.name)
-
-        if (this.startRestricting) {
-          if (this.fileList.length) {
-            for (let i = 0; i < this.fileList.length; i++) {
-              if (this.fileList[i].name.split('.')[0] === file.name.split('.')[0]) {
-                this.fileList[i].name = this.waitUploadList[index].name
-                this.fileList[i].url = this.waitUploadList[index].key
-                this.fileList[i].hover = false
-                this.waitUploadList.splice(index, 1)
-                this.showFileList = true
-                loading.close()
-                return false
-              }
-            }
-          }
-        }
+        const index = findElem(this.waitUploadList, 'name', this.fileName ? this.fileName : file.name)
         this.fileList.push({
           name: this.waitUploadList[index].name,
           url: this.waitUploadList[index].key,
           hover: false
         })
+
         this.waitUploadList.splice(index, 1)
       }
       this.showFileList = true

+ 1 - 1
src/views/engin_deposit/components/deposit-apply-surrender.vue

@@ -287,7 +287,7 @@ export default {
       fileList: [],
       details: {},
       restrictFilename: [
-        '安装结算单', '合同', '竣工明细表', '审核表', '收据', '片'
+        '安装结算单', '合同', '竣工明细表', '审核表', '收据', '片'
       ]
     };
   },

+ 9 - 8
src/views/engin_deposit/deposit_list.vue

@@ -122,8 +122,8 @@
             ></el-table-column>
             <el-table-column
               align="center"
-              label="工程名称"
-              prop="refProjectName"
+              label="使用单位"
+              prop="refUseUnit"
               min-width="160"
               show-overflow-tooltip
             ></el-table-column>
@@ -284,12 +284,13 @@
 </template>
 
 <script>
-import DepositListDetail from "./components/deposit_list-detail";
-import DepositApplyDeduction from "./components/deposit-apply-deduction.vue";
-import DepositApplySurrender from "./components/deposit-apply-surrender.vue";
-import { downloadFiles, handleImport } from "@/utils/util";
-import { getList } from "@/api/engin_deposit.js";
-import Mixin from "@/mixin";
+import DepositListDetail from './components/deposit_list-detail'
+import DepositApplyDeduction from './components/deposit-apply-deduction.vue'
+import DepositApplySurrender from './components/deposit-apply-surrender.vue'
+import { downloadFiles, handleImport } from '@/utils/util'
+import { getList } from '@/api/engin_deposit.js'
+import Mixin from '@/mixin'
+
 export default {
   mixins: [Mixin],
   components: {

+ 3 - 3
src/views/sales_policy/components/AddPolicy.vue

@@ -29,10 +29,10 @@
                 </el-form-item>
               </el-col>
               <el-col :xs="24" :ms="12" :lg="12">
-                <el-form-item label="销售政策说明" prop="title">
+                <el-form-item label="销售政策名称" prop="title">
                   <el-input
                     v-model="searchForm.title"
-                    placeholder="销售政策说明"
+                    placeholder="销售政策名称"
                   />
                 </el-form-item>
               </el-col>
@@ -88,7 +88,7 @@
                     value-format="yyyy-MM-dd HH:mm:ss"
                   /> </el-form-item></el-col>
               <el-col :xs="24" :ms="24" :lg="24">
-                <el-form-item label="表头备注" prop="remark">
+                <el-form-item label="销售政策说明" prop="remark">
                   <el-input
                     v-model="searchForm.remark"
                     placeholder="新风机变频挂机。按提货数量1:3开单"

+ 18 - 6
src/views/supply/policy/components/retail_form.vue

@@ -409,8 +409,8 @@
           label-width="120px"
           size="small"
         >
-          <el-row v-if="factor.length" style="margin: 0 0 20px 0">
-            引用销售政策说明:{{ factor.length ? factor[0].name : "" }}
+          <el-row v-if="factor.length && !dataList.length" style="margin: 0 0 20px 0;font-size: 20px;">
+           引用销售政策说明:{{!remark ? factor[0].name : remark }} 配提比列:{{pop}}
           </el-row>
           <el-row :gutter="20">
             <el-col :xs="24" :sm="6" :lg="6">
@@ -577,9 +577,9 @@
               </el-pagination>
             </div> -->
           </div>
-          <div v-if="factor.length">
-            引用销售政策说明:{{ factor.length ? factor[0].name : "" }}
-          </div>
+<!--          <div v-if="factor.length">-->
+<!--            引用销售政策说明:{{ factor.length ? factor[0].name : "" }} 配提比列:{{pop}}-->
+<!--          </div>-->
           <span slot="footer" class="dialog-footer">
             <el-button type="primary" @click="hanlePopData">完成</el-button>
           </span>
@@ -822,7 +822,8 @@ export default {
       totalAmount: 0,
       totalArr: [],
       type: 1,
-      newMultipleSelections: []
+      newMultipleSelections: [],
+      remark:''
     }
   },
 
@@ -982,6 +983,7 @@ export default {
 
         this.factor = data
         this.pop = data[0].pop
+        this.remark = data[0].remark || ''
         this.popArr = data[0].pop.split(':')
 
         if (this.policyId) {
@@ -1069,6 +1071,16 @@ export default {
         }
       }
       const datas = data.records
+      if (this.listItem) {
+
+        for (let i = 0; i < this.goodsList.length; i++) {
+          for (let j = 0; j < datas.length; j++) {
+            if (datas[j].id == this.goodsList[i].policyMaterialId) {
+              this.$set(datas[j], 'disabled', true)
+            }
+          }
+        }
+      }
       // this.total = data.total;
       // console.log(this.goodsList,'4555');
       if (this.goodsList.length) {