Jelajahi Sumber

自动升学相关功能

natasha 22 jam lalu
induk
melakukan
6b1e914fb2

+ 155 - 9
src/views/content_manage/newspaper_manage/CheckArticle.vue

@@ -93,15 +93,19 @@
             <b>{{ index + 1 + "." }}</b>
             <div>
               <span>{{ item.exp_title + " " + item.exp_content }}</span>
-              <a @click="changeType(item)"
-                >{{
-                  item.type == "newWord"
-                    ? "词汇"
-                    : item.type == "phrase"
-                    ? "短语"
-                    : "注释"
-                }}<svg-icon icon-class="arrow-left-right-line"></svg-icon
-              ></a>
+              <div class="btn-box">
+                <a @click="changeType(item)"
+                  >{{
+                    item.type == "newWord"
+                      ? "词汇"
+                      : item.type == "phrase"
+                      ? "短语"
+                      : "注释"
+                  }}<svg-icon icon-class="arrow-left-right-line"></svg-icon
+                ></a>
+                <a class="edit-btn" @click="handleEditItem(item)">编辑</a>
+                <a class="delete-btn" @click="handleDeleteItem(item)">删除</a>
+              </div>
             </div>
           </li>
         </ul>
@@ -125,6 +129,39 @@
         >
       </div>
     </div>
+    <el-dialog
+      :visible.sync="editFlag"
+      :close-on-click-modal="false"
+      :append-to-body="true"
+      width="500px"
+      v-if="editFlag"
+      title="编辑释义"
+    >
+      <el-form
+        :model="editItem"
+        ref="articleForm"
+        label-width="50px"
+        class="registerForm"
+      >
+        <el-form-item label="释义" prop="exp_content">
+          <el-input
+            type="textarea"
+            v-model="editItem.exp_content"
+            placeholder="请输入"
+            maxlength="100"
+            :rows="4"
+            show-word-limit
+            @input="(val) => changeInputEvent(val, editItem)"
+          ></el-input>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button size="small" @click="editFlag = false">取 消</el-button>
+        <el-button size="small" type="primary" @click="sureEdit"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -208,6 +245,10 @@ export default {
       activeItem: null,
       highInclude: null,
       highSentenceId: null,
+      editFlag: false,
+      editItem: {
+        exp_content: "",
+      },
     };
   },
   //计算属性 类似于data概念
@@ -651,6 +692,104 @@ export default {
         })
         .catch(() => {});
     },
+    // 删除生词
+    handleDeleteItem(item) {
+      this.$confirm("确定删除吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        let Mname = "/PaperServer/Manager/ArticleManager/DelExplainInArt";
+        if (item.type === "newWord") {
+          Mname = "/PaperServer/Manager/ArticleManager/DelNewWordInArt";
+        } else if (item.type === "phrase") {
+          Mname = "/PaperServer/Manager/ArticleManager/DelPhraseInArt";
+        }
+        let data = {
+          id: item.id,
+        };
+        getLogin(Mname, data).then((res) => {
+          this.$message({
+            type: "success",
+            message: "删除成功!",
+          });
+          this.getArticleInfo();
+        });
+      });
+    },
+    // 点击编辑按钮
+    handleEditItem(item) {
+      this.editItem = item;
+      this.editFlag = true;
+    },
+    sureEdit() {
+      let item = this.editItem;
+      let MethodName =
+        "/PaperServer/Manager/ArticleManager/CheckWordExplainInArt";
+      let data = null;
+      if (item.type === "phrase") {
+        data = {
+          phraseExplain: {
+            id: item.id,
+            art_id: this.id,
+            exp_type: 1,
+            exp_title: item.exp_title,
+            exp_content: item.exp_content,
+            bind_sent_data: item.bind_sent_data,
+          },
+        };
+      } else if (item.type === "explain") {
+        data = {
+          phraseExplain: {
+            id: item.id,
+            art_id: this.id,
+            exp_type: 2,
+            exp_title: item.exp_title,
+            exp_content: item.exp_content,
+            bind_sent_data: item.bind_sent_data,
+          },
+        };
+      } else if (item.type === "newWord") {
+        data = {
+          wordExplain: {
+            id: item.id,
+            art_id: this.id,
+            word_name: item.exp_title,
+            vl_level: null, // 类别
+            ph: "", // 音标
+            ph_mp3: [], // 发音数组
+            ph_mp3_id: "", // 发音文件id
+            ph_file_url: "", // 发音url
+            star: null, // 星级
+            word_explain: {
+              word_para_list: [
+                {
+                  cixing:
+                    item.bind_sent_data.bind_sents[0].sent_bean.tokens[
+                      item.bind_sent_data.bind_sents[0].sel_token_idxes[0]
+                    ][7],
+                  para: item.exp_content,
+                },
+              ],
+            },
+            bind_sent_data: item.bind_sent_data,
+          },
+        };
+      }
+      this.$forceUpdate();
+      getLogin(MethodName, data)
+        .then((res) => {
+          this.editFlag = false;
+          if (res.status === 1) {
+            this.getArticleInfo();
+          }
+        })
+        .catch(() => {});
+    },
+    changeInputEvent(val, item) {
+      item.exp_content = val;
+      this.$forceUpdate();
+    },
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {
@@ -811,6 +950,10 @@ export default {
       flex: 1;
       display: flex;
       justify-content: space-between;
+      .btn-box {
+        display: flex;
+        gap: 5px;
+      }
       a {
         padding: 0px 5px;
         border-radius: 3px;
@@ -823,6 +966,9 @@ export default {
           margin-left: 2px;
         }
       }
+      .delete-btn {
+        background: #ea5939 !important;
+      }
     }
     &:hover {
       background: #f4f4f4;

+ 112 - 1
src/views/finance_manage/FlowManage.vue

@@ -324,6 +324,17 @@
                 {{ scope.row.is_reservation === "true" ? "是" : "否" }}
               </template>
             </el-table-column>
+            <el-table-column label="自动升学" width="80">
+              <template slot-scope="scope">
+                <span>{{
+                  scope.row.is_reservation === "true"
+                    ? scope.row.is_auto_adjust_study_phase === "true"
+                      ? "是"
+                      : "否"
+                    : ""
+                }}</span>
+              </template>
+            </el-table-column>
             <el-table-column
               prop="goods_study_phase_name"
               label="学段"
@@ -483,7 +494,7 @@
             <el-table-column
               fixed="right"
               label="操作"
-              :width="isPhone ? '50' : '110'"
+              :width="isPhone ? '50' : '130'"
             >
               <template slot-scope="scope">
                 <template v-if="isPhone">
@@ -512,6 +523,13 @@
                         "
                         >查看</el-dropdown-item
                       >
+                      <el-dropdown-item
+                        @click.native.prevent="
+                          handleEditInfo(scope.row, scope.$index)
+                        "
+                        v-if="scope.row.is_reservation === 'true'"
+                        >修改</el-dropdown-item
+                      >
                     </el-dropdown-menu>
                   </el-dropdown>
                 </template>
@@ -537,6 +555,17 @@
                   >
                     查看
                   </el-button>
+                  <el-button
+                    type="text"
+                    size="small"
+                    class="primary-btn"
+                    @click.native.prevent="
+                      handleEditInfo(scope.row, scope.$index)
+                    "
+                    v-if="scope.row.is_reservation === 'true'"
+                  >
+                    修改
+                  </el-button>
                   <!-- <el-button
                     @click.native.prevent="handleUp(scope.row, scope.$index)"
                     type="text"
@@ -705,6 +734,7 @@
       title="已上架物品列表"
       :visible.sync="shelveVisible"
       :width="isPhone ? '100%' : '500px'"
+      v-if="orderInfo"
     >
       <el-table :data="goodsListShelve" style="width: 100%">
         <el-table-column type="index" label="#" width="54"> </el-table-column>
@@ -731,12 +761,65 @@
           </template>
         </el-table-column>
       </el-table>
+      <template
+        v-if="
+          orderInfo.sale_model === 0 &&
+          orderInfo.is_reservation === 'true' &&
+          orderInfo.is_auto_adjust_study_phase === 'true'
+        "
+      >
+        <h4>
+          年预定【{{
+            orderInfo.is_auto_adjust_study_phase === "true"
+              ? "自动升学"
+              : "不自动升学"
+          }}】
+        </h4>
+        <p>
+          {{
+            orderInfo.valid_period_1_study_phase_name +
+            " &nbsp;&nbsp; " +
+            orderInfo.valid_period_1_begin_date +
+            " &nbsp;&nbsp;至&nbsp;&nbsp; " +
+            orderInfo.valid_period_1_end_date
+          }}
+        </p>
+        <p v-if="orderInfo.valid_period_2_study_phase !== 0">
+          {{
+            orderInfo.valid_period_2_study_phase_name +
+            " &nbsp;&nbsp; " +
+            orderInfo.valid_period_2_begin_date +
+            " &nbsp;&nbsp;至&nbsp;&nbsp; " +
+            orderInfo.valid_period_2_end_date
+          }}
+        </p>
+      </template>
       <span slot="footer" class="dialog-footer">
         <el-button size="small" type="primary" @click="shelveVisible = false"
           >确 定</el-button
         >
       </span>
     </el-dialog>
+    <el-dialog
+      title="修改"
+      :visible.sync="editInfoFlag"
+      :width="isPhone ? '100%' : '500px'"
+    >
+      <el-form :model="editInfo">
+        <el-form-item label="自动升学">
+          <el-radio-group v-model="editInfo.is_auto_adjust_study_phase">
+            <el-radio label="false">否</el-radio>
+            <el-radio label="true">是</el-radio>
+          </el-radio-group>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button size="small" @click="editInfoFlag = false">取 消</el-button>
+        <el-button size="small" type="primary" @click="sureIsAuto"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -1000,7 +1083,12 @@ export default {
       isPhone: false,
       showSearch: true,
       goodsListShelve: [], // 已上架物品列表
+      orderInfo: null, // 订单详情
       shelveVisible: false,
+      editInfoFlag: false,
+      editInfo: {
+        is_auto_adjust_study_phase: "false",
+      },
     };
   },
   //计算属性 类似于data概念
@@ -1332,6 +1420,7 @@ export default {
     // 查看已上架物品
     handleLookInfo(row, index) {
       this.goodsListShelve = [];
+      this.orderInfo = null;
       let Mnames = "/ShopServer/Manager/FinanceManager/GetOrderInfo";
       let datas = {
         id: row.id,
@@ -1339,10 +1428,32 @@ export default {
       getLogin(Mnames, datas).then((res) => {
         if (res.status === 1) {
           this.goodsListShelve = res.goods_list_shelve;
+          this.orderInfo = res.order_info;
           this.shelveVisible = true;
         }
       });
     },
+    // 点击修改按钮
+    handleEditInfo(row) {
+      this.editInfo = {
+        is_auto_adjust_study_phase: row.is_auto_adjust_study_phase,
+        id: row.id,
+      };
+      this.editInfoFlag = true;
+    },
+    // 确定修改自动升学属性
+    sureIsAuto() {
+      let Mnames =
+        "ShopServer/Manager/FinanceManager/SetIsAutoAdjustStudayPhase_YearReservationOrder";
+
+      getLogin(Mnames, this.editInfo).then((res) => {
+        if (res.status === 1) {
+          this.$message.success("操作成功");
+          this.getList();
+          this.editInfoFlag = false;
+        }
+      });
+    },
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {