From 16346fcb4f474834f685140de005a98d8a9bf5f9 Mon Sep 17 00:00:00 2001 From: cuilei <ray_tsu1@163.com> Date: 星期三, 07 五月 2025 09:29:00 +0800 Subject: [PATCH] 工具管理-仓库管理基础代码生成 --- src/views/tms/WarehouseList.vue | 247 ++++++++++++++++ src/views/tms/modules/WarehouseModal.vue | 60 ++++ src/views/tms/modules/WarehouseForm.vue | 152 ++++++++++ src/views/tms/WarehouseTree.vue | 397 ++++++++++++++++++++++++++ src/views/tms/Warehouse.vue | 36 ++ 5 files changed, 892 insertions(+), 0 deletions(-) diff --git a/src/views/tms/Warehouse.vue b/src/views/tms/Warehouse.vue new file mode 100644 index 0000000..8ad416d --- /dev/null +++ b/src/views/tms/Warehouse.vue @@ -0,0 +1,36 @@ +<template> + <a-card :bordered="false"> + <a-row type="flex" :gutter="16"> + <a-col :md="5"> + <WarehouseTree/> + </a-col> + <a-col :md="19"> + <WarehouseList/> + </a-col> + </a-row> + + </a-card> +</template> + +<script> + import WarehouseList from './WarehouseList.vue' + import WarehouseTree from './WarehouseTree.vue' + + export default { + name: 'Warehouse', + components: { + WarehouseList, + WarehouseTree + }, + data() { + return {} + }, + methods: {} + } +</script> + +<style scoped lang="less"> + /deep/ .ant-card-body { + padding: 8px; + } +</style> \ No newline at end of file diff --git a/src/views/tms/WarehouseList.vue b/src/views/tms/WarehouseList.vue new file mode 100644 index 0000000..d99540f --- /dev/null +++ b/src/views/tms/WarehouseList.vue @@ -0,0 +1,247 @@ +<template> + <a-card :bordered="false"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + <a-col + :md="6" + :sm="8" + > + <a-form-item label="搴撴埧鍚嶇О"> + <a-input + placeholder="璇疯緭鍏ュ簱鎴垮悕绉�" + v-model="queryParam.warehouseName" + ></a-input> + </a-form-item> + </a-col> + <a-col + :md="6" + :sm="8" + > + <a-form-item label="闆朵欢缂栧彿"> + <a-input + placeholder="璇疯緭鍏ラ浂浠剁紪鍙锋煡璇�" + v-model="queryParam.partNum" + ></a-input> + <!-- :triggerChange="false" --> + </a-form-item> + </a-col> + + <a-col :md="4" :sm="4"> + <a-space> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + <a-button type="primary" @click="searchReset" icon="reload">閲嶇疆</a-button> + </a-space> + </a-col> + </a-row> + </a-form> + </div> + <!-- 鏌ヨ鍖哄煙-END --> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> +<!-- <a-button type="primary" icon="download" @click="handleExportXls('tms_warehouse')">瀵煎嚭</a-button>--> +<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">--> +<!-- <a-button type="primary" icon="import">瀵煎叆</a-button>--> +<!-- </a-upload>--> + <!-- 楂樼骇鏌ヨ鍖哄煙 --> +<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>--> + <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-menu slot="overlay"> + <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>鍒犻櫎</a-menu-item> + </a-menu> + <a-button style="margin-left: 8px"> 鎵归噺鎿嶄綔 <a-icon type="down" /></a-button> + </a-dropdown> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + :scroll="{x:true}" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + class="j-table-force-nowrap" + @change="handleTableChange"> + + <template slot="htmlSlot" slot-scope="text"> + <div v-html="text"></div> + </template> + <template slot="imgSlot" slot-scope="text,record"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> + <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> + </template> + <template slot="fileSlot" slot-scope="text"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> + <a-button + v-else + :ghost="true" + type="primary" + icon="download" + size="small" + @click="downloadFile(text)"> + 涓嬭浇 + </a-button> + </template> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handleDetail(record)">璇︽儏</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + + <warehouse-modal ref="modalForm" @ok="modalFormOk"></warehouse-modal> + </a-card> +</template> + +<script> + + import '@/assets/less/TableExpand.less' + import { mixinDevice } from '@/utils/mixin' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import WarehouseModal from './modules/WarehouseModal' + + export default { + name: 'WarehouseList', + mixins:[JeecgListMixin, mixinDevice], + components: { + WarehouseModal + }, + data () { + return { + description: '浠撳簱绠$悊', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'浠撳簱缂栧彿', + align:"center", + dataIndex: 'warehouseId' + }, + { + title:'浠撳簱鍚嶇О', + align:"center", + dataIndex: 'warehouseName' + }, + { + title:'鐖惰妭鐐圭紪鍙�', + align:"center", + dataIndex: 'parentId' + }, + { + title:'鐖惰妭鐐瑰悕绉�', + align:"center", + dataIndex: 'parentName' + }, + { + title:'鐘舵��', + align:"center", + dataIndex: 'status_dictText' + }, + { + title:'澶囨敞', + align:"center", + dataIndex: 'remark' + }, + { + title:'鍒涘缓浜�', + align:"center", + dataIndex: 'createdBy' + }, + { + title:'鍒涘缓鏃堕棿', + align:"center", + dataIndex: 'createdTime', + customRender:function (text) { + return !text?"":(text.length>10?text.substr(0,10):text) + } + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align:"center", + fixed:"right", + width:147, + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: "/tms/warehouse/list", + delete: "/tms/warehouse/delete", + deleteBatch: "/tms/warehouse/deleteBatch", + exportXlsUrl: "/tms/warehouse/exportXls", + importExcelUrl: "tms/warehouse/importExcel", + + }, + dictOptions:{}, + superFieldList:[], + } + }, + created() { + this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + }, + methods: { + initDictConfig(){ + }, + getSuperFieldList(){ + let fieldList=[]; + fieldList.push({type:'string',value:'warehouseId',text:'浠撳簱缂栧彿',dictCode:''}) + fieldList.push({type:'string',value:'warehouseName',text:'浠撳簱鍚嶇О',dictCode:''}) + fieldList.push({type:'string',value:'parentId',text:'鐖惰妭鐐圭紪鍙�',dictCode:''}) + fieldList.push({type:'string',value:'seq',text:'灞曠ず搴忓彿',dictCode:''}) + fieldList.push({type:'string',value:'leafFlag',text:'鏄惁鍙跺瓙鑺傜偣(1鏄�;2鍚�)',dictCode:''}) + fieldList.push({type:'string',value:'status',text:'鐘舵�侊紙1鍚敤;2鍋滅敤锛�',dictCode:''}) + fieldList.push({type:'string',value:'remark',text:'澶囨敞',dictCode:''}) + fieldList.push({type:'string',value:'createdBy',text:'鍒涘缓浜�',dictCode:''}) + fieldList.push({type:'date',value:'createdTime',text:'鍒涘缓鏃堕棿'}) + this.superFieldList = fieldList + } + } + } +</script> +<style scoped> + @import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/tms/WarehouseTree.vue b/src/views/tms/WarehouseTree.vue new file mode 100644 index 0000000..d17e14d --- /dev/null +++ b/src/views/tms/WarehouseTree.vue @@ -0,0 +1,397 @@ +<template> + <a-card + :loading="cardLoading" + :bordered="false" + title="浠撳簱绠$悊" + style="height: 100%;" + > + <a-spin :spinning="loading"> + <a-alert + type="info" + :showIcon="true" + style="margin-right: 54px;" + > + <div slot="message"> + 褰撳墠锛�<span v-if="this.currSelected.title">{{ getCurrSelectedTitle() }}</span> + <a + v-if="this.currSelected.title" + style="margin-left: 10px" + @click="onClearSelected" + >鍙栨秷</a> + </div> + </a-alert> + <div class="drawer-bootom-button"> + <a-dropdown + :trigger="['click']" + placement="bottomCenter" + > + <a-menu slot="overlay"> + <a-menu-item + key="1" + @click="expandAll" + >灞曞紑鎵�鏈�</a-menu-item> + <a-menu-item + key="2" + @click="closeAll" + >鍚堝苟鎵�鏈�</a-menu-item> + <a-menu-item + key="3" + @click="refreshTree" + >鍒锋柊</a-menu-item> + </a-menu> + <a-button> + <a-icon type="bars" /> + </a-button> + </a-dropdown> + </div> + + <a-input-search + @search="handleSearch" + style="width:100%;margin-top: 10px" + placeholder="妫�绱粨搴�" + allowClear + v-model="searchInput" + @change="handleChange" + /> + + <!-- showLine --> + <a-tree + :checkStrictly="checkStrictly" + :expandedKeys.sync="expandedKeys" + :selectedKeys="selectedKeys" + :dropdownStyle="{maxHeight:'200px',overflow:'auto'}" + :treeData="treeDataSource" + :autoExpandParent="autoExpandParent" + @select="onSelect" + @expand="onExpand" + > + <template + slot="title" + slot-scope="{title, type, rfield1}" + > + <Tooltip + placement="top" + title="浼佷笟" + > + <i + v-if="type == 0" + class="action-jeecg actioncompany2" + style="font-size: 18px;" + /> + </Tooltip> + <Tooltip + placement="top" + title="宸ュ巶" + > + <i + v-if="type == 1" + class="action-jeecg actionsite2" + style="font-size: 18px;" + /> + </Tooltip> + <Tooltip + placement="top" + title="浠撳簱" + > + <i + v-if="type == 2" + class="action-jeecg actionwarehouse" + style="font-size: 13px;" + /> + </Tooltip> + <Tooltip + placement="top" + title="鍖哄煙" + > + <i + v-if="type == 3" + class="action-jeecg actionstoragearea" + style="font-size: 14px;" + /> + </Tooltip> + <Tooltip + placement="top" + title="璐ф灦" + > + <i + v-if="type == 4" + class="action-jeecg actionshelf" + style="font-size: 13px;" + /> + </Tooltip> + <!-- <Tooltip + placement="top" + title="搴撲綅" + > + <i + v-if="type == 5" + class="action-jeecg actionstoragelocation" + style="font-size: 14px;" + /> + </Tooltip> --> + <span v-if="title.indexOf(searchValue) > -1"> + {{ title.substr(0, title.indexOf(searchValue)) }} + <span class="replaceSearch">{{ searchValue }}</span> + {{ title.substr(title.indexOf(searchValue) + searchValue.length) }} + </span> + <span v-else>{{ title }}</span> + <span + v-if="type == 4" + :style="{position: 'absolute',right: 0}" + > + <Tooltip + placement="top" + title="璐ф灦搴撲綅鏁伴噺" + > + {{rfield1}} + </Tooltip> + </span> + </template> + </a-tree> + </a-spin> + </a-card> +</template> + +<script> +import { getAction } from '@/api/manage' +import Tooltip from 'ant-design-vue/es/tooltip' +export default { + name: 'WarehouseTree', + components: { + Tooltip, + }, + props: ['value'], + data() { + return { + searchInput: '', + cardLoading: false, + loading: false, + treeDataSource: [], + selectedKeys: [], + expandedKeys: [], + url: { + factoryTreeList: '/base/warehouse/loadTree', + getAllSiteList: '/base/site/getAllList', + }, + searchValue: '', + dataList: [], + autoExpandParent: true, + checkStrictly: true, + allTreeKeys: [], + currSelected: {}, + hiding: false, + allSiteIds: ['-1'], + } + }, + created() { + this.getAllSiteId(); + this.queryTreeData(); + this.closeAll(); + }, + methods: { + getAllSiteId() { + getAction(this.url.getAllSiteList).then((res) => { + if (res.success) { + let allSiteList = res.result; + for (let i = 0; i < allSiteList.length; i++) { + const site = allSiteList[i]; + this.allSiteIds.push(site.id); + } + } else { + this.$message.warn(res.message); + } + }) + }, + getCurrSelectedTitle() { + return !this.currSelected.title ? '' : this.currSelected.title; + }, + onClearSelected() { + this.hiding = true; + this.currSelected = {}; + this.selectedKeys = []; + }, + onSelect(selectedKeys, e) { + this.hiding = false; + let record = e.node.dataRef; + this.currSelected = Object.assign({}, record); + this.selectedKeys = [record.key]; + }, + onExpand(expandedKeys) { + this.expandedKeys = expandedKeys; + this.autoExpandParent = false; + }, + queryTreeData() { + this.loading = true; + this.cardLoading = true; + getAction(this.url.factoryTreeList).then((res) => { + if (res.success) { + this.dataList = []; + this.allTreeKeys = []; + this.treeDataSource = res.result; + this.generateList(res.result); + } else { + this.$message.warn(res.message); + } + }).finally(() => { + this.loading = false; + this.cardLoading = false; + }) + }, + + handleChange() { + let search = this.searchInput; + let expandedKeys = this.dataList + .map(item => { + if (item.title.indexOf(search) > -1) { + return this.getParentKey(item.key, this.treeDataSource); + } + return null; + }) + .filter((item, i, self) => item && self.indexOf(item) === i); + Object.assign(this, { + expandedKeys, + searchValue: search, + autoExpandParent: true, + }); + }, + handleSearch(value) { + let search = value; + let expandedKeys = this.dataList + .map(item => { + if (item.title.indexOf(search) > -1) { + return this.getParentKey(item.key, this.treeDataSource); + } + return null; + }) + .filter((item, i, self) => item && self.indexOf(item) === i); + Object.assign(this, { + expandedKeys, + searchValue: search, + autoExpandParent: true, + }); + }, + getParentKey(key, tree) { + let parentKey; + for (let i = 0; i < tree.length; i++) { + const node = tree[i]; + if (node.children) { + if (node.children.some(item => item.key === key)) { + parentKey = node.key; + } else if ( + this.getParentKey(key, node.children)) { + parentKey = this.getParentKey(key, node.children); + } + } + } + return parentKey; + }, + + generateList(data) { + for (let i = 0; i < data.length; i++) { + const node = data[i]; + const key = node.key; + const title = node.title; + this.dataList.push({ key, title: title }); + this.allTreeKeys.push(key); + if (node.children) { + this.generateList(node.children); + } + } + }, + expandAll() { + this.expandedKeys = this.allTreeKeys; + }, + closeAll() { + this.expandedKeys = this.allSiteIds; + }, + refreshTree() { + this.queryTreeData(); + } + }, + mounted() { + this.$bus.$on('queryTreeData', this.queryTreeData); + }, + //鐩戝惉 + watch: { + currSelected(val) {//鐩戝惉currSelected 鍙樺寲锛屽皢鍙樺寲鍚庣殑鏁板�间紶閫掔粰 getCurrSelected 浜嬩欢 + this.$bus.$emit('getCurrSelected', val) + }, + } +} +</script> + +<style scoped> +.replaceSearch { + color: #40a9ff; + font-weight: bold; + background-color: rgb(204, 204, 204); +} +/*闅愯棌鏍戠殑榛樿icon*/ +.ant-tree-switcher-noop { + display: none !important; +} +/*闅愯棌鏍戠殑榛樿绔栫嚎*/ +.ant-tree.ant-tree-show-line li:not(:last-child):before { + border-left: 0px; +} + +.ant-card-body .table-operator { + margin: 15px; +} + +.anty-form-btn { + width: 100%; + text-align: center; +} + +.anty-form-btn button { + margin: 0 5px; +} + +.anty-node-layout .ant-layout-header { + padding-right: 0; +} + +.header { + padding: 0 8px; +} + +.header button { + margin: 0 3px; +} + +.ant-modal-cust-warp { + height: 100%; +} + +.ant-modal-cust-warp .ant-modal-body { + height: calc(100% - 110px) !important; + overflow-y: auto; +} + +.ant-modal-cust-warp .ant-modal-content { + height: 90% !important; + overflow-y: hidden; +} + +#app .desktop { + height: auto !important; +} + +/** Button鎸夐挳闂磋窛 */ +.ant-btn { + margin-left: 3px; +} +.ant-alert { + padding: 5px 15px 5px 37px; +} +.drawer-bootom-button { + position: absolute; + top: 1px; + /* padding: 10px 16px; */ + text-align: left; + right: 0; + background: #fff; + border-radius: 0 0 2px 2px; +} +</style> \ No newline at end of file diff --git a/src/views/tms/modules/WarehouseForm.vue b/src/views/tms/modules/WarehouseForm.vue new file mode 100644 index 0000000..2ff4a66 --- /dev/null +++ b/src/views/tms/modules/WarehouseForm.vue @@ -0,0 +1,152 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail"> + <a-row> + <a-col :span="12"> + <a-form-model-item label="鐖惰妭鐐圭紪鍙�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="parentId"> + <a-input v-model="model.parentId" placeholder="璇疯緭鍏ョ埗鑺傜偣缂栧彿" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="鐖惰妭鐐瑰悕绉�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="parentName"> + <a-input v-model="model.parentName" placeholder="璇疯緭鍏ョ埗鑺傜偣鍚嶇О" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="浠撳簱缂栧彿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="warehouseId"> + <a-input v-model="model.warehouseId" placeholder="璇疯緭鍏ヤ粨搴撶紪鍙�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="浠撳簱鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="warehouseName"> + <a-input v-model="model.warehouseName" placeholder="璇疯緭鍏ヤ粨搴撳悕绉�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="鍙跺瓙鑺傜偣鏍囪瘑" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="leafFlag"> + <a-radio-group v-model="model.leafFlag" @change="onChange" placeholder="璇烽�夋嫨鏄惁鍙跺瓙鑺傜偣"> + <a-radio :value="2">鏈夊瓙鑺傜偣</a-radio> + <a-radio :value="1">鏄彾瀛愯妭鐐�</a-radio> + </a-radio-group> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <a-form-model-item label="灞曠ず搴忓彿" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="seq"> + <a-input type="number" v-model="model.seq" placeholder="璇疯緭鍏ュ睍绀哄簭鍙�" ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="12"> + <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-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: 'WarehouseForm', + components: { + }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data () { + return { + model:{ + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + validatorRules: { + warehouseId: [ + { required: true, message: '璇疯緭鍏ヤ粨搴撶紪鍙�!'}, + ], + warehouseName: [ + { required: true, message: '璇疯緭鍏ヤ粨搴撳悕绉�!'}, + ], + parentId: [ + { required: true, message: '璇疯緭鍏ョ埗鑺傜偣缂栧彿!'}, + ], + leafFlag: [ + { required: true, message: '璇疯緭鍏ユ槸鍚﹀彾瀛愯妭鐐�!'}, + ], + seq: [ + { min: 0, message: '灞曠ず搴忓彿涓嶈兘灏忎簬0!'}, + ], + }, + url: { + add: "/tms/warehouse/add", + edit: "/tms/warehouse/edit", + queryById: "/tms/warehouse/queryById" + } + } + }, + computed: { + formDisabled(){ + return this.disabled + }, + }, + created () { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add () { + this.edit(this.modelDefault); + }, + edit (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; + }) + } + + }) + }, + } + } +</script> \ No newline at end of file diff --git a/src/views/tms/modules/WarehouseModal.vue b/src/views/tms/modules/WarehouseModal.vue new file mode 100644 index 0000000..e046771 --- /dev/null +++ b/src/views/tms/modules/WarehouseModal.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="鍏抽棴"> + <warehouse-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></warehouse-form> + </j-modal> +</template> + +<script> + + import WarehouseForm from './WarehouseForm' + export default { + name: 'WarehouseModal', + components: { + WarehouseForm + }, + data () { + return { + title:'', + width:896, + 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> \ No newline at end of file -- Gitblit v1.9.3