AddOrUpdate.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805
  1. <template>
  2. <el-dialog
  3. :title="title"
  4. :visible.sync="showDialog"
  5. width="80%"
  6. @close="handleClose"
  7. :close-on-click-modal="false"
  8. >
  9. <span>
  10. <el-form ref="form" :model="form" :rules="rules" label-width="90px">
  11. <el-row>
  12. <el-col :span="6">
  13. <el-form-item label="客户名称" prop="fCorpId">
  14. <el-select
  15. v-model="form.fCorpId"
  16. placeholder="请输入客户名称"
  17. :clearable="true"
  18. filterable
  19. size="mini"
  20. style="width: 180px"
  21. :disabled="true"
  22. >
  23. <el-option
  24. v-for="(dict, index) in fMblnoOptions"
  25. :key="index.fId"
  26. :label="dict.fName"
  27. :value="dict.fId"
  28. />
  29. </el-select>
  30. </el-form-item>
  31. </el-col>
  32. <el-col :span="6">
  33. <el-form-item label="业务类型" prop="billType">
  34. <el-select
  35. v-model="form.billType"
  36. placeholder="请选择业务类型"
  37. :disabled="true"
  38. size="mini"
  39. style="width: 180px"
  40. >
  41. <el-option
  42. v-for="(dict, index) in billTypeList"
  43. :key="index.dictSort"
  44. :label="dict.dictLabel"
  45. :value="dict.dictSort"
  46. />
  47. </el-select>
  48. </el-form-item>
  49. </el-col>
  50. <el-col :span="6">
  51. <el-form-item label="运输方式" prop="transType">
  52. <el-select
  53. v-model="form.transType"
  54. placeholder="请选择运输方式"
  55. :disabled="true"
  56. size="mini"
  57. style="width: 180px"
  58. >
  59. <el-option
  60. v-for="(dict, index) in transTypeList"
  61. :key="index.dictValue"
  62. :label="dict.dictLabel"
  63. :value="dict.dictValue"
  64. />
  65. </el-select>
  66. </el-form-item>
  67. </el-col>
  68. <el-col :span="6">
  69. <el-form-item label="运输性质" prop="transProp">
  70. <el-select
  71. v-model="form.transProp"
  72. placeholder="请选择运输方式"
  73. :disabled="true"
  74. size="mini"
  75. style="width: 180px"
  76. >
  77. <el-option
  78. v-for="(dict, index) in transPropList"
  79. :key="index.dictValue"
  80. :label="dict.dictLabel"
  81. :value="dict.dictValue"
  82. />
  83. </el-select>
  84. </el-form-item>
  85. </el-col>
  86. </el-row>
  87. <el-row>
  88. <el-col :span="6">
  89. <el-form-item label="提箱地点" prop="tLoadAddr">
  90. <el-input
  91. v-model="form.tLoadAddr"
  92. placeholder="请输入提箱地点"
  93. :disabled="true"
  94. size="mini"
  95. style="width: 180px"
  96. />
  97. </el-form-item>
  98. </el-col>
  99. <el-col :span="6">
  100. <el-form-item label="提箱时间" prop="loadDate">
  101. <el-date-picker
  102. clearable
  103. size="mini"
  104. style="width: 180px"
  105. v-model="form.loadDate"
  106. type="date"
  107. :disabled="true"
  108. value-format="yyyy-MM-dd"
  109. placeholder="选择卸箱时间"
  110. >
  111. </el-date-picker>
  112. </el-form-item>
  113. </el-col>
  114. <el-col :span="6">
  115. <el-form-item label="装货地点" prop="mdLoadAddr">
  116. <el-input
  117. v-model="form.tMdLoadAddr"
  118. placeholder="装货地点"
  119. :disabled="true"
  120. size="mini"
  121. style="width: 180px"
  122. />
  123. </el-form-item>
  124. </el-col>
  125. <el-col :span="6">
  126. <el-form-item label="装货时间" prop="mdLoadDate">
  127. <el-date-picker
  128. clearable
  129. size="mini"
  130. style="width: 180px"
  131. v-model="form.mdLoadDate"
  132. type="date"
  133. :disabled="true"
  134. value-format="yyyy-MM-dd"
  135. placeholder="选择装货时间"
  136. >
  137. </el-date-picker>
  138. </el-form-item>
  139. </el-col>
  140. <el-col :span="6">
  141. <el-form-item label="卸箱地点" prop="unLoadAddr">
  142. <el-input
  143. v-model="form.unLoadAddr"
  144. placeholder="请输入装卸箱地点"
  145. :disabled="true"
  146. size="mini"
  147. style="width: 180px"
  148. />
  149. </el-form-item>
  150. </el-col>
  151. <el-col :span="6">
  152. <el-form-item label="卸箱时间" prop="unLoadDate">
  153. <el-date-picker
  154. clearable
  155. size="mini"
  156. style="width: 180px"
  157. v-model="form.unLoadDate"
  158. type="date"
  159. :disabled="true"
  160. value-format="yyyy-MM-dd"
  161. placeholder="选择卸箱时间"
  162. >
  163. </el-date-picker>
  164. </el-form-item>
  165. </el-col>
  166. <el-col :span="6">
  167. <el-form-item label="接单时间" prop="acceptDate">
  168. <el-date-picker
  169. clearable
  170. size="mini"
  171. style="width: 180px"
  172. v-model="form.acceptDate"
  173. type="date"
  174. value-format="yyyy-MM-dd"
  175. placeholder="选择接单时间"
  176. :disabled="true"
  177. >
  178. </el-date-picker>
  179. </el-form-item>
  180. </el-col>
  181. <el-col :span="6">
  182. <el-form-item label="回单时间" prop="waybillDate">
  183. <el-date-picker
  184. clearable
  185. size="mini"
  186. style="width: 180px"
  187. v-model="form.waybillDate"
  188. type="date"
  189. value-format="yyyy-MM-dd"
  190. placeholder="选择回单时间"
  191. :disabled="true"
  192. >
  193. </el-date-picker>
  194. </el-form-item>
  195. </el-col>
  196. </el-row>
  197. <el-row>
  198. <el-col :span="6">
  199. <el-form-item label="提单号" prop="mblno">
  200. <el-input
  201. v-model="form.mblno"
  202. placeholder="请输入提单号"
  203. :disabled="true"
  204. size="mini"
  205. style="width: 180px"
  206. />
  207. </el-form-item>
  208. </el-col>
  209. <el-col :span="6">
  210. <el-form-item label="货品名称" prop="goodsId">
  211. <el-select
  212. v-model="form.goodsId"
  213. placeholder="请输入货品名称"
  214. :disabled="true"
  215. clearable
  216. filterable
  217. size="mini"
  218. style="width: 180px"
  219. >
  220. <el-option
  221. v-for="(dict, index) in goodsOptions"
  222. :key="index.fId"
  223. :label="dict.fName"
  224. :value="dict.fId"
  225. />
  226. </el-select>
  227. </el-form-item>
  228. </el-col>
  229. <el-col :span="6">
  230. <el-form-item label="计划件数" prop="qtyPlan">
  231. <el-input
  232. v-model="form.qtyPlan"
  233. placeholder="请输入计划件数"
  234. :disabled="true"
  235. v-input-limit="2"
  236. size="mini"
  237. style="width: 180px"
  238. />
  239. </el-form-item>
  240. </el-col>
  241. <el-col :span="6">
  242. <el-form-item label="重量(吨)" prop="weightPlan">
  243. <el-input
  244. v-model="form.weightPlan"
  245. placeholder="请输入计划重量"
  246. :disabled="true"
  247. v-input-limit="2"
  248. size="mini"
  249. style="width: 180px"
  250. />
  251. </el-form-item>
  252. </el-col>
  253. </el-row>
  254. <el-row>
  255. <el-col :span="6">
  256. <el-form-item label="船名" prop="ysl">
  257. <el-input
  258. v-model="form.ysl"
  259. placeholder="请输入船名"
  260. :disabled="true"
  261. size="mini"
  262. style="width: 180px"
  263. />
  264. </el-form-item>
  265. </el-col>
  266. <el-col :span="6">
  267. <el-form-item label="航次" prop="voy">
  268. <el-input
  269. v-model="form.voy"
  270. placeholder="请输入航次"
  271. :disabled="true"
  272. size="mini"
  273. style="width: 180px"
  274. />
  275. </el-form-item>
  276. </el-col>
  277. <el-col :span="6">
  278. <el-form-item label="起运港" prop="polId">
  279. <el-input
  280. v-model="form.polId"
  281. placeholder="请输入起运港"
  282. :disabled="true"
  283. size="mini"
  284. style="width: 180px"
  285. />
  286. </el-form-item>
  287. </el-col>
  288. <el-col :span="6">
  289. <el-form-item label="目的港" prop="podId">
  290. <el-input
  291. v-model="form.podId"
  292. placeholder="请输入目的港"
  293. :disabled="true"
  294. size="mini"
  295. style="width: 180px"
  296. />
  297. </el-form-item>
  298. </el-col>
  299. </el-row>
  300. </el-form>
  301. <template slot="title">
  302. <i class="header-icon el-icon-circle-plus" style="font-size: 16px"
  303. ><span style="font-size: 16px; font-weight: bolder; margin-left: 5px"
  304. >添加费用明细</span
  305. >
  306. </i>
  307. </template>
  308. <div>
  309. <div
  310. style="display: flex; justify-content: space-between; margin: 10px 0"
  311. >
  312. <div>
  313. <el-button
  314. type="primary"
  315. icon="el-icon-plus"
  316. size="mini"
  317. @click="addRelevt"
  318. :disabled="disabled"
  319. >添加费用</el-button
  320. >
  321. </div>
  322. </div>
  323. </div>
  324. <el-table :data="feesList" style="width: 100%">
  325. <el-table-column
  326. prop="fCorpid"
  327. label="结算单位"
  328. align="center"
  329. width="180"
  330. >
  331. <template slot-scope="scope">
  332. <el-select
  333. v-model="scope.row.fCorpid"
  334. placeholder="请输入客户名称"
  335. :clearable="true"
  336. filterable
  337. size="mini"
  338. style="width: 160px"
  339. disabled
  340. >
  341. <el-option
  342. v-for="(dict, index) in fMblnoOptions"
  343. :key="index.fId"
  344. :label="dict.fName"
  345. :value="dict.fId"
  346. />
  347. </el-select>
  348. </template>
  349. </el-table-column>
  350. <el-table-column prop="fFeeid" label="费用名称">
  351. <template slot-scope="scope">
  352. <el-select
  353. v-model="scope.row.fFeeid"
  354. filterable
  355. :disabled="scope.row.actId != 1090||disabled"
  356. remote
  357. placeholder="费用名称"
  358. >
  359. <el-option
  360. v-for="(dict, index) in fCNameOptions"
  361. :key="index.fId"
  362. :label="dict.fName"
  363. :value="dict.fId"
  364. ></el-option>
  365. </el-select>
  366. </template>
  367. </el-table-column>
  368. <el-table-column prop="fDc" label="收付">
  369. <template slot-scope="scope">
  370. <el-select
  371. v-model="scope.row.fDc"
  372. placeholder="请选择"
  373. :disabled="scope.row.actId != 1090||disabled"
  374. >
  375. <el-option label="收" value="D"></el-option>
  376. <el-option label="付" value="C"></el-option>
  377. </el-select>
  378. </template>
  379. </el-table-column>
  380. <el-table-column prop="fFeeunitid" label="计费单位">
  381. <template slot-scope="scope">
  382. <el-select
  383. v-model="scope.row.fFeeunitid"
  384. placeholder="请选择计费单位"
  385. :disabled="scope.row.actId != 1090||disabled"
  386. clearable
  387. >
  388. <el-option
  389. v-for="dict in jFeetunitOptions"
  390. :key="dict.dictValue"
  391. :label="dict.dictLabel"
  392. :value="dict.dictValue"
  393. />
  394. </el-select>
  395. </template>
  396. </el-table-column>
  397. <el-table-column prop="fBillingQty" label="计费数量">
  398. <template slot-scope="scope">
  399. <el-input
  400. v-model="scope.row.fBillingQty"
  401. :disabled="scope.row.actId != 1090||disabled"
  402. placeholder="请输入内容"
  403. @input="total(scope.row)"
  404. v-input-limit="2"
  405. ></el-input>
  406. </template>
  407. </el-table-column>
  408. <el-table-column prop="fUnitprice" label="单价">
  409. <template slot-scope="scope">
  410. <el-input
  411. v-model="scope.row.fUnitprice"
  412. :disabled="scope.row.actId != 1090||disabled"
  413. placeholder="请输入内容"
  414. @input="total(scope.row)"
  415. v-input-limit="2"
  416. ></el-input>
  417. </template>
  418. </el-table-column>
  419. <el-table-column prop="fCurrency" label="币种">
  420. <template slot-scope="scope">
  421. <el-input
  422. v-model="scope.row.fCurrency"
  423. :disabled="scope.row.actId != 1090||disabled"
  424. placeholder="请输入内容"
  425. ></el-input>
  426. </template>
  427. </el-table-column>
  428. <el-table-column prop="fExrate" label="汇率">
  429. <template slot-scope="scope">
  430. <el-input
  431. v-model="scope.row.fExrate"
  432. :disabled="scope.row.actId != 1090||disabled"
  433. placeholder="请输入内容"
  434. ></el-input>
  435. </template>
  436. </el-table-column>
  437. <el-table-column prop="fAmount" label="金额">
  438. <template slot-scope="scope">
  439. <el-input
  440. v-model="scope.row.fAmount"
  441. :disabled="scope.row.actId != 1090||disabled"
  442. placeholder="请输入内容"
  443. ></el-input>
  444. </template>
  445. </el-table-column>
  446. <el-table-column prop="fTaxrate" label="税率">
  447. <template slot-scope="scope">
  448. <el-input
  449. v-model="scope.row.fTaxrate"
  450. :disabled="scope.row.actId != 1090||disabled"
  451. placeholder="请输入内容"
  452. ></el-input>
  453. </template>
  454. </el-table-column>
  455. <el-table-column prop="remarks" label="备注">
  456. <template slot-scope="scope">
  457. <el-input
  458. v-model="scope.row.remarks"
  459. :disabled="scope.row.actId != 1090||disabled"
  460. placeholder="请输入内容"
  461. ></el-input>
  462. </template>
  463. </el-table-column>
  464. <el-table-column prop="remarks" label="费用来源">
  465. <template slot-scope="scope">
  466. <span v-if="scope.row.actId == 1030">接单</span>
  467. <span v-if="scope.row.actId == 1040">提箱</span>
  468. <span v-if="scope.row.actId == 1050">装卸柜</span>
  469. <span v-if="scope.row.actId == 1060">还卸柜</span>
  470. <span v-if="scope.row.actId == 1070">回单</span>
  471. <span v-if="scope.row.actId == 1090">追加费用</span>
  472. </template>
  473. </el-table-column>
  474. <el-table-column
  475. label="操作"
  476. align="center"
  477. class-name="small-padding fixed-width"
  478. fixed="right"
  479. width="100px"
  480. >
  481. <template slot-scope="scope">
  482. <el-button
  483. size="mini"
  484. type="text"
  485. icon="el-icon-delete"
  486. :disabled="scope.row.actId != 1090||disabled"
  487. @click.native.prevent="deleteRow(scope.$index)"
  488. >删除</el-button
  489. >
  490. </template>
  491. </el-table-column>
  492. </el-table>
  493. </span>
  494. <span slot="footer" class="dialog-footer">
  495. <el-button type="primary" :disabled="disabled" @click="submitForm"
  496. >提 交</el-button
  497. >
  498. <el-button type="success" @click="submitAllowChanges">修 改</el-button>
  499. <el-button type="info" :disabled="disabled" @click="submitSave"
  500. >保 存</el-button
  501. >
  502. <el-button type="warning" :disabled="disabled" @click="submitRetreat"
  503. >撤 回</el-button
  504. >
  505. <el-button @click="showDialog = false">取 消</el-button>
  506. </span>
  507. </el-dialog>
  508. </template>
  509. <script>
  510. import { removeFtmsorderbillscars } from "@/api/fleet/ftmsorderbillscars";
  511. import { query, submit } from "@/api/track/singleCost";
  512. import { listGoods } from "@/api/basicdata/goods";
  513. import { listCorps } from "@/api/basicdata/corps";
  514. import { listFees } from "@/api/basicdata/fees";
  515. import UploadFile from "@/components/Uploadfile";
  516. import Cookies from "js-cookie";
  517. export default {
  518. name: "plans",
  519. props: {
  520. addOrUpdateVisible: {
  521. type: Boolean,
  522. default: false,
  523. },
  524. title: {
  525. type: String,
  526. required: "",
  527. },
  528. fname: Object,
  529. },
  530. components: {
  531. UploadFile,
  532. },
  533. data() {
  534. return {
  535. jFeetunitOptions: [],
  536. form: {},
  537. feesList: [],
  538. // 控制弹出框显示隐藏
  539. showDialog: false,
  540. // 表单校验
  541. rules: {
  542. corpId: [
  543. { required: true, message: "请输入客户名称", trigger: "blur" },
  544. ],
  545. billType: [
  546. { required: true, message: "请选择业务类型", trigger: "blur" },
  547. ],
  548. transType: [
  549. { required: true, message: "请选择运输方式", trigger: "blur" },
  550. ],
  551. loadAddr: [
  552. { required: true, message: "请输入提箱地点", trigger: "blur" },
  553. ],
  554. loadAttntel: [
  555. {
  556. pattern: /^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/,
  557. message: "请正确输入手机号",
  558. trigger: "blur",
  559. },
  560. ],
  561. mdLoadAttnTel: [
  562. {
  563. pattern: /^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/,
  564. message: "请正确输入手机号",
  565. trigger: "blur",
  566. },
  567. ],
  568. unLoadAttnTel: [
  569. {
  570. pattern: /^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/,
  571. message: "请正确输入手机号",
  572. trigger: "blur",
  573. },
  574. ],
  575. },
  576. billTypeList: [],
  577. transTypeList: [],
  578. transPropList: [],
  579. goodsLossTypeList: [],
  580. relevantAttachments: [],
  581. cntrIdList: [],
  582. priceTypeList: [],
  583. userType: null,
  584. username: null,
  585. collapses: [],
  586. fMblnoOptions: [],
  587. cntrId2List: [],
  588. goodsOptions: [],
  589. fWbuOptions: [],
  590. disabled:false,
  591. };
  592. },
  593. created() {
  594. this.getDicts("data_unitfees").then((response) => {
  595. if (response.data) {
  596. this.jFeetunitOptions = response.data;
  597. }
  598. });
  599. listFees().then((response) => {
  600. this.fCNameOptions = response.rows;
  601. });
  602. this.getDicts("data_billType").then((response) => {
  603. this.billTypeList = response.data;
  604. });
  605. this.getDicts("data_transType").then((response) => {
  606. this.transTypeList = response.data;
  607. });
  608. this.getDicts("data_transProp").then((response) => {
  609. this.transPropList = response.data;
  610. });
  611. this.getDicts("data_goodsLossType").then((response) => {
  612. this.goodsLossTypeList = response.data;
  613. });
  614. this.getDicts("data_cntrId").then((response) => {
  615. if (response.data) {
  616. response.data.map((e) => (e.noOption = false));
  617. this.cntrIdList = response.data;
  618. }
  619. });
  620. this.getDicts("data_priceType").then((response) => {
  621. this.priceTypeList = response.data;
  622. });
  623. listCorps().then((response) => {
  624. this.fMblnoOptions = response.rows;
  625. });
  626. listGoods().then((response) => {
  627. this.goodsOptions = response.rows;
  628. });
  629. listFees().then((response) => {
  630. this.fWbuOptions = response.rows;
  631. });
  632. this.userType = Cookies.get("userType");
  633. this.username = Cookies.get("userName");
  634. },
  635. methods: {
  636. deleteRow(index) {
  637. this.feesList.splice(index, 1);
  638. },
  639. init() {
  640. this.showDialog = true;
  641. query(this.fname.id).then((data) => {
  642. this.form = data.data;
  643. this.feesList = data.data.ftmsorderbillsfees;
  644. for (let item in this.feesList) {
  645. this.feesList[item].fFeeunitid = this.feesList[item].fFeeunitid + "";
  646. }
  647. if(this.feesList.length>=0){
  648. this.disabled=true
  649. }
  650. });
  651. },
  652. //选中时赋值pid
  653. checkPid(row) {
  654. let arr = this.schedulingList;
  655. let arr2 = arr.filter((e) => e.cntrId == row.cntrId);
  656. row["pid"] = arr2[0].id;
  657. },
  658. noMorecntrId(e) {
  659. this.cntrIdList.forEach((item) => (item.noOption = false));
  660. let arrIds = e.map((item) => item.cntrId);
  661. this.cntrIdList
  662. .filter((item) => arrIds.indexOf(item.dictValue) > -1)
  663. .forEach((item) => (item.noOption = true));
  664. },
  665. showSure(val) {
  666. let pidList = val.filter((e) => e.pid != null);
  667. let arr1 = pidList;
  668. let arr1Ids = arr1.map((item) => item.cntrId);
  669. arr1Ids = [...new Set(arr1Ids)];
  670. let arr2 = this.cntrIdList;
  671. this.cntrId2List = arr2.filter(
  672. (item) => arr1Ids.indexOf(item.dictValue) > -1
  673. );
  674. },
  675. // 新增附件上传
  676. addRelevt() {
  677. this.feesList.push({
  678. actId: "1090",
  679. fCorpid: this.form.fCorpId,
  680. fFeeid: "",
  681. fDc: "",
  682. fFeeunitid: "1",
  683. fBillingQty: 0,
  684. fUnitprice: 0,
  685. fCurrency: "RMB",
  686. fTaxrate: null,
  687. fAmount: 0,
  688. fExrate: 1,
  689. remarks: "",
  690. });
  691. },
  692. deleteplansRow(index, rows, row) {
  693. let arr = this.schedulingList;
  694. let arr2 = arr.filter((e) => e.cntrId == row.cntrId && e.cntrId != null);
  695. if (arr2.length != 0) {
  696. this.msgSuccess("调度安排已插入此箱型数据,不能删除");
  697. } else {
  698. this.cntrIdList
  699. .filter((item) => item.dictValue == row.cntrId)
  700. .forEach((item) => (item.noOption = false));
  701. rows.splice(index, 1);
  702. }
  703. },
  704. // 上传成功返回数据
  705. showFile(row) {
  706. for (let list in this.relevantAttachments) {
  707. this.$set(this.relevantAttachments[list], "attachUrl", row.url);
  708. this.$set(this.relevantAttachments[list], "attachName", row.fileName);
  709. }
  710. },
  711. // 弹出框关闭后触发
  712. handleClose() {
  713. // 子组件调用父组件方法,并传递参数
  714. this.$emit("changeShow", "false");
  715. this.cntrIdList.forEach((item) => (item.noOption = false));
  716. this.collapses = [];
  717. },
  718. /** 提交按钮 */
  719. submitForm() {
  720. this.$refs["form"].validate((valid) => {
  721. if (valid) {
  722. let formDatae = new window.FormData();
  723. formDatae.append("status", 6);
  724. formDatae.append("cars", JSON.stringify(this.form));
  725. formDatae.append("ftmsorderbillsfees", JSON.stringify(this.feesList));
  726. submit(formDatae).then((data) => {
  727. this.feesList = data.data.ftmsorderbillsfeesList;
  728. for (let item in this.feesList) {
  729. this.feesList[item].fFeeunitid =
  730. this.feesList[item].fFeeunitid + "";
  731. }
  732. this.$message.success("提交成功");
  733. this.$parent.getList();
  734. this.showDialog = false;
  735. });
  736. }
  737. });
  738. },
  739. //修改
  740. submitFix() {
  741. this.$refs["form"].validate((valid) => {
  742. if (valid) {
  743. }
  744. });
  745. },
  746. //保存
  747. submitSave() {
  748. let formDatae = new window.FormData();
  749. formDatae.append("status", 2);
  750. formDatae.append("cars", JSON.stringify(this.form));
  751. formDatae.append("ftmsorderbillsfees", JSON.stringify(this.feesList));
  752. submit(formDatae).then((data) => {
  753. this.feesList = data.data.ftmsorderbillsfeesList;
  754. for (let item in this.feesList) {
  755. this.feesList[item].fFeeunitid = this.feesList[item].fFeeunitid + "";
  756. }
  757. this.$message.success("保存成功");
  758. });
  759. },
  760. //撤回
  761. submitRetreat() {},
  762. //修改
  763. submitAllowChanges() {
  764. this.disabled = !this.disabled;
  765. },
  766. //单条订单调度提交
  767. addscarsRow(row) {},
  768. delscarsRow(index, rows, row) {
  769. if (row.billStatus != 6 && row.id != null) {
  770. removeFtmsorderbillscars(row).then((response) => {
  771. if (response.code == 200) {
  772. rows.splice(index, 1);
  773. this.msgSuccess("成功删除");
  774. }
  775. });
  776. } else {
  777. rows.splice(index, 1);
  778. }
  779. },
  780. revokescarsRow(index, rows, row) {},
  781. changescarsRow(row) {},
  782. total(row) {
  783. if (row.fBillingQty && row.fUnitprice) {
  784. console.log(row.fBillingQty);
  785. this.$set(
  786. row,
  787. "fAmount",
  788. (row.fBillingQty * row.fUnitprice).toFixed(2)
  789. );
  790. } else {
  791. this.$set(row, "fAmount", 0);
  792. }
  793. },
  794. },
  795. watch: {
  796. // 监听 addOrUpdateVisible 改变
  797. addOrUpdateVisible(oldVal, newVal) {
  798. this.showDialog = this.addOrUpdateVisible;
  799. },
  800. },
  801. };
  802. </script>