addInwardBillet.vue 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  1. // 新增内转钢坯需求
  2. <template>
  3. <div class="inwardRequirement">
  4. <page-title>新增需求</page-title>
  5. <div>
  6. <!-- 用车单位 -->
  7. <div class="requireUnit form">
  8. <el-form class="demo-form-inline" label-width="80px">
  9. <el-form-item label="用车单位">
  10. <el-input
  11. class="inline-input"
  12. v-model="requireUnitName"
  13. disabled
  14. >
  15. </el-input>
  16. </el-form-item>
  17. <el-form-item label="炉号">
  18. <el-input
  19. class="inline-input"
  20. v-model="heatNo"
  21. >
  22. </el-input>
  23. </el-form-item>
  24. <el-form-item label="需求类型">
  25. <el-input
  26. class="inline-input"
  27. v-model="requirementType"
  28. disabled
  29. >
  30. </el-input>
  31. </el-form-item>
  32. <el-form-item label="选择班别">
  33. <el-select
  34. class="inline-select"
  35. v-model="clazz"
  36. >
  37. <el-option
  38. v-for="item in options"
  39. :key="item.value"
  40. :label="item.value"
  41. :value="item.value">
  42. </el-option>
  43. </el-select>
  44. </el-form-item>
  45. <el-form-item label="选择钢种">
  46. <el-select
  47. class="inline-select"
  48. v-model="type"
  49. >
  50. <el-option
  51. v-for="item in options1"
  52. :key="item.value"
  53. :label="item.value"
  54. :value="item.value">
  55. </el-option>
  56. </el-select>
  57. </el-form-item>
  58. <el-form-item label="选择规格">
  59. <el-select
  60. class="inline-select"
  61. v-model="model"
  62. >
  63. <el-option
  64. v-for="item in options2"
  65. :key="item.value"
  66. :label="item.value"
  67. :value="item.value">
  68. </el-option>
  69. </el-select>
  70. </el-form-item>
  71. <!-- 车辆我设为多选了,我觉得会省事,他们应该不希望每台车都做一次 -->
  72. <el-form-item label="选择车辆">
  73. <el-select
  74. class="inline-select"
  75. v-model="capacityId"
  76. multiple
  77. >
  78. <el-option
  79. v-for="item in optionsCapacity"
  80. :key="item.capacityId"
  81. :label="item.capacityNumber"
  82. :value="item.capacityId">
  83. </el-option>
  84. </el-select>
  85. </el-form-item>
  86. <el-form-item label="选择装货点">
  87. <el-select
  88. class="inline-select"
  89. v-model="loadPoint"
  90. >
  91. <el-option
  92. v-for="item in optionsLoad"
  93. :key="item.warehouseId"
  94. :label="item.warehouseName"
  95. :value="item.warehouseId">
  96. </el-option>
  97. </el-select>
  98. </el-form-item>
  99. <el-form-item label="选择卸货点">
  100. <el-select
  101. class="inline-select"
  102. v-model="unloadPoint"
  103. >
  104. <el-option
  105. v-for="item in optionsUnload"
  106. :key="item.warehouseId"
  107. :label="item.warehouseName"
  108. :value="item.warehouseId">
  109. </el-option>
  110. </el-select>
  111. </el-form-item>
  112. </el-form>
  113. </div>
  114. </div>
  115. <div class="button-box">
  116. <el-button type="primary" @click="makeSure">确认新增</el-button>
  117. <el-button type="primary" @click="cancel">返回</el-button>
  118. </div>
  119. </div>
  120. </template>
  121. <script>
  122. import PageTitle from '@/components/Page/Title'
  123. import { sjTime } from '@/utils/sharedJsFile'
  124. import { getCookie } from '@/utils/util.js'
  125. import { checkTel } from '@/utils/validator.js'
  126. import returnResultVue from '../offsetSteel/truckTransport/returnResult.vue'
  127. export default {
  128. components: { PageTitle },
  129. data() {
  130. return {
  131. requireUnitId:null,
  132. requireUnitName:null,
  133. heatNo:null,
  134. requirementType:"计重",
  135. clazz:null,
  136. type:null,
  137. model:null,
  138. capacityId:null,
  139. loadPoint:null,
  140. unloadPoint:null,
  141. options: [{
  142. value:"甲"
  143. },{
  144. value:"乙"
  145. },{
  146. value:"丙"
  147. }
  148. ],
  149. options1: [{
  150. value:"Q215"
  151. },{
  152. value:"HPB300"
  153. },{
  154. value:"HRB400E"
  155. },{
  156. value:"HRB400"
  157. },{
  158. value:"HRB500"
  159. },{
  160. value:"HRB500E"
  161. },{
  162. value:"HRB600"
  163. }
  164. ],
  165. options2: [{
  166. value:"Φ16"
  167. },{
  168. value:"Φ6.5"
  169. },{
  170. value:"Φ6"
  171. },{
  172. value:"Φ8"
  173. },{
  174. value:"Φ10"
  175. },{
  176. value:"Φ12"
  177. },{
  178. value:"Φ14"
  179. },{
  180. value:"Φ16"
  181. },{
  182. value:"Φ36"
  183. },{
  184. value:"Φ40"
  185. }
  186. ],
  187. capacityArr:['场S74348','场S74976','场S73321','场S16586','场S00859'],
  188. optionsCapacity:[],
  189. optionsLoad:[],
  190. optionsUnload:[],
  191. }
  192. },
  193. mounted(){
  194. this.getRequireUnit();
  195. this.getLoadPoint();
  196. this.getUnloadPoint();
  197. this.getCapacity();
  198. },
  199. methods: {
  200. //获取炼钢厂连铸车间
  201. getRequireUnit(){
  202. this.axios
  203. .post('/api/v1/uc/getRequireUnitName?index=炼钢厂连铸车间')
  204. .then(res => {
  205. if (res.data.code == '200') {
  206. this.requireUnitId = res.data.data[0].shipperId
  207. this.requireUnitName = res.data.data[0].shipperName
  208. }
  209. })
  210. },
  211. //查询装货点
  212. getLoadPoint(){
  213. this.axios
  214. .post('/api/v1/uc/getUnloadingMesByLike?apiId=374&index=连铸车间')
  215. .then(res => {
  216. if (res.data.code == '200') {
  217. this.optionsLoad=res.data.data.list;
  218. this.loadPoint=parseInt(this.optionsLoad[0].warehouseId);
  219. }
  220. })
  221. },
  222. //查询卸货点
  223. getUnloadPoint(){
  224. this.axios
  225. .post('/api/v1/uc/getUnloadingMesByLike?apiId=374',{
  226. warehouseName:['一棒车间','高线车间']
  227. })
  228. .then(res => {
  229. if (res.data.code == '200') {
  230. this.optionsUnload=res.data.data.list;
  231. }
  232. })
  233. },
  234. //查询车牌号
  235. getCapacity(){
  236. this.axios
  237. .post('/api/v1/uc/getCapacityByLike?index=S')
  238. .then(res => {
  239. if (res.data.code == '200') {
  240. //过滤
  241. this.optionsCapacity = res.data.data.filter(function (x) {
  242. return x in this.capacityArr;
  243. });
  244. }
  245. })
  246. },
  247. // 新增
  248. makeSure() {
  249. let map={
  250. requireUnitId:this.requireUnitId,
  251. heatNo:this.heatNo,
  252. requirementType:"计重",
  253. clazz:this.clazz,
  254. type:this.type,
  255. model:this.model,
  256. capacityId:this.capacityId,
  257. loadPoint:this.loadPoint,
  258. unloadPoint:this.unloadPoint,
  259. }
  260. console.log("map:",map);
  261. if(!map.requireUnitId || !map.heatNo || !map.requirementType || !map.clazz || !map.type || !map.model || !map.loadPoint || !map.unloadPoint || !map.capacityId || map.capacityId.length<=0){
  262. this.$message.warning("每项都为必填!");
  263. return;
  264. }
  265. //提交
  266. this.axios
  267. .post('',map)
  268. .then(res => {
  269. if (res.data.code == '200') {
  270. }
  271. })
  272. },
  273. // 返回
  274. cancel() {
  275. this.$router.go(-1)
  276. }
  277. }
  278. }
  279. </script>
  280. <style lang="scss" scoped>
  281. .inwardRequirement {
  282. .from {
  283. display: flex;
  284. align-items: center;
  285. justify-content: center;
  286. margin-top: 5px;
  287. margin-bottom: 20px;
  288. }
  289. .drawSty {
  290. .el-input {
  291. width: 240px;
  292. }
  293. }
  294. .DueTime {
  295. display: flex;
  296. align-items: center;
  297. justify-content: center;
  298. margin-top: 5px;
  299. margin-bottom: 20px;
  300. .chooseDueTime {
  301. margin-right: 70px;
  302. }
  303. }
  304. .capacity {
  305. display: flex;
  306. text-align: center;
  307. align-items: center;
  308. justify-content: center;
  309. margin-top: 2rem;
  310. margin-bottom: 1.25rem;
  311. margin-right: 10px;
  312. }
  313. .materialDrawer {
  314. display: flex;
  315. justify-content: center;
  316. align-items: center;
  317. .el-input {
  318. width: 320px;
  319. }
  320. .el-select {
  321. width: 320px;
  322. }
  323. .el-autocomplete {
  324. width: 320px;
  325. }
  326. .el-form {
  327. padding: 10px;
  328. }
  329. .truckBtn {
  330. width: 320px;
  331. }
  332. }
  333. .swtichTop {
  334. display: flex;
  335. height: 40px;
  336. align-content: center;
  337. justify-content: center;
  338. padding-right: 20px;
  339. .titile {
  340. color: red;
  341. font-size: 14px;
  342. }
  343. .switch {
  344. margin-right: -30px;
  345. }
  346. }
  347. .requireUnit {
  348. display: flex;
  349. justify-content: center;
  350. align-items: center;
  351. margin-top: 20px;
  352. .text {
  353. display: inline-block;
  354. width: 170px;
  355. text-align: right;
  356. .input {
  357. width: 250px;
  358. margin-right: 90px;
  359. }
  360. }
  361. }
  362. .form-box {
  363. display: flex;
  364. text-align: center;
  365. align-items: center;
  366. justify-content: center;
  367. margin-top: 20px;
  368. margin-bottom: 20px;
  369. margin-left: 10px;
  370. ::v-deep .el-form {
  371. display: flex;
  372. justify-content: center;
  373. align-items: center;
  374. margin-right: 600px;
  375. // margin-left: -20px;
  376. background-color: yellow;
  377. .preview-group {
  378. background-color: blue;
  379. ::v-deep .el-form-item {
  380. background-color: blue;
  381. .el-form-item__label {
  382. width: 170px !important;
  383. background-color: blue;
  384. }
  385. ::v-deep .el-form-item__content {
  386. background-color: red;
  387. width: 300px;
  388. }
  389. .el-input {
  390. width: 210px !important;
  391. }
  392. }
  393. }
  394. }
  395. }
  396. .button-box {
  397. display: flex;
  398. align-items: center;
  399. justify-content: center;
  400. margin-top: 20px;
  401. margin-right: 90px;
  402. }
  403. }
  404. </style>
  405. <style>
  406. .el-drawer__body {
  407. overflow: auto;
  408. }
  409. .el-drawer__container ::-webkit-scrollbar {
  410. display: none;
  411. }
  412. </style>