inwardContractMaterial.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <div class="inwardContractMaterial">
  3. <div class="top">
  4. <el-input placeholder="请输入物资名称" clearable></el-input>
  5. <el-button type="primary" @click="onclick">查询</el-button>
  6. <el-button type="primary" @click="onInsert">新增</el-button>
  7. </div>
  8. <div class="table">
  9. <dilTable v-bind.sync="option" ref="table">
  10. <el-table-column
  11. fixed="right"
  12. label="操作"
  13. width="200px"
  14. align="center"
  15. >
  16. <template slot-scope="scope">
  17. <el-button type="primary" @click="updateSomeData(scope.row)">修改</el-button>
  18. <el-button type="primary" @click="deleteSomeData(scope.row)">删除</el-button>
  19. </template>
  20. </el-table-column>
  21. </dilTable>
  22. </div>
  23. </div>
  24. </template>
  25. <script>
  26. export default {
  27. data() {
  28. return {
  29. option: {
  30. requestUrl: "/api/v1/rms/getInwardContractMaterial?apiId=482"
  31. }
  32. };
  33. },
  34. methods: {
  35. onInsert() {
  36. this.$router.push("/addInwardContractMaterial");
  37. },
  38. updateSomeData(row){
  39. this.$router.push({
  40. name:"editInwardContractMaterial",
  41. params:{
  42. materialTypeId:row.materialTypeId,
  43. materialTypeName:row.materialTypeName
  44. }
  45. })
  46. },
  47. deleteSomeData(row){
  48. let mapValue={
  49. materialTypeId:row.materialTypeId,
  50. materialTypeName:row.materialTypeName
  51. }
  52. this.$confirm("你确定要删除吗","提示",{
  53. confirmButtonText:"确定",
  54. cancelButtonText:"取消",
  55. type:"warning"
  56. }).then(()=>{
  57. this.axios.post("/api/v1/rms/deleteMaterialForInward", mapValue)
  58. .then((res)=>{
  59. if(res.data.code=='200'){
  60. this.$message.success("删除成功")
  61. this.$router.go(0)
  62. }
  63. })
  64. })
  65. .catch()
  66. },
  67. }
  68. };
  69. </script>
  70. <style lang="scss" scoped>
  71. .inwardContractMaterial {
  72. .top {
  73. .el-input {
  74. margin-top: 30px;
  75. margin-left: 30px;
  76. width: 250px;
  77. }
  78. }
  79. .table {
  80. margin-left: 30px;
  81. margin-top: 30px;
  82. }
  83. }
  84. </style>