wagonLoadbu.vue 14 KB

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