detailsPageEdit.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956
  1. <template>
  2. <div class="borderless">
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <!-- <i class="back-icon el-icon-arrow-left"></i><i style="font-style:normal">返回管理列表</i>-->
  6. <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
  7. @click="backToList">返回列表
  8. </el-button>
  9. </div>
  10. <el-button
  11. class="el-button--small-yh add-customer-btn"
  12. type="primary"
  13. :disabled="disabled"
  14. @click="editCustomer"
  15. >{{ form.id ? '确认修改' : '确认新增' }}
  16. </el-button>
  17. </div>
  18. <div style="margin-top: 60px">
  19. <el-form :model="form" ref="form" label-width="130px" class="demo-ruleForm">
  20. <containerTitle title="基础资料"></containerTitle>
  21. <basic-container style="margin-bottom: 10px">
  22. <el-row>
  23. <el-col v-for="(item,index) in basicData.column" :key="index" :span="item.span?item.span:8">
  24. <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
  25. <!-- <avue-input-tree v-if="item.prop === 'corpsTypeId'" leaf-only multiple :props="{label:'title'}" v-model="form[item.prop]" placeholder="请选择内容" type="tree" :dic="dic"-->
  26. <!-- ></avue-input-tree>-->
  27. <el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="form[item.prop]"
  28. size="small" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss"/>
  29. <el-input type="age" v-else v-model="form[item.prop]" size="small" autocomplete="off"></el-input>
  30. </el-form-item>
  31. </el-col>
  32. </el-row>
  33. </basic-container>
  34. <containerTitle title="商品信息"></containerTitle>
  35. <basic-container style="margin-bottom: 10px">
  36. <avue-crud
  37. :option="customerContact"
  38. v-model="contactsForm"
  39. :data="contactsData"
  40. ref="crudContact"
  41. @row-save="rowSave"
  42. @row-click="handleRowClick"
  43. @row-update="rowUpdate"
  44. @row-del="rowDel"
  45. >
  46. <template slot="code" slot-scope="{row,index}">
  47. <span style="float: left;padding-top: 2px">{{ row.code }}</span>
  48. <el-button type="text" size="mini" style="float: right" @click="commodityChoice(row)">选择</el-button>
  49. </template>
  50. <template slot-scope="{row,index}" slot="menu">
  51. <el-button
  52. type="text"
  53. size="small"
  54. @click="rowCell(row,index)"
  55. >{{ row.$cellEdit ? '保存' : '修改' }}
  56. </el-button>
  57. </template>
  58. <template slot="menuLeft" slot-scope="{size}">
  59. <el-button type="primary"
  60. icon="el-icon-plus"
  61. size="small"
  62. @click="commoditySelection"
  63. >新增
  64. </el-button>
  65. </template>
  66. </avue-crud>
  67. </basic-container>
  68. <containerTitle title="费用明细"></containerTitle>
  69. <basic-container style="margin-bottom: 10px">
  70. <avue-crud
  71. :option="advantageProject"
  72. v-model="advantageProjectForm"
  73. :data="advantageProjectData"
  74. ref="crudProject"
  75. @row-save="rowSaveProject"
  76. @row-update="rowUpdateProject"
  77. @row-del="rowDelProject"
  78. >
  79. <template slot="code" slot-scope="{row,index}">
  80. <span style="float: left;padding-top: 2px">{{ row.code }}</span>
  81. <el-button type="text" size="mini" style="float: right" @click="choice(row)">选择</el-button>
  82. </template>
  83. <template slot-scope="{row,index}" slot="menu">
  84. <el-button
  85. type="text"
  86. size="small"
  87. @click="rowCellTwo(row,index)"
  88. >{{ row.$cellEdit ? '保存' : '修改' }}
  89. </el-button>
  90. </template>
  91. <template slot="menuLeft" slot-scope="{size}">
  92. <el-button type="primary"
  93. icon="el-icon-plus"
  94. size="small"
  95. @click="costIncrease"
  96. >新增
  97. </el-button>
  98. </template>
  99. </avue-crud>
  100. </basic-container>
  101. <containerTitle title="附件上传"></containerTitle>
  102. <basic-container style="margin-bottom: 40px">
  103. <avue-crud
  104. :option="bankOfDeposit"
  105. v-model="bankOfDepositForm"
  106. :data="bankOfDepositData"
  107. @row-save="rowSaveBankOfDeposit"
  108. @row-update="rowUpdateBankOfDeposit"
  109. @row-del="rowDelBankOfDeposit"
  110. ></avue-crud>
  111. </basic-container>
  112. </el-form>
  113. </div>
  114. <el-dialog
  115. title="导入商品"
  116. append-to-body
  117. class="el-dialogDeep"
  118. :visible.sync="dialogVisible"
  119. width="80%"
  120. :close-on-click-modal="false"
  121. :destroy-on-close="true"
  122. :close-on-press-escape="false">
  123. <el-row style="height: 0;">
  124. <el-col :span="5">
  125. <div>
  126. <el-scrollbar>
  127. <basic-container>
  128. <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick"/>
  129. </basic-container>
  130. </el-scrollbar>
  131. </div>
  132. </el-col>
  133. <el-col :span="19">
  134. <basic-container>
  135. <avue-crud :option="optionTwo"
  136. :table-loading="loading"
  137. :data="data"
  138. ref="crud"
  139. @refresh-change="refreshChange"
  140. @selection-change="selectionChange"
  141. :page.sync="page"
  142. @on-load="onLoad"></avue-crud>
  143. </basic-container>
  144. </el-col>
  145. </el-row>
  146. <span slot="footer" class="dialog-footer">
  147. <el-button @click="dialogVisible = false">取 消</el-button>
  148. <el-button type="primary" @click="importGoods" v-if="commodityData !== true">导入</el-button>
  149. <el-button type="primary" @click="importChoice" v-if="commodityData === true"
  150. :disabled="tableData.length !== 1">导入</el-button>
  151. </span>
  152. </el-dialog>
  153. <el-dialog
  154. title="导入费用"
  155. append-to-body
  156. class="el-dialogDeep"
  157. :visible.sync="dialogCost"
  158. width="80%"
  159. :close-on-click-modal="false"
  160. :destroy-on-close="true"
  161. :close-on-press-escape="false">
  162. <el-row style="height: 0;">
  163. <el-col :span="5">
  164. <div>
  165. <el-scrollbar>
  166. <basic-container>
  167. <avue-tree :option="treeOptionCost" :data="treeData" @node-click="nodeClickCost"/>
  168. </basic-container>
  169. </el-scrollbar>
  170. </div>
  171. </el-col>
  172. <el-col :span="19">
  173. <basic-container>
  174. <avue-crud :option="optionTwoCost"
  175. :table-loading="loadingCost"
  176. :data="dataCost"
  177. ref="crud"
  178. @refresh-change="refreshChangeCost"
  179. @selection-change="selectionChangeCost"
  180. :page.sync="pageCost"
  181. @on-load="onLoadCost">
  182. </avue-crud>
  183. </basic-container>
  184. </el-col>
  185. </el-row>
  186. <span slot="footer" class="dialog-footer">
  187. <el-button @click="dialogCost = false">取 消</el-button>
  188. <el-button type="primary" @click="importCost" v-if="choiceData !== true">导入</el-button>
  189. <el-button type="primary" @click="choiceCost" v-if="choiceData === true"
  190. :disabled="tableDataCost.length !== 1">导入</el-button>
  191. </span>
  192. </el-dialog>
  193. <!-- 打印-->
  194. <el-dialog
  195. title="打印单"
  196. append-to-body
  197. class="el-dialogDeep"
  198. :visible.sync="printVisible"
  199. width="100%"
  200. fullscreen
  201. :close-on-click-modal="false"
  202. :close-on-press-escape="false">
  203. <div class="print-div">
  204. <div
  205. style="
  206. display: flex;
  207. flex-direction: column;
  208. justify-content: center;
  209. align-item: center;
  210. font-size: 24px;
  211. margin-bottom: 5px;
  212. width: 100%;
  213. text-align: center;
  214. "
  215. >
  216. <div><b>VITAL INDUSTRIAL GROUP LIMITED</b></div>
  217. <div>NO.37 DONGHAI ROAD, QINGDAO, CHINA</div>
  218. <div>TEL:0086-532-86019080 FAX:0086-532-86019080</div>
  219. <div>
  220. <b>COMMERCIAL INVOICE</b>
  221. <span style="float: right">ORIGINAL</span>
  222. </div>
  223. </div>
  224. <div class="print_table" style="display: flex">
  225. <table
  226. border="0"
  227. cellspacing="0"
  228. cellpadding="0"
  229. style="width: 100%; line-height: 30px"
  230. >
  231. <tr>
  232. <td colspan="5" rowspan="3">MESSERS:</td>
  233. <td colspan="2">INVOICE NO.</td>
  234. <td colspan="3"></td>
  235. </tr>
  236. <tr>
  237. <td colspan="2">DATE</td>
  238. <td colspan="3"></td>
  239. </tr>
  240. <tr>
  241. <td colspan="2">INCOTERM .</td>
  242. <td colspan="3"></td>
  243. </tr>
  244. <tr>
  245. <td colspan="5">PI NO.:</td>
  246. <td colspan="2">DELIVERY PORT</td>
  247. <td colspan="3"></td>
  248. </tr>
  249. <tr>
  250. <td rowspan="2">NO.</td>
  251. <td rowspan="2">DESCRIPTION</td>
  252. <td>THICK</td>
  253. <td>LENGTH</td>
  254. <td>WIDTH</td>
  255. <td rowspan="2">SHEETS</td>
  256. <td rowspan="2">CRATES</td>
  257. <td>UNIT PRICE</td>
  258. <td>TOTAL</td>
  259. <td>T. AMOUNT</td>
  260. </tr>
  261. <tr>
  262. <td>mm</td>
  263. <td>mm</td>
  264. <td>mm</td>
  265. <td>US$/M²</td>
  266. <td>M²</td>
  267. <td>US$</td>
  268. </tr>
  269. <tr>
  270. <td>1</td>
  271. <td></td>
  272. <td></td>
  273. <td></td>
  274. <td></td>
  275. <td></td>
  276. <td></td>
  277. <td></td>
  278. <td></td>
  279. <td></td>
  280. </tr>
  281. <tr>
  282. <td>2</td>
  283. <td></td>
  284. <td></td>
  285. <td></td>
  286. <td></td>
  287. <td></td>
  288. <td></td>
  289. <td></td>
  290. <td></td>
  291. <td></td>
  292. </tr>
  293. <tr>
  294. <td>3</td>
  295. <td></td>
  296. <td></td>
  297. <td></td>
  298. <td></td>
  299. <td></td>
  300. <td></td>
  301. <td></td>
  302. <td></td>
  303. <td></td>
  304. </tr>
  305. <tr>
  306. <td colspan="9" style="text-align: right">FUMIGATION COST:</td>
  307. <td></td>
  308. </tr>
  309. <tr>
  310. <td colspan="9" style="text-align: right">INSURANCE:</td>
  311. <td></td>
  312. </tr>
  313. <tr>
  314. <td colspan="9" style="text-align: right">TOTAL:</td>
  315. <td>0.00</td>
  316. </tr>
  317. </table>
  318. </div>
  319. <div class="print-footer" style="margin-top: 8px">
  320. <div style="font-weight: bold">TOTAL AMOUNT: U.S. DOLLARS NINE THOUSAND FORTY SIX CENTS TWENTY FIVE ONLY.
  321. </div>
  322. </div>
  323. </div>
  324. </el-dialog>
  325. </div>
  326. </template>
  327. <script>
  328. import {
  329. typeSave, detail, deleteDetails,
  330. corpstypeTree,
  331. corpsattn,
  332. corpsbank,
  333. corpsfiles,
  334. corpsitem,
  335. getList,
  336. getDeptLazyTreeS
  337. } from "@/api/basicData/configuration"
  338. import customerContact from "./configuration/customerContact.json"
  339. import advantageProject from "./configuration/advantageProject.json"
  340. import bankOfDeposit from "./configuration/bankOfDeposit.json"
  341. import commodity from "./configuration/commodity.json"
  342. import optionTwoCost from "./configuration/mainListCost.json"
  343. import {getDeptLazyTree, customerList} from "@/api/basicData/basicFeesDesc";
  344. export default {
  345. name: "detailsPage",
  346. data() {
  347. return {
  348. form: {},
  349. data: [],
  350. loadingCost: false,
  351. choiceData: false,
  352. commodityData: false,
  353. dataCost: [],
  354. choiceIndex: '',
  355. dialogCost: false,
  356. treeDeptId: '',
  357. treeDeptIdCost: '',
  358. pageCost: {
  359. pageSize: 10,
  360. currentPage: 1,
  361. total: 0
  362. },
  363. page: {
  364. pageSize: 10,
  365. currentPage: 1,
  366. total: 0
  367. },
  368. loading: false,
  369. contactsForm: {},
  370. optionTwo: commodity,
  371. optionTwoCost: optionTwoCost,
  372. treeOptionCost: {
  373. nodeKey: 'id',
  374. lazy: true,
  375. treeLoad: function (node, resolve) {
  376. const parentId = (node.level === 0) ? 0 : node.data.id;
  377. getDeptLazyTree(parentId).then(res => {
  378. resolve(res.data.data.map(item => {
  379. return {
  380. ...item,
  381. leaf: !item.hasChildren
  382. }
  383. }))
  384. });
  385. },
  386. addBtn: false,
  387. menu: false,
  388. size: 'small',
  389. props: {
  390. labelText: '标题',
  391. label: 'title',
  392. value: 'value',
  393. children: 'children'
  394. }
  395. },
  396. treeOption: {
  397. nodeKey: 'id',
  398. lazy: true,
  399. treeLoad: function (node, resolve) {
  400. const parentId = (node.level === 0) ? 0 : node.data.id;
  401. getDeptLazyTreeS(parentId).then(res => {
  402. console.log(res.data.data)
  403. resolve(res.data.data.map(item => {
  404. return {
  405. ...item,
  406. leaf: !item.hasChildren
  407. }
  408. }))
  409. });
  410. },
  411. addBtn: false,
  412. menu: false,
  413. size: 'small',
  414. props: {
  415. labelText: '标题',
  416. label: 'title',
  417. value: 'value',
  418. children: 'children'
  419. }
  420. },
  421. dialogVisible: false,
  422. advantageProjectForm: {},
  423. bankOfDepositForm: {},
  424. contactsData: [],
  425. advantageProjectData: [],
  426. disabled: false,
  427. bankOfDepositData: [],
  428. tableDataCost: [],
  429. dic: [],
  430. tableData: [],
  431. customerContact: customerContact,
  432. advantageProject: advantageProject,
  433. bankOfDeposit: bankOfDeposit,
  434. basicData: {
  435. column: [
  436. {
  437. label: '系统编号',
  438. prop: 'orderNo',
  439. rules: [
  440. {
  441. required: true,
  442. message: ' ',
  443. trigger: 'blur'
  444. }
  445. ]
  446. }, {
  447. label: '来源单号',
  448. prop: 'morderNo',
  449. rules: [
  450. {
  451. required: true,
  452. message: ' ',
  453. trigger: 'blur'
  454. }
  455. ]
  456. }, {
  457. label: ' 银行账号',
  458. prop: 'shippingAddress',
  459. rules: [
  460. {
  461. required: true,
  462. message: ' ',
  463. trigger: 'blur'
  464. }
  465. ]
  466. }, {
  467. label: '供应商',
  468. prop: 'arrivalAddress',
  469. rules: [
  470. {
  471. required: true,
  472. message: ' ',
  473. trigger: 'blur'
  474. }
  475. ]
  476. }, {
  477. label: '付款方式',
  478. prop: 'paymentType',
  479. rules: [
  480. {
  481. required: true,
  482. message: ' ',
  483. trigger: 'blur'
  484. }
  485. ]
  486. }, {
  487. label: '公司户头',
  488. prop: 'packageRemarks',
  489. rules: [
  490. {
  491. required: true,
  492. message: ' ',
  493. trigger: 'blur'
  494. }
  495. ]
  496. }, {
  497. label: '包装要求',
  498. prop: 'packageRemarks',
  499. rules: [
  500. {
  501. required: true,
  502. message: ' ',
  503. trigger: 'blur'
  504. }
  505. ]
  506. }, {
  507. label: '运费',
  508. prop: 'banks',
  509. rules: [
  510. {
  511. required: true,
  512. message: ' ',
  513. trigger: 'blur'
  514. }
  515. ]
  516. }, {
  517. label: '要求到货日期',
  518. prop: 'requiredDeliveryDate',
  519. type: 'datetime',
  520. rules: [
  521. {
  522. required: true,
  523. message: ' ',
  524. trigger: 'blur'
  525. }
  526. ]
  527. },{
  528. label: "备注",
  529. span: 24,
  530. prop: "orderRemark",
  531. mock: {
  532. type: 'county'
  533. }
  534. }
  535. ]
  536. }
  537. }
  538. },
  539. //初始化查询
  540. created() {
  541. if (this.$route.query.id) {
  542. let id = this.$route.query.id.replace(/\"/g, "")
  543. detail(id).then(res => {
  544. console.log(res.data.data)
  545. this.form = res.data.data;
  546. this.contactsData = this.form.orderItemsList
  547. this.advantageProjectData = this.form.orderFeesList
  548. this.bankOfDepositData = this.form.orderFilesList
  549. delete this.form.orderItemsList
  550. delete this.form.orderFeesList
  551. delete this.form.orderFilesList
  552. });
  553. }
  554. },
  555. watch: {
  556. '$route'(to, from) {
  557. console.log(to, from);
  558. if (this.$route.query.id) {
  559. let id = JSON.parse(this.$route.query.id).replace(/\"/g, "")
  560. detail(id).then(res => {
  561. console.log(res.data.data)
  562. this.form = res.data.data;
  563. });
  564. } else {
  565. this.form = {}
  566. }
  567. }
  568. },
  569. methods: {
  570. //点击行可编辑
  571. handleRowClick(row, event, column) {
  572. console.log(row.$index)
  573. },
  574. //商品编辑
  575. rowCell(row, index) {
  576. console.log(row)
  577. this.$refs.crudContact.rowCell(row, index)
  578. },
  579. //费用编辑
  580. rowCellTwo(row, index) {
  581. console.log(row)
  582. this.$refs.crudProject.rowCell(row, index)
  583. },
  584. //费用新增触发
  585. costIncrease() {
  586. this.dialogCost = !this.dialogCost
  587. this.choiceData = false
  588. },
  589. //商品新增触发
  590. commoditySelection() {
  591. this.dialogVisible = !this.dialogVisible
  592. this.commodityData = false
  593. },
  594. //点击费用明细选择触发
  595. choice(row) {
  596. this.dialogCost = !this.dialogCost
  597. this.choiceData = true
  598. console.log(row)
  599. this.choiceIndex = row.$index
  600. },
  601. //点击商品明细选择触发
  602. commodityChoice(row) {
  603. this.dialogVisible = !this.dialogVisible
  604. this.commodityData = true
  605. console.log(row)
  606. this.choiceIndexT = row.$index
  607. },
  608. //导入商品触发
  609. importChoice() {
  610. if (this.tableData.length === 1) {
  611. this.contactsData[this.choiceIndexT].cname = this.tableData[0].cname
  612. this.contactsData[this.choiceIndexT].code = this.tableData[0].code
  613. this.contactsData[this.choiceIndexT].typeno = this.tableData[0].typeno
  614. this.contactsData[this.choiceIndexT].specificationAndModel = this.tableData[0].specificationAndModel
  615. this.contactsData[this.choiceIndexT].itemId = this.tableData[0].id
  616. }
  617. this.dialogVisible = !this.dialogVisible
  618. this.commodityData = false
  619. },
  620. //费用编辑导入触发
  621. choiceCost() {
  622. console.log('1111')
  623. if (this.tableDataCost.length === 1) {
  624. this.advantageProjectData[this.choiceIndex].feeName = this.tableDataCost[0].cname
  625. this.advantageProjectData[this.choiceIndex].itemId = this.tableDataCost[0].id
  626. this.advantageProjectData[this.choiceIndex].code = this.tableDataCost[0].code
  627. }
  628. this.dialogCost = !this.dialogCost
  629. this.choiceData = false
  630. },
  631. //费用导入触发
  632. importCost() {
  633. console.log('111111')
  634. // this.advantageProjectForm = this.advantageProjectForm.concat(this.tableDataCost)
  635. if (this.tableDataCost.length > 0) {
  636. for (let item in this.tableDataCost) {
  637. console.log(this.tableDataCost[item])
  638. this.tableDataCost[item].itemId = this.tableDataCost[item].id
  639. this.tableDataCost[item].feeName = this.tableDataCost[item].cname
  640. delete this.tableDataCost[item].id
  641. this.$refs.crudProject.rowCellAdd(this.tableDataCost[item]);
  642. this.$refs.crudProject.rowCell(this.tableDataCost[item], this.advantageProjectForm.length - 1)
  643. }
  644. }
  645. this.tableDataCost = []
  646. this.dialogCost = false
  647. },
  648. //确认导入触发
  649. importGoods() {
  650. // this.contactsData = this.contactsData.concat(this.tableData)
  651. if (this.tableData.length > 0) {
  652. for (let item in this.tableData) {
  653. console.log(this.tableData[item])
  654. this.tableData[item].itemId = this.tableData[item].id
  655. delete this.tableData[item].id
  656. this.$refs.crudContact.rowCellAdd(this.tableData[item]);
  657. this.$refs.crudContact.rowCell(this.tableData[item], this.contactsData.length - 1)
  658. }
  659. }
  660. this.tableData = []
  661. this.dialogVisible = false
  662. },
  663. //选中触发
  664. selectionChange(list) {
  665. console.log(list);
  666. this.tableData = list
  667. },
  668. //费用选中触发
  669. selectionChangeCost(list) {
  670. console.log(list);
  671. this.tableDataCost = list
  672. },
  673. //导入页左商品类型查询
  674. nodeClick(data) {
  675. this.treeDeptId = data.id;
  676. this.page.currentPage = 1;
  677. this.onLoad(this.page);
  678. },
  679. //导入页左费用类型查询
  680. nodeClickCost(data) {
  681. this.treeDeptIdCost = data.id;
  682. this.pageCost.currentPage = 1;
  683. this.onLoadCost(this.pageCost);
  684. },
  685. //刷新触发
  686. refreshChange() {
  687. this.treeDeptId = '';
  688. this.page.currentPage = 1;
  689. this.onLoad(this.page);
  690. },
  691. //费用刷新触发
  692. refreshChangeCost() {
  693. this.treeDeptIdCost = '';
  694. this.pageCost.currentPage = 1;
  695. this.onLoadCost(this.pageCost);
  696. },
  697. //新增商品信息保存触发
  698. rowSave(row, done, loading) {
  699. console.log(row)
  700. console.log(this.contactsData)
  701. // this.contactsData.push(row)
  702. done()
  703. },
  704. //修改商品信息触发
  705. rowUpdate(row, index, done, loading) {
  706. done(row);
  707. },
  708. //删除商品信息触发
  709. rowDel(row, index, donerowDel) {
  710. this.$confirm("确定将选择数据删除?", {
  711. confirmButtonText: "确定",
  712. cancelButtonText: "取消",
  713. type: "warning"
  714. }).then(() => {
  715. //商品判断是否需要调用删除接口
  716. if (row.id) {
  717. corpsattn(row.id).then(res => {
  718. this.$message({
  719. type: "success",
  720. message: "操作成功!"
  721. });
  722. this.contactsData.splice(index, 1);
  723. })
  724. } else {
  725. this.$message({
  726. type: "success",
  727. message: "操作成功!"
  728. });
  729. this.contactsData.splice(index, 1);
  730. }
  731. })
  732. },
  733. //新增费用明细保存触发
  734. rowSaveProject(row, done, loading) {
  735. // this.advantageProjectData.push(row)
  736. done()
  737. },
  738. //修改费用明细触发
  739. rowUpdateProject(row, index, done, loading) {
  740. done(row);
  741. },
  742. //商品列表查询
  743. onLoad(page, params = {}) {
  744. this.loading = true;
  745. getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => {
  746. console.log(res)
  747. const data = res.data.data;
  748. this.page.total = data.total;
  749. this.data = data.records;
  750. this.loading = false;
  751. });
  752. },
  753. //费用查询
  754. onLoadCost(page, params = {}) {
  755. this.loadingCost = true;
  756. let queryParams = Object.assign({}, params, {
  757. pageSize: page.pageSize,
  758. pageNum: page.currentPage,
  759. parentId: 0,
  760. feesTypeId: this.treeDeptIdCost
  761. })
  762. customerList(queryParams).then(res => {
  763. console.log(res)
  764. const data = res.data.data;
  765. this.pageCost.total = data.total;
  766. this.dataCost = data.records;
  767. this.loadingCost = false;
  768. });
  769. },
  770. //删除费用明细触发
  771. rowDelProject(row, index, donerowDel) {
  772. this.$confirm("确定将选择数据删除?", {
  773. confirmButtonText: "确定",
  774. cancelButtonText: "取消",
  775. type: "warning"
  776. }).then(() => {
  777. //费用判断是否需要调用删除接口
  778. if (row.id) {
  779. corpsitem(row.id).then(res => {
  780. this.$message({
  781. type: "success",
  782. message: "操作成功!"
  783. });
  784. this.advantageProjectData.splice(index, 1);
  785. })
  786. } else {
  787. this.$message({
  788. type: "success",
  789. message: "操作成功!"
  790. });
  791. this.advantageProjectData.splice(index, 1);
  792. }
  793. })
  794. },
  795. //新增附件上传保存触发
  796. rowSaveBankOfDeposit(row, done, loading) {
  797. this.bankOfDepositData.push(row)
  798. done()
  799. },
  800. //修改附件上传触发
  801. rowUpdateBankOfDeposit(row, index, done, loading) {
  802. done(row);
  803. },
  804. //删除附件上传触发
  805. rowDelBankOfDeposit(row, index, donerowDel) {
  806. this.$confirm("确定将选择数据删除?", {
  807. confirmButtonText: "确定",
  808. cancelButtonText: "取消",
  809. type: "warning"
  810. }).then(() => {
  811. //附件判断是否需要调用删除接口
  812. if (row.id) {
  813. corpsbank(row.id).then(res => {
  814. this.$message({
  815. type: "success",
  816. message: "操作成功!"
  817. });
  818. this.bankOfDepositData.splice(index, 1);
  819. })
  820. } else {
  821. this.$message({
  822. type: "success",
  823. message: "操作成功!"
  824. });
  825. this.bankOfDepositData.splice(index, 1);
  826. }
  827. })
  828. },
  829. //修改提交触发
  830. editCustomer() {
  831. console.log(this.form)
  832. this.$refs["form"].validate((valid) => {
  833. if (valid) {
  834. //商品信息
  835. this.form.orderItemsList = this.contactsData
  836. this.form.orderFeesList = this.advantageProjectData
  837. this.form.orderFilesList = this.bankOfDepositData
  838. if (typeof this.form.corpsTypeId == 'object') {
  839. this.form.corpsTypeId = this.form.corpsTypeId.join(",")
  840. }
  841. this.disabled = true
  842. this.form.billType = 'CG'
  843. typeSave(this.form).then(res => {
  844. this.$message({type: "success", message: this.form.id ? "修改成功!" : "新增成功!"});
  845. //成功关闭此页面回到列表页
  846. this.backToList()
  847. })
  848. } else {
  849. return false;
  850. }
  851. });
  852. },
  853. //返回列表
  854. backToList() {
  855. this.$router.$avueRouter.closeTag();
  856. this.$router.push({
  857. path: '/businessManagement/purchaseOrder/index',
  858. query: {}
  859. });
  860. }
  861. }
  862. }
  863. </script>
  864. <style lang="scss" scoped>
  865. .customer-head {
  866. position: fixed;
  867. top: 105px;
  868. width: 100%;
  869. margin-left: -10px;
  870. height: 62px;
  871. background: #ffffff;
  872. box-shadow: 0 4px 12px 0px rgba(232, 232, 235, 1);
  873. z-index: 999;
  874. /* display: flex;
  875. justify-content: left; */
  876. }
  877. .customer-back {
  878. cursor: pointer;
  879. line-height: 62px;
  880. font-size: 16px;
  881. color: #323233;
  882. font-weight: 400;
  883. }
  884. .back-icon {
  885. line-height: 64px;
  886. font-size: 20px;
  887. margin-right: 8px;
  888. }
  889. .add-customer-btn {
  890. position: fixed;
  891. right: 36px;
  892. top: 115px;
  893. }
  894. ::v-deep .el-form-item {
  895. margin-bottom: 0;
  896. }
  897. .el-dialogDeep {
  898. ::v-deep .el-dialog {
  899. margin: 1vh auto 0 !important;
  900. padding-bottom: 10px !important;
  901. .el-dialog__body, .el-dialog__footer {
  902. padding-bottom: 0 !important;
  903. padding-top: 0 !important;
  904. }
  905. }
  906. }
  907. .print-div {
  908. color: #000;
  909. }
  910. .print_table {
  911. table {
  912. border-right: 1px solid #000;
  913. border-bottom: 1px solid #000;
  914. font-size: 12px;
  915. margin-bottom: 5px;
  916. }
  917. table td {
  918. border-left: 1px solid #000;
  919. border-top: 1px solid #000;
  920. vertical-align: middle;
  921. padding: 2px;
  922. text-align: center;
  923. }
  924. }
  925. .table {
  926. border-collapse: collapse;
  927. border-spacing: 0;
  928. background-color: transparent;
  929. display: table;
  930. width: 99%;
  931. max-width: 100%;
  932. margin: 0 auto;
  933. }
  934. .table td {
  935. text-align: left;
  936. vertical-align: middle;
  937. font-size: 14px;
  938. color: #000000;
  939. padding: 10.5px 0 10.5px 30px;
  940. //border: 1px solid #000;
  941. }
  942. </style>