Ver código fonte

扫码点餐 删除 查看

DESKTOP-B78GIPM\admin 2 anos atrás
pai
commit
966685ff36

+ 227 - 0
src/views/pos/modules/posThaliModals/posThaliForm.vue

@@ -0,0 +1,227 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+        <a-row type="flex">
+          <a-col :span="12">
+            <a-form-model-item label="订单编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="" style="margin-bottom:0px;">
+              <!-- <a-input v-model="model.tenantId" placeholder="请输入关联租户"  ></a-input> -->
+              {{model.code}}
+            </a-form-model-item>
+
+            <a-form-model-item label="区域" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="" style="margin-bottom:0px;">
+              <!-- <a-textarea v-model="model.images" rows="4" placeholder="请输入图片逗号分隔" /> -->
+              {{model.regionName}}
+            </a-form-model-item>
+
+            <a-form-model-item label="支付方式" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="" style="margin-bottom:0px;">
+              <!-- <a-input v-model="model.hotelId" placeholder="请输入关联酒店"  ></a-input> -->
+              {{model.paymentMethod==1? "会员卡" : model.paymentMethod==2? '积分' : '微信'}}
+            </a-form-model-item>
+
+            <a-form-model-item label="下单时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="" style="margin-bottom:0px;">
+              <!-- <a-input-number v-model="model.userId" placeholder="请输入用户ID" style="width: 100%" /> -->
+              {{model.createTime}}
+            </a-form-model-item>
+
+            <a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="" style="margin-bottom:0px;">
+              <!-- <a-textarea v-model="model.contentBody" rows="4" placeholder="请输入内容" /> -->
+              {{model.statusName}}
+            </a-form-model-item>
+
+            <a-form-model-item label="付款状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="" style="margin-bottom:0px;">
+              <!-- <a-input v-model="model.userName" placeholder="请输入姓名"  ></a-input> -->
+              {{model.payStatus==1? '已付款': '未付款'}}
+            </a-form-model-item>
+
+            <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="" style="margin-bottom:0px;">
+              <!-- <a-input v-model="model.roomNo" placeholder="请输入房号"  ></a-input> -->
+              {{model.remarks}}
+            </a-form-model-item>
+          </a-col>
+          <!-- <a-col :span="12">
+              <a-card title="订单信息" :bordered="false" style="width: 100%">
+                  <a-form-model-item label="订房状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="" style="margin-bottom:0px;">
+                    {{roomStatusFilter(model.status)}}
+                  </a-form-model-item>
+                  <a-form-model-item label="付款金额" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="" style="margin-bottom:0px;">
+                    {{model.money}}
+                  </a-form-model-item>
+                  <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="" style="margin-bottom:0px;">
+                    {{model.remark}}
+                  </a-form-model-item>
+                  <a-form-model-item label="积分" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="" style="margin-bottom:0px;">
+                    {{'0'}}
+                  </a-form-model-item>
+                  <a-form-model-item label="会员折扣" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="" style="margin-bottom:0px;">
+                    {{model.memberZk}}
+                  </a-form-model-item>
+                  <a-form-model-item label="优惠券" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="" style="margin-bottom:0px;">
+                    {{model.couponMoney}}
+                  </a-form-model-item>
+                  <a-form-model-item label="免房券" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="" style="margin-bottom:0px;">
+                    {{'--'}}
+                  </a-form-model-item>
+              </a-card>
+          </a-col> -->
+          <a-col :span="24">
+            <h3>详情</h3>
+            <a-table :columns="columns" :dataSource="model.detailList || []">
+                <template slot="goodsName" slot-scope="text, record">
+                    {{text.goodsInfo.name}}
+                </template>
+            </a-table>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import { validateDuplicateValue } from '@/utils/util'
+
+  export default {
+    name: 'CesOrderMessageForm',
+    components: {
+    },
+    props: {
+      //表单禁用
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+    },
+    data () {
+      return {
+        model:{
+         },
+        columns: [
+          {
+            title: "名称",
+            align: "center",
+            dataIndex: "",
+            scopedSlots: { customRender: "goodsName" }
+          },
+          // {
+          //   title: "订单号",
+          //   align: "center",
+          //   dataIndex: "orderCode",
+          // },
+          {
+            title: "价格",
+            align: "center",
+            dataIndex: "money",
+            // customRender: function (text) {
+            //   return Number(text.money) + Number(text.memberZk) + Number(text.couponMoney)
+            // }
+          },
+          {
+            title: "数量",
+            align: "center",
+            dataIndex: "num",
+          }
+        ],
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        validatorRules: {
+           tenantId: [
+              { required: true, message: '请输入关联租户!'},
+           ],
+           hotelId: [
+              { required: true, message: '请输入关联酒店!'},
+           ],
+           messageType: [
+              { required: true, message: '请输入留言类型 1 投诉 2建议!'},
+           ],
+           createDate: [
+              { required: true, message: '请输入创建时间!'},
+           ],
+        },
+        url: {
+          add: "/order/cesOrderMessage/add",
+          edit: "/order/cesOrderMessage/edit",
+          queryById: "/order/cesOrderMessage/queryById"
+        }
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+    },
+    created () {
+       //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+      add () {
+        this.edit(this.modelDefault);
+      },
+      edit (record) {
+        console.log(record);
+        this.model = Object.assign({}, record);
+        this.visible = true;
+      },
+      submitForm () {
+        const that = this;
+        // 触发表单验证
+        this.$refs.form.validate(valid => {
+          if (valid) {
+            that.confirmLoading = true;
+            let httpurl = '';
+            let method = '';
+            if(!this.model.id){
+              httpurl+=this.url.add;
+              method = 'post';
+            }else{
+              httpurl+=this.url.edit;
+               method = 'put';
+            }
+            httpAction(httpurl,this.model,method).then((res)=>{
+              if(res.success){
+                that.$message.success(res.message);
+                that.$emit('ok');
+              }else{
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+            })
+          }
+         
+        })
+      },
+      roomStatusFilter(status){
+        switch (status) {
+          case 1:
+            return '未付款';
+          case 2:
+            return '已付款';
+          case 3:
+            return '已取消';
+          case 4:
+            return '已完成';
+          case 5:
+            return '待入住';
+          case 6:
+            return '已入住';
+          case 7:
+            return '退款中';
+          default: '--'
+            break;
+        }
+      }
+    }
+  }
+</script>

+ 65 - 0
src/views/pos/modules/posThaliModals/posThaliModal.vue

@@ -0,0 +1,65 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }"
+    @cancel="handleCancel"
+    cancelText="关闭"
+  >
+    <PosThaliForm
+      ref="realForm"
+      @ok="submitCallback"
+      :disabled="disableSubmit"
+    ></PosThaliForm>
+  </j-modal>
+</template>
+
+<script>
+import PosThaliForm from "./posThaliForm.vue";
+export default {
+  name: "BusMarketMemberModal",
+  components: {
+    PosThaliForm,
+  },
+  data() {
+    return {
+      title: "",
+      width: 800,
+      visible: false,
+      disableSubmit: false,
+    };
+  },
+  methods: {
+    add() {
+      this.visible = true;
+      this.$nextTick(() => {
+        this.$refs.realForm.add();
+      });
+    },
+    edit(record) {
+      this.visible = true;
+      this.$nextTick(() => {
+        this.$refs.realForm.edit(record);
+      });
+    },
+    close() {
+      this.$emit("close");
+      this.visible = false;
+    },
+    handleOk() {
+      this.$refs.realForm.submitForm();
+    },
+    submitCallback(e) {
+      console.log("e", e);
+      this.$emit("ok", e);
+      this.visible = false;
+    },
+    handleCancel() {
+      this.close();
+    },
+  },
+};
+</script>

+ 10 - 12
src/views/pos/posThali.vue

@@ -157,19 +157,19 @@
         </template>
 
         <span slot="action" slot-scope="text, record">
-            <a @click="okChange(record)" v-if="record.status==5"> 确认 </a>
-            <a-divider type="vertical" v-if="record.status==1 || record.status==5 || record.status==2" />
-          <a v-if="record.status==1 || record.status==5 || record.status==2" @click="cancelOrder(record)">取消订单</a>
-          <a-divider type="vertical" v-if="record.status==1 || record.status==5" />
+            <!-- <a @click="okChange(record)" v-if="record.status==5"> 确认 </a>
+            <a-divider type="vertical" v-if="record.status==1 || record.status==5 || record.status==2" /> -->
+          <a @click="handleDelete(record.id)">删除</a>
+          <a-divider type="vertical" />
           <a @click="handleEdit(record)">查看</a>
         </span>
       </a-table>
     </div>
 
-    <!-- <ces-order-message-modal
+    <PosThaliModal
       ref="modalForm"
       @ok="modalFormOk"
-    ></ces-order-message-modal> -->
+    ></PosThaliModal>
   </a-card>
 </template>
 
@@ -177,13 +177,13 @@
 import "@/assets/less/TableExpand.less";
 import { mixinDevice } from "@/utils/mixin";
 import { JeecgListMixin } from "@/mixins/JeecgListMixin";
-// import CesOrderMessageModal from "./modules/CesOrderMessageModal";
+import PosThaliModal from "./modules/posThaliModals/posThaliModal.vue";
 import { httpAction, postAction, getAction } from "@/api/manage";
 export default {
   name: "cesOrderRepairList",
   mixins: [JeecgListMixin, mixinDevice],
   components: {
-    // CesOrderMessageModal,
+    PosThaliModal,
   },
   data() {
     return {
@@ -296,10 +296,8 @@ export default {
       ],
       url: {
         list: "/mall/mallPosTableOrderGoods/list",
-        delete: "/order/cesOrderRepair/delete",
-        deleteBatch: "/order/cesOrderRepair/deleteBatch",
-        exportXlsUrl: "/order/cesOrderRepair/exportXls",
-        importExcelUrl: "order/cesOrderRepair/importExcel",
+        delete: "/mall/mallPosTableOrderGoods/delete",
+        deleteBatch: "/mall/mallPosTableOrderGoods/deleteBatch",
       },
       dictOptions: {},
       superFieldList: [],

+ 9 - 5
src/views/settings/components/roomModules/goodList.vue

@@ -82,13 +82,13 @@
                     <a-card title="商品信息" :bordered="true" >
                         <a-row>
                             <a-col :span="8">
-                                商品编号:{{goodsSetData.barCode}}
+                                商品编号:{{goodsSetData.barCode || ''}}
                             </a-col>
                             <a-col :span="8">
-                                商品名称:{{goodsSetData.name}}
+                                商品名称:{{goodsSetData.name || ''}}
                             </a-col>
                             <a-col :span="8">
-                                商品库存:{{goodsSetData.inventory}}
+                                商品库存:{{goodsSetData.inventory || ''}}
                             </a-col>
                         </a-row>
                     </a-card>
@@ -441,6 +441,7 @@ export default {
                 this.$message.info('请先选择要删除的数据')
                 return
             }
+            const that = this
             this.$confirm({
                 title: '提示',
                 content: '确认要删除吗',
@@ -450,7 +451,10 @@ export default {
                     return goodBatchDel({idStr:this.selectedRowKeys.toString()}).then(res=>{
                         if (res.code && res.code==200) {
                             this.$message.success(res.message)
-                            this.loadData();
+                            that.reCalculatePage(that.selectedRowKeys.length)
+                            // that.$message.success(res.message);
+                            that.loadData();
+                            that.onClearSelected();
                         }else{
                             this.$message.error(res.message)
                         }
@@ -487,7 +491,7 @@ export default {
         moreSet(record){
             console.log(this.$refs.modalSet);
             this.$refs.modalSet.edit(record)
-            this.$refs.modalForm.disableSubmit = false;
+            // this.$refs.modalForm.disableSubmit = false;
             // this.moreSetVisible = true
         },
         //更多设置确认

+ 2 - 1
src/views/settings/components/roomModules/moreSet/foodSet.vue

@@ -94,7 +94,8 @@ export default {
             modelData:{
                 beat:true,
                 weighDown:false
-            }
+            },
+            disableSubmit: false,
         }
     },
     methods: {

+ 6 - 6
src/views/settings/components/roomModules/setUnit/index.vue

@@ -41,12 +41,12 @@
 import { JeecgListMixin } from "@/mixins/JeecgListMixin";
 import { getUnit, addUnit, editUnit, delUnit, batchDelUnit } from '@/api/good'
 const columns = [
-  {
-    title: '商家',
-    dataIndex: 'name',
-    key: 'name',
-    align:'center'
-  },
+//   {
+//     title: '商家',
+//     dataIndex: 'name',
+//     key: 'name',
+//     align:'center'
+//   },
   {
     title: '单位名称',
     dataIndex: 'name',