update - 订单页面加同步SAP按钮

master
yinq 6 months ago
parent 63c137c475
commit 1b8535d26f

@ -29,7 +29,7 @@ export function addCalendarInfo(data) {
// 新增SAP生产日历 // 新增SAP生产日历
export function addSAPCalendar(data) { export function addSAPCalendar(data) {
return request({ return request({
url: '/production/calendarInfo/addSAPCalendar', url: '/sap/port/addSAPCalendar',
method: 'post', method: 'post',
data: data data: data
}) })

@ -72,7 +72,8 @@
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['base:orderInfo:add']" v-hasPermi="['base:orderInfo:add']"
>新增</el-button> >新增
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -83,7 +84,8 @@
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['base:orderInfo:edit']" v-hasPermi="['base:orderInfo:edit']"
>修改</el-button> >修改
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -94,7 +96,8 @@
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['base:orderInfo:remove']" v-hasPermi="['base:orderInfo:remove']"
>删除</el-button> >删除
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -104,7 +107,18 @@
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['base:orderInfo:export']" v-hasPermi="['base:orderInfo:export']"
>导出</el-button> >导出
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="sapForm"
>同步SAP周计划
</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row> </el-row>
@ -123,7 +137,9 @@
<dict-tag :options="dict.type.order_type" :value="scope.row.orderType"/> <dict-tag :options="dict.type.order_type" :value="scope.row.orderType"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="工单状态" align="center" prop="orderStatus" v-if="columns[10].visible" :show-overflow-tooltip="true"> <el-table-column label="工单状态" align="center" prop="orderStatus" v-if="columns[10].visible"
:show-overflow-tooltip="true"
>
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.order_status" :value="scope.row.orderStatus"/> <dict-tag :options="dict.type.order_status" :value="scope.row.orderStatus"/>
</template> </template>
@ -177,14 +193,16 @@
type="text" type="text"
icon="el-icon-bottom" icon="el-icon-bottom"
@click="handleReleasePlan(scope.row)" @click="handleReleasePlan(scope.row)"
>下达计划</el-button> >下达计划
</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['base:orderInfo:edit']" v-hasPermi="['base:orderInfo:edit']"
>修改工单</el-button> >修改工单
</el-button>
<!-- <el-button--> <!-- <el-button-->
<!-- size="mini"--> <!-- size="mini"-->
<!-- type="text"--> <!-- type="text"-->
@ -249,7 +267,8 @@
v-model="form.beginDate" v-model="form.beginDate"
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="请选择计划开始日期"> placeholder="请选择计划开始日期"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="计划结束日期" prop="endDate"> <el-form-item label="计划结束日期" prop="endDate">
@ -257,7 +276,8 @@
v-model="form.endDate" v-model="form.endDate"
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="请选择计划结束日期"> placeholder="请选择计划结束日期"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="工厂编码" prop="factoryCode"> <el-form-item label="工厂编码" prop="factoryCode">
@ -268,7 +288,8 @@
v-model="form.completeDate" v-model="form.completeDate"
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="请选择完成日期"> placeholder="请选择完成日期"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -290,9 +311,10 @@ import {
releaseOrderPlan releaseOrderPlan
} from '@/api/base/orderInfo' } from '@/api/base/orderInfo'
import { findProductLineList } from '@//api/base/productLine' import { findProductLineList } from '@//api/base/productLine'
import { addSAPCalendar } from '@//api/production/calendarInfo'
export default { export default {
name: "OrderInfo", name: 'OrderInfo',
dicts: ['order_status', 'order_type', 'is_flag', 'is_release'], dicts: ['order_status', 'order_type', 'is_flag', 'is_release'],
data() { data() {
return { return {
@ -311,7 +333,7 @@ export default {
// //
orderInfoList: [], orderInfoList: [],
// //
title: "", title: '',
// //
open: false, open: false,
// //
@ -342,8 +364,7 @@ export default {
// //
form: {}, form: {},
// //
rules: { rules: {},
},
columns: [ columns: [
{ key: 0, label: `主键标识`, visible: false }, { key: 0, label: `主键标识`, visible: false },
{ key: 1, label: `SAP计划编号`, visible: true }, { key: 1, label: `SAP计划编号`, visible: true },
@ -366,32 +387,32 @@ export default {
{ key: 18, label: `更新时间`, visible: false }, { key: 18, label: `更新时间`, visible: false },
{ key: 19, label: `完成日期`, visible: true }, { key: 19, label: `完成日期`, visible: true },
{ key: 20, label: `是否已下达生产计划`, visible: true }, { key: 20, label: `是否已下达生产计划`, visible: true },
{ key: 21, label: `工作中心编号`, visible: true }, { key: 21, label: `工作中心编号`, visible: true }
], ],
// 线 // 线
productLineList: [], productLineList: []
}; }
}, },
created() { created() {
this.getList(); this.getList()
}, },
methods: { methods: {
/** 查询工单信息列表 */ /** 查询工单信息列表 */
getList() { getList() {
this.loading = true; this.loading = true
listOrderInfo(this.queryParams).then(response => { listOrderInfo(this.queryParams).then(response => {
this.orderInfoList = response.rows; this.orderInfoList = response.rows
this.total = response.total; this.total = response.total
this.loading = false; this.loading = false
}); })
findProductLineList({ productLineType: 1 }).then(response => { findProductLineList({ productLineType: 1 }).then(response => {
this.productLineList = response.data; this.productLineList = response.data
}); })
}, },
// //
cancel() { cancel() {
this.open = false; this.open = false
this.reset(); this.reset()
}, },
// //
reset() { reset() {
@ -417,18 +438,18 @@ export default {
updatedBy: null, updatedBy: null,
updatedTime: null, updatedTime: null,
completeDate: null completeDate: null
}; }
this.resetForm("form"); this.resetForm('form')
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1
this.getList(); this.getList()
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryForm"); this.resetForm('queryForm')
this.handleQuery(); this.handleQuery()
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
@ -438,65 +459,79 @@ export default {
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset()
this.open = true; this.open = true
this.title = "添加工单信息"; this.title = '添加工单信息'
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset()
const objId = row.objId || this.ids const objId = row.objId || this.ids
getOrderInfo(objId).then(response => { getOrderInfo(objId).then(response => {
this.form = response.data; this.form = response.data
this.open = true; this.open = true
this.title = "修改工单信息"; this.title = '修改工单信息'
}); })
}, },
/** 下达计划 */ /** 下达计划 */
handleReleasePlan(row) { handleReleasePlan(row) {
if (row.isRelease === 0) { if (row.isRelease === 0) {
this.$modal.msgWarning("该工单已下达计划!"); this.$modal.msgWarning('该工单已下达计划!')
return; return
} }
this.$modal.confirm('是否下达SAP计划编号为"' + row.orderCode + '"的计划?').then(function() { this.$modal.confirm('是否下达SAP计划编号为"' + row.orderCode + '"的计划?').then(function() {
return releaseOrderPlan(row); return releaseOrderPlan(row)
}).then(() => { }).then(() => {
this.getList(); this.getList()
this.$modal.msgSuccess("下达工单计划成功"); this.$modal.msgSuccess('下达工单计划成功')
}).catch((e) => { }).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() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
if (this.form.objId != null) { if (this.form.objId != null) {
updateOrderInfo(this.form).then(response => { updateOrderInfo(this.form).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess('修改成功')
this.open = false; this.open = false
this.getList(); this.getList()
}); })
} else { } else {
addOrderInfo(this.form).then(response => { addOrderInfo(this.form).then(response => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess('新增成功')
this.open = false; this.open = false
this.getList(); this.getList()
}); })
} }
} }
}); })
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const objIds = row.objId || this.ids; const objIds = row.objId || this.ids
this.$modal.confirm('是否确认删除工单信息编号为"' + objIds + '"的数据项?').then(function() { this.$modal.confirm('是否确认删除工单信息编号为"' + objIds + '"的数据项?').then(function() {
return delOrderInfo(objIds); return delOrderInfo(objIds)
}).then(() => { }).then(() => {
this.getList(); this.getList()
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess('删除成功')
}).catch(() => {}); }).catch(() => {
})
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
@ -505,5 +540,5 @@ export default {
}, `orderInfo_${new Date().getTime()}.xlsx`) }, `orderInfo_${new Date().getTime()}.xlsx`)
} }
} }
}; }
</script> </script>

@ -71,7 +71,7 @@
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
>同步SAP计划 >同步SAP计划
</el-button> </el-button>
</el-col> </el-col>
<!-- <el-col :span="1.5">--> <!-- <el-col :span="1.5">-->

Loading…
Cancel
Save