suochencheng 6 лет назад
Родитель
Сommit
329922f740

+ 1 - 1
src/main/java/com/izouma/awesomeadmin/dao/PayCodeOrderMapper.xml

@@ -248,7 +248,7 @@
                 channel= #{channel,jdbcType=INTEGER},
             </if>
             <if test="appname != null">
-                appmane= #{appname},
+                appname= #{appname},
             </if>
             <if test="codeowner != null">
                 codeowner= #{codeowner,jdbcType=INTEGER},

+ 48 - 1
src/main/vue/src/pages/PayCodeStocks.vue

@@ -124,8 +124,9 @@
                              label="操作"
                              align="center"
                              fixed="right"
-                             min-width="150">
+                             min-width="220">
                 <template slot-scope="scope">
+                    <el-button @click="xiadan(scope.row)"  type="primary" size="mini" plain>下单</el-button>
                     <el-button @click="$router.push({path:'/payCodeOrders',query:{column:scope.row.id+',stockId'}})" type="primary" size="small" plain>订单
                     </el-button>
                     <el-button @click="editRow(scope.row)" type="primary" size="mini" plain>编辑</el-button>
@@ -242,6 +243,21 @@
             <img width="100%" :src="imgSrc" alt="">
         </el-dialog>
 
+        <el-dialog title="手动下单" :visible.sync="xiadanShowDialog">
+            <el-form :model="xiadanRow" label-width="120px">
+                <el-form-item label="库存Id">
+                    <el-input v-model="xiadanRow.id"></el-input>
+                </el-form-item>
+                <el-form-item label="用户ID">
+                    <el-input v-model="xiadanRow.userId"></el-input>
+                </el-form-item>
+            </el-form>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="xiadanShowDialog = false">取 消</el-button>
+                <el-button type="primary" @click="xiadanShowSubmit">下单</el-button>
+            </span>
+        </el-dialog>
+
     </div>
 </template>
 <script>
@@ -398,6 +414,8 @@ export default {
             payType: '',
             codeId: '',
             payCodeOptions: [],
+            xiadanRow: {},
+            xiadanShowDialog: false,
         };
     },
     computed: {
@@ -620,6 +638,35 @@ export default {
 
             return valueStr;
         },
+        xiadan(row) {
+            this.xiadanRow = row;
+            this.xiadanShowDialog = true;
+        },
+        xiadanShowSubmit() {
+            if (!this.xiadanRow.userId) {
+                this.$message.warning('请输入下单用户ID');
+            } else {
+                this.$http
+                    .post({
+                        url: '/payCodeOrder/submit',
+                        data: {
+                            stockId: this.xiadanRow.id,
+                            userId: this.xiadanRow.userId,
+                        },
+                    })
+                    .then(res => {
+                        if (res.success) {
+                            this.$message.success('保存成功');
+                            this.getData();
+                        } else {
+                            this.$message.error(res.error);
+                        }
+
+                        this.xiadanRow = {};
+                        this.xiadanShowDialog = false;
+                    });
+            }
+        },
     },
 };
 </script>