queueFStart.vue 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247
  1. // 排队开始
  2. <template>
  3. <div class="sale">
  4. <div class="top">
  5. <el-form :inline="true" style="margin-top: 1rem;">
  6. <el-form-item>
  7. <el-input
  8. v-model.trim="capacityNo"
  9. style="width:250px"
  10. placeholder="输入车牌号查询"
  11. clearable
  12. >
  13. </el-input>
  14. <el-button
  15. type="primary"
  16. class="btn"
  17. @click="onclick"
  18. style="margin-left: 4px;"
  19. clearable
  20. ><i class="el-icon-search"></i>查询车辆</el-button
  21. >
  22. </el-form-item>
  23. <el-form-item>
  24. <el-button
  25. type="primary"
  26. class="btn"
  27. @click="onclickMaterial"
  28. style="margin-left: 4px;"
  29. clearable
  30. ><i class="el-icon-search"></i>查询物资</el-button
  31. >
  32. </el-form-item>
  33. <el-form-item>
  34. <el-badge :value="redDotNum" class="item">
  35. <el-button type="primary" class="btn" @click="refresh">
  36. <i class="el-icon-refresh"></i>刷新
  37. </el-button>
  38. </el-badge>
  39. </el-form-item>
  40. <el-form-item
  41. ><el-button type="primary" class="btn" @click="allow">
  42. <i class="el-icon-d-arrow-right"></i>放行
  43. </el-button></el-form-item
  44. >
  45. <el-form-item
  46. ><el-button type="primary" class="btn" disabled>
  47. 厂内钢材车辆总数
  48. </el-button>
  49. <el-input disabled style="width:100px" v-model="steelOrderNum">
  50. </el-input>
  51. </el-form-item>
  52. </el-form>
  53. </div>
  54. <!-- 物资选择模态框 -->
  55. <el-drawer
  56. title="选择物资信息"
  57. :visible.sync="table1"
  58. direction="rtl"
  59. size="90%"
  60. :show-close="true"
  61. >
  62. <el-form :inline="true" style="margin-top: 0.5rem;">
  63. <el-form-item>
  64. <label class="el-form-item__label" style="width: auto;"
  65. >物资名称</label
  66. >
  67. </el-form-item>
  68. <el-form-item>
  69. <el-input
  70. placeholder="请输入内容"
  71. v-model="materialNameText"
  72. clearable
  73. ></el-input>
  74. </el-form-item>
  75. <el-form-item>
  76. <label class="el-form-item__label" style="width: auto;">规格</label>
  77. </el-form-item>
  78. <el-form-item>
  79. <el-input
  80. placeholder="请输入内容"
  81. v-model="materialSpecificationText"
  82. clearable
  83. ><template slot="prepend">Φ</template></el-input
  84. >
  85. </el-form-item>
  86. <el-button
  87. type="primary"
  88. class="btn"
  89. @click="onclickMaterial1"
  90. style="margin-left: 4px;"
  91. ><i class="el-icon-search"></i>查询</el-button
  92. >
  93. <el-button type="primary" @click="makeSureMaterial"
  94. ><i class="el-icon-check"></i>确定</el-button
  95. >
  96. </el-form>
  97. <div class="tablecls">
  98. <!-- 查询所有的物资 -->
  99. <dilTable
  100. v-bind.sync="optionMa"
  101. @selection-change="selectionChange2"
  102. @rowDbClick="rowDbClick"
  103. >
  104. </dilTable>
  105. </div>
  106. </el-drawer>
  107. <div class="tabs">
  108. <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
  109. <el-tab-pane label="单拼车辆排队链表" name="first">
  110. <el-table
  111. ref="mutiData"
  112. :data="tableData1"
  113. border
  114. :row-key="getRowKey"
  115. style="width: 100%; margin-top: 20px"
  116. @selection-change="handleSelectionChange"
  117. max-height="500px"
  118. @cell-click="cellClikSingle"
  119. :cell-style="cellStyleSingle"
  120. >
  121. <!-- 是否可以勾选:selectable="selectInit" -->
  122. <el-table-column
  123. type="selection"
  124. width="30"
  125. reserve-selection
  126. align="center"
  127. :selectable="selectInit"
  128. ></el-table-column>
  129. <el-table-column label="装货点" width="100">
  130. <template slot-scope="scope">
  131. <el-select
  132. size="mini"
  133. v-model="scope.row.id"
  134. @change="changePriority(scope.row)"
  135. >
  136. <el-option
  137. v-for="item in option"
  138. :key="item.id"
  139. :label="item.value"
  140. :value="item.id"
  141. >
  142. </el-option>
  143. </el-select>
  144. </template>
  145. </el-table-column>
  146. <el-table-column
  147. prop="capacityNumber"
  148. label="车牌号"
  149. fit
  150. width="120"
  151. >
  152. </el-table-column>
  153. <el-table-column
  154. prop="listNodeOrder"
  155. label="序号"
  156. align="center"
  157. width="30"
  158. ></el-table-column>
  159. <el-table-column
  160. prop="resultStartTime"
  161. label="排队开始时间"
  162. align="center"
  163. width="150"
  164. >
  165. </el-table-column>
  166. <el-table-column
  167. prop="consigneeName"
  168. label="客户"
  169. fit
  170. show-overflow-tooltip
  171. width="170"
  172. >
  173. </el-table-column>
  174. <el-table-column
  175. prop="materialName"
  176. label="物资名称"
  177. min-width="180"
  178. >
  179. </el-table-column>
  180. <el-table-column
  181. prop="steelMeter"
  182. label="钢材长度"
  183. align="center"
  184. width="55"
  185. >
  186. </el-table-column>
  187. <el-table-column
  188. prop="materialSpecification"
  189. label="规格型号"
  190. min-width="160"
  191. >
  192. </el-table-column>
  193. <el-table-column
  194. prop="materialNumber"
  195. label="物资件数"
  196. align="center"
  197. width="60"
  198. >
  199. </el-table-column>
  200. <el-table-column prop="driverTel" label="司机电话号码" width="120">
  201. </el-table-column>
  202. <el-table-column prop="sureTime" label="可进厂确认时间" width="150">
  203. </el-table-column>
  204. <!-- <el-table-column prop="gatepostName" label="进厂门岗" width="80">
  205. </el-table-column> -->
  206. <el-table-column fixed="right" label="操作" width="150">
  207. <template slot-scope="scope">
  208. <el-button
  209. type="text"
  210. size="mini"
  211. @click="ctrlZQueueAllow(scope)"
  212. >
  213. 撤销放行
  214. </el-button>
  215. <el-button type="text" size="mini" @click="updateBill(scope)">
  216. 修改提货单
  217. </el-button>
  218. </template>
  219. </el-table-column>
  220. </el-table>
  221. </el-tab-pane>
  222. <el-tab-pane label="两拼车辆排队链表" name="fourth">
  223. <el-table
  224. :data="tableData2"
  225. :span-method="objectSpanMethod1"
  226. border
  227. style="width: 100%; margin-top: 20px"
  228. @selection-change="handleSelectionChangeSpelling"
  229. :row-key="getRowKey"
  230. max-height="500px"
  231. ref="twoSpellData"
  232. :cell-style="cellStyleTwoSpelling"
  233. >
  234. <el-table-column
  235. type="selection"
  236. width="30"
  237. align="center"
  238. reserve-selection
  239. :selectable="selectInitSplleing"
  240. ></el-table-column>
  241. <el-table-column label="装货点" width="100">
  242. <template slot-scope="scope">
  243. <el-select
  244. size="mini"
  245. v-model="scope.row.id"
  246. @change="changePriority(scope.row)"
  247. >
  248. <el-option
  249. v-for="item in option"
  250. :key="item.id"
  251. :label="item.value"
  252. :value="item.id"
  253. >
  254. </el-option>
  255. </el-select>
  256. </template>
  257. </el-table-column>
  258. <el-table-column
  259. prop="capacityNumber"
  260. label="车牌号"
  261. fit
  262. align="center"
  263. width="120"
  264. >
  265. </el-table-column>
  266. <el-table-column
  267. prop="listNodeOrder"
  268. label="序号"
  269. align="center"
  270. width="30"
  271. ></el-table-column>
  272. <el-table-column
  273. prop="resultStartTime"
  274. label="排队开始时间"
  275. width="150"
  276. >
  277. </el-table-column>
  278. <el-table-column
  279. prop="consigneeName"
  280. label="客户"
  281. fit
  282. width="170"
  283. show-overflow-tooltip
  284. >
  285. </el-table-column>
  286. <el-table-column
  287. prop="materialName"
  288. label="物资名称"
  289. min-width="180"
  290. >
  291. </el-table-column>
  292. <el-table-column
  293. prop="steelMeter"
  294. label="钢材长度"
  295. align="center"
  296. width="60"
  297. >
  298. </el-table-column>
  299. <el-table-column
  300. prop="materialSpecification"
  301. label="规格型号"
  302. min-width="160"
  303. >
  304. </el-table-column>
  305. <el-table-column
  306. prop="materialNumber"
  307. label="物资件数"
  308. align="center"
  309. width="60"
  310. >
  311. </el-table-column>
  312. <el-table-column
  313. prop="grid"
  314. label="拼数"
  315. fit
  316. align="center"
  317. width="50"
  318. >
  319. </el-table-column>
  320. <el-table-column prop="driverTel" label="司机电话号码" width="120">
  321. </el-table-column>
  322. <!-- <el-table-column prop="gatepostName" label="进厂门岗" width="100">
  323. </el-table-column> -->
  324. <el-table-column prop="sureTime" label="可进厂确认时间" width="150">
  325. </el-table-column>
  326. <el-table-column fixed="right" label="操作" width="150">
  327. <template slot-scope="scope">
  328. <el-button
  329. type="text"
  330. size="mini"
  331. @click="ctrlZQueueAllow(scope)"
  332. >
  333. 撤销放行
  334. </el-button>
  335. <el-button type="text" size="mini" @click="updateBill(scope)">
  336. 修改提货单
  337. </el-button>
  338. </template>
  339. </el-table-column>
  340. </el-table>
  341. </el-tab-pane>
  342. <el-tab-pane label="多拼车辆排队链表" name="second">
  343. <el-table
  344. :data="tableData"
  345. :span-method="objectSpanMethod"
  346. border
  347. style="width: 100%; margin-top: 20px"
  348. @selection-change="handleSelectionChangeSpelling"
  349. :row-key="getRowKey"
  350. max-height="500px"
  351. ref="spellData"
  352. :cell-style="cellStyleSpelling"
  353. >
  354. <el-table-column
  355. type="selection"
  356. width="30"
  357. align="center"
  358. reserve-selection
  359. :selectable="selectInitSplleing"
  360. ></el-table-column>
  361. <el-table-column label="装货点" width="100">
  362. <template slot-scope="scope">
  363. <el-select
  364. size="mini"
  365. v-model="scope.row.id"
  366. @change="changePriority(scope.row)"
  367. >
  368. <el-option
  369. v-for="item in option"
  370. :key="item.id"
  371. :label="item.value"
  372. :value="item.id"
  373. >
  374. </el-option>
  375. </el-select>
  376. </template>
  377. </el-table-column>
  378. <el-table-column
  379. prop="capacityNumber"
  380. label="车牌号"
  381. fit
  382. align="center"
  383. width="120"
  384. >
  385. </el-table-column>
  386. <el-table-column
  387. prop="listNodeOrder"
  388. label="序号"
  389. width="30"
  390. align="center"
  391. ></el-table-column>
  392. <el-table-column
  393. prop="resultStartTime"
  394. label="排队开始时间"
  395. align="center"
  396. width="150"
  397. >
  398. </el-table-column>
  399. <el-table-column
  400. prop="consigneeName"
  401. label="客户"
  402. fit
  403. width="170"
  404. show-overflow-tooltip
  405. >
  406. </el-table-column>
  407. <el-table-column
  408. prop="materialName"
  409. label="物资名称"
  410. align="center"
  411. min-width="180"
  412. >
  413. </el-table-column>
  414. <el-table-column
  415. prop="steelMeter"
  416. label="钢材长度"
  417. align="cenetr"
  418. width="60"
  419. >
  420. </el-table-column>
  421. <el-table-column
  422. prop="materialSpecification"
  423. label="规格型号"
  424. align="center"
  425. min-width="160"
  426. >
  427. </el-table-column>
  428. <el-table-column
  429. prop="materialNumber"
  430. label="物资件数"
  431. align="center"
  432. width="60"
  433. >
  434. </el-table-column>
  435. <el-table-column
  436. prop="grid"
  437. label="拼数"
  438. fit
  439. width="60"
  440. align="center"
  441. >
  442. </el-table-column>
  443. <el-table-column prop="driverTel" label="司机电话号码" width="120">
  444. </el-table-column>
  445. <!-- <el-table-column prop="gatepostName" label="进厂门岗">
  446. </el-table-column> -->
  447. <el-table-column prop="sureTime" label="可进厂确认时间" width="150">
  448. </el-table-column>
  449. <el-table-column fixed="right" label="操作" width="150">
  450. <template slot-scope="scope">
  451. <el-button
  452. type="text"
  453. size="mini"
  454. @click="ctrlZQueueAllow(scope)"
  455. >
  456. 撤销放行
  457. </el-button>
  458. <el-button type="text" size="mini" @click="updateBill(scope)">
  459. 修改提货单
  460. </el-button>
  461. </template>
  462. </el-table-column>
  463. </el-table>
  464. </el-tab-pane>
  465. <el-tab-pane label="仓库排队列表" name="third">
  466. <el-table
  467. :data="tableData3"
  468. border
  469. style="width: 100%; margin-top: 20px"
  470. max-height="500px"
  471. >
  472. <el-table-column
  473. prop="warehouseName"
  474. label="仓库"
  475. fit
  476. ></el-table-column>
  477. <el-table-column prop="carQueue" label="排队车辆"></el-table-column>
  478. </el-table>
  479. </el-tab-pane>
  480. </el-tabs>
  481. </div>
  482. </div>
  483. </template>
  484. <script>
  485. import { getCookie } from '@/utils/util.js'
  486. export default {
  487. data() {
  488. return {
  489. capacityNo: '',
  490. inputText: '',
  491. option1: {
  492. // 表格请求数据的地址
  493. requestUrl: '',
  494. selectionType: 'select'
  495. },
  496. optionMa: {
  497. // 表格请求数据的地址
  498. requestUrl: '',
  499. // 控制显示多选列
  500. selectionType: 'select'
  501. },
  502. activeName: 'first',
  503. tableData: [],
  504. tableData1: [],
  505. tableData2: [],
  506. tableData3: [],
  507. //存放每一行记录的合并数
  508. spanArr: [],
  509. spanArr1: [],
  510. maplist: [],
  511. id: null,
  512. option: [],
  513. filterArr1: [],
  514. table1: false,
  515. //物资选中表格
  516. materialList: [],
  517. //物资选中暂存
  518. materialList1: [],
  519. //物资信息查询内容
  520. materialNameText: null,
  521. materialSpecificationText: null,
  522. materialModelText: null,
  523. timer: null,
  524. totalQueueNum: null,
  525. redDotNum: null,
  526. i: 0,
  527. totalQueueNumFirst: null,
  528. //厂内钢材车辆总数
  529. steelOrderNum: 0,
  530. isQueryCapacity: null,
  531. //排队放行限制
  532. releaseFlag: false
  533. }
  534. },
  535. created() {
  536. this.i = 0
  537. this.infomation()
  538. this.getReleaseFlag()
  539. this.getSpellingArray()
  540. this.getNoSpellingArray()
  541. this.getStoreArray()
  542. this.getSteelOrderNum()
  543. this.wantEnfactory()
  544. this.start()
  545. },
  546. mounted() {},
  547. computed: {
  548. wantS() {
  549. return this.totalQueueNum
  550. }
  551. },
  552. beforeDestroy() {
  553. this.timer
  554. },
  555. watch: {
  556. wantS() {
  557. if (this.totalQueueNum - this.totalQueueNumFirst > 0) {
  558. this.redDotNum = this.totalQueueNum - this.totalQueueNumFirst
  559. }
  560. }
  561. },
  562. methods: {
  563. //获取放行限制标志
  564. getReleaseFlag() {
  565. this.axios
  566. .get('/api/v1/uc/getReleaseFlag')
  567. .then(res => {
  568. this.releaseFlag = res.data
  569. console.log(res.data, 'res')
  570. })
  571. .catch(e => {
  572. this.releaseFlag = false
  573. })
  574. },
  575. //单拼样式调整
  576. cellStyleSingle({ row, column, rowIndex, columnIndex }) {
  577. if (
  578. column.property == 'capacityNumber' ||
  579. column.property == 'materialName' ||
  580. column.property == 'materialSpecification'
  581. ) {
  582. return { fontSize: '16px', fontWeight: '600' }
  583. } else {
  584. return { fontSize: '15px' }
  585. }
  586. },
  587. cellStyleTwoSpelling({ row, column, rowIndex, columnIndex }) {
  588. if (
  589. column.property == 'capacityNumber' ||
  590. column.property == 'materialName' ||
  591. column.property == 'materialSpecification'
  592. ) {
  593. return { fontSize: '16px', fontWeight: '600' }
  594. } else {
  595. return { fontSize: '15px' }
  596. }
  597. },
  598. cellStyleSpelling({ row, column, rowIndex, columnIndex }) {
  599. if (
  600. column.property == 'capacityNumber' ||
  601. column.property == 'materialName' ||
  602. column.property == 'materialSpecification'
  603. ) {
  604. return { fontSize: '16px', fontWeight: '600' }
  605. } else {
  606. return { fontSize: '15px' }
  607. }
  608. },
  609. ctrlZQueueAllow(scope) {
  610. let map = {
  611. listId: scope.row.listId,
  612. resultTotalId: scope.row.resultTotalId
  613. }
  614. console.log(map)
  615. this.axios.post('/api/v1/qms/ctrlZQueueAllow', map).then(res => {
  616. if (res.data.code == 200) {
  617. this.$message({
  618. message: '撤销成功',
  619. type: 'success',
  620. duration: 2000,
  621. center: true,
  622. offset: 100
  623. })
  624. this.getNoSpellingArray()
  625. this.getSpellingArray()
  626. this.getSpellingArrayTwo()
  627. } else {
  628. this.$message({
  629. message: '撤销失败',
  630. type: 'error',
  631. duration: 2000,
  632. center: true,
  633. offset: 100
  634. })
  635. }
  636. })
  637. },
  638. wantEnfactory() {
  639. this.axios.get('/api/v1/uc/getQueueCount').then(res => {
  640. this.totalQueueNum = res.data.data
  641. console.log(this.totalQueueNum, 'totalQueueNum')
  642. if (this.i == 0) {
  643. this.totalQueueNumFirst = this.totalQueueNum
  644. }
  645. this.i++
  646. })
  647. },
  648. start() {
  649. this.timer = setInterval(this.wantEnfactory, 60000)
  650. },
  651. refresh() {
  652. this.getReleaseFlag()
  653. this.getSpellingArray()
  654. this.getNoSpellingArray()
  655. this.getSpellingArrayTwo()
  656. this.getSteelOrderNum()
  657. this.getStoreArray()
  658. this.redDotNum = null
  659. this.totalQueueNum = null
  660. this.totalQueueNumFirst = null
  661. this.isQueryCapacity = null
  662. this.maplist = []
  663. this.filterArr1 = []
  664. this.i = 0
  665. clearInterval(this.timer)
  666. this.start()
  667. },
  668. getSteelOrderNum() {
  669. this.axios.get('/api/v1/uc/getSteelOrderNum').then(res => {
  670. this.steelOrderNum = res.data.data
  671. })
  672. },
  673. getRowKey(row) {
  674. return row.ROW_ID
  675. },
  676. selectInit(row) {
  677. if (!this.releaseFlag) {
  678. return true
  679. }
  680. //单拼的可勾选控制功能在这
  681. //过滤出处在同一个网格上的数据
  682. let gridData = this.tableData1.filter(e => {
  683. return e.gridId === row.gridId && e.sureTime == null
  684. })
  685. //处理下maplist里面的数据
  686. let reallyMaplist = this.maplist.map(e => {
  687. return e.resultTotalId
  688. })
  689. //在maplist里面的不能进入到gridData里面来,遍历gridData移除在maplist里面的
  690. let reallyGridData = gridData.filter(e => {
  691. if (!reallyMaplist.includes(e.resultTotalId)) {
  692. return e
  693. }
  694. })
  695. //判断当前行是不是在reallyGridData的第一行,如果是就允许勾选,反之不行
  696. if (
  697. (reallyGridData.length > 0 &&
  698. (row.resultTotalId === reallyGridData[0].resultTotalId ||
  699. row.resultInsertTime != null)) ||
  700. reallyMaplist.includes(row.resultTotalId)
  701. ) {
  702. return true
  703. } else {
  704. return false
  705. }
  706. // if (this.maplist.length == 0) {
  707. // if (row.ROW_ID == 1) {
  708. // return true
  709. // } else {
  710. // return false
  711. // }
  712. // } else {
  713. // if (
  714. // this.maplist.some(e => {
  715. // return (
  716. // e.ROW_ID == row.ROW_ID ||
  717. // e.ROW_ID + 1 == row.ROW_ID ||
  718. // typeof row.ROW_ID == 'undefined'
  719. // )
  720. // })
  721. // ) {
  722. // return true
  723. // } else {
  724. // return false
  725. // }
  726. // }
  727. },
  728. selectInitSplleing(row) {
  729. if (!this.releaseFlag) {
  730. return true
  731. }
  732. if (this.maplist.length == 0) {
  733. if (row.group + 1 == 1) {
  734. return true
  735. } else {
  736. return false
  737. }
  738. } else {
  739. if (
  740. this.maplist.some(e => {
  741. return e.group == row.group || e.group + 1 == row.group
  742. })
  743. ) {
  744. return true
  745. } else {
  746. return false
  747. }
  748. }
  749. },
  750. rowDbClick(row) {
  751. this.materialList = []
  752. this.materialList.push(row)
  753. this.makeSureMaterial()
  754. },
  755. cellClikSingle(row, column, cell, event) {
  756. if (
  757. column.property == 'materialSpecification' ||
  758. column.property == 'materialName'
  759. ) {
  760. this.materialList = []
  761. this.materialList.push(row)
  762. this.makeSureMaterial()
  763. }
  764. },
  765. //物资模态框查询
  766. onclickMaterial1() {
  767. this.optionMa.requestUrl =
  768. '/api/v1/uc/getSteelMaterial?apiId=244&materialNameText=' +
  769. this.materialNameText +
  770. '&materialSpecificationText=' +
  771. this.materialSpecificationText
  772. },
  773. onclickMaterial() {
  774. this.table1 = true
  775. this.optionMa.requestUrl =
  776. '/api/v1/uc/getSteelMaterial?apiId=244&i=' + new Date()
  777. },
  778. //返回选中的物资信息
  779. selectionChange2(selection) {
  780. 8
  781. this.materialList1 = []
  782. this.materialList1 = selection
  783. this.materialList = this.materialList.concat(this.materialList1)
  784. },
  785. makeSureMaterial() {
  786. if (this.materialList.length > 0) {
  787. console.log(this.materialList)
  788. var materialIdList = []
  789. this.materialList.forEach(e => {
  790. if (materialIdList.indexOf(e.materialId) == -1) {
  791. materialIdList.push(e.materialId)
  792. }
  793. })
  794. let map = {
  795. materialList: materialIdList
  796. }
  797. // this.materialList = []
  798. // this.materialList1 = []
  799. if (this.activeName == 'first') {
  800. this.axios
  801. .post('/api/v1/qms/getQueueListByQueueUp?isSpelling=0', map)
  802. .then(res => {
  803. this.tableData1 = res.data.data
  804. })
  805. }
  806. this.table1 = false
  807. }
  808. },
  809. infomation() {
  810. this.axios.get('/api/v1/uc/getSteelWarehouse').then(res => {
  811. console.log(res.data)
  812. this.option = res.data
  813. })
  814. },
  815. //记录每一行的合并数
  816. getSpanArr(data) {
  817. //每次调用方法初始化
  818. this.spanArr = []
  819. for (var i = 0; i < data.length; i++) {
  820. if (i === 0) {
  821. this.spanArr.push(1)
  822. this.pos = 0
  823. data[i].group = i
  824. } else {
  825. // 判断当前元素与上一个元素是否相同
  826. if (data[i].resultTotalId === data[i - 1].resultTotalId) {
  827. this.spanArr[this.pos] += 1
  828. this.spanArr.push(0)
  829. data[i].group = data[i - 1].group
  830. } else {
  831. this.spanArr.push(1)
  832. this.pos = i
  833. data[i].group = data[i - 1].group + 1
  834. }
  835. }
  836. }
  837. },
  838. //记录每一行的合并数
  839. getSpanArr1(data) {
  840. //每次调用方法初始化
  841. this.spanArr1 = []
  842. for (var i = 0; i < data.length; i++) {
  843. if (i === 0) {
  844. this.spanArr1.push(1)
  845. this.pos = 0
  846. data[i].group = i
  847. } else {
  848. // 判断当前元素与上一个元素是否相同
  849. if (data[i].resultTotalId === data[i - 1].resultTotalId) {
  850. this.spanArr1[this.pos] += 1
  851. this.spanArr1.push(0)
  852. data[i].group = data[i - 1].group
  853. } else {
  854. this.spanArr1.push(1)
  855. this.pos = i
  856. data[i].group = data[i - 1].group + 1
  857. }
  858. }
  859. }
  860. },
  861. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  862. if (
  863. columnIndex === 0 ||
  864. columnIndex === 2 ||
  865. columnIndex === 3 ||
  866. columnIndex === 4 ||
  867. columnIndex === 10 ||
  868. columnIndex === 11 ||
  869. columnIndex === 12 ||
  870. columnIndex === 13 ||
  871. columnIndex === 14 ||
  872. columnIndex === 15
  873. ) {
  874. const _row = this.spanArr[rowIndex]
  875. const _col = _row > 0 ? 1 : 0
  876. return {
  877. rowspan: _row,
  878. colspan: _col
  879. }
  880. }
  881. },
  882. objectSpanMethod1({ row, column, rowIndex, columnIndex }) {
  883. if (
  884. columnIndex === 0 ||
  885. columnIndex === 2 ||
  886. columnIndex === 3 ||
  887. columnIndex === 4 ||
  888. columnIndex === 10 ||
  889. columnIndex === 11 ||
  890. columnIndex === 12 ||
  891. columnIndex === 13 ||
  892. columnIndex === 14 ||
  893. columnIndex === 15
  894. ) {
  895. const _row = this.spanArr1[rowIndex]
  896. const _col = _row > 0 ? 1 : 0
  897. return {
  898. rowspan: _row,
  899. colspan: _col
  900. }
  901. }
  902. },
  903. handleClick() {
  904. this.redDotNum = null
  905. this.totalQueueNum = null
  906. this.totalQueueNumFirst = null
  907. this.i = 0
  908. if (this.activeName == 'first') {
  909. this.getNoSpellingArray()
  910. } else if (this.activeName == 'second') {
  911. this.getSpellingArray()
  912. } else if (this.activeName == 'fourth') {
  913. this.getSpellingArrayTwo()
  914. } else {
  915. this.getStoreArray()
  916. }
  917. },
  918. getNoSpellingArray() {
  919. this.axios
  920. .post('/api/v1/qms/getQueueListByQueueUp?isSpelling=0&i=' + new Date())
  921. .then(res => {
  922. this.tableData1 = res.data.data
  923. this.isQueryCapacity = null
  924. console.log(this.tableData1)
  925. })
  926. },
  927. getSpellingArray() {
  928. this.axios
  929. .post(
  930. '/api/v1/qms/getQueueListByQueueUp?apiId=473&isSpelling=1&i=' +
  931. new Date()
  932. )
  933. .then(res => {
  934. this.tableData = res.data.data
  935. this.isQueryCapacity = null
  936. console.log(this.tableData)
  937. this.getSpanArr(this.tableData)
  938. })
  939. },
  940. getSpellingArrayTwo() {
  941. this.axios
  942. .post(
  943. '/api/v1/qms/getQueueListByQueueUp?apiId=473&isSpelling=2&i=' +
  944. new Date()
  945. )
  946. .then(res => {
  947. this.tableData2 = res.data.data
  948. this.isQueryCapacity = null
  949. console.log(this.tableData2)
  950. this.getSpanArr1(this.tableData2)
  951. })
  952. },
  953. getStoreArray() {
  954. this.axios.post('/api/v1/qms/getStoreQueueList').then(res => {
  955. this.tableData3 = res.data.data
  956. console.log('getStoreArray ' + JSON.stringify(this.tableData3))
  957. })
  958. },
  959. onclick() {
  960. if (this.activeName == 'first') {
  961. this.axios
  962. .post(
  963. '/api/v1/qms/getQueueListByQueueUp?isSpelling=0&i=' +
  964. new Date() +
  965. '&capacityNumber=' +
  966. this.capacityNo
  967. )
  968. .then(res => {
  969. this.isQueryCapacity = 1
  970. this.tableData1 = res.data.data
  971. })
  972. console.log('wzxxx')
  973. } else if (this.activeName == 'second') {
  974. this.axios
  975. .post(
  976. '/api/v1/qms/getQueueListByQueueUp?apiId=473&isSpelling=1&i=' +
  977. new Date() +
  978. '&capacityNumber=' +
  979. this.capacityNo
  980. )
  981. .then(res => {
  982. this.isQueryCapacity = 1
  983. this.tableData = res.data.data
  984. this.getSpanArr(this.tableData)
  985. })
  986. } else if (this.activeName == 'fourth') {
  987. this.axios
  988. .post(
  989. '/api/v1/qms/getQueueListByQueueUp?apiId=473&isSpelling=2&i=' +
  990. new Date() +
  991. '&capacityNumber=' +
  992. this.capacityNo
  993. )
  994. .then(res => {
  995. this.isQueryCapacity = 1
  996. this.tableData2 = res.data.data
  997. this.getSpanArr1(this.tableData2)
  998. })
  999. }
  1000. },
  1001. handleSelectionChange(selection) {
  1002. this.maplist = []
  1003. this.maplist = selection
  1004. },
  1005. handleSelectionChangeSpelling(selection) {
  1006. this.maplist = []
  1007. this.maplist = selection
  1008. // console.log(selection)
  1009. // for (let i = 0; i < this.maplist.length; i++) {
  1010. // if (i + 1 < this.maplist.length) {
  1011. // if (this.maplist[i].group + 1 != this.maplist[i + 1].group) {
  1012. // this.$refs.spellData.clearSelection()
  1013. // this.$refs.twoSpellData.clearSelection()
  1014. // }
  1015. // }
  1016. // }
  1017. // // 限制只取第一个去掉
  1018. // if (
  1019. // !this.maplist.some(e => {
  1020. // return e.group == 0
  1021. // })
  1022. // ) {
  1023. // this.$refs.spellData.clearSelection()
  1024. // this.$refs.twoSpellData.clearSelection()
  1025. // }
  1026. },
  1027. updateBill(scope) {
  1028. console.log(scope.row.capacityId)
  1029. this.$router.push(
  1030. `/editBill/${scope.row.capacityId}/${scope.row.capacityNumber}`
  1031. )
  1032. },
  1033. filterArr(resultId) {
  1034. console.log('fdhjsaj')
  1035. this.filterArr1 = []
  1036. if (this.activeName == 'first') {
  1037. this.filterArr1 = this.filterArr1.concat(
  1038. this.tableData1.filter(ele => ele.resultId == resultId)
  1039. )
  1040. } else if (this.activeName == 'second') {
  1041. this.filterArr1 = this.filterArr1.concat(
  1042. this.tableData.filter(ele => ele.resultId == resultId)
  1043. )
  1044. } else if (this.activeName == 'fourth') {
  1045. this.filterArr1 = this.filterArr1.concat(
  1046. this.tableData2.filter(ele => ele.resultId == resultId)
  1047. )
  1048. }
  1049. },
  1050. allow() {
  1051. if (this.maplist.length == 0) {
  1052. this.$message({
  1053. message: '请选择需要放行的车辆',
  1054. type: 'error',
  1055. duration: 2000,
  1056. center: true,
  1057. offset: 100
  1058. })
  1059. return
  1060. }
  1061. for (let i = 0; i < this.maplist.length; i++) {
  1062. console.log(typeof this.maplist[i].id)
  1063. if (
  1064. typeof this.maplist[i].id == 'undefined' ||
  1065. this.maplist[i].id == null ||
  1066. this.maplist[i].id == 'null'
  1067. ) {
  1068. this.$message({
  1069. message: '请选择装货点',
  1070. type: 'error',
  1071. duration: 2000,
  1072. center: true,
  1073. offset: 100
  1074. })
  1075. return
  1076. }
  1077. let warehouse = this.tableData3.find(
  1078. value => value.materialPriority === this.maplist[i].id
  1079. )
  1080. console.log('warehouse', warehouse)
  1081. if (warehouse && warehouse.carQueue >= 30) {
  1082. this.$message({
  1083. message: '该仓库已经有30辆车在排队,不允许放行!',
  1084. type: 'error',
  1085. duration: 2000,
  1086. center: true,
  1087. offset: 100
  1088. })
  1089. return
  1090. }
  1091. this.filterArr(this.maplist[i].resultId)
  1092. }
  1093. console.log(this.filterArr1, 'this.fil')
  1094. var filterArr2 = []
  1095. this.filterArr1.forEach(e => {
  1096. if (filterArr2.indexOf(e) === -1) {
  1097. filterArr2.push(e)
  1098. }
  1099. })
  1100. let map = {
  1101. ssoId: getCookie('userId'),
  1102. mapList: filterArr2,
  1103. isQueryCapacity: this.isQueryCapacity
  1104. }
  1105. if (this.activeName == 'first') {
  1106. map.mapList = this.maplist
  1107. }
  1108. console.log('勾选的数据')
  1109. console.log(map)
  1110. this.axios
  1111. .post('/api/v1/qms/allowEnFactory', map)
  1112. .then(res => {
  1113. if (res.data.code == '200') {
  1114. this.$message({
  1115. message: '放行成功,等待进厂',
  1116. type: 'success',
  1117. duration: 2000,
  1118. center: true,
  1119. offset: 100
  1120. })
  1121. this.maplist = []
  1122. this.filterArr1 = []
  1123. this.$refs.mutiData.clearSelection()
  1124. this.$refs.spellData.clearSelection()
  1125. this.$refs.twoSpellData.clearSelection()
  1126. // this.getNoSpellingArray()
  1127. this.makeSureMaterial()
  1128. this.getSpellingArray()
  1129. this.getSpellingArrayTwo()
  1130. this.getStoreArray()
  1131. this.redDotNum = null
  1132. this.totalQueueNum = null
  1133. this.totalQueueNumFirst = null
  1134. this.i = 0
  1135. clearInterval(this.timer)
  1136. this.start()
  1137. } else {
  1138. this.$message({
  1139. message: '请按顺序勾选',
  1140. type: 'error',
  1141. duration: 2000,
  1142. center: true,
  1143. offset: 100
  1144. })
  1145. this.maplist = []
  1146. this.filterArr1 = []
  1147. this.$refs.mutiData.clearSelection()
  1148. this.$refs.spellData.clearSelection()
  1149. this.$refs.twoSpellData.clearSelection()
  1150. // this.getNoSpellingArray()
  1151. this.makeSureMaterial()
  1152. this.getSpellingArray()
  1153. this.getStoreArray()
  1154. this.getSpellingArrayTwo()
  1155. this.redDotNum = null
  1156. this.totalQueueNum = null
  1157. this.totalQueueNumFirst = null
  1158. this.i = 0
  1159. clearInterval(this.timer)
  1160. this.start()
  1161. }
  1162. })
  1163. .catch(e => {
  1164. console.log(e)
  1165. this.maplist = []
  1166. this.filterArr1 = []
  1167. this.$refs.mutiData.clearSelection()
  1168. this.$refs.spellData.clearSelection()
  1169. this.$refs.twoSpellData.clearSelection()
  1170. this.getNoSpellingArray()
  1171. this.getSpellingArray()
  1172. this.getStoreArray()
  1173. this.getSpellingArrayTwo()
  1174. this.redDotNum = null
  1175. this.totalQueueNum = null
  1176. this.totalQueueNumFirst = null
  1177. this.i = 0
  1178. clearInterval(this.timer)
  1179. this.start()
  1180. })
  1181. },
  1182. changePriority(row) {
  1183. console.log('装货点:' + row.id)
  1184. console.log('订单id' + row.orderId)
  1185. console.log('物资ID' + row.materialId)
  1186. let map = {
  1187. id: row.id,
  1188. orderId: row.orderId,
  1189. materialId: row.materialId
  1190. }
  1191. this.axios.post('/api/v1/qms/modifyLoadWarehouse', map).then(res => {
  1192. console.log(res)
  1193. if (res.data.code == '200') {
  1194. this.$message({
  1195. message: '更新装货点成功',
  1196. type: 'success',
  1197. duration: 2000,
  1198. center: true,
  1199. offset: 100
  1200. })
  1201. } else {
  1202. this.$message({
  1203. message: '更新装货点失败',
  1204. type: 'error',
  1205. duration: 2000,
  1206. center: true,
  1207. offset: 100
  1208. })
  1209. }
  1210. })
  1211. //this.axios.post("")
  1212. }
  1213. }
  1214. }
  1215. </script>
  1216. <style lang="scss" scoped>
  1217. .sale {
  1218. .top {
  1219. width: 100%;
  1220. height: 80px;
  1221. display: flex;
  1222. align-items: center;
  1223. padding-left: 40px;
  1224. .el-form {
  1225. display: flex;
  1226. justify-content: center;
  1227. align-items: center;
  1228. .el-form-item__label {
  1229. align-items: center;
  1230. line-height: 80px;
  1231. }
  1232. }
  1233. }
  1234. .input {
  1235. width: 250px;
  1236. margin-right: 20px;
  1237. }
  1238. .tabs {
  1239. margin-left: 20px;
  1240. margin-top: 10px;
  1241. .tabs /deep/ .el-tabs__nav {
  1242. font-size: 40px;
  1243. }
  1244. }
  1245. }
  1246. </style>