queueFStart.vue 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251
  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="40"
  125. reserve-selection
  126. align="center"
  127. :selectable="selectInit"
  128. ></el-table-column>
  129. <el-table-column label="装货点" width="110">
  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="40"
  158. ></el-table-column>
  159. <el-table-column
  160. prop="resultStartTime"
  161. label="排队开始时间"
  162. align="center"
  163. width="160"
  164. >
  165. </el-table-column>
  166. <el-table-column
  167. prop="consigneeName"
  168. label="客户"
  169. fit
  170. show-overflow-tooltip
  171. width="180"
  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="40"
  237. align="center"
  238. reserve-selection
  239. :selectable="selectInitSplleing"
  240. ></el-table-column>
  241. <el-table-column label="装货点" width="110">
  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="40"
  271. ></el-table-column>
  272. <el-table-column
  273. prop="resultStartTime"
  274. label="排队开始时间"
  275. width="160"
  276. >
  277. </el-table-column>
  278. <el-table-column
  279. prop="consigneeName"
  280. label="客户"
  281. fit
  282. width="180"
  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="40"
  357. align="center"
  358. reserve-selection
  359. :selectable="selectInitSplleing"
  360. ></el-table-column>
  361. <el-table-column label="装货点" width="110">
  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="40"
  390. align="center"
  391. ></el-table-column>
  392. <el-table-column
  393. prop="resultStartTime"
  394. label="排队开始时间"
  395. align="center"
  396. width="160"
  397. >
  398. </el-table-column>
  399. <el-table-column prop="consigneeName" label="客户" fit width="180">
  400. </el-table-column>
  401. <el-table-column
  402. prop="materialName"
  403. label="物资名称"
  404. align="center"
  405. min-width="180"
  406. >
  407. </el-table-column>
  408. <el-table-column
  409. prop="steelMeter"
  410. label="钢材长度"
  411. align="cenetr"
  412. width="60"
  413. >
  414. </el-table-column>
  415. <el-table-column
  416. prop="materialSpecification"
  417. label="规格型号"
  418. align="center"
  419. min-width="160"
  420. >
  421. </el-table-column>
  422. <el-table-column
  423. prop="materialNumber"
  424. label="物资件数"
  425. align="center"
  426. width="60"
  427. >
  428. </el-table-column>
  429. <el-table-column
  430. prop="grid"
  431. label="拼数"
  432. fit
  433. width="60"
  434. align="center"
  435. >
  436. </el-table-column>
  437. <el-table-column prop="driverTel" label="司机电话号码" width="120">
  438. </el-table-column>
  439. <!-- <el-table-column prop="gatepostName" label="进厂门岗">
  440. </el-table-column> -->
  441. <el-table-column prop="sureTime" label="可进厂确认时间" width="150">
  442. </el-table-column>
  443. <el-table-column fixed="right" label="操作" width="150">
  444. <template slot-scope="scope">
  445. <el-button
  446. type="text"
  447. size="mini"
  448. @click="ctrlZQueueAllow(scope)"
  449. >
  450. 撤销放行
  451. </el-button>
  452. <el-button type="text" size="mini" @click="updateBill(scope)">
  453. 修改提货单
  454. </el-button>
  455. </template>
  456. </el-table-column>
  457. </el-table>
  458. </el-tab-pane>
  459. <el-tab-pane label="仓库排队列表" name="third">
  460. <el-table
  461. :data="tableData3"
  462. border
  463. style="width: 100%; margin-top: 20px"
  464. max-height="500px"
  465. >
  466. <el-table-column
  467. prop="warehouseName"
  468. label="仓库"
  469. fit
  470. ></el-table-column>
  471. <el-table-column prop="carQueue" label="排队车辆"></el-table-column>
  472. </el-table>
  473. </el-tab-pane>
  474. </el-tabs>
  475. </div>
  476. </div>
  477. </template>
  478. <script>
  479. import { getCookie } from '@/utils/util.js'
  480. export default {
  481. data() {
  482. return {
  483. capacityNo: '',
  484. inputText: '',
  485. option1: {
  486. // 表格请求数据的地址
  487. requestUrl: '',
  488. selectionType: 'select'
  489. },
  490. optionMa: {
  491. // 表格请求数据的地址
  492. requestUrl: '',
  493. // 控制显示多选列
  494. selectionType: 'select'
  495. },
  496. activeName: 'first',
  497. tableData: [],
  498. tableData1: [],
  499. tableData2: [],
  500. tableData3: [],
  501. //存放每一行记录的合并数
  502. spanArr: [],
  503. spanArr1: [],
  504. maplist: [],
  505. id: null,
  506. option: [],
  507. filterArr1: [],
  508. table1: false,
  509. //物资选中表格
  510. materialList: [],
  511. //物资选中暂存
  512. materialList1: [],
  513. //物资信息查询内容
  514. materialNameText: null,
  515. materialSpecificationText: null,
  516. materialModelText: null,
  517. timer: null,
  518. totalQueueNum: null,
  519. redDotNum: null,
  520. i: 0,
  521. totalQueueNumFirst: null,
  522. //厂内钢材车辆总数
  523. steelOrderNum: 0,
  524. isQueryCapacity: null,
  525. //排队放行限制
  526. releaseFlag: false
  527. }
  528. },
  529. created() {
  530. this.i = 0
  531. this.infomation()
  532. this.getReleaseFlag()
  533. this.getSpellingArray()
  534. this.getNoSpellingArray()
  535. this.getStoreArray()
  536. this.getSteelOrderNum()
  537. this.wantEnfactory()
  538. this.start()
  539. },
  540. mounted() {},
  541. computed: {
  542. wantS() {
  543. return this.totalQueueNum
  544. }
  545. },
  546. beforeDestroy() {
  547. this.timer
  548. },
  549. watch: {
  550. wantS() {
  551. if (this.totalQueueNum - this.totalQueueNumFirst > 0) {
  552. this.redDotNum = this.totalQueueNum - this.totalQueueNumFirst
  553. }
  554. }
  555. },
  556. methods: {
  557. //获取放行限制标志
  558. getReleaseFlag() {
  559. this.axios
  560. .get('/api/v1/uc/getReleaseFlag')
  561. .then(res => {
  562. this.releaseFlag = res.data
  563. console.log(res.data, 'res')
  564. })
  565. .catch(e => {
  566. this.releaseFlag = false
  567. })
  568. },
  569. //单拼样式调整
  570. cellStyleSingle({ row, column, rowIndex, columnIndex }) {
  571. if (
  572. column.property == 'capacityNumber' ||
  573. column.property == 'materialName' ||
  574. column.property == 'materialSpecification'
  575. ) {
  576. return { fontSize: '16px', fontWeight: '600' }
  577. } else {
  578. return { fontSize: '15px' }
  579. }
  580. },
  581. cellStyleTwoSpelling({ row, column, rowIndex, columnIndex }) {
  582. if (
  583. column.property == 'capacityNumber' ||
  584. column.property == 'materialName' ||
  585. column.property == 'materialSpecification'
  586. ) {
  587. return { fontSize: '16px', fontWeight: '600' }
  588. } else {
  589. return { fontSize: '15px' }
  590. }
  591. },
  592. cellStyleSpelling({ row, column, rowIndex, columnIndex }) {
  593. if (
  594. column.property == 'capacityNumber' ||
  595. column.property == 'materialName' ||
  596. column.property == 'materialSpecification'
  597. ) {
  598. return { fontSize: '16px', fontWeight: '600' }
  599. } else {
  600. return { fontSize: '15px' }
  601. }
  602. },
  603. ctrlZQueueAllow(scope) {
  604. let map = {
  605. listId: scope.row.listId,
  606. resultTotalId: scope.row.resultTotalId
  607. }
  608. console.log(map)
  609. this.axios.post('/api/v1/qms/ctrlZQueueAllow', map).then(res => {
  610. if (res.data.code == 200) {
  611. this.$message({
  612. message: '撤销成功',
  613. type: 'success',
  614. duration: 2000,
  615. center: true,
  616. offset: 100
  617. })
  618. this.getNoSpellingArray()
  619. this.getSpellingArray()
  620. this.getSpellingArrayTwo()
  621. } else {
  622. this.$message({
  623. message: '撤销失败',
  624. type: 'error',
  625. duration: 2000,
  626. center: true,
  627. offset: 100
  628. })
  629. }
  630. })
  631. },
  632. wantEnfactory() {
  633. this.axios.get('/api/v1/uc/getQueueCount').then(res => {
  634. this.totalQueueNum = res.data.data
  635. console.log(this.totalQueueNum, 'totalQueueNum')
  636. if (this.i == 0) {
  637. this.totalQueueNumFirst = this.totalQueueNum
  638. }
  639. this.i++
  640. })
  641. },
  642. start() {
  643. this.timer = setInterval(this.wantEnfactory, 60000)
  644. },
  645. refresh() {
  646. this.getReleaseFlag()
  647. this.getSpellingArray()
  648. this.getNoSpellingArray()
  649. this.getSpellingArrayTwo()
  650. this.getSteelOrderNum()
  651. this.getStoreArray()
  652. this.redDotNum = null
  653. this.totalQueueNum = null
  654. this.totalQueueNumFirst = null
  655. this.isQueryCapacity = null
  656. this.maplist = []
  657. this.filterArr1 = []
  658. this.i = 0
  659. clearInterval(this.timer)
  660. this.start()
  661. },
  662. getSteelOrderNum() {
  663. this.axios.get('/api/v1/uc/getSteelOrderNum').then(res => {
  664. this.steelOrderNum = res.data.data
  665. })
  666. },
  667. getRowKey(row) {
  668. return row.ROW_ID
  669. },
  670. selectInit(row) {
  671. if (!this.releaseFlag) {
  672. return true
  673. }
  674. //单拼的可勾选控制功能在这
  675. //过滤出处在同一个网格上的数据
  676. let gridData = this.tableData1.filter(e => {
  677. return e.gridId === row.gridId && e.sureTime == null
  678. })
  679. //处理下maplist里面的数据
  680. let reallyMaplist = this.maplist.map(e => {
  681. return e.resultTotalId
  682. })
  683. //在maplist里面的不能进入到gridData里面来,遍历gridData移除在maplist里面的
  684. let reallyGridData = gridData.filter(e => {
  685. if (!reallyMaplist.includes(e.resultTotalId)) {
  686. return e
  687. }
  688. })
  689. //判断当前行是不是在reallyGridData的第一行,如果是就允许勾选,反之不行
  690. if (
  691. (reallyGridData.length > 0 &&
  692. (row.resultTotalId === reallyGridData[0].resultTotalId ||
  693. row.resultInsertTime != null)) ||
  694. reallyMaplist.includes(row.resultTotalId)
  695. ) {
  696. return true
  697. } else {
  698. return false
  699. }
  700. // if (this.maplist.length == 0) {
  701. // if (row.ROW_ID == 1) {
  702. // return true
  703. // } else {
  704. // return false
  705. // }
  706. // } else {
  707. // if (
  708. // this.maplist.some(e => {
  709. // return (
  710. // e.ROW_ID == row.ROW_ID ||
  711. // e.ROW_ID + 1 == row.ROW_ID ||
  712. // typeof row.ROW_ID == 'undefined'
  713. // )
  714. // })
  715. // ) {
  716. // return true
  717. // } else {
  718. // return false
  719. // }
  720. // }
  721. },
  722. selectInitSplleing(row) {
  723. if (!this.releaseFlag) {
  724. return true
  725. }
  726. if (this.maplist.length == 0) {
  727. if (row.group + 1 == 1) {
  728. return true
  729. } else {
  730. return false
  731. }
  732. } else {
  733. if (
  734. this.maplist.some(e => {
  735. return e.group == row.group || e.group + 1 == row.group
  736. })
  737. ) {
  738. return true
  739. } else {
  740. return false
  741. }
  742. }
  743. },
  744. rowDbClick(row) {
  745. this.materialList = []
  746. this.materialList.push(row)
  747. this.makeSureMaterial()
  748. },
  749. cellClikSingle(row, column, cell, event) {
  750. if (
  751. column.property == 'materialSpecification' ||
  752. column.property == 'materialName'
  753. ) {
  754. this.materialList = []
  755. this.materialList.push(row)
  756. this.makeSureMaterial()
  757. }
  758. },
  759. //物资模态框查询
  760. onclickMaterial1() {
  761. this.optionMa.requestUrl =
  762. '/api/v1/uc/getSteelMaterial?apiId=244&materialNameText=' +
  763. this.materialNameText +
  764. '&materialSpecificationText=' +
  765. this.materialSpecificationText
  766. },
  767. onclickMaterial() {
  768. this.table1 = true
  769. this.optionMa.requestUrl =
  770. '/api/v1/uc/getSteelMaterial?apiId=244&i=' + new Date()
  771. },
  772. //返回选中的物资信息
  773. selectionChange2(selection) {
  774. 8
  775. this.materialList1 = []
  776. this.materialList1 = selection
  777. this.materialList = this.materialList.concat(this.materialList1)
  778. },
  779. makeSureMaterial() {
  780. console.log(this.materialList)
  781. var materialIdList = []
  782. this.materialList.forEach(e => {
  783. if (materialIdList.indexOf(e.materialId) == -1) {
  784. materialIdList.push(e.materialId)
  785. }
  786. })
  787. let map = {
  788. materialList: materialIdList
  789. }
  790. this.materialList = []
  791. this.materialList1 = []
  792. if (this.activeName == 'first') {
  793. this.axios
  794. .post('/api/v1/qms/getQueueListByQueueUp?isSpelling=0', map)
  795. .then(res => {
  796. this.tableData1 = res.data.data
  797. })
  798. } else if (this.activeName == second) {
  799. this.axios
  800. .post('/api/v1/qms/getQueueListByQueueUp?apiId=473&isSpelling=1', map)
  801. .then(res => {
  802. this.tableData = res.data.data
  803. this.getSpanArr(this.tableData)
  804. })
  805. } else if (this.activeName == fourth) {
  806. this.axios
  807. .post('/api/v1/qms/getQueueListByQueueUp?apiId=473&isSpelling=2', map)
  808. .then(res => {
  809. this.tableData2 = res.data.data
  810. this.getSpanArr1(this.tableData2)
  811. })
  812. }
  813. this.table1 = false
  814. },
  815. infomation() {
  816. this.axios.get('/api/v1/uc/getSteelWarehouse').then(res => {
  817. console.log(res.data)
  818. this.option = res.data
  819. })
  820. },
  821. //记录每一行的合并数
  822. getSpanArr(data) {
  823. //每次调用方法初始化
  824. this.spanArr = []
  825. for (var i = 0; i < data.length; i++) {
  826. if (i === 0) {
  827. this.spanArr.push(1)
  828. this.pos = 0
  829. data[i].group = i
  830. } else {
  831. // 判断当前元素与上一个元素是否相同
  832. if (data[i].resultTotalId === data[i - 1].resultTotalId) {
  833. this.spanArr[this.pos] += 1
  834. this.spanArr.push(0)
  835. data[i].group = data[i - 1].group
  836. } else {
  837. this.spanArr.push(1)
  838. this.pos = i
  839. data[i].group = data[i - 1].group + 1
  840. }
  841. }
  842. }
  843. },
  844. //记录每一行的合并数
  845. getSpanArr1(data) {
  846. //每次调用方法初始化
  847. this.spanArr1 = []
  848. for (var i = 0; i < data.length; i++) {
  849. if (i === 0) {
  850. this.spanArr1.push(1)
  851. this.pos = 0
  852. data[i].group = i
  853. } else {
  854. // 判断当前元素与上一个元素是否相同
  855. if (data[i].resultTotalId === data[i - 1].resultTotalId) {
  856. this.spanArr1[this.pos] += 1
  857. this.spanArr1.push(0)
  858. data[i].group = data[i - 1].group
  859. } else {
  860. this.spanArr1.push(1)
  861. this.pos = i
  862. data[i].group = data[i - 1].group + 1
  863. }
  864. }
  865. }
  866. },
  867. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  868. if (
  869. columnIndex === 0 ||
  870. columnIndex === 2 ||
  871. columnIndex === 3 ||
  872. columnIndex === 4 ||
  873. columnIndex === 10 ||
  874. columnIndex === 11 ||
  875. columnIndex === 12 ||
  876. columnIndex === 13 ||
  877. columnIndex === 14 ||
  878. columnIndex === 15
  879. ) {
  880. const _row = this.spanArr[rowIndex]
  881. const _col = _row > 0 ? 1 : 0
  882. return {
  883. rowspan: _row,
  884. colspan: _col
  885. }
  886. }
  887. },
  888. objectSpanMethod1({ row, column, rowIndex, columnIndex }) {
  889. if (
  890. columnIndex === 0 ||
  891. columnIndex === 2 ||
  892. columnIndex === 3 ||
  893. columnIndex === 4 ||
  894. columnIndex === 10 ||
  895. columnIndex === 11 ||
  896. columnIndex === 12 ||
  897. columnIndex === 13 ||
  898. columnIndex === 14 ||
  899. columnIndex === 15
  900. ) {
  901. const _row = this.spanArr1[rowIndex]
  902. const _col = _row > 0 ? 1 : 0
  903. return {
  904. rowspan: _row,
  905. colspan: _col
  906. }
  907. }
  908. },
  909. handleClick() {
  910. this.redDotNum = null
  911. this.totalQueueNum = null
  912. this.totalQueueNumFirst = null
  913. this.i = 0
  914. if (this.activeName == 'first') {
  915. this.getNoSpellingArray()
  916. } else if (this.activeName == 'second') {
  917. this.getSpellingArray()
  918. } else if (this.activeName == 'fourth') {
  919. this.getSpellingArrayTwo()
  920. } else {
  921. this.getStoreArray()
  922. }
  923. },
  924. getNoSpellingArray() {
  925. this.axios
  926. .post('/api/v1/qms/getQueueListByQueueUp?isSpelling=0&i=' + new Date())
  927. .then(res => {
  928. this.tableData1 = res.data.data
  929. this.isQueryCapacity = null
  930. console.log(this.tableData1)
  931. })
  932. },
  933. getSpellingArray() {
  934. this.axios
  935. .post(
  936. '/api/v1/qms/getQueueListByQueueUp?apiId=473&isSpelling=1&i=' +
  937. new Date()
  938. )
  939. .then(res => {
  940. this.tableData = res.data.data
  941. this.isQueryCapacity = null
  942. console.log(this.tableData)
  943. this.getSpanArr(this.tableData)
  944. })
  945. },
  946. getSpellingArrayTwo() {
  947. this.axios
  948. .post(
  949. '/api/v1/qms/getQueueListByQueueUp?apiId=473&isSpelling=2&i=' +
  950. new Date()
  951. )
  952. .then(res => {
  953. this.tableData2 = res.data.data
  954. this.isQueryCapacity = null
  955. console.log(this.tableData2)
  956. this.getSpanArr1(this.tableData2)
  957. })
  958. },
  959. getStoreArray() {
  960. this.axios.post('/api/v1/qms/getStoreQueueList').then(res => {
  961. this.tableData3 = res.data.data
  962. console.log('getStoreArray ' + JSON.stringify(this.tableData3))
  963. })
  964. },
  965. onclick() {
  966. if (this.activeName == 'first') {
  967. this.axios
  968. .post(
  969. '/api/v1/qms/getQueueListByQueueUp?isSpelling=0&i=' +
  970. new Date() +
  971. '&capacityNumber=' +
  972. this.capacityNo
  973. )
  974. .then(res => {
  975. this.isQueryCapacity = 1
  976. this.tableData1 = res.data.data
  977. })
  978. console.log('wzxxx')
  979. } else if (this.activeName == 'second') {
  980. this.axios
  981. .post(
  982. '/api/v1/qms/getQueueListByQueueUp?apiId=473&isSpelling=1&i=' +
  983. new Date() +
  984. '&capacityNumber=' +
  985. this.capacityNo
  986. )
  987. .then(res => {
  988. this.isQueryCapacity = 1
  989. this.tableData = res.data.data
  990. this.getSpanArr(this.tableData)
  991. })
  992. } else if (this.activeName == 'fourth') {
  993. this.axios
  994. .post(
  995. '/api/v1/qms/getQueueListByQueueUp?apiId=473&isSpelling=2&i=' +
  996. new Date() +
  997. '&capacityNumber=' +
  998. this.capacityNo
  999. )
  1000. .then(res => {
  1001. this.isQueryCapacity = 1
  1002. this.tableData2 = res.data.data
  1003. this.getSpanArr1(this.tableData2)
  1004. })
  1005. }
  1006. },
  1007. handleSelectionChange(selection) {
  1008. this.maplist = []
  1009. this.maplist = selection
  1010. },
  1011. handleSelectionChangeSpelling(selection) {
  1012. this.maplist = []
  1013. this.maplist = selection
  1014. // console.log(selection)
  1015. // for (let i = 0; i < this.maplist.length; i++) {
  1016. // if (i + 1 < this.maplist.length) {
  1017. // if (this.maplist[i].group + 1 != this.maplist[i + 1].group) {
  1018. // this.$refs.spellData.clearSelection()
  1019. // this.$refs.twoSpellData.clearSelection()
  1020. // }
  1021. // }
  1022. // }
  1023. // // 限制只取第一个去掉
  1024. // if (
  1025. // !this.maplist.some(e => {
  1026. // return e.group == 0
  1027. // })
  1028. // ) {
  1029. // this.$refs.spellData.clearSelection()
  1030. // this.$refs.twoSpellData.clearSelection()
  1031. // }
  1032. },
  1033. updateBill(scope) {
  1034. console.log(scope.row.capacityId)
  1035. this.$router.push(
  1036. `/editBill/${scope.row.capacityId}/${scope.row.capacityNumber}`
  1037. )
  1038. },
  1039. filterArr(resultId) {
  1040. console.log('fdhjsaj')
  1041. this.filterArr1 = []
  1042. if (this.activeName == 'first') {
  1043. this.filterArr1 = this.filterArr1.concat(
  1044. this.tableData1.filter(ele => ele.resultId == resultId)
  1045. )
  1046. } else if (this.activeName == 'second') {
  1047. this.filterArr1 = this.filterArr1.concat(
  1048. this.tableData.filter(ele => ele.resultId == resultId)
  1049. )
  1050. } else if (this.activeName == 'fourth') {
  1051. this.filterArr1 = this.filterArr1.concat(
  1052. this.tableData2.filter(ele => ele.resultId == resultId)
  1053. )
  1054. }
  1055. },
  1056. allow() {
  1057. if (this.maplist.length == 0) {
  1058. this.$message({
  1059. message: '请选择需要放行的车辆',
  1060. type: 'error',
  1061. duration: 2000,
  1062. center: true,
  1063. offset: 100
  1064. })
  1065. return
  1066. }
  1067. for (let i = 0; i < this.maplist.length; i++) {
  1068. console.log(typeof this.maplist[i].id)
  1069. if (
  1070. typeof this.maplist[i].id == 'undefined' ||
  1071. this.maplist[i].id == null ||
  1072. this.maplist[i].id == 'null'
  1073. ) {
  1074. this.$message({
  1075. message: '请选择装货点',
  1076. type: 'error',
  1077. duration: 2000,
  1078. center: true,
  1079. offset: 100
  1080. })
  1081. return
  1082. }
  1083. let warehouse = this.tableData3.find(
  1084. value => value.materialPriority === this.maplist[i].id
  1085. )
  1086. console.log('warehouse', warehouse)
  1087. if (warehouse && warehouse.carQueue >= 20) {
  1088. this.$message({
  1089. message: '该仓库已经有20辆车在排队,不允许放行!',
  1090. type: 'error',
  1091. duration: 2000,
  1092. center: true,
  1093. offset: 100
  1094. })
  1095. return
  1096. }
  1097. this.filterArr(this.maplist[i].resultId)
  1098. }
  1099. console.log(this.filterArr1, 'this.fil')
  1100. var filterArr2 = []
  1101. this.filterArr1.forEach(e => {
  1102. if (filterArr2.indexOf(e) === -1) {
  1103. filterArr2.push(e)
  1104. }
  1105. })
  1106. let map = {
  1107. ssoId: getCookie('userId'),
  1108. mapList: filterArr2,
  1109. isQueryCapacity: this.isQueryCapacity
  1110. }
  1111. if (this.activeName == 'first') {
  1112. map.mapList = this.maplist
  1113. }
  1114. console.log('勾选的数据')
  1115. console.log(map)
  1116. this.axios
  1117. .post('/api/v1/qms/allowEnFactory', map)
  1118. .then(res => {
  1119. if (res.data.code == '200') {
  1120. this.$message({
  1121. message: '放行成功,等待进厂',
  1122. type: 'success',
  1123. duration: 2000,
  1124. center: true,
  1125. offset: 100
  1126. })
  1127. this.maplist = []
  1128. this.filterArr1 = []
  1129. this.$refs.mutiData.clearSelection()
  1130. this.$refs.spellData.clearSelection()
  1131. this.$refs.twoSpellData.clearSelection()
  1132. this.getNoSpellingArray()
  1133. this.getSpellingArray()
  1134. this.getSpellingArrayTwo()
  1135. this.getStoreArray()
  1136. this.redDotNum = null
  1137. this.totalQueueNum = null
  1138. this.totalQueueNumFirst = null
  1139. this.i = 0
  1140. clearInterval(this.timer)
  1141. this.start()
  1142. } else {
  1143. this.$message({
  1144. message: '请按顺序勾选',
  1145. type: 'error',
  1146. duration: 2000,
  1147. center: true,
  1148. offset: 100
  1149. })
  1150. this.maplist = []
  1151. this.filterArr1 = []
  1152. this.$refs.mutiData.clearSelection()
  1153. this.$refs.spellData.clearSelection()
  1154. this.$refs.twoSpellData.clearSelection()
  1155. this.getNoSpellingArray()
  1156. this.getSpellingArray()
  1157. this.getStoreArray()
  1158. this.getSpellingArrayTwo()
  1159. this.redDotNum = null
  1160. this.totalQueueNum = null
  1161. this.totalQueueNumFirst = null
  1162. this.i = 0
  1163. clearInterval(this.timer)
  1164. this.start()
  1165. }
  1166. })
  1167. .catch(e => {
  1168. console.log(e)
  1169. this.maplist = []
  1170. this.filterArr1 = []
  1171. this.$refs.mutiData.clearSelection()
  1172. this.$refs.spellData.clearSelection()
  1173. this.$refs.twoSpellData.clearSelection()
  1174. this.getNoSpellingArray()
  1175. this.getSpellingArray()
  1176. this.getStoreArray()
  1177. this.getSpellingArrayTwo()
  1178. this.redDotNum = null
  1179. this.totalQueueNum = null
  1180. this.totalQueueNumFirst = null
  1181. this.i = 0
  1182. clearInterval(this.timer)
  1183. this.start()
  1184. })
  1185. },
  1186. changePriority(row) {
  1187. console.log('装货点:' + row.id)
  1188. console.log('订单id' + row.orderId)
  1189. console.log('物资ID' + row.materialId)
  1190. let map = {
  1191. id: row.id,
  1192. orderId: row.orderId,
  1193. materialId: row.materialId
  1194. }
  1195. this.axios.post('/api/v1/qms/modifyLoadWarehouse', map).then(res => {
  1196. console.log(res)
  1197. if (res.data.code == '200') {
  1198. this.$message({
  1199. message: '更新装货点成功',
  1200. type: 'success',
  1201. duration: 2000,
  1202. center: true,
  1203. offset: 100
  1204. })
  1205. } else {
  1206. this.$message({
  1207. message: '更新装货点失败',
  1208. type: 'error',
  1209. duration: 2000,
  1210. center: true,
  1211. offset: 100
  1212. })
  1213. }
  1214. })
  1215. //this.axios.post("")
  1216. }
  1217. }
  1218. }
  1219. </script>
  1220. <style lang="scss" scoped>
  1221. .sale {
  1222. .top {
  1223. width: 100%;
  1224. height: 80px;
  1225. display: flex;
  1226. align-items: center;
  1227. padding-left: 40px;
  1228. .el-form {
  1229. display: flex;
  1230. justify-content: center;
  1231. align-items: center;
  1232. .el-form-item__label {
  1233. align-items: center;
  1234. line-height: 80px;
  1235. }
  1236. }
  1237. }
  1238. .input {
  1239. width: 250px;
  1240. margin-right: 20px;
  1241. }
  1242. .tabs {
  1243. margin-left: 20px;
  1244. margin-top: 10px;
  1245. .tabs /deep/ .el-tabs__nav {
  1246. font-size: 40px;
  1247. }
  1248. }
  1249. }
  1250. </style>