addSaleOrderSteelSendCarrier.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819
  1. <template>
  2. <div class="addSaleOrderSend">
  3. <page-title>新增销售订单钢材派车</page-title>
  4. <!-- 派车表格 -->
  5. <div class="selectionTable from">
  6. <el-table
  7. :data="selectionList"
  8. border
  9. style="width: 100%"
  10. highlight-current-row
  11. :span-method="cellMerge"
  12. >
  13. <el-table-column
  14. v-for="(item, i) in tableTop"
  15. :key="i"
  16. :prop="item.prop"
  17. :label="item.label"
  18. :width="item.width"
  19. align="center"
  20. show-overflow-tooltip
  21. >
  22. <template slot="scope" v-if="item.label !== '车牌号'">
  23. <span>{{ item.label }}</span>
  24. </template>
  25. <template slot="scope" v-if="item.label !== '承运商'">
  26. <span>{{ item.label }}</span>
  27. </template>
  28. <template slot="scope" v-if="item.label !== '件数'">
  29. <span>{{ item.label }}</span>
  30. </template>
  31. <template slot="scope" v-if="item.label !== '运输线路'">
  32. <span>{{ item.label }}</span>
  33. </template>
  34. <template slot="scope" v-if="item.label !== '运输单价'">
  35. <span>{{ item.label }}</span>
  36. </template>
  37. <template slot="scope" v-if="item.label !== '订单有效期'">
  38. <span>{{ item.label }}</span>
  39. </template>
  40. <template slot="scope" v-if="item.label !== '收货客户'">
  41. <span>{{ item.label }}</span>
  42. </template>
  43. <template slot="scope" v-if="item.label !== '收货客户电话号码'">
  44. <span>{{ item.label }}</span>
  45. </template>
  46. <template slot="scope" v-if="item.label !== '备注'">
  47. <span>{{ item.label }}</span>
  48. </template>
  49. <!-- 插入输入框 -->
  50. <template slot-scope="scope">
  51. <template v-if="item.slot">
  52. <!-- 车牌号 -->
  53. <template v-if="item.prop == 'capacityNumber'">
  54. <el-autocomplete
  55. class="inline-input"
  56. v-model="scope.row.capacityNumber"
  57. :fetch-suggestions="querySearch"
  58. placeholder="(必填)"
  59. :trigger-on-focus="false"
  60. @select="handleSelect(scope.row, scope.$index)"
  61. @blur="checkRelationship(scope.$index)"
  62. @change="batchUpdateValue(scope.row, scope.$index)"
  63. ></el-autocomplete>
  64. </template>
  65. <!-- 司机电话号码 -->
  66. <template v-if="item.prop == 'driverTel'">
  67. <el-input
  68. class="textinput"
  69. placeholder="(必填)"
  70. @blur="checkIsTelephone(scope.$index)"
  71. v-model="scope.row.driverTel"
  72. ></el-input>
  73. </template>
  74. <!-- 承运商 -->
  75. <template v-if="item.prop == 'carrierName'">
  76. <el-select
  77. v-model="scope.row.carrierName"
  78. placeholder="请选择"
  79. @change="batchUpdateValue(scope.row, scope.$index)"
  80. disabled
  81. >
  82. <el-option
  83. v-for="item in carrierNameOptions[scope.$index]"
  84. :key="item.value"
  85. :label="item.label"
  86. :value="item.value"
  87. >
  88. </el-option>
  89. </el-select>
  90. </template>
  91. <!-- 物资件数 -->
  92. <template v-if="item.prop == 'orderPlanWeight'">
  93. <el-input
  94. class="textinput"
  95. @input="onInput"
  96. placeholder="(必填)"
  97. v-model.number="scope.row.orderPlanWeight"
  98. disabled
  99. ></el-input>
  100. </template>
  101. <!-- 物资重量 -->
  102. <template v-if="item.prop == 'materialWeight'">
  103. <el-input
  104. class="textinput"
  105. v-model.number="scope.row.materialWeight"
  106. disabled
  107. ></el-input>
  108. </template>
  109. <!-- 运输单价id -->
  110. <template v-if="item.prop == 'priceValue'">
  111. <el-input v-model="scope.row.priceValue" disabled> </el-input>
  112. </template>
  113. <!-- 订单有效期 -->
  114. <template v-if="item.prop == 'saleDateOfReceipt'">
  115. <el-date-picker
  116. class="textinput3"
  117. type="date"
  118. v-model.number="scope.row.saleDateOfReceipt"
  119. style="width:135px"
  120. disabled
  121. ></el-date-picker>
  122. </template>
  123. <!-- 收货客户 -->
  124. <template v-if="item.prop == 'saleOrderConsignee'">
  125. <el-input
  126. class="textinput4"
  127. placeholder="(非必填)"
  128. v-model.number="scope.row.saleOrderConsignee"
  129. disabled
  130. ></el-input>
  131. </template>
  132. <!-- 收货客户电话号码 -->
  133. <template v-if="item.prop == 'saleOrderConsigneeTel'">
  134. <el-input
  135. class="textinput5"
  136. placeholder="(非必填)"
  137. v-model.number="scope.row.saleOrderConsigneeTel"
  138. @input="onInput"
  139. disabled
  140. ></el-input>
  141. </template>
  142. </template>
  143. <template v-else>
  144. <span>{{ scope.row[item.prop] }}</span>
  145. </template>
  146. </template>
  147. </el-table-column>
  148. <!-- 操作列 -->
  149. <!-- <el-table-column fixed="right" label="操作" width="100">
  150. </el-table-column> -->
  151. </el-table>
  152. </div>
  153. <div class="button_box">
  154. <el-button @click="cancel">取消</el-button>
  155. <el-button type="primary" @click="makeSure" :loading="isLoading"
  156. >确定</el-button
  157. >
  158. </div>
  159. </div>
  160. </template>
  161. <script>
  162. import PageTitle from "@/components/Page/Title";
  163. import { getCookie } from "@/utils/util.js";
  164. import { sjTime, isNumber, isIntegerNumber } from "@/utils/sharedJsFile";
  165. import returnResultVue from "../../../inward/components/offsetSteel/truckTransport/returnResult.vue";
  166. export default {
  167. components: { PageTitle },
  168. data() {
  169. return {
  170. //是否正在加载
  171. isLoading: false,
  172. //存放每一行记录的合并数
  173. spanArr: [],
  174. //pos是spanArr的索引
  175. pos: 0,
  176. //加载
  177. selectLineLoading: false,
  178. //承运商下拉框中的值
  179. carrierNameOptions: [],
  180. //当前车序号物资
  181. selectionList: [],
  182. driverTel1: null,
  183. //是否可发送请求
  184. canSend: 1,
  185. statusStr: null,
  186. tableTop: [
  187. {
  188. prop: "truckNo",
  189. label: "车序号",
  190. width: "50"
  191. },
  192. {
  193. prop: "capacityNumber",
  194. label: "车牌号",
  195. width: "130",
  196. slot: true
  197. },
  198. {
  199. prop: "driverTel",
  200. label: "司机电话号码",
  201. width: "150",
  202. slot: true
  203. },
  204. {
  205. prop: "carrierName",
  206. label: "承运商",
  207. width: "240",
  208. slot: true
  209. },
  210. {
  211. prop: "materialName",
  212. label: "物资名称",
  213. width: "140"
  214. },
  215. {
  216. prop: "Specification",
  217. label: "规格型号",
  218. width: "140"
  219. },
  220. {
  221. prop: "orderPlanWeight",
  222. label: "件数",
  223. width: "80",
  224. slot: true
  225. },
  226. {
  227. prop: "materialWeight",
  228. label: "重量",
  229. width: "80",
  230. slot: true
  231. },
  232. {
  233. prop: "lineName",
  234. label: "厂内运输线路",
  235. width: "220"
  236. },
  237. {
  238. prop: "saleDateOfReceipt",
  239. label: "订单有效期",
  240. width: "150",
  241. slot: true
  242. },
  243. {
  244. prop: "saleShipperAddressName",
  245. label: "收货地址",
  246. width: "300"
  247. },
  248. {
  249. prop: "priceValue",
  250. label: "运输单价",
  251. width: "80",
  252. slot: true
  253. },
  254. {
  255. prop: "saleOrderConsignee",
  256. label: "收货客户",
  257. width: "150",
  258. slot: true
  259. },
  260. {
  261. prop: "saleOrderConsigneeTel",
  262. label: "收货客户电话号码",
  263. slot: true,
  264. width: "150"
  265. },
  266. {
  267. prop: "materialCode",
  268. label: "物资编码",
  269. width: "140"
  270. },
  271. {
  272. prop: "truckRemark",
  273. label: "备注",
  274. width: "140"
  275. }
  276. ]
  277. };
  278. },
  279. created() {
  280. this.getValue();
  281. },
  282. methods: {
  283. getValue() {
  284. let map = {};
  285. if (getCookie("orgCode") == "chengyunshang") {
  286. map.saleOrderId = this.$route.params.saleOrderId;
  287. map.carrierSsoId = getCookie("userId");
  288. } else {
  289. map.saleOrderId = this.$route.params.saleOrderId;
  290. }
  291. this.axios
  292. .post("/api/v1/ams/getCarrierTruckNoAndMaterialList", map)
  293. .then(res => {
  294. if (res.data.data.length == 0) {
  295. this.$confirm("该销售订单尚未排车!是否先进行排车?", "提示", {
  296. confirmButtonText: "确定",
  297. cancelButtonText: "取消",
  298. type: "warning",
  299. center: true
  300. })
  301. .then(() => {
  302. this.$router.push(
  303. "/addSaleOrderArrange/" + this.$route.params.saleOrderId
  304. );
  305. })
  306. .catch(() => {
  307. this.$message({ type: "info", message: "取消!" });
  308. });
  309. }
  310. console.log("res.data.data", res.data.data);
  311. this.statusStr = res.data.data[0].statusStr;
  312. //赋值派车表格
  313. res.data.data.forEach((e, i) => {
  314. if (e.saleOrderConsignee == "null") {
  315. e.saleOrderConsignee = null;
  316. }
  317. if (e.saleOrderConsigneeTel == "null") {
  318. e.saleOrderConsigneeTel = null;
  319. }
  320. //带承运商初始化派车表格
  321. var addmap = {
  322. truckNo: e.truckNo,
  323. saleOrderMaterialId: e.saleOrderMaterialId,
  324. capacityNumber: null,
  325. driverTel: null,
  326. carrierName: e.carrierName,
  327. carrierId: e.carrierId,
  328. materialId: e.materialId,
  329. materialName: e.materialName,
  330. Specification: e.materialModelSpecification,
  331. materialCode: e.materialCode,
  332. orderPlanWeight: e.materialNumber,
  333. materialWeight: e.materialWeight,
  334. lineName: null,
  335. lineId: null,
  336. saleShipperAddressId: e.placeId,
  337. saleShipperAddressName: e.place,
  338. saleDateOfReceipt: e.receiptDate,
  339. saleOrderConsignee: e.saleOrderConsignee,
  340. saleOrderConsigneeTel: e.saleOrderConsigneeTel,
  341. truckRemark: e.truckRemark
  342. };
  343. this.selectionList.push(addmap);
  344. //调用记录每一行的合并数的方法
  345. this.getSpanArr(this.selectionList);
  346. //初始化每个车的线路
  347. this.initializeLine();
  348. });
  349. });
  350. },
  351. onInput(val) {
  352. if (!isNumber(val)) {
  353. this.$message.warning("重量/电话号码请输入数字");
  354. }
  355. },
  356. //校验是否为车牌
  357. isVehicleNumber(vehicleNumber) {
  358. var result = false;
  359. if (vehicleNumber != null) {
  360. if (vehicleNumber.length == 7) {
  361. var express = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$/;
  362. result = express.test(vehicleNumber);
  363. }
  364. }
  365. return result;
  366. },
  367. //绑定车牌号和承运商的关系
  368. bindRelationship(mapValue) {
  369. let RmsCapacity = {
  370. capacityTypeId: 1,
  371. capacityNumber: mapValue.capacityNumber,
  372. capacityCorlor: "黄",
  373. capacityOwneris: "否",
  374. capacityVip: "否",
  375. capacityBlacklist: "否",
  376. remark: null,
  377. carrierId: mapValue.carrierId,
  378. state: mapValue.carrierName
  379. };
  380. this.$confirm(
  381. "车牌号(" +
  382. mapValue.capacityNumber +
  383. ")与承运商未有绑定关系, 是否立即绑定该车牌号和承运商?",
  384. "提示",
  385. {
  386. confirmButtonText: "确定",
  387. cancelButtonText: "取消",
  388. type: "warning"
  389. }
  390. )
  391. .then(() => {
  392. this.axios
  393. .post("/api/v1/rms/insertCapacity", RmsCapacity)
  394. .then(res => {
  395. console.log("res", res);
  396. if (res.data.data == 0) {
  397. this.$message.success("该车牌号与承运商绑定关系成功!");
  398. }
  399. });
  400. })
  401. .catch(() => {
  402. this.$message({ type: "info", message: "已取消删除" });
  403. });
  404. },
  405. //失焦事件后确定车牌号与承运商是否有绑定关系
  406. checkRelationship(index) {
  407. if (this.selectionList[index].carrierId != null) {
  408. //暂存车牌号
  409. var capacityNumber1;
  410. if (this.isVehicleNumber(this.selectionList[index].capacityNumber)) {
  411. let mapValue = {
  412. capacityNumber: this.selectionList[index].capacityNumber,
  413. carrierId: this.selectionList[index].carrierId,
  414. carrierName: this.selectionList[index].carrierName
  415. };
  416. this.axios
  417. .post("/api/v1/uc/isInCapacityCarrier", mapValue)
  418. .then(res => {
  419. if (res.data.code == "201") {
  420. capacityNumber1 = res.data.data;
  421. if (capacityNumber1 == null) {
  422. this.selectionList[index].capacityNumber = null;
  423. this.$message.error("该车牌号未注册,请先前往注册!");
  424. } else {
  425. this.bindRelationship(mapValue);
  426. }
  427. }
  428. });
  429. }
  430. }
  431. },
  432. //车牌号弹出层
  433. handleSelect(row, index) {
  434. this.axios
  435. .post(
  436. "/api/v1/ams/matchingDriverTelRecently?capacityNumber=" +
  437. row.capacityNumber
  438. )
  439. .then(res => {
  440. row.driverTel = res.data.data;
  441. });
  442. },
  443. //以下是车牌号边输边查搜索
  444. querySearch(queryString, cb) {
  445. this.axios
  446. .post("/api/v1/uc/getCapacityByLike?index=" + queryString)
  447. .then(res => {
  448. if (res.data.code == "200") {
  449. var restaurants = res.data.data;
  450. var results = queryString
  451. ? restaurants.filter(this.createFilter(queryString))
  452. : restaurants;
  453. // 调用 callback 返回建议列表的数据
  454. cb(results);
  455. }
  456. });
  457. },
  458. createFilter(queryString) {
  459. return restaurants => {
  460. return (
  461. restaurants.value.toLowerCase().indexOf(queryString.toLowerCase()) >
  462. -1
  463. );
  464. };
  465. },
  466. //以上是车牌号边输边查搜索
  467. //校验是否为电话号码
  468. checkIsTelephone(index) {
  469. //电话号码校验
  470. console.log("电话号码"+this.selectionList[index].driverTel);
  471. var reg = /^[1][3456789]\d{9}$/;
  472. if (!reg.test(this.selectionList[index].driverTel)) {
  473. this.canSend = -1;
  474. this.$message.warning("电话号码格式不正确,请输入正确的电话号码!");
  475. } else {
  476. this.canSend = 1;
  477. }
  478. },
  479. //点击确定按钮的事件
  480. makeSure() {
  481. this.isLoading = true;
  482. //是否可发送请求
  483. if (this.canSend == -1) {
  484. this.$message.warning("电话号码格式不正确,请输入正确的电话号码!");
  485. } else {
  486. this.$confirm("是否确定进行钢材派单!", "提示", {
  487. confirmButtonText: "确定",
  488. cancelButtonText: "取消",
  489. type: "warning",
  490. center: true
  491. })
  492. .then(() => {
  493. var mapList = [];
  494. for (var i = 0; i < this.spanArr.length; i++) {
  495. if (this.spanArr[i] > 0 && this.selectionList[i].capacityNumber) {
  496. var mapItem = {
  497. //车牌号
  498. capacityNumber: null,
  499. //司机电话号码
  500. driverTel: null,
  501. //车序号主键
  502. saleOrderMaterialId: 0,
  503. //承运商Id
  504. carrierId: 0,
  505. //线路Id
  506. lineId: 0
  507. };
  508. mapItem.capacityNumber = this.selectionList[i].capacityNumber;
  509. mapItem.driverTel = this.selectionList[i].driverTel;
  510. mapItem.saleOrderMaterialId = this.selectionList[
  511. i
  512. ].saleOrderMaterialId;
  513. mapItem.carrierId = this.selectionList[i].carrierId;
  514. mapItem.lineId = this.selectionList[i].lineId;
  515. mapList.push(mapItem);
  516. }
  517. }
  518. this.axios
  519. .post("/api/v1/ams/dispatchSteelOrder", mapList)
  520. .then(res => {
  521. if (res.data.code == "200") {
  522. this.cancel();
  523. this.$message.success("派单成功!");
  524. this.isLoading = false;
  525. } else {
  526. this.$message.error("派单失败:" + res.data.data);
  527. this.isLoading = false;
  528. }
  529. this.isLoading = false;
  530. });
  531. })
  532. .catch(() => {
  533. this.$message({ type: "info", message: "取消!" });
  534. this.isLoading = false;
  535. });
  536. }
  537. },
  538. //点击取消按钮的事件
  539. cancel() {
  540. this.$router.push("/saleOrderSteelCarrier");
  541. },
  542. //批量修改内层值
  543. batchUpdateValue(row, index) {
  544. for (var i = index; i < this.spanArr[index] + index; i++) {
  545. this.selectionList[i].capacityNumber = row.capacityNumber;
  546. this.selectionList[i].driverTel = this.driverTel1;
  547. }
  548. },
  549. //初始化线路
  550. initializeLine() {
  551. for (var i = 0; i < this.spanArr.length; i++) {
  552. if (this.spanArr[i] == 1) {
  553. for (var j = i; j < this.spanArr[i] + i; j++) {
  554. this.selectionList[j].lineName =
  555. "总厂:销售钢材单拼路线" + " " + "进厂-计皮-装货-计毛-出厂";
  556. this.selectionList[j].lineId = 110001;
  557. }
  558. }
  559. if (this.spanArr[i] == 2) {
  560. for (var j = i; j < this.spanArr[i] + i; j++) {
  561. this.selectionList[j].lineName =
  562. "总厂:销售钢材二拼路线" +
  563. " " +
  564. "计皮-进厂-装货-计毛-计皮-装货-计毛-出厂";
  565. this.selectionList[j].lineId = 110002;
  566. }
  567. }
  568. if (this.spanArr[i] == 3) {
  569. for (var j = i; j < this.spanArr[i] + i; j++) {
  570. this.selectionList[j].lineName =
  571. "总厂:销售钢材三拼路线" +
  572. " " +
  573. "进厂-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-出厂";
  574. this.selectionList[j].lineId = 110003;
  575. }
  576. }
  577. if (this.spanArr[i] == 4) {
  578. for (var j = i; j < this.spanArr[i] + i; j++) {
  579. this.selectionList[j].lineName =
  580. "总厂:销售钢材四拼路线" +
  581. " " +
  582. "进厂-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-出厂";
  583. this.selectionList[j].lineId = 110004;
  584. }
  585. }
  586. if (this.spanArr[i] == 5) {
  587. for (var j = i; j < this.spanArr[i] + i; j++) {
  588. this.selectionList[j].lineName =
  589. "总厂:销售钢材五拼路线" +
  590. " " +
  591. "进厂-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-出厂";
  592. this.selectionList[j].lineId = 110005;
  593. }
  594. }
  595. if (this.spanArr[i] == 6) {
  596. for (var j = i; j < this.spanArr[i] + i; j++) {
  597. this.selectionList[j].lineName =
  598. "总厂:销售钢材六拼路线" +
  599. " " +
  600. "进厂-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-出厂";
  601. this.selectionList[j].lineId = 110006;
  602. }
  603. }
  604. if (this.spanArr[i] == 7) {
  605. for (var j = i; j < this.spanArr[i] + i; j++) {
  606. this.selectionList[j].lineName =
  607. "总厂:销售钢材七拼路线" +
  608. " " +
  609. "进厂-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-出厂";
  610. this.selectionList[j].lineId = 110007;
  611. }
  612. }
  613. if (this.spanArr[i] == 8) {
  614. for (var j = i; j < this.spanArr[i] + i; j++) {
  615. this.selectionList[j].lineName =
  616. "总厂:销售钢材八拼路线" +
  617. " " +
  618. "进厂-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-出厂";
  619. this.selectionList[j].lineId = 110008;
  620. }
  621. }
  622. if (this.spanArr[i] == 9) {
  623. for (var j = i; j < this.spanArr[i] + i; j++) {
  624. this.selectionList[j].lineName =
  625. "总厂:销售钢材九拼路线" +
  626. " " +
  627. "进厂-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-出厂";
  628. this.selectionList[j].lineId = 110009;
  629. }
  630. }
  631. if (this.spanArr[i] == 10) {
  632. for (var j = i; j < this.spanArr[i] + i; j++) {
  633. this.selectionList[j].lineName =
  634. "总厂:销售钢材十拼路线" +
  635. " " +
  636. "进厂-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-计皮-装货-计毛-出厂";
  637. this.selectionList[j].lineId = 110010;
  638. }
  639. }
  640. }
  641. },
  642. //记录每一行的合并数
  643. getSpanArr(data) {
  644. //每次调用方法初始化
  645. this.spanArr = [];
  646. for (var i = 0; i < data.length; i++) {
  647. if (i === 0) {
  648. this.spanArr.push(1);
  649. this.pos = 0;
  650. } else {
  651. // 判断当前元素与上一个元素是否相同
  652. if (data[i].truckNo === data[i - 1].truckNo) {
  653. this.spanArr[this.pos] += 1;
  654. this.spanArr.push(0);
  655. } else {
  656. this.spanArr.push(1);
  657. this.pos = i;
  658. }
  659. }
  660. }
  661. },
  662. //根据条件合并行
  663. cellMerge({ row, column, rowIndex, columnIndex }) {
  664. if (columnIndex === 0) {
  665. const _row = this.spanArr[rowIndex];
  666. const _col = _row > 0 ? 1 : 0;
  667. return {
  668. rowspan: _row,
  669. colspan: _col
  670. };
  671. }
  672. if (columnIndex === 1) {
  673. const _row = this.spanArr[rowIndex];
  674. const _col = _row > 0 ? 1 : 0;
  675. return {
  676. rowspan: _row,
  677. colspan: _col
  678. };
  679. }
  680. if (columnIndex === 2) {
  681. const _row = this.spanArr[rowIndex];
  682. const _col = _row > 0 ? 1 : 0;
  683. return {
  684. rowspan: _row,
  685. colspan: _col
  686. };
  687. }
  688. if (columnIndex === 3) {
  689. const _row = this.spanArr[rowIndex];
  690. const _col = _row > 0 ? 1 : 0;
  691. return {
  692. rowspan: _row,
  693. colspan: _col
  694. };
  695. }
  696. if (columnIndex === 8) {
  697. const _row = this.spanArr[rowIndex];
  698. const _col = _row > 0 ? 1 : 0;
  699. return {
  700. rowspan: _row,
  701. colspan: _col
  702. };
  703. }
  704. if (columnIndex === 9) {
  705. const _row = this.spanArr[rowIndex];
  706. const _col = _row > 0 ? 1 : 0;
  707. return {
  708. rowspan: _row,
  709. colspan: _col
  710. };
  711. }
  712. if (columnIndex === 10) {
  713. const _row = this.spanArr[rowIndex];
  714. const _col = _row > 0 ? 1 : 0;
  715. return {
  716. rowspan: _row,
  717. colspan: _col
  718. };
  719. }
  720. if (columnIndex === 11) {
  721. const _row = this.spanArr[rowIndex];
  722. const _col = _row > 0 ? 1 : 0;
  723. return {
  724. rowspan: _row,
  725. colspan: _col
  726. };
  727. }
  728. if (columnIndex === 12) {
  729. const _row = this.spanArr[rowIndex];
  730. const _col = _row > 0 ? 1 : 0;
  731. return {
  732. rowspan: _row,
  733. colspan: _col
  734. };
  735. }
  736. if (columnIndex === 13) {
  737. const _row = this.spanArr[rowIndex];
  738. const _col = _row > 0 ? 1 : 0;
  739. return {
  740. rowspan: _row,
  741. colspan: _col
  742. };
  743. }
  744. if (columnIndex === 15) {
  745. const _row = this.spanArr[rowIndex];
  746. const _col = _row > 0 ? 1 : 0;
  747. return {
  748. rowspan: _row,
  749. colspan: _col
  750. };
  751. }
  752. }
  753. }
  754. };
  755. </script>
  756. <style lang="scss">
  757. .addSaleOrderSend {
  758. .from {
  759. margin-top: 20px;
  760. .line {
  761. display: flex;
  762. justify-content: center;
  763. align-items: center;
  764. .el-input {
  765. width: 350px;
  766. margin-left: 10px;
  767. margin-right: 10px;
  768. }
  769. }
  770. .sendCar {
  771. display: flex;
  772. justify-content: center;
  773. align-items: center;
  774. .el-input {
  775. width: 70px;
  776. margin-left: 10px;
  777. margin-right: 10px;
  778. margin-top: 10px;
  779. }
  780. }
  781. .vehicle {
  782. display: flex;
  783. justify-content: center;
  784. align-items: center;
  785. margin-top: 20px;
  786. .el-button {
  787. width: 250px;
  788. margin-left: 10px;
  789. margin-right: 10px;
  790. }
  791. .span {
  792. width: 70px;
  793. }
  794. }
  795. }
  796. .tablecls {
  797. margin-top: 20px;
  798. }
  799. .button_box {
  800. display: flex;
  801. justify-content: center;
  802. margin: 20px;
  803. .el-button {
  804. width: 100px;
  805. margin-left: 20px;
  806. }
  807. }
  808. }
  809. </style>