Browse Source

Merge branch 'develop_yh30' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_yh30

lilei 1 năm trước cách đây
mục cha
commit
06c04f11f0

+ 3 - 1
src/views/common/creatorList.vue

@@ -22,7 +22,6 @@
 </template>
 <script>
 import debounce from 'lodash/debounce'
-import { dealerDetailBySn } from '@/api/dealer'
 import { queryCreatorList } from '@/api/promotion'
 export default {
   props: {
@@ -77,6 +76,9 @@ export default {
     },
     resetForm () {
       this.creatorName = []
+    },
+    setDefaultVal (val) {
+      this.creatorName = val
     }
   }
 }

+ 1 - 1
src/views/promotionRulesManagement/dealerPromotions/importGuideModal.vue

@@ -18,7 +18,7 @@
             <li v-if="goodFlag==='1'">1) 导入的Excel文件中必须包含名为“产品编码”的列,“产品编码”必填</li>
             <li v-else>1) 导入的Excel文件中必须包含名为“产品编码”、“省级特价”、“市级特价”和“特约特价”的列,都为必填,省级特价≤市级特价≤特约特价</li>
             <li>2) 如果导入的产品已经存在,则不会导入该行</li>
-            <li>3)设置类型和起订数量非必填:设置类型为空则默认为“按数量设置”,起订数量为空则默认为“1”。</li>
+            <li>3)起订类型和起订数量非必填:起订类型为空则默认为“按数量设置”,起订数量为空则默认为“1”。</li>
             <li>
               <a :href="filePath" style="margin: 5px 0 0;display: block;">
                 <a-icon type="download" style="padding-right: 5px;" />下载导入模板

+ 17 - 5
src/views/promotionRulesManagement/dealerPromotions/list.vue

@@ -63,11 +63,12 @@
       </div>
     </a-card>
     <a-card size="small" :bordered="false">
+      <!-- v-if="$hasPermissions('B_dealerAudit')" -->
       <a-spin :spinning="spinning" tip="Loading...">
         <!-- 操作按钮 -->
         <div class="table-operator tableBtnSet" >
           <a-button v-if="$hasPermissions('B_dealerPromotionAdd')" id="promotionList-add" type="primary" @click="handleAdd">新增</a-button>
-          <a-checkbox @change="handleDealerAudit" v-if="$hasPermissions('B_dealerAudit')">
+          <a-checkbox @change="handleDealerAudit" :checked="queryParam.dealerAuditFlag &&queryParam.dealerAuditFlag==1">
             待审核(修改参与客户)
           </a-checkbox>
         </div>
@@ -269,7 +270,8 @@ export default {
         queryWord: '',
         enabledFlag: undefined, // 发布状态
         state: undefined,
-        creatorId: undefined
+        creatorId: undefined,
+        dealerAuditFlag: undefined
       },
       columns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
@@ -333,7 +335,7 @@ export default {
     handleCustomers (row) {
       this.openCustomerModal = true
       this.itemPromotionSn = row.promotionSn
-      if ((row.state === 'NOT_START' || row.state === 'RUNNING') && row.dealerAuditFlag && row.dealerAuditFlag == 0) {
+      if ((row.state === 'NOT_START' || row.state === 'RUNNING') && row.dealerAuditFlag && (row.dealerAuditFlag == 0 || row.dealerAuditFlag == 2)) {
         this.itemStatusType = 'isEdit'
       } else if ((row.state === 'NOT_START' || row.state === 'RUNNING') && row.dealerAuditFlag && row.dealerAuditFlag == 1) {
         this.itemStatusType = 'isAudit'
@@ -384,7 +386,7 @@ export default {
     },
     // 审核参与客户
     handleDealerAudit (val) {
-      this.queryParam.dealerAuditFlag = val.target.checked ? '1' : '0'
+      this.queryParam.dealerAuditFlag = val.target.checked ? '1' : undefined
       this.$nextTick(() => {
         this.$refs.table.refresh(true)
       })
@@ -527,7 +529,9 @@ export default {
         endDate: undefined,
         queryWord: '',
         enabledFlag: undefined, // 发布状态
-        state: undefined
+        state: undefined,
+        creatorId: undefined,
+        dealerAuditFlag: undefined
       }
       this.$refs.rangeDate.resetDate()
       this.$refs.table.refresh(true)
@@ -544,6 +548,14 @@ export default {
       this.itemSn = null
       this.rowSelectionInfo = null
       this.$refs.table.clearTable()
+      // 获取创建人默认值
+      const creatorObj = this.$store.getters.userInfo
+      const newObj = {
+        key: creatorObj.userid,
+        name: creatorObj.rootOrgName,
+        label: creatorObj.rootOrgName
+      }
+      this.$refs.creatorList.setDefaultVal(newObj)
     },
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight

+ 7 - 6
src/views/promotionRulesManagement/dealerPromotions/lookUpCustomersModal.vue

@@ -63,11 +63,12 @@
           </template>
         </s-table>
       </a-card>
+      <div style="text-align:right;color:#666;" v-if="showType ==='isEdit' || (showType === 'isAudit'&& !$hasPermissions('B_dealerAudit'))"><span v-if="showType === 'isAudit'&& !$hasPermissions('B_dealerAudit')">待审核,</span>增加的客户显示红色,删除的客户显示绿色</div>
       <div class="btn-cont" v-if="showType ==='isEdit'">
         <a-button type="primary" class="button-warning" @click="editDealerModal">修改</a-button>
         <a-button type="primary" style="margin-left: 15px;" :loading="spinning" id="promotion-modal-save" @click="submitAudit">提交审核</a-button>
       </div>
-      <div class="btn-cont" v-if="showType === 'isAudit'&& $hasPermissions('B_dealerAudit') ">
+      <div class="btn-cont" v-if="showType === 'isAudit'&& $hasPermissions('B_dealerAudit')">
         <a-button @click="handleAudit('AUDIT_REJECT')">审核不通过</a-button>
         <a-button type="primary" style="margin-left: 15px;" :loading="spinning" id="promotion-modal-save" @click="handleAudit('AUDIT_PASS')">审核通过</a-button>
       </div>
@@ -184,7 +185,6 @@ export default {
       const _this = this
       _this.openDealerModal = true
       const arr = _this.chooseDealerList
-      console.log('111111111111111:',arr)
       // 选择参与客户回显
       _this.$nextTick(() => {
         _this.$refs.dealerChoose.pageInit(arr)
@@ -193,7 +193,7 @@ export default {
     // 添加经销商
     handleAddDealer (list) {
       const newArr = []
-      let dealerSnArr= []
+      const dealerSnArr = []
       list.forEach(item => {
         const obj = {
           dealerScope: this.itemSn ? 'SOME_DEALER' : 'ALL_DEALER',
@@ -243,14 +243,16 @@ export default {
       this.updateFlag = false
       this.$refs.areaList.clearData()
       this.$refs.subarea.clearData()
-      this.$refs.table.clearTable()
+      this.$refs.table.refresh(true)
     },
     //  导出
     handleExport () {
       const _this = this
       _this.exportLoading = true
       _this.spinning = true
-      hdExportExcel(dealerExport, _this.queryParam, '促销经销商列表导出', function () {
+      _this.queryParam.dealerSnList = this.chooseDealerList
+      const paramsData = _this.queryParam
+      hdExportExcel(dealerExport, paramsData, '促销经销商列表导出', function () {
         _this.exportLoading = false
         _this.spinning = false
         _this.showExport = true
@@ -277,7 +279,6 @@ export default {
         this.$emit('close')
         this.resetSearchForm()
       } else {
-        console.log('this.showType', this.showType)
         this.$nextTick(() => {
           this.$refs.table.refresh(true)
         })

+ 1 - 9
src/views/promotionRulesManagement/dealerPromotions/sendAmountModal.vue

@@ -260,16 +260,8 @@ export default {
       this.openGuideModal = false
     },
     hanldeOk (arr) {
-      const resultArr = []
-      arr.forEach(item => {
-        const obj = {
-          productCode: item.productCode,
-          productSn: item.product.productSn
-        }
-        resultArr.push(obj)
-      })
       const name = this.chooseVal == 'a' ? 'cill' : this.chooseVal == 'b' ? 'normalPrice' : 'offer'
-      this.$refs[name + 'Product'].importRow(resultArr)
+      this.$refs[name + 'Product'].importRow(arr)
     },
     // 计算百分比
     calculatePrice () {

+ 1 - 9
src/views/promotionRulesManagement/dealerPromotions/sendProductsModal.vue

@@ -292,16 +292,8 @@ export default {
       this.openGuideModal = false
     },
     hanldeOk (arr) {
-      const resultArr = []
-      arr.forEach(item => {
-        const obj = {
-          productCode: item.productCode,
-          productSn: item.product.productSn
-        }
-        resultArr.push(obj)
-      })
       const name = this.chooseVal == 'a' ? 'cill' : this.chooseVal == 'b' ? 'normalPrice' : 'offer'
-      this.$refs[name + 'Product'].importRow(resultArr)
+      this.$refs[name + 'Product'].importRow(arr)
     },
     // 限制正价产品款数
     onChange (e) {

+ 8 - 8
src/views/promotionRulesManagement/dealerPromotions/specialOfferModal.vue

@@ -481,16 +481,16 @@ export default {
     hanldeOk (arr) {
       // 门槛产品导入
       const resultArr = []
+      arr.forEach(item => {
+        const obj = {
+          productCode: item.productCode,
+          productSn: item.product.productSn
+        }
+        resultArr.push(obj)
+      })
       if (this.chooseVal == 'a') {
-        arr.forEach(item => {
-          const obj = {
-            productCode: item.productCode,
-            productSn: item.product.productSn
-          }
-          resultArr.push(obj)
-        })
         const name = this.chooseVal == 'a' ? 'cill' : this.chooseVal == 'b' ? 'normalPrice' : 'offer'
-        this.$refs[name + 'Product'].importRow(resultArr)
+        this.$refs[name + 'Product'].importRow(arr)
       } else {
         // 特价产品导入
         const dataList = this.setShowData('This')

+ 16 - 13
src/views/promotionRulesManagement/dealerPromotions/tableType1.vue

@@ -173,6 +173,7 @@ import ChooseBrandModal from '@/views/common/chooseBrandModal.vue'
 import ChooseTypeModal from '@/views/common/chooseTypeModal.vue'
 import chooseProductsModal from './chooseProductsModal.vue'
 import { getNewScopeSn } from '@/api/promotion'
+import { forEach } from 'core-js/library/es6/array'
 export default {
   name: 'TableType1',
   mixins: [commonMixin],
@@ -231,23 +232,25 @@ export default {
       const _this = this
       const dataList = _this.setShowData('This')
       dataList.forEach(item => {
-        const pos = list.indexOf(con => con.productSn == item.goodsSn)
+        const pos = list.indexOf(con => item.product.productSn == item.goodsSn)
         list.splice(pos, 1)
       })
       if (list.length > 0) {
-        _this.spinning = true
-        getNewScopeSn({}).then(res => {
-          if (res.status == 200) {
-            const newData = {
-              productScopeSn: res.data,
-              productThisList: list,
-              unitType: 'SL',
-              unitQty: 1
+        list.forEach(con => {
+          getNewScopeSn({}).then(res => {
+            if (res.status == 200) {
+              const newData = {
+                productScopeSn: res.data,
+                productThisList: [{
+                  productCode: con.productCode,
+                  productSn: con.product.productSn
+                }],
+                unitType: con.unitType,
+                unitQty: con.unitQty
+              }
+              _this.dataSource.push(newData)
             }
-            _this.dataSource.push(newData)
-          } else {
-            _this.spinning = false
-          }
+          })
         })
       } else {
         _this.$message.warning('请勿导入重复数据!')

+ 13 - 10
src/views/promotionRulesManagement/dealerPromotions/tableType2.vue

@@ -205,20 +205,23 @@ export default {
       const _this = this
       const dataList = _this.setShowData('This')
       dataList.forEach(item => {
-        const pos = list.indexOf(con => con.productSn == item.goodsSn)
+        const pos = list.indexOf(con => item.product.productSn == item.goodsSn)
         list.splice(pos, 1)
       })
       if (list.length > 0) {
-        getNewScopeSn({}).then(res => {
-          if (res.status == 200) {
-            const newData = {
-              productScopeSn: res.data,
-              productThisList: list
+        list.forEach(con => {
+          getNewScopeSn({}).then(res => {
+            if (res.status == 200) {
+              const newData = {
+                productScopeSn: res.data,
+                productThisList: [{
+                  productCode: con.productCode,
+                  productSn: con.product.productSn
+                }]
+              }
+              _this.dataSource.push(newData)
             }
-            _this.dataSource.push(newData)
-          } else {
-            _this.spinning = false
-          }
+          })
         })
       } else {
         _this.$message.warning('请勿导入重复数据!')