queueFStart.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  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. <label class="el-form-item__label" style="width: auto;">车牌号</label>
  8. </el-form-item>
  9. <el-form-item>
  10. <el-input v-model="capacityNo"></el-input>
  11. </el-form-item>
  12. <el-form-item>
  13. <el-button
  14. type="primary"
  15. class="btn"
  16. @click="onclick"
  17. style="margin-left: 4px;"
  18. clearable
  19. ><i class="el-icon-search"></i>查询</el-button
  20. >
  21. </el-form-item>
  22. <el-form-item>
  23. <el-button
  24. type="primary"
  25. class="btn"
  26. @click="onclickMaterial"
  27. style="margin-left: 4px;"
  28. clearable
  29. ><i class="el-icon-search"></i>查询物资</el-button
  30. >
  31. </el-form-item>
  32. <el-form-item
  33. ><el-button type="primary" class="btn" @click="allow">
  34. <i class="el-icon-d-arrow-right"></i>放行
  35. </el-button></el-form-item
  36. >
  37. </el-form>
  38. </div>
  39. <!-- 物资选择模态框 -->
  40. <el-drawer
  41. title="选择物资信息"
  42. :visible.sync="table1"
  43. direction="rtl"
  44. size="90%"
  45. :show-close="true"
  46. >
  47. <el-form :inline="true" style="margin-top: 0.5rem;">
  48. <el-form-item>
  49. <label class="el-form-item__label" style="width: auto;"
  50. >物资名称</label
  51. >
  52. </el-form-item>
  53. <el-form-item>
  54. <el-input
  55. placeholder="请输入内容"
  56. v-model="materialNameText"
  57. clearable
  58. ></el-input>
  59. </el-form-item>
  60. <el-form-item>
  61. <label class="el-form-item__label" style="width: auto;">规格</label>
  62. </el-form-item>
  63. <el-form-item>
  64. <el-input
  65. placeholder="请输入内容"
  66. v-model="materialSpecificationText"
  67. clearable
  68. ><template slot="prepend">Φ</template></el-input
  69. >
  70. </el-form-item>
  71. <el-button
  72. type="primary"
  73. class="btn"
  74. @click="onclickMaterial1"
  75. style="margin-left: 4px;"
  76. ><i class="el-icon-search"></i>查询</el-button
  77. >
  78. <el-button type="primary" @click="makeSureMaterial"
  79. ><i class="el-icon-check"></i>确定</el-button
  80. >
  81. </el-form>
  82. <div class="tablecls">
  83. <!-- 查询所有的物资 -->
  84. <dilTable
  85. v-bind.sync="optionMa"
  86. @selection-change="selectionChange2"
  87. @rowDbClick="rowDbClick"
  88. >
  89. </dilTable>
  90. </div>
  91. </el-drawer>
  92. <div class="tabs">
  93. <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
  94. <el-tab-pane label="单拼车辆排队链表" name="first">
  95. <el-table
  96. :data="tableData1"
  97. border
  98. style="width: 100%; margin-top: 20px"
  99. @selection-change="handleSelectionChange"
  100. max-height="500px"
  101. >
  102. <el-table-column type="selection" width="55"></el-table-column>
  103. <el-table-column type="index" width="50"> </el-table-column>
  104. <el-table-column prop="capacityNumber" label="车牌号" fit>
  105. </el-table-column>
  106. <el-table-column prop="resultStartTime" label="排队开始时间">
  107. </el-table-column>
  108. <el-table-column
  109. prop="listNodeOrder"
  110. label="序号"
  111. ></el-table-column>
  112. <el-table-column prop="materialName" label="物资名称">
  113. </el-table-column>
  114. <el-table-column prop="materialSpecification" label="物资规格">
  115. </el-table-column>
  116. <el-table-column prop="materialModel" label="物资型号">
  117. </el-table-column>
  118. <el-table-column prop="materialNumber" label="物资件数">
  119. </el-table-column>
  120. <el-table-column prop="driverTel" label="司机电话号码">
  121. </el-table-column>
  122. <el-table-column prop="sureTime" label="可进厂确认时间">
  123. </el-table-column>
  124. <el-table-column prop="gatepostName" label="进厂门岗">
  125. </el-table-column>
  126. <el-table-column label="装货点" width="100">
  127. <template slot-scope="scope">
  128. <el-select size="mini" v-model="scope.row.id">
  129. <el-option
  130. v-for="item in option"
  131. :key="item.id"
  132. :label="item.value"
  133. :value="item.id"
  134. >
  135. </el-option>
  136. </el-select>
  137. </template>
  138. </el-table-column>
  139. <el-table-column fixed="right" label="操作" width="100">
  140. <template slot-scope="scope">
  141. <el-button type="text" size="mini" @click="updateBill(scope)">
  142. 修改提货单
  143. </el-button>
  144. </template>
  145. </el-table-column>
  146. </el-table>
  147. </el-tab-pane>
  148. <el-tab-pane label="多拼车辆排队链表" name="second">
  149. <el-table
  150. :data="tableData"
  151. :span-method="objectSpanMethod"
  152. border
  153. style="width: 100%; margin-top: 20px"
  154. @selection-change="handleSelectionChange"
  155. max-height="500px"
  156. >
  157. <el-table-column type="selection" width="55"></el-table-column>
  158. <el-table-column prop="capacityNumber" label="车牌号" fit>
  159. </el-table-column>
  160. <el-table-column prop="grid" label="拼数" fit> </el-table-column>
  161. <el-table-column prop="resultStartTime" label="排队开始时间">
  162. </el-table-column>
  163. <el-table-column
  164. prop="listNodeOrder"
  165. label="序号"
  166. ></el-table-column>
  167. <el-table-column prop="materialName" label="物资名称">
  168. </el-table-column>
  169. <el-table-column prop="materialSpecification" label="物资规格">
  170. </el-table-column>
  171. <el-table-column prop="materialModel" label="物资型号">
  172. </el-table-column>
  173. <el-table-column prop="materialNumber" label="物资件数">
  174. </el-table-column>
  175. <el-table-column prop="driverTel" label="司机电话号码">
  176. </el-table-column>
  177. <el-table-column prop="gatepostName" label="进厂门岗">
  178. </el-table-column>
  179. <el-table-column prop="sureTime" label="可进厂确认时间">
  180. </el-table-column>
  181. <el-table-column label="装货点" width="100">
  182. <template slot-scope="scope">
  183. <el-select size="mini" v-model="scope.row.id">
  184. <el-option
  185. v-for="item in option"
  186. :key="item.id"
  187. :label="item.value"
  188. :value="item.id"
  189. >
  190. </el-option>
  191. </el-select>
  192. </template>
  193. </el-table-column>
  194. <el-table-column fixed="right" label="操作" width="100">
  195. <template slot-scope="scope">
  196. <el-button type="text" size="mini" @click="updateBill(scope)">
  197. 修改提货单
  198. </el-button>
  199. </template>
  200. </el-table-column>
  201. </el-table>
  202. </el-tab-pane>
  203. </el-tabs>
  204. </div>
  205. </div>
  206. </template>
  207. <script>
  208. import { getCookie } from "@/utils/util.js";
  209. export default {
  210. data() {
  211. return {
  212. capacityNo: "",
  213. inputText: "",
  214. option1: {
  215. // 表格请求数据的地址
  216. requestUrl: "",
  217. selectionType: "select"
  218. },
  219. optionMa: {
  220. // 表格请求数据的地址
  221. requestUrl: "",
  222. // 控制显示多选列
  223. selectionType: "select"
  224. },
  225. activeName: "first",
  226. tableData: [],
  227. tableData1: [],
  228. //存放每一行记录的合并数
  229. spanArr: [],
  230. maplist: [],
  231. id: null,
  232. option: [],
  233. filterArr1: [],
  234. table1: false,
  235. //物资选中表格
  236. materialList: [],
  237. //物资选中暂存
  238. materialList1: [],
  239. //物资信息查询内容
  240. materialNameText: null,
  241. materialSpecificationText: null,
  242. materialModelText: null
  243. };
  244. },
  245. watch: {
  246. activeName() {}
  247. },
  248. mounted() {
  249. this.infomation();
  250. this.getSpellingArray();
  251. this.getNoSpellingArray();
  252. },
  253. methods: {
  254. rowDbClick(row) {
  255. this.materialList = [];
  256. this.materialList.push(row);
  257. this.makeSureMaterial();
  258. },
  259. //物资模态框查询
  260. onclickMaterial1() {
  261. this.optionMa.requestUrl =
  262. "/api/v1/uc/getSteelMaterial?apiId=244&materialNameText=" +
  263. this.materialNameText +
  264. "&materialSpecificationText=" +
  265. this.materialSpecificationText;
  266. },
  267. onclickMaterial() {
  268. this.table1 = true;
  269. this.optionMa.requestUrl =
  270. "/api/v1/uc/getSteelMaterial?apiId=244&i=" + new Date();
  271. console.log("dasd");
  272. },
  273. //返回选中的物资信息
  274. selectionChange2(selection) {
  275. this.materialList1 = [];
  276. this.materialList1 = selection;
  277. this.materialList = this.materialList.concat(this.materialList1);
  278. },
  279. makeSureMaterial() {
  280. console.log(this.materialList);
  281. var materialIdList = [];
  282. this.materialList.forEach(e => {
  283. if (materialIdList.indexOf(e.materialId) == -1) {
  284. materialIdList.push(e.materialId);
  285. }
  286. });
  287. let map = {
  288. materialList: materialIdList
  289. };
  290. this.materialList = [];
  291. this.materialList1 = [];
  292. if (this.activeName == "first") {
  293. this.axios
  294. .post("/api/v1/qms/getQueueListByQueueUp?isSpelling=0", map)
  295. .then(res => {
  296. this.tableData1 = res.data.data;
  297. });
  298. } else {
  299. this.axios
  300. .post("/api/v1/qms/getQueueListByQueueUp?apiId=473&isSpelling=1", map)
  301. .then(res => {
  302. this.tableData = res.data.data;
  303. this.getSpanArr(this.tableData);
  304. });
  305. }
  306. this.table1 = false;
  307. },
  308. infomation() {
  309. this.axios.get("/api/v1/uc/getSteelWarehouse").then(res => {
  310. console.log(res.data);
  311. this.option = res.data;
  312. });
  313. },
  314. //记录每一行的合并数
  315. getSpanArr(data) {
  316. //每次调用方法初始化
  317. this.spanArr = [];
  318. for (var i = 0; i < data.length; i++) {
  319. if (i === 0) {
  320. this.spanArr.push(1);
  321. this.pos = 0;
  322. } else {
  323. // 判断当前元素与上一个元素是否相同
  324. if (data[i].resultTotalId === data[i - 1].resultTotalId) {
  325. this.spanArr[this.pos] += 1;
  326. this.spanArr.push(0);
  327. } else {
  328. this.spanArr.push(1);
  329. this.pos = i;
  330. }
  331. }
  332. }
  333. },
  334. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  335. if (
  336. columnIndex === 0 ||
  337. columnIndex === 1 ||
  338. columnIndex === 2 ||
  339. columnIndex === 3 ||
  340. columnIndex === 4 ||
  341. columnIndex === 9 ||
  342. columnIndex === 10 ||
  343. columnIndex === 12
  344. ) {
  345. const _row = this.spanArr[rowIndex];
  346. const _col = _row > 0 ? 1 : 0;
  347. return {
  348. rowspan: _row,
  349. colspan: _col
  350. };
  351. }
  352. },
  353. handleClick() {
  354. if (this.activeName == "first") {
  355. this.getNoSpellingArray();
  356. } else {
  357. this.getSpellingArray();
  358. }
  359. },
  360. getNoSpellingArray() {
  361. this.axios
  362. .post("/api/v1/qms/getQueueListByQueueUp?isSpelling=0&i=" + new Date())
  363. .then(res => {
  364. this.tableData1 = res.data.data;
  365. });
  366. },
  367. getSpellingArray() {
  368. this.axios
  369. .post(
  370. "/api/v1/qms/getQueueListByQueueUp?apiId=473&isSpelling=1&i=" +
  371. new Date()
  372. )
  373. .then(res => {
  374. this.tableData = res.data.data;
  375. console.log(this.tableData);
  376. this.getSpanArr(this.tableData);
  377. });
  378. },
  379. onclick() {
  380. if (this.activeName == "first") {
  381. this.option1.requestUrl =
  382. "/api/v1/qms/getQueueListByQueueUp?apiId=473&isSpelling=0?capacityNumber=" +
  383. this.capacityNo +
  384. "&i=" +
  385. new Date();
  386. } else {
  387. this.axios
  388. .post(
  389. "/api/v1/qms/getQueueListByQueueUp?apiId=473&isSpelling=1&i=" +
  390. new Date() +
  391. "&capacityNumber=" +
  392. this.capacityNo
  393. )
  394. .then(res => {
  395. this.tableData = res.data.data;
  396. this.getSpanArr(this.tableData);
  397. });
  398. }
  399. },
  400. handleSelectionChange(selection) {
  401. this.maplist = [];
  402. this.maplist = selection;
  403. },
  404. updateBill(scope) {
  405. console.log(scope.row.capacityId);
  406. this.$router.push(
  407. `/editBill/${scope.row.capacityId}/${scope.row.capacityNumber}`
  408. );
  409. },
  410. filterArr(resultId) {
  411. console.log("fdhjsaj");
  412. this.filterArr1 = this.filterArr1.concat(
  413. this.tableData.filter(ele => ele.resultId == resultId)
  414. );
  415. },
  416. allow() {
  417. if (this.maplist.length == 0) {
  418. this.$message.error("请选择需要放行的车辆");
  419. return;
  420. }
  421. for (let i = 0; i < this.maplist.length; i++) {
  422. if (typeof this.maplist[i].id == "undefined") {
  423. this.$message.error("请选择装货点");
  424. return;
  425. }
  426. this.filterArr(this.maplist[i].resultId);
  427. }
  428. var filterArr2 = [];
  429. this.filterArr1.forEach(e => {
  430. if (filterArr2.indexOf(e) === -1) {
  431. filterArr2.push(e);
  432. }
  433. });
  434. let map = {
  435. ssoId: getCookie("userId"),
  436. mapList: filterArr2
  437. };
  438. if (this.activeName == "first") {
  439. map.mapList = this.maplist;
  440. }
  441. this.axios.post("/api/v1/qms/allowEnFactory", map).then(res => {
  442. if (res.data.code == "200") {
  443. this.$message.success("放行成功,等待进厂");
  444. this.getNoSpellingArray();
  445. this.getSpellingArray();
  446. }
  447. });
  448. }
  449. }
  450. };
  451. </script>
  452. <style lang="scss" scoped>
  453. .sale {
  454. .top {
  455. width: 100%;
  456. height: 80px;
  457. display: flex;
  458. align-items: center;
  459. padding-left: 40px;
  460. .el-form {
  461. display: flex;
  462. justify-content: center;
  463. align-items: center;
  464. .el-form-item__label {
  465. align-items: center;
  466. line-height: 80px;
  467. }
  468. }
  469. }
  470. .input {
  471. width: 250px;
  472. margin-right: 20px;
  473. }
  474. .tabs {
  475. margin-left: 20px;
  476. margin-top: 10px;
  477. .tabs /deep/ .el-tabs__nav {
  478. font-size: 40px;
  479. }
  480. }
  481. }
  482. </style>