shenzhongzheng 2 gadi atpakaļ
vecāks
revīzija
6e6ec497cc

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 39719 - 0
package-lock.json


+ 17 - 0
src/api/good.js

@@ -0,0 +1,17 @@
+import { axios } from '@/utils/request'
+
+/**
+ * 获取商品分类
+ * @param {object} parameter 参数
+ * @returns Axios Promise
+ */
+export function tree(parameter) {
+    return axios({
+        url: '/rooms/cesStockType/tree',
+        method: 'get',
+        params: parameter
+    })
+}
+
+
+

+ 261 - 0
src/views/settings/components/roomModules/goodList.vue

@@ -0,0 +1,261 @@
+<template>
+    <div class="back">
+        <div class="back-left">
+            <a-button @click="handleStockTypeModelManager(undefined,1)">添加分类</a-button>
+            <a-button style="margin-left: 30px;">单位设置</a-button>
+            <a-tree class="draggable-tree" :tree-data="treeData" blockNode style="width: 400px;"
+                :replaceFields="{ children: 'children', title: 'name', key: 'id' }">
+                <div slot="title" slot-scope="item,key,children" style="display:flex; align-items: center; height: 100%; overflow: hidden;">
+                    <a-button style="font-size: 12px" type="link" @click="() => { $message.success(item.name) }">{{ item.name}}</a-button>
+                    <div style="flex:1;height:1px;"></div>
+                    <a-button style="font-size: 12px; padding: 0 5px;" type="link" v-show="item.parentId == 0" @click="handleStockTypeModelManager(item,1)">添加分类</a-button>
+                    <a-button style="font-size: 12px; padding: 0 5px;" type="link" @click="handleStockTypeModelManager(item,2)">编辑</a-button>
+                    <a-button style="font-size: 12px; padding: 0 5px;" type="link" @click="() => { $message.success('删除--' + item.id) }">删除</a-button>
+                </div>
+            </a-tree>
+        </div>
+        <div class="back-right" style="margin-top: -28px; margin-left: 10px;">
+            <a-card :bordered="false">
+                <!-- 查询区域 -->
+                <div class="table-page-search-wrapper">
+                    <a-form layout="inline" @keyup.enter.native="searchQuery">
+                        <a-row :gutter="24">
+                            <a-col :span="4">
+                                <a-form-item label="">
+                                    <j-input placeholder="商品名称" v-model="queryParam.name" style="width: 200px"></j-input>
+                                </a-form-item>
+                            </a-col>
+                            <a-col :md="13" :sm="8" style="display: flex; justify-content: space-around;">
+                                <span style="float:left; overflow: hidden" class="table-page-search-submitButtons">
+                                    <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
+                                </span>
+                                <span style="float:left; overflow: hidden; line-height: 32px">【全部】房间属性</span>
+                                <span style="float:left; overflow: hidden">
+                                    <a-button type="primary" @click="handleAdd">新增商品</a-button>
+                                </span>
+                                <span style="float:left; overflow: hidden">
+                                    <a-button type="danger" @click="searchQuery">批量删除</a-button>
+                                </span>
+                                <span style="float:left; overflow: hidden;">
+                                    <a-button type="primary" style="background-color:coral;border: none"
+                                        @click="searchQuery">进退货</a-button>
+                                </span>
+                                <span style="float:left; overflow: hidden">
+                                    <a-button type="primary" style="background-color:seagreen;border: none"
+                                        @click="searchQuery">导入商品</a-button>
+                                </span>
+                            </a-col>
+                        </a-row>
+                    </a-form>
+                </div>
+                <!-- 查询区域-END -->
+                <div>
+                    <a-table ref="table" size="middle" :scroll="{ x: true }" bordered rowKey="id" :columns="columns"
+                        :dataSource="dataSource" :pagination="ipagination" :loading="false" :rowSelection="{
+                            selectedRowKeys: selectedRowKeys,
+                            onChange: onSelectChange,
+                        }" class="j-table-force-nowrap" @change="handleTableChange">
+
+                    </a-table>
+                </div>
+                <!-- <room-layout-form ref="modalForm" @ok="modalFormOk"></room-layout-form> -->
+                <stock-type-model ref="stockTypeModel" @ok="onSave"></stock-type-model>
+            </a-card>
+        </div>
+    </div>
+
+</template>
+<script>
+import { tree } from '@/api/good'
+import { JeecgListMixin } from "@/mixins/JeecgListMixin";
+import stockTypeModel from './stockTypeModel.vue'
+export default {
+    name: "goodList",
+    mixins: [JeecgListMixin],
+    components: {
+        stockTypeModel
+      },
+    data() {
+        return {
+            treeData: [
+                {
+                    t: '111',
+                    k: '1',
+                    c: [
+                        {
+                            t: '222',
+                            k: '2',
+                            c: [
+                                { t: 'leaf', k: '333', disableCheckbox: true },
+                                { t: 'leaf', k: '444' },
+                            ],
+                        },
+                        {
+                            t: '555',
+                            k: '555',
+                            c: [{ k: '666', t: 'sb' }],
+                        },
+                    ],
+                },],
+            checkedKeys: [''],
+            selectedKeys: [],
+            queryParam: {},
+            // 分页参数
+            ipagination: {
+                current: 1,
+                pageSize: 10,
+                pageSizeOptions: ["10", "20", "30"],
+                showTotal: (total, range) => {
+                    return range[0] + "-" + range[1] + " 共" + total + "条";
+                },
+                showQuickJumper: true,
+                showSizeChanger: true,
+                total: 0,
+            },
+            // 表头
+            columns: [
+                {
+                    title: "商家",
+                    align: "center",
+                    dataIndex: "hotelName",
+                },
+                {
+                    title: "分类",
+                    align: "center",
+                    dataIndex: "cover",
+
+                },
+                {
+                    title: "单位",
+                    align: "center",
+                    dataIndex: "name",
+
+                },
+                {
+                    title: "条码",
+                    align: "center",
+                    dataIndex: "marketPrice",
+                },
+                {
+                    title: "名称",
+                    align: "center",
+                    dataIndex: "canLivePersonNum",
+                },
+                {
+                    title: "进价",
+                    align: "center",
+                    dataIndex: "num",
+                },
+                {
+                    title: "售价",
+                    align: "center",
+                    dataIndex: "state",
+
+                },
+
+                {
+                    title: "进货量",
+                    align: "center",
+                    dataIndex: "appState",
+
+                },
+                {
+                    title: "销售量",
+                    align: "center",
+                    dataIndex: "appState2",
+
+                },
+                {
+                    title: "库存量",
+                    align: "center",
+                    dataIndex: "storeNum",
+
+                },
+                {
+                    title: "排序",
+                    align: "center",
+                    dataIndex: "appState3",
+
+                },
+                {
+                    title: "操作",
+                    dataIndex: "action",
+                    align: "center",
+                    fixed: "right",
+                    width: 147,
+                },
+            ],
+            url: {
+                // list: 'org.jeecg.modules.business/busMarketMember/list',
+                list: "/rooms/cesRoomLayout/list?hotelId",
+                delete: "/rooms/cesRoomLayout/remove",
+                deleteBatch: "/rooms/cesRoomLayout/deleteBatch",
+                exportXlsUrl: "/rooms/cesRoomLayout/exportXls",
+                importExcelUrl:"rooms/cesRoomLayout/importExcel",
+            },
+            dictOptions: {},
+            superFieldList: [],
+            selectedRowKeys: [],
+            isorter: {
+                column: "createTime",
+                order: "desc",
+            },
+            stockTypeVisible:false,
+        };
+    },
+    computed: {
+
+    },
+    watch: {
+
+    },
+    created() {
+        this.loadTree();
+    },
+    methods: {
+        handleStockTypeModelManager(item,type) {
+            console.log(item, type)
+            this.$refs.stockTypeModel.title = type === 1 ?"新增":"修改"
+            this.$refs.stockTypeModel.visible = true
+        },
+        loadTree() {
+            var that = this
+            tree().then((res) => {
+                if (res.success) {
+                    this.treeData = res.result;
+                }
+            })
+        },
+        onExpand(expandedKeys) {
+            console.log('onExpand', expandedKeys);
+            // if not set autoExpandParent to false, if children expanded, parent can not collapse.
+            // or, you can remove all expanded children keys.
+        },
+        onSelect(selectedKeys, info) {
+            console.log('onSelect', info);
+            this.selectedKeys = selectedKeys;
+        },
+    },
+};
+</script>
+<style scoped>
+.back {
+    display: flex;
+    justify-content: space-between;
+}
+
+.back-left {
+    flex: 10
+}
+
+.back-right {
+    flex: 38;
+}
+
+.ant-tree li .ant-tree-node-content-wrapper {
+    height: auto !important;
+}
+
+.ant-tree li .ant-tree-node-content-wrapper.ant-tree-node-selected {
+    background-color: #bae7ff33;
+}</style>

+ 0 - 1
src/views/settings/components/roomModules/roomLayoutForm.vue

@@ -29,7 +29,6 @@
         </j-form-container>
     </a-spin>
 </template>
-
 <script>
 import { getRoomPlans, getSelectList } from "@/api/api";
 import { httpAction, getAction } from "@/api/manage";

+ 181 - 0
src/views/settings/components/roomModules/stockTypeForm.vue

@@ -0,0 +1,181 @@
+<template>
+    <a-spin :spinning="confirmLoading">
+        <j-form-container :disabled="formDisabled">
+            <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+                <a-form-model-item label="名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="name">
+                    <a-input v-model="model.name" placeholder="请输入名称"></a-input>
+                </a-form-model-item>
+                <a-form-model-item label="上级" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="marketPrice">
+                    <a-select  style="width: 120px" v-model="model.canLivePersonNum" defaultValue="0">
+                        <a-select-option value ="0">{{"顶级目录"}}</a-select-option>
+                        <a-select-option v-for="d in selectData" :key="d.value">
+                            {{ d.name }}
+                        </a-select-option>
+                    </a-select>
+                </a-form-model-item>
+                
+                <a-form-model-item label="快捷" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="canLivePersonNum">
+                    <a-switch default-checked @change="onChange"  v-model="model.canLivePersonNum" />
+                </a-form-model-item>
+
+                <a-form-model-item label="是否启用" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="breakfastNum">
+                    <a-switch default-checked @change="onChange"  v-model="model.canLivePersonNum" />
+                </a-form-model-item>
+
+                <a-form-model-item label="应用范围" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="lunchNum">
+                    <a-checkbox :indeterminate="indeterminate" :checked="checkAll" @change="onCheckAllChange">
+                        Check all
+                    </a-checkbox>
+                    <a-checkbox-group v-model="checkedList" :options="plainOptions" @change="onChange" />
+                </a-form-model-item>
+
+                <a-form-model-item label="排序" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="dinnerNum">
+                    <a-input-number style="width:50%;" v-model="model.dinnerNum" :min="0"  placeholder="请输入排序"/>
+                </a-form-model-item>
+            </a-form-model>
+
+        </j-form-container>
+    </a-spin>
+</template>
+<script>
+import { getRoomPlans, getSelectList } from "@/api/api";
+import { httpAction, getAction } from "@/api/manage";
+import { validateDuplicateValue } from "@/utils/util";
+
+
+export default {
+    name: "BusMarketMemberForm",
+    props: {
+        disabled: {
+            type: Boolean,
+            default: false,
+            required: false,
+        },
+    },
+    data() {
+        return {
+            selectData:[],
+            model: {
+                id: "",
+                hotelId: 0,
+                name: null,
+                marketPrice: null,
+                canLivePersonNum: "0",
+                breakfastNum: 0,
+                lunchNum: 0,
+                dinnerNum: 0
+            },
+            labelCol: {
+                xs: { span: 24 },
+                sm: { span: 5 },
+            },
+            wrapperCol: {
+                xs: { span: 24 },
+                sm: { span: 16 },
+            },
+            confirmLoading: false,
+            validatorRules: {
+                name: [{ required: true, message: "请输入房型!" }],
+                marketPrice: [{ required: true, message: "请填写门市价!" }],
+                canLivePersonNum: [{ required: true, message: "请填写可住人数!" }],
+                breakfastNum: [{ required: true, message: "请填写早餐数量!" }],
+                lunchNum: [{ required: true, message: "请填写中餐数量!" }],
+                dinnerNum: [{ required: true, message: "请填写晚餐数量!" }],
+            },
+            url: {
+                add: "/rooms/cesRoomLayout/save",
+                edit: "/rooms/cesRoomLayout/modify",
+                queryById: "/rooms/cesRoomLayout/queryById",
+            },
+            iconChooseVisible: false,
+            roomPlans: [],
+            members: [],
+        };
+    },
+    computed: {
+        formDisabled() {
+            return this.disabled;
+        },
+    },
+    created() {
+        var _info = JSON.parse(localStorage.getItem("storeInfo"));
+        if (_info) {
+            this.model.hotelId = _info.id;
+            this.initData();
+        }
+        this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+        initData() {
+            getRoomPlans(this.model.hotelId, null).then((res) => {
+                if (res.success) {
+                    this.roomPlans = res.result;
+                }
+            });
+
+        },
+        selectIcons() {
+            this.iconChooseVisible = true;
+        },
+        handleIconCancel() {
+            this.iconChooseVisible = false;
+        },
+        handleIconChoose(value) {
+            console.log(value);
+            this.model.icon = value;
+            this.iconChooseVisible = false;
+        },
+        add() {
+            this.edit(this.modelDefault);
+        },
+        edit(record) {
+            this.model = Object.assign({}, record);
+            this.visible = true;
+            getSelectList({ id: this.model.id }).then((res) => {
+                if (res.success) {
+                    this.members = res.result;
+                }
+            });
+        },
+        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";
+                    }
+                    if (this.model.payFlag == 0) {
+                        this.model.payAmount = 0;
+                    }
+                    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;
+                        });
+                }
+            });
+        },
+    },
+};
+</script>
+<style scoped>
+.avatar-uploader>.ant-upload {
+    width: 104px;
+    height: 104px;
+}
+</style>

+ 60 - 0
src/views/settings/components/roomModules/stockTypeModel.vue

@@ -0,0 +1,60 @@
+<template>
+    <j-modal
+      :title="title"
+      :width="width"
+      :visible="visible"
+      switchFullscreen
+      @ok="handleOk"
+      :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+      @cancel="handleCancel"
+      cancelText="关闭">
+      <stock-type-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></stock-type-form>
+    </j-modal>
+  </template>
+  
+  <script>
+    import stockTypeForm from './stockTypeForm.vue'
+    export default {
+      name: 'stockTypeModel',
+      components: {
+        stockTypeForm
+      },
+      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(){
+          this.$emit('ok');
+          this.visible = false;
+        },
+        handleCancel () {
+          this.close()
+        }
+      }
+    }
+  </script>

+ 4 - 1
src/views/settings/roomSettings.vue

@@ -20,6 +20,7 @@
                     <a-icon type="shop" />
                     商品库存
                 </span>
+               <goodList></goodList>     
             </a-tab-pane>
         </a-tabs>
     </a-card>
@@ -28,10 +29,12 @@
 <script>
 import roomLayoutList from "./components/roomModules/roomLayoutList.vue"
 import roomGen from "./components/roomModules/roomGen.vue";
+import goodList from "./components/roomModules/goodList.vue";
 export default {
     components: {
         roomLayoutList,
-        roomGen
+        roomGen,
+        goodList
     },
     data() {
         return {