瀏覽代碼

add:推送订单

ct 1 月之前
父節點
當前提交
17954179d0
共有 3 個文件被更改,包括 69 次插入7 次删除
  1. 9 1
      src/api/his/storeSubOrder.js
  2. 0 4
      src/views/his/storeOrder/order1.vue
  3. 60 2
      src/views/his/storeSubOrder/index.vue

+ 9 - 1
src/api/his/storeSubOrder.js

@@ -50,4 +50,12 @@ export function exportStoreSubOrder(query) {
     method: 'get',
     params: query
   })
-}
+}
+
+export function pushStoreSubOrder(data) {
+  return request({
+    url: '/his/storeSubOrder/pushStoreSubOrder',
+    method: 'post',
+    data: data
+  })
+}

+ 0 - 4
src/views/his/storeOrder/order1.vue

@@ -1455,10 +1455,6 @@ export default {
         this.$refs.tagInput.focus()
       })
     },
-    // 删除订单号
-    removeOrderCode(index) {
-      this.queryParams.orderCodes.splice(index, 1)
-    },
     // 聚焦输入框
     focusInput() {
       if (!this.inputVisible) {

+ 60 - 2
src/views/his/storeSubOrder/index.vue

@@ -130,6 +130,17 @@
               </el-select>
       </el-form-item>
 
+      <el-form-item label="是否已推送" prop="isPush">
+        <el-select filterable v-model="queryParams.isPush" placeholder="推送状态" clearable size="small">
+          <el-option
+            v-for="dict in isPushOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+
 
       <el-form-item label="下单时间" prop="createTime">
             <el-date-picker v-model="createTime" size="small" style="width: 220px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="changeTime"></el-date-picker>
@@ -139,6 +150,8 @@
       </el-form-item>
 
 
+
+
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -167,6 +180,17 @@
           v-hasPermi="['store:storeOrder:export']"
         >导出订单</el-button>
         </el-col> -->
+        <el-col :span="1.5">
+          <el-button
+            type="success"
+            plain
+            icon="el-icon-s-promotion"
+            size="mini"
+            :loading="pushLoading"
+            @click="handlePush"
+            v-hasPermi="['his:storeOrder:push']"
+          >推送</el-button>
+        </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
     <el-tabs type="card" v-model="actName" @tab-click="handleClickX">
@@ -238,7 +262,7 @@
 </template>
 
 <script>
-import { listStoreSubOrder, getStoreSubOrder,  addOrder,importExpressTemplate,  exportStoreSubOrder,importTemplate } from "@/api/his/storeSubOrder";
+import { listStoreSubOrder, getStoreSubOrder,  addOrder,importExpressTemplate,  exportStoreSubOrder,importTemplate,pushStoreSubOrder } from "@/api/his/storeSubOrder";
 import storeSubOrderDetails from '../../components/his/storeSubOrderDetails.vue';
 import { getToken } from "@/utils/auth";
 import {listStore} from "@/api/his/storeProduct";
@@ -299,8 +323,10 @@ export default {
       loading: true,
       // 导出遮罩层
       exportLoading: false,
+      pushLoading: false,
       // 选中数组
       ids: [],
+      subOrderIds: [],
       // 非单个禁用
       single: true,
       // 非多个禁用
@@ -388,6 +414,16 @@ export default {
        channelOptions:[],
        qwSubjectOptions:[],
        orderTypeOptions:[],
+      isPushOptions:[
+        {
+          dictLabel :"已推送",
+          dictValue:"1"
+        },
+        {
+          dictLabel :"未推送",
+          dictValue:"0"
+        },
+      ],
        orderBuyTypeOptions:[],
        tuiOptions:[],
        orOptions:[],
@@ -458,7 +494,7 @@ export default {
 
   },
   methods: {
-  
+
     handledetails(row){
         this.show.open=true;
         setTimeout(() => {
@@ -636,6 +672,7 @@ export default {
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.orderId)
+      this.subOrderIds= selection.map(item => item.subOrderId)
       this.single = selection.length!==1
       this.multiple = !selection.length
     },
@@ -689,6 +726,27 @@ export default {
           this.msgSuccess("删除成功");
         }).catch(() => {});
     },
+    handlePush() {
+      let params = {...this.queryParams}; // 先浅拷贝一份
+      if (this.subOrderIds?.length > 0) { // 使用可选链操作符
+        params = {...params, orderIds: this.subOrderIds};
+      }
+      this.$confirm('是否确认推送所选订单数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.pushLoading = true;
+        return pushStoreSubOrder(params);
+      }).then(response => {
+        var msg = response.msg
+        this.pushLoading = false;
+        if (msg !== null && msg.length > 0) {
+          this.$message.error(msg);
+        }
+      }).catch(() => {
+      });
+    },
     /** 导出按钮操作 */
     handleExport() {
       if(this.payTypeArr.length>0){