diff --git a/src/api/production/calendarInfo.js b/src/api/production/calendarInfo.js index abbce29..5e795e9 100644 --- a/src/api/production/calendarInfo.js +++ b/src/api/production/calendarInfo.js @@ -29,7 +29,7 @@ export function addCalendarInfo(data) { // 新增SAP生产日历 export function addSAPCalendar(data) { return request({ - url: '/production/calendarInfo/addSAPCalendar', + url: '/sap/port/addSAPCalendar', method: 'post', data: data }) diff --git a/src/views/base/orderInfo/index.vue b/src/views/base/orderInfo/index.vue index 53d1492..702b00c 100644 --- a/src/views/base/orderInfo/index.vue +++ b/src/views/base/orderInfo/index.vue @@ -1,7 +1,7 @@ - + @@ -177,21 +193,23 @@ type="text" icon="el-icon-bottom" @click="handleReleasePlan(scope.row)" - >下达计划 + >下达计划 + 修改工单 - - - - - - - + >修改工单 + + + + + + + + @@ -208,28 +226,28 @@ - + - + - + - + - + - + - + - + @@ -242,33 +260,36 @@ - + + v-model="form.beginDate" + type="date" + value-format="yyyy-MM-dd" + placeholder="请选择计划开始日期" + > + v-model="form.endDate" + type="date" + value-format="yyyy-MM-dd" + placeholder="请选择计划结束日期" + > - + + v-model="form.completeDate" + type="date" + value-format="yyyy-MM-dd" + placeholder="请选择完成日期" + > @@ -290,9 +311,10 @@ import { releaseOrderPlan } from '@/api/base/orderInfo' import { findProductLineList } from '@//api/base/productLine' +import { addSAPCalendar } from '@//api/production/calendarInfo' export default { - name: "OrderInfo", + name: 'OrderInfo', dicts: ['order_status', 'order_type', 'is_flag', 'is_release'], data() { return { @@ -311,7 +333,7 @@ export default { // 工单信息表格数据 orderInfoList: [], // 弹出层标题 - title: "", + title: '', // 是否显示弹出层 open: false, // 查询参数 @@ -342,56 +364,55 @@ export default { // 表单参数 form: {}, // 表单校验 - rules: { - }, + rules: {}, columns: [ - { key: 0, label: `主键标识`, visible: false }, - { key: 1, label: `SAP计划编号`, visible: true }, - { key: 2, label: `销售订单编号`, visible: false }, - { key: 3, label: `销售订单行号`, visible: false }, - { key: 4, label: `物料编码`, visible: true }, - { key: 5, label: `物料名称`, visible: true }, - { key: 6, label: `物料组`, visible: false }, - { key: 7, label: `订单计划数量`, visible: true }, - { key: 8, label: `完成数量`, visible: true }, - { key: 9, label: `工单类型`, visible: true }, - { key: 10, label: `工单状态`, visible: true }, - { key: 11, label: `计划开始日期`, visible: true }, - { key: 12, label: `计划结束日期`, visible: true }, - { key: 13, label: `工厂编码`, visible: false }, - { key: 14, label: `启用标识`, visible: false }, - { key: 15, label: `创建人`, visible: false }, - { key: 16, label: `创建时间`, visible: false }, - { key: 17, label: `更新人`, visible: false }, - { key: 18, label: `更新时间`, visible: false }, - { key: 19, label: `完成日期`, visible: true }, - { key: 20, label: `是否已下达生产计划`, visible: true }, - { key: 21, label: `工作中心编号`, visible: true }, - ], + { key: 0, label: `主键标识`, visible: false }, + { key: 1, label: `SAP计划编号`, visible: true }, + { key: 2, label: `销售订单编号`, visible: false }, + { key: 3, label: `销售订单行号`, visible: false }, + { key: 4, label: `物料编码`, visible: true }, + { key: 5, label: `物料名称`, visible: true }, + { key: 6, label: `物料组`, visible: false }, + { key: 7, label: `订单计划数量`, visible: true }, + { key: 8, label: `完成数量`, visible: true }, + { key: 9, label: `工单类型`, visible: true }, + { key: 10, label: `工单状态`, visible: true }, + { key: 11, label: `计划开始日期`, visible: true }, + { key: 12, label: `计划结束日期`, visible: true }, + { key: 13, label: `工厂编码`, visible: false }, + { key: 14, label: `启用标识`, visible: false }, + { key: 15, label: `创建人`, visible: false }, + { key: 16, label: `创建时间`, visible: false }, + { key: 17, label: `更新人`, visible: false }, + { key: 18, label: `更新时间`, visible: false }, + { key: 19, label: `完成日期`, visible: true }, + { key: 20, label: `是否已下达生产计划`, visible: true }, + { key: 21, label: `工作中心编号`, visible: true } + ], // 产线选项 - productLineList: [], - }; + productLineList: [] + } }, created() { - this.getList(); + this.getList() }, methods: { /** 查询工单信息列表 */ getList() { - this.loading = true; + this.loading = true listOrderInfo(this.queryParams).then(response => { - this.orderInfoList = response.rows; - this.total = response.total; - this.loading = false; - }); - findProductLineList({productLineType: 1}).then(response => { - this.productLineList = response.data; - }); + this.orderInfoList = response.rows + this.total = response.total + this.loading = false + }) + findProductLineList({ productLineType: 1 }).then(response => { + this.productLineList = response.data + }) }, // 取消按钮 cancel() { - this.open = false; - this.reset(); + this.open = false + this.reset() }, // 表单重置 reset() { @@ -417,86 +438,100 @@ export default { updatedBy: null, updatedTime: null, completeDate: null - }; - this.resetForm("form"); + } + this.resetForm('form') }, /** 搜索按钮操作 */ handleQuery() { - this.queryParams.pageNum = 1; - this.getList(); + this.queryParams.pageNum = 1 + this.getList() }, /** 重置按钮操作 */ resetQuery() { - this.resetForm("queryForm"); - this.handleQuery(); + this.resetForm('queryForm') + this.handleQuery() }, // 多选框选中数据 handleSelectionChange(selection) { this.ids = selection.map(item => item.objId) - this.single = selection.length!==1 + this.single = selection.length !== 1 this.multiple = !selection.length }, /** 新增按钮操作 */ handleAdd() { - this.reset(); - this.open = true; - this.title = "添加工单信息"; + this.reset() + this.open = true + this.title = '添加工单信息' }, /** 修改按钮操作 */ handleUpdate(row) { - this.reset(); + this.reset() const objId = row.objId || this.ids getOrderInfo(objId).then(response => { - this.form = response.data; - this.open = true; - this.title = "修改工单信息"; - }); + this.form = response.data + this.open = true + this.title = '修改工单信息' + }) }, /** 下达计划 */ - handleReleasePlan(row){ - if (row.isRelease === 0){ - this.$modal.msgWarning("该工单已下达计划!"); - return; + handleReleasePlan(row) { + if (row.isRelease === 0) { + this.$modal.msgWarning('该工单已下达计划!') + return } this.$modal.confirm('是否下达SAP计划编号为:"' + row.orderCode + '"的计划?').then(function() { - return releaseOrderPlan(row); + return releaseOrderPlan(row) }).then(() => { - this.getList(); - this.$modal.msgSuccess("下达工单计划成功"); + this.getList() + this.$modal.msgSuccess('下达工单计划成功') }).catch((e) => { - console.log("下达计划错误信息:",e); - }); + console.log('下达计划错误信息:', e) + }) + }, + sapForm() { + let planStartDate = null + let planEndDate = null + let currentDate = new Date() + currentDate.setMonth(currentDate.getMonth() - 1) + planStartDate = currentDate.toISOString().slice(0, 10) + currentDate.setMonth(currentDate.getMonth() + 2) + planEndDate = currentDate.toISOString().slice(0, 10) + addSAPCalendar({ planStartDate: planStartDate, planEndDate: planEndDate }).then(response => { + this.$modal.msgSuccess('同步成功') + this.sapOpen = false + this.getList() + }) }, - /** 提交按钮 */ submitForm() { - this.$refs["form"].validate(valid => { + this.$refs['form'].validate(valid => { if (valid) { if (this.form.objId != null) { updateOrderInfo(this.form).then(response => { - this.$modal.msgSuccess("修改成功"); - this.open = false; - this.getList(); - }); + this.$modal.msgSuccess('修改成功') + this.open = false + this.getList() + }) } else { addOrderInfo(this.form).then(response => { - this.$modal.msgSuccess("新增成功"); - this.open = false; - this.getList(); - }); + this.$modal.msgSuccess('新增成功') + this.open = false + this.getList() + }) } } - }); + }) }, /** 删除按钮操作 */ handleDelete(row) { - const objIds = row.objId || this.ids; + const objIds = row.objId || this.ids this.$modal.confirm('是否确认删除工单信息编号为"' + objIds + '"的数据项?').then(function() { - return delOrderInfo(objIds); + return delOrderInfo(objIds) }).then(() => { - this.getList(); - this.$modal.msgSuccess("删除成功"); - }).catch(() => {}); + this.getList() + this.$modal.msgSuccess('删除成功') + }).catch(() => { + }) }, /** 导出按钮操作 */ handleExport() { @@ -505,5 +540,5 @@ export default { }, `orderInfo_${new Date().getTime()}.xlsx`) } } -}; +} diff --git a/src/views/production/calendarInfo/index.vue b/src/views/production/calendarInfo/index.vue index 0919dcb..64de808 100644 --- a/src/views/production/calendarInfo/index.vue +++ b/src/views/production/calendarInfo/index.vue @@ -71,7 +71,7 @@ icon="el-icon-plus" size="mini" @click="handleAdd" - >同步SAP周计划 + >同步SAP计划