addSteelInbound.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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. console.log(this.input)
  99. this.first.requestUrl = "/api/v1/wms/getSteelMaterialModelList?apiId=447&warehouseId="+3+"&status="+1+"&con="+this.input
  100. }
  101. },
  102. ondrawer(num) {
  103. this.drawer = true;
  104. this.a = num;
  105. if(num==1){
  106. this.first.requestUrl = "/api/v1/wms/getSteelMaterialModelList?apiId=447&warehouseId="+3+"&status="+1+"&con="+""
  107. }
  108. },
  109. // 返回
  110. onClickCancel() {
  111. this.$router.push("/steel_inbound");
  112. },
  113. currentRadioChange1(selection) {
  114. console.log(selection);
  115. this.materialName = selection.materialName;
  116. this.max = selection.max;
  117. },
  118. currentRadioChange2(selection) {
  119. this.warehouseId = selection.warehouseId
  120. this.warehouseName = selection.warehouseName
  121. },
  122. // 确认
  123. onClickConfirm() {
  124. // console.log(this.warehouseId,this.materialCode,this.materialNumber);
  125. this.disabled = true
  126. this.axios.post("/api/v1/wms/insertReserved?warehouseId=" + 3 + "&materialCode=" + this.materialCode+"&materialSpecification="+this.materialSpecification+"&materialModel="+this.materialModel+ "&quantity=" + this.materialNumber ).then((res) => {
  127. console.log(res.data)
  128. if (res.data.code == "200") {
  129. this.$message({
  130. message: "预留成功!",
  131. type: "success",
  132. });
  133. this.disabled = false
  134. this.onClickCancel()
  135. this.$router.go(-1)
  136. }else if(res.data.code=="201"){
  137. this.$message({
  138. message:"预留的数量不正确",
  139. type:"faile",
  140. })
  141. }
  142. this.$router.go(-1)
  143. });
  144. },
  145. },
  146. };
  147. </script>
  148. <style lang="scss" scope>
  149. .addCheckWarehouse{
  150. .contractDetails {
  151. width: 100%;
  152. }
  153. .from {
  154. display: flex;
  155. align-items: center;
  156. justify-content: center;
  157. margin-top: 5px;
  158. margin-bottom: 20px;
  159. }
  160. .warehouse {
  161. display: flex;
  162. justify-content: center;
  163. margin-top: 20px;
  164. margin-right: 70px;
  165. .text {
  166. display: inline-block;
  167. width: 170px;
  168. text-align: right;
  169. }
  170. .input {
  171. width: 250px;
  172. margin-right: 20px;
  173. }
  174. }
  175. .material {
  176. display: flex;
  177. justify-content: center;
  178. margin-top: 20px;
  179. .text {
  180. display: inline-block;
  181. width: 170px;
  182. text-align: right;
  183. }
  184. .input {
  185. width: 250px;
  186. margin-right: 20px;
  187. }
  188. }
  189. .materialNumber {
  190. display: flex;
  191. justify-content: center;
  192. margin-top: 20px;
  193. margin-right: 70px;
  194. .text {
  195. display:inline-block;
  196. width: 170px;
  197. text-align: right;
  198. }
  199. .input {
  200. width: 250px;
  201. margin-right: 20px;
  202. }
  203. }
  204. .button_box {
  205. display: flex;
  206. justify-content: center;
  207. align-items: center;
  208. width: 100%;
  209. height: 100px;
  210. }
  211. }
  212. </style>