소스 검색

商品库存模块

DESKTOP-B78GIPM\admin 2 년 전
부모
커밋
24670fd293

+ 13 - 0
src/api/good.js

@@ -119,6 +119,19 @@ export function goodBatchDel(parameter){
 }
 
 /**
+ * 修改商品
+ * @param {*} parameter 
+ * @returns 
+ */
+export function editGood(parameter){
+    return axios({
+        url:'/rooms/cesGoods/modify',
+        method:'put',
+        data:parameter
+    })
+}
+
+/**
  * 进退货
  * @param {*} parameter 
  * @returns 

+ 15 - 10
src/views/settings/components/roomModules/goodList.vue

@@ -107,7 +107,7 @@
                             数量
                         </a-col>
                         <a-col :span="4">
-                            <a-input-number v-model="goodsSetData.goodNum" :min="0" /> &nbsp;
+                            <a-input-number v-model="goodsSetData.goodNum" :min="0" /> &nbsp;{{goodsSetData.unitName}}
                         </a-col>
                     </a-row>
                     <a-row style="display:flex;justify-content:center;align-items:center;">
@@ -122,14 +122,15 @@
                 </a-modal>
                 <!-- 进退货区域END -->
                 <!-- 更多设置弹窗 -->
-                <a-modal destroyOnClose title="详细设置" closable :visible="moreSetVisible" @ok="handleMoreSetOk" @cancel="()=>{moreSetVisible=false}"
+                <moreSet ref='modalSet' @ok="onSave" />
+                <!-- <a-modal destroyOnClose title="详细设置" closable :visible="moreSetVisible" @ok="handleMoreSetOk" @cancel="()=>{moreSetVisible=false}"
                  width="70%" >
                     <a-card style="width:100%" :tab-list="tabListNoTitle" :active-tab-key="noTitleKey"
                      @tabChange="key => onTabChange(key, 'noTitleKey')">
                         <Commodity v-if="noTitleKey=='commodity'" />
                         <GoodImg v-if="noTitleKey=='goodImg'" />
                     </a-card>
-                </a-modal>
+                </a-modal> -->
                 <room-layout-form ref="modalForm" @ok="modalFormOk"></room-layout-form>
                 <stock-type-model ref="stockTypeModel" @ok="onSave"></stock-type-model>
             </a-card>
@@ -144,8 +145,9 @@ import { tree, delTree, goodBatchDel, goodSet } from '@/api/good'
 import { JeecgListMixin } from "@/mixins/JeecgListMixin";
 import roomLayoutForm from './goodStock/goods'
 import stockTypeModel from './stockTypeModel.vue'
-import Commodity from './moreSet/commodity.vue'
-import GoodImg from './moreSet/goodImg.vue';
+// import Commodity from './moreSet/commodity.vue'
+// import GoodImg from './moreSet/goodImg.vue';
+import moreSet from './moreSet/moreModal.vue'
 import { computed } from 'vue';
 import SetUnit from './setUnit/index.vue'
 
@@ -175,8 +177,9 @@ export default {
         stockTypeModel,
         roomLayoutForm,
         SetUnit,
-        Commodity,
-        GoodImg
+        moreSet
+        // Commodity,
+        // GoodImg
       },
     data() {
         return {
@@ -482,9 +485,11 @@ export default {
             this.goodsSetData.type = e.target.value
         },
         //更多设置
-        moreSet(e){
-            console.log(e);
-            this.moreSetVisible = true
+        moreSet(record){
+            console.log(this.$refs.modalSet);
+            this.$refs.modalSet.edit(record)
+            this.$refs.modalForm.disableSubmit = false;
+            // this.moreSetVisible = true
         },
         //更多设置确认
         handleMoreSetOk(){

+ 24 - 13
src/views/settings/components/roomModules/moreSet/commodity.vue

@@ -12,31 +12,32 @@
             <a-row>
                 <a-col :span="12" type='flex' justify="start">
                     <a-form-model-item style="width:100%" label="能否储值卡" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="">
-                        <a-switch :checked="model.appState" @change="switchState" ></a-switch>
+                        <a-switch :checked="model.canStoreCard" @change="storeChange" ></a-switch>
                     </a-form-model-item>
                 </a-col>
             </a-row>
             <a-row>
                 <a-col :span="12">
                     <a-form-model-item label="能否积分支付" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="">
-                        <a-switch :checked="model.appState" @change="switchState" ></a-switch>
+                        <a-switch :checked="model.canIntegralPay" @change="integralPayChange" ></a-switch>
                     </a-form-model-item>
                 </a-col>
             </a-row>
             <a-row>
                 <a-col :span="12">
                     <a-form-model-item label="积分支付价格" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="">
-                        <a-input-number v-model="model.bid" :min="0" />
+                        <a-input-number v-model="model.integralPrice" :min="0" />
                     </a-form-model-item>
                 </a-col>
             </a-row>
             <a-row>
                 <a-col :span="24">
                     <a-form-model-item label="描述" :labelCol="{span:'2',offset:'0'}" :wrapperCol="wrapperCol" prop="">
-                        <j-editor />
+                        <j-editor v-model="model.remark" />
                     </a-form-model-item>
                 </a-col>
             </a-row>
+            <a-button @click="submitForm">确认</a-button>
         </a-form-model>
 
     </j-form-container>
@@ -78,7 +79,9 @@ export default {
                 purchases:null,
                 salesVolume:null,
                 inventory:null,
-                appState:null
+                appState:false,
+                canStoreCard:false,
+                canIntegralPay:false
             },
             labelCol: {
                 xs: {
@@ -203,15 +206,15 @@ export default {
             this.model = JSON.parse(JSON.stringify(record))
             
             console.log(this.filterType(this.treeData, record.goodType));
-            console.log(this.arr);
+            console.log(this.model);
             this.visible = true;
-            getSelectList({
-                id: this.model.id
-            }).then((res) => {
-                if (res.success) {
-                    this.members = res.result;
-                }
-            });
+            // getSelectList({
+            //     id: this.model.id
+            // }).then((res) => {
+            //     if (res.success) {
+            //         this.members = res.result;
+            //     }
+            // });
         },
         submitForm() {
             const that = this;
@@ -258,6 +261,14 @@ export default {
         switchState(e){
             console.log('这是滑动按钮触发',e);
             this.model.appState = e
+        },
+        storeChange(e){
+            console.log(e);
+            this.model.canStoreCard = e
+        },
+        integralPayChange(e){
+            console.log(e);
+            this.model.canIntegralPay = e
         }
     },
 };

+ 133 - 0
src/views/settings/components/roomModules/moreSet/foodSet.vue

@@ -0,0 +1,133 @@
+<template>
+<a-space direction="vertical" style="width:100%">
+    <a-card title="商品规格" style="width: 100%">
+        <a-row :gutter="[6,38]" v-for="(item, index) in specsData" :key="item.id">
+            <a-col :span="4">
+                <a-input placeholder="商品规格" v-model="item.specs"></a-input>
+            </a-col>
+            <a-col :span="4">
+                <a-input-number :min="0.0" style="width:100%" v-model="item.number"></a-input-number>
+            </a-col>
+            <a-col :span="2">
+                <a-button @click="delSpecs(index)">删除</a-button>
+            </a-col>
+        </a-row>
+        <a-row>
+            <a-col>
+                <a-button @click="addSpecs">添加规格</a-button>
+            </a-col>
+        </a-row>
+    </a-card>
+    <a-card title="商品口味" style="width: 100%">
+        <a-row :gutter="[6,38]" v-for="(item, index) in specsData" :key="item.id">
+            <a-col :span="4">
+                <a-input placeholder="商品规格" v-model="item.specs"></a-input>
+            </a-col>
+            <a-col :span="4">
+                <a-input-number :min="0.0" style="width:100%" v-model="item.number"></a-input-number>
+            </a-col>
+            <a-col :span="2">
+                <a-button @click="delSpecs(index)">删除</a-button>
+            </a-col>
+        </a-row>
+        <a-row>
+            <a-col>
+                <a-button @click="addTasta">添加口味</a-button>
+            </a-col>
+        </a-row>
+    </a-card>
+    <a-card title="商品加料" style="width: 100%">
+        <a-row :gutter="[6,38]" v-for="(item, index) in specsData" :key="item.id">
+            <a-col :span="4">
+                <a-input placeholder="商品规格" v-model="item.specs"></a-input>
+            </a-col>
+            <a-col :span="4">
+                <a-input-number :min="0.0" style="width:100%" v-model="item.number"></a-input-number>
+            </a-col>
+            <a-col :span="2">
+                <a-button @click="delSpecs(index)">删除</a-button>
+            </a-col>
+        </a-row>
+        <a-row>
+            <a-col>
+                <a-button @click="addMaterial">选择加料</a-button>
+            </a-col>
+        </a-row>
+    </a-card>
+    <a-card style="width: 100%">
+        <a-row>
+            <a-col :span="2">是否启用厨打</a-col>
+            <a-col :span="22">
+                <a-switch checked-children="是" un-checked-children="否" v-model="modelData.beat" />
+            </a-col>
+        </a-row>
+        <a-row>
+            <a-col :span="2">是否计重</a-col>
+            <a-col :span="22">
+                <a-switch checked-children="是" un-checked-children="否" v-model="modelData.weighDown" />
+            </a-col>
+        </a-row>
+    </a-card>
+    <a-button>确认</a-button>
+    <j-modal :title="'口味选择'" :width="'70%'" :visible="tastaVisible" switchFullscreen @ok="handleOk" :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" @cancel="tastaVisible=false" cancelText="关闭">
+        <tastaTable />
+    </j-modal>
+    <j-modal :title="'加料选择'" :width="'70%'" :visible="materialVisible" switchFullscreen @ok="handleMateriaOk" :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" @cancel="materialVisible=false" cancelText="关闭">
+        <materialTableVue />
+    </j-modal>
+</a-space>
+</template>
+
+<script>
+import materialTableVue from './materialTable.vue';
+import tastaTable from './tastaTable.vue';
+export default {
+    components:{
+        tastaTable,
+        materialTableVue
+    },
+    data() {
+        return {
+            specsData: [],
+            tastaVisible:false,
+            materialVisible:false,
+            modelData:{
+                beat:true,
+                weighDown:false
+            }
+        }
+    },
+    methods: {
+        //删除规格
+        delSpecs(index) {
+            console.log(index);
+            this.specsData.splice(index, 1)
+        },
+        //添加规格
+        addSpecs() {
+            this.specsData.push({
+                specs: '',
+                number: null
+            })
+        },
+        addTasta() {
+            this.tastaVisible = true
+        },
+        handleOk(){
+            this.tastaVisible = false
+        },
+        handleCancel(){},
+        //加料
+        addMaterial(){
+            this.materialVisible = true
+        },
+        handleMateriaOk(){
+            this.materialVisible = false
+        }
+    }
+}
+</script>
+
+<style>
+
+</style>

+ 163 - 37
src/views/settings/components/roomModules/moreSet/goodImg.vue

@@ -1,62 +1,98 @@
 <template>
   <div class="clearfix">
-        <a-row>
-            <a-col>商品大图</a-col>
-            <a-col>
-                <a-upload action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
-                list-type="picture-card"
-                :file-list="fileList"
-                @preview="handlePreview"
-                @change="handleChange">
-                <div v-if="fileList.length < 8">
-                    <a-icon type="plus" />
-                    <div class="ant-upload-text">
-                    Upload
-                    </div>
-                </div>
-                </a-upload>
-            </a-col>
-        </a-row>
-        <a-row>
-            <a-col>图片</a-col>
-            <a-col>
-                <a-upload action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
-                list-type="picture-card"
-                :file-list="fileList"
-                @preview="handlePreview"
-                @change="handleChange">
-                <div v-if="fileList.length < 8">
-                    <a-icon type="plus" />
-                    <div class="ant-upload-text">
-                    Upload
-                    </div>
-                </div>
-                </a-upload>
-            </a-col>
-        </a-row>
+    <a-row>
+      <a-col>商品大图</a-col>
+      <a-col>
+        <a-upload
+          action="/rooms/cesGoods/modify"
+          list-type="picture-card"
+          :file-list="fileList"
+          @preview="handlePreview"
+          @change="handleChange"
+        >
+          <div v-if="fileList.length < 1">
+            <a-icon type="plus" />
+            <!-- <div class="ant-upload-text">Upload</div> -->
+          </div>
+        </a-upload>
+      </a-col>
+    </a-row>
+    <a-row>
+      <a-col>图片</a-col>
+      <a-col>
+        <a-upload
+          action="#"
+          list-type="picture-card"
+          :file-list="fileListImgs"
+          @preview="handlePreview"
+          @change="handleChangeImgs"
+        >
+          <div v-if="fileList.length < 8">
+            <a-icon type="plus" />
+            <!-- <div class="ant-upload-text">Upload</div> -->
+          </div>
+        </a-upload>
+      </a-col>
+    </a-row>
+    <a-button @click="submitImg">确认</a-button>
     <a-modal :visible="previewVisible" :footer="null" @cancel="handleCancel">
       <img alt="example" style="width: 100%" :src="previewImage" />
     </a-modal>
   </div>
 </template>
+
 <script>
 function getBase64(file) {
   return new Promise((resolve, reject) => {
     const reader = new FileReader();
     reader.readAsDataURL(file);
     reader.onload = () => resolve(reader.result);
-    reader.onerror = error => reject(error);
+    reader.onerror = (error) => reject(error);
   });
 }
+import { httpAction, getAction } from "@/api/manage";
 export default {
+  inject:['modelData'],
   data() {
     return {
       previewVisible: false,
-      previewImage: '',
+      previewImage: "",
       fileList: [],
+      fileListImgs: [],
+      model: {
+        id: "",
+        hotelId: 0,
+        goodType: "",
+        goodUnit: "",
+        barCode: "",
+        bid: null,
+        name: "",
+        sellingPrice: "",
+        purchases: null,
+        salesVolume: null,
+        inventory: null,
+        appState: false,
+        canStoreCard: false,
+        canIntegralPay: false,
+      },
+      url: {
+        edit: "/rooms/cesGoods/modify",
+      },
     };
   },
+  created(){
+    console.log(this.model);
+  },
   methods: {
+    getStartData(){
+      this.model = this.modelData
+      if (this.model.cover) {
+        this.fileList.push(this.model.cover);
+      }
+      if (this.model.images) {
+        this.fileListImgs = this.model.images.split(",");
+      }
+    },
     handleCancel() {
       this.previewVisible = false;
     },
@@ -68,11 +104,101 @@ export default {
       this.previewVisible = true;
     },
     handleChange({ fileList }) {
+      console.log(fileList);
       this.fileList = fileList;
     },
+    handleChangeImgs({ fileList }) {
+      console.log(fileList);
+      this.fileListImgs = fileList;
+    },
+    edit(record) {
+      console.log(22222222, record);
+      this.model = JSON.parse(JSON.stringify(record));
+      if (this.model.cover) {
+        this.fileList.push(this.model.cover);
+      }
+      if (this.model.images) {
+        this.fileListImgs = this.model.images.split(",");
+      }
+      // console.log(this.filterType(this.treeData, record.goodType));
+      // console.log(this.arr);
+      this.visible = true;
+      // getSelectList({
+      //   id: this.model.id,
+      // }).then((res) => {
+      //   if (res.success) {
+      //     this.members = res.result;
+      //   }
+      // });
+    },
+    //修改图片
+    submitImg() {
+      const that = this;
+      that.confirmLoading = true;
+      let httpurl = "";
+      let method = "";
+      httpurl += this.url.edit;
+      method = "put";
+      if (this.model.payFlag == 0) {
+        this.model.payAmount = 0;
+      }
+      this.model.cover = this.fileList[0].thumbUrl;
+      let arr=[] 
+      this.fileListImgs.forEach(ele=>{
+        arr.push(ele.thumbUrl)
+      })
+      this.model.images = arr.toString()
+      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;
+        });
+    },
+    submitForm() {
+      const that = this;
+      // 触发表单验证
+      debugger;
+      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>
 /* you can make up upload button and sample style by using stylesheets */
 .ant-upload-select-picture-card i {
@@ -84,4 +210,4 @@ export default {
   margin-top: 8px;
   color: #666;
 }
-</style>
+</style>

+ 101 - 0
src/views/settings/components/roomModules/moreSet/materialTable.vue

@@ -0,0 +1,101 @@
+<template>
+<div>
+    <a-row :gutter="[6,38]">
+        <a-col :span="4">
+            <j-input placeholder="商品名称" v-model="queryParam.name" style="width: 200px"></j-input>
+        </a-col>
+        <a-col :span="4">
+            <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
+        </a-col>
+    </a-row>
+    <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource" :pagination="ipagination" :loading="loading" :rowSelection="{
+      selectedRowKeys: selectedRowKeys,
+      onChange: onSelectChange,
+    }" class="j-table-force-nowrap" @change="handleTableChange">
+        <span slot="state" slot-scope="record">
+            {{ record ? "启用" : "停用" }}
+            <!-- {{record}} -->
+        </span>
+        <!-- <span slot="action" slot-scope="text, record">
+        <a @click="handleEdit(record)">修改</a>
+        <a-divider type="vertical" />
+        <a @click="moreSet(record)">更多设置</a>
+        <a-divider type="vertical" />
+        <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+            <a>删除</a>
+        </a-popconfirm>
+    </span> -->
+    </a-table>
+</div>
+</template>
+
+<script>
+import {
+    JeecgListMixin
+} from "@/mixins/JeecgListMixin";
+export default {
+    mixins: [JeecgListMixin],
+    data() {
+        return {
+            // 表头
+            columns: [{
+                    title: "加料名称",
+                    align: "center",
+                    dataIndex: "hotelName",
+                    customCell: () => {
+                        return {
+                            style: {
+                                wordWrap: "break-word",
+                                wordBreak: "break-all",
+                                whiteSpace: "normal",
+                                minHeight: "50px",
+                                width: "50px",
+                            },
+                        };
+                    },
+                },
+                {
+                    title: "加料金额",
+                    align: "center",
+                    dataIndex: "typeName",
+                    customCell: () => {
+                        return {
+                            style: {
+                                wordWrap: "break-word",
+                                wordBreak: "break-all",
+                                whiteSpace: "normal",
+                                minHeight: "50px",
+                                width: "50px",
+                            },
+                        };
+                    },
+                },
+                {
+                    title: "状态",
+                    align: "center",
+                    dataIndex: "unitName",
+                    customCell: () => {
+                        return {
+                            style: {
+                                wordWrap: "break-word",
+                                wordBreak: "break-all",
+                                whiteSpace: "normal",
+                                minHeight: "50px",
+                                width: "50px",
+                            },
+                        };
+                    },
+                },
+                {
+                    title: "创建时间",
+                    align: "center",
+                    dataIndex: "bid",
+                },
+            ],
+        };
+    },
+};
+</script>
+
+<style>
+</style>

+ 107 - 0
src/views/settings/components/roomModules/moreSet/moreModal.vue

@@ -0,0 +1,107 @@
+<template>
+<!-- <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <bus-market-member-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></bus-market-member-form>
+  </j-modal> -->
+<j-modal destroyOnClose title="详细设置" :width="'70%'" :footer="null" :visible="visible" :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" @ok="handleOk" @cancel="handleCancel">
+    <a-card style="width:100%" :tab-list="tabListNoTitle" :active-tab-key="noTitleKey" @tabChange="key => onTabChange(key, 'noTitleKey')">
+        <BusMarketMemberForm ref="realForm" @ok="submitCallback" :disabled="disableSubmit" v-show="noTitleKey=='commodity'" />
+        <GoodImg @saveOk="handleCancel" ref="goodImg" v-show="noTitleKey=='goodImg'" />
+        <FoodSet v-show="noTitleKey=='foodSet'" />
+    </a-card>
+</j-modal>
+</template>
+
+<script>
+const tabListNoTitle=[
+        {
+          key: 'commodity',
+          tab: '商品小程序设置',
+        },
+        {
+          key: 'goodImg',
+          tab: '商品图片',
+        },
+        {
+          key: 'foodSet',
+          tab: '餐饮设置',
+        }
+      ]
+import BusMarketMemberForm from './commodity.vue'
+// import GoodImg from './goodImg.vue'
+import GoodImg from '../roomLayoutDetailForm/roomLayoutImage.vue'
+import FoodSet from './foodSet.vue'
+import { computed } from 'vue'
+export default {
+    name: 'BusMarketMemberModal',
+    components: {
+        BusMarketMemberForm,
+        GoodImg,
+        FoodSet
+    },
+    data() {
+        return {
+            title: '',
+            width: 800,
+            visible: false,
+            disableSubmit: false,
+            tabListNoTitle,
+            key: 'tab1',
+            noTitleKey: 'commodity',
+            model:{}
+        }
+    },
+    provide(){
+        return{
+            modelData:computed(()=> this.model)
+        }
+    },
+    methods: {
+        add() {
+            this.visible = true
+            this.$nextTick(() => {
+                this.$refs.realForm.add();
+            })
+        },
+        edit(record) {
+            console.log(record);
+            this.visible = true
+            this.$nextTick(() => {
+                this.model = record
+                this.$refs.realForm.edit(record);
+                console.log('refs.realForm',this.$refs.realForm);
+            })
+        },
+        close() {
+            this.$emit('close');
+            this.visible = false;
+        },
+        handleOk() {
+            this.$refs.realForm.submitForm();
+        },
+        submitCallback() {
+            this.$emit('ok');
+            this.visible = false;
+        },
+        handleCancel() {
+            this.close()
+        },
+        //更多设置切换卡片
+        onTabChange(key, type) {
+            console.log(key, type);
+            this[type] = key;
+            if (key = 'goodImg') {
+                this.model.url = true
+                this.$refs.goodImg.setData(this.model)
+            }
+        },
+    }
+}
+</script>

+ 111 - 0
src/views/settings/components/roomModules/moreSet/tastaTable.vue

@@ -0,0 +1,111 @@
+<template>
+<div>
+    <a-row :gutter="[6,38]">
+        <a-col :span="4">
+            <j-input placeholder="商品名称" v-model="queryParam.name" style="width: 200px"></j-input>
+        </a-col>
+        <a-col :span="4">
+            <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
+        </a-col>
+    </a-row>
+    <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource" :pagination="ipagination" :loading="loading" :rowSelection="{
+      selectedRowKeys: selectedRowKeys,
+      onChange: onSelectChange,
+    }" class="j-table-force-nowrap" @change="handleTableChange">
+        <span slot="state" slot-scope="record">
+            {{ record ? "启用" : "停用" }}
+            <!-- {{record}} -->
+        </span>
+        <!-- <span slot="action" slot-scope="text, record">
+        <a @click="handleEdit(record)">修改</a>
+        <a-divider type="vertical" />
+        <a @click="moreSet(record)">更多设置</a>
+        <a-divider type="vertical" />
+        <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+            <a>删除</a>
+        </a-popconfirm>
+    </span> -->
+    </a-table>
+</div>
+</template>
+
+<script>
+import {
+    JeecgListMixin
+} from "@/mixins/JeecgListMixin";
+export default {
+    mixins: [JeecgListMixin],
+    data() {
+        return {
+            // 表头
+            columns: [{
+                    title: "口味名称",
+                    align: "center",
+                    dataIndex: "hotelName",
+                    customCell: () => {
+                        return {
+                            style: {
+                                wordWrap: "break-word",
+                                wordBreak: "break-all",
+                                whiteSpace: "normal",
+                                minHeight: "50px",
+                                width: "50px",
+                            },
+                        };
+                    },
+                },
+                {
+                    title: "加价金额",
+                    align: "center",
+                    dataIndex: "typeName",
+                    customCell: () => {
+                        return {
+                            style: {
+                                wordWrap: "break-word",
+                                wordBreak: "break-all",
+                                whiteSpace: "normal",
+                                minHeight: "50px",
+                                width: "50px",
+                            },
+                        };
+                    },
+                },
+                {
+                    title: "状态",
+                    align: "center",
+                    dataIndex: "unitName",
+                    customCell: () => {
+                        return {
+                            style: {
+                                wordWrap: "break-word",
+                                wordBreak: "break-all",
+                                whiteSpace: "normal",
+                                minHeight: "50px",
+                                width: "50px",
+                            },
+                        };
+                    },
+                },
+                {
+                    title: "应用范围",
+                    align: "center",
+                    dataIndex: "barCode",
+                },
+                {
+                    title: "备注",
+                    align: "center",
+                    dataIndex: "name",
+                },
+                {
+                    title: "创建时间",
+                    align: "center",
+                    dataIndex: "bid",
+                },
+            ],
+        };
+    },
+};
+</script>
+
+<style>
+</style>

+ 39 - 0
src/views/settings/components/roomModules/roomLayoutDetailForm/roomLayoutImage.vue

@@ -15,6 +15,7 @@
 
 <script>
 import { modify } from '@/api/roomLayout'
+import { editGood } from '@/api/good'
 export default {
     name: 'HotelSaasTenantFrontendRoomLayoutImage',
 
@@ -39,6 +40,9 @@ export default {
     methods: {
         setData(data) {
             this.model = JSON.parse(JSON.stringify(data))
+            if (!data.picture) {
+                this.model.picture = data.images
+            }
         },
         submitForm() {
             const that = this;
@@ -47,6 +51,41 @@ export default {
                 if (valid) {
                     let data = JSON.parse(JSON.stringify(this.model))
                     that.confirmLoading = true;
+                    // debugger
+                    console.log('datadatadatadata',data);
+                    if (data.url) {
+                        editGood({
+                            id: data.id,
+                            hotelId: data.hotelId,
+                            name: data.name,
+                            images: data.picture,
+                            goodUnit: data.goodUnit,
+                            goodType: data.goodType,
+                            barCode: data.barCode,
+                            bid: data.bid,
+                            sellingPrice: data.sellingPrice,
+                            purchases: data.purchases,
+                            salesVolume: data.salesVolume,
+                            marketPrice: data.marketPrice,
+                            inventory: data.inventory,
+                            appState: data.appState,
+                            // canLivePersonNum: data.canLivePersonNum,
+                            // breakfastNum: data.breakfastNum,
+                            // lunchNum: data.lunchNum,
+                            // dinnerNum: data.dinnerNum,
+                            cover: data.cover,
+                            picture: data.picture
+                        })
+                        .then(res => {
+                            if (res.code == 200) {
+                                this.$emit('saveOk')
+                                this.$message.success("保存成功")
+                            }
+                        }).finally(_ => {
+                            that.confirmLoading = false;
+                        })
+                        return
+                    }
                     modify({
                         id: data.id,
                         hotelId: data.hotelId,