addSteelInbound.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  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. materialNumber:null,
  68. //物资id
  69. materialId: null,
  70. //是否需要打开模态窗口
  71. drawer: false,
  72. a: 1,
  73. direction: "rtl",
  74. input: "",
  75. first: {
  76. requestUrl: "",
  77. selectionType: "radio",
  78. mapList1: [],
  79. },
  80. second: {
  81. requestUrl: "",
  82. selectionType:"radio"
  83. }
  84. };
  85. },
  86. watch: {
  87. drawer(val) {
  88. if (!val) {
  89. this.input = null;
  90. }
  91. },
  92. },
  93. created() {
  94. },
  95. methods: {
  96. onclick(a) {
  97. if (a == 1) {
  98. this.first.requestUrl =
  99. "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050&index=" +
  100. this.input;
  101. }
  102. },
  103. ondrawer(num) {
  104. this.drawer = true;
  105. this.a = num;
  106. if(num==1){
  107. this.first.requestUrl = "/api/v1/wms/getSteelMaterialModelList?apiId=443&warehouseId="+3+"&status="+1
  108. }
  109. },
  110. // 返回
  111. onClickCancel() {
  112. this.$router.push("/steel_checkWarehouse");
  113. },
  114. currentRadioChange1(selection) {
  115. console.log(selection);
  116. this.materialName = selection.materialName + selection.materialSpecification + '(' + selection.materialModel + ')' ;
  117. this.materialId = selection.materialId;
  118. this.materialCode = selection.materialCode;
  119. this.materialSpecification = selection.materialSpecification;
  120. this.materialModel = selection.materialModel;
  121. this.max = selection.max;
  122. },
  123. currentRadioChange2(selection) {
  124. this.warehouseId = selection.warehouseId
  125. this.warehouseName = selection.warehouseName
  126. },
  127. // 确认
  128. onClickConfirm() {
  129. // console.log(this.warehouseId,this.materialCode,this.materialNumber);
  130. this.disabled = true
  131. this.axios.post("/api/v1/wms/insertReserved?warehouseId=" + 3 + "&materialCode=" + this.materialCode+"&materialSpecification="+this.materialSpecification+"&materialModel="+this.materialModel+ "&quantity=" + this.materialNumber ).then((res) => {
  132. console.log(res.data)
  133. if (res.data.code == "200") {
  134. this.$message({
  135. message: "预留成功!",
  136. type: "success",
  137. });
  138. this.disabled = false
  139. this.onClickCancel()
  140. this.$router.go(-1)
  141. }else if(res.data.code=="201"){
  142. this.$message({
  143. message:"预留的数量不正确",
  144. type:"faile",
  145. })
  146. }
  147. this.$router.go(-1)
  148. });
  149. },
  150. },
  151. };
  152. </script>
  153. <style lang="scss" scope>
  154. .addCheckWarehouse{
  155. .contractDetails {
  156. width: 100%;
  157. }
  158. .from {
  159. display: flex;
  160. align-items: center;
  161. justify-content: center;
  162. margin-top: 5px;
  163. margin-bottom: 20px;
  164. }
  165. .warehouse {
  166. display: flex;
  167. justify-content: center;
  168. margin-top: 20px;
  169. margin-right: 70px;
  170. .text {
  171. display: inline-block;
  172. width: 170px;
  173. text-align: right;
  174. }
  175. .input {
  176. width: 250px;
  177. margin-right: 20px;
  178. }
  179. }
  180. .material {
  181. display: flex;
  182. justify-content: center;
  183. margin-top: 20px;
  184. .text {
  185. display: inline-block;
  186. width: 170px;
  187. text-align: right;
  188. }
  189. .input {
  190. width: 250px;
  191. margin-right: 20px;
  192. }
  193. }
  194. .materialNumber {
  195. display: flex;
  196. justify-content: center;
  197. margin-top: 20px;
  198. margin-right: 70px;
  199. .text {
  200. display:inline-block;
  201. width: 170px;
  202. text-align: right;
  203. }
  204. .input {
  205. width: 250px;
  206. margin-right: 20px;
  207. }
  208. }
  209. .button_box {
  210. display: flex;
  211. justify-content: center;
  212. align-items: center;
  213. width: 100%;
  214. height: 100px;
  215. }
  216. }
  217. </style>