¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <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> |