Explorar el Código

Finish Hotfix-zh-30

howie hace 3 años
padre
commit
091b753d2c

+ 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: {

+ 4 - 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开单"
@@ -819,6 +819,7 @@ export default {
         deleteMaterialPolicy(params).then((res) => {
           this.dataList.splice(index, 1)
         })
+        return
       }
       this.dataList.splice(index, 1)
       // this.listTotal -= 1;

+ 70 - 36
src/views/sales_policy/components/Examine.vue

@@ -30,21 +30,27 @@
                 {{ detail.status == 1 ? "已生效" : "未生效" }}
               </div>
             </el-col>
-            <el-col :span="8" class="item">
+            <el-col :span="24" class="item">
               <div class="label">销售政策类型</div>
               <div class="value">
-                {{ detail.type == "PROVISION" ? "配提" : "限量" }}
+                <el-select
+                  v-model="detail.type"
+                  size="small"
+                  placeholder="销售政策类型"
+                  class="select_height"
+                >
+                  <el-option
+                    v-for="(item, index) in typeOptions"
+                    :key="index"
+                    :label="item.label"
+                    :value="item.value"
+                  />
+                </el-select>
+
               </div>
             </el-col>
-            <el-col :span="8" class="item">
-              <div class="label"></div>
-              <div class="value"></div>
-            </el-col>
-            <el-col :span="8" class="item">
-              <div class="label"></div>
-              <div class="value"></div>
-            </el-col>
-            <el-col :span="8" class="item">
+
+            <el-col :span="24" class="item">
               <div class="label">备注</div>
               <div class="value">
                 <el-input
@@ -53,29 +59,46 @@
                 ></el-input>
               </div>
             </el-col>
-            <el-col :span="8" class="item">
-              <div class="label"></div>
-              <div class="value"></div>
-            </el-col>
-            <el-col :span="8" class="item">
-              <div class="label"></div>
-              <div class="value"></div>
-            </el-col>
+
             <el-col :span="8" class="item">
               <div class="label">制单人</div>
               <div class="value">{{ detail.createBy }}</div>
             </el-col>
             <el-col :span="8" class="item">
               <div class="label">制单日期</div>
-              <div class="value">{{ detail.createTime }}</div>
+              <div class="value">
+                <el-date-picker
+                  v-model="detail.createTime"
+                  type="datetime"
+                  placeholder="制单日期"
+                  default-time="00:00:00"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                />
+                </div>
             </el-col>
             <el-col :span="8" class="item">
               <div class="label">生效日期</div>
-              <div class="value">{{ detail.startTime }}</div>
+              <div class="value">
+                <el-date-picker
+                  v-model="detail.startTime"
+                  type="datetime"
+                  placeholder="生效日期"
+                  default-time="00:00:00"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                /> </el-form-item>
+                </div>
             </el-col>
-            <el-col :span="8" class="item">
+            <el-col :span="24" class="item">
               <div class="label">失败日期</div>
-              <div class="value">{{ detail.endTime }}</div>
+              <div class="value">
+                <el-date-picker
+                  v-model="detail.endTime"
+                  type="datetime"
+                  placeholder="生效日期"
+                  default-time="00:00:00"
+                  value-format="yyyy-MM-dd HH:mm:ss"
+                /> </el-form-item>
+               </div>
             </el-col>
           </el-row>
           <el-row class="img-box" v-if="detail.imgSrc && $parent.isShow !== 5">
@@ -92,7 +115,7 @@
             </el-col>
           </el-row>
           <el-row v-if="$parent.isShow == 5">
-            <el-col :span="8" class="item">
+            <el-col :span="24" class="item">
               <div class="label" style="height: 150px">政策封面图</div>
               <div class="value" style="height: 150px">
                 <ImageUpload :fileList="fileList" :multiple="false" />
@@ -559,22 +582,21 @@
 <script>
 import {
   deleteCondition,
-  getPolicyDetail,
-  getMaterialList,
-  getCustomerList,
-  getConditionList,
   deleteMaterialPolicy,
+  getConditionList,
   getCrList,
+  getCustomerList,
+  getMaterialList,
+  getPolicyDetail,
   toExamine,
-  addPoliy,
-  updatePolicy,
-} from "@/api/policy_list";
-import EditCondition from "./EditCondition";
-import ImageUpload from "@/components/Common/image-upload.vue";
+  updatePolicy
+} from '@/api/policy_list'
+import EditCondition from './EditCondition'
+import ImageUpload from '@/components/Common/image-upload.vue'
 
-import { handleImport } from "@/utils/util";
+import { handleImport } from '@/utils/util'
 
-import Minxin from "@/mixin";
+import Minxin from '@/mixin'
 
 export default {
   mixins: [Minxin],
@@ -631,6 +653,16 @@ export default {
       importFileList: [],
       leftData: [],
       rightData: [],
+      typeOptions: [
+        {
+          value: 'PROVISION',
+          label: '配提'
+        },
+        {
+          value: 'LIMIT',
+          label: '限量'
+        }
+      ],
     };
   },
   created() {},
@@ -992,7 +1024,9 @@ export default {
   margin-right: 10px;
   display: inline-block;
 }
-
+::v-deep .el-input__icon .el-icon-time{
+  display: none;
+}
 .middle_box {
   margin-top: 80px;
   text-align: center;

+ 6 - 3
src/views/supply/policy/components/retail_examine.vue

@@ -141,7 +141,6 @@
             v-if="scope.row.customerWalletName2"
               type="success"
               size="small"
-
             >
                 {{ scope.row.customerWalletName2 }}
             </el-tag>
@@ -153,7 +152,11 @@
           prop="payRebateAmount"
           min-width="100"
           show-overflow-tooltip
-        ></el-table-column>
+        >
+          <template slot-scope="scope">
+            {{ scope.row.payRebateAmount | numToFixed }}
+          </template>
+        </el-table-column>
         <el-table-column
           align="center"
           label="格力折扣"
@@ -280,7 +283,7 @@
 </template>
 
 <script>
-import { getDetail, examineData } from "@/api/supply/policy";
+import { examineData, getDetail } from '@/api/supply/policy'
 
 export default {
   name: "RetailExamine",

+ 42 - 11
src/views/supply/policy/components/retail_form.vue

@@ -68,6 +68,7 @@
             <el-select
               v-model="mainForm.k3ServiceName"
               placeholder="选择业务员"
+              disabled
               style="width: 100%"
               @change="handleUser"
             >
@@ -204,6 +205,7 @@
               placeholder="选择返利钱包"
               clearable
               size="small"
+              @remove-tag="clearWallet($event,scope.row)"
               @change="changeWallet($event,scope.row)"
             >
               <el-option
@@ -273,7 +275,9 @@
             <el-select
               v-model="scope.row.serviceName"
               size="small"
+              disabled
               placeholder="选择业务员"
+
               style="width: 100%"
               @change="handleUser2($event,scope.row)"
             >
@@ -409,8 +413,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 +581,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 +826,8 @@ export default {
       totalAmount: 0,
       totalArr: [],
       type: 1,
-      newMultipleSelections: []
+      newMultipleSelections: [],
+      remark:''
     }
   },
 
@@ -949,6 +954,9 @@ export default {
       })[0]
       this.$set(row, 'serviceId', user.adminUserId)
       this.$set(row, 'serviceName', user.nickName)
+      this.$set(this.mainForm,'k3ServiceId',user.adminUserId)
+      this.$set(this.mainForm,'k3ServiceName',user.nickName)
+
     },
     // 返回列表
     goBack() {
@@ -982,6 +990,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 +1078,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) {
@@ -1648,12 +1667,24 @@ export default {
     },
     // 修改返利钱包
     changeWallet(e, row) {
-      const obj = row.rebateWallets.filter(k => {
-        return e === k.customerWalletId
-      })[0]
-      this.$set(row, 'rebateRate', (obj.rebateRate || 0))
-    },
+     if (e){
+       const obj = row.rebateWallets.filter(k => {
+         return e === k.customerWalletId
+       })[0]
+       this.$set(row, 'rebateRate', (obj.rebateRate || 0))
+     }else{
+       this.$set(row, 'rebateRate',  0)
+     }
 
+
+    },
+    clearWallet(e){
+      console.log(e)
+      // const obj = row.rebateWallets.filter(k => {
+      //   return e === k.customerWalletId
+      // })[0]
+      this.$set(row, 'rebateRate',0)
+    },
     // 检查库存
     checkStock() {
       if (!this.warehouseValue) {