更新前端
This commit is contained in:
@@ -42,3 +42,11 @@ export function delMaterial(id) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function deleteMaterial(id) {
|
||||
return request({
|
||||
url: '/work/material/delete/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -176,11 +176,20 @@
|
||||
|
||||
<el-button style="margin-right: 0;"
|
||||
@click="success"
|
||||
>确定</el-button>
|
||||
>确定
|
||||
</el-button>
|
||||
|
||||
<el-button style="margin-left: 20px;"
|
||||
@click="clear"
|
||||
>初始化</el-button>
|
||||
>初始化
|
||||
</el-button>
|
||||
|
||||
<el-button style="margin-left: 20px;"
|
||||
type="danger"
|
||||
@click="removeMaterial"
|
||||
:disabled="indexSelect!==0"
|
||||
>删除物料
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<div id="hxjx_popup" class="hxjx_popup" v-if="showFault">
|
||||
@@ -250,7 +259,8 @@ import {
|
||||
messageUpdate,
|
||||
updateResource
|
||||
} from '@/api/system/resource'
|
||||
import { getFaultMessage, newIP } from '@/api/system/common'
|
||||
import {getFaultMessage, newIP} from '@/api/system/common'
|
||||
import {deleteMaterial} from "../../../api/system/material";
|
||||
|
||||
export default {
|
||||
name: 'index',
|
||||
@@ -263,6 +273,7 @@ export default {
|
||||
dataList: [],
|
||||
indexSelect: 0,
|
||||
technologyId: '',
|
||||
selectMaterial: [],
|
||||
// 粗轧请求参数
|
||||
params: {
|
||||
state: 0,
|
||||
@@ -283,7 +294,6 @@ export default {
|
||||
if (this.dataList.length === 0) {
|
||||
alert('钽靶原料列表为空,不可提交')
|
||||
return
|
||||
// TODO 考虑原料列表队列问题 及上一批材料未处理完毕 又来了一批材料
|
||||
}
|
||||
let data = {
|
||||
batchId: this.dataList[0].batchId,
|
||||
@@ -296,15 +306,29 @@ export default {
|
||||
alert('钽靶原料成功提交至轧制')
|
||||
this.dataList = []
|
||||
|
||||
} else if(res.data===0){
|
||||
alert('提交失败,请检查工艺是否相同')
|
||||
}else if (res.data ===2){
|
||||
alert('提交失败,请检查此物料工艺是否存在于数据库中')
|
||||
} else if (res.data === 0) {
|
||||
alert('提交失败,检查是否存在物料')
|
||||
} else if (res.data === 2) {
|
||||
alert('提交成功,但工艺出现差异,已将差异物料提交异常')
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
removeMaterial() {
|
||||
if (this.indexSelect === 0) {
|
||||
return
|
||||
} else {
|
||||
this.$modal.confirm('是否确认删除钽靶编号为"' + this.dataList[this.indexSelect].id + '"的数据项?').then(function () {
|
||||
return deleteMaterial(this.dataList[this.indexSelect].id)
|
||||
}).then(() => {
|
||||
this.getDataList()
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 选择材料
|
||||
getTechnologyInfo(index) {
|
||||
this.indexSelect = index
|
||||
@@ -366,8 +390,10 @@ export default {
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
mounted() {
|
||||
}
|
||||
,
|
||||
mounted()
|
||||
{
|
||||
|
||||
clearInterval(this.intervalTime)
|
||||
|
||||
@@ -378,10 +404,12 @@ export default {
|
||||
this.getFault()
|
||||
this.getDataList() // 接口方法
|
||||
}, 3000)
|
||||
},
|
||||
created() {
|
||||
}
|
||||
,
|
||||
created()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user