addRequirement.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. // 新增采购内转需求
  2. <template>
  3. <div id="endMaintenance">
  4. <page-title>新增需求</page-title>
  5. <div class="main">
  6. <span class="text">新增</span>
  7. <span class="a"></span>
  8. </div>
  9. <div>
  10. <div class="form-box f2">
  11. <el-form :inline="true" class="demo-form-inline">
  12. <el-form-item label="采购订单号">
  13. <el-input v-model="purchaseOrder" disabled> </el-input>
  14. </el-form-item>
  15. <el-form-item>
  16. <el-button type="primary" @click="ondrawer(1)">浏览</el-button>
  17. </el-form-item>
  18. </el-form>
  19. </div>
  20. <div class="form-box f3">
  21. <el-form :inline="true" class="demo-form-inline">
  22. <el-form-item label="外轮船名">
  23. <el-input v-model="foreignShipName" disabled> </el-input>
  24. </el-form-item>
  25. </el-form>
  26. </div>
  27. <div class="form-box f4">
  28. <el-form :inline="true" class="demo-form-inline">
  29. <el-form-item label="物资名称">
  30. <el-input v-model="materialName" disabled> </el-input>
  31. </el-form-item>
  32. </el-form>
  33. </div>
  34. <div class="form-box f5">
  35. <el-form :inline="true" class="demo-form-inline">
  36. <el-form-item label="用车地点">
  37. <el-input v-model="truckPoint" disabled> </el-input>
  38. </el-form-item>
  39. <el-form-item>
  40. <el-button type="primary" @click="ondrawer(2)">浏览</el-button>
  41. </el-form-item>
  42. </el-form>
  43. </div>
  44. <div class="form-box f5">
  45. <el-form :inline="true" class="demo-form-inline">
  46. <el-form-item label="卸货地点">
  47. <el-input v-model="truckPoint1" disabled> </el-input>
  48. </el-form-item>
  49. <el-form-item>
  50. <el-button type="primary" @click="ondrawer(3)">浏览</el-button>
  51. </el-form-item>
  52. </el-form>
  53. </div>
  54. <div class="form-box f5">
  55. <el-form :inline="true" class="demo-form-inline">
  56. <el-form-item label="装货月台">
  57. <el-input v-model="requirementPlatformName" disabled> </el-input>
  58. </el-form-item>
  59. <el-form-item>
  60. <el-button type="primary" @click="ondrawer(4)">浏览</el-button>
  61. </el-form-item>
  62. </el-form>
  63. </div>
  64. <div class="form-box">
  65. <dil-form :formId="300" v-model="form"></dil-form>
  66. </div>
  67. <el-drawer
  68. :visible.sync="drawer"
  69. :direction="direction"
  70. :before-close="handleClose"
  71. size="30%"
  72. >
  73. <el-input
  74. placeholder="请输入内容"
  75. v-model="input"
  76. style="margin-top: 10px; margin-left: 20px"
  77. clearable
  78. >
  79. </el-input>
  80. <el-button
  81. type="primary"
  82. class="btn"
  83. @click="onclick(a)"
  84. style="margin-bottom: 15px"
  85. >
  86. <i class="el-icon-search"></i>查询
  87. </el-button>
  88. <div v-show="a == 1">
  89. <dilTable
  90. v-bind.sync="second"
  91. @radio-change="currentRadioChange1"
  92. ></dilTable>
  93. </div>
  94. <div v-show="a == 2">
  95. <dilTable
  96. v-bind.sync="second1"
  97. @radio-change="currentRadioChange2"
  98. ></dilTable>
  99. </div>
  100. <div v-show="a == 3">
  101. <dilTable
  102. v-bind.sync="second2"
  103. @radio-change="currentRadioChange3"
  104. ></dilTable>
  105. </div>
  106. <div v-show="a == 4">
  107. <dilTable
  108. v-bind.sync="second3"
  109. @radio-change="currentRadioChange4"
  110. ></dilTable>
  111. </div>
  112. </el-drawer>
  113. </div>
  114. <div class="button-box">
  115. <el-button type="primary" @click="makeSure">确认新增</el-button>
  116. <el-button type="primary" @click="cancel">返回</el-button>
  117. </div>
  118. </div>
  119. </template>
  120. <script>
  121. import PageTitle from "@/components/Page/Title";
  122. import { sjTime } from "@/utils/sharedJsFile";
  123. export default {
  124. components: { PageTitle },
  125. data() {
  126. return {
  127. purchaseOrder: "",
  128. foreignShipName: "",
  129. materialName: "",
  130. a: 1,
  131. direction: "rtl",
  132. input: "",
  133. truckPoint: "",
  134. truckPoint1:'',
  135. requirementPlatformName: "",
  136. drawer: false,
  137. form: {},
  138. second: {
  139. requestUrl: "/api/v1/ams/getPurchaseIdByBatch?apiId=252",
  140. selectionType: "radio",
  141. mapList1: [],
  142. },
  143. second1: {
  144. requestUrl: "/api/v1/ams/getWareHouse?apiId=251",
  145. selectionType: "radio",
  146. mapList2: [],
  147. },
  148. second2 :{
  149. requestUrl: "/api/v1/ams/getWareHouse?apiId=251",
  150. selectionType: "radio",
  151. mapList3: [],
  152. },
  153. second3 :{
  154. requestUrl: "/api/v1/ams/getWareHouse?apiId=251",
  155. selectionType: "radio",
  156. mapList4: [],
  157. },
  158. };
  159. },
  160. methods: {
  161. ondrawer(num) {
  162. this.drawer = true;
  163. this.a = num;
  164. },
  165. handleClose(done) {
  166. done();
  167. },
  168. onclick(a) {
  169. if (a == 1) {
  170. this.second.requestUrl =
  171. "/api/v1/ams/getPurchaseIdByBatch?apiId=252&con=" + this.input;
  172. } else {
  173. this.second1.requestUrl =
  174. "/api/v1/ams/getWareHouse?apiId=251&con=" + this.input;
  175. }
  176. },
  177. currentRadioChange1(selection) {
  178. this.mapList1 = selection
  179. this.purchaseOrder = this.mapList1.purchaseOrderNo
  180. this.foreignShipName = this.mapList1.resultForeignShipName
  181. this.materialName = this.mapList1.materialName;
  182. },
  183. currentRadioChange2(selection) {
  184. this.mapList2 = selection
  185. this.truckPoint = this.mapList2.wareHouseName;
  186. },
  187. currentRadioChange3(selection) {
  188. this.mapList3 = selection
  189. this.truckPoint1 = this.mapList3.wareHouseName;
  190. },
  191. currentRadioChange4(selection) {
  192. this.mapList4 = selection
  193. this.requirementPlatformName = this.mapList4.wareHouseName;
  194. },
  195. // 新增
  196. makeSure() {
  197. let requiremnet = {
  198. purchaseOrderId: this.mapList1.purchaseOrderId,
  199. requiremntUnitId: this.mapList2.wareHouseId,
  200. capacityTypeId: this.form.capacityTypeId,
  201. materialWeight: this.form.materialWeight,
  202. materialNumber: this.form.materialNumber,
  203. requirementEstimatedDuration: this.form.requirementEstimatedDuration,
  204. requirementOverlimit: this.form.requirementOverlimit,
  205. requirementShipperId: this.form.requirementShipperId,
  206. requirementTruckTime: sjTime(this.form.requirementTruckTime),
  207. requirementType: this.form.requirementType,
  208. requirementWorkContent: this.form.requirementWorkContent,
  209. requirementWorkEnvironment: this.form.requirementWorkEnvironment,
  210. requirementWorkType: this.form.requirementWorkType,
  211. requirementUnloadUnitId:this.mapList3.wareHouseId,
  212. requirementPlatformId: this.mapList4.wareHouseId
  213. };
  214. console.log(requiremnet);
  215. this.axios
  216. .post("/api/v1/ams/addTruckRequirement", requiremnet)
  217. .then((res) => {
  218. if (res.data.code == 200) {
  219. this.$message({
  220. type: "success",
  221. message: "新增成功!",
  222. });
  223. this.$router.go(-1);
  224. } else {
  225. this.$message.error("新增失败!");
  226. }
  227. });
  228. },
  229. // 返回
  230. cancel() {
  231. this.$router.go(-1);
  232. },
  233. },
  234. };
  235. </script>
  236. <style lang="scss">
  237. .el-form-item{
  238. display: flex;
  239. }
  240. .form-box,
  241. .button-box
  242. {
  243. display: flex;
  244. text-align: center;
  245. align-items: center;
  246. justify-content: center;
  247. margin-top: 0.3125rem;
  248. margin-bottom: 1.25rem;
  249. }
  250. </style>