Browse Source

修改bug

chenrui 1 year ago
parent
commit
e427802816

+ 20 - 8
src/views/promotionRulesManagement/dealerPromotions/chooseImportModal.vue

@@ -22,6 +22,9 @@
         :scroll="{ y: 200 }"
         :pagination="false"
         bordered>
+        <template slot="unitTypeShow" slot-scope="text,record">
+          {{ record.unitType==='SL'?'按数量设置':'按整箱设置' }}
+        </template>
       </a-table>
       <a-divider />
       <!-- 不可导入数据 -->
@@ -37,6 +40,9 @@
         :scroll="{ y: 200 }"
         :pagination="false"
         bordered>
+        <template slot="unitTypeShow" slot-scope="text,record">
+          {{ record.unitType==='SL'?'按数量设置':'按整箱设置' }}
+        </template>
         <template slot="errorMsg" slot-scope="text,record">
           <a-popover placement="topRight">
             <template slot="content">
@@ -100,7 +106,8 @@ export default {
       loadData: [],
       unLoadData: [],
       loading: false,
-      goodsFlag: ''
+      goodsFlag: '',
+      discountType: ''
     }
   },
   computed: {
@@ -109,9 +116,11 @@ export default {
       let columnsArr = [
         { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
         { title: '产品编码', dataIndex: 'productCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'product.name', width: '50%', align: 'center', customRender: function (text) { return text || '--' } }
+        { title: '产品名称', dataIndex: 'product.name', width: '30%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '起订类型', scopedSlots: { customRender: 'unitTypeShow' }, dataIndex: 'unitType', width: '20%', align: 'center' },
+        { title: '起订数量', dataIndex: 'unitQty', width: '20%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } }
       ]
-      if (_this.goodsFlag == '0') {
+      if (_this.goodsFlag == '0' && _this.discountType == '0') {
         const arr = [
           { title: '省级特价', dataIndex: 'provinceDiscountPriceText', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
           { title: '市级特价', dataIndex: 'cityDiscountPriceText', width: '10%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
@@ -124,12 +133,14 @@ export default {
     nowUnColumns () {
       const _this = this
       const unColumnsArr = [
-        { title: '序号', dataIndex: 'no', width: '10%', align: 'center' },
-        { title: '产品编码', dataIndex: 'productCode', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
-        { title: '产品名称', dataIndex: 'product.name', width: '50%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '产品编码', dataIndex: 'productCode', width: '10%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '产品名称', dataIndex: 'product.name', width: '25%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '起订类型', scopedSlots: { customRender: 'unitTypeShow' }, dataIndex: 'unitType', width: '15%', align: 'center' },
+        { title: '起订数量', dataIndex: 'unitQty', width: '10%', align: 'center', customRender: function (text) { return (text || text == 0) ? text : '--' } },
         { title: '错误说明', scopedSlots: { customRender: 'errorMsg' }, width: '20%', align: 'center' }
       ]
-      if (_this.goodsFlag == '0') {
+      if (_this.goodsFlag == '0' && _this.discountType == '0') {
         unColumnsArr.splice(3, 0, { title: '省级特价', dataIndex: 'provinceDiscountPriceText', width: '10%', align: 'right', customRender: function (text) { return text || '--' } },
           { title: '市级特价', dataIndex: 'cityDiscountPriceText', width: '10%', align: 'right', customRender: function (text) { return text || '--' } },
           { title: '特约特价', dataIndex: 'specialDiscountPriceText', width: '10%', align: 'right', customRender: function (text) { return text || '--' } })
@@ -139,7 +150,8 @@ export default {
   },
   methods: {
     setFlag (val) {
-      this.goodsFlag = val
+      this.goodsFlag = val.goodsFlag
+      this.discountType = val.discountType
     },
     getData () {
       const paramsData = JSON.parse(JSON.stringify(this.paramsData))

+ 9 - 4
src/views/promotionRulesManagement/dealerPromotions/importGuideModal.vue

@@ -15,8 +15,8 @@
             <span>1</span>准备导入
           </div>
           <ul>
-            <li v-if="goodFlag==='1'">1) 导入的Excel文件中必须包含名为“产品编码”的列,“产品编码”必填</li>
-            <li v-else>1) 导入的Excel文件中必须包含名为“产品编码”、“省级特价”、“市级特价”和“特约特价”的列,都为必填,省级特价≤市级特价≤特约特价</li>
+            <li v-if="goodFlag==='1'&&discountType!='0'">1) 导入的Excel文件中必须包含名为“产品编码”的列,“产品编码”必填</li>
+            <li v-if="goodFlag==='0'&&discountType=='0'">1) 导入的Excel文件中必须包含名为“产品编码”、“省级特价”、“市级特价”和“特约特价”的列,都为必填,省级特价≤市级特价≤特约特价</li>
             <li>2) 如果导入的产品已经存在,则不会导入该行</li>
             <li>3)起订类型和起订数量非必填:起订类型为空则默认为“按数量设置”,起订数量为空则默认为“1”。</li>
             <li>
@@ -38,6 +38,7 @@
               :maxNums="1"
               fileType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel"
               uploadType="attach"
+              :uploadParams="goodFlag==='0'?{discountType:discountType,savePathType: 'ali'}:undefined"
               :action="goodFlag==='1'?attachAction:attachAction1"
               upText="选择导入文件"
               @remove="resetSearchForm"
@@ -82,7 +83,11 @@ export default {
       type: Object,
       default: null
     },
-    goodFlag: {
+    goodFlag: {//0  特价  1 买产品送产品  买产品送采购额
+      type: [String, Number],
+      default: '0'
+    },
+    discountType:{//0 手动 1折扣 2直降
       type: [String, Number],
       default: '0'
     }
@@ -107,7 +112,7 @@ export default {
     handlerNextStep () {
       if (this.paramsData) {
         this.openImportModal = true
-        this.$refs.chooseImportBox.setFlag(this.goodFlag)
+        this.$refs.chooseImportBox.setFlag({goodFlag:this.goodFlag,discountType:this.discountType})
       } else {
         this.$message.warning('添加文件后再进行下一步操作!')
       }

+ 3 - 3
src/views/promotionRulesManagement/dealerPromotions/list.vue

@@ -45,7 +45,7 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="经销商名称">
-                <a-input id="promotionList-dealerName" v-model.trim="queryParam.dealerName" allowClear placeholder="请输入经销商名称"/>
+                <a-input id="promotionList-dealerNameLike" v-model.trim="queryParam.dealerNameLike" allowClear placeholder="请输入经销商名称"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -277,7 +277,7 @@ export default {
         state: undefined,
         creatorId: undefined,
         dealerAuditFlag: undefined,
-        dealerName: ''
+        dealerNameLike: ''
       },
       columns: [
         { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
@@ -542,7 +542,7 @@ export default {
         state: undefined,
         creatorId: creatorObj.userid,
         dealerAuditFlag: undefined,
-        dealerName: ''
+        dealerNameLike: ''
       }
       this.$refs.rangeDate.resetDate()
       this.$refs.table.refresh(true)

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

@@ -208,7 +208,7 @@
       @close="openProductsModal=false"
       @ok="handleProductsAdd" />
     <!-- 导入产品 -->
-    <importGuideModal :goodFlag="chooseVal=='a'?'1':'0'" :openModal="openGuideModal" @close="closeGuideModel" @ok="hanldeOk" />
+    <importGuideModal :goodFlag="chooseVal=='a'?'1':'0'" :discountType="form.discountType" :openModal="openGuideModal" @close="closeGuideModel" @ok="hanldeOk" />
   </a-modal>
 </template>