diff --git a/ant-design-vue-jeecg/public/index.html b/ant-design-vue-jeecg/public/index.html index 1d73771..2ad3d10 100644 --- a/ant-design-vue-jeecg/public/index.html +++ b/ant-design-vue-jeecg/public/index.html @@ -6,7 +6,7 @@ <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width,initial-scale=1.0"> <title>华恒仓储管理系统</title> - <link rel="icon" href="<%= BASE_URL %>logo.png"> + <link rel="icon" href="<%= BASE_URL %>logo.ico"> <script src="<%= BASE_URL %>cdn/babel-polyfill/polyfill_7_2_5.js"></script> <style> html, diff --git a/ant-design-vue-jeecg/public/logo.ico b/ant-design-vue-jeecg/public/logo.ico new file mode 100644 index 0000000..9762592 --- /dev/null +++ b/ant-design-vue-jeecg/public/logo.ico diff --git a/ant-design-vue-jeecg/public/logo.png b/ant-design-vue-jeecg/public/logo2.png index 1c356e3..1c356e3 100644 --- a/ant-design-vue-jeecg/public/logo.png +++ b/ant-design-vue-jeecg/public/logo2.png diff --git a/ant-design-vue-jeecg/src/assets/logo.ico b/ant-design-vue-jeecg/src/assets/logo.ico new file mode 100644 index 0000000..9762592 --- /dev/null +++ b/ant-design-vue-jeecg/src/assets/logo.ico diff --git a/ant-design-vue-jeecg/src/views/system/DictList.vue b/ant-design-vue-jeecg/src/views/system/DictList.vue index 6ab1d88..be6bd3c 100644 --- a/ant-design-vue-jeecg/src/views/system/DictList.vue +++ b/ant-design-vue-jeecg/src/views/system/DictList.vue @@ -47,14 +47,13 @@ @change="handleTableChange"> <span slot="action" slot-scope="text, record"> <a @click="handleEdit(record)" v-has="'dict:edit'"> - <a-icon type="edit"/> - 编辑 + <a-button icon="edit" type="default">编辑</a-button> </a> <a-divider type="vertical"/> - <a v-has="'dict:config'" @click="editDictItem(record)"><a-icon type="setting"/> 字典配置</a> + <a v-has="'dict:config'" @click="editDictItem(record)"><a-button type="primary" icon="setting">字典配置</a-button> </a> <a-divider type="vertical"/> <a-popconfirm title="确定删除吗?" @confirm="() =>handleDelete(record.id)"> - <a v-has="'dict:delete'">删除</a> + <a v-has="'dict:delete'"><a-button type="danger">删除</a-button></a> </a-popconfirm> </span> </a-table> diff --git a/ant-design-vue-jeecg/src/views/system/config/ContainerList.vue b/ant-design-vue-jeecg/src/views/system/config/ContainerList.vue index 613e5b6..0523dfc 100644 --- a/ant-design-vue-jeecg/src/views/system/config/ContainerList.vue +++ b/ant-design-vue-jeecg/src/views/system/config/ContainerList.vue @@ -309,7 +309,7 @@ export default { '空盘': 'lightgray', '有货': 'purple', '满盘': 'red', - default: 'default' + default: 'blue' }; return colors[status] || colors.default; }, diff --git a/ant-design-vue-jeecg/src/views/system/config/LocationList.vue b/ant-design-vue-jeecg/src/views/system/config/LocationList.vue index b86b89b..ce5deb7 100644 --- a/ant-design-vue-jeecg/src/views/system/config/LocationList.vue +++ b/ant-design-vue-jeecg/src/views/system/config/LocationList.vue @@ -405,7 +405,7 @@ export default { '高库位': 'red', '低库位': 'green', - default: 'default' + default: 'blue' }; return colors[status] || colors.default; }, diff --git a/ant-design-vue-jeecg/src/views/system/config/ParameterConfigurationList.vue b/ant-design-vue-jeecg/src/views/system/config/ParameterConfigurationList.vue index 96e294e..c3fe1af 100644 --- a/ant-design-vue-jeecg/src/views/system/config/ParameterConfigurationList.vue +++ b/ant-design-vue-jeecg/src/views/system/config/ParameterConfigurationList.vue @@ -38,9 +38,9 @@ <!-- 操作按钮区域 --> <div class="table-operator"> - <a-button @click="handleAdd" v-has="'ParameterConfiguration:add'" type="primary" icon="plus">新增</a-button> - <a-button v-has="'ParameterConfiguration:export'" type="primary" icon="download" @click="handleExportXls('参数配置')">导出</a-button> - <a-upload v-has="'ParameterConfiguration:import'" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" + <a-button @click="handleAdd" v-has="'parameterConfiguration:add'" type="primary" icon="plus">新增</a-button> + <a-button v-has="'parameterConfiguration:export'" type="primary" icon="download" @click="handleExportXls('参数配置')">导出</a-button> + <a-upload v-has="'parameterConfiguration:import'" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> <a-button type="primary" icon="import">导入</a-button> </a-upload> diff --git a/ant-design-vue-jeecg/src/views/system/config/PortList.vue b/ant-design-vue-jeecg/src/views/system/config/PortList.vue index eb77aff..d416de4 100644 --- a/ant-design-vue-jeecg/src/views/system/config/PortList.vue +++ b/ant-design-vue-jeecg/src/views/system/config/PortList.vue @@ -249,7 +249,7 @@ export default { '入库口': 'green', '出库口': 'purple', '出入口': 'red', - default: 'default' + default: 'blue' }; return colors[status] || colors.default; }, diff --git a/ant-design-vue-jeecg/src/views/system/inventory/InventoryDetailList.vue b/ant-design-vue-jeecg/src/views/system/inventory/InventoryDetailList.vue index e26d09b..2328140 100644 --- a/ant-design-vue-jeecg/src/views/system/inventory/InventoryDetailList.vue +++ b/ant-design-vue-jeecg/src/views/system/inventory/InventoryDetailList.vue @@ -4,7 +4,8 @@ <div class="table-operator" v-if="mainId"> <a-button v-has="'inventoryDetail:add'" @click="handleAdd" type="primary" icon="plus">新增</a-button> <a-button v-has="'inventoryDetail:export'" type="primary" icon="download" @click="handleExportXls('库存详情')" - >导出</a-button + >导出 + </a-button > <a-upload v-has="'inventoryDetail:import'" @@ -20,13 +21,13 @@ <a-dropdown v-if="selectedRowKeys.length > 0"> <a-menu slot="overlay" v-has="'inventoryDetail:deleteBatch'"> <a-menu-item key="1" @click="batchDel"> - <a-icon type="delete" /> + <a-icon type="delete"/> 删除 </a-menu-item> </a-menu> <a-button style="margin-left: 8px"> 批量操作 - <a-icon type="down" /> + <a-icon type="down"/> </a-button> </a-dropdown> </div> @@ -52,6 +53,12 @@ :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" @change="handleTableChange" > + <span slot="inventoryStatus_dictText" slot-scope="inventoryStatus_dictText"> + <a-tag :key="inventoryStatus_dictText" :color="getStatusColor(inventoryStatus_dictText)"> + {{ inventoryStatus_dictText }} + </a-tag> + </span> + <span slot="companyCode" slot-scope="companyCode"> <a-tag :key="companyCode" color="blue"> {{ solutionCompany(companyCode) }} @@ -92,14 +99,14 @@ </template> <script> -import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import {JeecgListMixin} from '@/mixins/JeecgListMixin' import InventoryDetailModal from './modules/InventoryDetailModal' -import { getCompanyList } from '@/api/api' +import {getCompanyList, getZoneList} from '@/api/api' export default { name: 'InventoryDetailList', mixins: [JeecgListMixin], - components: { InventoryDetailModal }, + components: {InventoryDetailModal}, props: { mainId: { type: String, @@ -137,7 +144,7 @@ export default { align: 'center', dataIndex: 'companyCode', key: 'companyCode', - scopedSlots: { customRender: 'companyCode' } + scopedSlots: {customRender: 'companyCode'} }, // { // title: '库区', @@ -195,7 +202,8 @@ export default { { title: '库存状态', align: 'center', - dataIndex: 'inventoryStatus_dictText' + dataIndex: 'inventoryStatus_dictText', + scopedSlots: {customRender: 'inventoryStatus_dictText'} }, { title: '批次', @@ -243,7 +251,7 @@ export default { align: 'center', fixed: 'right', width: 147, - scopedSlots: { customRender: 'action' } + scopedSlots: {customRender: 'action'} } ], url: { @@ -267,13 +275,38 @@ export default { } }, methods: { + getStatusColor(status) { + const colors = { + '良品': 'green', + '报废品': 'purple', + '待确认 ': 'grey', + '次品': 'red', + default: 'blue' + }; + return colors[status] || colors.default; + }, loadFrom() { + // getZoneList().then((res) => { + // if (res.success) { + // this.zoneList = res.result + // } + // }); getCompanyList().then(res => { if (res.success) { this.companyList = res.result } }) }, + // solutionZoneCode(value) { + // var actions = [] + // Object.keys(this.zoneList).some((key) => { + // if (this.zoneList[key].code == ('' + value)) { + // actions.push(this.zoneList[key].name) + // return true + // } + // }) + // return actions.join('') + // }, solutionCompany(value) { var actions = [] Object.keys(this.companyList).some(key => { diff --git a/ant-design-vue-jeecg/src/views/system/inventory/InventoryHeaderList.vue b/ant-design-vue-jeecg/src/views/system/inventory/InventoryHeaderList.vue index 27b4a83..d78fd83 100644 --- a/ant-design-vue-jeecg/src/views/system/inventory/InventoryHeaderList.vue +++ b/ant-design-vue-jeecg/src/views/system/inventory/InventoryHeaderList.vue @@ -92,6 +92,12 @@ :customRow="clickThenSelect" @change="handleTableChange"> + <span slot="containerStatus_dictText" slot-scope="containerStatus_dictText"> + <a-tag :key="containerStatus_dictText" :color="getStatusColor(containerStatus_dictText)"> + {{ containerStatus_dictText }} + </a-tag> + </span> + <span slot="zoneCode" slot-scope="zoneCode"> <a-tag :key="zoneCode" color=blue> {{ solutionZoneCode(zoneCode) }} @@ -190,6 +196,7 @@ export default { title: '容器状态', align: "center", dataIndex: 'containerStatus_dictText', + scopedSlots: {customRender: 'containerStatus_dictText'} }, { title: '库位号', @@ -271,6 +278,18 @@ export default { } }, methods: { + getStatusColor(status) { + const colors = { + '空闲': 'green', + '锁定': 'red', + // '空盘': 'lightgray', + '有货': 'purple', + '满盘': 'blue', + default: 'blue' + }; + return colors[status] || colors.default; + }, + solutionZoneCode(value) { var actions = [] Object.keys(this.zoneList).some((key) => { diff --git a/ant-design-vue-jeecg/src/views/system/inventory/InventoryTransactionList.vue b/ant-design-vue-jeecg/src/views/system/inventory/InventoryTransactionList.vue index 4ff77ea..d3d855c 100644 --- a/ant-design-vue-jeecg/src/views/system/inventory/InventoryTransactionList.vue +++ b/ant-design-vue-jeecg/src/views/system/inventory/InventoryTransactionList.vue @@ -57,7 +57,8 @@ </a-col> <a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-form-item label="库存状态"> - <j-dict-select-tag placeholder="请选择库存状态" v-model="queryParam.inventoryStatus" dictCode="inventory_status"/> + <j-dict-select-tag placeholder="请选择库存状态" v-model="queryParam.inventoryStatus" + dictCode="inventory_status"/> </a-form-item> </a-col> <a-col :xl="6" :lg="7" :md="8" :sm="24"> @@ -98,8 +99,11 @@ <!-- 操作按钮区域 --> <div class="table-operator"> <a-button @click="handleAdd" v-has="'inventoryTransaction:add'" type="primary" icon="plus">新增</a-button> - <a-button v-has="'inventoryTransaction:export'" type="primary" icon="download" @click="handleExportXls('库存交易记录')">导出</a-button> - <a-upload v-has="'inventoryTransaction:import'" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" + <a-button v-has="'inventoryTransaction:export'" type="primary" icon="download" + @click="handleExportXls('库存交易记录')">导出 + </a-button> + <a-upload v-has="'inventoryTransaction:import'" name="file" :showUploadList="false" :multiple="false" + :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> <a-button type="primary" icon="import">导入</a-button> </a-upload> @@ -138,6 +142,12 @@ class="j-table-force-nowrap" @change="handleTableChange"> + <span slot="inventoryStatus_dictText" slot-scope="inventoryStatus_dictText"> + <a-tag :key="inventoryStatus_dictText" :color="getStatusColor(inventoryStatus_dictText)"> + {{ inventoryStatus_dictText }} + </a-tag> + </span> + <span slot="companyCode" slot-scope="companyCode"> <a-tag :key="companyCode" color=blue> {{ solutionCompany(companyCode) }} @@ -265,7 +275,8 @@ export default { { title: '库存状态', align: "center", - dataIndex: 'inventoryStatus_dictText' + dataIndex: 'inventoryStatus_dictText', + scopedSlots: {customRender: 'inventoryStatus_dictText'} }, { title: '数量', @@ -273,6 +284,11 @@ export default { dataIndex: 'qty' }, { + title: '库存数量', + align: "center", + dataIndex: 'inventoryQty' + }, + { title: '批次', align: "center", dataIndex: 'batch' @@ -328,6 +344,16 @@ export default { }, }, methods: { + getStatusColor(status) { + const colors = { + '良品': 'green', + '报废品': 'purple', + '待确认 ': 'grey', + '次品': 'red', + default: 'blue' + }; + return colors[status] || colors.default; + }, initDictConfig() { }, loadFrom() { diff --git a/ant-design-vue-jeecg/src/views/system/inventory/SimpleInventoryDetailList.vue b/ant-design-vue-jeecg/src/views/system/inventory/SimpleInventoryDetailList.vue index 6b5894b..2b06ed1 100644 --- a/ant-design-vue-jeecg/src/views/system/inventory/SimpleInventoryDetailList.vue +++ b/ant-design-vue-jeecg/src/views/system/inventory/SimpleInventoryDetailList.vue @@ -86,7 +86,7 @@ <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> <a @click="handleToggleSearch" style="margin-left: 8px"> {{ toggleSearchStatus ? '收起' : '展开' }} - <a-icon :type="toggleSearchStatus ? 'up' : 'down'" /> + <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/> </a> </span> </a-col> @@ -99,7 +99,8 @@ <div class="table-operator"> <a-button v-has="'inventoryDetail:add'" @click="handleAdd" type="primary" icon="plus">新增</a-button> <a-button v-has="'inventoryDetail:export'" type="primary" icon="download" @click="handleExportXls('库存详情')" - >导出</a-button + >导出 + </a-button > <a-upload v-has="'inventoryDetail:import'" @@ -148,6 +149,24 @@ class="j-table-force-nowrap" @change="handleTableChange" > + <span slot="inventoryStatus_dictText" slot-scope="inventoryStatus_dictText"> + <a-tag :key="inventoryStatus_dictText" :color="getStatusColor(inventoryStatus_dictText)"> + {{ inventoryStatus_dictText }} + </a-tag> + </span> + + <span slot="companyCode" slot-scope="companyCode"> + <a-tag :key="companyCode" color="blue"> + {{ solutionCompany(companyCode) }} + </a-tag> + </span> + + <span slot="zoneCode" slot-scope="zoneCode"> + <a-tag :key="zoneCode" color=blue> + {{ solutionZoneCode(zoneCode) }} + </a-tag> + </span> + <template slot="htmlSlot" slot-scope="text"> <div v-html="text"></div> </template> @@ -182,10 +201,11 @@ <script> import '@/assets/less/TableExpand.less' -import { mixinDevice } from '@/utils/mixin' -import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import {mixinDevice} from '@/utils/mixin' +import {JeecgListMixin} from '@/mixins/JeecgListMixin' import SimpleInventoryDetailModal from './modules/SimpleInventoryDetailModal' -import { filterMultiDictText } from '@/components/dict/JDictSelectUtil' +import {filterMultiDictText} from '@/components/dict/JDictSelectUtil' +import {getCompanyList, getZoneList} from "@api/api"; export default { name: 'InventoryDetailList', @@ -195,6 +215,8 @@ export default { }, data() { return { + zoneList: [], + companyList: [], description: '库存详情管理页面', // 表头 columns: [ @@ -204,19 +226,23 @@ export default { key: 'rowIndex', width: 60, align: 'center', - customRender: function(t, r, index) { + customRender: function (t, r, index) { return parseInt(index) + 1 } }, { title: '货主', align: 'center', - dataIndex: 'companyCode' + dataIndex: 'companyCode', + key: 'companyCode', + scopedSlots: {customRender: 'companyCode'} }, { title: '库区', - align: 'center', - dataIndex: 'zoneCode' + align: "center", + dataIndex: 'zoneCode', + key: 'zoneCode', + scopedSlots: {customRender: 'zoneCode'} }, { title: '容器编码', @@ -269,7 +295,8 @@ export default { { title: '库存状态', align: 'center', - dataIndex: 'inventoryStatus_dictText' + dataIndex: 'inventoryStatus_dictText', + scopedSlots: {customRender: 'inventoryStatus_dictText'} }, { title: '批次', @@ -317,7 +344,7 @@ export default { align: 'center', fixed: 'right', width: 147, - scopedSlots: { customRender: 'action' } + scopedSlots: {customRender: 'action'} } ], url: { @@ -332,36 +359,81 @@ export default { } }, created() { + this.loadFrom() this.getSuperFieldList() }, computed: { - importExcelUrl: function() { + importExcelUrl: function () { return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` } }, methods: { - initDictConfig() {}, + getStatusColor(status) { + const colors = { + '良品': 'green', + '报废品': 'purple', + '待确认 ': 'grey', + '次品': 'red', + default: 'blue' + }; + return colors[status] || colors.default; + }, + loadFrom() { + getZoneList().then((res) => { + if (res.success) { + this.zoneList = res.result + } + }); + getCompanyList().then(res => { + if (res.success) { + this.companyList = res.result + } + }) + }, + + solutionCompany(value) { + var actions = [] + Object.keys(this.companyList).some(key => { + if (this.companyList[key].code == '' + value) { + actions.push(this.companyList[key].name) + return true + } + }) + return actions.join('') + }, + solutionZoneCode(value) { + var actions = [] + Object.keys(this.zoneList).some((key) => { + if (this.zoneList[key].code == ('' + value)) { + actions.push(this.zoneList[key].name) + return true + } + }) + return actions.join('') + }, + initDictConfig() { + }, getSuperFieldList() { let fieldList = [] - fieldList.push({ type: 'string', value: 'companyCode', text: '货主', dictCode: '' }) - fieldList.push({ type: 'string', value: 'zoneCode', text: '库区', dictCode: '' }) - fieldList.push({ type: 'string', value: 'containerCode', text: '容器编码', dictCode: '' }) - fieldList.push({ type: 'string', value: 'locationCode', text: '库位编码', dictCode: '' }) - fieldList.push({ type: 'string', value: 'materialCode', text: '物料编码', dictCode: '' }) - fieldList.push({ type: 'string', value: 'materialName', text: '物料名称', dictCode: '' }) - fieldList.push({ type: 'string', value: 'materialSpec', text: '物料规格', dictCode: '' }) - fieldList.push({ type: 'string', value: 'materialUnit', text: '物料单位', dictCode: '' }) - fieldList.push({ type: 'BigDecimal', value: 'qty', text: '数量', dictCode: '' }) - fieldList.push({ type: 'BigDecimal', value: 'taskQty', text: '任务锁定数量', dictCode: '' }) - fieldList.push({ type: 'string', value: 'inventoryStatus', text: '库存状态', dictCode: 'inventory_status' }) - fieldList.push({ type: 'string', value: 'batch', text: '批次', dictCode: '' }) + fieldList.push({type: 'string', value: 'companyCode', text: '货主', dictCode: ''}) + fieldList.push({type: 'string', value: 'zoneCode', text: '库区', dictCode: ''}) + fieldList.push({type: 'string', value: 'containerCode', text: '容器编码', dictCode: ''}) + fieldList.push({type: 'string', value: 'locationCode', text: '库位编码', dictCode: ''}) + fieldList.push({type: 'string', value: 'materialCode', text: '物料编码', dictCode: ''}) + fieldList.push({type: 'string', value: 'materialName', text: '物料名称', dictCode: ''}) + fieldList.push({type: 'string', value: 'materialSpec', text: '物料规格', dictCode: ''}) + fieldList.push({type: 'string', value: 'materialUnit', text: '物料单位', dictCode: ''}) + fieldList.push({type: 'BigDecimal', value: 'qty', text: '数量', dictCode: ''}) + fieldList.push({type: 'BigDecimal', value: 'taskQty', text: '任务锁定数量', dictCode: ''}) + fieldList.push({type: 'string', value: 'inventoryStatus', text: '库存状态', dictCode: 'inventory_status'}) + fieldList.push({type: 'string', value: 'batch', text: '批次', dictCode: ''}) // fieldList.push({type:'string',value:'uniqueCode',text:'唯一号',dictCode:''}) - fieldList.push({ type: 'datetime', value: 'receiptDate', text: '入库日期' }) - fieldList.push({ type: 'int', value: 'inventoryAge', text: '库龄(天)', dictCode: '' }) - fieldList.push({ type: 'string', value: 'createBy', text: '创建人', dictCode: '' }) - fieldList.push({ type: 'datetime', value: 'createTime', text: '创建日期' }) - fieldList.push({ type: 'string', value: 'updateBy', text: '更新人', dictCode: '' }) - fieldList.push({ type: 'datetime', value: 'updateTime', text: '更新日期' }) + fieldList.push({type: 'datetime', value: 'receiptDate', text: '入库日期'}) + fieldList.push({type: 'int', value: 'inventoryAge', text: '库龄(天)', dictCode: ''}) + fieldList.push({type: 'string', value: 'createBy', text: '创建人', dictCode: ''}) + fieldList.push({type: 'datetime', value: 'createTime', text: '创建日期'}) + fieldList.push({type: 'string', value: 'updateBy', text: '更新人', dictCode: ''}) + fieldList.push({type: 'datetime', value: 'updateTime', text: '更新日期'}) this.superFieldList = fieldList } } diff --git a/ant-design-vue-jeecg/src/views/system/inventory/subTables/InventoryDetailSubTable.vue b/ant-design-vue-jeecg/src/views/system/inventory/subTables/InventoryDetailSubTable.vue index 90b2b2d..f4fbb51 100644 --- a/ant-design-vue-jeecg/src/views/system/inventory/subTables/InventoryDetailSubTable.vue +++ b/ant-design-vue-jeecg/src/views/system/inventory/subTables/InventoryDetailSubTable.vue @@ -47,6 +47,12 @@ :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" @change="handleTableChange"> + <span slot="inventoryStatus_dictText" slot-scope="inventoryStatus_dictText"> + <a-tag :key="inventoryStatus_dictText" :color="getStatusColor(inventoryStatus_dictText)"> + {{ inventoryStatus_dictText }} + </a-tag> + </span> + <span slot="companyCode" slot-scope="companyCode"> <a-tag :key="companyCode" color=blue> {{ solutionCompany(companyCode) }} @@ -181,6 +187,7 @@ export default { title: '库存状态', align: "center", dataIndex: 'inventoryStatus_dictText', + scopedSlots: {customRender: 'inventoryStatus_dictText'} }, { title: '批次', @@ -249,6 +256,16 @@ export default { } }, methods: { + getStatusColor(status) { + const colors = { + '良品': 'green', + '报废品': 'purple', + '待确认 ': 'grey', + '次品': 'red', + default: 'blue' + }; + return colors[status] || colors.default; + }, loadFrom() { getCompanyList().then((res) => { if (res.success) { diff --git a/ant-design-vue-jeecg/src/views/system/receipt/ReceiptContainerHeaderList.vue b/ant-design-vue-jeecg/src/views/system/receipt/ReceiptContainerHeaderList.vue index c5e19b7..93142cf 100644 --- a/ant-design-vue-jeecg/src/views/system/receipt/ReceiptContainerHeaderList.vue +++ b/ant-design-vue-jeecg/src/views/system/receipt/ReceiptContainerHeaderList.vue @@ -112,14 +112,14 @@ </a-button> </template> <span slot="action" slot-scope="text, record"> - <a v-if="record.status == 0 && record.taskType == 200" @click="selectFillPort(record)" v-has="'receiptContainerHeader:fill'">生成任务<a-divider type="vertical"/></a> - <a v-else-if="record.status == 0" @click="selectContainerStatus(record)" v-has="'receiptContainerHeader:fill'">生成任务<a-divider type="vertical"/></a> + <a v-if="record.status == 0 && record.taskType == 200" @click="selectFillPort(record)" v-has="'receiptContainerHeader:fill'"><a-button type="primary">生成任务</a-button> <a-divider type="vertical"/></a> + <a v-else-if="record.status == 0" @click="selectContainerStatus(record)" v-has="'receiptContainerHeader:fill'"><a-button type="primary">生成任务</a-button> <a-divider type="vertical"/></a> <!-- <a v-if="record.status == 0 && record.taskType == 200" @click="selectPort(record)" v-has="'receiptContainerHeader:createTask'">生成任务<a-divider type="vertical"/></a>--> <!-- <a v-else-if="record.status == 0" @click="createTask(record)" v-has="'receiptContainerHeader:createTask'">生成任务<a-divider type="vertical"/></a>--> <a-popconfirm v-if="record.status == 0" v-has="'receiptContainerHeader:delete'" title="确定取消配盘吗?" @confirm="() => handleDelete(record.id)"> - <a>取消配盘<a-divider type="vertical"/></a> + <a><a-button type="danger">取消配盘</a-button> <a-divider type="vertical"/></a> </a-popconfirm> - <a v-has="'receiptContainerHeader:edit'" @click="handleEdit(record)">编辑</a> + <a v-has="'receiptContainerHeader:edit'" @click="handleEdit(record)"><a-button type="default">编辑</a-button></a> </span> </a-table> </div> @@ -274,9 +274,9 @@ export default { getStatusColor(status) { const colors = { '新建': 'green', - '生成任务': 'purple', + '生成任务': 'blue', '上架完成': 'gray', - default: 'default' + default: 'blue' }; return colors[status] || colors.default; }, diff --git a/ant-design-vue-jeecg/src/views/system/receipt/ReceiptDetailList.vue b/ant-design-vue-jeecg/src/views/system/receipt/ReceiptDetailList.vue index 61d637f..ed5e251 100644 --- a/ant-design-vue-jeecg/src/views/system/receipt/ReceiptDetailList.vue +++ b/ant-design-vue-jeecg/src/views/system/receipt/ReceiptDetailList.vue @@ -49,6 +49,12 @@ :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" @change="handleTableChange"> + <span slot="inventoryStatus_dictText" slot-scope="inventoryStatus_dictText"> + <a-tag :key="inventoryStatus_dictText" :color="getStatusColor(inventoryStatus_dictText)"> + {{ inventoryStatus_dictText }} + </a-tag> + </span> + <template slot="htmlSlot" slot-scope="text"> <div v-html="text"></div> </template> @@ -161,6 +167,7 @@ export default { title: '库存状态', align: "center", dataIndex: 'inventoryStatus_dictText', + scopedSlots: {customRender: 'inventoryStatus_dictText'} }, { title: '批次', @@ -222,6 +229,16 @@ export default { } }, methods: { + getStatusColor(status) { + const colors = { + '良品': 'green', + '报废品': 'purple', + '待确认 ': 'grey', + '次品': 'red', + default: 'blue' + }; + return colors[status] || colors.default; + }, clearList() { this.dataSource = [] this.selectedRowKeys = [] diff --git a/ant-design-vue-jeecg/src/views/system/receipt/ReceiptHeaderHistoryList.vue b/ant-design-vue-jeecg/src/views/system/receipt/ReceiptHeaderHistoryList.vue index ddfa10a..5a19f25 100644 --- a/ant-design-vue-jeecg/src/views/system/receipt/ReceiptHeaderHistoryList.vue +++ b/ant-design-vue-jeecg/src/views/system/receipt/ReceiptHeaderHistoryList.vue @@ -344,13 +344,13 @@ export default { getStatusColor(status) { const colors = { '新建': 'green', - '收货': 'yellow', + '收货': 'Skyblue', '等待上架': 'blue', - '上架': 'orange', + '上架': 'darkorange', '过账': 'purple', '回传': 'grey', '回传失败': 'red', - default: 'default' + default: 'blue' }; return colors[status] || colors.default; }, diff --git a/ant-design-vue-jeecg/src/views/system/receipt/ReceiptHeaderList.vue b/ant-design-vue-jeecg/src/views/system/receipt/ReceiptHeaderList.vue index df56886..49944d3 100644 --- a/ant-design-vue-jeecg/src/views/system/receipt/ReceiptHeaderList.vue +++ b/ant-design-vue-jeecg/src/views/system/receipt/ReceiptHeaderList.vue @@ -177,10 +177,10 @@ <span slot="action" slot-scope="text, record"> <a-popconfirm v-has="'receiptHeader:back'" v-if="record.lastStatus == 800" title="确定回传吗?" @confirm="() => hanleBack(record)"> - <a>回传<a-divider type="vertical"/></a> + <a><a-button type="default">回传</a-button><a-divider type="vertical"/></a> </a-popconfirm> - <a v-if="record.lastStatus < 800" @click="receive(record)" v-has="'receiptHeader:receive'">组盘<a-divider type="vertical"/></a> - <a v-if="record.lastStatus == 850" @click="viewReason(record)">原因<a-divider type="vertical"/></a> + <a v-if="record.lastStatus < 800" @click="receive(record)" v-has="'receiptHeader:receive'"><a-button type="primary">组盘</a-button><a-divider type="vertical"/></a> + <a v-if="record.lastStatus == 850" @click="viewReason(record)"><a-button type="danger">原因</a-button><a-divider type="vertical"/></a> <a-dropdown> <a class="ant-dropdown-link">更多 <a-icon type="down"/></a> <a-menu slot="overlay"> @@ -194,6 +194,7 @@ </a-menu-item> </a-menu> </a-dropdown> + </span> </a-table> @@ -376,13 +377,13 @@ export default { getStatusColor(status) { const colors = { '新建': 'green', - '收货': 'yellow', + '收货': 'Skyblue', '等待上架': 'blue', - '上架': 'orange', + '上架': 'darkorange', '过账': 'purple', '回传': 'grey', '回传失败': 'red', - default: 'default' + default: 'blue' }; return colors[status] || colors.default; }, diff --git a/ant-design-vue-jeecg/src/views/system/shipment/ShipmentContainerHeaderList.vue b/ant-design-vue-jeecg/src/views/system/shipment/ShipmentContainerHeaderList.vue index 0dbf25e..ebe3b1e 100644 --- a/ant-design-vue-jeecg/src/views/system/shipment/ShipmentContainerHeaderList.vue +++ b/ant-design-vue-jeecg/src/views/system/shipment/ShipmentContainerHeaderList.vue @@ -126,11 +126,11 @@ </template> <span slot="action" slot-scope="text, record"> - <a v-if="record.status == 0" @click="selectPort(record)">生成任务</a> + <a v-if="record.status == 0" @click="selectPort(record)"><a-button type="primary">生成任务</a-button> </a> <a-popconfirm v-if="record.status == 0" v-has="'shipmentContainerHeader:delete'" title="确定取消配盘吗?" @confirm="() => handleDelete(record.id)"> - <a><a-divider type="vertical"/>取消配盘</a> + <a><a-divider type="vertical"/><a-button type="danger">取消配盘</a-button> </a> </a-popconfirm> - <a v-has="'receiptContainerHeader:edit'" @click="handleEdit(record)"><a-divider type="vertical"/>编辑</a> + <a v-has="'receiptContainerHeader:edit'" @click="handleEdit(record)"><a-divider type="vertical"/><a-button type="default">编辑</a-button></a> </span> </a-table> </div> @@ -272,9 +272,9 @@ export default { getStatusColor(status) { const colors = { '新建': 'green', - '生成任务': 'purple', + '生成任务': 'blue', '下架完成': 'gray', - default: 'default' + default: 'blue' }; return colors[status] || colors.default; }, diff --git a/ant-design-vue-jeecg/src/views/system/shipment/ShipmentDetailList.vue b/ant-design-vue-jeecg/src/views/system/shipment/ShipmentDetailList.vue index 3ac0df0..237e73d 100644 --- a/ant-design-vue-jeecg/src/views/system/shipment/ShipmentDetailList.vue +++ b/ant-design-vue-jeecg/src/views/system/shipment/ShipmentDetailList.vue @@ -48,6 +48,12 @@ :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" @change="handleTableChange"> + <span slot="inventoryStatus_dictText" slot-scope="inventoryStatus_dictText"> + <a-tag :key="inventoryStatus_dictText" :color="getStatusColor(inventoryStatus_dictText)"> + {{ inventoryStatus_dictText }} + </a-tag> + </span> + <template slot="htmlSlot" slot-scope="text"> <div v-html="text"></div> </template> @@ -70,13 +76,28 @@ </template> <span slot="action" slot-scope="text, record"> - <a @click="combine(record)">配盘</a> - <a-divider type="vertical"/> - <a v-has="'shipmentDetail:edit'" @click="edit(record)">编辑</a> + <a @click="combine(record)"><a-button type="primary">配盘</a-button></a> <a-divider type="vertical"/> - <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> - <a v-has="'shipmentDetail:delete'">删除</a> - </a-popconfirm> + + <a-dropdown> + <a class="ant-dropdown-link">更多 <a-icon type="down"/></a> + <a-menu slot="overlay"> + <a-menu-item v-has="'shipmentDetail:edit'"> + <a @click="handleEdit(record)">编辑</a> + </a-menu-item> + <a-menu-item v-has="'shipmentDetail:delete'"> + <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> + <a>删除</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + +<!-- <a v-has="'shipmentDetail:edit'" @click="edit(record)">编辑</a>--> +<!-- <a-divider type="vertical"/>--> +<!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">--> +<!-- <a v-has="'shipmentDetail:delete'">删除</a>--> +<!-- </a-popconfirm>--> </span> </a-table> @@ -177,6 +198,7 @@ export default { title: '库存状态', align: "center", dataIndex: 'inventoryStatus_dictText', + scopedSlots: {customRender: 'inventoryStatus_dictText'} }, { title: '批次', @@ -238,6 +260,16 @@ export default { } }, methods: { + getStatusColor(status) { + const colors = { + '良品': 'green', + '报废品': 'purple', + '待确认 ': 'grey', + '次品': 'red', + default: 'blue' + }; + return colors[status] || colors.default; + }, clearList() { this.dataSource = [] this.selectedRowKeys = [] diff --git a/ant-design-vue-jeecg/src/views/system/shipment/ShipmentHeaderHistoryList.vue b/ant-design-vue-jeecg/src/views/system/shipment/ShipmentHeaderHistoryList.vue index 2ad3d0d..af307bf 100644 --- a/ant-design-vue-jeecg/src/views/system/shipment/ShipmentHeaderHistoryList.vue +++ b/ant-design-vue-jeecg/src/views/system/shipment/ShipmentHeaderHistoryList.vue @@ -373,13 +373,13 @@ export default { getStatusColor(status) { const colors = { '新建': 'green', - '出库组盘': 'yellow', + '出库组盘': 'Skyblue', '等待下架': 'blue', - '下架': 'orange', + '下架': 'darkorange', '过账': 'purple', '回传': 'grey', '回传失败': 'red', - default: 'default' + default: 'blue' }; return colors[status] || colors.default; }, diff --git a/ant-design-vue-jeecg/src/views/system/shipment/ShipmentHeaderList.vue b/ant-design-vue-jeecg/src/views/system/shipment/ShipmentHeaderList.vue index 22ce36a..34bc57e 100644 --- a/ant-design-vue-jeecg/src/views/system/shipment/ShipmentHeaderList.vue +++ b/ant-design-vue-jeecg/src/views/system/shipment/ShipmentHeaderList.vue @@ -190,9 +190,9 @@ </template> <span slot="action" slot-scope="text, record"> <a-popconfirm v-has="'shipmentHeader:back'" v-if="record.lastStatus == 800" title="确定回传吗?" @confirm="() => hanleBack(record)"> - <a>回传<a-divider type="vertical"/></a> + <a><a-button type="default">回传</a-button><a-divider type="vertical"/></a> </a-popconfirm> - <a v-if="record.lastStatus < 800" @click="autoShipmentCombine(record)" v-has="'shipmentHeader:autoShipmentCombine'">自动配盘<a-divider type="vertical"/></a> + <a v-if="record.lastStatus < 800" @click="autoShipmentCombine(record)" v-has="'shipmentHeader:autoShipmentCombine'"><a-button type="primary">自动配盘</a-button> <a-divider type="vertical"/></a> <a-dropdown> <a class="ant-dropdown-link">更多 <a-icon type="down"/></a> <a-menu slot="overlay"> @@ -384,13 +384,13 @@ export default { getStatusColor(status) { const colors = { '新建': 'green', - '出库组盘': 'yellow', + '出库组盘': 'Skyblue', '等待下架': 'blue', - '下架': 'orange', + '下架': 'darkorange', '过账': 'purple', '回传': 'grey', '回传失败': 'red', - default: 'default' + default: 'blue' }; return colors[status] || colors.default; }, diff --git a/ant-design-vue-jeecg/src/views/system/task/AgvTaskList.vue b/ant-design-vue-jeecg/src/views/system/task/AgvTaskList.vue index 5a8e64d..7012d6a 100644 --- a/ant-design-vue-jeecg/src/views/system/task/AgvTaskList.vue +++ b/ant-design-vue-jeecg/src/views/system/task/AgvTaskList.vue @@ -111,12 +111,14 @@ </template> <span slot="action" slot-scope="text, record"> - <a v-if="record.status == 1" v-has="'agvTask:executeTask'" @click="executeAgvTask(record)">执行<a-divider - type="vertical"/></a> + <a v-if="record.status == 1" v-has="'agvTask:executeTask'" @click="executeAgvTask(record)"> + <a-button type="primary">执行</a-button><a-divider type="vertical"/></a> + <a-popconfirm v-if="record.status < 100" title="确定删除吗?" v-has="'agvTask:delete'" @confirm="() => handleDelete(record.id)"> - <a>删除 <a-divider type="vertical"/></a> + <a><a-button type="danger">取消</a-button> <a-divider type="vertical"/></a> </a-popconfirm> + <a-dropdown> <a class="ant-dropdown-link">更多 <a-icon type="down"/></a> <a-menu slot="overlay"> @@ -261,7 +263,7 @@ export default { '开始执行': 'orange', '取货完成': 'purple', '任务完成': 'grey', - default: 'default' + default: 'blue' }; return colors[status] || colors.default; }, diff --git a/ant-design-vue-jeecg/src/views/system/task/CircleTaskHeaderList.vue b/ant-design-vue-jeecg/src/views/system/task/CircleTaskHeaderList.vue index afbcdcb..1791857 100644 --- a/ant-design-vue-jeecg/src/views/system/task/CircleTaskHeaderList.vue +++ b/ant-design-vue-jeecg/src/views/system/task/CircleTaskHeaderList.vue @@ -148,14 +148,17 @@ </template> <span slot="action" slot-scope="text, record"> - <a v-if="record.status == 1" v-has="'taskHeader:executeTask'" @click="executeTask(record)">执行<a-divider type="vertical"/></a> - <a v-if="record.isEmptyOut == 1 && record.exceptionState == 1" v-has="'taskHeader:handleEmptyOutTask'" @click="handleEmptyOutTask(record)">修复空出数据 + <a v-if="record.status == 1" v-has="'taskHeader:executeTask'" @click="executeTask(record)"><a-button type="primary">执行</a-button> <a-divider type="vertical"/></a> + <a v-if="record.isEmptyOut == 1 && record.exceptionState == 1" v-has="'taskHeader:handleEmptyOutTask'" @click="handleEmptyOutTask(record)"><a-button type="danger">修复空出数据</a-button> <a-divider type="vertical"/></a> - <a v-if="record.isPickupError == 1 && record.exceptionState == 1" v-has="'taskHeader:handlePickupErrorTask'" @click="handlePickupErrorTask(record)">修复取货错数据 + <a v-if="record.isPickupError == 1 && record.exceptionState == 1" v-has="'taskHeader:handlePickupErrorTask'" @click="handlePickupErrorTask(record)"><a-button type="danger">修复取货错数据</a-button> <a-divider type="vertical"/></a> - <a v-if="record.isDoubleIn == 1 && record.exceptionState == 1" v-has="'taskHeader:handleDoubleInTask'" @click="handleDoubleInTask(record)">修复重入数据 + <a v-if="record.isDoubleIn == 1 && record.exceptionState == 1" v-has="'taskHeader:handleDoubleInTask'" @click="handleDoubleInTask(record)"><a-button type="danger">修复重入数据</a-button> <a-divider type="vertical"/></a> - <a v-if="record.status <= 10" v-has="'taskHeader:cancelTask'" @click="cancelTask(record)">取消</a> + + <a-popconfirm v-if="record.status <= 10" v-has="'taskHeader:cancelTask'" title="确定取消任务吗?" @confirm="() => cancelTask(record)"> + <a-button type="danger">取消</a-button> + </a-popconfirm> </span> </a-table> </div> @@ -275,6 +278,26 @@ export default { dataIndex: 'updateTime' }, { + title: '执行时间', + align: "center", + dataIndex: 'executeTime' + }, + { + title: '库位分配时间', + align: "center", + dataIndex: 'allocationTime' + }, + { + title: '到达分拣口时间', + align: "center", + dataIndex: 'arrivalTime' + }, + { + title: '完成时间', + align: "center", + dataIndex: 'completeTime' + }, + { title: '操作', dataIndex: 'action', align: "center", @@ -328,7 +351,7 @@ export default { '下发任务': 'blue', '到达拣选站台': 'orange', '任务完成': 'grey', - default: 'default' + default: 'blue' }; return colors[status] || colors.default; }, diff --git a/ant-design-vue-jeecg/src/views/system/task/ReceiptTaskHeaderList.vue b/ant-design-vue-jeecg/src/views/system/task/ReceiptTaskHeaderList.vue index b159832..e822236 100644 --- a/ant-design-vue-jeecg/src/views/system/task/ReceiptTaskHeaderList.vue +++ b/ant-design-vue-jeecg/src/views/system/task/ReceiptTaskHeaderList.vue @@ -140,16 +140,16 @@ </template> <span slot="action" slot-scope="text, record"> - <a v-if="record.status == 1" v-has="'taskHeader:executeTask'" @click="executeTask(record)">执行<a-divider type="vertical"/></a> - <a v-if="record.isEmptyOut == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleEmptyOutTask(record)">修复空出数据 + <a v-if="record.status == 1" v-has="'taskHeader:executeTask'" @click="executeTask(record)"><a-button type="primary">执行</a-button> <a-divider type="vertical"/></a> + <a v-if="record.isEmptyOut == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleEmptyOutTask(record)"><a-button type="danger">修复空出数据</a-button> <a-divider type="vertical"/></a> - <a v-if="record.isPickupError == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handlePickupErrorTask(record)">修复取货错数据 + <a v-if="record.isPickupError == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handlePickupErrorTask(record)"><a-button type="danger">修复取货错数据</a-button> <a-divider type="vertical"/></a> - <a v-if="record.isDoubleIn == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleDoubleInTask(record)">修复重入数据 + <a v-if="record.isDoubleIn == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleDoubleInTask(record)"><a-button type="danger">修复重入数据</a-button> <a-divider type="vertical"/></a> -<!-- <a v-if="record.status <= 10" v-has="'taskHeader:cancelTask'" @click="cancelTask(record)" >取消</a>--> + <!-- <a v-if="record.status <= 10" v-has="'taskHeader:cancelTask'" @click="cancelTask(record)" >取消</a>--> <a-popconfirm v-if="record.status <= 10" v-has="'taskHeader:cancelTask'" title="确定取消任务吗?" @confirm="() => cancelTask(record)"> - <a>取消</a> + <a-button type="danger">取消</a-button> </a-popconfirm> </span> @@ -273,6 +273,26 @@ export default { dataIndex: 'updateTime' }, { + title: '执行时间', + align: "center", + dataIndex: 'executeTime' + }, + { + title: '库位分配时间', + align: "center", + dataIndex: 'allocationTime' + }, + { + title: '到达分拣口时间', + align: "center", + dataIndex: 'arrivalTime' + }, + { + title: '完成时间', + align: "center", + dataIndex: 'completeTime' + }, + { title: '操作', dataIndex: 'action', align: "center", @@ -327,7 +347,7 @@ export default { '下发任务': 'blue', '到达拣选站台': 'orange', '任务完成': 'grey', - default: 'default' + default: 'blue' }; return colors[status] || colors.default; }, diff --git a/ant-design-vue-jeecg/src/views/system/task/ShipmentTaskHeaderList.vue b/ant-design-vue-jeecg/src/views/system/task/ShipmentTaskHeaderList.vue index 6dba9c7..58bee51 100644 --- a/ant-design-vue-jeecg/src/views/system/task/ShipmentTaskHeaderList.vue +++ b/ant-design-vue-jeecg/src/views/system/task/ShipmentTaskHeaderList.vue @@ -141,16 +141,16 @@ </template> <span slot="action" slot-scope="text, record"> - <a v-if="record.status == 1" v-has="'taskHeader:executeTask'" @click="executeTask(record)">执行 + <a v-if="record.status == 1" v-has="'taskHeader:executeTask'" @click="executeTask(record)"><a-button type="primary">执行</a-button> <a-divider type="vertical"/></a> - <a v-if="record.isEmptyOut == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleEmptyOutTask(record)">修复空出数据 + <a v-if="record.isEmptyOut == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleEmptyOutTask(record)"><a-button type="danger">修复空出数据</a-button> <a-divider type="vertical"/></a> - <a v-if="record.isPickupError == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handlePickupErrorTask(record)">修复取货错数据 + <a v-if="record.isPickupError == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handlePickupErrorTask(record)"><a-button type="danger">修复取货错数据</a-button> <a-divider type="vertical"/></a> - <a v-if="record.isDoubleIn == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleDoubleInTask(record)">修复重入数据 + <a v-if="record.isDoubleIn == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleDoubleInTask(record)"><a-button type="danger">修复重入数据</a-button> <a-divider type="vertical"/></a> <a-popconfirm v-if="record.status <= 10" v-has="'taskHeader:cancelTask'" title="确定取消任务吗?" @confirm="() => cancelTask(record)"> - <a>取消</a> + <a-button type="danger">取消</a-button> </a-popconfirm> </span> @@ -273,6 +273,26 @@ export default { dataIndex: 'updateTime' }, { + title: '执行时间', + align: "center", + dataIndex: 'executeTime' + }, + { + title: '库位分配时间', + align: "center", + dataIndex: 'allocationTime' + }, + { + title: '到达分拣口时间', + align: "center", + dataIndex: 'arrivalTime' + }, + { + title: '完成时间', + align: "center", + dataIndex: 'completeTime' + }, + { title: '操作', dataIndex: 'action', align: "center", @@ -326,7 +346,7 @@ export default { '下发任务': 'blue', '到达拣选站台': 'orange', '任务完成': 'grey', - default: 'default' + default: 'blue' }; return colors[status] || colors.default; }, diff --git a/ant-design-vue-jeecg/src/views/system/task/TransferTaskHeaderList.vue b/ant-design-vue-jeecg/src/views/system/task/TransferTaskHeaderList.vue index 903c053..0f1312f 100644 --- a/ant-design-vue-jeecg/src/views/system/task/TransferTaskHeaderList.vue +++ b/ant-design-vue-jeecg/src/views/system/task/TransferTaskHeaderList.vue @@ -146,14 +146,14 @@ </template> <span slot="action" slot-scope="text, record"> - <a v-if="record.status == 1" v-has="'taskHeader:executeTask'" @click="executeTask(record)">执行<a-divider type="vertical"/></a> - <a v-if="record.isEmptyOut == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleEmptyOutTask(record)">修复空出数据 + <a v-if="record.status == 1" v-has="'taskHeader:executeTask'" @click="executeTask(record)"><a-button type="primary">执行</a-button> <a-divider type="vertical"/></a> + <a v-if="record.isEmptyOut == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleEmptyOutTask(record)"><a-button type="danger">修复空出数据</a-button> <a-divider type="vertical"/></a> - <a v-if="record.isPickupError == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handlePickupErrorTask(record)">修复取货错数据 + <a v-if="record.isPickupError == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handlePickupErrorTask(record)"><a-button type="danger">修复取货错数据</a-button> <a-divider type="vertical"/></a> - <a v-if="record.isDoubleIn == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleDoubleInTask(record)">修复重入数据 + <a v-if="record.isDoubleIn == 1 && record.exceptionState == 1" v-has="'taskHeader:executeTask'" @click="handleDoubleInTask(record)"><a-button type="danger">修复重入数据</a-button> <a-divider type="vertical"/></a> - <a v-if="record.status <= 10" v-has="'taskHeader:cancelTask'" @click="cancelTask(record)">取消<a-divider type="vertical"/></a> + <a v-if="record.status <= 10" v-has="'taskHeader:cancelTask'" @click="cancelTask(record)"><a-button type="danger">取消</a-button> <a-divider type="vertical"/></a> </span> </a-table> @@ -281,6 +281,26 @@ export default { dataIndex: 'updateTime' }, { + title: '执行时间', + align: "center", + dataIndex: 'executeTime' + }, + { + title: '库位分配时间', + align: "center", + dataIndex: 'allocationTime' + }, + { + title: '到达分拣口时间', + align: "center", + dataIndex: 'arrivalTime' + }, + { + title: '完成时间', + align: "center", + dataIndex: 'completeTime' + }, + { title: '操作', dataIndex: 'action', align: "center", @@ -334,7 +354,7 @@ export default { '下发任务': 'blue', '到达拣选站台': 'orange', '任务完成': 'grey', - default: 'default' + default: 'blue' }; return colors[status] || colors.default; }, diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/erp/controller/ErpController.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/erp/controller/ErpController.java index 2fb2d0f..8eb7832 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/erp/controller/ErpController.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/erp/controller/ErpController.java @@ -4,19 +4,11 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import org.jeecg.common.api.vo.Result; -import org.jeecg.modules.wms.api.erp.entity.ErpCancel; -import org.jeecg.modules.wms.api.erp.entity.ErpMaterial; -import org.jeecg.modules.wms.api.erp.entity.ErpReceipt; -import org.jeecg.modules.wms.api.erp.entity.ErpShipment; -import org.jeecg.modules.wms.api.erp.entity.InventoryQueryParam; +import org.jeecg.modules.wms.api.erp.entity.*; import org.jeecg.modules.wms.api.erp.service.IErpService; import org.jeecg.modules.wms.framework.controller.HuahengBaseController; import org.jeecg.utils.support.ApiLogger; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -32,6 +24,14 @@ public class ErpController extends HuahengBaseController { @Resource private IErpService erpService; + @PostMapping("/addMaterial") + @ResponseBody + @ApiOperation("增加物料") + @ApiLogger(apiName = "增加物料", from = "ERP") + public Result addMaterial(@RequestBody ErpMaterial erpMaterial) { + return erpService.addMaterial(erpMaterial); + } + @PostMapping("/receipt") @ResponseBody @ApiOperation("入库单下发") @@ -77,12 +77,4 @@ public class ErpController extends HuahengBaseController { return result; } - @PostMapping("/addMaterial") - @ResponseBody - @ApiOperation("增加物料") - @ApiLogger(apiName = "增加物料", from = "ERP") - public Result addMaterial(@RequestBody ErpMaterial erpMaterial) { - return erpService.addMaterial(erpMaterial); - } - } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mobile/entity/CallBoxBean.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mobile/entity/CallBoxBean.java index 007a945..dea50ff 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mobile/entity/CallBoxBean.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mobile/entity/CallBoxBean.java @@ -3,6 +3,9 @@ package org.jeecg.modules.wms.api.mobile.entity; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +/** + * @author 游杰 + */ @Data public class CallBoxBean { @ApiModelProperty(value = "托盘号", required = true) diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/controller/WcsController.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/controller/WcsController.java index d8e886e..bdc8737 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/controller/WcsController.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/controller/WcsController.java @@ -171,7 +171,13 @@ public class WcsController extends HuahengBaseController { @ApiOperation("设置物料信息") @ApiLogger(apiName = "WCS设置物料信息", from = "WCS") public Result setMaterialInfo(@RequestBody MaterialInfoEntity materialInfoEntity) { - Result result = wcsService.setMaterialInfo(materialInfoEntity); + Result result = handleMultiProcess("setMaterialInfo", new MultiProcessListener() { + @Override + public Result<?> doProcess() { + Result result = wcsService.setMaterialInfo(materialInfoEntity); + return result; + } + }); return result; } @@ -184,7 +190,13 @@ public class WcsController extends HuahengBaseController { public Result arrivedNotice(@RequestBody ArriveEntity arriveEntity) { String taskNo = arriveEntity.getTaskNo(); String port = arriveEntity.getPort(); - Result result = wcsService.arrivedNotice(taskNo, port); + Result result = handleMultiProcess("arrivedNotice", new MultiProcessListener() { + @Override + public Result<?> doProcess() { + Result result = wcsService.arrivedNotice(taskNo, port); + return result; + } + }); return result; } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java index 5b36c0f..44ccd7b 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/wcs/service/WcsServiceImpl.java @@ -2,6 +2,7 @@ package org.jeecg.modules.wms.api.wcs.service; import java.net.SocketException; import java.util.ArrayList; +import java.util.Date; import java.util.List; import java.util.stream.Collectors; @@ -257,6 +258,7 @@ public class WcsServiceImpl implements WcsService { taskHeader.setZoneCode(location.getZoneCode()); taskHeader.setRoadWay(location.getRoadWay()); taskHeader.setPreTaskNo(preTaskNo); + taskHeader.setAllocationTime(new Date()); taskHeader.setWeight(Integer.parseInt(warecellDomain.getWeight())); taskHeader.setToLocationCode(locationCode); if (!taskHeaderService.updateById(taskHeader)) { @@ -703,6 +705,10 @@ public class WcsServiceImpl implements WcsService { if (status == QuantityConstant.TASK_STATUS_COMPLETED) { return Result.error("任务已经完成taskNo:" + taskNo); } + int taskId = taskHeader.getId(); + taskHeader = new TaskHeader(); + taskHeader.setId(taskId); + taskHeader.setArrivalTime(new Date()); taskHeader.setStatus(QuantityConstant.TASK_STATUS_ARRIVED_STATION); taskHeader.setToPortCode(port); boolean result = taskHeaderService.updateById(taskHeader); diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/parameterConfiguration/service/IParameterConfigurationService.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/parameterConfiguration/service/IParameterConfigurationService.java index 9bbfc83..02711c0 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/parameterConfiguration/service/IParameterConfigurationService.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/parameterConfiguration/service/IParameterConfigurationService.java @@ -1,8 +1,9 @@ package org.jeecg.modules.wms.config.parameterConfiguration.service; -import com.baomidou.mybatisplus.extension.service.IService; import org.jeecg.modules.wms.config.parameterConfiguration.entity.ParameterConfiguration; +import com.baomidou.mybatisplus.extension.service.IService; + /** * @Description: 参数配置 * @Author: jeecg-boot @@ -11,5 +12,7 @@ import org.jeecg.modules.wms.config.parameterConfiguration.entity.ParameterConfi */ public interface IParameterConfigurationService extends IService<ParameterConfiguration> { - public String getValueByCode(String code); + String getValueByCode(String code); + + int getValueIntByCode(String code); } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/parameterConfiguration/service/impl/ParameterConfigurationServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/parameterConfiguration/service/impl/ParameterConfigurationServiceImpl.java index 73e2d77..e00d270 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/parameterConfiguration/service/impl/ParameterConfigurationServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/parameterConfiguration/service/impl/ParameterConfigurationServiceImpl.java @@ -1,13 +1,12 @@ package org.jeecg.modules.wms.config.parameterConfiguration.service.impl; -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; import org.jeecg.modules.wms.config.parameterConfiguration.entity.ParameterConfiguration; import org.jeecg.modules.wms.config.parameterConfiguration.mapper.ParameterConfigurationMapper; import org.jeecg.modules.wms.config.parameterConfiguration.service.IParameterConfigurationService; import org.springframework.stereotype.Service; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; /** @@ -30,4 +29,17 @@ public class ParameterConfigurationServiceImpl extends ServiceImpl<ParameterConf String value = parameterConfiguration.getValue(); return value; } + + @Override + public int getValueIntByCode(String code) { + LambdaQueryWrapper<ParameterConfiguration> parameterConfigurationLambdaQueryWrapper = Wrappers.lambdaQuery(); + parameterConfigurationLambdaQueryWrapper.eq(ParameterConfiguration::getCode, code); + ParameterConfiguration parameterConfiguration = getOne(parameterConfigurationLambdaQueryWrapper); + if (parameterConfiguration == null) { + return 0; + } + String value = parameterConfiguration.getValue(); + int valueInt = Integer.parseInt(value); + return valueInt; + } } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/IInventoryDetailService.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/IInventoryDetailService.java index 3dfb3ef..2eb6867 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/IInventoryDetailService.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/IInventoryDetailService.java @@ -50,4 +50,5 @@ public interface IInventoryDetailService extends IService<InventoryDetail> { boolean updateQtyAndTaskQtyAndLocationCode(BigDecimal qty, BigDecimal taskQty, String locationCode, int id); + boolean updateBatchLocationCodeById(List<InventoryDetail> inventoryDetailList); } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/impl/InventoryDetailServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/impl/InventoryDetailServiceImpl.java index ae53e93..36216db 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/impl/InventoryDetailServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryHeader/service/impl/InventoryDetailServiceImpl.java @@ -2,6 +2,7 @@ package org.jeecg.modules.wms.inventory.inventoryHeader.service.impl; import java.math.BigDecimal; import java.math.RoundingMode; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.function.Function; @@ -131,6 +132,19 @@ public class InventoryDetailServiceImpl extends ServiceImpl<InventoryDetailMappe return success; } + @Override + public boolean updateBatchLocationCodeById(List<InventoryDetail> inventoryDetailList) { + List<InventoryDetail> inventoryDetailList1 = new ArrayList<>(); + for (InventoryDetail inventoryDetail : inventoryDetailList) { + InventoryDetail inventoryDetail1 = new InventoryDetail(); + inventoryDetail1.setId(inventoryDetail.getId()); + inventoryDetail1.setLocationCode(inventoryDetail.getLocationCode()); + inventoryDetailList1.add(inventoryDetail1); + } + boolean success = this.updateBatchById(inventoryDetailList1); + return success; + } + /** * 计算库存明细托盘填充度 * @author TanYibin diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryTransaction/entity/InventoryTransaction.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryTransaction/entity/InventoryTransaction.java index 249b786..7ad6bbd 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryTransaction/entity/InventoryTransaction.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/inventory/inventoryTransaction/entity/InventoryTransaction.java @@ -1,19 +1,19 @@ package org.jeecg.modules.wms.inventory.inventoryTransaction.entity; import java.io.Serializable; -import java.io.UnsupportedEncodingException; -import java.util.Date; import java.math.BigDecimal; +import java.util.Date; + +import org.jeecg.common.aspect.annotation.Dict; +import org.jeecgframework.poi.excel.annotation.Excel; + import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; -import org.springframework.format.annotation.DateTimeFormat; -import org.jeecgframework.poi.excel.annotation.Excel; -import org.jeecg.common.aspect.annotation.Dict; + import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; @@ -109,6 +109,10 @@ public class InventoryTransaction implements Serializable { @Excel(name = "数量", width = 15) @ApiModelProperty(value = "数量") private BigDecimal qty; + /** 库存数量 */ + @Excel(name = "库存数量", width = 15) + @ApiModelProperty(value = "库存数量") + private BigDecimal inventoryQty; /** 批次 */ @Excel(name = "批次", width = 15) @ApiModelProperty(value = "批次") diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/entity/TaskHeader.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/entity/TaskHeader.java index 29a5aec..61a4622 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/entity/TaskHeader.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/entity/TaskHeader.java @@ -168,4 +168,16 @@ public class TaskHeader implements Serializable { /** 更新日期 */ @ApiModelProperty(value = "更新日期") private Date updateTime; + /** 执行时间(下发任务时间) */ + @ApiModelProperty(value = "执行时间") + private Date executeTime; + /** 分配时间 */ + @ApiModelProperty(value = "分配时间") + private Date allocationTime; + /** 到达时间(到达拣选台时间) */ + @ApiModelProperty(value = "到达时间") + private Date arrivalTime; + /** 完成时间(完成任务时间) */ + @ApiModelProperty(value = "完成时间") + private Date completeTime; } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java index e9efdb0..af7cc6b 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/task/taskHeader/service/impl/TaskHeaderServiceImpl.java @@ -62,10 +62,10 @@ import org.jeecg.utils.StringUtils; import org.jeecg.utils.constant.QuantityConstant; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import com.alibaba.fastjson.JSON; -import com.aliyun.oss.ServiceException; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -867,7 +867,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea } @Override - @Transactional(rollbackFor = Exception.class) + @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW) public Result sendTaskToWcs(Integer taskId) { TaskHeader taskHeader = taskHeaderService.getById(taskId); if (taskHeader == null) { @@ -1011,11 +1011,25 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea return Result.ok("入库任务(" + taskHeader.getId() + ")已经是完成的!"); } if (taskDetailList.isEmpty()) { - throw new JeecgBootException("完成入库任务时, 入库任务明细为空"); + int allow = parameterConfigurationService.getValueIntByCode(QuantityConstant.RULE_CALL_BOX_ALLOW_EMPTY); + if (allow == QuantityConstant.RULE_ALLOW_EMPTY) { + Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), taskType, containerCode, + fromLocationCode, toLocationCode, warehouseCode); + if (!result.isSuccess()) { + throw new JeecgBootException(result.getMessage()); + } + success = taskHeaderService.updateStatusById(QuantityConstant.TASK_STATUS_COMPLETED, taskHeader.getId()); + if (!success) { + throw new JeecgBootException("完成入库任务时,保存任务头失败"); + } + return Result.ok("完成入库任务"); + } else { + return Result.error("完成入库任务时, 入库任务明细为空"); + } } Location toLocation = locationService.getLocationByCode(toLocationCode, warehouseCode); if (toLocation == null) { - throw new JeecgBootException("完成入库任务时,没有找到目的库位"); + return Result.error("完成入库任务时,没有找到目的库位"); } InventoryHeader inventoryHeader = inventoryHeaderService.getInventoryHeaderByContainerCode(containerCode, warehouseCode); if (inventoryHeader != null) { @@ -1034,7 +1048,7 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea inventoryDetailList1.add(inventoryDetail1); } if (!inventoryDetailService.updateBatchById(inventoryDetailList1)) { - throw new ServiceException("完成入库任务时,更新库存详情失败"); + throw new JeecgBootException("完成入库任务时,更新库存详情失败"); } } } @@ -1115,8 +1129,13 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea inventoryTransaction.setProject(taskDetail.getProject()); inventoryTransaction.setInventoryStatus(taskDetail.getInventoryStatus()); inventoryTransaction.setQty(receiptQty); + // 获得库存数量 + BigDecimal inventoryQty = inventoryDetailService.getSumQty(inventoryDetail); + inventoryQty = inventoryQty.add(receiptQty); + inventoryTransaction.setInventoryQty(inventoryQty); inventoryTransactionList.add(inventoryTransaction); } + success = receiptContainerHeaderService.updateStatusById(QuantityConstant.RECEIPT_CONTAINER_FINISHED, taskHeader.getReceiptContainerHeaderId()); if (!success) { throw new JeecgBootException("完成入库任务时,更新入库组盘头表状态失败"); @@ -1129,14 +1148,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea if (!success) { throw new JeecgBootException("完成入库任务时,保存库存交易失败"); } - - Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), taskType, containerCode, fromLocationCode, - toLocationCode, warehouseCode); - if (!result.isSuccess()) { - throw new JeecgBootException(result.getMessage()); - } if (!taskHeaderService.combineInventoryDetail(taskHeader)) { - throw new JeecgBootException("合并入库库存失败"); + throw new JeecgBootException("完成入库任务时, 合并入库库存失败"); } if (!receiptDetailService.updateBatchById(receiptDetaiList)) { throw new JeecgBootException("完成入库任务时,更新入库单详情失败"); @@ -1151,9 +1164,14 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea if (!inventoryHeaderService.updateInventoryContainerStatusByContainerCode(containerCode, warehouseCode)) { throw new JeecgBootException("完成入库任务时,更新托盘状态失败"); } + Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), taskType, containerCode, fromLocationCode, + toLocationCode, warehouseCode); + if (!result.isSuccess()) { + throw new JeecgBootException(result.getMessage()); + } success = taskHeaderService.updateStatusById(QuantityConstant.TASK_STATUS_COMPLETED, taskHeader.getId()); if (!success) { - throw new JeecgBootException("完成出库任务,保存任务头失败"); + throw new JeecgBootException("完成入库任务时,保存任务头失败"); } receiptDetaiList = receiptDetaiList.stream().filter(t -> t.getStatus().equals(QuantityConstant.RECEIPT_HEADER_COMPLETED)).collect(Collectors.toList()); LogRecordContext.putVariable("taskHeader", taskHeader); @@ -1194,8 +1212,23 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea if (taskHeader.getStatus().equals(QuantityConstant.TASK_STATUS_COMPLETED)) { return Result.ok("完成出库任务,(" + taskHeader.getId() + ")任务已经是完成的!"); } + // 如果任务详情为空,那么就是呼叫料盒,但是又没入库进去。 if (taskDetailList.isEmpty()) { - return Result.error("完成出库任务,任务明细为空"); + int allow = parameterConfigurationService.getValueIntByCode(QuantityConstant.RULE_CALL_BOX_ALLOW_EMPTY); + if (allow == QuantityConstant.RULE_ALLOW_EMPTY) { + Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), taskType, containerCode, + fromLocationCode, toLocationCode, warehouseCode); + if (!result.isSuccess()) { + throw new JeecgBootException(result.getMessage()); + } + success = taskHeaderService.updateStatusById(QuantityConstant.TASK_STATUS_COMPLETED, taskHeader.getId()); + if (!success) { + throw new JeecgBootException("完成出库任务,保存任务头失败"); + } + return Result.ok("完成出库任务"); + } else { + return Result.error("完成出库任务,任务明细为空"); + } } if (StringUtils.isEmpty(fromLocationCode)) { return Result.error("完成出库任务" + taskHeader.getId() + "没有起始库位,执行中止"); @@ -1281,6 +1314,8 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea inventoryTransaction.setLot(inventoryDetail.getLot()); inventoryTransaction.setProject(inventoryDetail.getProject()); inventoryTransaction.setQty(taskDetail.getQty()); + BigDecimal inventoryQty = inventoryDetailService.getSumQty(inventoryDetail); + inventoryTransaction.setInventoryQty(inventoryQty); inventoryTransactionList.add(inventoryTransaction); shipmentIdList.add(taskDetail.getShipmentId()); } @@ -1305,11 +1340,6 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea if (!success) { throw new JeecgBootException("完成出库任务,保存库存详情失败"); } - Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), taskType, containerCode, fromLocationCode, - toLocationCode, warehouseCode); - if (!result.isSuccess()) { - throw new JeecgBootException(result.getMessage()); - } ShipmentContainerHeader shipmentContainerHeader = shipmentContainerHeaderService.getById(taskHeader.getShipmentContainerHeaderId()); if (shipmentContainerHeader == null) { throw new JeecgBootException("完成出库任务,获取出库组盘头失败"); @@ -1340,6 +1370,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea throw new JeecgBootException("完成出库任务,更新库存状态失败"); } } + Result result = taskHeaderService.completeTaskUnLockContainerAndLocation(taskHeader.getContainerFillStatus(), taskType, containerCode, fromLocationCode, + toLocationCode, warehouseCode); + if (!result.isSuccess()) { + throw new JeecgBootException(result.getMessage()); + } success = taskHeaderService.updateStatusById(QuantityConstant.TASK_STATUS_COMPLETED, taskHeader.getId()); if (!success) { throw new JeecgBootException("完成出库任务,保存任务头失败"); @@ -2143,14 +2178,13 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea .eq(InventoryHeader::getLocationCode, fromLocationCode); InventoryHeader inventoryHeader = inventoryHeaderService.getOne(inventoryHeaderLambdaUpdateWrapper); if (inventoryHeader != null) { - inventoryHeader.setLocationCode(toLocationCode); - success = inventoryHeaderService.updateById(inventoryHeader); + success = inventoryHeaderService.updateLocationCodeById(toLocationCode, inventoryHeader.getId()); if (!success) { throw new JeecgBootException("完成移库任务时, 更新库存头失败"); } } if (inventoryDetailList.size() != 0) { - success = inventoryDetailService.updateBatchById(inventoryDetailList); + success = inventoryDetailService.updateBatchLocationCodeById(inventoryDetailList); if (!success) { throw new JeecgBootException("完成移库任务时, 更新库存详情失败"); } @@ -2431,6 +2465,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea TaskHeader taskHeader = new TaskHeader(); taskHeader.setId(id); taskHeader.setStatus(status); + if (status == QuantityConstant.TASK_STATUS_COMPLETED) { + taskHeader.setCompleteTime(new Date()); + } else if (status == QuantityConstant.TASK_STATUS_RELEASE) { + taskHeader.setExecuteTime(new Date()); + } boolean success = taskHeaderService.updateById(taskHeader); return success; } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java b/huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java index afd9c1d..b55e56d 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/utils/constant/QuantityConstant.java @@ -448,6 +448,7 @@ public class QuantityConstant { public static final String RULE_TASK_LOCATION = "taskLocationRule"; public static final String RULE_CONNECT_WCS = "connectWcs"; public static final String RULE_ALLOCATION = "allocationRule"; + public static final String RULE_CALL_BOX_ALLOW_EMPTY = "callBoxAllowEmpty"; public static final String DOUBLE_FORK_RESERVE_LOCATION = "doubleForkReserveLocation"; public static final String DOUBLE_FORK_SEARCH_LOCATION = "doubleForkSearchLocation"; public static final String WAREHOUSING_WEIGHING = "warehousingWeighing"; @@ -472,6 +473,9 @@ public class QuantityConstant { public static final int RULE_TASK_PICK_SHIPMENT = 1; public static final int RULE_TASK_WHOLE_SHIPMENT = 0; + public static final int RULE_ALLOW_EMPTY = 1; + public static final int RULE_NOT_ALLOW_EMPTY = 0; + public static final int RULE_WCS_CONNECT = 1; public static final int RULE_WCS_DISCONNECT = 0;