gqx 2 年之前
父节点
当前提交
789ec349b9

+ 1 - 1
src/views/stock/index.vue

@@ -15,7 +15,7 @@
       </a-tab-pane>
       </a-tab-pane>
       <a-tab-pane key="4">
       <a-tab-pane key="4">
         <span slot="tab"> 出入库管理 </span>
         <span slot="tab"> 出入库管理 </span>
-        <stock></stock>
+        <stock v-if="activeKey == '4'"></stock>
       </a-tab-pane>
       </a-tab-pane>
       <a-tab-pane key="5">
       <a-tab-pane key="5">
         <span slot="tab"> 商品库存统计 </span>
         <span slot="tab"> 商品库存统计 </span>

+ 315 - 0
src/views/stock/modules/DepositoryForm copy.vue

@@ -0,0 +1,315 @@
+<template>
+<a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+        <a-form-model ref="form" :model="model" layout="horizontal" :rules="validatorRules" slot="detail">
+            <a-row :gutter="2" align="top" type="flex">
+                <a-col :span="5" flex>
+                    <a-form-item label="" prop="depositoryList">
+                        <a-select v-model="model.depositoryId" style="width: 100%" placeholder="入仓仓库" :allowClear="true">
+                            <a-select-option v-for="(item, index) in depositoryList" :key="index" :value="item.id">{{ item.name }}</a-select-option>
+                        </a-select>
+                    </a-form-item>
+                </a-col>
+                <a-col :span="5">
+                    <a-form-item label="" prop="supplierList">
+                        <a-select v-model="model.supplierId" style="width: 100%" placeholder="供应商" :allowClear="true">
+                            <a-select-option v-for="(item, index) in supplierList" :key="index" :value="item.id">{{ item.name }}</a-select-option>
+                        </a-select>
+                    </a-form-item>
+                </a-col>
+                <a-col :span="5">
+                    <a-form-item label="" prop="storageTypeList">
+                        <a-select v-model="model.stockType" style="width: 100%" placeholder="入库类型" :allowClear="true">
+                            <a-select-option v-for="(item, index) in storageTypeList" :key="index" :value="item.value">{{ item.title }}</a-select-option>
+                        </a-select>
+                    </a-form-item>
+                </a-col>
+                <a-col :span="6" style="margin-top:5px;">
+                    <a-button :disabled="!model.supplierId" @click="handleGoods" type="primary" icon="plus">批量添加</a-button>
+                </a-col>
+            </a-row>
+        </a-form-model>
+    </j-form-container>
+
+    <!-- 查询区域-END -->
+    <div>
+        <a-table :scroll="{ y: 540 }" ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource" :pagination="false" :loading="loading" class="j-table-force-nowrap" @change="handleTableChange">
+            <span slot="state" slot-scope="record">
+                {{ record ? "启用" : "停用" }}
+                <!-- {{record}} -->
+            </span>
+            <template slot="price" slot-scope="record">
+                <a-input-number :min="0" :placeholder="record.costPrice" v-model="record.costPrice"></a-input-number>
+            </template>
+            <template slot="num" slot-scope="record">
+                <a-input-number :min="0" v-model="record.num"></a-input-number>
+            </template>
+            <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="() => deleteGoods(record.id)">
+                    <a>删除</a>
+                </a-popconfirm>
+            </span>
+        </a-table>
+    </div>
+
+    <a-row>
+        <a-col :span="12">
+            <a-form-item label="备注" label-col="labelCol">
+                <a-textarea v-model="model.remarks" :rows="4" />
+            </a-form-item>
+        </a-col>
+    </a-row>
+
+    <supplier-in-goods-modal ref="modalSelectGoodsForm" @ok="selectOk"></supplier-in-goods-modal>
+</a-spin>
+</template>
+
+<script>
+import {
+    httpAction,
+    getAction
+} from "@/api/manage";
+import {
+    validateDuplicateValue
+} from "@/utils/util";
+import {
+    JeecgListMixin
+} from "@/mixins/JeecgListMixin";
+import SupplierInGoodsModal from "./DepositorySelectGoods/selectGoodsModal.vue";
+export default {
+    name: "PosTypeForm",
+    mixins: [JeecgListMixin],
+    components: {
+        SupplierInGoodsModal,
+    },
+    props: {
+        //表单禁用
+        disabled: {
+            type: Boolean,
+            default: false,
+            required: false,
+        },
+    },
+    data() {
+        return {
+            model: {
+                code: "",
+                createAt: "",
+                createTime: "",
+                // depositoryId: "",
+                hotelId: "",
+                id: "",
+                remarks: "",
+                status: 0,
+                num: 0,
+                // stockInfo: "",
+                // stockType: 0,
+                // supplierId: "",
+                tenantId: "",
+                type: 2,
+                verifyAt: "",
+                verifyRemarks: "",
+                verifyTime: ""
+
+            },
+            labelCol: {
+                xs: {
+                    span: 24,
+                },
+                sm: {
+                    span: 5,
+                },
+            },
+            wrapperCol: {
+                xs: {
+                    span: 24,
+                },
+                sm: {
+                    span: 16,
+                },
+            },
+            confirmLoading: false,
+            validatorRules: {
+                depositoryList: [{
+                    required: true,
+                    message: "请选择入库仓库!",
+                }, ],
+                supplierList: [{
+                    required: true,
+                    message: "请选择供应商!",
+                }, ],
+                storageTypeList: [{
+                    required: true,
+                    message: "请选择入库类型!",
+                }, ],
+            },
+            // 表头
+            columns: [{
+                    title: "商品名称",
+                    align: "center",
+                    dataIndex: "name",
+                },
+                {
+                    title: "单位",
+                    align: "center",
+                    dataIndex: "goodUnit",
+                },
+                {
+                    title: "商品规格",
+                    align: "center",
+                    dataIndex: "spec",
+                },
+                {
+                    title: "成本价",
+                    align: "center",
+                    // dataIndex: "costPrice",
+                    scopedSlots: {
+                        customRender: "price"
+                    },
+                },
+                {
+                    title: "出入库数量",
+                    align: "center",
+                    // dataIndex: "spec",
+                    scopedSlots: {
+                        customRender: "num"
+                    },
+                },
+                {
+                    title: '操作',
+                    dataIndex: 'action',
+                    key: 'action',
+                    scopedSlots: {
+                        customRender: "action"
+                    },
+                    align: 'center',
+                    fixed: "right",
+                    width: 200,
+                }
+            ],
+            url: {
+                list: 2,
+                add: "/kc/kcStock/add",
+                edit: "/kc/kcStock/edit",
+                queryById: "/kc/kcDepository/queryById",
+            },
+            depositoryList: [],
+            supplierList: [],
+            storageTypeList: [],
+            dataSource: []
+        };
+    },
+    computed: {
+        formDisabled() {
+            return this.disabled;
+        },
+    },
+    created() {
+        var _info = JSON.parse(localStorage.getItem("storeInfo"));
+        if (_info) {
+            this.model.hotelId = _info.id;
+        }
+        //备份model原始值
+        this.modelDefault = JSON.parse(JSON.stringify(this.model));
+        getAction("/kc/kcDepository/list", {
+            state: 1,
+        }).then((res) => {
+            if (res.success) {
+                this.depositoryList = res.result.records;
+            }
+        });
+        getAction("/kc/kcSupplier/list", {
+            state: 1,
+        }).then((res) => {
+            if (res.success) {
+                this.supplierList = res.result.records;
+            }
+        });
+        getAction("/kc/kcStock/storageTypeList", {}).then((res) => {
+            if (res.success) {
+                this.storageTypeList = res.result;
+            }
+        });
+    },
+    methods: {
+        handleGoods(row) {
+            this.$refs.modalSelectGoodsForm.add();
+            this.$refs.modalSelectGoodsForm.title = "供货商品";
+            this.$refs.modalSelectGoodsForm.disableSubmit = false;
+            this.$refs.modalSelectGoodsForm.supplierId = this.model.supplierId;
+        },
+        /**
+         * 删除商品
+         */
+        deleteGoods(id) {
+            this.dataSource = this.dataSource.filter(item => item.id !== id)
+        },
+        selectOk(e) {
+            console.log(e);
+            this.dataSource = JSON.parse(JSON.stringify(e))
+            console.log(this.dataSource);
+        },
+        add() {
+            this.edit(this.modelDefault,1);
+        },
+        edit(record, type) {
+          if (type) {
+            return
+          }
+            this.model = Object.assign({}, record);
+            console.log(this.model);
+            getAction(`/kc/kcStockDetail/list?stockId=${this.model.code}`).then(res=>{
+              console.log(res);
+              if ( res.code==200 ) {
+                this.dataSource = res.result.records
+                this.dataSource.forEach(ele=>{
+                  ele.costPrice = ele.price
+                })
+              }
+            })
+            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";
+                    }
+                    this.model.stockDetailList = this.dataSource
+                    this.model.stockDetailList.forEach(element => {
+                        element.supplierInGoodsId = element.supplierInGoodsId;
+                        element.price = element.costPrice;
+                        element.num = Number(element.num);
+                    });
+                    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>

+ 141 - 298
src/views/stock/modules/DepositoryForm.vue

@@ -1,315 +1,158 @@
 <template>
 <template>
-<a-spin :spinning="confirmLoading">
+  <a-spin :spinning="confirmLoading">
     <j-form-container :disabled="formDisabled">
     <j-form-container :disabled="formDisabled">
-        <a-form-model ref="form" :model="model" layout="horizontal" :rules="validatorRules" slot="detail">
-            <a-row :gutter="2" align="top" type="flex">
-                <a-col :span="5" flex>
-                    <a-form-item label="" prop="depositoryList">
-                        <a-select v-model="model.depositoryId" style="width: 100%" placeholder="入仓仓库" :allowClear="true">
-                            <a-select-option v-for="(item, index) in depositoryList" :key="index" :value="item.id">{{ item.name }}</a-select-option>
-                        </a-select>
-                    </a-form-item>
-                </a-col>
-                <a-col :span="5">
-                    <a-form-item label="" prop="supplierList">
-                        <a-select v-model="model.supplierId" style="width: 100%" placeholder="供应商" :allowClear="true">
-                            <a-select-option v-for="(item, index) in supplierList" :key="index" :value="item.id">{{ item.name }}</a-select-option>
-                        </a-select>
-                    </a-form-item>
-                </a-col>
-                <a-col :span="5">
-                    <a-form-item label="" prop="storageTypeList">
-                        <a-select v-model="model.stockType" style="width: 100%" placeholder="入库类型" :allowClear="true">
-                            <a-select-option v-for="(item, index) in storageTypeList" :key="index" :value="item.value">{{ item.title }}</a-select-option>
-                        </a-select>
-                    </a-form-item>
-                </a-col>
-                <a-col :span="6" style="margin-top:5px;">
-                    <a-button :disabled="!model.supplierId" @click="handleGoods" type="primary" icon="plus">批量添加</a-button>
-                </a-col>
-            </a-row>
-        </a-form-model>
+      <a-form-model
+        ref="form"
+        :model="model"
+        :rules="validatorRules"
+        slot="detail"
+      >
+        <a-row>
+          <a-col :span="24">
+            <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-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="仓库地址"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="address"
+            >
+              <a-input v-model="model.address" placeholder="请输入仓库地址"></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="备注"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="remark"
+            >
+              <a-textarea
+                v-model="model.remark"
+                rows="4"
+                placeholder="请输入备注"
+              />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item
+              label="状态"
+              :labelCol="labelCol"
+              :wrapperCol="wrapperCol"
+              prop="state"
+            >
+              <a-radio-group v-model="model.state">
+                <a-radio :value="1"> 启用 </a-radio>
+                <a-radio :value="0"> 停用 </a-radio>
+              </a-radio-group>
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
     </j-form-container>
     </j-form-container>
-
-    <!-- 查询区域-END -->
-    <div>
-        <a-table :scroll="{ y: 540 }" ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource" :pagination="false" :loading="loading" class="j-table-force-nowrap" @change="handleTableChange">
-            <span slot="state" slot-scope="record">
-                {{ record ? "启用" : "停用" }}
-                <!-- {{record}} -->
-            </span>
-            <template slot="price" slot-scope="record">
-                <a-input-number :min="0" :placeholder="record.costPrice" v-model="record.costPrice"></a-input-number>
-            </template>
-            <template slot="num" slot-scope="record">
-                <a-input-number :min="0" v-model="record.num"></a-input-number>
-            </template>
-            <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="() => deleteGoods(record.id)">
-                    <a>删除</a>
-                </a-popconfirm>
-            </span>
-        </a-table>
-    </div>
-
-    <a-row>
-        <a-col :span="12">
-            <a-form-item label="备注" label-col="labelCol">
-                <a-textarea v-model="model.remarks" :rows="4" />
-            </a-form-item>
-        </a-col>
-    </a-row>
-
-    <supplier-in-goods-modal ref="modalSelectGoodsForm" @ok="selectOk"></supplier-in-goods-modal>
-</a-spin>
+  </a-spin>
 </template>
 </template>
 
 
 <script>
 <script>
-import {
-    httpAction,
-    getAction
-} from "@/api/manage";
-import {
-    validateDuplicateValue
-} from "@/utils/util";
-import {
-    JeecgListMixin
-} from "@/mixins/JeecgListMixin";
-import SupplierInGoodsModal from "./DepositorySelectGoods/selectGoodsModal.vue";
+import { httpAction, getAction } from "@/api/manage";
+import { validateDuplicateValue } from "@/utils/util";
+
 export default {
 export default {
-    name: "PosTypeForm",
-    mixins: [JeecgListMixin],
-    components: {
-        SupplierInGoodsModal,
+  name: "PosTypeForm",
+  components: {},
+  props: {
+    //表单禁用
+    disabled: {
+      type: Boolean,
+      default: false,
+      required: false,
     },
     },
-    props: {
-        //表单禁用
-        disabled: {
-            type: Boolean,
-            default: false,
-            required: false,
-        },
+  },
+  data() {
+    return {
+      model: { state: 1, online: 0 },
+      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: "请输入关联酒店!" }],
+        name: [{ required: true, message: "请输入名称!" }],
+        state: [{ required: true, message: "请输入状态!" }],
+        online: [{ required: true, message: "请输入线上预定!" }],
+      },
+      url: {
+        add: "/kc/kcDepository/add",
+        edit: "/kc/kcDepository/edit",
+        queryById: "/kc/kcDepository/queryById",
+      },
+    };
+  },
+  computed: {
+    formDisabled() {
+      return this.disabled;
     },
     },
-    data() {
-        return {
-            model: {
-                code: "",
-                createAt: "",
-                createTime: "",
-                // depositoryId: "",
-                hotelId: "",
-                id: "",
-                remarks: "",
-                status: 0,
-                num: 0,
-                // stockInfo: "",
-                // stockType: 0,
-                // supplierId: "",
-                tenantId: "",
-                type: 2,
-                verifyAt: "",
-                verifyRemarks: "",
-                verifyTime: ""
-
-            },
-            labelCol: {
-                xs: {
-                    span: 24,
-                },
-                sm: {
-                    span: 5,
-                },
-            },
-            wrapperCol: {
-                xs: {
-                    span: 24,
-                },
-                sm: {
-                    span: 16,
-                },
-            },
-            confirmLoading: false,
-            validatorRules: {
-                depositoryList: [{
-                    required: true,
-                    message: "请选择入库仓库!",
-                }, ],
-                supplierList: [{
-                    required: true,
-                    message: "请选择供应商!",
-                }, ],
-                storageTypeList: [{
-                    required: true,
-                    message: "请选择入库类型!",
-                }, ],
-            },
-            // 表头
-            columns: [{
-                    title: "商品名称",
-                    align: "center",
-                    dataIndex: "name",
-                },
-                {
-                    title: "单位",
-                    align: "center",
-                    dataIndex: "goodUnit",
-                },
-                {
-                    title: "商品规格",
-                    align: "center",
-                    dataIndex: "spec",
-                },
-                {
-                    title: "成本价",
-                    align: "center",
-                    // dataIndex: "costPrice",
-                    scopedSlots: {
-                        customRender: "price"
-                    },
-                },
-                {
-                    title: "出入库数量",
-                    align: "center",
-                    // dataIndex: "spec",
-                    scopedSlots: {
-                        customRender: "num"
-                    },
-                },
-                {
-                    title: '操作',
-                    dataIndex: 'action',
-                    key: 'action',
-                    scopedSlots: {
-                        customRender: "action"
-                    },
-                    align: 'center',
-                    fixed: "right",
-                    width: 200,
-                }
-            ],
-            url: {
-                list: 2,
-                add: "/kc/kcStock/add",
-                edit: "/kc/kcStock/edit",
-                queryById: "/kc/kcDepository/queryById",
-            },
-            depositoryList: [],
-            supplierList: [],
-            storageTypeList: [],
-            dataSource: []
-        };
+  },
+  created() {
+    var _info = JSON.parse(localStorage.getItem("storeInfo"));
+    if (_info) {
+      this.model.hotelId = _info.id;
+    }
+    //备份model原始值
+    this.modelDefault = JSON.parse(JSON.stringify(this.model));
+  },
+  methods: {
+    add() {
+      this.edit(this.modelDefault);
     },
     },
-    computed: {
-        formDisabled() {
-            return this.disabled;
-        },
+    edit(record) {
+      this.model = Object.assign({}, record);
+      this.visible = true;
     },
     },
-    created() {
-        var _info = JSON.parse(localStorage.getItem("storeInfo"));
-        if (_info) {
-            this.model.hotelId = _info.id;
-        }
-        //备份model原始值
-        this.modelDefault = JSON.parse(JSON.stringify(this.model));
-        getAction("/kc/kcDepository/list", {
-            state: 1,
-        }).then((res) => {
-            if (res.success) {
-                this.depositoryList = res.result.records;
-            }
-        });
-        getAction("/kc/kcSupplier/list", {
-            state: 1,
-        }).then((res) => {
-            if (res.success) {
-                this.supplierList = res.result.records;
-            }
-        });
-        getAction("/kc/kcStock/storageTypeList", {}).then((res) => {
-            if (res.success) {
-                this.storageTypeList = res.result;
-            }
-        });
-    },
-    methods: {
-        handleGoods(row) {
-            this.$refs.modalSelectGoodsForm.add();
-            this.$refs.modalSelectGoodsForm.title = "供货商品";
-            this.$refs.modalSelectGoodsForm.disableSubmit = false;
-            this.$refs.modalSelectGoodsForm.supplierId = this.model.supplierId;
-        },
-        /**
-         * 删除商品
-         */
-        deleteGoods(id) {
-            this.dataSource = this.dataSource.filter(item => item.id !== id)
-        },
-        selectOk(e) {
-            console.log(e);
-            this.dataSource = JSON.parse(JSON.stringify(e))
-            console.log(this.dataSource);
-        },
-        add() {
-            this.edit(this.modelDefault,1);
-        },
-        edit(record, type) {
-          if (type) {
-            return
+    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";
           }
           }
-            this.model = Object.assign({}, record);
-            console.log(this.model);
-            getAction(`/kc/kcStockDetail/list?stockId=${this.model.code}`).then(res=>{
-              console.log(res);
-              if ( res.code==200 ) {
-                this.dataSource = res.result.records
-                this.dataSource.forEach(ele=>{
-                  ele.costPrice = ele.price
-                })
+          httpAction(httpurl, this.model, method)
+            .then((res) => {
+              if (res.success) {
+                that.$message.success(res.message);
+                that.$emit("ok");
+              } else {
+                that.$message.warning(res.message);
               }
               }
             })
             })
-            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";
-                    }
-                    this.model.stockDetailList = this.dataSource
-                    this.model.stockDetailList.forEach(element => {
-                        element.supplierInGoodsId = element.supplierInGoodsId;
-                        element.price = element.costPrice;
-                        element.num = Number(element.num);
-                    });
-                    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;
-                        });
-                }
+            .finally(() => {
+              that.confirmLoading = false;
             });
             });
-        },
+        }
+      });
     },
     },
+  },
 };
 };
-</script>
+</script>

+ 61 - 0
src/views/stock/modules/DepositoryModal copy.vue

@@ -0,0 +1,61 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :destroyOnClose="true"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <pos-type-form v-if="visible" ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></pos-type-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import PosTypeForm from './DepositoryForm'
+  export default {
+    name: 'PosTypeModal',
+    components: {
+      PosTypeForm
+    },
+    data () {
+      return {
+        title:'',
+        width:1200,
+        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>

+ 2 - 3
src/views/stock/modules/DepositoryModal.vue

@@ -5,11 +5,10 @@
     :visible="visible"
     :visible="visible"
     switchFullscreen
     switchFullscreen
     @ok="handleOk"
     @ok="handleOk"
-    :destroyOnClose="true"
     :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
     :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
     @cancel="handleCancel"
     @cancel="handleCancel"
     cancelText="关闭">
     cancelText="关闭">
-    <pos-type-form v-if="visible" ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></pos-type-form>
+    <pos-type-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></pos-type-form>
   </j-modal>
   </j-modal>
 </template>
 </template>
 
 
@@ -24,7 +23,7 @@
     data () {
     data () {
       return {
       return {
         title:'',
         title:'',
-        width:1200,
+        width:800,
         visible: false,
         visible: false,
         disableSubmit: false
         disableSubmit: false
       }
       }