feat: 优化生产计划下发页面筛选与调序交互
This commit is contained in:
@@ -3,23 +3,29 @@
|
|||||||
<el-card class="topCard">
|
<el-card class="topCard">
|
||||||
<div class="topDiv">
|
<div class="topDiv">
|
||||||
<span style="margin-left: 10px">订单号:</span>
|
<span style="margin-left: 10px">订单号:</span>
|
||||||
<el-select v-model="orderNumberValue" clearable placeholder="请选择订单" size="small" style="width: 150px">
|
<el-input v-model="orderNumberValue" clearable placeholder="请输入订单号" size="small" style="width: 150px" />
|
||||||
<el-option v-for="item in orderNumber" :key="item.value" :label="item.label" :value="item.value"
|
|
||||||
size="mini" />
|
|
||||||
</el-select>
|
|
||||||
<span style="margin-left: 10px">产品型号:</span>
|
<span style="margin-left: 10px">产品型号:</span>
|
||||||
<el-select v-model="engineTypeValue" clearable placeholder="请选择产品型号" size="small" style="width: 150px">
|
<el-select v-model="engineTypeValue" clearable placeholder="请选择产品型号" size="small" style="width: 150px">
|
||||||
<el-option v-for="item in engineType" :key="item.value" :label="item.label" :value="item.value" size="mini" />
|
<el-option v-for="item in engineType" :key="item.value" :label="item.label" :value="item.value" size="mini" />
|
||||||
</el-select>
|
</el-select>
|
||||||
<span style="margin-left: 10px">生产类型:</span>
|
<span style="margin-left: 10px">生产类型:</span>
|
||||||
<el-input v-model="workType" clearable placeholder="生产类型" size="small" style="width: 150px" />
|
<el-select v-model="workType" clearable placeholder="请选择生产类型" size="small" style="width: 150px">
|
||||||
|
<el-option label="MAIN" value="MAIN" />
|
||||||
|
<el-option label="FES" value="FES" />
|
||||||
|
</el-select>
|
||||||
|
<span style="margin-left: 10px">执行状态:</span>
|
||||||
|
<el-select v-model="executeStatusValue" clearable placeholder="请选择执行状态" size="small" style="width: 130px">
|
||||||
|
<el-option label="未开始" :value="0" />
|
||||||
|
<el-option label="进行中" :value="1" />
|
||||||
|
<el-option label="已完成" :value="2" />
|
||||||
|
</el-select>
|
||||||
<span style="margin-left: 10px">开始日期:</span>
|
<span style="margin-left: 10px">开始日期:</span>
|
||||||
<el-date-picker v-model="startPlanTime" placeholder="选择开始日期" size="small" type="date"
|
<el-date-picker v-model="startPlanTime" placeholder="选择开始日期" size="small" type="date"
|
||||||
value-format="yyyy-MM-dd" />
|
value-format="yyyy-MM-dd" />
|
||||||
<span style="margin-left: 10px">结束日期:</span>
|
<span style="margin-left: 10px">结束日期:</span>
|
||||||
<el-date-picker v-model="endPlanTime" placeholder="选择结束日期" size="small" type="date" value-format="yyyy-MM-dd" />
|
<el-date-picker v-model="endPlanTime" placeholder="选择结束日期" size="small" type="date" value-format="yyyy-MM-dd" />
|
||||||
<el-button icon="el-icon-search" plain size="small" style="margin-left: 10px" type="primary"
|
<el-button icon="el-icon-search" plain size="small" style="margin-left: 10px" type="primary"
|
||||||
@click="pageSize = 30; pageCurrent = 1; searchOrder()">
|
@click="pageCurrent = 1; searchOrder()">
|
||||||
查询订单
|
查询订单
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button icon="el-icon-circle-plus" size="small" type="distribution" @click="creatOrder('form')">
|
<el-button icon="el-icon-circle-plus" size="small" type="distribution" @click="creatOrder('form')">
|
||||||
@@ -82,10 +88,15 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="项目名称" prop="项目名称" show-overflow-tooltip width="220" />
|
<el-table-column align="center" label="项目名称" prop="项目名称" show-overflow-tooltip width="220" />
|
||||||
<el-table-column align="center" label="工件编号" prop="工件编号" width="180" />
|
<el-table-column align="center" label="工件编号" prop="工件编号" width="220" />
|
||||||
<el-table-column align="center" label="产品型号" prop="产品型号" width="170" />
|
<el-table-column align="center" label="产品型号" prop="产品型号" width="170" />
|
||||||
<el-table-column align="center" label="产品名称" prop="产品名称" show-overflow-tooltip min-width="200" />
|
<el-table-column align="center" label="产品名称" prop="产品名称" show-overflow-tooltip min-width="200" />
|
||||||
<el-table-column align="center" label="生产类型" prop="生产类型" width="80" />
|
<el-table-column align="center" label="生产类型" prop="生产类型" width="80">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-tag v-if="scope.row.生产类型 === 'MAIN'" size="mini" type="primary">MAIN</el-tag>
|
||||||
|
<el-tag v-else-if="scope.row.生产类型" size="mini" type="warning">{{ scope.row.生产类型 }}</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column align="center" label="小机型" width="80">
|
<el-table-column align="center" label="小机型" width="80">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag v-if="scope.row.小机型 == 0" size="mini" type="success">无</el-tag>
|
<el-tag v-if="scope.row.小机型 == 0" size="mini" type="success">无</el-tag>
|
||||||
@@ -141,7 +152,7 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<div class="block" style="margin-top: 10px;">
|
<div class="block" style="margin-top: 10px;">
|
||||||
<el-pagination :current-page="pageCurrent" :page-size="pageSize" :page-sizes="[30, 50, 100]"
|
<el-pagination :current-page="pageCurrent" :page-size="pageSize" :page-sizes="[50, 100, 200, 500]"
|
||||||
:total="total" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange"
|
:total="total" layout="total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange"
|
||||||
@current-change="handleCurrentChange" />
|
@current-change="handleCurrentChange" />
|
||||||
</div>
|
</div>
|
||||||
@@ -223,20 +234,17 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<el-dialog :visible.sync="dialogFormVisibleSort" center title="修改订单排序" width="400px">
|
<el-dialog :visible.sync="dialogFormVisibleSort" center title="调序(修改计划开始时间)" width="500px">
|
||||||
<el-form ref="sortForm" :model="sortForm" :rules="sortRules" label-position="right" label-width="110px">
|
<el-form ref="sortForm" :model="sortForm" :rules="sortRules" label-position="right" label-width="110px">
|
||||||
<el-form-item label="订单号" style="display: inline-block">
|
<el-form-item label="订单号">
|
||||||
<el-input v-model="sortForm.订单号" readonly size="small" />
|
<el-input v-model="sortForm.订单号" readonly size="small" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="项目名称" style="display: inline-block">
|
<el-form-item label="项目名称">
|
||||||
<el-input v-model="sortForm.项目名称" readonly size="small" />
|
<el-input v-model="sortForm.项目名称" readonly size="small" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="当前排序" style="display: inline-block">
|
<el-form-item label="计划开始时间" prop="计划开始时间">
|
||||||
<el-input v-model="sortForm.当前排序" readonly size="small" />
|
<el-date-picker v-model="sortForm.计划开始时间" placeholder="选择计划开始时间" size="small" type="datetime"
|
||||||
</el-form-item>
|
value-format="yyyy-MM-dd HH:mm:ss" style="width: 100%" />
|
||||||
<el-form-item label="新排序号" prop="新排序号" style="display: inline-block">
|
|
||||||
<el-input-number v-model="sortForm.新排序号" :min="1" :step="1" placeholder="请输入新的排序号" size="small"
|
|
||||||
style="width: 200px;" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
@@ -257,20 +265,19 @@ export default {
|
|||||||
expandsDetail: [],
|
expandsDetail: [],
|
||||||
tableData: [],
|
tableData: [],
|
||||||
tableDataWorkProcess: [],
|
tableDataWorkProcess: [],
|
||||||
orderNumber: [],
|
|
||||||
orderNumberValue: '',
|
orderNumberValue: '',
|
||||||
OrderNumber_check: 0,
|
OrderNumber_check: 0,
|
||||||
engineType: [],
|
engineType: [],
|
||||||
engineTypeValue: '',
|
engineTypeValue: '',
|
||||||
engineType_check: 0,
|
engineType_check: 0,
|
||||||
workType: '',
|
workType: '',
|
||||||
planTime: [],
|
executeStatusValue: '',
|
||||||
startPlanTime: '',
|
startPlanTime: '',
|
||||||
startPlanTime_check: 0,
|
startPlanTime_check: 0,
|
||||||
endPlanTime: '',
|
endPlanTime: '',
|
||||||
endPlanTime_check: 0,
|
endPlanTime_check: 0,
|
||||||
total: 0,
|
total: 0,
|
||||||
pageSize: 30,
|
pageSize: 100,
|
||||||
pageCurrent: 1,
|
pageCurrent: 1,
|
||||||
dialogFormVisible: false,
|
dialogFormVisible: false,
|
||||||
dialogFormVisible1: false,
|
dialogFormVisible1: false,
|
||||||
@@ -313,16 +320,14 @@ export default {
|
|||||||
ID: null,
|
ID: null,
|
||||||
订单号: '',
|
订单号: '',
|
||||||
项目名称: '',
|
项目名称: '',
|
||||||
当前排序: '',
|
计划开始时间: ''
|
||||||
新排序号: 1
|
|
||||||
},
|
},
|
||||||
sortRules: {
|
sortRules: {
|
||||||
新排序号: [{ required: true, message: '请输入新的排序号', trigger: 'blur' }]
|
计划开始时间: [{ required: true, message: '请选择计划开始时间', trigger: 'change' }]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getOrderNumber()
|
|
||||||
this.getEndStation()
|
this.getEndStation()
|
||||||
this.searchOrder()
|
this.searchOrder()
|
||||||
this.refreshTimer = setInterval(() => {
|
this.refreshTimer = setInterval(() => {
|
||||||
@@ -348,20 +353,6 @@ export default {
|
|||||||
}))
|
}))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getOrderNumber() {
|
|
||||||
this.orderNumber = []
|
|
||||||
const param = []
|
|
||||||
param[0] = ['开始时间', this.planTime[0]]
|
|
||||||
param[1] = ['结束时间', this.planTime[1]]
|
|
||||||
const Data = this.CreateData('11', '订单计划_订单号_查询', param)
|
|
||||||
this.ExecDatabase(Data).then(response => {
|
|
||||||
const list = Array.isArray(response.data) ? response.data : []
|
|
||||||
this.orderNumber = list.map(item => ({
|
|
||||||
label: item.订单号,
|
|
||||||
value: item.订单号
|
|
||||||
}))
|
|
||||||
})
|
|
||||||
},
|
|
||||||
searchOrder(options = {}) {
|
searchOrder(options = {}) {
|
||||||
const { silent = false } = options
|
const { silent = false } = options
|
||||||
this.startPlanTime_check = this.startPlanTime ? 1 : 0
|
this.startPlanTime_check = this.startPlanTime ? 1 : 0
|
||||||
@@ -374,6 +365,7 @@ export default {
|
|||||||
if (this.endPlanTime === null) {
|
if (this.endPlanTime === null) {
|
||||||
this.endPlanTime = ''
|
this.endPlanTime = ''
|
||||||
}
|
}
|
||||||
|
const executeStatusVal = (this.executeStatusValue === '' || this.executeStatusValue === null || this.executeStatusValue === undefined) ? -1 : this.executeStatusValue
|
||||||
const param = []
|
const param = []
|
||||||
param[0] = ['计划开始时间_check', this.startPlanTime_check]
|
param[0] = ['计划开始时间_check', this.startPlanTime_check]
|
||||||
param[1] = ['计划开始时间', this.startPlanTime]
|
param[1] = ['计划开始时间', this.startPlanTime]
|
||||||
@@ -383,11 +375,12 @@ export default {
|
|||||||
param[5] = ['订单号', this.orderNumberValue]
|
param[5] = ['订单号', this.orderNumberValue]
|
||||||
param[6] = ['产品型号_check', this.engineType_check]
|
param[6] = ['产品型号_check', this.engineType_check]
|
||||||
param[7] = ['产品型号', this.engineTypeValue]
|
param[7] = ['产品型号', this.engineTypeValue]
|
||||||
param[8] = ['生产类型', this.workType]
|
param[8] = ['生产类型', this.workType || '']
|
||||||
param[9] = ['PageCurrent', this.pageCurrent]
|
param[9] = ['执行状态', executeStatusVal]
|
||||||
param[10] = ['PageSize', this.pageSize]
|
param[10] = ['PageCurrent', this.pageCurrent]
|
||||||
param[11] = ['PageCount', '1111', 'int', '1']
|
param[11] = ['PageSize', this.pageSize]
|
||||||
param[12] = ['ItemCount', '1111', 'int', '1']
|
param[12] = ['PageCount', '1111', 'int', '1']
|
||||||
|
param[13] = ['ItemCount', '1111', 'int', '1']
|
||||||
const Data = this.CreateData('11', 'MES_计划BOM_发动机订单计划_查询分页', param)
|
const Data = this.CreateData('11', 'MES_计划BOM_发动机订单计划_查询分页', param)
|
||||||
this.ExecDatabase(Data).then(response => {
|
this.ExecDatabase(Data).then(response => {
|
||||||
const responseData = response.data || {}
|
const responseData = response.data || {}
|
||||||
@@ -486,7 +479,6 @@ export default {
|
|||||||
type: 'success'
|
type: 'success'
|
||||||
})
|
})
|
||||||
this.pageCurrent = 1
|
this.pageCurrent = 1
|
||||||
this.pageSize = 30
|
|
||||||
this.searchOrder()
|
this.searchOrder()
|
||||||
this.dialogFormVisible = false
|
this.dialogFormVisible = false
|
||||||
} else if (result.result === 2) {
|
} else if (result.result === 2) {
|
||||||
@@ -542,7 +534,6 @@ export default {
|
|||||||
type: 'success'
|
type: 'success'
|
||||||
})
|
})
|
||||||
this.pageCurrent = 1
|
this.pageCurrent = 1
|
||||||
this.pageSize = 30
|
|
||||||
this.searchOrder()
|
this.searchOrder()
|
||||||
this.dialogFormVisible1 = false
|
this.dialogFormVisible1 = false
|
||||||
} else {
|
} else {
|
||||||
@@ -615,7 +606,6 @@ export default {
|
|||||||
if (result.result === 1) {
|
if (result.result === 1) {
|
||||||
this.$message.success('订单状态操作成功!')
|
this.$message.success('订单状态操作成功!')
|
||||||
this.pageCurrent = 1
|
this.pageCurrent = 1
|
||||||
this.pageSize = 30
|
|
||||||
this.searchOrder()
|
this.searchOrder()
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(result.msg || '订单状态操作失败')
|
this.$message.error(result.msg || '订单状态操作失败')
|
||||||
@@ -639,7 +629,6 @@ export default {
|
|||||||
type: 'success'
|
type: 'success'
|
||||||
})
|
})
|
||||||
this.pageCurrent = 1
|
this.pageCurrent = 1
|
||||||
this.pageSize = 30
|
|
||||||
this.searchOrder()
|
this.searchOrder()
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(result.msg || '删除失败')
|
this.$message.error(result.msg || '删除失败')
|
||||||
@@ -667,8 +656,13 @@ export default {
|
|||||||
this.sortForm.ID = row.ID
|
this.sortForm.ID = row.ID
|
||||||
this.sortForm.订单号 = row.订单号
|
this.sortForm.订单号 = row.订单号
|
||||||
this.sortForm.项目名称 = row.项目名称
|
this.sortForm.项目名称 = row.项目名称
|
||||||
this.sortForm.当前排序 = row.排序
|
const rawPlanTime = row.计划开始时间
|
||||||
this.sortForm.新排序号 = row.排序
|
if (rawPlanTime) {
|
||||||
|
const str = String(rawPlanTime)
|
||||||
|
this.sortForm.计划开始时间 = str.includes('T') ? str.replace('T', ' ').substring(0, 19) : str
|
||||||
|
} else {
|
||||||
|
this.sortForm.计划开始时间 = ''
|
||||||
|
}
|
||||||
this.dialogFormVisibleSort = true
|
this.dialogFormVisibleSort = true
|
||||||
},
|
},
|
||||||
submitSort() {
|
submitSort() {
|
||||||
@@ -676,33 +670,25 @@ export default {
|
|||||||
if (!valid) {
|
if (!valid) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
this.$confirm(`确定将订单排序从 ${this.sortForm.当前排序} 调整为 ${this.sortForm.新排序号} 吗?`, '提示', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning'
|
|
||||||
}).then(() => {
|
|
||||||
if (this.sortForm.ID === null || this.sortForm.ID === undefined || this.sortForm.ID === '') {
|
if (this.sortForm.ID === null || this.sortForm.ID === undefined || this.sortForm.ID === '') {
|
||||||
this.$message.error('缺少订单主键ID,无法调整排序')
|
this.$message.error('缺少订单主键ID,无法调整')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const param = []
|
const param = []
|
||||||
param[0] = ['ID', this.sortForm.ID]
|
param[0] = ['ID', this.sortForm.ID]
|
||||||
param[1] = ['新排序号', this.sortForm.新排序号]
|
param[1] = ['计划开始时间', this.sortForm.计划开始时间]
|
||||||
const Data = this.CreateData('11', '生产计划_派工订单_执行计划_排序调整', param)
|
const Data = this.CreateData('11', '生产计划_派工订单_执行计划_计划开始时间修改', param)
|
||||||
this.ExecDatabase(Data).then(response => {
|
this.ExecDatabase(Data).then(response => {
|
||||||
const result = response.data && response.data[0] ? response.data[0] : {}
|
const result = response.data && response.data[0] ? response.data[0] : {}
|
||||||
if (result.result === 1) {
|
if (result.result === 1) {
|
||||||
this.$message.success('排序调整成功!')
|
this.$message.success(result.msg || '修改成功!')
|
||||||
this.dialogFormVisibleSort = false
|
this.dialogFormVisibleSort = false
|
||||||
this.pageCurrent = 1
|
|
||||||
this.pageSize = 30
|
|
||||||
this.searchOrder()
|
this.searchOrder()
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(result.msg || '排序调整失败')
|
this.$message.error(result.msg || '修改失败')
|
||||||
}
|
}
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
this.$message.error('排序调整失败:' + error.message)
|
this.$message.error('修改失败:' + error.message)
|
||||||
})
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user