Commit 9838e398 authored by zhangyichen's avatar zhangyichen

修改bug

parent 7af404a0
// 生产模型api // 生产模型api
import request from '@/utils/request' import request from '@/utils/request'
import Qs from 'qs'
// 分页查询列表 // 分页查询列表
export function listModel(query) { export function listModel(query) {
...@@ -35,3 +36,14 @@ export function queryNltIfsMaterialCopyByPagination(query) { ...@@ -35,3 +36,14 @@ export function queryNltIfsMaterialCopyByPagination(query) {
params: query params: query
}) })
} }
// 修改生产模型状态
export function updateStatus(data) {
const businessId = data.businessId
data = Qs.stringify(data)
return request({
url: '/nltmodel/updateStatus/' + businessId,
method: 'put',
data
})
}
...@@ -1000,9 +1000,15 @@ export default { ...@@ -1000,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() {
......
...@@ -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="handleCopy(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>
...@@ -236,7 +230,7 @@ ...@@ -236,7 +230,7 @@
</template> </template>
<script> <script>
import { listModel, deleteLogicalId, queryCopyNltModels, queryNltIfsMaterialCopyByPagination } from '@/api/model' import { listModel, deleteLogicalId, queryCopyNltModels, queryNltIfsMaterialCopyByPagination, updateStatus } from '@/api/model'
export default { export default {
name: 'ProductionModel', name: 'ProductionModel',
data() { data() {
...@@ -271,6 +265,29 @@ export default { ...@@ -271,6 +265,29 @@ 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() { submitChoicePart() {
if (this.addMaterialList.length < 1) { if (this.addMaterialList.length < 1) {
......
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