wagonLoadbu.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530
  1. <template>
  2. <div class="wagonLoadbu">
  3. <page-title>返回</page-title>
  4. <div class="purchaseOrder_table">
  5. <div class="search" style="display:flex">
  6. <el-input
  7. placeholder="发货单位"
  8. v-model="supplierName"
  9. style="margin-top: 10px; margin-left: 20px; width: 150px"
  10. clearable
  11. >
  12. </el-input>
  13. <el-input
  14. placeholder="物资名"
  15. v-model="materialName"
  16. style="margin-top: 10px; margin-left: 20px; width: 150px"
  17. clearable
  18. >
  19. </el-input>
  20. <el-input
  21. placeholder="卸货地点"
  22. v-model="resultForeignShipName"
  23. style="margin-top: 10px; margin-left: 20px; width: 150px"
  24. clearable
  25. >
  26. </el-input>
  27. <el-button
  28. type="primary"
  29. class="btn"
  30. @click="searchOrder()"
  31. style="margin: 10px;">
  32. <i class="el-icon-search"></i>查询
  33. </el-button>
  34. <!-- <el-button
  35. type="primary"
  36. class="btn"
  37. @click="makeSure"
  38. style="margin: 10px;">确认配单
  39. </el-button> -->
  40. </div>
  41. <!-- 采购订单号 -->
  42. <dilTable
  43. v-bind.sync="purchaseOption"
  44. @radio-change="orderChange"
  45. ></dilTable>
  46. </div>
  47. <!-- <div class="material form">
  48. <span class="text">物资:</span>
  49. <el-input v-model="materialName" disabled> </el-input>
  50. <el-button type="primary" @click="ondrawer(1)">浏览</el-button>
  51. </div>
  52. <div class="forwardingUnit form">
  53. <span class="text">发货单位:</span>
  54. <el-input v-model="supplierName" disabled> </el-input>
  55. <el-button type="primary" @click="ondrawer(2)">浏览</el-button>
  56. </div>
  57. <div class="forwardingUnit form">
  58. <span class="text">卸货点:</span>
  59. <el-input v-model="unloadPointName" disabled> </el-input>
  60. <el-button type="primary" @click="ondrawer(3)">浏览</el-button>
  61. </div>
  62. <div class="remark form">
  63. <span class="text" >船名(备注):</span>
  64. <el-input v-model="remark" @blur="onBlur" > </el-input>
  65. <span class="span"></span>
  66. </div>
  67. <div class="form">
  68. <div class="form_box">
  69. <dil-form :formId="361" v-model="form1" ref="from1"></dil-form>
  70. </div>
  71. </div> -->
  72. <!--待补录表格-->
  73. <!-- <div class="wagonLoadbu_table">
  74. <dilTable
  75. v-bind.sync="option"
  76. @selection-change="selectionChange"
  77. @row-click="selectionChange"
  78. ></dilTable>
  79. </div> -->
  80. <!-- 模态窗口 -->
  81. <!-- <el-drawer :visible.sync="drawer" :direction="direction" size="30%">
  82. <el-input
  83. placeholder="请输入内容"
  84. v-model="inputText"
  85. style="margin-top: 10px; margin-left: 20px"
  86. clearable
  87. ></el-input>
  88. <el-button
  89. type="primary"
  90. class="btn"
  91. @click="onClick(a)"
  92. style="margin-bottom: 15px"
  93. >
  94. <i class="el-icon-search"></i>查询
  95. </el-button>
  96. <div v-show="a == 1">
  97. <dilTable
  98. v-bind.sync="frist"
  99. @radio-change="currentRadioChange1"
  100. ></dilTable>
  101. </div>
  102. <div v-show="a == 2">
  103. <dilTable
  104. v-bind.sync="secend"
  105. @radio-change="currentRadioChange2"
  106. ></dilTable>
  107. </div>
  108. <div v-show="a == 3">
  109. <dilTable
  110. v-bind.sync="unloadPoint"
  111. @radio-change="currentRadioChange3"
  112. ></dilTable>
  113. </div>
  114. </el-drawer> -->
  115. </div>
  116. </template>
  117. <script>
  118. import PageTitle from "@/components/Page/Title";
  119. import {getCookie} from "@/utils/util.js";
  120. export default {
  121. components: { PageTitle },
  122. data() {
  123. return {
  124. form1: {},
  125. con:null,
  126. purchaseOption:{
  127. // 表格请求数据的地址
  128. requestUrl: "/api/v1/tms/findPurchaseOrderList?apiId=81",
  129. // 控制选择单列
  130. selectionType: "radio",
  131. pageSize:5,
  132. },
  133. option: {
  134. // 表格请求数据的地址
  135. requestUrl: "/api/v1/tms/getTmstrainWagonLoad?apiId=209&resultType=10",
  136. // 控制显示多选列
  137. selectionType: "select",
  138. pageSize:10,
  139. },
  140. //查询用数据
  141. search1:null,
  142. search2:null,
  143. //多选选中的数据
  144. selecTionListMap: [],
  145. //船名
  146. remark: null,
  147. //采购订单id
  148. purchaseOrderId: null,
  149. //物资名称
  150. materialName: '',
  151. //发货单位名称
  152. supplierName: '',
  153. resultForeignShipName:'',
  154. //发货单位id
  155. supplierId: null,
  156. //物资id
  157. materialId: null,
  158. //物资选项
  159. materialNames:[],
  160. //发货单位选项
  161. supplierNames:[],
  162. //卸货点
  163. unloadPointId:null,
  164. unloadPointName:null,
  165. //是否需要打开模态窗口
  166. drawer: false,
  167. a: 1,
  168. direction: "rtl",
  169. inputText: "",
  170. frist: {
  171. requestUrl: "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050",
  172. selectionType: "radio",
  173. mapList1: [],
  174. },
  175. secend: {
  176. requestUrl:
  177. "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=",
  178. selectionType: "radio",
  179. mapList2: [],
  180. },
  181. unloadPoint: {
  182. requestUrl: "/api/v1/uc/getUnloadingMesByLike?apiId=374",
  183. selectionType: "radio",
  184. },
  185. };
  186. },
  187. mounted(){
  188. this.searchMaterialName('');
  189. },
  190. methods: {
  191. //确定
  192. makeSure() {
  193. if(this.selecTionListMap.length <= 0){
  194. this.$message({
  195. message: "请选择需要配单的装车信息!",
  196. type: "warning",
  197. });
  198. }else if(!this.purchaseOrderId){
  199. this.$message({
  200. message: "请选择采购订单!",
  201. type: "warning",
  202. });
  203. }
  204. else{
  205. let map = {
  206. resultIdList:this.selecTionListMap,
  207. purchaseOrderId:this.purchaseOrderId,
  208. userId:getCookie("userId")
  209. }
  210. console.log(map);
  211. let that=this;
  212. this.axios.post('/api/v1/tms/updateDomesticLoadResult',map).then((res)=>{
  213. console.log(res.data.data)
  214. if(res.data.code == "200"){
  215. this.$message({
  216. message: "配单成功!",
  217. type: "success",
  218. });
  219. that.tableChange();
  220. // this.cancel();//不退出
  221. }
  222. })
  223. }
  224. },
  225. //取消
  226. cancel() {
  227. this.$router.push("/wagonLoadMine");
  228. },
  229. //采购订单表格选中
  230. orderChange(selection){
  231. console.log(selection);
  232. this.purchaseOrderId=selection.purchaseOrderId;
  233. this.form1 = { purchaseOrderNo: selection.purchaseOrderNo };
  234. this.materialId=selection.materialId;
  235. this.materialName=selection.materialName;
  236. this.supplierId=selection.supplierId;
  237. this.supplierName=selection.supplierName;
  238. this.remark=selection.resultForeignShipName;
  239. },
  240. //表格选中
  241. selectionChange(selection) {
  242. this.selecTionListMap = [];
  243. selection.forEach(element => {
  244. this.selecTionListMap.push(element.resultId)
  245. });
  246. console.log( this.selecTionListMap)
  247. },
  248. currentRadioChange1(selection) {
  249. this.input = null;
  250. this.materialName = selection.materialName;
  251. this.materialId = selection.materialId;
  252. this.getPurchaseOrderNo();
  253. },
  254. currentRadioChange2(selection) {
  255. this.supplierName = selection.supplierName;
  256. this.supplierId = selection.supplierId;
  257. this.getPurchaseOrderNo();
  258. },
  259. currentRadioChange3(selection) {
  260. this.unloadPointId = selection.warehouseId;
  261. this.unloadPointName = selection.warehouseName;
  262. },
  263. ondrawer(num) {
  264. this.drawer = true;
  265. this.a = num;
  266. if (num == 2) {
  267. this.secend.requestUrl =
  268. "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=" +
  269. this.materialId;
  270. }
  271. },
  272. onBlur() {
  273. this.getPurchaseOrderNo();
  274. },
  275. getPurchaseOrderNo() {
  276. let map = {
  277. materialId: this.materialId,
  278. supplierId: this.supplierId,
  279. };
  280. if (this.remark) {
  281. map.remark = this.remark;
  282. }
  283. console.log(this.map);
  284. if (this.materialId && this.supplierId) {
  285. this.axios.post("/api/v1/oms/selectNewOrderId", map).then((res) => {
  286. console.log(res);
  287. if (res.data.code == "200") {
  288. if (res.data.data == null) {
  289. this.$message({
  290. message: "没有匹配的采购订单号!",
  291. type: "warning",
  292. });
  293. this.form1 = [];
  294. } else {
  295. this.remark = res.data.data.remark;
  296. this.purchaseOrderId = res.data.data.purchaseOrderId;
  297. this.form1 = { purchaseOrderNo: res.data.data.purchaseOrderNo };
  298. }
  299. } else {
  300. this.$message.error("请求失败");
  301. }
  302. });
  303. }
  304. },
  305. searchOrder(){
  306. //查询订单
  307. this.purchaseOption.requestUrl=
  308. "/api/v1/tms/findPurchaseOrderList?apiId=81&supplierName="+this.supplierName
  309. +"&materialName="+this.materialName
  310. +"&resultForeignShipName="+this.resultForeignShipName
  311. +"&i="+new Date();
  312. },
  313. onClick(a) {
  314. if (a == 1) {
  315. this.frist.requestUrl =
  316. "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050&index=" +
  317. this.inputText;
  318. } else if (a == 2) {
  319. this.secend.requestUrl =
  320. "/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId=" +
  321. this.materialId +
  322. "&index=" +
  323. this.inputText;
  324. } else if (a == 3) {
  325. this.third.requestUrl =
  326. "/api/v1/uc/getUnloadingMesByLike?apiId=347&index=" + this.inputText;
  327. }
  328. },
  329. searchMaterialName(index=''){
  330. //根据name查询物资名
  331. let that=this;
  332. that.axios.post("api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050&index="+index).then((res)=>{
  333. console.log(res);
  334. if (res.data.code == "200" && res.data.data) {
  335. that.materialNames=res.data.data.list;
  336. } else {
  337. this.$message.error("请求失败");
  338. }
  339. });
  340. },
  341. searchSupplierName(index=''){
  342. //根据name查询发货单位
  343. let that=this;
  344. that.axios.post("/api/v1/uc/getSupplierMesByMaterialId?apiId=247&materialId="+that.materialId+"&index="+index).then((res)=>{
  345. console.log(res);
  346. if (res.data.code == "200" && res.data.data) {
  347. that.supplierNames=res.data.data.list;
  348. }else{
  349. this.$message.error("请求失败");
  350. }
  351. });
  352. },
  353. tableChange(){
  354. //刷新表格
  355. this.option.requestUrl="/api/v1/tms/getTmstrainWagonLoad?apiId=209&resultType=10&i="+new Date();
  356. }
  357. },
  358. };
  359. </script>
  360. <style lang="scss">
  361. .wagonLoadbu {
  362. color: #606266;
  363. font-size: 0.675rem;
  364. font-weight: 500;
  365. .top {
  366. display: flex;
  367. margin:0.375rem;
  368. .el-select{
  369. width: 15%;
  370. // height: 2%;
  371. }
  372. .text {
  373. text-align: left;
  374. margin-top: 0.5rem;
  375. margin-left:0.375rem;
  376. }
  377. }
  378. .cp {
  379. width: 49%;
  380. display: flex;
  381. justify-content: center;
  382. align-items: center;
  383. padding-top: 0.625rem;
  384. padding-bottom: 0.625rem;
  385. margin-left: 364px;
  386. .cp_title {
  387. .cp_top {
  388. width: 3.125rem;
  389. padding-right: 1.55rem;
  390. }
  391. }
  392. }
  393. .cpList {
  394. display: flex;
  395. justify-content: center;
  396. width: 100%;
  397. height: 10rem;
  398. .list {
  399. width: 45%;
  400. border: #000 0.0625rem solid;
  401. padding: 0.625rem;
  402. display: flex;
  403. flex-wrap: wrap;
  404. .cpList1 {
  405. background-color: #c9c7c7;
  406. height: 1.875rem;
  407. margin-right: 0.5rem;
  408. padding: 0.625rem;
  409. display: flex;
  410. align-items: center;
  411. justify-content: center;
  412. position: relative;
  413. .itu {
  414. position: absolute;
  415. top: -0.125rem;
  416. right: 0.0625rem;
  417. width: 0.625rem;
  418. height: 0.625rem;
  419. }
  420. }
  421. }
  422. }
  423. .matching {
  424. width: 100%;
  425. height: 3.125rem;
  426. display: flex;
  427. justify-content: center;
  428. align-items: center;
  429. .text {
  430. width: 8.75rem;
  431. }
  432. .span {
  433. display: inline-block;
  434. width: 310px;
  435. height: 0.0625rem;
  436. }
  437. }
  438. .material {
  439. display: flex;
  440. justify-content: center;
  441. align-items: center;
  442. height: 3.75rem;
  443. margin-left: 27rem;
  444. width: 20rem;
  445. .text {
  446. text-align: right;
  447. width: 8.125rem;
  448. }
  449. }
  450. .forwardingUnit {
  451. display: flex;
  452. justify-content: center;
  453. align-items: center;
  454. height: 3.75rem;
  455. margin-left: 27rem;
  456. width: 20rem;
  457. .text {
  458. text-align: right;
  459. width: 8.125rem;
  460. }
  461. }
  462. .remark {
  463. display: flex;
  464. justify-content: center;
  465. align-items: center;
  466. height: 3.75rem;
  467. .text {
  468. text-align: right;
  469. width: 5.625rem;
  470. }
  471. .span {
  472. display: inline-block;
  473. width: 1.875rem;
  474. height: 1.25rem;
  475. }
  476. }
  477. .purchaseOrder {
  478. display: flex;
  479. justify-content: center;
  480. align-items: center;
  481. .span {
  482. display: inline-block;
  483. width: 1.875rem;
  484. height: 0.0625rem;
  485. }
  486. }
  487. .form {
  488. display: flex;
  489. width: 340px;
  490. margin-left:23rem;
  491. .form_box {
  492. .el-form {
  493. .preview-group {
  494. .el-form-item {
  495. .el-form-item__label {
  496. display: inline-block;
  497. width: 70px !important;
  498. }
  499. .el-form-item__content {
  500. .el-select {
  501. width: 250px;
  502. }
  503. .el-input {
  504. width: 250px;
  505. }
  506. .el-textarea{
  507. .el-textarea__inner{
  508. width: 250px;
  509. margin-top: 0.03rem;
  510. }
  511. }
  512. }
  513. }
  514. }
  515. }
  516. }
  517. }
  518. .button_box {
  519. display: flex;
  520. justify-content: center;
  521. margin: 30px;
  522. }
  523. }
  524. </style>