queueFJumpLine.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416
  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="resultInsertTime" label="插队时间">
  125. </el-table-column>
  126. <el-table-column prop="gatepostName" label="进厂门岗">
  127. </el-table-column>
  128. </el-table>
  129. </el-tab-pane>
  130. <el-tab-pane label="多拼车辆排队链表" name="second">
  131. <el-table
  132. :data="tableData"
  133. :span-method="objectSpanMethod"
  134. border
  135. style="width: 100%; margin-top: 20px"
  136. @selection-change="handleSelectionChange"
  137. max-height="500px"
  138. >
  139. <el-table-column type="selection" width="55"></el-table-column>
  140. <el-table-column prop="capacityNumber" label="车牌号" fit>
  141. </el-table-column>
  142. <el-table-column prop="grid" label="拼数" fit> </el-table-column>
  143. <el-table-column prop="resultStartTime" label="排队开始时间">
  144. </el-table-column>
  145. <el-table-column
  146. prop="listNodeOrder"
  147. label="序号"
  148. ></el-table-column>
  149. <el-table-column prop="materialName" label="物资名称">
  150. </el-table-column>
  151. <el-table-column prop="materialSpecification" label="物资规格">
  152. </el-table-column>
  153. <el-table-column prop="materialModel" label="物资型号">
  154. </el-table-column>
  155. <el-table-column prop="materialNumber" label="物资件数">
  156. </el-table-column>
  157. <el-table-column prop="driverTel" label="司机电话号码">
  158. </el-table-column>
  159. <el-table-column prop="gatepostName" label="进厂门岗">
  160. </el-table-column>
  161. <el-table-column prop="resultInsertTime" label="插队时间">
  162. </el-table-column>
  163. <el-table-column prop="sureTime" label="可进厂确认时间">
  164. </el-table-column>
  165. </el-table>
  166. </el-tab-pane>
  167. </el-tabs>
  168. </div>
  169. </div>
  170. </template>
  171. <script>
  172. export default {
  173. data() {
  174. return {
  175. capacityNo: "",
  176. inputText: "",
  177. optionMa: {
  178. // 表格请求数据的地址
  179. requestUrl: "",
  180. // 控制显示多选列
  181. selectionType: "select"
  182. },
  183. activeName: "first",
  184. tableData: [],
  185. tableData1: [],
  186. //存放每一行记录的合并数
  187. spanArr: [],
  188. maplist: [],
  189. id: null,
  190. option: [],
  191. filterArr1: [],
  192. table1: false,
  193. //物资选中表格
  194. materialList: [],
  195. //物资选中暂存
  196. materialList1: [],
  197. //物资信息查询内容
  198. materialNameText: null,
  199. materialSpecificationText: null,
  200. materialModelText: null
  201. };
  202. },
  203. watch: {
  204. activeName() {}
  205. },
  206. mounted() {
  207. this.getSpellingArray();
  208. this.getNoSpellingArray();
  209. },
  210. methods: {
  211. rowDbClick(row) {
  212. this.materialList = [];
  213. this.materialList.push(row);
  214. this.makeSureMaterial();
  215. },
  216. //物资模态框查询
  217. onclickMaterial1() {
  218. this.optionMa.requestUrl =
  219. "/api/v1/uc/getSteelMaterial?apiId=244&materialNameText=" +
  220. this.materialNameText +
  221. "&materialSpecificationText=" +
  222. this.materialSpecificationText;
  223. },
  224. onclickMaterial() {
  225. this.table1 = true;
  226. this.optionMa.requestUrl =
  227. "/api/v1/uc/getSteelMaterial?apiId=244&i=" + new Date();
  228. console.log("dasd");
  229. },
  230. //返回选中的物资信息
  231. selectionChange2(selection) {
  232. this.materialList1 = [];
  233. this.materialList1 = selection;
  234. this.materialList = this.materialList.concat(this.materialList1);
  235. },
  236. makeSureMaterial() {
  237. console.log(this.materialList);
  238. var materialIdList = [];
  239. this.materialList.forEach(e => {
  240. if (materialIdList.indexOf(e.materialId) == -1) {
  241. materialIdList.push(e.materialId);
  242. }
  243. });
  244. let map = {
  245. materialList: materialIdList
  246. };
  247. this.materialList = [];
  248. this.materialList1 = [];
  249. if (this.activeName == "first") {
  250. this.axios
  251. .post("/api/v1/qms/getQueueListByQueueUp?isSpelling=0", map)
  252. .then(res => {
  253. this.tableData1 = res.data.data;
  254. });
  255. } else {
  256. this.axios
  257. .post("/api/v1/qms/getQueueListByQueueUp?apiId=473&isSpelling=1", map)
  258. .then(res => {
  259. this.tableData = res.data.data;
  260. this.getSpanArr(this.tableData);
  261. });
  262. }
  263. this.table1 = false;
  264. },
  265. //记录每一行的合并数
  266. getSpanArr(data) {
  267. //每次调用方法初始化
  268. this.spanArr = [];
  269. for (var i = 0; i < data.length; i++) {
  270. if (i === 0) {
  271. this.spanArr.push(1);
  272. this.pos = 0;
  273. } else {
  274. // 判断当前元素与上一个元素是否相同
  275. if (data[i].resultTotalId === data[i - 1].resultTotalId) {
  276. this.spanArr[this.pos] += 1;
  277. this.spanArr.push(0);
  278. } else {
  279. this.spanArr.push(1);
  280. this.pos = i;
  281. }
  282. }
  283. }
  284. },
  285. objectSpanMethod({ row, column, rowIndex, columnIndex }) {
  286. if (
  287. columnIndex === 0 ||
  288. columnIndex === 1 ||
  289. columnIndex === 2 ||
  290. columnIndex === 3 ||
  291. columnIndex === 4 ||
  292. columnIndex === 9 ||
  293. columnIndex === 10 ||
  294. columnIndex === 12
  295. ) {
  296. const _row = this.spanArr[rowIndex];
  297. const _col = _row > 0 ? 1 : 0;
  298. return {
  299. rowspan: _row,
  300. colspan: _col
  301. };
  302. }
  303. },
  304. handleClick() {
  305. if (this.activeName == "first") {
  306. this.getNoSpellingArray();
  307. } else {
  308. this.getSpellingArray();
  309. }
  310. },
  311. getNoSpellingArray() {
  312. this.axios
  313. .post("/api/v1/qms/getQueueListByQueueUp?isSpelling=0&i=" + new Date())
  314. .then(res => {
  315. this.tableData1 = res.data.data;
  316. });
  317. },
  318. getSpellingArray() {
  319. this.axios
  320. .post(
  321. "/api/v1/qms/getQueueListByQueueUp?apiId=473&isSpelling=1&i=" +
  322. new Date()
  323. )
  324. .then(res => {
  325. this.tableData = res.data.data;
  326. console.log(this.tableData);
  327. this.getSpanArr(this.tableData);
  328. });
  329. },
  330. onclick() {
  331. if (this.activeName == "first") {
  332. this.option1.requestUrl =
  333. "/api/v1/qms/getQueueListByQueueUp?apiId=473&isSpelling=0?capacityNumber=" +
  334. this.capacityNo +
  335. "&i=" +
  336. new Date();
  337. } else {
  338. this.axios
  339. .post(
  340. "/api/v1/qms/getQueueListByQueueUp?apiId=473&isSpelling=1&i=" +
  341. new Date() +
  342. "&capacityNumber=" +
  343. this.capacityNo
  344. )
  345. .then(res => {
  346. this.tableData = res.data.data;
  347. this.getSpanArr(this.tableData);
  348. });
  349. }
  350. },
  351. handleSelectionChange(selection) {
  352. this.maplist = [];
  353. this.maplist = selection;
  354. },
  355. updateBill(scope) {
  356. console.log(scope.row.capacityId);
  357. this.$router.push(
  358. `/editBill/${scope.row.capacityId}/${scope.row.capacityNumber}`
  359. );
  360. },
  361. filterArr(resultId) {
  362. console.log("fdhjsaj");
  363. this.filterArr1 = this.filterArr1.concat(
  364. this.tableData.filter(ele => ele.resultId == resultId)
  365. );
  366. },
  367. allow() {
  368. if (this.maplist.length == 0) {
  369. this.$message.error("请选择需要插队的车辆");
  370. return;
  371. }
  372. let map = {
  373. mapList: this.maplist
  374. };
  375. this.axios.post("/api/v1/qms/queueCutInLine", map).then(res => {
  376. if (res.data.code == "200") {
  377. this.$message.success("插队成功,等待放行");
  378. this.getNoSpellingArray();
  379. this.getSpellingArray();
  380. }
  381. });
  382. }
  383. }
  384. };
  385. </script>
  386. <style lang="scss" scoped>
  387. .sale {
  388. .top {
  389. width: 100%;
  390. height: 80px;
  391. display: flex;
  392. align-items: center;
  393. padding-left: 40px;
  394. .el-form {
  395. display: flex;
  396. justify-content: center;
  397. align-items: center;
  398. .el-form-item__label {
  399. align-items: center;
  400. line-height: 80px;
  401. }
  402. }
  403. }
  404. .input {
  405. width: 250px;
  406. margin-right: 20px;
  407. }
  408. .tabs {
  409. margin-left: 20px;
  410. margin-top: 10px;
  411. .tabs /deep/ .el-tabs__nav {
  412. font-size: 40px;
  413. }
  414. }
  415. }
  416. </style>