Просмотр исходного кода

台账bug修复,返利单导入可批量删除

chen 3 лет назад
Родитель
Сommit
659bbb0c30

+ 10 - 11
src/views/basic_data/material/machine_list.vue

@@ -59,15 +59,15 @@
     <div class="btn-group clearfix">
       <div class="fl">
         <el-button
-         v-if="$checkBtnRole('add', $route.meta.roles)"
+          v-if="$checkBtnRole('add', $route.meta.roles)"
           type="primary"
           size="small"
-             icon="el-icon-plus"
+          icon="el-icon-plus"
           @click="(showDialogForm = true), (type = 1)"
           >新增</el-button
         >
         <el-popconfirm
-         v-if="$checkBtnRole('del', $route.meta.roles)"
+          v-if="$checkBtnRole('del', $route.meta.roles)"
           confirm-button-text="好的"
           cancel-button-text="不用了"
           icon="el-icon-info"
@@ -79,7 +79,7 @@
           <el-button
             slot="reference"
             type="primary"
-               icon="el-icon-delete"
+            icon="el-icon-delete"
             size="small"
             class="textColor el-popover-left"
             >删除</el-button
@@ -200,14 +200,14 @@
           >
             <template slot-scope="scope">
               <el-button
-               v-if="$checkBtnRole('edit', $route.meta.roles)"
+                v-if="$checkBtnRole('edit', $route.meta.roles)"
                 type="text"
                 class="textColor"
                 @click="editFn(scope.row.id, scope.row)"
                 >编辑</el-button
               >
               <el-popconfirm
-               v-if="$checkBtnRole('del', $route.meta.roles)"
+                v-if="$checkBtnRole('del', $route.meta.roles)"
                 confirm-button-text="好的"
                 cancel-button-text="不用了"
                 icon="el-icon-info"
@@ -404,7 +404,7 @@ export default {
             getMachineAdd(this.diaLogForm).then((res) => {
               this.$successMsg("保存成功");
               this.showDialogForm = false;
-               this.resetInfo();
+              this.resetInfo();
               this.getList();
             });
           } else if (this.type === 2) {
@@ -414,12 +414,11 @@ export default {
             getMachineEdit(params).then((res) => {
               this.$successMsg("编辑成功");
               this.showDialogForm = false;
-               this.resetInfo();
+              this.resetInfo();
               this.getList();
             });
             this.diaLogForm.id = null;
           }
-
         } else {
           console.log("error submit!!");
           return false;
@@ -496,8 +495,8 @@ export default {
       };
     },
     findMachineType(val) {
-      const obj = this.distList.find((value) => value.dictCode === val)
-      return obj ? obj.dictValue : ''
+      const obj = this.distList.find((value) => value.dictCode === val);
+      return obj ? obj.dictValue : "";
     },
   },
 };

+ 1 - 0
src/views/dashboard/index.vue

@@ -202,6 +202,7 @@
         >
         </el-pagination>
       </div>
+      <br /><br />
       <!-- 内层弹窗 -->
       <el-dialog
         width="40%"

+ 42 - 2
src/views/finance/rebate_form.vue

@@ -66,6 +66,23 @@
     </div>
     <!-- 按钮 -->
     <div class="btn-group clearfix">
+      <div class="fl">
+        <el-popconfirm
+          v-if="$checkBtnRole('del', $route.meta.roles)"
+          @onConfirm="delSeletFn"
+          title="这是一段内容确定删除吗?"
+        >
+          <el-button
+            :disabled="selectList.length < 1"
+            type="danger"
+            size="small"
+            class="textColor delStyle"
+            icon="el-icon-minus"
+            slot="reference"
+            >批量删除</el-button
+          >
+        </el-popconfirm>
+      </div>
       <div class="fr">
         <el-button type="primary" size="small" @click="downLoadFn"
           >模板</el-button
@@ -99,11 +116,11 @@
           stripe
           :row-class-name="rouClassNameFn"
           @row-click="onRowClick"
+          @selection-change="selectionChange"
         >
           <el-table-column
             align="center"
-            label="序号"
-            type="index"
+            type="selection"
             width="100"
             show-overflow-tooltip
           ></el-table-column>
@@ -340,6 +357,7 @@ import {
 export default {
   data() {
     return {
+      selectList: [],
       importFileList: [],
 
       dataList: [],
@@ -372,6 +390,25 @@ export default {
     this.searchForm.createBy = this.name;
   },
   methods: {
+    //删除
+    delSeletFn() {
+      console.log(this.dataList);
+      this.selectList.sort(function (a, b) {
+        return b - a;
+      });
+      console.log(this.selectList);
+
+      for (let index = 0; index < this.selectList.length; index++) {
+        // console.log(index);
+        this.dataList.splice(this.selectList[index], 1);
+      }
+    },
+    //选择项改变
+    selectionChange(v) {
+      console.log(v);
+      this.selectList = v.map((v) => v.index);
+      console.log(this.selectList);
+    },
     // 导入
     async handleImport(param) {
       const file = param.file;
@@ -523,4 +560,7 @@ export default {
   display: inline-block;
   margin-left: 10px;
 }
+.delStyle {
+  margin-top: 20px;
+}
 </style>

+ 35 - 21
src/views/finance/standbook_list.vue

@@ -77,10 +77,9 @@
               <el-date-picker
                 class="selectStyle"
                 v-model="searchForm.startTime"
-                type="datetime"
+                type="date"
                 placeholder="选择日期时间"
-                default-time="00:00:00"
-                value-format="yyyy-MM-dd HH:mm:ss"
+                value-format="yyyy-MM-dd"
               >
               </el-date-picker>
             </el-form-item>
@@ -90,10 +89,9 @@
               <el-date-picker
                 class="selectStyle"
                 v-model="searchForm.endTime"
-                type="datetime"
+                type="date"
                 placeholder="选择日期时间"
-                default-time="23:59:59"
-                value-format="yyyy-MM-dd HH:mm:ss"
+                value-format="yyyy-MM-dd"
               >
               </el-date-picker>
             </el-form-item>
@@ -416,6 +414,14 @@
             </el-table-column>
             <el-table-column
               align="center"
+              label="折让金额"
+              prop="allowanceAmount"
+              min-width="160"
+              show-overflow-tooltip
+            >
+            </el-table-column>
+            <el-table-column
+              align="center"
               label="暂扣返利"
               prop="withholdAmount"
               min-width="160"
@@ -491,6 +497,13 @@ export default {
       bill: "COMMONLY",
       isCustomer: JSON.parse(localStorage.getItem("supply_user")).isCustomer,
       isDisabled: false,
+      isCustomerList: {
+        customerId: JSON.parse(localStorage.getItem("supply_user")).customerId,
+        customerName: JSON.parse(localStorage.getItem("supply_user"))
+          .customerName,
+        customerNumber: JSON.parse(localStorage.getItem("supply_user"))
+          .customerNumber,
+      },
     };
   },
   computed: {
@@ -533,15 +546,17 @@ export default {
     next((vm) => {
       // 这个时候组件还没有创建,所以要通过vm来访问
       console.log(vm);
+      vm.getCustomerDataList();
       if (
         from.path == "/finance/details/balance_sum" &&
-        to.path == "/finance/details/standbook_list"
+        to.path == "/finance/details/standbook_list" &&
+        vm.$route.query.customerId
       ) {
         //只有是从A进到B页面才执行
         // 将要执行的逻辑
 
         vm.isDisabled = true;
-        vm.searchForm.customerId = vm.$route.query.customerName;
+        vm.searchForm.customerId = vm.$route.query.customerId;
         vm.changeFn(vm.$route.query.customerId);
         vm.getDataList({
           pageSize: vm.pageSize,
@@ -552,14 +567,13 @@ export default {
         });
       } else if (vm.isCustomer) {
         vm.isDisabled = true;
-        vm.searchForm.customerId = vm.$store.state.user.customerName;
+        vm.searchForm.customerId = vm.$store.state.user.customerId;
         vm.changeFn(vm.$store.state.user.customerId);
         vm.getDataList({
           pageSize: vm.pageSize,
           pageNum: vm.currentPage,
           type: vm.bill,
-          customerName: vm.$store.state.user.customerName,
-          customerNumber: vm.$store.state.user.customerNumber,
+          ...vm.isCustomerList,
         });
       } else {
         vm.searchForm.customerId = "";
@@ -689,8 +703,7 @@ export default {
           pageSize: this.pageSize,
           pageNum: this.currentPage,
           type: this.bill,
-          customerName: this.$store.state.user.customerName,
-          customerNumber: this.$store.state.user.customerNumber,
+          ...this.isCustomerList,
         });
       } else {
         this.getDataList({
@@ -726,8 +739,7 @@ export default {
           pageSize: this.pageSize,
           pageNum: this.currentPage,
           type: this.bill,
-          customerName: this.$store.state.user.customerName,
-          customerNumber: this.$store.state.user.customerNumber,
+          ...this.isCustomerList,
         });
       } else {
         this.getDataList({
@@ -752,8 +764,11 @@ export default {
       // this.walletList = [];
       // this.customerName = "";
       // this.customerNumber = "";
-      if (this.isCustomer || this.$route.query.customerId) {
+      if (this.isCustomer) {
         await this.$refs.searchForm.resetFields();
+        this.searchForm.customerId = this.$store.state.user.customerId;
+      } else if (this.$route.query.customerId) {
+        this.searchForm.customerId = this.$route.query.customerId;
       } else {
         this.walletList = [];
         this.customerName = "";
@@ -791,8 +806,7 @@ export default {
           pageSize: this.pageSize,
           pageNum: this.currentPage,
           type: this.bill,
-          customerName: this.$store.state.user.customerName,
-          customerNumber: this.$store.state.user.customerNumber,
+          ...this.isCustomerList,
         });
       } else {
         this.getDataList({
@@ -833,6 +847,7 @@ export default {
           pageSize: this.pageSize,
           pageNum: this.currentPage,
           type: v,
+          customerId: this.$route.query.customerId,
           customerName: this.$route.query.customerName,
           customerNumber: this.$route.query.customerNumber,
         });
@@ -842,9 +857,8 @@ export default {
           ...this.searchForm,
           pageSize: this.pageSize,
           pageNum: this.currentPage,
-          type: this.bill,
-          customerName: this.$store.state.user.customerName,
-          customerNumber: this.$store.state.user.customerNumber,
+          type: v,
+          ...this.isCustomerList,
         });
       } else {
         this.getDataList({