| | |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | <a-col |
| | | :md="6" |
| | | :md="5" |
| | | :sm="8" |
| | | > |
| | | <a-form-item label="库房名称"> |
| | | <a-form-item label="仓库名称"> |
| | | <a-input |
| | | placeholder="请输入库房名称" |
| | | placeholder="请输入仓库名称" |
| | | v-model="queryParam.warehouseName" |
| | | ></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col |
| | | :md="6" |
| | | :md="7" |
| | | :sm="8" |
| | | > |
| | | <a-form-item label="零件编号"> |
| | | <a-input |
| | | placeholder="请输入零件编号查询" |
| | | v-model="queryParam.partNum" |
| | | ></a-input> |
| | | <a-form-item label="开始时间"> |
| | | <a-date-picker |
| | | show-time |
| | | placeholder="请选择开始时间" |
| | | format="YYYY-MM-DD HH:mm" |
| | | valueFormat="YYYY-MM-DD HH:mm" |
| | | v-model="queryParam.beginTime" |
| | | ></a-date-picker> |
| | | <!-- :triggerChange="false" --> |
| | | </a-form-item> |
| | | </a-col> |
| | | <a-col |
| | | :md="7" |
| | | :sm="8" |
| | | > |
| | | <a-form-item label="结束时间"> |
| | | <a-date-picker |
| | | show-time |
| | | placeholder="请选择结束时间" |
| | | format="YYYY-MM-DD HH:mm" |
| | | valueFormat="YYYY-MM-DD HH:mm" |
| | | v-model="queryParam.endTime" |
| | | ></a-date-picker> |
| | | <!-- :triggerChange="false" --> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | |
| | | <a-col :md="4" :sm="4"> |
| | | <a-space> |
| | |
| | | |
| | | <!-- 操作按钮区域 --> |
| | | <div class="table-operator"> |
| | | <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> |
| | | <a-button @click="handleAdd" :disabled="addFlag" 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> |
| | | <!-- <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> |
| | | <!-- <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" |
| | |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
| | | :rowSelection="null" |
| | | 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="status" slot-scope="text, record"> |
| | | <span v-if="text === '1'" class='enable'>启用</span> |
| | | <span v-if="text === '2'" class='disable'>停用</span> |
| | | </span> |
| | | |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a @click="handleEdit(record)">编辑</a> |
| | | <a @click="handleDetail(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 @click="handleEdit(record)">编辑</a> |
| | | </a-menu-item> |
| | | <a-menu-item v-if="record.status === '1'"> |
| | | <a-popconfirm title="确定停用吗?" @confirm="() => handleStatus(record)"> |
| | | <a>停用</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | <a-menu-item v-if="record.status === '2'"> |
| | | <a-popconfirm title="确定启用吗?" @confirm="() => handleStatus(record)"> |
| | | <a>启用</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | <a-menu-item> |
| | | <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> |
| | |
| | | </a-table> |
| | | </div> |
| | | |
| | | <warehouse-modal ref="modalForm" @ok="modalFormOk"></warehouse-modal> |
| | | <warehouse-modal ref="modalForm" :treeSelected="treeSelected" @ok="modalFormOk"></warehouse-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | |
| | | import { mixinDevice } from '@/utils/mixin' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import WarehouseModal from './modules/WarehouseModal' |
| | | import { getAction, putAction, deleteAction } from '../../api/manage' |
| | | import moment from 'moment' |
| | | |
| | | export default { |
| | | name: 'WarehouseList', |
| | |
| | | WarehouseModal |
| | | }, |
| | | data () { |
| | | const now = moment() |
| | | const lastWeek = now.clone().subtract(7,'days') |
| | | return { |
| | | description: '仓库管理', |
| | | queryParam: { |
| | | beginTime: lastWeek.format('YYYY-MM-DD HH:mm'), |
| | | endTime: now.format('YYYY-MM-DD HH:mm'), |
| | | warehouseName: '', |
| | | parentId: '' |
| | | }, |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | |
| | | { |
| | | title:'父节点编号', |
| | | align:"center", |
| | | dataIndex: 'parentId' |
| | | dataIndex: 'parentWarehouseId' |
| | | }, |
| | | { |
| | | title:'父节点名称', |
| | | align:"center", |
| | | dataIndex: 'parentName' |
| | | dataIndex: 'parentWarehouseName' |
| | | }, |
| | | { |
| | | title:'状态', |
| | | align:"center", |
| | | dataIndex: 'status_dictText' |
| | | dataIndex: 'status', |
| | | scopedSlots: { customRender: 'status' } |
| | | }, |
| | | { |
| | | title:'备注', |
| | |
| | | { |
| | | title:'创建人', |
| | | align:"center", |
| | | dataIndex: 'createdBy' |
| | | dataIndex: 'createBy' |
| | | }, |
| | | { |
| | | title:'创建时间', |
| | | align:"center", |
| | | dataIndex: 'createdTime', |
| | | dataIndex: 'createTime', |
| | | customRender:function (text) { |
| | | return !text?"":(text.length>10?text.substr(0,10):text) |
| | | } |
| | |
| | | url: { |
| | | list: "/tms/warehouse/list", |
| | | delete: "/tms/warehouse/delete", |
| | | edit: "/tms/warehouse/edit", |
| | | deleteBatch: "/tms/warehouse/deleteBatch", |
| | | exportXlsUrl: "/tms/warehouse/exportXls", |
| | | importExcelUrl: "tms/warehouse/importExcel", |
| | |
| | | }, |
| | | dictOptions:{}, |
| | | superFieldList:[], |
| | | treeSelected: {}, |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | importExcelUrl: function(){ |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
| | | }, |
| | | addFlag: function(){ |
| | | return !(this.treeSelected.key && this.treeSelected.entity.leafFlag === '2'); |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.$bus.$on('getCurrSelected', (data) => { |
| | | console.log(data) |
| | | this.treeSelected = data; |
| | | this.queryParam.parentId = data.key; |
| | | this.loadData(); |
| | | }); |
| | | }, |
| | | beforeDestroy() { |
| | | this.$bus.$off('getCurrSelected', {}); |
| | | }, |
| | | methods: { |
| | | handleStatus(record) { |
| | | const params = { |
| | | id: record.id, |
| | | status: record.status === '1' ? '2' : '1' |
| | | } |
| | | putAction(this.url.edit, params).then((res) => { |
| | | if (res.success) { |
| | | this.$message.success(res.message) |
| | | this.loadData() |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }) |
| | | }, |
| | | handleDelete(id) { |
| | | getAction(this.url.list, { parentId: id }).then((res) => { |
| | | if (res.success) { |
| | | if (res.result.total > 0) { |
| | | this.$message.warning('请先删除子节点'); |
| | | } else { |
| | | deleteAction(this.url.delete, {id: id}).then((res) => { |
| | | if (res.success) { |
| | | //重新计算分页问题 |
| | | this.loadData() |
| | | this.$message.success(res.message); |
| | | this.$bus.$emit('queryTreeData') |
| | | } else { |
| | | this.$message.warning(res.message); |
| | | } |
| | | }); |
| | | } |
| | | } else { |
| | | this.$message.warning(res.message); |
| | | } |
| | | }) |
| | | }, |
| | | // onBeginTimeChange(date, dateString) { |
| | | // this.queryParam.begin_time = dateString[0] |
| | | // }, |
| | | // onEndTimeChange(date, dateString) { |
| | | // this.queryParam.end_time = dateString[0] |
| | | // }, |
| | | searchReset() { |
| | | const now = moment() |
| | | const lastWeek = now.clone().subtract(7,'days') |
| | | this.queryParam = { |
| | | beginTime: lastWeek.format('YYYY-MM-DD HH:mm'), |
| | | endTime: now.format('YYYY-MM-DD HH:mm'), |
| | | warehouseName: '', |
| | | parentId: '' |
| | | } |
| | | this.treeSelected = {} |
| | | this.loadData(1) |
| | | this.$bus.$emit('clearTreeSelection') |
| | | }, |
| | | modalFormOk() { |
| | | this.loadData() |
| | | this.$bus.$emit('queryTreeData') |
| | | }, |
| | | initDictConfig(){ |
| | | }, |
| | | getSuperFieldList(){ |
| | |
| | | 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:'创建时间'}) |
| | | fieldList.push({type:'string',value:'createBy',text:'创建人',dictCode:''}) |
| | | fieldList.push({type:'date',value:'createTime',text:'创建时间'}) |
| | | this.superFieldList = fieldList |
| | | } |
| | | } |
| | |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | .enable { |
| | | color: green; |
| | | } |
| | | .disable { |
| | | color: red; |
| | | } |
| | | </style> |