wagonLoadbu.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  1. <template>
  2. <div class="wagonLoadbu">
  3. <el-divider content-position="left">选择需要补录的装车信息</el-divider>
  4. <div class="wagonLoadbu_table">
  5. <dilTable
  6. v-bind.sync="option"
  7. @selection-change="selectionChange"
  8. ></dilTable>
  9. </div>
  10. <div class="material from">
  11. <span class="text">物资:</span>
  12. <el-input v-model="materialName" disabled> </el-input>
  13. <el-button type="primary" @click="ondrawer(1)">浏览</el-button>
  14. </div>
  15. <div class="forwardingUnit from">
  16. <span class="text">发货单位:</span>
  17. <el-input v-model="supplierName" disabled> </el-input>
  18. <el-button type="primary" @click="ondrawer(2)">浏览</el-button>
  19. </div>
  20. <div class="remark from">
  21. <span class="text">船名:</span>
  22. <el-input v-model="remark" @blur="onBlur"> </el-input>
  23. <span class="span"></span>
  24. </div>
  25. <div class="forwardingUnit from">
  26. <span class="text">卸货点:</span>
  27. <el-input v-model="unloadPointName" disabled> </el-input>
  28. <el-button type="primary" @click="ondrawer(4)">浏览</el-button>
  29. </div>
  30. <div class="form">
  31. <dil-form :formId="361" v-model="form1" ref="from1"></dil-form>
  32. </div>
  33. <div class="button_box">
  34. <el-button @click="cancel">取消</el-button>
  35. <el-button type="primary" @click="makeSure">确定</el-button>
  36. </div>
  37. <!-- 模态窗口 -->
  38. <el-drawer :visible.sync="drawer" :direction="direction" size="30%">
  39. <el-input
  40. placeholder="请输入内容"
  41. v-model="inputText"
  42. style="margin-top: 10px; margin-left: 20px"
  43. clearable
  44. ></el-input>
  45. <el-button
  46. type="primary"
  47. class="btn"
  48. @click="onClick(a)"
  49. style="margin-bottom: 15px"
  50. >
  51. <i class="el-icon-search"></i>查询
  52. </el-button>
  53. <div v-show="a == 1">
  54. <dilTable
  55. v-bind.sync="frist"
  56. @radio-change="currentRadioChange1"
  57. ></dilTable>
  58. </div>
  59. <div v-show="a == 2">
  60. <dilTable
  61. v-bind.sync="secend"
  62. @radio-change="currentRadioChange2"
  63. ></dilTable>
  64. </div>
  65. <div v-show="a == 4">
  66. <dilTable
  67. v-bind.sync="unloadPoint"
  68. @radio-change="currentRadioChange4"
  69. ></dilTable>
  70. </div>
  71. </el-drawer>
  72. </div>
  73. </template>
  74. <script>
  75. export default {
  76. data() {
  77. return {
  78. form1: {},
  79. option: {
  80. // 表格请求数据的地址
  81. requestUrl: "/api/v1/tms/getTmstrainWagonLoad?apiId=209&resultType=10",
  82. // 控制显示多选列
  83. selectionType: "select",
  84. },
  85. //多选选中的数据
  86. selecTionListMap: [],
  87. //船名
  88. remark: null,
  89. //采购订单id
  90. purchaseOrderId: null,
  91. //物资名称
  92. materialName: null,
  93. //发货单位名称
  94. supplierName: null,
  95. //发货单位id
  96. supplierId: null,
  97. //物资id
  98. materialId: null,
  99. //是否需要打开模态窗口
  100. drawer: false,
  101. //卸货点id
  102. unloadPointId: null,
  103. //卸货点名称
  104. unloadPointName: null,
  105. a: 1,
  106. direction: "rtl",
  107. inputText: "",
  108. frist: {
  109. requestUrl: "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050",
  110. selectionType: "radio",
  111. mapList1: [],
  112. },
  113. secend: {
  114. requestUrl:
  115. "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=",
  116. selectionType: "radio",
  117. mapList2: [],
  118. },
  119. unloadPoint: {
  120. requestUrl: "/api/v1/uc/getUnloadingMesByLike?apiId=374",
  121. selectionType: "radio",
  122. },
  123. };
  124. },
  125. methods: {
  126. //确定
  127. makeSure() {
  128. if(this.selecTionListMap.length <= 0){
  129. this.$message({
  130. message: "请选择需要补录的装车信息!",
  131. type: "warning",
  132. });
  133. }else{
  134. let map = {
  135. resultIdList:this.selecTionListMap,
  136. unloadPointId:this.unloadPointId,
  137. purchaseOrderId:this.purchaseOrderId,
  138. insertUpdateRemark: this.form1.insertUpdateRemark
  139. }
  140. this.$axios.post('/api/v1/tms/updateDomesticLoadResult',map).then((res)=>{
  141. console.log(res.data.data)
  142. if(res.data.code == "200"){
  143. this.$message({
  144. message: "补录成功!",
  145. type: "success",
  146. });
  147. this.cancel();
  148. }
  149. })
  150. }
  151. },
  152. //取消
  153. cancel() {
  154. this.$router.push("/domesticMine/wagonLoad");
  155. },
  156. //表格选中
  157. selectionChange(selection) {
  158. this.selecTionListMap = [];
  159. selection.forEach(element => {
  160. this.selecTionListMap.push(element.resultId)
  161. });
  162. console.log( this.selecTionListMap)
  163. },
  164. currentRadioChange1(selection) {
  165. this.input = null;
  166. this.materialName = selection.materialName;
  167. this.materialId = selection.materialId;
  168. this.getPurchaseOrderNo();
  169. },
  170. currentRadioChange2(selection) {
  171. this.supplierName = selection.supplierName;
  172. this.supplierId = selection.supplierId;
  173. this.getPurchaseOrderNo();
  174. },
  175. currentRadioChange4(selection) {
  176. this.unloadPointId = selection.warehouseId;
  177. this.unloadPointName = selection.warehouseName;
  178. },
  179. ondrawer(num) {
  180. this.drawer = true;
  181. this.a = num;
  182. if (num == 2) {
  183. this.secend.requestUrl =
  184. "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=" +
  185. this.materialId;
  186. }
  187. },
  188. onBlur() {
  189. this.getPurchaseOrderNo();
  190. },
  191. getPurchaseOrderNo() {
  192. let map = {
  193. materialId: this.materialId,
  194. supplierId: this.supplierId,
  195. };
  196. if (this.remark) {
  197. map.remark = this.remark;
  198. }
  199. console.log(this.map);
  200. if (this.materialId && this.supplierId) {
  201. this.$axios.post("/api/v1/oms/selectNewOrderId", map).then((res) => {
  202. console.log(res);
  203. if (res.data.code == "200") {
  204. if (res.data.data == null) {
  205. this.$message({
  206. message: "没有匹配的采购订单号!",
  207. type: "warning",
  208. });
  209. this.form1 = [];
  210. } else {
  211. this.remark = res.data.data.remark;
  212. this.purchaseOrderId = res.data.data.purchaseOrderId;
  213. this.form1 = { purchaseOrderNo: res.data.data.purchaseOrderNo };
  214. }
  215. } else {
  216. this.$message.error("请求失败");
  217. }
  218. });
  219. }
  220. },
  221. onClick(a) {
  222. if (a == 1) {
  223. this.frist.requestUrl =
  224. "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050&index=" +
  225. this.inputText;
  226. } else if (a == 2) {
  227. this.secend.requestUrl =
  228. "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=" +
  229. this.materialId +
  230. "&index=" +
  231. this.inputText;
  232. } else if (a == 4) {
  233. this.third.requestUrl =
  234. "/api/v1/uc/getUnloadingMesByLike?apiId=347&index=" + this.inputText;
  235. }
  236. },
  237. },
  238. };
  239. </script>
  240. <style lang="scss">
  241. .wagonLoadbu {
  242. .material {
  243. display: flex;
  244. justify-content: center;
  245. align-items: center;
  246. height: 3.75rem;
  247. .text {
  248. text-align: right;
  249. width: 150px;
  250. }
  251. }
  252. .forwardingUnit {
  253. display: flex;
  254. justify-content: center;
  255. align-items: center;
  256. height: 3.75rem;
  257. .text {
  258. text-align: right;
  259. width: 9.375rem;
  260. }
  261. }
  262. .remark {
  263. display: flex;
  264. justify-content: center;
  265. align-items: center;
  266. height: 3.75rem;
  267. .text {
  268. text-align: right;
  269. width: 80px;
  270. }
  271. }
  272. .form {
  273. margin-top: 1.25rem;
  274. display: flex;
  275. justify-content: center;
  276. }
  277. .button_box {
  278. width: 100%;
  279. height: 6.25rem;
  280. display: flex;
  281. justify-content: center;
  282. align-items: center;
  283. }
  284. }
  285. </style>