浏览代码

管理后台-订单列表:现场订单

panyong 3 年之前
父节点
当前提交
ec092149c5
共有 1 个文件被更改,包括 51 次插入3 次删除
  1. 51 3
      htmldev/manage/src/views/business/oms/list/index.vue

+ 51 - 3
htmldev/manage/src/views/business/oms/list/index.vue

@@ -68,8 +68,8 @@
           <!--TODO 权限-->
           <el-button type="text"
                      :disabled="booLock"
-                     @click="handlePrint(scope.row)"
-                     v-if="scope.row.order_pay_type === 3 && scope.row.order_status === 1">确认支付
+                     @click="showOrderStatusdialogForm(scope.row)"
+                     v-if="scope.row.order_pay_type === 3">确认支付
           </el-button>
           <el-button type="text"
                      v-permission="'business_oms_order_check'"
@@ -89,6 +89,29 @@
       background
       layout="total, sizes, prev, pager, next, jumper"
       :total="totalCount"/>
+    <!--通过pos机支付的订单-->
+    <el-dialog title="现场订单付款确认"
+               :visible.sync="orderStatusdialogForm">
+      <el-form :model="dialogForm"
+               :rules="formRules"
+               ref="dialogForm">
+        <el-form-item
+          label="订单状态"
+          prop="order_status"
+          :rules="formRules.required">
+          <el-select
+            v-model="dialogForm.order_status"
+            placeholder="请选择">
+            <el-option label="待支付" value="0"></el-option>
+            <el-option label="已支付" value="1"></el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="orderStatusdialogForm = false">取 消</el-button>
+        <el-button type="primary" @click="siteOrderSet">确 定</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -103,7 +126,9 @@ export default {
       searchForm: {},
       tableData: [],
       tableUrl: '/v1/user/order/list',
-      booLock: false
+      booLock: false,
+      orderStatusdialogForm: false,
+      dialogForm: {}
     }
   },
   methods: {
@@ -114,6 +139,29 @@ export default {
       if (data.code === 200) {
         this.$message.success('开始打印')
       }
+    },
+    showOrderStatusdialogForm (row) {
+      this.orderStatusdialogForm = true
+      this.dialogForm = {}
+      this.$nextTick(() => {
+        this.$set(this.dialogForm, 'id', row.id)
+      })
+    },
+    // 现场订单支付
+    async siteOrderSet () {
+      this.$refs['dialogForm'].validate(async valid => {
+        if (valid) {
+          this.booLock = true
+          const data = await this.$fetch('/v1/user/order/siteOrderSet', this.dialogForm, 'get')
+          this.booLock = false
+          if (data.code === 200) {
+            this.$message.success('现场订单支付状态修改成功')
+            this.orderStatusdialogForm = false
+          }
+        } else {
+          console.log('error submit!!')
+        }
+      })
     }
   },
   mounted () {