Commit 083f68d7 authored by zhangyichen's avatar zhangyichen

生产模型提交

parent e0c716fd
......@@ -17,3 +17,12 @@ export function deleteLogicalId(data) {
method: 'delete',
})
}
// 复制
export function queryCopyNltModels(params) {
return request({
url: '/nltmodel/queryCopyNltModels',
method: 'get',
params
})
}
This diff is collapsed.
......@@ -657,6 +657,9 @@ export default {
if (this.type === '2') {
this.materQueryType = ''
}
if (this.type === '1') {
str = this.materIdListType1.join(',')
}
const params = {
...this.queryParams,
businessIdList: str,
......@@ -1045,7 +1048,6 @@ export default {
})
},
initData() {
for (let i = 0; i < this.positionList.length; i++) {
console.log(i)
this.positionList[i].sort = i
......
......@@ -126,7 +126,7 @@
size="mini"
type="danger"
style="margin-left: 10px"
@click="handleDelete(scope.row)"
@click="handleCopy(scope.row)"
>复制</el-link>
<el-link
size="mini"
......@@ -153,25 +153,114 @@
</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 } from '@/api/model'
import { listMaterial } from '@/api/material'
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 +272,41 @@ export default {
this.getList()
},
methods: {
// 确定关闭选择成品料号弹窗
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 +348,22 @@ 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
listMaterial(this.queryParam).then(res => {
this.selectPartNum = res.rows
this.totalMater = res.total
this.loadingCode = false
})
},
// 删除生产模型
handleDelete(row) {
this.$confirm('确定删除该生产模型?', '提示', {
......@@ -250,13 +390,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;
......
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