addSteelReserved.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <template>
  2. <!-- 新增预留转入库作业页面 -->
  3. <div class="addCheckWarehouse">
  4. <page-title>预留转入库作业</page-title>
  5. <div class="material from">
  6. <span class="text">物资规格型号:</span>
  7. <el-input class="input" v-model="materialName" disabled> </el-input>
  8. <el-button type="primary" @click="ondrawer(1)">浏览</el-button>
  9. </div>
  10. <div class="materialNumber from">
  11. <span class="text">最大预留件数:</span>
  12. <el-input class="input" v-model="max" disabled> </el-input>
  13. </div>
  14. <div class="materialNumber from">
  15. <span class="text">件数:</span>
  16. <el-input class="input" v-model="materialNumber"> </el-input>
  17. </div>
  18. <!-- 模态窗口 -->
  19. <el-drawer :visible.sync="drawer" :direction="direction" size="40%">
  20. <div style="margin-bottom: 10px">
  21. <el-input
  22. placeholder="请输入内容"
  23. v-model="input"
  24. style="margin-top: 10px; margin-right: 10px; width: 250px"
  25. clearable
  26. ></el-input>
  27. <el-button type="primary" class="btn" @click="onclick(a)">
  28. <i class="el-icon-search"></i>查询
  29. </el-button>
  30. </div>
  31. <div v-show="a == 1">
  32. <dilTable
  33. v-bind.sync="first"
  34. @radio-change="currentRadioChange1"
  35. ></dilTable>
  36. </div>
  37. <div v-show="a == 2">
  38. <dilTable
  39. v-bind.sync="second"
  40. @radio-change="currentRadioChange2"
  41. ></dilTable>
  42. </div>
  43. </el-drawer>
  44. <div class="button_box">
  45. <el-button @click="onClickCancel">返回</el-button>
  46. <el-button type="primary" @click="onClickConfirm" :disabled = "disabled">确认</el-button>
  47. </div>
  48. </div>
  49. </template>
  50. <script>
  51. import PageTitle from "@/components/Page/Title";
  52. import { sjTime, isNumber, isIntegerNumber } from "@/utils/sharedJsFile";
  53. import { getCookie } from "@/utils/util.js";
  54. export default {
  55. components: { PageTitle },
  56. data() {
  57. return {
  58. max:null,
  59. disabled:false,
  60. //仓库名称
  61. warehouseName:null,
  62. //物资名称
  63. materialName: null,
  64. //物资编码
  65. materialCode:null,
  66. // 物资规格
  67. materialSpecification:null,
  68. // 物资型号
  69. materialModel:null,
  70. //盘点数量
  71. materialNumber:null,
  72. //物资id
  73. materialId: null,
  74. //是否需要打开模态窗口
  75. drawer: false,
  76. a: 1,
  77. direction: "rtl",
  78. input: "",
  79. first: {
  80. requestUrl: "",
  81. selectionType: "radio",
  82. mapList1: [],
  83. },
  84. second: {
  85. requestUrl: "",
  86. selectionType:"radio"
  87. }
  88. };
  89. },
  90. watch: {
  91. drawer(val) {
  92. if (!val) {
  93. this.input = null;
  94. }
  95. },
  96. },
  97. created() {
  98. },
  99. methods: {
  100. onclick(a) {
  101. if (a == 1) {
  102. this.first.requestUrl = "/api/v1/wms/getSteelMaterialModelList?apiId=447&warehouseId="+3+"&status="+2+"&con="+this.input
  103. }
  104. },
  105. ondrawer(num) {
  106. this.drawer = true;
  107. this.a = num;
  108. if(num==1){
  109. this.first.requestUrl = "/api/v1/wms/getSteelMaterialModelList?apiId=447&warehouseId="+3+"&status="+2+"&con="+""
  110. }
  111. },
  112. // 返回
  113. onClickCancel() {
  114. this.$router.push("/steel_reserved");
  115. },
  116. currentRadioChange1(selection) {
  117. console.log(selection);
  118. this.materialName = selection.materialName + selection.materialSpecification + '(' + selection.materialModel + ')' ;
  119. this.materialId = selection.materialId;
  120. this.materialCode = selection.materialCode;
  121. this.materialSpecification = selection.materialSpecification;
  122. this.materialModel = selection.materialModel;
  123. this.max = selection.max;
  124. },
  125. currentRadioChange2(selection) {
  126. this.warehouseId = selection.warehouseId
  127. this.warehouseName = selection.warehouseName
  128. },
  129. // 确认
  130. onClickConfirm() {
  131. // console.log(this.warehouseId,this.materialCode,this.materialNumber);
  132. this.disabled = true
  133. this.axios.post("/api/v1/wms/insertInbounds?warehouseId=" + 3 + "&materialCode=" + this.materialCode+"&materialSpecification="+this.materialSpecification+"&materialModel="+this.materialModel+ "&quantity=" + this.materialNumber ).then((res) => {
  134. console.log(res.data)
  135. if (res.data.code == "200") {
  136. this.$message({
  137. message: "入库成功!",
  138. type: "success",
  139. });
  140. this.disabled = false
  141. this.onClickCancel()
  142. this.$router.go(-1)
  143. }else if(res.data.code=="201"){
  144. this.$message({
  145. message:"入库的数量不正确",
  146. type:"faile",
  147. })
  148. }
  149. this.$router.go(-1)
  150. });
  151. },
  152. },
  153. };
  154. </script>
  155. <style lang="scss" scope>
  156. .addCheckWarehouse{
  157. .contractDetails {
  158. width: 100%;
  159. }
  160. .from {
  161. display: flex;
  162. align-items: center;
  163. justify-content: center;
  164. margin-top: 5px;
  165. margin-bottom: 20px;
  166. }
  167. .warehouse {
  168. display: flex;
  169. justify-content: center;
  170. margin-top: 20px;
  171. margin-right: 70px;
  172. .text {
  173. display: inline-block;
  174. width: 170px;
  175. text-align: right;
  176. }
  177. .input {
  178. width: 250px;
  179. margin-right: 20px;
  180. }
  181. }
  182. .material {
  183. display: flex;
  184. justify-content: center;
  185. margin-top: 20px;
  186. .text {
  187. display: inline-block;
  188. width: 170px;
  189. text-align: right;
  190. }
  191. .input {
  192. width: 250px;
  193. margin-right: 20px;
  194. }
  195. }
  196. .materialNumber {
  197. display: flex;
  198. justify-content: center;
  199. margin-top: 20px;
  200. margin-right: 70px;
  201. .text {
  202. display:inline-block;
  203. width: 170px;
  204. text-align: right;
  205. }
  206. .input {
  207. width: 250px;
  208. margin-right: 20px;
  209. }
  210. }
  211. .button_box {
  212. display: flex;
  213. justify-content: center;
  214. align-items: center;
  215. width: 100%;
  216. height: 100px;
  217. }
  218. }
  219. </style>