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

Merge remote-tracking branch 'origin/master'

parents d2dd403b 9838e398
// 生产模型api
import request from '@/utils/request'
import Qs from 'qs'
// 分页查询列表
export function listModel(query) {
......@@ -17,3 +18,32 @@ export function deleteLogicalId(data) {
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 {
this.$router.push({
path: '/ProductionProcess/ModelDetails',
query: {
businessId: row.businessId,
businessId: row.orderModelId,
type: '2'
}
})
......
This diff is collapsed.
<template>
<div class="model_details">
<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">
<div slot="label" class="labelClassRequired">
<div class="labelName">模型类型</div>
......@@ -120,7 +120,7 @@
</el-row>
<!-- 添加工站-->
<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">
<div slot="label">
<div class="labelName">工站名称</div>
......@@ -199,7 +199,7 @@
</el-dialog>
<!-- 选择成品料号 物料料号-->
<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">
<div slot="label">
<div class="labelName">成品料号</div>
......@@ -457,7 +457,7 @@ export default {
// 替换物料时 禁用自己的id判断
disabledId: '',
// 物料已被选中但是可编辑多选且提前查的id组 用于回显替换物料 状态1的时候传值
selectMaterIdStr: ''
selectMaterIList: []
}
},
watch: {
......@@ -594,7 +594,7 @@ export default {
this.queryParams.materCode = ''
this.queryParams.page = 1
this.queryParams.rows = 10
this.selectMaterIdStr = ''
this.selectMaterIList = []
this.openPartNo = true
this.title = '选择成品料号'
this.type = '3'
......@@ -607,7 +607,7 @@ export default {
this.queryParams.page = 1
this.queryParams.rows = 10
this.materQueryType = ''
this.selectMaterIdStr = ''
this.selectMaterIList = []
if (row) {
this.type = '1'
this.materQueryType = (row.configureOrNot === null || row.configureOrNot === undefined || row.configureOrNot === '') ? '0' : '1'
......@@ -625,7 +625,7 @@ export default {
this.disabledId = row.businessId
this.replaceMaterialList.forEach(item => {
this.materIdList.push(item.businessId)
this.selectMaterIdStr += item.businessId
this.selectMaterIList.push(item.businessId)
})
} else {
this.materIdList = []
......@@ -657,12 +657,15 @@ export default {
if (this.type === '2') {
this.materQueryType = ''
}
if (this.type === '1') {
str = this.materIdListType1.join(',')
}
const params = {
...this.queryParams,
businessIdList: str,
totalType: this.materQueryType,
type: '',
selectMaterIdStr: this.selectMaterIdStr
selectMaterIdStr: this.selectMaterIList.join(',')
}
if (this.type === '3') {
params.type = '3'
......@@ -997,9 +1000,15 @@ export default {
},
// 返回模型页面
cancelPosition() {
if (this.htmlType === '2') {
this.$router.push({
name: '/ProductionProcess/workOrder'
})
} else {
this.$router.push({
name: '/productionInfo/ProductionModel'
})
}
},
// 确定返回模型页面
submitPosition() {
......@@ -1045,7 +1054,6 @@ export default {
})
},
initData() {
for (let i = 0; i < this.positionList.length; i++) {
console.log(i)
this.positionList[i].sort = i
......
......@@ -108,7 +108,7 @@
</el-table-column>
<el-table-column
align="center"
width="300"
width="200"
class-name="small-padding fixed-width"
>
<template slot="header">
......@@ -122,12 +122,6 @@
style="margin-left: 10px"
@click="handleUpdate(scope.row)"
>修改</el-link>
<el-link
size="mini"
type="danger"
style="margin-left: 10px"
@click="handleDelete(scope.row)"
>复制</el-link>
<el-link
size="mini"
type="danger"
......@@ -136,10 +130,10 @@
>删除</el-link>
<el-link
size="mini"
type="danger"
type="success"
style="margin-left: 10px"
@click="handleQueryInfo(scope.row)"
>详情</el-link>
@click="handleCopy(scope.row)"
>复制</el-link>
</template>
</el-table-column>
</el-table>
......@@ -153,25 +147,113 @@
</el-col>
</el-row>
</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>
</template>
<script>
import { listModel, deleteLogicalId } from '@/api/model'
import { listModel, deleteLogicalId, queryCopyNltModels, queryNltIfsMaterialCopyByPagination, updateStatus } from '@/api/model'
export default {
name: 'ProductionModel',
data() {
return {
addMaterialList: [],
loadingCode: false,
loading: false,
selectPartNum: [],
modelList: [],
total: 0,
totalMater: 0,
queryParams: {
page: 1,
rows: 10,
modelType: undefined,
partNo: undefined
},
queryParam: {
page: 1,
rows: 10,
materCode: ''
},
openPartNo: false,
// 新增模型弹窗
openModel: false,
// 添加工站弹窗
......@@ -183,6 +265,64 @@ export default {
this.getList()
},
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() {
this.loading = true
......@@ -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) {
this.$confirm('确定删除该生产模型?', '提示', {
......@@ -250,13 +410,29 @@ export default {
type: '4'
}
})
}
},
// 成品料号表格查询
queryCode() {
this.queryParam.page = 1
this.partNum()
},
// 重置按钮
resetCode() {
this.queryParam.materCode = ''
this.queryParam.page = 1
this.queryParam.rows = 10
this.partNum()
},
}
}
</script>
<style lang="scss" scoped>
.product_model {
::v-deep .el-table .disabledSelection .cell .el-checkbox__inner {
display: none;
position: relative;
}
font-size: 18px;
.placeholder{
height:14px;
......
......@@ -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-item label="时间">
<div slot="label" class="labelClass">
<div>时间</div>
<div>Synchronization Time</div>
<div>执行时间</div>
<div>Create Time</div>
</div>
<el-date-picker
v-model="queryParams.synchronizationTime"
v-model="dateRange"
size="small"
style="width: 300px"
value-format="yyyy-MM-dd"
......@@ -26,7 +26,7 @@
</div>
<div>
<el-row :gutter="20">
<!--不良定义数据-->
<!--同步数据数据-->
<el-col :span="24" :xs="24">
<div style="float: right;margin: 10px">
<el-button
......@@ -48,33 +48,34 @@
border
style="padding-right: 10px;padding-left: 10px"
:data="badList"
:default-sort="{prop: 'createTime', order: 'descending'}"
>
<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">
<div>时间</div>
<div>Synchronization Time</div>
<div>执行时间</div>
<div>Create Time</div>
</template>
<template v-slot:default="scope">
{{ scope.row.synchronizationTime || '-' }}
{{ scope.row.createTime || '-' }}
</template>
</el-table-column>
<el-table-column align="center" prop="type" :show-overflow-tooltip="true">
<template slot="header">
<div>类型</div>
<div>执行类型</div>
<div>Type</div>
</template>
<template slot-scope="scope">
{{ scope.row.type || '-' }}
</template>
</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">
<div>结果</div>
<div>Result</div>
<div>执行结果</div>
<div>Status</div>
</template>
<template slot-scope="scope">
{{ scope.row.result || '-' }}
{{ scope.row.status || '-' }}
</template>
</el-table-column>
<el-table-column align="center" prop="remarks" :show-overflow-tooltip="true">
......@@ -119,18 +120,19 @@
</template>
<script>
import { delSchedule, getSync, onSchedule } from '@/api/synchronization'
export default {
name: 'Index',
data() {
return {
loading: false,
badList: [],
// 日期范围
dateRange: [],
queryParams: {
page: 1,
rows: 10,
synchronizationTime: '',
startTime: '',
endTime: ''
rows: 10
},
total: 0
}
......@@ -155,7 +157,12 @@ export default {
},
methods: {
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() {
this.queryParams.page = 1
......@@ -164,26 +171,40 @@ export default {
resetQuery() {
this.queryParams.rows = 10
this.queryParams.page = 1
this.queryParams.synchronizationTime = undefined
this.dateRange = []
this.handleQuery()
},
handleDelete() {
handleDelete(row) {
this.$confirm('所选择数据被删除后不可再恢复,是否继续?', '提示', {
confirmButtonText: '确定 Confirm',
cancelButtonText: '取消 Cancel',
cancelButtonClass: 'btn-custom-cancel',
type: 'warning'
}).then(function() {
console.log('删除')
}).then(() => {
return delSchedule(row.businessId)
}).then(() => {
this.getList()
this.$message({
message: '删除成功',
type: 'success'
})
}).catch()
},
// 同步物料
handleMaterial() {
console.log('同步物料')
const type = 1
onSchedule(type).then(res => {
this.$message.success('操作成功,请稍后查看结果')
this.getList()
})
},
// 同步工单
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