wagonLoadbu.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. <template>
  2. <div class="wagonLoadbu">
  3. <span> </span>
  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" style="margin-left: 60px; ">船名(备注):</span>
  22. <el-input v-model="remark" @blur="onBlur" style="width: 230px; margin-right:140px"> </el-input>
  23. <span class="span"></span>
  24. </div>
  25. <div class="form">
  26. <div class="form_box">
  27. <dil-form :formId="361" v-model="form1" ref="from1"></dil-form>
  28. </div>
  29. </div>
  30. <div class="button_box">
  31. <el-button @click="cancel">取消</el-button>
  32. <el-button type="primary" @click="makeSure">确定</el-button>
  33. </div>
  34. <!-- 模态窗口 -->
  35. <el-drawer :visible.sync="drawer" :direction="direction" size="30%">
  36. <el-input
  37. placeholder="请输入内容"
  38. v-model="inputText"
  39. style="margin-top: 10px; margin-left: 20px"
  40. clearable
  41. ></el-input>
  42. <el-button
  43. type="primary"
  44. class="btn"
  45. @click="onClick(a)"
  46. style="margin-bottom: 15px"
  47. >
  48. <i class="el-icon-search"></i>查询
  49. </el-button>
  50. <div v-show="a == 1">
  51. <dilTable
  52. v-bind.sync="frist"
  53. @radio-change="currentRadioChange1"
  54. ></dilTable>
  55. </div>
  56. <div v-show="a == 2">
  57. <dilTable
  58. v-bind.sync="secend"
  59. @radio-change="currentRadioChange2"
  60. ></dilTable>
  61. </div>
  62. </el-drawer>
  63. </div>
  64. </template>
  65. <script>
  66. export default {
  67. data() {
  68. return {
  69. form1: {},
  70. option: {
  71. // 表格请求数据的地址
  72. requestUrl: "/api/v1/tms/getTmstrainWagonLoad?apiId=209&resultType=10",
  73. // 控制显示多选列
  74. selectionType: "select",
  75. },
  76. //多选选中的数据
  77. selecTionListMap: [],
  78. //船名
  79. remark: null,
  80. //采购订单id
  81. purchaseOrderId: null,
  82. //物资名称
  83. materialName: null,
  84. //发货单位名称
  85. supplierName: null,
  86. //发货单位id
  87. supplierId: null,
  88. //物资id
  89. materialId: null,
  90. //是否需要打开模态窗口
  91. drawer: false,
  92. a: 1,
  93. direction: "rtl",
  94. inputText: "",
  95. frist: {
  96. requestUrl: "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050",
  97. selectionType: "radio",
  98. mapList1: [],
  99. },
  100. secend: {
  101. requestUrl:
  102. "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=",
  103. selectionType: "radio",
  104. mapList2: [],
  105. },
  106. unloadPoint: {
  107. requestUrl: "/api/v1/uc/getUnloadingMesByLike?apiId=374",
  108. selectionType: "radio",
  109. },
  110. };
  111. },
  112. methods: {
  113. //确定
  114. makeSure() {
  115. if(this.selecTionListMap.length <= 0){
  116. this.$message({
  117. message: "请选择需要补录的装车信息!",
  118. type: "warning",
  119. });
  120. }else{
  121. let map = {
  122. resultIdList:this.selecTionListMap,
  123. purchaseOrderId:this.purchaseOrderId,
  124. insertUpdateRemark: this.form1.insertUpdateRemark
  125. }
  126. this.axios.post('/api/v1/tms/updateDomesticLoadResult',map).then((res)=>{
  127. console.log(res.data.data)
  128. if(res.data.code == "200"){
  129. this.$message({
  130. message: "补录成功!",
  131. type: "success",
  132. });
  133. this.cancel();
  134. }
  135. })
  136. }
  137. },
  138. //取消
  139. cancel() {
  140. this.$router.push("/wagonLoadMine");
  141. },
  142. //表格选中
  143. selectionChange(selection) {
  144. this.selecTionListMap = [];
  145. selection.forEach(element => {
  146. this.selecTionListMap.push(element.resultId)
  147. });
  148. console.log( this.selecTionListMap)
  149. },
  150. currentRadioChange1(selection) {
  151. this.input = null;
  152. this.materialName = selection.materialName;
  153. this.materialId = selection.materialId;
  154. this.getPurchaseOrderNo();
  155. },
  156. currentRadioChange2(selection) {
  157. this.supplierName = selection.supplierName;
  158. this.supplierId = selection.supplierId;
  159. this.getPurchaseOrderNo();
  160. },
  161. ondrawer(num) {
  162. this.drawer = true;
  163. this.a = num;
  164. if (num == 2) {
  165. this.secend.requestUrl =
  166. "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=" +
  167. this.materialId;
  168. }
  169. },
  170. onBlur() {
  171. this.getPurchaseOrderNo();
  172. },
  173. getPurchaseOrderNo() {
  174. let map = {
  175. materialId: this.materialId,
  176. supplierId: this.supplierId,
  177. };
  178. if (this.remark) {
  179. map.remark = this.remark;
  180. }
  181. console.log(this.map);
  182. if (this.materialId && this.supplierId) {
  183. this.axios.post("/api/v1/oms/selectNewOrderId", map).then((res) => {
  184. console.log(res);
  185. if (res.data.code == "200") {
  186. if (res.data.data == null) {
  187. this.$message({
  188. message: "没有匹配的采购订单号!",
  189. type: "warning",
  190. });
  191. this.form1 = [];
  192. } else {
  193. this.remark = res.data.data.remark;
  194. this.purchaseOrderId = res.data.data.purchaseOrderId;
  195. this.form1 = { purchaseOrderNo: res.data.data.purchaseOrderNo };
  196. }
  197. } else {
  198. this.$message.error("请求失败");
  199. }
  200. });
  201. }
  202. },
  203. onClick(a) {
  204. if (a == 1) {
  205. this.frist.requestUrl =
  206. "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050&index=" +
  207. this.inputText;
  208. } else if (a == 2) {
  209. this.secend.requestUrl =
  210. "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=" +
  211. this.materialId +
  212. "&index=" +
  213. this.inputText;
  214. } else if (a == 4) {
  215. this.third.requestUrl =
  216. "/api/v1/uc/getUnloadingMesByLike?apiId=347&index=" + this.inputText;
  217. }
  218. },
  219. },
  220. };
  221. </script>
  222. <style lang="scss">
  223. .wagonLoadbu {
  224. color: #606266;
  225. font-size: 0.675rem;
  226. font-weight: 500;
  227. .cp {
  228. width: 49%;
  229. display: flex;
  230. justify-content: center;
  231. align-items: center;
  232. padding-top: 0.625rem;
  233. padding-bottom: 0.625rem;
  234. margin-left: 364px;
  235. .cp_title {
  236. .cp_top {
  237. width: 3.125rem;
  238. padding-right: 1.55rem;
  239. }
  240. }
  241. }
  242. .cpList {
  243. display: flex;
  244. justify-content: center;
  245. width: 100%;
  246. height: 10rem;
  247. .list {
  248. width: 45%;
  249. border: #000 0.0625rem solid;
  250. padding: 0.625rem;
  251. display: flex;
  252. flex-wrap: wrap;
  253. .cpList1 {
  254. background-color: #c9c7c7;
  255. height: 1.875rem;
  256. margin-right: 0.5rem;
  257. padding: 0.625rem;
  258. display: flex;
  259. align-items: center;
  260. justify-content: center;
  261. position: relative;
  262. .itu {
  263. position: absolute;
  264. top: -0.125rem;
  265. right: 0.0625rem;
  266. width: 0.625rem;
  267. height: 0.625rem;
  268. }
  269. }
  270. }
  271. }
  272. .matching {
  273. width: 100%;
  274. height: 3.125rem;
  275. display: flex;
  276. justify-content: center;
  277. align-items: center;
  278. .text {
  279. width: 8.75rem;
  280. }
  281. .span {
  282. display: inline-block;
  283. width: 310px;
  284. height: 0.0625rem;
  285. }
  286. }
  287. .material {
  288. display: flex;
  289. justify-content: center;
  290. align-items: center;
  291. height: 3.75rem;
  292. margin-left: 27rem;
  293. width: 20rem;
  294. .text {
  295. text-align: right;
  296. width: 8.125rem;
  297. }
  298. }
  299. .forwardingUnit {
  300. display: flex;
  301. justify-content: center;
  302. align-items: center;
  303. height: 3.75rem;
  304. margin-left: 27rem;
  305. width: 20rem;
  306. .text {
  307. text-align: right;
  308. width: 8.125rem;
  309. }
  310. }
  311. .remark {
  312. display: flex;
  313. justify-content: center;
  314. align-items: center;
  315. height: 3.75rem;
  316. .text {
  317. text-align: right;
  318. width: 5.625rem;
  319. }
  320. .span {
  321. display: inline-block;
  322. width: 1.875rem;
  323. height: 1.25rem;
  324. }
  325. .el-input{
  326. width: 13.5rem;
  327. margin-right: 2.375rem;
  328. }
  329. }
  330. .purchaseOrder {
  331. display: flex;
  332. justify-content: center;
  333. align-items: center;
  334. .span {
  335. display: inline-block;
  336. width: 1.875rem;
  337. height: 0.0625rem;
  338. }
  339. }
  340. .form {
  341. display: flex;
  342. .form_box {
  343. width: 340px;
  344. margin-left: 37%;
  345. margin-right: 20px;
  346. .el-form {
  347. .preview-group {
  348. .el-form-item {
  349. .el-form-item__label {
  350. display: inline-block;
  351. width: 70px !important;
  352. }
  353. .el-form-item__content {
  354. .el-select {
  355. width: 250px;
  356. }
  357. .el-input {
  358. width: 250px;
  359. }
  360. .el-textarea{
  361. .el-textarea__inner{
  362. width: 240px;
  363. margin-top: 0.03rem;
  364. }
  365. }
  366. }
  367. }
  368. }
  369. }
  370. }
  371. }
  372. .button_box {
  373. display: flex;
  374. justify-content: center;
  375. padding-top: 30px;
  376. }
  377. }
  378. </style>