Commit 31f4e7e1 authored by 张伯涛's avatar 张伯涛

Merge remote-tracking branch 'origin/master'

parents d2dd403b 9838e398
// 生产模型api // 生产模型api
import request from '@/utils/request' import request from '@/utils/request'
import Qs from 'qs'
// 分页查询列表 // 分页查询列表
export function listModel(query) { export function listModel(query) {
...@@ -17,3 +18,32 @@ export function deleteLogicalId(data) { ...@@ -17,3 +18,32 @@ export function deleteLogicalId(data) {
method: 'delete', method: 'delete',
}) })
} }
// 复制
export function queryCopyNltModels(params) {
return request({
url: '/nltmodel/queryCopyNltModels',
method: 'get',
params
})
}
// 查询物料列表
export function queryNltIfsMaterialCopyByPagination(query) {
return request({
url: '/nltifsmaterial/queryNltIfsMaterialCopyByPagination',
method: 'get',
params: query
})
}
// 修改生产模型状态
export function updateStatus(data) {
const businessId = data.businessId
data = Qs.stringify(data)
return request({
url: '/nltmodel/updateStatus/' + businessId,
method: 'put',
data
})
}
// 同步数据api
import request from '@/utils/request'
export function getSync(query) {
return request({
url: '/nltscheduledresult/queryNltScheduledResultByPagination',
method: 'get',
params: query
})
}
export function onSchedule() {
return request({
url: '/nltscheduledresult/onSchedule',
method: 'get'
})
}
// 删除同步数据(逻辑删除)
export function delSchedule(businessId) {
return request({
url: '/nltscheduledresult/delete/' + businessId,
method: 'delete'
})
}
...@@ -515,7 +515,7 @@ export default { ...@@ -515,7 +515,7 @@ export default {
this.$router.push({ this.$router.push({
path: '/ProductionProcess/ModelDetails', path: '/ProductionProcess/ModelDetails',
query: { query: {
businessId: row.businessId, businessId: row.orderModelId,
type: '2' type: '2'
} }
}) })
......
This diff is collapsed.
<template> <template>
<div class="model_details"> <div class="model_details">
<div class="detailsSearch" style="border-bottom: 14px solid #f4f4f4"> <div class="detailsSearch" style="border-bottom: 14px solid #f4f4f4">
<el-form ref="form" :model="form" :rules="rules" style="padding: 0 0 0 20px" class="formClass" :inline="true" label-width="auto"> <el-form ref="form" :model="form" :rules="rules" style="padding: 0 0 0 20px" class="formClass" :inline="true">
<el-form-item class="labelHeight" label="模型类型" prop="modelType"> <el-form-item class="labelHeight" label="模型类型" prop="modelType">
<div slot="label" class="labelClassRequired"> <div slot="label" class="labelClassRequired">
<div class="labelName">模型类型</div> <div class="labelName">模型类型</div>
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
</el-row> </el-row>
<!-- 添加工站--> <!-- 添加工站-->
<el-dialog :close-on-click-modal="false" class="modelDialog" :title="title" :visible.sync="openPosition" width="70%" :append-to-body="false"> <el-dialog :close-on-click-modal="false" class="modelDialog" :title="title" :visible.sync="openPosition" width="70%" :append-to-body="false">
<el-form ref="form1" :model="queryParams" label-width="auto" :inline="true"> <el-form ref="form1" :model="queryParams" :inline="true">
<el-form-item label="工站名称" prop="staName"> <el-form-item label="工站名称" prop="staName">
<div slot="label"> <div slot="label">
<div class="labelName">工站名称</div> <div class="labelName">工站名称</div>
...@@ -199,7 +199,7 @@ ...@@ -199,7 +199,7 @@
</el-dialog> </el-dialog>
<!-- 选择成品料号 物料料号--> <!-- 选择成品料号 物料料号-->
<el-dialog :close-on-click-modal="false" class="modelDialog" :title="title" :visible.sync="openPartNo" width="70%" :append-to-body="false"> <el-dialog :close-on-click-modal="false" class="modelDialog" :title="title" :visible.sync="openPartNo" width="70%" :append-to-body="false">
<el-form ref="form2" :model="queryParams" label-width="auto" :inline="true"> <el-form ref="form2" :model="queryParams" :inline="true">
<el-form-item label="成品料号" prop="materCode"> <el-form-item label="成品料号" prop="materCode">
<div slot="label"> <div slot="label">
<div class="labelName">成品料号</div> <div class="labelName">成品料号</div>
...@@ -457,7 +457,7 @@ export default { ...@@ -457,7 +457,7 @@ export default {
// 替换物料时 禁用自己的id判断 // 替换物料时 禁用自己的id判断
disabledId: '', disabledId: '',
// 物料已被选中但是可编辑多选且提前查的id组 用于回显替换物料 状态1的时候传值 // 物料已被选中但是可编辑多选且提前查的id组 用于回显替换物料 状态1的时候传值
selectMaterIdStr: '' selectMaterIList: []
} }
}, },
watch: { watch: {
...@@ -594,7 +594,7 @@ export default { ...@@ -594,7 +594,7 @@ export default {
this.queryParams.materCode = '' this.queryParams.materCode = ''
this.queryParams.page = 1 this.queryParams.page = 1
this.queryParams.rows = 10 this.queryParams.rows = 10
this.selectMaterIdStr = '' this.selectMaterIList = []
this.openPartNo = true this.openPartNo = true
this.title = '选择成品料号' this.title = '选择成品料号'
this.type = '3' this.type = '3'
...@@ -607,7 +607,7 @@ export default { ...@@ -607,7 +607,7 @@ export default {
this.queryParams.page = 1 this.queryParams.page = 1
this.queryParams.rows = 10 this.queryParams.rows = 10
this.materQueryType = '' this.materQueryType = ''
this.selectMaterIdStr = '' this.selectMaterIList = []
if (row) { if (row) {
this.type = '1' this.type = '1'
this.materQueryType = (row.configureOrNot === null || row.configureOrNot === undefined || row.configureOrNot === '') ? '0' : '1' this.materQueryType = (row.configureOrNot === null || row.configureOrNot === undefined || row.configureOrNot === '') ? '0' : '1'
...@@ -625,7 +625,7 @@ export default { ...@@ -625,7 +625,7 @@ export default {
this.disabledId = row.businessId this.disabledId = row.businessId
this.replaceMaterialList.forEach(item => { this.replaceMaterialList.forEach(item => {
this.materIdList.push(item.businessId) this.materIdList.push(item.businessId)
this.selectMaterIdStr += item.businessId this.selectMaterIList.push(item.businessId)
}) })
} else { } else {
this.materIdList = [] this.materIdList = []
...@@ -657,12 +657,15 @@ export default { ...@@ -657,12 +657,15 @@ export default {
if (this.type === '2') { if (this.type === '2') {
this.materQueryType = '' this.materQueryType = ''
} }
if (this.type === '1') {
str = this.materIdListType1.join(',')
}
const params = { const params = {
...this.queryParams, ...this.queryParams,
businessIdList: str, businessIdList: str,
totalType: this.materQueryType, totalType: this.materQueryType,
type: '', type: '',
selectMaterIdStr: this.selectMaterIdStr selectMaterIdStr: this.selectMaterIList.join(',')
} }
if (this.type === '3') { if (this.type === '3') {
params.type = '3' params.type = '3'
...@@ -997,9 +1000,15 @@ export default { ...@@ -997,9 +1000,15 @@ export default {
}, },
// 返回模型页面 // 返回模型页面
cancelPosition() { cancelPosition() {
this.$router.push({ if (this.htmlType === '2') {
name: '/productionInfo/ProductionModel' this.$router.push({
}) name: '/ProductionProcess/workOrder'
})
} else {
this.$router.push({
name: '/productionInfo/ProductionModel'
})
}
}, },
// 确定返回模型页面 // 确定返回模型页面
submitPosition() { submitPosition() {
...@@ -1045,7 +1054,6 @@ export default { ...@@ -1045,7 +1054,6 @@ export default {
}) })
}, },
initData() { initData() {
for (let i = 0; i < this.positionList.length; i++) { for (let i = 0; i < this.positionList.length; i++) {
console.log(i) console.log(i)
this.positionList[i].sort = i this.positionList[i].sort = i
......
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
align="center" align="center"
width="300" width="200"
class-name="small-padding fixed-width" class-name="small-padding fixed-width"
> >
<template slot="header"> <template slot="header">
...@@ -122,12 +122,6 @@ ...@@ -122,12 +122,6 @@
style="margin-left: 10px" style="margin-left: 10px"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
>修改</el-link> >修改</el-link>
<el-link
size="mini"
type="danger"
style="margin-left: 10px"
@click="handleDelete(scope.row)"
>复制</el-link>
<el-link <el-link
size="mini" size="mini"
type="danger" type="danger"
...@@ -136,10 +130,10 @@ ...@@ -136,10 +130,10 @@
>删除</el-link> >删除</el-link>
<el-link <el-link
size="mini" size="mini"
type="danger" type="success"
style="margin-left: 10px" style="margin-left: 10px"
@click="handleQueryInfo(scope.row)" @click="handleCopy(scope.row)"
>详情</el-link> >复制</el-link>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -153,25 +147,113 @@ ...@@ -153,25 +147,113 @@
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<!-- 选择成品料号 物料料号-->
<el-dialog :close-on-click-modal="false" class="modelDialog" :title="'选择复制料号'" :visible.sync="openPartNo" width="70%" :append-to-body="false">
<el-form ref="form2" :model="queryParam" label-width="auto" :inline="true">
<el-form-item label="成品料号" prop="materCode">
<div slot="label">
<div class="labelName">成品料号</div>
<div class="labelName">Part Number</div>
</div>
<el-input
v-model="queryParam.materCode"
placeholder="请输入料号名称"
clearable
:maxlength="30"
size="small"
style="width: 200px"
/>
</el-form-item>
<el-form-item>
<el-button class="redBtn" type="danger" size="small" @click="queryCode">查询 Query</el-button>
<el-button class="resetBtn" size="small" @click="resetCode">重置 Reset</el-button>
</el-form-item>
<el-row :gutter="20">
<!--选择成品料号数据-->
<el-col :span="24" :xs="24" style="height: 300px">
<el-table
v-loading="loadingCode"
border
ref="materTable"
:header-row-class-name="cellClassMater"
style="padding-right: 10px;padding-left: 10px;margin-top: 10px"
:data="selectPartNum"
@selection-change="handleSelectionChangeMaterial"
@select="handleSelectionMaterial"
>
<el-table-column type="selection" width="50"/>
<el-table-column type="index" label="序号" width="50" />
<el-table-column align="center" prop="materCode" width="200" :show-overflow-tooltip="true">
<template slot="header">
<div>料号</div>
<div>Part No.</div>
</template>
<template v-slot:default="scope">
{{ scope.row.materCode || '-' }}
</template>
</el-table-column>
<el-table-column align="center" prop="materDesc" :show-overflow-tooltip="true">
<template slot="header">
<div>物料描述</div>
<div>Description</div>
</template>
<template slot-scope="scope">
{{ scope.row.materDesc || '-' }}
</template>
</el-table-column>
<el-table-column align="center" width="200" prop="materUnit" :show-overflow-tooltip="true">
<template slot="header">
<div>单位</div>
<!-- <div>Position Type</div>-->
</template>
<template slot-scope="scope">
{{ scope.row.materUnit || '-' }}
</template>
</el-table-column>
</el-table>
<pagination
v-show="totalMater>0"
:total="totalMater"
:page.sync="queryParam.page"
:limit.sync="queryParam.rows"
@pagination="partNum"
/>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button class="canleBtn" @click="cancelChoicePart">取 消 Cancel</el-button>
<el-button class="redBtn" type="danger" @click="submitChoicePart">确 定 Confirm</el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { listModel, deleteLogicalId } from '@/api/model' import { listModel, deleteLogicalId, queryCopyNltModels, queryNltIfsMaterialCopyByPagination, updateStatus } from '@/api/model'
export default { export default {
name: 'ProductionModel', name: 'ProductionModel',
data() { data() {
return { return {
addMaterialList: [],
loadingCode: false,
loading: false, loading: false,
selectPartNum: [],
modelList: [], modelList: [],
total: 0, total: 0,
totalMater: 0,
queryParams: { queryParams: {
page: 1, page: 1,
rows: 10, rows: 10,
modelType: undefined, modelType: undefined,
partNo: undefined partNo: undefined
}, },
queryParam: {
page: 1,
rows: 10,
materCode: ''
},
openPartNo: false,
// 新增模型弹窗 // 新增模型弹窗
openModel: false, openModel: false,
// 添加工站弹窗 // 添加工站弹窗
...@@ -183,6 +265,64 @@ export default { ...@@ -183,6 +265,64 @@ export default {
this.getList() this.getList()
}, },
methods: { methods: {
handleStatusChange(row) {
const params = {
businessId: row.businessId,
flag: row.flag
}
this.$confirm('确定' + (row.flag === '1' ? '启用' : '停用') + '该生产模型?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
updateStatus(params).then(res => {
this.$message({
type: 'success',
message: '修改成功!'
})
this.getList()
}).catch(_ => {
row.flag = row.flag === '1' ? '0' : '1'
})
}).catch(() => {
row.flag = row.flag === '1' ? '0' : '1'
})
},
// 确定关闭选择成品料号弹窗
submitChoicePart() {
if (this.addMaterialList.length < 1) {
this.$message.error('请选择一条物料')
return
}
const params = {
businessId: this.businessId,
materId: this.addMaterialList[0].businessId
}
queryCopyNltModels(params).then(res => {
this.$message.success('复制成功')
this.openPartNo = false
this.getList()
})
},
// 关闭选择成品料号弹窗
cancelChoicePart() {
this.openPartNo = false
},
// 工单表样式
cellClassMater(row) {
return 'disabledSelection'
},
// 配置物料选择框
handleSelectionChangeMaterial(data) {
this.addMaterialList = data
},
// 单选
handleSelectionMaterial(selection, row) {
if (selection.length > 1) {
const del_row = selection.shift()
this.$refs.materTable.toggleRowSelection(del_row, false)//
}
},
/** 列表获取 */ /** 列表获取 */
getList() { getList() {
this.loading = true this.loading = true
...@@ -224,6 +364,26 @@ export default { ...@@ -224,6 +364,26 @@ export default {
} }
}) })
}, },
handleCopy(row) {
this.businessId = row.businessId
this.queryParam.materCode = ''
this.queryParam.page = 1
this.queryParam.rows = 10
this.openPartNo = true
this.partNum()
},
partNum() {
this.loadingCode = true
const params = {
...this.queryParam,
}
queryNltIfsMaterialCopyByPagination(this.queryParam).then(res => {
this.selectPartNum = res.rows
this.totalMater = res.total
this.loadingCode = false
})
},
// 删除生产模型 // 删除生产模型
handleDelete(row) { handleDelete(row) {
this.$confirm('确定删除该生产模型?', '提示', { this.$confirm('确定删除该生产模型?', '提示', {
...@@ -250,13 +410,29 @@ export default { ...@@ -250,13 +410,29 @@ export default {
type: '4' type: '4'
} }
}) })
} },
// 成品料号表格查询
queryCode() {
this.queryParam.page = 1
this.partNum()
},
// 重置按钮
resetCode() {
this.queryParam.materCode = ''
this.queryParam.page = 1
this.queryParam.rows = 10
this.partNum()
},
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.product_model { .product_model {
::v-deep .el-table .disabledSelection .cell .el-checkbox__inner {
display: none;
position: relative;
}
font-size: 18px; font-size: 18px;
.placeholder{ .placeholder{
height:14px; height:14px;
......
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
<el-form ref="queryForm" style="padding: 0 0 0 10px" class="formClass" :model="queryParams" :inline="true" label-width="auto"> <el-form ref="queryForm" style="padding: 0 0 0 10px" class="formClass" :model="queryParams" :inline="true" label-width="auto">
<el-form-item label="时间"> <el-form-item label="时间">
<div slot="label" class="labelClass"> <div slot="label" class="labelClass">
<div>时间</div> <div>执行时间</div>
<div>Synchronization Time</div> <div>Create Time</div>
</div> </div>
<el-date-picker <el-date-picker
v-model="queryParams.synchronizationTime" v-model="dateRange"
size="small" size="small"
style="width: 300px" style="width: 300px"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</div> </div>
<div> <div>
<el-row :gutter="20"> <el-row :gutter="20">
<!--不良定义数据--> <!--同步数据数据-->
<el-col :span="24" :xs="24"> <el-col :span="24" :xs="24">
<div style="float: right;margin: 10px"> <div style="float: right;margin: 10px">
<el-button <el-button
...@@ -48,33 +48,34 @@ ...@@ -48,33 +48,34 @@
border border
style="padding-right: 10px;padding-left: 10px" style="padding-right: 10px;padding-left: 10px"
:data="badList" :data="badList"
:default-sort="{prop: 'createTime', order: 'descending'}"
> >
<el-table-column type="index" label="序号" width="50" /> <el-table-column type="index" label="序号" width="50" />
<el-table-column align="center" prop="synchronizationTime" width="200" :show-overflow-tooltip="true"> <el-table-column align="center" prop="createTime" width="200" :show-overflow-tooltip="true">
<template slot="header"> <template slot="header">
<div>时间</div> <div>执行时间</div>
<div>Synchronization Time</div> <div>Create Time</div>
</template> </template>
<template v-slot:default="scope"> <template v-slot:default="scope">
{{ scope.row.synchronizationTime || '-' }} {{ scope.row.createTime || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" prop="type" :show-overflow-tooltip="true"> <el-table-column align="center" prop="type" :show-overflow-tooltip="true">
<template slot="header"> <template slot="header">
<div>类型</div> <div>执行类型</div>
<div>Type</div> <div>Type</div>
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.type || '-' }} {{ scope.row.type || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" width="200" prop="result" :show-overflow-tooltip="true"> <el-table-column align="center" width="200" prop="status" :show-overflow-tooltip="true">
<template slot="header"> <template slot="header">
<div>结果</div> <div>执行结果</div>
<div>Result</div> <div>Status</div>
</template> </template>
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.result || '-' }} {{ scope.row.status || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" prop="remarks" :show-overflow-tooltip="true"> <el-table-column align="center" prop="remarks" :show-overflow-tooltip="true">
...@@ -119,18 +120,19 @@ ...@@ -119,18 +120,19 @@
</template> </template>
<script> <script>
import { delSchedule, getSync, onSchedule } from '@/api/synchronization'
export default { export default {
name: 'Index', name: 'Index',
data() { data() {
return { return {
loading: false, loading: false,
badList: [], badList: [],
// 日期范围
dateRange: [],
queryParams: { queryParams: {
page: 1, page: 1,
rows: 10, rows: 10
synchronizationTime: '',
startTime: '',
endTime: ''
}, },
total: 0 total: 0
} }
...@@ -155,7 +157,12 @@ export default { ...@@ -155,7 +157,12 @@ export default {
}, },
methods: { methods: {
getList() { getList() {
console.log('查询成功') this.loading = true
getSync(this.addDateRange(this.queryParams, this.dateRange)).then(res => {
this.badList = res.rows
this.total = res.total
this.loading = false
})
}, },
handleQuery() { handleQuery() {
this.queryParams.page = 1 this.queryParams.page = 1
...@@ -164,26 +171,40 @@ export default { ...@@ -164,26 +171,40 @@ export default {
resetQuery() { resetQuery() {
this.queryParams.rows = 10 this.queryParams.rows = 10
this.queryParams.page = 1 this.queryParams.page = 1
this.queryParams.synchronizationTime = undefined this.dateRange = []
this.handleQuery() this.handleQuery()
}, },
handleDelete() { handleDelete(row) {
this.$confirm('所选择数据被删除后不可再恢复,是否继续?', '提示', { this.$confirm('所选择数据被删除后不可再恢复,是否继续?', '提示', {
confirmButtonText: '确定 Confirm', confirmButtonText: '确定 Confirm',
cancelButtonText: '取消 Cancel', cancelButtonText: '取消 Cancel',
cancelButtonClass: 'btn-custom-cancel', cancelButtonClass: 'btn-custom-cancel',
type: 'warning' type: 'warning'
}).then(function() { }).then(() => {
console.log('删除') return delSchedule(row.businessId)
}) }).then(() => {
this.getList()
this.$message({
message: '删除成功',
type: 'success'
})
}).catch()
}, },
// 同步物料 // 同步物料
handleMaterial() { handleMaterial() {
console.log('同步物料') const type = 1
onSchedule(type).then(res => {
this.$message.success('操作成功,请稍后查看结果')
this.getList()
})
}, },
// 同步工单 // 同步工单
handleOrder() { handleOrder() {
console.log('同步工单') const type = 2
onSchedule(type).then(res => {
this.$message.success('操作成功,请稍后查看结果')
this.getList()
})
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment