addWagonUnLoad.vue 7.3 KB

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