diff --git a/src/application/mk/basic-pages/list.vue b/src/application/mk/basic-pages/list.vue index fbc2000..d8e4dc2 100644 --- a/src/application/mk/basic-pages/list.vue +++ b/src/application/mk/basic-pages/list.vue @@ -44,8 +44,10 @@ @@ -177,6 +179,13 @@ export default { // 动作 methods: { + enabledOp({ name, row }) { + + if (name == 'delete' && row.__hide_delete) { + return false + } + return true; + }, pagePrint() { let tableData = JSON.parse(JSON.stringify(this.$refs.xGrid.getTableData().fullData)); this.$emit("print", { tableData: tableData }); diff --git a/src/application/mk/index.js b/src/application/mk/index.js index ee431e0..c7dfe21 100644 --- a/src/application/mk/index.js +++ b/src/application/mk/index.js @@ -94,6 +94,9 @@ VXETable.formats.mixin({ formatYesNo({ cellValue }) { // 格式化是否 return cellValue ? '是' : '否' }, + formatStart({ cellValue }) { // 格式化启用禁用 + return cellValue ? '启用' : '禁用' + }, formatRef({ cellValue, column }) { // 格式化参照 if (column && column.params diff --git a/src/pages/Middle/Mes/MesStock/MesStock/List.vue b/src/pages/Middle/Mes/MesStock/MesStock/List.vue index 43c6b39..7b5a068 100644 --- a/src/pages/Middle/Mes/MesStock/MesStock/List.vue +++ b/src/pages/Middle/Mes/MesStock/MesStock/List.vue @@ -1,5 +1,12 @@ \ No newline at end of file + \ No newline at end of file diff --git a/src/pages/Middle/Mes/MesWarehouse/MesWarehouse/PositionEdit.vue b/src/pages/Middle/Mes/MesWarehouse/MesWarehouse/PositionEdit.vue index cf4b179..feb799a 100644 --- a/src/pages/Middle/Mes/MesWarehouse/MesWarehouse/PositionEdit.vue +++ b/src/pages/Middle/Mes/MesWarehouse/MesWarehouse/PositionEdit.vue @@ -1,13 +1,248 @@ + i18n: require('./i18n'), + components: {}, + props: { + pageMode: { + type: String, + default: "edit" + }, + dataId: { + } + }, - \ No newline at end of file + data() { + + return { + pageOptions: {} + }; + }, + + computed: { + desc() { + return this.$t('editPageDesc') + } + }, + + + created() { + + this.optionsInit(); + this.dataInit(); + + }, + // 函数 + methods: { + + + + optionsInit() { + // 页面数据变量 + var pageData = { + // 当前项目名称 + currentConfigName: "", + // 当前项目ID + currentBeid: 0, + + addPageUrl: "/MesWarehouse/MesWarehousePositionAdd", + editPageUrl: "/MesWarehouse/MesWarehousePositionUpdate/", + listPageUrl: "/MesWarehouse/MesWarehousePositionList", + + + uploadDefaultImg: null, + detailDataFieldName: "warehouse_location", + + actions: { + // =============================== 接口地址 自动生成 Start =============================== + MesWarehouseList: `${BASE_URL.BASE_URL}/MesWarehouse/v1/mes/warehouse/list`, // 仓库列表 + MesWarehouseDetail: `${BASE_URL.BASE_URL}/MesWarehouse/v1/mes/warehouse/detail`, // 仓库详情 + MesWarehouseCreate: `${BASE_URL.BASE_URL}/MesWarehouse/v1/mes/warehouse/create`, // 创建仓库 + MesWarehouseUpdate: `${BASE_URL.BASE_URL}/MesWarehouse/v1/mes/warehouse/update`, // 更新仓库 + MesWarehouseDelete: `${BASE_URL.BASE_URL}/MesWarehouse/v1/mes/warehouse/detele`, // 删除仓库 + MesWarehouseBatchDelete: `${BASE_URL.BASE_URL}/MesWarehouse/v1/mes/warehouse/batchDelete`, // 批量删除仓库 + MesWarehouseBatchUpdate: `${BASE_URL.BASE_URL}/MesWarehouse/v1/mes/warehouse/batchUpdate`, // 批量更新仓库 + MesWarehouseBatchCreate: `${BASE_URL.BASE_URL}/MesWarehouse/v1/mes/warehouse/batchCreate`, // 批量创建仓库 + MesWarehouseExportExcel: `${BASE_URL.BASE_URL}/MesWarehouse/v1/mes/warehouse/export/excel`, // 导出仓库数据到EXCEL + MesWarehouseImportExcel: `${BASE_URL.BASE_URL}/MesWarehouse/v1/mes/warehouse/import/excel`, // 批量导入EXCEL仓库数据 + WarehouseLocationList: `${BASE_URL.BASE_URL}/MesWarehouse/v1/warehouse/location/list`, // 仓库库位列表 + WarehouseLocationDetail: `${BASE_URL.BASE_URL}/MesWarehouse/v1/warehouse/location/detail`, // 仓库库位详情 + WarehouseLocationCreate: `${BASE_URL.BASE_URL}/MesWarehouse/v1/warehouse/location/create`, // 创建仓库库位 + WarehouseLocationUpdate: `${BASE_URL.BASE_URL}/MesWarehouse/v1/warehouse/location/update`, // 更新仓库库位 + WarehouseLocationDelete: `${BASE_URL.BASE_URL}/MesWarehouse/v1/warehouse/location/detele`, // 删除仓库库位 + WarehouseLocationBatchDelete: `${BASE_URL.BASE_URL}/MesWarehouse/v1/warehouse/location/batchDelete`, // 批量删除仓库库位 + WarehouseLocationBatchUpdate: `${BASE_URL.BASE_URL}/MesWarehouse/v1/warehouse/location/batchUpdate`, // 批量更新仓库库位 + WarehouseLocationBatchCreate: `${BASE_URL.BASE_URL}/MesWarehouse/v1/warehouse/location/batchCreate`, // 批量创建仓库库位 + WarehouseLocationExportExcel: `${BASE_URL.BASE_URL}/MesWarehouse/v1/warehouse/location/export/excel`, // 导出仓库库位数据到EXCEL + WarehouseLocationImportExcel: `${BASE_URL.BASE_URL}/MesWarehouse/v1/warehouse/location/import/excel`, // 批量导入EXCEL仓库库位数据 + + // =============================== 接口地址 自动生成 End =============================== + }, + + keyName: 'id', + // 是否编辑模式 + isEdit: false, + // 表单数据 + formOptions: { + data: { + // =============================== 表单数据 自动生成 Start =============================== + + id: 0, + warehouse_id: 0, + code: "", + warehouse_location_code: "", + warehouse_location_name: "", + warehouse_location_keeper_uid: 0, + warehouse_location_keeper_uname: "", + create_uid: 0, + update_uid: 0, + warehouse_location_status: 0, + create_time: new Date(2100, 1, 1).getTime() / 10000, + update_time: new Date(2100, 1, 1).getTime() / 10000, + is_default: 0, + + // =============================== 表单数据 自动生成 End =============================== + }, + // 标题宽度 + titleWidth: 150, + // 标题对齐方式 + titleAlign: 'right', + + // 表单校验规则 + rules: { + // =============================== 表单校验 自动生成 Start =============================== + + warehouse_id: [ + { required: true, message: '请选择仓库' } + ], + code: [ + { required: true, message: '请输入编码' } + ], + warehouse_location_code: [ + { message: '输入库位编号' } + ], + warehouse_location_name: [ + { required: true, message: '请输入库位名称' } + ], + warehouse_location_keeper_uid: [ + { required: true, message: '请输入库管员UID' } + ], + warehouse_location_keeper_uname: [ + { required: true, message: '请输入库管员姓名' } + ], + warehouse_location_status: [ + { required: true, message: '请输入库位状态:0.禁用,1.启用' } + ], + is_default: [ + { required: true, message: '请输入是否默认库位:0.否,1.是' } + ], + + // =============================== 表单校验 自动生成 End =============================== + }, + // 表单项 + items: [ + // =============================== 表单项 自动生成 Start =============================== + + { field: 'warehouse_id', title: '选择仓库', span: 12, itemRender: { name: '$input' } }, + { field: 'code', title: '编码', span: 12, itemRender: { name: '$input' } }, + { field: 'warehouse_location_code', title: '库位编码', span: 12, itemRender: { name: '$input' } }, + { field: 'warehouse_location_name', title: '库位名称', span: 12, itemRender: { name: '$input' } }, + { field: 'warehouse_location_keeper_uid', title: '选择管理员', span: 12, itemRender: { name: '$input' } }, + { field: 'warehouse_location_status', title: '库位状态', span: 12, itemRender: { name: '$switch' } }, + { field: 'is_default', title: '是否默认库位', span: 12, itemRender: { name: '$switch' } }, + + // =============================== 表单项 自动生成 End =============================== + ] + }, + // 新增模式表单项 + addModeItems: [ + + ], + + + }; + pageData.actions.get = pageData.actions.MesWarehouseDetail; + pageData.actions.create = pageData.actions.MesWarehouseCreate; + pageData.actions.update = pageData.actions.MesWarehouseUpdate; + + // 合并表单数据及配置 + pageData.formOptions = Object.assign({}, this.$mk.config.defaults.formOptions, pageData.formOptions); + + this.pageOptions = pageData; + }, + + dataInit() { + // 获取路由的id参数 + let dataId = this.getDataId(); + // 如果有id参数,说明是编辑模式 + if (dataId) { + const json = `{"id":${dataId}}`; + this.$mk.post({ + url: this.pageOptions.actions.get, + loading: "加载中...", + data: json, + config: { + headers: { + 'Content-Type': 'application/json' + } + } + }).then(a => { + + let detailDataFieldName = this.pageOptions.detailDataFieldName; + if(a.data[detailDataFieldName].warehouse_effective_date){ + a.data[detailDataFieldName].warehouse_effective_date = new Date(a.data[detailDataFieldName].warehouse_effective_date * 1000); + } + if(a.data[detailDataFieldName].warehouse_invalid_date){ + a.data[detailDataFieldName].warehouse_invalid_date = new Date(a.data[detailDataFieldName].warehouse_invalid_date * 1000); + } + if (a.data[detailDataFieldName].create_time) { + a.data[detailDataFieldName].create_time = new Date(a.data[detailDataFieldName].create_time * 1000); + } + if (a.data[detailDataFieldName].update_time) { + a.data[detailDataFieldName].update_time = new Date(a.data[detailDataFieldName].update_time * 1000); + } + this.pageOptions.formOptions.data = a.data[detailDataFieldName]; + + this.$forceUpdate() + }).catch((a) => { + this.$mk.error(a.data.msg); + }); + + this.pageOptions.isEdit = true; + + this.$forceUpdate() + } else { + // 如果没有id参数,说明是新增模式 + this.addModeItems.forEach(item => { + this.pageOptions.formOptions.items.push(item); + }) + + } + }, + + // 获取路由的id参数 + getDataId() { + let dataId = this.dataId; + if (this.$route.params.id) { + dataId = this.$route.params.id; + } + if (!dataId) { + dataId = 0; + } + return dataId; + } + }, + // 监听属性 + watch: { + + } +}; + + diff --git a/src/pages/Middle/Mes/MesWarehouse/MesWarehouse/PositionList.vue b/src/pages/Middle/Mes/MesWarehouse/MesWarehouse/PositionList.vue index 486d9c5..741fcce 100644 --- a/src/pages/Middle/Mes/MesWarehouse/MesWarehouse/PositionList.vue +++ b/src/pages/Middle/Mes/MesWarehouse/MesWarehouse/PositionList.vue @@ -1,161 +1,170 @@ - + \ No newline at end of file