Tang преди 3 години
родител
ревизия
d0fcdc59b1

+ 1 - 0
src/views/Marketing/order/offlineOrder/batchRecord/firstStep/index.vue

@@ -241,6 +241,7 @@ export default {
       for (let i = 0; i < this.newBusinessLevel.length; i++) {
         if (this.newBusinessLevel[i].id === this.topData.businessId) {
           this.topData.projectId = this.newBusinessLevel[i].projectId;
+          this.topData.templateStatus = this.newBusinessLevel[i].templateStatus
           break;
         }
       }

+ 86 - 23
src/views/Marketing/order/offlineOrder/batchRecord/secondStep/index.vue

@@ -47,6 +47,7 @@
                 }}</span
                 >{{ scope.row[item.prop3] }}
                 <el-button
+                  v-if="toData.templateStatus == 1"
                   type="text"
                   :style="
                     scope.row[item.prop4] === -1 ? 'color:red!important;' : ''
@@ -119,8 +120,8 @@
       <el-button
         size="mini"
         :loading="disabledBtn"
-        @click="orderSubmitStatus ? submitForm() : submitForm(1)"
-        >{{ orderSubmitStatus ? "提交下单内容" : "继续下一步" }}</el-button
+        @click="orderSubmitStatus ? submitForm() : submitResult(1)"
+        >{{ orderSubmitStatus ? "提交下单内容" : "查看录单结果" }}</el-button
       >
     </div>
     <select-class ref="selectClass" />
@@ -147,7 +148,7 @@ export default {
         {
           label: "学员身份证",
           prop: "idCard",
-          width: "160px",
+          width: "166px",
         },
         {
           label: "手机号码",
@@ -347,8 +348,11 @@ export default {
       });
       this.$refs.setGoodsList.openBox(this.toData, data);
     },
-    uploadDatas(list) {
-      if (!list.length) return;
+    uploadDatas(lists) {
+      if (!lists.length) return;
+      let list = lists.sort((a, b) => {
+        return a.goodsType - b.goodsType;
+      });
       const index = this.tableData.findIndex((item) => {
         return item.realname === list[0].realname;
       });
@@ -561,7 +565,7 @@ export default {
                       }
                       items.goodsRealPrice = items.standPrice;
                       items.goodsReceived = items.standPrice;
-                      if (!items.gradeId) {
+                      if (this.toData.templateStatus == 1 && !items.gradeId) {
                         items.gradeId = 0;
                       }
                       return items;
@@ -638,10 +642,40 @@ export default {
           });
       });
     },
+    submitResult(int) {
+      if (this.checkedSuccess()) {
+        this.jumpThire();
+      } else {
+        this.$confirm(
+          "当前页面还有学员的商品未完成录单操作。【确定下一步】后,只能通过补录方式,继续为学员批量录单。请慎重操作。",
+          "操作提示",
+          {
+            confirmButtonText: "确定,下一步",
+            cancelButtonText: "再想一想",
+            type: "warning",
+          }
+        )
+          .then(() => {
+            this.jumpThire();
+          })
+          .catch(() => {});
+      }
+    },
     async submitForm(int, row) {
+      let checkStatus = this.tableData.every((item) => {
+        return item.checked === false;
+      });
+      if (checkStatus) {
+        this.$message.error("请选择需要购买的商品");
+        return;
+      }
       if (this.orderSubmitStatus) {
         let py = this.tableData.some((item) => {
-          return item.checked && item.gradeId == -1;
+          return (
+            item.checked &&
+            item.gradeId == -1 &&
+            this.toData.templateStatus == 1
+          );
         });
         if (py) {
           this.$message.warning("请选择班级");
@@ -651,7 +685,10 @@ export default {
         if (int === 2 && row) {
           let ary = this.tableData.some((item) => {
             return (
-              item.userId === row.userId && item.checked && item.gradeId == -1
+              item.userId === row.userId &&
+              item.checked &&
+              item.gradeId == -1 &&
+              this.toData.templateStatus == 1
             );
           });
           if (ary) {
@@ -662,18 +699,18 @@ export default {
       }
       this.disabledBtn = true;
       this.loading = true;
-      if (int === 1 && !this.orderSubmitStatus) {
-        var successList = this.tableData.filter((item) => {
-          return item.checked && item.success;
-        });
-        var errorList = this.tableData.filter((item) => {
-          return item.checked && item.errmsg;
-        });
-        this.$parent.changePage2("third", successList, errorList);
-        this.disabledBtn = false;
-        this.loading = false;
-        return;
-      }
+      // if (int === 1 && !this.orderSubmitStatus) {
+      //   var successList = this.tableData.filter((item) => {
+      //     return item.checked && item.success;
+      //   });
+      //   var errorList = this.tableData.filter((item) => {
+      //     return item.checked && item.errmsg;
+      //   });
+      //   this.$parent.changePage2("third", successList, errorList);
+      //   this.disabledBtn = false;
+      //   this.loading = false;
+      //   return;
+      // }
       let submitTable = this.tableData.filter((item) => {
         if (row && int === 2) {
           return item.checked && item.userId === row.userId;
@@ -705,7 +742,7 @@ export default {
                 goodsReceived: item.goodsReceived,
                 goodsPrice: item.standPrice,
                 goodsInputData: {
-                  gradeId: item.gradeId,
+                  gradeId: this.toData.templateStatus == 1 ? item.gradeId : "",
                 },
               },
             ],
@@ -721,7 +758,7 @@ export default {
               goodsReceived: item.goodsReceived,
               goodsPrice: item.standPrice,
               goodsInputData: {
-                gradeId: item.gradeId,
+                gradeId: this.toData.templateStatus == 1 ? item.gradeId : "",
               },
             });
           } else {
@@ -736,7 +773,8 @@ export default {
                   goodsReceived: item.goodsReceived,
                   goodsPrice: item.standPrice,
                   goodsInputData: {
-                    gradeId: item.gradeId,
+                    gradeId:
+                      this.toData.templateStatus == 1 ? item.gradeId : "",
                   },
                 },
               ],
@@ -750,10 +788,35 @@ export default {
       if (arr.length) {
         this.$message("已提交下单内容");
       }
+      if (this.orderSubmitStatus && this.checkedSuccess()) {
+        this.jumpThire();
+      }
       this.disabledBtn = false;
       this.loading = false;
       this.orderSubmitStatus = false;
     },
+    checkedSuccess() {
+      let newData = this.tableData.filter((item) => {
+        return item.checked;
+      });
+      let status = newData.every((item) => {
+        return item.success === true;
+      });
+      console.log(this.tableData, status);
+      return status;
+    },
+    jumpThire() {
+      var successList = this.tableData.filter((item) => {
+        return item.checked && item.success;
+      });
+      var errorList = this.tableData.filter((item) => {
+        return item.checked && item.errmsg;
+      });
+      this.$parent.changePage2("third", successList, errorList);
+      this.disabledBtn = false;
+      this.loading = false;
+      return;
+    },
     submitFunApi(item) {
       var self = this;
       return new Promise((resolve, reject) => {

+ 43 - 2
src/views/Marketing/order/offlineOrder/batchRecord/secondStep/selectClass.vue

@@ -3,7 +3,7 @@
     <el-dialog
       @closed="loadingClose"
       :visible.sync="dialogCG"
-      width="360px"
+      width="500px"
       :show-close="false"
       :close-on-click-modal="false"
       class="dialogNew"
@@ -22,7 +22,7 @@
         <el-radio-group v-model="radio">
           <ul>
             <li
-              v-for="(item, index) in classList"
+              v-for="(item, index) in classListy(classList)"
               :key="index"
               style="margin-bottom: 20px"
             >
@@ -37,6 +37,22 @@
                 :label="item.gradeId"
                 >{{ item.className }}</el-radio
               >
+              <p v-if="item.gradeId" style="font-size: 14px">
+                <span style="margin-right:10px;">{{
+                  item.classStatus === 1
+                    ? "已开班"
+                    : item.classStatus === 0
+                    ? "未开班"
+                    : ""
+                }}</span>
+                <span v-if="item.classStatus === 1 && item.classStartTime && item.classEndTime">
+                  {{
+                    $methodsTools.onlyForma(item.classStartTime) +
+                    " - " +
+                    $methodsTools.onlyForma(item.classEndTime)
+                  }}
+                </span>
+              </p>
             </li>
           </ul>
         </el-radio-group>
@@ -62,6 +78,31 @@ export default {
       indexResult: "", //记录当前打开的索引
     };
   },
+  computed: {
+    classListy: function () {
+      return function (list) {
+        let ary = [];
+        ary = list.filter((item) => {
+          if (item.gradeId) {
+            if (item.studentNum < item.studentUpper) {
+              if (item.classStatus === 1) {
+                let date = new Date().getTime() / 1000;
+                if (item.classEndTime && item.classEndTime < date) {
+                } else {
+                  return item;
+                }
+              } else {
+                return item;
+              }
+            }
+          } else {
+            return item;
+          }
+        });
+        return ary
+      };
+    },
+  },
   methods: {
     loadingClose() {
       this.disabledBtn = false;

+ 12 - 10
src/views/Marketing/order/offlineOrder/batchRecord/secondStep/setGoodsList.vue

@@ -149,11 +149,13 @@ export default {
           copyData.goodsReceived = row.standPrice;
           copyData.subjectId = this.active.split("-").map(Number)[0];
           copyData.checked = true;
-          if (row.gradeNum) {
-            copyData.gradeId = row.gradeId;
-            copyData.gradeName = row.gradeName;
-          } else {
-            copyData.gradeId = 0;
+          if (this.$parent.toData.templateStatus == 1) {
+            if (row.gradeNum) {
+              copyData.gradeId = row.gradeId;
+              copyData.gradeName = row.gradeName;
+            } else {
+              copyData.gradeId = 0;
+            }
           }
           const status = this.newDatas.some((item) => {
             return item.subjectId == this.active.split("-").map(Number)[0];
@@ -236,9 +238,9 @@ export default {
       }
       if (type == 3 || type == 4) {
         data.businessIds = this.oldObj.businessId;
-        data.status = 1
+        data.status = 1;
       }
-      data.goodsStatus = 1
+      data.goodsStatus = 1;
       this.$api.inquiregoodslistToInputList(data).then((res) => {
         res.rows.forEach((item) => {
           item.subjectId = subjectId;
@@ -291,15 +293,15 @@ export default {
       this.newDatas = JSON.parse(JSON.stringify(datas));
       this.copynewDatas = JSON.parse(JSON.stringify(datas));
       this.oldObj = JSON.parse(JSON.stringify(oldObj));
-      if(this.active){
-        this.searchData()
+      if (this.active) {
+        this.searchData();
       }
       // this.active = "";
       this.goodsName = "";
       this.goodsPrice = "";
       this.goodsList = [];
       this.$api
-        .inquireCourseSubject({ businessId: Number(oldObj.businessId) })
+        .inquireCourseSubject({ businessId: Number(oldObj.businessId),status:1 })
         .then((res) => {
           let options = [];
           if (oldObj.type.indexOf(1) !== -1) {

+ 1 - 1
src/views/Marketing/order/offlineOrder/orderChargeInfo/goodsDocument/goodsInfos.vue

@@ -194,7 +194,7 @@
       <div class="fgx"></div>
       <el-form-item label="订单状态" prop="orderGoodsStatus">
         <el-radio-group v-model="listData.orderGoodsStatus" disabled>
-          <el-radio :label="-1">关闭</el-radio>
+          <el-radio :label="-1">已取消</el-radio>
           <el-radio :label="0">待支付</el-radio>
           <el-radio :label="1">已支付</el-radio>
           <el-radio :label="2">已退款</el-radio>

+ 16 - 4
src/views/Marketing/order/offlineOrder/orderDetailsT/index.vue

@@ -119,17 +119,25 @@ export default {
           ],
         },
         {
-          prop: "status",
+          prop: "orderGoodsStatus",
           placeholder: "订单状态",
           scope: "select",
           options: [
             {
-              label: "有效",
+              label: "待支付",
+              value: 0,
+            },
+            {
+              label: "已支付",
               value: 1,
             },
             {
-              label: "无效",
-              value: 0,
+              label: "已退款",
+              value: 2,
+            },
+            {
+              label: "已取消",
+              value: -1,
             },
           ],
         },
@@ -138,6 +146,10 @@ export default {
           placeholder: "退款状态",
           scope: "select",
           options: [
+            {
+              label: "无",
+              value: 0,
+            },
             {
               label: "退款中",
               value: 1,