addWagonUnLoad.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  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. console.log("warehouse:",selection);
  148. this.unloadPointId = selection.warehouseId;
  149. this.unloadPointName = selection.warehouseName;
  150. },
  151. selectionChange(selection) {
  152. this.list = selection;
  153. console.log("list:",selection);
  154. },
  155. // 确定
  156. onClickConfirm() {
  157. let tmstrainWagonUnloadResult = {
  158. list: this.list,
  159. resultArrivalDate: sjTime(this.form1.resultArrivalDate),
  160. resultUnloadTime: sjTime(this.form1.resultUnloadTime),
  161. resultRemark: this.form1.resultRemark,
  162. unloadingPointId:this.unloadPointId,
  163. insertUsername:getCookie("userId"),
  164. resultType: 1,
  165. };
  166. console.log(tmstrainWagonUnloadResult);
  167. if (
  168. tmstrainWagonUnloadResult.list == null ||
  169. tmstrainWagonUnloadResult.resultArrivalDate == null ||
  170. tmstrainWagonUnloadResult.resultUnloadTime == null ||
  171. tmstrainWagonUnloadResult.list.length <=0 ||
  172. tmstrainWagonUnloadResult.unloadingPointId ==null
  173. )
  174. this.$message.error("请填写完整信息!");
  175. else
  176. this.axios
  177. .post(
  178. "/api/v1/tms/insertTmstrainWagonUnLoadResult",
  179. tmstrainWagonUnloadResult
  180. )
  181. .then((res) => {
  182. if ((res.data.code = "200")) {
  183. this.$message({
  184. type: "success",
  185. message: "新增成功!",
  186. });
  187. } else {
  188. ({ type: "failed", message: "新增失败!" });
  189. }
  190. this.$router.go(-1);
  191. });
  192. },
  193. // 取消
  194. onClickCancel() {
  195. this.$router.go(-1);
  196. },
  197. },
  198. };
  199. </script>
  200. <style lang='scss'>
  201. .contractDetails {
  202. .form {
  203. display: flex;
  204. .form_box {
  205. width: 340px;
  206. margin-left: 35%;
  207. margin-top: 30px;
  208. margin-right: 20px;
  209. .el-form {
  210. .preview-group {
  211. .el-form-item {
  212. .el-form-item__label {
  213. display: inline-block;
  214. width: 70px !important;
  215. }
  216. .el-form-item__content {
  217. .el-select {
  218. width: 250px;
  219. }
  220. .el-input {
  221. width: 250px;
  222. }
  223. .el-textarea {
  224. .el-textarea__inner {
  225. width: 230px;
  226. // margin-left: 45px;
  227. margin-top: 0.03rem;
  228. }
  229. }
  230. }
  231. }
  232. }
  233. }
  234. }
  235. }
  236. .button_box {
  237. margin-left: 42%;
  238. margin-top: 55px;
  239. }
  240. }
  241. .fromOther {
  242. margin-left: 34.5%;
  243. width: 50%;
  244. .inline-input {
  245. width: 300px;
  246. }
  247. }
  248. .forwardingUnit {
  249. display: flex;
  250. justify-content: center;
  251. align-items: center;
  252. width: 320px;
  253. margin-left: 33%;
  254. margin-top: 30px;
  255. margin-right: 22px;
  256. .text {
  257. text-align: right;
  258. width: 8.125rem;
  259. }
  260. }
  261. </style>