Commit c937f05f authored by zhangyichen's avatar zhangyichen

完善生产模型

parent 25cc6096
...@@ -9,3 +9,11 @@ export function listModel(query) { ...@@ -9,3 +9,11 @@ export function listModel(query) {
params: query params: query
}) })
} }
// 删除
export function deleteLogicalId(data) {
return request({
url: '/nltmodel/deleteLogical/' + data.businessId,
method: 'delete',
})
}
...@@ -455,7 +455,9 @@ export default { ...@@ -455,7 +455,9 @@ export default {
// 物料查询类型 // 物料查询类型
materQueryType: '', materQueryType: '',
// 替换物料时 禁用自己的id判断 // 替换物料时 禁用自己的id判断
disabledId: '' disabledId: '',
// 物料已被选中但是可编辑多选且提前查的id组 用于回显替换物料 状态1的时候传值
selectMaterIdStr: ''
} }
}, },
watch: { watch: {
...@@ -592,6 +594,7 @@ export default { ...@@ -592,6 +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.openPartNo = true this.openPartNo = true
this.title = '选择成品料号' this.title = '选择成品料号'
this.type = '3' this.type = '3'
...@@ -604,6 +607,7 @@ export default { ...@@ -604,6 +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 = ''
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'
...@@ -621,6 +625,7 @@ export default { ...@@ -621,6 +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
}) })
} else { } else {
this.materIdList = [] this.materIdList = []
...@@ -656,7 +661,8 @@ export default { ...@@ -656,7 +661,8 @@ export default {
...this.queryParams, ...this.queryParams,
businessIdList: str, businessIdList: str,
totalType: this.materQueryType, totalType: this.materQueryType,
type: '' type: '',
selectMaterIdStr: this.selectMaterIdStr
} }
if (this.type === '3') { if (this.type === '3') {
params.type = '3' params.type = '3'
...@@ -1039,6 +1045,11 @@ export default { ...@@ -1039,6 +1045,11 @@ export default {
}) })
}, },
initData() { initData() {
for (let i = 0; i < this.positionList.length; i++) {
console.log(i)
this.positionList[i].sort = i
}
const data = { const data = {
materId: this.form.materId, materId: this.form.materId,
modelType: this.form.modelType, modelType: this.form.modelType,
......
...@@ -157,7 +157,7 @@ ...@@ -157,7 +157,7 @@
</template> </template>
<script> <script>
import { listModel } from '@/api/model' import { listModel, deleteLogicalId } from '@/api/model'
export default { export default {
name: 'ProductionModel', name: 'ProductionModel',
...@@ -224,6 +224,23 @@ export default { ...@@ -224,6 +224,23 @@ export default {
} }
}) })
}, },
// 删除生产模型
handleDelete(row) {
this.$confirm('确定删除该生产模型?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteLogicalId({ businessId: row.businessId }).then(res => {
this.$message({
type: 'success',
message: '删除成功!'
})
this.handleQuery()
})
}).catch(() => {
})
},
// 详情 // 详情
handleQueryInfo(row) { handleQueryInfo(row) {
this.$router.push({ this.$router.push({
......
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