zh 2 gadi atpakaļ
vecāks
revīzija
f2d602440f

+ 4 - 4
src/layout/components/AppMain.vue

@@ -80,11 +80,11 @@ export default {
         position: 'bottom-right',
         dangerouslyUseHTMLString: true,
         message: (
-          <div>
-            通知:您有一条新的物流通知发货单号${this.invoiceOrderList[0].id},
-            <el-link type='primary' underline={false} onClick={() => That.handleJump()}>
+          <div >
+            <div>通知:您有一条新的物流通知发货单号{this.invoiceOrderList.length && this.invoiceOrderList[0].id}</div>
+            <div style='text-align:right'><el-link type='primary' underline={false} onClick={() => That.handleJump()}>
               点击查看详情
-            </el-link>
+            </el-link></div>
           </div>
         ),
         onClose() {

+ 1 - 1
src/views/sales_policy/components/Examine.vue

@@ -493,7 +493,7 @@
                   {{ scope.row.minBuyNum }}
                 </template>
               </el-table-column>
-              <el-table-column prop="maxBuyNum" label="最大提货数" align="left" min-width="200">
+              <el-table-column prop="maxBuyNum" label="最大提货数" align="left" min-width="200">
                 <template slot-scope="scope">
                   {{ scope.row.maxBuyNum }}
                 </template>

+ 207 - 154
src/views/sales_policy/components/TabelTransfer.vue

@@ -149,6 +149,14 @@
             <el-button type="primary" size="mini">导入经销商</el-button>
           </el-upload>
           <el-button type="primary" size="mini" @click="hanleDownloadFilesPolicy">下载模板</el-button>
+          <el-button
+            type="primary"
+            size="mini"
+            @click="()=>{
+              buyNumvisible = true
+              handelBatchData()
+            }"
+          >批量修改上限</el-button>
         </div>
         <el-row type="flex" style="margin: 20px 0">
           <el-col :xs="24" :sm="12" :lg="14">
@@ -202,6 +210,7 @@
                   handelBatchData()
                 }"
               >批量修改上限</el-button>
+
               <!-- <el-button
                 v-if="list.length"
                 type="primary"
@@ -256,7 +265,7 @@
                 {{ scope.row.minBuyNum }}
               </template>
             </el-table-column>
-            <el-table-column prop="maxBuyNum" label="最大提货数" align="left" min-width="200">
+            <el-table-column prop="maxBuyNum" label="最大提货数" align="left" min-width="200">
               <template slot-scope="scope">
                 {{ scope.row.maxBuyNum }}
               </template>
@@ -404,153 +413,160 @@
           </div>
         </div>
       </div>
-      </div>
-      <!-- 操作按钮 -->
-      <slot name="footer">
-        <el-row style="margin: 20px 0 0 0">
-          <el-button type="primary" size="mini" @click="handleSave">
-            {{ comCode ? '保存' : '提交审核' }}
-          </el-button>
-          <el-button type="primary" size="mini" @click="handleReset">重置</el-button>
-        </el-row>
-      </slot>
-      <el-dialog
-        title="批量修改"
-        :visible.sync="visible"
-        width="50%"
-        :append-to-body="true"
-        :close-on-click-modal="false"
-        @close="handleDialogVisible"
-      >
-        <el-row :gutter="20">
-          <el-col :span="24" style="display: flex; align-items: center; margin-bottom: 20px">
-            <el-col :span="4" :offset="0"> 购买量上限 </el-col>
-            <el-col :span="8" :offset="0"> <el-input v-model="limitQty" size="mini" /></el-col>
-          </el-col>
-          <el-col :span="24" :offset="0" style="margin-bottom: 20px">
-            <div style="display: flex">
-              <el-input v-model="limitQtyKeyWord" placeholder="输入关键字搜索" size="mini" />
-              <el-button style="margin-left: 20px" type="primary" size="mini" @click="handelBatchData('search')">查询</el-button>
-              <el-button size="mini" @click="onReset">重置</el-button>
-            </div>
-          </el-col>
-        </el-row>
+    </div>
+    <!-- 操作按钮 -->
+    <slot name="footer">
+      <el-row style="margin: 20px 0 0 0">
+        <el-button type="primary" size="mini" @click="handleSave">
+          {{ comCode ? '保存' : '提交审核' }}
+        </el-button>
+        <el-button type="primary" size="mini" @click="handleReset">重置</el-button>
+      </el-row>
+    </slot>
+    <el-dialog
+      title="批量修改"
+      :visible.sync="visible"
+      width="50%"
+      :append-to-body="true"
+      :close-on-click-modal="false"
+      @close="handleDialogVisible"
+    >
+      <el-row :gutter="20">
+        <el-col :span="24" style="display: flex; align-items: center; margin-bottom: 20px">
+          <el-col :span="4" :offset="0"> 购买量上限 </el-col>
+          <el-col :span="8" :offset="0"> <el-input v-model.number="limitQty" type="number" size="mini" /></el-col>
+        </el-col>
+        <el-col :span="24" :offset="0" style="margin-bottom: 20px">
+          <div style="display: flex">
+            <el-input v-model="limitQtyKeyWord" placeholder="输入关键字搜索" size="mini" />
+            <el-button style="margin-left: 20px" type="primary" size="mini" @click="handelBatchData('search')">查询</el-button>
+            <el-button size="mini" @click="onReset">重置</el-button>
+          </div>
+        </el-col>
+      </el-row>
 
-        <zj-table
-          :table-attributes="tableAttributes"
-          :table-events="tableEvents"
-          :is-drop="true"
-          :columns="columns"
-          :table-data="tableData"
+      <zj-table
+        :table-attributes="tableAttributes"
+        :table-events="tableEvents"
+        :is-drop="true"
+        :columns="columns"
+        :table-data="tableData"
+      />
+      <div style="margin: 20px 0">
+        <el-pagination
+          :current-page="batchCurrentPages"
+          :page-sizes="[10, 20, 30, 50]"
+          :page-size="10"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="batchTotal"
+          @size-change="handleBatchSizeChanges"
+          @current-change="handleBatchCurrentChanges"
         />
-        <div style="margin: 20px 0">
-          <el-pagination
-            :current-page="batchCurrentPages"
-            :page-sizes="[10, 20, 30, 50]"
-            :page-size="10"
-            layout="total, sizes, prev, pager, next, jumper"
-            :total="batchTotal"
-            @size-change="handleBatchSizeChanges"
-            @current-change="handleBatchCurrentChanges"
-          />
-        </div>
-        <span slot="footer">
-          <el-button @click="handleDialogVisible">取消</el-button>
-          <el-button type="primary" @click="onSubmit('limit')">确定</el-button>
-        </span>
-      </el-dialog>
-      <el-dialog
-        title="批量修改"
-        :visible.sync="maxBuyNumVisible"
-        width="50%"
-        :append-to-body="true"
-        :close-on-click-modal="false"
-        @close="handleDialogVisible"
-      >
-        <el-row :gutter="20">
-          <el-col :span="24" style="display: flex; align-items: cente; margin-bottom: 20px">
-            <el-col :span="5" :offset="0"> 最大提货组数 </el-col>
-            <el-col :span="8" :offset="0"> <el-input v-model="maxBuyNum" size="mini" /></el-col>
-          </el-col>
-          <el-col :span="24" :offset="0" style="margin-bottom: 20px">
-            <div style="display: flex">
-              <el-input v-model="maxBuyNumKeyWord" placeholder="输入关键字搜索" size="mini" clearable />
-              <el-button style="margin-left: 20px" type="primary" size="mini" @click="handelBatchData('search')">查询</el-button>
-              <el-button size="mini" @click="onReset">重置</el-button>
-            </div>
-          </el-col>
-        </el-row>
+      </div>
+      <span slot="footer">
+        <el-button @click="handleDialogVisible">取消</el-button>
+        <el-button type="primary" @click="onSubmit($event,'limit')">确定</el-button>
+      </span>
+    </el-dialog>
+    <el-dialog
+      title="批量修改"
+      :visible.sync="limitGroupvisible"
+      width="50%"
+      :append-to-body="true"
+      :close-on-click-modal="false"
+      @close="handleLimitDialogVisible"
+    >
+      <el-row :gutter="20">
+        <el-col :span="24" style="display: flex; align-items: center; margin-bottom: 20px">
+          <el-col :span="4" :offset="0"> 配提套数上限 </el-col>
+          <el-col :span="8" :offset="0"> <el-input v-model.number="limitGroupNum" type="number" size="mini" /></el-col>
+        </el-col>
+        <el-col :span="24" :offset="0" style="margin-bottom: 20px">
+          <div style="display: flex">
+            <el-input v-model="limitGroupKeyWord" placeholder="输入关键字搜索" size="mini" />
+            <el-button style="margin-left: 20px" type="primary" size="mini" @click="handelLimitGroupData('search')">查询</el-button>
+            <el-button size="mini" @click="onLimitReset">重置</el-button>
+          </div>
+        </el-col>
+      </el-row>
 
-        <zj-table
-          :table-attributes="tableAttributes"
-          :table-events="tableEvents"
-          :is-drop="true"
-          :columns="columns"
-          :table-data="tableData"
+      <zj-table
+        :table-attributes="tableAttributes"
+        :table-events="tableEvents"
+        :is-drop="true"
+        :columns="limitColumns"
+        :table-data="limitTableData"
+      />
+      <div style="margin: 20px 0">
+        <el-pagination
+          :current-page="limitCurrentPages"
+          :page-sizes="[10, 20, 30, 50]"
+          :page-size="10"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="limitTotal"
+          @size-change="handleLimitSizeChanges"
+          @current-change="handleLimitCurrentChanges"
         />
-        <div style="margin: 20px 0">
-          <el-pagination
-            :current-page="batchCurrentPages"
-            :page-sizes="[10, 20, 30, 50]"
-            :page-size="10"
-            layout="total, sizes, prev, pager, next, jumper"
-            :total="batchTotal"
-            @size-change="handleBatchSizeChanges"
-            @current-change="handleBatchCurrentChanges"
-          />
-        </div>
-        <span slot="footer">
-          <el-button @click="handleDialogVisible">取消</el-button>
-          <el-button type="primary" @click="onSubmit">确定</el-button>
-        </span>
-      </el-dialog>
-      <el-dialog
-        title="批量修改"
-        :visible.sync="limitGroupvisible"
-        width="50%"
-        :append-to-body="true"
-        :close-on-click-modal="false"
-        @close="handleLimitDialogVisible"
-      >
-        <el-row :gutter="20">
-          <el-col :span="24" style="display: flex; align-items: center; margin-bottom: 20px">
-            <el-col :span="4" :offset="0"> 配提套数上限 </el-col>
-            <el-col :span="8" :offset="0"> <el-input v-model="limitGroupNum" size="mini" /></el-col>
-          </el-col>
-          <el-col :span="24" :offset="0" style="margin-bottom: 20px">
-            <div style="display: flex">
-              <el-input v-model="limitGroupKeyWord" placeholder="输入关键字搜索" size="mini" />
-              <el-button style="margin-left: 20px" type="primary" size="mini" @click="handelLimitGroupData('search')">查询</el-button>
-              <el-button size="mini" @click="onLimitReset">重置</el-button>
-            </div>
-          </el-col>
-        </el-row>
+      </div>
+      <span slot="footer">
+        <el-button @click="handleLimitDialogVisible">取消</el-button>
+        <el-button type="primary" @click="onLimitSubmit('limit')">确定</el-button>
+      </span>
+    </el-dialog>
+    <el-dialog
+      title="批量修改"
+      :visible.sync="buyNumvisible"
+      width="50%"
+      :append-to-body="true"
+      :close-on-click-modal="false"
+      @close="handleDialogVisible"
+    >
+      <el-row :gutter="20">
+        <el-col :span="24" style="display: flex; align-items: center; margin-bottom: 20px">
+          <el-col :span="4" :offset="0"> 最小提货数量 </el-col>
+          <el-col :span="8" :offset="0"> <el-input v-model.number="minBuyNum" type="number" size="mini" /></el-col>
+          <el-col :span="4" :offset="0"> 最大提货组数 </el-col>
+          <el-col :span="8" :offset="0"> <el-input v-model.number="maxBuyNum" type="number" size="mini" /></el-col>
+        </el-col>
+        <el-col :span="24" :offset="0" style="margin-bottom: 20px">
+          <div style="display: flex">
+            <el-input v-model="limitQtyKeyWord" placeholder="输入关键字搜索" size="mini" />
+            <el-button
+              style="margin-left: 20px"
+              type="primary"
+              size="mini"
+              @click="handelBatchData('search')"
+            >查询</el-button>
+            <el-button size="mini" @click="onReset">重置</el-button>
+          </div>
+        </el-col>
+      </el-row>
 
-        <zj-table
-          :table-attributes="tableAttributes"
-          :table-events="tableEvents"
-          :is-drop="true"
-          :columns="columns"
-          :table-data="limitTableData"
+      <zj-table
+        :table-attributes="tableAttributes"
+        :table-events="tableEvents"
+        :is-drop="true"
+        :columns="columns"
+        :table-data="tableData"
+      />
+      <div style="margin: 20px 0">
+        <el-pagination
+          :current-page="batchCurrentPages"
+          :page-sizes="[10, 20, 30, 50]"
+          :page-size="10"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total="batchTotal"
+          @size-change="handleBatchSizeChanges"
+          @current-change="handleBatchCurrentChanges"
         />
-        <div style="margin: 20px 0">
-          <el-pagination
-            :current-page="limitCurrentPages"
-            :page-sizes="[10, 20, 30, 50]"
-            :page-size="10"
-            layout="total, sizes, prev, pager, next, jumper"
-            :total="limitTotal"
-            @size-change="handleLimitSizeChanges"
-            @current-change="handleLimitCurrentChanges"
-          />
-        </div>
-        <span slot="footer">
-          <el-button @click="handleLimitDialogVisible">取消</el-button>
-          <el-button type="primary" @click="onLimitSubmit('limit')">确定</el-button>
-        </span>
-      </el-dialog>
-    </div>
-  </div></template>
+      </div>
+      <span slot="footer">
+        <el-button @click="handleDialogVisible">取消</el-button>
+        <el-button type="primary" @click="onSubmit">确定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
 
 <script>
 import {
@@ -676,7 +692,9 @@ export default {
       limitCurrentPages: 1,
       limitTotal: 0,
       limitPageSizes: 10,
-      limitTableData: []
+      limitTableData: [],
+      buyNumvisible: false,
+      minBuyNum: 0
     }
   },
   computed: {
@@ -710,6 +728,22 @@ export default {
           }
         }
       ]
+    },
+    limitColumns() {
+      return [
+        {
+          columnAttributes: {
+            label: '经销商编码',
+            prop: 'customerNumber'
+          }
+        },
+        {
+          columnAttributes: {
+            label: '经销商名称',
+            prop: 'customerName'
+          }
+        }
+      ]
     }
   },
   watch: {
@@ -1062,23 +1096,24 @@ export default {
     },
     handleDialogVisible() {
       this.visible = false
+      this.buyNumvisible = false
       this.maxBuyNumVisible = false
       this.batchCurrentPages = 1
       this.batchPageSizes = 10
       this.limitQty = 0
       this.maxBuyNum = 0
+      this.minBuyNum = 0
       this.limitQtyKeyWord = ''
       this.maxBuyNumKeyWord = ''
     },
-    onSubmit(type) {
+    onSubmit(e, type) {
+      console.log(type)
       if (!this.selectedData.length) {
         this.$errorMsg('不能为空,请选择')
         return
       }
-      if (this.limitQty <= 0 || this.maxBuyNum <= 0) {
-        this.$errorMsg(type ? '购买量上限不能小于0' : '最大提货组数不能小于0')
-        return
-      }
+      let params = {}
+
       const customerIds = this.selectedData
         .map(k => {
           return k.customerId
@@ -1089,17 +1124,35 @@ export default {
           return k.id
         })
         .join(',')
-      const params = {
-        customerIds,
-        ids
-      }
       if (type) {
-        params.limitQty = this.limitQty
+        if (this.limitQty <= 0) {
+          this.$errorMsg('购买量上限不能小于0')
+          return
+        }
+        params = {
+          customerIds,
+          ids,
+          limitQty: this.limitQty
+        }
       } else {
-        params.maxBuyNum = this.maxBuyNum
+        if (this.minBuyNum <= 0) {
+          this.$errorMsg('最小提货数量不能小于0')
+          return
+        }
+        if (this.manBuyNum <= 0) {
+          this.$errorMsg('最大提货组数不能小于0')
+          return
+        }
+        params = {
+          customerIds,
+          ids,
+          minBuyNum: this.minBuyNum,
+          maxBuyNum: this.maxBuyNum
+        }
       }
       updateLimitBatchupdate(params).then(res => {
         this.handleDialogVisible()
+        this.getPolicyList()
         this.$successMsg('批量修改成功')
       })
     },

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

@@ -545,7 +545,7 @@
                         {{ scope.row.minBuyNum }}
                       </template>
                     </el-table-column>
-                    <el-table-column prop="maxBuyNum" label="最大提货数" align="left" min-width="200">
+                    <el-table-column prop="maxBuyNum" label="最大提货数" align="left" min-width="200">
                       <template slot-scope="scope">
                         {{ scope.row.maxBuyNum }}
                       </template>
@@ -730,9 +730,9 @@
       >
         <el-row :gutter="20">
           <el-col :span="24" style="display: flex; align-items: center; margin-bottom: 20px">
-            <el-col :span="4" :offset="0"> 最小起起提数 </el-col>
+            <el-col :span="4" :offset="0"> 最小提 </el-col>
             <el-col :span="8" :offset="0"> <el-input v-model="minBuyNum" size="mini" /></el-col>
-            <el-col :span="4" :offset="0"> 最大提组数 </el-col>
+            <el-col :span="4" :offset="0"> 最大提组数 </el-col>
             <el-col :span="8" :offset="0"> <el-input v-model="maxBuyNum" size="mini" /></el-col>
           </el-col>
           <el-col :span="24" :offset="0" style="margin-bottom: 20px">