wagonUnLoadAdd.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <template>
  2. <!-- 添加车皮卸车实绩 -->
  3. <div class="addWagonLoad">
  4. <page-title>返回</page-title>
  5. <div class="main">
  6. <el-divider content-position="left"></el-divider>
  7. </div>
  8. <div>
  9. <div class="search" style="display:flex">
  10. <div style="margin-top: 18px;margin-left:10px">
  11. <el-label>车皮号:</el-label>
  12. </div>
  13. <el-input
  14. placeholder="请输入"
  15. v-model="wagon"
  16. style="margin: 10px; width:10%"
  17. clearable
  18. ></el-input>
  19. <div style="margin-top: 18px;margin-left:10px">
  20. <el-label>订单号:</el-label>
  21. </div>
  22. <el-input
  23. placeholder="请输入"
  24. v-model="purchaseOrderNum"
  25. style="margin: 10px; width:10%"
  26. clearable
  27. ></el-input>
  28. <div style="margin-top: 18px;margin-left:10px">
  29. <el-label>物资名:</el-label>
  30. </div>
  31. <el-input
  32. placeholder="请输入"
  33. v-model="materialName"
  34. style="margin: 10px;width:10%"
  35. clearable
  36. ></el-input>
  37. <el-button
  38. type="primary"
  39. class="btn"
  40. @click="searchOrder()"
  41. style="margin: 10px;">
  42. <i class="el-icon-search"></i>查询
  43. </el-button>
  44. </div>
  45. <dilTable
  46. v-bind.sync="option"
  47. ref="table"
  48. @selection-change="selectionChange"
  49. >
  50. </dilTable>
  51. </div>
  52. <div class="forwardingUnit item">
  53. <span class="text">卸货点:</span>
  54. <el-input v-model="unloadPointName" disabled> </el-input>
  55. <el-button type="primary" @click="ondrawer(3)">浏览</el-button>
  56. </div>
  57. <div class="form">
  58. <div class="form_box" style="margin-right: 10rem">
  59. <dil-form :formId="255" v-model="form1" ref="from1"></dil-form>
  60. </div>
  61. </div>
  62. <div class="button-box">
  63. <el-button @click="cancel">取消</el-button>
  64. <el-button type="primary" @click="makeSure">确定</el-button>
  65. </div>
  66. <!-- 模态窗口 -->
  67. <el-drawer :visible.sync="drawer" :direction="direction" size="30%">
  68. <el-input
  69. placeholder="请输入内容"
  70. v-model="inputText"
  71. style="margin-top: 0rem; margin-right: 0.1rem; width: 230px"
  72. clearable
  73. ></el-input>
  74. <el-button
  75. type="primary"
  76. class="btn"
  77. @click="searchUnLoadPoint()"
  78. style="margin-bottom: 0.9375rem">
  79. <i class="el-icon-search"></i>查询
  80. </el-button>
  81. <div>
  82. <dilTable
  83. v-bind.sync="unloadPoint"
  84. @radio-change="currentRadioChange"
  85. ></dilTable>
  86. </div>
  87. </el-drawer>
  88. </div>
  89. </template>
  90. <script>
  91. import PageTitle from "@/components/Page/Title";
  92. import { sjTime } from "@/utils/sharedJsFile";
  93. import { getCookie } from "@/utils/util.js";
  94. export default {
  95. components: { PageTitle },
  96. data() {
  97. return {
  98. form1: {},
  99. inputText:null,
  100. drawer:false,
  101. unloadPoint:null,
  102. wagon:null,
  103. purchaseOrderNum:null,
  104. materialName:null,
  105. direction: "rtl",
  106. unloadPointId:null,
  107. unloadPointName:null,
  108. option: {
  109. // 表格请求数据的地址
  110. requestUrl: "/api/v1/tms/getWagonNo/3?apiId=213",
  111. // 控制显示当选列
  112. selectionType: "select",
  113. },
  114. unloadPoint: {
  115. requestUrl: "/api/v1/uc/getUnloadingMesByLike?apiId=374",
  116. selectionType: "radio",
  117. },
  118. value: undefined,
  119. list: [],
  120. };
  121. },
  122. mounted() {
  123. this.form1.resultArrivalDate=new Date();
  124. this.form1.resultUnloadTime=new Date();
  125. },
  126. // created() {
  127. // this.form1 = {
  128. // arrivalStationId: 1,
  129. // };
  130. // },
  131. methods: {
  132. searchOrder(){
  133. let requestUrl="/api/v1/tms/getWagonNo/3?apiId=213";
  134. if(typeof this.wagon !='undefined' && this.wagon!=null){
  135. requestUrl+=("&wagon="+this.wagon);
  136. }
  137. if(typeof this.purchaseOrderNum !='undefined' && this.purchaseOrderNum!=null){
  138. requestUrl+=("&purchaseOrderNum="+this.purchaseOrderNum);
  139. }
  140. if(typeof this.materialName !='undefined' && this.materialName!=null){
  141. requestUrl+=("&materialName="+this.materialName);
  142. }
  143. this.option.requestUrl=requestUrl;
  144. },
  145. ondrawer() {
  146. this.drawer = true;
  147. },
  148. searchUnLoadPoint(){
  149. this.unloadPoint.requestUrl =
  150. "/api/v1/uc/getUnloadingMesByLike?apiId=374&index=" + this.inputText;
  151. },
  152. currentRadioChange(selection){
  153. this.unloadPointId = selection.warehouseId;
  154. this.unloadPointName = selection.warehouseName;
  155. console.log(this.unloadPointId);
  156. },
  157. selectionChange(selection) {
  158. this.list = [];
  159. selection.forEach((e) => {
  160. this.list.push({
  161. resultWagonNo: e.resultWagonNo,
  162. resultId: e.resultId,
  163. purchaseOrderId: e.purchaseOrderId,
  164. unloadingPointId: e.unloadingPointId,
  165. });
  166. });
  167. },
  168. // 确定
  169. makeSure() {
  170. let tmstrainWagonUnloadResult = {
  171. wagonNoList: this.list,
  172. resultArrivalDate: sjTime(this.form1.resultArrivalDate),
  173. resultUnloadTime: sjTime(this.form1.resultUnloadTime),
  174. resultRemark: this.form1.resultRemark,
  175. unloadingPointId:this.unloadPointId,
  176. insertUsername:getCookie("userId"),
  177. resultType: 3,
  178. };
  179. console.log(tmstrainWagonUnloadResult);
  180. if (
  181. tmstrainWagonUnloadResult.wagonNoList == null ||
  182. tmstrainWagonUnloadResult.wagonNoList.length <=0 ||
  183. tmstrainWagonUnloadResult.resultArrivalDate == null ||
  184. tmstrainWagonUnloadResult.resultUnloadTime == null ||
  185. tmstrainWagonUnloadResult.unloadingPointId ==null
  186. )
  187. this.$message.error("请填写完整信息!");
  188. else
  189. this.axios
  190. .post(
  191. "/api/v1/tms/insertTmstrainWagonUnLoadResult",
  192. tmstrainWagonUnloadResult
  193. )
  194. .then((res) => {
  195. if ((res.data.code = "200")) {
  196. this.$message({
  197. type: "success",
  198. message: "新增成功!",
  199. });
  200. this.$router.go(-1);
  201. } else {
  202. ({ type: "failed", message: "新增失败!" });
  203. }
  204. });
  205. },
  206. // 取消
  207. cancel() {
  208. this.$router.go(-1);
  209. },
  210. },
  211. };
  212. </script>
  213. <style lang='scss' scoped>
  214. .addWagonLoad {
  215. .form {
  216. display: flex;
  217. .form_box {
  218. width: 320px;
  219. margin-left: 35%;
  220. margin-top: 30px;
  221. margin-right: 22px;
  222. .el-form {
  223. .preview-group {
  224. .el-form-item {
  225. .el-form-item__label {
  226. display: inline-block;
  227. width: 70px !important;
  228. }
  229. .el-form-item__content {
  230. .el-select {
  231. width: 250px;
  232. }
  233. .el-input {
  234. width: 220px;
  235. }
  236. .el-textarea {
  237. .el-textarea__inner {
  238. width: 230px;
  239. // margin-left: 45px;
  240. margin-top: 0.03rem;
  241. }
  242. }
  243. }
  244. }
  245. }
  246. }
  247. }
  248. }
  249. .forwardingUnit {
  250. display: flex;
  251. justify-content: center;
  252. align-items: center;
  253. width: 320px;
  254. margin-left: 33%;
  255. margin-top: 30px;
  256. margin-right: 22px;
  257. .text {
  258. text-align: right;
  259. width: 8.125rem;
  260. }
  261. }
  262. .button-box {
  263. margin-left: 42%;
  264. margin-top: 25px;
  265. width: 300px;
  266. }
  267. }
  268. </style>